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 ctype_digit deprecation#42074

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
nicolas-grekas merged 1 commit intosymfony:4.4fromalexpott:php8.1-ctype-digit
Jul 13, 2021

Conversation

@alexpott
Copy link
Contributor

QA
Branch?4.4
Bug fix?yes
New feature?no
Deprecations?no
TicketsFix #...
LicenseMIT
Doc PRsymfony/symfony-docs#...

Running the Yaml unit tests on PHP 8.1 built: Jul 12 2021 00:22:13 results in the following PHP Notices:

Testing /Users/alex/dev/symfony/src/Symfony/Component/Yaml/Tests...............................................................  63 / 689 (  9%)............................................................... 126 / 689 ( 18%)............................................................... 189 / 689 ( 27%)............................................................... 252 / 689 ( 36%)............................................................... 315 / 689 ( 45%)............................................................... 378 / 689 ( 54%)............................................................... 441 / 689 ( 64%)............................................................... 504 / 689 ( 73%)............................................................... 567 / 689 ( 82%)............................................................... 630 / 689 ( 91%)...........................................................     689 / 689 (100%)Time: 00:00.336, Memory: 20.00 MBOK (689 tests, 984 assertions)Unsilenced deprecation notices (131)  109x: ctype_digit(): Argument of type int will be interpreted as string in the future    53x in DumperTest::testSpecifications from Symfony\Component\Yaml\Tests    21x in DumperTest::testInlineLevel from Symfony\Component\Yaml\Tests    16x in InlineTest::testDump from Symfony\Component\Yaml\Tests    7x in DumperTest::testDumpingArrayObjectInstancesWithNumericKeysInlined from Symfony\Component\Yaml\Tests    7x in DumperTest::testDumpingArrayObjectInstancesWithNumericKeysRespectsInlineLevel from Symfony\Component\Yaml\Tests    3x in DumperTest::testIndentationInConstructor from Symfony\Component\Yaml\Tests    1x in DumperTest::testObjectSupportEnabled from Symfony\Component\Yaml\Tests    1x in DumperTest::testObjectSupportDisabledButNoExceptions from Symfony\Component\Yaml\Tests  22x: ctype_digit(): Argument of type float will be interpreted as string in the future    15x in DumperTest::testSpecifications from Symfony\Component\Yaml\Tests    6x in InlineTest::testDump from Symfony\Component\Yaml\Tests    1x in InlineTest::testDumpNumericValueWithLocale from Symfony\Component\Yaml\Tests

@nicolas-grekas
Copy link
Member

Thank you@alexpott.

@nicolas-grekasnicolas-grekas merged commit19fdcba intosymfony:4.4Jul 13, 2021
casefalse ===$value:
return'false';
casectype_digit($value):
return\is_string($value) ?"'$value'" : (int)$value;
Copy link
Member

@stofstofJul 13, 2021
edited
Loading

Choose a reason for hiding this comment

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

We still need to handle the case ofis_string($value) && ctype_digit($value), to dump the value quoted.

Choose a reason for hiding this comment

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

this case is handled L180, isn't it?

Copy link
Member

Choose a reason for hiding this comment

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

indeed, this case should be covered byis_numeric($value).

Btw, don't we also have issues when passing floats throughis_numeric($value) && false === strpos($value, "\f") && ... ?

Choose a reason for hiding this comment

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

we could have a case dedicated to is_float I agree

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

@stof I'm pretty sure that the next case takes care of that already.

sstok reacted with thumbs up emoji
This was referencedJul 26, 2021
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@nicolas-grekasnicolas-grekasnicolas-grekas left review comments

@stofstofstof left review comments

@derrabusderrabusderrabus approved these changes

@chalasrchalasrchalasr approved these changes

@xabbuhxabbuhAwaiting requested review from xabbuhxabbuh is a code owner

Assignees

No one assigned

Projects

None yet

Milestone

4.4

Development

Successfully merging this pull request may close these issues.

6 participants

@alexpott@nicolas-grekas@stof@derrabus@chalasr@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp