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

daycry / twig / 25524567684

07 May 2026 06:21PM UTC coverage: 60.954% (-18.5%) from 79.433%
25524567684

push

github

daycry
chore(ci): bump toolchain to PHP 8.5; rector 2.x, devkit 1.3, framework 4.7

Brings the toolchain in line with what we actually want to support and what
the audit work needs to live on long-term.

composer.json
- "php": ">=8.2" (CI matrix already drops 8.1; was implicit since the
  codebase relies on enums / readonly / first-class callables).
- "rector/rector": "^2.0" — fixes incompatibility with PHP 8.5 + the
  phpdoc-parser version installed by phpstan.
- "codeigniter4/devkit": "^1.3" — required for rector ^2.0.
- "codeigniter4/framework": "^4.7" — pulls in laminas-escaper 2.18+ which
  supports PHP 8.5 (2.17 capped at 8.4).

rector.php
- Rewritten for the rector 2.x namespace layout:
  * Rector\Core\ValueObject\PhpVersion → Rector\ValueObject\PhpVersion
  * PHPUnitSetList::PHPUNIT_SPECIFIC_METHOD → PHPUNIT_CODE_QUALITY
  * PHPUNIT_80 → PHPUNIT_100 (matches the PHPUnit 10.5 we actually run)
  * Removed rules that no longer exist in 2.x (ForToForeachRector, several
    PSR4 / Php56 rules) and skips for non-existent rules.
- target phpVersion bumped to PHP_82.

phpstan.neon.dist + baseline
- excludePaths marked optional with " (?)" (required by phpstan 2.x).
- baseline migrated from phpstan-baseline.php to phpstan-baseline.neon and
  regenerated against the new rector output and stricter analyser; deleted
  the old .php file.

.github/workflows/
- phpunit / rector matrices bumped to ['8.2', '8.3', '8.4', '8.5'] (8.1
  removed); coveralls publishes from 8.5.
- phpstan matrix likewise bumped (was '7.4', '8.0', '8.1').
- phpcsfixer / deptrac / phpcpd single-version steps moved to '8.5'.
- rector.yml drops "composer global require rector:^0.14" and uses the
  pinned vendor/bin/rector instead.
- phpcpd.yml path fixed: "app/ tests/" → "src/ tests/".
- deptrac.yml path filter fixed: "depfile.yaml" → "deptrac.yaml".

Tests
- declare(strict_types=1) added to every test file by rector (auto-applied
  during the bump). Plus minor cs-fixer formatting touch-ups; n... (continued)

1010 of 1657 relevant lines covered (60.95%)

10.11 hits per line

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

38.46
/src/Helpers/twig_helper.php
1
<?php
2

3
use Daycry\Twig\Config\Services;
4
use Daycry\Twig\Twig;
5

6
if (! function_exists('twig_instance')) {
1✔
7
    /**
8
     * Load the shared Twig service instance.
9
     */
10
    function twig_instance(): Twig
11
    {
12
        return Services::twig();
1✔
13
    }
14
}
15

16
if (! function_exists('twig_render')) {
1✔
17
    /**
18
     * Render a Twig template through the shared service. Equivalent to
19
     * `Services::twig()->render($view, $params)` but reads better in
20
     * controller code.
21
     */
22
    function twig_render(string $view, array $params = []): string
23
    {
24
        return Services::twig()->render($view, $params);
×
25
    }
26
}
27

28
if (! function_exists('twig_display')) {
1✔
29
    /**
30
     * Render and echo a Twig template through the shared service.
31
     */
32
    function twig_display(string $view, array $params = []): void
33
    {
34
        Services::twig()->display($view, $params);
×
35
    }
36
}
37

38
if (! function_exists('twig_capture')) {
1✔
39
    /**
40
     * Run a callable and return what it would have written to stdout. Useful
41
     * when integrating snippets that `display()` directly inside controllers
42
     * that need the resulting string instead.
43
     */
44
    function twig_capture(callable $fn): string
45
    {
46
        ob_start();
×
47

48
        try {
49
            $fn();
×
50

51
            return (string) ob_get_clean();
×
52
        } catch (Throwable $e) {
×
53
            ob_end_clean();
×
54

55
            throw $e;
×
56
        }
57
    }
58
}
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