| Total Complexity | 8 |
| Total Lines | 58 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 24 | class UserMusicFolder { |
||
| 25 | |||
| 26 | private $appName; |
||
| 27 | private $configManager; |
||
| 28 | private $rootFolder; |
||
| 29 | private $logger; |
||
| 30 | |||
| 31 | public function __construct( |
||
| 32 | $appName, |
||
| 33 | IConfig $configManager, |
||
| 34 | IRootFolder $rootFolder, |
||
| 35 | Logger $logger) { |
||
| 36 | $this->appName = $appName; |
||
| 37 | $this->configManager = $configManager; |
||
| 38 | $this->rootFolder = $rootFolder; |
||
| 39 | $this->logger = $logger; |
||
| 40 | } |
||
| 41 | |||
| 42 | /** |
||
| 43 | * @param string $userId |
||
| 44 | * @param string $path |
||
| 45 | */ |
||
| 46 | public function setPath($userId, $path) { |
||
| 47 | $success = false; |
||
| 48 | |||
| 49 | $userHome = $this->rootFolder->getUserFolder($userId); |
||
| 50 | $element = $userHome->get($path); |
||
| 51 | if ($element instanceof \OCP\Files\Folder) { |
||
| 52 | if ($path[0] !== '/') { |
||
| 53 | $path = '/' . $path; |
||
| 54 | } |
||
| 55 | if ($path[\strlen($path)-1] !== '/') { |
||
| 56 | $path .= '/'; |
||
| 57 | } |
||
| 58 | $this->configManager->setUserValue($userId, $this->appName, 'path', $path); |
||
| 59 | $success = true; |
||
| 60 | } |
||
| 61 | |||
| 62 | return $success; |
||
| 63 | } |
||
| 64 | |||
| 65 | /** |
||
| 66 | * @param string $userId |
||
| 67 | * @return string |
||
| 68 | */ |
||
| 69 | public function getPath($userId) { |
||
| 70 | $path = $this->configManager->getUserValue($userId, $this->appName, 'path'); |
||
| 71 | return $path ?: '/'; |
||
| 72 | } |
||
| 73 | |||
| 74 | /** |
||
| 75 | * @param string $userId |
||
| 76 | * @return Folder |
||
| 77 | */ |
||
| 78 | public function getFolder($userId) { |
||
| 82 | } |
||
| 83 | } |
||
| 84 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths