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

Fix redundant type casts#44330

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

Conversation

@fancyweb
Copy link
Contributor

QA
Branch?5.3
Bug fix?no
New feature?no
Deprecations?no
Tickets-
LicenseMIT
Doc PR-

Continuation of#44274 on 5.3

publicstaticfunctioncreateChoiceName(object$choice,$key,string$value):string
{
returnstr_replace('-','_',(string)$value);
returnstr_replace('-','_',$value);
Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

string $value in args

thrownew \InvalidArgumentException(sprintf('Unsupported verbosity group "%s", expected one of "%s".',$group,implode('", "',array_keys($this->verboseOutput))));
}
$this->verboseOutput[$group] =(bool)$status;
$this->verboseOutput[$group] =$status;
Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

@param bool[] $verboseOutput in the doc + the constructor is private and only called with a$verboseOutput infromUrlEncodedString() andinWeakMode() and we always set valid booleans values.

protectedfunctionrenderForm(FormView$view,array$vars = []):string
{
return(string)$this->renderer->renderBlock($view,'form',$vars);
return$this->renderer->renderBlock($view,'form',$vars);
Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

FormRendererInterface::renderBlock() returns a string

}

$this->hidden =(bool)$hidden;
$this->hidden =$hidden;
Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

bool $hidden in args

publicfunctionsetHiddenFallback(bool$fallback)
{
$this->hiddenFallback =(bool)$fallback;
$this->hiddenFallback =$fallback;
Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

bool $fallback in args


// Per RFC 4514, leading/trailing spaces should be encoded in DNs, as well as carriage returns.
if ((int)$flags & \LDAP_ESCAPE_DN) {
if ($flags & \LDAP_ESCAPE_DN) {
Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

int $flags = 0 in args

protectedfunctionassertValidLocale(string$locale)
{
if (!preg_match('/^[a-z0-9@_\\.\\-]*$/i',(string)$locale)) {
if (!preg_match('/^[a-z0-9@_\\.\\-]*$/i',$locale)) {
Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

string $locale in args

{
if (str_contains($name,'\\') &&class_exists($name)) {
$className =(string)$name;
$className =$name;
Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

string $name in args

{
$data =clone$this;
$data->maxDepth =(int)$maxDepth;
$data->maxDepth =$maxDepth;
Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

int $maxDepth in args

{
$data =clone$this;
$data->maxItemsPerDepth =(int)$maxItemsPerDepth;
$data->maxItemsPerDepth =$maxItemsPerDepth;
Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

int $maxItemsPerDepth in args

@nicolas-grekas
Copy link
Member

Thank you@fancyweb.

@nicolas-grekasnicolas-grekas merged commitbedd09f intosymfony:5.3Nov 29, 2021
@fancywebfancyweb deleted the minor/type-cast-redundancy-53 branchNovember 29, 2021 15:27
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@chalasrchalasrchalasr approved these changes

@xabbuhxabbuhAwaiting requested review from xabbuhxabbuh is a code owner

@ycerutoycerutoAwaiting requested review from ycerutoyceruto is a code owner

Assignees

No one assigned

Projects

None yet

Milestone

5.3

Development

Successfully merging this pull request may close these issues.

4 participants

@fancyweb@nicolas-grekas@chalasr@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp