Code Duplication    Length = 23-24 lines in 2 locations

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

@@ 154-176 (lines=23) @@
151
152
        $possibleFileName = $this->configuration->getPathFinder()->getPath($beannamespace.'\\'.$className)->getPathname();
153
154
        if (!file_exists($possibleFileName)) {
155
            $tableName = $table->getName();
156
            $str = "<?php
157
/*
158
 * This file has been automatically generated by TDBM.
159
 * You can edit this file as it will not be overwritten.
160
 */
161
162
namespace {$beannamespace};
163
164
use {$beannamespace}\\Generated\\{$baseClassName};
165
166
/**
167
 * The $className class maps the '$tableName' table in database.
168
 */
169
class $className extends $baseClassName
170
{
171
}
172
";
173
            $this->ensureDirectoryExist($possibleFileName);
174
            file_put_contents($possibleFileName, $str);
175
            @chmod($possibleFileName, 0664);
176
        }
177
    }
178
179
    /**
@@ 449-472 (lines=24) @@
446
        $possibleFileName = $this->configuration->getPathFinder()->getPath($daonamespace.'\\'.$className)->getPathname();
447
448
        // Now, let's generate the "editable" class
449
        if (!file_exists($possibleFileName)) {
450
            $str = "<?php
451
452
/*
453
 * This file has been automatically generated by TDBM.
454
 * You can edit this file as it will not be overwritten.
455
 */
456
457
namespace {$daonamespace};
458
459
use {$daonamespace}\\Generated\\{$baseClassName};
460
461
/**
462
 * The $className class will maintain the persistence of $beanClassWithoutNameSpace class into the $tableName table.
463
 */
464
class $className extends $baseClassName
465
{
466
}
467
";
468
            $this->ensureDirectoryExist($possibleFileName);
469
            file_put_contents($possibleFileName, $str);
470
            @chmod($possibleFileName, 0664);
471
        }
472
    }
473
474
    /**
475
     * Generates the factory bean.