Passed
Pull Request — master (#152)
by
unknown
05:15
created
client/html/src/Client/Html/Account/Profile/Account/Standard.php 3 patches
Indentation   +224 added lines, -224 removed lines patch added patch discarded remove patch
@@ -13,252 +13,252 @@
 block discarded – undo
13 13
  * @subpackage Html
14 14
  */
15 15
 class Standard
16
-    extends \Aimeos\Client\Html\Common\Client\Summary\Base
17
-    implements \Aimeos\Client\Html\Common\Client\Factory\Iface
16
+	extends \Aimeos\Client\Html\Common\Client\Summary\Base
17
+	implements \Aimeos\Client\Html\Common\Client\Factory\Iface
18 18
 {
19 19
 
20
-    /** client/html/account/profile/account/subparts
21
-     * List of HTML sub-clients rendered within the account profile account section
22
-     *
23
-     * The output of the frontend is composed of the code generated by the HTML
24
-     * clients. Each HTML client can consist of serveral (or none) sub-clients
25
-     * that are responsible for rendering certain sub-parts of the output. The
26
-     * sub-clients can contain HTML clients themselves and therefore a
27
-     * hierarchical tree of HTML clients is composed. Each HTML client creates
28
-     * the output that is placed inside the container of its parent.
29
-     *
30
-     * At first, always the HTML code generated by the parent is printed, then
31
-     * the HTML code of its sub-clients. The account of the HTML sub-clients
32
-     * determines the account of the output of these sub-clients inside the parent
33
-     * container. If the configured list of clients is
34
-     *
35
-     *  array( "subclient1", "subclient2" )
36
-     *
37
-     * you can easily change the account of the output by readdressing the subparts:
38
-     *
39
-     *  client/html/<clients>/subparts = array( "subclient1", "subclient2" )
40
-     *
41
-     * You can also remove one or more parts if they shouldn't be rendered:
42
-     *
43
-     *  client/html/<clients>/subparts = array( "subclient1" )
44
-     *
45
-     * As the clients only generates structural HTML, the layout defined via CSS
46
-     * should support adding, removing or readdressing content by a fluid like
47
-     * design.
48
-     *
49
-     * @param array List of sub-client names
50
-     * @since 2019.07
51
-     * @category Developer
52
-     */
53
-    private $subPartPath = 'client/html/account/profile/account/subparts';
54
-    private $subPartNames = [];
20
+	/** client/html/account/profile/account/subparts
21
+	 * List of HTML sub-clients rendered within the account profile account section
22
+	 *
23
+	 * The output of the frontend is composed of the code generated by the HTML
24
+	 * clients. Each HTML client can consist of serveral (or none) sub-clients
25
+	 * that are responsible for rendering certain sub-parts of the output. The
26
+	 * sub-clients can contain HTML clients themselves and therefore a
27
+	 * hierarchical tree of HTML clients is composed. Each HTML client creates
28
+	 * the output that is placed inside the container of its parent.
29
+	 *
30
+	 * At first, always the HTML code generated by the parent is printed, then
31
+	 * the HTML code of its sub-clients. The account of the HTML sub-clients
32
+	 * determines the account of the output of these sub-clients inside the parent
33
+	 * container. If the configured list of clients is
34
+	 *
35
+	 *  array( "subclient1", "subclient2" )
36
+	 *
37
+	 * you can easily change the account of the output by readdressing the subparts:
38
+	 *
39
+	 *  client/html/<clients>/subparts = array( "subclient1", "subclient2" )
40
+	 *
41
+	 * You can also remove one or more parts if they shouldn't be rendered:
42
+	 *
43
+	 *  client/html/<clients>/subparts = array( "subclient1" )
44
+	 *
45
+	 * As the clients only generates structural HTML, the layout defined via CSS
46
+	 * should support adding, removing or readdressing content by a fluid like
47
+	 * design.
48
+	 *
49
+	 * @param array List of sub-client names
50
+	 * @since 2019.07
51
+	 * @category Developer
52
+	 */
53
+	private $subPartPath = 'client/html/account/profile/account/subparts';
54
+	private $subPartNames = [];
55 55
 
56
-    /**
57
-     * Returns the list of sub-client names configured for the client.
58
-     *
59
-     * @return array List of HTML client names
60
-     */
61
-    protected function getSubClientNames() : array
62
-    {
63
-        return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames );
64
-    }
56
+	/**
57
+	 * Returns the list of sub-client names configured for the client.
58
+	 *
59
+	 * @return array List of HTML client names
60
+	 */
61
+	protected function getSubClientNames() : array
62
+	{
63
+		return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames );
64
+	}
65 65
 
