@@ -32,7 +32,8 @@ discard block |
||
| 32 | 32 | } |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | - /** @return bool|bool[] */ |
|
| 35 | + /** @param boolean $clear |
|
| 36 | +/** @return bool|bool[] */ |
|
| 36 | 37 | protected function flags( $flags, $clear ) { |
| 37 | 38 | $cb = [$this->mailbox()->imap(), $clear ? 'unflag' : 'flag']; |
| 38 | 39 | |
@@ -79,7 +80,8 @@ discard block |
||
| 79 | 80 | return $this->headers; |
| 80 | 81 | } |
| 81 | 82 | |
| 82 | - /** @return string */ |
|
| 83 | + /** @param string $name |
|
| 84 | +/** @return string */ |
|
| 83 | 85 | public function header( $name ) { |
| 84 | 86 | $headers = $this->headers(); |
| 85 | 87 | return @$headers[ strtolower($name) ]; |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | |
| 58 | 58 | /** @return string */ |
| 59 | 59 | public function safeFilename() { |
| 60 | - if ($filename = $this->filename()) { |
|
| 60 | + if ( $filename = $this->filename() ) { |
|
| 61 | 61 | return trim(preg_replace('#_+#', '_', preg_replace('#[^a-z0-9\-_\.]+#i', '', $filename)), '_'); |
| 62 | 62 | } |
| 63 | 63 | } |
@@ -72,8 +72,8 @@ discard block |
||
| 72 | 72 | |
| 73 | 73 | /** @return string */ |
| 74 | 74 | public function decodedContent() { |
| 75 | - if ($raw = $this->content()) { |
|
| 76 | - switch ($this->parameter('encoding')) { |
|
| 75 | + if ( $raw = $this->content() ) { |
|
| 76 | + switch ( $this->parameter('encoding') ) { |
|
| 77 | 77 | case ENC7BIT: |
| 78 | 78 | case ENC8BIT: |
| 79 | 79 | case ENCQUOTEDPRINTABLE: |
@@ -88,10 +88,10 @@ discard block |
||
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | /** @return bool */ |
| 91 | - public function saveAttachment($dir, $filenameOverride = null) { |
|
| 92 | - if ($filename = $this->safeFilename()) { |
|
| 91 | + public function saveAttachment( $dir, $filenameOverride = null ) { |
|
| 92 | + if ( $filename = $this->safeFilename() ) { |
|
| 93 | 93 | $filepath = realpath($dir) . '/' . ($filenameOverride ?? $filename); |
| 94 | - if (file_put_contents($filepath, $this->decodedContent())) { |
|
| 94 | + if ( file_put_contents($filepath, $this->decodedContent()) ) { |
|
| 95 | 95 | return true; |
| 96 | 96 | } |
| 97 | 97 | } |