1
0
Fork 0

use more precise phpstan/psam return-types (#8744)

pull/8752/head
Markus Staab 2020-04-08 10:01:09 +02:00 committed by GitHub
parent 736af4cb58
commit 593d5abf27
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 4 deletions

View File

@ -28,6 +28,9 @@ class ArchiveManager
protected $downloadManager; protected $downloadManager;
protected $loop; protected $loop;
/**
* @var ArchiverInterface[]
*/
protected $archivers = array(); protected $archivers = array();
/** /**

View File

@ -47,7 +47,7 @@ interface PackageInterface
* *
* @param bool $provides Whether provided names should be included * @param bool $provides Whether provided names should be included
* *
* @return array An array of strings referring to this package * @return string[] An array of strings referring to this package
*/ */
public function getNames($provides = true); public function getNames($provides = true);
@ -159,7 +159,7 @@ interface PackageInterface
/** /**
* Returns the urls of the distribution archive of this version, including mirrors * Returns the urls of the distribution archive of this version, including mirrors
* *
* @return array * @return string[]
*/ */
public function getDistUrls(); public function getDistUrls();
@ -270,6 +270,7 @@ interface PackageInterface
* combination with this package. * combination with this package.
* *
* @return array An array of package suggestions with descriptions * @return array An array of package suggestions with descriptions
* @psalm-return array<string, string>
*/ */
public function getSuggests(); public function getSuggests();
@ -282,6 +283,7 @@ interface PackageInterface
* directories for autoloading using the type specified. * directories for autoloading using the type specified.
* *
* @return array Mapping of autoloading rules * @return array Mapping of autoloading rules
* @psalm-return array{psr-0?: array<string, string>, psr-4?: array<string, string>, classmap?: list<string>, file?: list<string>}
*/ */
public function getAutoload(); public function getAutoload();
@ -294,6 +296,7 @@ interface PackageInterface
* directories for autoloading using the type specified. * directories for autoloading using the type specified.
* *
* @return array Mapping of dev autoloading rules * @return array Mapping of dev autoloading rules
* @psalm-return array{psr-0?: array<string, string>, psr-4?: array<string, string>, classmap?: list<string>, file?: list<string>}
*/ */
public function getDevAutoload(); public function getDevAutoload();
@ -301,7 +304,7 @@ interface PackageInterface
* Returns a list of directories which should get added to PHP's * Returns a list of directories which should get added to PHP's
* include path. * include path.
* *
* @return array * @return string[]
*/ */
public function getIncludePaths(); public function getIncludePaths();
@ -322,7 +325,7 @@ interface PackageInterface
/** /**
* Returns the package binaries * Returns the package binaries
* *
* @return array * @return string[]
*/ */
public function getBinaries(); public function getBinaries();

View File

@ -69,7 +69,9 @@ interface RepositoryInterface extends \Countable
* @param ConstraintInterface[] $packageNameMap package names pointing to constraints * @param ConstraintInterface[] $packageNameMap package names pointing to constraints
* @param array $acceptableStabilities * @param array $acceptableStabilities
* @param array $stabilityFlags * @param array $stabilityFlags
*
* @return array [namesFound => string[], packages => PackageInterface[]] * @return array [namesFound => string[], packages => PackageInterface[]]
* @psalm-return array{namesFound: string[], packages: PackageInterface[]}
*/ */
public function loadPackages(array $packageNameMap, array $acceptableStabilities, array $stabilityFlags); public function loadPackages(array $packageNameMap, array $acceptableStabilities, array $stabilityFlags);
@ -81,6 +83,7 @@ interface RepositoryInterface extends \Countable
* @param string $type The type of package to search for. Defaults to all types of packages * @param string $type The type of package to search for. Defaults to all types of packages
* *
* @return array[] an array of array('name' => '...', 'description' => '...') * @return array[] an array of array('name' => '...', 'description' => '...')
* @psalm-return list<array{name: string, description: string}>
*/ */
public function search($query, $mode = 0, $type = null); public function search($query, $mode = 0, $type = null);
@ -92,6 +95,7 @@ interface RepositoryInterface extends \Countable
* @param string $packageName package name which must be provided * @param string $packageName package name which must be provided
* *
* @return array[] an array with the provider name as key and value of array('name' => '...', 'description' => '...', 'type' => '...') * @return array[] an array with the provider name as key and value of array('name' => '...', 'description' => '...', 'type' => '...')
* @psalm-return array<string, array{name: string, description: string, type: string}>
*/ */
public function getProviders($packageName); public function getProviders($packageName);