Skip to content

Commit

Permalink
Merge pull request #5 from sheavescapital/two
Browse files Browse the repository at this point in the history
phpstan 2.0, larastan 3.0
  • Loading branch information
calebdw authored Nov 20, 2024
2 parents 8b0f29d + 86a37c1 commit a283c3b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 8 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"php": "^8.1",
"illuminate/support": "^10.0 || ^11.0",
"livewire/livewire": "^3.3",
"phpstan/phpstan": "^1.10"
"phpstan/phpstan": "^2.0"
},
"require-dev": {
"phpunit/phpunit": "^10.5"
Expand Down
5 changes: 1 addition & 4 deletions src/Properties/ComputedPropertyExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
use Livewire\Attributes\Computed;
use Livewire\Component;
use PHPStan\Reflection\ClassReflection;
use PHPStan\Reflection\ParametersAcceptorSelector;
use PHPStan\Reflection\PropertiesClassReflectionExtension;
use PHPStan\Reflection\PropertyReflection;

Expand Down Expand Up @@ -51,9 +50,7 @@ public function getProperty(

$methodReflection = $classReflection->getNativeMethod($methodName);

$returnType = ParametersAcceptorSelector::selectSingle(
$methodReflection->getVariants(),
)->getReturnType();
$returnType = $methodReflection->getOnlyVariant()->getReturnType();

return new ComputedProperty(
declaringClass: $classReflection,
Expand Down
4 changes: 1 addition & 3 deletions tests/Fixtures/TestComponentWithComputedProperties.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@ private function privateMethod(): bool
#[Computed]
protected function protectedMethod(): bool
{
$this->privateMethod();

return true;
return $this->privateMethod();
}

#[Computed]
Expand Down

0 comments on commit a283c3b

Please sign in to comment.