1 | <?php |
||
16 | abstract class AbstractChecker |
||
17 | { |
||
18 | |||
19 | /** |
||
20 | * Source database. |
||
21 | * |
||
22 | * @var ExtendedPdoInterface |
||
23 | */ |
||
24 | protected $sourceDatabase; |
||
25 | |||
26 | /** |
||
27 | * Target database. |
||
28 | * |
||
29 | * @var ExtendedPdoInterface |
||
30 | */ |
||
31 | protected $targetDatabase; |
||
32 | |||
33 | /** |
||
34 | * Incidents. |
||
35 | * |
||
36 | * @var array |
||
37 | */ |
||
38 | protected $incidents = array(); |
||
39 | |||
40 | /** |
||
41 | * Returns backwards compatibility checker name. |
||
42 | * |
||
43 | * @return string |
||
44 | */ |
||
45 | abstract public function getName(); |
||
46 | |||
47 | /** |
||
48 | * Checks backwards compatibility and returns violations by category. |
||
49 | * |
||
50 | * @param ExtendedPdoInterface $source_db Source DB. |
||
51 | * @param ExtendedPdoInterface $target_db Target DB. |
||
52 | * |
||
53 | * @return array |
||
54 | */ |
||
55 | abstract public function check(ExtendedPdoInterface $source_db, ExtendedPdoInterface $target_db); |
||
56 | |||
57 | /** |
||
58 | * Builds string representation of a parameter. |
||
59 | * |
||
60 | * @param array $parameter_data Parameter data. |
||
61 | * |
||
62 | * @return string |
||
63 | */ |
||
64 | protected function paramToString(array $parameter_data) |
||
101 | |||
102 | /** |
||
103 | * Decodes json-encoded PHP value. |
||
104 | * |
||
105 | * @param string $json_string JSON string. |
||
106 | * |
||
107 | * @return string |
||
108 | */ |
||
109 | protected function decodeValue($json_string) |
||
117 | |||
118 | /** |
||
119 | * Adds incident. |
||
120 | * |
||
121 | * @param string $group Incident group. |
||
122 | * @param string $incident Incident description. |
||
123 | * @param string|null $old_value Old value. |
||
124 | * @param string|null $new_value New value. |
||
125 | * |
||
126 | * @return void |
||
127 | */ |
||
128 | protected function addIncident($group, $incident, $old_value = null, $new_value = null) |
||
138 | |||
139 | } |
||
140 |