Passed
Push — developer ( 7cf2c5...92d385 )
by Radosław
15:53
created

SmsProviderField   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 4
eloc 5
dl 0
loc 15
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getOperator() 0 3 2
A getValue() 0 6 2
1
<?php
2
/**
3
 * SMS provider query condition field file.
4
 *
5
 * @package UIType
6
 *
7
 * @copyright YetiForce S.A.
8
 * @license   YetiForce Public License 5.0 (licenses/LicenseEN.txt or yetiforce.com)
9
 * @author    Adrian Kon <[email protected]>
10
 */
11
12
namespace App\Conditions\QueryFields;
13
14
/**
15
 * SMS provider query condition field class.
16
 */
17
class SmsProviderField extends BaseField
18
{
19
	/** {@inheritdoc} */
20
	public function getValue()
21
	{
22
		if (\is_array($this->value)) {
23
			return $this->value;
24
		}
25
		return explode('##', $this->value);
26
	}
27
28
	/** {@inheritdoc} */
29
	public function getOperator(): string
30
	{
31
		return 'a' === $this->operator ? 'e' : $this->operator;
32
	}
33
}
34