ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
Factory.php
Go to the documentation of this file.
1 <?php
2 
19 namespace ILIAS\StaticURL\Response;
20 
22 
26 class Factory
27 {
28  public function __construct(
29  private Context $context
30  ) {
31  }
32 
33  public function cannot(): CannotHandle
34  {
35  return new CannotHandle();
36  }
37 
39  {
40  if ($this->context->isUserLoggedIn()) {
41  return new CannotReach();
42  }
43  if (!$this->context->isUserLoggedIn() && !$this->context->isPublicSectionActive()) {
44  return new CannotReach();
45  }
46 
47  return new MaybeCanHandlerAfterLogin();
48  }
49 
50  public function can(string $uri_path): CanHandleWithURIPath
51  {
52  return new CanHandleWithURIPath($uri_path);
53  }
54 }
$context
Definition: webdav.php:31
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(private Context $context)
Definition: Factory.php:28