Skip to content

Commit

Permalink
Override base type to not include null
Browse files Browse the repository at this point in the history
Because the defaultName is documented in the base class as string|null,
psalm is not happy, because we're calling the parent constructor with a
potential null value. Since we're always setting this to a string, we
can safely avoid this though.
  • Loading branch information
WouterSioen committed Mar 26, 2024
1 parent 0ffe2e2 commit 3087074
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/Commands/CheckLicenses.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

class CheckLicenses extends Command
{
/** @var string */
protected static $defaultName = 'check';

Check failure on line 23 in src/Commands/CheckLicenses.php

View workflow job for this annotation

GitHub Actions / Psalm

NonInvariantDocblockPropertyType

src/Commands/CheckLicenses.php:23:22: NonInvariantDocblockPropertyType: Property LicenseChecker\Commands\CheckLicenses::$defaultName has type string, not invariant with Symfony\Component\Console\Command\Command::$defaultName of type null|string (see https://psalm.dev/267)

public function __construct(
Expand Down
1 change: 1 addition & 0 deletions src/Commands/CountUsedLicenses.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

class CountUsedLicenses extends Command
{
/** @var string */
protected static $defaultName = 'count';

Check failure on line 18 in src/Commands/CountUsedLicenses.php

View workflow job for this annotation

GitHub Actions / Psalm

NonInvariantDocblockPropertyType

src/Commands/CountUsedLicenses.php:18:22: NonInvariantDocblockPropertyType: Property LicenseChecker\Commands\CountUsedLicenses::$defaultName has type string, not invariant with Symfony\Component\Console\Command\Command::$defaultName of type null|string (see https://psalm.dev/267)

public function __construct(
Expand Down
1 change: 1 addition & 0 deletions src/Commands/GenerateConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

class GenerateConfig extends Command
{
/** @var string */
protected static $defaultName = 'generate-config';

Check failure on line 20 in src/Commands/GenerateConfig.php

View workflow job for this annotation

GitHub Actions / Psalm

NonInvariantDocblockPropertyType

src/Commands/GenerateConfig.php:20:22: NonInvariantDocblockPropertyType: Property LicenseChecker\Commands\GenerateConfig::$defaultName has type string, not invariant with Symfony\Component\Console\Command\Command::$defaultName of type null|string (see https://psalm.dev/267)

public function __construct(
Expand Down
1 change: 1 addition & 0 deletions src/Commands/ListAllowedLicenses.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

class ListAllowedLicenses extends Command
{
/** @var string */
protected static $defaultName = 'allowed';

Check failure on line 17 in src/Commands/ListAllowedLicenses.php

View workflow job for this annotation

GitHub Actions / Psalm

NonInvariantDocblockPropertyType

src/Commands/ListAllowedLicenses.php:17:22: NonInvariantDocblockPropertyType: Property LicenseChecker\Commands\ListAllowedLicenses::$defaultName has type string, not invariant with Symfony\Component\Console\Command\Command::$defaultName of type null|string (see https://psalm.dev/267)

public function __construct(
Expand Down
1 change: 1 addition & 0 deletions src/Commands/ListUsedLicenses.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

class ListUsedLicenses extends Command
{
/** @var string */
protected static $defaultName = 'used';

Check failure on line 18 in src/Commands/ListUsedLicenses.php

View workflow job for this annotation

GitHub Actions / Psalm

NonInvariantDocblockPropertyType

src/Commands/ListUsedLicenses.php:18:22: NonInvariantDocblockPropertyType: Property LicenseChecker\Commands\ListUsedLicenses::$defaultName has type string, not invariant with Symfony\Component\Console\Command\Command::$defaultName of type null|string (see https://psalm.dev/267)

public function __construct(
Expand Down

0 comments on commit 3087074

Please sign in to comment.