Skip to content

CsvReader and CsvWriter should accept the same type of file object, in the same order #114

Open

Description

@deviantintegral

CsvReader accepts an \SplFileObject as it's first parameter, while CsvWriter accepts a stream as it's third parameter.

https://github.com/portphp/csv/blob/master/src/CsvReader.php#L82

https://github.com/portphp/csv/blob/master/src/CsvWriter.php#L43

Ideally, these should both be the same type, as well as in the same position in the constructor arguments.

Activity

  1. hkvstore commented on Mar 26, 2022

    @hkvstore

    In addition, CsvReader supports $escape = '\\', but CsvWriter does not.

  2. ddeboer commented on Mar 26, 2022

    @ddeboer
    Member

    Good points! Would either of you want to open a PR to fix these issues?

  3. hkvstore commented on Mar 26, 2022

    @hkvstore

    Since that will be a breaking change, you may want to determine the constructor signature of CsvWriter.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions