@param \stdClass $place
@param bool      $reverse

@return Location
510989
private function jsonResultToLocation(\stdClass $place, bool $reverse): Location
    {
        $builder = new AddressBuilder($this->getName());

        foreach (['state', 'county'] as $i => $tagName) {
            if (isset($place->address->{$tagName})) {
                $builder->addAdminLevel($i + 1, $place->address->{$tagName}, '');
            }
        }

        // get the first postal-code when there are many
        if (isset($place->address->postcode)) {
            $postalCode = $place->address->postcode;
            if (!empty($postalCode)) {
                $postalCode = current(explode(';', $postalCode));
            }
            $builder->setPostalCode($postalCode);
        }

        $localityFields = ['city', 'town', 'village', 'hamlet'];
        foreach ($localityFields as $localityField) {
            if (isset($place->address->{$localityField})) {
                $localityFieldContent = $place->address->{$localityField};

                if (!empty($localityFieldContent)) {
                    $builder->setLocality($localityFieldContent);

                    break;
                }
            }
        }

        $builder->setStreetName($place->address->road ?? $place->address->pedestrian ?? null);
        $builder->setStreetNumber($place->address->house_number ?? null);
        $builder->setSubLocality($place->address->suburb ?? null);
        $builder->setCountry($place->address->country);
        $builder->setCountryCode(strtoupper($place->address->country_code));

        $builder->setCoordinates(floatval($place->lat), floatval($place->lon));

        $builder->setBounds($place->boundingbox[0], $place->boundingbox[2], $place->boundingbox[1], $place->boundingbox[3]);

        $location = $builder->build(NominatimAddress::class);
        $location = $location->withAttribution($place->licence);
        $location = $location->withOSMId(intval($place->osm_id));
        $location = $location->withOSMType($place->osm_type);
        $location = $location->withDisplayName($place->display_name);

        if (false === $reverse) {
            $location = $location->withCategory($place->category);
            $location = $location->withType($place->type);
        }

        return $location;
    }
44055
private function _place() {
		/** @var int $oid */
		try {
			BA::disable(!$this->m()->requireBillingAddress());
			try {$oid = df_quote_m()->placeOrder($this->qid());}
			finally {BA::restore();}
		}
		catch (\Exception $e) {throw new CouldNotSave(__($this->message($e)), $e);}
		/**
		 * 2018-04-14
		 * The previous code was:
		 * 		return dfp_iia(df_order($oid), self::$REDIRECT_DATA);
		 * I have changed it for the @see \Dfe\Tap\Model\Tap class,
		 * which is not a @see \Df\Payment\Method descendant and therefore not a singleton.
		 */
		$m = $this->m(); /** @var M $m */
		$m->orderPlaced($oid);
		$r = dfp_iia($m->getInfoInstance(), self::$REDIRECT_DATA);
		/**
		 * 2018-04-15
		 * https://www.upwork.com/messages/rooms/room_c037d73dc6d45dee9ad4a664a05ce541/story_89760d8131dae4d3d268f13009b89950
		 */
		return $m->skipDfwEncode() ? $r : dfw_encode($r);
	}
527281
public function reverse() : self
    {
        $list = $this->list;
        $count = $this->list->getSize();
        $newList = new \SplFixedArray($count);

        foreach ($newList as $index => $val) {
            $newList[$index] = $list[$count - $index - 1];
        }

        return new static($newList);
    }
615152
public static function getHtml($negativeOffset = null, $reverse = null)
    {
        if (!self::$active) {
            return false;
        }
        if (file_exists(self::$fileLocation) && $file = file(self::$fileLocation)) {
            if ($negativeOffset !== null) {
                $file = array_slice($file, (-$negativeOffset), null, true);
            }
            if ($reverse) {
                $file = array_reverse($file, true);
            }
            $content = "";
            foreach ($file as $key => $value) {
                $html = ("<p>" . str_replace("\n", "<br>", $value) . "</p>");
                $html = str_replace("[", "<strong>", $html);
                $html = str_replace("]", "</strong>", $html);
                $html = str_replace("{", "<span>", $html);
                $html = str_replace("}", "</span>", $html);
                $content .= $html;
            }
        }
        return isset($content) ? $content : false;
    }
