From 8a7ba488cde4667d660ac7a8f08596e63ed66fd7 Mon Sep 17 00:00:00 2001 From: lopar Date: Sat, 3 Mar 2018 20:21:58 +0200 Subject: [PATCH] tests --- admin/test.php | 3 +-- classes/n.php | 3 ++- classes/nick.php | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/admin/test.php b/admin/test.php index 4916e82..122f542 100644 --- a/admin/test.php +++ b/admin/test.php @@ -16,5 +16,4 @@ print_r($row2); echo '
'; -n::show(11221)->show(); - +n::show(11221); diff --git a/classes/n.php b/classes/n.php index a84832c..706f495 100644 --- a/classes/n.php +++ b/classes/n.php @@ -12,10 +12,11 @@ class n private function __clone() {} private function __construct() {} + public static function show($userId) { if (!self::$_instance) { - self::$_instance = battles\nick::search($userId); + self::$_instance = battles\nick::search($userId)->geninf(); } return self::$_instance; } diff --git a/classes/nick.php b/classes/nick.php index 6b04ee7..1a0a686 100644 --- a/classes/nick.php +++ b/classes/nick.php @@ -31,7 +31,7 @@ class nick /** * @param int $showInvisibility */ - public function show($showInvisibility = 0) + public function geninf($showInvisibility = 0) { $n =''; if ($showInvisibility) { @@ -51,6 +51,6 @@ class nick // $user['login'] = 'невидимка'; // $user['level'] = 100; // } - echo $n; + return $n; } } \ No newline at end of file