截流自动化的商城平台
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

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