Nwidart\Modules\Module::json PHP Method

json() public method

Get json contents.
public json ( $file = null ) : Json
return Json
    public function json($file = null)
    {
        if (is_null($file)) {
            $file = 'module.json';
        }
        return new Json($this->getPath() . '/' . $file, $this->app['files']);
    }

Usage Example

Example #1
0
 /** @test */
 public function it_reads_module_json_files()
 {
     $jsonModule = $this->module->json();
     $composerJson = $this->module->json('composer.json');
     $this->assertInstanceOf(Json::class, $jsonModule);
     $this->assertEquals('0.1', $jsonModule->get('version'));
     $this->assertInstanceOf(Json::class, $composerJson);
     $this->assertEquals('asgard-module', $composerJson->get('type'));
 }