Code Duplication    Length = 9-9 lines in 2 locations

src/Row.php 2 locations

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