Comments (5)
It could be suggested in
composer.json
and then something likeif 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.
class_exists
may returntrue
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.
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.
How about making every dependency lazy by default?
from di.
@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)
- New in initializers in PHP 8.1 HOT 7
- Container doesn't resolve properties of already built instances after their state reset HOT 2
- Add Attributes to inject scalar definitions & tags HOT 1
- Change syntax for get services by tag to `#tag-name` HOT 6
- Check tag services array in `Container::setTags()` on empty HOT 4
- Improve UX adding short syntax passing string reference to methods' calls
- Incorrect parameter reference in error message
- Add ability to set classes when resolving which an exception should be thrown HOT 5
- Make `BuildingException` friendly
- Dynamic bindings HOT 2
- Proposal to Add Reference::tag Method HOT 4
- Add debug commands
- update irc link
- update src folder links
- update root folder links
- Need update documentation
- Prevent run GitHub Actions when change non-code files
- Factory call from container config HOT 3
- Remove scrutinizer
- Convert all exceptions into Friendly Exceptions HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from di.