@@ -19,6 +19,12 @@ public function getYamlKey(): string
1919
2020    public  function  getVariables (): array 
2121    {
22+         // Return empty array if the variables have not yet been set, 
23+         // to prevent calling getObjectActions or getBatchActions without reading the configuration 
24+         if  (empty ($ this  ->variables )) {
25+             return  [];
26+         }
27+ 
2228        // If credentials are not globally defined, 
2329        // check if an action have credentials 
2430        if  (null  === $ this  ->getVariable ('credentials ' )) {
@@ -49,13 +55,13 @@ public function getBatchActions(): array
4955
5056    protected  function  setUserBatchActionConfiguration (Action   $ action )
5157    {
52-         $ batchActions  = $ this  ->getVariable ('batch_actions ' , array () );
58+         $ batchActions  = $ this  ->getVariable ('batch_actions ' , [] );
5359        $ builderOptions  = is_array ($ batchActions ) && array_key_exists ($ action ->getName (), $ batchActions )
5460            ? $ batchActions [$ action ->getName ()]
55-             : array () ;
61+             : [] ;
5662
5763        $ globalOptions  = $ this  ->getGenerator ()->getFromYaml (
58-             'params.batch_actions. ' .$ action ->getName (), array () 
64+             'params.batch_actions. ' .$ action ->getName (), [] 
5965        );
6066
6167        if  (null  !== $ builderOptions ) {
@@ -76,7 +82,7 @@ protected function addBatchAction(Action $action)
7682
7783    protected  function  findBatchActions ()
7884    {
79-         $ batchActions  = $ this  ->getVariable ('batch_actions ' , array () );
85+         $ batchActions  = $ this  ->getVariable ('batch_actions ' , [] );
8086
8187        foreach  ($ batchActions  as  $ actionName  => $ actionParams ) {
8288            $ action  = $ this  ->findBatchAction ($ actionName );
0 commit comments