@@ -24,7 +24,7 @@ |
||
24 | 24 | { |
25 | 25 | protected $targetDocument = Cv::class; |
26 | 26 | |
27 | - protected $filesProperties = [ 'attachments' ]; |
|
27 | + protected $filesProperties = ['attachments']; |
|
28 | 28 | |
29 | 29 | /** |
30 | 30 | * |
@@ -49,7 +49,7 @@ |
||
49 | 49 | |
50 | 50 | public function getSubscribedEvents() |
51 | 51 | { |
52 | - return [ Events::onFlush ]; |
|
52 | + return [Events::onFlush]; |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | /** |
@@ -41,6 +41,9 @@ discard block |
||
41 | 41 | */ |
42 | 42 | protected $message; |
43 | 43 | |
44 | + /** |
|
45 | + * @param StatusInterface|null $status |
|
46 | + */ |
|
44 | 47 | public function __construct($status, $message = '[System]') |
45 | 48 | { |
46 | 49 | if (!$status instanceof StatusInterface) { |
@@ -116,7 +119,7 @@ discard block |
||
116 | 119 | /** |
117 | 120 | * Sets the history message |
118 | 121 | * |
119 | - * @param $message |
|
122 | + * @param string $message |
|
120 | 123 | * |
121 | 124 | * @return $this |
122 | 125 | */ |
@@ -72,6 +72,9 @@ discard block |
||
72 | 72 | return $this; |
73 | 73 | } |
74 | 74 | |
75 | + /** |
|
76 | + * @param AddressList $header |
|
77 | + */ |
|
75 | 78 | protected function stringFromMailHeader($header) |
76 | 79 | { |
77 | 80 | $erg = ''; |
@@ -160,6 +163,9 @@ discard block |
||
160 | 163 | } |
161 | 164 | } |
162 | 165 | |
166 | + /** |
|
167 | + * @return string |
|
168 | + */ |
|
163 | 169 | protected function getTemplate() |
164 | 170 | { |
165 | 171 | $template = null; |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | } elseif (isset($this->config['templateHalf'])) { |
169 | 169 | $template = $this->config['templateHalf']; |
170 | 170 | } else { |
171 | - throw new \InvalidArgumentException('Not template provided for Mail.'); |
|
171 | + throw new \InvalidArgumentException('Not template provided for Mail.'); |
|
172 | 172 | } |
173 | 173 | return $template; |
174 | 174 | } |
@@ -181,19 +181,19 @@ discard block |
||
181 | 181 | $from = $this->config['from']; |
182 | 182 | } else { |
183 | 183 | $log->err('A from email address must be provided (Variable $from) in Template: ' . $template); |
184 | - throw new \InvalidArgumentException('A from email address must be provided (Variable $from) in Template: ' . $template); |
|
184 | + throw new \InvalidArgumentException('A from email address must be provided (Variable $from) in Template: ' . $template); |
|
185 | 185 | } |
186 | 186 | if (isset($this->config['fromName'])) { |
187 | 187 | $fromName = $this->config['fromName']; |
188 | 188 | } else { |
189 | 189 | $log->err('A from name must be provided (Variable $fromName) in Template: ' . $template); |
190 | - throw new \InvalidArgumentException('A from name must be provided (Variable $fromName) in Template: ' . $template); |
|
190 | + throw new \InvalidArgumentException('A from name must be provided (Variable $fromName) in Template: ' . $template); |
|
191 | 191 | } |
192 | 192 | if (isset($this->config['subject'])) { |
193 | 193 | $subject = $this->config['subject']; |
194 | 194 | } else { |
195 | 195 | $log->err('A subject must be provided (Variable $subject) in Template: ' . $template); |
196 | - throw new \InvalidArgumentException('A subject must be provided (Variable $subject) in Template: ' . $template); |
|
196 | + throw new \InvalidArgumentException('A subject must be provided (Variable $subject) in Template: ' . $template); |
|
197 | 197 | } |
198 | 198 | $this->setFrom($from, $fromName); |
199 | 199 | $this->setSubject($subject); |
@@ -220,11 +220,11 @@ discard block |
||
220 | 220 | return $erg; |
221 | 221 | } |
222 | 222 | |
223 | - /** |
|
224 | - * @param ContainerInterface $container |
|
225 | - * |
|
226 | - * @return static |
|
227 | - */ |
|
223 | + /** |
|
224 | + * @param ContainerInterface $container |
|
225 | + * |
|
226 | + * @return static |
|
227 | + */ |
|
228 | 228 | public static function factory(ContainerInterface $container) |
229 | 229 | { |
230 | 230 | return new static($container); |
@@ -96,18 +96,18 @@ discard block |
||
96 | 96 | $replyTo = $this->stringFromMailHeader($this->getReplyTo()); |
97 | 97 | |
98 | 98 | return str_pad($template, 30) |
99 | - . 'to: ' . str_pad($to, 50) |
|
100 | - . 'cc: ' . str_pad($cc, 50) |
|
101 | - . 'bcc: ' . str_pad($bcc, 50) |
|
102 | - . 'from: ' . str_pad($from, 50) |
|
103 | - . 'replyTo: ' . str_pad($replyTo, 50) |
|
99 | + . 'to: '.str_pad($to, 50) |
|
100 | + . 'cc: '.str_pad($cc, 50) |
|
101 | + . 'bcc: '.str_pad($bcc, 50) |
|
102 | + . 'from: '.str_pad($from, 50) |
|
103 | + . 'replyTo: '.str_pad($replyTo, 50) |
|
104 | 104 | //. str_pad(implode(',', ArrayUtils::iteratorToArray($this->getSender())),50) |
105 | - . 'subject: ' . str_pad($this->getSubject(), 50); |
|
105 | + . 'subject: '.str_pad($this->getSubject(), 50); |
|
106 | 106 | } |
107 | 107 | |
108 | 108 | public function template($template) |
109 | 109 | { |
110 | - $controller = get_class($this->controller); |
|
110 | + $controller = get_class($this->controller); |
|
111 | 111 | $services = $this->serviceManager; |
112 | 112 | |
113 | 113 | $event = new Event(); |
@@ -124,11 +124,11 @@ discard block |
||
124 | 124 | $controllerIdentifier = strtolower(substr($controller, 0, strpos($controller, '\\'))); |
125 | 125 | $viewResolver = $this->serviceManager->get('ViewResolver'); |
126 | 126 | |
127 | - $templateHalf = 'mail/' . $template; |
|
127 | + $templateHalf = 'mail/'.$template; |
|
128 | 128 | $resource = $viewResolver->resolve($templateHalf); |
129 | 129 | |
130 | 130 | if (empty($resource)) { |
131 | - $templateFull = $controllerIdentifier . '/mail/' . $template; |
|
131 | + $templateFull = $controllerIdentifier.'/mail/'.$template; |
|
132 | 132 | $resource = $viewResolver->resolve($templateFull); |
133 | 133 | } |
134 | 134 | |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | unset($__vars[$key]); |
156 | 156 | } |
157 | 157 | } |
158 | - unset($__vars['content'],$__vars['controllerIdentifier'],$__vars['controller'],$__vars['resource'],$__vars['template'],$__vars['viewResolver']); |
|
158 | + unset($__vars['content'], $__vars['controllerIdentifier'], $__vars['controller'], $__vars['resource'], $__vars['template'], $__vars['viewResolver']); |
|
159 | 159 | $this->config = $__vars; |
160 | 160 | } |
161 | 161 | } |
@@ -180,20 +180,20 @@ discard block |
||
180 | 180 | if (isset($this->config['from'])) { |
181 | 181 | $from = $this->config['from']; |
182 | 182 | } else { |
183 | - $log->err('A from email address must be provided (Variable $from) in Template: ' . $template); |
|
184 | - throw new \InvalidArgumentException('A from email address must be provided (Variable $from) in Template: ' . $template); |
|
183 | + $log->err('A from email address must be provided (Variable $from) in Template: '.$template); |
|
184 | + throw new \InvalidArgumentException('A from email address must be provided (Variable $from) in Template: '.$template); |
|
185 | 185 | } |
186 | 186 | if (isset($this->config['fromName'])) { |
187 | 187 | $fromName = $this->config['fromName']; |
188 | 188 | } else { |
189 | - $log->err('A from name must be provided (Variable $fromName) in Template: ' . $template); |
|
190 | - throw new \InvalidArgumentException('A from name must be provided (Variable $fromName) in Template: ' . $template); |
|
189 | + $log->err('A from name must be provided (Variable $fromName) in Template: '.$template); |
|
190 | + throw new \InvalidArgumentException('A from name must be provided (Variable $fromName) in Template: '.$template); |
|
191 | 191 | } |
192 | 192 | if (isset($this->config['subject'])) { |
193 | 193 | $subject = $this->config['subject']; |
194 | 194 | } else { |
195 | - $log->err('A subject must be provided (Variable $subject) in Template: ' . $template); |
|
196 | - throw new \InvalidArgumentException('A subject must be provided (Variable $subject) in Template: ' . $template); |
|
195 | + $log->err('A subject must be provided (Variable $subject) in Template: '.$template); |
|
196 | + throw new \InvalidArgumentException('A subject must be provided (Variable $subject) in Template: '.$template); |
|
197 | 197 | } |
198 | 198 | $this->setFrom($from, $fromName); |
199 | 199 | $this->setSubject($subject); |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | $erg = true; |
216 | 216 | $log->info($this); |
217 | 217 | } catch (\Exception $e) { |
218 | - $log->err('Mail failure ' . $e->getMessage()); |
|
218 | + $log->err('Mail failure '.$e->getMessage()); |
|
219 | 219 | } |
220 | 220 | return $erg; |
221 | 221 | } |
@@ -20,7 +20,7 @@ |
||
20 | 20 | * Set the View object |
21 | 21 | * |
22 | 22 | * @param Renderer $view |
23 | - * @return AbstractHelper |
|
23 | + * @return AbstractEventsHelper |
|
24 | 24 | */ |
25 | 25 | public function setView(Renderer $view) |
26 | 26 | { |
@@ -24,8 +24,8 @@ |
||
24 | 24 | public function init() |
25 | 25 | { |
26 | 26 | $this->setName('education') |
27 | - ->setHydrator(new EntityHydrator()) |
|
28 | - ->setObject(new EducationEntity()); |
|
27 | + ->setHydrator(new EntityHydrator()) |
|
28 | + ->setObject(new EducationEntity()); |
|
29 | 29 | |
30 | 30 | $this->add( |
31 | 31 | array( |
@@ -26,7 +26,7 @@ |
||
26 | 26 | { |
27 | 27 | $this->add([ |
28 | 28 | 'name' => 'endDate', |
29 | - 'required' => ! $data['currentIndicator'] |
|
29 | + 'required' => !$data['currentIndicator'] |
|
30 | 30 | ]); |
31 | 31 | |
32 | 32 | return parent::setData($data); |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | * |
53 | 53 | * @var string |
54 | 54 | */ |
55 | - protected $options="Cv/Options"; |
|
55 | + protected $options = "Cv/Options"; |
|
56 | 56 | |
57 | 57 | |
58 | 58 | /** |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | ->setIsDescriptionsEnabled(true) |
78 | 78 | ->setDescription( |
79 | 79 | /*@translate*/ 'Attach images or PDF Documents to your CV. Drag&drop them, or click into the attachement area. You can upload up to %sMB', |
80 | - [round($size/(1024*1024))>0? round($size/(1024*1024)):round($size/(1024*1024), 1)] |
|
80 | + [round($size / (1024 * 1024)) > 0 ? round($size / (1024 * 1024)) : round($size / (1024 * 1024), 1)] |
|
81 | 81 | ) |
82 | 82 | ->setParam('return', 'file-uri') |
83 | 83 | ->setLabel(/*@translate*/ 'Attachments'); |
@@ -74,14 +74,14 @@ |
||
74 | 74 | $count = $options->getAttachmentsCount(); |
75 | 75 | |
76 | 76 | $form->setIsDisableCapable(false) |
77 | - ->setIsDisableElementsCapable(false) |
|
78 | - ->setIsDescriptionsEnabled(true) |
|
79 | - ->setDescription( |
|
77 | + ->setIsDisableElementsCapable(false) |
|
78 | + ->setIsDescriptionsEnabled(true) |
|
79 | + ->setDescription( |
|
80 | 80 | /*@translate*/ 'Attach images or PDF Documents to your CV. Drag&drop them, or click into the attachement area. You can upload up to %sMB', |
81 | - [round($size/(1024*1024))>0? round($size/(1024*1024)):round($size/(1024*1024), 1)] |
|
82 | - ) |
|
83 | - ->setParam('return', 'file-uri') |
|
84 | - ->setLabel(/*@translate*/ 'Attachments'); |
|
81 | + [round($size/(1024*1024))>0? round($size/(1024*1024)):round($size/(1024*1024), 1)] |
|
82 | + ) |
|
83 | + ->setParam('return', 'file-uri') |
|
84 | + ->setLabel(/*@translate*/ 'Attachments'); |
|
85 | 85 | |
86 | 86 | /* @var $file \Core\Form\Element\FileUpload */ |
87 | 87 | $file = $form->get($this->fileName); |
@@ -50,7 +50,7 @@ |
||
50 | 50 | */ |
51 | 51 | public function getEmptySummaryNotice() |
52 | 52 | { |
53 | - if (! isset($this->emptySummaryNotice) && property_exists($this, 'defaultEmptySummaryNotice')) { |
|
53 | + if (!isset($this->emptySummaryNotice) && property_exists($this, 'defaultEmptySummaryNotice')) { |
|
54 | 54 | $this->emptySummaryNotice = $this->defaultEmptySummaryNotice; |
55 | 55 | } |
56 | 56 |