Skip to content

Latest commit

 

History

History
41 lines (23 loc) · 611 Bytes

git_grep_command.md

File metadata and controls

41 lines (23 loc) · 611 Bytes

Git Grep

Use the interface: ArtARTs36\GitHandler\Contracts\Commands\GitGrepCommand


Create Instance

use \ArtARTs36\GitHandler\Factory\LocalGitFactory;

$command = (new LocalGitFactory())->factory(__DIR__)->greps();

Features:

* Git grep

Method Signature:

public function grep(string $term): \FileMatch[];

Equals Git Command:

git grep -n $term

Example:

use \ArtARTs36\GitHandler\Factory\LocalGitFactory;

(new LocalGitFactory())->factory(__DIR__)->greps()->grep('term-test');