ergebnis / classy

Compare 54932b5 ... +249 ... 36b189d

No flags found

Use flags to group coverage reports by test type, project and/or folders.
Then setup custom commit statuses and notifications for each flag.

e.g., #unittest #integration

#production #enterprise

#frontend #backend

Learn more about Codecov Flags here.

Showing 6 of 44 files from the diff.
Other files ignored by Codecov

@@ -3,7 +3,7 @@
Loading
3 3
declare(strict_types=1);
4 4
5 5
/**
6 -
 * Copyright (c) 2017-2020 Andreas Möller
6 +
 * Copyright (c) 2017-2021 Andreas Möller
7 7
 *
8 8
 * For the full copyright and license information, please view
9 9
 * the LICENSE.md file that was distributed with this source code.

@@ -3,7 +3,7 @@
Loading
3 3
declare(strict_types=1);
4 4
5 5
/**
6 -
 * Copyright (c) 2017-2020 Andreas Möller
6 +
 * Copyright (c) 2017-2021 Andreas Möller
7 7
 *
8 8
 * For the full copyright and license information, please view
9 9
 * the LICENSE.md file that was distributed with this source code.
@@ -22,10 +22,6 @@
Loading
22 22
23 23
    /**
24 24
     * Returns a new exception from a directory.
25 -
     *
26 -
     * @param string $directory
27 -
     *
28 -
     * @return self
29 25
     */
30 26
    public static function fromDirectory(string $directory): self
31 27
    {
@@ -41,8 +37,6 @@
Loading
41 37
42 38
    /**
43 39
     * Returns the directory.
44 -
     *
45 -
     * @return string
46 40
     */
47 41
    public function directory(): string
48 42
    {

@@ -3,7 +3,7 @@
Loading
3 3
declare(strict_types=1);
4 4
5 5
/**
6 -
 * Copyright (c) 2017-2020 Andreas Möller
6 +
 * Copyright (c) 2017-2021 Andreas Möller
7 7
 *
8 8
 * For the full copyright and license information, please view
9 9
 * the LICENSE.md file that was distributed with this source code.
@@ -26,8 +26,6 @@
Loading
26 26
     * Returns a new exception from constructs.
27 27
     *
28 28
     * @param Construct[] $constructs
29 -
     *
30 -
     * @return self
31 29
     */
32 30
    public static function fromConstructs(array $constructs): self
33 31
    {

@@ -3,7 +3,7 @@
Loading
3 3
declare(strict_types=1);
4 4
5 5
/**
6 -
 * Copyright (c) 2017-2020 Andreas Möller
6 +
 * Copyright (c) 2017-2021 Andreas Möller
7 7
 *
8 8
 * For the full copyright and license information, please view
9 9
 * the LICENSE.md file that was distributed with this source code.
@@ -32,8 +32,6 @@
Loading
32 32
33 33
    /**
34 34
     * Returns a string representation of the construct.
35 -
     *
36 -
     * @return string
37 35
     */
38 36
    public function __toString(): string
39 37
    {
@@ -42,10 +40,6 @@
Loading
42 40
43 41
    /**
44 42
     * Creates a new construct from a construct name.
45 -
     *
46 -
     * @param string $name
47 -
     *
48 -
     * @return self
49 43
     */
50 44
    public static function fromName(string $name): self
51 45
    {
@@ -54,8 +48,6 @@
Loading
54 48
55 49
    /**
56 50
     * Returns the name of the construct.
57 -
     *
58 -
     * @return string
59 51
     */
60 52
    public function name(): string
61 53
    {
@@ -76,8 +68,6 @@
Loading
76 68
     * Clones the construct and adds the file name to the list of files the construct is defined in.
77 69
     *
78 70
     * @param string ...$fileNames
79 -
     *
80 -
     * @return self
81 71
     */
82 72
    public function definedIn(string ...$fileNames): self
83 73
    {

@@ -3,7 +3,7 @@
Loading
3 3
declare(strict_types=1);
4 4
5 5
/**
6 -
 * Copyright (c) 2017-2020 Andreas Möller
6 +
 * Copyright (c) 2017-2021 Andreas Möller
7 7
 *
8 8
 * For the full copyright and license information, please view
9 9
 * the LICENSE.md file that was distributed with this source code.
@@ -18,8 +18,6 @@
Loading
18 18
    /**
19 19
     * Returns an array of names of classy constructs (classes, interfaces, traits) found in source.
20 20
     *
21 -
     * @param string $source
22 -
     *
23 21
     * @throws Exception\ParseError
24 22
     *
25 23
     * @return Construct[]
@@ -40,6 +38,19 @@
Loading
40 38
        $count = \count($sequence);
41 39
        $namespacePrefix = '';
42 40
41 +
        $namespaceSegmentOrNamespaceTokens = [
42 +
            \T_STRING,
43 +
        ];
44 +
45 +
        // https://wiki.php.net/rfc/namespaced_names_as_token
46 +
        if (\PHP_VERSION_ID >= 80000 && \defined('T_NAME_QUALIFIED')) {
47 +
            /** @var array<int> $namespaceSegmentOrNamespaceTokens */
48 +
            $namespaceSegmentOrNamespaceTokens = [
49 +
                \T_STRING,
50 +
                \T_NAME_QUALIFIED,
51 +
            ];
52 +
        }
53 +
43 54
        for ($index = 0; $index < $count; ++$index) {
44 55
            $token = $sequence[$index];
45 56
@@ -51,7 +62,7 @@
Loading
51 62
                for ($index = self::significantAfter($index, $sequence, $count); $index < $count; ++$index) {
52 63
                    $token = $sequence[$index];
53 64
54 -
                    if (\is_array($token) && \T_STRING !== $token[0]) {
65 +
                    if (\is_array($token) && !\in_array($token[0], $namespaceSegmentOrNamespaceTokens, true)) {
55 66
                        continue;
56 67
                    }
57 68
@@ -103,8 +114,6 @@
Loading
103 114
    /**
104 115
     * Returns an array of constructs defined in a directory.
105 116
     *
106 -
     * @param string $directory
107 -
     *
108 117
     * @throws Exception\DirectoryDoesNotExist
109 118
     * @throws Exception\MultipleDefinitionsFound
110 119
     *
@@ -184,11 +193,7 @@
Loading
184 193
    /**
185 194
     * Returns the index of the significant token after the index.
186 195
     *
187 -
     * @param int                                                 $index
188 196
     * @param array<int, array{0: int, 1: string, 2: int}|string> $sequence
189 -
     * @param int                                                 $count
190 -
     *
191 -
     * @return int
192 197
     */
193 198
    private static function significantAfter(int $index, array $sequence, int $count): int
194 199
    {
@@ -208,10 +213,7 @@
Loading
208 213
    /**
209 214
     * Returns the index of the significant token after the index.
210 215
     *
211 -
     * @param int                                                 $index
212 216
     * @param array<int, array{0: int, 1: string, 2: int}|string> $sequence
213 -
     *
214 -
     * @return int
215 217
     */
216 218
    private static function significantBefore(int $index, array $sequence): int
217 219
    {
@@ -232,8 +234,6 @@
Loading
232 234
     * Returns the string content of a token.
233 235
     *
234 236
     * @param array{0: int, 1: string, 2: int}|string $token
235 -
     *
236 -
     * @return string
237 237
     */
238 238
    private static function content($token): string
239 239
    {

Click to load this diff.
Loading diff...

Learn more Showing 2 files with coverage changes found.

Changes in src/Exception/ParseError.php
+2
Loading file...
Changes in src/Constructs.php
+1
Loading file...

251 Commits

Hiding 1 contexual commits Hiding 3 contexual commits Hiding 1 contexual commits Hiding 1 contexual commits
+6
+6
Hiding 1 contexual commits Hiding 1 contexual commits
-6
-6
Hiding 1 contexual commits Hiding 1 contexual commits Hiding 1 contexual commits Hiding 1 contexual commits Hiding 1 contexual commits Hiding 1 contexual commits Hiding 2 contexual commits Hiding 2 contexual commits Hiding 1 contexual commits Hiding 1 contexual commits Hiding 1 contexual commits Hiding 1 contexual commits Hiding 1 contexual commits Hiding 1 contexual commits Hiding 2 contexual commits
Hiding 2 contexual commits
+1
+1
Hiding 1 contexual commits
+6
+6
Hiding 1 contexual commits
Hiding 1 contexual commits Hiding 1 contexual commits Hiding 1 contexual commits
+2
+2