Skip to content

Commit

Permalink
Fix missing attributes on Iconify provider
Browse files Browse the repository at this point in the history
  • Loading branch information
ocubom committed Apr 3, 2023
1 parent a3ea107 commit 64d07cc
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
4 changes: 3 additions & 1 deletion src/Svg/Provider/Iconify/IconifyLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ public function __construct(PathCollection $searchPath, iterable $options = null
// Parse options
$options = static::configureOptions()
->resolve(iterable_to_array($options ?? /* @scrutinizer ignore-type */ []));

// Check cache directory path
$this->cacheDir = Path::canonicalize($options['cache_dir'] ?? '');
if ('' === $this->cacheDir) {
$this->cacheDir = null; // @codeCoverageIgnore
Expand All @@ -66,7 +68,7 @@ public function resolve(string $ident, iterable $options = null): Svg
);

if ($icon) {
return new Svg($icon->getSVG(iterable_to_array($options ?? [])));
return new Svg($icon->getSVG(iterable_to_array($options ?? []), true));
}
}

Expand Down
4 changes: 2 additions & 2 deletions tests/Fixtures/filter/iconify-no-webcomponent.test
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ return ['debug' => true]
<body>

<!-- Iconify SVG framework -->
<!--<span class="iconify" data-icon="mdi:home"></span>--><svg width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24" focusable="false" role="img" aria-hidden="true"><path fill="currentColor" d="M10 20v-6h4v6h5v-8h3L12 3L2 12h3v8h5Z" /></svg>
<!--<span class="iconify-inline" data-icon="mdi:home"></span>--><svg width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24" focusable="false" role="img" aria-hidden="true"><path fill="currentColor" d="M10 20v-6h4v6h5v-8h3L12 3L2 12h3v8h5Z" /></svg>
<!--<span class="iconify" data-icon="mdi:home"></span>--><svg class="iconify" data-icon="mdi:home" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24" focusable="false" role="img" aria-hidden="true"><path fill="currentColor" d="M10 20v-6h4v6h5v-8h3L12 3L2 12h3v8h5Z" /></svg>
<!--<span class="iconify-inline" data-icon="mdi:home"></span>--><svg class="iconify-inline" data-icon="mdi:home" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24" focusable="false" role="img" aria-hidden="true"><path fill="currentColor" d="M10 20v-6h4v6h5v-8h3L12 3L2 12h3v8h5Z" /></svg>

<!-- Iconify Icon Web Component -->
<iconify-icon icon="mdi:home"></iconify-icon>
Expand Down
4 changes: 2 additions & 2 deletions tests/Fixtures/filter/iconify.test
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ return ['debug' => true]
<body>

<!-- Iconify SVG framework -->
<!--<span class="iconify" data-icon="mdi:home"></span>--><svg width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24" focusable="false" role="img" aria-hidden="true"><path fill="currentColor" d="M10 20v-6h4v6h5v-8h3L12 3L2 12h3v8h5Z" /></svg>
<!--<span class="iconify-inline" data-icon="mdi:home"></span>--><svg width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24" focusable="false" role="img" aria-hidden="true"><path fill="currentColor" d="M10 20v-6h4v6h5v-8h3L12 3L2 12h3v8h5Z" /></svg>
<!--<span class="iconify" data-icon="mdi:home"></span>--><svg class="iconify" data-icon="mdi:home" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24" focusable="false" role="img" aria-hidden="true"><path fill="currentColor" d="M10 20v-6h4v6h5v-8h3L12 3L2 12h3v8h5Z" /></svg>
<!--<span class="iconify-inline" data-icon="mdi:home"></span>--><svg class="iconify-inline" data-icon="mdi:home" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24" focusable="false" role="img" aria-hidden="true"><path fill="currentColor" d="M10 20v-6h4v6h5v-8h3L12 3L2 12h3v8h5Z" /></svg>

<!-- Iconify Icon Web Component -->
<!--<iconify-icon icon="mdi:home"></iconify-icon>--><svg width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24" focusable="false" role="img" aria-hidden="true"><path fill="currentColor" d="M10 20v-6h4v6h5v-8h3L12 3L2 12h3v8h5Z" /></svg>
Expand Down

0 comments on commit 64d07cc

Please sign in to comment.