Commit 2105f092 by Qiang Xue

Merge branch 'master' of git://github.com/yiisoft/yii2

parents 78136d42 f93d871c
...@@ -86,8 +86,8 @@ class TypeDoc extends BaseDoc ...@@ -86,8 +86,8 @@ class TypeDoc extends BaseDoc
} }
/** /**
* @param null $visibility * @param string|null $visibility
* @param null $definedBy * @param string|null $definedBy
* @return MethodDoc[] * @return MethodDoc[]
*/ */
private function getFilteredMethods($visibility = null, $definedBy = null) private function getFilteredMethods($visibility = null, $definedBy = null)
......
...@@ -53,7 +53,7 @@ abstract class BaseRenderer extends Component ...@@ -53,7 +53,7 @@ abstract class BaseRenderer extends Component
/** /**
* creates a link to a type (class, interface or trait) * creates a link to a type (class, interface or trait)
* @param ClassDoc|InterfaceDoc|TraitDoc|ClassDoc[]|InterfaceDoc[]|TraitDoc[] $types * @param ClassDoc|InterfaceDoc|TraitDoc|ClassDoc[]|InterfaceDoc[]|TraitDoc[]|string|string[] $types
* @param string $title a title to be used for the link TODO check whether [[yii\...|Class]] is supported * @param string $title a title to be used for the link TODO check whether [[yii\...|Class]] is supported
* @param BaseDoc $context * @param BaseDoc $context
* @param array $options additional HTML attributes for the link. * @param array $options additional HTML attributes for the link.
......
...@@ -6,6 +6,7 @@ use yii\helpers\StringHelper; ...@@ -6,6 +6,7 @@ use yii\helpers\StringHelper;
/** /**
* @var yii\web\View $this * @var yii\web\View $this
* @var array $types
* @var string $content * @var string $content
*/ */
......
...@@ -95,7 +95,7 @@ class Command extends Component ...@@ -95,7 +95,7 @@ class Command extends Component
*/ */
public function get($index, $type, $id, $options = []) public function get($index, $type, $id, $options = [])
{ {
return $this->db->get([$index, $type, $id], $options, null); return $this->db->get([$index, $type, $id], $options);
} }
/** /**
...@@ -184,7 +184,7 @@ class Command extends Component ...@@ -184,7 +184,7 @@ class Command extends Component
{ {
$body = $configuration !== null ? Json::encode($configuration) : null; $body = $configuration !== null ? Json::encode($configuration) : null;
return $this->db->put([$index], $body); return $this->db->put([$index], [], $body);
} }
/** /**
...@@ -381,7 +381,7 @@ class Command extends Component ...@@ -381,7 +381,7 @@ class Command extends Component
'mappings' => (object) $mappings, 'mappings' => (object) $mappings,
]); ]);
return $this->db->put(['_template', $name], $body); return $this->db->put(['_template', $name], [], $body);
} }
......
...@@ -81,7 +81,8 @@ abstract class BaseActiveRecord extends Model implements ActiveRecordInterface ...@@ -81,7 +81,8 @@ abstract class BaseActiveRecord extends Model implements ActiveRecordInterface
*/ */
private $_attributes = []; private $_attributes = [];
/** /**
* @var array old attribute values indexed by attribute names. * @var array|null old attribute values indexed by attribute names.
* This is `null` if the record [[isNewRecord|is new]].
*/ */
private $_oldAttributes; private $_oldAttributes;
/** /**
...@@ -475,7 +476,7 @@ abstract class BaseActiveRecord extends Model implements ActiveRecordInterface ...@@ -475,7 +476,7 @@ abstract class BaseActiveRecord extends Model implements ActiveRecordInterface
/** /**
* Sets the old attribute values. * Sets the old attribute values.
* All existing old attribute values will be discarded. * All existing old attribute values will be discarded.
* @param array $values old attribute values to be set. * @param array|null $values old attribute values to be set.
*/ */
public function setOldAttributes($values) public function setOldAttributes($values)
{ {
...@@ -1304,8 +1305,8 @@ abstract class BaseActiveRecord extends Model implements ActiveRecordInterface ...@@ -1304,8 +1305,8 @@ abstract class BaseActiveRecord extends Model implements ActiveRecordInterface
/** /**
* @param array $link * @param array $link
* @param BaseActiveRecord $foreignModel * @param ActiveRecordInterface $foreignModel
* @param BaseActiveRecord $primaryModel * @param ActiveRecordInterface $primaryModel
* @throws InvalidCallException * @throws InvalidCallException
*/ */
private function bindModels($link, $foreignModel, $primaryModel) private function bindModels($link, $foreignModel, $primaryModel)
......
...@@ -62,7 +62,7 @@ class BaseArrayHelper ...@@ -62,7 +62,7 @@ class BaseArrayHelper
if ($recursive) { if ($recursive) {
foreach ($object as $key => $value) { foreach ($object as $key => $value) {
if (is_array($value) || is_object($value)) { if (is_array($value) || is_object($value)) {
$object[$key] = static::toArray($value, true); $object[$key] = static::toArray($value, $properties, true);
} }
} }
} }
......
...@@ -82,7 +82,7 @@ class BaseMarkdown ...@@ -82,7 +82,7 @@ class BaseMarkdown
* @return \cebe\markdown\Parser * @return \cebe\markdown\Parser
* @throws \yii\base\InvalidParamException when an undefined flavor is given. * @throws \yii\base\InvalidParamException when an undefined flavor is given.
*/ */
private static function getParser($flavor) protected static function getParser($flavor)
{ {
/** @var \cebe\markdown\Markdown $parser */ /** @var \cebe\markdown\Markdown $parser */
if (!isset(static::$flavors[$flavor])) { if (!isset(static::$flavors[$flavor])) {
......
...@@ -108,7 +108,7 @@ class BaseUrl ...@@ -108,7 +108,7 @@ class BaseUrl
* @return string normalized route suitable for UrlManager * @return string normalized route suitable for UrlManager
* @throws InvalidParamException a relative route is given while there is no active controller * @throws InvalidParamException a relative route is given while there is no active controller
*/ */
private static function normalizeRoute($route) protected static function normalizeRoute($route)
{ {
$route = (string) $route; $route = (string) $route;
if (strncmp($route, '/', 1) === 0) { if (strncmp($route, '/', 1) === 0) {
......
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
namespace yii\rest; namespace yii\rest;
use yii\base\Component; use yii\base\Component;
use yii\base\Action;
use yii\web\Request; use yii\web\Request;
use yii\web\Response; use yii\web\Response;
use yii\web\TooManyRequestsHttpException; use yii\web\TooManyRequestsHttpException;
...@@ -37,7 +36,7 @@ class RateLimiter extends Component ...@@ -37,7 +36,7 @@ class RateLimiter extends Component
* @param RateLimitInterface $user the current user * @param RateLimitInterface $user the current user
* @param Request $request * @param Request $request
* @param Response $response * @param Response $response
* @param Action $action the action to be executed * @param \yii\base\Action $action the action to be executed
* @throws TooManyRequestsHttpException if rate limit exceeds * @throws TooManyRequestsHttpException if rate limit exceeds
*/ */
public function check($user, $request, $response, $action) public function check($user, $request, $response, $action)
......
...@@ -64,6 +64,7 @@ class AccessControl extends ActionFilter ...@@ -64,6 +64,7 @@ class AccessControl extends ActionFilter
* ~~~ * ~~~
* *
* where `$rule` is this rule, and `$action` is the current [[Action|action]] object. * where `$rule` is this rule, and `$action` is the current [[Action|action]] object.
* `$rule` will be `null` if access is denied because none of the rules matched.
*/ */
public $denyCallback; public $denyCallback;
/** /**
...@@ -79,6 +80,7 @@ class AccessControl extends ActionFilter ...@@ -79,6 +80,7 @@ class AccessControl extends ActionFilter
*/ */
public $rules = []; public $rules = [];
/** /**
* Initializes the [[rules]] array by instantiating rule objects from configurations. * Initializes the [[rules]] array by instantiating rule objects from configurations.
*/ */
...@@ -114,16 +116,14 @@ class AccessControl extends ActionFilter ...@@ -114,16 +116,14 @@ class AccessControl extends ActionFilter
} else { } else {
$this->denyAccess($user); $this->denyAccess($user);
} }
return false; return false;
} }
} }
if (isset($this->denyCallback)) { if (isset($this->denyCallback)) {
call_user_func($this->denyCallback, $rule, $action); call_user_func($this->denyCallback, null, $action);
} else { } else {
$this->denyAccess($user); $this->denyAccess($user);
} }
return false; return false;
} }
......
...@@ -56,6 +56,7 @@ class UploadedFile extends Object ...@@ -56,6 +56,7 @@ class UploadedFile extends Object
*/ */
public $error; public $error;
/** /**
* String output. * String output.
* This is PHP magic method that returns string representation of an object. * This is PHP magic method that returns string representation of an object.
...@@ -80,7 +81,6 @@ class UploadedFile extends Object ...@@ -80,7 +81,6 @@ class UploadedFile extends Object
public static function getInstance($model, $attribute) public static function getInstance($model, $attribute)
{ {
$name = Html::getInputName($model, $attribute); $name = Html::getInputName($model, $attribute);
return static::getInstanceByName($name); return static::getInstanceByName($name);
} }
...@@ -95,7 +95,6 @@ class UploadedFile extends Object ...@@ -95,7 +95,6 @@ class UploadedFile extends Object
public static function getInstances($model, $attribute) public static function getInstances($model, $attribute)
{ {
$name = Html::getInputName($model, $attribute); $name = Html::getInputName($model, $attribute);
return static::getInstancesByName($name); return static::getInstancesByName($name);
} }
...@@ -108,8 +107,7 @@ class UploadedFile extends Object ...@@ -108,8 +107,7 @@ class UploadedFile extends Object
*/ */
public static function getInstanceByName($name) public static function getInstanceByName($name)
{ {
$files = static::loadFiles(); $files = self::loadFiles();
return isset($files[$name]) ? $files[$name] : null; return isset($files[$name]) ? $files[$name] : null;
} }
...@@ -124,7 +122,7 @@ class UploadedFile extends Object ...@@ -124,7 +122,7 @@ class UploadedFile extends Object
*/ */
public static function getInstancesByName($name) public static function getInstancesByName($name)
{ {
$files = static::loadFiles(); $files = self::loadFiles();
if (isset($files[$name])) { if (isset($files[$name])) {
return [$files[$name]]; return [$files[$name]];
} }
...@@ -134,7 +132,6 @@ class UploadedFile extends Object ...@@ -134,7 +132,6 @@ class UploadedFile extends Object
$results[] = self::$_files[$key]; $results[] = self::$_files[$key];
} }
} }
return $results; return $results;
} }
...@@ -166,7 +163,6 @@ class UploadedFile extends Object ...@@ -166,7 +163,6 @@ class UploadedFile extends Object
return copy($this->tempName, $file); return copy($this->tempName, $file);
} }
} }
return false; return false;
} }
...@@ -209,7 +205,6 @@ class UploadedFile extends Object ...@@ -209,7 +205,6 @@ class UploadedFile extends Object
} }
} }
} }
return self::$_files; return self::$_files;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment