ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ClientId.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2018 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4namespace ILIAS\Data;
5
12{
16 private $clientId = '';
17
22 public function __construct(string $clientId)
23 {
24 if (preg_match('/[^A-Za-z0-9#_\.\-]/', $clientId)) {
25 throw new \InvalidArgumentException('Invalid value for $clientId');
26 }
27
28 $this->clientId = $clientId;
29 }
30
34 public function toString() : string
35 {
36 return $this->clientId;
37 }
38
42 public function __toString() : string
43 {
44 return $this->toString();
45 }
46}
An exception for terminatinating execution or to throw for unit testing.
__construct(string $clientId)
ClientId constructor.
Definition: ClientId.php:22