1 | <?php |
||||
2 | declare(strict_types=1); |
||||
3 | |||||
4 | namespace TddWizard\Fixtures\Customer; |
||||
5 | |||||
6 | use Magento\Customer\Api\CustomerRepositoryInterface; |
||||
7 | use Magento\Framework\Exception\LocalizedException; |
||||
8 | use Magento\Framework\Registry; |
||||
9 | use Magento\TestFramework\Helper\Bootstrap; |
||||
0 ignored issues
–
show
|
|||||
10 | |||||
11 | /** |
||||
12 | * @internal Use CustomerFixture::rollback() or CustomerFixturePool::rollback() instead |
||||
13 | */ |
||||
14 | class CustomerFixtureRollback |
||||
15 | { |
||||
16 | /** |
||||
17 | * @var Registry |
||||
18 | */ |
||||
19 | private $registry; |
||||
20 | /** |
||||
21 | * @var CustomerRepositoryInterface |
||||
22 | */ |
||||
23 | private $customerRepository; |
||||
24 | |||||
25 | 10 | public function __construct(Registry $registry, CustomerRepositoryInterface $customerRepository) |
|||
26 | { |
||||
27 | 10 | $this->registry = $registry; |
|||
28 | 10 | $this->customerRepository = $customerRepository; |
|||
29 | 10 | } |
|||
30 | |||||
31 | 10 | public static function create(): CustomerFixtureRollback |
|||
32 | { |
||||
33 | 10 | $objectManager = Bootstrap::getObjectManager(); |
|||
34 | 10 | return new self( |
|||
35 | 10 | $objectManager->get(Registry::class), |
|||
36 | 10 | $objectManager->get(CustomerRepositoryInterface::class) |
|||
37 | ); |
||||
38 | } |
||||
39 | |||||
40 | /** |
||||
41 | * @param CustomerFixture ...$customerFixtures |
||||
42 | * @throws LocalizedException |
||||
43 | */ |
||||
44 | 10 | public function execute(CustomerFixture ...$customerFixtures): void |
|||
45 | { |
||||
46 | 10 | $this->registry->unregister('isSecureArea'); |
|||
0 ignored issues
–
show
The function
Magento\Framework\Registry::unregister() has been deprecated: 102.0.0
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
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. ![]() |
|||||
47 | 10 | $this->registry->register('isSecureArea', true); |
|||
0 ignored issues
–
show
The function
Magento\Framework\Registry::register() has been deprecated: 102.0.0
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
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. ![]() |
|||||
48 | |||||
49 | 10 | foreach ($customerFixtures as $customerFixture) { |
|||
50 | 10 | $this->customerRepository->deleteById($customerFixture->getId()); |
|||
51 | } |
||||
52 | |||||
53 | 10 | $this->registry->unregister('isSecureArea'); |
|||
0 ignored issues
–
show
The function
Magento\Framework\Registry::unregister() has been deprecated: 102.0.0
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
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. ![]() |
|||||
54 | 10 | } |
|||
55 | } |
||||
56 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths