Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
9 / 9
100.00% covered (success)
100.00%
4 / 4
CRAP
100.00% covered (success)
100.00%
1 / 1
StructAttribute
100.00% covered (success)
100.00%
9 / 9
100.00% covered (success)
100.00%
4 / 4
7
100.00% covered (success)
100.00%
1 / 1
 getStructAttributeByName
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getStructAttributeByCleanName
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getByCleanName
100.00% covered (success)
100.00%
6 / 6
100.00% covered (success)
100.00%
1 / 1
4
 objectClass
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2
3declare(strict_types=1);
4
5namespace WsdlToPhp\PackageGenerator\Container\Model;
6
7use WsdlToPhp\PackageGenerator\Model\StructAttribute as Model;
8
9final class StructAttribute extends AbstractModel
10{
11    public function getStructAttributeByName(string $name): ?Model
12    {
13        return $this->get($name);
14    }
15
16    public function getStructAttributeByCleanName(string $cleanedName): ?Model
17    {
18        return $this->getByCleanName($cleanedName);
19    }
20
21    public function getByCleanName(string $cleanedName): ?Model
22    {
23        $attribute = null;
24        foreach ($this->objects as $object) {
25            if ($object instanceof Model && $cleanedName === $object->getCleanName()) {
26                $attribute = $object;
27
28                break;
29            }
30        }
31
32        return $attribute;
33    }
34
35    protected function objectClass(): string
36    {
37        return Model::class;
38    }
39}