| 1 | <?php |
||
| 17 | class ProxyBuilder |
||
| 18 | { |
||
| 19 | /** |
||
| 20 | * @var ProxyContainer |
||
| 21 | */ |
||
| 22 | protected $container; |
||
| 23 | |||
| 24 | /** |
||
| 25 | * @var MockingStrategyInterface |
||
| 26 | */ |
||
| 27 | protected $mockingStrategy; |
||
| 28 | |||
| 29 | /** |
||
| 30 | * ProxyBuilder constructor. |
||
| 31 | * @param MockingStrategyInterface $mockingStrategy |
||
| 32 | */ |
||
| 33 | 4 | public function __construct(MockingStrategyInterface $mockingStrategy) |
|
| 38 | |||
| 39 | /** |
||
| 40 | * @return void |
||
| 41 | */ |
||
| 42 | 6 | public function reset() |
|
| 43 | { |
||
| 44 | 6 | $this->container = new ProxyContainer(); |
|
| 45 | } |
||
| 46 | |||
| 47 | /** |
||
| 48 | * @param string $fqcn |
||
| 49 | * @param string|null $alias |
||
| 50 | * @return Proxy |
||
| 51 | * |
||
| 52 | * @throws MockNotCreatedException |
||
| 53 | * @throws InvalidIdentifierException |
||
| 54 | */ |
||
| 55 | 7 | public function getProxy(string $fqcn, string $alias = null): Proxy |
|
| 65 | |||
| 66 | /** |
||
| 67 | * @param string $fqcn |
||
| 68 | * @return Proxy |
||
| 69 | */ |
||
| 70 | 5 | protected function buildProxy(string $fqcn): Proxy |
|
| 74 | } |
||
| 75 |