1 | <?php |
||
39 | class CardApiController extends ApiController { |
||
40 | private $cardService; |
||
41 | private $userId; |
||
42 | |||
43 | /** |
||
44 | * @param string $appName |
||
45 | * @param IRequest $request |
||
46 | * @param CardService $cardService |
||
47 | * @param $userId |
||
48 | */ |
||
49 | public function __construct($appName, IRequest $request, CardService $cardService, $userId) { |
||
50 | parent::__construct($appName, $request); |
||
51 | $this->cardService = $cardService; |
||
52 | $this->userId = $userId; |
||
53 | } |
||
54 | |||
55 | /** |
||
56 | * @NoAdminRequired |
||
57 | * @CORS |
||
58 | * @NoCSRFRequired |
||
59 | * |
||
60 | * Get a specific card. |
||
61 | */ |
||
62 | public function get() { |
||
63 | $card = $this->cardService->find($this->request->getParam('cardId')); |
||
64 | return new DataResponse($card, HTTP::STATUS_OK); |
||
65 | } |
||
66 | |||
67 | /** |
||
68 | * @NoAdminRequired |
||
69 | * @CORS |
||
70 | * @NoCSRFRequired |
||
71 | * |
||
72 | * @params $title |
||
73 | * @params $type |
||
74 | * @params $order |
||
75 | * @params $description |
||
76 | * |
||
77 | * Get a specific card. |
||
78 | */ |
||
79 | public function create($title, $type = 'plain', $order = 999, $description = '') { |
||
80 | $card = $this->cardService->create($title, $this->request->getParam('stackId'), $type, $order, $this->userId, $description); |
||
81 | return new DataResponse($card, HTTP::STATUS_OK); |
||
82 | } |
||
83 | |||
84 | /** |
||
85 | * @NoAdminRequired |
||
86 | * @CORS |
||
87 | * @NoCSRFRequired |
||
88 | * |
||
89 | * |
||
90 | * Update a card |
||
91 | */ |
||
92 | public function update($title, $type, $order = 0, $description = '', $owner, $duedate = null, $archived = null) { |
||
93 | $card = $this->cardService->update($this->request->getParam('cardId'), $title, $this->request->getParam('stackId'), $type, $order, $description, $owner, $duedate, 0, $archived); |
||
94 | return new DataResponse($card, HTTP::STATUS_OK); |
||
95 | } |
||
96 | |||
97 | /** |
||
98 | * @NoAdminRequired |
||
99 | * @CORS |
||
100 | * @NoCSRFRequired |
||
101 | * |
||
102 | * Delete a specific card. |
||
103 | */ |
||
104 | public function delete() { |
||
108 | |||
109 | /** |
||
110 | * @NoAdminRequired |
||
111 | * @CORS |
||
112 | * @NoCSRFRequired |
||
113 | * |
||
114 | * Assign a label to a card. |
||
115 | */ |
||
116 | public function assignLabel($labelId) { |
||
120 | |||
121 | /** |
||
122 | * @NoAdminRequired |
||
123 | * @CORS |
||
124 | * @NoCSRFRequired |
||
125 | * |
||
126 | * Assign a label to a card. |
||
127 | */ |
||
128 | public function removeLabel($labelId) { |
||
132 | |||
133 | /** |
||
134 | * @NoAdminRequired |
||
135 | * @CORS |
||
136 | * @NoCSRFRequired |
||
137 | * |
||
138 | * Unassign a user from a card |
||
139 | */ |
||
140 | public function unassignUser($userId) { |
||
144 | |||
145 | /** |
||
146 | * @NoAdminRequired |
||
147 | * @CORS |
||
148 | * @NoCSRFRequired |
||
149 | * |
||
150 | * Assign a user to a card |
||
151 | */ |
||
152 | public function assignUser($userId) { |
||
156 | |||
157 | /** |
||
158 | * @NoAdminRequired |
||
159 | * @CORS |
||
160 | * @NoCSRFRequired |
||
161 | * |
||
162 | * Reorder cards |
||
163 | */ |
||
164 | public function reorder($stackId, $order) { |
||
168 | } |
||
169 |
This check looks for function or method calls that always return null and whose return value is assigned to a variable.
The method
getObject()
can return nothing but null, so it makes no sense to assign that value to a variable.The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.