改名
This commit is contained in:
@@ -125,9 +125,16 @@ class Annotation extends Component
|
|||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$construct = $reflect->getConstructor();
|
||||||
|
if (!empty($construct) && count($params = $construct->getParameters()) > 0) {
|
||||||
|
if (!$params[0]->isOptional()) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$def = Snowflake::getDi()->getDependencies($class);
|
$def = Snowflake::getDi()->getDependencies($class);
|
||||||
|
|
||||||
$object = $reflect->newInstanceArgs($def);
|
$object = $reflect->newInstance($def);
|
||||||
$this->resolveMethod($reflect, $class, $alias, $object);
|
$this->resolveMethod($reflect, $class, $alias, $object);
|
||||||
return $this->targets($reflect);
|
return $this->targets($reflect);
|
||||||
} catch (\Throwable $throwable) {
|
} catch (\Throwable $throwable) {
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ abstract class AbstractCollection extends Component implements \IteratorAggregat
|
|||||||
* @param array $array
|
* @param array $array
|
||||||
* @param null $model
|
* @param null $model
|
||||||
*/
|
*/
|
||||||
public function __construct(ActiveQuery $query, array $array = [], $model = null)
|
public function __construct($query, array $array = [], $model = null)
|
||||||
{
|
{
|
||||||
$this->_item = $array;
|
$this->_item = $array;
|
||||||
$this->query = $query;
|
$this->query = $query;
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Database\Base;
|
namespace Database\Base;
|
||||||
|
|
||||||
|
|
||||||
@@ -34,7 +35,7 @@ class CollectionIterator extends \ArrayIterator
|
|||||||
* @param int $flags
|
* @param int $flags
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public function __construct(ActiveRecord $model,ActiveQuery $query, $array = array(), $flags = 0)
|
public function __construct($model, $query, $array = array(), $flags = 0)
|
||||||
{
|
{
|
||||||
$this->model = $model;
|
$this->model = $model;
|
||||||
$this->query = $query;
|
$this->query = $query;
|
||||||
|
|||||||
Reference in New Issue
Block a user