Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use Symfony\Component\Config\FileLocator;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Loader;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
use Symfony\Component\DependencyInjection\Extension\Extension;

/**
* This is the class that loads and manages your bundle configuration.
Expand Down
14 changes: 6 additions & 8 deletions Tests/Controller/GeneratorControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,10 @@ public function testGetPasswordGeneratorException(): void

$container
->method('get')
->will(
$this->returnCallback(
function ($service) {
return $service;
}
)
->willReturnCallback(
function ($service) {
return $service;
}
);

$this->_object->setContainer($container);
Expand All @@ -79,7 +77,7 @@ function ($service) {
$this->invokeMethod($this->_object, 'getPasswordGenerator', ['non-existent']);
}

public function modeProvider()
public static function modeProvider()
{
return [
['dummy', 'dummy'],
Expand All @@ -104,7 +102,7 @@ public function testGetMode($mode, $check): void
$this->assertSame($check, $returnValue);
}

public function nullModeProvider()
public static function nullModeProvider()
{
return [
['dummy', 'dummy'],
Expand Down
4 changes: 2 additions & 2 deletions Tests/Entity/OptionsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public function setup(): void
$this->_object = new \Hackzilla\Bundle\PasswordGeneratorBundle\Entity\Options($passwordGenerator);
}

public function quantityProvider()
public static function quantityProvider()
{
return [
[1, 1],
Expand All @@ -38,7 +38,7 @@ public function testQuantity($quantity, $check): void
$this->assertSame($check, $this->_object->getQuantity());
}

public function optionProvider()
public static function optionProvider()
{
return [
['LENGTH', 1],
Expand Down
4 changes: 2 additions & 2 deletions Tests/PublicService.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ final class PublicService implements CompilerPassInterface
'twig',
];

public function process(ContainerBuilder $container)
public function process(ContainerBuilder $container): void
{
foreach ($container->getDefinitions() as $id => $definition) {
$this->checkForService($id, $definition);
Expand All @@ -30,7 +30,7 @@ public function process(ContainerBuilder $container)
}
}

private function checkForService(string $id, $definition)
private function checkForService(string $id, $definition): void
{
foreach (self::SERVICES as $service) {
if (stripos($id, $service) === 0) {
Expand Down
7 changes: 6 additions & 1 deletion Tests/TestKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@ protected function configureContainer(ContainerBuilder $c, LoaderInterface $load
'form' => null,
'test' => true,
];
if (version_compare(self::VERSION, '7.3', '>=')) {
$frameworkConfig['property_info'] = ['with_constructor_extractor' => true];
}

if (version_compare(self::VERSION, '5.1', '>=') && version_compare(self::VERSION, '6.0', '<')) {
$frameworkConfig['router'] = ['utf8' => true];
Expand All @@ -130,12 +133,14 @@ protected function configureContainer(ContainerBuilder $c, LoaderInterface $load
// TwigBundle config
$twigConfig = [
'strict_variables' => '%kernel.debug%',
'exception_controller' => null,
];
// "default_path" configuration is available since version 3.4.
if (version_compare(self::VERSION, '3.4', '>=')) {
$twigConfig['default_path'] = __DIR__.'/Resources/views';
}
if (version_compare(self::VERSION, '7.3', '<')) {
$twigConfig['exception_controller'] = null;
}
$c->loadFromExtension('twig', $twigConfig);
}

Expand Down
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@
"require": {
"php": "^8.0.2",
"hackzilla/password-generator": "^1.3",
"symfony/framework-bundle": "^6.0|^7.0",
"symfony/form": "^6.0|^7.0",
"symfony/twig-bundle": "^6.0|^7.0",
"symfony/serializer": "^6.0|^7.0"
"symfony/framework-bundle": "^6.0|^7.0|^8.0",
"symfony/form": "^6.0|^7.0|^8.0",
"symfony/twig-bundle": "^6.0|^7.0|^8.0",
"symfony/serializer": "^6.0|^7.0|^8.0"
},
"require-dev": {
"php-coveralls/php-coveralls": "^2.0",
"symfony/phpunit-bridge": "^6.0|^7.0",
"symfony/phpunit-bridge": "^6.0|^7.0|^8.0",
"phpunit/phpunit": "^9.0"
},
"autoload": {
Expand Down