Skip to content

Commit

Permalink
Minor fixes (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
zeriyoshi authored Oct 23, 2023
1 parent ec75a30 commit cd6ceb8
Show file tree
Hide file tree
Showing 23 changed files with 193 additions and 102 deletions.
32 changes: 15 additions & 17 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
name: CI
on: [push, pull_request]
on:
push:
branches:
- main
pull_request:
branches:
- main
schedule:
- cron: '0 2 * * *'
jobs:
Library:
runs-on: ubuntu-22.04
Expand All @@ -9,23 +17,15 @@ jobs:
version: ["7.4", "8.0", "8.1", "8.2"]
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup Buildx
uses: docker/setup-buildx-action@v2
- name: Cache
uses: actions/cache@v3
with:
path: ./vendor
key: library-composer-${{ hashFiles('composer.lock') }}
restore-keys: library-composer-${{ hashFiles('composer.lock') }}
uses: docker/setup-buildx-action@v3
- name: Build Container
uses: docker/build-push-action@v4
uses: docker/build-push-action@v5
with:
build-args: |
IMAGE=php
TAG=${{ matrix.version }}-cli
cache-from: type=gha
cache-to: type=gha,mode=max
context: .
file: ./build/library/Dockerfile
load: true
Expand All @@ -43,22 +43,20 @@ jobs:
distro: ["bullseye", "alpine"]
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: "arm64,s390x"
- name: Setup Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3
- name: Build Container
uses: docker/build-push-action@v4
uses: docker/build-push-action@v5
with:
build-args: |
IMAGE=${{ matrix.arch }}/php
TAG=${{ matrix.version }}-${{ matrix.type }}-${{ matrix.distro }}
PSKEL_SKIP_DEBUG=${{ matrix.arch != 'amd64' && '1' || '' }}
cache-from: type=gha
cache-to: type=gha,mode=max
context: .
load: true
tags: "pskel-${{ matrix.arch }}-${{ matrix.type }}-${{ matrix.distro }}"
Expand Down
6 changes: 3 additions & 3 deletions .idea/php-colopl_bc.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# 10.x.x (Not released yet)
- n/a

# 10.0.2
- Bump dependencies
- CI minor fixes

# 10.0.1
- Extension: Support PHP 8.2
- Library: Support PHP 8.2
Expand Down
12 changes: 6 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@
"php": "~7.4.0 || ~8.0.0 || ~8.1.0 || ~8.2.0"
},
"require-dev": {
"phpunit/phpunit": "^9.6.9",
"phpstan/phpstan": "^1.10.18",
"vimeo/psalm": "^5.12",
"phpstan/phpstan-phpunit": "^1.3.13",
"phpunit/phpunit": "^9.6.13",
"phpstan/phpstan": "^1.10.39",
"vimeo/psalm": "^5.15",
"phpstan/phpstan-phpunit": "^1.3.15",
"psalm/plugin-phpunit": "^0.18.4",
"php-cs-fixer/shim": "^3.17",
"rector/rector": "^0.16.0"
"php-cs-fixer/shim": "^3.35.1",
"rector/rector": "^0.18.5"
},
"license": "PHP-3.01",
"authors": [
Expand Down
2 changes: 1 addition & 1 deletion ext/php_colopl_bc.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ extern zend_module_entry colopl_bc_module_entry;
#define COLOPL_BC_PHP74_SORT_MODE_DEPRECATED 1
#define COLOPL_BC_PHP74_SORT_MODE_LOG 2

#define PHP_COLOPL_BC_VERSION "10.0.1"
#define PHP_COLOPL_BC_VERSION "10.0.2"

ZEND_BEGIN_MODULE_GLOBALS(colopl_bc)
bool rand_is_seeded;
Expand Down
146 changes: 146 additions & 0 deletions psalm-baseline.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
<?xml version="1.0" encoding="UTF-8"?>
<files psalm-version="5.15.0@5c774aca4746caf3d239d9c8cadb9f882ca29352">
<file src="library.php">
<LessSpecificReturnType>
<code>array-key|false|null</code>
<code>bool|null</code>
<code>bool|null</code>
<code>bool|null</code>
<code>bool|null</code>
<code>bool|null</code>
<code>bool|null</code>
<code>bool|null</code>
<code>bool|null</code>
<code>bool|null</code>
</LessSpecificReturnType>
</file>
<file src="tests/Extension/PHP70Test.php">
<UnusedFunctionCall>
<code>\Colopl\ColoplBc\Php70\mt_srand</code>
<code>\Colopl\ColoplBc\Php70\mt_srand</code>
<code>\Colopl\ColoplBc\Php70\mt_srand</code>
<code>\Colopl\ColoplBc\Php70\srand</code>
<code>\Colopl\ColoplBc\Php70\srand</code>
<code>\Colopl\ColoplBc\Php70\srand</code>
<code>\Colopl\ColoplBc\Php70\srand</code>
<code>\Colopl\ColoplBc\Php70\srand</code>
</UnusedFunctionCall>
</file>
<file src="tests/Extension/PHP74Test.php">
<DeprecatedFunction>
<code><![CDATA[\Colopl\ColoplBc\Php74\array_keys(['first' => 0, 'second' => ''], '')]]></code>
<code>\Colopl\ColoplBc\Php74\array_multisort($ary1, $ary2)</code>
<code><![CDATA[\Colopl\ColoplBc\Php74\array_search('', ['first' => 0, 'second' => ''])]]></code>
<code>\Colopl\ColoplBc\Php74\arsort($array)</code>
<code>\Colopl\ColoplBc\Php74\asort($array)</code>
<code><![CDATA[\Colopl\ColoplBc\Php74\eq(0, '')]]></code>
<code><![CDATA[\Colopl\ColoplBc\Php74\gt('a', 0)]]></code>
<code><![CDATA[\Colopl\ColoplBc\Php74\gte(0, '')]]></code>
<code><![CDATA[\Colopl\ColoplBc\Php74\in_array('', [0])]]></code>
<code>\Colopl\ColoplBc\Php74\krsort($array)</code>
<code>\Colopl\ColoplBc\Php74\ksort($array)</code>
<code><![CDATA[\Colopl\ColoplBc\Php74\lt(0, 'a')]]></code>
<code><![CDATA[\Colopl\ColoplBc\Php74\lte(0, '')]]></code>
<code><![CDATA[\Colopl\ColoplBc\Php74\neq(0, '')]]></code>
<code>\Colopl\ColoplBc\Php74\rsort($array)</code>
<code>\Colopl\ColoplBc\Php74\sort($array)</code>
<code><![CDATA[\Colopl\ColoplBc\Php74\spaceship('', 0)]]></code>
<code>\Colopl\ColoplBc\Php74\uasort($array, function (int $_left, int $_right): int {
return 0;
})</code>
<code>\Colopl\ColoplBc\Php74\uksort($array, function (int $_left, int $_right): int {
return 0;
})</code>
<code>\Colopl\ColoplBc\Php74\usort($array, function (int $_left, int $_right): int {
return 0;
})</code>
</DeprecatedFunction>
</file>
<file src="tests/Rector/AbstractSimpleRectorTestCase.php">
<MixedInferredReturnType>
<code>Iterator</code>
</MixedInferredReturnType>
</file>
<file src="vendor/rector/rector/src/Rector/AbstractRector.php">
<LessSpecificImplementedReturnType>
<code>mixed[]|int|\PhpParser\Node|null</code>
</LessSpecificImplementedReturnType>
<MissingConstructor>
<code>$file</code>
<code>$file</code>
<code>$file</code>
<code>$file</code>
<code>$file</code>
<code>$file</code>
<code>$file</code>
<code>$file</code>
<code>$file</code>
<code>$file</code>
<code>$file</code>
<code>$file</code>
<code>$file</code>
<code>$file</code>
<code>$file</code>
<code>$nodeComparator</code>
<code>$nodeComparator</code>
<code>$nodeComparator</code>
<code>$nodeComparator</code>
<code>$nodeComparator</code>
<code>$nodeComparator</code>
<code>$nodeComparator</code>
<code>$nodeComparator</code>
<code>$nodeComparator</code>
<code>$nodeComparator</code>
<code>$nodeComparator</code>
<code>$nodeComparator</code>
<code>$nodeComparator</code>
<code>$nodeComparator</code>
<code>$nodeComparator</code>
<code>$nodeFactory</code>
<code>$nodeFactory</code>
<code>$nodeFactory</code>
<code>$nodeFactory</code>
<code>$nodeFactory</code>
<code>$nodeFactory</code>
<code>$nodeFactory</code>
<code>$nodeFactory</code>
<code>$nodeFactory</code>
<code>$nodeFactory</code>
<code>$nodeFactory</code>
<code>$nodeFactory</code>
<code>$nodeFactory</code>
<code>$nodeFactory</code>
<code>$nodeFactory</code>
<code>$nodeNameResolver</code>
<code>$nodeNameResolver</code>
<code>$nodeNameResolver</code>
<code>$nodeNameResolver</code>
<code>$nodeNameResolver</code>
<code>$nodeNameResolver</code>
<code>$nodeNameResolver</code>
<code>$nodeNameResolver</code>
<code>$nodeNameResolver</code>
<code>$nodeNameResolver</code>
<code>$nodeNameResolver</code>
<code>$nodeNameResolver</code>
<code>$nodeNameResolver</code>
<code>$nodeNameResolver</code>
<code>$nodeNameResolver</code>
<code>$nodeTypeResolver</code>
<code>$nodeTypeResolver</code>
<code>$nodeTypeResolver</code>
<code>$nodeTypeResolver</code>
<code>$nodeTypeResolver</code>
<code>$nodeTypeResolver</code>
<code>$nodeTypeResolver</code>
<code>$nodeTypeResolver</code>
<code>$nodeTypeResolver</code>
<code>$nodeTypeResolver</code>
<code>$nodeTypeResolver</code>
<code>$nodeTypeResolver</code>
<code>$nodeTypeResolver</code>
<code>$nodeTypeResolver</code>
<code>$nodeTypeResolver</code>
</MissingConstructor>
</file>
</files>
46 changes: 1 addition & 45 deletions psalm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://getpsalm.org/schema/config"
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
errorBaseline="psalm-baseline.xml"
>
<projectFiles>
<file name="library.php"/>
Expand All @@ -16,49 +17,4 @@
<plugins>
<pluginClass class="Psalm\PhpUnitPlugin\Plugin"/>
</plugins>
<issueHandlers>
<ForbiddenCode>
<errorLevel type="suppress">
<file name="ext/package.xml.php"/>
</errorLevel>
</ForbiddenCode>
<DuplicateFunction>
<errorLevel type="suppress">
<file name="library.php"/>
</errorLevel>
</DuplicateFunction>
<DeprecatedFunction>
<errorLevel type="suppress">
<file name="library.php"/>
<directory name="tests"/>
</errorLevel>
</DeprecatedFunction>
<LessSpecificReturnType>
<errorLevel type="suppress">
<file name="library.php"/>
</errorLevel>
</LessSpecificReturnType>
<NullArgument>
<errorLevel type="suppress">
<referencedFunction name="Colopl\ColoplBc\Php70\srand"/>
<referencedFunction name="Colopl\ColoplBc\Php70\mt_srand"/>
</errorLevel>
</NullArgument>
<UnusedFunctionCall>
<errorLevel type="suppress">
<referencedFunction name="Colopl\ColoplBc\Php70\srand"/>
<referencedFunction name="Colopl\ColoplBc\Php70\mt_srand"/>
</errorLevel>
</UnusedFunctionCall>
<MissingConstructor>
<errorLevel type="suppress">
<directory name="src/Rector"/>
</errorLevel>
</MissingConstructor>
<MixedInferredReturnType>
<errorLevel type="suppress">
<file name="tests/Rector/AbstractSimpleRectorTestCase.php"/>
</errorLevel>
</MixedInferredReturnType>
</issueHandlers>
</psalm>
2 changes: 2 additions & 0 deletions tests/Rector/AbstractSimpleRectorTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace Colopl\ColoplBc\Tests\Rector;

use Iterator;
use Rector\Core\Exception\ShouldNotHappenException;
use Rector\Testing\PHPUnit\AbstractRectorTestCase;

use const DIRECTORY_SEPARATOR as DS;
Expand All @@ -13,6 +14,7 @@ abstract class AbstractSimpleRectorTestCase extends AbstractRectorTestCase
{
/**
* @dataProvider provideData()
* @throws ShouldNotHappenException
*/
public function test(string $file): void
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,5 @@
use Rector\Config\RectorConfig;

return static function (RectorConfig $rectorConfig): void {
$services = $rectorConfig->services();
$services->set(EqualToBCMigrateRector::class);
$rectorConfig->rule(EqualToBCMigrateRector::class);
};
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,5 @@
use Rector\Config\RectorConfig;

return static function (RectorConfig $rectorConfig): void {
$services = $rectorConfig->services();
$services->set(APCToAPCUFunctionMigrateRector::class);
$rectorConfig->rule(APCToAPCUFunctionMigrateRector::class);
};
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,5 @@
use Rector\Config\RectorConfig;

return static function (RectorConfig $rectorConfig): void {
$services = $rectorConfig->services();
$services->set(ArrayFuncToBCMigrateRector::class);
$rectorConfig->rule(ArrayFuncToBCMigrateRector::class);
};
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,5 @@
use Rector\Config\RectorConfig;

return static function (RectorConfig $rectorConfig): void {
$services = $rectorConfig->services();
$services->set(ArrayKeyExistsToPropertyExistsRector::class);
$rectorConfig->rule(ArrayKeyExistsToPropertyExistsRector::class);
};
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,5 @@
use Rector\Config\RectorConfig;

return static function (RectorConfig $rectorConfig): void {
$services = $rectorConfig->services();
$services->set(ArrayMultisortToBCMigrateRector::class);
$rectorConfig->rule(ArrayMultisortToBCMigrateRector::class);
};
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,5 @@
use Rector\Config\RectorConfig;

return static function (RectorConfig $rectorConfig): void {
$services = $rectorConfig->services();
$services->set(RandomToBCMigrateRector::class);
$rectorConfig->rule(RandomToBCMigrateRector::class);
};
Loading

0 comments on commit cd6ceb8

Please sign in to comment.