Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix deprecations #1924

Merged
merged 1 commit into from
Dec 11, 2021
Merged
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
2 changes: 1 addition & 1 deletion DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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