diff --git a/.github/workflows/static.yaml b/.github/workflows/static.yaml
new file mode 100644
index 0000000..3a824bd
--- /dev/null
+++ b/.github/workflows/static.yaml
@@ -0,0 +1,33 @@
+name: Static analysis
+on:
+ push:
+ branches:
+ - '[0-9]+.x'
+ - '[0-9]+.[0-9]+'
+ - '[0-9]+.[0-9]+.x'
+ pull_request:
+
+jobs:
+ phpstan:
+ name: PHPStan
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v4
+
+ - name: PHPStan
+ uses: docker://oskarstark/phpstan-ga
+ env:
+ REQUIRE_DEV: true
+ with:
+ args: analyze --no-progress
+
+ php-cs-fixer:
+ name: PHP-CS-Fixer
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+ - name: PHP-CS-Fixer
+ uses: docker://oskarstark/php-cs-fixer-ga
+ with:
+ args: --dry-run
diff --git a/.github/workflows/test-application.yaml b/.github/workflows/test-application.yaml
index f7361f8..462433a 100644
--- a/.github/workflows/test-application.yaml
+++ b/.github/workflows/test-application.yaml
@@ -4,12 +4,14 @@ on:
pull_request:
push:
branches:
- - 'master'
+ - '[0-9]+.x'
+ - '[0-9]+.[0-9]+'
+ - '[0-9]+.[0-9]+.x'
jobs:
test:
name: 'PHP ${{ matrix.php-version }} ${{ matrix.dependencies }}'
- runs-on: ubuntu-20.04
+ runs-on: ubuntu-latest
env:
SYMFONY_DEPRECATIONS_HELPER: weak
@@ -23,10 +25,12 @@ jobs:
- php-version: '7.4'
- php-version: '8.0'
- php-version: '8.1'
+ - php-version: '8.2'
+ - php-version: '8.3'
steps:
- name: Checkout project
- uses: actions/checkout@v2
+ uses: actions/checkout@v4
- name: Install and configure PHP
uses: shivammathur/setup-php@v2
@@ -35,7 +39,7 @@ jobs:
tools: 'composer:v2'
- name: Install dependencies with Composer
- uses: ramsey/composer-install@v1
+ uses: ramsey/composer-install@v3
with:
dependency-versions: ${{ matrix.dependencies }}
composer-options: --prefer-dist
diff --git a/.gitignore b/.gitignore
index 2f66930..cc40462 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,7 @@
-composer.lock
-vendor
-tests/data
-tests/migrations
-.phpunit.result.cache
+/.php-cs-fixer.cache
+/.phpunit.result.cache
+/composer.lock
+/phpunit.xml
+/tests/data
+/tests/migrations
+/vendor
diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php
new file mode 100644
index 0000000..8b672e1
--- /dev/null
+++ b/.php-cs-fixer.dist.php
@@ -0,0 +1,12 @@
+exclude('vendor')
+ ->in(__DIR__);
+$config = new PhpCsFixer\Config();
+
+return $config->setFinder($finder)
+ ->setRules([
+ '@Symfony' => true,
+ 'array_syntax' => ['syntax' => 'short'],
+ ]);
diff --git a/.php_cs b/.php_cs
deleted file mode 100644
index 816b744..0000000
--- a/.php_cs
+++ /dev/null
@@ -1,29 +0,0 @@
-
-
-For the full copyright and license information, please view the LICENSE
-file that was distributed with this source code.
-EOF;
-
-Symfony\CS\Fixer\Contrib\HeaderCommentFixer::setHeader($header);
-
-return Symfony\CS\Config\Config::create()
- ->fixers(array(
- 'header_comment',
- 'symfony',
- 'concat_with_spaces',
- 'ordered_use',
- '-concat_without_spaces',
- '-phpdoc_indent',
- '-phpdoc_params',
- ))
- ->finder(
- Symfony\CS\Finder\DefaultFinder::create()
- ->exclude('vendor')
- ->in(__DIR__)
- )
-;
diff --git a/README.md b/README.md
index 4f264a4..fa44f76 100644
--- a/README.md
+++ b/README.md
@@ -2,7 +2,7 @@ PHPCR Migrations
================
[](https://travis-ci.org/phpcr/phpcr-migrations)
+Status](https://github.com/phpcr/phpcr-migrations/actions/workflows/test-application.yaml/badge.svg)](https://github.com/phpcr/phpcr-migrations/actions/workflows/test-application.yaml)
Migrations library for PHPCR influenced by [Doctrine
migrations](https://github.com/doctrine/migrations).
diff --git a/composer.json b/composer.json
index 7a3f984..c315882 100644
--- a/composer.json
+++ b/composer.json
@@ -17,7 +17,8 @@
"require-dev": {
"jackalope/jackalope-fs": "0.0.*",
"handcraftedinthealps/zendsearch": "^2.0",
- "phpunit/phpunit": "^8.5 || ^9.4"
+ "phpunit/phpunit": "^8.5 || ^9.4",
+ "phpspec/prophecy": "^1.19"
},
"autoload": {
"psr-4": {
@@ -28,8 +29,5 @@
"psr-4": {
"PHPCR\\Migrations\\Tests\\": "tests"
}
- },
- "extra": {
- "branch-alias": {"dev-master": "1.x-dev" }
}
}
diff --git a/lib/Migrator.php b/lib/Migrator.php
index 3452585..538d108 100644
--- a/lib/Migrator.php
+++ b/lib/Migrator.php
@@ -20,9 +20,9 @@ class Migrator
private $session;
private $versionCollection;
private $versionStorage;
- private $actions = array(
+ private $actions = [
'up', 'down', 'top', 'bottom',
- );
+ ];
public function __construct(
SessionInterface $session,
@@ -57,15 +57,14 @@ public function initialize()
* If $to is 0 then all migrations will be reverted.
* If $to is null then all migrations will be executed.
*
- * @param string|null $to Version to run until
- * @param OutputInterface $output
+ * @param string|int|bool|null $to Version to run until
*
* @return VersionInterface[] Executed migrations
*/
public function migrate($to, OutputInterface $output)
{
if (false === $to) {
- return array();
+ return [];
}
$from = $this->versionStorage->getCurrentVersion();
@@ -76,17 +75,17 @@ public function migrate($to, OutputInterface $output)
$versionsToExecute = $this->versionCollection->getVersions($from, $to, $direction);
if (!$versionsToExecute) {
- return array();
+ return [];
}
$position = 0;
- $output->writeln(sprintf('%s %d version(s):', ($direction == 'up' ? 'Upgrading' : 'Reverting'), count($versionsToExecute)));
+ $output->writeln(sprintf('%s %d version(s):', 'up' == $direction ? 'Upgrading' : 'Reverting', count($versionsToExecute)));
foreach ($versionsToExecute as $timestamp => $version) {
- $position++;
- $output->writeln(sprintf(' %s [%d/%d]: %s', $direction == 'up' ? '+' : '-', $position, count($versionsToExecute), $timestamp));
+ ++$position;
+ $output->writeln(sprintf(' %s [%d/%d]: %s', 'up' == $direction ? '+' : '-', $position, count($versionsToExecute), $timestamp));
$version->$direction($this->session);
- if ($direction === 'down') {
+ if ('down' === $direction) {
$this->versionStorage->remove($timestamp);
} else {
$this->versionStorage->add($timestamp);
@@ -117,34 +116,28 @@ private function resolveTo($to, $from)
$to = strtolower($to);
}
- if ($to === 'down') {
+ if ('down' === $to) {
$to = $this->versionCollection->getPreviousVersion($from);
}
- if ($to === 'up') {
+ if ('up' === $to) {
$to = $this->versionCollection->getNextVersion($from);
}
- if ($to === 'bottom') {
+ if ('bottom' === $to) {
$to = 0;
}
- if ($to === 'top' || null === $to) {
+ if ('top' === $to || null === $to) {
$to = $this->versionCollection->getLatestVersion();
}
if (0 !== $to && false === strtotime($to)) {
- throw new MigratorException(sprintf(
- 'Unknown migration action "%s". Known actions: "%s"',
- $to,
- implode('", "', $this->actions)
- ));
+ throw new MigratorException(sprintf('Unknown migration action "%s". Known actions: "%s"', $to, implode('", "', $this->actions)));
}
if (0 !== $to && !$this->versionCollection->has($to)) {
- throw new MigratorException(sprintf(
- 'Unknown version "%s"', $to
- ));
+ throw new MigratorException(sprintf('Unknown version "%s"', $to));
}
return $to;
diff --git a/lib/MigratorUtil.php b/lib/MigratorUtil.php
index 8e5abae..69e34be 100644
--- a/lib/MigratorUtil.php
+++ b/lib/MigratorUtil.php
@@ -24,7 +24,7 @@ class MigratorUtil
*/
public static function getClassNameFromFile($file)
{
- $fp = fopen($file, 'r');
+ $fp = fopen($file, 'rb');
$class = $namespace = $buffer = '';
$i = 0;
@@ -35,40 +35,41 @@ public static function getClassNameFromFile($file)
}
// Read entire lines to prevent keyword truncation
- for ($line = 0; $line <= 20; $line++) {
+ for ($line = 0; $line <= 20; ++$line) {
$buffer .= fgets($fp);
}
$tokens = @token_get_all($buffer);
+ $tokensCount = count($tokens);
- if (strpos($buffer, '{') === false) {
+ if (false === strpos($buffer, '{')) {
continue;
}
- for (;$i < count($tokens);$i++) {
- if ($tokens[$i][0] === T_NAMESPACE) {
- for ($j = $i + 1;$j < count($tokens); $j++) {
- if (\defined('T_NAME_QUALIFIED') && $tokens[$j][0] === T_NAME_QUALIFIED || $tokens[$j][0] === T_STRING) {
- $namespace .= '\\' . $tokens[$j][1];
- } elseif ($tokens[$j] === '{' || $tokens[$j] === ';') {
+ for (; $i < $tokensCount; ++$i) {
+ if (T_NAMESPACE === $tokens[$i][0]) {
+ for ($j = $i + 1; $j < $tokensCount; ++$j) {
+ if (T_STRING === $tokens[$j][0] || (\defined('T_NAME_QUALIFIED') && T_NAME_QUALIFIED === $tokens[$j][0])) {
+ $namespace .= '\\'.$tokens[$j][1];
+ } elseif ('{' === $tokens[$j] || ';' === $tokens[$j]) {
break;
}
}
}
- if ($tokens[$i][0] === T_CLASS) {
- for ($j = $i + 1;$j < count($tokens);$j++) {
- if ($tokens[$j] === '{') {
+ if (T_CLASS === $tokens[$i][0]) {
+ for ($j = $i + 1; $j < $tokensCount; ++$j) {
+ if ('{' === $tokens[$j]) {
$class = $tokens[$i + 2][1];
}
}
}
}
- };
+ }
if (!$class) {
- return;
+ throw new \RuntimeException('Could not determine class for migration');
}
- return $namespace . '\\' . $class;
+ return $namespace.'\\'.$class;
}
}
diff --git a/lib/VersionCollection.php b/lib/VersionCollection.php
index 82a6dd6..ad55c74 100644
--- a/lib/VersionCollection.php
+++ b/lib/VersionCollection.php
@@ -34,25 +34,25 @@ public function getAllVersions()
public function getVersions($from, $to)
{
$direction = $from > $to ? 'down' : 'up';
- $result = array();
+ $result = [];
$versions = $this->versions;
if ($from == $to) {
- return array();
+ return [];
}
- if ($direction === 'up') {
+ if ('up' === $direction) {
ksort($versions, SORT_STRING);
} else {
krsort($versions, SORT_STRING);
}
- $found = $from === null ? true : false;
+ $found = null === $from ? true : false;
foreach ($versions as $timestamp => $version) {
if ($timestamp == $from) {
$found = true;
- if ($direction == 'down') {
+ if ('down' == $direction) {
$result[$timestamp] = $version;
}
@@ -64,7 +64,7 @@ public function getVersions($from, $to)
}
if ($timestamp == $to) {
- if ($direction == 'up') {
+ if ('up' == $direction) {
$result[$timestamp] = $version;
}
break;
@@ -86,13 +86,13 @@ public function getLatestVersion()
/**
* Return the version after the given version.
*
- * @param string $from
+ * @param string|null $from
*/
public function getNextVersion($from)
{
$found = false;
foreach (array_keys($this->versions) as $timestamp) {
- if ($from === null) {
+ if (null === $from) {
return $timestamp;
}
@@ -105,8 +105,6 @@ public function getNextVersion($from)
return $timestamp;
}
}
-
- return;
}
/**
@@ -126,9 +124,4 @@ public function getPreviousVersion($from)
return 0;
}
-
- private function normalizeTs($ts)
- {
- return $ts ? $ts : null;
- }
}
diff --git a/lib/VersionFinder.php b/lib/VersionFinder.php
index c0dd048..36d7d83 100644
--- a/lib/VersionFinder.php
+++ b/lib/VersionFinder.php
@@ -22,9 +22,7 @@ class VersionFinder
public function __construct(array $paths)
{
if (empty($paths)) {
- throw new \RuntimeException(
- 'No paths were provided to the version finder.'
- );
+ throw new \RuntimeException('No paths were provided to the version finder.');
}
$this->paths = $paths;
}
@@ -35,7 +33,7 @@ public function getCollection()
return $this->collection;
}
- $versions = array();
+ $versions = [];
$finder = new Finder();
$finder->name('/Version[0-9]{12}.php/');
$finder->files();
@@ -52,10 +50,7 @@ public function getCollection()
$version = new $classFqn();
if (!$version instanceof VersionInterface) {
- throw new MigratorException(sprintf(
- 'Version class "%s" must implement VersionInterface',
- $className
- ));
+ throw new MigratorException(sprintf('Version class "%s" must implement VersionInterface', $className));
}
$versionTimestamp = substr($versionFile->getBaseName(), 7, 12);
diff --git a/lib/VersionInterface.php b/lib/VersionInterface.php
index 1cd9fb1..33ad011 100644
--- a/lib/VersionInterface.php
+++ b/lib/VersionInterface.php
@@ -28,15 +28,11 @@ interface VersionInterface
{
/**
* Migrate the repository up.
- *
- * @param SessionInterface $session
*/
public function up(SessionInterface $session);
/**
* Migrate the system down.
- *
- * @param SessionInterface $session
*/
public function down(SessionInterface $session);
}
diff --git a/lib/VersionStorage.php b/lib/VersionStorage.php
index 399fbe5..4cb98af 100644
--- a/lib/VersionStorage.php
+++ b/lib/VersionStorage.php
@@ -11,6 +11,7 @@
namespace PHPCR\Migrations;
+use PHPCR\NodeInterface;
use PHPCR\SessionInterface;
class VersionStorage
@@ -18,6 +19,10 @@ class VersionStorage
private $session;
private $storageNodeName;
private $initialized = false;
+ /**
+ * @var NodeInterface
+ */
+ private $storageNode;
public function __construct(SessionInterface $session, $storageNodeName = 'phpcrmig:versions')
{
@@ -31,8 +36,8 @@ public function init()
return;
}
- $this->workspace = $this->session->getWorkspace();
- $nodeTypeManager = $this->workspace->getNodeTypeManager();
+ $workspace = $this->session->getWorkspace();
+ $nodeTypeManager = $workspace->getNodeTypeManager();
if (!$nodeTypeManager->hasNodeType('phpcrmig:version')) {
$nodeTypeManager->registerNodeTypesCnd(<< nt:base
+* (phpcrmig:version)
EOT
- , true);
+ , true);
}
$rootNode = $this->session->getRootNode();
- if ($rootNode->hasNode($this->storageNodeName)) {
- $storageNode = $rootNode->getNode($this->storageNodeName);
- } else {
- $storageNode = $rootNode->addNode($this->storageNodeName, 'phpcrmig:versions');
- }
-
- $this->storageNode = $storageNode;
+ $this->storageNode = ($rootNode->hasNode($this->storageNodeName))
+ ? $rootNode->getNode($this->storageNodeName)
+ : $rootNode->addNode($this->storageNodeName, 'phpcrmig:versions')
+ ;
}
public function getPersistedVersions()
@@ -61,13 +63,13 @@ public function getPersistedVersions()
$this->init();
$versionNodes = $this->storageNode->getNodes();
- $versions = array();
+ $versions = [];
foreach ($versionNodes as $versionNode) {
- $versions[$versionNode->getName()] = array(
+ $versions[$versionNode->getName()] = [
'name' => $versionNode->getName(),
'executed' => $versionNode->getPropertyValue('jcr:created'),
- );
+ ];
}
return $versions;
@@ -75,7 +77,7 @@ public function getPersistedVersions()
public function hasVersioningNode()
{
- return $this->session->nodeExists('/' . $this->storageNodeName);
+ return $this->session->nodeExists('/'.$this->storageNodeName);
}
public function getCurrentVersion()
@@ -85,7 +87,7 @@ public function getCurrentVersion()
$versions = (array) $this->storageNode->getNodeNames();
if (!$versions) {
- return;
+ return null;
}
asort($versions);
diff --git a/phpstan.neon.dist b/phpstan.neon.dist
new file mode 100644
index 0000000..1be1e0e
--- /dev/null
+++ b/phpstan.neon.dist
@@ -0,0 +1,5 @@
+parameters:
+ level: 5
+ reportUnmatchedIgnoredErrors: false
+ paths:
+ - lib/
diff --git a/tests/BaseTestCase.php b/tests/BaseTestCase.php
index aa8b91d..0f55afc 100644
--- a/tests/BaseTestCase.php
+++ b/tests/BaseTestCase.php
@@ -22,14 +22,14 @@ class BaseTestCase extends TestCase
public function initPhpcr()
{
- $path = __DIR__ . '/data';
+ $path = __DIR__.'/data';
$sfFs = new Filesystem();
$sfFs->remove($path);
$factory = new RepositoryFactoryFilesystem();
- $repository = $factory->getRepository(array(
+ $repository = $factory->getRepository([
'path' => $path,
'search.enabled' => false,
- ));
+ ]);
$credentials = new SimpleCredentials('admin', 'admin');
$this->session = $repository->login($credentials);
}
diff --git a/tests/Functional/MigrationTest.php b/tests/Functional/MigrationTest.php
index 7fdcdcb..4e52fa8 100644
--- a/tests/Functional/MigrationTest.php
+++ b/tests/Functional/MigrationTest.php
@@ -21,9 +21,9 @@
class MigrationTest extends BaseTestCase
{
- const VERSION1 = '201501011200';
- const VERSION2 = '201501011212';
- const VERSION3 = '201501011215';
+ public const VERSION1 = '201501011200';
+ public const VERSION2 = '201501011212';
+ public const VERSION3 = '201501011215';
private $output;
private $filesystem;
@@ -34,8 +34,8 @@ class MigrationTest extends BaseTestCase
public function setUp(): void
{
$this->initPhpcr();
- $this->migrationDir = __DIR__ . '/../migrations';
- $this->migrationDistDir = __DIR__ . '/../migrations.dist';
+ $this->migrationDir = __DIR__.'/../migrations';
+ $this->migrationDistDir = __DIR__.'/../migrations.dist';
$this->filesystem = new Filesystem();
if (file_exists($this->migrationDir)) {
@@ -248,15 +248,15 @@ public function testMigrateBottom()
private function addVersion($version)
{
$this->filesystem->copy(
- $this->migrationDistDir . '/Version' . $version . '.php',
- $this->migrationDir . '/Version' . $version . '.php'
+ $this->migrationDistDir.'/Version'.$version.'.php',
+ $this->migrationDir.'/Version'.$version.'.php'
);
}
private function getMigrator()
{
$this->storage = new VersionStorage($this->session);
- $finder = new VersionFinder(array($this->migrationDir));
+ $finder = new VersionFinder([$this->migrationDir]);
$versions = $finder->getCollection();
return new Migrator($this->session, $versions, $this->storage);
diff --git a/tests/Unit/MigratorFactoryTest.php b/tests/Unit/MigratorFactoryTest.php
index 1c8c38f..16727cb 100644
--- a/tests/Unit/MigratorFactoryTest.php
+++ b/tests/Unit/MigratorFactoryTest.php
@@ -11,12 +11,7 @@
namespace PHPCR\Migrations\Tests\Unit;
-use PHPCR\Migrations\Migrator;
use PHPCR\Migrations\MigratorFactory;
-use PHPCR\Migrations\VersionCollection;
-use PHPCR\Migrations\VersionFinder;
-use PHPCR\Migrations\VersionStorage;
-use PHPCR\SessionInterface;
use PHPUnit\Framework\TestCase;
class MigratorFactoryTest extends TestCase
diff --git a/tests/Unit/MigratorUtilTest.php b/tests/Unit/MigratorUtilTest.php
index d7e5b90..8415831 100644
--- a/tests/Unit/MigratorUtilTest.php
+++ b/tests/Unit/MigratorUtilTest.php
@@ -21,7 +21,7 @@ class MigratorUtilTest extends TestCase
*/
public function testGetClassName()
{
- $className = MigratorUtil::getClassNameFromFile(__DIR__ . '/migrations/Version201511240843.php');
+ $className = MigratorUtil::getClassNameFromFile(__DIR__.'/migrations/Version201511240843.php');
$this->assertEquals('\Sulu\Bundle\ContentBundle\Version201511240843', $className);
}
}
diff --git a/tests/Unit/VersionCollectionTest.php b/tests/Unit/VersionCollectionTest.php
index 8fb0bf7..e3a0214 100644
--- a/tests/Unit/VersionCollectionTest.php
+++ b/tests/Unit/VersionCollectionTest.php
@@ -12,14 +12,13 @@
namespace PHPCR\Migrations\Tests\Unit;
use PHPCR\Migrations\VersionCollection;
-use PHPCR\Migrations\VersionInterface;
use PHPUnit\Framework\TestCase;
class VersionCollectionTest extends TestCase
{
- const VERSION1 = '201501010000';
- const VERSION2 = '201501020000';
- const VERSION3 = '201501030000';
+ public const VERSION1 = '201501010000';
+ public const VERSION2 = '201501020000';
+ public const VERSION3 = '201501030000';
public function setUp(): void
{
@@ -33,10 +32,10 @@ public function setUp(): void
*/
public function testHas()
{
- $collection = $this->createCollection(array(
+ $collection = $this->createCollection([
self::VERSION1 => $this->version1->reveal(),
self::VERSION3 => $this->version3->reveal(),
- ));
+ ]);
$this->assertTrue($collection->has(self::VERSION1));
$this->assertTrue($collection->has(self::VERSION3));
$this->assertFalse($collection->has(self::VERSION2));
@@ -47,17 +46,17 @@ public function testHas()
*/
public function testFromAToBUp()
{
- $collection = $this->createCollection(array(
+ $collection = $this->createCollection([
self::VERSION1 => $this->version1->reveal(),
self::VERSION2 => $this->version2->reveal(),
self::VERSION3 => $this->version3->reveal(),
- ));
+ ]);
$versions = $collection->getVersions(self::VERSION1, self::VERSION3);
- $this->assertEquals(array(
+ $this->assertEquals([
self::VERSION2, self::VERSION3,
- ), array_map('strval', array_keys($versions)));
+ ], array_map('strval', array_keys($versions)));
}
/**
@@ -65,17 +64,17 @@ public function testFromAToBUp()
*/
public function testDownFromAToBUp()
{
- $collection = $this->createCollection(array(
+ $collection = $this->createCollection([
self::VERSION1 => $this->version1->reveal(),
self::VERSION2 => $this->version2->reveal(),
self::VERSION3 => $this->version3->reveal(),
- ));
+ ]);
$versions = $collection->getVersions(self::VERSION3, self::VERSION1);
- $this->assertEquals(array(
+ $this->assertEquals([
self::VERSION3, self::VERSION2,
- ), array_map('strval', array_keys($versions)));
+ ], array_map('strval', array_keys($versions)));
}
private function createCollection($versions)
diff --git a/tests/Unit/VersionFinderTest.php b/tests/Unit/VersionFinderTest.php
index b526d42..87807a8 100644
--- a/tests/Unit/VersionFinderTest.php
+++ b/tests/Unit/VersionFinderTest.php
@@ -11,7 +11,6 @@
namespace PHPCR\Migrations\Tests\Unit;
-use PHPCR\Migrations\VersionCollection;
use PHPCR\Migrations\VersionFinder;
use PHPUnit\Framework\TestCase;
@@ -24,9 +23,9 @@ class VersionFinderTest extends TestCase
public function setUp(): void
{
- $this->finder = new VersionFinder(array(
- __DIR__ . '/../migrations',
- ));
+ $this->finder = new VersionFinder([
+ __DIR__.'/../migrations',
+ ]);
}
/**
@@ -49,6 +48,6 @@ public function testNoMigrationPaths()
{
$this->expectException(\RuntimeException::class);
$this->expectExceptionMessage('No paths were provided');
- $versionFinder = new VersionFinder(array());
+ $versionFinder = new VersionFinder([]);
}
}
diff --git a/tests/Unit/migrations/Version201511240843.php b/tests/Unit/migrations/Version201511240843.php
index ff1db62..2bd429e 100644
--- a/tests/Unit/migrations/Version201511240843.php
+++ b/tests/Unit/migrations/Version201511240843.php
@@ -12,21 +12,10 @@
namespace Sulu\Bundle\ContentBundle;
use PHPCR\Migrations\VersionInterface;
-use PHPCR\NodeInterface;
-use PHPCR\SessionInterface;
-use Bala\Bundle\ContentBundle\Blog\BasePageBlog;
-use Bala\Bundle\BlogManagerBundle\Bridge\BlogInspector;
-use Bala\Bundle\BlogManagerBundle\Bridge\PropertyEncoder;
-use Bala\Component\Content\Metadata\BlockMetadata;
-use Bala\Component\Content\Metadata\Factory\StructureMetadataFactoryInterface;
-use Bala\Component\Content\Metadata\PropertyMetadata;
-use Bala\Component\Content\Metadata\StructureMetadata;
-use Bala\Component\BlogManager\BlogManagerInterface;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
-use Symfony\Component\DependencyInjection\ContainerInterface;
/**
- * Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore
+ * Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore.
*
* Created: 2015-12-10 10:04
*/