This commit is contained in:
Fabien Potencier 2013-03-01 11:42:10 +01:00
parent 7d9688dc6d
commit 62baab5b36
13 changed files with 13 additions and 16 deletions

View File

@ -85,6 +85,7 @@ class PropelTypeGuesser implements FormTypeGuesserInterface
//check if this is mysql enum //check if this is mysql enum
$choices = $column->getValueSet(); $choices = $column->getValueSet();
$labels = array_map('ucfirst', $choices); $labels = array_map('ucfirst', $choices);
return new TypeGuess('choice', array('choices' => array_combine($choices, $labels)), Guess::MEDIUM_CONFIDENCE); return new TypeGuess('choice', array('choices' => array_combine($choices, $labels)), Guess::MEDIUM_CONFIDENCE);
} }
case \PropelColumnTypes::VARCHAR: case \PropelColumnTypes::VARCHAR:

View File

@ -14,7 +14,6 @@ namespace Symfony\Bridge\Twig\Tests\Extension;
use Symfony\Bridge\Twig\Extension\HttpKernelExtension; use Symfony\Bridge\Twig\Extension\HttpKernelExtension;
use Symfony\Bridge\Twig\Tests\TestCase; use Symfony\Bridge\Twig\Tests\TestCase;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Fragment\FragmentHandler; use Symfony\Component\HttpKernel\Fragment\FragmentHandler;
class HttpKernelExtensionTest extends TestCase class HttpKernelExtensionTest extends TestCase

View File

@ -360,6 +360,7 @@ class ClassCollectionLoader
} }
$resolved[$nodeName] = $node; $resolved[$nodeName] = $node;
unset($unresolved[$nodeName]); unset($unresolved[$nodeName]);
return $resolved; return $resolved;
} }
} }

View File

@ -19,7 +19,6 @@ class WithComments
$string = 'string shoult not be modified'; $string = 'string shoult not be modified';
$heredoc = <<<HD $heredoc = <<<HD

View File

@ -237,6 +237,7 @@ class ArrayNodeDefinition extends NodeDefinition implements ParentNodeDefinition
->ifArray() ->ifArray()
->then(function($v) { ->then(function($v) {
$v['enabled'] = isset($v['enabled']) ? $v['enabled'] : true; $v['enabled'] = isset($v['enabled']) ? $v['enabled'] : true;
return $v; return $v;
}) })
->end() ->end()

View File

@ -291,4 +291,4 @@ class ValidatorTypeGuesser implements FormTypeGuesserInterface
return Guess::getBestGuess($guesses); return Guess::getBestGuess($guesses);
} }
} }

View File

@ -13,7 +13,6 @@ namespace Symfony\Component\Form\Tests\Extension\Validator\EventListener;
use Symfony\Component\Form\FormBuilder; use Symfony\Component\Form\FormBuilder;
use Symfony\Component\Form\FormEvent; use Symfony\Component\Form\FormEvent;
use Symfony\Component\Form\FormError;
use Symfony\Component\Form\Extension\Validator\Constraints\Form; use Symfony\Component\Form\Extension\Validator\Constraints\Form;
use Symfony\Component\Form\Extension\Validator\EventListener\ValidationListener; use Symfony\Component\Form\Extension\Validator\EventListener\ValidationListener;
use Symfony\Component\PropertyAccess\PropertyPath; use Symfony\Component\PropertyAccess\PropertyPath;

View File

@ -258,7 +258,7 @@ class Response
* @link http://support.microsoft.com/kb/323308 * @link http://support.microsoft.com/kb/323308
*/ */
if (false !== stripos($this->headers->get('Content-Disposition'), 'attachment') && preg_match('/MSIE (.*?);/i', $request->server->get('HTTP_USER_AGENT'), $match) == 1 && true === $request->isSecure()) { if (false !== stripos($this->headers->get('Content-Disposition'), 'attachment') && preg_match('/MSIE (.*?);/i', $request->server->get('HTTP_USER_AGENT'), $match) == 1 && true === $request->isSecure()) {
if(intval(preg_replace("/(MSIE )(.*?);/", "$2", $match[0])) < 9) { if (intval(preg_replace("/(MSIE )(.*?);/", "$2", $match[0])) < 9) {
$this->headers->remove('Cache-Control'); $this->headers->remove('Cache-Control');
} }
} }

