Skip to content

Commit

Permalink
fix(files): Remove dead code from files controllers
Browse files Browse the repository at this point in the history
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
  • Loading branch information
susnux committed Feb 12, 2024
1 parent 9192886 commit b0c3931
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 25 deletions.
2 changes: 0 additions & 2 deletions apps/files/lib/Controller/TemplateController.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@
*/
namespace OCA\Files\Controller;

use OCA\Files\ResponseDefinitions;
use OCP\AppFramework\Http;
use OCP\AppFramework\Http\DataResponse;
use OCP\AppFramework\OCS\OCSForbiddenException;
use OCP\AppFramework\OCSController;
Expand Down
20 changes: 0 additions & 20 deletions apps/files/lib/Controller/ViewController.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,26 +115,6 @@ public function __construct(string $appName,
$this->viewConfig = $viewConfig;
}

/**
* @param string $appName
* @param string $scriptName
* @return string
*/
protected function renderScript($appName, $scriptName) {
$content = '';
$appPath = \OC_App::getAppPath($appName);
$scriptPath = $appPath . '/' . $scriptName;
if (file_exists($scriptPath)) {
// TODO: sanitize path / script name ?
ob_start();
include $scriptPath;
$content = ob_get_contents();
@ob_end_clean();
}

return $content;
}

/**
* FIXME: Replace with non static code
*
Expand Down
5 changes: 2 additions & 3 deletions apps/files/tests/Controller/ViewControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ class ViewControllerTest extends TestCase {
private $eventDispatcher;
/** @var ViewController|\PHPUnit\Framework\MockObject\MockObject */
private $viewController;
/** @var IUser */
/** @var IUser|\PHPUnit\Framework\MockObject\MockObject */
private $user;
/** @var IUserSession */
/** @var IUserSession|\PHPUnit\Framework\MockObject\MockObject */
private $userSession;
/** @var IAppManager|\PHPUnit\Framework\MockObject\MockObject */
private $appManager;
Expand Down Expand Up @@ -135,7 +135,6 @@ protected function setUp(): void {
])
->setMethods([
'getStorageInfo',
'renderScript'
])
->getMock();
}
Expand Down

0 comments on commit b0c3931

Please sign in to comment.