t1gor/Robots.txt-Parser-Class

View on GitHub
source/Stream/Filters/TrimSpacesLeftFilter.php

Summary

Maintainability
A
0 mins
Test Coverage

Showing 14 of 14 total issues

Avoid unused parameters such as '$closing'.
Open

public function filter($in, $out, &$consumed, $closing) {

Avoid variables with short names like $in. Configured minimum length is 3.
Open

public function filter($in, $out, &$consumed, $closing) {

Opening brace of a class must be on the line after the definition
Open

class TrimSpacesLeftFilter extends \php_user_filter implements CustomFilterInterface {

Spaces must be used to indent lines; tabs are not allowed
Open

public $filtername = self::NAME;

Spaces must be used to indent lines; tabs are not allowed
Open

}

Spaces must be used to indent lines; tabs are not allowed
Open

public const NAME = 'RTP_trim_spaces_both';

Spaces must be used to indent lines; tabs are not allowed
Open

$bucket->data = preg_replace('/(^\s+)(?!\n$)/mui', '', $bucket->data);

Spaces must be used to indent lines; tabs are not allowed
Open

public function filter($in, $out, &$consumed, $closing) {

Spaces must be used to indent lines; tabs are not allowed
Open

$consumed += $bucket->datalen;

Spaces must be used to indent lines; tabs are not allowed
Open

stream_bucket_append($out, $bucket);

Spaces must be used to indent lines; tabs are not allowed
Open

while ($bucket = stream_bucket_make_writeable($in)) {

Spaces must be used to indent lines; tabs are not allowed
Open

}

Spaces must be used to indent lines; tabs are not allowed
Open

return PSFS_PASS_ON;

Opening brace should be on a new line
Open

public function filter($in, $out, &$consumed, $closing) {
Category
Status