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

Updated docs added missing use statements #194

Merged
merged 3 commits into from
Jul 9, 2014

Conversation

Miliooo
Copy link
Contributor

@Miliooo Miliooo commented Oct 28, 2013

There are some use statements missing for the @ var

@merk
Copy link
Member

merk commented Oct 28, 2013

These use statements arent actually used. Can you change the phpdoc to point to the full class name instead?

@Miliooo
Copy link
Contributor Author

Miliooo commented Oct 28, 2013

well it's true that it will work without those (meaning it's only a fix for the phpdoc) so it's not like it's really important but then the phpdoc is wrong

I could use the full class name in the phpdoc but that's against the symfony coding standards...

@merk
Copy link
Member

merk commented Oct 28, 2013

The coding standards documentation does not talk about this, and it doesnt make sense to import a php class just for use in a phpdoc comment.

@Miliooo
Copy link
Contributor Author

Miliooo commented Oct 28, 2013

Well I'm sure @stof can comment on that. True it's not on the documentation, but I'm quite sure I've seen remarks about using full namespaces in params and returns (well here it's a var). If @stof says full namespaces are fine I'll update this pull request with that solution.

@merk
Copy link
Member

merk commented Oct 28, 2013

This issue doesnt need Stof's blessing, its rather simple - example documentation for entities is not very important and I'm not happy to import classes for use in phpdoc.

@Miliooo
Copy link
Contributor Author

Miliooo commented Oct 29, 2013

Well most people copy paste that example.

But I agree. I didn't expect this discussion either. It already took me longer then I thought to pull request this. (having to triple check things). But I would still like to hear his answer if he reads this. Not to prove anyone wrong (because it is not written in the docs so you are right about that) but just to know if there is a guideline for that. Because I thought there was.

I'll update this request in the coming days and then you can merge this. Or just close it if you see it as a non issue.

@@ -32,6 +32,9 @@ namespace Acme\MessageBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;
use FOS\MessageBundle\Entity\Message as BaseMessage;
use FOS\MessageBundle\Model\ThreadInterface;
use FOS\MessageBundle\Entity\MessageMetadata;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe unneeded if class is created in same namespace then it would reference the class the user has created

@Miliooo
Copy link
Contributor Author

Miliooo commented Nov 5, 2013

Ok I finally wanted to fix it the way you proposed. But then I saw
https://github.com/FriendsOfSymfony/FOSMessageBundle/blob/master/Resources/doc/01a-orm-models.md#messagemetadata-class

There the use statements also get used only for the vars. So you want me to remove those then? I don't see anything wrong with adding use statements for interfaces.

There can be problems with it for classes though Miliooo@26499ef caused doctrine problems 👎. (guess I learned something from this pull request :octocat: )

@merk
Copy link
Member

merk commented Nov 5, 2013

Any imported class purely for phpdoc reasons should be removed and replaced with a full class name.

zocimek added a commit that referenced this pull request Jul 9, 2014
Updated docs added missing use statements
@zocimek zocimek merged commit cab9c3d into FriendsOfSymfony:master Jul 9, 2014
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