File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed
Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change 66 * This file is part of the Nette Framework (https://nette.org)
77 */
88
9- use Nette \Utils \Strings ;
109use Nette \CommandLine \Parser ;
10+ use Nette \Utils \Strings ;
1111
1212if (@!include __DIR__ . '/../vendor/autoload.php ' ) {
1313 echo ('Install packages using `composer update` ' );
@@ -374,6 +374,23 @@ public function is($extensions)
374374 }
375375};
376376
377+ // cs, entity
378+ $ checker ->tasks [] = function (CodeChecker $ checker , $ s ) {
379+ if ($ checker ->is ('php ' )) {
380+ if (Strings::contains ($ s , '@ORM\Entity ' ) && !Strings::contains ($ s , '@ORM\Entity( ' )) {
381+ $ checker ->fix ('Missing Entity`()` ' );
382+ $ s = str_replace ('@ORM\Entity ' , '@ORM\Entity() ' , $ s );
383+ }
384+
385+ if (Strings::contains ($ s , '@ORM\Table() ' )) {
386+ $ checker ->fix ('Missing `name="table_name"` ' );
387+ $ s = str_replace ('@ORM\Table() ' , '@ORM\Table(name="") ' , $ s );
388+ }
389+
390+ return $ s ;
391+ }
392+ };
393+
377394$ ok = $ checker ->run ($ options ['-d ' ]);
378395
379396exit ($ ok ? 0 : 1 );
You can’t perform that action at this time.
0 commit comments