File: anonclass.php

package info (click to toggle)
php-composer-class-map-generator 1.0.0-2%2Bdeb12u1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 3,584 kB
  • sloc: php: 4,130; makefile: 22
file content (43 lines) | stat: -rw-r--r-- 788 bytes parent folder | download | duplicates (5)
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
<?php

declare(strict_types = 1);

namespace Dummy\Test;

use Dummy\Common\TestCase;

class AnonClassHolder extends TestCase
{
    protected function getTest(): ClassAvailability
    {
        return new class extends ClassAvailability
        {
        };
    }

    protected function getTest2(): ClassAvailability
    {
        return new class(2) extends ClassAvailability
        {
        };
    }

    protected function getTest3(): ClassAvailability
    {
        return new class(2, 3) extends ClassAvailability
        {
        };
    }

    protected function getTest4(): ClassAvailability
    {
        return new class(2, 3) {
        };
    }

    protected function getTest5(): ClassAvailability
    {
        return new class implements FooInterface {
        };
    }
}