Skip to content

Commit ac3600b

Browse files
committed
Tweak the feature that links to Symfony repository URLs
1 parent 97ffc89 commit ac3600b

File tree

5 files changed

+18
-18
lines changed

5 files changed

+18
-18
lines changed

src/BuildConfig.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
class BuildConfig
1717
{
1818
private const PHP_DOC_URL = 'https://secure.php.net/manual/en';
19-
private const GITHUB_URL = 'https://github.com/symfony/symfony/blob/{symfonyVersion}/src';
19+
private const SYMFONY_REPOSITORY_URL = 'https://github.com/symfony/symfony/blob/{symfonyVersion}/src';
2020
private const SYMFONY_DOC_URL = 'https://symfony.com/doc/{symfonyVersion}';
2121

2222
private $useBuildCache;
@@ -78,9 +78,9 @@ public function getPhpDocUrl(): string
7878
return self::PHP_DOC_URL;
7979
}
8080

81-
public function getGithubUrl(): string
81+
public function getSymfonyRepositoryUrl(): string
8282
{
83-
return str_replace('{symfonyVersion}', $this->getSymfonyVersion(), self::GITHUB_URL);
83+
return str_replace('{symfonyVersion}', $this->getSymfonyVersion(), self::SYMFONY_REPOSITORY_URL);
8484
}
8585

8686
public function getSymfonyDocUrl(): string

src/KernelFactory.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,9 @@ private static function getDirectives(): array
101101
private static function getReferences(BuildConfig $buildConfig): array
102102
{
103103
return [
104-
new SymfonyReferences\ClassReference($buildConfig->getGithubUrl()),
105-
new SymfonyReferences\MethodReference($buildConfig->getGithubUrl()),
106-
new SymfonyReferences\NamespaceReference($buildConfig->getGithubUrl()),
104+
new SymfonyReferences\ClassReference($buildConfig->getSymfonyRepositoryUrl()),
105+
new SymfonyReferences\MethodReference($buildConfig->getSymfonyRepositoryUrl()),
106+
new SymfonyReferences\NamespaceReference($buildConfig->getSymfonyRepositoryUrl()),
107107
new SymfonyReferences\PhpFunctionReference($buildConfig->getPhpDocUrl()),
108108
new SymfonyReferences\PhpMethodReference($buildConfig->getPhpDocUrl()),
109109
new SymfonyReferences\PhpClassReference($buildConfig->getPhpDocUrl()),

src/Reference/ClassReference.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@
1616

1717
class ClassReference extends Reference
1818
{
19-
private $githubUrl;
19+
private $symfonyRepositoryUrl;
2020

21-
public function __construct(string $githubUrl)
21+
public function __construct(string $symfonyRepositoryUrl)
2222
{
23-
$this->githubUrl = $githubUrl;
23+
$this->symfonyRepositoryUrl = $symfonyRepositoryUrl;
2424
}
2525

2626
public function getName(): string
@@ -35,7 +35,7 @@ public function resolve(Environment $environment, string $data): ResolvedReferen
3535
return new ResolvedReference(
3636
$environment->getCurrentFileName(),
3737
$className->afterLast('\\'),
38-
sprintf('%s/%s.php', $this->githubUrl, $className->replace('\\', '/')),
38+
sprintf('%s/%s.php', $this->symfonyRepositoryUrl, $className->replace('\\', '/')),
3939
[],
4040
[
4141
'title' => $className,

src/Reference/MethodReference.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@
1616

1717
class MethodReference extends Reference
1818
{
19-
private $githubUrl;
19+
private $symfonyRepositoryUrl;
2020

21-
public function __construct(string $githubUrl)
21+
public function __construct(string $symfonyRepositoryUrl)
2222
{
23-
$this->githubUrl = $githubUrl;
23+
$this->symfonyRepositoryUrl = $symfonyRepositoryUrl;
2424
}
2525

2626
public function getName(): string
@@ -42,7 +42,7 @@ public function resolve(Environment $environment, string $data): ResolvedReferen
4242
return new ResolvedReference(
4343
$environment->getCurrentFileName(),
4444
$methodName.'()',
45-
sprintf('%s/%s.php#method_%s', $this->githubUrl, str_replace('\\', '/', $className), $methodName),
45+
sprintf('%s/%s.php#method_%s', $this->symfonyRepositoryUrl, str_replace('\\', '/', $className), $methodName),
4646
[],
4747
[
4848
'title' => sprintf('%s::%s()', $className, $methodName),

src/Reference/NamespaceReference.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@
1616

1717
class NamespaceReference extends Reference
1818
{
19-
private $githubUrl;
19+
private $symfonyRepositoryUrl;
2020

21-
public function __construct(string $githubUrl)
21+
public function __construct(string $symfonyRepositoryUrl)
2222
{
23-
$this->githubUrl = $githubUrl;
23+
$this->symfonyRepositoryUrl = $symfonyRepositoryUrl;
2424
}
2525

2626
public function getName(): string
@@ -35,7 +35,7 @@ public function resolve(Environment $environment, string $data): ResolvedReferen
3535
return new ResolvedReference(
3636
$environment->getCurrentFileName(),
3737
$className->afterLast('\\'),
38-
sprintf('%s/%s', $this->githubUrl, $className->replace('\\', '/')),
38+
sprintf('%s/%s', $this->symfonyRepositoryUrl, $className->replace('\\', '/')),
3939
[],
4040
[
4141
'title' => $className,

0 commit comments

Comments
 (0)