Giter Site home page Giter Site logo

Test service container about phpstan-symfony HOT 6 CLOSED

phpstan avatar phpstan commented on May 10, 2024
Test service container

from phpstan-symfony.

Comments (6)

lookyman avatar lookyman commented on May 10, 2024 2

Ok, this is trickier than it looks. Fixing it completely would most likely require changes in PHPStan's core, so for now i did 34b1940, which should at least allow you to annotate the container with /**@var \Symfony\Bundle\FrameworkBundle\Test\TestContainer */, and it will stop complaining. Or you can access the container via a method, so you don't have to annotate it everywhere. Something like:

protected function getTestContainer(): \Symfony\Bundle\FrameworkBundle\Test\TestContainer
{
    return self::$container;
}

from phpstan-symfony.

lookyman avatar lookyman commented on May 10, 2024

Thanks, I'll take a look at it as soon as possible.

from phpstan-symfony.

ondrejmirtes avatar ondrejmirtes commented on May 10, 2024

from phpstan-symfony.

lookyman avatar lookyman commented on May 10, 2024

I am also not sure if it can be solved. One possibility might be to ask Scope if we are inside a TestCase. I will have to investigate..

EDIT: They actually have a special container class, so this should be easy.

from phpstan-symfony.

lookyman avatar lookyman commented on May 10, 2024

@ossinkine Could you please test #5 and let me know if it fixes it? Thanks.

EDIT: Nevermind, I will have to rewrite that completely from scratch.

from phpstan-symfony.

github-actions avatar github-actions commented on May 10, 2024

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

from phpstan-symfony.

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.