Skip to content

Commit

Permalink
deprecated manager prop -> prop
Browse files Browse the repository at this point in the history
  • Loading branch information
dp88 committed Dec 8, 2020
1 parent 3b88eeb commit 3da1889
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions src/StorageConnectManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,15 @@ public function adapter($driver)
{
$this->verifyDriver($driver);

return $this->app->make("sts.storage-connect.adapter.$driver");
return $this->container->make("sts.storage-connect.adapter.$driver");
}

/**
* @return string
*/
public function getDefaultDriver()
{
return $this->app['config']['storage-connect.default'];
return $this->container['config']['storage-connect.default'];
}

/**
Expand All @@ -72,10 +72,10 @@ public function getDefaultDriver()
public function isSupportedDriver($driver)
{
return in_array($driver, $this->registered)
&& in_array($driver, $this->app['config']['storage-connect.enabled'])
&& is_array($this->app['config']["services.$driver"])
&& $this->app['config']["services.$driver.client_id"] != null
&& $this->app['config']["services.$driver.client_secret"] != null;
&& in_array($driver, $this->container['config']['storage-connect.enabled'])
&& is_array($this->container['config']["services.$driver"])
&& $this->container['config']["services.$driver.client_id"] != null
&& $this->container['config']["services.$driver.client_secret"] != null;
}

/**
Expand Down Expand Up @@ -169,7 +169,7 @@ public function getState()
*/
public function finish($driver)
{
$props = (array) $this->app['request']->session()->pull('storage-connect');
$props = (array) $this->container['request']->session()->pull('storage-connect');

$storage = Arr::get($props, 'custom') == true
? $this->driver($driver)
Expand All @@ -189,7 +189,7 @@ public function redirectAfterConnect($redirectUrl = null)
{
return new RedirectResponse(
$redirectUrl == null
? $this->app['config']->get('storage-connect.redirect_after_connect')
? $this->container['config']->get('storage-connect.redirect_after_connect')
: $redirectUrl
);
}
Expand All @@ -203,11 +203,11 @@ public function appName()
return $appName;
}

if ($appName = $this->app['config']->get('storage-connect.app_name')) {
if ($appName = $this->container['config']->get('storage-connect.app_name')) {
return $appName;
}

return $this->app['config']->get('app.name');
return $this->container['config']->get('app.name');
}

/**
Expand All @@ -230,15 +230,15 @@ public function __call($method, $parameters)
*/
public function register($name, $abstractClass, $providerClass)
{
$this->app->bind($abstractClass, function($app) use($abstractClass, $name) {
$this->container->bind($abstractClass, function($app) use($abstractClass, $name) {
return new $abstractClass($app['config']->get("services.$name"));
});
$this->app->alias($abstractClass, "sts.storage-connect.adapter.$name");
$this->container->alias($abstractClass, "sts.storage-connect.adapter.$name");

$this->app->bind($providerClass, function($app) use($providerClass, $name) {
$this->container->bind($providerClass, function($app) use($providerClass, $name) {
return new $providerClass($app['config']->get("services.$name"));
});
$this->app->alias($providerClass, "sts.storage-connect.provider.$name");
$this->container->alias($providerClass, "sts.storage-connect.provider.$name");

$this->registered[] = $name;
}
Expand Down

0 comments on commit 3da1889

Please sign in to comment.