1: <?php
2:
3: /**
4: * Copyright 2015, Eduardo Trujillo
5: *
6: * For the full copyright and license information, please view the LICENSE
7: * file that was distributed with this source code.
8: *
9: * This file is part of the Nucleus package
10: */
11:
12: namespace Chromabits\Nucleus\Meditation;
13:
14: use Chromabits\Nucleus\Foundation\Enum;
15:
16: /**
17: * Class TypesDefinition.
18: *
19: * @author Eduardo Trujillo <ed@chromabits.com>
20: * @package Chromabits\Nucleus\Meditation
21: */
22: abstract class TypesDefinition extends Enum
23: {
24: /**
25: * Get a list of names of all the types defined.
26: *
27: * @return string[]
28: */
29: abstract public function getTypesDefined();
30:
31: /**
32: * Get a list of names of all the scalar types defined.
33: *
34: * @return string[]
35: */
36: public function getScalars()
37: {
38: return [];
39: }
40:
41: /**
42: * Get a list of names of all the compound types defined.
43: *
44: * @return string[]
45: */
46: public function getCompounds()
47: {
48: return [];
49: }
50:
51: /**
52: * Get a list of names of all the special types defined.
53: *
54: * @return string[]
55: */
56: public function getSpecial()
57: {
58: return [];
59: }
60:
61: /**
62: * Type check a value.
63: *
64: * @param string $typeName
65: * @param mixed $value
66: *
67: * @return bool
68: */
69: abstract public function check($typeName, $value);
70: }
71: