Skip to content

Commit

Permalink
Fix docblocks to satisfy phpstan requirements
Browse files Browse the repository at this point in the history
  • Loading branch information
Lustmored committed Dec 21, 2023
1 parent 733a882 commit 0870a2b
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 20 deletions.
6 changes: 3 additions & 3 deletions src/Command/UpdateDatabaseCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ class UpdateDatabaseCommand extends Command
private $downloader;

/**
* @var array[]
* @var array<string, ?array{url?: string|false, path?: string|false, locales?: string[], license?: ?string, edition?: string}>
*/
private $databases;

/**
* @param Downloader $downloader
* @param array[] $databases
* @param Downloader $downloader
* @param array<string, ?array{url?: string|false, path?: string|false, locales?: string[], license?: ?string, edition?: string}> $databases
*/
public function __construct(Downloader $downloader, array $databases)
{
Expand Down
8 changes: 2 additions & 6 deletions src/DependencyInjection/GpsLabGeoIP2Extension.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@ class GpsLabGeoIP2Extension extends Extension
*/
private const SERVICE_NAME = 'geoip2.database.%s_reader';

/**
* @param array[] $configs
* @param ContainerBuilder $container
*/
public function load(array $configs, ContainerBuilder $container): void
{
$configuration = $this->getConfiguration($configs, $container);
Expand Down Expand Up @@ -102,8 +98,8 @@ public function load(array $configs, ContainerBuilder $container): void
}

/**
* @param array[] $config
* @param ContainerBuilder $container
* @param array<array<mixed>> $config
* @param ContainerBuilder $container
*
* @return Configuration
*/
Expand Down
8 changes: 4 additions & 4 deletions src/Reader/ReaderFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,18 @@
class ReaderFactory
{
/**
* @var array[]
* @var array<string, ?array{url?: string|false, path?: string|false, locales?: string[], license?: ?string, edition?: string}>
*/
private $databases;

/**
* @var string
* @var class-string<Reader>
*/
private $reader_class;

/**
* @param array[] $databases
* @param string $reader_class
* @param array<string, ?array{url?: string|false, path?: string|false, locales?: string[], license?: ?string, edition?: string}> $databases
* @param class-string<Reader> $reader_class
*/
public function __construct(array $databases, string $reader_class = Reader::class)
{
Expand Down
12 changes: 6 additions & 6 deletions tests/DependencyInjection/ConfigurationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,8 @@ public function getBadConfigs(): iterable
/**
* @dataProvider getBadConfigs
*
* @param string|null $cache_dir
* @param array[] $configs
* @param string|null $cache_dir
* @param array<array<mixed>> $configs
*/
public function testBadConfigs(?string $cache_dir, array $configs): void
{
Expand All @@ -177,7 +177,7 @@ public function testBadConfigs(?string $cache_dir, array $configs): void
}

/**
* @return mixed[]
* @return array<array<mixed>>
*/
public function getConfigs(): iterable
{
Expand Down Expand Up @@ -430,9 +430,9 @@ public function getConfigs(): iterable
/**
* @dataProvider getConfigs
*
* @param string|null $cache_dir
* @param array[] $configs
* @param array[] $expected
* @param string|null $cache_dir
* @param array<array<mixed>> $configs
* @param array<array<mixed>> $expected
*/
public function testConfigs(?string $cache_dir, array $configs, array $expected): void
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Reader/ReaderFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
class ReaderFactoryTest extends TestCase
{
/**
* @return array[]
* @return list<list<?list<string>>>
*/
public function getLocales(): array
{
Expand Down

0 comments on commit 0870a2b

Please sign in to comment.