From 8bf632147d4da7332971bd1b335c852494c75752 Mon Sep 17 00:00:00 2001 From: Niels Keurentjes Date: Sat, 2 Dec 2023 01:28:09 +0100 Subject: [PATCH] Retire DataTablesTrait --- CHANGELOG.md | 1 + src/Controller/DataTablesTrait.php | 57 ------------------------------ 2 files changed, 1 insertion(+), 57 deletions(-) delete mode 100644 src/Controller/DataTablesTrait.php diff --git a/CHANGELOG.md b/CHANGELOG.md index c2446289..eab7357f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ Nothing yet. ## 0.8.0 - in RC ### Breaking - All interfaces and classes are now fully typed, this will likely require modifications in any custom extensions + - Removed `DataTablesTrait` for use in controllers - EOL: Drop PHP <8.1 support - EOL: Drop Symfony <6.3 support diff --git a/src/Controller/DataTablesTrait.php b/src/Controller/DataTablesTrait.php deleted file mode 100644 index 5a90fb1e..00000000 --- a/src/Controller/DataTablesTrait.php +++ /dev/null @@ -1,57 +0,0 @@ - - * - * @property ContainerInterface $container - * - * @deprecated inject the DataTableFactory in your controllers or actions instead - */ -trait DataTablesTrait -{ - /** - * Creates and returns a basic DataTable instance. - * - * @param array $options Options to be passed - * @return DataTable - */ - protected function createDataTable(array $options = []) - { - @trigger_error('Omines\DataTablesBundle\Controller\DataTablesTrait is deprecated. Use dependency injection to inject the Omines\DataTablesBundle\DataTableFactory service instead.', E_USER_DEPRECATED); - - return $this->container->get(DataTableFactory::class)->create($options); - } - - /** - * Creates and returns a DataTable based upon a registered DataTableType or an FQCN. - * - * @param string $type FQCN or service name - * @param array $typeOptions Type-specific options to be considered - * @param array $options Options to be passed - * @return DataTable - */ - protected function createDataTableFromType($type, array $typeOptions = [], array $options = []) - { - @trigger_error('Omines\DataTablesBundle\Controller\DataTablesTrait is deprecated. Use dependency injection to inject the Omines\DataTablesBundle\DataTableFactory service instead.', E_USER_DEPRECATED); - - return $this->container->get(DataTableFactory::class)->createFromType($type, $typeOptions, $options); - } -}