Completed
Push — master ( ae1c8e...2e3369 )
by Gordon
10:33 queued 02:15
created

ImageBestCropExtension::BestCrop()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 9
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 12
Metric Value
dl 0
loc 9
ccs 0
cts 6
cp 0
rs 9.6666
cc 3
eloc 7
nc 3
nop 2
crap 12
1
<?php
2
3
class ImageBestCropExtension extends Extension {
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
4
    public function BestCrop($width, $height) {
1 ignored issue
show
Coding Style introduced by
Method name "ImageBestCropExtension::BestCrop" is not in camel caps format
Loading history...
5
        if ($this->owner->hasExtension('FocusPointImage')) {
6
            return $this->owner->CroppedFocusedImage($width, $height);
7
        } elseif ($this->owner->hasMethod('Fill')) {
8
            return $this->owner->Fill($width, $height);
9
        } else {
10
            return $this->owner->setSize($width, $height);
11
        }
12
    }
13
}
14