Code Duplication    Length = 16-16 lines in 2 locations

apps/dav/lib/CalDAV/Search/Xml/Filter/LimitFilter.php 1 location

@@ 28-43 (lines=16) @@
25
use Sabre\Xml\XmlDeserializable;
26
use OCA\DAV\CalDAV\Search\SearchPlugin;
27
28
class LimitFilter implements XmlDeserializable {
29
30
	/**
31
	 * @param Reader $reader
32
	 * @throws BadRequest
33
	 * @return int
34
	 */
35
	static function xmlDeserialize(Reader $reader) {
36
		$value = $reader->parseInnerTree();
37
		if (!is_int($value) && !is_string($value)) {
38
			throw new BadRequest('The {' . SearchPlugin::NS_Nextcloud . '}limit has illegal value');
39
		}
40
41
		return intval($value);
42
	}
43
}

apps/dav/lib/CalDAV/Search/Xml/Filter/OffsetFilter.php 1 location

@@ 28-43 (lines=16) @@
25
use Sabre\Xml\XmlDeserializable;
26
use OCA\DAV\CalDAV\Search\SearchPlugin;
27
28
class OffsetFilter implements XmlDeserializable {
29
30
	/**
31
	 * @param Reader $reader
32
	 * @throws BadRequest
33
	 * @return int
34
	 */
35
	static function xmlDeserialize(Reader $reader) {
36
		$value = $reader->parseInnerTree();
37
		if (!is_int($value) && !is_string($value)) {
38
			throw new BadRequest('The {' . SearchPlugin::NS_Nextcloud . '}offset has illegal value');
39
		}
40
41
		return intval($value);
42
	}
43
}