Perform whichever task the Plugin should perform based
on the payload's data.

@param Payload $payload
@return void
169303
public function process(Payload $payload) {
		$directory = $this->getDirectorySettingOrFail();
		$branch = $this->getSettingValue(self::OPTION_BRANCH, $payload->getRepository()->getMasterBranch());
		$url = $this->getSettingValue(self::OPTION_REPOSITORY, $payload->getRepository()->getUrl());
		$git = $this->resolveGitCommand();
		$command = array(
			'cd', escapeshellarg($directory), '&&',
			$git, self::COMMAND, escapeshellarg($url), escapeshellarg($branch)
		);
		if (TRUE === (boolean) $this->getSettingValue(self::OPTION_REBASE, FALSE)) {
			$command[] = self::COMMAND_REBASE;
		}
		$output = $this->executeGitCommand($command);
		$payload->getResponse()->addOutputFromPlugin($this, $output);
	}
900126
public function pushRaw($payload, $queue = null, array $options = [])
    {
        $payload = (new JobPayload($payload))->prepare($this->lastPushed)->value;

        return tap(parent::pushRaw($payload, $queue, $options), function () use ($queue, $payload) {
            $this->event($this->getQueue($queue), new JobPushed($payload));
        });
    }
902814
public function beingDeleted($payload)
    {
        $type = get_class($payload);
        $id = $payload->id;

        Translation::where('entity_id', $id)->where('entity_type', $type)->delete();
        Archive::where('entity_id', $id)->where('entity_type', $type)->delete();

        Archive::where('entity_type', 'Grafite\Cms\Models\Translation')
            ->where('entity_data', 'LIKE', '%"entity_id":'.$id.'%')
            ->where('entity_data', 'LIKE', '%"entity_type":"'.$type.'"%')
            ->delete();

        if ($type == 'Grafite\Cms\Models\Page') {
            Link::where('page_id', $id)->delete();
        }
    }
1074041
public function trigger(Payload $payload)
    {
        if (!$this->command) {
            return $this->targetState();
        }

        return call_user_func($this->command, $payload) ? $this->targetState() : $this->errorState();
    }
810884
public function completed(JobPayload $payload, $failed = false)
    {
        if ($payload->isRetry()) {
            $this->updateRetryInformationOnParent($payload, $failed);
        }

        $this->connection()->pipeline(function ($pipe) use ($payload, $failed) {
            $this->markJobAsCompleted($pipe, $payload->id(), $failed);
        });
    }
1136456
public function process($payload) {
        $result = $this->convertToObject($payload, true);

        return $this->processPayload($result);
    }
484335
public function sendAck($payload)
    {

        if (empty($payload->delivery_info['delivery_tag'])) {
            throw new Exception('sendAck: delivery_tag not set.');
        }

        $payload->delivery_info['channel']->basic_ack($payload->delivery_info['delivery_tag']);
    }
1084848
public function has(Payload $payload)
    {
        $val = $this->storage->get($this->getKey($payload));

        // exit early if the token was blacklisted forever,
        if ($val === 'forever') {
            return true;
        }

        // check whether the expiry + grace has past
        return ! empty($val) && ! Utils::isFuture($val['valid_until']);
    }
827668
public function push($payload): void
    {
        // attach sender if not broadcast
        if (! $this->broadcast && $this->sender && ! $this->hasDescriptor($this->sender)) {
            $this->addDescriptor($this->sender);
        }

        // check if to broadcast to other clients
        if ($this->shouldBroadcast()) {
            $this->addDescriptors($this->getWebsocketConnections());
        }

        // push message to designated fds
        foreach ($this->descriptors as $descriptor) {
            if ($this->shouldPushToDescriptor($descriptor)) {
                $this->server->push($descriptor, $payload, $this->opcode);
            }
        }
    }
453546
public function addForever(Payload $payload)
    {
        $this->storage->forever($this->getKey($payload), 'forever');

        return true;
    }
