File tree 1 file changed +4
-2
lines changed
app/Semver/Http/Controllers
1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -56,7 +56,8 @@ public function matchVersions($vendor, $package)
56
56
{
57
57
$ this ->configureMinimumStability ();
58
58
59
- $ constraint = $ this ->request ->getAttribute ('constraint ' , '* ' );
59
+ $ queryParams = $ this ->request ->getQueryParams ();
60
+ $ constraint = isset ($ queryParams ['constraint ' ]) ? $ queryParams ['constraint ' ] : '* ' ;
60
61
$ versions = $ this ->packagist ->getMatchingVersions ($ vendor , $ package , $ constraint );
61
62
62
63
return new JsonResponse ($ versions );
@@ -67,7 +68,8 @@ public function matchVersions($vendor, $package)
67
68
*/
68
69
protected function configureMinimumStability ()
69
70
{
70
- $ minimumStability = $ this ->request ->getAttribute ('minimum-stability ' , 'stable ' );
71
+ $ queryParams = $ this ->request ->getQueryParams ();
72
+ $ minimumStability = isset ($ queryParams ['minimum-stability ' ]) ? $ queryParams ['minimum-stability ' ] : 'stable ' ;
71
73
if (!in_array ($ minimumStability , array_keys (BasePackage::$ stabilities ), true )) {
72
74
throw new UnexpectedValueException (sprintf ('Unsupported value for minimum-stability: %s ' , $ minimumStability ));
73
75
}
You can’t perform that action at this time.
0 commit comments