You are here

class ModuleFileWriterDummyLocation in Module Builder 8.3

Test file writer which puts module files in the test site folder.

This ensures that they are cleaned up, and do not interfere with site code.

Hierarchy

Expanded class hierarchy of ModuleFileWriterDummyLocation

1 string reference to 'ModuleFileWriterDummyLocation'
test_dummy_module_write_location.services.yml in tests/modules/test_dummy_module_write_location/test_dummy_module_write_location.services.yml
tests/modules/test_dummy_module_write_location/test_dummy_module_write_location.services.yml
1 service uses ModuleFileWriterDummyLocation
test_dummy_module_write_location.module_file_writer_dummy_location in tests/modules/test_dummy_module_write_location/test_dummy_module_write_location.services.yml
Drupal\test_dummy_module_write_location\ModuleFileWriterDummyLocation

File

tests/modules/test_dummy_module_write_location/src/ModuleFileWriterDummyLocation.php, line 13

Namespace

Drupal\test_dummy_module_write_location
View source
class ModuleFileWriterDummyLocation extends ModuleFileWriter {

  /**
   * Put modules in the site folder, as that gets cleaned up.
   */
  public function getRelativeModuleFolder($module_name) {
    $site_path = \Drupal::service('site.path');
    return $site_path . '/' . $module_name;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
ModuleFileWriter::$fileSystem protected property The File system service.
ModuleFileWriter::$moduleExtensionList protected property The Module extension list service.
ModuleFileWriter::writeSingleFile public function Writes a single file.
ModuleFileWriter::__construct public function Creates a ModuleFileWriter instance.
ModuleFileWriterDummyLocation::getRelativeModuleFolder public function Put modules in the site folder, as that gets cleaned up. Overrides ModuleFileWriter::getRelativeModuleFolder