ILIAS  release_7 Revision v7.30-3-g800a261c036
Css.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
21
22use LogicException;
23
29{
30 public const MEDIA_ALL = "all";
31 public const MEDIA_SCREEN = "screen";
32 public const MEDIA_PRINT = "print";
33 public const MEDIA_SPEECH = "speech";
34
39
45 public function __construct(string $content, string $version, string $media = self::MEDIA_SCREEN)
46 {
47 if (!in_array($media, [self::MEDIA_ALL, self::MEDIA_PRINT, self::MEDIA_SCREEN, self::MEDIA_SPEECH])) {
48 throw new LogicException("Invalid media type for CSS");
49 }
51 $this->media = $media;
52 }
53
57 public function getMedia() : string
58 {
59 return $this->media;
60 }
61}
An exception for terminatinating execution or to throw for unit testing.
__construct(string $content, string $version, string $media=self::MEDIA_SCREEN)
Css constructor.
Definition: Css.php:45
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc