Passed
Branch master (5ce1b0)
by Stefan
02:04
created
Category
SKien/JsonLD/JsonLD.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
      * @param int $iType        internal type
54 54
      * @param string $strType   type for JsonLD
55 55
      */
56
-    public function __construct($iType, $strType, $bIsChild=false)
56
+    public function __construct($iType, $strType, $bIsChild = false)
57 57
     {
58 58
         $this->iType = $iType;
59 59
         $this->bIsChild = $bIsChild;
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
      * @param mixed $longitude      string/float
81 81
      * @param string $strMap        URL to map show the location
82 82
      */
83
-    public function setLocation($strName, $latitude, $longitude, $strMap='')
83
+    public function setLocation($strName, $latitude, $longitude, $strMap = '')
84 84
     {
85 85
         $aLocation = $this->buildLocation($strName, $latitude, $longitude, $strMap);
86 86
         if ($aLocation != null) {
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
      * @param string $strCountry
151 151
      * @return array    array containing the property
152 152
      */
153
-    public function buildAdress($strStreet, $strPostcode, $strCity, $strRegion='', $strCountry='')
153
+    public function buildAdress($strStreet, $strPostcode, $strCity, $strRegion = '', $strCountry = '')
154 154
     {
155 155
         $aAdress = array("@type" => "PostalAddress");
156 156
         if (strlen($strStreet) > 0) {
@@ -226,10 +226,10 @@  discard block
 block discarded – undo
226 226
         if (strlen($strType) > 0) {
227 227
             $aCP = array("@type" => "ContactPoint");
228 228
             $aCP["contactType"] = $strType;
229
-            if (strlen($strEMail) > 0 ) {
229
+            if (strlen($strEMail) > 0) {
230 230
                 $aCP["email"] = $strEMail;
231 231
             }
232
-            if (strlen($strPhone) > 0 ) {
232
+            if (strlen($strPhone) > 0) {
233 233
                 $aCP["telephone"] = $strPhone;
234 234
             }
235 235
         }
@@ -249,7 +249,7 @@  discard block
 block discarded – undo
249 249
      * @param int $iType
250 250
      * @param string $strFormat
251 251
      */
252
-    public function setProperty($strName, $strValue, $iType=self::STRING, $strFormat='')
252
+    public function setProperty($strName, $strValue, $iType = self::STRING, $strFormat = '')
253 253
     {
254 254
         switch ($iType) {
255 255
             case self::DATE:
@@ -279,7 +279,7 @@  discard block
 block discarded – undo
279 279
      * @param bool $bPrettyPrint
280 280
      * @return string
281 281
      */
282
-    public function getHTMLHeadTag($bPrettyPrint=false)
282
+    public function getHTMLHeadTag($bPrettyPrint = false)
283 283
     {
284 284
         $strTag = '';
285 285
         if (!$this->bIsChild) {
@@ -295,7 +295,7 @@  discard block
 block discarded – undo
295 295
      * @param bool $bPrettyPrint
296 296
      * @return string
297 297
      */
298
-    public function getJson($bPrettyPrint=false)
298
+    public function getJson($bPrettyPrint = false)
299 299
     {
300 300
         $strJson = json_encode($this->aJsonLD, $bPrettyPrint ? JSON_PRETTY_PRINT : 0);
301 301
         return $strJson;
@@ -367,7 +367,7 @@  discard block
 block discarded – undo
367 367
         if (count($aTime) == 2) {
368 368
             $iHour = intval($aTime[0]);
369 369
             $iMin = intval($aTime[1]);
370
-            if ($iHour >= 0 && $iHour < 24 && $iMin >= 0 && $iMin <60) {
370
+            if ($iHour >= 0 && $iHour < 24 && $iMin >= 0 && $iMin < 60) {
371 371
                 $strTime = sprintf('%02d:%02d', $iHour, $iMin);
372 372
             }
373 373
         }
@@ -411,7 +411,7 @@  discard block
 block discarded – undo
411 411
      * @param int       $iMaxLen
412 412
      * @param bool      $bHardBreak
413 413
      */
414
-    static public function strTruncateEllipsis($strText, $iMaxLen, $bHardBreak=false)
414
+    static public function strTruncateEllipsis($strText, $iMaxLen, $bHardBreak = false)
415 415
     {
416 416
         if (strlen($strText) > $iMaxLen - 3 && $iMaxLen > 4) {
417 417
             $strText = substr($strText, 0, $iMaxLen - 3);
Please login to merge, or discard this patch.
SKien/JsonLD/JsonLDLocalBusiness.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
      * 
76 76
      * @see DocJsonLDLocalBusinessType
77 77
      */
78
-    public function __construct($strType='Organization', $bIsChild=false)
78
+    public function __construct($strType = 'Organization', $bIsChild = false)
79 79
     {
80 80
         parent::__construct(self::LOCAL_BUSINESS, $strType, $bIsChild);
81 81
         if (!$bIsChild) {
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
      * @param string $strURL
95 95
      * @param string $strId
96 96
      */
97
-    public function setURL($strURL, $strId='')
97
+    public function setURL($strURL, $strId = '')
98 98
     {
99 99
         $strURL = $this->validURL($strURL);
100 100
         $strId = $this->validString($strId);
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
      * @param string $strEMail      recommended property
115 115
      * @param string $strPhone      recommended property
116 116
      */
117
-    public function setInfo($strName, $strEMail='', $strPhone='')
117
+    public function setInfo($strName, $strEMail = '', $strPhone = '')
118 118
     {
119 119
         $strEMail = $this->validEMail($strEMail);
120 120
         $strName = $this->validString($strName);
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
      * @param string $strRegion     (default: '')
144 144
      * @param string $strCountry    (default: '')
145 145
      */
146
-    public function setAdress($strStreet, $strPostcode, $strCity, $strRegion='', $strCountry='') 
146
+    public function setAdress($strStreet, $strPostcode, $strCity, $strRegion = '', $strCountry = '') 
147 147
     {
148 148
         $this->aJsonLD["address"] = $this->buildAdress($strStreet, $strPostcode, $strCity, $strRegion, $strCountry);
149 149
     }
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
      * @param string $strPhone
214 214
      * @return int  index of the added contact point
215 215
      */
216
-    public function addContact($strType, $strEMail='', $strPhone='')
216
+    public function addContact($strType, $strEMail = '', $strPhone = '')
217 217
     {
218 218
         $iIndex = -1;
219 219
         $aCP = $this->buildContactPoint($strType, $strEMail, $strPhone);
@@ -295,7 +295,7 @@  discard block
 block discarded – undo
295 295
             }
296 296
             $iIndex = count($this->aJsonLD["location"]["openingHoursSpecification"]);
297 297
             $aOHS = array("@type" => "OpeningHoursSpecification");
298
-            $aDayOfWeek = array("Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunnday");
298
+            $aDayOfWeek = array("Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunnday");
299 299
             for ($i = 0; $i < 7; $i++) {
300 300
                 if ($aWeekdays[$i] != 1) {
301 301
                     unset($aDayOfWeek[$i]);
Please login to merge, or discard this patch.
SKien/JsonLD/JsonLDArticle.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
      * WebPage with @id = $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']
57 57
      * @param string $strType
58 58
      */ 
59
-    public function __construct($strType='NewsArticle')
59
+    public function __construct($strType = 'NewsArticle')
60 60
     {
61 61
         parent::__construct(self::ARTICLE, $strType);
62 62
         $this->aJsonLD["mainEntityOfPage"] = array(
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
      * @param string $strEMail
73 73
      * @param string $strPhone
74 74
      */
75
-    public function setPublisher($strName, $strEMail='', $strPhone='')
75
+    public function setPublisher($strName, $strEMail = '', $strPhone = '')
76 76
     {
77 77
         $strName = $this->validString($strName);
78 78
         $strEMail = $this->validEMail($strEMail);
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
      * @param mixed $published          can be string (format YYYY-MM-DD HH:ii:ss), int (unixtimestamp) or DateTime - object
115 115
      * @param mixed $modified           can be string (format YYYY-MM-DD HH:ii:ss), int (unixtimestamp) or DateTime - object
116 116
      */
117
-    public function setInfo($strHeadline, $strDescription, $published, $modified=null)
117
+    public function setInfo($strHeadline, $strDescription, $published, $modified = null)
118 118
     {
119 119
         $strHeadline = $this->validString($strHeadline);
120 120
         $strHeadline = $this->strTruncateEllipsis($strHeadline, 110);
Please login to merge, or discard this patch.
SKien/JsonLD/JsonLDEvent.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
      * @param mixed $start      can be string (format YYYY-MM-DD HH:ii:ss), int (unixtimestamp) or DateTime - object
97 97
      * @param mixed $end        can be string (format YYYY-MM-DD HH:ii:ss), int (unixtimestamp) or DateTime - object
98 98
      */
99
-    public function setInfo($strName, $start, $end=null)
99
+    public function setInfo($strName, $start, $end = null)
100 100
     {
101 101
         $strName = $this->validString($strName);
102 102
         if (strlen($strName) > 0) {
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
      * @param string $strRegion     (default: '')
121 121
      * @param string $strCountry    (default: '')
122 122
      */
123
-    public function setAdress($strStreet, $strPostcode, $strCity, $strRegion='', $strCountry='')
123
+    public function setAdress($strStreet, $strPostcode, $strCity, $strRegion = '', $strCountry = '')
124 124
     {
125 125
         $aAddress = $this->buildAdress($strStreet, $strPostcode, $strCity, $strRegion, $strCountry);
126 126
         if ($aAddress != null) {
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
      * @param string $strStatus
181 181
      * @param mixed $prevstart      can be string (format YYYY-MM-DD HH:ii:ss), int (unixtimestamp) or DateTime - object
182 182
      */
183
-    public function setStatus($strStatus, $prevstart=null)
183
+    public function setStatus($strStatus, $prevstart = null)
184 184
     {
185 185
         $aValid = array('EventScheduled', 'EventCancelled', 'EventMovedOnline', 'EventPostponed', 'EventRescheduled');
186 186
         if (in_array($strStatus, $aValid)) {
@@ -205,12 +205,12 @@  discard block
 block discarded – undo
205 205
      * @param mixed     $validFrom        Offer valid from, may be string (format YYYY-MM-DD HH:ii:ss), int (unixtimestamp) or DateTime - object
206 206
      * @param string    $strURL           landing page that clearly and predominantly provides the opportunity to buy a ticket 
207 207
      */
208
-    public function addOffer($strName, $dftPrice, $strCur, $strAvailable=self::AVAILABLE_IN_STOCK, $validFrom=null, $strURL='')
208
+    public function addOffer($strName, $dftPrice, $strCur, $strAvailable = self::AVAILABLE_IN_STOCK, $validFrom = null, $strURL = '')
209 209
     {
210 210
         $aValid = array('InStock', 'SoldOut', 'PreOrder');
211 211
         if (in_array($strAvailable, $aValid)) {
212 212
             $strName = $this->validString($strName);
213
-            $strCur =  strtoupper($this->validString($strCur));
213
+            $strCur = strtoupper($this->validString($strCur));
214 214
             $strURL = $this->validURL($strURL);
215 215
             if (!isset($this->aJsonLD['offers'])) {
216 216
                 $this->aJsonLD['offers'] = array();
@@ -249,7 +249,7 @@  discard block
 block discarded – undo
249 249
      * @param string $strURL
250 250
      * @param string $strType
251 251
      */
252
-    public function setOrganizer($strName, $strURL='', $strType=self::ORGANIZATION)
252
+    public function setOrganizer($strName, $strURL = '', $strType = self::ORGANIZATION)
253 253
     {
254 254
         $aValid = array('PerformingGroup', 'Person', 'Organization');
255 255
         $strName = $this->validString($strName);
@@ -276,7 +276,7 @@  discard block
 block discarded – undo
276 276
      * @param string $strURL
277 277
      * @param string $strType
278 278
      */
279
-    public function addPerformer($strName, $strURL='', $strType=self::GROUP)
279
+    public function addPerformer($strName, $strURL = '', $strType = self::GROUP)
280 280
     {
281 281
         $aValid = array('PerformingGroup', 'Person', 'Organization');
282 282
         $strName = $this->validString($strName);
Please login to merge, or discard this patch.
EventTest.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -14,14 +14,14 @@  discard block
 block discarded – undo
14 14
 $oJsonLD->setOrganizer('Queen Mum', 'https://www.lissyII.uk');
15 15
 $oJsonLD->addPerformer('U2');
16 16
 $oJsonLD->addPerformer('Elton John');
17
-$oJsonLD->addImage('elephpant.png');    // use bigger image - only for test purposes to avoid warning from test tool
17
+$oJsonLD->addImage('elephpant.png'); // use bigger image - only for test purposes to avoid warning from test tool
18 18
 ?>
19 19
 <!DOCTYPE html>
20 20
 <html>
21 21
 <head>
22 22
 <title>Json LD Generator</title>
23 23
 <!-- insert the tag in the head section of the document -->
24
-<?php echo $oJsonLD->getHTMLHeadTag(false);?>
24
+<?php echo $oJsonLD->getHTMLHeadTag(false); ?>
25 25
 </head>
26 26
 <body>
27 27
     <h1>Json LD Generator - Event</h1>
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
         </a>
32 32
     </p>
33 33
     <textarea style="font-family: 'Courier'; width: 100%; white-space: nowrap;" rows="50" spellcheck="false">
34
-    <?php echo $oJsonLD->getJson(true);?>
34
+    <?php echo $oJsonLD->getJson(true); ?>
35 35
     </textarea>
36 36
 </body>
37 37
 </html>
Please login to merge, or discard this patch.
ArticleTest.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -9,14 +9,14 @@  discard block
 block discarded – undo
9 9
 $oJsonLD->setLogo('elephpant.png');
10 10
 $oJsonLD->setInfo('New Outdoor climbing facilitry opened', '... and the article...', new DateTime('2020-05-12'), new DateTime('2020-05-13 22:13:42'));
11 11
 $oJsonLD->setAuthor('Stefanius');
12
-$oJsonLD->addImage('elephpant.png');    // use bigger image - only for test purposes to avoid warning from test tool
12
+$oJsonLD->addImage('elephpant.png'); // use bigger image - only for test purposes to avoid warning from test tool
13 13
 ?>
14 14
 <!DOCTYPE html>
15 15
 <html>
16 16
 <head>
17 17
 <title>Json LD Generator</title>
18 18
 <!-- insert the tag in the head section of the document -->
19
-<?php echo $oJsonLD->getHTMLHeadTag(false);?>
19
+<?php echo $oJsonLD->getHTMLHeadTag(false); ?>
20 20
 </head>
21 21
 <body>
22 22
     <h1>Json LD Generator - Article</h1>
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
         </a>
27 27
     </p>
28 28
     <textarea style="font-family: 'Courier'; width: 100%; white-space: nowrap;" rows="50" spellcheck="false">
29
-    <?php echo $oJsonLD->getJson(true);?>
29
+    <?php echo $oJsonLD->getJson(true); ?>
30 30
     </textarea>
31 31
 </body>
32 32
 </html>
Please login to merge, or discard this patch.
BusinessTest.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
 $oJsonLD->setAdress('Street 12', '12345', 'MyTown', '', 'Germany');
11 11
 $oJsonLD->setLocation(48.3365629, 7.8447896, 'https://www.google.de/maps/place/DAV-Kletterzentrum+Lahr/@48.3365629,7.8447896,156m/data=!3m1!1e3!4m5!3m4!1s0x47912e4949b57841:0xc26f08dacee0a1a9!8m2!3d48.3367173!4d7.8441243');
12 12
 $oJsonLD->setLogo('elephpant.png');
13
-$oJsonLD->addImage('elephpant.png');    // use bigger image - only for test purposes to avoid warning from test tool
13
+$oJsonLD->addImage('elephpant.png'); // use bigger image - only for test purposes to avoid warning from test tool
14 14
 $oJsonLD->addLanguage('de');
15 15
 $oJsonLD->setPriceRange('$$$');
16 16
 
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
 <head>
29 29
 <title>Json LD Generator</title>
30 30
 <!-- insert the tag in the head section of the document -->
31
-<?php echo $oJsonLD->getHTMLHeadTag(false);?>
31
+<?php echo $oJsonLD->getHTMLHeadTag(false); ?>
32 32
 </head>
33 33
 <body>
34 34
     <h1>Json LD Generator - Local Business</h1>
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
         </a>
39 39
     </p>
40 40
     <textarea style="font-family: 'Courier'; width: 100%; white-space: nowrap;" rows="50" spellcheck="false">
41
-    <?php echo $oJsonLD->getJson(true);?>
41
+    <?php echo $oJsonLD->getJson(true); ?>
42 42
     </textarea>
43 43
 </body>
44 44
 </html>
Please login to merge, or discard this patch.