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

Fix/Update PHPStan after PHPDoc enhancement #473

Merged
merged 54 commits into from
Feb 6, 2025

Conversation

adriendupuis
Copy link
Contributor

@adriendupuis adriendupuis commented Feb 3, 2025

🎫 Issue IBX-XXXXX

Related PRs:

Sub-PR for #463

Description:

  • Update PHPStan file to fix errors after PHPDoc modifications.
  • Update SearchServiceTest for better type hinting corresponding to SearchService PHPDoc.

For QA:

Documentation:

Don't use advanced format in summary, it won't be rendered.
Don't use advanced format in summary, it won't be rendered.

Define array key type, or it will be rendered as array<string|int, …>

phpDocumentor don't seem to understand self.
One docblock per constant.
- Describes a bit more `getProperties`
- Details `getProperties` param type and returned type
- Hides link to internal function
- Uses `@internal` as a short for "@ignore This method is for internal use"
- Fixes internal links
Revert 1799d56  changes on src/lib/Limitation/ as this is out of contracts scope.
Method Ibexa\Contracts\Core\Limitation\Type::valueSchema() has invalid return type Ibexa\Contracts\Core\Limitation\Traversable.

To fix this, it's possible do add a leading backslash, but it throws a new error:

Method Ibexa\Contracts\Core\Limitation\Type::valueSchema() return type has no value type specified in iterable type Traversable. See: https://phpstan.org/blog/solving-phpstan-no-value-type-specified-in-iterable-type
…$properties change

$properties has now value type specified
Copy link

sonarqubecloud bot commented Feb 5, 2025

@adriendupuis
Copy link
Contributor Author

To properly fix local PHPStan analyse for PHP 8.1, I had to rethink my usage, and stop using default PHP (8.4):

brew tap shivammathur/php
brew install shivammathur/php/[email protected]
/opt/homebrew/Cellar/[email protected]/8.1.31/bin/php $(which composer) install
/opt/homebrew/Cellar/[email protected]/8.1.31/bin/php -d memory_limit=-1 vendor/bin/phpstan analyse

@adriendupuis adriendupuis marked this pull request as ready for review February 6, 2025 00:42
@adriendupuis adriendupuis merged commit 91f989f into enh-phpdoc Feb 6, 2025
22 checks passed
@adriendupuis adriendupuis deleted the enh-phpdoc-fix-phpstan branch February 6, 2025 00:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants