Page MenuHomeDevCentral

No OneTemporary

diff --git a/app/Providers/DockerHubServiceProvider.php b/app/Providers/DockerHubServiceProvider.php
index c590007..e7c3020 100644
--- a/app/Providers/DockerHubServiceProvider.php
+++ b/app/Providers/DockerHubServiceProvider.php
@@ -1,50 +1,49 @@
<?php
namespace Nasqueron\Notifications\Providers;
-use Illuminate\Config\Repository;
use Illuminate\Contracts\Foundation\Application;
use Illuminate\Support\ServiceProvider;
use GuzzleHttp\Client;
use Keruald\DockerHub\Build\TriggerBuildFactory;
class DockerHubServiceProvider extends ServiceProvider {
/**
* Bootstraps the application services.
*
* @return void
*/
public function boot() {
}
/**
* Gets the tokens to trigger build for the Docker Hub images.
*
* @param \Illuminate\Contracts\Foundation\Application $app
* @return array
*/
public static function getTokens (Application $app) {
$file = $app->make('config')->get('services.dockerhub.tokens');
$fs = $app->make('filesystem')->disk('local');
if ($fs->exists($file)) {
$content = $fs->get($file);
return json_decode($content, true);
}
return [];
}
/**
* Registers the application services.
*
* @return void
*/
public function register() {
$this->app->singleton('dockerhub', function (Application $app) {
$tokens = DockerHubServiceProvider::getTokens($app);
return new TriggerBuildFactory(new Client, $tokens);
});
}
}

File Metadata

Mime Type
text/x-diff
Expires
Mon, Nov 25, 09:49 (1 d, 13 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2259956
Default Alt Text
(1 KB)

Event Timeline