Skip to content

[WIP] Fix code-blocks-checker #16868

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 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion components/filesystem.rst
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ systems (unlike PHP's :phpfunction:`readlink` function)::

Its behavior is the following::

public function readlink($path, $canonicalize = false)
public function readlink($path, $canonicalize = false) { ... }

* When ``$canonicalize`` is ``false``:
* if ``$path`` does not exist or is not a link, it returns ``null``.
Expand Down
1 change: 1 addition & 0 deletions components/serializer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1122,6 +1122,7 @@ to ``true``::
$result = $normalizer->normalize($dummy, 'json', [AbstractObjectNormalizer::SKIP_NULL_VALUES => true]);
// ['bar' => 'notNull']


.. _component-serializer-handling-circular-references:

Handling Circular References
Expand Down
12 changes: 6 additions & 6 deletions create_framework/http_kernel_controller_resolver.rst
Original file line number Diff line number Diff line change
Expand Up @@ -103,29 +103,29 @@ The ``index()`` method needs the Request object as an argument.
``getArguments()`` knows when to inject it properly if it is type-hinted
correctly::

public function index(Request $request)
public function index(Request $request) { ... }
Copy link
Contributor

Choose a reason for hiding this comment

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

Imho it is too verbose just to make the code checker happy. What about allowing it somehow as is?

Copy link
Member

Choose a reason for hiding this comment

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

I agree. In the past (when this tool was introduced), we also decided that it's not the goal of documentation examples to be 100% syntax correct. Their goal is to explain the PHP API and do as good of a job as possible on not distracting the user with irrelevant details.

I'm -1 for these additions.


// won't work
public function index($request)
public function index($request) { ... }

More interesting, ``getArguments()`` is also able to inject any Request
attribute; if the argument has the same name as the corresponding
attribute::

public function index($year)
public function index($year) { ... }

You can also inject the Request and some attributes at the same time (as the
matching is done on the argument name or a type hint, the arguments order does
not matter)::

public function index(Request $request, $year)
public function index(Request $request, $year) { ... }

public function index($year, Request $request)
public function index($year, Request $request) { ... }

Finally, you can also define default values for any argument that matches an
optional attribute of the Request::

public function index($year = 2012)
public function index($year = 2012) { ... }

Let's inject the ``$year`` request attribute for our controller::

Expand Down
2 changes: 1 addition & 1 deletion reference/forms/types/file.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ be used to move the ``attachment`` file to a permanent location::
// ...

if ($form->isSubmitted() && $form->isValid()) {
$someNewFilename = ...
$someNewFilename = ...;

$file = $form['attachment']->getData();
$file->move($directory, $someNewFilename);
Expand Down