From e65f527bcdb95a5879e0cfd414f23c99efed3386 Mon Sep 17 00:00:00 2001 From: Matthias Pigulla Date: Mon, 26 Aug 2024 11:18:55 +0200 Subject: [PATCH 1/2] Aktualisiere PHP-CS-Fixer auf v3.62.0 (Batch-commit via https://github.com/webfactory/bfg9000/pull/8, Case 174703) --- .github/workflows/fix-cs-php.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/fix-cs-php.yml b/.github/workflows/fix-cs-php.yml index 09d76ca..891af0c 100644 --- a/.github/workflows/fix-cs-php.yml +++ b/.github/workflows/fix-cs-php.yml @@ -18,7 +18,7 @@ jobs: ref: ${{ github.head_ref }} - name: Run PHP-CS-Fixer - uses: docker://oskarstark/php-cs-fixer-ga:3.11.0 + uses: docker://ghcr.io/webfactory/php-cs-fixer:3.62.0 - name: Commit and push back changes uses: stefanzweifel/git-auto-commit-action@v4 From 574c3b6ba537c6aaa80c0e704f025ecb1ef5e97b Mon Sep 17 00:00:00 2001 From: mpdude Date: Mon, 26 Aug 2024 09:19:19 +0000 Subject: [PATCH 2/2] Fix CS with PHP-CS-Fixer --- src/Caching/Attribute/Send304IfNotModified.php | 2 +- src/Caching/WfdMetaQueries.php | 1 + src/Config/WfdMetaConfigCache.php | 2 +- src/Config/WfdMetaConfigCacheFactory.php | 2 +- src/DoctrineMetadataHelper.php | 2 +- src/MetadataFacade.php | 4 ++-- src/Util/CriticalSection.php | 2 +- src/Util/ExpirableConfigCache.php | 2 +- 8 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/Caching/Attribute/Send304IfNotModified.php b/src/Caching/Attribute/Send304IfNotModified.php index 2d7e960..77a38db 100644 --- a/src/Caching/Attribute/Send304IfNotModified.php +++ b/src/Caching/Attribute/Send304IfNotModified.php @@ -30,7 +30,7 @@ public function __construct(...$values) ); if (!$values) { - throw new InvalidArgumentException(sprintf('The %s attribute needs at least one criterion', __CLASS__)); + throw new InvalidArgumentException(\sprintf('The %s attribute needs at least one criterion', __CLASS__)); } $this->lastmodHelper = new LastmodHelper(); diff --git a/src/Caching/WfdMetaQueries.php b/src/Caching/WfdMetaQueries.php index 6661681..1e70e4b 100644 --- a/src/Caching/WfdMetaQueries.php +++ b/src/Caching/WfdMetaQueries.php @@ -28,6 +28,7 @@ * ) * * becomes (without the spaces behind the "@"s): + * * @ ReplaceWithNotModifiedResponse({"@ app_caching_mycontroller_myaction"}) * * with the following service definition: diff --git a/src/Config/WfdMetaConfigCache.php b/src/Config/WfdMetaConfigCache.php index f01ae06..37885a3 100644 --- a/src/Config/WfdMetaConfigCache.php +++ b/src/Config/WfdMetaConfigCache.php @@ -71,7 +71,7 @@ public function isWfdMetaFresh(): bool return $metaQuery->getLastTouched() === $wfdMetaResources['timestamp']; } - public function write($content, array $metadata = null): void + public function write($content, ?array $metadata = null): void { $this->innerCache->write($content, $metadata); diff --git a/src/Config/WfdMetaConfigCacheFactory.php b/src/Config/WfdMetaConfigCacheFactory.php index f590760..02d57b4 100644 --- a/src/Config/WfdMetaConfigCacheFactory.php +++ b/src/Config/WfdMetaConfigCacheFactory.php @@ -44,7 +44,7 @@ public function __construct(ConfigCacheFactoryInterface $configCacheFactory, Met public function cache($file, $callback): ConfigCacheInterface { if (!\is_callable($callback)) { - throw new InvalidArgumentException(sprintf('Invalid type for callback argument. Expected callable, but got "%s".', \gettype($callback))); + throw new InvalidArgumentException(\sprintf('Invalid type for callback argument. Expected callable, but got "%s".', \gettype($callback))); } $wfdMetaCache = null; diff --git a/src/DoctrineMetadataHelper.php b/src/DoctrineMetadataHelper.php index 8019131..c8b707c 100644 --- a/src/DoctrineMetadataHelper.php +++ b/src/DoctrineMetadataHelper.php @@ -58,7 +58,7 @@ public function getRootTableName(string $classname): string public function getPrimaryKey($entity) { /** @var $meta ClassMetadata */ - $meta = $this->metadataFactory->getMetadataFor(\get_class($entity)); + $meta = $this->metadataFactory->getMetadataFor($entity::class); return $meta->getFieldValue($entity, $meta->getSingleIdentifierFieldName()); } diff --git a/src/MetadataFacade.php b/src/MetadataFacade.php index a368981..dce4879 100644 --- a/src/MetadataFacade.php +++ b/src/MetadataFacade.php @@ -19,7 +19,7 @@ class MetadataFacade /** * MetadataFacade constructor. */ - public function __construct(Provider $provider, DoctrineMetadataHelper $doctrineMetadataHelper = null) + public function __construct(Provider $provider, ?DoctrineMetadataHelper $doctrineMetadataHelper = null) { $this->provider = $provider; $this->doctrineMetadataHelper = $doctrineMetadataHelper; @@ -37,7 +37,7 @@ public function getLastTouchedForEntity($entity) } return $this->provider->getLastTouchedRow( - $this->doctrineMetadataHelper->getRootTableName(\get_class($entity)), + $this->doctrineMetadataHelper->getRootTableName($entity::class), $this->doctrineMetadataHelper->getPrimaryKey($entity) ); } diff --git a/src/Util/CriticalSection.php b/src/Util/CriticalSection.php index 24aac58..7778f61 100644 --- a/src/Util/CriticalSection.php +++ b/src/Util/CriticalSection.php @@ -48,7 +48,7 @@ class CriticalSection * * The lock name is used as key. * - * @var array + * @var array */ private static $entranceCount = []; diff --git a/src/Util/ExpirableConfigCache.php b/src/Util/ExpirableConfigCache.php index 41e1af1..617ed30 100644 --- a/src/Util/ExpirableConfigCache.php +++ b/src/Util/ExpirableConfigCache.php @@ -38,7 +38,7 @@ public function __construct($baseFilename, $debug, $timestamp) parent::__construct($this->timestampedFile, $debug); } - public function write(string $content, array $metadata = null): void + public function write(string $content, ?array $metadata = null): void { parent::write($content, $metadata);