PhpGitHooks\Module\Git\Contract\QueryHandler\GitIgnoreExtractorQueryHandler::handle PHP Метод

handle() публичный Метод

public handle ( Bruli\EventBusBundle\QueryBus\QueryInterface $query ) : GitIgnoreDataResponse | PhpGitHooks\Module\Git\Contract\Query\GitIgnoreExtractorQuery
$query Bruli\EventBusBundle\QueryBus\QueryInterface
Результат PhpGitHooks\Module\Git\Contract\Response\GitIgnoreDataResponse | PhpGitHooks\Module\Git\Contract\Query\GitIgnoreExtractorQuery
    public function handle(QueryInterface $query)
    {
        return $this->gitIgnoreExtractor->extract();
    }

Usage Example

 /**
  * @test
  */
 public function itShouldReturnNotNull()
 {
     $content = 'composer.phar
     vendor/
     bin/
     php-git-hooks.yml
     # Commit your application\'s lock file http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file
     # You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file
     # composer.lock
     ';
     $this->shouldReadGitIgnoreFile($content);
     $query = new GitIgnoreExtractorQuery();
     $data = $this->gitIgnoreExtractorQueryHandler->handle($query);
     $this->assertInstanceOf(GitIgnoreDataResponse::class, $data);
     $this->assertNotNull($data->getContent());
 }
GitIgnoreExtractorQueryHandler