Nwidart\Modules\Module::getComposerAttr PHP Method

getComposerAttr() public method

Get a specific data from composer.json file by given the key.
public getComposerAttr ( $key, null $default = null ) : mixed
$key
$default null
return mixed
    public function getComposerAttr($key, $default = null)
    {
        return $this->json('composer.json')->get($key, $default);
    }

Usage Example

Example #1
0
 /** @test */
 public function it_reads_key_from_composer_json_file_via_helper_method()
 {
     $this->assertEquals('nwidart/recipe', $this->module->getComposerAttr('name'));
 }