73483
public function createPosition(array $conditions, ?int $position = null, ?int $endPosition = null, bool $allowOutOfRange = false): int
    {
        $nextPosition = $this->getNextPosition($conditions);

        if ($position === null) {
            return $nextPosition;
        }

        if ($position < 0) {
            throw new BadStateException('position', 'Position cannot be negative.');
        }

        if (!$allowOutOfRange && $position > $nextPosition) {
            throw new BadStateException('position', 'Position is out of range.');
        }

        if ($endPosition !== null && $endPosition < $position) {
            throw new BadStateException('position', 'When creating a position, end position needs to be greater or equal than start position.');
        }

        $this->incrementPositions(
            $conditions,
            $position,
            $endPosition
        );

        return $position;
    }
860482
function reverse ($preserveKeys = false)
  {
    $this->pack ();
    $this->it = $this->array_reverse_iterator ($this->data, $preserveKeys);
    unset ($this->data);
    return $this;
  }
1158686
protected function _getUlangInfo($key = null, $reverse = false) {
		$result = '';
		if (empty($key)) {
			return $result;
		}

		$UIlangs = $this->_modelConfigSettingsApp->getUiLangs();
		if (empty($UIlangs)) {
			return $result;
		}

		if ($reverse) {
			$UIlangs = array_flip($UIlangs);
		}
		if (isset($UIlangs[$key])) {
			$result = $UIlangs[$key];
		}

		return $result;
	}
353617
private function arrayListToStringBuilder(ArrayList $arrayList, bool $reverse = false) {
        $stringBuilder = new StringBuilder();
        if ($reverse) {
            $stack = new Stack();
            foreach ($arrayList as $item) {
                if (null !== $item) {
                    $stack->push($item);
                }
            }
            while (!$stack->isEmpty()) {
                $stringBuilder->append($stack->pop());
            }
        } else {
            $queue = new Queue();
            foreach ($arrayList as $item) {
                if (null !== $item) {
                    $queue->enqueue($item);
                }

            }
            while (!$queue->isEmpty()) {
                $stringBuilder->append($queue->dequeue());
            }
        }
        return $stringBuilder;
    }
382519
function reverseInplace(array) {
  for (var i = 0; i < array.length / 2; ++i) {
    var h = array[i];
    var ii = array.length - i - 1;
    array[i] = array[ii];
    array[ii] = h;
  }
}
1222460
function reverse ($this, opts) {
            if (opts.debug) console.time("blast reversal");

            var skippedDescendantRoot = false;

            $this
                .removeClass(NAME + "-root")
                .removeAttr("aria-label")
                .find("." + NAME)
                    .each(function () {
                        var $this = $(this);
                        /* Do not reverse Blast on descendant root elements. (Before you can reverse Blast on an element, you must reverse Blast on any parent elements that have been Blasted.) */
                        if (!$this.closest("." + NAME + "-root").length) {
                            var thisParentNode = this.parentNode;
                            
                            /* This triggers some sort of node layout, thereby solving a node normalization bug in <=IE7 for reasons unknown. If you know the specific reason, tweet me: @Shapiro. */
                            if (IE <= 7) (thisParentNode.firstChild.nodeName);

                            /* Strip the HTML tags off of the wrapper elements by replacing the elements with their child node's text. */
                            thisParentNode.replaceChild(this.firstChild, this);

                            /* Normalize() parents to remove empty text nodes and concatenate sibling text nodes. (This cleans up the DOM after our manipulation.) */
                            thisParentNode.normalize();
                        } else {
                            skippedDescendantRoot = true;
                        }
                    });

            /* Zepto core doesn't include cache-based $.data(), so we mimic data-attr removal by setting it to undefined. */
            if (window.Zepto) {
                $this.data(NAME, undefined);
            } else {
                $this.removeData(NAME);
            }

            if (opts.debug) {
                console.log(NAME + ": Reversed Blast" + ($this.attr("id") ? " on #" + $this.attr("id") + "." : ".") + (skippedDescendantRoot ? " Skipped reversal on the children of one or more descendant root elements." : ""));
                console.timeEnd("blast reversal");
            }
        }
