From dc7694d4987dca88401404ecc9ea13f5d4adb706 Mon Sep 17 00:00:00 2001 From: Matthias Pigulla Date: Mon, 26 Aug 2024 11:19:04 +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 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 From 0ff6fef8e2368082a46c328a4e6f7db41c21340f Mon Sep 17 00:00:00 2001 From: mpdude Date: Mon, 26 Aug 2024 09:19:22 +0000 Subject: [PATCH 2/2] Fix CS with PHP-CS-Fixer 2.19.0 --- src/Build/TreeFactory.php | 8 ++++---- src/Tree/Node.php | 16 ++-------------- src/Tree/Tree.php | 6 +++--- src/Twig/NavigationExtension.php | 2 +- 4 files changed, 10 insertions(+), 22 deletions(-) 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]) {