| 1 | <?php |
||
| 12 | class FlashBag implements \Iterator{ |
||
| 13 | const FLASH_BAG_KEY="_flash_bag"; |
||
| 14 | private $array; |
||
| 15 | private $position; |
||
| 16 | public function __construct(){ |
||
| 20 | |||
| 21 | public function addMessage($type,$content,$icon=NULL){ |
||
| 24 | |||
| 25 | public function getMessages($type){ |
||
| 33 | |||
| 34 | public function getAll(){ |
||
| 37 | |||
| 38 | public function clear(){ |
||
| 44 | |||
| 45 | public function current() { |
||
| 48 | |||
| 49 | public function key() { |
||
| 52 | |||
| 53 | public function next() { |
||
| 56 | |||
| 57 | public function valid() { |
||
| 60 | |||
| 61 | public function save(){ |
||
| 64 | |||
| 65 | } |
||
| 66 | |||
| 67 |
There are different options of fixing this problem.
If you want to be on the safe side, you can add an additional type-check:
If you are sure that the expression is traversable, you might want to add a doc comment cast to improve IDE auto-completion and static analysis:
Mark the issue as a false-positive: Just hover the remove button, in the top-right corner of this issue for more options.