-
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.
* Update min PHP version to 8 * Add more linters * Update type-hinting system to PHPDoc/PHPStan * Rework casting logic + a few bug fixes
- Loading branch information
Showing
16 changed files
with
216 additions
and
166 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 |
---|---|---|
@@ -1,3 +1,7 @@ | ||
/tests export-ignore | ||
.github export-ignore | ||
phpunit.xml.dist export-ignore | ||
.github/ export-ignore | ||
tests/ export-ignore | ||
.gitattributes export-ignore | ||
.gitignore export-ignore | ||
.php-cs-fixer.dist.php export-ignore | ||
phpstan.dist.neon export-ignore | ||
phpunit.dist.xml export-ignore |
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,5 +1,8 @@ | ||
/vendor | ||
.phpunit.result.cache | ||
.php-cs-fixer.cache | ||
phpstan.neon | ||
phpunit.xml | ||
.idea | ||
composer.lock | ||
coverage.xml |
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,14 @@ | ||
<?php | ||
|
||
return (new PhpCsFixer\Config()) | ||
->setRiskyAllowed(true) | ||
->setParallelConfig(PhpCsFixer\Runner\Parallel\ParallelConfigFactory::detect()) | ||
->setRules([ | ||
'@PER-CS2.0' => true, | ||
'@PER-CS2.0:risky' => true, | ||
'trailing_comma_in_multiline' => false, | ||
]) | ||
->setFinder( | ||
(new PhpCsFixer\Finder()) | ||
->in(__DIR__) | ||
); |
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 |
---|---|---|
|
@@ -9,6 +9,16 @@ | |
"email": "[email protected]" | ||
} | ||
], | ||
"require": { | ||
"php": "^8" | ||
}, | ||
"require-dev": { | ||
"ergebnis/composer-normalize": "^2.7", | ||
"friendsofphp/php-cs-fixer": "^3.3", | ||
"phpstan/phpstan": "^1.4", | ||
"phpunit/phpunit": "^9 || ^10 || ^11", | ||
"roave/security-advisories": "dev-latest" | ||
}, | ||
"autoload": { | ||
"psr-4": { | ||
"uuf6429\\Castable\\": "src/" | ||
|
@@ -22,10 +32,23 @@ | |
"uuf6429\\Castable\\": "tests/" | ||
} | ||
}, | ||
"require": { | ||
"php": "^5.6 || ^7 || ^8" | ||
"config": { | ||
"allow-plugins": { | ||
"ergebnis/composer-normalize": true | ||
}, | ||
"process-timeout": 0 | ||
}, | ||
"require-dev": { | ||
"phpunit/phpunit": "^5 | ^6 | ^7 | ^8 | ^9" | ||
"scripts": { | ||
"lint": [ | ||
"composer normalize --dry-run", | ||
"composer exec phpstan -- analyse --no-progress", | ||
"composer exec php-cs-fixer -- fix --dry-run --show-progress=none --diff" | ||
], | ||
"lint:fix": [ | ||
"composer normalize", | ||
"composer exec php-cs-fixer -- fix --diff" | ||
], | ||
"test": "phpunit ./tests/", | ||
"test:cover": "@php -dzend_extension=php_xdebug -dxdebug.mode=coverage vendor/bin/phpunit --coverage-clover coverage.xml ./tests/" | ||
} | ||
} |
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,14 @@ | ||
parameters: | ||
level: 9 | ||
paths: | ||
- src | ||
- tests | ||
ignoreErrors: | ||
- | ||
message: "#^Function uuf6429\\\\Castable\\\\cast\\(\\) should return T but returns object\\.$#" | ||
count: 1 | ||
path: src/functions.php | ||
- | ||
message: "#^Unable to resolve the template type T in call to method uuf6429\\\\Castable\\\\Castable\\:\\:castTo\\(\\)$#" | ||
count: 1 | ||
path: src/functions.php |
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,13 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<phpunit colors="true" failOnRisky="true"> | ||
<testsuites> | ||
<testsuite name="All Tests"> | ||
<directory>./tests/</directory> | ||
</testsuite> | ||
</testsuites> | ||
<source> | ||
<include> | ||
<directory suffix=".php">./src/</directory> | ||
</include> | ||
</source> | ||
</phpunit> |
This file was deleted.
Oops, something went wrong.
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
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
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.