Skip to content

Commit 7a83409

Browse files
committed
adjust from dantleech
1 parent 70728f3 commit 7a83409

26 files changed

+61
-71
lines changed

.github/workflows/ci.yaml

+5-3
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,17 @@ on:
44
pull_request:
55
push:
66
branches:
7-
- 'master'
7+
- '[0-9]+.x'
8+
- '[0-9]+.[0-9]+'
9+
- '[0-9]+.[0-9]+.x'
810

911
jobs:
1012
php:
1113
name: "PHP ${{ matrix.php-version }}"
1214
runs-on: ubuntu-latest
1315

1416
env:
15-
KERNEL_CLASS: DTL\Bundle\PhpcrMigrations\Tests\Resources\App\AppKernel
17+
KERNEL_CLASS: PHPCR\PhpcrMigrationsBundle\Tests\Resources\App\AppKernel
1618

1719
strategy:
1820
fail-fast: false
@@ -40,7 +42,7 @@ jobs:
4042

4143
steps:
4244
- name: Checkout project
43-
uses: actions/checkout@v2
45+
uses: actions/checkout@v4
4446

4547
- name: Install and configure PHP
4648
uses: shivammathur/setup-php@v2

.gitignore

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
Tests/Resources/app/cache
2-
Tests/Resources/app/logs
1+
tests/Resources/App/var
32
composer.lock
43
vendor
54
.phpunit.result.cache
6-
Tests/Resources/App/var/cache
7-
Tests/Resources/App/var/logs

CHANGELOG.md

+3-7
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
11
CHANGELOG
22
=========
33

4-
1.3.0
4+
1.4.0
55
-----
66

7-
- Support Symfony 6
8-
- Drop Support for PHP <= 7.1 and Symfony <= 4.3
7+
Initial release after renaming from `dantleech/phpcr-migrations-bundle` to `phpcr/phpcr-migrations-bundle`.
98

10-
1.2.0
11-
-----
12-
13-
- Support Symfony 5
9+
Adjusted namespaces to match PHPCR.

README.md

+13-11
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,23 @@ PHPCR Migrations Bundle
22
=======================
33

