Skip to content

Add initial PHPStan config#218

Draft
swissspidy wants to merge 6 commits intomainfrom
fix/phpstan
Draft

Add initial PHPStan config#218
swissspidy wants to merge 6 commits intomainfrom
fix/phpstan

Conversation

@swissspidy
Copy link
Copy Markdown
Member

No description provided.

@github-actions github-actions bot added the scope:testing Related to testing label Apr 2, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 2, 2026

Hello! 👋

Thanks for opening this pull request! Please check out our contributing guidelines. We appreciate you taking the initiative to contribute to this project.

Contributing isn't limited to just code. We encourage you to contribute in the way that best fits your abilities, by writing tutorials, giving a demo at your local meetup, helping other users with their support questions, or revising our documentation.

Here are some useful Composer commands to get you started:

  • composer install: Install dependencies.
  • composer test: Run the full test suite.
  • composer phpcs: Check for code style violations.
  • composer phpcbf: Automatically fix code style violations.
  • composer phpunit: Run unit tests.
  • composer behat: Run behavior-driven tests.

To run a single Behat test, you can use the following command:

# Run all tests in a single file
composer behat features/some-feature.feature

# Run only a specific scenario (where 123 is the line number of the "Scenario:" title)
composer behat features/some-feature.feature:123

You can find a list of all available Behat steps in our handbook.

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 2, 2026

Codecov Report

❌ Patch coverage is 83.33333% with 3 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/Formatter.php 0.00% 3 Missing ⚠️

📢 Thoughts on this report? Let us know!

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces PHPStan for static analysis by adding a configuration file and a scan file. The majority of the changes involve adding comprehensive PHPDoc annotations to properties and methods across the codebase to improve type safety and documentation. Additionally, the Profiler class was refactored to use more specific variable names for loggers, preventing potential issues with undefined variables. Feedback was provided regarding a minor efficiency improvement in the float comparison logic within the Formatter class.

Comment on lines +94 to 97
if ( 0.0 === $a - $b ) {
return 0;
} elseif ( $a - $b < 0 ) {
return -1;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The subtraction $a - $b is performed multiple times. It is more efficient to calculate the difference once and reuse it.

		$diff = $a - $b;
		if ( 0.0 === $diff ) {
			return 0;
		} elseif ( $diff < 0 ) {
			return -1;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope:testing Related to testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant