|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace Kunstmaan\GeneratorBundle\Helper; |
|
4
|
|
|
|
|
5
|
|
|
use Symfony\Component\DependencyInjection\ContainerBuilder; |
|
6
|
|
|
use Symfony\Component\DependencyInjection\ContainerInterface; |
|
7
|
|
|
use Symfony\Component\DependencyInjection\Extension\ExtensionInterface; |
|
8
|
|
|
use Symfony\Component\HttpKernel\Bundle\BundleInterface; |
|
9
|
|
|
|
|
10
|
|
|
/** |
|
11
|
|
|
* @internal |
|
12
|
|
|
*/ |
|
13
|
|
|
final class Sf4AppBundle implements BundleInterface |
|
14
|
|
|
{ |
|
15
|
|
|
private $projectDir; |
|
16
|
|
|
|
|
17
|
|
|
public function __construct($projectDir) |
|
18
|
|
|
{ |
|
19
|
|
|
$this->projectDir = $projectDir; |
|
20
|
|
|
} |
|
21
|
|
|
|
|
22
|
|
|
/** |
|
23
|
|
|
* Boots the Bundle. |
|
24
|
|
|
*/ |
|
25
|
|
|
public function boot() |
|
26
|
|
|
{ |
|
27
|
|
|
//no-op |
|
28
|
|
|
} |
|
29
|
|
|
|
|
30
|
|
|
/** |
|
31
|
|
|
* Shutdowns the Bundle. |
|
32
|
|
|
*/ |
|
33
|
|
|
public function shutdown() |
|
34
|
|
|
{ |
|
35
|
|
|
//no-op |
|
36
|
|
|
} |
|
37
|
|
|
|
|
38
|
|
|
/** |
|
39
|
|
|
* Builds the bundle. |
|
40
|
|
|
* |
|
41
|
|
|
* It is only ever called once when the cache is empty. |
|
42
|
|
|
*/ |
|
43
|
|
|
public function build(ContainerBuilder $container) |
|
44
|
|
|
{ |
|
45
|
|
|
//no-op |
|
46
|
|
|
} |
|
47
|
|
|
|
|
48
|
|
|
/** |
|
49
|
|
|
* Returns the container extension that should be implicitly loaded. |
|
50
|
|
|
* |
|
51
|
|
|
* @return ExtensionInterface|null The default extension or null if there is none |
|
52
|
|
|
*/ |
|
53
|
|
|
public function getContainerExtension() |
|
54
|
|
|
{ |
|
55
|
|
|
//no-op |
|
56
|
|
|
} |
|
57
|
|
|
|
|
58
|
|
|
/** |
|
59
|
|
|
* Returns the bundle name (the class short name). |
|
60
|
|
|
* |
|
61
|
|
|
* @return string The Bundle name |
|
62
|
|
|
*/ |
|
63
|
|
|
public function getName() |
|
64
|
|
|
{ |
|
65
|
|
|
return 'App'; |
|
66
|
|
|
} |
|
67
|
|
|
|
|
68
|
|
|
/** |
|
69
|
|
|
* Gets the Bundle namespace. |
|
70
|
|
|
* |
|
71
|
|
|
* @return string The Bundle namespace |
|
72
|
|
|
*/ |
|
73
|
|
|
public function getNamespace() |
|
74
|
|
|
{ |
|
75
|
|
|
return 'App'; |
|
76
|
|
|
} |
|
77
|
|
|
|
|
78
|
|
|
/** |
|
79
|
|
|
* Gets the Bundle directory path. |
|
80
|
|
|
* |
|
81
|
|
|
* The path should always be returned as a Unix path (with /). |
|
82
|
|
|
* |
|
83
|
|
|
* @return string The Bundle absolute path |
|
84
|
|
|
*/ |
|
85
|
|
|
public function getPath() |
|
86
|
|
|
{ |
|
87
|
|
|
return $this->projectDir . '/src'; |
|
88
|
|
|
} |
|
89
|
|
|
|
|
90
|
|
|
/** |
|
91
|
|
|
* Sets the container. |
|
92
|
|
|
*/ |
|
93
|
|
|
public function setContainer(ContainerInterface $container = null) |
|
94
|
|
|
{ |
|
95
|
|
|
//no-op |
|
96
|
|
|
} |
|
97
|
|
|
|
|
98
|
|
|
/** |
|
99
|
|
|
* Returns the bundle name that this bundle overrides. |
|
100
|
|
|
* |
|
101
|
|
|
* Despite its name, this method does not imply any parent/child relationship |
|
102
|
|
|
* between the bundles, just a way to extend and override an existing |
|
103
|
|
|
* bundle. |
|
104
|
|
|
* |
|
105
|
|
|
* @return string The Bundle name it overrides or null if no parent |
|
|
|
|
|
|
106
|
|
|
* |
|
107
|
|
|
* @deprecated This method is deprecated as of 3.4 and will be removed in 4.0. |
|
108
|
|
|
*/ |
|
109
|
|
|
public function getParent() |
|
110
|
|
|
{ |
|
111
|
|
|
//no-op |
|
112
|
|
|
} |
|
113
|
|
|
} |
|
114
|
|
|
|
This check compares the return type specified in the
@returnannotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.