Skip to content

Commit f7b2624

Browse files
committed
minor #17614 Update confusing first class callable syntax (alamirault)
This PR was merged into the 5.4 branch. Discussion ---------- Update confusing first class callable syntax #16685 I replaced by `'...'` when arg is only one string, else `/* ... */` I found these case with `->[a-zA-Z]+\(\.` regex Commits ------- 608618e Update confusing first class callable syntax
2 parents 97486b7 + 608618e commit f7b2624

File tree

8 files changed

+12
-12
lines changed

8 files changed

+12
-12
lines changed

components/validator.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ If you have lots of validation errors, you can filter them by error code::
5757

5858
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
5959

60-
$violations = $validator->validate(...);
60+
$violations = $validator->validate(/* ... */);
6161
if (0 !== count($violations->findByCodes(UniqueEntity::NOT_UNIQUE_ERROR))) {
6262
// handle this specific error (display some message, send an email, etc.)
6363
}

controller.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ special type of exception::
340340
// throw new NotFoundHttpException('The product does not exist');
341341
}
342342

343-
return $this->render(...);
343+
return $this->render(/* ... */);
344344
}
345345

346346
The :method:`Symfony\\Bundle\\FrameworkBundle\\Controller\\AbstractController::createNotFoundException`
@@ -461,10 +461,10 @@ For example, imagine you're processing a :doc:`form </forms>` submission::
461461
);
462462
// $this->addFlash() is equivalent to $request->getSession()->getFlashBag()->add()
463463

464-
return $this->redirectToRoute(...);
464+
return $this->redirectToRoute(/* ... */);
465465
}
466466

467-
return $this->render(...);
467+
return $this->render(/* ... */);
468468
}
469469

470470
After processing the request, the controller sets a flash message in the session

form/data_transformers.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ slightly::
112112
$builder->add(
113113
$builder
114114
->create('tags', TextType::class)
115-
->addModelTransformer(...)
115+
->addModelTransformer(/* ... */)
116116
);
117117

118118
Example #2: Transforming an Issue Number into an Issue Entity

form/validation_groups.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ this as an option when :ref:`creating forms in controllers <creating-forms-in-co
1313

1414
$form = $this->createFormBuilder($user, [
1515
'validation_groups' => ['registration'],
16-
])->add(...);
16+
])->add(/* ... */);
1717

1818
When :ref:`creating forms in classes <creating-forms-in-classes>`, add the
1919
following to the ``configureOptions()`` method::

http_client.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1257,7 +1257,7 @@ that network errors can happen when calling e.g. ``getStatusCode()`` too::
12571257
// ...
12581258
try {
12591259
// both lines can potentially throw
1260-
$response = $client->request(...);
1260+
$response = $client->request(/* ... */);
12611261
$headers = $response->getHeaders();
12621262
// ...
12631263
} catch (TransportExceptionInterface $e) {

logging/monolog_exclude_http_codes.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ logging these HTTP codes based on the MonologBundle configuration:
5555
$mainHandler = $monolog->handler('main')
5656
// ...
5757
->type('fingers_crossed')
58-
->handler(...)
58+
->handler('...')
5959
;
6060
6161
$mainHandler->excludedHttpCode()->code(403);

messenger.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1917,7 +1917,7 @@ this globally (or for each transport) to a service that implements
19171917
->context('foo', 'bar');
19181918
19191919
$messenger->transport('async_priority_normal')
1920-
->dsn(...)
1920+
->dsn('...')
19211921
->serializer('messenger.transport.symfony_serializer');
19221922
};
19231923
@@ -2180,8 +2180,8 @@ Then, make sure to "route" your message to *both* transports:
21802180
return static function (FrameworkConfig $framework) {
21812181
$messenger = $framework->messenger();
21822182
2183-
$messenger->transport('async_priority_normal')->dsn(...);
2184-
$messenger->transport('image_transport')->dsn(...);
2183+
$messenger->transport('async_priority_normal')->dsn('...');
2184+
$messenger->transport('image_transport')->dsn('...');
21852185
21862186
$messenger->routing('App\Message\UploadedImage')
21872187
->senders(['image_transport', 'async_priority_normal']);

testing.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ the container is returned by ``static::getContainer()``::
267267

268268
// (3) run some service & test the result
269269
$newsletterGenerator = $container->get(NewsletterGenerator::class);
270-
$newsletter = $newsletterGenerator->generateMonthlyNews(...);
270+
$newsletter = $newsletterGenerator->generateMonthlyNews(/* ... */);
271271

272272
$this->assertEquals('...', $newsletter->getContent());
273273
}

0 commit comments

Comments
 (0)