File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -22,19 +22,14 @@ class ItemId extends EntityId implements Int32EntityId {
2222 * @throws InvalidArgumentException
2323 */
2424 public function __construct ( $ idSerialization ) {
25- $ serializationParts = self ::splitSerialization ( $ idSerialization );
26- $ localId = strtoupper ( $ serializationParts [2 ] );
27- $ this ->assertValidIdFormat ( $ localId );
25+ $ parts = self ::splitSerialization ( $ idSerialization );
26+ $ this ->assertValidIdFormat ( $ parts [2 ] );
2827 parent ::__construct ( self ::joinSerialization (
29- [ $ serializationParts [0 ], $ serializationParts [1 ], $ localId ] )
30- );
28+ [ $ parts [0 ], $ parts [1 ], strtoupper ( $ parts [ 2 ] ) ]
29+ ) ) ;
3130 }
3231
3332 private function assertValidIdFormat ( $ idSerialization ) {
34- if ( !is_string ( $ idSerialization ) ) {
35- throw new InvalidArgumentException ( '$idSerialization must be a string ' );
36- }
37-
3833 if ( !preg_match ( self ::PATTERN , $ idSerialization ) ) {
3934 throw new InvalidArgumentException ( '$idSerialization must match ' . self ::PATTERN );
4035 }
Original file line number Diff line number Diff line change @@ -22,19 +22,14 @@ class PropertyId extends EntityId implements Int32EntityId {
2222 * @throws InvalidArgumentException
2323 */
2424 public function __construct ( $ idSerialization ) {
25- $ serializationParts = self ::splitSerialization ( $ idSerialization );
26- $ localId = strtoupper ( $ serializationParts [2 ] );
27- $ this ->assertValidIdFormat ( $ localId );
25+ $ parts = self ::splitSerialization ( $ idSerialization );
26+ $ this ->assertValidIdFormat ( $ parts [2 ] );
2827 parent ::__construct ( self ::joinSerialization (
29- [ $ serializationParts [0 ], $ serializationParts [1 ], $ localId ] )
30- );
28+ [ $ parts [0 ], $ parts [1 ], strtoupper ( $ parts [ 2 ] ) ]
29+ ) ) ;
3130 }
3231
3332 private function assertValidIdFormat ( $ idSerialization ) {
34- if ( !is_string ( $ idSerialization ) ) {
35- throw new InvalidArgumentException ( '$idSerialization must be a string ' );
36- }
37-
3833 if ( !preg_match ( self ::PATTERN , $ idSerialization ) ) {
3934 throw new InvalidArgumentException ( '$idSerialization must match ' . self ::PATTERN );
4035 }
You can’t perform that action at this time.
0 commit comments