Completed
Push — master ( 1a8c72...81e1ab )
by Marco
12:55
created

PasswordTrait   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 32
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setPassword() 0 5 1
A getPassword() 0 3 1
1
<?php namespace Comodojo\Zip\Traits;
2
3
use \Comodojo\Zip\Interfaces\ZipInterface;
4
5
/**
6
 * Password helper trait.
7
 *
8
 * @package     Comodojo Zip
9
 * @author      Marco Giovinazzi <[email protected]>
10
 * @license     MIT
11
 *
12
 * LICENSE:
13
 *
14
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20
 * THE SOFTWARE.
21
 */
22
23
trait PasswordTrait {
24
25
    /**
26
     * zip file password
27
     *
28
     * @var string
29
     */
30
    private $password;
31
32
    /**
33
     * Set zip password
34
     *
35
     * @param string $password
36
     *
37
     * @return Zip
0 ignored issues
show
Bug introduced by
The type Comodojo\Zip\Traits\Zip was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
38
     */
39
    public function setPassword(string $password): ZipInterface {
40
41
        $this->password = $password;
42
43
        return $this;
44
45
    }
46
47
    /**
48
     * Get current zip password
49
     *
50
     * @return string
51
     */
52
    public function getPassword(): ?string {
53
54
        return $this->password;
55
56
    }
57
58
}
59