فهرست منبع

[FrameworkBundle] made a small optimization

Fabien Potencier 15 سال پیش
والد
کامیت
9e157f51a3
1فایلهای تغییر یافته به همراه1 افزوده شده و 1 حذف شده
  1. 1 1
      src/Symfony/Bundle/FrameworkBundle/Controller/ControllerNameConverter.php

+ 1 - 1
src/Symfony/Bundle/FrameworkBundle/Controller/ControllerNameConverter.php

@@ -56,7 +56,7 @@ class ControllerNameConverter
 
         list($class, $method) = $parts;
 
-        if (!preg_match('/Action$/', $method)) {
+        if ('Action' != substr($method, -6)) {
             throw new \InvalidArgumentException(sprintf('The "%s::%s" method does not look like a controller action (it does not end with Action)', $class, $method));
         }
         $action = substr($method, 0, -6);