Skip to content

Declare strict types #375

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

Merged
merged 9 commits into from
Jan 6, 2020
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/.phpunit.result.cache
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added this also on this PR.

/.php_cs.cache
/behat.yml
/build/
Expand Down
2 changes: 2 additions & 0 deletions .php_cs.dist
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@ $finder = PhpCsFixer\Finder::create()
;

return PhpCsFixer\Config::create()
->setRiskyAllowed(true)
->setRules([
'@Symfony' => true,
'array_syntax' => ['syntax' => 'short'],
'declare_strict_types' => true,
'visibility_required' => [
'elements' => [
'const',
Expand Down
2 changes: 2 additions & 0 deletions src/ClientFactory/AutoDiscoveryFactory.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Http\HttplugBundle\ClientFactory;

use Http\Discovery\HttpClientDiscovery;
Expand Down
2 changes: 2 additions & 0 deletions src/ClientFactory/BuzzFactory.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Http\HttplugBundle\ClientFactory;

use Buzz\Client\FileGetContents;
Expand Down
2 changes: 2 additions & 0 deletions src/ClientFactory/ClientFactory.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Http\HttplugBundle\ClientFactory;

use Http\Client\HttpClient;
Expand Down
2 changes: 2 additions & 0 deletions src/ClientFactory/CurlFactory.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Http\HttplugBundle\ClientFactory;

use Http\Client\Curl\Client;
Expand Down
2 changes: 2 additions & 0 deletions src/ClientFactory/DummyClient.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Http\HttplugBundle\ClientFactory;

@trigger_error('The '.__NAMESPACE__.'\DummyClient interface is deprecated since version 1.7 and will be removed in 2.0.', E_USER_DEPRECATED);
Expand Down
2 changes: 2 additions & 0 deletions src/ClientFactory/Guzzle5Factory.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Http\HttplugBundle\ClientFactory;

use GuzzleHttp\Client;
Expand Down
2 changes: 2 additions & 0 deletions src/ClientFactory/Guzzle6Factory.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Http\HttplugBundle\ClientFactory;

use Http\Adapter\Guzzle6\Client;
Expand Down
2 changes: 2 additions & 0 deletions src/ClientFactory/MockFactory.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Http\HttplugBundle\ClientFactory;

use Http\Client\HttpClient;
Expand Down
2 changes: 2 additions & 0 deletions src/ClientFactory/PluginClientFactory.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Http\HttplugBundle\ClientFactory;

@trigger_error('The '.__NAMESPACE__.'\PluginClientFactory class is deprecated since version 1.8 and will be removed in 2.0. Use Http\Client\Common\PluginClientFactory instead.', E_USER_DEPRECATED);
Expand Down
2 changes: 2 additions & 0 deletions src/ClientFactory/ReactFactory.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Http\HttplugBundle\ClientFactory;

use Http\Adapter\React\Client;
Expand Down
2 changes: 2 additions & 0 deletions src/ClientFactory/SocketFactory.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Http\HttplugBundle\ClientFactory;

use Http\Client\Socket\Client;
Expand Down
2 changes: 2 additions & 0 deletions src/ClientFactory/SymfonyFactory.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Http\HttplugBundle\ClientFactory;

use Psr\Http\Message\ResponseFactoryInterface;
Expand Down
2 changes: 2 additions & 0 deletions src/Collector/Collector.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Http\HttplugBundle\Collector;

use Symfony\Component\HttpFoundation\Request;
Expand Down
2 changes: 2 additions & 0 deletions src/Collector/Formatter.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Http\HttplugBundle\Collector;

use Exception;
Expand Down
2 changes: 2 additions & 0 deletions src/Collector/PluginClientFactory.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Http\HttplugBundle\Collector;

use Http\Client\Common\Plugin;
Expand Down
2 changes: 2 additions & 0 deletions src/Collector/PluginClientFactoryListener.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Http\HttplugBundle\Collector;

use Http\Client\Common\PluginClientFactory as DefaultPluginClientFactory;
Expand Down
2 changes: 2 additions & 0 deletions src/Collector/Profile.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Http\HttplugBundle\Collector;

/**
Expand Down
2 changes: 2 additions & 0 deletions src/Collector/ProfileClient.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Http\HttplugBundle\Collector;

use Http\Client\Common\FlexibleHttpClient;
Expand Down
2 changes: 2 additions & 0 deletions src/Collector/ProfileClientFactory.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Http\HttplugBundle\Collector;

use Http\Client\Common\FlexibleHttpClient;
Expand Down
2 changes: 2 additions & 0 deletions src/Collector/ProfilePlugin.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Http\HttplugBundle\Collector;

use Exception;
Expand Down
2 changes: 2 additions & 0 deletions src/Collector/Stack.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Http\HttplugBundle\Collector;

/**
Expand Down
2 changes: 2 additions & 0 deletions src/Collector/StackPlugin.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Http\HttplugBundle\Collector;

use Exception;
Expand Down
2 changes: 2 additions & 0 deletions src/Collector/Twig/HttpMessageMarkupExtension.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Http\HttplugBundle\Collector\Twig;

use Twig\Extension\AbstractExtension;
Expand Down
2 changes: 2 additions & 0 deletions src/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Http\HttplugBundle\DependencyInjection;

use Http\Client\Common\Plugin\Cache\Generator\CacheKeyGenerator;
Expand Down
2 changes: 2 additions & 0 deletions src/DependencyInjection/HttplugExtension.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Http\HttplugBundle\DependencyInjection;

use Http\Client\Common\BatchClient;
Expand Down
2 changes: 2 additions & 0 deletions src/Discovery/ConfiguredClientsStrategy.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Http\HttplugBundle\Discovery;

use Http\Client\HttpClient;
Expand Down
2 changes: 2 additions & 0 deletions src/HttplugBundle.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Http\HttplugBundle;

use Symfony\Component\HttpKernel\Bundle\Bundle;
Expand Down
4 changes: 3 additions & 1 deletion tests/Functional/DiscoveredClientsTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Http\HttplugBundle\Tests\Functional;

use Http\Client\HttpAsyncClient;
Expand All @@ -11,9 +13,9 @@
use Http\HttplugBundle\Discovery\ConfiguredClientsStrategy;
use Nyholm\NSA;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
use Symfony\Component\EventDispatcher\Event as LegacyEvent;
use Symfony\Component\HttpKernel\Kernel;
use Symfony\Contracts\EventDispatcher\Event;
use Symfony\Component\EventDispatcher\Event as LegacyEvent;

class DiscoveredClientsTest extends WebTestCase
{
Expand Down
4 changes: 3 additions & 1 deletion tests/Functional/DiscoveryTest.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
<?php

declare(strict_types=1);

namespace Http\HttplugBundle\Tests\Unit\DependencyInjection\Compiler;

use Http\Adapter\Guzzle6\Client;
use Http\Client\HttpAsyncClient;
use Http\Client\HttpClient;
use Http\Discovery\HttpClientDiscovery;
Expand All @@ -13,7 +16,6 @@
use Matthias\SymfonyDependencyInjectionTest\PhpUnit\ContainerBuilderHasAliasConstraint;
use PHPUnit\Framework\Constraint\LogicalNot;
use Symfony\Component\DependencyInjection\Definition;
use Http\Adapter\Guzzle6\Client;

/**
* @author Márk Sági-Kazár <mark.sagikazar@gmail.com>
Expand Down
2 changes: 2 additions & 0 deletions tests/Functional/ProfilerTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Http\HttplugBundle\Tests\Functional;

use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
Expand Down
2 changes: 2 additions & 0 deletions tests/Functional/ProfilingTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Http\HttplugBundle\Tests\Functional;

use GuzzleHttp\Psr7\Request;
Expand Down
2 changes: 2 additions & 0 deletions tests/Functional/ServiceInstantiationTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Http\HttplugBundle\Tests\Functional;

use GuzzleHttp\Psr7\Request as GuzzleRequest;
Expand Down
2 changes: 2 additions & 0 deletions tests/Unit/ClientFactory/BuzzFactoryTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Http\HttplugBundle\Tests\Unit\ClientFactory;

use Http\Adapter\Buzz\Client;
Expand Down
4 changes: 3 additions & 1 deletion tests/Unit/ClientFactory/CurlFactoryTest.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
<?php

declare(strict_types=1);

namespace Http\HttplugBundle\Tests\Unit\ClientFactory;

use Http\HttplugBundle\ClientFactory\CurlFactory;
use Http\Client\Curl\Client;
use Http\HttplugBundle\ClientFactory\CurlFactory;
use PHPUnit\Framework\TestCase;
use Psr\Http\Message\ResponseFactoryInterface;
use Psr\Http\Message\StreamFactoryInterface;
Expand Down
4 changes: 3 additions & 1 deletion tests/Unit/ClientFactory/Guzzle6FactoryTest.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
<?php

declare(strict_types=1);

namespace Http\HttplugBundle\Tests\Unit\ClientFactory;

use Http\HttplugBundle\ClientFactory\Guzzle6Factory;
use Http\Adapter\Guzzle6\Client;
use Http\HttplugBundle\ClientFactory\Guzzle6Factory;
use PHPUnit\Framework\TestCase;

/**
Expand Down
2 changes: 2 additions & 0 deletions tests/Unit/ClientFactory/MockFactoryTest.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php

declare(strict_types=1);
/**
* This file is part of the HttplugBundle package.
*
Expand Down
2 changes: 2 additions & 0 deletions tests/Unit/ClientFactory/ReactFactoryTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Http\HttplugBundle\Tests\Unit\ClientFactory;

use Http\Adapter\React\Client;
Expand Down
2 changes: 2 additions & 0 deletions tests/Unit/ClientFactory/SocketFactoryTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Http\HttplugBundle\Tests\Unit\ClientFactory;

use Http\Client\Socket\Client;
Expand Down
2 changes: 2 additions & 0 deletions tests/Unit/ClientFactory/SymfonyFactoryTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Http\HttplugBundle\Tests\Unit\ClientFactory;

use Http\HttplugBundle\ClientFactory\SymfonyFactory;
Expand Down
2 changes: 2 additions & 0 deletions tests/Unit/Collector/CollectorTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Http\HttplugBundle\Tests\Unit\Collector;

use Http\HttplugBundle\Collector\Collector;
Expand Down
2 changes: 2 additions & 0 deletions tests/Unit/Collector/FormatterTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Http\HttplugBundle\Tests\Unit\Collector;

use GuzzleHttp\Psr7\Request;
Expand Down
2 changes: 2 additions & 0 deletions tests/Unit/Collector/PluginClientFactoryListenerTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Http\HttplugBundle\Tests\Unit\Collector;

use Http\Client\Common\PluginClientFactory as DefaultPluginClientFactory;
Expand Down
2 changes: 2 additions & 0 deletions tests/Unit/Collector/ProfileClientFactoryTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Http\HttplugBundle\Tests\Unit\Collector;

use Http\Client\HttpClient;
Expand Down
2 changes: 2 additions & 0 deletions tests/Unit/Collector/ProfileClientTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Http\HttplugBundle\Tests\Unit\Collector;

use GuzzleHttp\Psr7\Request;
Expand Down
Loading