Skip to content

use the empty string instead of null as an array offset#12181

Merged
derrabus merged 1 commit intodoctrine:2.20.xfrom
xabbuh:array-offset-2.20
Oct 7, 2025
Merged

use the empty string instead of null as an array offset#12181
derrabus merged 1 commit intodoctrine:2.20.xfrom
xabbuh:array-offset-2.20

Conversation

@xabbuh
Copy link
Copy Markdown
Member

@xabbuh xabbuh commented Sep 29, 2025

No description provided.

@xabbuh
Copy link
Copy Markdown
Member Author

xabbuh commented Sep 29, 2025

this is #12160 rebased on the 2.20.x branch

// Get any aliases that are available for select expressions.
foreach ($AST->selectClause->selectExpressions as $selectExpression) {
$selectAliasToExpressionMap[$selectExpression->fieldIdentificationVariable] = $selectExpression->expression;
if (is_string($selectExpression->fieldIdentificationVariable)) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Let's check for null instead.

Suggested change
if (is_string($selectExpression->fieldIdentificationVariable)) {
if ($selectExpression->fieldIdentificationVariable !== null) {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

done

@derrabus derrabus added the Bug label Oct 7, 2025
@derrabus derrabus added this to the 2.20.7 milestone Oct 7, 2025
@derrabus derrabus merged commit 5f35518 into doctrine:2.20.x Oct 7, 2025
74 checks passed
@xabbuh xabbuh deleted the array-offset-2.20 branch October 7, 2025 12:51
derrabus added a commit to derrabus/orm that referenced this pull request Oct 7, 2025
* 2.20.x:
  use the empty string instead of null as an array offset (doctrine#12181)
  do not call setAccessible() on PHP >= 8.1 (doctrine#12182)
  Bump actions/checkout from 4 to 5
  PHPCS 3.13.2 (doctrine#12134)
  PHPStan 2.1.22
  Bump actions/download-artifact from 4 to 5
  chore: remove run-all.sh
  Fix `IN`/`NOT IN` expression handling and support enums when matching on to-many-collections
derrabus added a commit to derrabus/orm that referenced this pull request Oct 7, 2025
* 2.20.x:
  use the empty string instead of null as an array offset (doctrine#12181)
  do not call setAccessible() on PHP >= 8.1 (doctrine#12182)
derrabus added a commit to derrabus/orm that referenced this pull request Oct 7, 2025
* 3.5.x:
  Add a CI job that fails on deprecations (doctrine#12188)
  use the empty string instead of null as an array offset (doctrine#12181)
  do not call setAccessible() on PHP >= 8.1 (doctrine#12182)
  Fix docs on final entities (doctrine#12176)
  Remove Database and Model First chapters that said little of value.
  Switch to IgnoreDeprecations
  docs: consistent PostgreSQL's name case
  docs: generation strategies differences between DBAL 3 and 4
  Check extra condition to decide if a test was skipped
  Use PHPUnit 11 when possible
  Migrate away from annotations in tests
  Migrate away from assertStringNotMatchesFormat()
  Migrate to willReturn()
  Migrate away from getMockForAbstractClass()
  Fix `IN`/`NOT IN` expression handling and support enums when matching on to-many-collections
derrabus added a commit to derrabus/orm that referenced this pull request Oct 7, 2025
* 3.6.x:
  Add a CI job that fails on deprecations (doctrine#12188)
  use the empty string instead of null as an array offset (doctrine#12181)
  do not call setAccessible() on PHP >= 8.1 (doctrine#12182)
  Fix docs on final entities (doctrine#12176)
  Remove Database and Model First chapters that said little of value.
  Switch to IgnoreDeprecations
  Fix php doc for getPropertyAccessors method (doctrine#12159)
  docs: consistent PostgreSQL's name case
  docs: generation strategies differences between DBAL 3 and 4
  Check extra condition to decide if a test was skipped
  Use PHPUnit 11 when possible
  Migrate away from annotations in tests
  Migrate away from assertStringNotMatchesFormat()
  Migrate to willReturn()
  Migrate away from getMockForAbstractClass()
  Fix `IN`/`NOT IN` expression handling and support enums when matching on to-many-collections
derrabus added a commit to derrabus/orm that referenced this pull request Oct 8, 2025
* 3.6.x:
  Fix missing import
  Remove calls to getMockForAbstractClass() (doctrine#12003)
  Add a CI job that fails on deprecations (doctrine#12188)
  use the empty string instead of null as an array offset (doctrine#12181)
  Upgrade to doctrine/coding-standard 14
  Bump doctrine/.github from 7.3.0 to 8.0.0
  do not call setAccessible() on PHP >= 8.1 (doctrine#12182)
  Fix docs on final entities (doctrine#12176)
  Remove Database and Model First chapters that said little of value.
  Switch to IgnoreDeprecations
  Fix php doc for getPropertyAccessors method (doctrine#12159)
  docs: consistent PostgreSQL's name case
  docs: generation strategies differences between DBAL 3 and 4
  Check extra condition to decide if a test was skipped
  Use PHPUnit 11 when possible
  Migrate away from annotations in tests
  Migrate away from assertStringNotMatchesFormat()
  Migrate to willReturn()
  Migrate away from getMockForAbstractClass()
  Fix `IN`/`NOT IN` expression handling and support enums when matching on to-many-collections
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants