Skip to content

Commit 2e11d05

Browse files
Removed some occurrences of explicitly talking about "PHP 8 attributes"
1 parent 8eeba23 commit 2e11d05

File tree

4 files changed

+9
-14
lines changed

4 files changed

+9
-14
lines changed

console.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,8 +208,7 @@ available in the ``configure()`` method::
208208
Registering the Command
209209
~~~~~~~~~~~~~~~~~~~~~~~
210210

211-
In PHP 8 and newer versions, you can register the command by adding the
212-
``AsCommand`` attribute to it::
211+
You can register the command by adding the ``AsCommand`` attribute to it::
213212

214213
// src/Command/CreateUserCommand.php
215214
namespace App\Command;

service_container.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,8 +238,8 @@ each time you ask for it.
238238
Limiting Services to a specific Symfony Environment
239239
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
240240

241-
If you are using PHP 8.0 or later, you can use the ``#[When]`` PHP
242-
attribute to only register the class as a service in some environments::
241+
You can use the ``#[When]`` attribute to only register the class
242+
as a service in some environments::
243243

244244
use Symfony\Component\DependencyInjection\Attribute\When;
245245

service_container/calls.rst

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -145,20 +145,16 @@ The configuration to tell the container it should do so would be like:
145145
If autowire is enabled, you can also use attributes; with the previous
146146
example it would be::
147147

148-
/**
149-
* @return static
150-
*/
151148
#[Required]
152-
public function withLogger(LoggerInterface $logger)
149+
public function withLogger(LoggerInterface $logger): static
153150
{
154151
$new = clone $this;
155152
$new->logger = $logger;
156153

157154
return $new;
158155
}
159156

160-
You can also leverage the PHP 8 ``static`` return type instead of the
161-
``@return static`` annotation. If you don't want a method with a
162-
PHP 8 ``static`` return type and a ``#[Required]`` attribute to behave as
163-
a wither, you can add a ``@return $this`` annotation to disable the
164-
*returns clone* feature.
157+
If you don't want a method with a ``static`` return type and
158+
a ``#[Required]`` attribute to behave as a wither, you can
159+
add a ``@return $this`` annotation to disable the *returns clone*
160+
feature.

service_container/tags.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ In a Symfony bundle, call this method in the ``load()`` method of the
168168
}
169169

170170
Autoconfiguration registering is not limited to interfaces. It is possible
171-
to use PHP 8 attributes to autoconfigure services by using the
171+
to use PHP attributes to autoconfigure services by using the
172172
:method:`Symfony\\Component\\DependencyInjection\\ContainerBuilder::registerAttributeForAutoconfiguration`
173173
method::
174174

0 commit comments

Comments
 (0)