Skip to content

Commit

Permalink
Linter changes
Browse files Browse the repository at this point in the history
  • Loading branch information
WendellAdriel committed May 26, 2024
1 parent 8b748e5 commit 81f8e28
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/Concerns/StrictusTyping.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ private function validate(mixed $value): void

private function immutableValidate(): void
{
if (false === $this->immutable) {
if ($this->immutable === false) {
return;
}

Expand Down
2 changes: 1 addition & 1 deletion src/Types/StrictusEnum.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function __construct(private string $enumType, private mixed $value, priv

private function validate(mixed $value): void
{
if (false === enum_exists($this->enumType)) {
if (enum_exists($this->enumType) === false) {
throw new StrictusTypeException('Invalid Enum Type');
}

Expand Down
14 changes: 7 additions & 7 deletions src/Types/StrictusUnion.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public function __set(string $name, mixed $value): void
}

/**
* @param array<int, Type> $types $types
* @param array<int, Type> $types $types
*/
private function validateTypes(array $types): void
{
Expand Down Expand Up @@ -137,12 +137,12 @@ private function detectType(mixed $value): void
return;
}

if (false === is_object($value)) {
if (is_object($value) === false) {
throw StrictusTypeException::becauseNotSupportedType(gettype($value));
}

$class = get_class($value);
if ('stdClass' === $class) {
if ($class === 'stdClass') {
$this->type = Type::OBJECT;

return;
Expand Down Expand Up @@ -170,11 +170,11 @@ private function detectType(mixed $value): void
*/
private function setInstance(string $instance): void
{
if (null === $this->type) {
if ($this->type === null) {
throw StrictusTypeException::becauseNullInstanceType();
}

if (Type::ENUM !== $this->type && Type::INSTANCE !== $this->type) {
if ($this->type !== Type::ENUM && $this->type !== Type::INSTANCE) {
throw StrictusTypeException::becauseUnInstanceableType();
}

Expand Down Expand Up @@ -203,11 +203,11 @@ private function getStrictusType(mixed $value): ?StrictusTypeInterface

private function getInstanceableStrictusType(mixed $value): StrictusTypeInterface
{
if (null === $this->type) {
if ($this->type === null) {
throw StrictusTypeException::becauseInvalidSupportedType();
}

if (null === $this->instances || (! isset($this->instances[$this->type->name]))) {
if ($this->instances === null || (! isset($this->instances[$this->type->name]))) {
throw StrictusTypeException::becauseNullInstanceType();
}

Expand Down

0 comments on commit 81f8e28

Please sign in to comment.