foothing/laravel-wrappr

View on GitHub
src/Foothing/Wrappr/Installer/Browser.php

Summary

Maintainability
A
0 mins
Test Coverage
<?php namespace Foothing\Wrappr\Installer;


class Browser {
    protected $collection = [];

    protected $index;

    protected function next( $item ) {
        $this->index++;
        return $this->current($item);
    }

    protected function reset() {
        $this->collection = [];
        $this->index = -1;
    }

    public function getItems() {
        return $this->collection;
    }

    protected function current($item = null) {
        return $item ? $this->collection[ $this->index ] = $item : $this->collection[ $this->index ];
    }
}