Code Duplication    Length = 3-3 lines in 4 locations

apps/workflowengine/lib/Check/FileSize.php 1 location

@@ 88-90 (lines=3) @@
85
	 * @throws \UnexpectedValueException
86
	 */
87
	public function validateCheck($operator, $value) {
88
		if (!in_array($operator, ['less', '!less', 'greater', '!greater'])) {
89
			throw new \UnexpectedValueException($this->l->t('The given operator is invalid'), 1);
90
		}
91
92
		if (!preg_match('/^[0-9]+[ ]?[kmgt]?b$/i', $value)) {
93
			throw new \UnexpectedValueException($this->l->t('The given file size is invalid'), 2);

apps/workflowengine/lib/Check/FileSystemTags.php 1 location

@@ 92-94 (lines=3) @@
89
	 * @throws \UnexpectedValueException
90
	 */
91
	public function validateCheck($operator, $value) {
92
		if (!in_array($operator, ['is', '!is'])) {
93
			throw new \UnexpectedValueException($this->l->t('The given operator is invalid'), 1);
94
		}
95
96
		try {
97
			$this->systemTagManager->getTagsByIds($value);

apps/workflowengine/lib/Check/RequestTime.php 1 location

@@ 108-110 (lines=3) @@
105
	 * @throws \UnexpectedValueException
106
	 */
107
	public function validateCheck($operator, $value) {
108
		if (!in_array($operator, ['in', '!in'])) {
109
			throw new \UnexpectedValueException($this->l->t('The given operator is invalid'), 1);
110
		}
111
112
		$regexValue = '\"' . self::REGEX_TIME . ' ' . self::REGEX_TIMEZONE . '\"';
113
		$result = preg_match('/^\[' . $regexValue . ',' . $regexValue . '\]$/', $value, $matches);

apps/workflowengine/lib/Check/UserGroupMembership.php 1 location

@@ 91-93 (lines=3) @@
88
	 * @throws \UnexpectedValueException
89
	 */
90
	public function validateCheck($operator, $value) {
91
		if (!in_array($operator, ['is', '!is'])) {
92
			throw new \UnexpectedValueException($this->l->t('The given operator is invalid'), 1);
93
		}
94
95
		if (!$this->groupManager->groupExists($value)) {
96
			throw new \UnexpectedValueException($this->l->t('The given group does not exist'), 2);