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

SmsProviderField::getValue()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 6
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 0
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