Permalink
Browse files

cs fix

  • Loading branch information...
kbond committed Dec 11, 2013
1 parent 7d2fed2 commit 9446b13ad30c298fefa56e2efabeb264000cef73
@@ -29,4 +29,4 @@ public function process(ContainerBuilder $container)
$definition->addMethodCall('addExportType', array(new Reference($id)));
}
}
}
}
@@ -90,7 +90,7 @@ public function addGridConfig(NodeParentInterface $node)
->variableNode('filter_values')
->defaultNull()
->validate()
->ifTrue(function($value) {
->ifTrue(function ($value) {
return !is_null($value) && !is_array($value);
})
->thenInvalid('Must be either null or an array.')
@@ -102,7 +102,7 @@ public function addGridConfig(NodeParentInterface $node)
->defaultNull()
->validate()
->ifNotInArray(Field::getAvailableSortDirections())
->thenInvalid(sprintf('sort_direction must be one of: %s', implode(', ', array_map(function($value) {
->thenInvalid(sprintf('sort_direction must be one of: %s', implode(', ', array_map(function ($value) {
return is_null($value) ? 'null' : sprintf('"%s"', $value);
}, Field::getAvailableSortDirections()))))
->end()
@@ -99,4 +99,4 @@ public function getAlias()
{
return 'zenstruck_datagrid';
}
}
}
@@ -112,4 +112,4 @@ public function filterQuery(FieldCollection $fieldCollection)
return $this->qb;
}
}
}
@@ -15,4 +15,4 @@
* @return array
*/
public function execute(FieldCollection $fieldCollection);
}
}
View
@@ -46,4 +46,4 @@ public function addExportType(ExportTypeInterface $exportType)
{
$this->types[$exportType->getType()] = $exportType;
}
}
}
@@ -16,4 +16,4 @@ public function getType()
{
return 'csv';
}
}
}
@@ -22,4 +22,4 @@ public function export(Grid $grid, $filename, $options = array());
* @return string
*/
public function getType();
}
}
@@ -99,4 +99,4 @@ protected function writeData(\PHPExcel $phpExcel, $column, $row, $data)
* @return \PHPExcel_Writer_IWriter
*/
abstract public function getWriter(\PHPExcel $phpExcel);
}
}
@@ -16,4 +16,4 @@ public function getWriter(\PHPExcel $phpExcel)
{
return new \PHPExcel_Writer_Excel5($phpExcel);
}
}
}
@@ -16,4 +16,4 @@ public function getWriter(\PHPExcel $phpExcel)
{
return new \PHPExcel_Writer_Excel2007($phpExcel);
}
}
}
View
@@ -4,7 +4,6 @@
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\PropertyAccess\PropertyAccess;
use Symfony\Component\PropertyAccess\PropertyAccessor;
/**
* @author Kevin Bond <kevinbond@gmail.com>
@@ -161,6 +160,7 @@ public function setFilterValue($value)
{
if (!$this->isFilterable() || ((is_array($this->filterValues) && !in_array($value, $this->filterValues)))) {
$this->filterValue = null;
return;
}
@@ -193,6 +193,7 @@ public function setSortDirection($value)
{
if (!$this->isSortable() || null === $value) {
$this->sortDirection = null;
return;
}
@@ -232,4 +233,4 @@ public function getValue($object)
return $accessor->getValue($object, $name);
}
}
}
View
@@ -31,7 +31,7 @@ public function __construct(array $fields = array())
*/
public function getVisible()
{
return array_filter($this->fields, function(Field $field) {
return array_filter($this->fields, function (Field $field) {
return $field->isVisible();
});
}
@@ -41,7 +41,7 @@ public function getVisible()
*/
public function getSearchable()
{
return array_filter($this->fields, function(Field $field) {
return array_filter($this->fields, function (Field $field) {
return $field->isSearchable();
});
}
@@ -120,7 +120,7 @@ public function setSortDirections(array $sorts = array())
*/
public function clearSorts()
{
return $this->forAll(function(Field $field) {
return $this->forAll(function (Field $field) {
if ($field->isSortable()) {
$field->setSortDirection(null);
}
@@ -133,7 +133,7 @@ public function clearSorts()
*/
public function clearFilters()
{
return $this->forAll(function(Field $field) {
return $this->forAll(function (Field $field) {
if ($field->isFilterable()) {
$field->setFilterValue(null);
}
@@ -199,4 +199,4 @@ protected function forAll(\Closure $p)
return $this;
}
}
}
@@ -81,4 +81,4 @@ public function getFilters();
* @return array
*/
public function getSorts();
}
}
@@ -16,4 +16,4 @@ public function getCurrentPage();
* @return int
*/
public function getMaxPerPage();
}
}
View
@@ -47,7 +47,7 @@ public function __construct(Request $request, RouterInterface $router)
}
/**
* @param FieldCollection $fieldCollection
* @param FieldCollection $fieldCollection
* @return FieldCollection
*/
public function filter(FieldCollection $fieldCollection)
@@ -184,4 +184,4 @@ public function getRouteParams()
{
return $this->routeParams;
}
}
}
View
@@ -108,4 +108,4 @@ public function getFilter()
{
return $this->filter;
}
}
}
View
@@ -25,4 +25,4 @@ public function getMaxPerPage();
public function execute(FieldCollection $fields, ExecutorInterface $executor, $currentPage = 1, $maxPerPage = self::DEFAULT_MAX_PER_PAGE);
public function getPaginator();
}
}
@@ -20,4 +20,4 @@ protected function createAdapter(FieldCollection $fields, ExecutorInterface $exe
return new DoctrineORMAdapter($executor->filterQuery($fields));
}
}
}
@@ -72,10 +72,10 @@ public function getPaginator()
}
/**
* @param FieldCollection $fields
* @param FieldCollection $fields
* @param ExecutorInterface $executor
*
* @return AdapterInterface
*/
abstract protected function createAdapter(FieldCollection $fields, ExecutorInterface $executor);
}
}
View
@@ -119,4 +119,4 @@ public function getPager()
return $this->pager;
}
}
}
@@ -13,4 +13,4 @@
<tag name="zenstruck_datagrid.export_type" />
</service>
</services>
</container>
</container>
@@ -14,4 +14,4 @@
<argument>%zenstruck_datagrid.export_global_options%</argument>
</service>
</services>
</container>
</container>
@@ -13,4 +13,4 @@
<tag name="zenstruck_datagrid.export_type" />
</service>
</services>
</container>
</container>
@@ -13,4 +13,4 @@
<tag name="zenstruck_datagrid.export_type" />
</service>
</services>
</container>
</container>
@@ -25,4 +25,4 @@
<tag name="twig.extension" />
</service>
</services>
</container>
</container>
@@ -95,4 +95,4 @@
{% endif %}
</td>
{% endspaceless %}
{% endblock %}
{% endblock %}
@@ -2,4 +2,4 @@
{% if pager and pager.paginator.haveToPaginate %}
{{ pagerfanta(pager.paginator, 'twitter_bootstrap', pager_params) }}
{% endif %}
{% endblock %}
{% endblock %}
@@ -157,4 +157,4 @@ public function testClearFilters()
$fieldCollection->clearFilters();
$this->assertNull($fieldCollection->get('bar')->getFilterValue());
}
}
}
@@ -119,4 +119,4 @@ public function getFooBar()
{
return 'getFooBar';
}
}
}
@@ -120,4 +120,4 @@ protected function createRequestFilter(Request $request)
return new RequestFilter($request, $router);
}
}
}
View
@@ -161,7 +161,7 @@ protected function renderBlock($name, array $parameters = array())
throw new \InvalidArgumentException(
sprintf('Block "%s" doesn\'t exist in template "%s".', $name,
implode(', ', array_map(function(\Twig_Template $template) {
implode(', ', array_map(function (\Twig_Template $template) {
return $template->getTemplateName();
}, $this->getTemplates()
)))
@@ -205,4 +205,4 @@ protected function getTemplates()
{
return $this->templates;
}
}
}
@@ -24,4 +24,4 @@ public function getContainerExtension()
{
return $this->extension = new ZenstruckDataGridExtension();
}
}
}

0 comments on commit 9446b13

Please sign in to comment.