Commit Graph

7 Commits

Author SHA1 Message Date
Jeremy Mikola
80f0b980ba [DependencyInjection] Fix DefinitionDecorator::getArgument() for replacements
While Definition::getArgument() could be used to fetch replaced values, it relied upon bad comparison logic (e.g. "index_1" > 1). Additionally, storing original arguments and replacements in the same array makes Definition::getArguments()'s bounds check unreliable. A single argument and its replacement would count twice, allowing getArgument(2) to pass the bounds check and result in an array index error.

With this new method, fetching of replacement arguments is more straightforward and bounds checking functions as it should.
2011-10-27 18:03:51 -04:00
Jeremy Mikola
4bbb685557 [DependencyInjection] Test Definition and DefinitionDecorator exceptions 2011-10-27 17:59:47 -04:00
Fabien Potencier
17cd08dc6c fixed CS 2011-06-08 19:56:59 +02:00
Fabien Potencier
65200aa86a added missing license headers 2011-05-31 10:57:06 +02:00
Kris Wallsmith
cdf706d357 [DependencyInjection] renamed Definition::setArgument() as replaceArgument() to be more specific 2011-04-20 04:47:44 -07:00
Jeremy Mikola
743f25a287 [DependencyInjection] Create explicit factoryClass property for Definitions
Previously, the Definition class was used both for type inference and factory construction (if factoryService was absent). This is fine for cases where classes create instances of themselves (e.g. getInstance() or create()), but leads to ambiguity when we have a separate factory class.
2011-02-05 20:39:42 +01:00
Johannes Schmitt
803dd58002 add definition inheritance support 2011-01-28 09:12:29 +01:00