File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -83,21 +83,18 @@ public function getId() {
8383 }
8484
8585 /**
86- * Can be integer since 0.1.
87- * Can be ItemId since 0.5.
88- * Can be null since 1.0.
86+ * @since 0.5, can be null since 1.0
8987 *
9088 * @param ItemId|null $id
9189 *
9290 * @throws InvalidArgumentException
9391 */
9492 public function setId ( $ id ) {
95- if ( $ id === null || $ id instanceof ItemId ) {
96- $ this ->id = $ id ;
97- } else {
98- throw new InvalidArgumentException ( '$id must be an instance of ItemId, an integer, '
99- . ' or null ' );
93+ if ( !( $ id instanceof ItemId ) && $ id !== null ) {
94+ throw new InvalidArgumentException ( '$id must be an ItemId or null ' );
10095 }
96+
97+ $ this ->id = $ id ;
10198 }
10299
103100 /**
Original file line number Diff line number Diff line change @@ -81,21 +81,18 @@ public function getId() {
8181 }
8282
8383 /**
84- * Can be integer since 0.1.
85- * Can be PropertyId since 0.5.
86- * Can be null since 1.0.
84+ * @since 0.5, can be null since 1.0
8785 *
8886 * @param PropertyId|null $id
8987 *
9088 * @throws InvalidArgumentException
9189 */
9290 public function setId ( $ id ) {
93- if ( $ id === null || $ id instanceof PropertyId ) {
94- $ this ->id = $ id ;
95- } else {
96- throw new InvalidArgumentException ( '$id must be an instance of PropertyId, an integer, '
97- . ' or null ' );
91+ if ( !( $ id instanceof PropertyId ) && $ id !== null ) {
92+ throw new InvalidArgumentException ( '$id must be a PropertyId or null ' );
9893 }
94+
95+ $ this ->id = $ id ;
9996 }
10097
10198 /**
You can’t perform that action at this time.
0 commit comments