for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace Rinvex\Oauth;
use Illuminate\Contracts\Support\Jsonable;
use Illuminate\Contracts\Support\Arrayable;
class PersonalAccessTokenResult implements Arrayable, Jsonable
{
/**
* The access token.
*
* @var string
*/
public $accessToken;
* The token model instance.
* @var \Rinvex\Oauth\Models\AccessToken
public $token;
* Create a new result instance.
* @param string $accessToken
* @param \Rinvex\Oauth\Models\AccessToken $token
* @return void
@return
Adding a @return annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.
Please refer to the PHP core documentation on constructors.
public function __construct($accessToken, $token)
$this->token = $token;
$this->accessToken = $accessToken;
}
* Get the instance as an array.
* @return array
array<string,string|Models\AccessToken>
This check looks for the generic type array as a return type and suggests a more specific type. This type is inferred from the actual code.
array
public function toArray()
return [
'accessToken' => $this->accessToken,
'token' => $this->token,
];
* Convert the object to its JSON representation.
* @param int $options
* @return string
public function toJson($options = 0)
return json_encode($this->toArray(), $options);
Adding a
@return
annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.Please refer to the PHP core documentation on constructors.