Skip to content
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
1 change: 0 additions & 1 deletion .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
'no_unreachable_default_argument_value' => true,
'no_useless_else' => true,
'no_useless_return' => true,
'php_unit_strict' => true,
'phpdoc_order' => true,
'strict_comparison' => true,
'strict_param' => true,
Expand Down
666 changes: 342 additions & 324 deletions composer.lock

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions src/DTO/Abandoned.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,14 @@ public function getReplacement(): ?string
{
return $this->replacement;
}

public function setPackage(string $package): void
{
$this->package = $package;
}

public function setReplacement(?string $replacement): void
{
$this->replacement = $replacement;
}
}
44 changes: 22 additions & 22 deletions src/DTO/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,38 +9,38 @@ class Configuration
{
public const string DEFAULT_OUTPUT_DIR = 'public';

private string $name = 'localhost/repository';
private string $description = '';
private string $homepage = 'http://localhost';
public string $name = 'localhost/repository';
public string $description = '';
public string $homepage = 'http://localhost';

#[SerializedName('output-dir')]
private string $outputDir = self::DEFAULT_OUTPUT_DIR;
public string $outputDir = self::DEFAULT_OUTPUT_DIR;

#[SerializedName('output-html')]
private bool $outputHtml = true;
public bool $outputHtml = true;

/**
* @var \ArrayObject<string, RepositoryInterface>|RepositoryInterface[]
*/
private \ArrayIterator|array $repositories;
public \ArrayIterator|array $repositories;

/**
* @var PackageConstraint[]
*/
#[SerializedName('require')]
private array $require = [];
public array $require = [];

#[SerializedName('require-all')]
private bool $requireAll = false;
public bool $requireAll = false;

#[SerializedName('require-dependencies')]
private bool $requireDependencies = false;
public bool $requireDependencies = false;

#[SerializedName('require-dev-dependencies')]
private bool $requireDevDependencies = false;
public bool $requireDevDependencies = false;

#[SerializedName('require-dependency-filter')]
private bool $requireDependencyFilter = true;
public bool $requireDependencyFilter = true;

/**
* @var string[]|null
Expand All @@ -49,51 +49,51 @@ class Configuration
private ?array $stripHosts = null;

#[SerializedName('include-filename')]
private ?string $includeFilename = null;
public ?string $includeFilename = null;

#[SerializedName('archive')]
private ?Archive $archive = null;
public ?Archive $archive = null;

#[SerializedName('minimum-stability')]
private ?string $minimumStability = 'dev';
public ?string $minimumStability = 'dev';

/**
* @var PackageStability[]
*/
#[SerializedName('minimum-stability-per-package')]
private array $minimumStabilityPerPackage = [];
public array $minimumStabilityPerPackage = [];

private bool $providers = false;
public bool $providers = false;

#[SerializedName('providers-history-size')]
private ?int $providersHistorySize = null;

#[SerializedName('twig-template')]
private ?string $twigTemplate = null;
public ?string $twigTemplate = null;

/**
* @var Abandoned[]
*/
private array $abandoned = [];
public array $abandoned = [];

/**
* @var PackageConstraint[]
*/
private array $blacklist = [];
public array $blacklist = [];

/**
* @var mixed[]|null
*/
private ?array $config = null;
public ?array $config = null;

#[SerializedName('notify-batch')]
private ?string $notifyBatch = null;
public ?string $notifyBatch = null;

#[SerializedName('_comment')]
private ?string $comment = null;

#[SerializedName('pretty-print')]
private bool $prettyPrint = true;
public bool $prettyPrint = true;

public function __construct()
{
Expand Down
15 changes: 14 additions & 1 deletion src/DTO/PackageStability.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
class PackageStability
{
private string $package;

private string $stability;

public function __construct(string $package, string $stability)
Expand All @@ -19,8 +18,22 @@ public function getPackage(): string
return $this->package;
}

public function setPackage(?string $package): void
{
if (null !== $package) {
$this->package = $package;
}
}

public function getStability(): string
{
return $this->stability;
}

public function setStability(?string $stability): void
{
if (null !== $stability) {
$this->stability = $stability;
}
}
}
1 change: 0 additions & 1 deletion src/Validator/Constraints/Repository.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

/**
* @Annotation
*
*/
class Repository extends Constraint
{
Expand Down
45 changes: 45 additions & 0 deletions tests/Application/ApplicationKernelTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?php

namespace App\Tests\Application;

use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
use Symfony\Component\Filesystem\Filesystem;
use Symfony\Component\HttpFoundation\Response;

final class ApplicationKernelTest extends WebTestCase
{
public function testUnavailablePageIsShownWhenIndexFileIsMissing(): void
{
$client = self::createClient();
$projectDir = $client->getContainer()->getParameter('kernel.project_dir');
$publicDir = $projectDir . \DIRECTORY_SEPARATOR . 'public';
$indexFile = $publicDir . \DIRECTORY_SEPARATOR . 'index.html';
$backupFile = $publicDir . \DIRECTORY_SEPARATOR . '_index.html';

$filesystem = new Filesystem();

if ($filesystem->exists($indexFile)) {
$filesystem->rename($indexFile, $backupFile);
}

try {
$client->request('GET', '/');
$response = $client->getResponse();

self::assertSame(
Response::HTTP_OK,
$response->getStatusCode(),
'Expected unavailable-page handler to respond with HTTP 200.'
);

self::assertPageTitleSame(
'Composer Repository currently not available',
'Unavailable page title did not match expectations.'
);
} finally {
if ($filesystem->exists($backupFile)) {
$filesystem->rename($backupFile, $indexFile);
}
}
}
}
164 changes: 0 additions & 164 deletions tests/Composer/Satis/Command/BuildCommandTest.php

This file was deleted.

Loading