Skip to content

Commit

Permalink
Run php cs fixer
Browse files Browse the repository at this point in the history
  • Loading branch information
romanzipp committed Mar 7, 2024
1 parent 0a5fec2 commit 0a98020
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 15 deletions.
4 changes: 2 additions & 2 deletions src/AbstractData.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public static function isFlexible(): bool
*
* @param string $key
*
* @return \romanzipp\DTO\Property
* @return Property
*/
private function getProperty(string $key): Property
{
Expand Down Expand Up @@ -171,7 +171,7 @@ public function toArrayConverted(string $case = SnakeCase::class): array
throw new \InvalidArgumentException("The given case formatter `{$case}` is invalid");
}

/** @var \romanzipp\DTO\Cases\AbstractCase $caseFormatter */
/** @var AbstractCase $caseFormatter */
$caseFormatter = new $case($values);

return $caseFormatter->format();
Expand Down
2 changes: 0 additions & 2 deletions src/Attributes/Flexible.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

namespace romanzipp\DTO\Attributes;

use Attribute;

#[\Attribute]
class Flexible
{
Expand Down
2 changes: 0 additions & 2 deletions src/Attributes/Required.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

namespace romanzipp\DTO\Attributes;

use Attribute;

#[\Attribute]
class Required
{
Expand Down
2 changes: 1 addition & 1 deletion src/Exceptions/InvalidDataException.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class InvalidDataException extends \InvalidArgumentException
private array $properties = [];

/**
* @param \romanzipp\DTO\Property $property
* @param Property $property
* @param mixed $value
*
* @return self
Expand Down
15 changes: 7 additions & 8 deletions src/Property.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

namespace romanzipp\DTO;

use ReflectionException;
use romanzipp\DTO\Exceptions\InvalidDataException;
use romanzipp\DTO\Values\MissingValue;

Expand Down Expand Up @@ -54,7 +53,7 @@ public function __construct(\ReflectionProperty $reflectionProperty, ?AbstractDa
* Create a new class instance.
*
* @param \ReflectionProperty $reflectionProperty
* @param \romanzipp\DTO\AbstractData $data
* @param AbstractData $data
*
* @return static
*/
Expand All @@ -67,7 +66,7 @@ public static function make(\ReflectionProperty $reflectionProperty, AbstractDat
* Collect all properties form a given class and optional instance.
*
* @param string $class
* @param \romanzipp\DTO\AbstractData|null $data
* @param AbstractData|null $data
*
* @return \romanzipp\DTO\Property[]
*/
Expand All @@ -77,7 +76,7 @@ public static function collect(string $class, ?AbstractData $data = null): array

try {
$reflectionClass = new \ReflectionClass($class);
} catch (ReflectionException) {
} catch (\ReflectionException) {
return $properties;
}

Expand All @@ -96,7 +95,7 @@ public static function collect(string $class, ?AbstractData $data = null): array
* Create an instance from a given data instance and property key.
*
* @param string $key
* @param \romanzipp\DTO\AbstractData $data
* @param AbstractData $data
*
* @return $this
*/
Expand All @@ -106,7 +105,7 @@ public static function fromKey(string $key, AbstractData $data): self
}

/**
* @param \romanzipp\DTO\AbstractData $data
* @param AbstractData $data
*
* @return \romanzipp\DTO\Property[]
*/
Expand Down Expand Up @@ -145,7 +144,7 @@ public function isValid(mixed $value): bool
*
* @param mixed $value
*
* @return \romanzipp\DTO\Exceptions\InvalidDataException|null
* @return InvalidDataException|null
*/
public function getError(mixed $value): ?InvalidDataException
{
Expand Down Expand Up @@ -273,7 +272,7 @@ private function checkIsRequired(): bool
* Check if a property has been initialized with a value.
* This also returns true if a property has been declared with a default value.
*
* @param \romanzipp\DTO\AbstractData $data
* @param AbstractData $data
*
* @return bool
*/
Expand Down

0 comments on commit 0a98020

Please sign in to comment.