Skip to content

Commit

Permalink
Merge pull request #11048 from greg0ire/restore-bc
Browse files Browse the repository at this point in the history
Restore backward compatibility with previous format
  • Loading branch information
greg0ire authored Nov 6, 2023
2 parents f08159e + c075154 commit be62f72
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/Doctrine/ORM/Query/Exec/AbstractSqlExecutor.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ public function __sleep(): array

public function __wakeup(): void
{
if ($this->_sqlStatements !== null && $this->sqlStatements === null) {
$this->sqlStatements = $this->_sqlStatements;
}

$this->_sqlStatements = &$this->sqlStatements;
}
}
11 changes: 11 additions & 0 deletions psalm-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1844,6 +1844,14 @@
</ParamNameMismatch>
</file>
<file src="lib/Doctrine/ORM/Query/Exec/AbstractSqlExecutor.php">
<DeprecatedProperty>
<code><![CDATA[$this->_sqlStatements]]></code>
<code><![CDATA[$this->_sqlStatements]]></code>
</DeprecatedProperty>
<DocblockTypeContradiction>
<code><![CDATA[$this->_sqlStatements !== null && $this->sqlStatements === null]]></code>
<code><![CDATA[$this->sqlStatements === null]]></code>
</DocblockTypeContradiction>
<PossiblyNullPropertyAssignmentValue>
<code>null</code>
</PossiblyNullPropertyAssignmentValue>
Expand All @@ -1852,6 +1860,9 @@
<code>$queryCacheProfile</code>
<code>$sqlStatements</code>
</PropertyNotSetInConstructor>
<RedundantConditionGivenDocblockType>
<code><![CDATA[$this->_sqlStatements !== null]]></code>
</RedundantConditionGivenDocblockType>
<UninitializedProperty>
<code><![CDATA[$this->sqlStatements]]></code>
</UninitializedProperty>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ public function testUnserializeSingleSelectResult(string $serialized): void
$this->assertInstanceOf(ResultSetMapping::class, $unserialized->getResultSetMapping());
$this->assertEquals(['name' => [0]], $unserialized->getParameterMappings());
$this->assertInstanceOf(SingleSelectExecutor::class, $unserialized->getSqlExecutor());
$this->assertIsString($unserialized->getSqlExecutor()->getSqlStatements());
}

/** @return Generator<string, array{string}> */
Expand Down

0 comments on commit be62f72

Please sign in to comment.