From e05d2064b83949d70ca44efb65a4634b33e0653e Mon Sep 17 00:00:00 2001 From: printempw Date: Fri, 16 Feb 2018 16:25:35 +0800 Subject: [PATCH] Update php DocBlocks for events --- app/Events/CheckPlayerExists.php | 12 ++++-------- app/Events/ConfigureAdminMenu.php | 3 ++- app/Events/ConfigureRoutes.php | 1 + app/Events/ConfigureUserMenu.php | 3 ++- app/Events/EncryptUserPassword.php | 11 ++++++----- app/Events/GetAvatarPreview.php | 13 ++++++------- app/Events/GetPlayerJson.php | 18 +++++++++++------- app/Events/GetSkinPreview.php | 8 +++----- app/Events/PlayerProfileUpdated.php | 5 +---- app/Events/PlayerWasAdded.php | 2 +- app/Events/PlayerWasDeleted.php | 6 +++--- app/Events/PlayerWillBeAdded.php | 6 +++--- app/Events/PlayerWillBeDeleted.php | 2 +- app/Events/PluginWasDeleted.php | 2 +- app/Events/PluginWasDisabled.php | 2 +- app/Events/PluginWasEnabled.php | 2 +- app/Events/RenderingFooter.php | 13 ++++++++++--- app/Events/RenderingHeader.php | 12 +++++++++--- app/Events/UserAuthenticated.php | 2 +- app/Events/UserLoggedIn.php | 2 +- app/Events/UserProfileUpdated.php | 6 ++---- app/Events/UserRegistered.php | 2 +- app/Events/UserTryToLogin.php | 11 ++++------- 23 files changed, 75 insertions(+), 69 deletions(-) diff --git a/app/Events/CheckPlayerExists.php b/app/Events/CheckPlayerExists.php index fddc6275..0c07ba7c 100644 --- a/app/Events/CheckPlayerExists.php +++ b/app/Events/CheckPlayerExists.php @@ -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; } - } diff --git a/app/Events/ConfigureAdminMenu.php b/app/Events/ConfigureAdminMenu.php index 9cbce16c..90186997 100644 --- a/app/Events/ConfigureAdminMenu.php +++ b/app/Events/ConfigureAdminMenu.php @@ -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; } } diff --git a/app/Events/ConfigureRoutes.php b/app/Events/ConfigureRoutes.php index 2dfc76dc..b0d9fc03 100644 --- a/app/Events/ConfigureRoutes.php +++ b/app/Events/ConfigureRoutes.php @@ -11,6 +11,7 @@ class ConfigureRoutes extends Event /** * Create a new event instance. * + * @param Router $router * @return void */ public function __construct(Router $router) diff --git a/app/Events/ConfigureUserMenu.php b/app/Events/ConfigureUserMenu.php index 1bcaea12..9035edeb 100644 --- a/app/Events/ConfigureUserMenu.php +++ b/app/Events/ConfigureUserMenu.php @@ -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; } } diff --git a/app/Events/EncryptUserPassword.php b/app/Events/EncryptUserPassword.php index 9798ccf4..0f820331 100644 --- a/app/Events/EncryptUserPassword.php +++ b/app/Events/EncryptUserPassword.php @@ -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; } - } diff --git a/app/Events/GetAvatarPreview.php b/app/Events/GetAvatarPreview.php index 8a99431c..3f29b488 100644 --- a/app/Events/GetAvatarPreview.php +++ b/app/Events/GetAvatarPreview.php @@ -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; } - } diff --git a/app/Events/GetPlayerJson.php b/app/Events/GetPlayerJson.php index e2d0e4a9..6d378909 100644 --- a/app/Events/GetPlayerJson.php +++ b/app/Events/GetPlayerJson.php @@ -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; } - } diff --git a/app/Events/GetSkinPreview.php b/app/Events/GetSkinPreview.php index 8f4876b1..a19b0ce6 100644 --- a/app/Events/GetSkinPreview.php +++ b/app/Events/GetSkinPreview.php @@ -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; } - } diff --git a/app/Events/PlayerProfileUpdated.php b/app/Events/PlayerProfileUpdated.php index 70b6f04b..a0b34610 100644 --- a/app/Events/PlayerProfileUpdated.php +++ b/app/Events/PlayerProfileUpdated.php @@ -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; } - } diff --git a/app/Events/PlayerWasAdded.php b/app/Events/PlayerWasAdded.php index b0985ce1..007bfe53 100644 --- a/app/Events/PlayerWasAdded.php +++ b/app/Events/PlayerWasAdded.php @@ -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; } - } diff --git a/app/Events/PlayerWasDeleted.php b/app/Events/PlayerWasDeleted.php index 698c9cf0..4bcf1347 100644 --- a/app/Events/PlayerWasDeleted.php +++ b/app/Events/PlayerWasDeleted.php @@ -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; } - } diff --git a/app/Events/PlayerWillBeAdded.php b/app/Events/PlayerWillBeAdded.php index 8ede93e3..3c13e7e2 100644 --- a/app/Events/PlayerWillBeAdded.php +++ b/app/Events/PlayerWillBeAdded.php @@ -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; } - } diff --git a/app/Events/PlayerWillBeDeleted.php b/app/Events/PlayerWillBeDeleted.php index 810cae84..4e2ff768 100644 --- a/app/Events/PlayerWillBeDeleted.php +++ b/app/Events/PlayerWillBeDeleted.php @@ -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; } - } diff --git a/app/Events/PluginWasDeleted.php b/app/Events/PluginWasDeleted.php index 75d8fed9..5b478d73 100644 --- a/app/Events/PluginWasDeleted.php +++ b/app/Events/PluginWasDeleted.php @@ -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; } - } diff --git a/app/Events/PluginWasDisabled.php b/app/Events/PluginWasDisabled.php index 09273da0..ae4b9b29 100644 --- a/app/Events/PluginWasDisabled.php +++ b/app/Events/PluginWasDisabled.php @@ -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; } - } diff --git a/app/Events/PluginWasEnabled.php b/app/Events/PluginWasEnabled.php index ab263779..d2b2a90b 100644 --- a/app/Events/PluginWasEnabled.php +++ b/app/Events/PluginWasEnabled.php @@ -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; } - } diff --git a/app/Events/RenderingFooter.php b/app/Events/RenderingFooter.php index d869dd72..5778ca99 100644 --- a/app/Events/RenderingFooter.php +++ b/app/Events/RenderingFooter.php @@ -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); } diff --git a/app/Events/RenderingHeader.php b/app/Events/RenderingHeader.php index 48c42519..ae75eb4c 100644 --- a/app/Events/RenderingHeader.php +++ b/app/Events/RenderingHeader.php @@ -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; } } - } diff --git a/app/Events/UserAuthenticated.php b/app/Events/UserAuthenticated.php index 396aaceb..daa83500 100644 --- a/app/Events/UserAuthenticated.php +++ b/app/Events/UserAuthenticated.php @@ -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; } - } diff --git a/app/Events/UserLoggedIn.php b/app/Events/UserLoggedIn.php index c5bc3d23..238340d7 100644 --- a/app/Events/UserLoggedIn.php +++ b/app/Events/UserLoggedIn.php @@ -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; } - } diff --git a/app/Events/UserProfileUpdated.php b/app/Events/UserProfileUpdated.php index 101f0d39..9bfd7bed 100644 --- a/app/Events/UserProfileUpdated.php +++ b/app/Events/UserProfileUpdated.php @@ -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; } - } diff --git a/app/Events/UserRegistered.php b/app/Events/UserRegistered.php index e8019032..69ec4da1 100644 --- a/app/Events/UserRegistered.php +++ b/app/Events/UserRegistered.php @@ -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; } - } diff --git a/app/Events/UserTryToLogin.php b/app/Events/UserTryToLogin.php index 9cc7ebc0..c6e02caf 100644 --- a/app/Events/UserTryToLogin.php +++ b/app/Events/UserTryToLogin.php @@ -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; } - }