Skip to content

Commit

Permalink
PHPStan documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
Crell committed Sep 6, 2024
1 parent f80b40a commit 7c49aa4
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/Formatter/TomlFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,24 @@ public function serializeFinalize(mixed $runningValue, ClassSettings $classDef):
return Toml::encode($runningValue['root']);
}

/**
* @param array<string, mixed> $runningValue
* @param Field $field
* @param Sequence $next
* @return array<string, mixed>
*/
public function serializeSequence(mixed $runningValue, Field $field, Sequence $next, Serializer $serializer): array
{
$next->items = array_filter(collect($next->items), static fn(CollectionItem $i) => !is_null($i->value));
return $this->serializeArraySequence($runningValue, $field, $next, $serializer);
}

/**
* @param array<string, mixed> $runningValue
* @param Field $field
* @param Dict $next
* @return array<string, mixed>
*/
public function serializeDictionary(mixed $runningValue, Field $field, Dict $next, Serializer $serializer): array
{
$next->items = array_filter(collect($next->items), static fn(CollectionItem $i) => !is_null($i->value));
Expand Down

0 comments on commit 7c49aa4

Please sign in to comment.