repository_name
stringlengths
5
67
func_path_in_repository
stringlengths
4
234
func_name
stringlengths
0
314
whole_func_string
stringlengths
52
3.87M
language
stringclasses
6 values
func_code_string
stringlengths
52
3.87M
func_code_tokens
listlengths
15
672k
func_documentation_string
stringlengths
1
47.2k
func_documentation_tokens
listlengths
1
3.92k
split_name
stringclasses
1 value
func_code_url
stringlengths
85
339
seregazhuk/php-pinterest-bot
src/Api/Providers/Pinners.php
Pinners.followingPeople
public function followingPeople($username, $limit = Pagination::DEFAULT_LIMIT) { return $this->following($username, UrlBuilder::FOLLOWING_PEOPLE, $limit); }
php
public function followingPeople($username, $limit = Pagination::DEFAULT_LIMIT) { return $this->following($username, UrlBuilder::FOLLOWING_PEOPLE, $limit); }
[ "public", "function", "followingPeople", "(", "$", "username", ",", "$", "limit", "=", "Pagination", "::", "DEFAULT_LIMIT", ")", "{", "return", "$", "this", "->", "following", "(", "$", "username", ",", "UrlBuilder", "::", "FOLLOWING_PEOPLE", ",", "$", "limi...
Get following people for pinner. @param string $username @param int $limit @return Pagination
[ "Get", "following", "people", "for", "pinner", "." ]
train
https://github.com/seregazhuk/php-pinterest-bot/blob/0ef279183f998d6b3652f1d4a361ed1e19d04cf1/src/Api/Providers/Pinners.php#L75-L78
seregazhuk/php-pinterest-bot
src/Api/Providers/Pinners.php
Pinners.followingBoards
public function followingBoards($username, $limit = Pagination::DEFAULT_LIMIT) { return $this->following($username, UrlBuilder::FOLLOWING_BOARDS, $limit); }
php
public function followingBoards($username, $limit = Pagination::DEFAULT_LIMIT) { return $this->following($username, UrlBuilder::FOLLOWING_BOARDS, $limit); }
[ "public", "function", "followingBoards", "(", "$", "username", ",", "$", "limit", "=", "Pagination", "::", "DEFAULT_LIMIT", ")", "{", "return", "$", "this", "->", "following", "(", "$", "username", ",", "UrlBuilder", "::", "FOLLOWING_BOARDS", ",", "$", "limi...
Get following boards for pinner. @param string $username @param int $limit @return Pagination
[ "Get", "following", "boards", "for", "pinner", "." ]
train
https://github.com/seregazhuk/php-pinterest-bot/blob/0ef279183f998d6b3652f1d4a361ed1e19d04cf1/src/Api/Providers/Pinners.php#L87-L90
seregazhuk/php-pinterest-bot
src/Api/Providers/Pinners.php
Pinners.followingInterests
public function followingInterests($username, $limit = Pagination::DEFAULT_LIMIT) { return $this->following($username, UrlBuilder::FOLLOWING_INTERESTS, $limit); }
php
public function followingInterests($username, $limit = Pagination::DEFAULT_LIMIT) { return $this->following($username, UrlBuilder::FOLLOWING_INTERESTS, $limit); }
[ "public", "function", "followingInterests", "(", "$", "username", ",", "$", "limit", "=", "Pagination", "::", "DEFAULT_LIMIT", ")", "{", "return", "$", "this", "->", "following", "(", "$", "username", ",", "UrlBuilder", "::", "FOLLOWING_INTERESTS", ",", "$", ...
Get following interests for pinner. @param string $username @param int $limit @return Pagination @throws WrongFollowingType
[ "Get", "following", "interests", "for", "pinner", "." ]
train
https://github.com/seregazhuk/php-pinterest-bot/blob/0ef279183f998d6b3652f1d4a361ed1e19d04cf1/src/Api/Providers/Pinners.php#L100-L103
seregazhuk/php-pinterest-bot
src/Api/Providers/Pinners.php
Pinners.pins
public function pins($username, $limit = Pagination::DEFAULT_LIMIT) { return $this->paginateByUsername( $username, UrlBuilder::RESOURCE_USER_PINS, $limit ); }
php
public function pins($username, $limit = Pagination::DEFAULT_LIMIT) { return $this->paginateByUsername( $username, UrlBuilder::RESOURCE_USER_PINS, $limit ); }
[ "public", "function", "pins", "(", "$", "username", ",", "$", "limit", "=", "Pagination", "::", "DEFAULT_LIMIT", ")", "{", "return", "$", "this", "->", "paginateByUsername", "(", "$", "username", ",", "UrlBuilder", "::", "RESOURCE_USER_PINS", ",", "$", "limi...
Get pinner pins. @param string $username @param int $limit @return Pagination
[ "Get", "pinner", "pins", "." ]
train
https://github.com/seregazhuk/php-pinterest-bot/blob/0ef279183f998d6b3652f1d4a361ed1e19d04cf1/src/Api/Providers/Pinners.php#L113-L118
seregazhuk/php-pinterest-bot
src/Api/Providers/Pinners.php
Pinners.likes
public function likes($username, $limit = Pagination::DEFAULT_LIMIT) { return $this->paginateByUsername( $username, UrlBuilder::RESOURCE_USER_LIKES, $limit ); }
php
public function likes($username, $limit = Pagination::DEFAULT_LIMIT) { return $this->paginateByUsername( $username, UrlBuilder::RESOURCE_USER_LIKES, $limit ); }
[ "public", "function", "likes", "(", "$", "username", ",", "$", "limit", "=", "Pagination", "::", "DEFAULT_LIMIT", ")", "{", "return", "$", "this", "->", "paginateByUsername", "(", "$", "username", ",", "UrlBuilder", "::", "RESOURCE_USER_LIKES", ",", "$", "li...
Get pins that user likes. @param string $username @param int $limit @return Pagination
[ "Get", "pins", "that", "user", "likes", "." ]
train
https://github.com/seregazhuk/php-pinterest-bot/blob/0ef279183f998d6b3652f1d4a361ed1e19d04cf1/src/Api/Providers/Pinners.php#L127-L132
seregazhuk/php-pinterest-bot
src/Api/Providers/Pinners.php
Pinners.paginateByUsername
protected function paginateByUsername($username, $url, $limit = Pagination::DEFAULT_LIMIT) { return $this->paginate($url, ['username' => $username], $limit); }
php
protected function paginateByUsername($username, $url, $limit = Pagination::DEFAULT_LIMIT) { return $this->paginate($url, ['username' => $username], $limit); }
[ "protected", "function", "paginateByUsername", "(", "$", "username", ",", "$", "url", ",", "$", "limit", "=", "Pagination", "::", "DEFAULT_LIMIT", ")", "{", "return", "$", "this", "->", "paginate", "(", "$", "url", ",", "[", "'username'", "=>", "$", "use...
@param string $username @param string $url @param int $limit @return Pagination
[ "@param", "string", "$username", "@param", "string", "$url", "@param", "int", "$limit" ]
train
https://github.com/seregazhuk/php-pinterest-bot/blob/0ef279183f998d6b3652f1d4a361ed1e19d04cf1/src/Api/Providers/Pinners.php#L178-L181
seregazhuk/php-pinterest-bot
src/Api/Providers/Pinners.php
Pinners.followers
public function followers($username = '', $limit = Pagination::DEFAULT_LIMIT) { $username = empty($username) ? $this->resolveCurrentUsername() : $username; if (!$username) { return new Pagination(); } return parent::followers($username, $limit); ...
php
public function followers($username = '', $limit = Pagination::DEFAULT_LIMIT) { $username = empty($username) ? $this->resolveCurrentUsername() : $username; if (!$username) { return new Pagination(); } return parent::followers($username, $limit); ...
[ "public", "function", "followers", "(", "$", "username", "=", "''", ",", "$", "limit", "=", "Pagination", "::", "DEFAULT_LIMIT", ")", "{", "$", "username", "=", "empty", "(", "$", "username", ")", "?", "$", "this", "->", "resolveCurrentUsername", "(", ")...
Returns current user's followers when used without arguments. @param string $username @param int $limit @return array|Pagination
[ "Returns", "current", "user", "s", "followers", "when", "used", "without", "arguments", "." ]
train
https://github.com/seregazhuk/php-pinterest-bot/blob/0ef279183f998d6b3652f1d4a361ed1e19d04cf1/src/Api/Providers/Pinners.php#L207-L218
seregazhuk/php-pinterest-bot
src/Api/Providers/Topics.php
Topics.pins
public function pins($interest, $limit = Pagination::DEFAULT_LIMIT) { $data = [ 'interest' => $interest, 'pins_only' => false, ]; return $this->paginate(UrlBuilder::RESOURCE_GET_TOPIC_FEED, $data, $limit); }
php
public function pins($interest, $limit = Pagination::DEFAULT_LIMIT) { $data = [ 'interest' => $interest, 'pins_only' => false, ]; return $this->paginate(UrlBuilder::RESOURCE_GET_TOPIC_FEED, $data, $limit); }
[ "public", "function", "pins", "(", "$", "interest", ",", "$", "limit", "=", "Pagination", "::", "DEFAULT_LIMIT", ")", "{", "$", "data", "=", "[", "'interest'", "=>", "$", "interest", ",", "'pins_only'", "=>", "false", ",", "]", ";", "return", "$", "thi...
Returns a feed of pins. @param string $interest @param int $limit @return Pagination
[ "Returns", "a", "feed", "of", "pins", "." ]
train
https://github.com/seregazhuk/php-pinterest-bot/blob/0ef279183f998d6b3652f1d4a361ed1e19d04cf1/src/Api/Providers/Topics.php#L37-L45
seregazhuk/php-pinterest-bot
src/Api/CurlHttpClient.php
CurlHttpClient.execute
public function execute($url, $postString = '', array $headers = []) { return $this ->init($url, $postString, $headers) ->callCurl(); }
php
public function execute($url, $postString = '', array $headers = []) { return $this ->init($url, $postString, $headers) ->callCurl(); }
[ "public", "function", "execute", "(", "$", "url", ",", "$", "postString", "=", "''", ",", "array", "$", "headers", "=", "[", "]", ")", "{", "return", "$", "this", "->", "init", "(", "$", "url", ",", "$", "postString", ",", "$", "headers", ")", "-...
Executes curl request. @param string $url @param string $postString @param array $headers @return string
[ "Executes", "curl", "request", "." ]
train
https://github.com/seregazhuk/php-pinterest-bot/blob/0ef279183f998d6b3652f1d4a361ed1e19d04cf1/src/Api/CurlHttpClient.php#L86-L91
seregazhuk/php-pinterest-bot
src/Api/CurlHttpClient.php
CurlHttpClient.init
protected function init($url, $postString, $headers) { $this->headers = $headers; $this->curl = curl_init($url); if (empty($this->cookieJar)) { $this->loadCookies(); } curl_setopt_array($this->curl, $this->makeHttpOptions($postString)); return $this; ...
php
protected function init($url, $postString, $headers) { $this->headers = $headers; $this->curl = curl_init($url); if (empty($this->cookieJar)) { $this->loadCookies(); } curl_setopt_array($this->curl, $this->makeHttpOptions($postString)); return $this; ...
[ "protected", "function", "init", "(", "$", "url", ",", "$", "postString", ",", "$", "headers", ")", "{", "$", "this", "->", "headers", "=", "$", "headers", ";", "$", "this", "->", "curl", "=", "curl_init", "(", "$", "url", ")", ";", "if", "(", "e...
Initializes curl resource with options. @param string $url @param string $postString @param array $headers @return $this
[ "Initializes", "curl", "resource", "with", "options", "." ]
train
https://github.com/seregazhuk/php-pinterest-bot/blob/0ef279183f998d6b3652f1d4a361ed1e19d04cf1/src/Api/CurlHttpClient.php#L117-L130
seregazhuk/php-pinterest-bot
src/Api/CurlHttpClient.php
CurlHttpClient.makeHttpOptions
protected function makeHttpOptions($postString = '') { // Union custom Curl options and default ones. $options = array_replace( $this->options, $this->getDefaultHttpOptions() ); if (!empty($postString)) { $options[CURLOPT_POST] = true; ...
php
protected function makeHttpOptions($postString = '') { // Union custom Curl options and default ones. $options = array_replace( $this->options, $this->getDefaultHttpOptions() ); if (!empty($postString)) { $options[CURLOPT_POST] = true; ...
[ "protected", "function", "makeHttpOptions", "(", "$", "postString", "=", "''", ")", "{", "// Union custom Curl options and default ones.", "$", "options", "=", "array_replace", "(", "$", "this", "->", "options", ",", "$", "this", "->", "getDefaultHttpOptions", "(", ...
Adds necessary curl options for query. @param string $postString POST query string @return array
[ "Adds", "necessary", "curl", "options", "for", "query", "." ]
train
https://github.com/seregazhuk/php-pinterest-bot/blob/0ef279183f998d6b3652f1d4a361ed1e19d04cf1/src/Api/CurlHttpClient.php#L157-L171
seregazhuk/php-pinterest-bot
src/Api/CurlHttpClient.php
CurlHttpClient.initCookieFile
protected function initCookieFile($username) { $cookieName = self::COOKIE_PREFIX . $username; $cookieFilePath = $this->getCookiesPath() . DIRECTORY_SEPARATOR . $cookieName; if (!file_exists($cookieFilePath)) { touch($cookieFilePath); } return $cookieFilePath; ...
php
protected function initCookieFile($username) { $cookieName = self::COOKIE_PREFIX . $username; $cookieFilePath = $this->getCookiesPath() . DIRECTORY_SEPARATOR . $cookieName; if (!file_exists($cookieFilePath)) { touch($cookieFilePath); } return $cookieFilePath; ...
[ "protected", "function", "initCookieFile", "(", "$", "username", ")", "{", "$", "cookieName", "=", "self", "::", "COOKIE_PREFIX", ".", "$", "username", ";", "$", "cookieFilePath", "=", "$", "this", "->", "getCookiesPath", "(", ")", ".", "DIRECTORY_SEPARATOR", ...
Returns cookie file name according to the provided username. @param string $username @return string
[ "Returns", "cookie", "file", "name", "according", "to", "the", "provided", "username", "." ]
train
https://github.com/seregazhuk/php-pinterest-bot/blob/0ef279183f998d6b3652f1d4a361ed1e19d04cf1/src/Api/CurlHttpClient.php#L253-L263
seregazhuk/php-pinterest-bot
src/Api/Response.php
Response.parseResponseData
protected function parseResponseData($key = null) { $responseData = get_array_data('resource_response.data', $this->data); if (!$responseData) { return false; } return $key ? get_array_data($key, $responseData) : $responseData; }
php
protected function parseResponseData($key = null) { $responseData = get_array_data('resource_response.data', $this->data); if (!$responseData) { return false; } return $key ? get_array_data($key, $responseData) : $responseData; }
[ "protected", "function", "parseResponseData", "(", "$", "key", "=", "null", ")", "{", "$", "responseData", "=", "get_array_data", "(", "'resource_response.data'", ",", "$", "this", "->", "data", ")", ";", "if", "(", "!", "$", "responseData", ")", "{", "ret...
Parse data from Pinterest Api response. Data is stored in ['resource_response']['data'] array. @param string|null $key @return bool|array
[ "Parse", "data", "from", "Pinterest", "Api", "response", ".", "Data", "is", "stored", "in", "[", "resource_response", "]", "[", "data", "]", "array", "." ]
train
https://github.com/seregazhuk/php-pinterest-bot/blob/0ef279183f998d6b3652f1d4a361ed1e19d04cf1/src/Api/Response.php#L100-L111
seregazhuk/php-pinterest-bot
src/Api/Providers/Core/Provider.php
Provider.post
public function post($resourceUrl, array $requestOptions = [], $returnData = false) { $postString = $this->request->createQuery($requestOptions); // When executing POST request we need a csrf-token. $this->initTokenIfRequired(); $this->execute($resourceUrl, $postString); r...
php
public function post($resourceUrl, array $requestOptions = [], $returnData = false) { $postString = $this->request->createQuery($requestOptions); // When executing POST request we need a csrf-token. $this->initTokenIfRequired(); $this->execute($resourceUrl, $postString); r...
[ "public", "function", "post", "(", "$", "resourceUrl", ",", "array", "$", "requestOptions", "=", "[", "]", ",", "$", "returnData", "=", "false", ")", "{", "$", "postString", "=", "$", "this", "->", "request", "->", "createQuery", "(", "$", "requestOption...
Executes a POST request to Pinterest API. @param string $resourceUrl @param array $requestOptions @param bool $returnData @return bool|array
[ "Executes", "a", "POST", "request", "to", "Pinterest", "API", "." ]
train
https://github.com/seregazhuk/php-pinterest-bot/blob/0ef279183f998d6b3652f1d4a361ed1e19d04cf1/src/Api/Providers/Core/Provider.php#L58-L68
seregazhuk/php-pinterest-bot
src/Api/Providers/Core/Provider.php
Provider.get
protected function get($resourceUrl = '', array $requestOptions = []) { $this->execute($resourceUrl . $this->makeQueryString($requestOptions)); return $this->response->getResponseData(); }
php
protected function get($resourceUrl = '', array $requestOptions = []) { $this->execute($resourceUrl . $this->makeQueryString($requestOptions)); return $this->response->getResponseData(); }
[ "protected", "function", "get", "(", "$", "resourceUrl", "=", "''", ",", "array", "$", "requestOptions", "=", "[", "]", ")", "{", "$", "this", "->", "execute", "(", "$", "resourceUrl", ".", "$", "this", "->", "makeQueryString", "(", "$", "requestOptions"...
Executes a GET request to Pinterest API. @param string $resourceUrl @param array $requestOptions @return array|bool
[ "Executes", "a", "GET", "request", "to", "Pinterest", "API", "." ]
train
https://github.com/seregazhuk/php-pinterest-bot/blob/0ef279183f998d6b3652f1d4a361ed1e19d04cf1/src/Api/Providers/Core/Provider.php#L77-L82
seregazhuk/php-pinterest-bot
src/Api/Providers/Core/Provider.php
Provider.checkMethodRequiresLogin
public function checkMethodRequiresLogin($method) { $methodsThatRequireLogin = array_merge($this->loginRequiredFor, $this->requiresLoginFor()); return in_array($method, $methodsThatRequireLogin); }
php
public function checkMethodRequiresLogin($method) { $methodsThatRequireLogin = array_merge($this->loginRequiredFor, $this->requiresLoginFor()); return in_array($method, $methodsThatRequireLogin); }
[ "public", "function", "checkMethodRequiresLogin", "(", "$", "method", ")", "{", "$", "methodsThatRequireLogin", "=", "array_merge", "(", "$", "this", "->", "loginRequiredFor", ",", "$", "this", "->", "requiresLoginFor", "(", ")", ")", ";", "return", "in_array", ...
@param string $method @return bool
[ "@param", "string", "$method" ]
train
https://github.com/seregazhuk/php-pinterest-bot/blob/0ef279183f998d6b3652f1d4a361ed1e19d04cf1/src/Api/Providers/Core/Provider.php#L103-L108
seregazhuk/php-pinterest-bot
src/Api/Providers/Core/Provider.php
Provider.paginateCustom
protected function paginateCustom(callable $callback, $limit = Pagination::DEFAULT_LIMIT) { $this->response->clear(); return (new Pagination)->paginateOver($callback)->take($limit); }
php
protected function paginateCustom(callable $callback, $limit = Pagination::DEFAULT_LIMIT) { $this->response->clear(); return (new Pagination)->paginateOver($callback)->take($limit); }
[ "protected", "function", "paginateCustom", "(", "callable", "$", "callback", ",", "$", "limit", "=", "Pagination", "::", "DEFAULT_LIMIT", ")", "{", "$", "this", "->", "response", "->", "clear", "(", ")", ";", "return", "(", "new", "Pagination", ")", "->", ...
Accepts callback which should return PaginatedResponse object. @param callable $callback @param int $limit @return Pagination
[ "Accepts", "callback", "which", "should", "return", "PaginatedResponse", "object", "." ]
train
https://github.com/seregazhuk/php-pinterest-bot/blob/0ef279183f998d6b3652f1d4a361ed1e19d04cf1/src/Api/Providers/Core/Provider.php#L159-L164
seregazhuk/php-pinterest-bot
src/Api/Providers/Comments.php
Comments.create
public function create($pinId, $text) { $requestOptions = [ 'objectId' => $this->getAggregatedPinId($pinId), 'pinId' => $pinId, 'text' => $text, ]; return $this->post(UrlBuilder::RESOURCE_COMMENT_PIN, $requestOptions, true); }
php
public function create($pinId, $text) { $requestOptions = [ 'objectId' => $this->getAggregatedPinId($pinId), 'pinId' => $pinId, 'text' => $text, ]; return $this->post(UrlBuilder::RESOURCE_COMMENT_PIN, $requestOptions, true); }
[ "public", "function", "create", "(", "$", "pinId", ",", "$", "text", ")", "{", "$", "requestOptions", "=", "[", "'objectId'", "=>", "$", "this", "->", "getAggregatedPinId", "(", "$", "pinId", ")", ",", "'pinId'", "=>", "$", "pinId", ",", "'text'", "=>"...
Write a comment for a pin with current id. @param int $pinId @param string $text Comment @return array
[ "Write", "a", "comment", "for", "a", "pin", "with", "current", "id", "." ]
train
https://github.com/seregazhuk/php-pinterest-bot/blob/0ef279183f998d6b3652f1d4a361ed1e19d04cf1/src/Api/Providers/Comments.php#L27-L36
seregazhuk/php-pinterest-bot
src/Api/Providers/Comments.php
Comments.delete
public function delete($pinId, $commentId) { $requestOptions = ['commentId' => $commentId]; return $this->post(UrlBuilder::RESOURCE_COMMENT_DELETE_PIN, $requestOptions); }
php
public function delete($pinId, $commentId) { $requestOptions = ['commentId' => $commentId]; return $this->post(UrlBuilder::RESOURCE_COMMENT_DELETE_PIN, $requestOptions); }
[ "public", "function", "delete", "(", "$", "pinId", ",", "$", "commentId", ")", "{", "$", "requestOptions", "=", "[", "'commentId'", "=>", "$", "commentId", "]", ";", "return", "$", "this", "->", "post", "(", "UrlBuilder", "::", "RESOURCE_COMMENT_DELETE_PIN",...
Delete a comment for a pin with current id. @param string $pinId @param int $commentId @return bool
[ "Delete", "a", "comment", "for", "a", "pin", "with", "current", "id", "." ]
train
https://github.com/seregazhuk/php-pinterest-bot/blob/0ef279183f998d6b3652f1d4a361ed1e19d04cf1/src/Api/Providers/Comments.php#L46-L51
seregazhuk/php-pinterest-bot
src/Api/Providers/Inbox.php
Inbox.sendMessage
public function sendMessage($userIds, $text, $pinId = null) { return $this->send($pinId, $text, $userIds, []); }
php
public function sendMessage($userIds, $text, $pinId = null) { return $this->send($pinId, $text, $userIds, []); }
[ "public", "function", "sendMessage", "(", "$", "userIds", ",", "$", "text", ",", "$", "pinId", "=", "null", ")", "{", "return", "$", "this", "->", "send", "(", "$", "pinId", ",", "$", "text", ",", "$", "userIds", ",", "[", "]", ")", ";", "}" ]
Send message to a user. @param array|string $userIds @param string $text @param int|null $pinId @return bool @throws InvalidRequest
[ "Send", "message", "to", "a", "user", "." ]
train
https://github.com/seregazhuk/php-pinterest-bot/blob/0ef279183f998d6b3652f1d4a361ed1e19d04cf1/src/Api/Providers/Inbox.php#L79-L82
seregazhuk/php-pinterest-bot
src/Api/Providers/Inbox.php
Inbox.sendEmail
public function sendEmail($emails, $text, $pinId = null) { return $this->send($pinId, $text, [], $emails); }
php
public function sendEmail($emails, $text, $pinId = null) { return $this->send($pinId, $text, [], $emails); }
[ "public", "function", "sendEmail", "(", "$", "emails", ",", "$", "text", ",", "$", "pinId", "=", "null", ")", "{", "return", "$", "this", "->", "send", "(", "$", "pinId", ",", "$", "text", ",", "[", "]", ",", "$", "emails", ")", ";", "}" ]
Send email. @param array|string $emails @param string $text @param int|null $pinId @return bool @throws InvalidRequest
[ "Send", "email", "." ]
train
https://github.com/seregazhuk/php-pinterest-bot/blob/0ef279183f998d6b3652f1d4a361ed1e19d04cf1/src/Api/Providers/Inbox.php#L93-L96
seregazhuk/php-pinterest-bot
src/Api/Providers/Core/ProviderWrapper.php
ProviderWrapper.checkMethodForLoginRequired
protected function checkMethodForLoginRequired($method) { $isLoggedIn = $this->provider->isLoggedIn(); $methodRequiresLogin = $this->provider->checkMethodRequiresLogin($method); if ($methodRequiresLogin && !$isLoggedIn) { $errorMessage = $this->getErrorMethodCallMessage($method,...
php
protected function checkMethodForLoginRequired($method) { $isLoggedIn = $this->provider->isLoggedIn(); $methodRequiresLogin = $this->provider->checkMethodRequiresLogin($method); if ($methodRequiresLogin && !$isLoggedIn) { $errorMessage = $this->getErrorMethodCallMessage($method,...
[ "protected", "function", "checkMethodForLoginRequired", "(", "$", "method", ")", "{", "$", "isLoggedIn", "=", "$", "this", "->", "provider", "->", "isLoggedIn", "(", ")", ";", "$", "methodRequiresLogin", "=", "$", "this", "->", "provider", "->", "checkMethodRe...
Checks if method requires login and if true, checks logged in status. @param $method @throws AuthRequired if is not logged in
[ "Checks", "if", "method", "requires", "login", "and", "if", "true", "checks", "logged", "in", "status", "." ]
train
https://github.com/seregazhuk/php-pinterest-bot/blob/0ef279183f998d6b3652f1d4a361ed1e19d04cf1/src/Api/Providers/Core/ProviderWrapper.php#L59-L68
seregazhuk/php-pinterest-bot
src/Api/Traits/Searchable.php
Searchable.execSearchRequest
protected function execSearchRequest($query, $scope) { $url = $this->getResponse()->hasBookmarks() ? UrlBuilder::RESOURCE_SEARCH_WITH_PAGINATION : UrlBuilder::RESOURCE_SEARCH; $requestOptions = [ 'scope' => $scope, 'query' => $query, ]; ...
php
protected function execSearchRequest($query, $scope) { $url = $this->getResponse()->hasBookmarks() ? UrlBuilder::RESOURCE_SEARCH_WITH_PAGINATION : UrlBuilder::RESOURCE_SEARCH; $requestOptions = [ 'scope' => $scope, 'query' => $query, ]; ...
[ "protected", "function", "execSearchRequest", "(", "$", "query", ",", "$", "scope", ")", "{", "$", "url", "=", "$", "this", "->", "getResponse", "(", ")", "->", "hasBookmarks", "(", ")", "?", "UrlBuilder", "::", "RESOURCE_SEARCH_WITH_PAGINATION", ":", "UrlBu...
Executes search to API. Query - search string. @param string $query @param string $scope @return SearchResponse
[ "Executes", "search", "to", "API", ".", "Query", "-", "search", "string", "." ]
train
https://github.com/seregazhuk/php-pinterest-bot/blob/0ef279183f998d6b3652f1d4a361ed1e19d04cf1/src/Api/Traits/Searchable.php#L33-L49
seregazhuk/php-pinterest-bot
src/Api/Traits/Searchable.php
Searchable.search
public function search($query, $limit = Pagination::DEFAULT_LIMIT) { return $this->paginateCustom(function () use ($query) { return $this->execSearchRequest($query, $this->getSearchScope()); })->take($limit); }
php
public function search($query, $limit = Pagination::DEFAULT_LIMIT) { return $this->paginateCustom(function () use ($query) { return $this->execSearchRequest($query, $this->getSearchScope()); })->take($limit); }
[ "public", "function", "search", "(", "$", "query", ",", "$", "limit", "=", "Pagination", "::", "DEFAULT_LIMIT", ")", "{", "return", "$", "this", "->", "paginateCustom", "(", "function", "(", ")", "use", "(", "$", "query", ")", "{", "return", "$", "this...
Search entities by search query. @param string $query @param int $limit @return Pagination
[ "Search", "entities", "by", "search", "query", "." ]
train
https://github.com/seregazhuk/php-pinterest-bot/blob/0ef279183f998d6b3652f1d4a361ed1e19d04cf1/src/Api/Traits/Searchable.php#L59-L64
seregazhuk/php-pinterest-bot
src/Api/Providers/Password.php
Password.reset
public function reset($link, $newPassword) { // Visit link to get current reset token, username and token expiration $this->get($link); $this->request->dropCookies(); $urlData = $this->parseCurrentUrl(); $isValidUrlData = isset($urlData['query'], $urlData['path']); ...
php
public function reset($link, $newPassword) { // Visit link to get current reset token, username and token expiration $this->get($link); $this->request->dropCookies(); $urlData = $this->parseCurrentUrl(); $isValidUrlData = isset($urlData['query'], $urlData['path']); ...
[ "public", "function", "reset", "(", "$", "link", ",", "$", "newPassword", ")", "{", "// Visit link to get current reset token, username and token expiration", "$", "this", "->", "get", "(", "$", "link", ")", ";", "$", "this", "->", "request", "->", "dropCookies", ...
Set a new password by link from reset password email @param string $link @param string $newPassword @return bool
[ "Set", "a", "new", "password", "by", "link", "from", "reset", "password", "email" ]
train
https://github.com/seregazhuk/php-pinterest-bot/blob/0ef279183f998d6b3652f1d4a361ed1e19d04cf1/src/Api/Providers/Password.php#L38-L71
seregazhuk/php-pinterest-bot
src/Api/Providers/Core/FollowableProvider.php
FollowableProvider.followCall
protected function followCall($entityId, $resourceUrl) { $query = $this->createFollowRequest($this->resolveEntityId($entityId)); return $this->post($resourceUrl, $query); }
php
protected function followCall($entityId, $resourceUrl) { $query = $this->createFollowRequest($this->resolveEntityId($entityId)); return $this->post($resourceUrl, $query); }
[ "protected", "function", "followCall", "(", "$", "entityId", ",", "$", "resourceUrl", ")", "{", "$", "query", "=", "$", "this", "->", "createFollowRequest", "(", "$", "this", "->", "resolveEntityId", "(", "$", "entityId", ")", ")", ";", "return", "$", "t...
Make api call for follow/unFollow a entity (user/board). @param int $entityId @param string $resourceUrl @return bool
[ "Make", "api", "call", "for", "follow", "/", "unFollow", "a", "entity", "(", "user", "/", "board", ")", "." ]
train
https://github.com/seregazhuk/php-pinterest-bot/blob/0ef279183f998d6b3652f1d4a361ed1e19d04cf1/src/Api/Providers/Core/FollowableProvider.php#L72-L77
seregazhuk/php-pinterest-bot
src/Api/Providers/Core/FollowableProvider.php
FollowableProvider.followers
public function followers($for, $limit = Pagination::DEFAULT_LIMIT) { return $this->paginate( $this->getFollowersUrl(), [$this->getFollowersFor() => $for], $limit ); }
php
public function followers($for, $limit = Pagination::DEFAULT_LIMIT) { return $this->paginate( $this->getFollowersUrl(), [$this->getFollowersFor() => $for], $limit ); }
[ "public", "function", "followers", "(", "$", "for", ",", "$", "limit", "=", "Pagination", "::", "DEFAULT_LIMIT", ")", "{", "return", "$", "this", "->", "paginate", "(", "$", "this", "->", "getFollowersUrl", "(", ")", ",", "[", "$", "this", "->", "getFo...
Get followers. @param string $for @param int $limit @return Pagination
[ "Get", "followers", "." ]
train
https://github.com/seregazhuk/php-pinterest-bot/blob/0ef279183f998d6b3652f1d4a361ed1e19d04cf1/src/Api/Providers/Core/FollowableProvider.php#L117-L122
seregazhuk/php-pinterest-bot
src/Api/ProvidersContainer.php
ProvidersContainer.getProvider
public function getProvider($provider) { // Check if an instance has already been initiated. If not // build it and then add to the providers array. if (!isset($this->providers[$provider])) { $this->addProvider($provider); } return $this->providers[$provider]; ...
php
public function getProvider($provider) { // Check if an instance has already been initiated. If not // build it and then add to the providers array. if (!isset($this->providers[$provider])) { $this->addProvider($provider); } return $this->providers[$provider]; ...
[ "public", "function", "getProvider", "(", "$", "provider", ")", "{", "// Check if an instance has already been initiated. If not", "// build it and then add to the providers array.", "if", "(", "!", "isset", "(", "$", "this", "->", "providers", "[", "$", "provider", "]", ...
Gets provider object by name. If there is no such provider in providers array, it will try to create it, then save it, and then return. @param string $provider @throws WrongProvider @return Provider
[ "Gets", "provider", "object", "by", "name", ".", "If", "there", "is", "no", "such", "provider", "in", "providers", "array", "it", "will", "try", "to", "create", "it", "then", "save", "it", "and", "then", "return", "." ]
train
https://github.com/seregazhuk/php-pinterest-bot/blob/0ef279183f998d6b3652f1d4a361ed1e19d04cf1/src/Api/ProvidersContainer.php#L98-L107
seregazhuk/php-pinterest-bot
src/Api/ProvidersContainer.php
ProvidersContainer.addProvider
protected function addProvider($provider) { $className = $this->resolveProviderClass($provider); $this->providers[$provider] = $this->buildProvider($className); }
php
protected function addProvider($provider) { $className = $this->resolveProviderClass($provider); $this->providers[$provider] = $this->buildProvider($className); }
[ "protected", "function", "addProvider", "(", "$", "provider", ")", "{", "$", "className", "=", "$", "this", "->", "resolveProviderClass", "(", "$", "provider", ")", ";", "$", "this", "->", "providers", "[", "$", "provider", "]", "=", "$", "this", "->", ...
Creates provider by class name, and if success saves it to providers array. Provider class must exist in PROVIDERS_NAMESPACE. @param string $provider @throws WrongProvider
[ "Creates", "provider", "by", "class", "name", "and", "if", "success", "saves", "it", "to", "providers", "array", ".", "Provider", "class", "must", "exist", "in", "PROVIDERS_NAMESPACE", "." ]
train
https://github.com/seregazhuk/php-pinterest-bot/blob/0ef279183f998d6b3652f1d4a361ed1e19d04cf1/src/Api/ProvidersContainer.php#L116-L121
seregazhuk/php-pinterest-bot
src/Api/ProvidersContainer.php
ProvidersContainer.getClientInfo
public function getClientInfo($reload = false) { $clientInfo = $this->response->getClientInfo(); if ($clientInfo === null || $reload) { /** @var User $userProvider */ $userProvider = $this->getProvider('user'); $userProvider->visitPage(); } retur...
php
public function getClientInfo($reload = false) { $clientInfo = $this->response->getClientInfo(); if ($clientInfo === null || $reload) { /** @var User $userProvider */ $userProvider = $this->getProvider('user'); $userProvider->visitPage(); } retur...
[ "public", "function", "getClientInfo", "(", "$", "reload", "=", "false", ")", "{", "$", "clientInfo", "=", "$", "this", "->", "response", "->", "getClientInfo", "(", ")", ";", "if", "(", "$", "clientInfo", "===", "null", "||", "$", "reload", ")", "{", ...
Returns client context from Pinterest response. By default info returns from the last Pinterest response. If there was no response before or the argument $reload is true, we make a dummy request to the main page to update client context. @param bool $reload @return array|null @throws WrongProvider
[ "Returns", "client", "context", "from", "Pinterest", "response", ".", "By", "default", "info", "returns", "from", "the", "last", "Pinterest", "response", ".", "If", "there", "was", "no", "response", "before", "or", "the", "argument", "$reload", "is", "true", ...
train
https://github.com/seregazhuk/php-pinterest-bot/blob/0ef279183f998d6b3652f1d4a361ed1e19d04cf1/src/Api/ProvidersContainer.php#L156-L167
lucadegasperi/oauth2-server-laravel
src/Storage/FluentClient.php
FluentClient.get
public function get($clientId, $clientSecret = null, $redirectUri = null, $grantType = null) { $query = null; if (!is_null($redirectUri) && is_null($clientSecret)) { $query = $this->getConnection()->table('oauth_clients') ->select( 'oauth_client...
php
public function get($clientId, $clientSecret = null, $redirectUri = null, $grantType = null) { $query = null; if (!is_null($redirectUri) && is_null($clientSecret)) { $query = $this->getConnection()->table('oauth_clients') ->select( 'oauth_client...
[ "public", "function", "get", "(", "$", "clientId", ",", "$", "clientSecret", "=", "null", ",", "$", "redirectUri", "=", "null", ",", "$", "grantType", "=", "null", ")", "{", "$", "query", "=", "null", ";", "if", "(", "!", "is_null", "(", "$", "redi...
Get the client. @param string $clientId @param string $clientSecret @param string $redirectUri @param string $grantType @return null|\League\OAuth2\Server\Entity\ClientEntity
[ "Get", "the", "client", "." ]
train
https://github.com/lucadegasperi/oauth2-server-laravel/blob/b884f6030ce562dc21838e408371b5e942a3e967/src/Storage/FluentClient.php#L76-L124
lucadegasperi/oauth2-server-laravel
src/Storage/FluentClient.php
FluentClient.getBySession
public function getBySession(SessionEntity $session) { $result = $this->getConnection()->table('oauth_clients') ->select( 'oauth_clients.id as id', 'oauth_clients.secret as secret', 'oauth_clients.name as name') ->jo...
php
public function getBySession(SessionEntity $session) { $result = $this->getConnection()->table('oauth_clients') ->select( 'oauth_clients.id as id', 'oauth_clients.secret as secret', 'oauth_clients.name as name') ->jo...
[ "public", "function", "getBySession", "(", "SessionEntity", "$", "session", ")", "{", "$", "result", "=", "$", "this", "->", "getConnection", "(", ")", "->", "table", "(", "'oauth_clients'", ")", "->", "select", "(", "'oauth_clients.id as id'", ",", "'oauth_cl...
Get the client associated with a session. @param \League\OAuth2\Server\Entity\SessionEntity $session The session @return null|\League\OAuth2\Server\Entity\ClientEntity
[ "Get", "the", "client", "associated", "with", "a", "session", "." ]
train
https://github.com/lucadegasperi/oauth2-server-laravel/blob/b884f6030ce562dc21838e408371b5e942a3e967/src/Storage/FluentClient.php#L133-L149
lucadegasperi/oauth2-server-laravel
src/Storage/FluentClient.php
FluentClient.create
public function create($name, $id, $secret) { return $this->getConnection()->table('oauth_clients')->insertGetId([ 'id' => $id, 'name' => $name, 'secret' => $secret, 'created_at' => Carbon::now(), 'updated_at' => Carbon::now(), ]); }
php
public function create($name, $id, $secret) { return $this->getConnection()->table('oauth_clients')->insertGetId([ 'id' => $id, 'name' => $name, 'secret' => $secret, 'created_at' => Carbon::now(), 'updated_at' => Carbon::now(), ]); }
[ "public", "function", "create", "(", "$", "name", ",", "$", "id", ",", "$", "secret", ")", "{", "return", "$", "this", "->", "getConnection", "(", ")", "->", "table", "(", "'oauth_clients'", ")", "->", "insertGetId", "(", "[", "'id'", "=>", "$", "id"...
Create a new client. @param string $name The client's unique name @param string $id The client's unique id @param string $secret The clients' unique secret @return string
[ "Create", "a", "new", "client", "." ]
train
https://github.com/lucadegasperi/oauth2-server-laravel/blob/b884f6030ce562dc21838e408371b5e942a3e967/src/Storage/FluentClient.php#L160-L169
lucadegasperi/oauth2-server-laravel
src/Storage/FluentClient.php
FluentClient.hydrateEntity
protected function hydrateEntity($result) { $client = new ClientEntity($this->getServer()); $client->hydrate([ 'id' => $result->id, 'name' => $result->name, 'secret' => $result->secret, 'redirectUri' => (isset($result->redirect_uri) ? $result->redirect...
php
protected function hydrateEntity($result) { $client = new ClientEntity($this->getServer()); $client->hydrate([ 'id' => $result->id, 'name' => $result->name, 'secret' => $result->secret, 'redirectUri' => (isset($result->redirect_uri) ? $result->redirect...
[ "protected", "function", "hydrateEntity", "(", "$", "result", ")", "{", "$", "client", "=", "new", "ClientEntity", "(", "$", "this", "->", "getServer", "(", ")", ")", ";", "$", "client", "->", "hydrate", "(", "[", "'id'", "=>", "$", "result", "->", "...
Hydrate the entity. @param $result @return \League\OAuth2\Server\Entity\ClientEntity
[ "Hydrate", "the", "entity", "." ]
train
https://github.com/lucadegasperi/oauth2-server-laravel/blob/b884f6030ce562dc21838e408371b5e942a3e967/src/Storage/FluentClient.php#L178-L189
lucadegasperi/oauth2-server-laravel
database/migrations/2014_04_24_110459_create_oauth_clients_table.php
CreateOauthClientsTable.up
public function up() { Schema::create('oauth_clients', function (BluePrint $table) { $table->string('id', 40)->primary(); $table->string('secret', 40); $table->string('name'); $table->timestamps(); $table->unique(['id', 'secret']); }); ...
php
public function up() { Schema::create('oauth_clients', function (BluePrint $table) { $table->string('id', 40)->primary(); $table->string('secret', 40); $table->string('name'); $table->timestamps(); $table->unique(['id', 'secret']); }); ...
[ "public", "function", "up", "(", ")", "{", "Schema", "::", "create", "(", "'oauth_clients'", ",", "function", "(", "BluePrint", "$", "table", ")", "{", "$", "table", "->", "string", "(", "'id'", ",", "40", ")", "->", "primary", "(", ")", ";", "$", ...
Run the migrations. @return void
[ "Run", "the", "migrations", "." ]
train
https://github.com/lucadegasperi/oauth2-server-laravel/blob/b884f6030ce562dc21838e408371b5e942a3e967/database/migrations/2014_04_24_110459_create_oauth_clients_table.php#L28-L38
lucadegasperi/oauth2-server-laravel
src/Middleware/OAuthClientOwnerMiddleware.php
OAuthClientOwnerMiddleware.handle
public function handle($request, Closure $next) { $this->authorizer->setRequest($request); if ($this->authorizer->getResourceOwnerType() !== 'client') { throw new AccessDeniedException(); } return $next($request); }
php
public function handle($request, Closure $next) { $this->authorizer->setRequest($request); if ($this->authorizer->getResourceOwnerType() !== 'client') { throw new AccessDeniedException(); } return $next($request); }
[ "public", "function", "handle", "(", "$", "request", ",", "Closure", "$", "next", ")", "{", "$", "this", "->", "authorizer", "->", "setRequest", "(", "$", "request", ")", ";", "if", "(", "$", "this", "->", "authorizer", "->", "getResourceOwnerType", "(",...
Handle an incoming request. @param \Illuminate\Http\Request $request @param \Closure $next @throws \League\OAuth2\Server\Exception\AccessDeniedException @return mixed
[ "Handle", "an", "incoming", "request", "." ]
train
https://github.com/lucadegasperi/oauth2-server-laravel/blob/b884f6030ce562dc21838e408371b5e942a3e967/src/Middleware/OAuthClientOwnerMiddleware.php#L52-L61
lucadegasperi/oauth2-server-laravel
src/Storage/FluentStorageServiceProvider.php
FluentStorageServiceProvider.registerStorageBindings
public function registerStorageBindings(Application $app) { $provider = $this; $app->singleton(FluentAccessToken::class, function () use ($provider) { $storage = new FluentAccessToken($provider->app['db']); $storage->setConnectionName($provider->getConnectionName()); ...
php
public function registerStorageBindings(Application $app) { $provider = $this; $app->singleton(FluentAccessToken::class, function () use ($provider) { $storage = new FluentAccessToken($provider->app['db']); $storage->setConnectionName($provider->getConnectionName()); ...
[ "public", "function", "registerStorageBindings", "(", "Application", "$", "app", ")", "{", "$", "provider", "=", "$", "this", ";", "$", "app", "->", "singleton", "(", "FluentAccessToken", "::", "class", ",", "function", "(", ")", "use", "(", "$", "provider...
Bind the storage implementations to the IoC container. @param \Illuminate\Contracts\Foundation\Application $app @return void
[ "Bind", "the", "storage", "implementations", "to", "the", "IoC", "container", "." ]
train
https://github.com/lucadegasperi/oauth2-server-laravel/blob/b884f6030ce562dc21838e408371b5e942a3e967/src/Storage/FluentStorageServiceProvider.php#L58-L106
lucadegasperi/oauth2-server-laravel
src/Storage/FluentStorageServiceProvider.php
FluentStorageServiceProvider.registerInterfaceBindings
public function registerInterfaceBindings(Application $app) { $app->bind(ClientInterface::class, FluentClient::class); $app->bind(ScopeInterface::class, FluentScope::class); $app->bind(SessionInterface::class, FluentSession::class); $app->bind(AuthCodeInterface::class, FluentAuthCode...
php
public function registerInterfaceBindings(Application $app) { $app->bind(ClientInterface::class, FluentClient::class); $app->bind(ScopeInterface::class, FluentScope::class); $app->bind(SessionInterface::class, FluentSession::class); $app->bind(AuthCodeInterface::class, FluentAuthCode...
[ "public", "function", "registerInterfaceBindings", "(", "Application", "$", "app", ")", "{", "$", "app", "->", "bind", "(", "ClientInterface", "::", "class", ",", "FluentClient", "::", "class", ")", ";", "$", "app", "->", "bind", "(", "ScopeInterface", "::",...
Bind the interfaces to their implementations. @param \Illuminate\Contracts\Foundation\Application $app @return void
[ "Bind", "the", "interfaces", "to", "their", "implementations", "." ]
train
https://github.com/lucadegasperi/oauth2-server-laravel/blob/b884f6030ce562dc21838e408371b5e942a3e967/src/Storage/FluentStorageServiceProvider.php#L115-L123
lucadegasperi/oauth2-server-laravel
src/Middleware/OAuthMiddleware.php
OAuthMiddleware.handle
public function handle($request, Closure $next, $scopesString = null) { $scopes = []; if (!is_null($scopesString)) { $scopes = explode('+', $scopesString); } $this->authorizer->setRequest($request); $this->authorizer->validateAccessToken($this->httpHeadersOnly)...
php
public function handle($request, Closure $next, $scopesString = null) { $scopes = []; if (!is_null($scopesString)) { $scopes = explode('+', $scopesString); } $this->authorizer->setRequest($request); $this->authorizer->validateAccessToken($this->httpHeadersOnly)...
[ "public", "function", "handle", "(", "$", "request", ",", "Closure", "$", "next", ",", "$", "scopesString", "=", "null", ")", "{", "$", "scopes", "=", "[", "]", ";", "if", "(", "!", "is_null", "(", "$", "scopesString", ")", ")", "{", "$", "scopes",...
Handle an incoming request. @param \Illuminate\Http\Request $request @param \Closure $next @param string|null $scopesString @throws \League\OAuth2\Server\Exception\InvalidScopeException @return mixed
[ "Handle", "an", "incoming", "request", "." ]
train
https://github.com/lucadegasperi/oauth2-server-laravel/blob/b884f6030ce562dc21838e408371b5e942a3e967/src/Middleware/OAuthMiddleware.php#L62-L76
lucadegasperi/oauth2-server-laravel
src/Middleware/OAuthMiddleware.php
OAuthMiddleware.validateScopes
public function validateScopes($scopes) { if (!empty($scopes) && !$this->authorizer->hasScope($scopes)) { throw new InvalidScopeException(implode(',', $scopes)); } }
php
public function validateScopes($scopes) { if (!empty($scopes) && !$this->authorizer->hasScope($scopes)) { throw new InvalidScopeException(implode(',', $scopes)); } }
[ "public", "function", "validateScopes", "(", "$", "scopes", ")", "{", "if", "(", "!", "empty", "(", "$", "scopes", ")", "&&", "!", "$", "this", "->", "authorizer", "->", "hasScope", "(", "$", "scopes", ")", ")", "{", "throw", "new", "InvalidScopeExcept...
Validate the scopes. @param $scopes @throws \League\OAuth2\Server\Exception\InvalidScopeException
[ "Validate", "the", "scopes", "." ]
train
https://github.com/lucadegasperi/oauth2-server-laravel/blob/b884f6030ce562dc21838e408371b5e942a3e967/src/Middleware/OAuthMiddleware.php#L85-L90
lucadegasperi/oauth2-server-laravel
src/Storage/FluentAuthCode.php
FluentAuthCode.get
public function get($code) { $result = $this->getConnection()->table('oauth_auth_codes') ->where('oauth_auth_codes.id', $code) ->where('oauth_auth_codes.expire_time', '>=', time()) ->first(); if (is_null($result)) { return; } return (...
php
public function get($code) { $result = $this->getConnection()->table('oauth_auth_codes') ->where('oauth_auth_codes.id', $code) ->where('oauth_auth_codes.expire_time', '>=', time()) ->first(); if (is_null($result)) { return; } return (...
[ "public", "function", "get", "(", "$", "code", ")", "{", "$", "result", "=", "$", "this", "->", "getConnection", "(", ")", "->", "table", "(", "'oauth_auth_codes'", ")", "->", "where", "(", "'oauth_auth_codes.id'", ",", "$", "code", ")", "->", "where", ...
Get the auth code. @param string $code @return \League\OAuth2\Server\Entity\AuthCodeEntity
[ "Get", "the", "auth", "code", "." ]
train
https://github.com/lucadegasperi/oauth2-server-laravel/blob/b884f6030ce562dc21838e408371b5e942a3e967/src/Storage/FluentAuthCode.php#L33-L48
lucadegasperi/oauth2-server-laravel
src/Storage/FluentAuthCode.php
FluentAuthCode.associateScope
public function associateScope(AuthCodeEntity $token, ScopeEntity $scope) { $this->getConnection()->table('oauth_auth_code_scopes')->insert([ 'auth_code_id' => $token->getId(), 'scope_id' => $scope->getId(), 'created_at' => Carbon::now(), 'updated_at' => Carbo...
php
public function associateScope(AuthCodeEntity $token, ScopeEntity $scope) { $this->getConnection()->table('oauth_auth_code_scopes')->insert([ 'auth_code_id' => $token->getId(), 'scope_id' => $scope->getId(), 'created_at' => Carbon::now(), 'updated_at' => Carbo...
[ "public", "function", "associateScope", "(", "AuthCodeEntity", "$", "token", ",", "ScopeEntity", "$", "scope", ")", "{", "$", "this", "->", "getConnection", "(", ")", "->", "table", "(", "'oauth_auth_code_scopes'", ")", "->", "insert", "(", "[", "'auth_code_id...
Associate a scope with an access token. @param \League\OAuth2\Server\Entity\AuthCodeEntity $token The auth code @param \League\OAuth2\Server\Entity\ScopeEntity $scope The scope @return void
[ "Associate", "a", "scope", "with", "an", "access", "token", "." ]
train
https://github.com/lucadegasperi/oauth2-server-laravel/blob/b884f6030ce562dc21838e408371b5e942a3e967/src/Storage/FluentAuthCode.php#L85-L93
lucadegasperi/oauth2-server-laravel
src/Storage/FluentAuthCode.php
FluentAuthCode.delete
public function delete(AuthCodeEntity $token) { $this->getConnection()->table('oauth_auth_codes') ->where('oauth_auth_codes.id', $token->getId()) ->delete(); }
php
public function delete(AuthCodeEntity $token) { $this->getConnection()->table('oauth_auth_codes') ->where('oauth_auth_codes.id', $token->getId()) ->delete(); }
[ "public", "function", "delete", "(", "AuthCodeEntity", "$", "token", ")", "{", "$", "this", "->", "getConnection", "(", ")", "->", "table", "(", "'oauth_auth_codes'", ")", "->", "where", "(", "'oauth_auth_codes.id'", ",", "$", "token", "->", "getId", "(", ...
Delete an access token. @param \League\OAuth2\Server\Entity\AuthCodeEntity $token The access token to delete @return void
[ "Delete", "an", "access", "token", "." ]
train
https://github.com/lucadegasperi/oauth2-server-laravel/blob/b884f6030ce562dc21838e408371b5e942a3e967/src/Storage/FluentAuthCode.php#L102-L107
lucadegasperi/oauth2-server-laravel
src/Storage/FluentAuthCode.php
FluentAuthCode.create
public function create($token, $expireTime, $sessionId, $redirectUri) { $this->getConnection()->table('oauth_auth_codes')->insert([ 'id' => $token, 'session_id' => $sessionId, 'redirect_uri' => $redirectUri, 'expire_time' => $expireTime, 'created_a...
php
public function create($token, $expireTime, $sessionId, $redirectUri) { $this->getConnection()->table('oauth_auth_codes')->insert([ 'id' => $token, 'session_id' => $sessionId, 'redirect_uri' => $redirectUri, 'expire_time' => $expireTime, 'created_a...
[ "public", "function", "create", "(", "$", "token", ",", "$", "expireTime", ",", "$", "sessionId", ",", "$", "redirectUri", ")", "{", "$", "this", "->", "getConnection", "(", ")", "->", "table", "(", "'oauth_auth_codes'", ")", "->", "insert", "(", "[", ...
Create an auth code. @param string $token The token ID @param int $expireTime Token expire time @param int $sessionId Session identifier @param string $redirectUri Client redirect uri @return void
[ "Create", "an", "auth", "code", "." ]
train
https://github.com/lucadegasperi/oauth2-server-laravel/blob/b884f6030ce562dc21838e408371b5e942a3e967/src/Storage/FluentAuthCode.php#L119-L129
lucadegasperi/oauth2-server-laravel
src/Middleware/OAuthExceptionHandlerMiddleware.php
OAuthExceptionHandlerMiddleware.handle
public function handle($request, Closure $next) { try { $response = $next($request); // Was an exception thrown? If so and available catch in our middleware if (isset($response->exception) && $response->exception) { throw $response->exception; ...
php
public function handle($request, Closure $next) { try { $response = $next($request); // Was an exception thrown? If so and available catch in our middleware if (isset($response->exception) && $response->exception) { throw $response->exception; ...
[ "public", "function", "handle", "(", "$", "request", ",", "Closure", "$", "next", ")", "{", "try", "{", "$", "response", "=", "$", "next", "(", "$", "request", ")", ";", "// Was an exception thrown? If so and available catch in our middleware", "if", "(", "isset...
Handle an incoming request. @param \Illuminate\Http\Request $request @param \Closure $next @return mixed
[ "Handle", "an", "incoming", "request", "." ]
train
https://github.com/lucadegasperi/oauth2-server-laravel/blob/b884f6030ce562dc21838e408371b5e942a3e967/src/Middleware/OAuthExceptionHandlerMiddleware.php#L33-L51
lucadegasperi/oauth2-server-laravel
src/Storage/FluentSession.php
FluentSession.get
public function get($sessionId) { $result = $this->getConnection()->table('oauth_sessions') ->where('oauth_sessions.id', $sessionId) ->first(); if (is_null($result)) { return; } return (new SessionEntity($this->getServer())) ...
php
public function get($sessionId) { $result = $this->getConnection()->table('oauth_sessions') ->where('oauth_sessions.id', $sessionId) ->first(); if (is_null($result)) { return; } return (new SessionEntity($this->getServer())) ...
[ "public", "function", "get", "(", "$", "sessionId", ")", "{", "$", "result", "=", "$", "this", "->", "getConnection", "(", ")", "->", "table", "(", "'oauth_sessions'", ")", "->", "where", "(", "'oauth_sessions.id'", ",", "$", "sessionId", ")", "->", "fir...
Get a session from it's identifier. @param string $sessionId @return \League\OAuth2\Server\Entity\SessionEntity
[ "Get", "a", "session", "from", "it", "s", "identifier", "." ]
train
https://github.com/lucadegasperi/oauth2-server-laravel/blob/b884f6030ce562dc21838e408371b5e942a3e967/src/Storage/FluentSession.php#L35-L48
lucadegasperi/oauth2-server-laravel
src/Storage/FluentSession.php
FluentSession.getByAccessToken
public function getByAccessToken(AccessTokenEntity $accessToken) { $result = $this->getConnection()->table('oauth_sessions') ->select('oauth_sessions.*') ->join('oauth_access_tokens', 'oauth_sessions.id', '=', 'oauth_access_tokens.session_id') ->where('oauth_a...
php
public function getByAccessToken(AccessTokenEntity $accessToken) { $result = $this->getConnection()->table('oauth_sessions') ->select('oauth_sessions.*') ->join('oauth_access_tokens', 'oauth_sessions.id', '=', 'oauth_access_tokens.session_id') ->where('oauth_a...
[ "public", "function", "getByAccessToken", "(", "AccessTokenEntity", "$", "accessToken", ")", "{", "$", "result", "=", "$", "this", "->", "getConnection", "(", ")", "->", "table", "(", "'oauth_sessions'", ")", "->", "select", "(", "'oauth_sessions.*'", ")", "->...
Get a session from an access token. @param \League\OAuth2\Server\Entity\AccessTokenEntity $accessToken The access token @return \League\OAuth2\Server\Entity\SessionEntity
[ "Get", "a", "session", "from", "an", "access", "token", "." ]
train
https://github.com/lucadegasperi/oauth2-server-laravel/blob/b884f6030ce562dc21838e408371b5e942a3e967/src/Storage/FluentSession.php#L57-L72
lucadegasperi/oauth2-server-laravel
src/Storage/FluentSession.php
FluentSession.getScopes
public function getScopes(SessionEntity $session) { // TODO: Check this before pushing $result = $this->getConnection()->table('oauth_session_scopes') ->select('oauth_scopes.*') ->join('oauth_scopes', 'oauth_session_scopes.scope_id', '=', 'oauth_scopes.id') ...
php
public function getScopes(SessionEntity $session) { // TODO: Check this before pushing $result = $this->getConnection()->table('oauth_session_scopes') ->select('oauth_scopes.*') ->join('oauth_scopes', 'oauth_session_scopes.scope_id', '=', 'oauth_scopes.id') ...
[ "public", "function", "getScopes", "(", "SessionEntity", "$", "session", ")", "{", "// TODO: Check this before pushing", "$", "result", "=", "$", "this", "->", "getConnection", "(", ")", "->", "table", "(", "'oauth_session_scopes'", ")", "->", "select", "(", "'o...
Get a session's scopes. @param \League\OAuth2\Server\Entity\SessionEntity @return array Array of \League\OAuth2\Server\Entity\ScopeEntity
[ "Get", "a", "session", "s", "scopes", "." ]
train
https://github.com/lucadegasperi/oauth2-server-laravel/blob/b884f6030ce562dc21838e408371b5e942a3e967/src/Storage/FluentSession.php#L81-L100
lucadegasperi/oauth2-server-laravel
src/Storage/FluentSession.php
FluentSession.create
public function create($ownerType, $ownerId, $clientId, $clientRedirectUri = null) { return $this->getConnection()->table('oauth_sessions')->insertGetId([ 'client_id' => $clientId, 'owner_type' => $ownerType, 'owner_id' => $ownerId, 'client_redirect_uri' => $c...
php
public function create($ownerType, $ownerId, $clientId, $clientRedirectUri = null) { return $this->getConnection()->table('oauth_sessions')->insertGetId([ 'client_id' => $clientId, 'owner_type' => $ownerType, 'owner_id' => $ownerId, 'client_redirect_uri' => $c...
[ "public", "function", "create", "(", "$", "ownerType", ",", "$", "ownerId", ",", "$", "clientId", ",", "$", "clientRedirectUri", "=", "null", ")", "{", "return", "$", "this", "->", "getConnection", "(", ")", "->", "table", "(", "'oauth_sessions'", ")", "...
Create a new session. @param string $ownerType Session owner's type (user, client) @param string $ownerId Session owner's ID @param string $clientId Client ID @param string $clientRedirectUri Client redirect URI (default = null) @return int The session's ID
[ "Create", "a", "new", "session", "." ]
train
https://github.com/lucadegasperi/oauth2-server-laravel/blob/b884f6030ce562dc21838e408371b5e942a3e967/src/Storage/FluentSession.php#L112-L122
lucadegasperi/oauth2-server-laravel
src/Storage/FluentSession.php
FluentSession.associateScope
public function associateScope(SessionEntity $session, ScopeEntity $scope) { $this->getConnection()->table('oauth_session_scopes')->insert([ 'session_id' => $session->getId(), 'scope_id' => $scope->getId(), 'created_at' => Carbon::now(), 'updated_at' => Carbon...
php
public function associateScope(SessionEntity $session, ScopeEntity $scope) { $this->getConnection()->table('oauth_session_scopes')->insert([ 'session_id' => $session->getId(), 'scope_id' => $scope->getId(), 'created_at' => Carbon::now(), 'updated_at' => Carbon...
[ "public", "function", "associateScope", "(", "SessionEntity", "$", "session", ",", "ScopeEntity", "$", "scope", ")", "{", "$", "this", "->", "getConnection", "(", ")", "->", "table", "(", "'oauth_session_scopes'", ")", "->", "insert", "(", "[", "'session_id'",...
Associate a scope with a session. @param \League\OAuth2\Server\Entity\SessionEntity $session @param \League\OAuth2\Server\Entity\ScopeEntity $scope The scopes ID might be an integer or string @return void
[ "Associate", "a", "scope", "with", "a", "session", "." ]
train
https://github.com/lucadegasperi/oauth2-server-laravel/blob/b884f6030ce562dc21838e408371b5e942a3e967/src/Storage/FluentSession.php#L132-L140
lucadegasperi/oauth2-server-laravel
src/Storage/FluentSession.php
FluentSession.getByAuthCode
public function getByAuthCode(AuthCodeEntity $authCode) { $result = $this->getConnection()->table('oauth_sessions') ->select('oauth_sessions.*') ->join('oauth_auth_codes', 'oauth_sessions.id', '=', 'oauth_auth_codes.session_id') ->where('oauth_auth_codes.id', $authCode->g...
php
public function getByAuthCode(AuthCodeEntity $authCode) { $result = $this->getConnection()->table('oauth_sessions') ->select('oauth_sessions.*') ->join('oauth_auth_codes', 'oauth_sessions.id', '=', 'oauth_auth_codes.session_id') ->where('oauth_auth_codes.id', $authCode->g...
[ "public", "function", "getByAuthCode", "(", "AuthCodeEntity", "$", "authCode", ")", "{", "$", "result", "=", "$", "this", "->", "getConnection", "(", ")", "->", "table", "(", "'oauth_sessions'", ")", "->", "select", "(", "'oauth_sessions.*'", ")", "->", "joi...
Get a session from an auth code. @param \League\OAuth2\Server\Entity\AuthCodeEntity $authCode The auth code @return \League\OAuth2\Server\Entity\SessionEntity
[ "Get", "a", "session", "from", "an", "auth", "code", "." ]
train
https://github.com/lucadegasperi/oauth2-server-laravel/blob/b884f6030ce562dc21838e408371b5e942a3e967/src/Storage/FluentSession.php#L149-L164
lucadegasperi/oauth2-server-laravel
src/Storage/FluentAccessToken.php
FluentAccessToken.get
public function get($token) { $result = $this->getConnection()->table('oauth_access_tokens') ->where('oauth_access_tokens.id', $token) ->first(); if (is_null($result)) { return; } return (new AccessTokenEntity($this->getServer())) ...
php
public function get($token) { $result = $this->getConnection()->table('oauth_access_tokens') ->where('oauth_access_tokens.id', $token) ->first(); if (is_null($result)) { return; } return (new AccessTokenEntity($this->getServer())) ...
[ "public", "function", "get", "(", "$", "token", ")", "{", "$", "result", "=", "$", "this", "->", "getConnection", "(", ")", "->", "table", "(", "'oauth_access_tokens'", ")", "->", "where", "(", "'oauth_access_tokens.id'", ",", "$", "token", ")", "->", "f...
Get an instance of Entities\AccessToken. @param string $token The access token @return null|AbstractTokenEntity
[ "Get", "an", "instance", "of", "Entities", "\\", "AccessToken", "." ]
train
https://github.com/lucadegasperi/oauth2-server-laravel/blob/b884f6030ce562dc21838e408371b5e942a3e967/src/Storage/FluentAccessToken.php#L33-L46
lucadegasperi/oauth2-server-laravel
src/Storage/FluentAccessToken.php
FluentAccessToken.create
public function create($token, $expireTime, $sessionId) { $this->getConnection()->table('oauth_access_tokens')->insert([ 'id' => $token, 'expire_time' => $expireTime, 'session_id' => $sessionId, 'created_at' => Carbon::now(), 'updated_at' => Carbon...
php
public function create($token, $expireTime, $sessionId) { $this->getConnection()->table('oauth_access_tokens')->insert([ 'id' => $token, 'expire_time' => $expireTime, 'session_id' => $sessionId, 'created_at' => Carbon::now(), 'updated_at' => Carbon...
[ "public", "function", "create", "(", "$", "token", ",", "$", "expireTime", ",", "$", "sessionId", ")", "{", "$", "this", "->", "getConnection", "(", ")", "->", "table", "(", "'oauth_access_tokens'", ")", "->", "insert", "(", "[", "'id'", "=>", "$", "to...
Creates a new access token. @param string $token The access token @param int $expireTime The expire time expressed as a unix timestamp @param string|int $sessionId The session ID @return \League\OAuth2\Server\Entity\AccessTokenEntity
[ "Creates", "a", "new", "access", "token", "." ]
train
https://github.com/lucadegasperi/oauth2-server-laravel/blob/b884f6030ce562dc21838e408371b5e942a3e967/src/Storage/FluentAccessToken.php#L103-L116
lucadegasperi/oauth2-server-laravel
src/Storage/FluentAccessToken.php
FluentAccessToken.delete
public function delete(AccessTokenEntity $token) { $this->getConnection()->table('oauth_access_tokens') ->where('oauth_access_tokens.id', $token->getId()) ->delete(); }
php
public function delete(AccessTokenEntity $token) { $this->getConnection()->table('oauth_access_tokens') ->where('oauth_access_tokens.id', $token->getId()) ->delete(); }
[ "public", "function", "delete", "(", "AccessTokenEntity", "$", "token", ")", "{", "$", "this", "->", "getConnection", "(", ")", "->", "table", "(", "'oauth_access_tokens'", ")", "->", "where", "(", "'oauth_access_tokens.id'", ",", "$", "token", "->", "getId", ...
Delete an access token. @param \League\OAuth2\Server\Entity\AccessTokenEntity $token The access token to delete @return void
[ "Delete", "an", "access", "token", "." ]
train
https://github.com/lucadegasperi/oauth2-server-laravel/blob/b884f6030ce562dc21838e408371b5e942a3e967/src/Storage/FluentAccessToken.php#L143-L148
lucadegasperi/oauth2-server-laravel
src/Authorizer.php
Authorizer.getAuthCodeRequestParam
public function getAuthCodeRequestParam($key, $default = null) { if (array_key_exists($key, $this->authCodeRequestParams)) { return $this->authCodeRequestParams[$key]; } return $default; }
php
public function getAuthCodeRequestParam($key, $default = null) { if (array_key_exists($key, $this->authCodeRequestParams)) { return $this->authCodeRequestParams[$key]; } return $default; }
[ "public", "function", "getAuthCodeRequestParam", "(", "$", "key", ",", "$", "default", "=", "null", ")", "{", "if", "(", "array_key_exists", "(", "$", "key", ",", "$", "this", "->", "authCodeRequestParams", ")", ")", "{", "return", "$", "this", "->", "au...
Get a single parameter from the auth code request parameters. @param $key @param null $default @return mixed
[ "Get", "a", "single", "parameter", "from", "the", "auth", "code", "request", "parameters", "." ]
train
https://github.com/lucadegasperi/oauth2-server-laravel/blob/b884f6030ce562dc21838e408371b5e942a3e967/src/Authorizer.php#L138-L145
lucadegasperi/oauth2-server-laravel
src/Authorizer.php
Authorizer.issueAuthCode
public function issueAuthCode($ownerType, $ownerId, $params = []) { $params = array_merge($this->authCodeRequestParams, $params); return $this->issuer->getGrantType('authorization_code')->newAuthorizeRequest($ownerType, $ownerId, $params); }
php
public function issueAuthCode($ownerType, $ownerId, $params = []) { $params = array_merge($this->authCodeRequestParams, $params); return $this->issuer->getGrantType('authorization_code')->newAuthorizeRequest($ownerType, $ownerId, $params); }
[ "public", "function", "issueAuthCode", "(", "$", "ownerType", ",", "$", "ownerId", ",", "$", "params", "=", "[", "]", ")", "{", "$", "params", "=", "array_merge", "(", "$", "this", "->", "authCodeRequestParams", ",", "$", "params", ")", ";", "return", ...
Issue an auth code. @param string $ownerType the auth code owner type @param string $ownerId the auth code owner id @param array $params additional parameters to merge @return string the auth code redirect url
[ "Issue", "an", "auth", "code", "." ]
train
https://github.com/lucadegasperi/oauth2-server-laravel/blob/b884f6030ce562dc21838e408371b5e942a3e967/src/Authorizer.php#L166-L171
lucadegasperi/oauth2-server-laravel
src/Authorizer.php
Authorizer.authCodeRequestDeniedRedirectUri
public function authCodeRequestDeniedRedirectUri() { $error = new AccessDeniedException(); return $this->getRedirectUriGenerator()->make($this->getAuthCodeRequestParam('redirect_uri'), [ 'error' => $error->errorType, 'error_description' => $error->get...
php
public function authCodeRequestDeniedRedirectUri() { $error = new AccessDeniedException(); return $this->getRedirectUriGenerator()->make($this->getAuthCodeRequestParam('redirect_uri'), [ 'error' => $error->errorType, 'error_description' => $error->get...
[ "public", "function", "authCodeRequestDeniedRedirectUri", "(", ")", "{", "$", "error", "=", "new", "AccessDeniedException", "(", ")", ";", "return", "$", "this", "->", "getRedirectUriGenerator", "(", ")", "->", "make", "(", "$", "this", "->", "getAuthCodeRequest...
Generate a redirect uri when the auth code request is denied by the user. @return string a correctly formed url to redirect back to
[ "Generate", "a", "redirect", "uri", "when", "the", "auth", "code", "request", "is", "denied", "by", "the", "user", "." ]
train
https://github.com/lucadegasperi/oauth2-server-laravel/blob/b884f6030ce562dc21838e408371b5e942a3e967/src/Authorizer.php#L178-L187
lucadegasperi/oauth2-server-laravel
src/Authorizer.php
Authorizer.validateAccessToken
public function validateAccessToken($httpHeadersOnly = false, $accessToken = null) { return $this->checker->isValidRequest($httpHeadersOnly, $accessToken); }
php
public function validateAccessToken($httpHeadersOnly = false, $accessToken = null) { return $this->checker->isValidRequest($httpHeadersOnly, $accessToken); }
[ "public", "function", "validateAccessToken", "(", "$", "httpHeadersOnly", "=", "false", ",", "$", "accessToken", "=", "null", ")", "{", "return", "$", "this", "->", "checker", "->", "isValidRequest", "(", "$", "httpHeadersOnly", ",", "$", "accessToken", ")", ...
Validate a request with an access token in it. @param bool $httpHeadersOnly whether or not to check only the http headers of the request @param string|null $accessToken an access token to validate @return mixed
[ "Validate", "a", "request", "with", "an", "access", "token", "in", "it", "." ]
train
https://github.com/lucadegasperi/oauth2-server-laravel/blob/b884f6030ce562dc21838e408371b5e942a3e967/src/Authorizer.php#L221-L224
lucadegasperi/oauth2-server-laravel
src/Authorizer.php
Authorizer.hasScope
public function hasScope($scope) { if (is_array($scope)) { foreach ($scope as $s) { if ($this->hasScope($s) === false) { return false; } } return true; } return $this->getAccessToken()->hasScope($scope)...
php
public function hasScope($scope) { if (is_array($scope)) { foreach ($scope as $s) { if ($this->hasScope($s) === false) { return false; } } return true; } return $this->getAccessToken()->hasScope($scope)...
[ "public", "function", "hasScope", "(", "$", "scope", ")", "{", "if", "(", "is_array", "(", "$", "scope", ")", ")", "{", "foreach", "(", "$", "scope", "as", "$", "s", ")", "{", "if", "(", "$", "this", "->", "hasScope", "(", "$", "s", ")", "===",...
Check if the current request has all the scopes passed. @param string|array $scope the scope(s) to check for existence @return bool
[ "Check", "if", "the", "current", "request", "has", "all", "the", "scopes", "passed", "." ]
train
https://github.com/lucadegasperi/oauth2-server-laravel/blob/b884f6030ce562dc21838e408371b5e942a3e967/src/Authorizer.php#L243-L256
lucadegasperi/oauth2-server-laravel
src/Authorizer.php
Authorizer.setRequest
public function setRequest(Request $request) { $this->issuer->setRequest($request); $this->checker->setRequest($request); }
php
public function setRequest(Request $request) { $this->issuer->setRequest($request); $this->checker->setRequest($request); }
[ "public", "function", "setRequest", "(", "Request", "$", "request", ")", "{", "$", "this", "->", "issuer", "->", "setRequest", "(", "$", "request", ")", ";", "$", "this", "->", "checker", "->", "setRequest", "(", "$", "request", ")", ";", "}" ]
Set the request to use on the issuer and checker. @param \Symfony\Component\HttpFoundation\Request $request
[ "Set", "the", "request", "to", "use", "on", "the", "issuer", "and", "checker", "." ]
train
https://github.com/lucadegasperi/oauth2-server-laravel/blob/b884f6030ce562dc21838e408371b5e942a3e967/src/Authorizer.php#L293-L297
lucadegasperi/oauth2-server-laravel
src/Authorizer.php
Authorizer.setTokenType
public function setTokenType(TokenTypeInterface $tokenType) { $this->issuer->setTokenType($tokenType); $this->checker->setTokenType($tokenType); }
php
public function setTokenType(TokenTypeInterface $tokenType) { $this->issuer->setTokenType($tokenType); $this->checker->setTokenType($tokenType); }
[ "public", "function", "setTokenType", "(", "TokenTypeInterface", "$", "tokenType", ")", "{", "$", "this", "->", "issuer", "->", "setTokenType", "(", "$", "tokenType", ")", ";", "$", "this", "->", "checker", "->", "setTokenType", "(", "$", "tokenType", ")", ...
Set the token type to use. @param \League\OAuth2\Server\TokenType\TokenTypeInterface $tokenType
[ "Set", "the", "token", "type", "to", "use", "." ]
train
https://github.com/lucadegasperi/oauth2-server-laravel/blob/b884f6030ce562dc21838e408371b5e942a3e967/src/Authorizer.php#L304-L308
lucadegasperi/oauth2-server-laravel
src/Storage/FluentScope.php
FluentScope.get
public function get($scope, $grantType = null, $clientId = null) { $query = $this->getConnection()->table('oauth_scopes') ->select('oauth_scopes.id as id', 'oauth_scopes.description as description') ->where('oauth_scopes.id', $scope); if ($this->limitClientsT...
php
public function get($scope, $grantType = null, $clientId = null) { $query = $this->getConnection()->table('oauth_scopes') ->select('oauth_scopes.id as id', 'oauth_scopes.description as description') ->where('oauth_scopes.id', $scope); if ($this->limitClientsT...
[ "public", "function", "get", "(", "$", "scope", ",", "$", "grantType", "=", "null", ",", "$", "clientId", "=", "null", ")", "{", "$", "query", "=", "$", "this", "->", "getConnection", "(", ")", "->", "table", "(", "'oauth_scopes'", ")", "->", "select...
Return information about a scope. Example SQL query: <code> SELECT * FROM oauth_scopes WHERE scope = :scope </code> @param string $scope The scope @param string $grantType The grant type used in the request (default = "null") @param string $clientId The client id used for the request (default = "null") @return \Lea...
[ "Return", "information", "about", "a", "scope", "." ]
train
https://github.com/lucadegasperi/oauth2-server-laravel/blob/b884f6030ce562dc21838e408371b5e942a3e967/src/Storage/FluentScope.php#L108-L138
lucadegasperi/oauth2-server-laravel
src/Middleware/CheckAuthCodeRequestMiddleware.php
CheckAuthCodeRequestMiddleware.handle
public function handle($request, Closure $next) { $this->authorizer->setRequest($request); $this->authorizer->checkAuthCodeRequest(); return $next($request); }
php
public function handle($request, Closure $next) { $this->authorizer->setRequest($request); $this->authorizer->checkAuthCodeRequest(); return $next($request); }
[ "public", "function", "handle", "(", "$", "request", ",", "Closure", "$", "next", ")", "{", "$", "this", "->", "authorizer", "->", "setRequest", "(", "$", "request", ")", ";", "$", "this", "->", "authorizer", "->", "checkAuthCodeRequest", "(", ")", ";", ...
Handle an incoming request. @param \Illuminate\Http\Request $request @param \Closure $next @return mixed
[ "Handle", "an", "incoming", "request", "." ]
train
https://github.com/lucadegasperi/oauth2-server-laravel/blob/b884f6030ce562dc21838e408371b5e942a3e967/src/Middleware/CheckAuthCodeRequestMiddleware.php#L49-L56
lucadegasperi/oauth2-server-laravel
src/OAuth2ServerServiceProvider.php
OAuth2ServerServiceProvider.setupMigrations
protected function setupMigrations(Application $app) { $source = realpath(__DIR__.'/../database/migrations/'); if ($app instanceof LaravelApplication && $app->runningInConsole()) { $this->publishes([$source => database_path('migrations')], 'migrations'); } }
php
protected function setupMigrations(Application $app) { $source = realpath(__DIR__.'/../database/migrations/'); if ($app instanceof LaravelApplication && $app->runningInConsole()) { $this->publishes([$source => database_path('migrations')], 'migrations'); } }
[ "protected", "function", "setupMigrations", "(", "Application", "$", "app", ")", "{", "$", "source", "=", "realpath", "(", "__DIR__", ".", "'/../database/migrations/'", ")", ";", "if", "(", "$", "app", "instanceof", "LaravelApplication", "&&", "$", "app", "->"...
Setup the migrations. @param \Illuminate\Contracts\Container\Container $app @return void
[ "Setup", "the", "migrations", "." ]
train
https://github.com/lucadegasperi/oauth2-server-laravel/blob/b884f6030ce562dc21838e408371b5e942a3e967/src/OAuth2ServerServiceProvider.php#L76-L83
lucadegasperi/oauth2-server-laravel
src/OAuth2ServerServiceProvider.php
OAuth2ServerServiceProvider.registerAuthorizer
public function registerAuthorizer(Application $app) { $app->singleton('oauth2-server.authorizer', function ($app) { $config = $app['config']->get('oauth2'); $issuer = $app->make(AuthorizationServer::class) ->setClientStorage($app->make(ClientInterface::class)) ...
php
public function registerAuthorizer(Application $app) { $app->singleton('oauth2-server.authorizer', function ($app) { $config = $app['config']->get('oauth2'); $issuer = $app->make(AuthorizationServer::class) ->setClientStorage($app->make(ClientInterface::class)) ...
[ "public", "function", "registerAuthorizer", "(", "Application", "$", "app", ")", "{", "$", "app", "->", "singleton", "(", "'oauth2-server.authorizer'", ",", "function", "(", "$", "app", ")", "{", "$", "config", "=", "$", "app", "[", "'config'", "]", "->", ...
Register the Authorization server with the IoC container. @param \Illuminate\Contracts\Container\Container $app @return void
[ "Register", "the", "Authorization", "server", "with", "the", "IoC", "container", "." ]
train
https://github.com/lucadegasperi/oauth2-server-laravel/blob/b884f6030ce562dc21838e408371b5e942a3e967/src/OAuth2ServerServiceProvider.php#L103-L158
lucadegasperi/oauth2-server-laravel
src/OAuth2ServerServiceProvider.php
OAuth2ServerServiceProvider.registerMiddlewareBindings
public function registerMiddlewareBindings(Application $app) { $app->singleton(CheckAuthCodeRequestMiddleware::class, function ($app) { return new CheckAuthCodeRequestMiddleware($app['oauth2-server.authorizer']); }); $app->singleton(OAuthMiddleware::class, function ($app) { ...
php
public function registerMiddlewareBindings(Application $app) { $app->singleton(CheckAuthCodeRequestMiddleware::class, function ($app) { return new CheckAuthCodeRequestMiddleware($app['oauth2-server.authorizer']); }); $app->singleton(OAuthMiddleware::class, function ($app) { ...
[ "public", "function", "registerMiddlewareBindings", "(", "Application", "$", "app", ")", "{", "$", "app", "->", "singleton", "(", "CheckAuthCodeRequestMiddleware", "::", "class", ",", "function", "(", "$", "app", ")", "{", "return", "new", "CheckAuthCodeRequestMid...
Register the Middleware to the IoC container because some middleware need additional parameters. @param \Illuminate\Contracts\Container\Container $app @return void
[ "Register", "the", "Middleware", "to", "the", "IoC", "container", "because", "some", "middleware", "need", "additional", "parameters", "." ]
train
https://github.com/lucadegasperi/oauth2-server-laravel/blob/b884f6030ce562dc21838e408371b5e942a3e967/src/OAuth2ServerServiceProvider.php#L168-L187
lucadegasperi/oauth2-server-laravel
src/Storage/FluentRefreshToken.php
FluentRefreshToken.get
public function get($token) { $result = $this->getConnection()->table('oauth_refresh_tokens') ->where('oauth_refresh_tokens.id', $token) ->where('oauth_refresh_tokens.expire_time', '>=', time()) ->first(); if (is_null($result)) { return; ...
php
public function get($token) { $result = $this->getConnection()->table('oauth_refresh_tokens') ->where('oauth_refresh_tokens.id', $token) ->where('oauth_refresh_tokens.expire_time', '>=', time()) ->first(); if (is_null($result)) { return; ...
[ "public", "function", "get", "(", "$", "token", ")", "{", "$", "result", "=", "$", "this", "->", "getConnection", "(", ")", "->", "table", "(", "'oauth_refresh_tokens'", ")", "->", "where", "(", "'oauth_refresh_tokens.id'", ",", "$", "token", ")", "->", ...
Return a new instance of \League\OAuth2\Server\Entity\RefreshTokenEntity. @param string $token @return \League\OAuth2\Server\Entity\RefreshTokenEntity
[ "Return", "a", "new", "instance", "of", "\\", "League", "\\", "OAuth2", "\\", "Server", "\\", "Entity", "\\", "RefreshTokenEntity", "." ]
train
https://github.com/lucadegasperi/oauth2-server-laravel/blob/b884f6030ce562dc21838e408371b5e942a3e967/src/Storage/FluentRefreshToken.php#L32-L47
lucadegasperi/oauth2-server-laravel
src/Storage/FluentRefreshToken.php
FluentRefreshToken.create
public function create($token, $expireTime, $accessToken) { $this->getConnection()->table('oauth_refresh_tokens')->insert([ 'id' => $token, 'expire_time' => $expireTime, 'access_token_id' => $accessToken, 'created_at' => Carbon::now(), 'updated_at'...
php
public function create($token, $expireTime, $accessToken) { $this->getConnection()->table('oauth_refresh_tokens')->insert([ 'id' => $token, 'expire_time' => $expireTime, 'access_token_id' => $accessToken, 'created_at' => Carbon::now(), 'updated_at'...
[ "public", "function", "create", "(", "$", "token", ",", "$", "expireTime", ",", "$", "accessToken", ")", "{", "$", "this", "->", "getConnection", "(", ")", "->", "table", "(", "'oauth_refresh_tokens'", ")", "->", "insert", "(", "[", "'id'", "=>", "$", ...
Create a new refresh token_name. @param string $token @param int $expireTime @param string $accessToken @return \League\OAuth2\Server\Entity\RefreshTokenEntity
[ "Create", "a", "new", "refresh", "token_name", "." ]
train
https://github.com/lucadegasperi/oauth2-server-laravel/blob/b884f6030ce562dc21838e408371b5e942a3e967/src/Storage/FluentRefreshToken.php#L58-L72
lucadegasperi/oauth2-server-laravel
src/Storage/FluentRefreshToken.php
FluentRefreshToken.delete
public function delete(RefreshTokenEntity $token) { $this->getConnection()->table('oauth_refresh_tokens') ->where('id', $token->getId()) ->delete(); }
php
public function delete(RefreshTokenEntity $token) { $this->getConnection()->table('oauth_refresh_tokens') ->where('id', $token->getId()) ->delete(); }
[ "public", "function", "delete", "(", "RefreshTokenEntity", "$", "token", ")", "{", "$", "this", "->", "getConnection", "(", ")", "->", "table", "(", "'oauth_refresh_tokens'", ")", "->", "where", "(", "'id'", ",", "$", "token", "->", "getId", "(", ")", ")...
Delete the refresh token. @param \League\OAuth2\Server\Entity\RefreshTokenEntity $token @return void
[ "Delete", "the", "refresh", "token", "." ]
train
https://github.com/lucadegasperi/oauth2-server-laravel/blob/b884f6030ce562dc21838e408371b5e942a3e967/src/Storage/FluentRefreshToken.php#L81-L86
snc/SncRedisBundle
Command/RedisBaseCommand.php
RedisBaseCommand.execute
protected function execute(InputInterface $input, OutputInterface $output) { $this->input = $input; $this->output = $output; $client = $this->input->getOption('client'); try { $this->redisClient = $this->clientLocator->get('snc_redis.' . $client); } catch (Servic...
php
protected function execute(InputInterface $input, OutputInterface $output) { $this->input = $input; $this->output = $output; $client = $this->input->getOption('client'); try { $this->redisClient = $this->clientLocator->get('snc_redis.' . $client); } catch (Servic...
[ "protected", "function", "execute", "(", "InputInterface", "$", "input", ",", "OutputInterface", "$", "output", ")", "{", "$", "this", "->", "input", "=", "$", "input", ";", "$", "this", "->", "output", "=", "$", "output", ";", "$", "client", "=", "$",...
{@inheritDoc}
[ "{" ]
train
https://github.com/snc/SncRedisBundle/blob/19cd0192e4b68ddd0ba1e1be3113b98dcce8fcb2/Command/RedisBaseCommand.php#L72-L86
snc/SncRedisBundle
Command/RedisBaseCommand.php
RedisBaseCommand.proceedingAllowed
protected function proceedingAllowed(): bool { if ($this->input->getOption('no-interaction')) { return true; } return $this->getHelper('question')->ask($this->input, $this->output, new ConfirmationQuestion('<question>Are you sure you wish to flush the whole database? (y/n)</ques...
php
protected function proceedingAllowed(): bool { if ($this->input->getOption('no-interaction')) { return true; } return $this->getHelper('question')->ask($this->input, $this->output, new ConfirmationQuestion('<question>Are you sure you wish to flush the whole database? (y/n)</ques...
[ "protected", "function", "proceedingAllowed", "(", ")", ":", "bool", "{", "if", "(", "$", "this", "->", "input", "->", "getOption", "(", "'no-interaction'", ")", ")", "{", "return", "true", ";", "}", "return", "$", "this", "->", "getHelper", "(", "'quest...
Checks if either the no-interaction option was chosen or asks the user to proceed @return boolean true if either no-interaction was chosen or the user wants to proceed
[ "Checks", "if", "either", "the", "no", "-", "interaction", "option", "was", "chosen", "or", "asks", "the", "user", "to", "proceed" ]
train
https://github.com/snc/SncRedisBundle/blob/19cd0192e4b68ddd0ba1e1be3113b98dcce8fcb2/Command/RedisBaseCommand.php#L98-L105
snc/SncRedisBundle
Client/Phpredis/Client.php
Client.call
private function call($name, array $arguments = array()) { $startTime = microtime(true); $result = call_user_func_array("parent::$name", $arguments); $duration = (microtime(true) - $startTime) * 1000; if (null !== $this->logger) { $this->logger->logCommand($this->getComm...
php
private function call($name, array $arguments = array()) { $startTime = microtime(true); $result = call_user_func_array("parent::$name", $arguments); $duration = (microtime(true) - $startTime) * 1000; if (null !== $this->logger) { $this->logger->logCommand($this->getComm...
[ "private", "function", "call", "(", "$", "name", ",", "array", "$", "arguments", "=", "array", "(", ")", ")", "{", "$", "startTime", "=", "microtime", "(", "true", ")", ";", "$", "result", "=", "call_user_func_array", "(", "\"parent::$name\"", ",", "$", ...
Proxy function. @param string $name A command name @param array $arguments Lit of command arguments @throws \RuntimeException If no Redis instance is defined @return mixed
[ "Proxy", "function", "." ]
train
https://github.com/snc/SncRedisBundle/blob/19cd0192e4b68ddd0ba1e1be3113b98dcce8fcb2/Client/Phpredis/Client.php#L60-L71
snc/SncRedisBundle
Client/Phpredis/Client.php
Client.getCommandString
private function getCommandString($command, array $arguments) { $list = array(); $this->flatten($arguments, $list); return trim(strtoupper($command).' '.implode(' ', $list)); }
php
private function getCommandString($command, array $arguments) { $list = array(); $this->flatten($arguments, $list); return trim(strtoupper($command).' '.implode(' ', $list)); }
[ "private", "function", "getCommandString", "(", "$", "command", ",", "array", "$", "arguments", ")", "{", "$", "list", "=", "array", "(", ")", ";", "$", "this", "->", "flatten", "(", "$", "arguments", ",", "$", "list", ")", ";", "return", "trim", "("...
Returns a string representation of the given command including arguments. @param string $command A command name @param array $arguments List of command arguments @return string
[ "Returns", "a", "string", "representation", "of", "the", "given", "command", "including", "arguments", "." ]
train
https://github.com/snc/SncRedisBundle/blob/19cd0192e4b68ddd0ba1e1be3113b98dcce8fcb2/Client/Phpredis/Client.php#L81-L87
snc/SncRedisBundle
Client/Phpredis/Client.php
Client.flatten
private function flatten($arguments, array &$list) { foreach ($arguments as $key => $item) { if (!is_numeric($key)) { $list[] = $key; } if (is_scalar($item)) { $list[] = strval($item); } elseif (null === $item) { ...
php
private function flatten($arguments, array &$list) { foreach ($arguments as $key => $item) { if (!is_numeric($key)) { $list[] = $key; } if (is_scalar($item)) { $list[] = strval($item); } elseif (null === $item) { ...
[ "private", "function", "flatten", "(", "$", "arguments", ",", "array", "&", "$", "list", ")", "{", "foreach", "(", "$", "arguments", "as", "$", "key", "=>", "$", "item", ")", "{", "if", "(", "!", "is_numeric", "(", "$", "key", ")", ")", "{", "$",...
Flatten arguments to single dimension array. @param array $arguments An array of command arguments @param array $list Holder of results
[ "Flatten", "arguments", "to", "single", "dimension", "array", "." ]
train
https://github.com/snc/SncRedisBundle/blob/19cd0192e4b68ddd0ba1e1be3113b98dcce8fcb2/Client/Phpredis/Client.php#L95-L110
snc/SncRedisBundle
Client/Phpredis/Client.php
Client.connect
public function connect($host, $port = 6379, $timeout = 0.0, $reserved = null, $retry_interval = 0, $read_timeout = 0.0) { return $this->call('connect', func_get_args()); }
php
public function connect($host, $port = 6379, $timeout = 0.0, $reserved = null, $retry_interval = 0, $read_timeout = 0.0) { return $this->call('connect', func_get_args()); }
[ "public", "function", "connect", "(", "$", "host", ",", "$", "port", "=", "6379", ",", "$", "timeout", "=", "0.0", ",", "$", "reserved", "=", "null", ",", "$", "retry_interval", "=", "0", ",", "$", "read_timeout", "=", "0.0", ")", "{", "return", "$...
{@inheritdoc}
[ "{" ]
train
https://github.com/snc/SncRedisBundle/blob/19cd0192e4b68ddd0ba1e1be3113b98dcce8fcb2/Client/Phpredis/Client.php#L115-L118
snc/SncRedisBundle
Client/Phpredis/Client.php
Client.pconnect
public function pconnect($host, $port = 6379, $timeout = 0.0, $persistent_id = null, $retry_interval = 0, $read_timeout = 0.0) { return $this->call('pconnect', func_get_args()); }
php
public function pconnect($host, $port = 6379, $timeout = 0.0, $persistent_id = null, $retry_interval = 0, $read_timeout = 0.0) { return $this->call('pconnect', func_get_args()); }
[ "public", "function", "pconnect", "(", "$", "host", ",", "$", "port", "=", "6379", ",", "$", "timeout", "=", "0.0", ",", "$", "persistent_id", "=", "null", ",", "$", "retry_interval", "=", "0", ",", "$", "read_timeout", "=", "0.0", ")", "{", "return"...
{@inheritdoc}
[ "{" ]
train
https://github.com/snc/SncRedisBundle/blob/19cd0192e4b68ddd0ba1e1be3113b98dcce8fcb2/Client/Phpredis/Client.php#L139-L142
snc/SncRedisBundle
Client/Phpredis/Client.php
Client.popen
public function popen($host, $port = 6379, $timeout = 0.0, $persistent_id = '', $retry_interval = 0, $read_timeout = 0.0) { return $this->call('popen', func_get_args()); }
php
public function popen($host, $port = 6379, $timeout = 0.0, $persistent_id = '', $retry_interval = 0, $read_timeout = 0.0) { return $this->call('popen', func_get_args()); }
[ "public", "function", "popen", "(", "$", "host", ",", "$", "port", "=", "6379", ",", "$", "timeout", "=", "0.0", ",", "$", "persistent_id", "=", "''", ",", "$", "retry_interval", "=", "0", ",", "$", "read_timeout", "=", "0.0", ")", "{", "return", "...
{@inheritdoc}
[ "{" ]
train
https://github.com/snc/SncRedisBundle/blob/19cd0192e4b68ddd0ba1e1be3113b98dcce8fcb2/Client/Phpredis/Client.php#L147-L150
snc/SncRedisBundle
Client/Phpredis/Client.php
Client.sScan
public function sScan($key, &$iterator, $pattern = null, $count = 0) { return $this->call('sScan', array($key, &$iterator, $pattern, $count)); }
php
public function sScan($key, &$iterator, $pattern = null, $count = 0) { return $this->call('sScan', array($key, &$iterator, $pattern, $count)); }
[ "public", "function", "sScan", "(", "$", "key", ",", "&", "$", "iterator", ",", "$", "pattern", "=", "null", ",", "$", "count", "=", "0", ")", "{", "return", "$", "this", "->", "call", "(", "'sScan'", ",", "array", "(", "$", "key", ",", "&", "$...
{@inheritdoc}
[ "{" ]
train
https://github.com/snc/SncRedisBundle/blob/19cd0192e4b68ddd0ba1e1be3113b98dcce8fcb2/Client/Phpredis/Client.php#L691-L694
snc/SncRedisBundle
Client/Phpredis/Client.php
Client.bitOp
public function bitOp($operation, $retKey, $key1, $key2, $key3 = null) { return $this->call('bitOp', func_get_args()); }
php
public function bitOp($operation, $retKey, $key1, $key2, $key3 = null) { return $this->call('bitOp', func_get_args()); }
[ "public", "function", "bitOp", "(", "$", "operation", ",", "$", "retKey", ",", "$", "key1", ",", "$", "key2", ",", "$", "key3", "=", "null", ")", "{", "return", "$", "this", "->", "call", "(", "'bitOp'", ",", "func_get_args", "(", ")", ")", ";", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/snc/SncRedisBundle/blob/19cd0192e4b68ddd0ba1e1be3113b98dcce8fcb2/Client/Phpredis/Client.php#L963-L966
snc/SncRedisBundle
Client/Phpredis/Client.php
Client.zAdd
public function zAdd($key, $score1, $value1, $score2 = null, $value2 = null, $scoreN = null, $valueN = null) { return $this->call('zAdd', func_get_args()); }
php
public function zAdd($key, $score1, $value1, $score2 = null, $value2 = null, $scoreN = null, $valueN = null) { return $this->call('zAdd', func_get_args()); }
[ "public", "function", "zAdd", "(", "$", "key", ",", "$", "score1", ",", "$", "value1", ",", "$", "score2", "=", "null", ",", "$", "value2", "=", "null", ",", "$", "scoreN", "=", "null", ",", "$", "valueN", "=", "null", ")", "{", "return", "$", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/snc/SncRedisBundle/blob/19cd0192e4b68ddd0ba1e1be3113b98dcce8fcb2/Client/Phpredis/Client.php#L1075-L1078
snc/SncRedisBundle
Client/Phpredis/Client.php
Client.zRangeByLex
public function zRangeByLex($key, $min, $max, $offset = null, $limit = null) { return $this->call('zRangeByLex', func_get_args()); }
php
public function zRangeByLex($key, $min, $max, $offset = null, $limit = null) { return $this->call('zRangeByLex', func_get_args()); }
[ "public", "function", "zRangeByLex", "(", "$", "key", ",", "$", "min", ",", "$", "max", ",", "$", "offset", "=", "null", ",", "$", "limit", "=", "null", ")", "{", "return", "$", "this", "->", "call", "(", "'zRangeByLex'", ",", "func_get_args", "(", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/snc/SncRedisBundle/blob/19cd0192e4b68ddd0ba1e1be3113b98dcce8fcb2/Client/Phpredis/Client.php#L1131-L1134
snc/SncRedisBundle
Client/Phpredis/Client.php
Client.zScan
public function zScan($key, &$iterator, $pattern = null, $count = 0) { return $this->call('zScan', array($key, &$iterator, $pattern, $count)); }
php
public function zScan($key, &$iterator, $pattern = null, $count = 0) { return $this->call('zScan', array($key, &$iterator, $pattern, $count)); }
[ "public", "function", "zScan", "(", "$", "key", ",", "&", "$", "iterator", ",", "$", "pattern", "=", "null", ",", "$", "count", "=", "0", ")", "{", "return", "$", "this", "->", "call", "(", "'zScan'", ",", "array", "(", "$", "key", ",", "&", "$...
{@inheritdoc}
[ "{" ]
train
https://github.com/snc/SncRedisBundle/blob/19cd0192e4b68ddd0ba1e1be3113b98dcce8fcb2/Client/Phpredis/Client.php#L1251-L1254
snc/SncRedisBundle
Client/Phpredis/Client.php
Client.hScan
public function hScan($key, &$iterator, $pattern = null, $count = 0) { return $this->call('hScan', array($key, &$iterator, $pattern, $count)); }
php
public function hScan($key, &$iterator, $pattern = null, $count = 0) { return $this->call('hScan', array($key, &$iterator, $pattern, $count)); }
[ "public", "function", "hScan", "(", "$", "key", ",", "&", "$", "iterator", ",", "$", "pattern", "=", "null", ",", "$", "count", "=", "0", ")", "{", "return", "$", "this", "->", "call", "(", "'hScan'", ",", "array", "(", "$", "key", ",", "&", "$...
{@inheritdoc}
[ "{" ]
train
https://github.com/snc/SncRedisBundle/blob/19cd0192e4b68ddd0ba1e1be3113b98dcce8fcb2/Client/Phpredis/Client.php#L1363-L1366
snc/SncRedisBundle
Client/Phpredis/Client.php
Client.migrate
public function migrate($host, $port, $key, $db, $timeout, $copy = false, $replace = false) { return $this->call('migrate', func_get_args()); }
php
public function migrate($host, $port, $key, $db, $timeout, $copy = false, $replace = false) { return $this->call('migrate', func_get_args()); }
[ "public", "function", "migrate", "(", "$", "host", ",", "$", "port", ",", "$", "key", ",", "$", "db", ",", "$", "timeout", ",", "$", "copy", "=", "false", ",", "$", "replace", "=", "false", ")", "{", "return", "$", "this", "->", "call", "(", "'...
{@inheritdoc}
[ "{" ]
train
https://github.com/snc/SncRedisBundle/blob/19cd0192e4b68ddd0ba1e1be3113b98dcce8fcb2/Client/Phpredis/Client.php#L1467-L1470
snc/SncRedisBundle
Client/Phpredis/Client.php
Client.scan
public function scan(&$iterator, $pattern = null, $count = 0) { return $this->call('scan', array($key, &$iterator, $pattern, $count)); }
php
public function scan(&$iterator, $pattern = null, $count = 0) { return $this->call('scan', array($key, &$iterator, $pattern, $count)); }
[ "public", "function", "scan", "(", "&", "$", "iterator", ",", "$", "pattern", "=", "null", ",", "$", "count", "=", "0", ")", "{", "return", "$", "this", "->", "call", "(", "'scan'", ",", "array", "(", "$", "key", ",", "&", "$", "iterator", ",", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/snc/SncRedisBundle/blob/19cd0192e4b68ddd0ba1e1be3113b98dcce8fcb2/Client/Phpredis/Client.php#L1483-L1486
snc/SncRedisBundle
Client/Phpredis/Client.php
Client.xClaim
public function xClaim($str_key, $str_group, $str_consumer, $min_idle_time, $arr_ids, $arr_options = []) { return $this->call('xClaim', func_get_args()); }
php
public function xClaim($str_key, $str_group, $str_consumer, $min_idle_time, $arr_ids, $arr_options = []) { return $this->call('xClaim', func_get_args()); }
[ "public", "function", "xClaim", "(", "$", "str_key", ",", "$", "str_group", ",", "$", "str_consumer", ",", "$", "min_idle_time", ",", "$", "arr_ids", ",", "$", "arr_options", "=", "[", "]", ")", "{", "return", "$", "this", "->", "call", "(", "'xClaim'"...
{@inheritdoc}
[ "{" ]
train
https://github.com/snc/SncRedisBundle/blob/19cd0192e4b68ddd0ba1e1be3113b98dcce8fcb2/Client/Phpredis/Client.php#L1547-L1550
snc/SncRedisBundle
Client/Phpredis/Client.php
Client.xPending
public function xPending($str_stream, $str_group, $str_start = null, $str_end = null, $i_count = null, $str_consumer = null) { return $this->call('xPending', func_get_args()); }
php
public function xPending($str_stream, $str_group, $str_start = null, $str_end = null, $i_count = null, $str_consumer = null) { return $this->call('xPending', func_get_args()); }
[ "public", "function", "xPending", "(", "$", "str_stream", ",", "$", "str_group", ",", "$", "str_start", "=", "null", ",", "$", "str_end", "=", "null", ",", "$", "i_count", "=", "null", ",", "$", "str_consumer", "=", "null", ")", "{", "return", "$", "...
{@inheritdoc}
[ "{" ]
train
https://github.com/snc/SncRedisBundle/blob/19cd0192e4b68ddd0ba1e1be3113b98dcce8fcb2/Client/Phpredis/Client.php#L1587-L1590
snc/SncRedisBundle
Client/Phpredis/Client.php
Client.xReadGroup
public function xReadGroup($str_group, $str_consumer, $arr_streams, $i_count, $i_block = null) { return $this->call('xReadGroup', func_get_args()); }
php
public function xReadGroup($str_group, $str_consumer, $arr_streams, $i_count, $i_block = null) { return $this->call('xReadGroup', func_get_args()); }
[ "public", "function", "xReadGroup", "(", "$", "str_group", ",", "$", "str_consumer", ",", "$", "arr_streams", ",", "$", "i_count", ",", "$", "i_block", "=", "null", ")", "{", "return", "$", "this", "->", "call", "(", "'xReadGroup'", ",", "func_get_args", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/snc/SncRedisBundle/blob/19cd0192e4b68ddd0ba1e1be3113b98dcce8fcb2/Client/Phpredis/Client.php#L1611-L1614
snc/SncRedisBundle
DependencyInjection/SncRedisExtension.php
SncRedisExtension.load
public function load(array $configs, ContainerBuilder $container) { $loader = new XmlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config')); $loader->load('redis.xml'); $mainConfig = $this->getConfiguration($configs, $container); $config = $this->processConfigurat...
php
public function load(array $configs, ContainerBuilder $container) { $loader = new XmlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config')); $loader->load('redis.xml'); $mainConfig = $this->getConfiguration($configs, $container); $config = $this->processConfigurat...
[ "public", "function", "load", "(", "array", "$", "configs", ",", "ContainerBuilder", "$", "container", ")", "{", "$", "loader", "=", "new", "XmlFileLoader", "(", "$", "container", ",", "new", "FileLocator", "(", "__DIR__", ".", "'/../Resources/config'", ")", ...
Loads the configuration. @param array $configs An array of configurations @param ContainerBuilder $container A ContainerBuilder instance @throws InvalidConfigurationException
[ "Loads", "the", "configuration", "." ]
train
https://github.com/snc/SncRedisBundle/blob/19cd0192e4b68ddd0ba1e1be3113b98dcce8fcb2/DependencyInjection/SncRedisExtension.php#L37-L75
snc/SncRedisBundle
DependencyInjection/SncRedisExtension.php
SncRedisExtension.loadClient
protected function loadClient(array $client, ContainerBuilder $container) { $dsnResolver = function ($dsn) use ($container) { $usedEnvs = null; if (method_exists($container, 'resolveEnvPlaceholders')) { $container->resolveEnvPlaceholders($dsn, null, $usedEnvs); ...
php
protected function loadClient(array $client, ContainerBuilder $container) { $dsnResolver = function ($dsn) use ($container) { $usedEnvs = null; if (method_exists($container, 'resolveEnvPlaceholders')) { $container->resolveEnvPlaceholders($dsn, null, $usedEnvs); ...
[ "protected", "function", "loadClient", "(", "array", "$", "client", ",", "ContainerBuilder", "$", "container", ")", "{", "$", "dsnResolver", "=", "function", "(", "$", "dsn", ")", "use", "(", "$", "container", ")", "{", "$", "usedEnvs", "=", "null", ";",...
Loads a redis client. @param array $client A client configuration @param ContainerBuilder $container A ContainerBuilder instance
[ "Loads", "a", "redis", "client", "." ]
train
https://github.com/snc/SncRedisBundle/blob/19cd0192e4b68ddd0ba1e1be3113b98dcce8fcb2/DependencyInjection/SncRedisExtension.php#L99-L130
snc/SncRedisBundle
DependencyInjection/SncRedisExtension.php
SncRedisExtension.loadPredisClient
protected function loadPredisClient(array $client, ContainerBuilder $container) { if (null === $client['options']['cluster']) { unset($client['options']['cluster']); } else { unset($client['options']['replication']); } // predis connection parameters have bee...
php
protected function loadPredisClient(array $client, ContainerBuilder $container) { if (null === $client['options']['cluster']) { unset($client['options']['cluster']); } else { unset($client['options']['replication']); } // predis connection parameters have bee...
[ "protected", "function", "loadPredisClient", "(", "array", "$", "client", ",", "ContainerBuilder", "$", "container", ")", "{", "if", "(", "null", "===", "$", "client", "[", "'options'", "]", "[", "'cluster'", "]", ")", "{", "unset", "(", "$", "client", "...
Loads a redis client using predis. @param array $client A client configuration @param ContainerBuilder $container A ContainerBuilder instance
[ "Loads", "a", "redis", "client", "using", "predis", "." ]
train
https://github.com/snc/SncRedisBundle/blob/19cd0192e4b68ddd0ba1e1be3113b98dcce8fcb2/DependencyInjection/SncRedisExtension.php#L138-L213
snc/SncRedisBundle
DependencyInjection/SncRedisExtension.php
SncRedisExtension.loadPredisConnectionParameters
protected function loadPredisConnectionParameters($clientAlias, array $connection, ContainerBuilder $container, $dsn) { $parametersClass = $container->getParameter('snc_redis.connection_parameters.class'); $parameterId = sprintf('snc_redis.connection.%s_parameters.%s', $connection['alias'], $clientA...
php
protected function loadPredisConnectionParameters($clientAlias, array $connection, ContainerBuilder $container, $dsn) { $parametersClass = $container->getParameter('snc_redis.connection_parameters.class'); $parameterId = sprintf('snc_redis.connection.%s_parameters.%s', $connection['alias'], $clientA...
[ "protected", "function", "loadPredisConnectionParameters", "(", "$", "clientAlias", ",", "array", "$", "connection", ",", "ContainerBuilder", "$", "container", ",", "$", "dsn", ")", "{", "$", "parametersClass", "=", "$", "container", "->", "getParameter", "(", "...
Loads a connection. @param string $clientAlias The client alias @param array $connection A connection configuration @param ContainerBuilder $container A ContainerBuilder instance @param RedisEnvDsn|RedisDsn $dsn DSN object
[ "Loads", "a", "connection", "." ]
train
https://github.com/snc/SncRedisBundle/blob/19cd0192e4b68ddd0ba1e1be3113b98dcce8fcb2/DependencyInjection/SncRedisExtension.php#L223-L236
snc/SncRedisBundle
DependencyInjection/SncRedisExtension.php
SncRedisExtension.loadPhpredisClient
protected function loadPhpredisClient(array $client, ContainerBuilder $container) { $connectionCount = count($client['dsns']); if (1 !== $connectionCount) { throw new \RuntimeException('Support for RedisArray is not yet implemented.'); } /** @var \Snc\RedisBundle\Depend...
php
protected function loadPhpredisClient(array $client, ContainerBuilder $container) { $connectionCount = count($client['dsns']); if (1 !== $connectionCount) { throw new \RuntimeException('Support for RedisArray is not yet implemented.'); } /** @var \Snc\RedisBundle\Depend...
[ "protected", "function", "loadPhpredisClient", "(", "array", "$", "client", ",", "ContainerBuilder", "$", "container", ")", "{", "$", "connectionCount", "=", "count", "(", "$", "client", "[", "'dsns'", "]", ")", ";", "if", "(", "1", "!==", "$", "connection...
Loads a redis client using phpredis. @param array $client A client configuration @param ContainerBuilder $container A ContainerBuilder instance @throws \RuntimeException
[ "Loads", "a", "redis", "client", "using", "phpredis", "." ]
train
https://github.com/snc/SncRedisBundle/blob/19cd0192e4b68ddd0ba1e1be3113b98dcce8fcb2/DependencyInjection/SncRedisExtension.php#L246-L292
snc/SncRedisBundle
DependencyInjection/SncRedisExtension.php
SncRedisExtension.loadSession
protected function loadSession(array $config, ContainerBuilder $container, XmlFileLoader $loader) { $loader->load('session.xml'); $container->setParameter('snc_redis.session.client', $config['session']['client']); $container->setParameter('snc_redis.session.prefix', $config['session']['pref...
php
protected function loadSession(array $config, ContainerBuilder $container, XmlFileLoader $loader) { $loader->load('session.xml'); $container->setParameter('snc_redis.session.client', $config['session']['client']); $container->setParameter('snc_redis.session.prefix', $config['session']['pref...
[ "protected", "function", "loadSession", "(", "array", "$", "config", ",", "ContainerBuilder", "$", "container", ",", "XmlFileLoader", "$", "loader", ")", "{", "$", "loader", "->", "load", "(", "'session.xml'", ")", ";", "$", "container", "->", "setParameter", ...
Loads the session configuration. @param array $config A configuration array @param ContainerBuilder $container A ContainerBuilder instance @param XmlFileLoader $loader A XmlFileLoader instance
[ "Loads", "the", "session", "configuration", "." ]
train
https://github.com/snc/SncRedisBundle/blob/19cd0192e4b68ddd0ba1e1be3113b98dcce8fcb2/DependencyInjection/SncRedisExtension.php#L301-L320
snc/SncRedisBundle
DependencyInjection/SncRedisExtension.php
SncRedisExtension.loadDoctrine
protected function loadDoctrine(array $config, ContainerBuilder $container) { foreach ($config['doctrine'] as $name => $cache) { if (empty($cache['entity_managers']) && empty($cache['document_managers'])) { throw new InvalidConfigurationException(sprintf('Enabling the doctrine %s...
php
protected function loadDoctrine(array $config, ContainerBuilder $container) { foreach ($config['doctrine'] as $name => $cache) { if (empty($cache['entity_managers']) && empty($cache['document_managers'])) { throw new InvalidConfigurationException(sprintf('Enabling the doctrine %s...
[ "protected", "function", "loadDoctrine", "(", "array", "$", "config", ",", "ContainerBuilder", "$", "container", ")", "{", "foreach", "(", "$", "config", "[", "'doctrine'", "]", "as", "$", "name", "=>", "$", "cache", ")", "{", "if", "(", "empty", "(", ...
Loads the Doctrine configuration. @param array $config A configuration array @param ContainerBuilder $container A ContainerBuilder instance
[ "Loads", "the", "Doctrine", "configuration", "." ]
train
https://github.com/snc/SncRedisBundle/blob/19cd0192e4b68ddd0ba1e1be3113b98dcce8fcb2/DependencyInjection/SncRedisExtension.php#L328-L374
snc/SncRedisBundle
DependencyInjection/SncRedisExtension.php
SncRedisExtension.loadMonolog
protected function loadMonolog(array $config, ContainerBuilder $container) { if ('phpredis' === $config['clients'][$config['monolog']['client']]['type']) { $ref = new Reference(sprintf('snc_redis.phpredis.%s', $config['monolog']['client'])); } else { $ref = new Reference(spri...
php
protected function loadMonolog(array $config, ContainerBuilder $container) { if ('phpredis' === $config['clients'][$config['monolog']['client']]['type']) { $ref = new Reference(sprintf('snc_redis.phpredis.%s', $config['monolog']['client'])); } else { $ref = new Reference(spri...
[ "protected", "function", "loadMonolog", "(", "array", "$", "config", ",", "ContainerBuilder", "$", "container", ")", "{", "if", "(", "'phpredis'", "===", "$", "config", "[", "'clients'", "]", "[", "$", "config", "[", "'monolog'", "]", "[", "'client'", "]",...
Loads the Monolog configuration. @param array $config A configuration array @param ContainerBuilder $container A ContainerBuilder instance
[ "Loads", "the", "Monolog", "configuration", "." ]
train
https://github.com/snc/SncRedisBundle/blob/19cd0192e4b68ddd0ba1e1be3113b98dcce8fcb2/DependencyInjection/SncRedisExtension.php#L382-L400
snc/SncRedisBundle
DependencyInjection/SncRedisExtension.php
SncRedisExtension.loadSwiftMailer
protected function loadSwiftMailer(array $config, ContainerBuilder $container) { $def = new Definition($container->getParameter('snc_redis.swiftmailer_spool.class')); $def->setPublic(false); $def->addMethodCall('setRedis', array(new Reference(sprintf('snc_redis.%s', $config['swiftmailer']['c...
php
protected function loadSwiftMailer(array $config, ContainerBuilder $container) { $def = new Definition($container->getParameter('snc_redis.swiftmailer_spool.class')); $def->setPublic(false); $def->addMethodCall('setRedis', array(new Reference(sprintf('snc_redis.%s', $config['swiftmailer']['c...
[ "protected", "function", "loadSwiftMailer", "(", "array", "$", "config", ",", "ContainerBuilder", "$", "container", ")", "{", "$", "def", "=", "new", "Definition", "(", "$", "container", "->", "getParameter", "(", "'snc_redis.swiftmailer_spool.class'", ")", ")", ...
Loads the SwiftMailer configuration. @param array $config A configuration array @param ContainerBuilder $container A ContainerBuilder instance
[ "Loads", "the", "SwiftMailer", "configuration", "." ]
train
https://github.com/snc/SncRedisBundle/blob/19cd0192e4b68ddd0ba1e1be3113b98dcce8fcb2/DependencyInjection/SncRedisExtension.php#L408-L416
snc/SncRedisBundle
DependencyInjection/SncRedisExtension.php
SncRedisExtension.loadProfilerStorage
protected function loadProfilerStorage(array $config, ContainerBuilder $container, XmlFileLoader $loader) { $loader->load('profiler_storage.xml'); $container->setParameter('snc_redis.profiler_storage.client', $config['profiler_storage']['client']); $container->setParameter('snc_redis.profil...
php
protected function loadProfilerStorage(array $config, ContainerBuilder $container, XmlFileLoader $loader) { $loader->load('profiler_storage.xml'); $container->setParameter('snc_redis.profiler_storage.client', $config['profiler_storage']['client']); $container->setParameter('snc_redis.profil...
[ "protected", "function", "loadProfilerStorage", "(", "array", "$", "config", ",", "ContainerBuilder", "$", "container", ",", "XmlFileLoader", "$", "loader", ")", "{", "$", "loader", "->", "load", "(", "'profiler_storage.xml'", ")", ";", "$", "container", "->", ...
/* Loads the profiler storage configuration. @param array $config A configuration array @param ContainerBuilder $container A ContainerBuilder instance @param XmlFileLoader $loader A XmlFileLoader instance
[ "/", "*", "Loads", "the", "profiler", "storage", "configuration", "." ]
train
https://github.com/snc/SncRedisBundle/blob/19cd0192e4b68ddd0ba1e1be3113b98dcce8fcb2/DependencyInjection/SncRedisExtension.php#L424-L434
snc/SncRedisBundle
DependencyInjection/Compiler/ClientLocatorPass.php
ClientLocatorPass.process
public function process(ContainerBuilder $container) { $this->checkForExistingLocatorService($container); $clientDefinitions = $this->getRedisClientDefinitions($container); $clients = $this->generateServiceClosures($clientDefinitions); $clientLocatorDefinition = $this->createClien...
php
public function process(ContainerBuilder $container) { $this->checkForExistingLocatorService($container); $clientDefinitions = $this->getRedisClientDefinitions($container); $clients = $this->generateServiceClosures($clientDefinitions); $clientLocatorDefinition = $this->createClien...
[ "public", "function", "process", "(", "ContainerBuilder", "$", "container", ")", "{", "$", "this", "->", "checkForExistingLocatorService", "(", "$", "container", ")", ";", "$", "clientDefinitions", "=", "$", "this", "->", "getRedisClientDefinitions", "(", "$", "...
{@inheritdoc}
[ "{" ]
train
https://github.com/snc/SncRedisBundle/blob/19cd0192e4b68ddd0ba1e1be3113b98dcce8fcb2/DependencyInjection/Compiler/ClientLocatorPass.php#L32-L43
snc/SncRedisBundle
DependencyInjection/Compiler/ClientLocatorPass.php
ClientLocatorPass.generateServiceClosures
private function generateServiceClosures(array $clientDefinitions): array { $clients = []; foreach (array_keys($clientDefinitions) as $key) { $clients[$key] = new ServiceClosureArgument(new Reference($key)); } return $clients; }
php
private function generateServiceClosures(array $clientDefinitions): array { $clients = []; foreach (array_keys($clientDefinitions) as $key) { $clients[$key] = new ServiceClosureArgument(new Reference($key)); } return $clients; }
[ "private", "function", "generateServiceClosures", "(", "array", "$", "clientDefinitions", ")", ":", "array", "{", "$", "clients", "=", "[", "]", ";", "foreach", "(", "array_keys", "(", "$", "clientDefinitions", ")", "as", "$", "key", ")", "{", "$", "client...
@param array $clientDefinitions @return array
[ "@param", "array", "$clientDefinitions" ]
train
https://github.com/snc/SncRedisBundle/blob/19cd0192e4b68ddd0ba1e1be3113b98dcce8fcb2/DependencyInjection/Compiler/ClientLocatorPass.php#L77-L85