1: <?php
2: /**
3: * @author Jefferson González
4: * @license MIT
5: * @link http://github.com/peg-org/peg-src Source code.
6: */
7:
8: namespace Peg\Lib\Definitions\Element;
9:
10: /**
11: * Class to identify the components of a type seperated by the scope operator,
12: * eg: Something::Someclass::Sometype. This class shouldn't be used by
13: * it self but with the help of the Symbols class.
14: * @see \Peg\Lib\Definitions\Symbols::GetComponents($type)
15: */
16: class TypeComponents
17: {
18: public $namespace;
19: public $class;
20: public $type;
21:
22: public function __construct()
23: {
24: $this->namespace = "\\";
25: }
26:
27: /**
28: * Returns true if theres a namespace on the
29: * components of a type declaration.
30: * @return boolean
31: */
32: public function HasNamespace()
33: {
34: if($this->namespace && $this->namespace != "\\")
35: return true;
36:
37: return false;
38: }
39:
40: /**
41: * Returns true if theres a class on the
42: * components of a type declaration.
43: * @return boolean
44: */
45: public function HasClass()
46: {
47: if($this->class)
48: return true;
49:
50: return false;
51: }
52: }
53:
54: