Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
}
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
GITHUB_TOKEN=
PHP_VERSION=56|73|74|80|81|82|83
PHP_VERSION=74|80|81|82|83
DB_ENGINE=
28 changes: 21 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
test:
strategy:
matrix:
PHP: [56, 74, 80, 81, 82, 83]
PHP: [74, 80, 81, 82, 83]
runs-on: ubuntu-latest

steps:
Expand All @@ -26,23 +26,37 @@ jobs:
echo "GITHUB_TOKEN=${{ secrets.GH_TOKEN }}" >> .env
echo "PHP_VERSION=$PHP_VERSION" >> .env

- name: Prepare environment
- name: Up environment
run: |
docker compose up -d
echo $(docker run -t --network github jwilder/dockerize -wait tcp://php:9000 -timeout 120s)

- name: Wait environment
run: |
echo $(docker compose -f docker-compose.wait.yml run --rm wait)

- name: Environment logs
run: |
docker compose ps
docker compose logs php

- name: Run PHP Unit
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
docker compose exec -T php rm -Rf vendor/ .env
docker compose down --remove-orphans
4 changes: 0 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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/
53 changes: 0 additions & 53 deletions .php-cs-fixer.php

This file was deleted.

58 changes: 0 additions & 58 deletions .php_cs

This file was deleted.

3 changes: 2 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
}
21 changes: 12 additions & 9 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@
"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": ">=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",
"symplify/easy-coding-standard": "^12.6"
},
"autoload": {
"psr-4": {
Expand All @@ -34,12 +34,15 @@
}
],
"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/ ."
}
}
2 changes: 1 addition & 1 deletion db/migrations/20220623110507_my_new_migration.php
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
12 changes: 12 additions & 0 deletions docker-compose.wait.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
networks:
github:
name: github
driver: bridge

services:

wait:
image: jwilder/dockerize:latest
command: -wait tcp://php:9000 -timeout 120s
networks:
- github
1 change: 0 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
36 changes: 36 additions & 0 deletions ecs.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?php

use PhpCsFixer\Fixer\ArrayNotation\ArraySyntaxFixer;
use PhpCsFixer\Fixer\Basic\CurlyBracesPositionFixer;
use PhpCsFixer\Fixer\ClassNotation\VisibilityRequiredFixer;
use Symplify\CodingStandard\Fixer\Annotation\RemovePHPStormAnnotationFixer;
use Symplify\EasyCodingStandard\Config\ECSConfig;
use Symplify\EasyCodingStandard\ValueObject\Option;
use Symplify\EasyCodingStandard\ValueObject\Set\SetList;

return ECSConfig::configure()
->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']]
);
17 changes: 0 additions & 17 deletions phpunit.xml

This file was deleted.

23 changes: 23 additions & 0 deletions rector.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php

declare(strict_types=1);

use Rector\ValueObject\PhpVersion;
use Rector\Config\RectorConfig;
use Rector\Set\ValueObject\SetList;

return RectorConfig::configure()
->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,
]);
Loading