Before run

@param SourceSetEvent $sourceSetEvent Source Set Event
352627
public function onSculpinCoreBeforerun(SourceSetEvent $sourceSetEvent)
    {
        /** @var FileSource $source */
        foreach ($sourceSetEvent->updatedSources() as $source) {
            foreach ($this->extensions as $extension) {
                if (fnmatch("*.{$extension}", $source->filename())) {
                    $source->data()->append('converters', SculpinCommonMarkBundle::CONVERTER_NAME);

                    break;
                }
            }
        }
    }
468378
public function beforeUpdate($event)
    {
        foreach ($this->update as $field) {
            $event->sender->$field = time();
        }
    }
1149237
public function handlePreRemove(RemoveEvent $event)
    {
        $document = $event->getDocument();

        if (!$this->supports($document)) {
            return;
        }

        $event = $this->getDeleteEvent($document);
        $this->deleteEvents[spl_object_hash($document)] = $event;
        $this->eventDispatcher->dispatch(
            ContentEvents::NODE_PRE_DELETE,
            $event
        );
    }
465725
private function before(callable $before): void
    {
        if ($before instanceof Closure) {
            $this->options["before"] = $before->bindTo($this);
        } else {
            $this->options["before"] = $before;
        }
    }
1218477
protected function onBeforeCreate($identifier, &$data, &$fixtures)
    {
        $this->disableValidation()->invokeCallbacks('beforeCreate', [$identifier, $data, $fixtures]);
    }
315308
public function beforeProcess()
    {
        $event = new ProcessEvent($this->message, $this->getWechat());
        $this->trigger(self::EVENT_BEFORE_PROCESS, $event);
        return $event->isValid;
    }
776725
public function beforePrepare(Event $event)
	{
		$operation = $event['command']->getOperation();
		$client = $event['command']->getClient();

		if ($operation->hasParam('collection') === false) return;
		if (is_null($client->getCollectionName())) return;

		$operation->getParam('collection')->setDefault($client->getCollectionName());
		$operation->getParam('collection')->setStatic(true);

	}
1087587
private function initSource($source)
    {
        if (empty($this->source)) {
            $this->source = new Source();
        }

        if (!empty($source)) {
            if (is_array($source)) {
                $this->source->setLines($source);
            } elseif (is_string($source)) {
                $this->source->setString($source);
            }
        }
    }
705018
public function beforeFilter(Event $event)
    {
        EventManager::trigger('Controller.setup', $this);

        $pluginEvent = Plugin::getData('Core', 'Controller.beforeFilter');
        if (is_callable($pluginEvent->find(0)) && Plugin::hasManifestEvent('Controller.beforeFilter')) {
            call_user_func_array($pluginEvent->find(0), [$this, $event]);
        }
    }
1089683
public function prepareSource(&$source = null, $reference = false)
    {
        if ($source) {
            $this->data = $source;
        } else {
            $this->data = &$_COOKIE;
        }
    }
1188908
public function beforeSend()
    {
        $this->client->beforeSend($this);

        $event = new RequestEvent();
        $event->request = $this;
        $this->trigger(self::EVENT_BEFORE_SEND, $event);
    }
941423
public function fireEvent($event, $source, $data = [])
    {
        if ($this->_listeners) {
            list($p1, $p2) = explode(':', $event, 2);
            if (isset($this->_listeners[$p1])) {
                foreach ($this->_listeners[$p1] as $k => $v) {
                    /**@var \ManaPHP\Event\Listener $listener */
                    if (is_int($v)) {
                        $this->_listeners[$p1][$k] = $listener = $this->_di->getShared($k);
                    } else {
                        $listener = $v;
                    }

                    $listener->process($p2, $source, $data);
                }
            }
        }

        foreach ($this->_peekers as $handler) {
            if ($handler instanceof \Closure) {
                $handler($event, $source, $data);
            } else {
                $handler[0]->{$handler[1]}($event, $source, $data);
            }
        }

        if (!isset($this->_events[$event])) {
            return;
        }

        foreach ($this->_events[$event] as $handler) {
            if ($handler instanceof \Closure) {
                $handler($source, $data, $event);
            } else {
                $handler[0]->{$handler[1]}($source, $data, $event);
            }
        }
    }
537245
public function beforeRender(Event $event)
    {
        parent::beforeRender($event);

        $this->set('type', $this->type);
        $this->set('title', $this->type['name']);
    }
1022359
public function onUpdateRunNodeEvents(NodeEvent $event)
    {
        $node = $event->getNode();

        $this->ensureNodeSubscribers($event);

        $newEvent = new ResourceEvent('node', $node->nid, $this->currentUser->id());

        if ($node->is_flagged != $node->original->is_flagged) {
            if ($node->is_flagged) {
                $this->dispatcher->dispatch('node:flag', $newEvent);
            }
        } else if ($node->status != $node->original->status) {
            if ($node->status) {
                $this->dispatcher->dispatch('node:publish', $newEvent);
            } else {
                $this->dispatcher->dispatch('node:unpublish', $newEvent);
            }
        } else {
            $this->dispatcher->dispatch('node:edit', $newEvent);
        }
    }
7019
public function beforeRun($event)
    {
        $id = $this->owner->options['id'];
        $options = Json::htmlEncode($this->getClientOptions());
        $view = $this->owner->getView();
        GridViewAsset::register($view);
        $view->registerJs("jQuery('#$id').yiiGridView($options);");
    }
1071750
protected function beforeDispatch(string $eventName, $event)
    {
        $this->preDispatch($eventName, $event instanceof Event ? $event : new LegacyEventProxy($event));
    }
972468
public function onBeforeSend(Event $event)
    {
        /** @var \Guzzle\Http\Message\Request $request */
        $request = $event['request'];

        list($newUrl, $port) = $this->proxify(
            $request->getUrl(),
            $this->bucketKey,
            $this->gatewayHost
        );

        $request->setUrl($newUrl);

        if ($port) {
            $request->setHeader('Runscope-Request-Port', $port);
        }

        if ($this->authToken) {
            $request->setHeader('Runscope-Bucket-Auth', $this->authToken);
        }
    }