Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PSDI Army
yii2
Commits
ea68bd3a
Commit
ea68bd3a
authored
May 11, 2013
by
resurtm
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CS fixes.
parent
b314d963
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
28 additions
and
29 deletions
+28
-29
DictionaryTest.php
tests/unit/framework/base/DictionaryTest.php
+2
-2
QueryTest.php
tests/unit/framework/db/QueryTest.php
+1
-1
ManagerTestBase.php
tests/unit/framework/rbac/ManagerTestBase.php
+3
-3
AppController.php
yii/console/controllers/AppController.php
+12
-13
MessageController.php
yii/console/controllers/MessageController.php
+2
-2
Query.php
yii/db/Query.php
+1
-1
Markdown.php
yii/helpers/base/Markdown.php
+1
-1
GettextMoFile.php
yii/i18n/GettextMoFile.php
+1
-1
I18N.php
yii/i18n/I18N.php
+1
-1
ProfileTarget.php
yii/logging/ProfileTarget.php
+1
-1
TestCase.php
yii/test/TestCase.php
+2
-2
ListPager.php
yii/widgets/ListPager.php
+1
-1
No files found.
tests/unit/framework/base/DictionaryTest.php
View file @
ea68bd3a
...
...
@@ -111,8 +111,8 @@ class DictionaryTest extends \yiiunit\TestCase
public
function
testMergeWith
()
{
$a
=
array
(
'a'
=>
'v1'
,
'v2'
,
array
(
'2'
),
'c'
=>
array
(
'3'
,
'c'
=>
'a'
));
$b
=
array
(
'v22'
,
'a'
=>
'v11'
,
array
(
'2'
),
'c'
=>
array
(
'c'
=>
'3'
,
'a'
));
$a
=
array
(
'a'
=>
'v1'
,
'v2'
,
array
(
'2'
),
'c'
=>
array
(
'3'
,
'c'
=>
'a'
));
$b
=
array
(
'v22'
,
'a'
=>
'v11'
,
array
(
'2'
),
'c'
=>
array
(
'c'
=>
'3'
,
'a'
));
$c
=
array
(
'a'
=>
'v11'
,
'v2'
,
array
(
'2'
),
'c'
=>
array
(
'3'
,
'c'
=>
'3'
,
'a'
),
'v22'
,
array
(
'2'
));
$dictionary
=
new
Dictionary
(
$a
);
$dictionary2
=
new
Dictionary
(
$b
);
...
...
tests/unit/framework/db/QueryTest.php
View file @
ea68bd3a
...
...
@@ -20,7 +20,7 @@ class QueryTest extends \yiiunit\DatabaseTestCase
$query
=
new
Query
;
$query
->
select
(
'id, name'
,
'something'
)
->
distinct
(
true
);
$this
->
assertEquals
(
array
(
'id'
,
'name'
),
$query
->
select
);
$this
->
assertEquals
(
array
(
'id'
,
'name'
),
$query
->
select
);
$this
->
assertTrue
(
$query
->
distinct
);
$this
->
assertEquals
(
'something'
,
$query
->
selectOption
);
}
...
...
tests/unit/framework/rbac/ManagerTestBase.php
View file @
ea68bd3a
...
...
@@ -164,8 +164,8 @@ abstract class ManagerTestBase extends TestCase
public
function
testExecuteBizRule
()
{
$this
->
assertTrue
(
$this
->
auth
->
executeBizRule
(
null
,
array
(),
null
));
$this
->
assertTrue
(
$this
->
auth
->
executeBizRule
(
'return 1
==
true;'
,
array
(),
null
));
$this
->
assertTrue
(
$this
->
auth
->
executeBizRule
(
'return $params[0]
==
$params[1];'
,
array
(
1
,
'1'
),
null
));
$this
->
assertTrue
(
$this
->
auth
->
executeBizRule
(
'return 1
==
true;'
,
array
(),
null
));
$this
->
assertTrue
(
$this
->
auth
->
executeBizRule
(
'return $params[0]
==
$params[1];'
,
array
(
1
,
'1'
),
null
));
$this
->
assertFalse
(
$this
->
auth
->
executeBizRule
(
'invalid'
,
array
(),
null
));
}
...
...
@@ -220,7 +220,7 @@ abstract class ManagerTestBase extends TestCase
$this
->
auth
->
createOperation
(
'updatePost'
,
'update a post'
);
$this
->
auth
->
createOperation
(
'deletePost'
,
'delete a post'
);
$task
=
$this
->
auth
->
createTask
(
'updateOwnPost'
,
'update a post by author himself'
,
'return $params["authorID"]
==
$params["userID"];'
);
$task
=
$this
->
auth
->
createTask
(
'updateOwnPost'
,
'update a post by author himself'
,
'return $params["authorID"]
==
$params["userID"];'
);
$task
->
addChild
(
'updatePost'
);
$role
=
$this
->
auth
->
createRole
(
'reader'
);
...
...
yii/console/controllers/AppController.php
View file @
ea68bd3a
...
...
@@ -8,7 +8,6 @@
namespace
yii\console\controllers
;
use
yii\console\Controller
;
use
yii\helpers\FileHelper
;
use
yii\base\Exception
;
/**
...
...
@@ -140,10 +139,10 @@ class AppController extends Controller
*/
protected
function
getConfig
()
{
if
(
$this
->
_config
===
null
)
{
$this
->
_config
=
require
$this
->
getDefaultTemplatesPath
()
.
'/config.php'
;
if
(
$this
->
_config
===
null
)
{
$this
->
_config
=
require
$this
->
getDefaultTemplatesPath
()
.
'/config.php'
;
if
(
$this
->
templatesPath
&&
file_exists
(
$this
->
templatesPath
))
{
$this
->
_config
=
array_merge
(
$this
->
_config
,
require
$this
->
templatesPath
.
'/config.php'
);
$this
->
_config
=
array_merge
(
$this
->
_config
,
require
$this
->
templatesPath
.
'/config.php'
);
}
}
if
(
isset
(
$this
->
_config
[
$this
->
type
]))
{
...
...
@@ -188,18 +187,18 @@ class AppController extends Controller
}
}
if
(
$i
===
0
)
{
return
"'"
.
$path1
.
"'"
;
if
(
$i
===
0
)
{
return
"'"
.
$path1
.
"'"
;
}
$up
=
''
;
for
(
$j
=
$i
;
$j
<
$n2
-
1
;
++
$j
)
{
$up
.=
'/..'
;
$up
=
''
;
for
(
$j
=
$i
;
$j
<
$n2
-
1
;
++
$j
)
{
$up
.=
'/..'
;
}
for
(;
$i
<
$n1
-
1
;
++
$i
)
{
$up
.=
'/'
.
$segs1
[
$i
];
for
(;
$i
<
$n1
-
1
;
++
$i
)
{
$up
.=
'/'
.
$segs1
[
$i
];
}
return
'__DIR__.\''
.
$up
.
'/'
.
basename
(
$path1
)
.
'\''
;
return
'__DIR__.\''
.
$up
.
'/'
.
basename
(
$path1
)
.
'\''
;
}
...
...
@@ -214,7 +213,7 @@ class AppController extends Controller
* <li>callback: optional, the callback to be invoked when copying a file. The callback function
* should be declared as follows:
* <pre>
* function foo($source,$params)
* function foo($source,
$params)
* </pre>
* where $source parameter is the source file path, and the content returned
* by the function will be saved into the target file.</li>
...
...
yii/console/controllers/MessageController.php
View file @
ea68bd3a
...
...
@@ -36,7 +36,7 @@ class MessageController extends Controller
* - sourcePath: string, root directory of all source files.
* - messagePath: string, root directory containing message translations.
* - languages: array, list of language codes that the extracted messages
* should be translated to. For example, array('zh_cn','en_au').
* should be translated to. For example, array('zh_cn',
'en_au').
* - fileTypes: array, a list of file extensions (e.g. 'php', 'xml').
* Only the files whose extension name can be found in this list
* will be processed. If empty, all files will be processed.
...
...
@@ -135,7 +135,7 @@ class MessageController extends Controller
return
$messages
;
}
protected
function
generateMessageFile
(
$messages
,
$fileName
,
$overwrite
,
$removeOld
,
$sort
)
protected
function
generateMessageFile
(
$messages
,
$fileName
,
$overwrite
,
$removeOld
,
$sort
)
{
echo
"Saving messages to
$fileName
..."
;
if
(
is_file
(
$fileName
))
{
...
...
yii/db/Query.php
View file @
ea68bd3a
...
...
@@ -234,7 +234,7 @@ class Query extends \yii\base\Component
*
* - `in`: operand 1 should be a column or DB expression, and operand 2 be an array representing
* the range of the values that the column or DB expression should be in. For example,
* `array('in', 'id', array(1,
2,3))` will generate `id IN (1,2,
3)`.
* `array('in', 'id', array(1,
2, 3))` will generate `id IN (1, 2,
3)`.
* The method will properly quote the column name and escape values in the range.
*
* - `not in`: similar to the `in` operator except that `IN` is replaced with `NOT IN` in the generated condition.
...
...
yii/helpers/base/Markdown.php
View file @
ea68bd3a
...
...
@@ -39,7 +39,7 @@ class Markdown
public
static
function
process
(
$content
,
$config
=
array
())
{
if
(
static
::
$markdown
===
null
)
{
if
(
static
::
$markdown
===
null
)
{
static
::
$markdown
=
new
MarkdownExtra
();
}
foreach
(
$config
as
$name
=>
$value
)
{
...
...
yii/i18n/GettextMoFile.php
View file @
ea68bd3a
...
...
@@ -109,7 +109,7 @@ class GettextMoFile extends GettextFile
if
((
$context
&&
$separatorPosition
!==
false
&&
substr
(
$id
,
0
,
$separatorPosition
)
===
$context
)
||
(
!
$context
&&
$separatorPosition
===
false
))
{
if
(
$separatorPosition
!==
false
)
{
$id
=
substr
(
$id
,
$separatorPosition
+
1
);
$id
=
substr
(
$id
,
$separatorPosition
+
1
);
}
$message
=
$this
->
readString
(
$fileHandle
,
$targetLengths
[
$i
],
$targetOffsets
[
$i
]);
...
...
yii/i18n/I18N.php
View file @
ea68bd3a
...
...
@@ -87,7 +87,7 @@ class I18N extends Component
$language
=
Yii
::
$app
->
language
;
}
// allow chars for category: word chars, ".", "-", "/","\"
// allow chars for category: word chars, ".", "-", "/",
"\"
if
(
strpos
(
$message
,
'|'
)
!==
false
&&
preg_match
(
'/^([\w\-\\/\.\\\\]+)\|(.*)/'
,
$message
,
$matches
))
{
$category
=
$matches
[
1
];
$message
=
$matches
[
2
];
...
...
yii/logging/ProfileTarget.php
View file @
ea68bd3a
...
...
@@ -166,7 +166,7 @@ class CProfileLogRoute extends CWebLogRoute
}
$entries
=
array_values
(
$results
);
$func
=
create_function
(
'$a,$b'
,
'return $a[4]
<$b[4]?1:
0;'
);
$func
=
create_function
(
'$a,$b'
,
'return $a[4]
< $b[4] ? 1 :
0;'
);
usort
(
$entries
,
$func
);
$this
->
render
(
'profile-summary'
,
$entries
);
...
...
yii/test/TestCase.php
View file @
ea68bd3a
...
...
@@ -10,9 +10,9 @@
namespace
yii\test
;
require_once
(
'PHPUnit/Runner/Version.php'
);
spl_autoload_unregister
(
array
(
'Yii'
,
'autoload'
));
spl_autoload_unregister
(
array
(
'Yii'
,
'autoload'
));
require_once
(
'PHPUnit/Autoload.php'
);
spl_autoload_register
(
array
(
'Yii'
,
'autoload'
));
// put yii's autoloader at the end
spl_autoload_register
(
array
(
'Yii'
,
'autoload'
));
// put yii's autoloader at the end
/**
* TestCase is the base class for all test case classes.
...
...
yii/widgets/ListPager.php
View file @
ea68bd3a
...
...
@@ -73,7 +73,7 @@ class ListPager extends Widget
$selection
=
$this
->
pagination
->
createUrl
(
$currentPage
);
if
(
!
isset
(
$this
->
options
[
'onchange'
]))
{
$this
->
options
[
'onchange'
]
=
"if
(this.value!='')
{
window.location=this.value;
}
;"
;
$this
->
options
[
'onchange'
]
=
"if
(this.value != '') { window.location = this.value;
};"
;
}
echo
Html
::
dropDownList
(
null
,
$selection
,
$pages
,
$this
->
options
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment