protected function resolveCasts(array $options = [])
    {
        /* Create a copy of the options to work on. */
        $castOptions = $options;

        /* Iterate every options and cast as needed. */
        foreach ($options as $option => $value) {

            /* No cast was defined, continue. */
            if (! isset($this->casts[$option])) {

                continue;
            }
            $type = $this->casts[$option];

            $castOptions[$option] = ($type instanceof \Closure)
                ? $type($value)
                : $this->castToType($value, $type);
        }

        return $castOptions;
    }