Find a list of place names that would be updated.

@param Tree   $tree
@param string $search
@param string $replace

@return string[]
437744
private function changePlacesPreview(Tree $tree, string $search, string $replace): array
    {
        // Fetch the latest GEDCOM for each individual and family
        $union = DB::table('families')
            ->where('f_file', '=', $tree->id())
            ->whereContains('f_gedcom', $search)
            ->select(['f_gedcom AS gedcom']);

        return DB::table('individuals')
            ->where('i_file', '=', $tree->id())
            ->whereContains('i_gedcom', $search)
            ->select(['i_gedcom AS gedcom'])
            ->unionAll($union)
            ->pluck('gedcom')
            ->mapWithKeys(static function (string $gedcom) use ($search, $replace): array {
                preg_match_all('/\n2 PLAC ((?:.*, )*)' . preg_quote($search, '/') . '(\n|$)/i', $gedcom, $matches);

                $changes = [];
                foreach ($matches[1] as $prefix) {
                    $changes[$prefix . $search] = $prefix . $replace;
                }

                return $changes;
            })
            ->sort()
            ->all();
    }
299223
public function replace($search, $replace): ClassDeclaration
    {
        $this->constants->replace($search, $replace);
        $this->properties->replace($search, $replace);
        $this->methods->replace($search, $replace);

        return $this;
    }
457874
public function get($key, array $replace = [], $locale = null, $fallback = true) {
        foreach($this->bulkReplacements as $match => $extraReplace) {
            if(starts_with($key, $match)) {
                $replace = array_merge($replace, $extraReplace);
            }
        }

        return parent::get($key, $replace, $locale, $fallback);
    }
46984
public function setValue($search, $replace) {
        if(substr($search, 0, 2) !== '${' && substr($search, -1) !== '}') {
            $search = '${'.$search.'}';
        }
        
        $this->_documentXML = str_replace($search, $replace, $this->_documentXML);
    }
1159456
protected function strReplace($search, $replace, $subject)
    {
        $template = $this->getTemplateVariable($search);

        return str_replace($template, $replace, $subject);
    }
34292
public function replace(string $search, string $replacement): self
    {
        if (!$this->contains($search)) {
            return $this;
        }

        return $this
            ->split($search)
            ->join($replacement);
    }
297904
public static function replaceFirstOccurrence($search, $replace, $subject)
    {
        if (!$search) {
            return $subject;
        }

        $pos = mb_strpos($subject, $search);
        if ($pos !== false) {
            $subject = static::mb_substr_replace($subject, $replace, $pos, mb_strlen($search));
        }


        return $subject;
    }
10970
protected static function strReplaceOnce($search, $replace, $subject)
    {
        $firstChar = strpos($subject, $search);
        if (false !== $firstChar) {
            $beforeStr = substr($subject, 0, $firstChar);
            $afterStr = substr($subject, $firstChar + strlen($search));

            return $beforeStr.$replace.$afterStr;
        }

        return $subject;
    }
657771
public function replaceArray( string $search, array $replace ) : SplString
    {
        foreach( $replace as $value ){
            $this->setString( $this->replaceFirst( $search, $value ) );
        }
        return $this;
    }
12619
protected function strReplaceOnce(string $search, string $replace, string $subject): string
    {
        $pos = strpos($subject, $search);
        if ($pos === false) {
            return $subject;
        }

        return substr($subject, 0, $pos) . $replace . substr($subject, $pos + strlen($search));
    }
188020
public function replace($search, $replace): Comment
    {
        $lines = $this->getLines();

        array_walk($lines, function (&$line) use ($search, $replace) {
            $line = str_replace($search, $replace, $line);
        });

        return $this->setLines($lines);
    }
1257454
public function StrReplace($search = ' ', $replace = '')
    {
        $owner = $this->owner;
        $owner->value = str_replace(
            $search,
            $replace,
            $owner->value
        );
        return $owner;
    }
336005
public function recursiveReplace($search, $replace)
	{
		$json = json_encode($this->params);

		$json = str_replace($search, $replace, $json);

		$this->params = json_decode($json, TRUE);
	}
1132906
public function replaceValues($search, $replacement = ''): self
    {
        $array = $this->each(
            static function ($value) use ($search, $replacement) {
                return \str_replace($search, $replacement, $value);
            }
        );

        return $array;
    }
122236
public function createFilter($search, $replace)
    {
        if (!isset($this->filters[$search][$replace])) {
            if (!isset($this->filters[$search])) {
                $this->filters[$search] = [];
            }

            if (!isset($this->filters[$search][$replace])) {
                $this->filters[$search][$replace] = [];
            }

            $this->filters[$search][$replace] = new Swift_StreamFilters_StringReplacementFilter($search, $replace);
        }

        return $this->filters[$search][$replace];
    }
1107575
public function replace($search, $replace): Method
    {
        $this->docComment->replace($search, $replace);

        return $this;
    }
1151600
public static function replacePrefix(string $s, string $search, string $replacement = ''): string
	{
		if (strncmp($s, $search, strlen($search)) === 0) {
			$s = $replacement . substr($s, strlen($search));
		}

		return $s;
	}