Skip to content

Commit e95840a

Browse files
committed
Some minor fixes
1 parent b7d93a9 commit e95840a

5 files changed

+11
-32
lines changed

src/Command/BenchmarkValidateCommand.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,7 @@ protected function configure()
2222

2323
protected function doExecute(): parent
2424
{
25-
$this
26-
->runCommand('validate:configuration:component')
27-
->runCommand('validate:branch:name')
28-
->runCommand('validate:composer:json')
29-
->runCommand('validate:composer:lock')
30-
->runCommand('validate:configuration:initBenchmark')
31-
->runCommand('validate:configuration:vhost');
25+
$this->runCommand('validate:all');
3226

3327
foreach (ComponentConfiguration::getEnabledPhpVersions() as $phpVersion) {
3428
$this->validateForPhpVersion($phpVersion);

src/Command/Configure/ConfigureComponentSourceCodeUrlsCommand.php

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
use AbstractComponentConfiguration\AbstractComponentConfiguration;
88
use App\{
9-
Command\Validate\ValidateConfigurationComponentCommand,
9+
Command\Validate\ValidateConfigurationComponentSourceCodeUrlsCommand,
1010
ComponentConfiguration\ComponentConfiguration
1111
};
1212
use Symfony\Component\Validator\ConstraintViolationInterface;
@@ -34,8 +34,7 @@ protected function doExecute(): parent
3434
if ($this->skipSourceCodeUrls() === false) {
3535
$this
3636
->title('Configuration of AbstractComponentConfiguration::getSourceCodeUrls()')
37-
->defineSourceCodeUrls()
38-
->runCommand('validate:configuration:component:sourceCodeUrls');
37+
->defineSourceCodeUrls();
3938
}
4039

4140
return $this;
@@ -88,7 +87,7 @@ protected function getSourceCodeUrls(): array
8887
];
8988

9089
foreach ($return as &$url) {
91-
$violations = ValidateConfigurationComponentCommand::validateSourCodeUrl($url['url']);
90+
$violations = ValidateConfigurationComponentSourceCodeUrlsCommand::validateSourCodeUrl($url['url']);
9291
$showWarning = false;
9392
do {
9493
if (count($violations) > 0) {
@@ -105,7 +104,11 @@ protected function getSourceCodeUrls(): array
105104
}
106105

107106
$showWarning = true;
108-
} while (count($violations = ValidateConfigurationComponentCommand::validateSourCodeUrl($url['url'])) > 0);
107+
} while (
108+
count(
109+
$violations = ValidateConfigurationComponentSourceCodeUrlsCommand::validateSourCodeUrl($url['url'])
110+
) > 0
111+
);
109112
}
110113

111114
return $return;

src/Command/Validate/ValidateAllCommand.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ protected function doExecute(): parent
2424
->runCommand('validate:composer:json')
2525
->runCommand('validate:composer:lock')
2626
->runCommand('validate:configuration:component')
27+
->runCommand('validate:configuration:component:sourceCodeUrls')
2728
->runCommand('validate:configuration:initBenchmark')
2829
->runCommand('validate:configuration:responseBody')
2930
->runCommand('validate:configuration:vhost');

src/Command/Validate/ValidateComposerLockFilesCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ private function validateEnabledPhpVersions(): self
5353
$lockFile = 'composer.lock.php' . $phpVersion;
5454
$lockPath = $this->getInstallationPath() . '/' . $lockFile;
5555
if (is_readable($lockPath) === false) {
56-
$this->error('File does not exist.');
56+
$this->error('File does not exist. Call "phpbench composer:update" to create it.');
5757
}
5858

5959
try {

src/Command/Validate/ValidateConfigurationComponentCommand.php

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -11,28 +11,9 @@
1111
ComponentConfiguration\ComponentConfiguration,
1212
PhpVersion\PhpVersion
1313
};
14-
use Symfony\Component\Validator\{
15-
Constraints\NotBlank,
16-
Constraints\Type,
17-
Constraints\Url,
18-
ConstraintViolationListInterface,
19-
Validation
20-
};
2114

2215
class ValidateConfigurationComponentCommand extends AbstractCommand
2316
{
24-
public static function validateSourCodeUrl($url): ConstraintViolationListInterface
25-
{
26-
return Validation::createValidator()->validate(
27-
$url,
28-
[
29-
new NotBlank(),
30-
new Type(['type' => 'string']),
31-
new Url()
32-
]
33-
);
34-
}
35-
3617
protected function configure()
3718
{
3819
parent::configure();

0 commit comments

Comments
 (0)