-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #98 from milan-miscevic/upgrade
General upgrade
- Loading branch information
Showing
19 changed files
with
3,020 additions
and
534 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
end_of_line = lf | ||
indent_size = 4 | ||
indent_style = space | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
|
||
[Makefile] | ||
indent_style = tab | ||
|
||
[*.yml] | ||
indent_size = 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: composer | ||
- package-ecosystem: "composer" | ||
directory: "/" | ||
open-pull-requests-limit: 10 | ||
schedule: | ||
interval: daily | ||
interval: "daily" | ||
time: "04:00" | ||
open-pull-requests-limit: 10 | ||
versioning-strategy: "increase" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
name: "Test" | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- "master" | ||
push: | ||
branches: | ||
- "master" | ||
|
||
jobs: | ||
mutation: | ||
name: "Infection mutation testing" | ||
runs-on: "ubuntu-latest" | ||
|
||
strategy: | ||
matrix: | ||
php-version: | ||
- "8.1" | ||
|
||
steps: | ||
- uses: "shivammathur/[email protected]" | ||
with: | ||
php-version: "${{ matrix.php-version }}" | ||
- uses: "actions/checkout@v2" | ||
- uses: "php-actions/composer@v1" | ||
- run: "vendor/bin/infection --min-msi=80" | ||
|
||
phpstan: | ||
name: "PHPStan static analysis" | ||
runs-on: "ubuntu-latest" | ||
|
||
strategy: | ||
matrix: | ||
php-version: | ||
- "8.1" | ||
|
||
steps: | ||
- uses: "shivammathur/[email protected]" | ||
with: | ||
php-version: "${{ matrix.php-version }}" | ||
- uses: "actions/checkout@v2" | ||
- uses: "php-actions/composer@v1" | ||
- run: "vendor/bin/phpstan analyse" | ||
|
||
psalm: | ||
name: "Psalm static analysis" | ||
runs-on: "ubuntu-latest" | ||
|
||
strategy: | ||
matrix: | ||
php-version: | ||
- "8.1" | ||
|
||
steps: | ||
- uses: "shivammathur/[email protected]" | ||
with: | ||
php-version: "${{ matrix.php-version }}" | ||
- uses: "actions/checkout@v2" | ||
- uses: "php-actions/composer@v1" | ||
- run: "vendor/bin/psalm --show-info=true --shepherd" | ||
|
||
standards: | ||
name: "PHP-CS-Fixer coding standards" | ||
runs-on: "ubuntu-latest" | ||
|
||
strategy: | ||
matrix: | ||
php-version: | ||
- "8.1" | ||
|
||
steps: | ||
- uses: "shivammathur/[email protected]" | ||
with: | ||
php-version: "${{ matrix.php-version }}" | ||
- uses: "actions/checkout@v2" | ||
- uses: "php-actions/composer@v1" | ||
- run: "vendor/bin/php-cs-fixer fix --dry-run -v" | ||
|
||
unit: | ||
name: "PHPUnit unit tests" | ||
runs-on: "ubuntu-latest" | ||
|
||
strategy: | ||
matrix: | ||
php-version: | ||
- "7.4" | ||
- "8.0" | ||
- "8.1" | ||
|
||
steps: | ||
- uses: "shivammathur/[email protected]" | ||
with: | ||
php-version: "${{ matrix.php-version }}" | ||
- uses: "actions/checkout@v2" | ||
- uses: "php-actions/composer@v1" | ||
- run: "vendor/bin/phpunit" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
/.php_cs.cache | ||
/.php-cs-fixer.cache | ||
/.phpunit.result.cache | ||
/.vscode | ||
/infection.json | ||
/phpstan.neon | ||
/phpunit.xml | ||
/vendor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
<?php | ||
|
||
$finder = PhpCsFixer\Finder::create() | ||
->in(__DIR__ . '/src') | ||
->in(__DIR__ . '/tests') | ||
; | ||
|
||
return (new PhpCsFixer\Config()) | ||
->setRules([ | ||
'@PSR2' => true, | ||
'array_indentation' => true, | ||
'array_syntax' => true, | ||
'binary_operator_spaces' => [ | ||
'operators' => [ | ||
'=>' => 'single_space', | ||
] | ||
], | ||
'blank_line_after_opening_tag' => true, | ||
'concat_space' => [ | ||
'spacing' => 'one', | ||
], | ||
'declare_strict_types' => true, | ||
'general_phpdoc_annotation_remove' => [ | ||
'annotations' => [ | ||
'author', | ||
], | ||
], | ||
'include' => true, | ||
'method_chaining_indentation' => true, | ||
'modernize_types_casting' => true, | ||
'new_with_braces' => true, | ||
'no_empty_statement' => true, | ||
'no_empty_comment' => true, | ||
'no_empty_phpdoc' => true, | ||
'no_extra_blank_lines' => true, | ||
'no_leading_import_slash' => true, | ||
'no_leading_namespace_whitespace' => true, | ||
'no_singleline_whitespace_before_semicolons' => true, | ||
'no_superfluous_phpdoc_tags' => [ | ||
'remove_inheritdoc' => true, | ||
], | ||
'no_trailing_comma_in_singleline_array' => true, | ||
'no_unused_imports' => true, | ||
'no_whitespace_in_blank_line' => true, | ||
'object_operator_without_whitespace' => true, | ||
'ordered_imports' => true, | ||
'phpdoc_line_span' => [ | ||
'property' => 'single', | ||
], | ||
'return_type_declaration' => [ | ||
'space_before' => 'none', | ||
], | ||
'single_blank_line_before_namespace' => true, | ||
'ternary_operator_spaces' => true, | ||
'trailing_comma_in_multiline' => true, | ||
]) | ||
->setRiskyAllowed(true) | ||
->setFinder($finder) | ||
; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
DOCKER=docker-compose -f ./docker/docker-compose.yml | ||
PHP=php81-cli | ||
|
||
coverage: | ||
$(DOCKER) run --rm $(PHP) php -dxdebug.mode=coverage ./vendor/bin/phpunit --coverage-text | ||
|
||
fix: | ||
$(DOCKER) run --rm $(PHP) ./vendor/bin/php-cs-fixer fix | ||
|
||
install: | ||
$(DOCKER) build | ||
$(DOCKER) run --rm $(PHP) composer install | ||
|
||
mutation: | ||
$(DOCKER) run --rm $(PHP) ./vendor/bin/infection --min-msi=80 | ||
|
||
phpstan: | ||
$(DOCKER) run --rm $(PHP) ./vendor/bin/phpstan analyse | ||
|
||
psalm: | ||
$(DOCKER) run --rm $(PHP) ./vendor/bin/psalm --show-info=true | ||
|
||
standards: | ||
$(DOCKER) run --rm $(PHP) ./vendor/bin/php-cs-fixer fix --dry-run -v | ||
|
||
test: standards unit phpstan psalm mutation | ||
|
||
unit: | ||
$(DOCKER) run --rm php74-cli ./vendor/bin/phpunit | ||
$(DOCKER) run --rm php80-cli ./vendor/bin/phpunit | ||
$(DOCKER) run --rm $(PHP) ./vendor/bin/phpunit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,33 @@ | ||
{ | ||
"name": "milan-miscevic/folder", | ||
"description": "A folder scanner", | ||
"description": "Folder scanner", | ||
"license": "MIT", | ||
"type": "library", | ||
"keywords": [ | ||
"scanner", | ||
"folder", | ||
"active-folder", | ||
"relative-path", | ||
"absolute-path", | ||
"active-folder", | ||
"files", | ||
"folder", | ||
"folders", | ||
"files" | ||
"relative-path", | ||
"scanner" | ||
], | ||
"license": "MIT", | ||
"authors": [ | ||
{ | ||
"name": "Milan Miščević", | ||
"email": "[email protected]" | ||
} | ||
], | ||
"require": { | ||
"php": "^7.2" | ||
"php": "^7.4 || ^8" | ||
}, | ||
"require-dev": { | ||
"friendsofphp/php-cs-fixer": "^2 || ^3", | ||
"phpstan/phpstan": "^0.12 || ^1.0", | ||
"phpunit/phpunit": "^8" | ||
"friendsofphp/php-cs-fixer": "^3.7.0", | ||
"infection/infection": "^0.26.6", | ||
"phpstan/phpstan": "^1.4.9", | ||
"phpstan/phpstan-strict-rules": "^1.1", | ||
"phpunit/phpunit": "^9.5.18", | ||
"vimeo/psalm": "^4.22.0" | ||
}, | ||
"autoload": { | ||
"psr-4": { | ||
|
@@ -37,12 +40,7 @@ | |
} | ||
}, | ||
"config": { | ||
"allow-plugins": {}, | ||
"sort-packages": true | ||
}, | ||
"scripts": { | ||
"coverage": "phpunit --coverage-text", | ||
"fix": "php-cs-fixer fix", | ||
"phpstan": "phpstan analyse", | ||
"test": "phpunit" | ||
} | ||
} |
Oops, something went wrong.