Esempio n. 1
0
 /**
  * Construct an instance of a FrontModule.
  */
 public function __construct()
 {
     parent::__construct();
     $this->register('index', FrontModuleController::class, 'getIndex', 'Home');
     $this->register('modules', FrontModuleController::class, 'getModules', 'Modules');
     $this->register('issues', FrontModuleController::class, 'getIssues', 'Module issues');
 }
Esempio n. 2
0
 public function boot()
 {
     parent::boot();
     if (!$this->container->bound(JobSchedulerInterface::class)) {
         throw new CoreException('This module requires the Jobs component to be loaded. ' . 'Please make sure that `JobsServiceProvider` ' . 'is in your application\'s `config/app.php` file.');
     }
 }
 /**
  * Boot the module.
  *
  * @throws CoreException
  */
 public function boot()
 {
     parent::boot();
     if (!$this->container->bound(ApplicationManifestInterface::class)) {
         throw new CoreException('An instance of ApplicationManifest must be bound to in the ' . 'container in order to provide application reflection data.');
     }
 }
Esempio n. 4
0
 /**
  * Construct an instance of a HttpModule.
  */
 public function __construct()
 {
     parent::__construct();
     $this->register('index', HttpModuleController::class, 'getIndex', 'All Routes');
     $this->register('middleware', HttpModuleController::class, 'getRouterMiddleware', 'Middleware');
     $this->register('patterns', HttpModuleController::class, 'getPatterns', 'Patterns');
 }
 /**
  * Boot the module.
  *
  * @throws CoreException
  */
 public function boot()
 {
     parent::boot();
     if (!$this->container->bound(StructuredStatusInterface::class)) {
         throw new CoreException('This module requires the Structured service to be loaded. ' . 'Please make sure that `StructuredMigrationsServiceProvider` ' . 'is in your application\'s `config/app.php` file.');
     }
     if (!$this->container->bound(Batch::class)) {
         throw new CoreException('While the Structured service is loaded, there isn\'t a ' . 'Batch defined at the moment. Please define a Batch class ' . 'for your application and bind it using a service provider.');
     }
 }
Esempio n. 6
0
 /**
  * Resolve a method inside a module.
  *
  * @param Module $module
  * @param null $methodName
  *
  * @throws MethodNotFoundException
  * @return mixed
  */
 protected function resolveMethod(Module $module, $methodName = null)
 {
     $selected = $methodName;
     if ($methodName === null) {
         $selected = $module->getDefaultMethodName();
     }
     if (!$module->hasMethod($selected)) {
         throw new MethodNotFoundException($module->getName(), $methodName);
     }
     return $module->getMethod($selected);
 }