Skip to content

Commit

Permalink
Merge pull request #1390 from Roave/renovate/all-minor-patch
Browse files Browse the repository at this point in the history
Update all non-major dependencies
  • Loading branch information
Ocramius authored Jan 19, 2024
2 parents bd4af33 + 5e4957b commit f509e0b
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ jobs:
dependencies:
- "locked"
php-version:
- "8.2"
- "8.3"
operating-system:
- "ubuntu-latest"

Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
"doctrine/coding-standard": "^12.0.0",
"phpstan/phpstan": "^1.10.56",
"phpstan/phpstan-phpunit": "^1.3.15",
"phpunit/phpunit": "^10.5.7",
"vimeo/psalm": "5.19.1",
"phpunit/phpunit": "^10.5.8",
"vimeo/psalm": "5.20.0",
"roave/infection-static-analysis-plugin": "^1.34.0"
},
"autoload": {
Expand Down
24 changes: 12 additions & 12 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/Reflection/Adapter/ReflectionMethod.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public function __construct(private BetterReflectionMethod $betterReflectionMeth
unset($this->class);
}

/** @psalm-suppress MethodSignatureMismatch */
public static function createFromMethodName(string $method): static
{
if (! str_contains($method, '::')) {
Expand Down
2 changes: 1 addition & 1 deletion src/Reflection/ReflectionClass.php
Original file line number Diff line number Diff line change
Expand Up @@ -1410,7 +1410,7 @@ private function computeTraitsData(ClassNode|InterfaceNode|TraitNode|EnumNode $n
$methodHash = $this->methodHash($usedTrait->toString(), $adaptation->method->toString());

if ($adaptation instanceof Node\Stmt\TraitUseAdaptation\Alias) {
if ($adaptation->newModifier) {
if ($adaptation->newModifier !== null) {
/** @var int-mask-of<ReflectionMethodAdapter::IS_*> $modifier */
$modifier = $adaptation->newModifier;
$traitsData['modifiers'][$methodHash] = $modifier;
Expand Down
11 changes: 8 additions & 3 deletions src/SourceLocator/SourceStubber/ReflectionSourceStubber.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
use function implode;
use function in_array;
use function is_resource;
use function is_string;
use function method_exists;
use function preg_replace;
use function sprintf;
Expand Down Expand Up @@ -120,7 +121,8 @@ public function generateClassStub(string $className): StubData|null
? $this->generateStubInNamespace($node, $classReflection->getNamespaceName())
: $this->generateStub($node);

$extensionName = $classReflection->getExtensionName() ?: null;
$extensionName = $classReflection->getExtension()?->getName();
assert((is_string($extensionName) && $extensionName !== '') || $extensionName === null);

return $this->createStubData($stub, $extensionName);
}
Expand All @@ -147,7 +149,10 @@ public function generateFunctionStub(string $functionName): StubData|null
$functionNode->setReturnType($this->formatType($returnType));
}

$extensionName = $functionReflection->getExtensionName() ?: null;
/** @phpstan-ignore-next-line */
$extensionName = $functionReflection->getExtension()?->getName();
/** @phpstan-ignore-next-line */
assert((is_string($extensionName) && $extensionName !== '') || $extensionName === null);

if (! $functionReflection->inNamespace()) {
return $this->createStubData($this->generateStub($functionNode->getNode()), $extensionName);
Expand Down Expand Up @@ -214,7 +219,7 @@ private function addDocComment(
Class_|Interface_|Trait_|Enum_|Method|Property|Function_ $node,
CoreReflectionClass|CoreReflectionMethod|CoreReflectionProperty|CoreReflectionFunction $reflection,
): void {
$docComment = $reflection->getDocComment() ?: '';
$docComment = $reflection->getDocComment() !== false ? $reflection->getDocComment() : '';
$annotations = [];

if (
Expand Down
2 changes: 1 addition & 1 deletion src/SourceLocator/Type/ComposerSourceLocator.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ protected function createLocatedSource(Identifier $identifier): LocatedSource|nu

$filename = $this->classLoader->findFile($identifier->getName());

if (! $filename) {
if ($filename === false) {
return null;
}

Expand Down
2 changes: 1 addition & 1 deletion src/SourceLocator/Type/EvaledCodeSourceLocator.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ private function getInternalReflectionClass(Identifier $identifier): ReflectionC
$reflection = new ReflectionClass($name);
$sourceFile = $reflection->getFileName();

return $sourceFile && is_file($sourceFile)
return $sourceFile !== false && is_file($sourceFile)
? null : $reflection;
}
}
2 changes: 1 addition & 1 deletion test/unit/SourceLocator/Type/ComposerSourceLocatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public function testInvokableThrowsExceptionWhenClassNotResolved(): void
->expects($this->once())
->method('findFile')
->with($className)
->will($this->returnValue(null));
->willReturn(false);

$locator = new ComposerSourceLocator($loader, $this->astLocator);

Expand Down

0 comments on commit f509e0b

Please sign in to comment.