View File

@ -225,7 +225,7 @@ class FileProfilerStorage implements ProfilerStorageInterface
return null; return null;
} }
while(true) { while (true) {
$chunkSize = min($position, 1024); $chunkSize = min($position, 1024);
$position -= $chunkSize; $position -= $chunkSize;
fseek($file, $position); fseek($file, $position);

View File

@ -12,8 +12,6 @@
namespace Symfony\Component\PropertyAccess\Tests; namespace Symfony\Component\PropertyAccess\Tests;
use Symfony\Component\PropertyAccess\PropertyPath; use Symfony\Component\PropertyAccess\PropertyPath;
use Symfony\Component\PropertyAccess\Tests\Fixtures\Author;
use Symfony\Component\PropertyAccess\Tests\Fixtures\Magician;
class PropertyPathTest extends \PHPUnit_Framework_TestCase class PropertyPathTest extends \PHPUnit_Framework_TestCase
{ {

View File

@ -26,7 +26,7 @@ class UserPasswordValidatorTest extends \PHPUnit_Framework_TestCase
if (false === class_exists('Symfony\Component\Validator\Validator')) { if (false === class_exists('Symfony\Component\Validator\Validator')) {
$this->markTestSkipped('The Validator component is required for this test.'); $this->markTestSkipped('The Validator component is required for this test.');
} }
$this->context = $this->getMock('Symfony\Component\Validator\ExecutionContext', array(), array(), '', false); $this->context = $this->getMock('Symfony\Component\Validator\ExecutionContext', array(), array(), '', false);
} }

View File

@ -61,7 +61,6 @@ class JsonEncoderTest extends \PHPUnit_Framework_TestCase
$this->assertEquals($expected, $this->serializer->serialize($arr, 'json'), 'Context should not be persistent'); $this->assertEquals($expected, $this->serializer->serialize($arr, 'json'), 'Context should not be persistent');
} }
protected function getJsonSource() protected function getJsonSource()
{ {
return '{"foo":"foo","bar":["a","b"],"baz":{"key":"val","key2":"val","A B":"bar","item":[{"title":"title1"},{"title":"title2"}],"Barry":{"FooBar":{"Baz":"Ed","@id":1}}},"qux":"1"}'; return '{"foo":"foo","bar":["a","b"],"baz":{"key":"val","key2":"val","A B":"bar","item":[{"title":"title1"},{"title":"title2"}],"Barry":{"FooBar":{"Baz":"Ed","@id":1}}},"qux":"1"}';

View File

@ -22,20 +22,20 @@ use Symfony\Component\Translation\TranslatorInterface;
* Example usage: * Example usage:
* *
* $translator = new DefaultTranslator(); * $translator = new DefaultTranslator();
* *
* echo $translator->trans( * echo $translator->trans(
* 'This is a {{ var }}.', * 'This is a {{ var }}.',
* array('{{ var }}' => 'donkey') * array('{{ var }}' => 'donkey')
* ); * );
* *
* // -> This is a donkey. * // -> This is a donkey.
* *
* echo $translator->transChoice( * echo $translator->transChoice(
* 'This is {{ count }} donkey.|These are {{ count }} donkeys.', * 'This is {{ count }} donkey.|These are {{ count }} donkeys.',
* 3, * 3,
* array('{{ count }}' => 'three') * array('{{ count }}' => 'three')
* ); * );
* *
* // -> These are three donkeys. * // -> These are three donkeys.
* *
* This translator does not support message catalogs, translation domains or * This translator does not support message catalogs, translation domains or
@ -56,12 +56,12 @@ class DefaultTranslator implements TranslatorInterface
* Example usage: * Example usage:
* *
* $translator = new DefaultTranslator(); * $translator = new DefaultTranslator();
* *
* echo $translator->trans( * echo $translator->trans(
* 'This is a {{ var }}.', * 'This is a {{ var }}.',
* array('{{ var }}' => 'donkey') * array('{{ var }}' => 'donkey')
* ); * );
* *
* // -> This is a donkey. * // -> This is a donkey.
* *
* @param string $id The message id * @param string $id The message id