[Pkg-owncloud-commits] [php-sabre-vobject] 163/341: Fix CS.

David Prévot taffit at moszumanska.debian.org
Tue Aug 11 13:35:44 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository php-sabre-vobject.

commit 58404ca549dca3dfbccb3c6d3693ea79a3a316fe
Author: Ivan Enderlin <ivan.enderlin at hoa-project.net>
Date:   Tue Jan 20 11:25:00 2015 +0100

    Fix CS.
---
 lib/Property/VCard/DateAndOrTime.php | 55 ++++++++++++++++++++----------------
 1 file changed, 30 insertions(+), 25 deletions(-)

diff --git a/lib/Property/VCard/DateAndOrTime.php b/lib/Property/VCard/DateAndOrTime.php
index d78b6a2..779daaa 100644
--- a/lib/Property/VCard/DateAndOrTime.php
+++ b/lib/Property/VCard/DateAndOrTime.php
@@ -158,42 +158,43 @@ class DateAndOrTime extends Property {
 
         // Year
         if (!is_null($parts['year'])) {
-            $dateStr.=$parts['year'];
+
+            $dateStr .= $parts['year'];
 
             if (!is_null($parts['month'])) {
                 // If a year and a month is set, we need to insert a separator
                 // dash.
-                $dateStr.='-';
+                $dateStr .= '-';
             }
 
         } else {
 
             if (!is_null($parts['month']) || !is_null($parts['date'])) {
                 // Inserting two dashes
-                $dateStr.='--';
+                $dateStr .= '--';
             }
 
         }
 
         // Month
         if (!is_null($parts['month'])) {
-            $dateStr.=$parts['month'];
+
+            $dateStr .= $parts['month'];
 
             if (isset($parts['date'])) {
                 // If month and date are set, we need the separator dash.
-                $dateStr.='-';
-            }
-        } else {
-            if (isset($parts['date'])) {
-                // If the month is empty, and a date is set, we need a 'empty
-                // dash'
-                $dateStr.='-';
+                $dateStr .= '-';
             }
+
+        } elseif (isset($parts['date'])) {
+            // If the month is empty, and a date is set, we need a 'empty
+            // dash'
+            $dateStr .= '-';
         }
 
         // Date
         if (!is_null($parts['date'])) {
-            $dateStr.=$parts['date'];
+            $dateStr .= $parts['date'];
         }
 
 
@@ -202,43 +203,45 @@ class DateAndOrTime extends Property {
             return [$dateStr];
         }
 
-        $dateStr.='T';
+        $dateStr .= 'T';
 
         // Hour
         if (!is_null($parts['hour'])) {
-            $dateStr.=$parts['hour'];
+
+            $dateStr .= $parts['hour'];
 
             if (!is_null($parts['minute'])) {
-                $dateStr.=':';
+                $dateStr .= ':';
             }
+
         } else {
             // We know either minute or second _must_ be set, so we insert a
             // dash for an empty value.
-            $dateStr.='-';
+            $dateStr .= '-';
         }
 
         // Minute
         if (!is_null($parts['minute'])) {
-            $dateStr.=$parts['minute'];
+
+            $dateStr .= $parts['minute'];
 
             if (!is_null($parts['second'])) {
-                $dateStr.=':';
-            }
-        } else {
-            if (isset($parts['second'])) {
-                // Dash for empty minute
-                $dateStr.='-';
+                $dateStr .= ':';
             }
+
+        } elseif (isset($parts['second'])) {
+            // Dash for empty minute
+            $dateStr .= '-';
         }
 
         // Second
         if (!is_null($parts['second'])) {
-            $dateStr.=$parts['second'];
+            $dateStr .= $parts['second'];
         }
 
         // Timezone
         if (!is_null($parts['timezone'])) {
-            $dateStr.=$parts['timezone'];
+            $dateStr .= $parts['timezone'];
         }
 
         return [$dateStr];
@@ -296,6 +299,7 @@ class DateAndOrTime extends Property {
 
         $messages = parent::validate($options);
         $value = $this->getValue();
+
         try {
             DateTimeParser::parseVCardDateTime($value);
         } catch (\InvalidArgumentException $e) {
@@ -305,6 +309,7 @@ class DateAndOrTime extends Property {
                 'node' => $this,
             ];
         }
+
         return $messages;
 
     }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/php-sabre-vobject.git



More information about the Pkg-owncloud-commits mailing list