Skip to content

Commit

Permalink
style: composer style
Browse files Browse the repository at this point in the history
  • Loading branch information
kenjis committed Oct 23, 2023
1 parent 3ca9dfc commit b6be60e
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 18 deletions.
3 changes: 1 addition & 2 deletions app/Controllers/DungeonController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace App\Controllers;

use App\Controllers\BaseController;
use App\Models\DungeonModel;
use App\Models\HeroModel;

Expand Down Expand Up @@ -39,7 +38,7 @@ public function show(int $id)
}

echo view('dungeon', [
'dungeon' => $dungeon,
'dungeon' => $dungeon,
'monsters' => $dungeon->monsters(3),
]);
}
Expand Down
7 changes: 3 additions & 4 deletions app/Controllers/HeroController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace App\Controllers;

use App\Controllers\BaseController;
use App\Models\HeroModel;
use CodeIgniter\Exceptions\PageNotFoundException;

Expand All @@ -17,9 +16,9 @@ class HeroController extends BaseController
*/
public function show(int $id)
{
// When you only need to use a model in a single place,
// you can simply get a new instance here. It will use
// the default database connection if none is passed in
// When you only need to use a model in a single place,
// you can simply get a new instance here. It will use
// the default database connection if none is passed in
// during instantiation.
$heroes = new HeroModel();

Expand Down
2 changes: 1 addition & 1 deletion app/Entities/Dungeon.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function link(): string
/**
* Use another model to get some random data.
*/
public function monsters(int $limit=5)
public function monsters(int $limit = 5)
{
return model(MonsterModel::class)
->where('dungeon_id', $this->id)
Expand Down
2 changes: 0 additions & 2 deletions app/Entities/Monster.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
namespace App\Entities;

use CodeIgniter\Entity\Entity;
use CodeIgniter\HTTP\Exceptions\HTTPException;
use InvalidArgumentException;

/**
* Class Monster
Expand Down
16 changes: 8 additions & 8 deletions app/Views/errors/html/error_exception.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
use Config\Services;
use CodeIgniter\CodeIgniter;
use Config\Services;

$errorId = uniqid('error', true);
?>
Expand Down Expand Up @@ -89,11 +89,11 @@

<?php
$params = null;
// Reflection by name is not available for closure function
if (substr($row['function'], -1) !== '}') {
$mirror = isset($row['class']) ? new ReflectionMethod($row['class'], $row['function']) : new ReflectionFunction($row['function']);
$params = $mirror->getParameters();
}
// Reflection by name is not available for closure function
if (substr($row['function'], -1) !== '}') {
$mirror = isset($row['class']) ? new ReflectionMethod($row['class'], $row['function']) : new ReflectionFunction($row['function']);
$params = $mirror->getParameters();
}

foreach ($row['args'] as $key => $value) : ?>
<tr>
Expand Down Expand Up @@ -303,8 +303,8 @@
<!-- Response -->
<?php
$response = Services::response();
$response->setStatusCode(http_response_code());
?>
$response->setStatusCode(http_response_code());
?>
<div class="content" id="response">
<table>
<tr>
Expand Down
2 changes: 1 addition & 1 deletion app/Views/hero.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<div class="col-6 mx-auto">

<div class="card shadow">
<img src="<?= base_url('images/'. esc($hero->image, 'attr')) ?>"
<img src="<?= base_url('images/' . esc($hero->image, 'attr')) ?>"
alt="<?= esc($hero->name, 'attr') ?>"
class="card-img-top"
>
Expand Down

0 comments on commit b6be60e

Please sign in to comment.