Completed
Push — master ( e3e1e6...8ca8f6 )
by Rudie
02:01
created
src/IMAPMessageContent.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -8,12 +8,12 @@  discard block
 block discarded – undo
8 8
 	protected $parts = []; // Array<rdx\imap\IMAPMessagePart>
9 9
 	protected $parameters = [];
10 10
 
11
-	public function allParts( $withContainers = false ) {
11
+	public function allParts($withContainers = false) {
12 12
 		$parts = [];
13 13
 		$iterate = function($message) use (&$iterate, &$parts, $withContainers) {
14
-			foreach ( $message->parts() as $part ) {
15
-				if ( $part->parts() ) {
16
-					if ( $withContainers ) {
14
+			foreach ($message->parts() as $part) {
15
+				if ($part->parts()) {
16
+					if ($withContainers) {
17 17
 						$parts[] = $part;
18 18
 					}
19 19
 
@@ -29,57 +29,57 @@  discard block
 block discarded – undo
29 29
 		return $parts;
30 30
 	}
31 31
 
32
-	public function part( $index ) {
32
+	public function part($index) {
33 33
 		$parts = $this->parts();
34 34
 		return @$parts[$index];
35 35
 	}
36 36
 
37 37
 	public function parameters() {
38
-		if ( empty($this->parameters) ) {
38
+		if (empty($this->parameters)) {
39 39
 			$structure = $this->structure();
40 40
 
41 41
 			$this->parameters['bytes'] = @$structure->bytes;
42 42
 
43
-			foreach ((array) @$structure->parameters as $param) {
44
-				$this->parameters[ strtolower($param->attribute) ] = $param->value;
43
+			foreach ((array)@$structure->parameters as $param) {
44
+				$this->parameters[strtolower($param->attribute)] = $param->value;
45 45
 			}
46
-			foreach ((array) @$structure->dparameters as $param) {
47
-				$this->parameters[ strtolower($param->attribute) ] = $param->value;
46
+			foreach ((array)@$structure->dparameters as $param) {
47
+				$this->parameters[strtolower($param->attribute)] = $param->value;
48 48
 			}
49 49
 		}
50 50
 
51 51
 		return $this->parameters;
52 52
 	}
53 53
 
54
-	public function parameter( $name ) {
54
+	public function parameter($name) {
55 55
 		$parameters = $this->parameters();
56
-		return @$parameters[ strtolower($name) ];
56
+		return @$parameters[strtolower($name)];
57 57
 	}
58 58
 
59
-	public function subtypePart( $subtypes, $recursive ) {
60
-		$subtypes = (array) $subtypes;
59
+	public function subtypePart($subtypes, $recursive) {
60
+		$subtypes = (array)$subtypes;
61 61
 		$method = [$this, $recursive ? 'allParts' : 'parts'];
62 62
 		$parts = call_user_func($method);
63 63
 		array_unshift($parts, $this);
64 64
 
65
-		foreach ( $parts as $part ) {
66
-			if ( in_array($part->subtype(), $subtypes) ) {
65
+		foreach ($parts as $part) {
66
+			if (in_array($part->subtype(), $subtypes)) {
67 67
 				return $part;
68 68
 			}
69 69
 		}
70 70
 	}
71 71
 
72
-	public function subtypeContent( $subtypes, $recursive ) {
73
-		if ( $part = $this->subtypePart($subtypes, $recursive) ) {
72
+	public function subtypeContent($subtypes, $recursive) {
73
+		if ($part = $this->subtypePart($subtypes, $recursive)) {
74 74
 			return $part->content();
75 75
 		}
76 76
 	}
77 77
 
78
-	public function text( $recursive = false ) {
78
+	public function text($recursive = false) {
79 79
 		return $this->subtypeContent($this->mailbox()->getTextSubtypes(), $recursive);
80 80
 	}
81 81
 
82
-	public function html( $recursive = false ) {
82
+	public function html($recursive = false) {
83 83
 		return $this->subtypeContent($this->mailbox()->getHtmlSubtypes(), $recursive);
84 84
 	}
85 85
 
Please login to merge, or discard this patch.