Skip to content

Commit

Permalink
minor #186 use new bundle strategy
Browse files Browse the repository at this point in the history
  • Loading branch information
jrushlow authored Apr 27, 2024
1 parent c3690bd commit 5de06bc
Show file tree
Hide file tree
Showing 30 changed files with 26 additions and 91 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<container xmlns="http://symfony.com/schema/dic/services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd"
xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd"
>
<services>
<service id="symfonycasts.verify_email.token_generator" class="SymfonyCasts\Bundle\VerifyEmail\Generator\VerifyEmailTokenGenerator" public="false">
Expand Down
38 changes: 0 additions & 38 deletions src/DependencyInjection/Configuration.php

This file was deleted.

43 changes: 0 additions & 43 deletions src/DependencyInjection/SymfonyCastsVerifyEmailExtension.php

This file was deleted.

34 changes: 25 additions & 9 deletions src/SymfonyCastsVerifyEmailBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,38 @@

namespace SymfonyCasts\Bundle\VerifyEmail;

use Symfony\Component\DependencyInjection\Extension\ExtensionInterface;
use Symfony\Component\HttpKernel\Bundle\Bundle;
use SymfonyCasts\Bundle\VerifyEmail\DependencyInjection\SymfonyCastsVerifyEmailExtension;
use Symfony\Component\Config\Definition\Configurator\DefinitionConfigurator;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
use Symfony\Component\HttpKernel\Bundle\AbstractBundle;

/**
* @author Jesse Rushlow <[email protected]>
* @author Ryan Weaver <[email protected]>
*/
class SymfonyCastsVerifyEmailBundle extends Bundle
class SymfonyCastsVerifyEmailBundle extends AbstractBundle
{
public function getContainerExtension(): ?ExtensionInterface
protected string $extensionAlias = 'symfonycasts_verify_email';

public function configure(DefinitionConfigurator $definition): void
{
$definition->rootNode() /** @phpstan-ignore method.notFound */
->children()
->integerNode('lifetime')
->defaultValue(3600)
->info('The length of time in seconds that a signed URI is valid for after it is created.')
->end()
;
}

/** @param array<mixed> $config */
public function loadExtension(array $config, ContainerConfigurator $container, ContainerBuilder $builder): void
{
if (!$this->extension) {
$this->extension = new SymfonyCastsVerifyEmailExtension();
}
$container->import('../config/verify_email_services.xml');

return $this->extension;
$container->services()
->get('symfonycasts.verify_email.helper')
->arg(3, $config['lifetime'])
;
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 5de06bc

Please sign in to comment.