@@ -12,16 +12,6 @@ abstract class SerializableEntityId implements EntityId {
1212
1313 protected $ serialization ;
1414
15- /**
16- * @var string
17- */
18- protected $ repositoryName ;
19-
20- /**
21- * @var string
22- */
23- protected $ localPart ;
24-
2515 public const PATTERN = '/^[^:]+\z/ ' ;
2616
2717 /**
@@ -32,8 +22,6 @@ abstract class SerializableEntityId implements EntityId {
3222 public function __construct ( $ serialization ) {
3323 self ::assertValidSerialization ( $ serialization );
3424 $ this ->serialization = self ::normalizeIdSerialization ( $ serialization );
35-
36- list ( $ this ->repositoryName , $ this ->localPart ) = self ::extractRepositoryNameAndLocalPart ( $ serialization );
3725 }
3826
3927 private static function assertValidSerialization ( $ serialization ) {
@@ -62,25 +50,6 @@ public function getSerialization() {
6250 return $ this ->serialization ;
6351 }
6452
65- /**
66- * Returns '' for local IDs and the foreign repository name for foreign IDs. For chained IDs (e.g. foo:bar:Q42) it
67- * will return only the first part.
68- *
69- * @return string
70- */
71- public function getRepositoryName () {
72- return $ this ->repositoryName ;
73- }
74-
75- /**
76- * Returns the serialization without the first repository prefix.
77- *
78- * @return string
79- */
80- public function getLocalPart () {
81- return $ this ->localPart ;
82- }
83-
8453 /**
8554 * @param string $id
8655 *
@@ -119,17 +88,4 @@ abstract public function __serialize(): array;
11988
12089 abstract public function __unserialize ( array $ serialized ): void ;
12190
122- /**
123- * Returns a pair (repository name, local part of ID) from the given ID serialization.
124- * Note: this does not perform any validation of the given input. Calling code should take
125- * care of this!
126- *
127- * @param string $serialization
128- *
129- * @return string[] Array of form [ string $repositoryName, string $localPart ]
130- */
131- protected static function extractRepositoryNameAndLocalPart ( $ serialization ) {
132- return array_pad ( explode ( ': ' , $ serialization , 2 ), -2 , '' );
133- }
134-
13591}
0 commit comments