ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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\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->name = 'custom';
29 $this->icon_path = $icon_path;
30 $this->aria_label = $aria_label;
31 $this->size = $size;
32 }
33
37 public function getIconPath()
38 {
39 return $this->icon_path;
40 }
41}
An exception for terminatinating execution or to throw for unit testing.
__construct($icon_path, $aria_label, $size)
Definition: Custom.php:18
checkStringArg($which, $value)
Throw an InvalidArgumentException if $value is no string.
trait ComponentHelper
Provides common functionality for component implementations.
checkArgIsElement($which, $value, $array, $name)
Throw an InvalidArgumentException if $value is not an element of array.