Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Implement template default types #1835

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
rvanvelzen wants to merge 2 commits into phpstan:1.9.x from rvanvelzen:template-default

Conversation

@rvanvelzen
Copy link
Contributor

@rvanvelzen rvanvelzen commented Oct 13, 2022

mad-briller, vhenzl, voku, tyabu12, devfrey, LastDragon-ru, jiripudil, yurikuzn, axlon, DjordyKoert, and 8 more reacted with heart emoji
Copy link
Member

Feel free to rebase your PR without any Composer changes, I updated the parser on 1.9.x :)


/**
* @template T1 = true
* @template T2 = true
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder what syntax is for bound templates? Something like @template T of bool = true?

Copy link
Contributor Author

@rvanvelzen rvanvelzen Nov 4, 2022

Choose a reason for hiding this comment

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

Yes

b1rdex and kbond reacted with thumbs up emoji
Copy link
Contributor

ruudk commented Mar 7, 2023

@rvanvelzen Are you still interested in solving this? Having default values would be extremely handy!

devfrey reacted with thumbs up emoji

Copy link
Contributor Author

@ruudk I won't have time to work on this in the foreseeable future, but I do intend to solve this.

That being said, anyone should feel free to take this over :)

Copy link
Member

@rvanvelzen I need to tell you that I really miss your contributions :) Not just this specific one, but in general - a PR from you was always something to look forward to :)

rvanvelzen reacted with laugh emoji canvural reacted with heart emoji

use function PHPStan\Testing\assertType;

/**
* @template T
Copy link
Contributor

@mvorisek mvorisek Dec 3, 2023
edited
Loading

Choose a reason for hiding this comment

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

@template T of Xxx test should be added like in phpstan/phpstan#4801 (comment).

When of Xxx is specified, it should be used as implicit default type.

Copy link
Contributor

Since #1835 is resolved ; I assume this PR can be closed @rvanvelzen

rvanvelzen reacted with thumbs up emoji

@rvanvelzen rvanvelzen deleted the template-default branch July 19, 2025 09:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

2 more reviewers

@b1rdex b1rdex b1rdex left review comments

@mvorisek mvorisek mvorisek left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Add support for template default types

AltStyle によって変換されたページ (->オリジナル) /