Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
6 / 6
100.00% covered (success)
100.00%
4 / 4
CRAP
100.00% covered (success)
100.00%
1 / 1
AbstractAcl
100.00% covered (success)
100.00%
6 / 6
100.00% covered (success)
100.00%
4 / 4
4
100.00% covered (success)
100.00%
1 / 1
 __construct
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
1 / 1
1
 setName
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
1 / 1
1
 getName
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 __toString
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2/**
3 * Pop PHP Framework (http://www.popphp.org/)
4 *
5 * @link       https://github.com/popphp/popphp-framework
6 * @author     Nick Sagona, III <dev@nolainteractive.com>
7 * @copyright  Copyright (c) 2009-2023 NOLA Interactive, LLC. (http://www.nolainteractive.com)
8 * @license    http://www.popphp.org/license     New BSD License
9 */
10
11/**
12 * @namespace
13 */
14namespace Pop\Acl;
15
16use Pop\Utils;
17
18/**
19 * Abstract ACL role class
20 *
21 * @category   Pop
22 * @package    Pop\Acl
23 * @author     Nick Sagona, III <dev@nolainteractive.com>
24 * @copyright  Copyright (c) 2009-2023 NOLA Interactive, LLC. (http://www.nolainteractive.com)
25 * @license    http://www.popphp.org/license     New BSD License
26 * @version    3.4.0
27 */
28abstract class AbstractAcl extends Utils\ArrayObject
29{
30
31    /**
32     * Role name
33     * @var string
34     */
35    protected $name = null;
36
37    /**
38     * Constructor
39     *
40     * Instantiate the acl role object
41     *
42     * @param  string $name
43     * @param  array  $data
44     */
45    public function __construct($name, array $data = [])
46    {
47        $this->setName($name);
48        parent::__construct($data);
49    }
50
51    /**
52     * Set the acl role name
53     *
54     * @param  string $name
55     * @return AbstractAcl
56     */
57    public function setName($name)
58    {
59        $this->name = $name;
60        return $this;
61    }
62
63    /**
64     * Get the acl role name
65     *
66     * @return string
67     */
68    public function getName()
69    {
70        return $this->name;
71    }
72
73    /**
74     * Return the string value of the name of the acl role
75     *
76     * @return string
77     */
78    public function __toString()
79    {
80        return $this->name;
81    }
82
83}