Code Duplication    Length = 16-16 lines in 2 locations

src/IMAPMessage.php 1 location

@@ 152-167 (lines=16) @@
149
		return '';
150
	}
151
152
	public function parameters() {
153
		if ( !$this->parameters ) {
154
			$structure = $this->structure();
155
156
			$this->parameters['bytes'] = @$structure->bytes;
157
158
			foreach ((array) @$structure->parameters as $param) {
159
				$this->parameters[ strtolower($param->attribute) ] = $param->value;
160
			}
161
			foreach ((array) @$structure->dparameters as $param) {
162
				$this->parameters[ strtolower($param->attribute) ] = $param->value;
163
			}
164
		}
165
166
		return $this->parameters;
167
	}
168
169
	public function simpleStructure() {
170
		$parts = [];

src/IMAPMessagePart.php 1 location

@@ 75-90 (lines=16) @@
72
		return $this->structure;
73
	}
74
75
	public function parameters() {
76
		if ( !$this->parameters ) {
77
			$structure = $this->structure();
78
79
			$this->parameters['bytes'] = @$structure->bytes;
80
81
			foreach ((array) @$structure->parameters as $param) {
82
				$this->parameters[ strtolower($param->attribute) ] = $param->value;
83
			}
84
			foreach ((array) @$structure->dparameters as $param) {
85
				$this->parameters[ strtolower($param->attribute) ] = $param->value;
86
			}
87
		}
88
89
		return $this->parameters;
90
	}
91
92
	public function parameter( $name ) {
93
		$parameters = $this->parameters();