66
-    /**
67
-     * Returns the sub-client given by its name.
68
-     *
69
-     * @param string $type Name of the client type
70
-     * @param string|null $name Name of the sub-client (Default if null)
71
-     * @return \Aimeos\Client\Html\Iface Sub-client object
72
-     * @throws \Aimeos\Client\Html\Exception
73
-     */
74
-    public function getSubClient( string $type, string $name = null ) : \Aimeos\Client\Html\Iface
75
-    {
76
-        /** client/html/account/profile/account/decorators/excludes
77
-         * Excludes decorators added by the "common" option from the account profile account html client
78
-         *
79
-         * Decorators extend the functionality of a class by adding new aspects
80
-         * (e.g. log what is currently done), executing the methods of the underlying
81
-         * class only in certain conditions (e.g. only for logged in users) or
82
-         * modify what is returned to the caller.
83
-         *
84
-         * This option allows you to remove a decorator added via
85
-         * "client/html/common/decorators/default" before they are wrapped
86
-         * around the html client.
87
-         *
88
-         *  client/html/account/profile/account/decorators/excludes = array( 'decorator1' )
89
-         *
90
-         * This would remove the decorator named "decorator1" from the list of
91
-         * common decorators ("\Aimeos\Client\Html\Common\Decorator\*") added via
92
-         * "client/html/common/decorators/default" to the html client.
93
-         *
94
-         * @param array List of decorator names
95
-         * @since 2019.07
96
-         * @category Developer
97
-         * @see client/html/common/decorators/default
98
-         * @see client/html/account/profile/account/decorators/global
99
-         * @see client/html/account/profile/account/decorators/local
100
-         */
66
+	/**
67
+	 * Returns the sub-client given by its name.
68
+	 *
69
+	 * @param string $type Name of the client type
70
+	 * @param string|null $name Name of the sub-client (Default if null)
71
+	 * @return \Aimeos\Client\Html\Iface Sub-client object
72
+	 * @throws \Aimeos\Client\Html\Exception
73
+	 */
74
+	public function getSubClient( string $type, string $name = null ) : \Aimeos\Client\Html\Iface
75
+	{
76
+		/** client/html/account/profile/account/decorators/excludes
77
+		 * Excludes decorators added by the "common" option from the account profile account html client
78
+		 *
79
+		 * Decorators extend the functionality of a class by adding new aspects
80
+		 * (e.g. log what is currently done), executing the methods of the underlying
81
+		 * class only in certain conditions (e.g. only for logged in users) or
82
+		 * modify what is returned to the caller.
83
+		 *
84
+		 * This option allows you to remove a decorator added via
85
+		 * "client/html/common/decorators/default" before they are wrapped
86
+		 * around the html client.
87
+		 *
88
+		 *  client/html/account/profile/account/decorators/excludes = array( 'decorator1' )
89
+		 *
90
+		 * This would remove the decorator named "decorator1" from the list of
91
+		 * common decorators ("\Aimeos\Client\Html\Common\Decorator\*") added via
92
+		 * "client/html/common/decorators/default" to the html client.
93
+		 *
94
+		 * @param array List of decorator names
95
+		 * @since 2019.07
96
+		 * @category Developer
97
+		 * @see client/html/common/decorators/default
98
+		 * @see client/html/account/profile/account/decorators/global
99
+		 * @see client/html/account/profile/account/decorators/local
100
+		 */
101 101
 
102
-        /** client/html/account/profile/account/decorators/global
103
-         * Adds a list of globally available decorators only to the account profile account html client
104
-         *
105
-         * Decorators extend the functionality of a class by adding new aspects
106
-         * (e.g. log what is currently done), executing the methods of the underlying
107
-         * class only in certain conditions (e.g. only for logged in users) or
108
-         * modify what is returned to the caller.
109
-         *
110
-         * This option allows you to wrap global decorators
111
-         * ("\Aimeos\Client\Html\Common\Decorator\*") around the html client.
112
-         *
113
-         *  client/html/account/profile/account/decorators/global = array( 'decorator1' )
114
-         *
115
-         * This would add the decorator named "decorator1" defined by
116
-         * "\Aimeos\Client\Html\Common\Decorator\Decorator1" only to the html client.
117
-         *
118
-         * @param array List of decorator names
119
-         * @since 2019.07
120
-         * @category Developer
121
-         * @see client/html/common/decorators/default
122
-         * @see client/html/account/profile/account/decorators/excludes
123
-         * @see client/html/account/profile/account/decorators/local
124
-         */
102
+		/** client/html/account/profile/account/decorators/global
103
+		 * Adds a list of globally available decorators only to the account profile account html client
104
+		 *
105
+		 * Decorators extend the functionality of a class by adding new aspects
106
+		 * (e.g. log what is currently done), executing the methods of the underlying
107
+		 * class only in certain conditions (e.g. only for logged in users) or
108
+		 * modify what is returned to the caller.
109
+		 *
110
+		 * This option allows you to wrap global decorators
111
+		 * ("\Aimeos\Client\Html\Common\Decorator\*") around the html client.
112
+		 *
113
+		 *  client/html/account/profile/account/decorators/global = array( 'decorator1' )
114
+		 *
115
+		 * This would add the decorator named "decorator1" defined by
116
+		 * "\Aimeos\Client\Html\Common\Decorator\Decorator1" only to the html client.
117
+		 *
118
+		 * @param array List of decorator names
119
+		 * @since 2019.07
120
+		 * @category Developer
121
+		 * @see client/html/common/decorators/default
122
+		 * @see client/html/account/profile/account/decorators/excludes
123
+		 * @see client/html/account/profile/account/decorators/local
124
+		 */
125 125
 
126
-        /** client/html/account/profile/account/decorators/local
127
-         * Adds a list of local decorators only to the account profile account html client
128
-         *
129
-         * Decorators extend the functionality of a class by adding new aspects
130
-         * (e.g. log what is currently done), executing the methods of the underlying
131
-         * class only in certain conditions (e.g. only for logged in users) or
132
-         * modify what is returned to the caller.
133
-         *
134
-         * This option allows you to wrap local decorators
135
-         * ("\Aimeos\Client\Html\Account\Decorator\*") around the html client.
136
-         *
137
-         *  client/html/account/profile/account/decorators/local = array( 'decorator2' )
138
-         *
139
-         * This would add the decorator named "decorator2" defined by
140
-         * "\Aimeos\Client\Html\Account\Decorator\Decorator2" only to the html client.
141
-         *
142
-         * @param array List of decorator names
143
-         * @since 2019.07
144
-         * @category Developer
145
-         * @see client/html/common/decorators/default
146
-         * @see client/html/account/profile/account/decorators/excludes
147
-         * @see client/html/account/profile/account/decorators/global
148
-         */
126
+		/** client/html/account/profile/account/decorators/local
127
+		 * Adds a list of local decorators only to the account profile account html client
128
+		 *
129
+		 * Decorators extend the functionality of a class by adding new aspects
130
+		 * (e.g. log what is currently done), executing the methods of the underlying
131
+		 * class only in certain conditions (e.g. only for logged in users) or
132
+		 * modify what is returned to the caller.
133
+		 *
134
+		 * This option allows you to wrap local decorators
135
+		 * ("\Aimeos\Client\Html\Account\Decorator\*") around the html client.
136
+		 *
137
+		 *  client/html/account/profile/account/decorators/local = array( 'decorator2' )
138
+		 *
139
+		 * This would add the decorator named "decorator2" defined by
140
+		 * "\Aimeos\Client\Html\Account\Decorator\Decorator2" only to the html client.
141
+		 *
142
+		 * @param array List of decorator names
143
+		 * @since 2019.07
144
+		 * @category Developer
145
+		 * @see client/html/common/decorators/default
146
+		 * @see client/html/account/profile/account/decorators/excludes
147
+		 * @see client/html/account/profile/account/decorators/global
148
+		 */
149 149
 
150
-        return $this->createSubClient( 'account/profile/account/' . $type, $name );
151
-    }
150
+		return $this->createSubClient( 'account/profile/account/' . $type, $name );
151
+	}
152 152
 
