Skip to content

Commit

Permalink
Remove code path usage from projects
Browse files Browse the repository at this point in the history
  • Loading branch information
SenseException committed Jan 23, 2025
1 parent b7e77be commit 6756e79
Show file tree
Hide file tree
Showing 9 changed files with 0 additions and 29 deletions.
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

0 comments on commit 6756e79

Please sign in to comment.