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

Adding PHP attributes #9555

Merged
merged 14 commits into from
Mar 8, 2022
Merged

Adding PHP attributes #9555

merged 14 commits into from
Mar 8, 2022

Conversation

ThomasLandauer
Copy link
Contributor

@greg0ire This is the first (small) step towards documenting enums - see #9304 (comment)
I started reading the page from the top, and did some minor changes.
Biggest change: If you agree, I'd continue adding php attributes to all code blocks, and always mention it as first choice.

@derrabus
Copy link
Member

derrabus commented Mar 2, 2022

Biggest change: If you agree, I'd continue adding php attributes to all code blocks, and always mention it as first choice.

I agree. We should be consistent about the order of the code examples and attributes should be the preferred choice nowadays.

Looking at the code example you've updated, I also noticed that the annotation example (and consequently your new attribute example) don't import the Entity annotation via a use statement. Since the examples start with an opening <?php tag, the reader might get the impression that the use statement is not necessary. I think we should add the necessary imports.

@ThomasLandauer
Copy link
Contributor Author

@SenseException In Symfony docs there is a shorcut versionadded (or similar) for a uniform info box "XY was added in version x.y". There's nothing similar here in Doctrine, is it?

@ThomasLandauer
Copy link
Contributor Author

@derrabus: OK, done :-)

Question about https://github.com/doctrine/orm/pull/9555/files#diff-239d9a128ce24a76e204d8b9821ce009ef5c7b16298d549165da9bc05d5d8f97R246
Can I link to a separate page this way, or do I have to create an anchor there and then use this syntax?:

:doc:`Docblock Annotations <annotations-reference>`

@ThomasLandauer
Copy link
Contributor Author

I'm done for the moment; please merge this, so I can see how it comes out. Then I'll continue.

@greg0ire
Copy link
Member

greg0ire commented Mar 2, 2022

Please refrain from mentioning people in commit, it results in them receiving a notification every time that commit is cherry-picked here or there 🙏

stored in the metadata cache. If you're not using a metadata cache (not
recommended!) then the XML driver is the fastest.

Marking our ``Message`` class as an entity for Doctrine is straightforward:

.. configuration-block::

.. code-block:: php
.. code-block:: attribute
Copy link
Member

Choose a reason for hiding this comment

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

As I commented on your commit where you mentioned me, isn't this going to break syntactic coloration?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, it's the same as I was using at https://www.doctrine-project.org/projects/doctrine-orm/en/2.11/reference/events.html#lifecycle-callbacks

Sorry about the mentioning! Somebody already told me that before - I hope I'll remember next time...

Copy link
Member

Choose a reason for hiding this comment

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

No worries, please reword that commit to make it go away.

How to do that?

  1. git rebase -i origin/2.11.x, assuming origin is a git remote that points to this repository, and not your fork. If you're not sure what your remotes are, run git remote -vvv, there should be your fork and the holy/reference/base/origin/whatever-you-call-it repository.
  2. A window will show up with many lines, replace pick with reword on the line corresponding to your commit
  3. Close your editor, git should do its magic, and let you amend the commit message
  4. Use git push --force to overwrite what you already push. Don't forget the --force option otherwise git will try to merge both things together.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, my "Git instructor"! :-) It looks like I succeeded.

Copy link
Member

Choose a reason for hiding this comment

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

Indeed, great job! My inbox thanks you!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So this is resolved? Could you please merge it then?

ThomasLandauer and others added 11 commits March 3, 2022 12:58
This is the first (small) step towards documenting enums - see doctrine#9304 (comment)
I started reading the page from the top, and did some minor changes.
Biggest change: If you agree, I'd continue adding php attributes to all code blocks.
Co-authored-by: Alexander M. Turek <me@derrabus.de>
Co-authored-by: Alexander M. Turek <me@derrabus.de>
Co-authored-by: Alexander M. Turek <me@derrabus.de>
Co-authored-by: Alexander M. Turek <me@derrabus.de>
@SenseException
Copy link
Member

@ThomasLandauer
Copy link
Contributor Author

@SenseException Thanks, I now used it here too :-)

docs/en/reference/basic-mapping.rst Show resolved Hide resolved
docs/en/reference/basic-mapping.rst Outdated Show resolved Hide resolved
ThomasLandauer and others added 2 commits March 6, 2022 21:35
Co-authored-by: Claudio Zizza <859964+SenseException@users.noreply.github.com>
Co-authored-by: Claudio Zizza <859964+SenseException@users.noreply.github.com>
@derrabus derrabus added this to the 2.11.2 milestone Mar 8, 2022
@derrabus derrabus merged commit eb1d548 into doctrine:2.11.x Mar 8, 2022
@ThomasLandauer ThomasLandauer deleted the patch-5 branch March 8, 2022 10:23
derrabus added a commit that referenced this pull request Mar 9, 2022
* 2.11.x:
  Make sure MemcachedAdapter is supported before tring to use it (#9574)
  Fixing `:doc:` link (#9569)
  Adding PHP attributes (#9555)
  Remove reference to removed class
derrabus added a commit that referenced this pull request Mar 9, 2022
* 2.11.x:
  Make sure MemcachedAdapter is supported before tring to use it (#9574)
  Fixing `:doc:` link (#9569)
  Adding PHP attributes (#9555)
  Remove reference to removed class
derrabus added a commit that referenced this pull request Mar 9, 2022
* 2.11.x:
  Baseline Psalm errors caused by DBAL 3.3.3 (#9577)
  Make sure MemcachedAdapter is supported before tring to use it (#9574)
  Fixing `:doc:` link (#9569)
  Adding PHP attributes (#9555)
  Remove reference to removed class
derrabus added a commit to derrabus/orm that referenced this pull request Mar 10, 2022
* 2.12.x:
  Leverage MemcachedAdapter::isSupported() (doctrine#9578)
  Baseline Psalm errors caused by DBAL 3.3.3 (doctrine#9577)
  Make sure MemcachedAdapter is supported before tring to use it (doctrine#9574)
  Fixing `:doc:` link (doctrine#9569)
  Adding PHP attributes (doctrine#9555)
  Remove reference to removed class
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

4 participants