Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow php 8.3 and add it to github actions #102

Merged
merged 1 commit into from
Nov 2, 2023
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/unittests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
strategy:
matrix:
os: ['ubuntu-latest']
php: ['8.1', '8.2']
php: ['8.1', '8.2', '8.3']
steps:
- name: Set locales
run: |
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
}
],
"require": {
"php": "^8.1",
"php": "~8.1.0 || ~8.2.0 || ~8.3.0",
"ext-dom": "*",
"ext-gettext": "*",
"ext-simplexml": "*",
Expand All @@ -42,7 +42,7 @@
"friendsofphp/php-cs-fixer": "^3",
"phpstan/phpstan": "^1.3",
"phpunit/phpunit": "^10",
"rector/rector": "^0.15"
"rector/rector": "^0.18"
},
"autoload": {
"classmap": [
Expand Down
26 changes: 11 additions & 15 deletions rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,38 +8,34 @@
use Rector\Php73\Rector\FuncCall\JsonThrowOnErrorRector;
use Rector\Php74\Rector\Closure\ClosureToArrowFunctionRector;
use Rector\Php74\Rector\LNumber\AddLiteralSeparatorToNumberRector;
use Rector\Php80\Rector\FunctionLike\UnionTypesRector;
use Rector\PostRector\Rector\NameImportingPostRector;
use Rector\Set\ValueObject\LevelSetList;
use Rector\Set\ValueObject\SetList;

return static function (RectorConfig $rector_config): void {
return static function (RectorConfig $rectorConfig): void {
// Define paths to process
$rector_config->paths([
$rectorConfig->paths([
'src/',
'tests/'
]);

// import all kind of names
$rector_config->importNames();
$rectorConfig->importNames();

// Define what rule sets will be applied
$rector_config->import(SetList::DEAD_CODE);
$rector_config->skip([
$rectorConfig->import(SetList::DEAD_CODE);
$rectorConfig->skip([
StringClassNameToClassConstantRector::class,
UnionTypesRector::class,
JsonThrowOnErrorRector::class,
]);

// define sets of rules
$rector_config->sets([
$rectorConfig->sets([
LevelSetList::UP_TO_PHP_81,
]);

$services = $rector_config->services();

$services->set(IntvalToTypeCastRector::class);
$services->set(AddLiteralSeparatorToNumberRector::class);
$services->set(ClosureToArrowFunctionRector::class);
$services->set(NameImportingPostRector::class);
$rectorConfig->rules([
IntvalToTypeCastRector::class,
AddLiteralSeparatorToNumberRector::class,
ClosureToArrowFunctionRector::class,
]);
};
2 changes: 1 addition & 1 deletion src/PHPTAL.php
Original file line number Diff line number Diff line change
Expand Up @@ -878,7 +878,7 @@ public function prepare(): PhpTalInterface

// greedy .* ensures last match
$line = preg_match('/.*on line (\d+)$/m', $msg, $m) ? $m[1] : 0;
throw new Exception\TemplateException(trim($msg), $this->getCodePath(), $line);
throw new Exception\TemplateException(trim($msg), $this->getCodePath(), (int) $line);
}
ob_end_clean();
} else {
Expand Down