public function commands()
    {
        $shellList = $this->getShellList();
        $flatten = Hash::flatten($shellList);
        $duplicates = array_intersect($flatten, array_unique(array_diff_key($flatten, array_unique($flatten))));
        $duplicates = Hash::expand($duplicates);

        $options = [];
        foreach ($shellList as $type => $commands) {
            foreach ($commands as $shell) {
                $prefix = '';
                if (!in_array(strtolower($type), ['app', 'core']) &&
                    isset($duplicates[$type]) &&
                    in_array($shell, $duplicates[$type])
                ) {
                    $prefix = $type . '.';
                }

                $options[] = $prefix . $shell;
            }
        }

        return $options;
    }
public function commands()
    {
        $shellList = $this->getShellList();
        $flatten = Hash::flatten($shellList);
        $duplicates = array_intersect($flatten, array_unique(array_diff_key($flatten, array_unique($flatten))));
        $duplicates = Hash::expand($duplicates);

        $options = [];
        foreach ($shellList as $type => $commands) {
            foreach ($commands as $shell) {
                $prefix = '';
                if (!in_array(strtolower($type), ['app', 'core']) &&
                    isset($duplicates[$type]) &&
                    in_array($shell, $duplicates[$type])
                ) {
                    $prefix = $type . '.';
                }

                $options[] = $prefix . $shell;
            }
        }

        return $options;
    }
public function commands ( ) { $ shellList = $ this -> getShellList ( ) ; $ flatten = Hash :: flatten ( $ shellList ) ; $ duplicates = array_intersect ( $ flatten , array_unique ( array_diff_key ( $ flatten , array_unique ( $ flatten ) ) ) ) ; $ duplicates = Hash :: expand ( $ duplicates ) ; $ options = [ ] ; foreach ( $ shellList as $ type => $ commands ) { foreach ( $ commands as $ shell ) { $ prefix = '' ; if ( ! in_array ( strtolower ( $ type ) , [ 'app' , 'core' ] ) && isset ( $ duplicates [ $ type ] ) && in_array ( $ shell , $ duplicates [ $ type ] ) ) { $ prefix = $ type . '.' ; } $ options [ ] = $ prefix . $ shell ; } } return $ options ; }
Return a list of all commands

@return array
Return a list of all commands