@@ -62,53 +62,6 @@ public function getSerialization() {
6262 return $ this ->serialization ;
6363 }
6464
65- /**
66- * Returns an array with 3 elements: the foreign repository name as the first element, the local ID as the last
67- * element and everything that is in between as the second element.
68- *
69- * SerializableEntityId::joinSerialization can be used to restore the original serialization from the parts returned.
70- *
71- * @param string $serialization
72- *
73- * @throws InvalidArgumentException
74- * @return string[] Array containing the serialization split into 3 parts.
75- */
76- public static function splitSerialization ( $ serialization ) {
77- self ::assertValidSerialization ( $ serialization );
78-
79- return self ::extractSerializationParts ( self ::normalizeIdSerialization ( $ serialization ) );
80- }
81-
82- /**
83- * Splits the given ID serialization into an array with the following three elements:
84- * - the repository name as the first element (empty string for local repository)
85- * - any parts of the ID serialization but the repository name and the local ID (if any, empty string
86- * if nothing else present)
87- * - the local ID
88- * Note: this method does not perform any validation of the given input. Calling code should take
89- * care of this!
90- *
91- * @param string $serialization
92- *
93- * @return string[]
94- */
95- private static function extractSerializationParts ( $ serialization ) {
96- $ parts = explode ( ': ' , $ serialization );
97- $ localPart = array_pop ( $ parts );
98- $ repoName = array_shift ( $ parts );
99- $ prefixRemainder = implode ( ': ' , $ parts );
100-
101- if ( $ repoName !== null ) {
102- throw new InvalidArgumentException ( 'repo name no longer supported (T291823) ' );
103- }
104-
105- return [
106- is_string ( $ repoName ) ? $ repoName : '' ,
107- $ prefixRemainder ,
108- $ localPart ,
109- ];
110- }
111-
11265 /**
11366 * Returns '' for local IDs and the foreign repository name for foreign IDs. For chained IDs (e.g. foo:bar:Q42) it
11467 * will return only the first part.
0 commit comments