ZipDecompressor   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 1
dl 0
loc 17
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A extract() 0 7 1
1
<?php
2
namespace Peridot\WebDriverManager\Binary\Decompression;
3
4
use splitbrain\PHPArchive\Zip;
5
6
/**
7
 * ZipDecompressor extracts binaries contained in zip files.
8
 *
9
 * @package Peridot\WebDriverManager\Binary\Decompression
10
 */
11
class ZipDecompressor implements BinaryDecompressorInterface
12
{
13
    /**
14
     * {@inheritdoc}
15
     *
16
     * @param string $compressedFilePath
17
     * @param string $directory
18
     * @return bool
19
     */
20
    public function extract($compressedFilePath, $directory)
21
    {
22
        $zip = new Zip();
23
        $zip->open($compressedFilePath);
24
        $info = $zip->extract($directory);
25
        return !empty($info);
26
    }
27
}
28