summaryrefslogtreecommitdiffstats
path: root/apps/files_external/lib/dependencytrait.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_external/lib/dependencytrait.php')
-rw-r--r--apps/files_external/lib/dependencytrait.php47
1 files changed, 1 insertions, 46 deletions
diff --git a/apps/files_external/lib/dependencytrait.php b/apps/files_external/lib/dependencytrait.php
index 116421eab14..f0d6d6080e5 100644
--- a/apps/files_external/lib/dependencytrait.php
+++ b/apps/files_external/lib/dependencytrait.php
@@ -28,58 +28,13 @@ use \OCA\Files_External\Lib\MissingDependency;
*/
trait DependencyTrait {
- /** @var callable|null dependency check */
- private $dependencyCheck = null;
-
- /**
- * @return bool
- */
- public function hasDependencies() {
- return !is_null($this->dependencyCheck);
- }
-
- /**
- * @param callable $dependencyCheck
- * @return self
- */
- public function setDependencyCheck(callable $dependencyCheck) {
- $this->dependencyCheck = $dependencyCheck;
- return $this;
- }
-
/**
* Check if object is valid for use
*
* @return MissingDependency[] Unsatisfied dependencies
*/
public function checkDependencies() {
- $ret = [];
-
- if ($this->hasDependencies()) {
- $result = call_user_func($this->dependencyCheck);
- if ($result !== true) {
- if (!is_array($result)) {
- $result = [$result];
- }
- foreach ($result as $key => $value) {
- if (!($value instanceof MissingDependency)) {
- $module = null;
- $message = null;
- if (is_numeric($key)) {
- $module = $value;
- } else {
- $module = $key;
- $message = $value;
- }
- $value = new MissingDependency($module, $this);
- $value->setMessage($message);
- }
- $ret[] = $value;
- }
- }
- }
-
- return $ret;
+ return []; // no dependencies by default
}
}