File tree Expand file tree Collapse file tree 6 files changed +14
-18
lines changed Expand file tree Collapse file tree 6 files changed +14
-18
lines changed Original file line number Diff line number Diff line change 22
33namespace App \Controllers ;
44
5- use App \Controllers \BaseController ;
65use App \Models \DungeonModel ;
76use App \Models \HeroModel ;
87
@@ -39,7 +38,7 @@ public function show(int $id)
3938 }
4039
4140 echo view ('dungeon ' , [
42- 'dungeon ' => $ dungeon ,
41+ 'dungeon ' => $ dungeon ,
4342 'monsters ' => $ dungeon ->monsters (3 ),
4443 ]);
4544 }
Original file line number Diff line number Diff line change 22
33namespace App \Controllers ;
44
5- use App \Controllers \BaseController ;
65use App \Models \HeroModel ;
76use CodeIgniter \Exceptions \PageNotFoundException ;
87
@@ -17,9 +16,9 @@ class HeroController extends BaseController
1716 */
1817 public function show (int $ id )
1918 {
20- // When you only need to use a model in a single place,
21- // you can simply get a new instance here. It will use
22- // the default database connection if none is passed in
19+ // When you only need to use a model in a single place,
20+ // you can simply get a new instance here. It will use
21+ // the default database connection if none is passed in
2322 // during instantiation.
2423 $ heroes = new HeroModel ();
2524
Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ public function link(): string
3939 /**
4040 * Use another model to get some random data.
4141 */
42- public function monsters (int $ limit= 5 )
42+ public function monsters (int $ limit = 5 )
4343 {
4444 return model (MonsterModel::class)
4545 ->where ('dungeon_id ' , $ this ->id )
Original file line number Diff line number Diff line change 33namespace App \Entities ;
44
55use CodeIgniter \Entity \Entity ;
6- use CodeIgniter \HTTP \Exceptions \HTTPException ;
7- use InvalidArgumentException ;
86
97/**
108 * Class Monster
Original file line number Diff line number Diff line change 11<?php
2- use Config \Services ;
32use CodeIgniter \CodeIgniter ;
3+ use Config \Services ;
44
55$ errorId = uniqid ('error ' , true );
66?>
8989
9090 <?php
9191 $ params = null ;
92- // Reflection by name is not available for closure function
93- if (substr ($ row ['function ' ], -1 ) !== '} ' ) {
94- $ mirror = isset ($ row ['class ' ]) ? new ReflectionMethod ($ row ['class ' ], $ row ['function ' ]) : new ReflectionFunction ($ row ['function ' ]);
95- $ params = $ mirror ->getParameters ();
96- }
92+ // Reflection by name is not available for closure function
93+ if (substr ($ row ['function ' ], -1 ) !== '} ' ) {
94+ $ mirror = isset ($ row ['class ' ]) ? new ReflectionMethod ($ row ['class ' ], $ row ['function ' ]) : new ReflectionFunction ($ row ['function ' ]);
95+ $ params = $ mirror ->getParameters ();
96+ }
9797
9898 foreach ($ row ['args ' ] as $ key => $ value ) : ?>
9999 <tr>
303303 <!-- Response -->
304304 <?php
305305 $ response = Services::response ();
306- $ response ->setStatusCode (http_response_code ());
307- ?>
306+ $ response ->setStatusCode (http_response_code ());
307+ ?>
308308 <div class="content" id="response">
309309 <table>
310310 <tr>
Original file line number Diff line number Diff line change 2929 <div class="col-6 mx-auto">
3030
3131 <div class="card shadow">
32- <img src="<?= base_url ('images/ ' . esc ($ hero ->image , 'attr ' )) ?> "
32+ <img src="<?= base_url ('images/ ' . esc ($ hero ->image , 'attr ' )) ?> "
3333 alt="<?= esc ($ hero ->name , 'attr ' ) ?> "
3434 class="card-img-top"
3535 >
You can’t perform that action at this time.
0 commit comments