Skip to content

Commit b6db635

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

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
@@ -65,7 +65,7 @@ final public function attachCodec(Codec $codec): self
6565
$this->decoders[] = $codec;
6666
$this->encoders[] = $codec;
6767
if ($codec instanceof KnowsCodecLibrary) {
68-
$codec->attachLibrary($this);
68+
$codec->attachCodecLibrary($this);
6969
}
7070

7171
return $this;
@@ -76,7 +76,7 @@ final public function attachDecoder(Decoder $decoder): self
7676
{
7777
$this->decoders[] = $decoder;
7878
if ($decoder instanceof KnowsCodecLibrary) {
79-
$decoder->attachLibrary($this);
79+
$decoder->attachCodecLibrary($this);
8080
}
8181

8282
return $this;
@@ -87,7 +87,7 @@ final public function attachEncoder(Encoder $encoder): self
8787
{
8888
$this->encoders[] = $encoder;
8989
if ($encoder instanceof KnowsCodecLibrary) {
90-
$encoder->attachLibrary($this);
90+
$encoder->attachCodecLibrary($this);
9191
}
9292

9393
return $this;

src/Codec/KnowsCodecLibrary.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,5 @@
2424
*/
2525
interface KnowsCodecLibrary
2626
{
27-
public function attachLibrary(CodecLibrary $library): void;
27+
public function attachCodecLibrary(CodecLibrary $library): void;
2828
}

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)