*
* @param string $fileName css filename with extension
* @param string $appName css folder name
- * @return text/css
+ * @return FileDisplayResponse|NotFoundResponse
*/
public function getCss($fileName, $appName) {
try {
use OCP\Files\IAppData;
use OCP\Files\NotFoundException;
+use OCP\Files\SimpleFS\ISimpleFile;
use OCP\ICssManager;
/**
* @throws NotFoundException
*/
public function getCss($fileName, $appName) {
- try {
- $folder = $this->appData->getFolder($appName);
- } catch(NotFoundException $e) {
- throw new NotFoundException();
- }
- try {
- return $folder->getFile($fileName);
- } catch(NotFoundException $e) {
- throw new NotFoundException();
- }
+ $folder = $this->appData->getFolder($appName);
+ return $folder->getFile($fileName);
}
}
$c->getConfig()
);
});
- $this->registerService('CssManager', function (Server $c) {
+ $this->registerService(CssManager::class, function (Server $c) {
return new CssManager(
$c->getAppDataDir('css')
);
* @return \OCP\ICssManager
*/
public function getCssManager() {
- return $this->query('CssManager');
+ return $this->query(CssManager::class);
}
/**
use Leafo\ScssPhp\Compiler;
use Leafo\ScssPhp\Exception\ParserException;
+use OC\Files\SimpleFS\SimpleFolder;
use OCP\Files\NotFoundException;
-use OCP\IURLGenerator;
class SCSSCacher {
* @var string The css filename with extension
* @var string Absolute path to scss file location folder
* @var string Path to scss file from the root installation
- * @var OC\Files\SimpleFS\SimpleFolder The folder we're putting our compiled css files
+ * @var SimpleFolder The folder we're putting our compiled css files
*/
protected $root, $file, $fileNameSCSS, $fileNameCSS, $fileLoc, $rootCssLoc, $folder;
} catch(NotFoundException $e) {
return false;
}
- return false;
}
/**
namespace OCP;
+use OCP\Files\NotFoundException;
+use OCP\Files\SimpleFS\ISimpleFile;
+
/**
* This class provides scss functionality
* @since 11.0.0
* @param string $fileName css filename with extension
* @param string $appName css app name
* @return ISimpleFile
+ * @throws NotFoundException
*/
public function getCss($fileName, $appName);
}