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

[Debug] Fixed erroneous deprecation notice for extended Interfaces#17320

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:2.8frompeterrehm:deprecated-auth-interface
Jan 12, 2016
Merged

[Debug] Fixed erroneous deprecation notice for extended Interfaces#17320

nicolas-grekas merged 1 commit intosymfony:2.8frompeterrehm:deprecated-auth-interface
Jan 12, 2016

Conversation

@peterrehm
Copy link
Contributor

QA
Bug fix?yes
New feature?no
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets#16643,#16775
LicenseMIT
Doc PR-

Replaces#16775.

@Tobion
Copy link
Contributor

I think this implementation is too specific. It should be solved generically. Something like ignore deprecated interfaces if the parent interface is from the Symfony namespace as well.

@peterrehm
Copy link
ContributorAuthor

@Tobion Updated accordingly. I don't know if this might cause any unwanted side effects.

@Tobion
Copy link
Contributor

Lets see what@nicolas-grekas thinks

@nicolas-grekas
Copy link
Member

There is an issue, and I think we should not restrict the fix toSymfony* names.
I propose this patch:

--- a/src/Symfony/Component/Debug/DebugClassLoader.php+++ b/src/Symfony/Component/Debug/DebugClassLoader.php@@ -200,8 +200,23 @@ class DebugClassLoader                         @trigger_error(sprintf('The %s class extends %s that is deprecated %s', $name, $parent->name, self::$deprecated[$parent->name]), E_USER_DEPRECATED);                     }+                    $parentInterfaces = array();+                    $deprecatedInterfaces = array();+                    if ($parent) {+                        foreach ($parent->getInterfaceNames() as $interface) {+                            $parentInterfaces[$interface] = 1;+                        }+                    }                     foreach ($refl->getInterfaceNames() as $interface) {-                        if (isset(self::$deprecated[$interface]) && strncmp($ns, $interface, $len) && !($parent && $parent->implementsInterface($interface))) {+                        if (isset(self::$deprecated[$interface]) && strncmp($ns, $interface, $len)) {+                            $deprecatedInterfaces[] = $interface;+                        }+                        foreach (class_implements($interface) as $interface) {+                            $parentInterfaces[$interface] = 1;+                        }+                    }+                    foreach ($deprecatedInterfaces as $interface) {+                        if (!isset($parentInterfaces[$interface])) {                             @trigger_error(sprintf('The %s %s %s that is deprecated %s', $name, $refl->isInterface() ? 'interface extends' : 'class implements', $interface, self::$deprecated[$interface]), E_USER_DEPRECATED);                         }                     }

@peterrehm could you please also squash your PR and fix the commit message (and PR title)?
This would help generating a useful changelog when releasing. Thanks!

@peterrehmpeterrehm changed the titleFixed erroneous deprecation notice for the SimplePreAuthenticatorInterfaceFixed erroneous deprecation notice for extended InterfacesJan 11, 2016
@peterrehmpeterrehm changed the titleFixed erroneous deprecation notice for extended Interfaces[Debug] Fixed erroneous deprecation notice for extended InterfacesJan 11, 2016
@Tobion
Copy link
Contributor

Needs tests IMO

@stof
Copy link
Member

Can you add a test covering this ?

@peterrehm
Copy link
ContributorAuthor

Not sure yet, working on it.

@peterrehm
Copy link
ContributorAuthor

Just added a test, please have a look at the test.@nicolas-grekas Otherwise all your comments should have been incorporated as well...

Copy link
Member

Choose a reason for hiding this comment

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

please keep this dataProvider near the test using it instead of inserting your new test between them

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Updated.

@nicolas-grekas
Copy link
Member

Thank you@peterrehm.

@nicolas-grekasnicolas-grekas merged commit5f4e968 intosymfony:2.8Jan 12, 2016
nicolas-grekas added a commit that referenced this pull requestJan 12, 2016
…terfaces (peterrehm)This PR was merged into the 2.8 branch.Discussion----------[Debug] Fixed erroneous deprecation notice for extended Interfaces| Q             | A| ------------- | ---| Bug fix?      | yes| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets |#16643,#16775| License       | MIT| Doc PR        | -Replaces#16775.Commits-------5f4e968 Fixed erroneous deprecation notice for extended Interfaces
@peterrehmpeterrehm deleted the deprecated-auth-interface branchJanuary 12, 2016 09:14
@Tobion
Copy link
Contributor

So when a user-land interface extends a deprecated symfony interface, there are no deprecation messages anymore?

@nicolas-grekas
Copy link
Member

yes there is, when the user interface is loaded, isn't it?

@Tobion
Copy link
Contributor

Ok I just wanted to make sure.

@fabpotfabpot mentioned this pull requestJan 14, 2016
@fabpotfabpot mentioned this pull requestFeb 3, 2016
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

5 participants

@peterrehm@Tobion@nicolas-grekas@stof@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp