Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
7 / 7
100.00% covered (success)
100.00%
4 / 4
CRAP
100.00% covered (success)
100.00%
1 / 1
Method
100.00% covered (success)
100.00%
7 / 7
100.00% covered (success)
100.00%
4 / 4
7
100.00% covered (success)
100.00%
1 / 1
 getMethodByName
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 get
100.00% covered (success)
100.00%
4 / 4
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
 objectProperty
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\Method as Model;
8
9final class Method extends AbstractModel
10{
11    public const KEY_PARAMETER_TYPE = 'parameterType';
12
13    public function getMethodByName(string $name): ?Model
14    {
15        return $this->get($name);
16    }
17
18    public function get($value): ?Model
19    {
20        foreach ($this->objects as $object) {
21            if ($object instanceof Model && $value === $object->getName()) {
22                return $object;
23            }
24        }
25
26        return null;
27    }
28
29    protected function objectClass(): string
30    {
31        return Model::class;
32    }
33
34    protected function objectProperty(): string
35    {
36        return 'methodName';
37    }
38}