@param Movement $mvt

@throws InvalidArgumentException
320304
public function removeMovement(Movement $mvt): void
    {
        if (!$this->hasMovement($mvt)) {
            throw new \InvalidArgumentException(
                'The Movement is not part of this Operation and cannot be removed from there');
        }
        $this->movements->removeElement($mvt);
    }
148463
public function execute(array $args, array $options = [])
    {
        if (!isset($args[0])) {
            throw new \InvalidArgumentException('arg action must be input');
        }
        $action = explode('::', $args[0]);
        if (!class_exists($action[0])) {
            throw new \InvalidArgumentException('action not not found!');
        }

        ProcessManage::rmTask($action);
    }
790943
private static void exportAllowedMovements(Xml root, Collection<MovementTile> movements)
    {
        for (final MovementTile movement : movements)
        {
            final Xml node = root.createChild(NODE_MOVEMENT);
            node.setText(movement.name());
        }
    }
131123
public function setField(string $field) : void
    {
        $field = trim($field);
        if (empty($field)) {
            throw new InvalidArgumentException("Field is empty");
        }

        $this->field = $field;
    }
1277598
public function setTarget(string $target): void
    {
        $path = realpath($target);
        if (false === $path) {
            if (@mkdir($target, 0755, true)) {
                $path = realpath($target);
            } else {
                throw new InvalidArgumentException(
                    'Target directory (' . $target . ') does not exist and could not be created'
                );
            }
        }

        if (!is_dir($path) || !is_writable($path)) {
            throw new InvalidArgumentException('Given target (' . $target . ') is not a writable directory');
        }

        $this->target = $path;
    }
997208
public function setPosition( $horizontal, $vertical )
	{
		if( in_array( $horizontal, array( 'left', 'center', 'right' ) ) )
			$this->positionH	= $horizontal;
		else
			throw new InvalidArgumentException( 'Horizontal Position "'.$horizontal.'" must be on of (left, center, right).' );
		if( in_array( $vertical, array( 'top', 'middle', 'bottom' ) ) )
			$this->positionV	= $vertical;
		else
			throw new InvalidArgumentException( 'Vertical Position "'.$horizontal.'" must be on of (top, middle, bottom).' );
	}
263024
protected function _advanceTracker($tracker)
    {
        if (!($tracker instanceof Iterator)) {
            throw $this->_createInvalidArgumentException($this->__('Can only advance an Iterator tracker'), null, null, $tracker);
        }

        $tracker->next();
    }
1067884
public function move($value)
    {
        // No need to update if $value is already current one
        if ($value === $this->current()) {
            return;
        }

        $index = $this->search($value);

        if (false === $index) {
            throw new \InvalidArgumentException(sprintf('"%s" value not found in JobGraph', $value));
        }

        return $this->seek($index);
    }
1353041
public function createDraft(StockItemInterface $stockItem, UomQty $qty): Movement
    {
        $code = $this->codeGenerator->generate($stockItem, $qty);

        return Movement::createDefault($code, $stockItem, $qty);
    }
708702
public function init( $config = NULL )
    {
        parent::init( $config );
        
        if ( !isset( $config[ 'migration_path' ] ) )
        {
            throw new \InvalidArgumentException( 'Missing migration_path parameter' );
        }
        
        foreach ( $config as $key => $value )
        {
            switch( $key )
            {
                case 'migration_path':
                    $this->migrationPath = $value;
                    break;
                
                case 'migration_namespace':
                    $this->migrationNamespace = $value;
                    break;
                
                case 'namespaces':
                    $this->namespaces = $value;
                    break;
                
                case 'class_prefix':
                    $this->classPrefix = $value;
                    break;
                
                case 'migration_table':
                    $this->migrationTable = $value;
                    break;
                
                case 'class_name_style':
                    $this->migrationClassStyle = $value;
                    break;
                
                case 'overwrite':
                    $this->overwrite = $value;
                    break;
                
                case 'levels':
                    $this->levels = $value;
                    break;
                
                case 'name':
                    $this->migrationClass = $value;
                    break;
                
                case 'verbose':
                    $this->verbose = $value === 'true' ? TRUE : FALSE;
                    break;
                
                default:
                    // Do nothing
                    break;
            }
        }
        
        $this->doAction( self::ON_INIT_ACTION );
    }
