mirror of
https://github.com/pestphp/pest.git
synced 2026-03-06 07:47:22 +01:00
Merge pull request #497 from pestphp/feature/style
style: apply fixes from PHP-CS-Fixer
This commit is contained in:
@ -43,7 +43,7 @@ trait Pipeable
|
|||||||
$this->pipe($name, function ($next, ...$arguments) use ($handler, $filter) {
|
$this->pipe($name, function ($next, ...$arguments) use ($handler, $filter) {
|
||||||
/* @phpstan-ignore-next-line */
|
/* @phpstan-ignore-next-line */
|
||||||
if ($filter($this->value, ...$arguments)) {
|
if ($filter($this->value, ...$arguments)) {
|
||||||
//@phpstan-ignore-next-line
|
// @phpstan-ignore-next-line
|
||||||
$handler->bindTo($this, get_class($this))(...$arguments);
|
$handler->bindTo($this, get_class($this))(...$arguments);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|||||||
@ -307,7 +307,7 @@ final class Expectation
|
|||||||
private function getExpectationClosure(string $name): Closure
|
private function getExpectationClosure(string $name): Closure
|
||||||
{
|
{
|
||||||
if (method_exists(Mixins\Expectation::class, $name)) {
|
if (method_exists(Mixins\Expectation::class, $name)) {
|
||||||
//@phpstan-ignore-next-line
|
// @phpstan-ignore-next-line
|
||||||
return Closure::fromCallable([new Mixins\Expectation($this->value), $name]);
|
return Closure::fromCallable([new Mixins\Expectation($this->value), $name]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -37,7 +37,7 @@ final class Kernel
|
|||||||
public static function boot(): self
|
public static function boot(): self
|
||||||
{
|
{
|
||||||
foreach (self::$bootstrappers as $bootstrapper) {
|
foreach (self::$bootstrappers as $bootstrapper) {
|
||||||
//@phpstan-ignore-next-line
|
// @phpstan-ignore-next-line
|
||||||
(new $bootstrapper())->__invoke();
|
(new $bootstrapper())->__invoke();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -283,7 +283,7 @@ final class Expectation
|
|||||||
{
|
{
|
||||||
$this->toBeObject();
|
$this->toBeObject();
|
||||||
|
|
||||||
//@phpstan-ignore-next-line
|
// @phpstan-ignore-next-line
|
||||||
Assert::assertTrue(property_exists($this->value, $name));
|
Assert::assertTrue(property_exists($this->value, $name));
|
||||||
|
|
||||||
if (func_num_args() > 1) {
|
if (func_num_args() > 1) {
|
||||||
@ -534,7 +534,7 @@ final class Expectation
|
|||||||
{
|
{
|
||||||
Assert::assertIsString($this->value);
|
Assert::assertIsString($this->value);
|
||||||
|
|
||||||
//@phpstan-ignore-next-line
|
// @phpstan-ignore-next-line
|
||||||
Assert::assertJson($this->value);
|
Assert::assertJson($this->value);
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
|
|||||||
@ -156,11 +156,11 @@ final class DatasetsRepository
|
|||||||
$datasets[$index] = iterator_to_array($datasets[$index]);
|
$datasets[$index] = iterator_to_array($datasets[$index]);
|
||||||
}
|
}
|
||||||
|
|
||||||
//@phpstan-ignore-next-line
|
// @phpstan-ignore-next-line
|
||||||
foreach ($datasets[$index] as $key => $values) {
|
foreach ($datasets[$index] as $key => $values) {
|
||||||
$values = is_array($values) ? $values : [$values];
|
$values = is_array($values) ? $values : [$values];
|
||||||
$processedDataset[] = [
|
$processedDataset[] = [
|
||||||
'label' => self::getDatasetDescription($key, $values), //@phpstan-ignore-line
|
'label' => self::getDatasetDescription($key, $values), // @phpstan-ignore-line
|
||||||
'values' => $values,
|
'values' => $values,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
@ -189,7 +189,7 @@ final class DatasetsRepository
|
|||||||
$result = $tmp;
|
$result = $tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
//@phpstan-ignore-next-line
|
// @phpstan-ignore-next-line
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -85,7 +85,7 @@ final class Container
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//@phpstan-ignore-next-line
|
// @phpstan-ignore-next-line
|
||||||
return $this->get($candidate);
|
return $this->get($candidate);
|
||||||
},
|
},
|
||||||
$constructor->getParameters()
|
$constructor->getParameters()
|
||||||
|
|||||||
@ -40,7 +40,7 @@ final class HigherOrderMessageCollection
|
|||||||
public function chain(object $target): void
|
public function chain(object $target): void
|
||||||
{
|
{
|
||||||
foreach ($this->messages as $message) {
|
foreach ($this->messages as $message) {
|
||||||
//@phpstan-ignore-next-line
|
// @phpstan-ignore-next-line
|
||||||
$target = $message->call($target) ?? $target;
|
$target = $message->call($target) ?? $target;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -12,7 +12,7 @@ class Number
|
|||||||
public function __construct(
|
public function __construct(
|
||||||
public int $value
|
public int $value
|
||||||
) {
|
) {
|
||||||
//..
|
// ..
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -21,7 +21,7 @@ class Char
|
|||||||
public function __construct(
|
public function __construct(
|
||||||
public string $value
|
public string $value
|
||||||
) {
|
) {
|
||||||
//..
|
// ..
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -30,7 +30,7 @@ class Symbol
|
|||||||
public function __construct(
|
public function __construct(
|
||||||
public string $value
|
public string $value
|
||||||
) {
|
) {
|
||||||
//..
|
// ..
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -69,11 +69,11 @@ expect()->pipe('toBe', function ($next, $expected) use ($state) {
|
|||||||
assertInstanceOf(Char::class, $expected);
|
assertInstanceOf(Char::class, $expected);
|
||||||
assertEquals($this->value->value, $expected->value);
|
assertEquals($this->value->value, $expected->value);
|
||||||
|
|
||||||
//returning nothing stops pipeline execution
|
// returning nothing stops pipeline execution
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//calling $next(); let the pipeline to keep running
|
// calling $next(); let the pipeline to keep running
|
||||||
$next();
|
$next();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user