@@ -239,7 +239,7 @@ |
||
| 239 | 239 | |
| 240 | 240 | /** |
| 241 | 241 | * Prepares arguments and runs the command with [[passthru()]]. |
| 242 | - * @param array $arguments |
|
| 242 | + * @param string[] $arguments |
|
| 243 | 243 | * @return integer the exit code |
| 244 | 244 | */ |
| 245 | 245 | public function passthru(array $arguments = []) |
@@ -154,7 +154,7 @@ |
||
| 154 | 154 | /** |
| 155 | 155 | * Returns package with given name if exists. |
| 156 | 156 | * @param string $name package name |
| 157 | - * @return \Composer\Package\PackageInterface|null |
|
| 157 | + * @return \Composer\Package\RootPackageInterface|PackageInterface|null |
|
| 158 | 158 | */ |
| 159 | 159 | public function findPackage($name) |
| 160 | 160 | { |
@@ -56,10 +56,18 @@ |
||
| 56 | 56 | return static::isEmpty($a) || static::startsWith($a, $b . ' |') | static::endsWith($a, '| ' . $b); |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | + /** |
|
| 60 | + * @param string $haystack |
|
| 61 | + * @param string $needle |
|
| 62 | + */ |
|
| 59 | 63 | static public function startsWith($haystack, $needle) { |
| 60 | 64 | return $needle === "" || strrpos($haystack, $needle, -strlen($haystack)) !== false; |
| 61 | 65 | } |
| 62 | 66 | |
| 67 | + /** |
|
| 68 | + * @param string $haystack |
|
| 69 | + * @param string $needle |
|
| 70 | + */ |
|
| 63 | 71 | static public function endsWith($haystack, $needle) { |
| 64 | 72 | return $needle === "" || (($temp = strlen($haystack) - strlen($needle)) >= 0 && strpos($haystack, $needle, $temp) !== false); |
| 65 | 73 | } |