Close #9
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
<?php
|
||||
namespace Battles;
|
||||
use db;
|
||||
/**
|
||||
* Разные способы отображения строки с логином персонажа.
|
||||
*/
|
||||
@@ -15,7 +16,7 @@ class Nick extends User
|
||||
* Отображение иконки склонности.
|
||||
* @return string
|
||||
*/
|
||||
private function getAlign()
|
||||
private function getAlign():string
|
||||
{
|
||||
if (isset($this->align)) {
|
||||
return sprintf('<img src="i/align_%s.gif">', $this->align);
|
||||
@@ -28,7 +29,7 @@ class Nick extends User
|
||||
* Отображение иконки клана.
|
||||
* @return string
|
||||
*/
|
||||
private function getClan()
|
||||
private function getClan():string
|
||||
{
|
||||
if (isset($this->clan)) {
|
||||
return sprintf('<img src="i/clan/%s.png">', $this->clan);
|
||||
@@ -51,12 +52,11 @@ class Nick extends User
|
||||
/**
|
||||
* Возвращает строку со склонностью, кланом, логином, уровнем, ссылкой на профиль.
|
||||
*
|
||||
* @param int $showInvisibility - По умолчанию 0. Выбрать 1, если надо отображать невидимый статус.
|
||||
* @param int $showInvisibility отображать логин даже если персонаж невидимка.
|
||||
*
|
||||
* @return string
|
||||
* @throws \Krugozor\Database\Mysql\Exception
|
||||
*/
|
||||
public function full($showInvisibility = 0)
|
||||
public function full($showInvisibility = 0):string
|
||||
{
|
||||
if ($showInvisibility && $this->getInvisibilityStatus()) {
|
||||
return '<i>невидимка</i>';
|
||||
@@ -66,12 +66,12 @@ class Nick extends User
|
||||
|
||||
/**
|
||||
* Возвращает строку с логином или невидимым статусом.
|
||||
* @param int $showInvisibility отображать логин даже если персонаж невидимка.
|
||||
* @return string
|
||||
* @throws \Krugozor\Database\Mysql\Exception
|
||||
*/
|
||||
public function short()
|
||||
public function short($showInvisibility = 0):string
|
||||
{
|
||||
if ($this->getInvisibilityStatus()) {
|
||||
if ($showInvisibility && $this->getInvisibilityStatus()) {
|
||||
return '<i>невидимка</i>';
|
||||
} else {
|
||||
return htmlspecialchars($this->login);
|
||||
@@ -82,7 +82,7 @@ class Nick extends User
|
||||
* Возвращает строку со склонностью, кланом, логином, уровнем, ссылкой на профиль, здоровьем.
|
||||
* @return string
|
||||
*/
|
||||
public function battle()
|
||||
public function battle():string
|
||||
{
|
||||
return $this->getAlign().$this->getClan().sprintf('<b>%s</b> [%s] <a href="inf.php?%s" target="_blank"><img src="i/inf.gif" style="width:12px;height:11px"></a> <img src="i/herz.gif" alt="HP"> _hp_/_maxhp_', $this->login, $this->level, $this->login);
|
||||
}
|
||||
@@ -93,7 +93,7 @@ class Nick extends User
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function battleShort($textstyle)
|
||||
public function battleShort($textstyle):string
|
||||
{
|
||||
if ($this->getInvisibilityStatus()) {
|
||||
return '<i>невидимка</i>';
|
||||
|
||||
Reference in New Issue
Block a user