public function doAddPattern($pattern)
    {
        if (0 === strpos($pattern, '!')) {
            $searchPattern = substr($pattern, 1);
            $this->finder->notPath(Glob::toRegex($searchPattern, true, true));

            $pathComponents = explode('/', $searchPattern);

            if (1 < \count($pathComponents)) {
                $parentDirectories = \array_slice($pathComponents, 0, -1);
                $basePath = '';

                foreach ($parentDirectories as $dir) {
                    $this->finder->notPath('/\b('.preg_quote($basePath.$dir, '/').')(?!\/)\b/');
                    $basePath .= $dir.'/';
                }
            }
        } else {
            $this->finder->path(Glob::toRegex($pattern, true, true));
        }
    }
public function doAddPattern($pattern)
    {
        if (0 === strpos($pattern, '!')) {
            $searchPattern = substr($pattern, 1);
            $this->finder->notPath(Glob::toRegex($searchPattern, true, true));

            $pathComponents = explode('/', $searchPattern);

            if (1 < \count($pathComponents)) {
                $parentDirectories = \array_slice($pathComponents, 0, -1);
                $basePath = '';

                foreach ($parentDirectories as $dir) {
                    $this->finder->notPath('/\b('.preg_quote($basePath.$dir, '/').')(?!\/)\b/');
                    $basePath .= $dir.'/';
                }
            }
        } else {
            $this->finder->path(Glob::toRegex($pattern, true, true));
        }
    }
public function doAddPattern ( $ pattern ) { if ( 0 === strpos ( $ pattern , '!' ) ) { $ searchPattern = substr ( $ pattern , 1 ) ; $ this -> finder -> notPath ( Glob :: toRegex ( $ searchPattern , true , true ) ) ; $ pathComponents = explode ( '/' , $ searchPattern ) ; if ( 1 < \ count ( $ pathComponents ) ) { $ parentDirectories = \ array_slice ( $ pathComponents , 0 , - 1 ) ; $ basePath = '' ; foreach ( $ parentDirectories as $ dir ) { $ this -> finder -> notPath ( '/\b(' . preg_quote ( $ basePath . $ dir , '/' ) . ')(?!\/)\b/' ) ; $ basePath .= $ dir . '/' ; } } } else { $ this -> finder -> path ( Glob :: toRegex ( $ pattern , true , true ) ) ; } }
Action for Add an ignore pattern.

@param string $pattern The pattern
Action for Add an ignore pattern .