Skip to content

Commit

Permalink
use final classes
Browse files Browse the repository at this point in the history
  • Loading branch information
paullla committed Aug 23, 2023
1 parent 704f8d9 commit 8387065
Show file tree
Hide file tree
Showing 39 changed files with 39 additions and 39 deletions.
2 changes: 1 addition & 1 deletion src/Annotation/Loggable.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @Target({"CLASS"})
*/
#[\Attribute(\Attribute::TARGET_CLASS)]
class Loggable
final class Loggable
{
public array $groups = [];

Expand Down
2 changes: 1 addition & 1 deletion src/Bridge/Elasticsearch/Context/ElasticsearchContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
2 changes: 1 addition & 1 deletion src/Bridge/Elasticsearch/ElasticsearchClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use Elasticsearch\Client;
use Elasticsearch\ClientBuilder;

class ElasticsearchClient
final class ElasticsearchClient
{
public function __construct(private readonly string $activityLogElasticHost)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Bridge/Elasticsearch/ElasticsearchService.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use Symfony\Component\Serializer\Normalizer\DenormalizerInterface;
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;

class ElasticsearchService
final class ElasticsearchService
{
use ElasticNormalizationContextTrait;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Command/CreateLoggableIndexesCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Command/PopulateCurrentDataTrackersCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
2 changes: 1 addition & 1 deletion src/DataProvider/ActivityLogProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
2 changes: 1 addition & 1 deletion src/DataProvider/CurrentDataTrackerProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
2 changes: 1 addition & 1 deletion src/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
2 changes: 1 addition & 1 deletion src/DependencyInjection/LocasticLoggasticExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
2 changes: 1 addition & 1 deletion src/Enum/ActivityLogAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Locastic\Loggastic\Enum;

class ActivityLogAction
final class ActivityLogAction
{
final public const CREATED = 'Created';
final public const EDITED = 'Edited';
Expand Down
2 changes: 1 addition & 1 deletion src/Event/PreDispatchActivityLogMessageEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
2 changes: 1 addition & 1 deletion src/EventSubscriber/ActivityLogDoctrineSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [];

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

namespace Locastic\Loggastic\Exception;

class IndexNotFoundException extends \Exception
final class IndexNotFoundException extends \Exception
{
}
2 changes: 1 addition & 1 deletion src/Factory/CurrentDataTrackerInputFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
2 changes: 1 addition & 1 deletion src/LocasticLoggasticBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
2 changes: 1 addition & 1 deletion src/Logger/ActivityLogger.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion src/Message/CreateActivityLogMessage.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/Message/DeleteActivityLogMessage.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/Message/PopulateCurrentDataTrackersMessage.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Message/UpdateActivityLogMessage.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/MessageHandler/CreateActivityLogHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
use Symfony\Component\Messenger\MessageBusInterface;

#[AsMessageHandler]
class CreateActivityLogHandler
final class CreateActivityLogHandler
{
public function __construct(
private readonly ActivityLogProcessorInterface $activityLogProcessor,
Expand Down
2 changes: 1 addition & 1 deletion src/MessageHandler/DeleteActivityLogHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/MessageHandler/PopulateCurrentDataTrackersHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;

#[AsMessageHandler]
class PopulateCurrentDataTrackersHandler
final class PopulateCurrentDataTrackersHandler
{
use ElasticNormalizationContextTrait;

Expand Down
2 changes: 1 addition & 1 deletion src/MessageHandler/UpdateActivityLogHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
use Symfony\Component\Messenger\Attribute\AsMessageHandler;

#[AsMessageHandler]
class UpdateActivityLogHandler
final class UpdateActivityLogHandler
{
use ElasticNormalizationContextTrait;

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

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Metadata/LoggableContext/LoggableContextCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [])
{
Expand Down
2 changes: 1 addition & 1 deletion src/Util/ArrayDiff.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Locastic\Loggastic\Util;

class ArrayDiff
final class ArrayDiff
{
public static function arrayDiffRecursive($array1, $array2): array
{
Expand Down
2 changes: 1 addition & 1 deletion src/Util/ArraysComparer.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Locastic\Loggastic\Util;

class ArraysComparer
final class ArraysComparer
{
public static function getCompared(array $currentData, array $previousData): ?array
{
Expand Down
2 changes: 1 addition & 1 deletion src/Util/ClassUtils.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use Doctrine\Persistence\Proxy;

class ClassUtils
final class ClassUtils
{
public static function getClass($object): string
{
Expand Down
2 changes: 1 addition & 1 deletion src/Util/RecursiveClassIterator.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Locastic\Loggastic\Util;

class RecursiveClassIterator
final class RecursiveClassIterator
{
public static function getReflectionClasses(array $paths): \Generator
{
Expand Down
2 changes: 1 addition & 1 deletion src/Util/StringConverter.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'.
Expand Down

0 comments on commit 8387065

Please sign in to comment.