File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -130,15 +130,15 @@ public function getWithUniqueMainSnaks() {
130130 * @return StatementList
131131 */
132132 public function getWithPropertyId ( PropertyId $ id ) {
133- $ statements = array ();
133+ $ statementList = new self ();
134134
135135 foreach ( $ this ->statements as $ statement ) {
136136 if ( $ statement ->getPropertyId ()->equals ( $ id ) ) {
137- $ statements [] = $ statement ;
137+ $ statementList -> addStatement ( $ statement ) ;
138138 }
139139 }
140140
141- return new self ( $ statements ) ;
141+ return $ statementList ;
142142 }
143143
144144 /**
@@ -150,15 +150,15 @@ public function getWithPropertyId( PropertyId $id ) {
150150 */
151151 public function getWithRank ( $ acceptableRanks ) {
152152 $ acceptableRanks = array_flip ( (array )$ acceptableRanks );
153- $ statements = array ();
153+ $ statementList = new self ();
154154
155155 foreach ( $ this ->statements as $ statement ) {
156156 if ( array_key_exists ( $ statement ->getRank (), $ acceptableRanks ) ) {
157- $ statements [] = $ statement ;
157+ $ statementList -> addStatement ( $ statement ) ;
158158 }
159159 }
160160
161- return new self ( $ statements ) ;
161+ return $ statementList ;
162162 }
163163
164164 /**
You can’t perform that action at this time.
0 commit comments