private function cleanStrayHooks()
 {
     $hasHooks = false;
     $hooks = OC_Hook::getHooks();
     if (!$hooks || sizeof($hooks) === 0) {
         return false;
     }
     foreach ($hooks as $signalClass => $signals) {
         if (sizeof($signals)) {
             foreach ($signals as $signalName => $handlers) {
                 if (sizeof($handlers) > 0) {
                     $hasHooks = true;
                     OC_Hook::clear($signalClass, $signalName);
                     if ($this->isShowDetail()) {
                         printf("Stray hook: \"%s\" \"%s\"\n", $signalClass, $signalName);
                     }
                 }
             }
         }
     }
     return $hasHooks;
 }