Puli\Manager\Api\Module\ModuleFile::__construct PHP Method

__construct() public method

Creates a new module file.
public __construct ( string | null $moduleName = null, string | null $path = null )
$moduleName string | null The module name. Optional.
$path string | null The path where the file is stored or `null` if this configuration is not stored on the file system.
    public function __construct($moduleName = null, $path = null)
    {
        Assert::nullOrModuleName($moduleName);
        Assert::nullOrAbsoluteSystemPath($path);
        $this->path = $path;
        $this->moduleName = $moduleName;
    }

Usage Example

Example #1
0
 /**
  * Creates a new root module file.
  *
  * The file's configuration will inherit its settings from the base
  * configuration passed to the constructor.
  *
  * @param string|null $moduleName The module name. Optional.
  * @param string|null $path       The path where the configuration is
  *                                stored or `null` if this configuration is
  *                                not stored on the file system.
  * @param Config|null $baseConfig The configuration that the module will
  *                                inherit its configuration values from.
  */
 public function __construct($moduleName = null, $path = null, Config $baseConfig = null)
 {
     parent::__construct($moduleName, $path);
     $this->config = new Config($baseConfig);
 }