Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
vjik committed Nov 5, 2024
1 parent 2564009 commit 7bab0ce
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## 1.3.1 under development

- New #380: Add `TagReference::makeId()` method (@vjik)
- New #380: Add `TagReference::id()` method (@vjik)

## 1.3.0 October 14, 2024

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ $container = new Container($config);
You can get tagged services from the container in the following way:

```php
$container->get(\Yiisoft\Di\Reference\TagReference::makeId('car'));
$container->get(\Yiisoft\Di\Reference\TagReference::id('car'));
```

The result is an array that has two instances: `BlueCarService` and `RedCarService`.
Expand Down
2 changes: 1 addition & 1 deletion src/Reference/TagReference.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ private function __construct()

public static function to(string $tag): Reference
{
return Reference::to(self::makeId($tag));
return Reference::to(self::id($tag));
}

public static function id(string $tag): string
Expand Down
4 changes: 2 additions & 2 deletions tests/Unit/Reference/TagReference/TagReferenceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ public function has($id): bool
$this->assertEquals('tag@test', $result);
}

public function testMakeId(): void
public function testId(): void
{
$this->assertSame('tag@test', TagReference::makeId('test'));
$this->assertSame('tag@test', TagReference::id('test'));
}
}

0 comments on commit 7bab0ce

Please sign in to comment.