Skip to content

Php8 multiple signatures#950

Merged
MaXal merged 3 commits intomasterfrom
php8_multiple_signatures
Nov 12, 2020
Merged

Php8 multiple signatures#950
MaXal merged 3 commits intomasterfrom
php8_multiple_signatures

Conversation

@MaXal
Copy link
Copy Markdown
Collaborator

@MaXal MaXal commented Nov 10, 2020

No description provided.

@MaXal MaXal requested review from isfedorov and wbars November 10, 2020 14:43
gd/gd.php Outdated
#[Pure]
function imagecreatefromstring ($image) {}

#[PhpStormStubsElementAvailable('5.3','7.4')]
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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