Completed
Pull Request — master (#14)
by
unknown
05:41
created
src/Consumer.php 2 patches
Doc Comments   +11 added lines patch added patch discarded remove patch
@@ -80,6 +80,9 @@  discard block
 block discarded – undo
80 80
         return $page;
81 81
     }
82 82
 
83
+    /**
84
+     * @param string $content
85
+     */
83 86
     private function extractOpenGraphData($content)
84 87
     {
85 88
         $crawler = new Crawler($content);
@@ -92,6 +95,10 @@  discard block
 block discarded – undo
92 95
             // Create clean property array
93 96
             $props = Linq::from($ogMetaTags)
94 97
                 ->select(
98
+
99
+                    /**
100
+                     * @param string $tag
101
+                     */
95 102
                     function (\DOMElement $tag) use ($t) {
96 103
                         $name = strtolower(trim($tag->getAttribute($t)));
97 104
                         $value = trim($tag->getAttribute("content"));
@@ -106,6 +113,10 @@  discard block
 block discarded – undo
106 113
         // Create new object of the correct type
107 114
         $typeProperty = Linq::from($properties)
108 115
             ->firstOrNull(
116
+
117
+                /**
118
+                 * @param string $property
119
+                 */
109 120
                 function (Property $property) {
110 121
                     return $property->key === Property::TYPE;
111 122
                 }
Please login to merge, or discard this patch.
Spacing   +4 added lines, -5 removed lines patch added patch discarded remove patch
@@ -85,14 +85,14 @@  discard block
 block discarded – undo
85 85
         $crawler = new Crawler($content);
86 86
 
87 87
         $properties = [];
88
-        foreach(['name', 'property'] as $t)
88
+        foreach (['name', 'property'] as $t)
89 89
         {
90 90
             // Get all meta-tags starting with "og:"
91 91
             $ogMetaTags = $crawler->filter("meta[{$t}^='og:']");
92 92
             // Create clean property array
93 93
             $props = Linq::from($ogMetaTags)
94 94
                 ->select(
95
-                    function (\DOMElement $tag) use ($t) {
95
+                    function(\DOMElement $tag) use ($t) {
96 96
                         $name = strtolower(trim($tag->getAttribute($t)));
97 97
                         $value = trim($tag->getAttribute("content"));
98 98
                         return new Property($name, $value);
@@ -106,13 +106,12 @@  discard block
 block discarded – undo
106 106
         // Create new object of the correct type
107 107
         $typeProperty = Linq::from($properties)
108 108
             ->firstOrNull(
109
-                function (Property $property) {
109
+                function(Property $property) {
110 110
                     return $property->key === Property::TYPE;
111 111
                 }
112 112
             );
113 113
         switch ($typeProperty !== null ? $typeProperty->value : null) {
114
-            default:
115
-                $object = new Website();
114
+            default : $object = new Website();
116 115
                 break;
117 116
         }
118 117
 
Please login to merge, or discard this patch.
src/Objects/ObjectBase.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
             $name = $property->key;
130 130
             $value = $property->value;
131 131
 
132
-            switch($name) {
132
+            switch ($name) {
133 133
                 case Property::AUDIO:
134 134
                 case Property::AUDIO_URL:
135 135
                     $this->audios[] = new Audio($value);
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
 
236 236
     private function handleImageAttribute(Image $element, $name, $value)
237 237
     {
238
-        switch($name)
238
+        switch ($name)
239 239
         {
240 240
             case Property::IMAGE_HEIGHT:
241 241
                 $element->height = (int)$value;
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
 
258 258
     private function handleVideoAttribute(Video $element, $name, $value)
259 259
     {
260
-        switch($name)
260
+        switch ($name)
261 261
         {
262 262
             case Property::VIDEO_HEIGHT:
263 263
                 $element->height = (int)$value;
@@ -276,7 +276,7 @@  discard block
 block discarded – undo
276 276
 
277 277
     private function handleAudioAttribute(Audio $element, $name, $value)
278 278
     {
279
-        switch($name)
279
+        switch ($name)
280 280
         {
281 281
             case Property::AUDIO_TYPE:
282 282
                 $element->type = $value;
@@ -294,7 +294,7 @@  discard block
 block discarded – undo
294 294
 
295 295
     protected function convertToBoolean($value)
296 296
     {
297
-        switch(strtolower($value))
297
+        switch (strtolower($value))
298 298
         {
299 299
             case "1":
300 300
             case "true":
Please login to merge, or discard this patch.
src/Publisher.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@
 block discarded – undo
27 27
     public function generateHtml(ObjectBase $object)
28 28
     {
29 29
         $html = "";
30
-        $format = "<meta property=\"%s\" content=\"%s\"" . ($this->doctype == self::DOCTYPE_XHTML ? " />" : ">");
30
+        $format = "<meta property=\"%s\" content=\"%s\"".($this->doctype == self::DOCTYPE_XHTML ? " />" : ">");
31 31
 
32 32
         foreach ($object->getProperties() as $property) {
33 33
             if ($html !== "") {
Please login to merge, or discard this patch.