Completed
Pull Request — master (#81)
by
unknown
01:30
created

Compressor::getExtension()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
nc 1
cc 1
nop 0
1
<?php
2
3
namespace Spatie\DbDumper\Compressors;
4
5
abstract class Compressor
6
{
7
    /* @string compression level*/
8
    protected $level = null;
9
10
    abstract function getCompressorCommand();
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
11
12
    /**
13
     * get the extension of the compressed file
14
     *
15
     * @returns string
16
     */
17
    public function getExtension()
18
    {
19
        return $this->extension;
0 ignored issues
show
Bug introduced by
The property extension does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
20
    }
21
22
    /**
23
     * Set compression level
24
     *
25
     * @param string $level
26
     */
27
    public function setLevel(string $level)
28
    {
29
        $this->level = $level;
30
    }
31
}
32