Skip to content

Commit 50f2a08

Browse files
committed
Revert Passing a variable by reference to a function and method has side effects
This reverts commit 1070788.
1 parent 35e4813 commit 50f2a08

File tree

10 files changed

+0
-91
lines changed

10 files changed

+0
-91
lines changed

src/Reflection/Annotations/AnnotationMethodReflection.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -113,14 +113,6 @@ public function hasSideEffects(): TrinaryLogic
113113
return TrinaryLogic::createYes();
114114
}
115115

116-
foreach ($this->getVariants() as $variant) {
117-
foreach ($variant->getParameters() as $parameter) {
118-
if ($parameter->passedByReference()->yes()) {
119-
return TrinaryLogic::createYes();
120-
}
121-
}
122-
}
123-
124116
return TrinaryLogic::createMaybe();
125117
}
126118

src/Reflection/Native/NativeFunctionReflection.php

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -81,13 +81,6 @@ public function hasSideEffects(): TrinaryLogic
8181
if ($this->isVoid()) {
8282
return TrinaryLogic::createYes();
8383
}
84-
foreach ($this->variants as $variant) {
85-
foreach ($variant->getParameters() as $parameter) {
86-
if ($parameter->passedByReference()->yes()) {
87-
return TrinaryLogic::createYes();
88-
}
89-
}
90-
}
9184

9285
return $this->hasSideEffects;
9386
}

src/Reflection/Native/NativeMethodReflection.php

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -136,13 +136,6 @@ public function hasSideEffects(): TrinaryLogic
136136
) {
137137
return TrinaryLogic::createYes();
138138
}
139-
foreach ($this->variants as $variant) {
140-
foreach ($variant->getParameters() as $parameter) {
141-
if ($parameter->passedByReference()->yes()) {
142-
return TrinaryLogic::createYes();
143-
}
144-
}
145-
}
146139

147140
return $this->hasSideEffects;
148141
}

src/Reflection/Php/PhpFunctionFromParserNodeReflection.php

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -199,13 +199,6 @@ public function hasSideEffects(): TrinaryLogic
199199
if ($this->isPure !== null) {
200200
return TrinaryLogic::createFromBoolean(!$this->isPure);
201201
}
202-
foreach ($this->getVariants() as $variant) {
203-
foreach ($variant->getParameters() as $parameter) {
204-
if ($parameter->passedByReference()->yes()) {
205-
return TrinaryLogic::createYes();
206-
}
207-
}
208-
}
209202

210203
return TrinaryLogic::createMaybe();
211204
}

src/Reflection/Php/PhpFunctionReflection.php

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -245,13 +245,6 @@ public function hasSideEffects(): TrinaryLogic
245245
if ($this->isPure !== null) {
246246
return TrinaryLogic::createFromBoolean(!$this->isPure);
247247
}
248-
foreach ($this->getVariants() as $variant) {
249-
foreach ($variant->getParameters() as $parameter) {
250-
if ($parameter->passedByReference()->yes()) {
251-
return TrinaryLogic::createYes();
252-
}
253-
}
254-
}
255248

256249
return TrinaryLogic::createMaybe();
257250
}

src/Reflection/Php/PhpMethodReflection.php

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -416,13 +416,6 @@ public function hasSideEffects(): TrinaryLogic
416416
if ($this->isPure !== null) {
417417
return TrinaryLogic::createFromBoolean(!$this->isPure);
418418
}
419-
foreach ($this->getVariants() as $variant) {
420-
foreach ($variant->getParameters() as $parameter) {
421-
if ($parameter->passedByReference()->yes()) {
422-
return TrinaryLogic::createYes();
423-
}
424-
}
425-
}
426419

427420
return TrinaryLogic::createMaybe();
428421
}

tests/PHPStan/Analyser/NodeScopeResolverTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1171,7 +1171,6 @@ public function dataFileAsserts(): iterable
11711171
yield from $this->gatherAssertTypes(__DIR__ . '/data/bug-8635.php');
11721172
yield from $this->gatherAssertTypes(__DIR__ . '/data/bug-8625.php');
11731173
yield from $this->gatherAssertTypes(__DIR__ . '/data/bug-8621.php');
1174-
yield from $this->gatherAssertTypes(__DIR__ . '/data/bug-8084.php');
11751174
}
11761175

11771176
/**

tests/PHPStan/Analyser/data/bug-8084.php

Lines changed: 0 additions & 20 deletions
This file was deleted.

tests/PHPStan/Rules/Variables/NullCoalesceRuleTest.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -360,12 +360,4 @@ public function testBug7968(): void
360360
$this->analyse([__DIR__ . '/data/bug-7968.php'], []);
361361
}
362362

363-
public function testBug8084(): void
364-
{
365-
$this->treatPhpDocTypesAsCertain = true;
366-
$this->strictUnnecessaryNullsafePropertyFetch = true;
367-
368-
$this->analyse([__DIR__ . '/data/bug-8084.php'], []);
369-
}
370-
371363
}

tests/PHPStan/Rules/Variables/data/bug-8084.php

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)