Skip to content

Commit

Permalink
Some minor refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
ankitpokhrel committed Dec 22, 2018
1 parent c4db35e commit c622799
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/Cache/FileStore.php
Expand Up @@ -90,7 +90,7 @@ protected function createCacheDir()
}

/**
* Create cache file and add required meta.
* Create a cache file.
*
* @return void
*/
Expand Down
6 changes: 4 additions & 2 deletions src/File.php
Expand Up @@ -328,7 +328,7 @@ public function upload(int $totalBytes) : int
}

/**
* Open file in append binary mode.
* Open file in given mode.
*
* @param string $filePath
* @param string $mode
Expand Down Expand Up @@ -374,6 +374,8 @@ public function exists(string $filePath, string $mode = self::READ_BINARY) : boo
}

/**
* Move file pointer to given offset.
*
* @param Resource $handle
* @param int $offset
* @param int $whence
Expand Down Expand Up @@ -510,7 +512,7 @@ public function delete(array $files, bool $folder = false) : bool
}

/**
* Delete files.
* Delete multiple files.
*
* @param array $files
*
Expand Down
7 changes: 4 additions & 3 deletions src/Request.php
Expand Up @@ -2,6 +2,7 @@

namespace TusPhp;

use TusPhp\Tus\Server;
use Symfony\Component\HttpFoundation\Request as HttpRequest;

class Request
Expand Down Expand Up @@ -155,7 +156,7 @@ public function extractMeta(string $requestedKey) : string
*/
public function extractPartials() : array
{
return $this->extractFromHeader('Upload-Concat', 'final;');
return $this->extractFromHeader('Upload-Concat', Server::UPLOAD_TYPE_FINAL . ';');
}

/**
Expand All @@ -165,7 +166,7 @@ public function extractPartials() : array
*/
public function isPartial() : bool
{
return $this->header('Upload-Concat') === 'partial';
return Server::UPLOAD_TYPE_PARTIAL === $this->header('Upload-Concat');
}

/**
Expand All @@ -175,7 +176,7 @@ public function isPartial() : bool
*/
public function isFinal() : bool
{
return false !== strpos($this->header('Upload-Concat'), 'final;');
return false !== strpos($this->header('Upload-Concat'), Server::UPLOAD_TYPE_FINAL . ';');
}

/**
Expand Down

0 comments on commit c622799

Please sign in to comment.