153
-    /**
154
-     * Returns the HTML code for insertion into the body.
155
-     *
156
-     * @param string $uid Unique identifier for the output if the content is placed more than once on the same page
157
-     * @return string HTML code
158
-     * @throws \Aimeos\MW\View\Exception|\Aimeos\Client\Html\Exception
159
-     */
160
-    public function getBody(string $uid = ''): string
161
-    {
162
-        $view = $this->getView();
153
+	/**
154
+	 * Returns the HTML code for insertion into the body.
155
+	 *
156
+	 * @param string $uid Unique identifier for the output if the content is placed more than once on the same page
157
+	 * @return string HTML code
158
+	 * @throws \Aimeos\MW\View\Exception|\Aimeos\Client\Html\Exception
159
+	 */
160
+	public function getBody(string $uid = ''): string
161
+	{
162
+		$view = $this->getView();
163 163
 
164
-        $html = '';
165
-        foreach( $this->getSubClients() as $subclient ) {
166
-            $html .= $subclient->setView( $view )->getBody( $uid );
167
-        }
168
-        $view->accountBody = $html;
164
+		$html = '';
165
+		foreach( $this->getSubClients() as $subclient ) {
166
+			$html .= $subclient->setView( $view )->getBody( $uid );
167
+		}
168
+		$view->accountBody = $html;
169 169
 
170
-        /** client/html/account/profile/account/template-body
171
-         * Relative path to the HTML body template of the account profile account client.
172
-         *
173
-         * The template file contains the HTML code and processing instructions
174
-         * to generate the result shown in the body of the frontend. The
175
-         * configuration string is the path to the template file relative
176
-         * to the templates directory (usually in client/html/templates).
177
-         *
178
-         * You can overwrite the template file configuration in extensions and
179
-         * provide alternative templates. These alternative templates should be
180
-         * named like the default one but with the string "standard" replaced by
181
-         * an unique name. You may use the name of your project for this. If
182
-         * you've implemented an alternative client class as well, "standard"
183
-         * should be replaced by the name of the new class.
184
-         *
185
-         * @param string Relative path to the template creating code for the HTML page body
186
-         * @since 2019.07
187
-         * @category Developer
188
-         * @see client/html/account/profile/account/template-header
189
-         */
190
-        $tplconf = 'client/html/account/profile/account/template-body';
191
-        $default = 'account/profile/account-body-standard';
170
+		/** client/html/account/profile/account/template-body
171
+		 * Relative path to the HTML body template of the account profile account client.
172
+		 *
173
+		 * The template file contains the HTML code and processing instructions
174
+		 * to generate the result shown in the body of the frontend. The
175
+		 * configuration string is the path to the template file relative
176
+		 * to the templates directory (usually in client/html/templates).
177
+		 *
178
+		 * You can overwrite the template file configuration in extensions and
179
+		 * provide alternative templates. These alternative templates should be
180
+		 * named like the default one but with the string "standard" replaced by
181
+		 * an unique name. You may use the name of your project for this. If
182
+		 * you've implemented an alternative client class as well, "standard"
183
+		 * should be replaced by the name of the new class.
184
+		 *
185
+		 * @param string Relative path to the template creating code for the HTML page body
186
+		 * @since 2019.07
187
+		 * @category Developer
188
+		 * @see client/html/account/profile/account/template-header
189
+		 */
190
+		$tplconf = 'client/html/account/profile/account/template-body';
191
+		$default = 'account/profile/account-body-standard';
192 192
 
193
-        return $view->render( $view->config( $tplconf, $default ) );
194
-    }
193
+		return $view->render( $view->config( $tplconf, $default ) );
194
+	}
195 195
 
196
-    /**
197
-     * Processes the input, e.g. store given values.
198
-     *
199
-     * A view must be available and this method doesn't generate any output
200
-     * besides setting view variables if necessary.
201
-     * @throws \Aimeos\Client\Html\Exception|\Aimeos\Controller\Frontend\Exception
202
-     */
203
-    public function process()
204
-    {
205
-        $view = $this->getView();
196
+	/**
197
+	 * Processes the input, e.g. store given values.
198
+	 *
199
+	 * A view must be available and this method doesn't generate any output
200
+	 * besides setting view variables if necessary.
201
+	 * @throws \Aimeos\Client\Html\Exception|\Aimeos\Controller\Frontend\Exception
202
+	 */
203
+	public function process()
204
+	{
205
+		$view = $this->getView();
206 206
 
207
-        if( !$view->param( 'account/save' , false) ) {
208
-            parent::process();
209
-            return;
210
-        }
207
+		if( !$view->param( 'account/save' , false) ) {
208
+			parent::process();
209
+			return;
210
+		}
211 211
 
212
-        /** @var \Aimeos\Controller\Frontend\Customer\Standard $cntl */
213
-        $cntl = \Aimeos\Controller\Frontend::create( $this->getContext(), 'customer' );
214
-        $oldPassword = $cntl->get()->getPassword();
215
-        $values = $view->param('account', []);
212
+		/** @var \Aimeos\Controller\Frontend\Customer\Standard $cntl */
213
+		$cntl = \Aimeos\Controller\Frontend::create( $this->getContext(), 'customer' );
214
+		$oldPassword = $cntl->get()->getPassword();
215
+		$values = $view->param('account', []);
216 216
 
217
-        $isNew = $values['customer.newpassword'] !== $values['customer.oldpassword'];
218
-        $confirmed = $values['customer.newpassword'] === $values['customer.confirmnewpassword'];
217
+		$isNew = $values['customer.newpassword'] !== $values['customer.oldpassword'];
218
+		$confirmed = $values['customer.newpassword'] === $values['customer.confirmnewpassword'];
219 219
 
220
-        $errors = [];
220
+		$errors = [];
221 221
 
222
-        $isValid = true;
223
-        try {
224
-            Validator::make([
225
-                'password' => $values['customer.newpassword'],
226
-                'password_confirmation' => $values['customer.confirmnewpassword']
227
-            ], [
228
-                'password' => ['required', 'string', new Password, 'confirmed']
229
-            ])->validate();
230
-        } catch (\Exception $ex) {
231
-            $isValid = false;
232
-            $errors['passwordRules'] = "The password does not meet the password requirements!";
233
-        }
222
+		$isValid = true;
223
+		try {
224
+			Validator::make([
225
+				'password' => $values['customer.newpassword'],
226
+				'password_confirmation' => $values['customer.confirmnewpassword']
227
+			], [
228
+				'password' => ['required', 'string', new Password, 'confirmed']
229
+			])->validate();
230
+		} catch (\Exception $ex) {
231
+			$isValid = false;
232
+			$errors['passwordRules'] = "The password does not meet the password requirements!";
233
+		}
234 234
 
235
-        if ($isValid) {
236
-            /** is the password realy new? */
237
-            if (!$isNew) {
238
-                $errors['isNew'] = "The given password is not new!";
239
-            }
235
+		if ($isValid) {
236
+			/** is the password realy new? */
237
+			if (!$isNew) {
238
+				$errors['isNew'] = "The given password is not new!";
239
+			}
240 240
 
241
-            /** does the confirm password is the same? */
242
-            if (!$confirmed) {
243
-                $errors["confirm"] = "New passwords doesnt match!";
244
-            }
241
+			/** does the confirm password is the same? */
242
+			if (!$confirmed) {
243
+				$errors["confirm"] = "New passwords doesnt match!";
244
+			}
245 245
 
246
-            $cntl = $cntl->add($values);
246
+			$cntl = $cntl->add($values);
247 247
 
248
-        }
249
-        /** if the pasword is new and confirmed, but is not changed, the given old password must be wrong */
250
-        if ($isValid && $isNew && $confirmed && $oldPassword === $cntl->get()->getPassword() ) {
251
-                $errors['oldPassword'] = "Wrong password!";
252
-        }
248
+		}
249
+		/** if the pasword is new and confirmed, but is not changed, the given old password must be wrong */
250
+		if ($isValid && $isNew && $confirmed && $oldPassword === $cntl->get()->getPassword() ) {
251
+				$errors['oldPassword'] = "Wrong password!";
252
+		}
253 253
 
254
-        $view->passwordChanged = count(array_keys($errors)) === 0;
254
+		$view->passwordChanged = count(array_keys($errors)) === 0;
255 255
 
256
-        if (count(array_keys($errors)) > 0) {
257
-            $view->passwordErrors = $errors;
258
-        } else {
259
-            $cntl->store();
260
-        }
256
+		if (count(array_keys($errors)) > 0) {
257
+			$view->passwordErrors = $errors;
258
+		} else {
259
+			$cntl->store();
260
+		}
261 261
 
262
-        parent::process();
263
-    }
262
+		parent::process();
263
+	}
264 264
 }
