Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
632 changes: 318 additions & 314 deletions composer.lock

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/Storage/Validator/File.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

class File extends Validator
{
public function getDescription()
public function getDescription(): string
{
return 'File is not valid';
}
Expand All @@ -20,7 +20,7 @@ public function getDescription()
*
* @return bool
*/
public function isValid($name)
public function isValid($name): bool
{
return true;
}
Expand Down
4 changes: 2 additions & 2 deletions src/Storage/Validator/FileExt.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public function __construct(array $allowed)
/**
* Get Description
*/
public function getDescription()
public function getDescription(): string
{
return 'File extension is not valid';
}
Expand All @@ -41,7 +41,7 @@ public function getDescription()
*
* @return bool
*/
public function isValid($filename)
public function isValid($filename): bool
{
$ext = pathinfo($filename, PATHINFO_EXTENSION);

Expand Down
7 changes: 5 additions & 2 deletions src/Storage/Validator/FileName.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@

class FileName extends Validator
{
public function getDescription()
/**
* Get Description
*/
public function getDescription(): string
{
return 'Filename is not valid';
}
Expand All @@ -18,7 +21,7 @@ public function getDescription()
*
* @return bool
*/
public function isValid($name)
public function isValid($name): bool
{
if (empty($name)) {
return false;
Expand Down
7 changes: 5 additions & 2 deletions src/Storage/Validator/FileSize.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ public function __construct($max)
$this->max = $max;
}

public function getDescription()
/**
* Get Description
*/
public function getDescription(): string
{
return 'File size can\'t be bigger than '.$this->max;
}
Expand All @@ -33,7 +36,7 @@ public function getDescription()
*
* @return bool
*/
public function isValid($fileSize)
public function isValid($fileSize): bool
{
if (!is_int($fileSize)) {
return false;
Expand Down
4 changes: 2 additions & 2 deletions src/Storage/Validator/FileType.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function __construct(array $allowed)
/**
* Get Description
*/
public function getDescription()
public function getDescription(): string
{
return 'File mime-type is not allowed ';
}
Expand All @@ -67,7 +67,7 @@ public function getDescription()
*
* @return bool
*/
public function isValid($path)
public function isValid($path): bool
{
if (!\is_readable($path)) {
return false;
Expand Down
7 changes: 5 additions & 2 deletions src/Storage/Validator/Upload.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@

class Upload extends Validator
{
public function getDescription()
/**
* Get Description
*/
public function getDescription(): string
{
return 'Not a valid upload file';
}
Expand All @@ -18,7 +21,7 @@ public function getDescription()
*
* @return bool
*/
public function isValid($path)
public function isValid($path): bool
{
if (!is_string($path)) {
return false;
Expand Down