Skip to content

Use the shorthand notation when applicable #9339

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
wants to merge 2 commits into from

Conversation

greg0ire
Copy link
Contributor

It's part of the standard

Copy link
Member

@javiereguiluz javiereguiluz left a comment

Choose a reason for hiding this comment

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

@greg0ire thanks for taking care of this. I'm sorry for the amount of review comments (35!) but I wanted to mark all the places where we can get rid of ::.

By the way, I'm not sure I like replacing .. code-block:: php by :: when there's no previous line of text. The problem with :: is that it looks strange and it's not easy to understand, whereas .. code-block:: php is beautiful and self-explanatory. Ping @xabbuh what do you think?

@@ -24,7 +24,7 @@ Usage

A lock can be used, for example, to allow only one instance of a command to run.

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

Choose a reason for hiding this comment

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

Can we move this to the end of the previous line? Thanks!

Copy link
Member

Choose a reason for hiding this comment

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

While reading this comment there is at least one important difference to point out that we did not discuss on Slack: The colon of the short-hand notation will be rendered in the final document. So we need to check too if that really makes sense with each example.

@@ -70,7 +70,7 @@ which returns an array of expression functions (instances of
:class:`Symfony\\Component\\ExpressionLanguage\\ExpressionFunction`) to
register.

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

Choose a reason for hiding this comment

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

Let's move this to the end of the previous line.

@@ -312,7 +312,7 @@ Process Pid
You can access the `pid`_ of a running process with the
:method:`Symfony\\Component\\Process\\Process::getPid` method.

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

Choose a reason for hiding this comment

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

Merge with the previous line, please.

@@ -190,7 +190,7 @@ choose which one to use for the template, the
:method:`EngineInterface::supports() <Symfony\\Component\\Templating\\EngineInterface::supports>`
method is used.

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

Choose a reason for hiding this comment

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

Merge with previous line, please.

@@ -31,7 +31,7 @@ Configuration

The constructor of the ``Translator`` class needs one argument: The locale.

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

Choose a reason for hiding this comment

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

Merge with previous line, please.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This one will look a bit weird I think

@@ -585,7 +585,7 @@ contain a ``lifetime`` key, set to 5 minutes (300 seconds) unless otherwise
set in the configuration. Pass this argument to your authentication provider
in order to put it to use.

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

Choose a reason for hiding this comment

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

Merge with previous line, please.

@@ -236,7 +236,7 @@ the sticky locale:

The listener implementation assumes your ``User`` entity has a ``getLocale()`` method.

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

Choose a reason for hiding this comment

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

Merge with previous line, please.

@@ -238,7 +238,7 @@ in the controller could be secured using the service context.
In the following example, the action is only allowed if the user has the
``IS_AUTHENTICATED_FULLY`` role.

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

Choose a reason for hiding this comment

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

Merge with previous line, please.

@@ -38,7 +38,7 @@ A custom voter needs to implement
or extend :class:`Symfony\\Component\\Security\\Core\\Authorization\\Voter\\AbstractVoter`,
which makes creating a voter even easier.

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

Choose a reason for hiding this comment

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

Merge with previous line, please.

@@ -129,7 +129,7 @@ locale value before they are redirected to their first page.
To do this, you need an event listener for the ``security.interactive_login``
event:

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

Choose a reason for hiding this comment

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

Merge with previous line, please.

@xabbuh xabbuh added this to the 2.7 milestone Feb 26, 2018

Unverified

No user is associated with the committer email.
It's part of the standard
The constructor of the ``Translator`` class needs one argument: The locale.

.. code-block:: php
The constructor of the ``Translator`` class needs one argument: The locale::
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@javiereguiluz @xabbuh that one will look a bit weird, won't it?

Copy link
Member

Choose a reason for hiding this comment

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

I would stick with the explicit code block here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The problem with :: is that it looks strange and it's not easy to understand, whereas .. code-block:: php is beautiful and self-explanatory. Ping @xabbuh what do you think?

I would stick with the explicit code block here

I'll extrapolate and take this as an agreement with @javiereguiluz 's feelings about :: at the beginning of a line.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But that probably means I should amend the standard.

Verified

This commit was signed with the committer’s verified signature.
greg0ire Grégoire Paris
@javiereguiluz
Copy link
Member

@greg0ire please, tell me when you consider this ready for merge. Thanks!

@greg0ire
Copy link
Contributor Author

greg0ire commented Feb 28, 2018

I believe it's ready, but warning, I amended the standard

code block (read `the Sphinx documentation`_ to see when you should use the
shorthand);
code block unless it results in the marker being on its own line (read
`the Sphinx documentation`_ to see when you should use the shorthand);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@javiereguiluz here is the part I amended, please tell me what you think

Copy link
Member

Choose a reason for hiding this comment

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

Looks good to me!

@javiereguiluz
Copy link
Member

Let's merge this PR too ... and let's wish there are not too many conflicts. Thanks for working on this @greg0ire.

javiereguiluz added a commit that referenced this pull request Mar 1, 2018
This PR was squashed before being merged into the 2.7 branch (closes #9339).

Discussion
----------

Use the shorthand notation when applicable

It's part of the standard

Commits
-------

d8faa39 Use the shorthand notation when applicable
@javiereguiluz
Copy link
Member

This has been merged up to master branch. As said in other PR, if you want to do this for the other branches, you should do it in 2.8, wait for merge, then 3.4 and wait for merge, then 4.0 and wait for merge and finally, master and wait for merger. Thanks!

@greg0ire greg0ire deleted the shorthand branch March 1, 2018 17:16
@@ -124,7 +124,7 @@ You can now reference these parameters wherever you need them.

</container>

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

Choose a reason for hiding this comment

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

This change is wrong as this is part of a configuration-block block. Reverted in #9368.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Woops, sorry for this!

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

5 participants