From 452df10ea19d53117b9fdc3bee07a120288cdbfd Mon Sep 17 00:00:00 2001 From: Matias Griese Date: Thu, 14 Feb 2019 11:35:43 +0200 Subject: [PATCH] Updated `UserInterface` and `FlexObjectInterface` by adding missing update() parameter --- system/src/Grav/Common/User/DataUser/User.php | 3 ++- .../src/Grav/Common/User/Interfaces/UserInterface.php | 10 +++++++++- .../Framework/Flex/Interfaces/FlexObjectInterface.php | 8 ++++++++ 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/system/src/Grav/Common/User/DataUser/User.php b/system/src/Grav/Common/User/DataUser/User.php index 8b6cfed22..7bf9fd0a2 100644 --- a/system/src/Grav/Common/User/DataUser/User.php +++ b/system/src/Grav/Common/User/DataUser/User.php @@ -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); diff --git a/system/src/Grav/Common/User/Interfaces/UserInterface.php b/system/src/Grav/Common/User/Interfaces/UserInterface.php index 040cd095b..8e6762978 100644 --- a/system/src/Grav/Common/User/Interfaces/UserInterface.php +++ b/system/src/Grav/Common/User/Interfaces/UserInterface.php @@ -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. diff --git a/system/src/Grav/Framework/Flex/Interfaces/FlexObjectInterface.php b/system/src/Grav/Framework/Flex/Interfaces/FlexObjectInterface.php index c747d3534..4f03a3984 100644 --- a/system/src/Grav/Framework/Flex/Interfaces/FlexObjectInterface.php +++ b/system/src/Grav/Framework/Flex/Interfaces/FlexObjectInterface.php @@ -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. *