@@ -131,6 +131,9 @@ |
||
131 | 131 | self::send($array); |
132 | 132 | } |
133 | 133 | |
134 | + /** |
|
135 | + * @param string[] $array |
|
136 | + */ |
|
134 | 137 | private static function send($array, $gzip = true) |
135 | 138 | { |
136 | 139 | if($gzip) |
@@ -1,10 +1,10 @@ discard block |
||
1 | 1 | <? |
2 | 2 | |
3 | -final class Header |
|
4 | -{ |
|
3 | +final class Header |
|
4 | +{ |
|
5 | 5 | |
6 | - public static function sendJSON() |
|
7 | - { |
|
6 | + public static function sendJSON() |
|
7 | + { |
|
8 | 8 | $array = array( |
9 | 9 | 'HTTP/1.1 200 OK', |
10 | 10 | 'Cache-Control: no-cache', |
@@ -16,8 +16,8 @@ discard block |
||
16 | 16 | self::send($array); |
17 | 17 | } |
18 | 18 | |
19 | - public static function sendHTML() |
|
20 | - { |
|
19 | + public static function sendHTML() |
|
20 | + { |
|
21 | 21 | $array = array( |
22 | 22 | 'HTTP/1.1 200 OK', |
23 | 23 | 'Cache-Control: no-cache', |
@@ -29,14 +29,14 @@ discard block |
||
29 | 29 | self::send($array); |
30 | 30 | } |
31 | 31 | |
32 | - public static function redirect($location, $method = 301) |
|
33 | - { |
|
32 | + public static function redirect($location, $method = 301) |
|
33 | + { |
|
34 | 34 | header("Location: {$location}", TRUE, $method); |
35 | 35 | exit(); |
36 | 36 | } |
37 | 37 | |
38 | - public static function send404() |
|
39 | - { |
|
38 | + public static function send404() |
|
39 | + { |
|
40 | 40 | $array = array( |
41 | 41 | 'HTTP/1.1 404 Not Found', |
42 | 42 | 'Cache-Control: no-cache', |
@@ -48,8 +48,8 @@ discard block |
||
48 | 48 | self::send($array); |
49 | 49 | } |
50 | 50 | |
51 | - public static function send503() |
|
52 | - { |
|
51 | + public static function send503() |
|
52 | + { |
|
53 | 53 | $array = array( |
54 | 54 | 'HTTP/1.1 503 Service Unavailable', |
55 | 55 | 'Cache-Control: no-cache', |
@@ -61,10 +61,11 @@ discard block |
||
61 | 61 | self::send($array); |
62 | 62 | } |
63 | 63 | |
64 | - private static function send($array, $gzip = true) |
|
65 | - { |
|
66 | - if($gzip) |
|
67 | - self::start_gzipping(); |
|
64 | + private static function send($array, $gzip = true) |
|
65 | + { |
|
66 | + if($gzip) { |
|
67 | + self::start_gzipping(); |
|
68 | + } |
|
68 | 69 | |
69 | 70 | foreach($array as $row) |
70 | 71 | { |
@@ -72,17 +73,19 @@ discard block |
||
72 | 73 | } |
73 | 74 | } |
74 | 75 | |
75 | - private static function get_date($timestamp = false) |
|
76 | - { |
|
77 | - if($timestamp == 0) |
|
78 | - $timestamp = time(); |
|
76 | + private static function get_date($timestamp = false) |
|
77 | + { |
|
78 | + if($timestamp == 0) { |
|
79 | + $timestamp = time(); |
|
80 | + } |
|
79 | 81 | return gmdate('D, d M Y H:i:s \G\M\T', $timestamp); |
80 | 82 | } |
81 | 83 | |
82 | - private static function start_gzipping() |
|
83 | - { |
|
84 | - if(!ob_start('ob_gzhandler')) |
|
85 | - ob_start(); |
|
84 | + private static function start_gzipping() |
|
85 | + { |
|
86 | + if(!ob_start('ob_gzhandler')) { |
|
87 | + ob_start(); |
|
88 | + } |
|
86 | 89 | } |
87 | 90 | |
88 | 91 | } |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | protected $connections; |
12 | 12 | |
13 | 13 | /** |
14 | - * @param Aura\Sql\ConnectionLocator $connections |
|
14 | + * @param ConnectionLocator $connections |
|
15 | 15 | */ |
16 | 16 | public function __construct(ConnectionLocator $connections) |
17 | 17 | { |
@@ -41,6 +41,9 @@ discard block |
||
41 | 41 | ->fetchOne($query, $bindings); |
42 | 42 | } |
43 | 43 | |
44 | + /** |
|
45 | + * @param integer $limit |
|
46 | + */ |
|
44 | 47 | public function getActivePosts($limit = null, $offset = 0) |
45 | 48 | { |
46 | 49 | $query = " |
@@ -79,6 +82,9 @@ discard block |
||
79 | 82 | ->fetchValue($query, $bindings); |
80 | 83 | } |
81 | 84 | |
85 | + /** |
|
86 | + * @param integer $limit |
|
87 | + */ |
|
82 | 88 | public function getActivePostsByTag($tag, $limit = null, $offset = 0) |
83 | 89 | { |
84 | 90 | $query = " |
@@ -122,6 +128,9 @@ discard block |
||
122 | 128 | ->fetchValue($query, $bindings); |
123 | 129 | } |
124 | 130 | |
131 | + /** |
|
132 | + * @param integer $limit |
|
133 | + */ |
|
125 | 134 | public function getActivePostsByCategory($category, $limit = null, $offset = 0) |
126 | 135 | { |
127 | 136 | $query = " |
@@ -4,8 +4,8 @@ discard block |
||
4 | 4 | |
5 | 5 | use Aura\Sql\ConnectionLocator; |
6 | 6 | |
7 | -class MysqlPostRepository implements PostRepositoryInterface |
|
8 | -{ |
|
7 | +class MysqlPostRepository implements PostRepositoryInterface |
|
8 | +{ |
|
9 | 9 | |
10 | 10 | /** @var Aura\Sql\ConnectionLocator */ |
11 | 11 | protected $connections; |
@@ -13,8 +13,8 @@ discard block |
||
13 | 13 | /** |
14 | 14 | * @param Aura\Sql\ConnectionLocator $connections |
15 | 15 | */ |
16 | - public function __construct(ConnectionLocator $connections) |
|
17 | - { |
|
16 | + public function __construct(ConnectionLocator $connections) |
|
17 | + { |
|
18 | 18 | $this->connections = $connections; |
19 | 19 | } |
20 | 20 | |
@@ -23,8 +23,8 @@ discard block |
||
23 | 23 | * |
24 | 24 | * @return array|false |
25 | 25 | */ |
26 | - public function findPostByPath($path) |
|
27 | - { |
|
26 | + public function findPostByPath($path) |
|
27 | + { |
|
28 | 28 | $query = " |
29 | 29 | SELECT `id`, `title`, `path`, `date`, `body`, `category` |
30 | 30 | FROM `jpemeric_blog`.`post` |
@@ -41,8 +41,8 @@ discard block |
||
41 | 41 | ->fetchOne($query, $bindings); |
42 | 42 | } |
43 | 43 | |
44 | - public function getActivePosts($limit = null, $offset = 0) |
|
45 | - { |
|
44 | + public function getActivePosts($limit = null, $offset = 0) |
|
45 | + { |
|
46 | 46 | $query = " |
47 | 47 | SELECT `id`, `title`, `path`, `date`, `body`, `category` |
48 | 48 | FROM `jpemeric_blog`.`post` |
@@ -63,8 +63,8 @@ discard block |
||
63 | 63 | ->fetchAll($query, $bindings); |
64 | 64 | } |
65 | 65 | |
66 | - public function getActivePostsCount() |
|
67 | - { |
|
66 | + public function getActivePostsCount() |
|
67 | + { |
|
68 | 68 | $query = " |
69 | 69 | SELECT COUNT(1) AS `count` |
70 | 70 | FROM `jpemeric_blog`.`post` |
@@ -79,8 +79,8 @@ discard block |
||
79 | 79 | ->fetchValue($query, $bindings); |
80 | 80 | } |
81 | 81 | |
82 | - public function getActivePostsByTag($tag, $limit = null, $offset = 0) |
|
83 | - { |
|
82 | + public function getActivePostsByTag($tag, $limit = null, $offset = 0) |
|
83 | + { |
|
84 | 84 | $query = " |
85 | 85 | SELECT `id`, `title`, `path`, `date`, `body`, `category` |
86 | 86 | FROM `jpemeric_blog`.`post` |
@@ -104,8 +104,8 @@ discard block |
||
104 | 104 | ->fetchAll($query, $bindings); |
105 | 105 | } |
106 | 106 | |
107 | - public function getActivePostsCountByTag($tag) |
|
108 | - { |
|
107 | + public function getActivePostsCountByTag($tag) |
|
108 | + { |
|
109 | 109 | $query = " |
110 | 110 | SELECT COUNT(1) AS `count` |
111 | 111 | FROM `jpemeric_blog`.`post` |
@@ -123,8 +123,8 @@ discard block |
||
123 | 123 | ->fetchValue($query, $bindings); |
124 | 124 | } |
125 | 125 | |
126 | - public function getActivePostsByCategory($category, $limit = null, $offset = 0) |
|
127 | - { |
|
126 | + public function getActivePostsByCategory($category, $limit = null, $offset = 0) |
|
127 | + { |
|
128 | 128 | $query = " |
129 | 129 | SELECT `id`, `title`, `path`, `date`, `body`, `category` |
130 | 130 | FROM `jpemeric_blog`.`post` |
@@ -146,8 +146,8 @@ discard block |
||
146 | 146 | ->fetchAll($query, $bindings); |
147 | 147 | } |
148 | 148 | |
149 | - public function getActivePostsCountByCategory($category) |
|
150 | - { |
|
149 | + public function getActivePostsCountByCategory($category) |
|
150 | + { |
|
151 | 151 | $query = " |
152 | 152 | SELECT COUNT(1) AS `count` |
153 | 153 | FROM `jpemeric_blog`.`post` |
@@ -163,8 +163,8 @@ discard block |
||
163 | 163 | ->fetchValue($query, $bindings); |
164 | 164 | } |
165 | 165 | |
166 | - public function getActivePostsByRelatedTags($post, $limit = 4) |
|
167 | - { |
|
166 | + public function getActivePostsByRelatedTags($post, $limit = 4) |
|
167 | + { |
|
168 | 168 | $query = " |
169 | 169 | SELECT `id`, `title`, `path`, `date`, `body`, `category`, COUNT(1) AS `count` |
170 | 170 | FROM `jpemeric_blog`.`post` |
@@ -2,8 +2,8 @@ |
||
2 | 2 | |
3 | 3 | namespace Jacobemerick\Web\Domain\Comment\Comment; |
4 | 4 | |
5 | -interface CommentRepositoryInterface |
|
6 | -{ |
|
5 | +interface CommentRepositoryInterface |
|
6 | +{ |
|
7 | 7 | public function createComment(array $comment); |
8 | 8 | public function getComment($commentId); |
9 | 9 | public function getComments($domain = null, $path = null, $page = null, $perPage = null, $order = null); |
@@ -2,8 +2,8 @@ |
||
2 | 2 | |
3 | 3 | namespace Jacobemerick\Web\Domain\Comment\Commenter; |
4 | 4 | |
5 | -interface CommenterRepositoryInterface |
|
6 | -{ |
|
5 | +interface CommenterRepositoryInterface |
|
6 | +{ |
|
7 | 7 | public function createCommenter(array $commenter); |
8 | 8 | public function getCommenter($commenterId); |
9 | 9 | public function getCommenters($page = null, $perPage = null); |
@@ -2,7 +2,7 @@ |
||
2 | 2 | |
3 | 3 | namespace Jacobemerick\Web\Domain\Waterfall\County; |
4 | 4 | |
5 | -interface CountyRepositoryInterface |
|
6 | -{ |
|
5 | +interface CountyRepositoryInterface |
|
6 | +{ |
|
7 | 7 | public function getCountyList(); |
8 | 8 | } |
@@ -2,7 +2,7 @@ |
||
2 | 2 | |
3 | 3 | namespace Jacobemerick\Web\Domain\Waterfall\Period; |
4 | 4 | |
5 | -interface PeriodRepositoryInterface |
|
6 | -{ |
|
5 | +interface PeriodRepositoryInterface |
|
6 | +{ |
|
7 | 7 | public function getPeriodList(); |
8 | 8 | } |
@@ -2,7 +2,7 @@ |
||
2 | 2 | |
3 | 3 | namespace Jacobemerick\Web\Domain\Waterfall\Waterfall; |
4 | 4 | |
5 | -interface WaterfallRepositoryInterface |
|
6 | -{ |
|
5 | +interface WaterfallRepositoryInterface |
|
6 | +{ |
|
7 | 7 | public function getWaterfalls($limit = null, $offset= 0); |
8 | 8 | } |
@@ -2,7 +2,7 @@ |
||
2 | 2 | |
3 | 3 | namespace Jacobemerick\Web\Domain\Waterfall\Watercourse; |
4 | 4 | |
5 | -interface WatercourseRepositoryInterface |
|
6 | -{ |
|
5 | +interface WatercourseRepositoryInterface |
|
6 | +{ |
|
7 | 7 | public function getWatercourseList(); |
8 | 8 | } |
@@ -2,7 +2,7 @@ |
||
2 | 2 | |
3 | 3 | namespace Jacobemerick\Web\Domain\Waterfall\Companion; |
4 | 4 | |
5 | -interface CompanionRepositoryInterface |
|
6 | -{ |
|
5 | +interface CompanionRepositoryInterface |
|
6 | +{ |
|
7 | 7 | public function getCompanionList(); |
8 | 8 | } |