Code Duplication    Length = 9-9 lines in 2 locations

src/Row.php 2 locations

@@ 144-152 (lines=9) @@
141
	 */
142
	public function getActiveRowProperty(ActiveRow $item, $key)
143
	{
144
		if (preg_match("/^:([a-zA-Z0-9_$]+)\.([a-zA-Z0-9_$]+)(:([a-zA-Z0-9_$]+))?$/", $key, $matches)) {
145
			$relatedTable = $matches[1];
146
			$relatedColumn = $matches[2];
147
			$throughColumn = isset($matches[4]) ? $matches[4] : null;
148
149
			$relatedRow = $item->related($relatedTable, $throughColumn)->fetch();
150
151
			return $relatedRow ? $relatedRow->{$relatedColumn} : null;
152
		}
153
154
		if (preg_match("/^([a-zA-Z0-9_$]+)\.([a-zA-Z0-9_$]+)(:([a-zA-Z0-9_$]+))?$/", $key, $matches)) {
155
			$referencedTable = $matches[1];
@@ 154-162 (lines=9) @@
151
			return $relatedRow ? $relatedRow->{$relatedColumn} : null;
152
		}
153
154
		if (preg_match("/^([a-zA-Z0-9_$]+)\.([a-zA-Z0-9_$]+)(:([a-zA-Z0-9_$]+))?$/", $key, $matches)) {
155
			$referencedTable = $matches[1];
156
			$referencedColumn = $matches[2];
157
			$throughColumn = isset($matches[4]) ? $matches[4] : null;
158
159
			$referencedRow = $item->ref($referencedTable, $throughColumn);
160
161
			return $referencedRow ? $referencedRow->{$referencedColumn} : null;
162
		}
163
164
		return $item->{$key};
165
	}