summaryrefslogtreecommitdiffstats
path: root/src/Psecio/Gatekeeper/Restriction.php
blob: 2a98d93503e5f03bd44117f05e10df581a758c79 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?php

namespace Psecio\Gatekeeper;

abstract class Restriction
{
    /**
     * Restriction configuration
     * @var array
     */
    private $config = array();

    /**
     * Init the object and set the configuration
     *
     * @param array $config Configuration settings
     */
    public function __construct(array $config)
    {
        $this->setConfig($config);
    }

    /**
     * Set the configuration property
     *
     * @param array $config Configuration settings
     */
    public function setConfig(array $config)
    {
        $this->config = $config;
    }

    /**
     * Get the confguration settings
     *
     * @return array Configuration settings
     */
    public function getConfig()
    {
        return $this->config;
    }

    /**
     * Evaluate the restriction based on given data
     *
     * @return boolean Pass/fail of restriction
     */
    abstract public function evaluate();
}