Skip to content

Commit

Permalink
remove usless filterfonts method close #438
Browse files Browse the repository at this point in the history
  • Loading branch information
vincent-peugnet committed Oct 13, 2024
1 parent dbbc86f commit a171bec
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions app/class/Servicefont.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,9 @@ public function __construct(Modelmedia $mediamanager)
$this->mediamanager = $mediamanager;
$mediaopt = new Mediaopt(['path' => Model::FONT_DIR, 'type' => [Media::FONT]]);
$medias = $this->mediamanager->medialistopt($mediaopt);
$medias = $this->filterfonts($medias);
$this->fonts = $this->groupfonts($medias);
}

/**
* Remove all non-font Media from a list of Media objects
*
* @param Media[] $medias List of Media objects
*
* @return Media[] Filtered list, containting only font files
*/
protected function filterfonts(array $medias): array
{
return array_filter($medias, function (Media $media) {
return $media->type() === Media::FONT;
});
}

/**
* This will group the media by filename
*
Expand Down

0 comments on commit a171bec

Please sign in to comment.