예제 #1
0
파일: ConfigTest.php 프로젝트: galmi/xacml
 public function testMissingKey()
 {
     try {
         \Galmi\Xacml\Config::get('test2');
     } catch (\Exception $e) {
         $this->assertEquals("Key test2 not exists.", $e->getMessage());
     }
 }
예제 #2
0
 /**
  * Retrieve attributeId value using AttributeFinder
  *
  * @inheritdoc
  */
 public function evaluate(Request $request)
 {
     try {
         $attributeFinder = Config::get(Config::ATTRIBUTE_FINDER);
         $value = $attributeFinder->getValue($request, $this->attributeId);
     } catch (\Exception $e) {
         return Match::INDETERMINATE;
     }
     if ($value == null && $this->mustBePresent) {
         return Match::INDETERMINATE;
     }
     return $value;
 }
예제 #3
0
파일: Apply.php 프로젝트: galmi/xacml
 /**
  * Get function from functionId
  *
  * @return \Galmi\Xacml\Func\FuncInterface
  * @throws \Galmi\Xacml\Exception\FunctionNotFoundException
  */
 public function getFunc()
 {
     $funcFactory = Config::get(Config::FUNC_REGISTRY);
     return $funcFactory->get($this->functionId);
 }
예제 #4
0
 public function __construct()
 {
     $this->funcFactory = Config::get(Config::FUNC_REGISTRY);
 }