laravel/framework — pull request #230 by laravelbook (2013-02-01 14:06:03+00:00)
Title: Fix minor inconsistencies in Illuminate\Http\Request class

The `Illuminate\Http\Request` class has a method named `getSessionStore()` which is used to fetch the session store associated with the request. This method raises a `RuntimeException` if the underlying session store has not been initialized. However, `flash()` and `flush()` methods on the same class try to access the $sessionStore field directly. These methods should take advantage of `getSessionStore()` which guards against null object.

I have modified the said methods to utilize `getSessionStore()`:
```php
public function flash($filter = null, $keys = array())
{
$flash = ( ! is_null($filter)) ? $this->$filter($keys) : $this->input();

$this->getSessionStore()->flashInput($flash);
}

public function flush()
{
$this->getSessionStore()->flashInput(array());
}
```
Additionally, I have added the `hasSessionStore()` method to check if the request object has a valid session store (cf. issues [#229](https://github.com/laravel/framework/issues/229) and [#227](https://github.com/laravel/framework/issues/229) as well as [ardent#3](https://github.com/laravelbook/ardent/issues/3))
```php
/**
* Determine if the current request has a valid session store.
*
* @return bool
*/
public function hasSessionStore()
{
return isset( $this->sessionStore );
}
```