Skip to content

Commit

Permalink
Merge release 2.16.1 into 2.17.x (#10896)
Browse files Browse the repository at this point in the history
  • Loading branch information
derrabus authored Aug 9, 2023
2 parents 368eb01 + 597a63a commit 9647d0e
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 11 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,14 @@
"doctrine/annotations": "^1.13 || ^2",
"doctrine/coding-standard": "^9.0.2 || ^12.0",
"phpbench/phpbench": "^0.16.10 || ^1.0",
"phpstan/phpstan": "~1.4.10 || 1.10.25",
"phpstan/phpstan": "~1.4.10 || 1.10.28",
"phpunit/phpunit": "^7.5 || ^8.5 || ^9.6",
"psr/log": "^1 || ^2 || ^3",
"squizlabs/php_codesniffer": "3.7.2",
"symfony/cache": "^4.4 || ^5.4 || ^6.0",
"symfony/var-exporter": "^4.4 || ^5.4 || ^6.2",
"symfony/yaml": "^3.4 || ^4.0 || ^5.0 || ^6.0",
"vimeo/psalm": "4.30.0 || 5.13.1"
"vimeo/psalm": "4.30.0 || 5.14.1"
},
"conflict": {
"doctrine/annotations": "<1.13 || >= 3.0"
Expand Down
5 changes: 4 additions & 1 deletion lib/Doctrine/ORM/Mapping/Driver/XmlDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -944,7 +944,10 @@ private function cacheToArray(SimpleXMLElement $cacheMapping): array
private function getCascadeMappings(SimpleXMLElement $cascadeElement): array
{
$cascades = [];
foreach ($cascadeElement->children() as $action) {
$children = $cascadeElement->children();
assert($children !== null);

foreach ($children as $action) {
// According to the JPA specifications, XML uses "cascade-persist"
// instead of "persist". Here, both variations
// are supported because YAML, Annotation and Attribute use "persist"
Expand Down
5 changes: 4 additions & 1 deletion lib/Doctrine/ORM/Mapping/UnderscoreNamingStrategy.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ class UnderscoreNamingStrategy implements NamingStrategy
/** @var int */
private $case;

/** @var string */
/**
* @var string
* @psalm-var non-empty-string
*/
private $pattern;

/**
Expand Down
4 changes: 2 additions & 2 deletions lib/Doctrine/ORM/Tools/EntityGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -1376,7 +1376,7 @@ protected function generateEntityStubMethod(ClassMetadataInfo $metadata, $type,
$this->staticReflection[$metadata->name]['methods'][] = strtolower($methodName);

$var = sprintf('%sMethodTemplate', $type);
$template = static::$$var;
$template = (string) static::$$var;

$methodTypeHint = '';
$types = Type::getTypesMap();
Expand Down Expand Up @@ -1695,7 +1695,7 @@ protected function generateFieldMappingPropertyDocBlock(array $fieldMapping, Cla
}

if (isset($fieldMapping['options']['comment']) && $fieldMapping['options']['comment']) {
$options[] = '"comment"="' . str_replace('"', '""', $fieldMapping['options']['comment']) . '"';
$options[] = '"comment"="' . str_replace('"', '""', (string) $fieldMapping['options']['comment']) . '"';
}

if (isset($fieldMapping['options']['collation']) && $fieldMapping['options']['collation']) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ private function recreateInnerSql(

/**
* @return string[][]
* @psalm-return array{0: list<string>, 1: list<string>}
* @psalm-return array{0: list<non-empty-string>, 1: list<string>}
*/
private function generateSqlAliasReplacements(): array
{
Expand Down
5 changes: 1 addition & 4 deletions psalm-baseline.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<files psalm-version="5.13.1@086b94371304750d1c673315321a55d15fc59015">
<files psalm-version="5.14.1@b9d355e0829c397b9b3b47d0c0ed042a8a70284d">
<file src="lib/Doctrine/ORM/AbstractQuery.php">
<DeprecatedClass>
<code>IterableResult</code>
Expand Down Expand Up @@ -964,9 +964,6 @@
<code><![CDATA[$joinColumnElement['options']->children()]]></code>
<code><![CDATA[$option->children()]]></code>
</PossiblyNullArgument>
<PossiblyNullIterator>
<code><![CDATA[$cascadeElement->children()]]></code>
</PossiblyNullIterator>
<TypeDoesNotContainType>
<code><![CDATA[$xmlRoot->getName() === 'embeddable']]></code>
<code><![CDATA[$xmlRoot->getName() === 'entity']]></code>
Expand Down

0 comments on commit 9647d0e

Please sign in to comment.