Skip to content

Commit 3be482f

Browse files
committed
minor #1725 [Site] Fix infinite demo CS (smnandre)
This PR was merged into the 2.x branch. Discussion ---------- [Site] Fix infinite demo CS CS fixes Commits ------- b5a2d21 [Site] Fix infinite demo CS
2 parents 53b35c5 + b5a2d21 commit 3be482f

File tree

3 files changed

+7
-10
lines changed

3 files changed

+7
-10
lines changed

ux.symfony.com/src/Service/EmojiCollection.php

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,14 @@
22

33
namespace App\Service;
44

5-
use IteratorAggregate;
6-
use Traversable;
7-
85
/**
96
* Collection of emojis used in demos.
107
*
11-
* @implements IteratorAggregate<string>
8+
* @implements \IteratorAggregate<string>
129
*
1310
* @internal
1411
*/
15-
final class EmojiCollection implements IteratorAggregate, \Countable
12+
final class EmojiCollection implements \IteratorAggregate, \Countable
1613
{
1714
private array $emojis;
1815

@@ -23,17 +20,17 @@ public function __construct(array $emojis = [])
2320

2421
public function paginate(int $page, int $perPage): self
2522
{
26-
return new self(array_slice($this->emojis, ($page - 1) * $perPage, $perPage));
23+
return new self(\array_slice($this->emojis, ($page - 1) * $perPage, $perPage));
2724
}
2825

29-
public function getIterator(): Traversable
26+
public function getIterator(): \Traversable
3027
{
3128
return new \ArrayIterator($this->emojis);
3229
}
3330

3431
public function count(): int
3532
{
36-
return count($this->emojis);
33+
return \count($this->emojis);
3734
}
3835

3936
private function loadEmojis(): array

ux.symfony.com/src/Service/LiveDemoRepository.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function findAll(): array
4242
route: 'app_demo_live_component_infinite_scroll',
4343
longDescription: <<<EOF
4444
Infinite scroll allows users to continuously load content as they scroll down the page.
45-
<br><code>Part One</code> of this demo shows how to <code>append new items</code> to the page with a <a href="/live-component"><code>LiveComponent</code></a>.
45+
<br><code>Part One</code> of this demo shows how to <code>append new items</code> to the page with a <a href="/live-component"><code>LiveComponent</code></a>.
4646
EOF,
4747
tags: ['pattern', 'pagination', 'navigation'],
4848
),

ux.symfony.com/src/Twig/ProductGrid.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public function getItems(): array
5454
$items[] = [
5555
'id' => $id = ($this->page - 1) * self::PER_PAGE + $i,
5656
'emoji' => $emoji,
57-
'color' => $colors[$id % count($colors)],
57+
'color' => $colors[$id % \count($colors)],
5858
];
5959
}
6060

0 commit comments

Comments
 (0)