Skip to content

Commit 29323d8

Browse files
committed
Removed dependency on Affirm.
1 parent 5f0f66c commit 29323d8

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

composer.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
],
1111
"require": {
1212
"php": ">=5.4.0",
13-
"setbased/php-affirm": "*",
1413
"setbased/phing-extensions": "1.*"
1514
},
1615
"require-dev": {

lib/MySqlFix.php

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
//----------------------------------------------------------------------------------------------------------------------
33
namespace SetBased\ErdConcepts;
44

5-
use SetBased\Affirm\Affirm;
6-
75
//----------------------------------------------------------------------------------------------------------------------
86
/**
97
* Class MySql
@@ -68,15 +66,18 @@ static public function fixColumnComments( $theSourceCode )
6866
// Enhance the column definitions with comments.
6967
foreach ($comments as $table_name => $columns)
7068
{
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+
}
7273

7374
foreach ($columns as $column_name => $comment)
7475
{
7576
if (!isset($map[$table_name][$column_name]))
7677
{
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.",
7879
$column_name,
79-
$table_name );
80+
$table_name ));
8081
}
8182

8283
$line_number = $map[$table_name][$column_name];
@@ -154,7 +155,10 @@ static public function fixTableComments( $theSourceCode )
154155
// Enhance the column definitions with comments.
155156
foreach ($comments as $table_name => $comment)
156157
{
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+
}
158162

159163
$line_number = $map[$table_name];
160164

@@ -213,7 +217,10 @@ static public function fixIndexComments( $theSourceCode )
213217
// Enhance the column definitions with comments.
214218
foreach ($comments as $index_name => $comment)
215219
{
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+
}
217224

218225
$line_number = $map[$index_name];
219226

0 commit comments

Comments
 (0)