for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Cerbero\JsonObjects;
use Psr\Http\Message\StreamInterface;
/**
* The stream wrapper.
*
*/
class StreamWrapper
{
* The name of the stream wrapper.
* @var string
const NAME = 'cerbero-json-objects';
* The stream context.
* @var resource
public $context;
* The stream.
* @var \Psr\Http\Message\StreamInterface
protected $stream;
* Open the stream
* @param string $path
* @param string $mode
* @param int $options
* @param mixed $opened_path
* @return bool
public function stream_open(string $path, string $mode, int $options, &$opened_path) : bool
$options
If this is a false-positive, you can also ignore this issue in your code via the ignore-unused annotation
ignore-unused
public function stream_open(string $path, string $mode, /** @scrutinizer ignore-unused */ int $options, &$opened_path) : bool
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
$opened_path
public function stream_open(string $path, string $mode, int $options, /** @scrutinizer ignore-unused */ &$opened_path) : bool
$path
public function stream_open(/** @scrutinizer ignore-unused */ string $path, string $mode, int $options, &$opened_path) : bool
$mode
public function stream_open(string $path, /** @scrutinizer ignore-unused */ string $mode, int $options, &$opened_path) : bool
$options = stream_context_get_options($this->context);
$stream = $options[static::NAME]['stream'] ?? null;
if (!$stream instanceof StreamInterface || !$stream->isReadable()) {
return false;
}
$this->stream = $stream;
return true;
* Determine whether the pointer is at the end of the stream
public function stream_eof() : bool
return $this->stream->eof();
* Read from the stream
* @param int $count
* @return string
public function stream_read(int $count) : string
return $this->stream->read($count);
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.