Code Monkey home page Code Monkey logo

Comments (5)

rob006 avatar rob006 commented on August 25, 2024

It could be suggested in composer.json and then something like if class_exists then it works else silently works without it.

You will not be able to define constraints in such case - class_exists may return true, but you may get different class than you expected.

from di.

hiqsol avatar hiqsol commented on August 25, 2024

class_exists may return true

Sorry, I didn't get you.
I've meant to use if class_exists(\ProxyManager\Factory\LazyLoadingValueHolderFactory::class) to detect if ProxyManager package is installed.

from di.

rob006 avatar rob006 commented on August 25, 2024

I mean that class_exists(\ProxyManager\Factory\LazyLoadingValueHolderFactory::class) tells you that package is probably installed, but does not tell you anything about version of this package. And LazyLoadingValueHolderFactory in v2.0.0 may have different signature and behavior than in v3.0.0.

from di.

samdark avatar samdark commented on August 25, 2024

How about making every dependency lazy by default?

from di.

rob006 avatar rob006 commented on August 25, 2024

@samdark I don't think that this is worth the additional overhead. I'm not sure if it is even possible (final classes may be a problem).

from di.

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.