Skip to content

Commit

Permalink
Merge pull request #1 from schulzefelix/analysis-8mglOD
Browse files Browse the repository at this point in the history
Apply fixes from StyleCI
  • Loading branch information
schulzefelix authored Jul 31, 2017
2 parents 144c46e + e7f2ab1 commit 34e88ff
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/BigQueryClientFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public static function createForConfig(array $bigQueryConfig): BigQueryClient
$clientConfig = array_merge([
'projectId' => $bigQueryConfig['project_id'],
'keyFilePath' => $bigQueryConfig['application_credentials'],
'authCache' => self::configureCache($bigQueryConfig['auth_cache_store'])
'authCache' => self::configureCache($bigQueryConfig['auth_cache_store']),
], array_get($bigQueryConfig, 'client_options', []));

return new BigQueryClient($clientConfig);
Expand Down
6 changes: 2 additions & 4 deletions src/BigQueryServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace SchulzeFelix\BigQuery;

use Google\Cloud\BigQuery\BigQueryClient;
use Illuminate\Support\ServiceProvider;
use Google\Cloud\BigQuery\BigQueryClient;
use SchulzeFelix\BigQuery\Exceptions\InvalidConfiguration;

class BigQueryServiceProvider extends ServiceProvider
Expand Down Expand Up @@ -33,19 +33,17 @@ public function register()

$this->app->bind(BigQueryClient::class, function () use ($bigQueryConfig) {
$this->guardAgainstInvalidConfiguration($bigQueryConfig);

return BigQueryClientFactory::createForConfig($bigQueryConfig);
});

$this->app->alias(BigQueryClient::class, 'bigquery');

}

protected function guardAgainstInvalidConfiguration(array $bigQueryConfig = null)
{
if (! file_exists($bigQueryConfig['application_credentials'])) {
throw InvalidConfiguration::credentialsJsonDoesNotExist($bigQueryConfig['application_credentials']);
}

}

}
2 changes: 1 addition & 1 deletion src/config/bigquery.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,4 @@
'client_options' => [
'retries' => 3, // Default
],
];
];
4 changes: 2 additions & 2 deletions tests/Integration/BigQueryServiceProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use SchulzeFelix\BigQuery\Exceptions\InvalidConfiguration;

class AnalyticsServiceProviderTest extends TestCase
class BigQueryServiceProviderTest extends TestCase
{
/** @test */
public function it_will_throw_an_exception_if_credentials_file_is_not_given()
Expand All @@ -13,4 +13,4 @@ public function it_will_throw_an_exception_if_credentials_file_is_not_given()

\BigQuery::bytes('hello world');
}
}
}
4 changes: 2 additions & 2 deletions tests/Integration/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
namespace SchulzeFelix\BigQuery\Tests\Integration;

use SchulzeFelix\BigQuery\BigQueryFacade;
use SchulzeFelix\BigQuery\BigQueryServiceProvider;
use Orchestra\Testbench\TestCase as Orchestra;
use SchulzeFelix\BigQuery\BigQueryServiceProvider;

abstract class TestCase extends Orchestra
{
Expand Down Expand Up @@ -36,4 +36,4 @@ protected function getPackageAliases($app)
'BigQuery' => BigQueryFacade::class,
];
}
}
}

0 comments on commit 34e88ff

Please sign in to comment.