src/Kisma/Core/Utility/Option.php
public static function set( &$options = array(), $key, $value = null )
    {
        if ( is_array( $key ) )
        {
            return static::setMany( $options, $key );
        }

        $_cleanKey = static::_cleanKey( $key );

        if ( is_array( $options ) )
        {
            //	Check for the original key too
            if ( !array_key_exists( $key, $options ) && array_key_exists( $_cleanKey, $options ) )
            {
                $key = $_cleanKey;
            }

            $options[$key] = $value;

            return true;
        }

        if ( is_object( $options ) )
        {
            $_setter = 'set' . Inflector::deneutralize( $key );

            //	Prefer setter, if one...
            if ( method_exists( $options, $_setter ) )
            {
                $options->{$_setter}( $value );

                return true;
            }

            if ( property_exists( $options, $key ) )
            {
                $options->{$key} = $value;

                return true;
            }

            if ( property_exists( $options, $_cleanKey ) )
            {
                $options->{$_cleanKey} = $value;

                return true;
            }

            return false;
        }

        return false;
    }
public static function set( &$options = array(), $key, $value = null )
    {
        if ( is_array( $key ) )
        {
            return static::setMany( $options, $key );
        }

        $_cleanKey = static::_cleanKey( $key );

        if ( is_array( $options ) )
        {
            //	Check for the original key too
            if ( !array_key_exists( $key, $options ) && array_key_exists( $_cleanKey, $options ) )
            {
                $key = $_cleanKey;
            }

            $options[$key] = $value;

            return true;
        }

        if ( is_object( $options ) )
        {
            $_setter = 'set' . Inflector::deneutralize( $key );

            //	Prefer setter, if one...
            if ( method_exists( $options, $_setter ) )
            {
                $options->{$_setter}( $value );

                return true;
            }

            if ( property_exists( $options, $key ) )
            {
                $options->{$key} = $value;

                return true;
            }

            if ( property_exists( $options, $_cleanKey ) )
            {
                $options->{$_cleanKey} = $value;

                return true;
            }

            return false;
        }

        return false;
    }
public static function set ( & $ options = array ( ) , $ key , $ value = null ) { if ( is_array ( $ key ) ) { return static :: setMany ( $ options , $ key ) ; } $ _cleanKey = static :: _cleanKey ( $ key ) ; if ( is_array ( $ options ) ) { //	Check for the original key too if ( ! array_key_exists ( $ key , $ options ) && array_key_exists ( $ _cleanKey , $ options ) ) { $ key = $ _cleanKey ; } $ options [ $ key ] = $ value ; return true ; } if ( is_object ( $ options ) ) { $ _setter = 'set' . Inflector :: deneutralize ( $ key ) ; //	Prefer setter, if one... if ( method_exists ( $ options , $ _setter ) ) { $ options -> { $ _setter } ( $ value ) ; return true ; } if ( property_exists ( $ options , $ key ) ) { $ options -> { $ key } = $ value ; return true ; } if ( property_exists ( $ options , $ _cleanKey ) ) { $ options -> { $ _cleanKey } = $ value ; return true ; } return false ; } return false ; }
Sets an value in the given array at key.

@param array|\ArrayAccess|object $options The array or object from which to set $key's $value
@param string|array              $key     The array index or property to set
@param mixed                     $value   The value to set

@return bool|bool[]
Sets an value in the given array at key .