From 01ea22d089892035bfc7e6db654e3d568cce6c21 Mon Sep 17 00:00:00 2001 From: Kavalar Date: Wed, 24 Jul 2024 16:31:07 +0300 Subject: [PATCH] some fix --- app/controllers/UserController.php | 13 +++++++++++++ app/models/Question.php | 3 +++ app/models/User.php | 2 ++ 3 files changed, 18 insertions(+) diff --git a/app/controllers/UserController.php b/app/controllers/UserController.php index d0eb0e2..f3ab12b 100644 --- a/app/controllers/UserController.php +++ b/app/controllers/UserController.php @@ -16,9 +16,17 @@ use Itguild\Tables\ViewJsonTable; use kernel\Controller; use kernel\IGTabel\ListJsonTableEloquentCollection; use kernel\IGTabel\ViewJsonTableEloquentModel; +use Twig\Error\LoaderError; +use Twig\Error\RuntimeError; +use Twig\Error\SyntaxError; use Twig\TwigFunction; class UserController extends Controller{ + /** + * @throws SyntaxError + * @throws RuntimeError + * @throws LoaderError + */ public function actionCreate(): void { echo $this->twig->render('user_create.html.twig'); @@ -87,6 +95,11 @@ class UserController extends Controller{ echo $this->twig->render('user_table.html.twig'); } + /** + * @throws RuntimeError + * @throws SyntaxError + * @throws LoaderError + */ public function actionUpdate(): void { // $loader = new \Twig\Loader\FilesystemLoader(__DIR__.'/../views'); diff --git a/app/models/Question.php b/app/models/Question.php index ef5d034..4f3b28d 100644 --- a/app/models/Question.php +++ b/app/models/Question.php @@ -3,6 +3,9 @@ namespace app\models; use \Illuminate\Database\Eloquent\Model; +/** + * @method static where(string $string, $user_id) + */ class Question extends Model { protected $table = 'question'; protected $fillable = ['question','user_id']; diff --git a/app/models/User.php b/app/models/User.php index aed47c8..40622fd 100644 --- a/app/models/User.php +++ b/app/models/User.php @@ -6,6 +6,8 @@ use Illuminate\Database\Eloquent\Model; * @property string $username * @property string $email * @property string $password_hash + * @method static where(int[] $array) + * @method static find($id) */ class User extends Model { protected $table = 'user';