protected function getAttributeHydrator($book): array
    {
        return [
            "title" => function (array $book, $attribute, $data) {
                $book["title"] = $attribute;
                return $book;
            },
            "pages" => function (array &$book, $attribute, $data) {
                $book["pages"] = $attribute;
            }
        ];
    }
protected function getAttributeHydrator($book): array
    {
        return [
            "title" => function (array $book, $attribute, $data) {
                $book["title"] = $attribute;
                return $book;
            },
            "pages" => function (array &$book, $attribute, $data) {
                $book["pages"] = $attribute;
            }
        ];
    }
protected function getAttributeHydrator ( $ book ) : array { return [ "title" => function ( array $ book , $ attribute , $ data ) { $ book [ "title" ] = $ attribute ; return $ book ; } , "pages" => function ( array & $ book , $ attribute , $ data ) { $ book [ "pages" ] = $ attribute ; } ] ; }
Provides the attribute hydrators.

The method returns an array of attribute hydrators, where a hydrator is a key-value pair:
the key is the specific attribute name which comes from the request and the value is a
callable which hydrates the given attribute.
These callables receive the domain object (which will be hydrated), the value of the
currently processed attribute, the "data" part of the request and the name of the attribute
to be hydrated as their arguments, and they should mutate the state of the domain object.
If it is an immutable object or an array (and passing by reference isn't used),
the callable should return the domain object.

@param array $book
@return callable[]
Provides the attribute hydrators .