[Pkg-owncloud-commits] [php-sabre-vobject] 04/16: Fixing coding standards.

David Prévot taffit at moszumanska.debian.org
Mon Jul 21 19:19:14 UTC 2014


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 a7fc4578d92890173330e3e543f942f2e58435b2
Author: Evert Pot <me at evertpot.com>
Date:   Wed Jun 25 15:13:39 2014 -0400

    Fixing coding standards.
---
 lib/Sabre/VObject/Cli.php                         | 47 +++++++++++++----------
 lib/Sabre/VObject/Component.php                   | 13 ++++---
 lib/Sabre/VObject/Component/VEvent.php            |  2 +-
 lib/Sabre/VObject/DateTimeParser.php              |  6 ++-
 lib/Sabre/VObject/ElementList.php                 |  2 +-
 lib/Sabre/VObject/EofException.php                |  4 +-
 lib/Sabre/VObject/Node.php                        |  6 +--
 lib/Sabre/VObject/Parameter.php                   | 44 ++++++++++++---------
 lib/Sabre/VObject/ParseException.php              |  3 +-
 lib/Sabre/VObject/Parser/Json.php                 | 20 ++++++----
 lib/Sabre/VObject/Parser/MimeDir.php              | 35 +++++++++--------
 lib/Sabre/VObject/Property/Float.php              |  9 +++--
 lib/Sabre/VObject/Property/ICalendar/DateTime.php | 28 +++++++++-----
 lib/Sabre/VObject/Property/ICalendar/Period.php   |  9 +++--
 lib/Sabre/VObject/Property/Text.php               | 17 ++++----
 lib/Sabre/VObject/Property/Uri.php                |  2 +-
 lib/Sabre/VObject/Reader.php                      |  4 +-
 lib/Sabre/VObject/RecurrenceIterator.php          |  4 +-
 lib/Sabre/VObject/Splitter/ICalendar.php          |  2 +-
 lib/Sabre/VObject/Splitter/SplitterInterface.php  |  4 +-
 lib/Sabre/VObject/StringUtil.php                  |  4 +-
 lib/Sabre/VObject/TimeZoneUtil.php                |  2 +-
 lib/Sabre/VObject/UUIDUtil.php                    |  9 +++--
 lib/Sabre/VObject/VCardConverter.php              |  2 +-
 tests/phpcs/ruleset.xml                           | 11 ++----
 25 files changed, 167 insertions(+), 122 deletions(-)

