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

ArchiveTrait   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 setArchive() 0 5 1
A getArchive() 0 3 1
1
<?php namespace Comodojo\Zip\Traits;
2
3
use \Comodojo\Zip\Interfaces\ZipInterface;
4
use \ZipArchive;
5
6
/**
7
 * Archive helper trait.
8
 *
9
 * @package     Comodojo Zip
10
 * @author      Marco Giovinazzi <[email protected]>
11
 * @license     MIT
12
 *
13
 * LICENSE:
14
 *
15
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
 * THE SOFTWARE.
22
 */
23
24
trait ArchiveTrait {
25
26
    /**
27
     * ZipArchive internal pointer
28
     *
29
     * @var ZipArchive
30
     */
31
    private $zip_archive;
32
33
    /**
34
     * Set the current ZipArchive object
35
     *
36
     * @param ZipArchive $zip
37
     *
38
     * @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...
39
     */
40
    public function setArchive(ZipArchive $zip): ZipInterface {
41
42
        $this->zip_archive = $zip;
43
44
        return $this;
45
46
    }
47
48
    /**
49
     * Get current ZipArchive object
50
     *
51
     * @return ZipArchive|null
52
     */
53
    public function getArchive(): ?ZipArchive {
54
55
        return $this->zip_archive;
56
57
    }
58
59
}
60