diff --git a/src/Annotation/Loggable.php b/src/Annotation/Loggable.php index 1c004f5..f489311 100644 --- a/src/Annotation/Loggable.php +++ b/src/Annotation/Loggable.php @@ -7,7 +7,7 @@ * @Target({"CLASS"}) */ #[\Attribute(\Attribute::TARGET_CLASS)] -class Loggable +final class Loggable { public array $groups = []; diff --git a/src/Bridge/Elasticsearch/Context/ElasticsearchContext.php b/src/Bridge/Elasticsearch/Context/ElasticsearchContext.php index 1486e9d..d07cdfa 100644 --- a/src/Bridge/Elasticsearch/Context/ElasticsearchContext.php +++ b/src/Bridge/Elasticsearch/Context/ElasticsearchContext.php @@ -2,7 +2,7 @@ namespace Locastic\Loggastic\Bridge\Elasticsearch\Context; -class ElasticsearchContext implements ElasticsearchContextInterface +final class ElasticsearchContext implements ElasticsearchContextInterface { public function __construct(private readonly string $className, private readonly string $activityLogIndex, private readonly string $currentDataTrackerIndex) { diff --git a/src/Bridge/Elasticsearch/Context/ElasticsearchContextFactory.php b/src/Bridge/Elasticsearch/Context/ElasticsearchContextFactory.php index 29937bf..5a3f9f9 100644 --- a/src/Bridge/Elasticsearch/Context/ElasticsearchContextFactory.php +++ b/src/Bridge/Elasticsearch/Context/ElasticsearchContextFactory.php @@ -6,7 +6,7 @@ use Locastic\Loggastic\Model\Output\CurrentDataTracker; use Locastic\Loggastic\Util\StringConverter; -class ElasticsearchContextFactory implements ElasticsearchContextFactoryInterface +final class ElasticsearchContextFactory implements ElasticsearchContextFactoryInterface { public function create(string $className): ElasticsearchContext { diff --git a/src/Bridge/Elasticsearch/ElasticsearchClient.php b/src/Bridge/Elasticsearch/ElasticsearchClient.php index 1dc7078..05a9ed8 100644 --- a/src/Bridge/Elasticsearch/ElasticsearchClient.php +++ b/src/Bridge/Elasticsearch/ElasticsearchClient.php @@ -5,7 +5,7 @@ use Elasticsearch\Client; use Elasticsearch\ClientBuilder; -class ElasticsearchClient +final class ElasticsearchClient { public function __construct(private readonly string $activityLogElasticHost) { diff --git a/src/Bridge/Elasticsearch/ElasticsearchService.php b/src/Bridge/Elasticsearch/ElasticsearchService.php index 8646a7c..2b35bbb 100644 --- a/src/Bridge/Elasticsearch/ElasticsearchService.php +++ b/src/Bridge/Elasticsearch/ElasticsearchService.php @@ -7,7 +7,7 @@ use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class ElasticsearchService +final class ElasticsearchService { use ElasticNormalizationContextTrait; diff --git a/src/Bridge/Elasticsearch/Index/ElasticsearchIndexConfiguration.php b/src/Bridge/Elasticsearch/Index/ElasticsearchIndexConfiguration.php index cbdbc33..7fc7f62 100644 --- a/src/Bridge/Elasticsearch/Index/ElasticsearchIndexConfiguration.php +++ b/src/Bridge/Elasticsearch/Index/ElasticsearchIndexConfiguration.php @@ -4,7 +4,7 @@ use Locastic\Loggastic\Bridge\Elasticsearch\Context\ElasticsearchContextInterface; -class ElasticsearchIndexConfiguration implements ElasticsearchIndexConfigurationInterface +final class ElasticsearchIndexConfiguration implements ElasticsearchIndexConfigurationInterface { public function __construct(private readonly bool $dateDetection, private readonly string $dateFormats, private readonly array $activityLogProperties, private readonly array $currentDataTrackerProperties) { diff --git a/src/Bridge/Elasticsearch/Index/ElasticsearchIndexFactory.php b/src/Bridge/Elasticsearch/Index/ElasticsearchIndexFactory.php index 5dbde13..550bdfe 100644 --- a/src/Bridge/Elasticsearch/Index/ElasticsearchIndexFactory.php +++ b/src/Bridge/Elasticsearch/Index/ElasticsearchIndexFactory.php @@ -5,7 +5,7 @@ use Locastic\Loggastic\Bridge\Elasticsearch\Context\ElasticsearchContextFactoryInterface; use Locastic\Loggastic\Bridge\Elasticsearch\ElasticsearchClient; -class ElasticsearchIndexFactory implements ElasticsearchIndexFactoryInterface +final class ElasticsearchIndexFactory implements ElasticsearchIndexFactoryInterface { public function __construct(private readonly ElasticsearchClient $elasticsearchClient, private readonly ElasticsearchContextFactoryInterface $elasticsearchContextFactory, private readonly ElasticsearchIndexConfigurationInterface $elasticsearchIndexConfiguration) { diff --git a/src/Command/CreateLoggableIndexesCommand.php b/src/Command/CreateLoggableIndexesCommand.php index 1da4fad..36c2042 100644 --- a/src/Command/CreateLoggableIndexesCommand.php +++ b/src/Command/CreateLoggableIndexesCommand.php @@ -12,7 +12,7 @@ use Symfony\Component\Console\Style\SymfonyStyle; #[AsCommand('locastic:activity-logs:create-loggable-indexes')] -class CreateLoggableIndexesCommand extends Command +final class CreateLoggableIndexesCommand extends Command { public function __construct(private readonly LoggableContextCollectionFactoryInterface $loggableContextCollectionFactory, private readonly ElasticsearchIndexFactoryInterface $elasticsearchIndexFactory) { diff --git a/src/Command/PopulateCurrentDataTrackersCommand.php b/src/Command/PopulateCurrentDataTrackersCommand.php index b419f67..dd6b325 100644 --- a/src/Command/PopulateCurrentDataTrackersCommand.php +++ b/src/Command/PopulateCurrentDataTrackersCommand.php @@ -20,7 +20,7 @@ * Pull all loggable objects from DB and populate currentTracker data to elastic. */ #[AsCommand('locastic:activity-logs:populate-current-data-trackers')] -class PopulateCurrentDataTrackersCommand extends Command +final class PopulateCurrentDataTrackersCommand extends Command { public function __construct(private readonly ElasticsearchIndexFactoryInterface $elasticsearchIndexFactory, private readonly LoggableContextCollectionFactoryInterface $loggableContextCollectionFactory, private readonly ManagerRegistry $managerRegistry, private readonly MessageBusInterface $bus) { diff --git a/src/DataProvider/ActivityLogProvider.php b/src/DataProvider/ActivityLogProvider.php index eae0166..734d4d6 100644 --- a/src/DataProvider/ActivityLogProvider.php +++ b/src/DataProvider/ActivityLogProvider.php @@ -7,7 +7,7 @@ use Locastic\Loggastic\Model\Output\ActivityLog; use Locastic\Loggastic\Model\Output\CurrentDataTracker; -class ActivityLogProvider implements ActivityLogProviderInterface +final class ActivityLogProvider implements ActivityLogProviderInterface { public function __construct(private readonly ElasticsearchService $elasticsearchService, private readonly ElasticsearchContextFactoryInterface $elasticsearchContextFactory) { diff --git a/src/DataProvider/CurrentDataTrackerProvider.php b/src/DataProvider/CurrentDataTrackerProvider.php index 57bda42..df5c5a6 100644 --- a/src/DataProvider/CurrentDataTrackerProvider.php +++ b/src/DataProvider/CurrentDataTrackerProvider.php @@ -7,7 +7,7 @@ use Locastic\Loggastic\Model\Output\CurrentDataTracker; use Locastic\Loggastic\Model\Output\CurrentDataTrackerInterface; -class CurrentDataTrackerProvider implements CurrentDataTrackerProviderInterface +final class CurrentDataTrackerProvider implements CurrentDataTrackerProviderInterface { public function __construct(private readonly ElasticsearchService $elasticsearchService, private readonly ElasticsearchContextFactoryInterface $elasticsearchContextFactory) { diff --git a/src/DependencyInjection/Configuration.php b/src/DependencyInjection/Configuration.php index a05b533..e210ab3 100644 --- a/src/DependencyInjection/Configuration.php +++ b/src/DependencyInjection/Configuration.php @@ -5,7 +5,7 @@ use Symfony\Component\Config\Definition\Builder\TreeBuilder; use Symfony\Component\Config\Definition\ConfigurationInterface; -class Configuration implements ConfigurationInterface +final class Configuration implements ConfigurationInterface { public function getConfigTreeBuilder(): TreeBuilder { diff --git a/src/DependencyInjection/LocasticLoggasticExtension.php b/src/DependencyInjection/LocasticLoggasticExtension.php index b5f4f0f..ef6cdbf 100644 --- a/src/DependencyInjection/LocasticLoggasticExtension.php +++ b/src/DependencyInjection/LocasticLoggasticExtension.php @@ -12,7 +12,7 @@ use Symfony\Component\DependencyInjection\Loader\YamlFileLoader; use Symfony\Component\Finder\Finder; -class LocasticLoggasticExtension extends Extension +final class LocasticLoggasticExtension extends Extension { /** * {@inheritdoc} diff --git a/src/Enum/ActivityLogAction.php b/src/Enum/ActivityLogAction.php index 979aac0..752741a 100644 --- a/src/Enum/ActivityLogAction.php +++ b/src/Enum/ActivityLogAction.php @@ -2,7 +2,7 @@ namespace Locastic\Loggastic\Enum; -class ActivityLogAction +final class ActivityLogAction { final public const CREATED = 'Created'; final public const EDITED = 'Edited'; diff --git a/src/Event/PreDispatchActivityLogMessageEvent.php b/src/Event/PreDispatchActivityLogMessageEvent.php index ae0f7a8..ff7fd24 100644 --- a/src/Event/PreDispatchActivityLogMessageEvent.php +++ b/src/Event/PreDispatchActivityLogMessageEvent.php @@ -6,7 +6,7 @@ use Locastic\Loggastic\Model\ActivityLogInterface; use Symfony\Contracts\EventDispatcher\Event; -class PreDispatchActivityLogMessageEvent extends Event +final class PreDispatchActivityLogMessageEvent extends Event { public function __construct(private readonly ActivityLogMessageInterface $activityLogMessage) { diff --git a/src/EventSubscriber/ActivityLogDoctrineSubscriber.php b/src/EventSubscriber/ActivityLogDoctrineSubscriber.php index 79ca289..8423e1c 100644 --- a/src/EventSubscriber/ActivityLogDoctrineSubscriber.php +++ b/src/EventSubscriber/ActivityLogDoctrineSubscriber.php @@ -12,7 +12,7 @@ use Locastic\Loggastic\Logger\ActivityLogger; use Locastic\Loggastic\Util\ClassUtils; -class ActivityLogDoctrineSubscriber implements EventSubscriberInterface +final class ActivityLogDoctrineSubscriber implements EventSubscriberInterface { private array $persistedEntities = []; diff --git a/src/Exception/IndexNotFoundException.php b/src/Exception/IndexNotFoundException.php index 50a0402..4532852 100644 --- a/src/Exception/IndexNotFoundException.php +++ b/src/Exception/IndexNotFoundException.php @@ -2,6 +2,6 @@ namespace Locastic\Loggastic\Exception; -class IndexNotFoundException extends \Exception +final class IndexNotFoundException extends \Exception { } diff --git a/src/Factory/CurrentDataTrackerInputFactory.php b/src/Factory/CurrentDataTrackerInputFactory.php index 31cfc82..af368e9 100644 --- a/src/Factory/CurrentDataTrackerInputFactory.php +++ b/src/Factory/CurrentDataTrackerInputFactory.php @@ -6,7 +6,7 @@ use Locastic\Loggastic\Model\Output\CurrentDataTrackerInterface; use Locastic\Loggastic\Util\ClassUtils; -class CurrentDataTrackerInputFactory implements CurrentDataTrackerInputFactoryInterface +final class CurrentDataTrackerInputFactory implements CurrentDataTrackerInputFactoryInterface { public function create($item, ?array $normalizedData = []): CurrentDataTrackerInput { diff --git a/src/LocasticLoggasticBundle.php b/src/LocasticLoggasticBundle.php index 8fe869a..6d8a718 100644 --- a/src/LocasticLoggasticBundle.php +++ b/src/LocasticLoggasticBundle.php @@ -6,7 +6,7 @@ use Symfony\Component\DependencyInjection\Extension\Extension; use Symfony\Component\HttpKernel\Bundle\Bundle; -class LocasticLoggasticBundle extends Bundle +final class LocasticLoggasticBundle extends Bundle { public function getContainerExtension(): Extension { diff --git a/src/Logger/ActivityLogger.php b/src/Logger/ActivityLogger.php index 6ccb455..650e74a 100644 --- a/src/Logger/ActivityLogger.php +++ b/src/Logger/ActivityLogger.php @@ -14,7 +14,7 @@ use Symfony\Component\Messenger\MessageBusInterface; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -class ActivityLogger implements ActivityLoggerInterface +final class ActivityLogger implements ActivityLoggerInterface { use ElasticNormalizationContextTrait; diff --git a/src/Message/CreateActivityLogMessage.php b/src/Message/CreateActivityLogMessage.php index 5aa8c17..71e0c09 100644 --- a/src/Message/CreateActivityLogMessage.php +++ b/src/Message/CreateActivityLogMessage.php @@ -5,7 +5,7 @@ use Locastic\Loggastic\Enum\ActivityLogAction; use Locastic\Loggastic\Util\ClassUtils; -class CreateActivityLogMessage implements CreateActivityLogMessageInterface +final class CreateActivityLogMessage implements CreateActivityLogMessageInterface { private readonly string $actionName; private readonly \DateTime $dateTime; diff --git a/src/Message/DeleteActivityLogMessage.php b/src/Message/DeleteActivityLogMessage.php index a41de40..fd8fd4b 100644 --- a/src/Message/DeleteActivityLogMessage.php +++ b/src/Message/DeleteActivityLogMessage.php @@ -4,7 +4,7 @@ use Locastic\Loggastic\Enum\ActivityLogAction; -class DeleteActivityLogMessage implements DeleteActivityLogMessageInterface +final class DeleteActivityLogMessage implements DeleteActivityLogMessageInterface { private readonly \DateTime $dateTime; private readonly string $actionName; diff --git a/src/Message/PopulateCurrentDataTrackersMessage.php b/src/Message/PopulateCurrentDataTrackersMessage.php index bca4d4c..f27041f 100644 --- a/src/Message/PopulateCurrentDataTrackersMessage.php +++ b/src/Message/PopulateCurrentDataTrackersMessage.php @@ -2,7 +2,7 @@ namespace Locastic\Loggastic\Message; -class PopulateCurrentDataTrackersMessage +final class PopulateCurrentDataTrackersMessage { public function __construct(private readonly int $offset, private readonly int $batchSize, private readonly string $loggableClass, private readonly array $loggableContext) { diff --git a/src/Message/UpdateActivityLogMessage.php b/src/Message/UpdateActivityLogMessage.php index 0ef33be..79cf34a 100644 --- a/src/Message/UpdateActivityLogMessage.php +++ b/src/Message/UpdateActivityLogMessage.php @@ -5,7 +5,7 @@ use Locastic\Loggastic\Enum\ActivityLogAction; use Locastic\Loggastic\Util\ClassUtils; -class UpdateActivityLogMessage implements UpdateActivityLogMessageInterface +final class UpdateActivityLogMessage implements UpdateActivityLogMessageInterface { private \DateTime $dateTime; private readonly string $actionName; diff --git a/src/MessageHandler/CreateActivityLogHandler.php b/src/MessageHandler/CreateActivityLogHandler.php index 09d7cf3..ea1bae5 100644 --- a/src/MessageHandler/CreateActivityLogHandler.php +++ b/src/MessageHandler/CreateActivityLogHandler.php @@ -11,7 +11,7 @@ use Symfony\Component\Messenger\MessageBusInterface; #[AsMessageHandler] -class CreateActivityLogHandler +final class CreateActivityLogHandler { public function __construct( private readonly ActivityLogProcessorInterface $activityLogProcessor, diff --git a/src/MessageHandler/DeleteActivityLogHandler.php b/src/MessageHandler/DeleteActivityLogHandler.php index 88148aa..c3f11d0 100644 --- a/src/MessageHandler/DeleteActivityLogHandler.php +++ b/src/MessageHandler/DeleteActivityLogHandler.php @@ -6,7 +6,7 @@ use Locastic\Loggastic\Message\DeleteActivityLogMessageInterface; use Locastic\Loggastic\Metadata\LoggableContext\Factory\LoggableContextFactoryInterface; -class DeleteActivityLogHandler +final class DeleteActivityLogHandler { public function __construct( private readonly ActivityLogProcessorInterface $activityLogProcessor, diff --git a/src/MessageHandler/PopulateCurrentDataTrackersHandler.php b/src/MessageHandler/PopulateCurrentDataTrackersHandler.php index acf69e4..57e4233 100644 --- a/src/MessageHandler/PopulateCurrentDataTrackersHandler.php +++ b/src/MessageHandler/PopulateCurrentDataTrackersHandler.php @@ -12,7 +12,7 @@ use Symfony\Component\Serializer\Normalizer\NormalizerInterface; #[AsMessageHandler] -class PopulateCurrentDataTrackersHandler +final class PopulateCurrentDataTrackersHandler { use ElasticNormalizationContextTrait; diff --git a/src/MessageHandler/UpdateActivityLogHandler.php b/src/MessageHandler/UpdateActivityLogHandler.php index 12eeed8..73557f4 100644 --- a/src/MessageHandler/UpdateActivityLogHandler.php +++ b/src/MessageHandler/UpdateActivityLogHandler.php @@ -11,7 +11,7 @@ use Symfony\Component\Messenger\Attribute\AsMessageHandler; #[AsMessageHandler] -class UpdateActivityLogHandler +final class UpdateActivityLogHandler { use ElasticNormalizationContextTrait; diff --git a/src/Metadata/Extractor/XmlLoggableExtractor.php b/src/Metadata/Extractor/XmlLoggableExtractor.php index a948fe9..59bd699 100644 --- a/src/Metadata/Extractor/XmlLoggableExtractor.php +++ b/src/Metadata/Extractor/XmlLoggableExtractor.php @@ -5,7 +5,7 @@ use Symfony\Component\Config\Util\XmlUtils; use Symfony\Component\Security\Core\Exception\InvalidArgumentException; -class XmlLoggableExtractor extends AbstractLoggableExtractor +final class XmlLoggableExtractor extends AbstractLoggableExtractor { final public const RESOURCE_SCHEMA = __DIR__.'/schema/metadata.xsd'; diff --git a/src/Metadata/Extractor/YamlLoggableExtractor.php b/src/Metadata/Extractor/YamlLoggableExtractor.php index e611ac1..3341745 100644 --- a/src/Metadata/Extractor/YamlLoggableExtractor.php +++ b/src/Metadata/Extractor/YamlLoggableExtractor.php @@ -5,7 +5,7 @@ use Symfony\Component\Yaml\Exception\ParseException; use Symfony\Component\Yaml\Yaml; -class YamlLoggableExtractor extends AbstractLoggableExtractor +final class YamlLoggableExtractor extends AbstractLoggableExtractor { protected function extractPath(string $path): void { diff --git a/src/Metadata/LoggableContext/Factory/AnnotationLoggableContextCollectionFactory.php b/src/Metadata/LoggableContext/Factory/AnnotationLoggableContextCollectionFactory.php index ca09735..f3bc7a6 100644 --- a/src/Metadata/LoggableContext/Factory/AnnotationLoggableContextCollectionFactory.php +++ b/src/Metadata/LoggableContext/Factory/AnnotationLoggableContextCollectionFactory.php @@ -7,7 +7,7 @@ use Locastic\Loggastic\Metadata\LoggableContext\LoggableContextCollection; use Locastic\Loggastic\Util\RecursiveClassIterator; -class AnnotationLoggableContextCollectionFactory implements LoggableContextCollectionFactoryInterface +final class AnnotationLoggableContextCollectionFactory implements LoggableContextCollectionFactoryInterface { /** * @param string[] $loggablePaths diff --git a/src/Metadata/LoggableContext/Factory/CachedLoggableContextCollectionFactory.php b/src/Metadata/LoggableContext/Factory/CachedLoggableContextCollectionFactory.php index f4c307f..621f1e9 100644 --- a/src/Metadata/LoggableContext/Factory/CachedLoggableContextCollectionFactory.php +++ b/src/Metadata/LoggableContext/Factory/CachedLoggableContextCollectionFactory.php @@ -5,7 +5,7 @@ use Locastic\Loggastic\Metadata\LoggableContext\LoggableContextCollection; use Symfony\Contracts\Cache\CacheInterface; -class CachedLoggableContextCollectionFactory implements LoggableContextCollectionFactoryInterface +final class CachedLoggableContextCollectionFactory implements LoggableContextCollectionFactoryInterface { final public const CACHE_KEY = 'loggable_name_collection'; diff --git a/src/Metadata/LoggableContext/Factory/LoggableContextFactory.php b/src/Metadata/LoggableContext/Factory/LoggableContextFactory.php index fcea831..e35a10c 100644 --- a/src/Metadata/LoggableContext/Factory/LoggableContextFactory.php +++ b/src/Metadata/LoggableContext/Factory/LoggableContextFactory.php @@ -2,7 +2,7 @@ namespace Locastic\Loggastic\Metadata\LoggableContext\Factory; -class LoggableContextFactory implements LoggableContextFactoryInterface +final class LoggableContextFactory implements LoggableContextFactoryInterface { public function __construct(private readonly LoggableContextCollectionFactoryInterface $loggableContextCollectionFactory) { diff --git a/src/Metadata/LoggableContext/LoggableContextCollection.php b/src/Metadata/LoggableContext/LoggableContextCollection.php index 2852ec6..6416870 100644 --- a/src/Metadata/LoggableContext/LoggableContextCollection.php +++ b/src/Metadata/LoggableContext/LoggableContextCollection.php @@ -2,7 +2,7 @@ namespace Locastic\Loggastic\Metadata\LoggableContext; -class LoggableContextCollection implements \IteratorAggregate, \Countable +final class LoggableContextCollection implements \IteratorAggregate, \Countable { public function __construct(private readonly array $loggableContextCollection = []) { diff --git a/src/Util/ArrayDiff.php b/src/Util/ArrayDiff.php index ab55336..a9ff129 100644 --- a/src/Util/ArrayDiff.php +++ b/src/Util/ArrayDiff.php @@ -2,7 +2,7 @@ namespace Locastic\Loggastic\Util; -class ArrayDiff +final class ArrayDiff { public static function arrayDiffRecursive($array1, $array2): array { diff --git a/src/Util/ArraysComparer.php b/src/Util/ArraysComparer.php index 1abe231..6ee1f54 100644 --- a/src/Util/ArraysComparer.php +++ b/src/Util/ArraysComparer.php @@ -2,7 +2,7 @@ namespace Locastic\Loggastic\Util; -class ArraysComparer +final class ArraysComparer { public static function getCompared(array $currentData, array $previousData): ?array { diff --git a/src/Util/ClassUtils.php b/src/Util/ClassUtils.php index 5358ee2..5187778 100644 --- a/src/Util/ClassUtils.php +++ b/src/Util/ClassUtils.php @@ -4,7 +4,7 @@ use Doctrine\Persistence\Proxy; -class ClassUtils +final class ClassUtils { public static function getClass($object): string { diff --git a/src/Util/RecursiveClassIterator.php b/src/Util/RecursiveClassIterator.php index 1bf9c1e..7d0d28a 100644 --- a/src/Util/RecursiveClassIterator.php +++ b/src/Util/RecursiveClassIterator.php @@ -2,7 +2,7 @@ namespace Locastic\Loggastic\Util; -class RecursiveClassIterator +final class RecursiveClassIterator { public static function getReflectionClasses(array $paths): \Generator { diff --git a/src/Util/StringConverter.php b/src/Util/StringConverter.php index cc86b7d..1452e1a 100644 --- a/src/Util/StringConverter.php +++ b/src/Util/StringConverter.php @@ -2,7 +2,7 @@ namespace Locastic\Loggastic\Util; -class StringConverter +final class StringConverter { /** * Converts a word into the format for the elastic document name. Converts 'ModelName' to 'model_name'.