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

tylernathanreed / jira-client-php / 13834920235

13 Mar 2025 12:45PM UTC coverage: 71.089% (-2.2%) from 73.289%
13834920235

push

github

tylernathanreed
Merge branch 'master' of github.com:tylernathanreed/jira-client-php

3976 of 5593 relevant lines covered (71.09%)

9.76 hits per line

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

72.73
/src/Dto.php
1
<?php
2

3
namespace Jira\Client;
4

5
use JsonSerializable;
6
use ReflectionClass;
7
use ReflectionProperty;
8

9
abstract readonly class Dto implements JsonSerializable
10
{
11
    /** @return array<string,mixed> */
12
    public function toArray(): array
136✔
13
    {
14
        $properties = [];
136✔
15

16
        foreach ((new ReflectionClass($this))->getProperties(ReflectionProperty::IS_PUBLIC) as $property) {
136✔
17
            $properties[$property->getName()] = $property->getValue($this);
136✔
18
        }
19

20
        return array_map(function ($value) {
136✔
21
            if ($value instanceof Dto) {
136✔
22
                return $value->toArray();
×
23
            }
24

25
            return $value;
136✔
26
        }, $properties);
136✔
27
    }
28

29
    /** @return array<string,mixed> */
30
    public function jsonSerialize(): array
×
31
    {
32
        return $this->toArray();
×
33
    }
34
}
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