Code Duplication    Length = 23-24 lines in 2 locations

src/Mouf/Database/TDBM/Utils/TDBMDaoGenerator.php 2 locations

@@ 213-235 (lines=23) @@
210
            // @codeCoverageIgnoreEnd
211
        }
212
        $possibleFileName = $this->rootPath.$possibleFileNames[0];
213
        if (!file_exists($possibleFileName)) {
214
            $tableName = $table->getName();
215
            $str = "<?php
216
/*
217
 * This file has been automatically generated by TDBM.
218
 * You can edit this file as it will not be overwritten.
219
 */
220
221
namespace {$beannamespace};
222
223
use {$beannamespace}\\Generated\\{$baseClassName};
224
225
/**
226
 * The $className class maps the '$tableName' table in database.
227
 */
228
class $className extends $baseClassName
229
{
230
}
231
";
232
            $this->ensureDirectoryExist($possibleFileName);
233
            file_put_contents($possibleFileName, $str);
234
            @chmod($possibleFileName, 0664);
235
        }
236
    }
237
238
    /**
@@ 520-543 (lines=24) @@
517
        $possibleFileName = $this->rootPath.$possibleFileNames[0];
518
519
        // Now, let's generate the "editable" class
520
        if (!file_exists($possibleFileName)) {
521
            $str = "<?php
522
523
/*
524
 * This file has been automatically generated by TDBM.
525
 * You can edit this file as it will not be overwritten.
526
 */
527
528
namespace {$daonamespace};
529
530
use {$daonamespace}\\Generated\\{$baseClassName};
531
532
/**
533
 * The $className class will maintain the persistence of $beanClassWithoutNameSpace class into the $tableName table.
534
 */
535
class $className extends $baseClassName
536
{
537
}
538
";
539
            $this->ensureDirectoryExist($possibleFileName);
540
            file_put_contents($possibleFileName, $str);
541
            @chmod($possibleFileName, 0664);
542
        }
543
    }
544
545
    /**
546
     * Generates the factory bean.