| Conditions | 2 |
| Paths | 2 |
| Total Lines | 18 |
| Code Lines | 10 |
| Lines | 17 |
| Ratio | 94.44 % |
| Changes | 3 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 29 | View Code Duplication | public function spam(SS_HTTPRequest $request) |
|
| 30 | { |
||
| 31 | $ids = array(); |
||
| 32 | |||
| 33 | foreach ($this->getRecords() as $record) { |
||
| 34 | array_push($ids, $record->ID); |
||
| 35 | $record->markSpam(); |
||
| 36 | } |
||
| 37 | |||
| 38 | $response = new SS_HTTPResponse(Convert::raw2json(array( |
||
| 39 | 'done' => true, |
||
| 40 | 'records' => $ids |
||
| 41 | ))); |
||
| 42 | |||
| 43 | $response->addHeader('Content-Type', 'text/json'); |
||
| 44 | |||
| 45 | return $response; |
||
| 46 | } |
||
| 47 | |||
| 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.