cleanup context handling for wrappers

This commit is contained in:
Robin Appelman 2019-03-11 16:52:13 +01:00
commit 2c8ae56d02
16 changed files with 182 additions and 258 deletions

View file

@ -38,7 +38,7 @@ class Path {
* @param string $class
* @param array $contextOptions
*/
public function __construct($class, $contextOptions = array()) {
public function __construct($class, $contextOptions = []) {
$this->class = $class;
$this->contextOptions = $contextOptions;
}
@ -75,7 +75,7 @@ class Path {
*/
protected function appendDefaultContent($values) {
if (!is_array(current($values))) {
$values = array($this->getProtocol() => $values);
$values = [$this->getProtocol() => $values];
}
$context = stream_context_get_default();
$defaults = stream_context_get_options($context);