Skip to content

Commit

Permalink
Merge branch '4.x' into no-phinx
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed May 2, 2024
2 parents d34fdad + 3de99c3 commit 57332c3
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 11 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ jobs:
run: echo "date=$(date +'%Y-%m')" >> $GITHUB_OUTPUT

- name: Cache composer dependencies
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ steps.key-date.outputs.date }}-${{ hashFiles('composer.json') }}-${{ matrix.prefer-lowest }}
Expand Down Expand Up @@ -117,7 +117,7 @@ jobs:
- name: Code Coverage Report
if: success() && matrix.php-version == '8.1' && matrix.db-type == 'mysql'
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4

testsuite-windows:
runs-on: windows-2022
Expand Down
4 changes: 2 additions & 2 deletions .phive/phars.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<phive xmlns="https://phar.io/phive">
<phar name="phpstan" version="1.10.22" installed="1.10.22" location="./tools/phpstan" copy="false"/>
<phar name="psalm" version="5.13.1" installed="5.13.1" location="./tools/psalm" copy="false"/>
<phar name="phpstan" version="1.10.56" installed="1.10.56" location="./tools/phpstan" copy="false"/>
<phar name="psalm" version="5.20.0" installed="5.20.0" location="./tools/psalm" copy="false"/>
</phive>
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"php": ">=8.1",
"cakephp/cache": "^5.0",
"cakephp/orm": "^5.0",
"robmorgan/phinx": "0.x-dev#c35379620f23319329bb9ed17b82f4bdcce2a91e"
"robmorgan/phinx": "^0.16.0"
},
"require-dev": {
"cakephp/bake": "^3.0",
Expand Down
14 changes: 13 additions & 1 deletion psalm-baseline.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<files psalm-version="5.13.1@086b94371304750d1c673315321a55d15fc59015">
<files psalm-version="5.20.0@3f284e96c9d9be6fe6b15c79416e1d1903dcfef4">
<file src="src/Command/MigrationsCommand.php">
<DeprecatedClass>
<code>MigrationsDispatcher</code>
Expand Down Expand Up @@ -150,4 +150,16 @@
<code>self::VERBOSITY_*</code>
</MoreSpecificReturnType>
</file>
<file src="src/Util/ColumnParser.php">
<ArgumentTypeCoercion>
<code><![CDATA[$this->regexpParseColumn]]></code>
<code><![CDATA[$this->regexpParseColumn]]></code>
<code><![CDATA[$this->regexpParseColumn]]></code>
<code><![CDATA[$this->regexpParseColumn]]></code>
<code><![CDATA[$this->regexpParseField]]></code>
</ArgumentTypeCoercion>
<TypeDoesNotContainType>
<code>empty($indexes[$indexName])</code>
</TypeDoesNotContainType>
</file>
</files>
1 change: 1 addition & 0 deletions psalm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,6 @@
<PropertyNotSetInConstructor errorLevel="suppress"/>
<UnresolvableInclude errorLevel="suppress"/>
<UnsafeInstantiation errorLevel="suppress"/>
<RiskyTruthyFalsyComparison errorLevel="suppress"/>
</issueHandlers>
</psalm>
1 change: 1 addition & 0 deletions src/AbstractMigration.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ public function table(string $tableName, array $options = []): Table
}

$table = new Table($tableName, $options, $this->getAdapter());
$this->tables[] = $table;

return $table;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Command/BakeSeedCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public function templateData(Arguments $arguments): array
$namespace = $this->_pluginNamespace($this->plugin);
}

$table = Inflector::tableize((string)$arguments->getArgumentAt(0));
$table = Inflector::underscore((string)$arguments->getArgumentAt(0));
if ($arguments->hasOption('table')) {
/** @var string $table */
$table = $arguments->getOption('table');
Expand Down
2 changes: 1 addition & 1 deletion src/Util/ColumnParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ public function validArguments(array $arguments): array
public function getTypeAndLength(string $field, ?string $type): array
{
if ($type && preg_match($this->regexpParseField, $type, $matches)) {
if (strpos($matches[2], ',') !== false) {
if (str_contains($matches[2], ',')) {
$matches[2] = explode(',', $matches[2]);
}

Expand Down
6 changes: 3 additions & 3 deletions src/Util/TableFinder.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public function getTablesToBake(CollectionInterface $collection, array $options
}

foreach ($tableNamesInModel as $num => $table) {
if (str_contains($table, '.')) {
if ($table && str_contains($table, '.')) {
$split = array_reverse(explode('.', $table, 2));

$config = (array)ConnectionManager::getConfig($this->connection);
Expand Down Expand Up @@ -108,7 +108,7 @@ public function getTablesToBake(CollectionInterface $collection, array $options
* Gets list Tables Names
*
* @param string|null $pluginName Plugin name if exists.
* @return string[]
* @return array<int, string|null>
*/
public function getTableNames(?string $pluginName = null): array
{
Expand Down Expand Up @@ -157,7 +157,7 @@ public function findTables(?string $pluginName = null): array
*
* @param string $className Name of Table Class.
* @param string|null $pluginName Plugin name if exists.
* @return string[]
* @return list<null|string>
*/
public function fetchTableName(string $className, ?string $pluginName = null): array
{
Expand Down

0 comments on commit 57332c3

Please sign in to comment.