Completed
Push — master ( fcc1ef...af96a2 )
by Jacob
15s
created
public/portfolio/index.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 $namespace = 'portfolio';
4
-require_once __DIR__ . '/../../bootstrap.php';
4
+require_once __DIR__.'/../../bootstrap.php';
5 5
 
6 6
 // route
7 7
 Loader::loadInstance('router', 'Router');
Please login to merge, or discard this patch.
utility/URLDecode.class.inc.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -15,11 +15,11 @@  discard block
 block discarded – undo
15 15
 	static private function form_url_array($host, $uri)
16 16
 	{
17 17
 		$uri = substr($uri, 1);
18
-		if(strpos($uri, '?'))
18
+		if (strpos($uri, '?'))
19 19
 			$uri = substr($uri, 0, strpos($uri, '?'));
20 20
 		$uri_array = explode('/', $uri);
21 21
 		
22
-		if(!Loader::isLive())
22
+		if (!Loader::isLive())
23 23
 			$host = substr($host, strpos($host, '.') + 1);
24 24
 		
25 25
 		self::$array['host'] = $host;
@@ -41,9 +41,9 @@  discard block
 block discarded – undo
41 41
     $base .= '/';
42 42
 
43 43
 		self::$array['base'] = $base;
44
-		self::$array['uri'] = '/' . implode('/', $uri_array);
44
+		self::$array['uri'] = '/'.implode('/', $uri_array);
45 45
 		
46
-		if(end($uri_array) == '')
46
+		if (end($uri_array) == '')
47 47
 			$uri_array = array_slice($uri_array, 0, count($uri_array) - 1);
48 48
 		self::$array['pieces'] = (array) $uri_array;
49 49
 	}
@@ -71,21 +71,21 @@  discard block
 block discarded – undo
71 71
 	static function getExtension()
72 72
 	{
73 73
 		$file = self::getPiece(-1);
74
-		if(substr($file, -1) == '/')
74
+		if (substr($file, -1) == '/')
75 75
 			return false;
76
-		return substr($file, strrpos($file, '.') + 1);;
76
+		return substr($file, strrpos($file, '.') + 1); ;
77 77
 	}
78 78
 
79 79
 	static function getPiece($piece = null)
80 80
 	{
81
-		if(!$piece)
81
+		if (!$piece)
82 82
 			return self::$array['pieces'];
83 83
 		
84
-		if($piece == -1)
84
+		if ($piece == -1)
85 85
 			return end(self::$array['pieces']);
86 86
 		
87 87
 		$piece = $piece - 1;
88
-		if(array_key_exists($piece, self::$array['pieces']))
88
+		if (array_key_exists($piece, self::$array['pieces']))
89 89
 			return self::$array['pieces'][$piece];
90 90
 		return;
91 91
 	}
Please login to merge, or discard this patch.
utility/Loader.class.inc.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -17,14 +17,14 @@  discard block
 block discarded – undo
17 17
 
18 18
 	public static function instance()
19 19
 	{
20
-		if(!isset(self::$instance))
20
+		if (!isset(self::$instance))
21 21
 			self::$instance = new Loader();
22 22
 		return self::$instance;
23 23
 	}
24 24
 
25 25
 	private function get_root()
