Skip to content

Commit

Permalink
📦 Update php cs fixer
Browse files Browse the repository at this point in the history
  • Loading branch information
Nek- committed Feb 18, 2024
1 parent d1842cb commit 33cea8b
Show file tree
Hide file tree
Showing 14 changed files with 9 additions and 45 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"require-dev": {
"phpunit/phpunit": "^9.5 || ^10",
"doctrine/orm": "^2.6.3",
"friendsofphp/php-cs-fixer": "^3.11.0",
"friendsofphp/php-cs-fixer": "^3.49.0",
"symfony/symfony": "^5.0 || ^6.0 || ^7.0",
"phpspec/prophecy-phpunit": "^2.0.1",
"monolog/monolog": "^2.8.0 || ^3.2.0"
Expand Down
2 changes: 1 addition & 1 deletion config/bundles.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
return [
Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true],
Doctrine\Bundle\DoctrineBundle\DoctrineBundle::class => ['all' => true],
\Biig\Component\Domain\Integration\Symfony\DomainBundle::class => ['all' => true],
Biig\Component\Domain\Integration\Symfony\DomainBundle::class => ['all' => true],
];
2 changes: 1 addition & 1 deletion src/DataCollector/DomainEventDataCollector.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public function reset(): void
$this->dispatcher->reset();
}

