Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit45ee853

Browse files
committed
Merge branch '6.4' into 7.2
* 6.4: Replace get_class() calls by ::class
2 parents5a102c8 +3d83f8d commit45ee853

File tree

7 files changed

+9
-9
lines changed

7 files changed

+9
-9
lines changed

‎components/options_resolver.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -918,7 +918,7 @@ can change your code to do the configuration only once per class::
918918
public function __construct(array $options = [])
919919
{
920920
// What type of Mailer is this, a Mailer, a GoogleMailer, ... ?
921-
$class =get_class($this);
921+
$class = $this::class;
922922

923923
// Was configureOptions() executed before for this class?
924924
if (!isset(self::$resolversByClass[$class])) {

‎components/property_info.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ class exposes public methods to extract several types of information:
131131
$propertyInfo->getProperties($awesomeObject);
132132

133133
// Good!
134-
$propertyInfo->getProperties(get_class($awesomeObject));
134+
$propertyInfo->getProperties($awesomeObject::class);
135135
$propertyInfo->getProperties('Example\Namespace\YourAwesomeClass');
136136
$propertyInfo->getProperties(YourAwesomeClass::class);
137137

‎components/yaml.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ You can make it convert to a ``DateTime`` instance by using the ``PARSE_DATETIME
298298
flag::
299299

300300
$date = Yaml::parse('2016-05-27', Yaml::PARSE_DATETIME);
301-
var_dump(get_class($date)); // DateTime
301+
var_dump($date::class); // DateTime
302302

303303
Dumping Multi-line Literal Blocks
304304
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

‎console/verbosity.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ level. For example::
6868

6969
// available methods: ->isSilent(), ->isQuiet(), ->isVerbose(), ->isVeryVerbose(), ->isDebug()
7070
if ($output->isVerbose()) {
71-
$output->writeln('User class: '.get_class($user));
71+
$output->writeln('User class: '.$user::class);
7272
}
7373

7474
// alternatively you can pass the verbosity level PHP constant to writeln()

‎doctrine/associations.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@ by adding JOINs.
447447
$category = $product->getCategory();
448448

449449
// prints "Proxies\AppEntityCategoryProxy"
450-
dump(get_class($category));
450+
dump($category::class);
451451
die();
452452

453453
This proxy object extends the true ``Category`` object, and looks and

‎security/user_providers.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ command will generate a nice skeleton to get you started::
425425
public function refreshUser(UserInterface $user): UserInterface
426426
{
427427
if (!$user instanceof User) {
428-
throw new UnsupportedUserException(sprintf('Invalid user class "%s".',get_class($user)));
428+
throw new UnsupportedUserException(sprintf('Invalid user class "%s".', $user::class));
429429
}
430430

431431
// Return a User object after making sure its data is "fresh".

‎service_container/service_subscribers_locators.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ to handle their respective command when it is asked for::
3636

3737
public function handle(Command $command): mixed
3838
{
39-
$commandClass =get_class($command);
39+
$commandClass = $command::class;
4040

4141
if (!$handler = $this->handlerMap[$commandClass] ?? null) {
4242
return;
@@ -94,7 +94,7 @@ in the service subscriber::
9494

9595
public function handle(Command $command): mixed
9696
{
97-
$commandClass =get_class($command);
97+
$commandClass = $command::class;
9898

9999
if ($this->locator->has($commandClass)) {
100100
$handler = $this->locator->get($commandClass);
@@ -350,7 +350,7 @@ attribute::
350350

351351
public function handle(Command $command): mixed
352352
{
353-
$commandClass =get_class($command);
353+
$commandClass = $command::class;
354354

355355
if ($this->handlers->has($commandClass)) {
356356
$handler = $this->handlers->get($commandClass);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp