| Total Lines | 46 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 10 | interface ProxyFactory |
||
| 11 | { |
||
| 12 | /** |
||
| 13 | * Never autogenerate a proxy and rely that it was generated by some |
||
| 14 | * process before deployment. |
||
| 15 | */ |
||
| 16 | public const AUTOGENERATE_NEVER = 0; |
||
| 17 | /** |
||
| 18 | * Always generates a new proxy in every request. |
||
| 19 | * |
||
| 20 | * This is only sane during development. |
||
| 21 | */ |
||
| 22 | public const AUTOGENERATE_ALWAYS = 1; |
||
| 23 | /** |
||
| 24 | * Autogenerate the proxy class when the proxy file does not exist. |
||
| 25 | * |
||
| 26 | * This strategy causes a file exists call whenever any proxy is used the |
||
| 27 | * first time in a request. |
||
| 28 | */ |
||
| 29 | public const AUTOGENERATE_FILE_NOT_EXISTS = 2; |
||
| 30 | /** |
||
| 31 | * Generate the proxy classes using eval(). |
||
| 32 | * |
||
| 33 | * This strategy is only sane for development, and even then it gives me |
||
| 34 | * the creeps a little. |
||
| 35 | */ |
||
| 36 | public const AUTOGENERATE_EVAL = 3; |
||
| 37 | |||
| 38 | /** |
||
| 39 | * @param ClassMetadata[] $classes |
||
| 40 | * |
||
| 41 | * @return int |
||
| 42 | */ |
||
| 43 | public function generateProxyClasses(array $classes) : int; |
||
| 44 | |||
| 45 | /** |
||
| 46 | * Gets a reference proxy instance for the entity of the given type and identified by |
||
| 47 | * the given identifier. |
||
| 48 | * |
||
| 49 | * @param ClassMetadata $metadata |
||
| 50 | * @param string $identifier |
||
| 51 | * |
||
| 52 | * @return GhostObjectInterface |
||
| 53 | */ |
||
| 54 | public function getProxy(ClassMetadata $metadata, string $identifier) : GhostObjectInterface; |
||
| 55 | } |
||
| 56 |