Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[PhpUnitBridge] Use total for asserting deprecation count when a group is not defined #58499

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 21, 2024

Conversation

lyrixx
Copy link
Member

@lyrixx lyrixx commented Oct 8, 2024

Q A
Branch? 7.2
Bug fix? no
New feature? no
Deprecations? no
Issues -
License MIT

@@ -96,7 +96,7 @@ private function __construct(array $thresholds = [], string $regex = '', array $
}
foreach ($groups as $group) {
if (!isset($this->thresholds[$group])) {
$this->thresholds[$group] = 999999;
$this->thresholds[$group] ??= $this->thresholds['total'] ?? 999999;
Copy link
Member Author

@lyrixx lyrixx Oct 8, 2024

Choose a reason for hiding this comment

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

I have an app, with a LOT OF deprecation notice.
I tried to increased the value in our setup

<server name="SYMFONY_DEPRECATIONS_HELPER" value="max[total]=2000000&amp;verbose=0" />

but it did not worked, because the default value is 999999.
And this is a bit "WTF", because it failed, and I had no clue why.
I had hard time to understand why.

In our app, we have theses numbers:

array:6 [                                                                                                                                                                                   
  "unsilenced" => 0                                                                                                                                                                         
  "self" => 3                                                                                                                                                                               
  "direct" => 646                                                                                                                                                                           
  "indirect" => 1002531                                                                                                                                                                     
  "legacy" => 0                                                                                                                                                                             
  "other" => 686                                                                                                                                                                            
]

@lyrixx lyrixx force-pushed the phpunit-use-total branch 2 times, most recently from 62087c1 to 3e87ba4 Compare October 8, 2024 14:46
@OskarStark OskarStark changed the title [PhpUnitBridge] Use 'total' for asserting deprecation count when a group is not defined [PhpUnitBridge] Use total for asserting deprecation count when a group is not defined Oct 8, 2024
@xabbuh
Copy link
Member

xabbuh commented Oct 9, 2024

This should be documented in the changelog file.

@lyrixx lyrixx force-pushed the phpunit-use-total branch from 3e87ba4 to 02d1110 Compare October 21, 2024 09:45
@lyrixx
Copy link
Member Author

lyrixx commented Oct 21, 2024

This should be documented in the changelog file.

Thanks, fixed 👍🏼

@xabbuh xabbuh added the ❄️ Feature Freeze Important Pull Requests to finish before the next Symfony "feature freeze" label Oct 21, 2024
@nicolas-grekas
Copy link
Member

Thank you @lyrixx.

@nicolas-grekas nicolas-grekas merged commit 814397d into symfony:7.2 Oct 21, 2024
9 of 11 checks passed
@lyrixx lyrixx deleted the phpunit-use-total branch October 21, 2024 11:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PhpUnitBridge ❄️ Feature Freeze Important Pull Requests to finish before the next Symfony "feature freeze" Status: Reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants