1
0
Fork 0
mirror of https://github.com/composer/composer synced 2025-05-09 16:42:57 +00:00

Fix phpstan phpdocs issues (#9478)

This commit is contained in:
Andrés De la Cruz 2020-11-20 09:28:09 +01:00 committed by GitHub
parent f129c231b1
commit 480a6439fd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 31 additions and 10 deletions

View file

@ -1,5 +1,6 @@
parameters: parameters:
level: 1 level: 1
checkClassCaseSensitivity: true # Level 2 rule
excludes_analyse: excludes_analyse:
- '../tests/Composer/Test/Fixtures/*' - '../tests/Composer/Test/Fixtures/*'
- '../tests/Composer/Test/Autoload/Fixtures/*' - '../tests/Composer/Test/Autoload/Fixtures/*'
@ -34,3 +35,25 @@ parameters:
rules: rules:
- Composer\PHPStanRules\AnonymousFunctionWithThisRule - Composer\PHPStanRules\AnonymousFunctionWithThisRule
# Level 2 rules
- PHPStan\Rules\Cast\EchoRule
- PHPStan\Rules\Cast\InvalidCastRule
- PHPStan\Rules\Cast\InvalidPartOfEncapsedStringRule
- PHPStan\Rules\Cast\PrintRule
- PHPStan\Rules\Functions\IncompatibleDefaultParameterTypeRule
- PHPStan\Rules\Generics\ClassAncestorsRule
- PHPStan\Rules\Generics\ClassTemplateTypeRule
- PHPStan\Rules\Generics\FunctionTemplateTypeRule
- PHPStan\Rules\Generics\FunctionSignatureVarianceRule
- PHPStan\Rules\Generics\InterfaceAncestorsRule
- PHPStan\Rules\Generics\InterfaceTemplateTypeRule
- PHPStan\Rules\Generics\MethodTemplateTypeRule
- PHPStan\Rules\Generics\MethodSignatureVarianceRule
- PHPStan\Rules\Generics\TraitTemplateTypeRule
- PHPStan\Rules\Operators\InvalidBinaryOperationRule
- PHPStan\Rules\Operators\InvalidUnaryOperationRule
- PHPStan\Rules\Operators\InvalidComparisonOperationRule
- PHPStan\Rules\PhpDoc\IncompatiblePhpDocTypeRule
- PHPStan\Rules\PhpDoc\IncompatiblePropertyPhpDocTypeRule
- PHPStan\Rules\PhpDoc\InvalidPhpDocTagValueRule
- PHPStan\Rules\PhpDoc\InvalidPHPStanDocTagRule

View file

@ -400,7 +400,7 @@ TAGSPUBKEY
* @param string $localFilename The composer.phar location * @param string $localFilename The composer.phar location
* @param string $newFilename The downloaded or backup phar * @param string $newFilename The downloaded or backup phar
* @param string $backupTarget The filename to use for the backup * @param string $backupTarget The filename to use for the backup
* @throws \FilesystemException If the file cannot be moved * @throws FilesystemException If the file cannot be moved
* @return bool Whether the phar is valid and has been moved * @return bool Whether the phar is valid and has been moved
*/ */
protected function setLocalPhar($localFilename, $newFilename, $backupTarget = null) protected function setLocalPhar($localFilename, $newFilename, $backupTarget = null)

View file

@ -29,7 +29,7 @@ interface OperationInterface
/** /**
* Serializes the operation in a human readable format * Serializes the operation in a human readable format
* *
* @param $lock bool Whether this is an operation on the lock file * @param bool $lock Whether this is an operation on the lock file
* @return string * @return string
*/ */
public function show($lock); public function show($lock);

View file

@ -66,7 +66,6 @@ class PackageEvent extends Event
* @param IOInterface $io * @param IOInterface $io
* @param bool $devMode * @param bool $devMode
* @param RepositoryInterface $localRepo * @param RepositoryInterface $localRepo
* @param Request $request
* @param OperationInterface[] $operations * @param OperationInterface[] $operations
* @param OperationInterface $operation * @param OperationInterface $operation
*/ */

View file

@ -599,7 +599,7 @@ class PlatformRepository extends ArrayRepository
/** /**
* Check if a package name is a platform package. * Check if a package name is a platform package.
* *
* @param $name * @param string $name
* @return bool * @return bool
*/ */
public static function isPlatformPackage($name) public static function isPlatformPackage($name)

View file

@ -90,7 +90,6 @@ class Bitbucket
} }
/** /**
* @param string $originUrl
* @return bool * @return bool
*/ */
private function requestAccessToken() private function requestAccessToken()

View file

@ -152,7 +152,7 @@ class ProxyManager
/** /**
* Sets initial data * Sets initial data
* *
* @param string $proxyUrl Proxy url * @param string $url Proxy url
* @param string $scheme Environment variable scheme * @param string $scheme Environment variable scheme
*/ */
private function setData($url, $scheme) private function setData($url, $scheme)

View file

@ -174,7 +174,7 @@ class NoProxyPattern
* @param int $index * @param int $index
* @param string $hostName * @param string $hostName
* *
* @return {null|stdClass} Null if the hostname is invalid * @return null|stdClass Null if the hostname is invalid
*/ */
private function getRule($index, $hostName) private function getRule($index, $hostName)
{ {

View file

@ -1073,7 +1073,7 @@ Linked Version => 1.2.11',
* @param array<string,string|false> $expectations * @param array<string,string|false> $expectations
* @param array<string,mixed> $functions * @param array<string,mixed> $functions
* @param array<string,mixed> $constants * @param array<string,mixed> $constants
* @param array<string,class-string> $classes * @param array<string,class-string> $classDefinitions
*/ */
public function testLibraryInformation( public function testLibraryInformation(
$extensions, $extensions,

View file

@ -514,8 +514,8 @@ class AuthHelperTest extends TestCase
} }
/** /**
* @param $origin * @param string $origin
* @param $auth * @param array $auth
*/ */
private function expectsAuthentication($origin, $auth) private function expectsAuthentication($origin, $auth)
{ {