javiereguiluz / easybook

Book publishing as easy as it should be (built with Symfony components)
https://easycorp.io/EasyBook
Other
754 stars 81 forks source link

[Insight] PHP code should follow PSR-1 basic coding standard #139

Closed javiereguiluz closed 9 years ago

javiereguiluz commented 10 years ago

in src/Easybook/Util/TwigCssExtension.php, line 90

Method names should be declared in camelCase. You should rename this class to comply with PSR-1.

    /*
     * Perfoms an addition with CSS lenght units
     * Examples: css_add('250px', 30) => returns '280px'
     *           css_add('8in', 12)   => returns '20in'
     */
    public function css_add($length, $factor)
    {
        return preg_replace_callback(
            '/(?<value>[\d\.]*)(?<unit>[a-z]{2})/i',
            function($matches) use ($factor) {
                $unit = isset($matches['unit']) ? $matches['unit'] : 'px';

Posted from SensioLabsInsight

javiereguiluz commented 9 years ago

Closing it because this was recently fixed.