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
}
/**
* @param null $visibility
* @param null $definedBy
* @param string|null $visibility
* @param string|null $definedBy
* @return MethodDoc[]
*/
private function getFilteredMethods($visibility = null, $definedBy = null)
......
......@@ -53,7 +53,7 @@ abstract class BaseRenderer extends Component
/**
* 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 BaseDoc $context
* @param array $options additional HTML attributes for the link.
......
......@@ -6,6 +6,7 @@ use yii\helpers\StringHelper;
/**
* @var yii\web\View $this
* @var array $types
* @var string $content
*/
......
......@@ -95,7 +95,7 @@ class Command extends Component
*/
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
{
$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
'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
*/
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;
/**
......@@ -475,7 +476,7 @@ abstract class BaseActiveRecord extends Model implements ActiveRecordInterface
/**
* Sets the old attribute values.
* 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)
{
......@@ -1304,8 +1305,8 @@ abstract class BaseActiveRecord extends Model implements ActiveRecordInterface
/**
* @param array $link
* @param BaseActiveRecord $foreignModel
* @param BaseActiveRecord $primaryModel
* @param ActiveRecordInterface $foreignModel
* @param ActiveRecordInterface $primaryModel
* @throws InvalidCallException
*/
private function bindModels($link, $foreignModel, $primaryModel)
......
......@@ -62,7 +62,7 @@ class BaseArrayHelper
if ($recursive) {
foreach ($object as $key => $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
* @return \cebe\markdown\Parser
* @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 */
if (!isset(static::$flavors[$flavor])) {
......
......@@ -108,7 +108,7 @@ class BaseUrl
* @return string normalized route suitable for UrlManager
* @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;
if (strncmp($route, '/', 1) === 0) {
......
......@@ -8,7 +8,6 @@
namespace yii\rest;
use yii\base\Component;
use yii\base\Action;
use yii\web\Request;
use yii\web\Response;
use yii\web\TooManyRequestsHttpException;
......@@ -37,7 +36,7 @@ class RateLimiter extends Component
* @param RateLimitInterface $user the current user
* @param Request $request
* @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
*/
public function check($user, $request, $response, $action)
......
......@@ -64,6 +64,7 @@ class AccessControl extends ActionFilter
* ~~~
*
* 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;
/**
......@@ -79,6 +80,7 @@ class AccessControl extends ActionFilter
*/
public $rules = [];
/**
* Initializes the [[rules]] array by instantiating rule objects from configurations.
*/
......@@ -114,16 +116,14 @@ class AccessControl extends ActionFilter
} else {
$this->denyAccess($user);
}
return false;
}
}
if (isset($this->denyCallback)) {
call_user_func($this->denyCallback, $rule, $action);
call_user_func($this->denyCallback, null, $action);
} else {
$this->denyAccess($user);
}
return false;
}
......
......@@ -56,6 +56,7 @@ class UploadedFile extends Object
*/
public $error;
/**
* String output.
* This is PHP magic method that returns string representation of an object.
......@@ -80,7 +81,6 @@ class UploadedFile extends Object
public static function getInstance($model, $attribute)
{
$name = Html::getInputName($model, $attribute);
return static::getInstanceByName($name);
}
......@@ -95,7 +95,6 @@ class UploadedFile extends Object
public static function getInstances($model, $attribute)
{
$name = Html::getInputName($model, $attribute);
return static::getInstancesByName($name);
}
......@@ -108,8 +107,7 @@ class UploadedFile extends Object
*/
public static function getInstanceByName($name)
{
$files = static::loadFiles();
$files = self::loadFiles();
return isset($files[$name]) ? $files[$name] : null;
}
......@@ -124,7 +122,7 @@ class UploadedFile extends Object
*/
public static function getInstancesByName($name)
{
$files = static::loadFiles();
$files = self::loadFiles();
if (isset($files[$name])) {
return [$files[$name]];
}
......@@ -134,7 +132,6 @@ class UploadedFile extends Object
$results[] = self::$_files[$key];
}
}
return $results;
}
......@@ -166,7 +163,6 @@ class UploadedFile extends Object
return copy($this->tempName, $file);
}
}
return false;
}
......@@ -209,7 +205,6 @@ class UploadedFile extends Object
}
}
}
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