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

Replaceget_class() calls by::class#21016

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
javiereguiluz merged 1 commit intosymfony:6.4fromalamirault:feature/sf-47401
May 29, 2025
Merged
Show file tree
Hide file tree
Changes fromall 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 deletioncomponents/options_resolver.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -922,7 +922,7 @@ can change your code to do the configuration only once per class::
public function __construct(array $options = [])
{
// What type of Mailer is this, a Mailer, a GoogleMailer, ... ?
$class =get_class($this);
$class = $this::class;

// Was configureOptions() executed before for this class?
if (!isset(self::$resolversByClass[$class])) {
Expand Down
2 changes: 1 addition & 1 deletioncomponents/property_info.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -131,7 +131,7 @@ class exposes public methods to extract several types of information:
$propertyInfo->getProperties($awesomeObject);

// Good!
$propertyInfo->getProperties(get_class($awesomeObject));
$propertyInfo->getProperties($awesomeObject::class);
$propertyInfo->getProperties('Example\Namespace\YourAwesomeClass');
$propertyInfo->getProperties(YourAwesomeClass::class);

Expand Down
2 changes: 1 addition & 1 deletioncomponents/yaml.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -296,7 +296,7 @@ You can make it convert to a ``DateTime`` instance by using the ``PARSE_DATETIME
flag::

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

Dumping Multi-line Literal Blocks
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down
2 changes: 1 addition & 1 deletionconsole/verbosity.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -60,7 +60,7 @@ level. For example::

// available methods: ->isQuiet(), ->isVerbose(), ->isVeryVerbose(), ->isDebug()
if ($output->isVerbose()) {
$output->writeln('User class: '.get_class($user));
$output->writeln('User class: '.$user::class);
}

// alternatively you can pass the verbosity level PHP constant to writeln()
Expand Down
2 changes: 1 addition & 1 deletiondoctrine/associations.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -447,7 +447,7 @@ by adding JOINs.
$category = $product->getCategory();

// prints "Proxies\AppEntityCategoryProxy"
dump(get_class($category));
dump($category::class);
die();

This proxy object extends the true ``Category`` object, and looks and
Expand Down
2 changes: 1 addition & 1 deletionsecurity/user_providers.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -425,7 +425,7 @@ command will generate a nice skeleton to get you started::
public function refreshUser(UserInterface $user): UserInterface
{
if (!$user instanceof User) {
throw new UnsupportedUserException(sprintf('Invalid user class "%s".',get_class($user)));
throw new UnsupportedUserException(sprintf('Invalid user class "%s".', $user::class));
}

// Return a User object after making sure its data is "fresh".
Expand Down
6 changes: 3 additions & 3 deletionsservice_container/service_subscribers_locators.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -36,7 +36,7 @@ to handle their respective command when it is asked for::

public function handle(Command $command): mixed
{
$commandClass =get_class($command);
$commandClass = $command::class;

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

public function handle(Command $command): mixed
{
$commandClass =get_class($command);
$commandClass = $command::class;

if ($this->locator->has($commandClass)) {
$handler = $this->locator->get($commandClass);
Expand DownExpand Up@@ -328,7 +328,7 @@ attribute::

public function handle(Command $command): mixed
{
$commandClass =get_class($command);
$commandClass = $command::class;

if ($this->handlers->has($commandClass)) {
$handler = $this->handlers->get($commandClass);
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp