Code Duplication    Length = 3-5 lines in 2 locations

apps/comments/lib/Dav/EntityCollection.php 1 location

@@ 70-72 (lines=3) @@
67
	) {
68
		foreach(['id', 'name'] as $property) {
69
			$$property = trim($$property);
70
			if(empty($$property) || !is_string($$property)) {
71
				throw new \InvalidArgumentException('"' . $property . '" parameter must be non-empty string');
72
			}
73
		}
74
		$this->id = $id;
75
		$this->name = $name;

lib/private/Comments/Manager.php 1 location

@@ 186-190 (lines=5) @@
183
	 * @throws \InvalidArgumentException
184
	 */
185
	protected function checkRoleParameters($role, $type, $id) {
186
		if (!is_string($type) || empty($type) ||
187
		    !is_string($id) || ($id === '')
188
		) {
189
			throw new \InvalidArgumentException($role . ' parameters must be a non-blank string');
190
		}
191
	}
192
193
	/**