ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
Factory.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 2017 Richard Klees <richard.klees@concepts-and-training.de> Extended GPL, see docs/LICENSE */
3
4namespace ILIAS\Data;
5
15{
20
27 public function ok($value)
28 {
29 return new Result\Ok($value);
30 }
31
38 public function error($e)
39 {
40 return new Result\Error($e);
41 }
42
50 public function color($value)
51 {
52 if (!$this->colorfactory) {
53 $this->colorfactory = new Color\Factory();
54 }
55 return $this->colorfactory->build($value);
56 }
65 public function uri($uri_string)
66 {
67 return new URI($uri_string);
68 }
69
76 public function password($pass)
77 {
78 return new Password($pass);
79 }
80
85 public function clientId(string $clientId) : ClientId
86 {
87 return new ClientId($clientId);
88 }
89}
An exception for terminatinating execution or to throw for unit testing.
Builds a Color from either hex- or rgb values.
Definition: Factory.php:14
Builds data types.
Definition: Factory.php:15
color($value)
Color is a data type representing a color in HTML.
Definition: Factory.php:50
$colorfactory
cache for color factory.
Definition: Factory.php:19
clientId(string $clientId)
Definition: Factory.php:85
uri($uri_string)
Object representing an uri valid according to RFC 3986 with restrictions imposed on valid characters ...
Definition: Factory.php:65
ok($value)
Get an ok result.
Definition: Factory.php:27
error($e)
Get an error result.
Definition: Factory.php:38
password($pass)
Get a password.
Definition: Factory.php:76
A password is used as part of credentials for authentication.
Definition: Password.php:14
A result encapsulates a value or an error and simplifies the handling of those.
Definition: Error.php:14
A result encapsulates a value or an error and simplifies the handling of those.
Definition: Ok.php:14
The scope of this class is split ilias-conform URI's into components.
Definition: URI.php:18
if(array_key_exists('provider', $_GET)) elseif(array_key_exists( 'provider', $_SESSION)) if(!in_array($providerName, ['Google', 'Microsoft', 'Yahoo'])) $clientId