Handles the "bind --disable" command.

@param Args $args The console arguments

@return int The status code
12307
public function handleDisable(Args $args)
    {
        $bindingToDisable = $this->getBindingByUuidPrefix($args->getArgument('uuid'));

        if ($bindingToDisable->getContainingModule() instanceof RootModule) {
            throw new RuntimeException(sprintf(
                'Cannot disable bindings in the module "%s".',
                $bindingToDisable->getContainingModule()->getName()
            ));
        }

        $this->discoveryManager->disableBindingDescriptor($bindingToDisable->getUuid());

        return 0;
    }
1262566
public function formatArgs($args)
    {
        // The first argument is always the file
        unset($args[0]);

        if (isset($args[1])) {
            $command = explode(':', $args[1]);
            unset($args[1]);
        } else {
            // No Command Specified.
            return array();
        }

        try {

            $action = (isset($command[1]) ? $command[1] : 'main');
            $cmd = $this->library->find($command[0].':'.$action);
            $task = get_class($cmd);

            return array(
                'task'      => $task,
                'action'    => $action,
                'params'    => $args
            );

        } catch (\Exception $e) {

            // No Command FOUND
            return array();
        }
    }
818343
public function enableSpamProtection($args = [])
    {
        // Obtain Spam Guard Instance:
        
        if ($guard = $this->getSpamGuardInstance($args)) {
            
            // Define Field Name and Title:
            
            $name  = isset($args['name'])  ? $args['name']  : $guard->getDefaultName();
            $title = isset($args['title']) ? $args['title'] : $guard->getDefaultTitle();
            
            // Obtain Spam Guard Form Field:
            
            if ($field = $guard->getFormField($name, $title)) {
                
                // Link Field with Form:
                
                $field->setForm($this->owner);
                
                // Add Field to Form:
                
                if (isset($args['insertBefore'])) {
                    
                    // Insert Before Specified Field:
                    
                    $this->owner->Fields()->insertBefore($field, $args['insertBefore']);
                    
                } elseif (isset($args['insertAfter'])) {
                    
                    // Insert After Specified Field:
                    
                    $this->owner->Fields()->insertAfter($field, $args['insertAfter']);
                    
                } else {
                    
                    // Push Field to End of List:
                    
                    $this->owner->Fields()->push($field);
                    
                }
                
            }
            
        }
        
        // Answer Extended Form:
        
        return $this->owner;
    }
569460
public function total(array $args = []): int
    {
        // Establish args.

        $default_args = [
            // Also used by {@link all()}.
            'include'                   => [],
            'exclude'                   => [],
            'exclude_deprecated_levels' => true,
            'no_cache'                  => false,
        ];
        $args = array_merge($default_args, $args);
        $args = array_intersect_key($args, $default_args);

        $args['include']                   = (array) $args['include'];
        $args['exclude']                   = (array) $args['exclude'];
        $args['exclude_deprecated_levels'] = (bool) $args['exclude_deprecated_levels'];
        $args['no_cache']                  = (bool) $args['no_cache'];

        // Check cache; already did this query?

        $cache_keys = $args; // Keys to consider when checking the cache.
        unset($cache_keys['no_cache']); // Cache key exclusions.

        if (($total = &$this->cacheKey(__FUNCTION__, $cache_keys)) !== null && !$args['no_cache']) {
            return $total; // Already cached this.
        }
        // Establish total caps in the query.

        $caps = $this->collectAll(); // All possible caps.

        $caps = $args['include'] ? array_intersect_key($caps, array_fill_keys($args['include'], true)) : $caps;
        $caps = $args['exclude'] ? array_diff_key($caps, array_fill_keys($args['exclude'], true)) : $caps;
        $caps = $args['exclude_deprecated_levels'] ? array_diff_key($caps, array_fill_keys($this->deprecated_levels, true)) : $caps;

        return $total = count($caps);
    }
