Skip to content

Commit

Permalink
Merge pull request #43532 from nextcloud/chore/remove-dead-code
Browse files Browse the repository at this point in the history
fix(files): Remove dead code from files controllers
  • Loading branch information
skjnldsv authored Feb 13, 2024
2 parents 932d6e1 + 5e124c4 commit 8bcc55b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 23 deletions.
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 8bcc55b

Please sign in to comment.