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 
4 namespace ILIAS\Data;
5 
14 class Factory
15 {
19  private $colorfactory;
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 }
color($value)
Color is a data type representing a color in HTML.
Definition: Factory.php:50
error($e)
Get an error result.
Definition: Factory.php:38
A password is used as part of credentials for authentication.
Definition: Password.php:13
$colorfactory
cache for color factory.
Definition: Factory.php:19
The scope of this class is split ilias-conform URI&#39;s into components.
Definition: URI.php:17
Builds data types.
Definition: Factory.php:14
password($pass)
Get a password.
Definition: Factory.php:76
clientId(string $clientId)
Definition: Factory.php:85
ok($value)
Get an ok result.
Definition: Factory.php:27
uri($uri_string)
Object representing an uri valid according to RFC 3986 with restrictions imposed on valid characters ...
Definition: Factory.php:65
if(array_key_exists('provider', $_GET)) elseif(array_key_exists('provider', $_SESSION)) if(!in_array($providerName, ['Google', 'Microsoft', 'Yahoo'])) $clientId