protected function saveToCache()
    {
        if (!is_object($this->dataCache)) {
            throw new Exception('A cache must be injected before initializing the Reflection Service.', 1232044697);
        }
        $data = [];
        $propertyNames = [
            'reflectedClassNames',
            'classPropertyNames',
            'classMethodNames',
            'classTagsValues',
            'methodTagsValues',
            'methodParameters',
            'propertyTagsValues',
            'taggedClasses',
            'classSchemata'
        ];
        foreach ($propertyNames as $propertyName) {
            $data[$propertyName] = $this->{$propertyName};
        }
        $this->dataCache->set($this->cacheIdentifier, $data);
        $this->dataCacheNeedsUpdate = false;
    }