Skip to content

Commit

Permalink
fix(src) phpstan issues
Browse files Browse the repository at this point in the history
  • Loading branch information
lucatume committed Nov 23, 2023
1 parent da81f28 commit f6b63b4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
10 changes: 9 additions & 1 deletion src/Adapters/Symfony/Component/Process/Process.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@

class Process extends SymfonyProcess
{
/**
* @var array<string,mixed>
*/
private $options = [];
/**
* @param string[] $command
Expand Down Expand Up @@ -47,12 +50,17 @@ public function getStartTime(): float
return $startTime;
}

/**
* @param string $name
* @param array<mixed> $arguments
* @return void
*/
public function __call(string $name, array $arguments)
{
if ($name === 'setOptions') {
$this->options = $arguments[0] ?? [];
return;
}
return;
}

public function __destruct()
Expand Down
3 changes: 2 additions & 1 deletion src/Events/Dispatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ public static function dispatch(string $name, mixed $origin = null, array $conte
}

$event = new Event($name, $context, $origin);

try {
$dispatchMethodReflection = new \ReflectionMethod($eventDispatcher, 'dispatch');
$firstParameterReflection = $dispatchMethodReflection->getParameters()[0] ?? null;
Expand All @@ -102,7 +103,7 @@ public static function dispatch(string $name, mixed $origin = null, array $conte
return $eventDispatcher->dispatch($event, $name);
}

return $eventDispatcher->dispatch($name, $event);
return $eventDispatcher->dispatch($name, $event); //@phpstan-ignore-line
} catch (\ReflectionException $e) {
return null;
}
Expand Down

0 comments on commit f6b63b4

Please sign in to comment.