Skip to content

Commit

Permalink
rename Configuration\Configuration into Configuration\Migration
Browse files Browse the repository at this point in the history
  • Loading branch information
goetas committed Jan 14, 2020
1 parent f8fa939 commit 6b39991
Show file tree
Hide file tree
Showing 36 changed files with 74 additions and 65 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

declare(strict_types=1);

namespace Doctrine\Migrations\Configuration\Configuration;
namespace Doctrine\Migrations\Configuration\Migration;

use Closure;
use Doctrine\Migrations\Configuration\Configuration;
use Doctrine\Migrations\Configuration\Configuration\Exception\InvalidConfigurationKey;
use Doctrine\Migrations\Configuration\Migration\Exception\InvalidConfigurationKey;
use Doctrine\Migrations\Metadata\Storage\TableMetadataStorageConfiguration;
use Doctrine\Migrations\Tools\BooleanStringFormatter;
use function assert;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Doctrine\Migrations\Configuration\Configuration;
namespace Doctrine\Migrations\Configuration\Migration;

use function dirname;
use function realpath;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

declare(strict_types=1);

namespace Doctrine\Migrations\Configuration\Configuration;
namespace Doctrine\Migrations\Configuration\Migration;

use Doctrine\Migrations\Configuration\Configuration;
use Doctrine\Migrations\Configuration\Configuration\Exception\MissingConfigurationFile;
use Doctrine\Migrations\Configuration\Migration\Exception\MissingConfigurationFile;
use Doctrine\Migrations\Tools\Console\Exception\FileTypeNotSupported;
use function file_exists;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Doctrine\Migrations\Configuration\Configuration;
namespace Doctrine\Migrations\Configuration\Migration;

use Doctrine\Migrations\Configuration\Configuration;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Doctrine\Migrations\Configuration\Configuration\Exception;
namespace Doctrine\Migrations\Configuration\Migration\Exception;

use Doctrine\Migrations\Configuration\Exception\ConfigurationException;
use LogicException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Doctrine\Migrations\Configuration\Configuration\Exception;
namespace Doctrine\Migrations\Configuration\Migration\Exception;

use Doctrine\Migrations\Configuration\Exception\ConfigurationException;
use LogicException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Doctrine\Migrations\Configuration\Configuration\Exception;
namespace Doctrine\Migrations\Configuration\Migration\Exception;

use Doctrine\Migrations\Configuration\Exception\ConfigurationException;
use LogicException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Doctrine\Migrations\Configuration\Configuration\Exception;
namespace Doctrine\Migrations\Configuration\Migration\Exception;

use Doctrine\Migrations\Configuration\Exception\ConfigurationException;
use LogicException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Doctrine\Migrations\Configuration\Configuration\Exception;
namespace Doctrine\Migrations\Configuration\Migration\Exception;

use Doctrine\Migrations\Configuration\Exception\ConfigurationException;
use LogicException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Doctrine\Migrations\Configuration\Configuration\Exception;
namespace Doctrine\Migrations\Configuration\Migration\Exception;

use Doctrine\Migrations\Configuration\Exception\ConfigurationException;
use LogicException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Doctrine\Migrations\Configuration\Configuration\Exception;
namespace Doctrine\Migrations\Configuration\Migration\Exception;

use Doctrine\Migrations\Configuration\Exception\ConfigurationException;
use LogicException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Doctrine\Migrations\Configuration\Configuration;
namespace Doctrine\Migrations\Configuration\Migration;

use Doctrine\Migrations\Configuration\Configuration;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Doctrine\Migrations\Configuration\Configuration;
namespace Doctrine\Migrations\Configuration\Migration;

use Doctrine\Migrations\Configuration\Configuration;
use function count;
Expand Down Expand Up @@ -46,7 +46,7 @@ public function getConfiguration() : Configuration

$extension = pathinfo($this->file, PATHINFO_EXTENSION);
if (! isset($this->loaders[$extension])) {
throw Configuration\Exception\InvalidConfigurationFormat::new($this->file);
throw Migration\Exception\InvalidConfigurationFormat::new($this->file);
}

return $this->loaders[$extension]($this->file)->getConfiguration();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@

declare(strict_types=1);

namespace Doctrine\Migrations\Configuration\Configuration;
namespace Doctrine\Migrations\Configuration\Migration;

use Doctrine\Migrations\Configuration\Configuration;
use Doctrine\Migrations\Configuration\Configuration\Exception\JsonNotValid;
use Doctrine\Migrations\Configuration\Exception\FileNotFound;
use function assert;
use function file_exists;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Doctrine\Migrations\Configuration\Configuration;
namespace Doctrine\Migrations\Configuration\Migration;

use Doctrine\Migrations\Configuration\Configuration;
use Doctrine\Migrations\Configuration\Exception\FileNotFound;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

