Upgrade to 3.2.0

This commit is contained in:
Bastian Allgeier
2019-06-25 09:56:08 +02:00
parent 9e18cf635d
commit 9c89153d35
296 changed files with 14408 additions and 2504 deletions

View File

@@ -2,6 +2,15 @@
namespace Kirby\Cms;
/**
* AppUsers
*
* @package Kirby Cms
* @author Bastian Allgeier <bastian@getkirby.com>
* @link https://getkirby.com
* @copyright Bastian Allgeier GmbH
* @license https://getkirby.com/license
*/
trait AppUsers
{
@@ -16,7 +25,7 @@ trait AppUsers
* Returns the Authentication layer class
*
* @internal
* @return Auth
* @return Kirby\Cms\Auth
*/
public function auth()
{
@@ -27,7 +36,7 @@ trait AppUsers
* Become any existing user
*
* @param string|null $who
* @return self
* @return Kirby\Cms\User|null
*/
public function impersonate(string $who = null)
{
@@ -37,10 +46,10 @@ trait AppUsers
/**
* Set the currently active user id
*
* @param User|string $user
* @return self
* @param Kirby\Cms\User|string $user
* @return Kirby\Cms\App
*/
protected function setUser($user = null): self
protected function setUser($user = null)
{
$this->user = $user;
return $this;
@@ -50,9 +59,9 @@ trait AppUsers
* Create your own set of app users
*
* @param array $users
* @return self
* @return Kirby\Cms\App
*/
protected function setUsers(array $users = null): self
protected function setUsers(array $users = null)
{
if ($users !== null) {
$this->users = Users::factory($users, [
@@ -67,11 +76,10 @@ trait AppUsers
* Returns a specific user by id
* or the current user if no id is given
*
* @param string $id
* @param \Kirby\Session\Session|array $session Session options or session object for getting the current user
* @return User|null
* @param string $id
* @return Kirby\Cms\User|null
*/
public function user(string $id = null, $session = null)
public function user(string $id = null)
{
if ($id !== null) {
return $this->users()->find($id);
@@ -87,9 +95,9 @@ trait AppUsers
/**
* Returns all users
*
* @return Users
* @return Kirby\Cms\Users
*/
public function users(): Users
public function users()
{
if (is_a($this->users, 'Kirby\Cms\Users') === true) {
return $this->users;