diff --git a/lib/Sabre/VObject/Cli.php b/lib/Sabre/VObject/Cli.php
index ae4b88c..cac0763 100644
--- a/lib/Sabre/VObject/Cli.php
+++ b/lib/Sabre/VObject/Cli.php
@@ -102,13 +102,13 @@ class Cli {
         // We cannot easily test this, so we'll skip it. Pretty basic anyway.
 
         if (!$this->stderr) {
-            $this->stderr = fopen('php://stderr','w');
+            $this->stderr = fopen('php://stderr', 'w');
         }
         if (!$this->stdout) {
-            $this->stdout = fopen('php://stdout','w');
+            $this->stdout = fopen('php://stdout', 'w');
         }
         if (!$this->stdin) {
-            $this->stdin = fopen('php://stdin','r');
+            $this->stdin = fopen('php://stdin', 'r');
         }
 
         // @codeCoverageIgnoreEnd
@@ -223,7 +223,7 @@ class Cli {
 
         } catch (InvalidArgumentException $e) {
             $this->showHelp();
-            $this->log('Error: ' . $e->getMessage(),'red');
+            $this->log('Error: ' . $e->getMessage(), 'red');
             return 1;
         }
 
@@ -233,11 +233,11 @@ class Cli {
         $this->outputPath = isset($positional[2])?$positional[2]:'-';
 
         if ($this->outputPath !== '-') {
-            $this->stdout = fopen($this->outputPath,'w');
+            $this->stdout = fopen($this->outputPath, 'w');
         }
 
         if (!$this->inputFormat) {
-            if (substr($this->inputPath,-5)==='.json') {
+            if (substr($this->inputPath, -5)==='.json') {
                 $this->inputFormat = 'json';
             } else {
                 $this->inputFormat = 'mimedir';
@@ -302,14 +302,15 @@ class Cli {
         $this->log($this->colorize('green', '  repair') . ' source_file [output_file]  Repairs a file.');
         $this->log($this->colorize('green', '  convert') . ' source_file [output_file] Converts a file.');
         $this->log($this->colorize('green', '  color') . ' source_file                 Colorize a file, useful for debbugging.');
-        $this->log(<<<HELP
+        $this->log(
+<<<HELP
 
 If source_file is set as '-', STDIN will be used.
 If output_file is omitted, STDOUT will be used.
 All other output is sent to STDERR.
 
 HELP
-    );
+        );
 
         $this->log('Examples:', 'yellow');
         $this->log('   vobject convert contact.vcf contact.json');
@@ -576,14 +577,17 @@ HELP
         };
 
         $tmp = $vObj->children;
-        uksort($vObj->children, function($a, $b) use ($sortScore, $tmp) {
+        uksort(
+            $vObj->children,
+            function($a, $b) use ($sortScore, $tmp) {
 
-            $sA = $sortScore($a, $tmp);
-            $sB = $sortScore($b, $tmp);
+                $sA = $sortScore($a, $tmp);
+                $sB = $sortScore($b, $tmp);
 
-            return $sA - $sB;
+                return $sA - $sB;
 
-        });
+            }
+        );
 
         foreach($vObj->children as $child) {
             if ($child instanceof Component) {
@@ -648,13 +652,16 @@ HELP
                         $this->cWrite('red', ',');
                     }
 
-                    $subPart = strtr($subPart, array(
-                        '\\' => $this->colorize('purple', '\\\\', 'green'),
-                        ';'  => $this->colorize('purple', '\;', 'green'),
-                        ','  => $this->colorize('purple', '\,', 'green'),
-                        "\n" => $this->colorize('purple', "\\n\n\t", 'green'),
-                        "\r" => "",
-                    ));
+                    $subPart = strtr(
+                        $subPart,
+                        array(
+                            '\\' => $this->colorize('purple', '\\\\', 'green'),
+                            ';'  => $this->colorize('purple', '\;', 'green'),
+                            ','  => $this->colorize('purple', '\,', 'green'),
+                            "\n" => $this->colorize('purple', "\\n\n\t", 'green'),
+                            "\r" => "",
+                        )
+                    );
 
                     $this->cWrite('green', $subPart);
                 }
diff --git a/lib/Sabre/VObject/Component.php b/lib/Sabre/VObject/Component.php
index d27d959..00e2694 100644
--- a/lib/Sabre/VObject/Component.php
+++ b/lib/Sabre/VObject/Component.php
@@ -272,14 +272,17 @@ class Component extends Node {
         };
 
         $tmp = $this->children;
-        uksort($this->children, function($a, $b) use ($sortScore, $tmp) {
+        uksort(
+            $this->children,
+            function($a, $b) use ($sortScore, $tmp) {
 
-            $sA = $sortScore($a, $tmp);
-            $sB = $sortScore($b, $tmp);
+                $sA = $sortScore($a, $tmp);
+                $sB = $sortScore($b, $tmp);
 
-            return $sA - $sB;
+                return $sA - $sB;
 
-        });
+            }
+        );
 
         foreach($this->children as $child) $str.=$child->serialize();
         $str.= "END:" . $this->name . "\r\n";
diff --git a/lib/Sabre/VObject/Component/VEvent.php b/lib/Sabre/VObject/Component/VEvent.php
index 3d0dbb6..0a9a2e9 100644
--- a/lib/Sabre/VObject/Component/VEvent.php
+++ b/lib/Sabre/VObject/Component/VEvent.php
@@ -54,7 +54,7 @@ class VEvent extends VObject\Component {
 
         } elseif (isset($this->DURATION)) {
             $effectiveEnd = clone $effectiveStart;
-            $effectiveEnd->add( VObject\DateTimeParser::parseDuration($this->DURATION) );
+            $effectiveEnd->add(VObject\DateTimeParser::parseDuration($this->DURATION));
         } elseif (!$this->DTSTART->hasTime()) {
             $effectiveEnd = clone $effectiveStart;
             $effectiveEnd->modify('+1 day');
diff --git a/lib/Sabre/VObject/DateTimeParser.php b/lib/Sabre/VObject/DateTimeParser.php
index 838f78e..e702b40 100644
--- a/lib/Sabre/VObject/DateTimeParser.php
+++ b/lib/Sabre/VObject/DateTimeParser.php
@@ -25,7 +25,7 @@ class DateTimeParser {
      * @param DateTimeZone $tz
      * @return DateTime
      */
-    static public function parseDateTime($dt,\DateTimeZone $tz = null) {
+    static public function parseDateTime($dt, \DateTimeZone $tz = null) {
 
         // Format is YYYYMMDD + "T" + hhmmss
         $result = preg_match('/^([0-9]{4})([0-1][0-9])([0-3][0-9])T([0-2][0-9])([0-5][0-9])([0-5][0-9])([Z]?)$/',$dt,$matches);
@@ -153,7 +153,9 @@ class DateTimeParser {
         }
 
         $newDur = ($matches['plusminus']==='-'?'-':'+') . trim($newDur);
-        if ($newDur === '+') { $newDur = '+0 seconds'; };
+        if ($newDur === '+') {
+            $newDur = '+0 seconds';
+        };
         return $newDur;
 
     }
diff --git a/lib/Sabre/VObject/ElementList.php b/lib/Sabre/VObject/ElementList.php
index 87c3bba..d0c4ed8 100644
--- a/lib/Sabre/VObject/ElementList.php
+++ b/lib/Sabre/VObject/ElementList.php
@@ -147,7 +147,7 @@ class ElementList implements \Iterator, \Countable, \ArrayAccess {
      * @param mixed $value
      * @return void
      */
-    public function offsetSet($offset,$value) {
+    public function offsetSet($offset, $value) {
 
         throw new \LogicException('You can not add new objects to an ElementList');
 
diff --git a/lib/Sabre/VObject/EofException.php b/lib/Sabre/VObject/EofException.php
index 3a005a9..bc784b3 100644
--- a/lib/Sabre/VObject/EofException.php
+++ b/lib/Sabre/VObject/EofException.php
@@ -10,4 +10,6 @@ namespace Sabre\VObject;
  * @author Evert Pot (http://evertpot.com/)
  * @license http://sabre.io/license/ Modified BSD License
  */
-class EofException extends ParseException { }
+class EofException extends ParseException {
+
+}
diff --git a/lib/Sabre/VObject/Node.php b/lib/Sabre/VObject/Node.php
index 2caebda..29bae61 100644
--- a/lib/Sabre/VObject/Node.php
+++ b/lib/Sabre/VObject/Node.php
@@ -42,7 +42,7 @@ abstract class Node implements \IteratorAggregate, \ArrayAccess, \Countable {
      *
      * @return string
      */
-    abstract function serialize();
+    abstract public function serialize();
 
     /**
      * This method returns an array, with the representation as it should be
@@ -50,7 +50,7 @@ abstract class Node implements \IteratorAggregate, \ArrayAccess, \Countable {
      *
      * @return array
      */
-    abstract function jsonSerialize();
+    abstract public function jsonSerialize();
 
     /* {{{ IteratorAggregator interface */
 
@@ -169,7 +169,7 @@ abstract class Node implements \IteratorAggregate, \ArrayAccess, \Countable {
      * @param mixed $value
      * @return void
      */
-    public function offsetSet($offset,$value) {
+    public function offsetSet($offset, $value) {
 
         $iterator = $this->getIterator();
         $iterator->offsetSet($offset,$value);
diff --git a/lib/Sabre/VObject/Parameter.php b/lib/Sabre/VObject/Parameter.php
index 2995fa1..9750d78 100644
--- a/lib/Sabre/VObject/Parameter.php
+++ b/lib/Sabre/VObject/Parameter.php
@@ -280,26 +280,32 @@ class Parameter extends Node {
 
         }
 
-        return $this->name . '=' . array_reduce($value, function($out, $item) {
-
-            if (!is_null($out)) $out.=',';
-
-            // If there's no special characters in the string, we'll use the simple
-            // format
-            if (!preg_match('#(?: [\n":;\^,] )#x', $item)) {
-                return $out.$item;
-            } else {
-                // Enclosing in double-quotes, and using RFC6868 for encoding any
-                // special characters
-                $out.='"' . strtr($item, array(
-                    '^'  => '^^',
-                    "\n" => '^n',
-                    '"'  => '^\'',
-                )) . '"';
-                return $out;
-            }
+        return $this->name . '=' . array_reduce(
+            $value,
+            function($out, $item) {
+
+                if (!is_null($out)) $out.=',';
+
+                // If there's no special characters in the string, we'll use the simple
+                // format
+                if (!preg_match('#(?: [\n":;\^,] )#x', $item)) {
+                    return $out.$item;
+                } else {
+                    // Enclosing in double-quotes, and using RFC6868 for encoding any
+                    // special characters
+                    $out.='"' . strtr(
+                        $item,
+                        array(
+                            '^'  => '^^',
+                            "\n" => '^n',
+                            '"'  => '^\'',
+                        )
+                    ) . '"';
+                    return $out;
+                }
 
-        });
+            }
+        );
 
     }
 
diff --git a/lib/Sabre/VObject/ParseException.php b/lib/Sabre/VObject/ParseException.php
index d5648d2..f6d03cf 100644
--- a/lib/Sabre/VObject/ParseException.php
+++ b/lib/Sabre/VObject/ParseException.php
@@ -9,4 +9,5 @@ namespace Sabre\VObject;
  * @author Evert Pot (http://evertpot.com/)
  * @license http://sabre.io/license/ Modified BSD License
  */
-class ParseException extends \Exception { }
+class ParseException extends \Exception {
+}
diff --git a/lib/Sabre/VObject/Parser/Json.php b/lib/Sabre/VObject/Parser/Json.php
index 42c468f..646d601 100644
--- a/lib/Sabre/VObject/Parser/Json.php
+++ b/lib/Sabre/VObject/Parser/Json.php
@@ -94,21 +94,27 @@ class Json extends Parser {
         // We can remove $self from PHP 5.4 onward.
         $self = $this;
 
-        $properties = array_map(function($jProp) use ($self) {
-            return $self->parseProperty($jProp);
-        }, $jComp[1]);
+        $properties = array_map(
+            function($jProp) use ($self) {
+                return $self->parseProperty($jProp);
+            },
+            $jComp[1]
+        );
 
         if (isset($jComp[2])) {
 
-            $components = array_map(function($jComp) use ($self) {
-                return $self->parseComponent($jComp);
-            }, $jComp[2]);
+            $components = array_map(
+                function($jComp) use ($self) {
+                    return $self->parseComponent($jComp);
+                },
+                $jComp[2]
+            );
 
         } else $components = array();
 
         return $this->root->createComponent(
             $jComp[0],
-            array_merge( $properties, $components),
+            array_merge($properties, $components),
             $defaults = false
         );
 
diff --git a/lib/Sabre/VObject/Parser/MimeDir.php b/lib/Sabre/VObject/Parser/MimeDir.php
index 14cd695..8dd2e63 100644
--- a/lib/Sabre/VObject/Parser/MimeDir.php
+++ b/lib/Sabre/VObject/Parser/MimeDir.php
@@ -301,7 +301,7 @@ class MimeDir extends Parser {
             /xi";
 
         //echo $regex, "\n"; die();
-        preg_match_all($regex, $line, $matches,  PREG_SET_ORDER );
+        preg_match_all($regex, $line, $matches,  PREG_SET_ORDER);
 
         $property = array(
             'name' => null,
@@ -474,7 +474,7 @@ class MimeDir extends Parser {
         }
         $regex .= ') #x';
 
-        $matches = preg_split($regex, $input, -1, PREG_SPLIT_DELIM_CAPTURE  |  PREG_SPLIT_NO_EMPTY );
+        $matches = preg_split($regex, $input, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);
 
         $resultArray = array();
         $result = '';
@@ -548,20 +548,23 @@ class MimeDir extends Parser {
     private function unescapeParam($input) {
 
         return
-            preg_replace_callback('#(\^(\^|n|\'))#',function($matches) {
-                switch($matches[2]) {
-                    case 'n' :
-                        return "\n";
-                    case '^' :
-                        return '^';
-                    case '\'' :
-                        return '"';
-
-                // @codeCoverageIgnoreStart
-                }
-                // @codeCoverageIgnoreEnd
-            }, $input);
-
+            preg_replace_callback(
+                '#(\^(\^|n|\'))#',
+                function($matches) {
+                    switch($matches[2]) {
+                        case 'n' :
+                            return "\n";
+                        case '^' :
+                            return '^';
+                        case '\'' :
+                            return '"';
+
+                    // @codeCoverageIgnoreStart
+                    }
+                    // @codeCoverageIgnoreEnd
+                },
+                $input
+            );
     }
 
     /**
diff --git a/lib/Sabre/VObject/Property/Float.php b/lib/Sabre/VObject/Property/Float.php
index d7bea1d..5b1f17e 100644
--- a/lib/Sabre/VObject/Property/Float.php
+++ b/lib/Sabre/VObject/Property/Float.php
@@ -81,11 +81,14 @@ class Float extends Property {
      */
     public function getJsonValue() {
 
-        $val = array_map(function($item) {
+        $val = array_map(
+            function($item) {
 
-            return (float)$item;
+                return (float)$item;
 
-        }, $this->getParts());
+            },
+            $this->getParts()
+        );
 
         // Special-casing the GEO property.
         //
diff --git a/lib/Sabre/VObject/Property/ICalendar/DateTime.php b/lib/Sabre/VObject/Property/ICalendar/DateTime.php
index 990b0b6..3d9ffbf 100644
--- a/lib/Sabre/VObject/Property/ICalendar/DateTime.php
+++ b/lib/Sabre/VObject/Property/ICalendar/DateTime.php
@@ -253,15 +253,18 @@ class DateTime extends Property {
         $tz = $dts[0]->getTimeZone();
         $isUtc = in_array($tz->getName() , array('UTC', 'GMT', 'Z'));
 
-        return array_map(function($dt) use ($hasTime, $isUtc) {
+        return array_map(
+            function($dt) use ($hasTime, $isUtc) {
 
-            if ($hasTime) {
-                return $dt->format('Y-m-d\\TH:i:s') . ($isUtc?'Z':'');
-            } else {
-                return $dt->format('Y-m-d');
-            }
+                if ($hasTime) {
+                    return $dt->format('Y-m-d\\TH:i:s') . ($isUtc?'Z':'');
+                } else {
+                    return $dt->format('Y-m-d');
+                }
 
-        }, $dts);
+            },
+            $dts
+        );
 
     }
 
@@ -279,11 +282,16 @@ class DateTime extends Property {
         // iCalendar. In jCal date-parts are separated by dashes, and
         // time-parts are separated by colons. It makes sense to just remove
         // those.
-        $this->setValue(array_map(function($item) {
+        $this->setValue(
+            array_map(
+                function($item) {
 
-            return strtr($item, array(':'=>'', '-'=>''));
+                    return strtr($item, array(':'=>'', '-'=>''));
 
-        }, $value));
+                },
+                $value
+            )
+        );
 
     }
     /**
diff --git a/lib/Sabre/VObject/Property/ICalendar/Period.php b/lib/Sabre/VObject/Property/ICalendar/Period.php
index 9496e7b..1acd6d6 100644
--- a/lib/Sabre/VObject/Property/ICalendar/Period.php
+++ b/lib/Sabre/VObject/Property/ICalendar/Period.php
@@ -78,11 +78,14 @@ class Period extends Property {
      */
     public function setJsonValue(array $value) {
 
-        $value = array_map(function($item) {
+        $value = array_map(
+            function($item) {
 
-            return strtr(implode('/', $item), array(':' => '', '-' => ''));
+                return strtr(implode('/', $item), array(':' => '', '-' => ''));
 
-        }, $value);
+            },
+            $value
+        );
         parent::setJsonValue($value);
 
     }
diff --git a/lib/Sabre/VObject/Property/Text.php b/lib/Sabre/VObject/Property/Text.php
index ad7d337..3cfa84f 100644
--- a/lib/Sabre/VObject/Property/Text.php
+++ b/lib/Sabre/VObject/Property/Text.php
@@ -143,13 +143,16 @@ class Text extends Property {
             }
 
             foreach($item as &$subItem) {
-                $subItem = strtr($subItem, array(
-                    '\\' => '\\\\',
-                    ';'  => '\;',
-                    ','  => '\,',
-                    "\n" => '\n',
-                    "\r" => "",
-                ));
+                $subItem = strtr(
+                    $subItem,
+                    array(
+                        '\\' => '\\\\',
+                        ';'  => '\;',
+                        ','  => '\,',
+                        "\n" => '\n',
+                        "\r" => "",
+                    )
+                );
             }
             $item = implode(',', $item);
 
diff --git a/lib/Sabre/VObject/Property/Uri.php b/lib/Sabre/VObject/Property/Uri.php
index 4df47a4..2b782ff 100644
--- a/lib/Sabre/VObject/Property/Uri.php
+++ b/lib/Sabre/VObject/Property/Uri.php
@@ -58,7 +58,7 @@ class Uri extends Property {
         // assume that a backslash is always intended as an escape character.
         if ($this->name === 'URL') {
             $regex = '#  (?: (\\\\ (?: \\\\ | : ) ) ) #x';
-            $matches = preg_split($regex, $val, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY );
+            $matches = preg_split($regex, $val, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);
             $newVal = '';
             foreach($matches as $match) {
                 switch($match) {
diff --git a/lib/Sabre/VObject/Reader.php b/lib/Sabre/VObject/Reader.php
index acb4f44..65a2543 100644
--- a/lib/Sabre/VObject/Reader.php
+++ b/lib/Sabre/VObject/Reader.php
@@ -38,7 +38,7 @@ class Reader {
      * @param int $options
      * @return Document
      */
-    static function read($data, $options = 0) {
+    static public function read($data, $options = 0) {
 
         $parser = new Parser\MimeDir();
         $result = $parser->parse($data, $options);
@@ -61,7 +61,7 @@ class Reader {
      * @param int $options
      * @return Node
      */
-    static function readJson($data, $options = 0) {
+    static public function readJson($data, $options = 0) {
 
         $parser = new Parser\Json();
         $result = $parser->parse($data, $options);
diff --git a/lib/Sabre/VObject/RecurrenceIterator.php b/lib/Sabre/VObject/RecurrenceIterator.php
index 618aebe..ce50ffe 100644
--- a/lib/Sabre/VObject/RecurrenceIterator.php
+++ b/lib/Sabre/VObject/RecurrenceIterator.php
@@ -313,7 +313,7 @@ class RecurrenceIterator implements \Iterator {
      * @param Component $vcal
      * @param string|null $uid
      */
-    public function __construct(Component $vcal, $uid=null) {
+    public function __construct(Component $vcal, $uid = null) {
 
         if (is_null($uid)) {
             if ($vcal instanceof Component\VCalendar) {
@@ -513,7 +513,7 @@ class RecurrenceIterator implements \Iterator {
 
         if (!$this->valid()) return null;
         $dtEnd = clone $this->currentDate;
-        $dtEnd->add( $this->startDate->diff( $this->endDate ) );
+        $dtEnd->add($this->startDate->diff($this->endDate));
         return clone $dtEnd;
 
     }
diff --git a/lib/Sabre/VObject/Splitter/ICalendar.php b/lib/Sabre/VObject/Splitter/ICalendar.php
index c8433a2..5e7f367 100644
--- a/lib/Sabre/VObject/Splitter/ICalendar.php
+++ b/lib/Sabre/VObject/Splitter/ICalendar.php
@@ -107,6 +107,6 @@ class ICalendar implements SplitterInterface {
 
         }
 
-   }
+    }
 
 }
diff --git a/lib/Sabre/VObject/Splitter/SplitterInterface.php b/lib/Sabre/VObject/Splitter/SplitterInterface.php
index 4dde024..e5282ab 100644
--- a/lib/Sabre/VObject/Splitter/SplitterInterface.php
+++ b/lib/Sabre/VObject/Splitter/SplitterInterface.php
@@ -24,7 +24,7 @@ interface SplitterInterface {
      *
      * @param resource $input
      */
-    function __construct($input);
+    public function __construct($input);
 
     /**
      * Every time getNext() is called, a new object will be parsed, until we
@@ -34,6 +34,6 @@ interface SplitterInterface {
      *
      * @return Sabre\VObject\Component|null
      */
-    function getNext();
+    public function getNext();
 
 }
diff --git a/lib/Sabre/VObject/StringUtil.php b/lib/Sabre/VObject/StringUtil.php
index 2b64902..5e0dce6 100644
--- a/lib/Sabre/VObject/StringUtil.php
+++ b/lib/Sabre/VObject/StringUtil.php
@@ -17,7 +17,7 @@ class StringUtil {
      * @param string $str
      * @return bool
      */
-    static function isUTF8($str) {
+    static public function isUTF8($str) {
 
         // First check.. mb_check_encoding
         if (!mb_check_encoding($str, 'UTF-8')) {
@@ -42,7 +42,7 @@ class StringUtil {
      * @param string $str
      * @return string
      */
-    static function convertToUTF8($str) {
+    static public function convertToUTF8($str) {
 
         $encoding = mb_detect_encoding($str , array('UTF-8','ISO-8859-1', 'WINDOWS-1252'), true);
 
diff --git a/lib/Sabre/VObject/TimeZoneUtil.php b/lib/Sabre/VObject/TimeZoneUtil.php
index 241b706..dc90ebf 100644
--- a/lib/Sabre/VObject/TimeZoneUtil.php
+++ b/lib/Sabre/VObject/TimeZoneUtil.php
@@ -218,7 +218,7 @@ class TimeZoneUtil {
      * This method will load in all the tz mapping information, if it's not yet
      * done.
      */
-    static function loadTzMaps() {
+    static public function loadTzMaps() {
 
         if (!is_null(self::$map)) return;
 
diff --git a/lib/Sabre/VObject/UUIDUtil.php b/lib/Sabre/VObject/UUIDUtil.php
index c990024..81cdc7d 100644
--- a/lib/Sabre/VObject/UUIDUtil.php
+++ b/lib/Sabre/VObject/UUIDUtil.php
@@ -23,9 +23,12 @@ class UUIDUtil {
      * @see http://www.php.net/manual/en/function.uniqid.php#94959
      * @return string
      */
-    static function getUUID() {
+    static public function getUUID() {
+
+        return sprintf(
+
+            '%04x%04x-%04x-%04x-%04x-%04x%04x%04x',
 
-        return sprintf( '%04x%04x-%04x-%04x-%04x-%04x%04x%04x',
             // 32 bits for "time_low"
             mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ),
 
@@ -52,7 +55,7 @@ class UUIDUtil {
      * @param string $uuid
      * @return bool
      */
-    static function validateUUID($uuid) {
+    static public function validateUUID($uuid) {
 
         return preg_match(
             '/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/i',
diff --git a/lib/Sabre/VObject/VCardConverter.php b/lib/Sabre/VObject/VCardConverter.php
index a5e2219..618cef3 100644
--- a/lib/Sabre/VObject/VCardConverter.php
+++ b/lib/Sabre/VObject/VCardConverter.php
@@ -121,7 +121,7 @@ class VCardConverter {
                 return;
             }
 
-            if ($property instanceOf Property\Binary) {
+            if ($property instanceof Property\Binary) {
 
                 $newProperty = $this->convertBinaryToUri($output, $property, $parameters);
 
diff --git a/tests/phpcs/ruleset.xml b/tests/phpcs/ruleset.xml
index ce7c0d7..f28539a 100644
--- a/tests/phpcs/ruleset.xml
+++ b/tests/phpcs/ruleset.xml
@@ -42,6 +42,7 @@
    <rule ref="Squiz.WhiteSpace.ScopeKeywordSpacing"/>
 
    <!-- In the argument list, there MUST NOT be a space before each comma, and there MUST be one space after each comma. -->
+   <!--
    <rule ref="Squiz.Functions.FunctionDeclarationArgumentSpacing">
     <properties>
      <property name="equalsSpacing" value="1"/>
@@ -50,14 +51,8 @@
    <rule ref="Squiz.Functions.FunctionDeclarationArgumentSpacing.SpacingAfterHint">
     <severity>0</severity>
    </rule>
-
-   <!-- When making a method or function call, there MUST NOT be a space between the method or function name and the opening parenthesis, there MUST NOT be a space after the opening parenthesis, and there MUST NOT be a space before the closing parenthesis. In the argument list, there MUST NOT be a space before each comma, and there MUST be one space after each comma.
-   Argument lists MAY be split across multiple lines, where each subsequent line is indented once. When doing so, the first item in the list MUST be on the next line, and there MUST be only one argument per line. -->
-   <rule ref="PSR2.Methods.FunctionCallSignature.SpaceAfterCloseBracket">
-     <severity>0</severity>
-    </rule>
-
-   <rule ref="PEAR.Functions.FunctionCallSignature"/>
+    -->
    <rule ref="PEAR.Functions.ValidDefaultValue"/>
    <rule ref="PEAR.WhiteSpace.ScopeClosingBrace"/>
+
 </ruleset>

-- 
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