Skip to content

Commit

Permalink
Merge pull request #11 from peter-gribanov/extension
Browse files Browse the repository at this point in the history
Optimize get container extension
  • Loading branch information
peter-gribanov authored Aug 15, 2019
2 parents 05638e0 + 1d55ea5 commit 2bf172e
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 2bf172e

Please sign in to comment.