Create a new 'returned' event.

@param mixed $value The return value.

@return ReturnedEvent The newly created event.
971275
public function createReturned($value): ReturnedEvent
    {
        return new ReturnedEvent(
            $this->sequencer->next(),
            $this->clock->time(),
            $value
        );
    }
485227
public function create($operator, $value)
    {
        $this->operator = $operator;
        $this->value    = $value;

        return $this;
    }
50437
private function valueRetriever($value)
    {
        if ($this->useAsCallable($value)) {
            return $value;
        }

        return function ($item) use ($value) {
            if ($value === null) {
                return $item;
            }

            $item = (array)$item;
            return isset($item[$value]) ? $item[$value] : null;
        };
    }
315652
protected function createWithSetState($value)
    {
        if (!method_exists($this->class, '__set_state')) {
            return $value;
        }

        if ($value instanceof \stdClass) {
            $value = get_object_vars($value);
        }

        if (!is_array($value) || !$this->isAssocArray($value)) {
            return $value;
        }

        $class = $this->class;

        return $class::__set_state($value);
    }
247075
public function append($value)
  {
    $_internalVal = is_object($value) ? $value->__toString() : $value;
    array_push($this->_content, $_internalVal);
    return $this;
  }
376528
public static function fromValue($value) {
        if (is_int($value)) {
            return new Type(Type::TYPE_LONG);
        } elseif (is_bool($value)) {
            return new Type(Type::TYPE_BOOLEAN);
        } elseif (is_double($value)) {
            return new Type(Type::TYPE_DOUBLE);
        } elseif (is_string($value)) {
            return new Type(Type::TYPE_STRING);
        }
        throw new \RuntimeException("Unknown value type found: " . gettype($value));
    }
1003965
public function setCreatedDate($value)
    {
        $this->_validateNotNull('CreatedDate', $value);
        $this->_validateDate('CreatedDate', $value);

        if ($this->data['created_date'] === $value) {
            return;
        }

        $this->data['created_date'] = $value;

        $this->_setModified('created_date');
    }
470227
public function appendValue($value)
    {
        $appendValue = $this->formatValue($value);
        $this->message = $this->message . $appendValue;

        return $this;
    }
1021201
public function onChange($value = null)
    {
        if (func_num_args()) {
            $this->onChange = $value;
            return $this;
        }
        return $this->onChange;
    }
1012381
public function add($value)
    {
        /** @var $tag TagInterface */
        $tag = $this->create($value);

        if (null !== $persistedTag = $this->findOneByCode($tag->getCode())) {
            $tag = $persistedTag;
        } else {
            $this->save($tag);
        }

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

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

        $this->value = $value;

        return $this;
    }
602243
public function append($value)
    {
        $nValue = (is_array($value) ? $value : [$value]);
        return $this->vUnion(new static($nValue));
    }
539735
function setValue($value)
    {
        $this->_createElementsIfNotExist();
        foreach (array_keys($this->_elements) as $key) {
            if (!$this->_appendName) {
                $v = $this->_elements[$key]->_findValue($value);
                if (null !== $v) {
                    $this->_elements[$key]->onQuickFormEvent('setGroupValue', $v, $this);
                }

            } else {
                $elementName = $this->_elements[$key]->getName();
                $index       = strlen($elementName) ? $elementName : $key;
                if (is_array($value)) {
                    if (isset($value[$index])) {
                        $this->_elements[$key]->onQuickFormEvent('setGroupValue', $value[$index], $this);
                    }
                } elseif (isset($value)) {
                    $this->_elements[$key]->onQuickFormEvent('setGroupValue', $value, $this);
                }
            }
        }
    }
87705
public static function create($value, $type = self::TYPE_PLAIN_TEXT): self
    {
        $text = new self();

        $text->text = $value;
        $text->type = $type;

        return $text;
    }
945929
private function createDateTime($value)
    {
        if ($value instanceof DateTime) {
            return $value;
        }
        if ($value instanceof \MongoDate) {
            $dateStr = date('Y-m-d H:i:s.'.$value->usec, $value->sec);
            return new DateTime($dateStr);
        }
        if (is_numeric($value)) {
            // Supports microseconds
            $value = (Float) $value;
            $usec = round(($value - (Integer) $value) * 1000000, 0);
            $dateStr = date('Y-m-d H:i:s.'.$usec, (Integer) $value);
            return new DateTime($dateStr);
        }
        return new DateTime((String) $value);
    }
748675
public function setEvents($value)
    {
        if (empty($value)) {
            $value = $this->events_list;
        } elseif (!is_array($value)) {
            $value = [$value];
        }

        $this->values['events'] = $value;

        return $this;
    }
965342
private function createCookieWithValue($value)
    {
        return new Cookie(
            $this->cookieSettings->getName(),
            $value,
            $this->cookieSettings->getExpiresTime(),
            $this->cookieSettings->getPath(),
            $this->cookieSettings->getDomain(),
            $this->cookieSettings->isSecure(),
            $this->cookieSettings->isHttpOnly()
        );
    }