[DI] Uncomment code
This commit is contained in:
parent
3bbb657560
commit
03f33b592a
@ -77,21 +77,8 @@ class Compiler
|
||||
* @param string $type The type of the pass
|
||||
* @param int $priority Used to sort the passes
|
||||
*/
|
||||
public function addPass(CompilerPassInterface $pass, $type = PassConfig::TYPE_BEFORE_OPTIMIZATION/*, int $priority = 0*/)
|
||||
public function addPass(CompilerPassInterface $pass, $type = PassConfig::TYPE_BEFORE_OPTIMIZATION, int $priority = 0)
|
||||
{
|
||||
if (func_num_args() >= 3) {
|
||||
$priority = func_get_arg(2);
|
||||
} else {
|
||||
if (__CLASS__ !== get_class($this)) {
|
||||
$r = new \ReflectionMethod($this, __FUNCTION__);
|
||||
if (__CLASS__ !== $r->getDeclaringClass()->getName()) {
|
||||
@trigger_error(sprintf('Method %s() will have a third `int $priority = 0` argument in version 4.0. Not defining it is deprecated since 3.2.', __METHOD__), E_USER_DEPRECATED);
|
||||
}
|
||||
}
|
||||
|
||||
$priority = 0;
|
||||
}
|
||||
|
||||
$this->passConfig->addPass($pass, $type, $priority);
|
||||
}
|
||||
|
||||
|
@ -108,21 +108,8 @@ class PassConfig
|
||||
*
|
||||
* @throws InvalidArgumentException when a pass type doesn't exist
|
||||
*/
|
||||
public function addPass(CompilerPassInterface $pass, $type = self::TYPE_BEFORE_OPTIMIZATION/*, int $priority = 0*/)
|
||||
public function addPass(CompilerPassInterface $pass, $type = self::TYPE_BEFORE_OPTIMIZATION, int $priority = 0)
|
||||
{
|
||||
if (func_num_args() >= 3) {
|
||||
$priority = func_get_arg(2);
|
||||
} else {
|
||||
if (__CLASS__ !== get_class($this)) {
|
||||
$r = new \ReflectionMethod($this, __FUNCTION__);
|
||||
if (__CLASS__ !== $r->getDeclaringClass()->getName()) {
|
||||
@trigger_error(sprintf('Method %s() will have a third `int $priority = 0` argument in version 4.0. Not defining it is deprecated since 3.2.', __METHOD__), E_USER_DEPRECATED);
|
||||
}
|
||||
}
|
||||
|
||||
$priority = 0;
|
||||
}
|
||||
|
||||
$property = $type.'Passes';
|
||||
if (!isset($this->$property)) {
|
||||
throw new InvalidArgumentException(sprintf('Invalid type "%s".', $type));
|
||||
|
@ -86,19 +86,8 @@ class ServiceReferenceGraph
|
||||
* @param string $reference
|
||||
* @param bool $lazy
|
||||
*/
|
||||
public function connect($sourceId, $sourceValue, $destId, $destValue = null, $reference = null/*, bool $lazy = false*/)
|
||||
public function connect($sourceId, $sourceValue, $destId, $destValue = null, $reference = null, bool $lazy = false)
|
||||
{
|
||||
if (func_num_args() >= 6) {
|
||||
$lazy = func_get_arg(5);
|
||||
} else {
|
||||
if (__CLASS__ !== get_class($this)) {
|
||||
$r = new \ReflectionMethod($this, __FUNCTION__);
|
||||
if (__CLASS__ !== $r->getDeclaringClass()->getName()) {
|
||||
@trigger_error(sprintf('Method %s() will have a 6th `bool $lazy = false` argument in version 4.0. Not defining it is deprecated since 3.3.', __METHOD__), E_USER_DEPRECATED);
|
||||
}
|
||||
}
|
||||
$lazy = false;
|
||||
}
|
||||
$sourceNode = $this->createNode($sourceId, $sourceValue);
|
||||
$destNode = $this->createNode($destId, $destValue);
|
||||
$edge = new ServiceReferenceGraphEdge($sourceNode, $destNode, $reference, $lazy);
|
||||
|
@ -442,21 +442,8 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function addCompilerPass(CompilerPassInterface $pass, $type = PassConfig::TYPE_BEFORE_OPTIMIZATION/*, int $priority = 0*/)
|
||||
public function addCompilerPass(CompilerPassInterface $pass, $type = PassConfig::TYPE_BEFORE_OPTIMIZATION, int $priority = 0)
|
||||
{
|
||||
if (func_num_args() >= 3) {
|
||||
$priority = func_get_arg(2);
|
||||
} else {
|
||||
if (__CLASS__ !== get_class($this)) {
|
||||
$r = new \ReflectionMethod($this, __FUNCTION__);
|
||||
if (__CLASS__ !== $r->getDeclaringClass()->getName()) {
|
||||
@trigger_error(sprintf('Method %s() will have a third `int $priority = 0` argument in version 4.0. Not defining it is deprecated since 3.2.', __METHOD__), E_USER_DEPRECATED);
|
||||
}
|
||||
}
|
||||
|
||||
$priority = 0;
|
||||
}
|
||||
|
||||
$this->getCompiler()->addPass($pass, $type, $priority);
|
||||
|
||||
$this->addObjectResource($pass);
|
||||
@ -699,19 +686,8 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
|
||||
* Set to "true" when you want to use the current ContainerBuilder
|
||||
* directly, keep to "false" when the container is dumped instead.
|
||||
*/
|
||||
public function compile(/*$resolveEnvPlaceholders = false*/)
|
||||
public function compile(bool $resolveEnvPlaceholders = false)
|
||||
{
|
||||
if (1 <= func_num_args()) {
|
||||
$resolveEnvPlaceholders = func_get_arg(0);
|
||||
} else {
|
||||
if (__CLASS__ !== static::class) {
|
||||
$r = new \ReflectionMethod($this, __FUNCTION__);
|
||||
if (__CLASS__ !== $r->getDeclaringClass()->getName() && (1 > $r->getNumberOfParameters() || 'resolveEnvPlaceholders' !== $r->getParameters()[0]->name)) {
|
||||
@trigger_error(sprintf('The %s::compile() method expects a first "$resolveEnvPlaceholders" argument since version 3.3. It will be made mandatory in 4.0.', static::class), E_USER_DEPRECATED);
|
||||
}
|
||||
}
|
||||
$resolveEnvPlaceholders = false;
|
||||
}
|
||||
$compiler = $this->getCompiler();
|
||||
|
||||
if ($this->trackResources) {
|
||||
|
Reference in New Issue
Block a user