26 26
 	{
27
-		if(!isset($this->root))
27
+		if (!isset($this->root))
28 28
 		{
29 29
 			$current_directory = dirname(__FILE__);
30 30
 			$current_directory = substr($current_directory, 0, -7);
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 
53 53
 	private static function get_extension($type)
54 54
 	{
55
-		switch($type)
55
+		switch ($type)
56 56
 		{
57 57
 			case 'collector' :
58 58
 			case 'controller' :
@@ -104,15 +104,15 @@  discard block
 block discarded – undo
104 104
 
105 105
 	public static function load($type, $files, $data = array())
106 106
 	{
107
-		foreach((array) $files as $file)
107
+		foreach ((array) $files as $file)
108 108
 		{
109 109
 			$file_path = self::instance()->get_path($type, $file);
110
-			if(in_array($file_path, self::instance()->get_included_files()) && $type !== 'view')
110
+			if (in_array($file_path, self::instance()->get_included_files()) && $type !== 'view')
111 111
 				continue;
112 112
 			
113 113
 			self::instance()->add_included_file($file_path);
114 114
 			
115
-			switch($type)
115
+			switch ($type)
116 116
 			{
117 117
 				case 'images' :
118 118
 				case 'scripts' :
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
 		
143 143
 		$reflectionObject = self::create_reflection_class($file);
144 144
 		
145
-		if(
145
+		if (
146 146
 			$reflectionObject->hasMethod('instance') &&
147 147
 			$reflectionObject->getMethod('instance')->isStatic())
148 148
 		{
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
 		
158 158
 		$reflectionObject = self::create_reflection_class($file);
159 159
 		
160
-		if($reflectionObject->hasMethod('__construct'))
160
+		if ($reflectionObject->hasMethod('__construct'))
161 161
 			return $reflectionObject->newInstanceArgs($data);
162 162
 		else
163 163
 			return $reflectionObject->newInstance();
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
             if ($site == 'waterfalls' && self::instance()->is_live) {
181 181
                 return "{$protocol}://www.waterfallsofthekeweenaw.com/";
182 182
             } else {
183
-                return $protocol . '://' . (self::instance()->is_live ? '' : 'dev.') . $site . '.jacobemerick.com/';
183
+                return $protocol.'://'.(self::instance()->is_live ? '' : 'dev.').$site.'.jacobemerick.com/';
184 184
             }
185 185
         }
186 186
         return '/';
Please login to merge, or discard this patch.
utility/Database.class.inc.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 		$mysqli = new mysqli($host, $username, $password);
37 37
 		
38 38
 		$has_connection_error = $mysqli->connect_error;
39
-		if(isset($has_connection_error))
39
+		if (isset($has_connection_error))
40 40
 			$this->has_connection_error = true;
41 41
 		
42 42
 		return $mysqli;
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 
45 45
 	public static function instance()
46 46
 	{
47
-		if(!isset(self::$instance)) {
47
+		if (!isset(self::$instance)) {
48 48
             global $config;
49 49
             self::$instance = new Database(
50 50
                 $config->database->master,
@@ -63,23 +63,23 @@  discard block
 block discarded – undo
63 63
 	public static function select($query)
64 64
 	{
65 65
 		$start = microtime(true);
66
-		if($result = self::instance()->read_connection->query($query))
66
+		if ($result = self::instance()->read_connection->query($query))
67 67
 		{
68 68
 			self::instance()->log_query($query, $start);
69 69
 			$array = array();
70
-			while($row = $result->fetch_object())
70
+			while ($row = $result->fetch_object())
71 71
 				$array[] = $row;
72 72
 			$result->close();
73 73
 			return $array;
74 74
 		}
75
-		trigger_error('Could not preform query - ' . $query . ' - ' . self::instance()->read_connection->error);
75
+		trigger_error('Could not preform query - '.$query.' - '.self::instance()->read_connection->error);
76 76
 		return false;
77 77
 	}
78 78
 
79 79
 	public static function selectRow($query)
80 80
 	{
81 81
 		$result = self::select($query);
82
-		if(is_array($result))
82
+		if (is_array($result))
83 83
 			return array_pop($result);
84 84
 		return false;
85 85
 	}
@@ -87,19 +87,19 @@  discard block
 block discarded – undo
87 87
 	public static function execute($query)
88 88
 	{
89 89
 		$start = microtime(true);
90
-		if(self::instance()->write_connection->query($query))
90
+		if (self::instance()->write_connection->query($query))
91 91
 		{
92 92
 			self::instance()->log_query($query, $start);
93 93
 			return true;
94 94
 		}
95
-		trigger_error('Could not preform query - ' . $query . '-' . self::instance()->write_connection->error);
95
+		trigger_error('Could not preform query - '.$query.'-'.self::instance()->write_connection->error);
96 96
 		return false;
97 97
 	}
98 98
 
99 99
 	public static function lastInsertID()
100 100
 	{
101 101
 		$id = self::instance()->write_connection->insert_id;
102
-		if($id == 0)
102
+		if ($id == 0)
103 103
 			return false;
104 104
 		return $id;
105 105
 	}
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
 	private function gather_query_data()
120 120
 	{
121 121
 		$query_data = array();
122
-		foreach($this->query_log as $query)
122
+		foreach ($this->query_log as $query)
123 123
 		{
124 124
 			$query = self::explain($query);
125 125
 			$query_data[] = $query;
@@ -129,9 +129,9 @@  discard block
 block discarded – undo
129 129
 
130 130
 	public static function explain($query)
131 131
 	{
132
-		$sql = 'EXPLAIN ' . $query['sql'];
132
+		$sql = 'EXPLAIN '.$query['sql'];
133 133
 		
134
-		if($result = self::instance()->read_connection->query($sql))
134
+		if ($result = self::instance()->read_connection->query($sql))
135 135
 		{
136 136
 			$row = $result->fetch_assoc();
137 137
 			$query['explain'] = $row;
Please login to merge, or discard this patch.
controller/home/HomeController.class.inc.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -48,11 +48,11 @@
 block discarded – undo
48 48
     $recentPosts = $postRepository->getActivePosts(3);
49 49
 
50 50
 		$recent_post_array = array();
51
-		foreach($recentPosts as $postResult)
51
+		foreach ($recentPosts as $postResult)
52 52
 		{
53 53
 			$post = new stdclass();
54 54
 			$post->title = $postResult['title'];
55
-			$post->url = Loader::getRootUrl('blog') . "{$postResult['category']}/{$postResult['path']}/";
55
+			$post->url = Loader::getRootUrl('blog')."{$postResult['category']}/{$postResult['path']}/";
56 56
 			$post->category = ucwords(str_replace('-', ' ', $postResult['category']));
57 57
 			$post->thumb = Content::instance('FetchFirstPhoto', $postResult['body'])->activate();
58 58
 			$post->body = Content::instance('SmartTrim', $postResult['body'])->activate(($post->thumb !== '') ? self::$POST_LENGTH_SHORT : self::$POST_LENGTH_LONG);
Please login to merge, or discard this patch.
controller/portfolio/ResumeController.class.inc.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@
 block discarded – undo
25 25
     {
26 26
         $this->set_body('body_view', 'Resume');
27 27
 
28
-        $resumePath = Loader::getRootURL('portfolio') . "/jsonresume/{$this->resume}";
28
+        $resumePath = Loader::getRootURL('portfolio')."/jsonresume/{$this->resume}";
29 29
         $resume = file_get_contents($resumePath);
30 30
         $resume = json_decode($resume, true);
31 31
         $this->set_body('body_data', $resume);
Please login to merge, or discard this patch.
controller/portfolio/ContactController.class.inc.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -89,7 +89,7 @@
 block discarded – undo
89 89
 
90 90
         return [
91 91
             'success' =>
92
-                "Thank you for your message, {$_POST['name']}! " .
92
+                "Thank you for your message, {$_POST['name']}! ".
93 93
                 "I'll get back to you as soon as possible."
94 94
         ];
95 95
     }
Please login to merge, or discard this patch.
bootstrap.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -5,13 +5,13 @@  discard block
 block discarded – undo
5 5
 ini_set('display_errors', 0);
6 6
 
7 7
 
8
-require_once __DIR__ . '/vendor/autoload.php';
8
+require_once __DIR__.'/vendor/autoload.php';
9 9
 
10 10
 $container = new Pimple\Container();
11 11
 
12 12
 
13 13
 // load the config for the application
14
-$config_path = __DIR__ . '/config.json';
14
+$config_path = __DIR__.'/config.json';
15 15
 
16 16
 $handle = @fopen($config_path, 'r');
17 17
 if ($handle === false) {
@@ -29,14 +29,14 @@  discard block
 block discarded – undo
29 29
 
30 30
 // timezones are fun
31 31
 date_default_timezone_set('America/Phoenix'); // todo - belongs in configuration
32
-$container['default_timezone'] = function ($c) {
32
+$container['default_timezone'] = function($c) {
33 33
     return new DateTimeZone('America/Phoenix');
34 34
 };
35 35
 
36 36
 
37 37
 // configure the db connections holder
38 38
 $db_connections = new Aura\Sql\ConnectionLocator();
39
-$db_connections->setDefault(function () use ($config) {
39
+$db_connections->setDefault(function() use ($config) {
40 40
     $connection = $config->database->slave;
41 41
     return new Aura\Sql\ExtendedPdo(
42 42
         "mysql:host={$connection->host}",
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
         $connection->password
45 45
     );
46 46
 });
47
-$db_connections->setWrite('master', function () use ($config) {
47
+$db_connections->setWrite('master', function() use ($config) {
48 48
     $connection = $config->database->master;
49 49
     return new Aura\Sql\ExtendedPdo(
50 50
         "mysql:host={$connection->host}",
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
         $connection->password
53 53
     );
54 54
 });
55
-$db_connections->setRead('slave', function () use ($config) {
55
+$db_connections->setRead('slave', function() use ($config) {
56 56
     $connection = $config->database->slave;
57 57
     $pdo = new Aura\Sql\ExtendedPdo(
58 58
         "mysql:host={$connection->host}",
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
 
71 71
 
72 72
 // configure the comment service connection
73
-$container['comment_service_api'] = function () use ($config) {
73
+$container['comment_service_api'] = function() use ($config) {
74 74
     $configuration = (new Jacobemerick\CommentService\Configuration())
75 75
         ->setUsername($config->comments->user)
76 76
         ->setPassword($config->comments->password)
@@ -84,16 +84,16 @@  discard block
 block discarded – undo
84 84
 
85 85
 
86 86
 // setup mail handler
87
-$container['mail'] = $container->factory(function ($c) {
87
+$container['mail'] = $container->factory(function($c) {
88 88
     return (new Jacobemerick\Archangel\Archangel())->setLogger($c['logger']);
89 89
 });
90 90
 
91 91
 
92 92
 // setup the logger
93
-$container['setup_logger'] = $container->protect(function ($name) use ($container) {
93
+$container['setup_logger'] = $container->protect(function($name) use ($container) {
94 94
     $logger = new Monolog\Logger($name);
95 95
 
96
-    $logPath = __DIR__ . "/logs/{$name}.log";
96
+    $logPath = __DIR__."/logs/{$name}.log";
97 97
     $streamHandler = new Monolog\Handler\StreamHandler($logPath, Monolog\Logger::INFO);
98 98
     // todo - make this more useful
99 99
     // $streamHandler->setFormatter(
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
 
123 123
 
124 124
 // sets up shutdown function to display profiler
125
-register_shutdown_function(function () use ($container) {
125
+register_shutdown_function(function() use ($container) {
126 126
     if (
127 127
         !isset($_COOKIE['debugger']) ||
128 128
         $_COOKIE['debugger'] != 'display'
@@ -134,10 +134,10 @@  discard block
 block discarded – undo
134 134
         ->getRead()
135 135
         ->getProfiler()
136 136
         ->getProfiles();
137
-    $dbProfiles = array_filter($dbProfiles, function ($profile) {
137
+    $dbProfiles = array_filter($dbProfiles, function($profile) {
138 138
         return $profile['function'] == 'perform';
139 139
     });
140
-    $dbProfiles = array_map(function ($profile) {
140
+    $dbProfiles = array_map(function($profile) {
141 141
         return [
142 142
             'sql' => trim(preg_replace('/\s+/', ' ', $profile['statement'])),
143 143
             'parameters' => $profile['bind_values'],
Please login to merge, or discard this patch.
src/Domain/Blog/Post/PostRepositoryInterface.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@
 block discarded – undo
5 5
 interface PostRepositoryInterface
6 6
 {
7 7
     public function findPostByPath($path);
8
-    public function getActivePosts($limit = null, $offset= 0);
8
+    public function getActivePosts($limit = null, $offset = 0);
9 9
     public function getActivePostsCount();
10 10
     public function getActivePostsByTag($tag, $limit = null, $offset = 0);
11 11
     public function getActivePostsCountByTag($tag);
Please login to merge, or discard this patch.