| 1 |
<?php |
| 2 |
|
| 3 |
/** |
| 4 |
* League.Csv (https://csv.thephpleague.com) |
| 5 |
* |
| 6 |
* (c) Ignace Nyamagana Butera <[email protected]> |
| 7 |
* |
| 8 |
* For the full copyright and license information, please view the LICENSE |
| 9 |
* file that was distributed with this source code. |
| 10 |
*/ |
| 11 |
|
| 12 |
declare(strict_types=1); |
| 13 |
|
| 14 |
namespace League\Csv; |
| 15 |
|
| 16 |
/** |
| 17 |
* DEPRECATION WARNING! This class will be removed in the next major point release. |
| 18 |
* |
| 19 |
* @deprecated since version 9.7.0 |
| 20 |
* @see Info::fetchBOMSequence() |
| 21 |
* |
| 22 |
* Returns the BOM sequence found at the start of the string. |
| 23 |
* |
| 24 |
* If no valid BOM sequence is found an empty string is returned |
| 25 |
*/ |
| 26 |
function bom_match(string $str): string |
| 27 |
{ |
| 28 |
return Info::fetchBOMSequence($str) ?? ''; |
| 29 |
} |
| 30 |
|
| 31 |
/** |
| 32 |
* @param array<string> $delimiters |
| 33 |
* |
| 34 |
* @return array<string,int> |
| 35 |
* @deprecated since version 9.7.0 |
| 36 |
* @see Info::getDelimiterStats() |
| 37 |
* |
| 38 |
* Detect Delimiters usage in a {@link Reader} object. |
| 39 |
* |
| 40 |
* Returns a associative array where each key represents |
| 41 |
* a submitted delimiter and each value the number CSV fields found |
| 42 |
* when processing at most $limit CSV records with the given delimiter |
| 43 |
* |
| 44 |
*/ |
| 45 |
function delimiter_detect(Reader $csv, array $delimiters, int $limit = 1): array |
| 46 |
{ |
| 47 |
return Info::getDelimiterStats($csv, $delimiters, $limit); |
| 48 |
} |
| 49 |
|