[Pkg-owncloud-commits] [php-sabredav] 38/40: CS fixes.

David Prévot taffit at moszumanska.debian.org
Sat Sep 5 15:24:10 UTC 2015


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

taffit pushed a commit to tag 3.1.0-alpha2
in repository php-sabredav.

commit 5c2379cdd176e75f6103aae1f5a1ffc53ece1ae4
Author: Evert Pot <me at evertpot.com>
Date:   Sat Sep 5 00:46:06 2015 +0200

    CS fixes.
---
 lib/DAV/CorePlugin.php                        |  4 ++--
 tests/Sabre/DAV/Mock/Collection.php           | 12 ++++++------
 tests/Sabre/DAV/Mock/PropertiesCollection.php | 20 +++++++++-----------
 tests/Sabre/DAV/Mock/StreamingFile.php        |  4 +---
 4 files changed, 18 insertions(+), 22 deletions(-)

diff --git a/lib/DAV/CorePlugin.php b/lib/DAV/CorePlugin.php
index 4e4bf77..3fdb92a 100644
--- a/lib/DAV/CorePlugin.php
+++ b/lib/DAV/CorePlugin.php
@@ -628,8 +628,8 @@ class CorePlugin extends ServerPlugin {
             if (!$this->server->emit('beforeUnbind', [$moveInfo['destination']])) return false;
 
         }
-        if (!$this->server->emit('beforeUnbind',[$path])) return false;
-        if (!$this->server->emit('beforeBind',[$moveInfo['destination']])) return false;
+        if (!$this->server->emit('beforeUnbind', [$path])) return false;
+        if (!$this->server->emit('beforeBind', [$moveInfo['destination']])) return false;
         if (!$this->server->emit('beforeMove', [$path, $moveInfo['destination']])) return false;
 
         if ($moveInfo['destinationExists']) {
diff --git a/tests/Sabre/DAV/Mock/Collection.php b/tests/Sabre/DAV/Mock/Collection.php
index a35b6d9..d6a201f 100644
--- a/tests/Sabre/DAV/Mock/Collection.php
+++ b/tests/Sabre/DAV/Mock/Collection.php
@@ -32,14 +32,14 @@ class Collection extends DAV\Collection {
      * @param array $children
      * @return void
      */
-    function __construct($name, array $children = array(), Collection $parent = null) {
+    function __construct($name, array $children = [], Collection $parent = null) {
 
         $this->name = $name;
-        foreach($children as $key=>$value) {
+        foreach ($children as $key => $value) {
             if (is_string($value)) {
                 $this->children[] = new File($key, $value, $this);
             } elseif (is_array($value)) {
-                $this->children[] = new Collection($key, $value, $this);
+                $this->children[] = new self($key, $value, $this);
             } elseif ($value instanceof \Sabre\DAV\INode) {
                 $this->children[] = $value;
             } else {
@@ -105,7 +105,7 @@ class Collection extends DAV\Collection {
      */
     function createDirectory($name) {
 
-        $this->children[] = new Collection($name);
+        $this->children[] = new self($name);
 
     }
 
@@ -128,7 +128,7 @@ class Collection extends DAV\Collection {
      */
     function deleteChild($name) {
 
-        foreach($this->children as $key=>$value) {
+        foreach ($this->children as $key => $value) {
 
             if ($value->getName() == $name) {
                 unset($this->children[$key]);
@@ -146,7 +146,7 @@ class Collection extends DAV\Collection {
      */
     function delete() {
 
-        foreach($this->getChildren() as $child) {
+        foreach ($this->getChildren() as $child) {
             $this->deleteChild($child->getName());
         }
         $this->parent->deleteChild($this->getName());
diff --git a/tests/Sabre/DAV/Mock/PropertiesCollection.php b/tests/Sabre/DAV/Mock/PropertiesCollection.php
index 118379c..0d01f50 100644
--- a/tests/Sabre/DAV/Mock/PropertiesCollection.php
+++ b/tests/Sabre/DAV/Mock/PropertiesCollection.php
@@ -2,10 +2,8 @@
 
 namespace Sabre\DAV\Mock;
 
-use
-    Sabre\DAV\IProperties,
-    Sabre\DAV\PropPatch;
-
+use Sabre\DAV\IProperties;
+use Sabre\DAV\PropPatch;
 
 /**
  * A node specifically for testing property-related operations
@@ -28,7 +26,7 @@ class PropertiesCollection extends Collection implements IProperties {
      * @param array $properties
      * @return void
      */
-    public function __construct($name, array $children, array $properties = []) {
+    function __construct($name, array $children, array $properties = []) {
 
         parent::__construct($name, $children, null);
         $this->properties = $properties;
@@ -47,15 +45,15 @@ class PropertiesCollection extends Collection implements IProperties {
      * @param array $mutations
      * @return bool|array
      */
-    public function propPatch(PropPatch $proppatch) {
+    function propPatch(PropPatch $proppatch) {
 
         $proppatch->handleRemaining(function($updateProperties) {
 
-            switch($this->failMode) {
+            switch ($this->failMode) {
                 case 'updatepropsfalse' : return false;
                 case 'updatepropsarray' :
                     $r = [];
-                    foreach($updateProperties as $k=>$v) $r[$k] = 402;
+                    foreach ($updateProperties as $k => $v) $r[$k] = 402;
                     return $r;
                 case 'updatepropsobj' :
                     return new \STDClass();
@@ -80,10 +78,10 @@ class PropertiesCollection extends Collection implements IProperties {
      * @param array $properties
      * @return array
      */
-    public function getProperties($requestedProperties) {
+    function getProperties($requestedProperties) {
 
-        $returnedProperties = array();
-        foreach($requestedProperties as $requestedProperty) {
+        $returnedProperties = [];
+        foreach ($requestedProperties as $requestedProperty) {
             if (isset($this->properties[$requestedProperty])) {
                 $returnedProperties[$requestedProperty] =
                     $this->properties[$requestedProperty];
diff --git a/tests/Sabre/DAV/Mock/StreamingFile.php b/tests/Sabre/DAV/Mock/StreamingFile.php
index 90770b4..ca912b0 100644
--- a/tests/Sabre/DAV/Mock/StreamingFile.php
+++ b/tests/Sabre/DAV/Mock/StreamingFile.php
@@ -2,8 +2,6 @@
 
 namespace Sabre\DAV\Mock;
 
-use Sabre\DAV;
-
 /**
  * Mock Streaming File File
  *
@@ -39,7 +37,7 @@ class StreamingFile extends File {
     function put($data) {
 
         if (is_string($data)) {
-            $stream = fopen('php://memory','r+');
+            $stream = fopen('php://memory', 'r+');
             fwrite($stream, $data);
             rewind($stream);
             $data = $stream;

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



More information about the Pkg-owncloud-commits mailing list