Skip to content

Commit

Permalink
Merge pull request #196 from pine3ree/patch-1
Browse files Browse the repository at this point in the history
Allow adding the same tag once only
  • Loading branch information
philipobenito authored Apr 17, 2020
2 parents 7c852a3 + d2116a4 commit 1040b51
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Definition/Definition.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public function __construct(string $id, $concrete = null)
*/
public function addTag(string $tag) : DefinitionInterface
{
$this->tags[] = $tag;
$this->tags[$tag] = true;

return $this;
}
Expand All @@ -78,7 +78,7 @@ public function addTag(string $tag) : DefinitionInterface
*/
public function hasTag(string $tag) : bool
{
return in_array($tag, $this->tags, true);
return isset($this->tags[$tag]);
}

/**
Expand Down

0 comments on commit 1040b51

Please sign in to comment.