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

tempestphp / tempest-framework / 14049246919

24 Mar 2025 09:42PM UTC coverage: 79.353% (-0.04%) from 79.391%
14049246919

push

github

web-flow
feat(support): support array parameters in string manipulations (#1073)

48 of 48 new or added lines in 2 files covered. (100.0%)

735 existing lines in 126 files now uncovered.

10492 of 13222 relevant lines covered (79.35%)

90.78 hits per line

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

93.33
/src/Tempest/Generation/src/DataObjects/StubFile.php
1
<?php
2

3
declare(strict_types=1);
4

5
namespace Tempest\Generation\DataObjects;
6

7
use InvalidArgumentException;
8
use Nette\InvalidStateException;
9
use ReflectionException;
10
use Tempest\Generation\ClassManipulator;
11
use Tempest\Generation\Enums\StubFileType;
12

13
/**
14
 * Represents a file that is to be generated.
15
 */
16
final readonly class StubFile
17
{
18
    public function __construct(
46✔
19
        public string $filePath,
20
        public StubFileType $type,
21
    ) {}
46✔
22

23
    /**
24
     * @param string|class-string $pathOrClass The path of the file or the class-string
25
     */
26
    public static function from(string $pathOrClass): self
46✔
27
    {
28
        try {
29
            new ClassManipulator($pathOrClass);
46✔
30

31
            return new self(
35✔
32
                filePath: $pathOrClass,
35✔
33
                type: StubFileType::CLASS_FILE,
35✔
34
            );
35✔
35
        } catch (InvalidStateException|ReflectionException) {
13✔
36
            if (! file_exists($pathOrClass)) {
13✔
UNCOV
37
                throw new InvalidArgumentException(sprintf('The file "%s" does not exist.', $pathOrClass));
×
38
            }
39

40
            return new self(
13✔
41
                filePath: $pathOrClass,
13✔
42
                type: StubFileType::RAW_FILE,
13✔
43
            );
13✔
44
        }
45
    }
46
}
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