1 | <?php |
||
22 | class Move implements StrategyInterface { |
||
23 | |||
24 | |||
25 | /** |
||
26 | * @var int |
||
27 | */ |
||
28 | protected $steps = null; |
||
29 | |||
30 | /** |
||
31 | * @var int |
||
32 | */ |
||
33 | protected $direction = null; |
||
34 | |||
35 | |||
36 | /** |
||
37 | * @param int $steps |
||
38 | * @return static |
||
39 | */ |
||
40 | 15 | public static function create($steps) { |
|
43 | |||
44 | |||
45 | /** |
||
46 | * You can pass positive and negative numbers |
||
47 | * Positive - move forward |
||
48 | * Negative - move backward |
||
49 | * |
||
50 | * @param int $steps |
||
51 | */ |
||
52 | 14 | public function __construct($steps) { |
|
53 | |||
54 | 14 | if (!is_int($steps)) { |
|
55 | 2 | throw new InvalidArgumentException('Invalid steps. Expect integer. Given: ' . gettype($steps)); |
|
56 | } |
||
57 | |||
58 | 12 | $this->steps = $steps; |
|
59 | |||
60 | 12 | } |
|
61 | |||
62 | |||
63 | /** |
||
64 | * @inheritdoc |
||
65 | */ |
||
66 | 12 | public function process(\Funivan\PhpTokenizer\Collection $collection, $currentIndex) { |
|
81 | |||
82 | } |