Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
# Version 18.1.0

## Features

### PHP 8.4 Compatibility

* Update dependencies
* Add PHP 8.4 support
* Replace abandoned `swiftmailer/swiftmailer` with `symfony/mailer`

# Version 18.0.0

### PHP 8.1 Compatibility
Expand Down
26 changes: 13 additions & 13 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,22 @@
"license": "MIT",
"require": {
"php": "^8.1",
"psr/log": "^1.0.0|^2.0.0|^3.0.0",
"psr/cache" : "^2.0.0|^3.0.0",
"psr/log": "^1.0|^2.0|^3.0",
"psr/cache" : "^2.0|^3.0",
"psr/container": "^1.1.2",
"handcraftedinthealps/goodby-csv": "^1.4.2",
"handcraftedinthealps/goodby-csv": "^1.4",
"monolog/monolog": "^2.9|^3.7",
"league/event": "^2.2.0",
"league/event": "^2.2",
"ramsey/uuid": "^4.2|^4.7",
"swiftmailer/swiftmailer": "v6.3.0",
"laminas/laminas-filter": "^2.31.0",
"techdivision/import-dbal": "^2.0.0",
"techdivision/import-dbal-collection": "^2.0.0",
"techdivision/import-cache": "^2.0.0",
"techdivision/import-cache-collection": "^2.0.0",
"techdivision/import-serializer": "^2.0.0",
"techdivision/import-serializer-csv": "^2.0.0",
"techdivision/import-configuration": "^6.0.0.",
"symfony/mailer": "^5.4|^6.4",
"laminas/laminas-filter": "^2.31",
"techdivision/import-dbal": "^2.0",
"techdivision/import-dbal-collection": "^2.1",
"techdivision/import-cache": "^2.0",
"techdivision/import-cache-collection": "^2.0",
"techdivision/import-serializer": "^2.1",
"techdivision/import-serializer-csv": "^2.1",
"techdivision/import-configuration": "^6.1",
"ext-json": "*",
"ext-zip": "*"
},
Expand Down
2 changes: 1 addition & 1 deletion src/Adapter/Goodby/Lexer.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class Lexer implements LexerInterface
*
* @param \Goodby\CSV\Import\Standard\LexerConfig $config The lexer configuration
*/
public function __construct(LexerConfig $config = null)
public function __construct(?LexerConfig $config = null)
{

// query whether or not a configuration has been passed
Expand Down
4 changes: 2 additions & 2 deletions src/Adapter/SerializerAwareAdapterInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function explode($value = null, $delimiter = null);
*
* @return string|null The compatected value
*/
public function implode(array $value = null, $delimiter = null);
public function implode(?array $value = null, $delimiter = null);

/**
* Serializes the elements of the passed array.
Expand All @@ -57,7 +57,7 @@ public function implode(array $value = null, $delimiter = null);
*
* @return string The serialized array
*/
public function serialize(array $unserialized = null);
public function serialize(?array $unserialized = null);

/**
* Unserializes the elements of the passed string.
Expand Down
4 changes: 2 additions & 2 deletions src/Adapter/SerializerTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public function explode($value = null, $delimiter = null)
*
* @return string|null The compatected value
*/
public function implode(array $value = null, $delimiter = null)
public function implode(?array $value = null, $delimiter = null)
{
return $this->getSerializer()->implode($value, $delimiter);
}
Expand All @@ -93,7 +93,7 @@ public function implode(array $value = null, $delimiter = null)
*
* @return string The serialized array
*/
public function serialize(array $unserialized = null, $delimiter = null)
public function serialize(?array $unserialized = null, $delimiter = null)
{
return $this->getSerializer()->serialize($unserialized, $delimiter);
}
Expand Down
4 changes: 2 additions & 2 deletions src/Callbacks/AbstractBooleanCallback.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ abstract class AbstractBooleanCallback extends AbstractCallback
*
* @return mixed The modified value
*/
public function handle(AttributeCodeAndValueAwareObserverInterface $observer = null)
public function handle(?AttributeCodeAndValueAwareObserverInterface $observer = null)
{

// set the observer
Expand Down Expand Up @@ -100,7 +100,7 @@ public function handle(AttributeCodeAndValueAwareObserverInterface $observer = n
// return NULL, if NO value can be mapped to a boolean representation
return;
}

// throw an exception if the attribute is not available
throw new \Exception(
$this->appendExceptionSuffix(
Expand Down
15 changes: 8 additions & 7 deletions src/Callbacks/AbstractCallback.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

namespace TechDivision\Import\Callbacks;

use Exception;
use TechDivision\Import\Observers\ObserverInterface;

/**
Expand Down Expand Up @@ -108,14 +109,14 @@ protected function appendExceptionSuffix($message = null, $filename = null, $lin
* line number and column name and use it for a detailed exception message.
*
* @param string $columnName The column name that should be resolved
* @param \Exception $parent The exception we want to wrap
* @param Exception|null $parent The exception we want to wrap
* @param string $className The class name of the exception type we want to wrap the parent one
*
* @return \Exception the wrapped exception
* @return Exception the wrapped exception
*/
protected function wrapException(
$columnName,
\Exception $parent = null,
?Exception $parent = null,
$className = '\TechDivision\Import\Exceptions\WrappedColumnException'
) {
return $this->getSubject()->wrapException($columnName, $parent, $className);
Expand All @@ -130,7 +131,7 @@ protected function isDebugMode()
{
return $this->getSubject()->isDebugMode();
}

/**
* Queries whether or not strict mode is enabled or not, default is True.
* Backward compatibility
Expand Down Expand Up @@ -181,7 +182,7 @@ protected function mergeAttributesRecursive(array $status)
*
* @return mixed|null The, almost formatted, value
*/
protected function getValue($name, $default = null, callable $callback = null)
protected function getValue($name, $default = null, ?callable $callback = null)
{
return $this->getSubject()->getValue($name, $default, $callback);
}
Expand All @@ -192,7 +193,7 @@ protected function getValue($name, $default = null, callable $callback = null)
* @param string $storeViewCode The store view code to return the store ID for
*
* @return integer The ID of the store with the passed ID
* @throws \Exception Is thrown, if the store with the actual code is not available
* @throws Exception Is thrown, if the store with the actual code is not available
*/
protected function getStoreId($storeViewCode)
{
Expand All @@ -206,7 +207,7 @@ protected function getStoreId($storeViewCode)
* @param string|null $default The default store view code to use, if no store view code is set in the CSV file
*
* @return integer The ID of the actual store
* @throws \Exception Is thrown, if the store with the actual code is not available
* @throws Exception Is thrown, if the store with the actual code is not available
*/
protected function getRowStoreId($default = null)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Callbacks/AbstractMultiselectCallback.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ abstract class AbstractMultiselectCallback extends AbstractEavAwareCallback
*
* @return mixed The modified value
*/
public function handle(AttributeCodeAndValueAwareObserverInterface $observer = null)
public function handle(?AttributeCodeAndValueAwareObserverInterface $observer = null)
{

// set the observer
Expand Down
4 changes: 2 additions & 2 deletions src/Callbacks/AbstractSelectCallback.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ abstract class AbstractSelectCallback extends AbstractEavAwareCallback
*
* @return mixed The modified value
*/
public function handle(AttributeCodeAndValueAwareObserverInterface $observer = null)
public function handle(?AttributeCodeAndValueAwareObserverInterface $observer = null)
{

// set the observer
Expand Down Expand Up @@ -100,7 +100,7 @@ public function handle(AttributeCodeAndValueAwareObserverInterface $observer = n
// return NULL, if the value can't be mapped to an option
return;
}

// throw an exception if the attribute is NOT
// available and we're in strict mode
throw new \Exception(
Expand Down
4 changes: 2 additions & 2 deletions src/Exceptions/InvalidDataException.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ class InvalidDataException extends \Exception
*
* @param string $message [optional] The Exception message to throw.
* @param int $code [optional] The Exception code.
* @param null|Throwable $previous [optional] The previous throwable used for the exception chaining.
* @param Throwable|null $previous [optional] The previous throwable used for the exception chaining.
*/
public function __construct($message = "", $code = self::INVALID_DATA_CODE, Throwable $previous = null)
public function __construct($message = "", $code = self::INVALID_DATA_CODE, ?Throwable $previous = null)
{
parent::__construct($message, $code, $previous);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Exceptions/MissingFileException.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class MissingFileException extends \Exception
* @param int $code [optional] The Exception code.
* @param null|Throwable $previous [optional] The previous throwable used for the exception chaining.
*/
public function __construct($message = "", $code = self::NOT_FOUND_CODE, Throwable $previous = null)
public function __construct($message = "", $code = self::NOT_FOUND_CODE, ?Throwable $previous = null)
{
parent::__construct($message, $code, $previous);
}
Expand Down
15 changes: 9 additions & 6 deletions src/Execution/ConfigurationManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,15 @@ public function getOperations()
if ($shortcut = $configuration->getShortcut()) {
// load the entity type code and map it to the Magento edition
$magentoEdition = $this->mapEntityTypeToMagentoEdition($entityTypeCode);
// load the operation names from the shorcuts
foreach ($shortcuts[$magentoEdition][$entityTypeCode] as $shortcutName => $opNames) {
// query whether or not the operation has to be executed or not
if ($shortcutName === $shortcut) {
foreach ($opNames as $opName) {
$configuration->addOperationName($opName);
// load the operation names from the shortcuts if available
if (isset($shortcuts[$magentoEdition], $shortcuts[$magentoEdition][$entityTypeCode])
&& is_array($shortcuts[$magentoEdition][$entityTypeCode])) {
foreach ($shortcuts[$magentoEdition][$entityTypeCode] as $shortcutName => $opNames) {
// query whether or not the operation has to be executed or not
if ($shortcutName === $shortcut) {
foreach ($opNames as $opName) {
$configuration->addOperationName($opName);
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Handlers/OkFileHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class OkFileHandler implements OkFileHandlerInterface
*
* @param \TechDivision\Import\Handlers\GenericFileHandlerInterface|null $genericFileHandler The generic file handler instance
*/
public function __construct(GenericFileHandlerInterface $genericFileHandler = null)
public function __construct(?GenericFileHandlerInterface $genericFileHandler = null)
{
$this->genericFileHandler = $genericFileHandler ?? new GenericFileHandler();
}
Expand Down
2 changes: 1 addition & 1 deletion src/Handlers/OkFileHandlerFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ protected function getLoaderFactory() : LoaderFactoryInterface
*
* @return \TechDivision\Import\Handlers\HandlerInterface|null The new handler instance
*/
public function createHandler(SubjectConfigurationInterface $subject = null) : HandlerInterface
public function createHandler(?SubjectConfigurationInterface $subject = null) : HandlerInterface
{

// load the proposed .OK file loader
Expand Down
4 changes: 2 additions & 2 deletions src/Handlers/PidFileHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,12 @@ class PidFileHandler implements PidFileHandlerInterface
*
* @param \TechDivision\Import\Configuration\ConfigurationInterface $configuration The actual configuration instance
* @param \TechDivision\Import\Handlers\GenericFileHandlerInterface $genericFileHandler The actual file handler instance
* @param \Doctrine\Common\Collections\Collection $systemLoggers The array with the system logger instances
* @param \Doctrine\Common\Collections\Collection|null $systemLoggers The array with the system logger instances
*/
public function __construct(
ConfigurationInterface $configuration,
GenericFileHandlerInterface $genericFileHandler,
Collection $systemLoggers = null
?Collection $systemLoggers = null
) {
$this->configuration = $configuration;
$this->genericFileHandler = $genericFileHandler;
Expand Down
4 changes: 2 additions & 2 deletions src/Interfaces/PregMatchAwareInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public function addMatches(array $matches) : void;
*
* @return bool TRUE if the match with the passed name and key is available, else FALSE
*/
public function hasMatch(string $name, string $key = null) : bool;
public function hasMatch(string $name, ?string $key = null) : bool;

/**
* Return's the value of the key with the passed name out of the matches
Expand All @@ -77,5 +77,5 @@ public function hasMatch(string $name, string $key = null) : bool;
* @return string The match itself
* @throws \InvalidArgumentException Is thrown the value of the match with the passed name and key is not available
*/
public function getMatch(string $name, string $key = null) : string;
public function getMatch(string $name, ?string $key = null) : string;
}
2 changes: 1 addition & 1 deletion src/Listeners/ArchiveListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ protected function getConfiguration()
*
* @return void
*/
public function handle(EventInterface $event, ApplicationInterface $application = null)
public function handle(EventInterface $event, ?ApplicationInterface $application = null)
{

// query whether or not, the import artefacts have to be archived
Expand Down
4 changes: 2 additions & 2 deletions src/Listeners/CacheUrlRewriteListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,12 @@ public function getKey()
* Handle the event.
*
* @param \League\Event\EventInterface $event The event that triggered the listener
* @param \TechDivision\Import\Dbal\Actions\CachedActionInterface $action The action instance that triggered the event
* @param \TechDivision\Import\Dbal\Actions\CachedActionInterface|null $action The action instance that triggered the event
* @param array $row The row to be cached
*
* @return void
*/
public function handle(EventInterface $event, CachedActionInterface $action = null, array $row = array())
public function handle(EventInterface $event, ?CachedActionInterface $action = null, array $row = array())
{

// prepare the unique cache key for the EAV attribute option value
Expand Down
2 changes: 1 addition & 1 deletion src/Listeners/ClearDirectoriesListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public function __construct(
*
* @return void
*/
public function handle(EventInterface $event, ApplicationInterface $application = null)
public function handle(EventInterface $event, ?ApplicationInterface $application = null)
{

// clear the filecache
Expand Down
2 changes: 1 addition & 1 deletion src/Listeners/ImportHistoryListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ protected function loadAdminUserByUsername($username)
*
* @return void
*/
public function handle(EventInterface $event, ApplicationInterface $application = null)
public function handle(EventInterface $event, ?ApplicationInterface $application = null)
{

// load the registry processor
Expand Down
3 changes: 1 addition & 2 deletions src/Listeners/InvalidDataListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,8 @@ public function __construct(RegistryProcessorInterface $registryProcessor)
* @param ApplicationInterface|null $application The application instance
*
* @return void
* @throws \TechDivision\Import\Exceptions\MissingFileException
*/
public function handle(EventInterface $event, ApplicationInterface $application = null)
public function handle(EventInterface $event, ?ApplicationInterface $application = null)
{
// load the validations from the registry
$noStrictValidations = $this->getRegistryProcessor()->getAttribute(RegistryKeys::NO_STRICT_VALIDATIONS);
Expand Down
2 changes: 1 addition & 1 deletion src/Listeners/MissingFilesListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public function __construct(RegistryProcessorInterface $registryProcessor, $noFi
* @return void
* @throws \TechDivision\Import\Exceptions\MissingFileException
*/
public function handle(EventInterface $event, ApplicationInterface $application = null)
public function handle(EventInterface $event, ?ApplicationInterface $application = null)
{

// load the validations from the registry
Expand Down
4 changes: 2 additions & 2 deletions src/Listeners/PrepareDebugDumpListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,11 @@ private function getConfiguration() : ConfigurationInterface
* Handle the event.
*
* @param \League\Event\EventInterface $event The event that triggered the listener
* @param \TechDivision\Import\ApplicationInterface $application The application instance
* @param \TechDivision\Import\ApplicationInterface|null $application The application instance
*
* @return void
*/
public function handle(EventInterface $event, ApplicationInterface $application = null)
public function handle(EventInterface $event, ?ApplicationInterface $application = null)
{
if ($this->getConfiguration()->isDebugMode()) {
$this->getDebugUtil()->prepareDump($application->getSerial());
Expand Down
2 changes: 1 addition & 1 deletion src/Listeners/RenderAnsiArtListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class RenderAnsiArtListener extends AbstractListener
*
* @return void
*/
public function handle(EventInterface $event, ApplicationInterface $application = null)
public function handle(EventInterface $event, ?ApplicationInterface $application = null)
{

// write the TechDivision ANSI art icon to the console
Expand Down
2 changes: 1 addition & 1 deletion src/Listeners/RenderDebugInfoListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public function __construct(ConfigurationInterface $configuration)
*
* @return void
*/
public function handle(EventInterface $event, ApplicationInterface $application = null)
public function handle(EventInterface $event, ?ApplicationInterface $application = null)
{

// abort if the application instance is not available
Expand Down
2 changes: 1 addition & 1 deletion src/Listeners/RenderOperationInfoListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public function __construct(ConfigurationInterface $configuration)
*
* @return void
*/
public function handle(EventInterface $event, ApplicationInterface $application = null)
public function handle(EventInterface $event, ?ApplicationInterface $application = null)
{

// write a warning for low performance, if XDebug extension is activated
Expand Down
Loading
Loading