Update php DocBlocks for events

This commit is contained in:
printempw 2018-02-16 16:25:35 +08:00
parent 0bc68090a8
commit e05d2064b8
23 changed files with 75 additions and 69 deletions

View File

@ -2,22 +2,18 @@
namespace App\Events;
use Illuminate\Queue\SerializesModels;
class CheckPlayerExists extends Event
{
use SerializesModels;
public $player_name;
public $playerName;
/**
* Create a new event instance.
*
* @param string $playerName
* @return void
*/
public function __construct($player_name)
public function __construct($playerName)
{
$this->player_name = $player_name;
$this->playerName = $playerName;
}
}

View File

@ -9,11 +9,12 @@ class ConfigureAdminMenu extends Event
/**
* Create a new event instance.
*
* @param array $menu
* @return void
*/
public function __construct(array &$menu)
{
// pass array by reference
// Pass array by reference
$this->menu = &$menu;
}
}

View File

@ -11,6 +11,7 @@ class ConfigureRoutes extends Event
/**
* Create a new event instance.
*
* @param Router $router
* @return void
*/
public function __construct(Router $router)

View File

@ -9,11 +9,12 @@ class ConfigureUserMenu extends Event
/**
* Create a new event instance.
*
* @param array $menu
* @return void
*/
public function __construct(array &$menu)
{
// pass array by reference
// Pass array by reference
$this->menu = &$menu;
}
}

View File

@ -6,19 +6,20 @@ use App\Models\User;
class EncryptUserPassword extends Event
{
public $rawPasswd;
public $user;
public $rawPasswd;
/**
* Create a new event instance.
*
* @param string $rawPasswd
* @param User $user
* @return void
*/
public function __construct($raw_passwd, User $user)
public function __construct($rawPasswd, User $user)
{
$this->rawPasswd = $raw_passwd;
$this->rawPasswd = $rawPasswd;
$this->user = $user;
}
}

View File

@ -2,25 +2,24 @@
namespace App\Events;
use Illuminate\Queue\SerializesModels;
use App\Models\Texture;
class GetAvatarPreview extends Event
{
use SerializesModels;
public $size;
public $texture;
public $size;
/**
* Create a new event instance.
*
* @param Texture $texture
* @param int $size
* @return void
*/
public function __construct(\App\Models\Texture $texture, $size)
public function __construct(Texture $texture, $size)
{
$this->texture = $texture;
$this->texture = $texture;
$this->size = $size;
}
}

View File

@ -3,25 +3,29 @@
namespace App\Events;
use App\Models\Player;
use Illuminate\Queue\SerializesModels;
class GetPlayerJson extends Event
{
use SerializesModels;
public $player;
public $api_type;
/**
* CSL_API = 0
* USM_API = 1
*
* @var int
*/
public $apiType;
/**
* Create a new event instance.
*
* @param Player $player
* @param int $apiType
* @return void
*/
public function __construct(Player $player, $api_type)
public function __construct(Player $player, $apiType)
{
$this->player = $player;
$this->api_type = $api_type;
$this->apiType = $apiType;
}
}

View File

@ -3,19 +3,18 @@
namespace App\Events;
use App\Models\Texture;
use Illuminate\Queue\SerializesModels;
class GetSkinPreview extends Event
{
use SerializesModels;
public $size;
public $texture;
public $size;
/**
* Create a new event instance.
*
* @param Texture $texture
* @param int $size
* @return void
*/
public function __construct(Texture $texture, $size)
@ -23,5 +22,4 @@ class GetSkinPreview extends Event
$this->texture = $texture;
$this->size = $size;
}
}

View File

@ -3,22 +3,19 @@
namespace App\Events;
use App\Models\Player;
use Illuminate\Queue\SerializesModels;
class PlayerProfileUpdated extends Event
{
use SerializesModels;
public $player;
/**
* Create a new event instance.
*
* @param Player $player
* @return void
*/
public function __construct(Player $player)
{
$this->player = $player;
}
}

View File

@ -11,11 +11,11 @@ class PlayerWasAdded extends Event
/**
* Create a new event instance.
*
* @param Player $player
* @return void
*/
public function __construct(Player $player)
{
$this->player = $player;
}
}

View File

@ -9,11 +9,11 @@ class PlayerWasDeleted extends Event
/**
* Create a new event instance.
*
* @param string $playerName
* @return void
*/
public function __construct($player_name)
public function __construct($playerName)
{
$this->playerName = $player_name;
$this->playerName = $playerName;
}
}

