Skip to content

Commit cd84b18

Browse files
committed
Fix CS
1 parent c141c91 commit cd84b18

File tree

591 files changed

+59198
-64717
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

591 files changed

+59198
-64717
lines changed

data/bin/changelog.php

+13-16
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/*
44
* This file is part of the symfony package.
55
* (c) Fabien Potencier <fabien.potencier@symfony-project.com>
6-
*
6+
*
77
* For the full copyright and license information, please view the LICENSE
88
* file that was distributed with this source code.
99
*/
@@ -13,22 +13,20 @@
1313
*
1414
* Usage: php data/bin/changelog.php -r12345:67890 /branches/1.3
1515
*
16-
* @package symfony
1716
* @author Fabien Potencier <fabien.potencier@symfony-project.com>
17+
*
1818
* @version SVN: $Id$
1919
*/
2020
require_once __DIR__.'/../../lib/task/sfFilesystem.class.php';
2121

22-
if (!isset($argv[1]))
23-
{
24-
echo "You must provide a revision range (-r123:456)\n";
25-
exit(1);
22+
if (!isset($argv[1])) {
23+
echo "You must provide a revision range (-r123:456)\n";
24+
exit(1);
2625
}
2726

28-
if (!isset($argv[2]))
29-
{
30-
echo "You must provide a repository path (/branches/1.4)\n";
31-
exit(1);
27+
if (!isset($argv[2])) {
28+
echo "You must provide a repository path (/branches/1.4)\n";
29+
exit(1);
3230
}
3331

3432
$filesystem = new sfFilesystem();
@@ -37,13 +35,12 @@
3735
$info = new SimpleXMLElement($out);
3836

3937
list($out, $err) = $filesystem->execute(vsprintf('svn log %s --xml %s', array_map('escapeshellarg', array(
40-
$argv[1],
41-
(string) $info->entry->repository->root.$argv[2],
38+
$argv[1],
39+
(string) $info->entry->repository->root.$argv[2],
4240
))));
4341
$log = new SimpleXMLElement($out);
4442

45-
foreach ($log->logentry as $logentry)
46-
{
47-
echo sprintf(' * [%d] %s', $logentry['revision'], trim(preg_replace('/\s*\[[\d\., ]+\]\s*/', '', (string) $logentry->msg)));
48-
echo PHP_EOL;
43+
foreach ($log->logentry as $logentry) {
44+
echo sprintf(' * [%d] %s', $logentry['revision'], trim(preg_replace('/\s*\[[\d\., ]+\]\s*/', '', (string) $logentry->msg)));
45+
echo PHP_EOL;
4946
}

data/bin/check_configuration.php

+36-41
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,28 @@
22

33
function is_cli()
44
{
5-
return !isset($_SERVER['HTTP_HOST']);
5+
return !isset($_SERVER['HTTP_HOST']);
66
}
77

88
/**
99
* Checks a configuration.
10+
*
11+
* @param mixed $boolean
12+
* @param mixed $message
13+
* @param mixed $help
14+
* @param mixed $fatal
1015
*/
1116
function check($boolean, $message, $help = '', $fatal = false)
1217
{
13-
echo $boolean ? " OK " : sprintf("[[%s]] ", $fatal ? ' ERROR ' : 'WARNING');
14-
echo sprintf("$message%s\n", $boolean ? '' : ': FAILED');
18+
echo $boolean ? ' OK ' : sprintf('[[%s]] ', $fatal ? ' ERROR ' : 'WARNING');
19+
echo sprintf("{$message}%s\n", $boolean ? '' : ': FAILED');
1520

16-
if (!$boolean)
17-
{
18-
echo " *** $help ***\n";
19-
if ($fatal)
20-
{
21-
die("You must fix this problem before resuming the check.\n");
21+
if (!$boolean) {
22+
echo " *** {$help} ***\n";
23+
if ($fatal) {
24+
exit("You must fix this problem before resuming the check.\n");
25+
}
2226
}
23-
}
2427
}
2528

2629
/**
@@ -30,17 +33,15 @@ function check($boolean, $message, $help = '', $fatal = false)
3033
*/
3134
function get_ini_path()
3235
{
33-
if ($path = get_cfg_var('cfg_file_path'))
34-
{
35-
return $path;
36-
}
36+
if ($path = get_cfg_var('cfg_file_path')) {
37+
return $path;
38+
}
3739

38-
return 'WARNING: not using a php.ini file';
40+
return 'WARNING: not using a php.ini file';
3941
}
4042

41-
if (!is_cli())
42-
{
43-
echo '<html><body><pre>';
43+
if (!is_cli()) {
44+
echo '<html><body><pre>';
4445
}
4546

4647
echo "********************************\n";
@@ -51,18 +52,16 @@ function get_ini_path()
5152

5253
echo sprintf("php.ini used by PHP: %s\n\n", get_ini_path());
5354

54-
if (is_cli())
55-
{
56-
echo "** WARNING **\n";
57-
echo "* The PHP CLI can use a different php.ini file\n";
58-
echo "* than the one used with your web server.\n";
59-
if ('\\' == DIRECTORY_SEPARATOR)
60-
{
61-
echo "* (especially on the Windows platform)\n";
62-
}
63-
echo "* If this is the case, please launch this\n";
64-
echo "* utility from your web server.\n";
65-
echo "** WARNING **\n";
55+
if (is_cli()) {
56+
echo "** WARNING **\n";
57+
echo "* The PHP CLI can use a different php.ini file\n";
58+
echo "* than the one used with your web server.\n";
59+
if ('\\' == DIRECTORY_SEPARATOR) {
60+
echo "* (especially on the Windows platform)\n";
61+
}
62+
echo "* If this is the case, please launch this\n";
63+
echo "* utility from your web server.\n";
64+
echo "** WARNING **\n";
6665
}
6766

6867
// mandatory
@@ -72,10 +71,9 @@ function get_ini_path()
7271
// warnings
7372
echo "\n** Optional checks **\n\n";
7473
check(class_exists('PDO'), 'PDO is installed', 'Install PDO (mandatory for Doctrine)', false);
75-
if (class_exists('PDO'))
76-
{
77-
$drivers = PDO::getAvailableDrivers();
78-
check(count($drivers), 'PDO has some drivers installed: '.implode(', ', $drivers), 'Install PDO drivers (mandatory for Doctrine)');
74+
if (class_exists('PDO')) {
75+
$drivers = PDO::getAvailableDrivers();
76+
check(count($drivers), 'PDO has some drivers installed: '.implode(', ', $drivers), 'Install PDO drivers (mandatory for Doctrine)');
7977
}
8078
check(function_exists('token_get_all'), 'The token_get_all() function is available', 'Install and enable the Tokenizer extension (highly recommended)', false);
8179
check(function_exists('mb_strlen'), 'The mb_strlen() function is available', 'Install and enable the mbstring extension', false);
@@ -85,10 +83,8 @@ function get_ini_path()
8583

8684
$accelerator =
8785
(function_exists('apc_store') && ini_get('apc.enabled'))
88-
||
89-
function_exists('eaccelerator_put') && ini_get('eaccelerator.enable')
90-
||
91-
function_exists('xcache_set')
86+
|| function_exists('eaccelerator_put') && ini_get('eaccelerator.enable')
87+
|| function_exists('xcache_set')
9288
;
9389
check($accelerator, 'A PHP accelerator is installed', 'Install a PHP accelerator like APC (highly recommended)', false);
9490

@@ -99,7 +95,6 @@ function_exists('xcache_set')
9995

10096
check(class_exists('Memcache'), 'Memcache is available', 'You must have memcache installed and enabled to use sfMemcacheCache class.', false);
10197

102-
if (!is_cli())
103-
{
104-
echo '</pre></body></html>';
98+
if (!is_cli()) {
99+
echo '</pre></body></html>';
105100
}

data/bin/release.php

+38-49
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/*
44
* This file is part of the symfony package.
55
* (c) 2004-2007 Fabien Potencier <fabien.potencier@symfony-project.com>
6-
*
6+
*
77
* For the full copyright and license information, please view the LICENSE
88
* file that was distributed with this source code.
99
*/
@@ -13,65 +13,56 @@
1313
*
1414
* Usage: php data/bin/release.php 1.3.0 stable
1515
*
16-
* @package symfony
1716
* @author Fabien Potencier <fabien.potencier@symfony-project.com>
17+
*
1818
* @version SVN: $Id$
1919
*/
20-
require_once(__DIR__.'/../../lib/exception/sfException.class.php');
21-
require_once(__DIR__.'/../../lib/task/sfFilesystem.class.php');
22-
require_once(__DIR__.'/../../lib/util/sfFinder.class.php');
23-
require_once(__DIR__.'/../../lib/vendor/lime/lime.php');
24-
25-
if (!isset($argv[1]))
26-
{
27-
throw new Exception('You must provide version prefix.');
20+
require_once __DIR__.'/../../lib/exception/sfException.class.php';
21+
require_once __DIR__.'/../../lib/task/sfFilesystem.class.php';
22+
require_once __DIR__.'/../../lib/util/sfFinder.class.php';
23+
require_once __DIR__.'/../../lib/vendor/lime/lime.php';
24+
25+
if (!isset($argv[1])) {
26+
throw new Exception('You must provide version prefix.');
2827
}
2928

30-
if (!isset($argv[2]))
31-
{
32-
throw new Exception('You must provide stability status (alpha/beta/stable).');
29+
if (!isset($argv[2])) {
30+
throw new Exception('You must provide stability status (alpha/beta/stable).');
3331
}
3432

3533
$stability = $argv[2];
3634

3735
$filesystem = new sfFilesystem();
3836

39-
if (($stability == 'beta' || $stability == 'alpha') && count(explode('.', $argv[1])) < 2)
40-
{
41-
$version_prefix = $argv[1];
37+
if (('beta' == $stability || 'alpha' == $stability) && count(explode('.', $argv[1])) < 2) {
38+
$version_prefix = $argv[1];
4239

43-
list($result) = $filesystem->execute('svn status -u '.getcwd());
44-
if (preg_match('/Status against revision\:\s+(\d+)\s*$/im', $result, $match))
45-
{
46-
$version = $match[1];
47-
}
40+
list($result) = $filesystem->execute('svn status -u '.getcwd());
41+
if (preg_match('/Status against revision\:\s+(\d+)\s*$/im', $result, $match)) {
42+
$version = $match[1];
43+
}
4844

49-
if (!isset($version))
50-
{
51-
throw new Exception('Unable to find last SVN revision.');
52-
}
45+
if (!isset($version)) {
46+
throw new Exception('Unable to find last SVN revision.');
47+
}
5348

54-
// make a PEAR compatible version
55-
$version = $version_prefix.'.'.$version;
56-
}
57-
else
58-
{
59-
$version = $argv[1];
49+
// make a PEAR compatible version
50+
$version = $version_prefix.'.'.$version;
51+
} else {
52+
$version = $argv[1];
6053
}
6154

62-
print sprintf("Releasing symfony version \"%s\".\n", $version);
55+
echo sprintf("Releasing symfony version \"%s\".\n", $version);
6356

6457
// tests
6558
list($result) = $filesystem->execute('php data/bin/symfony symfony:test');
6659

67-
if (0 != $result)
68-
{
69-
throw new Exception('Some tests failed. Release process aborted!');
60+
if (0 != $result) {
61+
throw new Exception('Some tests failed. Release process aborted!');
7062
}
7163

72-
if (is_file('package.xml'))
73-
{
74-
$filesystem->remove(getcwd().DIRECTORY_SEPARATOR.'package.xml');
64+
if (is_file('package.xml')) {
65+
$filesystem->remove(getcwd().DIRECTORY_SEPARATOR.'package.xml');
7566
}
7667

7768
$filesystem->copy(getcwd().'/package.xml.tmpl', getcwd().'/package.xml');
@@ -80,21 +71,19 @@
8071
$finder = sfFinder::type('file')->relative();
8172
$xml_classes = '';
8273
$dirs = array('lib' => 'php', 'data' => 'data');
83-
foreach ($dirs as $dir => $role)
84-
{
85-
$class_files = $finder->in($dir);
86-
foreach ($class_files as $file)
87-
{
88-
$xml_classes .= '<file role="'.$role.'" baseinstalldir="symfony" install-as="'.$file.'" name="'.$dir.'/'.$file.'" />'."\n";
89-
}
74+
foreach ($dirs as $dir => $role) {
75+
$class_files = $finder->in($dir);
76+
foreach ($class_files as $file) {
77+
$xml_classes .= '<file role="'.$role.'" baseinstalldir="symfony" install-as="'.$file.'" name="'.$dir.'/'.$file.'" />'."\n";
78+
}
9079
}
9180

9281
// replace tokens
9382
$filesystem->replaceTokens(getcwd().DIRECTORY_SEPARATOR.'package.xml', '##', '##', array(
94-
'SYMFONY_VERSION' => $version,
95-
'CURRENT_DATE' => date('Y-m-d'),
96-
'CLASS_FILES' => $xml_classes,
97-
'STABILITY' => $stability,
83+
'SYMFONY_VERSION' => $version,
84+
'CURRENT_DATE' => date('Y-m-d'),
85+
'CLASS_FILES' => $xml_classes,
86+
'STABILITY' => $stability,
9887
));
9988

10089
list($results) = $filesystem->execute('pear package');

data/bin/sandbox_installer.php

+6-8
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,10 @@
2424

2525
$this->logSection('install', 'add an empty file in empty directories');
2626
$seen = array();
27-
foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator(sfConfig::get('sf_root_dir')), RecursiveIteratorIterator::CHILD_FIRST) as $path => $item)
28-
{
29-
if (!isset($seen[$path]) && $item->isDir() && !$item->isLink())
30-
{
31-
touch($item->getRealPath().'/.sf');
32-
}
33-
34-
$seen[$item->getPath()] = true;
27+
foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator(sfConfig::get('sf_root_dir')), RecursiveIteratorIterator::CHILD_FIRST) as $path => $item) {
28+
if (!isset($seen[$path]) && $item->isDir() && !$item->isLink()) {
29+
touch($item->getRealPath().'/.sf');
30+
}
31+
32+
$seen[$item->getPath()] = true;
3533
}

0 commit comments

Comments
 (0)