Skip to content

Commit

Permalink
Fix CS with PHP-CS-Fixer
Browse files Browse the repository at this point in the history
  • Loading branch information
mpdude authored and github-actions[bot] committed Aug 30, 2024
1 parent 618f640 commit 48e8ea1
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/Caching/Attribute/Send304IfNotModified.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
1 change: 1 addition & 0 deletions src/Caching/WfdMetaQueries.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
* )
*
* becomes (without the spaces behind the "@"s):
*
* @ ReplaceWithNotModifiedResponse({"@ app_caching_mycontroller_myaction"})
*
* with the following service definition:
Expand Down
2 changes: 1 addition & 1 deletion src/Config/WfdMetaConfigCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,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);

Expand Down
2 changes: 1 addition & 1 deletion src/Config/WfdMetaConfigCacheFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,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;
Expand Down
2 changes: 1 addition & 1 deletion src/DoctrineMetadataHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
Expand Down
4 changes: 2 additions & 2 deletions src/MetadataFacade.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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)
);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Util/CriticalSection.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class CriticalSection
*
* The lock name is used as key.
*
* @var array<string, integer>
* @var array<string, int>
*/
private static $entranceCount = [];

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

Expand Down

0 comments on commit 48e8ea1

Please sign in to comment.