1
0
Fork 0

do not stumble over missing descriptions (#12152)

pull/12159/head
Christian Flothmann 2024-10-15 11:22:49 +02:00 committed by GitHub
parent a67ce984e9
commit 787f503616
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 6 additions and 6 deletions

View File

@ -2381,7 +2381,7 @@ parameters:
path: ../src/Composer/Repository/ComposerRepository.php path: ../src/Composer/Repository/ComposerRepository.php
- -
message: "#^Method Composer\\\\Repository\\\\ComposerRepository\\:\\:getProviders\\(\\) should return array\\<string, array\\{name\\: string, description\\: string, type\\: string\\}\\> but returns array\\<int\\|string, array\\{name\\: mixed, description\\: mixed, type\\: mixed\\}\\>\\.$#" message: "#^Method Composer\\\\Repository\\\\ComposerRepository\\:\\:getProviders\\(\\) should return array\\<string, array\\{name\\: string, description\\: string|null, type\\: string\\}\\> but returns array\\<int\\|string, array\\{name\\: mixed, description\\: mixed, type\\: mixed\\}\\>\\.$#"
count: 1 count: 1
path: ../src/Composer/Repository/ComposerRepository.php path: ../src/Composer/Repository/ComposerRepository.php
@ -2496,7 +2496,7 @@ parameters:
path: ../src/Composer/Repository/CompositeRepository.php path: ../src/Composer/Repository/CompositeRepository.php
- -
message: "#^Only booleans are allowed in a ternary operator condition, array\\<int, array\\<string, array\\<string, string\\>\\>\\> given\\.$#" message: "#^Only booleans are allowed in a ternary operator condition, array\\<int, array\\<string, array\\<string, string|null\\>\\>\\> given\\.$#"
count: 1 count: 1
path: ../src/Composer/Repository/CompositeRepository.php path: ../src/Composer/Repository/CompositeRepository.php
@ -2714,7 +2714,7 @@ parameters:
path: ../src/Composer/Repository/RepositorySet.php path: ../src/Composer/Repository/RepositorySet.php
- -
message: "#^Only booleans are allowed in an if condition, array\\<string, array\\<string, string\\>\\> given\\.$#" message: "#^Only booleans are allowed in an if condition, array\\<string, array\\<string, string|null\\>\\> given\\.$#"
count: 1 count: 1
path: ../src/Composer/Repository/RepositorySet.php path: ../src/Composer/Repository/RepositorySet.php

View File

@ -649,7 +649,7 @@ class Problem
$providers = $repositorySet->getProviders($packageName); $providers = $repositorySet->getProviders($packageName);
if (\count($providers) > 0) { if (\count($providers) > 0) {
$providersStr = implode(array_map(static function ($p): string { $providersStr = implode(array_map(static function ($p): string {
$description = $p['description'] !== '' ? ' '.substr($p['description'], 0, 100) : ''; $description = $p['description'] !== '' ? ' '.substr($p['description'] ?? '', 0, 100) : '';
return ' - '.$p['name'].$description."\n"; return ' - '.$p['name'].$description."\n";
}, count($providers) > $maxProviders + 1 ? array_slice($providers, 0, $maxProviders) : $providers)); }, count($providers) > $maxProviders + 1 ? array_slice($providers, 0, $maxProviders) : $providers));

View File

@ -104,7 +104,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' => '...')
* @phpstan-return array<string, array{name: string, description: string, type: string}> * @phpstan-return array<string, array{name: string, description: string|null, type: string}>
*/ */
public function getProviders(string $packageName); public function getProviders(string $packageName);

View File

@ -284,7 +284,7 @@ class RepositorySet
/** /**
* @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' => '...')
* @phpstan-return array<string, array{name: string, description: string, type: string}> * @phpstan-return array<string, array{name: string, description: string|null, type: string}>
*/ */
public function getProviders(string $packageName): array public function getProviders(string $packageName): array
{ {