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
6066c29a
Commit
6066c29a
authored
Nov 11, 2013
by
Qiang Xue
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1180 from slavcodev/code-style
Code style
parents
5f76ee01
93dd6294
Hide whitespace changes
Inline
Side-by-side
Showing
37 changed files
with
92 additions
and
97 deletions
+92
-97
main.php
apps/advanced/backend/views/layouts/main.php
+4
-4
passwordResetToken.php
apps/advanced/frontend/views/emails/passwordResetToken.php
+2
-2
main.php
apps/advanced/frontend/views/layouts/main.php
+6
-6
login.php
apps/advanced/frontend/views/site/login.php
+1
-1
main.php
apps/basic/views/layouts/main.php
+7
-6
index.php
extensions/gii/views/default/index.php
+4
-4
files.php
extensions/gii/views/default/view/files.php
+2
-2
generator.php
extensions/gii/views/layouts/generator.php
+4
-4
main.php
extensions/gii/views/layouts/main.php
+2
-2
Message.php
extensions/swiftmailer/Message.php
+1
-1
BaseYii.php
framework/yii/BaseYii.php
+1
-1
Application.php
framework/yii/base/Application.php
+0
-2
Model.php
framework/yii/base/Model.php
+1
-2
Module.php
framework/yii/base/Module.php
+1
-1
View.php
framework/yii/base/View.php
+1
-1
CacheController.php
framework/yii/console/controllers/CacheController.php
+1
-1
ActiveQuery.php
framework/yii/db/ActiveQuery.php
+3
-3
ActiveRecord.php
framework/yii/db/ActiveRecord.php
+5
-5
ActiveRelation.php
framework/yii/db/ActiveRelation.php
+4
-4
Command.php
framework/yii/db/Command.php
+1
-1
Schema.php
framework/yii/db/Schema.php
+2
-2
Target.php
framework/yii/log/Target.php
+1
-1
PhpManager.php
framework/yii/rbac/PhpManager.php
+10
-10
requirements.php
framework/yii/requirements/requirements.php
+1
-1
index.php
framework/yii/requirements/views/console/index.php
+3
-3
index.php
framework/yii/requirements/views/web/index.php
+3
-3
ExistValidator.php
framework/yii/validators/ExistValidator.php
+2
-2
UniqueValidator.php
framework/yii/validators/UniqueValidator.php
+1
-1
AccessControl.php
framework/yii/web/AccessControl.php
+1
-1
UrlManager.php
framework/yii/web/UrlManager.php
+3
-3
User.php
framework/yii/web/User.php
+2
-2
ActiveForm.php
framework/yii/widgets/ActiveForm.php
+1
-1
layout.php
tests/unit/data/views/layout.php
+3
-4
rawlayout.php
tests/unit/data/views/rawlayout.php
+2
-3
MessageTest.php
tests/unit/extensions/swiftmailer/MessageTest.php
+1
-1
ActiveRecordTest.php
tests/unit/framework/db/ActiveRecordTest.php
+3
-3
ValidatorTest.php
tests/unit/framework/validators/ValidatorTest.php
+2
-3
No files found.
apps/advanced/backend/views/layouts/main.php
View file @
6066c29a
...
@@ -6,8 +6,8 @@ use yii\bootstrap\NavBar;
...
@@ -6,8 +6,8 @@ use yii\bootstrap\NavBar;
use
yii\widgets\Breadcrumbs
;
use
yii\widgets\Breadcrumbs
;
/**
/**
* @var
$this \yii\web\View
* @var
\yii\web\View $this
* @var
$content string
* @var
string $content
*/
*/
AppAsset
::
register
(
$this
);
AppAsset
::
register
(
$this
);
?>
?>
...
@@ -45,9 +45,9 @@ AppAsset::register($this);
...
@@ -45,9 +45,9 @@ AppAsset::register($this);
?>
?>
<div
class=
"container"
>
<div
class=
"container"
>
<?=
Breadcrumbs
::
widget
([
<?=
Breadcrumbs
::
widget
([
'links'
=>
isset
(
$this
->
params
[
'breadcrumbs'
])
?
$this
->
params
[
'breadcrumbs'
]
:
[],
'links'
=>
isset
(
$this
->
params
[
'breadcrumbs'
])
?
$this
->
params
[
'breadcrumbs'
]
:
[],
])
;
?>
])
?>
<?=
$content
?>
<?=
$content
?>
</div>
</div>
...
...
apps/advanced/frontend/views/emails/passwordResetToken.php
View file @
6066c29a
...
@@ -9,8 +9,8 @@ use yii\helpers\Html;
...
@@ -9,8 +9,8 @@ use yii\helpers\Html;
$resetLink
=
Yii
::
$app
->
urlManager
->
createAbsoluteUrl
(
'site/reset-password'
,
[
'token'
=>
$user
->
password_reset_token
]);
$resetLink
=
Yii
::
$app
->
urlManager
->
createAbsoluteUrl
(
'site/reset-password'
,
[
'token'
=>
$user
->
password_reset_token
]);
?>
?>
Hello
<?=
Html
::
encode
(
$user
->
username
)
?>
,
Hello
<?=
Html
::
encode
(
$user
->
username
)
?>
,
Follow the link below to reset your password:
Follow the link below to reset your password:
<?=
Html
::
a
(
Html
::
encode
(
$resetLink
),
$resetLink
)
?>
<?=
Html
::
a
(
Html
::
encode
(
$resetLink
),
$resetLink
)
?>
apps/advanced/frontend/views/layouts/main.php
View file @
6066c29a
<?php
<?php
use
frontend\config\AppAsset
;
use
yii\helpers\Html
;
use
yii\helpers\Html
;
use
yii\bootstrap\Nav
;
use
yii\bootstrap\Nav
;
use
yii\bootstrap\NavBar
;
use
yii\bootstrap\NavBar
;
use
yii\widgets\Breadcrumbs
;
use
yii\widgets\Breadcrumbs
;
use
frontend\config\AppAsset
;
use
frontend\widgets\Alert
;
use
frontend\widgets\Alert
;
/**
/**
* @var
$this \yii\web\View
* @var
\yii\web\View $this
* @var
$content string
* @var
string $content
*/
*/
AppAsset
::
register
(
$this
);
AppAsset
::
register
(
$this
);
?>
?>
...
@@ -49,10 +49,10 @@ AppAsset::register($this);
...
@@ -49,10 +49,10 @@ AppAsset::register($this);
?>
?>
<div
class=
"container"
>
<div
class=
"container"
>
<?=
Breadcrumbs
::
widget
([
<?=
Breadcrumbs
::
widget
([
'links'
=>
isset
(
$this
->
params
[
'breadcrumbs'
])
?
$this
->
params
[
'breadcrumbs'
]
:
[],
'links'
=>
isset
(
$this
->
params
[
'breadcrumbs'
])
?
$this
->
params
[
'breadcrumbs'
]
:
[],
])
;
?>
])
?>
<?=
Alert
::
widget
()
?>
<?=
Alert
::
widget
()
?>
<?=
$content
?>
<?=
$content
?>
</div>
</div>
...
...
apps/advanced/frontend/views/site/login.php
View file @
6066c29a
...
@@ -22,7 +22,7 @@ $this->params['breadcrumbs'][] = $this->title;
...
@@ -22,7 +22,7 @@ $this->params['breadcrumbs'][] = $this->title;
<?=
$form
->
field
(
$model
,
'password'
)
->
passwordInput
()
?>
<?=
$form
->
field
(
$model
,
'password'
)
->
passwordInput
()
?>
<?=
$form
->
field
(
$model
,
'rememberMe'
)
->
checkbox
()
?>
<?=
$form
->
field
(
$model
,
'rememberMe'
)
->
checkbox
()
?>
<div
style=
"color:#999;margin:1em 0"
>
<div
style=
"color:#999;margin:1em 0"
>
If you forgot your password you can
<?=
Html
::
a
(
'reset it'
,
[
'site/request-password-reset'
])
?>
.
If you forgot your password you can
<?=
Html
::
a
(
'reset it'
,
[
'site/request-password-reset'
])
?>
.
</div>
</div>
<div
class=
"form-group"
>
<div
class=
"form-group"
>
<?=
Html
::
submitButton
(
'Login'
,
[
'class'
=>
'btn btn-primary'
])
?>
<?=
Html
::
submitButton
(
'Login'
,
[
'class'
=>
'btn btn-primary'
])
?>
...
...
apps/basic/views/layouts/main.php
View file @
6066c29a
...
@@ -3,12 +3,13 @@ use yii\helpers\Html;
...
@@ -3,12 +3,13 @@ use yii\helpers\Html;
use
yii\bootstrap\Nav
;
use
yii\bootstrap\Nav
;
use
yii\bootstrap\NavBar
;
use
yii\bootstrap\NavBar
;
use
yii\widgets\Breadcrumbs
;
use
yii\widgets\Breadcrumbs
;
use
app\config\AppAsset
;
/**
/**
* @var
$this \yii\web\View
* @var
\yii\web\View $this
* @var
$content string
* @var
string $content
*/
*/
app\config\
AppAsset
::
register
(
$this
);
AppAsset
::
register
(
$this
);
?>
?>
<?php
$this
->
beginPage
();
?>
<?php
$this
->
beginPage
();
?>
<!DOCTYPE html>
<!DOCTYPE html>
...
@@ -36,7 +37,7 @@ app\config\AppAsset::register($this);
...
@@ -36,7 +37,7 @@ app\config\AppAsset::register($this);
[
'label'
=>
'Contact'
,
'url'
=>
[
'/site/contact'
]],
[
'label'
=>
'Contact'
,
'url'
=>
[
'/site/contact'
]],
Yii
::
$app
->
user
->
isGuest
?
Yii
::
$app
->
user
->
isGuest
?
[
'label'
=>
'Login'
,
'url'
=>
[
'/site/login'
]]
:
[
'label'
=>
'Login'
,
'url'
=>
[
'/site/login'
]]
:
[
'label'
=>
'Logout ('
.
Yii
::
$app
->
user
->
identity
->
username
.
')'
,
[
'label'
=>
'Logout ('
.
Yii
::
$app
->
user
->
identity
->
username
.
')'
,
'url'
=>
[
'/site/logout'
],
'url'
=>
[
'/site/logout'
],
'linkOptions'
=>
[
'data-method'
=>
'post'
]],
'linkOptions'
=>
[
'data-method'
=>
'post'
]],
],
],
...
@@ -45,9 +46,9 @@ app\config\AppAsset::register($this);
...
@@ -45,9 +46,9 @@ app\config\AppAsset::register($this);
?>
?>
<div
class=
"container"
>
<div
class=
"container"
>
<?=
Breadcrumbs
::
widget
([
<?=
Breadcrumbs
::
widget
([
'links'
=>
isset
(
$this
->
params
[
'breadcrumbs'
])
?
$this
->
params
[
'breadcrumbs'
]
:
[],
'links'
=>
isset
(
$this
->
params
[
'breadcrumbs'
])
?
$this
->
params
[
'breadcrumbs'
]
:
[],
])
;
?>
])
?>
<?=
$content
?>
<?=
$content
?>
</div>
</div>
...
...
extensions/gii/views/default/index.php
View file @
6066c29a
...
@@ -2,10 +2,10 @@
...
@@ -2,10 +2,10 @@
use
yii\helpers\Html
;
use
yii\helpers\Html
;
/**
/**
* @var
$this \yii\web\View
* @var
\yii\web\View $this
* @var
$content string
* @var
\yii\gii\Generator[] $generators
* @var
yii\gii\Generator[] $generators
* @var
\yii\gii\Generator $activeGenerator
* @var
yii\gii\Generator $activeGenerator
* @var
string $content
*/
*/
$generators
=
Yii
::
$app
->
controller
->
module
->
generators
;
$generators
=
Yii
::
$app
->
controller
->
module
->
generators
;
$activeGenerator
=
Yii
::
$app
->
controller
->
generator
;
$activeGenerator
=
Yii
::
$app
->
controller
->
generator
;
...
...
extensions/gii/views/default/view/files.php
View file @
6066c29a
...
@@ -4,8 +4,8 @@ use yii\helpers\Html;
...
@@ -4,8 +4,8 @@ use yii\helpers\Html;
use
yii\gii\CodeFile
;
use
yii\gii\CodeFile
;
/**
/**
* @var
$this \yii\web\View
* @var
\yii\web\View $this
* @var
$generator \yii\gii\G
enerator
* @var
\yii\gii\Generator $g
enerator
* @var CodeFile[] $files
* @var CodeFile[] $files
* @var array $answers
* @var array $answers
*/
*/
...
...
extensions/gii/views/layouts/generator.php
View file @
6066c29a
...
@@ -2,10 +2,10 @@
...
@@ -2,10 +2,10 @@
use
yii\helpers\Html
;
use
yii\helpers\Html
;
/**
/**
* @var
$this \yii\web\View
* @var
\yii\web\View $this
* @var
$content string
* @var
\yii\gii\Generator[] $generators
* @var
yii\gii\Generator[] $generators
* @var
\yii\gii\Generator $activeGenerator
* @var
yii\gii\Generator $activeGenerator
* @var
string $content
*/
*/
$generators
=
Yii
::
$app
->
controller
->
module
->
generators
;
$generators
=
Yii
::
$app
->
controller
->
module
->
generators
;
$activeGenerator
=
Yii
::
$app
->
controller
->
generator
;
$activeGenerator
=
Yii
::
$app
->
controller
->
generator
;
...
...
extensions/gii/views/layouts/main.php
View file @
6066c29a
...
@@ -4,8 +4,8 @@ use yii\bootstrap\Nav;
...
@@ -4,8 +4,8 @@ use yii\bootstrap\Nav;
use
yii\helpers\Html
;
use
yii\helpers\Html
;
/**
/**
* @var
$this \yii\web\View
* @var
\yii\web\View $this
* @var
$content string
* @var
string $content
*/
*/
$asset
=
yii\gii\GiiAsset
::
register
(
$this
);
$asset
=
yii\gii\GiiAsset
::
register
(
$this
);
?>
?>
...
...
extensions/swiftmailer/Message.php
View file @
6066c29a
...
@@ -192,7 +192,7 @@ class Message extends BaseMessage
...
@@ -192,7 +192,7 @@ class Message extends BaseMessage
$partFound
=
false
;
$partFound
=
false
;
foreach
(
$parts
as
$key
=>
$part
)
{
foreach
(
$parts
as
$key
=>
$part
)
{
if
(
!
(
$part
instanceof
\Swift_Mime_Attachment
))
{
if
(
!
(
$part
instanceof
\Swift_Mime_Attachment
))
{
/* @var
$part \Swift_Mime_MimeP
art */
/* @var
\Swift_Mime_MimePart $p
art */
if
(
$part
->
getContentType
()
==
$contentType
)
{
if
(
$part
->
getContentType
()
==
$contentType
)
{
unset
(
$parts
[
$key
]);
unset
(
$parts
[
$key
]);
$partFound
=
true
;
$partFound
=
true
;
...
...
framework/yii/BaseYii.php
View file @
6066c29a
...
@@ -367,7 +367,7 @@ class BaseYii
...
@@ -367,7 +367,7 @@ class BaseYii
}
}
if
((
$n
=
func_num_args
())
>
1
)
{
if
((
$n
=
func_num_args
())
>
1
)
{
/** @var
$reflection \ReflectionClass
*/
/** @var
\ReflectionClass $reflection
*/
if
(
isset
(
$reflections
[
$class
]))
{
if
(
isset
(
$reflections
[
$class
]))
{
$reflection
=
$reflections
[
$class
];
$reflection
=
$reflections
[
$class
];
}
else
{
}
else
{
...
...
framework/yii/base/Application.php
View file @
6066c29a
...
@@ -616,10 +616,8 @@ abstract class Application extends Module
...
@@ -616,10 +616,8 @@ abstract class Application extends Module
{
{
$category
=
get_class
(
$exception
);
$category
=
get_class
(
$exception
);
if
(
$exception
instanceof
HttpException
)
{
if
(
$exception
instanceof
HttpException
)
{
/** @var $exception HttpException */
$category
.=
'\\'
.
$exception
->
statusCode
;
$category
.=
'\\'
.
$exception
->
statusCode
;
}
elseif
(
$exception
instanceof
\ErrorException
)
{
}
elseif
(
$exception
instanceof
\ErrorException
)
{
/** @var $exception \ErrorException */
$category
.=
'\\'
.
$exception
->
getSeverity
();
$category
.=
'\\'
.
$exception
->
getSeverity
();
}
}
Yii
::
error
((
string
)
$exception
,
$category
);
Yii
::
error
((
string
)
$exception
,
$category
);
...
...
framework/yii/base/Model.php
View file @
6066c29a
...
@@ -349,7 +349,7 @@ class Model extends Component implements IteratorAggregate, ArrayAccess
...
@@ -349,7 +349,7 @@ class Model extends Component implements IteratorAggregate, ArrayAccess
* $model->validators[] = $newValidator;
* $model->validators[] = $newValidator;
* ~~~
* ~~~
*
*
* @return ArrayObject all the validators declared in the model.
* @return ArrayObject
|\yii\validators\Validator[]
all the validators declared in the model.
*/
*/
public
function
getValidators
()
public
function
getValidators
()
{
{
...
@@ -369,7 +369,6 @@ class Model extends Component implements IteratorAggregate, ArrayAccess
...
@@ -369,7 +369,6 @@ class Model extends Component implements IteratorAggregate, ArrayAccess
{
{
$validators
=
[];
$validators
=
[];
$scenario
=
$this
->
getScenario
();
$scenario
=
$this
->
getScenario
();
/** @var $validator Validator */
foreach
(
$this
->
getValidators
()
as
$validator
)
{
foreach
(
$this
->
getValidators
()
as
$validator
)
{
if
(
$validator
->
isActive
(
$scenario
)
&&
(
$attribute
===
null
||
in_array
(
$attribute
,
$validator
->
attributes
,
true
)))
{
if
(
$validator
->
isActive
(
$scenario
)
&&
(
$attribute
===
null
||
in_array
(
$attribute
,
$validator
->
attributes
,
true
)))
{
$validators
[]
=
$validator
;
$validators
[]
=
$validator
;
...
...
framework/yii/base/Module.php
View file @
6066c29a
...
@@ -578,7 +578,7 @@ abstract class Module extends Component
...
@@ -578,7 +578,7 @@ abstract class Module extends Component
{
{
$parts
=
$this
->
createController
(
$route
);
$parts
=
$this
->
createController
(
$route
);
if
(
is_array
(
$parts
))
{
if
(
is_array
(
$parts
))
{
/** @var
$controller C
ontroller */
/** @var
Controller $c
ontroller */
list
(
$controller
,
$actionID
)
=
$parts
;
list
(
$controller
,
$actionID
)
=
$parts
;
$oldController
=
Yii
::
$app
->
controller
;
$oldController
=
Yii
::
$app
->
controller
;
Yii
::
$app
->
controller
=
$controller
;
Yii
::
$app
->
controller
=
$controller
;
...
...
framework/yii/base/View.php
View file @
6066c29a
...
@@ -410,7 +410,7 @@ class View extends Component
...
@@ -410,7 +410,7 @@ class View extends Component
{
{
$properties
[
'id'
]
=
$id
;
$properties
[
'id'
]
=
$id
;
$properties
[
'view'
]
=
$this
;
$properties
[
'view'
]
=
$this
;
/** @var
$cache FragmentC
ache */
/** @var
FragmentCache $c
ache */
$cache
=
FragmentCache
::
begin
(
$properties
);
$cache
=
FragmentCache
::
begin
(
$properties
);
if
(
$cache
->
getCachedContent
()
!==
false
)
{
if
(
$cache
->
getCachedContent
()
!==
false
)
{
$this
->
endCache
();
$this
->
endCache
();
...
...
framework/yii/console/controllers/CacheController.php
View file @
6066c29a
...
@@ -52,7 +52,7 @@ class CacheController extends Controller
...
@@ -52,7 +52,7 @@ class CacheController extends Controller
*/
*/
public
function
actionFlush
(
$component
=
'cache'
)
public
function
actionFlush
(
$component
=
'cache'
)
{
{
/** @var
$cache C
ache */
/** @var
Cache $c
ache */
$cache
=
Yii
::
$app
->
getComponent
(
$component
);
$cache
=
Yii
::
$app
->
getComponent
(
$component
);
if
(
!
$cache
||
!
$cache
instanceof
Cache
)
{
if
(
!
$cache
||
!
$cache
instanceof
Cache
)
{
throw
new
Exception
(
'Application component "'
.
$component
.
'" is not defined or not a cache.'
);
throw
new
Exception
(
'Application component "'
.
$component
.
'" is not defined or not a cache.'
);
...
...
framework/yii/db/ActiveQuery.php
View file @
6066c29a
...
@@ -122,7 +122,7 @@ class ActiveQuery extends Query
...
@@ -122,7 +122,7 @@ class ActiveQuery extends Query
if
(
$this
->
asArray
)
{
if
(
$this
->
asArray
)
{
$model
=
$row
;
$model
=
$row
;
}
else
{
}
else
{
/** @var
$class ActiveRecord
*/
/** @var
ActiveRecord $class
*/
$class
=
$this
->
modelClass
;
$class
=
$this
->
modelClass
;
$model
=
$class
::
create
(
$row
);
$model
=
$class
::
create
(
$row
);
}
}
...
@@ -145,7 +145,7 @@ class ActiveQuery extends Query
...
@@ -145,7 +145,7 @@ class ActiveQuery extends Query
*/
*/
public
function
createCommand
(
$db
=
null
)
public
function
createCommand
(
$db
=
null
)
{
{
/** @var
$modelClass ActiveRecord
*/
/** @var
ActiveRecord $modelClass
*/
$modelClass
=
$this
->
modelClass
;
$modelClass
=
$this
->
modelClass
;
if
(
$db
===
null
)
{
if
(
$db
===
null
)
{
$db
=
$modelClass
::
getDb
();
$db
=
$modelClass
::
getDb
();
...
@@ -253,7 +253,7 @@ class ActiveQuery extends Query
...
@@ -253,7 +253,7 @@ class ActiveQuery extends Query
$models
[
$key
]
=
$row
;
$models
[
$key
]
=
$row
;
}
}
}
else
{
}
else
{
/** @var
$class ActiveRecord
*/
/** @var
ActiveRecord $class
*/
$class
=
$this
->
modelClass
;
$class
=
$this
->
modelClass
;
if
(
$this
->
indexBy
===
null
)
{
if
(
$this
->
indexBy
===
null
)
{
foreach
(
$rows
as
$row
)
{
foreach
(
$rows
as
$row
)
{
...
...
framework/yii/db/ActiveRecord.php
View file @
6066c29a
...
@@ -1321,9 +1321,9 @@ class ActiveRecord extends Model
...
@@ -1321,9 +1321,9 @@ class ActiveRecord extends Model
throw
new
InvalidCallException
(
'Unable to link models: both models must NOT be newly created.'
);
throw
new
InvalidCallException
(
'Unable to link models: both models must NOT be newly created.'
);
}
}
if
(
is_array
(
$relation
->
via
))
{
if
(
is_array
(
$relation
->
via
))
{
/** @var
$viaRelation Active
Relation */
/** @var
ActiveRelation $via
Relation */
list
(
$viaName
,
$viaRelation
)
=
$relation
->
via
;
list
(
$viaName
,
$viaRelation
)
=
$relation
->
via
;
/** @var
$viaClass ActiveRecord
*/
/** @var
ActiveRecord $viaClass
*/
$viaClass
=
$viaRelation
->
modelClass
;
$viaClass
=
$viaRelation
->
modelClass
;
$viaTable
=
$viaClass
::
tableName
();
$viaTable
=
$viaClass
::
tableName
();
// unset $viaName so that it can be reloaded to reflect the change
// unset $viaName so that it can be reloaded to reflect the change
...
@@ -1396,9 +1396,9 @@ class ActiveRecord extends Model
...
@@ -1396,9 +1396,9 @@ class ActiveRecord extends Model
if
(
$relation
->
via
!==
null
)
{
if
(
$relation
->
via
!==
null
)
{
if
(
is_array
(
$relation
->
via
))
{
if
(
is_array
(
$relation
->
via
))
{
/** @var
$viaRelation Active
Relation */
/** @var
ActiveRelation $via
Relation */
list
(
$viaName
,
$viaRelation
)
=
$relation
->
via
;
list
(
$viaName
,
$viaRelation
)
=
$relation
->
via
;
/** @var
$viaClass ActiveRecord
*/
/** @var
ActiveRecord $viaClass
*/
$viaClass
=
$viaRelation
->
modelClass
;
$viaClass
=
$viaRelation
->
modelClass
;
$viaTable
=
$viaClass
::
tableName
();
$viaTable
=
$viaClass
::
tableName
();
unset
(
$this
->
_related
[
$viaName
]);
unset
(
$this
->
_related
[
$viaName
]);
...
@@ -1444,7 +1444,7 @@ class ActiveRecord extends Model
...
@@ -1444,7 +1444,7 @@ class ActiveRecord extends Model
if
(
!
$relation
->
multiple
)
{
if
(
!
$relation
->
multiple
)
{
unset
(
$this
->
_related
[
$name
]);
unset
(
$this
->
_related
[
$name
]);
}
elseif
(
isset
(
$this
->
_related
[
$name
]))
{
}
elseif
(
isset
(
$this
->
_related
[
$name
]))
{
/** @var
$b ActiveRecord
*/
/** @var
ActiveRecord $b
*/
foreach
(
$this
->
_related
[
$name
]
as
$a
=>
$b
)
{
foreach
(
$this
->
_related
[
$name
]
as
$a
=>
$b
)
{
if
(
$model
->
getPrimaryKey
()
==
$b
->
getPrimaryKey
())
{
if
(
$model
->
getPrimaryKey
()
==
$b
->
getPrimaryKey
())
{
unset
(
$this
->
_related
[
$name
][
$a
]);
unset
(
$this
->
_related
[
$name
][
$a
]);
...
...
framework/yii/db/ActiveRelation.php
View file @
6066c29a
...
@@ -120,7 +120,7 @@ class ActiveRelation extends ActiveQuery
...
@@ -120,7 +120,7 @@ class ActiveRelation extends ActiveQuery
$this
->
filterByModels
(
$viaModels
);
$this
->
filterByModels
(
$viaModels
);
}
elseif
(
is_array
(
$this
->
via
))
{
}
elseif
(
is_array
(
$this
->
via
))
{
// via relation
// via relation
/** @var
$viaQuery ActiveRelation
*/
/** @var
ActiveRelation $viaQuery
*/
list
(
$viaName
,
$viaQuery
)
=
$this
->
via
;
list
(
$viaName
,
$viaQuery
)
=
$this
->
via
;
if
(
$viaQuery
->
multiple
)
{
if
(
$viaQuery
->
multiple
)
{
$viaModels
=
$viaQuery
->
all
();
$viaModels
=
$viaQuery
->
all
();
...
@@ -154,13 +154,13 @@ class ActiveRelation extends ActiveQuery
...
@@ -154,13 +154,13 @@ class ActiveRelation extends ActiveQuery
if
(
$this
->
via
instanceof
self
)
{
if
(
$this
->
via
instanceof
self
)
{
// via pivot table
// via pivot table
/** @var
$viaQuery ActiveRelation
*/
/** @var
ActiveRelation $viaQuery
*/
$viaQuery
=
$this
->
via
;
$viaQuery
=
$this
->
via
;
$viaModels
=
$viaQuery
->
findPivotRows
(
$primaryModels
);
$viaModels
=
$viaQuery
->
findPivotRows
(
$primaryModels
);
$this
->
filterByModels
(
$viaModels
);
$this
->
filterByModels
(
$viaModels
);
}
elseif
(
is_array
(
$this
->
via
))
{
}
elseif
(
is_array
(
$this
->
via
))
{
// via relation
// via relation
/** @var
$viaQuery ActiveRelation
*/
/** @var
ActiveRelation $viaQuery
*/
list
(
$viaName
,
$viaQuery
)
=
$this
->
via
;
list
(
$viaName
,
$viaQuery
)
=
$this
->
via
;
$viaQuery
->
primaryModel
=
null
;
$viaQuery
->
primaryModel
=
null
;
$viaModels
=
$viaQuery
->
findWith
(
$viaName
,
$primaryModels
);
$viaModels
=
$viaQuery
->
findWith
(
$viaName
,
$primaryModels
);
...
@@ -306,7 +306,7 @@ class ActiveRelation extends ActiveQuery
...
@@ -306,7 +306,7 @@ class ActiveRelation extends ActiveQuery
return
[];
return
[];
}
}
$this
->
filterByModels
(
$primaryModels
);
$this
->
filterByModels
(
$primaryModels
);
/** @var
$primaryModel ActiveRecord
*/
/** @var
ActiveRecord $primaryModel
*/
$primaryModel
=
reset
(
$primaryModels
);
$primaryModel
=
reset
(
$primaryModels
);
$db
=
$primaryModel
->
getDb
();
$db
=
$primaryModel
->
getDb
();
list
(
$sql
,
$params
)
=
$db
->
getQueryBuilder
()
->
build
(
$this
);
list
(
$sql
,
$params
)
=
$db
->
getQueryBuilder
()
->
build
(
$this
);
...
...
framework/yii/db/Command.php
View file @
6066c29a
...
@@ -366,7 +366,7 @@ class Command extends \yii\base\Component
...
@@ -366,7 +366,7 @@ class Command extends \yii\base\Component
Yii
::
info
(
$rawSql
,
__METHOD__
);
Yii
::
info
(
$rawSql
,
__METHOD__
);
/** @var
$cache \yii\caching\C
ache */
/** @var
\yii\caching\Cache $c
ache */
if
(
$db
->
enableQueryCache
&&
$method
!==
''
)
{
if
(
$db
->
enableQueryCache
&&
$method
!==
''
)
{
$cache
=
is_string
(
$db
->
queryCache
)
?
Yii
::
$app
->
getComponent
(
$db
->
queryCache
)
:
$db
->
queryCache
;
$cache
=
is_string
(
$db
->
queryCache
)
?
Yii
::
$app
->
getComponent
(
$db
->
queryCache
)
:
$db
->
queryCache
;
}
}
...
...
framework/yii/db/Schema.php
View file @
6066c29a
...
@@ -92,7 +92,7 @@ abstract class Schema extends Object
...
@@ -92,7 +92,7 @@ abstract class Schema extends Object
$realName
=
$this
->
getRawTableName
(
$name
);
$realName
=
$this
->
getRawTableName
(
$name
);
if
(
$db
->
enableSchemaCache
&&
!
in_array
(
$name
,
$db
->
schemaCacheExclude
,
true
))
{
if
(
$db
->
enableSchemaCache
&&
!
in_array
(
$name
,
$db
->
schemaCacheExclude
,
true
))
{
/** @var
$cache C
ache */
/** @var
Cache $c
ache */
$cache
=
is_string
(
$db
->
schemaCache
)
?
Yii
::
$app
->
getComponent
(
$db
->
schemaCache
)
:
$db
->
schemaCache
;
$cache
=
is_string
(
$db
->
schemaCache
)
?
Yii
::
$app
->
getComponent
(
$db
->
schemaCache
)
:
$db
->
schemaCache
;
if
(
$cache
instanceof
Cache
)
{
if
(
$cache
instanceof
Cache
)
{
$key
=
$this
->
getCacheKey
(
$name
);
$key
=
$this
->
getCacheKey
(
$name
);
...
@@ -215,7 +215,7 @@ abstract class Schema extends Object
...
@@ -215,7 +215,7 @@ abstract class Schema extends Object
*/
*/
public
function
refresh
()
public
function
refresh
()
{
{
/** @var
$cache C
ache */
/** @var
Cache $c
ache */
$cache
=
is_string
(
$this
->
db
->
schemaCache
)
?
Yii
::
$app
->
getComponent
(
$this
->
db
->
schemaCache
)
:
$this
->
db
->
schemaCache
;
$cache
=
is_string
(
$this
->
db
->
schemaCache
)
?
Yii
::
$app
->
getComponent
(
$this
->
db
->
schemaCache
)
:
$this
->
db
->
schemaCache
;
if
(
$this
->
db
->
enableSchemaCache
&&
$cache
instanceof
Cache
)
{
if
(
$this
->
db
->
enableSchemaCache
&&
$cache
instanceof
Cache
)
{
GroupDependency
::
invalidate
(
$cache
,
$this
->
getCacheGroup
());
GroupDependency
::
invalidate
(
$cache
,
$this
->
getCacheGroup
());
...
...
framework/yii/log/Target.php
View file @
6066c29a
...
@@ -112,7 +112,7 @@ abstract class Target extends Component
...
@@ -112,7 +112,7 @@ abstract class Target extends Component
{
{
$context
=
[];
$context
=
[];
if
(
$this
->
logUser
&&
(
$user
=
Yii
::
$app
->
getComponent
(
'user'
,
false
))
!==
null
)
{
if
(
$this
->
logUser
&&
(
$user
=
Yii
::
$app
->
getComponent
(
'user'
,
false
))
!==
null
)
{
/** @var
$user \yii\web\U
ser */
/** @var
\yii\web\User $u
ser */
$context
[]
=
'User: '
.
$user
->
getId
();
$context
[]
=
'User: '
.
$user
->
getId
();
}
}
...
...
framework/yii/rbac/PhpManager.php
View file @
6066c29a
...
@@ -74,7 +74,7 @@ class PhpManager extends Manager
...
@@ -74,7 +74,7 @@ class PhpManager extends Manager
if
(
!
isset
(
$this
->
_items
[
$itemName
]))
{
if
(
!
isset
(
$this
->
_items
[
$itemName
]))
{
return
false
;
return
false
;
}
}
/** @var
$item I
tem */
/** @var
Item $i
tem */
$item
=
$this
->
_items
[
$itemName
];
$item
=
$this
->
_items
[
$itemName
];
Yii
::
trace
(
'Checking permission: '
.
$item
->
getName
(),
__METHOD__
);
Yii
::
trace
(
'Checking permission: '
.
$item
->
getName
(),
__METHOD__
);
if
(
!
isset
(
$params
[
'userId'
]))
{
if
(
!
isset
(
$params
[
'userId'
]))
{
...
@@ -85,7 +85,7 @@ class PhpManager extends Manager
...
@@ -85,7 +85,7 @@ class PhpManager extends Manager
return
true
;
return
true
;
}
}
if
(
isset
(
$this
->
_assignments
[
$userId
][
$itemName
]))
{
if
(
isset
(
$this
->
_assignments
[
$userId
][
$itemName
]))
{
/** @var
$assignment A
ssignment */
/** @var
Assignment $a
ssignment */
$assignment
=
$this
->
_assignments
[
$userId
][
$itemName
];
$assignment
=
$this
->
_assignments
[
$userId
][
$itemName
];
if
(
$this
->
executeBizRule
(
$assignment
->
bizRule
,
$params
,
$assignment
->
data
))
{
if
(
$this
->
executeBizRule
(
$assignment
->
bizRule
,
$params
,
$assignment
->
data
))
{
return
true
;
return
true
;
...
@@ -113,9 +113,9 @@ class PhpManager extends Manager
...
@@ -113,9 +113,9 @@ class PhpManager extends Manager
if
(
!
isset
(
$this
->
_items
[
$childName
],
$this
->
_items
[
$itemName
]))
{
if
(
!
isset
(
$this
->
_items
[
$childName
],
$this
->
_items
[
$itemName
]))
{
throw
new
Exception
(
"Either '
$itemName
' or '
$childName
' does not exist."
);
throw
new
Exception
(
"Either '
$itemName
' or '
$childName
' does not exist."
);
}
}
/** @var
$child Item
*/
/** @var
Item $child
*/
$child
=
$this
->
_items
[
$childName
];
$child
=
$this
->
_items
[
$childName
];
/** @var
$item I
tem */
/** @var
Item $i
tem */
$item
=
$this
->
_items
[
$itemName
];
$item
=
$this
->
_items
[
$itemName
];
$this
->
checkItemChildType
(
$item
->
type
,
$child
->
type
);
$this
->
checkItemChildType
(
$item
->
type
,
$child
->
type
);
if
(
$this
->
detectLoop
(
$itemName
,
$childName
))
{
if
(
$this
->
detectLoop
(
$itemName
,
$childName
))
{
...
@@ -270,14 +270,14 @@ class PhpManager extends Manager
...
@@ -270,14 +270,14 @@ class PhpManager extends Manager
$items
=
[];
$items
=
[];
if
(
$userId
===
null
)
{
if
(
$userId
===
null
)
{
foreach
(
$this
->
_items
as
$name
=>
$item
)
{
foreach
(
$this
->
_items
as
$name
=>
$item
)
{
/** @var
$item I
tem */
/** @var
Item $i
tem */
if
(
$item
->
type
==
$type
)
{
if
(
$item
->
type
==
$type
)
{
$items
[
$name
]
=
$item
;
$items
[
$name
]
=
$item
;
}
}
}
}
}
elseif
(
isset
(
$this
->
_assignments
[
$userId
]))
{
}
elseif
(
isset
(
$this
->
_assignments
[
$userId
]))
{
foreach
(
$this
->
_assignments
[
$userId
]
as
$assignment
)
{
foreach
(
$this
->
_assignments
[
$userId
]
as
$assignment
)
{
/** @var
$assignment A
ssignment */
/** @var
Assignment $a
ssignment */
$name
=
$assignment
->
itemName
;
$name
=
$assignment
->
itemName
;
if
(
isset
(
$this
->
_items
[
$name
])
&&
(
$type
===
null
||
$this
->
_items
[
$name
]
->
type
==
$type
))
{
if
(
isset
(
$this
->
_items
[
$name
])
&&
(
$type
===
null
||
$this
->
_items
[
$name
]
->
type
==
$type
))
{
$items
[
$name
]
=
$this
->
_items
[
$name
];
$items
[
$name
]
=
$this
->
_items
[
$name
];
...
@@ -400,7 +400,7 @@ class PhpManager extends Manager
...
@@ -400,7 +400,7 @@ class PhpManager extends Manager
{
{
$items
=
[];
$items
=
[];
foreach
(
$this
->
_items
as
$name
=>
$item
)
{
foreach
(
$this
->
_items
as
$name
=>
$item
)
{
/** @var
$item I
tem */
/** @var
Item $i
tem */
$items
[
$name
]
=
[
$items
[
$name
]
=
[
'type'
=>
$item
->
type
,
'type'
=>
$item
->
type
,
'description'
=>
$item
->
description
,
'description'
=>
$item
->
description
,
...
@@ -409,7 +409,7 @@ class PhpManager extends Manager
...
@@ -409,7 +409,7 @@ class PhpManager extends Manager
];
];
if
(
isset
(
$this
->
_children
[
$name
]))
{
if
(
isset
(
$this
->
_children
[
$name
]))
{
foreach
(
$this
->
_children
[
$name
]
as
$child
)
{
foreach
(
$this
->
_children
[
$name
]
as
$child
)
{
/** @var
$child Item
*/
/** @var
Item $child
*/
$items
[
$name
][
'children'
][]
=
$child
->
getName
();
$items
[
$name
][
'children'
][]
=
$child
->
getName
();
}
}
}
}
...
@@ -417,7 +417,7 @@ class PhpManager extends Manager
...
@@ -417,7 +417,7 @@ class PhpManager extends Manager
foreach
(
$this
->
_assignments
as
$userId
=>
$assignments
)
{
foreach
(
$this
->
_assignments
as
$userId
=>
$assignments
)
{
foreach
(
$assignments
as
$name
=>
$assignment
)
{
foreach
(
$assignments
as
$name
=>
$assignment
)
{
/** @var
$assignment A
ssignment */
/** @var
Assignment $a
ssignment */
if
(
isset
(
$items
[
$name
]))
{
if
(
isset
(
$items
[
$name
]))
{
$items
[
$name
][
'assignments'
][
$userId
]
=
[
$items
[
$name
][
'assignments'
][
$userId
]
=
[
'bizRule'
=>
$assignment
->
bizRule
,
'bizRule'
=>
$assignment
->
bizRule
,
...
@@ -505,7 +505,7 @@ class PhpManager extends Manager
...
@@ -505,7 +505,7 @@ class PhpManager extends Manager
return
false
;
return
false
;
}
}
foreach
(
$this
->
_children
[
$childName
]
as
$child
)
{
foreach
(
$this
->
_children
[
$childName
]
as
$child
)
{
/** @var
$child Item
*/
/** @var
Item $child
*/
if
(
$this
->
detectLoop
(
$itemName
,
$child
->
getName
()))
{
if
(
$this
->
detectLoop
(
$itemName
,
$child
->
getName
()))
{
return
true
;
return
true
;
}
}
...
...
framework/yii/requirements/requirements.php
View file @
6066c29a
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
* These are the Yii core requirements for the [[YiiRequirementChecker]] instance.
* These are the Yii core requirements for the [[YiiRequirementChecker]] instance.
* These requirements are mandatory for any Yii application.
* These requirements are mandatory for any Yii application.
*
*
* @var
$this YiiRequirementChecker
* @var
YiiRequirementChecker $this
*/
*/
return
array
(
return
array
(
array
(
array
(
...
...
framework/yii/requirements/views/console/index.php
View file @
6066c29a
<?php
<?php
/* @var
$this YiiRequirementChecker
*/
/* @var
YiiRequirementChecker $this
*/
/* @var
$summary arra
y */
/* @var
array $summar
y */
/* @var
$requirements array[]
*/
/* @var
array[] $requirements
*/
echo
"
\n
Yii Application Requirement Checker
\n\n
"
;
echo
"
\n
Yii Application Requirement Checker
\n\n
"
;
...
...
framework/yii/requirements/views/web/index.php
View file @
6066c29a
<?php
<?php
/* @var
$this YiiRequirementChecker
*/
/* @var
YiiRequirementChecker $this
*/
/* @var
$summary arra
y */
/* @var
array $summar
y */
/* @var
$requirements array[]
*/
/* @var
array[] $requirements
*/
?>
?>
<!DOCTYPE html>
<!DOCTYPE html>
<html
lang=
"en"
>
<html
lang=
"en"
>
...
...
framework/yii/validators/ExistValidator.php
View file @
6066c29a
...
@@ -65,7 +65,7 @@ class ExistValidator extends Validator
...
@@ -65,7 +65,7 @@ class ExistValidator extends Validator
return
;
return
;
}
}
/** @var
$className \yii\db\ActiveRecord
*/
/** @var
\yii\db\ActiveRecord $className
*/
$className
=
$this
->
className
===
null
?
get_class
(
$object
)
:
$this
->
className
;
$className
=
$this
->
className
===
null
?
get_class
(
$object
)
:
$this
->
className
;
$attributeName
=
$this
->
attributeName
===
null
?
$attribute
:
$this
->
attributeName
;
$attributeName
=
$this
->
attributeName
===
null
?
$attribute
:
$this
->
attributeName
;
$query
=
$className
::
find
();
$query
=
$className
::
find
();
...
@@ -92,7 +92,7 @@ class ExistValidator extends Validator
...
@@ -92,7 +92,7 @@ class ExistValidator extends Validator
if
(
$this
->
attributeName
===
null
)
{
if
(
$this
->
attributeName
===
null
)
{
throw
new
InvalidConfigException
(
'The "attributeName" property must be set.'
);
throw
new
InvalidConfigException
(
'The "attributeName" property must be set.'
);
}
}
/** @var
$className \yii\db\ActiveRecord
*/
/** @var
\yii\db\ActiveRecord $className
*/
$className
=
$this
->
className
;
$className
=
$this
->
className
;
$query
=
$className
::
find
();
$query
=
$className
::
find
();
$query
->
where
([
$this
->
attributeName
=>
$value
]);
$query
->
where
([
$this
->
attributeName
=>
$value
]);
...
...
framework/yii/validators/UniqueValidator.php
View file @
6066c29a
...
@@ -60,7 +60,7 @@ class UniqueValidator extends Validator
...
@@ -60,7 +60,7 @@ class UniqueValidator extends Validator
return
;
return
;
}
}
/** @var
$className \yii\db\ActiveRecord
*/
/** @var
\yii\db\ActiveRecord $className
*/
$className
=
$this
->
className
===
null
?
get_class
(
$object
)
:
$this
->
className
;
$className
=
$this
->
className
===
null
?
get_class
(
$object
)
:
$this
->
className
;
$attributeName
=
$this
->
attributeName
===
null
?
$attribute
:
$this
->
attributeName
;
$attributeName
=
$this
->
attributeName
===
null
?
$attribute
:
$this
->
attributeName
;
...
...
framework/yii/web/AccessControl.php
View file @
6066c29a
...
@@ -102,7 +102,7 @@ class AccessControl extends ActionFilter
...
@@ -102,7 +102,7 @@ class AccessControl extends ActionFilter
{
{
$user
=
Yii
::
$app
->
getUser
();
$user
=
Yii
::
$app
->
getUser
();
$request
=
Yii
::
$app
->
getRequest
();
$request
=
Yii
::
$app
->
getRequest
();
/** @var
$rule AccessR
ule */
/** @var
AccessRule $r
ule */
foreach
(
$this
->
rules
as
$rule
)
{
foreach
(
$this
->
rules
as
$rule
)
{
if
(
$allow
=
$rule
->
allows
(
$action
,
$user
,
$request
))
{
if
(
$allow
=
$rule
->
allows
(
$action
,
$user
,
$request
))
{
return
true
;
return
true
;
...
...
framework/yii/web/UrlManager.php
View file @
6066c29a
...
@@ -169,7 +169,7 @@ class UrlManager extends Component
...
@@ -169,7 +169,7 @@ class UrlManager extends Component
{
{
if
(
$this
->
enablePrettyUrl
)
{
if
(
$this
->
enablePrettyUrl
)
{
$pathInfo
=
$request
->
getPathInfo
();
$pathInfo
=
$request
->
getPathInfo
();
/** @var
$rule UrlR
ule */
/** @var
UrlRule $r
ule */
foreach
(
$this
->
rules
as
$rule
)
{
foreach
(
$this
->
rules
as
$rule
)
{
if
((
$result
=
$rule
->
parseRequest
(
$this
,
$request
))
!==
false
)
{
if
((
$result
=
$rule
->
parseRequest
(
$this
,
$request
))
!==
false
)
{
Yii
::
trace
(
"Request parsed with URL rule:
{
$rule
->
name
}
"
,
__METHOD__
);
Yii
::
trace
(
"Request parsed with URL rule:
{
$rule
->
name
}
"
,
__METHOD__
);
...
@@ -224,7 +224,7 @@ class UrlManager extends Component
...
@@ -224,7 +224,7 @@ class UrlManager extends Component
$baseUrl
=
$this
->
getBaseUrl
();
$baseUrl
=
$this
->
getBaseUrl
();
if
(
$this
->
enablePrettyUrl
)
{
if
(
$this
->
enablePrettyUrl
)
{
/** @var
$rule UrlR
ule */
/** @var
UrlRule $r
ule */
foreach
(
$this
->
rules
as
$rule
)
{
foreach
(
$this
->
rules
as
$rule
)
{
if
((
$url
=
$rule
->
createUrl
(
$this
,
$route
,
$params
))
!==
false
)
{
if
((
$url
=
$rule
->
createUrl
(
$this
,
$route
,
$params
))
!==
false
)
{
if
(
$rule
->
host
!==
null
)
{
if
(
$rule
->
host
!==
null
)
{
...
@@ -282,7 +282,7 @@ class UrlManager extends Component
...
@@ -282,7 +282,7 @@ class UrlManager extends Component
public
function
getBaseUrl
()
public
function
getBaseUrl
()
{
{
if
(
$this
->
_baseUrl
===
null
)
{
if
(
$this
->
_baseUrl
===
null
)
{
/** @var
$request \yii\web\R
equest */
/** @var
\yii\web\Request $r
equest */
$request
=
Yii
::
$app
->
getRequest
();
$request
=
Yii
::
$app
->
getRequest
();
$this
->
_baseUrl
=
$this
->
showScriptName
||
!
$this
->
enablePrettyUrl
?
$request
->
getScriptUrl
()
:
$request
->
getBaseUrl
();
$this
->
_baseUrl
=
$this
->
showScriptName
||
!
$this
->
enablePrettyUrl
?
$request
->
getScriptUrl
()
:
$request
->
getBaseUrl
();
}
}
...
...
framework/yii/web/User.php
View file @
6066c29a
...
@@ -139,7 +139,7 @@ class User extends Component
...
@@ -139,7 +139,7 @@ class User extends Component
if
(
$id
===
null
)
{
if
(
$id
===
null
)
{
$this
->
_identity
=
null
;
$this
->
_identity
=
null
;
}
else
{
}
else
{
/** @var
$class IdentityInterface
*/
/** @var
IdentityInterface $class
*/
$class
=
$this
->
identityClass
;
$class
=
$this
->
identityClass
;
$this
->
_identity
=
$class
::
findIdentity
(
$id
);
$this
->
_identity
=
$class
::
findIdentity
(
$id
);
}
}
...
@@ -202,7 +202,7 @@ class User extends Component
...
@@ -202,7 +202,7 @@ class User extends Component
$data
=
json_decode
(
$value
,
true
);
$data
=
json_decode
(
$value
,
true
);
if
(
count
(
$data
)
===
3
&&
isset
(
$data
[
0
],
$data
[
1
],
$data
[
2
]))
{
if
(
count
(
$data
)
===
3
&&
isset
(
$data
[
0
],
$data
[
1
],
$data
[
2
]))
{
list
(
$id
,
$authKey
,
$duration
)
=
$data
;
list
(
$id
,
$authKey
,
$duration
)
=
$data
;
/** @var
$class IdentityInterface
*/
/** @var
IdentityInterface $class
*/
$class
=
$this
->
identityClass
;
$class
=
$this
->
identityClass
;
$identity
=
$class
::
findIdentity
(
$id
);
$identity
=
$class
::
findIdentity
(
$id
);
if
(
$identity
!==
null
&&
$identity
->
validateAuthKey
(
$authKey
))
{
if
(
$identity
!==
null
&&
$identity
->
validateAuthKey
(
$authKey
))
{
...
...
framework/yii/widgets/ActiveForm.php
View file @
6066c29a
...
@@ -220,7 +220,7 @@ class ActiveForm extends Widget
...
@@ -220,7 +220,7 @@ class ActiveForm extends Widget
$lines
=
[];
$lines
=
[];
foreach
(
$models
as
$model
)
{
foreach
(
$models
as
$model
)
{
/** @var
$model M
odel */
/** @var
Model $m
odel */
foreach
(
$model
->
getFirstErrors
()
as
$error
)
{
foreach
(
$model
->
getFirstErrors
()
as
$error
)
{
$lines
[]
=
Html
::
encode
(
$error
);
$lines
[]
=
Html
::
encode
(
$error
);
}
}
...
...
tests/unit/data/views/layout.php
View file @
6066c29a
<?php
<?php
/**
/**
* @var
$this \yii\web\View
* @var
\yii\web\View $this
* @var
$content string
* @var
string $content
*/
*/
?>
?>
<?php
$this
->
beginPage
();
?>
<?php
$this
->
beginPage
();
?>
...
@@ -19,4 +19,4 @@
...
@@ -19,4 +19,4 @@
<?php
$this
->
endBody
();
?>
<?php
$this
->
endBody
();
?>
</body>
</body>
</html>
</html>
<?php
$this
->
endPage
();
?>
<?php
$this
->
endPage
();
?>
\ No newline at end of file
tests/unit/data/views/rawlayout.php
View file @
6066c29a
<?php
<?php
/**
/**
* @var
$this \yii\web\View
* @var
\yii\web\View $this
*/
*/
?><?php
$this
->
beginPage
();
?>
1
<?php
$this
->
head
();
?>
2
<?php
$this
->
beginBody
();
?>
3
<?php
$this
->
endBody
();
?>
4
<?php
$this
->
endPage
();
?>
?><?php
$this
->
beginPage
();
?>
1
<?php
$this
->
head
();
?>
2
<?php
$this
->
beginBody
();
?>
3
<?php
$this
->
endBody
();
?>
4
<?php
$this
->
endPage
();
?>
\ No newline at end of file
tests/unit/extensions/swiftmailer/MessageTest.php
View file @
6066c29a
...
@@ -306,7 +306,7 @@ class MessageTest extends VendorTestCase
...
@@ -306,7 +306,7 @@ class MessageTest extends VendorTestCase
$htmlPresent
=
false
;
$htmlPresent
=
false
;
foreach
(
$messageParts
as
$part
)
{
foreach
(
$messageParts
as
$part
)
{
if
(
!
(
$part
instanceof
\Swift_Mime_Attachment
))
{
if
(
!
(
$part
instanceof
\Swift_Mime_Attachment
))
{
/* @var
$part \Swift_Mime_MimeP
art */
/* @var
\Swift_Mime_MimePart $p
art */
if
(
$part
->
getContentType
()
==
'text/plain'
)
{
if
(
$part
->
getContentType
()
==
'text/plain'
)
{
$textPresent
=
true
;
$textPresent
=
true
;
}
}
...
...
tests/unit/framework/db/ActiveRecordTest.php
View file @
6066c29a
...
@@ -117,7 +117,7 @@ class ActiveRecordTest extends DatabaseTestCase
...
@@ -117,7 +117,7 @@ class ActiveRecordTest extends DatabaseTestCase
public
function
testFindLazy
()
public
function
testFindLazy
()
{
{
/** @var
$customer C
ustomer */
/** @var
Customer $c
ustomer */
$customer
=
Customer
::
find
(
2
);
$customer
=
Customer
::
find
(
2
);
$orders
=
$customer
->
orders
;
$orders
=
$customer
->
orders
;
$this
->
assertEquals
(
2
,
count
(
$orders
));
$this
->
assertEquals
(
2
,
count
(
$orders
));
...
@@ -137,7 +137,7 @@ class ActiveRecordTest extends DatabaseTestCase
...
@@ -137,7 +137,7 @@ class ActiveRecordTest extends DatabaseTestCase
public
function
testFindLazyVia
()
public
function
testFindLazyVia
()
{
{
/** @var
$order O
rder */
/** @var
Order $o
rder */
$order
=
Order
::
find
(
1
);
$order
=
Order
::
find
(
1
);
$this
->
assertEquals
(
1
,
$order
->
id
);
$this
->
assertEquals
(
1
,
$order
->
id
);
$this
->
assertEquals
(
2
,
count
(
$order
->
items
));
$this
->
assertEquals
(
2
,
count
(
$order
->
items
));
...
@@ -162,7 +162,7 @@ class ActiveRecordTest extends DatabaseTestCase
...
@@ -162,7 +162,7 @@ class ActiveRecordTest extends DatabaseTestCase
public
function
testFindLazyViaTable
()
public
function
testFindLazyViaTable
()
{
{
/** @var
$order O
rder */
/** @var
Order $o
rder */
$order
=
Order
::
find
(
1
);
$order
=
Order
::
find
(
1
);
$this
->
assertEquals
(
1
,
$order
->
id
);
$this
->
assertEquals
(
1
,
$order
->
id
);
$this
->
assertEquals
(
2
,
count
(
$order
->
books
));
$this
->
assertEquals
(
2
,
count
(
$order
->
books
));
...
...
tests/unit/framework/validators/ValidatorTest.php
View file @
6066c29a
...
@@ -30,7 +30,7 @@ class ValidatorTest extends TestCase
...
@@ -30,7 +30,7 @@ class ValidatorTest extends TestCase
public
function
testCreateValidator
()
public
function
testCreateValidator
()
{
{
$model
=
FakedValidationModel
::
createWithAttributes
([
'attr_test1'
=>
'abc'
,
'attr_test2'
=>
'2013'
]);
$model
=
FakedValidationModel
::
createWithAttributes
([
'attr_test1'
=>
'abc'
,
'attr_test2'
=>
'2013'
]);
/** @var
$numberVal NumberValidator
*/
/** @var
NumberValidator $numberVal
*/
$numberVal
=
TestValidator
::
createValidator
(
'number'
,
$model
,
[
'attr_test1'
]);
$numberVal
=
TestValidator
::
createValidator
(
'number'
,
$model
,
[
'attr_test1'
]);
$this
->
assertInstanceOf
(
NumberValidator
::
className
(),
$numberVal
);
$this
->
assertInstanceOf
(
NumberValidator
::
className
(),
$numberVal
);
$numberVal
=
TestValidator
::
createValidator
(
'integer'
,
$model
,
[
'attr_test2'
]);
$numberVal
=
TestValidator
::
createValidator
(
'integer'
,
$model
,
[
'attr_test2'
]);
...
@@ -229,4 +229,4 @@ class ValidatorTest extends TestCase
...
@@ -229,4 +229,4 @@ class ValidatorTest extends TestCase
$errors
=
$m
->
getErrors
(
'attr_msg_val'
);
$errors
=
$m
->
getErrors
(
'attr_msg_val'
);
$this
->
assertEquals
(
'attr_msg_val::abc::param_value'
,
$errors
[
0
]);
$this
->
assertEquals
(
'attr_msg_val::abc::param_value'
,
$errors
[
0
]);
}
}
}
}
\ No newline at end of file
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