IsProtected   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 14
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A evaluate() 0 5 2
1
<?php
2
3
namespace Psecio\Invoke\Match\Resource;
4
5
class IsProtected extends \Psecio\Invoke\MatchInstance
6
{
7
	/**
8
	 * Evaluate the provided resource to see if it's marked as protected
9
	 *
10
	 * @param \Psecio\Invoke\Resource $data Resource instance
11
	 * @return boolean Pass/fail status
12
	 */
13
	public function evaluate($data)
14
	{
15
		$setting = $this->getConfig('data');
16
		return (strtolower($setting) === 'on' && $data->user->isAuthed());
0 ignored issues
show
Bug introduced by
The property user does not seem to exist in Psecio\Invoke\Resource.

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
17
	}
18
}