From f9f580ac5cecd59aa1fcb99f67c8905d1056a677 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Radim=20Vaculi=CC=81k?= Date: Mon, 13 Jan 2025 09:26:50 +0100 Subject: [PATCH] Support nextras/(orm|dbal):5 --- composer.json | 4 ++-- phpstan.neon | 4 ---- tests/Cases/DataSources/NextrasDataSourceTest.phpt | 6 +++--- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/composer.json b/composer.json index dbb4a3de..9292b211 100644 --- a/composer.json +++ b/composer.json @@ -52,8 +52,8 @@ "mockery/mockery": "^1.3.3", "nette/database": "^3.0.2", "nette/tester": "^2.3.4", - "nextras/dbal": "^4.0", - "nextras/orm": "^4.0", + "nextras/dbal": "^4.0 || ^5.0", + "nextras/orm": "^4.0 || ^5.0", "phpstan/phpstan-deprecation-rules": "^1.1", "phpstan/phpstan-mockery": "^1.1", "phpstan/phpstan-nette": "^1.0.0", diff --git a/phpstan.neon b/phpstan.neon index 5d4f13e0..9b905ada 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -37,10 +37,6 @@ parameters: message: "#^Cannot call method filterRow\\(\\) on Contributte\\\\Datagrid\\\\DataModel\\|null\\.$#" count: 1 path: src/Datagrid.php - - - message: "#^Parameter \\#1 \\$x of method Doctrine\\\\ORM\\\\Query\\\\Expr\\:\\:like\\(\\) expects string, Doctrine\\\\ORM\\\\Query\\\\Expr\\\\Func given\\.$#" - count: 1 - path: src/DataSource/DoctrineDataSource.php - # In PHP 8+, the Stringable typehint should be used, and this can be removed. message: '#string\\|Stringable#' count: 1 diff --git a/tests/Cases/DataSources/NextrasDataSourceTest.phpt b/tests/Cases/DataSources/NextrasDataSourceTest.phpt index 574f90c2..f061b6c0 100644 --- a/tests/Cases/DataSources/NextrasDataSourceTest.phpt +++ b/tests/Cases/DataSources/NextrasDataSourceTest.phpt @@ -11,8 +11,8 @@ use Nette\Utils\Arrays; use Nextras\Dbal\Connection; use Nextras\Orm\Collection\Expression\LikeExpression; use Nextras\Orm\Entity\Entity; +use Nextras\Orm\Mapper\Dbal\DbalMapper; use Nextras\Orm\Mapper\Dbal\DbalMapperCoordinator; -use Nextras\Orm\Mapper\Mapper; use Nextras\Orm\Model\Model; use Nextras\Orm\Model\SimpleModelFactory; use Nextras\Orm\Repository\Repository; @@ -129,7 +129,7 @@ class User extends Entity } -class UsersMapper extends Mapper +class UsersMapper extends DbalMapper { } @@ -155,7 +155,7 @@ class Book extends Entity } -class BooksMapper extends Mapper +class BooksMapper extends DbalMapper { }