diff --git a/.github/workflows/fix-cs-php.yml b/.github/workflows/fix-cs-php.yml index 3fbfe58..8d9f924 100644 --- a/.github/workflows/fix-cs-php.yml +++ b/.github/workflows/fix-cs-php.yml @@ -21,7 +21,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 diff --git a/src/Build/TreeFactory.php b/src/Build/TreeFactory.php index d2bb660..bbaa1e5 100644 --- a/src/Build/TreeFactory.php +++ b/src/Build/TreeFactory.php @@ -52,9 +52,9 @@ public function __construct( ConfigCacheFactoryInterface $configCacheFactory, $cacheFile, ContainerInterface $container, - EventDispatcherInterface $eventDispatcher = null, - LoggerInterface $logger = null, - Stopwatch $stopwatch = null + ?EventDispatcherInterface $eventDispatcher = null, + ?LoggerInterface $logger = null, + ?Stopwatch $stopwatch = null ) { $this->configCacheFactory = $configCacheFactory; $this->cacheFile = $cacheFile; @@ -80,7 +80,7 @@ protected function startTiming(string $sectionName): ?StopwatchEvent return null; } - protected function stopTiming(StopwatchEvent $watch = null): void + protected function stopTiming(?StopwatchEvent $watch = null): void { if ($watch) { $watch->stop(); diff --git a/src/Tree/Node.php b/src/Tree/Node.php index ee2cc48..11d13f4 100644 --- a/src/Tree/Node.php +++ b/src/Tree/Node.php @@ -18,7 +18,7 @@ class Node implements \ArrayAccess /** * @var Node|null */ - protected $parent = null; + protected $parent; protected $data = ['visible' => false, 'breadcrumbsVisible' => true, 'url' => false, 'caption' => '']; @@ -34,7 +34,7 @@ class Node implements \ArrayAccess * * @return Node returns the given or newly created node, for use in fluent notations */ - public function addChild(self $n = null): self + public function addChild(?self $n = null): self { if (null === $n) { $n = new self(); @@ -243,17 +243,12 @@ public function isActivePath(): bool return $this === $ap || $this->hasDescendant($ap); } - /** - * @param mixed $offset - */ public function offsetExists($offset): bool { return isset($this->data[$offset]); } /** - * @param mixed $offset - * * @return mixed|null */ #[\ReturnTypeWillChange] @@ -262,18 +257,11 @@ public function offsetGet($offset) return $this->get($offset); } - /** - * @param mixed $offset - * @param mixed $value - */ public function offsetSet($offset, $value): void { $this->set($offset, $value); } - /** - * @param mixed $offset - */ public function offsetUnset($offset): void { unset($this->data[$offset]); diff --git a/src/Tree/Tree.php b/src/Tree/Tree.php index 22d65d0..115550a 100644 --- a/src/Tree/Tree.php +++ b/src/Tree/Tree.php @@ -19,7 +19,7 @@ class Tree * * @var Node|null */ - protected $activeNode = null; + protected $activeNode; /** * The "closest to active" node in this tree. @@ -30,14 +30,14 @@ class Tree * * @var ?Node */ - protected $activePath = null; + protected $activePath; public function __construct() { $this->finder = new Finder(); } - public function addRoot(Node $r = null): Node + public function addRoot(?Node $r = null): Node { if (null === $r) { $r = new Node(); diff --git a/src/Twig/NavigationExtension.php b/src/Twig/NavigationExtension.php index 5e4644b..693b76d 100644 --- a/src/Twig/NavigationExtension.php +++ b/src/Twig/NavigationExtension.php @@ -177,7 +177,7 @@ public function getPowerSet(array $baseSet): array $members = 2 ** $count; $powerSet = []; for ($i = 0; $i < $members; ++$i) { - $b = sprintf('%0'.$count.'b', $i); + $b = \sprintf('%0'.$count.'b', $i); $out = []; for ($j = 0; $j < $count; ++$j) { if ('1' == $b[$j]) {