Skip to content

Commit

Permalink
optimize get container extension
Browse files Browse the repository at this point in the history
  • Loading branch information
peter-gribanov committed Aug 14, 2019
1 parent e1b8f5a commit 1d55ea5
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions src/GpsLabPaginationBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

namespace GpsLab\Bundle\PaginationBundle;

use GpsLab\Bundle\PaginationBundle\DependencyInjection\GpsLabPaginationExtension;
use Symfony\Component\DependencyInjection\Extension\ExtensionInterface;
use Symfony\Component\HttpKernel\Bundle\Bundle;

Expand All @@ -19,19 +20,6 @@ class GpsLabPaginationBundle extends Bundle
*/
public function getContainerExtension()
{
if (null === $this->extension) {
$this->extension = false;
$class = $this->getContainerExtensionClass();

if (class_exists($class)) {
$extension = new $class();

if ($extension instanceof ExtensionInterface) {
$this->extension = $extension;
}
}
}

return $this->extension ?: null;
return new GpsLabPaginationExtension();
}
}

0 comments on commit 1d55ea5

Please sign in to comment.