$parent = substr($path, 0, strrpos($path, '/') ?: 0);
$path = $this->getAbsolutePath($path);
[$storage, $internalPath] = Filesystem::resolvePath($path);
- if (Filesystem::isValidPath($parent) and $storage) {
+ if (Filesystem::isValidPath($parent) && $storage) {
return $storage->getLocalFile($internalPath);
} else {
return false;
* @param int|string $mtime
*/
public function touch($path, $mtime = null): bool {
- if (!is_null($mtime) and !is_numeric($mtime)) {
+ if (!is_null($mtime) && !is_numeric($mtime)) {
$mtime = strtotime($mtime);
}
if (is_resource($data)) { //not having to deal with streams in file_put_contents makes life easier
$absolutePath = Filesystem::normalizePath($this->getAbsolutePath($path));
if (Filesystem::isValidPath($path)
- and !Filesystem::isFileBlacklisted($path)
+ && !Filesystem::isFileBlacklisted($path)
) {
$path = $this->getRelativePath($absolutePath);
if ($path === null) {
$result = false;
if (
Filesystem::isValidPath($target)
- and Filesystem::isValidPath($source)
- and !Filesystem::isFileBlacklisted($target)
+ && Filesystem::isValidPath($source)
+ && !Filesystem::isFileBlacklisted($target)
) {
$source = $this->getRelativePath($absolutePath1);
$target = $this->getRelativePath($absolutePath2);
$exists = $this->file_exists($target);
- if ($source == null or $target == null) {
+ if ($source == null || $target == null) {
return false;
}
$this->emit_file_hooks_post($exists, $target);
}
} elseif ($result) {
- if ($this->shouldEmitHooks($source) and $this->shouldEmitHooks($target)) {
+ if ($this->shouldEmitHooks($source) && $this->shouldEmitHooks($target)) {
\OC_Hook::emit(
Filesystem::CLASSNAME,
Filesystem::signal_post_rename,
$result = false;
if (
Filesystem::isValidPath($target)
- and Filesystem::isValidPath($source)
- and !Filesystem::isFileBlacklisted($target)
+ && Filesystem::isValidPath($source)
+ && !Filesystem::isFileBlacklisted($target)
) {
$source = $this->getRelativePath($absolutePath1);
$target = $this->getRelativePath($absolutePath2);
- if ($source == null or $target == null) {
+ if ($source == null || $target == null) {
return false;
}
$run = true;
$postFix = (substr($path, -1) === '/') ? '/' : '';
$absolutePath = Filesystem::normalizePath($this->getAbsolutePath($path));
if (Filesystem::isValidPath($path)
- and !Filesystem::isFileBlacklisted($path)
+ && !Filesystem::isFileBlacklisted($path)
) {
$path = $this->getRelativePath($absolutePath);
if ($path == null) {
$run = $this->runHooks($hooks, $path);
[$storage, $internalPath] = Filesystem::resolvePath($absolutePath . $postFix);
- if ($run and $storage) {
+ if ($run && $storage) {
/** @var Storage $storage */
if (in_array('write', $hooks) || in_array('delete', $hooks)) {
try {
$info = new FileInfo($path, $storage, $internalPath, $data, $mount, $owner);
if (isset($data['fileid'])) {
- if ($includeMountPoints and $data['mimetype'] === 'httpd/unix-directory') {
+ if ($includeMountPoints && $data['mimetype'] === 'httpd/unix-directory') {
//add the sizes of other mount points to the folder
$extOnly = ($includeMountPoints === 'ext');
$this->addSubMounts($info, $extOnly);