[Pkg-owncloud-commits] [php-sabredav] 29/42: Invokable pathFilter() without using __call()

David Prévot taffit at moszumanska.debian.org
Wed Jul 23 16:41:26 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 6e4843e23581993106a2a88aa189dcdfdc8eabd4
Author: Dominik Tobschall <dominik at fruux.com>
Date:   Thu Jun 26 15:46:49 2014 +0200

    Invokable pathFilter() without using __call()
    
    Conflicts:
    	lib/DAV/PropertyStorage/Plugin.php
---
 lib/DAV/PropertyStorage/Plugin.php | 26 ++++++--------------------
 1 file changed, 6 insertions(+), 20 deletions(-)

diff --git a/lib/DAV/PropertyStorage/Plugin.php b/lib/DAV/PropertyStorage/Plugin.php
index 09de3a8..f8c3b63 100644
--- a/lib/DAV/PropertyStorage/Plugin.php
+++ b/lib/DAV/PropertyStorage/Plugin.php
@@ -34,23 +34,6 @@ class Plugin extends ServerPlugin {
     }
 
     /**
-     * This method is triggered when an inaccessible method
-     * is invoked in the context of this object.
-     *
-     * Allows us to call $this->pathFilter() as a method.
-     *
-     * @param  string $method
-     * @param  array $args
-     * @return void|callable
-     */
-    public function __call($method, $args)
-    {
-        if (is_callable([$this, $method])) {
-            return call_user_func_array($this->$method, $args);
-        }
-    }
-
-    /**
      * This initializes the plugin.
      *
      * This function is called by Sabre\DAV\Server, after
@@ -82,7 +65,8 @@ class Plugin extends ServerPlugin {
     public function propFind(PropFind $propFind, INode $node) {
 
         $path = $propFind->getPath();
-        if ($this->pathFilter && !$this->pathFilter($path)) return;
+        $pathFilter = $this->pathFilter;
+        if ($pathFilter && !$pathFilter($path)) return;
         $this->backend->propFind($propFind->getPath(), $propFind);
 
     }
@@ -99,7 +83,8 @@ class Plugin extends ServerPlugin {
      */
     public function propPatch($path, PropPatch $propPatch) {
 
-        if ($this->pathFilter && !$this->pathFilter($path)) return;
+        $pathFilter = $this->pathFilter;
+        if ($pathFilter && !$pathFilter($path)) return;
         $this->backend->propPatch($path, $propPatch);
 
     }
@@ -115,7 +100,8 @@ class Plugin extends ServerPlugin {
      */
     public function afterUnbind($path) {
 
-        if ($this->pathFilter && !$this->pathFilter($path)) return;
+        $pathFilter = $this->pathFilter;
+        if ($pathFilter && !$pathFilter($path)) return;
         $this->backend->delete($path);
 
     }

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