mirror of
https://github.com/doctrine/orm.git
synced 2026-04-25 07:28:04 +02:00
Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 5bff0919a7 | |||
| 9ef0f5301b | |||
| 4989ca6f15 | |||
| 32d1e97ce7 | |||
| ca8147b148 | |||
| c8ebea77f0 | |||
| 23f22860f1 | |||
| b24586b1b5 |
@@ -24,4 +24,4 @@ on:
|
||||
|
||||
jobs:
|
||||
coding-standards:
|
||||
uses: "doctrine/.github/.github/workflows/coding-standards.yml@12.1.0"
|
||||
uses: "doctrine/.github/.github/workflows/coding-standards.yml@v12.2.0"
|
||||
|
||||
@@ -17,4 +17,4 @@ on:
|
||||
jobs:
|
||||
composer-lint:
|
||||
name: "Composer Lint"
|
||||
uses: "doctrine/.github/.github/workflows/composer-lint.yml@12.1.0"
|
||||
uses: "doctrine/.github/.github/workflows/composer-lint.yml@v12.2.0"
|
||||
|
||||
@@ -17,4 +17,4 @@ on:
|
||||
jobs:
|
||||
documentation:
|
||||
name: "Documentation"
|
||||
uses: "doctrine/.github/.github/workflows/documentation.yml@12.1.0"
|
||||
uses: "doctrine/.github/.github/workflows/documentation.yml@v12.2.0"
|
||||
|
||||
@@ -7,7 +7,7 @@ on:
|
||||
|
||||
jobs:
|
||||
release:
|
||||
uses: "doctrine/.github/.github/workflows/release-on-milestone-closed.yml@12.1.0"
|
||||
uses: "doctrine/.github/.github/workflows/release-on-milestone-closed.yml@v12.2.0"
|
||||
secrets:
|
||||
GIT_AUTHOR_EMAIL: ${{ secrets.GIT_AUTHOR_EMAIL }}
|
||||
GIT_AUTHOR_NAME: ${{ secrets.GIT_AUTHOR_NAME }}
|
||||
|
||||
+1
-1
@@ -54,7 +54,7 @@
|
||||
"doctrine/coding-standard": "^9.0.2 || ^14.0",
|
||||
"phpbench/phpbench": "^0.16.10 || ^1.0",
|
||||
"phpstan/extension-installer": "~1.1.0 || ^1.4",
|
||||
"phpstan/phpstan": "~1.4.10 || 2.1.22",
|
||||
"phpstan/phpstan": "~1.4.10 || 2.1.23",
|
||||
"phpstan/phpstan-deprecation-rules": "^1 || ^2",
|
||||
"phpunit/phpunit": "^7.5 || ^8.5 || ^9.6",
|
||||
"psr/log": "^1 || ^2 || ^3",
|
||||
|
||||
+7
-25
@@ -1056,6 +1056,12 @@ parameters:
|
||||
count: 1
|
||||
path: src/Internal/HydrationCompleteHandler.php
|
||||
|
||||
-
|
||||
message: '#^Offset int\|null might not exist on array\<int, object\>\.$#'
|
||||
identifier: offsetAccess.notFound
|
||||
count: 1
|
||||
path: src/Internal/StronglyConnectedComponents.php
|
||||
|
||||
-
|
||||
message: '#^Property Doctrine\\ORM\\Internal\\StronglyConnectedComponents\:\:\$representingNodes \(array\<int, object\>\) does not accept array\<int\|string, object\>\.$#'
|
||||
identifier: assign.propertyType
|
||||
@@ -3594,7 +3600,7 @@ parameters:
|
||||
-
|
||||
message: '#^Property Doctrine\\ORM\\Query\\Filter\\SQLFilter\:\:\$parameters \(array\<string, array\{type\: string, value\: mixed, is_list\: bool\}\>\) does not accept non\-empty\-array\<string, array\{value\: mixed, type\: int\|string, is_list\: bool\}\>\.$#'
|
||||
identifier: assign.propertyType
|
||||
count: 1
|
||||
count: 2
|
||||
path: src/Query/Filter/SQLFilter.php
|
||||
|
||||
-
|
||||
@@ -4173,12 +4179,6 @@ parameters:
|
||||
count: 1
|
||||
path: src/Tools/Console/Command/ConvertMappingCommand.php
|
||||
|
||||
-
|
||||
message: '#^Parameter \#2 \$destPath of method Doctrine\\ORM\\Tools\\Console\\Command\\ConvertMappingCommand\:\:getExporter\(\) expects string, string\|false given\.$#'
|
||||
identifier: argument.type
|
||||
count: 1
|
||||
path: src/Tools/Console/Command/ConvertMappingCommand.php
|
||||
|
||||
-
|
||||
message: '#^Access to an undefined property Doctrine\\Persistence\\Mapping\\ClassMetadata\:\:\$name\.$#'
|
||||
identifier: property.notFound
|
||||
@@ -4203,12 +4203,6 @@ parameters:
|
||||
count: 1
|
||||
path: src/Tools/Console/Command/GenerateEntitiesCommand.php
|
||||
|
||||
-
|
||||
message: '#^Parameter \#2 \$outputDirectory of method Doctrine\\ORM\\Tools\\EntityGenerator\:\:generate\(\) expects string, string\|false given\.$#'
|
||||
identifier: argument.type
|
||||
count: 1
|
||||
path: src/Tools/Console/Command/GenerateEntitiesCommand.php
|
||||
|
||||
-
|
||||
message: '#^Access to an undefined property Doctrine\\Persistence\\Mapping\\ClassMetadata\:\:\$name\.$#'
|
||||
identifier: property.notFound
|
||||
@@ -4227,12 +4221,6 @@ parameters:
|
||||
count: 1
|
||||
path: src/Tools/Console/Command/GenerateProxiesCommand.php
|
||||
|
||||
-
|
||||
message: '#^Parameter \#2 \$proxyDir of method Doctrine\\ORM\\Proxy\\ProxyFactory\:\:generateProxyClasses\(\) expects string\|null, string\|false given\.$#'
|
||||
identifier: argument.type
|
||||
count: 1
|
||||
path: src/Tools/Console/Command/GenerateProxiesCommand.php
|
||||
|
||||
-
|
||||
message: '#^Access to an undefined property Doctrine\\Persistence\\Mapping\\ClassMetadata\:\:\$customRepositoryClassName\.$#'
|
||||
identifier: property.notFound
|
||||
@@ -4251,12 +4239,6 @@ parameters:
|
||||
count: 1
|
||||
path: src/Tools/Console/Command/GenerateRepositoriesCommand.php
|
||||
|
||||
-
|
||||
message: '#^Parameter \#2 \$outputDirectory of method Doctrine\\ORM\\Tools\\EntityRepositoryGenerator\:\:writeEntityRepositoryClass\(\) expects string, string\|false given\.$#'
|
||||
identifier: argument.type
|
||||
count: 1
|
||||
path: src/Tools/Console/Command/GenerateRepositoriesCommand.php
|
||||
|
||||
-
|
||||
message: '#^Method Doctrine\\ORM\\Tools\\Console\\Command\\MappingDescribeCommand\:\:formatMappings\(\) has parameter \$propertyMappings with no value type specified in iterable type array\.$#'
|
||||
identifier: missingType.iterableValue
|
||||
|
||||
@@ -1753,6 +1753,11 @@ class BasicEntityPersister implements EntityPersister
|
||||
$value = [$value];
|
||||
}
|
||||
|
||||
if ($value === []) {
|
||||
$selectedColumns[] = '1=0';
|
||||
continue;
|
||||
}
|
||||
|
||||
$nullKeys = array_keys($value, null, true);
|
||||
$nonNullValues = array_diff_key($value, array_flip($nullKeys));
|
||||
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Doctrine\Tests\ORM\Functional\Ticket;
|
||||
|
||||
use Doctrine\ORM\Mapping\Column;
|
||||
use Doctrine\ORM\Mapping\Entity;
|
||||
use Doctrine\ORM\Mapping\GeneratedValue;
|
||||
use Doctrine\ORM\Mapping\Id;
|
||||
use Doctrine\Tests\OrmFunctionalTestCase;
|
||||
|
||||
class GH12254Test extends OrmFunctionalTestCase
|
||||
{
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
$this->setUpEntitySchema([
|
||||
GH12254EntityA::class,
|
||||
]);
|
||||
|
||||
$this->_em->persist(new GH12254EntityA());
|
||||
$this->_em->flush();
|
||||
$this->_em->clear();
|
||||
}
|
||||
|
||||
public function testFindByEmptyArrayShouldReturnEmptyArray(): void
|
||||
{
|
||||
// pretend we are starting afresh
|
||||
$this->_em = $this->getEntityManager();
|
||||
$result = $this->_em->getRepository(GH12254EntityA::class)->findBy(['id' => []]);
|
||||
$this->assertEmpty($result);
|
||||
}
|
||||
|
||||
public function testFindByInNullableField(): void
|
||||
{
|
||||
$this->_em = $this->getEntityManager();
|
||||
$result = $this->_em->getRepository(GH12254EntityA::class)->findBy(['name' => []]);
|
||||
$this->assertEmpty($result);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @Entity()
|
||||
*/
|
||||
class GH12254EntityA
|
||||
{
|
||||
/**
|
||||
* @Column(type="integer")
|
||||
* @Id()
|
||||
* @GeneratedValue(strategy="AUTO")
|
||||
* @var int
|
||||
*/
|
||||
public $id;
|
||||
|
||||
/**
|
||||
* @Column(type="string", nullable=true)
|
||||
* @var string|null
|
||||
*/
|
||||
public $name = null;
|
||||
}
|
||||
@@ -129,7 +129,10 @@ class BasicEntityPersisterTypeValueSqlTest extends OrmTestCase
|
||||
self::assertEquals('test IS NOT NULL', $statement);
|
||||
}
|
||||
|
||||
/** @group DDC-3056 */
|
||||
/**
|
||||
* @group DDC-3056
|
||||
* @group GH12254
|
||||
*/
|
||||
public function testSelectConditionStatementWithMultipleValuesContainingNull(): void
|
||||
{
|
||||
self::assertEquals(
|
||||
@@ -151,6 +154,11 @@ class BasicEntityPersisterTypeValueSqlTest extends OrmTestCase
|
||||
'(t0.id IN (?, ?) OR t0.id IS NULL)',
|
||||
$this->persister->getSelectConditionStatementSQL('id', [123, null, 234])
|
||||
);
|
||||
|
||||
self::assertEquals(
|
||||
'1=0',
|
||||
$this->persister->getSelectConditionStatementSQL('id', [])
|
||||
);
|
||||
}
|
||||
|
||||
public function testCountCondition(): void
|
||||
|
||||
Reference in New Issue
Block a user