1 | <?php |
||
17 | class PublicReferenceGeneratorImpl implements PublicReferenceGenerator |
||
18 | { |
||
19 | public static $REDUCED_UPPER_CHARS = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'K', 'L', 'M', 'N', 'P', 'R', 'S', 'T', 'V', 'W', 'X', 'Y', 'Z']; |
||
20 | |||
21 | /** @var Repository */ |
||
22 | private $repository; |
||
23 | /** @var string */ |
||
24 | private $pattern; |
||
25 | /** @var array */ |
||
26 | private $cls2pattern; |
||
27 | |||
28 | /** |
||
29 | * PublicReferenceGeneratorImpl constructor. |
||
30 | * |
||
31 | * @param Repository $repository |
||
32 | * @param string $pattern |
||
33 | * @param array $cls2pattern |
||
34 | */ |
||
35 | public function __construct(Repository $repository, $pattern = '$$-__-########', array $cls2pattern = []) |
||
41 | |||
42 | /** |
||
43 | * @param mixed $subject The object to create a public unique reference for |
||
44 | * |
||
45 | * @return null|string |
||
46 | */ |
||
47 | public function create($subject) |
||
72 | |||
73 | |||
74 | /** |
||
75 | * @param string $pattern |
||
76 | * @param string $className |
||
77 | * |
||
78 | * @return string |
||
79 | */ |
||
80 | private function generate($pattern, $className) |
||
111 | } |
||
112 |