Ensures that both `in` and `value` elements are present in array

@param array $in

@return array
771173
protected static function select_common_normalize ($in) {
		$has_in    = isset($in['in']);
		$has_value = isset($in['value']);
		if (
			!$has_value && $has_in && is_array($in['in'])
		) {
			$in['value'] = &$in['in'];
		} elseif (
			!$has_in && $has_value && is_array($in['value'])
		) {
			$in['in'] = &$in['value'];
		} elseif (
			(
				!$has_in || !is_array($in['in'])
			) &&
			(
				!$has_value || !is_array($in['value'])
			)
		) {
			$in = [
				'in'    => $in,
				'value' => $in
			];
		}
		return $in;
	}
497423
protected static function select_common ($in, $data, $function) {
		if (isset($in['insert']) || isset($data['insert'])) {
			return static::__callStatic_internal(__FUNCTION__, [$in, $data]);
		}
		if ($in === false) {
			return '';
		}
		if (
			!is_array($in) ||
			(
				isset($in['in']) && !is_array($in['in'])
			)
		) {
			return static::wrap($in, $data, $function);
		}
		$in = static::select_common_normalize($in);
		/**
		 * Moves arrays of attributes into option tags
		 */
		foreach ($data as $attr => &$value) {
			if (is_array($value)) {
				$in[$attr] = $value;
				unset($data[$attr]);
			}
		}
		unset($value);
		$disabled = array_merge(
			isset($in['disabled']) ? (array)$in['disabled'] : [],
			isset($data['disabled']) ? (array)$data['disabled'] : []
		);
		$selected = array_merge(
			isset($in['selected']) ? (array)$in['selected'] : [],
			isset($data['selected']) ? (array)$data['selected'] : []
		) ?: [$in['value'][0]];
		unset($data['selected'], $data['disabled']);
		$in['selected'] = $in['disabled'] = [];
		foreach ($in['value'] as $i => $v) {
			$in['disabled'][$i] = in_array($v, $disabled);
			$in['selected'][$i] = !$in['disabled'][$i] && in_array($v, $selected);
		}
		unset($i, $v);
		$options = static::array_flip_3d($in);
		foreach ($options as &$option) {
			if (isset($option[1])) {
				$option = array_merge(
					[
						'in' => $option[0]
					],
					$option[1]
				);
			}
			$option['in'] = str_replace('<', '&lt;', $option['in']);
			$option       = static::option($option);
		}
		unset($option);
		return static::wrap(implode('', $options), $data, $function);
	}
551480
protected static function input_merge ($in, $data) {
		if (is_string($in)) {
			$in = ['in' => $in];
		}
		return !$data ? $in : array_merge(
			static::is_array_assoc($in) ? $in : ['in' => $in],
			$data
		);
	}
698581
public static function convertToDb($value)
    {
        if (!is_array($value)) {
            return [];
        }

        $elements = [];
        foreach ($value as $translatable) {
            $elements[] = TranslatableType::convertToDb($translatable);
        }

        return $elements;
    }
647425
public static function in($values)
    {
        if ($values instanceof Arrayable) {
            $values = $values->toArray();
        }

        return new Rules\In(is_array($values) ? $values : func_get_args());
    }
789743
protected function prepareArrayValue(array $value)
    {
        $rii = new \RecursiveIteratorIterator(
            new \RecursiveArrayIterator($value),
            \RecursiveIteratorIterator::SELF_FIRST
        );
        foreach ($rii as $key => $value) {
            if (($value instanceof ValueGenerator) === false) {
                $value = new self($value);
                $rii->getSubIterator()->offsetSet($key, $value);
            }

            $value->setIndentationLevel($value->getIndentationLevel() + $rii->getDepth());
        }

        return $rii->getSubIterator()->getArrayCopy();
    }
613891
protected static function filterConstant(array $values)
    {
        if (isset($values[1]) && in_array($values[1], self::VALID_CONSTANTS)) {
            $values[1] = constant($values[1]);
        }
        return $values[1];
    }
832704
public static function exist($value)
    {
        $list = static::loadConstants();

        return in_array($value,$list) || in_array(strtoupper($value),$list) ;
    }
328994
public static function validate($value)
    {
        $value = Utils::toString($value);
        $tags = [
            'latest', 'earliest', 'pending'
        ];

        return in_array($value, $tags);
    }
775561
private function getValues($value)
    {
        if (is_array($value)) {
            $newValue = array();

            foreach ($value as $itemValue) {
                $newValue = array_merge($newValue, $this->getValues($itemValue));
            }

            return array($newValue);
        }

        if (is_object($value) && $this->em->getMetadataFactory()->hasMetadataFor(ClassUtils::getClass($value))) {
            $class = $this->em->getClassMetadata(get_class($value));
            if ($class->isIdentifierComposite) {
                $newValue = array();

                foreach ($class->getIdentifierValues($value) as $innerValue) {
                    $newValue = array_merge($newValue, $this->getValues($innerValue));
                }

                return $newValue;
            }
        }

        return array($this->getIndividualValue($value));
    }
822230
public static function validValue($value): bool
    {
        $enumerables = self::getCache();
        $values = array_values($enumerables);

        return \in_array($value, $values, true);
    }
1286116
public function whereIn($field, array $in, $symbol = 'AND')
    {
        $q = array_fill(0, count($in), '?');
        $this->where[] = ['AND', "{$field} IN (" . implode(', ', $q) . ")", $in];
        return $this;
    }
577203
private function validateValue($element, $userInput) : array
    {
        $valid = true;
        $value = null;
        $typedValue = null;

        if ($element->isRequired() && is_null($userInput)) {
            $valid = false;
        }

        if ($element->getPrimitiveType() && !is_null($userInput)) {
            $typedValue = $this->validateType($userInput, $element->getPrimitiveType());
            if (is_null($typedValue)) {
                $valid = false;
            } else {
                $value = $typedValue;
            }
        } else {
            $value = $userInput;
        }

        if (method_exists($element, 'transformValue') && $value) {
            $value = $element->transformValue($value);
        }

        if (method_exists($element, 'isValid') && $valid == true && $element->getValue()) {
            $valid = $element->isValid();
        }

        if (!$valid) {
            $value = null;
        }

        return [$valid, $value, $typedValue];
    }
1322623
protected function isIn($key, $value) : bool
    {
        $data = explode(',', $value);
        if (is_array($data) && in_array((string) $this->param[$key], $data)) {
            return true;
        }

        $this->errors[$key.self::ERROR] = $this->convertToFieldName($key)." must be in the given list of values $value.";
        return false;
    }
1308385
public static function getInitializedConditionals($value)
    {
        $services = array();

        if (is_array($value)) {
            foreach ($value as $v) {
                $services = array_unique(array_merge($services, self::getInitializedConditionals($v)));
            }
        } elseif ($value instanceof Reference && ContainerInterface::IGNORE_ON_UNINITIALIZED_REFERENCE === $value->getInvalidBehavior()) {
            $services[] = (string) $value;
        }

        return $services;
    }
758940
public static function inEnum($value)
    {
        $allItems = array_flip(self::toArray());

        return isset($allItems[$value]) ? true : false;
    }
1011512
public function pull($value): AbstractArray
    {
        $value = $this->filterValue($value);
        if (is_null($value)) {
            return $this;
        }

        //Removing values from array (non strict)
        $this->values = array_filter($this->values, function ($item) use ($value) {
            return $item != $value;
        });

        $this->atomics['$pull']['$in'][] = $value;

        return $this;
    }