Example #1
0
 /**
  * Initializes a new instance of that class.
  *
  * @param callable $provider The callable that provides the value.
  *
  * @throws ArgumentException $provider is no valid callable / lambda expression.
  * @throws ArgumentNullException $provider is (null).
  */
 public function __construct($provider)
 {
     if (null === $provider) {
         throw new ArgumentNullException('provider');
     }
     parent::__construct(static::asCallable($provider));
 }
Example #2
0
 /**
  * Initializes a new instance of that class.
  *
  * @param mixed $value The value to wrap.
  * @param callable $equalityComparer The custom equality comparer to use.
  *
  * @throws ArgumentException $equalityComparer is no valid callable / lambda expression.
  */
 public function __construct($value, $equalityComparer = null)
 {
     $this->_equalityComparer = static::getEqualityComparerSafe($equalityComparer);
     parent::__construct($value);
 }
Example #3
0
 /**
  * Initializes a new instance of that class.
  *
  * @param mixed $value The value to wrap.
  * @param callable $converter The converter to use.
  */
 public function __construct($value, $converter = null)
 {
     $this->_converter = static::getConverterSafe($converter);
     parent::__construct($value);
 }