Skip to content

Commit 0f136db

Browse files
committed
fix indentation
1 parent ca08af1 commit 0f136db

File tree

3 files changed

+46
-46
lines changed

3 files changed

+46
-46
lines changed

framework/web/CHttpRequest.php

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1025,20 +1025,20 @@ public function getPreferredAcceptType()
10251025
return empty($preferredAcceptTypes) ? false : $preferredAcceptTypes[0];
10261026
}
10271027

1028-
/**
1029-
* String compare function used by usort.
1030-
* Included to circumvent the use of closures (not supported by PHP 5.2) and create_function (deprecated since PHP 7.2.0)
1031-
* @param array $a
1032-
* @param array $b
1033-
* @return int -1 (a>b), 0 (a==b), 1 (a<b)
1034-
*/
1035-
private function stringCompare($a, $b)
1036-
{
1037-
if ($a[0] == $b[0]) {
1038-
return 0;
1039-
}
1040-
return ($a[0] < $b[0]) ? 1 : -1;
1041-
}
1028+
/**
1029+
* String compare function used by usort.
1030+
* Included to circumvent the use of closures (not supported by PHP 5.2) and create_function (deprecated since PHP 7.2.0)
1031+
* @param array $a
1032+
* @param array $b
1033+
* @return int -1 (a>b), 0 (a==b), 1 (a<b)
1034+
*/
1035+
private function stringCompare($a, $b)
1036+
{
1037+
if ($a[0] == $b[0]) {
1038+
return 0;
1039+
}
1040+
return ($a[0] < $b[0]) ? 1 : -1;
1041+
}
10421042

10431043
/**
10441044
* Returns an array of user accepted languages in order of preference.

framework/web/helpers/CJavaScript.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class CJavaScript
2828
public static function quote($js,$forUrl=false)
2929
{
3030
$js = (string)$js;
31-
31+
3232
Yii::import('system.vendors.zend-escaper.Escaper');
3333
$escaper=new Escaper(Yii::app()->charset);
3434
if($forUrl)

tests/framework/web/helpers/CJavaScriptTest.php

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -16,38 +16,38 @@ public function testLegacyEncodeSafe()
1616
$this->assertEquals("'js\\x3Afunction\\x28\\x29\\x20\\x7B\\x20\\x2F\\x2A\\x20callback\\x20\\x2A\\x2F\\x20\\x7D'",$expression);
1717
}
1818

19-
public function testEncode()
20-
{
21-
$expression=CJavaScript::encode(new CJavaScriptExpression("function() { /* callback */ }"));
22-
$this->assertEquals("function() { /* callback */ }",$expression);
23-
}
19+
public function testEncode()
20+
{
21+
$expression=CJavaScript::encode(new CJavaScriptExpression("function() { /* callback */ }"));
22+
$this->assertEquals("function() { /* callback */ }",$expression);
23+
}
2424

25-
private function getUnicodeTestString()
26-
{
27-
$unicodeChar1 = json_decode('"'.'\u2028'.'"');
28-
$unicodeChar2 = json_decode('"'.'\u2029'.'"');
29-
return "test {$unicodeChar1}\ntest $unicodeChar2";
30-
}
25+
private function getUnicodeTestString()
26+
{
27+
$unicodeChar1 = json_decode('"'.'\u2028'.'"');
28+
$unicodeChar2 = json_decode('"'.'\u2029'.'"');
29+
return "test {$unicodeChar1}\ntest $unicodeChar2";
30+
}
3131

32-
public function testQuote()
33-
{
34-
$input=$this->getUnicodeTestString();
35-
$output=CJavaScript::quote($input);
36-
$this->assertEquals('test\x20\u2028\x0Atest\x20\u2029',$output);
37-
}
32+
public function testQuote()
33+
{
34+
$input=$this->getUnicodeTestString();
35+
$output=CJavaScript::quote($input);
36+
$this->assertEquals('test\x20\u2028\x0Atest\x20\u2029',$output);
37+
}
38+
39+
public function testQuoteForUrl()
40+
{
41+
$input=$this->getUnicodeTestString();
42+
$output=CJavaScript::quote($input,true);
43+
$this->assertEquals('test%20%E2%80%A8%0Atest%20%E2%80%A9',$output);
44+
}
45+
46+
public function testQuoteWithNull()
47+
{
48+
$input=null;
49+
$output=CJavaScript::quote($input);
50+
$this->assertSame('',$output);
51+
}
3852

39-
public function testQuoteForUrl()
40-
{
41-
$input=$this->getUnicodeTestString();
42-
$output=CJavaScript::quote($input,true);
43-
$this->assertEquals('test%20%E2%80%A8%0Atest%20%E2%80%A9',$output);
44-
}
45-
46-
public function testQuoteWithNull()
47-
{
48-
$input=null;
49-
$output=CJavaScript::quote($input);
50-
$this->assertSame('',$output);
51-
}
52-
5353
}

0 commit comments

Comments
 (0)