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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
226,000 | CallFire/CallFire-PHP-SDK | src/CallFire/Api/Rest/AbstractClient.php | AbstractClient.put | public function put($uri, AbstractRequest $request = null)
{
$http = $this->getHttpClone();
$http->setOption(CURLOPT_CUSTOMREQUEST, 'PUT');
$http->setOption(CURLOPT_URL, $uri);
if ($request) {
$http->setOption(CURLOPT_POSTFIELDS, $this->buildPostData($request->getQuery()... | php | public function put($uri, AbstractRequest $request = null)
{
$http = $this->getHttpClone();
$http->setOption(CURLOPT_CUSTOMREQUEST, 'PUT');
$http->setOption(CURLOPT_URL, $uri);
if ($request) {
$http->setOption(CURLOPT_POSTFIELDS, $this->buildPostData($request->getQuery()... | [
"public",
"function",
"put",
"(",
"$",
"uri",
",",
"AbstractRequest",
"$",
"request",
"=",
"null",
")",
"{",
"$",
"http",
"=",
"$",
"this",
"->",
"getHttpClone",
"(",
")",
";",
"$",
"http",
"->",
"setOption",
"(",
"CURLOPT_CUSTOMREQUEST",
",",
"'PUT'",
... | Execute a PUT request against an API endpoint,
optionally with a given Request object as parameters
@param string $uri Endpoint URL
@param AbstractRequest $request = null Request object for parameters
@return string Response data | [
"Execute",
"a",
"PUT",
"request",
"against",
"an",
"API",
"endpoint",
"optionally",
"with",
"a",
"given",
"Request",
"object",
"as",
"parameters"
] | 7d6d3e1c59d4116e4fadaf57851a2fa127a13f65 | https://github.com/CallFire/CallFire-PHP-SDK/blob/7d6d3e1c59d4116e4fadaf57851a2fa127a13f65/src/CallFire/Api/Rest/AbstractClient.php#L118-L129 |
226,001 | CallFire/CallFire-PHP-SDK | src/CallFire/Api/Rest/AbstractClient.php | AbstractClient.updateCredentials | protected function updateCredentials()
{
if ($this->http) {
$this->http->setOption(CURLOPT_USERPWD, implode(":", array(
$this->getUsername(),
$this->getPassword()
)));
}
} | php | protected function updateCredentials()
{
if ($this->http) {
$this->http->setOption(CURLOPT_USERPWD, implode(":", array(
$this->getUsername(),
$this->getPassword()
)));
}
} | [
"protected",
"function",
"updateCredentials",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"http",
")",
"{",
"$",
"this",
"->",
"http",
"->",
"setOption",
"(",
"CURLOPT_USERPWD",
",",
"implode",
"(",
"\":\"",
",",
"array",
"(",
"$",
"this",
"->",
"getU... | Rehashes the HTTP Basic Authentication on the HTTP
client
@return void | [
"Rehashes",
"the",
"HTTP",
"Basic",
"Authentication",
"on",
"the",
"HTTP",
"client"
] | 7d6d3e1c59d4116e4fadaf57851a2fa127a13f65 | https://github.com/CallFire/CallFire-PHP-SDK/blob/7d6d3e1c59d4116e4fadaf57851a2fa127a13f65/src/CallFire/Api/Rest/AbstractClient.php#L267-L275 |
226,002 | infomaniac-amf/php | lib/AMF/Spec.php | Spec.isDenseArray | public static function isDenseArray($array)
{
$arrayLength = count($array);
if(!$arrayLength) {
return true;
}
// generate a dense array with incrementing numeric keys
$keyTest = array_flip(range(0, $arrayLength - 1));
// perform a diff on the two arrays... | php | public static function isDenseArray($array)
{
$arrayLength = count($array);
if(!$arrayLength) {
return true;
}
// generate a dense array with incrementing numeric keys
$keyTest = array_flip(range(0, $arrayLength - 1));
// perform a diff on the two arrays... | [
"public",
"static",
"function",
"isDenseArray",
"(",
"$",
"array",
")",
"{",
"$",
"arrayLength",
"=",
"count",
"(",
"$",
"array",
")",
";",
"if",
"(",
"!",
"$",
"arrayLength",
")",
"{",
"return",
"true",
";",
"}",
"// generate a dense array with incrementing... | Determine if a given array is "dense".
From the AMF spec:
"ordinal indices start at 0 and do not contain gaps between successive
indices (that is, every index is defined from 0 for the length of the array)"
@param $array
@return bool | [
"Determine",
"if",
"a",
"given",
"array",
"is",
"dense",
"."
] | 1b71c125352ec562f473cd51958a03f786aa7ac9 | https://github.com/infomaniac-amf/php/blob/1b71c125352ec562f473cd51958a03f786aa7ac9/lib/AMF/Spec.php#L67-L81 |
226,003 | CallFire/CallFire-PHP-SDK | src/CallFire/Api/Rest/Client/Contact.php | Contact.QueryContacts | public function QueryContacts(Request\QueryContacts $QueryContacts = null)
{
$uri = $this->getUri('/contact', array());
return $this->get($uri, $QueryContacts);
} | php | public function QueryContacts(Request\QueryContacts $QueryContacts = null)
{
$uri = $this->getUri('/contact', array());
return $this->get($uri, $QueryContacts);
} | [
"public",
"function",
"QueryContacts",
"(",
"Request",
"\\",
"QueryContacts",
"$",
"QueryContacts",
"=",
"null",
")",
"{",
"$",
"uri",
"=",
"$",
"this",
"->",
"getUri",
"(",
"'/contact'",
",",
"array",
"(",
")",
")",
";",
"return",
"$",
"this",
"->",
"... | Lists existing contacts
Query for existing contacts using optional filters such as ContactListId, Field,
etc... Returns a list of contacts and all associated info. See GetContact to
return just a single contact by id.
@api
@param Request\QueryContacts $QueryContacts = null | [
"Lists",
"existing",
"contacts"
] | 7d6d3e1c59d4116e4fadaf57851a2fa127a13f65 | https://github.com/CallFire/CallFire-PHP-SDK/blob/7d6d3e1c59d4116e4fadaf57851a2fa127a13f65/src/CallFire/Api/Rest/Client/Contact.php#L24-L29 |
226,004 | CallFire/CallFire-PHP-SDK | src/CallFire/Api/Rest/Client/Contact.php | Contact.UpdateContacts | public function UpdateContacts(Request\UpdateContacts $UpdateContacts = null)
{
$uri = $this->getUri('/contact', array());
return $this->put($uri, $UpdateContacts);
} | php | public function UpdateContacts(Request\UpdateContacts $UpdateContacts = null)
{
$uri = $this->getUri('/contact', array());
return $this->put($uri, $UpdateContacts);
} | [
"public",
"function",
"UpdateContacts",
"(",
"Request",
"\\",
"UpdateContacts",
"$",
"UpdateContacts",
"=",
"null",
")",
"{",
"$",
"uri",
"=",
"$",
"this",
"->",
"getUri",
"(",
"'/contact'",
",",
"array",
"(",
")",
")",
";",
"return",
"$",
"this",
"->",
... | Updates existing contacts
Update existing contacts.
@api
@param Request\UpdateContacts $UpdateContacts = null | [
"Updates",
"existing",
"contacts"
] | 7d6d3e1c59d4116e4fadaf57851a2fa127a13f65 | https://github.com/CallFire/CallFire-PHP-SDK/blob/7d6d3e1c59d4116e4fadaf57851a2fa127a13f65/src/CallFire/Api/Rest/Client/Contact.php#L39-L44 |
226,005 | CallFire/CallFire-PHP-SDK | src/CallFire/Api/Rest/Client/Contact.php | Contact.GetContactHistory | public function GetContactHistory($ContactId, Request\GetContactHistory $GetContactHistory)
{
$uri = $this->getUri('/contact/%s/history', array($ContactId));
return $this->get($uri, $GetContactHistory);
} | php | public function GetContactHistory($ContactId, Request\GetContactHistory $GetContactHistory)
{
$uri = $this->getUri('/contact/%s/history', array($ContactId));
return $this->get($uri, $GetContactHistory);
} | [
"public",
"function",
"GetContactHistory",
"(",
"$",
"ContactId",
",",
"Request",
"\\",
"GetContactHistory",
"$",
"GetContactHistory",
")",
"{",
"$",
"uri",
"=",
"$",
"this",
"->",
"getUri",
"(",
"'/contact/%s/history'",
",",
"array",
"(",
"$",
"ContactId",
")... | Gets a contact's history by contact ID
List all calls and texts associated with a contact.
@api
@param int $ContactId Contact to get history
@param Request\GetContactHistory $GetContactHistory | [
"Gets",
"a",
"contact",
"s",
"history",
"by",
"contact",
"ID"
] | 7d6d3e1c59d4116e4fadaf57851a2fa127a13f65 | https://github.com/CallFire/CallFire-PHP-SDK/blob/7d6d3e1c59d4116e4fadaf57851a2fa127a13f65/src/CallFire/Api/Rest/Client/Contact.php#L91-L96 |
226,006 | CallFire/CallFire-PHP-SDK | src/CallFire/Api/Rest/Client/Contact.php | Contact.CreateContactList | public function CreateContactList(Request\CreateContactList $CreateContactList = null)
{
$uri = $this->getUri('/contact/list', array());
return $this->post($uri, $CreateContactList);
} | php | public function CreateContactList(Request\CreateContactList $CreateContactList = null)
{
$uri = $this->getUri('/contact/list', array());
return $this->post($uri, $CreateContactList);
} | [
"public",
"function",
"CreateContactList",
"(",
"Request",
"\\",
"CreateContactList",
"$",
"CreateContactList",
"=",
"null",
")",
"{",
"$",
"uri",
"=",
"$",
"this",
"->",
"getUri",
"(",
"'/contact/list'",
",",
"array",
"(",
")",
")",
";",
"return",
"$",
"t... | Create new contact list and add to account
Add contact list to account using 1 of 4 inputs: list of contacts, numbers
string, list of contactIds, or csv file containing contacts or numbers. If more
then one ContactSource specified then only load from 1 source with precedence as
listed above. On import contact lists g... | [
"Create",
"new",
"contact",
"list",
"and",
"add",
"to",
"account"
] | 7d6d3e1c59d4116e4fadaf57851a2fa127a13f65 | https://github.com/CallFire/CallFire-PHP-SDK/blob/7d6d3e1c59d4116e4fadaf57851a2fa127a13f65/src/CallFire/Api/Rest/Client/Contact.php#L118-L123 |
226,007 | CallFire/CallFire-PHP-SDK | src/CallFire/Api/Rest/Client/Contact.php | Contact.QueryContactLists | public function QueryContactLists(Request\QueryContactLists $QueryContactLists = null)
{
$uri = $this->getUri('/contact/list', array());
return $this->get($uri, $QueryContactLists);
} | php | public function QueryContactLists(Request\QueryContactLists $QueryContactLists = null)
{
$uri = $this->getUri('/contact/list', array());
return $this->get($uri, $QueryContactLists);
} | [
"public",
"function",
"QueryContactLists",
"(",
"Request",
"\\",
"QueryContactLists",
"$",
"QueryContactLists",
"=",
"null",
")",
"{",
"$",
"uri",
"=",
"$",
"this",
"->",
"getUri",
"(",
"'/contact/list'",
",",
"array",
"(",
")",
")",
";",
"return",
"$",
"t... | Lists existing contact lists
Query for existing contact lists. Currently does no filtering and returns all
contact lists.
@api
@param Request\QueryContactLists $QueryContactLists = null | [
"Lists",
"existing",
"contact",
"lists"
] | 7d6d3e1c59d4116e4fadaf57851a2fa127a13f65 | https://github.com/CallFire/CallFire-PHP-SDK/blob/7d6d3e1c59d4116e4fadaf57851a2fa127a13f65/src/CallFire/Api/Rest/Client/Contact.php#L134-L139 |
226,008 | CallFire/CallFire-PHP-SDK | src/CallFire/Api/Rest/Client/Contact.php | Contact.AddContactsToList | public function AddContactsToList($ContactListId, Request\AddContactsToList $AddContactsToList)
{
$uri = $this->getUri('/contact/list/%s/add', array($ContactListId));
return $this->post($uri, $AddContactsToList);
} | php | public function AddContactsToList($ContactListId, Request\AddContactsToList $AddContactsToList)
{
$uri = $this->getUri('/contact/list/%s/add', array($ContactListId));
return $this->post($uri, $AddContactsToList);
} | [
"public",
"function",
"AddContactsToList",
"(",
"$",
"ContactListId",
",",
"Request",
"\\",
"AddContactsToList",
"$",
"AddContactsToList",
")",
"{",
"$",
"uri",
"=",
"$",
"this",
"->",
"getUri",
"(",
"'/contact/list/%s/add'",
",",
"array",
"(",
"$",
"ContactList... | Adds contacts to an existing list
See CreateContactList.
@api
@param int $ContactListId Unique ID of ContactList
@param Request\AddContactsToList $AddContactsToList | [
"Adds",
"contacts",
"to",
"an",
"existing",
"list"
] | 7d6d3e1c59d4116e4fadaf57851a2fa127a13f65 | https://github.com/CallFire/CallFire-PHP-SDK/blob/7d6d3e1c59d4116e4fadaf57851a2fa127a13f65/src/CallFire/Api/Rest/Client/Contact.php#L165-L170 |
226,009 | CallFire/CallFire-PHP-SDK | src/CallFire/Api/Rest/Client/Contact.php | Contact.RemoveContactsFromList | public function RemoveContactsFromList($ContactListId, Request\RemoveContactsFromList $RemoveContactsFromList)
{
$uri = $this->getUri('/contact/list/%s/remove', array($ContactListId));
return $this->post($uri, $RemoveContactsFromList);
} | php | public function RemoveContactsFromList($ContactListId, Request\RemoveContactsFromList $RemoveContactsFromList)
{
$uri = $this->getUri('/contact/list/%s/remove', array($ContactListId));
return $this->post($uri, $RemoveContactsFromList);
} | [
"public",
"function",
"RemoveContactsFromList",
"(",
"$",
"ContactListId",
",",
"Request",
"\\",
"RemoveContactsFromList",
"$",
"RemoveContactsFromList",
")",
"{",
"$",
"uri",
"=",
"$",
"this",
"->",
"getUri",
"(",
"'/contact/list/%s/remove'",
",",
"array",
"(",
"... | Removes contacts from a list without deleting the contacts
Removes contacts from a list without deleting the contacts.
@api
@param int $ContactListId Unique ID of ContactList
@param Request\RemoveContactsFromList $RemoveContactsFromList | [
"Removes",
"contacts",
"from",
"a",
"list",
"without",
"deleting",
"the",
"contacts"
] | 7d6d3e1c59d4116e4fadaf57851a2fa127a13f65 | https://github.com/CallFire/CallFire-PHP-SDK/blob/7d6d3e1c59d4116e4fadaf57851a2fa127a13f65/src/CallFire/Api/Rest/Client/Contact.php#L197-L202 |
226,010 | gjerokrsteski/pimf-framework | core/Pimf/Model/AsArray.php | AsArray.map | protected function map(array $properties)
{
$map = array();
foreach ($properties as $name => $default) {
$map[$name] = (true === empty($this->$name)) ? $default : $this->$name;
}
return $map;
} | php | protected function map(array $properties)
{
$map = array();
foreach ($properties as $name => $default) {
$map[$name] = (true === empty($this->$name)) ? $default : $this->$name;
}
return $map;
} | [
"protected",
"function",
"map",
"(",
"array",
"$",
"properties",
")",
"{",
"$",
"map",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"properties",
"as",
"$",
"name",
"=>",
"$",
"default",
")",
"{",
"$",
"map",
"[",
"$",
"name",
"]",
"=",
"(",... | Maps the properties to array with actual values.
For another properties-mapping, please override this method.
@param array $properties
@return array | [
"Maps",
"the",
"properties",
"to",
"array",
"with",
"actual",
"values",
".",
"For",
"another",
"properties",
"-",
"mapping",
"please",
"override",
"this",
"method",
"."
] | 859aa7c8bb727b556c5e32224842af3cff33f18b | https://github.com/gjerokrsteski/pimf-framework/blob/859aa7c8bb727b556c5e32224842af3cff33f18b/core/Pimf/Model/AsArray.php#L45-L54 |
226,011 | infomaniac-amf/php | lib/AMF/Base.php | Base.getDataType | protected function getDataType($data)
{
switch (true) {
case $data instanceof Undefined:
return Spec::AMF3_UNDEFINED;
break;
case $data === null:
return Spec::AMF3_NULL;
break;
case $data === true || $data ... | php | protected function getDataType($data)
{
switch (true) {
case $data instanceof Undefined:
return Spec::AMF3_UNDEFINED;
break;
case $data === null:
return Spec::AMF3_NULL;
break;
case $data === true || $data ... | [
"protected",
"function",
"getDataType",
"(",
"$",
"data",
")",
"{",
"switch",
"(",
"true",
")",
"{",
"case",
"$",
"data",
"instanceof",
"Undefined",
":",
"return",
"Spec",
"::",
"AMF3_UNDEFINED",
";",
"break",
";",
"case",
"$",
"data",
"===",
"null",
":"... | Return the AMF3 data type for given data
@param $data
@return int|null | [
"Return",
"the",
"AMF3",
"data",
"type",
"for",
"given",
"data"
] | 1b71c125352ec562f473cd51958a03f786aa7ac9 | https://github.com/infomaniac-amf/php/blob/1b71c125352ec562f473cd51958a03f786aa7ac9/lib/AMF/Base.php#L61-L115 |
226,012 | gamegos/php-code-sniffer | src/Gamegos/Sniffs/Strings/ConcatenationSpacingSniff.php | ConcatenationSpacingSniff.findExpected | protected function findExpected(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
{
$tokens = $phpcsFile->getTokens();
// Find the last operator in the previous line.
$prevLineOp = $phpcsFile->findPrevious(
array(
T_WHITESPACE, T_CONSTANT_ENCAPSED_STRING
),
... | php | protected function findExpected(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
{
$tokens = $phpcsFile->getTokens();
// Find the last operator in the previous line.
$prevLineOp = $phpcsFile->findPrevious(
array(
T_WHITESPACE, T_CONSTANT_ENCAPSED_STRING
),
... | [
"protected",
"function",
"findExpected",
"(",
"PHP_CodeSniffer_File",
"$",
"phpcsFile",
",",
"$",
"stackPtr",
")",
"{",
"$",
"tokens",
"=",
"$",
"phpcsFile",
"->",
"getTokens",
"(",
")",
";",
"// Find the last operator in the previous line.",
"$",
"prevLineOp",
"=",... | Find expected number of spaces to align operators.
@param \PHP_CodeSniffer_File $phpcsFile
@param int $stackPtr
@return int | [
"Find",
"expected",
"number",
"of",
"spaces",
"to",
"align",
"operators",
"."
] | 7e5939b66a55bb70eb66830b596b28e6bf3d1368 | https://github.com/gamegos/php-code-sniffer/blob/7e5939b66a55bb70eb66830b596b28e6bf3d1368/src/Gamegos/Sniffs/Strings/ConcatenationSpacingSniff.php#L111-L143 |
226,013 | infomaniac-amf/php | lib/AMF/Deserializer.php | Deserializer.createClassInstance | private function createClassInstance($className)
{
if (empty($className)) {
return new stdClass();
}
try {
$refClass = new ReflectionClass($className);
return $refClass->newInstance();
} catch (Exception $e) {
throw new Deserialization... | php | private function createClassInstance($className)
{
if (empty($className)) {
return new stdClass();
}
try {
$refClass = new ReflectionClass($className);
return $refClass->newInstance();
} catch (Exception $e) {
throw new Deserialization... | [
"private",
"function",
"createClassInstance",
"(",
"$",
"className",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"className",
")",
")",
"{",
"return",
"new",
"stdClass",
"(",
")",
";",
"}",
"try",
"{",
"$",
"refClass",
"=",
"new",
"ReflectionClass",
"(",
"... | Create an instance of a given class
Use stdClass if no class name is provided
@param $className
@throws \Infomaniac\Exception\DeserializationException
@return object|stdClass | [
"Create",
"an",
"instance",
"of",
"a",
"given",
"class",
"Use",
"stdClass",
"if",
"no",
"class",
"name",
"is",
"provided"
] | 1b71c125352ec562f473cd51958a03f786aa7ac9 | https://github.com/infomaniac-amf/php/blob/1b71c125352ec562f473cd51958a03f786aa7ac9/lib/AMF/Deserializer.php#L239-L251 |
226,014 | gjerokrsteski/pimf-framework | core/Pimf/Session/Payload.php | Payload.load | public function load($key)
{
if ($key !== null) {
$this->session = $this->storage->load($key);
}
// If the session doesn't exist or is invalid.
if (is_null($this->session) || static::expired($this->session)) {
$this->exists = false;
$this->session... | php | public function load($key)
{
if ($key !== null) {
$this->session = $this->storage->load($key);
}
// If the session doesn't exist or is invalid.
if (is_null($this->session) || static::expired($this->session)) {
$this->exists = false;
$this->session... | [
"public",
"function",
"load",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"$",
"key",
"!==",
"null",
")",
"{",
"$",
"this",
"->",
"session",
"=",
"$",
"this",
"->",
"storage",
"->",
"load",
"(",
"$",
"key",
")",
";",
"}",
"// If the session doesn't exist o... | Load the session for the current request.
@param null|string $key | [
"Load",
"the",
"session",
"for",
"the",
"current",
"request",
"."
] | 859aa7c8bb727b556c5e32224842af3cff33f18b | https://github.com/gjerokrsteski/pimf-framework/blob/859aa7c8bb727b556c5e32224842af3cff33f18b/core/Pimf/Session/Payload.php#L80-L97 |
226,015 | gjerokrsteski/pimf-framework | core/Pimf/Session/Payload.php | Payload.isIn | protected function isIn($key, array $session)
{
if (array_key_exists($key, $session) && $session[$key] !== null) {
return $session[$key];
}
return null;
} | php | protected function isIn($key, array $session)
{
if (array_key_exists($key, $session) && $session[$key] !== null) {
return $session[$key];
}
return null;
} | [
"protected",
"function",
"isIn",
"(",
"$",
"key",
",",
"array",
"$",
"session",
")",
"{",
"if",
"(",
"array_key_exists",
"(",
"$",
"key",
",",
"$",
"session",
")",
"&&",
"$",
"session",
"[",
"$",
"key",
"]",
"!==",
"null",
")",
"{",
"return",
"$",
... | Checks if key is in session.
@param string $key
@param array $session
@return mixed|null | [
"Checks",
"if",
"key",
"is",
"in",
"session",
"."
] | 859aa7c8bb727b556c5e32224842af3cff33f18b | https://github.com/gjerokrsteski/pimf-framework/blob/859aa7c8bb727b556c5e32224842af3cff33f18b/core/Pimf/Session/Payload.php#L165-L172 |
226,016 | gjerokrsteski/pimf-framework | core/Pimf/Session/Payload.php | Payload.keep | public function keep($keys)
{
foreach ((array)$keys as $key) {
$this->flash($key, $this->get($key));
}
} | php | public function keep($keys)
{
foreach ((array)$keys as $key) {
$this->flash($key, $this->get($key));
}
} | [
"public",
"function",
"keep",
"(",
"$",
"keys",
")",
"{",
"foreach",
"(",
"(",
"array",
")",
"$",
"keys",
"as",
"$",
"key",
")",
"{",
"$",
"this",
"->",
"flash",
"(",
"$",
"key",
",",
"$",
"this",
"->",
"get",
"(",
"$",
"key",
")",
")",
";",
... | Keep a session flash item from expiring at the end of the request.
@param $keys | [
"Keep",
"a",
"session",
"flash",
"item",
"from",
"expiring",
"at",
"the",
"end",
"of",
"the",
"request",
"."
] | 859aa7c8bb727b556c5e32224842af3cff33f18b | https://github.com/gjerokrsteski/pimf-framework/blob/859aa7c8bb727b556c5e32224842af3cff33f18b/core/Pimf/Session/Payload.php#L213-L218 |
226,017 | gjerokrsteski/pimf-framework | core/Pimf/Session/Payload.php | Payload.save | public function save()
{
$this->session['last_activity'] = time();
// age it that should expire at the end of the user's next request.
$this->age();
$sessionConf = Config::get('session');
// save data into the specialized storage.
$this->storage->save($this->sessio... | php | public function save()
{
$this->session['last_activity'] = time();
// age it that should expire at the end of the user's next request.
$this->age();
$sessionConf = Config::get('session');
// save data into the specialized storage.
$this->storage->save($this->sessio... | [
"public",
"function",
"save",
"(",
")",
"{",
"$",
"this",
"->",
"session",
"[",
"'last_activity'",
"]",
"=",
"time",
"(",
")",
";",
"// age it that should expire at the end of the user's next request.",
"$",
"this",
"->",
"age",
"(",
")",
";",
"$",
"sessionConf"... | Store the session payload in storage.
This method will be called automatically at the end of the request.
@return void | [
"Store",
"the",
"session",
"payload",
"in",
"storage",
".",
"This",
"method",
"will",
"be",
"called",
"automatically",
"at",
"the",
"end",
"of",
"the",
"request",
"."
] | 859aa7c8bb727b556c5e32224842af3cff33f18b | https://github.com/gjerokrsteski/pimf-framework/blob/859aa7c8bb727b556c5e32224842af3cff33f18b/core/Pimf/Session/Payload.php#L273-L295 |
226,018 | gjerokrsteski/pimf-framework | core/Pimf/Session/Payload.php | Payload.clean | public function clean()
{
if ($this->storage instanceof \Pimf\Contracts\Cleanable) {
$this->storage->clean(time() - (Config::get('session.lifetime') * 60));
}
} | php | public function clean()
{
if ($this->storage instanceof \Pimf\Contracts\Cleanable) {
$this->storage->clean(time() - (Config::get('session.lifetime') * 60));
}
} | [
"public",
"function",
"clean",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"storage",
"instanceof",
"\\",
"Pimf",
"\\",
"Contracts",
"\\",
"Cleanable",
")",
"{",
"$",
"this",
"->",
"storage",
"->",
"clean",
"(",
"time",
"(",
")",
"-",
"(",
"Config",... | Clean up expired sessions.
@return void | [
"Clean",
"up",
"expired",
"sessions",
"."
] | 859aa7c8bb727b556c5e32224842af3cff33f18b | https://github.com/gjerokrsteski/pimf-framework/blob/859aa7c8bb727b556c5e32224842af3cff33f18b/core/Pimf/Session/Payload.php#L302-L307 |
226,019 | gjerokrsteski/pimf-framework | core/Pimf/Session/Payload.php | Payload.cookie | protected function cookie($config)
{
$minutes = (!$config['expire_on_close']) ? $config['lifetime'] : 0;
Cookie::put($config['cookie'], $this->session['id'], $minutes, $config['path'], $config['domain'],
$config['secure']);
} | php | protected function cookie($config)
{
$minutes = (!$config['expire_on_close']) ? $config['lifetime'] : 0;
Cookie::put($config['cookie'], $this->session['id'], $minutes, $config['path'], $config['domain'],
$config['secure']);
} | [
"protected",
"function",
"cookie",
"(",
"$",
"config",
")",
"{",
"$",
"minutes",
"=",
"(",
"!",
"$",
"config",
"[",
"'expire_on_close'",
"]",
")",
"?",
"$",
"config",
"[",
"'lifetime'",
"]",
":",
"0",
";",
"Cookie",
"::",
"put",
"(",
"$",
"config",
... | Send the session ID cookie to the browser.
@param array $config
@return void | [
"Send",
"the",
"session",
"ID",
"cookie",
"to",
"the",
"browser",
"."
] | 859aa7c8bb727b556c5e32224842af3cff33f18b | https://github.com/gjerokrsteski/pimf-framework/blob/859aa7c8bb727b556c5e32224842af3cff33f18b/core/Pimf/Session/Payload.php#L327-L333 |
226,020 | Techworker/ssml | src/ContainerElement.php | ContainerElement.addElement | public function addElement(BaseElement $element): ContainerElement
{
$element->parent = $this;
$this->children[] = $element;
if ($element instanceof ContainerElement) {
return $element;
}
return $this;
} | php | public function addElement(BaseElement $element): ContainerElement
{
$element->parent = $this;
$this->children[] = $element;
if ($element instanceof ContainerElement) {
return $element;
}
return $this;
} | [
"public",
"function",
"addElement",
"(",
"BaseElement",
"$",
"element",
")",
":",
"ContainerElement",
"{",
"$",
"element",
"->",
"parent",
"=",
"$",
"this",
";",
"$",
"this",
"->",
"children",
"[",
"]",
"=",
"$",
"element",
";",
"if",
"(",
"$",
"elemen... | Adds an element instance as a child and returns either itself or the new element if its a
container element.
@param BaseElement $element
@return ContainerElement | [
"Adds",
"an",
"element",
"instance",
"as",
"a",
"child",
"and",
"returns",
"either",
"itself",
"or",
"the",
"new",
"element",
"if",
"its",
"a",
"container",
"element",
"."
] | cafb979b777480baf7a01b5db2bf7c2cff837805 | https://github.com/Techworker/ssml/blob/cafb979b777480baf7a01b5db2bf7c2cff837805/src/ContainerElement.php#L54-L63 |
226,021 | Techworker/ssml | src/ContainerElement.php | ContainerElement.containerToDOM | protected function containerToDOM(\DomDocument $doc, \DomNode $node) : void
{
foreach ($this->children as $child) {
$node->appendChild($child->toDOM($doc));
}
} | php | protected function containerToDOM(\DomDocument $doc, \DomNode $node) : void
{
foreach ($this->children as $child) {
$node->appendChild($child->toDOM($doc));
}
} | [
"protected",
"function",
"containerToDOM",
"(",
"\\",
"DomDocument",
"$",
"doc",
",",
"\\",
"DomNode",
"$",
"node",
")",
":",
"void",
"{",
"foreach",
"(",
"$",
"this",
"->",
"children",
"as",
"$",
"child",
")",
"{",
"$",
"node",
"->",
"appendChild",
"(... | Helper function that loops all children and appends them to the given \DomNode.
@param \DomDocument $doc
@param \DomNode $node | [
"Helper",
"function",
"that",
"loops",
"all",
"children",
"and",
"appends",
"them",
"to",
"the",
"given",
"\\",
"DomNode",
"."
] | cafb979b777480baf7a01b5db2bf7c2cff837805 | https://github.com/Techworker/ssml/blob/cafb979b777480baf7a01b5db2bf7c2cff837805/src/ContainerElement.php#L91-L96 |
226,022 | Techworker/ssml | src/Traits/CustomTrait.php | CustomTrait.custom | public function custom(string $name, array $attributes): Custom
{
/** @var ContainerElement $this */
return $this->addElement(Custom::factory($name, $attributes));
} | php | public function custom(string $name, array $attributes): Custom
{
/** @var ContainerElement $this */
return $this->addElement(Custom::factory($name, $attributes));
} | [
"public",
"function",
"custom",
"(",
"string",
"$",
"name",
",",
"array",
"$",
"attributes",
")",
":",
"Custom",
"{",
"/** @var ContainerElement $this */",
"return",
"$",
"this",
"->",
"addElement",
"(",
"Custom",
"::",
"factory",
"(",
"$",
"name",
",",
"$",... | Adds a new custom element.
@param string $name
@param array $attributes
@return Custom | [
"Adds",
"a",
"new",
"custom",
"element",
"."
] | cafb979b777480baf7a01b5db2bf7c2cff837805 | https://github.com/Techworker/ssml/blob/cafb979b777480baf7a01b5db2bf7c2cff837805/src/Traits/CustomTrait.php#L30-L34 |
226,023 | mlanin/laravel-setup-wizard | src/Commands/Setup.php | Setup.runSteps | protected function runSteps($steps = [], $pretend = false)
{
$return = true;
$steps = empty($steps) ? array_keys($this->steps) : $steps;
foreach ($steps as $step)
{
if ($this->runStep($step, $pretend) === false)
{
$return = false;
... | php | protected function runSteps($steps = [], $pretend = false)
{
$return = true;
$steps = empty($steps) ? array_keys($this->steps) : $steps;
foreach ($steps as $step)
{
if ($this->runStep($step, $pretend) === false)
{
$return = false;
... | [
"protected",
"function",
"runSteps",
"(",
"$",
"steps",
"=",
"[",
"]",
",",
"$",
"pretend",
"=",
"false",
")",
"{",
"$",
"return",
"=",
"true",
";",
"$",
"steps",
"=",
"empty",
"(",
"$",
"steps",
")",
"?",
"array_keys",
"(",
"$",
"this",
"->",
"s... | Run all steps one by one.
@param array $steps
@param bool $pretend
@return bool | [
"Run",
"all",
"steps",
"one",
"by",
"one",
"."
] | b2614612f92861af434e70b0fe070f6167a71e33 | https://github.com/mlanin/laravel-setup-wizard/blob/b2614612f92861af434e70b0fe070f6167a71e33/src/Commands/Setup.php#L83-L97 |
226,024 | mlanin/laravel-setup-wizard | src/Commands/Setup.php | Setup.runStep | protected function runStep($step, $pretend = false)
{
try
{
$step = $this->createStep($step);
if ($this->confirm($step->prompt(), true))
{
return $step->run($pretend);
}
}
catch (\Exception $e)
{
$th... | php | protected function runStep($step, $pretend = false)
{
try
{
$step = $this->createStep($step);
if ($this->confirm($step->prompt(), true))
{
return $step->run($pretend);
}
}
catch (\Exception $e)
{
$th... | [
"protected",
"function",
"runStep",
"(",
"$",
"step",
",",
"$",
"pretend",
"=",
"false",
")",
"{",
"try",
"{",
"$",
"step",
"=",
"$",
"this",
"->",
"createStep",
"(",
"$",
"step",
")",
";",
"if",
"(",
"$",
"this",
"->",
"confirm",
"(",
"$",
"step... | Run installation step
@param string $step
@param bool $pretend
@return bool | [
"Run",
"installation",
"step"
] | b2614612f92861af434e70b0fe070f6167a71e33 | https://github.com/mlanin/laravel-setup-wizard/blob/b2614612f92861af434e70b0fe070f6167a71e33/src/Commands/Setup.php#L106-L123 |
226,025 | mlanin/laravel-setup-wizard | src/Commands/Setup.php | Setup.createStep | protected function createStep($step)
{
if ( ! $this->stepExist($step))
{
throw new \Exception("Step <comment>{$step}</comment> doesn't exist.");
}
$class = $this->steps[$step];
$step = new $class($this);
if ( ! ($step instanceof AbstractStep))
{... | php | protected function createStep($step)
{
if ( ! $this->stepExist($step))
{
throw new \Exception("Step <comment>{$step}</comment> doesn't exist.");
}
$class = $this->steps[$step];
$step = new $class($this);
if ( ! ($step instanceof AbstractStep))
{... | [
"protected",
"function",
"createStep",
"(",
"$",
"step",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"stepExist",
"(",
"$",
"step",
")",
")",
"{",
"throw",
"new",
"\\",
"Exception",
"(",
"\"Step <comment>{$step}</comment> doesn't exist.\"",
")",
";",
"}",
... | Instantiate step class.
@param string $step
@return AbstractStep
@throws \Exception | [
"Instantiate",
"step",
"class",
"."
] | b2614612f92861af434e70b0fe070f6167a71e33 | https://github.com/mlanin/laravel-setup-wizard/blob/b2614612f92861af434e70b0fe070f6167a71e33/src/Commands/Setup.php#L132-L148 |
226,026 | mlanin/laravel-setup-wizard | src/Commands/Setup.php | Setup.stepExist | protected function stepExist($step)
{
return isset($this->steps[$step]) && class_exists($this->steps[$step]);
} | php | protected function stepExist($step)
{
return isset($this->steps[$step]) && class_exists($this->steps[$step]);
} | [
"protected",
"function",
"stepExist",
"(",
"$",
"step",
")",
"{",
"return",
"isset",
"(",
"$",
"this",
"->",
"steps",
"[",
"$",
"step",
"]",
")",
"&&",
"class_exists",
"(",
"$",
"this",
"->",
"steps",
"[",
"$",
"step",
"]",
")",
";",
"}"
] | Check if step exists.
@param string $step
@return bool | [
"Check",
"if",
"step",
"exists",
"."
] | b2614612f92861af434e70b0fe070f6167a71e33 | https://github.com/mlanin/laravel-setup-wizard/blob/b2614612f92861af434e70b0fe070f6167a71e33/src/Commands/Setup.php#L156-L159 |
226,027 | Daursu/postcode-lookup | src/Postcode.php | Postcode.lookup | public function lookup($postcode)
{
// Mutate the postcode
$postcode = $this->mutatePostcode($postcode);
// Sanitize the postcode:
$coords = $this->getCoordinates($postcode);
// If empty, we must have no results
if (empty($coords)) {
return [];
}... | php | public function lookup($postcode)
{
// Mutate the postcode
$postcode = $this->mutatePostcode($postcode);
// Sanitize the postcode:
$coords = $this->getCoordinates($postcode);
// If empty, we must have no results
if (empty($coords)) {
return [];
}... | [
"public",
"function",
"lookup",
"(",
"$",
"postcode",
")",
"{",
"// Mutate the postcode",
"$",
"postcode",
"=",
"$",
"this",
"->",
"mutatePostcode",
"(",
"$",
"postcode",
")",
";",
"// Sanitize the postcode:",
"$",
"coords",
"=",
"$",
"this",
"->",
"getCoordin... | Retrieves the full address for a given postcode.
@param $postcode
@return array | [
"Retrieves",
"the",
"full",
"address",
"for",
"a",
"given",
"postcode",
"."
] | 5afb74a3e297d06bfd3ea7681c0005a4c4088f92 | https://github.com/Daursu/postcode-lookup/blob/5afb74a3e297d06bfd3ea7681c0005a4c4088f92/src/Postcode.php#L36-L115 |
226,028 | Techworker/ssml | src/Element/SayAs.php | SayAs.factory | public static function factory(string $interpretAs, string $content, string $format = null)
{
$instance = new static();
$instance->interpretAs = $interpretAs;
$instance->content = $content;
$instance->format = $format;
return $instance;
} | php | public static function factory(string $interpretAs, string $content, string $format = null)
{
$instance = new static();
$instance->interpretAs = $interpretAs;
$instance->content = $content;
$instance->format = $format;
return $instance;
} | [
"public",
"static",
"function",
"factory",
"(",
"string",
"$",
"interpretAs",
",",
"string",
"$",
"content",
",",
"string",
"$",
"format",
"=",
"null",
")",
"{",
"$",
"instance",
"=",
"new",
"static",
"(",
")",
";",
"$",
"instance",
"->",
"interpretAs",
... | Creates a say-as element with the given values as attributes.
@param string $interpretAs
@param string $content
@param string|null $format
@return static | [
"Creates",
"a",
"say",
"-",
"as",
"element",
"with",
"the",
"given",
"values",
"as",
"attributes",
"."
] | cafb979b777480baf7a01b5db2bf7c2cff837805 | https://github.com/Techworker/ssml/blob/cafb979b777480baf7a01b5db2bf7c2cff837805/src/Element/SayAs.php#L53-L61 |
226,029 | Daursu/postcode-lookup | src/GoogleApi.php | GoogleApi.fetch | public function fetch($url)
{
if ($this->apiKey) {
$url .= '&key='.$this->apiKey;
}
try {
$json = json_decode(file_get_contents($url));
} catch(\Exception $e) {
throw new ServiceUnavailableException;
}
$this->checkApiError($json);... | php | public function fetch($url)
{
if ($this->apiKey) {
$url .= '&key='.$this->apiKey;
}
try {
$json = json_decode(file_get_contents($url));
} catch(\Exception $e) {
throw new ServiceUnavailableException;
}
$this->checkApiError($json);... | [
"public",
"function",
"fetch",
"(",
"$",
"url",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"apiKey",
")",
"{",
"$",
"url",
".=",
"'&key='",
".",
"$",
"this",
"->",
"apiKey",
";",
"}",
"try",
"{",
"$",
"json",
"=",
"json_decode",
"(",
"file_get_content... | Calls the Google API.
@param string $url
@return \stdClass
@throws ServiceUnavailableException | [
"Calls",
"the",
"Google",
"API",
"."
] | 5afb74a3e297d06bfd3ea7681c0005a4c4088f92 | https://github.com/Daursu/postcode-lookup/blob/5afb74a3e297d06bfd3ea7681c0005a4c4088f92/src/GoogleApi.php#L43-L58 |
226,030 | eosnewmedia/JSON-API-Common | src/Model/Resource/Extension/RelatedMetaInformationTrait.php | RelatedMetaInformationTrait.relatedMetaInformation | public function relatedMetaInformation(): KeyValueCollectionInterface
{
if (!$this->relatedMetaInformation instanceof KeyValueCollectionInterface) {
$this->relatedMetaInformation = new KeyValueCollection();
}
return $this->relatedMetaInformation;
} | php | public function relatedMetaInformation(): KeyValueCollectionInterface
{
if (!$this->relatedMetaInformation instanceof KeyValueCollectionInterface) {
$this->relatedMetaInformation = new KeyValueCollection();
}
return $this->relatedMetaInformation;
} | [
"public",
"function",
"relatedMetaInformation",
"(",
")",
":",
"KeyValueCollectionInterface",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"relatedMetaInformation",
"instanceof",
"KeyValueCollectionInterface",
")",
"{",
"$",
"this",
"->",
"relatedMetaInformation",
"=",
"ne... | This method provides additional meta information for a resource identifier object in the context of relationship data
@return KeyValueCollectionInterface | [
"This",
"method",
"provides",
"additional",
"meta",
"information",
"for",
"a",
"resource",
"identifier",
"object",
"in",
"the",
"context",
"of",
"relationship",
"data"
] | d868eb4d76bf75518f1bb72a70e5abf78fcae476 | https://github.com/eosnewmedia/JSON-API-Common/blob/d868eb4d76bf75518f1bb72a70e5abf78fcae476/src/Model/Resource/Extension/RelatedMetaInformationTrait.php#L24-L31 |
226,031 | gjerokrsteski/pimf-framework | core/Pimf/Util/Xml.php | Xml.toDOMDocument | public static function toDOMDocument($xml)
{
if ($xml instanceof \DOMDocument) {
return $xml;
}
if ($xml instanceof \SimpleXMLElement) {
$doc = new \DOMDocument();
$doc->loadXML('' . $xml->asXML());
return $doc;
}
if (is_stri... | php | public static function toDOMDocument($xml)
{
if ($xml instanceof \DOMDocument) {
return $xml;
}
if ($xml instanceof \SimpleXMLElement) {
$doc = new \DOMDocument();
$doc->loadXML('' . $xml->asXML());
return $doc;
}
if (is_stri... | [
"public",
"static",
"function",
"toDOMDocument",
"(",
"$",
"xml",
")",
"{",
"if",
"(",
"$",
"xml",
"instanceof",
"\\",
"DOMDocument",
")",
"{",
"return",
"$",
"xml",
";",
"}",
"if",
"(",
"$",
"xml",
"instanceof",
"\\",
"SimpleXMLElement",
")",
"{",
"$"... | Convert anything DOMDocument|SimpleXMLElement|string to DOMDocument.
@param \DOMDocument|\SimpleXMLElement|string $xml String may be filename or xml string
@throws \InvalidArgumentException
@return \DOMDocument | [
"Convert",
"anything",
"DOMDocument|SimpleXMLElement|string",
"to",
"DOMDocument",
"."
] | 859aa7c8bb727b556c5e32224842af3cff33f18b | https://github.com/gjerokrsteski/pimf-framework/blob/859aa7c8bb727b556c5e32224842af3cff33f18b/core/Pimf/Util/Xml.php#L27-L57 |
226,032 | gjerokrsteski/pimf-framework | core/Pimf/Util/Xml.php | Xml.toSimpleXMLElement | public static function toSimpleXMLElement($xml)
{
if ($xml instanceof \SimpleXMLElement) {
return $xml;
}
if ($xml instanceof \DOMDocument) {
return simplexml_import_dom($xml);
}
if (is_string($xml)) {
if (is_file($xml)) {
... | php | public static function toSimpleXMLElement($xml)
{
if ($xml instanceof \SimpleXMLElement) {
return $xml;
}
if ($xml instanceof \DOMDocument) {
return simplexml_import_dom($xml);
}
if (is_string($xml)) {
if (is_file($xml)) {
... | [
"public",
"static",
"function",
"toSimpleXMLElement",
"(",
"$",
"xml",
")",
"{",
"if",
"(",
"$",
"xml",
"instanceof",
"\\",
"SimpleXMLElement",
")",
"{",
"return",
"$",
"xml",
";",
"}",
"if",
"(",
"$",
"xml",
"instanceof",
"\\",
"DOMDocument",
")",
"{",
... | Convert anything DOMDocument|SimpleXMLElement|string to SimpleXMLElement.
@param \DOMDocument|\SimpleXMLElement|string $xml String may be filename or xml string
@throws \InvalidArgumentException
@return \SimpleXMLElement | [
"Convert",
"anything",
"DOMDocument|SimpleXMLElement|string",
"to",
"SimpleXMLElement",
"."
] | 859aa7c8bb727b556c5e32224842af3cff33f18b | https://github.com/gjerokrsteski/pimf-framework/blob/859aa7c8bb727b556c5e32224842af3cff33f18b/core/Pimf/Util/Xml.php#L67-L89 |
226,033 | gjerokrsteski/pimf-framework | core/Pimf/Util/Xml.php | Xml.toArray | public static function toArray(\SimpleXMLElement $xml, $namespace = null)
{
if ($namespace !== null) {
$namespaces = $xml->getNamespaces();
if (false === isset($namespaces[$namespace])) {
throw new \OutOfBoundsException('namespace [' . $namespace . '] not found');
... | php | public static function toArray(\SimpleXMLElement $xml, $namespace = null)
{
if ($namespace !== null) {
$namespaces = $xml->getNamespaces();
if (false === isset($namespaces[$namespace])) {
throw new \OutOfBoundsException('namespace [' . $namespace . '] not found');
... | [
"public",
"static",
"function",
"toArray",
"(",
"\\",
"SimpleXMLElement",
"$",
"xml",
",",
"$",
"namespace",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"namespace",
"!==",
"null",
")",
"{",
"$",
"namespaces",
"=",
"$",
"xml",
"->",
"getNamespaces",
"(",
")... | Convert SimpleXMLElement to multidimensional array.
@param \SimpleXMLElement $xml
@param string $namespace The namespace that schould be used.
@throws \OutOfBoundsException If namespace not found in the xml.
@return array | [
"Convert",
"SimpleXMLElement",
"to",
"multidimensional",
"array",
"."
] | 859aa7c8bb727b556c5e32224842af3cff33f18b | https://github.com/gjerokrsteski/pimf-framework/blob/859aa7c8bb727b556c5e32224842af3cff33f18b/core/Pimf/Util/Xml.php#L100-L114 |
226,034 | sop/gcm | lib/GCM/GCM.php | GCM._generateJ0 | private function _generateJ0(string $IV, GHASH $ghash): string
{
// if len(IV) = 96
if (12 == strlen($IV)) {
return $IV . "\0\0\0\1";
}
$data = self::_pad128($IV) . self::ZB_64 . self::_uint64(
strlen($IV) << 3);
return $ghash($data);
} | php | private function _generateJ0(string $IV, GHASH $ghash): string
{
// if len(IV) = 96
if (12 == strlen($IV)) {
return $IV . "\0\0\0\1";
}
$data = self::_pad128($IV) . self::ZB_64 . self::_uint64(
strlen($IV) << 3);
return $ghash($data);
} | [
"private",
"function",
"_generateJ0",
"(",
"string",
"$",
"IV",
",",
"GHASH",
"$",
"ghash",
")",
":",
"string",
"{",
"// if len(IV) = 96",
"if",
"(",
"12",
"==",
"strlen",
"(",
"$",
"IV",
")",
")",
"{",
"return",
"$",
"IV",
".",
"\"\\0\\0\\0\\1\"",
";"... | Generate pre-counter block.
See NIST SP-300-38D section 7.1 step 2 for the details.
@param string $IV Initialization vector
@param GHASH $ghash GHASH functor
@return string | [
"Generate",
"pre",
"-",
"counter",
"block",
"."
] | ef5f63ca0fb1af4c5d2a319858746b9ffd12a216 | https://github.com/sop/gcm/blob/ef5f63ca0fb1af4c5d2a319858746b9ffd12a216/lib/GCM/GCM.php#L136-L145 |
226,035 | sop/gcm | lib/GCM/GCM.php | GCM._gctr | private function _gctr(string $ICB, string $X, string $K): string
{
// if data is an empty string, return an empty string
if ("" == $X) {
return "";
}
// number of blocks
$n = ceil(strlen($X) / 16);
$CB = $ICB;
$Y = "";
for ($i = 0; $i < $n... | php | private function _gctr(string $ICB, string $X, string $K): string
{
// if data is an empty string, return an empty string
if ("" == $X) {
return "";
}
// number of blocks
$n = ceil(strlen($X) / 16);
$CB = $ICB;
$Y = "";
for ($i = 0; $i < $n... | [
"private",
"function",
"_gctr",
"(",
"string",
"$",
"ICB",
",",
"string",
"$",
"X",
",",
"string",
"$",
"K",
")",
":",
"string",
"{",
"// if data is an empty string, return an empty string",
"if",
"(",
"\"\"",
"==",
"$",
"X",
")",
"{",
"return",
"\"\"",
";... | Apply GCTR algorithm.
See NIST SP-300-38D section 6.5 for the details.
@param string $ICB Initial counter block
@param string $X Input data
@param string $K Encryption key
@return string Output data | [
"Apply",
"GCTR",
"algorithm",
"."
] | ef5f63ca0fb1af4c5d2a319858746b9ffd12a216 | https://github.com/sop/gcm/blob/ef5f63ca0fb1af4c5d2a319858746b9ffd12a216/lib/GCM/GCM.php#L157-L180 |
226,036 | sop/gcm | lib/GCM/GCM.php | GCM._computeAuthTag | private function _computeAuthTag(string $A, string $C, string $J0, string $K,
GHASH $ghash): string
{
$data = self::_pad128($A) . self::_pad128($C) .
self::_uint64(strlen($A) << 3) . self::_uint64(strlen($C) << 3);
$S = $ghash($data);
return substr($this->_gctr($J0, $S, ... | php | private function _computeAuthTag(string $A, string $C, string $J0, string $K,
GHASH $ghash): string
{
$data = self::_pad128($A) . self::_pad128($C) .
self::_uint64(strlen($A) << 3) . self::_uint64(strlen($C) << 3);
$S = $ghash($data);
return substr($this->_gctr($J0, $S, ... | [
"private",
"function",
"_computeAuthTag",
"(",
"string",
"$",
"A",
",",
"string",
"$",
"C",
",",
"string",
"$",
"J0",
",",
"string",
"$",
"K",
",",
"GHASH",
"$",
"ghash",
")",
":",
"string",
"{",
"$",
"data",
"=",
"self",
"::",
"_pad128",
"(",
"$",... | Compute authentication tag
See NIST SP-300-38D section 7.1 steps 5-6 for the details.
@param string $A Additional authenticated data
@param string $C Ciphertext
@param string $J0 Pre-counter block
@param string $K Encryption key
@param GHASH $ghash GHASH functor
@return string Authentication tag <code>T</code> | [
"Compute",
"authentication",
"tag"
] | ef5f63ca0fb1af4c5d2a319858746b9ffd12a216 | https://github.com/sop/gcm/blob/ef5f63ca0fb1af4c5d2a319858746b9ffd12a216/lib/GCM/GCM.php#L194-L201 |
226,037 | sop/gcm | lib/GCM/GCM.php | GCM._pad128 | private static function _pad128($data)
{
$padlen = 16 - strlen($data) % 16;
if (16 != $padlen) {
$data .= str_repeat("\0", $padlen);
}
return $data;
} | php | private static function _pad128($data)
{
$padlen = 16 - strlen($data) % 16;
if (16 != $padlen) {
$data .= str_repeat("\0", $padlen);
}
return $data;
} | [
"private",
"static",
"function",
"_pad128",
"(",
"$",
"data",
")",
"{",
"$",
"padlen",
"=",
"16",
"-",
"strlen",
"(",
"$",
"data",
")",
"%",
"16",
";",
"if",
"(",
"16",
"!=",
"$",
"padlen",
")",
"{",
"$",
"data",
".=",
"str_repeat",
"(",
"\"\\0\"... | Pad data to 128 bit block boundary.
@param string $data
@return string | [
"Pad",
"data",
"to",
"128",
"bit",
"block",
"boundary",
"."
] | ef5f63ca0fb1af4c5d2a319858746b9ffd12a216 | https://github.com/sop/gcm/blob/ef5f63ca0fb1af4c5d2a319858746b9ffd12a216/lib/GCM/GCM.php#L209-L216 |
226,038 | sop/gcm | lib/GCM/GCM.php | GCM._inc32 | private static function _inc32(string $X): string
{
$Y = substr($X, 0, -4);
// increment counter
$n = self::strToGMP(substr($X, -4)) + 1;
// wrap by using only the 32 rightmost bits
$Y .= substr(self::gmpToStr($n, 4), -4);
return $Y;
} | php | private static function _inc32(string $X): string
{
$Y = substr($X, 0, -4);
// increment counter
$n = self::strToGMP(substr($X, -4)) + 1;
// wrap by using only the 32 rightmost bits
$Y .= substr(self::gmpToStr($n, 4), -4);
return $Y;
} | [
"private",
"static",
"function",
"_inc32",
"(",
"string",
"$",
"X",
")",
":",
"string",
"{",
"$",
"Y",
"=",
"substr",
"(",
"$",
"X",
",",
"0",
",",
"-",
"4",
")",
";",
"// increment counter",
"$",
"n",
"=",
"self",
"::",
"strToGMP",
"(",
"substr",
... | Increment 32 rightmost bits of the counter block.
See NIST SP-300-38D section 6.2 for the details.
@param string $X
@return string | [
"Increment",
"32",
"rightmost",
"bits",
"of",
"the",
"counter",
"block",
"."
] | ef5f63ca0fb1af4c5d2a319858746b9ffd12a216 | https://github.com/sop/gcm/blob/ef5f63ca0fb1af4c5d2a319858746b9ffd12a216/lib/GCM/GCM.php#L226-L234 |
226,039 | sop/gcm | lib/GCM/GCM.php | GCM.gmpToStr | public static function gmpToStr(\GMP $num, int $size): string
{
$data = gmp_export($num, 1, GMP_MSW_FIRST | GMP_BIG_ENDIAN);
$len = strlen($data);
if ($len < $size) {
$data = str_repeat("\0", $size - $len) . $data;
}
return $data;
} | php | public static function gmpToStr(\GMP $num, int $size): string
{
$data = gmp_export($num, 1, GMP_MSW_FIRST | GMP_BIG_ENDIAN);
$len = strlen($data);
if ($len < $size) {
$data = str_repeat("\0", $size - $len) . $data;
}
return $data;
} | [
"public",
"static",
"function",
"gmpToStr",
"(",
"\\",
"GMP",
"$",
"num",
",",
"int",
"$",
"size",
")",
":",
"string",
"{",
"$",
"data",
"=",
"gmp_export",
"(",
"$",
"num",
",",
"1",
",",
"GMP_MSW_FIRST",
"|",
"GMP_BIG_ENDIAN",
")",
";",
"$",
"len",
... | Convert GMP number to string.
Returned string represents an unsigned integer with big endian order and
the most significant byte first.
@param \GMP $num GMP number
@param int $size Width of the string in bytes
@return string Binary data | [
"Convert",
"GMP",
"number",
"to",
"string",
"."
] | ef5f63ca0fb1af4c5d2a319858746b9ffd12a216 | https://github.com/sop/gcm/blob/ef5f63ca0fb1af4c5d2a319858746b9ffd12a216/lib/GCM/GCM.php#L275-L283 |
226,040 | adamgoose/laravel-annotations | src/Adamgoose/Routing/Annotations/AnnotationSet.php | AnnotationSet.getMethodAnnotations | protected function getMethodAnnotations(ReflectionClass $class, SimpleAnnotationReader $reader)
{
$annotations = [];
foreach ($class->getMethods() as $method)
{
$results = $reader->getMethodAnnotations($method);
if (count($results) > 0)
$annotations[$method->name] = $results;
}
return $annotatio... | php | protected function getMethodAnnotations(ReflectionClass $class, SimpleAnnotationReader $reader)
{
$annotations = [];
foreach ($class->getMethods() as $method)
{
$results = $reader->getMethodAnnotations($method);
if (count($results) > 0)
$annotations[$method->name] = $results;
}
return $annotatio... | [
"protected",
"function",
"getMethodAnnotations",
"(",
"ReflectionClass",
"$",
"class",
",",
"SimpleAnnotationReader",
"$",
"reader",
")",
"{",
"$",
"annotations",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"class",
"->",
"getMethods",
"(",
")",
"as",
"$",
"met... | Get the method annotations for a given class.
@param \ReflectionClass $class
@param \Doctrine\Common\Annotations\SimpleAnnotationReader $reader
@return array | [
"Get",
"the",
"method",
"annotations",
"for",
"a",
"given",
"class",
"."
] | 0a8445508d5d3aeb08e42d0bb357373b522da28e | https://github.com/adamgoose/laravel-annotations/blob/0a8445508d5d3aeb08e42d0bb357373b522da28e/src/Adamgoose/Routing/Annotations/AnnotationSet.php#L42-L55 |
226,041 | gjerokrsteski/pimf-framework | core/Pimf/Response.php | Response.sendStream | public function sendStream($stream, $name, $exit = true)
{
Header::sendDownloadDialog($stream, $name, $exit);
} | php | public function sendStream($stream, $name, $exit = true)
{
Header::sendDownloadDialog($stream, $name, $exit);
} | [
"public",
"function",
"sendStream",
"(",
"$",
"stream",
",",
"$",
"name",
",",
"$",
"exit",
"=",
"true",
")",
"{",
"Header",
"::",
"sendDownloadDialog",
"(",
"$",
"stream",
",",
"$",
"name",
",",
"$",
"exit",
")",
";",
"}"
] | Sends a download dialog to the browser.
@param string $stream Can be a file-path or a string.
@param string $name Name of the stream/file should be shown.
@param boolean $exit Optional for testing | [
"Sends",
"a",
"download",
"dialog",
"to",
"the",
"browser",
"."
] | 859aa7c8bb727b556c5e32224842af3cff33f18b | https://github.com/gjerokrsteski/pimf-framework/blob/859aa7c8bb727b556c5e32224842af3cff33f18b/core/Pimf/Response.php#L123-L126 |
226,042 | gjerokrsteski/pimf-framework | core/Pimf/Response.php | Response.cacheNoValidate | public function cacheNoValidate($seconds = 60)
{
self::preventMultipleCaching();
self::$cached = true;
Header::cacheNoValidate($seconds);
return $this;
} | php | public function cacheNoValidate($seconds = 60)
{
self::preventMultipleCaching();
self::$cached = true;
Header::cacheNoValidate($seconds);
return $this;
} | [
"public",
"function",
"cacheNoValidate",
"(",
"$",
"seconds",
"=",
"60",
")",
"{",
"self",
"::",
"preventMultipleCaching",
"(",
")",
";",
"self",
"::",
"$",
"cached",
"=",
"true",
";",
"Header",
"::",
"cacheNoValidate",
"(",
"$",
"seconds",
")",
";",
"re... | If you want to allow a page to be cached by shared proxies for one minute.
@param int $seconds Interval in seconds
@return $this | [
"If",
"you",
"want",
"to",
"allow",
"a",
"page",
"to",
"be",
"cached",
"by",
"shared",
"proxies",
"for",
"one",
"minute",
"."
] | 859aa7c8bb727b556c5e32224842af3cff33f18b | https://github.com/gjerokrsteski/pimf-framework/blob/859aa7c8bb727b556c5e32224842af3cff33f18b/core/Pimf/Response.php#L187-L194 |
226,043 | gjerokrsteski/pimf-framework | core/Pimf/Environment.php | Environment.getIp | public function getIp()
{
if ($this->X_FORWARDED_FOR) {
return $this->X_FORWARDED_FOR;
}
if ($this->CLIENT_IP) {
return $this->CLIENT_IP;
}
if ($this->SERVER_NAME) {
return gethostbyname($this->SERVER_NAME);
}
return $thi... | php | public function getIp()
{
if ($this->X_FORWARDED_FOR) {
return $this->X_FORWARDED_FOR;
}
if ($this->CLIENT_IP) {
return $this->CLIENT_IP;
}
if ($this->SERVER_NAME) {
return gethostbyname($this->SERVER_NAME);
}
return $thi... | [
"public",
"function",
"getIp",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"X_FORWARDED_FOR",
")",
"{",
"return",
"$",
"this",
"->",
"X_FORWARDED_FOR",
";",
"}",
"if",
"(",
"$",
"this",
"->",
"CLIENT_IP",
")",
"{",
"return",
"$",
"this",
"->",
"CLIE... | Get remote IP
@return string | [
"Get",
"remote",
"IP"
] | 859aa7c8bb727b556c5e32224842af3cff33f18b | https://github.com/gjerokrsteski/pimf-framework/blob/859aa7c8bb727b556c5e32224842af3cff33f18b/core/Pimf/Environment.php#L153-L168 |
226,044 | gjerokrsteski/pimf-framework | core/Pimf/Environment.php | Environment.getUserAgent | public function getUserAgent()
{
if ($this->USER_AGENT) {
return $this->USER_AGENT;
}
if ($this->HTTP_USER_AGENT) {
return $this->HTTP_USER_AGENT;
}
return null;
} | php | public function getUserAgent()
{
if ($this->USER_AGENT) {
return $this->USER_AGENT;
}
if ($this->HTTP_USER_AGENT) {
return $this->HTTP_USER_AGENT;
}
return null;
} | [
"public",
"function",
"getUserAgent",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"USER_AGENT",
")",
"{",
"return",
"$",
"this",
"->",
"USER_AGENT",
";",
"}",
"if",
"(",
"$",
"this",
"->",
"HTTP_USER_AGENT",
")",
"{",
"return",
"$",
"this",
"->",
"H... | Get User Agent
@return string|null | [
"Get",
"User",
"Agent"
] | 859aa7c8bb727b556c5e32224842af3cff33f18b | https://github.com/gjerokrsteski/pimf-framework/blob/859aa7c8bb727b556c5e32224842af3cff33f18b/core/Pimf/Environment.php#L175-L186 |
226,045 | gjerokrsteski/pimf-framework | core/Pimf/Environment.php | Environment.getUrl | public function getUrl()
{
$protocol = strpos(strtolower($this->PATH_INFO), 'https') === false ? 'http' : 'https';
return $protocol . '://' . $this->getHost();
} | php | public function getUrl()
{
$protocol = strpos(strtolower($this->PATH_INFO), 'https') === false ? 'http' : 'https';
return $protocol . '://' . $this->getHost();
} | [
"public",
"function",
"getUrl",
"(",
")",
"{",
"$",
"protocol",
"=",
"strpos",
"(",
"strtolower",
"(",
"$",
"this",
"->",
"PATH_INFO",
")",
",",
"'https'",
")",
"===",
"false",
"?",
"'http'",
":",
"'https'",
";",
"return",
"$",
"protocol",
".",
"'://'"... | Gives you the current page URL
@return string | [
"Gives",
"you",
"the",
"current",
"page",
"URL"
] | 859aa7c8bb727b556c5e32224842af3cff33f18b | https://github.com/gjerokrsteski/pimf-framework/blob/859aa7c8bb727b556c5e32224842af3cff33f18b/core/Pimf/Environment.php#L193-L198 |
226,046 | gjerokrsteski/pimf-framework | core/Pimf/Environment.php | Environment.getRequestHeader | public function getRequestHeader($header)
{
$header = str_replace('-', '_', strtoupper($header));
$value = $this->{'HTTP_' . $header};
if (!$value) {
$headers = $this->getRequestHeaders();
$value = !empty($headers[$header]) ? $headers[$header] : null;
}
... | php | public function getRequestHeader($header)
{
$header = str_replace('-', '_', strtoupper($header));
$value = $this->{'HTTP_' . $header};
if (!$value) {
$headers = $this->getRequestHeaders();
$value = !empty($headers[$header]) ? $headers[$header] : null;
}
... | [
"public",
"function",
"getRequestHeader",
"(",
"$",
"header",
")",
"{",
"$",
"header",
"=",
"str_replace",
"(",
"'-'",
",",
"'_'",
",",
"strtoupper",
"(",
"$",
"header",
")",
")",
";",
"$",
"value",
"=",
"$",
"this",
"->",
"{",
"'HTTP_'",
".",
"$",
... | Try to get a request header.
@param string $header
@return array | [
"Try",
"to",
"get",
"a",
"request",
"header",
"."
] | 859aa7c8bb727b556c5e32224842af3cff33f18b | https://github.com/gjerokrsteski/pimf-framework/blob/859aa7c8bb727b556c5e32224842af3cff33f18b/core/Pimf/Environment.php#L207-L218 |
226,047 | gjerokrsteski/pimf-framework | core/Pimf/Environment.php | Environment.getRequestHeaders | public function getRequestHeaders()
{
$headers = array();
foreach ($this->data->getAll() as $key => $value) {
if ('HTTP_' === substr($key, 0, 5)) {
$headers[substr($key, 5)] = $value;
}
}
return $headers;
} | php | public function getRequestHeaders()
{
$headers = array();
foreach ($this->data->getAll() as $key => $value) {
if ('HTTP_' === substr($key, 0, 5)) {
$headers[substr($key, 5)] = $value;
}
}
return $headers;
} | [
"public",
"function",
"getRequestHeaders",
"(",
")",
"{",
"$",
"headers",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"data",
"->",
"getAll",
"(",
")",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"if",
"(",
"'HTTP_'",
"===",... | Try to determine all request headers
@return array | [
"Try",
"to",
"determine",
"all",
"request",
"headers"
] | 859aa7c8bb727b556c5e32224842af3cff33f18b | https://github.com/gjerokrsteski/pimf-framework/blob/859aa7c8bb727b556c5e32224842af3cff33f18b/core/Pimf/Environment.php#L225-L236 |
226,048 | CallFire/CallFire-PHP-SDK | src/CallFire/Common/Subscription.php | Subscription.is_event_request | public static function is_event_request($requestData = null, $contentTypes = null)
{
if (!$requestData) {
$requestData = $_SERVER;
}
if (!$contentTypes) {
$contentTypes = static::$eventContentTypes;
}
switch (false) { // All of these things must be t... | php | public static function is_event_request($requestData = null, $contentTypes = null)
{
if (!$requestData) {
$requestData = $_SERVER;
}
if (!$contentTypes) {
$contentTypes = static::$eventContentTypes;
}
switch (false) { // All of these things must be t... | [
"public",
"static",
"function",
"is_event_request",
"(",
"$",
"requestData",
"=",
"null",
",",
"$",
"contentTypes",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"requestData",
")",
"{",
"$",
"requestData",
"=",
"$",
"_SERVER",
";",
"}",
"if",
"(",
"!",
... | Determines if the request is an event notification,
and returns the corresponding format identifier.
@static
@param array $requestData = null
@param array $contentTypes = null
@return string | [
"Determines",
"if",
"the",
"request",
"is",
"an",
"event",
"notification",
"and",
"returns",
"the",
"corresponding",
"format",
"identifier",
"."
] | 7d6d3e1c59d4116e4fadaf57851a2fa127a13f65 | https://github.com/CallFire/CallFire-PHP-SDK/blob/7d6d3e1c59d4116e4fadaf57851a2fa127a13f65/src/CallFire/Common/Subscription.php#L48-L67 |
226,049 | jagilpe/encryption-bundle | EventListener/UserEventsSubsbriber.php | UserEventsSubsbriber.handlePasswordChangeSuccess | public function handlePasswordChangeSuccess(FOSFormEvent $event)
{
$form = $event->getForm();
$user = $form->getData();
if ($user instanceof PKEncryptionEnabledUserInterface) {
$currentPassword = $form->get('current_password')->getData();
$this->encryptionService->ha... | php | public function handlePasswordChangeSuccess(FOSFormEvent $event)
{
$form = $event->getForm();
$user = $form->getData();
if ($user instanceof PKEncryptionEnabledUserInterface) {
$currentPassword = $form->get('current_password')->getData();
$this->encryptionService->ha... | [
"public",
"function",
"handlePasswordChangeSuccess",
"(",
"FOSFormEvent",
"$",
"event",
")",
"{",
"$",
"form",
"=",
"$",
"event",
"->",
"getForm",
"(",
")",
";",
"$",
"user",
"=",
"$",
"form",
"->",
"getData",
"(",
")",
";",
"if",
"(",
"$",
"user",
"... | Handles a successful password change using the FOSUserBundle forms
@param \FOS\UserBundle\Event\FormEvent $event | [
"Handles",
"a",
"successful",
"password",
"change",
"using",
"the",
"FOSUserBundle",
"forms"
] | 1e1ba13a3cc646b36e3407822f2e8339c5671f47 | https://github.com/jagilpe/encryption-bundle/blob/1e1ba13a3cc646b36e3407822f2e8339c5671f47/EventListener/UserEventsSubsbriber.php#L47-L56 |
226,050 | jagilpe/encryption-bundle | EventListener/UserEventsSubsbriber.php | UserEventsSubsbriber.handlePasswordResetSuccess | public function handlePasswordResetSuccess(FOSFormEvent $event)
{
$form = $event->getForm();
$user = $form->getData();
if ($user instanceof PKEncryptionEnabledUserInterface) {
$this->encryptionService->handleUserPasswordResetSuccess($user);
}
} | php | public function handlePasswordResetSuccess(FOSFormEvent $event)
{
$form = $event->getForm();
$user = $form->getData();
if ($user instanceof PKEncryptionEnabledUserInterface) {
$this->encryptionService->handleUserPasswordResetSuccess($user);
}
} | [
"public",
"function",
"handlePasswordResetSuccess",
"(",
"FOSFormEvent",
"$",
"event",
")",
"{",
"$",
"form",
"=",
"$",
"event",
"->",
"getForm",
"(",
")",
";",
"$",
"user",
"=",
"$",
"form",
"->",
"getData",
"(",
")",
";",
"if",
"(",
"$",
"user",
"i... | Handles a successful password reset using the FOSUserBundle forms
@param \FOS\UserBundle\Event\FormEvent $event | [
"Handles",
"a",
"successful",
"password",
"reset",
"using",
"the",
"FOSUserBundle",
"forms"
] | 1e1ba13a3cc646b36e3407822f2e8339c5671f47 | https://github.com/jagilpe/encryption-bundle/blob/1e1ba13a3cc646b36e3407822f2e8339c5671f47/EventListener/UserEventsSubsbriber.php#L63-L71 |
226,051 | jagilpe/encryption-bundle | EventListener/UserEventsSubsbriber.php | UserEventsSubsbriber.handleUserRegistrationSuccess | public function handleUserRegistrationSuccess(FOSFormEvent $event)
{
$user = $event->getForm()->getData();
if ($user instanceof PKEncryptionEnabledUserInterface) {
$this->encryptionService->handleUserPreCreation($user);
}
} | php | public function handleUserRegistrationSuccess(FOSFormEvent $event)
{
$user = $event->getForm()->getData();
if ($user instanceof PKEncryptionEnabledUserInterface) {
$this->encryptionService->handleUserPreCreation($user);
}
} | [
"public",
"function",
"handleUserRegistrationSuccess",
"(",
"FOSFormEvent",
"$",
"event",
")",
"{",
"$",
"user",
"=",
"$",
"event",
"->",
"getForm",
"(",
")",
"->",
"getData",
"(",
")",
";",
"if",
"(",
"$",
"user",
"instanceof",
"PKEncryptionEnabledUserInterfa... | Handles a successful user registration using the FOSUserBundle forms
@param FOSFormEvent $event
@throws \Exception | [
"Handles",
"a",
"successful",
"user",
"registration",
"using",
"the",
"FOSUserBundle",
"forms"
] | 1e1ba13a3cc646b36e3407822f2e8339c5671f47 | https://github.com/jagilpe/encryption-bundle/blob/1e1ba13a3cc646b36e3407822f2e8339c5671f47/EventListener/UserEventsSubsbriber.php#L79-L86 |
226,052 | jagilpe/encryption-bundle | EventListener/UserEventsSubsbriber.php | UserEventsSubsbriber.handleUserRegistrationComplete | public function handleUserRegistrationComplete(FOSFilterUserResponseEvent $event)
{
$user = $event->getUser();
if ($user instanceof PKEncryptionEnabledUserInterface) {
$this->encryptionService->handleUserPostCreation($user);
}
} | php | public function handleUserRegistrationComplete(FOSFilterUserResponseEvent $event)
{
$user = $event->getUser();
if ($user instanceof PKEncryptionEnabledUserInterface) {
$this->encryptionService->handleUserPostCreation($user);
}
} | [
"public",
"function",
"handleUserRegistrationComplete",
"(",
"FOSFilterUserResponseEvent",
"$",
"event",
")",
"{",
"$",
"user",
"=",
"$",
"event",
"->",
"getUser",
"(",
")",
";",
"if",
"(",
"$",
"user",
"instanceof",
"PKEncryptionEnabledUserInterface",
")",
"{",
... | Handles the completion of a user registration using the FOSUserBundle forms
@param \FOS\UserBundle\Event\FilterUserResponseEvent $event | [
"Handles",
"the",
"completion",
"of",
"a",
"user",
"registration",
"using",
"the",
"FOSUserBundle",
"forms"
] | 1e1ba13a3cc646b36e3407822f2e8339c5671f47 | https://github.com/jagilpe/encryption-bundle/blob/1e1ba13a3cc646b36e3407822f2e8339c5671f47/EventListener/UserEventsSubsbriber.php#L93-L100 |
226,053 | Techworker/ssml | src/Element/Word.php | Word.factory | public static function factory(string $role, string $text): Word
{
$instance = new static();
$instance->role = $role;
$instance->text = $text;
return $instance;
} | php | public static function factory(string $role, string $text): Word
{
$instance = new static();
$instance->role = $role;
$instance->text = $text;
return $instance;
} | [
"public",
"static",
"function",
"factory",
"(",
"string",
"$",
"role",
",",
"string",
"$",
"text",
")",
":",
"Word",
"{",
"$",
"instance",
"=",
"new",
"static",
"(",
")",
";",
"$",
"instance",
"->",
"role",
"=",
"$",
"role",
";",
"$",
"instance",
"... | Creates a word element with the given data as attributes.
@param string $role
@param string $text
@return Word | [
"Creates",
"a",
"word",
"element",
"with",
"the",
"given",
"data",
"as",
"attributes",
"."
] | cafb979b777480baf7a01b5db2bf7c2cff837805 | https://github.com/Techworker/ssml/blob/cafb979b777480baf7a01b5db2bf7c2cff837805/src/Element/Word.php#L46-L53 |
226,054 | jagilpe/encryption-bundle | Crypt/SymmetricKey.php | SymmetricKey.getSystemKey | public function getSystemKey()
{
return isset($this->encryptedKeys[self::SYSTEM_IDENTIFIER])
? $this->encryptedKeys[self::SYSTEM_IDENTIFIER]
: null;
} | php | public function getSystemKey()
{
return isset($this->encryptedKeys[self::SYSTEM_IDENTIFIER])
? $this->encryptedKeys[self::SYSTEM_IDENTIFIER]
: null;
} | [
"public",
"function",
"getSystemKey",
"(",
")",
"{",
"return",
"isset",
"(",
"$",
"this",
"->",
"encryptedKeys",
"[",
"self",
"::",
"SYSTEM_IDENTIFIER",
"]",
")",
"?",
"$",
"this",
"->",
"encryptedKeys",
"[",
"self",
"::",
"SYSTEM_IDENTIFIER",
"]",
":",
"n... | Returns the encrypted key that corresponds to the system master key
@return NULL|string | [
"Returns",
"the",
"encrypted",
"key",
"that",
"corresponds",
"to",
"the",
"system",
"master",
"key"
] | 1e1ba13a3cc646b36e3407822f2e8339c5671f47 | https://github.com/jagilpe/encryption-bundle/blob/1e1ba13a3cc646b36e3407822f2e8339c5671f47/Crypt/SymmetricKey.php#L39-L44 |
226,055 | jagilpe/encryption-bundle | Crypt/SymmetricKey.php | SymmetricKey.addKey | public function addKey(PKEncryptionEnabledUserInterface $user, $encryptedKey)
{
$userClass = $this->getUserClass($user);
$userId = $user->getId();
if (!isset($this->encryptedKeys[$userClass])) {
$this->encryptedKeys[$userClass] = array();
}
$this->encryptedKeys[$u... | php | public function addKey(PKEncryptionEnabledUserInterface $user, $encryptedKey)
{
$userClass = $this->getUserClass($user);
$userId = $user->getId();
if (!isset($this->encryptedKeys[$userClass])) {
$this->encryptedKeys[$userClass] = array();
}
$this->encryptedKeys[$u... | [
"public",
"function",
"addKey",
"(",
"PKEncryptionEnabledUserInterface",
"$",
"user",
",",
"$",
"encryptedKey",
")",
"{",
"$",
"userClass",
"=",
"$",
"this",
"->",
"getUserClass",
"(",
"$",
"user",
")",
";",
"$",
"userId",
"=",
"$",
"user",
"->",
"getId",
... | Adds a new version of the key encrypted with the key of a new user
@param \Jagilpe\EncryptionBundle\Entity\PKEncryptionEnabledUserInterface $user
@param string $encryptedKey | [
"Adds",
"a",
"new",
"version",
"of",
"the",
"key",
"encrypted",
"with",
"the",
"key",
"of",
"a",
"new",
"user"
] | 1e1ba13a3cc646b36e3407822f2e8339c5671f47 | https://github.com/jagilpe/encryption-bundle/blob/1e1ba13a3cc646b36e3407822f2e8339c5671f47/Crypt/SymmetricKey.php#L52-L60 |
226,056 | jagilpe/encryption-bundle | Crypt/SymmetricKey.php | SymmetricKey.getKey | public function getKey(PKEncryptionEnabledUserInterface $user)
{
$userClass = $this->getUserClass($user);
$userId = $user->getId();
return isset($this->encryptedKeys[$userClass]) && isset($this->encryptedKeys[$userClass][$userId])
? $this->encryptedKeys[$userClass][$userId]
... | php | public function getKey(PKEncryptionEnabledUserInterface $user)
{
$userClass = $this->getUserClass($user);
$userId = $user->getId();
return isset($this->encryptedKeys[$userClass]) && isset($this->encryptedKeys[$userClass][$userId])
? $this->encryptedKeys[$userClass][$userId]
... | [
"public",
"function",
"getKey",
"(",
"PKEncryptionEnabledUserInterface",
"$",
"user",
")",
"{",
"$",
"userClass",
"=",
"$",
"this",
"->",
"getUserClass",
"(",
"$",
"user",
")",
";",
"$",
"userId",
"=",
"$",
"user",
"->",
"getId",
"(",
")",
";",
"return",... | Returns the encrypted key that corresponds to a determined user
@param PKEncryptionEnabledUserInterface $user
@return NULL|string | [
"Returns",
"the",
"encrypted",
"key",
"that",
"corresponds",
"to",
"a",
"determined",
"user"
] | 1e1ba13a3cc646b36e3407822f2e8339c5671f47 | https://github.com/jagilpe/encryption-bundle/blob/1e1ba13a3cc646b36e3407822f2e8339c5671f47/Crypt/SymmetricKey.php#L68-L76 |
226,057 | gjerokrsteski/pimf-framework | core/Pimf/Session.php | Session.factory | public static function factory($storage)
{
switch ($storage) {
case 'apc':
return new Storage\Apc(Cache::storage('apc'));
case 'cookie':
return new Storage\Cookie();
case 'file':
return new Storage\File(Config::get('sessio... | php | public static function factory($storage)
{
switch ($storage) {
case 'apc':
return new Storage\Apc(Cache::storage('apc'));
case 'cookie':
return new Storage\Cookie();
case 'file':
return new Storage\File(Config::get('sessio... | [
"public",
"static",
"function",
"factory",
"(",
"$",
"storage",
")",
"{",
"switch",
"(",
"$",
"storage",
")",
"{",
"case",
"'apc'",
":",
"return",
"new",
"Storage",
"\\",
"Apc",
"(",
"Cache",
"::",
"storage",
"(",
"'apc'",
")",
")",
";",
"case",
"'co... | Create a new session storage instance.
@param string $storage
@return Storage\Storage
@throws \RuntimeException | [
"Create",
"a",
"new",
"session",
"storage",
"instance",
"."
] | 859aa7c8bb727b556c5e32224842af3cff33f18b | https://github.com/gjerokrsteski/pimf-framework/blob/859aa7c8bb727b556c5e32224842af3cff33f18b/core/Pimf/Session.php#L91-L121 |
226,058 | infomaniac-amf/php | lib/io/Input.php | Input.readDouble | public function readDouble()
{
$double = $this->readRawBytes(8);
if (Spec::isLittleEndian()) {
$double = strrev($double);
}
$double = unpack("d", $double);
return $double[1];
} | php | public function readDouble()
{
$double = $this->readRawBytes(8);
if (Spec::isLittleEndian()) {
$double = strrev($double);
}
$double = unpack("d", $double);
return $double[1];
} | [
"public",
"function",
"readDouble",
"(",
")",
"{",
"$",
"double",
"=",
"$",
"this",
"->",
"readRawBytes",
"(",
"8",
")",
";",
"if",
"(",
"Spec",
"::",
"isLittleEndian",
"(",
")",
")",
"{",
"$",
"double",
"=",
"strrev",
"(",
"$",
"double",
")",
";",... | Read a byte as a float
@return float | [
"Read",
"a",
"byte",
"as",
"a",
"float"
] | 1b71c125352ec562f473cd51958a03f786aa7ac9 | https://github.com/infomaniac-amf/php/blob/1b71c125352ec562f473cd51958a03f786aa7ac9/lib/io/Input.php#L49-L59 |
226,059 | crip-laravel/filesys | src/Services/TreeService.php | TreeService.content | public function content(): array
{
$dirs = collect($this->storage->allDirectories($this->root));
$output = [];
$dirs->filter(function ($dir) {
$parts = $this->split($dir);
return !in_array($parts[0], $this->exclude);
})->each(function ($dir) use (&$output) {
... | php | public function content(): array
{
$dirs = collect($this->storage->allDirectories($this->root));
$output = [];
$dirs->filter(function ($dir) {
$parts = $this->split($dir);
return !in_array($parts[0], $this->exclude);
})->each(function ($dir) use (&$output) {
... | [
"public",
"function",
"content",
"(",
")",
":",
"array",
"{",
"$",
"dirs",
"=",
"collect",
"(",
"$",
"this",
"->",
"storage",
"->",
"allDirectories",
"(",
"$",
"this",
"->",
"root",
")",
")",
";",
"$",
"output",
"=",
"[",
"]",
";",
"$",
"dirs",
"... | Gets root folder tree content.
@return array | [
"Gets",
"root",
"folder",
"tree",
"content",
"."
] | 43c66929a5a16772dbb3bae4b5188bdc10b6f9ec | https://github.com/crip-laravel/filesys/blob/43c66929a5a16772dbb3bae4b5188bdc10b6f9ec/src/Services/TreeService.php#L51-L78 |
226,060 | crip-laravel/filesys | src/Services/TreeService.php | TreeService.dirToPath | private function dirToPath(string $dir): string
{
if ($this->root !== '') {
return str_replace_first($this->root, '', $dir);
}
return $dir;
} | php | private function dirToPath(string $dir): string
{
if ($this->root !== '') {
return str_replace_first($this->root, '', $dir);
}
return $dir;
} | [
"private",
"function",
"dirToPath",
"(",
"string",
"$",
"dir",
")",
":",
"string",
"{",
"if",
"(",
"$",
"this",
"->",
"root",
"!==",
"''",
")",
"{",
"return",
"str_replace_first",
"(",
"$",
"this",
"->",
"root",
",",
"''",
",",
"$",
"dir",
")",
";"... | Convert dir to path.
@param string $dir
@return string | [
"Convert",
"dir",
"to",
"path",
"."
] | 43c66929a5a16772dbb3bae4b5188bdc10b6f9ec | https://github.com/crip-laravel/filesys/blob/43c66929a5a16772dbb3bae4b5188bdc10b6f9ec/src/Services/TreeService.php#L85-L92 |
226,061 | crip-laravel/filesys | src/Services/TreeService.php | TreeService.split | private function split(string $dir): array
{
$path = $this->dirToPath($dir);
return explode('/', Str::normalizePath($path));
} | php | private function split(string $dir): array
{
$path = $this->dirToPath($dir);
return explode('/', Str::normalizePath($path));
} | [
"private",
"function",
"split",
"(",
"string",
"$",
"dir",
")",
":",
"array",
"{",
"$",
"path",
"=",
"$",
"this",
"->",
"dirToPath",
"(",
"$",
"dir",
")",
";",
"return",
"explode",
"(",
"'/'",
",",
"Str",
"::",
"normalizePath",
"(",
"$",
"path",
")... | Normalize and split dir path.
@param string $dir
@return array | [
"Normalize",
"and",
"split",
"dir",
"path",
"."
] | 43c66929a5a16772dbb3bae4b5188bdc10b6f9ec | https://github.com/crip-laravel/filesys/blob/43c66929a5a16772dbb3bae4b5188bdc10b6f9ec/src/Services/TreeService.php#L99-L104 |
226,062 | gjerokrsteski/pimf-framework | core/Pimf/Util/Uploaded.php | Uploaded.getMaxFilesize | public static function getMaxFilesize()
{
$max = trim(ini_get('upload_max_filesize'));
if ('' === $max) {
return PHP_INT_MAX;
}
$unit = strtolower(substr($max, -1));
$max = (int)substr($max, 0, -1);
if (in_array($unit, array('g', 'm', 'k'), true)) {
... | php | public static function getMaxFilesize()
{
$max = trim(ini_get('upload_max_filesize'));
if ('' === $max) {
return PHP_INT_MAX;
}
$unit = strtolower(substr($max, -1));
$max = (int)substr($max, 0, -1);
if (in_array($unit, array('g', 'm', 'k'), true)) {
... | [
"public",
"static",
"function",
"getMaxFilesize",
"(",
")",
"{",
"$",
"max",
"=",
"trim",
"(",
"ini_get",
"(",
"'upload_max_filesize'",
")",
")",
";",
"if",
"(",
"''",
"===",
"$",
"max",
")",
"{",
"return",
"PHP_INT_MAX",
";",
"}",
"$",
"unit",
"=",
... | Returns the maximum size of an uploaded file in bytes as configured in php.ini
@return int | [
"Returns",
"the",
"maximum",
"size",
"of",
"an",
"uploaded",
"file",
"in",
"bytes",
"as",
"configured",
"in",
"php",
".",
"ini"
] | 859aa7c8bb727b556c5e32224842af3cff33f18b | https://github.com/gjerokrsteski/pimf-framework/blob/859aa7c8bb727b556c5e32224842af3cff33f18b/core/Pimf/Util/Uploaded.php#L201-L217 |
226,063 | mlanin/laravel-setup-wizard | src/Commands/Steps/CreateMysqlDatabase.php | CreateMysqlDatabase.getDatabaseConfigs | protected function getDatabaseConfigs(array &$return)
{
$return['localhost'] = 'localhost';
$return['host'] = $this->connection->getConfig('host');
$return['database'] = $this->connection->getConfig('database');
$return['username'] = $this->connection->getConfig('username');
... | php | protected function getDatabaseConfigs(array &$return)
{
$return['localhost'] = 'localhost';
$return['host'] = $this->connection->getConfig('host');
$return['database'] = $this->connection->getConfig('database');
$return['username'] = $this->connection->getConfig('username');
... | [
"protected",
"function",
"getDatabaseConfigs",
"(",
"array",
"&",
"$",
"return",
")",
"{",
"$",
"return",
"[",
"'localhost'",
"]",
"=",
"'localhost'",
";",
"$",
"return",
"[",
"'host'",
"]",
"=",
"$",
"this",
"->",
"connection",
"->",
"getConfig",
"(",
"... | Get database config.
@param array $return | [
"Get",
"database",
"config",
"."
] | b2614612f92861af434e70b0fe070f6167a71e33 | https://github.com/mlanin/laravel-setup-wizard/blob/b2614612f92861af434e70b0fe070f6167a71e33/src/Commands/Steps/CreateMysqlDatabase.php#L61-L76 |
226,064 | mlanin/laravel-setup-wizard | src/Commands/Steps/CreateMysqlDatabase.php | CreateMysqlDatabase.generateConsoleCommand | protected function generateConsoleCommand($results, $full = false)
{
return sprintf(
"mysql -u\"%s\" -p\"%s\" -h\"%s\" -e\"%s\"",
$results['connection_username'],
$full ? $results['connection_password'] : '******',
$results['host'],
join(' ', $resu... | php | protected function generateConsoleCommand($results, $full = false)
{
return sprintf(
"mysql -u\"%s\" -p\"%s\" -h\"%s\" -e\"%s\"",
$results['connection_username'],
$full ? $results['connection_password'] : '******',
$results['host'],
join(' ', $resu... | [
"protected",
"function",
"generateConsoleCommand",
"(",
"$",
"results",
",",
"$",
"full",
"=",
"false",
")",
"{",
"return",
"sprintf",
"(",
"\"mysql -u\\\"%s\\\" -p\\\"%s\\\" -h\\\"%s\\\" -e\\\"%s\\\"\"",
",",
"$",
"results",
"[",
"'connection_username'",
"]",
",",
"$... | Generate terminal command.
@param array $results
@param bool $full
@return string | [
"Generate",
"terminal",
"command",
"."
] | b2614612f92861af434e70b0fe070f6167a71e33 | https://github.com/mlanin/laravel-setup-wizard/blob/b2614612f92861af434e70b0fe070f6167a71e33/src/Commands/Steps/CreateMysqlDatabase.php#L117-L126 |
226,065 | gjerokrsteski/pimf-framework | core/Pimf/Event.php | Event.fire | public static function fire($events, $parameters = array(), $halt = false)
{
$responses = array();
$parameters = (array)$parameters;
// If the event has listeners, iterate through them and call each listener,
// passing in the parameters.
foreach ((array)$events as $event) {... | php | public static function fire($events, $parameters = array(), $halt = false)
{
$responses = array();
$parameters = (array)$parameters;
// If the event has listeners, iterate through them and call each listener,
// passing in the parameters.
foreach ((array)$events as $event) {... | [
"public",
"static",
"function",
"fire",
"(",
"$",
"events",
",",
"$",
"parameters",
"=",
"array",
"(",
")",
",",
"$",
"halt",
"=",
"false",
")",
"{",
"$",
"responses",
"=",
"array",
"(",
")",
";",
"$",
"parameters",
"=",
"(",
"array",
")",
"$",
"... | Fire an event so that all listeners are called.
@param string $events
@param array $parameters
@param bool $halt
@return array|null | [
"Fire",
"an",
"event",
"so",
"that",
"all",
"listeners",
"are",
"called",
"."
] | 859aa7c8bb727b556c5e32224842af3cff33f18b | https://github.com/gjerokrsteski/pimf-framework/blob/859aa7c8bb727b556c5e32224842af3cff33f18b/core/Pimf/Event.php#L149-L175 |
226,066 | kinglozzer/tinypng | src/Result.php | Result.makeDir | protected function makeDir($path)
{
if (! file_exists(dirname($path))) {
$this->makeDir(dirname($path));
}
if (! file_exists($path)) {
mkdir($path);
}
} | php | protected function makeDir($path)
{
if (! file_exists(dirname($path))) {
$this->makeDir(dirname($path));
}
if (! file_exists($path)) {
mkdir($path);
}
} | [
"protected",
"function",
"makeDir",
"(",
"$",
"path",
")",
"{",
"if",
"(",
"!",
"file_exists",
"(",
"dirname",
"(",
"$",
"path",
")",
")",
")",
"{",
"$",
"this",
"->",
"makeDir",
"(",
"dirname",
"(",
"$",
"path",
")",
")",
";",
"}",
"if",
"(",
... | Creates a directory, recursively iterating through, and creating, missing
parent directories
@param string $path | [
"Creates",
"a",
"directory",
"recursively",
"iterating",
"through",
"and",
"creating",
"missing",
"parent",
"directories"
] | 3ae3b1ed217bd5a77c449c3a3d7ea3f0d33a4025 | https://github.com/kinglozzer/tinypng/blob/3ae3b1ed217bd5a77c449c3a3d7ea3f0d33a4025/src/Result.php#L85-L94 |
226,067 | gjerokrsteski/pimf-framework | core/Pimf/Controller/Base.php | Base.render | public function render()
{
if (Sapi::isCli() && Config::get('environment') == 'production') {
$suffix = 'CliAction';
$action = $this->request->fromCli()->get('action', 'index');
} else {
$suffix = 'Action';
if ($this->request->getMethod() != 'GET' &&... | php | public function render()
{
if (Sapi::isCli() && Config::get('environment') == 'production') {
$suffix = 'CliAction';
$action = $this->request->fromCli()->get('action', 'index');
} else {
$suffix = 'Action';
if ($this->request->getMethod() != 'GET' &&... | [
"public",
"function",
"render",
"(",
")",
"{",
"if",
"(",
"Sapi",
"::",
"isCli",
"(",
")",
"&&",
"Config",
"::",
"get",
"(",
"'environment'",
")",
"==",
"'production'",
")",
"{",
"$",
"suffix",
"=",
"'CliAction'",
";",
"$",
"action",
"=",
"$",
"this"... | Method to show the content.
@return mixed
@throws \Exception If not supported request method or bad controller | [
"Method",
"to",
"show",
"the",
"content",
"."
] | 859aa7c8bb727b556c5e32224842af3cff33f18b | https://github.com/gjerokrsteski/pimf-framework/blob/859aa7c8bb727b556c5e32224842af3cff33f18b/core/Pimf/Controller/Base.php#L87-L133 |
226,068 | gjerokrsteski/pimf-framework | core/Pimf/Controller/Base.php | Base.redirect | public function redirect($route, $permanent = false, $exit = true)
{
$url = Url::compute($route);
($permanent === true) ? Header::sendMovedPermanently() : Header::sendFound();
Header::toLocation($url, $exit);
} | php | public function redirect($route, $permanent = false, $exit = true)
{
$url = Url::compute($route);
($permanent === true) ? Header::sendMovedPermanently() : Header::sendFound();
Header::toLocation($url, $exit);
} | [
"public",
"function",
"redirect",
"(",
"$",
"route",
",",
"$",
"permanent",
"=",
"false",
",",
"$",
"exit",
"=",
"true",
")",
"{",
"$",
"url",
"=",
"Url",
"::",
"compute",
"(",
"$",
"route",
")",
";",
"(",
"$",
"permanent",
"===",
"true",
")",
"?... | Prepares the response object to return an HTTP Redirect response to the client.
@param string $route The redirect destination like controller/action
@param boolean $permanent If permanent redirection or not.
@param boolean $exit | [
"Prepares",
"the",
"response",
"object",
"to",
"return",
"an",
"HTTP",
"Redirect",
"response",
"to",
"the",
"client",
"."
] | 859aa7c8bb727b556c5e32224842af3cff33f18b | https://github.com/gjerokrsteski/pimf-framework/blob/859aa7c8bb727b556c5e32224842af3cff33f18b/core/Pimf/Controller/Base.php#L142-L149 |
226,069 | gjerokrsteski/pimf-framework | core/Pimf/Sapi.php | Sapi.isWeb | public static function isWeb()
{
return self::isApache() || self::isIIS() || self::isCgi() || self::isBuiltInWebServer() || self::isHHVM();
} | php | public static function isWeb()
{
return self::isApache() || self::isIIS() || self::isCgi() || self::isBuiltInWebServer() || self::isHHVM();
} | [
"public",
"static",
"function",
"isWeb",
"(",
")",
"{",
"return",
"self",
"::",
"isApache",
"(",
")",
"||",
"self",
"::",
"isIIS",
"(",
")",
"||",
"self",
"::",
"isCgi",
"(",
")",
"||",
"self",
"::",
"isBuiltInWebServer",
"(",
")",
"||",
"self",
"::"... | Are we in a web environment?
@return boolean | [
"Are",
"we",
"in",
"a",
"web",
"environment?"
] | 859aa7c8bb727b556c5e32224842af3cff33f18b | https://github.com/gjerokrsteski/pimf-framework/blob/859aa7c8bb727b556c5e32224842af3cff33f18b/core/Pimf/Sapi.php#L25-L28 |
226,070 | progsmile/request-validator | src/Rules/BaseRule.php | BaseRule.getConfig | public function getConfig($type = self::CONFIG_ALL)
{
if ($type == self::CONFIG_ALL) {
return $this->config;
}
return isset($this->config[$type]) ? $this->config[$type] : [];
} | php | public function getConfig($type = self::CONFIG_ALL)
{
if ($type == self::CONFIG_ALL) {
return $this->config;
}
return isset($this->config[$type]) ? $this->config[$type] : [];
} | [
"public",
"function",
"getConfig",
"(",
"$",
"type",
"=",
"self",
"::",
"CONFIG_ALL",
")",
"{",
"if",
"(",
"$",
"type",
"==",
"self",
"::",
"CONFIG_ALL",
")",
"{",
"return",
"$",
"this",
"->",
"config",
";",
"}",
"return",
"isset",
"(",
"$",
"this",
... | Returns all config array, or specific one.
@param string $type
@return array | [
"Returns",
"all",
"config",
"array",
"or",
"specific",
"one",
"."
] | f211abd1a8e7c67030401f8c4896d926da7dafef | https://github.com/progsmile/request-validator/blob/f211abd1a8e7c67030401f8c4896d926da7dafef/src/Rules/BaseRule.php#L36-L43 |
226,071 | progsmile/request-validator | src/Rules/BaseRule.php | BaseRule.isNotRequiredAndEmpty | protected function isNotRequiredAndEmpty($type = 'var')
{
$condition = false;
if ($type == 'var') {
$condition = strlen($this->params[1]) == 0;
} elseif ($type == 'file') {
$fieldsName = $this->params[0];
//when file field is not required and empty
... | php | protected function isNotRequiredAndEmpty($type = 'var')
{
$condition = false;
if ($type == 'var') {
$condition = strlen($this->params[1]) == 0;
} elseif ($type == 'file') {
$fieldsName = $this->params[0];
//when file field is not required and empty
... | [
"protected",
"function",
"isNotRequiredAndEmpty",
"(",
"$",
"type",
"=",
"'var'",
")",
"{",
"$",
"condition",
"=",
"false",
";",
"if",
"(",
"$",
"type",
"==",
"'var'",
")",
"{",
"$",
"condition",
"=",
"strlen",
"(",
"$",
"this",
"->",
"params",
"[",
... | Check if variable is not required - to prevent error messages from another validators.
@param string $type | 'var' or 'file'
@return bool | [
"Check",
"if",
"variable",
"is",
"not",
"required",
"-",
"to",
"prevent",
"error",
"messages",
"from",
"another",
"validators",
"."
] | f211abd1a8e7c67030401f8c4896d926da7dafef | https://github.com/progsmile/request-validator/blob/f211abd1a8e7c67030401f8c4896d926da7dafef/src/Rules/BaseRule.php#L64-L78 |
226,072 | crip-laravel/filesys | src/Services/Blob.php | Blob.setPath | public function setPath($path = '')
{
$userFolder = Str::normalizePath(config('cripfilesys.user_folder'));
if ($userFolder !== '' && !starts_with($path, $userFolder)) {
$path = empty($path) ? '' : $path;
$path = $this->prefixPath($path, $userFolder);
}
$this... | php | public function setPath($path = '')
{
$userFolder = Str::normalizePath(config('cripfilesys.user_folder'));
if ($userFolder !== '' && !starts_with($path, $userFolder)) {
$path = empty($path) ? '' : $path;
$path = $this->prefixPath($path, $userFolder);
}
$this... | [
"public",
"function",
"setPath",
"(",
"$",
"path",
"=",
"''",
")",
"{",
"$",
"userFolder",
"=",
"Str",
"::",
"normalizePath",
"(",
"config",
"(",
"'cripfilesys.user_folder'",
")",
")",
";",
"if",
"(",
"$",
"userFolder",
"!==",
"''",
"&&",
"!",
"starts_wi... | Set current blob path property.
@param string $path
@return Blob $this | [
"Set",
"current",
"blob",
"path",
"property",
"."
] | 43c66929a5a16772dbb3bae4b5188bdc10b6f9ec | https://github.com/crip-laravel/filesys/blob/43c66929a5a16772dbb3bae4b5188bdc10b6f9ec/src/Services/Blob.php#L49-L61 |
226,073 | crip-laravel/filesys | src/Services/Blob.php | Blob.getMediaType | public function getMediaType()
{
$mime = $this->getMime();
if ($mime == 'file') {
return $mime;
}
foreach ($this->package->config('mime.media') as $mediaType => $mimes) {
if (in_array($mime, $mimes)) {
return $mediaType;
}
... | php | public function getMediaType()
{
$mime = $this->getMime();
if ($mime == 'file') {
return $mime;
}
foreach ($this->package->config('mime.media') as $mediaType => $mimes) {
if (in_array($mime, $mimes)) {
return $mediaType;
}
... | [
"public",
"function",
"getMediaType",
"(",
")",
"{",
"$",
"mime",
"=",
"$",
"this",
"->",
"getMime",
"(",
")",
";",
"if",
"(",
"$",
"mime",
"==",
"'file'",
")",
"{",
"return",
"$",
"mime",
";",
"}",
"foreach",
"(",
"$",
"this",
"->",
"package",
"... | Get blob media type.
@return string | [
"Get",
"blob",
"media",
"type",
"."
] | 43c66929a5a16772dbb3bae4b5188bdc10b6f9ec | https://github.com/crip-laravel/filesys/blob/43c66929a5a16772dbb3bae4b5188bdc10b6f9ec/src/Services/Blob.php#L96-L111 |
226,074 | crip-laravel/filesys | src/Services/Blob.php | Blob.getThumbUrl | public function getThumbUrl($size = 'thumb')
{
$url = $this->package->config('icons.url');
$icons = $this->package->config('icons.files');
if (!$this->metadata->isFile()) {
return $url . $icons['dir'];
}
if ($this->isImage()) {
$thumbs = $this->getTh... | php | public function getThumbUrl($size = 'thumb')
{
$url = $this->package->config('icons.url');
$icons = $this->package->config('icons.files');
if (!$this->metadata->isFile()) {
return $url . $icons['dir'];
}
if ($this->isImage()) {
$thumbs = $this->getTh... | [
"public",
"function",
"getThumbUrl",
"(",
"$",
"size",
"=",
"'thumb'",
")",
"{",
"$",
"url",
"=",
"$",
"this",
"->",
"package",
"->",
"config",
"(",
"'icons.url'",
")",
";",
"$",
"icons",
"=",
"$",
"this",
"->",
"package",
"->",
"config",
"(",
"'icon... | Get 'thumb' size thumbnail url.
@param string $size
@return string
@throws \Exception | [
"Get",
"thumb",
"size",
"thumbnail",
"url",
"."
] | 43c66929a5a16772dbb3bae4b5188bdc10b6f9ec | https://github.com/crip-laravel/filesys/blob/43c66929a5a16772dbb3bae4b5188bdc10b6f9ec/src/Services/Blob.php#L119-L145 |
226,075 | crip-laravel/filesys | src/Services/Blob.php | Blob.getUrl | public function getUrl($path = null)
{
$path = $path ?: $this->path;
if ($this->package->config('public_storage', false)) {
// If file has public access enabled, we simply can try return storage
// url to file.
try {
$useAbsolute = $this->package-... | php | public function getUrl($path = null)
{
$path = $path ?: $this->path;
if ($this->package->config('public_storage', false)) {
// If file has public access enabled, we simply can try return storage
// url to file.
try {
$useAbsolute = $this->package-... | [
"public",
"function",
"getUrl",
"(",
"$",
"path",
"=",
"null",
")",
"{",
"$",
"path",
"=",
"$",
"path",
"?",
":",
"$",
"this",
"->",
"path",
";",
"if",
"(",
"$",
"this",
"->",
"package",
"->",
"config",
"(",
"'public_storage'",
",",
"false",
")",
... | Generates url to a file.
@param null $path
@return string | [
"Generates",
"url",
"to",
"a",
"file",
"."
] | 43c66929a5a16772dbb3bae4b5188bdc10b6f9ec | https://github.com/crip-laravel/filesys/blob/43c66929a5a16772dbb3bae4b5188bdc10b6f9ec/src/Services/Blob.php#L162-L190 |
226,076 | crip-laravel/filesys | src/Services/Blob.php | Blob.getMime | public function getMime()
{
if ($this->metadata->isFile()) {
$mimes = $this->package->config('mime.types');
foreach ($mimes as $mime => $mimeValues) {
$key = collect($mimeValues)->search(function ($mimeValue) {
return preg_match($mimeValue, $this->... | php | public function getMime()
{
if ($this->metadata->isFile()) {
$mimes = $this->package->config('mime.types');
foreach ($mimes as $mime => $mimeValues) {
$key = collect($mimeValues)->search(function ($mimeValue) {
return preg_match($mimeValue, $this->... | [
"public",
"function",
"getMime",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"metadata",
"->",
"isFile",
"(",
")",
")",
"{",
"$",
"mimes",
"=",
"$",
"this",
"->",
"package",
"->",
"config",
"(",
"'mime.types'",
")",
";",
"foreach",
"(",
"$",
"mime... | Get blob mime.
@return int|string | [
"Get",
"blob",
"mime",
"."
] | 43c66929a5a16772dbb3bae4b5188bdc10b6f9ec | https://github.com/crip-laravel/filesys/blob/43c66929a5a16772dbb3bae4b5188bdc10b6f9ec/src/Services/Blob.php#L196-L214 |
226,077 | crip-laravel/filesys | src/Services/Blob.php | Blob.isImage | private function isImage()
{
if ($this->metadata->isFile() &&
mb_strpos($this->metadata->getMimeType(), 'image/') === 0
) {
return true;
}
return false;
} | php | private function isImage()
{
if ($this->metadata->isFile() &&
mb_strpos($this->metadata->getMimeType(), 'image/') === 0
) {
return true;
}
return false;
} | [
"private",
"function",
"isImage",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"metadata",
"->",
"isFile",
"(",
")",
"&&",
"mb_strpos",
"(",
"$",
"this",
"->",
"metadata",
"->",
"getMimeType",
"(",
")",
",",
"'image/'",
")",
"===",
"0",
")",
"{",
"... | Determines is the current blob an image.
@return bool | [
"Determines",
"is",
"the",
"current",
"blob",
"an",
"image",
"."
] | 43c66929a5a16772dbb3bae4b5188bdc10b6f9ec | https://github.com/crip-laravel/filesys/blob/43c66929a5a16772dbb3bae4b5188bdc10b6f9ec/src/Services/Blob.php#L233-L242 |
226,078 | crip-laravel/filesys | src/Services/Blob.php | Blob.setThumbsDetails | private function setThumbsDetails()
{
$this->thumbsDetails = [];
if ($this->isImage()) {
$service = new ThumbService($this->package);
collect($service->getSizes())->each(function ($size, $key) {
$this->thumbsDetails[$key] = [
'size' => $key... | php | private function setThumbsDetails()
{
$this->thumbsDetails = [];
if ($this->isImage()) {
$service = new ThumbService($this->package);
collect($service->getSizes())->each(function ($size, $key) {
$this->thumbsDetails[$key] = [
'size' => $key... | [
"private",
"function",
"setThumbsDetails",
"(",
")",
"{",
"$",
"this",
"->",
"thumbsDetails",
"=",
"[",
"]",
";",
"if",
"(",
"$",
"this",
"->",
"isImage",
"(",
")",
")",
"{",
"$",
"service",
"=",
"new",
"ThumbService",
"(",
"$",
"this",
"->",
"packag... | Set thumb sizes details for current file. | [
"Set",
"thumb",
"sizes",
"details",
"for",
"current",
"file",
"."
] | 43c66929a5a16772dbb3bae4b5188bdc10b6f9ec | https://github.com/crip-laravel/filesys/blob/43c66929a5a16772dbb3bae4b5188bdc10b6f9ec/src/Services/Blob.php#L247-L261 |
226,079 | adamgoose/laravel-annotations | src/Adamgoose/AnnotationsServiceProvider.php | AnnotationsServiceProvider.loadAnnotatedRoutes | protected function loadAnnotatedRoutes()
{
if ($this->app->environment('local') && $this->scanWhenLocal)
{
$this->scanRoutes();
}
if ( ! empty($this->scanRoutes) && $this->finder->routesAreScanned())
{
$this->loadScannedRoutes();
}
} | php | protected function loadAnnotatedRoutes()
{
if ($this->app->environment('local') && $this->scanWhenLocal)
{
$this->scanRoutes();
}
if ( ! empty($this->scanRoutes) && $this->finder->routesAreScanned())
{
$this->loadScannedRoutes();
}
} | [
"protected",
"function",
"loadAnnotatedRoutes",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"app",
"->",
"environment",
"(",
"'local'",
")",
"&&",
"$",
"this",
"->",
"scanWhenLocal",
")",
"{",
"$",
"this",
"->",
"scanRoutes",
"(",
")",
";",
"}",
"if",... | Load the annotated routes
@return void | [
"Load",
"the",
"annotated",
"routes"
] | 0a8445508d5d3aeb08e42d0bb357373b522da28e | https://github.com/adamgoose/laravel-annotations/blob/0a8445508d5d3aeb08e42d0bb357373b522da28e/src/Adamgoose/AnnotationsServiceProvider.php#L180-L191 |
226,080 | progsmile/request-validator | src/Helpers/ValidatorFacade.php | ValidatorFacade.messages | public function messages($field = '')
{
if ($field) {
return isset($this->errorMessages[$field]) ? $this->errorMessages[$field] : [];
}
$messages = [];
array_walk_recursive($this->errorMessages, function ($message) use (&$messages) {
$messages[] = $message;
... | php | public function messages($field = '')
{
if ($field) {
return isset($this->errorMessages[$field]) ? $this->errorMessages[$field] : [];
}
$messages = [];
array_walk_recursive($this->errorMessages, function ($message) use (&$messages) {
$messages[] = $message;
... | [
"public",
"function",
"messages",
"(",
"$",
"field",
"=",
"''",
")",
"{",
"if",
"(",
"$",
"field",
")",
"{",
"return",
"isset",
"(",
"$",
"this",
"->",
"errorMessages",
"[",
"$",
"field",
"]",
")",
"?",
"$",
"this",
"->",
"errorMessages",
"[",
"$",... | Get flat messages array, or all messages from field.
@param string $field
@return array | [
"Get",
"flat",
"messages",
"array",
"or",
"all",
"messages",
"from",
"field",
"."
] | f211abd1a8e7c67030401f8c4896d926da7dafef | https://github.com/progsmile/request-validator/blob/f211abd1a8e7c67030401f8c4896d926da7dafef/src/Helpers/ValidatorFacade.php#L71-L84 |
226,081 | progsmile/request-validator | src/Helpers/ValidatorFacade.php | ValidatorFacade.firsts | public function firsts()
{
$messages = [];
foreach ($this->errorMessages as $fieldsMessages) {
foreach ($fieldsMessages as $fieldMessage) {
$messages[] = $fieldMessage;
break;
}
}
return $messages;
} | php | public function firsts()
{
$messages = [];
foreach ($this->errorMessages as $fieldsMessages) {
foreach ($fieldsMessages as $fieldMessage) {
$messages[] = $fieldMessage;
break;
}
}
return $messages;
} | [
"public",
"function",
"firsts",
"(",
")",
"{",
"$",
"messages",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"errorMessages",
"as",
"$",
"fieldsMessages",
")",
"{",
"foreach",
"(",
"$",
"fieldsMessages",
"as",
"$",
"fieldMessage",
")",
"{",
"... | For each rule get it's first message.
@return array | [
"For",
"each",
"rule",
"get",
"it",
"s",
"first",
"message",
"."
] | f211abd1a8e7c67030401f8c4896d926da7dafef | https://github.com/progsmile/request-validator/blob/f211abd1a8e7c67030401f8c4896d926da7dafef/src/Helpers/ValidatorFacade.php#L101-L112 |
226,082 | jagilpe/encryption-bundle | Service/EncryptionService.php | EncryptionService.isPerUserEncryptionEnabled | public function isPerUserEncryptionEnabled()
{
$perUserEncryptionEnabled = false;
if ($this->settings['per_user_encryption_enabled']) {
$encryptionMetadata = $this->metadataFactory->getAllMetadata();
/** @var ClassMetadata $classEncryptionMetadata */
foreach ($en... | php | public function isPerUserEncryptionEnabled()
{
$perUserEncryptionEnabled = false;
if ($this->settings['per_user_encryption_enabled']) {
$encryptionMetadata = $this->metadataFactory->getAllMetadata();
/** @var ClassMetadata $classEncryptionMetadata */
foreach ($en... | [
"public",
"function",
"isPerUserEncryptionEnabled",
"(",
")",
"{",
"$",
"perUserEncryptionEnabled",
"=",
"false",
";",
"if",
"(",
"$",
"this",
"->",
"settings",
"[",
"'per_user_encryption_enabled'",
"]",
")",
"{",
"$",
"encryptionMetadata",
"=",
"$",
"this",
"->... | Checks if the Per User Encryption must be enabled
@return bool | [
"Checks",
"if",
"the",
"Per",
"User",
"Encryption",
"must",
"be",
"enabled"
] | 1e1ba13a3cc646b36e3407822f2e8339c5671f47 | https://github.com/jagilpe/encryption-bundle/blob/1e1ba13a3cc646b36e3407822f2e8339c5671f47/Service/EncryptionService.php#L118-L134 |
226,083 | jagilpe/encryption-bundle | Service/EncryptionService.php | EncryptionService.getEncryptionEnabledEntitiesMetadata | public function getEncryptionEnabledEntitiesMetadata()
{
$entityManager = $this->doctrine->getManager();
$doctrineMetadataFactory = $entityManager->getMetadataFactory();
$encryptedEnabledTypes = array();
$encryptionMetadata = $this->metadataFactory->getAllMetadata();
/** @va... | php | public function getEncryptionEnabledEntitiesMetadata()
{
$entityManager = $this->doctrine->getManager();
$doctrineMetadataFactory = $entityManager->getMetadataFactory();
$encryptedEnabledTypes = array();
$encryptionMetadata = $this->metadataFactory->getAllMetadata();
/** @va... | [
"public",
"function",
"getEncryptionEnabledEntitiesMetadata",
"(",
")",
"{",
"$",
"entityManager",
"=",
"$",
"this",
"->",
"doctrine",
"->",
"getManager",
"(",
")",
";",
"$",
"doctrineMetadataFactory",
"=",
"$",
"entityManager",
"->",
"getMetadataFactory",
"(",
")... | Returns the doctrine metadata of all the encryption enabled entities
@return array | [
"Returns",
"the",
"doctrine",
"metadata",
"of",
"all",
"the",
"encryption",
"enabled",
"entities"
] | 1e1ba13a3cc646b36e3407822f2e8339c5671f47 | https://github.com/jagilpe/encryption-bundle/blob/1e1ba13a3cc646b36e3407822f2e8339c5671f47/Service/EncryptionService.php#L141-L157 |
226,084 | jagilpe/encryption-bundle | Service/EncryptionService.php | EncryptionService.addEncryptionMetadata | public function addEncryptionMetadata(DoctrineClassMetadata $metadata)
{
if ($metadata->isMappedSuperclass) {
return;
}
$reflection = $metadata->getReflectionClass();
if ($this->hasEncryptionEnabled($reflection) && !$this->hasEncryptionFieldsDoctrineMetadata($metadata)) ... | php | public function addEncryptionMetadata(DoctrineClassMetadata $metadata)
{
if ($metadata->isMappedSuperclass) {
return;
}
$reflection = $metadata->getReflectionClass();
if ($this->hasEncryptionEnabled($reflection) && !$this->hasEncryptionFieldsDoctrineMetadata($metadata)) ... | [
"public",
"function",
"addEncryptionMetadata",
"(",
"DoctrineClassMetadata",
"$",
"metadata",
")",
"{",
"if",
"(",
"$",
"metadata",
"->",
"isMappedSuperclass",
")",
"{",
"return",
";",
"}",
"$",
"reflection",
"=",
"$",
"metadata",
"->",
"getReflectionClass",
"("... | Adds the metadata required to encrypt the doctrine entity
@param DoctrineClassMetadata $metadata
@return DoctrineClassMetadata | [
"Adds",
"the",
"metadata",
"required",
"to",
"encrypt",
"the",
"doctrine",
"entity"
] | 1e1ba13a3cc646b36e3407822f2e8339c5671f47 | https://github.com/jagilpe/encryption-bundle/blob/1e1ba13a3cc646b36e3407822f2e8339c5671f47/Service/EncryptionService.php#L165-L244 |
226,085 | jagilpe/encryption-bundle | Service/EncryptionService.php | EncryptionService.processEntityPostPersist | public function processEntityPostPersist($entity)
{
$userClasses = $this->settings['user_classes'];
foreach ($userClasses as $userClass) {
if (class_exists($userClass) && $entity instanceof $userClass) {
$relatedEntities = $this->getUserRelatedEntities($entity);
... | php | public function processEntityPostPersist($entity)
{
$userClasses = $this->settings['user_classes'];
foreach ($userClasses as $userClass) {
if (class_exists($userClass) && $entity instanceof $userClass) {
$relatedEntities = $this->getUserRelatedEntities($entity);
... | [
"public",
"function",
"processEntityPostPersist",
"(",
"$",
"entity",
")",
"{",
"$",
"userClasses",
"=",
"$",
"this",
"->",
"settings",
"[",
"'user_classes'",
"]",
";",
"foreach",
"(",
"$",
"userClasses",
"as",
"$",
"userClass",
")",
"{",
"if",
"(",
"class... | Process all encryption related actions on an Entity post persist event
@param mixed $entity
@return mixed | [
"Process",
"all",
"encryption",
"related",
"actions",
"on",
"an",
"Entity",
"post",
"persist",
"event"
] | 1e1ba13a3cc646b36e3407822f2e8339c5671f47 | https://github.com/jagilpe/encryption-bundle/blob/1e1ba13a3cc646b36e3407822f2e8339c5671f47/Service/EncryptionService.php#L265-L285 |
226,086 | jagilpe/encryption-bundle | Service/EncryptionService.php | EncryptionService.processEntityMigration | public function processEntityMigration($entity)
{
if ($entity) {
$reflection = ClassUtils::newReflectionObject($entity);
if ($this->hasEncryptionEnabled($reflection) && !$entity->isEncrypted()) {
$encryptionEnabledFields = $this->getEncryptionEnabledFields($reflection... | php | public function processEntityMigration($entity)
{
if ($entity) {
$reflection = ClassUtils::newReflectionObject($entity);
if ($this->hasEncryptionEnabled($reflection) && !$entity->isEncrypted()) {
$encryptionEnabledFields = $this->getEncryptionEnabledFields($reflection... | [
"public",
"function",
"processEntityMigration",
"(",
"$",
"entity",
")",
"{",
"if",
"(",
"$",
"entity",
")",
"{",
"$",
"reflection",
"=",
"ClassUtils",
"::",
"newReflectionObject",
"(",
"$",
"entity",
")",
";",
"if",
"(",
"$",
"this",
"->",
"hasEncryptionE... | Normalizes the data of the entity fields to the one required by the encryption
after the encryption has been activated
@param mixed $entity | [
"Normalizes",
"the",
"data",
"of",
"the",
"entity",
"fields",
"to",
"the",
"one",
"required",
"by",
"the",
"encryption",
"after",
"the",
"encryption",
"has",
"been",
"activated"
] | 1e1ba13a3cc646b36e3407822f2e8339c5671f47 | https://github.com/jagilpe/encryption-bundle/blob/1e1ba13a3cc646b36e3407822f2e8339c5671f47/Service/EncryptionService.php#L375-L393 |
226,087 | jagilpe/encryption-bundle | Service/EncryptionService.php | EncryptionService.isEncryptableFile | private function isEncryptableFile($entity)
{
$reflection = ClassUtils::newReflectionObject($entity);
$classMetadata = $this->getEncryptionMetadataFor($reflection->getName());
return $classMetadata->encryptionEnabled && $classMetadata->encryptedFile;
} | php | private function isEncryptableFile($entity)
{
$reflection = ClassUtils::newReflectionObject($entity);
$classMetadata = $this->getEncryptionMetadataFor($reflection->getName());
return $classMetadata->encryptionEnabled && $classMetadata->encryptedFile;
} | [
"private",
"function",
"isEncryptableFile",
"(",
"$",
"entity",
")",
"{",
"$",
"reflection",
"=",
"ClassUtils",
"::",
"newReflectionObject",
"(",
"$",
"entity",
")",
";",
"$",
"classMetadata",
"=",
"$",
"this",
"->",
"getEncryptionMetadataFor",
"(",
"$",
"refl... | Checks if the entity has file encryption enabled
@param mixed $entity
@return boolean | [
"Checks",
"if",
"the",
"entity",
"has",
"file",
"encryption",
"enabled"
] | 1e1ba13a3cc646b36e3407822f2e8339c5671f47 | https://github.com/jagilpe/encryption-bundle/blob/1e1ba13a3cc646b36e3407822f2e8339c5671f47/Service/EncryptionService.php#L402-L408 |
226,088 | jagilpe/encryption-bundle | Service/EncryptionService.php | EncryptionService.processEntity | private function processEntity($entity, $operation)
{
if ($this->settings[$operation.'_on_backend']) {
$reflection = ClassUtils::newReflectionObject($entity);
$classMetadata = $this->getEncryptionMetadataFor($reflection->getName());
if ($classMetadata->encryptionEnabled ... | php | private function processEntity($entity, $operation)
{
if ($this->settings[$operation.'_on_backend']) {
$reflection = ClassUtils::newReflectionObject($entity);
$classMetadata = $this->getEncryptionMetadataFor($reflection->getName());
if ($classMetadata->encryptionEnabled ... | [
"private",
"function",
"processEntity",
"(",
"$",
"entity",
",",
"$",
"operation",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"settings",
"[",
"$",
"operation",
".",
"'_on_backend'",
"]",
")",
"{",
"$",
"reflection",
"=",
"ClassUtils",
"::",
"newReflectionObj... | Processes an entity if it has encryption enabled and it's not already processed
@param mixed $entity
@param string $operation
@return mixed | [
"Processes",
"an",
"entity",
"if",
"it",
"has",
"encryption",
"enabled",
"and",
"it",
"s",
"not",
"already",
"processed"
] | 1e1ba13a3cc646b36e3407822f2e8339c5671f47 | https://github.com/jagilpe/encryption-bundle/blob/1e1ba13a3cc646b36e3407822f2e8339c5671f47/Service/EncryptionService.php#L418-L450 |
226,089 | jagilpe/encryption-bundle | Service/EncryptionService.php | EncryptionService.encryptFile | private function encryptFile(EncryptableFile $fileEntity, KeyData $keyData)
{
$file = $fileEntity->getFile();
$encrypt = false;
if ($file) {
$filePath = $file->getRealPath();
$encrypt = true;
} elseif ($fileEntity->getId() && $fileEntity->fileExists() && !$fi... | php | private function encryptFile(EncryptableFile $fileEntity, KeyData $keyData)
{
$file = $fileEntity->getFile();
$encrypt = false;
if ($file) {
$filePath = $file->getRealPath();
$encrypt = true;
} elseif ($fileEntity->getId() && $fileEntity->fileExists() && !$fi... | [
"private",
"function",
"encryptFile",
"(",
"EncryptableFile",
"$",
"fileEntity",
",",
"KeyData",
"$",
"keyData",
")",
"{",
"$",
"file",
"=",
"$",
"fileEntity",
"->",
"getFile",
"(",
")",
";",
"$",
"encrypt",
"=",
"false",
";",
"if",
"(",
"$",
"file",
"... | Encrypts the uploaded file contained in a File Entity
@param EncryptableFile $fileEntity
@param KeyData $keyData | [
"Encrypts",
"the",
"uploaded",
"file",
"contained",
"in",
"a",
"File",
"Entity"
] | 1e1ba13a3cc646b36e3407822f2e8339c5671f47 | https://github.com/jagilpe/encryption-bundle/blob/1e1ba13a3cc646b36e3407822f2e8339c5671f47/Service/EncryptionService.php#L458-L484 |
226,090 | jagilpe/encryption-bundle | Service/EncryptionService.php | EncryptionService.decryptFile | private function decryptFile($fileEntity, KeyData $keyData)
{
if ($keyData) {
$encryptedContent = $fileEntity->getContent();
if ($encryptedContent) {
$encType = CryptographyProviderInterface::FILE_ENCRYPTION;
$decryptedContent = $this->cryptographyProv... | php | private function decryptFile($fileEntity, KeyData $keyData)
{
if ($keyData) {
$encryptedContent = $fileEntity->getContent();
if ($encryptedContent) {
$encType = CryptographyProviderInterface::FILE_ENCRYPTION;
$decryptedContent = $this->cryptographyProv... | [
"private",
"function",
"decryptFile",
"(",
"$",
"fileEntity",
",",
"KeyData",
"$",
"keyData",
")",
"{",
"if",
"(",
"$",
"keyData",
")",
"{",
"$",
"encryptedContent",
"=",
"$",
"fileEntity",
"->",
"getContent",
"(",
")",
";",
"if",
"(",
"$",
"encryptedCon... | Decrpyts the content of a file associated with an Encryptable File Entity
@param mixed $fileEntity
@param KeyData $keyData | [
"Decrpyts",
"the",
"content",
"of",
"a",
"file",
"associated",
"with",
"an",
"Encryptable",
"File",
"Entity"
] | 1e1ba13a3cc646b36e3407822f2e8339c5671f47 | https://github.com/jagilpe/encryption-bundle/blob/1e1ba13a3cc646b36e3407822f2e8339c5671f47/Service/EncryptionService.php#L492-L503 |
226,091 | jagilpe/encryption-bundle | Service/EncryptionService.php | EncryptionService.hasEncryptionEnabled | public function hasEncryptionEnabled(\ReflectionClass $reflection, DoctrineClassMetadata $metadata = null)
{
$classMetadata = $this->getEncryptionMetadataFor($reflection->getName());
return $classMetadata->encryptionEnabled;
} | php | public function hasEncryptionEnabled(\ReflectionClass $reflection, DoctrineClassMetadata $metadata = null)
{
$classMetadata = $this->getEncryptionMetadataFor($reflection->getName());
return $classMetadata->encryptionEnabled;
} | [
"public",
"function",
"hasEncryptionEnabled",
"(",
"\\",
"ReflectionClass",
"$",
"reflection",
",",
"DoctrineClassMetadata",
"$",
"metadata",
"=",
"null",
")",
"{",
"$",
"classMetadata",
"=",
"$",
"this",
"->",
"getEncryptionMetadataFor",
"(",
"$",
"reflection",
"... | Checks if the class has been enabled for encryption
@param \ReflectionClass $reflection
@param \Doctrine\ORM\Mapping\ClassMetadata $metadata
@return boolean | [
"Checks",
"if",
"the",
"class",
"has",
"been",
"enabled",
"for",
"encryption"
] | 1e1ba13a3cc646b36e3407822f2e8339c5671f47 | https://github.com/jagilpe/encryption-bundle/blob/1e1ba13a3cc646b36e3407822f2e8339c5671f47/Service/EncryptionService.php#L553-L557 |
226,092 | jagilpe/encryption-bundle | Service/EncryptionService.php | EncryptionService.hasFileEncryptionEnabled | private function hasFileEncryptionEnabled(\ReflectionClass $reflection)
{
$classMetadata = $this->getEncryptionMetadataFor($reflection->getName());
return $classMetadata->encryptionEnabled && $classMetadata->encryptedFile;
} | php | private function hasFileEncryptionEnabled(\ReflectionClass $reflection)
{
$classMetadata = $this->getEncryptionMetadataFor($reflection->getName());
return $classMetadata->encryptionEnabled && $classMetadata->encryptedFile;
} | [
"private",
"function",
"hasFileEncryptionEnabled",
"(",
"\\",
"ReflectionClass",
"$",
"reflection",
")",
"{",
"$",
"classMetadata",
"=",
"$",
"this",
"->",
"getEncryptionMetadataFor",
"(",
"$",
"reflection",
"->",
"getName",
"(",
")",
")",
";",
"return",
"$",
... | Checks if the class is a File entity and has the file encryption enabled
@param \ReflectionClass $reflection
@return boolean | [
"Checks",
"if",
"the",
"class",
"is",
"a",
"File",
"entity",
"and",
"has",
"the",
"file",
"encryption",
"enabled"
] | 1e1ba13a3cc646b36e3407822f2e8339c5671f47 | https://github.com/jagilpe/encryption-bundle/blob/1e1ba13a3cc646b36e3407822f2e8339c5671f47/Service/EncryptionService.php#L565-L569 |
226,093 | jagilpe/encryption-bundle | Service/EncryptionService.php | EncryptionService.keyPerEntityRequired | private function keyPerEntityRequired(\ReflectionClass $reflectionClass)
{
$classMetadata = $this->getEncryptionMetadataFor($reflectionClass->getName());
$keyPerEntityModes = array(
EncryptionService::MODE_PER_USER_SHAREABLE,
EncryptionService::MODE_SYSTEM_ENCRYPTION,
... | php | private function keyPerEntityRequired(\ReflectionClass $reflectionClass)
{
$classMetadata = $this->getEncryptionMetadataFor($reflectionClass->getName());
$keyPerEntityModes = array(
EncryptionService::MODE_PER_USER_SHAREABLE,
EncryptionService::MODE_SYSTEM_ENCRYPTION,
... | [
"private",
"function",
"keyPerEntityRequired",
"(",
"\\",
"ReflectionClass",
"$",
"reflectionClass",
")",
"{",
"$",
"classMetadata",
"=",
"$",
"this",
"->",
"getEncryptionMetadataFor",
"(",
"$",
"reflectionClass",
"->",
"getName",
"(",
")",
")",
";",
"$",
"keyPe... | Checks if the entity needs a field to store a key for each instance
@param \ReflectionClass $reflectionClass
@return boolean | [
"Checks",
"if",
"the",
"entity",
"needs",
"a",
"field",
"to",
"store",
"a",
"key",
"for",
"each",
"instance"
] | 1e1ba13a3cc646b36e3407822f2e8339c5671f47 | https://github.com/jagilpe/encryption-bundle/blob/1e1ba13a3cc646b36e3407822f2e8339c5671f47/Service/EncryptionService.php#L578-L589 |
226,094 | jagilpe/encryption-bundle | Service/EncryptionService.php | EncryptionService.getEncryptionEnabledFields | public function getEncryptionEnabledFields(\ReflectionClass $reflectionClass)
{
$encryptionEnabledFields = array();
$classMetadata = $this->getEncryptionMetadataFor($reflectionClass->getName());
if ($classMetadata->encryptionEnabled) {
/** @var PropertyMetadata $propertyMetadat... | php | public function getEncryptionEnabledFields(\ReflectionClass $reflectionClass)
{
$encryptionEnabledFields = array();
$classMetadata = $this->getEncryptionMetadataFor($reflectionClass->getName());
if ($classMetadata->encryptionEnabled) {
/** @var PropertyMetadata $propertyMetadat... | [
"public",
"function",
"getEncryptionEnabledFields",
"(",
"\\",
"ReflectionClass",
"$",
"reflectionClass",
")",
"{",
"$",
"encryptionEnabledFields",
"=",
"array",
"(",
")",
";",
"$",
"classMetadata",
"=",
"$",
"this",
"->",
"getEncryptionMetadataFor",
"(",
"$",
"re... | Checks the fields of the entity and returns a list of those with encryption enabled
@param \ReflectionClass $reflectionClass
@return array | [
"Checks",
"the",
"fields",
"of",
"the",
"entity",
"and",
"returns",
"a",
"list",
"of",
"those",
"with",
"encryption",
"enabled"
] | 1e1ba13a3cc646b36e3407822f2e8339c5671f47 | https://github.com/jagilpe/encryption-bundle/blob/1e1ba13a3cc646b36e3407822f2e8339c5671f47/Service/EncryptionService.php#L598-L615 |
226,095 | jagilpe/encryption-bundle | Service/EncryptionService.php | EncryptionService.getFieldValue | private function getFieldValue($entity, \ReflectionProperty $reflectionProperty)
{
$value = null;
if ($reflectionProperty) {
$reflectionProperty->setAccessible(true);
$value = $reflectionProperty->getValue($entity);
}
return $value;
} | php | private function getFieldValue($entity, \ReflectionProperty $reflectionProperty)
{
$value = null;
if ($reflectionProperty) {
$reflectionProperty->setAccessible(true);
$value = $reflectionProperty->getValue($entity);
}
return $value;
} | [
"private",
"function",
"getFieldValue",
"(",
"$",
"entity",
",",
"\\",
"ReflectionProperty",
"$",
"reflectionProperty",
")",
"{",
"$",
"value",
"=",
"null",
";",
"if",
"(",
"$",
"reflectionProperty",
")",
"{",
"$",
"reflectionProperty",
"->",
"setAccessible",
... | Returns the value of an entity using reflection
@param mixed $entity
@param \ReflectionProperty $reflectionProperty
@return mixed | [
"Returns",
"the",
"value",
"of",
"an",
"entity",
"using",
"reflection"
] | 1e1ba13a3cc646b36e3407822f2e8339c5671f47 | https://github.com/jagilpe/encryption-bundle/blob/1e1ba13a3cc646b36e3407822f2e8339c5671f47/Service/EncryptionService.php#L625-L634 |
226,096 | jagilpe/encryption-bundle | Service/EncryptionService.php | EncryptionService.setFieldValue | private function setFieldValue($entity, \ReflectionProperty $reflectionProperty, $value)
{
if ($reflectionProperty) {
$reflectionProperty->setAccessible(true);
$value = $reflectionProperty->setValue($entity, $value);
}
} | php | private function setFieldValue($entity, \ReflectionProperty $reflectionProperty, $value)
{
if ($reflectionProperty) {
$reflectionProperty->setAccessible(true);
$value = $reflectionProperty->setValue($entity, $value);
}
} | [
"private",
"function",
"setFieldValue",
"(",
"$",
"entity",
",",
"\\",
"ReflectionProperty",
"$",
"reflectionProperty",
",",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"reflectionProperty",
")",
"{",
"$",
"reflectionProperty",
"->",
"setAccessible",
"(",
"true",
... | Sets the value of an entity using reflection
@param mixed $entity
@param \ReflectionProperty $reflectionProperty
@param mixed $value | [
"Sets",
"the",
"value",
"of",
"an",
"entity",
"using",
"reflection"
] | 1e1ba13a3cc646b36e3407822f2e8339c5671f47 | https://github.com/jagilpe/encryption-bundle/blob/1e1ba13a3cc646b36e3407822f2e8339c5671f47/Service/EncryptionService.php#L643-L649 |
226,097 | jagilpe/encryption-bundle | Service/EncryptionService.php | EncryptionService.getEncryptedFieldMapping | private function getEncryptedFieldMapping(array $fieldMapping)
{
switch($fieldMapping['type']) {
case 'string':
return new FieldMapping\StringFieldMapping($this, $fieldMapping);
case 'text':
case 'json_array':
case 'simple_array':
c... | php | private function getEncryptedFieldMapping(array $fieldMapping)
{
switch($fieldMapping['type']) {
case 'string':
return new FieldMapping\StringFieldMapping($this, $fieldMapping);
case 'text':
case 'json_array':
case 'simple_array':
c... | [
"private",
"function",
"getEncryptedFieldMapping",
"(",
"array",
"$",
"fieldMapping",
")",
"{",
"switch",
"(",
"$",
"fieldMapping",
"[",
"'type'",
"]",
")",
"{",
"case",
"'string'",
":",
"return",
"new",
"FieldMapping",
"\\",
"StringFieldMapping",
"(",
"$",
"t... | Factory method to get the right EncryptedFieldMapping object for a determined field
@param array $fieldMapping
@return \Jagilpe\EncryptionBundle\Crypt\FieldMapping\EncryptedFieldMappingInterface
@throws EncryptionException | [
"Factory",
"method",
"to",
"get",
"the",
"right",
"EncryptedFieldMapping",
"object",
"for",
"a",
"determined",
"field"
] | 1e1ba13a3cc646b36e3407822f2e8339c5671f47 | https://github.com/jagilpe/encryption-bundle/blob/1e1ba13a3cc646b36e3407822f2e8339c5671f47/Service/EncryptionService.php#L660-L684 |
226,098 | jagilpe/encryption-bundle | Service/EncryptionService.php | EncryptionService.getFieldEncrypter | private function getFieldEncrypter(\ReflectionProperty $reflectionProperty, \ReflectionClass $reflectionClass)
{
$classMetadata = $this->doctrine->getManager()->getMetadataFactory()->getMetadataFor($reflectionClass->getName());
$fieldName = $reflectionProperty->getName();
$fieldMapping = $c... | php | private function getFieldEncrypter(\ReflectionProperty $reflectionProperty, \ReflectionClass $reflectionClass)
{
$classMetadata = $this->doctrine->getManager()->getMetadataFactory()->getMetadataFor($reflectionClass->getName());
$fieldName = $reflectionProperty->getName();
$fieldMapping = $c... | [
"private",
"function",
"getFieldEncrypter",
"(",
"\\",
"ReflectionProperty",
"$",
"reflectionProperty",
",",
"\\",
"ReflectionClass",
"$",
"reflectionClass",
")",
"{",
"$",
"classMetadata",
"=",
"$",
"this",
"->",
"doctrine",
"->",
"getManager",
"(",
")",
"->",
... | Factory method to get the right EncryptedFieldEncrypter object for a determined field
@param \ReflectionProperty $reflectionProperty
@param \ReflectionClass $reflectionClass
@return \Jagilpe\EncryptionBundle\Crypt\FieldEncrypter\EncryptedFieldEncrypterInterface
@throws EncryptionException | [
"Factory",
"method",
"to",
"get",
"the",
"right",
"EncryptedFieldEncrypter",
"object",
"for",
"a",
"determined",
"field"
] | 1e1ba13a3cc646b36e3407822f2e8339c5671f47 | https://github.com/jagilpe/encryption-bundle/blob/1e1ba13a3cc646b36e3407822f2e8339c5671f47/Service/EncryptionService.php#L696-L743 |
226,099 | jagilpe/encryption-bundle | Service/EncryptionService.php | EncryptionService.getFieldNormalizer | private function getFieldNormalizer(\ReflectionProperty $reflectionProperty, \ReflectionClass $reflectionClass)
{
$classMetadata = $this->doctrine->getManager()->getMetadataFactory()->getMetadataFor($reflectionClass->getName());
$fieldName = $reflectionProperty->getName();
$fieldMapping = $... | php | private function getFieldNormalizer(\ReflectionProperty $reflectionProperty, \ReflectionClass $reflectionClass)
{
$classMetadata = $this->doctrine->getManager()->getMetadataFactory()->getMetadataFor($reflectionClass->getName());
$fieldName = $reflectionProperty->getName();
$fieldMapping = $... | [
"private",
"function",
"getFieldNormalizer",
"(",
"\\",
"ReflectionProperty",
"$",
"reflectionProperty",
",",
"\\",
"ReflectionClass",
"$",
"reflectionClass",
")",
"{",
"$",
"classMetadata",
"=",
"$",
"this",
"->",
"doctrine",
"->",
"getManager",
"(",
")",
"->",
... | Factory method to get the right EncryptedFieldNormalizer object for a determined field
@param \ReflectionProperty $reflectionProperty
@param \ReflectionClass $reflectionClass
@return \Jagilpe\EncryptionBundle\Crypt\FieldNormalizer\EncryptedFieldNormalizerInterface
@throws EncryptionException | [
"Factory",
"method",
"to",
"get",
"the",
"right",
"EncryptedFieldNormalizer",
"object",
"for",
"a",
"determined",
"field"
] | 1e1ba13a3cc646b36e3407822f2e8339c5671f47 | https://github.com/jagilpe/encryption-bundle/blob/1e1ba13a3cc646b36e3407822f2e8339c5671f47/Service/EncryptionService.php#L755-L808 |
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.