public function getExpectedGitattributesContent(array $postfixlessExportIgnores = [])
    {
        if ($postfixlessExportIgnores === []) {
            $postfixlessExportIgnores = $this->collectExpectedExportIgnores();
        }

        if (!$this->hasGitattributesFile() && count($postfixlessExportIgnores) > 0) {
            $postfixlessExportIgnores[] = '.gitattributes';
        }

        sort($postfixlessExportIgnores, SORT_STRING | SORT_FLAG_CASE);

        if (count($postfixlessExportIgnores) > 0) {
            if ($this->isAlignExportIgnoresEnabled() || $this->isStrictAlignmentCamparisonEnabled()) {
                $postfixlessExportIgnores = $this->getAlignedExportIgnoreArtifacts(
                    $postfixlessExportIgnores
                );
            }

            $content = implode(" export-ignore" . $this->preferredEol, $postfixlessExportIgnores)
                . " export-ignore" . $this->preferredEol;

            if ($this->hasGitattributesFile()) {
                $exportIgnoreContent = rtrim($content);
                $content = $this->getPresentNonExportIgnoresContent();

                if (strstr($content, self::EXPORT_IGNORES_PLACEMENT_PLACEHOLDER)) {
                    $content = str_replace(
                        self::EXPORT_IGNORES_PLACEMENT_PLACEHOLDER,
                        $exportIgnoreContent,
                        $content
                    );
                } else {
                    $content = $content
                        . str_repeat($this->preferredEol, 2)
                        . $exportIgnoreContent;
                }
            } else {
                $content = "* text=auto eol=lf"
                    . str_repeat($this->preferredEol, 2)
                    . $content;
            }

            return $content;
        }

        return '';
    }
public function getExpectedGitattributesContent(array $postfixlessExportIgnores = [])
    {
        if ($postfixlessExportIgnores === []) {
            $postfixlessExportIgnores = $this->collectExpectedExportIgnores();
        }

        if (!$this->hasGitattributesFile() && count($postfixlessExportIgnores) > 0) {
            $postfixlessExportIgnores[] = '.gitattributes';
        }

        sort($postfixlessExportIgnores, SORT_STRING | SORT_FLAG_CASE);

        if (count($postfixlessExportIgnores) > 0) {
            if ($this->isAlignExportIgnoresEnabled() || $this->isStrictAlignmentCamparisonEnabled()) {
                $postfixlessExportIgnores = $this->getAlignedExportIgnoreArtifacts(
                    $postfixlessExportIgnores
                );
            }

            $content = implode(" export-ignore" . $this->preferredEol, $postfixlessExportIgnores)
                . " export-ignore" . $this->preferredEol;

            if ($this->hasGitattributesFile()) {
                $exportIgnoreContent = rtrim($content);
                $content = $this->getPresentNonExportIgnoresContent();

                if (strstr($content, self::EXPORT_IGNORES_PLACEMENT_PLACEHOLDER)) {
                    $content = str_replace(
                        self::EXPORT_IGNORES_PLACEMENT_PLACEHOLDER,
                        $exportIgnoreContent,
                        $content
                    );
                } else {
                    $content = $content
                        . str_repeat($this->preferredEol, 2)
                        . $exportIgnoreContent;
                }
            } else {
                $content = "* text=auto eol=lf"
                    . str_repeat($this->preferredEol, 2)
                    . $content;
            }

            return $content;
        }

        return '';
    }
public function getExpectedGitattributesContent ( array $ postfixlessExportIgnores = [ ] ) { if ( $ postfixlessExportIgnores === [ ] ) { $ postfixlessExportIgnores = $ this -> collectExpectedExportIgnores ( ) ; } if ( ! $ this -> hasGitattributesFile ( ) && count ( $ postfixlessExportIgnores ) > 0 ) { $ postfixlessExportIgnores [ ] = '.gitattributes' ; } sort ( $ postfixlessExportIgnores , SORT_STRING | SORT_FLAG_CASE ) ; if ( count ( $ postfixlessExportIgnores ) > 0 ) { if ( $ this -> isAlignExportIgnoresEnabled ( ) || $ this -> isStrictAlignmentCamparisonEnabled ( ) ) { $ postfixlessExportIgnores = $ this -> getAlignedExportIgnoreArtifacts ( $ postfixlessExportIgnores ) ; } $ content = implode ( " export-ignore" . $ this -> preferredEol , $ postfixlessExportIgnores ) . " export-ignore" . $ this -> preferredEol ; if ( $ this -> hasGitattributesFile ( ) ) { $ exportIgnoreContent = rtrim ( $ content ) ; $ content = $ this -> getPresentNonExportIgnoresContent ( ) ; if ( strstr ( $ content , self :: EXPORT_IGNORES_PLACEMENT_PLACEHOLDER ) ) { $ content = str_replace ( self :: EXPORT_IGNORES_PLACEMENT_PLACEHOLDER , $ exportIgnoreContent , $ content ) ; } else { $ content = $ content . str_repeat ( $ this -> preferredEol , 2 ) . $ exportIgnoreContent ; } } else { $ content = "* text=auto eol=lf" . str_repeat ( $ this -> preferredEol , 2 ) . $ content ; } return $ content ; } return '' ; }
Return the expected .gitattributes content.

@param  array $postfixlessExportIgnores Expected patterns without
an export-ignore postfix.

@return string
Return the expected . gitattributes content .