From b063031522f43faa0ea2693963139ab8bc74dc40 Mon Sep 17 00:00:00 2001 From: ignace nyamagana butera Date: Sat, 23 Nov 2024 18:15:36 +0100 Subject: [PATCH] Improve Deprecated attribute usage in the package --- src/AbstractCsv.php | 12 ++++++------ src/ByteSequence.php | 10 +++++----- src/EncloseField.php | 7 ++----- src/EscapeFormula.php | 2 +- src/HTMLConverter.php | 1 - src/Info.php | 2 +- src/InvalidArgument.php | 1 - src/JsonConverter.php | 2 +- src/RFC4180Field.php | 9 +++------ src/Reader.php | 4 ++-- src/ResultSet.php | 4 ++-- src/Serializer/AfterMapping.php | 16 ++++++---------- src/Serializer/CallbackCasting.php | 2 +- src/Serializer/Denormalizer.php | 4 ++-- src/Statement.php | 8 ++++---- src/SyntaxError.php | 1 - src/TabularDataReader.php | 2 +- src/UnavailableFeature.php | 1 - src/Writer.php | 10 +++++----- src/XMLConverter.php | 1 - src/functions.php | 4 ++-- 21 files changed, 44 insertions(+), 59 deletions(-) diff --git a/src/AbstractCsv.php b/src/AbstractCsv.php index e9b523c3..48976890 100644 --- a/src/AbstractCsv.php +++ b/src/AbstractCsv.php @@ -400,7 +400,7 @@ public function addStreamFilter(string $filtername, null|array $params = null): * * Returns the stream filter mode. */ - #[Deprecated(message:'Use AbstractCsv::supportsStreamFilterOnRead or AbstractCsv::supportsStreamFilterOnWrite instead', since:'league/csv:9.7.0')] + #[Deprecated(message:'use League\Csv\AbstractCsv::supportsStreamFilterOnRead() or League\Csv\AbstractCsv::supportsStreamFilterOnWrite() instead', since:'league/csv:9.7.0')] public function getStreamFilterMode(): int { return static::STREAM_FILTER_MODE; @@ -416,7 +416,7 @@ public function getStreamFilterMode(): int * * Tells whether the stream filter capabilities can be used. */ - #[Deprecated(message:'Use AbstractCsv::supportsStreamFilterOnRead or AbstractCsv::supportsStreamFilterOnWrite instead', since:'league/csv:9.7.0')] + #[Deprecated(message:'use League\Csv\AbstractCsv::supportsStreamFilterOnRead() or League\Csv\AbstractCsv::supportsStreamFilterOnWrite() instead', since:'league/csv:9.7.0')] public function supportsStreamFilter(): bool { return $this->document instanceof Stream; @@ -431,7 +431,7 @@ public function supportsStreamFilter(): bool * @see AbstractCsv::toString * @codeCoverageIgnore */ - #[Deprecated(message:'Use AbstractCsv::toString instead', since:'league/csv:9.7.0')] + #[Deprecated(message:'use League\Csv\AbstractCsv::toString() instead', since:'league/csv:9.7.0')] public function getContent(): string { return $this->toString(); @@ -446,7 +446,7 @@ public function getContent(): string * * Retrieves the CSV content */ - #[Deprecated(message:'Use AbstractCsv::toString instead', since:'league/csv:9.1.0')] + #[Deprecated(message:'use League\Csv\AbstractCsv::toString() instead', since:'league/csv:9.1.0')] public function __toString(): string { return $this->toString(); @@ -467,7 +467,7 @@ public function __toString(): string * @deprecated since version 9.17.0 * @see https://tools.ietf.org/html/rfc6266#section-4.3 */ - #[Deprecated(message:'Use HttpHeaders::forFileDownload instead', since:'league/csv:9.17.0')] + #[Deprecated(message:'the method no longer affect the outcome of the class, use League\Csv\HttpHeaders::forFileDownload instead', since:'league/csv:9.17.0')] protected function sendHeaders(string $filename): void { if (strlen($filename) !== strcspn($filename, '\\/')) { @@ -507,7 +507,7 @@ protected function sendHeaders(string $filename): void * * @throws Exception */ - #[Deprecated(message:'Use AbstractCsv::download instead', since:'league/csv:9.18.0')] + #[Deprecated(message:'use League\Csv\AbstractCsv::download() instead', since:'league/csv:9.18.0')] public function output(?string $filename = null): int { try { diff --git a/src/ByteSequence.php b/src/ByteSequence.php index b17ad61e..5ddb1312 100644 --- a/src/ByteSequence.php +++ b/src/ByteSequence.php @@ -21,14 +21,14 @@ */ interface ByteSequence { - #[Deprecated(message: 'Use Bom:Utf8 instead', since: 'league/csv:9.16.0')] + #[Deprecated(message: 'use League\Csv\Bom:Utf8 instead', since: 'league/csv:9.16.0')] public const BOM_UTF8 = "\xEF\xBB\xBF"; - #[Deprecated(message: 'Use Bom:Utf16be instead', since: 'league/csv:9.16.0')] + #[Deprecated(message: 'use League\Csv\Bom:Utf16be instead', since: 'league/csv:9.16.0')] public const BOM_UTF16_BE = "\xFE\xFF"; - #[Deprecated(message: 'Use Bom:Utf16Le instead', since: 'league/csv:9.16.0')] + #[Deprecated(message: 'use League\Csv\Bom:Utf16Le instead', since: 'league/csv:9.16.0')] public const BOM_UTF16_LE = "\xFF\xFE"; - #[Deprecated(message: 'Use Bom:Utf32Be instead', since: 'league/csv:9.16.0')] + #[Deprecated(message: 'use League\Csv\Bom:Utf32Be instead', since: 'league/csv:9.16.0')] public const BOM_UTF32_BE = "\x00\x00\xFE\xFF"; - #[Deprecated(message: 'Use Bom:Utf32Le instead', since: 'league/csv:9.16.0')] + #[Deprecated(message: 'use League\Csv\Bom:Utf32Le instead', since: 'league/csv:9.16.0')] public const BOM_UTF32_LE = "\xFF\xFE\x00\x00"; } diff --git a/src/EncloseField.php b/src/EncloseField.php index 02f186bf..c828171e 100644 --- a/src/EncloseField.php +++ b/src/EncloseField.php @@ -40,6 +40,7 @@ */ class EncloseField extends php_user_filter { + #[Deprecated(message: 'use League\Csv\Writer::forceEnclosure() instead', since: 'league/csv:9.10.0')] public const FILTERNAME = 'convert.league.csv.enclosure'; /** Default sequence. */ @@ -50,7 +51,6 @@ class EncloseField extends php_user_filter /** * Static method to return the stream filter filtername. */ - #[Deprecated(message: 'Use Writer::forceEnclosure instead', since: 'league/csv:9.10.0')] public static function getFiltername(): string { return self::FILTERNAME; @@ -59,7 +59,6 @@ public static function getFiltername(): string /** * Static method to register the class as a stream filter. */ - #[Deprecated(message: 'Use Writer::forceEnclosure instead', since: 'league/csv:9.10.0')] public static function register(): void { if (!in_array(self::FILTERNAME, stream_get_filters(), true)) { @@ -73,7 +72,6 @@ public static function register(): void * @throws InvalidArgumentException if the sequence is malformed * @throws Exception */ - #[Deprecated(message: 'Use Writer::forceEnclosure instead', since: 'league/csv:9.10.0')] public static function addTo(Writer $csv, string $sequence): Writer { self::register(); @@ -97,7 +95,7 @@ protected static function isValidSequence(string $sequence): bool return strlen($sequence) !== strcspn($sequence, self::$force_enclosure); } - #[Deprecated(message: 'Use Writer::forceEnclosure instead', since: 'league/csv:9.10.0')] + #[Deprecated(message: 'use League\Csv\Writer::forceEnclosure() instead', since: 'league/csv:9.10.0')] public function onCreate(): bool { return is_array($this->params) @@ -110,7 +108,6 @@ public function onCreate(): bool * @param resource $out * @param int $consumed */ - #[Deprecated(message: 'Use Writer::forceEnclosure instead', since: 'league/csv:9.10.0')] public function filter($in, $out, &$consumed, bool $closing): int { /** @var array $params */ diff --git a/src/EscapeFormula.php b/src/EscapeFormula.php index cfaba0c1..73f22e68 100644 --- a/src/EscapeFormula.php +++ b/src/EscapeFormula.php @@ -152,7 +152,7 @@ protected function isStringable(mixed $value): bool * * @see escapeRecord */ - #[Deprecated(message:'use EscapeFormula::escapeRecord instead', since:'league/csv:9.11.0')] + #[Deprecated(message:'use League\Csv\EscapeFormula::escapeRecord() instead', since:'league/csv:9.11.0')] public function __invoke(array $record): array { return $this->escapeRecord($record); diff --git a/src/HTMLConverter.php b/src/HTMLConverter.php index 722e4125..9a6fc072 100644 --- a/src/HTMLConverter.php +++ b/src/HTMLConverter.php @@ -43,7 +43,6 @@ public static function create(): self * @see HTMLConverter::create() * @deprecated since version 9.7.0 */ - #[Deprecated(message:'use HTMLConverter::create instead', since:'league/csv:9.7.0')] public function __construct() { $this->xml_converter = XMLConverter::create() diff --git a/src/Info.php b/src/Info.php index c076ec1a..0c3a8d30 100644 --- a/src/Info.php +++ b/src/Info.php @@ -35,7 +35,7 @@ final class Info implements ByteSequence * @see Bom::tryFromSequence() * @codeCoverageIgnore */ - #[Deprecated(message:'use Bom::tryFromSequence instead', since:'league/csv:9.16.0')] + #[Deprecated(message:'use League\Csv\Bom::tryFromSequence() instead', since:'league/csv:9.16.0')] public static function fetchBOMSequence(string $str): ?string { return Bom::tryFromSequence($str)?->value; diff --git a/src/InvalidArgument.php b/src/InvalidArgument.php index 7bbd6c5e..a880a377 100644 --- a/src/InvalidArgument.php +++ b/src/InvalidArgument.php @@ -26,7 +26,6 @@ class InvalidArgument extends Exception * * @deprecated since version 9.7.0 */ - #[Deprecated(message:'use its named constructor instead', since:'league/csv:9.7.0')] public function __construct(string $message = '', int $code = 0, ?Throwable $previous = null) { parent::__construct($message, $code, $previous); diff --git a/src/JsonConverter.php b/src/JsonConverter.php index 936bd313..0eac513d 100644 --- a/src/JsonConverter.php +++ b/src/JsonConverter.php @@ -503,7 +503,7 @@ public function convert(iterable $records): Iterator * * @param int<1, max> $indentSize */ - #[Deprecated(message:'Use JsonConverter::withPrettyPrint instead', since:'league/csv:9.19.0')] + #[Deprecated(message:'use League\Csv\JsonConverter::withPrettyPrint() instead', since:'league/csv:9.19.0')] public function indentSize(int $indentSize): self { return match ($indentSize) { diff --git a/src/RFC4180Field.php b/src/RFC4180Field.php index 987eeac1..98afe8db 100644 --- a/src/RFC4180Field.php +++ b/src/RFC4180Field.php @@ -44,6 +44,7 @@ */ class RFC4180Field extends php_user_filter { + #[Deprecated(message: 'use League\Csv\Reader::setEscape or League\Csv\Writer::setEscape instead', since: 'league/csv:9.2.0')] public const FILTERNAME = 'convert.league.csv.rfc4180'; /** @@ -68,7 +69,6 @@ class RFC4180Field extends php_user_filter /** * Static method to add the stream filter to a {@link AbstractCsv} object. */ - #[Deprecated(message: 'Use Reader::setEscape or Writer::setEscape instead', since: 'league/csv:9.2.0')] public static function addTo(AbstractCsv $csv, string $whitespace_replace = ''): AbstractCsv { self::register(); @@ -91,7 +91,7 @@ public static function addTo(AbstractCsv $csv, string $whitespace_replace = ''): * Add a formatter to the {@link Writer} object to format the record * field to avoid enclosure around a field with an empty space. */ - #[Deprecated(message: 'Use Reader::setEscape or Writer::setEscape instead', since: 'league/csv:9.2.0')] + #[Deprecated(message: 'use League\Csv\Reader::setEscape or League\Csv\Writer::setEscape instead', since: 'league/csv:9.2.0')] public static function addFormatterTo(Writer $csv, string $whitespace_replace): Writer { if ('' == $whitespace_replace || strlen($whitespace_replace) !== strcspn($whitespace_replace, self::$force_enclosure)) { @@ -108,7 +108,6 @@ public static function addFormatterTo(Writer $csv, string $whitespace_replace): /** * Static method to register the class as a stream filter. */ - #[Deprecated(message: 'Use Reader::setEscape or Writer::setEscape instead', since: 'league/csv:9.2.0')] public static function register(): void { if (!in_array(self::FILTERNAME, stream_get_filters(), true)) { @@ -119,7 +118,6 @@ public static function register(): void /** * Static method to return the stream filter filtername. */ - #[Deprecated(message: 'Use Reader::setEscape or Writer::setEscape instead', since: 'league/csv:9.2.0')] public static function getFiltername(): string { return self::FILTERNAME; @@ -130,7 +128,6 @@ public static function getFiltername(): string * @param resource $out * @param int $consumed */ - #[Deprecated(message: 'Use Reader::setEscape or Writer::setEscape instead', since: 'league/csv:9.2.0')] public function filter($in, $out, &$consumed, bool $closing): int { while (null !== ($bucket = stream_bucket_make_writeable($in))) { @@ -142,7 +139,7 @@ public function filter($in, $out, &$consumed, bool $closing): int return PSFS_PASS_ON; } - #[Deprecated(message: 'Use Reader::setEscape or Writer::setEscape instead', since: 'league/csv:9.2.0')] + #[Deprecated(message: 'use League\Csv\Reader::setEscape or League\Csv\Writer::setEscape instead', since: 'league/csv:9.2.0')] public function onCreate(): bool { if (!is_array($this->params)) { diff --git a/src/Reader.php b/src/Reader.php index 13128636..7c139335 100644 --- a/src/Reader.php +++ b/src/Reader.php @@ -615,7 +615,7 @@ protected function combineHeader(Iterator $iterator, array $header): Iterator * @deprecated since version 9.9.0 * @codeCoverageIgnore */ - #[Deprecated(message:'Use Reader::nth instead', since:'league/csv:9.9.0')] + #[Deprecated(message:'use League\Csv\Reader::nth() instead', since:'league/csv:9.9.0')] public function fetchOne(int $nth_record = 0): array { return $this->nth($nth_record); @@ -635,7 +635,7 @@ public function fetchOne(int $nth_record = 0): array * @throws MappingFailed * @throws TypeCastingFailed */ - #[Deprecated(message:'Use Reader::getRecordsAsObject instead', since:'league/csv:9.15.0')] + #[Deprecated(message:'use League\Csv\Reader::getRecordsAsObject() instead', since:'league/csv:9.15.0')] public function getObjects(string $className, array $header = []): Iterator { return $this->getRecordsAsObject($className, $header); diff --git a/src/ResultSet.php b/src/ResultSet.php index 0d13e73c..836a0950 100644 --- a/src/ResultSet.php +++ b/src/ResultSet.php @@ -547,7 +547,7 @@ public function fetchPairs($offset_index = 0, $value_index = 1): Iterator * @deprecated since version 9.9.0 * @codeCoverageIgnore */ - #[Deprecated(message:'Use Resultset::nth instead', since:'league/csv:9.9.0')] + #[Deprecated(message:'use League\Csv\Resultset::nth() instead', since:'league/csv:9.9.0')] public function fetchOne(int $nth_record = 0): array { return $this->nth($nth_record); @@ -567,7 +567,7 @@ public function fetchOne(int $nth_record = 0): array * @throws MappingFailed * @throws TypeCastingFailed */ - #[Deprecated(message:'Use ResultSet::getRecordsAsObject instead', since:'league/csv:9.15.0')] + #[Deprecated(message:'use League\Csv\ResultSet::getRecordsAsObject() instead', since:'league/csv:9.15.0')] public function getObjects(string $className, array $header = []): Iterator { return $this->getRecordsAsObject($className, $header); diff --git a/src/Serializer/AfterMapping.php b/src/Serializer/AfterMapping.php index a55c6eeb..1654be22 100644 --- a/src/Serializer/AfterMapping.php +++ b/src/Serializer/AfterMapping.php @@ -29,26 +29,22 @@ final class AfterMapping public readonly MapRecord $mapRecord; public readonly array $methods; - #[Deprecated(message: 'Use Leauge\Csv\Serializer\MapRecord instead', since: 'league/csv:9.17.0')] + #[Deprecated(message: 'use League\Csv\Serializer\MapRecord instead', since: 'league/csv:9.17.0')] public function __construct(string ...$methods) { $this->mapRecord = new MapRecord($methods); $this->methods = $this->mapRecord->afterMapping; } - #[Deprecated(message: 'Use Leauge\Csv\Serializer\MapRecord instead', since: 'league/csv:9.17.0')] public static function from(ReflectionClass $class): ?self { $attributes = $class->getAttributes(self::class, ReflectionAttribute::IS_INSTANCEOF); $nbAttributes = count($attributes); - if (0 === $nbAttributes) { - return null; - } - if (1 < $nbAttributes) { - throw new MappingFailed('Using more than one `'.self::class.'` attribute on a class property or method is not supported.'); - } - - return $attributes[0]->newInstance(); + return match (true) { + 0 === $nbAttributes => null, + 1 < $nbAttributes => throw new MappingFailed('Using more than one `'.self::class.'` attribute on a class property or method is not supported.'), + default => $attributes[0]->newInstance(), + }; } } diff --git a/src/Serializer/CallbackCasting.php b/src/Serializer/CallbackCasting.php index 673fe0f0..3385e085 100644 --- a/src/Serializer/CallbackCasting.php +++ b/src/Serializer/CallbackCasting.php @@ -377,7 +377,7 @@ private static function getTypes(?ReflectionType $type): array * @see CallbackCasting::unregisterType() * @codeCoverageIgnore */ - #[Deprecated(message:'Use CallbackCasting::unregisterType instead', since:'league/csv:9.13.0')] + #[Deprecated(message:'use League\Csv\Serializer\CallbackCasting::unregisterType() instead', since:'league/csv:9.13.0')] public static function unregister(string $type): bool { return self::unregisterType($type); diff --git a/src/Serializer/Denormalizer.php b/src/Serializer/Denormalizer.php index 2694720b..c5ec7b03 100644 --- a/src/Serializer/Denormalizer.php +++ b/src/Serializer/Denormalizer.php @@ -66,7 +66,7 @@ public function __construct(string $className, array $propertyNames = []) * * Enables converting empty string to the null value. */ - #[Deprecated(message:'Use MapRecord::$convertEmptyStringToNull or MapCell::$convertEmptyStringToNullinstead', since:'league/csv:9.17.0')] + #[Deprecated(message:'use League\Csv\Serializer\MapRecord::$convertEmptyStringToNull or League\Csv\Serializer\MapCell::$convertEmptyStringToNullinstead', since:'league/csv:9.17.0')] public static function allowEmptyStringAsNull(): void { self::$convertEmptyStringToNull = true; @@ -80,7 +80,7 @@ public static function allowEmptyStringAsNull(): void * * Disables converting empty string to the null value. */ - #[Deprecated(message:'Use MapRecord::$convertEmptyStringToNull or MapCell::$convertEmptyStringToNullinstead', since:'league/csv:9.17.0')] + #[Deprecated(message:'use League\Csv\Serializer\MapRecord::$convertEmptyStringToNull or League\Csv\Serializer\MapCell::$convertEmptyStringToNullinstead', since:'league/csv:9.17.0')] public static function disallowEmptyStringAsNull(): void { self::$convertEmptyStringToNull = false; diff --git a/src/Statement.php b/src/Statement.php index 6ad18568..e89e4889 100644 --- a/src/Statement.php +++ b/src/Statement.php @@ -331,7 +331,7 @@ public function process(TabularDataReader $tabular_data, array $header = []): Ta * @see Statement::process() * @deprecated Since version 9.16.0 */ - #[Deprecated(message:'Use Statement::process() instead', since:'league/csv:9.16.0')] + #[Deprecated(message:'this method no longer affects on the outcome of the class, use League\Csv\Statement::process() instead', since:'league/csv:9.16.0')] protected function applySelect(Iterator $records, array $recordsHeader, array $select): TabularDataReader { $hasHeader = [] !== $recordsHeader; @@ -380,7 +380,7 @@ protected function applySelect(Iterator $records, array $recordsHeader, array $s * @deprecated Since version 9.15.0 * @codeCoverageIgnore */ - #[Deprecated(message:'Use Statement::applyFilter() instead', since:'league/csv:9.15.0')] + #[Deprecated(message:'this method no longer affects on the outcome of the class, use League\Csv\Statement::applyFilter() instead', since:'league/csv:9.15.0')] protected function filter(Iterator $iterator, callable $callable): CallbackFilterIterator { return new CallbackFilterIterator($iterator, $callable); @@ -395,7 +395,7 @@ protected function filter(Iterator $iterator, callable $callable): CallbackFilte * @deprecated Since version 9.16.0 * @codeCoverageIgnore */ - #[Deprecated(message:'Use Statement::process() instead', since:'league/csv:9.16.0')] + #[Deprecated(message:'this method no longer affects on the outcome of the class, use League\Csv\Statement::process() instead', since:'league/csv:9.16.0')] protected function applyFilter(Iterator $iterator): Iterator { $filter = function (array $record, string|int $key): bool { @@ -420,7 +420,7 @@ protected function applyFilter(Iterator $iterator): Iterator * @deprecated Since version 9.16.0 * @codeCoverageIgnore */ - #[Deprecated(message:'Use Statement::process() instead', since:'league/csv:9.16.0')] + #[Deprecated(message:'this method no longer affects on the outcome of the class, use League\Csv\Statement::process() instead', since:'league/csv:9.16.0')] protected function buildOrderBy(Iterator $iterator): Iterator { if ([] === $this->order_by) { diff --git a/src/SyntaxError.php b/src/SyntaxError.php index d72976b3..034ebecd 100644 --- a/src/SyntaxError.php +++ b/src/SyntaxError.php @@ -35,7 +35,6 @@ class SyntaxError extends Exception * * @deprecated since version 9.7.0 */ - #[Deprecated(message:'Use named constructor instead', since:'league/csv:9.7.0')] public function __construct(string $message = '', int $code = 0, ?Throwable $previous = null) { parent::__construct($message, $code, $previous); diff --git a/src/TabularDataReader.php b/src/TabularDataReader.php index cd5306ff..be2ff804 100644 --- a/src/TabularDataReader.php +++ b/src/TabularDataReader.php @@ -127,7 +127,7 @@ public function fetchPairs($offset_index = 0, $value_index = 1): Iterator; * * @throws UnableToProcessCsv if argument is less than 0 */ - #[Deprecated(message:'Use TabularDataReader::nth() instead', since:'league/csv:9.9.0')] + #[Deprecated(message:'use League\Csv\TabularDataReader::nth() instead', since:'league/csv:9.9.0')] public function fetchOne(int $nth_record = 0): array; /** diff --git a/src/UnavailableFeature.php b/src/UnavailableFeature.php index 0809c05a..1d153c79 100644 --- a/src/UnavailableFeature.php +++ b/src/UnavailableFeature.php @@ -26,7 +26,6 @@ class UnavailableFeature extends Exception * * @deprecated since version 9.7.0 */ - #[Deprecated(message:'Use named constructor instead', since:'league/csv:9.9.0')] public function __construct(string $message = '', int $code = 0, ?Throwable $previous = null) { parent::__construct($message, $code, $previous); diff --git a/src/Writer.php b/src/Writer.php index 2b2d1e88..45b07e54 100644 --- a/src/Writer.php +++ b/src/Writer.php @@ -228,7 +228,7 @@ public function forceEnclosure(): self * - NULL values, * - or objects implementing the __toString() method. */ - #[Deprecated(message:'No longer used', since:'league/csv:9.8.0')] + #[Deprecated(message:'no longer affecting the class behaviour', since:'league/csv:9.8.0')] protected function formatRecord(array $record, callable $formatter): array { return $formatter($record); @@ -244,7 +244,7 @@ protected function formatRecord(array $record, callable $formatter): array * * @see https://php.net/manual/en/function.fputcsv.php */ - #[Deprecated(message:'No longer used', since:'league/csv:9.9.0')] + #[Deprecated(message:'no longer affecting the class behaviour', since:'league/csv:9.9.0')] protected function addRecord(array $record): int|false { return $this->document->fputcsv($record, $this->delimiter, $this->enclosure, $this->escape, $this->newline); @@ -258,7 +258,7 @@ protected function addRecord(array $record): int|false * * Applies post insertion actions. */ - #[Deprecated(message:'No longer used', since:'league/csv:9.9.0')] + #[Deprecated(message:'no longer affecting the class behaviour', since:'league/csv:9.9.0')] protected function consolidate(): int { if (null === $this->flush_threshold) { @@ -283,7 +283,7 @@ protected function consolidate(): int * * Returns the current newline sequence characters. */ - #[Deprecated(message:'Use Writer::getEndOfLine()', since:'league/csv:9.8.0')] + #[Deprecated(message:'use League\Csv\Writer::getEndOfLine()', since:'league/csv:9.8.0')] public function getNewline(): string { return $this->getEndOfLine(); @@ -298,7 +298,7 @@ public function getNewline(): string * * Sets the newline sequence. */ - #[Deprecated(message:'Use Writer::setEndOfLine()', since:'league/csv:9.8.0')] + #[Deprecated(message:'use League\Csv\Writer::setEndOfLine()', since:'league/csv:9.8.0')] public function setNewline(string $newline): self { return $this->setEndOfLine($newline); diff --git a/src/XMLConverter.php b/src/XMLConverter.php index 81213ca2..388364c6 100644 --- a/src/XMLConverter.php +++ b/src/XMLConverter.php @@ -47,7 +47,6 @@ public static function create(): self * @deprecated since version 9.7.0 * @see XMLConverter::create() */ - #[Deprecated(message:'Use named constructor instead', since:'league/csv:9.7.0')] public function __construct() { } diff --git a/src/functions.php b/src/functions.php index 302a2d96..ce56fbb0 100644 --- a/src/functions.php +++ b/src/functions.php @@ -26,7 +26,7 @@ * * If no valid BOM sequence is found an empty string is returned */ -#[Deprecated(message:'Use Bom::tryFromSequence()', since:'league/csv:9.7.0')] +#[Deprecated(message:'use League\Csv\Bom::tryFromSequence()', since:'league/csv:9.7.0')] function bom_match(string $str): string { return Bom::tryFromSequence($str)?->value ?? ''; @@ -50,7 +50,7 @@ function bom_match(string $str): string * * @return array */ -#[Deprecated(message:'Use Info::getDelimiterStats() instead', since:'league/csv:9.8.0')] +#[Deprecated(message:'use League\Csv\Info::getDelimiterStats() instead', since:'league/csv:9.8.0')] function delimiter_detect(Reader $csv, array $delimiters, int $limit = 1): array { return Info::getDelimiterStats($csv, $delimiters, $limit);