The Ignorant library allows you to check if a path or name is ignored in a pattern list or in a pattern dot (.) file.
Using composer, you can install Ignorant with the following command:
composer require sikessem/ignorant
Explore our .gitignore file:
<?php
use Sikessem\Ignorant\Ignorefile;
require_once "$VENDOR_DIR/autoload.php";
$gitignore = new Ignorefile(__DIR__.'/.gitignore');
$gitignore->contains('/vendor/'); // Returns true
$gitignore->contains('/.phpunit*'); // Returns true
$gitignore->includes('/vendor/autoload.php'); // Returns true
$gitignore->includes('/.phpunit.result.cache'); // Returns true
$gitignore->excludes('src'); // Return true
$gitignore->excludes('/tests/Unit'); // Return true
This library is distributed under the
Please send any sensitive issue to [email protected]. Thanks!