<?php

namespace PhpTabs\Component;

abstract class Config
{
  /**
   * @var array config options
   */
  private static $data = array();

  /**
   * Gets a defined option
   * 
   * @param string $key option name
   * @param mixed $default optional return value if not defined
   */
  public static function get($key, $default = null)
  {
    return is_string($key) && isset(self::$data[$key])
      ? self::$data[$key] : $default;
  }

  /**
   * Sets an option
   * 
   * @param string $key option name
   * @param mixed $value optional option value
   */
  public static function set($key, $value = null)
  {
    if (is_string($key))
    {
      self::$data[$key] = $value;
    }
  }

  /**
   * Gets all defined options
   * 
   * @return array All defined options
   */
  public static function getAll()
  {
    return self::$data;
  }
}

<?php

namespace PhpTabs\Component;

abstract class Config
{
  /**
   * @var array config options
   */
  private static $data = array();

  /**
   * Gets a defined option
   * 
   * @param string $key option name
   * @param mixed $default optional return value if not defined
   */
  public static function get($key, $default = null)
  {
    return isset(self::$data[$key]) ? self::$data[$key] : $default;
  }

  /**
   * Sets an option
   * 
   * @param string $key option name
   * @param mixed $value optional option value
   */
  public static function set($key, $value = null)
  {
    if (is_string($key))
    {
      self::$data[$key] = $value;
    }
  }

  /**
   * Gets all defined options
   * 
   * @return array All defined options
   */
  public static function getAll()
  {
    return self::$data;
  }
}

--- 
+++ 
@@ -17,7 +17,8 @@
    */
   public static function get($key, $default = null)
   {
-    return isset(self::$data[$key]) ? self::$data[$key] : $default;
+    return is_string($key) && isset(self::$data[$key])
+      ? self::$data[$key] : $default;
   }
 
   /**
Fix bad key format for config component
