Skip to content

Commit

Permalink
Fix deprecations (#1924)
Browse files Browse the repository at this point in the history
  • Loading branch information
GuilhemN committed Dec 11, 2021
1 parent c0b57fd commit f5fb7a4
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 9 deletions.
2 changes: 1 addition & 1 deletion DependencyInjection/Configuration.php
Expand Up @@ -16,7 +16,7 @@

final class Configuration implements ConfigurationInterface
{
public function getConfigTreeBuilder()
public function getConfigTreeBuilder(): TreeBuilder
{
$treeBuilder = new TreeBuilder('nelmio_api_doc');

Expand Down
2 changes: 1 addition & 1 deletion Resources/doc/index.rst
Expand Up @@ -39,7 +39,7 @@ Open a command console, enter your project directory and execute the following c

class AppKernel extends Kernel
{
public function registerBundles()
public function registerBundles(): iterable
{
$bundles = [
// ...
Expand Down
3 changes: 2 additions & 1 deletion Tests/Functional/ArrayItemsErrorTest.php
Expand Up @@ -12,6 +12,7 @@
namespace Nelmio\ApiDocBundle\Tests\Functional;

use Nelmio\ApiDocBundle\Exception\UndocumentedArrayItemsException;
use Symfony\Component\HttpKernel\KernelInterface;

class ArrayItemsErrorTest extends WebTestCase
{
Expand All @@ -30,7 +31,7 @@ public function testModelPictureDocumentation()
$this->getSwaggerDefinition();
}

protected static function createKernel(array $options = [])
protected static function createKernel(array $options = []): KernelInterface
{
return new TestKernel(TestKernel::ERROR_ARRAY_ITEMS);
}
Expand Down
3 changes: 2 additions & 1 deletion Tests/Functional/BazingaFunctionalTest.php
Expand Up @@ -12,6 +12,7 @@
namespace Nelmio\ApiDocBundle\Tests\Functional;

use Hateoas\Configuration\Embedded;
use Symfony\Component\HttpKernel\KernelInterface;

class BazingaFunctionalTest extends WebTestCase
{
Expand Down Expand Up @@ -120,7 +121,7 @@ public function testWithType()
], $this->getModel('BazingaUserTyped')->toArray());
}

protected static function createKernel(array $options = [])
protected static function createKernel(array $options = []): KernelInterface
{
return new TestKernel(TestKernel::USE_JMS | TestKernel::USE_BAZINGA);
}
Expand Down
4 changes: 3 additions & 1 deletion Tests/Functional/JMSFunctionalTest.php
Expand Up @@ -11,6 +11,8 @@

namespace Nelmio\ApiDocBundle\Tests\Functional;

use Symfony\Component\HttpKernel\KernelInterface;

class JMSFunctionalTest extends WebTestCase
{
protected function setUp(): void
Expand Down Expand Up @@ -302,7 +304,7 @@ public function testNamingStrategyWithConstraints()
], $this->getModel('JMSNamingStrategyConstraints')->toArray());
}

protected static function createKernel(array $options = [])
protected static function createKernel(array $options = []): KernelInterface
{
return new TestKernel(TestKernel::USE_JMS);
}
Expand Down
6 changes: 3 additions & 3 deletions Tests/Functional/TestKernel.php
Expand Up @@ -52,7 +52,7 @@ public function __construct(int $flags = 0)
/**
* {@inheritdoc}
*/
public function registerBundles()
public function registerBundles(): iterable
{
$bundles = [
new FrameworkBundle(),
Expand Down Expand Up @@ -241,15 +241,15 @@ protected function configureContainer(ContainerBuilder $c, LoaderInterface $load
/**
* {@inheritdoc}
*/
public function getCacheDir()
public function getCacheDir(): string
{
return parent::getCacheDir().'/'.$this->flags;
}

/**
* {@inheritdoc}
*/
public function getLogDir()
public function getLogDir(): string
{
return parent::getLogDir().'/'.$this->flags;
}
Expand Down
3 changes: 2 additions & 1 deletion Tests/Functional/WebTestCase.php
Expand Up @@ -14,10 +14,11 @@
use EXSyst\Component\Swagger\Operation;
use EXSyst\Component\Swagger\Schema;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase as BaseWebTestCase;
use Symfony\Component\HttpKernel\KernelInterface;

class WebTestCase extends BaseWebTestCase
{
protected static function createKernel(array $options = [])
protected static function createKernel(array $options = []): KernelInterface
{
return new TestKernel();
}
Expand Down

0 comments on commit f5fb7a4

Please sign in to comment.