Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
staabm committed Dec 21, 2024
1 parent 2bccde7 commit d146e0e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Php/PhpVersions.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function producesWarningForFinalPrivateMethods(): TrinaryLogic
return IntegerRangeType::fromInterval(80000, null)->isSuperTypeOf($this->phpVersions)->result;
}

public function socketCreateUsesClass(): TrinaryLogic
public function socketCreateReturnsObject(): TrinaryLogic
{
return IntegerRangeType::fromInterval(80000, null)->isSuperTypeOf($this->phpVersions)->result;
}
Expand Down
4 changes: 2 additions & 2 deletions src/Type/Php/SocketCreateReturnTypeExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ public function getTypeFromFunctionCall(FunctionReflection $functionReflection,
return null;
}

if ($scope->getPhpVersion()->socketCreateUsesClass()->yes()) {
if ($scope->getPhpVersion()->socketCreateReturnsObject()->yes()) {
return new UnionType([new ConstantBooleanType(false), new ObjectType('\\Socket')]);
}

if ($scope->getPhpVersion()->socketCreateUsesClass()->no()) {
if ($scope->getPhpVersion()->socketCreateReturnsObject()->no()) {
return new UnionType([new ConstantBooleanType(false), new ResourceType()]);
}

Expand Down

0 comments on commit d146e0e

Please sign in to comment.