Skip to content

Commit 37e990f

Browse files
authored
Merge pull request #1413 from staabm/dep-fix
Fix non-version dependent deprecations
2 parents 1926b26 + 3fb2a1c commit 37e990f

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

src/SourceLocator/SourceStubber/PhpStormStubsSourceStubber.php

+2-4
Original file line numberDiff line numberDiff line change
@@ -692,12 +692,10 @@ private function isDeprecatedByPhpDocInPhpVersion(Node\Expr\FuncCall $node): boo
692692
$patch = $matches[3] ?? 0;
693693
$versionId = sprintf('%d%02d%02d', $major, $minor, $patch);
694694

695-
if ($this->phpVersion >= $versionId) {
696-
return true;
697-
}
695+
return $this->phpVersion >= $versionId;
698696
}
699697

700-
return false;
698+
return true;
701699
}
702700

703701
private function isDeprecatedInPhpVersion(Node\Stmt\ClassLike|Node\Stmt\ClassConst|Node\Stmt\Property|Node\Stmt\ClassMethod|Node\Stmt\Function_ $node): bool

test/unit/Reflection/ReflectionConstantTest.php

+9
Original file line numberDiff line numberDiff line change
@@ -338,4 +338,13 @@ public function testIsDeprecated(string $docComment, bool $isDeprecated): void
338338

339339
self::assertSame($isDeprecated, $constantReflection->isDeprecated());
340340
}
341+
342+
public function testIsCurloptFtpSslConstantDeprecated(): void
343+
{
344+
$betterReflection = BetterReflectionSingleton::instance();
345+
$reflector = new DefaultReflector($betterReflection->sourceLocator());
346+
$constantReflection = $reflector->reflectConstant('CURLOPT_FTP_SSL');
347+
348+
self::assertTrue($constantReflection->isDeprecated());
349+
}
341350
}

0 commit comments

Comments
 (0)