summaryrefslogtreecommitdiffstats
path: root/src/Exporter/DataFormatterCollection.php
diff options
context:
space:
mode:
authorIgnace Nyamagana Butera <nyamsprod@gmail.com>2015-02-19 08:49:17 +0100
committerIgnace Nyamagana Butera <nyamsprod@gmail.com>2015-02-19 08:52:39 +0100
commit0a493cecf0216f4c797671601251e3c1a6452ffa (patch)
treea23aeb9c31d7e05ccffa30bd4e5dc46cd27a5139 /src/Exporter/DataFormatterCollection.php
parent959ede56075fec54891fad13744aeed6d42ad345 (diff)
downloadcsv-0a493cecf0216f4c797671601251e3c1a6452ffa.zip
csv-0a493cecf0216f4c797671601251e3c1a6452ffa.tar.gz
csv-0a493cecf0216f4c797671601251e3c1a6452ffa.tar.bz2
final package structure
Diffstat (limited to 'src/Exporter/DataFormatterCollection.php')
-rw-r--r--src/Exporter/DataFormatterCollection.php85
1 files changed, 0 insertions, 85 deletions
diff --git a/src/Exporter/DataFormatterCollection.php b/src/Exporter/DataFormatterCollection.php
deleted file mode 100644
index 495c5e3..0000000
--- a/src/Exporter/DataFormatterCollection.php
+++ /dev/null
@@ -1,85 +0,0 @@
-<?php
-/**
-* This file is part of the League.csv library
-*
-* @license http://opensource.org/licenses/MIT
-* @link https://github.com/thephpleague/csv/
-* @version 7.0.0
-* @package League.csv
-*
-* For the full copyright and license information, please view the LICENSE
-* file that was distributed with this source code.
-*/
-namespace League\Csv\Exporter;
-
-/**
- * A trait to format the row before insertion
- *
- * @package League.csv
- * @since 7.0.0
- *
- */
-trait DataFormatterCollection
-{
- /**
- * Callables to format the row before insertion
- *
- * @var callable[]
- */
- protected $formatters = [];
-
- /**
- * add a formatter to the collection
- *
- * @param callable $callable
- *
- * @return $this
- */
- public function addFormatter(callable $callable)
- {
- $this->formatters[] = $callable;
-
- return $this;
- }
-
- /**
- * Remove a formatter from the collection
- *
- * @param callable $callable
- *
- * @return $this
- */
- public function removeFormatter(callable $callable)
- {
- $res = array_search($callable, $this->formatters, true);
- if (false !== $res) {
- unset($this->formatters[$res]);
- }
-
- return $this;
- }
-
- /**
- * Detect if the formatter is already registered
- *
- * @param callable $callable
- *
- * @return bool
- */
- public function hasFormatter(callable $callable)
- {
- return false !== array_search($callable, $this->formatters, true);
- }
-
- /**
- * Remove all registered formatter
- *
- * @return $this
- */
- public function clearFormatters()
- {
- $this->formatters = [];
-
- return $this;
- }
-}