Browse Source

Fix deprecated method call

Jordi Boggiano 11 years ago
parent
commit
94fd71a86e
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/Packagist/WebBundle/Controller/WebController.php

+ 2 - 2
src/Packagist/WebBundle/Controller/WebController.php

@@ -390,13 +390,13 @@ class WebController extends Controller
                 $response = array('status' => 'success', 'name' => $package->getName(), 'similar' => $similar);
             } else {
                 $errors = array();
-                if ($form->hasErrors()) {
+                if (count($form->getErrors())) {
                     foreach ($form->getErrors() as $error) {
                         $errors[] = $error->getMessageTemplate();
                     }
                 }
                 foreach ($form->all() as $child) {
-                    if ($child->hasErrors()) {
+                    if (count($child->getErrors())) {
                         foreach ($child->getErrors() as $error) {
                             $errors[] = $error->getMessageTemplate();
                         }