Skip to content

Commit d7c1526

Browse files
committed
Coding Style
1 parent 29563b9 commit d7c1526

File tree

13 files changed

+33
-18
lines changed

13 files changed

+33
-18
lines changed

lib/cache/sfFileCache.class.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,9 +256,13 @@ protected function read($path, $type = self::READ_DATA)
256256
fseek($fp, 0, SEEK_END);
257257
$length = ftell($fp) - 24;
258258
fseek($fp, 24);
259-
if($length > 0) {
259+
260+
if ($length > 0)
261+
{
260262
$data[self::READ_DATA] = @fread($fp, $length);
261-
} else {
263+
}
264+
else
265+
{
262266
$data[self::READ_DATA] = '';
263267
}
264268
}

lib/escaper/sfOutputEscaperObjectDecorator.class.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,8 @@ public function __isset($key)
119119
public function count()
120120
{
121121
// See https://github.com/symfony/polyfill/commit/d330c0094a47d8edceeea1ed553d6e08215a9fc2
122-
if(is_array($this->value) || $this->value instanceof Countable || $this->value instanceof ResourceBundle || $this->value instanceof SimpleXmlElement) {
122+
if (is_array($this->value) || $this->value instanceof Countable || $this->value instanceof ResourceBundle || $this->value instanceof SimpleXmlElement)
123+
{
123124
return count($this->value);
124125
}
125126
return 1;

lib/exception/sfException.class.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,9 +367,11 @@ static protected function formatArrayAsHtml($values)
367367
static protected function fileExcerpt($file, $line)
368368
{
369369
// $file can be null for RuntimeException
370-
if($file === null) {
370+
if ($file === null)
371+
{
371372
return '';
372373
}
374+
373375
if (is_readable($file))
374376
{
375377
$content = preg_split('#<br />#', preg_replace('/^<code>(.*)<\/code>$/s', '$1', highlight_file($file, true)));

lib/i18n/sfI18N.class.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,11 +273,13 @@ public function getTimestampForCulture($dateTime, $culture = null)
273273

274274
// mktime behavior change with php8
275275
// $hour become not nullable
276-
if (!$hour) {
276+
if (!$hour)
277+
{
277278
$hour = 0;
278279
}
279280
// Before 8.0, $minutes value to null, was casted as (int)0
280-
if (!$minute) {
281+
if (!$minute)
282+
{
281283
$minute = 0;
282284
}
283285
return null === $day ? null : mktime($hour, $minute, 0, $month, $day, $year);

lib/log/sfFileLogger.class.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,8 @@ public function shutdown()
136136
*/
137137
public static function strftime($format)
138138
{
139-
if (version_compare(PHP_VERSION, '8.1.0') < 0) {
139+
if (version_compare(PHP_VERSION, '8.1.0') < 0)
140+
{
140141
return strftime($format);
141142
}
142143
return date(self::_strftimeFormatToDateFormat($format));
@@ -160,8 +161,8 @@ public static function strftime($format)
160161
*
161162
* @return array|string|string[]
162163
*/
163-
private static function _strftimeFormatToDateFormat($strftimeFormat) {
164-
164+
private static function _strftimeFormatToDateFormat($strftimeFormat)
165+
{
165166
// Missing %V %C %g %G
166167
$search = array(
167168
'%a', '%A', '%d', '%e', '%u',

lib/plugins/sfDoctrinePlugin/lib/test/sfTesterDoctrine.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public function check($model, $query, $value = true)
6565
}
6666

6767
$operator = '=';
68-
if (strlen($condition) && '!' == substr($condition,0,1))
68+
if (strlen($condition) && '!' == substr($condition, 0, 1))
6969
{
7070
$operator = false !== strpos($condition, '%') ? 'NOT LIKE' : '!=';
7171
$condition = substr($condition, 1);

lib/response/sfResponse.class.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,8 @@ public function unserialize($serialized)
177177
*
178178
* @return array
179179
*/
180-
public function __serialize() {
180+
public function __serialize()
181+
{
181182
return array('content' => $this->content);
182183
}
183184

lib/routing/sfRoute.class.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -862,7 +862,8 @@ public function unserialize($serialized)
862862
*
863863
* @return array
864864
*/
865-
public function __serialize() {
865+
public function __serialize()
866+
{
866867
// always serialize compiled routes
867868
$this->compile();
868869
// sfPatternRouting will always re-set defaultParameters, so no need to serialize them

lib/test/sfTesterResponse.class.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ public function initialize()
4949
}
5050
else
5151
{
52-
if($this->response->getContent()) {
52+
if ($this->response->getContent())
53+
{
5354
@$this->dom->loadHTML($this->response->getContent());
5455
}
5556
}

lib/util/sfBrowserBase.class.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,8 @@ public function call($uri, $method = 'get', $parameters = array(), $changeStack
363363
}
364364
else
365365
{
366-
if($response->getContent()) {
366+
if ($response->getContent())
367+
{
367368
@$this->dom->loadHTML($response->getContent());
368369
}
369370
}

0 commit comments

Comments
 (0)