Skip to content

Match fgetcsv parameter names to values in reflection #493

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

Firehed
Copy link
Contributor

@Firehed Firehed commented Mar 18, 2021

The documented parameters differ from the names exposed in reflection/source code. Now that named parameters are supported in PHP 8, this discrepancy is confusing and impactful.

 $ php --rf fgetcsv
Function [ <internal:standard> function fgetcsv ] {

  - Parameters [5] {
    Parameter #0 [ <required> $stream ]
    Parameter #1 [ <optional> ?int $length = null ]
    Parameter #2 [ <optional> string $separator = "," ]
    Parameter #3 [ <optional> string $enclosure = "\"" ]
    Parameter #4 [ <optional> string $escape = "\\" ]
  }
  - Return [ array|false ]
}

The documented parameters differ from the names exposed in reflection/source code. Now that named parameters are supported in PHP 8, this discrepancy is confusing and impactful.

```
 $ php --rf fgetcsv
Function [ <internal:standard> function fgetcsv ] {

  - Parameters [5] {
    Parameter #0 [ <required> $stream ]
    Parameter php#1 [ <optional> ?int $length = null ]
    Parameter php#2 [ <optional> string $separator = "," ]
    Parameter php#3 [ <optional> string $enclosure = "\"" ]
    Parameter php#4 [ <optional> string $escape = "\\" ]
  }
  - Return [ array|false ]
}
```
Copy link
Member

@cmb69 cmb69 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you; the patch is fine! However, there is already work in progress to semi-automatically update the documentation from the *.stub.php files. I think it's generally preferable to do it this way, since there are soo many changes.

@Firehed
Copy link
Contributor Author

Firehed commented Mar 18, 2021

That's great to hear - we'll add benefit from that kind of automation :)

@php-pulls php-pulls closed this in 397f37e Mar 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants