Completed
Push — develop ( 29e407...41c7f2 )
by
unknown
37:38 queued 29:25
created

ModuleOptions::isAutoAccept()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
/**
3
 * YAWIK
4
 *
5
 * @filesource
6
 * @copyright (c) 2013 - 2016 Cross Solution (http://cross-solution.de)
7
 * @author cbleek
8
 * @license   MIT
9
 */
10
11
namespace Applications\Options;
12
13
use Zend\Stdlib\AbstractOptions;
14
15
/**
16
 * Class ModuleOptions
17
 *
18
 * Default options of the Applications Module
19
 *
20
 * @package Applications\Options
21
 */
22
class ModuleOptions extends AbstractOptions
23
{
24
25
    /**
26
     * maximum size in bytes of an attachment. Default 5MB
27
     *
28
     * @var int $attachmentsMaxSize
29
     */
30
    protected $attachmentsMaxSize = 5000000;
31
32
    /**
33
     * valid Mime-Types of attachments
34
     *
35
     * @var array $attachmentsMimeType
36
     */
37
    protected $attachmentsMimeType = array('image','applications/pdf',
38
        'application/x-pdf',
39
        'application/acrobat',
40
        'applications/vnd.pdf',
41
        'text/pdf',
42
        'text/x-pdf');
43
44
    /**
45
     * maximum number of attachments. Default 3
46
     *
47
     * @var int $attachmentsCount
48
     */
49
    protected $attachmentsCount = 3;
50
51
    /**
52
     * maximum size of an user image. Default 200 kB
53
     *
54
     * @var int $contactImageMaxSize
55
     */
56
    protected $contactImageMaxSize = 200000;
57
58
    /**
59
     * allowed Mime-Type of a user image
60
     *
61
     * @var array $contactImageMimeType
62
     */
63
    protected $contactImageMimeType = array('image');
64
65
    /**
66
     * Generally allowed Mime Types
67
     *
68
     * @var array $allowedMimeTypes
69
     */
70
    protected $allowedMimeTypes = array('image',
71
                                        'applications/pdf',
72
                                        'application/x-pdf',
73
                                        'application/acrobat',
74
                                        'applications/vnd.pdf',
75
                                        'text/pdf',
76
                                        'text/x-pdf',
77
                                        'text');
78
79
80
    protected $workflow = [
81
82
      'recruiter',
83
    ];
84
85
    /**
86
     * Gets the maximum size of attachments in bytes
87
     *
88
     * @return int
89
     */
90
    public function getAttachmentsMaxSize()
91
    {
92
        return $this->attachmentsMaxSize;
93
    }
94
    /**
95
     * Sets the maximum size of attachments in bytes
96
     *
97
     * @param int $size
98
     * @return ModuleOptions
99
     */
100
    public function setAttachmentsMaxSize($size)
101
    {
102
        $this->attachmentsMaxSize = $size;
103
        return $this;
104
    }
105
106
    /**
107
     * Gets the the allowed Mime-Types for attachments
108
     *
109
     * @return array
110
     */
111
    public function getAttachmentsMimeType()
112
    {
113
        return $this->attachmentsMimeType;
114
    }
115
    /**
116
     * Sets the maximum size of attachments in bytes
117
     *
118
     * @param array $mime
119
     * @return ModuleOptions
120
     */
121
    public function setAttachmentsMimeType(array $mime)
122
    {
123
        $this->attachmentsMimeType = $mime;
124
        return $this;
125
    }
126
127
    /**
128
     * Gets the the maximum number of allowed attachments
129
     *
130
     * @return string
0 ignored issues
show
Documentation introduced by
Should the return type not be integer?

This check compares the return type specified in the @return annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.

Loading history...
131
     */
132
    public function getAttachmentsCount()
133
    {
134
        return $this->attachmentsCount;
135
    }
136
    /**
137
     * Sets the maximum number of allowed attachments
138
     *
139
     * @param string $number
140
     * @return ModuleOptions
141
     */
142
    public function setAttachmentsCount($number)
143
    {
144
        $this->attachmentsCount = $number;
0 ignored issues
show
Documentation Bug introduced by
The property $attachmentsCount was declared of type integer, but $number is of type string. Maybe add a type cast?

This check looks for assignments to scalar types that may be of the wrong type.

To ensure the code behaves as expected, it may be a good idea to add an explicit type cast.

$answer = 42;

$correct = false;

$correct = (bool) $answer;
Loading history...
145
        return $this;
146
    }
147
148
    /**
149
     * Gets the the maximum size of contact images in bytes
150
     *
151
     * @return string
0 ignored issues
show
Documentation introduced by
Should the return type not be integer?

This check compares the return type specified in the @return annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.

Loading history...
152
     */
153
    public function getContactImageMaxSize()
154
    {
155
        return $this->contactImageMaxSize;
156
    }
157
    /**
158
     * Sets the maximum size of contact images in bytes
159
     *
160
     * @param string $size
161
     * @return ModuleOptions
162
     */
163
    public function setContactImageMaxSize($size)
164
    {
165
        $this->contactImageMaxSize = $size;
0 ignored issues
show
Documentation Bug introduced by
The property $contactImageMaxSize was declared of type integer, but $size is of type string. Maybe add a type cast?

This check looks for assignments to scalar types that may be of the wrong type.

To ensure the code behaves as expected, it may be a good idea to add an explicit type cast.

$answer = 42;

$correct = false;

$correct = (bool) $answer;
Loading history...
166
        return $this;
167
    }
168
169
    /**
170
     * Gets the allowed Mime-Types for contact images
171
     *
172
     * @return array
173
     */
174
    public function getContactImageMimeType()
175
    {
176
        return $this->contactImageMimeType;
177
    }
178
    /**
179
     * Sets the allowed Mime-Types for contact images
180
     *
181
     * @param array $mime
182
     * @return ModuleOptions
183
     */
184
    public function setContactImageMimeType($mime)
185
    {
186
        $this->contactImageMimeType = $mime;
187
        return $this;
188
    }
189
190
    /**
191
     * Gets the allowed Mime-Types for contact images
192
     *
193
     * @return string
0 ignored issues
show
Documentation introduced by
Should the return type not be array?

This check compares the return type specified in the @return annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.

Loading history...
194
     */
195
    public function getAllowedMimeTypes()
196
    {
197
        return $this->allowedMimeTypes;
198
    }
199
200
    /**
201
     * Sets the allowed Mime-Types
202
     *
203
     * @param array $array
204
     * @return ModuleOptions
205
     */
206
    public function setAllowedMimeTypes($array)
207
    {
208
        $this->allowedMimeTypes = $array;
209
        return $this;
210
    }
211
}