<commit_before><?php

/*
 * This file is part of the Sonata Project package.
 *
 * (c) <NAME> <<EMAIL>>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Sonata\AdminBundle\Admin;

use Knp\Menu\ItemInterface as MenuItemInterface;
use Sonata\AdminBundle\Datagrid\DatagridMapper;
use Sonata\AdminBundle\Datagrid\ListMapper;
use Sonata\AdminBundle\Datagrid\ProxyQueryInterface;
use Sonata\AdminBundle\Form\FormMapper;
use Sonata\AdminBundle\Route\RouteCollection;
use Sonata\AdminBundle\Show\ShowMapper;
use Sonata\CoreBundle\Validator\ErrorElement;

/**
 * @author <NAME> <<EMAIL>>
 */
interface AdminExtensionInterface
{
    /**
     * @param FormMapper $formMapper
     */
    public function configureFormFields(FormMapper $formMapper);

    /**
     * @param ListMapper $listMapper
     */
    public function configureListFields(ListMapper $listMapper);

    /**
     * @param DatagridMapper $datagridMapper
     */
    public function configureDatagridFilters(DatagridMapper $datagridMapper);

    /**
     * @param ShowMapper $showMapper
     */
    public function configureShowFields(ShowMapper $showMapper);

    /**
     * @param AdminInterface  $admin
     * @param RouteCollection $collection
     */
    public function configureRoutes(AdminInterface $admin, RouteCollection $collection);

    /**
     * DEPRECATED: Use configureTabMenu instead.
     *
     * NEXT_MAJOR: remove this method.
     *
     * @param AdminInterface    $admin
     * @param MenuItemInterface $menu
     * @param string            $action
     * @param AdminInterface    $childAdmin
     *
     * @deprecated
     */
    public function configureSideMenu(AdminInterface $admin, MenuItemInterface $menu, $action, AdminInterface $childAdmin = null);

    /**
     * Builds the tab menu.
     *
     * @param AdminInterface    $admin
     * @param MenuItemInterface $menu
     * @param string            $action
     * @param AdminInterface    $childAdmin
     */
    public function configureTabMenu(AdminInterface $admin, MenuItemInterface $menu, $action, AdminInterface $childAdmin = null);

    /**
     * @param AdminInterface $admin
     * @param ErrorElement   $errorElement
     * @param mixed          $object
     */
    public function validate(AdminInterface $admin, ErrorElement $errorElement, $object);

    /**
     * @param AdminInterface      $admin
     * @param ProxyQueryInterface $query
     * @param string              $context
     */
    public function configureQuery(AdminInterface $admin, ProxyQueryInterface $query, $context = 'list');

    /**
     * Get a chance to modify a newly created instance.
     *
     * @param AdminInterface $admin
     * @param mixed          $object
     */
    public function alterNewInstance(AdminInterface $admin, $object);

    /**
     * Get a chance to modify object instance.
     *
     * @param AdminInterface $admin
     * @param mixed          $object
     */
    public function alterObject(AdminInterface $admin, $object);

    /**
     * Get a chance to add persistent parameters.
     *
     * @param AdminInterface $admin
     *
     * @return array
     */
    public function getPersistentParameters(AdminInterface $admin);

     /**
      * Return the controller access mapping.
      *
      * @param AdminInterface $admin
      *
      * @return array
      */
     public function getAccessMapping(AdminInterface $admin);

    /**
     * Returns the list of batch actions.
     *
     * @param AdminInterface $admin
     * @param array          $actions
     *
     * @return array
     */
    public function configureBatchActions(AdminInterface $admin, array $actions);

    /**
     * Get a chance to modify export fields.
     *
     * @param AdminInterface $admin
     * @param string[]       $fields
     *
     * @return string[]
     */
    // TODO: Uncomment in next major release
    // public function configureExportFields(AdminInterface $admin, array $fields);

    /**
     * @param AdminInterface $admin
     * @param mixed          $object
     */
    public function preUpdate(AdminInterface $admin, $object);

    /**
     * @param AdminInterface $admin
     * @param mixed          $object
     */
    public function postUpdate(AdminInterface $admin, $object);

    /**
     * @param AdminInterface $admin
     * @param mixed          $object
     */
    public function prePersist(AdminInterface $admin, $object);

    /**
     * @param AdminInterface $admin
     * @param mixed          $object
     */
    public function postPersist(AdminInterface $admin, $object);

    /**
     * @param AdminInterface $admin
     * @param mixed          $object
     */
    public function preRemove(AdminInterface $admin, $object);

    /**
     * @param AdminInterface $admin
     * @param mixed          $object
     */
    public function postRemove(AdminInterface $admin, $object);

     /**
      * Get all action buttons for an action.
      *
      * @param AdminInterface $admin
      * @param array          $list
      * @param string         $action
      * @param object         $object
      *
      * @return array
      */
     public function configureActionButtons(AdminInterface $admin, $list, $action, $object);

