src/Plugin/Setup.php
public function load_options( string $options )
    {
        // get constants
        $reflect = new \ReflectionClass( $options );
        $options = $reflect->getConstants();

        // iterate needed params
        foreach ( $options as $option => $default ) {
            $key = strtolower( $option ); //
            $env = getenv( $option );
            $this->options[ $key ] = get_option( $key, $default );
            // overload env variables
            $this->options[ $key ] = ! $env ? $this->options[ $key ] : $env;
        }
    }
public function load_options( string $options )
    {
        // get constants
        $reflect = new \ReflectionClass( $options );
        $options = $reflect->getConstants();

        // iterate needed params
        foreach ( $options as $option => $default ) {
            $key = strtolower( $option ); //
            $env = getenv( $option );
            $this->options[ $key ] = get_option( $key, $default );
            // overload env variables
            $this->options[ $key ] = ! $env ? $this->options[ $key ] : $env;
        }
    }
public function load_options ( string $ options ) { // get constants $ reflect = new \ ReflectionClass ( $ options ) ; $ options = $ reflect -> getConstants ( ) ; // iterate needed params foreach ( $ options as $ option => $ default ) { $ key = strtolower ( $ option ) ; // $ env = getenv ( $ option ) ; $ this -> options [ $ key ] = get_option ( $ key , $ default ) ; // overload env variables $ this -> options [ $ key ] = ! $ env ? $ this -> options [ $ key ] : $ env ; } }
Load required options

@param string $options
Load required options