File tree Expand file tree Collapse file tree 2 files changed +15
-7
lines changed
Expand file tree Collapse file tree 2 files changed +15
-7
lines changed Original file line number Diff line number Diff line change 33if (!file_exists (__DIR__ .'/src ' )) {
44 exit (0 );
55}
6+
7+ $ finder = PhpCsFixer \Finder::create ()
8+ ->in (__DIR__ .'/src ' )
9+ // the PHP template files are a bit special
10+ ->notName ('*.tpl.php ' )
11+ ;
12+
13+ if (\PHP_VERSION_ID < 70100 ) {
14+ // EntityRegenerator works only with PHP 7.1+
15+ $ finder ->notName ('EntityRegenerator.php ' );
16+ }
17+
618return PhpCsFixer \Config::create ()
719 ->setRules (array (
820 '@Symfony ' => true ,
2234 ]
2335 ))
2436 ->setRiskyAllowed (true )
25- ->setFinder (
26- PhpCsFixer \Finder::create ()
27- ->in (__DIR__ .'/src ' )
28- // the PHP template files are a bit special
29- ->notName ('*.tpl.php ' )
30- )
37+ ->setFinder ($ finder )
3138;
Original file line number Diff line number Diff line change 1111
1212namespace Symfony \Bundle \MakerBundle \Doctrine ;
1313
14+ use Doctrine \Common \Persistence \Mapping \MappingException as CommonMappingException ;
1415use Doctrine \ORM \Mapping \ClassMetadata ;
1516use Doctrine \ORM \Mapping \MappingException ;
1617use Symfony \Bundle \MakerBundle \Exception \RuntimeCommandException ;
@@ -43,7 +44,7 @@ public function regenerateEntities(string $classOrNamespace)
4344 {
4445 try {
4546 $ metadata = $ this ->doctrineHelper ->getMetadata ($ classOrNamespace );
46- } catch (MappingException $ mappingException ) {
47+ } catch (MappingException | CommonMappingException $ mappingException ) {
4748 $ metadata = $ this ->doctrineHelper ->getMetadata ($ classOrNamespace , true );
4849 }
4950
You can’t perform that action at this time.
0 commit comments