    /*
     * NEXT_MAJOR: Uncomment in next major release
     *
     * Returns a list of default filters
     *
     * @param AdminInterface $admin
     * @param array          $filterValues
     */
    // public function configureDefaultFilterValues(AdminInterface $admin, array &$filterValues);
}<commit_msg>Apply fixes from StyleCI (#4647)<commit_after><?php

/*
 * This file is part of the Sonata Project package.
 *
 * (c) <NAME> <<EMAIL>>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Sonata\AdminBundle\Admin;

use Knp\Menu\ItemInterface as MenuItemInterface;
use Sonata\AdminBundle\Datagrid\DatagridMapper;
use Sonata\AdminBundle\Datagrid\ListMapper;
use Sonata\AdminBundle\Datagrid\ProxyQueryInterface;
use Sonata\AdminBundle\Form\FormMapper;
use Sonata\AdminBundle\Route\RouteCollection;
use Sonata\AdminBundle\Show\ShowMapper;
use Sonata\CoreBundle\Validator\ErrorElement;

/**
 * @author <NAME> <<EMAIL>>
 */
interface AdminExtensionInterface
{
    /**
     * @param FormMapper $formMapper
     */
    public function configureFormFields(FormMapper $formMapper);

    /**
     * @param ListMapper $listMapper
     */
    public function configureListFields(ListMapper $listMapper);

    /**
     * @param DatagridMapper $datagridMapper
     */
    public function configureDatagridFilters(DatagridMapper $datagridMapper);

    /**
     * @param ShowMapper $showMapper
     */
    public function configureShowFields(ShowMapper $showMapper);

    /**
     * @param AdminInterface  $admin
     * @param RouteCollection $collection
     */
    public function configureRoutes(AdminInterface $admin, RouteCollection $collection);

    /**
     * DEPRECATED: Use configureTabMenu instead.
     *
     * NEXT_MAJOR: remove this method.
     *
     * @param AdminInterface    $admin
     * @param MenuItemInterface $menu
     * @param string            $action
     * @param AdminInterface    $childAdmin
     *
     * @deprecated
     */
    public function configureSideMenu(AdminInterface $admin, MenuItemInterface $menu, $action, AdminInterface $childAdmin = null);

    /**
     * Builds the tab menu.
     *
     * @param AdminInterface    $admin
     * @param MenuItemInterface $menu
     * @param string            $action
     * @param AdminInterface    $childAdmin
     */
    public function configureTabMenu(AdminInterface $admin, MenuItemInterface $menu, $action, AdminInterface $childAdmin = null);

    /**
     * @param AdminInterface $admin
     * @param ErrorElement   $errorElement
     * @param mixed          $object
     */
    public function validate(AdminInterface $admin, ErrorElement $errorElement, $object);

    /**
     * @param AdminInterface      $admin
     * @param ProxyQueryInterface $query
     * @param string              $context
     */
    public function configureQuery(AdminInterface $admin, ProxyQueryInterface $query, $context = 'list');

    /**
     * Get a chance to modify a newly created instance.
     *
     * @param AdminInterface $admin
     * @param mixed          $object
     */
    public function alterNewInstance(AdminInterface $admin, $object);

    /**
     * Get a chance to modify object instance.
     *
     * @param AdminInterface $admin
     * @param mixed          $object
     */
    public function alterObject(AdminInterface $admin, $object);

    /**
     * Get a chance to add persistent parameters.
     *
     * @param AdminInterface $admin
     *
     * @return array
     */
    public function getPersistentParameters(AdminInterface $admin);

    /**
     * Return the controller access mapping.
     *
     * @param AdminInterface $admin
     *
     * @return array
     */
    public function getAccessMapping(AdminInterface $admin);

    /**
     * Returns the list of batch actions.
     *
     * @param AdminInterface $admin
     * @param array          $actions
     *
     * @return array
     */
    public function configureBatchActions(AdminInterface $admin, array $actions);

    /**
     * Get a chance to modify export fields.
     *
     * @param AdminInterface $admin
     * @param string[]       $fields
     *
     * @return string[]
     */
    // TODO: Uncomment in next major release
    // public function configureExportFields(AdminInterface $admin, array $fields);

    /**
     * @param AdminInterface $admin
     * @param mixed          $object
     */
    public function preUpdate(AdminInterface $admin, $object);

    /**
     * @param AdminInterface $admin
     * @param mixed          $object
     */
    public function postUpdate(AdminInterface $admin, $object);

    /**
     * @param AdminInterface $admin
     * @param mixed          $object
     */
    public function prePersist(AdminInterface $admin, $object);

    /**
     * @param AdminInterface $admin
     * @param mixed          $object
     */
    public function postPersist(AdminInterface $admin, $object);

    /**
     * @param AdminInterface $admin
     * @param mixed          $object
     */
    public function preRemove(AdminInterface $admin, $object);

    /**
     * @param AdminInterface $admin
     * @param mixed          $object
     */
    public function postRemove(AdminInterface $admin, $object);

    /**
     * Get all action buttons for an action.
     *
     * @param AdminInterface $admin
     * @param array          $list
     * @param string         $action
     * @param object         $object
     *
     * @return array
     */
    public function configureActionButtons(AdminInterface $admin, $list, $action, $object);

    /*
     * NEXT_MAJOR: Uncomment in next major release
     *
     * Returns a list of default filters
     *
     * @param AdminInterface $admin
     * @param array          $filterValues
     */
    // public function configureDefaultFilterValues(AdminInterface $admin, array &$filterValues);
}
{'fraction_non_alphanumeric': 0.09761523402740702, 'fraction_numerical': 0.0003559352197899982, 'mean_word_length': 2.477413366336634, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7227482', 'n_tokens_mistral': 2987, 'n_tokens_neox': 2942, 'n_words': 844}