| 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 |
declare (strict_types=1); |
| 8 |
namespace Packetery\Nette; |
| 9 |
|
| 10 |
/** |
| 11 |
* Static class. |
| 12 |
*/ |
| 13 |
trait StaticClass |
| 14 |
{ |
| 15 |
/** |
| 16 |
* @return never |
| 17 |
* @throws \Error |
| 18 |
*/ |
| 19 |
public final function __construct() |
| 20 |
{ |
| 21 |
throw new \Error('Class ' . static::class . ' is static and cannot be instantiated.'); |
| 22 |
} |
| 23 |
/** |
| 24 |
* Call to undefined static method. |
| 25 |
* @return void |
| 26 |
* @throws MemberAccessException |
| 27 |
*/ |
| 28 |
public static function __callStatic(string $name, array $args) |
| 29 |
{ |
| 30 |
Utils\ObjectHelpers::strictStaticCall(static::class, $name); |
| 31 |
} |
| 32 |
} |
| 33 |
|