Please login to merge, or discard this patch.
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
      * @return string HTML code
158 158
      * @throws \Aimeos\MW\View\Exception|\Aimeos\Client\Html\Exception
159 159
      */
160
-    public function getBody(string $uid = ''): string
160
+    public function getBody( string $uid = '' ): string
161 161
     {
162 162
         $view = $this->getView();
163 163
 
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
     {
205 205
         $view = $this->getView();
206 206
 
207
-        if( !$view->param( 'account/save' , false) ) {
207
+        if( !$view->param( 'account/save', false ) ) {
208 208
             parent::process();
209 209
             return;
210 210
         }
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
         /** @var \Aimeos\Controller\Frontend\Customer\Standard $cntl */
213 213
         $cntl = \Aimeos\Controller\Frontend::create( $this->getContext(), 'customer' );
214 214
         $oldPassword = $cntl->get()->getPassword();
215
-        $values = $view->param('account', []);
215
+        $values = $view->param( 'account', [] );
216 216
 
217 217
         $isNew = $values['customer.newpassword'] !== $values['customer.oldpassword'];
218 218
         $confirmed = $values['customer.newpassword'] === $values['customer.confirmnewpassword'];
@@ -221,39 +221,39 @@  discard block
 block discarded – undo
221 221
 
222 222
         $isValid = true;
223 223
         try {
224
-            Validator::make([
224
+            Validator::make( [
225 225
                 'password' => $values['customer.newpassword'],
226 226
                 'password_confirmation' => $values['customer.confirmnewpassword']
227 227
             ], [
228 228
                 'password' => ['required', 'string', new Password, 'confirmed']
229
-            ])->validate();
230
-        } catch (\Exception $ex) {
229
+            ] )->validate();
230
+        } catch( \Exception $ex ) {
231 231
             $isValid = false;
232 232
             $errors['passwordRules'] = "The password does not meet the password requirements!";
233 233
         }
234 234
 
235
-        if ($isValid) {
235
+        if( $isValid ) {
236 236
             /** is the password realy new? */
237
-            if (!$isNew) {
237
+            if( !$isNew ) {
238 238
                 $errors['isNew'] = "The given password is not new!";
239 239
             }
240 240
 
241 241
             /** does the confirm password is the same? */
242
-            if (!$confirmed) {
242
+            if( !$confirmed ) {
243 243
                 $errors["confirm"] = "New passwords doesnt match!";
244 244
             }
245 245
 
246
-            $cntl = $cntl->add($values);
246
+            $cntl = $cntl->add( $values );
247 247
 
248 248
         }
249 249
         /** if the pasword is new and confirmed, but is not changed, the given old password must be wrong */
250
-        if ($isValid && $isNew && $confirmed && $oldPassword === $cntl->get()->getPassword() ) {
250
+        if( $isValid && $isNew && $confirmed && $oldPassword === $cntl->get()->getPassword() ) {
251 251
                 $errors['oldPassword'] = "Wrong password!";
252 252
         }
253 253
 
254
-        $view->passwordChanged = count(array_keys($errors)) === 0;
254
+        $view->passwordChanged = count( array_keys( $errors ) ) === 0;
255 255
 
256
-        if (count(array_keys($errors)) > 0) {
256
+        if( count( array_keys( $errors ) ) > 0 ) {
257 257
             $view->passwordErrors = $errors;
258 258
         } else {
259 259
             $cntl->store();
Please login to merge, or discard this patch.
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -220,14 +220,17 @@
 block discarded – undo
220 220
         $errors = [];
221 221
 
222 222
         $isValid = true;
223
-        try {
223
+        try
224
+        {
224 225
             Validator::make([
225 226
                 'password' => $values['customer.newpassword'],
226 227
                 'password_confirmation' => $values['customer.confirmnewpassword']
227 228
             ], [
228 229
                 'password' => ['required', 'string', new Password, 'confirmed']
229 230
             ])->validate();
230
-        } catch (\Exception $ex) {
231
+        }
232
+        catch (\Exception $ex)
233
+        {
231 234
             $isValid = false;
232 235
             $errors['passwordRules'] = "The password does not meet the password requirements!";
233 236
         }
Please login to merge, or discard this patch.
client/html/templates/account/profile/account-body-standard.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
  * @see client/html/account/profile/url/config
87 87
  */
88 88
 
89
-$passwordErrors = $this->get('passwordErrors', []);
89
+$passwordErrors = $this->get( 'passwordErrors', [] );
90 90
 
91 91
 ?>
92 92
 <?php $this->block()->start( 'account/profile/account' ) ?>
@@ -97,10 +97,10 @@  discard block
 block discarded – undo
97 97
         <?= $this->csrf()->formfield() ?>
98 98
 
99 99
             <div class="row password-change-notifications">
100
-                <?php if ( $this->get('passwordChanged', null) === true ) : ?>
101
-                    <h2 class="text-success"><?= $this->translate('client', 'Password changed successfull!') ?></h2>
102
-                <?php elseif ($this->get('passwordChanged', null) === false) : ?>
103
-                    <h2 class="text-danger"><?= $this->translate('client', 'Error(s) occured!') ?></h2>
100
+                <?php if( $this->get( 'passwordChanged', null ) === true ) : ?>
101
+                    <h2 class="text-success"><?= $this->translate( 'client', 'Password changed successfull!' ) ?></h2>
102
+                <?php elseif( $this->get( 'passwordChanged', null ) === false ) : ?>
103
+                    <h2 class="text-danger"><?= $this->translate( 'client', 'Error(s) occured!' ) ?></h2>
104 104
                 <?php endif ?>
105 105
             </div>
106 106
         <div class="row">
@@ -117,9 +117,9 @@  discard block
 block discarded – undo
117 117
                                    name="<?= $enc->attr( $this->formparam( array( 'account', 'customer.oldpassword' ) ) ) ?>"
118 118
                                    placeholder="<?= $enc->attr( $this->translate( 'client', 'Old password' ) ) ?>"
119 119
                             >
120
-                            <?php if( isset($passwordErrors['oldPassword']) ) : ?>
120
+                            <?php if( isset( $passwordErrors['oldPassword'] ) ) : ?>
121 121
                                 <span class="invalid-feedback d-block" role="alert">
122
-                                    <strong><?= $enc->html($this->translate('client', $passwordErrors['oldPassword'])) ?></strong>
122
+                                    <strong><?= $enc->html( $this->translate( 'client', $passwordErrors['oldPassword'] ) ) ?></strong>
123 123
                                 </span>
124 124
                             <?php endif ?>
125 125
                         </div>
@@ -136,19 +136,19 @@  discard block
 block discarded – undo
136 136
                                    name="<?= $enc->attr( $this->formparam( array( 'account', 'customer.newpassword' ) ) ) ?>"
137 137
                                    placeholder="<?= $enc->attr( $this->translate( 'client', 'New password' ) ) ?>"
138 138
                             >
139
-                            <?php if( isset($passwordErrors['confirm']) ) : ?>
139
+                            <?php if( isset( $passwordErrors['confirm'] ) ) : ?>
140 140
                                 <span class="invalid-feedback d-block" role="alert">
141
-                                    <strong><?= $enc->html($this->translate('client', $passwordErrors['confirm'])) ?></strong>
141
+                                    <strong><?= $enc->html( $this->translate( 'client', $passwordErrors['confirm'] ) ) ?></strong>
142 142
                                 </span>
143 143
                             <?php endif ?>
144
-                            <?php if( isset($passwordErrors['isNew']) ) : ?>
144
+                            <?php if( isset( $passwordErrors['isNew'] ) ) : ?>
145 145
                                 <span class="invalid-feedback d-block" role="alert">
146
-                                    <strong><?= $enc->html($this->translate('client', $passwordErrors['isNew'])) ?></strong>
146
+                                    <strong><?= $enc->html( $this->translate( 'client', $passwordErrors['isNew'] ) ) ?></strong>
147 147
                                 </span>
148 148
                             <?php endif ?>
149
-                            <?php if( isset($passwordErrors['passwordRules']) ) : ?>
149
+                            <?php if( isset( $passwordErrors['passwordRules'] ) ) : ?>
150 150
                                 <span class="invalid-feedback d-block" role="alert">
151
-                                    <strong><?= $enc->html($this->translate('client', $passwordErrors['passwordRules'])) ?></strong>
151
+                                    <strong><?= $enc->html( $this->translate( 'client', $passwordErrors['passwordRules'] ) ) ?></strong>
152 152
                                 </span>
153 153
                             <?php endif ?>
154 154
                         </div>
@@ -164,14 +164,14 @@  discard block
 block discarded – undo
164 164
                                    name="<?= $enc->attr( $this->formparam( array( 'account', 'customer.confirmnewpassword' ) ) ) ?>"
165 165
                                    placeholder="<?= $enc->attr( $this->translate( 'client', 'Confirm password' ) ) ?>"
166 166
                             >
167
-                            <?php if( isset($passwordErrors['confirm']) ) : ?>
167
+                            <?php if( isset( $passwordErrors['confirm'] ) ) : ?>
168 168
                                 <span class="invalid-feedback d-block" role="alert">
169
-                                    <strong><?= $enc->html($this->translate('client', $passwordErrors['confirm'])) ?></strong>
169
+                                    <strong><?= $enc->html( $this->translate( 'client', $passwordErrors['confirm'] ) ) ?></strong>
170 170
                                 </span>
171 171
                             <?php endif ?>
172
-                            <?php if( isset($passwordErrors['isNew']) ) : ?>
172
+                            <?php if( isset( $passwordErrors['isNew'] ) ) : ?>
173 173
                                 <span class="invalid-feedback d-block" role="alert">
174
-                                    <strong><?= $enc->html($this->translate('client', $passwordErrors['isNew'])) ?></strong>
174
+                                    <strong><?= $enc->html( $this->translate( 'client', $passwordErrors['isNew'] ) ) ?></strong>
175 175
                                 </span>
176 176
                             <?php endif ?>
177 177
                         </div>
Please login to merge, or discard this patch.