Validator::setType()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
/**
4
 * Copyright 2019 Amin Yazdanpanah<http://www.aminyazdanpanah.com>.
5
 *
6
 * Licensed under the MIT License;
7
 * you may not use this file except in compliance with the License.
8
 * You may obtain a copy of the License at
9
 *
10
 *      https://opensource.org/licenses/MIT
11
 *
12
 * Unless required by applicable law or agreed to in writing, software
13
 * distributed under the License is distributed on an "AS IS" BASIS,
14
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
 * See the License for the specific language governing permissions and
16
 * limitations under the License.
17
 */
18
19
namespace AYazdanpanah\SaveUploadedFiles;
20
21
22
class Validator extends Validate
23
{
24
    private $min_size;
25
    private $max_size;
26
    private $type = [];
27
28
    /**
29
     * @return mixed
30
     */
31
    public function getMinSize()
32
    {
33
        return $this->min_size;
34
    }
35
36
    /**
37
     * @return mixed
38
     */
39
    public function getMaxSize()
40
    {
41
        return $this->max_size;
42
    }
43
44
    /**
45
     * @return mixed
46
     */
47
    public function getTypes()
48
    {
49
        return $this->type;
50
    }
51
52
    /**
53
     * @param mixed $min_size
54
     * @return Validator
55
     */
56
    public function setMinSize(int $min_size)
57
    {
58
        $this->min_size = $min_size * 1024;
59
        return $this;
60
    }
61
62
    /**
63
     * @param mixed $max_size
64
     * @return Validator
65
     */
66
    public function setMaxSize(int $max_size)
67
    {
68
        $this->max_size = $max_size * 1024;
69
        return $this;
70
    }
71
72
    /**
73
     * @param array $type
74
     * @return Validator
75
     */
76
    public function setType(array $type): Validator
77
    {
78
        $this->type = $type;
79
        return $this;
80
    }
81
82
83
}