Giter VIP home page Giter VIP logo

Comments (8)

shochdoerfer avatar shochdoerfer commented on August 26, 2024

Thanks for opening your first issue. Fancy opening your first PR to fix this? ;)

Technically we don't support this setup anymore, in fact, what should not work when you do it like this is the extension attribute support. Since we rely on the Composer autoloader to check if a class or an interface exists, this will not work if you separate the phpstan/phpstan-magento installation from the Magento installation. If you don't care about extension attributes, the setup will work for you (but might break in future releases).

I would have loved to keep supporting this way but I could not find a way to reliably check if a class or interface exists.

from phpstan-magento.

evs-xsarus avatar evs-xsarus commented on August 26, 2024

@shochdoerfer if you could point to me the logic to check extension attributes, I'll have a look.

from phpstan-magento.

evs-xsarus avatar evs-xsarus commented on August 26, 2024

PS My .phpstan.neon is setup like:

parameters:
    level: 7
    fileExtensions:
        - php
    paths:
        - app/code/
        - app/design/

    reportUnmatchedIgnoredErrors: false

    checkMissingIterableValueType: false

    ignoreErrors:
        - '#^Class.*[a-z]Factory not found\.$#'
        - '#^Class.*[a-z]\\Proxy not found\.$#'
        - '#^Call to method create\(\) on an unknown class.*[a-z]Factory\.$#'
        - '#^Call to method create\(\) on an unknown class.*[a-z]\\Proxy\.$#'
        - '#^Parameter \$\w+ of method .*::.*\(\) has invalid (typehint )?type.*[a-z]Factory\.$#'
        - '#^Parameter \$\w+ of method .*::.*\(\) has invalid (typehint )?type.*[a-z]\\Proxy\.$#'
        - '#^Property .*::\$.* has unknown class.*[a-z]Factory as its type\.$#'
        - '#^Property .*::\$.* has unknown class.*[a-z]\\Proxy as its type\.$#'
        - '#^Return typehint of method .*::.*\(\) has invalid type.*[a-z]Factory\.$#'
        - '#^Return typehint of method .*::.*\(\) has invalid type.*[a-z]\\Proxy\.$#'
        - '#^Call to an undefined method.*[a-z]Interface::(get|set).*\(\)\.$#'
        - '#invalid type.*ExtensionInterface#'
        - '#should return.*ExtensionInterface.*but returns.*Magento\\Framework\\Api\\ExtensionAttributesInterface#'
        - '#Parameter \#1 \$extensionAttributes of method Magento\\Framework\\Api\\AbstractExtensibleObject::_setExtensionAttributes\(\) expects Magento\\Framework\\Api\\ExtensionAttributesInterface, .*ExtensionInterface given\.#'
        - '#Call to an undefined method Magento\\Framework\\GraphQl\\Query\\Resolver\\ContextInterface::getExtensionAttributes\(\)\.#'
        - '#Call to an undefined method object::getExtensionAttributes\(\).#'
        - '#unknown class [a-zA-Z0-9\\_]+ExtensionInterface#'
        - '#Class [a-zA-Z0-9\\_]+ExtensionInterface not found#'

    excludePaths:
        - %currentWorkingDirectory%/pub/errors/processor.php

includes:
    - .phpstan-baseline.neon
    - ../qa/vendor/bitexpert/phpstan-magento/extension.neon

Looking at this, I believe I'm ignoring the extension attributes anyway.

from phpstan-magento.

shochdoerfer avatar shochdoerfer commented on August 26, 2024

@evs-xsarus correct, you are ignoring the errors anyways.

from phpstan-magento.

shochdoerfer avatar shochdoerfer commented on August 26, 2024

@evs-xsarus I prepared a PR, mind giving it a try? #267

from phpstan-magento.

evs-xsarus avatar evs-xsarus commented on August 26, 2024

Looking at the code, I believe it should work. My debugger doesn't stop in the TestFramewordAutoloader with PHPStan 1.8.x. Probably due to #249 .

from phpstan-magento.

shochdoerfer avatar shochdoerfer commented on August 26, 2024

dev-master version seems to work for me. Will release a new version soon, if you run into problems open a new issue.

from phpstan-magento.

shochdoerfer avatar shochdoerfer commented on August 26, 2024

Here you go: https://github.com/bitExpert/phpstan-magento/releases/tag/v0.24.0

from phpstan-magento.

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.