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

Appearance settings

Commit ab09fcc

Browse filesBrowse files
Revert "bug #27312 Supress deprecation notices thrown when getting private servies from container in tests (arderyp)"
This reverts commit 70c70e2, reversing changes made to 7497ad4.
1 parent 3e65a1c commit ab09fcc
Copy full SHA for ab09fcc

File tree

Expand file treeCollapse file tree

1 file changed

+0
-24
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+0
-24
lines changed

‎src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php
-24Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -109,30 +109,6 @@ public static function register($mode = 0)
109109
}
110110

111111
$trace = debug_backtrace(true);
112-
113-
// Silence deprecation warnings about private service accessed
114-
// from the service container if done so from a Test class.
115-
// As of Symfony 4.1, there is a new TestContainer that allows
116-
// fetching of private services within tests, so we no longer
117-
// need to warn about this behavior.
118-
//
119-
// NOTE: the event at the top of the stack $trace (index 0) should
120-
// always be the PhpUnitBridge's DeprecationErrorHandler; the
121-
// second event (index 1) should be the trigger_error() event;
122-
// the third event (index 2) should be the actual source of the
123-
// triggered deprecation notice; and the fourth event (index 3)
124-
// represents the action that called the deprecated code. In the
125-
// scenario that we want to suppress, the 4th event will be an
126-
// object instance of \PHPUnit\Framework\TestCase.
127-
if (isset($trace[3]['object'])) {
128-
$isPrivateServiceNotice = false !== strpos($msg, ' service is private, ');
129-
$isNoticeForContainerGetHasUsage = 'Symfony\Component\DependencyInjection\Container' === $trace[2]['class'] && in_array($trace[2]['function'], array('get', 'has'));
130-
$noticeWasTriggeredByPhpUnitTest = $trace[3]['object'] instanceof \PHPUnit\Framework\TestCase;
131-
if ($isPrivateServiceNotice && $isNoticeForContainerGetHasUsage && $noticeWasTriggeredByPhpUnitTest) {
132-
return false;
133-
}
134-
}
135-
136112
$group = 'other';
137113
$isVendor = DeprecationErrorHandler::MODE_WEAK_VENDORS === $mode && $inVendors($file);
138114

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.