@@ -48,7 +48,7 @@ |
||
| 48 | 48 | private $spoiler_text; |
| 49 | 49 | |
| 50 | 50 | /** |
| 51 | - * @param string[] $scopes |
|
| 51 | + * @param string $toot_string |
|
| 52 | 52 | */ |
| 53 | 53 | public function __construct($toot_string, array $options) |
| 54 | 54 | { |
@@ -92,7 +92,7 @@ |
||
| 92 | 92 | 'Authorization' => "Bearer {$session->getAccessToken()}", |
| 93 | 93 | 'User-Agent' => $user_agent, |
| 94 | 94 | ], |
| 95 | - ]; |
|
| 95 | + ]; |
|
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | /** |
@@ -29,7 +29,7 @@ |
||
| 29 | 29 | /** |
| 30 | 30 | * @param string $access_token |
| 31 | 31 | * @param string $token_type |
| 32 | - * @param string[] $scope |
|
| 32 | + * @param Scope $scope |
|
| 33 | 33 | * @param int $created_at |
| 34 | 34 | */ |
| 35 | 35 | public function __construct( |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | return [ |
| 106 | 106 | 'access_token' => isset($values[$token_key]) ? $values[$token_key] : null, |
| 107 | 107 | 'scope' => isset($values[$scope_key]) ? $values[$scope_key] : null, |
| 108 | - 'created_at' => isset($values[$cat_key]) ? $values[$cat_key] : null, |
|
| 108 | + 'created_at' => isset($values[$cat_key]) ? $values[$cat_key] : null, |
|
| 109 | 109 | ]; |
| 110 | 110 | } |
| 111 | 111 | |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | $values = $this->getValues(); |
| 149 | 149 | |
| 150 | 150 | return [ |
| 151 | - 'client_id' => isset($values[$id_key]) ? $values[$id_key] : null, |
|
| 151 | + 'client_id' => isset($values[$id_key]) ? $values[$id_key] : null, |
|
| 152 | 152 | 'client_secret' => isset($values[$sec_key]) ? $values[$sec_key] : null, |
| 153 | 153 | ]; |
| 154 | 154 | } |
@@ -188,7 +188,7 @@ discard block |
||
| 188 | 188 | { |
| 189 | 189 | v::stringType()->not(v::contains("\n"))->assert($username); |
| 190 | 190 | v::stringType()->not(v::contains("\n"))->assert($password); |
| 191 | - $this->save_values['username'] = $username; |
|
| 191 | + $this->save_values['username'] = $username; |
|
| 192 | 192 | $this->save_values['password'] = $password; |
| 193 | 193 | } |
| 194 | 194 | |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | $ref_types->setAccessible(true); |
| 46 | 46 | $types = $ref_types->getValue(); |
| 47 | 47 | $ref_types->setAccessible(false); |
| 48 | - $a[Caster::PREFIX_PROTECTED.'property_types'] = $types; |
|
| 48 | + $a[Caster::PREFIX_PROTECTED . 'property_types'] = $types; |
|
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | $ref_properties = $ref->getProperty('properties'); |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | $ref_properties->setAccessible(false); |
| 55 | 55 | |
| 56 | 56 | foreach ($properties as $key => $prop) { |
| 57 | - $a[Caster::PREFIX_DYNAMIC.$key] = $prop; |
|
| 57 | + $a[Caster::PREFIX_DYNAMIC . $key] = $prop; |
|
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | return $a; |
@@ -96,7 +96,7 @@ |
||
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | /** |
| 99 | - * @return Grant\Grant |
|
| 99 | + * @return Grant\PasswordCredential|null |
|
| 100 | 100 | */ |
| 101 | 101 | function grant(array $data) |
| 102 | 102 | { |
@@ -16,14 +16,14 @@ discard block |
||
| 16 | 16 | const RE_ACCT = '/\A[_a-z0-9]+@[-:.a-z0-9]+\z/'; |
| 17 | 17 | |
| 18 | 18 | $routes = []; |
| 19 | -$routes['index'] = ['GET', '/', function (Action $action) { |
|
| 19 | +$routes['index'] = ['GET', '/', function(Action $action) { |
|
| 20 | 20 | chrome_log()->info('Hello, World!'); |
| 21 | 21 | chrome_log()->info('session', $_SESSION); |
| 22 | 22 | |
| 23 | 23 | return [200, [], view('index')]; |
| 24 | 24 | }]; |
| 25 | 25 | |
| 26 | -$routes['acct'] = ['GET', '/acct/:acct', function (Action $action) { |
|
| 26 | +$routes['acct'] = ['GET', '/acct/:acct', function(Action $action) { |
|
| 27 | 27 | chrome_log()->info('session', $_SESSION); |
| 28 | 28 | |
| 29 | 29 | $acct_input = $action->param['acct']; |
@@ -38,12 +38,12 @@ discard block |
||
| 38 | 38 | ])]; |
| 39 | 39 | }, ['acct' => RE_ACCT]]; |
| 40 | 40 | |
| 41 | -$routes['license'] = ['GET', '/license', function (Action $action) { |
|
| 41 | +$routes['license'] = ['GET', '/license', function(Action $action) { |
|
| 42 | 42 | $path = __DIR__ . '/../../LICENSE'; |
| 43 | 43 | return [200, ['Content-Type' => 'text/plain;charset=UTF-8'], file_get_contents($path)]; |
| 44 | 44 | }]; |
| 45 | 45 | |
| 46 | -$routes['post_login'] = ['POST', '/login', function (Action $action) { |
|
| 46 | +$routes['post_login'] = ['POST', '/login', function(Action $action) { |
|
| 47 | 47 | $acct_input = filter_input(INPUT_POST, 'acct', FILTER_DEFAULT); |
| 48 | 48 | $acct = ltrim($acct_input, '@'); |
| 49 | 49 | |
@@ -91,8 +91,8 @@ discard block |
||
| 91 | 91 | return [302, ['Location' => $redirect_url], null]; |
| 92 | 92 | }]; |
| 93 | 93 | |
| 94 | -$routes['auth_callback'] = ['GET', '/auth/callback', function (Action $action) { |
|
| 95 | - $code_input = filter_input(INPUT_GET, 'code', FILTER_DEFAULT); |
|
| 94 | +$routes['auth_callback'] = ['GET', '/auth/callback', function(Action $action) { |
|
| 95 | + $code_input = filter_input(INPUT_GET, 'code', FILTER_DEFAULT); |
|
| 96 | 96 | $state_input = filter_input(INPUT_GET, 'state', FILTER_DEFAULT); |
| 97 | 97 | |
| 98 | 98 | if (!isset($_SESSION['login'], $_SESSION['login'][$state_input]) || !is_array($_SESSION['login'][$state_input])) { |
@@ -137,7 +137,7 @@ discard block |
||
| 137 | 137 | return [302, ['Location' => '/'], null]; |
| 138 | 138 | }]; |
| 139 | 139 | |
| 140 | -$routes['#404'] = function (Action $action) { |
|
| 140 | +$routes['#404'] = function(Action $action) { |
|
| 141 | 141 | return [404, [], view('404')]; |
| 142 | 142 | }; |
| 143 | 143 | |
@@ -130,5 +130,5 @@ |
||
| 130 | 130 | */ |
| 131 | 131 | function is_production() |
| 132 | 132 | { |
| 133 | - return getenv('MY_PHP_ENV') === 'production'; |
|
| 133 | + return getenv('MY_PHP_ENV') === 'production'; |
|
| 134 | 134 | } |