summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorIgnace Nyamagana Butera <nyamsprod@gmail.com>2014-08-08 14:16:52 +0200
committerIgnace Nyamagana Butera <nyamsprod@gmail.com>2014-08-08 14:16:52 +0200
commit01c7cd28781b14049cdc47fbff9a119498fde977 (patch)
treee222e2dc70b39add548c84bec2e4d1291031f65a /src
parentd4f6e82959e2e4498f55264adba1ee314eb98f75 (diff)
downloadcsv-01c7cd28781b14049cdc47fbff9a119498fde977.zip
csv-01c7cd28781b14049cdc47fbff9a119498fde977.tar.gz
csv-01c7cd28781b14049cdc47fbff9a119498fde977.tar.bz2
update docblock
Diffstat (limited to 'src')
-rw-r--r--src/AbstractCsv.php2
-rw-r--r--src/Config/StreamFilter.php22
2 files changed, 11 insertions, 13 deletions
diff --git a/src/AbstractCsv.php b/src/AbstractCsv.php
index 293b92f..bb1a7bb 100644
--- a/src/AbstractCsv.php
+++ b/src/AbstractCsv.php
@@ -76,8 +76,6 @@ abstract class AbstractCsv implements JsonSerializable, IteratorAggregate
$path = (string) $path;
$path = trim($path);
}
- $this->path = $path;
-
ini_set("auto_detect_line_endings", '1');
$this->path = $path;
diff --git a/src/Config/StreamFilter.php b/src/Config/StreamFilter.php
index e858b83..c46c970 100644
--- a/src/Config/StreamFilter.php
+++ b/src/Config/StreamFilter.php
@@ -12,7 +12,6 @@
*/
namespace League\Csv\Config;
-use InvalidArgumentException;
use LogicException;
use OutOfBoundsException;
use SplFileInfo;
@@ -53,11 +52,13 @@ trait StreamFilter
/**
* Internal path setter
*
- * @param \SplFileInfo|string $path can be a SplFileInfo object or the path to a file
+ * The path must be an SplFileInfo object
+ * an object that implements the `__toString` method
+ * a path to a file
*
- * @return self
+ * @param \SplFileInfo|object|string $path The file path
*
- * @throws InvalidArgumentException If $path is invalid
+ * @return void
*/
protected function initStreamFilter($path)
{
@@ -71,6 +72,7 @@ trait StreamFilter
$path = $path->getPath().'/'.$path->getBasename();
}
+ $path = (string) $path;
$path = trim($path);
//if we are submitting a filter meta wrapper
//we extract and inject the mode, the filter and the path
@@ -95,12 +97,11 @@ trait StreamFilter
$this->stream_real_path = $path;
$this->stream_filters = [];
-
- return $this;
}
/**
* Check if the trait methods can be used
+ *
* @return void
*
* @throws \LogicException If the API can not be use
@@ -121,6 +122,8 @@ trait StreamFilter
* @param integer $mode
*
* @return self
+ *
+ * @throws \LogicException If the API can not be use
*/
public function setStreamFilterMode($mode)
{
@@ -139,6 +142,8 @@ trait StreamFilter
* stream filter mode getter
*
* @return integer
+ *
+ * @throws \LogicException If the API can not be use
*/
public function getStreamFilterMode()
{
@@ -176,7 +181,6 @@ trait StreamFilter
public function appendStreamFilter($filter_name)
{
$this->checkStreamApiAvailability();
-
$this->stream_filters[] = $this->sanitizeStreamFilter($filter_name);
return $this;
@@ -194,7 +198,6 @@ trait StreamFilter
public function prependStreamFilter($filter_name)
{
$this->checkStreamApiAvailability();
-
array_unshift($this->stream_filters, $this->sanitizeStreamFilter($filter_name));
return $this;
@@ -228,7 +231,6 @@ trait StreamFilter
public function removeStreamFilter($filter_name)
{
$this->checkStreamApiAvailability();
-
$res = array_search($filter_name, $this->stream_filters, true);
if (false !== $res) {
unset($this->stream_filters[$res]);
@@ -247,7 +249,6 @@ trait StreamFilter
public function clearStreamFilter()
{
$this->checkStreamApiAvailability();
-
$this->stream_filters = [];
return $this;
@@ -263,7 +264,6 @@ trait StreamFilter
protected function getStreamFilterPath()
{
$this->checkStreamApiAvailability();
-
if (! $this->stream_filters) {
return $this->stream_real_path;
}