Grid/Type/GridType.php
public function configureOptions(OptionsResolver $resolver)
    {
        $resolver->setDefaults([
            'source'           => null,
            'group_by'         => null,
            'sort_by'          => null,
            'order'            => 'asc',
            'page'             => 1,
            'route'            => '',
            'route_parameters' => [],
            'persistence'      => false,
            'max_per_page'     => 10,
            'max_results'      => null,
            'filterable'       => true,
            'sortable'         => true,
        ]);

        $allowedTypes = [
            'source'           => ['null', 'APY\DataGridBundle\Grid\Source\Source'],
            'group_by'         => ['null', 'string', 'array'],
            'route_parameters' => 'array',
            'persistence'      => 'bool',
            'filterable'       => 'bool',
            'sortable'         => 'bool',
        ];
        $allowedValues = [
            'order' => ['asc', 'desc'],
        ];
        if (method_exists($resolver, 'setDefault')) {
            // Symfony 2.6.0 and up
            foreach ($allowedTypes as $option => $types) {
                $resolver->setAllowedTypes($option, $types);
            }

            foreach ($allowedValues as $option => $values) {
                $resolver->setAllowedValues($option, $values);
            }
        } else {
            $resolver->setAllowedTypes($allowedTypes);
            $resolver->setAllowedValues($allowedValues);
        }
    }
public function configureOptions(OptionsResolver $resolver)
    {
        $resolver->setDefaults([
            'source'           => null,
            'group_by'         => null,
            'sort_by'          => null,
            'order'            => 'asc',
            'page'             => 1,
            'route'            => '',
            'route_parameters' => [],
            'persistence'      => false,
            'max_per_page'     => 10,
            'max_results'      => null,
            'filterable'       => true,
            'sortable'         => true,
        ]);

        $allowedTypes = [
            'source'           => ['null', 'APY\DataGridBundle\Grid\Source\Source'],
            'group_by'         => ['null', 'string', 'array'],
            'route_parameters' => 'array',
            'persistence'      => 'bool',
            'filterable'       => 'bool',
            'sortable'         => 'bool',
        ];
        $allowedValues = [
            'order' => ['asc', 'desc'],
        ];
        if (method_exists($resolver, 'setDefault')) {
            // Symfony 2.6.0 and up
            foreach ($allowedTypes as $option => $types) {
                $resolver->setAllowedTypes($option, $types);
            }

            foreach ($allowedValues as $option => $values) {
                $resolver->setAllowedValues($option, $values);
            }
        } else {
            $resolver->setAllowedTypes($allowedTypes);
            $resolver->setAllowedValues($allowedValues);
        }
    }
{@inheritdoc}