Conditionally requires completion of current field based on completion of another field

@param mixed
@param string
@return bool
191047
public function _validation_required_with($val, $field)
	{
		if ( ! $this->_empty($this->input($field)) and $this->_empty($val))
		{
			$validating = $this->active_field();
			throw new \Validation_Error($validating, $val, array('required_with' => array($this->field($field))), array($this->field($field)->label));
		}

		return true;
	}
677843
protected function resolveConditionalLogic($condition)
    {
        $renderer = $this->getActionRenderer();
        if ($renderer && is_callable([ $renderer, $condition ])) {
            return !!$renderer->{$condition}();
        } elseif (is_callable([ $this, $condition ])) {
            return !!$this->{$condition}();
        } elseif (is_callable($condition)) {
            return !!$condition();
        } elseif ($renderer) {
            return !!$renderer->renderTemplate($condition);
        } elseif ($this->view()) {
            return !!$this->renderTemplate($condition);
        }

        return !!$condition;
    }
1074061
private static function _isRequired($object, $fieldName)
    {
        $reflectionClass = new \ReflectionClass($object);
        if ($reflectionClass->hasMethod('requiredFields')) {
            return in_array($fieldName, $object->requiredFields());
        }

        return false;
    }
805590
public function required($fields = [])
    {
        $fields = $fields ?: $this->fields();

        foreach ($fields as $field) {
            if (is_string($field)) {
                $this->field($field)->required();
                continue;
            }

            /* @var Field $field */
            $field->required();
        }

        return $this;
    }
1315020
public function highlight($field)
    {
        if (isset($this->highlighted[$field])) {
            return $this->highlighted[$field];
        }

        return false;
    }
1308274
public function checkRequired()
    {
        foreach ($this->required as $attribute) {
            throw_if(! collect($this->attributes)->offsetExists($attribute),
                FieldRequiredAttributeException::class, $attribute);
        }

        return $this;
    }
1219050
public function hasContent($intCount = 0)
    {
        $blnReturn = false;

        /* @var $objField Element */
        foreach ($this->__fields as $objField) {
            if (get_class($objField) !== "ValidFormBuilder\\Hidden") {
                $objValidator = $objField->getValidator();
                if (is_object($objValidator)) {
                    $varValue = $objValidator->getValue($intCount);

                    if (! empty($varValue)) {
                        $blnReturn = true;

                        break;
                    }
                }
            }
        }

        return $blnReturn;
    }
219379
function validate($value, $key, $fields, $options, $exists, \CharlotteDunois\Validation\Validator $validator) {
        if(!$exists) {
            return false;
        }
        
        if(empty($options)) {
            $options = 'confirmation';
        }
        
        if(!isset($fields[$key.'_'.$options]) || $fields[$key] !== $fields[$key.'_'.$options]) {
            return 'formvalidator_make_confirmed';
        }
        
        return true;
    }
784068
public function isCompleted( $strict = true ) {

		if( $strict ) {

			return $this->status == self::STATUS_COMPLETED;
		}

		return $this->status >= self::STATUS_COMPLETED;
	}
236785
protected function _canBeEmpty($field, $context)
    {
        $allowed = $field->isEmptyAllowed();

        if (!is_string($allowed) && is_callable($allowed)) {
            return $allowed($context);
        }

        $newRecord = $context['newRecord'];
        if (in_array($allowed, ['create', 'update'], true)) {
            $allowed = (
                ($allowed === 'create' && $newRecord) ||
                ($allowed === 'update' && !$newRecord)
            );
        }

        return $allowed;
    }
993612
public function required($options) {
        if ((is_array($options) || (!is_array($options) && $options))) {
            if ((is_array($this->elementData) && (empty($this->elementData) || (empty($this->elementData[0]) && count($this->elementData) === 1))) ||
                    (!is_array($this->elementData) && trim($this->elementData) === '')) {
                if (is_bool($options))
                    $this->addError('Field is required');
                else if (is_array($options) && isset($options['message'])) {
                    $this->addError($options['message']);
                } else
                    $this->addError((!is_array($options) && !is_object($options)) ? $options : 'Field is required');
                return false;
            }
            return true;
        }
        return true;
    }
383438
public function validateAllowEmpty()
    {
        $val = $this->val();

        if (($val === null || $val === '') && !$this->allowEmpty()) {
            return false;
        } else {
            return true;
        }
    }
1089588
public function isConditionalRequired()
    {
        if (is_null($this->conditionalRequired)) {
            $this->conditionalRequired = $this->startsWith('required_');
        }

        return $this->conditionalRequired;
    }
943367
public function hasField(string $field): bool
    {
        if ($this->fields === null) {
            return false;
        }

        return in_array($field, $this->fields);
    }
691479
function completionHandler(currentInput, currentArgv) {
    commandExecuted = true
    const {scripts} = getPSConfig(currentArgv) || {}
    if (scripts) {
      return getCompletionScripts(scripts, currentInput)
    }
    return []
  }
1053725
private function isAddressComplete($address)
    {
        foreach ($this->requiredAddressFields as $field) {
            if (empty($address[$field])) {
                return false;
            }
        }
        return true;
    }
1061076
function hasValue($field, $arguments = null, $cache = true) {
		return ($this->value || $this->value == '0') || ( !$this->nullifyEmpty && $this->value === '');
	}