Passed
Push — master ( 390e69...70fcf7 )
by Ferry
03:11
created

Image::encrypt()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 4
nc 1
nop 1
dl 0
loc 6
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: User
5
 * Date: 1/26/2019
6
 * Time: 6:00 PM
7
 */
8
9
namespace crocodicstudio\crudbooster\types;
10
11
use crocodicstudio\crudbooster\controllers\scaffolding\traits\DefaultOption;
12
use crocodicstudio\crudbooster\controllers\scaffolding\traits\Join;
13
use crocodicstudio\crudbooster\types\image\ImageModel;
14
15
class Image
16
{
17
    use DefaultOption, Join;
18
19
    public function encrypt($boolean)
20
    {
21
        $data = columnSingleton()->getColumn($this->index);
22
        $data->setEncrypt($boolean);
0 ignored issues
show
Bug introduced by
The method setEncrypt() does not exist on crocodicstudio\crudbooster\models\ColumnModel. It seems like you code against a sub-type of crocodicstudio\crudbooster\models\ColumnModel such as crocodicstudio\crudbooster\types\image\ImageModel. ( Ignorable by Annotation )

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

22
        $data->/** @scrutinizer ignore-call */ 
23
               setEncrypt($boolean);
Loading history...
23
        columnSingleton()->setColumn($this->index, $data);
24
        return $this;
25
    }
26
27
    public function resize($width, $height = null)
28
    {
29
        $data = columnSingleton()->getColumn($this->index);
30
        /** @var ImageModel $data */
31
        $data->setResizeWidth($width);
32
        $data->setResizeHeight($height);
33
        columnSingleton()->setColumn($this->index, $data);
34
        return $this;
35
    }
36
37
}