AbstractDeleteService::run()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 10

Duplication

Lines 10
Ratio 100 %

Code Coverage

Tests 5
CRAP Score 2

Importance

Changes 0
Metric Value
dl 10
loc 10
c 0
b 0
f 0
rs 9.9332
ccs 5
cts 5
cp 1
cc 2
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
use DavisPeixoto\BlogCore\Interfaces\ServiceInterface;
12
use Exception;
13
14
/**
15
 * Class AbstractDeleteService
16
 * @package DavisPeixoto\BlogCore\Service
17
 */
18 View Code Duplication
abstract class AbstractDeleteService extends AbstractWriteService implements ServiceInterface
19
{
20
    /**
21
     * @return boolean
22
     */
23 12
    public function run(): bool
24
    {
25
        try {
26 12
            return $this->repository->delete($this->entity);
27 4
        } catch (Exception $e) {
28 4
            $this->logger->error($e->getMessage());
29
        }
30
31 4
        return false;
32
    }
33
}
34