Visualphpunit\Core\Parser::filterTrace PHP Method

filterTrace() private method

Filter the trace to exclude vendor and VPU classes
private filterTrace ( array $trace ) : mixed[]
$trace array
return mixed[]
    private function filterTrace($trace)
    {
        $vpuPath = realpath(__DIR__ . '/../');
        $vendorPath = realpath(__DIR__ . '/../../vendor');
        $backendPath = realpath(__DIR__ . '/../../backend');
        $newTrace = [];
        if (!empty($trace)) {
            foreach ($trace as $entity) {
                if (isset($entity['file']) && !strstr($entity['file'], $vendorPath) && !strstr($entity['file'], $vpuPath) && !strstr($entity['file'], $backendPath)) {
                    $newTrace[] = $entity;
                }
            }
        }
        return $newTrace;
    }