/** * Check if the table is set and if the table exists * * @param string[] $args The command arguments * * @return bool True if the table exists else false */ private function checkTableName(array $args) : bool { $check = true; if (!isset($args['t'])) { static::fail('You need to specify a table name with -t parameter' . PHP_EOL); $check = false; } elseif (!in_array($args['t'], DB::getAllTables())) { static::fail('The table "' . $args['t'] . '" does not exist' . PHP_EOL); $check = false; } return $check; }