Skip to content
Merged
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
13 changes: 13 additions & 0 deletions bin/swiss-knife.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,19 @@
}
}

// the released tool is downgraded to PHP 7.2, but the bundled nikic/php-parser
// references PHP 7.4 token constants directly - define them to avoid fatal errors
// (see https://github.com/easy-coding-standard/ecs/blob/main/bin/ecs.php for the same approach)
if (! defined('T_FN')) {
define('T_FN', 5025);
}
if (! defined('T_COALESCE_EQUAL')) {
define('T_COALESCE_EQUAL', 5030);
}
if (! defined('T_BAD_CHARACTER')) {
define('T_BAD_CHARACTER', 5035);
}
Comment on lines +33 to +41

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

imo, this should be equal with php 8.+ values:

php > echo T_FN;
311
php > echo T_COALESCE_EQUAL;
367
php > echo T_BAD_CHARACTER;
409

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't really matter, as it's a placeholder value. If it's not existing token value.

5xxx are reserved


$containerFactory = new ContainerFactory();
$container = $containerFactory->create();

Expand Down
Loading