Skip to content

Commit

Permalink
Fix CS
Browse files Browse the repository at this point in the history
  • Loading branch information
jderusse committed Feb 28, 2024
1 parent 50b45ad commit 598cb20
Show file tree
Hide file tree
Showing 33 changed files with 66 additions and 66 deletions.
6 changes: 3 additions & 3 deletions Player/Adapter/BlackfireSdkAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function getConfiguration(): ClientConfiguration
}
}

public function createRequest(string|Configuration $config = null): Request
public function createRequest(string|Configuration|null $config = null): Request
{
try {
return $this->blackfireClient->createRequest($config);
Expand All @@ -45,7 +45,7 @@ public function createRequest(string|Configuration $config = null): Request
}
}

public function updateProfile(string $uuid, string $title, array $metadata = null): bool
public function updateProfile(string $uuid, string $title, ?array $metadata = null): bool
{
try {
return $this->blackfireClient->updateProfile($uuid, $title, $metadata);
Expand All @@ -63,7 +63,7 @@ public function getProfile(string $uuid): Profile
}
}

public function startBuild(string $env = null, array $options = []): Build
public function startBuild(?string $env = null, array $options = []): Build
{
try {
$sdkBuild = $this->blackfireClient->startBuild($env, $options);
Expand Down
6 changes: 3 additions & 3 deletions Player/Adapter/BlackfireSdkAdapterInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ interface BlackfireSdkAdapterInterface
{
public function getConfiguration(): ClientConfiguration;

public function createRequest(string|Configuration $config = null): Request;
public function createRequest(string|Configuration|null $config = null): Request;

public function updateProfile(string $uuid, string $title, array $metadata = null): bool;
public function updateProfile(string $uuid, string $title, ?array $metadata = null): bool;

public function getProfile(string $uuid): Profile;

public function startBuild(string $env = null, array $options = []): Build;
public function startBuild(?string $env = null, array $options = []): Build;
}
2 changes: 1 addition & 1 deletion Player/Build/Build.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
{
public function __construct(
public string $uuid,
public null|string $url = null,
public string|null $url = null,
) {
}
}
2 changes: 1 addition & 1 deletion Player/BuildApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public function getOrCreate(string $env, ScenarioSet $scenarioSet): Build
return $build;
}

public function createBuild(null|string $buildName, string $env): Build
public function createBuild(string|null $buildName, string $env): Build
{
$options = [
'trigger_name' => 'Blackfire Player',
Expand Down
2 changes: 1 addition & 1 deletion Player/Console/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
*/
final class Application extends BaseApplication
{
public function __construct(BlackfireSdkAdapterInterface $blackfireSdk = null, HttpClientInterface $blackfireHttpClient = null, string $transactionId)
public function __construct(BlackfireSdkAdapterInterface|null $blackfireSdk, HttpClientInterface|null $blackfireHttpClient, string $transactionId)
{
parent::__construct('Blackfire Player', Player::version());

Expand Down
8 changes: 4 additions & 4 deletions Player/Console/PlayerCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,12 @@ final class PlayerCommand extends Command
public const EXIT_CODE_SCENARIO_ERROR_NON_FATAL = 66;
public const EXIT_CODE_BLACKFIRE_NETWORK_ERROR = 67;

private ?HttpClientInterface $blackfireHttpClient;
private ?BlackfireSdkAdapterInterface $blackfireSdkAdapter;
private HttpClientInterface|null $blackfireHttpClient;
private BlackfireSdkAdapterInterface|null $blackfireSdkAdapter;
private string $transactionId;

public function __construct(
HttpClientInterface $blackfireHttpClient = null, BlackfireSdkAdapterInterface $blackfireSdkAdapter = null, string $transactionId)
HttpClientInterface|null $blackfireHttpClient, BlackfireSdkAdapterInterface|null $blackfireSdkAdapter, string $transactionId)
{
$this->blackfireHttpClient = $blackfireHttpClient;
$this->blackfireSdkAdapter = $blackfireSdkAdapter;
Expand Down Expand Up @@ -347,7 +347,7 @@ private function createReport(ScenarioSetResult $results): array
return $report;
}

private function getEnvOrDefault(string $envVar, string $default = null): ?string
private function getEnvOrDefault(string $envVar, ?string $default = null): ?string
{
$env = getenv($envVar);
if (!$env) {
Expand Down
2 changes: 1 addition & 1 deletion Player/Exception/ExpectationFailureException.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class ExpectationFailureException extends LogicException
{
private array $results;

public function __construct(string $message = null, array $results = [], int $code = 0, \Exception $previous = null)
public function __construct(?string $message = null, array $results = [], int $code = 0, ?\Exception $previous = null)
{
parent::__construct($message, $code, $previous);

Expand Down
2 changes: 1 addition & 1 deletion Player/ExpressionLanguage/ExtractResultsVisitor.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function extractResults(ParsedExpression $expression, array $variables):
return array_unique($results, \SORT_REGULAR);
}

private function visit(Node\Node $node, array $variables, Node\Node $parentNode = null): array
private function visit(Node\Node $node, array $variables, ?Node\Node $parentNode = null): array
{
$subExpressions = [];

Expand Down
8 changes: 4 additions & 4 deletions Player/ExpressionLanguage/Provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class Provider implements ExpressionFunctionProviderInterface
private readonly FakerGenerator $faker;

public function __construct(
FakerGenerator $faker = null,
?FakerGenerator $faker = null,
private readonly bool $sandbox = false,
) {
$this->faker = null !== $faker ? $faker : FakerFactory::create();
Expand Down Expand Up @@ -69,7 +69,7 @@ public function getFunctions(): array
return $arguments['_crawler']->selectButton($selector);
}),

new ExpressionFunction('file', $compiler, function (array $arguments, string $filename, string $name = null) {
new ExpressionFunction('file', $compiler, function (array $arguments, string $filename, ?string $name = null) {
if ($this->sandbox) {
if (UploadFile::isAbsolutePath($filename)) {
$extra = $arguments['_extra'];
Expand Down Expand Up @@ -186,7 +186,7 @@ public function getFunctions(): array
return array_merge($arr1, $arr2);
}),

new ExpressionFunction('fake', $compiler, function (array $arguments, string $provider = null/* , $othersArgs ... */) {
new ExpressionFunction('fake', $compiler, function (array $arguments, ?string $provider = null/* , $othersArgs ... */) {
$arguments = \func_get_args();

if (!$provider) {
Expand Down Expand Up @@ -222,7 +222,7 @@ public function getFunctions(): array
return $ret;
}),

new ExpressionFunction('regex', $compiler, function (array $arguments, string $regex, string $str = null) {
new ExpressionFunction('regex', $compiler, function (array $arguments, string $regex, ?string $str = null) {
if (null === $str) {
if ($arguments['_response'] instanceof Response) {
$str = $arguments['_response']->body;
Expand Down
2 changes: 1 addition & 1 deletion Player/Http/Cookie.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public function __toString(): string
*
* @throws \InvalidArgumentException
*/
public static function fromString(string $cookie, string $url = null): static
public static function fromString(string $cookie, ?string $url = null): static
{
$parts = explode(';', $cookie);

Expand Down
4 changes: 2 additions & 2 deletions Player/Http/CookieJar.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function clear(): void
$this->cookieJar = [];
}

public function updateFromSetCookie(array $setCookies, string $uri = null): void
public function updateFromSetCookie(array $setCookies, ?string $uri = null): void
{
$cookies = [];

Expand All @@ -56,7 +56,7 @@ public function updateFromSetCookie(array $setCookies, string $uri = null): void
}
}

public function updateFromResponse(ResponseInterface $response, string $uri = null): void
public function updateFromResponse(ResponseInterface $response, ?string $uri = null): void
{
$headers = $response->getHeaders(false);
$this->updateFromSetCookie($headers['set-cookie'] ?? [], $uri);
Expand Down
2 changes: 1 addition & 1 deletion Player/Http/CrawlerFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
*/
class CrawlerFactory
{
public static function create(Response $response, null|string $uri): ?Crawler
public static function create(Response $response, string|null $uri): ?Crawler
{
$contentType = $response->headers['content-type'][0] ?? null;
if (!$contentType) {
Expand Down
2 changes: 1 addition & 1 deletion Player/Http/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function __construct(
public string $uri,
/** @var string[][] */
public array $headers = [],
public null|string|iterable|\Closure $body = null,
public string|iterable|\Closure|null $body = null,
public array $options = [],
) {
}
Expand Down
2 changes: 1 addition & 1 deletion Player/Parser.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ protected function doLoad(mixed $file): ScenarioSet
return $this->parse($input, $file);
}

public function parse(string $input, string $file = null): ScenarioSet
public function parse(string $input, ?string $file = null): ScenarioSet
{
$input = new Input($input, $file);

Expand Down
4 changes: 2 additions & 2 deletions Player/PlayerNext.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ class PlayerNext
{
/** @var (StepExtensionInterface|ScenarioExtensionInterface|ScenarioSetExtensionInterface|NextStepExtensionInterface|ExceptionExtensionInterface)[][] */
private array $extensions = [];
private null|array $extensionsSorted = null;
private null|AbstractStep $currentStep = null;
private array|null $extensionsSorted = null;
private AbstractStep|null $currentStep = null;

public function __construct(
private readonly StepContextFactory $stepContextFactory,
Expand Down
4 changes: 2 additions & 2 deletions Player/ScenarioContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
*/
class ScenarioContext
{
private null|Response $lastResponse = null;
private null|Crawler $crawler = null;
private Response|null $lastResponse = null;
private Crawler|null $crawler = null;
private ValueBag $valueBag;
private ValueBag $extraBag;

Expand Down
4 changes: 2 additions & 2 deletions Player/ScenarioResult.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class ScenarioResult
{
public function __construct(
private readonly ScenarioContext $scenarioContext,
private null|\Throwable $error,
private \Throwable|null $error,
) {
}

Expand Down Expand Up @@ -53,7 +53,7 @@ public function getError(): ?\Throwable
return $this->error;
}

public function getScenarioName(): null|string
public function getScenarioName(): string|null
{
return $this->scenarioContext->getName();
}
Expand Down
2 changes: 1 addition & 1 deletion Player/SentrySupport.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public static function captureException(\Throwable $throwable, array $eventHint
\Sentry\captureException($throwable, EventHint::fromArray($eventHint));
}

public static function captureMessage(string $message, Severity $level = null, EventHint $hint = null): ?EventId
public static function captureMessage(string $message, ?Severity $level = null, ?EventHint $hint = null): ?EventId
{
return \Sentry\captureMessage($message, $level, $hint);
}
Expand Down
2 changes: 1 addition & 1 deletion Player/Serializer/ScenarioSetSerializer.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public function serializeForJsonView(ScenarioSet $scenarioSet, Build $build): st
return Json::encode($data, \JSON_PRETTY_PRINT);
}

public function normalize(ScenarioSet $scenarioSet, Build $build = null): array
public function normalize(ScenarioSet $scenarioSet, ?Build $build = null): array
{
if ($build) {
$filteredScenarios = array_values(
Expand Down
4 changes: 2 additions & 2 deletions Player/Step/ClickStep.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ class ClickStep extends Step
{
public function __construct(
private readonly string $selector,
string $file = null,
int $line = null,
?string $file = null,
?int $line = null,
) {
parent::__construct($file, $line);
}
Expand Down
12 changes: 6 additions & 6 deletions Player/Step/ConditionStep.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@
*/
class ConditionStep extends BlockStep
{
private null|AbstractStep $ifStep = null;
private null|AbstractStep $elseStep = null;
private AbstractStep|null $ifStep = null;
private AbstractStep|null $elseStep = null;

public function __construct(
private readonly string $condition,
string $file = null,
int $line = null,
?string $file = null,
?int $line = null,
) {
parent::__construct($file, $line);
}
Expand Down Expand Up @@ -59,12 +59,12 @@ public function getCondition(): string
return $this->condition;
}

public function getIfStep(): null|AbstractStep
public function getIfStep(): AbstractStep|null
{
return $this->ifStep;
}

public function getElseStep(): null|AbstractStep
public function getElseStep(): AbstractStep|null
{
return $this->elseStep;
}
Expand Down
2 changes: 1 addition & 1 deletion Player/Step/FollowStep.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class FollowStep extends Step implements StepInitiatorInterface
public function __construct(
private readonly ?string $file = null,
private readonly ?int $line = null,
Step $initiator = null
?Step $initiator = null
) {
parent::__construct($file, $line);

Expand Down
4 changes: 2 additions & 2 deletions Player/Step/GroupStep.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ class GroupStep extends BlockStep
{
public function __construct(
private ?string $key,
string $file = null,
int $line = null,
?string $file = null,
?int $line = null,
) {
parent::__construct($file, $line);
}
Expand Down
8 changes: 4 additions & 4 deletions Player/Step/LoopStep.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@
*/
class LoopStep extends BlockStep
{
private null|AbstractStep $loopStep = null;
private AbstractStep|null $loopStep = null;

public function __construct(
private readonly string $values,
private readonly string $keyName,
private readonly string $valueName,
string $file = null,
int $line = null,
?string $file = null,
?int $line = null,
) {
parent::__construct($file, $line);
}
Expand All @@ -48,7 +48,7 @@ public function getValues(): string
return $this->values;
}

public function getLoopStep(): null|AbstractStep
public function getLoopStep(): AbstractStep|null
{
return $this->loopStep;
}
Expand Down
2 changes: 1 addition & 1 deletion Player/Step/ReloadStep.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class ReloadStep extends Step implements StepInitiatorInterface
{
use StepInitiatorTrait;

public function __construct(string $file = null, int $line = null, Step $initiator = null)
public function __construct(?string $file = null, ?int $line = null, ?Step $initiator = null)
{
$this->setInitiator($initiator);
parent::__construct($file, $line);
Expand Down
2 changes: 1 addition & 1 deletion Player/Step/StepInitiatorTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public function getInitiator(): ?Step
return $this->initiator;
}

public function setInitiator(null|Step $step): void
public function setInitiator(Step|null $step): void
{
if ($step instanceof StepInitiatorInterface) {
$this->initiator = $step->getInitiator() ?? $step;
Expand Down
4 changes: 2 additions & 2 deletions Player/Step/SubmitStep.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ class SubmitStep extends Step

public function __construct(
private readonly string $selector,
string $file = null,
int $line = null,
?string $file = null,
?int $line = null,
) {
parent::__construct($file, $line);
}
Expand Down
4 changes: 2 additions & 2 deletions Player/Step/VisitStep.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ class VisitStep extends Step

public function __construct(
private readonly string $uri,
string $file = null,
int $line = null,
?string $file = null,
?int $line = null,
) {
parent::__construct($file, $line);
}
Expand Down
Loading

0 comments on commit 598cb20

Please sign in to comment.