@@ -32,10 +32,9 @@ |
||
32 | 32 | |
33 | 33 | namespace OrgHeiglHybridAuth; |
34 | 34 | |
35 | -use Zend\ModuleManager\ModuleManager, |
|
36 | - Zend\EventManager\StaticEventManager, |
|
37 | - Zend\Mvc\ModuleRouteListener; |
|
38 | -use OrgHeiglHybridAuth\View\Helper\HybridAuth as HybridAuthViewManager; |
|
35 | +use Zend\ModuleManager\ModuleManager; |
|
36 | +use Zend\EventManager\StaticEventManager; |
|
37 | +use Zend\Mvc\ModuleRouteListener; |
|
39 | 38 | |
40 | 39 | |
41 | 40 | /** |
@@ -75,9 +75,9 @@ discard block |
||
75 | 75 | public function onBootstrap($e) |
76 | 76 | { |
77 | 77 | // $e->getApplication()->getServiceManager()->get('translator'); |
78 | - $eventManager = $e->getApplication()->getEventManager(); |
|
79 | - $moduleRouteListener = new ModuleRouteListener(); |
|
80 | - $moduleRouteListener->attach($eventManager); |
|
78 | + $eventManager = $e->getApplication()->getEventManager(); |
|
79 | + $moduleRouteListener = new ModuleRouteListener(); |
|
80 | + $moduleRouteListener->attach($eventManager); |
|
81 | 81 | |
82 | 82 | $servicemanager = $e->getApplication()->getServiceManager(); |
83 | 83 | $helperManager = $servicemanager->get('ViewHelperManager'); |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | |
91 | 91 | public function getConfig() |
92 | 92 | { |
93 | - return include __DIR__ . '/config/module.config.php'; |
|
93 | + return include __DIR__ . '/config/module.config.php'; |
|
94 | 94 | } |
95 | 95 | |
96 | 96 | public function getAutoloaderConfig() |
@@ -32,7 +32,7 @@ |
||
32 | 32 | |
33 | 33 | return array('OrgHeiglHybridAuth' => array( |
34 | 34 | 'hybrid_auth' => array( |
35 | - // 'base_url' => 'http://example.com/auth/backend', |
|
35 | + // 'base_url' => 'http://example.com/auth/backend', |
|
36 | 36 | 'providers' => array( |
37 | 37 | 'Twitter' => array('enabled' => false, 'keys' => array('key' => '', 'secret' => '')), |
38 | 38 | ), |
@@ -31,7 +31,6 @@ |
||
31 | 31 | |
32 | 32 | namespace OrgHeiglHybridAuth; |
33 | 33 | |
34 | -use Hybridauth\Entity\Profile; |
|
35 | 34 | use OrgHeiglHybridAuth\UserInterface; |
36 | 35 | use SocialConnect\Common\Entity\User; |
37 | 36 |
@@ -107,11 +107,11 @@ |
||
107 | 107 | return $this->user->fullname; |
108 | 108 | } |
109 | 109 | |
110 | - if (! $this->user->firstname && ! $this->user->lastname) { |
|
110 | + if (!$this->user->firstname && !$this->user->lastname) { |
|
111 | 111 | return $this->user->username; |
112 | 112 | } |
113 | 113 | |
114 | - if (! $this->user->firstname) { |
|
114 | + if (!$this->user->firstname) { |
|
115 | 115 | return $this->user->lastname; |
116 | 116 | } |
117 | 117 |
@@ -65,7 +65,6 @@ |
||
65 | 65 | /** |
66 | 66 | * Set the user-object |
67 | 67 | * |
68 | - * @param HybridAuthUserWrapper $userProfile The userprofile to use |
|
69 | 68 | * |
70 | 69 | * @return UserToken |
71 | 70 | */ |
@@ -156,7 +156,7 @@ |
||
156 | 156 | */ |
157 | 157 | public function isAuthenticated() |
158 | 158 | { |
159 | - if (! $this->getService()) { |
|
159 | + if (!$this->getService()) { |
|
160 | 160 | return false; |
161 | 161 | } |
162 | 162 |
@@ -80,7 +80,7 @@ |
||
80 | 80 | |
81 | 81 | $userToken = new UserToken(); |
82 | 82 | $userToken->setService($service) |
83 | - ->setUser($user); |
|
83 | + ->setUser($user); |
|
84 | 84 | |
85 | 85 | return $userToken; |
86 | 86 | } |
@@ -67,8 +67,8 @@ |
||
67 | 67 | |
68 | 68 | $controller = new IndexController(); |
69 | 69 | $controller->setSession($session) |
70 | - ->setAuthenticator($authenticator) |
|
71 | - ->setUserWrapperFactory($wrapperFactory); |
|
70 | + ->setAuthenticator($authenticator) |
|
71 | + ->setUserWrapperFactory($wrapperFactory); |
|
72 | 72 | return $controller; |
73 | 73 | } |
74 | 74 | } |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | $this->config['item'], |
128 | 128 | sprintf( |
129 | 129 | $this->config['link'], |
130 | - (is_string($name)?$name:$backend), |
|
130 | + (is_string($name) ? $name : $backend), |
|
131 | 131 | $link |
132 | 132 | ), |
133 | 133 | $this->config['itemAttribs'] |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | ), |
143 | 143 | sprintf( |
144 | 144 | $this->config['itemlist'], |
145 | - implode("\n",$xhtml), |
|
145 | + implode("\n", $xhtml), |
|
146 | 146 | $this->config['listAttribs'] |
147 | 147 | ) |
148 | 148 | ); |
@@ -44,12 +44,12 @@ |
||
44 | 44 | */ |
45 | 45 | class UserWrapperFactory |
46 | 46 | { |
47 | - /** |
|
48 | - * Create the user-Proxy according to the given User-Object |
|
49 | - * |
|
50 | - * @return UserInterface |
|
51 | - * @throws \UnexpectedValueException |
|
52 | - */ |
|
47 | + /** |
|
48 | + * Create the user-Proxy according to the given User-Object |
|
49 | + * |
|
50 | + * @return UserInterface |
|
51 | + * @throws \UnexpectedValueException |
|
52 | + */ |
|
53 | 53 | public function factory($userObject) |
54 | 54 | { |
55 | 55 | switch (get_class($userObject)) |
@@ -141,14 +141,14 @@ discard block |
||
141 | 141 | */ |
142 | 142 | protected function doRedirect() |
143 | 143 | { |
144 | - if (! $redirect = $this->session->offsetGet('redirect')) { |
|
144 | + if (!$redirect = $this->session->offsetGet('redirect')) { |
|
145 | 145 | $redirect = $this->getEvent()->getRouteMatch()->getParam('redirect'); |
146 | 146 | } |
147 | 147 | |
148 | 148 | $this->session->offsetUnset('redirect'); |
149 | 149 | $redirect = base64_decode($redirect); |
150 | 150 | |
151 | - if (! $redirect) { |
|
151 | + if (!$redirect) { |
|
152 | 152 | $redirect = '/'; |
153 | 153 | } |
154 | 154 | |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | $provider = $this->authenticator->getProvider($providerName); |
176 | 176 | $accessToken = $provider->getAccessTokenByRequestParameters($_GET); |
177 | 177 | |
178 | - if (! $accessToken) { |
|
178 | + if (!$accessToken) { |
|
179 | 179 | $this->session->offsetSet('authenticated', false); |
180 | 180 | $this->session->offsetSet('user', null); |
181 | 181 | $this->session->offsetSet('backend', $providerName); |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | return $this->doRedirect(); |
184 | 184 | } |
185 | 185 | |
186 | - $this->session->offsetSet('authenticated',true); |
|
186 | + $this->session->offsetSet('authenticated', true); |
|
187 | 187 | $this->session->offsetSet('user', $this->userWrapperFactory->factory($provider->getIdentity($accessToken))); |
188 | 188 | $this->session->offsetSet('backend', $providerName); |
189 | 189 |