Here's what an actual working example looks like
https://github.com/justbetter/magento2-sentry/blob/26daa9575a8e9f673aa6102558288ae46a436a60/Plugin/MonologPlugin.php
Before
/**
* {@inheritdoc}
*/
public function __construct(
$name,
Data\Proxy $data,
SentryLog\Proxy $sentryLog,
DeploymentConfig\Proxy $deploymentConfig,
array $handlers = [],
array $processors = []
) {
$this->sentryHelper = $data;
$this->sentryLog = $sentryLog;
$this->deploymentConfig = $deploymentConfig;
parent::__construct($name, $handlers, $processors);
}
After
use JustBetter\Sentry\Model\SentryLog;
/**
* {@inheritdoc}
*/
public function __construct(
$name,
Data $data,
SentryLog $sentryLog,
DeploymentConfig $deploymentConfig,
array $handlers = [],
array $processors = []
) {
$this->sentryHelper = $data;
$this->sentryLog = $sentryLog;
$this->deploymentConfig = $deploymentConfig;
parent::__construct($name, $handlers, $processors);
}
etc/di.xml
https://github.com/justbetter/magento2-sentry/blob/8d7adcce685ae1fba38187901dee894002d05c78/etc/di.xml#L14-L23
<type name="JustBetter\Sentry\Plugin\MonologPlugin">
<arguments>
<argument name="name" xsi:type="string"></argument>
<argument name="data" xsi:type="object">JustBetter\Sentry\Helper\Data\Proxy</argument>
<argument name="sentryLog" xsi:type="object">JustBetter\Sentry\Model\SentryLog\Proxy</argument>
<argument name="deploymentConfig" xsi:type="object">Magento\Framework\App\DeploymentConfig\Proxy</argument>
<argument name="handlers" xsi:type="array"></argument>
<argument name="processors" xsi:type="array"></argument>
</arguments>
</type>