protected function addCache(Application $app)
    {
        $app['descriptor.cache'] = $app->share(
            function () {
                $cache = new Filesystem();
                $cache->setOptions(
                    array(
                         'namespace' => 'phpdoc-cache',
                         'cache_dir' => sys_get_temp_dir(),
                    )
                );
                $plugin = new SerializerPlugin();

                if (extension_loaded('igbinary')) {
                    $options = new PluginOptions();
                    $options->setSerializer('igbinary');

                    $plugin->setOptions($options);
                }

                $cache->addPlugin($plugin);

                return $cache;
            }
        );
    }