Updated UserInterface and FlexObjectInterface by adding missing update() parameter

This commit is contained in:
Matias Griese
2019-02-14 11:35:43 +02:00
parent a3bf38b182
commit 452df10ea1
3 changed files with 19 additions and 2 deletions

View File

@@ -87,9 +87,10 @@ class User extends Data implements UserInterface
* Update object with data
*
* @param array $data
* @param array $files
* @return $this
*/
public function update(array $data)
public function update(array $data, array $files = [])
{
$this->merge($data);

View File

@@ -15,6 +15,13 @@ use Grav\Common\Media\Interfaces\MediaInterface;
use Grav\Common\Page\Medium\ImageMedium;
use RocketTheme\Toolbox\ArrayTraits\ExportInterface;
/**
* Interface UserInterface
* @package Grav\Common\User\Interfaces
*
* @property string $username
* @property string $email
*/
interface UserInterface extends DataInterface, MediaInterface, \ArrayAccess, \JsonSerializable, ExportInterface
{
/**
@@ -123,9 +130,10 @@ interface UserInterface extends DataInterface, MediaInterface, \ArrayAccess, \Js
* Update object with data
*
* @param array $data
* @param array $files
* @return $this
*/
public function update(array $data);
public function update(array $data, array $files = []);
/**
* Returns whether the data already exists in the storage.

View File

@@ -82,6 +82,14 @@ interface FlexObjectInterface extends NestedObjectInterface, \ArrayAccess
*/
public function exists();
/**
* @param array $data
* @param array $files
* @return $this
* @throws \RuntimeException
*/
public function update(array $data, array $files = []);
/**
* Returns the blueprint for the object.
*