di->setShared($this->serviceName, function () { $config = $this->getShared('config'); if ($config->env == ENV_DEV) { $annotations = new MemoryAnnotations(); } else { $annotations = new FileAnnotations([ 'annotationsDir' => cache_path() . '/annotations/', ]); } return $annotations; }); } }