Checks if this spy returned the supplied value.

@param mixed $value The value.

@return EventCollection|null The result.
486198
public function checkReturned($value = null): ?EventCollection
    {
        $cardinality = $this->resetCardinality();

        $calls = $this->spy->allCalls();
        $matchingEvents = [];
        $totalCount = count($calls);
        $matchCount = 0;

        if (0 === func_num_args()) {
            foreach ($calls as $call) {
                if (!$responseEvent = $call->responseEvent()) {
                    continue;
                }

                list($exception) = $call->response();

                if (!$exception) {
                    $matchingEvents[] = $responseEvent;
                    ++$matchCount;
                }
            }
        } else {
            $value = $this->matcherFactory->adapt($value);

            foreach ($calls as $call) {
                if (!$responseEvent = $call->responseEvent()) {
                    continue;
                }

                list($exception, $returnValue) = $call->response();

                if (!$exception && $value->matches($returnValue)) {
                    $matchingEvents[] = $responseEvent;
                    ++$matchCount;
                }
            }
        }

        if ($cardinality->matches($matchCount, $totalCount)) {
            return $this->assertionRecorder->createSuccess($matchingEvents);
        }

        return null;
    }
898388
public function remove($value) {
        $oldCollection = $this->getArrayCopy();
        if (!in_array($value, $oldCollection))
            return $this;

        $newCollection = array();
        foreach ($oldCollection as $val) {
            if ($val === $value)
                continue;

            $newCollection[] = $val;
        }
        $this->exchangeArray($newCollection);
        return $this;
    }
153682
protected function toNull($value)
    {
        if ($value === 0 || $value === false || $value === '') {
            return null;
        }
        if ($this->getTypeCheck()->isArray($value) && count($value) === 1) {
            return $this->toNull(reset($value));
        }

        return $value;
    }
32136
protected function checkType($value)
    {
        if ($value === null) {
            return $value;
        }

        Type::force($value, 'numeric', true);
        return $value === null ? $value : (float)$value;
    }
603211
public function get($value) {

		return isset($this->items[$value]) ? $this->items[$value] : NULL;

	}
858208
public function value( $value = NULL ){
		if( is_null( $value ) )
			return $this->value;
		$this->value	= $value;
	}
911565
public function search( $value )
	{
		if( $value == $this->value )
			return $this;
		else if( $value < $this->value )
		{
			if( $this->left )
				return $this->left->search( $value );
		}
		else if( $value > $this->value )
		{
			if( $this->right )
				return $this->right->search( $value );
		}
		return NULL;
	}
1043305
private function checkValue($value){


        $check = $this->getPossibleValueArray();
        if (!is_array($check) || empty($check)){
            $this->handleError("No Check Array defined (getPossibleValueArray())",  EnumException::NoEnumsDefined);
        }
        if (!in_array($value, $check)){
            $this->handleError("Invalid Value", EnumException::Invalidvalue);
        }
    }
282816
public function getKey($value) {
		foreach ($this->collection as $k => $v) {
			if ($v === $value) {
				return $k;
			}
		}
		
		return null;
	}
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;
        };
    }
7394
protected function isValueSelected($value)
	{
		$val = $this->getValue();
		if (is_null($value)) {
			return FALSE;
		}
		elseif (is_array($val)) {
			return in_array($value, $val);
		}

		return $value == $val;
	}
968680
public function getTypeFromValue($value = null)
    {
        $value = ($value === null ? $this->value : $value);
        return array_search($value, self::$typeList);
    }
1004740
public function checkReturned($value = null): ?EventCollection
    {
        $cardinality = $this->resetCardinality();

        if ($this->subject instanceof Call) {
            $cardinality->assertSingular();
        }

        $matchingEvents = [];
        $matchCount = 0;

        if (0 === func_num_args()) {
            foreach ($this->calls as $call) {
                if (!$call->isGenerator() || !$endEvent = $call->endEvent()) {
                    continue;
                }

                list($exception) = $call->generatorResponse();

                if (!$exception) {
                    $matchingEvents[] = $endEvent;
                    ++$matchCount;
                }
            }
        } else {
            $value = $this->matcherFactory->adapt($value);

            foreach ($this->calls as $call) {
                if (!$call->isGenerator() || !$endEvent = $call->endEvent()) {
                    continue;
                }

                list($exception, $returnValue) = $call->generatorResponse();

                if (!$exception && $value->matches($returnValue)) {
                    $matchingEvents[] = $endEvent;
                    ++$matchCount;
                }
            }
        }

        if ($cardinality->matches($matchCount, $this->callCount)) {
            return $this->assertionRecorder->createSuccess($matchingEvents);
        }

        return null;
    }
593871
public function hasValue($value)
    {
        return ! is_null($this->findValueByName($value)) || ! is_null($this->findValueById($value));
    }
23953
protected function validatorValue($value)
    {
        if ($value === null) {
            return $this->allowEmpty;
        }

        if (preg_match($this->pattern, $value)) {
            return true;
        }

        return false;
    }
629261
public function filter($value)
    {
	    if (is_string($value))
	        return new DateTime('@'.strtotime($value));
	    if ($value instanceof DateTime)
		    return $value;
	    if (is_int($value))
		    return new DateTime('@'.$value);
	    return null;
    }
1302641
public function contains($value)
        {
            if ($value instanceof \Closure) {
                return ! is_null($this->first($value));
            }

            return Arrays::in($value, $this->_items);
        }