Skip to content

Commit c3fb205

Browse files
authored
Fix spurious deprecation warnings
Opcache preloading may trigger false deprecations during cache warmup.
1 parent 5ccdc12 commit c3fb205

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/Controller/DataTablesTrait.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616
use Omines\DataTablesBundle\DataTableFactory;
1717
use Psr\Container\ContainerInterface;
1818

19-
@trigger_error('Omines\DataTablesBundle\Controller\DataTablesTrait is deprecated. Use dependency injection to inject the Omines\DataTablesBundle\DataTableFactory service instead.', E_USER_DEPRECATED);
20-
2119
/**
2220
* DataTablesTrait.
2321
*
@@ -37,6 +35,8 @@ trait DataTablesTrait
3735
*/
3836
protected function createDataTable(array $options = [])
3937
{
38+
@trigger_error('Omines\DataTablesBundle\Controller\DataTablesTrait is deprecated. Use dependency injection to inject the Omines\DataTablesBundle\DataTableFactory service instead.', E_USER_DEPRECATED);
39+
4040
return $this->container->get(DataTableFactory::class)->create($options);
4141
}
4242

@@ -50,6 +50,8 @@ protected function createDataTable(array $options = [])
5050
*/
5151
protected function createDataTableFromType($type, array $typeOptions = [], array $options = [])
5252
{
53+
@trigger_error('Omines\DataTablesBundle\Controller\DataTablesTrait is deprecated. Use dependency injection to inject the Omines\DataTablesBundle\DataTableFactory service instead.', E_USER_DEPRECATED);
54+
5355
return $this->container->get(DataTableFactory::class)->createFromType($type, $typeOptions, $options);
5456
}
5557
}

0 commit comments

Comments
 (0)