Git Product home page Git Product logo

Comments (6)

ondrejmirtes avatar ondrejmirtes commented on June 16, 2024 1

Alright, I understand the issue now. PHPStan does not support conditional clauses in regard to PHP version so it's still going to complain in these situations. It'd require a lot of refactoring to make it understand that.

You can use method_exists which is understood by both PHPStan and PHP 8.3: https://3v4l.org/WAmpt, https://phpstan.org/r/690e2da6-8ad3-4f61-9442-d22971dc836d

Alternatively, you can split the $callable string by :: and call new ReflectionMethod() with 2 arguments.

from phpstan.

ondrejmirtes avatar ondrejmirtes commented on June 16, 2024

I don't yet accept issues for PHP 8.4 as things might change. The work on PHP 8.4 support will start after feature freeze. Thanks for understanding.

from phpstan.

andypost avatar andypost commented on June 16, 2024

But the bug is that function exists in PHP 8.3 but PhpStan complains for no reason

from phpstan.

ondrejmirtes avatar ondrejmirtes commented on June 16, 2024

In the code sample you've provided there's no error on 8.3.

from phpstan.

andypost avatar andypost commented on June 16, 2024

Yes, 3v4l said code valid but playground complains on 8.1/8.2 as the method does not exist but code valid

CI also using PHP 8.3 but fails as composer require 8.1+ https://git.drupalcode.org/project/drupal/-/jobs/1481141

from phpstan.

andypost avatar andypost commented on June 16, 2024

Thank you a lot!

from phpstan.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.