diff --git a/app/src/Application/AppVersion.php b/app/src/Application/AppVersion.php new file mode 100644 index 00000000..99866538 --- /dev/null +++ b/app/src/Application/AppVersion.php @@ -0,0 +1,16 @@ + fn(\Spiral\Core\Core $core, \Psr\Container\ContainerInterface $container, ?\Psr\EventDispatcher\EventDispatcherInterface $dispatcher = null): \Spiral\Core\InterceptableCore => self::domainCore($core, $container, $dispatcher), + CoreInterface::class => fn( + \Spiral\Core\Core $core, + \Psr\Container\ContainerInterface $container, + ?\Psr\EventDispatcher\EventDispatcherInterface $dispatcher = null, + ): \Spiral\Core\InterceptableCore => self::domainCore($core, $container, $dispatcher), + + UrlTemplate::class => fn( + EnvironmentInterface $env, + ): UrlTemplate => new UrlTemplate( + template: $env->get('IDE_URL_TEMPLATE', 'phpstorm://open?url=file://%s&line=%d'), + ), + + AppVersion::class => fn( + EnvironmentInterface $env, + ): AppVersion => new AppVersion( + version: $env->get('APP_VERSION', 'dev'), + ), ]; } diff --git a/app/src/Application/Ide/UrlTemplate.php b/app/src/Application/Ide/UrlTemplate.php new file mode 100644 index 00000000..737ce51a --- /dev/null +++ b/app/src/Application/Ide/UrlTemplate.php @@ -0,0 +1,16 @@ + [ 'enabled' => $settings->enabled, - 'login_url' => (string) $settings->loginUrl, + 'login_url' => (string)$settings->loginUrl, ], - 'version' => $env->get('APP_VERSION', 'dev'), + 'ide' => [ + 'url_template' => $ideUrl->template, + ], + 'version' => $appVersion->version, ]); } }