File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -93,8 +93,10 @@ public function getModule(): ?string
9393 }
9494
9595
96+ /** @deprecated */
9697 public function count (): int
9798 {
99+ trigger_error (__METHOD__ . '() is deprecated. ' , E_USER_DEPRECATED );
98100 return count ($ this ->getRouters ());
99101 }
100102
@@ -132,7 +134,7 @@ public function offsetGet($index)
132134 */
133135 public function offsetExists ($ index ): bool
134136 {
135- return is_int ($ index ) && $ index >= 0 && $ index < $ this ->count ( );
137+ return is_int ($ index ) && $ index >= 0 && $ index < count ( $ this ->getRouters () );
136138 }
137139
138140
@@ -149,8 +151,10 @@ public function offsetUnset($index): void
149151 }
150152
151153
154+ /** @deprecated */
152155 public function getIterator (): \ArrayIterator
153156 {
157+ trigger_error (__METHOD__ . '() is deprecated, use getRouters(). ' , E_USER_DEPRECATED );
154158 return new \ArrayIterator ($ this ->getRouters ());
155159 }
156160}
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ test(function () {
3636 $ container = new Container1 ;
3737 $ router = $ container ->getService ('router ' );
3838 Assert::type (Nette \Application \Routers \RouteList::class, $ router );
39- Assert::count (2 , $ router );
39+ @ Assert::count (2 , $ router ); // @ is deprecated
4040 Assert::same ('index.php ' , $ router [0 ]->getMask ());
4141 Assert::same ('item/<id> ' , $ router [1 ]->getMask ());
4242
You can’t perform that action at this time.
0 commit comments