Likelihood Of Impact: Medium
The phplrt/grammar and phplrt/grammar-contracts has been removed. All
classes and interfaces associated with this package have been moved inside
the phplrt/parser package.
- All classes
Phplrt\Grammar\*has been renamed toPhplrt\Parser\Grammar\*. - All interfaces
Phplrt\Contracts\Grammar\*has been renamed toPhplrt\Parser\Grammar\*.
Likelihood Of Impact: Medium
- Interface
Phplrt\Contracts\Lexer\BufferInterfacehas been moved intoPhplrt\Buffer\BufferInterface. - All classes
Phplrt\Lexer\Buffer\*has been moved intoPhplrt\Buffer\*.
Likelihood Of Impact: Medium
PHP 7.1 will no longer be actively maintained as of December 2019. Therefore, phplrt 3.0 requires PHP 7.4 or greater.
Likelihood Of Impact: Medium
The compiler code generation in the full-fledged PHP class has been removed and has been replaced by the generation of configs.
$compiler = new \Phplrt\Compiler\Compiler();
/** @var \Phplrt\Compiler\Generator $assembly */
$assembly = $compiler->build();- Method
Phplrt\Compiler\Generator::generateGrammar(string $class): stringhas been removed. - Method
Phplrt\Compiler\Generator::generateBuilder(string $class): stringhas been removed. - Method
Phplrt\Compiler\Generator::generate(string $class): stringhas been modified toPhplrt\Compiler\Generator::generate(): string.
echo $assembly->generate('ClassName');
// class ClassName extends Parser
// {
// ...
// }echo $assembly->generate();
// return [
// 'tokens' => [...],
// 'rules' => [...],
// ...etc
// ];Likelihood Of Impact: Low
The Zend project has been abandoned and is no longer supported: https://getlaminas.org/blog/2019-12-31-out-with-the-old-in-with-the-new.html
Likelihood Of Impact: Medium
In the phplrt 2.3, calling the prependMany() method added tokens by default
in the following order:
$lexer->prependMany([
'a' => 'a',
'b' => 'b',
'c' => 'c',
]);
// phplrt 2.3 lexer's data:
// [
// 'c' => 'c',
// 'b' => 'b',
// 'a' => 'a',
// ]
// New behavior:
// [
// 'a' => 'a',
// 'b' => 'b',
// 'c' => 'c',
// ]In order to return to the old behavior, explicit transfer of the second argument is required:
$lexer->prependMany([
'a' => 'a',
'b' => 'b',
'c' => 'c',
], true);
// Expected token definitions:
// [
// 'c' => 'c',
// 'b' => 'b',
// 'a' => 'a',
// ]