Git Product home page Git Product logo

Comments (4)

mark-gerarts avatar mark-gerarts commented on June 18, 2024

The reason it is commented is because it was added after the 1.0 release, and would otherwise break existing implementations. It will be explicitly added in the 2.0 version.

I don't know if there is a way I can annotate the methods so that PHPStan stops complaining? Maybe adding a @param would be enough, I'll have to experiment a bit.

from automapper-plus.

mark-gerarts avatar mark-gerarts commented on June 18, 2024

Okay, so far the only solution I've found is to ignore the errors in your PHPStan config:

parameters:
  ignoreErrors:
    - '#Method AutoMapperPlus\\(Auto)?MapperInterface::map(Multiple)?\(\) invoked with 3 parameters, 2 required#'

I don't really like this solution because I'd rather fix it in the library itself. So unless anyone has a better idea I'm going to create a PHPStan extension with the above config and make it auto-installable with phpstan/extension-installer. Then I can add that as a dependency to the main library.

from automapper-plus.

Toilal avatar Toilal commented on June 18, 2024

Thanks for the explanations, i'll just ignore the error in PHPStan at the moment.

from automapper-plus.

mark-gerarts avatar mark-gerarts commented on June 18, 2024

I've provided the workaround as a separate package. See the explanation and usage instructions here.

from automapper-plus.

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.