1: <?php
2: /**
3: * Picon Framework
4: * http://code.google.com/p/picon-framework/
5: *
6: * Copyright (C) 2011-2012 Martin Cassidy <martin.cassidy@webquub.com>
7:
8: * Picon Framework is free software: you can redistribute it and/or modify
9: * it under the terms of the GNU General Public License as published by
10: * the Free Software Foundation, either version 3 of the License, or
11: * (at your option) any later version.
12:
13: * Picon Framework is distributed in the hope that it will be useful,
14: * but WITHOUT ANY WARRANTY; without even the implied warranty of
15: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16: * General Public License for more details.
17:
18: * You should have received a copy of the GNU General Public License
19: * along with Picon Framework. If not, see <http://www.gnu.org/licenses/>.
20: * */
21:
22: namespace picon;
23:
24: /**
25: * Class scanner rule in which a class must be declared in the given namespace
26: *
27: * @author Martin Cassidy
28: * @package scanner
29: */
30: class ClassNamespaceRule implements ClassScannerRule
31: {
32: private $namespace;
33:
34: /**
35: *
36: * @param String $namespace The name of the namespace
37: */
38: public function __construct($namespace)
39: {
40: $this->namespace = $namespace;
41: }
42:
43: public function matches($className, \ReflectionAnnotatedClass $reflection)
44: {
45: return $reflection->getNamespaceName()==$this->namespace;
46: }
47: }
48: ?>
49: