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,200 | Techworker/ssml | src/Specification/Alexa.php | Alexa.validatePhoneme | protected function validatePhoneme(Phoneme $phoneme)
{
$alphabet = $phoneme->alphabet;
if (!in_array($alphabet, self::PHONEME_ALPHABETS, true)) {
throw new InvalidAttributeValueException(
$phoneme, 'alphabet', $alphabet, self::PHONEME_ALPHABETS, 'alexa'
);
... | php | protected function validatePhoneme(Phoneme $phoneme)
{
$alphabet = $phoneme->alphabet;
if (!in_array($alphabet, self::PHONEME_ALPHABETS, true)) {
throw new InvalidAttributeValueException(
$phoneme, 'alphabet', $alphabet, self::PHONEME_ALPHABETS, 'alexa'
);
... | [
"protected",
"function",
"validatePhoneme",
"(",
"Phoneme",
"$",
"phoneme",
")",
"{",
"$",
"alphabet",
"=",
"$",
"phoneme",
"->",
"alphabet",
";",
"if",
"(",
"!",
"in_array",
"(",
"$",
"alphabet",
",",
"self",
"::",
"PHONEME_ALPHABETS",
",",
"true",
")",
... | Validates a Phoneme element.
@param Phoneme $phoneme
@throws InvalidAttributeValueException | [
"Validates",
"a",
"Phoneme",
"element",
"."
] | cafb979b777480baf7a01b5db2bf7c2cff837805 | https://github.com/Techworker/ssml/blob/cafb979b777480baf7a01b5db2bf7c2cff837805/src/Specification/Alexa.php#L110-L118 |
226,201 | Techworker/ssml | src/Specification/Alexa.php | Alexa.validateSayAs | protected function validateSayAs(SayAs $sayAs)
{
$interpretAs = $sayAs->interpretAs;
if (!in_array($interpretAs, self::SAY_AS_INTERPRET_AS, true)) {
throw new InvalidAttributeValueException(
$sayAs, 'interpret-as', $interpretAs, self::SAY_AS_INTERPRET_AS, 'alexa'
... | php | protected function validateSayAs(SayAs $sayAs)
{
$interpretAs = $sayAs->interpretAs;
if (!in_array($interpretAs, self::SAY_AS_INTERPRET_AS, true)) {
throw new InvalidAttributeValueException(
$sayAs, 'interpret-as', $interpretAs, self::SAY_AS_INTERPRET_AS, 'alexa'
... | [
"protected",
"function",
"validateSayAs",
"(",
"SayAs",
"$",
"sayAs",
")",
"{",
"$",
"interpretAs",
"=",
"$",
"sayAs",
"->",
"interpretAs",
";",
"if",
"(",
"!",
"in_array",
"(",
"$",
"interpretAs",
",",
"self",
"::",
"SAY_AS_INTERPRET_AS",
",",
"true",
")"... | Validates a SayAs element.
@param SayAs $sayAs
@throws SsmlException | [
"Validates",
"a",
"SayAs",
"element",
"."
] | cafb979b777480baf7a01b5db2bf7c2cff837805 | https://github.com/Techworker/ssml/blob/cafb979b777480baf7a01b5db2bf7c2cff837805/src/Specification/Alexa.php#L126-L145 |
226,202 | Techworker/ssml | src/Specification/Alexa.php | Alexa.validateWord | protected function validateWord(Word $word)
{
$role = $word->role;
if (!in_array($role, self::WORD_ROLES, true)) {
throw new InvalidAttributeValueException(
$word, 'role', $role, self::WORD_ROLES, 'alexa'
);
}
} | php | protected function validateWord(Word $word)
{
$role = $word->role;
if (!in_array($role, self::WORD_ROLES, true)) {
throw new InvalidAttributeValueException(
$word, 'role', $role, self::WORD_ROLES, 'alexa'
);
}
} | [
"protected",
"function",
"validateWord",
"(",
"Word",
"$",
"word",
")",
"{",
"$",
"role",
"=",
"$",
"word",
"->",
"role",
";",
"if",
"(",
"!",
"in_array",
"(",
"$",
"role",
",",
"self",
"::",
"WORD_ROLES",
",",
"true",
")",
")",
"{",
"throw",
"new"... | Validates a Word element.
@param Word $word
@throws SsmlException | [
"Validates",
"a",
"Word",
"element",
"."
] | cafb979b777480baf7a01b5db2bf7c2cff837805 | https://github.com/Techworker/ssml/blob/cafb979b777480baf7a01b5db2bf7c2cff837805/src/Specification/Alexa.php#L153-L161 |
226,203 | sdboyer/gliph | src/Gliph/Traversal/DepthFirst.php | DepthFirst.traverse | public static function traverse(Digraph $graph, DepthFirstVisitorInterface $visitor, $start = NULL) {
if ($start === NULL) {
$queue = self::find_sources($graph, $visitor);
}
else if ($start instanceof \SplDoublyLinkedList) {
$queue = $start;
}
else if (is_... | php | public static function traverse(Digraph $graph, DepthFirstVisitorInterface $visitor, $start = NULL) {
if ($start === NULL) {
$queue = self::find_sources($graph, $visitor);
}
else if ($start instanceof \SplDoublyLinkedList) {
$queue = $start;
}
else if (is_... | [
"public",
"static",
"function",
"traverse",
"(",
"Digraph",
"$",
"graph",
",",
"DepthFirstVisitorInterface",
"$",
"visitor",
",",
"$",
"start",
"=",
"NULL",
")",
"{",
"if",
"(",
"$",
"start",
"===",
"NULL",
")",
"{",
"$",
"queue",
"=",
"self",
"::",
"f... | Perform a depth-first traversal on the provided graph.
@param Digraph $graph
The graph on which to perform the depth-first search.
@param DepthFirstVisitorInterface $visitor
The visitor object to use during the traversal.
@param object|\SplDoublyLinkedList $start
A vertex, or vertices, to use as start points for the t... | [
"Perform",
"a",
"depth",
"-",
"first",
"traversal",
"on",
"the",
"provided",
"graph",
"."
] | 5ec6314b2b211053f6bae989b95446ccf6e8ded0 | https://github.com/sdboyer/gliph/blob/5ec6314b2b211053f6bae989b95446ccf6e8ded0/src/Gliph/Traversal/DepthFirst.php#L36-L85 |
226,204 | sdboyer/gliph | src/Gliph/Traversal/DepthFirst.php | DepthFirst.find_sources | public static function find_sources(Digraph $graph, DepthFirstVisitorInterface $visitor) {
$incomings = new \SplObjectStorage();
$queue = new \SplQueue();
foreach ($graph->edges() as $edge) {
if (!isset($incomings[$edge[1]])) {
$incomings[$edge[1]] = new \SplObjectSt... | php | public static function find_sources(Digraph $graph, DepthFirstVisitorInterface $visitor) {
$incomings = new \SplObjectStorage();
$queue = new \SplQueue();
foreach ($graph->edges() as $edge) {
if (!isset($incomings[$edge[1]])) {
$incomings[$edge[1]] = new \SplObjectSt... | [
"public",
"static",
"function",
"find_sources",
"(",
"Digraph",
"$",
"graph",
",",
"DepthFirstVisitorInterface",
"$",
"visitor",
")",
"{",
"$",
"incomings",
"=",
"new",
"\\",
"SplObjectStorage",
"(",
")",
";",
"$",
"queue",
"=",
"new",
"\\",
"SplQueue",
"(",... | Finds source vertices in a Digraph, then enqueues them.
@param Digraph $graph
@param DepthFirstVisitorInterface $visitor
@return \SplQueue | [
"Finds",
"source",
"vertices",
"in",
"a",
"Digraph",
"then",
"enqueues",
"them",
"."
] | 5ec6314b2b211053f6bae989b95446ccf6e8ded0 | https://github.com/sdboyer/gliph/blob/5ec6314b2b211053f6bae989b95446ccf6e8ded0/src/Gliph/Traversal/DepthFirst.php#L95-L118 |
226,205 | sdboyer/gliph | src/Gliph/Traversal/DepthFirst.php | DepthFirst.toposort | public static function toposort(Digraph $graph, $start = NULL) {
$visitor = new DepthFirstToposortVisitor();
self::traverse($graph, $visitor, $start);
return $visitor->getTsl();
} | php | public static function toposort(Digraph $graph, $start = NULL) {
$visitor = new DepthFirstToposortVisitor();
self::traverse($graph, $visitor, $start);
return $visitor->getTsl();
} | [
"public",
"static",
"function",
"toposort",
"(",
"Digraph",
"$",
"graph",
",",
"$",
"start",
"=",
"NULL",
")",
"{",
"$",
"visitor",
"=",
"new",
"DepthFirstToposortVisitor",
"(",
")",
";",
"self",
"::",
"traverse",
"(",
"$",
"graph",
",",
"$",
"visitor",
... | Performs a topological sort on the provided graph.
@param Digraph $graph
@param object|\SplDoublyLinkedList $start
The starting point(s) for the toposort. @see DepthFirst::traverse()
@return array
A valid topologically sorted list for the provided graph. | [
"Performs",
"a",
"topological",
"sort",
"on",
"the",
"provided",
"graph",
"."
] | 5ec6314b2b211053f6bae989b95446ccf6e8ded0 | https://github.com/sdboyer/gliph/blob/5ec6314b2b211053f6bae989b95446ccf6e8ded0/src/Gliph/Traversal/DepthFirst.php#L130-L135 |
226,206 | mlanin/laravel-setup-wizard | src/Commands/Steps/CreateUser.php | CreateUser.preview | public function preview($results)
{
$table = $results['__table'];
unset($results['__table']);
$this->command->info('I will insert this values into <comment>' . $table . '</comment> table');
$this->command->table(['column', 'value'], $this->arrayToTable($results));
} | php | public function preview($results)
{
$table = $results['__table'];
unset($results['__table']);
$this->command->info('I will insert this values into <comment>' . $table . '</comment> table');
$this->command->table(['column', 'value'], $this->arrayToTable($results));
} | [
"public",
"function",
"preview",
"(",
"$",
"results",
")",
"{",
"$",
"table",
"=",
"$",
"results",
"[",
"'__table'",
"]",
";",
"unset",
"(",
"$",
"results",
"[",
"'__table'",
"]",
")",
";",
"$",
"this",
"->",
"command",
"->",
"info",
"(",
"'I will in... | Preview results.
@param mixed $results
@return void | [
"Preview",
"results",
"."
] | b2614612f92861af434e70b0fe070f6167a71e33 | https://github.com/mlanin/laravel-setup-wizard/blob/b2614612f92861af434e70b0fe070f6167a71e33/src/Commands/Steps/CreateUser.php#L44-L51 |
226,207 | mlanin/laravel-setup-wizard | src/Commands/Steps/CreateUser.php | CreateUser.getTable | protected function getTable($table = '')
{
if (empty($table))
{
switch (config('auth.driver'))
{
case 'eloquent':
$table = $this->getTableByModelClass(config('auth.model'));
break;
case 'database':
... | php | protected function getTable($table = '')
{
if (empty($table))
{
switch (config('auth.driver'))
{
case 'eloquent':
$table = $this->getTableByModelClass(config('auth.model'));
break;
case 'database':
... | [
"protected",
"function",
"getTable",
"(",
"$",
"table",
"=",
"''",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"table",
")",
")",
"{",
"switch",
"(",
"config",
"(",
"'auth.driver'",
")",
")",
"{",
"case",
"'eloquent'",
":",
"$",
"table",
"=",
"$",
"thi... | Get users table name.
@param string $table
@return string | [
"Get",
"users",
"table",
"name",
"."
] | b2614612f92861af434e70b0fe070f6167a71e33 | https://github.com/mlanin/laravel-setup-wizard/blob/b2614612f92861af434e70b0fe070f6167a71e33/src/Commands/Steps/CreateUser.php#L73-L90 |
226,208 | crip-laravel/filesys | src/App/Blob.php | Blob.init | public function init(ServiceBlob $blob)
{
$this->bytes = $blob->metadata->getSize();
$this->dir = $blob->metadata->getDir(true);
$this->fullName = $blob->metadata->getFullName();
$this->mediaType = $blob->getMediaType();
$this->name = $blob->metadata->getName();
$this... | php | public function init(ServiceBlob $blob)
{
$this->bytes = $blob->metadata->getSize();
$this->dir = $blob->metadata->getDir(true);
$this->fullName = $blob->metadata->getFullName();
$this->mediaType = $blob->getMediaType();
$this->name = $blob->metadata->getName();
$this... | [
"public",
"function",
"init",
"(",
"ServiceBlob",
"$",
"blob",
")",
"{",
"$",
"this",
"->",
"bytes",
"=",
"$",
"blob",
"->",
"metadata",
"->",
"getSize",
"(",
")",
";",
"$",
"this",
"->",
"dir",
"=",
"$",
"blob",
"->",
"metadata",
"->",
"getDir",
"... | Initialize Blob properties from service instance.
@param ServiceBlob $blob | [
"Initialize",
"Blob",
"properties",
"from",
"service",
"instance",
"."
] | 43c66929a5a16772dbb3bae4b5188bdc10b6f9ec | https://github.com/crip-laravel/filesys/blob/43c66929a5a16772dbb3bae4b5188bdc10b6f9ec/src/App/Blob.php#L46-L59 |
226,209 | gjerokrsteski/pimf-framework | core/Pimf/Util/Identifier.php | Identifier.slag | protected function slag()
{
$ident = str_replace('-', '_', implode(self::getDelimiter(), $this->args));
$ident = str_replace('_', self::getDelimiter(), $ident);
$ident = trim($ident);
$ident = str_replace(' ', '', $ident);
return strip_tags(strtolower($ident));
} | php | protected function slag()
{
$ident = str_replace('-', '_', implode(self::getDelimiter(), $this->args));
$ident = str_replace('_', self::getDelimiter(), $ident);
$ident = trim($ident);
$ident = str_replace(' ', '', $ident);
return strip_tags(strtolower($ident));
} | [
"protected",
"function",
"slag",
"(",
")",
"{",
"$",
"ident",
"=",
"str_replace",
"(",
"'-'",
",",
"'_'",
",",
"implode",
"(",
"self",
"::",
"getDelimiter",
"(",
")",
",",
"$",
"this",
"->",
"args",
")",
")",
";",
"$",
"ident",
"=",
"str_replace",
... | Slags the identifier.
@return string | [
"Slags",
"the",
"identifier",
"."
] | 859aa7c8bb727b556c5e32224842af3cff33f18b | https://github.com/gjerokrsteski/pimf-framework/blob/859aa7c8bb727b556c5e32224842af3cff33f18b/core/Pimf/Util/Identifier.php#L79-L87 |
226,210 | Techworker/ssml | src/Traits/SentenceTrait.php | SentenceTrait.sentence | public function sentence(string $text = null): Sentence
{
$sentence = Sentence::factory();
if ($text !== null) {
$sentence->text($text);
}
/** @var ContainerElement $this */
return $this->addElement($sentence);
} | php | public function sentence(string $text = null): Sentence
{
$sentence = Sentence::factory();
if ($text !== null) {
$sentence->text($text);
}
/** @var ContainerElement $this */
return $this->addElement($sentence);
} | [
"public",
"function",
"sentence",
"(",
"string",
"$",
"text",
"=",
"null",
")",
":",
"Sentence",
"{",
"$",
"sentence",
"=",
"Sentence",
"::",
"factory",
"(",
")",
";",
"if",
"(",
"$",
"text",
"!==",
"null",
")",
"{",
"$",
"sentence",
"->",
"text",
... | Adds a new sentence element. If a text is provided, it will be added.
@param string|null $text
@return Sentence | [
"Adds",
"a",
"new",
"sentence",
"element",
".",
"If",
"a",
"text",
"is",
"provided",
"it",
"will",
"be",
"added",
"."
] | cafb979b777480baf7a01b5db2bf7c2cff837805 | https://github.com/Techworker/ssml/blob/cafb979b777480baf7a01b5db2bf7c2cff837805/src/Traits/SentenceTrait.php#L29-L38 |
226,211 | gjerokrsteski/pimf-framework | core/Pimf/Util/Uploaded/Factory.php | Factory.get | public static function get(array $file, $test = false)
{
$file = static::heal($file);
if (is_array($file) && isset($file['name']) && empty($file['name']) === false) {
$keys = array_keys($file);
sort($keys);
if ($keys == self::$fileKeys) {
if (U... | php | public static function get(array $file, $test = false)
{
$file = static::heal($file);
if (is_array($file) && isset($file['name']) && empty($file['name']) === false) {
$keys = array_keys($file);
sort($keys);
if ($keys == self::$fileKeys) {
if (U... | [
"public",
"static",
"function",
"get",
"(",
"array",
"$",
"file",
",",
"$",
"test",
"=",
"false",
")",
"{",
"$",
"file",
"=",
"static",
"::",
"heal",
"(",
"$",
"file",
")",
";",
"if",
"(",
"is_array",
"(",
"$",
"file",
")",
"&&",
"isset",
"(",
... | Factory for save instance creation.
<code>
// Create an instance using the factory method.
$file = \Pimf\Util\Uploaded\Factory::get($_FILES);
</code>
@param mixed $file A $_FILES multi-dimensional array of uploaded file information.
@param bool $test Whether the test mode is active for essayer unit-testing.
@return... | [
"Factory",
"for",
"save",
"instance",
"creation",
"."
] | 859aa7c8bb727b556c5e32224842af3cff33f18b | https://github.com/gjerokrsteski/pimf-framework/blob/859aa7c8bb727b556c5e32224842af3cff33f18b/core/Pimf/Util/Uploaded/Factory.php#L49-L70 |
226,212 | Techworker/ssml | src/Traits/ParagraphTrait.php | ParagraphTrait.paragraph | public function paragraph(string $text = null): Paragraph
{
$paragraph = Paragraph::factory();
if ($text !== null) {
$paragraph->text($text);
}
/** @var ContainerElement $this */
return $this->addElement($paragraph);
} | php | public function paragraph(string $text = null): Paragraph
{
$paragraph = Paragraph::factory();
if ($text !== null) {
$paragraph->text($text);
}
/** @var ContainerElement $this */
return $this->addElement($paragraph);
} | [
"public",
"function",
"paragraph",
"(",
"string",
"$",
"text",
"=",
"null",
")",
":",
"Paragraph",
"{",
"$",
"paragraph",
"=",
"Paragraph",
"::",
"factory",
"(",
")",
";",
"if",
"(",
"$",
"text",
"!==",
"null",
")",
"{",
"$",
"paragraph",
"->",
"text... | Adds a new paragraph element. If text is provided, this will also be added.
@param string|null $text
@return Paragraph | [
"Adds",
"a",
"new",
"paragraph",
"element",
".",
"If",
"text",
"is",
"provided",
"this",
"will",
"also",
"be",
"added",
"."
] | cafb979b777480baf7a01b5db2bf7c2cff837805 | https://github.com/Techworker/ssml/blob/cafb979b777480baf7a01b5db2bf7c2cff837805/src/Traits/ParagraphTrait.php#L40-L49 |
226,213 | LUSHDigital/microservice-crud | src/Http/Controllers/CrudController.php | CrudController.show | public function show($id)
{
// Check the cache for item data. Otherwise get from the db.
$item = Cache::rememberForever($this->modelTableName . ':' . $id, function () use ($id) {
return call_user_func([$this->getModelClass(), 'findOrFail'], $id)->toArray();
});
return $t... | php | public function show($id)
{
// Check the cache for item data. Otherwise get from the db.
$item = Cache::rememberForever($this->modelTableName . ':' . $id, function () use ($id) {
return call_user_func([$this->getModelClass(), 'findOrFail'], $id)->toArray();
});
return $t... | [
"public",
"function",
"show",
"(",
"$",
"id",
")",
"{",
"// Check the cache for item data. Otherwise get from the db.",
"$",
"item",
"=",
"Cache",
"::",
"rememberForever",
"(",
"$",
"this",
"->",
"modelTableName",
".",
"':'",
".",
"$",
"id",
",",
"function",
"("... | Get a single item by it's ID.
@param int $id
@return Response | [
"Get",
"a",
"single",
"item",
"by",
"it",
"s",
"ID",
"."
] | df429279af36688462de78877650efdc04494c4a | https://github.com/LUSHDigital/microservice-crud/blob/df429279af36688462de78877650efdc04494c4a/src/Http/Controllers/CrudController.php#L125-L133 |
226,214 | LUSHDigital/microservice-crud | src/Http/Controllers/CrudController.php | CrudController.destroy | public function destroy($id)
{
// Get the item.
$item = call_user_func([$this->getModelClass(), 'findOrFail'], $id);
// Delete the item.
$item->delete();
return $this->generateResponse($this->modelTableName, null, Response::HTTP_OK, Status::OK, 'Item was deleted successfull... | php | public function destroy($id)
{
// Get the item.
$item = call_user_func([$this->getModelClass(), 'findOrFail'], $id);
// Delete the item.
$item->delete();
return $this->generateResponse($this->modelTableName, null, Response::HTTP_OK, Status::OK, 'Item was deleted successfull... | [
"public",
"function",
"destroy",
"(",
"$",
"id",
")",
"{",
"// Get the item.",
"$",
"item",
"=",
"call_user_func",
"(",
"[",
"$",
"this",
"->",
"getModelClass",
"(",
")",
",",
"'findOrFail'",
"]",
",",
"$",
"id",
")",
";",
"// Delete the item.",
"$",
"it... | Delete a single item.
@param int $id
@return Response | [
"Delete",
"a",
"single",
"item",
"."
] | df429279af36688462de78877650efdc04494c4a | https://github.com/LUSHDigital/microservice-crud/blob/df429279af36688462de78877650efdc04494c4a/src/Http/Controllers/CrudController.php#L164-L173 |
226,215 | LUSHDigital/microservice-crud | src/Http/Controllers/CrudController.php | CrudController.getModelClass | public function getModelClass()
{
$model = $this->getModelNamespace() . '\\' . $this->getModelBaseClass();
// Validate the model class.
$this->validateModelClass($model);
return $model;
} | php | public function getModelClass()
{
$model = $this->getModelNamespace() . '\\' . $this->getModelBaseClass();
// Validate the model class.
$this->validateModelClass($model);
return $model;
} | [
"public",
"function",
"getModelClass",
"(",
")",
"{",
"$",
"model",
"=",
"$",
"this",
"->",
"getModelNamespace",
"(",
")",
".",
"'\\\\'",
".",
"$",
"this",
"->",
"getModelBaseClass",
"(",
")",
";",
"// Validate the model class.",
"$",
"this",
"->",
"validate... | Get the fully qualified class of the model related to this controller.
@return string
@throws CrudModelException | [
"Get",
"the",
"fully",
"qualified",
"class",
"of",
"the",
"model",
"related",
"to",
"this",
"controller",
"."
] | df429279af36688462de78877650efdc04494c4a | https://github.com/LUSHDigital/microservice-crud/blob/df429279af36688462de78877650efdc04494c4a/src/Http/Controllers/CrudController.php#L181-L189 |
226,216 | LUSHDigital/microservice-crud | src/Http/Controllers/CrudController.php | CrudController.getModelBaseClass | public function getModelBaseClass()
{
// Use the non-plural version of the controller name if no model
// is already specified.
if (empty($this->modelBaseClass)) {
$this->modelBaseClass = Str::singular(str_replace('Controller', '', class_basename($this)));
}
retu... | php | public function getModelBaseClass()
{
// Use the non-plural version of the controller name if no model
// is already specified.
if (empty($this->modelBaseClass)) {
$this->modelBaseClass = Str::singular(str_replace('Controller', '', class_basename($this)));
}
retu... | [
"public",
"function",
"getModelBaseClass",
"(",
")",
"{",
"// Use the non-plural version of the controller name if no model",
"// is already specified.",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"modelBaseClass",
")",
")",
"{",
"$",
"this",
"->",
"modelBaseClass",
"=... | Get the name of the model related to this CRUD controller.
@return string | [
"Get",
"the",
"name",
"of",
"the",
"model",
"related",
"to",
"this",
"CRUD",
"controller",
"."
] | df429279af36688462de78877650efdc04494c4a | https://github.com/LUSHDigital/microservice-crud/blob/df429279af36688462de78877650efdc04494c4a/src/Http/Controllers/CrudController.php#L196-L205 |
226,217 | LUSHDigital/microservice-crud | src/Http/Controllers/CrudController.php | CrudController.validateModelClass | protected function validateModelClass($modelClass)
{
// Validate the expected model exists.
if (!class_exists($modelClass)) {
throw new CrudModelException('The related model does not exist.');
}
// Validate the model extends the correct base model.
if (!is_subcla... | php | protected function validateModelClass($modelClass)
{
// Validate the expected model exists.
if (!class_exists($modelClass)) {
throw new CrudModelException('The related model does not exist.');
}
// Validate the model extends the correct base model.
if (!is_subcla... | [
"protected",
"function",
"validateModelClass",
"(",
"$",
"modelClass",
")",
"{",
"// Validate the expected model exists.",
"if",
"(",
"!",
"class_exists",
"(",
"$",
"modelClass",
")",
")",
"{",
"throw",
"new",
"CrudModelException",
"(",
"'The related model does not exis... | Validate a model class name.
@param $modelClass
@return void
@throws CrudModelException | [
"Validate",
"a",
"model",
"class",
"name",
"."
] | df429279af36688462de78877650efdc04494c4a | https://github.com/LUSHDigital/microservice-crud/blob/df429279af36688462de78877650efdc04494c4a/src/Http/Controllers/CrudController.php#L229-L245 |
226,218 | CallFire/CallFire-PHP-SDK | src/CallFire/Api/Rest/Client/Number.php | Number.QueryRegions | public function QueryRegions(Request\QueryRegions $QueryRegions = null)
{
$uri = $this->getUri('/number/regions', array());
return $this->get($uri, $QueryRegions);
} | php | public function QueryRegions(Request\QueryRegions $QueryRegions = null)
{
$uri = $this->getUri('/number/regions', array());
return $this->get($uri, $QueryRegions);
} | [
"public",
"function",
"QueryRegions",
"(",
"Request",
"\\",
"QueryRegions",
"$",
"QueryRegions",
"=",
"null",
")",
"{",
"$",
"uri",
"=",
"$",
"this",
"->",
"getUri",
"(",
"'/number/regions'",
",",
"array",
"(",
")",
")",
";",
"return",
"$",
"this",
"->",... | Queries regions for use in subsequent searches and purchase requests
Use a know subset of info on a region to query for the full set of info on a
region. Example, if you know the city you can query for phone number prefixes,
rate-centers, etc... associated with that city.
@api
@param Request\QueryRegions $QueryRegion... | [
"Queries",
"regions",
"for",
"use",
"in",
"subsequent",
"searches",
"and",
"purchase",
"requests"
] | 7d6d3e1c59d4116e4fadaf57851a2fa127a13f65 | https://github.com/CallFire/CallFire-PHP-SDK/blob/7d6d3e1c59d4116e4fadaf57851a2fa127a13f65/src/CallFire/Api/Rest/Client/Number.php#L24-L29 |
226,219 | CallFire/CallFire-PHP-SDK | src/CallFire/Api/Rest/Client/Number.php | Number.QueryNumbers | public function QueryNumbers(Request\QueryNumbers $QueryNumbers = null)
{
$uri = $this->getUri('/number', array());
return $this->get($uri, $QueryNumbers);
} | php | public function QueryNumbers(Request\QueryNumbers $QueryNumbers = null)
{
$uri = $this->getUri('/number', array());
return $this->get($uri, $QueryNumbers);
} | [
"public",
"function",
"QueryNumbers",
"(",
"Request",
"\\",
"QueryNumbers",
"$",
"QueryNumbers",
"=",
"null",
")",
"{",
"$",
"uri",
"=",
"$",
"this",
"->",
"getUri",
"(",
"'/number'",
",",
"array",
"(",
")",
")",
";",
"return",
"$",
"this",
"->",
"get"... | Lists numbers owned by your account
Search for numbers already purchased and in your account by region info such as
prefix, city, state, zipcode, rate center, etc... Returns info on the numbers in
your account such as status, lease info, configuration, etc...
@api
@param Request\QueryNumbers $QueryNumbers = null | [
"Lists",
"numbers",
"owned",
"by",
"your",
"account"
] | 7d6d3e1c59d4116e4fadaf57851a2fa127a13f65 | https://github.com/CallFire/CallFire-PHP-SDK/blob/7d6d3e1c59d4116e4fadaf57851a2fa127a13f65/src/CallFire/Api/Rest/Client/Number.php#L41-L46 |
226,220 | CallFire/CallFire-PHP-SDK | src/CallFire/Api/Rest/Client/Number.php | Number.ConfigureNumber | public function ConfigureNumber($Number, Request\ConfigureNumber $ConfigureNumber)
{
$uri = $this->getUri('/number/%s', array($Number));
return $this->put($uri, $ConfigureNumber);
} | php | public function ConfigureNumber($Number, Request\ConfigureNumber $ConfigureNumber)
{
$uri = $this->getUri('/number/%s', array($Number));
return $this->put($uri, $ConfigureNumber);
} | [
"public",
"function",
"ConfigureNumber",
"(",
"$",
"Number",
",",
"Request",
"\\",
"ConfigureNumber",
"$",
"ConfigureNumber",
")",
"{",
"$",
"uri",
"=",
"$",
"this",
"->",
"getUri",
"(",
"'/number/%s'",
",",
"array",
"(",
"$",
"Number",
")",
")",
";",
"r... | Configure a number owned by your account
Update number configuration, such as ENABLE / DISABLE or turn call recording on,
using 11 diget E.164 format to select number. No response is returned.
@api
@param string $Number
@param Request\ConfigureNumber $ConfigureNumber | [
"Configure",
"a",
"number",
"owned",
"by",
"your",
"account"
] | 7d6d3e1c59d4116e4fadaf57851a2fa127a13f65 | https://github.com/CallFire/CallFire-PHP-SDK/blob/7d6d3e1c59d4116e4fadaf57851a2fa127a13f65/src/CallFire/Api/Rest/Client/Number.php#L75-L80 |
226,221 | CallFire/CallFire-PHP-SDK | src/CallFire/Api/Rest/Client/Number.php | Number.SearchAvailableNumbers | public function SearchAvailableNumbers(Request\SearchAvailableNumbers $SearchAvailableNumbers = null)
{
$uri = $this->getUri('/number/search', array());
return $this->get($uri, $SearchAvailableNumbers);
} | php | public function SearchAvailableNumbers(Request\SearchAvailableNumbers $SearchAvailableNumbers = null)
{
$uri = $this->getUri('/number/search', array());
return $this->get($uri, $SearchAvailableNumbers);
} | [
"public",
"function",
"SearchAvailableNumbers",
"(",
"Request",
"\\",
"SearchAvailableNumbers",
"$",
"SearchAvailableNumbers",
"=",
"null",
")",
"{",
"$",
"uri",
"=",
"$",
"this",
"->",
"getUri",
"(",
"'/number/search'",
",",
"array",
"(",
")",
")",
";",
"retu... | Search for new numbers that are available for purchase
Find numbers available for purchase using either TollFree = true or by region
info, such as prefix, city, zipcode, etc... The max count of numbers to return
must also be specified.
@api
@param Request\SearchAvailableNumbers $SearchAvailableNumbers = null | [
"Search",
"for",
"new",
"numbers",
"that",
"are",
"available",
"for",
"purchase"
] | 7d6d3e1c59d4116e4fadaf57851a2fa127a13f65 | https://github.com/CallFire/CallFire-PHP-SDK/blob/7d6d3e1c59d4116e4fadaf57851a2fa127a13f65/src/CallFire/Api/Rest/Client/Number.php#L92-L97 |
226,222 | CallFire/CallFire-PHP-SDK | src/CallFire/Api/Rest/Client/Number.php | Number.QueryKeywords | public function QueryKeywords(Request\QueryKeywords $QueryKeywords = null)
{
$uri = $this->getUri('/number/keyword', array());
return $this->get($uri, $QueryKeywords);
} | php | public function QueryKeywords(Request\QueryKeywords $QueryKeywords = null)
{
$uri = $this->getUri('/number/keyword', array());
return $this->get($uri, $QueryKeywords);
} | [
"public",
"function",
"QueryKeywords",
"(",
"Request",
"\\",
"QueryKeywords",
"$",
"QueryKeywords",
"=",
"null",
")",
"{",
"$",
"uri",
"=",
"$",
"this",
"->",
"getUri",
"(",
"'/number/keyword'",
",",
"array",
"(",
")",
")",
";",
"return",
"$",
"this",
"-... | Lists keywords owned by your account
Get info such as status, lease dates, etc... on keywords owned by your account.
@api
@param Request\QueryKeywords $QueryKeywords = null | [
"Lists",
"keywords",
"owned",
"by",
"your",
"account"
] | 7d6d3e1c59d4116e4fadaf57851a2fa127a13f65 | https://github.com/CallFire/CallFire-PHP-SDK/blob/7d6d3e1c59d4116e4fadaf57851a2fa127a13f65/src/CallFire/Api/Rest/Client/Number.php#L107-L112 |
226,223 | CallFire/CallFire-PHP-SDK | src/CallFire/Api/Rest/Client/Number.php | Number.SearchAvailableKeywords | public function SearchAvailableKeywords(Request\SearchAvailableKeywords $SearchAvailableKeywords = null)
{
$uri = $this->getUri('/number/keyword/search', array());
return $this->get($uri, $SearchAvailableKeywords);
} | php | public function SearchAvailableKeywords(Request\SearchAvailableKeywords $SearchAvailableKeywords = null)
{
$uri = $this->getUri('/number/keyword/search', array());
return $this->get($uri, $SearchAvailableKeywords);
} | [
"public",
"function",
"SearchAvailableKeywords",
"(",
"Request",
"\\",
"SearchAvailableKeywords",
"$",
"SearchAvailableKeywords",
"=",
"null",
")",
"{",
"$",
"uri",
"=",
"$",
"this",
"->",
"getUri",
"(",
"'/number/keyword/search'",
",",
"array",
"(",
")",
")",
"... | Search for keywords available for purchase
Supply list of keywords to see if they are available for purchase. If keyword is
available for purchase it will be returned in result. If not available then it
will not be returned in result. Once available keywords are found they can be
purchase using CreateNumberOrder
@ap... | [
"Search",
"for",
"keywords",
"available",
"for",
"purchase"
] | 7d6d3e1c59d4116e4fadaf57851a2fa127a13f65 | https://github.com/CallFire/CallFire-PHP-SDK/blob/7d6d3e1c59d4116e4fadaf57851a2fa127a13f65/src/CallFire/Api/Rest/Client/Number.php#L125-L130 |
226,224 | CallFire/CallFire-PHP-SDK | src/CallFire/Api/Rest/Client/Number.php | Number.Release | public function Release(Request\Release $Release = null)
{
$uri = $this->getUri('/number/release', array());
return $this->put($uri, $Release);
} | php | public function Release(Request\Release $Release = null)
{
$uri = $this->getUri('/number/release', array());
return $this->put($uri, $Release);
} | [
"public",
"function",
"Release",
"(",
"Request",
"\\",
"Release",
"$",
"Release",
"=",
"null",
")",
"{",
"$",
"uri",
"=",
"$",
"this",
"->",
"getUri",
"(",
"'/number/release'",
",",
"array",
"(",
")",
")",
";",
"return",
"$",
"this",
"->",
"put",
"("... | Disable auto-renew for a number or keyword
CallFire's system automatically "renews" your numbers and keywords each month
and bills you accordingly. When you no longer need a number or keyword, you can
easily 'Release' it and stop your recurring monthly charge. Once you release a
keyword, you will not be able to repur... | [
"Disable",
"auto",
"-",
"renew",
"for",
"a",
"number",
"or",
"keyword"
] | 7d6d3e1c59d4116e4fadaf57851a2fa127a13f65 | https://github.com/CallFire/CallFire-PHP-SDK/blob/7d6d3e1c59d4116e4fadaf57851a2fa127a13f65/src/CallFire/Api/Rest/Client/Number.php#L190-L195 |
226,225 | gjerokrsteski/pimf-framework | core/Pimf/Application.php | Application.bootstrap | public static function bootstrap(array $conf, array $server = array())
{
$problems = array();
try {
Config::load($conf);
$environment = Config::get('environment');
date_default_timezone_set(Config::get('timezone'));
self::setupUtils($server, Confi... | php | public static function bootstrap(array $conf, array $server = array())
{
$problems = array();
try {
Config::load($conf);
$environment = Config::get('environment');
date_default_timezone_set(Config::get('timezone'));
self::setupUtils($server, Confi... | [
"public",
"static",
"function",
"bootstrap",
"(",
"array",
"$",
"conf",
",",
"array",
"$",
"server",
"=",
"array",
"(",
")",
")",
"{",
"$",
"problems",
"=",
"array",
"(",
")",
";",
"try",
"{",
"Config",
"::",
"load",
"(",
"$",
"conf",
")",
";",
"... | Mechanism used to do initial setup and edging before a application runs.
@param array $conf The array of configuration options.
@param array $server Array of information such as headers, paths, and script locations.
@return boolean|null | [
"Mechanism",
"used",
"to",
"do",
"initial",
"setup",
"and",
"edging",
"before",
"a",
"application",
"runs",
"."
] | 859aa7c8bb727b556c5e32224842af3cff33f18b | https://github.com/gjerokrsteski/pimf-framework/blob/859aa7c8bb727b556c5e32224842af3cff33f18b/core/Pimf/Application.php#L53-L81 |
226,226 | vinkla/laravel-backup | src/ProfileRegistryFactory.php | ProfileRegistryFactory.make | public function make(array $config): ProfileRegistry
{
$config = $this->getConfig($config);
return $this->getProfileRegistry($config);
} | php | public function make(array $config): ProfileRegistry
{
$config = $this->getConfig($config);
return $this->getProfileRegistry($config);
} | [
"public",
"function",
"make",
"(",
"array",
"$",
"config",
")",
":",
"ProfileRegistry",
"{",
"$",
"config",
"=",
"$",
"this",
"->",
"getConfig",
"(",
"$",
"config",
")",
";",
"return",
"$",
"this",
"->",
"getProfileRegistry",
"(",
"$",
"config",
")",
"... | Make the profile registry.
@param array $config
@return \Zenstruck\Backup\ProfileRegistry | [
"Make",
"the",
"profile",
"registry",
"."
] | d3662b6509a39bce9cd75cc3e65b4ea01be46b26 | https://github.com/vinkla/laravel-backup/blob/d3662b6509a39bce9cd75cc3e65b4ea01be46b26/src/ProfileRegistryFactory.php#L53-L58 |
226,227 | vinkla/laravel-backup | src/ProfileRegistryFactory.php | ProfileRegistryFactory.getProfileRegistry | protected function getProfileRegistry(array $config): ProfileRegistry
{
$registry = new ProfileRegistry();
foreach (array_get($config, 'profiles') as $name => $profile) {
$profile = $this->builder->create(
$name,
array_get($profile, 'scratch_dir', storage... | php | protected function getProfileRegistry(array $config): ProfileRegistry
{
$registry = new ProfileRegistry();
foreach (array_get($config, 'profiles') as $name => $profile) {
$profile = $this->builder->create(
$name,
array_get($profile, 'scratch_dir', storage... | [
"protected",
"function",
"getProfileRegistry",
"(",
"array",
"$",
"config",
")",
":",
"ProfileRegistry",
"{",
"$",
"registry",
"=",
"new",
"ProfileRegistry",
"(",
")",
";",
"foreach",
"(",
"array_get",
"(",
"$",
"config",
",",
"'profiles'",
")",
"as",
"$",
... | Get the profile registry.
@param array $config
@return \Zenstruck\Backup\ProfileRegistry | [
"Get",
"the",
"profile",
"registry",
"."
] | d3662b6509a39bce9cd75cc3e65b4ea01be46b26 | https://github.com/vinkla/laravel-backup/blob/d3662b6509a39bce9cd75cc3e65b4ea01be46b26/src/ProfileRegistryFactory.php#L95-L113 |
226,228 | gjerokrsteski/pimf-framework | core/Pimf/Session/Storages/Pdo.php | Pdo.load | public function load($key)
{
try {
$sth = $this->pdo->prepare(
'SELECT * FROM sessions WHERE id = :id'
);
$sth->bindValue(':id', $key, \PDO::PARAM_INT);
$sth->execute();
$session = $sth->fetchObject();
if ($session in... | php | public function load($key)
{
try {
$sth = $this->pdo->prepare(
'SELECT * FROM sessions WHERE id = :id'
);
$sth->bindValue(':id', $key, \PDO::PARAM_INT);
$sth->execute();
$session = $sth->fetchObject();
if ($session in... | [
"public",
"function",
"load",
"(",
"$",
"key",
")",
"{",
"try",
"{",
"$",
"sth",
"=",
"$",
"this",
"->",
"pdo",
"->",
"prepare",
"(",
"'SELECT * FROM sessions WHERE id = :id'",
")",
";",
"$",
"sth",
"->",
"bindValue",
"(",
"':id'",
",",
"$",
"key",
","... | Load a session from storage by a given ID.
If no session is found for the ID, null will be returned.
@param string $key
@return array|null | [
"Load",
"a",
"session",
"from",
"storage",
"by",
"a",
"given",
"ID",
".",
"If",
"no",
"session",
"is",
"found",
"for",
"the",
"ID",
"null",
"will",
"be",
"returned",
"."
] | 859aa7c8bb727b556c5e32224842af3cff33f18b | https://github.com/gjerokrsteski/pimf-framework/blob/859aa7c8bb727b556c5e32224842af3cff33f18b/core/Pimf/Session/Storages/Pdo.php#L40-L64 |
226,229 | gjerokrsteski/pimf-framework | core/Pimf/Session/Storages/Pdo.php | Pdo.delete | public function delete($key)
{
$sth = $this->pdo->prepare(
"DELETE FROM sessions WHERE id = :id"
);
$sth->bindValue(':id', $key, \PDO::PARAM_INT);
$sth->execute();
} | php | public function delete($key)
{
$sth = $this->pdo->prepare(
"DELETE FROM sessions WHERE id = :id"
);
$sth->bindValue(':id', $key, \PDO::PARAM_INT);
$sth->execute();
} | [
"public",
"function",
"delete",
"(",
"$",
"key",
")",
"{",
"$",
"sth",
"=",
"$",
"this",
"->",
"pdo",
"->",
"prepare",
"(",
"\"DELETE FROM sessions WHERE id = :id\"",
")",
";",
"$",
"sth",
"->",
"bindValue",
"(",
"':id'",
",",
"$",
"key",
",",
"\\",
"P... | Delete a session from storage by a given ID.
@param string $key | [
"Delete",
"a",
"session",
"from",
"storage",
"by",
"a",
"given",
"ID",
"."
] | 859aa7c8bb727b556c5e32224842af3cff33f18b | https://github.com/gjerokrsteski/pimf-framework/blob/859aa7c8bb727b556c5e32224842af3cff33f18b/core/Pimf/Session/Storages/Pdo.php#L96-L104 |
226,230 | frictionlessdata/datapackage-php | src/Factory.php | Factory.resource | public static function resource($descriptor, $basePath = null, $skipValidations = false)
{
$resourceClass = static::getResourceClass($descriptor);
$resource = new $resourceClass($descriptor, $basePath, $skipValidations);
return $resource;
} | php | public static function resource($descriptor, $basePath = null, $skipValidations = false)
{
$resourceClass = static::getResourceClass($descriptor);
$resource = new $resourceClass($descriptor, $basePath, $skipValidations);
return $resource;
} | [
"public",
"static",
"function",
"resource",
"(",
"$",
"descriptor",
",",
"$",
"basePath",
"=",
"null",
",",
"$",
"skipValidations",
"=",
"false",
")",
"{",
"$",
"resourceClass",
"=",
"static",
"::",
"getResourceClass",
"(",
"$",
"descriptor",
")",
";",
"$"... | create a resource object.
@param object $descriptor
@param null|string $basePath
@param bool $skipValidations
@return Resources\BaseResource
@throws Exceptions\ResourceValidationFailedException | [
"create",
"a",
"resource",
"object",
"."
] | e745c21c1e9b11734964909275cfb4688004f07a | https://github.com/frictionlessdata/datapackage-php/blob/e745c21c1e9b11734964909275cfb4688004f07a/src/Factory.php#L59-L65 |
226,231 | frictionlessdata/datapackage-php | src/Factory.php | Factory.validate | public static function validate($source, $basePath = null)
{
$curResource = 1;
$curLine = null;
try {
$datapackage = static::datapackage($source, $basePath);
foreach ($datapackage as $resource) {
$curLine = 1;
foreach ($resource as $lin... | php | public static function validate($source, $basePath = null)
{
$curResource = 1;
$curLine = null;
try {
$datapackage = static::datapackage($source, $basePath);
foreach ($datapackage as $resource) {
$curLine = 1;
foreach ($resource as $lin... | [
"public",
"static",
"function",
"validate",
"(",
"$",
"source",
",",
"$",
"basePath",
"=",
"null",
")",
"{",
"$",
"curResource",
"=",
"1",
";",
"$",
"curLine",
"=",
"null",
";",
"try",
"{",
"$",
"datapackage",
"=",
"static",
"::",
"datapackage",
"(",
... | validates a given datapackage descriptor
will load all resources, and sample 10 lines of data from each data source.
@param mixed $source datapackage source - same as in datapackage function
@param null|string $basePath same as in datapackage function
@return Validators\DatapackageValidationError[] | [
"validates",
"a",
"given",
"datapackage",
"descriptor",
"will",
"load",
"all",
"resources",
"and",
"sample",
"10",
"lines",
"of",
"data",
"from",
"each",
"data",
"source",
"."
] | e745c21c1e9b11734964909275cfb4688004f07a | https://github.com/frictionlessdata/datapackage-php/blob/e745c21c1e9b11734964909275cfb4688004f07a/src/Factory.php#L76-L141 |
226,232 | gjerokrsteski/pimf-framework | core/Pimf/Error.php | Error.exception | public static function exception(\Exception $exception, Logger $logger, $exit = true)
{
static::log($exception, $logger);
ob_get_length() > 0 && ob_get_level() && ob_end_clean();
if (Config::get('error.debug_info') === true) {
echo static::format($exception, Sapi::isCli());
... | php | public static function exception(\Exception $exception, Logger $logger, $exit = true)
{
static::log($exception, $logger);
ob_get_length() > 0 && ob_get_level() && ob_end_clean();
if (Config::get('error.debug_info') === true) {
echo static::format($exception, Sapi::isCli());
... | [
"public",
"static",
"function",
"exception",
"(",
"\\",
"Exception",
"$",
"exception",
",",
"Logger",
"$",
"logger",
",",
"$",
"exit",
"=",
"true",
")",
"{",
"static",
"::",
"log",
"(",
"$",
"exception",
",",
"$",
"logger",
")",
";",
"ob_get_length",
"... | Handle an exception and display the exception report.
@param \Exception $exception
@param Logger $logger
@param boolean $exit | [
"Handle",
"an",
"exception",
"and",
"display",
"the",
"exception",
"report",
"."
] | 859aa7c8bb727b556c5e32224842af3cff33f18b | https://github.com/gjerokrsteski/pimf-framework/blob/859aa7c8bb727b556c5e32224842af3cff33f18b/core/Pimf/Error.php#L29-L51 |
226,233 | gjerokrsteski/pimf-framework | core/Pimf/Error.php | Error.format | public static function format(\Exception $exception, $isCli = false)
{
if ($isCli === true) {
return
"+++ Untreated Exception +++" . PHP_EOL . "Message: " . $exception->getMessage() . PHP_EOL . "Location: " . $exception->getFile()
. " on line " . $exception->getLi... | php | public static function format(\Exception $exception, $isCli = false)
{
if ($isCli === true) {
return
"+++ Untreated Exception +++" . PHP_EOL . "Message: " . $exception->getMessage() . PHP_EOL . "Location: " . $exception->getFile()
. " on line " . $exception->getLi... | [
"public",
"static",
"function",
"format",
"(",
"\\",
"Exception",
"$",
"exception",
",",
"$",
"isCli",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"isCli",
"===",
"true",
")",
"{",
"return",
"\"+++ Untreated Exception +++\"",
".",
"PHP_EOL",
".",
"\"Message: \""... | If detailed errors are enabled, just format the exception into
a simple error message and display it.
@param \Exception $exception
@param boolean $isCli
@return string | [
"If",
"detailed",
"errors",
"are",
"enabled",
"just",
"format",
"the",
"exception",
"into",
"a",
"simple",
"error",
"message",
"and",
"display",
"it",
"."
] | 859aa7c8bb727b556c5e32224842af3cff33f18b | https://github.com/gjerokrsteski/pimf-framework/blob/859aa7c8bb727b556c5e32224842af3cff33f18b/core/Pimf/Error.php#L62-L98 |
226,234 | gjerokrsteski/pimf-framework | core/Pimf/Error.php | Error.native | public static function native($code, $error, $file, $line, Logger $logger, $reporting, $exit = true)
{
if ($reporting === 0) {
return;
}
// create an ErrorException for the PHP error
$exception = new \ErrorException($error, $code, 0, $file, $line);
if (in_array(... | php | public static function native($code, $error, $file, $line, Logger $logger, $reporting, $exit = true)
{
if ($reporting === 0) {
return;
}
// create an ErrorException for the PHP error
$exception = new \ErrorException($error, $code, 0, $file, $line);
if (in_array(... | [
"public",
"static",
"function",
"native",
"(",
"$",
"code",
",",
"$",
"error",
",",
"$",
"file",
",",
"$",
"line",
",",
"Logger",
"$",
"logger",
",",
"$",
"reporting",
",",
"$",
"exit",
"=",
"true",
")",
"{",
"if",
"(",
"$",
"reporting",
"===",
"... | Handle a native PHP error as an ErrorException.
@param int $code
@param string $error
@param string $file
@param int $line
@param Logger $logger
@param array|int $reporting which PHP errors are reported
@param boolean $exit | [
"Handle",
"a",
"native",
"PHP",
"error",
"as",
"an",
"ErrorException",
"."
] | 859aa7c8bb727b556c5e32224842af3cff33f18b | https://github.com/gjerokrsteski/pimf-framework/blob/859aa7c8bb727b556c5e32224842af3cff33f18b/core/Pimf/Error.php#L111-L126 |
226,235 | crip-laravel/filesys | src/App/Controllers/FolderController.php | FolderController.store | public function store(Request $request)
{
$this->manager->resetPath($request->folder);
if (empty($request->name)) {
return $this->json('Name property is required.', 422);
}
if (!$this->manager->blobExists()) {
return $this->json('Folder not found.', 404);
... | php | public function store(Request $request)
{
$this->manager->resetPath($request->folder);
if (empty($request->name)) {
return $this->json('Name property is required.', 422);
}
if (!$this->manager->blobExists()) {
return $this->json('Folder not found.', 404);
... | [
"public",
"function",
"store",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"this",
"->",
"manager",
"->",
"resetPath",
"(",
"$",
"request",
"->",
"folder",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"request",
"->",
"name",
")",
")",
"{",
"return",
... | Create new sub folder
@param Request $request
@return JsonResponse | [
"Create",
"new",
"sub",
"folder"
] | 43c66929a5a16772dbb3bae4b5188bdc10b6f9ec | https://github.com/crip-laravel/filesys/blob/43c66929a5a16772dbb3bae4b5188bdc10b6f9ec/src/App/Controllers/FolderController.php#L26-L41 |
226,236 | crip-laravel/filesys | src/App/Controllers/FolderController.php | FolderController.show | public function show($folder)
{
$this->manager->resetPath($folder);
if (!$this->manager->blobExists()) {
return $this->json('File not found.', 404);
}
$list = $this->manager->folderContent();
return $this->json($list);
} | php | public function show($folder)
{
$this->manager->resetPath($folder);
if (!$this->manager->blobExists()) {
return $this->json('File not found.', 404);
}
$list = $this->manager->folderContent();
return $this->json($list);
} | [
"public",
"function",
"show",
"(",
"$",
"folder",
")",
"{",
"$",
"this",
"->",
"manager",
"->",
"resetPath",
"(",
"$",
"folder",
")",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"manager",
"->",
"blobExists",
"(",
")",
")",
"{",
"return",
"$",
"this",
... | List folder content
@param string $folder
@return JsonResponse | [
"List",
"folder",
"content"
] | 43c66929a5a16772dbb3bae4b5188bdc10b6f9ec | https://github.com/crip-laravel/filesys/blob/43c66929a5a16772dbb3bae4b5188bdc10b6f9ec/src/App/Controllers/FolderController.php#L48-L59 |
226,237 | crip-laravel/filesys | src/App/Controllers/FolderController.php | FolderController.update | public function update(Request $request, string $folder = '')
{
if (empty($request->name)) {
return $this->json('Name property is required.', 422);
}
$this->manager->resetPath($folder);
if (!$this->manager->blobExists()) {
return $this->json('Folder not foun... | php | public function update(Request $request, string $folder = '')
{
if (empty($request->name)) {
return $this->json('Name property is required.', 422);
}
$this->manager->resetPath($folder);
if (!$this->manager->blobExists()) {
return $this->json('Folder not foun... | [
"public",
"function",
"update",
"(",
"Request",
"$",
"request",
",",
"string",
"$",
"folder",
"=",
"''",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"request",
"->",
"name",
")",
")",
"{",
"return",
"$",
"this",
"->",
"json",
"(",
"'Name property is requir... | Rename folder name
@param Request $request
@param string $folder
@return JsonResponse | [
"Rename",
"folder",
"name"
] | 43c66929a5a16772dbb3bae4b5188bdc10b6f9ec | https://github.com/crip-laravel/filesys/blob/43c66929a5a16772dbb3bae4b5188bdc10b6f9ec/src/App/Controllers/FolderController.php#L67-L82 |
226,238 | gjerokrsteski/pimf-framework | core/Pimf/Memcached.php | Memcached.connect | protected static function connect(array $servers, $memcache = null)
{
if (!$memcache) {
$memcache = new \Memcached();
}
foreach ($servers as $server) {
$memcache->addServer($server['host'], $server['port'], $server['weight']);
}
if ($memcache->getVer... | php | protected static function connect(array $servers, $memcache = null)
{
if (!$memcache) {
$memcache = new \Memcached();
}
foreach ($servers as $server) {
$memcache->addServer($server['host'], $server['port'], $server['weight']);
}
if ($memcache->getVer... | [
"protected",
"static",
"function",
"connect",
"(",
"array",
"$",
"servers",
",",
"$",
"memcache",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"memcache",
")",
"{",
"$",
"memcache",
"=",
"new",
"\\",
"Memcached",
"(",
")",
";",
"}",
"foreach",
"(",
... | Create a new Memcached connection instance.
@param array $servers
@param null $memcache
@return \Memcached|null
@throws \RuntimeException | [
"Create",
"a",
"new",
"Memcached",
"connection",
"instance",
"."
] | 859aa7c8bb727b556c5e32224842af3cff33f18b | https://github.com/gjerokrsteski/pimf-framework/blob/859aa7c8bb727b556c5e32224842af3cff33f18b/core/Pimf/Memcached.php#L80-L95 |
226,239 | mlanin/laravel-setup-wizard | src/Commands/Steps/AbstractStep.php | AbstractStep.run | public function run($pretend = false)
{
$results = $this->prepare();
$this->preview($results);
if ($this->command->confirm('Everything is right?'))
{
$return = $pretend ? true : $this->finish($results);
if ($return === false)
{
$... | php | public function run($pretend = false)
{
$results = $this->prepare();
$this->preview($results);
if ($this->command->confirm('Everything is right?'))
{
$return = $pretend ? true : $this->finish($results);
if ($return === false)
{
$... | [
"public",
"function",
"run",
"(",
"$",
"pretend",
"=",
"false",
")",
"{",
"$",
"results",
"=",
"$",
"this",
"->",
"prepare",
"(",
")",
";",
"$",
"this",
"->",
"preview",
"(",
"$",
"results",
")",
";",
"if",
"(",
"$",
"this",
"->",
"command",
"->"... | Run step.
@param bool $pretend
@return mixed | [
"Run",
"step",
"."
] | b2614612f92861af434e70b0fe070f6167a71e33 | https://github.com/mlanin/laravel-setup-wizard/blob/b2614612f92861af434e70b0fe070f6167a71e33/src/Commands/Steps/AbstractStep.php#L35-L56 |
226,240 | mlanin/laravel-setup-wizard | src/Commands/Steps/AbstractStep.php | AbstractStep.repeat | public function repeat()
{
if ($this->repeats > self::REPEATS)
{
return false;
}
if ($this->command->confirm('Do you want to repeat step?'))
{
$this->repeats++;
return $this->run();
}
return false;
} | php | public function repeat()
{
if ($this->repeats > self::REPEATS)
{
return false;
}
if ($this->command->confirm('Do you want to repeat step?'))
{
$this->repeats++;
return $this->run();
}
return false;
} | [
"public",
"function",
"repeat",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"repeats",
">",
"self",
"::",
"REPEATS",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"$",
"this",
"->",
"command",
"->",
"confirm",
"(",
"'Do you want to repeat step?'",
... | Repeat step.
@return bool | [
"Repeat",
"step",
"."
] | b2614612f92861af434e70b0fe070f6167a71e33 | https://github.com/mlanin/laravel-setup-wizard/blob/b2614612f92861af434e70b0fe070f6167a71e33/src/Commands/Steps/AbstractStep.php#L63-L78 |
226,241 | Techworker/ssml | src/SsmlBuilder.php | SsmlBuilder.toDOM | public static function toDOM(BaseElement $element): \DOMDocument
{
$doc = new \DOMDocument('1.0', 'utf-8');
$doc->appendChild($element->toDOM($doc));
return $doc;
} | php | public static function toDOM(BaseElement $element): \DOMDocument
{
$doc = new \DOMDocument('1.0', 'utf-8');
$doc->appendChild($element->toDOM($doc));
return $doc;
} | [
"public",
"static",
"function",
"toDOM",
"(",
"BaseElement",
"$",
"element",
")",
":",
"\\",
"DOMDocument",
"{",
"$",
"doc",
"=",
"new",
"\\",
"DOMDocument",
"(",
"'1.0'",
",",
"'utf-8'",
")",
";",
"$",
"doc",
"->",
"appendChild",
"(",
"$",
"element",
... | Gets the xml representation of a tree.
@param BaseElement $element
@return \DOMDocument | [
"Gets",
"the",
"xml",
"representation",
"of",
"a",
"tree",
"."
] | cafb979b777480baf7a01b5db2bf7c2cff837805 | https://github.com/Techworker/ssml/blob/cafb979b777480baf7a01b5db2bf7c2cff837805/src/SsmlBuilder.php#L38-L43 |
226,242 | CallFire/CallFire-PHP-SDK | src/CallFire/Api/Rest/Client/Subscription.php | Subscription.CreateSubscription | public function CreateSubscription(Request\CreateSubscription $CreateSubscription = null)
{
$uri = $this->getUri('/subscription', array());
return $this->post($uri, $CreateSubscription);
} | php | public function CreateSubscription(Request\CreateSubscription $CreateSubscription = null)
{
$uri = $this->getUri('/subscription', array());
return $this->post($uri, $CreateSubscription);
} | [
"public",
"function",
"CreateSubscription",
"(",
"Request",
"\\",
"CreateSubscription",
"$",
"CreateSubscription",
"=",
"null",
")",
"{",
"$",
"uri",
"=",
"$",
"this",
"->",
"getUri",
"(",
"'/subscription'",
",",
"array",
"(",
")",
")",
";",
"return",
"$",
... | Creates a new subscription for CallFire event notifications
CreateSubscription registers a URI endpoint to start receiving CallFire
notification events on. Returned is the subscriptionId that can be used later to
query, update, or delete the subscription. The subscriptionId is also returned
as part of all notification... | [
"Creates",
"a",
"new",
"subscription",
"for",
"CallFire",
"event",
"notifications"
] | 7d6d3e1c59d4116e4fadaf57851a2fa127a13f65 | https://github.com/CallFire/CallFire-PHP-SDK/blob/7d6d3e1c59d4116e4fadaf57851a2fa127a13f65/src/CallFire/Api/Rest/Client/Subscription.php#L27-L32 |
226,243 | CallFire/CallFire-PHP-SDK | src/CallFire/Api/Rest/Client/Subscription.php | Subscription.QuerySubscriptions | public function QuerySubscriptions(Request\QuerySubscriptions $QuerySubscriptions = null)
{
$uri = $this->getUri('/subscription', array());
return $this->get($uri, $QuerySubscriptions);
} | php | public function QuerySubscriptions(Request\QuerySubscriptions $QuerySubscriptions = null)
{
$uri = $this->getUri('/subscription', array());
return $this->get($uri, $QuerySubscriptions);
} | [
"public",
"function",
"QuerySubscriptions",
"(",
"Request",
"\\",
"QuerySubscriptions",
"$",
"QuerySubscriptions",
"=",
"null",
")",
"{",
"$",
"uri",
"=",
"$",
"this",
"->",
"getUri",
"(",
"'/subscription'",
",",
"array",
"(",
")",
")",
";",
"return",
"$",
... | Get a list of registered subscriptions
Return a list of all subscriptions registered to an account. Subscriptions
returned contain info like id, enabled, endpoint, filter, etc...
@api
@param Request\QuerySubscriptions $QuerySubscriptions = null | [
"Get",
"a",
"list",
"of",
"registered",
"subscriptions"
] | 7d6d3e1c59d4116e4fadaf57851a2fa127a13f65 | https://github.com/CallFire/CallFire-PHP-SDK/blob/7d6d3e1c59d4116e4fadaf57851a2fa127a13f65/src/CallFire/Api/Rest/Client/Subscription.php#L43-L48 |
226,244 | CallFire/CallFire-PHP-SDK | src/CallFire/Api/Rest/Client/Subscription.php | Subscription.UpdateSubscription | public function UpdateSubscription($Id, Request\UpdateSubscription $UpdateSubscription = null)
{
$uri = $this->getUri('/subscription/%s', array($Id));
return $this->put($uri, $UpdateSubscription);
} | php | public function UpdateSubscription($Id, Request\UpdateSubscription $UpdateSubscription = null)
{
$uri = $this->getUri('/subscription/%s', array($Id));
return $this->put($uri, $UpdateSubscription);
} | [
"public",
"function",
"UpdateSubscription",
"(",
"$",
"Id",
",",
"Request",
"\\",
"UpdateSubscription",
"$",
"UpdateSubscription",
"=",
"null",
")",
"{",
"$",
"uri",
"=",
"$",
"this",
"->",
"getUri",
"(",
"'/subscription/%s'",
",",
"array",
"(",
"$",
"Id",
... | Updates an existing subscription
Update existing subscription by ID Use this to enable or disable notification
events, change the notification endpoint URI, or change the filtering so only
receive notification for a subset of events. UpdateSubscription service call
returns no response. Testing this method using swagg... | [
"Updates",
"an",
"existing",
"subscription"
] | 7d6d3e1c59d4116e4fadaf57851a2fa127a13f65 | https://github.com/CallFire/CallFire-PHP-SDK/blob/7d6d3e1c59d4116e4fadaf57851a2fa127a13f65/src/CallFire/Api/Rest/Client/Subscription.php#L97-L102 |
226,245 | sdboyer/gliph | src/Gliph/Visitor/DepthFirstBasicVisitor.php | DepthFirstBasicVisitor.getReachable | public function getReachable($vertex) {
if ($this->getState() !== self::COMPLETE) {
throw new WrongVisitorStateException('Correct reachability data cannot be retrieved until traversal is complete.');
}
if (!isset($this->paths[$vertex])) {
return FALSE;
}
... | php | public function getReachable($vertex) {
if ($this->getState() !== self::COMPLETE) {
throw new WrongVisitorStateException('Correct reachability data cannot be retrieved until traversal is complete.');
}
if (!isset($this->paths[$vertex])) {
return FALSE;
}
... | [
"public",
"function",
"getReachable",
"(",
"$",
"vertex",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"getState",
"(",
")",
"!==",
"self",
"::",
"COMPLETE",
")",
"{",
"throw",
"new",
"WrongVisitorStateException",
"(",
"'Correct reachability data cannot be retrieved un... | Returns an array of all vertices reachable from the given vertex.
@param object $vertex
The vertex for which reachability data is desired.
@return array|bool
An array of reachable vertices, or FALSE if the vertex could not be
found in the reachability data. Note that an empty array will be
returned for vertices that ... | [
"Returns",
"an",
"array",
"of",
"all",
"vertices",
"reachable",
"from",
"the",
"given",
"vertex",
"."
] | 5ec6314b2b211053f6bae989b95446ccf6e8ded0 | https://github.com/sdboyer/gliph/blob/5ec6314b2b211053f6bae989b95446ccf6e8ded0/src/Gliph/Visitor/DepthFirstBasicVisitor.php#L81-L91 |
226,246 | bazo/wamp-client | src/WAMP/WAMPClient.php | WAMPClient.prefix | public function prefix($prefix, $uri)
{
$type = WAMPProtocol::MSG_PREFIX;
$data = [$type, $prefix, $uri];
$this->send($data);
} | php | public function prefix($prefix, $uri)
{
$type = WAMPProtocol::MSG_PREFIX;
$data = [$type, $prefix, $uri];
$this->send($data);
} | [
"public",
"function",
"prefix",
"(",
"$",
"prefix",
",",
"$",
"uri",
")",
"{",
"$",
"type",
"=",
"WAMPProtocol",
"::",
"MSG_PREFIX",
";",
"$",
"data",
"=",
"[",
"$",
"type",
",",
"$",
"prefix",
",",
"$",
"uri",
"]",
";",
"$",
"this",
"->",
"send"... | Establish a prefix on server
@see http://wamp.ws/spec#prefix_message
@param type $prefix
@param type $uri | [
"Establish",
"a",
"prefix",
"on",
"server"
] | f93efeeb7a891b7fc4130d32071b43f4902b86cd | https://github.com/bazo/wamp-client/blob/f93efeeb7a891b7fc4130d32071b43f4902b86cd/src/WAMP/WAMPClient.php#L177-L182 |
226,247 | bazo/wamp-client | src/WAMP/WAMPClient.php | WAMPClient.call | public function call($procUri, $arguments = [])
{
$args = func_get_args();
array_shift($args);
$type = WAMPProtocol::MSG_CALL;
$callId = uniqid("", $moreEntropy = TRUE);
$data = array_merge(array($type, $callId, $procUri), $args);
$this->send($data);
} | php | public function call($procUri, $arguments = [])
{
$args = func_get_args();
array_shift($args);
$type = WAMPProtocol::MSG_CALL;
$callId = uniqid("", $moreEntropy = TRUE);
$data = array_merge(array($type, $callId, $procUri), $args);
$this->send($data);
} | [
"public",
"function",
"call",
"(",
"$",
"procUri",
",",
"$",
"arguments",
"=",
"[",
"]",
")",
"{",
"$",
"args",
"=",
"func_get_args",
"(",
")",
";",
"array_shift",
"(",
"$",
"args",
")",
";",
"$",
"type",
"=",
"WAMPProtocol",
"::",
"MSG_CALL",
";",
... | Call a procedure on server
@see http://wamp.ws/spec#call_message
@param string $procURI
@param mixed $arguments | [
"Call",
"a",
"procedure",
"on",
"server"
] | f93efeeb7a891b7fc4130d32071b43f4902b86cd | https://github.com/bazo/wamp-client/blob/f93efeeb7a891b7fc4130d32071b43f4902b86cd/src/WAMP/WAMPClient.php#L191-L200 |
226,248 | bazo/wamp-client | src/WAMP/WAMPClient.php | WAMPClient.publish | public function publish($topicUri, $payload, $exclude = [], $eligible = [])
{
$type = WAMPProtocol::MSG_PUBLISH;
$data = array($type, $topicUri, $payload, $exclude, $eligible);
$this->send($data);
} | php | public function publish($topicUri, $payload, $exclude = [], $eligible = [])
{
$type = WAMPProtocol::MSG_PUBLISH;
$data = array($type, $topicUri, $payload, $exclude, $eligible);
$this->send($data);
} | [
"public",
"function",
"publish",
"(",
"$",
"topicUri",
",",
"$",
"payload",
",",
"$",
"exclude",
"=",
"[",
"]",
",",
"$",
"eligible",
"=",
"[",
"]",
")",
"{",
"$",
"type",
"=",
"WAMPProtocol",
"::",
"MSG_PUBLISH",
";",
"$",
"data",
"=",
"array",
"(... | The client will send an event to all clients connected to the server who have subscribed to the topicURI
@see http://wamp.ws/spec#publish_message
@param string $topicUri
@param string $payload
@param string $exclude
@param string $eligible | [
"The",
"client",
"will",
"send",
"an",
"event",
"to",
"all",
"clients",
"connected",
"to",
"the",
"server",
"who",
"have",
"subscribed",
"to",
"the",
"topicURI"
] | f93efeeb7a891b7fc4130d32071b43f4902b86cd | https://github.com/bazo/wamp-client/blob/f93efeeb7a891b7fc4130d32071b43f4902b86cd/src/WAMP/WAMPClient.php#L211-L216 |
226,249 | jagilpe/encryption-bundle | Doctrine/ORM/EncryptionEntityRepositoryDecorator.php | EncryptionEntityRepositoryDecorator.filterHasEncryptedField | private function filterHasEncryptedField(array $criteria)
{
$result = false;
if (!empty($criteria)) {
$encryptedFields = array_keys($this->getEncryptedFields());
$criteriaFields = array_keys($criteria);
$commonFields = array_intersect($encryptedFields, $criteriaF... | php | private function filterHasEncryptedField(array $criteria)
{
$result = false;
if (!empty($criteria)) {
$encryptedFields = array_keys($this->getEncryptedFields());
$criteriaFields = array_keys($criteria);
$commonFields = array_intersect($encryptedFields, $criteriaF... | [
"private",
"function",
"filterHasEncryptedField",
"(",
"array",
"$",
"criteria",
")",
"{",
"$",
"result",
"=",
"false",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"criteria",
")",
")",
"{",
"$",
"encryptedFields",
"=",
"array_keys",
"(",
"$",
"this",
"->",
... | Checks if any of the fields in the filter criteria is encrypted
@param array $criteria
@return boolean | [
"Checks",
"if",
"any",
"of",
"the",
"fields",
"in",
"the",
"filter",
"criteria",
"is",
"encrypted"
] | 1e1ba13a3cc646b36e3407822f2e8339c5671f47 | https://github.com/jagilpe/encryption-bundle/blob/1e1ba13a3cc646b36e3407822f2e8339c5671f47/Doctrine/ORM/EncryptionEntityRepositoryDecorator.php#L127-L140 |
226,250 | jagilpe/encryption-bundle | Doctrine/ORM/EncryptionEntityRepositoryDecorator.php | EncryptionEntityRepositoryDecorator.orderByHasEncryptedField | private function orderByHasEncryptedField(array $orderBy = null)
{
$result = false;
if ($orderBy && !empty($orderBy)) {
$encryptedFields = array_keys($this->getEncryptedFields());
$orderByFields = array_keys($orderBy);
$commonFields = array_intersect($encryptedFi... | php | private function orderByHasEncryptedField(array $orderBy = null)
{
$result = false;
if ($orderBy && !empty($orderBy)) {
$encryptedFields = array_keys($this->getEncryptedFields());
$orderByFields = array_keys($orderBy);
$commonFields = array_intersect($encryptedFi... | [
"private",
"function",
"orderByHasEncryptedField",
"(",
"array",
"$",
"orderBy",
"=",
"null",
")",
"{",
"$",
"result",
"=",
"false",
";",
"if",
"(",
"$",
"orderBy",
"&&",
"!",
"empty",
"(",
"$",
"orderBy",
")",
")",
"{",
"$",
"encryptedFields",
"=",
"a... | Checks if any of the fields in the order by clause is encrypted
@param array $orderBy
@return boolean | [
"Checks",
"if",
"any",
"of",
"the",
"fields",
"in",
"the",
"order",
"by",
"clause",
"is",
"encrypted"
] | 1e1ba13a3cc646b36e3407822f2e8339c5671f47 | https://github.com/jagilpe/encryption-bundle/blob/1e1ba13a3cc646b36e3407822f2e8339c5671f47/Doctrine/ORM/EncryptionEntityRepositoryDecorator.php#L149-L162 |
226,251 | jagilpe/encryption-bundle | Doctrine/ORM/EncryptionEntityRepositoryDecorator.php | EncryptionEntityRepositoryDecorator.filterWithEncryptedCriteria | private function filterWithEncryptedCriteria($values, array $encryptedCriteria)
{
$result = array_filter($values, function($value) use ($encryptedCriteria) {
foreach ($encryptedCriteria as $fieldName => $fieldValue) {
if (!$this->fieldValueMatches($value, $fieldName, $fieldValue)... | php | private function filterWithEncryptedCriteria($values, array $encryptedCriteria)
{
$result = array_filter($values, function($value) use ($encryptedCriteria) {
foreach ($encryptedCriteria as $fieldName => $fieldValue) {
if (!$this->fieldValueMatches($value, $fieldName, $fieldValue)... | [
"private",
"function",
"filterWithEncryptedCriteria",
"(",
"$",
"values",
",",
"array",
"$",
"encryptedCriteria",
")",
"{",
"$",
"result",
"=",
"array_filter",
"(",
"$",
"values",
",",
"function",
"(",
"$",
"value",
")",
"use",
"(",
"$",
"encryptedCriteria",
... | Filters the values using by one or more encrypted fields
@param array $values
@param array $orderBy
@return array | [
"Filters",
"the",
"values",
"using",
"by",
"one",
"or",
"more",
"encrypted",
"fields"
] | 1e1ba13a3cc646b36e3407822f2e8339c5671f47 | https://github.com/jagilpe/encryption-bundle/blob/1e1ba13a3cc646b36e3407822f2e8339c5671f47/Doctrine/ORM/EncryptionEntityRepositoryDecorator.php#L219-L231 |
226,252 | jagilpe/encryption-bundle | Doctrine/ORM/EncryptionEntityRepositoryDecorator.php | EncryptionEntityRepositoryDecorator.fieldValueMatches | private function fieldValueMatches($entity, $fieldName, $fieldValue)
{
$value = $this->getFieldValue($entity, $fieldName);
if (is_array($fieldValue)) {
$matches = in_array($value, $fieldValue);
}
else {
$matches = ($value == $fieldValue);
}
re... | php | private function fieldValueMatches($entity, $fieldName, $fieldValue)
{
$value = $this->getFieldValue($entity, $fieldName);
if (is_array($fieldValue)) {
$matches = in_array($value, $fieldValue);
}
else {
$matches = ($value == $fieldValue);
}
re... | [
"private",
"function",
"fieldValueMatches",
"(",
"$",
"entity",
",",
"$",
"fieldName",
",",
"$",
"fieldValue",
")",
"{",
"$",
"value",
"=",
"$",
"this",
"->",
"getFieldValue",
"(",
"$",
"entity",
",",
"$",
"fieldName",
")",
";",
"if",
"(",
"is_array",
... | Check if the value of the field matches the given value
@param mixed $entity
@param string $fieldName
@return mixed | [
"Check",
"if",
"the",
"value",
"of",
"the",
"field",
"matches",
"the",
"given",
"value"
] | 1e1ba13a3cc646b36e3407822f2e8339c5671f47 | https://github.com/jagilpe/encryption-bundle/blob/1e1ba13a3cc646b36e3407822f2e8339c5671f47/Doctrine/ORM/EncryptionEntityRepositoryDecorator.php#L241-L252 |
226,253 | jagilpe/encryption-bundle | Doctrine/ORM/EncryptionEntityRepositoryDecorator.php | EncryptionEntityRepositoryDecorator.sortWithEncryptedOrderBy | private function sortWithEncryptedOrderBy($values, array $orderBy)
{
usort($values, function($entity1, $entity2) use ($orderBy) {
foreach ($orderBy as $fieldName => $order) {
$value1 = $this->getFieldValue($entity1, $fieldName);
$value2 = $this->getFieldValue($ent... | php | private function sortWithEncryptedOrderBy($values, array $orderBy)
{
usort($values, function($entity1, $entity2) use ($orderBy) {
foreach ($orderBy as $fieldName => $order) {
$value1 = $this->getFieldValue($entity1, $fieldName);
$value2 = $this->getFieldValue($ent... | [
"private",
"function",
"sortWithEncryptedOrderBy",
"(",
"$",
"values",
",",
"array",
"$",
"orderBy",
")",
"{",
"usort",
"(",
"$",
"values",
",",
"function",
"(",
"$",
"entity1",
",",
"$",
"entity2",
")",
"use",
"(",
"$",
"orderBy",
")",
"{",
"foreach",
... | Sorts the values using by one or more encrypted fields
@param array $values
@param array $orderBy
@return array | [
"Sorts",
"the",
"values",
"using",
"by",
"one",
"or",
"more",
"encrypted",
"fields"
] | 1e1ba13a3cc646b36e3407822f2e8339c5671f47 | https://github.com/jagilpe/encryption-bundle/blob/1e1ba13a3cc646b36e3407822f2e8339c5671f47/Doctrine/ORM/EncryptionEntityRepositoryDecorator.php#L262-L282 |
226,254 | jagilpe/encryption-bundle | Crypt/KeyStore.php | KeyStore.getUserKey | private function getUserKey(PKEncryptionEnabledUserInterface $user)
{
$pkiKey = $this->findKeyByUser($user);
if (!$pkiKey) {
$userId = $user->getId();
$userClass = $this->getUserClass($user);
$pkiKey = new PKIPrivateKey();
$pkiKey->setUserClass($user... | php | private function getUserKey(PKEncryptionEnabledUserInterface $user)
{
$pkiKey = $this->findKeyByUser($user);
if (!$pkiKey) {
$userId = $user->getId();
$userClass = $this->getUserClass($user);
$pkiKey = new PKIPrivateKey();
$pkiKey->setUserClass($user... | [
"private",
"function",
"getUserKey",
"(",
"PKEncryptionEnabledUserInterface",
"$",
"user",
")",
"{",
"$",
"pkiKey",
"=",
"$",
"this",
"->",
"findKeyByUser",
"(",
"$",
"user",
")",
";",
"if",
"(",
"!",
"$",
"pkiKey",
")",
"{",
"$",
"userId",
"=",
"$",
"... | Returns the Key pair of the user or a new one if it has not already been persisted
@param \Jagilpe\EncryptionBundle\Entity\PKEncryptionEnabledUserInterface $user
@return \Jagilpe\EncryptionBundle\Entity\PKIPrivateKey | [
"Returns",
"the",
"Key",
"pair",
"of",
"the",
"user",
"or",
"a",
"new",
"one",
"if",
"it",
"has",
"not",
"already",
"been",
"persisted"
] | 1e1ba13a3cc646b36e3407822f2e8339c5671f47 | https://github.com/jagilpe/encryption-bundle/blob/1e1ba13a3cc646b36e3407822f2e8339c5671f47/Crypt/KeyStore.php#L134-L148 |
226,255 | jagilpe/encryption-bundle | Crypt/KeyStore.php | KeyStore.findKeyByUser | private function findKeyByUser(PKEncryptionEnabledUserInterface $user)
{
$userClass = $this->getUserClass($user);
$userId = $user->getId();
$key = $this->getKeyRepository()->findOneBy(array('userClass' => $userClass, 'userId' => $userId));
return $key;
} | php | private function findKeyByUser(PKEncryptionEnabledUserInterface $user)
{
$userClass = $this->getUserClass($user);
$userId = $user->getId();
$key = $this->getKeyRepository()->findOneBy(array('userClass' => $userClass, 'userId' => $userId));
return $key;
} | [
"private",
"function",
"findKeyByUser",
"(",
"PKEncryptionEnabledUserInterface",
"$",
"user",
")",
"{",
"$",
"userClass",
"=",
"$",
"this",
"->",
"getUserClass",
"(",
"$",
"user",
")",
";",
"$",
"userId",
"=",
"$",
"user",
"->",
"getId",
"(",
")",
";",
"... | Returns the previously persisted key pair of a user
@param \Jagilpe\EncryptionBundle\Entity\PKEncryptionEnabledUserInterface $user
@return \Jagilpe\EncryptionBundle\Entity\PKIPrivateKey | [
"Returns",
"the",
"previously",
"persisted",
"key",
"pair",
"of",
"a",
"user"
] | 1e1ba13a3cc646b36e3407822f2e8339c5671f47 | https://github.com/jagilpe/encryption-bundle/blob/1e1ba13a3cc646b36e3407822f2e8339c5671f47/Crypt/KeyStore.php#L156-L163 |
226,256 | jagilpe/encryption-bundle | Crypt/KeyStore.php | KeyStore.deleteUserKey | private function deleteUserKey(PKEncryptionEnabledUserInterface$user, $flush = false)
{
$key = $this->findKeyByUser($user);
if ($key) {
$this->getEntityManager()->remove($key);
if ($flush) {
$this->getEntityManager()->flush();
}
}
} | php | private function deleteUserKey(PKEncryptionEnabledUserInterface$user, $flush = false)
{
$key = $this->findKeyByUser($user);
if ($key) {
$this->getEntityManager()->remove($key);
if ($flush) {
$this->getEntityManager()->flush();
}
}
} | [
"private",
"function",
"deleteUserKey",
"(",
"PKEncryptionEnabledUserInterface",
"$",
"user",
",",
"$",
"flush",
"=",
"false",
")",
"{",
"$",
"key",
"=",
"$",
"this",
"->",
"findKeyByUser",
"(",
"$",
"user",
")",
";",
"if",
"(",
"$",
"key",
")",
"{",
"... | Deletes the key pair of a user
@param \Jagilpe\EncryptionBundle\Entity\PKEncryptionEnabledUserInterface $user | [
"Deletes",
"the",
"key",
"pair",
"of",
"a",
"user"
] | 1e1ba13a3cc646b36e3407822f2e8339c5671f47 | https://github.com/jagilpe/encryption-bundle/blob/1e1ba13a3cc646b36e3407822f2e8339c5671f47/Crypt/KeyStore.php#L175-L184 |
226,257 | jagilpe/encryption-bundle | Crypt/KeyStore.php | KeyStore.encryptPrivateKey | private function encryptPrivateKey(PKIPrivateKey $pkiKey)
{
// Generate the symmetric key and iv to encrypt the users' key
$iv = $this->cryptographyProvider->generateIV(CryptographyProviderInterface::PRIVATE_KEY_ENCRYPTION);
$symmetricKey = $this->cryptographyProvider->generateSecureKey();
... | php | private function encryptPrivateKey(PKIPrivateKey $pkiKey)
{
// Generate the symmetric key and iv to encrypt the users' key
$iv = $this->cryptographyProvider->generateIV(CryptographyProviderInterface::PRIVATE_KEY_ENCRYPTION);
$symmetricKey = $this->cryptographyProvider->generateSecureKey();
... | [
"private",
"function",
"encryptPrivateKey",
"(",
"PKIPrivateKey",
"$",
"pkiKey",
")",
"{",
"// Generate the symmetric key and iv to encrypt the users' key",
"$",
"iv",
"=",
"$",
"this",
"->",
"cryptographyProvider",
"->",
"generateIV",
"(",
"CryptographyProviderInterface",
... | Encrypts the private key of the user using the app master public key
@param \Jagilpe\EncryptionBundle\Entity\PKIPrivateKey $pkiKey | [
"Encrypts",
"the",
"private",
"key",
"of",
"the",
"user",
"using",
"the",
"app",
"master",
"public",
"key"
] | 1e1ba13a3cc646b36e3407822f2e8339c5671f47 | https://github.com/jagilpe/encryption-bundle/blob/1e1ba13a3cc646b36e3407822f2e8339c5671f47/Crypt/KeyStore.php#L207-L233 |
226,258 | jagilpe/encryption-bundle | Crypt/KeyStore.php | KeyStore.decryptPrivateKey | private function decryptPrivateKey(PKIPrivateKey $pkiKey)
{
// Get the symmetric key used to encrypt the private key of the user
$encryptedKey = base64_decode($pkiKey->getKey());
$privateMasterKey = $this->getPrivateMasterKey();
$symmetricKey = $this->cryptographyProvider->decryptWi... | php | private function decryptPrivateKey(PKIPrivateKey $pkiKey)
{
// Get the symmetric key used to encrypt the private key of the user
$encryptedKey = base64_decode($pkiKey->getKey());
$privateMasterKey = $this->getPrivateMasterKey();
$symmetricKey = $this->cryptographyProvider->decryptWi... | [
"private",
"function",
"decryptPrivateKey",
"(",
"PKIPrivateKey",
"$",
"pkiKey",
")",
"{",
"// Get the symmetric key used to encrypt the private key of the user",
"$",
"encryptedKey",
"=",
"base64_decode",
"(",
"$",
"pkiKey",
"->",
"getKey",
"(",
")",
")",
";",
"$",
"... | Descrypts the private key of the user using the app master private key and returns it
@param \Jagilpe\EncryptionBundle\Entity\PKIPrivateKey $pkiKey
@return string | [
"Descrypts",
"the",
"private",
"key",
"of",
"the",
"user",
"using",
"the",
"app",
"master",
"private",
"key",
"and",
"returns",
"it"
] | 1e1ba13a3cc646b36e3407822f2e8339c5671f47 | https://github.com/jagilpe/encryption-bundle/blob/1e1ba13a3cc646b36e3407822f2e8339c5671f47/Crypt/KeyStore.php#L242-L263 |
226,259 | jagilpe/encryption-bundle | Crypt/KeyStore.php | KeyStore.getPublicMasterKey | public function getPublicMasterKey()
{
if (!$this->publicMasterKey) {
$masterKey = $this->getMasterKey();
$publicKeyDetails = openssl_pkey_get_details($masterKey);
$this->publicMasterKey = $publicKeyDetails['key'];
}
return $this->publicMasterKey;
} | php | public function getPublicMasterKey()
{
if (!$this->publicMasterKey) {
$masterKey = $this->getMasterKey();
$publicKeyDetails = openssl_pkey_get_details($masterKey);
$this->publicMasterKey = $publicKeyDetails['key'];
}
return $this->publicMasterKey;
} | [
"public",
"function",
"getPublicMasterKey",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"publicMasterKey",
")",
"{",
"$",
"masterKey",
"=",
"$",
"this",
"->",
"getMasterKey",
"(",
")",
";",
"$",
"publicKeyDetails",
"=",
"openssl_pkey_get_details",
"(",... | Returns the public master key
@return string | [
"Returns",
"the",
"public",
"master",
"key"
] | 1e1ba13a3cc646b36e3407822f2e8339c5671f47 | https://github.com/jagilpe/encryption-bundle/blob/1e1ba13a3cc646b36e3407822f2e8339c5671f47/Crypt/KeyStore.php#L270-L278 |
226,260 | jagilpe/encryption-bundle | Crypt/KeyStore.php | KeyStore.getPrivateMasterKey | public function getPrivateMasterKey()
{
if (!$this->privateMasterKey) {
$masterKey = $this->getMasterKey();
openssl_pkey_export($masterKey, $this->privateMasterKey);
}
return $this->privateMasterKey;
} | php | public function getPrivateMasterKey()
{
if (!$this->privateMasterKey) {
$masterKey = $this->getMasterKey();
openssl_pkey_export($masterKey, $this->privateMasterKey);
}
return $this->privateMasterKey;
} | [
"public",
"function",
"getPrivateMasterKey",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"privateMasterKey",
")",
"{",
"$",
"masterKey",
"=",
"$",
"this",
"->",
"getMasterKey",
"(",
")",
";",
"openssl_pkey_export",
"(",
"$",
"masterKey",
",",
"$",
... | Returns the private master key
@return string | [
"Returns",
"the",
"private",
"master",
"key"
] | 1e1ba13a3cc646b36e3407822f2e8339c5671f47 | https://github.com/jagilpe/encryption-bundle/blob/1e1ba13a3cc646b36e3407822f2e8339c5671f47/Crypt/KeyStore.php#L285-L292 |
226,261 | jagilpe/encryption-bundle | Crypt/KeyStore.php | KeyStore.getMasterKey | private function getMasterKey()
{
if (!$this->masterKey) {
$certificatePath = 'file://'.$this->masterKeyData['cert_file'];
$passPhrase = $this->masterKeyData['passphrase'];
$this->masterKey = openssl_pkey_get_private($certificatePath, $passPhrase);
if (!$this... | php | private function getMasterKey()
{
if (!$this->masterKey) {
$certificatePath = 'file://'.$this->masterKeyData['cert_file'];
$passPhrase = $this->masterKeyData['passphrase'];
$this->masterKey = openssl_pkey_get_private($certificatePath, $passPhrase);
if (!$this... | [
"private",
"function",
"getMasterKey",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"masterKey",
")",
"{",
"$",
"certificatePath",
"=",
"'file://'",
".",
"$",
"this",
"->",
"masterKeyData",
"[",
"'cert_file'",
"]",
";",
"$",
"passPhrase",
"=",
"$",
... | Returns the master key resource identifier
@return resource | [
"Returns",
"the",
"master",
"key",
"resource",
"identifier"
] | 1e1ba13a3cc646b36e3407822f2e8339c5671f47 | https://github.com/jagilpe/encryption-bundle/blob/1e1ba13a3cc646b36e3407822f2e8339c5671f47/Crypt/KeyStore.php#L299-L311 |
226,262 | jagilpe/encryption-bundle | Crypt/KeyManager.php | KeyManager.encryptSymmetricKeyWithUserKey | private function encryptSymmetricKeyWithUserKey($clearKey, $entity)
{
$users = $this->accessChecker->getAllowedUsers($entity);
$symmetricKey = new SymmetricKey();
foreach ($users as $user) {
$publicKey = $this->getPublicKey($user);
$encryptedKey = base64_encode($this... | php | private function encryptSymmetricKeyWithUserKey($clearKey, $entity)
{
$users = $this->accessChecker->getAllowedUsers($entity);
$symmetricKey = new SymmetricKey();
foreach ($users as $user) {
$publicKey = $this->getPublicKey($user);
$encryptedKey = base64_encode($this... | [
"private",
"function",
"encryptSymmetricKeyWithUserKey",
"(",
"$",
"clearKey",
",",
"$",
"entity",
")",
"{",
"$",
"users",
"=",
"$",
"this",
"->",
"accessChecker",
"->",
"getAllowedUsers",
"(",
"$",
"entity",
")",
";",
"$",
"symmetricKey",
"=",
"new",
"Symme... | Encrypts the Symmetric Key of the entity using Per User Encryption
@param string $clearKey
@param mixed $entity
@return SymmetricKey | [
"Encrypts",
"the",
"Symmetric",
"Key",
"of",
"the",
"entity",
"using",
"Per",
"User",
"Encryption"
] | 1e1ba13a3cc646b36e3407822f2e8339c5671f47 | https://github.com/jagilpe/encryption-bundle/blob/1e1ba13a3cc646b36e3407822f2e8339c5671f47/Crypt/KeyManager.php#L310-L322 |
226,263 | jagilpe/encryption-bundle | Crypt/KeyManager.php | KeyManager.encryptSymmetricKeyWithSystemKey | private function encryptSymmetricKeyWithSystemKey($clearKey, $entity)
{
$publicMasterKey = $this->keyStore->getPublicMasterKey();
$symmetricKey = new SymmetricKey();
$encryptedKey = base64_encode($this->cryptographyProvider->encryptWithPublicKey($clearKey, $publicMasterKey));
$symmet... | php | private function encryptSymmetricKeyWithSystemKey($clearKey, $entity)
{
$publicMasterKey = $this->keyStore->getPublicMasterKey();
$symmetricKey = new SymmetricKey();
$encryptedKey = base64_encode($this->cryptographyProvider->encryptWithPublicKey($clearKey, $publicMasterKey));
$symmet... | [
"private",
"function",
"encryptSymmetricKeyWithSystemKey",
"(",
"$",
"clearKey",
",",
"$",
"entity",
")",
"{",
"$",
"publicMasterKey",
"=",
"$",
"this",
"->",
"keyStore",
"->",
"getPublicMasterKey",
"(",
")",
";",
"$",
"symmetricKey",
"=",
"new",
"SymmetricKey",... | Encrypts the Symmetric Key of the entity using System Encryption
@param string $clearKey
@param mixed $entity
@return SymmetricKey | [
"Encrypts",
"the",
"Symmetric",
"Key",
"of",
"the",
"entity",
"using",
"System",
"Encryption"
] | 1e1ba13a3cc646b36e3407822f2e8339c5671f47 | https://github.com/jagilpe/encryption-bundle/blob/1e1ba13a3cc646b36e3407822f2e8339c5671f47/Crypt/KeyManager.php#L332-L340 |
226,264 | jagilpe/encryption-bundle | Crypt/KeyManager.php | KeyManager.decryptSymmetricKey | private function decryptSymmetricKey($entity)
{
$decryptedKey = null;
$encryptionMode = $this->getEncryptionMode($entity);
switch ($encryptionMode) {
case EncryptionService::MODE_PER_USER_SHAREABLE:
$decryptedKey = $this->decryptSymmetricKeyWithUserKey($entity);
... | php | private function decryptSymmetricKey($entity)
{
$decryptedKey = null;
$encryptionMode = $this->getEncryptionMode($entity);
switch ($encryptionMode) {
case EncryptionService::MODE_PER_USER_SHAREABLE:
$decryptedKey = $this->decryptSymmetricKeyWithUserKey($entity);
... | [
"private",
"function",
"decryptSymmetricKey",
"(",
"$",
"entity",
")",
"{",
"$",
"decryptedKey",
"=",
"null",
";",
"$",
"encryptionMode",
"=",
"$",
"this",
"->",
"getEncryptionMode",
"(",
"$",
"entity",
")",
";",
"switch",
"(",
"$",
"encryptionMode",
")",
... | Decrypts the Symmetric Key used to encrypt the fields of the entity
@param mixed $entity
@throws EncryptionException
@return string | [
"Decrypts",
"the",
"Symmetric",
"Key",
"used",
"to",
"encrypt",
"the",
"fields",
"of",
"the",
"entity"
] | 1e1ba13a3cc646b36e3407822f2e8339c5671f47 | https://github.com/jagilpe/encryption-bundle/blob/1e1ba13a3cc646b36e3407822f2e8339c5671f47/Crypt/KeyManager.php#L351-L368 |
226,265 | jagilpe/encryption-bundle | Crypt/KeyManager.php | KeyManager.decryptSymmetricKeyWithUserKey | private function decryptSymmetricKeyWithUserKey($entity)
{
$encryptedKey = $entity->getKey();
$decryptedKey = null;
$user = $this->getUser();
if ($user instanceof PKEncryptionEnabledUserInterface && $userKey = $encryptedKey->getKey($user)) {
$userKey = base64_decode($use... | php | private function decryptSymmetricKeyWithUserKey($entity)
{
$encryptedKey = $entity->getKey();
$decryptedKey = null;
$user = $this->getUser();
if ($user instanceof PKEncryptionEnabledUserInterface && $userKey = $encryptedKey->getKey($user)) {
$userKey = base64_decode($use... | [
"private",
"function",
"decryptSymmetricKeyWithUserKey",
"(",
"$",
"entity",
")",
"{",
"$",
"encryptedKey",
"=",
"$",
"entity",
"->",
"getKey",
"(",
")",
";",
"$",
"decryptedKey",
"=",
"null",
";",
"$",
"user",
"=",
"$",
"this",
"->",
"getUser",
"(",
")"... | Decrypts the Symmetric Key of the entity using Per User Encryption
@param $entity
@return string | [
"Decrypts",
"the",
"Symmetric",
"Key",
"of",
"the",
"entity",
"using",
"Per",
"User",
"Encryption"
] | 1e1ba13a3cc646b36e3407822f2e8339c5671f47 | https://github.com/jagilpe/encryption-bundle/blob/1e1ba13a3cc646b36e3407822f2e8339c5671f47/Crypt/KeyManager.php#L377-L400 |
226,266 | jagilpe/encryption-bundle | Crypt/KeyManager.php | KeyManager.decryptSymmetricKeyWithSystemKey | private function decryptSymmetricKeyWithSystemKey($entity)
{
/** @var SymmetricKey $encryptedKey */
$encryptedKey = $entity->getKey();
$decryptedKey = null;
$systemKey = $encryptedKey->getSystemKey();
$privateKey = $this->keyStore->getPrivateMasterKey();
if ($system... | php | private function decryptSymmetricKeyWithSystemKey($entity)
{
/** @var SymmetricKey $encryptedKey */
$encryptedKey = $entity->getKey();
$decryptedKey = null;
$systemKey = $encryptedKey->getSystemKey();
$privateKey = $this->keyStore->getPrivateMasterKey();
if ($system... | [
"private",
"function",
"decryptSymmetricKeyWithSystemKey",
"(",
"$",
"entity",
")",
"{",
"/** @var SymmetricKey $encryptedKey */",
"$",
"encryptedKey",
"=",
"$",
"entity",
"->",
"getKey",
"(",
")",
";",
"$",
"decryptedKey",
"=",
"null",
";",
"$",
"systemKey",
"=",... | Decrypts the Symmetric Key of the entity using System Encryption
@param $entity
@return string | [
"Decrypts",
"the",
"Symmetric",
"Key",
"of",
"the",
"entity",
"using",
"System",
"Encryption"
] | 1e1ba13a3cc646b36e3407822f2e8339c5671f47 | https://github.com/jagilpe/encryption-bundle/blob/1e1ba13a3cc646b36e3407822f2e8339c5671f47/Crypt/KeyManager.php#L409-L424 |
226,267 | jagilpe/encryption-bundle | Crypt/KeyManager.php | KeyManager.generatePKIKeys | private function generatePKIKeys()
{
// OPENSSL config
$config = array(
'digest_alg' => $this->settings['private_key']['digest_method'],
'private_key_bits' => $this->settings['private_key']['bits'],
'private_key_type' => $this->settings['private_key']['type'],
... | php | private function generatePKIKeys()
{
// OPENSSL config
$config = array(
'digest_alg' => $this->settings['private_key']['digest_method'],
'private_key_bits' => $this->settings['private_key']['bits'],
'private_key_type' => $this->settings['private_key']['type'],
... | [
"private",
"function",
"generatePKIKeys",
"(",
")",
"{",
"// OPENSSL config",
"$",
"config",
"=",
"array",
"(",
"'digest_alg'",
"=>",
"$",
"this",
"->",
"settings",
"[",
"'private_key'",
"]",
"[",
"'digest_method'",
"]",
",",
"'private_key_bits'",
"=>",
"$",
"... | Generates a pki keys pair
@return array
@throws EncryptionException | [
"Generates",
"a",
"pki",
"keys",
"pair"
] | 1e1ba13a3cc646b36e3407822f2e8339c5671f47 | https://github.com/jagilpe/encryption-bundle/blob/1e1ba13a3cc646b36e3407822f2e8339c5671f47/Crypt/KeyManager.php#L441-L463 |
226,268 | jagilpe/encryption-bundle | Crypt/KeyManager.php | KeyManager.encryptPrivateKey | private function encryptPrivateKey(PKEncryptionEnabledUserInterface $user)
{
if (!$user->isPrivateKeyEncrypted()) {
$privateKey = $user->getPrivateKey();
$passwordDigest = $this->getUserPasswordDigest($user);
if ($passwordDigest) {
$iv = $this->cryptograp... | php | private function encryptPrivateKey(PKEncryptionEnabledUserInterface $user)
{
if (!$user->isPrivateKeyEncrypted()) {
$privateKey = $user->getPrivateKey();
$passwordDigest = $this->getUserPasswordDigest($user);
if ($passwordDigest) {
$iv = $this->cryptograp... | [
"private",
"function",
"encryptPrivateKey",
"(",
"PKEncryptionEnabledUserInterface",
"$",
"user",
")",
"{",
"if",
"(",
"!",
"$",
"user",
"->",
"isPrivateKeyEncrypted",
"(",
")",
")",
"{",
"$",
"privateKey",
"=",
"$",
"user",
"->",
"getPrivateKey",
"(",
")",
... | Encrypts the Private key of the user using his password
@param \Jagilpe\EncryptionBundle\Entity\PKEncryptionEnabledUserInterface $user
@return array | [
"Encrypts",
"the",
"Private",
"key",
"of",
"the",
"user",
"using",
"his",
"password"
] | 1e1ba13a3cc646b36e3407822f2e8339c5671f47 | https://github.com/jagilpe/encryption-bundle/blob/1e1ba13a3cc646b36e3407822f2e8339c5671f47/Crypt/KeyManager.php#L472-L508 |
226,269 | jagilpe/encryption-bundle | Crypt/KeyManager.php | KeyManager.getUserPasswordDigest | private function getUserPasswordDigest(PKEncryptionEnabledUserInterface $user)
{
$passwordDigest = $user->getPasswordDigest();
if (!$passwordDigest) {
$password = $user->getPlainPassword();
if ($password) {
$salt = $user->getSalt();
$password... | php | private function getUserPasswordDigest(PKEncryptionEnabledUserInterface $user)
{
$passwordDigest = $user->getPasswordDigest();
if (!$passwordDigest) {
$password = $user->getPlainPassword();
if ($password) {
$salt = $user->getSalt();
$password... | [
"private",
"function",
"getUserPasswordDigest",
"(",
"PKEncryptionEnabledUserInterface",
"$",
"user",
")",
"{",
"$",
"passwordDigest",
"=",
"$",
"user",
"->",
"getPasswordDigest",
"(",
")",
";",
"if",
"(",
"!",
"$",
"passwordDigest",
")",
"{",
"$",
"password",
... | Returns the password digest of the password of the user
@param \Jagilpe\EncryptionBundle\Entity\PKEncryptionEnabledUserInterface $user
@return string | [
"Returns",
"the",
"password",
"digest",
"of",
"the",
"password",
"of",
"the",
"user"
] | 1e1ba13a3cc646b36e3407822f2e8339c5671f47 | https://github.com/jagilpe/encryption-bundle/blob/1e1ba13a3cc646b36e3407822f2e8339c5671f47/Crypt/KeyManager.php#L517-L531 |
226,270 | jagilpe/encryption-bundle | Crypt/KeyManager.php | KeyManager.decryptPrivateKey | private function decryptPrivateKey(PKEncryptionEnabledUserInterface $user, array $params = array())
{
if (isset($params['password_digest'])) {
$passwordDigest = base64_decode($params['password_digest']);
}
else {
if (isset($params['password'])) {
$salt... | php | private function decryptPrivateKey(PKEncryptionEnabledUserInterface $user, array $params = array())
{
if (isset($params['password_digest'])) {
$passwordDigest = base64_decode($params['password_digest']);
}
else {
if (isset($params['password'])) {
$salt... | [
"private",
"function",
"decryptPrivateKey",
"(",
"PKEncryptionEnabledUserInterface",
"$",
"user",
",",
"array",
"$",
"params",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"params",
"[",
"'password_digest'",
"]",
")",
")",
"{",
"$",
"pas... | Encrypts the Private key of the user using his password or a digest of it
@param \Jagilpe\EncryptionBundle\Entity\PKEncryptionEnabledUserInterface $user
@param array $params
@return string|boolean
@throws EncryptionException | [
"Encrypts",
"the",
"Private",
"key",
"of",
"the",
"user",
"using",
"his",
"password",
"or",
"a",
"digest",
"of",
"it"
] | 1e1ba13a3cc646b36e3407822f2e8339c5671f47 | https://github.com/jagilpe/encryption-bundle/blob/1e1ba13a3cc646b36e3407822f2e8339c5671f47/Crypt/KeyManager.php#L543-L568 |
226,271 | jagilpe/encryption-bundle | Crypt/KeyManager.php | KeyManager.getEncryptionMode | private function getEncryptionMode($entity)
{
$className = ClassUtils::getClass($entity);
$classMetadata = $this->metadataFactory->getMetadataFor($className);
return $classMetadata->encryptionMode;
} | php | private function getEncryptionMode($entity)
{
$className = ClassUtils::getClass($entity);
$classMetadata = $this->metadataFactory->getMetadataFor($className);
return $classMetadata->encryptionMode;
} | [
"private",
"function",
"getEncryptionMode",
"(",
"$",
"entity",
")",
"{",
"$",
"className",
"=",
"ClassUtils",
"::",
"getClass",
"(",
"$",
"entity",
")",
";",
"$",
"classMetadata",
"=",
"$",
"this",
"->",
"metadataFactory",
"->",
"getMetadataFor",
"(",
"$",
... | Returns the encryption mode for the given entity
@param $entity
@return ClassMetadata | [
"Returns",
"the",
"encryption",
"mode",
"for",
"the",
"given",
"entity"
] | 1e1ba13a3cc646b36e3407822f2e8339c5671f47 | https://github.com/jagilpe/encryption-bundle/blob/1e1ba13a3cc646b36e3407822f2e8339c5671f47/Crypt/KeyManager.php#L577-L583 |
226,272 | gjerokrsteski/pimf-framework | core/Pimf/Util/Validator.php | Validator.email | public function email($field)
{
return (filter_var(trim($this->get($field)), FILTER_VALIDATE_EMAIL) !== false) ?: $this->error($field,
__FUNCTION__);
} | php | public function email($field)
{
return (filter_var(trim($this->get($field)), FILTER_VALIDATE_EMAIL) !== false) ?: $this->error($field,
__FUNCTION__);
} | [
"public",
"function",
"email",
"(",
"$",
"field",
")",
"{",
"return",
"(",
"filter_var",
"(",
"trim",
"(",
"$",
"this",
"->",
"get",
"(",
"$",
"field",
")",
")",
",",
"FILTER_VALIDATE_EMAIL",
")",
"!==",
"false",
")",
"?",
":",
"$",
"this",
"->",
"... | check to see if valid email address
@param string $field
@return bool | [
"check",
"to",
"see",
"if",
"valid",
"email",
"address"
] | 859aa7c8bb727b556c5e32224842af3cff33f18b | https://github.com/gjerokrsteski/pimf-framework/blob/859aa7c8bb727b556c5e32224842af3cff33f18b/core/Pimf/Util/Validator.php#L60-L64 |
226,273 | gjerokrsteski/pimf-framework | core/Pimf/Util/Validator.php | Validator.ip | public function ip($field)
{
return (filter_var(trim($this->get($field)), FILTER_VALIDATE_IP) !== false) ?: $this->error($field,
__FUNCTION__);
} | php | public function ip($field)
{
return (filter_var(trim($this->get($field)), FILTER_VALIDATE_IP) !== false) ?: $this->error($field,
__FUNCTION__);
} | [
"public",
"function",
"ip",
"(",
"$",
"field",
")",
"{",
"return",
"(",
"filter_var",
"(",
"trim",
"(",
"$",
"this",
"->",
"get",
"(",
"$",
"field",
")",
")",
",",
"FILTER_VALIDATE_IP",
")",
"!==",
"false",
")",
"?",
":",
"$",
"this",
"->",
"error"... | Check is a valid IP.
@param $field
@return bool | [
"Check",
"is",
"a",
"valid",
"IP",
"."
] | 859aa7c8bb727b556c5e32224842af3cff33f18b | https://github.com/gjerokrsteski/pimf-framework/blob/859aa7c8bb727b556c5e32224842af3cff33f18b/core/Pimf/Util/Validator.php#L73-L77 |
226,274 | gjerokrsteski/pimf-framework | core/Pimf/Util/Validator.php | Validator.url | public function url($field)
{
return (filter_var(trim($this->get($field)), FILTER_VALIDATE_URL) !== false) ?: $this->error($field,
__FUNCTION__);
} | php | public function url($field)
{
return (filter_var(trim($this->get($field)), FILTER_VALIDATE_URL) !== false) ?: $this->error($field,
__FUNCTION__);
} | [
"public",
"function",
"url",
"(",
"$",
"field",
")",
"{",
"return",
"(",
"filter_var",
"(",
"trim",
"(",
"$",
"this",
"->",
"get",
"(",
"$",
"field",
")",
")",
",",
"FILTER_VALIDATE_URL",
")",
"!==",
"false",
")",
"?",
":",
"$",
"this",
"->",
"erro... | Check is a valid URL.
@param $field
@return bool | [
"Check",
"is",
"a",
"valid",
"URL",
"."
] | 859aa7c8bb727b556c5e32224842af3cff33f18b | https://github.com/gjerokrsteski/pimf-framework/blob/859aa7c8bb727b556c5e32224842af3cff33f18b/core/Pimf/Util/Validator.php#L86-L90 |
226,275 | gjerokrsteski/pimf-framework | core/Pimf/Util/Validator.php | Validator.compare | public function compare($field1, $field2, $caseInsensitive = false)
{
$field1value = $this->get($field1);
$field2value = $this->get($field2);
$valid = (strcmp($field1value, $field2value) == 0);
if ($caseInsensitive) {
$valid = (strcmp(strtolower($field1value), strtolowe... | php | public function compare($field1, $field2, $caseInsensitive = false)
{
$field1value = $this->get($field1);
$field2value = $this->get($field2);
$valid = (strcmp($field1value, $field2value) == 0);
if ($caseInsensitive) {
$valid = (strcmp(strtolower($field1value), strtolowe... | [
"public",
"function",
"compare",
"(",
"$",
"field1",
",",
"$",
"field2",
",",
"$",
"caseInsensitive",
"=",
"false",
")",
"{",
"$",
"field1value",
"=",
"$",
"this",
"->",
"get",
"(",
"$",
"field1",
")",
";",
"$",
"field2value",
"=",
"$",
"this",
"->",... | Check to see if two fields are equal.
@param string $field1
@param string $field2
@param bool $caseInsensitive
@return bool | [
"Check",
"to",
"see",
"if",
"two",
"fields",
"are",
"equal",
"."
] | 859aa7c8bb727b556c5e32224842af3cff33f18b | https://github.com/gjerokrsteski/pimf-framework/blob/859aa7c8bb727b556c5e32224842af3cff33f18b/core/Pimf/Util/Validator.php#L101-L113 |
226,276 | gjerokrsteski/pimf-framework | core/Pimf/Util/Validator.php | Validator.lengthBetween | public function lengthBetween($field, $min, $max, $inclusive = false)
{
$fieldValue = strlen(trim($this->get($field)));
$valid = ($fieldValue <= $max && $fieldValue >= $min);
if (!$inclusive) {
$valid = ($fieldValue < $max && $fieldValue > $min);
}
return ($val... | php | public function lengthBetween($field, $min, $max, $inclusive = false)
{
$fieldValue = strlen(trim($this->get($field)));
$valid = ($fieldValue <= $max && $fieldValue >= $min);
if (!$inclusive) {
$valid = ($fieldValue < $max && $fieldValue > $min);
}
return ($val... | [
"public",
"function",
"lengthBetween",
"(",
"$",
"field",
",",
"$",
"min",
",",
"$",
"max",
",",
"$",
"inclusive",
"=",
"false",
")",
"{",
"$",
"fieldValue",
"=",
"strlen",
"(",
"trim",
"(",
"$",
"this",
"->",
"get",
"(",
"$",
"field",
")",
")",
... | Check to see if the length of a field is between two numbers
@param string $field
@param int $min
@param int $max
@param bool $inclusive
@return bool | [
"Check",
"to",
"see",
"if",
"the",
"length",
"of",
"a",
"field",
"is",
"between",
"two",
"numbers"
] | 859aa7c8bb727b556c5e32224842af3cff33f18b | https://github.com/gjerokrsteski/pimf-framework/blob/859aa7c8bb727b556c5e32224842af3cff33f18b/core/Pimf/Util/Validator.php#L125-L136 |
226,277 | gjerokrsteski/pimf-framework | core/Pimf/Util/Validator.php | Validator.punctuation | public function punctuation($field)
{
return (preg_match("/[^\w\s\p{P}]/", '' . $this->get($field)) > 0) ? $this->error($field, __FUNCTION__) : true;
} | php | public function punctuation($field)
{
return (preg_match("/[^\w\s\p{P}]/", '' . $this->get($field)) > 0) ? $this->error($field, __FUNCTION__) : true;
} | [
"public",
"function",
"punctuation",
"(",
"$",
"field",
")",
"{",
"return",
"(",
"preg_match",
"(",
"\"/[^\\w\\s\\p{P}]/\"",
",",
"''",
".",
"$",
"this",
"->",
"get",
"(",
"$",
"field",
")",
")",
">",
"0",
")",
"?",
"$",
"this",
"->",
"error",
"(",
... | Check to see if there is punctuation
@param string $field
@return bool | [
"Check",
"to",
"see",
"if",
"there",
"is",
"punctuation"
] | 859aa7c8bb727b556c5e32224842af3cff33f18b | https://github.com/gjerokrsteski/pimf-framework/blob/859aa7c8bb727b556c5e32224842af3cff33f18b/core/Pimf/Util/Validator.php#L145-L148 |
226,278 | gjerokrsteski/pimf-framework | core/Pimf/Util/Validator.php | Validator.digit | public function digit($field)
{
return (ctype_digit((string)$this->get($field)) === true) ?: $this->error($field, __FUNCTION__);
} | php | public function digit($field)
{
return (ctype_digit((string)$this->get($field)) === true) ?: $this->error($field, __FUNCTION__);
} | [
"public",
"function",
"digit",
"(",
"$",
"field",
")",
"{",
"return",
"(",
"ctype_digit",
"(",
"(",
"string",
")",
"$",
"this",
"->",
"get",
"(",
"$",
"field",
")",
")",
"===",
"true",
")",
"?",
":",
"$",
"this",
"->",
"error",
"(",
"$",
"field",... | Check if a field contains only decimal digit
@param string $field
@return bool | [
"Check",
"if",
"a",
"field",
"contains",
"only",
"decimal",
"digit"
] | 859aa7c8bb727b556c5e32224842af3cff33f18b | https://github.com/gjerokrsteski/pimf-framework/blob/859aa7c8bb727b556c5e32224842af3cff33f18b/core/Pimf/Util/Validator.php#L208-L211 |
226,279 | gjerokrsteski/pimf-framework | core/Pimf/Util/Validator.php | Validator.alpha | public function alpha($field)
{
return (ctype_alpha((string)$this->get($field)) === true) ?: $this->error($field, __FUNCTION__);
} | php | public function alpha($field)
{
return (ctype_alpha((string)$this->get($field)) === true) ?: $this->error($field, __FUNCTION__);
} | [
"public",
"function",
"alpha",
"(",
"$",
"field",
")",
"{",
"return",
"(",
"ctype_alpha",
"(",
"(",
"string",
")",
"$",
"this",
"->",
"get",
"(",
"$",
"field",
")",
")",
"===",
"true",
")",
"?",
":",
"$",
"this",
"->",
"error",
"(",
"$",
"field",... | Check if a field contains only alphabetic characters
@param string $field
@return bool | [
"Check",
"if",
"a",
"field",
"contains",
"only",
"alphabetic",
"characters"
] | 859aa7c8bb727b556c5e32224842af3cff33f18b | https://github.com/gjerokrsteski/pimf-framework/blob/859aa7c8bb727b556c5e32224842af3cff33f18b/core/Pimf/Util/Validator.php#L220-L223 |
226,280 | gjerokrsteski/pimf-framework | core/Pimf/Util/Validator.php | Validator.alphaNumeric | public function alphaNumeric($field)
{
return (ctype_alnum((string)$this->get($field)) === true) ?: $this->error($field, __FUNCTION__);
} | php | public function alphaNumeric($field)
{
return (ctype_alnum((string)$this->get($field)) === true) ?: $this->error($field, __FUNCTION__);
} | [
"public",
"function",
"alphaNumeric",
"(",
"$",
"field",
")",
"{",
"return",
"(",
"ctype_alnum",
"(",
"(",
"string",
")",
"$",
"this",
"->",
"get",
"(",
"$",
"field",
")",
")",
"===",
"true",
")",
"?",
":",
"$",
"this",
"->",
"error",
"(",
"$",
"... | Check if a field contains only alphanumeric characters
@param string $field
@return bool | [
"Check",
"if",
"a",
"field",
"contains",
"only",
"alphanumeric",
"characters"
] | 859aa7c8bb727b556c5e32224842af3cff33f18b | https://github.com/gjerokrsteski/pimf-framework/blob/859aa7c8bb727b556c5e32224842af3cff33f18b/core/Pimf/Util/Validator.php#L232-L235 |
226,281 | gjerokrsteski/pimf-framework | core/Pimf/Util/Validator.php | Validator.date | public function date($field, $format)
{
$fieldValue = $this->get($field);
try {
$date = new \DateTime($fieldValue);
return $fieldValue === $date->format($format);
} catch (\Exception $exception) {
return $this->error($field, __FUNCTION__);
}
... | php | public function date($field, $format)
{
$fieldValue = $this->get($field);
try {
$date = new \DateTime($fieldValue);
return $fieldValue === $date->format($format);
} catch (\Exception $exception) {
return $this->error($field, __FUNCTION__);
}
... | [
"public",
"function",
"date",
"(",
"$",
"field",
",",
"$",
"format",
")",
"{",
"$",
"fieldValue",
"=",
"$",
"this",
"->",
"get",
"(",
"$",
"field",
")",
";",
"try",
"{",
"$",
"date",
"=",
"new",
"\\",
"DateTime",
"(",
"$",
"fieldValue",
")",
";",... | Check if field is a date by specified format.
@param string $field
@param string $format Find formats here http://www.php.net/manual/en/function.date.php
@return boolean | [
"Check",
"if",
"field",
"is",
"a",
"date",
"by",
"specified",
"format",
"."
] | 859aa7c8bb727b556c5e32224842af3cff33f18b | https://github.com/gjerokrsteski/pimf-framework/blob/859aa7c8bb727b556c5e32224842af3cff33f18b/core/Pimf/Util/Validator.php#L245-L257 |
226,282 | vinkla/laravel-backup | src/Sources/MysqlDumpSource.php | MysqlDumpSource.bootstrap | public function bootstrap(): Source
{
$connection = $this->getDatabaseConnection();
$config = $this->config->get("database.connections.$connection");
if (array_get($config, 'driver') !== 'mysql') {
throw new InvalidArgumentException("Unsupported database driver [{$config['drive... | php | public function bootstrap(): Source
{
$connection = $this->getDatabaseConnection();
$config = $this->config->get("database.connections.$connection");
if (array_get($config, 'driver') !== 'mysql') {
throw new InvalidArgumentException("Unsupported database driver [{$config['drive... | [
"public",
"function",
"bootstrap",
"(",
")",
":",
"Source",
"{",
"$",
"connection",
"=",
"$",
"this",
"->",
"getDatabaseConnection",
"(",
")",
";",
"$",
"config",
"=",
"$",
"this",
"->",
"config",
"->",
"get",
"(",
"\"database.connections.$connection\"",
")"... | Bootstrap the source.
@throws \InvalidArgumentException
@return \Zenstruck\Backup\Source\MySqlDumpSource | [
"Bootstrap",
"the",
"source",
"."
] | d3662b6509a39bce9cd75cc3e65b4ea01be46b26 | https://github.com/vinkla/laravel-backup/blob/d3662b6509a39bce9cd75cc3e65b4ea01be46b26/src/Sources/MysqlDumpSource.php#L53-L70 |
226,283 | Techworker/ssml | src/Traits/PhonemeTrait.php | PhonemeTrait.phoneme | public function phoneme(string $alphabet, string $ph, string $text): ContainerElement
{
/** @var ContainerElement $this */
return $this->addElement(Phoneme::factory($alphabet, $ph, $text));
} | php | public function phoneme(string $alphabet, string $ph, string $text): ContainerElement
{
/** @var ContainerElement $this */
return $this->addElement(Phoneme::factory($alphabet, $ph, $text));
} | [
"public",
"function",
"phoneme",
"(",
"string",
"$",
"alphabet",
",",
"string",
"$",
"ph",
",",
"string",
"$",
"text",
")",
":",
"ContainerElement",
"{",
"/** @var ContainerElement $this */",
"return",
"$",
"this",
"->",
"addElement",
"(",
"Phoneme",
"::",
"fa... | Adds a phoneme element.
@param string $alphabet
@param string $ph
@param string $text
@return ContainerElement | [
"Adds",
"a",
"phoneme",
"element",
"."
] | cafb979b777480baf7a01b5db2bf7c2cff837805 | https://github.com/Techworker/ssml/blob/cafb979b777480baf7a01b5db2bf7c2cff837805/src/Traits/PhonemeTrait.php#L32-L36 |
226,284 | phergie/phergie-irc-client-react | src/Client.php | Client.getLoop | public function getLoop()
{
if (!$this->loop) {
$this->loop = \React\EventLoop\Factory::create();
}
return $this->loop;
} | php | public function getLoop()
{
if (!$this->loop) {
$this->loop = \React\EventLoop\Factory::create();
}
return $this->loop;
} | [
"public",
"function",
"getLoop",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"loop",
")",
"{",
"$",
"this",
"->",
"loop",
"=",
"\\",
"React",
"\\",
"EventLoop",
"\\",
"Factory",
"::",
"create",
"(",
")",
";",
"}",
"return",
"$",
"this",
"->... | Returns the event loop dependency, initializing it if needed.
@return \React\EventLoop\LoopInterface | [
"Returns",
"the",
"event",
"loop",
"dependency",
"initializing",
"it",
"if",
"needed",
"."
] | b0d03f1e1ff34a2868f1f7d677786fdd1786b320 | https://github.com/phergie/phergie-irc-client-react/blob/b0d03f1e1ff34a2868f1f7d677786fdd1786b320/src/Client.php#L100-L106 |
226,285 | phergie/phergie-irc-client-react | src/Client.php | Client.getResolver | public function getResolver()
{
if ($this->resolver instanceof Resolver) {
return $this->resolver;
}
$factory = new Factory();
$this->resolver = $factory->createCached($this->getDnsServer(), $this->getLoop());
return $this->resolver;
} | php | public function getResolver()
{
if ($this->resolver instanceof Resolver) {
return $this->resolver;
}
$factory = new Factory();
$this->resolver = $factory->createCached($this->getDnsServer(), $this->getLoop());
return $this->resolver;
} | [
"public",
"function",
"getResolver",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"resolver",
"instanceof",
"Resolver",
")",
"{",
"return",
"$",
"this",
"->",
"resolver",
";",
"}",
"$",
"factory",
"=",
"new",
"Factory",
"(",
")",
";",
"$",
"this",
"-... | Get the DNS Resolver, if one isn't set in instance will be created.
@return Resolver | [
"Get",
"the",
"DNS",
"Resolver",
"if",
"one",
"isn",
"t",
"set",
"in",
"instance",
"will",
"be",
"created",
"."
] | b0d03f1e1ff34a2868f1f7d677786fdd1786b320 | https://github.com/phergie/phergie-irc-client-react/blob/b0d03f1e1ff34a2868f1f7d677786fdd1786b320/src/Client.php#L123-L133 |
226,286 | phergie/phergie-irc-client-react | src/Client.php | Client.addActiveConnection | protected function addActiveConnection(ConnectionInterface $connection)
{
if (!$this->activeConnections) {
$this->activeConnections = new \SplObjectStorage;
}
$this->activeConnections->attach($connection);
} | php | protected function addActiveConnection(ConnectionInterface $connection)
{
if (!$this->activeConnections) {
$this->activeConnections = new \SplObjectStorage;
}
$this->activeConnections->attach($connection);
} | [
"protected",
"function",
"addActiveConnection",
"(",
"ConnectionInterface",
"$",
"connection",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"activeConnections",
")",
"{",
"$",
"this",
"->",
"activeConnections",
"=",
"new",
"\\",
"SplObjectStorage",
";",
"}",
"... | Add a connection instance to the active connection store
@param \Phergie\Irc\ConnectionInterface | [
"Add",
"a",
"connection",
"instance",
"to",
"the",
"active",
"connection",
"store"
] | b0d03f1e1ff34a2868f1f7d677786fdd1786b320 | https://github.com/phergie/phergie-irc-client-react/blob/b0d03f1e1ff34a2868f1f7d677786fdd1786b320/src/Client.php#L180-L186 |
226,287 | phergie/phergie-irc-client-react | src/Client.php | Client.getSocket | protected function getSocket($remote, array $context)
{
$socket = stream_socket_client(
$remote,
$errno,
$errstr,
ini_get('default_socket_timeout'),
STREAM_CLIENT_CONNECT,
stream_context_create($context)
);
if (!$socket... | php | protected function getSocket($remote, array $context)
{
$socket = stream_socket_client(
$remote,
$errno,
$errstr,
ini_get('default_socket_timeout'),
STREAM_CLIENT_CONNECT,
stream_context_create($context)
);
if (!$socket... | [
"protected",
"function",
"getSocket",
"(",
"$",
"remote",
",",
"array",
"$",
"context",
")",
"{",
"$",
"socket",
"=",
"stream_socket_client",
"(",
"$",
"remote",
",",
"$",
"errno",
",",
"$",
"errstr",
",",
"ini_get",
"(",
"'default_socket_timeout'",
")",
"... | Returns a socket configured for a specified remote.
@param string $remote Address to connect the socket to (e.g. tcp://irc.freenode.net:6667)
@param array $context Context options for the socket
@return resource
@throws \Phergie\Irc\Client\React\Exception if unable to connect to the specified remote | [
"Returns",
"a",
"socket",
"configured",
"for",
"a",
"specified",
"remote",
"."
] | b0d03f1e1ff34a2868f1f7d677786fdd1786b320 | https://github.com/phergie/phergie-irc-client-react/blob/b0d03f1e1ff34a2868f1f7d677786fdd1786b320/src/Client.php#L218-L239 |
226,288 | phergie/phergie-irc-client-react | src/Client.php | Client.getRemote | protected function getRemote(ConnectionInterface $connection)
{
$hostname = $connection->getServerHostname();
$port = $connection->getServerPort();
$deferred = new Deferred();
$this->resolveHostname($hostname)
->then(
function($ip) use($deferred, $port) {... | php | protected function getRemote(ConnectionInterface $connection)
{
$hostname = $connection->getServerHostname();
$port = $connection->getServerPort();
$deferred = new Deferred();
$this->resolveHostname($hostname)
->then(
function($ip) use($deferred, $port) {... | [
"protected",
"function",
"getRemote",
"(",
"ConnectionInterface",
"$",
"connection",
")",
"{",
"$",
"hostname",
"=",
"$",
"connection",
"->",
"getServerHostname",
"(",
")",
";",
"$",
"port",
"=",
"$",
"connection",
"->",
"getServerPort",
"(",
")",
";",
"$",
... | Derives a remote for a given connection.
@param \Phergie\Irc\ConnectionInterface $connection
@return string Remote usable to establish a socket connection | [
"Derives",
"a",
"remote",
"for",
"a",
"given",
"connection",
"."
] | b0d03f1e1ff34a2868f1f7d677786fdd1786b320 | https://github.com/phergie/phergie-irc-client-react/blob/b0d03f1e1ff34a2868f1f7d677786fdd1786b320/src/Client.php#L280-L297 |
226,289 | phergie/phergie-irc-client-react | src/Client.php | Client.resolveHostname | protected function resolveHostname($hostname)
{
if (false !== filter_var($hostname, FILTER_VALIDATE_IP)) {
return \React\Promise\resolve($hostname);
}
return $this->getResolver()->resolve($hostname);
} | php | protected function resolveHostname($hostname)
{
if (false !== filter_var($hostname, FILTER_VALIDATE_IP)) {
return \React\Promise\resolve($hostname);
}
return $this->getResolver()->resolve($hostname);
} | [
"protected",
"function",
"resolveHostname",
"(",
"$",
"hostname",
")",
"{",
"if",
"(",
"false",
"!==",
"filter_var",
"(",
"$",
"hostname",
",",
"FILTER_VALIDATE_IP",
")",
")",
"{",
"return",
"\\",
"React",
"\\",
"Promise",
"\\",
"resolve",
"(",
"$",
"hostn... | Resolve an IP address from a hostname
@param string $hostname
@return PromiseInterface promise resolving to the hostname's IP | [
"Resolve",
"an",
"IP",
"address",
"from",
"a",
"hostname"
] | b0d03f1e1ff34a2868f1f7d677786fdd1786b320 | https://github.com/phergie/phergie-irc-client-react/blob/b0d03f1e1ff34a2868f1f7d677786fdd1786b320/src/Client.php#L305-L312 |
226,290 | phergie/phergie-irc-client-react | src/Client.php | Client.getContext | protected function getContext(ConnectionInterface $connection)
{
$context = array();
if ($this->getForceIpv4Flag($connection)) {
$context['bindto'] = '0.0.0.0:0';
}
$context = array('socket' => $context);
return $context;
} | php | protected function getContext(ConnectionInterface $connection)
{
$context = array();
if ($this->getForceIpv4Flag($connection)) {
$context['bindto'] = '0.0.0.0:0';
}
$context = array('socket' => $context);
return $context;
} | [
"protected",
"function",
"getContext",
"(",
"ConnectionInterface",
"$",
"connection",
")",
"{",
"$",
"context",
"=",
"array",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"getForceIpv4Flag",
"(",
"$",
"connection",
")",
")",
"{",
"$",
"context",
"[",
"'b... | Derives a set of socket context options for a given connection.
@param \Phergie\Irc\ConnectionInterface $connection
@return array Associative array of context option key-value pairs | [
"Derives",
"a",
"set",
"of",
"socket",
"context",
"options",
"for",
"a",
"given",
"connection",
"."
] | b0d03f1e1ff34a2868f1f7d677786fdd1786b320 | https://github.com/phergie/phergie-irc-client-react/blob/b0d03f1e1ff34a2868f1f7d677786fdd1786b320/src/Client.php#L320-L328 |
226,291 | phergie/phergie-irc-client-react | src/Client.php | Client.getSecureContext | protected function getSecureContext(ConnectionInterface $connection)
{
$context = array();
if ($this->getForceIpv4Flag($connection)) {
$context['bindto'] = '0.0.0.0:0';
}
if ($this->getAllowSelfSignedFlag($connection)) {
$context['allow_self_signed'] = true;
... | php | protected function getSecureContext(ConnectionInterface $connection)
{
$context = array();
if ($this->getForceIpv4Flag($connection)) {
$context['bindto'] = '0.0.0.0:0';
}
if ($this->getAllowSelfSignedFlag($connection)) {
$context['allow_self_signed'] = true;
... | [
"protected",
"function",
"getSecureContext",
"(",
"ConnectionInterface",
"$",
"connection",
")",
"{",
"$",
"context",
"=",
"array",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"getForceIpv4Flag",
"(",
"$",
"connection",
")",
")",
"{",
"$",
"context",
"[",... | Derives a set of socket context options for a given secure connection.
@param \Phergie\Irc\ConnectionInterface $connection
@return array Associative array of context option key-value pairs | [
"Derives",
"a",
"set",
"of",
"socket",
"context",
"options",
"for",
"a",
"given",
"secure",
"connection",
"."
] | b0d03f1e1ff34a2868f1f7d677786fdd1786b320 | https://github.com/phergie/phergie-irc-client-react/blob/b0d03f1e1ff34a2868f1f7d677786fdd1786b320/src/Client.php#L336-L346 |
226,292 | phergie/phergie-irc-client-react | src/Client.php | Client.getStream | protected function getStream($socket)
{
if (class_exists(DuplexResourceStream::class)) {
return new DuplexResourceStream($socket, $this->getLoop());
}
return new Stream($socket, $this->getLoop());
} | php | protected function getStream($socket)
{
if (class_exists(DuplexResourceStream::class)) {
return new DuplexResourceStream($socket, $this->getLoop());
}
return new Stream($socket, $this->getLoop());
} | [
"protected",
"function",
"getStream",
"(",
"$",
"socket",
")",
"{",
"if",
"(",
"class_exists",
"(",
"DuplexResourceStream",
"::",
"class",
")",
")",
"{",
"return",
"new",
"DuplexResourceStream",
"(",
"$",
"socket",
",",
"$",
"this",
"->",
"getLoop",
"(",
"... | Returns a stream for a socket connection.
@param resource $socket Socket for the connection to the server
@param \React\EventLoop\LoopInterface $loop Event loop
@return \React\Stream\DuplexStreamInterface | [
"Returns",
"a",
"stream",
"for",
"a",
"socket",
"connection",
"."
] | b0d03f1e1ff34a2868f1f7d677786fdd1786b320 | https://github.com/phergie/phergie-irc-client-react/blob/b0d03f1e1ff34a2868f1f7d677786fdd1786b320/src/Client.php#L355-L362 |
226,293 | phergie/phergie-irc-client-react | src/Client.php | Client.getOutputLogCallback | protected function getOutputLogCallback(ConnectionInterface $connection, $level, $prefix = null)
{
$logger = $this->getLogger();
if (!method_exists($logger, $level)) {
throw new \DomainException("Invalid log level '$level'");
}
return function($message) use ($connection, ... | php | protected function getOutputLogCallback(ConnectionInterface $connection, $level, $prefix = null)
{
$logger = $this->getLogger();
if (!method_exists($logger, $level)) {
throw new \DomainException("Invalid log level '$level'");
}
return function($message) use ($connection, ... | [
"protected",
"function",
"getOutputLogCallback",
"(",
"ConnectionInterface",
"$",
"connection",
",",
"$",
"level",
",",
"$",
"prefix",
"=",
"null",
")",
"{",
"$",
"logger",
"=",
"$",
"this",
"->",
"getLogger",
"(",
")",
";",
"if",
"(",
"!",
"method_exists"... | Generates a closure for stream output logging.
@param \Phergie\Irc\ConnectionInterface $connection
@param string $level Evenement logging level to use
@param string $prefix Prefix string for log lines (optional)
@return callable
@throws \DomainException if $level is not a valid logging level | [
"Generates",
"a",
"closure",
"for",
"stream",
"output",
"logging",
"."
] | b0d03f1e1ff34a2868f1f7d677786fdd1786b320 | https://github.com/phergie/phergie-irc-client-react/blob/b0d03f1e1ff34a2868f1f7d677786fdd1786b320/src/Client.php#L373-L383 |
226,294 | phergie/phergie-irc-client-react | src/Client.php | Client.addLogging | protected function addLogging(EventEmitter $emitter, ConnectionInterface $connection)
{
$emitter->on('data', $this->getOutputLogCallback($connection, 'debug'));
$emitter->on('error', $this->getOutputLogCallback($connection, 'notice'));
} | php | protected function addLogging(EventEmitter $emitter, ConnectionInterface $connection)
{
$emitter->on('data', $this->getOutputLogCallback($connection, 'debug'));
$emitter->on('error', $this->getOutputLogCallback($connection, 'notice'));
} | [
"protected",
"function",
"addLogging",
"(",
"EventEmitter",
"$",
"emitter",
",",
"ConnectionInterface",
"$",
"connection",
")",
"{",
"$",
"emitter",
"->",
"on",
"(",
"'data'",
",",
"$",
"this",
"->",
"getOutputLogCallback",
"(",
"$",
"connection",
",",
"'debug... | Adds an event listener to log data emitted by a stream.
@param \Evenement\EventEmitter $emitter
@param \Phergie\Irc\ConnectionInterface $connection Connection
corresponding to the stream | [
"Adds",
"an",
"event",
"listener",
"to",
"log",
"data",
"emitted",
"by",
"a",
"stream",
"."
] | b0d03f1e1ff34a2868f1f7d677786fdd1786b320 | https://github.com/phergie/phergie-irc-client-react/blob/b0d03f1e1ff34a2868f1f7d677786fdd1786b320/src/Client.php#L392-L396 |
226,295 | phergie/phergie-irc-client-react | src/Client.php | Client.getReadStream | protected function getReadStream(ConnectionInterface $connection)
{
$read = new ReadStream();
$this->addLogging($read, $connection);
$read->on('invalid', $this->getOutputLogCallback($connection, 'notice', 'Parser unable to parse line: '));
return $read;
} | php | protected function getReadStream(ConnectionInterface $connection)
{
$read = new ReadStream();
$this->addLogging($read, $connection);
$read->on('invalid', $this->getOutputLogCallback($connection, 'notice', 'Parser unable to parse line: '));
return $read;
} | [
"protected",
"function",
"getReadStream",
"(",
"ConnectionInterface",
"$",
"connection",
")",
"{",
"$",
"read",
"=",
"new",
"ReadStream",
"(",
")",
";",
"$",
"this",
"->",
"addLogging",
"(",
"$",
"read",
",",
"$",
"connection",
")",
";",
"$",
"read",
"->... | Returns a stream instance for parsing messages from the server and
emitting them as events.
@param \Phergie\Irc\ConnectionInterface $connection Connection
corresponding to the read stream
@return \Phergie\Irc\Client\React\ReadStream | [
"Returns",
"a",
"stream",
"instance",
"for",
"parsing",
"messages",
"from",
"the",
"server",
"and",
"emitting",
"them",
"as",
"events",
"."
] | b0d03f1e1ff34a2868f1f7d677786fdd1786b320 | https://github.com/phergie/phergie-irc-client-react/blob/b0d03f1e1ff34a2868f1f7d677786fdd1786b320/src/Client.php#L406-L412 |
226,296 | phergie/phergie-irc-client-react | src/Client.php | Client.getWriteStream | protected function getWriteStream(ConnectionInterface $connection)
{
$write = new WriteStream();
$this->addLogging($write, $connection);
return $write;
} | php | protected function getWriteStream(ConnectionInterface $connection)
{
$write = new WriteStream();
$this->addLogging($write, $connection);
return $write;
} | [
"protected",
"function",
"getWriteStream",
"(",
"ConnectionInterface",
"$",
"connection",
")",
"{",
"$",
"write",
"=",
"new",
"WriteStream",
"(",
")",
";",
"$",
"this",
"->",
"addLogging",
"(",
"$",
"write",
",",
"$",
"connection",
")",
";",
"return",
"$",... | Returns a stream instance for sending events to the server.
@param \Phergie\Irc\ConnectionInterface $connection Connection
corresponding to the read stream
@return \Phergie\Irc\Client\React\WriteStream | [
"Returns",
"a",
"stream",
"instance",
"for",
"sending",
"events",
"to",
"the",
"server",
"."
] | b0d03f1e1ff34a2868f1f7d677786fdd1786b320 | https://github.com/phergie/phergie-irc-client-react/blob/b0d03f1e1ff34a2868f1f7d677786fdd1786b320/src/Client.php#L421-L426 |
226,297 | phergie/phergie-irc-client-react | src/Client.php | Client.getLogger | public function getLogger()
{
if (!$this->logger) {
if (!defined('STDERR')) {
// See testGetLoggerRunFromStdin
// @codeCoverageIgnoreStart
define('STDERR', fopen('php://stderr', 'w'));
}
// @codeCoverageIgnoreEnd
... | php | public function getLogger()
{
if (!$this->logger) {
if (!defined('STDERR')) {
// See testGetLoggerRunFromStdin
// @codeCoverageIgnoreStart
define('STDERR', fopen('php://stderr', 'w'));
}
// @codeCoverageIgnoreEnd
... | [
"public",
"function",
"getLogger",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"logger",
")",
"{",
"if",
"(",
"!",
"defined",
"(",
"'STDERR'",
")",
")",
"{",
"// See testGetLoggerRunFromStdin",
"// @codeCoverageIgnoreStart",
"define",
"(",
"'STDERR'",
... | Returns a stream instance for logging data on the socket connection.
@return \Psr\Log\LoggerInterface | [
"Returns",
"a",
"stream",
"instance",
"for",
"logging",
"data",
"on",
"the",
"socket",
"connection",
"."
] | b0d03f1e1ff34a2868f1f7d677786fdd1786b320 | https://github.com/phergie/phergie-irc-client-react/blob/b0d03f1e1ff34a2868f1f7d677786fdd1786b320/src/Client.php#L433-L448 |
226,298 | phergie/phergie-irc-client-react | src/Client.php | Client.getReadCallback | protected function getReadCallback(WriteStream $write, ConnectionInterface $connection)
{
$logger = $this->getLogger();
return function($message) use ($write, $connection, $logger) {
$this->processInput($message, $write, $connection);
$this->emit('irc.received', array($messag... | php | protected function getReadCallback(WriteStream $write, ConnectionInterface $connection)
{
$logger = $this->getLogger();
return function($message) use ($write, $connection, $logger) {
$this->processInput($message, $write, $connection);
$this->emit('irc.received', array($messag... | [
"protected",
"function",
"getReadCallback",
"(",
"WriteStream",
"$",
"write",
",",
"ConnectionInterface",
"$",
"connection",
")",
"{",
"$",
"logger",
"=",
"$",
"this",
"->",
"getLogger",
"(",
")",
";",
"return",
"function",
"(",
"$",
"message",
")",
"use",
... | Returns a callback for proxying IRC events from the read stream to IRC
listeners of the client.
@param \Phergie\Irc\Client\React\WriteStream $write Write stream
corresponding to the read stream on which the event occurred
@param \Phergie\Irc\ConnectionInterface $connection Connection on
which the event occurred
@retur... | [
"Returns",
"a",
"callback",
"for",
"proxying",
"IRC",
"events",
"from",
"the",
"read",
"stream",
"to",
"IRC",
"listeners",
"of",
"the",
"client",
"."
] | b0d03f1e1ff34a2868f1f7d677786fdd1786b320 | https://github.com/phergie/phergie-irc-client-react/blob/b0d03f1e1ff34a2868f1f7d677786fdd1786b320/src/Client.php#L470-L477 |
226,299 | phergie/phergie-irc-client-react | src/Client.php | Client.getWriteCallback | protected function getWriteCallback(WriteStream $write, ConnectionInterface $connection)
{
$logger = $this->getLogger();
return function($message) use ($write, $connection, $logger) {
$this->emit('irc.sent', array($message, $write, $connection, $logger));
};
} | php | protected function getWriteCallback(WriteStream $write, ConnectionInterface $connection)
{
$logger = $this->getLogger();
return function($message) use ($write, $connection, $logger) {
$this->emit('irc.sent', array($message, $write, $connection, $logger));
};
} | [
"protected",
"function",
"getWriteCallback",
"(",
"WriteStream",
"$",
"write",
",",
"ConnectionInterface",
"$",
"connection",
")",
"{",
"$",
"logger",
"=",
"$",
"this",
"->",
"getLogger",
"(",
")",
";",
"return",
"function",
"(",
"$",
"message",
")",
"use",
... | Returns a callback for proxying events from the write stream to IRC
listeners of the client.
@param \Phergie\Irc\Client\React\WriteStream $write Write stream
corresponding to the read stream on which the event occurred
@param \Phergie\Irc\ConnectionInterface $connection Connection on which
the event occurred
@return c... | [
"Returns",
"a",
"callback",
"for",
"proxying",
"events",
"from",
"the",
"write",
"stream",
"to",
"IRC",
"listeners",
"of",
"the",
"client",
"."
] | b0d03f1e1ff34a2868f1f7d677786fdd1786b320 | https://github.com/phergie/phergie-irc-client-react/blob/b0d03f1e1ff34a2868f1f7d677786fdd1786b320/src/Client.php#L489-L495 |
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.