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
7295540c
Commit
7295540c
authored
Apr 17, 2014
by
Alexander Makarov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Code style and phpdoc fixes
parent
76d8e2b5
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
97 additions
and
12 deletions
+97
-12
FixtureHelper.php
apps/advanced/common/tests/_helpers/FixtureHelper.php
+4
-1
BasePage.php
extensions/codeception/BasePage.php
+2
-1
Connection.php
extensions/elasticsearch/Connection.php
+76
-0
QueryBuilder.php
extensions/elasticsearch/QueryBuilder.php
+5
-5
FixtureController.php
extensions/faker/FixtureController.php
+5
-2
Generator.php
extensions/gii/Generator.php
+4
-2
FileHelperTest.php
tests/unit/framework/helpers/FileHelperTest.php
+1
-1
No files found.
apps/advanced/common/tests/_helpers/FixtureHelper.php
View file @
7295540c
...
@@ -45,7 +45,10 @@ class FixtureHelper extends Module
...
@@ -45,7 +45,10 @@ class FixtureHelper extends Module
$this
->
unloadFixtures
();
$this
->
unloadFixtures
();
}
}
protected
function
fixtures
()
/**
* @inheritdoc
*/
public
function
fixtures
()
{
{
return
[
return
[
'user'
=>
[
'user'
=>
[
...
...
extensions/codeception/BasePage.php
View file @
7295540c
...
@@ -34,7 +34,8 @@ abstract class BasePage extends Component
...
@@ -34,7 +34,8 @@ abstract class BasePage extends Component
/**
/**
* Constructor.
* Constructor.
* @param \Codeception\AbstractGuy the testing guy object
*
* @param \Codeception\AbstractGuy $I the testing guy object
*/
*/
public
function
__construct
(
$I
)
public
function
__construct
(
$I
)
{
{
...
...
extensions/elasticsearch/Connection.php
View file @
7295540c
...
@@ -173,11 +173,26 @@ class Connection extends Component
...
@@ -173,11 +173,26 @@ class Connection extends Component
return
$command
;
return
$command
;
}
}
/**
* Creates new query builder instance
* @return QueryBuilder
*/
public
function
getQueryBuilder
()
public
function
getQueryBuilder
()
{
{
return
new
QueryBuilder
(
$this
);
return
new
QueryBuilder
(
$this
);
}
}
/**
* Performs GET HTTP request
*
* @param string $url URL
* @param array $options URL options
* @param string $body request body
* @param boolean $raw if response body contains JSON and should be decoded
* @return mixed response
* @throws Exception
* @throws \yii\base\InvalidConfigException
*/
public
function
get
(
$url
,
$options
=
[],
$body
=
null
,
$raw
=
false
)
public
function
get
(
$url
,
$options
=
[],
$body
=
null
,
$raw
=
false
)
{
{
$this
->
open
();
$this
->
open
();
...
@@ -185,6 +200,16 @@ class Connection extends Component
...
@@ -185,6 +200,16 @@ class Connection extends Component
return
$this
->
httpRequest
(
'GET'
,
$this
->
createUrl
(
$url
,
$options
),
$body
,
$raw
);
return
$this
->
httpRequest
(
'GET'
,
$this
->
createUrl
(
$url
,
$options
),
$body
,
$raw
);
}
}
/**
* Performs HEAD HTTP request
*
* @param string $url URL
* @param array $options URL options
* @param string $body request body
* @return mixed response
* @throws Exception
* @throws \yii\base\InvalidConfigException
*/
public
function
head
(
$url
,
$options
=
[],
$body
=
null
)
public
function
head
(
$url
,
$options
=
[],
$body
=
null
)
{
{
$this
->
open
();
$this
->
open
();
...
@@ -192,6 +217,17 @@ class Connection extends Component
...
@@ -192,6 +217,17 @@ class Connection extends Component
return
$this
->
httpRequest
(
'HEAD'
,
$this
->
createUrl
(
$url
,
$options
),
$body
);
return
$this
->
httpRequest
(
'HEAD'
,
$this
->
createUrl
(
$url
,
$options
),
$body
);
}
}
/**
* Performs POST HTTP request
*
* @param string $url URL
* @param array $options URL options
* @param string $body request body
* @param boolean $raw if response body contains JSON and should be decoded
* @return mixed response
* @throws Exception
* @throws \yii\base\InvalidConfigException
*/
public
function
post
(
$url
,
$options
=
[],
$body
=
null
,
$raw
=
false
)
public
function
post
(
$url
,
$options
=
[],
$body
=
null
,
$raw
=
false
)
{
{
$this
->
open
();
$this
->
open
();
...
@@ -199,6 +235,17 @@ class Connection extends Component
...
@@ -199,6 +235,17 @@ class Connection extends Component
return
$this
->
httpRequest
(
'POST'
,
$this
->
createUrl
(
$url
,
$options
),
$body
,
$raw
);
return
$this
->
httpRequest
(
'POST'
,
$this
->
createUrl
(
$url
,
$options
),
$body
,
$raw
);
}
}
/**
* Performs PUT HTTP request
*
* @param string $url URL
* @param array $options URL options
* @param string $body request body
* @param boolean $raw if response body contains JSON and should be decoded
* @return mixed response
* @throws Exception
* @throws \yii\base\InvalidConfigException
*/
public
function
put
(
$url
,
$options
=
[],
$body
=
null
,
$raw
=
false
)
public
function
put
(
$url
,
$options
=
[],
$body
=
null
,
$raw
=
false
)
{
{
$this
->
open
();
$this
->
open
();
...
@@ -206,6 +253,17 @@ class Connection extends Component
...
@@ -206,6 +253,17 @@ class Connection extends Component
return
$this
->
httpRequest
(
'PUT'
,
$this
->
createUrl
(
$url
,
$options
),
$body
,
$raw
);
return
$this
->
httpRequest
(
'PUT'
,
$this
->
createUrl
(
$url
,
$options
),
$body
,
$raw
);
}
}
/**
* Performs DELETE HTTP request
*
* @param string $url URL
* @param array $options URL options
* @param string $body request body
* @param boolean $raw if response body contains JSON and should be decoded
* @return mixed response
* @throws Exception
* @throws \yii\base\InvalidConfigException
*/
public
function
delete
(
$url
,
$options
=
[],
$body
=
null
,
$raw
=
false
)
public
function
delete
(
$url
,
$options
=
[],
$body
=
null
,
$raw
=
false
)
{
{
$this
->
open
();
$this
->
open
();
...
@@ -213,6 +271,13 @@ class Connection extends Component
...
@@ -213,6 +271,13 @@ class Connection extends Component
return
$this
->
httpRequest
(
'DELETE'
,
$this
->
createUrl
(
$url
,
$options
),
$body
,
$raw
);
return
$this
->
httpRequest
(
'DELETE'
,
$this
->
createUrl
(
$url
,
$options
),
$body
,
$raw
);
}
}
/**
* Creates URL
*
* @param mixed $path path
* @param array $options URL options
* @return array
*/
private
function
createUrl
(
$path
,
$options
=
[])
private
function
createUrl
(
$path
,
$options
=
[])
{
{
if
(
!
is_string
(
$path
))
{
if
(
!
is_string
(
$path
))
{
...
@@ -232,6 +297,17 @@ class Connection extends Component
...
@@ -232,6 +297,17 @@ class Connection extends Component
return
[
$this
->
nodes
[
$this
->
activeNode
][
'http_address'
],
$url
];
return
[
$this
->
nodes
[
$this
->
activeNode
][
'http_address'
],
$url
];
}
}
/**
* Performs HTTP request
*
* @param string $method method name
* @param string $url URL
* @param string $requestBody request body
* @param boolean $raw if response body contains JSON and should be decoded
* @throws Exception if request failed
* @throws \yii\base\InvalidParamException
* @return mixed response
*/
protected
function
httpRequest
(
$method
,
$url
,
$requestBody
=
null
,
$raw
=
false
)
protected
function
httpRequest
(
$method
,
$url
,
$requestBody
=
null
,
$raw
=
false
)
{
{
$method
=
strtoupper
(
$method
);
$method
=
strtoupper
(
$method
);
...
...
extensions/elasticsearch/QueryBuilder.php
View file @
7295540c
...
@@ -133,11 +133,11 @@ class QueryBuilder extends \yii\base\Object
...
@@ -133,11 +133,11 @@ class QueryBuilder extends \yii\base\Object
/**
/**
* Parses the condition specification and generates the corresponding SQL expression.
* Parses the condition specification and generates the corresponding SQL expression.
*
@param string|array $condition the condition specification. Please refer to [[Query::where()]]
*
*
on how to specify a condition.
*
@param string|array $condition the condition specification. Please refer to [[Query::where()]]
on how to specify a condition.
* @
param array $params the binding parameters to be populated
* @
throws \yii\base\InvalidParamException if unknown operator is used in query
* @
return string the generated SQL expression
* @
throws \yii\base\NotSupportedException if string conditions are used in where
* @
throws \yii\db\Exception if the condition is in bad format
* @
return string the generated SQL expression
*/
*/
public
function
buildCondition
(
$condition
)
public
function
buildCondition
(
$condition
)
{
{
...
...
extensions/faker/FixtureController.php
View file @
7295540c
...
@@ -194,9 +194,12 @@ class FixtureController extends \yii\console\controllers\FixtureController
...
@@ -194,9 +194,12 @@ class FixtureController extends \yii\console\controllers\FixtureController
/**
/**
* Generates fixtures and fill them with Faker data.
* Generates fixtures and fill them with Faker data.
* @param string $file filename for the table template. You can generate all fixtures for all tables
*
* by specifying keyword "all" as filename.
* @param array|string $file filename for the table template.
* You can generate all fixtures for all tables by specifying keyword "all" as filename.
* @param integer $times how much fixtures do you want per table
* @param integer $times how much fixtures do you want per table
* @throws \yii\base\InvalidParamException
* @throws \yii\console\Exception
*/
*/
public
function
actionGenerate
(
array
$file
,
$times
=
2
)
public
function
actionGenerate
(
array
$file
,
$times
=
2
)
{
{
...
...
extensions/gii/Generator.php
View file @
7295540c
...
@@ -485,8 +485,10 @@ abstract class Generator extends Model
...
@@ -485,8 +485,10 @@ abstract class Generator extends Model
/**
/**
* Generates a string depending on enableI18N property
* Generates a string depending on enableI18N property
* @param string $string the text be generated
*
* @param array $placeholders the placeholders to use by `Yii::t()`
* @param string $string the text be generated
* @param array $placeholders the placeholders to use by `Yii::t()`
* @return string
*/
*/
public
function
generateString
(
$string
=
''
,
$placeholders
=
[])
public
function
generateString
(
$string
=
''
,
$placeholders
=
[])
{
{
...
...
tests/unit/framework/helpers/FileHelperTest.php
View file @
7295540c
...
@@ -355,7 +355,7 @@ class FileHelperTest extends TestCase
...
@@ -355,7 +355,7 @@ class FileHelperTest extends TestCase
// without "fileinfo" it falls back to getMimeTypeByExtension() and returns application/json
// without "fileinfo" it falls back to getMimeTypeByExtension() and returns application/json
$file
=
$this
->
testFilePath
.
DIRECTORY_SEPARATOR
.
'mime_type_test.json'
;
$file
=
$this
->
testFilePath
.
DIRECTORY_SEPARATOR
.
'mime_type_test.json'
;
file_put_contents
(
$file
,
'{"a": "b"}'
);
file_put_contents
(
$file
,
'{"a": "b"}'
);
$this
->
assertTrue
(
in_array
(
FileHelper
::
getMimeType
(
$file
),
array
(
'application/json'
,
'text/plain'
)
));
$this
->
assertTrue
(
in_array
(
FileHelper
::
getMimeType
(
$file
),
[
'application/json'
,
'text/plain'
]
));
}
}
public
function
testNormalizePath
()
public
function
testNormalizePath
()
...
...
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