@@ -101,7 +101,7 @@ |
||
| 101 | 101 | $this->addRawHeaderToPart($header, $partBuilder); |
| 102 | 102 | $header = ''; |
| 103 | 103 | } else { |
| 104 | - $line = "\r\n" . $line; |
|
| 104 | + $line = "\r\n".$line; |
|
| 105 | 105 | } |
| 106 | 106 | $header .= rtrim($line, "\r\n"); |
| 107 | 107 | } while ($header !== ''); |
@@ -158,8 +158,8 @@ |
||
| 158 | 158 | ksort($parts); |
| 159 | 159 | return array_reduce( |
| 160 | 160 | $parts, |
| 161 | - function ($carry, $item) { |
|
| 162 | - return $carry . $item; |
|
| 161 | + function($carry, $item) { |
|
| 162 | + return $carry.$item; |
|
| 163 | 163 | }, |
| 164 | 164 | '' |
| 165 | 165 | ); |
@@ -168,7 +168,7 @@ discard block |
||
| 168 | 168 | */ |
| 169 | 169 | public function __construct(array $filter = []) |
| 170 | 170 | { |
| 171 | - $params = [ 'hascontent', 'multipart', 'textpart', 'signedpart', 'headers' ]; |
|
| 171 | + $params = ['hascontent', 'multipart', 'textpart', 'signedpart', 'headers']; |
|
| 172 | 172 | foreach ($params as $param) { |
| 173 | 173 | if (isset($filter[$param])) { |
| 174 | 174 | $this->__set($param, $filter[$param]); |
@@ -190,8 +190,8 @@ discard block |
||
| 190 | 190 | if (!in_array($value, $valid)) { |
| 191 | 191 | $last = array_pop($valid); |
| 192 | 192 | throw new InvalidArgumentException( |
| 193 | - '$value parameter for ' . $name . ' must be one of ' |
|
| 194 | - . join(', ', $valid) . ' or ' . $last . ' - "' . $value |
|
| 193 | + '$value parameter for '.$name.' must be one of ' |
|
| 194 | + . join(', ', $valid).' or '.$last.' - "'.$value |
|
| 195 | 195 | . '" provided' |
| 196 | 196 | ); |
| 197 | 197 | } |
@@ -206,11 +206,11 @@ discard block |
||
| 206 | 206 | */ |
| 207 | 207 | public function setHeaders(array $headers) |
| 208 | 208 | { |
| 209 | - array_walk($headers, function ($v, $k) { |
|
| 209 | + array_walk($headers, function($v, $k) { |
|
| 210 | 210 | $this->validateArgument( |
| 211 | 211 | 'headers', |
| 212 | 212 | $k, |
| 213 | - [ static::FILTER_EXCLUDE, static::FILTER_INCLUDE ] |
|
| 213 | + [static::FILTER_EXCLUDE, static::FILTER_INCLUDE] |
|
| 214 | 214 | ); |
| 215 | 215 | if (!is_array($v)) { |
| 216 | 216 | throw new InvalidArgumentException( |
@@ -238,7 +238,7 @@ discard block |
||
| 238 | 238 | $this->validateArgument( |
| 239 | 239 | $name, |
| 240 | 240 | $value, |
| 241 | - [ static::FILTER_OFF, static::FILTER_EXCLUDE, static::FILTER_INCLUDE ] |
|
| 241 | + [static::FILTER_OFF, static::FILTER_EXCLUDE, static::FILTER_INCLUDE] |
|
| 242 | 242 | ); |
| 243 | 243 | $this->$name = $value; |
| 244 | 244 | } elseif ($name === 'headers') { |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | |
| 50 | 50 | $pbChildren = $partBuilder->getChildren(); |
| 51 | 51 | if (!empty($pbChildren)) { |
| 52 | - $this->children = array_map(function ($child) use ($stream) { |
|
| 52 | + $this->children = array_map(function($child) use ($stream) { |
|
| 53 | 53 | $childPart = $child->createMessagePart($stream); |
| 54 | 54 | $childPart->parent = $this; |
| 55 | 55 | return $childPart; |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | */ |
| 66 | 66 | protected function getAllNonFilteredParts() |
| 67 | 67 | { |
| 68 | - $parts = [ $this ]; |
|
| 68 | + $parts = [$this]; |
|
| 69 | 69 | foreach ($this->children as $part) { |
| 70 | 70 | if ($part instanceof MimePart) { |
| 71 | 71 | $parts = array_merge( |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | if (!empty($filter)) { |
| 117 | 117 | return array_values(array_filter( |
| 118 | 118 | $parts, |
| 119 | - [ $filter, 'filter' ] |
|
| 119 | + [$filter, 'filter'] |
|
| 120 | 120 | )); |
| 121 | 121 | } |
| 122 | 122 | return $parts; |
@@ -164,7 +164,7 @@ discard block |
||
| 164 | 164 | public function getChildParts(PartFilter $filter = null) |
| 165 | 165 | { |
| 166 | 166 | if ($filter !== null) { |
| 167 | - return array_values(array_filter($this->children, [ $filter, 'filter' ])); |
|
| 167 | + return array_values(array_filter($this->children, [$filter, 'filter'])); |
|
| 168 | 168 | } |
| 169 | 169 | return $this->children; |
| 170 | 170 | } |
@@ -234,7 +234,7 @@ discard block |
||
| 234 | 234 | $this->children, |
| 235 | 235 | ($position === null) ? count($this->children) : $position, |
| 236 | 236 | 0, |
| 237 | - [ $part ] |
|
| 237 | + [$part] |
|
| 238 | 238 | ); |
| 239 | 239 | $this->onChange(); |
| 240 | 240 | } |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | { |
| 147 | 147 | return $this->getInstance( |
| 148 | 148 | 'partFilterFactory', |
| 149 | - __NAMESPACE__ . '\Message\PartFilterFactory' |
|
| 149 | + __NAMESPACE__.'\Message\PartFilterFactory' |
|
| 150 | 150 | ); |
| 151 | 151 | } |
| 152 | 152 | |
@@ -194,7 +194,7 @@ discard block |
||
| 194 | 194 | { |
| 195 | 195 | return $this->getInstance( |
| 196 | 196 | 'streamFactory', |
| 197 | - __NAMESPACE__ . '\Stream\StreamFactory' |
|
| 197 | + __NAMESPACE__.'\Stream\StreamFactory' |
|
| 198 | 198 | ); |
| 199 | 199 | } |
| 200 | 200 | |
@@ -207,7 +207,7 @@ discard block |
||
| 207 | 207 | } |
| 208 | 208 | return $this->getInstance( |
| 209 | 209 | 'partStreamFilterManagerFactory', |
| 210 | - __NAMESPACE__ . '\Message\Part\PartStreamFilterManagerFactory' |
|
| 210 | + __NAMESPACE__.'\Message\Part\PartStreamFilterManagerFactory' |
|
| 211 | 211 | ); |
| 212 | 212 | } |
| 213 | 213 | |
@@ -88,7 +88,7 @@ |
||
| 88 | 88 | * |
| 89 | 89 | * @param ParentHeaderPart $part |
| 90 | 90 | * @return MimePart the newly-created MimePart |
| 91 | - */ |
|
| 91 | + */ |
|
| 92 | 92 | public function createNewContentPartFrom(ParentHeaderPart $part) |
| 93 | 93 | { |
| 94 | 94 | $mime = $this->partBuilderFactory->newPartBuilder($this->mimePartFactory)->createMessagePart(); |
@@ -105,9 +105,9 @@ |
||
| 105 | 105 | public function overwrite8bitContentEncoding(Message $message) |
| 106 | 106 | { |
| 107 | 107 | $parts = $message->getAllParts(new PartFilter([ |
| 108 | - 'headers' => [ PartFilter::FILTER_INCLUDE => [ |
|
| 108 | + 'headers' => [PartFilter::FILTER_INCLUDE => [ |
|
| 109 | 109 | 'Content-Transfer-Encoding' => '8bit' |
| 110 | - ] ] |
|
| 110 | + ]] |
|
| 111 | 111 | ])); |
| 112 | 112 | foreach ($parts as $part) { |
| 113 | 113 | $contentType = strtolower($part->getHeaderValue('Content-Type', 'text/plain')); |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | public function getUniqueBoundary($mimeType) |
| 56 | 56 | { |
| 57 | 57 | $type = ltrim(strtoupper(preg_replace('/^(multipart\/(.{3}).*|.*)$/i', '$2-', $mimeType)), '-'); |
| 58 | - return uniqid('----=MMP-' . $type . '.', true); |
|
| 58 | + return uniqid('----=MMP-'.$type.'.', true); |
|
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | /** |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | $part->setRawHeader( |
| 71 | 71 | 'Content-Type', |
| 72 | 72 | "$mimeType;\r\n\tboundary=\"" |
| 73 | - . $this->getUniqueBoundary($mimeType) . '"' |
|
| 73 | + . $this->getUniqueBoundary($mimeType).'"' |
|
| 74 | 74 | ); |
| 75 | 75 | } |
| 76 | 76 | |
@@ -34,9 +34,9 @@ |
||
| 34 | 34 | return $this->part->getRawHeaders(); |
| 35 | 35 | } elseif ($this->part->getParent() !== null && $this->part->getParent()->isMime()) { |
| 36 | 36 | return [ |
| 37 | - [ 'Content-Type', $this->part->getContentType() ], |
|
| 38 | - [ 'Content-Disposition', $this->part->getContentDisposition() ], |
|
| 39 | - [ 'Content-Transfer-Encoding', $this->part->getContentTransferEncoding() ] |
|
| 37 | + ['Content-Type', $this->part->getContentType()], |
|
| 38 | + ['Content-Disposition', $this->part->getContentDisposition()], |
|
| 39 | + ['Content-Transfer-Encoding', $this->part->getContentTransferEncoding()] |
|
| 40 | 40 | ]; |
| 41 | 41 | } |
| 42 | 42 | return []; |