Skip to content

Commit

Permalink
Apply PER-2.0 and fix psalm errors
Browse files Browse the repository at this point in the history
  • Loading branch information
SerafimArts committed Apr 2, 2024
1 parent 2e8e6b7 commit dafd99a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Factory.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,16 @@ public function __construct(

public function add(array|string $tags, FactoryInterface $delegate): void
{
foreach ((array)$tags as $tag) {
foreach ((array) $tags as $tag) {
$this->factories[$tag] = $delegate;
}
}

public function create(string $name, string $content, DescriptionParserInterface $descriptions): Tag
{
if (($delegate = $this->factories[$name]) !== null) {
$delegate = $this->factories[$name] ?? null;

if ($delegate !== null) {
return $delegate->create($name, $content, $descriptions);
}

Expand Down
3 changes: 3 additions & 0 deletions src/MutableFactoryInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,8 @@

interface MutableFactoryInterface extends FactoryInterface
{
/**
* @param non-empty-string|list<non-empty-string> $tags
*/
public function add(string|array $tags, FactoryInterface $delegate): void;
}

0 comments on commit dafd99a

Please sign in to comment.