# packeta/trunk/deps/nette/utils/src/StaticClass.php

Packeta, version trunk. 33 lines.

- Page: https://pluginprobe.com/plugins/packeta/trunk/code/deps/nette/utils/src/StaticClass.php
- Raw: https://pluginprobe.com/plugins/packeta/trunk/raw/deps/nette/utils/src/StaticClass.php
- Modified: 2025-03-10T10:47:38+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/packeta/trunk/code/deps/nette/utils/src/StaticClass.php#L10-L20`.

```php
<?php

/**
 * This file is part of the Nette Framework (https://nette.org)
 * Copyright (c) 2004 David Grudl (https://davidgrudl.com)
 */
declare (strict_types=1);
namespace Packetery\Nette;

/**
 * Static class.
 */
trait StaticClass
{
    /**
     * @return never
     * @throws \Error
     */
    public final function __construct()
    {
        throw new \Error('Class ' . static::class . ' is static and cannot be instantiated.');
    }
    /**
     * Call to undefined static method.
     * @return void
     * @throws MemberAccessException
     */
    public static function __callStatic(string $name, array $args)
    {
        Utils\ObjectHelpers::strictStaticCall(static::class, $name);
    }
}

```
