diff --git a/file_example/file_example.routing.yml b/file_example/file_example.routing.yml index d07a754..ed00fad 100644 --- a/file_example/file_example.routing.yml +++ b/file_example/file_example.routing.yml @@ -1,4 +1,4 @@ -# Main page for our example. +# Main page for our example. file_example.fileapi: path: '/examples/file_example' defaults: diff --git a/file_example/src/Form/FileExampleReadWriteForm.php b/file_example/src/Form/FileExampleReadWriteForm.php index aece261..2b5de8b 100644 --- a/file_example/src/Form/FileExampleReadWriteForm.php +++ b/file_example/src/Form/FileExampleReadWriteForm.php @@ -80,11 +80,13 @@ class FileExampleReadWriteForm extends FormBase { * @param RequestStack $request_stack * Access to the current request, including to session objects. */ - public function __construct(StateInterface $state, - FileSystemInterface $file_system, - StreamWrapperManagerInterface $stream_wrapper_manager, - ModuleHandlerInterface $module_handler, - RequestStack $request_stack) { + public function __construct( + StateInterface $state, + FileSystemInterface $file_system, + StreamWrapperManagerInterface $stream_wrapper_manager, + ModuleHandlerInterface $module_handler, + RequestStack $request_stack + ) { $this->state = $state; $this->fileSystem = $file_system; $this->moduleHandler = $module_handler; @@ -136,12 +138,13 @@ class FileExampleReadWriteForm extends FormBase { * FALSE if the stream_wrapper_example is not enabled. * * @return Drupal\stream_wrapper_example\StreamWrapper\SessionWrapper|bool - * Wrapper object to manipulate the SESSION storage. + * Wrapper object to manipulate the SESSION storage or FALSE if the session + * wrapper is unavailable. + * + * @todo Update this to be meaningful when stream_wrapper_example is + * completed. https://www.drupal.org/node/2638290 */ protected function getSessionWrapper() { - if ($this->sessionSchemeEnabled) { - return new \Drupal\stream_wrapper_example\StreamWrapper\SessionWrapper($this->requestStack); - } return FALSE; } @@ -260,7 +263,6 @@ class FileExampleReadWriteForm extends FormBase { return FALSE; } - /** * {@inheritdoc} */ @@ -500,7 +502,6 @@ class FileExampleReadWriteForm extends FormBase { } } - /** * Submit handler to write an unmanaged file using plain PHP functions. * @@ -571,7 +572,6 @@ class FileExampleReadWriteForm extends FormBase { } - /** * Submit handler for reading a stream wrapper. * @@ -650,7 +650,6 @@ class FileExampleReadWriteForm extends FormBase { } - /** * Submit handler to delete a file. *