1 | <?php |
||
20 | class TdbmController extends AbstractMoufInstanceController |
||
21 | { |
||
22 | /** |
||
23 | * @var HtmlBlock |
||
24 | */ |
||
25 | public $content; |
||
26 | |||
27 | protected $daoNamespace; |
||
28 | protected $beanNamespace; |
||
29 | protected $daoFactoryInstanceName; |
||
30 | protected $autoloadDetected; |
||
31 | ///protected $storeInUtc; |
||
32 | protected $useCustomComposer; |
||
33 | protected $composerFile; |
||
34 | |||
35 | /** |
||
36 | * Admin page used to display the DAO generation form. |
||
37 | * |
||
38 | * @Action |
||
39 | */ |
||
40 | public function defaultAction($name, $selfedit = 'false') |
||
78 | |||
79 | /** |
||
80 | * This action generates the DAOs and Beans for the TDBM service passed in parameter. |
||
81 | * |
||
82 | * @Action |
||
83 | * |
||
84 | * @param string $name |
||
85 | * @param bool $selfedit |
||
86 | */ |
||
87 | public function generate($name, $daonamespace, $beannamespace, $daofactoryinstancename, /*$storeInUtc = 0,*/ $selfedit = 'false', $useCustomComposer = false, $composerFile = '') |
||
96 | |||
97 | /** |
||
98 | * This function generates the DAOs and Beans for the TDBM service passed in parameter. |
||
99 | * |
||
100 | * @param MoufManager $moufManager |
||
101 | * @param string $name |
||
102 | * @param string $daonamespace |
||
103 | * @param string $beannamespace |
||
104 | * @param string $selfedit |
||
105 | * |
||
106 | * @throws \Mouf\MoufException |
||
107 | */ |
||
108 | public static function generateDaos(MoufManager $moufManager, $name, $daonamespace, $beannamespace, $daofactoryinstancename, $selfedit = 'false', /*$storeInUtc = null,*/ $useCustomComposer = null, $composerFile = null) |
||
109 | { |
||
110 | self::setInConfiguration($moufManager, $name, 'daoNamespace', $daonamespace); |
||
111 | self::setInConfiguration($moufManager, $name, 'beanNamespace', $beannamespace); |
||
112 | self::setInConfiguration($moufManager, $name, 'daoFactoryInstanceName', $daofactoryinstancename); |
||
113 | //self::setInConfiguration($moufManager, $name, 'storeInUtc', $storeInUtc); |
||
114 | if ($useCustomComposer) { |
||
115 | $pathFinder = $moufManager->createInstance(PathFinder::class); |
||
116 | $pathFinder->getConstructorArgumentProperty('composerFile')->setValue($composerFile); |
||
117 | self::setInConfiguration($moufManager, $name, 'pathFinder', $pathFinder); |
||
118 | } else { |
||
119 | self::setInConfiguration($moufManager, $name, 'pathFinder', null); |
||
120 | } |
||
121 | // Let's rewrite before calling the DAO generator |
||
122 | $moufManager->rewriteMouf(); |
||
123 | |||
124 | |||
125 | $tdbmService = new InstanceProxy($name); |
||
126 | /* @var $tdbmService TDBMService */ |
||
127 | $tdbmService->generateAllDaosAndBeans(); |
||
128 | } |
||
129 | |||
130 | private static function getConfigurationDescriptor(MoufManager $moufManager, string $tdbmInstanceName) |
||
134 | |||
135 | private static function getFromConfiguration(MoufManager $moufManager, string $tdbmInstanceName, string $property) |
||
143 | |||
144 | private static function setInConfiguration(MoufManager $moufManager, string $tdbmInstanceName, string $property, ?string $value) |
||
152 | } |
||
153 |
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.