1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* Mockery |
4
|
|
|
* |
5
|
|
|
* LICENSE |
6
|
|
|
* |
7
|
|
|
* This source file is subject to the new BSD license that is bundled |
8
|
|
|
* with this package in the file LICENSE.txt. |
9
|
|
|
* It is also available through the world-wide-web at this URL: |
10
|
|
|
* http://github.com/padraic/mockery/blob/master/LICENSE |
11
|
|
|
* If you did not receive a copy of the license and are unable to |
12
|
|
|
* obtain it through the world-wide-web, please send an email |
13
|
|
|
* to [email protected] so we can send you a copy immediately. |
14
|
|
|
* |
15
|
|
|
* @category Mockery |
16
|
|
|
* @package Mockery |
17
|
|
|
* @copyright Copyright (c) 2010 Pádraic Brady (http://blog.astrumfutura.com) |
18
|
|
|
* @license http://github.com/padraic/mockery/blob/master/LICENSE New BSD License |
19
|
|
|
*/ |
20
|
|
|
|
21
|
|
|
namespace Mockery\Generator; |
22
|
|
|
|
23
|
|
|
class UndefinedTargetClass implements TargetClassInterface |
24
|
|
|
{ |
25
|
|
|
private $name; |
26
|
|
|
|
27
|
17 |
|
public function __construct($name) |
28
|
|
|
{ |
29
|
17 |
|
$this->name = $name; |
30
|
17 |
|
} |
31
|
|
|
|
32
|
17 |
|
public static function factory($name) |
33
|
|
|
{ |
34
|
17 |
|
return new self($name); |
35
|
|
|
} |
36
|
|
|
|
37
|
17 |
|
public function getName() |
38
|
|
|
{ |
39
|
17 |
|
return $this->name; |
40
|
|
|
} |
41
|
|
|
|
42
|
|
|
public function isAbstract() |
43
|
|
|
{ |
44
|
|
|
return false; |
45
|
|
|
} |
46
|
|
|
|
47
|
17 |
|
public function isFinal() |
48
|
|
|
{ |
49
|
17 |
|
return false; |
50
|
|
|
} |
51
|
|
|
|
52
|
|
|
public function isTrait() |
53
|
|
|
{ |
54
|
|
|
return false; |
55
|
|
|
} |
56
|
|
|
|
57
|
17 |
|
public function getMethods() |
58
|
|
|
{ |
59
|
17 |
|
return array(); |
60
|
|
|
} |
61
|
|
|
|
62
|
|
|
public function getInterfaces() |
63
|
|
|
{ |
64
|
|
|
return array(); |
65
|
|
|
} |
66
|
|
|
|
67
|
|
|
public function getNamespaceName() |
68
|
|
|
{ |
69
|
|
|
$parts = explode("\\", ltrim($this->getName(), "\\")); |
70
|
|
|
array_pop($parts); |
71
|
|
|
return implode("\\", $parts); |
72
|
|
|
} |
73
|
|
|
|
74
|
|
|
public function inNamespace() |
75
|
|
|
{ |
76
|
|
|
return $this->getNamespaceName() !== ''; |
77
|
|
|
} |
78
|
|
|
|
79
|
|
|
public function getShortName() |
80
|
|
|
{ |
81
|
|
|
$parts = explode("\\", $this->getName()); |
82
|
|
|
return array_pop($parts); |
83
|
|
|
} |
84
|
|
|
|
85
|
17 |
|
public function implementsInterface($interface) |
86
|
|
|
{ |
87
|
17 |
|
return false; |
88
|
|
|
} |
89
|
|
|
|
90
|
17 |
|
public function hasInternalAncestor() |
91
|
|
|
{ |
92
|
17 |
|
return false; |
93
|
|
|
} |
94
|
|
|
} |
95
|
|
|
|