[Pkg-owncloud-commits] [php-sabredav] 53/163: Removed NODE constants

David Prévot taffit at moszumanska.debian.org
Tue May 20 18:54:53 UTC 2014


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

taffit pushed a commit to annotated tag upstream/2.0.0_beta1
in repository php-sabredav.

commit b6e0aa62d54e0be5411a925de225ae7bd8ff1296
Author: Evert Pot <evert at rooftopsolutions.nl>
Date:   Sat Apr 12 22:13:39 2014 -0400

    Removed NODE constants
---
 ChangeLog.md                                  |  3 ++-
 lib/Sabre/DAV/Property/ResourceType.php       |  8 ++------
 lib/Sabre/DAV/Server.php                      | 10 ----------
 tests/Sabre/DAV/Property/ResourceTypeTest.php |  6 ------
 4 files changed, 4 insertions(+), 23 deletions(-)

diff --git a/ChangeLog.md b/ChangeLog.md
index 9738a8e..954cf06 100644
--- a/ChangeLog.md
+++ b/ChangeLog.md
@@ -11,7 +11,8 @@ ChangeLog
   home is located.
 * Fixed: Issue #422 Preconditions were not being set on PUT on non-existant
   files. Not really a chance for data-loss, but incorrect nevertheless.
-* Fixed: Issue #428: Etag check with If: fails if the target is a collection.
+* Fixed: Issue #428: Etag check with `If:` fails if the target is a collection.
+* Removed: `Sabre\DAV\Server::NODE_*` constants.
 
 1.9.0-alpha2 (2014-01-14)
 -------------------------
diff --git a/lib/Sabre/DAV/Property/ResourceType.php b/lib/Sabre/DAV/Property/ResourceType.php
index a0b22fb..4ed0513 100644
--- a/lib/Sabre/DAV/Property/ResourceType.php
+++ b/lib/Sabre/DAV/Property/ResourceType.php
@@ -28,13 +28,9 @@ class ResourceType extends DAV\Property {
      *
      * @param mixed $resourceType
      */
-    public function __construct($resourceType = array()) {
+    public function __construct($resourceType = []) {
 
-        if ($resourceType === DAV\Server::NODE_FILE)
-            $this->resourceType = array();
-        elseif ($resourceType === DAV\Server::NODE_DIRECTORY)
-            $this->resourceType = array('{DAV:}collection');
-        elseif (is_array($resourceType))
+        if (is_array($resourceType))
             $this->resourceType = $resourceType;
         else
             $this->resourceType = array($resourceType);
diff --git a/lib/Sabre/DAV/Server.php b/lib/Sabre/DAV/Server.php
index 522d388..56b2d49 100644
--- a/lib/Sabre/DAV/Server.php
+++ b/lib/Sabre/DAV/Server.php
@@ -24,16 +24,6 @@ class Server extends EventEmitter {
     const DEPTH_INFINITY = -1;
 
     /**
-     * Nodes that are files, should have this as the type property
-     */
-    const NODE_FILE = 1;
-
-    /**
-     * Nodes that are directories, should use this value as the type property
-     */
-    const NODE_DIRECTORY = 2;
-
-    /**
      * XML namespace for all SabreDAV related elements
      */
     const NS_SABREDAV = 'http://sabredav.org/ns';
diff --git a/tests/Sabre/DAV/Property/ResourceTypeTest.php b/tests/Sabre/DAV/Property/ResourceTypeTest.php
index e8beb62..1063b52 100644
--- a/tests/Sabre/DAV/Property/ResourceTypeTest.php
+++ b/tests/Sabre/DAV/Property/ResourceTypeTest.php
@@ -11,12 +11,6 @@ class ResourceTypeTest extends \PHPUnit_Framework_TestCase {
         $resourceType = new ResourceType(array('{DAV:}collection'));
         $this->assertEquals(array('{DAV:}collection'),$resourceType->getValue());
 
-        $resourceType = new ResourceType(DAV\Server::NODE_FILE);
-        $this->assertEquals(array(),$resourceType->getValue());
-
-        $resourceType = new ResourceType(DAV\Server::NODE_DIRECTORY);
-        $this->assertEquals(array('{DAV:}collection'),$resourceType->getValue());
-
         $resourceType = new ResourceType('{DAV:}principal');
         $this->assertEquals(array('{DAV:}principal'),$resourceType->getValue());
 

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