Code Duplication    Length = 8-8 lines in 2 locations

Form.php 2 locations

@@ 399-406 (lines=8) @@
396
			// Get the fields elements for a given group.
397
			$elements = &$this->findGroup($group);
398
399
			foreach ($elements as &$element)
400
			{
401
				// Get an array of <fieldset /> elements and fieldset attributes within the fields element.
402
				if ($tmp = $element->xpath('descendant::fieldset[@name] | descendant::field[@fieldset]/@fieldset'))
403
				{
404
					$sets = array_merge($sets, (array) $tmp);
405
				}
406
			}
407
		}
408
		else
409
		{
@@ 1353-1360 (lines=8) @@
1350
			$elements = &$this->findGroup($group);
1351
1352
			// Get all of the field elements with the correct name for the fields elements.
1353
			foreach ($elements as $element)
1354
			{
1355
				// If there are matching field elements add them to the fields array.
1356
				if ($tmp = $element->xpath('descendant::field[@name="' . $name . '"]'))
1357
				{
1358
					$fields = array_merge($fields, $tmp);
1359
				}
1360
			}
1361
1362
			// Make sure something was found.
1363
			if (!$fields)