@param int|null $value

@throws InvalidOperationException
182757
public function setPrimaryKey($value)
    {
        if (!$this->primaryKey) {
            throw InvalidOperationException::methodCall(__METHOD__, 'Table does not have a primary key');
        }

        $this->columnData[$this->primaryKey] = $value;
    }
788396
protected function checkValueStructure(BaseValue $value): void
    {
        if (!is_int($value->destinationContentId) && !is_string($value->destinationContentId)) {
            throw new InvalidArgumentType(
                '$value->destinationContentId',
                'string|int',
                $value->destinationContentId
            );
        }

        if ($value->alternativeText !== null && !is_string($value->alternativeText)) {
            throw new InvalidArgumentType(
                '$value->alternativeText',
                'string|null',
                $value->alternativeText
            );
        }
    }
1077635
protected function setValue($value)
    {
        if (!is_int($value)) {
            throw InvalidTypeException::fromMessageAndPrototype("Value must be an integer", static::prototype());
        }
        $this->value = $value;
    }
413964
public function set($id, $value)
    {
        if (!is_numeric($id) && !is_string($id)) {
            throw new InvalidServiceIdentifierException($id);
        }

        $this->offsetSet($id, $value);
    }
624190
public function offsetSet($offset, $value)
    {
        if (is_null($offset)) {
            throw new InvalidArrayAssignment();
        } else {
            $this->set($offset, $value);
        }
    }
355565
public function attach($value, $capture = null)
    {
        if (null === $capture) {
            $capture = $this->captureType;
        }

        switch ($capture) {
            case self::APPEND:
                $this->append($value);
                break;
            case self::PREPEND:
                $this->prepend($value);
                break;
            case self::SET:
                $this->set($value);
                break;
            default:
                throw new InvalidArgumentException(sprintf(
                    'Invalid capture type provided; must be any of the capture '
                    . 'type constants, "%s" received.',
                    is_scalar($capture) ? $capture : gettype($capture)
                ));
        }

        return $this;
    }
1139861
public static function isNullOrNumeric($value, $message = null)
    {
        if (!is_null($value) && !is_numeric($value)) {
            throw new InvalidArgumentException(sprintf(
                $message ?: 'Expected null or numeric, but got %s',
                Helper::typeToString($value)
            ));
        }
    }
306962
public function setValue($value)
    {
        if (is_numeric($value)) {
            $value = (string) $value;
        }

        if (!is_string($value) && $value !== null) {
            throw new InvalidArgumentException(sprintf('%s expects parameter 1 to be string, %s given', __METHOD__, (is_object($value) ? get_class($value) : gettype($value))));
        }

        $this->node->nodeValue = $value;

        return $this;
    }
353051
public function offsetSet($offset, $value): void
    {
        if ($offset === null) {
            throw new InvalidArgumentException(
                'Map elements are key/value pairs; a key must be provided for '
                . 'value ' . $value
            );
        }

        $this->data[$offset] = $value;
    }
733246
protected function setValue($value)
    {
        if (!is_float($value)) {
            throw InvalidTypeException::fromMessageAndPrototype("Value must be a float", static::prototype());
        }

        $this->value = $value;
    }
534034
protected function guard($value)
    {
        if (false === is_float($value) || $value < self::MIN_LONGITUDE || $value > self::MAX_LONGITUDE) {
            throw new InvalidLongitudeException($value);
        }
    }
1080250
protected function castToInt($value, bool $nullable = true)
    {
        if (null === $value && $nullable) {
            return null;
        }

        return (int) $value;
    }
1139552
public function validate($value): void
    {
        if (!$this->type->accepts($value)) {
            throw new InvalidArgument((string) $this->name);
        }
    }
790585
public function setPage($value)
    {
        if ($value === null || $value === '') {
            $this->_page = null;
        } elseif (TypeCast::canCastToString($value)) {
            $this->_page = (string)$value;
        } else {
            throw new InvalidPropertyValueTypeException(
                'Invalid status value in PaymentsRequest', 0, 'PaymentsRequest.page', $value
            );
        }
    }
862629
public static function isNullOrCallable($value, $message = null)
    {
        if (!is_null($value) && !is_callable($value)) {
            throw new InvalidArgumentException(sprintf(
                $message ?: 'Expected null or callable, but got %s',
                Helper::typeToString($value)
            ));
        }
    }
825238
protected static function paramsValidation($value, int $scale = null)
    {
        if (null === $value) {
            throw new \InvalidArgumentException('$value must be a non null number');
        }

        if (null !== $scale && $scale < 0) {
            throw new \InvalidArgumentException('$scale must be a positive integer');
        }
    }
1161639
public function append($value)
    {
        if (!$value instanceof Argument) {
            throw new \InvalidArgumentException(sprintf('Controller arguments must be valid %s objects.', Argument::class), 1187953786);
        }
        $this->offsetSet(null, $value);
    }