Problem/Motivation
Increasing the PHPStan level further uncovers some valuable suggestions for improving the module's code.
Proposed resolution
Increase PHPStan level past level 1 to a level that strikes a reasonable balance between adding value and causing developer pain.
Issue fork orange_dam-3403239
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
markdorison25 issues still outstanding.
Comment #4
apotek commentedOn this warning, it is interesting that the method works and returns data:
getDerivativeId() is a method on PluginBase.
and
abstract class PluginBase implements PluginInspectionInterface, DerivativeInspectionInterface
DerivativeInspectionInterface contains method getDerivativeId().
So I am not sure why phpstan is complaining here. Code runs fine.
Comment #5
markdorisonIt feels like PHPStan is confused and looking in the wrong place or not able to find these methods. 🤔
Comment #6
markdorison$migration->getDestinationPlugin()->getDerivativeId();getDestinationPlugin()returns an object conforming toMigrateDestinationInterfacewhich does not specifygetDestinationPlugin(); as you noted, it is inDerivativeInspectionInterface. Is it possible that in our case it is returning an object that conforms to both, but in theory, we could receive an object that does not have this method?If the above is accurate, this is why PHPStan is complaining.
Comment #7
markdorisonHow do we feel about the state of the MR? There are 14 issues outstanding. If it is not worthwhile to push further on these, we can drop the PHPStan level back down to 1 and commit these improvements as is.
Comment #8
adamzimmermann commentedI would like to push this forward if possible still. @apotek what are your thoughts on some of the issues you raised?
Comment #9
markdorisonComment #10
markdorisonComment #12
markdorison