1 | <?php |
||
26 | abstract class AbstractSegment extends AbstractObject implements SegmentInterface |
||
27 | { |
||
28 | |||
29 | use AutoLoggerTrait; |
||
30 | |||
31 | /** |
||
32 | * @var array |
||
33 | */ |
||
34 | protected $segments; |
||
35 | |||
36 | /** |
||
37 | * @return array |
||
38 | */ |
||
39 | protected function defaultSegments(): array |
||
43 | |||
44 | /** |
||
45 | * @inheritdoc |
||
46 | */ |
||
47 | public function init() |
||
55 | |||
56 | /** |
||
57 | * @param string $key |
||
58 | * @param $segment |
||
59 | * @param string|null $afterKey |
||
60 | * @return $this |
||
61 | */ |
||
62 | public function addAfter(string $key, $segment, string $afterKey = null) |
||
77 | |||
78 | /** |
||
79 | * @param string $key |
||
80 | * @param $segment |
||
81 | * @param string|null $beforeKey |
||
82 | * @return $this |
||
83 | */ |
||
84 | public function addBefore(string $key, $segment, string $beforeKey = null) |
||
99 | |||
100 | |||
101 | /** |
||
102 | * @inheritdoc |
||
103 | */ |
||
104 | public function run(array $config = []): ResponseInterface |
||
122 | |||
123 | /** |
||
124 | * @return array |
||
125 | */ |
||
126 | protected function getSegments() |
||
130 | |||
131 | |||
132 | /** |
||
133 | * @param \Exception $exception |
||
134 | * @throws InvalidResponseException |
||
135 | */ |
||
136 | protected function handleException(\Exception $exception) |
||
150 | |||
151 | /** |
||
152 | * @inheritdoc |
||
153 | */ |
||
154 | public function __invoke(array $config = []): ResponseInterface |
||
158 | } |
||
159 |