@@ -4,13 +4,10 @@ |
||
| 4 | 4 | use stdClass; |
| 5 | 5 | use Datetime; |
| 6 | 6 | use InvalidArgumentException; |
| 7 | - |
|
| 8 | 7 | use Behat\Behat\Context\Context; |
| 9 | 8 | use Behat\Gherkin\Node\PyStringNode; |
| 10 | - |
|
| 11 | 9 | use Symfony\Component\PropertyAccess\PropertyAccess; |
| 12 | 10 | use Symfony\Component\PropertyAccess\PropertyAccessor; |
| 13 | - |
|
| 14 | 11 | use Behapi\Extension\Tools\Assert; |
| 15 | 12 | |
| 16 | 13 | abstract class AbstractJson implements Context |
@@ -2,23 +2,17 @@ |
||
| 2 | 2 | namespace Behapi\Context; |
| 3 | 3 | |
| 4 | 4 | use RuntimeException; |
| 5 | - |
|
| 6 | 5 | use Psr\Http\Message\RequestInterface; |
| 7 | - |
|
| 8 | 6 | use Behat\Behat\Context\Context; |
| 9 | 7 | use Behat\Gherkin\Node\TableNode; |
| 10 | - |
|
| 11 | 8 | use Http\Client\HttpClient; |
| 12 | 9 | use Http\Message\StreamFactory; |
| 13 | 10 | use Http\Message\MessageFactory; |
| 14 | - |
|
| 15 | 11 | use Twig_Environment; |
| 16 | - |
|
| 17 | 12 | use Behapi\Extension\Context\ApiTrait; |
| 18 | 13 | use Behapi\Extension\Context\ApiInterface; |
| 19 | 14 | use Behapi\Extension\Context\TwigInterface; |
| 20 | 15 | use Behapi\Extension\Context\TwigTrait; |
| 21 | - |
|
| 22 | 16 | use Behapi\Extension\Tools\Assert; |
| 23 | 17 | use Behapi\Extension\Tools\HttpHistory; |
| 24 | 18 | |
@@ -4,38 +4,12 @@ |
||
| 4 | 4 | use Behat\Testwork\ServiceContainer\Extension; |
| 5 | 5 | use Behat\Testwork\ServiceContainer\ExtensionManager; |
| 6 | 6 | use Behat\Testwork\Cli\ServiceContainer\CliExtension; |
| 7 | - |
|
| 8 | 7 | use Behat\Behat\HelperContainer\ServiceContainer\HelperContainerExtension; |
| 9 | - |
|
| 10 | 8 | use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition; |
| 11 | - |
|
| 12 | 9 | use Symfony\Component\DependencyInjection\Reference; |
| 13 | -use Symfony\Component\DependencyInjection\Definition; |
|
| 14 | 10 | use Symfony\Component\DependencyInjection\ContainerBuilder; |
| 15 | - |
|
| 16 | -use Twig_Environment; |
|
| 17 | - |
|
| 18 | -use Psr\Http\Message\UriInterface; |
|
| 19 | - |
|
| 20 | -use Http\Client\HttpClient; |
|
| 21 | - |
|
| 22 | -use Http\Message\UriFactory; |
|
| 23 | -use Http\Message\StreamFactory; |
|
| 24 | -use Http\Message\MessageFactory; |
|
| 25 | - |
|
| 26 | -use Http\Discovery\HttpClientDiscovery; |
|
| 27 | -use Http\Discovery\UriFactoryDiscovery; |
|
| 28 | -use Http\Discovery\StreamFactoryDiscovery; |
|
| 29 | -use Http\Discovery\MessageFactoryDiscovery; |
|
| 30 | - |
|
| 31 | -use Http\Client\Common\PluginClient; |
|
| 32 | -use Http\Client\Common\Plugin\BaseUriPlugin; |
|
| 33 | -use Http\Client\Common\Plugin\HistoryPlugin; |
|
| 34 | -use Http\Client\Common\Plugin\ContentLengthPlugin; |
|
| 35 | - |
|
| 36 | 11 | use Behapi\Extension\Tools\Debug; |
| 37 | 12 | use Behapi\Extension\Tools\HttpHistory as History; |
| 38 | - |
|
| 39 | 13 | use Behapi\Extension\Cli\DebugController; |
| 40 | 14 | use Behapi\Extension\EventListener\DebugHttp; |
| 41 | 15 | use Behapi\Extension\EventListener\HttpHistory; |
@@ -100,7 +100,7 @@ |
||
| 100 | 100 | ->thenUnset() |
| 101 | 101 | ->end() |
| 102 | 102 | ->validate() |
| 103 | - ->ifTrue(function ($v) { return !is_dir($v); }) |
|
| 103 | + ->ifTrue(function($v) { return !is_dir($v); }) |
|
| 104 | 104 | ->thenInvalid('Directory does not exist') |
| 105 | 105 | ->end() |
| 106 | 106 | ->end() |
@@ -3,13 +3,10 @@ |
||
| 3 | 3 | |
| 4 | 4 | use Symfony\Component\Console\Command\Command; |
| 5 | 5 | use Symfony\Component\Console\Output\OutputInterface; |
| 6 | - |
|
| 7 | 6 | use Symfony\Component\Console\Input\InputOption; |
| 8 | 7 | use Symfony\Component\Console\Input\InputInterface; |
| 9 | - |
|
| 10 | 8 | use Behat\Testwork\Cli\Controller; |
| 11 | 9 | use Behat\Testwork\Output\OutputManager; |
| 12 | - |
|
| 13 | 10 | use Behapi\Extension\Tools\Debug; |
| 14 | 11 | |
| 15 | 12 | final class DebugController implements Controller |
@@ -3,30 +3,21 @@ |
||
| 3 | 3 | |
| 4 | 4 | use Twig_Environment; |
| 5 | 5 | use Twig_Loader_Array; |
| 6 | - |
|
| 7 | -use Psr\Http\Message\UriInterface; |
|
| 8 | 6 | use Interop\Container\ContainerInterface; |
| 9 | - |
|
| 10 | -use Http\Message\UriFactory; |
|
| 11 | 7 | use Http\Message\StreamFactory; |
| 12 | 8 | use Http\Message\MessageFactory; |
| 13 | - |
|
| 14 | 9 | use Http\Discovery\HttpClientDiscovery; |
| 15 | 10 | use Http\Discovery\UriFactoryDiscovery; |
| 16 | 11 | use Http\Discovery\StreamFactoryDiscovery; |
| 17 | 12 | use Http\Discovery\MessageFactoryDiscovery; |
| 18 | - |
|
| 19 | 13 | use Http\Client\HttpClient; |
| 20 | 14 | use Http\Client\Common\PluginClient; |
| 21 | 15 | use Http\Client\Common\Plugin\BaseUriPlugin; |
| 22 | 16 | use Http\Client\Common\Plugin\HistoryPlugin; |
| 23 | 17 | use Http\Client\Common\Plugin\ContentLengthPlugin; |
| 24 | - |
|
| 25 | 18 | use Behapi\Extension\Tools\Debug; |
| 26 | 19 | use Behapi\Extension\Tools\HttpHistory; |
| 27 | - |
|
| 28 | 20 | use Behapi\Extension\ServiceContainer\NotFoundException; |
| 29 | -use Behapi\Extension\ServiceContainer\ServiceNotAvailableException; |
|
| 30 | 21 | |
| 31 | 22 | class Container implements ContainerInterface |
| 32 | 23 | { |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | return $this->services[$id]; |
| 79 | 79 | } |
| 80 | 80 | |
| 81 | - switch($id) { |
|
| 81 | + switch ($id) { |
|
| 82 | 82 | case 'http.history': |
| 83 | 83 | return $this->history; |
| 84 | 84 | |
@@ -124,7 +124,7 @@ discard block |
||
| 124 | 124 | return $this->services['http.stream_factory'] = StreamFactoryDiscovery::find(); |
| 125 | 125 | } |
| 126 | 126 | |
| 127 | - private function getTwigService(): ?Twig_Environment |
|
| 127 | + private function getTwigService(): ? Twig_Environment |
|
| 128 | 128 | { |
| 129 | 129 | if (!class_exists(Twig_Environment::class)) { |
| 130 | 130 | return $this->services['twig'] = null; |
@@ -3,20 +3,15 @@ |
||
| 3 | 3 | |
| 4 | 4 | use Psr\Http\Message\RequestInterface; |
| 5 | 5 | use Psr\Http\Message\ResponseInterface; |
| 6 | - |
|
| 7 | 6 | use Symfony\Component\EventDispatcher\EventSubscriberInterface; |
| 8 | - |
|
| 9 | 7 | use Behat\Testwork\Tester\Result\TestResult; |
| 10 | 8 | use Behat\Testwork\Tester\Result\TestResults; |
| 11 | 9 | use Behat\Testwork\EventDispatcher\Event\AfterTested; |
| 12 | - |
|
| 13 | 10 | use Behat\Behat\EventDispatcher\Event\OutlineTested; |
| 14 | 11 | use Behat\Behat\EventDispatcher\Event\ScenarioTested; |
| 15 | 12 | use Behat\Behat\EventDispatcher\Event\BackgroundTested; |
| 16 | 13 | use Behat\Behat\EventDispatcher\Event\GherkinNodeTested; |
| 17 | - |
|
| 18 | 14 | use Behat\Gherkin\Node\TaggedNodeInterface; |
| 19 | - |
|
| 20 | 15 | use Behapi\Extension\Tools\Debug; |
| 21 | 16 | use Behapi\Extension\Tools\HttpHistory; |
| 22 | 17 | |
@@ -118,7 +118,7 @@ |
||
| 118 | 118 | } |
| 119 | 119 | } |
| 120 | 120 | |
| 121 | - private function debug(?RequestInterface $request, ?ResponseInterface $response): void |
|
| 121 | + private function debug(? RequestInterface $request, ? ResponseInterface $response) : void |
|
| 122 | 122 | { |
| 123 | 123 | if (!$request instanceof RequestInterface) { |
| 124 | 124 | return; |
@@ -52,7 +52,7 @@ |
||
| 52 | 52 | reset($this->tuples); |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | - public function getLastResponse(): ?ResponseInterface |
|
| 55 | + public function getLastResponse(): ? ResponseInterface |
|
| 56 | 56 | { |
| 57 | 57 | if (1 > count($this->tuples)) { |
| 58 | 58 | return null; |