Skip to content

Improve Writer Quoting feature - #606

Open
nyamsprod wants to merge 7 commits into
masterfrom
feature/writer-quoting
Open

nyamsprod wants to merge 7 commits into
masterfrom
feature/writer-quoting

Conversation

@nyamsprod

@nyamsprod nyamsprod commented Nov 11, 2026 •

Copy link
Copy Markdown
Member

Rewrite and simplify Writer quoting feature based on Python quoting constant,
see:

The following quoting type from Python are not backported to league/csv because they have no counterpart in PHP.

The escape character is never used outside of the Quoting::Minimal type which is the default type covered by PHP's fputcsv.

The following Enum is added:

enum Quoting
{
    case All;
    case NonNumeric;
    case Minimal;
    case EscapeOnly;
    case None;
}

alongside the following methods:

  • Writer::setQuoting(Quoting $quoting): Writer
  • Writer::getQuooting(): Quoting

And thus, the following methods are deprecated:

  • Writer::forceEnclosure
  • Writer::noEnclosure
  • Writer::necessaryEnclosure
  • Writer::encloseAll
  • Writer::encloseNecessary
  • Writer::encloseNone

By default and to avoid BC break, the default quoting mechanism is Quoting::Minimal

@nyamsprod nyamsprod self-assigned this Nov 11, 2026
@nyamsprod
nyamsprod force-pushed the feature/writer-quoting branch from a716f68 to dd0ddf0 Compare November 12, 2026 03:51
@nyamsprod
nyamsprod force-pushed the feature/writer-quoting branch 2 times, most recently from ea4ab1a to dfb17f9 Compare November 17, 2026 07:57
@nyamsprod
nyamsprod force-pushed the feature/writer-quoting branch from dfb17f9 to 1a3965c Compare November 17, 2026 11:39

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant