1 | <?php |
||
19 | class ActionSplitter |
||
20 | { |
||
21 | /** |
||
22 | * The fully qualified class name of the Action class to match for conflicts |
||
23 | * |
||
24 | * @var string |
||
25 | */ |
||
26 | protected $conflictClass; |
||
27 | |||
28 | /** |
||
29 | * The fully qualified class name of the Action class to match for conflicts, which |
||
30 | * is the dual of $conflictClass. For example `AddColumn` and `DropColumn` are duals. |
||
31 | * |
||
32 | * @var string |
||
33 | */ |
||
34 | protected $conflictClassDual; |
||
35 | |||
36 | /** |
||
37 | * A callback used to signal the actual presence of a conflict, that will be used to |
||
38 | * partition the AlterTable into non-conflicting parts. |
||
39 | * |
||
40 | * The callback receives as first argument amn instance of $conflictClass and as second |
||
41 | * argument an instance of $conflictClassDual |
||
42 | * |
||
43 | * @var callable |
||
44 | */ |
||
45 | protected $conflictFilter; |
||
46 | |||
47 | /** |
||
48 | * Comstructor |
||
49 | * |
||
50 | * @param string $conflictClass The fully qualified class name of the Action class to match for conflicts |
||
51 | * @param string $conflictClassDual The fully qualified class name of the Action class to match for conflicts, |
||
52 | * which is the dual of $conflictClass. For example `AddColumn` and `DropColumn` are duals. |
||
53 | * @param callable $conflictFilter The collection of actions to inspect |
||
54 | */ |
||
55 | public function __construct($conflictClass, $conflictClassDual, callable $conflictFilter) |
||
61 | |||
62 | /** |
||
63 | * Returs a sequence of AlterTable instructions that are non conflicting |
||
64 | * based on the constructor parameters. |
||
65 | * |
||
66 | * @param \Phinx\Db\Plan\AlterTable $alter The collection of actions to inspect |
||
67 | * |
||
68 | * @return \Phinx\Db\Plan\AlterTable[] A list of AlterTable that can be executed without |
||
69 | * this type of conflict |
||
70 | */ |
||
71 | public function split(AlterTable $alter) |
||
113 | } |
||
114 |
This check looks for variables that are accessed but have not been defined. It raises an issue if it finds another variable that has a similar name.
The variable may have been renamed without also renaming all references.