sebastianmonzel/webfiles-framework-php

View on GitHub
source/core/datasystem/file/format/media/image/MImage.php

Summary

Maintainability
B
6 hrs
Test Coverage
F
6%

The class MImage has 16 public methods. Consider refactoring MImage to keep number of public methods under 10.
Open

class MImage extends MFile
{

    protected $m_oImage;

TooManyPublicMethods

Since: 0.1

A class with too many public methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.

By default it ignores methods starting with 'get' or 'set'.

Example

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

The class MImage has an overall complexity of 51 which is very high. The configured complexity threshold is 50.
Open

class MImage extends MFile
{

    protected $m_oImage;

MImage has 24 functions (exceeds 20 allowed). Consider refactoring.
Open

class MImage extends MFile
{

    protected $m_oImage;

Severity: Minor
Found in source/core/datasystem/file/format/media/image/MImage.php - About 2 hrs to fix

Function loadImage has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    public function loadImage() {

        if (MImage::isImageMagickInstalled() && false) {
            $this->handler = new MImageMagickHandler();
        } else if (MImage::isGdInstalled()) {
Severity: Minor
Found in source/core/datasystem/file/format/media/image/MImage.php - About 1 hr 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 saveScaledImgAsFile has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function saveScaledImgAsFile($width, $height, $filePath = "")
    {
        if ($this->isJpeg()) {
            $inputPel = new PelJpeg($this->getPath());
            $oldExif = $inputPel->getExif();
Severity: Minor
Found in source/core/datasystem/file/format/media/image/MImage.php - About 1 hr to fix

Function saveScaledImgAsFile has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public function saveScaledImgAsFile($width, $height, $filePath = "")
    {
        if ($this->isJpeg()) {
            $inputPel = new PelJpeg($this->getPath());
            $oldExif = $inputPel->getExif();
Severity: Minor
Found in source/core/datasystem/file/format/media/image/MImage.php - About 45 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 saveAsFile has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function saveAsFile($filePath = "", $quality = 80)
    {

        if (!empty($filePath)) {
            $sFilePath = $filePath;
Severity: Minor
Found in source/core/datasystem/file/format/media/image/MImage.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 __construct has a boolean flag argument $loadImageResourceOnCreation, which is a certain sign of a Single Responsibility Principle violation.
Open

    public function __construct($filePath, $loadImageResourceOnCreation = false, $type = "jpg") {

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

Remove error control operator '@' on line 122.
Open

    public function readExifDate() {
        $exifData = @exif_read_data($this->getPath());

        if ( isset($exifData['DateTimeDigitized']) ) {
            return MTimestampHelper::getTimestampFromExifFormatedDateTime(

ErrorControlOperator

Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.

Example

function foo($filePath) {
    $file = @fopen($filPath); // hides exceptions
    $key = @$array[$notExistingKey]; // assigns null to $key
}

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

The method saveAsFile uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

        } else {
            $sFilePath = $this->getPath();
        }

ElseExpression

Since: 1.4.0

An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

Example

class Foo
{
    public function bar($flag)
    {
        if ($flag) {
            // one branch
        } else {
            // another branch
        }
    }
}

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

The method readExifDate uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

        } else {
            echo "warn: " . $this->getPath() . " does not have defined exifdate.\n";
            //var_dump($exifData);
        }

ElseExpression

Since: 1.4.0

An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

Example

class Foo
{
    public function bar($flag)
    {
        if ($flag) {
            // one branch
        } else {
            // another branch
        }
    }
}

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

Avoid using static access to class 'webfilesframework\core\datasystem\file\format\media\image\MImage' in method 'loadImage'.
Open

        if (MImage::isImageMagickInstalled() && false) {

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 'webfilesframework\core\datasystem\file\format\media\image\MImage' in method 'loadImage'.
Open

        } else if (MImage::isGdInstalled()) {

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

The method saveScaledImgAsFile uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

        } else {
            $sFilePath = $this->getPath();
        }

ElseExpression

Since: 1.4.0

An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

Example

class Foo
{
    public function bar($flag)
    {
        if ($flag) {
            // one branch
        } else {
            // another branch
        }
    }
}

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

The method loadImage uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

        } else {

        }

ElseExpression

Since: 1.4.0

An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

Example

class Foo
{
    public function bar($flag)
    {
        if ($flag) {
            // one branch
        } else {
            // another branch
        }
    }
}

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

Avoid using static access to class '\webfilesframework\core\datatype\time\MTimestampHelper' in method 'readExifDate'.
Open

            return MTimestampHelper::getTimestampFromExifFormatedDateTime(
                $exifData['DateTimeOriginal']); //e.g. 2016:12:22 14:49:07

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 '\webfilesframework\core\datatype\time\MTimestampHelper' in method 'readExifDate'.
Open

            return MTimestampHelper::getTimestampFromExifFormatedDateTime(
                $exifData['DateTimeDigitized']); //e.g. 2016:12:22 14:49:07

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

The method saveScaledImgAsFileWithBiggerSize uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

        } else {
            $this->saveScaledImgAsFileWithHeight($p_iBiggerSize, $p_sFilePath);
        }

ElseExpression

Since: 1.4.0

An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

Example

class Foo
{
    public function bar($flag)
    {
        if ($flag) {
            // one branch
        } else {
            // another branch
        }
    }
}

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

Avoid unused parameters such as '$outputPath'.
Open

    function copyMeta($inputPath, $outputPath) {

UnusedFormalParameter

Since: 0.2

Avoid passing parameters to methods or constructors and then not using those parameters.

Example

class Foo
{
    private function bar($howdy)
    {
        // $howdy is not used
    }
}

Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

Avoid unused parameters such as '$inputPath'.
Open

    function copyMeta($inputPath, $outputPath) {

UnusedFormalParameter

Since: 0.2

Avoid passing parameters to methods or constructors and then not using those parameters.

Example

class Foo
{
    private function bar($howdy)
    {
        // $howdy is not used
    }
}

Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

TODO found
Open

        // TODO exif informationen mitkopieren

Avoid excessively long variable names like $loadImageResourceOnCreation. Keep variable name length under 20.
Open

    public function __construct($filePath, $loadImageResourceOnCreation = false, $type = "jpg") {

LongVariable

Since: 0.2

Detects when a field, formal or local variable is declared with a long name.

Example

class Something {
    protected $reallyLongIntName = -3; // VIOLATION - Field
    public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
        $otherReallyLongName = -5; // VIOLATION - Local
        for ($interestingIntIndex = 0; // VIOLATION - For
             $interestingIntIndex < 10;
             $interestingIntIndex++ ) {
        }
    }
}

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

The parameter $p_sFilePath is not named in camelCase.
Open

    public function saveScaledImgAsFileWithHeight($p_iHeight, $p_sFilePath = "")
    {

        $iWidth = $this->getImageWidth();
        $iHeight = $this->getImageHeight();

CamelCaseParameterName

Since: 0.2

It is considered best practice to use the camelCase notation to name parameters.

Example

class ClassName {
    public function doSomething($user_name) {
    }
}

Source

The property $m_sType is not named in camelCase.
Open

class MImage extends MFile
{

    protected $m_oImage;

CamelCasePropertyName

Since: 0.2

It is considered best practice to use the camelCase notation to name attributes.

Example

class ClassName {
    protected $property_name;
}

Source

The parameter $p_iHeight is not named in camelCase.
Open

    public function saveScaledImgAsFileWithHeight($p_iHeight, $p_sFilePath = "")
    {

        $iWidth = $this->getImageWidth();
        $iHeight = $this->getImageHeight();

CamelCaseParameterName

Since: 0.2

It is considered best practice to use the camelCase notation to name parameters.

Example

class ClassName {
    public function doSomething($user_name) {
    }
}

Source

The property $m_oImage is not named in camelCase.
Open

class MImage extends MFile
{

    protected $m_oImage;

CamelCasePropertyName

Since: 0.2

It is considered best practice to use the camelCase notation to name attributes.

Example

class ClassName {
    protected $property_name;
}

Source

The parameter $p_iWidth is not named in camelCase.
Open

    public function saveScaledImgAsFileWithWidth($p_iWidth, $p_sFilePath = "")
    {

        $iWidth = $this->getImageWidth();
        $iProportion = $p_iWidth / $iWidth;

CamelCaseParameterName

Since: 0.2

It is considered best practice to use the camelCase notation to name parameters.

Example

class ClassName {
    public function doSomething($user_name) {
    }
}

Source

The parameter $p_iBiggerSize is not named in camelCase.
Open

    public function saveScaledImgAsFileWithBiggerSize($p_iBiggerSize, $p_sFilePath = "")
    {

        // TODO exif informationen mitkopieren
        ini_set ('gd.jpeg_ignore_warning', 1);

CamelCaseParameterName

Since: 0.2

It is considered best practice to use the camelCase notation to name parameters.

Example

class ClassName {
    public function doSomething($user_name) {
    }
}

Source

The parameter $p_sFilePath is not named in camelCase.
Open

    public function saveScaledImgAsFileWithBiggerSize($p_iBiggerSize, $p_sFilePath = "")
    {

        // TODO exif informationen mitkopieren
        ini_set ('gd.jpeg_ignore_warning', 1);

CamelCaseParameterName

Since: 0.2

It is considered best practice to use the camelCase notation to name parameters.

Example

class ClassName {
    public function doSomething($user_name) {
    }
}

Source

The parameter $p_sFilePath is not named in camelCase.
Open

    public function saveScaledImgAsFileWithPercent($p_iPercent, $p_sFilePath = "")
    {

        $iNewHeigt = ceil($this->getImageHeight() * ($p_iPercent / 100));
        $iNewWidth = ceil($this->getImageWidth() * ($p_iPercent / 100));

CamelCaseParameterName

Since: 0.2

It is considered best practice to use the camelCase notation to name parameters.

Example

class ClassName {
    public function doSomething($user_name) {
    }
}

Source

The parameter $p_sFilePath is not named in camelCase.
Open

    public function saveScaledImgAsFileWithWidth($p_iWidth, $p_sFilePath = "")
    {

        $iWidth = $this->getImageWidth();
        $iProportion = $p_iWidth / $iWidth;

CamelCaseParameterName

Since: 0.2

It is considered best practice to use the camelCase notation to name parameters.

Example

class ClassName {
    public function doSomething($user_name) {
    }
}

Source

The parameter $p_iPercent is not named in camelCase.
Open

    public function saveScaledImgAsFileWithPercent($p_iPercent, $p_sFilePath = "")
    {

        $iNewHeigt = ceil($this->getImageHeight() * ($p_iPercent / 100));
        $iNewWidth = ceil($this->getImageWidth() * ($p_iPercent / 100));

CamelCaseParameterName

Since: 0.2

It is considered best practice to use the camelCase notation to name parameters.

Example

class ClassName {
    public function doSomething($user_name) {
    }
}

Source

The variable $p_iHeight is not named in camelCase.
Open

    public function saveScaledImgAsFileWithHeight($p_iHeight, $p_sFilePath = "")
    {

        $iWidth = $this->getImageWidth();
        $iHeight = $this->getImageHeight();

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $p_iBiggerSize is not named in camelCase.
Open

    public function saveScaledImgAsFileWithBiggerSize($p_iBiggerSize, $p_sFilePath = "")
    {

        // TODO exif informationen mitkopieren
        ini_set ('gd.jpeg_ignore_warning', 1);

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $p_iBiggerSize is not named in camelCase.
Open

    public function saveScaledImgAsFileWithBiggerSize($p_iBiggerSize, $p_sFilePath = "")
    {

        // TODO exif informationen mitkopieren
        ini_set ('gd.jpeg_ignore_warning', 1);

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $p_sFilePath is not named in camelCase.
Open

    public function saveScaledImgAsFileWithBiggerSize($p_iBiggerSize, $p_sFilePath = "")
    {

        // TODO exif informationen mitkopieren
        ini_set ('gd.jpeg_ignore_warning', 1);

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $p_iPercent is not named in camelCase.
Open

    public function saveScaledImgAsFileWithPercent($p_iPercent, $p_sFilePath = "")
    {

        $iNewHeigt = ceil($this->getImageHeight() * ($p_iPercent / 100));
        $iNewWidth = ceil($this->getImageWidth() * ($p_iPercent / 100));

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $p_iWidth is not named in camelCase.
Open

    public function saveScaledImgAsFileWithWidth($p_iWidth, $p_sFilePath = "")
    {

        $iWidth = $this->getImageWidth();
        $iProportion = $p_iWidth / $iWidth;

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $img_y is not named in camelCase.
Open

    public function mirror()
    {

        $img_x = imagesx($this->m_oImage);
        $img_y = imagesy($this->m_oImage);

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $p_sFilePath is not named in camelCase.
Open

    public function saveScaledImgAsFileWithWidth($p_iWidth, $p_sFilePath = "")
    {

        $iWidth = $this->getImageWidth();
        $iProportion = $p_iWidth / $iWidth;

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $img_x is not named in camelCase.
Open

    public function mirror()
    {

        $img_x = imagesx($this->m_oImage);
        $img_y = imagesy($this->m_oImage);

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $img_x is not named in camelCase.
Open

    public function mirror()
    {

        $img_x = imagesx($this->m_oImage);
        $img_y = imagesy($this->m_oImage);

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $img_y is not named in camelCase.
Open

    public function mirror()
    {

        $img_x = imagesx($this->m_oImage);
        $img_y = imagesy($this->m_oImage);

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $p_iHeight is not named in camelCase.
Open

    public function saveScaledImgAsFileWithHeight($p_iHeight, $p_sFilePath = "")
    {

        $iWidth = $this->getImageWidth();
        $iHeight = $this->getImageHeight();

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $img_x is not named in camelCase.
Open

    public function mirror()
    {

        $img_x = imagesx($this->m_oImage);
        $img_y = imagesy($this->m_oImage);

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $p_iWidth is not named in camelCase.
Open

    public function saveScaledImgAsFileWithWidth($p_iWidth, $p_sFilePath = "")
    {

        $iWidth = $this->getImageWidth();
        $iProportion = $p_iWidth / $iWidth;

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $p_sFilePath is not named in camelCase.
Open

    public function saveScaledImgAsFileWithPercent($p_iPercent, $p_sFilePath = "")
    {

        $iNewHeigt = ceil($this->getImageHeight() * ($p_iPercent / 100));
        $iNewWidth = ceil($this->getImageWidth() * ($p_iPercent / 100));

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $img_x is not named in camelCase.
Open

    public function mirror()
    {

        $img_x = imagesx($this->m_oImage);
        $img_y = imagesy($this->m_oImage);

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $img_y is not named in camelCase.
Open

    public function mirror()
    {

        $img_x = imagesx($this->m_oImage);
        $img_y = imagesy($this->m_oImage);

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $p_sFilePath is not named in camelCase.
Open

    public function saveScaledImgAsFileWithBiggerSize($p_iBiggerSize, $p_sFilePath = "")
    {

        // TODO exif informationen mitkopieren
        ini_set ('gd.jpeg_ignore_warning', 1);

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $img_x is not named in camelCase.
Open

    public function mirror()
    {

        $img_x = imagesx($this->m_oImage);
        $img_y = imagesy($this->m_oImage);

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $p_sFilePath is not named in camelCase.
Open

    public function saveScaledImgAsFileWithHeight($p_iHeight, $p_sFilePath = "")
    {

        $iWidth = $this->getImageWidth();
        $iHeight = $this->getImageHeight();

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $p_iPercent is not named in camelCase.
Open

    public function saveScaledImgAsFileWithPercent($p_iPercent, $p_sFilePath = "")
    {

        $iNewHeigt = ceil($this->getImageHeight() * ($p_iPercent / 100));
        $iNewWidth = ceil($this->getImageWidth() * ($p_iPercent / 100));

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $img_y is not named in camelCase.
Open

    public function mirror()
    {

        $img_x = imagesx($this->m_oImage);
        $img_y = imagesy($this->m_oImage);

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

There are no issues that match your filters.

Category
Status