1 <?php
declare(strict_types
=1);
4 * This file is part of the Rapsys PackBundle package.
6 * (c) Raphaël Gertz <symfony@rapsys.eu>
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 namespace Rapsys\PackBundle
;
14 use Symfony\Component\DependencyInjection\Container
;
15 use Symfony\Component\HttpKernel\Bundle\Bundle
;
20 class RapsysPackBundle
extends Bundle
{
24 * @return string The bundle alias
26 public function getAlias(): string {
28 if ($npos = strrpos(static::class, '\\')) {
36 //With trailing bundle
37 if (substr(static::class, -strlen('Bundle'), strlen('Bundle')) === 'Bundle') {
39 $bpos = strlen(static::class) - $npos - strlen('Bundle');
43 $bpos = strlen(static::class) - $npos;
46 //Return underscored lowercase bundle alias
47 return Container
::underscore(substr(static::class, $npos, $bpos));