source/Stream/CustomFilterInterface.php
Avoid variables with short names like $in. Configured minimum length is 3. Open
Open
public function filter($in, $out, &$consumed, $closing);
- Read upRead up
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}
Source https://phpmd.org/rules/naming.html#shortvariable
Opening brace of a interface must be on the line after the definition Open
Open
interface CustomFilterInterface {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
public function filter($in, $out, &$consumed, $closing);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
* Called when closing the filter.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
* @param resource $in
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
* @return bool
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
* Your implementation of this method should return FALSE on failure, or TRUE on success.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
public function onCreate();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
* this means you will increment consumed by $bucket->datalen for each $bucket.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
* @return int
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
* - PSFS_FEED_ME: Filter processed successfully, however no data was available to
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
* Called when creating the filter.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
* @param resource $out
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
* Called when applying the filter.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
* cannot continue.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
* - PSFS_ERR_FATAL (default): The filter experienced an unrecoverable error and
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
* out is a resource pointing to a second bucket brigade into which your modified
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
* in is a resource pointing to a bucket brigade which contains one or more bucket
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
* - PSFS_PASS_ON: Filter processed successfully with data available in the out
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
public function onClose();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
* @param bool $closing
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
* objects containing data to be filtered.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
* buckets should be placed.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
* consumed, which must always be declared by reference, should be incremented by
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
* through the filterchain), the closing parameter will be set to TRUE.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
* The filter() method must return one of three values upon completion.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
* bucket brigade.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
* @param int $consumed
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
* return. More data is required from the stream or prior filter.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
* the length of the data which your filter reads in and alters. In most cases
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
* If the stream is in the process of closing (and therefore this is the last pass
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
*
- Exclude checks