Browse Source

Fix method name

Jordi Boggiano 12 years ago
parent
commit
f71a72acfa
1 changed files with 9 additions and 9 deletions
  1. 9 9
      src/Packagist/WebBundle/Entity/Package.php

+ 9 - 9
src/Packagist/WebBundle/Entity/Package.php

@@ -166,11 +166,11 @@ class Package
         $driver = $this->vcsDriver;
         $driver = $this->vcsDriver;
         if (!is_object($driver)) {
         if (!is_object($driver)) {
             if (preg_match('{https?://.+@}', $this->repository)) {
             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)) {
             } elseif (is_string($this->vcsDriverError)) {
-                $context->addViolationAtSubPath($property, 'Uncaught Exception: '.$this->vcsDriverError, array(), null);
+                $context->addViolationAt($property, 'Uncaught Exception: '.$this->vcsDriverError, array(), null);
             } else {
             } 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;
             return;
         }
         }
@@ -178,17 +178,17 @@ class Package
             $information = $driver->getComposerInformation($driver->getRootIdentifier());
             $information = $driver->getComposerInformation($driver->getRootIdentifier());
 
 
             if (false === $information) {
             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;
                 return;
             }
             }
 
 
             if (empty($information['name'])) {
             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;
                 return;
             }
             }
 
 
             if (!preg_match('{^[a-z0-9]([_.-]?[a-z0-9]+)*/[a-z0-9]([_.-]?[a-z0-9]+)*$}i', $information['name'])) {
             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;
                 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 = preg_replace('{(?:([a-z])([A-Z])|([A-Z])([A-Z][a-z]))}', '\\1\\3-\\2\\4', $information['name']);
                 $suggestName = strtolower($suggestName);
                 $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;
                 return;
             }
             }
         } catch (\Exception $e) {
         } 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 {
         try {
             if ($this->entityRepository->findOneByName($this->name)) {
             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) {}
         } catch (\Doctrine\ORM\NoResultException $e) {}
     }
     }