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

AJenbo / agcms / 21420560247

28 Jan 2026 12:59AM UTC coverage: 52.306% (-1.4%) from 53.72%
21420560247

push

github

AJenbo
Bump phpunit/phpunit from 9.6.11 to 9.6.33 in /application

Bumps [phpunit/phpunit](https://github.com/sebastianbergmann/phpunit) from 9.6.11 to 9.6.33.
- [Release notes](https://github.com/sebastianbergmann/phpunit/releases)
- [Changelog](https://github.com/sebastianbergmann/phpunit/blob/9.6.33/ChangeLog-9.6.md)
- [Commits](https://github.com/sebastianbergmann/phpunit/compare/9.6.11...9.6.33)

---
updated-dependencies:
- dependency-name: phpunit/phpunit
  dependency-version: 9.6.33
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>

3039 of 5810 relevant lines covered (52.31%)

12.21 hits per line

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

84.0
/application/inc/Services/SiteTreeService.php
1
<?php
2

3
namespace App\Services;
4

5
use App\Models\Category;
6
use App\Models\CustomPage;
7

8
class SiteTreeService
9
{
10
    /**
11
     * Get site tree data.
12
     *
13
     * @param int[] $openCategories
14
     *
15
     * @return array<string, mixed>
16
     */
17
    public function getSiteTreeData(array $openCategories, string $inputType = '', ?int $selectedId = null): array
18
    {
19
        $orm = app(OrmService::class);
2✔
20

21
        $category = null;
2✔
22
        if (null !== $selectedId) {
2✔
23
            $category = $orm->getOne(Category::class, $selectedId);
2✔
24
        }
25

26
        $rootCategories = $orm->getByQuery(Category::class, 'SELECT * FROM kat WHERE bind IS NULL');
2✔
27

28
        $customPages = [];
2✔
29
        if (!$inputType) {
2✔
30
            $customPages = $orm->getByQuery(
×
31
                CustomPage::class,
×
32
                'SELECT * FROM `special` WHERE `id` > 1 ORDER BY `navn`'
×
33
            );
×
34
        }
35

36
        return [
2✔
37
            'selectedCategory' => $category,
2✔
38
            'openCategories'   => $this->getOpenCategories($openCategories, $selectedId),
2✔
39
            'includePages'     => (!$inputType || 'pages' === $inputType),
2✔
40
            'inputType'        => $inputType,
2✔
41
            'node'             => ['children' => $rootCategories],
2✔
42
            'customPages'      => $customPages,
2✔
43
        ];
2✔
44
    }
45

46
    /**
47
     * Get ids of open categories.
48
     *
49
     * @param int[] $openCategories
50
     *
51
     * @return int[]
52
     */
53
    private function getOpenCategories(array $openCategories, ?int $selectedId = null): array
54
    {
55
        if (null !== $selectedId) {
2✔
56
            $category = app(OrmService::class)->getOne(Category::class, $selectedId);
2✔
57
            if ($category) {
2✔
58
                foreach ($category->getBranch() as $category) {
2✔
59
                    $openCategories[] = $category->getId();
2✔
60
                }
61
            }
62
        }
63

64
        return $openCategories;
2✔
65
    }
66
}
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