Refactor format actions
This commit is contained in:
@ -11,9 +11,6 @@ use Symfony\Component\HttpKernel\DependencyInjection\Extension;
|
||||
|
||||
class HtmlPrettierExtension extends Extension
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function load(array $configs, ContainerBuilder $container)
|
||||
{
|
||||
$loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
|
||||
|
@ -4,21 +4,14 @@ declare(strict_types=1);
|
||||
|
||||
namespace Homepage\HtmlPrettierBundle;
|
||||
|
||||
use Generator;
|
||||
use Sculpin\Core\Event\SourceSetEvent;
|
||||
use Sculpin\Core\Sculpin;
|
||||
use Sculpin\Core\Source\SourceInterface;
|
||||
use Sculpin\Core\Source\SourceSet;
|
||||
|
||||
use function strlen;
|
||||
|
||||
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
|
||||
|
||||
class HtmlPrettier implements EventSubscriberInterface
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public static function getSubscribedEvents(): array
|
||||
{
|
||||
return [
|
||||
@ -47,7 +40,7 @@ class HtmlPrettier implements EventSubscriberInterface
|
||||
}
|
||||
}
|
||||
|
||||
private function filterSource(SourceSet $sourceSet): Generator
|
||||
private function filterSource(SourceSet $sourceSet): \Generator
|
||||
{
|
||||
/** @var SourceInterface $source */
|
||||
foreach ($sourceSet->allSources() as $source) {
|
||||
@ -65,7 +58,7 @@ class HtmlPrettier implements EventSubscriberInterface
|
||||
|
||||
private function endsWith($haystack, $needle): bool
|
||||
{
|
||||
$length = strlen($needle);
|
||||
$length = \strlen($needle);
|
||||
|
||||
return $length === 0 || (substr($haystack, -$length) === $needle);
|
||||
}
|
||||
|
@ -11,9 +11,6 @@ use Symfony\Component\HttpKernel\DependencyInjection\Extension;
|
||||
|
||||
class SiteMapExtension extends Extension
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function load(array $configs, ContainerBuilder $container)
|
||||
{
|
||||
$loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
|
||||
|
@ -23,9 +23,6 @@ class SiteMapGenerator implements DataProviderInterface, EventSubscriberInterfac
|
||||
*/
|
||||
private $sources;
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public static function getSubscribedEvents(): array
|
||||
{
|
||||
return [
|
||||
|
@ -11,9 +11,6 @@ use Symfony\Component\HttpKernel\DependencyInjection\Extension;
|
||||
|
||||
class TwigExtensionExtension extends Extension
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function load(array $configs, ContainerBuilder $container)
|
||||
{
|
||||
$loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
|
||||
|
Reference in New Issue
Block a user