id int32 0 241k | repo stringlengths 6 63 | path stringlengths 5 140 | func_name stringlengths 3 151 | original_string stringlengths 84 13k | language stringclasses 1
value | code stringlengths 84 13k | code_tokens list | docstring stringlengths 3 47.2k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 91 247 |
|---|---|---|---|---|---|---|---|---|---|---|---|
223,400 | lexik/LexikWorkflowBundle | Flow/Node.php | Node.addNextStateOr | public function addNextStateOr($name, $type, array $targets)
{
$this->nextStates[$name] = new NextStateOr($name, $type, $targets);
} | php | public function addNextStateOr($name, $type, array $targets)
{
$this->nextStates[$name] = new NextStateOr($name, $type, $targets);
} | [
"public",
"function",
"addNextStateOr",
"(",
"$",
"name",
",",
"$",
"type",
",",
"array",
"$",
"targets",
")",
"{",
"$",
"this",
"->",
"nextStates",
"[",
"$",
"name",
"]",
"=",
"new",
"NextStateOr",
"(",
"$",
"name",
",",
"$",
"type",
",",
"$",
"ta... | Add a next state OR
@param string $name
@param string $type
@param array $targets | [
"Add",
"a",
"next",
"state",
"OR"
] | 0caf4609843c8b1929f14d7c717e37626c3f2f71 | https://github.com/lexik/LexikWorkflowBundle/blob/0caf4609843c8b1929f14d7c717e37626c3f2f71/Flow/Node.php#L99-L102 |
223,401 | silverstripe/silverstripe-ldap | src/Model/LDAPGateway.php | LDAPGateway.search | protected function search($filter, $baseDn = null, $scope = Ldap::SEARCH_SCOPE_SUB, $attributes = [], $sort = '')
{
$records = $this->ldap->search($filter, $baseDn, $scope, $attributes, $sort);
return $this->processSearchResults($records);
} | php | protected function search($filter, $baseDn = null, $scope = Ldap::SEARCH_SCOPE_SUB, $attributes = [], $sort = '')
{
$records = $this->ldap->search($filter, $baseDn, $scope, $attributes, $sort);
return $this->processSearchResults($records);
} | [
"protected",
"function",
"search",
"(",
"$",
"filter",
",",
"$",
"baseDn",
"=",
"null",
",",
"$",
"scope",
"=",
"Ldap",
"::",
"SEARCH_SCOPE_SUB",
",",
"$",
"attributes",
"=",
"[",
"]",
",",
"$",
"sort",
"=",
"''",
")",
"{",
"$",
"records",
"=",
"$"... | Query the LDAP directory with the given filter.
@param string $filter The string to filter by, e.g. (objectClass=user)
@param null|string $baseDn The DN to search from. Default is the baseDn option in the connection if not given
@param int $scope The scope to perform the search. Zend_Ldap::SEARCH_SCOPE_ONE, Zend_LDAP:... | [
"Query",
"the",
"LDAP",
"directory",
"with",
"the",
"given",
"filter",
"."
] | e8e6de4de9d61ad383086bc2fb2a793809cb755e | https://github.com/silverstripe/silverstripe-ldap/blob/e8e6de4de9d61ad383086bc2fb2a793809cb755e/src/Model/LDAPGateway.php#L80-L84 |
223,402 | silverstripe/silverstripe-ldap | src/Model/LDAPGateway.php | LDAPGateway.getUserByDN | public function getUserByDN($dn, $baseDn = null, $scope = Ldap::SEARCH_SCOPE_SUB, $attributes = [])
{
return $this->search(
sprintf('(&(objectClass=user)(distinguishedname=%s))', $dn),
$baseDn,
$scope,
$attributes
);
} | php | public function getUserByDN($dn, $baseDn = null, $scope = Ldap::SEARCH_SCOPE_SUB, $attributes = [])
{
return $this->search(
sprintf('(&(objectClass=user)(distinguishedname=%s))', $dn),
$baseDn,
$scope,
$attributes
);
} | [
"public",
"function",
"getUserByDN",
"(",
"$",
"dn",
",",
"$",
"baseDn",
"=",
"null",
",",
"$",
"scope",
"=",
"Ldap",
"::",
"SEARCH_SCOPE_SUB",
",",
"$",
"attributes",
"=",
"[",
"]",
")",
"{",
"return",
"$",
"this",
"->",
"search",
"(",
"sprintf",
"(... | Return a particular LDAP user by DN value.
@param string $dn
@param null|string $baseDn The DN to search from. Default is the baseDn option in the connection if not given
@param int $scope The scope to perform the search. Zend_Ldap::SEARCH_SCOPE_ONE, Zend_LDAP::SEARCH_SCOPE_BASE.
Default is Zend_Ldap::SEARCH_SCOPE_SUB... | [
"Return",
"a",
"particular",
"LDAP",
"user",
"by",
"DN",
"value",
"."
] | e8e6de4de9d61ad383086bc2fb2a793809cb755e | https://github.com/silverstripe/silverstripe-ldap/blob/e8e6de4de9d61ad383086bc2fb2a793809cb755e/src/Model/LDAPGateway.php#L295-L303 |
223,403 | silverstripe/silverstripe-ldap | src/Model/LDAPGateway.php | LDAPGateway.getUserByEmail | public function getUserByEmail($email, $baseDn = null, $scope = Ldap::SEARCH_SCOPE_SUB, $attributes = [])
{
return $this->search(
sprintf('(&(objectClass=user)(mail=%s))', AbstractFilter::escapeValue($email)),
$baseDn,
$scope,
$attributes
);
} | php | public function getUserByEmail($email, $baseDn = null, $scope = Ldap::SEARCH_SCOPE_SUB, $attributes = [])
{
return $this->search(
sprintf('(&(objectClass=user)(mail=%s))', AbstractFilter::escapeValue($email)),
$baseDn,
$scope,
$attributes
);
} | [
"public",
"function",
"getUserByEmail",
"(",
"$",
"email",
",",
"$",
"baseDn",
"=",
"null",
",",
"$",
"scope",
"=",
"Ldap",
"::",
"SEARCH_SCOPE_SUB",
",",
"$",
"attributes",
"=",
"[",
"]",
")",
"{",
"return",
"$",
"this",
"->",
"search",
"(",
"sprintf"... | Return a particular LDAP user by mail value.
@param string $email
@return array | [
"Return",
"a",
"particular",
"LDAP",
"user",
"by",
"mail",
"value",
"."
] | e8e6de4de9d61ad383086bc2fb2a793809cb755e | https://github.com/silverstripe/silverstripe-ldap/blob/e8e6de4de9d61ad383086bc2fb2a793809cb755e/src/Model/LDAPGateway.php#L311-L319 |
223,404 | silverstripe/silverstripe-ldap | src/Model/LDAPGateway.php | LDAPGateway.getUserByUsername | public function getUserByUsername($username, $baseDn = null, $scope = Ldap::SEARCH_SCOPE_SUB, $attributes = [])
{
$options = $this->config()->options;
$option = isset($options['accountCanonicalForm']) ? $options['accountCanonicalForm'] : null;
// will translate the username to username@foo.... | php | public function getUserByUsername($username, $baseDn = null, $scope = Ldap::SEARCH_SCOPE_SUB, $attributes = [])
{
$options = $this->config()->options;
$option = isset($options['accountCanonicalForm']) ? $options['accountCanonicalForm'] : null;
// will translate the username to username@foo.... | [
"public",
"function",
"getUserByUsername",
"(",
"$",
"username",
",",
"$",
"baseDn",
"=",
"null",
",",
"$",
"scope",
"=",
"Ldap",
"::",
"SEARCH_SCOPE_SUB",
",",
"$",
"attributes",
"=",
"[",
"]",
")",
"{",
"$",
"options",
"=",
"$",
"this",
"->",
"config... | Get a specific user's data from LDAP
@param string $username
@param null|string $baseDn The DN to search from. Default is the baseDn option in the connection if not given
@param int $scope The scope to perform the search. Zend_Ldap::SEARCH_SCOPE_ONE, Zend_LDAP::SEARCH_SCOPE_BASE.
Default is Zend_Ldap::SEARCH_SCOPE_SUB... | [
"Get",
"a",
"specific",
"user",
"s",
"data",
"from",
"LDAP"
] | e8e6de4de9d61ad383086bc2fb2a793809cb755e | https://github.com/silverstripe/silverstripe-ldap/blob/e8e6de4de9d61ad383086bc2fb2a793809cb755e/src/Model/LDAPGateway.php#L332-L367 |
223,405 | silverstripe/silverstripe-ldap | src/Model/LDAPGateway.php | LDAPGateway.getCanonicalUsername | public function getCanonicalUsername($data)
{
$options = $this->config()->options;
$option = isset($options['accountCanonicalForm']) ? $options['accountCanonicalForm'] : null;
switch ($option) {
case Ldap::ACCTNAME_FORM_USERNAME: // traditional style usernames, e.g. alice
... | php | public function getCanonicalUsername($data)
{
$options = $this->config()->options;
$option = isset($options['accountCanonicalForm']) ? $options['accountCanonicalForm'] : null;
switch ($option) {
case Ldap::ACCTNAME_FORM_USERNAME: // traditional style usernames, e.g. alice
... | [
"public",
"function",
"getCanonicalUsername",
"(",
"$",
"data",
")",
"{",
"$",
"options",
"=",
"$",
"this",
"->",
"config",
"(",
")",
"->",
"options",
";",
"$",
"option",
"=",
"isset",
"(",
"$",
"options",
"[",
"'accountCanonicalForm'",
"]",
")",
"?",
... | Get a canonical username from the record based on the connection settings.
@param array $data
@return string
@throws Exception | [
"Get",
"a",
"canonical",
"username",
"from",
"the",
"record",
"based",
"on",
"the",
"connection",
"settings",
"."
] | e8e6de4de9d61ad383086bc2fb2a793809cb755e | https://github.com/silverstripe/silverstripe-ldap/blob/e8e6de4de9d61ad383086bc2fb2a793809cb755e/src/Model/LDAPGateway.php#L376-L400 |
223,406 | wirecard/checkout-client-library | library/WirecardCEE/Stdlib/Validate/Fingerprint.php | WirecardCEE_Stdlib_Validate_Fingerprint.setHashAlgorithm | public function setHashAlgorithm($hashAlgorithm)
{
$this->hashAlgorithm = (string) $hashAlgorithm;
WirecardCEE_Stdlib_Fingerprint::setHashAlgorithm($hashAlgorithm);
return $this;
} | php | public function setHashAlgorithm($hashAlgorithm)
{
$this->hashAlgorithm = (string) $hashAlgorithm;
WirecardCEE_Stdlib_Fingerprint::setHashAlgorithm($hashAlgorithm);
return $this;
} | [
"public",
"function",
"setHashAlgorithm",
"(",
"$",
"hashAlgorithm",
")",
"{",
"$",
"this",
"->",
"hashAlgorithm",
"=",
"(",
"string",
")",
"$",
"hashAlgorithm",
";",
"WirecardCEE_Stdlib_Fingerprint",
"::",
"setHashAlgorithm",
"(",
"$",
"hashAlgorithm",
")",
";",
... | Hash algorithm setter
@param string $hashAlgorithm
@return WirecardCEE_Stdlib_Validate_Fingerprint | [
"Hash",
"algorithm",
"setter"
] | ad0f8c88dfb3c39091c80b1b58e8dd3604f3e25c | https://github.com/wirecard/checkout-client-library/blob/ad0f8c88dfb3c39091c80b1b58e8dd3604f3e25c/library/WirecardCEE/Stdlib/Validate/Fingerprint.php#L223-L229 |
223,407 | wirecard/checkout-client-library | library/WirecardCEE/Stdlib/Validate/Fingerprint.php | WirecardCEE_Stdlib_Validate_Fingerprint.addMandatoryField | public function addMandatoryField($mandatoryField)
{
if (!in_array((string) $mandatoryField, $this->_mandatoryFields)) {
$this->_mandatoryFields[] = (string) $mandatoryField;
}
return $this;
} | php | public function addMandatoryField($mandatoryField)
{
if (!in_array((string) $mandatoryField, $this->_mandatoryFields)) {
$this->_mandatoryFields[] = (string) $mandatoryField;
}
return $this;
} | [
"public",
"function",
"addMandatoryField",
"(",
"$",
"mandatoryField",
")",
"{",
"if",
"(",
"!",
"in_array",
"(",
"(",
"string",
")",
"$",
"mandatoryField",
",",
"$",
"this",
"->",
"_mandatoryFields",
")",
")",
"{",
"$",
"this",
"->",
"_mandatoryFields",
"... | Add madatory field
@param string $mandatoryField
@return WirecardCEE_Stdlib_Validate_Fingerprint | [
"Add",
"madatory",
"field"
] | ad0f8c88dfb3c39091c80b1b58e8dd3604f3e25c | https://github.com/wirecard/checkout-client-library/blob/ad0f8c88dfb3c39091c80b1b58e8dd3604f3e25c/library/WirecardCEE/Stdlib/Validate/Fingerprint.php#L252-L259 |
223,408 | wirecard/checkout-client-library | library/WirecardCEE/Stdlib/Validate/Fingerprint.php | WirecardCEE_Stdlib_Validate_Fingerprint.isValid | public function isValid($value, $context = null)
{
$context = array_change_key_case($context, CASE_LOWER);
switch ($this->hashAlgorithm) {
case WirecardCEE_Stdlib_Fingerprint::HASH_ALGORITHM_HMAC_SHA512:
case WirecardCEE_Stdlib_Fingerprint::HASH_ALGORITHM_SHA512:
... | php | public function isValid($value, $context = null)
{
$context = array_change_key_case($context, CASE_LOWER);
switch ($this->hashAlgorithm) {
case WirecardCEE_Stdlib_Fingerprint::HASH_ALGORITHM_HMAC_SHA512:
case WirecardCEE_Stdlib_Fingerprint::HASH_ALGORITHM_SHA512:
... | [
"public",
"function",
"isValid",
"(",
"$",
"value",
",",
"$",
"context",
"=",
"null",
")",
"{",
"$",
"context",
"=",
"array_change_key_case",
"(",
"$",
"context",
",",
"CASE_LOWER",
")",
";",
"switch",
"(",
"$",
"this",
"->",
"hashAlgorithm",
")",
"{",
... | Is validator check valid?
@see WirecardCEE_Stdlib_Validate_Interface::isValid() | [
"Is",
"validator",
"check",
"valid?"
] | ad0f8c88dfb3c39091c80b1b58e8dd3604f3e25c | https://github.com/wirecard/checkout-client-library/blob/ad0f8c88dfb3c39091c80b1b58e8dd3604f3e25c/library/WirecardCEE/Stdlib/Validate/Fingerprint.php#L280-L335 |
223,409 | leonelquinteros/php-toml | src/Toml.php | Toml.parseFile | public static function parseFile($path)
{
if(!is_file($path))
{
throw new Exception('Invalid file path');
}
$toml = file_get_contents($path);
// Remove BOM if present
$toml = preg_replace('/^' . pack('H*','EFBBBF') . '/', '', $toml);
return self... | php | public static function parseFile($path)
{
if(!is_file($path))
{
throw new Exception('Invalid file path');
}
$toml = file_get_contents($path);
// Remove BOM if present
$toml = preg_replace('/^' . pack('H*','EFBBBF') . '/', '', $toml);
return self... | [
"public",
"static",
"function",
"parseFile",
"(",
"$",
"path",
")",
"{",
"if",
"(",
"!",
"is_file",
"(",
"$",
"path",
")",
")",
"{",
"throw",
"new",
"Exception",
"(",
"'Invalid file path'",
")",
";",
"}",
"$",
"toml",
"=",
"file_get_contents",
"(",
"$"... | Reads string from specified file path and parses it as TOML.
@param (string) File path
@return (array) Toml::parse() result | [
"Reads",
"string",
"from",
"specified",
"file",
"path",
"and",
"parses",
"it",
"as",
"TOML",
"."
] | 33e0157ff38626d39f0fe71d642301a320a12fc3 | https://github.com/leonelquinteros/php-toml/blob/33e0157ff38626d39f0fe71d642301a320a12fc3/src/Toml.php#L51-L64 |
223,410 | leonelquinteros/php-toml | src/Toml.php | Toml.parseTableName | private static function parseTableName($name)
{
// Init buffer
$buffer = '';
$strOpen = false;
$names = array();
$strLen = strlen($name);
for($i = 0; $i < $strLen; $i++)
{
if($name[$i] == '"')
{
// Toggle strings
... | php | private static function parseTableName($name)
{
// Init buffer
$buffer = '';
$strOpen = false;
$names = array();
$strLen = strlen($name);
for($i = 0; $i < $strLen; $i++)
{
if($name[$i] == '"')
{
// Toggle strings
... | [
"private",
"static",
"function",
"parseTableName",
"(",
"$",
"name",
")",
"{",
"// Init buffer",
"$",
"buffer",
"=",
"''",
";",
"$",
"strOpen",
"=",
"false",
";",
"$",
"names",
"=",
"array",
"(",
")",
";",
"$",
"strLen",
"=",
"strlen",
"(",
"$",
"nam... | Parses TOML table names and returns the hierarchy array of table names.
@param (string) $name
@return (array) Table names | [
"Parses",
"TOML",
"table",
"names",
"and",
"returns",
"the",
"hierarchy",
"array",
"of",
"table",
"names",
"."
] | 33e0157ff38626d39f0fe71d642301a320a12fc3 | https://github.com/leonelquinteros/php-toml/blob/33e0157ff38626d39f0fe71d642301a320a12fc3/src/Toml.php#L464-L500 |
223,411 | leonelquinteros/php-toml | src/Toml.php | Toml.parseValue | private static function parseValue($val)
{
$parsedVal = null;
// Cleanup
$val = trim($val);
if($val === '')
{
throw new Exception('Empty value not allowed');
}
// Boolean
if($val == 'true' || $val == 'false')
{
$parse... | php | private static function parseValue($val)
{
$parsedVal = null;
// Cleanup
$val = trim($val);
if($val === '')
{
throw new Exception('Empty value not allowed');
}
// Boolean
if($val == 'true' || $val == 'false')
{
$parse... | [
"private",
"static",
"function",
"parseValue",
"(",
"$",
"val",
")",
"{",
"$",
"parsedVal",
"=",
"null",
";",
"// Cleanup",
"$",
"val",
"=",
"trim",
"(",
"$",
"val",
")",
";",
"if",
"(",
"$",
"val",
"===",
"''",
")",
"{",
"throw",
"new",
"Exception... | Parses TOML value and returns it to be assigned on the hashed array
@param (string) $val
@return (mixed) Parsed value. | [
"Parses",
"TOML",
"value",
"and",
"returns",
"it",
"to",
"be",
"assigned",
"on",
"the",
"hashed",
"array"
] | 33e0157ff38626d39f0fe71d642301a320a12fc3 | https://github.com/leonelquinteros/php-toml/blob/33e0157ff38626d39f0fe71d642301a320a12fc3/src/Toml.php#L509-L604 |
223,412 | leonelquinteros/php-toml | src/Toml.php | Toml.parseInlineTable | private static function parseInlineTable($val)
{
// Check valid inline table
if($val[0] == '{' && substr($val, -1) == '}')
{
$val = substr($val, 1, -1);
}
else
{
throw new Exception('Invalid inline table definition: ' . $val);
}
... | php | private static function parseInlineTable($val)
{
// Check valid inline table
if($val[0] == '{' && substr($val, -1) == '}')
{
$val = substr($val, 1, -1);
}
else
{
throw new Exception('Invalid inline table definition: ' . $val);
}
... | [
"private",
"static",
"function",
"parseInlineTable",
"(",
"$",
"val",
")",
"{",
"// Check valid inline table",
"if",
"(",
"$",
"val",
"[",
"0",
"]",
"==",
"'{'",
"&&",
"substr",
"(",
"$",
"val",
",",
"-",
"1",
")",
"==",
"'}'",
")",
"{",
"$",
"val",
... | Parse inline tables into common table array | [
"Parse",
"inline",
"tables",
"into",
"common",
"table",
"array"
] | 33e0157ff38626d39f0fe71d642301a320a12fc3 | https://github.com/leonelquinteros/php-toml/blob/33e0157ff38626d39f0fe71d642301a320a12fc3/src/Toml.php#L686-L735 |
223,413 | leonelquinteros/php-toml | src/Toml.php | Toml.parseKeyValue | private static function parseKeyValue($key, $val, & $pointer)
{
// Flags
$openQuote = false;
$openDoubleQuote = false;
// Buffer
$buff = '';
// Parse
for($i = 0; $i < strlen($key); $i++) {
// Handle quoting
if($key[$i] == '"') {
... | php | private static function parseKeyValue($key, $val, & $pointer)
{
// Flags
$openQuote = false;
$openDoubleQuote = false;
// Buffer
$buff = '';
// Parse
for($i = 0; $i < strlen($key); $i++) {
// Handle quoting
if($key[$i] == '"') {
... | [
"private",
"static",
"function",
"parseKeyValue",
"(",
"$",
"key",
",",
"$",
"val",
",",
"&",
"$",
"pointer",
")",
"{",
"// Flags",
"$",
"openQuote",
"=",
"false",
";",
"$",
"openDoubleQuote",
"=",
"false",
";",
"// Buffer",
"$",
"buff",
"=",
"''",
";"... | Function that takes a key expression and the current pointer to position in the right hierarchy.
Then it sets the corresponding value on that position.
@param (string) $key
@param (&) $pointer | [
"Function",
"that",
"takes",
"a",
"key",
"expression",
"and",
"the",
"current",
"pointer",
"to",
"position",
"in",
"the",
"right",
"hierarchy",
".",
"Then",
"it",
"sets",
"the",
"corresponding",
"value",
"on",
"that",
"position",
"."
] | 33e0157ff38626d39f0fe71d642301a320a12fc3 | https://github.com/leonelquinteros/php-toml/blob/33e0157ff38626d39f0fe71d642301a320a12fc3/src/Toml.php#L744-L806 |
223,414 | leonelquinteros/php-toml | src/Toml.php | Toml.checkDataType | private static function checkDataType($array)
{
if(count($array) <= 1)
{
return true;
}
$last = count($array) - 1;
$type = self::getCustomDataType($array[$last]);
if ($type != self::getCustomDataType($array[0]))
{
return false;
... | php | private static function checkDataType($array)
{
if(count($array) <= 1)
{
return true;
}
$last = count($array) - 1;
$type = self::getCustomDataType($array[$last]);
if ($type != self::getCustomDataType($array[0]))
{
return false;
... | [
"private",
"static",
"function",
"checkDataType",
"(",
"$",
"array",
")",
"{",
"if",
"(",
"count",
"(",
"$",
"array",
")",
"<=",
"1",
")",
"{",
"return",
"true",
";",
"}",
"$",
"last",
"=",
"count",
"(",
"$",
"array",
")",
"-",
"1",
";",
"$",
"... | Function that checks the data type of the first and last elements of an array,
and returns false if they don't match
@param (array) $array
@return boolean | [
"Function",
"that",
"checks",
"the",
"data",
"type",
"of",
"the",
"first",
"and",
"last",
"elements",
"of",
"an",
"array",
"and",
"returns",
"false",
"if",
"they",
"don",
"t",
"match"
] | 33e0157ff38626d39f0fe71d642301a320a12fc3 | https://github.com/leonelquinteros/php-toml/blob/33e0157ff38626d39f0fe71d642301a320a12fc3/src/Toml.php#L816-L835 |
223,415 | leonelquinteros/php-toml | src/Toml.php | Toml.isISODate | public static function isISODate($val)
{
if(!is_string($val)) {
return false;
}
// Use DateTime support to check for valid dates.
try
{
$date = new DateTime($val);
}
catch(Exception $e)
{
return false;
}
... | php | public static function isISODate($val)
{
if(!is_string($val)) {
return false;
}
// Use DateTime support to check for valid dates.
try
{
$date = new DateTime($val);
}
catch(Exception $e)
{
return false;
}
... | [
"public",
"static",
"function",
"isISODate",
"(",
"$",
"val",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"val",
")",
")",
"{",
"return",
"false",
";",
"}",
"// Use DateTime support to check for valid dates.",
"try",
"{",
"$",
"date",
"=",
"new",
"Dat... | Return whether the given value is a valid ISODate
@param (string) $val
@return boolean | [
"Return",
"whether",
"the",
"given",
"value",
"is",
"a",
"valid",
"ISODate"
] | 33e0157ff38626d39f0fe71d642301a320a12fc3 | https://github.com/leonelquinteros/php-toml/blob/33e0157ff38626d39f0fe71d642301a320a12fc3/src/Toml.php#L863-L880 |
223,416 | digiaonline/lumen-fractal | src/FractalService.php | FractalService.makeBuilder | protected function makeBuilder(
$resourceClass,
$data,
TransformerAbstract $transformer = null,
$resourceKey = null
) {
$fractal = $this->makeFractal();
$builder = new FractalBuilder($fractal, $resourceClass, $data);
if ($transformer !== null) {
$... | php | protected function makeBuilder(
$resourceClass,
$data,
TransformerAbstract $transformer = null,
$resourceKey = null
) {
$fractal = $this->makeFractal();
$builder = new FractalBuilder($fractal, $resourceClass, $data);
if ($transformer !== null) {
$... | [
"protected",
"function",
"makeBuilder",
"(",
"$",
"resourceClass",
",",
"$",
"data",
",",
"TransformerAbstract",
"$",
"transformer",
"=",
"null",
",",
"$",
"resourceKey",
"=",
"null",
")",
"{",
"$",
"fractal",
"=",
"$",
"this",
"->",
"makeFractal",
"(",
")... | Creates a builder for serializing data.
@param array $resourceClass
@param mixed $data
@param TransformerAbstract|null $transformer
@param string|null $resourceKey
@return FractalBuilder | [
"Creates",
"a",
"builder",
"for",
"serializing",
"data",
"."
] | f2e70aff2d8ae55e072b062ed4ded45d0635069f | https://github.com/digiaonline/lumen-fractal/blob/f2e70aff2d8ae55e072b062ed4ded45d0635069f/src/FractalService.php#L75-L93 |
223,417 | Payum/PayumModule | src/Payum/PayumModule/Module/AbstractModuleNoTraits.php | AbstractModuleNoTraits.getAutoloaderConfig | public function getAutoloaderConfig()
{
$autoloaderArray = array();
// If this module has a defined classmap, add a classmap autoloader.
$classmapPath = $this->getDir() . '/' . $this->relativeModuleDir . 'autoload_classmap.php';
if (file_exists($classmapPath)) {
$autoloa... | php | public function getAutoloaderConfig()
{
$autoloaderArray = array();
// If this module has a defined classmap, add a classmap autoloader.
$classmapPath = $this->getDir() . '/' . $this->relativeModuleDir . 'autoload_classmap.php';
if (file_exists($classmapPath)) {
$autoloa... | [
"public",
"function",
"getAutoloaderConfig",
"(",
")",
"{",
"$",
"autoloaderArray",
"=",
"array",
"(",
")",
";",
"// If this module has a defined classmap, add a classmap autoloader.",
"$",
"classmapPath",
"=",
"$",
"this",
"->",
"getDir",
"(",
")",
".",
"'/'",
".",... | Return an array to configure a default autoloader instance.
@return array | [
"Return",
"an",
"array",
"to",
"configure",
"a",
"default",
"autoloader",
"instance",
"."
] | ecac0586b4573edd686aa899b05021b6995ee355 | https://github.com/Payum/PayumModule/blob/ecac0586b4573edd686aa899b05021b6995ee355/src/Payum/PayumModule/Module/AbstractModuleNoTraits.php#L51-L72 |
223,418 | silverstripe/silverstripe-ldap | src/Tasks/LDAPMemberSyncOneTask.php | LDAPMemberSyncOneTask.run | public function run($request)
{
$email = $request->getVar('email');
if (!$email) {
echo 'You must supply an email parameter to this method.', PHP_EOL;
exit;
}
$user = $this->ldapService->getUserByEmail($email);
if (!$user) {
echo sprintf... | php | public function run($request)
{
$email = $request->getVar('email');
if (!$email) {
echo 'You must supply an email parameter to this method.', PHP_EOL;
exit;
}
$user = $this->ldapService->getUserByEmail($email);
if (!$user) {
echo sprintf... | [
"public",
"function",
"run",
"(",
"$",
"request",
")",
"{",
"$",
"email",
"=",
"$",
"request",
"->",
"getVar",
"(",
"'email'",
")",
";",
"if",
"(",
"!",
"$",
"email",
")",
"{",
"echo",
"'You must supply an email parameter to this method.'",
",",
"PHP_EOL",
... | Syncs a single user based on the email address passed in the URL
@param HTTPRequest $request | [
"Syncs",
"a",
"single",
"user",
"based",
"on",
"the",
"email",
"address",
"passed",
"in",
"the",
"URL"
] | e8e6de4de9d61ad383086bc2fb2a793809cb755e | https://github.com/silverstripe/silverstripe-ldap/blob/e8e6de4de9d61ad383086bc2fb2a793809cb755e/src/Tasks/LDAPMemberSyncOneTask.php#L50-L95 |
223,419 | lexik/LexikWorkflowBundle | Handler/ProcessHandler.php | ProcessHandler.getProcessStep | protected function getProcessStep($stepName)
{
$step = $this->process->getStep($stepName);
if (! ($step instanceof Step)) {
throw new WorkflowException(sprintf('Can\'t find step named "%s" in process "%s".', $stepName, $this->process->getName()));
}
return $step;
} | php | protected function getProcessStep($stepName)
{
$step = $this->process->getStep($stepName);
if (! ($step instanceof Step)) {
throw new WorkflowException(sprintf('Can\'t find step named "%s" in process "%s".', $stepName, $this->process->getName()));
}
return $step;
} | [
"protected",
"function",
"getProcessStep",
"(",
"$",
"stepName",
")",
"{",
"$",
"step",
"=",
"$",
"this",
"->",
"process",
"->",
"getStep",
"(",
"$",
"stepName",
")",
";",
"if",
"(",
"!",
"(",
"$",
"step",
"instanceof",
"Step",
")",
")",
"{",
"throw"... | Returns a step by its name.
@param string $stepName
@return Step
@throws WorkflowException | [
"Returns",
"a",
"step",
"by",
"its",
"name",
"."
] | 0caf4609843c8b1929f14d7c717e37626c3f2f71 | https://github.com/lexik/LexikWorkflowBundle/blob/0caf4609843c8b1929f14d7c717e37626c3f2f71/Handler/ProcessHandler.php#L213-L222 |
223,420 | lexik/LexikWorkflowBundle | Handler/ProcessHandler.php | ProcessHandler.checkCredentials | protected function checkCredentials(ModelInterface $model, Step $step)
{
$roles = $step->getRoles();
if (!empty($roles) && !$this->authorizationChecker->isGranted($roles, $model->getWorkflowObject())) {
throw new AccessDeniedException($step->getName());
}
} | php | protected function checkCredentials(ModelInterface $model, Step $step)
{
$roles = $step->getRoles();
if (!empty($roles) && !$this->authorizationChecker->isGranted($roles, $model->getWorkflowObject())) {
throw new AccessDeniedException($step->getName());
}
} | [
"protected",
"function",
"checkCredentials",
"(",
"ModelInterface",
"$",
"model",
",",
"Step",
"$",
"step",
")",
"{",
"$",
"roles",
"=",
"$",
"step",
"->",
"getRoles",
"(",
")",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"roles",
")",
"&&",
"!",
"$",
... | Check if the user is allowed to reach the step.
@param ModelInterface $model
@param Step $step
@throws AccessDeniedException | [
"Check",
"if",
"the",
"user",
"is",
"allowed",
"to",
"reach",
"the",
"step",
"."
] | 0caf4609843c8b1929f14d7c717e37626c3f2f71 | https://github.com/lexik/LexikWorkflowBundle/blob/0caf4609843c8b1929f14d7c717e37626c3f2f71/Handler/ProcessHandler.php#L231-L238 |
223,421 | wirecard/checkout-client-library | library/WirecardCEE/QPay/ReturnFactory.php | WirecardCEE_QPay_ReturnFactory._getSuccessInstance | protected static function _getSuccessInstance($return, $secret)
{
if (!array_key_exists('paymentType', $return)) {
throw new WirecardCEE_QPay_Exception_InvalidResponseException('Invalid response from QPAY. Paymenttype is missing.');
}
switch (strtoupper($return['paymentType'])) ... | php | protected static function _getSuccessInstance($return, $secret)
{
if (!array_key_exists('paymentType', $return)) {
throw new WirecardCEE_QPay_Exception_InvalidResponseException('Invalid response from QPAY. Paymenttype is missing.');
}
switch (strtoupper($return['paymentType'])) ... | [
"protected",
"static",
"function",
"_getSuccessInstance",
"(",
"$",
"return",
",",
"$",
"secret",
")",
"{",
"if",
"(",
"!",
"array_key_exists",
"(",
"'paymentType'",
",",
"$",
"return",
")",
")",
"{",
"throw",
"new",
"WirecardCEE_QPay_Exception_InvalidResponseExce... | getter for the correct qpay success return instance
@param string[] $return
@param string $secret
@return WirecardCEE_QPay_Return_Success|WirecardCEE_QPay_Return_Success_CreditCard|WirecardCEE_QPay_Return_Success_Ideal|WirecardCEE_QPay_Return_Success_PayPal|WirecardCEE_QPay_Return_Success_Sofortueberweisung
@throws W... | [
"getter",
"for",
"the",
"correct",
"qpay",
"success",
"return",
"instance"
] | ad0f8c88dfb3c39091c80b1b58e8dd3604f3e25c | https://github.com/wirecard/checkout-client-library/blob/ad0f8c88dfb3c39091c80b1b58e8dd3604f3e25c/library/WirecardCEE/QPay/ReturnFactory.php#L112-L137 |
223,422 | lexik/LexikWorkflowBundle | Twig/Extension/WorkflowExtension.php | WorkflowExtension.getStepLabel | public function getStepLabel(ModelState $state)
{
$step = $this->aggregator
->getProcess($state->getProcessName())
->getStep($state->getStepName());
return $step instanceof Step ? $step->getLabel() : '';
} | php | public function getStepLabel(ModelState $state)
{
$step = $this->aggregator
->getProcess($state->getProcessName())
->getStep($state->getStepName());
return $step instanceof Step ? $step->getLabel() : '';
} | [
"public",
"function",
"getStepLabel",
"(",
"ModelState",
"$",
"state",
")",
"{",
"$",
"step",
"=",
"$",
"this",
"->",
"aggregator",
"->",
"getProcess",
"(",
"$",
"state",
"->",
"getProcessName",
"(",
")",
")",
"->",
"getStep",
"(",
"$",
"state",
"->",
... | Return the state's step label.
@param ModelState $state
@return string | [
"Return",
"the",
"state",
"s",
"step",
"label",
"."
] | 0caf4609843c8b1929f14d7c717e37626c3f2f71 | https://github.com/lexik/LexikWorkflowBundle/blob/0caf4609843c8b1929f14d7c717e37626c3f2f71/Twig/Extension/WorkflowExtension.php#L52-L59 |
223,423 | lexik/LexikWorkflowBundle | Twig/Extension/WorkflowExtension.php | WorkflowExtension.getStateMessage | public function getStateMessage(ModelState $state)
{
$message = '';
if ($state->getSuccessful()) {
$data = $state->getData();
$message = isset($data['success_message']) ? $data['success_message'] : '';
} else {
$message = implode("\n", $state->getErrors(... | php | public function getStateMessage(ModelState $state)
{
$message = '';
if ($state->getSuccessful()) {
$data = $state->getData();
$message = isset($data['success_message']) ? $data['success_message'] : '';
} else {
$message = implode("\n", $state->getErrors(... | [
"public",
"function",
"getStateMessage",
"(",
"ModelState",
"$",
"state",
")",
"{",
"$",
"message",
"=",
"''",
";",
"if",
"(",
"$",
"state",
"->",
"getSuccessful",
"(",
")",
")",
"{",
"$",
"data",
"=",
"$",
"state",
"->",
"getData",
"(",
")",
";",
... | Returns the state message.
@param ModelState $state
@return string | [
"Returns",
"the",
"state",
"message",
"."
] | 0caf4609843c8b1929f14d7c717e37626c3f2f71 | https://github.com/lexik/LexikWorkflowBundle/blob/0caf4609843c8b1929f14d7c717e37626c3f2f71/Twig/Extension/WorkflowExtension.php#L67-L80 |
223,424 | wirecard/checkout-client-library | library/WirecardCEE/QPay/ToolkitClient.php | WirecardCEE_QPay_ToolkitClient.getOrderDetails | public function getOrderDetails($iOrderNumber)
{
$this->_requestData[self::COMMAND] = self::$COMMAND_GET_ORDER_DETAILS;
$this->_setField(self::ORDER_NUMBER, $iOrderNumber);
$this->_fingerprintOrder->setOrder(Array(
self::CUSTOMER_ID,
self::SHOP_ID,
self::... | php | public function getOrderDetails($iOrderNumber)
{
$this->_requestData[self::COMMAND] = self::$COMMAND_GET_ORDER_DETAILS;
$this->_setField(self::ORDER_NUMBER, $iOrderNumber);
$this->_fingerprintOrder->setOrder(Array(
self::CUSTOMER_ID,
self::SHOP_ID,
self::... | [
"public",
"function",
"getOrderDetails",
"(",
"$",
"iOrderNumber",
")",
"{",
"$",
"this",
"->",
"_requestData",
"[",
"self",
"::",
"COMMAND",
"]",
"=",
"self",
"::",
"$",
"COMMAND_GET_ORDER_DETAILS",
";",
"$",
"this",
"->",
"_setField",
"(",
"self",
"::",
... | Returns order details
@param int|string $iOrderNumber
@throws WirecardCEE_Stdlib_Client_Exception_InvalidResponseException
@return WirecardCEE_QPay_Response_Toolkit_GetOrderDetails | [
"Returns",
"order",
"details"
] | ad0f8c88dfb3c39091c80b1b58e8dd3604f3e25c | https://github.com/wirecard/checkout-client-library/blob/ad0f8c88dfb3c39091c80b1b58e8dd3604f3e25c/library/WirecardCEE/QPay/ToolkitClient.php#L417-L433 |
223,425 | haridarshan/instagram-php | src/InstagramRequest.php | InstagramRequest.execute | protected function execute()
{
$authMethod = '?access_token=' . $this->params['access_token'];
$endpoint = Constants::API_VERSION . $this->path . (('GET' === $this->method) ? '?' . http_build_query($this->params) : $authMethod);
$endpoint .= (strstr($endpoint, '?') ? '&' : '?') . 'sig=' . st... | php | protected function execute()
{
$authMethod = '?access_token=' . $this->params['access_token'];
$endpoint = Constants::API_VERSION . $this->path . (('GET' === $this->method) ? '?' . http_build_query($this->params) : $authMethod);
$endpoint .= (strstr($endpoint, '?') ? '&' : '?') . 'sig=' . st... | [
"protected",
"function",
"execute",
"(",
")",
"{",
"$",
"authMethod",
"=",
"'?access_token='",
".",
"$",
"this",
"->",
"params",
"[",
"'access_token'",
"]",
";",
"$",
"endpoint",
"=",
"Constants",
"::",
"API_VERSION",
".",
"$",
"this",
"->",
"path",
".",
... | Execute the Instagram Request
@param void
@throws InstagramResponseException
@return InstagramResponse | [
"Execute",
"the",
"Instagram",
"Request"
] | 5f21e622eaffcbb9b30f12ebdf0064a91ff1caff | https://github.com/haridarshan/instagram-php/blob/5f21e622eaffcbb9b30f12ebdf0064a91ff1caff/src/InstagramRequest.php#L100-L113 |
223,426 | haridarshan/instagram-php | src/InstagramRequest.php | InstagramRequest.generateSignature | public static function generateSignature(InstagramApp $app, $endpoint, $params)
{
$signature = $endpoint;
ksort($params);
foreach ($params as $key => $value) {
$signature .= "|$key=$value";
}
return hash_hmac('sha256', $signature, $app->getSecret(), false);
} | php | public static function generateSignature(InstagramApp $app, $endpoint, $params)
{
$signature = $endpoint;
ksort($params);
foreach ($params as $key => $value) {
$signature .= "|$key=$value";
}
return hash_hmac('sha256', $signature, $app->getSecret(), false);
} | [
"public",
"static",
"function",
"generateSignature",
"(",
"InstagramApp",
"$",
"app",
",",
"$",
"endpoint",
",",
"$",
"params",
")",
"{",
"$",
"signature",
"=",
"$",
"endpoint",
";",
"ksort",
"(",
"$",
"params",
")",
";",
"foreach",
"(",
"$",
"params",
... | Secure API Request by using endpoint, paramters and API secret
@see https://www.instagram.com/developer/secure-api-requests/
@param InstagramApp $app
@param string $endpoint
@param array $params
@return string (Signature) | [
"Secure",
"API",
"Request",
"by",
"using",
"endpoint",
"paramters",
"and",
"API",
"secret"
] | 5f21e622eaffcbb9b30f12ebdf0064a91ff1caff | https://github.com/haridarshan/instagram-php/blob/5f21e622eaffcbb9b30f12ebdf0064a91ff1caff/src/InstagramRequest.php#L170-L179 |
223,427 | wirecard/checkout-client-library | library/WirecardCEE/Stdlib/ReturnFactoryAbstract.php | WirecardCEE_Stdlib_ReturnFactoryAbstract.generateConfirmResponseString | public static function generateConfirmResponseString($messages = null, $inCommentTag = false)
{
$template = '<QPAY-CONFIRMATION-RESPONSE result="%status%" %message%/>';
if (empty( $messages )) {
$returnValue = str_replace('%status%', 'OK', $template);
$returnValue = str_repla... | php | public static function generateConfirmResponseString($messages = null, $inCommentTag = false)
{
$template = '<QPAY-CONFIRMATION-RESPONSE result="%status%" %message%/>';
if (empty( $messages )) {
$returnValue = str_replace('%status%', 'OK', $template);
$returnValue = str_repla... | [
"public",
"static",
"function",
"generateConfirmResponseString",
"(",
"$",
"messages",
"=",
"null",
",",
"$",
"inCommentTag",
"=",
"false",
")",
"{",
"$",
"template",
"=",
"'<QPAY-CONFIRMATION-RESPONSE result=\"%status%\" %message%/>'",
";",
"if",
"(",
"empty",
"(",
... | generator for qpay confirm response strings.
the response-string must be returned to QPAY in confirmation process.
@param string $messages
@param bool $inCommentTag
@return string | [
"generator",
"for",
"qpay",
"confirm",
"response",
"strings",
".",
"the",
"response",
"-",
"string",
"must",
"be",
"returned",
"to",
"QPAY",
"in",
"confirmation",
"process",
"."
] | ad0f8c88dfb3c39091c80b1b58e8dd3604f3e25c | https://github.com/wirecard/checkout-client-library/blob/ad0f8c88dfb3c39091c80b1b58e8dd3604f3e25c/library/WirecardCEE/Stdlib/ReturnFactoryAbstract.php#L83-L98 |
223,428 | wirecard/checkout-client-library | library/WirecardCEE/QMore/Return/Failure.php | WirecardCEE_QMore_Return_Failure.getErrors | public function getErrors()
{
if (empty( $this->_errors )) {
$errorList = Array();
foreach ($this->__get(self::$ERROR) as $error) {
$errorCode = $error[self::$ERROR_ERROR_CODE];
$message = $error[self::$ERROR_MESSAGE];
$c... | php | public function getErrors()
{
if (empty( $this->_errors )) {
$errorList = Array();
foreach ($this->__get(self::$ERROR) as $error) {
$errorCode = $error[self::$ERROR_ERROR_CODE];
$message = $error[self::$ERROR_MESSAGE];
$c... | [
"public",
"function",
"getErrors",
"(",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"_errors",
")",
")",
"{",
"$",
"errorList",
"=",
"Array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"__get",
"(",
"self",
"::",
"$",
"ERROR",
")... | Returns all the errors
return Array | [
"Returns",
"all",
"the",
"errors",
"return",
"Array"
] | ad0f8c88dfb3c39091c80b1b58e8dd3604f3e25c | https://github.com/wirecard/checkout-client-library/blob/ad0f8c88dfb3c39091c80b1b58e8dd3604f3e25c/library/WirecardCEE/QMore/Return/Failure.php#L57-L79 |
223,429 | EtonDigital/EDBlogBundle | Security/Authorization/Voter/AdminVoter.php | AdminVoter.supportsClass | public function supportsClass($class)
{
if($class)
{
$classNameArray = explode('\\', $class);
$className = $classNameArray[ count($classNameArray)-1 ];
if( in_array($className, array('User', 'AdminVoter')) )
{
return true;
... | php | public function supportsClass($class)
{
if($class)
{
$classNameArray = explode('\\', $class);
$className = $classNameArray[ count($classNameArray)-1 ];
if( in_array($className, array('User', 'AdminVoter')) )
{
return true;
... | [
"public",
"function",
"supportsClass",
"(",
"$",
"class",
")",
"{",
"if",
"(",
"$",
"class",
")",
"{",
"$",
"classNameArray",
"=",
"explode",
"(",
"'\\\\'",
",",
"$",
"class",
")",
";",
"$",
"className",
"=",
"$",
"classNameArray",
"[",
"count",
"(",
... | Checks if the voter supports the given class.
@param string $class A class name
@return bool true if this Voter can process the class | [
"Checks",
"if",
"the",
"voter",
"supports",
"the",
"given",
"class",
"."
] | bce97b1991b6201733aa7459712c840d92a96ccc | https://github.com/EtonDigital/EDBlogBundle/blob/bce97b1991b6201733aa7459712c840d92a96ccc/Security/Authorization/Voter/AdminVoter.php#L43-L57 |
223,430 | silverstripe/silverstripe-ldap | src/Extensions/LDAPMemberExtension.php | LDAPMemberExtension.writeWithoutSync | public function writeWithoutSync()
{
$this->owner->LDAPMemberExtension_NoSync = true;
try {
$this->owner->write();
} finally {
$this->owner->LDAPMemberExtension_NoSync = false;
}
} | php | public function writeWithoutSync()
{
$this->owner->LDAPMemberExtension_NoSync = true;
try {
$this->owner->write();
} finally {
$this->owner->LDAPMemberExtension_NoSync = false;
}
} | [
"public",
"function",
"writeWithoutSync",
"(",
")",
"{",
"$",
"this",
"->",
"owner",
"->",
"LDAPMemberExtension_NoSync",
"=",
"true",
";",
"try",
"{",
"$",
"this",
"->",
"owner",
"->",
"write",
"(",
")",
";",
"}",
"finally",
"{",
"$",
"this",
"->",
"ow... | Write DataObject without triggering this extension's hooks.
@throws Exception | [
"Write",
"DataObject",
"without",
"triggering",
"this",
"extension",
"s",
"hooks",
"."
] | e8e6de4de9d61ad383086bc2fb2a793809cb755e | https://github.com/silverstripe/silverstripe-ldap/blob/e8e6de4de9d61ad383086bc2fb2a793809cb755e/src/Extensions/LDAPMemberExtension.php#L265-L273 |
223,431 | silverstripe/silverstripe-ldap | src/Extensions/LDAPMemberExtension.php | LDAPMemberExtension.sync | public function sync()
{
$service = Injector::inst()->get(LDAPService::class);
if (!$service->enabled() ||
!$this->owner->GUID
) {
return;
}
$service->updateLDAPFromMember($this->owner);
$service->updateLDAPGroupsForMember($this->owner);
} | php | public function sync()
{
$service = Injector::inst()->get(LDAPService::class);
if (!$service->enabled() ||
!$this->owner->GUID
) {
return;
}
$service->updateLDAPFromMember($this->owner);
$service->updateLDAPGroupsForMember($this->owner);
} | [
"public",
"function",
"sync",
"(",
")",
"{",
"$",
"service",
"=",
"Injector",
"::",
"inst",
"(",
")",
"->",
"get",
"(",
"LDAPService",
"::",
"class",
")",
";",
"if",
"(",
"!",
"$",
"service",
"->",
"enabled",
"(",
")",
"||",
"!",
"$",
"this",
"->... | Update the local data with LDAP, and ensure local membership is also set in
LDAP too. This writes into LDAP, provided that feature is enabled. | [
"Update",
"the",
"local",
"data",
"with",
"LDAP",
"and",
"ensure",
"local",
"membership",
"is",
"also",
"set",
"in",
"LDAP",
"too",
".",
"This",
"writes",
"into",
"LDAP",
"provided",
"that",
"feature",
"is",
"enabled",
"."
] | e8e6de4de9d61ad383086bc2fb2a793809cb755e | https://github.com/silverstripe/silverstripe-ldap/blob/e8e6de4de9d61ad383086bc2fb2a793809cb755e/src/Extensions/LDAPMemberExtension.php#L279-L289 |
223,432 | silverstripe/silverstripe-ldap | src/Extensions/LDAPMemberExtension.php | LDAPMemberExtension.onBeforeChangePassword | public function onBeforeChangePassword($newPassword, $validation)
{
// Don't do anything if there's already a validation failure
if (!$validation->isValid()) {
return;
}
Injector::inst()->get(LDAPService::class)
->setPassword($this->owner, $newPassword);
... | php | public function onBeforeChangePassword($newPassword, $validation)
{
// Don't do anything if there's already a validation failure
if (!$validation->isValid()) {
return;
}
Injector::inst()->get(LDAPService::class)
->setPassword($this->owner, $newPassword);
... | [
"public",
"function",
"onBeforeChangePassword",
"(",
"$",
"newPassword",
",",
"$",
"validation",
")",
"{",
"// Don't do anything if there's already a validation failure",
"if",
"(",
"!",
"$",
"validation",
"->",
"isValid",
"(",
")",
")",
"{",
"return",
";",
"}",
"... | Synchronise password changes to AD when they happen in SilverStripe
@param string $newPassword
@param ValidationResult $validation | [
"Synchronise",
"password",
"changes",
"to",
"AD",
"when",
"they",
"happen",
"in",
"SilverStripe"
] | e8e6de4de9d61ad383086bc2fb2a793809cb755e | https://github.com/silverstripe/silverstripe-ldap/blob/e8e6de4de9d61ad383086bc2fb2a793809cb755e/src/Extensions/LDAPMemberExtension.php#L326-L335 |
223,433 | appstract/laravel-tracer | src/Tracer.php | Tracer.trace | public function trace()
{
foreach ($this->files as $file) {
($this->debug === true) ? $this->addTrace($file) : $this->removeTrace($file);
}
} | php | public function trace()
{
foreach ($this->files as $file) {
($this->debug === true) ? $this->addTrace($file) : $this->removeTrace($file);
}
} | [
"public",
"function",
"trace",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"files",
"as",
"$",
"file",
")",
"{",
"(",
"$",
"this",
"->",
"debug",
"===",
"true",
")",
"?",
"$",
"this",
"->",
"addTrace",
"(",
"$",
"file",
")",
":",
"$",
"th... | Start the tracer.
@return [type] [description] | [
"Start",
"the",
"tracer",
"."
] | 64b6cb334ddea3bc4c8527d66b6e2050223f39fd | https://github.com/appstract/laravel-tracer/blob/64b6cb334ddea3bc4c8527d66b6e2050223f39fd/src/Tracer.php#L41-L46 |
223,434 | appstract/laravel-tracer | src/Tracer.php | Tracer.addTrace | public function addTrace($file)
{
// If the file does not contain the trace, add it.
if (strpos(File::get($file), $this->realPath) === false && $this->debug == true) {
File::prepend($file, $this->realPath);
File::append($file, '</span>');
}
} | php | public function addTrace($file)
{
// If the file does not contain the trace, add it.
if (strpos(File::get($file), $this->realPath) === false && $this->debug == true) {
File::prepend($file, $this->realPath);
File::append($file, '</span>');
}
} | [
"public",
"function",
"addTrace",
"(",
"$",
"file",
")",
"{",
"// If the file does not contain the trace, add it.",
"if",
"(",
"strpos",
"(",
"File",
"::",
"get",
"(",
"$",
"file",
")",
",",
"$",
"this",
"->",
"realPath",
")",
"===",
"false",
"&&",
"$",
"t... | Add the trace to the view.
@param [type] $file [description] | [
"Add",
"the",
"trace",
"to",
"the",
"view",
"."
] | 64b6cb334ddea3bc4c8527d66b6e2050223f39fd | https://github.com/appstract/laravel-tracer/blob/64b6cb334ddea3bc4c8527d66b6e2050223f39fd/src/Tracer.php#L52-L59 |
223,435 | appstract/laravel-tracer | src/Tracer.php | Tracer.removeTrace | public function removeTrace($file)
{
// If the file does contain the trace, remove it.
if (strpos(File::get($file), $this->realPath) !== false) {
$content = str_replace($this->realPath, '', File::get($file));
File::put($file, $content);
}
} | php | public function removeTrace($file)
{
// If the file does contain the trace, remove it.
if (strpos(File::get($file), $this->realPath) !== false) {
$content = str_replace($this->realPath, '', File::get($file));
File::put($file, $content);
}
} | [
"public",
"function",
"removeTrace",
"(",
"$",
"file",
")",
"{",
"// If the file does contain the trace, remove it.",
"if",
"(",
"strpos",
"(",
"File",
"::",
"get",
"(",
"$",
"file",
")",
",",
"$",
"this",
"->",
"realPath",
")",
"!==",
"false",
")",
"{",
"... | Remove the trace from the view.
@param [type] $file [description]
@return [type] [description] | [
"Remove",
"the",
"trace",
"from",
"the",
"view",
"."
] | 64b6cb334ddea3bc4c8527d66b6e2050223f39fd | https://github.com/appstract/laravel-tracer/blob/64b6cb334ddea3bc4c8527d66b6e2050223f39fd/src/Tracer.php#L66-L73 |
223,436 | EtonDigital/EDBlogBundle | Handler/ObjectGenerator.php | ObjectGenerator.generateArticleFromDraft | public function generateArticleFromDraft(ArticleInterface &$article, ArticleInterface $draft)
{
$this->loadArticle($article, $draft);
$article
->setStatus( Article::STATUS_PUBLISHED )
->setParent(null);
return $article;
} | php | public function generateArticleFromDraft(ArticleInterface &$article, ArticleInterface $draft)
{
$this->loadArticle($article, $draft);
$article
->setStatus( Article::STATUS_PUBLISHED )
->setParent(null);
return $article;
} | [
"public",
"function",
"generateArticleFromDraft",
"(",
"ArticleInterface",
"&",
"$",
"article",
",",
"ArticleInterface",
"$",
"draft",
")",
"{",
"$",
"this",
"->",
"loadArticle",
"(",
"$",
"article",
",",
"$",
"draft",
")",
";",
"$",
"article",
"->",
"setSta... | Will synchronize changes made on Draft to the master article and set it 'As Published'
@param ArticleInterface $article
@param ArticleInterface $draft
@return ArticleInterface | [
"Will",
"synchronize",
"changes",
"made",
"on",
"Draft",
"to",
"the",
"master",
"article",
"and",
"set",
"it",
"As",
"Published"
] | bce97b1991b6201733aa7459712c840d92a96ccc | https://github.com/EtonDigital/EDBlogBundle/blob/bce97b1991b6201733aa7459712c840d92a96ccc/Handler/ObjectGenerator.php#L72-L82 |
223,437 | lexik/LexikWorkflowBundle | DependencyInjection/LexikWorkflowExtension.php | LexikWorkflowExtension.buildProcesses | protected function buildProcesses($processes, $container, $processClass, $stepClass)
{
$processReferences = array();
foreach ($processes as $processName => $processConfig) {
if (!empty($processConfig['import'])) {
if (is_file($processConfig['import'])) {
... | php | protected function buildProcesses($processes, $container, $processClass, $stepClass)
{
$processReferences = array();
foreach ($processes as $processName => $processConfig) {
if (!empty($processConfig['import'])) {
if (is_file($processConfig['import'])) {
... | [
"protected",
"function",
"buildProcesses",
"(",
"$",
"processes",
",",
"$",
"container",
",",
"$",
"processClass",
",",
"$",
"stepClass",
")",
"{",
"$",
"processReferences",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"processes",
"as",
"$",
"process... | Build process definitions from configuration.
@param array $processes
@param ContainerBuilder $container
@param string $processClass
@param string $stepClass
@return array | [
"Build",
"process",
"definitions",
"from",
"configuration",
"."
] | 0caf4609843c8b1929f14d7c717e37626c3f2f71 | https://github.com/lexik/LexikWorkflowBundle/blob/0caf4609843c8b1929f14d7c717e37626c3f2f71/DependencyInjection/LexikWorkflowExtension.php#L77-L112 |
223,438 | lexik/LexikWorkflowBundle | DependencyInjection/LexikWorkflowExtension.php | LexikWorkflowExtension.buildSteps | protected function buildSteps($processName, $steps, $container, $stepClass)
{
$stepReferences = array();
foreach ($steps as $stepName => $stepConfig) {
$definition = new Definition($stepClass, array(
$stepName,
$stepConfig['label'],
array(... | php | protected function buildSteps($processName, $steps, $container, $stepClass)
{
$stepReferences = array();
foreach ($steps as $stepName => $stepConfig) {
$definition = new Definition($stepClass, array(
$stepName,
$stepConfig['label'],
array(... | [
"protected",
"function",
"buildSteps",
"(",
"$",
"processName",
",",
"$",
"steps",
",",
"$",
"container",
",",
"$",
"stepClass",
")",
"{",
"$",
"stepReferences",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"steps",
"as",
"$",
"stepName",
"=>",
"$... | Build steps definitions from configuration.
@param string $processName
@param array $steps
@param ContainerBuilder $container
@param string $stepClass
@return array | [
"Build",
"steps",
"definitions",
"from",
"configuration",
"."
] | 0caf4609843c8b1929f14d7c717e37626c3f2f71 | https://github.com/lexik/LexikWorkflowBundle/blob/0caf4609843c8b1929f14d7c717e37626c3f2f71/DependencyInjection/LexikWorkflowExtension.php#L124-L150 |
223,439 | lexik/LexikWorkflowBundle | DependencyInjection/LexikWorkflowExtension.php | LexikWorkflowExtension.addStepNextStates | protected function addStepNextStates(Definition $step, $stepsNextStates, $processName)
{
foreach ($stepsNextStates as $stateName => $data) {
if (NextStateInterface::TYPE_STEP === $data['type']) {
$step->addMethodCall('addNextState', array(
$stateName,
... | php | protected function addStepNextStates(Definition $step, $stepsNextStates, $processName)
{
foreach ($stepsNextStates as $stateName => $data) {
if (NextStateInterface::TYPE_STEP === $data['type']) {
$step->addMethodCall('addNextState', array(
$stateName,
... | [
"protected",
"function",
"addStepNextStates",
"(",
"Definition",
"$",
"step",
",",
"$",
"stepsNextStates",
",",
"$",
"processName",
")",
"{",
"foreach",
"(",
"$",
"stepsNextStates",
"as",
"$",
"stateName",
"=>",
"$",
"data",
")",
"{",
"if",
"(",
"NextStateIn... | Add all next states to the step definition.
@param Definition $step
@param array $stepsNextStates
@param string $processName
@throws \InvalidArgumentException | [
"Add",
"all",
"next",
"states",
"to",
"the",
"step",
"definition",
"."
] | 0caf4609843c8b1929f14d7c717e37626c3f2f71 | https://github.com/lexik/LexikWorkflowBundle/blob/0caf4609843c8b1929f14d7c717e37626c3f2f71/DependencyInjection/LexikWorkflowExtension.php#L160-L201 |
223,440 | spanjeta/yii2-backup | helpers/MysqlBackup.php | MysqlBackup.createZipBackup | private function createZipBackup() {
if (class_exists ( \ZipArchive::class )) {
$zip = new \ZipArchive ();
$file_name = $this->file_name . '.zip';
if ($zip->open ( $file_name, \ZipArchive::CREATE ) === TRUE) {
$zip->addFile ( $this->file_name, basename ( $this->file_name ) );
$zip->close ();
... | php | private function createZipBackup() {
if (class_exists ( \ZipArchive::class )) {
$zip = new \ZipArchive ();
$file_name = $this->file_name . '.zip';
if ($zip->open ( $file_name, \ZipArchive::CREATE ) === TRUE) {
$zip->addFile ( $this->file_name, basename ( $this->file_name ) );
$zip->close ();
... | [
"private",
"function",
"createZipBackup",
"(",
")",
"{",
"if",
"(",
"class_exists",
"(",
"\\",
"ZipArchive",
"::",
"class",
")",
")",
"{",
"$",
"zip",
"=",
"new",
"\\",
"ZipArchive",
"(",
")",
";",
"$",
"file_name",
"=",
"$",
"this",
"->",
"file_name",... | Charge method to backup and create a zip with this | [
"Charge",
"method",
"to",
"backup",
"and",
"create",
"a",
"zip",
"with",
"this"
] | cead8b178f86192c875cfbede54fec6a6ba9ef5b | https://github.com/spanjeta/yii2-backup/blob/cead8b178f86192c875cfbede54fec6a6ba9ef5b/helpers/MysqlBackup.php#L165-L179 |
223,441 | spanjeta/yii2-backup | helpers/MysqlBackup.php | MysqlBackup.zipDirectory | private function zipDirectory($zip, $alias, $directory) {
if ($handle = opendir ( $directory )) {
while ( ($file = readdir ( $handle )) !== false ) {
if (is_dir ( $directory . $file ) && $file != "." && $file != ".." && ! in_array ( $directory . $file . '/', $this->module->excludeDirectoryBackup ))
$this-... | php | private function zipDirectory($zip, $alias, $directory) {
if ($handle = opendir ( $directory )) {
while ( ($file = readdir ( $handle )) !== false ) {
if (is_dir ( $directory . $file ) && $file != "." && $file != ".." && ! in_array ( $directory . $file . '/', $this->module->excludeDirectoryBackup ))
$this-... | [
"private",
"function",
"zipDirectory",
"(",
"$",
"zip",
",",
"$",
"alias",
",",
"$",
"directory",
")",
"{",
"if",
"(",
"$",
"handle",
"=",
"opendir",
"(",
"$",
"directory",
")",
")",
"{",
"while",
"(",
"(",
"$",
"file",
"=",
"readdir",
"(",
"$",
... | Method responsible for reading a directory and add them to the zip
@param ZipArchive $zip
@param string $alias
@param string $directory | [
"Method",
"responsible",
"for",
"reading",
"a",
"directory",
"and",
"add",
"them",
"to",
"the",
"zip"
] | cead8b178f86192c875cfbede54fec6a6ba9ef5b | https://github.com/spanjeta/yii2-backup/blob/cead8b178f86192c875cfbede54fec6a6ba9ef5b/helpers/MysqlBackup.php#L188-L199 |
223,442 | spanjeta/yii2-backup | helpers/MysqlBackup.php | MysqlBackup.unzip | public function unzip($sqlZipFile) {
if (file_exists ( $sqlZipFile )) {
$zip = new \ZipArchive ();
$result = $zip->open ( $sqlZipFile );
if ($result === true) {
$zip->extractTo ( dirname ( $sqlZipFile ) );
$zip->close ();
$sqlZipFile = str_replace ( ".zip", "", $sqlZipFile );
}
}
return $s... | php | public function unzip($sqlZipFile) {
if (file_exists ( $sqlZipFile )) {
$zip = new \ZipArchive ();
$result = $zip->open ( $sqlZipFile );
if ($result === true) {
$zip->extractTo ( dirname ( $sqlZipFile ) );
$zip->close ();
$sqlZipFile = str_replace ( ".zip", "", $sqlZipFile );
}
}
return $s... | [
"public",
"function",
"unzip",
"(",
"$",
"sqlZipFile",
")",
"{",
"if",
"(",
"file_exists",
"(",
"$",
"sqlZipFile",
")",
")",
"{",
"$",
"zip",
"=",
"new",
"\\",
"ZipArchive",
"(",
")",
";",
"$",
"result",
"=",
"$",
"zip",
"->",
"open",
"(",
"$",
"... | Zip file execution
@param string $zipFile
Name of file zip | [
"Zip",
"file",
"execution"
] | cead8b178f86192c875cfbede54fec6a6ba9ef5b | https://github.com/spanjeta/yii2-backup/blob/cead8b178f86192c875cfbede54fec6a6ba9ef5b/helpers/MysqlBackup.php#L206-L217 |
223,443 | lexik/LexikWorkflowBundle | Model/ModelStorage.php | ModelStorage.findCurrentModelState | public function findCurrentModelState(ModelInterface $model, $processName, $stepName = null)
{
return $this->repository->findLatestModelState(
$model->getWorkflowIdentifier(),
$processName,
$stepName
);
} | php | public function findCurrentModelState(ModelInterface $model, $processName, $stepName = null)
{
return $this->repository->findLatestModelState(
$model->getWorkflowIdentifier(),
$processName,
$stepName
);
} | [
"public",
"function",
"findCurrentModelState",
"(",
"ModelInterface",
"$",
"model",
",",
"$",
"processName",
",",
"$",
"stepName",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"repository",
"->",
"findLatestModelState",
"(",
"$",
"model",
"->",
"getWork... | Returns the current model state.
@param ModelInterface $model
@param string $processName
@param string $stepName
@return ModelState | [
"Returns",
"the",
"current",
"model",
"state",
"."
] | 0caf4609843c8b1929f14d7c717e37626c3f2f71 | https://github.com/lexik/LexikWorkflowBundle/blob/0caf4609843c8b1929f14d7c717e37626c3f2f71/Model/ModelStorage.php#L43-L50 |
223,444 | lexik/LexikWorkflowBundle | Model/ModelStorage.php | ModelStorage.findAllModelStates | public function findAllModelStates(ModelInterface $model, $processName, $successOnly = true)
{
return $this->repository->findModelStates(
$model->getWorkflowIdentifier(),
$processName,
$successOnly
);
} | php | public function findAllModelStates(ModelInterface $model, $processName, $successOnly = true)
{
return $this->repository->findModelStates(
$model->getWorkflowIdentifier(),
$processName,
$successOnly
);
} | [
"public",
"function",
"findAllModelStates",
"(",
"ModelInterface",
"$",
"model",
",",
"$",
"processName",
",",
"$",
"successOnly",
"=",
"true",
")",
"{",
"return",
"$",
"this",
"->",
"repository",
"->",
"findModelStates",
"(",
"$",
"model",
"->",
"getWorkflowI... | Returns all model states.
@param ModelInterface $model
@param string $processName
@param bool $successOnly
@return mixed | [
"Returns",
"all",
"model",
"states",
"."
] | 0caf4609843c8b1929f14d7c717e37626c3f2f71 | https://github.com/lexik/LexikWorkflowBundle/blob/0caf4609843c8b1929f14d7c717e37626c3f2f71/Model/ModelStorage.php#L61-L68 |
223,445 | lexik/LexikWorkflowBundle | Model/ModelStorage.php | ModelStorage.newModelStateError | public function newModelStateError(ModelInterface $model, $processName, $stepName, ViolationList $violationList, $previous = null)
{
$modelState = $this->createModelState($model, $processName, $stepName, $previous);
$modelState->setSuccessful(false);
$modelState->setErrors($violationList->to... | php | public function newModelStateError(ModelInterface $model, $processName, $stepName, ViolationList $violationList, $previous = null)
{
$modelState = $this->createModelState($model, $processName, $stepName, $previous);
$modelState->setSuccessful(false);
$modelState->setErrors($violationList->to... | [
"public",
"function",
"newModelStateError",
"(",
"ModelInterface",
"$",
"model",
",",
"$",
"processName",
",",
"$",
"stepName",
",",
"ViolationList",
"$",
"violationList",
",",
"$",
"previous",
"=",
"null",
")",
"{",
"$",
"modelState",
"=",
"$",
"this",
"->"... | Create a new invalid model state.
@param ModelInterface $model
@param string $processName
@param string $stepName
@param ViolationList $violationList
@param null|ModelState $previous
@return ModelState | [
"Create",
"a",
"new",
"invalid",
"model",
"state",
"."
] | 0caf4609843c8b1929f14d7c717e37626c3f2f71 | https://github.com/lexik/LexikWorkflowBundle/blob/0caf4609843c8b1929f14d7c717e37626c3f2f71/Model/ModelStorage.php#L81-L91 |
223,446 | lexik/LexikWorkflowBundle | Model/ModelStorage.php | ModelStorage.deleteAllModelStates | public function deleteAllModelStates(ModelInterface $model, $processName = null)
{
return $this->repository->deleteModelStates(
$model->getWorkflowIdentifier(),
$processName
);
} | php | public function deleteAllModelStates(ModelInterface $model, $processName = null)
{
return $this->repository->deleteModelStates(
$model->getWorkflowIdentifier(),
$processName
);
} | [
"public",
"function",
"deleteAllModelStates",
"(",
"ModelInterface",
"$",
"model",
",",
"$",
"processName",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"repository",
"->",
"deleteModelStates",
"(",
"$",
"model",
"->",
"getWorkflowIdentifier",
"(",
")",
... | Delete all model states.
@param ModelInterface $model
@param string $processName | [
"Delete",
"all",
"model",
"states",
"."
] | 0caf4609843c8b1929f14d7c717e37626c3f2f71 | https://github.com/lexik/LexikWorkflowBundle/blob/0caf4609843c8b1929f14d7c717e37626c3f2f71/Model/ModelStorage.php#L99-L105 |
223,447 | lexik/LexikWorkflowBundle | Model/ModelStorage.php | ModelStorage.newModelStateSuccess | public function newModelStateSuccess(ModelInterface $model, $processName, $stepName, $previous = null)
{
$modelState = $this->createModelState($model, $processName, $stepName, $previous);
$modelState->setSuccessful(true);
$this->om->persist($modelState);
$this->om->flush($modelState... | php | public function newModelStateSuccess(ModelInterface $model, $processName, $stepName, $previous = null)
{
$modelState = $this->createModelState($model, $processName, $stepName, $previous);
$modelState->setSuccessful(true);
$this->om->persist($modelState);
$this->om->flush($modelState... | [
"public",
"function",
"newModelStateSuccess",
"(",
"ModelInterface",
"$",
"model",
",",
"$",
"processName",
",",
"$",
"stepName",
",",
"$",
"previous",
"=",
"null",
")",
"{",
"$",
"modelState",
"=",
"$",
"this",
"->",
"createModelState",
"(",
"$",
"model",
... | Create a new successful model state.
@param ModelInterface $model
@param string $processName
@param string $stepName
@param ModelState $previous
@return \Lexik\Bundle\WorkflowBundle\Entity\ModelState | [
"Create",
"a",
"new",
"successful",
"model",
"state",
"."
] | 0caf4609843c8b1929f14d7c717e37626c3f2f71 | https://github.com/lexik/LexikWorkflowBundle/blob/0caf4609843c8b1929f14d7c717e37626c3f2f71/Model/ModelStorage.php#L117-L126 |
223,448 | lexik/LexikWorkflowBundle | Model/ModelStorage.php | ModelStorage.createModelState | protected function createModelState(ModelInterface $model, $processName, $stepName, $previous = null)
{
$modelState = new ModelState();
$modelState->setWorkflowIdentifier($model->getWorkflowIdentifier());
$modelState->setProcessName($processName);
$modelState->setStepName($stepName);... | php | protected function createModelState(ModelInterface $model, $processName, $stepName, $previous = null)
{
$modelState = new ModelState();
$modelState->setWorkflowIdentifier($model->getWorkflowIdentifier());
$modelState->setProcessName($processName);
$modelState->setStepName($stepName);... | [
"protected",
"function",
"createModelState",
"(",
"ModelInterface",
"$",
"model",
",",
"$",
"processName",
",",
"$",
"stepName",
",",
"$",
"previous",
"=",
"null",
")",
"{",
"$",
"modelState",
"=",
"new",
"ModelState",
"(",
")",
";",
"$",
"modelState",
"->... | Create a new model state.
@param ModelInterface $model
@param string $processName
@param string $stepName
@param ModelState $previous
@return \Lexik\Bundle\WorkflowBun... | [
"Create",
"a",
"new",
"model",
"state",
"."
] | 0caf4609843c8b1929f14d7c717e37626c3f2f71 | https://github.com/lexik/LexikWorkflowBundle/blob/0caf4609843c8b1929f14d7c717e37626c3f2f71/Model/ModelStorage.php#L149-L162 |
223,449 | wirecard/checkout-client-library | library/WirecardCEE/Stdlib/Return/ReturnAbstract.php | WirecardCEE_Stdlib_Return_ReturnAbstract.addValidator | public function addValidator(WirecardCEE_Stdlib_Validate_ValidateAbstract $oValidator, $param)
{
$this->_validators[(string) $param][] = $oValidator;
return $this;
} | php | public function addValidator(WirecardCEE_Stdlib_Validate_ValidateAbstract $oValidator, $param)
{
$this->_validators[(string) $param][] = $oValidator;
return $this;
} | [
"public",
"function",
"addValidator",
"(",
"WirecardCEE_Stdlib_Validate_ValidateAbstract",
"$",
"oValidator",
",",
"$",
"param",
")",
"{",
"$",
"this",
"->",
"_validators",
"[",
"(",
"string",
")",
"$",
"param",
"]",
"[",
"]",
"=",
"$",
"oValidator",
";",
"r... | Adds the validator
@param WirecardCEE_Stdlib_Validate_ValidateAbstract $oValidator
@param string $param
@return WirecardCEE_Stdlib_Return_ReturnAbstract | [
"Adds",
"the",
"validator"
] | ad0f8c88dfb3c39091c80b1b58e8dd3604f3e25c | https://github.com/wirecard/checkout-client-library/blob/ad0f8c88dfb3c39091c80b1b58e8dd3604f3e25c/library/WirecardCEE/Stdlib/Return/ReturnAbstract.php#L121-L126 |
223,450 | wirecard/checkout-client-library | library/WirecardCEE/Stdlib/Return/ReturnAbstract.php | WirecardCEE_Stdlib_Return_ReturnAbstract.getReturned | public function getReturned()
{
$ret = $this->_returnData;
// noone needs the responseFingerprintOrder and responseFingerprint in the shop.
if (array_key_exists('responseFingerprintOrder', $ret)) {
unset( $ret['responseFingerprintOrder'] );
}
if (array_key_exist... | php | public function getReturned()
{
$ret = $this->_returnData;
// noone needs the responseFingerprintOrder and responseFingerprint in the shop.
if (array_key_exists('responseFingerprintOrder', $ret)) {
unset( $ret['responseFingerprintOrder'] );
}
if (array_key_exist... | [
"public",
"function",
"getReturned",
"(",
")",
"{",
"$",
"ret",
"=",
"$",
"this",
"->",
"_returnData",
";",
"// noone needs the responseFingerprintOrder and responseFingerprint in the shop.",
"if",
"(",
"array_key_exists",
"(",
"'responseFingerprintOrder'",
",",
"$",
"ret... | getter for filtered return data.
@return string[] | [
"getter",
"for",
"filtered",
"return",
"data",
"."
] | ad0f8c88dfb3c39091c80b1b58e8dd3604f3e25c | https://github.com/wirecard/checkout-client-library/blob/ad0f8c88dfb3c39091c80b1b58e8dd3604f3e25c/library/WirecardCEE/Stdlib/Return/ReturnAbstract.php#L157-L171 |
223,451 | lexik/LexikWorkflowBundle | Model/ModelStateRepository.php | ModelStateRepository.findModelStates | public function findModelStates($workflowIdentifier, $processName, $successOnly)
{
$qb = $this->createQueryBuilder('ms')
->andWhere('ms.workflowIdentifier = :workflow_identifier')
->andWhere('ms.processName = :process')
->orderBy('ms.createdAt', 'ASC')
->setPa... | php | public function findModelStates($workflowIdentifier, $processName, $successOnly)
{
$qb = $this->createQueryBuilder('ms')
->andWhere('ms.workflowIdentifier = :workflow_identifier')
->andWhere('ms.processName = :process')
->orderBy('ms.createdAt', 'ASC')
->setPa... | [
"public",
"function",
"findModelStates",
"(",
"$",
"workflowIdentifier",
",",
"$",
"processName",
",",
"$",
"successOnly",
")",
"{",
"$",
"qb",
"=",
"$",
"this",
"->",
"createQueryBuilder",
"(",
"'ms'",
")",
"->",
"andWhere",
"(",
"'ms.workflowIdentifier = :work... | Returns all model states for the given workflow identifier.
@param string $workflowIdentifier
@param string $processName
@param boolean $successOnly
@return array | [
"Returns",
"all",
"model",
"states",
"for",
"the",
"given",
"workflow",
"identifier",
"."
] | 0caf4609843c8b1929f14d7c717e37626c3f2f71 | https://github.com/lexik/LexikWorkflowBundle/blob/0caf4609843c8b1929f14d7c717e37626c3f2f71/Model/ModelStateRepository.php#L51-L67 |
223,452 | wirecard/checkout-client-library | library/WirecardCEE/QPay/Response/Toolkit/Order.php | WirecardCEE_QPay_Response_Toolkit_Order.getOperationsAllowed | public function getOperationsAllowed()
{
if ($this->_getField(self::$OPERATIONS_ALLOWED) == '') {
return Array();
} else {
return explode(',', $this->_getField(self::$OPERATIONS_ALLOWED));
}
} | php | public function getOperationsAllowed()
{
if ($this->_getField(self::$OPERATIONS_ALLOWED) == '') {
return Array();
} else {
return explode(',', $this->_getField(self::$OPERATIONS_ALLOWED));
}
} | [
"public",
"function",
"getOperationsAllowed",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_getField",
"(",
"self",
"::",
"$",
"OPERATIONS_ALLOWED",
")",
"==",
"''",
")",
"{",
"return",
"Array",
"(",
")",
";",
"}",
"else",
"{",
"return",
"explode",
"(... | getter for allowed follow-up operations
@return string[] | [
"getter",
"for",
"allowed",
"follow",
"-",
"up",
"operations"
] | ad0f8c88dfb3c39091c80b1b58e8dd3604f3e25c | https://github.com/wirecard/checkout-client-library/blob/ad0f8c88dfb3c39091c80b1b58e8dd3604f3e25c/library/WirecardCEE/QPay/Response/Toolkit/Order.php#L375-L382 |
223,453 | wirecard/checkout-client-library | library/WirecardCEE/QMore/ReturnFactory.php | WirecardCEE_QMore_ReturnFactory._getInstance | protected static function _getInstance($return, $secret)
{
switch (strtoupper($return['paymentState'])) {
case parent::STATE_SUCCESS:
return self::_getSuccessInstance($return, $secret);
break;
case parent::STATE_CANCEL:
return new Wirec... | php | protected static function _getInstance($return, $secret)
{
switch (strtoupper($return['paymentState'])) {
case parent::STATE_SUCCESS:
return self::_getSuccessInstance($return, $secret);
break;
case parent::STATE_CANCEL:
return new Wirec... | [
"protected",
"static",
"function",
"_getInstance",
"(",
"$",
"return",
",",
"$",
"secret",
")",
"{",
"switch",
"(",
"strtoupper",
"(",
"$",
"return",
"[",
"'paymentState'",
"]",
")",
")",
"{",
"case",
"parent",
"::",
"STATE_SUCCESS",
":",
"return",
"self",... | Returns the "return" sintance object
@param array $return
@param string $secret
@throws WirecardCEE_QMore_Exception_InvalidResponseException
@return WirecardCEE_QMore_Return_Cancel|WirecardCEE_QMore_Return_Failure|WirecardCEE_QMore_Return_Pending|WirecardCEE_QMore_Return_Success | [
"Returns",
"the",
"return",
"sintance",
"object"
] | ad0f8c88dfb3c39091c80b1b58e8dd3604f3e25c | https://github.com/wirecard/checkout-client-library/blob/ad0f8c88dfb3c39091c80b1b58e8dd3604f3e25c/library/WirecardCEE/QMore/ReturnFactory.php#L82-L101 |
223,454 | wirecard/checkout-client-library | library/WirecardCEE/QMore/ReturnFactory.php | WirecardCEE_QMore_ReturnFactory._getSuccessInstance | protected static function _getSuccessInstance($return, $secret)
{
if (!array_key_exists('paymentType', $return)) {
throw new WirecardCEE_QMore_Exception_InvalidResponseException('Invalid response from QMORE. Paymenttype is missing.');
}
switch (strtoupper($return['paymentType'])... | php | protected static function _getSuccessInstance($return, $secret)
{
if (!array_key_exists('paymentType', $return)) {
throw new WirecardCEE_QMore_Exception_InvalidResponseException('Invalid response from QMORE. Paymenttype is missing.');
}
switch (strtoupper($return['paymentType'])... | [
"protected",
"static",
"function",
"_getSuccessInstance",
"(",
"$",
"return",
",",
"$",
"secret",
")",
"{",
"if",
"(",
"!",
"array_key_exists",
"(",
"'paymentType'",
",",
"$",
"return",
")",
")",
"{",
"throw",
"new",
"WirecardCEE_QMore_Exception_InvalidResponseExc... | getter for the correct QMORE success return instance
@param string[] $return
@param string $secret
@return WirecardCEE_QMore_Return_Success
@throws WirecardCEE_QMore_Exception_InvalidResponseException | [
"getter",
"for",
"the",
"correct",
"QMORE",
"success",
"return",
"instance"
] | ad0f8c88dfb3c39091c80b1b58e8dd3604f3e25c | https://github.com/wirecard/checkout-client-library/blob/ad0f8c88dfb3c39091c80b1b58e8dd3604f3e25c/library/WirecardCEE/QMore/ReturnFactory.php#L112-L140 |
223,455 | inpsyde/menu-cache | src/MenuCache.php | MenuCache.cache_menu | public function cache_menu( $menu, $args ) {
if ( $this->should_cache_menu( $args ) ) {
set_transient( $this->menu_key( $args ), $menu, $this->expiration() );
}
return $menu;
} | php | public function cache_menu( $menu, $args ) {
if ( $this->should_cache_menu( $args ) ) {
set_transient( $this->menu_key( $args ), $menu, $this->expiration() );
}
return $menu;
} | [
"public",
"function",
"cache_menu",
"(",
"$",
"menu",
",",
"$",
"args",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"should_cache_menu",
"(",
"$",
"args",
")",
")",
"{",
"set_transient",
"(",
"$",
"this",
"->",
"menu_key",
"(",
"$",
"args",
")",
",",
"... | Stores the menu HTML in a transient.
@since 1.0.0
@wp-hook wp_nav_menu
@param string $menu Menu HTML.
@param object $args Menu args.
@return string Unfiltered menu HTML. | [
"Stores",
"the",
"menu",
"HTML",
"in",
"a",
"transient",
"."
] | 45ae3160484966cd642c4da0c66e275b1b23984b | https://github.com/inpsyde/menu-cache/blob/45ae3160484966cd642c4da0c66e275b1b23984b/src/MenuCache.php#L101-L108 |
223,456 | inpsyde/menu-cache | src/MenuCache.php | MenuCache.get_menu | public function get_menu( $menu, $args ) {
if ( $this->should_cache_menu( $args ) ) {
$cached_menu = get_transient( $this->menu_key( $args ) );
if ( is_string( $cached_menu ) ) {
return $cached_menu;
}
}
return $menu;
} | php | public function get_menu( $menu, $args ) {
if ( $this->should_cache_menu( $args ) ) {
$cached_menu = get_transient( $this->menu_key( $args ) );
if ( is_string( $cached_menu ) ) {
return $cached_menu;
}
}
return $menu;
} | [
"public",
"function",
"get_menu",
"(",
"$",
"menu",
",",
"$",
"args",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"should_cache_menu",
"(",
"$",
"args",
")",
")",
"{",
"$",
"cached_menu",
"=",
"get_transient",
"(",
"$",
"this",
"->",
"menu_key",
"(",
"$"... | Returns a cached menu, if found.
@since 1.0.0
@wp-hook pre_wp_nav_menu
@param string|null $menu Menu HTML, or null.
@param object $args Menu args.
@return string|null Cached menu HTML, if found, or original value. | [
"Returns",
"a",
"cached",
"menu",
"if",
"found",
"."
] | 45ae3160484966cd642c4da0c66e275b1b23984b | https://github.com/inpsyde/menu-cache/blob/45ae3160484966cd642c4da0c66e275b1b23984b/src/MenuCache.php#L121-L131 |
223,457 | inpsyde/menu-cache | src/MenuCache.php | MenuCache.expiration | private function expiration() {
if ( isset( $this->expiration ) ) {
return $this->expiration;
}
/**
* Filters the expiration.
*
* @since 1.0.0
*
* @param int $expiration Expiration in seconds.
*/
$this->expiration = (int) apply_filters( self::FILTER_EXPIRATION, 300 );
return $this->exp... | php | private function expiration() {
if ( isset( $this->expiration ) ) {
return $this->expiration;
}
/**
* Filters the expiration.
*
* @since 1.0.0
*
* @param int $expiration Expiration in seconds.
*/
$this->expiration = (int) apply_filters( self::FILTER_EXPIRATION, 300 );
return $this->exp... | [
"private",
"function",
"expiration",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"expiration",
")",
")",
"{",
"return",
"$",
"this",
"->",
"expiration",
";",
"}",
"/**\n\t\t * Filters the expiration.\n\t\t *\n\t\t * @since 1.0.0\n\t\t *\n\t\t * @param i... | Returns the expiration.
@return int Expiration. | [
"Returns",
"the",
"expiration",
"."
] | 45ae3160484966cd642c4da0c66e275b1b23984b | https://github.com/inpsyde/menu-cache/blob/45ae3160484966cd642c4da0c66e275b1b23984b/src/MenuCache.php#L138-L154 |
223,458 | inpsyde/menu-cache | src/MenuCache.php | MenuCache.should_cache_menu | private function should_cache_menu( $args ) {
$should_cache_menu = true;
if ( ! empty( $args->theme_location ) ) {
$theme_locations = $this->theme_locations();
if ( $theme_locations ) {
$should_cache_menu = in_array( $args->theme_location, $theme_locations, true );
}
}
/**
* Filters the cachi... | php | private function should_cache_menu( $args ) {
$should_cache_menu = true;
if ( ! empty( $args->theme_location ) ) {
$theme_locations = $this->theme_locations();
if ( $theme_locations ) {
$should_cache_menu = in_array( $args->theme_location, $theme_locations, true );
}
}
/**
* Filters the cachi... | [
"private",
"function",
"should_cache_menu",
"(",
"$",
"args",
")",
"{",
"$",
"should_cache_menu",
"=",
"true",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"args",
"->",
"theme_location",
")",
")",
"{",
"$",
"theme_locations",
"=",
"$",
"this",
"->",
"theme_l... | Checks if a menu should be cached.
@param object $args Menu args.
@return bool Whether or not the menu should be cached. | [
"Checks",
"if",
"a",
"menu",
"should",
"be",
"cached",
"."
] | 45ae3160484966cd642c4da0c66e275b1b23984b | https://github.com/inpsyde/menu-cache/blob/45ae3160484966cd642c4da0c66e275b1b23984b/src/MenuCache.php#L191-L211 |
223,459 | inpsyde/menu-cache | src/MenuCache.php | MenuCache.theme_locations | private function theme_locations() {
if ( isset( $this->theme_locations ) ) {
return $this->theme_locations;
}
/**
* Filters the theme locations.
*
* @since 1.0.0
*
* @param string|string[] $theme_locations One or more theme locations.
*/
$theme_locations = (array) apply_filters( self::FI... | php | private function theme_locations() {
if ( isset( $this->theme_locations ) ) {
return $this->theme_locations;
}
/**
* Filters the theme locations.
*
* @since 1.0.0
*
* @param string|string[] $theme_locations One or more theme locations.
*/
$theme_locations = (array) apply_filters( self::FI... | [
"private",
"function",
"theme_locations",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"theme_locations",
")",
")",
"{",
"return",
"$",
"this",
"->",
"theme_locations",
";",
"}",
"/**\n\t\t * Filters the theme locations.\n\t\t *\n\t\t * @since 1.0.0\n\t\... | Returns the theme locations.
@return string[] Theme locations. | [
"Returns",
"the",
"theme",
"locations",
"."
] | 45ae3160484966cd642c4da0c66e275b1b23984b | https://github.com/inpsyde/menu-cache/blob/45ae3160484966cd642c4da0c66e275b1b23984b/src/MenuCache.php#L218-L236 |
223,460 | haridarshan/instagram-php | src/LoginUrl.php | LoginUrl.loginUrl | public function loginUrl()
{
$query = 'client_id=' . $this->app->getId() . '&redirect_uri=' . urlencode($this->callback) . '&response_type=code&state=' . $this->state;
$query .= isset($this->scopes) ? '&scope=' . urlencode(str_replace(',', ' ', implode(',', $this->scopes))) : '';
return spr... | php | public function loginUrl()
{
$query = 'client_id=' . $this->app->getId() . '&redirect_uri=' . urlencode($this->callback) . '&response_type=code&state=' . $this->state;
$query .= isset($this->scopes) ? '&scope=' . urlencode(str_replace(',', ' ', implode(',', $this->scopes))) : '';
return spr... | [
"public",
"function",
"loginUrl",
"(",
")",
"{",
"$",
"query",
"=",
"'client_id='",
".",
"$",
"this",
"->",
"app",
"->",
"getId",
"(",
")",
".",
"'&redirect_uri='",
".",
"urlencode",
"(",
"$",
"this",
"->",
"callback",
")",
".",
"'&response_type=code&state... | Creates login url
@return string | [
"Creates",
"login",
"url"
] | 5f21e622eaffcbb9b30f12ebdf0064a91ff1caff | https://github.com/haridarshan/instagram-php/blob/5f21e622eaffcbb9b30f12ebdf0064a91ff1caff/src/LoginUrl.php#L80-L86 |
223,461 | EtonDigital/EDBlogBundle | Controller/Backend/FeedController.php | FeedController.feedAction | public function feedAction($type)
{
$articles = $this->get('app_repository_article')->getActiveArticles();
$feed = $this->get('eko_feed.feed.manager')->get('article');
$feed->addFromArray($articles);
return new Response($feed->render($type)); // or 'atom'
} | php | public function feedAction($type)
{
$articles = $this->get('app_repository_article')->getActiveArticles();
$feed = $this->get('eko_feed.feed.manager')->get('article');
$feed->addFromArray($articles);
return new Response($feed->render($type)); // or 'atom'
} | [
"public",
"function",
"feedAction",
"(",
"$",
"type",
")",
"{",
"$",
"articles",
"=",
"$",
"this",
"->",
"get",
"(",
"'app_repository_article'",
")",
"->",
"getActiveArticles",
"(",
")",
";",
"$",
"feed",
"=",
"$",
"this",
"->",
"get",
"(",
"'eko_feed.fe... | Generate the article feed | [
"Generate",
"the",
"article",
"feed"
] | bce97b1991b6201733aa7459712c840d92a96ccc | https://github.com/EtonDigital/EDBlogBundle/blob/bce97b1991b6201733aa7459712c840d92a96ccc/Controller/Backend/FeedController.php#L19-L27 |
223,462 | lexik/LexikWorkflowBundle | Handler/ProcessAggregator.php | ProcessAggregator.getProcess | public function getProcess($name)
{
if (!isset($this->processes[$name])) {
throw new WorkflowException(sprintf('Unknown process "%s".', $name));
}
return $this->processes[$name];
} | php | public function getProcess($name)
{
if (!isset($this->processes[$name])) {
throw new WorkflowException(sprintf('Unknown process "%s".', $name));
}
return $this->processes[$name];
} | [
"public",
"function",
"getProcess",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"processes",
"[",
"$",
"name",
"]",
")",
")",
"{",
"throw",
"new",
"WorkflowException",
"(",
"sprintf",
"(",
"'Unknown process \"%s\".'",
","... | Returns a process by its name.
@param string $name
@return \Lexik\Bundle\WorkflowBundle\Flow\Process
@throws WorkflowException | [
"Returns",
"a",
"process",
"by",
"its",
"name",
"."
] | 0caf4609843c8b1929f14d7c717e37626c3f2f71 | https://github.com/lexik/LexikWorkflowBundle/blob/0caf4609843c8b1929f14d7c717e37626c3f2f71/Handler/ProcessAggregator.php#L37-L44 |
223,463 | EtonDigital/EDBlogBundle | Controller/Frontend/RedirectController.php | RedirectController.authenticateAction | public function authenticateAction(Request $request)
{
if(!$this->getUser())
{
//Get redirecting route
$referer = $request->headers->get('referer');
//Get section on the page to be redirected at
$pageSection = $request->get('section', false);
... | php | public function authenticateAction(Request $request)
{
if(!$this->getUser())
{
//Get redirecting route
$referer = $request->headers->get('referer');
//Get section on the page to be redirected at
$pageSection = $request->get('section', false);
... | [
"public",
"function",
"authenticateAction",
"(",
"Request",
"$",
"request",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"getUser",
"(",
")",
")",
"{",
"//Get redirecting route",
"$",
"referer",
"=",
"$",
"request",
"->",
"headers",
"->",
"get",
"(",
"'r... | This action will ask for authorization and redirect user back to referer
@Route("/authenticate", name="ed_blog_redirect_authenticate") | [
"This",
"action",
"will",
"ask",
"for",
"authorization",
"and",
"redirect",
"user",
"back",
"to",
"referer"
] | bce97b1991b6201733aa7459712c840d92a96ccc | https://github.com/EtonDigital/EDBlogBundle/blob/bce97b1991b6201733aa7459712c840d92a96ccc/Controller/Frontend/RedirectController.php#L26-L69 |
223,464 | wirecard/checkout-client-library | library/WirecardCEE/Stdlib/Fingerprint.php | WirecardCEE_Stdlib_Fingerprint.generate | public static function generate(Array $aValues, WirecardCEE_Stdlib_FingerprintOrder $oFingerprintOrder)
{
if (self::$_HASH_ALGORITHM == self::HASH_ALGORITHM_HMAC_SHA512) {
$secret = isset( $aValues['secret'] ) && !empty( $aValues['secret'] ) ? $aValues['secret'] : '';
if (!strlen($se... | php | public static function generate(Array $aValues, WirecardCEE_Stdlib_FingerprintOrder $oFingerprintOrder)
{
if (self::$_HASH_ALGORITHM == self::HASH_ALGORITHM_HMAC_SHA512) {
$secret = isset( $aValues['secret'] ) && !empty( $aValues['secret'] ) ? $aValues['secret'] : '';
if (!strlen($se... | [
"public",
"static",
"function",
"generate",
"(",
"Array",
"$",
"aValues",
",",
"WirecardCEE_Stdlib_FingerprintOrder",
"$",
"oFingerprintOrder",
")",
"{",
"if",
"(",
"self",
"::",
"$",
"_HASH_ALGORITHM",
"==",
"self",
"::",
"HASH_ALGORITHM_HMAC_SHA512",
")",
"{",
"... | generates an Fingerprint-string
@param array $aValues
@param array $oFingerprintOrder | [
"generates",
"an",
"Fingerprint",
"-",
"string"
] | ad0f8c88dfb3c39091c80b1b58e8dd3604f3e25c | https://github.com/wirecard/checkout-client-library/blob/ad0f8c88dfb3c39091c80b1b58e8dd3604f3e25c/library/WirecardCEE/Stdlib/Fingerprint.php#L102-L124 |
223,465 | wirecard/checkout-client-library | library/WirecardCEE/Stdlib/ConsumerData/Address.php | WirecardCEE_Stdlib_ConsumerData_Address._setField | protected function _setField($name, $value)
{
// e.g. consumerBillingFirstname
$this->_addressData[self::$PREFIX . $this->_addressType . $name] = (string) $value;
} | php | protected function _setField($name, $value)
{
// e.g. consumerBillingFirstname
$this->_addressData[self::$PREFIX . $this->_addressType . $name] = (string) $value;
} | [
"protected",
"function",
"_setField",
"(",
"$",
"name",
",",
"$",
"value",
")",
"{",
"// e.g. consumerBillingFirstname",
"$",
"this",
"->",
"_addressData",
"[",
"self",
"::",
"$",
"PREFIX",
".",
"$",
"this",
"->",
"_addressType",
".",
"$",
"name",
"]",
"="... | setter for an addressfield.
@param string $name
@param string $value | [
"setter",
"for",
"an",
"addressfield",
"."
] | ad0f8c88dfb3c39091c80b1b58e8dd3604f3e25c | https://github.com/wirecard/checkout-client-library/blob/ad0f8c88dfb3c39091c80b1b58e8dd3604f3e25c/library/WirecardCEE/Stdlib/ConsumerData/Address.php#L317-L321 |
223,466 | EtonDigital/EDBlogBundle | Converter/AbstractConverter.php | AbstractConverter.supports | public function supports(ParamConverter $configuration)
{
if (null === $configuration->getClass()) {
return false;
}
if(array_key_exists($configuration->getClass(), $this->targetEntitiesArray))
{
return true;
}
else
{
retur... | php | public function supports(ParamConverter $configuration)
{
if (null === $configuration->getClass()) {
return false;
}
if(array_key_exists($configuration->getClass(), $this->targetEntitiesArray))
{
return true;
}
else
{
retur... | [
"public",
"function",
"supports",
"(",
"ParamConverter",
"$",
"configuration",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"configuration",
"->",
"getClass",
"(",
")",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"array_key_exists",
"(",
"$",
"configurat... | Checks if the object is supported.
@param ParamConverter $configuration Should be an instance of ParamConverter
@return bool True if the object is supported, else false | [
"Checks",
"if",
"the",
"object",
"is",
"supported",
"."
] | bce97b1991b6201733aa7459712c840d92a96ccc | https://github.com/EtonDigital/EDBlogBundle/blob/bce97b1991b6201733aa7459712c840d92a96ccc/Converter/AbstractConverter.php#L79-L93 |
223,467 | silverstripe/silverstripe-ldap | src/Authenticators/LDAPAuthenticator.php | LDAPAuthenticator.authenticate | public function authenticate(array $data, HTTPRequest $request, ValidationResult &$result = null)
{
$result = $result ?: ValidationResult::create();
/** @var LDAPService $service */
$service = Injector::inst()->get(LDAPService::class);
$login = trim($data['Login']);
if (Email... | php | public function authenticate(array $data, HTTPRequest $request, ValidationResult &$result = null)
{
$result = $result ?: ValidationResult::create();
/** @var LDAPService $service */
$service = Injector::inst()->get(LDAPService::class);
$login = trim($data['Login']);
if (Email... | [
"public",
"function",
"authenticate",
"(",
"array",
"$",
"data",
",",
"HTTPRequest",
"$",
"request",
",",
"ValidationResult",
"&",
"$",
"result",
"=",
"null",
")",
"{",
"$",
"result",
"=",
"$",
"result",
"?",
":",
"ValidationResult",
"::",
"create",
"(",
... | Performs the login, but will also create and sync the Member record on-the-fly, if not found.
@param array $data
@param HTTPRequest $request
@param ValidationResult|null $result
@return null|Member | [
"Performs",
"the",
"login",
"but",
"will",
"also",
"create",
"and",
"sync",
"the",
"Member",
"record",
"on",
"-",
"the",
"-",
"fly",
"if",
"not",
"found",
"."
] | e8e6de4de9d61ad383086bc2fb2a793809cb755e | https://github.com/silverstripe/silverstripe-ldap/blob/e8e6de4de9d61ad383086bc2fb2a793809cb755e/src/Authenticators/LDAPAuthenticator.php#L83-L165 |
223,468 | silverstripe/silverstripe-ldap | src/Authenticators/LDAPAuthenticator.php | LDAPAuthenticator.fallbackAuthenticate | protected function fallbackAuthenticate($data, HTTPRequest $request)
{
// Set Email from Login
if (array_key_exists('Login', $data) && !array_key_exists('Email', $data)) {
$data['Email'] = $data['Login'];
}
$authenticatorClass = Config::inst()->get(self::class, 'fallback_... | php | protected function fallbackAuthenticate($data, HTTPRequest $request)
{
// Set Email from Login
if (array_key_exists('Login', $data) && !array_key_exists('Email', $data)) {
$data['Email'] = $data['Login'];
}
$authenticatorClass = Config::inst()->get(self::class, 'fallback_... | [
"protected",
"function",
"fallbackAuthenticate",
"(",
"$",
"data",
",",
"HTTPRequest",
"$",
"request",
")",
"{",
"// Set Email from Login",
"if",
"(",
"array_key_exists",
"(",
"'Login'",
",",
"$",
"data",
")",
"&&",
"!",
"array_key_exists",
"(",
"'Email'",
",",
... | Try to authenticate using the fallback authenticator.
@param array $data
@param HTTPRequest $request
@return null|Member | [
"Try",
"to",
"authenticate",
"using",
"the",
"fallback",
"authenticator",
"."
] | e8e6de4de9d61ad383086bc2fb2a793809cb755e | https://github.com/silverstripe/silverstripe-ldap/blob/e8e6de4de9d61ad383086bc2fb2a793809cb755e/src/Authenticators/LDAPAuthenticator.php#L174-L192 |
223,469 | EtonDigital/EDBlogBundle | Hydrators/SettingsHydrator.php | SettingsHydrator.hydrateAllData | protected function hydrateAllData()
{
$result = array();
$data = $this->_stmt->fetchAll(PDO::FETCH_ASSOC);
foreach($data as $row)
{
$keys = array_keys($row);
$result[ $row[ $keys[0] ] ] = $row[ $keys[1] ];
}
return $result;
} | php | protected function hydrateAllData()
{
$result = array();
$data = $this->_stmt->fetchAll(PDO::FETCH_ASSOC);
foreach($data as $row)
{
$keys = array_keys($row);
$result[ $row[ $keys[0] ] ] = $row[ $keys[1] ];
}
return $result;
} | [
"protected",
"function",
"hydrateAllData",
"(",
")",
"{",
"$",
"result",
"=",
"array",
"(",
")",
";",
"$",
"data",
"=",
"$",
"this",
"->",
"_stmt",
"->",
"fetchAll",
"(",
"PDO",
"::",
"FETCH_ASSOC",
")",
";",
"foreach",
"(",
"$",
"data",
"as",
"$",
... | Hydrates all rows from the current statement instance at once.
@return array | [
"Hydrates",
"all",
"rows",
"from",
"the",
"current",
"statement",
"instance",
"at",
"once",
"."
] | bce97b1991b6201733aa7459712c840d92a96ccc | https://github.com/EtonDigital/EDBlogBundle/blob/bce97b1991b6201733aa7459712c840d92a96ccc/Hydrators/SettingsHydrator.php#L21-L34 |
223,470 | lexik/LexikWorkflowBundle | Validation/ViolationList.php | ViolationList.toArray | public function toArray()
{
$data = array();
foreach ($this->violations as $violation) {
$data[] = $violation->getMessage();
}
return $data;
} | php | public function toArray()
{
$data = array();
foreach ($this->violations as $violation) {
$data[] = $violation->getMessage();
}
return $data;
} | [
"public",
"function",
"toArray",
"(",
")",
"{",
"$",
"data",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"violations",
"as",
"$",
"violation",
")",
"{",
"$",
"data",
"[",
"]",
"=",
"$",
"violation",
"->",
"getMessage",
"(",
")",... | Cast violations to flat array.
@return array | [
"Cast",
"violations",
"to",
"flat",
"array",
"."
] | 0caf4609843c8b1929f14d7c717e37626c3f2f71 | https://github.com/lexik/LexikWorkflowBundle/blob/0caf4609843c8b1929f14d7c717e37626c3f2f71/Validation/ViolationList.php#L102-L110 |
223,471 | silverstripe/silverstripe-ldap | src/Services/LDAPService.php | LDAPService.getGroups | public function getGroups($cached = true, $attributes = [], $indexBy = 'dn')
{
$searchLocations = $this->config()->groups_search_locations ?: [null];
$cache = self::get_cache();
$cacheKey = 'groups' . md5(implode('', array_merge($searchLocations, $attributes)));
$results = $cache->ha... | php | public function getGroups($cached = true, $attributes = [], $indexBy = 'dn')
{
$searchLocations = $this->config()->groups_search_locations ?: [null];
$cache = self::get_cache();
$cacheKey = 'groups' . md5(implode('', array_merge($searchLocations, $attributes)));
$results = $cache->ha... | [
"public",
"function",
"getGroups",
"(",
"$",
"cached",
"=",
"true",
",",
"$",
"attributes",
"=",
"[",
"]",
",",
"$",
"indexBy",
"=",
"'dn'",
")",
"{",
"$",
"searchLocations",
"=",
"$",
"this",
"->",
"config",
"(",
")",
"->",
"groups_search_locations",
... | Return all AD groups in configured search locations, including all nested groups.
Uses groups_search_locations if defined, otherwise falls back to NULL, which tells LDAPGateway
to use the default baseDn defined in the connection.
@param boolean $cached Cache the results from AD, so that subsequent calls are faster. En... | [
"Return",
"all",
"AD",
"groups",
"in",
"configured",
"search",
"locations",
"including",
"all",
"nested",
"groups",
".",
"Uses",
"groups_search_locations",
"if",
"defined",
"otherwise",
"falls",
"back",
"to",
"NULL",
"which",
"tells",
"LDAPGateway",
"to",
"use",
... | e8e6de4de9d61ad383086bc2fb2a793809cb755e | https://github.com/silverstripe/silverstripe-ldap/blob/e8e6de4de9d61ad383086bc2fb2a793809cb755e/src/Services/LDAPService.php#L266-L294 |
223,472 | silverstripe/silverstripe-ldap | src/Services/LDAPService.php | LDAPService.getGroupByGUID | public function getGroupByGUID($guid, $attributes = [])
{
$searchLocations = $this->config()->groups_search_locations ?: [null];
foreach ($searchLocations as $searchLocation) {
$records = $this->getGateway()->getGroupByGUID($guid, $searchLocation, Ldap::SEARCH_SCOPE_SUB, $attributes);
... | php | public function getGroupByGUID($guid, $attributes = [])
{
$searchLocations = $this->config()->groups_search_locations ?: [null];
foreach ($searchLocations as $searchLocation) {
$records = $this->getGateway()->getGroupByGUID($guid, $searchLocation, Ldap::SEARCH_SCOPE_SUB, $attributes);
... | [
"public",
"function",
"getGroupByGUID",
"(",
"$",
"guid",
",",
"$",
"attributes",
"=",
"[",
"]",
")",
"{",
"$",
"searchLocations",
"=",
"$",
"this",
"->",
"config",
"(",
")",
"->",
"groups_search_locations",
"?",
":",
"[",
"null",
"]",
";",
"foreach",
... | Get a particular AD group's data given a GUID.
@param string $guid
@param array $attributes List of specific AD attributes to return. Empty array means return everything.
@return array | [
"Get",
"a",
"particular",
"AD",
"group",
"s",
"data",
"given",
"a",
"GUID",
"."
] | e8e6de4de9d61ad383086bc2fb2a793809cb755e | https://github.com/silverstripe/silverstripe-ldap/blob/e8e6de4de9d61ad383086bc2fb2a793809cb755e/src/Services/LDAPService.php#L330-L339 |
223,473 | silverstripe/silverstripe-ldap | src/Services/LDAPService.php | LDAPService.getUsers | public function getUsers($attributes = [])
{
$searchLocations = $this->config()->users_search_locations ?: [null];
$results = [];
foreach ($searchLocations as $searchLocation) {
$records = $this->getGateway()->getUsersWithIterator($searchLocation, $attributes);
if (!... | php | public function getUsers($attributes = [])
{
$searchLocations = $this->config()->users_search_locations ?: [null];
$results = [];
foreach ($searchLocations as $searchLocation) {
$records = $this->getGateway()->getUsersWithIterator($searchLocation, $attributes);
if (!... | [
"public",
"function",
"getUsers",
"(",
"$",
"attributes",
"=",
"[",
"]",
")",
"{",
"$",
"searchLocations",
"=",
"$",
"this",
"->",
"config",
"(",
")",
"->",
"users_search_locations",
"?",
":",
"[",
"null",
"]",
";",
"$",
"results",
"=",
"[",
"]",
";"... | Return all AD users in configured search locations, including all users in nested groups.
Uses users_search_locations if defined, otherwise falls back to NULL, which tells LDAPGateway
to use the default baseDn defined in the connection.
@param array $attributes List of specific AD attributes to return. Empty array mea... | [
"Return",
"all",
"AD",
"users",
"in",
"configured",
"search",
"locations",
"including",
"all",
"users",
"in",
"nested",
"groups",
".",
"Uses",
"users_search_locations",
"if",
"defined",
"otherwise",
"falls",
"back",
"to",
"NULL",
"which",
"tells",
"LDAPGateway",
... | e8e6de4de9d61ad383086bc2fb2a793809cb755e | https://github.com/silverstripe/silverstripe-ldap/blob/e8e6de4de9d61ad383086bc2fb2a793809cb755e/src/Services/LDAPService.php#L367-L384 |
223,474 | silverstripe/silverstripe-ldap | src/Services/LDAPService.php | LDAPService.updateMemberGroups | public function updateMemberGroups($data, Member $member)
{
if (isset($data['memberof'])) {
$ldapGroups = is_array($data['memberof']) ? $data['memberof'] : [$data['memberof']];
foreach ($ldapGroups as $groupDN) {
foreach (LDAPGroupMapping::get() as $mapping) {
... | php | public function updateMemberGroups($data, Member $member)
{
if (isset($data['memberof'])) {
$ldapGroups = is_array($data['memberof']) ? $data['memberof'] : [$data['memberof']];
foreach ($ldapGroups as $groupDN) {
foreach (LDAPGroupMapping::get() as $mapping) {
... | [
"public",
"function",
"updateMemberGroups",
"(",
"$",
"data",
",",
"Member",
"$",
"member",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"data",
"[",
"'memberof'",
"]",
")",
")",
"{",
"$",
"ldapGroups",
"=",
"is_array",
"(",
"$",
"data",
"[",
"'memberof'",
... | Ensure the user is mapped to any applicable groups.
@param array $data
@param Member $member | [
"Ensure",
"the",
"user",
"is",
"mapped",
"to",
"any",
"applicable",
"groups",
"."
] | e8e6de4de9d61ad383086bc2fb2a793809cb755e | https://github.com/silverstripe/silverstripe-ldap/blob/e8e6de4de9d61ad383086bc2fb2a793809cb755e/src/Services/LDAPService.php#L694-L765 |
223,475 | silverstripe/silverstripe-ldap | src/Services/LDAPService.php | LDAPService.addLDAPUserToGroup | public function addLDAPUserToGroup($userDn, $groupDn)
{
$members = $this->getLDAPGroupMembers($groupDn);
// this user is already in the group, no need to do anything.
if (in_array($userDn, $members)) {
return;
}
$members[] = $userDn;
try {
$... | php | public function addLDAPUserToGroup($userDn, $groupDn)
{
$members = $this->getLDAPGroupMembers($groupDn);
// this user is already in the group, no need to do anything.
if (in_array($userDn, $members)) {
return;
}
$members[] = $userDn;
try {
$... | [
"public",
"function",
"addLDAPUserToGroup",
"(",
"$",
"userDn",
",",
"$",
"groupDn",
")",
"{",
"$",
"members",
"=",
"$",
"this",
"->",
"getLDAPGroupMembers",
"(",
"$",
"groupDn",
")",
";",
"// this user is already in the group, no need to do anything.",
"if",
"(",
... | Add LDAP user by DN to LDAP group.
@param string $userDn
@param string $groupDn
@throws Exception | [
"Add",
"LDAP",
"user",
"by",
"DN",
"to",
"LDAP",
"group",
"."
] | e8e6de4de9d61ad383086bc2fb2a793809cb755e | https://github.com/silverstripe/silverstripe-ldap/blob/e8e6de4de9d61ad383086bc2fb2a793809cb755e/src/Services/LDAPService.php#L1072-L1088 |
223,476 | silverstripe/silverstripe-ldap | src/Services/LDAPService.php | LDAPService.setPassword | public function setPassword(Member $member, $password, $oldPassword = null)
{
$validationResult = ValidationResult::create();
$this->extend('onBeforeSetPassword', $member, $password, $validationResult);
if (!$member->GUID) {
$this->getLogger()->debug(sprintf('Cannot update Memb... | php | public function setPassword(Member $member, $password, $oldPassword = null)
{
$validationResult = ValidationResult::create();
$this->extend('onBeforeSetPassword', $member, $password, $validationResult);
if (!$member->GUID) {
$this->getLogger()->debug(sprintf('Cannot update Memb... | [
"public",
"function",
"setPassword",
"(",
"Member",
"$",
"member",
",",
"$",
"password",
",",
"$",
"oldPassword",
"=",
"null",
")",
"{",
"$",
"validationResult",
"=",
"ValidationResult",
"::",
"create",
"(",
")",
";",
"$",
"this",
"->",
"extend",
"(",
"'... | Change a members password on the AD. Works with ActiveDirectory compatible services that saves the
password in the `unicodePwd` attribute.
@todo Use the Zend\Ldap\Attribute::setPassword functionality to create a password in
an abstract way, so it works on other LDAP directories, not just Active Directory.
Ensure that... | [
"Change",
"a",
"members",
"password",
"on",
"the",
"AD",
".",
"Works",
"with",
"ActiveDirectory",
"compatible",
"services",
"that",
"saves",
"the",
"password",
"in",
"the",
"unicodePwd",
"attribute",
"."
] | e8e6de4de9d61ad383086bc2fb2a793809cb755e | https://github.com/silverstripe/silverstripe-ldap/blob/e8e6de4de9d61ad383086bc2fb2a793809cb755e/src/Services/LDAPService.php#L1104-L1146 |
223,477 | ConsoleTVs/Links | src/Builder/Link.php | Link.ajax | public function ajax($jquery = false)
{
$url = $this->link->shortered();
$code = $jquery ? "<script src='https://code.jquery.com/jquery-3.1.1.min.js' integrity='sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8=' crossorigin='anonymous'></script>" : '';
$code .= '<script>';
$code ... | php | public function ajax($jquery = false)
{
$url = $this->link->shortered();
$code = $jquery ? "<script src='https://code.jquery.com/jquery-3.1.1.min.js' integrity='sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8=' crossorigin='anonymous'></script>" : '';
$code .= '<script>';
$code ... | [
"public",
"function",
"ajax",
"(",
"$",
"jquery",
"=",
"false",
")",
"{",
"$",
"url",
"=",
"$",
"this",
"->",
"link",
"->",
"shortered",
"(",
")",
";",
"$",
"code",
"=",
"$",
"jquery",
"?",
"\"<script src='https://code.jquery.com/jquery-3.1.1.min.js' integrity... | Returns the javascript code to send a and ajax request to the short url. | [
"Returns",
"the",
"javascript",
"code",
"to",
"send",
"a",
"and",
"ajax",
"request",
"to",
"the",
"short",
"url",
"."
] | f9afe304137f8d7682eac9c46f8aa4c82f5e625c | https://github.com/ConsoleTVs/Links/blob/f9afe304137f8d7682eac9c46f8aa4c82f5e625c/src/Builder/Link.php#L63-L74 |
223,478 | haridarshan/instagram-php | src/HelperFactory.php | HelperFactory.request | public function request(Client $client, $endpoint, $options, $method = 'GET')
{
try {
return $client->request($method, $endpoint, [
'form_params' => $options,
]);
} catch (ClientException $exception) {
static::throwException(static::extractOriginal... | php | public function request(Client $client, $endpoint, $options, $method = 'GET')
{
try {
return $client->request($method, $endpoint, [
'form_params' => $options,
]);
} catch (ClientException $exception) {
static::throwException(static::extractOriginal... | [
"public",
"function",
"request",
"(",
"Client",
"$",
"client",
",",
"$",
"endpoint",
",",
"$",
"options",
",",
"$",
"method",
"=",
"'GET'",
")",
"{",
"try",
"{",
"return",
"$",
"client",
"->",
"request",
"(",
"$",
"method",
",",
"$",
"endpoint",
",",... | Sends request to Instagram Api Endpoints
@param Client $client
@param string $endpoint
@param array|string $options
@param string $method
@throws InstagramOAuthException|InstagramException
@return Response | [
"Sends",
"request",
"to",
"Instagram",
"Api",
"Endpoints"
] | 5f21e622eaffcbb9b30f12ebdf0064a91ff1caff | https://github.com/haridarshan/instagram-php/blob/5f21e622eaffcbb9b30f12ebdf0064a91ff1caff/src/HelperFactory.php#L117-L126 |
223,479 | haridarshan/instagram-php | src/HelperFactory.php | HelperFactory.createBody | protected static function createBody($options, $method)
{
return ('GET' !== $method) ? is_array($options) ? http_build_query($options) : ltrim($options, '&') : null;
} | php | protected static function createBody($options, $method)
{
return ('GET' !== $method) ? is_array($options) ? http_build_query($options) : ltrim($options, '&') : null;
} | [
"protected",
"static",
"function",
"createBody",
"(",
"$",
"options",
",",
"$",
"method",
")",
"{",
"return",
"(",
"'GET'",
"!==",
"$",
"method",
")",
"?",
"is_array",
"(",
"$",
"options",
")",
"?",
"http_build_query",
"(",
"$",
"options",
")",
":",
"l... | Create body for Guzzle client request
@param array|null|string $options
@param string $method GET|POST
@return string|mixed | [
"Create",
"body",
"for",
"Guzzle",
"client",
"request"
] | 5f21e622eaffcbb9b30f12ebdf0064a91ff1caff | https://github.com/haridarshan/instagram-php/blob/5f21e622eaffcbb9b30f12ebdf0064a91ff1caff/src/HelperFactory.php#L136-L139 |
223,480 | haridarshan/instagram-php | src/HelperFactory.php | HelperFactory.throwException | protected static function throwException(\stdClass $object, ClientException $exMessage)
{
$exception = static::createExceptionMessage($object);
if (stripos($exception['error_type'], 'oauth') !== false) {
throw new InstagramOAuthException(
json_encode(['Type' => $exception... | php | protected static function throwException(\stdClass $object, ClientException $exMessage)
{
$exception = static::createExceptionMessage($object);
if (stripos($exception['error_type'], 'oauth') !== false) {
throw new InstagramOAuthException(
json_encode(['Type' => $exception... | [
"protected",
"static",
"function",
"throwException",
"(",
"\\",
"stdClass",
"$",
"object",
",",
"ClientException",
"$",
"exMessage",
")",
"{",
"$",
"exception",
"=",
"static",
"::",
"createExceptionMessage",
"(",
"$",
"object",
")",
";",
"if",
"(",
"stripos",
... | Throw required Exception
@param \stdClass $object
@param ClientException $exMessage
@throws InstagramOAuthException|InstagramException | [
"Throw",
"required",
"Exception"
] | 5f21e622eaffcbb9b30f12ebdf0064a91ff1caff | https://github.com/haridarshan/instagram-php/blob/5f21e622eaffcbb9b30f12ebdf0064a91ff1caff/src/HelperFactory.php#L174-L189 |
223,481 | haridarshan/instagram-php | src/HelperFactory.php | HelperFactory.createExceptionMessage | protected static function createExceptionMessage(\stdClass $object)
{
$message = [];
$message['error_type'] = isset($object->meta) ? $object->meta->error_type : $object->error_type;
$message['error_message'] = isset($object->meta) ? $object->meta->error_message : $object->error_message;
... | php | protected static function createExceptionMessage(\stdClass $object)
{
$message = [];
$message['error_type'] = isset($object->meta) ? $object->meta->error_type : $object->error_type;
$message['error_message'] = isset($object->meta) ? $object->meta->error_message : $object->error_message;
... | [
"protected",
"static",
"function",
"createExceptionMessage",
"(",
"\\",
"stdClass",
"$",
"object",
")",
"{",
"$",
"message",
"=",
"[",
"]",
";",
"$",
"message",
"[",
"'error_type'",
"]",
"=",
"isset",
"(",
"$",
"object",
"->",
"meta",
")",
"?",
"$",
"o... | Creates Exception Message
@param \stdClass $object
@return array | [
"Creates",
"Exception",
"Message"
] | 5f21e622eaffcbb9b30f12ebdf0064a91ff1caff | https://github.com/haridarshan/instagram-php/blob/5f21e622eaffcbb9b30f12ebdf0064a91ff1caff/src/HelperFactory.php#L198-L206 |
223,482 | digiaonline/lumen-fractal | src/FractalBuilder.php | FractalBuilder.makeResource | protected function makeResource()
{
/** @var Item|Collection $resource */
$resource = new $this->resourceClass($this->data, $this->transformer, $this->resourceKey);
if (!empty($this->meta)) {
$resource->setMeta($this->meta);
}
if ($resource instanceof Collection... | php | protected function makeResource()
{
/** @var Item|Collection $resource */
$resource = new $this->resourceClass($this->data, $this->transformer, $this->resourceKey);
if (!empty($this->meta)) {
$resource->setMeta($this->meta);
}
if ($resource instanceof Collection... | [
"protected",
"function",
"makeResource",
"(",
")",
"{",
"/** @var Item|Collection $resource */",
"$",
"resource",
"=",
"new",
"$",
"this",
"->",
"resourceClass",
"(",
"$",
"this",
"->",
"data",
",",
"$",
"this",
"->",
"transformer",
",",
"$",
"this",
"->",
"... | Creates the resource for this builder.
@return ResourceAbstract | [
"Creates",
"the",
"resource",
"for",
"this",
"builder",
"."
] | f2e70aff2d8ae55e072b062ed4ded45d0635069f | https://github.com/digiaonline/lumen-fractal/blob/f2e70aff2d8ae55e072b062ed4ded45d0635069f/src/FractalBuilder.php#L191-L205 |
223,483 | digiaonline/lumen-fractal | src/FractalBuilder.php | FractalBuilder.makeScope | protected function makeScope()
{
$resource = $this->makeResource();
if (isset($this->serializer)) {
$this->fractal->setSerializer($this->serializer);
}
return $this->fractal->createData($resource);
} | php | protected function makeScope()
{
$resource = $this->makeResource();
if (isset($this->serializer)) {
$this->fractal->setSerializer($this->serializer);
}
return $this->fractal->createData($resource);
} | [
"protected",
"function",
"makeScope",
"(",
")",
"{",
"$",
"resource",
"=",
"$",
"this",
"->",
"makeResource",
"(",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"serializer",
")",
")",
"{",
"$",
"this",
"->",
"fractal",
"->",
"setSerializer",
... | Creates the scope for this builder.
@return Scope | [
"Creates",
"the",
"scope",
"for",
"this",
"builder",
"."
] | f2e70aff2d8ae55e072b062ed4ded45d0635069f | https://github.com/digiaonline/lumen-fractal/blob/f2e70aff2d8ae55e072b062ed4ded45d0635069f/src/FractalBuilder.php#L213-L222 |
223,484 | EtonDigital/EDBlogBundle | Controller/Backend/MediaController.php | MediaController.deleteAction | public function deleteAction(Request $request, Media $media)
{
$user = $this->getBlogUser();
$mediaLibrary = $this->container->get('sonata.media.manager.gallery')->findOneBy(array('name' => 'Media Library'));
$em = $this->getDoctrine()->getManager();
foreach($media->getGalleryHasMed... | php | public function deleteAction(Request $request, Media $media)
{
$user = $this->getBlogUser();
$mediaLibrary = $this->container->get('sonata.media.manager.gallery')->findOneBy(array('name' => 'Media Library'));
$em = $this->getDoctrine()->getManager();
foreach($media->getGalleryHasMed... | [
"public",
"function",
"deleteAction",
"(",
"Request",
"$",
"request",
",",
"Media",
"$",
"media",
")",
"{",
"$",
"user",
"=",
"$",
"this",
"->",
"getBlogUser",
"(",
")",
";",
"$",
"mediaLibrary",
"=",
"$",
"this",
"->",
"container",
"->",
"get",
"(",
... | Will remove Media from MediaLibrary, but not from file system!
@Route("/media/delete/{id}", name="ed_blog_admin_media_delete")
@ParamConverter("media", class="ApplicationSonataMediaBundle:Media") | [
"Will",
"remove",
"Media",
"from",
"MediaLibrary",
"but",
"not",
"from",
"file",
"system!"
] | bce97b1991b6201733aa7459712c840d92a96ccc | https://github.com/EtonDigital/EDBlogBundle/blob/bce97b1991b6201733aa7459712c840d92a96ccc/Controller/Backend/MediaController.php#L185-L208 |
223,485 | haridarshan/instagram-php | src/InstagramResponse.php | InstagramResponse.setParams | private function setParams(Response $response)
{
$this->protocol = $response->getProtocolVersion();
$this->statusCode = (int) $response->getStatusCode();
$this->headers = $response->getHeaders();
$this->body = json_decode($response->getBody()->getContents());
$this->extractBo... | php | private function setParams(Response $response)
{
$this->protocol = $response->getProtocolVersion();
$this->statusCode = (int) $response->getStatusCode();
$this->headers = $response->getHeaders();
$this->body = json_decode($response->getBody()->getContents());
$this->extractBo... | [
"private",
"function",
"setParams",
"(",
"Response",
"$",
"response",
")",
"{",
"$",
"this",
"->",
"protocol",
"=",
"$",
"response",
"->",
"getProtocolVersion",
"(",
")",
";",
"$",
"this",
"->",
"statusCode",
"=",
"(",
"int",
")",
"$",
"response",
"->",
... | Set Values to the class members
@param Response $response | [
"Set",
"Values",
"to",
"the",
"class",
"members"
] | 5f21e622eaffcbb9b30f12ebdf0064a91ff1caff | https://github.com/haridarshan/instagram-php/blob/5f21e622eaffcbb9b30f12ebdf0064a91ff1caff/src/InstagramResponse.php#L79-L86 |
223,486 | haridarshan/instagram-php | src/InstagramResponse.php | InstagramResponse.extractBodyParts | private function extractBodyParts()
{
if (isset($this->body->pagination)) {
$this->isPagination = true;
$this->pagination = $this->body->pagination;
}
if (isset($this->body->meta)) {
$this->isMetaData = true;
$this->metaData = $this->body->met... | php | private function extractBodyParts()
{
if (isset($this->body->pagination)) {
$this->isPagination = true;
$this->pagination = $this->body->pagination;
}
if (isset($this->body->meta)) {
$this->isMetaData = true;
$this->metaData = $this->body->met... | [
"private",
"function",
"extractBodyParts",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"body",
"->",
"pagination",
")",
")",
"{",
"$",
"this",
"->",
"isPagination",
"=",
"true",
";",
"$",
"this",
"->",
"pagination",
"=",
"$",
"this",
"... | Extract Body Parts from the response | [
"Extract",
"Body",
"Parts",
"from",
"the",
"response"
] | 5f21e622eaffcbb9b30f12ebdf0064a91ff1caff | https://github.com/haridarshan/instagram-php/blob/5f21e622eaffcbb9b30f12ebdf0064a91ff1caff/src/InstagramResponse.php#L91-L104 |
223,487 | lexik/LexikWorkflowBundle | DependencyInjection/Configuration.php | Configuration.createClassesNodeDefinition | private function createClassesNodeDefinition()
{
$classesNode = new ArrayNodeDefinition('classes');
$classesNode
->addDefaultsIfNotSet()
->children()
->scalarNode('process_handler')
->defaultValue('Lexik\Bundle\WorkflowBundle\Handler\Proce... | php | private function createClassesNodeDefinition()
{
$classesNode = new ArrayNodeDefinition('classes');
$classesNode
->addDefaultsIfNotSet()
->children()
->scalarNode('process_handler')
->defaultValue('Lexik\Bundle\WorkflowBundle\Handler\Proce... | [
"private",
"function",
"createClassesNodeDefinition",
"(",
")",
"{",
"$",
"classesNode",
"=",
"new",
"ArrayNodeDefinition",
"(",
"'classes'",
")",
";",
"$",
"classesNode",
"->",
"addDefaultsIfNotSet",
"(",
")",
"->",
"children",
"(",
")",
"->",
"scalarNode",
"("... | Create a configuration node to customize classes used by the bundle.
@return ArrayNodeDefinition | [
"Create",
"a",
"configuration",
"node",
"to",
"customize",
"classes",
"used",
"by",
"the",
"bundle",
"."
] | 0caf4609843c8b1929f14d7c717e37626c3f2f71 | https://github.com/lexik/LexikWorkflowBundle/blob/0caf4609843c8b1929f14d7c717e37626c3f2f71/DependencyInjection/Configuration.php#L40-L60 |
223,488 | lexik/LexikWorkflowBundle | DependencyInjection/Configuration.php | Configuration.createProcessesNodeDefinition | private function createProcessesNodeDefinition()
{
$processesNode = new ArrayNodeDefinition('processes');
$processesNode
->useAttributeAsKey('name')
->prototype('array')
->validate()
->ifTrue(function ($value) {
ret... | php | private function createProcessesNodeDefinition()
{
$processesNode = new ArrayNodeDefinition('processes');
$processesNode
->useAttributeAsKey('name')
->prototype('array')
->validate()
->ifTrue(function ($value) {
ret... | [
"private",
"function",
"createProcessesNodeDefinition",
"(",
")",
"{",
"$",
"processesNode",
"=",
"new",
"ArrayNodeDefinition",
"(",
"'processes'",
")",
";",
"$",
"processesNode",
"->",
"useAttributeAsKey",
"(",
"'name'",
")",
"->",
"prototype",
"(",
"'array'",
")... | Create a configuration node to define processes.
@return ArrayNodeDefinition | [
"Create",
"a",
"configuration",
"node",
"to",
"define",
"processes",
"."
] | 0caf4609843c8b1929f14d7c717e37626c3f2f71 | https://github.com/lexik/LexikWorkflowBundle/blob/0caf4609843c8b1929f14d7c717e37626c3f2f71/DependencyInjection/Configuration.php#L67-L99 |
223,489 | lexik/LexikWorkflowBundle | DependencyInjection/Configuration.php | Configuration.createStepsNodeDefinition | private function createStepsNodeDefinition()
{
$stepsNode = new ArrayNodeDefinition('steps');
$stepsNode
->defaultValue(array())
->useAttributeAsKey('name')
->prototype('array')
->addDefaultsIfNotSet()
->children()
... | php | private function createStepsNodeDefinition()
{
$stepsNode = new ArrayNodeDefinition('steps');
$stepsNode
->defaultValue(array())
->useAttributeAsKey('name')
->prototype('array')
->addDefaultsIfNotSet()
->children()
... | [
"private",
"function",
"createStepsNodeDefinition",
"(",
")",
"{",
"$",
"stepsNode",
"=",
"new",
"ArrayNodeDefinition",
"(",
"'steps'",
")",
";",
"$",
"stepsNode",
"->",
"defaultValue",
"(",
"array",
"(",
")",
")",
"->",
"useAttributeAsKey",
"(",
"'name'",
")"... | Create a configuration node to define the steps of a process.
@return ArrayNodeDefinition | [
"Create",
"a",
"configuration",
"node",
"to",
"define",
"the",
"steps",
"of",
"a",
"process",
"."
] | 0caf4609843c8b1929f14d7c717e37626c3f2f71 | https://github.com/lexik/LexikWorkflowBundle/blob/0caf4609843c8b1929f14d7c717e37626c3f2f71/DependencyInjection/Configuration.php#L106-L147 |
223,490 | EtonDigital/EDBlogBundle | Handler/ArticleHandler.php | ArticleHandler.findWritingLockMeta | private function findWritingLockMeta(ArticleInterface $article)
{
$metaLock = null;
//search writing_lock data
foreach($article->getMetaData() as $meta)
{
if($meta->getKey() == 'writing_locked')
{
$metaLock = $meta;
break;
... | php | private function findWritingLockMeta(ArticleInterface $article)
{
$metaLock = null;
//search writing_lock data
foreach($article->getMetaData() as $meta)
{
if($meta->getKey() == 'writing_locked')
{
$metaLock = $meta;
break;
... | [
"private",
"function",
"findWritingLockMeta",
"(",
"ArticleInterface",
"$",
"article",
")",
"{",
"$",
"metaLock",
"=",
"null",
";",
"//search writing_lock data",
"foreach",
"(",
"$",
"article",
"->",
"getMetaData",
"(",
")",
"as",
"$",
"meta",
")",
"{",
"if",
... | Finds last writing lock
@param ArticleInterface $article
@return mixed | [
"Finds",
"last",
"writing",
"lock"
] | bce97b1991b6201733aa7459712c840d92a96ccc | https://github.com/EtonDigital/EDBlogBundle/blob/bce97b1991b6201733aa7459712c840d92a96ccc/Handler/ArticleHandler.php#L90-L106 |
223,491 | EtonDigital/EDBlogBundle | Handler/MediaHandler.php | MediaHandler.addToEditHistory | public function addToEditHistory($media, $providerReference, $width, $height)
{
$key = 'media_edit_history_' . $media->getId();
$history = $this->session->get($key, null);
if(!$history)
{
$history = array();
}
else
{
$history = unseria... | php | public function addToEditHistory($media, $providerReference, $width, $height)
{
$key = 'media_edit_history_' . $media->getId();
$history = $this->session->get($key, null);
if(!$history)
{
$history = array();
}
else
{
$history = unseria... | [
"public",
"function",
"addToEditHistory",
"(",
"$",
"media",
",",
"$",
"providerReference",
",",
"$",
"width",
",",
"$",
"height",
")",
"{",
"$",
"key",
"=",
"'media_edit_history_'",
".",
"$",
"media",
"->",
"getId",
"(",
")",
";",
"$",
"history",
"=",
... | Keep temparary records of file media edit history
@param $media
@param $providerReference
@param $width
@param $height | [
"Keep",
"temparary",
"records",
"of",
"file",
"media",
"edit",
"history"
] | bce97b1991b6201733aa7459712c840d92a96ccc | https://github.com/EtonDigital/EDBlogBundle/blob/bce97b1991b6201733aa7459712c840d92a96ccc/Handler/MediaHandler.php#L66-L87 |
223,492 | silverstripe/silverstripe-ldap | src/Authenticators/LDAPLostPasswordHandler.php | LDAPLostPasswordHandler.lostPasswordForm | public function lostPasswordForm()
{
$loginFieldLabel = (Config::inst()->get(LDAPAuthenticator::class, 'allow_email_login') === 'yes') ?
_t('SilverStripe\\LDAP\\Forms\\LDAPLoginForm.USERNAMEOREMAIL', 'Username or email') :
_t('SilverStripe\\LDAP\\Forms\\LDAPLoginForm.USERNAME', 'User... | php | public function lostPasswordForm()
{
$loginFieldLabel = (Config::inst()->get(LDAPAuthenticator::class, 'allow_email_login') === 'yes') ?
_t('SilverStripe\\LDAP\\Forms\\LDAPLoginForm.USERNAMEOREMAIL', 'Username or email') :
_t('SilverStripe\\LDAP\\Forms\\LDAPLoginForm.USERNAME', 'User... | [
"public",
"function",
"lostPasswordForm",
"(",
")",
"{",
"$",
"loginFieldLabel",
"=",
"(",
"Config",
"::",
"inst",
"(",
")",
"->",
"get",
"(",
"LDAPAuthenticator",
"::",
"class",
",",
"'allow_email_login'",
")",
"===",
"'yes'",
")",
"?",
"_t",
"(",
"'Silve... | Factory method for the lost password form
@return Form Returns the lost password form | [
"Factory",
"method",
"for",
"the",
"lost",
"password",
"form"
] | e8e6de4de9d61ad383086bc2fb2a793809cb755e | https://github.com/silverstripe/silverstripe-ldap/blob/e8e6de4de9d61ad383086bc2fb2a793809cb755e/src/Authenticators/LDAPLostPasswordHandler.php#L147-L166 |
223,493 | ConsoleTVs/Links | src/Models/Link.php | Link.usedBrowsers | public function usedBrowsers()
{
$results = [];
foreach ($this->views as $view) {
array_key_exists($view->browser, $results) ? $results[$view->browser]++ : $results[$view->browser] = 1;
}
return $results;
} | php | public function usedBrowsers()
{
$results = [];
foreach ($this->views as $view) {
array_key_exists($view->browser, $results) ? $results[$view->browser]++ : $results[$view->browser] = 1;
}
return $results;
} | [
"public",
"function",
"usedBrowsers",
"(",
")",
"{",
"$",
"results",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"views",
"as",
"$",
"view",
")",
"{",
"array_key_exists",
"(",
"$",
"view",
"->",
"browser",
",",
"$",
"results",
")",
"?",
... | Returns the link browsers. | [
"Returns",
"the",
"link",
"browsers",
"."
] | f9afe304137f8d7682eac9c46f8aa4c82f5e625c | https://github.com/ConsoleTVs/Links/blob/f9afe304137f8d7682eac9c46f8aa4c82f5e625c/src/Models/Link.php#L64-L73 |
223,494 | ConsoleTVs/Links | src/Models/Link.php | Link.mostUsedBrowser | public function mostUsedBrowser()
{
$max = 0;
$max_browser = null;
foreach ($this->usedBrowsers() as $browser => $count) {
if ($count >= $max) {
$max = $count;
$max_browser = $browser;
}
}
return $max_browser;
} | php | public function mostUsedBrowser()
{
$max = 0;
$max_browser = null;
foreach ($this->usedBrowsers() as $browser => $count) {
if ($count >= $max) {
$max = $count;
$max_browser = $browser;
}
}
return $max_browser;
} | [
"public",
"function",
"mostUsedBrowser",
"(",
")",
"{",
"$",
"max",
"=",
"0",
";",
"$",
"max_browser",
"=",
"null",
";",
"foreach",
"(",
"$",
"this",
"->",
"usedBrowsers",
"(",
")",
"as",
"$",
"browser",
"=>",
"$",
"count",
")",
"{",
"if",
"(",
"$"... | Returns the link most used browser. | [
"Returns",
"the",
"link",
"most",
"used",
"browser",
"."
] | f9afe304137f8d7682eac9c46f8aa4c82f5e625c | https://github.com/ConsoleTVs/Links/blob/f9afe304137f8d7682eac9c46f8aa4c82f5e625c/src/Models/Link.php#L78-L91 |
223,495 | ConsoleTVs/Links | src/Models/Link.php | Link.addView | public function addView()
{
$view = View::create([
'link_id' => $this->id,
'language' => Identify::lang()->getLanguage(),
'browser' => Identify::browser()->getName(),
'browser_version' => Identify::browser()->getVersion(),
... | php | public function addView()
{
$view = View::create([
'link_id' => $this->id,
'language' => Identify::lang()->getLanguage(),
'browser' => Identify::browser()->getName(),
'browser_version' => Identify::browser()->getVersion(),
... | [
"public",
"function",
"addView",
"(",
")",
"{",
"$",
"view",
"=",
"View",
"::",
"create",
"(",
"[",
"'link_id'",
"=>",
"$",
"this",
"->",
"id",
",",
"'language'",
"=>",
"Identify",
"::",
"lang",
"(",
")",
"->",
"getLanguage",
"(",
")",
",",
"'browser... | Adds a new view to the link. | [
"Adds",
"a",
"new",
"view",
"to",
"the",
"link",
"."
] | f9afe304137f8d7682eac9c46f8aa4c82f5e625c | https://github.com/ConsoleTVs/Links/blob/f9afe304137f8d7682eac9c46f8aa4c82f5e625c/src/Models/Link.php#L182-L193 |
223,496 | ConsoleTVs/Links | src/Controllers/LinksController.php | LinksController.login | public function login(Request $request)
{
session(['links.password' => Crypt::encrypt($request->input('password'))]);
if (Crypt::decrypt(session('links.password')) != config('links.password')) {
return redirect()->route('links::login')->with('msg', 'The password is not correct');
... | php | public function login(Request $request)
{
session(['links.password' => Crypt::encrypt($request->input('password'))]);
if (Crypt::decrypt(session('links.password')) != config('links.password')) {
return redirect()->route('links::login')->with('msg', 'The password is not correct');
... | [
"public",
"function",
"login",
"(",
"Request",
"$",
"request",
")",
"{",
"session",
"(",
"[",
"'links.password'",
"=>",
"Crypt",
"::",
"encrypt",
"(",
"$",
"request",
"->",
"input",
"(",
"'password'",
")",
")",
"]",
")",
";",
"if",
"(",
"Crypt",
"::",
... | Login the user. | [
"Login",
"the",
"user",
"."
] | f9afe304137f8d7682eac9c46f8aa4c82f5e625c | https://github.com/ConsoleTVs/Links/blob/f9afe304137f8d7682eac9c46f8aa4c82f5e625c/src/Controllers/LinksController.php#L28-L37 |
223,497 | ConsoleTVs/Links | src/Controllers/LinksController.php | LinksController.redirect | public function redirect($slug)
{
if (! $link = Link::where('slug', $slug)->first()) {
abort(404, 'Unable to find this link');
}
$link->addView();
return redirect($link->url);
} | php | public function redirect($slug)
{
if (! $link = Link::where('slug', $slug)->first()) {
abort(404, 'Unable to find this link');
}
$link->addView();
return redirect($link->url);
} | [
"public",
"function",
"redirect",
"(",
"$",
"slug",
")",
"{",
"if",
"(",
"!",
"$",
"link",
"=",
"Link",
"::",
"where",
"(",
"'slug'",
",",
"$",
"slug",
")",
"->",
"first",
"(",
")",
")",
"{",
"abort",
"(",
"404",
",",
"'Unable to find this link'",
... | Redirects the user to the link.
@param string $slug | [
"Redirects",
"the",
"user",
"to",
"the",
"link",
"."
] | f9afe304137f8d7682eac9c46f8aa4c82f5e625c | https://github.com/ConsoleTVs/Links/blob/f9afe304137f8d7682eac9c46f8aa4c82f5e625c/src/Controllers/LinksController.php#L117-L126 |
223,498 | EtonDigital/EDBlogBundle | Model/Entity/Article.php | Article.getExcerptText | public function getExcerptText()
{
if($this->excerpt)
{
return $this->excerpt;
}
else
{
$rowExcerpt = strip_tags($this->content);
if( strlen($rowExcerpt) > self::EXCERPT_LENGTH)
{
$break = strpos($rowExcerpt, ' ... | php | public function getExcerptText()
{
if($this->excerpt)
{
return $this->excerpt;
}
else
{
$rowExcerpt = strip_tags($this->content);
if( strlen($rowExcerpt) > self::EXCERPT_LENGTH)
{
$break = strpos($rowExcerpt, ' ... | [
"public",
"function",
"getExcerptText",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"excerpt",
")",
"{",
"return",
"$",
"this",
"->",
"excerpt",
";",
"}",
"else",
"{",
"$",
"rowExcerpt",
"=",
"strip_tags",
"(",
"$",
"this",
"->",
"content",
")",
";"... | Use this over getExcept in frontend display
@return mixed | [
"Use",
"this",
"over",
"getExcept",
"in",
"frontend",
"display"
] | bce97b1991b6201733aa7459712c840d92a96ccc | https://github.com/EtonDigital/EDBlogBundle/blob/bce97b1991b6201733aa7459712c840d92a96ccc/Model/Entity/Article.php#L257-L275 |
223,499 | wirecard/checkout-client-library | library/WirecardCEE/Stdlib/Basket/Item.php | WirecardCEE_Stdlib_Basket_Item.getDescription | public function getDescription()
{
if(array_key_exists(self::ITEM_DESCRIPTION, $this->_itemData)) {
return (string) $this->_itemData[self::ITEM_DESCRIPTION];
}
return null;
} | php | public function getDescription()
{
if(array_key_exists(self::ITEM_DESCRIPTION, $this->_itemData)) {
return (string) $this->_itemData[self::ITEM_DESCRIPTION];
}
return null;
} | [
"public",
"function",
"getDescription",
"(",
")",
"{",
"if",
"(",
"array_key_exists",
"(",
"self",
"::",
"ITEM_DESCRIPTION",
",",
"$",
"this",
"->",
"_itemData",
")",
")",
"{",
"return",
"(",
"string",
")",
"$",
"this",
"->",
"_itemData",
"[",
"self",
":... | Returns the item description
@return string | [
"Returns",
"the",
"item",
"description"
] | ad0f8c88dfb3c39091c80b1b58e8dd3604f3e25c | https://github.com/wirecard/checkout-client-library/blob/ad0f8c88dfb3c39091c80b1b58e8dd3604f3e25c/library/WirecardCEE/Stdlib/Basket/Item.php#L208-L214 |
Subsets and Splits
Yii Code Samples
Gathers all records from test, train, and validation sets that contain the word 'yii', providing a basic filtered view of the dataset relevant to Yii-related content.