@param $input

@return array
554134
protected function wikidata($input){
    $input = urlencode($input);
    $urlindex =  '&language=en&format=json&search=' . $input;
    $baseurl = 'https://www.wikidata.org/w/api.php?action=wbsearchentities';
    $remoteUrl = $baseurl.$urlindex;

    $options['headers']=['Accept' => 'application/json'];
    $body = $this->getRemoteJsonData($remoteUrl, $options);

    $jsondata = [];
    $results = [];
    $jsondata = json_decode($body, TRUE);
    $json_error = json_last_error();
    if ($json_error == JSON_ERROR_NONE) {
      //WIKIdata will give is an success key will always return at least one, the query string
      if (count($jsondata) > 1) {
        if ($jsondata['success'] == 1) {
          foreach ($jsondata['search'] as $key => $item) {
            $desc = (isset($item['description'])) ? '('.$item['description'].')':'';
            $results[] = [
              'value' => $item['concepturi'],
              'label' => $item['label'].' '.$desc,
              'desc' => $desc,
            ];
          }
        }
      }
      else {
        $results[] = [
          'value' => NULL,
          'label' => 'Sorry no Match from Wikidata Subject Headings'
        ];
      }
      return  $results;
    }
    $this->messenger->addError(
      $this->t('Looks like data fetched from @url is not in JSON format.<br> JSON says: @$jsonerror <br>Please check your URL!',
        [
          '@url' => $remoteUrl,
          '@$jsonerror' => $json_error
        ]
      )
    );
    return [];
  }
609079
protected function generateRequestOptions( $input ) {
    $options = [
      'dataType' => 'json',
      'headers' => array_merge(self::$header, (array)$input['header']),
    ];
    $options = array_merge($options, ArrayUtils::array_pick($input, 'json', 'form', 'query'));
    return $options;
  }
548111
public function post(array $input) : array {
		$input[\Object\Form\Parent2::BUTTON_SUBMIT_SAVE] = true;
		$input[\Object\Form\Parent2::BUTTON_SUBMIT_POST] = true;
		$this->form->form_object->addInput($input);
		$this->form->form_object->process();
		return $this->form->form_object->apiResult();
	}
144610
public function temporaryPost(array $input) : array {
		$input[\Object\Form\Parent2::BUTTON_SUBMIT_SAVE] = true;
		$input[\Object\Form\Parent2::BUTTON_SUBMIT_TEMPORARY_POST] = true;
		$this->form->form_object->addInput($input);
		$this->form->form_object->process();
		return $this->form->form_object->apiResult();
	}
91420
public function readyToPost(array $input) : array {
		$input[\Object\Form\Parent2::BUTTON_SUBMIT_SAVE] = true;
		$input[\Object\Form\Parent2::BUTTON_SUBMIT_READY_TO_POST] = true;
		$this->form->form_object->addInput($input);
		$this->form->form_object->process();
		return $this->form->form_object->apiResult();
	}
906141
private function getUserData(array $input, string $name)
    {
        if (stripos($name, '[') !== false) {
            $names = explode('[', str_replace(']', '', $name));

            $ref = &$input;
            $leave = false;

            while ($leave == false) {
                $key = array_shift($names);

                if ($key === '') {
                    $leave = true;
                } elseif (is_null($key)) {
                    $leave = true;
                } else {
                    $ref = &$ref[$key];
                }
            }

            if (is_array($ref) && array_key_exists(0, $ref) && (is_null($ref[0]) || $ref[0] === '')) {
                $ref = [];
            }

            return $ref;
        } else {
            return $input[$name] ?? null;
        }
    }
855846
public function input($input = null, $default = null)
    {
        // Get all inputs
        $inputs = array_merge($this->getInputs(), $this->additionalInputs);

        // Exclude reserved inputs
        foreach ($inputs as $key => $value) {
            if (in_array($key, $this->reserved)) {
                unset($inputs[$key]);
            }
        }

        // Return one input
        if ($input) {
            return isset($inputs[$input])? $inputs[$input] : $default;
        }

        // Or the complete array of inputs
        return $inputs;
    }
