From 1c6fb954938e115b5d29ec2ac68abeef79350f24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vo=C5=99=C3=AD=C5=A1ek?= Date: Fri, 31 Dec 2021 11:47:24 +0100 Subject: [PATCH] fix stan Model2 --- phpstan.neon.dist | 4 ++-- tests/ConditionSqlTest.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 1c78e878e7..e54dce482e 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -43,7 +43,7 @@ parameters: - '~^Access to an undefined property Atk4\\Data\\Persistence::\$connection\.$~' - '~^Call to an undefined method Atk4\\Data\\Persistence::dsql\(\)\.$~' # for src/Field/SqlExpressionField.php - - '~^Call to an undefined method Atk4\\Data\\Model::expr\(\)\.$~' + - '~^Call to an undefined method Atk4\\Data\\Model2?::expr\(\)\.$~' # for src/Model.php - '~^Call to an undefined method Atk4\\Data\\Persistence::update\(\)\.$~' - '~^Call to an undefined method Atk4\\Data\\Persistence::insert\(\)\.$~' @@ -60,7 +60,7 @@ parameters: - '~^Call to an undefined method Atk4\\Data\\Persistence::initQuery\(\)\.$~' - '~^Call to an undefined method Atk4\\Data\\Persistence::lastInsertId\(\)\.$~' # for src/Reference/HasMany.php - - '~^Call to an undefined method Atk4\\Data\\Model::dsql\(\)\.$~' + - '~^Call to an undefined method Atk4\\Data\\Model2?::dsql\(\)\.$~' # for tests/FieldTest.php - '~^Call to an undefined method Atk4\\Data\\Reference\\HasOne::addTitle\(\)\.$~' # for tests/JoinSqlTest.php diff --git a/tests/ConditionSqlTest.php b/tests/ConditionSqlTest.php index 79823a5edb..32058b9679 100644 --- a/tests/ConditionSqlTest.php +++ b/tests/ConditionSqlTest.php @@ -75,7 +75,7 @@ public function testEntityReloadWithDifferentIdException(): void $m = $m->tryLoad(1); $this->assertSame('John', $m->get('name')); \Closure::bind(function () use ($m) { - $m->_entityId = 2; + $m->_entityId = null ?? 2; // @phpstan-ignore-line https://github.com/phpstan/phpstan-src/pull/706 }, null, Model::class)(); $this->expectException(\Atk4\Data\Exception::class); $this->expectExceptionMessageMatches('~entity.+different~');