8000 [DI] Uncomment code · symfony/symfony@03f33b5 · GitHub
[go: up one dir, main page]

Skip to content

Commit 03f33b5

Browse files
committed
[DI] Uncomment code
1 parent 3bbb657 commit 03f33b5

File tree

4 files changed

+5
-66
lines changed

4 files changed

+5
-66
lines changed

src/Symfony/Component/DependencyInjection/Compiler/Compiler.php

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -77,21 +77,8 @@ public function getLoggingFormatter()
7777
* @param string $type The type of the pass
7878
* @param int $priority Used to sort the passes
7979
*/
80-
public function addPass(CompilerPassInterface $pass, $type = PassConfig::TYPE_BEFORE_OPTIMIZATION/*, int $priority = 0*/)
80+
public function addPass(CompilerPassInterface $pass, $type = PassConfig::TYPE_BEFORE_OPTIMIZATION, int $priority = 0)
8181
{
82-
if (func_num_args() >= 3) {
83-
$priority = func_get_arg(2);
84-
} else {
85-
if (__CLASS__ !== get_class($this)) {
86-
$r = new \ReflectionMethod($this, __FUNCTION__);
87-
if (__CLASS__ !== $r->getDeclaringClass()->getName()) {
88-
@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);
89-
}
90-
}
91-
92-
$priority = 0;
93-
}
94-
9582
$this->passConfig->addPass($pass, $type, $priority);
9683
}
9784

src/Symfony/Component/DependencyInjection/Compiler/PassConfig.php

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -108,21 +108,8 @@ public function getPasses()
108108
*
109109
* @throws InvalidArgumentException when a pass type doesn't exist
110110
*/
111-
public function addPass(CompilerPassInterface $pass, $type = self::TYPE_BEFORE_OPTIMIZATION/*, int $priority = 0*/)
111+
public function addPass(CompilerPassInterface $pass, $type = self::TYPE_BEFORE_OPTIMIZATION, int $priority = 0)
112112
{
113-
if (func_num_args() >= 3) {
114-
$priority = func_get_arg(2);
115-
} else {
116-
if (__CLASS__ !== get_class($this)) {
117-
$r = new \ReflectionMethod($this, __FUNCTION__);
118-
if (__CLASS__ !== $r->getDeclaringClass()->getName()) {
119-
@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);
120-
}
121-
}
122-
123-
$priority = 0;
124-
}
125-
126113
$property = $type.'Passes';
127114
if (!isset($this->$property)) {
128115
throw new InvalidArgumentException(sprintf('Invalid type "%s".', $type));

src/Symfony/Component/DependencyInjection/Compiler/ServiceReferenceGraph.php

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -86,19 +86,8 @@ public function clear()
8686
* @param string $reference
8787
* @param bool $lazy
8888
*/
89-
public function connect($sourceId, $sourceValue, $destId, $destValue = null, $reference = null/*, bool $lazy = false*/)
89+
public function connect($sourceId, $sourceValue, $destId, $destValue = null, $reference = null, bool $lazy = false)
9090
{
91-
if (func_num_args() >= 6) {
92-
$lazy = func_get_arg(5);
93-
} else {
94-
if (__CLASS__ !== get_class($this)) {
95-
$r = new \ReflectionMethod($this, __FUNCTION__);
96-
if (__CLASS__ !== $r->getDeclaringClass()->getName()) {
97-
@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);
98-
}
99-
}
100-
$lazy = false;
101-
}
10291
$sourceNode = $this->createNode($sourceId, $sourceValue);
10392
$destNode = $this->createNode($destId, $destValue);
10493
$edge = new ServiceReferenceGraphEdge($sourceNode, $destNode, $reference, $lazy);

src/Symfony/Component/DependencyInjection/ContainerBuilder.php

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -442,21 +442,8 @@ public function loadFromExtension($extension, array $values = array())
442442
*
443443
* @return $this
444444
*/
445-
public function addCompilerPass(CompilerPassInterface $pass, $type = PassConfig::TYPE_BEFORE_OPTIMIZATION/*, int $priority = 0*/)
445+
public function addCompilerPass(CompilerPassInterface $pass, $type = PassConfig::TYPE_BEFORE_OPTIMIZATION, int $priority = 0)
446446
{
447-
if (func_num_args() >= 3) {
448-
$priority = func_get_arg(2);
449-
} else {
450-
if (__CLASS__ !== get_class($this)) {
451-
$r = new \ReflectionMethod($this, __FUNCTION__);
452-
if (__CLASS__ !== $r->getDeclaringClass()->getName()) {
453-
@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);
454-
}
455-
}
456-
457-
$priority = 0;
458-
}
459-
460447
$this->getCompiler()->addPass($pass, $type, $priority);
461448

462449
$this->addObjectResource($pass);
@@ -699,19 +686,8 @@ public function prependExtensionConfig($name, array $config)
699686
* Set to "true" when you want to use the current ContainerBuilder
700687
* directly, keep to "false" when the container is dumped instead.
701688
*/
702-
public function compile(/*$resolveEnvPlaceholders = false*/)
689+
public function compile(bool $resolveEnvPlaceholders = false)
703690
{
704-
if (1 <= func_num_args()) {
705-
$resolveEnvPlaceholders = func_get_arg(0);
706-
} else {
707-
if (__CLASS__ !== static::class) {
708-
$r = new \ReflectionMethod($this, __FUNCTION__);
709-
if (__CLASS__ !== $r->getDeclaringClass()->getName() && (1 > $r->getNumberOfParameters() || 'resolveEnvPlaceholders' !== $r->getParameters()[0]->name)) {
710-
@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);
711-
}
712-
}
713-
$resolveEnvPlaceholders = false;
714-
}
715691
$compiler = $this->getCompiler();
716692

717693
if ($this->trackResources) {

0 commit comments

Comments
 (0)
0