|
|
@@ -166,11 +166,11 @@ class Package
|
|
|
$driver = $this->vcsDriver;
|
|
|
if (!is_object($driver)) {
|
|
|
if (preg_match('{https?://.+@}', $this->repository)) {
|
|
|
- $context->addViolationAtSubPath($property, 'URLs with user@host are not supported, use a read-only public URL', array(), null);
|
|
|
+ $context->addViolationAt($property, 'URLs with user@host are not supported, use a read-only public URL', array(), null);
|
|
|
} elseif (is_string($this->vcsDriverError)) {
|
|
|
- $context->addViolationAtSubPath($property, 'Uncaught Exception: '.$this->vcsDriverError, array(), null);
|
|
|
+ $context->addViolationAt($property, 'Uncaught Exception: '.$this->vcsDriverError, array(), null);
|
|
|
} else {
|
|
|
- $context->addViolationAtSubPath($property, 'No valid/supported repository was found at the given URL', array(), null);
|
|
|
+ $context->addViolationAt($property, 'No valid/supported repository was found at the given URL', array(), null);
|
|
|
}
|
|
|
return;
|
|
|
}
|
|
|
@@ -178,17 +178,17 @@ class Package
|
|
|
$information = $driver->getComposerInformation($driver->getRootIdentifier());
|
|
|
|
|
|
if (false === $information) {
|
|
|
- $context->addViolationAtSubPath($property, 'No composer.json was found in the '.$driver->getRootIdentifier().' branch.', array(), null);
|
|
|
+ $context->addViolationAt($property, 'No composer.json was found in the '.$driver->getRootIdentifier().' branch.', array(), null);
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
if (empty($information['name'])) {
|
|
|
- $context->addViolationAtSubPath($property, 'The package name was not found in the composer.json, make sure there is a name present.', array(), null);
|
|
|
+ $context->addViolationAt($property, 'The package name was not found in the composer.json, make sure there is a name present.', array(), null);
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
if (!preg_match('{^[a-z0-9]([_.-]?[a-z0-9]+)*/[a-z0-9]([_.-]?[a-z0-9]+)*$}i', $information['name'])) {
|
|
|
- $context->addViolationAtSubPath($property, 'The package name '.$information['name'].' is invalid, it should have a vendor name, a forward slash, and a package name. The vendor and package name can be words separated by -, . or _. The complete name should match "[a-z0-9]([_.-]?[a-z0-9]+)*/[a-z0-9]([_.-]?[a-z0-9]+)*".', array(), null);
|
|
|
+ $context->addViolationAt($property, 'The package name '.$information['name'].' is invalid, it should have a vendor name, a forward slash, and a package name. The vendor and package name can be words separated by -, . or _. The complete name should match "[a-z0-9]([_.-]?[a-z0-9]+)*/[a-z0-9]([_.-]?[a-z0-9]+)*".', array(), null);
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
@@ -196,11 +196,11 @@ class Package
|
|
|
$suggestName = preg_replace('{(?:([a-z])([A-Z])|([A-Z])([A-Z][a-z]))}', '\\1\\3-\\2\\4', $information['name']);
|
|
|
$suggestName = strtolower($suggestName);
|
|
|
|
|
|
- $context->addViolationAtSubPath($property, 'The package name '.$information['name'].' is invalid, it should not contain uppercase characters. We suggest using '.$suggestName.' instead.');
|
|
|
+ $context->addViolationAt($property, 'The package name '.$information['name'].' is invalid, it should not contain uppercase characters. We suggest using '.$suggestName.' instead.');
|
|
|
return;
|
|
|
}
|
|
|
} catch (\Exception $e) {
|
|
|
- $context->addViolationAtSubPath($property, 'We had problems parsing your composer.json file, the parser reports: '.$e->getMessage(), array(), null);
|
|
|
+ $context->addViolationAt($property, 'We had problems parsing your composer.json file, the parser reports: '.$e->getMessage(), array(), null);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -218,7 +218,7 @@ class Package
|
|
|
{
|
|
|
try {
|
|
|
if ($this->entityRepository->findOneByName($this->name)) {
|
|
|
- $context->addViolationAtSubPath('repository', 'A package with the name <a href="'.$this->router->generate('view_package', array('name' => $this->name)).'">'.$this->name.'</a> already exists.', array(), null);
|
|
|
+ $context->addViolationAt('repository', 'A package with the name <a href="'.$this->router->generate('view_package', array('name' => $this->name)).'">'.$this->name.'</a> already exists.', array(), null);
|
|
|
}
|
|
|
} catch (\Doctrine\ORM\NoResultException $e) {}
|
|
|
}
|