]> git.mxchange.org Git - core.git/blobdiff - framework/main/classes/file_directories/text/input/csv/class_CsvInputFile.php
Continued:
[core.git] / framework / main / classes / file_directories / text / input / csv / class_CsvInputFile.php
index 81079f2ecae7e1d5b6c557bfa06c535e1bbc4a98..c34a6d18fba5398425ca3e7d96f78659c341d8e7 100644 (file)
@@ -4,6 +4,7 @@ namespace Org\Mxchange\CoreFramework\Filesystem\Input\Csv;
 
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Filesystem\Text\BaseInputTextFile;
+use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
 use Org\Mxchange\CoreFramework\Stream\Filesystem\CsvInputStreamer;
 
 // Import SPL stuff
@@ -16,7 +17,7 @@ use \UnexpectedValueException;
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2021 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
@@ -77,7 +78,7 @@ class CsvInputFile extends BaseInputTextFile implements CsvInputStreamer {
                /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] columnSeparator=%s,expectedMatches=%d - CALLED!', __METHOD__, __LINE__, $columnSeparator, $expectedMatches));
                if (strlen($columnSeparator) === 0) {
                        // No empty column separator
-                       throw new InvalidArgumentException('columnSeparator cannot be empty.');
+                       throw new InvalidArgumentException('Parameter "columnSeparator" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                } elseif ($expectedMatches < 0) {
                        // Below zero is not valid
                        throw new InvalidArgumentException(sprintf('expectedMatches=%d is below zero', $expectedMatches));
@@ -101,7 +102,7 @@ class CsvInputFile extends BaseInputTextFile implements CsvInputStreamer {
                /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] expectedMatches=%d,lineArray()=%d', __METHOD__, __LINE__, $expectedMatches, count($lineArray)));
                if (($expectedMatches > 0) && (count($lineArray) !== $expectedMatches)) {
                        // Invalid line found as strict count matching is requested
-                       throw new UnexpectedValueException(sprintf('lineArray()=%d has not expected count %d', count($lineArray), $expectedMatches));
+                       throw new UnexpectedValueException(sprintf('lineArray()=%d has not expected count %d', count($lineArray), $expectedMatches), FrameworkInterface::EXCEPTION_UNEXPECTED_VALUE);
                }
 
                // Return it