Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 5bf8a7feb1 | |||
| 52d26c4481 | |||
| dd369d348c |
@@ -17,6 +17,7 @@ use Kiri\ToArray;
|
||||
use Exception;
|
||||
use JetBrains\PhpStorm\Pure;
|
||||
use Kiri\Abstracts\Component;
|
||||
use ReturnTypeWillChange;
|
||||
use Traversable;
|
||||
|
||||
/**
|
||||
@@ -91,7 +92,7 @@ abstract class AbstractCollection extends Component implements \IteratorAggregat
|
||||
*/
|
||||
public function addItem($item)
|
||||
{
|
||||
array_push($this->_item, $item);
|
||||
$this->_item[] = $item;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -143,7 +144,7 @@ abstract class AbstractCollection extends Component implements \IteratorAggregat
|
||||
* @param mixed $offset
|
||||
* @param mixed $value
|
||||
*/
|
||||
public function offsetSet(mixed $offset, mixed $value)
|
||||
#[ReturnTypeWillChange] public function offsetSet(mixed $offset, mixed $value)
|
||||
{
|
||||
$this->_item[$offset] = $value;
|
||||
}
|
||||
@@ -152,7 +153,7 @@ abstract class AbstractCollection extends Component implements \IteratorAggregat
|
||||
/**
|
||||
* @param mixed $offset
|
||||
*/
|
||||
public function offsetUnset(mixed $offset)
|
||||
#[ReturnTypeWillChange] public function offsetUnset(mixed $offset)
|
||||
{
|
||||
if ($this->offsetExists($offset)) {
|
||||
unset($this->_item[$offset]);
|
||||
|
||||
+3
-2
@@ -33,6 +33,7 @@ use Kiri\Exception\NotFindClassException;
|
||||
use Kiri\Kiri;
|
||||
use Kiri\ToArray;
|
||||
use ReflectionException;
|
||||
use ReturnTypeWillChange;
|
||||
use validator\Validator;
|
||||
|
||||
/**
|
||||
@@ -1000,7 +1001,7 @@ abstract class Model extends Component implements ModelInterface, ArrayAccess, T
|
||||
* @param mixed $value
|
||||
* @throws Exception
|
||||
*/
|
||||
public function offsetSet(mixed $offset, mixed $value)
|
||||
#[ReturnTypeWillChange] public function offsetSet(mixed $offset, mixed $value)
|
||||
{
|
||||
$this->__set($offset, $value);
|
||||
}
|
||||
@@ -1009,7 +1010,7 @@ abstract class Model extends Component implements ModelInterface, ArrayAccess, T
|
||||
* @param mixed $offset
|
||||
* @throws Exception
|
||||
*/
|
||||
public function offsetUnset(mixed $offset)
|
||||
#[ReturnTypeWillChange] public function offsetUnset(mixed $offset)
|
||||
{
|
||||
if (!isset($this->_attributes[$offset])
|
||||
&& !isset($this->_oldAttributes[$offset])) {
|
||||
|
||||
Reference in New Issue
Block a user