|
2 | 2 | //---------------------------------------------------------------------------------------------------------------------- |
3 | 3 | namespace SetBased\ErdConcepts; |
4 | 4 |
|
5 | | -use SetBased\Affirm\Affirm; |
6 | | - |
7 | 5 | //---------------------------------------------------------------------------------------------------------------------- |
8 | 6 | /** |
9 | 7 | * Class MySql |
@@ -68,15 +66,18 @@ static public function fixColumnComments( $theSourceCode ) |
68 | 66 | // Enhance the column definitions with comments. |
69 | 67 | foreach ($comments as $table_name => $columns) |
70 | 68 | { |
71 | | - if (!isset($map[$table_name])) Affirm::assertFailed( "Table '%s' is not defined.", $table_name ); |
| 69 | + if (!isset($map[$table_name])) |
| 70 | + { |
| 71 | + throw new \RuntimeException( sprintf("Table '%s' is not defined.", $table_name) ); |
| 72 | + } |
72 | 73 |
|
73 | 74 | foreach ($columns as $column_name => $comment) |
74 | 75 | { |
75 | 76 | if (!isset($map[$table_name][$column_name])) |
76 | 77 | { |
77 | | - Affirm::assertFailed( "Column '%s' is not defined in '%s' table statements.", |
| 78 | + throw new \RuntimeException( sprintf("Column '%s' is not defined in '%s' table statements.", |
78 | 79 | $column_name, |
79 | | - $table_name ); |
| 80 | + $table_name )); |
80 | 81 | } |
81 | 82 |
|
82 | 83 | $line_number = $map[$table_name][$column_name]; |
@@ -154,7 +155,10 @@ static public function fixTableComments( $theSourceCode ) |
154 | 155 | // Enhance the column definitions with comments. |
155 | 156 | foreach ($comments as $table_name => $comment) |
156 | 157 | { |
157 | | - if (!isset($map[$table_name])) Affirm::assertFailed( "Table '%s' is not defined.", $table_name ); |
| 158 | + if (!isset($map[$table_name])) |
| 159 | + { |
| 160 | + throw new \RuntimeException( sprintf("Table '%s' is not defined.", $table_name )); |
| 161 | + } |
158 | 162 |
|
159 | 163 | $line_number = $map[$table_name]; |
160 | 164 |
|
@@ -213,7 +217,10 @@ static public function fixIndexComments( $theSourceCode ) |
213 | 217 | // Enhance the column definitions with comments. |
214 | 218 | foreach ($comments as $index_name => $comment) |
215 | 219 | { |
216 | | - if (!isset($map[$index_name])) Affirm::assertFailed( "Table '%s' is not defined.", $index_name ); |
| 220 | + if (!isset($map[$index_name])) |
| 221 | + { |
| 222 | + throw new \RuntimeException( sprintf("Table '%s' is not defined.", $index_name )); |
| 223 | + } |
217 | 224 |
|
218 | 225 | $line_number = $map[$index_name]; |
219 | 226 |
|
|
0 commit comments