1
0
mirror of https://github.com/flarum/core.git synced 2025-10-22 12:16:07 +02:00

Extract new Flarum\User namespace

This commit is contained in:
Franz Liedke
2017-06-24 12:55:22 +02:00
parent fda8c597f4
commit 564ea8ff73
163 changed files with 405 additions and 394 deletions

View File

@@ -0,0 +1,37 @@
<?php
/*
* This file is part of Flarum.
*
* (c) Toby Zerner <toby.zerner@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Flarum\User\Event;
use Flarum\User\User;
class Activated
{
/**
* @var User
*/
public $user;
/**
* @var User
*/
public $actor;
/**
* @param User $user
* @param User $actor
*/
public function __construct(User $user, User $actor = null)
{
$this->user = $user;
$this->actor = $actor;
}
}

View File

@@ -0,0 +1,37 @@
<?php
/*
* This file is part of Flarum.
*
* (c) Toby Zerner <toby.zerner@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Flarum\User\Event;
use Flarum\User\User;
class AvatarChanged
{
/**
* @var User
*/
public $user;
/**
* @var User
*/
public $actor;
/**
* @param User $user
* @param User $actor
*/
public function __construct(User $user, User $actor = null)
{
$this->user = $user;
$this->actor = $actor;
}
}

View File

@@ -0,0 +1,37 @@
<?php
/*
* This file is part of Flarum.
*
* (c) Toby Zerner <toby.zerner@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Flarum\User\Event;
use Flarum\User\User;
class BioChanged
{
/**
* @var User
*/
public $user;
/**
* @var User
*/
public $actor;
/**
* @param User $user
* @param User $actor
*/
public function __construct(User $user, User $actor = null)
{
$this->user = $user;
$this->actor = $actor;
}
}

View File

@@ -0,0 +1,37 @@
<?php
/*
* This file is part of Flarum.
*
* (c) Toby Zerner <toby.zerner@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Flarum\User\Event;
use Flarum\User\User;
class Deleted
{
/**
* @var User
*/
public $user;
/**
* @var User
*/
public $actor;
/**
* @param User $user
* @param User $actor
*/
public function __construct(User $user, User $actor = null)
{
$this->user = $user;
$this->actor = $actor;
}
}

View File

@@ -0,0 +1,50 @@
<?php
/*
* This file is part of Flarum.
*
* (c) Toby Zerner <toby.zerner@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Flarum\User\Event;
use Flarum\User\User;
class Deleting
{
/**
* The user who will be deleted.
*
* @var User
*/
public $user;
/**
* The user who is performing the action.
*
* @var User
*/
public $actor;
/**
* Any user input associated with the command.
*
* @var array
*/
public $data;
/**
* @param User $user The user who will be deleted.
* @param User $actor The user performing the action.
* @param array $data Any user input associated with the command.
*/
public function __construct(User $user, User $actor, array $data)
{
$this->user = $user;
$this->actor = $actor;
$this->data = $data;
}
}

View File

@@ -0,0 +1,41 @@
<?php
/*
* This file is part of Flarum.
*
* (c) Toby Zerner <toby.zerner@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Flarum\User\Event;
use Flarum\User\User;
class EmailChangeRequested
{
/**
* The user who requested the email change.
*
* @var User
*/
public $user;
/**
* The email they requested to change to.
*
* @var string
*/
public $email;
/**
* @param User $user The user who requested the email change.
* @param string $email The email they requested to change to.
*/
public function __construct(User $user, $email)
{
$this->user = $user;
$this->email = $email;
}
}

View File

@@ -0,0 +1,37 @@
<?php
/*
* This file is part of Flarum.
*
* (c) Toby Zerner <toby.zerner@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Flarum\User\Event;
use Flarum\User\User;
class EmailChanged
{
/**
* @var User
*/
public $user;
/**
* @var User
*/
public $actor;
/**
* @param User $user
* @param User $actor
*/
public function __construct(User $user, User $actor = null)
{
$this->user = $user;
$this->actor = $actor;
}
}

View File

@@ -0,0 +1,46 @@
<?php
/*
* This file is part of Flarum.
*
* (c) Toby Zerner <toby.zerner@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Flarum\User\Event;
use Flarum\User\User;
class GroupsChanged
{
/**
* The user whose groups were changed.
*
* @var User
*/
public $user;
/**
* @var \Flarum\Core\Group[]
*/
public $oldGroups;
/**
* @var User
*/
public $actor;
/**
* @param User $user The user whose groups were changed.
* @param \Flarum\Core\Group[] $oldGroups
* @param User $actor
*/
public function __construct(User $user, array $oldGroups, User $actor = null)
{
$this->user = $user;
$this->oldGroups = $oldGroups;
$this->actor = $actor;
}
}

View File

@@ -0,0 +1,28 @@
<?php
/*
* This file is part of Flarum.
*
* (c) Toby Zerner <toby.zerner@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Flarum\User\Event;
use Flarum\User\User;
use Flarum\Http\AccessToken;
class LoggedIn
{
public $user;
public $token;
public function __construct(User $user, AccessToken $token)
{
$this->user = $user;
$this->token = $token;
}
}

View File

@@ -0,0 +1,24 @@
<?php
/*
* This file is part of Flarum.
*
* (c) Toby Zerner <toby.zerner@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Flarum\User\Event;
use Flarum\User\User;
class LoggedOut
{
public $user;
public function __construct(User $user)
{
$this->user = $user;
}
}

View File

@@ -0,0 +1,37 @@
<?php
/*
* This file is part of Flarum.
*
* (c) Toby Zerner <toby.zerner@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Flarum\User\Event;
use Flarum\User\User;
class PasswordChanged
{
/**
* @var User
*/
public $user;
/**
* @var User
*/
public $actor;
/**
* @param User $user
* @param User $actor
*/
public function __construct(User $user, User $actor = null)
{
$this->user = $user;
$this->actor = $actor;
}
}

View File

@@ -0,0 +1,37 @@
<?php
/*
* This file is part of Flarum.
*
* (c) Toby Zerner <toby.zerner@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Flarum\User\Event;
use Flarum\User\User;
class Registered
{
/**
* @var User
*/
public $user;
/**
* @var User
*/
public $actor;
/**
* @param User $user
* @param User $actor
*/
public function __construct(User $user, User $actor = null)
{
$this->user = $user;
$this->actor = $actor;
}
}

View File

@@ -0,0 +1,37 @@
<?php
/*
* This file is part of Flarum.
*
* (c) Toby Zerner <toby.zerner@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Flarum\User\Event;
use Flarum\User\User;
class Renamed
{
/**
* @var User
*/
public $user;
/**
* @var User
*/
public $actor;
/**
* @param User $user
* @param User $actor
*/
public function __construct(User $user, User $actor = null)
{
$this->user = $user;
$this->actor = $actor;
}
}

50
src/User/Event/Saving.php Normal file
View File

@@ -0,0 +1,50 @@
<?php
/*
* This file is part of Flarum.
*
* (c) Toby Zerner <toby.zerner@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Flarum\User\Event;
use Flarum\User\User;
class Saving
{
/**
* The user that will be saved.
*
* @var User
*/
public $user;
/**
* The user who is performing the action.
*
* @var User
*/
public $actor;
/**
* The attributes to update on the user.
*
* @var array
*/
public $data;
/**
* @param User $user The user that will be saved.
* @param User $actor The user who is performing the action.
* @param array $data The attributes to update on the user.
*/
public function __construct(User $user, User $actor, array $data)
{
$this->user = $user;
$this->actor = $actor;
$this->data = $data;
}
}