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
0edd8bc6
Commit
0edd8bc6
authored
Jul 25, 2014
by
Alexander Makarov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed missing and incorrect phpdoc
parent
d8c2f05d
Show whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
105 additions
and
4 deletions
+105
-4
Application.php
framework/base/Application.php
+1
-0
Markdown.php
framework/console/Markdown.php
+18
-0
BaseMigrateController.php
framework/console/controllers/BaseMigrateController.php
+4
-2
BaseActiveRecord.php
framework/db/BaseActiveRecord.php
+2
-0
Exception.php
framework/db/Exception.php
+3
-0
QueryBuilder.php
framework/db/QueryBuilder.php
+16
-0
QueryTrait.php
framework/db/QueryTrait.php
+6
-0
PDO.php
framework/db/mssql/PDO.php
+3
-0
QueryBuilder.php
framework/db/oci/QueryBuilder.php
+3
-0
Schema.php
framework/db/oci/Schema.php
+11
-1
BaseConsole.php
framework/helpers/BaseConsole.php
+2
-0
BaseInflector.php
framework/helpers/BaseInflector.php
+1
-1
m140506_102106_rbac_init.php
framework/rbac/migrations/m140506_102106_rbac_init.php
+11
-0
DeleteAction.php
framework/rest/DeleteAction.php
+1
-0
FileValidator.php
framework/validators/FileValidator.php
+3
-0
Validator.php
framework/validators/Validator.php
+1
-0
ErrorAction.php
framework/web/ErrorAction.php
+5
-0
Request.php
framework/web/Request.php
+7
-0
FragmentCache.php
framework/widgets/FragmentCache.php
+7
-0
No files found.
framework/base/Application.php
View file @
0edd8bc6
...
@@ -316,6 +316,7 @@ abstract class Application extends Module
...
@@ -316,6 +316,7 @@ abstract class Application extends Module
/**
/**
* Registers the errorHandler component as a PHP error handler.
* Registers the errorHandler component as a PHP error handler.
* @param array $config application config
*/
*/
protected
function
registerErrorHandler
(
&
$config
)
protected
function
registerErrorHandler
(
&
$config
)
{
{
...
...
framework/console/Markdown.php
View file @
0edd8bc6
...
@@ -44,6 +44,10 @@ class Markdown extends \cebe\markdown\Parser
...
@@ -44,6 +44,10 @@ class Markdown extends \cebe\markdown\Parser
/**
/**
* Consume lines for a fenced code block
* Consume lines for a fenced code block
*
* @param array $lines
* @param integer $current
* @return array
*/
*/
protected
function
consumeFencedCode
(
$lines
,
$current
)
protected
function
consumeFencedCode
(
$lines
,
$current
)
{
{
...
@@ -70,12 +74,18 @@ class Markdown extends \cebe\markdown\Parser
...
@@ -70,12 +74,18 @@ class Markdown extends \cebe\markdown\Parser
/**
/**
* Renders a code block
* Renders a code block
*
* @param array $block
* @return string
*/
*/
protected
function
renderCode
(
$block
)
protected
function
renderCode
(
$block
)
{
{
return
Console
::
ansiFormat
(
implode
(
"
\n
"
,
$block
[
'content'
]),
[
Console
::
BG_GREY
])
.
"
\n
"
;
return
Console
::
ansiFormat
(
implode
(
"
\n
"
,
$block
[
'content'
]),
[
Console
::
BG_GREY
])
.
"
\n
"
;
}
}
/**
* @inheritdoc
*/
protected
function
renderParagraph
(
$block
)
protected
function
renderParagraph
(
$block
)
{
{
return
rtrim
(
$this
->
parseInline
(
implode
(
"
\n
"
,
$block
[
'content'
])))
.
"
\n
"
;
return
rtrim
(
$this
->
parseInline
(
implode
(
"
\n
"
,
$block
[
'content'
])))
.
"
\n
"
;
...
@@ -97,6 +107,8 @@ class Markdown extends \cebe\markdown\Parser
...
@@ -97,6 +107,8 @@ class Markdown extends \cebe\markdown\Parser
/**
/**
* Parses an inline code span `` ` ``.
* Parses an inline code span `` ` ``.
* @param string $text
* @return array
*/
*/
protected
function
parseCode
(
$text
)
protected
function
parseCode
(
$text
)
{
{
...
@@ -120,6 +132,8 @@ class Markdown extends \cebe\markdown\Parser
...
@@ -120,6 +132,8 @@ class Markdown extends \cebe\markdown\Parser
/**
/**
* Parses empathized and strong elements.
* Parses empathized and strong elements.
* @param string $text
* @return array
*/
*/
protected
function
parseEmphStrong
(
$text
)
protected
function
parseEmphStrong
(
$text
)
{
{
...
@@ -146,6 +160,8 @@ class Markdown extends \cebe\markdown\Parser
...
@@ -146,6 +160,8 @@ class Markdown extends \cebe\markdown\Parser
/**
/**
* Parses the strikethrough feature.
* Parses the strikethrough feature.
* @param string $markdown
* @return array
*/
*/
protected
function
parseStrike
(
$markdown
)
protected
function
parseStrike
(
$markdown
)
{
{
...
@@ -160,6 +176,8 @@ class Markdown extends \cebe\markdown\Parser
...
@@ -160,6 +176,8 @@ class Markdown extends \cebe\markdown\Parser
/**
/**
* Parses escaped special characters.
* Parses escaped special characters.
* @param string $text
* @return array
*/
*/
protected
function
parseEscape
(
$text
)
protected
function
parseEscape
(
$text
)
{
{
...
...
framework/console/controllers/BaseMigrateController.php
View file @
0edd8bc6
...
@@ -363,6 +363,7 @@ abstract class BaseMigrateController extends Controller
...
@@ -363,6 +363,7 @@ abstract class BaseMigrateController extends Controller
*
*
* @param integer $limit the maximum number of migrations to be displayed.
* @param integer $limit the maximum number of migrations to be displayed.
* If it is 0, the whole migration history will be displayed.
* If it is 0, the whole migration history will be displayed.
* @throws \yii\console\Exception if invalid limit value passed
*/
*/
public
function
actionHistory
(
$limit
=
10
)
public
function
actionHistory
(
$limit
=
10
)
{
{
...
@@ -371,7 +372,7 @@ abstract class BaseMigrateController extends Controller
...
@@ -371,7 +372,7 @@ abstract class BaseMigrateController extends Controller
}
else
{
}
else
{
$limit
=
(
int
)
$limit
;
$limit
=
(
int
)
$limit
;
if
(
$limit
<
1
)
{
if
(
$limit
<
1
)
{
throw
new
Exception
(
"The
step argumen
t must be greater than 0."
);
throw
new
Exception
(
"The
limi
t must be greater than 0."
);
}
}
}
}
...
@@ -406,6 +407,7 @@ abstract class BaseMigrateController extends Controller
...
@@ -406,6 +407,7 @@ abstract class BaseMigrateController extends Controller
*
*
* @param integer $limit the maximum number of new migrations to be displayed.
* @param integer $limit the maximum number of new migrations to be displayed.
* If it is 0, all available new migrations will be displayed.
* If it is 0, all available new migrations will be displayed.
* @throws \yii\console\Exception if invalid limit value passed
*/
*/
public
function
actionNew
(
$limit
=
10
)
public
function
actionNew
(
$limit
=
10
)
{
{
...
@@ -414,7 +416,7 @@ abstract class BaseMigrateController extends Controller
...
@@ -414,7 +416,7 @@ abstract class BaseMigrateController extends Controller
}
else
{
}
else
{
$limit
=
(
int
)
$limit
;
$limit
=
(
int
)
$limit
;
if
(
$limit
<
1
)
{
if
(
$limit
<
1
)
{
throw
new
Exception
(
"The
step argumen
t must be greater than 0."
);
throw
new
Exception
(
"The
limi
t must be greater than 0."
);
}
}
}
}
...
...
framework/db/BaseActiveRecord.php
View file @
0edd8bc6
...
@@ -686,6 +686,8 @@ abstract class BaseActiveRecord extends Model implements ActiveRecordInterface
...
@@ -686,6 +686,8 @@ abstract class BaseActiveRecord extends Model implements ActiveRecordInterface
/**
/**
* @see update()
* @see update()
* @param array $attributes attributes to update
* @return integer number of rows updated
* @throws StaleObjectException
* @throws StaleObjectException
*/
*/
protected
function
updateInternal
(
$attributes
=
null
)
protected
function
updateInternal
(
$attributes
=
null
)
...
...
framework/db/Exception.php
View file @
0edd8bc6
...
@@ -42,6 +42,9 @@ class Exception extends \yii\base\Exception
...
@@ -42,6 +42,9 @@ class Exception extends \yii\base\Exception
return
'Database Exception'
;
return
'Database Exception'
;
}
}
/**
* @return string readable representation of exception
*/
public
function
__toString
()
public
function
__toString
()
{
{
return
parent
::
__toString
()
.
PHP_EOL
return
parent
::
__toString
()
.
PHP_EOL
...
...
framework/db/QueryBuilder.php
View file @
0edd8bc6
...
@@ -689,6 +689,13 @@ class QueryBuilder extends \yii\base\Object
...
@@ -689,6 +689,13 @@ class QueryBuilder extends \yii\base\Object
return
implode
(
$this
->
separator
,
$joins
);
return
implode
(
$this
->
separator
,
$joins
);
}
}
/**
* Quotes table names passed
*
* @param array $tables
* @param array $params
* @return array
*/
private
function
quoteTableNames
(
$tables
,
&
$params
)
private
function
quoteTableNames
(
$tables
,
&
$params
)
{
{
foreach
(
$tables
as
$i
=>
$table
)
{
foreach
(
$tables
as
$i
=>
$table
)
{
...
@@ -1077,6 +1084,15 @@ class QueryBuilder extends \yii\base\Object
...
@@ -1077,6 +1084,15 @@ class QueryBuilder extends \yii\base\Object
}
}
}
}
/**
* Builds SQL for IN condition
*
* @param string $operator
* @param array $columns
* @param array $values
* @param array $params
* @return string SQL
*/
protected
function
buildCompositeInCondition
(
$operator
,
$columns
,
$values
,
&
$params
)
protected
function
buildCompositeInCondition
(
$operator
,
$columns
,
$values
,
&
$params
)
{
{
$vss
=
[];
$vss
=
[];
...
...
framework/db/QueryTrait.php
View file @
0edd8bc6
...
@@ -342,6 +342,12 @@ trait QueryTrait
...
@@ -342,6 +342,12 @@ trait QueryTrait
return
$this
;
return
$this
;
}
}
/**
* Normalizes format of ORDER BY data
*
* @param array|string $columns
* @return array
*/
protected
function
normalizeOrderBy
(
$columns
)
protected
function
normalizeOrderBy
(
$columns
)
{
{
if
(
is_array
(
$columns
))
{
if
(
is_array
(
$columns
))
{
...
...
framework/db/mssql/PDO.php
View file @
0edd8bc6
...
@@ -66,6 +66,9 @@ class PDO extends \PDO
...
@@ -66,6 +66,9 @@ class PDO extends \PDO
* Retrieve a database connection attribute.
* Retrieve a database connection attribute.
* It is necessary to override PDO's method as some MSSQL PDO driver (e.g. dblib) does not
* It is necessary to override PDO's method as some MSSQL PDO driver (e.g. dblib) does not
* support getting attributes
* support getting attributes
* @param integer $attribute One of the PDO::ATTR_* constants.
* @return mixed A successful call returns the value of the requested PDO attribute.
* An unsuccessful call returns null.
*/
*/
public
function
getAttribute
(
$attribute
)
public
function
getAttribute
(
$attribute
)
{
{
...
...
framework/db/oci/QueryBuilder.php
View file @
0edd8bc6
...
@@ -72,6 +72,9 @@ class QueryBuilder extends \yii\db\QueryBuilder
...
@@ -72,6 +72,9 @@ class QueryBuilder extends \yii\db\QueryBuilder
return
[
$this
->
_sql
,
$params
];
return
[
$this
->
_sql
,
$params
];
}
}
/**
* @inheritdoc
*/
public
function
buildLimit
(
$limit
,
$offset
)
public
function
buildLimit
(
$limit
,
$offset
)
{
{
$filters
=
[];
$filters
=
[];
...
...
framework/db/oci/Schema.php
View file @
0edd8bc6
...
@@ -168,7 +168,7 @@ EOD;
...
@@ -168,7 +168,7 @@ EOD;
return
$this
->
db
->
createCommand
(
$seq_name_sql
)
->
queryScalar
();
return
$this
->
db
->
createCommand
(
$seq_name_sql
)
->
queryScalar
();
}
}
/*
/*
*
* @Overrides method in class 'Schema'
* @Overrides method in class 'Schema'
* @see http://www.php.net/manual/en/function.PDO-lastInsertId.php -> Oracle does not support this
* @see http://www.php.net/manual/en/function.PDO-lastInsertId.php -> Oracle does not support this
*
*
...
@@ -189,6 +189,12 @@ EOD;
...
@@ -189,6 +189,12 @@ EOD;
}
}
}
}
/**
* Creates ColumnSchema instance
*
* @param array $column
* @return ColumnSchema
*/
protected
function
createColumn
(
$column
)
protected
function
createColumn
(
$column
)
{
{
$c
=
new
ColumnSchema
();
$c
=
new
ColumnSchema
();
...
@@ -211,6 +217,10 @@ EOD;
...
@@ -211,6 +217,10 @@ EOD;
return
$c
;
return
$c
;
}
}
/**
* Finds constraints and fills them into TableSchema object passed
* @param TableSchema $table
*/
protected
function
findConstraints
(
$table
)
protected
function
findConstraints
(
$table
)
{
{
$sql
=
<<<EOD
$sql
=
<<<EOD
...
...
framework/helpers/BaseConsole.php
View file @
0edd8bc6
...
@@ -453,6 +453,8 @@ class BaseConsole
...
@@ -453,6 +453,8 @@ class BaseConsole
/**
/**
* Converts Markdown to be better readable in console environments by applying some ANSI format
* Converts Markdown to be better readable in console environments by applying some ANSI format
* @param string $markdown
* @return string
*/
*/
public
static
function
markdownToAnsi
(
$markdown
)
public
static
function
markdownToAnsi
(
$markdown
)
{
{
...
...
framework/helpers/BaseInflector.php
View file @
0edd8bc6
...
@@ -326,7 +326,7 @@ class BaseInflector
...
@@ -326,7 +326,7 @@ class BaseInflector
* For example, 'PostTag' will be converted to 'post-tag'.
* For example, 'PostTag' will be converted to 'post-tag'.
* @param string $name the string to be converted
* @param string $name the string to be converted
* @param string $separator the character used to concatenate the words in the ID
* @param string $separator the character used to concatenate the words in the ID
* @param string $strict whether to insert a separator between two consecutive uppercase chars, defaults to false
* @param
boolean|
string $strict whether to insert a separator between two consecutive uppercase chars, defaults to false
* @return string the resulting ID
* @return string the resulting ID
*/
*/
public
static
function
camel2id
(
$name
,
$separator
=
'-'
,
$strict
=
false
)
public
static
function
camel2id
(
$name
,
$separator
=
'-'
,
$strict
=
false
)
...
...
framework/rbac/migrations/m140506_102106_rbac_init.php
View file @
0edd8bc6
<?php
<?php
/**
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
use
yii\base\InvalidConfigException
;
use
yii\base\InvalidConfigException
;
use
yii\db\Schema
;
use
yii\db\Schema
;
use
yii\rbac\DbManager
;
use
yii\rbac\DbManager
;
/**
* Initializes RBAC tables
*
* @author Alexander Kochetov <creocoder@gmail.com>
* @since 2.0
*/
class
m140506_102106_rbac_init
extends
\yii\db\Migration
class
m140506_102106_rbac_init
extends
\yii\db\Migration
{
{
/**
/**
...
...
framework/rest/DeleteAction.php
View file @
0edd8bc6
...
@@ -19,6 +19,7 @@ class DeleteAction extends Action
...
@@ -19,6 +19,7 @@ class DeleteAction extends Action
{
{
/**
/**
* Deletes a model.
* Deletes a model.
* @param mixed $id id of the model to be deleted.
*/
*/
public
function
run
(
$id
)
public
function
run
(
$id
)
{
{
...
...
framework/validators/FileValidator.php
View file @
0edd8bc6
...
@@ -327,6 +327,9 @@ class FileValidator extends Validator
...
@@ -327,6 +327,9 @@ class FileValidator extends Validator
return
true
;
return
true
;
}
}
/**
* @inheritdoc
*/
public
function
clientValidateAttribute
(
$object
,
$attribute
,
$view
)
{
public
function
clientValidateAttribute
(
$object
,
$attribute
,
$view
)
{
$label
=
$object
->
getAttributeLabel
(
$attribute
);
$label
=
$object
->
getAttributeLabel
(
$attribute
);
...
...
framework/validators/Validator.php
View file @
0edd8bc6
...
@@ -181,6 +181,7 @@ class Validator extends Component
...
@@ -181,6 +181,7 @@ class Validator extends Component
* @param array|string $attributes list of attributes to be validated. This can be either an array of
* @param array|string $attributes list of attributes to be validated. This can be either an array of
* the attribute names or a string of comma-separated attribute names.
* the attribute names or a string of comma-separated attribute names.
* @param array $params initial values to be applied to the validator properties
* @param array $params initial values to be applied to the validator properties
* @throws \yii\base\InvalidConfigException if type can't be recognized
* @return Validator the validator
* @return Validator the validator
*/
*/
public
static
function
createValidator
(
$type
,
$object
,
$attributes
,
$params
=
[])
public
static
function
createValidator
(
$type
,
$object
,
$attributes
,
$params
=
[])
...
...
framework/web/ErrorAction.php
View file @
0edd8bc6
...
@@ -66,6 +66,11 @@ class ErrorAction extends Action
...
@@ -66,6 +66,11 @@ class ErrorAction extends Action
*/
*/
public
$defaultMessage
;
public
$defaultMessage
;
/**
* Runs the action
*
* @return string result content
*/
public
function
run
()
public
function
run
()
{
{
if
((
$exception
=
Yii
::
$app
->
getErrorHandler
()
->
exception
)
===
null
)
{
if
((
$exception
=
Yii
::
$app
->
getErrorHandler
()
->
exception
)
===
null
)
{
...
...
framework/web/Request.php
View file @
0edd8bc6
...
@@ -1329,6 +1329,13 @@ class Request extends \yii\base\Request
...
@@ -1329,6 +1329,13 @@ class Request extends \yii\base\Request
||
$this
->
validateCsrfTokenInternal
(
$this
->
getCsrfTokenFromHeader
(),
$trueToken
);
||
$this
->
validateCsrfTokenInternal
(
$this
->
getCsrfTokenFromHeader
(),
$trueToken
);
}
}
/**
* Validates CSRF token
*
* @param string $token
* @param string $trueToken
* @return boolean
*/
private
function
validateCsrfTokenInternal
(
$token
,
$trueToken
)
private
function
validateCsrfTokenInternal
(
$token
,
$trueToken
)
{
{
$token
=
base64_decode
(
str_replace
(
'.'
,
'+'
,
$token
));
$token
=
base64_decode
(
str_replace
(
'.'
,
'+'
,
$token
));
...
...
framework/widgets/FragmentCache.php
View file @
0edd8bc6
...
@@ -150,6 +150,13 @@ class FragmentCache extends Widget
...
@@ -150,6 +150,13 @@ class FragmentCache extends Widget
return
$this
->
_content
;
return
$this
->
_content
;
}
}
/**
* Replaces placeholders in content by results of evaluated dynamic statemens
*
* @param string $content
* @param array $placeholders
* @return string final content
*/
protected
function
updateDynamicContent
(
$content
,
$placeholders
)
protected
function
updateDynamicContent
(
$content
,
$placeholders
)
{
{
foreach
(
$placeholders
as
$name
=>
$statements
)
{
foreach
(
$placeholders
as
$name
=>
$statements
)
{
...
...
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