Completed
Pull Request — master (#5)
by Jacob
03:10
created
router/PortfolioRouter.class.inc.php 2 patches
Indentation   +44 added lines, -44 removed lines patch added patch discarded remove patch
@@ -5,52 +5,52 @@
 block discarded – undo
5 5
 class PortfolioRouter extends Router
6 6
 {
7 7
 
8
-    protected function get_redirect_array()
9
-    {
10
-        $paths = [
11
-            [
12
-                'pattern' => '@/index.(html|htm|php)$@',
13
-                'replace' => '/',
14
-            ],
15
-            [
16
-                'pattern' => '@^/print(/?)$@',
17
-                'replace' => '/',
18
-            ],
19
-            [
20
-                'pattern' => '@^/web(/?)$@',
21
-                'replace' => '/',
22
-            ],
23
-            [
24
-                'pattern' => '@^/(web|print)/([a-z0-9-]+)(/?)$@',
25
-                'replace' => '/',
26
-            ],
27
-        ];
8
+	protected function get_redirect_array()
9
+	{
10
+		$paths = [
11
+			[
12
+				'pattern' => '@/index.(html|htm|php)$@',
13
+				'replace' => '/',
14
+			],
15
+			[
16
+				'pattern' => '@^/print(/?)$@',
17
+				'replace' => '/',
18
+			],
19
+			[
20
+				'pattern' => '@^/web(/?)$@',
21
+				'replace' => '/',
22
+			],
23
+			[
24
+				'pattern' => '@^/(web|print)/([a-z0-9-]+)(/?)$@',
25
+				'replace' => '/',
26
+			],
27
+		];
28 28
 
29
-        return array_map(function ($row) {
30
-            return (object) $row;
31
-        }, $paths);
32
-    }
29
+		return array_map(function ($row) {
30
+			return (object) $row;
31
+		}, $paths);
32
+	}
33 33
 
34
-    protected function get_direct_array()
35
-    {
36
-        $paths = [
37
-            [
38
-                'match' => '/',
39
-                'controller' => 'HomeController',
40
-            ],
41
-            [
42
-                'match' => '/contact/',
43
-                'controller' => 'ContactController',
44
-            ],
45
-            [
46
-                'match' => '/resume/',
47
-                'controller' => 'ResumeController',
48
-            ],
49
-        ];
34
+	protected function get_direct_array()
35
+	{
36
+		$paths = [
37
+			[
38
+				'match' => '/',
39
+				'controller' => 'HomeController',
40
+			],
41
+			[
42
+				'match' => '/contact/',
43
+				'controller' => 'ContactController',
44
+			],
45
+			[
46
+				'match' => '/resume/',
47
+				'controller' => 'ResumeController',
48
+			],
49
+		];
50 50
 
51
-        return array_map(function ($row) {
52
-            return (object) $row;
53
-        }, $paths);
54
-    }
51
+		return array_map(function ($row) {
52
+			return (object) $row;
53
+		}, $paths);
54
+	}
55 55
 
56 56
 }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
             ],
27 27
         ];
28 28
 
29
-        return array_map(function ($row) {
29
+        return array_map(function($row) {
30 30
             return (object) $row;
31 31
         }, $paths);
32 32
     }
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
             ],
49 49
         ];
50 50
 
