sebastianmonzel/webfiles-framework-php

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

Summary

Maintainability
A
0 mins
Test Coverage
F
0%

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

    public function loadJpg($p_sImage)
    {
        // workaround for: "Invalid SOS parameters for sequential JPEG" - actually ignoring it
        ini_set ('gd.jpeg_ignore_warning', 1);
        return @imagecreatefromjpeg($p_sImage);

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 parameter $p_sImage is not named in camelCase.
Open

    public function loadJpg($p_sImage)
    {
        // workaround for: "Invalid SOS parameters for sequential JPEG" - actually ignoring it
        ini_set ('gd.jpeg_ignore_warning', 1);
        return @imagecreatefromjpeg($p_sImage);

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_sImage is not named in camelCase.
Open

    public function loadPng($p_sImage)
    {
        return imagecreatefrompng($p_sImage);
    }

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_sImage is not named in camelCase.
Open

    public function loadPng($p_sImage)
    {
        return imagecreatefrompng($p_sImage);
    }

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_sImage is not named in camelCase.
Open

    public function loadJpg($p_sImage)
    {
        // workaround for: "Invalid SOS parameters for sequential JPEG" - actually ignoring it
        ini_set ('gd.jpeg_ignore_warning', 1);
        return @imagecreatefromjpeg($p_sImage);

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