@@ 43-56 (lines=14) @@ | ||
40 | /** |
|
41 | * {@inheritdoc} |
|
42 | */ |
|
43 | public function getNextLineContent(\SplFileObject $file) |
|
44 | { |
|
45 | if ($file->key() + 1 > $this->walker->countLines($file)) { |
|
46 | throw new OutOfBoundsException(); |
|
47 | } |
|
48 | ||
49 | $file->next(); |
|
50 | ||
51 | $content = $this->getCurrentLineContent($file); |
|
52 | ||
53 | $this->walker->goToLine($file, $file->key() - 1); |
|
54 | ||
55 | return $content; |
|
56 | } |
|
57 | ||
58 | /** |
|
59 | * {@inheritdoc} |
|
@@ 61-74 (lines=14) @@ | ||
58 | /** |
|
59 | * {@inheritdoc} |
|
60 | */ |
|
61 | public function getPreviousLineContent(\SplFileObject $file) |
|
62 | { |
|
63 | if ($file->key() - 1 < 0) { |
|
64 | throw new OutOfBoundsException(); |
|
65 | } |
|
66 | ||
67 | $file->seek($file->key() - 1); |
|
68 | ||
69 | $content = $this->getCurrentLineContent($file); |
|
70 | ||
71 | $this->walker->goToLine($file, $file->key() + 1); |
|
72 | ||
73 | return $content; |
|
74 | } |
|
75 | ||
76 | /** |
|
77 | * {@inheritdoc} |