public function toArray(): array
    {
        $sortedArrayKeys = $this->getSortedKeys();

        $sortedArray = [];
        foreach ($sortedArrayKeys as $key) {
            $sortedArray[$key] = $this->subject[$key];
        }
        return $sortedArray;
    }
public function toArray(): array
    {
        $sortedArrayKeys = $this->getSortedKeys();

        $sortedArray = [];
        foreach ($sortedArrayKeys as $key) {
            $sortedArray[$key] = $this->subject[$key];
        }
        return $sortedArray;
    }
public function toArray ( ) : array { $ sortedArrayKeys = $ this -> getSortedKeys ( ) ; $ sortedArray = [ ] ; foreach ( $ sortedArrayKeys as $ key ) { $ sortedArray [ $ key ] = $ this -> subject [ $ key ] ; } return $ sortedArray ; }
Returns a sorted copy of the subject array

@return array
Returns a sorted copy of the subject array