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 |
|---|---|---|---|---|---|---|---|---|---|---|
voryx/Thruway | src/Authentication/AuthenticationManager.php | AuthenticationManager.handleAuthenticateMessage | public function handleAuthenticateMessage(Realm $realm, Session $session, AuthenticateMessage $msg)
{
if ($session->getAuthenticationDetails() === null) {
throw new \Exception('Authenticate with no previous auth details');
}
$authMethod = $session->getAuthenticationDetails()->ge... | php | public function handleAuthenticateMessage(Realm $realm, Session $session, AuthenticateMessage $msg)
{
if ($session->getAuthenticationDetails() === null) {
throw new \Exception('Authenticate with no previous auth details');
}
$authMethod = $session->getAuthenticationDetails()->ge... | [
"public",
"function",
"handleAuthenticateMessage",
"(",
"Realm",
"$",
"realm",
",",
"Session",
"$",
"session",
",",
"AuthenticateMessage",
"$",
"msg",
")",
"{",
"if",
"(",
"$",
"session",
"->",
"getAuthenticationDetails",
"(",
")",
"===",
"null",
")",
"{",
"... | Handle Authenticate message
@param \Thruway\Realm $realm
@param \Thruway\Session $session
@param \Thruway\Message\AuthenticateMessage $msg
@throws \Exception | [
"Handle",
"Authenticate",
"message"
] | train | https://github.com/voryx/Thruway/blob/b86c0cddbec8fb69ff583e093d4cc169011fcbfb/src/Authentication/AuthenticationManager.php#L329-L343 |
voryx/Thruway | src/Authentication/AuthenticationManager.php | AuthenticationManager.onAuthenticateHandler | private function onAuthenticateHandler($authMethod, $authMethodInfo, Realm $realm, Session $session, AuthenticateMessage $msg)
{
$onAuthenticateSuccess = function ($res) use ($realm, $session) {
if (count($res) < 1) {
$session->abort(new \stdClass(), 'thruway.error.authenticati... | php | private function onAuthenticateHandler($authMethod, $authMethodInfo, Realm $realm, Session $session, AuthenticateMessage $msg)
{
$onAuthenticateSuccess = function ($res) use ($realm, $session) {
if (count($res) < 1) {
$session->abort(new \stdClass(), 'thruway.error.authenticati... | [
"private",
"function",
"onAuthenticateHandler",
"(",
"$",
"authMethod",
",",
"$",
"authMethodInfo",
",",
"Realm",
"$",
"realm",
",",
"Session",
"$",
"session",
",",
"AuthenticateMessage",
"$",
"msg",
")",
"{",
"$",
"onAuthenticateSuccess",
"=",
"function",
"(",
... | Call the handler that was registered to handle the Authenticate Message
@param $authMethod
@param $authMethodInfo
@param Realm $realm
@param Session $session
@param AuthenticateMessage $msg | [
"Call",
"the",
"handler",
"that",
"was",
"registered",
"to",
"handle",
"the",
"Authenticate",
"Message"
] | train | https://github.com/voryx/Thruway/blob/b86c0cddbec8fb69ff583e093d4cc169011fcbfb/src/Authentication/AuthenticationManager.php#L354-L399 |
voryx/Thruway | src/Authentication/AuthenticationManager.php | AuthenticationManager.registerAuthMethod | public function registerAuthMethod(array $args, $kwargs, $details)
{
// TODO: should return different error
if (!is_array($args)) {
return ['Received non-array arguments in registerAuthMethod'];
}
if (count($args) < 2) {
return ['Not enough arguments sent to... | php | public function registerAuthMethod(array $args, $kwargs, $details)
{
// TODO: should return different error
if (!is_array($args)) {
return ['Received non-array arguments in registerAuthMethod'];
}
if (count($args) < 2) {
return ['Not enough arguments sent to... | [
"public",
"function",
"registerAuthMethod",
"(",
"array",
"$",
"args",
",",
"$",
"kwargs",
",",
"$",
"details",
")",
"{",
"// TODO: should return different error",
"if",
"(",
"!",
"is_array",
"(",
"$",
"args",
")",
")",
"{",
"return",
"[",
"'Received non-array... | This is called via a WAMP RPC URI. It is registered as thruway.auth.registermethod
it takes arguments in an array - ["methodName", ["realm1", "realm2", "*"],
@param array $args
@param array $kwargs
@param array $details
@return array | [
"This",
"is",
"called",
"via",
"a",
"WAMP",
"RPC",
"URI",
".",
"It",
"is",
"registered",
"as",
"thruway",
".",
"auth",
".",
"registermethod",
"it",
"takes",
"arguments",
"in",
"an",
"array",
"-",
"[",
"methodName",
"[",
"realm1",
"realm2",
"*",
"]"
] | train | https://github.com/voryx/Thruway/blob/b86c0cddbec8fb69ff583e093d4cc169011fcbfb/src/Authentication/AuthenticationManager.php#L454-L494 |
voryx/Thruway | src/Authentication/AuthenticationManager.php | AuthenticationManager.realmHasAuthProvider | private function realmHasAuthProvider($realmName)
{
foreach ($this->authMethods as $authMethod) {
foreach ($authMethod['auth_realms'] as $authRealm) {
if ($authRealm === "*" || $authRealm === $realmName) {
return true;
}
}
}... | php | private function realmHasAuthProvider($realmName)
{
foreach ($this->authMethods as $authMethod) {
foreach ($authMethod['auth_realms'] as $authRealm) {
if ($authRealm === "*" || $authRealm === $realmName) {
return true;
}
}
}... | [
"private",
"function",
"realmHasAuthProvider",
"(",
"$",
"realmName",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"authMethods",
"as",
"$",
"authMethod",
")",
"{",
"foreach",
"(",
"$",
"authMethod",
"[",
"'auth_realms'",
"]",
"as",
"$",
"authRealm",
")",
... | Checks to see if a realm has a registered auth provider
@param string $realmName
@return boolean | [
"Checks",
"to",
"see",
"if",
"a",
"realm",
"has",
"a",
"registered",
"auth",
"provider"
] | train | https://github.com/voryx/Thruway/blob/b86c0cddbec8fb69ff583e093d4cc169011fcbfb/src/Authentication/AuthenticationManager.php#L502-L513 |
voryx/Thruway | src/Authentication/AuthenticationManager.php | AuthenticationManager.onSessionClose | public function onSessionClose(Session $session)
{
if ($session->getRealm() && $session->getRealm()->getRealmName() === 'thruway.auth') {
// session is closing in the auth domain
// check and see if there are any registrations that came from this session
$sessionId = $ses... | php | public function onSessionClose(Session $session)
{
if ($session->getRealm() && $session->getRealm()->getRealmName() === 'thruway.auth') {
// session is closing in the auth domain
// check and see if there are any registrations that came from this session
$sessionId = $ses... | [
"public",
"function",
"onSessionClose",
"(",
"Session",
"$",
"session",
")",
"{",
"if",
"(",
"$",
"session",
"->",
"getRealm",
"(",
")",
"&&",
"$",
"session",
"->",
"getRealm",
"(",
")",
"->",
"getRealmName",
"(",
")",
"===",
"'thruway.auth'",
")",
"{",
... | This allows the AuthenticationManager to clean out auth methods that were registered by
sessions that are dieing. Otherwise the method could be hijacked by another client in the
thruway.auth realm.
@param \Thruway\Session $session | [
"This",
"allows",
"the",
"AuthenticationManager",
"to",
"clean",
"out",
"auth",
"methods",
"that",
"were",
"registered",
"by",
"sessions",
"that",
"are",
"dieing",
".",
"Otherwise",
"the",
"method",
"could",
"be",
"hijacked",
"by",
"another",
"client",
"in",
"... | train | https://github.com/voryx/Thruway/blob/b86c0cddbec8fb69ff583e093d4cc169011fcbfb/src/Authentication/AuthenticationManager.php#L522-L535 |
voryx/Thruway | src/Authentication/AuthenticationManager.php | AuthenticationManager.abortSessionUsingResponse | private function abortSessionUsingResponse(Session $session, $response)
{
// $response needs to be a failure
if (!isset($response[0]) || $response[0] !== 'FAILURE') {
return false;
}
if (!isset($response[1]) || !is_object($response[1])) {
// there are no othe... | php | private function abortSessionUsingResponse(Session $session, $response)
{
// $response needs to be a failure
if (!isset($response[0]) || $response[0] !== 'FAILURE') {
return false;
}
if (!isset($response[1]) || !is_object($response[1])) {
// there are no othe... | [
"private",
"function",
"abortSessionUsingResponse",
"(",
"Session",
"$",
"session",
",",
"$",
"response",
")",
"{",
"// $response needs to be a failure",
"if",
"(",
"!",
"isset",
"(",
"$",
"response",
"[",
"0",
"]",
")",
"||",
"$",
"response",
"[",
"0",
"]",... | Send an abort message to the session if the Authenticator sent a FAILURE response
Returns true if the abort was sent, false otherwise
@param Session $session
@param $response
@return bool
@throws \Exception | [
"Send",
"an",
"abort",
"message",
"to",
"the",
"session",
"if",
"the",
"Authenticator",
"sent",
"a",
"FAILURE",
"response",
"Returns",
"true",
"if",
"the",
"abort",
"was",
"sent",
"false",
"otherwise"
] | train | https://github.com/voryx/Thruway/blob/b86c0cddbec8fb69ff583e093d4cc169011fcbfb/src/Authentication/AuthenticationManager.php#L586-L611 |
voryx/Thruway | Examples/100Clients/RelayClient.php | RelayClient.theFunction | public function theFunction()
{
$futureResult = new \React\Promise\Deferred();
$this->session->call('com.example.thefunction' . ($this->number + 1), [])
->then(function ($res) use ($futureResult) {
if (is_scalar($res[0])) {
$res[0] = $res[0] . ".";
... | php | public function theFunction()
{
$futureResult = new \React\Promise\Deferred();
$this->session->call('com.example.thefunction' . ($this->number + 1), [])
->then(function ($res) use ($futureResult) {
if (is_scalar($res[0])) {
$res[0] = $res[0] . ".";
... | [
"public",
"function",
"theFunction",
"(",
")",
"{",
"$",
"futureResult",
"=",
"new",
"\\",
"React",
"\\",
"Promise",
"\\",
"Deferred",
"(",
")",
";",
"$",
"this",
"->",
"session",
"->",
"call",
"(",
"'com.example.thefunction'",
".",
"(",
"$",
"this",
"->... | Handle for RPC 'com.example.thefunction{$number}'
@return \React\Promise\Promise | [
"Handle",
"for",
"RPC",
"com",
".",
"example",
".",
"thefunction",
"{",
"$number",
"}"
] | train | https://github.com/voryx/Thruway/blob/b86c0cddbec8fb69ff583e093d4cc169011fcbfb/Examples/100Clients/RelayClient.php#L39-L52 |
voryx/Thruway | Examples/100Clients/RelayClient.php | RelayClient.onSessionStart | public function onSessionStart($session, $transport)
{
$session->register('com.example.thefunction' . $this->number, [$this, 'theFunction'])
->then(function () {
$this->registeredDeferred->resolve();
});
} | php | public function onSessionStart($session, $transport)
{
$session->register('com.example.thefunction' . $this->number, [$this, 'theFunction'])
->then(function () {
$this->registeredDeferred->resolve();
});
} | [
"public",
"function",
"onSessionStart",
"(",
"$",
"session",
",",
"$",
"transport",
")",
"{",
"$",
"session",
"->",
"register",
"(",
"'com.example.thefunction'",
".",
"$",
"this",
"->",
"number",
",",
"[",
"$",
"this",
",",
"'theFunction'",
"]",
")",
"->",... | Handle on session start
@param \Thruway\ClientSession $session
@param \Thruway\Transport\TransportInterface $transport | [
"Handle",
"on",
"session",
"start"
] | train | https://github.com/voryx/Thruway/blob/b86c0cddbec8fb69ff583e093d4cc169011fcbfb/Examples/100Clients/RelayClient.php#L60-L66 |
voryx/Thruway | src/Transport/InternalClientTransport.php | InternalClientTransport.sendMessage | public function sendMessage(Message $msg)
{
if (is_callable($this->sendMessageFunction)) {
call_user_func_array($this->sendMessageFunction, [$msg]);
}
} | php | public function sendMessage(Message $msg)
{
if (is_callable($this->sendMessageFunction)) {
call_user_func_array($this->sendMessageFunction, [$msg]);
}
} | [
"public",
"function",
"sendMessage",
"(",
"Message",
"$",
"msg",
")",
"{",
"if",
"(",
"is_callable",
"(",
"$",
"this",
"->",
"sendMessageFunction",
")",
")",
"{",
"call_user_func_array",
"(",
"$",
"this",
"->",
"sendMessageFunction",
",",
"[",
"$",
"msg",
... | Send message
@param \Thruway\Message\Message $msg
@throws \Exception | [
"Send",
"message"
] | train | https://github.com/voryx/Thruway/blob/b86c0cddbec8fb69ff583e093d4cc169011fcbfb/src/Transport/InternalClientTransport.php#L33-L38 |
dirkgroenen/Pinterest-API-PHP | src/Pinterest/Utils/CurlBuilder.php | CurlBuilder.execFollow | private function execFollow() {
$mr = 5;
$body = null;
if (ini_get("open_basedir") == "" && ini_get("safe_mode" == "Off")) {
$this->setOptions(array(
CURLOPT_FOLLOWLOCATION => $mr > 0,
CURLOPT_MAXREDIRS => $mr
));
} else {
... | php | private function execFollow() {
$mr = 5;
$body = null;
if (ini_get("open_basedir") == "" && ini_get("safe_mode" == "Off")) {
$this->setOptions(array(
CURLOPT_FOLLOWLOCATION => $mr > 0,
CURLOPT_MAXREDIRS => $mr
));
} else {
... | [
"private",
"function",
"execFollow",
"(",
")",
"{",
"$",
"mr",
"=",
"5",
";",
"$",
"body",
"=",
"null",
";",
"if",
"(",
"ini_get",
"(",
"\"open_basedir\"",
")",
"==",
"\"\"",
"&&",
"ini_get",
"(",
"\"safe_mode\"",
"==",
"\"Off\"",
")",
")",
"{",
"$",... | Function which acts as a replacement for curl's default
FOLLOW_LOCATION option, since that gives errors when
combining it with open basedir.
@see http://slopjong.de/2012/03/31/curl-follow-locations-with-safe_mode-enabled-or-open_basedir-set/
@access private
@return false|string | [
"Function",
"which",
"acts",
"as",
"a",
"replacement",
"for",
"curl",
"s",
"default",
"FOLLOW_LOCATION",
"option",
"since",
"that",
"gives",
"errors",
"when",
"combining",
"it",
"with",
"open",
"basedir",
"."
] | train | https://github.com/dirkgroenen/Pinterest-API-PHP/blob/2dcffb7d4f4ffbc9a43ea962d79ebcda3b06efce/src/Pinterest/Utils/CurlBuilder.php#L184-L252 |
dirkgroenen/Pinterest-API-PHP | src/Pinterest/Endpoints/Following.php | Following.users | public function users(array $data = [])
{
$response = $this->request->get("me/following/users", $data);
return new Collection($this->master, $response, "User");
} | php | public function users(array $data = [])
{
$response = $this->request->get("me/following/users", $data);
return new Collection($this->master, $response, "User");
} | [
"public",
"function",
"users",
"(",
"array",
"$",
"data",
"=",
"[",
"]",
")",
"{",
"$",
"response",
"=",
"$",
"this",
"->",
"request",
"->",
"get",
"(",
"\"me/following/users\"",
",",
"$",
"data",
")",
";",
"return",
"new",
"Collection",
"(",
"$",
"t... | Get the authenticated user's following users
@access public
@param array $data
@throws Exceptions/PinterestExceptions
@return Collection | [
"Get",
"the",
"authenticated",
"user",
"s",
"following",
"users"
] | train | https://github.com/dirkgroenen/Pinterest-API-PHP/blob/2dcffb7d4f4ffbc9a43ea962d79ebcda3b06efce/src/Pinterest/Endpoints/Following.php#L27-L31 |
dirkgroenen/Pinterest-API-PHP | src/Pinterest/Endpoints/Following.php | Following.boards | public function boards(array $data = [])
{
$response = $this->request->get("me/following/boards", $data);
return new Collection($this->master, $response, "Board");
} | php | public function boards(array $data = [])
{
$response = $this->request->get("me/following/boards", $data);
return new Collection($this->master, $response, "Board");
} | [
"public",
"function",
"boards",
"(",
"array",
"$",
"data",
"=",
"[",
"]",
")",
"{",
"$",
"response",
"=",
"$",
"this",
"->",
"request",
"->",
"get",
"(",
"\"me/following/boards\"",
",",
"$",
"data",
")",
";",
"return",
"new",
"Collection",
"(",
"$",
... | Get the authenticated user's following boards
@access public
@param array $data
@throws Exceptions/PinterestExceptions
@return Collection | [
"Get",
"the",
"authenticated",
"user",
"s",
"following",
"boards"
] | train | https://github.com/dirkgroenen/Pinterest-API-PHP/blob/2dcffb7d4f4ffbc9a43ea962d79ebcda3b06efce/src/Pinterest/Endpoints/Following.php#L41-L45 |
dirkgroenen/Pinterest-API-PHP | src/Pinterest/Endpoints/Following.php | Following.interests | public function interests(array $data = [])
{
$response = $this->request->get("me/following/interests", $data);
return new Collection($this->master, $response, "Interest");
} | php | public function interests(array $data = [])
{
$response = $this->request->get("me/following/interests", $data);
return new Collection($this->master, $response, "Interest");
} | [
"public",
"function",
"interests",
"(",
"array",
"$",
"data",
"=",
"[",
"]",
")",
"{",
"$",
"response",
"=",
"$",
"this",
"->",
"request",
"->",
"get",
"(",
"\"me/following/interests\"",
",",
"$",
"data",
")",
";",
"return",
"new",
"Collection",
"(",
"... | Get the authenticated user's following interest
@access public
@param array $data
@throws Exceptions/PinterestExceptions
@return Collection | [
"Get",
"the",
"authenticated",
"user",
"s",
"following",
"interest"
] | train | https://github.com/dirkgroenen/Pinterest-API-PHP/blob/2dcffb7d4f4ffbc9a43ea962d79ebcda3b06efce/src/Pinterest/Endpoints/Following.php#L55-L59 |
dirkgroenen/Pinterest-API-PHP | src/Pinterest/Auth/PinterestOAuth.php | PinterestOAuth.getLoginUrl | public function getLoginUrl($redirect_uri, $scopes = array("read_public"), $response_type = "code")
{
$queryparams = array(
"response_type" => $response_type,
"redirect_uri" => $redirect_uri,
"client_id" => $this->client_id,
"client_secret" ... | php | public function getLoginUrl($redirect_uri, $scopes = array("read_public"), $response_type = "code")
{
$queryparams = array(
"response_type" => $response_type,
"redirect_uri" => $redirect_uri,
"client_id" => $this->client_id,
"client_secret" ... | [
"public",
"function",
"getLoginUrl",
"(",
"$",
"redirect_uri",
",",
"$",
"scopes",
"=",
"array",
"(",
"\"read_public\"",
")",
",",
"$",
"response_type",
"=",
"\"code\"",
")",
"{",
"$",
"queryparams",
"=",
"array",
"(",
"\"response_type\"",
"=>",
"$",
"respon... | Returns the login url
@access public
@param array $scopes
@param string $redirect_uri
@return string | [
"Returns",
"the",
"login",
"url"
] | train | https://github.com/dirkgroenen/Pinterest-API-PHP/blob/2dcffb7d4f4ffbc9a43ea962d79ebcda3b06efce/src/Pinterest/Auth/PinterestOAuth.php#L79-L92 |
dirkgroenen/Pinterest-API-PHP | src/Pinterest/Auth/PinterestOAuth.php | PinterestOAuth.getOAuthToken | public function getOAuthToken($code)
{
// Build data array
$data = array(
"grant_type" => "authorization_code",
"client_id" => $this->client_id,
"client_secret" => $this->client_secret,
"code" => $code
);
// Perform pos... | php | public function getOAuthToken($code)
{
// Build data array
$data = array(
"grant_type" => "authorization_code",
"client_id" => $this->client_id,
"client_secret" => $this->client_secret,
"code" => $code
);
// Perform pos... | [
"public",
"function",
"getOAuthToken",
"(",
"$",
"code",
")",
"{",
"// Build data array",
"$",
"data",
"=",
"array",
"(",
"\"grant_type\"",
"=>",
"\"authorization_code\"",
",",
"\"client_id\"",
"=>",
"$",
"this",
"->",
"client_id",
",",
"\"client_secret\"",
"=>",
... | Change the code for an access_token
@param string $code
@return \DirkGroenen\Pinterest\Transport\Response | [
"Change",
"the",
"code",
"for",
"an",
"access_token"
] | train | https://github.com/dirkgroenen/Pinterest-API-PHP/blob/2dcffb7d4f4ffbc9a43ea962d79ebcda3b06efce/src/Pinterest/Auth/PinterestOAuth.php#L132-L146 |
dirkgroenen/Pinterest-API-PHP | src/Pinterest/Endpoints/Boards.php | Boards.get | public function get($board_id, array $data = [])
{
$response = $this->request->get(sprintf("boards/%s", $board_id), $data);
return new Board($this->master, $response);
} | php | public function get($board_id, array $data = [])
{
$response = $this->request->get(sprintf("boards/%s", $board_id), $data);
return new Board($this->master, $response);
} | [
"public",
"function",
"get",
"(",
"$",
"board_id",
",",
"array",
"$",
"data",
"=",
"[",
"]",
")",
"{",
"$",
"response",
"=",
"$",
"this",
"->",
"request",
"->",
"get",
"(",
"sprintf",
"(",
"\"boards/%s\"",
",",
"$",
"board_id",
")",
",",
"$",
"data... | Find the provided board
@access public
@param string $board_id
@param array $data
@throws Exceptions/PinterestExceptions
@return Board | [
"Find",
"the",
"provided",
"board"
] | train | https://github.com/dirkgroenen/Pinterest-API-PHP/blob/2dcffb7d4f4ffbc9a43ea962d79ebcda3b06efce/src/Pinterest/Endpoints/Boards.php#L26-L30 |
dirkgroenen/Pinterest-API-PHP | src/Pinterest/Endpoints/Boards.php | Boards.create | public function create(array $data)
{
$response = $this->request->post("boards", $data);
return new Board($this->master, $response);
} | php | public function create(array $data)
{
$response = $this->request->post("boards", $data);
return new Board($this->master, $response);
} | [
"public",
"function",
"create",
"(",
"array",
"$",
"data",
")",
"{",
"$",
"response",
"=",
"$",
"this",
"->",
"request",
"->",
"post",
"(",
"\"boards\"",
",",
"$",
"data",
")",
";",
"return",
"new",
"Board",
"(",
"$",
"this",
"->",
"master",
",",
"... | Create a new board
@access public
@param array $data
@throws Exceptions/PinterestExceptions
@return Board | [
"Create",
"a",
"new",
"board"
] | train | https://github.com/dirkgroenen/Pinterest-API-PHP/blob/2dcffb7d4f4ffbc9a43ea962d79ebcda3b06efce/src/Pinterest/Endpoints/Boards.php#L40-L44 |
dirkgroenen/Pinterest-API-PHP | src/Pinterest/Endpoints/Boards.php | Boards.edit | public function edit($board_id, array $data, $fields = null)
{
$query = (!$fields) ? array() : array("fields" => $fields);
$response = $this->request->update(sprintf("boards/%s", $board_id), $data, $query);
return new Board($this->master, $response);
} | php | public function edit($board_id, array $data, $fields = null)
{
$query = (!$fields) ? array() : array("fields" => $fields);
$response = $this->request->update(sprintf("boards/%s", $board_id), $data, $query);
return new Board($this->master, $response);
} | [
"public",
"function",
"edit",
"(",
"$",
"board_id",
",",
"array",
"$",
"data",
",",
"$",
"fields",
"=",
"null",
")",
"{",
"$",
"query",
"=",
"(",
"!",
"$",
"fields",
")",
"?",
"array",
"(",
")",
":",
"array",
"(",
"\"fields\"",
"=>",
"$",
"fields... | Edit a board
@access public
@param string $board_id
@param array $data
@param string $fields
@throws Exceptions/PinterestExceptions
@return Board | [
"Edit",
"a",
"board"
] | train | https://github.com/dirkgroenen/Pinterest-API-PHP/blob/2dcffb7d4f4ffbc9a43ea962d79ebcda3b06efce/src/Pinterest/Endpoints/Boards.php#L56-L62 |
dirkgroenen/Pinterest-API-PHP | src/Pinterest/Transport/Request.php | Request.get | public function get($endpoint, array $parameters = array())
{
if (!empty($parameters)) {
$path = sprintf("%s/?%s", $endpoint, http_build_query($parameters));
} else {
$path = $endpoint;
}
return $this->execute("GET", sprintf("%s%s", $this->host, $path));
... | php | public function get($endpoint, array $parameters = array())
{
if (!empty($parameters)) {
$path = sprintf("%s/?%s", $endpoint, http_build_query($parameters));
} else {
$path = $endpoint;
}
return $this->execute("GET", sprintf("%s%s", $this->host, $path));
... | [
"public",
"function",
"get",
"(",
"$",
"endpoint",
",",
"array",
"$",
"parameters",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"parameters",
")",
")",
"{",
"$",
"path",
"=",
"sprintf",
"(",
"\"%s/?%s\"",
",",
"$",
"endpoin... | Make a get request to the given endpoint
@access public
@param string $endpoint
@param array $parameters
@return Response | [
"Make",
"a",
"get",
"request",
"to",
"the",
"given",
"endpoint"
] | train | https://github.com/dirkgroenen/Pinterest-API-PHP/blob/2dcffb7d4f4ffbc9a43ea962d79ebcda3b06efce/src/Pinterest/Transport/Request.php#L77-L86 |
dirkgroenen/Pinterest-API-PHP | src/Pinterest/Transport/Request.php | Request.post | public function post($endpoint, array $parameters = array())
{
return $this->execute("POST", sprintf("%s%s", $this->host, $endpoint), $parameters);
} | php | public function post($endpoint, array $parameters = array())
{
return $this->execute("POST", sprintf("%s%s", $this->host, $endpoint), $parameters);
} | [
"public",
"function",
"post",
"(",
"$",
"endpoint",
",",
"array",
"$",
"parameters",
"=",
"array",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"execute",
"(",
"\"POST\"",
",",
"sprintf",
"(",
"\"%s%s\"",
",",
"$",
"this",
"->",
"host",
",",
"$",... | Make a post request to the given endpoint
@access public
@param string $endpoint
@param array $parameters
@return Response | [
"Make",
"a",
"post",
"request",
"to",
"the",
"given",
"endpoint"
] | train | https://github.com/dirkgroenen/Pinterest-API-PHP/blob/2dcffb7d4f4ffbc9a43ea962d79ebcda3b06efce/src/Pinterest/Transport/Request.php#L96-L99 |
dirkgroenen/Pinterest-API-PHP | src/Pinterest/Transport/Request.php | Request.delete | public function delete($endpoint, array $parameters = array())
{
return $this->execute("DELETE", sprintf("%s%s", $this->host, $endpoint) . "/", $parameters);
} | php | public function delete($endpoint, array $parameters = array())
{
return $this->execute("DELETE", sprintf("%s%s", $this->host, $endpoint) . "/", $parameters);
} | [
"public",
"function",
"delete",
"(",
"$",
"endpoint",
",",
"array",
"$",
"parameters",
"=",
"array",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"execute",
"(",
"\"DELETE\"",
",",
"sprintf",
"(",
"\"%s%s\"",
",",
"$",
"this",
"->",
"host",
",",
... | Make a delete request to the given endpoint
@access public
@param string $endpoint
@param array $parameters
@return Response | [
"Make",
"a",
"delete",
"request",
"to",
"the",
"given",
"endpoint"
] | train | https://github.com/dirkgroenen/Pinterest-API-PHP/blob/2dcffb7d4f4ffbc9a43ea962d79ebcda3b06efce/src/Pinterest/Transport/Request.php#L109-L112 |
dirkgroenen/Pinterest-API-PHP | src/Pinterest/Transport/Request.php | Request.update | public function update($endpoint, array $parameters = array(), array $queryparameters = array())
{
if (!empty($queryparameters)) {
$path = sprintf("%s/?%s", $endpoint, http_build_query($queryparameters));
} else {
$path = $endpoint;
}
return $this->execute("P... | php | public function update($endpoint, array $parameters = array(), array $queryparameters = array())
{
if (!empty($queryparameters)) {
$path = sprintf("%s/?%s", $endpoint, http_build_query($queryparameters));
} else {
$path = $endpoint;
}
return $this->execute("P... | [
"public",
"function",
"update",
"(",
"$",
"endpoint",
",",
"array",
"$",
"parameters",
"=",
"array",
"(",
")",
",",
"array",
"$",
"queryparameters",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"queryparameters",
")",
")",
"{"... | Make an update request to the given endpoint
@access public
@param string $endpoint
@param array $parameters
@param array $queryparameters
@return Response | [
"Make",
"an",
"update",
"request",
"to",
"the",
"given",
"endpoint"
] | train | https://github.com/dirkgroenen/Pinterest-API-PHP/blob/2dcffb7d4f4ffbc9a43ea962d79ebcda3b06efce/src/Pinterest/Transport/Request.php#L123-L132 |
dirkgroenen/Pinterest-API-PHP | src/Pinterest/Transport/Request.php | Request.execute | public function execute($method, $apiCall, array $parameters = array(), $headers = array())
{
// Check if the access token needs to be added
if ($this->access_token != null) {
$headers = array_merge($headers, array(
"Authorization: Bearer " . $this->access_token,
... | php | public function execute($method, $apiCall, array $parameters = array(), $headers = array())
{
// Check if the access token needs to be added
if ($this->access_token != null) {
$headers = array_merge($headers, array(
"Authorization: Bearer " . $this->access_token,
... | [
"public",
"function",
"execute",
"(",
"$",
"method",
",",
"$",
"apiCall",
",",
"array",
"$",
"parameters",
"=",
"array",
"(",
")",
",",
"$",
"headers",
"=",
"array",
"(",
")",
")",
"{",
"// Check if the access token needs to be added",
"if",
"(",
"$",
"thi... | Execute the http request
@access public
@param string $method
@param string $apiCall
@param array $parameters
@param array $headers
@return Response
@throws CurlException
@throws PinterestException | [
"Execute",
"the",
"http",
"request"
] | train | https://github.com/dirkgroenen/Pinterest-API-PHP/blob/2dcffb7d4f4ffbc9a43ea962d79ebcda3b06efce/src/Pinterest/Transport/Request.php#L156-L244 |
dirkgroenen/Pinterest-API-PHP | src/Pinterest/Endpoints/Users.php | Users.me | public function me(array $data = [])
{
$response = $this->request->get("me", $data);
return new User($this->master, $response);
} | php | public function me(array $data = [])
{
$response = $this->request->get("me", $data);
return new User($this->master, $response);
} | [
"public",
"function",
"me",
"(",
"array",
"$",
"data",
"=",
"[",
"]",
")",
"{",
"$",
"response",
"=",
"$",
"this",
"->",
"request",
"->",
"get",
"(",
"\"me\"",
",",
"$",
"data",
")",
";",
"return",
"new",
"User",
"(",
"$",
"this",
"->",
"master",... | Get the current user
@access public
@param array $data
@throws Exceptions/PinterestExceptions
@return User | [
"Get",
"the",
"current",
"user"
] | train | https://github.com/dirkgroenen/Pinterest-API-PHP/blob/2dcffb7d4f4ffbc9a43ea962d79ebcda3b06efce/src/Pinterest/Endpoints/Users.php#L26-L30 |
dirkgroenen/Pinterest-API-PHP | src/Pinterest/Endpoints/Users.php | Users.find | public function find($username, array $data = [])
{
$response = $this->request->get(sprintf("users/%s", $username), $data);
return new User($this->master, $response);
} | php | public function find($username, array $data = [])
{
$response = $this->request->get(sprintf("users/%s", $username), $data);
return new User($this->master, $response);
} | [
"public",
"function",
"find",
"(",
"$",
"username",
",",
"array",
"$",
"data",
"=",
"[",
"]",
")",
"{",
"$",
"response",
"=",
"$",
"this",
"->",
"request",
"->",
"get",
"(",
"sprintf",
"(",
"\"users/%s\"",
",",
"$",
"username",
")",
",",
"$",
"data... | Get the provided user
@access public
@param string $username
@param array $data
@throws Exceptions/PinterestExceptions
@return User | [
"Get",
"the",
"provided",
"user"
] | train | https://github.com/dirkgroenen/Pinterest-API-PHP/blob/2dcffb7d4f4ffbc9a43ea962d79ebcda3b06efce/src/Pinterest/Endpoints/Users.php#L41-L45 |
dirkgroenen/Pinterest-API-PHP | src/Pinterest/Endpoints/Users.php | Users.getMePins | public function getMePins(array $data = [])
{
$response = $this->request->get("me/pins", $data);
return new Collection($this->master, $response, "Pin");
} | php | public function getMePins(array $data = [])
{
$response = $this->request->get("me/pins", $data);
return new Collection($this->master, $response, "Pin");
} | [
"public",
"function",
"getMePins",
"(",
"array",
"$",
"data",
"=",
"[",
"]",
")",
"{",
"$",
"response",
"=",
"$",
"this",
"->",
"request",
"->",
"get",
"(",
"\"me/pins\"",
",",
"$",
"data",
")",
";",
"return",
"new",
"Collection",
"(",
"$",
"this",
... | Get the authenticated user's pins
@access public
@param array $data
@throws Exceptions/PinterestExceptions
@return Collection | [
"Get",
"the",
"authenticated",
"user",
"s",
"pins"
] | train | https://github.com/dirkgroenen/Pinterest-API-PHP/blob/2dcffb7d4f4ffbc9a43ea962d79ebcda3b06efce/src/Pinterest/Endpoints/Users.php#L55-L59 |
dirkgroenen/Pinterest-API-PHP | src/Pinterest/Endpoints/Users.php | Users.searchMePins | public function searchMePins($query, array $data = [])
{
$data["query"] = $query;
$response = $this->request->get("me/search/pins", $data);
return new Collection($this->master, $response, "Pin");
} | php | public function searchMePins($query, array $data = [])
{
$data["query"] = $query;
$response = $this->request->get("me/search/pins", $data);
return new Collection($this->master, $response, "Pin");
} | [
"public",
"function",
"searchMePins",
"(",
"$",
"query",
",",
"array",
"$",
"data",
"=",
"[",
"]",
")",
"{",
"$",
"data",
"[",
"\"query\"",
"]",
"=",
"$",
"query",
";",
"$",
"response",
"=",
"$",
"this",
"->",
"request",
"->",
"get",
"(",
"\"me/sea... | Search in the user's pins
@param string $query
@param array $data
@throws Exceptions/PinterestExceptions
@return Collection | [
"Search",
"in",
"the",
"user",
"s",
"pins"
] | train | https://github.com/dirkgroenen/Pinterest-API-PHP/blob/2dcffb7d4f4ffbc9a43ea962d79ebcda3b06efce/src/Pinterest/Endpoints/Users.php#L69-L74 |
dirkgroenen/Pinterest-API-PHP | src/Pinterest/Endpoints/Users.php | Users.getMeBoards | public function getMeBoards(array $data = [])
{
$response = $this->request->get("me/boards", $data);
return new Collection($this->master, $response, "Board");
} | php | public function getMeBoards(array $data = [])
{
$response = $this->request->get("me/boards", $data);
return new Collection($this->master, $response, "Board");
} | [
"public",
"function",
"getMeBoards",
"(",
"array",
"$",
"data",
"=",
"[",
"]",
")",
"{",
"$",
"response",
"=",
"$",
"this",
"->",
"request",
"->",
"get",
"(",
"\"me/boards\"",
",",
"$",
"data",
")",
";",
"return",
"new",
"Collection",
"(",
"$",
"this... | Get the authenticated user's boards
@access public
@param array $data
@throws Exceptions/PinterestExceptions
@return Collection | [
"Get",
"the",
"authenticated",
"user",
"s",
"boards"
] | train | https://github.com/dirkgroenen/Pinterest-API-PHP/blob/2dcffb7d4f4ffbc9a43ea962d79ebcda3b06efce/src/Pinterest/Endpoints/Users.php#L100-L104 |
dirkgroenen/Pinterest-API-PHP | src/Pinterest/Endpoints/Users.php | Users.getMeLikes | public function getMeLikes(array $data = [])
{
$response = $this->request->get("me/likes", $data);
return new Collection($this->master, $response, "Pin");
} | php | public function getMeLikes(array $data = [])
{
$response = $this->request->get("me/likes", $data);
return new Collection($this->master, $response, "Pin");
} | [
"public",
"function",
"getMeLikes",
"(",
"array",
"$",
"data",
"=",
"[",
"]",
")",
"{",
"$",
"response",
"=",
"$",
"this",
"->",
"request",
"->",
"get",
"(",
"\"me/likes\"",
",",
"$",
"data",
")",
";",
"return",
"new",
"Collection",
"(",
"$",
"this",... | Get the authenticated user's likes
@access public
@param array $data
@throws Exceptions/PinterestExceptions
@return Collection | [
"Get",
"the",
"authenticated",
"user",
"s",
"likes"
] | train | https://github.com/dirkgroenen/Pinterest-API-PHP/blob/2dcffb7d4f4ffbc9a43ea962d79ebcda3b06efce/src/Pinterest/Endpoints/Users.php#L114-L118 |
dirkgroenen/Pinterest-API-PHP | src/Pinterest/Endpoints/Users.php | Users.getMeFollowers | public function getMeFollowers(array $data = [])
{
$response = $this->request->get("me/followers", $data);
return new Collection($this->master, $response, "User");
} | php | public function getMeFollowers(array $data = [])
{
$response = $this->request->get("me/followers", $data);
return new Collection($this->master, $response, "User");
} | [
"public",
"function",
"getMeFollowers",
"(",
"array",
"$",
"data",
"=",
"[",
"]",
")",
"{",
"$",
"response",
"=",
"$",
"this",
"->",
"request",
"->",
"get",
"(",
"\"me/followers\"",
",",
"$",
"data",
")",
";",
"return",
"new",
"Collection",
"(",
"$",
... | Get the authenticated user's followers
@access public
@param array $data
@throws Exceptions\PinterestException
@return Collection | [
"Get",
"the",
"authenticated",
"user",
"s",
"followers"
] | train | https://github.com/dirkgroenen/Pinterest-API-PHP/blob/2dcffb7d4f4ffbc9a43ea962d79ebcda3b06efce/src/Pinterest/Endpoints/Users.php#L128-L132 |
dirkgroenen/Pinterest-API-PHP | src/Pinterest/Endpoints/Pins.php | Pins.get | public function get($pin_id, array $data = [])
{
$response = $this->request->get(sprintf("pins/%s", $pin_id), $data);
return new Pin($this->master, $response);
} | php | public function get($pin_id, array $data = [])
{
$response = $this->request->get(sprintf("pins/%s", $pin_id), $data);
return new Pin($this->master, $response);
} | [
"public",
"function",
"get",
"(",
"$",
"pin_id",
",",
"array",
"$",
"data",
"=",
"[",
"]",
")",
"{",
"$",
"response",
"=",
"$",
"this",
"->",
"request",
"->",
"get",
"(",
"sprintf",
"(",
"\"pins/%s\"",
",",
"$",
"pin_id",
")",
",",
"$",
"data",
"... | Get a pin object
@access public
@param string $pin_id
@param array $data
@throws \DirkGroenen\Pinterest\Exceptions\PinterestException
@return Pin | [
"Get",
"a",
"pin",
"object"
] | train | https://github.com/dirkgroenen/Pinterest-API-PHP/blob/2dcffb7d4f4ffbc9a43ea962d79ebcda3b06efce/src/Pinterest/Endpoints/Pins.php#L27-L31 |
dirkgroenen/Pinterest-API-PHP | src/Pinterest/Endpoints/Pins.php | Pins.fromBoard | public function fromBoard($board_id, array $data = [])
{
$response = $this->request->get(sprintf("boards/%s/pins", $board_id), $data);
return new Collection($this->master, $response, "Pin");
} | php | public function fromBoard($board_id, array $data = [])
{
$response = $this->request->get(sprintf("boards/%s/pins", $board_id), $data);
return new Collection($this->master, $response, "Pin");
} | [
"public",
"function",
"fromBoard",
"(",
"$",
"board_id",
",",
"array",
"$",
"data",
"=",
"[",
"]",
")",
"{",
"$",
"response",
"=",
"$",
"this",
"->",
"request",
"->",
"get",
"(",
"sprintf",
"(",
"\"boards/%s/pins\"",
",",
"$",
"board_id",
")",
",",
"... | Get all pins from the given board
@access public
@param string $board_id
@param array $data
@throws \DirkGroenen\Pinterest\Exceptions\PinterestException
@return Collection | [
"Get",
"all",
"pins",
"from",
"the",
"given",
"board"
] | train | https://github.com/dirkgroenen/Pinterest-API-PHP/blob/2dcffb7d4f4ffbc9a43ea962d79ebcda3b06efce/src/Pinterest/Endpoints/Pins.php#L42-L46 |
dirkgroenen/Pinterest-API-PHP | src/Pinterest/Endpoints/Pins.php | Pins.create | public function create(array $data)
{
if (array_key_exists("image", $data)) {
if (class_exists('\CURLFile')) {
$data["image"] = new \CURLFile($data['image']);
} else {
$data["image"] = '@' . $data['image'];
}
}
$response = ... | php | public function create(array $data)
{
if (array_key_exists("image", $data)) {
if (class_exists('\CURLFile')) {
$data["image"] = new \CURLFile($data['image']);
} else {
$data["image"] = '@' . $data['image'];
}
}
$response = ... | [
"public",
"function",
"create",
"(",
"array",
"$",
"data",
")",
"{",
"if",
"(",
"array_key_exists",
"(",
"\"image\"",
",",
"$",
"data",
")",
")",
"{",
"if",
"(",
"class_exists",
"(",
"'\\CURLFile'",
")",
")",
"{",
"$",
"data",
"[",
"\"image\"",
"]",
... | Create a pin
@access public
@param array $data
@throws \DirkGroenen\Pinterest\Exceptions\PinterestException
@return Pin | [
"Create",
"a",
"pin"
] | train | https://github.com/dirkgroenen/Pinterest-API-PHP/blob/2dcffb7d4f4ffbc9a43ea962d79ebcda3b06efce/src/Pinterest/Endpoints/Pins.php#L56-L68 |
dirkgroenen/Pinterest-API-PHP | src/Pinterest/Endpoints/Pins.php | Pins.edit | public function edit($pin_id, array $data, $fields = null)
{
$query = (!$fields) ? array() : array("fields" => $fields);
$response = $this->request->update(sprintf("pins/%s/", $pin_id), $data, $query);
return new Pin($this->master, $response);
} | php | public function edit($pin_id, array $data, $fields = null)
{
$query = (!$fields) ? array() : array("fields" => $fields);
$response = $this->request->update(sprintf("pins/%s/", $pin_id), $data, $query);
return new Pin($this->master, $response);
} | [
"public",
"function",
"edit",
"(",
"$",
"pin_id",
",",
"array",
"$",
"data",
",",
"$",
"fields",
"=",
"null",
")",
"{",
"$",
"query",
"=",
"(",
"!",
"$",
"fields",
")",
"?",
"array",
"(",
")",
":",
"array",
"(",
"\"fields\"",
"=>",
"$",
"fields",... | Edit a pin
@access public
@param string $pin_id
@param array $data
@param string $fields
@throws \DirkGroenen\Pinterest\Exceptions\PinterestException
@return Pin | [
"Edit",
"a",
"pin"
] | train | https://github.com/dirkgroenen/Pinterest-API-PHP/blob/2dcffb7d4f4ffbc9a43ea962d79ebcda3b06efce/src/Pinterest/Endpoints/Pins.php#L80-L86 |
dirkgroenen/Pinterest-API-PHP | src/Pinterest/Models/Collection.php | Collection.buildCollectionModels | private function buildCollectionModels(array $items)
{
$modelcollection = [];
foreach ($items as $item) {
$class = new \ReflectionClass("\\DirkGroenen\\Pinterest\\Models\\" . $this->model);
$modelcollection[] = $class->newInstanceArgs([$this->master, $item]);
}
... | php | private function buildCollectionModels(array $items)
{
$modelcollection = [];
foreach ($items as $item) {
$class = new \ReflectionClass("\\DirkGroenen\\Pinterest\\Models\\" . $this->model);
$modelcollection[] = $class->newInstanceArgs([$this->master, $item]);
}
... | [
"private",
"function",
"buildCollectionModels",
"(",
"array",
"$",
"items",
")",
"{",
"$",
"modelcollection",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"items",
"as",
"$",
"item",
")",
"{",
"$",
"class",
"=",
"new",
"\\",
"ReflectionClass",
"(",
"\"\\\\Di... | Transform each raw item into a model
@access private
@param array $items
@return array | [
"Transform",
"each",
"raw",
"item",
"into",
"a",
"model"
] | train | https://github.com/dirkgroenen/Pinterest-API-PHP/blob/2dcffb7d4f4ffbc9a43ea962d79ebcda3b06efce/src/Pinterest/Models/Collection.php#L114-L124 |
laracasts/Integrated | src/AnnotationReader.php | AnnotationReader.having | public function having($annotation)
{
$methods = [];
foreach ($this->reflectInto($this->reference) as $method) {
if ($this->hasAnnotation($annotation, $method)) {
$methods[] = $method->getName();
}
}
// We'll reverse the results to ensure tha... | php | public function having($annotation)
{
$methods = [];
foreach ($this->reflectInto($this->reference) as $method) {
if ($this->hasAnnotation($annotation, $method)) {
$methods[] = $method->getName();
}
}
// We'll reverse the results to ensure tha... | [
"public",
"function",
"having",
"(",
"$",
"annotation",
")",
"{",
"$",
"methods",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"reflectInto",
"(",
"$",
"this",
"->",
"reference",
")",
"as",
"$",
"method",
")",
"{",
"if",
"(",
"$",
"this",... | Get method names for the referenced object
which contain the given annotation.
@param string $annotation
@return array | [
"Get",
"method",
"names",
"for",
"the",
"referenced",
"object",
"which",
"contain",
"the",
"given",
"annotation",
"."
] | train | https://github.com/laracasts/Integrated/blob/4c2dbbcd6343cdcd772e493d44b9dc4d794553a8/src/AnnotationReader.php#L34-L48 |
laracasts/Integrated | src/Extensions/Traits/WorksWithDatabase.php | WorksWithDatabase.getDbAdapter | protected function getDbAdapter()
{
if (! $this->db) {
try {
$config = $this->getPackageConfig('pdo');
} catch (IntegratedException $e) {
throw new IntegratedException(
"Thank you for riding Johnny Cab. To input your destination (an... | php | protected function getDbAdapter()
{
if (! $this->db) {
try {
$config = $this->getPackageConfig('pdo');
} catch (IntegratedException $e) {
throw new IntegratedException(
"Thank you for riding Johnny Cab. To input your destination (an... | [
"protected",
"function",
"getDbAdapter",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"db",
")",
"{",
"try",
"{",
"$",
"config",
"=",
"$",
"this",
"->",
"getPackageConfig",
"(",
"'pdo'",
")",
";",
"}",
"catch",
"(",
"IntegratedException",
"$",
"... | Get the adapter to the database.
@return Adapter | [
"Get",
"the",
"adapter",
"to",
"the",
"database",
"."
] | train | https://github.com/laracasts/Integrated/blob/4c2dbbcd6343cdcd772e493d44b9dc4d794553a8/src/Extensions/Traits/WorksWithDatabase.php#L25-L43 |
laracasts/Integrated | src/Extensions/Traits/WorksWithDatabase.php | WorksWithDatabase.seeRowsWereReturned | protected function seeRowsWereReturned($table, $data)
{
// If the user has imported the Laravel application trait, we can use Laravel to
// work with the database.
if (isset($this->app) || in_array('Laracasts\Integrated\Services\Laravel\Application', class_uses($this))) {
return... | php | protected function seeRowsWereReturned($table, $data)
{
// If the user has imported the Laravel application trait, we can use Laravel to
// work with the database.
if (isset($this->app) || in_array('Laracasts\Integrated\Services\Laravel\Application', class_uses($this))) {
return... | [
"protected",
"function",
"seeRowsWereReturned",
"(",
"$",
"table",
",",
"$",
"data",
")",
"{",
"// If the user has imported the Laravel application trait, we can use Laravel to",
"// work with the database.",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"app",
")",
"||",
... | Get the number of rows that match the given condition.
@param string $table
@param array $data
@return integer | [
"Get",
"the",
"number",
"of",
"rows",
"that",
"match",
"the",
"given",
"condition",
"."
] | train | https://github.com/laracasts/Integrated/blob/4c2dbbcd6343cdcd772e493d44b9dc4d794553a8/src/Extensions/Traits/WorksWithDatabase.php#L52-L64 |
laracasts/Integrated | src/Extensions/Goutte.php | Goutte.baseUrl | public function baseUrl()
{
if (isset($this->baseUrl)) {
return $this->baseUrl;
}
$config = $this->getPackageConfig();
if (isset($config['baseUrl'])) {
return $config['baseUrl'];
}
return 'http://localhost:8888';
} | php | public function baseUrl()
{
if (isset($this->baseUrl)) {
return $this->baseUrl;
}
$config = $this->getPackageConfig();
if (isset($config['baseUrl'])) {
return $config['baseUrl'];
}
return 'http://localhost:8888';
} | [
"public",
"function",
"baseUrl",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"baseUrl",
")",
")",
"{",
"return",
"$",
"this",
"->",
"baseUrl",
";",
"}",
"$",
"config",
"=",
"$",
"this",
"->",
"getPackageConfig",
"(",
")",
";",
"if",
... | Get the base url for all requests.
@return string | [
"Get",
"the",
"base",
"url",
"for",
"all",
"requests",
"."
] | train | https://github.com/laracasts/Integrated/blob/4c2dbbcd6343cdcd772e493d44b9dc4d794553a8/src/Extensions/Goutte.php#L27-L40 |
laracasts/Integrated | src/Extensions/Goutte.php | Goutte.submitForm | public function submitForm($buttonText, $formData = null)
{
$this->client()->submit(
$this->fillForm($buttonText, $formData)
);
$this->currentPage = $this->client()->getHistory()->current()->getUri();
$this->clearInputs()->assertPageLoaded($this->currentPage());
... | php | public function submitForm($buttonText, $formData = null)
{
$this->client()->submit(
$this->fillForm($buttonText, $formData)
);
$this->currentPage = $this->client()->getHistory()->current()->getUri();
$this->clearInputs()->assertPageLoaded($this->currentPage());
... | [
"public",
"function",
"submitForm",
"(",
"$",
"buttonText",
",",
"$",
"formData",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"client",
"(",
")",
"->",
"submit",
"(",
"$",
"this",
"->",
"fillForm",
"(",
"$",
"buttonText",
",",
"$",
"formData",
")",
")"... | Submit a form on the page.
@param string $buttonText
@param array|null $formData
@return static | [
"Submit",
"a",
"form",
"on",
"the",
"page",
"."
] | train | https://github.com/laracasts/Integrated/blob/4c2dbbcd6343cdcd772e493d44b9dc4d794553a8/src/Extensions/Goutte.php#L49-L60 |
laracasts/Integrated | src/Extensions/Goutte.php | Goutte.makeRequest | protected function makeRequest($requestType, $uri)
{
$this->crawler = $this->client()->request('GET', $uri);
$this->clearInputs()->assertPageLoaded($uri);
return $this;
} | php | protected function makeRequest($requestType, $uri)
{
$this->crawler = $this->client()->request('GET', $uri);
$this->clearInputs()->assertPageLoaded($uri);
return $this;
} | [
"protected",
"function",
"makeRequest",
"(",
"$",
"requestType",
",",
"$",
"uri",
")",
"{",
"$",
"this",
"->",
"crawler",
"=",
"$",
"this",
"->",
"client",
"(",
")",
"->",
"request",
"(",
"'GET'",
",",
"$",
"uri",
")",
";",
"$",
"this",
"->",
"clea... | Call a URI in the application.
@param string $requestType
@param string $uri
@param array $parameters
@return static | [
"Call",
"a",
"URI",
"in",
"the",
"application",
"."
] | train | https://github.com/laracasts/Integrated/blob/4c2dbbcd6343cdcd772e493d44b9dc4d794553a8/src/Extensions/Goutte.php#L70-L77 |
laracasts/Integrated | src/Database/Adapter.php | Adapter.whereExists | public function whereExists(array $data)
{
$this->parseConstraints($data);
$query = $this->connection->getPdo()->prepare($this->getSelectQuery());
return $this->execute($query)->fetch();
} | php | public function whereExists(array $data)
{
$this->parseConstraints($data);
$query = $this->connection->getPdo()->prepare($this->getSelectQuery());
return $this->execute($query)->fetch();
} | [
"public",
"function",
"whereExists",
"(",
"array",
"$",
"data",
")",
"{",
"$",
"this",
"->",
"parseConstraints",
"(",
"$",
"data",
")",
";",
"$",
"query",
"=",
"$",
"this",
"->",
"connection",
"->",
"getPdo",
"(",
")",
"->",
"prepare",
"(",
"$",
"thi... | See if the table contains records that match the given data.
@param array $data
@return boolean | [
"See",
"if",
"the",
"table",
"contains",
"records",
"that",
"match",
"the",
"given",
"data",
"."
] | train | https://github.com/laracasts/Integrated/blob/4c2dbbcd6343cdcd772e493d44b9dc4d794553a8/src/Database/Adapter.php#L57-L64 |
laracasts/Integrated | src/Database/Adapter.php | Adapter.parseConstraints | protected function parseConstraints(array $wheres)
{
foreach ($wheres as $column => $value) {
$this->wheres[] = "{$column} = ?";
$this->bindings[] = $value;
}
} | php | protected function parseConstraints(array $wheres)
{
foreach ($wheres as $column => $value) {
$this->wheres[] = "{$column} = ?";
$this->bindings[] = $value;
}
} | [
"protected",
"function",
"parseConstraints",
"(",
"array",
"$",
"wheres",
")",
"{",
"foreach",
"(",
"$",
"wheres",
"as",
"$",
"column",
"=>",
"$",
"value",
")",
"{",
"$",
"this",
"->",
"wheres",
"[",
"]",
"=",
"\"{$column} = ?\"",
";",
"$",
"this",
"->... | Parse the "where" constraints.
@param array $wheres
@return void | [
"Parse",
"the",
"where",
"constraints",
"."
] | train | https://github.com/laracasts/Integrated/blob/4c2dbbcd6343cdcd772e493d44b9dc4d794553a8/src/Database/Adapter.php#L72-L78 |
laracasts/Integrated | src/Database/Adapter.php | Adapter.execute | protected function execute($query)
{
$query->execute($this->bindings);
$this->bindings = [];
$this->wheres = [];
return $query;
} | php | protected function execute($query)
{
$query->execute($this->bindings);
$this->bindings = [];
$this->wheres = [];
return $query;
} | [
"protected",
"function",
"execute",
"(",
"$",
"query",
")",
"{",
"$",
"query",
"->",
"execute",
"(",
"$",
"this",
"->",
"bindings",
")",
";",
"$",
"this",
"->",
"bindings",
"=",
"[",
"]",
";",
"$",
"this",
"->",
"wheres",
"=",
"[",
"]",
";",
"ret... | Execute the query.
@param \PDOStatement $query
@return \PDOStatement | [
"Execute",
"the",
"query",
"."
] | train | https://github.com/laracasts/Integrated/blob/4c2dbbcd6343cdcd772e493d44b9dc4d794553a8/src/Database/Adapter.php#L99-L107 |
laracasts/Integrated | src/File.php | File.put | public function put($path, $contents)
{
$this->makeDirectory(dirname($path));
return file_put_contents($path, $contents);
} | php | public function put($path, $contents)
{
$this->makeDirectory(dirname($path));
return file_put_contents($path, $contents);
} | [
"public",
"function",
"put",
"(",
"$",
"path",
",",
"$",
"contents",
")",
"{",
"$",
"this",
"->",
"makeDirectory",
"(",
"dirname",
"(",
"$",
"path",
")",
")",
";",
"return",
"file_put_contents",
"(",
"$",
"path",
",",
"$",
"contents",
")",
";",
"}"
] | Put to a file path.
@param string $path
@param string $contents
@return mixed | [
"Put",
"to",
"a",
"file",
"path",
"."
] | train | https://github.com/laracasts/Integrated/blob/4c2dbbcd6343cdcd772e493d44b9dc4d794553a8/src/File.php#L27-L32 |
laracasts/Integrated | src/Extensions/IntegrationTrait.php | IntegrationTrait.visit | public function visit($uri)
{
$this->currentPage = $this->prepareUrl($uri);
$this->makeRequest('GET', $this->currentPage);
return $this;
} | php | public function visit($uri)
{
$this->currentPage = $this->prepareUrl($uri);
$this->makeRequest('GET', $this->currentPage);
return $this;
} | [
"public",
"function",
"visit",
"(",
"$",
"uri",
")",
"{",
"$",
"this",
"->",
"currentPage",
"=",
"$",
"this",
"->",
"prepareUrl",
"(",
"$",
"uri",
")",
";",
"$",
"this",
"->",
"makeRequest",
"(",
"'GET'",
",",
"$",
"this",
"->",
"currentPage",
")",
... | Make a GET request to the given uri.
@param string $uri
@return static | [
"Make",
"a",
"GET",
"request",
"to",
"the",
"given",
"uri",
"."
] | train | https://github.com/laracasts/Integrated/blob/4c2dbbcd6343cdcd772e493d44b9dc4d794553a8/src/Extensions/IntegrationTrait.php#L86-L93 |
laracasts/Integrated | src/Extensions/IntegrationTrait.php | IntegrationTrait.prepareUrl | protected function prepareUrl($url)
{
if (Str::startsWith($url, '/')) {
$url = substr($url, 1);
}
if (! Str::startsWith($url, 'http')) {
$url = sprintf("%s/%s", $this->baseUrl(), $url);
}
return trim($url, '/');
} | php | protected function prepareUrl($url)
{
if (Str::startsWith($url, '/')) {
$url = substr($url, 1);
}
if (! Str::startsWith($url, 'http')) {
$url = sprintf("%s/%s", $this->baseUrl(), $url);
}
return trim($url, '/');
} | [
"protected",
"function",
"prepareUrl",
"(",
"$",
"url",
")",
"{",
"if",
"(",
"Str",
"::",
"startsWith",
"(",
"$",
"url",
",",
"'/'",
")",
")",
"{",
"$",
"url",
"=",
"substr",
"(",
"$",
"url",
",",
"1",
")",
";",
"}",
"if",
"(",
"!",
"Str",
":... | Prepare the relative URL, given by the user.
@param string $url
@return string | [
"Prepare",
"the",
"relative",
"URL",
"given",
"by",
"the",
"user",
"."
] | train | https://github.com/laracasts/Integrated/blob/4c2dbbcd6343cdcd772e493d44b9dc4d794553a8/src/Extensions/IntegrationTrait.php#L101-L112 |
laracasts/Integrated | src/Extensions/IntegrationTrait.php | IntegrationTrait.assertSee | protected function assertSee($text, $message, $negate = false)
{
try {
$text = preg_quote($text, '/');
$method = $negate ? 'assertNotRegExp' : 'assertRegExp';
$this->$method("/{$text}/i", $this->response(), $message);
} catch (PHPUnitException $e) {
$... | php | protected function assertSee($text, $message, $negate = false)
{
try {
$text = preg_quote($text, '/');
$method = $negate ? 'assertNotRegExp' : 'assertRegExp';
$this->$method("/{$text}/i", $this->response(), $message);
} catch (PHPUnitException $e) {
$... | [
"protected",
"function",
"assertSee",
"(",
"$",
"text",
",",
"$",
"message",
",",
"$",
"negate",
"=",
"false",
")",
"{",
"try",
"{",
"$",
"text",
"=",
"preg_quote",
"(",
"$",
"text",
",",
"'/'",
")",
";",
"$",
"method",
"=",
"$",
"negate",
"?",
"... | Assert that the page contains the given text.
@param string $text
@param string $message
@param boolean $negate
@return static
@throws PHPUnitException | [
"Assert",
"that",
"the",
"page",
"contains",
"the",
"given",
"text",
"."
] | train | https://github.com/laracasts/Integrated/blob/4c2dbbcd6343cdcd772e493d44b9dc4d794553a8/src/Extensions/IntegrationTrait.php#L123-L137 |
laracasts/Integrated | src/Extensions/IntegrationTrait.php | IntegrationTrait.notSee | public function notSee($text)
{
return $this->assertSee($text, sprintf(
"Could not find '%s' on the page, '%s'.", $text, $this->currentPage
), true);
} | php | public function notSee($text)
{
return $this->assertSee($text, sprintf(
"Could not find '%s' on the page, '%s'.", $text, $this->currentPage
), true);
} | [
"public",
"function",
"notSee",
"(",
"$",
"text",
")",
"{",
"return",
"$",
"this",
"->",
"assertSee",
"(",
"$",
"text",
",",
"sprintf",
"(",
"\"Could not find '%s' on the page, '%s'.\"",
",",
"$",
"text",
",",
"$",
"this",
"->",
"currentPage",
")",
",",
"t... | Assert that the page does not contain the given text.
@param string $text
@return static
@throws PHPUnitException | [
"Assert",
"that",
"the",
"page",
"does",
"not",
"contain",
"the",
"given",
"text",
"."
] | train | https://github.com/laracasts/Integrated/blob/4c2dbbcd6343cdcd772e493d44b9dc4d794553a8/src/Extensions/IntegrationTrait.php#L160-L165 |
laracasts/Integrated | src/Extensions/IntegrationTrait.php | IntegrationTrait.assertPageIs | public function assertPageIs($uri, $message, $negate = false)
{
$this->assertPageLoaded($uri = $this->prepareUrl($uri));
$method = $negate ? 'assertNotEquals' : 'assertEquals';
$this->$method($uri, $this->currentPage(), $message);
return $this;
} | php | public function assertPageIs($uri, $message, $negate = false)
{
$this->assertPageLoaded($uri = $this->prepareUrl($uri));
$method = $negate ? 'assertNotEquals' : 'assertEquals';
$this->$method($uri, $this->currentPage(), $message);
return $this;
} | [
"public",
"function",
"assertPageIs",
"(",
"$",
"uri",
",",
"$",
"message",
",",
"$",
"negate",
"=",
"false",
")",
"{",
"$",
"this",
"->",
"assertPageLoaded",
"(",
"$",
"uri",
"=",
"$",
"this",
"->",
"prepareUrl",
"(",
"$",
"uri",
")",
")",
";",
"$... | Assert that the page URI matches the given uri.
@param string $uri
@param message $message
@param boolean $negate
@return static | [
"Assert",
"that",
"the",
"page",
"URI",
"matches",
"the",
"given",
"uri",
"."
] | train | https://github.com/laracasts/Integrated/blob/4c2dbbcd6343cdcd772e493d44b9dc4d794553a8/src/Extensions/IntegrationTrait.php#L175-L184 |
laracasts/Integrated | src/Extensions/IntegrationTrait.php | IntegrationTrait.attachFile | public function attachFile($element, $absolutePath)
{
$name = str_replace('#', '', $element);
$this->files[$name] = $absolutePath;
return $this->storeInput($element, $absolutePath);
} | php | public function attachFile($element, $absolutePath)
{
$name = str_replace('#', '', $element);
$this->files[$name] = $absolutePath;
return $this->storeInput($element, $absolutePath);
} | [
"public",
"function",
"attachFile",
"(",
"$",
"element",
",",
"$",
"absolutePath",
")",
"{",
"$",
"name",
"=",
"str_replace",
"(",
"'#'",
",",
"''",
",",
"$",
"element",
")",
";",
"$",
"this",
"->",
"files",
"[",
"$",
"name",
"]",
"=",
"$",
"absolu... | Attach a file to a form.
@param string $element
@param string $absolutePath
@return static | [
"Attach",
"a",
"file",
"to",
"a",
"form",
"."
] | train | https://github.com/laracasts/Integrated/blob/4c2dbbcd6343cdcd772e493d44b9dc4d794553a8/src/Extensions/IntegrationTrait.php#L350-L357 |
laracasts/Integrated | src/Extensions/IntegrationTrait.php | IntegrationTrait.storeInput | protected function storeInput($name, $value)
{
$this->assertFilterProducedResults($name);
$name = str_replace('#', '', $name);
$this->inputs[$name] = $value;
return $this;
} | php | protected function storeInput($name, $value)
{
$this->assertFilterProducedResults($name);
$name = str_replace('#', '', $name);
$this->inputs[$name] = $value;
return $this;
} | [
"protected",
"function",
"storeInput",
"(",
"$",
"name",
",",
"$",
"value",
")",
"{",
"$",
"this",
"->",
"assertFilterProducedResults",
"(",
"$",
"name",
")",
";",
"$",
"name",
"=",
"str_replace",
"(",
"'#'",
",",
"''",
",",
"$",
"name",
")",
";",
"$... | Store a form input.
@param string $name
@param string $value
@return static | [
"Store",
"a",
"form",
"input",
"."
] | train | https://github.com/laracasts/Integrated/blob/4c2dbbcd6343cdcd772e493d44b9dc4d794553a8/src/Extensions/IntegrationTrait.php#L366-L375 |
laracasts/Integrated | src/Extensions/IntegrationTrait.php | IntegrationTrait.fillForm | protected function fillForm($buttonText, $formData = [])
{
if (! is_string($buttonText)) {
$formData = $buttonText;
$buttonText = null;
}
return $this->getForm($buttonText)->setValues($formData);
} | php | protected function fillForm($buttonText, $formData = [])
{
if (! is_string($buttonText)) {
$formData = $buttonText;
$buttonText = null;
}
return $this->getForm($buttonText)->setValues($formData);
} | [
"protected",
"function",
"fillForm",
"(",
"$",
"buttonText",
",",
"$",
"formData",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"buttonText",
")",
")",
"{",
"$",
"formData",
"=",
"$",
"buttonText",
";",
"$",
"buttonText",
"=",
"nul... | Fill out the form, using the given data.
@param string $buttonText
@param array $formData
@return Form | [
"Fill",
"out",
"the",
"form",
"using",
"the",
"given",
"data",
"."
] | train | https://github.com/laracasts/Integrated/blob/4c2dbbcd6343cdcd772e493d44b9dc4d794553a8/src/Extensions/IntegrationTrait.php#L407-L415 |
laracasts/Integrated | src/Extensions/IntegrationTrait.php | IntegrationTrait.getForm | protected function getForm($button = null)
{
// If the first argument isn't a string, that means
// the user wants us to auto-find the form.
try {
if ($button) {
return $this->crawler->selectButton($button)->form();
}
return $this->crawle... | php | protected function getForm($button = null)
{
// If the first argument isn't a string, that means
// the user wants us to auto-find the form.
try {
if ($button) {
return $this->crawler->selectButton($button)->form();
}
return $this->crawle... | [
"protected",
"function",
"getForm",
"(",
"$",
"button",
"=",
"null",
")",
"{",
"// If the first argument isn't a string, that means",
"// the user wants us to auto-find the form.",
"try",
"{",
"if",
"(",
"$",
"button",
")",
"{",
"return",
"$",
"this",
"->",
"crawler",... | Get the form from the DOM.
@param string|null $button
@throws InvalidArgumentException
@return Form | [
"Get",
"the",
"form",
"from",
"the",
"DOM",
"."
] | train | https://github.com/laracasts/Integrated/blob/4c2dbbcd6343cdcd772e493d44b9dc4d794553a8/src/Extensions/IntegrationTrait.php#L424-L443 |
laracasts/Integrated | src/Extensions/IntegrationTrait.php | IntegrationTrait.assertPageLoaded | protected function assertPageLoaded($uri, $message = null)
{
$status = $this->statusCode();
try {
$this->assertEquals(200, $status);
} catch (PHPUnitException $e) {
$message = $message ?: "A GET request to '{$uri}' failed. Got a {$status} code instead.";
... | php | protected function assertPageLoaded($uri, $message = null)
{
$status = $this->statusCode();
try {
$this->assertEquals(200, $status);
} catch (PHPUnitException $e) {
$message = $message ?: "A GET request to '{$uri}' failed. Got a {$status} code instead.";
... | [
"protected",
"function",
"assertPageLoaded",
"(",
"$",
"uri",
",",
"$",
"message",
"=",
"null",
")",
"{",
"$",
"status",
"=",
"$",
"this",
"->",
"statusCode",
"(",
")",
";",
"try",
"{",
"$",
"this",
"->",
"assertEquals",
"(",
"200",
",",
"$",
"status... | Assert that a 200 status code was returned from the last call.
@param string $uri
@param string $message
@throws PHPUnitException
@return void | [
"Assert",
"that",
"a",
"200",
"status",
"code",
"was",
"returned",
"from",
"the",
"last",
"call",
"."
] | train | https://github.com/laracasts/Integrated/blob/4c2dbbcd6343cdcd772e493d44b9dc4d794553a8/src/Extensions/IntegrationTrait.php#L463-L480 |
laracasts/Integrated | src/Extensions/IntegrationTrait.php | IntegrationTrait.assertFilterProducedResults | protected function assertFilterProducedResults($filter)
{
$crawler = $this->filterByNameOrId($filter);
if (! count($crawler)) {
$message = "Nothing matched the '{$filter}' CSS query provided for {$this->currentPage}.";
throw new InvalidArgumentException($message);
}... | php | protected function assertFilterProducedResults($filter)
{
$crawler = $this->filterByNameOrId($filter);
if (! count($crawler)) {
$message = "Nothing matched the '{$filter}' CSS query provided for {$this->currentPage}.";
throw new InvalidArgumentException($message);
}... | [
"protected",
"function",
"assertFilterProducedResults",
"(",
"$",
"filter",
")",
"{",
"$",
"crawler",
"=",
"$",
"this",
"->",
"filterByNameOrId",
"(",
"$",
"filter",
")",
";",
"if",
"(",
"!",
"count",
"(",
"$",
"crawler",
")",
")",
"{",
"$",
"message",
... | Assert that the filtered Crawler contains nodes.
@param string $filter
@throws InvalidArgumentException
@return void | [
"Assert",
"that",
"the",
"filtered",
"Crawler",
"contains",
"nodes",
"."
] | train | https://github.com/laracasts/Integrated/blob/4c2dbbcd6343cdcd772e493d44b9dc4d794553a8/src/Extensions/IntegrationTrait.php#L489-L498 |
laracasts/Integrated | src/Extensions/IntegrationTrait.php | IntegrationTrait.assertInDatabase | public function assertInDatabase($table, array $data, $message, $negate = false)
{
$count = $this->seeRowsWereReturned($table, $data);
$method = $negate ? 'assertEquals' : 'assertGreaterThan';
$this->$method(0, $count, $message);
return $this;
} | php | public function assertInDatabase($table, array $data, $message, $negate = false)
{
$count = $this->seeRowsWereReturned($table, $data);
$method = $negate ? 'assertEquals' : 'assertGreaterThan';
$this->$method(0, $count, $message);
return $this;
} | [
"public",
"function",
"assertInDatabase",
"(",
"$",
"table",
",",
"array",
"$",
"data",
",",
"$",
"message",
",",
"$",
"negate",
"=",
"false",
")",
"{",
"$",
"count",
"=",
"$",
"this",
"->",
"seeRowsWereReturned",
"(",
"$",
"table",
",",
"$",
"data",
... | Assert that a record is contained in the database.
@param string $table
@param array $data
@param string $message
@param boolean $negate
@return static | [
"Assert",
"that",
"a",
"record",
"is",
"contained",
"in",
"the",
"database",
"."
] | train | https://github.com/laracasts/Integrated/blob/4c2dbbcd6343cdcd772e493d44b9dc4d794553a8/src/Extensions/IntegrationTrait.php#L535-L543 |
laracasts/Integrated | src/Extensions/IntegrationTrait.php | IntegrationTrait.seeInDatabase | public function seeInDatabase($table, array $data)
{
return $this->assertInDatabase($table, $data, sprintf(
"Didn't see row in the '%s' table that matched the attributes '%s'.",
$table, json_encode($data)
));
} | php | public function seeInDatabase($table, array $data)
{
return $this->assertInDatabase($table, $data, sprintf(
"Didn't see row in the '%s' table that matched the attributes '%s'.",
$table, json_encode($data)
));
} | [
"public",
"function",
"seeInDatabase",
"(",
"$",
"table",
",",
"array",
"$",
"data",
")",
"{",
"return",
"$",
"this",
"->",
"assertInDatabase",
"(",
"$",
"table",
",",
"$",
"data",
",",
"sprintf",
"(",
"\"Didn't see row in the '%s' table that matched the attribute... | Ensure that a database table contains a row with the given data.
@param string $table
@param array $data
@return static | [
"Ensure",
"that",
"a",
"database",
"table",
"contains",
"a",
"row",
"with",
"the",
"given",
"data",
"."
] | train | https://github.com/laracasts/Integrated/blob/4c2dbbcd6343cdcd772e493d44b9dc4d794553a8/src/Extensions/IntegrationTrait.php#L552-L558 |
laracasts/Integrated | src/Extensions/IntegrationTrait.php | IntegrationTrait.notSeeInDatabase | public function notSeeInDatabase($table, array $data)
{
return $this->assertInDatabase($table, $data, sprintf(
"Found row(s) in the '%s' table that matched the attributes '%s', but did not expect to.",
$table, json_encode($data)
), true);
} | php | public function notSeeInDatabase($table, array $data)
{
return $this->assertInDatabase($table, $data, sprintf(
"Found row(s) in the '%s' table that matched the attributes '%s', but did not expect to.",
$table, json_encode($data)
), true);
} | [
"public",
"function",
"notSeeInDatabase",
"(",
"$",
"table",
",",
"array",
"$",
"data",
")",
"{",
"return",
"$",
"this",
"->",
"assertInDatabase",
"(",
"$",
"table",
",",
"$",
"data",
",",
"sprintf",
"(",
"\"Found row(s) in the '%s' table that matched the attribut... | Ensure that a database table does not contain a row with the given data.
@param string $table
@param array $data
@return static | [
"Ensure",
"that",
"a",
"database",
"table",
"does",
"not",
"contain",
"a",
"row",
"with",
"the",
"given",
"data",
"."
] | train | https://github.com/laracasts/Integrated/blob/4c2dbbcd6343cdcd772e493d44b9dc4d794553a8/src/Extensions/IntegrationTrait.php#L567-L573 |
laracasts/Integrated | src/Extensions/IntegrationTrait.php | IntegrationTrait.getPackageConfig | protected function getPackageConfig($key = null)
{
if (! file_exists('integrated.json') && ! file_exists('integrated.php')) {
return [];
}
if ( ! $this->packageConfig) {
$this->loadPreferredConfigFile();
}
if ($key) {
if (! isset($this->p... | php | protected function getPackageConfig($key = null)
{
if (! file_exists('integrated.json') && ! file_exists('integrated.php')) {
return [];
}
if ( ! $this->packageConfig) {
$this->loadPreferredConfigFile();
}
if ($key) {
if (! isset($this->p... | [
"protected",
"function",
"getPackageConfig",
"(",
"$",
"key",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"file_exists",
"(",
"'integrated.json'",
")",
"&&",
"!",
"file_exists",
"(",
"'integrated.php'",
")",
")",
"{",
"return",
"[",
"]",
";",
"}",
"if",
"(",
... | Fetch the user-provided package configuration.
@param string|null $key
@return object | [
"Fetch",
"the",
"user",
"-",
"provided",
"package",
"configuration",
"."
] | train | https://github.com/laracasts/Integrated/blob/4c2dbbcd6343cdcd772e493d44b9dc4d794553a8/src/Extensions/IntegrationTrait.php#L645-L666 |
laracasts/Integrated | src/Extensions/IntegrationTrait.php | IntegrationTrait.loadPreferredConfigFile | protected function loadPreferredConfigFile()
{
if (file_exists('integrated.php')) {
return $this->packageConfig = require('integrated.php');
}
if (file_exists('integrated.json')) {
$this->packageConfig = json_decode(file_get_contents('integrated.json'), true);
... | php | protected function loadPreferredConfigFile()
{
if (file_exists('integrated.php')) {
return $this->packageConfig = require('integrated.php');
}
if (file_exists('integrated.json')) {
$this->packageConfig = json_decode(file_get_contents('integrated.json'), true);
... | [
"protected",
"function",
"loadPreferredConfigFile",
"(",
")",
"{",
"if",
"(",
"file_exists",
"(",
"'integrated.php'",
")",
")",
"{",
"return",
"$",
"this",
"->",
"packageConfig",
"=",
"require",
"(",
"'integrated.php'",
")",
";",
"}",
"if",
"(",
"file_exists",... | Load the configuration file.
@return void | [
"Load",
"the",
"configuration",
"file",
"."
] | train | https://github.com/laracasts/Integrated/blob/4c2dbbcd6343cdcd772e493d44b9dc4d794553a8/src/Extensions/IntegrationTrait.php#L673-L682 |
laracasts/Integrated | src/Extensions/Selenium.php | Selenium.makeRequest | protected function makeRequest($requestType, $uri, $parameters = [])
{
try {
$this->closeBrowser();
$this->session = $this->newSession()->open($uri);
$this->updateCurrentUrl();
} catch (CurlExec $e) {
throw new CurlExec(
"Hold on there,... | php | protected function makeRequest($requestType, $uri, $parameters = [])
{
try {
$this->closeBrowser();
$this->session = $this->newSession()->open($uri);
$this->updateCurrentUrl();
} catch (CurlExec $e) {
throw new CurlExec(
"Hold on there,... | [
"protected",
"function",
"makeRequest",
"(",
"$",
"requestType",
",",
"$",
"uri",
",",
"$",
"parameters",
"=",
"[",
"]",
")",
"{",
"try",
"{",
"$",
"this",
"->",
"closeBrowser",
"(",
")",
";",
"$",
"this",
"->",
"session",
"=",
"$",
"this",
"->",
"... | Call a URI in the application.
@param string $requestType
@param string $uri
@param array $parameters
@return self | [
"Call",
"a",
"URI",
"in",
"the",
"application",
"."
] | train | https://github.com/laracasts/Integrated/blob/4c2dbbcd6343cdcd772e493d44b9dc4d794553a8/src/Extensions/Selenium.php#L65-L80 |
laracasts/Integrated | src/Extensions/Selenium.php | Selenium.click | public function click($name)
{
$page = $this->currentPage();
try {
$link = $this->findByBody($name)->click();
} catch (InvalidArgumentException $e) {
$link = $this->findByNameOrId($name)->click();
}
$this->updateCurrentUrl();
$this->assertPa... | php | public function click($name)
{
$page = $this->currentPage();
try {
$link = $this->findByBody($name)->click();
} catch (InvalidArgumentException $e) {
$link = $this->findByNameOrId($name)->click();
}
$this->updateCurrentUrl();
$this->assertPa... | [
"public",
"function",
"click",
"(",
"$",
"name",
")",
"{",
"$",
"page",
"=",
"$",
"this",
"->",
"currentPage",
"(",
")",
";",
"try",
"{",
"$",
"link",
"=",
"$",
"this",
"->",
"findByBody",
"(",
"$",
"name",
")",
"->",
"click",
"(",
")",
";",
"}... | Click a link with the given body.
@param string $name
@return static | [
"Click",
"a",
"link",
"with",
"the",
"given",
"body",
"."
] | train | https://github.com/laracasts/Integrated/blob/4c2dbbcd6343cdcd772e493d44b9dc4d794553a8/src/Extensions/Selenium.php#L88-L107 |
laracasts/Integrated | src/Extensions/Selenium.php | Selenium.findByNameOrId | protected function findByNameOrId($name, $element = '*')
{
$name = str_replace('#', '', $name);
try {
return $this->session->element('css selector', "#{$name}, *[name={$name}]");
} catch (NoSuchElement $e) {
throw new InvalidArgumentException(
"Couldn... | php | protected function findByNameOrId($name, $element = '*')
{
$name = str_replace('#', '', $name);
try {
return $this->session->element('css selector', "#{$name}, *[name={$name}]");
} catch (NoSuchElement $e) {
throw new InvalidArgumentException(
"Couldn... | [
"protected",
"function",
"findByNameOrId",
"(",
"$",
"name",
",",
"$",
"element",
"=",
"'*'",
")",
"{",
"$",
"name",
"=",
"str_replace",
"(",
"'#'",
",",
"''",
",",
"$",
"name",
")",
";",
"try",
"{",
"return",
"$",
"this",
"->",
"session",
"->",
"e... | Filter according to an element's name or id attribute.
@param string $name
@param string $element
@return Crawler | [
"Filter",
"according",
"to",
"an",
"element",
"s",
"name",
"or",
"id",
"attribute",
"."
] | train | https://github.com/laracasts/Integrated/blob/4c2dbbcd6343cdcd772e493d44b9dc4d794553a8/src/Extensions/Selenium.php#L131-L142 |
laracasts/Integrated | src/Extensions/Selenium.php | Selenium.findByValue | protected function findByValue($value, $element = 'input')
{
try {
return $this->session->element('css selector', "{$element}[value='{$value}']");
} catch (NoSuchElement $e) {
try {
return $this->session->element('xpath', "//button[contains(text(),'{$value}')]... | php | protected function findByValue($value, $element = 'input')
{
try {
return $this->session->element('css selector', "{$element}[value='{$value}']");
} catch (NoSuchElement $e) {
try {
return $this->session->element('xpath', "//button[contains(text(),'{$value}')]... | [
"protected",
"function",
"findByValue",
"(",
"$",
"value",
",",
"$",
"element",
"=",
"'input'",
")",
"{",
"try",
"{",
"return",
"$",
"this",
"->",
"session",
"->",
"element",
"(",
"'css selector'",
",",
"\"{$element}[value='{$value}']\"",
")",
";",
"}",
"cat... | Find an element by its "value" attribute.
@param string $value
@param string $element
@return \Session | [
"Find",
"an",
"element",
"by",
"its",
"value",
"attribute",
"."
] | train | https://github.com/laracasts/Integrated/blob/4c2dbbcd6343cdcd772e493d44b9dc4d794553a8/src/Extensions/Selenium.php#L151-L165 |
laracasts/Integrated | src/Extensions/Selenium.php | Selenium.submitForm | public function submitForm($buttonText, $formData = [])
{
foreach ($formData as $name => $value) {
// Weird, but that's what you gotta do. :)
$value = ['value' => [$value]];
$element = $this->findByNameOrId($name);
$tag = $element->name();
if ($t... | php | public function submitForm($buttonText, $formData = [])
{
foreach ($formData as $name => $value) {
// Weird, but that's what you gotta do. :)
$value = ['value' => [$value]];
$element = $this->findByNameOrId($name);
$tag = $element->name();
if ($t... | [
"public",
"function",
"submitForm",
"(",
"$",
"buttonText",
",",
"$",
"formData",
"=",
"[",
"]",
")",
"{",
"foreach",
"(",
"$",
"formData",
"as",
"$",
"name",
"=>",
"$",
"value",
")",
"{",
"// Weird, but that's what you gotta do. :)",
"$",
"value",
"=",
"[... | Submit a form on the page.
@param string $buttonText
@param array $formData
@return static | [
"Submit",
"a",
"form",
"on",
"the",
"page",
"."
] | train | https://github.com/laracasts/Integrated/blob/4c2dbbcd6343cdcd772e493d44b9dc4d794553a8/src/Extensions/Selenium.php#L174-L195 |
laracasts/Integrated | src/Extensions/Selenium.php | Selenium.type | public function type($text, $element)
{
$value = ['value' => [$text]];
$this->findByNameOrId($element, $text)->postValue($value);
return $this;
} | php | public function type($text, $element)
{
$value = ['value' => [$text]];
$this->findByNameOrId($element, $text)->postValue($value);
return $this;
} | [
"public",
"function",
"type",
"(",
"$",
"text",
",",
"$",
"element",
")",
"{",
"$",
"value",
"=",
"[",
"'value'",
"=>",
"[",
"$",
"text",
"]",
"]",
";",
"$",
"this",
"->",
"findByNameOrId",
"(",
"$",
"element",
",",
"$",
"text",
")",
"->",
"postV... | Fill in an input with the given text.
@param string $text
@param string $element
@return static | [
"Fill",
"in",
"an",
"input",
"with",
"the",
"given",
"text",
"."
] | train | https://github.com/laracasts/Integrated/blob/4c2dbbcd6343cdcd772e493d44b9dc4d794553a8/src/Extensions/Selenium.php#L204-L210 |
laracasts/Integrated | src/Extensions/Selenium.php | Selenium.attachFile | public function attachFile($element, $absolutePath)
{
$path = ['value' => [$absolutePath]];
$this->findByNameOrId($element)->postValue($path);
return $this;
} | php | public function attachFile($element, $absolutePath)
{
$path = ['value' => [$absolutePath]];
$this->findByNameOrId($element)->postValue($path);
return $this;
} | [
"public",
"function",
"attachFile",
"(",
"$",
"element",
",",
"$",
"absolutePath",
")",
"{",
"$",
"path",
"=",
"[",
"'value'",
"=>",
"[",
"$",
"absolutePath",
"]",
"]",
";",
"$",
"this",
"->",
"findByNameOrId",
"(",
"$",
"element",
")",
"->",
"postValu... | Attach a file to a form.
@param string $element
@param string $absolutePath
@return static | [
"Attach",
"a",
"file",
"to",
"a",
"form",
"."
] | train | https://github.com/laracasts/Integrated/blob/4c2dbbcd6343cdcd772e493d44b9dc4d794553a8/src/Extensions/Selenium.php#L257-L264 |
laracasts/Integrated | src/Extensions/Selenium.php | Selenium.seeInAlert | public function seeInAlert($text, $accept = true)
{
try {
$alert = $this->session->alert_text();
} catch (\WebDriver\Exception\NoAlertOpenError $e) {
throw new PHPUnitException(
"Could not see '{$text}' because no alert box was shown."
);
}... | php | public function seeInAlert($text, $accept = true)
{
try {
$alert = $this->session->alert_text();
} catch (\WebDriver\Exception\NoAlertOpenError $e) {
throw new PHPUnitException(
"Could not see '{$text}' because no alert box was shown."
);
}... | [
"public",
"function",
"seeInAlert",
"(",
"$",
"text",
",",
"$",
"accept",
"=",
"true",
")",
"{",
"try",
"{",
"$",
"alert",
"=",
"$",
"this",
"->",
"session",
"->",
"alert_text",
"(",
")",
";",
"}",
"catch",
"(",
"\\",
"WebDriver",
"\\",
"Exception",
... | Assert that an alert box is displayed, and contains the given text.
@param string $text
@param boolean $accept
@return | [
"Assert",
"that",
"an",
"alert",
"box",
"is",
"displayed",
"and",
"contains",
"the",
"given",
"text",
"."
] | train | https://github.com/laracasts/Integrated/blob/4c2dbbcd6343cdcd772e493d44b9dc4d794553a8/src/Extensions/Selenium.php#L284-L306 |
laracasts/Integrated | src/Extensions/Selenium.php | Selenium.acceptAlert | public function acceptAlert()
{
try {
$this->session->accept_alert();
} catch (\WebDriver\Exception\NoAlertOpenError $e) {
throw new PHPUnitException(
"Well, tried to accept the alert, but there wasn't one. Dangit."
);
}
return $th... | php | public function acceptAlert()
{
try {
$this->session->accept_alert();
} catch (\WebDriver\Exception\NoAlertOpenError $e) {
throw new PHPUnitException(
"Well, tried to accept the alert, but there wasn't one. Dangit."
);
}
return $th... | [
"public",
"function",
"acceptAlert",
"(",
")",
"{",
"try",
"{",
"$",
"this",
"->",
"session",
"->",
"accept_alert",
"(",
")",
";",
"}",
"catch",
"(",
"\\",
"WebDriver",
"\\",
"Exception",
"\\",
"NoAlertOpenError",
"$",
"e",
")",
"{",
"throw",
"new",
"P... | Accept an alert.
@return static | [
"Accept",
"an",
"alert",
"."
] | train | https://github.com/laracasts/Integrated/blob/4c2dbbcd6343cdcd772e493d44b9dc4d794553a8/src/Extensions/Selenium.php#L313-L324 |
laracasts/Integrated | src/Extensions/Selenium.php | Selenium.snap | public function snap($destination = null)
{
$destination = $destination ?: './tests/logs/screenshot.png';
$this->files()->put(
$destination,
base64_decode($this->session->screenshot())
);
return $this;
} | php | public function snap($destination = null)
{
$destination = $destination ?: './tests/logs/screenshot.png';
$this->files()->put(
$destination,
base64_decode($this->session->screenshot())
);
return $this;
} | [
"public",
"function",
"snap",
"(",
"$",
"destination",
"=",
"null",
")",
"{",
"$",
"destination",
"=",
"$",
"destination",
"?",
":",
"'./tests/logs/screenshot.png'",
";",
"$",
"this",
"->",
"files",
"(",
")",
"->",
"put",
"(",
"$",
"destination",
",",
"b... | Take a snapshot of the current page.
@param string|null $destination
@return static | [
"Take",
"a",
"snapshot",
"of",
"the",
"current",
"page",
"."
] | train | https://github.com/laracasts/Integrated/blob/4c2dbbcd6343cdcd772e493d44b9dc4d794553a8/src/Extensions/Selenium.php#L332-L342 |
laracasts/Integrated | src/Extensions/Selenium.php | Selenium.waitForElement | public function waitForElement($element, $timeout = 5000)
{
$this->session->timeouts()->postImplicit_wait(['ms' => $timeout]);
try {
$this->findByNameOrId($element);
} catch (InvalidArgumentException $e) {
throw new InvalidArgumentException(
"Hey, wha... | php | public function waitForElement($element, $timeout = 5000)
{
$this->session->timeouts()->postImplicit_wait(['ms' => $timeout]);
try {
$this->findByNameOrId($element);
} catch (InvalidArgumentException $e) {
throw new InvalidArgumentException(
"Hey, wha... | [
"public",
"function",
"waitForElement",
"(",
"$",
"element",
",",
"$",
"timeout",
"=",
"5000",
")",
"{",
"$",
"this",
"->",
"session",
"->",
"timeouts",
"(",
")",
"->",
"postImplicit_wait",
"(",
"[",
"'ms'",
"=>",
"$",
"timeout",
"]",
")",
";",
"try",
... | Continuously poll the page, until you find an element
with the given name or id.
@param string $element
@param integer $timeout
@return static | [
"Continuously",
"poll",
"the",
"page",
"until",
"you",
"find",
"an",
"element",
"with",
"the",
"given",
"name",
"or",
"id",
"."
] | train | https://github.com/laracasts/Integrated/blob/4c2dbbcd6343cdcd772e493d44b9dc4d794553a8/src/Extensions/Selenium.php#L430-L444 |
laracasts/Integrated | src/Extensions/Selenium.php | Selenium.newSession | protected function newSession()
{
$config = $this->getPackageConfig();
$host = isset($config['selenium']['host']) ? $config['selenium']['host'] : 'http://localhost:4444/wd/hub';
$this->webDriver = new WebDriver($host);
$capabilities = [];
return $this->session = $this->web... | php | protected function newSession()
{
$config = $this->getPackageConfig();
$host = isset($config['selenium']['host']) ? $config['selenium']['host'] : 'http://localhost:4444/wd/hub';
$this->webDriver = new WebDriver($host);
$capabilities = [];
return $this->session = $this->web... | [
"protected",
"function",
"newSession",
"(",
")",
"{",
"$",
"config",
"=",
"$",
"this",
"->",
"getPackageConfig",
"(",
")",
";",
"$",
"host",
"=",
"isset",
"(",
"$",
"config",
"[",
"'selenium'",
"]",
"[",
"'host'",
"]",
")",
"?",
"$",
"config",
"[",
... | Create a new WebDriver session.
@param string $browser
@return Session | [
"Create",
"a",
"new",
"WebDriver",
"session",
"."
] | train | https://github.com/laracasts/Integrated/blob/4c2dbbcd6343cdcd772e493d44b9dc4d794553a8/src/Extensions/Selenium.php#L452-L462 |
laracasts/Integrated | src/Extensions/Traits/ApiRequests.php | ApiRequests.get | protected function get($uri, array $params = [])
{
$this->call('GET', $uri, $params, [], $this->cookies, $this->headers);
return $this;
} | php | protected function get($uri, array $params = [])
{
$this->call('GET', $uri, $params, [], $this->cookies, $this->headers);
return $this;
} | [
"protected",
"function",
"get",
"(",
"$",
"uri",
",",
"array",
"$",
"params",
"=",
"[",
"]",
")",
"{",
"$",
"this",
"->",
"call",
"(",
"'GET'",
",",
"$",
"uri",
",",
"$",
"params",
",",
"[",
"]",
",",
"$",
"this",
"->",
"cookies",
",",
"$",
"... | Make a GET request to an API endpoint.
@param string $uri
@param array $params
@return static | [
"Make",
"a",
"GET",
"request",
"to",
"an",
"API",
"endpoint",
"."
] | train | https://github.com/laracasts/Integrated/blob/4c2dbbcd6343cdcd772e493d44b9dc4d794553a8/src/Extensions/Traits/ApiRequests.php#L31-L36 |
laracasts/Integrated | src/Extensions/Traits/ApiRequests.php | ApiRequests.post | protected function post($uri, array $data)
{
$this->call('POST', $uri, $data, $this->cookies, [], $this->headers);
return $this;
} | php | protected function post($uri, array $data)
{
$this->call('POST', $uri, $data, $this->cookies, [], $this->headers);
return $this;
} | [
"protected",
"function",
"post",
"(",
"$",
"uri",
",",
"array",
"$",
"data",
")",
"{",
"$",
"this",
"->",
"call",
"(",
"'POST'",
",",
"$",
"uri",
",",
"$",
"data",
",",
"$",
"this",
"->",
"cookies",
",",
"[",
"]",
",",
"$",
"this",
"->",
"heade... | Make a POST request to an API endpoint.
@param string $uri
@param array $data
@return static | [
"Make",
"a",
"POST",
"request",
"to",
"an",
"API",
"endpoint",
"."
] | train | https://github.com/laracasts/Integrated/blob/4c2dbbcd6343cdcd772e493d44b9dc4d794553a8/src/Extensions/Traits/ApiRequests.php#L56-L61 |
laracasts/Integrated | src/Extensions/Traits/ApiRequests.php | ApiRequests.put | protected function put($uri, array $data)
{
$this->call('PUT', $uri, $data, $this->cookies, [], $this->headers);
return $this;
} | php | protected function put($uri, array $data)
{
$this->call('PUT', $uri, $data, $this->cookies, [], $this->headers);
return $this;
} | [
"protected",
"function",
"put",
"(",
"$",
"uri",
",",
"array",
"$",
"data",
")",
"{",
"$",
"this",
"->",
"call",
"(",
"'PUT'",
",",
"$",
"uri",
",",
"$",
"data",
",",
"$",
"this",
"->",
"cookies",
",",
"[",
"]",
",",
"$",
"this",
"->",
"headers... | Make a PUT request to an API endpoint.
@param string $uri
@param array $data
@return static | [
"Make",
"a",
"PUT",
"request",
"to",
"an",
"API",
"endpoint",
"."
] | train | https://github.com/laracasts/Integrated/blob/4c2dbbcd6343cdcd772e493d44b9dc4d794553a8/src/Extensions/Traits/ApiRequests.php#L70-L75 |
laracasts/Integrated | src/Extensions/Traits/ApiRequests.php | ApiRequests.patch | protected function patch($uri, array $data)
{
$this->call('PATCH', $uri, $data, $this->cookies, [], $this->headers);
return $this;
} | php | protected function patch($uri, array $data)
{
$this->call('PATCH', $uri, $data, $this->cookies, [], $this->headers);
return $this;
} | [
"protected",
"function",
"patch",
"(",
"$",
"uri",
",",
"array",
"$",
"data",
")",
"{",
"$",
"this",
"->",
"call",
"(",
"'PATCH'",
",",
"$",
"uri",
",",
"$",
"data",
",",
"$",
"this",
"->",
"cookies",
",",
"[",
"]",
",",
"$",
"this",
"->",
"hea... | Make a PATCH request to an API endpoint.
@param string $uri
@param array $data
@return static | [
"Make",
"a",
"PATCH",
"request",
"to",
"an",
"API",
"endpoint",
"."
] | train | https://github.com/laracasts/Integrated/blob/4c2dbbcd6343cdcd772e493d44b9dc4d794553a8/src/Extensions/Traits/ApiRequests.php#L84-L89 |
laracasts/Integrated | src/Extensions/Traits/ApiRequests.php | ApiRequests.delete | protected function delete($uri, array $data = [])
{
$this->call('DELETE', $uri, $data, $this->cookies, [], $this->headers);
return $this;
} | php | protected function delete($uri, array $data = [])
{
$this->call('DELETE', $uri, $data, $this->cookies, [], $this->headers);
return $this;
} | [
"protected",
"function",
"delete",
"(",
"$",
"uri",
",",
"array",
"$",
"data",
"=",
"[",
"]",
")",
"{",
"$",
"this",
"->",
"call",
"(",
"'DELETE'",
",",
"$",
"uri",
",",
"$",
"data",
",",
"$",
"this",
"->",
"cookies",
",",
"[",
"]",
",",
"$",
... | Make a DELETE request to an API endpoint.
@param string $uri
@param array $data
@return static | [
"Make",
"a",
"DELETE",
"request",
"to",
"an",
"API",
"endpoint",
"."
] | train | https://github.com/laracasts/Integrated/blob/4c2dbbcd6343cdcd772e493d44b9dc4d794553a8/src/Extensions/Traits/ApiRequests.php#L98-L103 |
laracasts/Integrated | src/Extensions/Traits/ApiRequests.php | ApiRequests.seeJsonEquals | protected function seeJsonEquals($expected)
{
if (is_array($expected)) {
$expected = json_encode($expected);
}
$this->assertJsonStringEqualsJsonString($expected, $this->response());
return $this;
} | php | protected function seeJsonEquals($expected)
{
if (is_array($expected)) {
$expected = json_encode($expected);
}
$this->assertJsonStringEqualsJsonString($expected, $this->response());
return $this;
} | [
"protected",
"function",
"seeJsonEquals",
"(",
"$",
"expected",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"expected",
")",
")",
"{",
"$",
"expected",
"=",
"json_encode",
"(",
"$",
"expected",
")",
";",
"}",
"$",
"this",
"->",
"assertJsonStringEqualsJsonSt... | Assert that an API response equals the provided array
or json-encoded array.
@param array|string $expected
@return static | [
"Assert",
"that",
"an",
"API",
"response",
"equals",
"the",
"provided",
"array",
"or",
"json",
"-",
"encoded",
"array",
"."
] | train | https://github.com/laracasts/Integrated/blob/4c2dbbcd6343cdcd772e493d44b9dc4d794553a8/src/Extensions/Traits/ApiRequests.php#L160-L169 |
laracasts/Integrated | src/Extensions/Traits/ApiRequests.php | ApiRequests.seeJsonContains | protected function seeJsonContains($expected)
{
$response = json_decode($this->response(), true);
$this->sortJson($expected);
$this->sortJson($response);
foreach ($expected as $key => $value) {
if ( ! str_contains(json_encode($response), trim(json_encode([$key => $value... | php | protected function seeJsonContains($expected)
{
$response = json_decode($this->response(), true);
$this->sortJson($expected);
$this->sortJson($response);
foreach ($expected as $key => $value) {
if ( ! str_contains(json_encode($response), trim(json_encode([$key => $value... | [
"protected",
"function",
"seeJsonContains",
"(",
"$",
"expected",
")",
"{",
"$",
"response",
"=",
"json_decode",
"(",
"$",
"this",
"->",
"response",
"(",
")",
",",
"true",
")",
";",
"$",
"this",
"->",
"sortJson",
"(",
"$",
"expected",
")",
";",
"$",
... | Assert that an API response matches the provided array.
@param array $expected
@return static | [
"Assert",
"that",
"an",
"API",
"response",
"matches",
"the",
"provided",
"array",
"."
] | train | https://github.com/laracasts/Integrated/blob/4c2dbbcd6343cdcd772e493d44b9dc4d794553a8/src/Extensions/Traits/ApiRequests.php#L177-L194 |
laracasts/Integrated | src/Extensions/Traits/ApiRequests.php | ApiRequests.sortJson | protected function sortJson(&$array)
{
foreach ($array as &$value) {
if (is_array($value) && isset($value[0])) {
sort($value);
} elseif (is_array($value)) {
$this->sortJson($value);
}
}
return ksort($array);
} | php | protected function sortJson(&$array)
{
foreach ($array as &$value) {
if (is_array($value) && isset($value[0])) {
sort($value);
} elseif (is_array($value)) {
$this->sortJson($value);
}
}
return ksort($array);
} | [
"protected",
"function",
"sortJson",
"(",
"&",
"$",
"array",
")",
"{",
"foreach",
"(",
"$",
"array",
"as",
"&",
"$",
"value",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"value",
")",
"&&",
"isset",
"(",
"$",
"value",
"[",
"0",
"]",
")",
")",
"{... | Sort a JSON response, for easy assertions and comparisons.
@param array &$array
@return array | [
"Sort",
"a",
"JSON",
"response",
"for",
"easy",
"assertions",
"and",
"comparisons",
"."
] | train | https://github.com/laracasts/Integrated/blob/4c2dbbcd6343cdcd772e493d44b9dc4d794553a8/src/Extensions/Traits/ApiRequests.php#L202-L213 |
laracasts/Integrated | src/Extensions/Traits/ApiRequests.php | ApiRequests.withHeaders | protected function withHeaders(array $headers)
{
$clean = [];
foreach ($headers as $key => $value) {
if (! Str::startsWith($key, ['HTTP_', 'CONTENT_'])) {
$key = 'HTTP_' . $key;
}
$clean[$key] = $value;
}
$this->headers = array_m... | php | protected function withHeaders(array $headers)
{
$clean = [];
foreach ($headers as $key => $value) {
if (! Str::startsWith($key, ['HTTP_', 'CONTENT_'])) {
$key = 'HTTP_' . $key;
}
$clean[$key] = $value;
}
$this->headers = array_m... | [
"protected",
"function",
"withHeaders",
"(",
"array",
"$",
"headers",
")",
"{",
"$",
"clean",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"headers",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"if",
"(",
"!",
"Str",
"::",
"startsWith",
"(",
"$",
... | An array of headers to pass along with the request
@param array $headers
@return $this | [
"An",
"array",
"of",
"headers",
"to",
"pass",
"along",
"with",
"the",
"request"
] | train | https://github.com/laracasts/Integrated/blob/4c2dbbcd6343cdcd772e493d44b9dc4d794553a8/src/Extensions/Traits/ApiRequests.php#L221-L236 |
ongr-io/ElasticsearchBundle | DependencyInjection/ONGRElasticsearchExtension.php | ONGRElasticsearchExtension.load | public function load(array $configs, ContainerBuilder $container)
{
$configuration = new Configuration();
$config = $this->processConfiguration($configuration, $configs);
$loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
$loader->loa... | php | public function load(array $configs, ContainerBuilder $container)
{
$configuration = new Configuration();
$config = $this->processConfiguration($configuration, $configs);
$loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
$loader->loa... | [
"public",
"function",
"load",
"(",
"array",
"$",
"configs",
",",
"ContainerBuilder",
"$",
"container",
")",
"{",
"$",
"configuration",
"=",
"new",
"Configuration",
"(",
")",
";",
"$",
"config",
"=",
"$",
"this",
"->",
"processConfiguration",
"(",
"$",
"con... | {@inheritdoc} | [
"{"
] | train | https://github.com/ongr-io/ElasticsearchBundle/blob/c817dc53d3b93129e8575a740e11484c67f79a87/DependencyInjection/ONGRElasticsearchExtension.php#L32-L69 |
ongr-io/ElasticsearchBundle | Service/Manager.php | Manager.getRepository | public function getRepository($className)
{
if (!is_string($className)) {
throw new \InvalidArgumentException('Document class must be a string.');
}
$directory = null;
if (strpos($className, ':')) {
$bundle = explode(':', $className)[0];
if (iss... | php | public function getRepository($className)
{
if (!is_string($className)) {
throw new \InvalidArgumentException('Document class must be a string.');
}
$directory = null;
if (strpos($className, ':')) {
$bundle = explode(':', $className)[0];
if (iss... | [
"public",
"function",
"getRepository",
"(",
"$",
"className",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"className",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"'Document class must be a string.'",
")",
";",
"}",
"$",
"directo... | Returns repository by document class.
@param string $className FQCN or string in Bundle:Document format
@return Repository | [
"Returns",
"repository",
"by",
"document",
"class",
"."
] | train | https://github.com/ongr-io/ElasticsearchBundle/blob/c817dc53d3b93129e8575a740e11484c67f79a87/Service/Manager.php#L180-L206 |
ongr-io/ElasticsearchBundle | Service/Manager.php | Manager.search | public function search(array $types, array $query, array $queryStringParams = [])
{
$params = [];
$params['index'] = $this->getIndexName();
$resolvedTypes = [];
foreach ($types as $type) {
$resolvedTypes[] = $this->resolveTypeName($type);
}
... | php | public function search(array $types, array $query, array $queryStringParams = [])
{
$params = [];
$params['index'] = $this->getIndexName();
$resolvedTypes = [];
foreach ($types as $type) {
$resolvedTypes[] = $this->resolveTypeName($type);
}
... | [
"public",
"function",
"search",
"(",
"array",
"$",
"types",
",",
"array",
"$",
"query",
",",
"array",
"$",
"queryStringParams",
"=",
"[",
"]",
")",
"{",
"$",
"params",
"=",
"[",
"]",
";",
"$",
"params",
"[",
"'index'",
"]",
"=",
"$",
"this",
"->",
... | Executes search query in the index.
@param array $types List of types to search in.
@param array $query Query to execute.
@param array $queryStringParams Query parameters.
@return array | [
"Executes",
"search",
"query",
"in",
"the",
"index",
"."
] | train | https://github.com/ongr-io/ElasticsearchBundle/blob/c817dc53d3b93129e8575a740e11484c67f79a87/Service/Manager.php#L281-L306 |
ongr-io/ElasticsearchBundle | Service/Manager.php | Manager.msearch | public function msearch(array $body)
{
$result = $this->client->msearch(
[
'index' => $this->getIndexName(), // set default index
'body' => $body
]
);
return $result;
} | php | public function msearch(array $body)
{
$result = $this->client->msearch(
[
'index' => $this->getIndexName(), // set default index
'body' => $body
]
);
return $result;
} | [
"public",
"function",
"msearch",
"(",
"array",
"$",
"body",
")",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"client",
"->",
"msearch",
"(",
"[",
"'index'",
"=>",
"$",
"this",
"->",
"getIndexName",
"(",
")",
",",
"// set default index",
"'body'",
"=>",
... | Execute search queries using multisearch api
$body - is array of requests described in elastic Multi Search API
@param $body
@return array | [
"Execute",
"search",
"queries",
"using",
"multisearch",
"api",
"$body",
"-",
"is",
"array",
"of",
"requests",
"described",
"in",
"elastic",
"Multi",
"Search",
"API"
] | train | https://github.com/ongr-io/ElasticsearchBundle/blob/c817dc53d3b93129e8575a740e11484c67f79a87/Service/Manager.php#L315-L324 |
ongr-io/ElasticsearchBundle | Service/Manager.php | Manager.persist | public function persist($document)
{
$documentArray = $this->converter->convertToArray($document);
$type = $this->getMetadataCollector()->getDocumentType(get_class($document));
$this->bulk('index', $type, $documentArray);
} | php | public function persist($document)
{
$documentArray = $this->converter->convertToArray($document);
$type = $this->getMetadataCollector()->getDocumentType(get_class($document));
$this->bulk('index', $type, $documentArray);
} | [
"public",
"function",
"persist",
"(",
"$",
"document",
")",
"{",
"$",
"documentArray",
"=",
"$",
"this",
"->",
"converter",
"->",
"convertToArray",
"(",
"$",
"document",
")",
";",
"$",
"type",
"=",
"$",
"this",
"->",
"getMetadataCollector",
"(",
")",
"->... | Adds document to next flush.
@param object $document | [
"Adds",
"document",
"to",
"next",
"flush",
"."
] | train | https://github.com/ongr-io/ElasticsearchBundle/blob/c817dc53d3b93129e8575a740e11484c67f79a87/Service/Manager.php#L331-L337 |
ongr-io/ElasticsearchBundle | Service/Manager.php | Manager.remove | public function remove($document)
{
$data = $this->converter->convertToArray($document, [], ['_id', '_routing']);
if (!isset($data['_id'])) {
throw new \LogicException(
'In order to use remove() method document class must have property with @Id annotation.'
)... | php | public function remove($document)
{
$data = $this->converter->convertToArray($document, [], ['_id', '_routing']);
if (!isset($data['_id'])) {
throw new \LogicException(
'In order to use remove() method document class must have property with @Id annotation.'
)... | [
"public",
"function",
"remove",
"(",
"$",
"document",
")",
"{",
"$",
"data",
"=",
"$",
"this",
"->",
"converter",
"->",
"convertToArray",
"(",
"$",
"document",
",",
"[",
"]",
",",
"[",
"'_id'",
",",
"'_routing'",
"]",
")",
";",
"if",
"(",
"!",
"iss... | Adds document for removal.
@param object $document | [
"Adds",
"document",
"for",
"removal",
"."
] | train | https://github.com/ongr-io/ElasticsearchBundle/blob/c817dc53d3b93129e8575a740e11484c67f79a87/Service/Manager.php#L344-L357 |
ongr-io/ElasticsearchBundle | Service/Manager.php | Manager.flush | public function flush(array $params = [])
{
return $this->client->indices()->flush(array_merge(['index' => $this->getIndexName()], $params));
} | php | public function flush(array $params = [])
{
return $this->client->indices()->flush(array_merge(['index' => $this->getIndexName()], $params));
} | [
"public",
"function",
"flush",
"(",
"array",
"$",
"params",
"=",
"[",
"]",
")",
"{",
"return",
"$",
"this",
"->",
"client",
"->",
"indices",
"(",
")",
"->",
"flush",
"(",
"array_merge",
"(",
"[",
"'index'",
"=>",
"$",
"this",
"->",
"getIndexName",
"(... | Flushes elasticsearch index.
@param array $params
@return array | [
"Flushes",
"elasticsearch",
"index",
"."
] | train | https://github.com/ongr-io/ElasticsearchBundle/blob/c817dc53d3b93129e8575a740e11484c67f79a87/Service/Manager.php#L366-L369 |
ongr-io/ElasticsearchBundle | Service/Manager.php | Manager.refresh | public function refresh(array $params = [])
{
return $this->client->indices()->refresh(array_merge(['index' => $this->getIndexName()], $params));
} | php | public function refresh(array $params = [])
{
return $this->client->indices()->refresh(array_merge(['index' => $this->getIndexName()], $params));
} | [
"public",
"function",
"refresh",
"(",
"array",
"$",
"params",
"=",
"[",
"]",
")",
"{",
"return",
"$",
"this",
"->",
"client",
"->",
"indices",
"(",
")",
"->",
"refresh",
"(",
"array_merge",
"(",
"[",
"'index'",
"=>",
"$",
"this",
"->",
"getIndexName",
... | Refreshes elasticsearch index.
@param array $params
@return array | [
"Refreshes",
"elasticsearch",
"index",
"."
] | train | https://github.com/ongr-io/ElasticsearchBundle/blob/c817dc53d3b93129e8575a740e11484c67f79a87/Service/Manager.php#L378-L381 |
ongr-io/ElasticsearchBundle | Service/Manager.php | Manager.commit | public function commit(array $params = [])
{
if (!empty($this->bulkQueries)) {
$bulkQueries = array_merge($this->bulkQueries, $this->bulkParams);
$bulkQueries['index']['_index'] = $this->getIndexName();
$this->eventDispatcher->dispatch(
Events::PRE_COMMIT,... | php | public function commit(array $params = [])
{
if (!empty($this->bulkQueries)) {
$bulkQueries = array_merge($this->bulkQueries, $this->bulkParams);
$bulkQueries['index']['_index'] = $this->getIndexName();
$this->eventDispatcher->dispatch(
Events::PRE_COMMIT,... | [
"public",
"function",
"commit",
"(",
"array",
"$",
"params",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"bulkQueries",
")",
")",
"{",
"$",
"bulkQueries",
"=",
"array_merge",
"(",
"$",
"this",
"->",
"bulkQueries",
",",
... | Inserts the current query container to the index, used for bulk queries execution.
@param array $params Parameters that will be passed to the flush or refresh queries.
@return null|array
@throws BulkWithErrorsException | [
"Inserts",
"the",
"current",
"query",
"container",
"to",
"the",
"index",
"used",
"for",
"bulk",
"queries",
"execution",
"."
] | train | https://github.com/ongr-io/ElasticsearchBundle/blob/c817dc53d3b93129e8575a740e11484c67f79a87/Service/Manager.php#L392-L440 |
ongr-io/ElasticsearchBundle | Service/Manager.php | Manager.bulk | public function bulk($operation, $type, array $query)
{
if (!in_array($operation, ['index', 'create', 'update', 'delete'])) {
throw new \InvalidArgumentException('Wrong bulk operation selected');
}
$this->eventDispatcher->dispatch(
Events::BULK,
new BulkE... | php | public function bulk($operation, $type, array $query)
{
if (!in_array($operation, ['index', 'create', 'update', 'delete'])) {
throw new \InvalidArgumentException('Wrong bulk operation selected');
}
$this->eventDispatcher->dispatch(
Events::BULK,
new BulkE... | [
"public",
"function",
"bulk",
"(",
"$",
"operation",
",",
"$",
"type",
",",
"array",
"$",
"query",
")",
"{",
"if",
"(",
"!",
"in_array",
"(",
"$",
"operation",
",",
"[",
"'index'",
",",
"'create'",
",",
"'update'",
",",
"'delete'",
"]",
")",
")",
"... | Adds query to bulk queries container.
@param string $operation One of: index, update, delete, create.
@param string|array $type Elasticsearch type name.
@param array $query DSL to execute.
@throws \InvalidArgumentException
@return null|array | [
"Adds",
"query",
"to",
"bulk",
"queries",
"container",
"."
] | train | https://github.com/ongr-io/ElasticsearchBundle/blob/c817dc53d3b93129e8575a740e11484c67f79a87/Service/Manager.php#L453-L500 |
ongr-io/ElasticsearchBundle | Service/Manager.php | Manager.createIndex | public function createIndex($noMapping = false)
{
if ($noMapping) {
unset($this->indexSettings['body']['mappings']);
}
return $this->getClient()->indices()->create($this->indexSettings);
} | php | public function createIndex($noMapping = false)
{
if ($noMapping) {
unset($this->indexSettings['body']['mappings']);
}
return $this->getClient()->indices()->create($this->indexSettings);
} | [
"public",
"function",
"createIndex",
"(",
"$",
"noMapping",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"noMapping",
")",
"{",
"unset",
"(",
"$",
"this",
"->",
"indexSettings",
"[",
"'body'",
"]",
"[",
"'mappings'",
"]",
")",
";",
"}",
"return",
"$",
"th... | Creates fresh elasticsearch index.
@param bool $noMapping Determines if mapping should be included.
@return array | [
"Creates",
"fresh",
"elasticsearch",
"index",
"."
] | train | https://github.com/ongr-io/ElasticsearchBundle/blob/c817dc53d3b93129e8575a740e11484c67f79a87/Service/Manager.php#L522-L529 |
ongr-io/ElasticsearchBundle | Service/Manager.php | Manager.dropAndCreateIndex | public function dropAndCreateIndex($noMapping = false)
{
try {
if ($this->indexExists()) {
$this->dropIndex();
}
} catch (\Exception $e) {
// Do nothing, our target is to create new index.
}
return $this->createIndex($noMapping);
... | php | public function dropAndCreateIndex($noMapping = false)
{
try {
if ($this->indexExists()) {
$this->dropIndex();
}
} catch (\Exception $e) {
// Do nothing, our target is to create new index.
}
return $this->createIndex($noMapping);
... | [
"public",
"function",
"dropAndCreateIndex",
"(",
"$",
"noMapping",
"=",
"false",
")",
"{",
"try",
"{",
"if",
"(",
"$",
"this",
"->",
"indexExists",
"(",
")",
")",
"{",
"$",
"this",
"->",
"dropIndex",
"(",
")",
";",
"}",
"}",
"catch",
"(",
"\\",
"Ex... | Tries to drop and create fresh elasticsearch index.
@param bool $noMapping Determines if mapping should be included.
@return array | [
"Tries",
"to",
"drop",
"and",
"create",
"fresh",
"elasticsearch",
"index",
"."
] | train | https://github.com/ongr-io/ElasticsearchBundle/blob/c817dc53d3b93129e8575a740e11484c67f79a87/Service/Manager.php#L546-L557 |
ongr-io/ElasticsearchBundle | Service/Manager.php | Manager.find | public function find($className, $id, $routing = null)
{
$type = $this->resolveTypeName($className);
$params = [
'index' => $this->getIndexName(),
'type' => $type,
'id' => $id,
];
if ($routing) {
$params['routing'] = $routing;
... | php | public function find($className, $id, $routing = null)
{
$type = $this->resolveTypeName($className);
$params = [
'index' => $this->getIndexName(),
'type' => $type,
'id' => $id,
];
if ($routing) {
$params['routing'] = $routing;
... | [
"public",
"function",
"find",
"(",
"$",
"className",
",",
"$",
"id",
",",
"$",
"routing",
"=",
"null",
")",
"{",
"$",
"type",
"=",
"$",
"this",
"->",
"resolveTypeName",
"(",
"$",
"className",
")",
";",
"$",
"params",
"=",
"[",
"'index'",
"=>",
"$",... | Returns a single document by ID. Returns NULL if document was not found.
@param string $className Document class name or Elasticsearch type name
@param string $id Document ID to find
@param string $routing Custom routing for the document
@return object | [
"Returns",
"a",
"single",
"document",
"by",
"ID",
".",
"Returns",
"NULL",
"if",
"document",
"was",
"not",
"found",
"."
] | train | https://github.com/ongr-io/ElasticsearchBundle/blob/c817dc53d3b93129e8575a740e11484c67f79a87/Service/Manager.php#L626-L647 |
ongr-io/ElasticsearchBundle | Service/Manager.php | Manager.scroll | public function scroll(
$scrollId,
$scrollDuration = '5m'
) {
$results = $this->getClient()->scroll(['scroll_id' => $scrollId, 'scroll' => $scrollDuration]);
return $results;
} | php | public function scroll(
$scrollId,
$scrollDuration = '5m'
) {
$results = $this->getClient()->scroll(['scroll_id' => $scrollId, 'scroll' => $scrollDuration]);
return $results;
} | [
"public",
"function",
"scroll",
"(",
"$",
"scrollId",
",",
"$",
"scrollDuration",
"=",
"'5m'",
")",
"{",
"$",
"results",
"=",
"$",
"this",
"->",
"getClient",
"(",
")",
"->",
"scroll",
"(",
"[",
"'scroll_id'",
"=>",
"$",
"scrollId",
",",
"'scroll'",
"=>... | Fetches next set of results.
@param string $scrollId
@param string $scrollDuration
@return mixed
@throws \Exception | [
"Fetches",
"next",
"set",
"of",
"results",
"."
] | train | https://github.com/ongr-io/ElasticsearchBundle/blob/c817dc53d3b93129e8575a740e11484c67f79a87/Service/Manager.php#L659-L666 |
ongr-io/ElasticsearchBundle | Service/Manager.php | Manager.getAliases | public function getAliases($params = [])
{
return $this->getClient()->indices()->getAliases(array_merge(['index' => $this->getIndexName()], $params));
} | php | public function getAliases($params = [])
{
return $this->getClient()->indices()->getAliases(array_merge(['index' => $this->getIndexName()], $params));
} | [
"public",
"function",
"getAliases",
"(",
"$",
"params",
"=",
"[",
"]",
")",
"{",
"return",
"$",
"this",
"->",
"getClient",
"(",
")",
"->",
"indices",
"(",
")",
"->",
"getAliases",
"(",
"array_merge",
"(",
"[",
"'index'",
"=>",
"$",
"this",
"->",
"get... | Gets Elasticsearch aliases information.
@param $params
@return array | [
"Gets",
"Elasticsearch",
"aliases",
"information",
".",
"@param",
"$params"
] | train | https://github.com/ongr-io/ElasticsearchBundle/blob/c817dc53d3b93129e8575a740e11484c67f79a87/Service/Manager.php#L694-L697 |
ongr-io/ElasticsearchBundle | Service/Manager.php | Manager.resolveTypeName | private function resolveTypeName($className)
{
if (strpos($className, ':') !== false || strpos($className, '\\') !== false) {
return $this->getMetadataCollector()->getDocumentType($className);
}
return $className;
} | php | private function resolveTypeName($className)
{
if (strpos($className, ':') !== false || strpos($className, '\\') !== false) {
return $this->getMetadataCollector()->getDocumentType($className);
}
return $className;
} | [
"private",
"function",
"resolveTypeName",
"(",
"$",
"className",
")",
"{",
"if",
"(",
"strpos",
"(",
"$",
"className",
",",
"':'",
")",
"!==",
"false",
"||",
"strpos",
"(",
"$",
"className",
",",
"'\\\\'",
")",
"!==",
"false",
")",
"{",
"return",
"$",
... | Resolves type name by class name.
@param string $className
@return string | [
"Resolves",
"type",
"name",
"by",
"class",
"name",
"."
] | train | https://github.com/ongr-io/ElasticsearchBundle/blob/c817dc53d3b93129e8575a740e11484c67f79a87/Service/Manager.php#L706-L713 |
ongr-io/ElasticsearchBundle | Service/Manager.php | Manager.stopwatch | private function stopwatch($action, $name)
{
if (isset($this->stopwatch)) {
$this->stopwatch->$action('ongr_es: '.$name, 'ongr_es');
}
} | php | private function stopwatch($action, $name)
{
if (isset($this->stopwatch)) {
$this->stopwatch->$action('ongr_es: '.$name, 'ongr_es');
}
} | [
"private",
"function",
"stopwatch",
"(",
"$",
"action",
",",
"$",
"name",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"stopwatch",
")",
")",
"{",
"$",
"this",
"->",
"stopwatch",
"->",
"$",
"action",
"(",
"'ongr_es: '",
".",
"$",
"name",
"... | Starts and stops an event in the stopwatch
@param string $action only 'start' and 'stop'
@param string $name name of the event | [
"Starts",
"and",
"stops",
"an",
"event",
"in",
"the",
"stopwatch"
] | train | https://github.com/ongr-io/ElasticsearchBundle/blob/c817dc53d3b93129e8575a740e11484c67f79a87/Service/Manager.php#L721-L726 |
ongr-io/ElasticsearchBundle | Service/ExportService.php | ExportService.exportIndex | public function exportIndex(
Manager $manager,
$filename,
$types,
$chunkSize,
OutputInterface $output,
$maxLinesInFile = 300000
) {
$search = new Search();
$search->addQuery(new MatchAllQuery());
$search->setSize($chunkSize);
$search->... | php | public function exportIndex(
Manager $manager,
$filename,
$types,
$chunkSize,
OutputInterface $output,
$maxLinesInFile = 300000
) {
$search = new Search();
$search->addQuery(new MatchAllQuery());
$search->setSize($chunkSize);
$search->... | [
"public",
"function",
"exportIndex",
"(",
"Manager",
"$",
"manager",
",",
"$",
"filename",
",",
"$",
"types",
",",
"$",
"chunkSize",
",",
"OutputInterface",
"$",
"output",
",",
"$",
"maxLinesInFile",
"=",
"300000",
")",
"{",
"$",
"search",
"=",
"new",
"S... | Exports es index to provided file.
@param Manager $manager
@param string $filename
@param array $types
@param int $chunkSize
@param int $maxLinesInFile
@param OutputInterface $output | [
"Exports",
"es",
"index",
"to",
"provided",
"file",
"."
] | train | https://github.com/ongr-io/ElasticsearchBundle/blob/c817dc53d3b93129e8575a740e11484c67f79a87/Service/ExportService.php#L39-L110 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.