| Conditions | 2 |
| Paths | 2 |
| Total Lines | 16 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 10 | public function generateForBundleClass(BundleInterface $bundle, $className, $withSuffix = false) |
||
| 11 | { |
||
| 12 | $namespace = $bundle->getNamespace(); |
||
| 13 | $extension = $bundle->getContainerExtension(); |
||
| 14 | |||
| 15 | $extensionAlias = $extension->getAlias(); |
||
| 16 | |||
| 17 | $bundleClass = substr($className, strlen($namespace) + 1); |
||
| 18 | $bundlePart = str_replace('\\', '.', Container::underscore($bundleClass)); |
||
| 19 | |||
| 20 | if (false !== $withSuffix) { |
||
| 21 | $bundlePart .= '_'.$withSuffix; |
||
| 22 | } |
||
| 23 | |||
| 24 | return sprintf('%s.%s', $extensionAlias, $bundlePart); |
||
| 25 | } |
||
| 26 | } |
||
| 27 |