@@ -26,19 +26,20 @@ $finder
26
26
->name ('*.xml ' )
27
27
->name ('*.xml.dist ' )
28
28
->name ('*.yml ' )
29
- ->in (__DIR__ )
29
+ ->in (array ( __DIR__ . ' /src ' , __DIR__ . ' /tests ' ) )
30
30
->notName (basename (__FILE__ ))
31
31
->exclude ('.git ' )
32
32
->exclude ('vendor ' )
33
33
;
34
34
35
- $ exit = 0 ;
35
+ $ count = 0 ;
36
+
36
37
foreach ($ finder as $ file ) {
37
38
38
39
/* @var $file Symfony\Component\Finder\SplFileInfo */
39
40
40
41
// These files are skipped because tests would break
41
- if ( in_array ( $ file -> getRelativePathname (), array (
42
+ foreach ( array (
42
43
'tests/Symfony/Tests/Component/ClassLoader/ClassCollectionLoaderTest.php ' ,
43
44
'tests/Symfony/Tests/Component/DependencyInjection/Fixtures/containers/container9.php ' ,
44
45
'tests/Symfony/Tests/Component/DependencyInjection/Fixtures/includes/foo.php ' ,
@@ -47,8 +48,11 @@ foreach ($finder as $file) {
47
48
'tests/Symfony/Tests/Component/Routing/Fixtures/dumper/url_matcher1.php ' ,
48
49
'tests/Symfony/Tests/Component/Routing/Fixtures/dumper/url_matcher2.php ' ,
49
50
'tests/Symfony/Tests/Component/Yaml/Fixtures/sfTests.yml ' ,
50
- ))) {
51
- continue ;
51
+ ) as $ skippedFile ) {
52
+
53
+ if ($ skippedFile === substr ($ file ->getRealPath (), strlen ($ skippedFile ) * -1 )) {
54
+ continue (2 );
55
+ }
52
56
}
53
57
54
58
$ old = file_get_contents ($ file ->getRealpath ());
@@ -90,13 +94,13 @@ foreach ($finder as $file) {
90
94
}
91
95
92
96
if ($ new != $ old ) {
93
- $ exit = 1 ;
97
+ $ count ++;
98
+
94
99
if ($ fix ) {
95
100
file_put_contents ($ file ->getRealpath (), $ new );
96
101
}
97
-
98
- echo $ file ->getRelativePathname ().PHP_EOL ;
102
+ printf ('%4d) %s ' .PHP_EOL , $ count , $ file ->getRelativePathname ());
99
103
}
100
104
}
101
105
102
- exit ($ exit );
106
+ exit ($ count ? 1 : 0 );
0 commit comments