declare(strict_types=1);

namespace Doctrine\Migrations\Configuration\Configuration;
namespace Doctrine\Migrations\Configuration\Migration;

use Doctrine\Migrations\Configuration\Configuration;
use Doctrine\Migrations\Configuration\Configuration\Exception\XmlNotValid;
use Doctrine\Migrations\Configuration\Exception\FileNotFound;
use Doctrine\Migrations\Configuration\Migration\Exception\XmlNotValid;
use Doctrine\Migrations\Tools\BooleanStringFormatter;
use DOMDocument;
use SimpleXMLElement;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

declare(strict_types=1);

namespace Doctrine\Migrations\Configuration\Configuration;
namespace Doctrine\Migrations\Configuration\Migration;

use Doctrine\Migrations\Configuration\Configuration;
use Doctrine\Migrations\Configuration\Configuration\Exception\YamlNotAvailable;
use Doctrine\Migrations\Configuration\Configuration\Exception\YamlNotValid;
use Doctrine\Migrations\Configuration\Exception\FileNotFound;
use Doctrine\Migrations\Configuration\Migration\Exception\YamlNotAvailable;
use Doctrine\Migrations\Configuration\Migration\Exception\YamlNotValid;
use Symfony\Component\Yaml\Exception\ParseException;
use Symfony\Component\Yaml\Yaml;
use function assert;
Expand Down
7 changes: 4 additions & 3 deletions lib/Doctrine/Migrations/DependencyFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use Doctrine\Migrations\Configuration\Configuration;
use Doctrine\Migrations\Configuration\Connection\ConnectionLoader;
use Doctrine\Migrations\Configuration\EntityManager\EntityManagerLoader;
use Doctrine\Migrations\Configuration\Migration\ConfigurationLoader;
use Doctrine\Migrations\Exception\FrozenDependencies;
use Doctrine\Migrations\Exception\MissingDependency;
use Doctrine\Migrations\Finder\GlobFinder;
Expand Down Expand Up @@ -73,7 +74,7 @@ class DependencyFactory
/** @var bool */
private $frozen = false;

/** @var Configuration\ConfigurationLoader */
/** @var ConfigurationLoader */
private $configurationLoader;

/** @var ConnectionLoader */
Expand All @@ -83,7 +84,7 @@ class DependencyFactory
private $emLoader;

