1 | <?php |
||
17 | trait ConstraintTrait |
||
18 | { |
||
19 | |||
20 | /** |
||
21 | * @var EventDispatcherInterface |
||
22 | */ |
||
23 | private $dispatcher; |
||
24 | |||
25 | /** |
||
26 | * @var CustomFactory |
||
27 | */ |
||
28 | private $factory; |
||
29 | |||
30 | /** |
||
31 | * Format constructor. |
||
32 | * |
||
33 | * @param int $checkMode check mode |
||
34 | * @param UriRetriever|null $uriRetriever uri retriever |
||
35 | * @param CustomFactory|null $factory factory |
||
36 | */ |
||
37 | public function __construct( |
||
45 | |||
46 | /** |
||
47 | * sets the event dispatcher |
||
48 | * |
||
49 | * @param EventDispatcherInterface $dispatcher dispatcher |
||
50 | * |
||
51 | * @return void |
||
52 | */ |
||
53 | public function setEventDispatcher(EventDispatcherInterface $dispatcher) |
||
57 | |||
58 | /** |
||
59 | * checks the input |
||
60 | * |
||
61 | * @param mixed $element element |
||
62 | * @param null $schema schema |
||
63 | * @param null $path path |
||
64 | * @param null $i iterator value |
||
65 | * |
||
66 | * @return void |
||
67 | */ |
||
68 | public function check($element, $schema = null, $path = null, $i = null) |
||
77 | } |
||
78 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: