Preconditions (*)
1. Magento/product-community-edition 2.3.4
2. PHP 7.3
3. ionCube 10.3.9
Summary (*)
When I’m using ionCube Encoder for encoding of custom modules then Magento not generating classes correctly.
I have few type of errors.
When I trying to extent MagentoFrameworkDBAdapterPdoMysql
public function query($sql, $bind = []) {
...
then I got error
PHP Fatal error: Declaration of VendorModuleNameFrameworkDBAdapterPdoMysqlInterceptor::query($sql, $bind) must be compatible with VendorModuleNameFrameworkDBAdapterPdoMysql::query($sql, $bind = ) in /var/www/magento/generated/code/Vendor/ModuleName/Framework/DB/Adapter/Pdo/Mysql/Interceptor.php on line 7
The interceptor has incorrect function declaration .
/** * {@inheritdoc}
*/
public function query($sql, $bind) {
$pluginInfo = $this->pluginList->getNext($this->subjectType, 'query');
if (!$pluginInfo) {
return parent::query($sql, $bind);
} else {
return $this->___callPlugins('query', func_get_args(), $pluginInfo);
}
}
And second issue with injection of dependencies (Magento 2.*).
I’m trying to inject dependency into
VendorModuleNameBlockAdminhtmlFormFieldCustomFile
public function _construct(
MagentoBackendBlockTemplateContext $context,
array $data = [] ,
VendorModuleNameHelperLicense $license
) {
$this->_license = $license;
parent::_construct( $context, $data );
}
And I see this string in the logs.
main.CRITICAL: Missing required argument $data of VendorModuleNameBlockAdminhtmlFormFieldCustomFile. [] []