Skip to content

Commit

Permalink
Add default values for psalm and update code style
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielBadura committed Feb 11, 2023
1 parent 59243d4 commit 483cd59
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
use Roave\BetterReflection\Reflection\ReflectionFunction;
use Roave\BetterReflection\Reflection\ReflectionMethod;
use Roave\BetterReflection\Reflection\ReflectionParameter;
use Throwable;

use function var_export;

Expand All @@ -32,7 +31,7 @@ final class ParameterDefaultValueChanged implements FunctionBased
public function __construct()
{
$this->formatFunction = new FunctionName();
$this->prettyPrinter = new Standard();
$this->prettyPrinter = new Standard();
}

public function __invoke(
Expand All @@ -45,6 +44,10 @@ public function __invoke(
$changes = Changes::empty();

foreach (Dict\intersect_by_key($fromParametersWithDefaults, $toParametersWithDefaults) as $parameterIndex => $parameter) {
// add default value to null to help psalm
$defaultValueFrom = null;
$defaultValueTo = null;

try {
$defaultValueFrom = $parameter->getDefaultValue();
$defaultValueTo = $toParametersWithDefaults[$parameterIndex]->getDefaultValue();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public function testDiffs(
*/
public function functionsToBeTested(): array
{
$astLocator = (new BetterReflection())->astLocator();
$astLocator = (new BetterReflection())->astLocator();
$sourceStubber = (new BetterReflection())->sourceStubber();

$fromLocator = new StringSourceLocator(
Expand Down

0 comments on commit 483cd59

Please sign in to comment.