| Conditions | 2 |
| Paths | 1 |
| Total Lines | 13 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 19 | public function jsonAction() |
||
| 20 | { |
||
| 21 | $callback = Mage::app()->getRequest()->getParam('callback'); |
||
| 22 | |||
| 23 | $results = Mage::getModel('yandexdelivery/carrier')->getAutocomplete( |
||
| 24 | Mage::app()->getRequest()->getParam('search'), |
||
| 25 | Mage::app()->getRequest()->getParam('type'), |
||
| 26 | (Mage::app()->getRequest()->getParam('city') ? Mage::app()->getRequest()->getParam('city') : false) |
||
| 27 | ); |
||
| 28 | |||
| 29 | $result = ['jsonresult' => $results]; |
||
| 30 | $this->getResponse()->setBody($callback . '(' . json_encode($result) . ')'); |
||
| 31 | } |
||
| 32 | } |
||
| 33 |
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.