@@ -211,14 +211,14 @@ |
||
| 211 | 211 | { |
| 212 | 212 | return $this->repository; |
| 213 | 213 | } |
| 214 | - /** |
|
| 215 | - * @param SocialProfilePlugin |
|
| 216 | - * @return HybridAuth |
|
| 217 | - */ |
|
| 218 | - public function setSocialProfilePlugin(SocialProfilePlugin $socialProfilePlugin) |
|
| 219 | - { |
|
| 220 | - $this->socialProfilePlugin = $socialProfilePlugin; |
|
| 214 | + /** |
|
| 215 | + * @param SocialProfilePlugin |
|
| 216 | + * @return HybridAuth |
|
| 217 | + */ |
|
| 218 | + public function setSocialProfilePlugin(SocialProfilePlugin $socialProfilePlugin) |
|
| 219 | + { |
|
| 220 | + $this->socialProfilePlugin = $socialProfilePlugin; |
|
| 221 | 221 | |
| 222 | - return $this; |
|
| 223 | - } |
|
| 222 | + return $this; |
|
| 223 | + } |
|
| 224 | 224 | } |
@@ -61,14 +61,14 @@ |
||
| 61 | 61 | return $this->useDefaultValidation ? \Zend\Form\Form::isValid() : parent::isValid(); |
| 62 | 62 | } |
| 63 | 63 | |
| 64 | - /** |
|
| 65 | - * @param bool $bool |
|
| 66 | - * @return SocialProfiles |
|
| 67 | - */ |
|
| 68 | - public function setUseDefaultValidation($bool) |
|
| 69 | - { |
|
| 70 | - $this->useDefaultValidation = (bool)$bool; |
|
| 64 | + /** |
|
| 65 | + * @param bool $bool |
|
| 66 | + * @return SocialProfiles |
|
| 67 | + */ |
|
| 68 | + public function setUseDefaultValidation($bool) |
|
| 69 | + { |
|
| 70 | + $this->useDefaultValidation = (bool)$bool; |
|
| 71 | 71 | |
| 72 | - return $this; |
|
| 73 | - } |
|
| 72 | + return $this; |
|
| 73 | + } |
|
| 74 | 74 | } |
@@ -67,7 +67,7 @@ |
||
| 67 | 67 | */ |
| 68 | 68 | public function setUseDefaultValidation($bool) |
| 69 | 69 | { |
| 70 | - $this->useDefaultValidation = (bool)$bool; |
|
| 70 | + $this->useDefaultValidation = (bool) $bool; |
|
| 71 | 71 | |
| 72 | 72 | return $this; |
| 73 | 73 | } |
@@ -53,7 +53,7 @@ |
||
| 53 | 53 | }, $userProfiles)]); |
| 54 | 54 | |
| 55 | 55 | $translator = $serviceLocator->get('Translator'); |
| 56 | - $formSocialProfiles->getBaseFieldset() |
|
| 56 | + $formSocialProfiles->getBaseFieldset() |
|
| 57 | 57 | ->setOption('description', $translator->translate("you can add your social profile to your application. You can preview and remove the attached profile before submitting the application.")); |
| 58 | 58 | $container->setEntity($user); |
| 59 | 59 | |
@@ -43,11 +43,11 @@ discard block |
||
| 43 | 43 | $forms = $serviceLocator->get('forms'); |
| 44 | 44 | $container = $forms->get('Auth/userprofilecontainer'); |
| 45 | 45 | $user = $serviceLocator->get('AuthenticationService')->getUser(); /* @var $user \Auth\Entity\User */ |
| 46 | - $postProfiles = (array)$this->params()->fromPost('social_profiles'); |
|
| 46 | + $postProfiles = (array) $this->params()->fromPost('social_profiles'); |
|
| 47 | 47 | $userProfiles = $user->getProfile(); |
| 48 | 48 | $formSocialProfiles = $forms->get('Auth/SocialProfiles') |
| 49 | 49 | ->setUseDefaultValidation(true) |
| 50 | - ->setData(['social_profiles' => array_map(function ($array) |
|
| 50 | + ->setData(['social_profiles' => array_map(function($array) |
|
| 51 | 51 | { |
| 52 | 52 | return $array['data']; |
| 53 | 53 | }, $userProfiles)]); |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | )); |
| 127 | 127 | } else { |
| 128 | 128 | $profile = [ |
| 129 | - 'auth' => (array)$authProfile, |
|
| 129 | + 'auth' => (array) $authProfile, |
|
| 130 | 130 | 'data' => \Zend\Json\Json::decode($dataProfiles[$network]) |
| 131 | 131 | ]; |
| 132 | 132 | $user->addProfile($network, $profile); |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | } |
| 137 | 137 | |
| 138 | 138 | // keep data in sync & properly decoded |
| 139 | - $formSocialProfiles->setData(['social_profiles' => array_map(function ($array) |
|
| 139 | + $formSocialProfiles->setData(['social_profiles' => array_map(function($array) |
|
| 140 | 140 | { |
| 141 | 141 | return \Zend\Json\Json::decode($array) ?: ''; |
| 142 | 142 | }, $dataProfiles)]); |
@@ -96,8 +96,7 @@ |
||
| 96 | 96 | 'content' => $content, |
| 97 | 97 | ) |
| 98 | 98 | ); |
| 99 | - } |
|
| 100 | - elseif ($postProfiles) { |
|
| 99 | + } elseif ($postProfiles) { |
|
| 101 | 100 | $formSocialProfiles->setData($this->params()->fromPost()); |
| 102 | 101 | |
| 103 | 102 | if ($formSocialProfiles->isValid()) { |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | */ |
| 88 | 88 | public function findByProfileIdentifier($identifier, $provider) |
| 89 | 89 | { |
| 90 | - return $this->findOneBy(array('profiles.' . $provider . '.auth.identifier' => $identifier)) ?: $this->findOneBy(array('profile.identifier' => $identifier)); |
|
| 90 | + return $this->findOneBy(array('profiles.'.$provider.'.auth.identifier' => $identifier)) ?: $this->findOneBy(array('profile.identifier' => $identifier)); |
|
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | /** |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | $qb->field('_id')->notEqual($curentUserId) |
| 105 | 105 | ->addAnd( |
| 106 | 106 | $qb->expr() |
| 107 | - ->addOr($qb->expr()->field('profiles.' . $provider . '.auth.identifier' )->equals($identifier)) |
|
| 107 | + ->addOr($qb->expr()->field('profiles.'.$provider.'.auth.identifier')->equals($identifier)) |
|
| 108 | 108 | ->addOr($qb->expr()->field('profile.identifier')->equals($identifier)) |
| 109 | 109 | ); |
| 110 | 110 | |
@@ -159,7 +159,7 @@ discard block |
||
| 159 | 159 | return $this->findOneBy( |
| 160 | 160 | array( |
| 161 | 161 | '$or' => array( |
| 162 | - array('login' => $identity . $suffix), |
|
| 162 | + array('login' => $identity.$suffix), |
|
| 163 | 163 | array('info.email' => $identity) |
| 164 | 164 | ) |
| 165 | 165 | ) |
@@ -208,10 +208,10 @@ discard block |
||
| 208 | 208 | public function findByQuery($query) |
| 209 | 209 | { |
| 210 | 210 | $qb = $this->createQueryBuilder(); |
| 211 | - $parts = explode(' ', trim($query)); |
|
| 211 | + $parts = explode(' ', trim($query)); |
|
| 212 | 212 | |
| 213 | 213 | foreach ($parts as $q) { |
| 214 | - $regex = new \MongoRegex('/^' . $query . '/i'); |
|
| 214 | + $regex = new \MongoRegex('/^'.$query.'/i'); |
|
| 215 | 215 | $qb->addOr($qb->expr()->field('info.firstName')->equals($regex)); |
| 216 | 216 | $qb->addOr($qb->expr()->field('info.lastName')->equals($regex)); |
| 217 | 217 | $qb->addOr($qb->expr()->field('info.email')->equals($regex)); |