Git Product home page Git Product logo

Comments (8)

pavarnos avatar pavarnos commented on June 5, 2024

Also for parameters passed to constructors.

    public function __construct(TaskRepository $repository)
    {
        parent::__construct(
            new class($repository) extends AbstractCommand
            {
                /** @var \ISV\Repository\Team\Checklist\TaskRepository */
                private $repository;

                public function __construct(TaskRepository $repository)
                {
                    $this->repository = $repository;
                }
                // .. etc
        );
    }

gives error 28 Property class@anonymous/src/Action/Main/Configure/Expectation/Collection/TaskDe leteAction.php:25::$repository has no typehint specified.
where line 25 is the new class and line 28 is the private $repository

from phpstan-strict-rules.

ondrejmirtes avatar ondrejmirtes commented on June 5, 2024

from phpstan-strict-rules.

ohartl avatar ohartl commented on June 5, 2024

@ondrejmirtes I have the same problem and atleast dev-master @ 5c5e30d did not fix it yet :/

from phpstan-strict-rules.

ohartl avatar ohartl commented on June 5, 2024

This seem related to phpstan/phpstan#1839, I also that only notice this problem with strict-rules on - but it seems like a problem based in phpstan/phpstan.

See this updated example with a docblock before fixed the faulty error reporting https://phpstan.org/r/8db8e022-63bc-4951-b4ce-a6f27e2a2a73

from phpstan-strict-rules.

ondrejmirtes avatar ondrejmirtes commented on June 5, 2024

from phpstan-strict-rules.

ondrejmirtes avatar ondrejmirtes commented on June 5, 2024

@marcospassos For best results, you should always run full PHPStan on all your source code.

from phpstan-strict-rules.

ondrejmirtes avatar ondrejmirtes commented on June 5, 2024

Fixed: phpstan/phpstan@4b52556

from phpstan-strict-rules.

github-actions avatar github-actions commented on June 5, 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-strict-rules.

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.