370554
private function convert($type, $reverse = false)
    {
        $replace = array_merge(
            $this->getJpgReplace(),
            $this->getBmpReplace()
        );

        if ( $reverse ) {
            $replace = array_flip($replace);
        }

        return str_replace(array_keys($replace), array_values($replace), $type);
    }
960813
protected function prepareCollection(Configuration $configuration, Parameter $parameter, $reverse = false)
  {
    if ($reverse === false)
    {
      $this->dispatcher->dispatch(
        TransformerEvents::PREPARE_COLLECTION,
        new TransformerEvent($configuration, $parameter)
      );
    }
    else
    {
      $this->dispatcher->dispatch(
        TransformerEvents::REVERSE_COLLECTION,
        new TransformerEvent($configuration, $parameter)
      );
    }

    $child_array = $parameter->getValue();

    $object_configuration = clone $configuration;
    $object_configuration->setType(TypeEnum::OBJECT_TYPE);
    $object_configuration->getOptions()->setReturnClass(
      $configuration->getOptions()->getReturnClass()
    );
    $object_configuration->getOptions()->setDefaultValue(
      $configuration->getOptions()->getDefaultValue()
    );
    $object_configuration->setParent($configuration);

    $result_array = array();
    $childs       = count($child_array);
    for ($i = 0; $i < $childs; ++$i)
    {
      $param = new Parameter($i, $child_array[$i]);
      if ($reverse === false)
      {
        $this->prepareObject($object_configuration, $param);
      }
      else
      {
        $this->reverseObject($object_configuration, $param);
      }

      array_push($result_array, $param->getValue());
    }

    $parameter->setValue($result_array);

    return $this;
  }
610825
public function reverse($lat, $lng)
    {
        $this->data = ['lat' => $lat, 'lng' => $lng];

        return $this->call('reverse', $this->prepareData($this->data));
    }
23285
public static GeocodingApiRequest reverseGeocode(GeoApiContext context, LatLng location) {
    GeocodingApiRequest request = new GeocodingApiRequest(context);
    request.latlng(location);
    return request;
  }
106190
public function reverseProcess($config, $object)
  {
    try
    {
      $object = $this->process('\stdClass', $config, $object);

      $this->init();
      $configurator = new EnmConfigurator($config, $this->dispatcher);

      $returnClass = $this->reverseBuild(
        '\stdClass',
        $configurator->getConfig(),
        $this->converter->convertTo($object, ConversionEnum::ARRAY_CONVERSION)
      );

      $this->destroy();

      return $returnClass;
    }
    catch (\Exception $e)
    {
      $this->dispatcher->dispatch(TransformerEvents::ON_EXCEPTION, new ExceptionEvent($e));
      throw new TransformerException($e->getMessage());
    }
  }
1122513
public function reverse() {
		if(!$this->orderBy)
			throw new \Exception('Cannot reverse a query without order by.');

		preg_match_all('/([^,])*([(].*?[)])([^,])*|([^,])+/', $this->orderBy, $e);
		$e = $e[0];
		foreach($e as $k=>$v) {
			$v = preg_replace_callback('/(DESC|ASC)[\s]*/', function($r) {
				$r = $r[0];
				if(strpos($r, 'DESC') !== false)
					return str_replace('DESC', 'ASC', $r);
				else
					return str_replace('ASC', 'DESC', $r);
			}, $v, -1, $c);
			if($c === 0)
				$v = $v.' DESC';
			$e[$k] = $v;
		}
		$orderBy = implode(', ', $e);

		$this->orderBy($orderBy);
		return $this;
	}
936448
public function reverseMap($data): RoleCreateStruct
    {
        if (!$data instanceof RoleCreateData) {
            throw new InvalidArgumentException('data', 'must be an instance of ' . RoleCreateData::class);
        }

        return new RoleCreateStruct([
            'identifier' => $data->getIdentifier(),
        ]);
    }