67570
public function extractToAssociativeArray($input)
    {
        $output = array_reduce($input, function($commands, array $item) {
            array_walk($item, function($values, $name) use (&$commands) {
                if (isset($commands[$name]) && !is_array($commands[$name]) && is_array($values)) {
                    $values[] = $values;
                    $commands[$name] = $values;
                } else if (isset($commands[$name]) && is_array($commands[$name]) && is_array($values)) {
                    $commands[$name] = array_merge($commands[$name], $values);
                } else if (isset($commands[$name])) { // if $commands[$name] is set, turn it into an array
                    $commands[$name] = [ $commands[$name], $values ];
                } else { // if $commands[$name] is not set
                    $commands[$name] = $values;
                }
            });

            return $commands;
        }, []);

        return $output;
    }
912576
protected function _unserialize($input)
	{
		$data = @unserialize($input);

		if (is_array($data))
		{
			foreach ($data as $key => $val)
			{
				if (is_string($val))
				{
					$data[$key] = str_replace('{{slash}}', '\\', $val);
				}
			}

			return $data;
		}

		elseif ($data === false)
		{
			is_string($input) and $data = array($input);
		}

		return (is_string($data)) ? str_replace('{{slash}}', '\\', $data) : $data;
	}
1339338
protected function getCommandOptions($input)
    {
        return [
            'model-name' => $this->argument('model-name'),
            '--resource-filename' => $this->option('resource-filename'),
            '--fields' => $this->option('fields'),
            '--translation-for' => $this->option('translation-for'),
            '--relations' => $this->option('relations'),
            '--indexes' => $this->option('indexes'),
        ];
    }
1006208
public static function clearInput($input)
    {
        if (is_array($input)) {
            foreach ($input as $key => $value) {
                if (!isset($value) || $value === '') {
                    unset($input[$key]);
                }
            }

            return $input;
        }

        return $input;
    }
221737
public function execute(array $input) : array {
		$this->form->form_object->addInput($input);
		$this->form->form_object->process();
		return $this->form->form_object->apiResult();
	}
1059624
private function fromCamelCase($input) {
	       
	        $a = preg_split(
		        '/(^[^A-Z]+|[A-Z][^A-Z]+)/',
		        $input,
		        -1, /* no limit for replacement count */
		        PREG_SPLIT_NO_EMPTY /*don't return empty elements*/
		            | PREG_SPLIT_DELIM_CAPTURE /*don't strip anything from output array*/
		    );
	        return strtolower(join($a, "-"));
	}
895281
public function convertFromPositive($input)
    {
        $matches = [];

        if (
            !preg_match(
                '
                /^0*(?<carets>\\^*)(?<alpha>[A-Z]*)(?<year>\d+)$/',
                $input,
                $matches
            )
        ) {
            return null;
        }

        if ($matches['alpha'] === '') {
            return $matches['year'];
        }

        if ($matches['carets'] === '') {
            $expectedLength = ord($matches['alpha']) - static::ORD_START + 5;
        } else {
            $len = strlen($matches['carets']);

            $expectedLength = 0;

            for ($i=0; $i < $len; $i++) {
                $expectedLength = $expectedLength * 26;
                $expectedLength += ord($matches['alpha'][$i]) - static::ORD_START;
                $expectedLength++;
            }

            $expectedLength += 30;
        }

        return str_pad($matches['year'], $expectedLength, '0', STR_PAD_RIGHT);
    }
241093
public function input($input) {
        if(isset($this->inputs->$input)) 
            return $this->inputs->$input;
        return null;
    }
407979
protected function cleanupLigatures($input)
    {
        $mapping = [
            'ﬀ' => 'ff',
            'ﬁ' => 'fi',
            'ﬂ' => 'fl',
            'ﬃ' => 'ffi',
            'ﬄ' => 'ffl',
            'ﬅ' => 'ft',
            'ﬆ' => 'st'
        ];

        return str_replace(array_keys($mapping), array_values($mapping), $input);
    }
1279364
private function righthandside($input) {
		foreach($this->sequences as $order) {
			if (substr($input, strlen($order)*-1) == $order) {
				$return = [ 'order' => substr($order, 1) ];
				if (strlen($input) > strlen($order)) {
					$return['properties'] = explode('*', substr($input, 0, strlen($order)*-1)); // Array of properties
				} else {
					return false;
				}
				return $return;
			}
		}
		return false;
	}