nette / php-generator

🐘 Generates neat PHP code for you. Supports new PHP 8.3 features.

Home Page:https://doc.nette.org/php-generator

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PhpParser\Lexer\Emulative::__construct(): Argument #1 ($phpVersion) must be of type ?PhpParser\PhpVersion, array given

i0FFLINE opened this issue · comments

Version: 4.1.2

Bug Description

the call does not match the constructor of the third-party package

Steps To Reproduce

$ns = new PhpNamespace("My\Namespace");
$target = ClassType::fromCode(file_get_contents('/path/to/class.php'));

class.php

<?php
namespace My\Namespace;
class Foo {
}

Expected Behavior

No exceptions

Possible Solution

Look into

  • nette/php-generator/src/PhpGenerator/Extractor.php : 50 call
  • nikic/php-parser/lib/PhpParser/Lexer/Emulative.php : 38 constructor
    called in /absolute/path/to/vendor/nette/php-generator/src/PhpGenerator/Extractor.php on line 50`

nikic/php-parser : 5.0.0 released

fixed