Skip to content

Commit bd51ba8

Browse files
committed
fixed phpdoc
1 parent efb64ad commit bd51ba8

File tree

3 files changed

+5
-14
lines changed

3 files changed

+5
-14
lines changed

src/Serialize.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ public function setContext(SerializeContext $context): static
3232

3333
public static function setGroups(array|string $groups): SerializeContext
3434
{
35-
/** @var SerializeContext<static> $serializeContext */
3635
$serializeContext = ContextFactory::build(static::class);
3736
return $serializeContext->setGroups((array)$groups);
3837
}

src/Support/Context/SerializeContext.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,13 @@
2020
use ReflectionProperty;
2121
use RuntimeException;
2222

23-
/**
24-
* @template T
25-
*/
2623
class SerializeContext
2724
{
2825
private array $groups = [];
2926
private array $responses = [];
3027

3128
public function __construct(
32-
/** @var class-string<T> */
29+
/** @var class-string */
3330
private readonly string $serializeClassName,
3431
private readonly ChooseSerializeContext $chooseSerializeContext,
3532
private readonly CacheInterface $cache,
@@ -208,6 +205,7 @@ className: $type->className,
208205

209206
/**
210207
* @param mixed ...$payload
208+
* @return object
211209
*/
212210
public function from(mixed ...$payload): object
213211
{
@@ -220,7 +218,7 @@ public function from(mixed ...$payload): object
220218

221219
$this->chooseSerializeContext->setGroups($this->getGroups());
222220

223-
/** @var T $object */
221+
224222
$object = $this->propertyInputValueResolver->resolve($this->chooseSerializeContext, $this->getGroupCollection(), $payloads);
225223

226224
if ($object instanceof Serialize && $object->getContext() === null) {
@@ -231,7 +229,7 @@ public function from(mixed ...$payload): object
231229

232230
}
233231

234-
public function faker()
232+
public function faker(): object
235233
{
236234
$this->chooseSerializeContext->setGroups($this->getGroups());
237235
return $this->fakerResolver->resolve($this->chooseSerializeContext, $this->getGroupCollection());

src/Support/Factories/ContextFactory.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,9 @@
66
use Astral\Serialize\Support\Context\ChooseSerializeContext;
77
use Astral\Serialize\Support\Context\SerializeContext;
88

9-
/**
10-
* @template T
11-
*/
9+
1210
class ContextFactory
1311
{
14-
/**
15-
* @param class-string<T> $className
16-
* @return SerializeContext<T>
17-
*/
1812
public static function build(string $className): SerializeContext
1913
{
2014
return (new SerializeContext(

0 commit comments

Comments
 (0)