Skip to content

Commit

Permalink
Add final classes (#148)
Browse files Browse the repository at this point in the history
  • Loading branch information
guvra authored Jan 7, 2025
1 parent be5544b commit b5f3d0f
Show file tree
Hide file tree
Showing 153 changed files with 304 additions and 268 deletions.
2 changes: 1 addition & 1 deletion src/AppKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/Config/Compiler/Compiler.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/Config/Compiler/Processor/DumpOutputProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -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").
Expand Down
2 changes: 1 addition & 1 deletion src/Config/Compiler/Processor/EnvVarProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@

use Smile\GdprDump\Config\Compiler\CompileException;

class InvalidVersionException extends CompileException
final class InvalidVersionException extends CompileException
{
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@

use Smile\GdprDump\Config\Compiler\CompileException;

class MissingVersionException extends CompileException
final class MissingVersionException extends CompileException
{
}
2 changes: 1 addition & 1 deletion src/Config/Compiler/Processor/Version/VersionCondition.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Smile\GdprDump\Config\Compiler\Processor\Version;

class VersionCondition
final class VersionCondition
{
/**
* @var string[]
Expand Down
2 changes: 1 addition & 1 deletion src/Config/Compiler/Processor/Version/VersionMatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -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").
Expand Down
2 changes: 1 addition & 1 deletion src/Config/Compiler/Processor/VersionProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion src/Config/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Smile\GdprDump\Config;

class Config implements ConfigInterface
final class Config implements ConfigInterface
{
public function __construct(private array $items = [])
{
Expand Down
2 changes: 1 addition & 1 deletion src/Config/Loader/ConfigLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -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[]
Expand Down
2 changes: 1 addition & 1 deletion src/Config/Loader/FileLocator.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Smile\GdprDump\Config\Loader;

class FileLocator implements FileLocatorInterface
final class FileLocator implements FileLocatorInterface
{
/**
* @var string[]
Expand Down
2 changes: 1 addition & 1 deletion src/Config/Loader/FileNotFoundException.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@

use Smile\GdprDump\Config\ConfigException;

class FileNotFoundException extends ConfigException
final class FileNotFoundException extends ConfigException
{
}
2 changes: 1 addition & 1 deletion src/Config/Loader/ParseException.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@

use Smile\GdprDump\Config\ConfigException;

class ParseException extends ConfigException
final class ParseException extends ConfigException
{
}
2 changes: 1 addition & 1 deletion src/Config/Validator/JsonSchemaValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use Exception;
use JsonSchema\Validator;

class JsonSchemaValidator implements ValidatorInterface
final class JsonSchemaValidator implements ValidatorInterface
{
private ?Validator $schemaValidator = null;

Expand Down
2 changes: 1 addition & 1 deletion src/Config/Validator/ValidationException.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@

use Smile\GdprDump\Config\ConfigException;

class ValidationException extends ConfigException
final class ValidationException extends ConfigException
{
}
2 changes: 1 addition & 1 deletion src/Config/Validator/ValidationResult.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Smile\GdprDump\Config\Validator;

class ValidationResult implements ValidationResultInterface
final class ValidationResult implements ValidationResultInterface
{
private bool $valid = false;

Expand Down
2 changes: 1 addition & 1 deletion src/Console/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
2 changes: 1 addition & 1 deletion src/Console/Command/CompileCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Console/Command/DumpCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
6 changes: 3 additions & 3 deletions src/Console/Helper/DumpInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
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;
use Symfony\Component\Console\Output\ConsoleOutputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;

class DumpInfo
final class DumpInfo
{
private OutputInterface $output;
private ProgressBar $progressBar;
Expand Down Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion src/Converter/Anonymizer/AnonymizeDateTime.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
}
2 changes: 1 addition & 1 deletion src/Converter/Anonymizer/AnonymizeEmail.php
Original file line number Diff line number Diff line change
Expand Up @@ -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[]
Expand Down
2 changes: 1 addition & 1 deletion src/Converter/Anonymizer/AnonymizeNumber.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/Converter/ConditionBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
use TheSeer\Tokenizer\TokenCollection;
use TheSeer\Tokenizer\Tokenizer;

class ConditionBuilder
final class ConditionBuilder
{
private Tokenizer $tokenizer;

Expand Down
2 changes: 1 addition & 1 deletion src/Converter/ConverterBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

use UnexpectedValueException;

class ConverterBuilder
final class ConverterBuilder
{
public function __construct(private ConverterFactory $converterFactory)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Converter/ConverterFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/Converter/Generator/NumberBetween.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/Converter/Generator/RandomDateTime.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
2 changes: 1 addition & 1 deletion src/Converter/Generator/RandomEmail.php
Original file line number Diff line number Diff line change
Expand Up @@ -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[]
Expand Down
2 changes: 1 addition & 1 deletion src/Converter/Generator/SetNull.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

use Smile\GdprDump\Converter\ConverterInterface;

class SetNull implements ConverterInterface
final class SetNull implements ConverterInterface
{
/**
* @inheritdoc
Expand Down
2 changes: 1 addition & 1 deletion src/Converter/Generator/SetValue.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion src/Converter/Parameters/InputParameters.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Smile\GdprDump\Converter\Parameters;

class InputParameters
final class InputParameters
{
public function __construct(private array $values)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Converter/Parameters/Parameter.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Smile\GdprDump\Converter\Parameters;

class Parameter
final class Parameter
{
public const TYPE_BOOL = 'bool';
public const TYPE_STRING = 'string';
Expand Down
2 changes: 1 addition & 1 deletion src/Converter/Parameters/ParameterProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Smile\GdprDump\Converter\Parameters;

class ParameterProcessor
final class ParameterProcessor
{
/**
* @var Parameter[]
Expand Down
2 changes: 1 addition & 1 deletion src/Converter/Parameters/ValidationException.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Converter/Proxy/Cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/Converter/Proxy/Chain.php
Original file line number Diff line number Diff line change
Expand Up @@ -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[]
Expand Down
2 changes: 1 addition & 1 deletion src/Converter/Proxy/Conditional.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/Converter/Proxy/Faker.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/Converter/Proxy/FromContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion src/Converter/Proxy/JsonData.php
Original file line number Diff line number Diff line change
Expand Up @@ -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[]
Expand Down
2 changes: 1 addition & 1 deletion src/Converter/Proxy/SerializedData.php
Original file line number Diff line number Diff line change
Expand Up @@ -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[]
Expand Down
Loading

0 comments on commit b5f3d0f

Please sign in to comment.