[Pkg-owncloud-commits] [php-sabredav] 181/275: Coding standards.

David Prévot taffit at moszumanska.debian.org
Thu Sep 25 14:56:06 UTC 2014


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

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

commit bde64eb9d89e64c1972fb861b5cb89b4b33a405a
Author: Evert Pot <evert at rooftopsolutions.nl>
Date:   Sun Aug 24 20:51:41 2014 -0400

    Coding standards.
---
 lib/DAV/FS/Directory.php    | 18 +++++++++---------
 lib/DAV/FS/File.php         | 12 ++++++------
 lib/DAV/FS/Node.php         |  8 ++++----
 lib/DAV/FSExt/Directory.php | 14 +++++++-------
 lib/DAV/FSExt/File.php      | 14 +++++++-------
 lib/DAV/FSExt/Node.php      |  8 ++++----
 lib/DAV/Tree.php            | 14 +++++++-------
 7 files changed, 44 insertions(+), 44 deletions(-)

diff --git a/lib/DAV/FS/Directory.php b/lib/DAV/FS/Directory.php
index 6fdd2ae..011a487 100644
--- a/lib/DAV/FS/Directory.php
+++ b/lib/DAV/FS/Directory.php
@@ -36,7 +36,7 @@ class Directory extends Node implements DAV\ICollection, DAV\IQuota {
      * @param resource|string $data Initial payload
      * @return null|string
      */
-    public function createFile($name, $data = null) {
+    function createFile($name, $data = null) {
 
         $newPath = $this->path . '/' . $name;
         file_put_contents($newPath,$data);
@@ -49,7 +49,7 @@ class Directory extends Node implements DAV\ICollection, DAV\IQuota {
      * @param string $name
      * @return void
      */
-    public function createDirectory($name) {
+    function createDirectory($name) {
 
         $newPath = $this->path . '/' . $name;
         mkdir($newPath);
@@ -66,7 +66,7 @@ class Directory extends Node implements DAV\ICollection, DAV\IQuota {
      * @throws DAV\Exception\NotFound
      * @return DAV\INode
      */
-    public function getChild($name) {
+    function getChild($name) {
 
         $path = $this->path . '/' . $name;
 
@@ -89,7 +89,7 @@ class Directory extends Node implements DAV\ICollection, DAV\IQuota {
      *
      * @return DAV\INode[]
      */
-    public function getChildren() {
+    function getChildren() {
 
         $nodes = array();
         foreach(scandir($this->path) as $node) if($node!='.' && $node!='..') $nodes[] = $this->getChild($node);
@@ -103,7 +103,7 @@ class Directory extends Node implements DAV\ICollection, DAV\IQuota {
      * @param string $name
      * @return bool
      */
-    public function childExists($name) {
+    function childExists($name) {
 
         $path = $this->path . '/' . $name;
         return file_exists($path);
@@ -115,7 +115,7 @@ class Directory extends Node implements DAV\ICollection, DAV\IQuota {
      *
      * @return void
      */
-    public function delete() {
+    function delete() {
 
         foreach($this->getChildren() as $child) $child->delete();
         rmdir($this->path);
@@ -127,12 +127,12 @@ class Directory extends Node implements DAV\ICollection, DAV\IQuota {
      *
      * @return array
      */
-    public function getQuotaInfo() {
+    function getQuotaInfo() {
 
-        return array(
+        return [
             disk_total_space($this->path)-disk_free_space($this->path),
             disk_free_space($this->path)
-            );
+        ];
 
     }
 
diff --git a/lib/DAV/FS/File.php b/lib/DAV/FS/File.php
index d10370f..46fe786 100644
--- a/lib/DAV/FS/File.php
+++ b/lib/DAV/FS/File.php
@@ -19,7 +19,7 @@ class File extends Node implements DAV\IFile {
      * @param resource $data
      * @return void
      */
-    public function put($data) {
+    function put($data) {
 
         file_put_contents($this->path,$data);
 
@@ -30,7 +30,7 @@ class File extends Node implements DAV\IFile {
      *
      * @return string
      */
-    public function get() {
+    function get() {
 
         return fopen($this->path,'r');
 
@@ -41,7 +41,7 @@ class File extends Node implements DAV\IFile {
      *
      * @return void
      */
-    public function delete() {
+    function delete() {
 
         unlink($this->path);
 
@@ -52,7 +52,7 @@ class File extends Node implements DAV\IFile {
      *
      * @return int
      */
-    public function getSize() {
+    function getSize() {
 
         return filesize($this->path);
 
@@ -68,7 +68,7 @@ class File extends Node implements DAV\IFile {
      *
      * @return mixed
      */
-    public function getETag() {
+    function getETag() {
 
         return null;
 
@@ -81,7 +81,7 @@ class File extends Node implements DAV\IFile {
      *
      * @return mixed
      */
-    public function getContentType() {
+    function getContentType() {
 
         return null;
 
diff --git a/lib/DAV/FS/Node.php b/lib/DAV/FS/Node.php
index a5463ef..e1aa1f0 100644
--- a/lib/DAV/FS/Node.php
+++ b/lib/DAV/FS/Node.php
@@ -29,7 +29,7 @@ abstract class Node implements DAV\INode {
      *
      * @param string $path
      */
-    public function __construct($path) {
+    function __construct($path) {
 
         $this->path = $path;
 
@@ -42,7 +42,7 @@ abstract class Node implements DAV\INode {
      *
      * @return string
      */
-    public function getName() {
+    function getName() {
 
         list(, $name)  = URLUtil::splitPath($this->path);
         return $name;
@@ -55,7 +55,7 @@ abstract class Node implements DAV\INode {
      * @param string $name The new name
      * @return void
      */
-    public function setName($name) {
+    function setName($name) {
 
         list($parentPath, ) = URLUtil::splitPath($this->path);
         list(, $newName) = URLUtil::splitPath($name);
@@ -74,7 +74,7 @@ abstract class Node implements DAV\INode {
      *
      * @return int
      */
-    public function getLastModified() {
+    function getLastModified() {
 
         return filemtime($this->path);
 
diff --git a/lib/DAV/FSExt/Directory.php b/lib/DAV/FSExt/Directory.php
index da3d2cc..af5edd8 100644
--- a/lib/DAV/FSExt/Directory.php
+++ b/lib/DAV/FSExt/Directory.php
@@ -37,7 +37,7 @@ class Directory extends Node implements DAV\ICollection, DAV\IQuota {
      * @param resource|string $data Initial payload
      * @return null|string
      */
-    public function createFile($name, $data = null) {
+    function createFile($name, $data = null) {
 
         // We're not allowing dots
         if ($name=='.' || $name=='..') throw new DAV\Exception\Forbidden('Permission denied to . and ..');
@@ -54,7 +54,7 @@ class Directory extends Node implements DAV\ICollection, DAV\IQuota {
      * @param string $name
      * @return void
      */
-    public function createDirectory($name) {
+    function createDirectory($name) {
 
         // We're not allowing dots
         if ($name=='.' || $name=='..') throw new DAV\Exception\Forbidden('Permission denied to . and ..');
@@ -73,7 +73,7 @@ class Directory extends Node implements DAV\ICollection, DAV\IQuota {
      * @throws DAV\Exception\NotFound
      * @return DAV\INode
      */
-    public function getChild($name) {
+    function getChild($name) {
 
         $path = $this->path . '/' . $name;
 
@@ -98,7 +98,7 @@ class Directory extends Node implements DAV\ICollection, DAV\IQuota {
      * @param string $name
      * @return bool
      */
-    public function childExists($name) {
+    function childExists($name) {
 
         if ($name=='.' || $name=='..')
             throw new DAV\Exception\Forbidden('Permission denied to . and ..');
@@ -113,9 +113,9 @@ class Directory extends Node implements DAV\ICollection, DAV\IQuota {
      *
      * @return DAV\INode[]
      */
-    public function getChildren() {
+    function getChildren() {
 
-        $nodes = array();
+        $nodes = [];
         foreach(scandir($this->path) as $node) if($node!='.' && $node!='..' && $node!='.sabredav') $nodes[] = $this->getChild($node);
         return $nodes;
 
@@ -126,7 +126,7 @@ class Directory extends Node implements DAV\ICollection, DAV\IQuota {
      *
      * @return bool
      */
-    public function delete() {
+    function delete() {
 
         // Deleting all children
         foreach($this->getChildren() as $child) $child->delete();
diff --git a/lib/DAV/FSExt/File.php b/lib/DAV/FSExt/File.php
index 7861082..8bd73f1 100644
--- a/lib/DAV/FSExt/File.php
+++ b/lib/DAV/FSExt/File.php
@@ -20,7 +20,7 @@ class File extends Node implements DAV\PartialUpdate\IPatchSupport {
      * @param resource|string $data
      * @return string
      */
-    public function put($data) {
+    function put($data) {
 
         file_put_contents($this->path,$data);
         return '"' . md5_file($this->path) . '"';
@@ -54,7 +54,7 @@ class File extends Node implements DAV\PartialUpdate\IPatchSupport {
      * @param int $offset
      * @return string|null
      */
-    public function patch($data, $rangeType, $offset = null) {
+    function patch($data, $rangeType, $offset = null) {
 
         switch($rangeType) {
             case 1 :
@@ -84,7 +84,7 @@ class File extends Node implements DAV\PartialUpdate\IPatchSupport {
      *
      * @return resource
      */
-    public function get() {
+    function get() {
 
         return fopen($this->path,'r');
 
@@ -95,7 +95,7 @@ class File extends Node implements DAV\PartialUpdate\IPatchSupport {
      *
      * @return bool
      */
-    public function delete() {
+    function delete() {
         return unlink($this->path) && parent::delete();
 
     }
@@ -110,7 +110,7 @@ class File extends Node implements DAV\PartialUpdate\IPatchSupport {
      *
      * @return string|null
      */
-    public function getETag() {
+    function getETag() {
 
         return '"' . md5_file($this->path). '"';
 
@@ -123,7 +123,7 @@ class File extends Node implements DAV\PartialUpdate\IPatchSupport {
      *
      * @return string|null
      */
-    public function getContentType() {
+    function getContentType() {
 
         return null;
 
@@ -134,7 +134,7 @@ class File extends Node implements DAV\PartialUpdate\IPatchSupport {
      *
      * @return int
      */
-    public function getSize() {
+    function getSize() {
 
         return filesize($this->path);
 
diff --git a/lib/DAV/FSExt/Node.php b/lib/DAV/FSExt/Node.php
index 2150241..cf78395 100644
--- a/lib/DAV/FSExt/Node.php
+++ b/lib/DAV/FSExt/Node.php
@@ -30,7 +30,7 @@ abstract class Node extends DAV\FS\Node implements DAV\IProperties {
      * @param PropPatch $propPatch
      * @return void
      */
-    public function propPatch(PropPatch $propPatch) {
+    function propPatch(PropPatch $propPatch) {
 
         $propPatch->handleRemaining(function(array $properties) {
 
@@ -61,7 +61,7 @@ abstract class Node extends DAV\FS\Node implements DAV\IProperties {
      * @param array $properties
      * @return array
      */
-    public function getProperties($properties) {
+    function getProperties($properties) {
 
         $resourceData = $this->getResourceData();
 
@@ -165,7 +165,7 @@ abstract class Node extends DAV\FS\Node implements DAV\IProperties {
      * @param string $name The new name
      * @return void
      */
-    public function setName($name) {
+    function setName($name) {
 
         list($parentPath, ) = URLUtil::splitPath($this->path);
         list(, $newName) = URLUtil::splitPath($name);
@@ -217,7 +217,7 @@ abstract class Node extends DAV\FS\Node implements DAV\IProperties {
         return true;
     }
 
-    public function delete() {
+    function delete() {
 
         return $this->deleteResourceData();
 
diff --git a/lib/DAV/Tree.php b/lib/DAV/Tree.php
index 46440ad..dc9dbaf 100644
--- a/lib/DAV/Tree.php
+++ b/lib/DAV/Tree.php
@@ -32,7 +32,7 @@ abstract class Tree {
      * @param string $path
      * @return bool
      */
-    public function nodeExists($path) {
+    function nodeExists($path) {
 
         try {
 
@@ -54,7 +54,7 @@ abstract class Tree {
      * @param string $destinationPath The full destination path
      * @return void
      */
-    public function copy($sourcePath, $destinationPath) {
+    function copy($sourcePath, $destinationPath) {
 
         $sourceNode = $this->getNodeForPath($sourcePath);
 
@@ -98,7 +98,7 @@ abstract class Tree {
      * @param string $path
      * @return void
      */
-    public function delete($path) {
+    function delete($path) {
 
         $node = $this->getNodeForPath($path);
         $node->delete();
@@ -114,7 +114,7 @@ abstract class Tree {
      * @param string $path
      * @return array
      */
-    public function getChildren($path) {
+    function getChildren($path) {
 
         $node = $this->getNodeForPath($path);
         return $node->getChildren();
@@ -139,7 +139,7 @@ abstract class Tree {
      * @param string $path
      * @return void
      */
-    public function markDirty($path) {
+    function markDirty($path) {
 
 
     }
@@ -158,7 +158,7 @@ abstract class Tree {
      * @param array $paths List of nodes that must be fetched.
      * @return array
      */
-    public function getMultipleNodes($paths) {
+    function getMultipleNodes($paths) {
 
         $result = [];
         foreach($paths as $path) {
@@ -209,7 +209,7 @@ abstract class Tree {
         }
         if ($source instanceof IProperties && $destination instanceof IProperties) {
 
-            $props = $source->getProperties(array());
+            $props = $source->getProperties([]);
             $propPatch = new PropPatch($props);
             $destination->propPatch($propPatch);
             $propPatch->commit();

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