1 | <?php |
||
2 | |||
3 | namespace Ijeffro\Laralocker\LearningLocker\Statements; |
||
4 | |||
5 | |||
6 | use Ijeffro\Laralocker\LearningLocker\API\APIHandler; |
||
7 | use Ijeffro\Laralocker\LearningLocker\StatementForwarding\StatementForwardingHandler; |
||
8 | |||
9 | class StatementHandler extends APIHandler { |
||
10 | |||
11 | private $statements = '/statement'; |
||
12 | private $api = '/api'; |
||
13 | private $v1 = '/v1'; |
||
0 ignored issues
–
show
introduced
by
![]() |
|||
14 | private $v2 = '/v2'; |
||
15 | |||
16 | public $statement_forwarding; |
||
17 | |||
18 | protected $headers = [ |
||
19 | 'Content-Type' => 'application/json' |
||
20 | ]; |
||
21 | |||
22 | function __construct($id = null) { |
||
23 | parent::__construct(); |
||
24 | $this->id = $id; |
||
0 ignored issues
–
show
|
|||
25 | } |
||
26 | |||
27 | /** |
||
28 | * Learning Locker API: Clients |
||
29 | * |
||
30 | * @return ClientHandler |
||
0 ignored issues
–
show
The type
Ijeffro\Laralocker\Learn...tatements\ClientHandler was not found. Maybe you did not declare it correctly or list all dependencies?
The issue could also be caused by a filter entry in the build configuration.
If the path has been excluded in your configuration, e.g. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths ![]() |
|||
31 | */ |
||
32 | public function forwarding($id = null) |
||
33 | { |
||
34 | if ($this->statement_forwarding) return $this->statement_forwarding; |
||
35 | |||
36 | $this->statement_forwarding = new StatementForwardingHandler($id ? $id : null); |
||
37 | return $this->forwarding($id ? $id : null); |
||
38 | } |
||
39 | |||
40 | /** |
||
41 | * Learning Locker: Request Organisation Details |
||
42 | * |
||
43 | * @return $response |
||
0 ignored issues
–
show
|
|||
44 | */ |
||
45 | public function get() { |
||
46 | try { |
||
47 | $url = $this->url . $this->api . $this->v2 . $this->statements . '/' . $this->id ?? $this->id; |
||
48 | $response = $this->request($url); |
||
49 | return $response; |
||
50 | } catch (Exception $e) { |
||
0 ignored issues
–
show
|
|||
51 | return $e; |
||
52 | } |
||
53 | } |
||
54 | |||
55 | /** |
||
56 | * Learning Locker: Request Organisation Details |
||
57 | * |
||
58 | * @return $response |
||
0 ignored issues
–
show
|
|||
59 | */ |
||
60 | public function update($data) { |
||
61 | try { |
||
62 | $url = $this->url . $this->api . $this->v2 . $this->statements . '/' . $this->id ?? $this->id; |
||
63 | $response = $this->save($url, $data); |
||
64 | return $response; |
||
65 | } catch (Exception $e) { |
||
66 | return $e; |
||
67 | } |
||
68 | } |
||
69 | } |
||
70 |