Phpstan level 6 in Composer/Plaform and Composer/Script (#10159) (#10170)

main
pistej 3 years ago committed by GitHub
parent c9b80bc3b6
commit 98f1465610
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -31,11 +31,17 @@ class HhvmDetector
$this->processExecutor = $processExecutor;
}
/**
* @return void
*/
public function reset()
{
self::$hhvmVersion = null;
}
/**
* @return string|null
*/
public function getVersion()
{
if (null !== self::$hhvmVersion) {
@ -44,7 +50,6 @@ class HhvmDetector
self::$hhvmVersion = defined('HHVM_VERSION') ? HHVM_VERSION : null;
if (self::$hhvmVersion === null && !Platform::isWindows()) {
self::$hhvmVersion = false;
$this->executableFinder = $this->executableFinder ?: new ExecutableFinder();
$hhvmPath = $this->executableFinder->find('hhvm');
if ($hhvmPath !== null) {
@ -60,6 +65,6 @@ class HhvmDetector
}
}
return self::$hhvmVersion;
return self::$hhvmVersion ?: null;
}
}

@ -17,6 +17,7 @@ class Runtime
/**
* @param string $constant
* @param class-string $class
*
* @return bool
*/
public function hasConstant($constant, $class = null)
@ -27,6 +28,7 @@ class Runtime
/**
* @param string $constant
* @param class-string $class
*
* @return mixed
*/
public function getConstant($constant, $class = null)
@ -36,6 +38,7 @@ class Runtime
/**
* @param string $fn
*
* @return bool
*/
public function hasFunction($fn)
@ -45,7 +48,8 @@ class Runtime
/**
* @param callable $callable
* @param array $arguments
* @param mixed[] $arguments
*
* @return mixed
*/
public function invoke($callable, array $arguments = array())
@ -55,6 +59,7 @@ class Runtime
/**
* @param class-string $class
*
* @return bool
*/
public function hasClass($class)
@ -64,8 +69,10 @@ class Runtime
/**
* @param class-string $class
* @param array $arguments
* @param mixed[] $arguments
*
* @return object
* @throws \ReflectionException
*/
public function construct($class, array $arguments = array())
{
@ -86,6 +93,7 @@ class Runtime
/**
* @param string $extension
*
* @return string
*/
public function getExtensionVersion($extension)
@ -95,7 +103,9 @@ class Runtime
/**
* @param string $extension
*
* @return string
* @throws \ReflectionException
*/
public function getExtensionInfo($extension)
{

@ -92,6 +92,12 @@ class Version
return self::convertVersionId($versionId, 100);
}
/**
* @param int $versionId
* @param int $base
*
* @return string
*/
private static function convertVersionId($versionId, $base)
{
return sprintf(

@ -51,8 +51,8 @@ class Event extends BaseEvent
* @param Composer $composer The composer object
* @param IOInterface $io The IOInterface object
* @param bool $devMode Whether or not we are in dev mode
* @param array $args Arguments passed by the user
* @param array $flags Optional flags to pass data not as argument
* @param array<string|int|float|bool|null> $args Arguments passed by the user
* @param mixed[] $flags Optional flags to pass data not as argument
*/
public function __construct($name, Composer $composer, IOInterface $io, $devMode = false, array $args = array(), array $flags = array())
{

Loading…
Cancel
Save