18106
private function getUpdatedClassBinding(Args $args, ClassBinding $bindingToUpdate)
    {
        $className = $bindingToUpdate->getClassName();
        $typeName = $bindingToUpdate->getTypeName();
        $bindingParams = $bindingToUpdate->getParameterValues();

        if ($args->isOptionSet('class')) {
            $className = $args->getOption('class');
        }

        if ($args->isOptionSet('type')) {
            $typeName = $args->getOption('type');
        }

        $this->parseParams($args, $bindingParams);
        $this->unsetParams($args, $bindingParams);

        return new ClassBinding(
            $className,
            $typeName,
            $bindingParams,
            $bindingToUpdate->getUuid()
        );
    }
105917
private function cmdPurge($args)
    {
        $cmd = new PurgeCommand($this->cwd);

        return $cmd->run(array_slice($args, 1));
    }
518361
public static function findCommandValue($args) {
		$args = explode("|",$args);
		foreach ($args as $arg) {
			if (isset(self::$options[$arg])) {
				return self::$options[$arg];
			}
		}
		return false;
	}
245491
public function passthru($args = [])
    {
        $command = $this->prepareCommand($args);
        Yii::info("> $command");
        passthru($command, $exitcode);

        return $exitcode;
    }
1028150
public function handleSet(Args $args)
    {
        $value = StringUtil::parseValue($args->getArgument('value'));

        $this->manager->setConfigKey($args->getArgument('key'), $value);

        return 0;
    }
1079347
public function handleInstall(Args $args)
    {
        $pluginClass = $args->getArgument('class');

        if ($this->manager->hasPluginClass($pluginClass)) {
            throw new RuntimeException(sprintf(
                'The plugin class "%s" is already installed.',
                $pluginClass
            ));
        }

        $this->manager->addPluginClass($pluginClass);

        return 0;
    }
298864
public function delete( $args, $assoc_args ) {

		$hook   = $args[0];
		$events = self::get_cron_events();

		if ( is_wp_error( $events ) ) {
			WP_CLI::error( $events );
		}

		$deleted = 0;
		foreach ( $events as $event ) {
			if ( $event->hook === $hook ) {
				$result = self::delete_event( $event );
				if ( $result ) {
					$deleted++;
				} else {
					WP_CLI::warning( sprintf( "Failed to the delete the cron event '%s'.", $hook ) );
				}
			}
		}

		if ( $deleted ) {
			$message = ( 1 === $deleted ) ? "Deleted the cron event '%2\$s'." : "Deleted %1\$d instances of the cron event '%2\$s'.";
			WP_CLI::success( sprintf( $message, $deleted, $hook ) );
		} else {
			WP_CLI::error( sprintf( "Invalid cron event '%s'.", $hook ) );
		}

	}
174872
public function listen($args = null)
    {
        if ('action' === $this->getModel()->getType()) {
            return do_action($this->getModel()->getIdentifier(), $args);
        }

        return apply_filters($this->getModel()->getIdentifier(), $args);
    }
1095227
private function cmdReset($args)
    {
        $cmd = new ResetCommand($this->cwd);

        return $cmd->run(array_slice($args, 1));
    }
195275
public function getSlot($command, $args): ?int
    {
        $id = \strtoupper($command);

        $slot = null;

        if (isset($this->commands[$id])) {
            $key = $this->commands[$id]($id, $args);

            if (null !== $key) {
                $slot = $this->getSlotByKey($key);
            }
        }

        return $slot;
    }
887192
public function passthru(array $arguments = [])
    {
        passthru($this->getBin() . $this->prepareCommand($arguments), $exitCode);
        return $exitCode;
    }
327218
public function enough_positionals( $args ) {
		$positional = $this->query_spec(
			array(
				'type'     => 'positional',
				'optional' => false,
			)
		);

		return count( $args ) >= count( $positional );
	}
1236845
public function input($arg,...$args){
        /** $args != null */
        if($args) {
            if(is_array($args[0])) {
                //$this->input('get',['name','pass']);
                $args = [$arg,$args[0]];
            }
            else {
                //$this->input('name','pass');
                array_unshift($args,$arg);
                $args = [$this->method,$args];
            }
        }
        else {
            /** $args == null */
            //$this->input('name');
            //$this->input(['name','pass']);
            $args = [$this->method,$arg];
        }

        $input = call_user_func_array([$this,'form'],$args);

        if(is_array($input) === false) {
            return null;
        }

        if(count($input) == 1) {
            return current($input);
        }

        return array_values($input);
    }