Skip to content

Commit

Permalink
Merge pull request #689 from cakephp/trim-config
Browse files Browse the repository at this point in the history
Trim down Config and Manager classes to remove unused behavior
  • Loading branch information
markstory authored Feb 13, 2024
2 parents 79e686b + 6068756 commit aa1399c
Show file tree
Hide file tree
Showing 9 changed files with 258 additions and 964 deletions.
3 changes: 1 addition & 2 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
colors="true"
cacheDirectory=".phpunit.cache"
bootstrap="tests/bootstrap.php"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.1/phpunit.xsd"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
>
<testsuites>
<testsuite name="migrations">
Expand Down Expand Up @@ -34,7 +34,6 @@
<php>
<env name="FIXTURE_SCHEMA_METADATA" value="./tests/schema.php"/>
<ini name="memory_limit" value="-1"/>
<ini name="apc.enable_cli" value="1"/>

<!-- SQLite
<env name="DB" value="sqlite"/>
Expand Down
22 changes: 0 additions & 22 deletions psalm-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,22 +50,6 @@
<code>ConfigurationTrait</code>
</DeprecatedTrait>
</file>
<file src="src/Config/Config.php">
<DeprecatedMethod>
<code>getEnvironments</code>
<code>getEnvironments</code>
<code>hasEnvironment</code>
<code>hasEnvironment</code>
<code>searchNamespace</code>
<code>searchNamespace</code>
</DeprecatedMethod>
<LessSpecificImplementedReturnType>
<code>array</code>
<code>array</code>
<code>array</code>
<code>array</code>
</LessSpecificImplementedReturnType>
</file>
<file src="src/Config/ConfigInterface.php">
<MissingTemplateParam>
<code>ArrayAccess</code>
Expand Down Expand Up @@ -143,12 +127,6 @@
<ArgumentTypeCoercion>
<code>array_merge($versions, array_keys($migrations))</code>
</ArgumentTypeCoercion>
<DeprecatedMethod>
<code>getDataDomain</code>
<code>getMigrationNamespaceByPath</code>
<code>getSeedNamespaceByPath</code>
<code>hasEnvironment</code>
</DeprecatedMethod>
<RedundantPropertyInitializationCheck>
<code><![CDATA[isset($this->container)]]></code>
</RedundantPropertyInitializationCheck>
Expand Down
9 changes: 4 additions & 5 deletions src/Command/StatusCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ protected function getConfig(Arguments $args): Config
'pass' => $connectionConfig['password'],
'host' => $connectionConfig['host'],
'name' => $connectionConfig['database'],
'migration_table' => $table,
];

$configData = [
Expand All @@ -146,10 +147,8 @@ protected function getConfig(Arguments $args): Config
'file' => $templatePath . 'Phinx/create.php.template',
],
'migration_base_class' => 'Migrations\AbstractMigration',
'environments' => [
'default_migration_table' => $table,
'default' => $adapterConfig,
],
'connection' => ConnectionManager::get($connectionName),
'environment' => $adapterConfig,
// TODO do we want to support the DI container in migrations?
];

Expand Down Expand Up @@ -180,7 +179,7 @@ public function execute(Arguments $args, ConsoleIo $io): ?int
{
/** @var string|null $format */
$format = $args->getOption('format');
$migrations = $this->getManager($args)->printStatus('default', $format);
$migrations = $this->getManager($args)->printStatus($format);

switch ($format) {
case 'json':
Expand Down
Loading

0 comments on commit aa1399c

Please sign in to comment.