Send a value to the generator.

@param mixed $value

@return mixed
546963
final public function send($value)
    {
        $this->_lastValueSentIn        = $value;
        $this->_sendInvokedAtLeastOnce = true;

        /*
         * If we've already ran to the first yield statement (from rewind() or key(), for instance), we need
         * to try to move to the next position;
         */
        if ($this->_positionsExecutedCount > 0) {

            $this->_position++;
        }

        return $this->current();
    }
988488
public function offsetPush($value)
    {

        $keys = $this->storage->keys();

        $nextId = $this->idGenerator->until(function ($id) use ($keys) {
            return !$keys->contains($id);
        })->generate($this->passSalt ? $value : null);

        $this->storage->offsetSet($nextId, $value);

        return $nextId;
    }
586931
protected function setValue($value)
    {
        if (!isset($this->value) || null === $this->value) {
            $this->value = $value;
        }

        return $this;
    }
376820
public static final function cast($value): array {
		if (is_array($value)){
			return $value;
		}

		if (is_object($value) && method_exists($value, 'toArray')){
			return $value->toArray();
		}

		if ($value instanceof \Generator){
			return iterator_to_array($value);
		}

		return [$value];
	}
758937
public function setValue($value)
    {
        // Set name in payload
        $payload = $this->getPayload();
        $payload['value'] = $value;

        return $this->setPayload($payload);
    }
148868
public function setValue( $value ) {
		$this->value = $this->cleanUpValue( $value );
		$this->input->setValue( $this->value );
		return $this;
	}
737911
public function transform($value)
    {
        if (null === $value) {
            return null;
        }

        if (!$value instanceof User) {
            throw new TransformationFailedException('Expected a ' . User::class . ' object.');
        }

        return $value->id;
    }
348198
public function transform($value)
    {
        if (null === $value) {
            return null;
        }

        if (!$value instanceof Value) {
            throw new TransformationFailedException(
                sprintf('Expected a %s, got %s instead', Value::class, gettype($value))
            );
        }

        if (null === $value->date) {
            return null;
        }

        return $value->date->getTimestamp();
    }
502223
public static function make($value)
    {
        if (is_resource($value)) {
            $value = null;
        } elseif (Arr::accessible($value)) {
            $value = new ArraySerialization($value);
        } elseif ($value instanceof stdClass) {
            $value = new ObjectSerialization($value);
        } elseif ($value instanceof Container) {
            $value = new ContainerSerialization($value);
        } elseif ($value instanceof DateTime) {
            $value = new DateTimeSerialization($value);
        } elseif ($value instanceof Validator) {
            $value = new ValidatorSerialization($value);
        } elseif ($value instanceof Throwable) {
            $value = new ThrowableSerialization($value);
        } elseif ($value instanceof Closure) {
            $value = null;
        }

        return $value;
    }
447018
public function setValue($value = null)
    {
        if (is_callable($value)) {
            $value = call_user_func($value);
        }

        $value = $this->handleJsonType($value);

        $this->value = $value;

        return $this;
    }
1110259
public static function copy($value){
		
		if(\is_object($value)){
			
			if(\is_callable($value)){
				return \Closure::bind($value, null);
			}
			
			return clone $value;
			
		}
		
		return $value;
		
	}
322874
private function processValue($value)
    {
        if ($value === "NOW()") {
            return $this->connection()->quote(gmdate("Y-m-d H:i:s"));
        } elseif ($value === "NULL") {
            return 'NULL';
        } elseif (is_array($value)) {
            return $this->connection()->quote(json_encode($value));
        } else {
            return $this->connection()->quote($value);
        }
    }
539799
public static final function cast($value): string {
		if (is_string($value)){
			return $value;
		}

		if (is_object($value) && method_exists($value, 'toString')){
			return $value->toString();
		}

		if (is_object($value) && method_exists($value, '__toString')){
			return $value->__toString();
		}

		if ($value instanceof \Generator){
			return self::join('', iterator_to_array($value, false));
		}

		return (string)$value;
	}
361387
public function setValue($value)
	{
		// any preparation goes here, for example casting to int
		$errors = $this->getValidationErrors($value);
		// if specific validation existed would go here & if
		// anything goes wrong will put error message into errors
		if(!empty($errors))
			throw $this->getContext()->getModel('ValidationException', 'Form', array(($errors)));
		return $value;
	}
858208
public function value( $value = NULL ){
		if( is_null( $value ) )
			return $this->value;
		$this->value	= $value;
	}
573205
public static function fromValue( $value )
	{
		$result = new ContextProvider();
		$result->m_iter = XPath2NodeIterator::Create( $value );
		return $result;
	}
189818
public function makeStorableArrayFieldValue($value)
    {
        if ($this->_isEncodedArrayFieldValue($value)) {
            $value = $this->_decodeArrayFieldValue($value);
        }

        $value = $this->_serializeValue($value);
        return $value;
    }