FastImageSize   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 14
ccs 7
cts 7
cp 1
rs 10
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A getImageSize() 0 12 2
1
<?php
2
/**
3
 * fast-image-size base class
4
 * @package fast-image-size
5
 * @copyright (c) Marc Alexander <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
namespace FastImageSize;
11
12
13
class FastImageSize
14
{
15 71
    public function getImageSize($file, $type = '')
1 ignored issue
show
Unused Code introduced by
The parameter $type is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

15
    public function getImageSize($file, /** @scrutinizer ignore-unused */ $type = '')

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
16
    {
17 71
        $size = getimagesize($file);
18
19 71
        if (empty($size)) {
20 6
            return false;
21
        }
22
23
        return array(
24 65
            'width' => $size[0],
25 65
            'height' => $size[1],
26 65
            'type' => $size[2],
27 65
        );
28
    }
29
}
30