Passed
Push — master ( 458d5c...6b9503 )
by Christian
13:27 queued 14s
created

SwagTestPluginAcl::activate()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
rs 10
c 1
b 0
f 0
1
<?php declare(strict_types=1);
2
3
namespace SwagTestPluginAcl;
4
5
use Shopware\Core\Framework\Plugin;
6
use Shopware\Core\Framework\Plugin\Context\ActivateContext;
7
use Shopware\Core\Framework\Plugin\Context\DeactivateContext;
8
9
/** @deprecated tag:v6.4.0.0 */
10
class SwagTestPluginAcl extends Plugin
11
{
12
    public function activate(ActivateContext $context): void
13
    {
14
        $this->addPrivileges('product.viewer', ['swag_demo_data:read']);
0 ignored issues
show
Deprecated Code introduced by
The function Shopware\Core\Framework\Plugin::addPrivileges() has been deprecated: tag:v6.4.0.0 use enrichPrivileges instead ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

14
        /** @scrutinizer ignore-deprecated */ $this->addPrivileges('product.viewer', ['swag_demo_data:read']);

This function has been deprecated. The supplier of the function has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.

Loading history...
15
    }
16
17
    public function deactivate(DeactivateContext $context): void
18
    {
19
        $this->removePrivileges(['swag_demo_data:read']);
0 ignored issues
show
Deprecated Code introduced by
The function Shopware\Core\Framework\Plugin::removePrivileges() has been deprecated: tag:v6.4.0.0 will be removed ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

19
        /** @scrutinizer ignore-deprecated */ $this->removePrivileges(['swag_demo_data:read']);

This function has been deprecated. The supplier of the function has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.

Loading history...
20
    }
21
}
22