Code Duplication    Length = 11-15 lines in 3 locations

src/objects/JsonapiObject.php 1 location

@@ 85-96 (lines=12) @@
82
	/**
83
	 * @inheritDoc
84
	 */
85
	public function toArray() {
86
		$array = $this->getAtMembers();
87
		
88
		if ($this->version !== null) {
89
			$array['version'] = $this->version;
90
		}
91
		if ($this->meta !== null && $this->meta->isEmpty() === false) {
92
			$array['meta'] = $this->meta->toArray();
93
		}
94
		
95
		return $array;
96
	}
97
}
98

src/objects/LinkObject.php 1 location

@@ 88-98 (lines=11) @@
85
	/**
86
	 * @inheritDoc
87
	 */
88
	public function toArray() {
89
		$array = $this->getAtMembers();
90
		
91
		$array['href'] = $this->href;
92
		
93
		if ($this->meta !== null && $this->meta->isEmpty() === false) {
94
			$array['meta'] = $this->meta->toArray();
95
		}
96
		
97
		return $array;
98
	}
99
}
100

src/objects/ResourceIdentifierObject.php 1 location

@@ 174-188 (lines=15) @@
171
	/**
172
	 * @inheritDoc
173
	 */
174
	public function toArray() {
175
		$array = $this->getAtMembers();
176
		
177
		$array['type'] = $this->type;
178
		
179
		if ($this->id !== null) {
180
			$array['id'] = $this->id;
181
		}
182
		
183
		if ($this->meta !== null && $this->meta->isEmpty() === false) {
184
			$array['meta'] = $this->meta->toArray();
185
		}
186
		
187
		return $array;
188
	}
189
	
190
	/**
191
	 * ResourceInterface