mirror of
https://github.com/codeguy/php-the-right-way.git
synced 2025-08-18 11:31:16 +02:00
fix the indentation
This commit is contained in:
@@ -27,7 +27,7 @@ Consider the most basic step:
|
|||||||
{% highlight php %}
|
{% highlight php %}
|
||||||
<?php
|
<?php
|
||||||
function getAllSomethings($db) {
|
function getAllSomethings($db) {
|
||||||
return $db->query('SELECT * FROM table');
|
return $db->query('SELECT * FROM table');
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (getAllFoos() as $row) {
|
foreach (getAllFoos() as $row) {
|
||||||
@@ -63,16 +63,16 @@ include 'views/foo-list.php';
|
|||||||
<?php
|
<?php
|
||||||
class Foo()
|
class Foo()
|
||||||
{
|
{
|
||||||
protected $db;
|
protected $db;
|
||||||
|
|
||||||
public function __construct(PDO $db)
|
public function __construct(PDO $db)
|
||||||
{
|
{
|
||||||
$this->db = $db;
|
$this->db = $db;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getAllFoos() {
|
public function getAllFoos() {
|
||||||
return $this->db->query('SELECT * FROM table');
|
return $this->db->query('SELECT * FROM table');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
{% endhighlight %}
|
{% endhighlight %}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user