Merge branch '2.0'

* 2.0:
  Revert "merged branch jakzal/2.0-StaticMethodLoaderFix (PR #3937)"
  fixed CS
This commit is contained in:
Fabien Potencier 2012-04-18 11:42:52 +02:00
commit 99f8a3ce97
4 changed files with 12 additions and 19 deletions

View File

@ -19,7 +19,8 @@ use Symfony\Component\Locale\Stub\StubIntl;
* @return Boolean Whether the error code indicates an error * @return Boolean Whether the error code indicates an error
* @see Symfony\Component\Locale\Stub\StubIntl::isFailure * @see Symfony\Component\Locale\Stub\StubIntl::isFailure
*/ */
function intl_is_failure($errorCode) { function intl_is_failure($errorCode)
{
return StubIntl::isFailure($errorCode); return StubIntl::isFailure($errorCode);
} }
@ -31,9 +32,11 @@ function intl_is_failure($errorCode) {
* StubIntl::U_ZERO_ERROR if no error occurred * StubIntl::U_ZERO_ERROR if no error occurred
* @see Symfony\Component\Locale\Stub\StubIntl::getErrorCode * @see Symfony\Component\Locale\Stub\StubIntl::getErrorCode
*/ */
function intl_get_error_code() { function intl_get_error_code()
{
return StubIntl::getErrorCode(); return StubIntl::getErrorCode();
} }
/** /**
* Stub implementation for the intl_get_error_code function of the intl extension * Stub implementation for the intl_get_error_code function of the intl extension
* *
@ -42,7 +45,8 @@ function intl_get_error_code() {
* "U_ZERO_ERROR" if no error occurred * "U_ZERO_ERROR" if no error occurred
* @see Symfony\Component\Locale\Stub\StubIntl::getErrorMessage * @see Symfony\Component\Locale\Stub\StubIntl::getErrorMessage
*/ */
function intl_get_error_message() { function intl_get_error_message()
{
return StubIntl::getErrorMessage(); return StubIntl::getErrorMessage();
} }
@ -53,6 +57,7 @@ function intl_get_error_message() {
* *
* @see Symfony\Component\Locale\Stub\StubIntl::getErrorName * @see Symfony\Component\Locale\Stub\StubIntl::getErrorName
*/ */
function intl_error_name($errorCode) { function intl_error_name($errorCode)
{
return StubIntl::getErrorName($errorCode); return StubIntl::getErrorName($errorCode);
} }

View File

@ -124,6 +124,7 @@ class RouteCompiler implements RouteCompilerInterface
$regexp .= str_repeat(")?", $nbTokens - $firstOptional); $regexp .= str_repeat(")?", $nbTokens - $firstOptional);
} }
} }
return $regexp; return $regexp;
} }
} }

View File

@ -37,7 +37,7 @@ class StaticMethodLoader implements LoaderInterface
throw new MappingException(sprintf('The method %s::%s should be static', $reflClass->getName(), $this->methodName)); throw new MappingException(sprintf('The method %s::%s should be static', $reflClass->getName(), $this->methodName));
} }
if ($reflClass->isAbstract() || $reflMethod->getDeclaringClass()->getName() != $reflClass->getName()) { if ($reflMethod->getDeclaringClass()->getName() != $reflClass->getName()) {
return false; return false;
} }

View File

@ -33,14 +33,6 @@ class StaticMethodLoaderTest extends \PHPUnit_Framework_TestCase
$this->assertFalse($loader->loadClassMetadata($metadata)); $this->assertFalse($loader->loadClassMetadata($metadata));
} }
public function testLoadClassMetadataReturnsFalseIfMethodIsAbstract()
{
$loader = new StaticMethodLoader('loadMetadata');
$metadata = new ClassMetadata(__NAMESPACE__.'\AbstractStaticLoaderEntity');
$this->assertFalse($loader->loadClassMetadata($metadata));
}
public function testLoadClassMetadata() public function testLoadClassMetadata()
{ {
$loader = new StaticMethodLoader('loadMetadata'); $loader = new StaticMethodLoader('loadMetadata');
@ -86,8 +78,3 @@ class BaseStaticLoaderDocument
$metadata->addConstraint(new ConstraintA()); $metadata->addConstraint(new ConstraintA());
} }
} }
abstract class AbstractStaticLoaderEntity
{
abstract public static function loadMetadata(ClassMetadata $metadata);
}