View File

@ -9,11 +9,11 @@ class PlayerWillBeAdded extends Event
/**
* Create a new event instance.
*
* @param string $playerName
* @return void
*/
public function __construct($player_name)
public function __construct($playerName)
{
$this->playerName = $player_name;
$this->playerName = $playerName;
}
}

View File

@ -11,11 +11,11 @@ class PlayerWillBeDeleted extends Event
/**
* Create a new event instance.
*
* @param Player $player
* @return void
*/
public function __construct(Player $player)
{
$this->player = $player;
}
}

View File

@ -11,11 +11,11 @@ class PluginWasDeleted extends Event
/**
* Create a new event instance.
*
* @param Plugin $plugin
* @return void
*/
public function __construct(Plugin $plugin)
{
$this->plugin = $plugin;
}
}

View File

@ -11,11 +11,11 @@ class PluginWasDisabled extends Event
/**
* Create a new event instance.
*
* @param Plugin $plugin
* @return void
*/
public function __construct(Plugin $plugin)
{
$this->plugin = $plugin;
}
}

View File

@ -11,11 +11,11 @@ class PluginWasEnabled extends Event
/**
* Create a new event instance.
*
* @param Plugin $plugin
* @return void
*/
public function __construct(Plugin $plugin)
{
$this->plugin = $plugin;
}
}

View File

@ -4,23 +4,30 @@ namespace App\Events;
class RenderingFooter extends Event
{
protected $contents;
public $contents;
/**
* Create a new event instance.
*
* @param array $contents
* @return void
*/
public function __construct(array &$contents)
{
// pass array by reference
// Pass array by reference
$this->contents = &$contents;
}
/**
* Add content to page footer.
*
* @param string $content
* @return void
*/
public function addContent($content)
{
if ($content) {
if (!is_string($content)) {
if (! is_string($content)) {
throw new \Exception("Can not add non-string content", 1);
}

View File

@ -9,23 +9,29 @@ class RenderingHeader extends Event
/**
* Create a new event instance.
*
* @param array $contents
* @return void
*/
public function __construct(array &$contents)
{
// pass array by reference
// Pass array by reference
$this->contents = &$contents;
}
/**
* Add content to page footer.
*
* @param string $content
* @return void
*/
public function addContent($content)
{
if ($content) {
if (!is_string($content)) {
if (! is_string($content)) {
throw new \Exception("Can not add non-string content", 1);
}
$this->contents[] = $content;
}
}
}

View File

@ -11,11 +11,11 @@ class UserAuthenticated extends Event
/**
* Create a new event instance.
*
* @param User $user
* @return void
*/
public function __construct(User $user)
{
$this->user = $user;
}
}

View File

@ -11,11 +11,11 @@ class UserLoggedIn extends Event
/**
* Create a new event instance.
*
* @param User $user
* @return void
*/
public function __construct(User $user)
{
$this->user = $user;
}
}

View File

@ -3,18 +3,17 @@
namespace App\Events;
use App\Models\User;
use Illuminate\Queue\SerializesModels;
class UserProfileUpdated extends Event
{
use SerializesModels;
public $type;
public $user;
/**
* Create a new event instance.
*
* @param string $type Which type of user profile was updated.
* @param User $user
* @return void
*/
public function __construct($type, User $user)
@ -22,5 +21,4 @@ class UserProfileUpdated extends Event
$this->type = $type;
$this->user = $user;
}
}

View File

@ -11,11 +11,11 @@ class UserRegistered extends Event
/**
* Create a new event instance.
*
* @param User $user
* @return void
*/
public function __construct(User $user)
{
$this->user = $user;
}
}

View File

@ -2,12 +2,8 @@
namespace App\Events;
use Illuminate\Queue\SerializesModels;
class UserTryToLogin extends Event
{
use SerializesModels;
public $identification;
public $authType;
@ -15,12 +11,13 @@ class UserTryToLogin extends Event
/**
* Create a new event instance.
*
* @param string $identification Email or username of the user.
* @param string $authType "email" or "username".
* @return void
*/
public function __construct($identification, $auth_type)
public function __construct($identification, $authType)
{
$this->identification = $identification;
$this->authType = $auth_type;
$this->authType = $authType;
}
}