44
This library provides a Symfony integration for the [PHPCR migrations
5-
library](https://github.com/dantleech/phpcr-migrations).
5+
library](https://github.com/phpcr/phpcr-migrations).
6+
7+
It has initially been created by Daniel Leech as `dantleech/phpcr-migrations-bundle` and was then
8+
donated to the PHPCR organization.
69

710
Configuration
811
-------------
912

1013
Configure the path to your migrations:
1114

1215
````yaml
13-
# app/config.yml
16+
# config/packages/phpcr-migrations.yaml
1417
phpcr_migrations:
15-
paths: [%kernel.root_dir%/phpcr-migrations]
18+
paths: [%kernel.project_dir%/phpcr-migrations]
1619
````
1720

18-
Or the bundle will automatically pick up any migrations in the
21+
And the bundle will automatically pick up any migrations in the
1922
`Resources/phpcr-migrations` folder in any bundles registered in the kernel.
2023

2124
Creating migrations
@@ -25,19 +28,19 @@ First create two new migration files:
2528

2629
````php
2730
<?php
28-
// app/phpcr-migrations/Version201501011200.php
31+
// phpcr-migrations/Version201501011200.php
2932

3033
use PHPCR\SessionInterface;
3134
use PHPCR\Migrations\VersionInterface;
3235

3336
class Version201501011200 implements VersionInterface
3437
{
35-
public function up(SessionInterface $session)
38+
public function up(SessionInterface $session): void
3639
{
3740
$session->getRootNode()->addNode('hello');
3841
}
3942

40-
public function down(SessionInterface $session)
43+
public function down(SessionInterface $session): void
4144
{
4245
$session->getRootNode()->getNode('hello')->remove();
4346
}
@@ -55,12 +58,12 @@ use PHPCR\Migrations\VersionInterface;
5558

5659
class Version201501011212 implements VersionInterface
5760
{
58-
public function up(SessionInterface $session)
61+
public function up(SessionInterface $session): void
5962
{
6063
$session->getNode('/hello')->addNode('world');
6164
}
6265

63-
public function down(SessionInterface $session)
66+
public function down(SessionInterface $session): void
6467
{
6568
$session->getNode('/hello')->getNode('world')->remove();
6669
}
@@ -99,7 +102,7 @@ Upgrading 2 version(s):
99102
+ [2/2]: 201501011212
100103
````
101104

102-
This should run the two migrations, your status should not look like this:
105+
This should run the two migrations.
103106

104107
Reverting
105108
---------
@@ -129,4 +132,3 @@ Actions are:
129132
- `down`: Revert one version
130133
- `top`: Migrate to the latest version
131134
- `bottom`: Revert all migrations
132-

Resources/docs/index.rst

Whitespace-only changes.

composer.json

+9-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
{
2-
"name": "dantleech/phpcr-migrations-bundle",
2+
"name": "phpcr/phpcr-migrations-bundle",
33
"description": "PHPCR migrations bundle",
44
"license": "MIT",
55
"authors": [
66
{
77
"name": "Daniel Leech",
88
"email": "[email protected]"
9+
},
10+
{
11+
"name": "David Buchmann",
12+
"email": "[email protected]"
913
}
1014
],
1115
"require": {
@@ -31,12 +35,12 @@
3135
},
3236
"autoload": {
3337
"psr-4": {
34-
"DTL\\Bundle\\PhpcrMigrations\\": "."
38+
"PHPCR\\PhpcrMigrationsBundle\\": "src/"
3539
}
3640
},
37-
"extra": {
38-
"branch-alias": {
39-
"dev-master": "1.x-dev"
41+
"autoload-dev": {
42+
"psr-4": {
43+
"PHPCR\\PhpcrMigrationsBundle\\Tests\\": "tests/"
4044
}
4145
}
4246
}

phpunit.xml.dist

+2-13
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,12 @@
66

77
<testsuites>
88
<testsuite name="PHPCR migrations Bundle">
9-
<directory>./Tests</directory>
9+
<directory>./tests</directory>
1010
</testsuite>
1111
</testsuites>
1212

13-
<filter>
14-
<whitelist addUncoveredFilesFromWhitelist="true">
15-
<directory>.</directory>
16-
<exclude>
17-
<directory>Resources/</directory>
18-
<directory>Tests/</directory>
19-
<directory>vendor/</directory>
20-
</exclude>
21-
</whitelist>
22-
</filter>
23-
2413
<php>
25-
<env name="KERNEL_CLASS" value="DTL\Bundle\PhpcrMigrations\Tests\Resources\App\AppKernel" />
14+
<env name="KERNEL_CLASS" value="PHPCR\PhpcrMigrationsBundle\Tests\Resources\App\AppKernel" />
2615
<env name="SYMFONY_PHPUNIT_REMOVE_RETURN_TYPEHINT" value="1"/>
2716
<env name="SYMFONY_DEPRECATIONS_HELPER" value="weak"/>
2817
</php>

Command/InitializeCommand.php renamed to src/Command/InitializeCommand.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* file that was distributed with this source code.
1010
*/
1111

12-
namespace DTL\Bundle\PhpcrMigrations\Command;
12+
namespace PHPCR\PhpcrMigrationsBundle\Command;
1313

1414
use PHPCR\Migrations\MigratorFactory;
1515
use Symfony\Component\Console\Command\Command;

Command/MigrateCommand.php renamed to src/Command/MigrateCommand.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* file that was distributed with this source code.
1010
*/
1111

12-
namespace DTL\Bundle\PhpcrMigrations\Command;
12+
namespace PHPCR\PhpcrMigrationsBundle\Command;
1313

1414
use PHPCR\Migrations\MigratorFactory;
1515
use Symfony\Component\Console\Command\Command;

Command/StatusCommand.php renamed to src/Command/StatusCommand.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* file that was distributed with this source code.
1010
*/
1111

12-
namespace DTL\Bundle\PhpcrMigrations\Command;
12+
namespace PHPCR\PhpcrMigrationsBundle\Command;
1313

1414
use PHPCR\Migrations\VersionFinder;
1515
use PHPCR\Migrations\VersionStorage;

DependencyInjection/Configuration.php renamed to src/DependencyInjection/Configuration.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* file that was distributed with this source code.
1010
*/
1111

12-
namespace DTL\Bundle\PhpcrMigrations\DependencyInjection;
12+
namespace PHPCR\PhpcrMigrationsBundle\DependencyInjection;
1313

1414
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
1515
use Symfony\Component\Config\Definition\ConfigurationInterface;

DependencyInjection/PhpcrMigrationsExtension.php renamed to src/DependencyInjection/PhpcrMigrationsExtension.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* file that was distributed with this source code.
1010
*/
1111

12-
namespace DTL\Bundle\PhpcrMigrations\DependencyInjection;
12+
namespace PHPCR\PhpcrMigrationsBundle\DependencyInjection;
1313

1414
use Symfony\Component\Config\FileLocator;
1515
use Symfony\Component\DependencyInjection\ContainerBuilder;

PhpcrMigrationsBundle.php renamed to src/PhpcrMigrationsBundle.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* file that was distributed with this source code.
1010
*/
1111

12-
namespace DTL\Bundle\PhpcrMigrations;
12+
namespace PHPCR\PhpcrMigrationsBundle;
1313

1414
use Symfony\Component\HttpKernel\Bundle\Bundle;
1515

Resources/config/services.xml renamed to src/Resources/config/services.xml

+3-3
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,19 @@
1919
<argument type="service" id="doctrine_phpcr.session" />
2020
</service>
2121

22-
<service id="phpcr_migrations.command.status" class="DTL\Bundle\PhpcrMigrations\Command\StatusCommand" public="true">
22+
<service id="phpcr_migrations.command.status" class="PHPCR\PhpcrMigrationsBundle\Command\StatusCommand" public="true">
2323
<argument type="service" id="phpcr_migrations.version_storage" />
2424
<argument type="service" id="phpcr_migrations.version_finder" />
2525
<tag name="console.command" />
2626
</service>
2727

28-
<service id="phpcr_migrations.command.migrate" class="DTL\Bundle\PhpcrMigrations\Command\MigrateCommand" public="true">
28+
<service id="phpcr_migrations.command.migrate" class="PHPCR\PhpcrMigrationsBundle\Command\MigrateCommand" public="true">
2929
<argument type="service" id="phpcr_migrations.migrator_factory" />
3030
<argument type="service" id="service_container" />
3131
<tag name="console.command" />
3232
</service>
3333

34-
<service id="phpcr_migrations.command.initialize" class="DTL\Bundle\PhpcrMigrations\Command\InitializeCommand" public="true">
34+
<service id="phpcr_migrations.command.initialize" class="PHPCR\PhpcrMigrationsBundle\Command\InitializeCommand" public="true">
3535
<argument type="service" id="phpcr_migrations.migrator_factory" />
3636
<tag name="console.command" />
3737
</service>

Tests/Functional/BaseTestCase.php renamed to tests/Functional/BaseTestCase.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@
99
* file that was distributed with this source code.
1010
*/
1111

12-
namespace DTL\Bundle\PhpcrMigrations\Tests\Functional;
12+
namespace PHPCR\PhpcrMigrationsBundle\Tests\Functional;
1313

1414
use Symfony\Cmf\Component\Testing\Functional\BaseTestCase as CmfBaseTestCase;
1515
use Symfony\Component\Console\Tester\CommandTester;
1616

1717
abstract class BaseTestCase extends CmfBaseTestCase
1818
{
19-
public function setUp()
19+
public function setUp(): void
2020
{
2121
$this->db('PHPCR')->purgeRepository();
2222
$this->session = $this->getContainer()->get('doctrine_phpcr.default_session');
@@ -27,7 +27,7 @@ public function setUp()
2727
}
2828
}
2929

30-
protected function executeCommand($serviceId, $arguments)
30+
protected function executeCommand($serviceId, $arguments): CommandTester
3131
{
3232
$command = $this->getContainer()->get($serviceId);
3333
$tester = new CommandTester($command);

Tests/Functional/MigrateCommandTest.php renamed to tests/Functional/MigrateCommandTest.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@
99
* file that was distributed with this source code.
1010
*/
1111

12-
namespace DTL\Bundle\PhpcrMigrations\Tests\Functional;
12+
namespace PHPCR\PhpcrMigrationsBundle\Tests\Functional;
1313

1414
class MigrateCommandTest extends BaseTestCase
1515
{
1616
/**
1717
* It should migrate all the unexecuted migrators.
1818
*/
19-
public function testMigrateToLatest()
19+
public function testMigrateToLatest(): void
2020
{
2121
$this->executeCommand('phpcr_migrations.command.migrate', array());
2222

@@ -27,7 +27,7 @@ public function testMigrateToLatest()
2727
/**
2828
* It should upgrade to a given version.
2929
*/
30-
public function testUpgradeTo()
30+
public function testUpgradeTo(): void
3131
{
3232
$tester = $this->executeCommand('phpcr_migrations.command.migrate', array('to' => '201401011300'));
3333
$display = $tester->getDisplay();
@@ -41,9 +41,9 @@ public function testUpgradeTo()
4141
/**
4242
* It should downgrade to a given version.
4343
*/
44-
public function testUpgradeRevertTo()
44+
public function testUpgradeRevertTo(): void
4545
{
46-
$tester = $this->executeCommand('phpcr_migrations.command.migrate', array());
46+
$this->executeCommand('phpcr_migrations.command.migrate', array());
4747
$tester = $this->executeCommand('phpcr_migrations.command.migrate', array('to' => '201501011200'));
4848
$display = $tester->getDisplay();
4949

Tests/Functional/StatusCommandTest.php renamed to tests/Functional/StatusCommandTest.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@
99
* file that was distributed with this source code.
1010
*/
1111

12-
namespace DTL\Bundle\PhpcrMigrations\Tests\Functional;
12+
namespace PHPCR\PhpcrMigrationsBundle\Tests\Functional;
1313

1414
class StatusCommandTest extends BaseTestCase
1515
{
1616
/**
1717
* It should list all of the migrations.
1818
*/
19-
public function testShowAll()
19+
public function testShowAll(): void
2020
{
2121
$tester = $this->executeCommand('phpcr_migrations.command.status', array());
2222
$display = $tester->getDisplay();
@@ -27,9 +27,9 @@ public function testShowAll()
2727
/**
2828
* It should show the current version.
2929
*/
30-
public function testShowCurrentVersion()
30+
public function testShowCurrentVersion(): void
3131
{
32-
$tester = $this->executeCommand('phpcr_migrations.command.migrate', array('to' => '201501011500'));
32+
$this->executeCommand('phpcr_migrations.command.migrate', array('to' => '201501011500'));
3333
$tester = $this->executeCommand('phpcr_migrations.command.status', array());
3434
$display = $tester->getDisplay();
3535

Tests/Resources/App/AppKernel.php renamed to tests/Resources/App/AppKernel.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99
* file that was distributed with this source code.
1010
*/
1111

12-
namespace DTL\Bundle\PhpcrMigrations\Tests\Resources\App;
12+
namespace PHPCR\PhpcrMigrationsBundle\Tests\Resources\App;
1313

14-
use DTL\Bundle\PhpcrMigrations\PhpcrMigrationsBundle;
15-
use DTL\Bundle\PhpcrMigrations\Tests\Resources\Bundle\OneTestBundle\OneTestBundle;
16-
use DTL\Bundle\PhpcrMigrations\Tests\Resources\Bundle\TwoTestBundle\TwoTestBundle;
14+
use PHPCR\PhpcrMigrationsBundle\PhpcrMigrationsBundle;
15+
use PHPCR\PhpcrMigrationsBundle\Tests\Resources\Bundle\OneTestBundle\OneTestBundle;
16+
use PHPCR\PhpcrMigrationsBundle\Tests\Resources\Bundle\TwoTestBundle\TwoTestBundle;
1717
use Symfony\Cmf\Component\Testing\HttpKernel\TestKernel;
1818
use Symfony\Component\Config\Loader\LoaderInterface;
1919
use Symfony\Component\DependencyInjection\ContainerBuilder;
@@ -44,7 +44,7 @@ public function registerContainerConfiguration(LoaderInterface $loader)
4444
protected function prepareContainer(ContainerBuilder $container)
4545
{
4646
parent::prepareContainer($container);
47-
$container->setParameter('cmf_testing.bundle_fqn', 'DTL\Bundle\PhpcrMigrations\PhpcrMigrationsBundle');
47+
$container->setParameter('cmf_testing.bundle_fqn', 'Phpcr\PhpcrMigrationsBundle\PhpcrMigrationsBundle');
4848
}
4949

5050
protected function getKernelParameters(): array

Tests/Resources/Bundle/OneTestBundle/OneTestBundle.php renamed to tests/Resources/Bundle/OneTestBundle/OneTestBundle.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* file that was distributed with this source code.
1010
*/
1111

12-
namespace DTL\Bundle\PhpcrMigrations\Tests\Resources\Bundle\OneTestBundle;
12+
namespace PHPCR\PhpcrMigrationsBundle\Tests\Resources\Bundle\OneTestBundle;
1313

1414
use Symfony\Component\HttpKernel\Bundle\Bundle;
1515

0 commit comments

Comments
 (0)