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

Use boolean values in while loops #6858

Merged
merged 1 commit into from
Mar 18, 2025
Merged

Conversation

morozov
Copy link
Member

@morozov morozov commented Mar 18, 2025

Not sure what has changed in dependencies, but as of this build, PHPStan started detecting the following issues in the code:

 ------ ------------------------------------------------------------------
  Line   src/Driver/SQLSrv/Result.php
 ------ ------------------------------------------------------------------
  109    Only booleans are allowed in a while condition, bool|null given.
         🪪  while.condNotBoolean
 ------ ------------------------------------------------------------------

 ------ ------------------------------------------------------------------
  Line   src/Schema/SQLServerSchemaManager.php
 ------ ------------------------------------------------------------------
  159    Only booleans are allowed in a while condition, int|false given.
         🪪  while.condNotBoolean
 ------ ------------------------------------------------------------------

 ------ --------------------------------------------------------------
  Line   tests/Functional/Driver/OCI8/ResultTest.php
 ------ --------------------------------------------------------------
  103    Only booleans are allowed in a while condition, mixed given.
         🪪  while.condNotBoolean
 ------ --------------------------------------------------------------

 ------ -----------------------------------------------------------------------------------
  Line   tests/Functional/PortabilityTest.php
 ------ -----------------------------------------------------------------------------------
  39     Only booleans are allowed in a while condition, array<string, mixed>|false given.
         🪪  while.condNotBoolean
  47     Only booleans are allowed in a while condition, array<string, mixed>|false given.
         🪪  while.condNotBoolean
 ------ -----------------------------------------------------------------------------------

So the 4.3.x build is currently failing. I can reproduce the same issue on 4.2.x locally, so I'm targeting 4.2.x.

@morozov morozov added this to the 4.3.0 milestone Mar 18, 2025
@morozov morozov changed the base branch from 4.3.x to 4.2.x March 18, 2025 15:12
@morozov morozov force-pushed the use-bool-in-while branch from 0730eda to 100930e Compare March 18, 2025 15:12
@morozov morozov modified the milestones: 4.3.0, 4.2.4 Mar 18, 2025
@morozov morozov marked this pull request as ready for review March 18, 2025 15:31
@morozov morozov requested a review from greg0ire March 18, 2025 15:31
@morozov morozov merged commit 4f57a02 into doctrine:4.2.x Mar 18, 2025
124 of 127 checks passed
@morozov morozov deleted the use-bool-in-while branch March 18, 2025 17:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants