Skip to content

Commit

Permalink
Merge pull request #753 from cakephp/import-util
Browse files Browse the repository at this point in the history
Import most of Phinx\Util\Util
  • Loading branch information
markstory authored Oct 7, 2024
2 parents 892cacf + a2e46b8 commit 2648e31
Show file tree
Hide file tree
Showing 14 changed files with 533 additions and 42 deletions.
1 change: 1 addition & 0 deletions phpcs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<file>tests/</file>

<exclude-pattern>*/tests/comparisons/*</exclude-pattern>
<exclude-pattern>*/tests/TestCase/Util/_files/*</exclude-pattern>
<exclude-pattern>*/test_app/config/*</exclude-pattern>
<exclude-pattern>*/TestBlog/config/*</exclude-pattern>
<exclude-pattern>*/BarPlugin/config/*</exclude-pattern>
Expand Down
78 changes: 39 additions & 39 deletions psalm-baseline.xml
Original file line number Diff line number Diff line change
@@ -1,64 +1,64 @@
<?xml version="1.0" encoding="UTF-8"?>
<files psalm-version="5.20.0@3f284e96c9d9be6fe6b15c79416e1d1903dcfef4">
<files psalm-version="5.25.0@01a8eb06b9e9cc6cfb6a320bf9fb14331919d505">
<file src="src/Command/MigrationsCommand.php">
<DeprecatedClass>
<code>MigrationsDispatcher</code>
<code>MigrationsDispatcher::getCommands()</code>
<code>MigrationsDispatcher::getCommands()</code>
<code>\Migrations\MigrationsDispatcher</code>
<code>new MigrationsDispatcher(PHINX_VERSION)</code>
<code><![CDATA[MigrationsDispatcher]]></code>
<code><![CDATA[MigrationsDispatcher::getCommands()]]></code>
<code><![CDATA[MigrationsDispatcher::getCommands()]]></code>
<code><![CDATA[\Migrations\MigrationsDispatcher]]></code>
<code><![CDATA[new MigrationsDispatcher(PHINX_VERSION)]]></code>
</DeprecatedClass>
</file>
<file src="src/Command/Phinx/Create.php">
<DeprecatedTrait>
<code>ConfigurationTrait</code>
<code><![CDATA[ConfigurationTrait]]></code>
</DeprecatedTrait>
<PossiblyUndefinedArrayOffset>
<code>$phinxName</code>
<code><![CDATA[$phinxName]]></code>
</PossiblyUndefinedArrayOffset>
</file>
<file src="src/Command/Phinx/Dump.php">
<DeprecatedTrait>
<code>ConfigurationTrait</code>
<code><![CDATA[ConfigurationTrait]]></code>
</DeprecatedTrait>
</file>
<file src="src/Command/Phinx/MarkMigrated.php">
<DeprecatedTrait>
<code>ConfigurationTrait</code>
<code><![CDATA[ConfigurationTrait]]></code>
</DeprecatedTrait>
</file>
<file src="src/Command/Phinx/Migrate.php">
<DeprecatedTrait>
<code>ConfigurationTrait</code>
<code><![CDATA[ConfigurationTrait]]></code>
</DeprecatedTrait>
</file>
<file src="src/Command/Phinx/Rollback.php">
<DeprecatedTrait>
<code>ConfigurationTrait</code>
<code><![CDATA[ConfigurationTrait]]></code>
</DeprecatedTrait>
</file>
<file src="src/Command/Phinx/Seed.php">
<DeprecatedTrait>
<code>ConfigurationTrait</code>
<code><![CDATA[ConfigurationTrait]]></code>
</DeprecatedTrait>
<PossiblyNullReference>
<code>setInput</code>
<code><![CDATA[setInput]]></code>
</PossiblyNullReference>
</file>
<file src="src/Command/Phinx/Status.php">
<DeprecatedTrait>
<code>ConfigurationTrait</code>
<code><![CDATA[ConfigurationTrait]]></code>
</DeprecatedTrait>
</file>
<file src="src/Config/ConfigInterface.php">
<MissingTemplateParam>
<code>ArrayAccess</code>
<code><![CDATA[ArrayAccess]]></code>
</MissingTemplateParam>
</file>
<file src="src/Db/Adapter/AbstractAdapter.php">
<RedundantPropertyInitializationCheck>
<code><![CDATA[$this->io]]></code>
<code>null</code>
<code><![CDATA[null]]></code>
</RedundantPropertyInitializationCheck>
</file>
<file src="src/Db/Adapter/AdapterFactory.php">
Expand All @@ -68,41 +68,41 @@
</file>
<file src="src/Db/Adapter/AdapterWrapper.php">
<DeprecatedMethod>
<code>getQueryBuilder</code>
<code><![CDATA[getQueryBuilder]]></code>
</DeprecatedMethod>
</file>
<file src="src/Db/Adapter/MysqlAdapter.php">
<RedundantCondition>
<code>$opened</code>
<code>is_array($newColumns)</code>
<code><![CDATA[$opened]]></code>
<code><![CDATA[is_array($newColumns)]]></code>
</RedundantCondition>
</file>
<file src="src/Db/Adapter/PhinxAdapter.php">
<DeprecatedMethod>
<code>getQueryBuilder</code>
<code><![CDATA[getQueryBuilder]]></code>
</DeprecatedMethod>
</file>
<file src="src/Db/Adapter/SqlserverAdapter.php">
<ImplementedReturnTypeMismatch>
<code>\Phinx\Db\Adapter\AdapterInterface</code>
<code><![CDATA[\Phinx\Db\Adapter\AdapterInterface]]></code>
</ImplementedReturnTypeMismatch>
<LessSpecificImplementedReturnType>
<code>\Phinx\Db\Adapter\AdapterInterface</code>
<code><![CDATA[\Phinx\Db\Adapter\AdapterInterface]]></code>
</LessSpecificImplementedReturnType>
<MismatchingDocblockReturnType>
<code>\Phinx\Db\Adapter\AdapterInterface</code>
<code><![CDATA[\Phinx\Db\Adapter\AdapterInterface]]></code>
</MismatchingDocblockReturnType>
<RedundantCondition>
<code>is_array($newColumns)</code>
<code><![CDATA[is_array($newColumns)]]></code>
</RedundantCondition>
</file>
<file src="src/Db/Adapter/TimedOutputAdapter.php">
<MissingParamType>
<code>$columns</code>
<code>$newColumns</code>
<code><![CDATA[$columns]]></code>
<code><![CDATA[$newColumns]]></code>
</MissingParamType>
<PossiblyNullReference>
<code>verbose</code>
<code><![CDATA[verbose]]></code>
</PossiblyNullReference>
</file>
<file src="src/Migration/Environment.php">
Expand All @@ -118,47 +118,47 @@
},
$phpFiles
)]]></code>
<code>array_merge($versions, array_keys($migrations))</code>
<code><![CDATA[array_merge($versions, array_keys($migrations))]]></code>
</ArgumentTypeCoercion>
<RedundantPropertyInitializationCheck>
<code><![CDATA[isset($this->container)]]></code>
</RedundantPropertyInitializationCheck>
<ReferenceReusedFromConfusingScope>
<code>$executedVersion</code>
<code><![CDATA[$executedVersion]]></code>
</ReferenceReusedFromConfusingScope>
</file>
<file src="src/Migration/ManagerFactory.php">
<UndefinedConstant>
<code>CONFIG</code>
<code><![CDATA[CONFIG]]></code>
</UndefinedConstant>
</file>
<file src="src/Migration/PhinxBackend.php">
<DeprecatedTrait>
<code>ConfigurationTrait</code>
<code><![CDATA[ConfigurationTrait]]></code>
</DeprecatedTrait>
</file>
<file src="src/Migrations.php">
<DeprecatedTrait>
<code>ConfigurationTrait</code>
<code><![CDATA[ConfigurationTrait]]></code>
</DeprecatedTrait>
</file>
<file src="src/Shim/OutputAdapter.php">
<ArgumentTypeCoercion>
<code>$messages</code>
<code>$messages</code>
<code><![CDATA[$messages]]></code>
<code><![CDATA[$messages]]></code>
</ArgumentTypeCoercion>
<LessSpecificReturnStatement>
<code><![CDATA[$this->io->level()]]></code>
</LessSpecificReturnStatement>
<MoreSpecificReturnType>
<code>self::VERBOSITY_*</code>
<code><![CDATA[self::VERBOSITY_*]]></code>
</MoreSpecificReturnType>
</file>
<file src="src/TestSuite/Migrator.php">
<ArgumentTypeCoercion>
<code>$dropTables</code>
<code>$phinxTables</code>
<code>$tables</code>
<code><![CDATA[$dropTables]]></code>
<code><![CDATA[$phinxTables]]></code>
<code><![CDATA[$tables]]></code>
</ArgumentTypeCoercion>
</file>
<file src="src/Util/ColumnParser.php">
Expand Down
2 changes: 1 addition & 1 deletion src/Command/BakeSimpleMigrationCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
use Cake\Console\ConsoleIo;
use Cake\Console\ConsoleOptionParser;
use Cake\Utility\Inflector;
use Phinx\Util\Util;
use Migrations\Util\Util;

/**
* Task class for generating migration snapshot files.
Expand Down
2 changes: 1 addition & 1 deletion src/Command/Phinx/Create.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@

use Cake\Utility\Inflector;
use Migrations\ConfigurationTrait;
use Migrations\Util\Util;
use Phinx\Console\Command\Create as CreateCommand;
use Phinx\Util\Util;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
Expand Down
2 changes: 1 addition & 1 deletion src/Migration/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
use Migrations\SeedInterface;
use Migrations\Shim\MigrationAdapter;
use Migrations\Shim\SeedAdapter;
use Migrations\Util\Util;
use Phinx\Migration\MigrationInterface as PhinxMigrationInterface;
use Phinx\Seed\SeedInterface as PhinxSeedInterface;
use Phinx\Util\Util;
use Psr\Container\ContainerInterface;
use RuntimeException;

Expand Down
2 changes: 2 additions & 0 deletions src/Table.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
use Phinx\Util\Literal;

/**
* TODO figure out how to update this for built-in backend.
*
* @method \Migrations\CakeAdapter getAdapter()
*/
class Table extends BaseTable
Expand Down
Loading

0 comments on commit 2648e31

Please sign in to comment.