From 7d127eb53d60bafe7583bf304b66913dccdec659 Mon Sep 17 00:00:00 2001 From: Damien Harper Date: Tue, 19 Dec 2023 10:27:07 +0100 Subject: [PATCH] Fixed CI (2.x) --- composer.json | 2 +- src/Event/LifecycleEvent.php | 4 +--- src/Exception/AccessDeniedException.php | 4 +--- src/Exception/InvalidArgumentException.php | 4 +--- src/Exception/MappingException.php | 4 +--- src/Exception/ProviderException.php | 4 +--- src/Model/Entry.php | 4 ---- src/Provider/ConfigurationInterface.php | 4 +--- .../Doctrine/Auditing/Annotation/Auditable.php | 2 -- .../Doctrine/Auditing/Annotation/Ignore.php | 5 +---- .../Doctrine/Auditing/Annotation/Security.php | 2 -- src/Provider/Doctrine/Auditing/Logger/Logger.php | 4 +--- .../Persistence/Exception/UpdateException.php | 4 +--- .../Doctrine/Service/AuditingService.php | 4 +--- src/Provider/Doctrine/Service/StorageService.php | 4 +--- .../Service/AuditingServiceInterface.php | 4 +--- src/Provider/Service/StorageServiceInterface.php | 4 +--- .../Fixtures/Provider/AuditNoStorageProvider.php | 16 ++++------------ .../Provider/NoStorageNoAuditProvider.php | 16 ++++------------ .../Provider/StorageAndAuditProvider.php | 16 ++++------------ .../Fixtures/Provider/StorageNoAuditProvider.php | 16 ++++------------ tests/Model/TransactionTest.php | 8 ++------ .../Fixtures/Entity/Inheritance/Joined/Cat.php | 4 +--- .../Fixtures/Entity/Inheritance/Joined/Dog.php | 4 +--- .../Entity/Inheritance/SingleTable/Bike.php | 4 +--- .../Entity/Inheritance/SingleTable/Car.php | 4 +--- .../Fixtures/Entity/Standard/Blog/Author.php | 6 ------ .../Fixtures/Entity/Standard/Blog/Comment.php | 12 +----------- .../Fixtures/Entity/Standard/Blog/Post.php | 8 -------- .../Fixtures/Entity/Standard/Blog/Tag.php | 4 ---- .../Doctrine/Fixtures/Issue101/ChildEntity.php | 4 +--- .../Doctrine/Fixtures/Issue132/DummyEntity.php | 4 +--- .../Provider/Doctrine/Fixtures/Issue37/User.php | 2 -- .../Doctrine/Traits/Schema/SchemaSetupTrait.php | 4 +--- tools/phpstan/composer.json | 5 +++++ 35 files changed, 45 insertions(+), 155 deletions(-) diff --git a/composer.json b/composer.json index e78830b2..5ce4d0b8 100644 --- a/composer.json +++ b/composer.json @@ -46,7 +46,7 @@ "test": "php -d pcov.enabled=1 ./vendor/bin/phpunit --colors=always", "csfixer": "tools/php-cs-fixer/vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.php --using-cache=no --verbose --ansi", "cs-check": "tools/php-cs-fixer/vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.php --using-cache=no --verbose --ansi --dry-run", - "phpstan": "tools/phpstan/vendor/bin/phpstan --ansi analyse src", + "phpstan": "tools/phpstan/vendor/bin/phpstan --ansi analyse src --memory-limit=1G", "rector": "tools/rector/vendor/bin/rector process src", "update-tools": "composer update --working-dir=tools/php-cs-fixer ; composer update --working-dir=tools/phpstan ; composer update --working-dir=tools/rector" }, diff --git a/src/Event/LifecycleEvent.php b/src/Event/LifecycleEvent.php index c3537a0a..0b748a4e 100644 --- a/src/Event/LifecycleEvent.php +++ b/src/Event/LifecycleEvent.php @@ -7,6 +7,4 @@ /** * @see \DH\Auditor\Tests\Event\LifecycleEventTest */ -final class LifecycleEvent extends AuditEvent -{ -} +final class LifecycleEvent extends AuditEvent {} diff --git a/src/Exception/AccessDeniedException.php b/src/Exception/AccessDeniedException.php index d3f51444..6ec5c523 100644 --- a/src/Exception/AccessDeniedException.php +++ b/src/Exception/AccessDeniedException.php @@ -6,6 +6,4 @@ use Exception; -class AccessDeniedException extends Exception -{ -} +class AccessDeniedException extends Exception {} diff --git a/src/Exception/InvalidArgumentException.php b/src/Exception/InvalidArgumentException.php index 210b38f2..65986cfd 100644 --- a/src/Exception/InvalidArgumentException.php +++ b/src/Exception/InvalidArgumentException.php @@ -6,6 +6,4 @@ use Exception; -class InvalidArgumentException extends Exception -{ -} +class InvalidArgumentException extends Exception {} diff --git a/src/Exception/MappingException.php b/src/Exception/MappingException.php index bd8a6b62..8f5cc4b2 100644 --- a/src/Exception/MappingException.php +++ b/src/Exception/MappingException.php @@ -6,6 +6,4 @@ use Exception; -class MappingException extends Exception -{ -} +class MappingException extends Exception {} diff --git a/src/Exception/ProviderException.php b/src/Exception/ProviderException.php index 5d3647a1..dfcfd0c7 100644 --- a/src/Exception/ProviderException.php +++ b/src/Exception/ProviderException.php @@ -6,6 +6,4 @@ use Exception; -class ProviderException extends Exception -{ -} +class ProviderException extends Exception {} diff --git a/src/Model/Entry.php b/src/Model/Entry.php index c140b457..700d7afe 100644 --- a/src/Model/Entry.php +++ b/src/Model/Entry.php @@ -106,8 +106,6 @@ public function getUserFirewall(): ?string /** * Get the value of ip. - * - * @return string */ public function getIp(): ?string { @@ -124,8 +122,6 @@ public function getCreatedAt(): string /** * Get diff values. - * - * @return array */ public function getDiffs(bool $includeMedadata = false): ?array { diff --git a/src/Provider/ConfigurationInterface.php b/src/Provider/ConfigurationInterface.php index 877818b7..ddea4237 100644 --- a/src/Provider/ConfigurationInterface.php +++ b/src/Provider/ConfigurationInterface.php @@ -4,6 +4,4 @@ namespace DH\Auditor\Provider; -interface ConfigurationInterface -{ -} +interface ConfigurationInterface {} diff --git a/src/Provider/Doctrine/Auditing/Annotation/Auditable.php b/src/Provider/Doctrine/Auditing/Annotation/Auditable.php index 441f0c31..425a2762 100644 --- a/src/Provider/Doctrine/Auditing/Annotation/Auditable.php +++ b/src/Provider/Doctrine/Auditing/Annotation/Auditable.php @@ -10,9 +10,7 @@ /** * @Annotation - * * @NamedArgumentConstructor - * * @Target("CLASS") * * @Attributes({ diff --git a/src/Provider/Doctrine/Auditing/Annotation/Ignore.php b/src/Provider/Doctrine/Auditing/Annotation/Ignore.php index ec39af5b..64345bd6 100644 --- a/src/Provider/Doctrine/Auditing/Annotation/Ignore.php +++ b/src/Provider/Doctrine/Auditing/Annotation/Ignore.php @@ -9,10 +9,7 @@ /** * @Annotation - * * @Target("PROPERTY") */ #[Attribute(Attribute::TARGET_PROPERTY)] -final class Ignore -{ -} +final class Ignore {} diff --git a/src/Provider/Doctrine/Auditing/Annotation/Security.php b/src/Provider/Doctrine/Auditing/Annotation/Security.php index 83650907..80a9ea9f 100644 --- a/src/Provider/Doctrine/Auditing/Annotation/Security.php +++ b/src/Provider/Doctrine/Auditing/Annotation/Security.php @@ -11,9 +11,7 @@ /** * @Annotation - * * @NamedArgumentConstructor - * * @Target("CLASS") * * @Attributes({ diff --git a/src/Provider/Doctrine/Auditing/Logger/Logger.php b/src/Provider/Doctrine/Auditing/Logger/Logger.php index 3f5b1c94..05d9c554 100644 --- a/src/Provider/Doctrine/Auditing/Logger/Logger.php +++ b/src/Provider/Doctrine/Auditing/Logger/Logger.php @@ -30,7 +30,5 @@ public function startQuery($sql, ?array $params = null, ?array $types = null): v } } - public function stopQuery(): void - { - } + public function stopQuery(): void {} } diff --git a/src/Provider/Doctrine/Persistence/Exception/UpdateException.php b/src/Provider/Doctrine/Persistence/Exception/UpdateException.php index 2383c066..2bcaf437 100644 --- a/src/Provider/Doctrine/Persistence/Exception/UpdateException.php +++ b/src/Provider/Doctrine/Persistence/Exception/UpdateException.php @@ -6,6 +6,4 @@ use Exception; -class UpdateException extends Exception -{ -} +class UpdateException extends Exception {} diff --git a/src/Provider/Doctrine/Service/AuditingService.php b/src/Provider/Doctrine/Service/AuditingService.php index 71b7fa36..63a13dc2 100644 --- a/src/Provider/Doctrine/Service/AuditingService.php +++ b/src/Provider/Doctrine/Service/AuditingService.php @@ -6,6 +6,4 @@ use DH\Auditor\Provider\Service\AuditingServiceInterface; -class AuditingService extends DoctrineService implements AuditingServiceInterface -{ -} +class AuditingService extends DoctrineService implements AuditingServiceInterface {} diff --git a/src/Provider/Doctrine/Service/StorageService.php b/src/Provider/Doctrine/Service/StorageService.php index e39aed04..433d90de 100644 --- a/src/Provider/Doctrine/Service/StorageService.php +++ b/src/Provider/Doctrine/Service/StorageService.php @@ -6,6 +6,4 @@ use DH\Auditor\Provider\Service\StorageServiceInterface; -class StorageService extends DoctrineService implements StorageServiceInterface -{ -} +class StorageService extends DoctrineService implements StorageServiceInterface {} diff --git a/src/Provider/Service/AuditingServiceInterface.php b/src/Provider/Service/AuditingServiceInterface.php index 4050c41a..8388e4f4 100644 --- a/src/Provider/Service/AuditingServiceInterface.php +++ b/src/Provider/Service/AuditingServiceInterface.php @@ -4,6 +4,4 @@ namespace DH\Auditor\Provider\Service; -interface AuditingServiceInterface extends ServiceInterface -{ -} +interface AuditingServiceInterface extends ServiceInterface {} diff --git a/src/Provider/Service/StorageServiceInterface.php b/src/Provider/Service/StorageServiceInterface.php index 92fac706..236c9f78 100644 --- a/src/Provider/Service/StorageServiceInterface.php +++ b/src/Provider/Service/StorageServiceInterface.php @@ -4,6 +4,4 @@ namespace DH\Auditor\Provider\Service; -interface StorageServiceInterface extends ServiceInterface -{ -} +interface StorageServiceInterface extends ServiceInterface {} diff --git a/tests/Fixtures/Provider/AuditNoStorageProvider.php b/tests/Fixtures/Provider/AuditNoStorageProvider.php index 3a74b7cf..8757a3c4 100644 --- a/tests/Fixtures/Provider/AuditNoStorageProvider.php +++ b/tests/Fixtures/Provider/AuditNoStorageProvider.php @@ -10,13 +10,9 @@ class AuditNoStorageProvider extends AbstractProvider { - public function getConfiguration(): ConfigurationInterface - { - } + public function getConfiguration(): ConfigurationInterface {} - public function persist(LifecycleEvent $event): void - { - } + public function persist(LifecycleEvent $event): void {} public function supportsStorage(): bool { @@ -28,11 +24,7 @@ public function supportsAuditing(): bool return true; } - public function getStorageServices(): array - { - } + public function getStorageServices(): array {} - public function getAuditingServices(): array - { - } + public function getAuditingServices(): array {} } diff --git a/tests/Fixtures/Provider/NoStorageNoAuditProvider.php b/tests/Fixtures/Provider/NoStorageNoAuditProvider.php index e26885c6..6c86712d 100644 --- a/tests/Fixtures/Provider/NoStorageNoAuditProvider.php +++ b/tests/Fixtures/Provider/NoStorageNoAuditProvider.php @@ -10,13 +10,9 @@ class NoStorageNoAuditProvider extends AbstractProvider { - public function getConfiguration(): ConfigurationInterface - { - } + public function getConfiguration(): ConfigurationInterface {} - public function persist(LifecycleEvent $event): void - { - } + public function persist(LifecycleEvent $event): void {} public function supportsStorage(): bool { @@ -28,11 +24,7 @@ public function supportsAuditing(): bool return false; } - public function getStorageServices(): array - { - } + public function getStorageServices(): array {} - public function getAuditingServices(): array - { - } + public function getAuditingServices(): array {} } diff --git a/tests/Fixtures/Provider/StorageAndAuditProvider.php b/tests/Fixtures/Provider/StorageAndAuditProvider.php index 3fe86694..3866dfaa 100644 --- a/tests/Fixtures/Provider/StorageAndAuditProvider.php +++ b/tests/Fixtures/Provider/StorageAndAuditProvider.php @@ -10,13 +10,9 @@ class StorageAndAuditProvider extends AbstractProvider { - public function getConfiguration(): ConfigurationInterface - { - } + public function getConfiguration(): ConfigurationInterface {} - public function persist(LifecycleEvent $event): void - { - } + public function persist(LifecycleEvent $event): void {} public function supportsStorage(): bool { @@ -28,11 +24,7 @@ public function supportsAuditing(): bool return true; } - public function getStorageServices(): array - { - } + public function getStorageServices(): array {} - public function getAuditingServices(): array - { - } + public function getAuditingServices(): array {} } diff --git a/tests/Fixtures/Provider/StorageNoAuditProvider.php b/tests/Fixtures/Provider/StorageNoAuditProvider.php index c859326d..0b40b4e5 100644 --- a/tests/Fixtures/Provider/StorageNoAuditProvider.php +++ b/tests/Fixtures/Provider/StorageNoAuditProvider.php @@ -10,13 +10,9 @@ class StorageNoAuditProvider extends AbstractProvider { - public function getConfiguration(): ConfigurationInterface - { - } + public function getConfiguration(): ConfigurationInterface {} - public function persist(LifecycleEvent $event): void - { - } + public function persist(LifecycleEvent $event): void {} public function supportsStorage(): bool { @@ -28,11 +24,7 @@ public function supportsAuditing(): bool return false; } - public function getStorageServices(): array - { - } + public function getStorageServices(): array {} - public function getAuditingServices(): array - { - } + public function getAuditingServices(): array {} } diff --git a/tests/Model/TransactionTest.php b/tests/Model/TransactionTest.php index a2e6fcd8..861657dc 100644 --- a/tests/Model/TransactionTest.php +++ b/tests/Model/TransactionTest.php @@ -14,13 +14,9 @@ */ final class TransactionTest extends TestCase { - protected function setUp(): void - { - } + protected function setUp(): void {} - protected function tearDown(): void - { - } + protected function tearDown(): void {} public function testGetTransactionHash(): void { diff --git a/tests/Provider/Doctrine/Fixtures/Entity/Inheritance/Joined/Cat.php b/tests/Provider/Doctrine/Fixtures/Entity/Inheritance/Joined/Cat.php index 18d721b7..ec953bf4 100644 --- a/tests/Provider/Doctrine/Fixtures/Entity/Inheritance/Joined/Cat.php +++ b/tests/Provider/Doctrine/Fixtures/Entity/Inheritance/Joined/Cat.php @@ -12,6 +12,4 @@ * @ORM\Table(name="cat", schema="auditor") */ #[ORM\Entity, ORM\Table(name: 'cat', schema: 'auditor')] -class Cat extends Animal -{ -} +class Cat extends Animal {} diff --git a/tests/Provider/Doctrine/Fixtures/Entity/Inheritance/Joined/Dog.php b/tests/Provider/Doctrine/Fixtures/Entity/Inheritance/Joined/Dog.php index 6ab74419..e3bae119 100644 --- a/tests/Provider/Doctrine/Fixtures/Entity/Inheritance/Joined/Dog.php +++ b/tests/Provider/Doctrine/Fixtures/Entity/Inheritance/Joined/Dog.php @@ -12,6 +12,4 @@ * @ORM\Table(name="dog", schema="auditor") */ #[ORM\Entity, ORM\Table(name: 'dog', schema: 'auditor')] -class Dog extends Animal -{ -} +class Dog extends Animal {} diff --git a/tests/Provider/Doctrine/Fixtures/Entity/Inheritance/SingleTable/Bike.php b/tests/Provider/Doctrine/Fixtures/Entity/Inheritance/SingleTable/Bike.php index 8ddef7f2..f2faeb31 100644 --- a/tests/Provider/Doctrine/Fixtures/Entity/Inheritance/SingleTable/Bike.php +++ b/tests/Provider/Doctrine/Fixtures/Entity/Inheritance/SingleTable/Bike.php @@ -10,6 +10,4 @@ * @ORM\Entity */ #[ORM\Entity] -class Bike extends Vehicle -{ -} +class Bike extends Vehicle {} diff --git a/tests/Provider/Doctrine/Fixtures/Entity/Inheritance/SingleTable/Car.php b/tests/Provider/Doctrine/Fixtures/Entity/Inheritance/SingleTable/Car.php index 46db0877..a1003955 100644 --- a/tests/Provider/Doctrine/Fixtures/Entity/Inheritance/SingleTable/Car.php +++ b/tests/Provider/Doctrine/Fixtures/Entity/Inheritance/SingleTable/Car.php @@ -10,6 +10,4 @@ * @ORM\Entity */ #[ORM\Entity] -class Car extends Vehicle -{ -} +class Car extends Vehicle {} diff --git a/tests/Provider/Doctrine/Fixtures/Entity/Standard/Blog/Author.php b/tests/Provider/Doctrine/Fixtures/Entity/Standard/Blog/Author.php index d29b6413..d14fdfe5 100644 --- a/tests/Provider/Doctrine/Fixtures/Entity/Standard/Blog/Author.php +++ b/tests/Provider/Doctrine/Fixtures/Entity/Standard/Blog/Author.php @@ -78,8 +78,6 @@ public function setId(int $id): self /** * Get the value of id. - * - * @return int */ public function getId(): ?int { @@ -98,8 +96,6 @@ public function setFullname(string $fullname): self /** * Get the value of fullname. - * - * @return string */ public function getFullname(): ?string { @@ -118,8 +114,6 @@ public function setEmail(string $email): self /** * Get the value of email. - * - * @return string */ public function getEmail(): ?string { diff --git a/tests/Provider/Doctrine/Fixtures/Entity/Standard/Blog/Comment.php b/tests/Provider/Doctrine/Fixtures/Entity/Standard/Blog/Comment.php index 04967938..55f959bd 100644 --- a/tests/Provider/Doctrine/Fixtures/Entity/Standard/Blog/Comment.php +++ b/tests/Provider/Doctrine/Fixtures/Entity/Standard/Blog/Comment.php @@ -67,9 +67,7 @@ class Comment #[ORM\JoinColumn(name: 'post_id', referencedColumnName: 'id', nullable: true)] protected $post; - public function __construct() - { - } + public function __construct() {} public function __sleep() { @@ -88,8 +86,6 @@ public function setId(int $id): self /** * Get the value of id. - * - * @return int */ public function getId(): ?int { @@ -108,8 +104,6 @@ public function setBody(string $body): self /** * Get the value of body. - * - * @return string */ public function getBody(): ?string { @@ -128,8 +122,6 @@ public function setAuthor(string $author): self /** * Get the value of author. - * - * @return string */ public function getAuthor(): ?string { @@ -166,8 +158,6 @@ public function setPostId(int $post_id): self /** * Get the value of post_id. - * - * @return int */ public function getPostId(): ?int { diff --git a/tests/Provider/Doctrine/Fixtures/Entity/Standard/Blog/Post.php b/tests/Provider/Doctrine/Fixtures/Entity/Standard/Blog/Post.php index 470df185..da1bd78f 100644 --- a/tests/Provider/Doctrine/Fixtures/Entity/Standard/Blog/Post.php +++ b/tests/Provider/Doctrine/Fixtures/Entity/Standard/Blog/Post.php @@ -134,8 +134,6 @@ public function setId(int $id): self /** * Get the value of id. - * - * @return int */ public function getId(): ?int { @@ -154,8 +152,6 @@ public function setTitle(string $title): self /** * Get the value of title. - * - * @return string */ public function getTitle(): ?string { @@ -174,8 +170,6 @@ public function setBody(string $body): self /** * Get the value of body. - * - * @return string */ public function getBody(): ?string { @@ -232,8 +226,6 @@ public function setAuthorId(int $author_id): self /** * Get the value of author_id. - * - * @return int */ public function getAuthorId(): ?int { diff --git a/tests/Provider/Doctrine/Fixtures/Entity/Standard/Blog/Tag.php b/tests/Provider/Doctrine/Fixtures/Entity/Standard/Blog/Tag.php index 29e2b958..ef21652f 100644 --- a/tests/Provider/Doctrine/Fixtures/Entity/Standard/Blog/Tag.php +++ b/tests/Provider/Doctrine/Fixtures/Entity/Standard/Blog/Tag.php @@ -69,8 +69,6 @@ public function setId(int $id): self /** * Get the value of id. - * - * @return int */ public function getId(): ?int { @@ -89,8 +87,6 @@ public function setTitle(string $title): self /** * Get the value of title. - * - * @return string */ public function getTitle(): ?string { diff --git a/tests/Provider/Doctrine/Fixtures/Issue101/ChildEntity.php b/tests/Provider/Doctrine/Fixtures/Issue101/ChildEntity.php index b35c7398..bed9448d 100644 --- a/tests/Provider/Doctrine/Fixtures/Issue101/ChildEntity.php +++ b/tests/Provider/Doctrine/Fixtures/Issue101/ChildEntity.php @@ -9,6 +9,4 @@ #[ORM\Entity] #[Audit\Auditable] -class ChildEntity extends ParentEntity -{ -} +class ChildEntity extends ParentEntity {} diff --git a/tests/Provider/Doctrine/Fixtures/Issue132/DummyEntity.php b/tests/Provider/Doctrine/Fixtures/Issue132/DummyEntity.php index 3961a4fd..93d942c5 100644 --- a/tests/Provider/Doctrine/Fixtures/Issue132/DummyEntity.php +++ b/tests/Provider/Doctrine/Fixtures/Issue132/DummyEntity.php @@ -10,6 +10,4 @@ * @ORM\Entity */ #[ORM\Entity] -class DummyEntity extends AbstractParentEntity -{ -} +class DummyEntity extends AbstractParentEntity {} diff --git a/tests/Provider/Doctrine/Fixtures/Issue37/User.php b/tests/Provider/Doctrine/Fixtures/Issue37/User.php index 5101d6b4..bd72c5e0 100644 --- a/tests/Provider/Doctrine/Fixtures/Issue37/User.php +++ b/tests/Provider/Doctrine/Fixtures/Issue37/User.php @@ -95,8 +95,6 @@ public function setLocaleId(string $locale_id): self /** * Get the value of locale_id. - * - * @return string */ public function getLocaleId(): ?string { diff --git a/tests/Provider/Doctrine/Traits/Schema/SchemaSetupTrait.php b/tests/Provider/Doctrine/Traits/Schema/SchemaSetupTrait.php index a3cbd44f..b5e9be8a 100644 --- a/tests/Provider/Doctrine/Traits/Schema/SchemaSetupTrait.php +++ b/tests/Provider/Doctrine/Traits/Schema/SchemaSetupTrait.php @@ -154,9 +154,7 @@ private function configureEntities(): void // No audited entities configured } - private function setupEntities(): void - { - } + private function setupEntities(): void {} /** * @param array $storageServices diff --git a/tools/phpstan/composer.json b/tools/phpstan/composer.json index 6d8f6e13..030aa9d9 100644 --- a/tools/phpstan/composer.json +++ b/tools/phpstan/composer.json @@ -5,5 +5,10 @@ "phpstan/phpstan-deprecation-rules": "^1.0", "phpstan/phpstan-doctrine": "^1.0", "phpstan/phpstan-strict-rules": "^1.0" + }, + "config": { + "allow-plugins": { + "phpstan/extension-installer": true + } } }