Closed (won't fix)
Project:
Drupal core
Version:
8.2.x-dev
Component:
plugin system
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
17 Jun 2014 at 19:43 UTC
Updated:
30 Jun 2016 at 12:31 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
tim.plunkettThis doesn't really make sense to me.
First, its a simple getter for the plugin definition. Nothing about it will change.
Second, this is a base class, it has the protected property, it should use it.
Third, there are about 100 other places we use
$this->pluginDefinition['directly, I don't know why you would pick this one.Comment #2
andypostI pick this one because it confusing to to read this code - because no reason to use different access methods
Here's a opposite patch - convert to direct access to property.
PS: probably it makes sense to check all other places
Comment #3
tim.plunkettNot too many, let's just do them all.
Comment #4
andypostseems all fixed, just need to check new plugins that was added (context and so on)
Comment #5
znerol commentedDoes not apply anymore. Potentially affected files include:
Comment #6
tadityar commentedRe-rolled.
Comment #7
tadityar commentedwell actually the patch from #6 is not only a re-roll. It also changed some more files.
No changes were made to these files though since they doesn't use
$this->getPluginDefinition[Comment #8
cs_shadow commentedLooks good to me. RTBC +1
Comment #9
dawehnerSeems alright.
Comment #11
adci_contributor commentedReroll
Comment #14
xanoMany of the clean-ups just convert things like
$definition = $this->getPluginDefinition();$foo = $definition['foo'];to$foo = $this->pluginDefinition['foo'], but in PHP 5.4 we can now do$foo = $this->getPluginDefinition()['foo']as well.Comment #15
deepakaryan1988Comment #16
deepakaryan1988Re-rolling the patch #11 and done the $foo = $this->getPluginDefinition()['foo'] according @Xano who has mentioned his point in #14.
Comment #18
Anonymous (not verified) commentedIs it possible to re-run the tests, as qa.drupal.org is no longer in use?
Comment #19
Anonymous (not verified) commentedPatch #16 could not be applied to the latest dev. I tried manually applying those changes.
Comment #20
Anonymous (not verified) commentedComment #21
jibranComment #23
Anonymous (not verified) commentedPlease help run tests for this patch.
Comment #24
tim.plunkettComment #26
benjy commented+1 to #16, using $this->pluginDefinition directly makes it harder for any child classes that override the getter.
Comment #27
Anonymous (not verified) commentedPlease review this patch.Ignore this, made a silly mistake.Comment #28
Anonymous (not verified) commentedKeeps failing on BlockInterfaceTest.
Comment #29
Anonymous (not verified) commentedComment #31
Anonymous (not verified) commentedLet's see if it works after I undo the changes in BlockBase.php.
Comment #34
tim.plunkettI think this should be won't fix. None of this patch seems like an improvement.
Comment #35
benjy commentedI agree with #34 as well, the changes aren't much of an improvement and they're now different from the original proposal anyway.
Comment #36
xanoClosing this in accordance with #16, #34, and #35. Nothing is wrong with the code in its current state, and it has been explained that method access is easier to override in case of base classes.