@@ -22,7 +22,7 @@ |
||
| 22 | 22 | $configuration = new Configuration(); |
| 23 | 23 | $config = $this->processConfiguration($configuration, $configs); |
| 24 | 24 | |
| 25 | - $loader = new Loader\PhpFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); |
|
| 25 | + $loader = new Loader\PhpFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config')); |
|
| 26 | 26 | $loader->load('services.php'); |
| 27 | 27 | |
| 28 | 28 | $container->setParameter('wanna_speak.api.account_id', $config['api']['credentials']['account_id']); |
@@ -4,7 +4,7 @@ discard block |
||
| 4 | 4 | |
| 5 | 5 | use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; |
| 6 | 6 | |
| 7 | -return static function (ContainerConfigurator $containerConfigurator): void { |
|
| 7 | +return static function(ContainerConfigurator $containerConfigurator): void { |
|
| 8 | 8 | $services = $containerConfigurator->services(); |
| 9 | 9 | |
| 10 | 10 | $services->defaults() |
@@ -12,12 +12,12 @@ discard block |
||
| 12 | 12 | ->autowire() |
| 13 | 13 | ->autoconfigure(); |
| 14 | 14 | |
| 15 | - $services->load('Yproximite\WannaSpeakBundle\\', __DIR__.'/../..') |
|
| 15 | + $services->load('Yproximite\WannaSpeakBundle\\', __DIR__ . '/../..') |
|
| 16 | 16 | ->exclude([ |
| 17 | - __DIR__.'/../../DependencyInjection', |
|
| 18 | - __DIR__.'/../../Exception', |
|
| 19 | - __DIR__.'/../../Resources', |
|
| 20 | - __DIR__.'/../../WannaSpeakBundle.php', |
|
| 17 | + __DIR__ . '/../../DependencyInjection', |
|
| 18 | + __DIR__ . '/../../Exception', |
|
| 19 | + __DIR__ . '/../../Resources', |
|
| 20 | + __DIR__ . '/../../WannaSpeakBundle.php', |
|
| 21 | 21 | ]); |
| 22 | 22 | |
| 23 | 23 | $services->get(\Yproximite\WannaSpeakBundle\HttpClient::class) |
@@ -21,21 +21,25 @@ |
||
| 21 | 21 | |
| 22 | 22 | /** |
| 23 | 23 | * @param array<string,mixed> $additionalArguments |
| 24 | + * @return void |
|
| 24 | 25 | */ |
| 25 | 26 | public function add(string $phoneDid, string $phoneDestination, string $name, array $additionalArguments = []): void; |
| 26 | 27 | |
| 27 | 28 | /** |
| 28 | 29 | * @param array<string,mixed> $additionalArguments |
| 30 | + * @return void |
|
| 29 | 31 | */ |
| 30 | 32 | public function modify(string $phoneDid, array $additionalArguments = []): void; |
| 31 | 33 | |
| 32 | 34 | /** |
| 33 | 35 | * @param array<string,mixed> $additionalArguments |
| 36 | + * @return void |
|
| 34 | 37 | */ |
| 35 | 38 | public function delete(string $phoneDid, array $additionalArguments = []): void; |
| 36 | 39 | |
| 37 | 40 | /** |
| 38 | 41 | * @param array<string,mixed> $additionalArguments |
| 42 | + * @return void |
|
| 39 | 43 | */ |
| 40 | 44 | public function expires(string $phoneDid, \DateTimeInterface $dateTime, array $additionalArguments = []): void; |
| 41 | 45 | } |
@@ -283,7 +283,7 @@ |
||
| 283 | 283 | { |
| 284 | 284 | $fieldsAllFound = false; |
| 285 | 285 | |
| 286 | - $client = $this->createHttpClient(static function (string $method, string $url, array $options) use (&$fieldsAllFound) { |
|
| 286 | + $client = $this->createHttpClient(static function(string $method, string $url, array $options) use (&$fieldsAllFound) { |
|
| 287 | 287 | $body = ''; |
| 288 | 288 | while ($part = $options['body']()) { |
| 289 | 289 | $body .= $part; |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | ]); |
| 74 | 74 | |
| 75 | 75 | // Prevent FormDataPart to throw when encountering a non-string value |
| 76 | - $fields = array_reduce(array_keys($fields), function (array $acc, string $fieldKey) use ($fields) { |
|
| 76 | + $fields = array_reduce(array_keys($fields), function(array $acc, string $fieldKey) use ($fields) { |
|
| 77 | 77 | $fieldValue = $fields[$fieldKey]; |
| 78 | 78 | |
| 79 | 79 | if (true === $fieldValue) { |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | { |
| 104 | 104 | $timeStamp = time(); |
| 105 | 105 | |
| 106 | - return $timeStamp.'-'.md5($this->accountId.$timeStamp.$this->secretKey); |
|
| 106 | + return $timeStamp . '-' . md5($this->accountId . $timeStamp . $this->secretKey); |
|
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | /** |
@@ -10,7 +10,6 @@ |
||
| 10 | 10 | interface HttpClientInterface |
| 11 | 11 | { |
| 12 | 12 | /** |
| 13 | - * @param array<string,mixed> $arguments Additional WannaSpeak request arguments |
|
| 14 | 13 | * |
| 15 | 14 | * @throws TestModeException |
| 16 | 15 | */ |
@@ -18,11 +18,13 @@ |
||
| 18 | 18 | /** |
| 19 | 19 | * @param \SplFileInfo|string $file |
| 20 | 20 | * @param array<string,mixed> $additionalArguments |
| 21 | + * @return void |
|
| 21 | 22 | */ |
| 22 | 23 | public function upload($file, string $name, array $additionalArguments = []): void; |
| 23 | 24 | |
| 24 | 25 | /** |
| 25 | 26 | * @param array<string,mixed> $additionalArguments |
| 27 | + * @return void |
|
| 26 | 28 | */ |
| 27 | 29 | public function delete(string $name, array $additionalArguments = []): void; |
| 28 | 30 | } |
@@ -38,14 +38,14 @@ discard block |
||
| 38 | 38 | ->request( |
| 39 | 39 | SoundsInterface::API, |
| 40 | 40 | 'upload', |
| 41 | - Argument::that(function ($args) { |
|
| 41 | + Argument::that(function($args) { |
|
| 42 | 42 | return $args['sound'] instanceof DataPart |
| 43 | 43 | && 'the name' === $args['name']; |
| 44 | 44 | }) |
| 45 | 45 | ) |
| 46 | 46 | ->shouldBeCalled(); |
| 47 | 47 | |
| 48 | - $this->upload(__DIR__.'/../../../../tests/fixtures/callee.mp3', 'the name'); |
|
| 48 | + $this->upload(__DIR__ . '/../../../../tests/fixtures/callee.mp3', 'the name'); |
|
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | public function it_should_upload_from_file(HttpClientInterface $client, ResponseInterface $response) |
@@ -54,14 +54,14 @@ discard block |
||
| 54 | 54 | ->request( |
| 55 | 55 | SoundsInterface::API, |
| 56 | 56 | 'upload', |
| 57 | - Argument::that(function ($args) { |
|
| 57 | + Argument::that(function($args) { |
|
| 58 | 58 | return $args['sound'] instanceof DataPart |
| 59 | 59 | && 'the name' === $args['name']; |
| 60 | 60 | }) |
| 61 | 61 | ) |
| 62 | 62 | ->shouldBeCalled(); |
| 63 | 63 | |
| 64 | - $file = new \SplFileInfo(__DIR__.'/../../../../tests/fixtures/callee.mp3'); |
|
| 64 | + $file = new \SplFileInfo(__DIR__ . '/../../../../tests/fixtures/callee.mp3'); |
|
| 65 | 65 | |
| 66 | 66 | $this->upload($file, 'the name'); |
| 67 | 67 | } |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | )) |
| 94 | 94 | ); |
| 95 | 95 | |
| 96 | - $sounds->upload(__DIR__.'/../fixtures/callee.mp3', 'the name'); |
|
| 96 | + $sounds->upload(__DIR__ . '/../fixtures/callee.mp3', 'the name'); |
|
| 97 | 97 | } |
| 98 | 98 | |
| 99 | 99 | public function testUploadFileAsSplFileInfo(): void |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | )) |
| 113 | 113 | ); |
| 114 | 114 | |
| 115 | - $splFileInfo = new \SplFileInfo(__DIR__.'/../fixtures/callee.mp3'); |
|
| 115 | + $splFileInfo = new \SplFileInfo(__DIR__ . '/../fixtures/callee.mp3'); |
|
| 116 | 116 | |
| 117 | 117 | $sounds->upload($splFileInfo, 'the name'); |
| 118 | 118 | } |