1 | <?php |
||
12 | class Utility |
||
13 | { |
||
14 | /** |
||
15 | * The library root namespace. |
||
16 | */ |
||
17 | const LIBRARY_NS = 'As3\\Modlr'; |
||
18 | |||
19 | /** |
||
20 | * The bundle root namespace. |
||
21 | */ |
||
22 | const BUNDLE_NS = 'As3\\Bundle\\ModlrBundle'; |
||
23 | |||
24 | /** |
||
25 | * The bundle alias. |
||
26 | */ |
||
27 | const BUNDLE_ALIAS = 'as3_modlr'; |
||
28 | |||
29 | /** |
||
30 | * Prevent instantiation. |
||
31 | */ |
||
32 | private function __construct() |
||
35 | |||
36 | /** |
||
37 | * Appends a key/value pair to a container parameter. |
||
38 | * If the parameter name currently isn't set, the parameter is created. |
||
39 | * |
||
40 | * @param string $name |
||
41 | * @param string $key |
||
42 | * @param mixed $value |
||
43 | * @param ContainerBuilder $container |
||
44 | */ |
||
45 | public static function appendParameter($name, $key, $value, ContainerBuilder $container) |
||
57 | |||
58 | /** |
||
59 | * Cleans a service name by removing any '@' characters. |
||
60 | * |
||
61 | * @param string $name |
||
62 | * @return string |
||
63 | */ |
||
64 | public static function cleanServiceName($name) |
||
68 | |||
69 | /** |
||
70 | * Gets the fully qualified class name for a Modlr bundle class. |
||
71 | * |
||
72 | * @static |
||
73 | * @param string $subClass |
||
74 | * @return string |
||
75 | */ |
||
76 | public static function getBundleClass($subClass) |
||
80 | |||
81 | /** |
||
82 | * Gets the fully qualified class name for a Modlr library class. |
||
83 | * |
||
84 | * @static |
||
85 | * @param string $subClass |
||
86 | * @return string |
||
87 | */ |
||
88 | public static function getLibraryClass($subClass) |
||
92 | |||
93 | /** |
||
94 | * Gets the fully-qualified bundle alias name. |
||
95 | * |
||
96 | * @static |
||
97 | * @param string $name |
||
98 | * @return string |
||
99 | */ |
||
100 | public static function getAliasedName($name) |
||
104 | |||
105 | /** |
||
106 | * Locates a file resource path for a given config path. |
||
107 | * Is needed in order to retrieve a bundle's directory, if used. |
||
108 | * |
||
109 | * |
||
110 | * @static |
||
111 | * @param string $path |
||
112 | * @param ContainerBuilder $container |
||
113 | * @return string |
||
114 | * @throws \RuntimeException |
||
115 | */ |
||
116 | public static function locateResource($path, ContainerBuilder $container) |
||
146 | } |
||
147 |