1 | <?php |
||
40 | class DatabaseManager |
||
41 | { |
||
42 | /** |
||
43 | * @var string The name of the default database. |
||
44 | */ |
||
45 | protected $defaultDatabaseName = null; |
||
46 | |||
47 | /** |
||
48 | * @var array An array of AgaviDatabases. |
||
49 | */ |
||
50 | protected $databases = array(); |
||
51 | |||
52 | /** |
||
53 | * @var Context A Context instance. |
||
54 | */ |
||
55 | protected $context = null; |
||
56 | |||
57 | /** |
||
58 | * Retrieve the current application context. |
||
59 | * |
||
60 | * @return Context The current Context instance. |
||
61 | * |
||
62 | * @author David Zülke <[email protected]> |
||
63 | * @since 0.11.0 |
||
64 | */ |
||
65 | final public function getContext() |
||
69 | |||
70 | /** |
||
71 | * Retrieve the database connection associated with this Database |
||
72 | * implementation. |
||
73 | * |
||
74 | * @param string $nme A database name. |
||
|
|||
75 | * |
||
76 | * @return mixed A Database instance. |
||
77 | * |
||
78 | * @throws DatabaseException If the requested database name does not exist. |
||
79 | * |
||
80 | * @author David Zülke <[email protected]> |
||
81 | * @author Sean Kerr <[email protected]> |
||
82 | * @since 0.9.0 |
||
83 | */ |
||
84 | public function getDatabase($name = null) |
||
99 | |||
100 | /** |
||
101 | * Retrieve the name of the given database instance. |
||
102 | * |
||
103 | * @param Database $database The database to fetch the name of. |
||
104 | * |
||
105 | * @return string The name of the database, or false if it was not found. |
||
106 | * |
||
107 | * @author David Zülke <[email protected]> |
||
108 | * @since 0.11.0 |
||
109 | */ |
||
110 | public function getDatabaseName(Database $database) |
||
114 | |||
115 | /** |
||
116 | * Returns the name of the default database. |
||
117 | * |
||
118 | * @return string The name of the default database. |
||
119 | * |
||
120 | * @author David Zülke <[email protected]> |
||
121 | * @since 0.11.0 |
||
122 | */ |
||
123 | public function getDefaultDatabaseName() |
||
127 | |||
128 | /** |
||
129 | * Initialize this DatabaseManager. |
||
130 | * |
||
131 | * @param Context $context A Context instance. |
||
132 | * @param array $parameters An array of initialization parameters. |
||
133 | * |
||
134 | * @throws InitializationException If an error occurs while initializing this DatabaseManager. |
||
135 | * |
||
136 | * @author David Zülke <[email protected]> |
||
137 | * @author Sean Kerr <[email protected]> |
||
138 | * @since 0.9.0 |
||
139 | */ |
||
140 | public function initialize(Context $context, array $parameters = array()) |
||
147 | |||
148 | /** |
||
149 | * Do any necessary startup work after initialization. |
||
150 | * |
||
151 | * This method is not called directly after initialize(). |
||
152 | * |
||
153 | * @author David Zülke <[email protected]> |
||
154 | * @since 0.11.0 |
||
155 | */ |
||
156 | public function startup() |
||
163 | |||
164 | /** |
||
165 | * Execute the shutdown procedure. |
||
166 | * |
||
167 | * @throws <b>AgaviDatabaseException</b> If an error occurs while shutting |
||
168 | * down this DatabaseManager. |
||
169 | * |
||
170 | * @author Sean Kerr <[email protected]> |
||
171 | * @since 0.9.0 |
||
172 | */ |
||
173 | public function shutdown() |
||
180 | } |
||
181 |
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter
$italy
is not defined by the methodfinale(...)
.The most likely cause is that the parameter was removed, but the annotation was not.