1
0
Fork 0

Fix misc phpdoc and strpos arg order nits

https://www.php.net/strpos has the signature
`strpos ( string $haystack , mixed $needle [, int $offset = 0 ] ) : int`
(The needle is usually the constant)

`strpos('/', $suggestion)` would only be `false` for `''` and `'/'`

So the existing check would just not suggest **anything** that was
already installed (from pecl, built-in, or composer).

The intent seems to be to not suggest non-vendored php packages
that were already installed. (b20cc22ebb)
pull/8377/head
Tyson Andre 2019-10-15 21:21:25 -04:00
parent f753c15664
commit 4c8e41d9a9
3 changed files with 2 additions and 3 deletions

View File

@ -90,7 +90,7 @@ EOT
continue;
}
foreach ($package['suggest'] as $suggestion => $reason) {
if (false === strpos('/', $suggestion) && null !== $platform->findPackage($suggestion, '*')) {
if (null !== $platform->findPackage($suggestion, '*')) {
continue;
}
if (!isset($installed[$suggestion])) {

View File

@ -239,7 +239,7 @@ abstract class BasePackage implements PackageInterface
* Build a regexp from a package name, expanding * globs as required
*
* @param string $whiteListedPattern
* @param bool $wrap Wrap the cleaned string by the given string
* @param string $wrap Wrap the cleaned string by the given string
* @return string
*/
public static function packageNameToRegexp($whiteListedPattern, $wrap = '{^%s$}i')

View File

@ -21,7 +21,6 @@ class Zip
* Gets content of the root composer.json inside a ZIP archive.
*
* @param string $pathToZip
* @param string $filename
*
* @return string|null
*/