public static function fromConnection(
Configuration\ConfigurationLoader $configurationLoader,
ConfigurationLoader $configurationLoader,
ConnectionLoader $connectionLoader,
?LoggerInterface $logger = null
) : self {
Expand All @@ -95,7 +96,7 @@ public static function fromConnection(
}

public static function fromEntityManager(
Configuration\ConfigurationLoader $configurationLoader,
ConfigurationLoader $configurationLoader,
EntityManagerLoader $emLoader,
?LoggerInterface $logger = null
) : self {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

namespace Doctrine\Migrations\Tools\Console\Command;

use Doctrine\Migrations\Configuration\Configuration\ConfigurationFileWithFallback;
use Doctrine\Migrations\Configuration\Connection\ConfigurationFile;
use Doctrine\Migrations\Configuration\Migration\ConfigurationFileWithFallback;
use Doctrine\Migrations\DependencyFactory;
use Doctrine\Migrations\Tools\Console\ConsoleLogger;
use Doctrine\Migrations\Tools\Console\Exception\DependenciesNotSatisfied;
Expand Down
2 changes: 1 addition & 1 deletion phpstan.neon.dist
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ parameters:
path: %currentWorkingDirectory%/lib/Doctrine/Migrations/Version/SortedMigrationPlanCalculator.php
-
message: '~^Variable property access on mixed\.$~'
path: %currentWorkingDirectory%/lib/Doctrine/Migrations/Configuration/Configuration/XmlFile.php
path: %currentWorkingDirectory%/lib/Doctrine/Migrations/Configuration/Migration/XmlFile.php
-
message: '~^Call to function is_bool\(\) with bool will always evaluate to true\.$~'
path: %currentWorkingDirectory%/lib/Doctrine/Migrations/InlineParameterFormatter.php
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

declare(strict_types=1);

namespace Doctrine\Migrations\Tests\Configuration\Configuration;
namespace Doctrine\Migrations\Tests\Configuration\Migration;

use Doctrine\Migrations\Configuration\Configuration\ConfigurationArray;
use Doctrine\Migrations\Configuration\Configuration\Exception\InvalidConfigurationKey;
use Doctrine\Migrations\Configuration\Migration\ConfigurationArray;
use Doctrine\Migrations\Configuration\Migration\Exception\InvalidConfigurationKey;
use PHPUnit\Framework\TestCase;

class ArrayLoaderTest extends TestCase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

declare(strict_types=1);

namespace Doctrine\Migrations\Tests\Configuration\Configuration;
namespace Doctrine\Migrations\Tests\Configuration\Migration;

use Doctrine\Migrations\Configuration\Configuration\ConfigurationFileWithFallback;
use Doctrine\Migrations\Configuration\Configuration\Exception\MissingConfigurationFile;
use Doctrine\Migrations\Configuration\Migration\ConfigurationFileWithFallback;
use Doctrine\Migrations\Configuration\Migration\Exception\MissingConfigurationFile;
use PHPUnit\Framework\TestCase;
use function chdir;
use function getcwd;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

declare(strict_types=1);

namespace Doctrine\Migrations\Tests\Configuration\Configuration;
namespace Doctrine\Migrations\Tests\Configuration\Migration;

use Doctrine\Migrations\Configuration\Configuration\Exception\InvalidConfigurationFormat;
use Doctrine\Migrations\Configuration\Configuration\FormattedFile;
use Doctrine\Migrations\Configuration\Migration\Exception\InvalidConfigurationFormat;
use Doctrine\Migrations\Configuration\Migration\FormattedFile;
use PHPUnit\Framework\TestCase;

class FormattedFileTest extends TestCase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@

declare(strict_types=1);

namespace Doctrine\Migrations\Tests\Configuration\Configuration;
namespace Doctrine\Migrations\Tests\Configuration\Migration;

use Doctrine\Migrations\Configuration\Configuration;
use Doctrine\Migrations\Configuration\Configuration\JsonFile;
use Doctrine\Migrations\Configuration\Migration\Exception\JsonNotValid;
use Doctrine\Migrations\Configuration\Migration\JsonFile;

class JsonLoaderTest extends LoaderTest
{
Expand All @@ -18,7 +19,7 @@ public function load(string $prefix = '') : Configuration

public function testMalformed() : void
{
$this->expectException(Configuration\Exception\JsonNotValid::class);
$this->expectException(JsonNotValid::class);
$this->load('malformed');
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

declare(strict_types=1);

namespace Doctrine\Migrations\Tests\Configuration\Configuration;
namespace Doctrine\Migrations\Tests\Configuration\Migration;

use Doctrine\Migrations\Configuration\Configuration;
use Doctrine\Migrations\Configuration\Configuration\Exception\InvalidConfigurationKey;
use Doctrine\Migrations\Configuration\Migration\Exception\InvalidConfigurationKey;
use Doctrine\Migrations\Exception\MigrationException;
use Doctrine\Migrations\Metadata\Storage\TableMetadataStorageConfiguration;
use InvalidArgumentException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

declare(strict_types=1);

namespace Doctrine\Migrations\Tests\Configuration\Configuration;
namespace Doctrine\Migrations\Tests\Configuration\Migration;

use Doctrine\Migrations\Configuration\Configuration;
use Doctrine\Migrations\Configuration\Configuration\PhpFile;
use Doctrine\Migrations\Configuration\Migration\PhpFile;

class PhpLoaderTest extends LoaderTest
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@

declare(strict_types=1);

namespace Doctrine\Migrations\Tests\Configuration\Configuration;
namespace Doctrine\Migrations\Tests\Configuration\Migration;

use Doctrine\Migrations\Configuration\Configuration;
use Doctrine\Migrations\Configuration\Configuration\XmlFile;
use Doctrine\Migrations\Configuration\Migration\Exception\XmlNotValid;
use Doctrine\Migrations\Configuration\Migration\XmlFile;

class XmlLoaderTest extends LoaderTest
{
Expand All @@ -18,14 +19,14 @@ public function load(string $prefix = '') : Configuration

public function testConfigurationWithInvalidOption() : void
{
$this->expectException(Configuration\Exception\XmlNotValid::class);
$this->expectException(XmlNotValid::class);

$this->load('invalid');
}

public function testMalformed() : void
{
$this->expectException(Configuration\Exception\XmlNotValid::class);
$this->expectException(XmlNotValid::class);

$this->load('malformed');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@

declare(strict_types=1);

namespace Doctrine\Migrations\Tests\Configuration\Configuration;
namespace Doctrine\Migrations\Tests\Configuration\Migration;

use Doctrine\Migrations\Configuration\Configuration;
use Doctrine\Migrations\Configuration\Configuration\YamlFile;
use Doctrine\Migrations\Configuration\Migration\Exception\YamlNotValid;
use Doctrine\Migrations\Configuration\Migration\YamlFile;

class YamlLoaderTest extends LoaderTest
{
Expand All @@ -18,7 +19,7 @@ public function load(string $prefix = '') : Configuration

public function testMalformed() : void
{
$this->expectException(Configuration\Exception\YamlNotValid::class);
$this->expectException(YamlNotValid::class);

$this->load('malformed');
}
Expand Down
Loading

0 comments on commit 6b39991

Please sign in to comment.