public function collect(Request $request, Response $response, \Throwable $exception = null)
public function collect(Request $request, Response $response, ?\Throwable $exception = null)
{
$this->currentRequest = $this->requestStack->getMainRequest() !== $request ? $request : null;
$this->data = [
Expand Down
2 changes: 1 addition & 1 deletion src/Debug/TraceableDomainEventDispatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public function getDelayedListenersCalled(): array
*
* @return object The passed $event MUST be returned
*/
public function dispatch(object $event, string $eventName = null): object
public function dispatch(object $event, ?string $eventName = null): object
{
$eventName = $eventName ?? get_class($event);
$this->eventsFired[] = $eventName;
Expand Down
2 changes: 1 addition & 1 deletion src/Event/DomainEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class DomainEvent extends GenericEvent
*/
private bool $delayed;

public function __construct($subject = null, $arguments = [], Event $originalEvent = null)
public function __construct($subject = null, $arguments = [], ?Event $originalEvent = null)
{
parent::__construct($subject, $arguments);
$this->originalEvent = $originalEvent;
Expand Down
2 changes: 1 addition & 1 deletion src/Event/DomainEventDispatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public function addPostPersistDomainRuleInterface(PostPersistDomainRuleInterface
*
* @return Event
*/
public function dispatch($event, string $eventName = null): object
public function dispatch($event, ?string $eventName = null): object
{
$event = parent::dispatch($event, $eventName);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@

class VerifyDoctrineConfigurationCompilerPass implements CompilerPassInterface
{
/**
* {@inheritdoc}
*/
public function process(ContainerBuilder $container)
{
if ($container->getParameter('biig_domain_doctrine_domain_event_instantiator')) {
Expand Down
3 changes: 0 additions & 3 deletions src/Integration/Symfony/DomainBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@

class DomainBundle extends Bundle
{
/**
* {@inheritdoc}
*/
public function getContainerExtension(): ?ExtensionInterface
{
return new DomainExtension();
Expand Down
11 changes: 0 additions & 11 deletions src/Integration/Symfony/Serializer/DomainDenormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@ public function __construct(NormalizerInterface $decorated, DomainEventDispatche
$this->dispatcher = $dispatcher;
}

/**
* {@inheritdoc}
* @return mixed
*/
public function denormalize($data, $class, $format = null, array $context = [])
{
$domain = $this->decorated->denormalize($data, $class, $format, $context);
Expand All @@ -47,26 +43,19 @@ public function denormalize($data, $class, $format = null, array $context = [])
return $domain;
}

/**
* {@inheritdoc}
*/
public function supportsDenormalization($data, $type, $format = null, array $context = []): bool
{
return $this->decorated->supportsDenormalization($data, $type, $format, $context);
}

/**
* {@inheritdoc}
* @return array|string|int|float|bool|\ArrayObject|null
*/
public function normalize($object, $format = null, array $context = [])
{
return $this->decorated->normalize($object, $format, $context);
}

/**
* {@inheritdoc}
*/
public function supportsNormalization($data, $format = null, array $context = []): bool
{
return $this->decorated->supportsNormalization($data, $format, $context);
Expand Down
2 changes: 1 addition & 1 deletion src/Model/DomainModelTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function setDispatcher(DomainEventDispatcherInterface $dispatcher)
}
}

protected function dispatch(DomainEvent $event, string $name = null)
protected function dispatch(DomainEvent $event, ?string $name = null)
{
if (null === $this->dispatcher) {
$eventToStack['event'] = $event;
Expand Down
5 changes: 1 addition & 4 deletions src/Model/Instantiator/DoctrineConfig/ClassMetadata.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,12 @@ class ClassMetadata extends BaseClassMetadata
*/
private $instantiator;

public function __construct($entityName, InstantiatorInterface $instantiator, NamingStrategy $namingStrategy = null)
public function __construct($entityName, InstantiatorInterface $instantiator, ?NamingStrategy $namingStrategy = null)
{
parent::__construct($entityName, $namingStrategy);
$this->instantiator = $instantiator;
}

/**
* {@inheritdoc}
*/
public function newInstance(): object
{
return $this->instantiator->instantiate(parent::newInstance($this->name));
Expand Down
14 changes: 1 addition & 13 deletions src/Model/Instantiator/DoctrineConfig/ClassMetadataFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
use Doctrine\Persistence\Mapping\ClassMetadata as ClassMetadataInterface;
use Doctrine\Persistence\Mapping\ReflectionService;

if (interface_exists(\Doctrine\Persistence\Mapping\ClassMetadata::class)) {
if (interface_exists(ClassMetadataInterface::class)) {
final class ClassMetadataFactory extends BaseClassMetadataFactory
{
/**
Expand All @@ -22,9 +22,6 @@ final class ClassMetadataFactory extends BaseClassMetadataFactory
*/
private $entityManager;

/**
* {@inheritdoc}
*/
public function newClassMetadataInstance($className): ClassMetadata
{
return new ClassMetadata($className, new Instantiator($this->dispatcher), $this->entityManager->getConfiguration()->getNamingStrategy());
Expand All @@ -35,9 +32,6 @@ public function setDispatcher(DomainEventDispatcherInterface $dispatcher)
$this->dispatcher = $dispatcher;
}

/**
* {@inheritdoc}
*/
protected function wakeupReflection(ClassMetadataInterface $class, ReflectionService $reflService): void
{
if ($class instanceof ClassMetadata) {
Expand Down Expand Up @@ -69,9 +63,6 @@ final class ClassMetadataFactory extends BaseClassMetadataFactory
*/
private $entityManager;

/**
* {@inheritdoc}
*/
public function newClassMetadataInstance($className): ClassMetadata
{
return new ClassMetadata($className, new Instantiator($this->dispatcher), $this->entityManager->getConfiguration()->getNamingStrategy());
Expand All @@ -82,9 +73,6 @@ public function setDispatcher(DomainEventDispatcherInterface $dispatcher)
$this->dispatcher = $dispatcher;
}

/**
* {@inheritdoc}
*/
protected function wakeupReflection(OldClassMetadataInterface $class, ReflectionService $reflService): void
{
if ($class instanceof ClassMetadata) {
Expand Down
1 change: 0 additions & 1 deletion src/PostFlushListener/EntitiesHasDispatcherChecker.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
use Biig\Component\Domain\Model\ModelInterface;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\Event\PostFlushEventArgs;
use Doctrine\ORM\Proxy\Proxy;

final class EntitiesHasDispatcherChecker
{
Expand Down
3 changes: 0 additions & 3 deletions src/PostPersistListener/DoctrinePostPersistListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ public function __construct(DomainEventDispatcherInterface $dispatcher)
$this->modelsStageForFlush = [];
}

/**
* {@inheritdoc}
*/
public function getSubscribedEvents()
{
return ['onFlush', 'postFlush'];
Expand Down

0 comments on commit 33cea8b

Please sign in to comment.