public static function writeAssociativeArrayTable(SymfonyStyle $helper, $array, $flatten = null)
    {
        if (null !== $flatten) {
            $helper->note('Using flatten is deprecated');

        }
        if (false === is_array($array)) {
            $helper->error(
                [
                    'Expecting associative array for table',
                    sprintf('Given data for table is %s.', gettype($array)),
                ]
            );
        }

        $rows = [];
        foreach ($array as $index => $value) {
            $rows[] = [
                $index,
                self::getStringForTable($value),
            ];
        }

        try {
            $helper->table([], $rows);
        } catch (ContextErrorException $error) {
            print_r($rows);

            $helper->error(
                [
                    'Table failed with error:',
                    $error->getMessage(),
                ]
            );
        }
    }