File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
app/Semver/Http/Controllers Expand file tree Collapse file tree 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)
5656 {
5757 $ this ->configureMinimumStability ();
5858
59- $ constraint = $ this ->request ->getAttribute ('constraint ' , '* ' );
59+ $ queryParams = $ this ->request ->getQueryParams ();
60+ $ constraint = isset ($ queryParams ['constraint ' ]) ? $ queryParams ['constraint ' ] : '* ' ;
6061 $ versions = $ this ->packagist ->getMatchingVersions ($ vendor , $ package , $ constraint );
6162
6263 return new JsonResponse ($ versions );
@@ -67,7 +68,8 @@ public function matchVersions($vendor, $package)
6768 */
6869 protected function configureMinimumStability ()
6970 {
70- $ minimumStability = $ this ->request ->getAttribute ('minimum-stability ' , 'stable ' );
71+ $ queryParams = $ this ->request ->getQueryParams ();
72+ $ minimumStability = isset ($ queryParams ['minimum-stability ' ]) ? $ queryParams ['minimum-stability ' ] : 'stable ' ;
7173 if (!in_array ($ minimumStability , array_keys (BasePackage::$ stabilities ), true )) {
7274 throw new UnexpectedValueException (sprintf ('Unsupported value for minimum-stability: %s ' , $ minimumStability ));
7375 }
You can’t perform that action at this time.
0 commit comments