Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHPStan fails for the current codebase #63

Closed
hussainweb opened this issue Oct 3, 2022 · 1 comment
Closed

PHPStan fails for the current codebase #63

hussainweb opened this issue Oct 3, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@hussainweb
Copy link
Contributor

Description

PHPStan reports errors when run manually or during a CI run. I saw this first when working on #58 but then I reproduced this on the main branch as well. That is the reason I am creating a new issue and a PR.

Steps to reproduce

  1. Make sure you are on the latest dependencies with composer update
  2. Run composer dev:analyze:phpstan

Expected behavior

We should see a message from PHPStan saying [OK] No errors.

Screenshots or output

See output below or on one of the recent CI runs.

❯ composer dev:analyze:phpstan
> phpstan analyse --ansi
Note: Using configuration file /Users/hw/work/php/conventional-commits/phpstan.neon.dist.
 96/96 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%

 ------ ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  Line   src/ConventionalCommits/Configuration/DefaultConfiguration.php
 ------ ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  88     Offset 'bodyWrapWidth' on array{typeCase?: string|null, types?: array<string>, scopeRequired?: bool, scopeCase?: string|null, scopes?: array<string>, descriptionCase?: string|null, descriptionEndMark?: string|null,
         bodyRequired?: bool, ...} on left side of ?? always exists and is not nullable.
 ------ ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

 ------ -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  Line   tests/ConventionalCommits/Configuration/DefaultConfigurationTest.php
 ------ -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  38     Call to method PHPUnit\Framework\Assert::assertSame() with array{typeCase: null, types: array{}, scopeCase: null, scopeRequired: false, scopes: array{}, descriptionCase: null, descriptionEndMark: null, bodyRequired:
         false, ...} and array{typeCase?: string|null, types?: array<string>, scopeRequired?: bool, scopeCase?: string|null, scopes?: array<string>, descriptionCase?: string|null, descriptionEndMark?: string|null, bodyRequired?:
         bool, ...} will always evaluate to false.
  88     Call to method PHPUnit\Framework\Assert::assertSame() with array{typeCase: 'kebab', types: array{'foo', 'bar', 'baz-qux'}, scopeCase: 'lower', scopeRequired: true, scopes: array{'component', 'unit', 'foo'},
         descriptionCase: 'sentence', descriptionEndMark: '.', bodyRequired: true, ...} and array{typeCase?: string|null, types?: array<string>, scopeRequired?: bool, scopeCase?: string|null, scopes?: array<string>,
         descriptionCase?: string|null, descriptionEndMark?: string|null, bodyRequired?: bool, ...} will always evaluate to false.
 ------ -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Environment details

  • version of this package: main
  • PHP version: 8.1.10
  • OS: macOS

Additional context

None

@hussainweb hussainweb added the bug Something isn't working label Oct 3, 2022
hussainweb added a commit to hussainweb/conventional-commits that referenced this issue Oct 3, 2022
ramsey pushed a commit that referenced this issue Oct 3, 2022
* fix: phpstan issues described in #63

* fix: avoid psalm false-positive
@ramsey
Copy link
Owner

ramsey commented Oct 3, 2022

Fixed in #64

@ramsey ramsey closed this as completed Oct 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants