ILIAS  release_7 Revision v7.30-3-g800a261c036
InvalidModification.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
26class InvalidModification extends \InvalidArgumentException
27{
28 public function __construct(LayoutModification $modification, $message = "")
29 {
30 // Context
31 $modification_class = get_class($modification);
32 $closure_file = 'Unknown';
33 $closure_line = 0;
34 try {
35 $closure = $modification->getModification();
36 $reflection = new \ReflectionFunction($closure);
37 $closure_file = $reflection->getClosureScopeClass()->getName();
38 $closure_line = $reflection->getStartLine();
39 } catch (\Throwable $e) {
40 // ignore
41 }
42 $message = sprintf(
43 "Invalid modification %s in %s (Line %s). %s",
44 $modification_class,
45 $closure_file,
46 $closure_line,
48 );
49
51 }
52}
An exception for terminatinating execution or to throw for unit testing.
__construct(LayoutModification $modification, $message="")
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
$message
Definition: xapiexit.php:14