Skip to content

Commit f146d57

Browse files
Merge branch '3.3' into 3.4
* 3.3: [CS][2.7] yoda_style, no_unneeded_curly_braces, no_unneeded_final_method, semicolon_after_instruction [Filesystem] mirror - fix copying content with same name as source/target. Removed unnecessary getDefinition() call. .php_cs.dist - simplify config [WebProfilerBundle] fixed TemplateManager when using Twig 2 without compat interfaces
2 parents 6fc5a29 + dbaa8ae commit f146d57

File tree

6 files changed

+19
-19
lines changed

6 files changed

+19
-19
lines changed

Data/Bundle/Compiler/GenrbCompiler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public function compile($sourcePath, $targetDir)
6161

6262
exec($this->genrb.' --quiet -e UTF-8 -d '.$targetDir.' '.$sourcePath, $output, $status);
6363

64-
if ($status !== 0) {
64+
if (0 !== $status) {
6565
throw new RuntimeException(sprintf(
6666
'genrb failed with status %d while compiling %s to %s.',
6767
$status,

DateFormatter/DateFormat/TimezoneTransformer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ public static function getEtcTimeZoneId($formattedTimeZone)
103103
if (preg_match('/GMT(?P<signal>[+-])(?P<hours>\d{2}):?(?P<minutes>\d{2})/', $formattedTimeZone, $matches)) {
104104
$hours = (int) $matches['hours'];
105105
$minutes = (int) $matches['minutes'];
106-
$signal = $matches['signal'] == '-' ? '+' : '-';
106+
$signal = '-' == $matches['signal'] ? '+' : '-';
107107

108108
if (0 < $minutes) {
109109
throw new NotImplementedException(sprintf(
@@ -112,7 +112,7 @@ public static function getEtcTimeZoneId($formattedTimeZone)
112112
));
113113
}
114114

115-
return 'Etc/GMT'.($hours !== 0 ? $signal.$hours : '');
115+
return 'Etc/GMT'.(0 !== $hours ? $signal.$hours : '');
116116
}
117117

118118
throw new \InvalidArgumentException(sprintf('The GMT time zone "%s" does not match with the supported formats GMT[+-]HH:MM or GMT[+-]HHMM.', $formattedTimeZone));

Exception/MethodArgumentValueNotImplementedException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public function __construct($methodName, $argName, $argValue, $additionalMessage
3131
$methodName,
3232
$argName,
3333
var_export($argValue, true),
34-
$additionalMessage !== '' ? ' '.$additionalMessage.'. ' : ''
34+
'' !== $additionalMessage ? ' '.$additionalMessage.'. ' : ''
3535
);
3636

3737
parent::__construct($message);

NumberFormatter/NumberFormatter.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ public static function create($locale = 'en', $style = null, $pattern = null)
332332
*/
333333
public function formatCurrency($value, $currency)
334334
{
335-
if ($this->style == self::DECIMAL) {
335+
if (self::DECIMAL == $this->style) {
336336
return $this->format($value);
337337
}
338338

@@ -371,21 +371,21 @@ public function formatCurrency($value, $currency)
371371
public function format($value, $type = self::TYPE_DEFAULT)
372372
{
373373
// The original NumberFormatter does not support this format type
374-
if ($type == self::TYPE_CURRENCY) {
374+
if (self::TYPE_CURRENCY == $type) {
375375
trigger_error(__METHOD__.'(): Unsupported format type '.$type, \E_USER_WARNING);
376376

377377
return false;
378378
}
379379

380-
if ($this->style == self::CURRENCY) {
380+
if (self::CURRENCY == $this->style) {
381381
throw new NotImplementedException(sprintf(
382382
'%s() method does not support the formatting of currencies (instance with CURRENCY style). %s',
383383
__METHOD__, NotImplementedException::INTL_INSTALL_MESSAGE
384384
));
385385
}
386386

387387
// Only the default type is supported.
388-
if ($type != self::TYPE_DEFAULT) {
388+
if (self::TYPE_DEFAULT != $type) {
389389
throw new MethodArgumentValueNotImplementedException(__METHOD__, 'type', $type, 'Only TYPE_DEFAULT is supported');
390390
}
391391

@@ -528,7 +528,7 @@ public function parseCurrency($value, &$currency, &$position = null)
528528
*/
529529
public function parse($value, $type = self::TYPE_DOUBLE, &$position = 0)
530530
{
531-
if ($type == self::TYPE_DEFAULT || $type == self::TYPE_CURRENCY) {
531+
if (self::TYPE_DEFAULT == $type || self::TYPE_CURRENCY == $type) {
532532
trigger_error(__METHOD__.'(): Unsupported format type '.$type, \E_USER_WARNING);
533533

534534
return false;
@@ -775,7 +775,7 @@ private function formatNumber($value, $precision)
775775
*/
776776
private function getUninitializedPrecision($value, $precision)
777777
{
778-
if ($this->style == self::CURRENCY) {
778+
if (self::CURRENCY == $this->style) {
779779
return $precision;
780780
}
781781

@@ -811,11 +811,11 @@ private function isInitializedAttribute($attr)
811811
*/
812812
private function convertValueDataType($value, $type)
813813
{
814-
if ($type == self::TYPE_DOUBLE) {
814+
if (self::TYPE_DOUBLE == $type) {
815815
$value = (float) $value;
816-
} elseif ($type == self::TYPE_INT32) {
816+
} elseif (self::TYPE_INT32 == $type) {
817817
$value = $this->getInt32Value($value);
818-
} elseif ($type == self::TYPE_INT64) {
818+
} elseif (self::TYPE_INT64 == $type) {
819819
$value = $this->getInt64Value($value);
820820
}
821821

Tests/NumberFormatter/AbstractNumberFormatterTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,7 @@ public function testParse($value, $expected, $message, $expectedPosition, $group
621621
$this->assertSame($expected, $parsedValue, $message);
622622
$this->assertSame($expectedPosition, $position, $message);
623623

624-
if ($expected === false) {
624+
if (false === $expected) {
625625
$errorCode = IntlGlobals::U_PARSE_ERROR;
626626
$errorMessage = 'Number parsing failed: U_PARSE_ERROR';
627627
} else {
@@ -631,10 +631,10 @@ public function testParse($value, $expected, $message, $expectedPosition, $group
631631

632632
$this->assertSame($errorMessage, $this->getIntlErrorMessage());
633633
$this->assertSame($errorCode, $this->getIntlErrorCode());
634-
$this->assertSame($errorCode !== 0, $this->isIntlFailure($this->getIntlErrorCode()));
634+
$this->assertSame(0 !== $errorCode, $this->isIntlFailure($this->getIntlErrorCode()));
635635
$this->assertSame($errorMessage, $formatter->getErrorMessage());
636636
$this->assertSame($errorCode, $formatter->getErrorCode());
637-
$this->assertSame($errorCode !== 0, $this->isIntlFailure($formatter->getErrorCode()));
637+
$this->assertSame(0 !== $errorCode, $this->isIntlFailure($formatter->getErrorCode()));
638638
}
639639

640640
public function parseProvider()

Util/SvnRepository.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public static function download($url, $targetDir)
5050
{
5151
exec('which svn', $output, $result);
5252

53-
if ($result !== 0) {
53+
if (0 !== $result) {
5454
throw new RuntimeException('The command "svn" is not installed.');
5555
}
5656

@@ -62,7 +62,7 @@ public static function download($url, $targetDir)
6262

6363
exec('svn checkout '.$url.' '.$targetDir, $output, $result);
6464

65-
if ($result !== 0) {
65+
if (0 !== $result) {
6666
throw new RuntimeException('The SVN checkout of '.$url.'failed.');
6767
}
6868
}
@@ -128,7 +128,7 @@ private function getSvnInfo()
128128

129129
$svnInfo = simplexml_load_string(implode("\n", $output));
130130

131-
if ($result !== 0) {
131+
if (0 !== $result) {
132132
throw new RuntimeException('svn info failed');
133133
}
134134

0 commit comments

Comments
 (0)