Completed
Push — master ( 6b9272...284840 )
by Jake
03:00
created
src/SEOGenerator.php 1 patch
Spacing   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
     public $defaults;
12 12
     public static $favicons;
13 13
     
14
-    public function __construct () {
14
+    public function __construct() {
15 15
         $this->defaults = [
16 16
             'title' => 'Home',
17 17
             'title-spacer' => ' – ',
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
         ];
32 32
     }
33 33
     
34
-    public function generateSEO (array $page)
34
+    public function generateSEO(array $page)
35 35
     {
36 36
         SEOTools::metatags()
37 37
             ->setTitleDefault($page['title-description'])
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
         }
67 67
     }
68 68
     
69
-    public function make (array $details, $view = null)
69
+    public function make(array $details, $view = null)
70 70
     {
71 71
         $this->defaults = array_replace($this->defaults, $details);
72 72
         
@@ -77,66 +77,66 @@  discard block
 block discarded – undo
77 77
         }
78 78
     }
79 79
     
80
-    public function get ()
80
+    public function get()
81 81
     {
82
-        return str_replace(PHP_EOL, '', SEOTools::generate()) . $this->getFavicons();
82
+        return str_replace(PHP_EOL, '', SEOTools::generate()).$this->getFavicons();
83 83
     }
84 84
     
85
-    public function setFavicons () 
85
+    public function setFavicons() 
86 86
     {
87 87
         $favicon_dir = insert_if_exists($this->defaults['icon_dir']);
88 88
         $colors = $this->defaults['colors'];
89 89
         self::$favicons =
90
-                insert_if_exists (['60x60', '72x72', '114x114', '120x120', '152x152', '180x180'], function ($insert) use ($favicon_dir) {
91
-                        return '<link rel="apple-touch-icon" sizes="' . $insert . '" href="' . asset($favicon_dir . '/apple-touch-icon-' . $insert . '.png').'">';
92
-                    }, function ($insert) use ($favicon_dir) {
90
+                insert_if_exists(['60x60', '72x72', '114x114', '120x120', '152x152', '180x180'], function($insert) use ($favicon_dir) {
91
+                        return '<link rel="apple-touch-icon" sizes="'.$insert.'" href="'.asset($favicon_dir.'/apple-touch-icon-'.$insert.'.png').'">';
92
+                    }, function($insert) use ($favicon_dir) {
93 93
                         return File::exists(public_path($favicon_dir.'/apple-touch-icon-'.$insert.'.png'));
94
-                    }) . 
95
-                insert_if_exists (['16x16', '32x32', '96x96', '194x194'], function ($insert) use ($favicon_dir) {
96
-                        return '<link rel="icon" type="image/png" href="' . asset($favicon_dir . '/favicon-' . $insert . '.png').'" sizes="'.$insert.'">';
97
-                    }, function ($insert) use ($favicon_dir) {
94
+                    }). 
95
+                insert_if_exists(['16x16', '32x32', '96x96', '194x194'], function($insert) use ($favicon_dir) {
96
+                        return '<link rel="icon" type="image/png" href="'.asset($favicon_dir.'/favicon-'.$insert.'.png').'" sizes="'.$insert.'">';
97
+                    }, function($insert) use ($favicon_dir) {
98 98
                         return File::exists(public_path($favicon_dir.'/favicon-'.$insert.'.png'));
99
-                    }) . 
100
-                insert_if_exists (['192x192'], function ($insert) use ($favicon_dir) {
101
-                        return '<link rel="icon" type="image/png" href="' . asset($favicon_dir . '/android-chrome-' . $insert . '.png').'" sizes="'.$insert.'">';
102
-                    }, function ($insert) use ($favicon_dir) {
99
+                    }). 
100
+                insert_if_exists(['192x192'], function($insert) use ($favicon_dir) {
101
+                        return '<link rel="icon" type="image/png" href="'.asset($favicon_dir.'/android-chrome-'.$insert.'.png').'" sizes="'.$insert.'">';
102
+                    }, function($insert) use ($favicon_dir) {
103 103
                         return File::exists(public_path($favicon_dir.'/android-chrome-'.$insert.'.png'));
104
-                    }) . 
105
-                insert_if_exists ($favicon_dir.'/manifest.json', function ($insert) {
106
-                        return '<link rel="manifest" href="' . asset($insert) . '">';
107
-                    }, function ($insert) {
104
+                    }). 
105
+                insert_if_exists($favicon_dir.'/manifest.json', function($insert) {
106
+                        return '<link rel="manifest" href="'.asset($insert).'">';
107
+                    }, function($insert) {
108 108
                         return File::exists(public_path($insert));
109
-                    }) . 
110
-                insert_if_exists ($favicon_dir.'/safari-pinned-tab.svg', function ($insert) use ($colors) {
111
-                        return '<link rel="mask-icon" href="'.asset($insert).'" color="' . insert_if_exists($colors['safari_pinned']) . '">';
112
-                    }, function ($insert) {
109
+                    }). 
110
+                insert_if_exists($favicon_dir.'/safari-pinned-tab.svg', function($insert) use ($colors) {
111
+                        return '<link rel="mask-icon" href="'.asset($insert).'" color="'.insert_if_exists($colors['safari_pinned']).'">';
112
+                    }, function($insert) {
113 113
                         return File::exists(public_path($insert));
114
-                    }) . 
115
-                insert_if_exists ($favicon_dir.'/favicon.ico', function ($insert) {
114
+                    }). 
115
+                insert_if_exists($favicon_dir.'/favicon.ico', function($insert) {
116 116
                         return '<link rel="shortcut icon" href="'.asset($insert).'">';
117
-                    }, function ($insert) {
117
+                    }, function($insert) {
118 118
                         return File::exists(public_path($insert));
119
-                    }) . 
120
-                insert_if_exists ($favicon_dir.'/mstile-144x144.png', function ($insert) {
119
+                    }). 
120
+                insert_if_exists($favicon_dir.'/mstile-144x144.png', function($insert) {
121 121
                         return '<meta name="msapplication-TileImage" content="'.asset($insert).'">';
122
-                    }, function ($insert) {
122
+                    }, function($insert) {
123 123
                         return File::exists(public_path($insert));
124
-                    }) . 
125
-                insert_if_exists ($favicon_dir.'/browserconfig.xml', function ($insert) {
124
+                    }). 
125
+                insert_if_exists($favicon_dir.'/browserconfig.xml', function($insert) {
126 126
                         return '<meta name="msapplication-config" content="'.asset($insert).'">';
127
-                    }, function ($insert) {
127
+                    }, function($insert) {
128 128
                         return File::exists(public_path($insert));
129
-                    }) . 
130
-                insert_if_exists ($colors['ms_tile'], function ($insert) {
129
+                    }). 
130
+                insert_if_exists($colors['ms_tile'], function($insert) {
131 131
                         return '<meta name="msapplication-TileColor" content="'.$insert.'">';
132
-                    }) . 
133
-                insert_if_exists ($colors['theme'], function ($insert) {
132
+                    }). 
133
+                insert_if_exists($colors['theme'], function($insert) {
134 134
                         return '<meta name="theme-color" content="'.$insert.'">';
135 135
                     });
136 136
         return self::$favicons;
137 137
     }
138 138
     
139
-    public function getFavicons () 
139
+    public function getFavicons() 
140 140
     {
141 141
         if (is_null(self::$favicons)) {
142 142
             return $this->setFavicons();
Please login to merge, or discard this patch.