Skip to content

Commit e1bb894

Browse files
manickiWMDE bot
authored andcommitted
Removed no longer used newFromRepositoryAndNumber from ItemId/PropertyId
Bug: T291823 Change-Id: Ie22e6b41d1cda46b531464b9d73fb2441322c522
1 parent 25c673b commit e1bb894

4 files changed

Lines changed: 0 additions & 61 deletions

File tree

src/Entity/ItemId.php

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -113,26 +113,4 @@ public static function newFromNumber( $numericId ) {
113113
return new self( 'Q' . $numericId );
114114
}
115115

116-
/**
117-
* CAUTION: Use the full string serialization whenever you can and avoid using numeric IDs.
118-
*
119-
* @since 7.0
120-
*
121-
* @param string $repositoryName
122-
* @param int|float|string $numericId
123-
*
124-
* @return self
125-
* @throws InvalidArgumentException
126-
*/
127-
public static function newFromRepositoryAndNumber( $repositoryName, $numericId ) {
128-
if ( !is_numeric( $numericId ) ) {
129-
throw new InvalidArgumentException( '$numericId must be numeric' );
130-
}
131-
if ( $repositoryName !== '' ) {
132-
throw new InvalidArgumentException( 'repo name no longer supported (T291823)' );
133-
}
134-
135-
return new self( self::joinSerialization( [ $repositoryName, '', 'Q' . $numericId ] ) );
136-
}
137-
138116
}

src/Entity/NumericPropertyId.php

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -107,23 +107,4 @@ public static function newFromNumber( $numericId ) {
107107
return new self( 'P' . $numericId );
108108
}
109109

110-
/**
111-
* CAUTION: Use the full string serialization whenever you can and avoid using numeric IDs.
112-
*
113-
* @param string $repositoryName
114-
* @param int|float|string $numericId
115-
*
116-
* @return self
117-
* @throws InvalidArgumentException
118-
*/
119-
public static function newFromRepositoryAndNumber( $repositoryName, $numericId ) {
120-
if ( !is_numeric( $numericId ) ) {
121-
throw new InvalidArgumentException( '$numericId must be numeric' );
122-
}
123-
if ( $repositoryName !== '' ) {
124-
throw new InvalidArgumentException( 'repo name no longer supported (T291823)' );
125-
}
126-
127-
return new self( self::joinSerialization( [ $repositoryName, '', 'P' . $numericId ] ) );
128-
}
129110
}

tests/unit/Entity/ItemIdTest.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -150,14 +150,4 @@ public static function invalidNumericIdProvider() {
150150
];
151151
}
152152

153-
public function testNewFromRepositoryAndNumber() {
154-
$id = ItemId::newFromRepositoryAndNumber( '', 1 );
155-
$this->assertSame( 'Q1', $id->getSerialization() );
156-
}
157-
158-
public function testNewFromRepositoryAndNumberWithInvalidNumericId() {
159-
$this->expectException( InvalidArgumentException::class );
160-
ItemId::newFromRepositoryAndNumber( '', 'Q1' );
161-
}
162-
163153
}

tests/unit/Entity/NumericPropertyIdTest.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -149,14 +149,4 @@ public static function invalidNumericIdProvider() {
149149
];
150150
}
151151

152-
public function testNewFromRepositoryAndNumber() {
153-
$id = NumericPropertyId::newFromRepositoryAndNumber( '', 1 );
154-
$this->assertSame( 'P1', $id->getSerialization() );
155-
}
156-
157-
public function testNewFromRepositoryAndNumberWithInvalidNumericId() {
158-
$this->expectException( InvalidArgumentException::class );
159-
NumericPropertyId::newFromRepositoryAndNumber( '', 'P1' );
160-
}
161-
162152
}

0 commit comments

Comments
 (0)