Skip to content
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

Php8 multiple signatures #950

Merged
merged 3 commits into from
Nov 12, 2020
Merged

Php8 multiple signatures #950

merged 3 commits into from
Nov 12, 2020

Conversation

MaXal
Copy link
Collaborator

@MaXal MaXal commented Nov 10, 2020

No description provided.

@MaXal MaXal requested review from wbars and isfedorov November 10, 2020 14:43
gd/gd.php Outdated
* the image type is unsupported, the data is not in a recognised format,
* or the image is corrupt and cannot be loaded.
*/
#[Pure]
function imagecreatefromstring ($image) {}

#[PhpStormStubsElementAvailable('5.3','7.4')]
Copy link
Member

Choose a reason for hiding this comment

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

As the matter of code style I'd group multiple attributes together

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I thought about it but decided to insert the annotation before the PHPDoc for better readability but this is discussable I guess and depends on the navigation patterns:) If GoTo is used, it's better to have attributes together if scrolling - better to have a new attribute above.

@wbars
Copy link
Member

wbars commented Nov 10, 2020

💪

* on failure.
* @see PDOStatement::setFetchMode For a full description of the second and following parameters.
*/
public function query ($statement, $mode = PDO::ATTR_DEFAULT_FETCH_MODE, ...$fetch_mode_args) {}
Copy link
Contributor

Choose a reason for hiding this comment

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

May be it makes sense to add property and return types (including union types) directly to signatures for entities marked with #[PhpStormStubsElementAvailable('8.0')] ? Thus we will strict types and improve type inference.

@isfedorov
Copy link
Contributor

Should we somehow explicitly notify authors of 3rd party tools about such changes to allow them update tools to support duplicated items in stubs?

@wbars
Copy link
Member

wbars commented Nov 11, 2020

Should we somehow explicitly notify authors of 3rd party tools about such changes to allow them update tools to support duplicated items in stubs?

Duplicates existed in stubs before this change, so nothing generally should change

@wbars wbars self-requested a review November 12, 2020 06:26
@wbars wbars closed this Nov 12, 2020
@wbars wbars reopened this Nov 12, 2020
@MaXal MaXal merged commit 1d6f06d into master Nov 12, 2020
@MaXal MaXal deleted the php8_multiple_signatures branch November 25, 2020 13:53
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.

3 participants