Simply change that line to:

```php
'method'  => $_SERVER['REQUEST_METHOD']
```
Just assume that $_SERVER is always there, because youd have to do the same to the other global variables like $_POST etc. also if you dont. If the key does not exist in an array its null by default, check it on http://writecodeonline.com/php/