@@ -40,7 +40,7 @@ |
||
40 | 40 | } |
41 | 41 | |
42 | 42 | /** @var array $files */ |
43 | - $files = $view->getVariable('assets'.ucfirst($type)); |
|
43 | + $files = $view->getVariable('assets' . ucfirst($type)); |
|
44 | 44 | |
45 | 45 | if (empty($files)) { |
46 | 46 | return ''; |
@@ -94,7 +94,7 @@ |
||
94 | 94 | /** |
95 | 95 | * Get response body and set headers |
96 | 96 | * |
97 | - * @return mixed |
|
97 | + * @return string |
|
98 | 98 | */ |
99 | 99 | public function getContent() |
100 | 100 | { |
@@ -188,7 +188,7 @@ discard block |
||
188 | 188 | $headers .= 'Content-Type: multipart/mixed; boundary=' . $boundary . $eol; |
189 | 189 | |
190 | 190 | if (!empty($this->from)) { |
191 | - $headers .= 'From: ' .$this->from . $eol; |
|
191 | + $headers .= 'From: ' . $this->from . $eol; |
|
192 | 192 | } |
193 | 193 | |
194 | 194 | if (!empty($this->replyTo)) { |
@@ -246,7 +246,7 @@ discard block |
||
246 | 246 | } |
247 | 247 | |
248 | 248 | $body .= 'Content-Transfer-Encoding: base64' . $eol; |
249 | - $body .= 'X-Attachment-Id: ' . rand(1000,99999) . $eol . $eol; |
|
249 | + $body .= 'X-Attachment-Id: ' . rand(1000, 99999) . $eol . $eol; |
|
250 | 250 | $body .= $encodedContent . $eol; |
251 | 251 | |
252 | 252 | } |
@@ -40,7 +40,7 @@ |
||
40 | 40 | { |
41 | 41 | if (!$this->process($this->field->getValue())) { |
42 | 42 | |
43 | - $this->field->addAttribute('class', 'error'); |
|
43 | + $this->field->addAttribute('class', 'error'); |
|
44 | 44 | $this->field->setErrorMessages([$this->getMessage()]); |
45 | 45 | return false; |
46 | 46 |
@@ -302,7 +302,7 @@ |
||
302 | 302 | } |
303 | 303 | |
304 | 304 | /** |
305 | - * @param $type |
|
305 | + * @param string $type |
|
306 | 306 | * @return bool |
307 | 307 | */ |
308 | 308 | private function translateType($type) |
@@ -13,7 +13,6 @@ |
||
13 | 13 | use Faulancer\Service\SessionManagerService; |
14 | 14 | use Faulancer\ServiceLocator\ServiceLocator; |
15 | 15 | use Faulancer\Form\Validator\ValidatorChain; |
16 | -use Faulancer\ServiceLocator\ServiceLocatorAwareInterface; |
|
17 | 16 | use Faulancer\ServiceLocator\ServiceLocatorInterface; |
18 | 17 | use Faulancer\Session\SessionManager; |
19 | 18 |
@@ -25,7 +25,7 @@ |
||
25 | 25 | /** |
26 | 26 | * @param $dom |
27 | 27 | * @param $data |
28 | - * @return bool|\DOMElement |
|
28 | + * @return \DOMNode |
|
29 | 29 | */ |
30 | 30 | protected function generateXmlElement( \DOMDocument $dom, $data ) |
31 | 31 | { |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | class XmlResponse extends Response |
13 | 13 | { |
14 | 14 | |
15 | - public function __construct ($content = []) |
|
15 | + public function __construct($content = []) |
|
16 | 16 | { |
17 | 17 | parent::__construct($content); |
18 | 18 | |
@@ -27,30 +27,30 @@ discard block |
||
27 | 27 | * @param $data |
28 | 28 | * @return bool|\DOMElement |
29 | 29 | */ |
30 | - protected function generateXmlElement( \DOMDocument $dom, $data ) |
|
30 | + protected function generateXmlElement(\DOMDocument $dom, $data) |
|
31 | 31 | { |
32 | - if ( empty( $data['name'] ) ) |
|
32 | + if (empty($data['name'])) |
|
33 | 33 | return false; |
34 | 34 | |
35 | 35 | // Create the element |
36 | - $element_value = ( ! empty( $data['value'] ) ) ? $data['value'] : null; |
|
37 | - $element = $dom->createElement( $data['name'], $element_value ); |
|
36 | + $element_value = (!empty($data['value'])) ? $data['value'] : null; |
|
37 | + $element = $dom->createElement($data['name'], $element_value); |
|
38 | 38 | |
39 | 39 | // Add any attributes |
40 | - if ( ! empty( $data['attributes'] ) && is_array( $data['attributes'] ) ) { |
|
41 | - foreach ( $data['attributes'] as $attribute_key => $attribute_value ) { |
|
42 | - $element->setAttribute( $attribute_key, $attribute_value ); |
|
40 | + if (!empty($data['attributes']) && is_array($data['attributes'])) { |
|
41 | + foreach ($data['attributes'] as $attribute_key => $attribute_value) { |
|
42 | + $element->setAttribute($attribute_key, $attribute_value); |
|
43 | 43 | } |
44 | 44 | } |
45 | 45 | |
46 | 46 | // Any other items in the data array should be child elements |
47 | - foreach ( $data as $data_key => $child_data ) { |
|
48 | - if ( ! is_numeric( $data_key ) ) |
|
47 | + foreach ($data as $data_key => $child_data) { |
|
48 | + if (!is_numeric($data_key)) |
|
49 | 49 | continue; |
50 | 50 | |
51 | - $child = $this->generateXmlElement( $dom, $child_data ); |
|
52 | - if ( $child ) |
|
53 | - $element->appendChild( $child ); |
|
51 | + $child = $this->generateXmlElement($dom, $child_data); |
|
52 | + if ($child) |
|
53 | + $element->appendChild($child); |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | return $element; |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | $doc->encoding = 'UTF-8'; |
71 | 71 | $child = $this->generateXmlElement($doc, $content); |
72 | 72 | |
73 | - if ( $child ) { |
|
73 | + if ($child) { |
|
74 | 74 | $doc->appendChild($child); |
75 | 75 | } |
76 | 76 |
@@ -29,8 +29,9 @@ discard block |
||
29 | 29 | */ |
30 | 30 | protected function generateXmlElement( \DOMDocument $dom, $data ) |
31 | 31 | { |
32 | - if ( empty( $data['name'] ) ) |
|
33 | - return false; |
|
32 | + if ( empty( $data['name'] ) ) { |
|
33 | + return false; |
|
34 | + } |
|
34 | 35 | |
35 | 36 | // Create the element |
36 | 37 | $element_value = ( ! empty( $data['value'] ) ) ? $data['value'] : null; |
@@ -45,12 +46,14 @@ discard block |
||
45 | 46 | |
46 | 47 | // Any other items in the data array should be child elements |
47 | 48 | foreach ( $data as $data_key => $child_data ) { |
48 | - if ( ! is_numeric( $data_key ) ) |
|
49 | - continue; |
|
49 | + if ( ! is_numeric( $data_key ) ) { |
|
50 | + continue; |
|
51 | + } |
|
50 | 52 | |
51 | 53 | $child = $this->generateXmlElement( $dom, $child_data ); |
52 | - if ( $child ) |
|
53 | - $element->appendChild( $child ); |
|
54 | + if ( $child ) { |
|
55 | + $element->appendChild( $child ); |
|
56 | + } |
|
54 | 57 | } |
55 | 58 | |
56 | 59 | return $element; |
@@ -7,7 +7,6 @@ |
||
7 | 7 | namespace Faulancer\Service; |
8 | 8 | |
9 | 9 | use Faulancer\Controller\AbstractController; |
10 | -use Faulancer\Http\Response; |
|
11 | 10 | use Faulancer\ORM\User\Entity; |
12 | 11 | use Faulancer\Security\Crypt; |
13 | 12 | use Faulancer\ServiceLocator\ServiceInterface; |