Completed
Push — Recipes ( c0466a...7632b6 )
by Laurent
04:22
created

SupplierController::removeSupplierEntity()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 1
dl 0
loc 5
rs 10
c 0
b 0
f 0
1
<?php
2
3
/**
4
 * SupplierController Controller of Supplier entity.
5
 *
6
 * PHP Version 7
7
 *
8
 * @author    Quétier Laurent <[email protected]>
9
 * @copyright 2018 Dev-Int GLSR
10
 * @license   http://opensource.org/licenses/gpl-license.php GNU Public License
11
 *
12
 * @version GIT: $Id$
13
 *
14
 * @see https://github.com/Dev-Int/glsr
15
 */
16
17
namespace App\Controller;
18
19
use EasyCorp\Bundle\EasyAdminBundle\Controller\EasyAdminController as BaseAdminController;
20
use App\Entity\Settings\Supplier;
21
22
/**
23
 * Description of SupplierController.
24
 *
25
 * @category Controller
26
 */
27
class SupplierController extends BaseAdminController
28
{
29
    /**
30
     * Allows applications to modify the entity associated with the item being
31
     * deleted before removing it.
32
     *
33
     * @param App\Entity\Settings\Supplier $supplier
0 ignored issues
show
Bug introduced by
The type App\Controller\App\Entity\Settings\Supplier was not found. Did you mean App\Entity\Settings\Supplier? If so, make sure to prefix the type with \.
Loading history...
34
     */
35
    protected function removeSupplierEntity(Supplier $supplier)
36
    {
37
        $supplier->setActive(false);
38
        $this->em->persist($supplier);
0 ignored issues
show
Bug introduced by
The method persist() does not exist on null. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

38
        $this->em->/** @scrutinizer ignore-call */ 
39
                   persist($supplier);

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
39
        $this->em->flush();
40
    }
41
}
42