Skip to content

Commit cea5852

Browse files
committed
Rename attachLibrary method in KnowsCodecLibrary interface
The new method name is more specific and helps prevent naming conflicts
1 parent e2f6f68 commit cea5852

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/Codec/CodecLibrary.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ final public function attachCodec(Codec $codec): self
5050
$this->decoders[] = $codec;
5151
$this->encoders[] = $codec;
5252
if ($codec instanceof KnowsCodecLibrary) {
53-
$codec->attachLibrary($this);
53+
$codec->attachCodecLibrary($this);
5454
}
5555

5656
return $this;
@@ -61,7 +61,7 @@ final public function attachDecoder(Decoder $decoder): self
6161
{
6262
$this->decoders[] = $decoder;
6363
if ($decoder instanceof KnowsCodecLibrary) {
64-
$decoder->attachLibrary($this);
64+
$decoder->attachCodecLibrary($this);
6565
}
6666

6767
return $this;
@@ -72,7 +72,7 @@ final public function attachEncoder(Encoder $encoder): self
7272
{
7373
$this->encoders[] = $encoder;
7474
if ($encoder instanceof KnowsCodecLibrary) {
75-
$encoder->attachLibrary($this);
75+
$encoder->attachCodecLibrary($this);
7676
}
7777

7878
return $this;

src/Codec/KnowsCodecLibrary.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@
99
*/
1010
interface KnowsCodecLibrary
1111
{
12-
public function attachLibrary(CodecLibrary $library): void;
12+
public function attachCodecLibrary(CodecLibrary $library): void;
1313
}

tests/Codec/CodecLibraryTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ private function getTestCodec(): Codec
145145

146146
public $library;
147147

148-
public function attachLibrary(CodecLibrary $library): void
148+
public function attachCodecLibrary(CodecLibrary $library): void
149149
{
150150
$this->library = $library;
151151
}

0 commit comments

Comments
 (0)