@@ -32,7 +32,7 @@ |
||
32 | 32 | { |
33 | 33 | $options = $this->options; |
34 | 34 | $filename = call_user_func($options->getCallback(), $this); |
35 | - $file = $options->getPath() . DIRECTORY_SEPARATOR . $filename; |
|
35 | + $file = $options->getPath().DIRECTORY_SEPARATOR.$filename; |
|
36 | 36 | |
37 | 37 | |
38 | 38 | $contents = $message->toString(); |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | */ |
27 | 27 | class MailServiceFactory implements FactoryInterface |
28 | 28 | { |
29 | - public function __invoke( ContainerInterface $container, $requestedName, array $options = null ) |
|
29 | + public function __invoke(ContainerInterface $container, $requestedName, array $options = null) |
|
30 | 30 | { |
31 | 31 | $config = $container->get('Config'); |
32 | 32 | $mails = isset($config['mails']) ? $config['mails'] : []; |
@@ -48,12 +48,12 @@ discard block |
||
48 | 48 | $configArray = array_merge($configArray, $mails); |
49 | 49 | |
50 | 50 | $config = new MailServiceConfig($configArray); |
51 | - $service = new MailService($container,$config->toArray()); |
|
51 | + $service = new MailService($container, $config->toArray()); |
|
52 | 52 | $config->configureServiceManager($service); |
53 | - foreach($config->toArray() as $name=>$value){ |
|
53 | + foreach ($config->toArray() as $name=>$value) { |
|
54 | 54 | $method = 'set'.$name; |
55 | - if(method_exists($service,$method)){ |
|
56 | - call_user_func([$service,$method],$value); |
|
55 | + if (method_exists($service, $method)) { |
|
56 | + call_user_func([$service, $method], $value); |
|
57 | 57 | } |
58 | 58 | } |
59 | 59 | |
@@ -65,11 +65,11 @@ discard block |
||
65 | 65 | $type = $mailServiceOptions->getTransportClass(); |
66 | 66 | if (MailService::TRANSPORT_SMTP == $type) { |
67 | 67 | return new Smtp($mailServiceOptions); |
68 | - }elseif(MailService::TRANSPORT_FILE == $type){ |
|
68 | + }elseif (MailService::TRANSPORT_FILE == $type) { |
|
69 | 69 | $fileOptions = new FileOptions(); |
70 | 70 | $fileOptions->setPath($mailServiceOptions->getPath()); |
71 | 71 | return new FileTransport($fileOptions); |
72 | - }elseif(MailService::TRANSPORT_SENDMAIL == $type){ |
|
72 | + }elseif (MailService::TRANSPORT_SENDMAIL == $type) { |
|
73 | 73 | return new Sendmail(); |
74 | 74 | } |
75 | 75 |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | return $this; |
100 | 100 | } |
101 | 101 | |
102 | - public function getUsername(){ |
|
102 | + public function getUsername() { |
|
103 | 103 | return $this->connectionConfig['username']; |
104 | 104 | } |
105 | 105 | |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | return $this; |
111 | 111 | } |
112 | 112 | |
113 | - public function getPassword(){ |
|
113 | + public function getPassword() { |
|
114 | 114 | return $this->connectionConfig['password']; |
115 | 115 | } |
116 | 116 | |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | return $this; |
122 | 122 | } |
123 | 123 | |
124 | - public function getSsl(){ |
|
124 | + public function getSsl() { |
|
125 | 125 | return $this->connectionConfig['ssl']; |
126 | 126 | } |
127 | 127 | |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | return $this; |
131 | 131 | } |
132 | 132 | |
133 | - public function getTransportClass(){ |
|
133 | + public function getTransportClass() { |
|
134 | 134 | return $this->transportClass; |
135 | 135 | } |
136 | 136 | |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | */ |
140 | 140 | public function getPath() |
141 | 141 | { |
142 | - if(is_null($this->path)){ |
|
142 | + if (is_null($this->path)) { |
|
143 | 143 | $this->setPath(sys_get_temp_dir().'/yawik/mails'); |
144 | 144 | } |
145 | 145 | return $this->path; |
@@ -151,9 +151,9 @@ discard block |
||
151 | 151 | */ |
152 | 152 | public function setPath($path) |
153 | 153 | { |
154 | - if(!is_dir($path)){ |
|
155 | - mkdir($path,0777,true); |
|
156 | - chmod($path,0777); |
|
154 | + if (!is_dir($path)) { |
|
155 | + mkdir($path, 0777, true); |
|
156 | + chmod($path, 0777); |
|
157 | 157 | } |
158 | 158 | $this->path = $path; |
159 | 159 | return $this; |