Skip to content

Commit

Permalink
psr2
Browse files Browse the repository at this point in the history
  • Loading branch information
yuklia committed May 8, 2015
1 parent aaf0e5c commit dbdaada
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 11 deletions.
2 changes: 1 addition & 1 deletion application/configs/default/hybridauth.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@

// to enable logging, set 'debug_mode' to true, then provide here a path of a writable file
"debug_file" =>''
);
);
7 changes: 3 additions & 4 deletions application/models/Auth/AuthInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
*/
namespace Application\Auth;

interface AuthInterface{

interface AuthInterface
{
/**
* @param array $data
* @param \Application\Users\Row $user
Expand Down Expand Up @@ -38,5 +38,4 @@ public function alreadyRegisteredLogic($auth);
* @return array
*/
public function getProfile();

}
}
8 changes: 3 additions & 5 deletions application/models/Auth/AuthProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ class AuthProvider implements AuthInterface
public function __construct($providerName)
{
if (!in_array(ucfirst($providerName), $this->getAvailableProviders())) {

throw new \Exception(sprintf('Provider % is not defined in configuration file', ucfirst($providerName)));
}
$this->providerName = ucfirst($providerName);
Expand All @@ -45,6 +44,7 @@ public function getHybridauth()
if (!$this->hybridauth) {
$this->hybridauth = new \Hybrid_Auth($this->getOptions());
}

return $this->hybridauth;
}

Expand Down Expand Up @@ -109,15 +109,14 @@ public function setProviderName($providerName)
public function getAuthAdapter()
{
if (!$this->authAdapter) {

/** @var \Hybrid_Provider_Adapter $authProvider */
$this->authAdapter = $this->getHybridauth()->authenticate($this->providerName);

if (!$this->authAdapter->isUserConnected()) {
throw new \Exception('Cannot connect to current provider !');
}

}

return $this->authAdapter;
}

Expand Down Expand Up @@ -225,5 +224,4 @@ public function getProfile()
{
return $this->authAdapter->getUserProfile();
}

}
}
3 changes: 2 additions & 1 deletion application/modules/index/controllers/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@
* @namespace
*/
namespace Application;

return
/**
* @var Bootstrap $this
* @return void
*/
function () {
};
};

0 comments on commit dbdaada

Please sign in to comment.