1 <?php
declare(strict_types
=1);
4 * This file is part of the Rapsys AirBundle 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\AirBundle
;
14 use Symfony\Component\DependencyInjection\Container
;
15 use Symfony\Component\HttpKernel\Bundle\Bundle
;
17 class RapsysAirBundle
extends Bundle
{
21 * @return string The bundle alias
23 public static function getAlias(): string {
25 if ($npos = strrpos(static::class, '\\')) {
33 //With trailing bundle
34 if (substr(static::class, -strlen('Bundle'), strlen('Bundle')) === 'Bundle') {
36 $bpos = strlen(static::class) - $npos - strlen('Bundle');
40 $bpos = strlen(static::class) - $npos;
43 //Return underscored lowercase bundle alias
44 return Container
::underscore(substr(static::class, $npos, $bpos));