chore: style changes

This commit is contained in:
Nuno Maduro
2023-05-31 01:40:03 +01:00
parent 80129f2e23
commit e2ccc9deac
2 changed files with 6 additions and 12 deletions

View File

@ -8,7 +8,6 @@ use BadMethodCallException;
use Closure; use Closure;
use Pest\Arch\Contracts\ArchExpectation; use Pest\Arch\Contracts\ArchExpectation;
use Pest\Arch\Expectations\Targeted; use Pest\Arch\Expectations\Targeted;
use Pest\Arch\Expectations\ToBe;
use Pest\Arch\Expectations\ToBeUsedIn; use Pest\Arch\Expectations\ToBeUsedIn;
use Pest\Arch\Expectations\ToBeUsedInNothing; use Pest\Arch\Expectations\ToBeUsedInNothing;
use Pest\Arch\Expectations\ToOnlyBeUsedIn; use Pest\Arch\Expectations\ToOnlyBeUsedIn;
@ -503,7 +502,7 @@ final class Expectation
return Targeted::make( return Targeted::make(
$this, $this,
fn (ObjectDescription $object): bool => $object->reflectionClass->getParentClass() === false, fn (ObjectDescription $object): bool => $object->reflectionClass->getParentClass() === false,
"to extend nothing", 'to extend nothing',
FileLineFinder::where(function (string $line): bool { FileLineFinder::where(function (string $line): bool {
return str_contains($line, 'class'); return str_contains($line, 'class');
}), }),
@ -518,7 +517,7 @@ final class Expectation
return Targeted::make( return Targeted::make(
$this, $this,
fn (ObjectDescription $object): bool => $object->reflectionClass->getInterfaceNames() === [], fn (ObjectDescription $object): bool => $object->reflectionClass->getInterfaceNames() === [],
"to implement nothing", 'to implement nothing',
FileLineFinder::where(function (string $line): bool { FileLineFinder::where(function (string $line): bool {
return str_contains($line, 'class'); return str_contains($line, 'class');
}), }),
@ -582,7 +581,7 @@ final class Expectation
return Targeted::make( return Targeted::make(
$this, $this,
function (ObjectDescription $object) use ($interfaces) : bool { function (ObjectDescription $object) use ($interfaces): bool {
foreach ($interfaces as $interface) { foreach ($interfaces as $interface) {
if (! $object->reflectionClass->implementsInterface($interface)) { if (! $object->reflectionClass->implementsInterface($interface)) {
return false; return false;

View File

@ -5,15 +5,10 @@ declare(strict_types=1);
namespace Pest\Expectations; namespace Pest\Expectations;
use Pest\Arch\Contracts\ArchExpectation; use Pest\Arch\Contracts\ArchExpectation;
use Pest\Arch\Exceptions\ArchExpectationFailedException;
use Pest\Arch\Expectations\NotToUseStrictTypes;
use Pest\Arch\Expectations\Targeted; use Pest\Arch\Expectations\Targeted;
use Pest\Arch\Expectations\ToBe;
use Pest\Arch\Expectations\ToBeFinal;
use Pest\Arch\Expectations\ToBeUsedIn; use Pest\Arch\Expectations\ToBeUsedIn;
use Pest\Arch\Expectations\ToBeUsedInNothing; use Pest\Arch\Expectations\ToBeUsedInNothing;
use Pest\Arch\Expectations\ToUse; use Pest\Arch\Expectations\ToUse;
use Pest\Arch\Expectations\ToUseStrictTypes;
use Pest\Arch\GroupArchExpectation; use Pest\Arch\GroupArchExpectation;
use Pest\Arch\SingleArchExpectation; use Pest\Arch\SingleArchExpectation;
use Pest\Arch\Support\FileLineFinder; use Pest\Arch\Support\FileLineFinder;
@ -210,7 +205,7 @@ final class OppositeExpectation
return Targeted::make( return Targeted::make(
$this->original, $this->original,
fn (ObjectDescription $object): bool => $object->reflectionClass->getParentClass() !== false, fn (ObjectDescription $object): bool => $object->reflectionClass->getParentClass() !== false,
"to extend a class", 'to extend a class',
FileLineFinder::where(function (string $line): bool { FileLineFinder::where(function (string $line): bool {
return str_contains($line, 'class'); return str_contains($line, 'class');
}), }),
@ -226,7 +221,7 @@ final class OppositeExpectation
return Targeted::make( return Targeted::make(
$this->original, $this->original,
function (ObjectDescription $object) use ($interfaces) : bool { function (ObjectDescription $object) use ($interfaces): bool {
foreach ($interfaces as $interface) { foreach ($interfaces as $interface) {
if ($object->reflectionClass->implementsInterface($interface)) { if ($object->reflectionClass->implementsInterface($interface)) {
return false; return false;
@ -250,7 +245,7 @@ final class OppositeExpectation
return Targeted::make( return Targeted::make(
$this, $this,
fn (ObjectDescription $object): bool => $object->reflectionClass->getInterfaceNames() !== [], fn (ObjectDescription $object): bool => $object->reflectionClass->getInterfaceNames() !== [],
"to implement an interface", 'to implement an interface',
FileLineFinder::where(function (string $line): bool { FileLineFinder::where(function (string $line): bool {
return str_contains($line, 'class'); return str_contains($line, 'class');
}), }),