public function calculateDescription()
    {
        $status = $this->x . $this->y;
        $matching = [
            '/ [MD]/'   => 'not updated',
            '/M[MD]/'   => 'updated in index',
            '/A[MD]/'   => 'added to index',
            '/D[M]/'    => 'deleted from index',
            '/R[MD]/'   => 'renamed in index',
            '/C[MD]/'   => 'copied in index',
            '/[MARC] /' => 'index and work tree matches',
            '/[MARC]M/' => 'work tree changed since index',
            '/[MARC]D/' => 'deleted in work tree',
            '/DD/'      => 'unmerged, both deleted',
            '/AU/'      => 'unmerged, added by us',
            '/UD/'      => 'unmerged, deleted by them',
            '/UA/'      => 'unmerged, added by them',
            '/DU/'      => 'unmerged, deleted by us',
            '/AA/'      => 'unmerged, both added',
            '/UU/'      => 'unmerged, both modified',
            '/\?\?/'    => 'untracked',
            '/!!/'      => 'ignored',
        ];
        $out = [];
        foreach ($matching as $pattern => $label) {
            if (preg_match($pattern, $status)) {
                $out[] = $label;
            }
        }

        $this->description = implode(', ', $out);
    }
public function calculateDescription()
    {
        $status = $this->x . $this->y;
        $matching = [
            '/ [MD]/'   => 'not updated',
            '/M[MD]/'   => 'updated in index',
            '/A[MD]/'   => 'added to index',
            '/D[M]/'    => 'deleted from index',
            '/R[MD]/'   => 'renamed in index',
            '/C[MD]/'   => 'copied in index',
            '/[MARC] /' => 'index and work tree matches',
            '/[MARC]M/' => 'work tree changed since index',
            '/[MARC]D/' => 'deleted in work tree',
            '/DD/'      => 'unmerged, both deleted',
            '/AU/'      => 'unmerged, added by us',
            '/UD/'      => 'unmerged, deleted by them',
            '/UA/'      => 'unmerged, added by them',
            '/DU/'      => 'unmerged, deleted by us',
            '/AA/'      => 'unmerged, both added',
            '/UU/'      => 'unmerged, both modified',
            '/\?\?/'    => 'untracked',
            '/!!/'      => 'ignored',
        ];
        $out = [];
        foreach ($matching as $pattern => $label) {
            if (preg_match($pattern, $status)) {
                $out[] = $label;
            }
        }

        $this->description = implode(', ', $out);
    }
public function calculateDescription ( ) { $ status = $ this -> x . $ this -> y ; $ matching = [ '/ [MD]/' => 'not updated' , '/M[MD]/' => 'updated in index' , '/A[MD]/' => 'added to index' , '/D[M]/' => 'deleted from index' , '/R[MD]/' => 'renamed in index' , '/C[MD]/' => 'copied in index' , '/[MARC] /' => 'index and work tree matches' , '/[MARC]M/' => 'work tree changed since index' , '/[MARC]D/' => 'deleted in work tree' , '/DD/' => 'unmerged, both deleted' , '/AU/' => 'unmerged, added by us' , '/UD/' => 'unmerged, deleted by them' , '/UA/' => 'unmerged, added by them' , '/DU/' => 'unmerged, deleted by us' , '/AA/' => 'unmerged, both added' , '/UU/' => 'unmerged, both modified' , '/\?\?/' => 'untracked' , '/!!/' => 'ignored' , ] ; $ out = [ ] ; foreach ( $ matching as $ pattern => $ label ) { if ( preg_match ( $ pattern , $ status ) ) { $ out [ ] = $ label ; } } $ this -> description = implode ( ', ' , $ out ) ; }
description of the status

@return string
description of the status