1: <?php
2:
3: /**
4: * This file is part of the Nette Framework (https://nette.org)
5: * Copyright (c) 2004 David Grudl (https://davidgrudl.com)
6: */
7:
8: namespace Nette;
9:
10:
11: /**
12: * Static class.
13: */
14: trait StaticClass
15: {
16:
17: /**
18: * @throws \LogicException
19: */
20: final public function __construct()
21: {
22: throw new \LogicException('Class ' . get_class($this) . ' is static and cannot be instantiated.');
23: }
24:
25:
26: /**
27: * Call to undefined static method.
28: * @throws MemberAccessException
29: */
30: public static function __callStatic($name, $args)
31: {
32: Utils\ObjectHelpers::strictStaticCall(get_called_class(), $name);
33: }
34: }
35: