Skip to content

Commit

Permalink
Merge pull request #6 from claudiodekker/align-codestyle-laravel
Browse files Browse the repository at this point in the history
Align codestyle to Laravel's
  • Loading branch information
ajaaleixo authored Feb 11, 2020
2 parents 2e4d316 + b9f70d7 commit 859c498
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 34 deletions.
3 changes: 1 addition & 2 deletions resources/config/laravel-phraseapp-client.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

return [


/*
* Master switch to enable or disable the prasheapp client.
* Default is true
Expand Down Expand Up @@ -82,4 +81,4 @@
*/
'sleep' => 1,
],
];
];
1 change: 0 additions & 1 deletion src/Client/PhraseAppClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ public function __construct(
float $timeout = 5.0,
string $format = 'laravel'
) {

$this->withProject($projectId);
$this->withAuthorization($apiKey);
$this->withIdentification($identification);
Expand Down
6 changes: 3 additions & 3 deletions src/Commands/DownloadCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ public function handle()
$tags = $this->config->get('laravel-phraseapp.tags');
$seconds = $this->config->get('laravel-phraseapp.api.sleep');

if (!$enabled) {
if (! $enabled) {
$this->warn('laravel-phraseapp not enabled! Check config!');

return;
}

Expand All @@ -45,7 +46,6 @@ public function handle()
// Fetch translation per tag per locale
foreach ($locales as $locale) {
foreach ($tags as $tag) {

$this->info(sprintf('Fetching [%s] [tag:%s]', $locale, $tag));

$content = $client->downloadLocale($locale, $tag);
Expand Down Expand Up @@ -80,4 +80,4 @@ protected function makeClient():PhraseAppClient
$this->config->get('laravel-phraseapp.api.format', 'laravel')
);
}
}
}
2 changes: 1 addition & 1 deletion src/Exceptions/PhraseAppRequestException.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
class PhraseAppRequestException extends \Exception
{
// void as intended
}
}
4 changes: 2 additions & 2 deletions src/PhraseAppServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace Ajaaleixo\PhraseApp;

use Illuminate\Support\ServiceProvider;
use Ajaaleixo\PhraseApp\Commands\DownloadCommand;
use Illuminate\Support\ServiceProvider;

class PhraseAppServiceProvider extends ServiceProvider
{
Expand All @@ -24,4 +24,4 @@ public function register()
{
$this->mergeConfigFrom(__DIR__.'/../resources/config/laravel-phraseapp-client.php', 'laravel-phraseapp');
}
}
}
36 changes: 18 additions & 18 deletions tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,25 +29,25 @@ protected function makeMockLocalesList()
{
return [
[
"id" => "abcd1234cdef1234abcd1234cdef1234",
"name" => "de",
"code" => "de-DE",
"default" => true,
"main" => false,
"rtl" => false,
"plural_forms" => [
"zero",
"one",
"other"
'id' => 'abcd1234cdef1234abcd1234cdef1234',
'name' => 'de',
'code' => 'de-DE',
'default' => true,
'main' => false,
'rtl' => false,
'plural_forms' => [
'zero',
'one',
'other',
],
"source_locale" => [
"id" => "abcd1234cdef1234abcd1234cdef1234",
"name" => "en",
"code" => "en-GB"
'source_locale' => [
'id' => 'abcd1234cdef1234abcd1234cdef1234',
'name' => 'en',
'code' => 'en-GB',
],
"created_at" => "2015-01-28T09:52:53Z",
"updated_at" => "2015-01-28T09:52:53Z",
]
'created_at' => '2015-01-28T09:52:53Z',
'updated_at' => '2015-01-28T09:52:53Z',
],
];
}
}
}
4 changes: 2 additions & 2 deletions tests/Unit/Client/PhraseAppClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public function testCanFetchLocales()

$this->assertEquals($localesExpectedList, $result);
}

public function testClientCanBeInitializedWithoutIdentificationAndTimeout()
{
$projectId = 'xpto';
Expand Down Expand Up @@ -76,4 +76,4 @@ protected function getDefaultHeadersAfterConstructorWithKey($apiKey)
'Authorization' => sprintf('token %s', $apiKey),
];
}
}
}
6 changes: 1 addition & 5 deletions tests/Unit/Commands/UpdateCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,11 @@
namespace Tests\Unit\Commands;

use Tests\TestCase;
use Tests\Unit\Client\PhraseAppClientTest;
use Ajaaleixo\PhraseApp\Client\PhraseAppClient;

class UpdateCommandTest extends TestCase
{
public function testUpdateLocaleFiles()
{


//
}

}

0 comments on commit 859c498

Please sign in to comment.