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

ImageBestCropExtension   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 0%
Metric Value
wmc 3
lcom 1
cbo 1
dl 0
loc 11
ccs 0
cts 6
cp 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A BestCrop() 0 9 3
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