Giter Club home page Giter Club logo

Comments (10)

spaze avatar spaze commented on August 15, 2024

I'm using callbacks as filters

foreach ($this->filters->getAll() as $name => $callback) {
$template->addFilter($name, $callback);
}

And it seems to be not yet supported:

Internal error: Internal error: PHPStan\Reflection\BetterReflection\Reflector\MemoizingReflector::reflectClass(): Argument #1 ($className) must be of type string, MichalSpacekCz\Templating\Filters given, called in michalspacek.cz/site/vendor/efabrica/phpstan-latte/src/VariableCollector/DynamicFilterVariables.php on line 64 in
file michalspacek.cz/site/app/Form/TrainingApplicationPreliminaryFormFactory.php

Post the following stack trace to https://github.com/phpstan/phpstan/issues/new?template=Bug_report.md:
#0 michalspacek.cz/site/vendor/efabrica/phpstan-latte/src/VariableCollector/DynamicFilterVariables.php(64): PHPStan\Reflection\BetterReflection\Reflector\MemoizingReflector->reflectClass(Object(MichalSpacekCz\Templating\Filters))

Maybe the support will be added in efabrica-team/phpstan-latte#120

from michalspacek.cz.

MartinMystikJonas avatar MartinMystikJonas commented on August 15, 2024

I'm using callbacks as filters

foreach ($this->filters->getAll() as $name => $callback) {
$template->addFilter($name, $callback);
}

And it seems to be not yet supported:

Internal error: Internal error: PHPStan\Reflection\BetterReflection\Reflector\MemoizingReflector::reflectClass(): Argument #1 ($className) must be of type string, MichalSpacekCz\Templating\Filters given, called in michalspacek.cz/site/vendor/efabrica/phpstan-latte/src/VariableCollector/DynamicFilterVariables.php on line 64 in
file michalspacek.cz/site/app/Form/TrainingApplicationPreliminaryFormFactory.php

Post the following stack trace to https://github.com/phpstan/phpstan/issues/new?template=Bug_report.md:
#0 michalspacek.cz/site/vendor/efabrica/phpstan-latte/src/VariableCollector/DynamicFilterVariables.php(64): PHPStan\Reflection\BetterReflection\Reflector\MemoizingReflector->reflectClass(Object(MichalSpacekCz\Templating\Filters))

Maybe the support will be added in efabrica-team/phpstan-latte#120

Callback filters should be supported. Mentioned error seems like some error with trying to access reflection of unknown class. Could you create issue and post stack trace? I will look at it.

from michalspacek.cz.

MartinMystikJonas avatar MartinMystikJonas commented on August 15, 2024

Oh I see the problem now. Autodetect of filters from engine do not convert callable [object, method] to correct [class, method] we need later. I will fix it.

from michalspacek.cz.

spaze avatar spaze commented on August 15, 2024

Oh I see the problem now. Autodetect of filters from engine do not convert callable [object, method] to correct [class, method] we need later. I will fix it.

Yeah, thank you! :-)

from michalspacek.cz.

lulco avatar lulco commented on August 15, 2024

Please share with us all of your problems and also success stories. Feedback is welcome.

from michalspacek.cz.

spaze avatar spaze commented on August 15, 2024

Please share with us all of your problems and also success stories. Feedback is welcome.

Thank you, I will!

from michalspacek.cz.

lulco avatar lulco commented on August 15, 2024

Any issue we can help with?

from michalspacek.cz.

spaze avatar spaze commented on August 15, 2024

I haven't had a chance to look at the news in the extension yet (but hey, I have an excuse: "I'm waiting for a release" 😅) but I see you don't need me 😂

@lulco How did you find efabrica-team/phpstan-latte#191?

from michalspacek.cz.

lulco avatar lulco commented on August 15, 2024

I forked your branch, because I was curious why it's not working in your CI.

I did some changes and it starts working. So now we will try to fix these issues and then maybe make some release :)

from michalspacek.cz.

spaze avatar spaze commented on August 15, 2024

I see, thanks. I think the main reason it's not working is that I required 0.x release 😅 But thanks for looking into it! 👍

Btw, love the issue title 😂

Some of the issues reported are definitely mine (and that's why I want to use the extension)

from michalspacek.cz.

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.