From 224213a03ffb8e8aef62561662b6abe47a6a8485 Mon Sep 17 00:00:00 2001 From: Ricardo Paes Date: Mon, 24 Nov 2025 14:50:36 -0300 Subject: [PATCH 1/6] =?UTF-8?q?=E2=9C=A8=20[GEST-3244]=20Melhorando=20estr?= =?UTF-8?q?utura=20-=20Fazendo=20upgrade=20para=20PHP=207.4;=20-=20Atualiz?= =?UTF-8?q?ando=20PHP=20Stan;=20-=20Usando=20PHP=20ECS;=20-=20Removendo=20?= =?UTF-8?q?PHPUnit;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.example | 2 +- .github/workflows/ci.yml | 34 +++++++++++++---------- .gitignore | 4 --- .php-cs-fixer.php | 53 ------------------------------------ .php_cs | 58 ---------------------------------------- composer.json | 20 +++++++++----- ecs.php | 36 +++++++++++++++++++++++++ phpunit.xml | 17 ------------ src/Phinx.php | 10 +++---- 9 files changed, 76 insertions(+), 158 deletions(-) delete mode 100644 .php-cs-fixer.php delete mode 100644 .php_cs create mode 100644 ecs.php delete mode 100644 phpunit.xml diff --git a/.env.example b/.env.example index 3cb636c..d0de590 100644 --- a/.env.example +++ b/.env.example @@ -1,3 +1,3 @@ GITHUB_TOKEN= -PHP_VERSION=56|73|74|80|81|82|83 +PHP_VERSION=74|80|81|82|83 DB_ENGINE= \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 883b73f..2123a00 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,24 +12,22 @@ jobs: test: strategy: matrix: - PHP: [56, 74, 80, 81, 82, 83] + PHP: [74, 80, 81, 82, 83] runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Prepare code - env: - PHP_VERSION: ${{ matrix.PHP }} + - name: Up environment run: | - touch .env - echo "GITHUB_TOKEN=${{ secrets.GH_TOKEN }}" >> .env - echo "PHP_VERSION=$PHP_VERSION" >> .env + docker compose up -d - - name: Prepare environment + - name: Wait environment + run: | + echo $(docker compose -f docker-compose.wait.yml run --rm wait) + + - name: Environment logs run: | - docker compose up -d - echo $(docker run -t --network github jwilder/dockerize -wait tcp://php:9000 -timeout 120s) docker compose ps docker compose logs php @@ -37,12 +35,20 @@ jobs: run: | docker compose exec -T php composer test + - name: Run Lint + run: | + docker compose exec -T php composer lint + - name: Run PHP Stan - if: matrix.PHP != '56' run: | docker compose exec -T php composer analyse - - name: Run PHP CS Fixer - if: matrix.PHP != '56' + - name: Run ECS + run: | + docker compose exec -T php composer fix:ci + + - name: Desligando ambiente + if: ${{ always() }} run: | - docker compose exec -T php composer fix:ci \ No newline at end of file + docker compose exec -T php rm -Rf vendor/ .env + docker compose down --remove-orphans \ No newline at end of file diff --git a/.gitignore b/.gitignore index 461b651..eea106d 100644 --- a/.gitignore +++ b/.gitignore @@ -4,8 +4,4 @@ desktop.ini /vendor/ .env composer.lock -tests/phpunit.*.xml -.phpunit.result.cache -.php_cs.cache -.php-cs-fixer.cache .mysql-data/ \ No newline at end of file diff --git a/.php-cs-fixer.php b/.php-cs-fixer.php deleted file mode 100644 index 52918dd..0000000 --- a/.php-cs-fixer.php +++ /dev/null @@ -1,53 +0,0 @@ - true, - 'array_syntax' => ['syntax' => 'short'], - 'multiline_whitespace_before_semicolons' => false, - 'echo_tag_syntax' => false, - 'no_unused_imports' => true, - 'not_operator_with_successor_space' => true, - 'no_useless_else' => true, - 'ordered_imports' => ['sort_algorithm' => 'none', 'imports_order' => ['const', 'class', 'function']], - 'phpdoc_add_missing_param_annotation' => true, - 'phpdoc_indent' => true, - 'phpdoc_no_package' => true, - 'phpdoc_order' => true, - 'phpdoc_separation' => true, - 'phpdoc_single_line_var_spacing' => true, - 'phpdoc_trim' => true, - 'phpdoc_var_without_name' => true, - 'phpdoc_to_comment' => true, - 'single_quote' => true, - 'ternary_operator_spaces' => true, - 'trailing_comma_in_multiline' => true, - 'trim_array_spaces' => true, - 'curly_braces_position' => [ - 'classes_opening_brace' => 'same_line', - 'functions_opening_brace' => 'same_line', - ], - 'visibility_required' => ['elements' => ['property', 'method']], -]; - -$excludes = [ - 'vendor', - '.vscode', - '.github', - '.devcontainer', - 'tests/Support/_generated/', -]; - -$finder = PhpCsFixer\Finder::create() - ->in(__DIR__) - ->exclude($excludes) - ->notName('README.md') - ->notName('*.xml') - ->notName('*.yml') - ->notName('_ide_helper.php') -; - -return (new PhpCsFixer\Config()) - ->setRules($rules) - ->setFinder($finder) - ->setIndent("\t") -; diff --git a/.php_cs b/.php_cs deleted file mode 100644 index 24303e2..0000000 --- a/.php_cs +++ /dev/null @@ -1,58 +0,0 @@ - true, - 'array_syntax' => ['syntax' => 'short'], - 'no_multiline_whitespace_before_semicolons' => true, - 'no_short_echo_tag' => true, - 'no_unused_imports' => true, - 'not_operator_with_successor_space' => true, - 'no_useless_else' => true, - 'ordered_imports' => ['sort_algorithm' => 'none', 'imports_order' => ['const', 'class', 'function']], - 'phpdoc_add_missing_param_annotation' => true, - 'phpdoc_indent' => true, - 'phpdoc_no_package' => true, - 'phpdoc_order' => true, - 'phpdoc_separation' => true, - 'phpdoc_single_line_var_spacing' => true, - 'phpdoc_trim' => true, - 'phpdoc_var_without_name' => true, - 'phpdoc_to_comment' => true, - 'single_quote' => true, - 'ternary_operator_spaces' => true, - 'trailing_comma_in_multiline_array' => true, - 'trim_array_spaces' => true, - 'braces' => [ - 'allow_single_line_closure' => true, - 'position_after_functions_and_oop_constructs' => 'same' - ] -]; - -$excludes = [ - 'vendor', - 'storage', - 'node_modules', - '.vscode', - '.github', - '.devcontainer', - 'logs', - 'files', - 'k8s', - 'socket', - 'temp' -]; - -$finder = PhpCsFixer\Finder::create() - ->in(__DIR__) - ->exclude($excludes) - ->notName('README.md') - ->notName('*.xml') - ->notName('*.yml') - ->notName('_ide_helper.php') -; - -return PhpCsFixer\Config::create() - ->setRules($rules) - ->setFinder($finder) - ->setIndent("\t") -; \ No newline at end of file diff --git a/composer.json b/composer.json index 0265f68..bd3e974 100644 --- a/composer.json +++ b/composer.json @@ -6,15 +6,19 @@ {"type": "composer", "url": "https://composer.likesistemas.com.br/"} ], "require": { - "php": ">=5.6", + "php": ">=7.4", "robmorgan/phinx": ">=0.10" }, "require-dev": { - "phpunit/phpunit": "^5.0 || ^9.0", "codeception/codeception": "^4.0 || ^5.0", "codeception/module-phpbrowser": "^1.0 || ^2.0", "codeception/module-asserts": "^1.3 || ^2.0", - "codeception/module-db": "^1.1 || ^2.0 || ^3.0" + "codeception/module-db": "^1.1 || ^2.0 || ^3.0", + "phpstan/phpstan": "^2.0", + "rector/rector": "^2.0", + "php-parallel-lint/php-parallel-lint": "^1.4", + "maglnet/composer-require-checker": "^3.8 || ^4.16", + "symplify/easy-coding-standard": "^12.6" }, "autoload": { "psr-4": { @@ -34,12 +38,16 @@ } ], "scripts": { - "fix": "php-cs-fixer fix --show-progress=dots", - "fix:ci": "php-cs-fixer fix --dry-run --stop-on-violation --show-progress=dots", + "fix": "ecs --fix", + "fix:ci": "ecs", "test": [ "codecept build", "codecept run" ], - "analyse": "phpstan analyse" + "analyse": "phpstan analyse", + "refactor": "rector process", + "refactor:ci": "rector process --dry-run", + "lint": "parallel-lint --colors --exclude vendor/ .", + "reqs": "composer-require-checker check composer.json" } } diff --git a/ecs.php b/ecs.php new file mode 100644 index 0000000..b29836a --- /dev/null +++ b/ecs.php @@ -0,0 +1,36 @@ +withPaths([ + __DIR__ . '/src/', + __DIR__ . '/tests/', + ]) + ->withSkip([ + __DIR__ . '/tests/Support/_generated', + ]) + ->withSets([SetList::PSR_12]) + ->withSpacing(Option::INDENTATION_TAB, PHP_EOL) + ->withRules([RemovePHPStormAnnotationFixer::class]) + ->withConfiguredRule( + ArraySyntaxFixer::class, + ['syntax' => 'short'] + ) + ->withConfiguredRule( + CurlyBracesPositionFixer::class, + [ + 'classes_opening_brace' => 'same_line', + 'functions_opening_brace' => 'same_line', + ] + ) + ->withConfiguredRule( + VisibilityRequiredFixer::class, + ['elements' => ['property', 'method']] + ); diff --git a/phpunit.xml b/phpunit.xml deleted file mode 100644 index 8363893..0000000 --- a/phpunit.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - ./tests/ - - - - - ./src/ - - - - - - - \ No newline at end of file diff --git a/src/Phinx.php b/src/Phinx.php index 4bacbcd..e5bd92b 100644 --- a/src/Phinx.php +++ b/src/Phinx.php @@ -10,7 +10,7 @@ class Phinx extends Module { public function _before(TestInterface $test) { - if(! $this->getConfigPopulate()) { + if (!$this->getConfigPopulate()) { return; } @@ -37,7 +37,7 @@ private function getSeedConfig() { private function getConfigBool($config) { $seed = $this->_getConfig($config); - if($seed === null) { + if ($seed === null) { $seed = true; } @@ -60,15 +60,15 @@ private function phinx($environment, $seed) { $this->run($app, $output, 'migrate', $config, $environment); - if($seed) { + if ($seed) { $this->run($app, $output, 'seed:run', $config, $environment); } } private function run(PhinxApplication $phinx, BufferedOutput $output, $commandName, $config, $environment) { $arguments = [ - 'command' => $commandName, - '--environment' => $environment, + 'command' => $commandName, + '--environment' => $environment, '--configuration' => $config, '-vvv' => '', ]; From e0b329c9030c0c8c12573a784741c97320ac9b26 Mon Sep 17 00:00:00 2001 From: Ricardo Paes Date: Mon, 24 Nov 2025 15:00:08 -0300 Subject: [PATCH 2/6] =?UTF-8?q?=E2=9C=A8=20[GEST-3244]=20Melhorando=20dete?= =?UTF-8?q?c=C3=A7=C3=A3o=20config=20Phinx=20-=20Procurando=20na=20pasta?= =?UTF-8?q?=20`tests`=20em=20todos=20os=20niveis=20antes=20de=20buscar=20n?= =?UTF-8?q?a=20raiz;=20-=20Tornando=20os=20m=C3=A9todos=20"protected"=20pa?= =?UTF-8?q?ra=20substitui-los=20se=20necess=C3=A1rio;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .devcontainer/devcontainer.json | 3 +- .vscode/extensions.json | 3 +- .../20220623110507_my_new_migration.php | 2 +- rector.php | 23 +++++++++ src/Phinx.php | 49 +++++++++++++------ tests/Support/AcceptanceTester.php | 3 +- tests/Support/FunctionalTester.php | 3 +- tests/Support/UnitTester.php | 3 +- tests/Unit/FirstCest.php | 2 +- tests/Unit/PhinxTest.php | 2 +- 10 files changed, 69 insertions(+), 24 deletions(-) create mode 100644 rector.php diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 8e38afb..c07ebaf 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -13,6 +13,7 @@ "eamodio.gitlens", "mhutchie.git-graph", "junstyle.php-cs-fixer", - "janbn.git-last-commit-message" + "janbn.git-last-commit-message", + "seatonjiang.gitmoji-vscode" ] } \ No newline at end of file diff --git a/.vscode/extensions.json b/.vscode/extensions.json index ba0fe32..1ce7d85 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -6,6 +6,7 @@ "eamodio.gitlens", "mhutchie.git-graph", "junstyle.php-cs-fixer", - "janbn.git-last-commit-message" + "janbn.git-last-commit-message", + "seatonjiang.gitmoji-vscode" ] } \ No newline at end of file diff --git a/db/migrations/20220623110507_my_new_migration.php b/db/migrations/20220623110507_my_new_migration.php index 0e93878..1f3cb80 100644 --- a/db/migrations/20220623110507_my_new_migration.php +++ b/db/migrations/20220623110507_my_new_migration.php @@ -3,7 +3,7 @@ use Phinx\Migration\AbstractMigration; final class MyNewMigration extends AbstractMigration { - public function change() { + public function change(): void { $table = $this->table('user_logins'); $table->addColumn('user_id', 'integer') ->addColumn('created', 'datetime') diff --git a/rector.php b/rector.php new file mode 100644 index 0000000..071ddf8 --- /dev/null +++ b/rector.php @@ -0,0 +1,23 @@ +withPaths([ + __DIR__ . '/src', + __DIR__ . '/tests', + __DIR__ . '/db', + ]) + ->withPhpVersion(PhpVersion::PHP_74) + ->withPhp74Sets() + ->withImportNames() + ->withSets([ + SetList::TYPE_DECLARATION, + SetList::DEAD_CODE, + SetList::CODE_QUALITY, + SetList::EARLY_RETURN, + ]); diff --git a/src/Phinx.php b/src/Phinx.php index e5bd92b..b806825 100644 --- a/src/Phinx.php +++ b/src/Phinx.php @@ -9,7 +9,7 @@ use Symfony\Component\Console\Output\BufferedOutput; class Phinx extends Module { - public function _before(TestInterface $test) { + public function _before(TestInterface $test): void { if (!$this->getConfigPopulate()) { return; } @@ -35,7 +35,7 @@ private function getSeedConfig() { return $this->getConfigBool('seed'); } - private function getConfigBool($config) { + private function getConfigBool(string $config): bool { $seed = $this->_getConfig($config); if ($seed === null) { $seed = true; @@ -45,13 +45,14 @@ private function getConfigBool($config) { } /** - * @param string $environment - * @param bool $seed - * - * @return void - */ - private function phinx($environment, $seed) { + * @param string $environment + * @param bool $seed + */ + private function phinx($environment, $seed): void { $config = $this->findConfigPath(); + if ($config === null) { + return; + } $app = new PhinxApplication(); $app->setAutoExit(false); @@ -65,7 +66,7 @@ private function phinx($environment, $seed) { } } - private function run(PhinxApplication $phinx, BufferedOutput $output, $commandName, $config, $environment) { + private function run(PhinxApplication $phinx, BufferedOutput $output, string $commandName, string $config, $environment): void { $arguments = [ 'command' => $commandName, '--environment' => $environment, @@ -79,25 +80,41 @@ private function run(PhinxApplication $phinx, BufferedOutput $output, $commandNa } } - private function findConfigPath() { - $paths = [ + protected function getPathConfig(string $path): string { + return __DIR__ . '/' . $path; + } + + protected function getPathsConfig(): array { + return [ '../../../../tests/phinx.php', + '../../../tests/phinx.php', + '../../tests/phinx.php', + '../tests/phinx.php', + './tests/phinx.php', '../../../../phinx.php', + '../../../phinx.php', '../../phinx.php', - '../phinx.php', // To use inside library tests + '../phinx.php', + './phinx.php', ]; + } + + protected function findConfigPath(): ?string { + $paths = $this->getPathsConfig(); $notFound = []; foreach ($paths as $path) { - $src = __DIR__ . '/' . $path; - if (file_exists($src)) { - return realpath($src); + $src = $this->getPathConfig($path); + if (file_exists($src) && ($realPath = realpath($src)) !== false) { + return $realPath; } $notFound[] = $src; } - trigger_error('Phinx configuration not found. Paths: `' . join('`, `', $notFound) . '`', E_USER_NOTICE); + trigger_error('Phinx configuration not found. Paths: `' . implode('`, `', $notFound) . '`', E_USER_NOTICE); + + return null; } } diff --git a/tests/Support/AcceptanceTester.php b/tests/Support/AcceptanceTester.php index 89caca0..afb3c74 100644 --- a/tests/Support/AcceptanceTester.php +++ b/tests/Support/AcceptanceTester.php @@ -2,6 +2,7 @@ namespace Tests; +use Codeception\Actor; use Tests\_generated\AcceptanceTesterActions; /** @@ -20,7 +21,7 @@ * * @SuppressWarnings(PHPMD) */ -class AcceptanceTester extends \Codeception\Actor { +class AcceptanceTester extends Actor { use AcceptanceTesterActions; /* diff --git a/tests/Support/FunctionalTester.php b/tests/Support/FunctionalTester.php index 63e23c5..0eb986b 100644 --- a/tests/Support/FunctionalTester.php +++ b/tests/Support/FunctionalTester.php @@ -2,6 +2,7 @@ namespace Tests; +use Codeception\Actor; use Tests\_generated\FunctionalTesterActions; /** @@ -20,7 +21,7 @@ * * @SuppressWarnings(PHPMD) */ -class FunctionalTester extends \Codeception\Actor { +class FunctionalTester extends Actor { use FunctionalTesterActions; /* diff --git a/tests/Support/UnitTester.php b/tests/Support/UnitTester.php index 84f244c..d433efd 100644 --- a/tests/Support/UnitTester.php +++ b/tests/Support/UnitTester.php @@ -2,6 +2,7 @@ namespace Tests; +use Codeception\Actor; use Tests\_generated\UnitTesterActions; /** @@ -20,7 +21,7 @@ * * @SuppressWarnings(PHPMD) */ -class UnitTester extends \Codeception\Actor { +class UnitTester extends Actor { use UnitTesterActions; /* diff --git a/tests/Unit/FirstCest.php b/tests/Unit/FirstCest.php index 4710bb3..cbbe9b6 100644 --- a/tests/Unit/FirstCest.php +++ b/tests/Unit/FirstCest.php @@ -5,7 +5,7 @@ use Tests\UnitTester; class FirstCest { - public function tryToTest(UnitTester $I) { + public function tryToTest(UnitTester $I): void { $I->seeNumRecords(0, 'user_logins'); } } diff --git a/tests/Unit/PhinxTest.php b/tests/Unit/PhinxTest.php index c199df9..54fd7d1 100644 --- a/tests/Unit/PhinxTest.php +++ b/tests/Unit/PhinxTest.php @@ -6,7 +6,7 @@ use PHPUnit\Framework\TestCase; class PhinxTest extends TestCase { - public function testInstance() { + public function testInstance(): void { $this->assertTrue(class_exists(Phinx::class)); } } From b438210e0c7dfb2ef794f8a9905e3ebdea0f76c1 Mon Sep 17 00:00:00 2001 From: Ricardo Paes Date: Mon, 24 Nov 2025 15:02:40 -0300 Subject: [PATCH 3/6] =?UTF-8?q?=E2=9C=A8=20[GEST-3244]=20Melhorando=20dete?= =?UTF-8?q?c=C3=A7=C3=A3o=20config=20Phinx=20-=20Procurando=20na=20pasta?= =?UTF-8?q?=20`tests`=20em=20todos=20os=20niveis=20antes=20de=20buscar=20n?= =?UTF-8?q?a=20raiz;=20-=20Tornando=20os=20m=C3=A9todos=20"protected"=20pa?= =?UTF-8?q?ra=20substitui-los=20se=20necess=C3=A1rio;=20-=20Refatorndo=20c?= =?UTF-8?q?=C3=B3digo=20usando=20rector;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Phinx.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Phinx.php b/src/Phinx.php index b806825..863a6a0 100644 --- a/src/Phinx.php +++ b/src/Phinx.php @@ -31,7 +31,7 @@ private function getConfigPopulate() { return $this->getModule('Db')->_getConfig('populate'); } - private function getSeedConfig() { + private function getSeedConfig(): bool { return $this->getConfigBool('seed'); } @@ -46,9 +46,8 @@ private function getConfigBool(string $config): bool { /** * @param string $environment - * @param bool $seed */ - private function phinx($environment, $seed): void { + private function phinx($environment, bool $seed): void { $config = $this->findConfigPath(); if ($config === null) { return; From 1b420ef965100651e00e63746aad015b89d20748 Mon Sep 17 00:00:00 2001 From: Ricardo Paes Date: Mon, 24 Nov 2025 15:09:44 -0300 Subject: [PATCH 4/6] =?UTF-8?q?=F0=9F=92=9A=20[GEST-3244]=20Corrigindo=20e?= =?UTF-8?q?rros=20CI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docker-compose.wait.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 docker-compose.wait.yml diff --git a/docker-compose.wait.yml b/docker-compose.wait.yml new file mode 100644 index 0000000..8c28c6c --- /dev/null +++ b/docker-compose.wait.yml @@ -0,0 +1,11 @@ +networks: + default: + driver: bridge + +services: + + wait: + image: jwilder/dockerize:latest + command: -wait tcp://php:9000 -timeout 120s + networks: + - default From 3db1d9647eee56ae3f9ec78b6bec13558a33c738 Mon Sep 17 00:00:00 2001 From: Ricardo Paes Date: Mon, 24 Nov 2025 15:19:18 -0300 Subject: [PATCH 5/6] =?UTF-8?q?=F0=9F=92=9A=20[GEST-3244]=20Corrigindo=20e?= =?UTF-8?q?rros=20CI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docker-compose.wait.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docker-compose.wait.yml b/docker-compose.wait.yml index 8c28c6c..788d847 100644 --- a/docker-compose.wait.yml +++ b/docker-compose.wait.yml @@ -1,5 +1,6 @@ networks: - default: + github: + name: github driver: bridge services: @@ -8,4 +9,4 @@ services: image: jwilder/dockerize:latest command: -wait tcp://php:9000 -timeout 120s networks: - - default + - github From 895f721649d0ad1743f41541977aca32c346bdc5 Mon Sep 17 00:00:00 2001 From: Ricardo Paes Date: Mon, 24 Nov 2025 15:27:00 -0300 Subject: [PATCH 6/6] =?UTF-8?q?=F0=9F=92=9A=20[GEST-3244]=20Corrigindo=20e?= =?UTF-8?q?rros=20CI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yml | 8 ++++++++ composer.json | 7 +------ docker-compose.yml | 1 - src/Phinx.php | 6 +++--- 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2123a00..fc17971 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,6 +18,14 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Prepare code + env: + PHP_VERSION: ${{ matrix.PHP }} + run: | + touch .env + echo "GITHUB_TOKEN=${{ secrets.GH_TOKEN }}" >> .env + echo "PHP_VERSION=$PHP_VERSION" >> .env + - name: Up environment run: | docker compose up -d diff --git a/composer.json b/composer.json index bd3e974..dfc0ada 100644 --- a/composer.json +++ b/composer.json @@ -2,9 +2,6 @@ "name": "likesistemas/codeception-phinx-module", "type": "library", "description": "Integração com phinx usando codeception.", - "repositories": [ - {"type": "composer", "url": "https://composer.likesistemas.com.br/"} - ], "require": { "php": ">=7.4", "robmorgan/phinx": ">=0.10" @@ -17,7 +14,6 @@ "phpstan/phpstan": "^2.0", "rector/rector": "^2.0", "php-parallel-lint/php-parallel-lint": "^1.4", - "maglnet/composer-require-checker": "^3.8 || ^4.16", "symplify/easy-coding-standard": "^12.6" }, "autoload": { @@ -47,7 +43,6 @@ "analyse": "phpstan analyse", "refactor": "rector process", "refactor:ci": "rector process --dry-run", - "lint": "parallel-lint --colors --exclude vendor/ .", - "reqs": "composer-require-checker check composer.json" + "lint": "parallel-lint --colors --exclude vendor/ ." } } diff --git a/docker-compose.yml b/docker-compose.yml index 050df30..c76f757 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -10,7 +10,6 @@ services: image: likesistemas/php-dev:${PHP_VERSION:-56} environment: - GITHUB_TOKEN=$GITHUB_TOKEN - - URL_SENTRY=${URL_SENTRY} - DB_HOST=mysql - DB_MIGRATE=false volumes: diff --git a/src/Phinx.php b/src/Phinx.php index 863a6a0..ac0cca8 100644 --- a/src/Phinx.php +++ b/src/Phinx.php @@ -45,9 +45,9 @@ private function getConfigBool(string $config): bool { } /** - * @param string $environment - */ - private function phinx($environment, bool $seed): void { + * @param string $environment + */ + private function phinx($environment, bool $seed): void { $config = $this->findConfigPath(); if ($config === null) { return;