ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
Custom.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 2017 Nils Haagen <nils.haagen@concepts-and-training.de> Extended GPL, see docs/LICENSE */
3
5
8
9class Custom extends Icon implements C\Symbol\Icon\Custom
10{
11
15 private $icon_path;
16
17
19 {
20 $this->checkStringArg("string", $icon_path);
21 $this->checkStringArg("string", $aria_label);
22 $this->checkArgIsElement(
23 "size",
24 $size,
25 self::$possible_sizes,
26 implode('/', self::$possible_sizes)
27 );
28 $this->checkBoolArg("is_disabled", $is_disabled);
29 $this->name = 'custom';
30 $this->icon_path = $icon_path;
31 $this->aria_label = $aria_label;
32 $this->size = $size;
33 $this->is_disabled = $is_disabled;
34 }
35
39 public function getIconPath()
40 {
41 return $this->icon_path;
42 }
43}
An exception for terminatinating execution or to throw for unit testing.
__construct($icon_path, $aria_label, $size, $is_disabled)
Definition: Custom.php:18
checkStringArg($which, $value)
Throw an InvalidArgumentException if $value is no string.
checkBoolArg($which, $value)
Throw an InvalidArgumentException if $value is not a bool.
trait ComponentHelper
Provides common functionality for component implementations.
checkArgIsElement($which, $value, $array, $name)
Throw an InvalidArgumentException if $value is not an element of array.