src/ApiProblem.php
protected function compile() : array
    {
        // Start with any extensions, since that's already an array.
        $response = $this->extensions;

        // These properties are optional.
        foreach (['title', 'type', 'status', 'detail', 'instance'] as $key) {
            if (!empty($this->$key)) {
                $response[$key] = $this->$key;
            }
        }

        return $response;
    }
protected function compile() : array
    {
        // Start with any extensions, since that's already an array.
        $response = $this->extensions;

        // These properties are optional.
        foreach (['title', 'type', 'status', 'detail', 'instance'] as $key) {
            if (!empty($this->$key)) {
                $response[$key] = $this->$key;
            }
        }

        return $response;
    }
protected function compile ( ) : array { // Start with any extensions, since that's already an array. $ response = $ this -> extensions ; // These properties are optional. foreach ( [ 'title' , 'type' , 'status' , 'detail' , 'instance' ] as $ key ) { if ( ! empty ( $ this -> $ key ) ) { $ response [ $ key ] = $ this -> $ key ; } } return $ response ; }
Compiles the object down to an array format, suitable for serializing.

@return array
This object, rendered to an array.
Compiles the object down to an array format suitable for serializing .