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

Image   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 11
dl 0
loc 20
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A encrypt() 0 6 1
A resize() 0 8 1
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
}