@@ -104,7 +104,7 @@ public function getAbsolutePath($path = '/'): ?string {
104104 * @param string $fakeRoot
105105 */
106106 public function chroot ($ fakeRoot ): void {
107- if (! $ fakeRoot == '' ) {
107+ if ($ fakeRoot ! == '' ) {
108108 if ($ fakeRoot [0 ] !== '/ ' ) {
109109 $ fakeRoot = '/ ' . $ fakeRoot ;
110110 }
@@ -126,7 +126,7 @@ public function getRoot(): string {
126126 */
127127 public function getRelativePath ($ path ): ?string {
128128 $ this ->assertPathLength ($ path );
129- if ($ this ->fakeRoot == '' ) {
129+ if ($ this ->fakeRoot === '' ) {
130130 return $ path ;
131131 }
132132
@@ -319,7 +319,7 @@ public function opendir($path) {
319319 * @return bool|mixed
320320 */
321321 public function is_dir ($ path ) {
322- if ($ path == '/ ' ) {
322+ if ($ path === '/ ' ) {
323323 return true ;
324324 }
325325 return $ this ->basicOperation ('is_dir ' , $ path );
@@ -330,7 +330,7 @@ public function is_dir($path) {
330330 * @return bool|mixed
331331 */
332332 public function is_file ($ path ) {
333- if ($ path == '/ ' ) {
333+ if ($ path === '/ ' ) {
334334 return false ;
335335 }
336336 return $ this ->basicOperation ('is_file ' , $ path );
@@ -496,7 +496,7 @@ public function isSharable($path) {
496496 * @return bool|mixed
497497 */
498498 public function file_exists ($ path ) {
499- if ($ path == '/ ' ) {
499+ if ($ path === '/ ' ) {
500500 return true ;
501501 }
502502 return $ this ->basicOperation ('file_exists ' , $ path );
@@ -728,7 +728,7 @@ public function rename($source, $target, array $options = []) {
728728 $ target = $ this ->getRelativePath ($ absolutePath2 );
729729 $ exists = $ this ->file_exists ($ target );
730730
731- if ($ source == null || $ target == null ) {
731+ if ($ source === null || $ target = == null ) {
732732 return false ;
733733 }
734734
@@ -925,7 +925,7 @@ public function copy($source, $target, $preserveMtime = false) {
925925 $ source = $ this ->getRelativePath ($ absolutePath1 );
926926 $ target = $ this ->getRelativePath ($ absolutePath2 );
927927
928- if ($ source == null || $ target == null ) {
928+ if ($ source === null || $ target = == null ) {
929929 return false ;
930930 }
931931 $ run = true ;
@@ -960,7 +960,7 @@ public function copy($source, $target, $preserveMtime = false) {
960960 $ this ->changeLock ($ target , ILockingProvider::LOCK_EXCLUSIVE );
961961 $ lockTypePath2 = ILockingProvider::LOCK_EXCLUSIVE ;
962962
963- if ($ mount1 ->getMountPoint () == $ mount2 ->getMountPoint ()) {
963+ if ($ mount1 ->getMountPoint () === $ mount2 ->getMountPoint ()) {
964964 if ($ storage1 ) {
965965 $ result = $ storage1 ->copy ($ internalPath1 , $ internalPath2 );
966966 } else {
@@ -1131,7 +1131,7 @@ public function hash($type, $path, $raw = false): string|bool {
11311131 $ absolutePath = Filesystem::normalizePath ($ this ->getAbsolutePath ($ path ));
11321132 if (Filesystem::isValidPath ($ path )) {
11331133 $ path = $ this ->getRelativePath ($ absolutePath );
1134- if ($ path == null ) {
1134+ if ($ path === null ) {
11351135 return false ;
11361136 }
11371137 if ($ this ->shouldEmitHooks ($ path )) {
@@ -1182,7 +1182,7 @@ private function basicOperation(string $operation, string $path, array $hooks =
11821182 && !Filesystem::isFileBlacklisted ($ path )
11831183 ) {
11841184 $ path = $ this ->getRelativePath ($ absolutePath );
1185- if ($ path == null ) {
1185+ if ($ path === null ) {
11861186 return false ;
11871187 }
11881188
@@ -1250,7 +1250,7 @@ private function basicOperation(string $operation, string $path, array $hooks =
12501250 }
12511251
12521252 if ($ this ->shouldEmitHooks ($ path ) && $ result !== false ) {
1253- if ($ operation != 'fopen ' ) { //no post hooks for fopen, the file stream is still open
1253+ if ($ operation !== 'fopen ' ) { //no post hooks for fopen, the file stream is still open
12541254 $ this ->runHooks ($ hooks , $ path , true );
12551255 }
12561256 }
@@ -1318,7 +1318,7 @@ private function runHooks($hooks, $path, $post = false) {
13181318 $ run = true ;
13191319 if ($ this ->shouldEmitHooks ($ relativePath )) {
13201320 foreach ($ hooks as $ hook ) {
1321- if ($ hook != 'read ' ) {
1321+ if ($ hook !== 'read ' ) {
13221322 \OC_Hook::emit (
13231323 Filesystem::CLASSNAME ,
13241324 $ prefix . $ hook ,
@@ -2252,7 +2252,7 @@ public function getUidAndFilename($filename) {
22522252 throw new NotFoundException ($ this ->getAbsolutePath ($ filename ) . ' not found ' );
22532253 }
22542254 $ uid = $ info ->getOwner ()->getUID ();
2255- if ($ uid != \OC_User::getUser ()) {
2255+ if ($ uid !== \OC_User::getUser ()) {
22562256 Filesystem::initMountPoints ($ uid );
22572257 $ ownerView = new View ('/ ' . $ uid . '/files ' );
22582258 try {
0 commit comments