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

phpstorm meta #7676

Open
wants to merge 1 commit into
base: old-prototype-3.x
Choose a base branch
from
Open

phpstorm meta #7676

wants to merge 1 commit into from

Conversation

MartkCz
Copy link

@MartkCz MartkCz commented Apr 9, 2019

Supports only few methods:

Parameter enums

Doctrine\ORM\EntityManager::find(X)
Doctrine\ORM\EntityManagerInterface::lock(_,_,X)
Doctrine\ORM\EntityManagerInterface::newHydrator(X)

Doctrine\ORM\AbstractQuery::getResult(X)
Doctrine\ORM\AbstractQuery::execute(X)
Doctrine\ORM\AbstractQuery::setParameter(_,_,X)
Doctrine\ORM\AbstractQuery::setFetchMode(,,X)
Doctrine\ORM\AbstractQuery::setHydrationMode()

Doctrine\ORM\QueryBuilder::getDQLPart(X)
Doctrine\ORM\QueryBuilder::resetDQLPart(X)
Doctrine\ORM\QueryBuilder::setCacheMode(X)
Doctrine\ORM\QueryBuilder::add(X)

Doctrine\ORM\Query::setCacheMode(X)

Return enums

Doctrine\ORM\QueryBuilder::getType()
Doctrine\ORM\QueryBuilder::getCacheMode()
Doctrine\ORM\QueryBuilder::getState()

Doctrine\ORM\Query::getCacheMode()

Doctrine\ORM\AbstractQuery::getHydrationMode()

Return types

Doctrine\Common\Persistence\ObjectManager::find(X)

Doctrine\ORM\EntityManagerInterface::copy(X)
Doctrine\ORM\EntityManagerInterface::getReference(X)
Doctrine\ORM\EntityManagerInterface::getPartialReference(X)
Doctrine\ORM\EntityManagerInterface::merge(X)

Preview

image

image

@greg0ire
Copy link
Member

greg0ire commented Apr 9, 2019

I'm against putting IDE-specific files in Doctrine repositories… have you considered creating a plugin instead?

Copy link
Contributor

@Majkl578 Majkl578 left a comment

Choose a reason for hiding this comment

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

Fully agree with @greg0ire.

@Ocramius
Copy link
Member

Ocramius commented Apr 9, 2019

I'm mostly for these changes (for some of these APIs), but I'd first need to know whether these meta files are actually used when located in a subpath: as far as I know, they need to live in your project root directory.

@greg0ire
Copy link
Member

greg0ire commented Apr 9, 2019

@Ocramius https://confluence.jetbrains.com/display/PhpStorm/PhpStorm+Advanced+Metadata

By using example metadata below It can reside anywhere, but we recommend using .phpstorm.meta.php file in project root.

@Ocramius
Copy link
Member

Ocramius commented Apr 9, 2019

And only one of these, or multiple ones?

@greg0ire
Copy link
Member

greg0ire commented Apr 9, 2019

From the same page:

2016.2 + -> you can have multiple separate files in FOLDER named .phpstorm.meta.php

So you can have several files, but they probably will have to be in the same directory.

@mabar
Copy link

mabar commented Jun 17, 2019

@Ocramius .phpstorm.meta.php files in vendor work. I tested it with nette/utils and got correct typehints.

@Ocramius
Copy link
Member

I'd like to respawn this: I've successfully integrated this in sebastianbergmann/phpunit#3708, and it is a net gain for all downstream consumers, with no negative impact (as far as I know).

What I'd rather say is that we should keep it minimal: less constants, only cover (very) commonly used API, remove enums. The important bits are certainly getRepository, find and so on.

@Ocramius Ocramius added this to the 3.0 milestone Aug 24, 2019
Base automatically changed from master to old-prototype-3.x February 23, 2021 08:19
@derrabus
Copy link
Member

We're doing some housekeeping on the 3.0.0 milestone. Since nobody seems to be actively working on this topic I'm removing this PR from the 3.0.0 milestone. I you want to pick up the work, please target the ORM's next feature release (currently 2.13.0) instead.

@derrabus derrabus removed this from the 3.0.0 milestone May 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants