• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

eliashaeussler / typo3-codeception-helper / 19571682840

21 Nov 2025 10:58AM UTC coverage: 77.707% (-3.0%) from 80.69%
19571682840

push

github

web-flow
[TASK] Update armin/editorconfig-cli to v2.2.0

| datasource | package                | from  | to    |
| ---------- | ---------------------- | ----- | ----- |
| packagist  | armin/editorconfig-cli | 2.1.1 | 2.2.0 |

122 of 157 relevant lines covered (77.71%)

2.27 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

92.0
/src/ValueObject/Entrypoint.php
1
<?php
2

3
declare(strict_types=1);
4

5
/*
6
 * This file is part of the Composer package "eliashaeussler/typo3-codeception-helper".
7
 *
8
 * Copyright (C) 2023-2025 Elias Häußler <elias@haeussler.dev>
9
 *
10
 * This program is free software: you can redistribute it and/or modify
11
 * it under the terms of the GNU General Public License as published by
12
 * the Free Software Foundation, either version 2 of the License, or
13
 * (at your option) any later version.
14
 *
15
 * This program is distributed in the hope that it will be useful,
16
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
 * GNU General Public License for more details.
19
 *
20
 * You should have received a copy of the GNU General Public License
21
 * along with this program. If not, see <https://www.gnu.org/licenses/>.
22
 */
23

24
namespace EliasHaeussler\Typo3CodeceptionHelper\ValueObject;
25

26
use EliasHaeussler\Typo3CodeceptionHelper\Exception;
27
use Symfony\Component\Filesystem;
28

29
use function array_key_exists;
30

31
/**
32
 * Entrypoint.
33
 *
34
 * @author Elias Häußler <elias@haeussler.dev>
35
 * @license GPL-2.0-or-later
36
 */
37
final readonly class Entrypoint
38
{
39
    /**
40
     * @param non-empty-string $webDirectory
41
     * @param non-empty-string $mainEntrypoint
42
     * @param non-empty-string $appEntrypoint
43
     */
44
    public function __construct(
11✔
45
        private string $webDirectory,
46
        private string $mainEntrypoint = 'index.php',
47
        private string $appEntrypoint = 'app.php',
48
        private bool $optional = false,
49
    ) {}
11✔
50

51
    /**
52
     * @param array<string, mixed> $config
53
     * @param non-empty-string     $baseDirectory
54
     *
55
     * @throws Exception\ConfigIsEmpty
56
     * @throws Exception\ConfigIsInvalid
57
     */
58
    public static function fromConfig(array $config, string $baseDirectory): self
8✔
59
    {
60
        $webDirectory = Filesystem\Path::join($baseDirectory, self::parseConfig($config, 'web-dir'));
8✔
61
        $mainEntrypoint = self::parseConfig($config, 'main-entrypoint', 'index.php');
6✔
62
        $appEntrypoint = self::parseConfig($config, 'app-entrypoint', 'app.php');
4✔
63
        $optional = (bool) ($config['optional'] ?? false);
2✔
64

65
        return new self($webDirectory, $mainEntrypoint, $appEntrypoint, $optional);
2✔
66
    }
67

68
    /**
69
     * @param array<string, mixed>  $config
70
     * @param non-empty-string      $name
71
     * @param non-empty-string|null $default
72
     *
73
     * @return non-empty-string
74
     *
75
     * @throws Exception\ConfigIsEmpty
76
     * @throws Exception\ConfigIsInvalid
77
     */
78
    private static function parseConfig(array $config, string $name, ?string $default = null): string
8✔
79
    {
80
        if (!array_key_exists($name, $config) && null !== $default) {
8✔
81
            return $default;
1✔
82
        }
83

84
        $value = $config[$name] ?? null;
8✔
85

86
        if (!is_string($value)) {
8✔
87
            throw new Exception\ConfigIsInvalid($name);
3✔
88
        }
89
        if ('' === $value) {
7✔
90
            throw new Exception\ConfigIsEmpty($name);
3✔
91
        }
92

93
        return $value;
6✔
94
    }
95

96
    /**
97
     * @return non-empty-string
98
     */
99
    public function getWebDirectory(): string
1✔
100
    {
101
        return $this->webDirectory;
1✔
102
    }
103

104
    /**
105
     * @return non-empty-string
106
     */
107
    public function getMainEntrypoint(): string
1✔
108
    {
109
        return Filesystem\Path::join($this->webDirectory, $this->mainEntrypoint);
1✔
110
    }
111

112
    /**
113
     * @return non-empty-string
114
     */
115
    public function getAppEntrypoint(): string
1✔
116
    {
117
        return Filesystem\Path::join($this->webDirectory, $this->appEntrypoint);
1✔
118
    }
119

120
    public function isOptional(): bool
×
121
    {
122
        return $this->optional;
×
123
    }
124
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc