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
199,400
vdhicts/dicms-html-element
src/Element.php
Element.generateTagAttributes
private function generateTagAttributes(): string { // When no attributes present, return empty string if (count($this->getAttributes()) === 0) { return ''; } // Collect the attributes $renderedAttributes = []; foreach ($this->getAttributes() as $attribute...
php
private function generateTagAttributes(): string { // When no attributes present, return empty string if (count($this->getAttributes()) === 0) { return ''; } // Collect the attributes $renderedAttributes = []; foreach ($this->getAttributes() as $attribute...
[ "private", "function", "generateTagAttributes", "(", ")", ":", "string", "{", "// When no attributes present, return empty string", "if", "(", "count", "(", "$", "this", "->", "getAttributes", "(", ")", ")", "===", "0", ")", "{", "return", "''", ";", "}", "// ...
Generates the HTML for the attributes of the HTML element. @return string
[ "Generates", "the", "HTML", "for", "the", "attributes", "of", "the", "HTML", "element", "." ]
4b1013c78cd8d1bc677508ec732a1ba5305e7e4e
https://github.com/vdhicts/dicms-html-element/blob/4b1013c78cd8d1bc677508ec732a1ba5305e7e4e/src/Element.php#L281-L297
199,401
vdhicts/dicms-html-element
src/Element.php
Element.generate
public function generate(): string { // The tag name is required if ($this->getTag() === '') { return ''; } // Generate the attribute string $tagAttributes = $this->generateTagAttributes(); // When attributes are provided, add a space between the tag and...
php
public function generate(): string { // The tag name is required if ($this->getTag() === '') { return ''; } // Generate the attribute string $tagAttributes = $this->generateTagAttributes(); // When attributes are provided, add a space between the tag and...
[ "public", "function", "generate", "(", ")", ":", "string", "{", "// The tag name is required", "if", "(", "$", "this", "->", "getTag", "(", ")", "===", "''", ")", "{", "return", "''", ";", "}", "// Generate the attribute string", "$", "tagAttributes", "=", "...
Generates the HTML tag with it's attributes and text. @return string
[ "Generates", "the", "HTML", "tag", "with", "it", "s", "attributes", "and", "text", "." ]
4b1013c78cd8d1bc677508ec732a1ba5305e7e4e
https://github.com/vdhicts/dicms-html-element/blob/4b1013c78cd8d1bc677508ec732a1ba5305e7e4e/src/Element.php#L303-L335
199,402
Linkvalue-Interne/MajoraOAuthServerBundle
src/Majora/Bundle/OAuthServerBundle/Controller/TokenApiController.php
TokenApiController.postAction
public function postAction(Request $request) { try { return $this->createJsonResponse($this->get('oauth.server')->grant( $this->getRequestData($request, 'snakelize') )); } catch (InvalidGrantException $e) { return new JsonResponse('Unavailable to c...
php
public function postAction(Request $request) { try { return $this->createJsonResponse($this->get('oauth.server')->grant( $this->getRequestData($request, 'snakelize') )); } catch (InvalidGrantException $e) { return new JsonResponse('Unavailable to c...
[ "public", "function", "postAction", "(", "Request", "$", "request", ")", "{", "try", "{", "return", "$", "this", "->", "createJsonResponse", "(", "$", "this", "->", "get", "(", "'oauth.server'", ")", "->", "grant", "(", "$", "this", "->", "getRequestData",...
Create a new access_token from given request throught oAuth server. @param Request $request @return Response
[ "Create", "a", "new", "access_token", "from", "given", "request", "throught", "oAuth", "server", "." ]
3e84e2494c947d1bd5d5c16221a3b9e343ebff92
https://github.com/Linkvalue-Interne/MajoraOAuthServerBundle/blob/3e84e2494c947d1bd5d5c16221a3b9e343ebff92/src/Majora/Bundle/OAuthServerBundle/Controller/TokenApiController.php#L25-L36
199,403
wb-crowdfusion/crowdfusion
system/core/classes/libraries/storagefacility/StorageFacilityFile.php
StorageFacilityFile.setID
public function setID($id) { if($id !== null && substr($id, 0, 1) !== '/') throw new Exception("invalid file id, must start with a /"); $this->id = $id; }
php
public function setID($id) { if($id !== null && substr($id, 0, 1) !== '/') throw new Exception("invalid file id, must start with a /"); $this->id = $id; }
[ "public", "function", "setID", "(", "$", "id", ")", "{", "if", "(", "$", "id", "!==", "null", "&&", "substr", "(", "$", "id", ",", "0", ",", "1", ")", "!==", "'/'", ")", "throw", "new", "Exception", "(", "\"invalid file id, must start with a /\"", ")",...
Set the ID for this file @param string $id The id to set @return void
[ "Set", "the", "ID", "for", "this", "file" ]
8cad7988f046a6fefbed07d026cb4ae6706c1217
https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/libraries/storagefacility/StorageFacilityFile.php#L123-L128
199,404
wb-crowdfusion/crowdfusion
system/core/classes/libraries/storagefacility/StorageFacilityFile.php
StorageFacilityFile.isValid
public function isValid() { return $this->getID() != null && $this->getURL() != null && $this->getLocalPath() != null; }
php
public function isValid() { return $this->getID() != null && $this->getURL() != null && $this->getLocalPath() != null; }
[ "public", "function", "isValid", "(", ")", "{", "return", "$", "this", "->", "getID", "(", ")", "!=", "null", "&&", "$", "this", "->", "getURL", "(", ")", "!=", "null", "&&", "$", "this", "->", "getLocalPath", "(", ")", "!=", "null", ";", "}" ]
Determines if this is a valid file object or not. @return boolean
[ "Determines", "if", "this", "is", "a", "valid", "file", "object", "or", "not", "." ]
8cad7988f046a6fefbed07d026cb4ae6706c1217
https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/libraries/storagefacility/StorageFacilityFile.php#L189-L192
199,405
horntell/php-sdk
lib/guzzle/GuzzleHttp/Cookie/CookieJar.php
CookieJar.getCookieValue
public static function getCookieValue($value) { if (substr($value, 0, 1) !== '"' && substr($value, -1, 1) !== '"' && strpbrk($value, ';,') ) { $value = '"' . $value . '"'; } return $value; }
php
public static function getCookieValue($value) { if (substr($value, 0, 1) !== '"' && substr($value, -1, 1) !== '"' && strpbrk($value, ';,') ) { $value = '"' . $value . '"'; } return $value; }
[ "public", "static", "function", "getCookieValue", "(", "$", "value", ")", "{", "if", "(", "substr", "(", "$", "value", ",", "0", ",", "1", ")", "!==", "'\"'", "&&", "substr", "(", "$", "value", ",", "-", "1", ",", "1", ")", "!==", "'\"'", "&&", ...
Quote the cookie value if it is not already quoted and it contains problematic characters. @param string $value Value that may or may not need to be quoted @return string
[ "Quote", "the", "cookie", "value", "if", "it", "is", "not", "already", "quoted", "and", "it", "contains", "problematic", "characters", "." ]
e5205e9396a21b754d5651a8aa5898da5922a1b7
https://github.com/horntell/php-sdk/blob/e5205e9396a21b754d5651a8aa5898da5922a1b7/lib/guzzle/GuzzleHttp/Cookie/CookieJar.php#L69-L79
199,406
devlabmtl/haven-core
Lib/NestedSet/NodeWrapper.php
NodeWrapper.getFirstChild
public function getFirstChild() { if($this->isLeaf()) { return null; } if($this->children !== null) { $ary = array_slice($this->children, 0, 1); return $ary[0]; } $qb = $this->getManager()->getConfiguration()->getBaseQuery...
php
public function getFirstChild() { if($this->isLeaf()) { return null; } if($this->children !== null) { $ary = array_slice($this->children, 0, 1); return $ary[0]; } $qb = $this->getManager()->getConfiguration()->getBaseQuery...
[ "public", "function", "getFirstChild", "(", ")", "{", "if", "(", "$", "this", "->", "isLeaf", "(", ")", ")", "{", "return", "null", ";", "}", "if", "(", "$", "this", "->", "children", "!==", "null", ")", "{", "$", "ary", "=", "array_slice", "(", ...
gets first child or null @return NodeWrapper
[ "gets", "first", "child", "or", "null" ]
f13410f996fd4002efafe482b927adadb211dec8
https://github.com/devlabmtl/haven-core/blob/f13410f996fd4002efafe482b927adadb211dec8/Lib/NestedSet/NodeWrapper.php#L85-L116
199,407
devlabmtl/haven-core
Lib/NestedSet/NodeWrapper.php
NodeWrapper.getDescendants
public function getDescendants($depth = null) { if(!$this->hasChildren()) { return array(); } if($this->descendants === null) { $qb = $this->getManager()->getConfiguration()->getBaseQueryBuilder(); $alias = $this->getManager()->getConfigur...
php
public function getDescendants($depth = null) { if(!$this->hasChildren()) { return array(); } if($this->descendants === null) { $qb = $this->getManager()->getConfiguration()->getBaseQueryBuilder(); $alias = $this->getManager()->getConfigur...
[ "public", "function", "getDescendants", "(", "$", "depth", "=", "null", ")", "{", "if", "(", "!", "$", "this", "->", "hasChildren", "(", ")", ")", "{", "return", "array", "(", ")", ";", "}", "if", "(", "$", "this", "->", "descendants", "===", "null...
gets descendants for this node @param int $depth or null for unlimited depth @return array array of NodeWrapper objects
[ "gets", "descendants", "for", "this", "node" ]
f13410f996fd4002efafe482b927adadb211dec8
https://github.com/devlabmtl/haven-core/blob/f13410f996fd4002efafe482b927adadb211dec8/Lib/NestedSet/NodeWrapper.php#L181-L225
199,408
devlabmtl/haven-core
Lib/NestedSet/NodeWrapper.php
NodeWrapper.getParent
public function getParent() { if($this->isRoot()) { return null; } if($this->parent == null && $this->ancestors) { // Shortcut if we already loaded the ancestors $this->parent = $this->ancestors[count($this->ancestors)-1]; } ...
php
public function getParent() { if($this->isRoot()) { return null; } if($this->parent == null && $this->ancestors) { // Shortcut if we already loaded the ancestors $this->parent = $this->ancestors[count($this->ancestors)-1]; } ...
[ "public", "function", "getParent", "(", ")", "{", "if", "(", "$", "this", "->", "isRoot", "(", ")", ")", "{", "return", "null", ";", "}", "if", "(", "$", "this", "->", "parent", "==", "null", "&&", "$", "this", "->", "ancestors", ")", "{", "// Sh...
gets parent Node or null @return NodeWrapper
[ "gets", "parent", "Node", "or", "null" ]
f13410f996fd4002efafe482b927adadb211dec8
https://github.com/devlabmtl/haven-core/blob/f13410f996fd4002efafe482b927adadb211dec8/Lib/NestedSet/NodeWrapper.php#L233-L273
199,409
devlabmtl/haven-core
Lib/NestedSet/NodeWrapper.php
NodeWrapper.getAncestors
public function getAncestors() { if($this->isRoot()) { return array(); } if($this->ancestors === null) { $qb = $this->getManager()->getConfiguration()->getBaseQueryBuilder(); $alias = $this->getManager()->getConfiguration()->getQueryBuilde...
php
public function getAncestors() { if($this->isRoot()) { return array(); } if($this->ancestors === null) { $qb = $this->getManager()->getConfiguration()->getBaseQueryBuilder(); $alias = $this->getManager()->getConfiguration()->getQueryBuilde...
[ "public", "function", "getAncestors", "(", ")", "{", "if", "(", "$", "this", "->", "isRoot", "(", ")", ")", "{", "return", "array", "(", ")", ";", "}", "if", "(", "$", "this", "->", "ancestors", "===", "null", ")", "{", "$", "qb", "=", "$", "th...
gets ancestors for node @return array array of NodeWrapper objects
[ "gets", "ancestors", "for", "node" ]
f13410f996fd4002efafe482b927adadb211dec8
https://github.com/devlabmtl/haven-core/blob/f13410f996fd4002efafe482b927adadb211dec8/Lib/NestedSet/NodeWrapper.php#L281-L318
199,410
devlabmtl/haven-core
Lib/NestedSet/NodeWrapper.php
NodeWrapper.getLevel
public function getLevel() { if($this->level === null) { $this->level = count($this->getAncestors()); } return $this->level; }
php
public function getLevel() { if($this->level === null) { $this->level = count($this->getAncestors()); } return $this->level; }
[ "public", "function", "getLevel", "(", ")", "{", "if", "(", "$", "this", "->", "level", "===", "null", ")", "{", "$", "this", "->", "level", "=", "count", "(", "$", "this", "->", "getAncestors", "(", ")", ")", ";", "}", "return", "$", "this", "->...
gets the level of this node @return int
[ "gets", "the", "level", "of", "this", "node" ]
f13410f996fd4002efafe482b927adadb211dec8
https://github.com/devlabmtl/haven-core/blob/f13410f996fd4002efafe482b927adadb211dec8/Lib/NestedSet/NodeWrapper.php#L326-L334
199,411
devlabmtl/haven-core
Lib/NestedSet/NodeWrapper.php
NodeWrapper.getSiblings
public function getSiblings($includeNode=false) { $parent = $this->getParent(); $siblings = array(); if($parent && $parent->isValidNode()) { $children = $parent->getChildren(); foreach($children as $child) { if(!$includeNode && $thi...
php
public function getSiblings($includeNode=false) { $parent = $this->getParent(); $siblings = array(); if($parent && $parent->isValidNode()) { $children = $parent->getChildren(); foreach($children as $child) { if(!$includeNode && $thi...
[ "public", "function", "getSiblings", "(", "$", "includeNode", "=", "false", ")", "{", "$", "parent", "=", "$", "this", "->", "getParent", "(", ")", ";", "$", "siblings", "=", "array", "(", ")", ";", "if", "(", "$", "parent", "&&", "$", "parent", "-...
gets siblings for node @param bool $includeNode whether to include this node in the list of sibling nodes (default: false) @return array array of NodeWrapper objects
[ "gets", "siblings", "for", "node" ]
f13410f996fd4002efafe482b927adadb211dec8
https://github.com/devlabmtl/haven-core/blob/f13410f996fd4002efafe482b927adadb211dec8/Lib/NestedSet/NodeWrapper.php#L479-L497
199,412
devlabmtl/haven-core
Lib/NestedSet/NodeWrapper.php
NodeWrapper.getPrevSibling
public function getPrevSibling() { // If parent and children are already loaded, avoid database query if($this->parent !== null && ($children = $this->parent->internalGetChildren()) !== null) { for($i=0; $i<count($children); $i++) { if($children[$i] ==...
php
public function getPrevSibling() { // If parent and children are already loaded, avoid database query if($this->parent !== null && ($children = $this->parent->internalGetChildren()) !== null) { for($i=0; $i<count($children); $i++) { if($children[$i] ==...
[ "public", "function", "getPrevSibling", "(", ")", "{", "// If parent and children are already loaded, avoid database query", "if", "(", "$", "this", "->", "parent", "!==", "null", "&&", "(", "$", "children", "=", "$", "this", "->", "parent", "->", "internalGetChildr...
gets prev sibling or null @return Node
[ "gets", "prev", "sibling", "or", "null" ]
f13410f996fd4002efafe482b927adadb211dec8
https://github.com/devlabmtl/haven-core/blob/f13410f996fd4002efafe482b927adadb211dec8/Lib/NestedSet/NodeWrapper.php#L505-L545
199,413
devlabmtl/haven-core
Lib/NestedSet/NodeWrapper.php
NodeWrapper.insertAsParentOf
public function insertAsParentOf(NodeWrapper $node) { if($node == $this) { throw new \InvalidArgumentException('Cannot insert node as a parent of itself'); } if($this->isValidNode()) { throw new \InvalidArgumentException('Cannot insert a node that alr...
php
public function insertAsParentOf(NodeWrapper $node) { if($node == $this) { throw new \InvalidArgumentException('Cannot insert node as a parent of itself'); } if($this->isValidNode()) { throw new \InvalidArgumentException('Cannot insert a node that alr...
[ "public", "function", "insertAsParentOf", "(", "NodeWrapper", "$", "node", ")", "{", "if", "(", "$", "node", "==", "$", "this", ")", "{", "throw", "new", "\\", "InvalidArgumentException", "(", "'Cannot insert node as a parent of itself'", ")", ";", "}", "if", ...
inserts node as parent of given node @param NodeWrapper $node
[ "inserts", "node", "as", "parent", "of", "given", "node" ]
f13410f996fd4002efafe482b927adadb211dec8
https://github.com/devlabmtl/haven-core/blob/f13410f996fd4002efafe482b927adadb211dec8/Lib/NestedSet/NodeWrapper.php#L634-L697
199,414
devlabmtl/haven-core
Lib/NestedSet/NodeWrapper.php
NodeWrapper.insertAsPrevSiblingOf
public function insertAsPrevSiblingOf(NodeWrapper $node) { if($node == $this) { throw new \InvalidArgumentException('Cannot insert node as a sibling of itself'); } $em = $this->getManager()->getEntityManager(); $newLeft = $node->getLeftValue(); $newRight ...
php
public function insertAsPrevSiblingOf(NodeWrapper $node) { if($node == $this) { throw new \InvalidArgumentException('Cannot insert node as a sibling of itself'); } $em = $this->getManager()->getEntityManager(); $newLeft = $node->getLeftValue(); $newRight ...
[ "public", "function", "insertAsPrevSiblingOf", "(", "NodeWrapper", "$", "node", ")", "{", "if", "(", "$", "node", "==", "$", "this", ")", "{", "throw", "new", "\\", "InvalidArgumentException", "(", "'Cannot insert node as a sibling of itself'", ")", ";", "}", "$...
inserts node as previous sibling of given node @param NodeWrapper $node
[ "inserts", "node", "as", "previous", "sibling", "of", "given", "node" ]
f13410f996fd4002efafe482b927adadb211dec8
https://github.com/devlabmtl/haven-core/blob/f13410f996fd4002efafe482b927adadb211dec8/Lib/NestedSet/NodeWrapper.php#L705-L736
199,415
devlabmtl/haven-core
Lib/NestedSet/NodeWrapper.php
NodeWrapper.moveAsLastChildOf
public function moveAsLastChildOf(NodeWrapper $node) { if($node == $this) { throw new \InvalidArgumentException('Cannot move node as a child of itself'); } $em = $this->getManager()->getEntityManager(); // beginTransaction $em->getConnection()->beginTran...
php
public function moveAsLastChildOf(NodeWrapper $node) { if($node == $this) { throw new \InvalidArgumentException('Cannot move node as a child of itself'); } $em = $this->getManager()->getEntityManager(); // beginTransaction $em->getConnection()->beginTran...
[ "public", "function", "moveAsLastChildOf", "(", "NodeWrapper", "$", "node", ")", "{", "if", "(", "$", "node", "==", "$", "this", ")", "{", "throw", "new", "\\", "InvalidArgumentException", "(", "'Cannot move node as a child of itself'", ")", ";", "}", "$", "em...
moves node as last child of the given node @param NodeWrapper $node
[ "moves", "node", "as", "last", "child", "of", "the", "given", "node" ]
f13410f996fd4002efafe482b927adadb211dec8
https://github.com/devlabmtl/haven-core/blob/f13410f996fd4002efafe482b927adadb211dec8/Lib/NestedSet/NodeWrapper.php#L987-L1021
199,416
devlabmtl/haven-core
Lib/NestedSet/NodeWrapper.php
NodeWrapper.makeRoot
public function makeRoot($newRoot) { if($this->isRoot()) { return; } if(!$this->hasManyRoots()) { throw new \BadMethodCallException(sprintf('%s::%s is only supported on multiple root trees', __CLASS__, __METHOD__)); } $em = $this->get...
php
public function makeRoot($newRoot) { if($this->isRoot()) { return; } if(!$this->hasManyRoots()) { throw new \BadMethodCallException(sprintf('%s::%s is only supported on multiple root trees', __CLASS__, __METHOD__)); } $em = $this->get...
[ "public", "function", "makeRoot", "(", "$", "newRoot", ")", "{", "if", "(", "$", "this", "->", "isRoot", "(", ")", ")", "{", "return", ";", "}", "if", "(", "!", "$", "this", "->", "hasManyRoots", "(", ")", ")", "{", "throw", "new", "\\", "BadMeth...
Makes this node a root node. @param mixed $newRoot
[ "Makes", "this", "node", "a", "root", "node", "." ]
f13410f996fd4002efafe482b927adadb211dec8
https://github.com/devlabmtl/haven-core/blob/f13410f996fd4002efafe482b927adadb211dec8/Lib/NestedSet/NodeWrapper.php#L1029-L1096
199,417
devlabmtl/haven-core
Lib/NestedSet/NodeWrapper.php
NodeWrapper.addChild
public function addChild(Node $node) { if($node instanceof NodeWrapper) { if($node == $this) { throw new \InvalidArgumentException('Cannot insert node as a child of itself'); } $node->insertAsLastChildOf($this); return $nod...
php
public function addChild(Node $node) { if($node instanceof NodeWrapper) { if($node == $this) { throw new \InvalidArgumentException('Cannot insert node as a child of itself'); } $node->insertAsLastChildOf($this); return $nod...
[ "public", "function", "addChild", "(", "Node", "$", "node", ")", "{", "if", "(", "$", "node", "instanceof", "NodeWrapper", ")", "{", "if", "(", "$", "node", "==", "$", "this", ")", "{", "throw", "new", "\\", "InvalidArgumentException", "(", "'Cannot inse...
adds given node as the last child of this entity @param Node $node @return NodeWrapper $wrapper
[ "adds", "given", "node", "as", "the", "last", "child", "of", "this", "entity" ]
f13410f996fd4002efafe482b927adadb211dec8
https://github.com/devlabmtl/haven-core/blob/f13410f996fd4002efafe482b927adadb211dec8/Lib/NestedSet/NodeWrapper.php#L1106-L1150
199,418
devlabmtl/haven-core
Lib/NestedSet/NodeWrapper.php
NodeWrapper.delete
public function delete() { $em = $this->getManager()->getEntityManager(); $lftField = $this->getLeftFieldName(); $rgtField = $this->getRightFieldName(); $oldLft = $this->getLeftValue(); $oldRgt = $this->getRightValue(); $oldRoot = $this->hasManyRoots() ? $this->getRo...
php
public function delete() { $em = $this->getManager()->getEntityManager(); $lftField = $this->getLeftFieldName(); $rgtField = $this->getRightFieldName(); $oldLft = $this->getLeftValue(); $oldRgt = $this->getRightValue(); $oldRoot = $this->hasManyRoots() ? $this->getRo...
[ "public", "function", "delete", "(", ")", "{", "$", "em", "=", "$", "this", "->", "getManager", "(", ")", "->", "getEntityManager", "(", ")", ";", "$", "lftField", "=", "$", "this", "->", "getLeftFieldName", "(", ")", ";", "$", "rgtField", "=", "$", ...
deletes this node and it's decendants
[ "deletes", "this", "node", "and", "it", "s", "decendants" ]
f13410f996fd4002efafe482b927adadb211dec8
https://github.com/devlabmtl/haven-core/blob/f13410f996fd4002efafe482b927adadb211dec8/Lib/NestedSet/NodeWrapper.php#L1157-L1202
199,419
devlabmtl/haven-core
Lib/NestedSet/NodeWrapper.php
NodeWrapper.insertNode
protected function insertNode($destLeft, $destRight, $destRoot=null) { $this->setLeftValue($destLeft); $this->setRightValue($destRight); if($this->hasManyRoots()) { $this->setRootValue($destRoot); } $this->getManager()->getEntityManager()->persist($this->g...
php
protected function insertNode($destLeft, $destRight, $destRoot=null) { $this->setLeftValue($destLeft); $this->setRightValue($destRight); if($this->hasManyRoots()) { $this->setRootValue($destRoot); } $this->getManager()->getEntityManager()->persist($this->g...
[ "protected", "function", "insertNode", "(", "$", "destLeft", ",", "$", "destRight", ",", "$", "destRoot", "=", "null", ")", "{", "$", "this", "->", "setLeftValue", "(", "$", "destLeft", ")", ";", "$", "this", "->", "setRightValue", "(", "$", "destRight",...
sets node's left and right values and persist's it NOTE: This method does not wrap its database queries in a transaction. This should be done before invoking this code. @param int $destLeft @param int $destRight @param mixed $destRoot
[ "sets", "node", "s", "left", "and", "right", "values", "and", "persist", "s", "it" ]
f13410f996fd4002efafe482b927adadb211dec8
https://github.com/devlabmtl/haven-core/blob/f13410f996fd4002efafe482b927adadb211dec8/Lib/NestedSet/NodeWrapper.php#L1216-L1225
199,420
devlabmtl/haven-core
Lib/NestedSet/NodeWrapper.php
NodeWrapper.isDescendantOf
public function isDescendantOf(Node $node) { return (($this->getLeftValue() > $node->getLeftValue()) && ($this->getRightValue() < $node->getRightValue()) && (!$this->hasManyRoots() || ($this->getRootValue() == $node->getRootValue()))); }
php
public function isDescendantOf(Node $node) { return (($this->getLeftValue() > $node->getLeftValue()) && ($this->getRightValue() < $node->getRightValue()) && (!$this->hasManyRoots() || ($this->getRootValue() == $node->getRootValue()))); }
[ "public", "function", "isDescendantOf", "(", "Node", "$", "node", ")", "{", "return", "(", "(", "$", "this", "->", "getLeftValue", "(", ")", ">", "$", "node", "->", "getLeftValue", "(", ")", ")", "&&", "(", "$", "this", "->", "getRightValue", "(", ")...
determines if this node is a child of the given node @param Node @return bool
[ "determines", "if", "this", "node", "is", "a", "child", "of", "the", "given", "node" ]
f13410f996fd4002efafe482b927adadb211dec8
https://github.com/devlabmtl/haven-core/blob/f13410f996fd4002efafe482b927adadb211dec8/Lib/NestedSet/NodeWrapper.php#L1478-L1483
199,421
devlabmtl/haven-core
Lib/NestedSet/NodeWrapper.php
NodeWrapper.isEqualTo
public function isEqualTo(Node $node) { return (($this->getLeftValue() == $node->getLeftValue()) && ($this->getRightValue() == $node->getRightValue()) && (!$this->hasManyRoots() || ($this->getRootValue() == $node->getRootValue()))); }
php
public function isEqualTo(Node $node) { return (($this->getLeftValue() == $node->getLeftValue()) && ($this->getRightValue() == $node->getRightValue()) && (!$this->hasManyRoots() || ($this->getRootValue() == $node->getRootValue()))); }
[ "public", "function", "isEqualTo", "(", "Node", "$", "node", ")", "{", "return", "(", "(", "$", "this", "->", "getLeftValue", "(", ")", "==", "$", "node", "->", "getLeftValue", "(", ")", ")", "&&", "(", "$", "this", "->", "getRightValue", "(", ")", ...
determines if this node is equal to the given node @param Node @return bool
[ "determines", "if", "this", "node", "is", "equal", "to", "the", "given", "node" ]
f13410f996fd4002efafe482b927adadb211dec8
https://github.com/devlabmtl/haven-core/blob/f13410f996fd4002efafe482b927adadb211dec8/Lib/NestedSet/NodeWrapper.php#L1525-L1530
199,422
fuelphp-storage/session
src/Manager.php
Manager.write
public function write() { // do we need to rotate? if ($this->rotationInterval and $this->rotationTimer < time()) { $this->rotate(); } return $this->driver->write(); }
php
public function write() { // do we need to rotate? if ($this->rotationInterval and $this->rotationTimer < time()) { $this->rotate(); } return $this->driver->write(); }
[ "public", "function", "write", "(", ")", "{", "// do we need to rotate?", "if", "(", "$", "this", "->", "rotationInterval", "and", "$", "this", "->", "rotationTimer", "<", "time", "(", ")", ")", "{", "$", "this", "->", "rotate", "(", ")", ";", "}", "re...
Writes the container data to the session store @return boolean
[ "Writes", "the", "container", "data", "to", "the", "session", "store" ]
948fd2b45286e65e7fababf65de89ca6aaca3c4a
https://github.com/fuelphp-storage/session/blob/948fd2b45286e65e7fababf65de89ca6aaca3c4a/src/Manager.php#L194-L203
199,423
fuelphp-storage/session
src/Manager.php
Manager.stop
public function stop() { // do we need to rotate? if ($this->rotationInterval and $this->rotationTimer < time()) { $this->rotate(); } // stop the current session return $this->driver->stop(); }
php
public function stop() { // do we need to rotate? if ($this->rotationInterval and $this->rotationTimer < time()) { $this->rotate(); } // stop the current session return $this->driver->stop(); }
[ "public", "function", "stop", "(", ")", "{", "// do we need to rotate?", "if", "(", "$", "this", "->", "rotationInterval", "and", "$", "this", "->", "rotationTimer", "<", "time", "(", ")", ")", "{", "$", "this", "->", "rotate", "(", ")", ";", "}", "// ...
Stops a session @return boolean
[ "Stops", "a", "session" ]
948fd2b45286e65e7fababf65de89ca6aaca3c4a
https://github.com/fuelphp-storage/session/blob/948fd2b45286e65e7fababf65de89ca6aaca3c4a/src/Manager.php#L210-L220
199,424
fuelphp-storage/session
src/Manager.php
Manager.rotate
public function rotate() { // update the session id rotation timer if ($this->rotationInterval) { $this->rotationTimer = time() + $this->rotationInterval; } // regenerate the session id $this->driver->regenerate($this); }
php
public function rotate() { // update the session id rotation timer if ($this->rotationInterval) { $this->rotationTimer = time() + $this->rotationInterval; } // regenerate the session id $this->driver->regenerate($this); }
[ "public", "function", "rotate", "(", ")", "{", "// update the session id rotation timer", "if", "(", "$", "this", "->", "rotationInterval", ")", "{", "$", "this", "->", "rotationTimer", "=", "time", "(", ")", "+", "$", "this", "->", "rotationInterval", ";", ...
Rotates the session id, and reset the rotation timer if needed
[ "Rotates", "the", "session", "id", "and", "reset", "the", "rotation", "timer", "if", "needed" ]
948fd2b45286e65e7fababf65de89ca6aaca3c4a
https://github.com/fuelphp-storage/session/blob/948fd2b45286e65e7fababf65de89ca6aaca3c4a/src/Manager.php#L225-L235
199,425
fuelphp-storage/session
src/Manager.php
Manager.setNamespace
public function setNamespace($name) { $this->config['namespace'] = is_bool($name) ? $name : (string) $name; if ($this->config['namespace'] === true) { $this->config['namespace'] = $this->app ? $app->getName() : false; } $this->data->setNamespace($this->config['namespace']); }
php
public function setNamespace($name) { $this->config['namespace'] = is_bool($name) ? $name : (string) $name; if ($this->config['namespace'] === true) { $this->config['namespace'] = $this->app ? $app->getName() : false; } $this->data->setNamespace($this->config['namespace']); }
[ "public", "function", "setNamespace", "(", "$", "name", ")", "{", "$", "this", "->", "config", "[", "'namespace'", "]", "=", "is_bool", "(", "$", "name", ")", "?", "$", "name", ":", "(", "string", ")", "$", "name", ";", "if", "(", "$", "this", "-...
Sets the session namespace @param string $name
[ "Sets", "the", "session", "namespace" ]
948fd2b45286e65e7fababf65de89ca6aaca3c4a
https://github.com/fuelphp-storage/session/blob/948fd2b45286e65e7fababf65de89ca6aaca3c4a/src/Manager.php#L282-L292
199,426
fuelphp-storage/session
src/Manager.php
Manager.setFlashNamespace
public function setFlashNamespace($name) { $this->config['flash_namespace'] = (string) $name; $this->flash->setNamespace($this->config['flash_namespace']); }
php
public function setFlashNamespace($name) { $this->config['flash_namespace'] = (string) $name; $this->flash->setNamespace($this->config['flash_namespace']); }
[ "public", "function", "setFlashNamespace", "(", "$", "name", ")", "{", "$", "this", "->", "config", "[", "'flash_namespace'", "]", "=", "(", "string", ")", "$", "name", ";", "$", "this", "->", "flash", "->", "setNamespace", "(", "$", "this", "->", "con...
Sets the session flash namespace @param string $name
[ "Sets", "the", "session", "flash", "namespace" ]
948fd2b45286e65e7fababf65de89ca6aaca3c4a
https://github.com/fuelphp-storage/session/blob/948fd2b45286e65e7fababf65de89ca6aaca3c4a/src/Manager.php#L309-L314
199,427
fuelphp-storage/session
src/Manager.php
Manager.reset
protected function reset() { // create the data container $this->data = new DataContainer(); // create the flash container $this->flash = new FlashContainer(); // initialise the flash expiry store $this->flash->set(FlashContainer::EXPIRE_DATA_KEY, array()); }
php
protected function reset() { // create the data container $this->data = new DataContainer(); // create the flash container $this->flash = new FlashContainer(); // initialise the flash expiry store $this->flash->set(FlashContainer::EXPIRE_DATA_KEY, array()); }
[ "protected", "function", "reset", "(", ")", "{", "// create the data container", "$", "this", "->", "data", "=", "new", "DataContainer", "(", ")", ";", "// create the flash container", "$", "this", "->", "flash", "=", "new", "FlashContainer", "(", ")", ";", "/...
Resets the data and flash data containers
[ "Resets", "the", "data", "and", "flash", "data", "containers" ]
948fd2b45286e65e7fababf65de89ca6aaca3c4a
https://github.com/fuelphp-storage/session/blob/948fd2b45286e65e7fababf65de89ca6aaca3c4a/src/Manager.php#L319-L330
199,428
sil-project/Contact
Model/Contact.php
Contact.addAddress
public function addAddress(AddressInterface $address) { if ($this->addresses->contains($address)) { throw new \InvalidArgumentException('This contact already owns this address'); } $this->addresses->add($address); if (!$this->defaultAddress) { $this->setDefa...
php
public function addAddress(AddressInterface $address) { if ($this->addresses->contains($address)) { throw new \InvalidArgumentException('This contact already owns this address'); } $this->addresses->add($address); if (!$this->defaultAddress) { $this->setDefa...
[ "public", "function", "addAddress", "(", "AddressInterface", "$", "address", ")", "{", "if", "(", "$", "this", "->", "addresses", "->", "contains", "(", "$", "address", ")", ")", "{", "throw", "new", "\\", "InvalidArgumentException", "(", "'This contact alread...
Add an Address to the collection. @param AddressInterface $address
[ "Add", "an", "Address", "to", "the", "collection", "." ]
ead863b5dc4ee7a6a2e3f0f181d1a0874b4969b9
https://github.com/sil-project/Contact/blob/ead863b5dc4ee7a6a2e3f0f181d1a0874b4969b9/Model/Contact.php#L228-L239
199,429
sil-project/Contact
Model/Contact.php
Contact.removeAddress
public function removeAddress(AddressInterface $address) { if (!$this->hasAddress($address)) { throw new \InvalidArgumentException('Trying to remove an address that does not belong to this contact'); } $this->addresses->removeElement($address); if ($address === $this->d...
php
public function removeAddress(AddressInterface $address) { if (!$this->hasAddress($address)) { throw new \InvalidArgumentException('Trying to remove an address that does not belong to this contact'); } $this->addresses->removeElement($address); if ($address === $this->d...
[ "public", "function", "removeAddress", "(", "AddressInterface", "$", "address", ")", "{", "if", "(", "!", "$", "this", "->", "hasAddress", "(", "$", "address", ")", ")", "{", "throw", "new", "\\", "InvalidArgumentException", "(", "'Trying to remove an address th...
Remove an Address from the collection. @param AddressInterface $address
[ "Remove", "an", "Address", "from", "the", "collection", "." ]
ead863b5dc4ee7a6a2e3f0f181d1a0874b4969b9
https://github.com/sil-project/Contact/blob/ead863b5dc4ee7a6a2e3f0f181d1a0874b4969b9/Model/Contact.php#L246-L263
199,430
sil-project/Contact
Model/Contact.php
Contact.addPhone
public function addPhone(PhoneInterface $phone) { if ($this->phones->contains($phone)) { throw new \InvalidArgumentException('This contact already owns this phone'); } $this->phones->add($phone); if (!$this->defaultPhone) { $this->setDefaultPhone($phone); ...
php
public function addPhone(PhoneInterface $phone) { if ($this->phones->contains($phone)) { throw new \InvalidArgumentException('This contact already owns this phone'); } $this->phones->add($phone); if (!$this->defaultPhone) { $this->setDefaultPhone($phone); ...
[ "public", "function", "addPhone", "(", "PhoneInterface", "$", "phone", ")", "{", "if", "(", "$", "this", "->", "phones", "->", "contains", "(", "$", "phone", ")", ")", "{", "throw", "new", "\\", "InvalidArgumentException", "(", "'This contact already owns this...
Add a Phone to the collection. @param PhoneInterface $phone
[ "Add", "a", "Phone", "to", "the", "collection", "." ]
ead863b5dc4ee7a6a2e3f0f181d1a0874b4969b9
https://github.com/sil-project/Contact/blob/ead863b5dc4ee7a6a2e3f0f181d1a0874b4969b9/Model/Contact.php#L312-L323
199,431
sil-project/Contact
Model/Contact.php
Contact.removePhone
public function removePhone(PhoneInterface $phone) { if (!$this->hasPhone($phone)) { throw new \InvalidArgumentException('Trying to remove a phone that does not belong to this contact'); } $this->phones->removeElement($phone); if ($phone === $this->defaultPhone) { ...
php
public function removePhone(PhoneInterface $phone) { if (!$this->hasPhone($phone)) { throw new \InvalidArgumentException('Trying to remove a phone that does not belong to this contact'); } $this->phones->removeElement($phone); if ($phone === $this->defaultPhone) { ...
[ "public", "function", "removePhone", "(", "PhoneInterface", "$", "phone", ")", "{", "if", "(", "!", "$", "this", "->", "hasPhone", "(", "$", "phone", ")", ")", "{", "throw", "new", "\\", "InvalidArgumentException", "(", "'Trying to remove a phone that does not b...
Remove a Phone from the collection. @param PhoneInterface $phone
[ "Remove", "a", "Phone", "from", "the", "collection", "." ]
ead863b5dc4ee7a6a2e3f0f181d1a0874b4969b9
https://github.com/sil-project/Contact/blob/ead863b5dc4ee7a6a2e3f0f181d1a0874b4969b9/Model/Contact.php#L330-L347
199,432
melisplatform/melis-calendar
src/Controller/ToolCalendarController.php
ToolCalendarController.retrieveDashboardCalendarEventsAction
public function retrieveDashboardCalendarEventsAction(){ $calendarTable = $this->getServiceLocator()->get('MelisCalendarTable'); $result = $calendarTable->retrieveDashboardCalendarEvents(); return new JsonModel($result->toArray()); }
php
public function retrieveDashboardCalendarEventsAction(){ $calendarTable = $this->getServiceLocator()->get('MelisCalendarTable'); $result = $calendarTable->retrieveDashboardCalendarEvents(); return new JsonModel($result->toArray()); }
[ "public", "function", "retrieveDashboardCalendarEventsAction", "(", ")", "{", "$", "calendarTable", "=", "$", "this", "->", "getServiceLocator", "(", ")", "->", "get", "(", "'MelisCalendarTable'", ")", ";", "$", "result", "=", "$", "calendarTable", "->", "retrie...
Retrive Calendar Event to initialize calender uifor Dashboard Calendar @return \Zend\View\Model\JsonModel
[ "Retrive", "Calendar", "Event", "to", "initialize", "calender", "uifor", "Dashboard", "Calendar" ]
1e6df34adc14f03dfdcc6e4ac05d4fa08cb7d223
https://github.com/melisplatform/melis-calendar/blob/1e6df34adc14f03dfdcc6e4ac05d4fa08cb7d223/src/Controller/ToolCalendarController.php#L25-L29
199,433
melisplatform/melis-calendar
src/Controller/ToolCalendarController.php
ToolCalendarController.retrieveCalendarEventsAction
public function retrieveCalendarEventsAction(){ $calendarTable = $this->getServiceLocator()->get('MelisCalendarTable'); $result = $calendarTable->retrieveCalendarEvents(); return new JsonModel($result->toArray()); }
php
public function retrieveCalendarEventsAction(){ $calendarTable = $this->getServiceLocator()->get('MelisCalendarTable'); $result = $calendarTable->retrieveCalendarEvents(); return new JsonModel($result->toArray()); }
[ "public", "function", "retrieveCalendarEventsAction", "(", ")", "{", "$", "calendarTable", "=", "$", "this", "->", "getServiceLocator", "(", ")", "->", "get", "(", "'MelisCalendarTable'", ")", ";", "$", "result", "=", "$", "calendarTable", "->", "retrieveCalenda...
Retrieve Calendar Event to initialize calender ui @return \Zend\View\Model\JsonModel
[ "Retrieve", "Calendar", "Event", "to", "initialize", "calender", "ui" ]
1e6df34adc14f03dfdcc6e4ac05d4fa08cb7d223
https://github.com/melisplatform/melis-calendar/blob/1e6df34adc14f03dfdcc6e4ac05d4fa08cb7d223/src/Controller/ToolCalendarController.php#L36-L40
199,434
melisplatform/melis-calendar
src/Controller/ToolCalendarController.php
ToolCalendarController.saveEventAction
public function saveEventAction(){ $translator = $this->getServiceLocator()->get('translator'); $request = $this->getRequest(); // Default Values $status = 0; $textMessage = ''; $errors = array(); $textTitle = ''; $responseData = array...
php
public function saveEventAction(){ $translator = $this->getServiceLocator()->get('translator'); $request = $this->getRequest(); // Default Values $status = 0; $textMessage = ''; $errors = array(); $textTitle = ''; $responseData = array...
[ "public", "function", "saveEventAction", "(", ")", "{", "$", "translator", "=", "$", "this", "->", "getServiceLocator", "(", ")", "->", "get", "(", "'translator'", ")", ";", "$", "request", "=", "$", "this", "->", "getRequest", "(", ")", ";", "// Default...
This action will save an event to the calendar @return \Zend\View\Model\JsonModel
[ "This", "action", "will", "save", "an", "event", "to", "the", "calendar" ]
1e6df34adc14f03dfdcc6e4ac05d4fa08cb7d223
https://github.com/melisplatform/melis-calendar/blob/1e6df34adc14f03dfdcc6e4ac05d4fa08cb7d223/src/Controller/ToolCalendarController.php#L47-L129
199,435
melisplatform/melis-calendar
src/Controller/ToolCalendarController.php
ToolCalendarController.searchCalendarEventAction
public function searchCalendarEventAction(){ $translator = $this->getServiceLocator()->get('translator'); $textMessage = ''; $request = $this->getRequest(); // Default Values $id = null; if($request->isPost()) { $postValues = get_object_vars($request->getPos...
php
public function searchCalendarEventAction(){ $translator = $this->getServiceLocator()->get('translator'); $textMessage = ''; $request = $this->getRequest(); // Default Values $id = null; if($request->isPost()) { $postValues = get_object_vars($request->getPos...
[ "public", "function", "searchCalendarEventAction", "(", ")", "{", "$", "translator", "=", "$", "this", "->", "getServiceLocator", "(", ")", "->", "get", "(", "'translator'", ")", ";", "$", "textMessage", "=", "''", ";", "$", "request", "=", "$", "this", ...
Retrieving Calendar searched item event data for updating
[ "Retrieving", "Calendar", "searched", "item", "event", "data", "for", "updating" ]
1e6df34adc14f03dfdcc6e4ac05d4fa08cb7d223
https://github.com/melisplatform/melis-calendar/blob/1e6df34adc14f03dfdcc6e4ac05d4fa08cb7d223/src/Controller/ToolCalendarController.php#L134-L160
199,436
melisplatform/melis-calendar
src/Controller/ToolCalendarController.php
ToolCalendarController.reschedEventAction
public function reschedEventAction(){ $translator = $this->getServiceLocator()->get('translator'); $request = $this->getRequest(); // Default Values $id = null; $status = 0; $textMessage = ''; $errors = array(); $textMessage = ''; $textT...
php
public function reschedEventAction(){ $translator = $this->getServiceLocator()->get('translator'); $request = $this->getRequest(); // Default Values $id = null; $status = 0; $textMessage = ''; $errors = array(); $textMessage = ''; $textT...
[ "public", "function", "reschedEventAction", "(", ")", "{", "$", "translator", "=", "$", "this", "->", "getServiceLocator", "(", ")", "->", "get", "(", "'translator'", ")", ";", "$", "request", "=", "$", "this", "->", "getRequest", "(", ")", ";", "// Defa...
Updating Calendar Event by resizing Calendar item event @return \Zend\View\Model\JsonModel
[ "Updating", "Calendar", "Event", "by", "resizing", "Calendar", "item", "event" ]
1e6df34adc14f03dfdcc6e4ac05d4fa08cb7d223
https://github.com/melisplatform/melis-calendar/blob/1e6df34adc14f03dfdcc6e4ac05d4fa08cb7d223/src/Controller/ToolCalendarController.php#L166-L219
199,437
melisplatform/melis-calendar
src/Controller/ToolCalendarController.php
ToolCalendarController.deleteEventAction
public function deleteEventAction(){ $translator = $this->getServiceLocator()->get('translator'); $request = $this->getRequest(); // Default Values $id = null; $status = 0; $textMessage = ''; $errors = array(); $textMessage = ''; $textTi...
php
public function deleteEventAction(){ $translator = $this->getServiceLocator()->get('translator'); $request = $this->getRequest(); // Default Values $id = null; $status = 0; $textMessage = ''; $errors = array(); $textMessage = ''; $textTi...
[ "public", "function", "deleteEventAction", "(", ")", "{", "$", "translator", "=", "$", "this", "->", "getServiceLocator", "(", ")", "->", "get", "(", "'translator'", ")", ";", "$", "request", "=", "$", "this", "->", "getRequest", "(", ")", ";", "// Defau...
Deleting Calendar item event @return \Zend\View\Model\JsonModel
[ "Deleting", "Calendar", "item", "event" ]
1e6df34adc14f03dfdcc6e4ac05d4fa08cb7d223
https://github.com/melisplatform/melis-calendar/blob/1e6df34adc14f03dfdcc6e4ac05d4fa08cb7d223/src/Controller/ToolCalendarController.php#L226-L267
199,438
melisplatform/melis-calendar
src/Controller/ToolCalendarController.php
ToolCalendarController.getEventTitleAction
public function getEventTitleAction(){ $translator = $this->getServiceLocator()->get('translator'); $request = $this->getRequest(); // Default Values $status = 0; // This can be override with success if result is success $textMessage = $translator->translate('tr...
php
public function getEventTitleAction(){ $translator = $this->getServiceLocator()->get('translator'); $request = $this->getRequest(); // Default Values $status = 0; // This can be override with success if result is success $textMessage = $translator->translate('tr...
[ "public", "function", "getEventTitleAction", "(", ")", "{", "$", "translator", "=", "$", "this", "->", "getServiceLocator", "(", ")", "->", "get", "(", "'translator'", ")", ";", "$", "request", "=", "$", "this", "->", "getRequest", "(", ")", ";", "// Def...
Retrieving Calendar item event data for updating @return \Zend\View\Model\JsonModel
[ "Retrieving", "Calendar", "item", "event", "data", "for", "updating" ]
1e6df34adc14f03dfdcc6e4ac05d4fa08cb7d223
https://github.com/melisplatform/melis-calendar/blob/1e6df34adc14f03dfdcc6e4ac05d4fa08cb7d223/src/Controller/ToolCalendarController.php#L274-L317
199,439
xelax90/l2p-client
src/L2PClient/TokenManager.php
TokenManager.getRefreshToken
protected function getRefreshToken(){ // check if RefreshToken is already stored $refreshToken = $this->getConfig()->getStorage()->getRefreshToken(); if(null !== $refreshToken){ return $refreshToken; } // get device token required for RefreshToken request $deviceToken = $this->getDeviceToken(); if($...
php
protected function getRefreshToken(){ // check if RefreshToken is already stored $refreshToken = $this->getConfig()->getStorage()->getRefreshToken(); if(null !== $refreshToken){ return $refreshToken; } // get device token required for RefreshToken request $deviceToken = $this->getDeviceToken(); if($...
[ "protected", "function", "getRefreshToken", "(", ")", "{", "// check if RefreshToken is already stored", "$", "refreshToken", "=", "$", "this", "->", "getConfig", "(", ")", "->", "getStorage", "(", ")", "->", "getRefreshToken", "(", ")", ";", "if", "(", "null", ...
Tries to retrieve RefreshToken. @return RefreshToken|null
[ "Tries", "to", "retrieve", "RefreshToken", "." ]
e4e53dfa1ee6e785acc4d3c632d3ebf70fe3d4fb
https://github.com/xelax90/l2p-client/blob/e4e53dfa1ee6e785acc4d3c632d3ebf70fe3d4fb/src/L2PClient/TokenManager.php#L52-L98
199,440
xelax90/l2p-client
src/L2PClient/TokenManager.php
TokenManager.getAccessTokenWithRefreshToken
protected function getAccessTokenWithRefreshToken(RefreshToken $refreshToken){ // Send post request to authentication service $params = array( 'client_id' => $this->getConfig()->getClientId(), 'refresh_token' => $refreshToken->getRefreshToken(), 'grant_type' => 'refresh_token', ); $response = $this->se...
php
protected function getAccessTokenWithRefreshToken(RefreshToken $refreshToken){ // Send post request to authentication service $params = array( 'client_id' => $this->getConfig()->getClientId(), 'refresh_token' => $refreshToken->getRefreshToken(), 'grant_type' => 'refresh_token', ); $response = $this->se...
[ "protected", "function", "getAccessTokenWithRefreshToken", "(", "RefreshToken", "$", "refreshToken", ")", "{", "// Send post request to authentication service", "$", "params", "=", "array", "(", "'client_id'", "=>", "$", "this", "->", "getConfig", "(", ")", "->", "get...
Get new AccessToken using provided RefreshToken @param RefreshToken $refreshToken @return AccessToken
[ "Get", "new", "AccessToken", "using", "provided", "RefreshToken" ]
e4e53dfa1ee6e785acc4d3c632d3ebf70fe3d4fb
https://github.com/xelax90/l2p-client/blob/e4e53dfa1ee6e785acc4d3c632d3ebf70fe3d4fb/src/L2PClient/TokenManager.php#L140-L166
199,441
xelax90/l2p-client
src/L2PClient/TokenManager.php
TokenManager.getDeviceToken
protected function getDeviceToken(){ // check if valid device token exists $deviceToken = $this->getConfig()->getStorage()->getDeviceToken(); if(null !== $deviceToken && $deviceToken->isExpired()){ $this->getConfig()->getStorage()->deleteDeviceToken(); $deviceToken = null; } if(null === $deviceToken)...
php
protected function getDeviceToken(){ // check if valid device token exists $deviceToken = $this->getConfig()->getStorage()->getDeviceToken(); if(null !== $deviceToken && $deviceToken->isExpired()){ $this->getConfig()->getStorage()->deleteDeviceToken(); $deviceToken = null; } if(null === $deviceToken)...
[ "protected", "function", "getDeviceToken", "(", ")", "{", "// check if valid device token exists", "$", "deviceToken", "=", "$", "this", "->", "getConfig", "(", ")", "->", "getStorage", "(", ")", "->", "getDeviceToken", "(", ")", ";", "if", "(", "null", "!==",...
Retrieves DeviceToken contianing the UserCode and DeviceCode @return DeviceToken
[ "Retrieves", "DeviceToken", "contianing", "the", "UserCode", "and", "DeviceCode" ]
e4e53dfa1ee6e785acc4d3c632d3ebf70fe3d4fb
https://github.com/xelax90/l2p-client/blob/e4e53dfa1ee6e785acc4d3c632d3ebf70fe3d4fb/src/L2PClient/TokenManager.php#L172-L198
199,442
xelax90/l2p-client
src/L2PClient/TokenManager.php
TokenManager.sendPostRequest
protected function sendPostRequest($path, $params){ $url = $this->getConfig()->getAuthUrl().$path; $ch = curl_init($url); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params)); curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); curl_setopt($ch, CURLOPT_TIMEOUT,10); ...
php
protected function sendPostRequest($path, $params){ $url = $this->getConfig()->getAuthUrl().$path; $ch = curl_init($url); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params)); curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); curl_setopt($ch, CURLOPT_TIMEOUT,10); ...
[ "protected", "function", "sendPostRequest", "(", "$", "path", ",", "$", "params", ")", "{", "$", "url", "=", "$", "this", "->", "getConfig", "(", ")", "->", "getAuthUrl", "(", ")", ".", "$", "path", ";", "$", "ch", "=", "curl_init", "(", "$", "url"...
Sends a POST request to the auth server. Returns array with keys 'output' and 'code'. Output contains the response body, code contains the response code. @param string $path The endpoint that you want to access @param string $params The parameters you want to send @return array
[ "Sends", "a", "POST", "request", "to", "the", "auth", "server", ".", "Returns", "array", "with", "keys", "output", "and", "code", ".", "Output", "contains", "the", "response", "body", "code", "contains", "the", "response", "code", "." ]
e4e53dfa1ee6e785acc4d3c632d3ebf70fe3d4fb
https://github.com/xelax90/l2p-client/blob/e4e53dfa1ee6e785acc4d3c632d3ebf70fe3d4fb/src/L2PClient/TokenManager.php#L206-L220
199,443
subjective-php/spl-datastructures
src/Bag.php
Bag.add
public function add($element) : BagInterface { array_unshift($this->elements, $element); shuffle($this->elements); return $this; }
php
public function add($element) : BagInterface { array_unshift($this->elements, $element); shuffle($this->elements); return $this; }
[ "public", "function", "add", "(", "$", "element", ")", ":", "BagInterface", "{", "array_unshift", "(", "$", "this", "->", "elements", ",", "$", "element", ")", ";", "shuffle", "(", "$", "this", "->", "elements", ")", ";", "return", "$", "this", ";", ...
Adds a new element to the bag. @param mixed $element The element to add. @return BagInterface
[ "Adds", "a", "new", "element", "to", "the", "bag", "." ]
621b0c47be9449299cfd22686d11ef9750f9841d
https://github.com/subjective-php/spl-datastructures/blob/621b0c47be9449299cfd22686d11ef9750f9841d/src/Bag.php#L27-L32
199,444
shrink0r/php-schema
src/Property/SequenceProperty.php
SequenceProperty.validate
public function validate($value) { if (!is_array($value)) { return Error::unit([ Error::NON_ARRAY ]); } $errors = []; foreach ($value as $pos => $item) { $result = parent::validate($item); if ($result instanceof Error) { $errors[$p...
php
public function validate($value) { if (!is_array($value)) { return Error::unit([ Error::NON_ARRAY ]); } $errors = []; foreach ($value as $pos => $item) { $result = parent::validate($item); if ($result instanceof Error) { $errors[$p...
[ "public", "function", "validate", "(", "$", "value", ")", "{", "if", "(", "!", "is_array", "(", "$", "value", ")", ")", "{", "return", "Error", "::", "unit", "(", "[", "Error", "::", "NON_ARRAY", "]", ")", ";", "}", "$", "errors", "=", "[", "]", ...
Tells if a given array's items adhere to any of the property's allowed types. @param mixed $value @return ResultInterface Returns Ok if the value is valid, otherwise an Error is returned.
[ "Tells", "if", "a", "given", "array", "s", "items", "adhere", "to", "any", "of", "the", "property", "s", "allowed", "types", "." ]
94293fe897af376dd9d05962e2c516079409dd29
https://github.com/shrink0r/php-schema/blob/94293fe897af376dd9d05962e2c516079409dd29/src/Property/SequenceProperty.php#L18-L33
199,445
marando/Units
src/Marando/Units/TimeBase.php
TimeBase.fmtRep
protected static function fmtRep($char, &$string, $value) { if (preg_match_all('/([0-9]{0,1})' . $char . '/', $string, $m)) { for ($i = 0; $i < count($m[0]); $i++) { $val = round($value, (int)$m[1][$i]); $string = str_replace($m[0][$i], $val, $string); ...
php
protected static function fmtRep($char, &$string, $value) { if (preg_match_all('/([0-9]{0,1})' . $char . '/', $string, $m)) { for ($i = 0; $i < count($m[0]); $i++) { $val = round($value, (int)$m[1][$i]); $string = str_replace($m[0][$i], $val, $string); ...
[ "protected", "static", "function", "fmtRep", "(", "$", "char", ",", "&", "$", "string", ",", "$", "value", ")", "{", "if", "(", "preg_match_all", "(", "'/([0-9]{0,1})'", ".", "$", "char", ".", "'/'", ",", "$", "string", ",", "$", "m", ")", ")", "{"...
Performs a decimal regular expression string formatter replace that provides value at a specified decimal precision. @param $char Character to match for replacing @param $string String being replaced @param $value Value to replace
[ "Performs", "a", "decimal", "regular", "expression", "string", "formatter", "replace", "that", "provides", "value", "at", "a", "specified", "decimal", "precision", "." ]
1721f16a2fdbd3fd8acb9061d393ce9ef1ce6e70
https://github.com/marando/Units/blob/1721f16a2fdbd3fd8acb9061d393ce9ef1ce6e70/src/Marando/Units/TimeBase.php#L39-L47
199,446
marando/Units
src/Marando/Units/TimeBase.php
TimeBase.encode
protected static function encode($string, $key) { for ($i = 0; $i < strlen($key); $i++) { $char = $key[$i]; $string = str_replace("\\{$char}", "%{$i}", $string); } return $string; }
php
protected static function encode($string, $key) { for ($i = 0; $i < strlen($key); $i++) { $char = $key[$i]; $string = str_replace("\\{$char}", "%{$i}", $string); } return $string; }
[ "protected", "static", "function", "encode", "(", "$", "string", ",", "$", "key", ")", "{", "for", "(", "$", "i", "=", "0", ";", "$", "i", "<", "strlen", "(", "$", "key", ")", ";", "$", "i", "++", ")", "{", "$", "char", "=", "$", "key", "["...
Encodes reserved characters for formatter strings. @param string $string String to encode @param string $key Characters to encode @return string
[ "Encodes", "reserved", "characters", "for", "formatter", "strings", "." ]
1721f16a2fdbd3fd8acb9061d393ce9ef1ce6e70
https://github.com/marando/Units/blob/1721f16a2fdbd3fd8acb9061d393ce9ef1ce6e70/src/Marando/Units/TimeBase.php#L73-L81
199,447
marando/Units
src/Marando/Units/TimeBase.php
TimeBase.decode
protected static function decode($string, $key) { for ($i = 0; $i < strlen($key); $i++) { $char = $key[$i]; $string = str_replace("%{$i}", "{$char}", $string); } return $string; }
php
protected static function decode($string, $key) { for ($i = 0; $i < strlen($key); $i++) { $char = $key[$i]; $string = str_replace("%{$i}", "{$char}", $string); } return $string; }
[ "protected", "static", "function", "decode", "(", "$", "string", ",", "$", "key", ")", "{", "for", "(", "$", "i", "=", "0", ";", "$", "i", "<", "strlen", "(", "$", "key", ")", ";", "$", "i", "++", ")", "{", "$", "char", "=", "$", "key", "["...
Decodes reserved characters for formatter strings. @param string $string String to decode @param string $key Characters to decode @return string
[ "Decodes", "reserved", "characters", "for", "formatter", "strings", "." ]
1721f16a2fdbd3fd8acb9061d393ce9ef1ce6e70
https://github.com/marando/Units/blob/1721f16a2fdbd3fd8acb9061d393ce9ef1ce6e70/src/Marando/Units/TimeBase.php#L91-L99
199,448
marando/Units
src/Marando/Units/TimeBase.php
TimeBase.hmsf2sec
protected static function hmsf2sec($h, $m, $s, $f) { return static::dmsf2asec($h, $m, $s, $f); }
php
protected static function hmsf2sec($h, $m, $s, $f) { return static::dmsf2asec($h, $m, $s, $f); }
[ "protected", "static", "function", "hmsf2sec", "(", "$", "h", ",", "$", "m", ",", "$", "s", ",", "$", "f", ")", "{", "return", "static", "::", "dmsf2asec", "(", "$", "h", ",", "$", "m", ",", "$", "s", ",", "$", "f", ")", ";", "}" ]
Composes h m s into seconds. @param int $h Hour component @param int $m Minute component @param int|double $s Second component @param int|double $f Fractional Second component @return double
[ "Composes", "h", "m", "s", "into", "seconds", "." ]
1721f16a2fdbd3fd8acb9061d393ce9ef1ce6e70
https://github.com/marando/Units/blob/1721f16a2fdbd3fd8acb9061d393ce9ef1ce6e70/src/Marando/Units/TimeBase.php#L206-L209
199,449
freialib/freia.autoloader
src/Filemap.php
Filemap.merge
protected function merge(array &$base, array $overwrite) { foreach ($overwrite as $key => $value) { if (is_int($key)) { // add only if it doesn't exist if ( ! in_array($overwrite[$key], $base)) { $base[] = $overwrite[$key]; } } else if (is_array($value)) { if (isset($base[$key]) && is_ar...
php
protected function merge(array &$base, array $overwrite) { foreach ($overwrite as $key => $value) { if (is_int($key)) { // add only if it doesn't exist if ( ! in_array($overwrite[$key], $base)) { $base[] = $overwrite[$key]; } } else if (is_array($value)) { if (isset($base[$key]) && is_ar...
[ "protected", "function", "merge", "(", "array", "&", "$", "base", ",", "array", "$", "overwrite", ")", "{", "foreach", "(", "$", "overwrite", "as", "$", "key", "=>", "$", "value", ")", "{", "if", "(", "is_int", "(", "$", "key", ")", ")", "{", "//...
Merge configuration arrays. This function does not return a new array, the first array is simply processed directly; for effeciency. Behaviour: numeric key arrays are appended to one another, any other key and the values will overwrite. @param array base @param array overwrite
[ "Merge", "configuration", "arrays", "." ]
45e0dfcd56d55cf533f12255db647e8a05fcd494
https://github.com/freialib/freia.autoloader/blob/45e0dfcd56d55cf533f12255db647e8a05fcd494/src/Filemap.php#L103-L123
199,450
Wedeto/Util
src/Dictionary.php
Dictionary.getType
public function getType($key, $type) { if (is_array($key)) { $args = $key; } else { $args = func_get_args(); $type = array_pop($args); // Type } $val = $this->dget($args); if ($val === null) throw new \O...
php
public function getType($key, $type) { if (is_array($key)) { $args = $key; } else { $args = func_get_args(); $type = array_pop($args); // Type } $val = $this->dget($args); if ($val === null) throw new \O...
[ "public", "function", "getType", "(", "$", "key", ",", "$", "type", ")", "{", "if", "(", "is_array", "(", "$", "key", ")", ")", "{", "$", "args", "=", "$", "key", ";", "}", "else", "{", "$", "args", "=", "func_get_args", "(", ")", ";", "$", "...
Get a value cast to a specific type. @param $key scalar The key to get. May be repeated to go deeper @param $type The type (one of the constants in Type) @return mixed The type as requested
[ "Get", "a", "value", "cast", "to", "a", "specific", "type", "." ]
0e080251bbaa8e7d91ae8d02eb79c029c976744a
https://github.com/Wedeto/Util/blob/0e080251bbaa8e7d91ae8d02eb79c029c976744a/src/Dictionary.php#L184-L211
199,451
Wedeto/Util
src/Dictionary.php
Dictionary.getSection
public function getSection($key) { $val = $this->dget(func_get_args()); if ($val instanceof Dictionary) return $val; $val = WF::cast_array($val); return Dictionary::wrap($val); }
php
public function getSection($key) { $val = $this->dget(func_get_args()); if ($val instanceof Dictionary) return $val; $val = WF::cast_array($val); return Dictionary::wrap($val); }
[ "public", "function", "getSection", "(", "$", "key", ")", "{", "$", "val", "=", "$", "this", "->", "dget", "(", "func_get_args", "(", ")", ")", ";", "if", "(", "$", "val", "instanceof", "Dictionary", ")", "return", "$", "val", ";", "$", "val", "=",...
Get the parameter as a Dictionary. @param $key scalar The key to get. May be repeated to go deeper @return Dictionary The section as a Dictionary. If the key does not exist, an empty Dictionay is returned. If the key is not array-like, it will be wrapped in an array.
[ "Get", "the", "parameter", "as", "a", "Dictionary", "." ]
0e080251bbaa8e7d91ae8d02eb79c029c976744a
https://github.com/Wedeto/Util/blob/0e080251bbaa8e7d91ae8d02eb79c029c976744a/src/Dictionary.php#L260-L267
199,452
Wedeto/Util
src/Dictionary.php
Dictionary.set
public function set($key, $value) { if (is_array($key) && $value === null) $args = $key; else $args = func_get_args(); $value = array_pop($args); $parent = null; $key = null; $ref = &$this->values; foreach ($args as $arg) ...
php
public function set($key, $value) { if (is_array($key) && $value === null) $args = $key; else $args = func_get_args(); $value = array_pop($args); $parent = null; $key = null; $ref = &$this->values; foreach ($args as $arg) ...
[ "public", "function", "set", "(", "$", "key", ",", "$", "value", ")", "{", "if", "(", "is_array", "(", "$", "key", ")", "&&", "$", "value", "===", "null", ")", "$", "args", "=", "$", "key", ";", "else", "$", "args", "=", "func_get_args", "(", "...
Set a value in the dictionary @param $key scalar The key to set. May be repeated to go deeper @param $value mixed The value to set @return Dictionary Provides fluent interface
[ "Set", "a", "value", "in", "the", "dictionary" ]
0e080251bbaa8e7d91ae8d02eb79c029c976744a
https://github.com/Wedeto/Util/blob/0e080251bbaa8e7d91ae8d02eb79c029c976744a/src/Dictionary.php#L314-L354
199,453
Wedeto/Util
src/Dictionary.php
Dictionary.addAll
public function addAll($values) { if (!WF::is_array_like($values)) throw new \DomainException("Invalid value to merge: " . WF::str($values)); $this->addAllRecursive($values, $this); return $this; }
php
public function addAll($values) { if (!WF::is_array_like($values)) throw new \DomainException("Invalid value to merge: " . WF::str($values)); $this->addAllRecursive($values, $this); return $this; }
[ "public", "function", "addAll", "(", "$", "values", ")", "{", "if", "(", "!", "WF", "::", "is_array_like", "(", "$", "values", ")", ")", "throw", "new", "\\", "DomainException", "(", "\"Invalid value to merge: \"", ".", "WF", "::", "str", "(", "$", "valu...
Add all elements in the provided array-like object to the dictionary. @param Traversable $values The values to add @return Wedeto\Util\Dictionary Provides fluent interface
[ "Add", "all", "elements", "in", "the", "provided", "array", "-", "like", "object", "to", "the", "dictionary", "." ]
0e080251bbaa8e7d91ae8d02eb79c029c976744a
https://github.com/Wedeto/Util/blob/0e080251bbaa8e7d91ae8d02eb79c029c976744a/src/Dictionary.php#L375-L381
199,454
Wedeto/Util
src/Dictionary.php
Dictionary.addAllRecursive
private function addAllRecursive($source, $target, array $path = []) { foreach ($source as $key => $value) { if (!isset($target[$key])) { $target[$key] = $value; } else { $tgt = $target[$key]; ...
php
private function addAllRecursive($source, $target, array $path = []) { foreach ($source as $key => $value) { if (!isset($target[$key])) { $target[$key] = $value; } else { $tgt = $target[$key]; ...
[ "private", "function", "addAllRecursive", "(", "$", "source", ",", "$", "target", ",", "array", "$", "path", "=", "[", "]", ")", "{", "foreach", "(", "$", "source", "as", "$", "key", "=>", "$", "value", ")", "{", "if", "(", "!", "isset", "(", "$"...
Recursive function to merge all values from a source dictionary or array into a target dictionary.
[ "Recursive", "function", "to", "merge", "all", "values", "from", "a", "source", "dictionary", "or", "array", "into", "a", "target", "dictionary", "." ]
0e080251bbaa8e7d91ae8d02eb79c029c976744a
https://github.com/Wedeto/Util/blob/0e080251bbaa8e7d91ae8d02eb79c029c976744a/src/Dictionary.php#L387-L410
199,455
Wedeto/Util
src/Dictionary.php
Dictionary.clear
public function clear() { $keys = array_keys($this->values); foreach ($keys as $key) unset($this->values[$key]); return $this; }
php
public function clear() { $keys = array_keys($this->values); foreach ($keys as $key) unset($this->values[$key]); return $this; }
[ "public", "function", "clear", "(", ")", "{", "$", "keys", "=", "array_keys", "(", "$", "this", "->", "values", ")", ";", "foreach", "(", "$", "keys", "as", "$", "key", ")", "unset", "(", "$", "this", "->", "values", "[", "$", "key", "]", ")", ...
Remove all elements from the dictionary @return Wedeto\Util\Dictionary Provides fluent interface
[ "Remove", "all", "elements", "from", "the", "dictionary" ]
0e080251bbaa8e7d91ae8d02eb79c029c976744a
https://github.com/Wedeto/Util/blob/0e080251bbaa8e7d91ae8d02eb79c029c976744a/src/Dictionary.php#L416-L422
199,456
congraphcms/core
CoreServiceProvider.php
CoreServiceProvider.registerServiceProviders
protected function registerServiceProviders() { // Core Bus // ----------------------------------------------------------------------------- $this->app->register('Congraph\Core\Bus\BusServiceProvider'); // Core Event // ----------------------------------------------------------------------------- $this->a...
php
protected function registerServiceProviders() { // Core Bus // ----------------------------------------------------------------------------- $this->app->register('Congraph\Core\Bus\BusServiceProvider'); // Core Event // ----------------------------------------------------------------------------- $this->a...
[ "protected", "function", "registerServiceProviders", "(", ")", "{", "// Core Bus", "// -----------------------------------------------------------------------------", "$", "this", "->", "app", "->", "register", "(", "'Congraph\\Core\\Bus\\BusServiceProvider'", ")", ";", "// Core ...
Register Service Providers for this package @return void
[ "Register", "Service", "Providers", "for", "this", "package" ]
d017d3951b446fb2ac93b8fcee120549bb125b17
https://github.com/congraphcms/core/blob/d017d3951b446fb2ac93b8fcee120549bb125b17/CoreServiceProvider.php#L54-L67
199,457
pazuzu156/Gravatar
src/Pazuzu156/Gravatar/Profile.php
Profile.getRaw
public function getRaw() { $url = $this->_gravatar->generateUrl('profile', $this->_gravatar->getEmail()).'.php'; if (is_null($this->_data)) { // Let's make a quick check to see if the user exists // we'll throw an exception if a 404 is returned $h = get_headers($...
php
public function getRaw() { $url = $this->_gravatar->generateUrl('profile', $this->_gravatar->getEmail()).'.php'; if (is_null($this->_data)) { // Let's make a quick check to see if the user exists // we'll throw an exception if a 404 is returned $h = get_headers($...
[ "public", "function", "getRaw", "(", ")", "{", "$", "url", "=", "$", "this", "->", "_gravatar", "->", "generateUrl", "(", "'profile'", ",", "$", "this", "->", "_gravatar", "->", "getEmail", "(", ")", ")", ".", "'.php'", ";", "if", "(", "is_null", "("...
Returns raw, serialized profile data. @return string
[ "Returns", "raw", "serialized", "profile", "data", "." ]
7ec5c03f8ada81ec15034c671f2750456c89b6d5
https://github.com/pazuzu156/Gravatar/blob/7ec5c03f8ada81ec15034c671f2750456c89b6d5/src/Pazuzu156/Gravatar/Profile.php#L58-L77
199,458
pazuzu156/Gravatar
src/Pazuzu156/Gravatar/Profile.php
Profile.convert
public function convert($type, $data) { foreach ($data as $k => $v) { if (is_array($v)) { $data[$k] = $this->convert($type, $v); } } switch (strtolower($type)) { case 'array': return (array) $data; break; case '...
php
public function convert($type, $data) { foreach ($data as $k => $v) { if (is_array($v)) { $data[$k] = $this->convert($type, $v); } } switch (strtolower($type)) { case 'array': return (array) $data; break; case '...
[ "public", "function", "convert", "(", "$", "type", ",", "$", "data", ")", "{", "foreach", "(", "$", "data", "as", "$", "k", "=>", "$", "v", ")", "{", "if", "(", "is_array", "(", "$", "v", ")", ")", "{", "$", "data", "[", "$", "k", "]", "=",...
Converts the data into whichever type specified. @param string $type - [array/object] Convert into a given type @param mixed $data - The data to convert @throws \Exception @return mixed
[ "Converts", "the", "data", "into", "whichever", "type", "specified", "." ]
7ec5c03f8ada81ec15034c671f2750456c89b6d5
https://github.com/pazuzu156/Gravatar/blob/7ec5c03f8ada81ec15034c671f2750456c89b6d5/src/Pazuzu156/Gravatar/Profile.php#L125-L143
199,459
faizalpribadi/Event
EventDispatcher.php
EventDispatcher.addSubscriber
public function addSubscriber(SubscriberInterface $subscriber) { foreach ($subscriber->getSubscriberEvents() as $subscriberEvent => $params) { if (is_string($params)) { $this->addListener($subscriberEvent, array($subscriber, $params)); } if (is_array($par...
php
public function addSubscriber(SubscriberInterface $subscriber) { foreach ($subscriber->getSubscriberEvents() as $subscriberEvent => $params) { if (is_string($params)) { $this->addListener($subscriberEvent, array($subscriber, $params)); } if (is_array($par...
[ "public", "function", "addSubscriber", "(", "SubscriberInterface", "$", "subscriber", ")", "{", "foreach", "(", "$", "subscriber", "->", "getSubscriberEvents", "(", ")", "as", "$", "subscriberEvent", "=>", "$", "params", ")", "{", "if", "(", "is_string", "(", ...
Added subscriber from event configuration This subscriber allow notified for event @param SubscriberInterface $subscriber @return mixed|void @throws \Exception
[ "Added", "subscriber", "from", "event", "configuration", "This", "subscriber", "allow", "notified", "for", "event" ]
f1bbd2d018b31b926ede66fd6b0787fbf38e6e99
https://github.com/faizalpribadi/Event/blob/f1bbd2d018b31b926ede66fd6b0787fbf38e6e99/EventDispatcher.php#L114-L127
199,460
faizalpribadi/Event
EventDispatcher.php
EventDispatcher.removeSubscriber
public function removeSubscriber(SubscriberInterface $subscriber) { if (is_array($subscriber->getSubscriberEvents())) { foreach ($subscriber->getSubscriberEvents() as $subscriberEvent => $params) { $this->removeListener($subscriberEvent, array($subscriber, $params)); ...
php
public function removeSubscriber(SubscriberInterface $subscriber) { if (is_array($subscriber->getSubscriberEvents())) { foreach ($subscriber->getSubscriberEvents() as $subscriberEvent => $params) { $this->removeListener($subscriberEvent, array($subscriber, $params)); ...
[ "public", "function", "removeSubscriber", "(", "SubscriberInterface", "$", "subscriber", ")", "{", "if", "(", "is_array", "(", "$", "subscriber", "->", "getSubscriberEvents", "(", ")", ")", ")", "{", "foreach", "(", "$", "subscriber", "->", "getSubscriberEvents"...
Remove all subscriber from event configuration @param SubscriberInterface $subscriber @return mixed|void
[ "Remove", "all", "subscriber", "from", "event", "configuration" ]
f1bbd2d018b31b926ede66fd6b0787fbf38e6e99
https://github.com/faizalpribadi/Event/blob/f1bbd2d018b31b926ede66fd6b0787fbf38e6e99/EventDispatcher.php#L136-L143
199,461
jooaziz/Jlib
src/Misc/UUID.php
UUID.v3
public static function v3($namespace, $name) { if (!self::is_valid($namespace)) return false; // Get hexadecimal components of namespace $nhex = str_replace(array('-', '{', '}'), '', $namespace); // Binary Value $nstr = ''; // Convert Namespace UUID to bit...
php
public static function v3($namespace, $name) { if (!self::is_valid($namespace)) return false; // Get hexadecimal components of namespace $nhex = str_replace(array('-', '{', '}'), '', $namespace); // Binary Value $nstr = ''; // Convert Namespace UUID to bit...
[ "public", "static", "function", "v3", "(", "$", "namespace", ",", "$", "name", ")", "{", "if", "(", "!", "self", "::", "is_valid", "(", "$", "namespace", ")", ")", "return", "false", ";", "// Get hexadecimal components of namespace", "$", "nhex", "=", "str...
Generate v3 UUID Version 3 UUIDs are named based. They require a namespace (another valid UUID) and a value (the name). Given the same namespace and name, the output is always the same. @param uuid $namespace @param string $name
[ "Generate", "v3", "UUID" ]
1060ab7964690da5ed0660bb4a6cbbd354778463
https://github.com/jooaziz/Jlib/blob/1060ab7964690da5ed0660bb4a6cbbd354778463/src/Misc/UUID.php#L39-L68
199,462
Kris-Kuiper/sFire-Framework
src/Hash/Token.php
Token.create
public static function create($length = 6, $numbers = true, $letters = false, $capitals = false, $symbols = false) { if(false === ('-' . intval($length) == '-' . $length)) { return trigger_error(sprintf('Argument 1 passed to %s() must be of the type integer, "%s" given', __METHOD__, gettype($length)), E_USER_E...
php
public static function create($length = 6, $numbers = true, $letters = false, $capitals = false, $symbols = false) { if(false === ('-' . intval($length) == '-' . $length)) { return trigger_error(sprintf('Argument 1 passed to %s() must be of the type integer, "%s" given', __METHOD__, gettype($length)), E_USER_E...
[ "public", "static", "function", "create", "(", "$", "length", "=", "6", ",", "$", "numbers", "=", "true", ",", "$", "letters", "=", "false", ",", "$", "capitals", "=", "false", ",", "$", "symbols", "=", "false", ")", "{", "if", "(", "false", "===",...
Create random token @param int $length @param boolean $numbers @param boolean $letters @param boolean $capitals @param boolean $symbols @return string
[ "Create", "random", "token" ]
deefe1d9d2b40e7326381e8dcd4f01f9aa61885c
https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/Hash/Token.php#L42-L78
199,463
SagittariusX/Beluga.IO
src/Beluga/IO/FileAccessError.php
FileAccessError.Read
public static function Read( string $package, string $file, string $message = null, int $code = \E_USER_ERROR, \Throwable $previous = null ) : FileAccessError { return new FileAccessError( $package, $file, static::ACCESS_READ, $message, $code, $pre...
php
public static function Read( string $package, string $file, string $message = null, int $code = \E_USER_ERROR, \Throwable $previous = null ) : FileAccessError { return new FileAccessError( $package, $file, static::ACCESS_READ, $message, $code, $pre...
[ "public", "static", "function", "Read", "(", "string", "$", "package", ",", "string", "$", "file", ",", "string", "$", "message", "=", "null", ",", "int", "$", "code", "=", "\\", "E_USER_ERROR", ",", "\\", "Throwable", "$", "previous", "=", "null", ")"...
Init's a new \Beluga\IO\FileAccessError for file read mode. @param string $file The file where reading fails. @param string $message The optional error message. @param integer $code A optional error code (Defaults to \E_USER_ERROR) @param \Throwable $previous A Optional previous exception. @ret...
[ "Init", "s", "a", "new", "\\", "Beluga", "\\", "IO", "\\", "FileAccessError", "for", "file", "read", "mode", "." ]
c8af09a1b3cc8a955e43c89b70779d11b30ae29e
https://github.com/SagittariusX/Beluga.IO/blob/c8af09a1b3cc8a955e43c89b70779d11b30ae29e/src/Beluga/IO/FileAccessError.php#L126-L138
199,464
SagittariusX/Beluga.IO
src/Beluga/IO/FileAccessError.php
FileAccessError.Write
public static function Write( string $package, string $file, string $message = null, int $code = \E_USER_ERROR, \Throwable $previous = null ) : FileAccessError { return new FileAccessError( $package, $file, static::ACCESS_WRITE, $message, $code, $...
php
public static function Write( string $package, string $file, string $message = null, int $code = \E_USER_ERROR, \Throwable $previous = null ) : FileAccessError { return new FileAccessError( $package, $file, static::ACCESS_WRITE, $message, $code, $...
[ "public", "static", "function", "Write", "(", "string", "$", "package", ",", "string", "$", "file", ",", "string", "$", "message", "=", "null", ",", "int", "$", "code", "=", "\\", "E_USER_ERROR", ",", "\\", "Throwable", "$", "previous", "=", "null", ")...
Init's a new \Beluga\IO\FileAccessError for file write mode. @param string $file The file where reading fails. @param string $message The optional error message. @param integer $code A optional error code (Defaults to \E_USER_ERROR) @param \Throwable $previous A Optional previous exception. @re...
[ "Init", "s", "a", "new", "\\", "Beluga", "\\", "IO", "\\", "FileAccessError", "for", "file", "write", "mode", "." ]
c8af09a1b3cc8a955e43c89b70779d11b30ae29e
https://github.com/SagittariusX/Beluga.IO/blob/c8af09a1b3cc8a955e43c89b70779d11b30ae29e/src/Beluga/IO/FileAccessError.php#L149-L163
199,465
cloudtek/dynamodm
lib/Cloudtek/DynamoDM/Persister/AssociationPersister.php
AssociationPersister.getDiscriminatedClass
public function getDiscriminatedClass(PropertyMetadata $mapping, $discriminator = null) { if ($discriminator === null) { $discriminator = $mapping->discriminatorDefaultValue; } if ($discriminator !== null) { if (isset($mapping->discriminatorMap[$discriminator])) { ...
php
public function getDiscriminatedClass(PropertyMetadata $mapping, $discriminator = null) { if ($discriminator === null) { $discriminator = $mapping->discriminatorDefaultValue; } if ($discriminator !== null) { if (isset($mapping->discriminatorMap[$discriminator])) { ...
[ "public", "function", "getDiscriminatedClass", "(", "PropertyMetadata", "$", "mapping", ",", "$", "discriminator", "=", "null", ")", "{", "if", "(", "$", "discriminator", "===", "null", ")", "{", "$", "discriminator", "=", "$", "mapping", "->", "discriminatorD...
Get the class metadata for an association's target, with respect to any discriminator value. @param PropertyMetadata $mapping @param mixed|null $discriminator @return ClassMetadata @throws ODMException
[ "Get", "the", "class", "metadata", "for", "an", "association", "s", "target", "with", "respect", "to", "any", "discriminator", "value", "." ]
119d355e2c5cbaef1f867970349b4432f5704fcd
https://github.com/cloudtek/dynamodm/blob/119d355e2c5cbaef1f867970349b4432f5704fcd/lib/Cloudtek/DynamoDM/Persister/AssociationPersister.php#L55-L90
199,466
geniv/nette-identity-authorizator
src/Authorizator.php
Authorizator.setPolicy
public function setPolicy(string $policy) { // allow (all is deny, allow part) | deny (all is allow, deny part) | none (all is allow, ignore part) if (!in_array($policy, [self::POLICY_NONE, self::POLICY_ALLOW, self::POLICY_DENY])) { throw new Exception('Unsupported policy type: ' . $poli...
php
public function setPolicy(string $policy) { // allow (all is deny, allow part) | deny (all is allow, deny part) | none (all is allow, ignore part) if (!in_array($policy, [self::POLICY_NONE, self::POLICY_ALLOW, self::POLICY_DENY])) { throw new Exception('Unsupported policy type: ' . $poli...
[ "public", "function", "setPolicy", "(", "string", "$", "policy", ")", "{", "// allow (all is deny, allow part) | deny (all is allow, deny part) | none (all is allow, ignore part)", "if", "(", "!", "in_array", "(", "$", "policy", ",", "[", "self", "::", "POLICY_NONE", ",",...
Set policy. @param string $policy @throws Exception
[ "Set", "policy", "." ]
f7db1cd589d022b6443f24a59432098a343d4639
https://github.com/geniv/nette-identity-authorizator/blob/f7db1cd589d022b6443f24a59432098a343d4639/src/Authorizator.php#L69-L78
199,467
geniv/nette-identity-authorizator
src/Authorizator.php
Authorizator.getIdRoleByName
public function getIdRoleByName(string $name): string { if (isset($this->role[$name])) { return (string) $this->role[$name]['id']; } return ''; }
php
public function getIdRoleByName(string $name): string { if (isset($this->role[$name])) { return (string) $this->role[$name]['id']; } return ''; }
[ "public", "function", "getIdRoleByName", "(", "string", "$", "name", ")", ":", "string", "{", "if", "(", "isset", "(", "$", "this", "->", "role", "[", "$", "name", "]", ")", ")", "{", "return", "(", "string", ")", "$", "this", "->", "role", "[", ...
Get id role by name. @param string $name @return string
[ "Get", "id", "role", "by", "name", "." ]
f7db1cd589d022b6443f24a59432098a343d4639
https://github.com/geniv/nette-identity-authorizator/blob/f7db1cd589d022b6443f24a59432098a343d4639/src/Authorizator.php#L120-L126
199,468
geniv/nette-identity-authorizator
src/Authorizator.php
Authorizator.getResource
public function getResource(string $id = null): array { if ($id) { if (is_numeric($id)) { $filter = array_filter($this->resource, function ($row) use ($id) { return $row['id'] == $id; }); return (array) array_pop($filter); } return (array) ...
php
public function getResource(string $id = null): array { if ($id) { if (is_numeric($id)) { $filter = array_filter($this->resource, function ($row) use ($id) { return $row['id'] == $id; }); return (array) array_pop($filter); } return (array) ...
[ "public", "function", "getResource", "(", "string", "$", "id", "=", "null", ")", ":", "array", "{", "if", "(", "$", "id", ")", "{", "if", "(", "is_numeric", "(", "$", "id", ")", ")", "{", "$", "filter", "=", "array_filter", "(", "$", "this", "->"...
Get resource. @param string|null $id @return array
[ "Get", "resource", "." ]
f7db1cd589d022b6443f24a59432098a343d4639
https://github.com/geniv/nette-identity-authorizator/blob/f7db1cd589d022b6443f24a59432098a343d4639/src/Authorizator.php#L135-L145
199,469
geniv/nette-identity-authorizator
src/Authorizator.php
Authorizator.getIdResourceByName
public function getIdResourceByName(string $name): string { if (isset($this->resource[$name])) { return (string) $this->resource[$name]['id']; } return ''; }
php
public function getIdResourceByName(string $name): string { if (isset($this->resource[$name])) { return (string) $this->resource[$name]['id']; } return ''; }
[ "public", "function", "getIdResourceByName", "(", "string", "$", "name", ")", ":", "string", "{", "if", "(", "isset", "(", "$", "this", "->", "resource", "[", "$", "name", "]", ")", ")", "{", "return", "(", "string", ")", "$", "this", "->", "resource...
Get id resource by name. @param string $name @return string
[ "Get", "id", "resource", "by", "name", "." ]
f7db1cd589d022b6443f24a59432098a343d4639
https://github.com/geniv/nette-identity-authorizator/blob/f7db1cd589d022b6443f24a59432098a343d4639/src/Authorizator.php#L154-L160
199,470
geniv/nette-identity-authorizator
src/Authorizator.php
Authorizator.getPrivilege
public function getPrivilege(string $id = null): array { if ($id) { if (is_numeric($id)) { $filter = array_filter($this->privilege, function ($row) use ($id) { return $row['id'] == $id; }); return (array) array_pop($filter); } return (array...
php
public function getPrivilege(string $id = null): array { if ($id) { if (is_numeric($id)) { $filter = array_filter($this->privilege, function ($row) use ($id) { return $row['id'] == $id; }); return (array) array_pop($filter); } return (array...
[ "public", "function", "getPrivilege", "(", "string", "$", "id", "=", "null", ")", ":", "array", "{", "if", "(", "$", "id", ")", "{", "if", "(", "is_numeric", "(", "$", "id", ")", ")", "{", "$", "filter", "=", "array_filter", "(", "$", "this", "->...
Get privilege. @param string|null $id @return array
[ "Get", "privilege", "." ]
f7db1cd589d022b6443f24a59432098a343d4639
https://github.com/geniv/nette-identity-authorizator/blob/f7db1cd589d022b6443f24a59432098a343d4639/src/Authorizator.php#L169-L179
199,471
geniv/nette-identity-authorizator
src/Authorizator.php
Authorizator.getIdPrivilegeByName
public function getIdPrivilegeByName(string $name): string { if (isset($this->privilege[$name])) { return (string) $this->privilege[$name]['id']; } return ''; }
php
public function getIdPrivilegeByName(string $name): string { if (isset($this->privilege[$name])) { return (string) $this->privilege[$name]['id']; } return ''; }
[ "public", "function", "getIdPrivilegeByName", "(", "string", "$", "name", ")", ":", "string", "{", "if", "(", "isset", "(", "$", "this", "->", "privilege", "[", "$", "name", "]", ")", ")", "{", "return", "(", "string", ")", "$", "this", "->", "privil...
Get id privilege by name. @param string $name @return string
[ "Get", "id", "privilege", "by", "name", "." ]
f7db1cd589d022b6443f24a59432098a343d4639
https://github.com/geniv/nette-identity-authorizator/blob/f7db1cd589d022b6443f24a59432098a343d4639/src/Authorizator.php#L188-L194
199,472
geniv/nette-identity-authorizator
src/Authorizator.php
Authorizator.getAcl
public function getAcl(string $idRole = null, string $idResource = null): array { if ($idRole) { $callback = function ($row) use ($idRole, $idResource) { if ($idRole && $idResource) { return $row['id_role'] == $idRole && $row['id_resource'] == $idResource; ...
php
public function getAcl(string $idRole = null, string $idResource = null): array { if ($idRole) { $callback = function ($row) use ($idRole, $idResource) { if ($idRole && $idResource) { return $row['id_role'] == $idRole && $row['id_resource'] == $idResource; ...
[ "public", "function", "getAcl", "(", "string", "$", "idRole", "=", "null", ",", "string", "$", "idResource", "=", "null", ")", ":", "array", "{", "if", "(", "$", "idRole", ")", "{", "$", "callback", "=", "function", "(", "$", "row", ")", "use", "("...
Get acl. @param string|null $idRole @param string|null $idResource @return array
[ "Get", "acl", "." ]
f7db1cd589d022b6443f24a59432098a343d4639
https://github.com/geniv/nette-identity-authorizator/blob/f7db1cd589d022b6443f24a59432098a343d4639/src/Authorizator.php#L204-L219
199,473
geniv/nette-identity-authorizator
src/Authorizator.php
Authorizator.getAclForm
public function getAclForm(string $idRole): array { // support method - for load form $result = []; foreach ($this->resource as $item) { $acl = $this->getAcl($idRole, (string) $item['id']); if ($this->isAll($idRole, (string) $item['id'])) { // idRole,...
php
public function getAclForm(string $idRole): array { // support method - for load form $result = []; foreach ($this->resource as $item) { $acl = $this->getAcl($idRole, (string) $item['id']); if ($this->isAll($idRole, (string) $item['id'])) { // idRole,...
[ "public", "function", "getAclForm", "(", "string", "$", "idRole", ")", ":", "array", "{", "// support method - for load form", "$", "result", "=", "[", "]", ";", "foreach", "(", "$", "this", "->", "resource", "as", "$", "item", ")", "{", "$", "acl", "=",...
Get acl form. @param string $idRole @return array
[ "Get", "acl", "form", "." ]
f7db1cd589d022b6443f24a59432098a343d4639
https://github.com/geniv/nette-identity-authorizator/blob/f7db1cd589d022b6443f24a59432098a343d4639/src/Authorizator.php#L228-L248
199,474
geniv/nette-identity-authorizator
src/Authorizator.php
Authorizator.isAll
public function isAll(string $idRole, string $idResource = null): bool { $acl = $this->getAcl($idRole); if ($idResource) { $callback = function ($row) use ($idResource) { if ($idResource) { return $row['id_resource'] == $idResource; } ...
php
public function isAll(string $idRole, string $idResource = null): bool { $acl = $this->getAcl($idRole); if ($idResource) { $callback = function ($row) use ($idResource) { if ($idResource) { return $row['id_resource'] == $idResource; } ...
[ "public", "function", "isAll", "(", "string", "$", "idRole", ",", "string", "$", "idResource", "=", "null", ")", ":", "bool", "{", "$", "acl", "=", "$", "this", "->", "getAcl", "(", "$", "idRole", ")", ";", "if", "(", "$", "idResource", ")", "{", ...
Is all. @param string $idRole @param string|null $idResource @return bool
[ "Is", "all", "." ]
f7db1cd589d022b6443f24a59432098a343d4639
https://github.com/geniv/nette-identity-authorizator/blob/f7db1cd589d022b6443f24a59432098a343d4639/src/Authorizator.php#L258-L279
199,475
geniv/nette-identity-authorizator
src/Authorizator.php
Authorizator.setAllowed
public function setAllowed($role = self::ALL, $resource = self::ALL, $privilege = self::ALL) { if ($this->policy == self::POLICY_ALLOW) { $this->permission->allow($role, $resource, $privilege); } else { $this->permission->deny($role, $resource, $privilege); } }
php
public function setAllowed($role = self::ALL, $resource = self::ALL, $privilege = self::ALL) { if ($this->policy == self::POLICY_ALLOW) { $this->permission->allow($role, $resource, $privilege); } else { $this->permission->deny($role, $resource, $privilege); } }
[ "public", "function", "setAllowed", "(", "$", "role", "=", "self", "::", "ALL", ",", "$", "resource", "=", "self", "::", "ALL", ",", "$", "privilege", "=", "self", "::", "ALL", ")", "{", "if", "(", "$", "this", "->", "policy", "==", "self", "::", ...
Set allowed. @param $role @param $resource @param $privilege
[ "Set", "allowed", "." ]
f7db1cd589d022b6443f24a59432098a343d4639
https://github.com/geniv/nette-identity-authorizator/blob/f7db1cd589d022b6443f24a59432098a343d4639/src/Authorizator.php#L300-L307
199,476
geniv/nette-identity-authorizator
src/Authorizator.php
Authorizator.getPathListCurrentAcl
private function getPathListCurrentAcl(): string { return sprintf(self::PATH_LIST_CURRENT_ACL, $this->appDir, explode('\\', get_class($this))[3]); }
php
private function getPathListCurrentAcl(): string { return sprintf(self::PATH_LIST_CURRENT_ACL, $this->appDir, explode('\\', get_class($this))[3]); }
[ "private", "function", "getPathListCurrentAcl", "(", ")", ":", "string", "{", "return", "sprintf", "(", "self", "::", "PATH_LIST_CURRENT_ACL", ",", "$", "this", "->", "appDir", ",", "explode", "(", "'\\\\'", ",", "get_class", "(", "$", "this", ")", ")", "[...
Get path list current acl. @return string
[ "Get", "path", "list", "current", "acl", "." ]
f7db1cd589d022b6443f24a59432098a343d4639
https://github.com/geniv/nette-identity-authorizator/blob/f7db1cd589d022b6443f24a59432098a343d4639/src/Authorizator.php#L356-L359
199,477
geniv/nette-identity-authorizator
src/Authorizator.php
Authorizator.saveListCurrentAcl
public function saveListCurrentAcl(): int { $separate = $last = $this->loadListCurrentAcl(); foreach ($this->listCurrentAcl as $item) { if (!isset($separate[$item['resource']])) { $separate[$item['resource']] = []; } if (!in_array($item['privilege...
php
public function saveListCurrentAcl(): int { $separate = $last = $this->loadListCurrentAcl(); foreach ($this->listCurrentAcl as $item) { if (!isset($separate[$item['resource']])) { $separate[$item['resource']] = []; } if (!in_array($item['privilege...
[ "public", "function", "saveListCurrentAcl", "(", ")", ":", "int", "{", "$", "separate", "=", "$", "last", "=", "$", "this", "->", "loadListCurrentAcl", "(", ")", ";", "foreach", "(", "$", "this", "->", "listCurrentAcl", "as", "$", "item", ")", "{", "if...
Save list current acl. @return int
[ "Save", "list", "current", "acl", "." ]
f7db1cd589d022b6443f24a59432098a343d4639
https://github.com/geniv/nette-identity-authorizator/blob/f7db1cd589d022b6443f24a59432098a343d4639/src/Authorizator.php#L367-L384
199,478
geniv/nette-identity-authorizator
src/Authorizator.php
Authorizator.loadListCurrentAcl
public function loadListCurrentAcl(): array { $path = $this->getPathListCurrentAcl(); if (file_exists($path)) { return Neon::decode(file_get_contents($path)); } return []; }
php
public function loadListCurrentAcl(): array { $path = $this->getPathListCurrentAcl(); if (file_exists($path)) { return Neon::decode(file_get_contents($path)); } return []; }
[ "public", "function", "loadListCurrentAcl", "(", ")", ":", "array", "{", "$", "path", "=", "$", "this", "->", "getPathListCurrentAcl", "(", ")", ";", "if", "(", "file_exists", "(", "$", "path", ")", ")", "{", "return", "Neon", "::", "decode", "(", "fil...
Load list current acl. @return array
[ "Load", "list", "current", "acl", "." ]
f7db1cd589d022b6443f24a59432098a343d4639
https://github.com/geniv/nette-identity-authorizator/blob/f7db1cd589d022b6443f24a59432098a343d4639/src/Authorizator.php#L392-L399
199,479
OliverMonneke/pennePHP
src/Datatype/Collection.php
Collection.merge
public static function merge($array1, $array2, $recursive = false) { if (!self::isValid($array1) || !self::isValid($array2)) { return false; } if ($recursive) { return array_merge_recursive($array1, $array2); } else { return array_merg...
php
public static function merge($array1, $array2, $recursive = false) { if (!self::isValid($array1) || !self::isValid($array2)) { return false; } if ($recursive) { return array_merge_recursive($array1, $array2); } else { return array_merg...
[ "public", "static", "function", "merge", "(", "$", "array1", ",", "$", "array2", ",", "$", "recursive", "=", "false", ")", "{", "if", "(", "!", "self", "::", "isValid", "(", "$", "array1", ")", "||", "!", "self", "::", "isValid", "(", "$", "array2"...
Merge 2 arrays @param array $array1 First array @param array $array2 Second array @param bool $recursive Recursive @return array
[ "Merge", "2", "arrays" ]
dd0de7944685a3f1947157e1254fc54b55ff9942
https://github.com/OliverMonneke/pennePHP/blob/dd0de7944685a3f1947157e1254fc54b55ff9942/src/Datatype/Collection.php#L126-L138
199,480
OliverMonneke/pennePHP
src/Datatype/Collection.php
Collection.existsValue
public static function existsValue($array, $value) { if (!self::isValid($array)) { return false; } $returnValue = false; $length = self::length($array); for ($i = 0; $i < $length; $i++) { if ($value === $array[$i]) { $returnValue = tr...
php
public static function existsValue($array, $value) { if (!self::isValid($array)) { return false; } $returnValue = false; $length = self::length($array); for ($i = 0; $i < $length; $i++) { if ($value === $array[$i]) { $returnValue = tr...
[ "public", "static", "function", "existsValue", "(", "$", "array", ",", "$", "value", ")", "{", "if", "(", "!", "self", "::", "isValid", "(", "$", "array", ")", ")", "{", "return", "false", ";", "}", "$", "returnValue", "=", "false", ";", "$", "leng...
Check if a value exists in an array @param array $array The array @param mixed $value The value to look for @return bool
[ "Check", "if", "a", "value", "exists", "in", "an", "array" ]
dd0de7944685a3f1947157e1254fc54b55ff9942
https://github.com/OliverMonneke/pennePHP/blob/dd0de7944685a3f1947157e1254fc54b55ff9942/src/Datatype/Collection.php#L165-L182
199,481
OliverMonneke/pennePHP
src/Datatype/Collection.php
Collection.explode
public static function explode($string, $delimiter) { if (!String::isValid($string) || String::isEmpty($string)) { return false; } return explode($delimiter, $string); }
php
public static function explode($string, $delimiter) { if (!String::isValid($string) || String::isEmpty($string)) { return false; } return explode($delimiter, $string); }
[ "public", "static", "function", "explode", "(", "$", "string", ",", "$", "delimiter", ")", "{", "if", "(", "!", "String", "::", "isValid", "(", "$", "string", ")", "||", "String", "::", "isEmpty", "(", "$", "string", ")", ")", "{", "return", "false",...
Convert a string to an array @param string $string The string @param string $delimiter The delimiter @return array
[ "Convert", "a", "string", "to", "an", "array" ]
dd0de7944685a3f1947157e1254fc54b55ff9942
https://github.com/OliverMonneke/pennePHP/blob/dd0de7944685a3f1947157e1254fc54b55ff9942/src/Datatype/Collection.php#L209-L217
199,482
Wedeto/Util
src/LoggerAwareStaticTrait.php
LoggerAwareStaticTrait.getLogger
public static function getLogger() { if (self::$logger === null) { try { $result = Hook::execute( "Wedeto.Util.GetLogger", ["logger" => null, "class" => static::class] ); } catch ...
php
public static function getLogger() { if (self::$logger === null) { try { $result = Hook::execute( "Wedeto.Util.GetLogger", ["logger" => null, "class" => static::class] ); } catch ...
[ "public", "static", "function", "getLogger", "(", ")", "{", "if", "(", "self", "::", "$", "logger", "===", "null", ")", "{", "try", "{", "$", "result", "=", "Hook", "::", "execute", "(", "\"Wedeto.Util.GetLogger\"", ",", "[", "\"logger\"", "=>", "null", ...
Get a logger. If not available yet, it will be created using a Hook, or a NullLogger is instantiated.
[ "Get", "a", "logger", ".", "If", "not", "available", "yet", "it", "will", "be", "created", "using", "a", "Hook", "or", "a", "NullLogger", "is", "instantiated", "." ]
0e080251bbaa8e7d91ae8d02eb79c029c976744a
https://github.com/Wedeto/Util/blob/0e080251bbaa8e7d91ae8d02eb79c029c976744a/src/LoggerAwareStaticTrait.php#L67-L88
199,483
koolkode/http
src/Header/AbstractAcceptHeader.php
AbstractAcceptHeader.addValue
public function addValue($value, $q = 1.0) { $val = $this->parseValue($value); $q = floatval($q); if($q > 1) { $q = 1.0; } if($q < 0) { $q = 0.0; } // Ensure an existing element with the same value is removed. foreach($this->values as $index => $tmp) { if($tmp[self::KEY_VAL] ...
php
public function addValue($value, $q = 1.0) { $val = $this->parseValue($value); $q = floatval($q); if($q > 1) { $q = 1.0; } if($q < 0) { $q = 0.0; } // Ensure an existing element with the same value is removed. foreach($this->values as $index => $tmp) { if($tmp[self::KEY_VAL] ...
[ "public", "function", "addValue", "(", "$", "value", ",", "$", "q", "=", "1.0", ")", "{", "$", "val", "=", "$", "this", "->", "parseValue", "(", "$", "value", ")", ";", "$", "q", "=", "floatval", "(", "$", "q", ")", ";", "if", "(", "$", "q", ...
Add a value to the header, uses a modified version of insertion sort. @param mixed $value @param float $q
[ "Add", "a", "value", "to", "the", "header", "uses", "a", "modified", "version", "of", "insertion", "sort", "." ]
3c1626d409d5ce5d71d26f0e8f31ae3683a2a966
https://github.com/koolkode/http/blob/3c1626d409d5ce5d71d26f0e8f31ae3683a2a966/src/Header/AbstractAcceptHeader.php#L64-L103
199,484
prolic/HumusSupervisorModule
src/HumusSupervisorModule/SupervisorAbstractServiceFactory.php
SupervisorAbstractServiceFactory.getConfig
protected function getConfig(ServiceLocatorInterface $serviceLocator) { if ($this->config !== null) { return $this->config; } /* @var $serviceLocator SupervisorManager */ $services = $serviceLocator->getServiceLocator(); if (!$services->has('Config')) { ...
php
protected function getConfig(ServiceLocatorInterface $serviceLocator) { if ($this->config !== null) { return $this->config; } /* @var $serviceLocator SupervisorManager */ $services = $serviceLocator->getServiceLocator(); if (!$services->has('Config')) { ...
[ "protected", "function", "getConfig", "(", "ServiceLocatorInterface", "$", "serviceLocator", ")", "{", "if", "(", "$", "this", "->", "config", "!==", "null", ")", "{", "return", "$", "this", "->", "config", ";", "}", "/* @var $serviceLocator SupervisorManager */",...
Get amqp configuration, if any @param ServiceLocatorInterface $serviceLocator @return array
[ "Get", "amqp", "configuration", "if", "any" ]
b71a7508d9737dbda1ad3b0a1374ed70b77070bd
https://github.com/prolic/HumusSupervisorModule/blob/b71a7508d9737dbda1ad3b0a1374ed70b77070bd/src/HumusSupervisorModule/SupervisorAbstractServiceFactory.php#L102-L126
199,485
zodream/database
src/Schema/Table.php
Table.setAI
public function setAI($arg) { $this->aiBegin = max($this->aiBegin, intval($arg)); return $this; }
php
public function setAI($arg) { $this->aiBegin = max($this->aiBegin, intval($arg)); return $this; }
[ "public", "function", "setAI", "(", "$", "arg", ")", "{", "$", "this", "->", "aiBegin", "=", "max", "(", "$", "this", "->", "aiBegin", ",", "intval", "(", "$", "arg", ")", ")", ";", "return", "$", "this", ";", "}" ]
SET AUTO_INCREMENT BEGIN @param string $arg @return $this
[ "SET", "AUTO_INCREMENT", "BEGIN" ]
03712219c057799d07350a3a2650c55bcc92c28e
https://github.com/zodream/database/blob/03712219c057799d07350a3a2650c55bcc92c28e/src/Schema/Table.php#L157-L160
199,486
zodream/database
src/Schema/Table.php
Table.fk
public function fk($name, $field, $table, $fkField, $delete = 'NO ACTION', $update = 'NO ACTION') { $this->foreignKey[$name] = [$field, $table, $fkField, $delete, $update]; return $this; }
php
public function fk($name, $field, $table, $fkField, $delete = 'NO ACTION', $update = 'NO ACTION') { $this->foreignKey[$name] = [$field, $table, $fkField, $delete, $update]; return $this; }
[ "public", "function", "fk", "(", "$", "name", ",", "$", "field", ",", "$", "table", ",", "$", "fkField", ",", "$", "delete", "=", "'NO ACTION'", ",", "$", "update", "=", "'NO ACTION'", ")", "{", "$", "this", "->", "foreignKey", "[", "$", "name", "]...
SET FOREIGN KEY @param string $name @param string $field @param string $table @param string $fkField @param string $delete @param string $update @return $this
[ "SET", "FOREIGN", "KEY" ]
03712219c057799d07350a3a2650c55bcc92c28e
https://github.com/zodream/database/blob/03712219c057799d07350a3a2650c55bcc92c28e/src/Schema/Table.php#L172-L175
199,487
zodream/database
src/Schema/Table.php
Table.getAlertSql
public function getAlertSql() { $sql = []; foreach ($this->_data as $item) { $sql[] = $item->getAlterSql(); } return sprintf('ALTER TABLE %s %s;', $this->getTable(), implode(',', $sql)); }
php
public function getAlertSql() { $sql = []; foreach ($this->_data as $item) { $sql[] = $item->getAlterSql(); } return sprintf('ALTER TABLE %s %s;', $this->getTable(), implode(',', $sql)); }
[ "public", "function", "getAlertSql", "(", ")", "{", "$", "sql", "=", "[", "]", ";", "foreach", "(", "$", "this", "->", "_data", "as", "$", "item", ")", "{", "$", "sql", "[", "]", "=", "$", "item", "->", "getAlterSql", "(", ")", ";", "}", "retur...
GET ALERT TABLE SQL @return string
[ "GET", "ALERT", "TABLE", "SQL" ]
03712219c057799d07350a3a2650c55bcc92c28e
https://github.com/zodream/database/blob/03712219c057799d07350a3a2650c55bcc92c28e/src/Schema/Table.php#L454-L462
199,488
zodream/database
src/Schema/Table.php
Table.getSql
public function getSql() { $sql = "CREATE TABLE IF NOT EXISTS {$this->getTable()} ("; $column = $this->_data; if (!empty($this->primaryKey)) { $column[] = "PRIMARY KEY (`{$this->primaryKey}`)"; } foreach ($this->checks as $key => $item) { $column[] = (!is_...
php
public function getSql() { $sql = "CREATE TABLE IF NOT EXISTS {$this->getTable()} ("; $column = $this->_data; if (!empty($this->primaryKey)) { $column[] = "PRIMARY KEY (`{$this->primaryKey}`)"; } foreach ($this->checks as $key => $item) { $column[] = (!is_...
[ "public", "function", "getSql", "(", ")", "{", "$", "sql", "=", "\"CREATE TABLE IF NOT EXISTS {$this->getTable()} (\"", ";", "$", "column", "=", "$", "this", "->", "_data", ";", "if", "(", "!", "empty", "(", "$", "this", "->", "primaryKey", ")", ")", "{", ...
GET CREATE TABLE SQL @return string
[ "GET", "CREATE", "TABLE", "SQL" ]
03712219c057799d07350a3a2650c55bcc92c28e
https://github.com/zodream/database/blob/03712219c057799d07350a3a2650c55bcc92c28e/src/Schema/Table.php#L494-L514
199,489
nochso/ORM2
src/Relation.php
Relation.getForeignKey
public function getForeignKey() { if ($this->foreignKey !== null) { return $this->foreignKey; } $this->init(); switch ($this->type) { case self::HAS_MANY: case self::HAS_ONE: return $this->owner->getTableName() . '_' . $this->owner-...
php
public function getForeignKey() { if ($this->foreignKey !== null) { return $this->foreignKey; } $this->init(); switch ($this->type) { case self::HAS_MANY: case self::HAS_ONE: return $this->owner->getTableName() . '_' . $this->owner-...
[ "public", "function", "getForeignKey", "(", ")", "{", "if", "(", "$", "this", "->", "foreignKey", "!==", "null", ")", "{", "return", "$", "this", "->", "foreignKey", ";", "}", "$", "this", "->", "init", "(", ")", ";", "switch", "(", "$", "this", "-...
Returns the name of the column that will be filtered on @return string @throws \Exception
[ "Returns", "the", "name", "of", "the", "column", "that", "will", "be", "filtered", "on" ]
89f9a5c61ad5f575fbdd52990171b52d54f8bfbc
https://github.com/nochso/ORM2/blob/89f9a5c61ad5f575fbdd52990171b52d54f8bfbc/src/Relation.php#L69-L84
199,490
eureka-framework/component-response
src/Response/Factory.php
Factory.create
public static function create($format = self::FORMAT_JSON, $engine = self::ENGINE_API) { $response = '\Eureka\Component\Response'; switch ($format) { //~ Json case self::FORMAT_JSON: $responseFormat = '\Json'; break; //~ Html ...
php
public static function create($format = self::FORMAT_JSON, $engine = self::ENGINE_API) { $response = '\Eureka\Component\Response'; switch ($format) { //~ Json case self::FORMAT_JSON: $responseFormat = '\Json'; break; //~ Html ...
[ "public", "static", "function", "create", "(", "$", "format", "=", "self", "::", "FORMAT_JSON", ",", "$", "engine", "=", "self", "::", "ENGINE_API", ")", "{", "$", "response", "=", "'\\Eureka\\Component\\Response'", ";", "switch", "(", "$", "format", ")", ...
Create response object. @param string $format @param string $engine @return Response @throws \DomainException
[ "Create", "response", "object", "." ]
f34aea3a0aa67b88c5e7f8a3b86af29c550fa99a
https://github.com/eureka-framework/component-response/blob/f34aea3a0aa67b88c5e7f8a3b86af29c550fa99a/src/Response/Factory.php#L62-L104
199,491
CDyWeb/http-adapter
src/cdyweb/http/psr/Uri.php
Uri.filterPath
private function filterPath($path) { if ($path != null && substr($path, 0, 1) !== '/') { $path = '/' . $path; } return preg_replace_callback( '/(?:[^' . self::$charUnreserved . ':@&=\+\$,\/;%]+|%(?![A-Fa-f0-9]{2}))/', function ($match) { return rawurlenco...
php
private function filterPath($path) { if ($path != null && substr($path, 0, 1) !== '/') { $path = '/' . $path; } return preg_replace_callback( '/(?:[^' . self::$charUnreserved . ':@&=\+\$,\/;%]+|%(?![A-Fa-f0-9]{2}))/', function ($match) { return rawurlenco...
[ "private", "function", "filterPath", "(", "$", "path", ")", "{", "if", "(", "$", "path", "!=", "null", "&&", "substr", "(", "$", "path", ",", "0", ",", "1", ")", "!==", "'/'", ")", "{", "$", "path", "=", "'/'", ".", "$", "path", ";", "}", "re...
Filters the path of a URI @param $path @return string
[ "Filters", "the", "path", "of", "a", "URI" ]
882e2fb8429dd6d55e0a2aba1cca5a8c2b4a47d7
https://github.com/CDyWeb/http-adapter/blob/882e2fb8429dd6d55e0a2aba1cca5a8c2b4a47d7/src/cdyweb/http/psr/Uri.php#L574-L585
199,492
translationexchange/tml-php-clientsdk
library/Tr8n/RulesEngine/Evaluator.php
Evaluator.reset
function reset() { foreach ($this->vars as $key=>$val) { unset($this->env[$key]); } $this->vars = array(); }
php
function reset() { foreach ($this->vars as $key=>$val) { unset($this->env[$key]); } $this->vars = array(); }
[ "function", "reset", "(", ")", "{", "foreach", "(", "$", "this", "->", "vars", "as", "$", "key", "=>", "$", "val", ")", "{", "unset", "(", "$", "this", "->", "env", "[", "$", "key", "]", ")", ";", "}", "$", "this", "->", "vars", "=", "array",...
Resets evaluator's variables
[ "Resets", "evaluator", "s", "variables" ]
fe51473824e62cfd883c6aa0c6a3783a16ce8425
https://github.com/translationexchange/tml-php-clientsdk/blob/fe51473824e62cfd883c6aa0c6a3783a16ce8425/library/Tr8n/RulesEngine/Evaluator.php#L173-L178
199,493
kherge-abandoned/lib-psr4
src/lib/Phine/PSR4/Loader.php
Loader.map
public function map($prefix, $paths) { $prefix = ltrim($prefix, '\\'); $paths = (array) $paths; if (!isset($this->map[$prefix])) { $this->map[$prefix] = array(); } foreach ($paths as $path) { $this->map[$prefix][] = rtrim($path, '\\/') . DIRECTORY_SE...
php
public function map($prefix, $paths) { $prefix = ltrim($prefix, '\\'); $paths = (array) $paths; if (!isset($this->map[$prefix])) { $this->map[$prefix] = array(); } foreach ($paths as $path) { $this->map[$prefix][] = rtrim($path, '\\/') . DIRECTORY_SE...
[ "public", "function", "map", "(", "$", "prefix", ",", "$", "paths", ")", "{", "$", "prefix", "=", "ltrim", "(", "$", "prefix", ",", "'\\\\'", ")", ";", "$", "paths", "=", "(", "array", ")", "$", "paths", ";", "if", "(", "!", "isset", "(", "$", ...
Maps a namespace prefix to one or more base directory paths. This method is used to map a single namespace to one or more directory paths. The `$paths` argument may be a single directory path (string), or an array of directory paths. $loader->map('Example\\Prefix', '/single/dir/path'); $loader->map( 'Example\\Prefix...
[ "Maps", "a", "namespace", "prefix", "to", "one", "or", "more", "base", "directory", "paths", "." ]
460b7089204fd09051fba13b2c4bfc6caba080e5
https://github.com/kherge-abandoned/lib-psr4/blob/460b7089204fd09051fba13b2c4bfc6caba080e5/src/lib/Phine/PSR4/Loader.php#L113-L127
199,494
kherge-abandoned/lib-psr4
src/lib/Phine/PSR4/Loader.php
Loader.getPath
protected function getPath($class) { foreach ($this->map as $prefix => $paths) { if (0 !== strpos($class, $prefix)) { continue; } foreach ($paths as $path) { $relative = ltrim(substr($class, strlen($prefix)), '\\'); $relati...
php
protected function getPath($class) { foreach ($this->map as $prefix => $paths) { if (0 !== strpos($class, $prefix)) { continue; } foreach ($paths as $path) { $relative = ltrim(substr($class, strlen($prefix)), '\\'); $relati...
[ "protected", "function", "getPath", "(", "$", "class", ")", "{", "foreach", "(", "$", "this", "->", "map", "as", "$", "prefix", "=>", "$", "paths", ")", "{", "if", "(", "0", "!==", "strpos", "(", "$", "class", ",", "$", "prefix", ")", ")", "{", ...
Returns the file path for the class name. This method will loop through the mapped namespace prefixes to find a directory that contains the class. If the file for the class is found, it will be returned. Otherwise, nothing (`null`) is returned. @param string $class The name of the class. @return string The file path...
[ "Returns", "the", "file", "path", "for", "the", "class", "name", "." ]
460b7089204fd09051fba13b2c4bfc6caba080e5
https://github.com/kherge-abandoned/lib-psr4/blob/460b7089204fd09051fba13b2c4bfc6caba080e5/src/lib/Phine/PSR4/Loader.php#L162-L181
199,495
Sectorr/Core
Sectorr/Core/Input/Validator.php
Validator.passes
public function passes($input, $rules) { foreach ($rules as $field => $rule) { $this->callValidator($input[$field], $field, $rule); } return ! $this->failed; }
php
public function passes($input, $rules) { foreach ($rules as $field => $rule) { $this->callValidator($input[$field], $field, $rule); } return ! $this->failed; }
[ "public", "function", "passes", "(", "$", "input", ",", "$", "rules", ")", "{", "foreach", "(", "$", "rules", "as", "$", "field", "=>", "$", "rule", ")", "{", "$", "this", "->", "callValidator", "(", "$", "input", "[", "$", "field", "]", ",", "$"...
Loops through the rules and checks the current input. @param $input @param $rules @return bool
[ "Loops", "through", "the", "rules", "and", "checks", "the", "current", "input", "." ]
31df852dc6cc61642b0b87d9f0ae56c8e7da5a27
https://github.com/Sectorr/Core/blob/31df852dc6cc61642b0b87d9f0ae56c8e7da5a27/Sectorr/Core/Input/Validator.php#L28-L34
199,496
Sectorr/Core
Sectorr/Core/Input/Validator.php
Validator.unique
protected function unique($input, $table, $column) { $email = $this->db->get($table, $column, [ $column => $input ]); if ($email) { var_dump("error: {$column} not unique"); $this->failed = true; } }
php
protected function unique($input, $table, $column) { $email = $this->db->get($table, $column, [ $column => $input ]); if ($email) { var_dump("error: {$column} not unique"); $this->failed = true; } }
[ "protected", "function", "unique", "(", "$", "input", ",", "$", "table", ",", "$", "column", ")", "{", "$", "email", "=", "$", "this", "->", "db", "->", "get", "(", "$", "table", ",", "$", "column", ",", "[", "$", "column", "=>", "$", "input", ...
Check if the given input is unique in the given database table and column. @param $input @param $table @param $column
[ "Check", "if", "the", "given", "input", "is", "unique", "in", "the", "given", "database", "table", "and", "column", "." ]
31df852dc6cc61642b0b87d9f0ae56c8e7da5a27
https://github.com/Sectorr/Core/blob/31df852dc6cc61642b0b87d9f0ae56c8e7da5a27/Sectorr/Core/Input/Validator.php#L84-L93
199,497
Sectorr/Core
Sectorr/Core/Input/Validator.php
Validator.multiple
protected function multiple($value) { $arguments = explode(':', $value); if (count($arguments) > 1) { $rule = $arguments[0]; unset($arguments[0]); return ['multiple' => true, 'rule' => $rule, 'arguments' => array_values($arguments)]; } return ['...
php
protected function multiple($value) { $arguments = explode(':', $value); if (count($arguments) > 1) { $rule = $arguments[0]; unset($arguments[0]); return ['multiple' => true, 'rule' => $rule, 'arguments' => array_values($arguments)]; } return ['...
[ "protected", "function", "multiple", "(", "$", "value", ")", "{", "$", "arguments", "=", "explode", "(", "':'", ",", "$", "value", ")", ";", "if", "(", "count", "(", "$", "arguments", ")", ">", "1", ")", "{", "$", "rule", "=", "$", "arguments", "...
Retrieves multiple arguments from argument string. @param $arg @return array|bool
[ "Retrieves", "multiple", "arguments", "from", "argument", "string", "." ]
31df852dc6cc61642b0b87d9f0ae56c8e7da5a27
https://github.com/Sectorr/Core/blob/31df852dc6cc61642b0b87d9f0ae56c8e7da5a27/Sectorr/Core/Input/Validator.php#L101-L113
199,498
Sectorr/Core
Sectorr/Core/Input/Validator.php
Validator.callValidator
protected function callValidator($input, $field, $arguments) { $arguments = explode('|', $arguments); foreach ($arguments as $arg) { if ($this->multiple($arg)['multiple']) { switch ($this->multiple($arg)['rule']) { case 'unique': ...
php
protected function callValidator($input, $field, $arguments) { $arguments = explode('|', $arguments); foreach ($arguments as $arg) { if ($this->multiple($arg)['multiple']) { switch ($this->multiple($arg)['rule']) { case 'unique': ...
[ "protected", "function", "callValidator", "(", "$", "input", ",", "$", "field", ",", "$", "arguments", ")", "{", "$", "arguments", "=", "explode", "(", "'|'", ",", "$", "arguments", ")", ";", "foreach", "(", "$", "arguments", "as", "$", "arg", ")", "...
Loops through all arguments and checks what methods need to be called. @param $input @param $field @param $arguments
[ "Loops", "through", "all", "arguments", "and", "checks", "what", "methods", "need", "to", "be", "called", "." ]
31df852dc6cc61642b0b87d9f0ae56c8e7da5a27
https://github.com/Sectorr/Core/blob/31df852dc6cc61642b0b87d9f0ae56c8e7da5a27/Sectorr/Core/Input/Validator.php#L122-L149
199,499
PenoaksDev/Milky-Framework
src/Milky/Validation/DatabasePresenceVerifier.php
DatabasePresenceVerifier.table
protected function table( $table ) { return $this->db->connection( $this->connection )->table( $table )->useWritePdo(); }
php
protected function table( $table ) { return $this->db->connection( $this->connection )->table( $table )->useWritePdo(); }
[ "protected", "function", "table", "(", "$", "table", ")", "{", "return", "$", "this", "->", "db", "->", "connection", "(", "$", "this", "->", "connection", ")", "->", "table", "(", "$", "table", ")", "->", "useWritePdo", "(", ")", ";", "}" ]
Get a query builder for the given table. @param string $table @return Builder
[ "Get", "a", "query", "builder", "for", "the", "given", "table", "." ]
8afd7156610a70371aa5b1df50b8a212bf7b142c
https://github.com/PenoaksDev/Milky-Framework/blob/8afd7156610a70371aa5b1df50b8a212bf7b142c/src/Milky/Validation/DatabasePresenceVerifier.php#L117-L120