Skip to content

Commit

Permalink
make Orm PHP 8.1+ only
Browse files Browse the repository at this point in the history
  • Loading branch information
hrach committed Feb 5, 2023
1 parent 8371c08 commit 31043a3
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 26 deletions.
13 changes: 3 additions & 10 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:

strategy:
matrix:
php-version: [ '7.4', '8.0', '8.1' ]
php-version: [ '8.1', '8.2' ]

steps:
- name: Checkout
Expand Down Expand Up @@ -58,18 +58,11 @@ jobs:
strategy:
fail-fast: false
matrix:
php-version: [ '7.2', '7.3', '7.4', '8.0', '8.1' ]
php-version: [ '8.1', '8.2' ]
deps: [ 'lowest', 'newest' ]
exclude:
- php-version: '7.3'
- php-version: '8.2'
deps: lowest
- php-version: '7.4'
deps: lowest
- php-version: '8.0'
deps: lowest
- php-version: '8.1'
deps: lowest

runs-on: ubuntu-latest

services:
Expand Down
22 changes: 11 additions & 11 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,22 @@
"issues": "https://github.com/nextras/orm/issues"
},
"require": {
"php": ">=7.2",
"php": ">=8.1",
"ext-json": "*",
"ext-ctype": "*",
"nette/caching": "~2.5 || ~3.0",
"nette/utils": "~2.5 || ~3.0",
"nette/tokenizer": "~2.3 || ~3.0",
"nette/caching": "~3.2 || ~3.1.3",
"nette/utils": "~3.0",
"nette/tokenizer": "~3.0",
"nextras/dbal": "~5.0@dev"
},
"require-dev": {
"nette/bootstrap": "~2.4 || ~3.0",
"nette/di": "~2.4 >=2.4.10 || ~3.0",
"nette/finder": "~2.4 || ~3.0",
"nette/neon": "~2.4 || ~3.0",
"nette/tester": "~2.3",
"marc-mabe/php-enum": "~3.0",
"mockery/mockery": "~1.2",
"nette/bootstrap": "~3.1",
"nette/di": "~3.0",
"nette/finder": "~2.4",
"nette/neon": "~3.0",
"nette/tester": "~2.4",
"marc-mabe/php-enum": "~4.6",
"mockery/mockery": ">=1.5.1",
"phpstan/extension-installer": "1.1.0",
"phpstan/phpstan": "1.8.0",
"phpstan/phpstan-deprecation-rules": "1.0.0",
Expand Down
2 changes: 1 addition & 1 deletion src/Model/MetadataStorage.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ function (&$dp) use ($entityClassesMap, $metadataParserFactory, $repositoryLoade
$annotationParser = $metadataParserFactory->create($entityClassesMap);

while (($className = array_shift($toProcess)) !== null) {
$metadata[$className] = $annotationParser->parseMetadata($className, $dp[Cache::FILES]);
$metadata[$className] = $annotationParser->parseMetadata($className, $dp[Cache::Files]);
foreach ($metadata[$className]->getProperties() as $property) {
if ($property->wrapper === EmbeddableContainer::class) {
assert($property->args !== null);
Expand Down
8 changes: 4 additions & 4 deletions tests/inc/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@


use Mockery;
use Nette\Configurator;
use Nette\Bootstrap\Configurator;
use Nette\DI\Container;
use Nextras\Dbal\IConnection;
use Nextras\Orm\TestHelper\TestCaseEntityTrait;
Expand Down Expand Up @@ -56,23 +56,23 @@ protected function setUp()
$configurator = new Configurator();

if (!Helper::isRunByRunner()) {
$configurator->enableDebugger(__DIR__ . '/../log');
$configurator->enableTracy(__DIR__ . '/../log');
}

$hashData = json_encode($dbConfig);
$hash = md5($hashData !== false ? $hashData : '');

if ($this->section !== Helper::SECTION_ARRAY) {
assert($dbConfig !== null);
$configurator->addParameters([
$configurator->addStaticParameters([
'container' => ['class' => "Dbal{$hash}SystemContainer"],
'db' => $dbConfig + ['port' => null],
'autowired1' => $this->section !== Helper::SECTION_MSSQL,
'autowired2' => $this->section === Helper::SECTION_MSSQL,
]);
$configurator->addConfig(__DIR__ . '/../config.dbal.neon');
} else {
$configurator->addParameters(['container' => ['class' => 'ArraySystemContainer']]);
$configurator->addStaticParameters(['container' => ['class' => 'ArraySystemContainer']]);
$configurator->addConfig(__DIR__ . '/../config.array.neon');
}

Expand Down

0 comments on commit 31043a3

Please sign in to comment.