Commit 89378561 authored by Keven's avatar Keven
Browse files

Require a File reference (URL or slug) to execute File command

parent 2ed1de65
......@@ -14,7 +14,7 @@ class File extends FileCommand
*
* @param \Libcast\Client\Model\FileInterface $file File instance, file URL or file unique slug
*/
public function __construct($file = null)
public function __construct($file)
{
$this->setFile($file);
}
......
......@@ -32,10 +32,10 @@ abstract class FileCommand extends Command
$this->fullPath = $href;
} elseif ('http' == substr($file, 0, 4)) {
$this->fullPath = $file;
} else {
} elseif (is_string($file)) {
$this->setVar('file', $file);
} else {
throw new BadParameterException(sprintf('"%s" command requires a valid file.', $this->getName()));
}
throw new BadParameterException(sprintf('"%s" command requires a valid file.', $this->getName()));
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment