Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove code path usage from projects #648

Merged
merged 1 commit into from
Jan 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions lib/DataSources/DbPrefill/Projects.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ private function buildAndSaveProject(array $projectData): void
$integrationFor = (string) ($projectData['integrationFor'] ?? '');
$docsRepositoryName = (string) ($projectData['docsRepositoryName'] ?? $repositoryName);
$docsPath = (string) ($projectData['docsPath'] ?? '/docs');
$codePath = (string) ($projectData['codePath'] ?? '/lib');
$description = (string) ($projectData['description'] ?? '');
$keywords = $projectData['keywords'] ?? [];

Expand Down Expand Up @@ -106,7 +105,6 @@ private function buildAndSaveProject(array $projectData): void
$integrationFor,
$docsRepositoryName,
$docsPath,
$codePath,
$description,
$projectIntegrationType,
$integration,
Expand Down
7 changes: 0 additions & 7 deletions lib/Model/Project.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ public function __construct(
#[ORM\Column(type: 'string')]
private string $docsPath,
#[ORM\Column(type: 'string')]
private string $codePath,
#[ORM\Column(type: 'string')]
private string $description,
#[ORM\OneToOne(targetEntity: ProjectIntegrationType::class, fetch: 'EAGER', orphanRemoval: true)]
#[ORM\JoinColumn(name: 'projectIntegrationType', referencedColumnName: 'id', nullable: true)]
Expand Down Expand Up @@ -137,11 +135,6 @@ public function getDocsPath(): string
return $this->docsPath;
}

public function getCodePath(): string
{
return $this->codePath;
}

public function getDescription(): string
{
return $this->description;
Expand Down
6 changes: 0 additions & 6 deletions lib/Projects/ProjectDataReader.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ private function createDefaultProjectData(string $repositoryName): array
'name' => $repositoryName,
'repositoryName' => $repositoryName,
'docsPath' => $this->detectDocsPath($repositoryName),
'codePath' => $this->detectCodePath($repositoryName),
'slug' => $slug,
'versions' => [
[
Expand Down Expand Up @@ -120,11 +119,6 @@ private function detectDocsPath(string $repositoryName): string|null
return $this->detectPath($repositoryName, ['/docs', '/doc', '/Resources/doc', '/source'], null);
}

private function detectCodePath(string $repositoryName): string|null
{
return $this->detectPath($repositoryName, ['/src', '/lib'], '/');
}

/** @param string[] $pathsToCheck */
private function detectPath(string $repositoryName, array $pathsToCheck, string|null $default): string|null
{
Expand Down
1 change: 0 additions & 1 deletion tests/DataSources/DbPrefill/ProjectsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ private function assertProjectIsComplete(EntityManagerInterface $entityManager):
self::assertSame('doctrine-testproject', $project->getDocsSlug());
self::assertSame('testproject', $project->getDocsRepositoryName());
self::assertSame('/docs', $project->getDocsPath());
self::assertSame('/lib', $project->getCodePath());
self::assertSame('doctrine/testproject', $project->getComposerPackageName());
self::assertSame('testproject', $project->getRepositoryName());
self::assertFalse($project->isIntegration());
Expand Down
1 change: 0 additions & 1 deletion tests/DataSources/DbPrefill/fixtures/projects.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
"name": "Testproject",
"repositoryName": "testproject",
"docsPath": "/docs",
"codePath": "/lib",
"slug": "testproject",
"versionsGreaterThan": "1.0.1",
"versions": [
Expand Down
2 changes: 0 additions & 2 deletions tests/Projects/ProjectDataReaderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ public function testRead(): void
'name' => 'test-project',
'repositoryName' => 'test-project',
'docsPath' => '/docs',
'codePath' => '/src',
'slug' => 'test-project',
'versions' => [
[
Expand All @@ -48,7 +47,6 @@ public function testReadFileDoesNotExist(): void
'repositoryName' => 'no-project-json',
'name' => 'no-project-json',
'docsPath' => null,
'codePath' => '/',
'slug' => 'no-project-json',
'versions' => [
[
Expand Down
6 changes: 0 additions & 6 deletions tests/Projects/ProjectTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ protected function setUp(): void
'repositoryName' => 'test-project',
'docsRepositoryName' => 'test-project',
'docsPath' => '/docs',
'codePath' => '/src',
'description' => 'Test description.',
'keywords' => ['keyword1', 'keyword2'],
'versions' => new ArrayCollection([
Expand Down Expand Up @@ -92,11 +91,6 @@ public function testGetDocsPath(): void
self::assertSame('/docs', $this->project->getDocsPath());
}

public function testGetCodePath(): void
{
self::assertSame('/src', $this->project->getCodePath());
}

public function testGetDescription(): void
{
self::assertSame('Test description.', $this->project->getDescription());
Expand Down
1 change: 0 additions & 1 deletion tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ protected function createProject(array $data): Project
'integrationFor' => '',
'docsRepositoryName' => '',
'docsPath' => '',
'codePath' => '',
'description' => '',
'projectIntegrationType' => null,
'integration' => true,
Expand Down
3 changes: 0 additions & 3 deletions tests/test-cache/data/projects.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
"name": "Object Relational Mapper",
"repositoryName": "orm",
"docsPath": "/docs",
"codePath": "/lib",
"slug": "orm",
"versions": [
{
Expand Down Expand Up @@ -390,7 +389,6 @@
"name": "Database Abstraction Layer",
"repositoryName": "dbal",
"docsPath": "/docs",
"codePath": "/src",
"slug": "dbal",
"versions": [
{
Expand Down Expand Up @@ -713,7 +711,6 @@
"name": "Annotations",
"repositoryName": "annotations",
"docsPath": "/docs",
"codePath": "/lib",
"slug": "annotations",
"versions": [
{
Expand Down
Loading