1187334
public function process(Payload $payload) {
		$sha1 = $payload->getHead()->getId();
		$tag = substr($payload->getRef(), strlen(self::PATTERN_TAG_HEAD));
		$this->validateVersionNumber($tag);

		// additional settings not requiring validation.
		$url = $this->getSettingValue(self::OPTION_URL, $payload->getRepository()->resolveApiUrl(Repository::API_URL_CLONE));
		// look for an upload comment in settings; if not found there, use Payload HEAD's message body
		$comment = $this->getSettingValue(self::OPTION_COMMENT, $payload->getHead()->getMessage());

		// validation: credentials file and local directory path.
		$directory = $this->getSettingValue(self::OPTION_DIRECTORY);
		$directory = rtrim($directory, '/') . '/';
		$directory .= $sha1 . '/' . $this->getWorkingDirectoryName($payload);
		$credentialsFile = $this->getSettingValue(self::OPTION_CREDENTIALSFILE, GIZZLE_HOME . self::CREDENTIALS_FILE);
		$this->validateCredentialsFile($credentialsFile);
		list ($username, $password) = $this->readUploadCredentials($credentialsFile);

		// initializing build directory and cloning source
		$clone = $this->getGitClonePlugin();
		$clonePluginSettings = $this->getSubPluginSettings('\NamelessCoder\GizzleGitPlugins\GizzlePlugins\ClonePlugin', array(
			ClonePlugin::OPTION_GITCOMMAND => $this->getSettingValue(self::OPTION_GITCOMMAND, ClonePlugin::DEFAULT_GITCOMMAND),
			ClonePlugin::OPTION_DIRECTORY => $directory,
			ClonePlugin::OPTION_SINGLE => TRUE,
			ClonePlugin::OPTION_BRANCH => $tag,
			ClonePlugin::OPTION_DEPTH => 1
		));
		$clone->initialize($clonePluginSettings);
		$this->createWorkingDirectory($directory);
		$this->validateDirectory($directory);
		$clone->process($payload);

		// a large, properly formatted data file.
		$comment = sprintf($comment, $url);
		try {
			$output = $this->getUploader()->upload($directory, $username, $password, $comment);
		} catch (\SoapFault $error) {
			throw new \RuntimeException($error->getMessage(), $error->getCode());
		}

		// cleanup and messages
		if (TRUE === (boolean) $this->getSettingValue(self::OPTION_REMOVEBUILD, FALSE)) {
			$this->removeWorkingDirectory($this->getSettingValue(self::OPTION_DIRECTORY), $sha1);
		}
		$payload->getResponse()->addOutputFromPlugin($this, $output);
	}
147008
public static function json($payload){
        static::type(static::TYPE_JSON);
        static::$payload[] = json_encode($payload, Options::get('core.response.json_flags',JSON_NUMERIC_CHECK|JSON_BIGINT_AS_STRING));
    }
1296930
function buildPayload(&$payload)
    {
        if (is_array($payload)) {
            $payload = $this->array_map_deep($payload, array($this, 'buildPayloadItemInfo'));
        } else {
            $payload = $this->makePayloadBuilder($payload);
            $this->buildPayload($payload);
        }

        return $payload;
    }
143764
protected function performInsert(array $payload)
    {
        try {
            return $this->session = Session::createNew($payload);
        } catch (QueryException $e) {
            $this->performUpdate($this->session, $payload);
        }

        return $this->session;
    }
638236
public function handle($event, $payload)
    {
        list($model) = $payload;
        
        // Check for matching input elements
        foreach (Request::input() as $key => $val) {
            if (preg_match('#^'.self::PREFIX.'(.+)#', $key, $matches)) {
                $this->updateRelationship($model, $matches[1]);
            }
        }
    }
398503
function postback(payload, callback)
{
  if (typeof payload.payload == 'string')
  {
    payload.payload = JSON.parse(payload.payload);
  }

  callback(null, payload);
}
1262116
public function isWebsocketPushPayload($payload): bool
    {
        if (! is_array($payload)) {
            return false;
        }

        return $this->isServerWebsocket
            && ($payload['action'] ?? null) === Websocket::PUSH_ACTION
            && array_key_exists('data', $payload);
    }