- Issue created by @markdorison
- Status changed to Needs work
over 1 year ago 8:52pm 21 November 2023 - πΊπΈUnited States markdorison
25 issues still outstanding.
------ ----------------------------------------------------------------------- Line src/Commands/OrangeDamCommands.php ------ ----------------------------------------------------------------------- 766 Cannot access property $RecordID on array. 946 PHPDoc tag @param for parameter $timeUpdatedUntil with type Drupal\Core\Datetime\DrupalDateTime|null is not subtype of native type Drupal\Core\Datetime\DrupalDateTime. 998 Call to an undefined method Drupal\migrate\Plugin\MigrateDestinationInterface::getDerivativeId(). ------ ----------------------------------------------------------------------- ------ -------------------------------------------------------------------------- Line src/EventSubscriber/OrangeDamMigrationSubscriber.php ------ -------------------------------------------------------------------------- 82 Call to an undefined method Drupal\migrate\Plugin\MigrateDestinationInterface::getDerivativeId(). 103 Access to an undefined property Drupal\Core\Entity\EntityInterface::$field_system_id. π‘ Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property ------ -------------------------------------------------------------------------- ------ -------------------------------------------------------------------------- Line src/OrangeDamApi.php ------ -------------------------------------------------------------------------- 66 Interface Drupal\Core\Logger\LoggerChannelInterface referenced with incorrect case: Drupal\Core\Logger\LoggerchannelInterface. 195 Method Drupal\orange_dam\OrangeDamApi::getDataTableData() has invalid return type Object. 202 Call to an undefined method Chromatic\OrangeDam\Factory::dataTable(). 240 Method Drupal\orange_dam\OrangeDamApi::getSearchApiData() has invalid return type Ojbect. 428 Access to an undefined property object::$GlobalInfo. π‘ Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property 518 Call to an undefined method Chromatic\OrangeDam\Factory::assetLink(). 595 Call to an undefined method Chromatic\OrangeDam\Factory::ObjectManagement(). 690 Call to an undefined method Chromatic\OrangeDam\Factory::dataTable(). 737 Access to an undefined property object::$ResponseSummary. π‘ Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property 801 Call to an undefined method Chromatic\OrangeDam\Factory::mediaFile(). 878 Call to an undefined method Chromatic\OrangeDam\Factory::dataTable(). 962 Call to an undefined method Chromatic\OrangeDam\Factory::dataTable(). 1011 Call to an undefined method Chromatic\OrangeDam\Http\Client::getClient(). 1050 Call to an undefined method Chromatic\OrangeDam\Http\Client::oAuth2(). 1055 Call to an undefined method Chromatic\OrangeDam\Http\Client::getClient(). ------ -------------------------------------------------------------------------- ------ ---------------------------------------------- Line src/OrangeDamMigrationDataManager.php ------ ---------------------------------------------- 220 Cannot access property $data on object|true. ------ ---------------------------------------------- ------ ----------------------------------------------------------------------- Line src/OrangeDamQueueDataManager.php ------ ----------------------------------------------------------------------- 337 Call to an undefined method Drupal\migrate\Plugin\MigrateDestinationInterface::getDerivativeId(). ------ ----------------------------------------------------------------------- ------ --------------------------------------------------------------------------------------- Line src/Plugin/migrate/process/OrangeDamProcessBase.php ------ --------------------------------------------------------------------------------------- 28 Constructor of class Drupal\orange_dam\Plugin\migrate\process\OrangeDamProcessBase has an unused parameter $loggerChannelFactory. 38 Access to an undefined property Drupal\orange_dam\Plugin\migrate\process\OrangeDamProcessBase::$loggerChannelFactory. π‘ Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property ------ --------------------------------------------------------------------------------------- ------ --------------------------------------------------------------------- Line src/Plugin/migrate/process/OrangeDamRecordIdSystemId.php ------ --------------------------------------------------------------------- 32 Access to property $SystemID on an unknown class Object. π‘ Learn more at https://phpstan.org/user-guide/discovering-symbols ------ --------------------------------------------------------------------- [ERROR] Found 25 errors
- πΊπΈUnited States apotek
On this warning, it is interesting that the method works and returns data:
------ ----------------------------------------------------------------------- Line src/Commands/OrangeDamCommands.php ------ ----------------------------------------------------------------------- 998 Call to an undefined method Drupal\migrate\Plugin\MigrateDestinationInterface::getDerivativeId().
getDerivativeId() is a method on PluginBase.
interface MigrateDestinationInterface extends PluginInspectionInterface
and
abstract class PluginBase implements PluginInspectionInterface, DerivativeInspectionInterface {
and DerivativeInspectiveInterface contains method getDerivativeId(). So I am not sure why phpstan is complaining here. I can execute this code without error.
- πΊπΈUnited States markdorison
getDerivativeId() is a method on PluginBase.
DerivativeInspectionInterface contains method getDerivativeId().
So I am not sure why phpstan is complaining here. Code runs fine.
It feels like PHPStan is confused and looking in the wrong place or not able to find these methods. π€
- πΊπΈUnited States markdorison
getDerivativeId() is a method on PluginBase.
DerivativeInspectionInterface contains method getDerivativeId().
So I am not sure why phpstan is complaining here. Code runs fine.
$migration->getDestinationPlugin()->getDerivativeId();
getDestinationPlugin()
returns an object conforming toMigrateDestinationInterface
which 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.
- πΊπΈUnited States markdorison
How 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.
- πΊπΈUnited States adamzimmermann
I would like to push this forward if possible still. @apotek what are your thoughts on some of the issues you raised?
- Status changed to Needs review
over 1 year ago 9:34pm 20 December 2023 - Status changed to RTBC
over 1 year ago 3:40pm 5 January 2024 -
markdorison β
committed 702cfb5c on 1.x
Issue #3403239 by markdorison, apotek, adamzimmermann: Increase PHPStan...
-
markdorison β
committed 702cfb5c on 1.x
- Status changed to Fixed
over 1 year ago 3:42pm 5 January 2024 Automatically closed - issue fixed for 2 weeks with no activity.