| Code Coverage
| Classes and Traits | Functions and Methods | Lines
Total | 0.00% covered (danger) | 0.00% | 0 / 1 | 33.33% covered (danger) | 33.33% | 4 / 12 | CRAP | 40.00% covered (danger) | 40.00% | 6 / 15
DefinedTargetClass | 0.00% covered (danger) | 0.00% | 0 / 1 | 33.33% covered (danger) | 33.33% | 4 / 12 | 43.10 | 40.00% covered (danger) | 40.00% | 6 / 15
__construct(\ReflectionClass $rfc) | 100.00% covered (success) | 100.00% | 1 / 1 | 1 | 100.00% covered (success) | 100.00% | 2 / 2
factory($name) | 100.00% covered (success) | 100.00% | 1 / 1 | 1 | 100.00% covered (success) | 100.00% | 1 / 1
getName() | 100.00% covered (success) | 100.00% | 1 / 1 | 1 | 100.00% covered (success) | 100.00% | 1 / 1
isAbstract() | 0.00% covered (danger) | 0.00% | 0 / 1 | 2 | 0.00% covered (danger) | 0.00% | 0 / 1
isFinal() | 100.00% covered (success) | 100.00% | 1 / 1 | 1 | 100.00% covered (success) | 100.00% | 1 / 1
getMethods() | 0.00% covered (danger) | 0.00% | 0 / 1 | 1.12 | 50.00% covered (warning) | 50.00% | 1 / 2
anonymous function ($interface) use ($class) | 0.00% covered (danger) | 0.00% | 0 / 1 | 2 | 0.00% covered (danger) | 0.00% | 0 / 2
getInterfaces() | 0.00% covered (danger) | 0.00% | 0 / 1 | 2 | 0.00% covered (danger) | 0.00% | 0 / 1
__toString() | 0.00% covered (danger) | 0.00% | 0 / 1 | 2 | 0.00% covered (danger) | 0.00% | 0 / 1
getNamespaceName() | 0.00% covered (danger) | 0.00% | 0 / 1 | 2 | 0.00% covered (danger) | 0.00% | 0 / 1
inNamespace() | 0.00% covered (danger) | 0.00% | 0 / 1 | 2 | 0.00% covered (danger) | 0.00% | 0 / 1
getShortName() | 0.00% covered (danger) | 0.00% | 0 / 1 | 2 | 0.00% covered (danger) | 0.00% | 0 / 1

1 | <?php
2 |
3 | namespace Mockery\Generator;
4 |
5 | class DefinedTargetClass
6 | {
7 | private $rfc;
8 |
9 | public function __construct(\ReflectionClass $rfc)
10 | {
11 | $this->rfc = $rfc;
12 | }
13 |
14 | public static function factory($name)
15 | {
16 | return new self(new \ReflectionClass($name));
17 | }
18 |
19 | public function getName()
20 | {
21 | return $this->rfc->getName();
22 | }
23 |
24 | public function isAbstract()
25 | {
26 | return $this->rfc->isAbstract();
27 | }
28 |
29 | public function isFinal()
30 | {
31 | return $this->rfc->isFinal();
32 | }
33 |
34 | public function getMethods()
35 | {
36 | return array_map(function ($method) {
37 | return new Method($method);
38 | }, $this->rfc->getMethods());
39 | }
40 |
41 | public function getInterfaces()
42 | {
43 | $class = __CLASS__;
44 | return array_map(function ($interface) use ($class) {
45 | return new $class($interface);
46 | }, $this->rfc->getInterfaces());
47 | }
48 |
49 | public function __toString()
50 | {
51 | return $this->getName();
52 | }
53 |
54 | public function getNamespaceName()
55 | {
56 | return $this->rfc->getNamespaceName();
57 | }
58 |
59 | public function inNamespace()
60 | {
61 | return $this->rfc->inNamespace();
62 | }
63 |
64 | public function getShortName()
65 | {
66 | return $this->rfc->getShortName();
67 | }
68 | }