51
-        return array_map(function ($row) {
51
+        return array_map(function($row) {
52 52
             return (object) $row;
53 53
         }, $paths);
54 54
     }
Please login to merge, or discard this patch.
controller/portfolio/DefaultPageController.class.inc.php 2 patches
Indentation   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -5,41 +5,41 @@
 block discarded – undo
5 5
 abstract class DefaultPageController extends PageController
6 6
 {
7 7
 
8
-    public function __construct()
9
-    {
10
-        parent::__construct();
8
+	public function __construct()
9
+	{
10
+		parent::__construct();
11 11
 
12
-        $this->add_css('reset');
13
-        $this->add_css('portfolio');
14
-    }
12
+		$this->add_css('reset');
13
+		$this->add_css('portfolio');
14
+	}
15 15
 
16
-    protected function get_menu()
17
-    {
18
-        $menu = [
19
-            [
20
-                'name' => 'About',
21
-                'link' => Loader::getRootURL(),
22
-            ],
23
-            [
24
-                'name' => 'Resume',
25
-                'link' => Loader::getRootURL() . 'resume/',
26
-            ],
27
-            [
28
-                'name' => 'Contact',
29
-                'link' => Loader::getRootURL() . 'contact/',
30
-            ],
31
-        ];
16
+	protected function get_menu()
17
+	{
18
+		$menu = [
19
+			[
20
+				'name' => 'About',
21
+				'link' => Loader::getRootURL(),
22
+			],
23
+			[
24
+				'name' => 'Resume',
25
+				'link' => Loader::getRootURL() . 'resume/',
26
+			],
27
+			[
28
+				'name' => 'Contact',
29
+				'link' => Loader::getRootURL() . 'contact/',
30
+			],
31
+		];
32 32
 
33
-        if (!URLDecode::getPiece(1)) {
34
-            $active_page = 'About';
35
-        } else {
36
-            $active_page = ucfirst(URLDecode::getPiece(1));
37
-        }
33
+		if (!URLDecode::getPiece(1)) {
34
+			$active_page = 'About';
35
+		} else {
36
+			$active_page = ucfirst(URLDecode::getPiece(1));
37
+		}
38 38
 
39
-        return array_map(function ($row) use ($active_page) {
40
-            $row = (object) $row;
41
-            $row->active = ($row->name == $active_page);
42
-            return $row;
43
-        }, $menu);
44
-    }
39
+		return array_map(function ($row) use ($active_page) {
40
+			$row = (object) $row;
41
+			$row->active = ($row->name == $active_page);
42
+			return $row;
43
+		}, $menu);
44
+	}
45 45
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@
 block discarded – undo
36 36
             $active_page = ucfirst(URLDecode::getPiece(1));
37 37
         }
38 38
 
39
-        return array_map(function ($row) use ($active_page) {
39
+        return array_map(function($row) use ($active_page) {
40 40
             $row = (object) $row;
41 41
             $row->active = ($row->name == $active_page);
42 42
             return $row;
Please login to merge, or discard this patch.
controller/portfolio/ContactController.class.inc.php 1 patch
Indentation   +77 added lines, -77 removed lines patch added patch discarded remove patch
@@ -5,93 +5,93 @@
 block discarded – undo
5 5
 class ContactController extends DefaultPageController
6 6
 {
7 7
 
8
-    protected function set_data()
9
-    {
10
-        $this->set_title("Contact Page | Jacob Emerick's Portfolio");
11
-        $this->set_description("Contact page for Jacob Emerick's Portfolio");
12
-        $this->set_keywords([
13
-            'portfolio',
14
-            'programming portfolio',
15
-            'contact',
16
-            'Jacob Emerick',
17
-            'information',
18
-            'freelance',
19
-        ]);
8
+	protected function set_data()
9
+	{
10
+		$this->set_title("Contact Page | Jacob Emerick's Portfolio");
11
+		$this->set_description("Contact page for Jacob Emerick's Portfolio");
12
+		$this->set_keywords([
13
+			'portfolio',
14
+			'programming portfolio',
15
+			'contact',
16
+			'Jacob Emerick',
17
+			'information',
18
+			'freelance',
19
+		]);
20 20
 
21
-        $this->set_body('body_view', 'Contact');
22
-        $this->set_body('left_side_data', [
23
-            'title' => "Contact | Jacob Emerick's Portfolio",
24
-            'menu' => $this->get_menu(),
25
-            'home_link' => Loader::getRootURL(),
26
-        ]);
21
+		$this->set_body('body_view', 'Contact');
22
+		$this->set_body('left_side_data', [
23
+			'title' => "Contact | Jacob Emerick's Portfolio",
24
+			'menu' => $this->get_menu(),
25
+			'home_link' => Loader::getRootURL(),
26
+		]);
27 27
 
28
-        $form_results = [];
29
-        if (!empty($_POST)) {
30
-            $form_results = $this->process_form_data();
31
-        }
32
-        $this->set_body('body_data', $form_results);
28
+		$form_results = [];
29
+		if (!empty($_POST)) {
30
+			$form_results = $this->process_form_data();
31
+		}
32
+		$this->set_body('body_data', $form_results);
33 33
 
34
-        $this->set_body_view('Page');
35
-    }
34
+		$this->set_body_view('Page');
35
+	}
36 36
 
37
-    private function process_form_data()
38
-    {
39
-        $errors = [];
37
+	private function process_form_data()
38
+	{
39
+		$errors = [];
40 40
 
41
-        if (
42
-            empty($_POST['name']) ||
43
-            !is_string($_POST['name']) ||
44
-            strlen($_POST['name']) > 100
45
-        ) {
46
-            $errors['name'] = 'Please enter a valid name.';
47
-        }
41
+		if (
42
+			empty($_POST['name']) ||
43
+			!is_string($_POST['name']) ||
44
+			strlen($_POST['name']) > 100
45
+		) {
46
+			$errors['name'] = 'Please enter a valid name.';
47
+		}
48 48
 
49
-        if (!filter_var($_POST['email'], FILTER_VALIDATE_EMAIL)) {
50
-            $errors['email'] = 'Please enter a valid email.';
51
-        }
49
+		if (!filter_var($_POST['email'], FILTER_VALIDATE_EMAIL)) {
50
+			$errors['email'] = 'Please enter a valid email.';
51
+		}
52 52
 
53
-        if (
54
-            empty($_POST['message']) ||
55
-            !is_string($_POST['message']) ||
56
-            strlen($_POST['message']) > 10000
57
-        ) {
58
-            $errors['message'] = 'Please enter a valid message.';
59
-        }
53
+		if (
54
+			empty($_POST['message']) ||
55
+			!is_string($_POST['message']) ||
56
+			strlen($_POST['message']) > 10000
57
+		) {
58
+			$errors['message'] = 'Please enter a valid message.';
59
+		}
60 60
 
61
-        if (!empty($errors)) {
62
-            $values = $_POST;
63
-            $values = array_intersect_key($values, array_flip([
64
-                'name',
65
-                'email',
66
-                'message',
67
-            ]));
61
+		if (!empty($errors)) {
62
+			$values = $_POST;
63
+			$values = array_intersect_key($values, array_flip([
64
+				'name',
65
+				'email',
66
+				'message',
67
+			]));
68 68
 
69
-            return [
70
-                'errors' => $errors,
71
-                'values' => $values,
72
-            ];
73
-        }
69
+			return [
70
+				'errors' => $errors,
71
+				'values' => $values,
72
+			];
73
+		}
74 74
 
75
-        $message = [
76
-            "Name: {$_POST['name']}",
77
-            "Email: {$_POST['email']}",
78
-            '',
79
-            'Message:',
80
-            $_POST['message'],
81
-        ];
82
-        $message = implode("\n", $message);
75
+		$message = [
76
+			"Name: {$_POST['name']}",
77
+			"Email: {$_POST['email']}",
78
+			'',
79
+			'Message:',
80
+			$_POST['message'],
81
+		];
82
+		$message = implode("\n", $message);
83 83
 
84
-        global $container;
85
-        $container['mail']
86
-            ->addTo($container['config']->admin_email)
87
-            ->setSubject('Portfolio Contact')
88
-            ->setPlainMessage($message)
89
-            ->send();
84
+		global $container;
85
+		$container['mail']
86
+			->addTo($container['config']->admin_email)
87
+			->setSubject('Portfolio Contact')
88
+			->setPlainMessage($message)
89
+			->send();
90 90
 
91
-        return [
92
-            'success' =>
93
-                "Thank you for your message, {$_POST['name']}! " .
94
-                "I'll get back to you as soon as possible."
95
-        ];
96
-    }
91
+		return [
92
+			'success' =>
93
+				"Thank you for your message, {$_POST['name']}! " .
94
+				"I'll get back to you as soon as possible."
95
+		];
96
+	}
97 97
 }
Please login to merge, or discard this patch.
utility/URLDecode.class.inc.php 1 patch
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -24,21 +24,21 @@
 block discarded – undo
24 24
 		
25 25
 		self::$array['host'] = $host;
26 26
 		
27
-    if (
28
-      $host == 'www.waterfallsofthekeweenaw.com' ||
29
-      $host == 'waterfallsofthekeweenaw.com'
30
-    ) {
27
+	if (
28
+	  $host == 'www.waterfallsofthekeweenaw.com' ||
29
+	  $host == 'waterfallsofthekeweenaw.com'
30
+	) {
31 31
 			self::$array['site'] = 'waterfalls';
32 32
 		} else {
33 33
 			self::$array['site'] = substr($host, 0, strpos($host, '.'));
34 34
 		}
35 35
 
36
-    $base = '';
37
-    $base .= (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') ? 'https' : 'http';
38
-    $base .= '://';
39
-    $base .= (!Loader::isLive()) ? 'dev.' : '';
40
-    $base .= $host;
41
-    $base .= '/';
36
+	$base = '';
37
+	$base .= (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') ? 'https' : 'http';
38
+	$base .= '://';
39
+	$base .= (!Loader::isLive()) ? 'dev.' : '';
40
+	$base .= $host;
41
+	$base .= '/';
42 42
 
43 43
 		self::$array['base'] = $base;
44 44
 		self::$array['uri'] = '/' . implode('/', $uri_array);
Please login to merge, or discard this patch.