InstanceQuery   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
eloc 2
c 0
b 0
f 0
dl 0
loc 11
rs 10
ccs 0
cts 3
cp 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A hasInstance() 0 3 1
1
<?php
2
3
namespace Jalle19\StatusManager\Database;
4
5
use Jalle19\StatusManager\Configuration\Instance as ConfiguredInstance;
6
use Jalle19\StatusManager\Database\Base\InstanceQuery as BaseInstanceQuery;
7
8
/**
9
 * @package   Jalle19\StatusManager\Database
10
 * @copyright Copyright &copy; Sam Stenvall 2015-
11
 * @license   https://www.gnu.org/licenses/gpl.html The GNU General Public License v2.0
12
 */
13
class InstanceQuery extends BaseInstanceQuery
14
{
15
16
	/**
17
	 * @param ConfiguredInstance $instance
18
	 *
19
	 * @return bool whether the instance exists in the database
20
	 */
21
	public function hasInstance(ConfiguredInstance $instance)
22
	{
23
		return $this->findPk($instance->getName()) !== null;
24
	}
25
26
}
27