mirror of
https://github.com/skipperbent/simple-php-router.git
synced 2026-07-11 11:52:19 +00:00
Development
This commit is contained in:
@@ -41,17 +41,17 @@ class InputCollection implements \IteratorAggregate
|
||||
{
|
||||
$input = $this->findFirst($index);
|
||||
|
||||
if($input !== null) {
|
||||
if(trim($input->getValue()) === '') {
|
||||
return $default;
|
||||
}
|
||||
|
||||
return $input;
|
||||
if($input !== null && trim($input->getValue()) !== '') {
|
||||
return $input->getValue();
|
||||
}
|
||||
|
||||
return $default;
|
||||
}
|
||||
|
||||
public function getValue($index, $default = null) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $index
|
||||
* @throws \InvalidArgumentException
|
||||
|
||||
@@ -60,24 +60,48 @@ class InputFile extends InputItem
|
||||
return file_get_contents($this->tmpName);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set file temp. name
|
||||
* @param string $name
|
||||
* @return static $this
|
||||
*/
|
||||
public function setTmpName($name)
|
||||
{
|
||||
$this->tmpName = $name;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set file size
|
||||
* @param int $size
|
||||
* @return static $this
|
||||
*/
|
||||
public function setSize($size)
|
||||
{
|
||||
$this->size = $size;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set type
|
||||
* @param string $type
|
||||
* @return static $this
|
||||
*/
|
||||
public function setType($type)
|
||||
{
|
||||
$this->type = $type;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set error
|
||||
* @param int $error
|
||||
* @return static $this
|
||||
*/
|
||||
public function setError($error)
|
||||
{
|
||||
$this->error = $error;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -101,9 +125,12 @@ class InputFile extends InputItem
|
||||
return $input;
|
||||
}
|
||||
|
||||
public function __toString()
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getValue()
|
||||
{
|
||||
return (string)$this->tmpName;
|
||||
return $this->tmpName;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -17,7 +17,7 @@ class InputItem
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
* @return string
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
@@ -25,7 +25,7 @@ class InputItem
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
* @return string
|
||||
*/
|
||||
public function getValue()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user