Skip to content

Commit

Permalink
Merge pull request #408 from skipperbent/v4-development
Browse files Browse the repository at this point in the history
Version 4.2.0.1
  • Loading branch information
skipperbent authored Apr 6, 2018
2 parents af641e3 + b8cfc4e commit 13501b3
Show file tree
Hide file tree
Showing 2 changed files with 85 additions and 66 deletions.
116 changes: 51 additions & 65 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

35 changes: 34 additions & 1 deletion src/Pecee/Http/Input/InputHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ public function get(string $index, ?string $defaultValue = null)
* @param array $filter Only take items in filter
* @return array
*/
public function all(array $filter): array
public function all(array $filter = []): array
{
$output = $_GET;

Expand All @@ -316,4 +316,37 @@ public function all(array $filter): array
return ($filter !== null) ? array_intersect_key($output, array_flip($filter)) : $output;
}

/**
* Add GET parameter
*
* @param string $key
* @param InputItem $item
*/
public function addGet(string $key, InputItem $item): void
{
$this->get[$key] = $item;
}

/**
* Add POST parameter
*
* @param string $key
* @param InputItem $item
*/
public function addPost(string $key, InputItem $item): void
{
$this->post[$key] = $item;
}

/**
* Add FILE parameter
*
* @param string $key
* @param InputFile $item
*/
public function addFile(string $key, InputFile $item): void
{
$this->file[$key] = $item;
}

}

0 comments on commit 13501b3

Please sign in to comment.