Git Product home page Git Product logo

Comments (6)

michnovka avatar michnovka commented on June 26, 2024

I did check for any stubs used, but in the whole project there is no stub for TwigFilter class. I do use psalm/plugin-symfony v 5.1.0, but this stub is not there. So Id assume it reads signature from the source code (vendor/twig/twig/src/TwigFilter.php)

from psalm.

michnovka avatar michnovka commented on June 26, 2024

Also please note that this syntax is in line with official Symfony docs for Lazy loaded twig extensions

from psalm.

michnovka avatar michnovka commented on June 26, 2024

This error is showing up on more places now. E.g. in the Syfony\Console\Command\Command::setCode() function.

ERROR: InvalidArgument - src/Command/AbstractEndlessCommand.php:55:25 - Argument 1 of Symfony\Component\Console\Command\Command::setCode expects a public callable, but a non-public callable provided (see https://psalm.dev/004)
        parent::setCode([$this, 'runloop']);

when I use protected modifier for function runloop. I repeat, there is no psalm param specification requiring that the callable should be public, nonstatic or whatever. Only callable. And I am unable to reproduce this on psalm.dev - https://psalm.dev/r/3c405968f1

Version 5.23 works just fine

from psalm.

psalm-github-bot avatar psalm-github-bot commented on June 26, 2024

I found these snippets:

https://psalm.dev/r/3c405968f1
<?php

class Command{
    /**
     * @param callable $code
     */
	public function setCode(callable $code): static
    {
        return $this;
    }
}

class Code extends Command{
    public function __construct(){
        parent::setCode([$this, 'runCode']);
    }
    
    protected function runCode(): void
    {}
}
Psalm output (using commit 16b24bd):

No issues!

from psalm.

michnovka avatar michnovka commented on June 26, 2024

Aha, the reason why I cannot reproduce this issue on psalm.dev is because it uses this version:

https://github.com/vimeo/psalm/blob/16b24bdc94e052b5ce69fd232a77416a1f6ec3e6/src/Psalm/Internal/Analyzer/Statements/Expression/Call/ArgumentAnalyzer.php

Which does not contain the breaking PR #10839

@weirdan can you please look into this, as you reviewed the change and also it seems you are in charge of merging code into master branch, which is what psalm.dev uses?

from psalm.

VincentLanglet avatar VincentLanglet commented on June 26, 2024

You can close the issue because it's already fixed in #10935.

Just wait for a new release.

from psalm.

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.