Skip to content

Commit cae56bb

Browse files
committed
Merge remote-tracking branch 'origin/1.x' into 1-to-2
2 parents e1dae8b + d59c4a9 commit cae56bb

File tree

9 files changed

+46
-21
lines changed

9 files changed

+46
-21
lines changed

.github/workflows/ci.yaml

+11-6
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,23 @@ on:
1010

1111
jobs:
1212
php:
13-
name: "PHP ${{ matrix.php-version }} Symfony ${{ matrix.symfony-version }}"
13+
name: "PHP ${{ matrix.php-version }} Symfony ${{ matrix.symfony-version }} ${{ matrix.dependencies}}"
1414
runs-on: ubuntu-latest
1515

1616
env:
1717
KERNEL_CLASS: PHPCR\PhpcrMigrationsBundle\Tests\Resources\App\AppKernel
18+
SYMFONY_REQUIRE: ${{ matrix.symfony-version }}
1819

1920
strategy:
2021
fail-fast: false
2122
matrix:
2223
include:
2324
- php-version: '8.1'
2425
symfony-version: '^6.0'
26+
dependencies: 'lowest'
27+
28+
- php-version: '8.1'
29+
symfony-version: '^6.4'
2530

2631
- php-version: '8.2'
2732

@@ -40,11 +45,11 @@ jobs:
4045
ini-values: memory_limit=-1
4146
coverage: none
4247

43-
- name: Composer update
44-
env:
45-
SYMFONY_REQUIRE: ${{ matrix.symfony-version }}
46-
run: |
47-
composer update ${{ matrix.composer-flag }} --prefer-dist --no-interaction --no-progress
48+
- name: Install dependencies with Composer
49+
uses: ramsey/composer-install@v3
50+
with:
51+
dependency-versions: ${{ matrix.dependencies }}
52+
composer-options: --prefer-dist
4853

4954
- name: Prepare phpcr odm doctrine dbal
5055
run: vendor/symfony-cmf/testing/bin/travis/phpcr_odm_doctrine_dbal.sh

.php-cs-fixer.dist.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
$finder = PhpCsFixer\Finder::create()
44
->in('src/')
55
->in('tests/')
6-
->exclude(__DIR__.'/tests/Resources/App/var')
6+
->exclude('tests/Resources/App/var/')
77
;
88
$config = new PhpCsFixer\Config();
99

CHANGELOG.md

+12-4
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,23 @@ CHANGELOG
44
2.0.0
55
-----
66

7-
* Replace ContainerAwareInterface from Symfony with `PHPCR\PhpcrMigrationsBundle\ContainerAwareInterface`.
8-
While 1.5.0 can be installed with Symfony 7, the container aware mechanism stopped working.
9-
* Allow installation with PHPCR-ODM 3.0.
107
* Drop support for Symfony 5.
118

9+
1.x
10+
===
11+
12+
1.6.0
13+
-----
14+
15+
* Deprecate using `Symfony\Component\DependencyInjection\ContainerAwareInterface` in favor of
16+
`PHPCR\PhpcrMigrationsBundle\ContainerAwareInterface` as Symfony 7 dropped its
17+
ContainerAwareInterface.
18+
On Symfony 6, the legacy ContainerAwareInterface continues to be supported.
19+
1220
1.5.0
1321
-----
1422

15-
* Allow installation with Symfony 7
23+
* Allow installation with Symfony 7 (! broken if you use `Symfony\Component\DependencyInjection\ContainerAwareInterface`)
1624
* Drop support for PHP < 8.1 and modernize code
1725

1826
1.4.0

composer.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,18 @@
1616
"php": "^8.1",
1717
"phpcr/phpcr-migrations": "^1.1",
1818
"phpcr/phpcr-implementation": "^2.1",
19-
"doctrine/phpcr-bundle": "^1.3 || ^2.0 || ^3.0",
19+
"doctrine/phpcr-bundle": "^3.0",
2020
"symfony/config": "^6.0 || ^7.0",
2121
"symfony/console": "^6.0 || ^7.0",
2222
"symfony/dependency-injection": "^6.0 || ^7.0",
2323
"symfony/http-kernel": "^6.0 || ^7.0"
2424
},
2525
"require-dev": {
26-
"doctrine/doctrine-bundle": "^1.8 || ^2.0",
27-
"doctrine/phpcr-odm": "^1.4 || ^2.0",
26+
"doctrine/doctrine-bundle": "^1.8 || ^2.5",
27+
"doctrine/phpcr-odm": "^2.0",
2828
"jackalope/jackalope-doctrine-dbal": "^2.0",
2929
"symfony/monolog-bundle": "^3.0",
30-
"symfony/phpunit-bridge": "^7.0",
30+
"symfony/phpunit-bridge": "^7.0.6",
3131
"symfony-cmf/testing": "^5.0",
3232
"symfony/security-bundle": "^6.0 || ^7.0",
3333
"symfony/twig-bundle": "^6.0 || ^7.0",

src/Command/MigrateCommand.php

+4
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
use Symfony\Component\Console\Input\InputArgument;
1818
use Symfony\Component\Console\Input\InputInterface;
1919
use Symfony\Component\Console\Output\OutputInterface;
20+
use Symfony\Component\DependencyInjection\ContainerAwareInterface as SymfonyContainerAwareInterface;
2021
use Symfony\Component\DependencyInjection\ContainerInterface;
2122

2223
class MigrateCommand extends Command
@@ -77,6 +78,9 @@ public function execute(InputInterface $input, OutputInterface $output): int
7778
foreach ($migrator->getVersions() as $version) {
7879
if ($version instanceof ContainerAwareInterface) {
7980
$version->setContainer($this->container);
81+
} elseif ($version instanceof SymfonyContainerAwareInterface) {
82+
$version->setContainer($this->container);
83+
@trigger_error('Relying on '.SymfonyContainerAwareInterface::class.' is deprecated and will break when upgrading to Symfony 7. Use '.ContainerAwareInterface::class.' instead.', \E_USER_DEPRECATED);
8084
}
8185
}
8286

tests/Functional/BaseTestCase.php

+3
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,14 @@
1111

1212
namespace PHPCR\PhpcrMigrationsBundle\Tests\Functional;
1313

14+
use PHPCR\SessionInterface;
1415
use Symfony\Cmf\Component\Testing\Functional\BaseTestCase as CmfBaseTestCase;
1516
use Symfony\Component\Console\Tester\CommandTester;
1617

1718
abstract class BaseTestCase extends CmfBaseTestCase
1819
{
20+
protected SessionInterface $session;
21+
1922
public function setUp(): void
2023
{
2124
$this->db('PHPCR')->purgeRepository();

tests/Resources/App/AppKernel.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public function registerContainerConfiguration(LoaderInterface $loader): void
3838
{
3939
$loader->import(CMF_TEST_CONFIG_DIR.'/default.php');
4040
$loader->import(CMF_TEST_CONFIG_DIR.'/phpcr_odm.php');
41-
$loader->load(__DIR__.'/config/config.yml');
41+
$loader->load(__DIR__.'/config/config.php');
4242
}
4343

4444
protected function prepareContainer(ContainerBuilder $container): void

tests/Resources/App/config/config.php

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php
2+
3+
$frameworkConfig = [
4+
'property_access' => true,
5+
];
6+
7+
$container->loadFromExtension('framework', $frameworkConfig);
8+
$container->loadFromExtension('phpcr_migrations', [
9+
'version_node_name' => 'jcr:migrations',
10+
]);

tests/Resources/App/config/config.yml

-5
This file was deleted.

0 commit comments

Comments
 (0)