mirror of
https://github.com/pestphp/pest.git
synced 2026-03-11 10:17:23 +01:00
feat: improve grammar
This commit is contained in:
@ -432,6 +432,14 @@ final class Expectation
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Asserts that the given expectation targets are traits.
|
||||||
|
*/
|
||||||
|
public function toBeTraits(): ArchExpectation
|
||||||
|
{
|
||||||
|
return $this->toBeTrait();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Asserts that the given expectation target is abstract.
|
* Asserts that the given expectation target is abstract.
|
||||||
*/
|
*/
|
||||||
@ -462,6 +470,14 @@ final class Expectation
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Asserts that the given expectation targets are enums.
|
||||||
|
*/
|
||||||
|
public function toBeEnums(): ArchExpectation
|
||||||
|
{
|
||||||
|
return $this->toBeEnum();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Asserts that the given expectation target is interface.
|
* Asserts that the given expectation target is interface.
|
||||||
*/
|
*/
|
||||||
@ -477,6 +493,14 @@ final class Expectation
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Asserts that the given expectation targets are interfaces.
|
||||||
|
*/
|
||||||
|
public function toBeInterfaces(): ArchExpectation
|
||||||
|
{
|
||||||
|
return $this->toBeInterface();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Asserts that the given expectation target to be subclass of the given class.
|
* Asserts that the given expectation target to be subclass of the given class.
|
||||||
*
|
*
|
||||||
@ -526,6 +550,8 @@ final class Expectation
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Asserts that the given expectation target to only implement the given interfaces.
|
* Asserts that the given expectation target to only implement the given interfaces.
|
||||||
|
*
|
||||||
|
* @param array<int, class-string>|class-string $interfaces
|
||||||
*/
|
*/
|
||||||
public function toOnlyImplement(array|string $interfaces): ArchExpectation
|
public function toOnlyImplement(array|string $interfaces): ArchExpectation
|
||||||
{
|
{
|
||||||
@ -535,7 +561,7 @@ final class Expectation
|
|||||||
$this,
|
$this,
|
||||||
fn (ObjectDescription $object): bool => count($interfaces) === count($object->reflectionClass->getInterfaceNames())
|
fn (ObjectDescription $object): bool => count($interfaces) === count($object->reflectionClass->getInterfaceNames())
|
||||||
&& array_diff($interfaces, $object->reflectionClass->getInterfaceNames()) === [],
|
&& array_diff($interfaces, $object->reflectionClass->getInterfaceNames()) === [],
|
||||||
"to only implement '".implode("', '", (array) $interfaces)."'",
|
"to only implement '".implode("', '", $interfaces)."'",
|
||||||
FileLineFinder::where(function (string $line): bool {
|
FileLineFinder::where(function (string $line): bool {
|
||||||
return str_contains($line, 'class');
|
return str_contains($line, 'class');
|
||||||
}),
|
}),
|
||||||
@ -574,6 +600,8 @@ final class Expectation
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Asserts that the given expectation target to implement the given interfaces.
|
* Asserts that the given expectation target to implement the given interfaces.
|
||||||
|
*
|
||||||
|
* @param array<int, class-string>|class-string $interfaces
|
||||||
*/
|
*/
|
||||||
public function toImplement(array|string $interfaces): ArchExpectation
|
public function toImplement(array|string $interfaces): ArchExpectation
|
||||||
{
|
{
|
||||||
@ -590,7 +618,7 @@ final class Expectation
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
"to implement '".implode("', '", (array) $interfaces)."'",
|
"to implement '".implode("', '", $interfaces)."'",
|
||||||
FileLineFinder::where(function (string $line): bool {
|
FileLineFinder::where(function (string $line): bool {
|
||||||
return str_contains($line, 'class');
|
return str_contains($line, 'class');
|
||||||
}),
|
}),
|
||||||
|
|||||||
Reference in New Issue
Block a user