From e62804abb6c66595fb9889a6e11e4d3f91d2ddcd Mon Sep 17 00:00:00 2001 From: Brikou CARRE Date: Wed, 8 Jun 2011 10:34:35 +0200 Subject: [PATCH] added a script to clean up the code and follow CS --- check_cs.php | 74 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 check_cs.php diff --git a/check_cs.php b/check_cs.php new file mode 100644 index 0000000000..efe163889d --- /dev/null +++ b/check_cs.php @@ -0,0 +1,74 @@ +#!/usr/bin/php +files() + ->name('*.md') + ->name('*.php') + ->name('*.php.dist') + ->name('*.twig') + ->name('*.xml') + ->name('*.xml.dist') + ->name('*.yml') + ->in(__DIR__) + ->notName(basename(__FILE__)) + ->exclude('.git') + ->exclude('vendor') +; + +foreach ($finder as $file) { /* @var $file Symfony\Component\Finder\SplFileInfo */ + + // These files are skipped because tests would break + if (in_array($file->getRelativePathname(), array( + 'tests/Symfony/Tests/Component/ClassLoader/ClassCollectionLoaderTest.php', + 'tests/Symfony/Tests/Component/DependencyInjection/Fixtures/containers/container9.php', + 'tests/Symfony/Tests/Component/DependencyInjection/Fixtures/includes/foo.php', + 'tests/Symfony/Tests/Component/DependencyInjection/Fixtures/php/services9.php', + 'tests/Symfony/Tests/Component/DependencyInjection/Fixtures/yaml/services9.yml', + 'tests/Symfony/Tests/Component/Routing/Fixtures/dumper/url_matcher1.php', + 'tests/Symfony/Tests/Component/Routing/Fixtures/dumper/url_matcher2.php', + 'tests/Symfony/Tests/Component/Yaml/Fixtures/sfTests.yml', + ))) { + continue; + } + + $old = file_get_contents($file->getRealpath()); + + $new = $old; + + // [Structure] Never use short tags (getRealpath(), $new); + echo $file->getRelativePathname() . PHP_EOL; + } +}