Skip to content

Commit

Permalink
Update parameter name for Stream class
Browse files Browse the repository at this point in the history
  • Loading branch information
nyamsprod committed Oct 12, 2019
1 parent 2d3d3d1 commit c8a9f3c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion phpstan.tests.neon
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ parameters:
- '#Call to function is_iterable\(\) will always evaluate to false.#'
- '#Parameter \#1 \$stream of static method League\\Csv\\AbstractCsv::createFromStream\(\) expects resource, string given.#'
- '#Parameter \#2 \$special_chars of class League\\Csv\\EscapeFormula constructor expects array<string>, array<int, stdClass> given.#'
- '#Parameter \#1 \$resource of class League\\Csv\\Stream constructor expects resource, string given.#'
- '#Parameter \#1 \$stream of class League\\Csv\\Stream constructor expects resource, string given.#'
- '#Parameter \#1 \$records of method League\\Csv\\CharsetConverter::convert\(\) expects array|Traversable, string given.#'
- '#Parameter \#2 \$delimiters of function League\\Csv\\delimiter_detect expects array<string>, array<int, array|string> given.#'
- '#Parameter \#1 \$document of static method League\\Csv\\Polyfill\\EmptyEscapeParser::parse\(\) expects League\\Csv\\Stream\|SplFileObject, array given.#'
Expand Down
14 changes: 7 additions & 7 deletions src/Stream.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,20 +121,20 @@ class Stream implements SeekableIterator
/**
* New instance.
*
* @param resource $resource stream type resource
* @param resource $stream stream type resource
*/
public function __construct($resource)
public function __construct($stream)
{
if (!is_resource($resource)) {
throw new TypeError(sprintf('Argument passed must be a stream resource, %s given', gettype($resource)));
if (!is_resource($stream)) {
throw new TypeError(sprintf('Argument passed must be a stream resource, %s given', gettype($stream)));
}

if ('stream' !== ($type = get_resource_type($resource))) {
if ('stream' !== ($type = get_resource_type($stream))) {
throw new TypeError(sprintf('Argument passed must be a stream resource, %s resource given', $type));
}

$this->is_seekable = stream_get_meta_data($resource)['seekable'];
$this->stream = $resource;
$this->is_seekable = stream_get_meta_data($stream)['seekable'];
$this->stream = $stream;
}

/**
Expand Down

0 comments on commit c8a9f3c

Please sign in to comment.