File: Php80Types.php

package info (click to toggle)
php-zend-code 4.16.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,648 kB
  • sloc: php: 13,824; xml: 2,327; makefile: 16
file content (58 lines) | stat: -rw-r--r-- 1,813 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<?php

namespace LaminasTest\Code\TestAsset;

use BadMethodCallException;

/**
 * This test assets contains new types introduced with the PHP 8.0.0 release
 *
 * @see https://www.php.net/ChangeLog-8.php#PHP_8_0
 * @see https://wiki.php.net/rfc/union_types_v2
 * @see https://www.php.net/manual/en/language.types.declarations.php#language.types.declarations.union
 * @see https://wiki.php.net/rfc/static_return_type
 * @see https://wiki.php.net/rfc/mixed_type_v2
 */
class Php80Types
{
    public function mixedType(mixed $parameter): mixed
    {
        throw new BadMethodCallException('Not supposed to be run');
    }

    /** Note: the false type cannot be used standalone, and must be part of a union type */
    public function falseType(false|self $parameter): false|self
    {
        throw new BadMethodCallException('Not supposed to be run');
    }

    public function unionNullableType(bool|null $parameter): bool|null
    {
        throw new BadMethodCallException('Not supposed to be run');
    }

    public function unionReverseNullableType(null|bool $parameter): null|bool
    {
        throw new BadMethodCallException('Not supposed to be run');
    }

    public function unionNullableTypeWithDefaultValue(bool|string|null $parameter = null): bool|string|null
    {
        throw new BadMethodCallException('Not supposed to be run');
    }

    public function unionType(Php80Types|\stdClass $parameter): Php80Types|\stdClass
    {
        throw new BadMethodCallException('Not supposed to be run');
    }

    public function staticType(self $parameter): static
    {
        throw new BadMethodCallException('Not supposed to be run');
    }

    public function selfAndBoolType(self|bool $parameter): self|bool
    {
        throw new BadMethodCallException('Not supposed to be run');
    }
}