EnumFormatter to format Enum for CSV serializationThis is the last version supporting PHP8.1
AbstractCsv::from and AbstractCsv::fromString to simplify instantiating Reader and Writer instance.Stream::from and Stream::fromString to simplify internal instantiation of Stream instances.AbstractCsv::createFromString use AbstractCsv::fromString insteadAbstractCsv::createFromStream use AbstractCsv::from insteadAbstractCsv::createFromFileObject use AbstractCsv::from insteadStream::createFromResource use Stream::from insteadStream::createFromString use Stream::fromString insteadJsonFormat::NdJsonHeader and JsonFormat::NdJsonHeaderLessJsonConverter conversion methods accept an optional $header parameter to handle the new JSON formats.Writer::insertAll and converter classes convert methods now accept TabularData and TabularDataProvider implementing classesWarning class to fix warnings triggering in the codebase.chunkSize usage when NDJson is generated by the JsonConverter class.application/x-ndjson.JsonFormat Enum to allow exporting to JsonLines with the JsonConverter object.TabularDataProvider interface to allow connecting to the package features without implementing all the methods.PHP8.5 in github actionsDOMDocument::createTextNode() receives a string #567 by serpentbladeTabularData::last and TabularData::lastAsObjectAbstractCsv::download methodWriter::necessaryEnclosureTabularDataReader::selectAllExceptStatement::selectAllExceptResultSet::from and ResultSet::tryFromRdbmsResult class to ease importing RDBMS result into the package classesTabularData interfaceBuffer classXMLConverter::supportsHeaderXMLConverter::whenHTMLConverter::whenJsonConverter::whenCharsetConverter::appendOnReadTo, CharsetConverter::appendOnWriteTo, CharsetConverter::prependOnReadTo, CharsetConverter::prependOnWriteToWriter::relaxEnclosure use Writer::necessaryEnclosureResultSet::createFromTabularDataReader use ResultSet::fromResultSet::createFromRecords use ResultSet::fromResultSet::__construct is marked as being internal and deprecated before being made private use ResultSet::fromXMLConverter::convert use XMLConverter::import insteadXMLConverter::create use XMLConverter::__construct insteadHTMLConverter::create use HTMLConverter::__construct insteadStatement::create use Statement::__construct insteadFragmentFinder::create use FragmentFinder::__construct insteadCharsetConverter::appendTo, CharsetConverter::prependTo use the more strict methods added on the instanceComparison::CONTAINS must check the value is a string before calling str_compare #548 by cage-isBom::tryFromSequence and Bom::fromSequence supports the Reader and Writer classes.XMLConverter::$formatter should not be public.XMLConverter internal rewritten to take advantage of PHP8.4 new dom classesHTMLConverter internal rewritten to take advantage of PHP8.4 new dom classesXMLConverter::fieldElement now has a nullable field element to allow using headers names as cell names.TabularDataReader::map method.StreamFilter classCallbackStreamFilter classAbstractCsv::appendStreamFilterOnReadAbstractCsv::appendStreamFilterOnWriteAbstractCsv::prependStreamFilterOnReadAbstractCsv::prependStreamFilterOnWriteStream::getMode returns the underlying stream mode; internal codebase.AbstractCsv::addStreamFilter use AbstractCsv::appendStreamFilterOnRead or AbstractCsv::appendStreamFilterOnWrite instead.CharsetConverter and SwapDelimiter internal code.supportStreamFilterOnReadand supportStreamFilterOnWrite to expose the document real stream filter capabilities.XMLConverter::formatterHTMLConverter::formatterWriter::encloseNoneWriter::encloseNecessaryWriter::noEnclosureJsonConverter::formatter now accepts callable before only Closure where accepted.Writer::$enclose_all is no longer a boolean but an integerJsonConverter::withPrettyPrint now accepts an optional $identSize parameter as its unique parameter.Statement::when to enable conditionable query building.Deprecated attribute to signal deprecated public API methods and constants.JsonConverter::indentSizecallable in the Query\Constraint namespace.HttpHeaders::forFileDownload to be inline with RFC2183 and HTTP field name and value best practices.League\Csv\JsonConverter::chunkSizeLeague\Csv\AbstractCsv::downloadLeague\Csv\AbstractCsv::output use League\Csv\AbstractCsv::download insteadLeague\Csv\FragmentFinder and derived methods are marked as experimental as their results will be changed in the next major version.League\Csv\JsonConverter::download the filename is now nullableLeague\Csv\XMLConverter::download the filename is now nullableLeague\Csv\JsonConverter::save throws a TypeError exception if the $destination type is not supported.League\Csv\SwapDelimiter::apppendToLeague\Csv\SwapDelimiter::prependToLeague\Csv\CharsetConverter::apppendToLeague\Csv\CharsetConverter::prependToLeague\Csv\XMLConverter::downloadLeague\Csv\JsonConverterLeague\Csv\Constraint\Criteria::andNotLeague\Csv\Constraint\Criteria::orNotLeague\Csv\Constraint\Criteria::xorNotLeague\Csv\Serializer\MapRecord attributeconvertEmptyStringToNull options to MapCell and to MapRecord to improve string and null conversiontrimFieldValueBeforeCasting options to MapCell and to MapRecord to improve string conversiontrimElementValueBeforeCasting option to CasToArray to improve conversion during denormalizationheaderOffset option to CasToArray to improve conversion during denormalization. The optoon is only used with the CSV shape.Cast* methods accept more input type to improve Denormalization usage when Reader::addFormatter is used or when the collection contains data other than string and null.Stream::getSize is added to the internal Stream classStream::getContents is added to the internal Stream classMapIterator::toIterator is added to the internal class MapIterator class to convert any iterable into an Iterator.array it now will be a collection of array instead of a simple array.HttpHeaders to improve file download throughout the codebase.leage\csv-doctrine is no longer a sub-split of the main league/csv package.Bom enumStream::ftellStatement::orderByAscStatement::orderByDescStatement::andWhereStatement::whereNotStatement::orWhereStatement::xorWhereStatement::andWhereColumnStatement::whereNotColumnStatement::orWhereColumnStatement::xorWhereColumnStatement::andWhereOffsetStatement::whereNotOffsetStatement::orWhereOffsetStatement::xorWhereOffsetQuery feature to allow easier filtering, ordering and querying tabular dataByteSequence Interface use the Bom enum insteadInfo::fetchBOMSequence use Bom::tryFromSequence insteadLeague\Csv\Doctrine use the new League\Csv\Constraint feature insteadLeague\Csv\Statement::create arguments; The method should be used without any argument at all. All arguments will be removed in the next major version.Reader and ResultSet docblocksBom enum instead of Info::fetchBOMSequenceAbstractCsv BOM related properties are moved to being Bom instances instead of nullable string.setOutpuBOM will only accept valid BOM sequences all other values except the empty string will throw a ValueError exception;ext-mbstring extension to work. But you should have it install in your system in order to use the mbstring related stream filters.ResultSet::chunkBy not working as documented.Statement::selectTabularDataReader::getRecordsAsObjectTabularDataReader::chunkByTabularDataReader::mapHeaderTabularDataReader::getObjects use TabularDataReader::getRecordsAsObject insteadReader::select and ResultSet::select now internally use Statement::selectStatement should not throw when LimitIterator is used in combinaison with ArrayIterator.Statement internal codebase improvement.$header argument on Statement::process is no longer deprecated. E_USER_DEPRECATED is no longer triggered.mbstring extensionTabularDataReader::fetchColumn is no longer deprecatedLeague\Csv\TabularDataReader::nthAsObject equivalent to nth but returns an object or nullLeague\Csv\TabularDataReader::firstAsObject equivalent to first but returns an object or nullLeague\Csv\Serializer\Denormalizer::types list all the registered typesLeague\Csv\SwapDelimiter stream filter to allow working with multibyte CSV delimiterLeague\Csv\Serializer\AfterMapping to work around the limitation of not using the class constructor during denormalization.League\Csv\Serializer\Denormalizer to allow registering type alias to improve callback usage.League\Csv\Serializer\MapCell has a new property ignore to allow ignoring a property or a method during denormalization.TabulatDataReader::valueTabulatDataReader::selectTabulatDataReader::getObjectsTabulatDataReader::matchingTabulatDataReader::matchingFirstTabulatDataReader::matchingFirstOrFailResultSet::fromRecordsStream::setMaxLineLenStream::getMaxLineLenLeague\Csv\Serializer\Denormalizer to allow denormalizing records into objects #508League\Csv\FragmentFinder to implement RFC7111$header argument on Statement::process is deprecated and will be removed in
the next version. Use TabularDataReader::getRecords on the returned value instead.
It's usage will trigger a E_USER_DEPRECATED call.$header argument for TabularDataReader;;getRecords becomes a full mapper between the records column offset and the column names #498ResultSet constructor now allows the records to be an array.Stream object will throw a RuntimeException if the rewind action failsfseek fails (returns -1 ) a RuntimeException will be thrown.Stream can iterate and return the full line respecting SplFielObject flags. Previously it only returned the CSV records.MapIterator::fromIterable to instantiate a MapIterator object from any iterable structure.EscapeFormula::unescapeRecord does the opposite of EscapeFormula::escapeRecordTabularReader::eachTabularReader::existsTabularReader::reduceTabularReader::filterTabularReader::sliceTabularReader::sortedReader::addFormatterAll the methods from the TabularReader interface are implemented on the Reader and the ResultSet objects.
EscapeFormula::__invoke use EscapeFormula::__escapeRecord insteadWriter::forceEnclosure and Writer::relaxEnclosure to control the presence of enclosure in the generated CSVWriter::getEndOfLine and Writer::setEndOfLineEncloseField stream filter in favor of the new Writer::forceEnclosure method.Writer::getNewline and Writer::setNewline in favor of Writer::getEndOfLine and Writer::setEndOfLineStream::fwrite to allow writing to a file in a normalized way. Internal use.TabularDataWriter interface to represent how to write to a tabular data document.TabularDataReader::first to replace TabularDataReader::fetchOneTabularDataReader::nth to replace TabularDataReader::fetchOneCharsetConverter::addBOMSkippingTo to improve BOM skipping see bug #483TabularDataReader::fetchOneStream::createFromResource
Stream::__construct is made private. The class is already marked as internal so BC break does not apply on it.
Using PHP8 feature to rewrite internal codebase
Replaced simple comparisons with strict comparison operator where types are obvious in internal codebase by [@astepin](https://github.com/astepin)
Marked class constants explicitly as public by [@astepin](https://github.com/astepin)
Minimal support version PHP8.1.2
Fix Docblock and method signature using PHP8 feature (Union Type)
Fix Internal codebase around seek usage and `#75917 requires PHP8.1.2
Remove internal usage of deprecated methods
Stream::fwrite The class is already marked as internal so BC break does not apply on it.Stream::fgets The class is already marked as internal so BC break does not apply on it.$eol argumentTabularDataReader::fetchColumnByName to replace TabularDataReader::fetchColumnTabularDataReader::fetchColumnByOffset to replace TabularDataReader::fetchColumnTabularDataReader::fetchColumn use TabularDataReader::fetchColumnByOffset or TabularDataReader::fetchColumnByName insteadAbstractCsv constructor is marked final via docblock.EmptyEscapeParser Polyfill used in Reader classWriter classEscapeFormula to follow OWASP latest recommendation PR #452ReturnTypeWillChange to avoid emitting a unnecessary deprecation notice. thanks to cedric-anneFILTER_SANITIZE_STRING by FILTER_UNSAFE_RAW$eol argumentLeague\Csv\SyntaxError::duplicateColumnNames to expose column name duplicates during header usageLeague\Csv\UnableToProcessCsv as the new Exception Marker InterfaceLeague\Csv\UnavailableStream as the new ExceptionLeague\Csv\Info::getDelimiterStats to replace the namespace function delimiter_detectLeague\Csv\Info::fetchBOMSequence to replace the namespace function bom_matchLeague\Csv\AbstractCsv::toString to replace League\Csv\AbstractCsv::getContent and League\Csv\AbstractCsv::__toStringLeague\Csv\XMLConverter::create to replace League\Csv\XMLConverter::__constructLeague\Csv\HTMLConverter::create to replace League\Csv\HTMLConverter::__constructLeague\Csv\AbstractCsv::supportsStreamFilterOnRead and League\Csv\AbstractCsv::supportsStreamFilterOnWrite to replace League\Csv\AbstractCsv::supportsStreamFilter and League\Csv\AbstractCsv::getStreamFilterModeLeague\Csv\delimiter_detect use League\Csv\Info::getDelimiterStatsLeague\Csv\bom_match use League\Csv\Info::fetchBOMSequenceLeague\Csv\AbstractCsv::getContent use League\Csv\AbstractCsv::toStringLeague\Csv\AbstractCsv::getStreamFilterMode use League\Csv\AbstractCsv::supportsStreamFilterOnRead or League\Csv\AbstractCsv::supportsStreamFilterOnWriteLeague\Csv\AbstractCsv::supportsStreamFilter use League\Csv\AbstractCsv::supportsStreamFilterOnRead or League\Csv\AbstractCsv::supportsStreamFilterOnWriteLeague\Csv\XMLConverter::__construct use League\Csv\XMLConverter::createLeague\Csv\HTMLConverter::__construct use League\Csv\HTMLConverter::createsrc directory[@internal](https://github.com/internal) are now finalLeague\Csv\AbstractCsv::STREAM_FILTER_MODE constant replaces League\Csv\AbstractCsv::$stream_filter_modeLeague\Csv\AbstractCsv::$stream_filter_modeHow can I help you explore Laravel packages today?