Load surname dict.

@param Closure $callback
518146
public function mapSurname(Closure $callback)
    {
        if (empty($this->surnames)) {
            $surnames = $this->path.'/surnames';

            if (file_exists($surnames)) {
                $this->surnames = (array) include $surnames;
            }
        }

        $callback($this->surnames);
    }
1051635
public function walk(Closure $callback) {
		foreach($this->_data as &$data) {
			$data = $callback($data);
		}
		unset($data);
		
		return $this;
	}
1150801
private function cacheSpammers(Closure $callback)
    {
        return cache()->remember($this->cacheKey, $this->cacheExpires, $callback);
    }
1211746
public function then(\Closure $callback)
    {
        if ($this->ready) {
            return null;
        }

        $this->ready = true;

        if (!$this->checkDomain() || !$this->checkPath() || !$this->checkSecurity()) {
            return null;
        }

        $oNS = parent::$prefixNS;
        $oPP = parent::$prefixPath;

        if ($this->ns) {
            parent::$prefixNS = $this->ns;
        }

        if ($this->path) {
            parent::$prefixPath = rtrim($this->currentPrefixPath, '/');
        }

        call_user_func_array($callback, $this->arguments);

        parent::$prefixNS = $oNS;
        parent::$prefixPath = $oPP;
    }
586783
public function attachment(Closure $callback)
    {
        $this->attachments[] = $attachment = new Attachment;

        $callback($attachment);

        return $this;
    }
786401
public function executeFor($id, Closure $callback): void
    {
        $callback(
            $this->newQuery()->findOrFail($id)
        );
    }
1258588
public function table($table, Closure $callback)
    {
        $table = $this->schema->getTable($table);

        $callback($this->build($table));

        return $table;
    }
907375
public function make(string $name, ?Closure $callback = null) : Collection {
        return $this->collection($name, $callback);
    }
564424
protected function storeCallback(\Closure $callback)
    {
        $key = md5(microtime());
        $this->callbacks[$key] = $callback;
        return $key;
    }
25607
protected function filterJSInline(\Closure $callback)
    {
        if ($this->js) {
            $filteredJs = array();
            foreach ($this->js as $position => $jsGroup) {
                $filteredJs[$position] = array();
                foreach ($jsGroup as $key => $jsCode) {
                    if (call_user_func($callback, $jsCode, RSmartLoad::RESOURCE_TYPE_JS_INLINE)) {
                        $filteredJs[$position][$key] = $jsCode;
                    }
                }
            }
            $this->js = $filteredJs;
        }
    }
374658
public function onRegister($name, Closure $callback)
    {
        $priority                  = $this->getPluginPriority($name);
        $this->registerCallbacks[] = compact('name', 'priority', 'callback');
    }
560645
public function pretend( Closure $callback ) {
		return $this->withFreshQueryLog( function () use ( $callback ) {
			$this->pretending = true;

			// Basically to make the database connection "pretend", we will just return
			// the default values for all the query methods, then we will return an
			// array of queries that were "executed" within the Closure callback.
			$callback( $this );

			$this->pretending = false;

			return $this->getLogger()->getQueryLog();
		} );
	}
367377
public function fieldset($name, Closure $callback = null)
    {
        $lastFieldset = $this->fieldsets->isEmpty() ? 0 : last($this->fieldsets->keys()->toArray()) + 2;

        if (!strlen($this->name)) {
            throw new Exception('Invalid form name.');
        }

        $primaryEventName = 'forms:' . str_slug($this->name) . '.fieldsets.' . $lastFieldset;
        Event::fire($primaryEventName . '.before', $this);


        $fieldset = new Fieldset($this->app, $name, $callback, $this->name, $this->name);

        if (is_null($fieldset->getName())) {
            $name = sprintf('fieldset-%d', $this->fieldsets->count());
        } else {
            if ($fieldset->getName() instanceof \Closure) {
                $name = sprintf('fieldset-%d', $this->fieldsets->count());
            }
            $name = Str::slug($name);
        }

        $this->keyMap[$name] = $fieldset;
        $return              = $this->fieldsets->push($fieldset);
        Event::fire($primaryEventName . '.after', $this);

        return $return;
    }
1370114
public function modify($name, Closure $callback)
    {
        $menu = collect($this->menus)->filter(function ($menu) use ($name) {
            return $menu->getName() == $name;
        })->first();

        $callback($menu);
    }
1082154
public function executeForEach(Closure $callback): void
    {
        $query = $this->newQuery();

        foreach ($query->cursor() as $entity) {
            $callback($entity);
        }
    }
953192
public function header(Closure $callback = null)
    {
        if (\is_null($callback)) {
            return $this->header;
        }

        $this->header = $callback;

        return null;
    }
479566
protected function _cache($key, Closure $callback) {
        if (isset($this->_cache[$key])) {
            return $this->_cache[$key];
        }

        // Requires 5.4
        // Closure::bind($callback, $this, __CLASS__);

        $this->_cache[$key] = $callback($this);

        return $this->_cache[$key];
    }