Skip to content

Commit

Permalink
skeleton: filter out non-library packages
Browse files Browse the repository at this point in the history
\Composer\InstalledVersions::getAllRawData() will return all composer
packages installed, regardless of their type. This caused a problem
when creating a "skeleton" project using composer. Currently, all
skeleton composer packages are of type "library" anyway so it's safe
to filter out the rest.
  • Loading branch information
gerryd committed Mar 18, 2023
1 parent abae4fa commit 1eb4656
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/Skeleton/Core/Skeleton.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ public static function get_all() {
}

list($vendor, $name) = explode('/', $package);
if ($vendor != 'tigron') {

if ($vendor !== 'tigron' || $details['type'] !== 'library') {
continue;
}

Expand All @@ -84,9 +85,10 @@ public static function get_all() {

$skeletons[] = $skeleton;
}

self::$skeleton_cache = $skeletons;
}

return self::$skeleton_cache;
}

}

0 comments on commit 1eb4656

Please sign in to comment.