Skip to content

Commit fcf35f2

Browse files
authored
refactor(icon): minor improvements (#1769)
1 parent c7237dc commit fcf35f2

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

packages/icon/src/Icon.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public function __construct(
3030
*/
3131
public function render(string $icon): ?string
3232
{
33-
[$collection, $iconName] = $this->parseIconIdentifier($icon);
33+
[$collection, $iconName] = $this->parseIconIdentifier($icon) ?? [null, null];
3434

3535
if ($this->iconCache->get("icon-failure-{$collection}-{$iconName}")) {
3636
return null;

packages/icon/src/IconCache.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ public function get(string $key): mixed
4343

4444
public function clear(): void
4545
{
46+
if (! $this->enabled) {
47+
return;
48+
}
49+
4650
$this->pool->clear();
4751
}
4852

packages/icon/src/IconInitializer.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
use Tempest\Container\Singleton;
88
use Tempest\EventBus\EventBus;
99
use Tempest\HttpClient\HttpClient;
10-
use Tempest\Icon\IconCache;
1110

1211
final class IconInitializer implements Initializer
1312
{

0 commit comments

Comments
 (0)