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 3
3
if (!file_exists (__DIR__ .'/src ' )) {
4
4
exit (0 );
5
5
}
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
+
6
18
return PhpCsFixer \Config::create ()
7
19
->setRules (array (
8
20
'@Symfony ' => true ,
22
34
]
23
35
))
24
36
->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 )
31
38
;
Original file line number Diff line number Diff line change 11
11
12
12
namespace Symfony \Bundle \MakerBundle \Doctrine ;
13
13
14
+ use Doctrine \Common \Persistence \Mapping \MappingException as CommonMappingException ;
14
15
use Doctrine \ORM \Mapping \ClassMetadata ;
15
16
use Doctrine \ORM \Mapping \MappingException ;
16
17
use Symfony \Bundle \MakerBundle \Exception \RuntimeCommandException ;
@@ -43,7 +44,7 @@ public function regenerateEntities(string $classOrNamespace)
43
44
{
44
45
try {
45
46
$ metadata = $ this ->doctrineHelper ->getMetadata ($ classOrNamespace );
46
- } catch (MappingException $ mappingException ) {
47
+ } catch (MappingException | CommonMappingException $ mappingException ) {
47
48
$ metadata = $ this ->doctrineHelper ->getMetadata ($ classOrNamespace , true );
48
49
}
49
50
You can’t perform that action at this time.
0 commit comments