Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.2] Added "hasHeader" request method #13271

Merged
merged 4 commits into from
Apr 23, 2016
Merged
Changes from 2 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
12 changes: 12 additions & 0 deletions src/Illuminate/Http/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -498,6 +498,18 @@ protected function isValidFile($file)
return $file instanceof SplFileInfo && $file->getPath() != '';
}

/**
* Determine if a header is set on the request.
*
* @param string $key
*
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please remove this extra newline

* @return boolean
*/
public function hasHeader($key)
{
return ! is_null($this->header($key));
}

/**
* Retrieve a header from the request.
*
Expand Down