| Conditions | 4 |
| Paths | 6 |
| Total Lines | 20 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 34 | public function testCreate(Article $articles, ObjectManager $etm) |
||
|
|
|||
| 35 | { |
||
| 36 | $return = false; |
||
| 37 | $orders = $etm->getRepository('AppBundle:Orders')->findAll(); |
||
| 38 | // This provider already has an order in progress! |
||
| 39 | foreach ($orders as $order) { |
||
| 40 | if ($order->getSupplier() === $articles->getSupplier()) { |
||
| 41 | $return = true; |
||
| 42 | } |
||
| 43 | } |
||
| 44 | |||
| 45 | // This supplier has no articles! |
||
| 46 | if (count($articles) < 1) { |
||
| 47 | $message = $this->get('translator')->trans('settings.no_articles', array(), 'gs_suppliers'); |
||
| 48 | $this->addFlash('danger', $message); |
||
| 49 | $return = false; |
||
| 50 | } |
||
| 51 | |||
| 52 | return $return; |
||
| 53 | } |
||
| 54 | } |
||
| 55 |
This check examines a number of code elements and verifies that they conform to the given naming conventions.
You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.