Completed
Pull Request — master (#9)
by Davis
02:21
created

AbstractDeleteService::run()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 6

Duplication

Lines 10
Ratio 100 %

Code Coverage

Tests 5
CRAP Score 2

Importance

Changes 0
Metric Value
dl 10
loc 10
ccs 5
cts 5
cp 1
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 6
nc 2
nop 0
crap 2
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: davis
5
 * Date: 7/30/17
6
 * Time: 7:21 PM
7
 */
8
9
namespace DavisPeixoto\BlogCore\Service;
10
11
12
use DavisPeixoto\BlogCore\Interfaces\ServiceInterface;
13
use Exception;
14
15
/**
16
 * Class AbstractDeleteService
17
 * @package DavisPeixoto\BlogCore\Service
18
 */
19 View Code Duplication
abstract class AbstractDeleteService extends AbstractWriteService implements ServiceInterface
1 ignored issue
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
20
{
21
    /**
22
     * @return boolean
23
     */
24 12
    public function run(): bool
25
    {
26
        try {
27 12
            return $this->repository->delete($this->entity);
28 4
        } catch (Exception $e) {
29 4
            $this->logger->error($e->getMessage());
30
        }
31
32 4
        return false;
33
    }
34
}
35