YetiForceCompany/YetiForceCRM

View on GitHub
app/Zip.php

Summary

Maintainability
B
6 hrs
Test Coverage
C
79%

Function unzip has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

    public function unzip($toDir, bool $close = true)
    {
        if (\is_string($toDir)) {
            $toDir = [$toDir];
        }
Severity: Minor
Found in app/Zip.php - About 3 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method unzip has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function unzip($toDir, bool $close = true)
    {
        if (\is_string($toDir)) {
            $toDir = [$toDir];
        }
Severity: Minor
Found in app/Zip.php - About 1 hr to fix

    Function validateFile has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

        public function validateFile(string $path)
        {
            if (!Validator::path($path)) {
                return true;
            }
    Severity: Minor
    Found in app/Zip.php - About 55 mins to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function extract has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        public function extract(string $toDir)
        {
            if (!is_dir($toDir) && !mkdir($toDir, 0755, true) && !is_dir($toDir)) {
                throw new \App\Exceptions\AppException('Directory unable to create it');
            }
    Severity: Minor
    Found in app/Zip.php - About 25 mins to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    The method unzip() has an NPath complexity of 296. The configured NPath complexity threshold is 200.
    Open

        public function unzip($toDir, bool $close = true)
        {
            if (\is_string($toDir)) {
                $toDir = [$toDir];
            }
    Severity: Minor
    Found in app/Zip.php by phpmd

    NPathComplexity

    Since: 0.1

    The NPath complexity of a method is the number of acyclic execution paths through that method. A threshold of 200 is generally considered the point where measures should be taken to reduce complexity.

    Example

    class Foo {
        function bar() {
            // lots of complicated code
        }
    }

    Source https://phpmd.org/rules/codesize.html#npathcomplexity

    The method unzip() has a Cyclomatic Complexity of 13. The configured cyclomatic complexity threshold is 10.
    Open

        public function unzip($toDir, bool $close = true)
        {
            if (\is_string($toDir)) {
                $toDir = [$toDir];
            }
    Severity: Minor
    Found in app/Zip.php by phpmd

    CyclomaticComplexity

    Since: 0.1

    Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.

    Example

    // Cyclomatic Complexity = 11
    class Foo {
    1   public function example() {
    2       if ($a == $b) {
    3           if ($a1 == $b1) {
                    fiddle();
    4           } elseif ($a2 == $b2) {
                    fiddle();
                } else {
                    fiddle();
                }
    5       } elseif ($c == $d) {
    6           while ($c == $d) {
                    fiddle();
                }
    7        } elseif ($e == $f) {
    8           for ($n = 0; $n < $h; $n++) {
                    fiddle();
                }
            } else {
                switch ($z) {
    9               case 1:
                        fiddle();
                        break;
    10              case 2:
                        fiddle();
                        break;
    11              case 3:
                        fiddle();
                        break;
                    default:
                        fiddle();
                        break;
                }
            }
        }
    }

    Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity

    Refactor this function to reduce its Cognitive Complexity from 27 to the 15 allowed.
    Open

        public function unzip($toDir, bool $close = true)
    Severity: Critical
    Found in app/Zip.php by sonar-php

    Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.

    See

    Missing class import via use statement (line '147', column '14').
    Open

                throw new \App\Exceptions\AppException('Directory unable to create it');
    Severity: Minor
    Found in app/Zip.php by phpmd

    MissingImport

    Since: 2.7.0

    Importing all external classes in a file through use statements makes them clearly visible.

    Example

    function make() {
        return new \stdClass();
    }

    Source http://phpmd.org/rules/cleancode.html#MissingImport

    Missing class import via use statement (line '266', column '16').
    Open

            $files = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($path), \RecursiveIteratorIterator::LEAVES_ONLY);
    Severity: Minor
    Found in app/Zip.php by phpmd

    MissingImport

    Since: 2.7.0

    Importing all external classes in a file through use statements makes them clearly visible.

    Example

    function make() {
        return new \stdClass();
    }

    Source http://phpmd.org/rules/cleancode.html#MissingImport

    Missing class import via use statement (line '58', column '14').
    Open

                throw new \App\Exceptions\AppException('Unable to open the zip file');
    Severity: Minor
    Found in app/Zip.php by phpmd

    MissingImport

    Since: 2.7.0

    Importing all external classes in a file through use statements makes them clearly visible.

    Example

    function make() {
        return new \stdClass();
    }

    Source http://phpmd.org/rules/cleancode.html#MissingImport

    Missing class import via use statement (line '61', column '14').
    Open

                throw new \App\Exceptions\AppException('The content of the zip file is too large');
    Severity: Minor
    Found in app/Zip.php by phpmd

    MissingImport

    Since: 2.7.0

    Importing all external classes in a file through use statements makes them clearly visible.

    Example

    function make() {
        return new \stdClass();
    }

    Source http://phpmd.org/rules/cleancode.html#MissingImport

    Missing class import via use statement (line '82', column '14').
    Open

                throw new \App\Exceptions\AppException('Unable to create the zip file');
    Severity: Minor
    Found in app/Zip.php by phpmd

    MissingImport

    Since: 2.7.0

    Importing all external classes in a file through use statements makes them clearly visible.

    Example

    function make() {
        return new \stdClass();
    }

    Source http://phpmd.org/rules/cleancode.html#MissingImport

    Missing class import via use statement (line '266', column '47').
    Open

            $files = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($path), \RecursiveIteratorIterator::LEAVES_ONLY);
    Severity: Minor
    Found in app/Zip.php by phpmd

    MissingImport

    Since: 2.7.0

    Importing all external classes in a file through use statements makes them clearly visible.

    Example

    function make() {
        return new \stdClass();
    }

    Source http://phpmd.org/rules/cleancode.html#MissingImport

    Missing class import via use statement (line '54', column '14').
    Open

                throw new \App\Exceptions\AppException('No file name');
    Severity: Minor
    Found in app/Zip.php by phpmd

    MissingImport

    Since: 2.7.0

    Importing all external classes in a file through use statements makes them clearly visible.

    Example

    function make() {
        return new \stdClass();
    }

    Source http://phpmd.org/rules/cleancode.html#MissingImport

    The method unzip has a boolean flag argument $close, which is a certain sign of a Single Responsibility Principle violation.
    Open

        public function unzip($toDir, bool $close = true)
    Severity: Minor
    Found in app/Zip.php by phpmd

    BooleanArgumentFlag

    Since: 1.4.0

    A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

    Example

    class Foo {
        public function bar($flag = true) {
        }
    }

    Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

    The method addDirectory has a boolean flag argument $relativePath, which is a certain sign of a Single Responsibility Principle violation.
    Open

        public function addDirectory(string $dir, string $localName = '', bool $relativePath = false)
    Severity: Minor
    Found in app/Zip.php by phpmd

    BooleanArgumentFlag

    Since: 1.4.0

    A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

    Example

    class Foo {
        public function bar($flag = true) {
        }
    }

    Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

    The method openFile has a boolean flag argument $fileName, which is a certain sign of a Single Responsibility Principle violation.
    Open

        public static function openFile($fileName = false, $options = [])
    Severity: Minor
    Found in app/Zip.php by phpmd

    BooleanArgumentFlag

    Since: 1.4.0

    A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

    Example

    class Foo {
        public function bar($flag = true) {
        }
    }

    Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

    Avoid using static access to class 'App\Fields\File' in method 'addDirectory'.
    Open

                    $zipPath = str_replace(\DIRECTORY_SEPARATOR, '/', Fields\File::getLocalPath($filePath, $pathToTrim));
    Severity: Minor
    Found in app/Zip.php by phpmd

    StaticAccess

    Since: 1.4.0

    Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

    Example

    class Foo
    {
        public function bar()
        {
            Bar::baz();
        }
    }

    Source https://phpmd.org/rules/cleancode.html#staticaccess

    Avoid using static access to class '\App\Fields\File' in method 'validateFile'.
    Open

                $fileInstance = \App\Fields\File::loadFromInfo([
                    'content' => $this->getFromName($path),
                    'path' => $this->getLocalPath($path),
                    'name' => basename($path),
                    'size' => $stat['size'],
    Severity: Minor
    Found in app/Zip.php by phpmd

    StaticAccess

    Since: 1.4.0

    Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

    Example

    class Foo
    {
        public function bar()
        {
            Bar::baz();
        }
    }

    Source https://phpmd.org/rules/cleancode.html#staticaccess

    Avoid using static access to class 'App\Validator' in method 'validateFile'.
    Open

            if (!Validator::path($path)) {
    Severity: Minor
    Found in app/Zip.php by phpmd

    StaticAccess

    Since: 1.4.0

    Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

    Example

    class Foo
    {
        public function bar()
        {
            Bar::baz();
        }
    }

    Source https://phpmd.org/rules/cleancode.html#staticaccess

    Argument 1 (source) is true but \App\Zip::open() takes string
    Open

            if (!file_exists($fileName) || !$zip->open($fileName)) {
    Severity: Minor
    Found in app/Zip.php by phan

    Call with 2 arg(s) to \App\Zip::__construct() which only takes 0 arg(s) defined at /code/app/Zip.php:18
    Open

            $zip = new self($fileName, $options);
    Severity: Info
    Found in app/Zip.php by phan

    Argument 1 (filename) is true but \file_exists() takes string
    Open

            if (!file_exists($fileName) || !$zip->open($fileName)) {
    Severity: Minor
    Found in app/Zip.php by phan

    Call to method path from undeclared class \App\Validator (Did you mean class \Tests\App\Validator)
    Open

            if (!Validator::path($path)) {
    Severity: Critical
    Found in app/Zip.php by phan

    Avoid variables with short names like $df. Configured minimum length is 3.
    Open

            $df = disk_free_space(ROOT_DIRECTORY . \DIRECTORY_SEPARATOR);
    Severity: Minor
    Found in app/Zip.php by phpmd

    ShortVariable

    Since: 0.2

    Detects when a field, local, or parameter has a very short name.

    Example

    class Something {
        private $q = 15; // VIOLATION - Field
        public static function main( array $as ) { // VIOLATION - Formal
            $r = 20 + $this->q; // VIOLATION - Local
            for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                $r += $this->q;
            }
        }
    }

    Source https://phpmd.org/rules/naming.html#shortvariable

    Spaces must be used to indent lines; tabs are not allowed
    Open

         * Check files before unpacking.
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                throw new \App\Exceptions\AppException('The content of the zip file is too large');
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        /**
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                    if (!isset($created[$fileDir])) {
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            }
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         *
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        /**
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         * @var bool
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         *
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         * Open file for create zip file.
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        {
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         * @param bool $close
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        protected $illegalExtensions;
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         */
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            return $zip;
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                        }
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         */
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            $zip = new self($fileName, $options);
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         * Function to extract files.
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                for ($i = 0; $i < $this->numFiles; ++$i) {
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         *
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        protected $checkFiles = true;
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         * @return bool|Zip
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        {
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        /**
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        /**
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         *
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         * @param array $options
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         * @return \App\Zip
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        public static function openFile($fileName = false, $options = [])
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        }
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         *
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        {
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        public static function createFile($fileName)
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                throw new \App\Exceptions\AppException('Unable to create the zip file');
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         * @param      $toDir Target directory
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                        }
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         * @return string|string[] Unpacked files
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                    }
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                    $zipPath = $this->getNameIndex($i);
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                        while ($data = fread($fpr, 1024)) {
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                        if (!is_dir($fileDir)) {
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         */
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         * Open file and initialization unpack.
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            if (!$fileName) {
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            if (!$zip->checkFreeSpace()) {
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                    if ((!\is_numeric($dir) && 0 !== strpos($path, $dir . '/')) || $this->validateFile($zipPath)) {
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                    $files[] = $zipPath;
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                $zip->{$key} = $value;
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         */
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        public function unzip($toDir, bool $close = true)
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                    $path = \str_replace('\\', '/', $zipPath);
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                        fclose($fpw);
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         * @var array
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         * Illegal extensions for extract.
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        }
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         * @throws \App\Exceptions\AppException
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            foreach ($toDir as $dir => $target) {
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                        continue;
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                    if (!$this->isDir($path)) {
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                        $fpw = fopen($file, 'w');
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         * @param bool  $fileName
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         */
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                            fwrite($fpw, $data);
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         * Files extension for extract.
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         *
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         *
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            $zip = new self();
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            if (true !== $zip->open($fileName, self::CREATE | self::OVERWRITE)) {
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            }
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         *
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                    $file = $target . '/' . (\is_numeric($dir) ? $path : substr($path, \strlen($dir) + 1));
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         */
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         *
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            foreach ($options as $key => $value) {
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                $toDir = [$toDir];
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                        fclose($fpr);
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         *
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        protected $onlyExtensions;
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        /**
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                throw new \App\Exceptions\AppException('Unable to open the zip file');
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            }
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                        $fpr = $this->getStream($zipPath);
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         * @var array
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            if (!file_exists($fileName) || !$zip->open($fileName)) {
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            }
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         * @param string $fileName
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            if (\is_string($toDir)) {
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            if ($close) {
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            return $fileList;
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         *
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         * Check free disk space.
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                $localName .= '/';
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                    $zipPath = str_replace(\DIRECTORY_SEPARATOR, '/', Fields\File::getLocalPath($filePath, $pathToTrim));
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         * @param string $name
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        /**
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         * @throws Exceptions\AppException
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         *
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            }
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                    $fileDir = \dirname($file);
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                            mkdir($fileDir, 0755, true);
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                        $created[$fileDir] = true;
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                        // Read from Zip and write to disk
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                    }
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        public function extract(string $toDir)
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         */
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            if (!Validator::path($path)) {
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            }
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        /**
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            }
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                    $filePath = $file->getRealPath();
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        /**
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            return $files;
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         *
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                    continue;
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        /**
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         *
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        }
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         * Push out the file content for download.
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        {
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                throw new \App\Exceptions\AppException('No file name');
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            }
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            }
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            return $zip;
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            $files = $created = [];
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                    }
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                }
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                $this->close();
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        /**
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         * @return array
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        {
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                }
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         *
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         */
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         *
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         * Get compressed file path.
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        {
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         */
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         * Simple extract the archive contents.
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         * Check illegal characters.
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            if ($this->checkFiles && !$this->isDir($path)) {
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            if ('/' === substr($filePath, -1, 1)) {
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            return copy($this->getLocalPath($compressedFileName), $targetFileName);
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         */
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         * Copy the directory on the disk into zip file.
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         * @param string $localName
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         */
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            $pathToTrim = $relativePath ? $path : ROOT_DIRECTORY;
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                if (isset($this->illegalExtensions) && \in_array($extension, $this->illegalExtensions)) {
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                    'name' => basename($path),
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         * @param string $filePath
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         * @param string $targetFileName
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         */
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        }
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         */
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            $size = 0;
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Line exceeds 120 characters; contains 129 characters
    Open

            $files = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($path), \RecursiveIteratorIterator::LEAVES_ONLY);
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        }
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                throw new \App\Exceptions\AppException('Directory unable to create it');
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            }
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                    $validate = true;
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                    'content' => $this->getFromName($path),
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                    'path' => $this->getLocalPath($path),
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                    'validateAllCodeInjection' => true,
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        }
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        /**
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        public function unzipFile($compressedFileName, $targetFileName)
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        {
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        }
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         * @param bool   $relativePath
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            $files = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($path), \RecursiveIteratorIterator::LEAVES_ONLY);
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                if (!$file->isDir()) {
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        public function download(string $name)
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                if ($this->validateFile(\str_replace('\\', '/', $path))) {
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            $this->extractTo($toDir, $fileList);
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        /**
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         * @return bool
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            $validate = false;
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         * Check if the file path is directory.
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        /**
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        {
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         *
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                }
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            $fileName = $this->filename;
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                $extension = pathinfo($path, PATHINFO_EXTENSION);
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            $this->close();
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         * @return bool
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            return "zip://{$this->filename}#{$compressedFileName}";
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        /**
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         * @param string $dir
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            if ($localName) {
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        }
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         */
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                $path = $this->getNameIndex($i);
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                }
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            }
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         *
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        public function validateFile(string $path)
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                return true;
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                if (isset($this->onlyExtensions) && !\in_array($extension, $this->onlyExtensions)) {
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                }
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            for ($i = 0; $i < $this->numFiles; ++$i) {
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            header('cache-control: private, max-age=120, must-revalidate');
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        }
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            $fileList = [];
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                if (!$fileInstance->validate()) {
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            }
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        {
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         *
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         *
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         * @throws \App\Exceptions\AppException
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         * @param string $path
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                $stat = $this->statName($path);
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                $fileInstance = \App\Fields\File::loadFromInfo([
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                    'size' => $stat['size'],
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        public function isDir($filePath)
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                return true;
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         *
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         * @param string $compressedFileName
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         * @return bool
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            for ($i = 0; $i < $this->numFiles; ++$i) {
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                $fileList[] = $path;
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                }
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        {
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         *
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        public function getLocalPath($compressedFileName)
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        public function checkFreeSpace()
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                $stat = $this->statIndex($i);
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        }
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            foreach ($files as $file) {
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                    $this->addFile($filePath, $localName . $zipPath);
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         * @param string $toDir
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            }
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        }
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            return $validate;
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            }
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            return false;
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         * @param string $compressedFileName
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                $size += $stat['size'];
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            header('pragma: no-cache');
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         *
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         *
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        {
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         *
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         * @return bool
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         * @return string
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            $df = disk_free_space(ROOT_DIRECTORY . \DIRECTORY_SEPARATOR);
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        public function addDirectory(string $dir, string $localName = '', bool $relativePath = false)
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            }
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            header('expires: 0');
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            unlink($fileName);
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            header('content-disposition: attachment; filename="' . $name . '.zip";');
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            }
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            if (!is_dir($toDir) && !mkdir($toDir, 0755, true) && !is_dir($toDir)) {
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                    $validate = true;
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                ]);
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                    $validate = true;
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         * Function to extract single file.
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            return $df > $size;
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            $path = realpath($dir);
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            header('content-length: ' . filesize($fileName));
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            header('content-type: application/zip');
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            header('accept-ranges: bytes');
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            readfile($fileName);
    Severity: Minor
    Found in app/Zip.php by phpcodesniffer

    There are no issues that match your filters.

    Category
    Status