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

nette / php-generator / 14161583165

31 Mar 2025 12:29AM UTC coverage: 91.977%. First build
14161583165

push

github

dg
Factory::fromClassReflection() extracts property hook bodies (#172)

22 of 24 new or added lines in 2 files covered. (91.67%)

1754 of 1907 relevant lines covered (91.98%)

0.92 hits per line

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

75.0
/src/PhpGenerator/GlobalFunction.php
1
<?php
2

3
/**
4
 * This file is part of the Nette Framework (https://nette.org)
5
 * Copyright (c) 2004 David Grudl (https://davidgrudl.com)
6
 */
7

8
declare(strict_types=1);
9

10
namespace Nette\PhpGenerator;
11

12
use Nette;
13

14

15
/**
16
 * Definition of a global function.
17
 */
18
final class GlobalFunction
19
{
20
        use Traits\FunctionLike;
21
        use Traits\NameAware;
22
        use Traits\CommentAware;
23
        use Traits\AttributeAware;
24

25
        public static function from(string|\Closure $function, bool $withBody = false): self
1✔
26
        {
27
                return (new Factory)->fromFunctionReflection(Nette\Utils\Callback::toReflection($function), $withBody);
1✔
28
        }
29

30

31
        public function __toString(): string
32
        {
33
                return (new Printer)->printFunction($this);
1✔
34
        }
35

36

37
        public function __clone(): void
38
        {
39
                $this->parameters = array_map(fn($param) => clone $param, $this->parameters);
×
40
        }
41
}
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