Aggiornato Composer

This commit is contained in:
Paolo A
2024-05-17 12:24:19 +00:00
parent 4ac62108b5
commit ec201d75b2
2238 changed files with 38684 additions and 59785 deletions

View File

@@ -2,6 +2,12 @@
All notable changes are documented in this file using the [Keep a CHANGELOG](https://keepachangelog.com/) principles.
## [1.0.4] - 2023-12-22
### Changed
* This component is now compatible with `nikic/php-parser` 5.0
## [1.0.3] - 2020-11-28
### Fixed
@@ -28,6 +34,7 @@ All notable changes are documented in this file using the [Keep a CHANGELOG](htt
* Initial release
[1.0.4]: https://github.com/sebastianbergmann/lines-of-code/compare/1.0.3...1.0.4
[1.0.3]: https://github.com/sebastianbergmann/lines-of-code/compare/1.0.2...1.0.3
[1.0.2]: https://github.com/sebastianbergmann/lines-of-code/compare/1.0.1...1.0.2
[1.0.1]: https://github.com/sebastianbergmann/lines-of-code/compare/1.0.0...1.0.1

View File

@@ -17,7 +17,7 @@
"prefer-stable": true,
"require": {
"php": ">=7.3",
"nikic/php-parser": "^4.6"
"nikic/php-parser": "^4.18 || ^5.0"
},
"require-dev": {
"phpunit/phpunit": "^9.3"

View File

@@ -11,10 +11,8 @@ namespace SebastianBergmann\LinesOfCode;
use function substr_count;
use PhpParser\Error;
use PhpParser\Lexer;
use PhpParser\Node;
use PhpParser\NodeTraverser;
use PhpParser\Parser;
use PhpParser\ParserFactory;
final class Counter
@@ -39,7 +37,7 @@ final class Counter
}
try {
$nodes = $this->parser()->parse($source);
$nodes = (new ParserFactory)->createForHostVersion()->parse($source);
assert($nodes !== null);
@@ -83,9 +81,4 @@ final class Counter
return $visitor->result();
}
private function parser(): Parser
{
return (new ParserFactory)->create(ParserFactory::PREFER_PHP7, new Lexer);
}
}