private function makeArraySerializable(array $data)
    {
        $serializable = [];

        foreach ($data as $key => $value) {
            if (is_object($value)) {
                $serializable[$key] = new ObjectStub($value);

                continue;
            }

            $serializable[$key] = is_array($value) ? $this->makeArraySerializable($value) : $value;
        }

        return $serializable;
    }
private function makeArraySerializable(array $data)
    {
        $serializable = [];

        foreach ($data as $key => $value) {
            if (is_object($value)) {
                $serializable[$key] = new ObjectStub($value);

                continue;
            }

            $serializable[$key] = is_array($value) ? $this->makeArraySerializable($value) : $value;
        }

        return $serializable;
    }
private function makeArraySerializable ( array $ data ) { $ serializable = [ ] ; foreach ( $ data as $ key => $ value ) { if ( is_object ( $ value ) ) { $ serializable [ $ key ] = new ObjectStub ( $ value ) ; continue ; } $ serializable [ $ key ] = is_array ( $ value ) ? $ this -> makeArraySerializable ( $ value ) : $ value ; } return $ serializable ; }
Replaces the un-serializable items in an array with stubs

@param array|\Traversable $data

@return array
Replaces the un - serializable items in an array with stubs