remove obsolete code from buildOpspecColumns()
authorDenis Ovsienko <denis@ovsienko.info>
Thu, 28 Jun 2018 10:01:52 +0000 (11:01 +0100)
committerDenis Ovsienko <denis@ovsienko.info>
Thu, 28 Jun 2018 10:01:52 +0000 (11:01 +0100)
Since commit 3c3487c (delivered in release 0.20.11) 'if_empty' was not
supposed to appear in the $opspec_list structures. It has been more than
2 years since the change and it is the time to remove the obsolete code.

wwwroot/inc/ophandlers.php

index 771e4c3..db2f765 100644 (file)
@@ -3527,21 +3527,6 @@ function buildOpspecColumns ($opspec, $listname)
                                        throw new RackTablesError ('opspec translator function is not callable', RackTablesError::INTERNAL);
                                $arg_value = $argspec['translator'] ($arg_value);
                        }
-                       elseif // FIXME: remove the old declaration style at a later point
-                       (
-                               ($argspec['assertion'] == 'uint0' && $arg_value == 0) ||
-                               ($argspec['assertion'] == 'string0' && $arg_value == '')
-                       )
-                               switch (TRUE)
-                               {
-                               case !array_key_exists ('if_empty', $argspec): // no action requested
-                                       break;
-                               case $argspec['if_empty'] == 'NULL':
-                                       $arg_value = NULL;
-                                       break;
-                               default:
-                                       throw new InvalidArgException ('opspec', '(malformed array structure)', '"if_empty" not recognized');
-                               }
                        $columns[$table_colname] = $arg_value;
                        break;
                case array_key_exists ('fix_argname', $argspec): # fixed column