@@ -105,7 +105,7 @@ public function getAbsolutePath($path = '/'): ?string {
105105 * @param string $fakeRoot
106106 */
107107 public function chroot ($ fakeRoot ): void {
108- if (! $ fakeRoot == '' ) {
108+ if ($ fakeRoot ! == '' ) {
109109 if ($ fakeRoot [0 ] !== '/ ' ) {
110110 $ fakeRoot = '/ ' . $ fakeRoot ;
111111 }
@@ -127,7 +127,7 @@ public function getRoot(): string {
127127 */
128128 public function getRelativePath ($ path ): ?string {
129129 $ this ->assertPathLength ($ path );
130- if ($ this ->fakeRoot == '' ) {
130+ if ($ this ->fakeRoot === '' ) {
131131 return $ path ;
132132 }
133133
@@ -320,7 +320,7 @@ public function opendir($path) {
320320 * @return bool|mixed
321321 */
322322 public function is_dir ($ path ) {
323- if ($ path == '/ ' ) {
323+ if ($ path === '/ ' ) {
324324 return true ;
325325 }
326326 return $ this ->basicOperation ('is_dir ' , $ path );
@@ -331,7 +331,7 @@ public function is_dir($path) {
331331 * @return bool|mixed
332332 */
333333 public function is_file ($ path ) {
334- if ($ path == '/ ' ) {
334+ if ($ path === '/ ' ) {
335335 return false ;
336336 }
337337 return $ this ->basicOperation ('is_file ' , $ path );
@@ -497,7 +497,7 @@ public function isSharable($path) {
497497 * @return bool|mixed
498498 */
499499 public function file_exists ($ path ) {
500- if ($ path == '/ ' ) {
500+ if ($ path === '/ ' ) {
501501 return true ;
502502 }
503503 return $ this ->basicOperation ('file_exists ' , $ path );
@@ -729,7 +729,7 @@ public function rename($source, $target, array $options = []) {
729729 $ target = $ this ->getRelativePath ($ absolutePath2 );
730730 $ exists = $ this ->file_exists ($ target );
731731
732- if ($ source == null || $ target == null ) {
732+ if ($ source === null || $ target = == null ) {
733733 return false ;
734734 }
735735
@@ -926,7 +926,7 @@ public function copy($source, $target, $preserveMtime = false) {
926926 $ source = $ this ->getRelativePath ($ absolutePath1 );
927927 $ target = $ this ->getRelativePath ($ absolutePath2 );
928928
929- if ($ source == null || $ target == null ) {
929+ if ($ source === null || $ target = == null ) {
930930 return false ;
931931 }
932932 $ run = true ;
@@ -961,7 +961,7 @@ public function copy($source, $target, $preserveMtime = false) {
961961 $ this ->changeLock ($ target , ILockingProvider::LOCK_EXCLUSIVE );
962962 $ lockTypePath2 = ILockingProvider::LOCK_EXCLUSIVE ;
963963
964- if ($ mount1 ->getMountPoint () == $ mount2 ->getMountPoint ()) {
964+ if ($ mount1 ->getMountPoint () === $ mount2 ->getMountPoint ()) {
965965 if ($ storage1 ) {
966966 $ result = $ storage1 ->copy ($ internalPath1 , $ internalPath2 );
967967 } else {
@@ -1132,7 +1132,7 @@ public function hash($type, $path, $raw = false): string|bool {
11321132 $ absolutePath = Filesystem::normalizePath ($ this ->getAbsolutePath ($ path ));
11331133 if (Filesystem::isValidPath ($ path )) {
11341134 $ path = $ this ->getRelativePath ($ absolutePath );
1135- if ($ path == null ) {
1135+ if ($ path === null ) {
11361136 return false ;
11371137 }
11381138 if ($ this ->shouldEmitHooks ($ path )) {
@@ -1183,7 +1183,7 @@ private function basicOperation(string $operation, string $path, array $hooks =
11831183 && !Filesystem::isFileBlacklisted ($ path )
11841184 ) {
11851185 $ path = $ this ->getRelativePath ($ absolutePath );
1186- if ($ path == null ) {
1186+ if ($ path === null ) {
11871187 return false ;
11881188 }
11891189
@@ -1251,7 +1251,7 @@ private function basicOperation(string $operation, string $path, array $hooks =
12511251 }
12521252
12531253 if ($ this ->shouldEmitHooks ($ path ) && $ result !== false ) {
1254- if ($ operation != 'fopen ' ) { //no post hooks for fopen, the file stream is still open
1254+ if ($ operation !== 'fopen ' ) { //no post hooks for fopen, the file stream is still open
12551255 $ this ->runHooks ($ hooks , $ path , true );
12561256 }
12571257 }
@@ -1319,7 +1319,7 @@ private function runHooks($hooks, $path, $post = false) {
13191319 $ run = true ;
13201320 if ($ this ->shouldEmitHooks ($ relativePath )) {
13211321 foreach ($ hooks as $ hook ) {
1322- if ($ hook != 'read ' ) {
1322+ if ($ hook !== 'read ' ) {
13231323 \OC_Hook::emit (
13241324 Filesystem::CLASSNAME ,
13251325 $ prefix . $ hook ,
@@ -2256,7 +2256,7 @@ public function getUidAndFilename($filename) {
22562256 throw new NotFoundException ($ this ->getAbsolutePath ($ filename ) . ' not found ' );
22572257 }
22582258 $ uid = $ info ->getOwner ()->getUID ();
2259- if ($ uid != \OC_User::getUser ()) {
2259+ if ($ uid !== \OC_User::getUser ()) {
22602260 Filesystem::initMountPoints ($ uid );
22612261 $ ownerView = new View ('/ ' . $ uid . '/files ' );
22622262 try {
0 commit comments