@@ -44,6 +44,6 @@ |
||
44 | 44 | |
45 | 45 | parse_str($query, $queryParams); |
46 | 46 | $queryParams = array_diff_key($queryParams, array_flip($stripParams)); |
47 | - return $uri . (empty($queryParams) ? '' : '?' . http_build_query($queryParams)); |
|
47 | + return $uri.(empty($queryParams) ? '' : '?'.http_build_query($queryParams)); |
|
48 | 48 | } |
49 | 49 | } |
@@ -79,13 +79,13 @@ |
||
79 | 79 | |
80 | 80 | /* Set locale */ |
81 | 81 | $translator = $e->getApplication()->getServiceManager()->get('mvctranslator'); |
82 | - $locale = $lang . '_' . strtoupper($lang); |
|
82 | + $locale = $lang.'_'.strtoupper($lang); |
|
83 | 83 | |
84 | 84 | setlocale( |
85 | 85 | LC_ALL, |
86 | 86 | array( |
87 | - $locale . ".utf8", |
|
88 | - $locale . ".iso88591", |
|
87 | + $locale.".utf8", |
|
88 | + $locale.".iso88591", |
|
89 | 89 | $locale, |
90 | 90 | substr($locale, 0, 2), |
91 | 91 | 'de_DE.utf8', |
@@ -93,8 +93,8 @@ |
||
93 | 93 | // Create a file with the class/file map. |
94 | 94 | // Stupid syntax highlighters make separating < from PHP declaration necessary |
95 | 95 | $content = '<' . "?php\n" |
96 | - . "\n" |
|
97 | - . 'return ' . var_export($config, true) . ';'; |
|
96 | + . "\n" |
|
97 | + . 'return ' . var_export($config, true) . ';'; |
|
98 | 98 | |
99 | 99 | // Fix \' strings from injected DIRECTORY_SEPARATOR usage in iterator_apply op |
100 | 100 | $content = str_replace("\\'", "'", $content); |
@@ -92,9 +92,9 @@ discard block |
||
92 | 92 | |
93 | 93 | // Create a file with the class/file map. |
94 | 94 | // Stupid syntax highlighters make separating < from PHP declaration necessary |
95 | - $content = '<' . "?php\n" |
|
95 | + $content = '<'."?php\n" |
|
96 | 96 | . "\n" |
97 | - . 'return ' . var_export($config, true) . ';'; |
|
97 | + . 'return '.var_export($config, true).';'; |
|
98 | 98 | |
99 | 99 | // Fix \' strings from injected DIRECTORY_SEPARATOR usage in iterator_apply op |
100 | 100 | $content = str_replace("\\'", "'", $content); |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | $content = str_replace('array (', 'array(', $content); |
108 | 108 | |
109 | 109 | // Make the file end by EOL |
110 | - $content = rtrim($content, "\n") . "\n"; |
|
110 | + $content = rtrim($content, "\n")."\n"; |
|
111 | 111 | |
112 | 112 | var_export($config, true); |
113 | 113 |
@@ -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 | } |
@@ -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 | } |
@@ -61,14 +61,14 @@ |
||
61 | 61 | return $this->useDefaultValidation ? \Laminas\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 | } |
@@ -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()) { |
@@ -28,66 +28,66 @@ discard block |
||
28 | 28 | */ |
29 | 29 | class ManageController extends AbstractActionController |
30 | 30 | { |
31 | - private $userProfileContainer; |
|
31 | + private $userProfileContainer; |
|
32 | 32 | |
33 | - private $authService; |
|
33 | + private $authService; |
|
34 | 34 | |
35 | - private $socialProfileForm; |
|
35 | + private $socialProfileForm; |
|
36 | 36 | |
37 | - private $translator; |
|
37 | + private $translator; |
|
38 | 38 | |
39 | - private $repositories; |
|
39 | + private $repositories; |
|
40 | 40 | |
41 | - private $viewHelper; |
|
41 | + private $viewHelper; |
|
42 | 42 | |
43 | - private $hybridAuthAdapter; |
|
43 | + private $hybridAuthAdapter; |
|
44 | 44 | |
45 | - /** |
|
46 | - * @param ContainerInterface $container |
|
47 | - * @return ManageController |
|
48 | - */ |
|
49 | - static public function factory(ContainerInterface $container) |
|
50 | - { |
|
51 | - $forms = $container->get('forms'); |
|
52 | - $userProfileContainer = $forms->get('Auth/UserProfileContainer'); |
|
53 | - $socialProfileForm = $forms->get('Auth/SocialProfiles'); |
|
54 | - $authService = $container->get('AuthenticationService'); |
|
55 | - $translator = $container->get('translator'); |
|
56 | - $repositories = $container->get('repositories'); |
|
57 | - $viewHelper = $container->get('ViewHelperManager'); |
|
58 | - $hybridAuthAdapter = $container->get('HybridAuthAdapter'); |
|
59 | - $controller = new ManageController( |
|
60 | - $userProfileContainer, |
|
61 | - $authService, |
|
62 | - $repositories, |
|
63 | - $socialProfileForm, |
|
64 | - $translator, |
|
65 | - $viewHelper, |
|
66 | - $hybridAuthAdapter |
|
67 | - ); |
|
68 | - return $controller; |
|
69 | - } |
|
45 | + /** |
|
46 | + * @param ContainerInterface $container |
|
47 | + * @return ManageController |
|
48 | + */ |
|
49 | + static public function factory(ContainerInterface $container) |
|
50 | + { |
|
51 | + $forms = $container->get('forms'); |
|
52 | + $userProfileContainer = $forms->get('Auth/UserProfileContainer'); |
|
53 | + $socialProfileForm = $forms->get('Auth/SocialProfiles'); |
|
54 | + $authService = $container->get('AuthenticationService'); |
|
55 | + $translator = $container->get('translator'); |
|
56 | + $repositories = $container->get('repositories'); |
|
57 | + $viewHelper = $container->get('ViewHelperManager'); |
|
58 | + $hybridAuthAdapter = $container->get('HybridAuthAdapter'); |
|
59 | + $controller = new ManageController( |
|
60 | + $userProfileContainer, |
|
61 | + $authService, |
|
62 | + $repositories, |
|
63 | + $socialProfileForm, |
|
64 | + $translator, |
|
65 | + $viewHelper, |
|
66 | + $hybridAuthAdapter |
|
67 | + ); |
|
68 | + return $controller; |
|
69 | + } |
|
70 | 70 | |
71 | - public function __construct( |
|
72 | - UserProfileContainer $userProfileContainer, |
|
73 | - AuthenticationService $authService, |
|
74 | - RepositoryService $repositories, |
|
75 | - SocialProfiles $socialProfileForm, |
|
76 | - Translator $translator, |
|
77 | - HelperPluginManager $viewHelper, |
|
78 | - HybridAuth $hybridAuthAdapter |
|
79 | - ) |
|
80 | - { |
|
81 | - $this->userProfileContainer = $userProfileContainer; |
|
82 | - $this->authService = $authService; |
|
83 | - $this->socialProfileForm = $socialProfileForm; |
|
84 | - $this->repositories = $repositories; |
|
85 | - $this->translator = $translator; |
|
86 | - $this->viewHelper = $viewHelper; |
|
87 | - $this->hybridAuthAdapter = $hybridAuthAdapter; |
|
88 | - } |
|
71 | + public function __construct( |
|
72 | + UserProfileContainer $userProfileContainer, |
|
73 | + AuthenticationService $authService, |
|
74 | + RepositoryService $repositories, |
|
75 | + SocialProfiles $socialProfileForm, |
|
76 | + Translator $translator, |
|
77 | + HelperPluginManager $viewHelper, |
|
78 | + HybridAuth $hybridAuthAdapter |
|
79 | + ) |
|
80 | + { |
|
81 | + $this->userProfileContainer = $userProfileContainer; |
|
82 | + $this->authService = $authService; |
|
83 | + $this->socialProfileForm = $socialProfileForm; |
|
84 | + $this->repositories = $repositories; |
|
85 | + $this->translator = $translator; |
|
86 | + $this->viewHelper = $viewHelper; |
|
87 | + $this->hybridAuthAdapter = $hybridAuthAdapter; |
|
88 | + } |
|
89 | 89 | |
90 | - /** |
|
90 | + /** |
|
91 | 91 | * @return array|JsonModel |
92 | 92 | */ |
93 | 93 | public function profileAction() |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | $postData = $form->getOption('use_post_array') ? $_POST : array(); |
122 | 122 | //@TODO: [ZF3] option use_files_array is false by default |
123 | 123 | //$filesData = $form->getOption('use_files_array') ? $_FILES : array(); |
124 | - $filesData = $_FILES; |
|
124 | + $filesData = $_FILES; |
|
125 | 125 | $data = array_merge($postData, $filesData); |
126 | 126 | $form->setData($data); |
127 | 127 |
@@ -95,11 +95,11 @@ discard block |
||
95 | 95 | /* @var \Auth\Form\UserProfileContainer $userProfileContainer */ |
96 | 96 | $userProfileContainer = $this->userProfileContainer; |
97 | 97 | $user = $this->authService->getUser(); /* @var $user \Auth\Entity\User */ |
98 | - $postProfiles = (array)$this->params()->fromPost('social_profiles'); |
|
98 | + $postProfiles = (array) $this->params()->fromPost('social_profiles'); |
|
99 | 99 | $userProfiles = $user->getProfile(); |
100 | 100 | $formSocialProfiles = $this->socialProfileForm |
101 | 101 | ->setUseDefaultValidation(true) |
102 | - ->setData(['social_profiles' => array_map(function ($array) |
|
102 | + ->setData(['social_profiles' => array_map(function($array) |
|
103 | 103 | { |
104 | 104 | return $array['data']; |
105 | 105 | }, $userProfiles)]); |
@@ -118,11 +118,11 @@ discard block |
||
118 | 118 | $form = $userProfileContainer->getForm($formName); |
119 | 119 | |
120 | 120 | if ($form) { |
121 | - $postData = $form->getOption('use_post_array') ? $_POST : array(); |
|
121 | + $postData = $form->getOption('use_post_array') ? $_POST : array(); |
|
122 | 122 | //@TODO: [ZF3] option use_files_array is false by default |
123 | 123 | //$filesData = $form->getOption('use_files_array') ? $_FILES : array(); |
124 | 124 | $filesData = $_FILES; |
125 | - $data = array_merge($postData, $filesData); |
|
125 | + $data = array_merge($postData, $filesData); |
|
126 | 126 | $form->setData($data); |
127 | 127 | |
128 | 128 | if (!$form->isValid()) { |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | )); |
184 | 184 | } else { |
185 | 185 | $profile = [ |
186 | - 'auth' => (array)$authProfile, |
|
186 | + 'auth' => (array) $authProfile, |
|
187 | 187 | 'data' => \Laminas\Json\Json::decode($dataProfiles[$network]) |
188 | 188 | ]; |
189 | 189 | $user->addProfile($network, $profile); |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | } |
194 | 194 | |
195 | 195 | // keep data in sync & properly decoded |
196 | - $formSocialProfiles->setData(['social_profiles' => array_map(function ($array) |
|
196 | + $formSocialProfiles->setData(['social_profiles' => array_map(function($array) |
|
197 | 197 | { |
198 | 198 | return \Laminas\Json\Json::decode($array) ?: ''; |
199 | 199 | }, $dataProfiles)]); |
@@ -33,7 +33,7 @@ |
||
33 | 33 | ]; |
34 | 34 | |
35 | 35 | // do nothing for allowed routes |
36 | - if (in_array($routeName, $allowedRoutes)) |
|
36 | + if (in_array($routeName, $allowedRoutes)) |
|
37 | 37 | { |
38 | 38 | return; |
39 | 39 | } |
@@ -53,10 +53,10 @@ |
||
53 | 53 | public function __construct($status = self::ACTIVE) |
54 | 54 | { |
55 | 55 | if (!isset(static::$orderMap[$status])) { |
56 | - throw new \DomainException('Unknown status: ' . $status); |
|
56 | + throw new \DomainException('Unknown status: '.$status); |
|
57 | 57 | } |
58 | 58 | |
59 | - $constant = 'self::' . strtoupper($status); |
|
59 | + $constant = 'self::'.strtoupper($status); |
|
60 | 60 | $this->name = constant($constant); |
61 | 61 | $this->order = $this->getOrder(); |
62 | 62 | } |
@@ -84,9 +84,9 @@ |
||
84 | 84 | $imageStrategy = $infoContainer->getForm('info.image') |
85 | 85 | ->getHydrator() |
86 | 86 | ->getStrategy('image'); |
87 | - $fileEntity = $imageStrategy->getFileEntity(); |
|
88 | - $fileEntity->setUser($user); |
|
89 | - $imageStrategy->setFileEntity($fileEntity); |
|
87 | + $fileEntity = $imageStrategy->getFileEntity(); |
|
88 | + $fileEntity->setUser($user); |
|
89 | + $imageStrategy->setFileEntity($fileEntity); |
|
90 | 90 | |
91 | 91 | if ($this->request->isPost()) { |
92 | 92 | $formName = $params->fromQuery('form'); |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | /** |
41 | 41 | * @param UserRepository $userRepository |
42 | 42 | */ |
43 | - public function __construct(UserRepository $userRepository,$formManager,$viewHelper) |
|
43 | + public function __construct(UserRepository $userRepository, $formManager, $viewHelper) |
|
44 | 44 | { |
45 | 45 | $this->userRepository = $userRepository; |
46 | 46 | $this->formManager = $formManager; |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | } |
187 | 187 | |
188 | 188 | $switcher = $this->plugin('Auth/User/Switcher'); |
189 | - $success = $switcher($this->params()->fromQuery('id'), [ 'ref' => urldecode($this->params()->fromQuery('ref')) ]); |
|
189 | + $success = $switcher($this->params()->fromQuery('id'), ['ref' => urldecode($this->params()->fromQuery('ref'))]); |
|
190 | 190 | |
191 | 191 | return new JsonModel(['success' => true]); |
192 | 192 | } |