Completed
Push — master ( 3f0046...b1c777 )
by Gino
06:41 queued 03:19
created

SqlFile::getFieldRow()   B

Complexity

Conditions 4
Paths 4

Size

Total Lines 25
Code Lines 21

Duplication

Lines 0
Ratio 0 %
Metric Value
dl 0
loc 25
rs 8.5806
cc 4
eloc 21
nc 4
nop 6
1
<?php
2
3
/*
4
 You may not change or alter any portion of this comment or credits
5
 of supporting developers from this source code or any supporting source code
6
 which is considered copyrighted (c) material of the original comment or credit authors.
7
8
 This program is distributed in the hope that it will be useful,
9
 but WITHOUT ANY WARRANTY; without even the implied warranty of
10
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11
 */
12
/**
13
 * tdmcreate module.
14
 *
15
 * @copyright       The XOOPS Project http://sourceforge.net/projects/xoops/
16
 * @license         GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
17
 *
18
 * @since           2.5.0
19
 *
20
 * @author          Txmod Xoops http://www.txmodxoops.org
21
 *
22
 * @version         $Id: SqlFile.php 12258 2014-01-02 09:33:29Z timgno $
23
 */
24
25
/**
26
 * Class SqlFile.
27
 */
28
class SqlFile extends TDMCreateFile
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
29
{
30
    /*
31
    * @var string
32
    */
33
    private $tdmcfile = null;
34
35
    /*
36
    *  @public function constructor
37
    *  @param null
38
    
39
    /*
40
    *  @public function constructor
41
    *  @param null
42
    */
43
    /**
44
     *
45
     */
46
    public function __construct()
47
    {
48
        parent::__construct();
49
        $this->tdmcfile = TDMCreateFile::getInstance();
0 ignored issues
show
Documentation Bug introduced by
It seems like \TDMCreateFile::getInstance() of type object<TDMCreateFile> is incompatible with the declared type string of property $tdmcfile.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
50
    }
51
52
    /*
53
    *  @static function &getInstance
54
    *  @param null
55
    */
56
    /**
57
     * @return SqlFile
58
     */
59
    public static function &getInstance()
60
    {
61
        static $instance = false;
62
        if (!$instance) {
63
            $instance = new self();
64
        }
65
66
        return $instance;
67
    }
68
69
    /*
70
    *  @public function write
71
    *  @param $module
72
    *  @param $table
73
    *  @param $tables
74
    *  @param $filename
75
    */
76
    /**
77
     * @param $module
78
     * @param $tables
79
     * @param $filename
80
     */
81
    public function write($module, $tables, $filename)
82
    {
83
        $this->setModule($module);
84
        $this->setTables($tables);
85
        $this->setFileName($filename);
86
    }
87
88
    /*
89
    *  @private function getHeaderSqlComments
90
    *  @param $moduleName
91
    */
92
    /**
93
     * @param $moduleName
94
     *
95
     * @return string
96
     */
97
    private function getHeaderSqlComments($moduleName)
98
    {
99
        $date = date('D M d, Y');
100
        $time = date('G:i');
101
        $server_name = $_SERVER['SERVER_NAME'];
102
        $server_version = mysql_get_server_info();
103
        $php_version = phpversion();
104
        // Header Sql Comments
105
        $ret = <<<SQL
106
# SQL Dump for {$moduleName} module
107
# PhpMyAdmin Version: 4.0.4
108
# http://www.phpmyadmin.net
109
#
110
# Host: {$server_name}
111
# Generated on: {$date} to {$time}
112
# Server version: {$server_version}
113
# PHP Version: {$php_version}\n\n
114
SQL;
115
116
        return $ret;
117
    }
118
119
    /*
120
    *  @private function getHeadDatabaseTable
121
    *  @param $moduleDirname
122
    *  @param $tableName
123
    *  @param integer $fieldsNumb
124
    *
125
    *  Unused IF NOT EXISTS
126
    *  @return string
127
    */
128
    private function getHeadDatabaseTable($moduleDirname, $tableName, $fieldsNumb)
129
    {
130
        $ret = <<<SQL
131
#
132
# Structure table for `{$moduleDirname}_{$tableName}` {$fieldsNumb}
133
#
134
135
CREATE TABLE `{$moduleDirname}_{$tableName}` (\n
136
SQL;
137
138
        return $ret;
139
    }
140
141
    /*
142
    *  @private function getDatabaseTables
143
    *  @param $moduleDirname
144
    *  @return null|string
145
    */
146
    private function getDatabaseTables($moduleDirname)
147
    {
148
        $ret = null;
149
        $tables = $this->getTables();
150
        foreach (array_keys($tables) as $t) {
151
            $tableId = $tables[$t]->getVar('table_id');
152
            $tableMid = $tables[$t]->getVar('table_mid');
153
            $tableName = $tables[$t]->getVar('table_name');
154
            $tableAutoincrement = $tables[$t]->getVar('table_autoincrement');
155
            $fieldsNumb = $tables[$t]->getVar('table_nbfields');
156
            $ret .= $this->getDatabaseFields($moduleDirname, $tableMid, $tableId, $tableName, $tableAutoincrement, $fieldsNumb);
157
        }
158
159
        return $ret;
160
    }
161
162
    /*
163
    *  @private function getDatabaseFields
164
    *  @param $moduleDirname
165
    *  @param $tableName
166
    *  @param $tableAutoincrement
167
    *  @param $fieldsNumb
168
    *  @return null|string
169
    */
170
    private function getDatabaseFields($moduleDirname, $tableMid, $tableId, $tableName, $tableAutoincrement, $fieldsNumb)
171
    {
172
        $ret = null;
173
        $j = 0;
174
        $comma = array();
175
        $row = array();
176
        $type = '';
0 ignored issues
show
Unused Code introduced by
$type is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
177
        $fields = $this->getTableFields($tableMid, $tableId, 'field_id ASC, field_name');
178
        foreach (array_keys($fields) as $f) {
179
            // Creation of database table
180
            $ret = $this->getHeadDatabaseTable($moduleDirname, $tableName, $fieldsNumb);
181
            $fieldName = $fields[$f]->getVar('field_name');
182
            $fieldType = $fields[$f]->getVar('field_type');
183
            $fieldValue = $fields[$f]->getVar('field_value');
184
            $fieldAttribute = $fields[$f]->getVar('field_attribute');
185
            $fieldNull = $fields[$f]->getVar('field_null');
186
            $fieldDefault = $fields[$f]->getVar('field_default');
187
            $fieldKey = $fields[$f]->getVar('field_key');
188
            if ($fieldType > 1) {
189
                $fType = $this->tdmcreate->getHandler('fieldtype')->get($fieldType);
0 ignored issues
show
Bug introduced by
The method getHandler cannot be called on $this->tdmcreate (of type string).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
190
                $fieldTypeName = $fType->getVar('fieldtype_name');
191
            } else {
192
                $fieldType = null;
193
            }
194
            if ($fieldAttribute > 1) {
195
                $fAttribute = $this->tdmcreate->getHandler('fieldattributes')->get($fieldAttribute);
0 ignored issues
show
Bug introduced by
The method getHandler cannot be called on $this->tdmcreate (of type string).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
196
                $fieldAttribute = $fAttribute->getVar('fieldattribute_name');
197
            } else {
198
                $fieldAttribute = null;
199
            }
200
            if ($fieldNull > 1) {
201
                $fNull = $this->tdmcreate->getHandler('fieldnull')->get($fieldNull);
0 ignored issues
show
Bug introduced by
The method getHandler cannot be called on $this->tdmcreate (of type string).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
202
                $fieldNull = $fNull->getVar('fieldnull_name');
203
            } else {
204
                $fieldNull = null;
205
            }
206
            if (!empty($fieldName)) {
207
                switch ($fieldType) {
208
                    case 2:
209
                    case 3:
210
                    case 4:
211
                    case 5:
212
                        $type = $fieldTypeName.'('.$fieldValue.')';
0 ignored issues
show
Bug introduced by
The variable $fieldTypeName does not seem to be defined for all execution paths leading up to this point.

If you define a variable conditionally, it can happen that it is not defined for all execution paths.

Let’s take a look at an example:

function myFunction($a) {
    switch ($a) {
        case 'foo':
            $x = 1;
            break;

        case 'bar':
            $x = 2;
            break;
    }

    // $x is potentially undefined here.
    echo $x;
}

In the above example, the variable $x is defined if you pass “foo” or “bar” as argument for $a. However, since the switch statement has no default case statement, if you pass any other value, the variable $x would be undefined.

Available Fixes

  1. Check for existence of the variable explicitly:

    function myFunction($a) {
        switch ($a) {
            case 'foo':
                $x = 1;
                break;
    
            case 'bar':
                $x = 2;
                break;
        }
    
        if (isset($x)) { // Make sure it's always set.
            echo $x;
        }
    }
    
  2. Define a default value for the variable:

    function myFunction($a) {
        $x = ''; // Set a default which gets overridden for certain paths.
        switch ($a) {
            case 'foo':
                $x = 1;
                break;
    
            case 'bar':
                $x = 2;
                break;
        }
    
        echo $x;
    }
    
  3. Add a value for the missing path:

    function myFunction($a) {
        switch ($a) {
            case 'foo':
                $x = 1;
                break;
    
            case 'bar':
                $x = 2;
                break;
    
            // We add support for the missing case.
            default:
                $x = '';
                break;
        }
    
        echo $x;
    }
    
Loading history...
213
                        if (empty($fieldDefault)) {
214
                            $default = "DEFAULT '0'";
215
                        } else {
216
                            $default = "DEFAULT '{$fieldDefault}'";
217
                        }
218
                        break;
219
                    case 6:
220
                    case 7:
221
                    case 8:
222
                        $type = $fieldTypeName.'('.$fieldValue.')';
223
                        if (empty($fieldDefault)) {
224
                            $default = "DEFAULT '0.00'"; // From MySQL 5.7 Manual
225
                        } else {
226
                            $default = "DEFAULT '{$fieldDefault}'";
227
                        }
228
                        break;
229
                    case 9:
230
                    case 10:
231
                        $type = $fieldTypeName;
232
                        break;
233
                    case 11:
234
                        $type = $fieldTypeName.'('.$fieldValue.')';
235
                        if (empty($fieldDefault)) {
236
                            $default = "DEFAULT '[email protected]'";
237
                        } else {
238
                            $default = "DEFAULT '{$fieldDefault}'";
239
                        }
240
                        break;
241
                    case 12:
242
                        $type = $fieldTypeName.'('.$fieldValue.')';
243
                        if (empty($fieldDefault)) {
244
                            $default = "DEFAULT 'http:\\'";
245
                        } else {
246
                            $default = "DEFAULT '{$fieldDefault}'";
247
                        }
248
                        break;
249
                    case 13:
250
                    case 14:
251
                        $type = $fieldTypeName.'('.$fieldValue.')';
252
                        $default = "DEFAULT '{$fieldDefault}'";
253
                        break;
254
                    case 15:
255
                    case 16:
256
                    case 17:
257
                    case 18:
258
                        $type = $fieldTypeName;
259
                        $default = null;
260
                        break;
261
                    case 19:
262
                    case 20:
263
                    case 21:
264
                    case 22:
265
                        $type = $fieldTypeName.'('.$fieldValue.')';
266
                        $default = "DEFAULT '{$fieldDefault}'";
267
                        break;
268
                    case 23:
269
                        $type = $fieldTypeName;
270
                        if (empty($fieldDefault)) {
271
                            $default = "DEFAULT '1970'"; // From MySQL 5.7 Manual
272
                        } else {
273
                            $default = "DEFAULT '{$fieldDefault}'";
274
                        }
275
                        break;
276
                    default:
277
                        $type = $fieldTypeName.'('.$fieldValue.')';
278
                        $default = "DEFAULT '{$fieldDefault}'";
279
                        break;
280
                }
281
                if ((0 == $f) && (1 == $tableAutoincrement)) {
282
                    $row[] = $this->getFieldRow($fieldName, $type, $fieldAttribute, $fieldNull, null, 'AUTO_INCREMENT');
283
                    $comma[$j] = $this->getKey(2, $fieldName);
284
                    ++$j;
285
                } elseif ((0 == $f) && (0 == $tableAutoincrement)) {
286
                    $row[] = $this->getFieldRow($fieldName, $type, $fieldAttribute, $fieldNull, $default);
0 ignored issues
show
Bug introduced by
The variable $default does not seem to be defined for all execution paths leading up to this point.

If you define a variable conditionally, it can happen that it is not defined for all execution paths.

Let’s take a look at an example:

function myFunction($a) {
    switch ($a) {
        case 'foo':
            $x = 1;
            break;

        case 'bar':
            $x = 2;
            break;
    }

    // $x is potentially undefined here.
    echo $x;
}

In the above example, the variable $x is defined if you pass “foo” or “bar” as argument for $a. However, since the switch statement has no default case statement, if you pass any other value, the variable $x would be undefined.

Available Fixes

  1. Check for existence of the variable explicitly:

    function myFunction($a) {
        switch ($a) {
            case 'foo':
                $x = 1;
                break;
    
            case 'bar':
                $x = 2;
                break;
        }
    
        if (isset($x)) { // Make sure it's always set.
            echo $x;
        }
    }
    
  2. Define a default value for the variable:

    function myFunction($a) {
        $x = ''; // Set a default which gets overridden for certain paths.
        switch ($a) {
            case 'foo':
                $x = 1;
                break;
    
            case 'bar':
                $x = 2;
                break;
        }
    
        echo $x;
    }
    
  3. Add a value for the missing path:

    function myFunction($a) {
        switch ($a) {
            case 'foo':
                $x = 1;
                break;
    
            case 'bar':
                $x = 2;
                break;
    
            // We add support for the missing case.
            default:
                $x = '';
                break;
        }
    
        echo $x;
    }
    
Loading history...
287
                    $comma[$j] = $this->getKey(2, $fieldName);
288
                    ++$j;
289
                } else {
290
                    if (3 == $fieldKey || 4 == $fieldKey || 5 == $fieldKey || 6 == $fieldKey) {
291
                        switch ($fieldKey) {
292
                            case 3:
293
                                $row[] = $this->getFieldRow($fieldName, $type, $fieldAttribute, $fieldNull, $default);
294
                                $comma[$j] = $this->getKey(3, $fieldName);
295
                                ++$j;
296
                                break;
297
                            case 4:
298
                                $row[] = $this->getFieldRow($fieldName, $type, $fieldAttribute, $fieldNull, $default);
299
                                $comma[$j] = $this->getKey(4, $fieldName);
300
                                ++$j;
301
                                break;
302
                            case 5:
303
                                $row[] = $this->getFieldRow($fieldName, $type, $fieldAttribute, $fieldNull, $default);
304
                                $comma[$j] = $this->getKey(5, $fieldName);
305
                                ++$j;
306
                                break;
307
                            case 6:
308
                                $row[] = $this->getFieldRow($fieldName, $type, $fieldAttribute, $fieldNull, $default);
309
                                $comma[$j] = $this->getKey(6, $fieldName);
310
                                ++$j;
311
                                break;
312
                        }
313
                    } else {
314
                        $row[] = $this->getFieldRow($fieldName, $type, $fieldAttribute, $fieldNull, $default);
315
                    }
316
                }
317
            }
318
        }
319
        // ================= COMMA ================= //
320
        for ($i = 0; $i < $j; ++$i) {
321
            if ($i != $j - 1) {
322
                $row[] = $comma[$i].',';
323
            } else {
324
                $row[] = $comma[$i];
325
            }
326
        }
327
        // ================= COMMA CICLE ================= //
328
        //$row[] = $this->getCommaCicle($comma, $j);
0 ignored issues
show
Unused Code Comprehensibility introduced by
69% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
329
        $ret .= implode("\n", $row);
330
        unset($j);
331
        $ret .= $this->getFootDatabaseTable();
332
333
        return $ret;
334
    }
335
336
    /*
337
    *  @private function getFootDatabaseTable
338
    *  @param null
339
    */
340
    /**
341
     * @return string
342
     */
343
    private function getFootDatabaseTable()
344
    {
345
        $ret = <<<SQL
346
\n) ENGINE=InnoDB;\n\n
347
SQL;
348
349
        return $ret;
350
    }
351
352
    /*
353
    *  @private function getFieldRow
354
    *  @param $fieldName
355
    *  @param $fieldTypeValue
356
    *  @param $fieldAttribute
357
    *  @param $fieldNull
358
    *  @param $fieldDefault
359
    *  @param $autoincrement
360
    *  @return string
361
    */
362
    private function getFieldRow($fieldName, $fieldTypeValue, $fieldAttribute = null, $fieldNull = null, $fieldDefault = null, $autoincrement = null)
363
    {
364
        $retAutoincrement = <<<SQL
365
  `{$fieldName}` {$fieldTypeValue} {$fieldAttribute} {$fieldNull} {$autoincrement},
366
SQL;
367
        $retFieldAttribute = <<<SQL
368
  `{$fieldName}` {$fieldTypeValue} {$fieldAttribute} {$fieldNull} {$fieldDefault},
369
SQL;
370
        $fieldDefault = <<<SQL
371
  `{$fieldName}` {$fieldTypeValue} {$fieldNull} {$fieldDefault},
372
SQL;
373
        $retShort = <<<SQL
374
  `{$fieldName}` {$fieldTypeValue},
375
SQL;
376
        $ret = $retShort;
377
        if ($autoincrement != null) {
378
            $ret = $retAutoincrement;
379
        } elseif ($fieldAttribute != null) {
380
            $ret = $retFieldAttribute;
381
        } elseif ($fieldAttribute == null) {
382
            $ret = $fieldDefault;
383
        }
384
385
        return $ret;
386
    }
387
388
    /*
389
    *  @private function getKey
390
    *  @return string
391
    */
392
    private function getKey($key, $fieldName)
393
    {
394
        switch ($key) {
395
            case 2: // PRIMARY KEY
396
                $ret = <<<SQL
397
  PRIMARY KEY (`{$fieldName}`)
398
SQL;
399
                break;
400
            case 3: // UNIQUE KEY
401
                $ret = <<<SQL
402
  UNIQUE KEY `{$fieldName}` (`{$fieldName}`)
403
SQL;
404
                break;
405
            case 4: // KEY
406
                $ret = <<<SQL
407
  KEY `{$fieldName}` (`{$fieldName}`)
408
SQL;
409
                break;
410
            case 5: // INDEX
411
                $ret = <<<SQL
412
  INDEX (`{$fieldName}`)
413
SQL;
414
                break;
415
            case 6: // FULLTEXT KEY
416
                $ret = <<<SQL
417
  FULLTEXT KEY `{$fieldName}` (`{$fieldName}`)
418
SQL;
419
                break;
420
        }
421
422
        return $ret;
0 ignored issues
show
Bug introduced by
The variable $ret does not seem to be defined for all execution paths leading up to this point.

If you define a variable conditionally, it can happen that it is not defined for all execution paths.

Let’s take a look at an example:

function myFunction($a) {
    switch ($a) {
        case 'foo':
            $x = 1;
            break;

        case 'bar':
            $x = 2;
            break;
    }

    // $x is potentially undefined here.
    echo $x;
}

In the above example, the variable $x is defined if you pass “foo” or “bar” as argument for $a. However, since the switch statement has no default case statement, if you pass any other value, the variable $x would be undefined.

Available Fixes

  1. Check for existence of the variable explicitly:

    function myFunction($a) {
        switch ($a) {
            case 'foo':
                $x = 1;
                break;
    
            case 'bar':
                $x = 2;
                break;
        }
    
        if (isset($x)) { // Make sure it's always set.
            echo $x;
        }
    }
    
  2. Define a default value for the variable:

    function myFunction($a) {
        $x = ''; // Set a default which gets overridden for certain paths.
        switch ($a) {
            case 'foo':
                $x = 1;
                break;
    
            case 'bar':
                $x = 2;
                break;
        }
    
        echo $x;
    }
    
  3. Add a value for the missing path:

    function myFunction($a) {
        switch ($a) {
            case 'foo':
                $x = 1;
                break;
    
            case 'bar':
                $x = 2;
                break;
    
            // We add support for the missing case.
            default:
                $x = '';
                break;
        }
    
        echo $x;
    }
    
Loading history...
423
    }
424
425
    /*
426
    *  @private function getComma
427
    *  @param $row
428
    *  @param $comma
429
    *  @return string
430
    */
431
    private function getComma($row, $comma = null)
432
    {
433
        $ret = <<<SQL
434
            {$row}{$comma}
435
SQL;
436
437
        return $ret;
438
    }
439
440
    /*
441
    *  @private function getCommaCicle
442
    *  @param $comma
443
    *  @param $index
444
    *  @return string
445
    */
446
    private function getCommaCicle($comma, $index)
0 ignored issues
show
Unused Code introduced by
This method is not used, and could be removed.
Loading history...
447
    {
448
        // Comma issue
449
        for ($i = 1; $i <= $index; ++$i) {
450
            if ($i != $index - 1) {
451
                $ret = $this->getComma(isset($comma[$i]), ',')."\n";
452
            } else {
453
                $ret = $this->getComma(isset($comma[$i]))."\n";
454
            }
455
        }
456
457
        return $ret;
0 ignored issues
show
Bug introduced by
The variable $ret does not seem to be defined for all execution paths leading up to this point.

If you define a variable conditionally, it can happen that it is not defined for all execution paths.

Let’s take a look at an example:

function myFunction($a) {
    switch ($a) {
        case 'foo':
            $x = 1;
            break;

        case 'bar':
            $x = 2;
            break;
    }

    // $x is potentially undefined here.
    echo $x;
}

In the above example, the variable $x is defined if you pass “foo” or “bar” as argument for $a. However, since the switch statement has no default case statement, if you pass any other value, the variable $x would be undefined.

Available Fixes

  1. Check for existence of the variable explicitly:

    function myFunction($a) {
        switch ($a) {
            case 'foo':
                $x = 1;
                break;
    
            case 'bar':
                $x = 2;
                break;
        }
    
        if (isset($x)) { // Make sure it's always set.
            echo $x;
        }
    }
    
  2. Define a default value for the variable:

    function myFunction($a) {
        $x = ''; // Set a default which gets overridden for certain paths.
        switch ($a) {
            case 'foo':
                $x = 1;
                break;
    
            case 'bar':
                $x = 2;
                break;
        }
    
        echo $x;
    }
    
  3. Add a value for the missing path:

    function myFunction($a) {
        switch ($a) {
            case 'foo':
                $x = 1;
                break;
    
            case 'bar':
                $x = 2;
                break;
    
            // We add support for the missing case.
            default:
                $x = '';
                break;
        }
    
        echo $x;
    }
    
Loading history...
458
    }
459
460
    /*
461
    *  @public function render
462
    *  @param null
463
    *  @return bool|string
464
    */
465
    public function render()
466
    {
467
        $module = $this->getModule();
468
        $filename = $this->getFileName();
469
        $moduleName = strtolower($module->getVar('mod_name'));
470
        $moduleDirname = strtolower($module->getVar('mod_dirname'));
471
        $content = $this->getHeaderSqlComments($moduleName);
472
        $content      .= $this->getDatabaseTables($moduleDirname);
473
        //
474
        $this->tdmcfile->create($moduleDirname, 'sql', $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
0 ignored issues
show
Bug introduced by
The method create cannot be called on $this->tdmcfile (of type string).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
475
476
        return $this->tdmcfile->renderFile();
0 ignored issues
show
Bug introduced by
The method renderFile cannot be called on $this->tdmcfile (of type string).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
477
    }
478
}
479