Code Duplication    Length = 9-9 lines in 2 locations

src/Row.php 2 locations

@@ 130-138 (lines=9) @@
127
	 */
128
	public function getActiveRowProperty(ActiveRow $item, string $key)
129
	{
130
		if (preg_match('/^:([a-zA-Z0-9_$]+)\.([a-zA-Z0-9_$]+)(:([a-zA-Z0-9_$]+))?$/', $key, $matches)) {
131
			$relatedTable = $matches[1];
132
			$relatedColumn = $matches[2];
133
			$throughColumn = $matches[4] ?? null;
134
135
			$relatedRow = $item->related($relatedTable, $throughColumn)->fetch();
136
137
			return $relatedRow ? $relatedRow->{$relatedColumn} : null;
138
		}
139
140
		if (preg_match('/^([a-zA-Z0-9_$]+)\.([a-zA-Z0-9_$]+)(:([a-zA-Z0-9_$]+))?$/', $key, $matches)) {
141
			$referencedTable = $matches[1];
@@ 140-148 (lines=9) @@
137
			return $relatedRow ? $relatedRow->{$relatedColumn} : null;
138
		}
139
140
		if (preg_match('/^([a-zA-Z0-9_$]+)\.([a-zA-Z0-9_$]+)(:([a-zA-Z0-9_$]+))?$/', $key, $matches)) {
141
			$referencedTable = $matches[1];
142
			$referencedColumn = $matches[2];
143
			$throughColumn = $matches[4] ?? null;
144
145
			$referencedRow = $item->ref($referencedTable, $throughColumn);
146
147
			return $referencedRow ? $referencedRow->{$referencedColumn} : null;
148
		}
149
150
		return $item->{$key};
151
	}