| Conditions | 2 |
| Paths | 2 |
| Total Lines | 18 |
| Code Lines | 10 |
| Lines | 17 |
| Ratio | 94.44 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 49 | View Code Duplication | public function approve(SS_HTTPRequest $request) |
|
| 50 | { |
||
| 51 | $ids = array(); |
||
| 52 | |||
| 53 | foreach ($this->getRecords() as $record) { |
||
| 54 | array_push($ids, $record->ID); |
||
| 55 | $record->markApproved(); |
||
| 56 | } |
||
| 57 | |||
| 58 | $response = new SS_HTTPResponse(Convert::raw2json(array( |
||
| 59 | 'done' => true, |
||
| 60 | 'records' => $ids |
||
| 61 | ))); |
||
| 62 | |||
| 63 | $response->addHeader('Content-Type', 'text/json'); |
||
| 64 | |||
| 65 | return $response; |
||
| 66 | } |
||
| 67 | } |
||
| 68 |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.