Skip to content

Commit

Permalink
Upd namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
vpodorozh committed Nov 2, 2022
1 parent 7ca9d0c commit 3d1d923
Show file tree
Hide file tree
Showing 12 changed files with 26 additions and 26 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
### Installation

```bash
composer req vpodorozh/magento-cli-auto-proxy:*
composer req run_as_root/magento-cli-auto-proxy:*
```

## Roadmap
Expand Down
2 changes: 1 addition & 1 deletion component/app/etc/cli_arg_auto_proxy_di.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<preference for="Magento\Framework\ObjectManager\Config\Reader\Dom"
type="Vpodorozh\CliConstructorArgAutoProxy\Preference\Framework\ObjectManager\Config\Reader\Dom\Interceptor" />
type="RunAsRoot\CliConstructorArgAutoProxy\Preference\Framework\ObjectManager\Config\Reader\Dom\Interceptor" />
</config>
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "vpodorozh/magento-cli-auto-proxy",
"name": "run_as_root/magento-cli-auto-proxy",
"description": "Makes all Magento CLI commands construct dependencies be injected as Proxy.",
"type": "magento2-component",
"require": {
Expand All @@ -10,7 +10,7 @@
},
"autoload": {
"psr-4": {
"Vpodorozh\\CliConstructorArgAutoProxy\\": "lib"
"RunAsRoot\\CliConstructorArgAutoProxy\\": "lib"
}
},
"extra": {
Expand Down
2 changes: 1 addition & 1 deletion lib/Enum/ProxyClassEntityInterfaceEnum.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
declare(strict_types=1);

namespace Vpodorozh\CliConstructorArgAutoProxy\Enum;
namespace RunAsRoot\CliConstructorArgAutoProxy\Enum;

interface ProxyClassEntityInterfaceEnum
{
Expand Down
2 changes: 1 addition & 1 deletion lib/Exception/ClassIsNotEligibleForProxyException.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
declare(strict_types=1);

namespace Vpodorozh\CliConstructorArgAutoProxy\Exception;
namespace RunAsRoot\CliConstructorArgAutoProxy\Exception;

use Exception;

Expand Down
2 changes: 1 addition & 1 deletion lib/Mapper/ProxiedConstructArgsToDiConfigMapper.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
declare(strict_types=1);

namespace Vpodorozh\CliConstructorArgAutoProxy\Mapper;
namespace RunAsRoot\CliConstructorArgAutoProxy\Mapper;

class ProxiedConstructArgsToDiConfigMapper
{
Expand Down
4 changes: 2 additions & 2 deletions lib/Plugin/Dom/EnrichCliConfigWithProxyPlugin.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php
declare(strict_types=1);

namespace Vpodorozh\CliConstructorArgAutoProxy\Plugin\Dom;
namespace RunAsRoot\CliConstructorArgAutoProxy\Plugin\Dom;

use Psr\Log\LoggerInterface;
use ReflectionException;
use Vpodorozh\CliConstructorArgAutoProxy\Service\EnrichCliConfigWithProxyService;
use RunAsRoot\CliConstructorArgAutoProxy\Service\EnrichCliConfigWithProxyService;

class EnrichCliConfigWithProxyPlugin
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php
declare(strict_types=1);

namespace Vpodorozh\CliConstructorArgAutoProxy\Preference\Framework\ObjectManager\Config\Reader\Dom;
namespace RunAsRoot\CliConstructorArgAutoProxy\Preference\Framework\ObjectManager\Config\Reader\Dom;

use Magento\Framework\App\ObjectManager;
use Magento\Framework\ObjectManager\Config\Reader\Dom as OriginDom;
use Vpodorozh\CliConstructorArgAutoProxy\Plugin\Dom\EnrichCliConfigWithProxyPlugin;
use RunAsRoot\CliConstructorArgAutoProxy\Plugin\Dom\EnrichCliConfigWithProxyPlugin;

class Interceptor extends OriginDom
{
Expand Down
14 changes: 7 additions & 7 deletions lib/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ Entry point of functionality is based on DI config reader that is used in both c

### Plugins

#### `\Vpodorozh\CliConstructorArgAutoProxy\Plugin\Dom\EnrichCliConfigWithProxyPlugin`
#### `\RunAsRoot\CliConstructorArgAutoProxy\Plugin\Dom\EnrichCliConfigWithProxyPlugin`
* responsible for enriching DI config with Proxies for CLI command constructor arguments;
* executed after DI config reading;
* plugin is executed in not trivial way - via preference on DOM config reader of DI (see section bellow for more details)
* Caller class: `\Vpodorozh\CliConstructorArgAutoProxy\Preference\Framework\ObjectManager\Config\Reader\Dom\Interceptor`
* Caller class: `\RunAsRoot\CliConstructorArgAutoProxy\Preference\Framework\ObjectManager\Config\Reader\Dom\Interceptor`

### Preferences

Expand All @@ -36,27 +36,27 @@ Entry point of functionality is based on DI config reader that is used in both c
| Magento\Framework\ObjectManager\Config\Reader\Dom | ...\Preference\Framework\ObjectManager\Config\Reader\Dom\Interceptor |


#### `\Vpodorozh\CliConstructorArgAutoProxy\Preference\Framework\ObjectManager\Config\Reader\Dom\Interceptor`
#### `\RunAsRoot\CliConstructorArgAutoProxy\Preference\Framework\ObjectManager\Config\Reader\Dom\Interceptor`
Workaround for plugin execution.
This override has the same purpose as regular Magento 2 Interceptors - hook for calling plugins.
It is not possible to define plugin over DOM config reader, as it is created before Magento plugin functionality starts.
Preference is the only way to hook in.

### Services

#### `\Vpodorozh\CliConstructorArgAutoProxy\Service\EnrichCliConfigWithProxyService`
#### `\RunAsRoot\CliConstructorArgAutoProxy\Service\EnrichCliConfigWithProxyService`
Enrich provided DI config with proxies for CLI class commands only.

#### `\Vpodorozh\CliConstructorArgAutoProxy\Service\GetProxiedConstructArgsConfigService`
#### `\RunAsRoot\CliConstructorArgAutoProxy\Service\GetProxiedConstructArgsConfigService`
Receives CLI command constructor arguments types and reformat them to Proxy types.
Using `IsClassEligibleForProxyValidator` to determine is class eligible to be Proxied.

### Validator

#### `\Vpodorozh\CliConstructorArgAutoProxy\Validator\IsClassEligibleForProxyValidator`
#### `\RunAsRoot\CliConstructorArgAutoProxy\Validator\IsClassEligibleForProxyValidator`
Check is Proxy applicable for this specific class.

### Mapper

#### `\Vpodorozh\CliConstructorArgAutoProxy\Mapper\ProxiedConstructArgsToDiConfigMapper`
#### `\RunAsRoot\CliConstructorArgAutoProxy\Mapper\ProxiedConstructArgsToDiConfigMapper`
Adds Proxy DI configs for specific CLI class command to DI configs pool.
4 changes: 2 additions & 2 deletions lib/Service/EnrichCliConfigWithProxyService.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?php
declare(strict_types=1);

namespace Vpodorozh\CliConstructorArgAutoProxy\Service;
namespace RunAsRoot\CliConstructorArgAutoProxy\Service;

use Magento\Framework\Code\Reader\ClassReaderInterface;
use Magento\Framework\Console\CommandListInterface;
use ReflectionException;
use Vpodorozh\CliConstructorArgAutoProxy\Mapper\ProxiedConstructArgsToDiConfigMapper;
use RunAsRoot\CliConstructorArgAutoProxy\Mapper\ProxiedConstructArgsToDiConfigMapper;

class EnrichCliConfigWithProxyService
{
Expand Down
6 changes: 3 additions & 3 deletions lib/Service/GetProxiedConstructArgsConfigService.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php
declare(strict_types=1);

namespace Vpodorozh\CliConstructorArgAutoProxy\Service;
namespace RunAsRoot\CliConstructorArgAutoProxy\Service;

use Vpodorozh\CliConstructorArgAutoProxy\Enum\ProxyClassEntityInterfaceEnum;
use Vpodorozh\CliConstructorArgAutoProxy\Validator\IsClassEligibleForProxyValidator;
use RunAsRoot\CliConstructorArgAutoProxy\Enum\ProxyClassEntityInterfaceEnum;
use RunAsRoot\CliConstructorArgAutoProxy\Validator\IsClassEligibleForProxyValidator;

class GetProxiedConstructArgsConfigService
{
Expand Down
6 changes: 3 additions & 3 deletions lib/Validator/IsClassEligibleForProxyValidator.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php
declare(strict_types=1);

namespace Vpodorozh\CliConstructorArgAutoProxy\Validator;
namespace RunAsRoot\CliConstructorArgAutoProxy\Validator;

use Vpodorozh\CliConstructorArgAutoProxy\Enum\ProxyClassEntityInterfaceEnum;
use Vpodorozh\CliConstructorArgAutoProxy\Exception\ClassIsNotEligibleForProxyException;
use RunAsRoot\CliConstructorArgAutoProxy\Enum\ProxyClassEntityInterfaceEnum;
use RunAsRoot\CliConstructorArgAutoProxy\Exception\ClassIsNotEligibleForProxyException;

class IsClassEligibleForProxyValidator
{
Expand Down

0 comments on commit 3d1d923

Please sign in to comment.