You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: contributing/code/bc.rst
+18-18Lines changed: 18 additions & 18 deletions
Original file line number
Diff line number
Diff line change
@@ -495,21 +495,21 @@ If that's the case, here is how to do it properly in a minor version:
495
495
496
496
#. Add the argument as a comment in the signature::
497
497
498
-
// the new argument can be optional
499
-
public function say(string $text, /* bool $stripWithespace = true */): void
500
-
{
501
-
}
498
+
// the new argument can be optional
499
+
public function say(string $text, /* bool $stripWithespace = true */): void
500
+
{
501
+
}
502
502
503
-
// or required
504
-
public function say(string $text, /* bool $stripWithespace */): void
505
-
{
506
-
}
503
+
// or required
504
+
public function say(string $text, /* bool $stripWithespace */): void
505
+
{
506
+
}
507
507
508
508
#. Document the new argument in a PHPDoc::
509
509
510
-
/**
511
-
* @param bool $stripWithespace
512
-
*/
510
+
/**
511
+
* @param bool $stripWithespace
512
+
*/
513
513
514
514
#. Use ``func_num_args`` and ``func_get_arg`` to retrieve the argument in the
515
515
method::
@@ -521,18 +521,18 @@ If that's the case, here is how to do it properly in a minor version:
521
521
#. If the argument has a default value that will change the current behavior,
522
522
warn the user::
523
523
524
-
trigger_deprecation('symfony/COMPONENT', 'X.Y', 'Not passing the "bool $stripWithespace" argument explicitly is deprecated, its default value will change to X in Z.0.');
524
+
trigger_deprecation('symfony/COMPONENT', 'X.Y', 'Not passing the "bool $stripWithespace" argument explicitly is deprecated, its default value will change to X in Z.0.');
525
525
526
526
#. If the argument has no default value, warn the user that is going to be
527
527
required in the next major version::
528
528
529
-
if (\func_num_args() < 2) {
530
-
trigger_deprecation('symfony/COMPONENT', 'X.Y', 'The "%s()" method will have a new "bool $stripWithespace" argument in version Z.0, not defining it is deprecated.', __METHOD__);
529
+
if (\func_num_args() < 2) {
530
+
trigger_deprecation('symfony/COMPONENT', 'X.Y', 'The "%s()" method will have a new "bool $stripWithespace" argument in version Z.0, not defining it is deprecated.', __METHOD__);
531
531
532
-
$stripWithespace = false;
533
-
} else {
534
-
$stripWithespace = func_get_arg(1);
535
-
}
532
+
$stripWithespace = false;
533
+
} else {
534
+
$stripWithespace = func_get_arg(1);
535
+
}
536
536
537
537
#. In the next major version (``X.0``), uncomment the argument, remove the
538
538
PHPDoc if there is no need for a description, and remove the
0 commit comments