Volume::saveRecord()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
crap 1
1
<?php
2
3
namespace NerdsAndCompany\Schematic\Converters\Base;
4
5
use Craft;
6
use craft\base\Model;
7
use NerdsAndCompany\Schematic\Converters\Models\Base;
8
9
/**
10
 * Schematic Volume Converter.
11
 *
12
 * Sync Craft Setups.
13
 *
14
 * @author    Nerds & Company
15
 * @copyright Copyright (c) 2015-2019, Nerds & Company
16
 * @license   MIT
17
 *
18
 * @see      http://www.nerds.company
19
 */
20
class Volume extends Base
21
{
22
    /**
23
     * {@inheritdoc}
24
     */
25 1
    public function saveRecord(Model $record, array $definition): bool
26
    {
27 1
        return Craft::$app->volumes->saveVolume($record);
28
    }
29
30
    /**
31
     * {@inheritdoc}
32
     */
33 1
    public function deleteRecord(Model $record): bool
34
    {
35 1
        return Craft::$app->volumes->deleteVolume($record);
36
    }
37
}
38