for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Jlis\Judge\Judges;
/**
* @author Julius Ehrlich <[email protected]>
*/
class ValueJudge extends AbstractValueJudge
{
* {@inheritdoc}
public function decide($value, $user = null, $defaultValue = false)
if (! $this->valueExists($value)) {
return $defaultValue;
}
$rules = $this->getValueRules($value);
if (! is_array($rules)) {
return $rules;
foreach ($rules as $rule) {
if (false !== $value = $this->decideRules($rule, $user)) {
return $value;
public function valueExists($value)
return isset($this->values[$value]);
public function getValues()
return $this->adapter->getValues();
* @param $value
*
* @return mixed
private function getValueRules($value)
return $this->values[$value];