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 |
|---|---|---|---|---|---|---|---|---|---|---|
paulgibbs/behat-wordpress-extension | src/Driver/Element/Wpcli/CommentElement.php | CommentElement.create | public function create($args)
{
$wpcli_args = buildCLIArgs(
array(
'comment_author', 'comment_author_email', 'comment_author_url', 'comment_content', 'comment_date',
'comment_date_gmt', 'comment_parent', 'comment_post_ID', 'user_id', 'comment_agent', 'comment_auth... | php | public function create($args)
{
$wpcli_args = buildCLIArgs(
array(
'comment_author', 'comment_author_email', 'comment_author_url', 'comment_content', 'comment_date',
'comment_date_gmt', 'comment_parent', 'comment_post_ID', 'user_id', 'comment_agent', 'comment_auth... | [
"public",
"function",
"create",
"(",
"$",
"args",
")",
"{",
"$",
"wpcli_args",
"=",
"buildCLIArgs",
"(",
"array",
"(",
"'comment_author'",
",",
"'comment_author_email'",
",",
"'comment_author_url'",
",",
"'comment_content'",
",",
"'comment_date'",
",",
"'comment_dat... | Create an item for this element.
@param array $args Data used to create an object.
@return mixed The new item. | [
"Create",
"an",
"item",
"for",
"this",
"element",
"."
] | train | https://github.com/paulgibbs/behat-wordpress-extension/blob/a5262e58510c8900ac165b91adb861adb8398774/src/Driver/Element/Wpcli/CommentElement.php#L21-L36 |
paulgibbs/behat-wordpress-extension | src/Driver/Element/Wpcli/CommentElement.php | CommentElement.get | public function get($id, $args = [])
{
$wpcli_args = buildCLIArgs(
array(
'field',
'fields',
),
$args
);
array_unshift($wpcli_args, $id, '--format=json');
$comment = $this->drivers->getDriver()->wpcli('comment', 'ge... | php | public function get($id, $args = [])
{
$wpcli_args = buildCLIArgs(
array(
'field',
'fields',
),
$args
);
array_unshift($wpcli_args, $id, '--format=json');
$comment = $this->drivers->getDriver()->wpcli('comment', 'ge... | [
"public",
"function",
"get",
"(",
"$",
"id",
",",
"$",
"args",
"=",
"[",
"]",
")",
"{",
"$",
"wpcli_args",
"=",
"buildCLIArgs",
"(",
"array",
"(",
"'field'",
",",
"'fields'",
",",
")",
",",
"$",
"args",
")",
";",
"array_unshift",
"(",
"$",
"wpcli_a... | Retrieve an item for this element.
@param int|string $id Object ID.
@param array $args Optional data used to fetch an object.
@throws \UnexpectedValueException
@return mixed The item. | [
"Retrieve",
"an",
"item",
"for",
"this",
"element",
"."
] | train | https://github.com/paulgibbs/behat-wordpress-extension/blob/a5262e58510c8900ac165b91adb861adb8398774/src/Driver/Element/Wpcli/CommentElement.php#L48-L67 |
paulgibbs/behat-wordpress-extension | src/Driver/Element/Wpcli/CommentElement.php | CommentElement.delete | public function delete($id, $args = [])
{
$wpcli_args = buildCLIArgs(
['force'],
$args
);
array_unshift($wpcli_args, $id);
$this->drivers->getDriver()->wpcli('comment', 'delete', $wpcli_args);
} | php | public function delete($id, $args = [])
{
$wpcli_args = buildCLIArgs(
['force'],
$args
);
array_unshift($wpcli_args, $id);
$this->drivers->getDriver()->wpcli('comment', 'delete', $wpcli_args);
} | [
"public",
"function",
"delete",
"(",
"$",
"id",
",",
"$",
"args",
"=",
"[",
"]",
")",
"{",
"$",
"wpcli_args",
"=",
"buildCLIArgs",
"(",
"[",
"'force'",
"]",
",",
"$",
"args",
")",
";",
"array_unshift",
"(",
"$",
"wpcli_args",
",",
"$",
"id",
")",
... | Delete an item for this element.
@param int|string $id Object ID.
@param array $args Optional data used to delete an object. | [
"Delete",
"an",
"item",
"for",
"this",
"element",
"."
] | train | https://github.com/paulgibbs/behat-wordpress-extension/blob/a5262e58510c8900ac165b91adb861adb8398774/src/Driver/Element/Wpcli/CommentElement.php#L75-L85 |
paulgibbs/behat-wordpress-extension | src/Listener/DriverListener.php | DriverListener.prepareWordpressDriver | public function prepareWordpressDriver($event)
{
$drivers = array_keys($this->wordpress->getDrivers());
$driver = $this->parameters['default_driver'];
$tags = array_merge($event->getFeature()->getTags(), $event->getScenario()->getTags());
// If the scenario or outline is tagged ... | php | public function prepareWordpressDriver($event)
{
$drivers = array_keys($this->wordpress->getDrivers());
$driver = $this->parameters['default_driver'];
$tags = array_merge($event->getFeature()->getTags(), $event->getScenario()->getTags());
// If the scenario or outline is tagged ... | [
"public",
"function",
"prepareWordpressDriver",
"(",
"$",
"event",
")",
"{",
"$",
"drivers",
"=",
"array_keys",
"(",
"$",
"this",
"->",
"wordpress",
"->",
"getDrivers",
"(",
")",
")",
";",
"$",
"driver",
"=",
"$",
"this",
"->",
"parameters",
"[",
"'defau... | Configures the driver to use before each scenario or outline.
@param ScenarioLikeTested $event | [
"Configures",
"the",
"driver",
"to",
"use",
"before",
"each",
"scenario",
"or",
"outline",
"."
] | train | https://github.com/paulgibbs/behat-wordpress-extension/blob/a5262e58510c8900ac165b91adb861adb8398774/src/Listener/DriverListener.php#L62-L79 |
paulgibbs/behat-wordpress-extension | src/Context/UserContext.php | UserContext.getUserByName | protected function getUserByName(string $username)
{
$found_user = null;
$users = $this->getWordpressParameter('users');
foreach ($users as $user) {
if ($username === $user['username']) {
$found_user = $user;
break;
}
}
... | php | protected function getUserByName(string $username)
{
$found_user = null;
$users = $this->getWordpressParameter('users');
foreach ($users as $user) {
if ($username === $user['username']) {
$found_user = $user;
break;
}
}
... | [
"protected",
"function",
"getUserByName",
"(",
"string",
"$",
"username",
")",
"{",
"$",
"found_user",
"=",
"null",
";",
"$",
"users",
"=",
"$",
"this",
"->",
"getWordpressParameter",
"(",
"'users'",
")",
";",
"foreach",
"(",
"$",
"users",
"as",
"$",
"us... | Verify a username is valid and get the matching user information.
@param string $username
@throws \RuntimeException
@return array The WordPress user details matching the given username. | [
"Verify",
"a",
"username",
"is",
"valid",
"and",
"get",
"the",
"matching",
"user",
"information",
"."
] | train | https://github.com/paulgibbs/behat-wordpress-extension/blob/a5262e58510c8900ac165b91adb861adb8398774/src/Context/UserContext.php#L25-L42 |
paulgibbs/behat-wordpress-extension | src/Context/UserContext.php | UserContext.thereAreUsers | public function thereAreUsers(TableNode $users)
{
$params = $this->getWordpressParameters();
foreach ($users->getHash() as $user) {
if (! isset($user['user_pass'])) {
$user['user_pass'] = $this->getRandomString();
}
$this->createUser($user['user_... | php | public function thereAreUsers(TableNode $users)
{
$params = $this->getWordpressParameters();
foreach ($users->getHash() as $user) {
if (! isset($user['user_pass'])) {
$user['user_pass'] = $this->getRandomString();
}
$this->createUser($user['user_... | [
"public",
"function",
"thereAreUsers",
"(",
"TableNode",
"$",
"users",
")",
"{",
"$",
"params",
"=",
"$",
"this",
"->",
"getWordpressParameters",
"(",
")",
";",
"foreach",
"(",
"$",
"users",
"->",
"getHash",
"(",
")",
"as",
"$",
"user",
")",
"{",
"if",... | Add specified user accounts.
Example: Given there are users:
| user_login | user_email | role |
| admin | admin@example.com | administrator |
@Given /^(?:there are|there is a) users?:/
@param TableNode $users | [
"Add",
"specified",
"user",
"accounts",
"."
] | train | https://github.com/paulgibbs/behat-wordpress-extension/blob/a5262e58510c8900ac165b91adb861adb8398774/src/Context/UserContext.php#L55-L74 |
paulgibbs/behat-wordpress-extension | src/Context/UserContext.php | UserContext.iAmViewingAuthorArchive | public function iAmViewingAuthorArchive(string $username)
{
$found_user = $this->getUserByName($username);
$this->visitPath(sprintf(
$this->getWordpressParameters()['permalinks']['author_archive'],
$this->getUserDataFromUsername('user_nicename', $found_user['username'])
... | php | public function iAmViewingAuthorArchive(string $username)
{
$found_user = $this->getUserByName($username);
$this->visitPath(sprintf(
$this->getWordpressParameters()['permalinks']['author_archive'],
$this->getUserDataFromUsername('user_nicename', $found_user['username'])
... | [
"public",
"function",
"iAmViewingAuthorArchive",
"(",
"string",
"$",
"username",
")",
"{",
"$",
"found_user",
"=",
"$",
"this",
"->",
"getUserByName",
"(",
"$",
"username",
")",
";",
"$",
"this",
"->",
"visitPath",
"(",
"sprintf",
"(",
"$",
"this",
"->",
... | Go to a user's author archive page.
Example: When I am viewing posts published by Paul
@When /^(?:I am|they are) viewing posts published by (.+)$/
@param string $username | [
"Go",
"to",
"a",
"user",
"s",
"author",
"archive",
"page",
"."
] | train | https://github.com/paulgibbs/behat-wordpress-extension/blob/a5262e58510c8900ac165b91adb861adb8398774/src/Context/UserContext.php#L99-L107 |
paulgibbs/behat-wordpress-extension | src/Context/UserContext.php | UserContext.iAmLoggedInAsRole | public function iAmLoggedInAsRole(string $role)
{
$found_user = null;
$users = $this->getWordpressParameter('users');
foreach ($users as $user) {
if (in_array($role, $user['roles'], true)) {
$found_user = $user;
break;
}
}... | php | public function iAmLoggedInAsRole(string $role)
{
$found_user = null;
$users = $this->getWordpressParameter('users');
foreach ($users as $user) {
if (in_array($role, $user['roles'], true)) {
$found_user = $user;
break;
}
}... | [
"public",
"function",
"iAmLoggedInAsRole",
"(",
"string",
"$",
"role",
")",
"{",
"$",
"found_user",
"=",
"null",
";",
"$",
"users",
"=",
"$",
"this",
"->",
"getWordpressParameter",
"(",
"'users'",
")",
";",
"foreach",
"(",
"$",
"users",
"as",
"$",
"user"... | Log user in (with role name).
Example: Given I am logged in as an contributor
@Given /^(?:I am|they are) logged in as an? (.+)$/
@param string $role
@throws \RuntimeException | [
"Log",
"user",
"in",
"(",
"with",
"role",
"name",
")",
"."
] | train | https://github.com/paulgibbs/behat-wordpress-extension/blob/a5262e58510c8900ac165b91adb861adb8398774/src/Context/UserContext.php#L134-L151 |
paulgibbs/behat-wordpress-extension | src/Context/UserContext.php | UserContext.iAmLoggedInAsUser | public function iAmLoggedInAsUser(string $username)
{
$found_user = $this->getUserByName($username);
$this->logIn($found_user['username'], $found_user['password']);
} | php | public function iAmLoggedInAsUser(string $username)
{
$found_user = $this->getUserByName($username);
$this->logIn($found_user['username'], $found_user['password']);
} | [
"public",
"function",
"iAmLoggedInAsUser",
"(",
"string",
"$",
"username",
")",
"{",
"$",
"found_user",
"=",
"$",
"this",
"->",
"getUserByName",
"(",
"$",
"username",
")",
";",
"$",
"this",
"->",
"logIn",
"(",
"$",
"found_user",
"[",
"'username'",
"]",
"... | Log user in (with user name).
Example: Given I am logged in as Mince
@Given /^(?:I am|they are) logged in as (?!an? )(.+)$/
@param string $username
@throws \RuntimeException | [
"Log",
"user",
"in",
"(",
"with",
"user",
"name",
")",
"."
] | train | https://github.com/paulgibbs/behat-wordpress-extension/blob/a5262e58510c8900ac165b91adb861adb8398774/src/Context/UserContext.php#L164-L169 |
paulgibbs/behat-wordpress-extension | src/Context/UserContext.php | UserContext.iShouldNotBeAbleToLogInAsRole | public function iShouldNotBeAbleToLogInAsRole(string $role)
{
try {
$this->iAmLoggedInAsRole($role);
} catch (ExpectationException $e) {
// Expectation fulfilled.
return;
} catch (RuntimeException $e) {
// Expectation fulfilled.
ret... | php | public function iShouldNotBeAbleToLogInAsRole(string $role)
{
try {
$this->iAmLoggedInAsRole($role);
} catch (ExpectationException $e) {
// Expectation fulfilled.
return;
} catch (RuntimeException $e) {
// Expectation fulfilled.
ret... | [
"public",
"function",
"iShouldNotBeAbleToLogInAsRole",
"(",
"string",
"$",
"role",
")",
"{",
"try",
"{",
"$",
"this",
"->",
"iAmLoggedInAsRole",
"(",
"$",
"role",
")",
";",
"}",
"catch",
"(",
"ExpectationException",
"$",
"e",
")",
"{",
"// Expectation fulfille... | Try to log user in (with role name), but expect failure.
Example: Then I should not be able to log in as an editor
@Then /^(?:I|they) should not be able to log in as an? (.+)$/
@param string $role
@throws ExpectationException | [
"Try",
"to",
"log",
"user",
"in",
"(",
"with",
"role",
"name",
")",
"but",
"expect",
"failure",
"."
] | train | https://github.com/paulgibbs/behat-wordpress-extension/blob/a5262e58510c8900ac165b91adb861adb8398774/src/Context/UserContext.php#L182-L201 |
paulgibbs/behat-wordpress-extension | src/Context/UserContext.php | UserContext.iShouldNotBeAbleToLogInAsUser | public function iShouldNotBeAbleToLogInAsUser(string $username)
{
try {
$this->iAmLoggedInAsUser($username);
} catch (ExpectationException $e) {
// Expectation fulfilled.
return;
} catch (RuntimeException $e) {
// Expectation fulfilled.
... | php | public function iShouldNotBeAbleToLogInAsUser(string $username)
{
try {
$this->iAmLoggedInAsUser($username);
} catch (ExpectationException $e) {
// Expectation fulfilled.
return;
} catch (RuntimeException $e) {
// Expectation fulfilled.
... | [
"public",
"function",
"iShouldNotBeAbleToLogInAsUser",
"(",
"string",
"$",
"username",
")",
"{",
"try",
"{",
"$",
"this",
"->",
"iAmLoggedInAsUser",
"(",
"$",
"username",
")",
";",
"}",
"catch",
"(",
"ExpectationException",
"$",
"e",
")",
"{",
"// Expectation ... | Try to log user in (with username), but expect failure.
Example: Then I should not be able to log in as Scotty
@Then /^(?:I|they) should not be able to log in as (.+)$/
@param string $username
@throws ExpectationException | [
"Try",
"to",
"log",
"user",
"in",
"(",
"with",
"username",
")",
"but",
"expect",
"failure",
"."
] | train | https://github.com/paulgibbs/behat-wordpress-extension/blob/a5262e58510c8900ac165b91adb861adb8398774/src/Context/UserContext.php#L214-L233 |
paulgibbs/behat-wordpress-extension | src/Driver/Element/Wpphp/UserElement.php | UserElement.create | public function create($args)
{
$extra_roles = [];
// Store multiple roles; WP can only assign one on user creation.
if (! empty($args['role'])) {
if (! is_array($args['role'])) {
$args['role'] = array_map('trim', explode(',', $args['role']));
}
... | php | public function create($args)
{
$extra_roles = [];
// Store multiple roles; WP can only assign one on user creation.
if (! empty($args['role'])) {
if (! is_array($args['role'])) {
$args['role'] = array_map('trim', explode(',', $args['role']));
}
... | [
"public",
"function",
"create",
"(",
"$",
"args",
")",
"{",
"$",
"extra_roles",
"=",
"[",
"]",
";",
"// Store multiple roles; WP can only assign one on user creation.",
"if",
"(",
"!",
"empty",
"(",
"$",
"args",
"[",
"'role'",
"]",
")",
")",
"{",
"if",
"(",
... | Create an item for this element.
@param array $args Data used to create an object.
@throws \UnexpectedValueException
@return \WP_User The new item. | [
"Create",
"an",
"item",
"for",
"this",
"element",
"."
] | train | https://github.com/paulgibbs/behat-wordpress-extension/blob/a5262e58510c8900ac165b91adb861adb8398774/src/Driver/Element/Wpphp/UserElement.php#L22-L51 |
paulgibbs/behat-wordpress-extension | src/Driver/Element/Wpphp/UserElement.php | UserElement.get | public function get($id, $args = [])
{
if (is_numeric($id) || ! isset($args['by'])) {
$type = 'ID';
} else {
$type = $args['by'];
}
$user = get_user_by($type, $id);
if (! $user) {
throw new UnexpectedValueException(sprintf('[W616] Could n... | php | public function get($id, $args = [])
{
if (is_numeric($id) || ! isset($args['by'])) {
$type = 'ID';
} else {
$type = $args['by'];
}
$user = get_user_by($type, $id);
if (! $user) {
throw new UnexpectedValueException(sprintf('[W616] Could n... | [
"public",
"function",
"get",
"(",
"$",
"id",
",",
"$",
"args",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"is_numeric",
"(",
"$",
"id",
")",
"||",
"!",
"isset",
"(",
"$",
"args",
"[",
"'by'",
"]",
")",
")",
"{",
"$",
"type",
"=",
"'ID'",
";",
"}",... | Retrieve an item for this element.
@param int|string $id Object ID.
@param array $args Optional data used to fetch an object.
@throws \UnexpectedValueException
@return \WP_User The item. | [
"Retrieve",
"an",
"item",
"for",
"this",
"element",
"."
] | train | https://github.com/paulgibbs/behat-wordpress-extension/blob/a5262e58510c8900ac165b91adb861adb8398774/src/Driver/Element/Wpphp/UserElement.php#L63-L78 |
paulgibbs/behat-wordpress-extension | src/Driver/Element/Wpphp/UserElement.php | UserElement.delete | public function delete($id, $args = [])
{
if (! function_exists('\wp_delete_user')) {
require_once ABSPATH . 'wp-admin/includes/user.php';
}
$result = wp_delete_user($id, $args);
if (! $result) {
throw new UnexpectedValueException('[W617] Failed deleting use... | php | public function delete($id, $args = [])
{
if (! function_exists('\wp_delete_user')) {
require_once ABSPATH . 'wp-admin/includes/user.php';
}
$result = wp_delete_user($id, $args);
if (! $result) {
throw new UnexpectedValueException('[W617] Failed deleting use... | [
"public",
"function",
"delete",
"(",
"$",
"id",
",",
"$",
"args",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"!",
"function_exists",
"(",
"'\\wp_delete_user'",
")",
")",
"{",
"require_once",
"ABSPATH",
".",
"'wp-admin/includes/user.php'",
";",
"}",
"$",
"result",... | Delete an item for this element.
@param int $id Object ID.
@param array $args Optional data used to delete an object.
@throws \UnexpectedValueException | [
"Delete",
"an",
"item",
"for",
"this",
"element",
"."
] | train | https://github.com/paulgibbs/behat-wordpress-extension/blob/a5262e58510c8900ac165b91adb861adb8398774/src/Driver/Element/Wpphp/UserElement.php#L104-L115 |
paulgibbs/behat-wordpress-extension | src/Driver/Element/Wpphp/CommentElement.php | CommentElement.create | public function create($args)
{
$comment_id = wp_new_comment($args);
if (! $comment_id) {
throw new UnexpectedValueException('[W600] Failed creating a new comment');
} elseif (is_wp_error($comment_id)) {
throw new UnexpectedValueException(
sprintf('[W... | php | public function create($args)
{
$comment_id = wp_new_comment($args);
if (! $comment_id) {
throw new UnexpectedValueException('[W600] Failed creating a new comment');
} elseif (is_wp_error($comment_id)) {
throw new UnexpectedValueException(
sprintf('[W... | [
"public",
"function",
"create",
"(",
"$",
"args",
")",
"{",
"$",
"comment_id",
"=",
"wp_new_comment",
"(",
"$",
"args",
")",
";",
"if",
"(",
"!",
"$",
"comment_id",
")",
"{",
"throw",
"new",
"UnexpectedValueException",
"(",
"'[W600] Failed creating a new comme... | Create an item for this element.
@param array $args Data used to create an object.
@throws \UnexpectedValueException
@return \WP_Comment The new item. | [
"Create",
"an",
"item",
"for",
"this",
"element",
"."
] | train | https://github.com/paulgibbs/behat-wordpress-extension/blob/a5262e58510c8900ac165b91adb861adb8398774/src/Driver/Element/Wpphp/CommentElement.php#L22-L35 |
paulgibbs/behat-wordpress-extension | src/Driver/Element/Wpphp/CommentElement.php | CommentElement.get | public function get($id, $args = [])
{
$comment = get_comment($id);
if (! $comment) {
throw new UnexpectedValueException(sprintf('[W601] Could not find comment with ID %d', $id));
}
return $comment;
} | php | public function get($id, $args = [])
{
$comment = get_comment($id);
if (! $comment) {
throw new UnexpectedValueException(sprintf('[W601] Could not find comment with ID %d', $id));
}
return $comment;
} | [
"public",
"function",
"get",
"(",
"$",
"id",
",",
"$",
"args",
"=",
"[",
"]",
")",
"{",
"$",
"comment",
"=",
"get_comment",
"(",
"$",
"id",
")",
";",
"if",
"(",
"!",
"$",
"comment",
")",
"{",
"throw",
"new",
"UnexpectedValueException",
"(",
"sprint... | Retrieve an item for this element.
@param int|string $id Object ID.
@param array $args Not used.
@throws \UnexpectedValueException
@return \WP_Comment The item. | [
"Retrieve",
"an",
"item",
"for",
"this",
"element",
"."
] | train | https://github.com/paulgibbs/behat-wordpress-extension/blob/a5262e58510c8900ac165b91adb861adb8398774/src/Driver/Element/Wpphp/CommentElement.php#L47-L56 |
paulgibbs/behat-wordpress-extension | src/Driver/Element/Wpphp/CommentElement.php | CommentElement.delete | public function delete($id, $args = [])
{
$result = wp_delete_comment($id, isset($args['force']));
if (! $result) {
throw new UnexpectedValueException('[W602] Failed deleting a comment');
}
} | php | public function delete($id, $args = [])
{
$result = wp_delete_comment($id, isset($args['force']));
if (! $result) {
throw new UnexpectedValueException('[W602] Failed deleting a comment');
}
} | [
"public",
"function",
"delete",
"(",
"$",
"id",
",",
"$",
"args",
"=",
"[",
"]",
")",
"{",
"$",
"result",
"=",
"wp_delete_comment",
"(",
"$",
"id",
",",
"isset",
"(",
"$",
"args",
"[",
"'force'",
"]",
")",
")",
";",
"if",
"(",
"!",
"$",
"result... | Delete an item for this element.
@param int|string $id Object ID.
@param array $args Optional data used to delete an object.
@throws \UnexpectedValueException | [
"Delete",
"an",
"item",
"for",
"this",
"element",
"."
] | train | https://github.com/paulgibbs/behat-wordpress-extension/blob/a5262e58510c8900ac165b91adb861adb8398774/src/Driver/Element/Wpphp/CommentElement.php#L66-L73 |
paulgibbs/behat-wordpress-extension | src/Driver/Element/Wpphp/WidgetElement.php | WidgetElement.addToSidebar | public function addToSidebar($widget_name, $sidebar_id, $args)
{
global $wp_widget_factory;
$widget_name = strtolower($widget_name);
$widget = wp_filter_object_list($wp_widget_factory->widgets, array('id_base' => $widget_name));
if (! $widget) {
throw new UnexpectedValu... | php | public function addToSidebar($widget_name, $sidebar_id, $args)
{
global $wp_widget_factory;
$widget_name = strtolower($widget_name);
$widget = wp_filter_object_list($wp_widget_factory->widgets, array('id_base' => $widget_name));
if (! $widget) {
throw new UnexpectedValu... | [
"public",
"function",
"addToSidebar",
"(",
"$",
"widget_name",
",",
"$",
"sidebar_id",
",",
"$",
"args",
")",
"{",
"global",
"$",
"wp_widget_factory",
";",
"$",
"widget_name",
"=",
"strtolower",
"(",
"$",
"widget_name",
")",
";",
"$",
"widget",
"=",
"wp_fi... | Adds a widget to the sidebar with the specified arguments
@param string $widget_name The ID base of the widget (e.g. 'meta', 'calendar'). Case insensitive.
@param string $sidebar_id The ID of the sidebar to the add the widget to
@param array $args Associative array of widget settings for this widget
@throws Unexpecte... | [
"Adds",
"a",
"widget",
"to",
"the",
"sidebar",
"with",
"the",
"specified",
"arguments"
] | train | https://github.com/paulgibbs/behat-wordpress-extension/blob/a5262e58510c8900ac165b91adb861adb8398774/src/Driver/Element/Wpphp/WidgetElement.php#L23-L57 |
paulgibbs/behat-wordpress-extension | src/Driver/Element/Wpphp/WidgetElement.php | WidgetElement.getSidebar | public function getSidebar($sidebar_name)
{
global $wp_registered_sidebars;
$sidebar_id = null;
foreach ($wp_registered_sidebars as $registered_sidebar_id => $registered_sidebar) {
if ($sidebar_name === $registered_sidebar['name']) {
$sidebar_id = $registered_si... | php | public function getSidebar($sidebar_name)
{
global $wp_registered_sidebars;
$sidebar_id = null;
foreach ($wp_registered_sidebars as $registered_sidebar_id => $registered_sidebar) {
if ($sidebar_name === $registered_sidebar['name']) {
$sidebar_id = $registered_si... | [
"public",
"function",
"getSidebar",
"(",
"$",
"sidebar_name",
")",
"{",
"global",
"$",
"wp_registered_sidebars",
";",
"$",
"sidebar_id",
"=",
"null",
";",
"foreach",
"(",
"$",
"wp_registered_sidebars",
"as",
"$",
"registered_sidebar_id",
"=>",
"$",
"registered_sid... | Gets a sidebar ID from its human-readable name.
@param string $sidebar_name The name of the sidebar (e.g. 'Footer', 'Widget Area', 'Right Sidebar').
@return string The sidebar ID.
@throws UnexpectedValueException If the sidebar is not registered. | [
"Gets",
"a",
"sidebar",
"ID",
"from",
"its",
"human",
"-",
"readable",
"name",
"."
] | train | https://github.com/paulgibbs/behat-wordpress-extension/blob/a5262e58510c8900ac165b91adb861adb8398774/src/Driver/Element/Wpphp/WidgetElement.php#L68-L86 |
paulgibbs/behat-wordpress-extension | src/Driver/Element/Wpcli/DatabaseElement.php | DatabaseElement.get | public function get($id, $args = [])
{
$wpcli_args = ['--porcelain', '--add-drop-table'];
if (! empty($args['path'])) {
$file = tempnam($args['path'], 'wordhat');
if ($file) {
array_unshift($wpcli_args, $file);
}
};
// Protect aga... | php | public function get($id, $args = [])
{
$wpcli_args = ['--porcelain', '--add-drop-table'];
if (! empty($args['path'])) {
$file = tempnam($args['path'], 'wordhat');
if ($file) {
array_unshift($wpcli_args, $file);
}
};
// Protect aga... | [
"public",
"function",
"get",
"(",
"$",
"id",
",",
"$",
"args",
"=",
"[",
"]",
")",
"{",
"$",
"wpcli_args",
"=",
"[",
"'--porcelain'",
",",
"'--add-drop-table'",
"]",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"args",
"[",
"'path'",
"]",
")",
")",
"{... | Export site database.
@param int $id Not used.
@param array $args
@return string Path to the database dump. | [
"Export",
"site",
"database",
"."
] | train | https://github.com/paulgibbs/behat-wordpress-extension/blob/a5262e58510c8900ac165b91adb861adb8398774/src/Driver/Element/Wpcli/DatabaseElement.php#L21-L39 |
paulgibbs/behat-wordpress-extension | src/PageObject/PostsEditPage.php | PostsEditPage.getMetaBox | public function getMetaBox(string $title): NodeElement
{
$metaboxes = $this->findAll('css', '.postbox');
if ($metaboxes) {
foreach ($metaboxes as $metabox) {
if ($metabox->find('css', 'h2')->getText() === $title) {
return $metabox;
}
... | php | public function getMetaBox(string $title): NodeElement
{
$metaboxes = $this->findAll('css', '.postbox');
if ($metaboxes) {
foreach ($metaboxes as $metabox) {
if ($metabox->find('css', 'h2')->getText() === $title) {
return $metabox;
}
... | [
"public",
"function",
"getMetaBox",
"(",
"string",
"$",
"title",
")",
":",
"NodeElement",
"{",
"$",
"metaboxes",
"=",
"$",
"this",
"->",
"findAll",
"(",
"'css'",
",",
"'.postbox'",
")",
";",
"if",
"(",
"$",
"metaboxes",
")",
"{",
"foreach",
"(",
"$",
... | Get the node element for the specified metabox.
@param string $title The title of the metabox to get
@return \Behat\Mink\Element\NodeElement
@throws \Behat\Mink\Exception\ExpectationException If the metabox cannot be found | [
"Get",
"the",
"node",
"element",
"for",
"the",
"specified",
"metabox",
"."
] | train | https://github.com/paulgibbs/behat-wordpress-extension/blob/a5262e58510c8900ac165b91adb861adb8398774/src/PageObject/PostsEditPage.php#L58-L76 |
PingPlusPlus/pingpp-php | lib/RoyaltySettlement.php | RoyaltySettlement.update | public static function update($royalty_settlement_id, $params, $options = null)
{
$url = static::instanceUrlWithId($royalty_settlement_id);
return static::_directRequest('put', $url, $params, $options);
} | php | public static function update($royalty_settlement_id, $params, $options = null)
{
$url = static::instanceUrlWithId($royalty_settlement_id);
return static::_directRequest('put', $url, $params, $options);
} | [
"public",
"static",
"function",
"update",
"(",
"$",
"royalty_settlement_id",
",",
"$",
"params",
",",
"$",
"options",
"=",
"null",
")",
"{",
"$",
"url",
"=",
"static",
"::",
"instanceUrlWithId",
"(",
"$",
"royalty_settlement_id",
")",
";",
"return",
"static"... | 更新分润结算对象
@param $royalty_settlement_id
@param $params
@return array|PingppObject | [
"更新分润结算对象"
] | train | https://github.com/PingPlusPlus/pingpp-php/blob/ce11a340abea605d76114f0d1587b54cf5ad85bf/lib/RoyaltySettlement.php#L45-L49 |
PingPlusPlus/pingpp-php | lib/Util/Util.php | Util.convertPingppObjectToArray | public static function convertPingppObjectToArray($values, $keep_object = false)
{
$results = array();
foreach ($values as $k => $v) {
// FIXME: this is an encapsulation violation
if ($k[0] == '_') {
continue;
}
if ($v instanceof Pingpp... | php | public static function convertPingppObjectToArray($values, $keep_object = false)
{
$results = array();
foreach ($values as $k => $v) {
// FIXME: this is an encapsulation violation
if ($k[0] == '_') {
continue;
}
if ($v instanceof Pingpp... | [
"public",
"static",
"function",
"convertPingppObjectToArray",
"(",
"$",
"values",
",",
"$",
"keep_object",
"=",
"false",
")",
"{",
"$",
"results",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"values",
"as",
"$",
"k",
"=>",
"$",
"v",
")",
"{",
"... | Recursively converts the PHP Pingpp object to an array.
@param array $values The PHP Pingpp object to convert.
@param bool
@return array | [
"Recursively",
"converts",
"the",
"PHP",
"Pingpp",
"object",
"to",
"an",
"array",
"."
] | train | https://github.com/PingPlusPlus/pingpp-php/blob/ce11a340abea605d76114f0d1587b54cf5ad85bf/lib/Util/Util.php#L36-L53 |
PingPlusPlus/pingpp-php | lib/Util/Util.php | Util.convertPingppObjectToStdObject | public static function convertPingppObjectToStdObject($values)
{
$results = new stdClass;
foreach ($values as $k => $v) {
// FIXME: this is an encapsulation violation
if ($k[0] == '_') {
continue;
}
if ($v instanceof PingppObject) {
... | php | public static function convertPingppObjectToStdObject($values)
{
$results = new stdClass;
foreach ($values as $k => $v) {
// FIXME: this is an encapsulation violation
if ($k[0] == '_') {
continue;
}
if ($v instanceof PingppObject) {
... | [
"public",
"static",
"function",
"convertPingppObjectToStdObject",
"(",
"$",
"values",
")",
"{",
"$",
"results",
"=",
"new",
"stdClass",
";",
"foreach",
"(",
"$",
"values",
"as",
"$",
"k",
"=>",
"$",
"v",
")",
"{",
"// FIXME: this is an encapsulation violation",
... | Recursively converts the PHP Pingpp object to an stdObject.
@param array $values The PHP Pingpp object to convert.
@return array | [
"Recursively",
"converts",
"the",
"PHP",
"Pingpp",
"object",
"to",
"an",
"stdObject",
"."
] | train | https://github.com/PingPlusPlus/pingpp-php/blob/ce11a340abea605d76114f0d1587b54cf5ad85bf/lib/Util/Util.php#L61-L78 |
PingPlusPlus/pingpp-php | lib/Util/Util.php | Util.convertToPingppObject | public static function convertToPingppObject($resp, $opts)
{
$types = array(
'red_envelope'=>'Pingpp\\RedEnvelope',
'charge' => 'Pingpp\\Charge',
'list' => 'Pingpp\\Collection',
'refund' => 'Pingpp\\Refund',
'event' => 'Pingpp\\Event',
... | php | public static function convertToPingppObject($resp, $opts)
{
$types = array(
'red_envelope'=>'Pingpp\\RedEnvelope',
'charge' => 'Pingpp\\Charge',
'list' => 'Pingpp\\Collection',
'refund' => 'Pingpp\\Refund',
'event' => 'Pingpp\\Event',
... | [
"public",
"static",
"function",
"convertToPingppObject",
"(",
"$",
"resp",
",",
"$",
"opts",
")",
"{",
"$",
"types",
"=",
"array",
"(",
"'red_envelope'",
"=>",
"'Pingpp\\\\RedEnvelope'",
",",
"'charge'",
"=>",
"'Pingpp\\\\Charge'",
",",
"'list'",
"=>",
"'Pingpp\... | Converts a response from the Pingpp API to the corresponding PHP object.
@param stdObject $resp The response from the Pingpp API.
@param array $opts
@return PingppObject|array | [
"Converts",
"a",
"response",
"from",
"the",
"Pingpp",
"API",
"to",
"the",
"corresponding",
"PHP",
"object",
"."
] | train | https://github.com/PingPlusPlus/pingpp-php/blob/ce11a340abea605d76114f0d1587b54cf5ad85bf/lib/Util/Util.php#L87-L135 |
PingPlusPlus/pingpp-php | lib/Util/Util.php | Util.getRequestHeaders | public static function getRequestHeaders()
{
if (function_exists('getallheaders')) {
$headers = array();
foreach (getallheaders() as $name => $value) {
$headers[str_replace(' ', '-', ucwords(strtolower(str_replace('-', ' ', $name))))] = $value;
}
... | php | public static function getRequestHeaders()
{
if (function_exists('getallheaders')) {
$headers = array();
foreach (getallheaders() as $name => $value) {
$headers[str_replace(' ', '-', ucwords(strtolower(str_replace('-', ' ', $name))))] = $value;
}
... | [
"public",
"static",
"function",
"getRequestHeaders",
"(",
")",
"{",
"if",
"(",
"function_exists",
"(",
"'getallheaders'",
")",
")",
"{",
"$",
"headers",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"getallheaders",
"(",
")",
"as",
"$",
"name",
"=>",
"$",... | Get the request headers
@return array An hash map of request headers. | [
"Get",
"the",
"request",
"headers"
] | train | https://github.com/PingPlusPlus/pingpp-php/blob/ce11a340abea605d76114f0d1587b54cf5ad85bf/lib/Util/Util.php#L141-L157 |
PingPlusPlus/pingpp-php | lib/User.php | User.retrieve | public static function retrieve($id, $options = null)
{
$url = static::classUrl().'/'.$id;
return static::_directRequest('get', $url, null, $options);
} | php | public static function retrieve($id, $options = null)
{
$url = static::classUrl().'/'.$id;
return static::_directRequest('get', $url, null, $options);
} | [
"public",
"static",
"function",
"retrieve",
"(",
"$",
"id",
",",
"$",
"options",
"=",
"null",
")",
"{",
"$",
"url",
"=",
"static",
"::",
"classUrl",
"(",
")",
".",
"'/'",
".",
"$",
"id",
";",
"return",
"static",
"::",
"_directRequest",
"(",
"'get'",
... | @param string $id The ID of the user to retrieve.
@param array|string|null $options
@return User | [
"@param",
"string",
"$id",
"The",
"ID",
"of",
"the",
"user",
"to",
"retrieve",
".",
"@param",
"array|string|null",
"$options"
] | train | https://github.com/PingPlusPlus/pingpp-php/blob/ce11a340abea605d76114f0d1587b54cf5ad85bf/lib/User.php#L13-L17 |
PingPlusPlus/pingpp-php | lib/WxpubOAuth.php | WxpubOAuth.getOpenid | public static function getOpenid($app_id, $app_secret, $code)
{
$url = WxpubOAuth::_createOauthUrlForOpenid($app_id, $app_secret, $code);
$res = self::_getRequest($url);
$data = json_decode($res, true);
return $data['openid'];
} | php | public static function getOpenid($app_id, $app_secret, $code)
{
$url = WxpubOAuth::_createOauthUrlForOpenid($app_id, $app_secret, $code);
$res = self::_getRequest($url);
$data = json_decode($res, true);
return $data['openid'];
} | [
"public",
"static",
"function",
"getOpenid",
"(",
"$",
"app_id",
",",
"$",
"app_secret",
",",
"$",
"code",
")",
"{",
"$",
"url",
"=",
"WxpubOAuth",
"::",
"_createOauthUrlForOpenid",
"(",
"$",
"app_id",
",",
"$",
"app_secret",
",",
"$",
"code",
")",
";",
... | 获取微信公众号授权用户唯一标识
@param $app_id 微信公众号应用唯一标识
@param $app_secret 微信公众号应用密钥(注意保密)
@param $code 授权code, 通过调用WxpubOAuth::createOauthUrlForCode来获取
@return openid 微信公众号授权用户唯一标识, 可用于微信网页内支付 | [
"获取微信公众号授权用户唯一标识"
] | train | https://github.com/PingPlusPlus/pingpp-php/blob/ce11a340abea605d76114f0d1587b54cf5ad85bf/lib/WxpubOAuth.php#L19-L26 |
PingPlusPlus/pingpp-php | lib/WxpubOAuth.php | WxpubOAuth.createOauthUrlForCode | public static function createOauthUrlForCode($app_id, $redirect_url, $more_info = false)
{
$urlObj = array();
$urlObj['appid'] = $app_id;
$urlObj['redirect_uri'] = $redirect_url;
$urlObj['response_type'] = 'code';
$urlObj['scope'] = $more_info ? 'snsapi_userinfo' : 'snsapi_ba... | php | public static function createOauthUrlForCode($app_id, $redirect_url, $more_info = false)
{
$urlObj = array();
$urlObj['appid'] = $app_id;
$urlObj['redirect_uri'] = $redirect_url;
$urlObj['response_type'] = 'code';
$urlObj['scope'] = $more_info ? 'snsapi_userinfo' : 'snsapi_ba... | [
"public",
"static",
"function",
"createOauthUrlForCode",
"(",
"$",
"app_id",
",",
"$",
"redirect_url",
",",
"$",
"more_info",
"=",
"false",
")",
"{",
"$",
"urlObj",
"=",
"array",
"(",
")",
";",
"$",
"urlObj",
"[",
"'appid'",
"]",
"=",
"$",
"app_id",
";... | 用于获取授权code的URL地址,此地址用于用户身份鉴权,获取用户身份信息,同时重定向到$redirect_url
@param $app_id 微信公众号应用唯一标识
@param $redirect_url 授权后重定向的回调链接地址,重定向后此地址将带有授权code参数,
该地址的域名需在微信公众号平台上进行设置,
步骤为:登陆微信公众号平台 => 开发者中心 => 网页授权获取用户基本信息 => 修改
@param bool $more_info FALSE 不弹出授权页面,直接跳转,这个只能拿到用户openid
TRUE 弹出授权页面,这个可以通过 openid 拿到昵称、性别、所在地,
@return string 用于... | [
"用于获取授权code的URL地址,此地址用于用户身份鉴权,获取用户身份信息,同时重定向到$redirect_url"
] | train | https://github.com/PingPlusPlus/pingpp-php/blob/ce11a340abea605d76114f0d1587b54cf5ad85bf/lib/WxpubOAuth.php#L38-L49 |
PingPlusPlus/pingpp-php | lib/WxpubOAuth.php | WxpubOAuth._createOauthUrlForOpenid | private static function _createOauthUrlForOpenid($app_id, $app_secret, $code)
{
$urlObj = array();
$urlObj['appid'] = $app_id;
$urlObj['secret'] = $app_secret;
$urlObj['code'] = $code;
$urlObj['grant_type'] = 'authorization_code';
$queryStr = http_build_query($urlObj)... | php | private static function _createOauthUrlForOpenid($app_id, $app_secret, $code)
{
$urlObj = array();
$urlObj['appid'] = $app_id;
$urlObj['secret'] = $app_secret;
$urlObj['code'] = $code;
$urlObj['grant_type'] = 'authorization_code';
$queryStr = http_build_query($urlObj)... | [
"private",
"static",
"function",
"_createOauthUrlForOpenid",
"(",
"$",
"app_id",
",",
"$",
"app_secret",
",",
"$",
"code",
")",
"{",
"$",
"urlObj",
"=",
"array",
"(",
")",
";",
"$",
"urlObj",
"[",
"'appid'",
"]",
"=",
"$",
"app_id",
";",
"$",
"urlObj",... | 获取openid的URL地址
@param $app_id 微信公众号应用唯一标识
@param $app_secret 微信公众号应用密钥(注意保密)
@param $code 授权code, 通过调用WxpubOAuth::createOauthUrlForCode来获取
@return string 获取openid的URL地址 | [
"获取openid的URL地址"
] | train | https://github.com/PingPlusPlus/pingpp-php/blob/ce11a340abea605d76114f0d1587b54cf5ad85bf/lib/WxpubOAuth.php#L58-L68 |
PingPlusPlus/pingpp-php | lib/WxpubOAuth.php | WxpubOAuth.getJsapiTicket | public static function getJsapiTicket($app_id, $app_secret) {
$urlObj = array();
$urlObj['appid'] = $app_id;
$urlObj['secret'] = $app_secret;
$urlObj['grant_type'] = 'client_credential';
$queryStr = http_build_query($urlObj);
$accessTokenUrl = 'https://api.weixin.qq.com/c... | php | public static function getJsapiTicket($app_id, $app_secret) {
$urlObj = array();
$urlObj['appid'] = $app_id;
$urlObj['secret'] = $app_secret;
$urlObj['grant_type'] = 'client_credential';
$queryStr = http_build_query($urlObj);
$accessTokenUrl = 'https://api.weixin.qq.com/c... | [
"public",
"static",
"function",
"getJsapiTicket",
"(",
"$",
"app_id",
",",
"$",
"app_secret",
")",
"{",
"$",
"urlObj",
"=",
"array",
"(",
")",
";",
"$",
"urlObj",
"[",
"'appid'",
"]",
"=",
"$",
"app_id",
";",
"$",
"urlObj",
"[",
"'secret'",
"]",
"=",... | 获取微信公众号 jsapi_ticket
@param $app_id 微信公众号应用唯一标识
@param $app_secret 微信公众号应用密钥(注意保密)
@return array 包含 jsapi_ticket 的数组或者错误信息 | [
"获取微信公众号",
"jsapi_ticket"
] | train | https://github.com/PingPlusPlus/pingpp-php/blob/ce11a340abea605d76114f0d1587b54cf5ad85bf/lib/WxpubOAuth.php#L93-L114 |
PingPlusPlus/pingpp-php | lib/WxpubOAuth.php | WxpubOAuth.getSignature | public static function getSignature($charge, $jsapi_ticket, $url = NULL) {
if (!isset($charge['credential']) || !isset($charge['credential']['wx_pub'])) {
return null;
}
$credential = $charge['credential']['wx_pub'];
$arrayToSign = array();
$arrayToSign[] = 'jsapi_tic... | php | public static function getSignature($charge, $jsapi_ticket, $url = NULL) {
if (!isset($charge['credential']) || !isset($charge['credential']['wx_pub'])) {
return null;
}
$credential = $charge['credential']['wx_pub'];
$arrayToSign = array();
$arrayToSign[] = 'jsapi_tic... | [
"public",
"static",
"function",
"getSignature",
"(",
"$",
"charge",
",",
"$",
"jsapi_ticket",
",",
"$",
"url",
"=",
"NULL",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"charge",
"[",
"'credential'",
"]",
")",
"||",
"!",
"isset",
"(",
"$",
"charge",
... | 生成微信公众号 js sdk signature
@param $charge charge
@param $jsapi_ticket
@param $url 是当前网页的 URL,不包含 # 及其后面部分
@return string signature 字符串 | [
"生成微信公众号",
"js",
"sdk",
"signature"
] | train | https://github.com/PingPlusPlus/pingpp-php/blob/ce11a340abea605d76114f0d1587b54cf5ad85bf/lib/WxpubOAuth.php#L123-L142 |
PingPlusPlus/pingpp-php | lib/Agreement.php | Agreement.cancel | public static function cancel($id, $params = null, $options = null)
{
$url = static::classUrl().'/'.$id;
if (empty($params)) {
$params = ['status' => 'canceled'];
} else {
$params = array_merge($params, ['status' => 'canceled']);
}
return static::_dire... | php | public static function cancel($id, $params = null, $options = null)
{
$url = static::classUrl().'/'.$id;
if (empty($params)) {
$params = ['status' => 'canceled'];
} else {
$params = array_merge($params, ['status' => 'canceled']);
}
return static::_dire... | [
"public",
"static",
"function",
"cancel",
"(",
"$",
"id",
",",
"$",
"params",
"=",
"null",
",",
"$",
"options",
"=",
"null",
")",
"{",
"$",
"url",
"=",
"static",
"::",
"classUrl",
"(",
")",
".",
"'/'",
".",
"$",
"id",
";",
"if",
"(",
"empty",
"... | @param string $id API resource ID
@param array|string|null $options
@return Agreement The canceled agreement. | [
"@param",
"string",
"$id",
"API",
"resource",
"ID",
"@param",
"array|string|null",
"$options"
] | train | https://github.com/PingPlusPlus/pingpp-php/blob/ce11a340abea605d76114f0d1587b54cf5ad85bf/lib/Agreement.php#L46-L55 |
PingPlusPlus/pingpp-php | lib/ApiRequestor.php | ApiRequestor.handleApiError | public function handleApiError($rbody, $rcode, $resp)
{
if (!is_object($resp) || !isset($resp->error)) {
$msg = "Invalid response object from API: $rbody "
."(HTTP response code was $rcode)";
throw new Error\Api($msg, $rcode, $rbody, $resp);
}
$error ... | php | public function handleApiError($rbody, $rcode, $resp)
{
if (!is_object($resp) || !isset($resp->error)) {
$msg = "Invalid response object from API: $rbody "
."(HTTP response code was $rcode)";
throw new Error\Api($msg, $rcode, $rbody, $resp);
}
$error ... | [
"public",
"function",
"handleApiError",
"(",
"$",
"rbody",
",",
"$",
"rcode",
",",
"$",
"resp",
")",
"{",
"if",
"(",
"!",
"is_object",
"(",
"$",
"resp",
")",
"||",
"!",
"isset",
"(",
"$",
"resp",
"->",
"error",
")",
")",
"{",
"$",
"msg",
"=",
"... | @param string $rbody A JSON string.
@param int $rcode
@param array $resp
@throws InvalidRequestError if the error is caused by the user.
@throws AuthenticationError if the error is caused by a lack of
permissions.
@throws ApiError otherwise. | [
"@param",
"string",
"$rbody",
"A",
"JSON",
"string",
".",
"@param",
"int",
"$rcode",
"@param",
"array",
"$resp"
] | train | https://github.com/PingPlusPlus/pingpp-php/blob/ce11a340abea605d76114f0d1587b54cf5ad85bf/lib/ApiRequestor.php#L115-L148 |
PingPlusPlus/pingpp-php | lib/RoyaltyTemplate.php | RoyaltyTemplate.update | public static function update($id, $params = [], $options = [])
{
$url = static::classUrl() . '/' . $id;
return static::_directRequest('put', $url, $params, $options);
} | php | public static function update($id, $params = [], $options = [])
{
$url = static::classUrl() . '/' . $id;
return static::_directRequest('put', $url, $params, $options);
} | [
"public",
"static",
"function",
"update",
"(",
"$",
"id",
",",
"$",
"params",
"=",
"[",
"]",
",",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"url",
"=",
"static",
"::",
"classUrl",
"(",
")",
".",
"'/'",
".",
"$",
"id",
";",
"return",
"static... | Update RoyaltyTemplate
@param $id
@param array $params
@param array $options
@return RoyaltyTemplate | [
"Update",
"RoyaltyTemplate"
] | train | https://github.com/PingPlusPlus/pingpp-php/blob/ce11a340abea605d76114f0d1587b54cf5ad85bf/lib/RoyaltyTemplate.php#L40-L44 |
PingPlusPlus/pingpp-php | lib/RoyaltyTemplate.php | RoyaltyTemplate.delete | public static function delete($id, $options = [])
{
$url = static::classUrl() . '/' . $id;
return static::_directRequest('delete', $url, null, $options);
} | php | public static function delete($id, $options = [])
{
$url = static::classUrl() . '/' . $id;
return static::_directRequest('delete', $url, null, $options);
} | [
"public",
"static",
"function",
"delete",
"(",
"$",
"id",
",",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"url",
"=",
"static",
"::",
"classUrl",
"(",
")",
".",
"'/'",
".",
"$",
"id",
";",
"return",
"static",
"::",
"_directRequest",
"(",
"'delet... | Delete RoyaltyTemplate
@param $id
@param array $options
@return RoyaltyTemplate | [
"Delete",
"RoyaltyTemplate"
] | train | https://github.com/PingPlusPlus/pingpp-php/blob/ce11a340abea605d76114f0d1587b54cf5ad85bf/lib/RoyaltyTemplate.php#L52-L56 |
PingPlusPlus/pingpp-php | lib/Charge.php | Charge.reverse | public static function reverse($id, $options = null)
{
$url = static::classUrl().'/'.$id.'/reverse';
$params = [];
return static::_directRequest('post', $url, $params, $options);
} | php | public static function reverse($id, $options = null)
{
$url = static::classUrl().'/'.$id.'/reverse';
$params = [];
return static::_directRequest('post', $url, $params, $options);
} | [
"public",
"static",
"function",
"reverse",
"(",
"$",
"id",
",",
"$",
"options",
"=",
"null",
")",
"{",
"$",
"url",
"=",
"static",
"::",
"classUrl",
"(",
")",
".",
"'/'",
".",
"$",
"id",
".",
"'/reverse'",
";",
"$",
"params",
"=",
"[",
"]",
";",
... | @param string $id The ID of the charge.
@param array|string|null $options
@return Charge The reversed charge. | [
"@param",
"string",
"$id",
"The",
"ID",
"of",
"the",
"charge",
".",
"@param",
"array|string|null",
"$options"
] | train | https://github.com/PingPlusPlus/pingpp-php/blob/ce11a340abea605d76114f0d1587b54cf5ad85bf/lib/Charge.php#L46-L51 |
PingPlusPlus/pingpp-php | lib/BatchWithdrawal.php | BatchWithdrawal.confirm | public static function confirm($params = null, $options = null)
{
$params['status'] = 'pending';
return self::_create($params, $options);
} | php | public static function confirm($params = null, $options = null)
{
$params['status'] = 'pending';
return self::_create($params, $options);
} | [
"public",
"static",
"function",
"confirm",
"(",
"$",
"params",
"=",
"null",
",",
"$",
"options",
"=",
"null",
")",
"{",
"$",
"params",
"[",
"'status'",
"]",
"=",
"'pending'",
";",
"return",
"self",
"::",
"_create",
"(",
"$",
"params",
",",
"$",
"opti... | 批量提现确认
@param array|null $params
@param array|string|null $options
@return BatchWithdrawal The created withdrawal. | [
"批量提现确认",
"@param",
"array|null",
"$params",
"@param",
"array|string|null",
"$options"
] | train | https://github.com/PingPlusPlus/pingpp-php/blob/ce11a340abea605d76114f0d1587b54cf5ad85bf/lib/BatchWithdrawal.php#L30-L34 |
PingPlusPlus/pingpp-php | lib/BatchWithdrawal.php | BatchWithdrawal.cancel | public static function cancel($params = null, $options = null)
{
$params['status'] = 'canceled';
return self::_create($params, $options);
} | php | public static function cancel($params = null, $options = null)
{
$params['status'] = 'canceled';
return self::_create($params, $options);
} | [
"public",
"static",
"function",
"cancel",
"(",
"$",
"params",
"=",
"null",
",",
"$",
"options",
"=",
"null",
")",
"{",
"$",
"params",
"[",
"'status'",
"]",
"=",
"'canceled'",
";",
"return",
"self",
"::",
"_create",
"(",
"$",
"params",
",",
"$",
"opti... | 批量提现撤销
@param null $params
@param null $options
@return array|PingppObject | [
"批量提现撤销"
] | train | https://github.com/PingPlusPlus/pingpp-php/blob/ce11a340abea605d76114f0d1587b54cf5ad85bf/lib/BatchWithdrawal.php#L42-L46 |
PingPlusPlus/pingpp-php | lib/Royalty.php | Royalty.update | public static function update($params, $options = null)
{
$url = static::classUrl();
return static::_directRequest('put', $url, $params, $options);
} | php | public static function update($params, $options = null)
{
$url = static::classUrl();
return static::_directRequest('put', $url, $params, $options);
} | [
"public",
"static",
"function",
"update",
"(",
"$",
"params",
",",
"$",
"options",
"=",
"null",
")",
"{",
"$",
"url",
"=",
"static",
"::",
"classUrl",
"(",
")",
";",
"return",
"static",
"::",
"_directRequest",
"(",
"'put'",
",",
"$",
"url",
",",
"$",... | 批量更新分润对象
@param $params
@param $options
@return Royalty | [
"批量更新分润对象"
] | train | https://github.com/PingPlusPlus/pingpp-php/blob/ce11a340abea605d76114f0d1587b54cf5ad85bf/lib/Royalty.php#L23-L27 |
PingPlusPlus/pingpp-php | lib/Withdrawal.php | Withdrawal.confirm | public static function confirm($id, $options = null)
{
$url = static::classUrl().'/'.$id;
$params = array('status' => 'pending');
return static::_directRequest('put', $url, $params, $options);
} | php | public static function confirm($id, $options = null)
{
$url = static::classUrl().'/'.$id;
$params = array('status' => 'pending');
return static::_directRequest('put', $url, $params, $options);
} | [
"public",
"static",
"function",
"confirm",
"(",
"$",
"id",
",",
"$",
"options",
"=",
"null",
")",
"{",
"$",
"url",
"=",
"static",
"::",
"classUrl",
"(",
")",
".",
"'/'",
".",
"$",
"id",
";",
"$",
"params",
"=",
"array",
"(",
"'status'",
"=>",
"'p... | @param string $id API resource ID
@param array|string|null $options
@return Withdrawal The confirmed withdrawal. | [
"@param",
"string",
"$id",
"API",
"resource",
"ID",
"@param",
"array|string|null",
"$options"
] | train | https://github.com/PingPlusPlus/pingpp-php/blob/ce11a340abea605d76114f0d1587b54cf5ad85bf/lib/Withdrawal.php#L35-L40 |
PingPlusPlus/pingpp-php | lib/Withdrawal.php | Withdrawal.cancel | public static function cancel($id, $options = null)
{
$url = static::classUrl().'/'.$id;
$params = array('status' => 'canceled');
return static::_directRequest('put', $url, $params, $options);
} | php | public static function cancel($id, $options = null)
{
$url = static::classUrl().'/'.$id;
$params = array('status' => 'canceled');
return static::_directRequest('put', $url, $params, $options);
} | [
"public",
"static",
"function",
"cancel",
"(",
"$",
"id",
",",
"$",
"options",
"=",
"null",
")",
"{",
"$",
"url",
"=",
"static",
"::",
"classUrl",
"(",
")",
".",
"'/'",
".",
"$",
"id",
";",
"$",
"params",
"=",
"array",
"(",
"'status'",
"=>",
"'ca... | @param string $id API resource ID
@param array|string|null $options
@return Withdrawal The canceled withdrawal. | [
"@param",
"string",
"$id",
"API",
"resource",
"ID",
"@param",
"array|string|null",
"$options"
] | train | https://github.com/PingPlusPlus/pingpp-php/blob/ce11a340abea605d76114f0d1587b54cf5ad85bf/lib/Withdrawal.php#L48-L53 |
PingPlusPlus/pingpp-php | lib/Withdrawal.php | Withdrawal.batchConfirm | public static function batchConfirm($params = null, $options = null)
{
$url = static::appBaseUrl().'/batch_withdrawals';
return static::_directRequest('post', $url, $params, $options);
} | php | public static function batchConfirm($params = null, $options = null)
{
$url = static::appBaseUrl().'/batch_withdrawals';
return static::_directRequest('post', $url, $params, $options);
} | [
"public",
"static",
"function",
"batchConfirm",
"(",
"$",
"params",
"=",
"null",
",",
"$",
"options",
"=",
"null",
")",
"{",
"$",
"url",
"=",
"static",
"::",
"appBaseUrl",
"(",
")",
".",
"'/batch_withdrawals'",
";",
"return",
"static",
"::",
"_directReques... | @param array|null $params
@param array|string|null $options
@return array An array of batch withdrawals. | [
"@param",
"array|null",
"$params",
"@param",
"array|string|null",
"$options"
] | train | https://github.com/PingPlusPlus/pingpp-php/blob/ce11a340abea605d76114f0d1587b54cf5ad85bf/lib/Withdrawal.php#L72-L76 |
PingPlusPlus/pingpp-php | lib/WxLiteOAuth.php | WxLiteOAuth.getSession | public static function getSession($app_id, $app_secret, $code)
{
$url_params = [
'appid' => $app_id,
'secret' => $app_secret,
'js_code' => $code,
'grant_type'=> 'authorization_code',
];
$query_str = http_build_query($url_params);
... | php | public static function getSession($app_id, $app_secret, $code)
{
$url_params = [
'appid' => $app_id,
'secret' => $app_secret,
'js_code' => $code,
'grant_type'=> 'authorization_code',
];
$query_str = http_build_query($url_params);
... | [
"public",
"static",
"function",
"getSession",
"(",
"$",
"app_id",
",",
"$",
"app_secret",
",",
"$",
"code",
")",
"{",
"$",
"url_params",
"=",
"[",
"'appid'",
"=>",
"$",
"app_id",
",",
"'secret'",
"=>",
"$",
"app_secret",
",",
"'js_code'",
"=>",
"$",
"c... | 获取 session_key 和 openid 等
@param string $app_id 微信小程序应用唯一标识
@param string $app_secret 微信小程序应用密钥(注意保密)
@param string $code 授权code, 登录时获取的 code
@return array
正常返回数组
[
'openid' => 'OPENID',
'session_key' => 'SESSIONKEY'
]
满足 UnionID 返回条件时返回数组
[
'openid' => 'OPENID',
'session_key' => 'SESSIONKEY',
'unionid' => 'UNIONI... | [
"获取",
"session_key",
"和",
"openid",
"等",
"@param",
"string",
"$app_id",
"微信小程序应用唯一标识",
"@param",
"string",
"$app_secret",
"微信小程序应用密钥(注意保密)",
"@param",
"string",
"$code",
"授权code",
"登录时获取的",
"code",
"@return",
"array",
"正常返回数组",
"[",
"openid",
"=",
">",
"OPENID",
... | train | https://github.com/PingPlusPlus/pingpp-php/blob/ce11a340abea605d76114f0d1587b54cf5ad85bf/lib/WxLiteOAuth.php#L45-L65 |
PingPlusPlus/pingpp-php | lib/WxLiteOAuth.php | WxLiteOAuth.getRequest | private static function getRequest($url)
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
curl_setopt($ch, CURLOPT_HEADER,... | php | private static function getRequest($url)
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
curl_setopt($ch, CURLOPT_HEADER,... | [
"private",
"static",
"function",
"getRequest",
"(",
"$",
"url",
")",
"{",
"$",
"ch",
"=",
"curl_init",
"(",
")",
";",
"curl_setopt",
"(",
"$",
"ch",
",",
"CURLOPT_TIMEOUT",
",",
"30",
")",
";",
"curl_setopt",
"(",
"$",
"ch",
",",
"CURLOPT_URL",
",",
... | GET 请求 | [
"GET",
"请求"
] | train | https://github.com/PingPlusPlus/pingpp-php/blob/ce11a340abea605d76114f0d1587b54cf5ad85bf/lib/WxLiteOAuth.php#L71-L84 |
PingPlusPlus/pingpp-php | lib/AttachedObject.php | AttachedObject.replaceWith | public function replaceWith($properties)
{
$removed = array_diff(array_keys($this->_values), array_keys($properties));
foreach ($removed as $k) {
unset($this->$k);
}
foreach ($properties as $k => $v) {
$this->$k = $v;
}
} | php | public function replaceWith($properties)
{
$removed = array_diff(array_keys($this->_values), array_keys($properties));
foreach ($removed as $k) {
unset($this->$k);
}
foreach ($properties as $k => $v) {
$this->$k = $v;
}
} | [
"public",
"function",
"replaceWith",
"(",
"$",
"properties",
")",
"{",
"$",
"removed",
"=",
"array_diff",
"(",
"array_keys",
"(",
"$",
"this",
"->",
"_values",
")",
",",
"array_keys",
"(",
"$",
"properties",
")",
")",
";",
"foreach",
"(",
"$",
"removed",... | Updates this object.
@param array $properties A mapping of properties to update on this object. | [
"Updates",
"this",
"object",
"."
] | train | https://github.com/PingPlusPlus/pingpp-php/blob/ce11a340abea605d76114f0d1587b54cf5ad85bf/lib/AttachedObject.php#L13-L23 |
PingPlusPlus/pingpp-php | lib/Util/RequestOptions.php | RequestOptions.merge | public function merge($options)
{
$other_options = self::parse($options);
if ($other_options->apiKey === null) {
$other_options->apiKey = $this->apiKey;
}
$other_options->headers = array_merge($this->headers, $other_options->headers);
return $other_options;
} | php | public function merge($options)
{
$other_options = self::parse($options);
if ($other_options->apiKey === null) {
$other_options->apiKey = $this->apiKey;
}
$other_options->headers = array_merge($this->headers, $other_options->headers);
return $other_options;
} | [
"public",
"function",
"merge",
"(",
"$",
"options",
")",
"{",
"$",
"other_options",
"=",
"self",
"::",
"parse",
"(",
"$",
"options",
")",
";",
"if",
"(",
"$",
"other_options",
"->",
"apiKey",
"===",
"null",
")",
"{",
"$",
"other_options",
"->",
"apiKey... | Unpacks an options array and merges it into the existing RequestOptions
object.
@param array|string|null $options a key => value array
@return RequestOptions | [
"Unpacks",
"an",
"options",
"array",
"and",
"merges",
"it",
"into",
"the",
"existing",
"RequestOptions",
"object",
".",
"@param",
"array|string|null",
"$options",
"a",
"key",
"=",
">",
"value",
"array"
] | train | https://github.com/PingPlusPlus/pingpp-php/blob/ce11a340abea605d76114f0d1587b54cf5ad85bf/lib/Util/RequestOptions.php#L27-L35 |
PingPlusPlus/pingpp-php | lib/Util/RequestOptions.php | RequestOptions.parse | public static function parse($options)
{
if ($options instanceof self) {
return $options;
}
if (is_null($options)) {
return new RequestOptions(null, array());
}
if (is_string($options)) {
return new RequestOptions($options, array());
... | php | public static function parse($options)
{
if ($options instanceof self) {
return $options;
}
if (is_null($options)) {
return new RequestOptions(null, array());
}
if (is_string($options)) {
return new RequestOptions($options, array());
... | [
"public",
"static",
"function",
"parse",
"(",
"$",
"options",
")",
"{",
"if",
"(",
"$",
"options",
"instanceof",
"self",
")",
"{",
"return",
"$",
"options",
";",
"}",
"if",
"(",
"is_null",
"(",
"$",
"options",
")",
")",
"{",
"return",
"new",
"Request... | Unpacks an options array into an RequestOptions object
@param array|string|null $options a key => value array
@return RequestOptions | [
"Unpacks",
"an",
"options",
"array",
"into",
"an",
"RequestOptions",
"object",
"@param",
"array|string|null",
"$options",
"a",
"key",
"=",
">",
"value",
"array"
] | train | https://github.com/PingPlusPlus/pingpp-php/blob/ce11a340abea605d76114f0d1587b54cf5ad85bf/lib/Util/RequestOptions.php#L43-L78 |
PingPlusPlus/pingpp-php | lib/SubApp.php | SubApp.delete | public static function delete($sub_app_id, $options = null)
{
$url = static::instanceUrlWithId($sub_app_id);
return static::_directRequest('delete', $url, null, $options);
} | php | public static function delete($sub_app_id, $options = null)
{
$url = static::instanceUrlWithId($sub_app_id);
return static::_directRequest('delete', $url, null, $options);
} | [
"public",
"static",
"function",
"delete",
"(",
"$",
"sub_app_id",
",",
"$",
"options",
"=",
"null",
")",
"{",
"$",
"url",
"=",
"static",
"::",
"instanceUrlWithId",
"(",
"$",
"sub_app_id",
")",
";",
"return",
"static",
"::",
"_directRequest",
"(",
"'delete'... | 删除子商户对象
@param $sub_app_id
@param $options
@return $this | [
"删除子商户对象"
] | train | https://github.com/PingPlusPlus/pingpp-php/blob/ce11a340abea605d76114f0d1587b54cf5ad85bf/lib/SubApp.php#L55-L59 |
PingPlusPlus/pingpp-php | lib/SubApp.php | SubApp.update | public static function update($sub_app_id, $params, $options = null)
{
$url = static::instanceUrlWithId($sub_app_id);
return static::_directRequest('put', $url, $params, $options);
} | php | public static function update($sub_app_id, $params, $options = null)
{
$url = static::instanceUrlWithId($sub_app_id);
return static::_directRequest('put', $url, $params, $options);
} | [
"public",
"static",
"function",
"update",
"(",
"$",
"sub_app_id",
",",
"$",
"params",
",",
"$",
"options",
"=",
"null",
")",
"{",
"$",
"url",
"=",
"static",
"::",
"instanceUrlWithId",
"(",
"$",
"sub_app_id",
")",
";",
"return",
"static",
"::",
"_directRe... | 更新子商户对象
@param $sub_app_id
@param $params
@param $options
@return array|PingppObject | [
"更新子商户对象"
] | train | https://github.com/PingPlusPlus/pingpp-php/blob/ce11a340abea605d76114f0d1587b54cf5ad85bf/lib/SubApp.php#L68-L72 |
PingPlusPlus/pingpp-php | lib/Order.php | Order.pay | public static function pay($order_id, $params = null, $opts = null)
{
$url = static::instanceUrlWithId($order_id) . '/pay';
return static::_directRequest('post', $url, $params, $opts);
} | php | public static function pay($order_id, $params = null, $opts = null)
{
$url = static::instanceUrlWithId($order_id) . '/pay';
return static::_directRequest('post', $url, $params, $opts);
} | [
"public",
"static",
"function",
"pay",
"(",
"$",
"order_id",
",",
"$",
"params",
"=",
"null",
",",
"$",
"opts",
"=",
"null",
")",
"{",
"$",
"url",
"=",
"static",
"::",
"instanceUrlWithId",
"(",
"$",
"order_id",
")",
".",
"'/pay'",
";",
"return",
"sta... | @param array|null $params
@param array|string|null $opts
@return Order | [
"@param",
"array|null",
"$params",
"@param",
"array|string|null",
"$opts"
] | train | https://github.com/PingPlusPlus/pingpp-php/blob/ce11a340abea605d76114f0d1587b54cf5ad85bf/lib/Order.php#L57-L61 |
PingPlusPlus/pingpp-php | lib/Order.php | Order.cancel | public static function cancel($order_id, $params = null, $opts = null)
{
$url = static::instanceUrlWithId($order_id);
if (empty($params)) {
$params = ['status' => 'canceled'];
} else {
$params = array_merge($params, ['status' => 'canceled']);
}
return ... | php | public static function cancel($order_id, $params = null, $opts = null)
{
$url = static::instanceUrlWithId($order_id);
if (empty($params)) {
$params = ['status' => 'canceled'];
} else {
$params = array_merge($params, ['status' => 'canceled']);
}
return ... | [
"public",
"static",
"function",
"cancel",
"(",
"$",
"order_id",
",",
"$",
"params",
"=",
"null",
",",
"$",
"opts",
"=",
"null",
")",
"{",
"$",
"url",
"=",
"static",
"::",
"instanceUrlWithId",
"(",
"$",
"order_id",
")",
";",
"if",
"(",
"empty",
"(",
... | @param array|null $params
@param array|string|null $opts
@return Order the canceled order | [
"@param",
"array|null",
"$params",
"@param",
"array|string|null",
"$opts"
] | train | https://github.com/PingPlusPlus/pingpp-php/blob/ce11a340abea605d76114f0d1587b54cf5ad85bf/lib/Order.php#L69-L78 |
PingPlusPlus/pingpp-php | lib/Coupon.php | Coupon.retrieve | public static function retrieve($userId, $id, $options = null)
{
return self::_userBasedRetrieve($userId, $id, $options);
} | php | public static function retrieve($userId, $id, $options = null)
{
return self::_userBasedRetrieve($userId, $id, $options);
} | [
"public",
"static",
"function",
"retrieve",
"(",
"$",
"userId",
",",
"$",
"id",
",",
"$",
"options",
"=",
"null",
")",
"{",
"return",
"self",
"::",
"_userBasedRetrieve",
"(",
"$",
"userId",
",",
"$",
"id",
",",
"$",
"options",
")",
";",
"}"
] | @param string $id The ID of the coupon to retrieve.
@param array|string|null $options
@return Coupon | [
"@param",
"string",
"$id",
"The",
"ID",
"of",
"the",
"coupon",
"to",
"retrieve",
".",
"@param",
"array|string|null",
"$options"
] | train | https://github.com/PingPlusPlus/pingpp-php/blob/ce11a340abea605d76114f0d1587b54cf5ad85bf/lib/Coupon.php#L13-L16 |
PingPlusPlus/pingpp-php | lib/Coupon.php | Coupon.create | public static function create($userId, $params = null, $options = null)
{
return self::_userBasedCreate($userId, $params, $options);
} | php | public static function create($userId, $params = null, $options = null)
{
return self::_userBasedCreate($userId, $params, $options);
} | [
"public",
"static",
"function",
"create",
"(",
"$",
"userId",
",",
"$",
"params",
"=",
"null",
",",
"$",
"options",
"=",
"null",
")",
"{",
"return",
"self",
"::",
"_userBasedCreate",
"(",
"$",
"userId",
",",
"$",
"params",
",",
"$",
"options",
")",
"... | @param string $userId
@param array|null $params
@param array|string|null $options
@return Coupon The created coupon. | [
"@param",
"string",
"$userId",
"@param",
"array|null",
"$params",
"@param",
"array|string|null",
"$options"
] | train | https://github.com/PingPlusPlus/pingpp-php/blob/ce11a340abea605d76114f0d1587b54cf5ad85bf/lib/Coupon.php#L25-L28 |
PingPlusPlus/pingpp-php | lib/Coupon.php | Coupon.update | public static function update($userId, $id, $params = null, $options = null)
{
return self::_userBasedUpdate($userId, $id, $params, $options);
} | php | public static function update($userId, $id, $params = null, $options = null)
{
return self::_userBasedUpdate($userId, $id, $params, $options);
} | [
"public",
"static",
"function",
"update",
"(",
"$",
"userId",
",",
"$",
"id",
",",
"$",
"params",
"=",
"null",
",",
"$",
"options",
"=",
"null",
")",
"{",
"return",
"self",
"::",
"_userBasedUpdate",
"(",
"$",
"userId",
",",
"$",
"id",
",",
"$",
"pa... | @param string $userId
@param string $id API resource ID
@param array|null $params
@param array|string|null $options
@return Coupon The updated coupon. | [
"@param",
"string",
"$userId",
"@param",
"string",
"$id",
"API",
"resource",
"ID",
"@param",
"array|null",
"$params",
"@param",
"array|string|null",
"$options"
] | train | https://github.com/PingPlusPlus/pingpp-php/blob/ce11a340abea605d76114f0d1587b54cf5ad85bf/lib/Coupon.php#L38-L41 |
PingPlusPlus/pingpp-php | lib/Coupon.php | Coupon.all | public static function all($userId, $params = null, $options = null)
{
return self::_userBasedList($userId, $params, $options);
} | php | public static function all($userId, $params = null, $options = null)
{
return self::_userBasedList($userId, $params, $options);
} | [
"public",
"static",
"function",
"all",
"(",
"$",
"userId",
",",
"$",
"params",
"=",
"null",
",",
"$",
"options",
"=",
"null",
")",
"{",
"return",
"self",
"::",
"_userBasedList",
"(",
"$",
"userId",
",",
"$",
"params",
",",
"$",
"options",
")",
";",
... | @param string $userId
@param array|null $params
@param array|string|null $options
@return array An array of coupon. | [
"@param",
"string",
"$userId",
"@param",
"array|null",
"$params",
"@param",
"array|string|null",
"$options"
] | train | https://github.com/PingPlusPlus/pingpp-php/blob/ce11a340abea605d76114f0d1587b54cf5ad85bf/lib/Coupon.php#L50-L53 |
PingPlusPlus/pingpp-php | lib/SettleAccount.php | SettleAccount.create | public static function create($user_id, $params, $options = null)
{
$url = static::classUrlWithUserId($user_id);
return static::_directRequest('post', $url, $params, $options);
} | php | public static function create($user_id, $params, $options = null)
{
$url = static::classUrlWithUserId($user_id);
return static::_directRequest('post', $url, $params, $options);
} | [
"public",
"static",
"function",
"create",
"(",
"$",
"user_id",
",",
"$",
"params",
",",
"$",
"options",
"=",
"null",
")",
"{",
"$",
"url",
"=",
"static",
"::",
"classUrlWithUserId",
"(",
"$",
"user_id",
")",
";",
"return",
"static",
"::",
"_directRequest... | 创建结算账户对象
@param $user_id
@param $params
@param $options
@return SettleAccount | [
"创建结算账户对象"
] | train | https://github.com/PingPlusPlus/pingpp-php/blob/ce11a340abea605d76114f0d1587b54cf5ad85bf/lib/SettleAccount.php#L32-L36 |
PingPlusPlus/pingpp-php | lib/SettleAccount.php | SettleAccount.retrieve | public static function retrieve($user_id, $settle_account_id, $params = null, $options = null)
{
$url = static::instanceUrlWithSettleAccountId($user_id, $settle_account_id);
return static::_directRequest('get', $url, $params, $options);
} | php | public static function retrieve($user_id, $settle_account_id, $params = null, $options = null)
{
$url = static::instanceUrlWithSettleAccountId($user_id, $settle_account_id);
return static::_directRequest('get', $url, $params, $options);
} | [
"public",
"static",
"function",
"retrieve",
"(",
"$",
"user_id",
",",
"$",
"settle_account_id",
",",
"$",
"params",
"=",
"null",
",",
"$",
"options",
"=",
"null",
")",
"{",
"$",
"url",
"=",
"static",
"::",
"instanceUrlWithSettleAccountId",
"(",
"$",
"user_... | 查询结算账户对象
@param $user_id
@param $settle_account_id
@param null $params
@return SettleAccount | [
"查询结算账户对象"
] | train | https://github.com/PingPlusPlus/pingpp-php/blob/ce11a340abea605d76114f0d1587b54cf5ad85bf/lib/SettleAccount.php#L45-L49 |
PingPlusPlus/pingpp-php | lib/SettleAccount.php | SettleAccount.all | public static function all($user_id, $params = null)
{
$url = static::classUrlWithUserId($user_id);
return static::_directRequest('get', $url, $params);
} | php | public static function all($user_id, $params = null)
{
$url = static::classUrlWithUserId($user_id);
return static::_directRequest('get', $url, $params);
} | [
"public",
"static",
"function",
"all",
"(",
"$",
"user_id",
",",
"$",
"params",
"=",
"null",
")",
"{",
"$",
"url",
"=",
"static",
"::",
"classUrlWithUserId",
"(",
"$",
"user_id",
")",
";",
"return",
"static",
"::",
"_directRequest",
"(",
"'get'",
",",
... | 查询结算账户对象列表
@param $user_id
@param null $params
@return SettleAccount | [
"查询结算账户对象列表"
] | train | https://github.com/PingPlusPlus/pingpp-php/blob/ce11a340abea605d76114f0d1587b54cf5ad85bf/lib/SettleAccount.php#L70-L74 |
PingPlusPlus/pingpp-php | lib/Channel.php | Channel.create | public static function create($sub_app_id, $params, $options = null)
{
$url = static::classUrlWithSubAppId($sub_app_id);
return static::_directRequest('post', $url, $params, $options);
} | php | public static function create($sub_app_id, $params, $options = null)
{
$url = static::classUrlWithSubAppId($sub_app_id);
return static::_directRequest('post', $url, $params, $options);
} | [
"public",
"static",
"function",
"create",
"(",
"$",
"sub_app_id",
",",
"$",
"params",
",",
"$",
"options",
"=",
"null",
")",
"{",
"$",
"url",
"=",
"static",
"::",
"classUrlWithSubAppId",
"(",
"$",
"sub_app_id",
")",
";",
"return",
"static",
"::",
"_direc... | 创建子商户应用支付渠道
@param $sub_app_id
@param $params
@param $options
@return array|PingppObject | [
"创建子商户应用支付渠道"
] | train | https://github.com/PingPlusPlus/pingpp-php/blob/ce11a340abea605d76114f0d1587b54cf5ad85bf/lib/Channel.php#L32-L36 |
PingPlusPlus/pingpp-php | lib/Channel.php | Channel.retrieve | public static function retrieve($sub_app_id, $channel, $options = null)
{
$url = static::instanceUrlWithChannel($sub_app_id, $channel);
return static::_directRequest('get', $url, array(), $options);
} | php | public static function retrieve($sub_app_id, $channel, $options = null)
{
$url = static::instanceUrlWithChannel($sub_app_id, $channel);
return static::_directRequest('get', $url, array(), $options);
} | [
"public",
"static",
"function",
"retrieve",
"(",
"$",
"sub_app_id",
",",
"$",
"channel",
",",
"$",
"options",
"=",
"null",
")",
"{",
"$",
"url",
"=",
"static",
"::",
"instanceUrlWithChannel",
"(",
"$",
"sub_app_id",
",",
"$",
"channel",
")",
";",
"return... | 查询子商户应用支付渠道
@param $sub_app_id
@param $channel
@param $options
@return array|PingppObject | [
"查询子商户应用支付渠道"
] | train | https://github.com/PingPlusPlus/pingpp-php/blob/ce11a340abea605d76114f0d1587b54cf5ad85bf/lib/Channel.php#L45-L49 |
PingPlusPlus/pingpp-php | lib/Channel.php | Channel.update | public static function update($sub_app_id, $channel, $params = null, $options = null)
{
$url = static::instanceUrlWithChannel($sub_app_id, $channel);
return static::_directRequest('put', $url, $params, $options);
} | php | public static function update($sub_app_id, $channel, $params = null, $options = null)
{
$url = static::instanceUrlWithChannel($sub_app_id, $channel);
return static::_directRequest('put', $url, $params, $options);
} | [
"public",
"static",
"function",
"update",
"(",
"$",
"sub_app_id",
",",
"$",
"channel",
",",
"$",
"params",
"=",
"null",
",",
"$",
"options",
"=",
"null",
")",
"{",
"$",
"url",
"=",
"static",
"::",
"instanceUrlWithChannel",
"(",
"$",
"sub_app_id",
",",
... | 更新子商户应用支付渠道
@param $sub_app_id
@param $channel
@param null $params
@param $options
@return array|PingppObject | [
"更新子商户应用支付渠道"
] | train | https://github.com/PingPlusPlus/pingpp-php/blob/ce11a340abea605d76114f0d1587b54cf5ad85bf/lib/Channel.php#L59-L63 |
PingPlusPlus/pingpp-php | lib/CouponTemplate.php | CouponTemplate.batchCreateCoupons | public static function batchCreateCoupons($id, $params = null, $options = null)
{
$url = static::classUrl() . '/' . $id . '/coupons';
return static::_directRequest('post', $url, $params, $options);
} | php | public static function batchCreateCoupons($id, $params = null, $options = null)
{
$url = static::classUrl() . '/' . $id . '/coupons';
return static::_directRequest('post', $url, $params, $options);
} | [
"public",
"static",
"function",
"batchCreateCoupons",
"(",
"$",
"id",
",",
"$",
"params",
"=",
"null",
",",
"$",
"options",
"=",
"null",
")",
"{",
"$",
"url",
"=",
"static",
"::",
"classUrl",
"(",
")",
".",
"'/'",
".",
"$",
"id",
".",
"'/coupons'",
... | @param $id
@param array|null $params
@param array|string|null $options
@return coupon | [
"@param",
"$id",
"@param",
"array|null",
"$params",
"@param",
"array|string|null",
"$options"
] | train | https://github.com/PingPlusPlus/pingpp-php/blob/ce11a340abea605d76114f0d1587b54cf5ad85bf/lib/CouponTemplate.php#L63-L67 |
PingPlusPlus/pingpp-php | lib/CouponTemplate.php | CouponTemplate.couponsList | public static function couponsList($id, $params = null, $options = null)
{
$url = static::classUrl() . '/' . $id . '/coupons';
return static::_directRequest('get', $url, $params, $options);
} | php | public static function couponsList($id, $params = null, $options = null)
{
$url = static::classUrl() . '/' . $id . '/coupons';
return static::_directRequest('get', $url, $params, $options);
} | [
"public",
"static",
"function",
"couponsList",
"(",
"$",
"id",
",",
"$",
"params",
"=",
"null",
",",
"$",
"options",
"=",
"null",
")",
"{",
"$",
"url",
"=",
"static",
"::",
"classUrl",
"(",
")",
".",
"'/'",
".",
"$",
"id",
".",
"'/coupons'",
";",
... | @param $id
@param array|null $params
@param array|string|null $options
@return coupon | [
"@param",
"$id",
"@param",
"array|null",
"$params",
"@param",
"array|string|null",
"$options"
] | train | https://github.com/PingPlusPlus/pingpp-php/blob/ce11a340abea605d76114f0d1587b54cf5ad85bf/lib/CouponTemplate.php#L76-L80 |
mailin-api/mailin-api-php | src/Sendinblue/Mailin.php | Mailin.campaign_recipients_export | public function campaign_recipients_export($data)
{
$id = $data['id'];
unset($data['id']);
return $this->post("campaign/".$id."/recipients", json_encode($data));
} | php | public function campaign_recipients_export($data)
{
$id = $data['id'];
unset($data['id']);
return $this->post("campaign/".$id."/recipients", json_encode($data));
} | [
"public",
"function",
"campaign_recipients_export",
"(",
"$",
"data",
")",
"{",
"$",
"id",
"=",
"$",
"data",
"[",
"'id'",
"]",
";",
"unset",
"(",
"$",
"data",
"[",
"'id'",
"]",
")",
";",
"return",
"$",
"this",
"->",
"post",
"(",
"\"campaign/\"",
".",... | /*
Export the recipients of a specified campaign.
@param {Array} data contains php array with key value pair.
@options data {Integer} id: Id of campaign to export its recipients [Mandatory]
@options data {String} notify_url: URL that will be called once the export process is finished [Mandatory]
@options data {String} ... | [
"/",
"*",
"Export",
"the",
"recipients",
"of",
"a",
"specified",
"campaign",
"."
] | train | https://github.com/mailin-api/mailin-api-php/blob/a0a521a88ea41cee821f5d30215a1c19efe540df/src/Sendinblue/Mailin.php#L277-L282 |
mailin-api/mailin-api-php | src/Sendinblue/Mailin.php | Mailin.send_bat_email | public function send_bat_email($data)
{
$id = $data['id'];
unset($data['id']);
return $this->post("campaign/".$id."/test", json_encode($data));
} | php | public function send_bat_email($data)
{
$id = $data['id'];
unset($data['id']);
return $this->post("campaign/".$id."/test", json_encode($data));
} | [
"public",
"function",
"send_bat_email",
"(",
"$",
"data",
")",
"{",
"$",
"id",
"=",
"$",
"data",
"[",
"'id'",
"]",
";",
"unset",
"(",
"$",
"data",
"[",
"'id'",
"]",
")",
";",
"return",
"$",
"this",
"->",
"post",
"(",
"\"campaign/\"",
".",
"$",
"i... | /*
Send a Test Campaign.
@param {Array} data contains php array with key value pair.
@options data {Integer} id: Id of the campaign [Mandatory]
@options data {Array} emails: Email address of recipient(s) existing in the one of the lists & should not be blacklisted. Example: "test@example.net". You can use commas to sep... | [
"/",
"*",
"Send",
"a",
"Test",
"Campaign",
"."
] | train | https://github.com/mailin-api/mailin-api-php/blob/a0a521a88ea41cee821f5d30215a1c19efe540df/src/Sendinblue/Mailin.php#L301-L306 |
mailin-api/mailin-api-php | src/Sendinblue/Mailin.php | Mailin.update_campaign_status | public function update_campaign_status($data)
{
$id = $data['id'];
unset($data['id']);
return $this->put("campaign/".$id."/updatecampstatus", json_encode($data));
} | php | public function update_campaign_status($data)
{
$id = $data['id'];
unset($data['id']);
return $this->put("campaign/".$id."/updatecampstatus", json_encode($data));
} | [
"public",
"function",
"update_campaign_status",
"(",
"$",
"data",
")",
"{",
"$",
"id",
"=",
"$",
"data",
"[",
"'id'",
"]",
";",
"unset",
"(",
"$",
"data",
"[",
"'id'",
"]",
")",
";",
"return",
"$",
"this",
"->",
"put",
"(",
"\"campaign/\"",
".",
"$... | /*
Update the Campaign status.
@param {Array} data contains php array with key value pair.
@options data {Integer} id: Id of campaign to update its status [Mandatory]
@options data {String} status: Types of status. Possible values – suspended, archive, darchive, sent, queued, replicate and replicate_template ( case sen... | [
"/",
"*",
"Update",
"the",
"Campaign",
"status",
"."
] | train | https://github.com/mailin-api/mailin-api-php/blob/a0a521a88ea41cee821f5d30215a1c19efe540df/src/Sendinblue/Mailin.php#L314-L319 |
mailin-api/mailin-api-php | src/Sendinblue/Mailin.php | Mailin.update_folder | public function update_folder($data)
{
$id = $data['id'];
unset($data['id']);
return $this->put("folder/".$id, json_encode($data));
} | php | public function update_folder($data)
{
$id = $data['id'];
unset($data['id']);
return $this->put("folder/".$id, json_encode($data));
} | [
"public",
"function",
"update_folder",
"(",
"$",
"data",
")",
"{",
"$",
"id",
"=",
"$",
"data",
"[",
"'id'",
"]",
";",
"unset",
"(",
"$",
"data",
"[",
"'id'",
"]",
")",
";",
"return",
"$",
"this",
"->",
"put",
"(",
"\"folder/\"",
".",
"$",
"id",
... | /*
Update an existing folder.
@param {Array} data contains php array with key value pair.
@options data {Integer} id: Id of folder to be modified [Mandatory]
@options data {String} name: Desired name of the folder to be modified [Mandatory] | [
"/",
"*",
"Update",
"an",
"existing",
"folder",
"."
] | train | https://github.com/mailin-api/mailin-api-php/blob/a0a521a88ea41cee821f5d30215a1c19efe540df/src/Sendinblue/Mailin.php#L425-L430 |
mailin-api/mailin-api-php | src/Sendinblue/Mailin.php | Mailin.add_users_list | public function add_users_list($data)
{
$id = $data['id'];
unset($data['id']);
return $this->post("list/".$id."/users", json_encode($data));
} | php | public function add_users_list($data)
{
$id = $data['id'];
unset($data['id']);
return $this->post("list/".$id."/users", json_encode($data));
} | [
"public",
"function",
"add_users_list",
"(",
"$",
"data",
")",
"{",
"$",
"id",
"=",
"$",
"data",
"[",
"'id'",
"]",
";",
"unset",
"(",
"$",
"data",
"[",
"'id'",
"]",
")",
";",
"return",
"$",
"this",
"->",
"post",
"(",
"\"list/\"",
".",
"$",
"id",
... | /*
Add already existing users in the SendinBlue contacts to the list.
@param {Array} data contains php array with key value pair.
@options data {Integer} id: Id of list to link users in it [Mandatory]
@options data {Array} users: Email address of the already existing user(s) in the SendinBlue contacts. Example: "test@e... | [
"/",
"*",
"Add",
"already",
"existing",
"users",
"in",
"the",
"SendinBlue",
"contacts",
"to",
"the",
"list",
"."
] | train | https://github.com/mailin-api/mailin-api-php/blob/a0a521a88ea41cee821f5d30215a1c19efe540df/src/Sendinblue/Mailin.php#L509-L514 |
mailin-api/mailin-api-php | src/Sendinblue/Mailin.php | Mailin.delete_users_list | public function delete_users_list($data)
{
$id = $data['id'];
unset($data['id']);
return $this->delete("list/".$id."/delusers", json_encode($data));
} | php | public function delete_users_list($data)
{
$id = $data['id'];
unset($data['id']);
return $this->delete("list/".$id."/delusers", json_encode($data));
} | [
"public",
"function",
"delete_users_list",
"(",
"$",
"data",
")",
"{",
"$",
"id",
"=",
"$",
"data",
"[",
"'id'",
"]",
";",
"unset",
"(",
"$",
"data",
"[",
"'id'",
"]",
")",
";",
"return",
"$",
"this",
"->",
"delete",
"(",
"\"list/\"",
".",
"$",
"... | /*
Delete already existing users in the SendinBlue contacts from the list.
@param {Array} data contains php array with key value pair.
@options data {Integer} id: Id of list to unlink users from it [Mandatory]
@options data {Array} users: Email address of the already existing user(s) in the SendinBlue contacts to be mo... | [
"/",
"*",
"Delete",
"already",
"existing",
"users",
"in",
"the",
"SendinBlue",
"contacts",
"from",
"the",
"list",
"."
] | train | https://github.com/mailin-api/mailin-api-php/blob/a0a521a88ea41cee821f5d30215a1c19efe540df/src/Sendinblue/Mailin.php#L522-L527 |
mailin-api/mailin-api-php | src/Sendinblue/Mailin.php | Mailin.update_webhook | public function update_webhook($data)
{
$id = $data['id'];
unset($data['id']);
return $this->put("webhook/".$id, json_encode($data));
} | php | public function update_webhook($data)
{
$id = $data['id'];
unset($data['id']);
return $this->put("webhook/".$id, json_encode($data));
} | [
"public",
"function",
"update_webhook",
"(",
"$",
"data",
")",
"{",
"$",
"id",
"=",
"$",
"data",
"[",
"'id'",
"]",
";",
"unset",
"(",
"$",
"data",
"[",
"'id'",
"]",
")",
";",
"return",
"$",
"this",
"->",
"put",
"(",
"\"webhook/\"",
".",
"$",
"id"... | /*
Update a webhook.
@param {Array} data contains php array with key value pair.
@options data {Integer} id: Id of webhook to be modified [Mandatory]
@options data {String} url: URL that will be triggered by a webhook [Mandatory]
@options data {String} description: Webook description [Optional]
@options data {Array} ev... | [
"/",
"*",
"Update",
"a",
"webhook",
"."
] | train | https://github.com/mailin-api/mailin-api-php/blob/a0a521a88ea41cee821f5d30215a1c19efe540df/src/Sendinblue/Mailin.php#L706-L711 |
mailin-api/mailin-api-php | src/Sendinblue/Mailin.php | Mailin.send_transactional_template | public function send_transactional_template($data)
{
$id = $data['id'];
unset($data['id']);
return $this->put("template/".$id, json_encode($data));
} | php | public function send_transactional_template($data)
{
$id = $data['id'];
unset($data['id']);
return $this->put("template/".$id, json_encode($data));
} | [
"public",
"function",
"send_transactional_template",
"(",
"$",
"data",
")",
"{",
"$",
"id",
"=",
"$",
"data",
"[",
"'id'",
"]",
";",
"unset",
"(",
"$",
"data",
"[",
"'id'",
"]",
")",
";",
"return",
"$",
"this",
"->",
"put",
"(",
"\"template/\"",
".",... | /*
Send templates created on SendinBlue, through SendinBlue SMTP (transactional mails).
@param {Array} data contains php array with key value pair.
@options data {Integer} id: Id of the template created on SendinBlue account [Mandatory]
@options data {String} to: Email address of the recipient(s). You can use pipe ( | ... | [
"/",
"*",
"Send",
"templates",
"created",
"on",
"SendinBlue",
"through",
"SendinBlue",
"SMTP",
"(",
"transactional",
"mails",
")",
"."
] | train | https://github.com/mailin-api/mailin-api-php/blob/a0a521a88ea41cee821f5d30215a1c19efe540df/src/Sendinblue/Mailin.php#L832-L837 |
mailin-api/mailin-api-php | src/Sendinblue/Mailin.php | Mailin.update_sms_campaign | public function update_sms_campaign($data)
{
$id = $data['id'];
unset($data['id']);
return $this->put("sms/".$id, json_encode($data));
} | php | public function update_sms_campaign($data)
{
$id = $data['id'];
unset($data['id']);
return $this->put("sms/".$id, json_encode($data));
} | [
"public",
"function",
"update_sms_campaign",
"(",
"$",
"data",
")",
"{",
"$",
"id",
"=",
"$",
"data",
"[",
"'id'",
"]",
";",
"unset",
"(",
"$",
"data",
"[",
"'id'",
"]",
")",
";",
"return",
"$",
"this",
"->",
"put",
"(",
"\"sms/\"",
".",
"$",
"id... | /*
Update your SMS campaigns.
@param {Array} data contains php array with key value pair.
@options data {Integer} id: Id of the SMS campaign [Mandatory]
@options data {String} name: Name of the SMS campaign [Optional]
@options data {String} sender: This allows you to customize the SMS sender. The number of characters i... | [
"/",
"*",
"Update",
"your",
"SMS",
"campaigns",
"."
] | train | https://github.com/mailin-api/mailin-api-php/blob/a0a521a88ea41cee821f5d30215a1c19efe540df/src/Sendinblue/Mailin.php#L927-L932 |
mailin-api/mailin-api-php | src/Sendinblue/Mailin.php | Mailin.send_bat_sms | public function send_bat_sms($data)
{
$id = $data['id'];
unset($data['id']);
return $this->get("sms/".$id, json_encode($data));
} | php | public function send_bat_sms($data)
{
$id = $data['id'];
unset($data['id']);
return $this->get("sms/".$id, json_encode($data));
} | [
"public",
"function",
"send_bat_sms",
"(",
"$",
"data",
")",
"{",
"$",
"id",
"=",
"$",
"data",
"[",
"'id'",
"]",
";",
"unset",
"(",
"$",
"data",
"[",
"'id'",
"]",
")",
";",
"return",
"$",
"this",
"->",
"get",
"(",
"\"sms/\"",
".",
"$",
"id",
",... | /*
Send a Test SMS.
@param {Array} data contains php array with key value pair.
@options data {Integer} id: Id of the SMS campaign [Mandatory]
@options data {String} to: Mobile number with the country code to send test SMS. The mobile number defined here should belong to one of your contacts in SendinBlue account and s... | [
"/",
"*",
"Send",
"a",
"Test",
"SMS",
"."
] | train | https://github.com/mailin-api/mailin-api-php/blob/a0a521a88ea41cee821f5d30215a1c19efe540df/src/Sendinblue/Mailin.php#L940-L945 |
mailin-api/mailin-api-php | V1.0/mailin.php | Mailin.do_request | private function do_request($resource,$method,$input)
{
$called_url = $this->base_url."/".$resource;
$ch = curl_init($called_url);
$c_date_time = date("r");
$md5_content = "";
if($input!="") {
$md5_content = md5($input);
}
$content_type = "application/json";
$sign_string = $method."\n".$md5_content... | php | private function do_request($resource,$method,$input)
{
$called_url = $this->base_url."/".$resource;
$ch = curl_init($called_url);
$c_date_time = date("r");
$md5_content = "";
if($input!="") {
$md5_content = md5($input);
}
$content_type = "application/json";
$sign_string = $method."\n".$md5_content... | [
"private",
"function",
"do_request",
"(",
"$",
"resource",
",",
"$",
"method",
",",
"$",
"input",
")",
"{",
"$",
"called_url",
"=",
"$",
"this",
"->",
"base_url",
".",
"\"/\"",
".",
"$",
"resource",
";",
"$",
"ch",
"=",
"curl_init",
"(",
"$",
"called... | Do CURL request with authorization | [
"Do",
"CURL",
"request",
"with",
"authorization"
] | train | https://github.com/mailin-api/mailin-api-php/blob/a0a521a88ea41cee821f5d30215a1c19efe540df/V1.0/mailin.php#L24-L55 |
ellipsesynergie/api-response | src/Laravel/ResponseServiceProvider.php | ResponseServiceProvider.bootResponse | protected function bootResponse()
{
$manager = new Manager;
// Custom serializer because DataArraySerializer doesn't provide the opportunity to change the resource key
$manager->setSerializer($this->getSerializer());
// Are we going to try and include embedded data?
$manage... | php | protected function bootResponse()
{
$manager = new Manager;
// Custom serializer because DataArraySerializer doesn't provide the opportunity to change the resource key
$manager->setSerializer($this->getSerializer());
// Are we going to try and include embedded data?
$manage... | [
"protected",
"function",
"bootResponse",
"(",
")",
"{",
"$",
"manager",
"=",
"new",
"Manager",
";",
"// Custom serializer because DataArraySerializer doesn't provide the opportunity to change the resource key",
"$",
"manager",
"->",
"setSerializer",
"(",
"$",
"this",
"->",
... | Boot response
@return Response | [
"Boot",
"response"
] | train | https://github.com/ellipsesynergie/api-response/blob/a0a803a01b04becfb3c681a8eab8ab06edaa3529/src/Laravel/ResponseServiceProvider.php#L46-L63 |
ellipsesynergie/api-response | src/Serializer/Serializer.php | Serializer.collection | public function collection($resourceKey, array $data)
{
if (is_null($resourceKey)) $resourceKey = static::RESOURCE_KEY;
return $resourceKey ? [$resourceKey => $data]: $data;
} | php | public function collection($resourceKey, array $data)
{
if (is_null($resourceKey)) $resourceKey = static::RESOURCE_KEY;
return $resourceKey ? [$resourceKey => $data]: $data;
} | [
"public",
"function",
"collection",
"(",
"$",
"resourceKey",
",",
"array",
"$",
"data",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"resourceKey",
")",
")",
"$",
"resourceKey",
"=",
"static",
"::",
"RESOURCE_KEY",
";",
"return",
"$",
"resourceKey",
"?",
"[... | Serialize a collection.
@param string $resourceKey
@param array $data
@return array | [
"Serialize",
"a",
"collection",
"."
] | train | https://github.com/ellipsesynergie/api-response/blob/a0a803a01b04becfb3c681a8eab8ab06edaa3529/src/Serializer/Serializer.php#L24-L28 |
ellipsesynergie/api-response | src/Serializer/Serializer.php | Serializer.item | public function item($resourceKey, array $data)
{
if (is_null($resourceKey)) $resourceKey = static::RESOURCE_KEY;
return $resourceKey ? [$resourceKey => $data]: $data;
} | php | public function item($resourceKey, array $data)
{
if (is_null($resourceKey)) $resourceKey = static::RESOURCE_KEY;
return $resourceKey ? [$resourceKey => $data]: $data;
} | [
"public",
"function",
"item",
"(",
"$",
"resourceKey",
",",
"array",
"$",
"data",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"resourceKey",
")",
")",
"$",
"resourceKey",
"=",
"static",
"::",
"RESOURCE_KEY",
";",
"return",
"$",
"resourceKey",
"?",
"[",
"... | Serialize an item.
@param string $resourceKey
@param array $data
@return array | [
"Serialize",
"an",
"item",
"."
] | train | https://github.com/ellipsesynergie/api-response/blob/a0a803a01b04becfb3c681a8eab8ab06edaa3529/src/Serializer/Serializer.php#L38-L42 |
ellipsesynergie/api-response | src/Laravel/Middleware/ParseInclude.php | ParseInclude.handle | public function handle(Request $request, Closure $next)
{
// Are we going to try and include embedded data?
$this->response->getManager()->parseIncludes(explode(',', $request->get('include')));
return $next($request);
} | php | public function handle(Request $request, Closure $next)
{
// Are we going to try and include embedded data?
$this->response->getManager()->parseIncludes(explode(',', $request->get('include')));
return $next($request);
} | [
"public",
"function",
"handle",
"(",
"Request",
"$",
"request",
",",
"Closure",
"$",
"next",
")",
"{",
"// Are we going to try and include embedded data?",
"$",
"this",
"->",
"response",
"->",
"getManager",
"(",
")",
"->",
"parseIncludes",
"(",
"explode",
"(",
"... | Handle middleware
@param Request $request
@param Closure $next
@return mixed | [
"Handle",
"middleware"
] | train | https://github.com/ellipsesynergie/api-response/blob/a0a803a01b04becfb3c681a8eab8ab06edaa3529/src/Laravel/Middleware/ParseInclude.php#L36-L42 |
ellipsesynergie/api-response | src/Laravel/LumenServiceProvider.php | LumenServiceProvider.boot | public function boot()
{
$manager = new Manager;
// If you have to customize the manager instance, like setting a custom serializer,
// I strongly suggest you to create your own service provider and add you manager configuration action here
// Here some example if you want to set a ... | php | public function boot()
{
$manager = new Manager;
// If you have to customize the manager instance, like setting a custom serializer,
// I strongly suggest you to create your own service provider and add you manager configuration action here
// Here some example if you want to set a ... | [
"public",
"function",
"boot",
"(",
")",
"{",
"$",
"manager",
"=",
"new",
"Manager",
";",
"// If you have to customize the manager instance, like setting a custom serializer,",
"// I strongly suggest you to create your own service provider and add you manager configuration action here",
"... | Register the service provider.
@return void | [
"Register",
"the",
"service",
"provider",
"."
] | train | https://github.com/ellipsesynergie/api-response/blob/a0a803a01b04becfb3c681a8eab8ab06edaa3529/src/Laravel/LumenServiceProvider.php#L24-L38 |
ellipsesynergie/api-response | src/AbstractResponse.php | AbstractResponse.withItem | public function withItem($data, $transformer, $resourceKey = null, $meta = [], array $headers = [])
{
$resource = new Item($data, $transformer, $resourceKey);
foreach ($meta as $metaKey => $metaValue) {
$resource->setMetaValue($metaKey, $metaValue);
}
$rootScope = $this... | php | public function withItem($data, $transformer, $resourceKey = null, $meta = [], array $headers = [])
{
$resource = new Item($data, $transformer, $resourceKey);
foreach ($meta as $metaKey => $metaValue) {
$resource->setMetaValue($metaKey, $metaValue);
}
$rootScope = $this... | [
"public",
"function",
"withItem",
"(",
"$",
"data",
",",
"$",
"transformer",
",",
"$",
"resourceKey",
"=",
"null",
",",
"$",
"meta",
"=",
"[",
"]",
",",
"array",
"$",
"headers",
"=",
"[",
"]",
")",
"{",
"$",
"resource",
"=",
"new",
"Item",
"(",
"... | Response for one item
@param $data
@param callable|\League\Fractal\TransformerAbstract $transformer
@param string $resourceKey
@param array $meta
@param array $headers
@return mixed | [
"Response",
"for",
"one",
"item"
] | train | https://github.com/ellipsesynergie/api-response/blob/a0a803a01b04becfb3c681a8eab8ab06edaa3529/src/AbstractResponse.php#L116-L127 |
ellipsesynergie/api-response | src/AbstractResponse.php | AbstractResponse.withCollection | public function withCollection($data, $transformer, $resourceKey = null, Cursor $cursor = null, $meta = [], array $headers = [])
{
$resource = new Collection($data, $transformer, $resourceKey);
foreach ($meta as $metaKey => $metaValue) {
$resource->setMetaValue($metaKey, $metaValue);
... | php | public function withCollection($data, $transformer, $resourceKey = null, Cursor $cursor = null, $meta = [], array $headers = [])
{
$resource = new Collection($data, $transformer, $resourceKey);
foreach ($meta as $metaKey => $metaValue) {
$resource->setMetaValue($metaKey, $metaValue);
... | [
"public",
"function",
"withCollection",
"(",
"$",
"data",
",",
"$",
"transformer",
",",
"$",
"resourceKey",
"=",
"null",
",",
"Cursor",
"$",
"cursor",
"=",
"null",
",",
"$",
"meta",
"=",
"[",
"]",
",",
"array",
"$",
"headers",
"=",
"[",
"]",
")",
"... | Response for collection of items
@param $data
@param callable|\League\Fractal\TransformerAbstract $transformer
@param string $resourceKey
@param Cursor $cursor
@param array $meta
@param array $headers
@return mixed | [
"Response",
"for",
"collection",
"of",
"items"
] | train | https://github.com/ellipsesynergie/api-response/blob/a0a803a01b04becfb3c681a8eab8ab06edaa3529/src/AbstractResponse.php#L140-L155 |
ellipsesynergie/api-response | src/AbstractResponse.php | AbstractResponse.withError | public function withError($message, $errorCode, array $headers = [])
{
return $this->withArray([
'error' => [
'code' => $errorCode,
'http_code' => $this->statusCode,
'message' => $message
]
],
... | php | public function withError($message, $errorCode, array $headers = [])
{
return $this->withArray([
'error' => [
'code' => $errorCode,
'http_code' => $this->statusCode,
'message' => $message
]
],
... | [
"public",
"function",
"withError",
"(",
"$",
"message",
",",
"$",
"errorCode",
",",
"array",
"$",
"headers",
"=",
"[",
"]",
")",
"{",
"return",
"$",
"this",
"->",
"withArray",
"(",
"[",
"'error'",
"=>",
"[",
"'code'",
"=>",
"$",
"errorCode",
",",
"'h... | Response for errors
@param string $message
@param string $errorCode
@param array $headers
@return mixed | [
"Response",
"for",
"errors"
] | train | https://github.com/ellipsesynergie/api-response/blob/a0a803a01b04becfb3c681a8eab8ab06edaa3529/src/AbstractResponse.php#L165-L176 |
ellipsesynergie/api-response | src/Laravel/Response.php | Response.withPaginator | public function withPaginator(LengthAwarePaginator $paginator, $transformer, $resourceKey = null, $meta = [])
{
$queryParams = array_diff_key($_GET, array_flip(['page']));
$paginator->appends($queryParams);
$resource = new Collection($paginator->items(), $transformer, $resourceKey);... | php | public function withPaginator(LengthAwarePaginator $paginator, $transformer, $resourceKey = null, $meta = [])
{
$queryParams = array_diff_key($_GET, array_flip(['page']));
$paginator->appends($queryParams);
$resource = new Collection($paginator->items(), $transformer, $resourceKey);... | [
"public",
"function",
"withPaginator",
"(",
"LengthAwarePaginator",
"$",
"paginator",
",",
"$",
"transformer",
",",
"$",
"resourceKey",
"=",
"null",
",",
"$",
"meta",
"=",
"[",
"]",
")",
"{",
"$",
"queryParams",
"=",
"array_diff_key",
"(",
"$",
"_GET",
","... | Respond with a paginator, and a transformer.
@param LengthAwarePaginator $paginator
@param callable|\League\Fractal\TransformerAbstract $transformer
@param string $resourceKey
@param array $meta
@return ResponseFactory | [
"Respond",
"with",
"a",
"paginator",
"and",
"a",
"transformer",
"."
] | train | https://github.com/ellipsesynergie/api-response/blob/a0a803a01b04becfb3c681a8eab8ab06edaa3529/src/Laravel/Response.php#L43-L58 |
optimizely/php-sdk | src/Optimizely/UserProfile/UserProfile.php | UserProfile.getVariationForExperiment | public function getVariationForExperiment($experimentId)
{
$decision = $this->getDecisionForExperiment($experimentId);
if (!is_null($decision)) {
return $decision->getVariationId();
}
return null;
} | php | public function getVariationForExperiment($experimentId)
{
$decision = $this->getDecisionForExperiment($experimentId);
if (!is_null($decision)) {
return $decision->getVariationId();
}
return null;
} | [
"public",
"function",
"getVariationForExperiment",
"(",
"$",
"experimentId",
")",
"{",
"$",
"decision",
"=",
"$",
"this",
"->",
"getDecisionForExperiment",
"(",
"$",
"experimentId",
")",
";",
"if",
"(",
"!",
"is_null",
"(",
"$",
"decision",
")",
")",
"{",
... | Get the variation ID for the given experiment from the experiment bucket map.
@param $experimentId string The ID of the experiment.
@return null|string The variation ID. | [
"Get",
"the",
"variation",
"ID",
"for",
"the",
"given",
"experiment",
"from",
"the",
"experiment",
"bucket",
"map",
"."
] | train | https://github.com/optimizely/php-sdk/blob/6bc0c7b1372e22926f5d7c1a439fe334c1c6e1db/src/Optimizely/UserProfile/UserProfile.php#L67-L75 |
optimizely/php-sdk | src/Optimizely/UserProfile/UserProfile.php | UserProfile.getDecisionForExperiment | public function getDecisionForExperiment($experimentId)
{
if (isset($this->_experiment_bucket_map[$experimentId])) {
return $this->_experiment_bucket_map[$experimentId];
}
return null;
} | php | public function getDecisionForExperiment($experimentId)
{
if (isset($this->_experiment_bucket_map[$experimentId])) {
return $this->_experiment_bucket_map[$experimentId];
}
return null;
} | [
"public",
"function",
"getDecisionForExperiment",
"(",
"$",
"experimentId",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"_experiment_bucket_map",
"[",
"$",
"experimentId",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"_experiment_bucket_map",
"["... | Get the decision for the given experiment from the experiment bucket map.
@param $experimentId string The ID of the experiment.
@return null|Decision The decision for the given experiment. | [
"Get",
"the",
"decision",
"for",
"the",
"given",
"experiment",
"from",
"the",
"experiment",
"bucket",
"map",
"."
] | train | https://github.com/optimizely/php-sdk/blob/6bc0c7b1372e22926f5d7c1a439fe334c1c6e1db/src/Optimizely/UserProfile/UserProfile.php#L84-L91 |
optimizely/php-sdk | src/Optimizely/Utils/Validator.php | Validator.validateJsonSchema | public static function validateJsonSchema($datafile, LoggerInterface $logger = null)
{
$data = json_decode($datafile);
// Validate
$validator = new JsonSchema\Validator;
$validator->check($data, (object)['$ref' => 'file://' . __DIR__.'/schema.json']);
if ($validator->isVali... | php | public static function validateJsonSchema($datafile, LoggerInterface $logger = null)
{
$data = json_decode($datafile);
// Validate
$validator = new JsonSchema\Validator;
$validator->check($data, (object)['$ref' => 'file://' . __DIR__.'/schema.json']);
if ($validator->isVali... | [
"public",
"static",
"function",
"validateJsonSchema",
"(",
"$",
"datafile",
",",
"LoggerInterface",
"$",
"logger",
"=",
"null",
")",
"{",
"$",
"data",
"=",
"json_decode",
"(",
"$",
"datafile",
")",
";",
"// Validate",
"$",
"validator",
"=",
"new",
"JsonSchem... | @param $datafile string JSON string representing the project.
@return boolean Representing whether schema is valid or not. | [
"@param",
"$datafile",
"string",
"JSON",
"string",
"representing",
"the",
"project",
"."
] | train | https://github.com/optimizely/php-sdk/blob/6bc0c7b1372e22926f5d7c1a439fe334c1c6e1db/src/Optimizely/Utils/Validator.php#L35-L56 |
optimizely/php-sdk | src/Optimizely/Utils/Validator.php | Validator.areAttributesValid | public static function areAttributesValid($attributes)
{
if (!is_array($attributes)) {
return false;
}
if (empty($attributes)) {
return true;
}
// At least one key string to be an associative array.
return count(array_filter(array_keys($attrib... | php | public static function areAttributesValid($attributes)
{
if (!is_array($attributes)) {
return false;
}
if (empty($attributes)) {
return true;
}
// At least one key string to be an associative array.
return count(array_filter(array_keys($attrib... | [
"public",
"static",
"function",
"areAttributesValid",
"(",
"$",
"attributes",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"attributes",
")",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"empty",
"(",
"$",
"attributes",
")",
")",
"{",
"return",... | @param $attributes mixed Attributes of the user.
@return boolean Representing whether attributes are valid or not. | [
"@param",
"$attributes",
"mixed",
"Attributes",
"of",
"the",
"user",
"."
] | train | https://github.com/optimizely/php-sdk/blob/6bc0c7b1372e22926f5d7c1a439fe334c1c6e1db/src/Optimizely/Utils/Validator.php#L63-L74 |
optimizely/php-sdk | src/Optimizely/Utils/Validator.php | Validator.isFiniteNumber | public static function isFiniteNumber($value)
{
if (!(is_int($value) || is_float($value))) {
return false;
}
if (is_nan($value) || is_infinite($value)) {
return false;
}
if (abs($value) > pow(2, 53)) {
return false;
}
ret... | php | public static function isFiniteNumber($value)
{
if (!(is_int($value) || is_float($value))) {
return false;
}
if (is_nan($value) || is_infinite($value)) {
return false;
}
if (abs($value) > pow(2, 53)) {
return false;
}
ret... | [
"public",
"static",
"function",
"isFiniteNumber",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"!",
"(",
"is_int",
"(",
"$",
"value",
")",
"||",
"is_float",
"(",
"$",
"value",
")",
")",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"is_nan",
"(",
... | @param $value The value to validate.
@return boolean Representing whether attribute's value is
a number and not NAN, INF, -INF or greater than absolute limit of 2^53. | [
"@param",
"$value",
"The",
"value",
"to",
"validate",
"."
] | train | https://github.com/optimizely/php-sdk/blob/6bc0c7b1372e22926f5d7c1a439fe334c1c6e1db/src/Optimizely/Utils/Validator.php#L82-L97 |
optimizely/php-sdk | src/Optimizely/Utils/Validator.php | Validator.isAttributeValid | public static function isAttributeValid($attributeKey, $attributeValue)
{
if (!is_string($attributeKey)) {
return false;
}
if (is_string($attributeValue) || is_bool($attributeValue)) {
return true;
}
if (is_int($attributeValue) || is_float($attribute... | php | public static function isAttributeValid($attributeKey, $attributeValue)
{
if (!is_string($attributeKey)) {
return false;
}
if (is_string($attributeValue) || is_bool($attributeValue)) {
return true;
}
if (is_int($attributeValue) || is_float($attribute... | [
"public",
"static",
"function",
"isAttributeValid",
"(",
"$",
"attributeKey",
",",
"$",
"attributeValue",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"attributeKey",
")",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"is_string",
"(",
"$",
"attr... | @param $attributeKey The key to validate.
@param $attributeValue The value to validate.
@return boolean Representing whether attribute's key and value are
valid for event payload or not. Valid attribute key must be a string.
Valid attribute value can be a string, bool, or a finite number. | [
"@param",
"$attributeKey",
"The",
"key",
"to",
"validate",
".",
"@param",
"$attributeValue",
"The",
"value",
"to",
"validate",
"."
] | train | https://github.com/optimizely/php-sdk/blob/6bc0c7b1372e22926f5d7c1a439fe334c1c6e1db/src/Optimizely/Utils/Validator.php#L107-L122 |
optimizely/php-sdk | src/Optimizely/Utils/Validator.php | Validator.isUserInExperiment | public static function isUserInExperiment($config, $experiment, $userAttributes, $logger)
{
$audienceConditions = $experiment->getAudienceConditions();
if ($audienceConditions === null) {
$audienceConditions = $experiment->getAudienceIds();
}
$logger->log(Logger::DEBUG, ... | php | public static function isUserInExperiment($config, $experiment, $userAttributes, $logger)
{
$audienceConditions = $experiment->getAudienceConditions();
if ($audienceConditions === null) {
$audienceConditions = $experiment->getAudienceIds();
}
$logger->log(Logger::DEBUG, ... | [
"public",
"static",
"function",
"isUserInExperiment",
"(",
"$",
"config",
",",
"$",
"experiment",
",",
"$",
"userAttributes",
",",
"$",
"logger",
")",
"{",
"$",
"audienceConditions",
"=",
"$",
"experiment",
"->",
"getAudienceConditions",
"(",
")",
";",
"if",
... | @param $config ProjectConfig Configuration for the project.
@param $experiment Experiment Entity representing the experiment.
@param $userAttributes array Attributes of the user.
@param $logger LoggerInterface.
@return boolean Representing whether user meets audience conditions to be in experiment or not. | [
"@param",
"$config",
"ProjectConfig",
"Configuration",
"for",
"the",
"project",
".",
"@param",
"$experiment",
"Experiment",
"Entity",
"representing",
"the",
"experiment",
".",
"@param",
"$userAttributes",
"array",
"Attributes",
"of",
"the",
"user",
".",
"@param",
"$... | train | https://github.com/optimizely/php-sdk/blob/6bc0c7b1372e22926f5d7c1a439fe334c1c6e1db/src/Optimizely/Utils/Validator.php#L142-L210 |
optimizely/php-sdk | src/Optimizely/Utils/Validator.php | Validator.isFeatureFlagValid | public static function isFeatureFlagValid($config, $featureFlag)
{
$experimentIds = $featureFlag->getExperimentIds();
if (empty($experimentIds)) {
return true;
}
if (sizeof($experimentIds) == 1) {
return true;
}
$groupId = $config->getExperim... | php | public static function isFeatureFlagValid($config, $featureFlag)
{
$experimentIds = $featureFlag->getExperimentIds();
if (empty($experimentIds)) {
return true;
}
if (sizeof($experimentIds) == 1) {
return true;
}
$groupId = $config->getExperim... | [
"public",
"static",
"function",
"isFeatureFlagValid",
"(",
"$",
"config",
",",
"$",
"featureFlag",
")",
"{",
"$",
"experimentIds",
"=",
"$",
"featureFlag",
"->",
"getExperimentIds",
"(",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"experimentIds",
")",
")",
"{... | Checks that if there are more than one experiment IDs
in the feature flag, they must belong to the same mutex group
@param ProjectConfig $config The project config to verify against
@param FeatureFlag $featureFlag The feature to validate
@return boolean True if feature flag is valid | [
"Checks",
"that",
"if",
"there",
"are",
"more",
"than",
"one",
"experiment",
"IDs",
"in",
"the",
"feature",
"flag",
"they",
"must",
"belong",
"to",
"the",
"same",
"mutex",
"group"
] | train | https://github.com/optimizely/php-sdk/blob/6bc0c7b1372e22926f5d7c1a439fe334c1c6e1db/src/Optimizely/Utils/Validator.php#L221-L242 |
optimizely/php-sdk | src/Optimizely/Utils/Validator.php | Validator.areValuesSameType | public static function areValuesSameType($firstVal, $secondVal)
{
$firstValType = gettype($firstVal);
$secondValType = gettype($secondVal);
$numberTypes = array('double', 'integer');
if (in_array($firstValType, $numberTypes) && in_array($secondValType, $numberTypes)) {
r... | php | public static function areValuesSameType($firstVal, $secondVal)
{
$firstValType = gettype($firstVal);
$secondValType = gettype($secondVal);
$numberTypes = array('double', 'integer');
if (in_array($firstValType, $numberTypes) && in_array($secondValType, $numberTypes)) {
r... | [
"public",
"static",
"function",
"areValuesSameType",
"(",
"$",
"firstVal",
",",
"$",
"secondVal",
")",
"{",
"$",
"firstValType",
"=",
"gettype",
"(",
"$",
"firstVal",
")",
";",
"$",
"secondValType",
"=",
"gettype",
"(",
"$",
"secondVal",
")",
";",
"$",
"... | Method to verify that both values belong to same type.
Float/Double and Integer are considered similar.
@param mixed $firstVal
@param mixed $secondVal
@return bool True if values belong to similar types. Otherwise, False. | [
"Method",
"to",
"verify",
"that",
"both",
"values",
"belong",
"to",
"same",
"type",
".",
"Float",
"/",
"Double",
"and",
"Integer",
"are",
"considered",
"similar",
"."
] | train | https://github.com/optimizely/php-sdk/blob/6bc0c7b1372e22926f5d7c1a439fe334c1c6e1db/src/Optimizely/Utils/Validator.php#L269-L280 |
optimizely/php-sdk | src/Optimizely/Utils/Validator.php | Validator.doesArrayContainOnlyStringKeys | public static function doesArrayContainOnlyStringKeys($arr)
{
if (!is_array($arr) || empty($arr)) {
return false;
}
return count(array_filter(array_keys($arr), 'is_string')) == count(array_keys($arr));
} | php | public static function doesArrayContainOnlyStringKeys($arr)
{
if (!is_array($arr) || empty($arr)) {
return false;
}
return count(array_filter(array_keys($arr), 'is_string')) == count(array_keys($arr));
} | [
"public",
"static",
"function",
"doesArrayContainOnlyStringKeys",
"(",
"$",
"arr",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"arr",
")",
"||",
"empty",
"(",
"$",
"arr",
")",
")",
"{",
"return",
"false",
";",
"}",
"return",
"count",
"(",
"array_fi... | Returns true only if given input is an array with all of it's keys of type string.
@param mixed $arr
@return bool True if array contains all string keys. Otherwise, false. | [
"Returns",
"true",
"only",
"if",
"given",
"input",
"is",
"an",
"array",
"with",
"all",
"of",
"it",
"s",
"keys",
"of",
"type",
"string",
"."
] | train | https://github.com/optimizely/php-sdk/blob/6bc0c7b1372e22926f5d7c1a439fe334c1c6e1db/src/Optimizely/Utils/Validator.php#L287-L294 |
optimizely/php-sdk | src/Optimizely/ProjectConfig.php | ProjectConfig.getGroup | public function getGroup($groupId)
{
if (isset($this->_groupIdMap[$groupId])) {
return $this->_groupIdMap[$groupId];
}
$this->_logger->log(Logger::ERROR, sprintf('Group ID "%s" is not in datafile.', $groupId));
$this->_errorHandler->handleError(new InvalidGroupException(... | php | public function getGroup($groupId)
{
if (isset($this->_groupIdMap[$groupId])) {
return $this->_groupIdMap[$groupId];
}
$this->_logger->log(Logger::ERROR, sprintf('Group ID "%s" is not in datafile.', $groupId));
$this->_errorHandler->handleError(new InvalidGroupException(... | [
"public",
"function",
"getGroup",
"(",
"$",
"groupId",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"_groupIdMap",
"[",
"$",
"groupId",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"_groupIdMap",
"[",
"$",
"groupId",
"]",
";",
"}",
"$"... | @param $groupId string ID of the group.
@return Group Entity corresponding to the ID.
Dummy entity is returned if ID is invalid. | [
"@param",
"$groupId",
"string",
"ID",
"of",
"the",
"group",
"."
] | train | https://github.com/optimizely/php-sdk/blob/6bc0c7b1372e22926f5d7c1a439fe334c1c6e1db/src/Optimizely/ProjectConfig.php#L372-L381 |
optimizely/php-sdk | src/Optimizely/ProjectConfig.php | ProjectConfig.getExperimentFromKey | public function getExperimentFromKey($experimentKey)
{
if (isset($this->_experimentKeyMap[$experimentKey])) {
return $this->_experimentKeyMap[$experimentKey];
}
$this->_logger->log(Logger::ERROR, sprintf('Experiment key "%s" is not in datafile.', $experimentKey));
$this-... | php | public function getExperimentFromKey($experimentKey)
{
if (isset($this->_experimentKeyMap[$experimentKey])) {
return $this->_experimentKeyMap[$experimentKey];
}
$this->_logger->log(Logger::ERROR, sprintf('Experiment key "%s" is not in datafile.', $experimentKey));
$this-... | [
"public",
"function",
"getExperimentFromKey",
"(",
"$",
"experimentKey",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"_experimentKeyMap",
"[",
"$",
"experimentKey",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"_experimentKeyMap",
"[",
"$",
"... | @param $experimentKey string Key of the experiment.
@return Experiment Entity corresponding to the key.
Dummy entity is returned if key is invalid. | [
"@param",
"$experimentKey",
"string",
"Key",
"of",
"the",
"experiment",
"."
] | train | https://github.com/optimizely/php-sdk/blob/6bc0c7b1372e22926f5d7c1a439fe334c1c6e1db/src/Optimizely/ProjectConfig.php#L389-L398 |
optimizely/php-sdk | src/Optimizely/ProjectConfig.php | ProjectConfig.getExperimentFromId | public function getExperimentFromId($experimentId)
{
if (isset($this->_experimentIdMap[$experimentId])) {
return $this->_experimentIdMap[$experimentId];
}
$this->_logger->log(Logger::ERROR, sprintf('Experiment ID "%s" is not in datafile.', $experimentId));
$this->_errorH... | php | public function getExperimentFromId($experimentId)
{
if (isset($this->_experimentIdMap[$experimentId])) {
return $this->_experimentIdMap[$experimentId];
}
$this->_logger->log(Logger::ERROR, sprintf('Experiment ID "%s" is not in datafile.', $experimentId));
$this->_errorH... | [
"public",
"function",
"getExperimentFromId",
"(",
"$",
"experimentId",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"_experimentIdMap",
"[",
"$",
"experimentId",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"_experimentIdMap",
"[",
"$",
"exper... | @param $experimentId string ID of the experiment.
@return Experiment Entity corresponding to the key.
Dummy entity is returned if ID is invalid. | [
"@param",
"$experimentId",
"string",
"ID",
"of",
"the",
"experiment",
"."
] | train | https://github.com/optimizely/php-sdk/blob/6bc0c7b1372e22926f5d7c1a439fe334c1c6e1db/src/Optimizely/ProjectConfig.php#L406-L415 |
optimizely/php-sdk | src/Optimizely/ProjectConfig.php | ProjectConfig.getFeatureFlagFromKey | public function getFeatureFlagFromKey($featureKey)
{
if (isset($this->_featureKeyMap[$featureKey])) {
return $this->_featureKeyMap[$featureKey];
}
$this->_logger->log(Logger::ERROR, sprintf('FeatureFlag Key "%s" is not in datafile.', $featureKey));
$this->_errorHandler->... | php | public function getFeatureFlagFromKey($featureKey)
{
if (isset($this->_featureKeyMap[$featureKey])) {
return $this->_featureKeyMap[$featureKey];
}
$this->_logger->log(Logger::ERROR, sprintf('FeatureFlag Key "%s" is not in datafile.', $featureKey));
$this->_errorHandler->... | [
"public",
"function",
"getFeatureFlagFromKey",
"(",
"$",
"featureKey",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"_featureKeyMap",
"[",
"$",
"featureKey",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"_featureKeyMap",
"[",
"$",
"featureKey"... | @param String $featureKey Key of the feature flag
@return FeatureFlag Entity corresponding to the key. | [
"@param",
"String",
"$featureKey",
"Key",
"of",
"the",
"feature",
"flag"
] | train | https://github.com/optimizely/php-sdk/blob/6bc0c7b1372e22926f5d7c1a439fe334c1c6e1db/src/Optimizely/ProjectConfig.php#L422-L431 |
optimizely/php-sdk | src/Optimizely/ProjectConfig.php | ProjectConfig.getRolloutFromId | public function getRolloutFromId($rolloutId)
{
if (isset($this->_rolloutIdMap[$rolloutId])) {
return $this->_rolloutIdMap[$rolloutId];
}
$this->_logger->log(Logger::ERROR, sprintf('Rollout with ID "%s" is not in the datafile.', $rolloutId));
$this->_errorHandler->handle... | php | public function getRolloutFromId($rolloutId)
{
if (isset($this->_rolloutIdMap[$rolloutId])) {
return $this->_rolloutIdMap[$rolloutId];
}
$this->_logger->log(Logger::ERROR, sprintf('Rollout with ID "%s" is not in the datafile.', $rolloutId));
$this->_errorHandler->handle... | [
"public",
"function",
"getRolloutFromId",
"(",
"$",
"rolloutId",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"_rolloutIdMap",
"[",
"$",
"rolloutId",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"_rolloutIdMap",
"[",
"$",
"rolloutId",
"]",
... | @param String $rolloutId
@return Rollout | [
"@param",
"String",
"$rolloutId"
] | train | https://github.com/optimizely/php-sdk/blob/6bc0c7b1372e22926f5d7c1a439fe334c1c6e1db/src/Optimizely/ProjectConfig.php#L438-L448 |
optimizely/php-sdk | src/Optimizely/ProjectConfig.php | ProjectConfig.getEvent | public function getEvent($eventKey)
{
if (isset($this->_eventKeyMap[$eventKey])) {
return $this->_eventKeyMap[$eventKey];
}
$this->_logger->log(Logger::ERROR, sprintf('Event key "%s" is not in datafile.', $eventKey));
$this->_errorHandler->handleError(new InvalidEventExc... | php | public function getEvent($eventKey)
{
if (isset($this->_eventKeyMap[$eventKey])) {
return $this->_eventKeyMap[$eventKey];
}
$this->_logger->log(Logger::ERROR, sprintf('Event key "%s" is not in datafile.', $eventKey));
$this->_errorHandler->handleError(new InvalidEventExc... | [
"public",
"function",
"getEvent",
"(",
"$",
"eventKey",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"_eventKeyMap",
"[",
"$",
"eventKey",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"_eventKeyMap",
"[",
"$",
"eventKey",
"]",
";",
"}",
... | @param $eventKey string Key of the event.
@return Event Entity corresponding to the key.
Dummy entity is returned if key is invalid. | [
"@param",
"$eventKey",
"string",
"Key",
"of",
"the",
"event",
"."
] | train | https://github.com/optimizely/php-sdk/blob/6bc0c7b1372e22926f5d7c1a439fe334c1c6e1db/src/Optimizely/ProjectConfig.php#L456-L465 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.