391042
public function moveNode(string $id = null, string $action = ''): void
    {
        $moveActions = ['up', 'down'];
        if (!in_array($action, $moveActions)) {
            $this->Flash->error((string)__('Unknown move action.'));
            $this->redirect(['action' => 'index']);

            return;
        }
        $menuItem = $this->MenuItems->get($id);
        $moveFunction = 'move' . $action;
        if ($this->MenuItems->{$moveFunction}($menuItem)) {
            $this->Flash->success((string)__('{0} has been moved {1} successfully.', $menuItem->get('label'), $action));
        } else {
            $this->Flash->error((string)__('Fail to move {0} {1}.', $menuItem->get('label'), $action));
        }

        $this->redirect($this->referer());
    }
304288
public function handleAlterAction($actionName, $arguments, $data)
    {
        $actionName = strtolower($actionName);

        foreach ($this->getComponents() as $component) {
            if ($component instanceof GridField_ActionProvider) {
                $actions = array_map('strtolower', (array) $component->getActions($this));

                if (in_array($actionName, $actions)) {
                    return $component->handleAction($this, $actionName, $arguments, $data);
                }
            }
        }

        throw new InvalidArgumentException(sprintf(
            'Can\'t handle action "%s"',
            $actionName
        ));
    }
1366869
public function execute(array $input)
    {
        $text = $this->textSanitizer->sanitize($input);
        $location = $this->locationSanitizer->sanitize($input);

        if (!is_callable($input['replacement'])) {
            throw new InvalidArgumentException('Invalid replacement');
        }

        $line = $text->getLine($location);
        $replacement = $input['replacement']($line);

        $text->setLine($replacement, $location);
        $text->setCurrentLineNumber($location);
    }
786831
private function moveFunctionArgumentsUp(MethodCall $methodCall): void
    {
        $funcCallOrEmptyNode = $methodCall->args[0]->value;
        if ($funcCallOrEmptyNode instanceof FuncCall) {
            $funcCallOrEmptyNodeName = $this->getName($funcCallOrEmptyNode);
            if ($funcCallOrEmptyNodeName === null) {
                return;
            }

            $funcCallOrEmptyNodeArgs = $funcCallOrEmptyNode->args;
            $oldArguments = $methodCall->args;
            unset($oldArguments[0]);

            $methodCall->args = $this->buildNewArguments(
                $funcCallOrEmptyNodeName,
                $funcCallOrEmptyNodeArgs,
                $oldArguments
            );
        }

        if ($funcCallOrEmptyNode instanceof Empty_) {
            $methodCall->args[0] = new Arg($funcCallOrEmptyNode->expr);
        }
    }
345134
public function setDocRoot($docRoot)
    {
        if (empty($docRoot) || ! file_exists($docRoot) || ! is_dir($docRoot)) {
            throw new \InvalidArgumentException(
                'The document root set is not a valid directory.'
            );
        }
        $this->docRoot = rtrim($docRoot, '/');
    }
1236917
public function handleChangeDir(string $dir = null): void
	{
		if ($dir !== null) {
			if (
				strpos($dir, '..' . DIRECTORY_SEPARATOR) !== false
				|| !is_dir($this->getBasePath() . $dir)
			) {
				throw new InvalidArgumentException;
			}
		}
		$this->path = $dir;
		$this->redrawControl('fileManagerContainer');
	}
447389
public function update($newProgress) {
        if (!is_numeric($newProgress) || (int) $newProgress < 0 || (int) $newProgress > $this->total) {
            throw new InvalidArgumentException(sprintf(
                'Argument must be an integer between 0 (zero) and %s (total).',
                $this->total
            ));
        }
        $this->current = $newProgress;
    }