1 | <?php |
||
11 | class Operations |
||
12 | { |
||
13 | const OP_KEY_NAME = 'op'; |
||
14 | |||
15 | /** |
||
16 | * @var Adapter |
||
17 | */ |
||
18 | private $adapter; |
||
19 | |||
20 | /** |
||
21 | * @param Adapter $adapter |
||
22 | */ |
||
23 | public function __construct(Adapter $adapter) |
||
27 | |||
28 | /** |
||
29 | * directly from stack overflow: http://stackoverflow.com/a/6041773 |
||
30 | * check if a string is valid json, and returns the parsed content |
||
31 | * |
||
32 | * @param string $string |
||
33 | * |
||
34 | * @throws InvalidJsonRequestContent |
||
35 | * @return array |
||
36 | */ |
||
37 | private function parseJson($string) |
||
45 | |||
46 | /** |
||
47 | * @param array $arr |
||
48 | * @return bool |
||
49 | */ |
||
50 | private function isAssociative($arr) |
||
54 | |||
55 | /** |
||
56 | * @throws InvalidJsonRequestContent |
||
57 | * @throws MissingOperationNameRequest |
||
58 | * @throws MissingOperationRequest |
||
59 | * |
||
60 | * @return Sequence |
||
61 | */ |
||
62 | public function all() |
||
77 | |||
78 | /** |
||
79 | * @param string $key |
||
80 | * @return \Closure |
||
81 | */ |
||
82 | private function operationWithKey($key = self::OP_KEY_NAME) |
||
88 | } |
||
89 |