<commit_before><?php

/*
 * +----------------------------------------------------------------------+
 * |                          ThinkSNS Plus                               |
 * +----------------------------------------------------------------------+
 * | Copyright (c) 2017 <NAME> Technology Co., Ltd.     |
 * +----------------------------------------------------------------------+
 * | This source file is subject to version 2.0 of the Apache license,    |
 * | that is bundled with this package in the file LICENSE, and is        |
 * | available through the world-wide-web at the following url:           |
 * | http://www.apache.org/licenses/LICENSE-2.0.html                      |
 * +----------------------------------------------------------------------+
 * | Author: Slim Kit Group <<EMAIL>>                          |
 * | Homepage: www.thinksns.com                                           |
 * +----------------------------------------------------------------------+
 */

namespace SlimKit\PlusID\Actions\Auth;

use SlimKit\PlusID\Actions\Action;
use SlimKit\PlusID\Support\Message;

class Resolve extends Action
{
    protected function getSignAction(): array
    {
        return [
            'action' => 'auth/resolve',
            'app' => $this->client->id,
            'time' => (int) $this->request->time,
        ];
    }

    public function check()
    {
        if (($response = parent::check()) !== true) {
            return $response;
        }

        if ($this->request->user('web') === null) {
            return $this->response(new Message(10002, 'fail'));
        }

        return true;
    }

    public function dispatch()
    {
        $action = [
            'app' => $this->client->id,
            'action' => 'auth/resolve',
            'user' => $user = $this->request->user('web')->id,
            'time' => $time = time(),
            'tc' = floor($time / 300),
        ];

        return $this->response(new Message(200, 'success', [
            'sign' => $this->server->sign($action),
            'user' => $user,
            'time' => $time,
        ]));
    }
}<commit_msg>fix: Syntax Error - packages/slimkit-plus-id/src/Actions/Auth/Resolve.php Unexpected '=', expecting ']' on line 55.<commit_after><?php

/*
 * +----------------------------------------------------------------------+
 * |                          ThinkSNS Plus                               |
 * +----------------------------------------------------------------------+
 * | Copyright (c) 2017 <NAME> Technology Co., Ltd.     |
 * +----------------------------------------------------------------------+
 * | This source file is subject to version 2.0 of the Apache license,    |
 * | that is bundled with this package in the file LICENSE, and is        |
 * | available through the world-wide-web at the following url:           |
 * | http://www.apache.org/licenses/LICENSE-2.0.html                      |
 * +----------------------------------------------------------------------+
 * | Author: <NAME> <<EMAIL>>                          |
 * | Homepage: www.thinksns.com                                           |
 * +----------------------------------------------------------------------+
 */

namespace SlimKit\PlusID\Actions\Auth;

use SlimKit\PlusID\Actions\Action;
use SlimKit\PlusID\Support\Message;

class Resolve extends Action
{
    protected function getSignAction(): array
    {
        return [
            'action' => 'auth/resolve',
            'app' => $this->client->id,
            'time' => (int) $this->request->time,
        ];
    }

    public function check()
    {
        if (($response = parent::check()) !== true) {
            return $response;
        }

        if ($this->request->user('web') === null) {
            return $this->response(new Message(10002, 'fail'));
        }

        return true;
    }

    public function dispatch()
    {
        $action = [
            'app' => $this->client->id,
            'action' => 'auth/resolve',
            'user' => $user = $this->request->user('web')->id,
            'time' => $time = time(),
            'tc' => floor($time / 300),
        ];

        return $this->response(new Message(200, 'success', [
            'sign' => $this->server->sign($action),
            'user' => $user,
            'time' => $time,
        ]));
    }
}
{'fraction_non_alphanumeric': 0.2952819332566168, 'fraction_numerical': 0.009205983889528193, 'mean_word_length': 1.044214487300094, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 61, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3222266', 'n_tokens_mistral': 1098, 'n_tokens_neox': 1054, 'n_words': 240}