public function _list($patterns, $assoc_args)
    {
        $this->init_args(func_get_args());
        $env   = $this->get_env_for_read_or_fail();

        $items = $env->dictionaryWithKeysMatching($patterns)
            ->map(function ($value, $key) {
                return (object) compact('key', 'value');
            });

        $args      = $this->args->toArray(); // var required - passed by reference
        $formatter = new Formatter($args, $this->fields());
        $formatter->display_items($items->all());
    }
public function _list($patterns, $assoc_args)
    {
        $this->init_args(func_get_args());
        $env   = $this->get_env_for_read_or_fail();

        $items = $env->dictionaryWithKeysMatching($patterns)
            ->map(function ($value, $key) {
                return (object) compact('key', 'value');
            });

        $args      = $this->args->toArray(); // var required - passed by reference
        $formatter = new Formatter($args, $this->fields());
        $formatter->display_items($items->all());
    }
public function _list ( $ patterns , $ assoc_args ) { $ this -> init_args ( func_get_args ( ) ) ; $ env = $ this -> get_env_for_read_or_fail ( ) ; $ items = $ env -> dictionaryWithKeysMatching ( $ patterns ) -> map ( function ( $ value , $ key ) { return ( object ) compact ( 'key' , 'value' ) ; } ) ; $ args = $ this -> args -> toArray ( ) ; // var required - passed by reference $ formatter = new Formatter ( $ args , $ this -> fields ( ) ) ; $ formatter -> display_items ( $ items -> all ( ) ) ; }
List the defined variables from the environment file

[<pattern>...]
: Key names or glob-style patterns to match.

[--format=<format>]
: Accepted values: table, csv, json, count. Default: table

[--file=<path-to-dotenv>]
: Path to the environment file.  Default: '.env'

@subcommand list
@when       before_wp_load

@param array $patterns   Glob-style patterns to match against env keys
@param array $assoc_args
List the defined variables from the environment file