-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
[BUG]: PHPStan static analysis ends up with internal errors #16023
Comments
After several tests with different versions of PHP, Phalcon and PHPStan. It seems that error is not in Phalcon, but in PHPStan, since version According to this blog post - https://phpstan.org/blog/zero-config-analysis-with-static-reflection, since version |
Related phpstan/phpstan#7590 |
My personal guess is that Phalcon uses some method name like I've added a bit more debugging capability to PHPStan so it should tell us what's the problem. |
The root issue here is that The |
Thank you! I'll check it. |
#16023 - Improve object return type
$stubber = new \Roave\BetterReflection\SourceLocator\SourceStubber\ReflectionSourceStubber();
$data = $stubber->generateClassStub(\Phalcon\Events\Event::class);
echo $data->getStub(); Now it generates correct stubs: <?php
namespace Phalcon\Events;
class Event implements \Phalcon\Events\EventInterface
{
protected $cancelable = null;
protected $data = null;
protected $source = null;
protected $stopped = false;
protected $type = null;
public function getData()
{
}
public function getType() : string
{
}
public function __construct(string $type, $source, $data, bool $cancelable)
{
}
public function isCancelable() : bool
{
}
public function isStopped() : bool
{
}
public function getSource() : ?object
{
}
public function setData($data) : \Phalcon\Events\EventInterface
{
}
public function setType(string $type) : \Phalcon\Events\EventInterface
{
}
public function stop() : \Phalcon\Events\EventInterface
{
}
} |
Resolved in #16066 |
Released in |
Describe the bug
We've upgraded to phalcon 5.0.0-RC3 and PHP8.1 on our projects and we have troubles with running static analysis on it. Currently found problems:
Phalcon\Events\Event
fails withPhalcon\Mvc\Model
ends up withChild process error (exit code 139): Segmentation fault (core dumped)
Unfortunately I couldn't get anything more specific than this message. I wrote an issue about the first one to PHPStan and I'm waiting for a response.
To Reproduce
We have not found a problem with Phalcon other than the static analysis file
all you need is just mention the class in the analysed class and then when you run
vendor/bin/phpstan analyse ./sourcepath
it failsExpected behavior
PHPStan analysis ends up with zero internal errors caused by using Phalcon
The text was updated successfully, but these errors were encountered: