|
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
|
17 |
|
public function getMethods() |
|
53
|
|
|
{ |
|
54
|
17 |
|
return array(); |
|
55
|
|
|
} |
|
56
|
|
|
|
|
57
|
|
|
public function getInterfaces() |
|
58
|
|
|
{ |
|
59
|
|
|
return array(); |
|
60
|
|
|
} |
|
61
|
|
|
|
|
62
|
17 |
|
public function getNamespaceName() |
|
63
|
|
|
{ |
|
64
|
17 |
|
$parts = explode("\\", ltrim($this->getName(), "\\")); |
|
65
|
17 |
|
array_pop($parts); |
|
66
|
17 |
|
return implode("\\", $parts); |
|
67
|
|
|
} |
|
68
|
|
|
|
|
69
|
17 |
|
public function inNamespace() |
|
70
|
|
|
{ |
|
71
|
17 |
|
return $this->getNamespaceName() !== ''; |
|
72
|
|
|
} |
|
73
|
|
|
|
|
74
|
17 |
|
public function getShortName() |
|
75
|
|
|
{ |
|
76
|
17 |
|
$parts = explode("\\", $this->getName()); |
|
77
|
17 |
|
return array_pop($parts); |
|
78
|
|
|
} |
|
79
|
|
|
|
|
80
|
17 |
|
public function implementsInterface($interface) |
|
81
|
|
|
{ |
|
82
|
17 |
|
return false; |
|
83
|
|
|
} |
|
84
|
|
|
|
|
85
|
17 |
|
public function hasInternalAncestor() |
|
86
|
|
|
{ |
|
87
|
17 |
|
return false; |
|
88
|
|
|
} |
|
89
|
|
|
} |
|
90
|
|
|
|