PluginProbe
User Access Manager / 2.1.11
User Access Manager v2.1.11
2.3.20 2.3.19 2.3.18 2.3.17 2.3.16 2.3.15 2.3.14 2.3.13 trunk 0.6 0.6.1 0.6.2 0.7 0.7 Beta 0.7.0.1 0.8 0.8.0.1 0.8.0.2 0.9 0.9.1 0.9.1.1 0.9.1.2 0.9.1.3 0.9.1.4 1.0 All 136 releases
← All changes | src/Form/MultipleFormElement.php +35 -15 2.3.17 → 2.1.11 View file →
@@ -1,28 +1,48 @@
1 1 <?php
2 -
3 -declare(strict_types=1);
4 -
2 +/**
3 + * MultipleFormElement.php
4 + *
5 + * The MultipleFormElement class file.
6 + *
7 + * PHP versions 5
8 + *
9 + * @author Alexander Schneider <[email protected]>
10 + * @copyright 2008-2017 Alexander Schneider
11 + * @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2
12 + * @version SVN: $id$
13 + * @link http://wordpress.org/extend/plugins/user-access-manager/
14 + */
5 15 namespace UserAccessManager\Form;
6 16
7 -use Exception;
8 -
17 +/**
18 + * Class MultipleFormElement
19 + *
20 + * @package UserAccessManager\Form
21 + */
9 22 abstract class MultipleFormElement extends ValueSetFormElement
10 23 {
11 24 /**
25 + * @var MultipleFormElementValue[]
26 + */
27 + protected $possibleValues;
28 +
29 + /**
30 + * MultipleFormElement constructor.
31 + *
32 + * @param string $id
12 33 * @param MultipleFormElementValue[] $possibleValues
13 - * @throws Exception
34 + * @param mixed|null $value
35 + * @param string|null $label
36 + * @param string|null $description
37 + *
38 + * @throws \Exception
14 39 */
15 - public function __construct(
16 - string $id,
17 - array $possibleValues,
18 - mixed $value = null,
19 - ?string $label = null,
20 - ?string $description = null
21 - ) {
40 + public function __construct($id, array $possibleValues, $value = null, $label = null, $description = null)
41 + {
22 42 foreach ($possibleValues as $possibleValue) {
23 43 if (($possibleValue instanceof MultipleFormElementValue) === false) {
24 - throw new Exception('Values must be MultipleFormElementValue objects');
44 + throw new \Exception('Values must be MultipleFormElementValue objects');
25 45 }
26 46 }
27 47
28 48 parent::__construct($id, $possibleValues, $value, $label, $description);
@@ -30,9 +50,9 @@
30 50
31 51 /**
32 52 * @return MultipleFormElementValue[]
33 53 */
34 - public function getPossibleValues(): array
54 + public function getPossibleValues()
35 55 {
36 56 return $this->possibleValues;
37 57 }
38 58 }