Coding standards and removing whitespace.
This commit is contained in:
parent
b498138471
commit
79793e442a
@ -132,7 +132,7 @@ class EntityChoiceList extends ArrayChoiceList
|
||||
|
||||
if (is_array($this->choices)) {
|
||||
$entities = $this->choices;
|
||||
} else if ($entityLoader = $this->entityLoader) {
|
||||
} elseif ($entityLoader = $this->entityLoader) {
|
||||
$entities = $entityLoader->getEntities();
|
||||
} else {
|
||||
$entities = $this->em->getRepository($this->class)->findAll();
|
||||
|
@ -13,14 +13,14 @@ namespace Symfony\Bridge\Doctrine\Form\ChoiceList;
|
||||
|
||||
/**
|
||||
* Custom loader for entities in the choice list.
|
||||
*
|
||||
*
|
||||
* @author Benjamin Eberlei <kontakt@beberlei.de>
|
||||
*/
|
||||
interface EntityLoaderInterface
|
||||
{
|
||||
{
|
||||
/**
|
||||
* Return an array of entities that are valid choices in the corresponding choice list.
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
function getEntities();
|
||||
|
@ -127,7 +127,7 @@
|
||||
if ('section.child' == event.name) {
|
||||
context.fillStyle = colors.child_sections;
|
||||
context.fillRect(x + period.begin * ratio, 0, (period.end - period.begin) * ratio, height);
|
||||
} else if ('section' == event.category) {
|
||||
} elseif ('section' == event.category) {
|
||||
context.beginPath();
|
||||
context.strokeStyle = "#dfdfdf";
|
||||
context.moveTo(x + period.begin * ratio, 0);
|
||||
@ -156,7 +156,7 @@
|
||||
if (colors[event.name]) {
|
||||
context.fillStyle = colors[event.name];
|
||||
context.strokeStyle = colors[event.name];
|
||||
} else if (colors[event.category]) {
|
||||
} elseif (colors[event.category]) {
|
||||
context.fillStyle = colors[event.category];
|
||||
context.strokeStyle = colors[event.category];
|
||||
} else {
|
||||
|
@ -14,7 +14,7 @@
|
||||
if (4 === xhr.readyState && 200 === xhr.status && -1 !== xhr.responseText.indexOf('sf-toolbarreset')) {
|
||||
wdt.innerHTML = xhr.responseText;
|
||||
wdt.style.display = 'block';
|
||||
} else if (4 === xhr.readyState && xhr.status != 200) {
|
||||
} elseif (4 === xhr.readyState && xhr.status != 200) {
|
||||
confirm('An error occurred while loading the web debug toolbar (' + xhr.status + ': ' + xhr.statusText + ').\n\nDo you want to open the profiler?') && (window.location = '{{ path("_profiler", { "token": token }) }}');
|
||||
}
|
||||
};
|
||||
|
@ -13,7 +13,7 @@ namespace Symfony\Component\HttpKernel\CacheClearer;
|
||||
|
||||
/**
|
||||
* CacheClearerInterface.
|
||||
*
|
||||
*
|
||||
* @author Dustin Dobervich <ddobervich@gmail.com>
|
||||
*/
|
||||
interface CacheClearerInterface
|
||||
|
@ -13,7 +13,7 @@ namespace Symfony\Component\HttpKernel\CacheClearer;
|
||||
|
||||
/**
|
||||
* ChainCacheClearer.
|
||||
*
|
||||
*
|
||||
* @author Dustin Dobervich <ddobervich@gmail.com>
|
||||
*/
|
||||
class ChainCacheClearer implements CacheClearerInterface
|
||||
@ -32,7 +32,7 @@ class ChainCacheClearer implements CacheClearerInterface
|
||||
{
|
||||
$this->clearers = $clearers;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@ -42,11 +42,11 @@ class ChainCacheClearer implements CacheClearerInterface
|
||||
$clearer->clear($cacheDir);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Adds a cache clearer to the aggregate.
|
||||
*
|
||||
* @param CacheClearerInterface $clearer
|
||||
*
|
||||
* @param CacheClearerInterface $clearer
|
||||
*/
|
||||
public function add(CacheClearerInterface $clearer)
|
||||
{
|
||||
|
@ -19,7 +19,7 @@ class SingleIdentEntity
|
||||
$this->id = $id;
|
||||
$this->name = $name;
|
||||
}
|
||||
|
||||
|
||||
public function __toString()
|
||||
{
|
||||
return (string)$this->name;
|
||||
|
@ -111,7 +111,7 @@ class EntityTypeTest extends TypeTestCase
|
||||
|
||||
$this->assertEquals(array(1 => 'Foo', 2 => 'Bar'), $field->createView()->get('choices'));
|
||||
}
|
||||
|
||||
|
||||
public function testSetDataToUninitializedEntityWithNonRequiredToString()
|
||||
{
|
||||
$entity1 = new SingleIdentEntity(1, 'Foo');
|
||||
@ -127,7 +127,7 @@ class EntityTypeTest extends TypeTestCase
|
||||
|
||||
$this->assertEquals(array("1" => 'Foo', "2" => 'Bar'), $field->createView()->get('choices'));
|
||||
}
|
||||
|
||||
|
||||
public function testSetDataToUninitializedEntityWithNonRequiredQueryBuilder()
|
||||
{
|
||||
$entity1 = new SingleIdentEntity(1, 'Foo');
|
||||
|
@ -34,23 +34,23 @@ class ChainCacheClearerTest extends \PHPUnit_Framework_TestCase
|
||||
$clearer
|
||||
->expects($this->once())
|
||||
->method('clear');
|
||||
|
||||
|
||||
$chainClearer = new ChainCacheClearer(array($clearer));
|
||||
$chainClearer->clear(self::$cacheDir);
|
||||
}
|
||||
|
||||
|
||||
public function testInjectClearerUsingAdd()
|
||||
{
|
||||
$clearer = $this->getMockClearer();
|
||||
$clearer
|
||||
->expects($this->once())
|
||||
->method('clear');
|
||||
|
||||
|
||||
$chainClearer = new ChainCacheClearer();
|
||||
$chainClearer->add($clearer);
|
||||
$chainClearer->clear(self::$cacheDir);
|
||||
}
|
||||
|
||||
|
||||
protected function getMockClearer()
|
||||
{
|
||||
return $this->getMock('Symfony\Component\HttpKernel\CacheClearer\CacheClearerInterface');
|
||||
|
Reference in New Issue
Block a user