This commit is contained in:
Fabien Potencier 2013-05-06 12:46:41 +02:00
parent de98954016
commit 9f522de0d5
11 changed files with 21 additions and 14 deletions

View File

@ -118,7 +118,7 @@ class DbalLoggerTest extends \PHPUnit_Framework_TestCase
$shortString = '';
$longString = '';
for($i=1; $i<=DbalLogger::MAX_STRING_LENGTH; $i++) {
for ($i = 1; $i <= DbalLogger::MAX_STRING_LENGTH; $i++) {
$shortString .= $testStringArray[$i % $testStringCount];
$longString .= $testStringArray[$i % $testStringCount];
}

View File

@ -308,6 +308,7 @@ class UniqueValidatorTest extends DoctrineOrmTestCase
$entity,
);
next($returnValue);
return $returnValue;
})
)

View File

@ -42,6 +42,7 @@ class DebugClassLoaderTest extends \PHPUnit_Framework_TestCase
$reflProp->setAccessible(true);
$this->assertNotInstanceOf('Symfony\Component\ClassLoader\DebugClassLoader', $reflProp->getValue($function[0]));
return;
}
}

View File

@ -11,6 +11,8 @@
namespace Symfony\Component\Form;
use Symfony\Component\Form\Exception\TransformationFailedException;
/**
* Transforms a value between different representations.
*
@ -43,7 +45,7 @@ interface DataTransformerInterface
*
* @return mixed The value in the transformed representation
*
* @throws \Symfony\Component\Form\Exception\TransformationFailedException When the transformation fails.
* @throws TransformationFailedException When the transformation fails.
*/
public function transform($value);
@ -69,7 +71,7 @@ interface DataTransformerInterface
*
* @return mixed The value in the original representation
*
* @throws \Symfony\Component\Form\Exception\TransformationFailedException When the transformation fails.
* @throws TransformationFailedException When the transformation fails.
*/
public function reverseTransform($value);
}

View File

@ -12,6 +12,7 @@
namespace Symfony\Component\Form\Extension\Core\DataTransformer;
use Symfony\Component\Form\DataTransformerInterface;
use Symfony\Component\Form\Exception\TransformationFailedException;
/**
* Passes a value through multiple value transformers
@ -48,7 +49,7 @@ class DataTransformerChain implements DataTransformerInterface
*
* @return mixed The transformed value
*
* @throws \Symfony\Component\Form\Exception\TransformationFailedException
* @throws TransformationFailedException
*/
public function transform($value)
{
@ -72,7 +73,7 @@ class DataTransformerChain implements DataTransformerInterface
*
* @return mixed The reverse-transformed value
*
* @throws \Symfony\Component\Form\Exception\TransformationFailedException
* @throws TransformationFailedException
*/
public function reverseTransform($value)
{

View File

@ -12,6 +12,7 @@
namespace Symfony\Component\Form\Extension\Core\DataTransformer;
use Symfony\Component\Form\Exception\TransformationFailedException;
use Symfony\Component\Form\Exception\UnexpectedTypeException;
/**
* Transforms between a normalized time and a localized time string/array.
@ -33,7 +34,7 @@ class DateTimeToArrayTransformer extends BaseDateTimeTransformer
* @param array $fields The date fields
* @param Boolean $pad Whether to use padding
*
* @throws \Symfony\Component\Form\Exception\UnexpectedTypeException if a timezone is not a string
* @throws UnexpectedTypeException if a timezone is not a string
*/
public function __construct($inputTimezone = null, $outputTimezone = null, array $fields = null, $pad = false)
{

View File

@ -12,6 +12,7 @@
namespace Symfony\Component\Form\Extension\Core\DataTransformer;
use Symfony\Component\Form\Exception\TransformationFailedException;
use Symfony\Component\Form\Exception\UnexpectedTypeException;
/**
* Transforms between a date string and a DateTime object
@ -57,7 +58,7 @@ class DateTimeToStringTransformer extends BaseDateTimeTransformer
* @param string $format The date format
* @param Boolean $parseUsingPipe Whether to parse by appending a pipe "|" to the parse format
*
* @throws \Symfony\Component\Form\Exception\UnexpectedTypeException if a timezone is not a string
* @throws UnexpectedTypeException if a timezone is not a string
*/
public function __construct($inputTimezone = null, $outputTimezone = null, $format = 'Y-m-d H:i:s', $parseUsingPipe = null)
{

View File

@ -124,7 +124,7 @@ class DateTimeToRfc3339TransformerTest extends DateTimeTestCase
* @expectedException \Symfony\Component\Form\Exception\TransformationFailedException
*/
public function testReverseTransformExpectsValidDateString()
{
{
$transformer = new DateTimeToRfc3339Transformer('UTC', 'UTC');
$transformer->reverseTransform('2010-2010-2010');

View File

@ -207,7 +207,7 @@ class RedisProfilerStorage implements ProfilerStorageInterface
$redis = new Redis;
$redis->connect($host, $port);
// if a valid dbnumber is given select the redis index
if (-1 < $dbnum) {
$redis->select($dbnum);

View File

@ -238,17 +238,17 @@ class RedisMock
return true;
}
public function select($dbnum)
{
if (!$this->connected) {
return false;
}
if (0 > $dbnum) {
return false;
}
return true;
return true;
}
}

View File

@ -47,7 +47,7 @@ class XmlFileLoaderTest extends \PHPUnit_Framework_TestCase
$this->assertEquals(1, count($routes), 'One route is loaded');
$this->assertContainsOnly('Symfony\Component\Routing\Route', $routes);
$route = $routes['blog_show'];
$this->assertSame(null, $route->getDefault('slug'));
$this->assertEquals('RouteCompiler', $route->getOption('compiler_class'));