From b5f3d0f82627aeef04532671635217b00c798c8f Mon Sep 17 00:00:00 2001 From: guvra Date: Tue, 7 Jan 2025 12:51:25 +0100 Subject: [PATCH] Add final classes (#148) --- src/AppKernel.php | 2 +- src/Config/Compiler/Compiler.php | 2 +- .../Processor/DumpOutputProcessor.php | 2 +- .../Compiler/Processor/EnvVarProcessor.php | 2 +- .../Version/InvalidVersionException.php | 2 +- .../Version/MissingVersionException.php | 2 +- .../Processor/Version/VersionCondition.php | 2 +- .../Processor/Version/VersionMatcher.php | 2 +- .../Compiler/Processor/VersionProcessor.php | 2 +- src/Config/Config.php | 2 +- src/Config/Loader/ConfigLoader.php | 2 +- src/Config/Loader/FileLocator.php | 2 +- src/Config/Loader/FileNotFoundException.php | 2 +- src/Config/Loader/ParseException.php | 2 +- src/Config/Validator/JsonSchemaValidator.php | 2 +- src/Config/Validator/ValidationException.php | 2 +- src/Config/Validator/ValidationResult.php | 2 +- src/Console/Application.php | 2 +- src/Console/Command/CompileCommand.php | 2 +- src/Console/Command/DumpCommand.php | 2 +- src/Console/Helper/DumpInfo.php | 6 +- .../Anonymizer/AnonymizeDateTime.php | 2 +- src/Converter/Anonymizer/AnonymizeEmail.php | 2 +- src/Converter/Anonymizer/AnonymizeNumber.php | 2 +- src/Converter/ConditionBuilder.php | 2 +- src/Converter/ConverterBuilder.php | 2 +- src/Converter/ConverterFactory.php | 2 +- src/Converter/Generator/NumberBetween.php | 2 +- src/Converter/Generator/RandomDateTime.php | 2 +- src/Converter/Generator/RandomEmail.php | 2 +- src/Converter/Generator/SetNull.php | 2 +- src/Converter/Generator/SetValue.php | 2 +- src/Converter/Parameters/InputParameters.php | 2 +- src/Converter/Parameters/Parameter.php | 2 +- .../Parameters/ParameterProcessor.php | 2 +- .../Parameters/ValidationException.php | 2 +- src/Converter/Proxy/Cache.php | 2 +- src/Converter/Proxy/Chain.php | 2 +- src/Converter/Proxy/Conditional.php | 2 +- src/Converter/Proxy/Faker.php | 2 +- src/Converter/Proxy/FromContext.php | 2 +- src/Converter/Proxy/JsonData.php | 2 +- src/Converter/Proxy/SerializedData.php | 2 +- src/Converter/Proxy/Unique.php | 2 +- src/Converter/Randomizer/RandomizeEmail.php | 2 +- src/Converter/Randomizer/RandomizeNumber.php | 2 +- src/Converter/Transformer/AppendText.php | 2 +- src/Converter/Transformer/Hash.php | 2 +- src/Converter/Transformer/PrependText.php | 2 +- src/Converter/Transformer/RegexReplace.php | 2 +- src/Converter/Transformer/Replace.php | 2 +- src/Converter/Transformer/ToLower.php | 2 +- src/Converter/Transformer/ToUpper.php | 2 +- src/Database/Database.php | 2 +- src/Database/DatabaseFactory.php | 2 +- src/Database/Driver/MysqlDriver.php | 2 +- .../Definition/Constraint/ForeignKey.php | 2 +- src/Database/Metadata/MysqlMetadata.php | 2 +- src/Database/ParameterBag.php | 2 +- src/Database/TableDependencyResolver.php | 6 +- .../Compiler/ConverterAliasPass.php | 2 +- .../ConverterAliasResolver.php | 2 +- src/Dumper/Config/ConfigProcessor.php | 2 +- .../Config/Definition/FakerSettings.php | 2 +- .../Definition/FilterPropagationSettings.php | 2 +- .../Config/Definition/Table/SortOrder.php | 2 +- src/Dumper/Config/Definition/TableConfig.php | 2 +- .../Definition/TableConfigCollection.php | 2 +- src/Dumper/Config/DumperConfig.php | 39 +++------ src/Dumper/Config/DumperConfigInterface.php | 82 +++++++++++++++++++ .../Config/Validation/QueryValidator.php | 2 +- .../Config/Validation/ValidationException.php | 2 +- .../Config/Validation/WhereExprValidator.php | 2 +- src/Dumper/Event/DumpEvent.php | 8 +- src/Dumper/Event/DumpFinishedEvent.php | 8 +- src/Dumper/Listener/DataConverterListener.php | 6 +- src/Dumper/Listener/FakerLocaleListener.php | 2 +- src/Dumper/Listener/TableFilterListener.php | 6 +- src/Dumper/MysqlDumper.php | 6 +- src/Faker/FakerService.php | 2 +- src/Phar/Compiler.php | 2 +- src/Phar/Minify/Json.php | 2 +- src/Phar/Minify/Php.php | 2 +- src/Util/ArrayHelper.php | 2 +- .../Mock/Converter/ConverterMock.php | 2 +- .../Validator/JsonSchemaValidatorTest.php | 2 +- .../Database/Metadata/MysqlMetadataTest.php | 2 +- .../Dumper/Config/ConfigProcessorTest.php | 2 +- tests/functional/Dumper/MysqlDumperTest.php | 2 +- tests/unit/Config/Compiler/CompilerTest.php | 2 +- .../Processor/EnvVarProcessorTest.php | 2 +- .../Version/VersionConditionTest.php | 2 +- .../Processor/Version/VersionMatcherTest.php | 2 +- .../Processor/VersionProcessorTest.php | 2 +- tests/unit/Config/ConfigTest.php | 2 +- tests/unit/Config/Loader/ConfigLoaderTest.php | 2 +- tests/unit/Config/Loader/FileLocatorTest.php | 2 +- .../Validator/JsonSchemaValidatorTest.php | 2 +- .../Config/Validator/ValidationResultTest.php | 2 +- tests/unit/Console/ApplicationTest.php | 2 +- .../Anonymizer/AnonymizeDateTimeTest.php | 2 +- .../Anonymizer/AnonymizeEmailTest.php | 2 +- .../Anonymizer/AnonymizeNumberTest.php | 2 +- .../Anonymizer/AnonymizeTextTest.php | 2 +- tests/unit/Converter/ConditionBuilderTest.php | 2 +- tests/unit/Converter/ConverterBuilderTest.php | 36 ++++---- tests/unit/Converter/ConverterFactoryTest.php | 24 ++---- .../Converter/Generator/NumberBetweenTest.php | 2 +- .../Generator/RandomDateTimeTest.php | 2 +- .../Converter/Generator/RandomEmailTest.php | 2 +- .../Converter/Generator/RandomTextTest.php | 2 +- .../unit/Converter/Generator/SetNullTest.php | 2 +- .../unit/Converter/Generator/SetValueTest.php | 2 +- .../Parameters/InputParametersTest.php | 2 +- .../Parameters/ParameterProcessorTest.php | 2 +- .../Converter/Parameters/ParameterTest.php | 2 +- tests/unit/Converter/Proxy/CacheTest.php | 2 +- tests/unit/Converter/Proxy/ChainTest.php | 2 +- .../unit/Converter/Proxy/ConditionalTest.php | 15 ++-- tests/unit/Converter/Proxy/FakerTest.php | 11 +-- .../unit/Converter/Proxy/FromContextTest.php | 2 +- tests/unit/Converter/Proxy/JsonDataTest.php | 2 +- .../Converter/Proxy/SerializedDataTest.php | 2 +- tests/unit/Converter/Proxy/UniqueTest.php | 2 +- .../Randomizer/RandomizeEmailTest.php | 2 +- .../Randomizer/RandomizeNumberTest.php | 2 +- .../Randomizer/RandomizeTextTest.php | 2 +- tests/unit/Converter/TestCase.php | 29 ++----- .../Converter/Transformer/AppendTextTest.php | 2 +- tests/unit/Converter/Transformer/HashTest.php | 2 +- .../Converter/Transformer/PrependTextTest.php | 2 +- .../Transformer/RegexReplaceTest.php | 2 +- .../Converter/Transformer/ReplaceTest.php | 2 +- .../Converter/Transformer/ToLowerTest.php | 2 +- .../Converter/Transformer/ToUpperTest.php | 2 +- .../unit/Database/Driver/MysqlDriverTest.php | 2 +- .../Definition/Constraint/ForeignKeyTest.php | 2 +- tests/unit/Database/ParameterBagTest.php | 2 +- .../Database/TableDependencyResolverTest.php | 10 +-- .../ConverterAliasResolverTest.php | 2 +- .../Dumper/Config/ConfigProcessorTest.php | 6 +- .../Config/Definition/FakerSettingsTest.php | 2 +- .../FilterPropagationSettingsTest.php | 2 +- .../Config/Definition/Table/SortOrderTest.php | 2 +- .../Definition/TableConfigCollectionTest.php | 2 +- .../Config/Definition/TableConfigTest.php | 2 +- tests/unit/Dumper/Config/DumperConfigTest.php | 2 +- .../Config/Validation/QueryValidatorTest.php | 2 +- .../Validation/WhereExprValidatorTest.php | 2 +- tests/unit/Faker/FakerServiceTest.php | 2 +- tests/unit/Phar/Compiler/Minify/JsonTest.php | 2 +- tests/unit/Phar/Compiler/Minify/PhpTest.php | 2 +- tests/unit/Util/ArrayHelperTest.php | 2 +- 153 files changed, 304 insertions(+), 268 deletions(-) create mode 100644 src/Dumper/Config/DumperConfigInterface.php diff --git a/src/AppKernel.php b/src/AppKernel.php index 583fe9c0..522f194e 100644 --- a/src/AppKernel.php +++ b/src/AppKernel.php @@ -18,7 +18,7 @@ use Symfony\Component\EventDispatcher\DependencyInjection\RegisterListenersPass; use Symfony\Component\EventDispatcher\EventDispatcher; -class AppKernel +final class AppKernel { private ContainerInterface $container; private bool $booted = false; diff --git a/src/Config/Compiler/Compiler.php b/src/Config/Compiler/Compiler.php index 2bcef53d..2d9c667e 100644 --- a/src/Config/Compiler/Compiler.php +++ b/src/Config/Compiler/Compiler.php @@ -7,7 +7,7 @@ use Smile\GdprDump\Config\Compiler\Processor\ProcessorInterface; use Smile\GdprDump\Config\ConfigInterface; -class Compiler implements CompilerInterface +final class Compiler implements CompilerInterface { /** * @param ProcessorInterface[] $processors diff --git a/src/Config/Compiler/Processor/DumpOutputProcessor.php b/src/Config/Compiler/Processor/DumpOutputProcessor.php index f16f4e39..36c74aeb 100644 --- a/src/Config/Compiler/Processor/DumpOutputProcessor.php +++ b/src/Config/Compiler/Processor/DumpOutputProcessor.php @@ -6,7 +6,7 @@ use Smile\GdprDump\Config\ConfigInterface; -class DumpOutputProcessor implements ProcessorInterface +final class DumpOutputProcessor implements ProcessorInterface { /** * Process date placeholders in dump output (e.g. "dump-{Y-m-d-H.i.s}.sql"). diff --git a/src/Config/Compiler/Processor/EnvVarProcessor.php b/src/Config/Compiler/Processor/EnvVarProcessor.php index eea25fff..b7ebea4e 100644 --- a/src/Config/Compiler/Processor/EnvVarProcessor.php +++ b/src/Config/Compiler/Processor/EnvVarProcessor.php @@ -7,7 +7,7 @@ use Smile\GdprDump\Config\Compiler\CompileException; use Smile\GdprDump\Config\ConfigInterface; -class EnvVarProcessor implements ProcessorInterface +final class EnvVarProcessor implements ProcessorInterface { /** * Environment variable name format. diff --git a/src/Config/Compiler/Processor/Version/InvalidVersionException.php b/src/Config/Compiler/Processor/Version/InvalidVersionException.php index a459f730..44772712 100644 --- a/src/Config/Compiler/Processor/Version/InvalidVersionException.php +++ b/src/Config/Compiler/Processor/Version/InvalidVersionException.php @@ -6,6 +6,6 @@ use Smile\GdprDump\Config\Compiler\CompileException; -class InvalidVersionException extends CompileException +final class InvalidVersionException extends CompileException { } diff --git a/src/Config/Compiler/Processor/Version/MissingVersionException.php b/src/Config/Compiler/Processor/Version/MissingVersionException.php index c4656523..cab3ea34 100644 --- a/src/Config/Compiler/Processor/Version/MissingVersionException.php +++ b/src/Config/Compiler/Processor/Version/MissingVersionException.php @@ -6,6 +6,6 @@ use Smile\GdprDump\Config\Compiler\CompileException; -class MissingVersionException extends CompileException +final class MissingVersionException extends CompileException { } diff --git a/src/Config/Compiler/Processor/Version/VersionCondition.php b/src/Config/Compiler/Processor/Version/VersionCondition.php index f36282d7..244fe5cd 100644 --- a/src/Config/Compiler/Processor/Version/VersionCondition.php +++ b/src/Config/Compiler/Processor/Version/VersionCondition.php @@ -4,7 +4,7 @@ namespace Smile\GdprDump\Config\Compiler\Processor\Version; -class VersionCondition +final class VersionCondition { /** * @var string[] diff --git a/src/Config/Compiler/Processor/Version/VersionMatcher.php b/src/Config/Compiler/Processor/Version/VersionMatcher.php index 78536f9d..61e663d5 100644 --- a/src/Config/Compiler/Processor/Version/VersionMatcher.php +++ b/src/Config/Compiler/Processor/Version/VersionMatcher.php @@ -4,7 +4,7 @@ namespace Smile\GdprDump\Config\Compiler\Processor\Version; -class VersionMatcher +final class VersionMatcher { /** * Check whether the requirement (e.g. ">=1.0.0 <2.0.0") matches the specified version (e.g. "1.1.0"). diff --git a/src/Config/Compiler/Processor/VersionProcessor.php b/src/Config/Compiler/Processor/VersionProcessor.php index 79131e2c..d0719505 100644 --- a/src/Config/Compiler/Processor/VersionProcessor.php +++ b/src/Config/Compiler/Processor/VersionProcessor.php @@ -8,7 +8,7 @@ use Smile\GdprDump\Config\Compiler\Processor\Version\VersionMatcher; use Smile\GdprDump\Config\ConfigInterface; -class VersionProcessor implements ProcessorInterface +final class VersionProcessor implements ProcessorInterface { /** * Process the "if_version" parameter. diff --git a/src/Config/Config.php b/src/Config/Config.php index 21e3abf7..01359434 100644 --- a/src/Config/Config.php +++ b/src/Config/Config.php @@ -4,7 +4,7 @@ namespace Smile\GdprDump\Config; -class Config implements ConfigInterface +final class Config implements ConfigInterface { public function __construct(private array $items = []) { diff --git a/src/Config/Loader/ConfigLoader.php b/src/Config/Loader/ConfigLoader.php index 1400bab2..410ce66b 100644 --- a/src/Config/Loader/ConfigLoader.php +++ b/src/Config/Loader/ConfigLoader.php @@ -9,7 +9,7 @@ use Smile\GdprDump\Config\ConfigInterface; use Symfony\Component\Yaml\Yaml; -class ConfigLoader implements ConfigLoaderInterface +final class ConfigLoader implements ConfigLoaderInterface { /** * @var string[] diff --git a/src/Config/Loader/FileLocator.php b/src/Config/Loader/FileLocator.php index e9871ea1..f18a4bb2 100644 --- a/src/Config/Loader/FileLocator.php +++ b/src/Config/Loader/FileLocator.php @@ -4,7 +4,7 @@ namespace Smile\GdprDump\Config\Loader; -class FileLocator implements FileLocatorInterface +final class FileLocator implements FileLocatorInterface { /** * @var string[] diff --git a/src/Config/Loader/FileNotFoundException.php b/src/Config/Loader/FileNotFoundException.php index 3c76ac57..d0a9cc76 100644 --- a/src/Config/Loader/FileNotFoundException.php +++ b/src/Config/Loader/FileNotFoundException.php @@ -6,6 +6,6 @@ use Smile\GdprDump\Config\ConfigException; -class FileNotFoundException extends ConfigException +final class FileNotFoundException extends ConfigException { } diff --git a/src/Config/Loader/ParseException.php b/src/Config/Loader/ParseException.php index af5ecd8f..69412fe7 100644 --- a/src/Config/Loader/ParseException.php +++ b/src/Config/Loader/ParseException.php @@ -6,6 +6,6 @@ use Smile\GdprDump\Config\ConfigException; -class ParseException extends ConfigException +final class ParseException extends ConfigException { } diff --git a/src/Config/Validator/JsonSchemaValidator.php b/src/Config/Validator/JsonSchemaValidator.php index 08920bbd..1b0a765f 100644 --- a/src/Config/Validator/JsonSchemaValidator.php +++ b/src/Config/Validator/JsonSchemaValidator.php @@ -7,7 +7,7 @@ use Exception; use JsonSchema\Validator; -class JsonSchemaValidator implements ValidatorInterface +final class JsonSchemaValidator implements ValidatorInterface { private ?Validator $schemaValidator = null; diff --git a/src/Config/Validator/ValidationException.php b/src/Config/Validator/ValidationException.php index ec0860fd..e51c8322 100644 --- a/src/Config/Validator/ValidationException.php +++ b/src/Config/Validator/ValidationException.php @@ -6,6 +6,6 @@ use Smile\GdprDump\Config\ConfigException; -class ValidationException extends ConfigException +final class ValidationException extends ConfigException { } diff --git a/src/Config/Validator/ValidationResult.php b/src/Config/Validator/ValidationResult.php index 4942b261..fccf8e4b 100644 --- a/src/Config/Validator/ValidationResult.php +++ b/src/Config/Validator/ValidationResult.php @@ -4,7 +4,7 @@ namespace Smile\GdprDump\Config\Validator; -class ValidationResult implements ValidationResultInterface +final class ValidationResult implements ValidationResultInterface { private bool $valid = false; diff --git a/src/Console/Application.php b/src/Console/Application.php index a41e57f7..0826b570 100644 --- a/src/Console/Application.php +++ b/src/Console/Application.php @@ -7,7 +7,7 @@ use Composer\InstalledVersions; use Symfony\Component\Console\Application as BaseApplication; -class Application extends BaseApplication +final class Application extends BaseApplication { private const PACKAGE_NAME = 'smile/gdpr-dump'; diff --git a/src/Console/Command/CompileCommand.php b/src/Console/Command/CompileCommand.php index 6b432ef2..954018de 100644 --- a/src/Console/Command/CompileCommand.php +++ b/src/Console/Command/CompileCommand.php @@ -10,7 +10,7 @@ use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; -class CompileCommand extends Command +final class CompileCommand extends Command { public function __construct(private Compiler $compiler, private string $defaultLocale) { diff --git a/src/Console/Command/DumpCommand.php b/src/Console/Command/DumpCommand.php index f03233c3..2bb57283 100644 --- a/src/Console/Command/DumpCommand.php +++ b/src/Console/Command/DumpCommand.php @@ -23,7 +23,7 @@ use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Question\Question; -class DumpCommand extends Command +final class DumpCommand extends Command { public function __construct( private DumperInterface $dumper, diff --git a/src/Console/Helper/DumpInfo.php b/src/Console/Helper/DumpInfo.php index 67d83008..8cdc91e1 100644 --- a/src/Console/Helper/DumpInfo.php +++ b/src/Console/Helper/DumpInfo.php @@ -5,7 +5,7 @@ namespace Smile\GdprDump\Console\Helper; use Smile\GdprDump\Database\Metadata\MetadataInterface; -use Smile\GdprDump\Dumper\Config\DumperConfig; +use Smile\GdprDump\Dumper\Config\DumperConfigInterface; use Smile\GdprDump\Dumper\Event\DumpEvent; use Smile\GdprDump\Dumper\Event\DumpFinishedEvent; use Symfony\Component\Console\Helper\ProgressBar; @@ -13,7 +13,7 @@ use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\EventDispatcher\EventDispatcherInterface; -class DumpInfo +final class DumpInfo { private OutputInterface $output; private ProgressBar $progressBar; @@ -147,7 +147,7 @@ private function updateProgressBarMessage(array $tableInfo): void /** * Get max number of steps of the progress bar. */ - private function getMaxSteps(DumperConfig $config, MetadataInterface $metadata): int + private function getMaxSteps(DumperConfigInterface $config, MetadataInterface $metadata): int { $includedTables = $config->getIncludedTables() ?: $metadata->getTableNames(); $excludedTables = $config->getExcludedTables(); diff --git a/src/Converter/Anonymizer/AnonymizeDateTime.php b/src/Converter/Anonymizer/AnonymizeDateTime.php index b00afa58..7b02e713 100644 --- a/src/Converter/Anonymizer/AnonymizeDateTime.php +++ b/src/Converter/Anonymizer/AnonymizeDateTime.php @@ -4,7 +4,7 @@ namespace Smile\GdprDump\Converter\Anonymizer; -class AnonymizeDateTime extends AnonymizeDate +final class AnonymizeDateTime extends AnonymizeDate { protected string $defaultFormat = 'Y-m-d H:i:s'; } diff --git a/src/Converter/Anonymizer/AnonymizeEmail.php b/src/Converter/Anonymizer/AnonymizeEmail.php index b29d7484..8f1a0f7b 100644 --- a/src/Converter/Anonymizer/AnonymizeEmail.php +++ b/src/Converter/Anonymizer/AnonymizeEmail.php @@ -7,7 +7,7 @@ use Smile\GdprDump\Converter\Parameters\Parameter; use Smile\GdprDump\Converter\Parameters\ParameterProcessor; -class AnonymizeEmail extends AnonymizeText +final class AnonymizeEmail extends AnonymizeText { /** * @var string[] diff --git a/src/Converter/Anonymizer/AnonymizeNumber.php b/src/Converter/Anonymizer/AnonymizeNumber.php index 736c8c38..6f3926d7 100644 --- a/src/Converter/Anonymizer/AnonymizeNumber.php +++ b/src/Converter/Anonymizer/AnonymizeNumber.php @@ -8,7 +8,7 @@ use Smile\GdprDump\Converter\Parameters\Parameter; use Smile\GdprDump\Converter\Parameters\ParameterProcessor; -class AnonymizeNumber implements ConverterInterface +final class AnonymizeNumber implements ConverterInterface { private string $replacement; private int $minNumberLength; diff --git a/src/Converter/ConditionBuilder.php b/src/Converter/ConditionBuilder.php index 2af20fcc..c66470bd 100644 --- a/src/Converter/ConditionBuilder.php +++ b/src/Converter/ConditionBuilder.php @@ -9,7 +9,7 @@ use TheSeer\Tokenizer\TokenCollection; use TheSeer\Tokenizer\Tokenizer; -class ConditionBuilder +final class ConditionBuilder { private Tokenizer $tokenizer; diff --git a/src/Converter/ConverterBuilder.php b/src/Converter/ConverterBuilder.php index 6ba82509..fe232607 100644 --- a/src/Converter/ConverterBuilder.php +++ b/src/Converter/ConverterBuilder.php @@ -6,7 +6,7 @@ use UnexpectedValueException; -class ConverterBuilder +final class ConverterBuilder { public function __construct(private ConverterFactory $converterFactory) { diff --git a/src/Converter/ConverterFactory.php b/src/Converter/ConverterFactory.php index a418861f..8ec95e8d 100644 --- a/src/Converter/ConverterFactory.php +++ b/src/Converter/ConverterFactory.php @@ -9,7 +9,7 @@ use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException; -class ConverterFactory +final class ConverterFactory { public function __construct( private ContainerInterface $container, diff --git a/src/Converter/Generator/NumberBetween.php b/src/Converter/Generator/NumberBetween.php index a5a7f0f2..61953b35 100644 --- a/src/Converter/Generator/NumberBetween.php +++ b/src/Converter/Generator/NumberBetween.php @@ -9,7 +9,7 @@ use Smile\GdprDump\Converter\Parameters\ParameterProcessor; use Smile\GdprDump\Converter\Parameters\ValidationException; -class NumberBetween implements ConverterInterface +final class NumberBetween implements ConverterInterface { private int $min; private int $max; diff --git a/src/Converter/Generator/RandomDateTime.php b/src/Converter/Generator/RandomDateTime.php index f8200251..47392fe1 100644 --- a/src/Converter/Generator/RandomDateTime.php +++ b/src/Converter/Generator/RandomDateTime.php @@ -4,7 +4,7 @@ namespace Smile\GdprDump\Converter\Generator; -class RandomDateTime extends RandomDate +final class RandomDateTime extends RandomDate { protected string $defaultFormat = 'Y-m-d H:i:s'; diff --git a/src/Converter/Generator/RandomEmail.php b/src/Converter/Generator/RandomEmail.php index 0a43dc64..39b96dd6 100644 --- a/src/Converter/Generator/RandomEmail.php +++ b/src/Converter/Generator/RandomEmail.php @@ -7,7 +7,7 @@ use Smile\GdprDump\Converter\Parameters\Parameter; use Smile\GdprDump\Converter\Parameters\ParameterProcessor; -class RandomEmail extends RandomText +final class RandomEmail extends RandomText { /** * @var string[] diff --git a/src/Converter/Generator/SetNull.php b/src/Converter/Generator/SetNull.php index 94603a25..c269c9fa 100644 --- a/src/Converter/Generator/SetNull.php +++ b/src/Converter/Generator/SetNull.php @@ -6,7 +6,7 @@ use Smile\GdprDump\Converter\ConverterInterface; -class SetNull implements ConverterInterface +final class SetNull implements ConverterInterface { /** * @inheritdoc diff --git a/src/Converter/Generator/SetValue.php b/src/Converter/Generator/SetValue.php index f0d2b3e1..04c0d550 100644 --- a/src/Converter/Generator/SetValue.php +++ b/src/Converter/Generator/SetValue.php @@ -7,7 +7,7 @@ use Smile\GdprDump\Converter\ConverterInterface; use Smile\GdprDump\Converter\Parameters\ValidationException; -class SetValue implements ConverterInterface +final class SetValue implements ConverterInterface { private mixed $value; diff --git a/src/Converter/Parameters/InputParameters.php b/src/Converter/Parameters/InputParameters.php index 57eef258..54933867 100644 --- a/src/Converter/Parameters/InputParameters.php +++ b/src/Converter/Parameters/InputParameters.php @@ -4,7 +4,7 @@ namespace Smile\GdprDump\Converter\Parameters; -class InputParameters +final class InputParameters { public function __construct(private array $values) { diff --git a/src/Converter/Parameters/Parameter.php b/src/Converter/Parameters/Parameter.php index 541006a0..76b83e73 100644 --- a/src/Converter/Parameters/Parameter.php +++ b/src/Converter/Parameters/Parameter.php @@ -4,7 +4,7 @@ namespace Smile\GdprDump\Converter\Parameters; -class Parameter +final class Parameter { public const TYPE_BOOL = 'bool'; public const TYPE_STRING = 'string'; diff --git a/src/Converter/Parameters/ParameterProcessor.php b/src/Converter/Parameters/ParameterProcessor.php index ec322dfc..9a6ac738 100644 --- a/src/Converter/Parameters/ParameterProcessor.php +++ b/src/Converter/Parameters/ParameterProcessor.php @@ -4,7 +4,7 @@ namespace Smile\GdprDump\Converter\Parameters; -class ParameterProcessor +final class ParameterProcessor { /** * @var Parameter[] diff --git a/src/Converter/Parameters/ValidationException.php b/src/Converter/Parameters/ValidationException.php index 55263cf2..1aa26831 100644 --- a/src/Converter/Parameters/ValidationException.php +++ b/src/Converter/Parameters/ValidationException.php @@ -7,7 +7,7 @@ use Exception; use Throwable; -class ValidationException extends Exception +final class ValidationException extends Exception { public function __construct(string $message, ?Throwable $previous = null) { diff --git a/src/Converter/Proxy/Cache.php b/src/Converter/Proxy/Cache.php index 468b1de4..f17450e8 100644 --- a/src/Converter/Proxy/Cache.php +++ b/src/Converter/Proxy/Cache.php @@ -8,7 +8,7 @@ use Smile\GdprDump\Converter\Parameters\Parameter; use Smile\GdprDump\Converter\Parameters\ParameterProcessor; -class Cache implements ConverterInterface +final class Cache implements ConverterInterface { private static array $values = []; private ConverterInterface $converter; diff --git a/src/Converter/Proxy/Chain.php b/src/Converter/Proxy/Chain.php index 5cd2a31f..168f3e1f 100644 --- a/src/Converter/Proxy/Chain.php +++ b/src/Converter/Proxy/Chain.php @@ -8,7 +8,7 @@ use Smile\GdprDump\Converter\Parameters\Parameter; use Smile\GdprDump\Converter\Parameters\ParameterProcessor; -class Chain implements ConverterInterface +final class Chain implements ConverterInterface { /** * @var ConverterInterface[] diff --git a/src/Converter/Proxy/Conditional.php b/src/Converter/Proxy/Conditional.php index ea1ed133..7e4906d7 100644 --- a/src/Converter/Proxy/Conditional.php +++ b/src/Converter/Proxy/Conditional.php @@ -10,7 +10,7 @@ use Smile\GdprDump\Converter\Parameters\ParameterProcessor; use Smile\GdprDump\Converter\Parameters\ValidationException; -class Conditional implements ConverterInterface +final class Conditional implements ConverterInterface { private string $condition; private ?ConverterInterface $ifTrueConverter = null; diff --git a/src/Converter/Proxy/Faker.php b/src/Converter/Proxy/Faker.php index c9326435..0b958786 100644 --- a/src/Converter/Proxy/Faker.php +++ b/src/Converter/Proxy/Faker.php @@ -11,7 +11,7 @@ use Smile\GdprDump\Converter\Parameters\ValidationException; use Smile\GdprDump\Faker\FakerService; -class Faker implements ConverterInterface +final class Faker implements ConverterInterface { private object $provider; private string $method; diff --git a/src/Converter/Proxy/FromContext.php b/src/Converter/Proxy/FromContext.php index 1857486f..f3a3eacc 100644 --- a/src/Converter/Proxy/FromContext.php +++ b/src/Converter/Proxy/FromContext.php @@ -9,7 +9,7 @@ use Smile\GdprDump\Converter\Parameters\ParameterProcessor; use Smile\GdprDump\Util\ArrayHelper; -class FromContext implements ConverterInterface +final class FromContext implements ConverterInterface { private string $key; diff --git a/src/Converter/Proxy/JsonData.php b/src/Converter/Proxy/JsonData.php index 3a477cf1..375613df 100644 --- a/src/Converter/Proxy/JsonData.php +++ b/src/Converter/Proxy/JsonData.php @@ -9,7 +9,7 @@ use Smile\GdprDump\Converter\Parameters\ParameterProcessor; use Smile\GdprDump\Util\ArrayHelper; -class JsonData implements ConverterInterface +final class JsonData implements ConverterInterface { /** * @var ConverterInterface[] diff --git a/src/Converter/Proxy/SerializedData.php b/src/Converter/Proxy/SerializedData.php index c01d18e3..b5430019 100644 --- a/src/Converter/Proxy/SerializedData.php +++ b/src/Converter/Proxy/SerializedData.php @@ -9,7 +9,7 @@ use Smile\GdprDump\Converter\Parameters\ParameterProcessor; use Smile\GdprDump\Util\ArrayHelper; -class SerializedData implements ConverterInterface +final class SerializedData implements ConverterInterface { /** * @var ConverterInterface[] diff --git a/src/Converter/Proxy/Unique.php b/src/Converter/Proxy/Unique.php index b56851da..38480aa8 100644 --- a/src/Converter/Proxy/Unique.php +++ b/src/Converter/Proxy/Unique.php @@ -9,7 +9,7 @@ use Smile\GdprDump\Converter\Parameters\Parameter; use Smile\GdprDump\Converter\Parameters\ParameterProcessor; -class Unique implements ConverterInterface +final class Unique implements ConverterInterface { private ConverterInterface $converter; private int $maxRetries; diff --git a/src/Converter/Randomizer/RandomizeEmail.php b/src/Converter/Randomizer/RandomizeEmail.php index 7c9f6cb3..723ff9ca 100644 --- a/src/Converter/Randomizer/RandomizeEmail.php +++ b/src/Converter/Randomizer/RandomizeEmail.php @@ -7,7 +7,7 @@ use Smile\GdprDump\Converter\Parameters\Parameter; use Smile\GdprDump\Converter\Parameters\ParameterProcessor; -class RandomizeEmail extends RandomizeText +final class RandomizeEmail extends RandomizeText { /** * @var string[] diff --git a/src/Converter/Randomizer/RandomizeNumber.php b/src/Converter/Randomizer/RandomizeNumber.php index 4a6fbc4b..6a1d5dad 100644 --- a/src/Converter/Randomizer/RandomizeNumber.php +++ b/src/Converter/Randomizer/RandomizeNumber.php @@ -7,7 +7,7 @@ use Closure; use Smile\GdprDump\Converter\ConverterInterface; -class RandomizeNumber implements ConverterInterface +final class RandomizeNumber implements ConverterInterface { private Closure $replaceCallback; diff --git a/src/Converter/Transformer/AppendText.php b/src/Converter/Transformer/AppendText.php index ab0c5e85..01416a25 100644 --- a/src/Converter/Transformer/AppendText.php +++ b/src/Converter/Transformer/AppendText.php @@ -8,7 +8,7 @@ use Smile\GdprDump\Converter\Parameters\Parameter; use Smile\GdprDump\Converter\Parameters\ParameterProcessor; -class AppendText implements ConverterInterface +final class AppendText implements ConverterInterface { private string $suffix; diff --git a/src/Converter/Transformer/Hash.php b/src/Converter/Transformer/Hash.php index 61ff55e9..4aed4a9b 100644 --- a/src/Converter/Transformer/Hash.php +++ b/src/Converter/Transformer/Hash.php @@ -9,7 +9,7 @@ use Smile\GdprDump\Converter\Parameters\ParameterProcessor; use Smile\GdprDump\Converter\Parameters\ValidationException; -class Hash implements ConverterInterface +final class Hash implements ConverterInterface { private string $algorithm; diff --git a/src/Converter/Transformer/PrependText.php b/src/Converter/Transformer/PrependText.php index cb0a8c95..94c67d5d 100644 --- a/src/Converter/Transformer/PrependText.php +++ b/src/Converter/Transformer/PrependText.php @@ -8,7 +8,7 @@ use Smile\GdprDump\Converter\Parameters\Parameter; use Smile\GdprDump\Converter\Parameters\ParameterProcessor; -class PrependText implements ConverterInterface +final class PrependText implements ConverterInterface { private string $prefix; diff --git a/src/Converter/Transformer/RegexReplace.php b/src/Converter/Transformer/RegexReplace.php index 91e210d9..6ed2eaba 100644 --- a/src/Converter/Transformer/RegexReplace.php +++ b/src/Converter/Transformer/RegexReplace.php @@ -9,7 +9,7 @@ use Smile\GdprDump\Converter\Parameters\Parameter; use Smile\GdprDump\Converter\Parameters\ParameterProcessor; -class RegexReplace implements ConverterInterface +final class RegexReplace implements ConverterInterface { private string $pattern; private string $replacement; diff --git a/src/Converter/Transformer/Replace.php b/src/Converter/Transformer/Replace.php index 4047f351..143c6d61 100644 --- a/src/Converter/Transformer/Replace.php +++ b/src/Converter/Transformer/Replace.php @@ -8,7 +8,7 @@ use Smile\GdprDump\Converter\Parameters\Parameter; use Smile\GdprDump\Converter\Parameters\ParameterProcessor; -class Replace implements ConverterInterface +final class Replace implements ConverterInterface { private string $search; private string $replacement; diff --git a/src/Converter/Transformer/ToLower.php b/src/Converter/Transformer/ToLower.php index 60cc4974..fb94eb79 100644 --- a/src/Converter/Transformer/ToLower.php +++ b/src/Converter/Transformer/ToLower.php @@ -6,7 +6,7 @@ use Smile\GdprDump\Converter\ConverterInterface; -class ToLower implements ConverterInterface +final class ToLower implements ConverterInterface { private bool $multiByteEnabled; diff --git a/src/Converter/Transformer/ToUpper.php b/src/Converter/Transformer/ToUpper.php index 9eb4d9e2..c531a9e8 100644 --- a/src/Converter/Transformer/ToUpper.php +++ b/src/Converter/Transformer/ToUpper.php @@ -6,7 +6,7 @@ use Smile\GdprDump\Converter\ConverterInterface; -class ToUpper implements ConverterInterface +final class ToUpper implements ConverterInterface { private bool $multiByteEnabled; diff --git a/src/Database/Database.php b/src/Database/Database.php index 3dd99ce1..69ef735f 100644 --- a/src/Database/Database.php +++ b/src/Database/Database.php @@ -22,7 +22,7 @@ * We use a custom abstraction layer for database metadata, because the Doctrine schema manager * crashes when used with databases that use custom Doctrine types (e.g. OroCommerce). */ -class Database +final class Database { public const DRIVER_MYSQL = 'pdo_mysql'; diff --git a/src/Database/DatabaseFactory.php b/src/Database/DatabaseFactory.php index 3f42d072..19a29783 100644 --- a/src/Database/DatabaseFactory.php +++ b/src/Database/DatabaseFactory.php @@ -6,7 +6,7 @@ use Smile\GdprDump\Config\ConfigInterface; -class DatabaseFactory +final class DatabaseFactory { /** * Create a database object. diff --git a/src/Database/Driver/MysqlDriver.php b/src/Database/Driver/MysqlDriver.php index 355c8e59..c0e2b3b5 100644 --- a/src/Database/Driver/MysqlDriver.php +++ b/src/Database/Driver/MysqlDriver.php @@ -6,7 +6,7 @@ use Smile\GdprDump\Database\ParameterBag; -class MysqlDriver implements DriverInterface +final class MysqlDriver implements DriverInterface { public function __construct(private ParameterBag $connectionParams) { diff --git a/src/Database/Metadata/Definition/Constraint/ForeignKey.php b/src/Database/Metadata/Definition/Constraint/ForeignKey.php index 0237009c..ff4b3b17 100644 --- a/src/Database/Metadata/Definition/Constraint/ForeignKey.php +++ b/src/Database/Metadata/Definition/Constraint/ForeignKey.php @@ -4,7 +4,7 @@ namespace Smile\GdprDump\Database\Metadata\Definition\Constraint; -class ForeignKey +final class ForeignKey { /** * @param string[] $localColumns diff --git a/src/Database/Metadata/MysqlMetadata.php b/src/Database/Metadata/MysqlMetadata.php index f0904aa2..db216e35 100644 --- a/src/Database/Metadata/MysqlMetadata.php +++ b/src/Database/Metadata/MysqlMetadata.php @@ -8,7 +8,7 @@ use RuntimeException; use Smile\GdprDump\Database\Metadata\Definition\Constraint\ForeignKey; -class MysqlMetadata implements MetadataInterface +final class MysqlMetadata implements MetadataInterface { private string $schema; private ?array $tableNames = null; diff --git a/src/Database/ParameterBag.php b/src/Database/ParameterBag.php index 702f6355..8146f4a6 100644 --- a/src/Database/ParameterBag.php +++ b/src/Database/ParameterBag.php @@ -6,7 +6,7 @@ use UnexpectedValueException; -class ParameterBag +final class ParameterBag { private array $params; private array $defaults = [ diff --git a/src/Database/TableDependencyResolver.php b/src/Database/TableDependencyResolver.php index f802f008..84dab0b4 100644 --- a/src/Database/TableDependencyResolver.php +++ b/src/Database/TableDependencyResolver.php @@ -6,9 +6,9 @@ use Smile\GdprDump\Database\Metadata\Definition\Constraint\ForeignKey; use Smile\GdprDump\Database\Metadata\MetadataInterface; -use Smile\GdprDump\Dumper\Config\DumperConfig; +use Smile\GdprDump\Dumper\Config\DumperConfigInterface; -class TableDependencyResolver +final class TableDependencyResolver { private bool $resolved = false; @@ -20,7 +20,7 @@ class TableDependencyResolver */ private array $foreignKeys = []; - public function __construct(private MetadataInterface $metadata, private DumperConfig $config) + public function __construct(private MetadataInterface $metadata, private DumperConfigInterface $config) { } diff --git a/src/DependencyInjection/Compiler/ConverterAliasPass.php b/src/DependencyInjection/Compiler/ConverterAliasPass.php index d2168ae9..accba255 100644 --- a/src/DependencyInjection/Compiler/ConverterAliasPass.php +++ b/src/DependencyInjection/Compiler/ConverterAliasPass.php @@ -9,7 +9,7 @@ use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; use Symfony\Component\DependencyInjection\ContainerBuilder; -class ConverterAliasPass implements CompilerPassInterface +final class ConverterAliasPass implements CompilerPassInterface { public const ALIAS_PREFIX = 'converter.'; diff --git a/src/DependencyInjection/ConverterAliasResolver.php b/src/DependencyInjection/ConverterAliasResolver.php index 6c505675..2c5846d4 100644 --- a/src/DependencyInjection/ConverterAliasResolver.php +++ b/src/DependencyInjection/ConverterAliasResolver.php @@ -6,7 +6,7 @@ use Smile\GdprDump\DependencyInjection\Compiler\ConverterAliasPass; -class ConverterAliasResolver +final class ConverterAliasResolver { /** * Get service alias by converter name (e.g. "randomizeText"). diff --git a/src/Dumper/Config/ConfigProcessor.php b/src/Dumper/Config/ConfigProcessor.php index 433eacc8..e900c125 100644 --- a/src/Dumper/Config/ConfigProcessor.php +++ b/src/Dumper/Config/ConfigProcessor.php @@ -8,7 +8,7 @@ use Smile\GdprDump\Database\Metadata\MetadataInterface; use Smile\GdprDump\Dumper\Config\Validation\ValidationException; -class ConfigProcessor +final class ConfigProcessor { /** * @var string[]|null diff --git a/src/Dumper/Config/Definition/FakerSettings.php b/src/Dumper/Config/Definition/FakerSettings.php index e4230f45..d17825b3 100644 --- a/src/Dumper/Config/Definition/FakerSettings.php +++ b/src/Dumper/Config/Definition/FakerSettings.php @@ -4,7 +4,7 @@ namespace Smile\GdprDump\Dumper\Config\Definition; -class FakerSettings +final class FakerSettings { public function __construct(private string $locale) { diff --git a/src/Dumper/Config/Definition/FilterPropagationSettings.php b/src/Dumper/Config/Definition/FilterPropagationSettings.php index 4b3bc379..9c49814f 100644 --- a/src/Dumper/Config/Definition/FilterPropagationSettings.php +++ b/src/Dumper/Config/Definition/FilterPropagationSettings.php @@ -4,7 +4,7 @@ namespace Smile\GdprDump\Dumper\Config\Definition; -class FilterPropagationSettings +final class FilterPropagationSettings { public function __construct(private bool $enabled, private array $ignoredForeignKeys) { diff --git a/src/Dumper/Config/Definition/Table/SortOrder.php b/src/Dumper/Config/Definition/Table/SortOrder.php index cefe9e81..327a6a17 100644 --- a/src/Dumper/Config/Definition/Table/SortOrder.php +++ b/src/Dumper/Config/Definition/Table/SortOrder.php @@ -6,7 +6,7 @@ use UnexpectedValueException; -class SortOrder +final class SortOrder { public const DIRECTION_ASC = 'ASC'; public const DIRECTION_DESC = 'DESC'; diff --git a/src/Dumper/Config/Definition/TableConfig.php b/src/Dumper/Config/Definition/TableConfig.php index fbaebe6e..8340d7f1 100644 --- a/src/Dumper/Config/Definition/TableConfig.php +++ b/src/Dumper/Config/Definition/TableConfig.php @@ -9,7 +9,7 @@ use Smile\GdprDump\Dumper\Config\Validation\WhereExprValidator; use UnexpectedValueException; -class TableConfig +final class TableConfig { private string $name; private ?string $where = null; diff --git a/src/Dumper/Config/Definition/TableConfigCollection.php b/src/Dumper/Config/Definition/TableConfigCollection.php index c4c36f9d..0c67f140 100644 --- a/src/Dumper/Config/Definition/TableConfigCollection.php +++ b/src/Dumper/Config/Definition/TableConfigCollection.php @@ -12,7 +12,7 @@ /** * @implements IteratorAggregate */ -class TableConfigCollection implements IteratorAggregate +final class TableConfigCollection implements IteratorAggregate { /** * @var TableConfig[] diff --git a/src/Dumper/Config/DumperConfig.php b/src/Dumper/Config/DumperConfig.php index 21391d43..5126f19e 100644 --- a/src/Dumper/Config/DumperConfig.php +++ b/src/Dumper/Config/DumperConfig.php @@ -14,7 +14,7 @@ use Smile\GdprDump\Dumper\Config\Validation\QueryValidator; use Smile\GdprDump\Dumper\Config\Validation\ValidationException; -class DumperConfig +final class DumperConfig implements DumperConfigInterface { private FakerSettings $fakerSettings; private FilterPropagationSettings $filterPropagationSettings; @@ -90,7 +90,7 @@ public function __construct(ConfigInterface $config) } /** - * Get the dump output. + * @inheritdoc */ public function getDumpOutput(): string { @@ -98,7 +98,7 @@ public function getDumpOutput(): string } /** - * Get dump settings. + * @inheritdoc */ public function getDumpSettings(): array { @@ -106,7 +106,7 @@ public function getDumpSettings(): array } /** - * Get faker settings. + * @inheritdoc */ public function getFakerSettings(): FakerSettings { @@ -114,7 +114,7 @@ public function getFakerSettings(): FakerSettings } /** - * Get filter propagation settings. + * @inheritdoc */ public function getFilterPropagationSettings(): FilterPropagationSettings { @@ -122,7 +122,7 @@ public function getFilterPropagationSettings(): FilterPropagationSettings } /** - * Get the tables configuration (filters, orders, limits). + * @inheritdoc */ public function getTablesConfig(): TableConfigCollection { @@ -130,12 +130,7 @@ public function getTablesConfig(): TableConfigCollection } /** - * Get the SQL queries to run. - * - * The result of each query will then be injected into user-defined variables. - * Array keys are the variable names, array values are the database queries. - * - * @return string[] + * @inheritdoc */ public function getVarQueries(): array { @@ -143,9 +138,7 @@ public function getVarQueries(): array } /** - * Get the tables to include. - * - * @return string[] + * @inheritdoc */ public function getIncludedTables(): array { @@ -153,9 +146,7 @@ public function getIncludedTables(): array } /** - * Get the tables to exclude. - * - * @return string[] + * @inheritdoc */ public function getExcludedTables(): array { @@ -163,9 +154,7 @@ public function getExcludedTables(): array } /** - * Get the tables to truncate (only the structure is included in the dump file, not the data). - * - * @return string[] + * @inheritdoc */ public function getTablesToTruncate(): array { @@ -173,9 +162,7 @@ public function getTablesToTruncate(): array } /** - * Get the names of the tables to filter. - * - * @return string[] + * @inheritdoc */ public function getTablesToFilter(): array { @@ -183,9 +170,7 @@ public function getTablesToFilter(): array } /** - * Get the names of the tables to sort. - * - * @return string[] + * @inheritdoc */ public function getTablesToSort(): array { diff --git a/src/Dumper/Config/DumperConfigInterface.php b/src/Dumper/Config/DumperConfigInterface.php new file mode 100644 index 00000000..c1e0a68f --- /dev/null +++ b/src/Dumper/Config/DumperConfigInterface.php @@ -0,0 +1,82 @@ +config; } diff --git a/src/Dumper/Event/DumpFinishedEvent.php b/src/Dumper/Event/DumpFinishedEvent.php index a2cdddd4..d9ca60f5 100644 --- a/src/Dumper/Event/DumpFinishedEvent.php +++ b/src/Dumper/Event/DumpFinishedEvent.php @@ -4,22 +4,22 @@ namespace Smile\GdprDump\Dumper\Event; -use Smile\GdprDump\Dumper\Config\DumperConfig; +use Smile\GdprDump\Dumper\Config\DumperConfigInterface; use Symfony\Contracts\EventDispatcher\Event; /** * Event dispatched after a dump creation. */ -class DumpFinishedEvent extends Event +final class DumpFinishedEvent extends Event { - public function __construct(private DumperConfig $config) + public function __construct(private DumperConfigInterface $config) { } /** * Get the dumper config. */ - public function getConfig(): DumperConfig + public function getConfig(): DumperConfigInterface { return $this->config; } diff --git a/src/Dumper/Listener/DataConverterListener.php b/src/Dumper/Listener/DataConverterListener.php index 2be2919b..c4574771 100644 --- a/src/Dumper/Listener/DataConverterListener.php +++ b/src/Dumper/Listener/DataConverterListener.php @@ -9,10 +9,10 @@ use Smile\GdprDump\Converter\ConditionBuilder; use Smile\GdprDump\Converter\ConverterBuilder; use Smile\GdprDump\Converter\ConverterInterface; -use Smile\GdprDump\Dumper\Config\DumperConfig; +use Smile\GdprDump\Dumper\Config\DumperConfigInterface; use Smile\GdprDump\Dumper\Event\DumpEvent; -class DataConverterListener +final class DataConverterListener { private array $context = []; @@ -88,7 +88,7 @@ private function getHook(): callable /** * Create the converters, grouped by table. */ - private function buildConverters(DumperConfig $config): void + private function buildConverters(DumperConfigInterface $config): void { $this->converters = []; $this->skipConditions = []; diff --git a/src/Dumper/Listener/FakerLocaleListener.php b/src/Dumper/Listener/FakerLocaleListener.php index 81da3fc2..2ea3a893 100644 --- a/src/Dumper/Listener/FakerLocaleListener.php +++ b/src/Dumper/Listener/FakerLocaleListener.php @@ -7,7 +7,7 @@ use Smile\GdprDump\Dumper\Event\DumpEvent; use Smile\GdprDump\Faker\FakerService; -class FakerLocaleListener +final class FakerLocaleListener { public function __construct(private FakerService $fakerService) { diff --git a/src/Dumper/Listener/TableFilterListener.php b/src/Dumper/Listener/TableFilterListener.php index 122da802..29fc06a8 100644 --- a/src/Dumper/Listener/TableFilterListener.php +++ b/src/Dumper/Listener/TableFilterListener.php @@ -9,15 +9,15 @@ use Smile\GdprDump\Database\Metadata\Definition\Constraint\ForeignKey; use Smile\GdprDump\Database\Metadata\MetadataInterface; use Smile\GdprDump\Database\TableDependencyResolver; -use Smile\GdprDump\Dumper\Config\DumperConfig; +use Smile\GdprDump\Dumper\Config\DumperConfigInterface; use Smile\GdprDump\Dumper\Event\DumpEvent; use UnexpectedValueException; -class TableFilterListener +final class TableFilterListener { private Connection $connection; private MetadataInterface $metadata; - private DumperConfig $config; + private DumperConfigInterface $config; /** * Define the filters to apply on the tables. diff --git a/src/Dumper/MysqlDumper.php b/src/Dumper/MysqlDumper.php index a7340fa0..448573ec 100644 --- a/src/Dumper/MysqlDumper.php +++ b/src/Dumper/MysqlDumper.php @@ -8,12 +8,12 @@ use Smile\GdprDump\Config\ConfigInterface; use Smile\GdprDump\Database\DatabaseFactory; use Smile\GdprDump\Dumper\Config\ConfigProcessor; -use Smile\GdprDump\Dumper\Config\DumperConfig; +use Smile\GdprDump\Dumper\Config\DumperConfigInterface; use Smile\GdprDump\Dumper\Event\DumpEvent; use Smile\GdprDump\Dumper\Event\DumpFinishedEvent; use Symfony\Contracts\EventDispatcher\EventDispatcherInterface; -class MysqlDumper implements DumperInterface +final class MysqlDumper implements DumperInterface { public function __construct( private DatabaseFactory $databaseFactory, @@ -68,7 +68,7 @@ public function dump(ConfigInterface $config, bool $dryRun = false): void /** * Get the dump settings. */ - private function getDumpSettings(DumperConfig $config): array + private function getDumpSettings(DumperConfigInterface $config): array { $settings = $config->getDumpSettings(); diff --git a/src/Faker/FakerService.php b/src/Faker/FakerService.php index 0529cab6..c02b7c6a 100644 --- a/src/Faker/FakerService.php +++ b/src/Faker/FakerService.php @@ -7,7 +7,7 @@ use Faker\Factory; use Faker\Generator; -class FakerService +final class FakerService { private ?Generator $generator = null; diff --git a/src/Phar/Compiler.php b/src/Phar/Compiler.php index 1f7e6a67..c4530b17 100644 --- a/src/Phar/Compiler.php +++ b/src/Phar/Compiler.php @@ -11,7 +11,7 @@ use Symfony\Component\Finder\Finder; use UnexpectedValueException; -class Compiler +final class Compiler { private string $basePath; diff --git a/src/Phar/Minify/Json.php b/src/Phar/Minify/Json.php index fa4167bc..9d54bbe5 100644 --- a/src/Phar/Minify/Json.php +++ b/src/Phar/Minify/Json.php @@ -4,7 +4,7 @@ namespace Smile\GdprDump\Phar\Minify; -class Json implements MinifierInterface +final class Json implements MinifierInterface { /** * @inheritdoc diff --git a/src/Phar/Minify/Php.php b/src/Phar/Minify/Php.php index d37f588e..95de275e 100644 --- a/src/Phar/Minify/Php.php +++ b/src/Phar/Minify/Php.php @@ -4,7 +4,7 @@ namespace Smile\GdprDump\Phar\Minify; -class Php implements MinifierInterface +final class Php implements MinifierInterface { /** * @inheritdoc diff --git a/src/Util/ArrayHelper.php b/src/Util/ArrayHelper.php index 8618a309..3048b110 100644 --- a/src/Util/ArrayHelper.php +++ b/src/Util/ArrayHelper.php @@ -4,7 +4,7 @@ namespace Smile\GdprDump\Util; -class ArrayHelper +final class ArrayHelper { /** * Get an array value by path. diff --git a/tests/framework/Mock/Converter/ConverterMock.php b/tests/framework/Mock/Converter/ConverterMock.php index c4d4fe19..b9b3009d 100644 --- a/tests/framework/Mock/Converter/ConverterMock.php +++ b/tests/framework/Mock/Converter/ConverterMock.php @@ -6,7 +6,7 @@ use Smile\GdprDump\Converter\ConverterInterface; -class ConverterMock implements ConverterInterface +final class ConverterMock implements ConverterInterface { private string $prefix = 'test_'; diff --git a/tests/functional/Config/Validator/JsonSchemaValidatorTest.php b/tests/functional/Config/Validator/JsonSchemaValidatorTest.php index f21ad888..98696207 100644 --- a/tests/functional/Config/Validator/JsonSchemaValidatorTest.php +++ b/tests/functional/Config/Validator/JsonSchemaValidatorTest.php @@ -9,7 +9,7 @@ use Smile\GdprDump\Tests\Functional\TestCase; use stdClass; -class JsonSchemaValidatorTest extends TestCase +final class JsonSchemaValidatorTest extends TestCase { private JsonSchemaValidator $validator; diff --git a/tests/functional/Database/Metadata/MysqlMetadataTest.php b/tests/functional/Database/Metadata/MysqlMetadataTest.php index e5dcb487..c07434dc 100644 --- a/tests/functional/Database/Metadata/MysqlMetadataTest.php +++ b/tests/functional/Database/Metadata/MysqlMetadataTest.php @@ -9,7 +9,7 @@ use Smile\GdprDump\Database\Metadata\MysqlMetadata; use Smile\GdprDump\Tests\Functional\TestCase; -class MysqlMetadataTest extends TestCase +final class MysqlMetadataTest extends TestCase { /** * Test the "getTableNames" method. diff --git a/tests/functional/Dumper/Config/ConfigProcessorTest.php b/tests/functional/Dumper/Config/ConfigProcessorTest.php index 3c3f5df4..5a4e592f 100644 --- a/tests/functional/Dumper/Config/ConfigProcessorTest.php +++ b/tests/functional/Dumper/Config/ConfigProcessorTest.php @@ -8,7 +8,7 @@ use Smile\GdprDump\Dumper\Config\ConfigProcessor; use Smile\GdprDump\Tests\Functional\TestCase; -class ConfigProcessorTest extends TestCase +final class ConfigProcessorTest extends TestCase { /** * Test the table name resolution. diff --git a/tests/functional/Dumper/MysqlDumperTest.php b/tests/functional/Dumper/MysqlDumperTest.php index 3ae60e20..c6d4d58f 100644 --- a/tests/functional/Dumper/MysqlDumperTest.php +++ b/tests/functional/Dumper/MysqlDumperTest.php @@ -9,7 +9,7 @@ use Smile\GdprDump\Faker\FakerService; use Smile\GdprDump\Tests\Functional\TestCase; -class MysqlDumperTest extends TestCase +final class MysqlDumperTest extends TestCase { private string $dumpFile; diff --git a/tests/unit/Config/Compiler/CompilerTest.php b/tests/unit/Config/Compiler/CompilerTest.php index 199279bc..d6c99a00 100644 --- a/tests/unit/Config/Compiler/CompilerTest.php +++ b/tests/unit/Config/Compiler/CompilerTest.php @@ -10,7 +10,7 @@ use Smile\GdprDump\Config\ConfigInterface; use Smile\GdprDump\Tests\Unit\TestCase; -class CompilerTest extends TestCase +final class CompilerTest extends TestCase { /** * Test the config compiler. diff --git a/tests/unit/Config/Compiler/Processor/EnvVarProcessorTest.php b/tests/unit/Config/Compiler/Processor/EnvVarProcessorTest.php index 0bbc933d..ed523f9d 100644 --- a/tests/unit/Config/Compiler/Processor/EnvVarProcessorTest.php +++ b/tests/unit/Config/Compiler/Processor/EnvVarProcessorTest.php @@ -9,7 +9,7 @@ use Smile\GdprDump\Config\Config; use Smile\GdprDump\Tests\Unit\TestCase; -class EnvVarProcessorTest extends TestCase +final class EnvVarProcessorTest extends TestCase { /** * Assert that environment variables are processed successfully. diff --git a/tests/unit/Config/Compiler/Processor/Version/VersionConditionTest.php b/tests/unit/Config/Compiler/Processor/Version/VersionConditionTest.php index c027c664..961c6c17 100644 --- a/tests/unit/Config/Compiler/Processor/Version/VersionConditionTest.php +++ b/tests/unit/Config/Compiler/Processor/Version/VersionConditionTest.php @@ -8,7 +8,7 @@ use Smile\GdprDump\Config\Compiler\Processor\Version\VersionCondition; use Smile\GdprDump\Tests\Unit\TestCase; -class VersionConditionTest extends TestCase +final class VersionConditionTest extends TestCase { /** * Test if the condition is properly parsed. diff --git a/tests/unit/Config/Compiler/Processor/Version/VersionMatcherTest.php b/tests/unit/Config/Compiler/Processor/Version/VersionMatcherTest.php index 4c0511cc..1be20003 100644 --- a/tests/unit/Config/Compiler/Processor/Version/VersionMatcherTest.php +++ b/tests/unit/Config/Compiler/Processor/Version/VersionMatcherTest.php @@ -7,7 +7,7 @@ use Smile\GdprDump\Config\Compiler\Processor\Version\VersionMatcher; use Smile\GdprDump\Tests\Unit\TestCase; -class VersionMatcherTest extends TestCase +final class VersionMatcherTest extends TestCase { /** * Test the "match" method with a single condition. diff --git a/tests/unit/Config/Compiler/Processor/VersionProcessorTest.php b/tests/unit/Config/Compiler/Processor/VersionProcessorTest.php index ac479f78..a1af7675 100644 --- a/tests/unit/Config/Compiler/Processor/VersionProcessorTest.php +++ b/tests/unit/Config/Compiler/Processor/VersionProcessorTest.php @@ -9,7 +9,7 @@ use Smile\GdprDump\Config\Config; use Smile\GdprDump\Tests\Unit\TestCase; -class VersionProcessorTest extends TestCase +final class VersionProcessorTest extends TestCase { /** * Assert that "if_version" blocks are processed successfully. diff --git a/tests/unit/Config/ConfigTest.php b/tests/unit/Config/ConfigTest.php index b9d7c39c..fad72bef 100644 --- a/tests/unit/Config/ConfigTest.php +++ b/tests/unit/Config/ConfigTest.php @@ -7,7 +7,7 @@ use Smile\GdprDump\Config\Config; use Smile\GdprDump\Tests\Unit\TestCase; -class ConfigTest extends TestCase +final class ConfigTest extends TestCase { private array $data = [ 'string' => 'value', diff --git a/tests/unit/Config/Loader/ConfigLoaderTest.php b/tests/unit/Config/Loader/ConfigLoaderTest.php index 9613014c..24ac0014 100644 --- a/tests/unit/Config/Loader/ConfigLoaderTest.php +++ b/tests/unit/Config/Loader/ConfigLoaderTest.php @@ -11,7 +11,7 @@ use Smile\GdprDump\Config\Loader\ParseException; use Smile\GdprDump\Tests\Unit\TestCase; -class ConfigLoaderTest extends TestCase +final class ConfigLoaderTest extends TestCase { /** * Test the "load" method. diff --git a/tests/unit/Config/Loader/FileLocatorTest.php b/tests/unit/Config/Loader/FileLocatorTest.php index a0b479ca..aa1f2bc0 100644 --- a/tests/unit/Config/Loader/FileLocatorTest.php +++ b/tests/unit/Config/Loader/FileLocatorTest.php @@ -8,7 +8,7 @@ use Smile\GdprDump\Config\Loader\FileNotFoundException; use Smile\GdprDump\Tests\Unit\TestCase; -class FileLocatorTest extends TestCase +final class FileLocatorTest extends TestCase { /** * Check if the locator can resolve relative paths. diff --git a/tests/unit/Config/Validator/JsonSchemaValidatorTest.php b/tests/unit/Config/Validator/JsonSchemaValidatorTest.php index dd940c66..a99561c4 100644 --- a/tests/unit/Config/Validator/JsonSchemaValidatorTest.php +++ b/tests/unit/Config/Validator/JsonSchemaValidatorTest.php @@ -8,7 +8,7 @@ use Smile\GdprDump\Config\Validator\ValidationException; use Smile\GdprDump\Tests\Unit\TestCase; -class JsonSchemaValidatorTest extends TestCase +final class JsonSchemaValidatorTest extends TestCase { private string $schemaFile; diff --git a/tests/unit/Config/Validator/ValidationResultTest.php b/tests/unit/Config/Validator/ValidationResultTest.php index 69ad07c6..4d057b86 100644 --- a/tests/unit/Config/Validator/ValidationResultTest.php +++ b/tests/unit/Config/Validator/ValidationResultTest.php @@ -7,7 +7,7 @@ use Smile\GdprDump\Config\Validator\ValidationResult; use Smile\GdprDump\Tests\Unit\TestCase; -class ValidationResultTest extends TestCase +final class ValidationResultTest extends TestCase { /** * Test the "valid" property. diff --git a/tests/unit/Console/ApplicationTest.php b/tests/unit/Console/ApplicationTest.php index 867b5be0..dcb7a6b2 100644 --- a/tests/unit/Console/ApplicationTest.php +++ b/tests/unit/Console/ApplicationTest.php @@ -7,7 +7,7 @@ use Smile\GdprDump\Console\Application; use Smile\GdprDump\Tests\Unit\TestCase; -class ApplicationTest extends TestCase +final class ApplicationTest extends TestCase { /** * Test the "getVersion" method. diff --git a/tests/unit/Converter/Anonymizer/AnonymizeDateTimeTest.php b/tests/unit/Converter/Anonymizer/AnonymizeDateTimeTest.php index 7b58b7a9..0dfee16b 100644 --- a/tests/unit/Converter/Anonymizer/AnonymizeDateTimeTest.php +++ b/tests/unit/Converter/Anonymizer/AnonymizeDateTimeTest.php @@ -8,7 +8,7 @@ use Smile\GdprDump\Converter\Parameters\ValidationException; use UnexpectedValueException; -class AnonymizeDateTimeTest extends AnonymizeDateTest +final class AnonymizeDateTimeTest extends AnonymizeDateTest { /** * Test the converter. diff --git a/tests/unit/Converter/Anonymizer/AnonymizeEmailTest.php b/tests/unit/Converter/Anonymizer/AnonymizeEmailTest.php index aef705f6..6960b672 100644 --- a/tests/unit/Converter/Anonymizer/AnonymizeEmailTest.php +++ b/tests/unit/Converter/Anonymizer/AnonymizeEmailTest.php @@ -8,7 +8,7 @@ use Smile\GdprDump\Converter\Parameters\ValidationException; use Smile\GdprDump\Tests\Unit\Converter\TestCase; -class AnonymizeEmailTest extends TestCase +final class AnonymizeEmailTest extends TestCase { /** * Test the converter. diff --git a/tests/unit/Converter/Anonymizer/AnonymizeNumberTest.php b/tests/unit/Converter/Anonymizer/AnonymizeNumberTest.php index 7c49e823..bc56d609 100644 --- a/tests/unit/Converter/Anonymizer/AnonymizeNumberTest.php +++ b/tests/unit/Converter/Anonymizer/AnonymizeNumberTest.php @@ -8,7 +8,7 @@ use Smile\GdprDump\Converter\Parameters\ValidationException; use Smile\GdprDump\Tests\Unit\Converter\TestCase; -class AnonymizeNumberTest extends TestCase +final class AnonymizeNumberTest extends TestCase { /** * Test the converter. diff --git a/tests/unit/Converter/Anonymizer/AnonymizeTextTest.php b/tests/unit/Converter/Anonymizer/AnonymizeTextTest.php index 99e85324..81a8161c 100644 --- a/tests/unit/Converter/Anonymizer/AnonymizeTextTest.php +++ b/tests/unit/Converter/Anonymizer/AnonymizeTextTest.php @@ -8,7 +8,7 @@ use Smile\GdprDump\Converter\Parameters\ValidationException; use Smile\GdprDump\Tests\Unit\Converter\TestCase; -class AnonymizeTextTest extends TestCase +final class AnonymizeTextTest extends TestCase { /** * Test the converter. diff --git a/tests/unit/Converter/ConditionBuilderTest.php b/tests/unit/Converter/ConditionBuilderTest.php index 6c8439e9..9ab118f9 100644 --- a/tests/unit/Converter/ConditionBuilderTest.php +++ b/tests/unit/Converter/ConditionBuilderTest.php @@ -8,7 +8,7 @@ use Smile\GdprDump\Converter\ConditionBuilder; use Smile\GdprDump\Tests\Unit\TestCase; -class ConditionBuilderTest extends TestCase +final class ConditionBuilderTest extends TestCase { /** * Test the condition builder. diff --git a/tests/unit/Converter/ConverterBuilderTest.php b/tests/unit/Converter/ConverterBuilderTest.php index db44b802..310904c3 100644 --- a/tests/unit/Converter/ConverterBuilderTest.php +++ b/tests/unit/Converter/ConverterBuilderTest.php @@ -5,6 +5,7 @@ namespace Smile\GdprDump\Tests\Unit\Converter; use RuntimeException; +use Smile\GdprDump\Converter\ConditionBuilder; use Smile\GdprDump\Converter\ConverterBuilder; use Smile\GdprDump\Converter\ConverterFactory; use Smile\GdprDump\Converter\Proxy\Cache; @@ -12,10 +13,13 @@ use Smile\GdprDump\Converter\Proxy\Conditional; use Smile\GdprDump\Converter\Proxy\Faker; use Smile\GdprDump\Converter\Proxy\Unique; +use Smile\GdprDump\DependencyInjection\ConverterAliasResolver; +use Smile\GdprDump\Faker\FakerService; use Smile\GdprDump\Tests\Framework\Mock\Converter\ConverterMock; +use Symfony\Component\DependencyInjection\Container; use UnexpectedValueException; -class ConverterBuilderTest extends TestCase +final class ConverterBuilderTest extends TestCase { /** * Test the converter creation from an array definition. @@ -212,25 +216,15 @@ public function testConvertersParameterMalformed(): void */ private function createBuilder(): ConverterBuilder { - $containerMock = $this->createMock(ConverterFactory::class); - $containerMock - ->method('create') - ->willReturnCallback( - fn (string $value, array $parameters) => match ($value) { - // Converters used in the context of this unit test - 'cache' => $this->createConverter(Cache::class, $parameters), - 'chain' => $this->createConverter(Chain::class, $parameters), - 'conditional' => $this->createConditionalConverter($parameters), - 'faker' => $this->createFakerConverter($parameters), - 'mock' => $this->createConverter(ConverterMock::class, $parameters), - 'notExists' => throw new RuntimeException($value), - 'unique' => $this->createConverter(Unique::class, $parameters), - default => throw new UnexpectedValueException( - sprintf('The converter "%s" was not expected in this unit case.', $value) - ), - } - ); - - return new ConverterBuilder($containerMock); + $resolver = new ConverterAliasResolver(); + $container = new Container(); + $container->set($resolver->getAliasByName('cache'), new Cache()); + $container->set($resolver->getAliasByName('chain'), new Chain()); + $container->set($resolver->getAliasByName('conditional'), new Conditional(new ConditionBuilder())); + $container->set($resolver->getAliasByName('faker'), new Faker(new FakerService())); + $container->set($resolver->getAliasByName('mock'), new ConverterMock()); + $container->set($resolver->getAliasByName('unique'), new Unique()); + + return new ConverterBuilder(new ConverterFactory($container, $resolver)); } } diff --git a/tests/unit/Converter/ConverterFactoryTest.php b/tests/unit/Converter/ConverterFactoryTest.php index 3b3feab5..11fd35b6 100644 --- a/tests/unit/Converter/ConverterFactoryTest.php +++ b/tests/unit/Converter/ConverterFactoryTest.php @@ -6,13 +6,11 @@ use RuntimeException; use Smile\GdprDump\Converter\ConverterFactory; -use Smile\GdprDump\DependencyInjection\Compiler\ConverterAliasPass; use Smile\GdprDump\DependencyInjection\ConverterAliasResolver; use Smile\GdprDump\Tests\Framework\Mock\Converter\ConverterMock; use Symfony\Component\DependencyInjection\Container; -use Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException; -class ConverterFactoryTest extends TestCase +final class ConverterFactoryTest extends TestCase { /** * Test the converter factory. @@ -20,7 +18,7 @@ class ConverterFactoryTest extends TestCase public function testConverterCreation(): void { $converter = $this->createFactory() - ->create('test'); + ->create('mock'); $this->assertInstanceOf(ConverterMock::class, $converter); } @@ -40,18 +38,10 @@ public function testConverterNotDefined(): void */ private function createFactory(): ConverterFactory { - $containerMock = $this->createMock(Container::class); - $containerMock - ->method('get') - ->will( - $this->returnCallback( - fn (string $value) => match ($value) { - ConverterAliasPass::ALIAS_PREFIX . 'test' => new ConverterMock(), - default => throw new ServiceNotFoundException(ConverterAliasPass::ALIAS_PREFIX . $value), - } - ) - ); - - return new ConverterFactory($containerMock, new ConverterAliasResolver()); + $resolver = new ConverterAliasResolver(); + $container = new Container(); + $container->set($resolver->getAliasByName('mock'), new ConverterMock()); + + return new ConverterFactory($container, $resolver); } } diff --git a/tests/unit/Converter/Generator/NumberBetweenTest.php b/tests/unit/Converter/Generator/NumberBetweenTest.php index 46ce53f7..04f94e8e 100644 --- a/tests/unit/Converter/Generator/NumberBetweenTest.php +++ b/tests/unit/Converter/Generator/NumberBetweenTest.php @@ -8,7 +8,7 @@ use Smile\GdprDump\Converter\Parameters\ValidationException; use Smile\GdprDump\Tests\Unit\Converter\TestCase; -class NumberBetweenTest extends TestCase +final class NumberBetweenTest extends TestCase { /** * Test the converter. diff --git a/tests/unit/Converter/Generator/RandomDateTimeTest.php b/tests/unit/Converter/Generator/RandomDateTimeTest.php index 4d3b2acb..b969157a 100644 --- a/tests/unit/Converter/Generator/RandomDateTimeTest.php +++ b/tests/unit/Converter/Generator/RandomDateTimeTest.php @@ -8,7 +8,7 @@ use Smile\GdprDump\Converter\Generator\RandomDateTime; use Smile\GdprDump\Converter\Parameters\ValidationException; -class RandomDateTimeTest extends RandomDateTest +final class RandomDateTimeTest extends RandomDateTest { /** * Test the converter. diff --git a/tests/unit/Converter/Generator/RandomEmailTest.php b/tests/unit/Converter/Generator/RandomEmailTest.php index 9ac6edfa..7ce75a83 100644 --- a/tests/unit/Converter/Generator/RandomEmailTest.php +++ b/tests/unit/Converter/Generator/RandomEmailTest.php @@ -8,7 +8,7 @@ use Smile\GdprDump\Converter\Parameters\ValidationException; use Smile\GdprDump\Tests\Unit\Converter\TestCase; -class RandomEmailTest extends TestCase +final class RandomEmailTest extends TestCase { /** * Test the converter. diff --git a/tests/unit/Converter/Generator/RandomTextTest.php b/tests/unit/Converter/Generator/RandomTextTest.php index facdf44f..3a0c3b6e 100644 --- a/tests/unit/Converter/Generator/RandomTextTest.php +++ b/tests/unit/Converter/Generator/RandomTextTest.php @@ -8,7 +8,7 @@ use Smile\GdprDump\Converter\Parameters\ValidationException; use Smile\GdprDump\Tests\Unit\Converter\TestCase; -class RandomTextTest extends TestCase +final class RandomTextTest extends TestCase { /** * Test the converter. diff --git a/tests/unit/Converter/Generator/SetNullTest.php b/tests/unit/Converter/Generator/SetNullTest.php index 104a5964..8e336c25 100644 --- a/tests/unit/Converter/Generator/SetNullTest.php +++ b/tests/unit/Converter/Generator/SetNullTest.php @@ -7,7 +7,7 @@ use Smile\GdprDump\Converter\Generator\SetNull; use Smile\GdprDump\Tests\Unit\Converter\TestCase; -class SetNullTest extends TestCase +final class SetNullTest extends TestCase { /** * Test the converter. diff --git a/tests/unit/Converter/Generator/SetValueTest.php b/tests/unit/Converter/Generator/SetValueTest.php index 1f6f390d..647f99e3 100644 --- a/tests/unit/Converter/Generator/SetValueTest.php +++ b/tests/unit/Converter/Generator/SetValueTest.php @@ -8,7 +8,7 @@ use Smile\GdprDump\Converter\Parameters\ValidationException; use Smile\GdprDump\Tests\Unit\Converter\TestCase; -class SetValueTest extends TestCase +final class SetValueTest extends TestCase { /** * Test the converter. diff --git a/tests/unit/Converter/Parameters/InputParametersTest.php b/tests/unit/Converter/Parameters/InputParametersTest.php index d3fa818f..d7fe3c4e 100644 --- a/tests/unit/Converter/Parameters/InputParametersTest.php +++ b/tests/unit/Converter/Parameters/InputParametersTest.php @@ -7,7 +7,7 @@ use Smile\GdprDump\Converter\Parameters\InputParameters; use Smile\GdprDump\Tests\Unit\TestCase; -class InputParametersTest extends TestCase +final class InputParametersTest extends TestCase { /** * Test the input parameters object. diff --git a/tests/unit/Converter/Parameters/ParameterProcessorTest.php b/tests/unit/Converter/Parameters/ParameterProcessorTest.php index 1685333c..b36b11a9 100644 --- a/tests/unit/Converter/Parameters/ParameterProcessorTest.php +++ b/tests/unit/Converter/Parameters/ParameterProcessorTest.php @@ -10,7 +10,7 @@ use Smile\GdprDump\Tests\Unit\TestCase; use stdClass; -class ParameterProcessorTest extends TestCase +final class ParameterProcessorTest extends TestCase { public function testProcessor(): void { diff --git a/tests/unit/Converter/Parameters/ParameterTest.php b/tests/unit/Converter/Parameters/ParameterTest.php index feba5350..c15c9c10 100644 --- a/tests/unit/Converter/Parameters/ParameterTest.php +++ b/tests/unit/Converter/Parameters/ParameterTest.php @@ -7,7 +7,7 @@ use Smile\GdprDump\Converter\Parameters\Parameter; use Smile\GdprDump\Tests\Unit\TestCase; -class ParameterTest extends TestCase +final class ParameterTest extends TestCase { /** * Test the parameter object. diff --git a/tests/unit/Converter/Proxy/CacheTest.php b/tests/unit/Converter/Proxy/CacheTest.php index 4bd55b86..fae5b00f 100644 --- a/tests/unit/Converter/Proxy/CacheTest.php +++ b/tests/unit/Converter/Proxy/CacheTest.php @@ -11,7 +11,7 @@ use Smile\GdprDump\Tests\Unit\Converter\TestCase; use stdClass; -class CacheTest extends TestCase +final class CacheTest extends TestCase { /** * Assert that values are properly cached. diff --git a/tests/unit/Converter/Proxy/ChainTest.php b/tests/unit/Converter/Proxy/ChainTest.php index e6041f52..1e9c09da 100644 --- a/tests/unit/Converter/Proxy/ChainTest.php +++ b/tests/unit/Converter/Proxy/ChainTest.php @@ -9,7 +9,7 @@ use Smile\GdprDump\Tests\Framework\Mock\Converter\ConverterMock; use Smile\GdprDump\Tests\Unit\Converter\TestCase; -class ChainTest extends TestCase +final class ChainTest extends TestCase { /** * Test the converter. diff --git a/tests/unit/Converter/Proxy/ConditionalTest.php b/tests/unit/Converter/Proxy/ConditionalTest.php index 8212a560..0d1c6eb7 100644 --- a/tests/unit/Converter/Proxy/ConditionalTest.php +++ b/tests/unit/Converter/Proxy/ConditionalTest.php @@ -6,18 +6,19 @@ use Smile\GdprDump\Converter\ConverterInterface; use Smile\GdprDump\Converter\Parameters\ValidationException; +use Smile\GdprDump\Converter\Proxy\Conditional; use Smile\GdprDump\Tests\Framework\Mock\Converter\ConverterMock; use Smile\GdprDump\Tests\Unit\Converter\TestCase; use stdClass; -class ConditionalTest extends TestCase +final class ConditionalTest extends TestCase { /** * Test the converter. */ public function testCondition(): void { - $converter = $this->createConditionalConverter([ + $converter = $this->createConverter(Conditional::class, [ 'condition' => '{{id}} === @my_var', 'if_true_converter' => $this->createIfTrueConverter(), 'if_false_converter' => $this->createIfFalseConverter(), @@ -39,7 +40,7 @@ public function testCondition(): void public function testConvertersNotSet(): void { $this->expectException(ValidationException::class); - $this->createConditionalConverter(['condition' => '{{id}} === 1']); + $this->createConverter(Conditional::class, ['condition' => '{{id}} === 1']); } /** @@ -49,7 +50,7 @@ public function testConvertersNotSet(): void public function testIfTrueConverterNotValid(): void { $this->expectException(ValidationException::class); - $this->createConditionalConverter(['if_true_converter' => new stdClass()]); + $this->createConverter(Conditional::class, ['if_true_converter' => new stdClass()]); } /** @@ -59,7 +60,7 @@ public function testIfTrueConverterNotValid(): void public function testIfFalseConverterNotValid(): void { $this->expectException(ValidationException::class); - $this->createConditionalConverter(['if_false_converter' => new stdClass()]); + $this->createConverter(Conditional::class, ['if_false_converter' => new stdClass()]); } /** @@ -68,7 +69,7 @@ public function testIfFalseConverterNotValid(): void public function testConditionNotSet(): void { $this->expectException(ValidationException::class); - $this->createConditionalConverter(['if_true_converter' => $this->createIfTrueConverter()]); + $this->createConverter(Conditional::class, ['if_true_converter' => $this->createIfTrueConverter()]); } /** @@ -77,7 +78,7 @@ public function testConditionNotSet(): void public function testEmptyCondition(): void { $this->expectException(ValidationException::class); - $this->createConditionalConverter([ + $this->createConverter(Conditional::class, [ 'if_true_converter' => $this->createIfTrueConverter(), 'condition' => '', ]); diff --git a/tests/unit/Converter/Proxy/FakerTest.php b/tests/unit/Converter/Proxy/FakerTest.php index 0bba98d4..e4233c4e 100644 --- a/tests/unit/Converter/Proxy/FakerTest.php +++ b/tests/unit/Converter/Proxy/FakerTest.php @@ -5,16 +5,17 @@ namespace Smile\GdprDump\Tests\Unit\Converter\Proxy; use Smile\GdprDump\Converter\Parameters\ValidationException; +use Smile\GdprDump\Converter\Proxy\Faker; use Smile\GdprDump\Tests\Unit\Converter\TestCase; -class FakerTest extends TestCase +final class FakerTest extends TestCase { /** * Test the converter. */ public function testConverter(): void { - $converter = $this->createFakerConverter([ + $converter = $this->createConverter(Faker::class, [ 'formatter' => 'numberBetween', 'arguments' => [1, 1], ]); @@ -28,7 +29,7 @@ public function testConverter(): void */ public function testValuePlaceholder(): void { - $converter = $this->createFakerConverter([ + $converter = $this->createConverter(Faker::class, [ 'formatter' => 'numberBetween', 'arguments' => ['{{value}}', '{{value}}'], ]); @@ -43,7 +44,7 @@ public function testValuePlaceholder(): void public function testFormatterNotSet(): void { $this->expectException(ValidationException::class); - $this->createFakerConverter(); + $this->createConverter(Faker::class); } /** @@ -52,7 +53,7 @@ public function testFormatterNotSet(): void public function testInvalidFormatter(): void { $this->expectException(ValidationException::class); - $this->createFakerConverter([ + $this->createConverter(Faker::class, [ 'formatter' => 'doesNotExist', 'arguments' => [1, 1], ]); diff --git a/tests/unit/Converter/Proxy/FromContextTest.php b/tests/unit/Converter/Proxy/FromContextTest.php index 59634490..dfb60f35 100644 --- a/tests/unit/Converter/Proxy/FromContextTest.php +++ b/tests/unit/Converter/Proxy/FromContextTest.php @@ -8,7 +8,7 @@ use Smile\GdprDump\Converter\Proxy\FromContext; use Smile\GdprDump\Tests\Unit\Converter\TestCase; -class FromContextTest extends TestCase +final class FromContextTest extends TestCase { /** * Test the converter. diff --git a/tests/unit/Converter/Proxy/JsonDataTest.php b/tests/unit/Converter/Proxy/JsonDataTest.php index 44411fb4..9224cc1a 100644 --- a/tests/unit/Converter/Proxy/JsonDataTest.php +++ b/tests/unit/Converter/Proxy/JsonDataTest.php @@ -9,7 +9,7 @@ use Smile\GdprDump\Tests\Framework\Mock\Converter\ConverterMock; use Smile\GdprDump\Tests\Unit\Converter\TestCase; -class JsonDataTest extends TestCase +final class JsonDataTest extends TestCase { /** * Test the converter. diff --git a/tests/unit/Converter/Proxy/SerializedDataTest.php b/tests/unit/Converter/Proxy/SerializedDataTest.php index 9a5cae8e..50d570e0 100644 --- a/tests/unit/Converter/Proxy/SerializedDataTest.php +++ b/tests/unit/Converter/Proxy/SerializedDataTest.php @@ -9,7 +9,7 @@ use Smile\GdprDump\Tests\Framework\Mock\Converter\ConverterMock; use Smile\GdprDump\Tests\Unit\Converter\TestCase; -class SerializedDataTest extends TestCase +final class SerializedDataTest extends TestCase { /** * Test the converter. diff --git a/tests/unit/Converter/Proxy/UniqueTest.php b/tests/unit/Converter/Proxy/UniqueTest.php index 6a8fb13b..b3cff576 100644 --- a/tests/unit/Converter/Proxy/UniqueTest.php +++ b/tests/unit/Converter/Proxy/UniqueTest.php @@ -12,7 +12,7 @@ use Smile\GdprDump\Tests\Unit\Converter\TestCase; use stdClass; -class UniqueTest extends TestCase +final class UniqueTest extends TestCase { /** * Test the converter. diff --git a/tests/unit/Converter/Randomizer/RandomizeEmailTest.php b/tests/unit/Converter/Randomizer/RandomizeEmailTest.php index b37b603a..70bee350 100644 --- a/tests/unit/Converter/Randomizer/RandomizeEmailTest.php +++ b/tests/unit/Converter/Randomizer/RandomizeEmailTest.php @@ -8,7 +8,7 @@ use Smile\GdprDump\Converter\Randomizer\RandomizeEmail; use Smile\GdprDump\Tests\Unit\Converter\TestCase; -class RandomizeEmailTest extends TestCase +final class RandomizeEmailTest extends TestCase { /** * Test the converter. diff --git a/tests/unit/Converter/Randomizer/RandomizeNumberTest.php b/tests/unit/Converter/Randomizer/RandomizeNumberTest.php index 016da44e..5e48f4bb 100644 --- a/tests/unit/Converter/Randomizer/RandomizeNumberTest.php +++ b/tests/unit/Converter/Randomizer/RandomizeNumberTest.php @@ -7,7 +7,7 @@ use Smile\GdprDump\Converter\Randomizer\RandomizeNumber; use Smile\GdprDump\Tests\Unit\Converter\TestCase; -class RandomizeNumberTest extends TestCase +final class RandomizeNumberTest extends TestCase { /** * Test the converter. diff --git a/tests/unit/Converter/Randomizer/RandomizeTextTest.php b/tests/unit/Converter/Randomizer/RandomizeTextTest.php index 1a7665e0..47b3cb19 100644 --- a/tests/unit/Converter/Randomizer/RandomizeTextTest.php +++ b/tests/unit/Converter/Randomizer/RandomizeTextTest.php @@ -8,7 +8,7 @@ use Smile\GdprDump\Converter\Randomizer\RandomizeText; use Smile\GdprDump\Tests\Unit\Converter\TestCase; -class RandomizeTextTest extends TestCase +final class RandomizeTextTest extends TestCase { /** * Test the converter. diff --git a/tests/unit/Converter/TestCase.php b/tests/unit/Converter/TestCase.php index 0d0931fb..47e481ef 100644 --- a/tests/unit/Converter/TestCase.php +++ b/tests/unit/Converter/TestCase.php @@ -12,7 +12,7 @@ use Smile\GdprDump\Faker\FakerService; use Smile\GdprDump\Tests\Unit\TestCase as UnitTestCase; -class TestCase extends UnitTestCase +abstract class TestCase extends UnitTestCase { /** * Create a converter. @@ -25,29 +25,12 @@ public function createConverter(string $className, array $parameters = []): Conv ); } - $converter = new $className(); - $converter->setParameters($parameters); - - return $converter; - } + $converter = match ($className) { + Conditional::class => new Conditional(new ConditionBuilder()), + Faker::class => new Faker(new FakerService()), + default => new $className(), + }; - /** - * Create a conditional converter. - */ - public function createConditionalConverter(array $parameters = []): ConverterInterface - { - $converter = new Conditional(new ConditionBuilder()); - $converter->setParameters($parameters); - - return $converter; - } - - /** - * Create a Faker converter. - */ - public function createFakerConverter(array $parameters = []): ConverterInterface - { - $converter = new Faker(new FakerService()); $converter->setParameters($parameters); return $converter; diff --git a/tests/unit/Converter/Transformer/AppendTextTest.php b/tests/unit/Converter/Transformer/AppendTextTest.php index aa8bace0..996c67ed 100644 --- a/tests/unit/Converter/Transformer/AppendTextTest.php +++ b/tests/unit/Converter/Transformer/AppendTextTest.php @@ -8,7 +8,7 @@ use Smile\GdprDump\Converter\Transformer\AppendText; use Smile\GdprDump\Tests\Unit\Converter\TestCase; -class AppendTextTest extends TestCase +final class AppendTextTest extends TestCase { /** * Test the converter. diff --git a/tests/unit/Converter/Transformer/HashTest.php b/tests/unit/Converter/Transformer/HashTest.php index 7ffe7749..d2cc973e 100644 --- a/tests/unit/Converter/Transformer/HashTest.php +++ b/tests/unit/Converter/Transformer/HashTest.php @@ -8,7 +8,7 @@ use Smile\GdprDump\Converter\Transformer\Hash; use Smile\GdprDump\Tests\Unit\Converter\TestCase; -class HashTest extends TestCase +final class HashTest extends TestCase { /** * Test the converter. diff --git a/tests/unit/Converter/Transformer/PrependTextTest.php b/tests/unit/Converter/Transformer/PrependTextTest.php index 2d67e986..08549f5b 100644 --- a/tests/unit/Converter/Transformer/PrependTextTest.php +++ b/tests/unit/Converter/Transformer/PrependTextTest.php @@ -8,7 +8,7 @@ use Smile\GdprDump\Converter\Transformer\PrependText; use Smile\GdprDump\Tests\Unit\Converter\TestCase; -class PrependTextTest extends TestCase +final class PrependTextTest extends TestCase { /** * Test the converter. diff --git a/tests/unit/Converter/Transformer/RegexReplaceTest.php b/tests/unit/Converter/Transformer/RegexReplaceTest.php index 83b4f079..5e68c98a 100644 --- a/tests/unit/Converter/Transformer/RegexReplaceTest.php +++ b/tests/unit/Converter/Transformer/RegexReplaceTest.php @@ -8,7 +8,7 @@ use Smile\GdprDump\Converter\Transformer\RegexReplace; use Smile\GdprDump\Tests\Unit\Converter\TestCase; -class RegexReplaceTest extends TestCase +final class RegexReplaceTest extends TestCase { /** * Test the converter. diff --git a/tests/unit/Converter/Transformer/ReplaceTest.php b/tests/unit/Converter/Transformer/ReplaceTest.php index db77273a..39462220 100644 --- a/tests/unit/Converter/Transformer/ReplaceTest.php +++ b/tests/unit/Converter/Transformer/ReplaceTest.php @@ -8,7 +8,7 @@ use Smile\GdprDump\Converter\Transformer\Replace; use Smile\GdprDump\Tests\Unit\Converter\TestCase; -class ReplaceTest extends TestCase +final class ReplaceTest extends TestCase { /** * Test the converter. diff --git a/tests/unit/Converter/Transformer/ToLowerTest.php b/tests/unit/Converter/Transformer/ToLowerTest.php index b0a421f2..264b9206 100644 --- a/tests/unit/Converter/Transformer/ToLowerTest.php +++ b/tests/unit/Converter/Transformer/ToLowerTest.php @@ -7,7 +7,7 @@ use Smile\GdprDump\Converter\Transformer\ToLower; use Smile\GdprDump\Tests\Unit\Converter\TestCase; -class ToLowerTest extends TestCase +final class ToLowerTest extends TestCase { /** * Test the converter. diff --git a/tests/unit/Converter/Transformer/ToUpperTest.php b/tests/unit/Converter/Transformer/ToUpperTest.php index a3b26688..856f033e 100644 --- a/tests/unit/Converter/Transformer/ToUpperTest.php +++ b/tests/unit/Converter/Transformer/ToUpperTest.php @@ -7,7 +7,7 @@ use Smile\GdprDump\Converter\Transformer\ToUpper; use Smile\GdprDump\Tests\Unit\Converter\TestCase; -class ToUpperTest extends TestCase +final class ToUpperTest extends TestCase { /** * Test the converter. diff --git a/tests/unit/Database/Driver/MysqlDriverTest.php b/tests/unit/Database/Driver/MysqlDriverTest.php index c8cc8536..bc0fdfe6 100644 --- a/tests/unit/Database/Driver/MysqlDriverTest.php +++ b/tests/unit/Database/Driver/MysqlDriverTest.php @@ -8,7 +8,7 @@ use Smile\GdprDump\Database\ParameterBag; use Smile\GdprDump\Tests\Unit\TestCase; -class MysqlDriverTest extends TestCase +final class MysqlDriverTest extends TestCase { /** * Test if the DSN is generated successfully. diff --git a/tests/unit/Database/Metadata/Definition/Constraint/ForeignKeyTest.php b/tests/unit/Database/Metadata/Definition/Constraint/ForeignKeyTest.php index 9637fc8a..dc2525be 100644 --- a/tests/unit/Database/Metadata/Definition/Constraint/ForeignKeyTest.php +++ b/tests/unit/Database/Metadata/Definition/Constraint/ForeignKeyTest.php @@ -7,7 +7,7 @@ use Smile\GdprDump\Database\Metadata\Definition\Constraint\ForeignKey; use Smile\GdprDump\Tests\Unit\TestCase; -class ForeignKeyTest extends TestCase +final class ForeignKeyTest extends TestCase { /** * Test the getters methods. diff --git a/tests/unit/Database/ParameterBagTest.php b/tests/unit/Database/ParameterBagTest.php index 48a6a6d8..24fd498a 100644 --- a/tests/unit/Database/ParameterBagTest.php +++ b/tests/unit/Database/ParameterBagTest.php @@ -9,7 +9,7 @@ use Smile\GdprDump\Tests\Unit\TestCase; use UnexpectedValueException; -class ParameterBagTest extends TestCase +final class ParameterBagTest extends TestCase { /** * Test the getter methods. diff --git a/tests/unit/Database/TableDependencyResolverTest.php b/tests/unit/Database/TableDependencyResolverTest.php index 71fb2db5..c7c64558 100644 --- a/tests/unit/Database/TableDependencyResolverTest.php +++ b/tests/unit/Database/TableDependencyResolverTest.php @@ -5,13 +5,13 @@ namespace Smile\GdprDump\Tests\Unit\Database; use Smile\GdprDump\Database\Metadata\Definition\Constraint\ForeignKey; -use Smile\GdprDump\Database\Metadata\MysqlMetadata; +use Smile\GdprDump\Database\Metadata\MetadataInterface; use Smile\GdprDump\Database\TableDependencyResolver; use Smile\GdprDump\Dumper\Config\Definition\FilterPropagationSettings; -use Smile\GdprDump\Dumper\Config\DumperConfig; +use Smile\GdprDump\Dumper\Config\DumperConfigInterface; use Smile\GdprDump\Tests\Unit\TestCase; -class TableDependencyResolverTest extends TestCase +final class TableDependencyResolverTest extends TestCase { /** * Test the "getDependencies" method. @@ -174,14 +174,14 @@ public function testIgnoredForeignKeys(): void */ private function createResolver(array $foreignKeyMap, array $ignoredForeignKeys = []): TableDependencyResolver { - $metadataMock = $this->createMock(MysqlMetadata::class); + $metadataMock = $this->createMock(MetadataInterface::class); $metadataMock->expects($this->once()) ->method('getTableNames') ->willReturn(array_column($foreignKeyMap, 0)); $metadataMock->method('getTableForeignKeys') ->willReturnMap($foreignKeyMap); - $configMock = $this->createMock(DumperConfig::class); + $configMock = $this->createMock(DumperConfigInterface::class); $configMock->method('getFilterPropagationSettings') ->willReturn(new FilterPropagationSettings(true, $ignoredForeignKeys)); diff --git a/tests/unit/DependencyInjection/ConverterAliasResolverTest.php b/tests/unit/DependencyInjection/ConverterAliasResolverTest.php index 947836b7..a5d62d42 100644 --- a/tests/unit/DependencyInjection/ConverterAliasResolverTest.php +++ b/tests/unit/DependencyInjection/ConverterAliasResolverTest.php @@ -8,7 +8,7 @@ use Smile\GdprDump\DependencyInjection\ConverterAliasResolver; use Smile\GdprDump\Tests\Unit\TestCase; -class ConverterAliasResolverTest extends TestCase +final class ConverterAliasResolverTest extends TestCase { /** * Test the alias resolver. diff --git a/tests/unit/Dumper/Config/ConfigProcessorTest.php b/tests/unit/Dumper/Config/ConfigProcessorTest.php index 89d3e736..a982a20a 100644 --- a/tests/unit/Dumper/Config/ConfigProcessorTest.php +++ b/tests/unit/Dumper/Config/ConfigProcessorTest.php @@ -5,11 +5,11 @@ namespace Smile\GdprDump\Tests\Unit\Dumper\Config; use Smile\GdprDump\Config\Config; -use Smile\GdprDump\Database\Metadata\MysqlMetadata; +use Smile\GdprDump\Database\Metadata\MetadataInterface; use Smile\GdprDump\Dumper\Config\ConfigProcessor; use Smile\GdprDump\Tests\Unit\TestCase; -class ConfigProcessorTest extends TestCase +final class ConfigProcessorTest extends TestCase { /** * Test the config processor. @@ -70,7 +70,7 @@ public function testProcessorWithEmptyConfig(): void */ private function createConfigProcessor(): ConfigProcessor { - $metadataMock = $this->createMock(MysqlMetadata::class); + $metadataMock = $this->createMock(MetadataInterface::class); $metadataMock->expects($this->atMost(1)) ->method('getTableNames') ->willReturn(['table1', 'table2', 'table3']); diff --git a/tests/unit/Dumper/Config/Definition/FakerSettingsTest.php b/tests/unit/Dumper/Config/Definition/FakerSettingsTest.php index 8159ad56..3355eff9 100644 --- a/tests/unit/Dumper/Config/Definition/FakerSettingsTest.php +++ b/tests/unit/Dumper/Config/Definition/FakerSettingsTest.php @@ -7,7 +7,7 @@ use Smile\GdprDump\Dumper\Config\Definition\FakerSettings; use Smile\GdprDump\Tests\Unit\TestCase; -class FakerSettingsTest extends TestCase +final class FakerSettingsTest extends TestCase { /** * Test the creation of a faker settings object. diff --git a/tests/unit/Dumper/Config/Definition/FilterPropagationSettingsTest.php b/tests/unit/Dumper/Config/Definition/FilterPropagationSettingsTest.php index 2ff34169..28594971 100644 --- a/tests/unit/Dumper/Config/Definition/FilterPropagationSettingsTest.php +++ b/tests/unit/Dumper/Config/Definition/FilterPropagationSettingsTest.php @@ -7,7 +7,7 @@ use Smile\GdprDump\Dumper\Config\Definition\FilterPropagationSettings; use Smile\GdprDump\Tests\Unit\TestCase; -class FilterPropagationSettingsTest extends TestCase +final class FilterPropagationSettingsTest extends TestCase { /** * Test the creation of a filter propagation settings object. diff --git a/tests/unit/Dumper/Config/Definition/Table/SortOrderTest.php b/tests/unit/Dumper/Config/Definition/Table/SortOrderTest.php index 5470f42d..55c4e573 100644 --- a/tests/unit/Dumper/Config/Definition/Table/SortOrderTest.php +++ b/tests/unit/Dumper/Config/Definition/Table/SortOrderTest.php @@ -8,7 +8,7 @@ use Smile\GdprDump\Tests\Unit\TestCase; use UnexpectedValueException; -class SortOrderTest extends TestCase +final class SortOrderTest extends TestCase { /** * Test the creation of a sort order. diff --git a/tests/unit/Dumper/Config/Definition/TableConfigCollectionTest.php b/tests/unit/Dumper/Config/Definition/TableConfigCollectionTest.php index 3e7bac6f..53939db7 100644 --- a/tests/unit/Dumper/Config/Definition/TableConfigCollectionTest.php +++ b/tests/unit/Dumper/Config/Definition/TableConfigCollectionTest.php @@ -9,7 +9,7 @@ use Smile\GdprDump\Tests\Unit\TestCase; use UnexpectedValueException; -class TableConfigCollectionTest extends TestCase +final class TableConfigCollectionTest extends TestCase { /** * Test that an empty collection behaves as expected. diff --git a/tests/unit/Dumper/Config/Definition/TableConfigTest.php b/tests/unit/Dumper/Config/Definition/TableConfigTest.php index 98c6cfe3..df67070c 100644 --- a/tests/unit/Dumper/Config/Definition/TableConfigTest.php +++ b/tests/unit/Dumper/Config/Definition/TableConfigTest.php @@ -9,7 +9,7 @@ use Smile\GdprDump\Tests\Unit\TestCase; use UnexpectedValueException; -class TableConfigTest extends TestCase +final class TableConfigTest extends TestCase { /** * Test the creation of a table filter with empty data. diff --git a/tests/unit/Dumper/Config/DumperConfigTest.php b/tests/unit/Dumper/Config/DumperConfigTest.php index 6958ae35..a14d15b5 100644 --- a/tests/unit/Dumper/Config/DumperConfigTest.php +++ b/tests/unit/Dumper/Config/DumperConfigTest.php @@ -9,7 +9,7 @@ use Smile\GdprDump\Dumper\Config\Validation\ValidationException; use Smile\GdprDump\Tests\Unit\TestCase; -class DumperConfigTest extends TestCase +final class DumperConfigTest extends TestCase { /** * Test the "tables_whitelist" parameter. diff --git a/tests/unit/Dumper/Config/Validation/QueryValidatorTest.php b/tests/unit/Dumper/Config/Validation/QueryValidatorTest.php index 6e0eb0a8..b9744246 100644 --- a/tests/unit/Dumper/Config/Validation/QueryValidatorTest.php +++ b/tests/unit/Dumper/Config/Validation/QueryValidatorTest.php @@ -10,7 +10,7 @@ use Smile\GdprDump\Tests\Unit\TestCase; use TheSeer\Tokenizer\Token; -class QueryValidatorTest extends TestCase +final class QueryValidatorTest extends TestCase { /** * Assert that no exceptio is thrown when the query is valid. diff --git a/tests/unit/Dumper/Config/Validation/WhereExprValidatorTest.php b/tests/unit/Dumper/Config/Validation/WhereExprValidatorTest.php index 45eb2490..da9ddfcd 100644 --- a/tests/unit/Dumper/Config/Validation/WhereExprValidatorTest.php +++ b/tests/unit/Dumper/Config/Validation/WhereExprValidatorTest.php @@ -8,7 +8,7 @@ use Smile\GdprDump\Dumper\Config\Validation\WhereExprValidator; use Smile\GdprDump\Tests\Unit\TestCase; -class WhereExprValidatorTest extends TestCase +final class WhereExprValidatorTest extends TestCase { /** * Assert that no exception is thrown when the expression is valid. diff --git a/tests/unit/Faker/FakerServiceTest.php b/tests/unit/Faker/FakerServiceTest.php index e5536073..76b73605 100644 --- a/tests/unit/Faker/FakerServiceTest.php +++ b/tests/unit/Faker/FakerServiceTest.php @@ -8,7 +8,7 @@ use Smile\GdprDump\Faker\FakerService; use Smile\GdprDump\Tests\Unit\TestCase; -class FakerServiceTest extends TestCase +final class FakerServiceTest extends TestCase { /** * Test the "getGenerator" method. diff --git a/tests/unit/Phar/Compiler/Minify/JsonTest.php b/tests/unit/Phar/Compiler/Minify/JsonTest.php index 07cdfd58..b4055ac0 100644 --- a/tests/unit/Phar/Compiler/Minify/JsonTest.php +++ b/tests/unit/Phar/Compiler/Minify/JsonTest.php @@ -7,7 +7,7 @@ use Smile\GdprDump\Phar\Minify\Json; use Smile\GdprDump\Tests\Unit\TestCase; -class JsonTest extends TestCase +final class JsonTest extends TestCase { /** * Test the "minify" method. diff --git a/tests/unit/Phar/Compiler/Minify/PhpTest.php b/tests/unit/Phar/Compiler/Minify/PhpTest.php index d6858ad2..f801dd0f 100644 --- a/tests/unit/Phar/Compiler/Minify/PhpTest.php +++ b/tests/unit/Phar/Compiler/Minify/PhpTest.php @@ -7,7 +7,7 @@ use Smile\GdprDump\Phar\Minify\Php; use Smile\GdprDump\Tests\Unit\TestCase; -class PhpTest extends TestCase +final class PhpTest extends TestCase { /** * Test the "minify" method. diff --git a/tests/unit/Util/ArrayHelperTest.php b/tests/unit/Util/ArrayHelperTest.php index ace10029..f7fc8f7f 100644 --- a/tests/unit/Util/ArrayHelperTest.php +++ b/tests/unit/Util/ArrayHelperTest.php @@ -7,7 +7,7 @@ use Smile\GdprDump\Tests\Unit\TestCase; use Smile\GdprDump\Util\ArrayHelper; -class ArrayHelperTest extends TestCase +final class ArrayHelperTest extends TestCase { /** * Test the "getPath" method.