Lines 100.00% 2 / 2
Functions and Methods 100.00% 2 / 2
Classes and Traits 100.00% 1 / 1
Name Lines Functions and Methods CRAP Classes and Traits
ServiceDefinition 100.00% 2 / 2 100.00% 2 / 2 3 100.00% 1 / 1
 __construct 100.00% 1 / 1 100.00% 1 / 1 1
 belongsOnHandle 100.00% 1 / 1 100.00% 1 / 1 2
1<?php
2
3declare(strict_types=1);
4
5namespace Stewart\Codegen\Service;
6
7final readonly class ServiceDefinition
8{
9    /** @param list<ServiceField> $fields */
10    public function __construct(
11        public string $domain,
12        public string $name,
13        public ?string $title,
14        public ?string $description,
15        public array $fields,
16        public ServiceTargetSpec $target,
17        public bool $returnsResponse,
18    ) {}
19
20    public function belongsOnHandle(string $domain): bool
21    {
22        return $this->domain === $domain && $this->target->acceptsDomain($domain);
23    }
24
25}