Apply fixes from StyleCI (#799)

This commit is contained in:
Phan An 2018-08-31 20:47:45 +07:00 committed by GitHub
parent d88dd79f15
commit 40d4174d04
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 11 additions and 10 deletions

View file

@ -4,8 +4,8 @@ namespace App\Services;
use GuzzleHttp\Client;
use GuzzleHttp\Exception\ClientException;
use Illuminate\Log\Logger;
use Illuminate\Contracts\Cache\Repository as Cache;
use Illuminate\Log\Logger;
use InvalidArgumentException;
use SimpleXMLElement;
@ -71,7 +71,7 @@ abstract class ApiClient
} catch (ClientException $e) {
$this->logger->error($e);
return null;
return;
}
}

View file

@ -5,6 +5,8 @@ namespace App\Services;
interface ApiConsumerInterface
{
public function getEndpoint(): ?string;
public function getKey(): ?string;
public function getSecret(): ?string;
}

View file

@ -43,7 +43,7 @@ class YouTubeService extends ApiClient implements ApiConsumerInterface
public function search(string $q, string $pageToken = '', int $perPage = 10)
{
if (!$this->enabled()) {
return null;
return;
}
$uri = sprintf('search?part=snippet&type=video&maxResults=%s&pageToken=%s&q=%s',

View file

@ -3,7 +3,6 @@
namespace Tests;
use App\Models\User;
use Illuminate\Contracts\Console\Kernel as Artisan;
use Illuminate\Foundation\Application;

View file

@ -56,28 +56,28 @@ abstract class TestCase extends BaseTestCase
protected function getAsUser($url, $user = null): self
{
return $this->get($url, [
'Authorization' => 'Bearer ' . $this->generateJwtToken($user),
'Authorization' => 'Bearer '.$this->generateJwtToken($user),
]);
}
protected function deleteAsUser($url, $data = [], $user = null): self
{
return $this->delete($url, $data, [
'Authorization' => 'Bearer ' . $this->generateJwtToken($user),
'Authorization' => 'Bearer '.$this->generateJwtToken($user),
]);
}
protected function postAsUser($url, $data, $user = null): self
{
return $this->post($url, $data, [
'Authorization' => 'Bearer ' . $this->generateJwtToken($user),
'Authorization' => 'Bearer '.$this->generateJwtToken($user),
]);
}
protected function putAsUser($url, $data, $user = null): self
{
return $this->put($url, $data, [
'Authorization' => 'Bearer ' . $this->generateJwtToken($user),
'Authorization' => 'Bearer '.$this->generateJwtToken($user),
]);
}

View file

@ -10,8 +10,8 @@ use App\Services\Streamers\TranscodingStreamer;
use App\Services\Streamers\XAccelRedirectStreamer;
use App\Services\Streamers\XSendFileStreamer;
use App\Services\TranscodingService;
use Tests\TestCase;
use phpmock\mockery\PHPMockery;
use Tests\TestCase;
class StreamerFactoryTest extends TestCase
{

View file

@ -28,7 +28,7 @@ class ApiClientTest extends TestCase
{
parent::setUp();
/**
/*
* @var Client client
* @var Cache cache
* @var Logger logger