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
21,600
brightmarch/rest-easy
src/Brightmarch/RestEasy/Controller/Controller.php
Controller.resourceRequires
public function resourceRequires() { $this->requiredTypes = array_merge(func_get_args(), $this->requiredTypes); $this->canServerSupportThisRequest(); return $this; }
php
public function resourceRequires() { $this->requiredTypes = array_merge(func_get_args(), $this->requiredTypes); $this->canServerSupportThisRequest(); return $this; }
[ "public", "function", "resourceRequires", "(", ")", "{", "$", "this", "->", "requiredTypes", "=", "array_merge", "(", "func_get_args", "(", ")", ",", "$", "this", "->", "requiredTypes", ")", ";", "$", "this", "->", "canServerSupportThisRequest", "(", ")", ";...
Set a list of content types this resource requires. @param [string, string, ...] @return Controller
[ "Set", "a", "list", "of", "content", "types", "this", "resource", "requires", "." ]
a6903cdff0a5de2e4466d3e3438c59b9903049f4
https://github.com/brightmarch/rest-easy/blob/a6903cdff0a5de2e4466d3e3438c59b9903049f4/src/Brightmarch/RestEasy/Controller/Controller.php#L56-L62
21,601
brightmarch/rest-easy
src/Brightmarch/RestEasy/Controller/Controller.php
Controller.renderResource
public function renderResource($view, array $parameters=[], $statusCode=200) { $this->findContentType() ->findViewType() ->buildViewTemplate($view) ->checkViewTemplateExists(); $response = $this->createResponse($statusCode); $response->headers ...
php
public function renderResource($view, array $parameters=[], $statusCode=200) { $this->findContentType() ->findViewType() ->buildViewTemplate($view) ->checkViewTemplateExists(); $response = $this->createResponse($statusCode); $response->headers ...
[ "public", "function", "renderResource", "(", "$", "view", ",", "array", "$", "parameters", "=", "[", "]", ",", "$", "statusCode", "=", "200", ")", "{", "$", "this", "->", "findContentType", "(", ")", "->", "findViewType", "(", ")", "->", "buildViewTempla...
Creates a Response object and returns it. @param string $view @param array $parameters @param integer $statusCode @return Symfony\Component\HttpFoundation\Response
[ "Creates", "a", "Response", "object", "and", "returns", "it", "." ]
a6903cdff0a5de2e4466d3e3438c59b9903049f4
https://github.com/brightmarch/rest-easy/blob/a6903cdff0a5de2e4466d3e3438c59b9903049f4/src/Brightmarch/RestEasy/Controller/Controller.php#L72-L84
21,602
heidelpay/PhpDoc
src/phpDocumentor/Descriptor/Builder/Reflector/Tags/TypeCollectionAssembler.php
TypeCollectionAssembler.convertToArrayDescriptor
protected function convertToArrayDescriptor($descriptor) { $arrayDescriptor = new CollectionDescriptor('array'); $arrayDescriptor->setTypes(array($descriptor)); $arrayDescriptor->setKeyTypes(array('mixed')); return $arrayDescriptor; }
php
protected function convertToArrayDescriptor($descriptor) { $arrayDescriptor = new CollectionDescriptor('array'); $arrayDescriptor->setTypes(array($descriptor)); $arrayDescriptor->setKeyTypes(array('mixed')); return $arrayDescriptor; }
[ "protected", "function", "convertToArrayDescriptor", "(", "$", "descriptor", ")", "{", "$", "arrayDescriptor", "=", "new", "CollectionDescriptor", "(", "'array'", ")", ";", "$", "arrayDescriptor", "->", "setTypes", "(", "array", "(", "$", "descriptor", ")", ")",...
Wraps the given Descriptor inside a Collection Descriptor of type array and returns that. @param DescriptorAbstract $descriptor @return CollectionDescriptor
[ "Wraps", "the", "given", "Descriptor", "inside", "a", "Collection", "Descriptor", "of", "type", "array", "and", "returns", "that", "." ]
5ac9e842cbd4cbb70900533b240c131f3515ee02
https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Descriptor/Builder/Reflector/Tags/TypeCollectionAssembler.php#L99-L106
21,603
heidelpay/PhpDoc
src/phpDocumentor/Descriptor/Builder/Reflector/Tags/TypeCollectionAssembler.php
TypeCollectionAssembler.findClassNameForType
protected function findClassNameForType($type) { $className = (isset($this->typeToValueObjectClassName[$type])) ? $this->typeToValueObjectClassName[$type] : false; return $className; }
php
protected function findClassNameForType($type) { $className = (isset($this->typeToValueObjectClassName[$type])) ? $this->typeToValueObjectClassName[$type] : false; return $className; }
[ "protected", "function", "findClassNameForType", "(", "$", "type", ")", "{", "$", "className", "=", "(", "isset", "(", "$", "this", "->", "typeToValueObjectClassName", "[", "$", "type", "]", ")", ")", "?", "$", "this", "->", "typeToValueObjectClassName", "["...
Returns the class name of the Value Object class associated with a given type or false if the type is unknown. @param string $type @return string|boolean
[ "Returns", "the", "class", "name", "of", "the", "Value", "Object", "class", "associated", "with", "a", "given", "type", "or", "false", "if", "the", "type", "is", "unknown", "." ]
5ac9e842cbd4cbb70900533b240c131f3515ee02
https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Descriptor/Builder/Reflector/Tags/TypeCollectionAssembler.php#L115-L122
21,604
Eresus/EresusCMS
src/core/framework/core/3rdparty/ezcomponents/Database/src/factory.php
ezcDbFactory.getImplementations
static public function getImplementations() { $list = array(); foreach ( self::$implementations as $name => $className ) { $list[] = $name; } return $list; }
php
static public function getImplementations() { $list = array(); foreach ( self::$implementations as $name => $className ) { $list[] = $name; } return $list; }
[ "static", "public", "function", "getImplementations", "(", ")", "{", "$", "list", "=", "array", "(", ")", ";", "foreach", "(", "self", "::", "$", "implementations", "as", "$", "name", "=>", "$", "className", ")", "{", "$", "list", "[", "]", "=", "$",...
Returns a list with supported database implementations. Example: <code> ezcDbFactory::getImplementations(); </code> @return array(string)
[ "Returns", "a", "list", "with", "supported", "database", "implementations", "." ]
b0afc661105f0a2f65d49abac13956cc93c5188d
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Database/src/factory.php#L101-L109
21,605
Eresus/EresusCMS
src/core/framework/core/3rdparty/ezcomponents/Database/src/factory.php
ezcDbFactory.create
static public function create( $dbParams ) { if ( is_string( $dbParams ) ) { $dbParams = self::parseDSN( $dbParams ); } else if ( !is_array( $dbParams ) ) { throw new ezcBaseValueException( 'dbParams', $dbParams, 'string or array', 'parameter' ); ...
php
static public function create( $dbParams ) { if ( is_string( $dbParams ) ) { $dbParams = self::parseDSN( $dbParams ); } else if ( !is_array( $dbParams ) ) { throw new ezcBaseValueException( 'dbParams', $dbParams, 'string or array', 'parameter' ); ...
[ "static", "public", "function", "create", "(", "$", "dbParams", ")", "{", "if", "(", "is_string", "(", "$", "dbParams", ")", ")", "{", "$", "dbParams", "=", "self", "::", "parseDSN", "(", "$", "dbParams", ")", ";", "}", "else", "if", "(", "!", "is_...
Creates and returns an instance of the specified ezcDbHandler implementation. Supported database parameters are: - phptype|type|handler|driver: Database implementation - user|username: Database user name - pass|password: Database user password - dbname|database: Database name - ...
[ "Creates", "and", "returns", "an", "instance", "of", "the", "specified", "ezcDbHandler", "implementation", "." ]
b0afc661105f0a2f65d49abac13956cc93c5188d
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Database/src/factory.php#L134-L165
21,606
surebert/surebert-framework
src/sb/Samba/Connection.php
Connection.execute
public function execute($command, &$output = null) { $cmd = "smbclient '\\\\{$this->host}\\{$this->share}' $this->password -U $this->username -W $this->domain -c '$command' 2>&1"; exec($cmd, $output, $return); if($return === 1){ $errmsg = sprintf("Host: %s / Share: %s / Usernam...
php
public function execute($command, &$output = null) { $cmd = "smbclient '\\\\{$this->host}\\{$this->share}' $this->password -U $this->username -W $this->domain -c '$command' 2>&1"; exec($cmd, $output, $return); if($return === 1){ $errmsg = sprintf("Host: %s / Share: %s / Usernam...
[ "public", "function", "execute", "(", "$", "command", ",", "&", "$", "output", "=", "null", ")", "{", "$", "cmd", "=", "\"smbclient '\\\\\\\\{$this->host}\\\\{$this->share}' $this->password -U $this->username -W $this->domain -c '$command' 2>&1\"", ";", "exec", "(", "$", ...
Executes the command line function that completes the remote windows operations @param $command string the command to issue to the smbclient @param $output array what the command line returns @param $log boolean whether to log this transaction @return int Exit code for smbclient: 0 for success, 1 for error
[ "Executes", "the", "command", "line", "function", "that", "completes", "the", "remote", "windows", "operations" ]
f2f32eb693bd39385ceb93355efb5b2a429f27ce
https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Samba/Connection.php#L152-L180
21,607
surebert/surebert-framework
src/sb/Samba/Connection.php
Connection.parseListing
private function parseListing($listing, $subdir = '') { $ret = new \sb\Samba\Listing(); $exp = '/^\s{2}([\w \-]+\.?\w{3,4})\s+([A-Z]?)\s+(\d+)\s+(\w{3}.+)$/'; preg_match_all($exp, $listing, $matches); if($matches[0]) { $ret->name = $matches[1][0]; $ret->type...
php
private function parseListing($listing, $subdir = '') { $ret = new \sb\Samba\Listing(); $exp = '/^\s{2}([\w \-]+\.?\w{3,4})\s+([A-Z]?)\s+(\d+)\s+(\w{3}.+)$/'; preg_match_all($exp, $listing, $matches); if($matches[0]) { $ret->name = $matches[1][0]; $ret->type...
[ "private", "function", "parseListing", "(", "$", "listing", ",", "$", "subdir", "=", "''", ")", "{", "$", "ret", "=", "new", "\\", "sb", "\\", "Samba", "\\", "Listing", "(", ")", ";", "$", "exp", "=", "'/^\\s{2}([\\w \\-]+\\.?\\w{3,4})\\s+([A-Z]?)\\s+(\\d+)\...
Converts a line of returned output into a \sb\Samba_Listing object @param $listing @param $subdir @return \sb\Samba\Listing
[ "Converts", "a", "line", "of", "returned", "output", "into", "a", "\\", "sb", "\\", "Samba_Listing", "object" ]
f2f32eb693bd39385ceb93355efb5b2a429f27ce
https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Samba/Connection.php#L235-L253
21,608
willhoffmann/domuserp-php
src/Resources/Companies/Secondary/Branches.php
Branches.get
public function get($id) { $data = $this->execute( self::HTTP_GET, self::DOMUSERP_API_PEDIDOVENDA . '/empresas/' . $this->companyId . '/filiais/' . $id ); return $data; }
php
public function get($id) { $data = $this->execute( self::HTTP_GET, self::DOMUSERP_API_PEDIDOVENDA . '/empresas/' . $this->companyId . '/filiais/' . $id ); return $data; }
[ "public", "function", "get", "(", "$", "id", ")", "{", "$", "data", "=", "$", "this", "->", "execute", "(", "self", "::", "HTTP_GET", ",", "self", "::", "DOMUSERP_API_PEDIDOVENDA", ".", "'/empresas/'", ".", "$", "this", "->", "companyId", ".", "'/filiais...
Gets the branch data according to the id parameter @param int $id @return array|string @throws \GuzzleHttp\Exception\GuzzleException
[ "Gets", "the", "branch", "data", "according", "to", "the", "id", "parameter" ]
44e77a4f02b0252bc26cae4c0e6b2b7d578f10a6
https://github.com/willhoffmann/domuserp-php/blob/44e77a4f02b0252bc26cae4c0e6b2b7d578f10a6/src/Resources/Companies/Secondary/Branches.php#L52-L60
21,609
BugBuster1701/contao-botdetection-bundle
src/Resources/contao/classes/CheckBotReferrer.php
CheckBotReferrer.getReferrerLocalList
protected static function getReferrerLocalList() { $botreferrerlist = array(); if (isset($GLOBALS['BOTDETECTION']['BOT_REFERRER']) && \is_array($GLOBALS['BOTDETECTION']['BOT_REFERRER']) ) { foreach ($GLOBALS['BOTDETECTION']['BOT_REFERRER'] as $search) ...
php
protected static function getReferrerLocalList() { $botreferrerlist = array(); if (isset($GLOBALS['BOTDETECTION']['BOT_REFERRER']) && \is_array($GLOBALS['BOTDETECTION']['BOT_REFERRER']) ) { foreach ($GLOBALS['BOTDETECTION']['BOT_REFERRER'] as $search) ...
[ "protected", "static", "function", "getReferrerLocalList", "(", ")", "{", "$", "botreferrerlist", "=", "array", "(", ")", ";", "if", "(", "isset", "(", "$", "GLOBALS", "[", "'BOTDETECTION'", "]", "[", "'BOT_REFERRER'", "]", ")", "&&", "\\", "is_array", "("...
Get Referrer List, self defined over localconfig @param string $Bot_Referrer_List @return boolean|array: false: no list, array: Referrer List
[ "Get", "Referrer", "List", "self", "defined", "over", "localconfig" ]
50c964acc354aa9116fae0e509cd7d075bd52f55
https://github.com/BugBuster1701/contao-botdetection-bundle/blob/50c964acc354aa9116fae0e509cd7d075bd52f55/src/Resources/contao/classes/CheckBotReferrer.php#L159-L175
21,610
lukasz-adamski/teamspeak3-framework
src/TeamSpeak3/Node/Server.php
Server.channelFileList
public function channelFileList($cid, $cpw = "", $path = "/", $recursive = FALSE) { $files = $this->execute("ftgetfilelist", array("cid" => $cid, "cpw" => $cpw, "path" => $path))->toArray(); $count = count($files); for($i = 0; $i < $count; $i++) { $files[$i]["sid"] = $this->getId(); $fil...
php
public function channelFileList($cid, $cpw = "", $path = "/", $recursive = FALSE) { $files = $this->execute("ftgetfilelist", array("cid" => $cid, "cpw" => $cpw, "path" => $path))->toArray(); $count = count($files); for($i = 0; $i < $count; $i++) { $files[$i]["sid"] = $this->getId(); $fil...
[ "public", "function", "channelFileList", "(", "$", "cid", ",", "$", "cpw", "=", "\"\"", ",", "$", "path", "=", "\"/\"", ",", "$", "recursive", "=", "FALSE", ")", "{", "$", "files", "=", "$", "this", "->", "execute", "(", "\"ftgetfilelist\"", ",", "ar...
Returns a list of files and directories stored in the specified channels file repository. @param integer $cid @param string $cpw @param string $path @param boolean $recursive @return array
[ "Returns", "a", "list", "of", "files", "and", "directories", "stored", "in", "the", "specified", "channels", "file", "repository", "." ]
39a56eca608da6b56b6aa386a7b5b31dc576c41a
https://github.com/lukasz-adamski/teamspeak3-framework/blob/39a56eca608da6b56b6aa386a7b5b31dc576c41a/src/TeamSpeak3/Node/Server.php#L491-L519
21,611
lukasz-adamski/teamspeak3-framework
src/TeamSpeak3/Node/Server.php
Server.channelGetById
public function channelGetById($cid) { if(!array_key_exists((string) $cid, $this->channelList())) { throw new Exception("invalid channelID", 0x300); } return $this->channelList[intval((string) $cid)]; }
php
public function channelGetById($cid) { if(!array_key_exists((string) $cid, $this->channelList())) { throw new Exception("invalid channelID", 0x300); } return $this->channelList[intval((string) $cid)]; }
[ "public", "function", "channelGetById", "(", "$", "cid", ")", "{", "if", "(", "!", "array_key_exists", "(", "(", "string", ")", "$", "cid", ",", "$", "this", "->", "channelList", "(", ")", ")", ")", "{", "throw", "new", "Exception", "(", "\"invalid cha...
Returns the Channel object matching the given ID. @param integer $cid @throws Exception @return Channel
[ "Returns", "the", "Channel", "object", "matching", "the", "given", "ID", "." ]
39a56eca608da6b56b6aa386a7b5b31dc576c41a
https://github.com/lukasz-adamski/teamspeak3-framework/blob/39a56eca608da6b56b6aa386a7b5b31dc576c41a/src/TeamSpeak3/Node/Server.php#L624-L632
21,612
lukasz-adamski/teamspeak3-framework
src/TeamSpeak3/Node/Server.php
Server.channelGetByName
public function channelGetByName($name) { foreach($this->channelList() as $channel) { if($channel["channel_name"] == $name) return $channel; } throw new Exception("invalid channelID", 0x300); }
php
public function channelGetByName($name) { foreach($this->channelList() as $channel) { if($channel["channel_name"] == $name) return $channel; } throw new Exception("invalid channelID", 0x300); }
[ "public", "function", "channelGetByName", "(", "$", "name", ")", "{", "foreach", "(", "$", "this", "->", "channelList", "(", ")", "as", "$", "channel", ")", "{", "if", "(", "$", "channel", "[", "\"channel_name\"", "]", "==", "$", "name", ")", "return",...
Returns the Channel object matching the given name. @param string $name @throws Exception @return Channel
[ "Returns", "the", "Channel", "object", "matching", "the", "given", "name", "." ]
39a56eca608da6b56b6aa386a7b5b31dc576c41a
https://github.com/lukasz-adamski/teamspeak3-framework/blob/39a56eca608da6b56b6aa386a7b5b31dc576c41a/src/TeamSpeak3/Node/Server.php#L641-L649
21,613
lukasz-adamski/teamspeak3-framework
src/TeamSpeak3/Node/Server.php
Server.clientList
public function clientList(array $filter = array()) { if($this->clientList === null) { $clients = $this->request("clientlist -uid -away -badges -voice -info -times -groups -icon -country -ip")->toAssocArray("clid"); $this->clientList = array(); foreach($clients as $clid => $client) {...
php
public function clientList(array $filter = array()) { if($this->clientList === null) { $clients = $this->request("clientlist -uid -away -badges -voice -info -times -groups -icon -country -ip")->toAssocArray("clid"); $this->clientList = array(); foreach($clients as $clid => $client) {...
[ "public", "function", "clientList", "(", "array", "$", "filter", "=", "array", "(", ")", ")", "{", "if", "(", "$", "this", "->", "clientList", "===", "null", ")", "{", "$", "clients", "=", "$", "this", "->", "request", "(", "\"clientlist -uid -away -badg...
Returns an array filled with Client objects. @param array $filter @return array|Client[]
[ "Returns", "an", "array", "filled", "with", "Client", "objects", "." ]
39a56eca608da6b56b6aa386a7b5b31dc576c41a
https://github.com/lukasz-adamski/teamspeak3-framework/blob/39a56eca608da6b56b6aa386a7b5b31dc576c41a/src/TeamSpeak3/Node/Server.php#L657-L678
21,614
lukasz-adamski/teamspeak3-framework
src/TeamSpeak3/Node/Server.php
Server.clientGetByName
public function clientGetByName($name) { foreach($this->clientList() as $client) { if($client["client_nickname"] == $name) return $client; } throw new Exception("invalid clientID", 0x200); }
php
public function clientGetByName($name) { foreach($this->clientList() as $client) { if($client["client_nickname"] == $name) return $client; } throw new Exception("invalid clientID", 0x200); }
[ "public", "function", "clientGetByName", "(", "$", "name", ")", "{", "foreach", "(", "$", "this", "->", "clientList", "(", ")", "as", "$", "client", ")", "{", "if", "(", "$", "client", "[", "\"client_nickname\"", "]", "==", "$", "name", ")", "return", ...
Returns the Client object matching the given name. @param string $name @throws Exception @return Client
[ "Returns", "the", "Client", "object", "matching", "the", "given", "name", "." ]
39a56eca608da6b56b6aa386a7b5b31dc576c41a
https://github.com/lukasz-adamski/teamspeak3-framework/blob/39a56eca608da6b56b6aa386a7b5b31dc576c41a/src/TeamSpeak3/Node/Server.php#L785-L793
21,615
lukasz-adamski/teamspeak3-framework
src/TeamSpeak3/Node/Server.php
Server.clientGetByUid
public function clientGetByUid($uid) { foreach($this->clientList() as $client) { if($client["client_unique_identifier"] == $uid) return $client; } throw new Exception("invalid clientID", 0x200); }
php
public function clientGetByUid($uid) { foreach($this->clientList() as $client) { if($client["client_unique_identifier"] == $uid) return $client; } throw new Exception("invalid clientID", 0x200); }
[ "public", "function", "clientGetByUid", "(", "$", "uid", ")", "{", "foreach", "(", "$", "this", "->", "clientList", "(", ")", "as", "$", "client", ")", "{", "if", "(", "$", "client", "[", "\"client_unique_identifier\"", "]", "==", "$", "uid", ")", "ret...
Returns the Client object matching the given unique identifier. @param string $uid @throws Exception @return Client
[ "Returns", "the", "Client", "object", "matching", "the", "given", "unique", "identifier", "." ]
39a56eca608da6b56b6aa386a7b5b31dc576c41a
https://github.com/lukasz-adamski/teamspeak3-framework/blob/39a56eca608da6b56b6aa386a7b5b31dc576c41a/src/TeamSpeak3/Node/Server.php#L802-L810
21,616
lukasz-adamski/teamspeak3-framework
src/TeamSpeak3/Node/Server.php
Server.clientGetByDbid
public function clientGetByDbid($dbid) { foreach($this->clientList() as $client) { if($client["client_database_id"] == $dbid) return $client; } throw new Exception("invalid clientID", 0x200); }
php
public function clientGetByDbid($dbid) { foreach($this->clientList() as $client) { if($client["client_database_id"] == $dbid) return $client; } throw new Exception("invalid clientID", 0x200); }
[ "public", "function", "clientGetByDbid", "(", "$", "dbid", ")", "{", "foreach", "(", "$", "this", "->", "clientList", "(", ")", "as", "$", "client", ")", "{", "if", "(", "$", "client", "[", "\"client_database_id\"", "]", "==", "$", "dbid", ")", "return...
Returns the Client object matching the given database ID. @param integer $dbid @throws Exception @return Client
[ "Returns", "the", "Client", "object", "matching", "the", "given", "database", "ID", "." ]
39a56eca608da6b56b6aa386a7b5b31dc576c41a
https://github.com/lukasz-adamski/teamspeak3-framework/blob/39a56eca608da6b56b6aa386a7b5b31dc576c41a/src/TeamSpeak3/Node/Server.php#L819-L827
21,617
lukasz-adamski/teamspeak3-framework
src/TeamSpeak3/Node/Server.php
Server.clientMove
public function clientMove($clid, $cid, $cpw = null) { $this->clientListReset(); $this->execute("clientmove", array("clid" => $clid, "cid" => $cid, "cpw" => $cpw)); if($clid instanceof Node) { $clid = $clid->getId(); } if($cid instanceof Node) { $cid = $cid->getId(); } ...
php
public function clientMove($clid, $cid, $cpw = null) { $this->clientListReset(); $this->execute("clientmove", array("clid" => $clid, "cid" => $cid, "cpw" => $cpw)); if($clid instanceof Node) { $clid = $clid->getId(); } if($cid instanceof Node) { $cid = $cid->getId(); } ...
[ "public", "function", "clientMove", "(", "$", "clid", ",", "$", "cid", ",", "$", "cpw", "=", "null", ")", "{", "$", "this", "->", "clientListReset", "(", ")", ";", "$", "this", "->", "execute", "(", "\"clientmove\"", ",", "array", "(", "\"clid\"", "=...
Moves a client to another channel. @param integer $clid @param integer $cid @param string $cpw @return void
[ "Moves", "a", "client", "to", "another", "channel", "." ]
39a56eca608da6b56b6aa386a7b5b31dc576c41a
https://github.com/lukasz-adamski/teamspeak3-framework/blob/39a56eca608da6b56b6aa386a7b5b31dc576c41a/src/TeamSpeak3/Node/Server.php#L885-L905
21,618
lukasz-adamski/teamspeak3-framework
src/TeamSpeak3/Node/Server.php
Server.serverGroupGetById
public function serverGroupGetById($sgid) { if(!array_key_exists((string) $sgid, $this->serverGroupList())) { throw new Exception("invalid groupID", 0xA00); } return $this->sgroupList[intval((string) $sgid)]; }
php
public function serverGroupGetById($sgid) { if(!array_key_exists((string) $sgid, $this->serverGroupList())) { throw new Exception("invalid groupID", 0xA00); } return $this->sgroupList[intval((string) $sgid)]; }
[ "public", "function", "serverGroupGetById", "(", "$", "sgid", ")", "{", "if", "(", "!", "array_key_exists", "(", "(", "string", ")", "$", "sgid", ",", "$", "this", "->", "serverGroupList", "(", ")", ")", ")", "{", "throw", "new", "Exception", "(", "\"i...
Returns the Servergroup object matching the given ID. @param integer $sgid @throws Exception @return ServerGroup
[ "Returns", "the", "Servergroup", "object", "matching", "the", "given", "ID", "." ]
39a56eca608da6b56b6aa386a7b5b31dc576c41a
https://github.com/lukasz-adamski/teamspeak3-framework/blob/39a56eca608da6b56b6aa386a7b5b31dc576c41a/src/TeamSpeak3/Node/Server.php#L1157-L1165
21,619
shabbyrobe/amiss
src/Sql/Manager.php
Manager.selectList
public function selectList($meta, ...$args) { if (!$args) { throw new \InvalidArgumentException(); } $fields = null; $query = null; if (!isset($args[1]) && $args[0] instanceof Query\Select) { $query = $args[0]; } elseif ((is_ar...
php
public function selectList($meta, ...$args) { if (!$args) { throw new \InvalidArgumentException(); } $fields = null; $query = null; if (!isset($args[1]) && $args[0] instanceof Query\Select) { $query = $args[0]; } elseif ((is_ar...
[ "public", "function", "selectList", "(", "$", "meta", ",", "...", "$", "args", ")", "{", "if", "(", "!", "$", "args", ")", "{", "throw", "new", "\\", "InvalidArgumentException", "(", ")", ";", "}", "$", "fields", "=", "null", ";", "$", "query", "="...
Dunno about this. Consider it unstable, don't count on it still being here in v6
[ "Dunno", "about", "this", ".", "Consider", "it", "unstable", "don", "t", "count", "on", "it", "still", "being", "here", "in", "v6" ]
ba261f0d1f985ed36e9fd2903ac0df86c5b9498d
https://github.com/shabbyrobe/amiss/blob/ba261f0d1f985ed36e9fd2903ac0df86c5b9498d/src/Sql/Manager.php#L217-L270
21,620
shabbyrobe/amiss
src/Sql/Manager.php
Manager.assignRelated
public function assignRelated($source, $relationNames=null, $meta=null) { if (!$source) { return; } $stack = []; $sourceIsArray = is_array($source) || $source instanceof \Traversable; if (!$sourceIsArray) { $source = array($source); } if ($meta !== null)...
php
public function assignRelated($source, $relationNames=null, $meta=null) { if (!$source) { return; } $stack = []; $sourceIsArray = is_array($source) || $source instanceof \Traversable; if (!$sourceIsArray) { $source = array($source); } if ($meta !== null)...
[ "public", "function", "assignRelated", "(", "$", "source", ",", "$", "relationNames", "=", "null", ",", "$", "meta", "=", "null", ")", "{", "if", "(", "!", "$", "source", ")", "{", "return", ";", "}", "$", "stack", "=", "[", "]", ";", "$", "sourc...
Retrieve related objects from the database and assign them to the source if the source field is not yet populated. @param object|array Source objects to assign relations for @param string|array The name of the relation(s) to assign @return void
[ "Retrieve", "related", "objects", "from", "the", "database", "and", "assign", "them", "to", "the", "source", "if", "the", "source", "field", "is", "not", "yet", "populated", "." ]
ba261f0d1f985ed36e9fd2903ac0df86c5b9498d
https://github.com/shabbyrobe/amiss/blob/ba261f0d1f985ed36e9fd2903ac0df86c5b9498d/src/Sql/Manager.php#L330-L393
21,621
shabbyrobe/amiss
src/Sql/Manager.php
Manager.getRelated
public function getRelated($source, $relationName, $query=null, $meta=null) { if (!$source) { return; } $sourceIsArray = false; $test = $source; if (is_array($test) || $test instanceof \Traversable) { $sourceIsArray = true; $test = $test[0]; } ...
php
public function getRelated($source, $relationName, $query=null, $meta=null) { if (!$source) { return; } $sourceIsArray = false; $test = $source; if (is_array($test) || $test instanceof \Traversable) { $sourceIsArray = true; $test = $test[0]; } ...
[ "public", "function", "getRelated", "(", "$", "source", ",", "$", "relationName", ",", "$", "query", "=", "null", ",", "$", "meta", "=", "null", ")", "{", "if", "(", "!", "$", "source", ")", "{", "return", ";", "}", "$", "sourceIsArray", "=", "fals...
Get related objects from the database Supports the following signatures: - getRelated( object|array $source , string $relationName ) - getRelated( object|array $source , string $relationName , $query ) - getRelated( object|array $source , string $relationName , Meta $meta ) - getRelated( object|array $source , string...
[ "Get", "related", "objects", "from", "the", "database" ]
ba261f0d1f985ed36e9fd2903ac0df86c5b9498d
https://github.com/shabbyrobe/amiss/blob/ba261f0d1f985ed36e9fd2903ac0df86c5b9498d/src/Sql/Manager.php#L478-L528
21,622
shabbyrobe/amiss
src/Sql/Manager.php
Manager.insertTable
public function insertTable($meta, $query) { $meta = $meta instanceof Meta ? $meta : $this->mapper->getMeta($meta); if (!$meta->canInsert) { throw new Exception("Class {$meta->class} prohibits insert"); } $query = $query instanceof Query\Insert ? $query : new Query\Inser...
php
public function insertTable($meta, $query) { $meta = $meta instanceof Meta ? $meta : $this->mapper->getMeta($meta); if (!$meta->canInsert) { throw new Exception("Class {$meta->class} prohibits insert"); } $query = $query instanceof Query\Insert ? $query : new Query\Inser...
[ "public", "function", "insertTable", "(", "$", "meta", ",", "$", "query", ")", "{", "$", "meta", "=", "$", "meta", "instanceof", "Meta", "?", "$", "meta", ":", "$", "this", "->", "mapper", "->", "getMeta", "(", "$", "meta", ")", ";", "if", "(", "...
Insert values into a table insertTable ( $meta , array $propertyValues ); insertTable ( $meta , Query\Insert $query ); - $meta can be an instance of Amiss\Meta or a class name. - $propertyValues keys must exist in the corresponding Meta. @return int|null
[ "Insert", "values", "into", "a", "table" ]
ba261f0d1f985ed36e9fd2903ac0df86c5b9498d
https://github.com/shabbyrobe/amiss/blob/ba261f0d1f985ed36e9fd2903ac0df86c5b9498d/src/Sql/Manager.php#L541-L561
21,623
shabbyrobe/amiss
src/Sql/Manager.php
Manager.insert
public function insert($object, $meta=null) { $query = new Query\Insert; if (is_array($meta)) { throw new \BadMethodCallException("Please use insertTable()"); } if ($meta) { $meta = !$meta instanceof Meta ? $this->mapper->getMeta($meta) : $meta; } el...
php
public function insert($object, $meta=null) { $query = new Query\Insert; if (is_array($meta)) { throw new \BadMethodCallException("Please use insertTable()"); } if ($meta) { $meta = !$meta instanceof Meta ? $this->mapper->getMeta($meta) : $meta; } el...
[ "public", "function", "insert", "(", "$", "object", ",", "$", "meta", "=", "null", ")", "{", "$", "query", "=", "new", "Query", "\\", "Insert", ";", "if", "(", "is_array", "(", "$", "meta", ")", ")", "{", "throw", "new", "\\", "BadMethodCallException...
Insert an object into the database, or values into a table insert($object) insert($object, Meta $meta) @return int|null
[ "Insert", "an", "object", "into", "the", "database", "or", "values", "into", "a", "table" ]
ba261f0d1f985ed36e9fd2903ac0df86c5b9498d
https://github.com/shabbyrobe/amiss/blob/ba261f0d1f985ed36e9fd2903ac0df86c5b9498d/src/Sql/Manager.php#L571-L634
21,624
shabbyrobe/amiss
src/Sql/Manager.php
Manager.updateTable
public function updateTable($meta, ...$args) { $meta = !$meta instanceof Meta ? $this->mapper->getMeta($meta) : $meta; if (!$meta->canUpdate) { throw new Exception("Meta {$meta->id} prohibits update"); } $query = Query\Update::fromParamArgs($args); if (!$query->s...
php
public function updateTable($meta, ...$args) { $meta = !$meta instanceof Meta ? $this->mapper->getMeta($meta) : $meta; if (!$meta->canUpdate) { throw new Exception("Meta {$meta->id} prohibits update"); } $query = Query\Update::fromParamArgs($args); if (!$query->s...
[ "public", "function", "updateTable", "(", "$", "meta", ",", "...", "$", "args", ")", "{", "$", "meta", "=", "!", "$", "meta", "instanceof", "Meta", "?", "$", "this", "->", "mapper", "->", "getMeta", "(", "$", "meta", ")", ":", "$", "meta", ";", "...
Update a table by criteria. updateTable ( $meta , array $values , $criteria... ) updateTable ( $meta , Query\Update $query , $criteria... ) @return void
[ "Update", "a", "table", "by", "criteria", "." ]
ba261f0d1f985ed36e9fd2903ac0df86c5b9498d
https://github.com/shabbyrobe/amiss/blob/ba261f0d1f985ed36e9fd2903ac0df86c5b9498d/src/Sql/Manager.php#L644-L665
21,625
shabbyrobe/amiss
src/Sql/Manager.php
Manager.update
public function update($object, $meta=null) { $query = new Query\Update(); if (!is_object($object)) { throw new \BadMethodCallException("Please use updateTable()"); } if ($meta) { $meta = !$meta instanceof Meta ? $this->mapper->getMeta($meta) : $meta; ...
php
public function update($object, $meta=null) { $query = new Query\Update(); if (!is_object($object)) { throw new \BadMethodCallException("Please use updateTable()"); } if ($meta) { $meta = !$meta instanceof Meta ? $this->mapper->getMeta($meta) : $meta; ...
[ "public", "function", "update", "(", "$", "object", ",", "$", "meta", "=", "null", ")", "{", "$", "query", "=", "new", "Query", "\\", "Update", "(", ")", ";", "if", "(", "!", "is_object", "(", "$", "object", ")", ")", "{", "throw", "new", "\\", ...
Update an object in the database, or update a table by criteria. update ( $object ) update ( $object , $meta ) @return void
[ "Update", "an", "object", "in", "the", "database", "or", "update", "a", "table", "by", "criteria", "." ]
ba261f0d1f985ed36e9fd2903ac0df86c5b9498d
https://github.com/shabbyrobe/amiss/blob/ba261f0d1f985ed36e9fd2903ac0df86c5b9498d/src/Sql/Manager.php#L675-L724
21,626
shabbyrobe/amiss
src/Sql/Manager.php
Manager.deleteTable
public function deleteTable($meta, ...$args) { if (!isset($args[0])) { throw new \InvalidArgumentException("Cannot delete from table without a condition (pass the string '1=1' if you really meant to do this)"); } $meta = !$meta instanceof Meta ? $this->mapper->getMeta($meta) : $m...
php
public function deleteTable($meta, ...$args) { if (!isset($args[0])) { throw new \InvalidArgumentException("Cannot delete from table without a condition (pass the string '1=1' if you really meant to do this)"); } $meta = !$meta instanceof Meta ? $this->mapper->getMeta($meta) : $m...
[ "public", "function", "deleteTable", "(", "$", "meta", ",", "...", "$", "args", ")", "{", "if", "(", "!", "isset", "(", "$", "args", "[", "0", "]", ")", ")", "{", "throw", "new", "\\", "InvalidArgumentException", "(", "\"Cannot delete from table without a ...
Delete from a table by criteria deleteTable ( $meta , $criteria... ); @return void
[ "Delete", "from", "a", "table", "by", "criteria" ]
ba261f0d1f985ed36e9fd2903ac0df86c5b9498d
https://github.com/shabbyrobe/amiss/blob/ba261f0d1f985ed36e9fd2903ac0df86c5b9498d/src/Sql/Manager.php#L733-L744
21,627
shabbyrobe/amiss
src/Sql/Manager.php
Manager.delete
public function delete($object, $meta=null) { $query = new Query\Criteria(); if (!is_object($object)) { throw new \BadMethodCallException("Please use deleteTable()"); } if ($meta) { $meta = !$meta instanceof Meta ? $this->mapper->getMeta($meta) : $meta; ...
php
public function delete($object, $meta=null) { $query = new Query\Criteria(); if (!is_object($object)) { throw new \BadMethodCallException("Please use deleteTable()"); } if ($meta) { $meta = !$meta instanceof Meta ? $this->mapper->getMeta($meta) : $meta; ...
[ "public", "function", "delete", "(", "$", "object", ",", "$", "meta", "=", "null", ")", "{", "$", "query", "=", "new", "Query", "\\", "Criteria", "(", ")", ";", "if", "(", "!", "is_object", "(", "$", "object", ")", ")", "{", "throw", "new", "\\",...
Delete an object from the database delete ( $object ) delete ( $object, $meta ) @return void
[ "Delete", "an", "object", "from", "the", "database" ]
ba261f0d1f985ed36e9fd2903ac0df86c5b9498d
https://github.com/shabbyrobe/amiss/blob/ba261f0d1f985ed36e9fd2903ac0df86c5b9498d/src/Sql/Manager.php#L754-L794
21,628
shabbyrobe/amiss
src/Sql/Manager.php
Manager.save
public function save($object, $meta=null) { if ($meta) { $meta = !$meta instanceof Meta ? $this->mapper->getMeta($meta) : $meta; } else { $meta = $this->mapper->getMeta(get_class($object)); } if (!$meta->primary) { throw new Exception("No primary ...
php
public function save($object, $meta=null) { if ($meta) { $meta = !$meta instanceof Meta ? $this->mapper->getMeta($meta) : $meta; } else { $meta = $this->mapper->getMeta(get_class($object)); } if (!$meta->primary) { throw new Exception("No primary ...
[ "public", "function", "save", "(", "$", "object", ",", "$", "meta", "=", "null", ")", "{", "if", "(", "$", "meta", ")", "{", "$", "meta", "=", "!", "$", "meta", "instanceof", "Meta", "?", "$", "this", "->", "mapper", "->", "getMeta", "(", "$", ...
If an object has an autoincrement primary key, insert or update as necessary. @return void
[ "If", "an", "object", "has", "an", "autoincrement", "primary", "key", "insert", "or", "update", "as", "necessary", "." ]
ba261f0d1f985ed36e9fd2903ac0df86c5b9498d
https://github.com/shabbyrobe/amiss/blob/ba261f0d1f985ed36e9fd2903ac0df86c5b9498d/src/Sql/Manager.php#L809-L858
21,629
shabbyrobe/amiss
src/Sql/Manager.php
Manager.createKeyCriteria
public function createKeyCriteria($meta, $id, $indexId=null) { if ($indexId == null) { $indexId = 'primary'; } $meta = !$meta instanceof Meta ? $this->mapper->getMeta($meta) : $meta; if (!isset($meta->indexes[$indexId])) { throw new Exception("Index $indexId d...
php
public function createKeyCriteria($meta, $id, $indexId=null) { if ($indexId == null) { $indexId = 'primary'; } $meta = !$meta instanceof Meta ? $this->mapper->getMeta($meta) : $meta; if (!isset($meta->indexes[$indexId])) { throw new Exception("Index $indexId d...
[ "public", "function", "createKeyCriteria", "(", "$", "meta", ",", "$", "id", ",", "$", "indexId", "=", "null", ")", "{", "if", "(", "$", "indexId", "==", "null", ")", "{", "$", "indexId", "=", "'primary'", ";", "}", "$", "meta", "=", "!", "$", "m...
Creates an array criteria for a key index @param mixed $meta Meta or class name @return array Criteria
[ "Creates", "an", "array", "criteria", "for", "a", "key", "index" ]
ba261f0d1f985ed36e9fd2903ac0df86c5b9498d
https://github.com/shabbyrobe/amiss/blob/ba261f0d1f985ed36e9fd2903ac0df86c5b9498d/src/Sql/Manager.php#L865-L892
21,630
getuisdk/getui-php-sdk
src/PBInputStringReader.php
PBInputStringReader.next
public function next($is_string = false) { $package = ''; while (true) { if ($this->pointer >= $this->length) { return false; } $string = $this->string[$this->pointer]; $this->pointer++; if ($is_string === true)...
php
public function next($is_string = false) { $package = ''; while (true) { if ($this->pointer >= $this->length) { return false; } $string = $this->string[$this->pointer]; $this->pointer++; if ($is_string === true)...
[ "public", "function", "next", "(", "$", "is_string", "=", "false", ")", "{", "$", "package", "=", "''", ";", "while", "(", "true", ")", "{", "if", "(", "$", "this", "->", "pointer", ">=", "$", "this", "->", "length", ")", "{", "return", "false", ...
get the next @param boolean $is_string - if set to true only one byte is read @return mixed
[ "get", "the", "next" ]
e91773b099bcbfd7492a44086b373d1c9fee37e2
https://github.com/getuisdk/getui-php-sdk/blob/e91773b099bcbfd7492a44086b373d1c9fee37e2/src/PBInputStringReader.php#L30-L57
21,631
sinri/Ark-Core
src/ArkHelper.php
ArkHelper.registerAutoload
public static function registerAutoload($base_namespace, $base_path, $extension = '.php') { spl_autoload_register(function ($class_name) use ($base_namespace, $base_path, $extension) { $file_path = self::getFilePathForClassName( $class_name, $base_namespace, ...
php
public static function registerAutoload($base_namespace, $base_path, $extension = '.php') { spl_autoload_register(function ($class_name) use ($base_namespace, $base_path, $extension) { $file_path = self::getFilePathForClassName( $class_name, $base_namespace, ...
[ "public", "static", "function", "registerAutoload", "(", "$", "base_namespace", ",", "$", "base_path", ",", "$", "extension", "=", "'.php'", ")", "{", "spl_autoload_register", "(", "function", "(", "$", "class_name", ")", "use", "(", "$", "base_namespace", ","...
For Autoload File @param string $base_namespace such as sinri\enoch @param string $base_path /code/sinri/enoch @param string $extension
[ "For", "Autoload", "File" ]
fb5715e72b500ddc08dd52d9701d713fe49f48c6
https://github.com/sinri/Ark-Core/blob/fb5715e72b500ddc08dd52d9701d713fe49f48c6/src/ArkHelper.php#L39-L53
21,632
sinri/Ark-Core
src/ArkHelper.php
ArkHelper.removeFromArray
public static function removeFromArray(&$array, $keychain) { if (!is_array($array)) { $array = []; } if (!is_array($keychain)) { $keychain = [$keychain]; } $headKey = array_shift($keychain); if (empty($keychain)) { //last ...
php
public static function removeFromArray(&$array, $keychain) { if (!is_array($array)) { $array = []; } if (!is_array($keychain)) { $keychain = [$keychain]; } $headKey = array_shift($keychain); if (empty($keychain)) { //last ...
[ "public", "static", "function", "removeFromArray", "(", "&", "$", "array", ",", "$", "keychain", ")", "{", "if", "(", "!", "is_array", "(", "$", "array", ")", ")", "{", "$", "array", "=", "[", "]", ";", "}", "if", "(", "!", "is_array", "(", "$", ...
Unset item and nested item in array @since 1.2 @param array $array @param array|string|int $keychain
[ "Unset", "item", "and", "nested", "item", "in", "array" ]
fb5715e72b500ddc08dd52d9701d713fe49f48c6
https://github.com/sinri/Ark-Core/blob/fb5715e72b500ddc08dd52d9701d713fe49f48c6/src/ArkHelper.php#L154-L173
21,633
frdl/webfan
.ApplicationComposer/lib/frdl/ApplicationComposer/ApplicationComposerBootstrap.php
ApplicationComposerBootstrap.wd
public function wd($dir = null, $code = E_USER_WARNING){ if(null !== $dir && is_dir($dir)){ $this->wd = $dir; if(chdir($dir) === false){ throw new \Exception('Cannot change to directory '.$dir.' in '.__METHOD__, $code); return $this; } }else{ $dir = $this->wd; } return $this; }
php
public function wd($dir = null, $code = E_USER_WARNING){ if(null !== $dir && is_dir($dir)){ $this->wd = $dir; if(chdir($dir) === false){ throw new \Exception('Cannot change to directory '.$dir.' in '.__METHOD__, $code); return $this; } }else{ $dir = $this->wd; } return $this; }
[ "public", "function", "wd", "(", "$", "dir", "=", "null", ",", "$", "code", "=", "E_USER_WARNING", ")", "{", "if", "(", "null", "!==", "$", "dir", "&&", "is_dir", "(", "$", "dir", ")", ")", "{", "$", "this", "->", "wd", "=", "$", "dir", ";", ...
set working directory
[ "set", "working", "directory" ]
84d270377685224e891cd9d571b103b36f05b845
https://github.com/frdl/webfan/blob/84d270377685224e891cd9d571b103b36f05b845/.ApplicationComposer/lib/frdl/ApplicationComposer/ApplicationComposerBootstrap.php#L67-L78
21,634
unclecheese/silverstripe-bootstrap-tagfield
code/BootstrapTagField.php
BootstrapTagField.formatJSON
protected function formatJSON(SS_List $list) { $ret = array (); foreach($list as $item) { $ret[] = array( 'id' => $item->{$this->idField}, 'label' => $item->{$this->labelField} ); } return Convert::array2json($ret); }
php
protected function formatJSON(SS_List $list) { $ret = array (); foreach($list as $item) { $ret[] = array( 'id' => $item->{$this->idField}, 'label' => $item->{$this->labelField} ); } return Convert::array2json($ret); }
[ "protected", "function", "formatJSON", "(", "SS_List", "$", "list", ")", "{", "$", "ret", "=", "array", "(", ")", ";", "foreach", "(", "$", "list", "as", "$", "item", ")", "{", "$", "ret", "[", "]", "=", "array", "(", "'id'", "=>", "$", "item", ...
Formats JSON so that it is usable by the JS component @param SS_List $list The list to format @return string JSON
[ "Formats", "JSON", "so", "that", "it", "is", "usable", "by", "the", "JS", "component" ]
ada0c647f90ccb753d26a5d01889b2b4fbe2af76
https://github.com/unclecheese/silverstripe-bootstrap-tagfield/blob/ada0c647f90ccb753d26a5d01889b2b4fbe2af76/code/BootstrapTagField.php#L80-L90
21,635
unclecheese/silverstripe-bootstrap-tagfield
code/BootstrapTagField.php
BootstrapTagField.query
public function query(SS_HTTPRequest $r) { return $this->formatJSON($this->source->filter(array( $this->labelField.':PartialMatch' => $r->getVar('q') )) ->limit(10)); }
php
public function query(SS_HTTPRequest $r) { return $this->formatJSON($this->source->filter(array( $this->labelField.':PartialMatch' => $r->getVar('q') )) ->limit(10)); }
[ "public", "function", "query", "(", "SS_HTTPRequest", "$", "r", ")", "{", "return", "$", "this", "->", "formatJSON", "(", "$", "this", "->", "source", "->", "filter", "(", "array", "(", "$", "this", "->", "labelField", ".", "':PartialMatch'", "=>", "$", ...
An AJAX endpoint for querying the typeahead @param SS_HTTPRequest $r The request @return string JSON
[ "An", "AJAX", "endpoint", "for", "querying", "the", "typeahead" ]
ada0c647f90ccb753d26a5d01889b2b4fbe2af76
https://github.com/unclecheese/silverstripe-bootstrap-tagfield/blob/ada0c647f90ccb753d26a5d01889b2b4fbe2af76/code/BootstrapTagField.php#L98-L103
21,636
unclecheese/silverstripe-bootstrap-tagfield
code/BootstrapTagField.php
BootstrapTagField.getValuesJSON
protected function getValuesJSON() { $value = $this->value; if($value instanceof SS_List) { $values = $value->column($this->idField); } else if(is_array($value)) { $values = array_keys($value); } else if(is_string($value)) { $values = explode(',', $value); $values = str_replace('{comma}', ',', $...
php
protected function getValuesJSON() { $value = $this->value; if($value instanceof SS_List) { $values = $value->column($this->idField); } else if(is_array($value)) { $values = array_keys($value); } else if(is_string($value)) { $values = explode(',', $value); $values = str_replace('{comma}', ',', $...
[ "protected", "function", "getValuesJSON", "(", ")", "{", "$", "value", "=", "$", "this", "->", "value", ";", "if", "(", "$", "value", "instanceof", "SS_List", ")", "{", "$", "values", "=", "$", "value", "->", "column", "(", "$", "this", "->", "idFiel...
Gets the current values assigned to the field, formatted as a JSON array @return string JSON
[ "Gets", "the", "current", "values", "assigned", "to", "the", "field", "formatted", "as", "a", "JSON", "array" ]
ada0c647f90ccb753d26a5d01889b2b4fbe2af76
https://github.com/unclecheese/silverstripe-bootstrap-tagfield/blob/ada0c647f90ccb753d26a5d01889b2b4fbe2af76/code/BootstrapTagField.php#L122-L138
21,637
unclecheese/silverstripe-bootstrap-tagfield
code/BootstrapTagField.php
BootstrapTagField.setPrefetch
public function setPrefetch(SS_List $list) { if(!$list instanceof SS_List) { throw new Exception('Prefetch list must be an instance of SS_List'); } $this->prefetch = $list; return $this; }
php
public function setPrefetch(SS_List $list) { if(!$list instanceof SS_List) { throw new Exception('Prefetch list must be an instance of SS_List'); } $this->prefetch = $list; return $this; }
[ "public", "function", "setPrefetch", "(", "SS_List", "$", "list", ")", "{", "if", "(", "!", "$", "list", "instanceof", "SS_List", ")", "{", "throw", "new", "Exception", "(", "'Prefetch list must be an instance of SS_List'", ")", ";", "}", "$", "this", "->", ...
Sets the prefetch records list @param SS_List $list @return BootstrapTagField
[ "Sets", "the", "prefetch", "records", "list" ]
ada0c647f90ccb753d26a5d01889b2b4fbe2af76
https://github.com/unclecheese/silverstripe-bootstrap-tagfield/blob/ada0c647f90ccb753d26a5d01889b2b4fbe2af76/code/BootstrapTagField.php#L146-L154
21,638
unclecheese/silverstripe-bootstrap-tagfield
code/BootstrapTagField.php
BootstrapTagField.Field
public function Field($properties = array()) { Requirements::javascript(BOOTSTRAP_TAGFIELD_DIR.'/javascript/typeahead.js'); Requirements::javascript(BOOTSTRAP_TAGFIELD_DIR.'/javascript/bootstrap-tagfield.js'); Requirements::javascript(BOOTSTRAP_TAGFIELD_DIR.'/javascript/bootstrap-tagfield-init.js'); Requirement...
php
public function Field($properties = array()) { Requirements::javascript(BOOTSTRAP_TAGFIELD_DIR.'/javascript/typeahead.js'); Requirements::javascript(BOOTSTRAP_TAGFIELD_DIR.'/javascript/bootstrap-tagfield.js'); Requirements::javascript(BOOTSTRAP_TAGFIELD_DIR.'/javascript/bootstrap-tagfield-init.js'); Requirement...
[ "public", "function", "Field", "(", "$", "properties", "=", "array", "(", ")", ")", "{", "Requirements", "::", "javascript", "(", "BOOTSTRAP_TAGFIELD_DIR", ".", "'/javascript/typeahead.js'", ")", ";", "Requirements", "::", "javascript", "(", "BOOTSTRAP_TAGFIELD_DIR"...
Renders the field @param array $properties @return SSViewer
[ "Renders", "the", "field" ]
ada0c647f90ccb753d26a5d01889b2b4fbe2af76
https://github.com/unclecheese/silverstripe-bootstrap-tagfield/blob/ada0c647f90ccb753d26a5d01889b2b4fbe2af76/code/BootstrapTagField.php#L252-L268
21,639
zicht/z
src/Zicht/Tool/Script/Compiler.php
Compiler.parse
public function parse($input) { if (strlen($input) == 0) { return null; } return $this->parser->parse(new TokenStream($this->tokenizer->getTokens($input))); }
php
public function parse($input) { if (strlen($input) == 0) { return null; } return $this->parser->parse(new TokenStream($this->tokenizer->getTokens($input))); }
[ "public", "function", "parse", "(", "$", "input", ")", "{", "if", "(", "strlen", "(", "$", "input", ")", "==", "0", ")", "{", "return", "null", ";", "}", "return", "$", "this", "->", "parser", "->", "parse", "(", "new", "TokenStream", "(", "$", "...
Parses the raw string input and returns the resulting root node. @param string $input @return Node
[ "Parses", "the", "raw", "string", "input", "and", "returns", "the", "resulting", "root", "node", "." ]
6a1731dad20b018555a96b726a61d4bf8ec8c886
https://github.com/zicht/z/blob/6a1731dad20b018555a96b726a61d4bf8ec8c886/src/Zicht/Tool/Script/Compiler.php#L36-L42
21,640
zicht/z
src/Zicht/Tool/Script/Compiler.php
Compiler.compile
public function compile($input) { if (strlen($input) == 0) { return null; } try { $buffer = new Buffer(); $this->parse($input)->compile($buffer); $code = $buffer->getResult(); return $code; } catch (\UnexpectedValueException...
php
public function compile($input) { if (strlen($input) == 0) { return null; } try { $buffer = new Buffer(); $this->parse($input)->compile($buffer); $code = $buffer->getResult(); return $code; } catch (\UnexpectedValueException...
[ "public", "function", "compile", "(", "$", "input", ")", "{", "if", "(", "strlen", "(", "$", "input", ")", "==", "0", ")", "{", "return", "null", ";", "}", "try", "{", "$", "buffer", "=", "new", "Buffer", "(", ")", ";", "$", "this", "->", "pars...
Compile an input string to PHP code @param string $input @return string
[ "Compile", "an", "input", "string", "to", "PHP", "code" ]
6a1731dad20b018555a96b726a61d4bf8ec8c886
https://github.com/zicht/z/blob/6a1731dad20b018555a96b726a61d4bf8ec8c886/src/Zicht/Tool/Script/Compiler.php#L50-L63
21,641
icicleio/cache
src/MemoryCache.php
MemoryCache.unlock
protected function unlock(string $key) { if (!isset($this->locks[$key])) { throw new InvalidArgumentError('No lock was set on the given key.'); } $awaitable = $this->locks[$key]; unset($this->locks[$key]); $awaitable->resolve(); }
php
protected function unlock(string $key) { if (!isset($this->locks[$key])) { throw new InvalidArgumentError('No lock was set on the given key.'); } $awaitable = $this->locks[$key]; unset($this->locks[$key]); $awaitable->resolve(); }
[ "protected", "function", "unlock", "(", "string", "$", "key", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "locks", "[", "$", "key", "]", ")", ")", "{", "throw", "new", "InvalidArgumentError", "(", "'No lock was set on the given key.'", ")", ...
Unlocks the given key. Throws if the key was not locked. @param string $key @throws \Icicle\Exception\InvalidArgumentError
[ "Unlocks", "the", "given", "key", ".", "Throws", "if", "the", "key", "was", "not", "locked", "." ]
d4edeed7c36dc261f051f880d389db80bb3672cf
https://github.com/icicleio/cache/blob/d4edeed7c36dc261f051f880d389db80bb3672cf/src/MemoryCache.php#L216-L225
21,642
JBZoo/Profiler
src/Benchmark.php
Benchmark._warmup
private function _warmup() { $warmup = new Test('warmup', function () { }); $this->_overhead = $warmup->runTest($this->_count); // One call each method for init (warmup) /** @var Test $test */ foreach ($this->_tests as $test) { $test->runTest(1); ...
php
private function _warmup() { $warmup = new Test('warmup', function () { }); $this->_overhead = $warmup->runTest($this->_count); // One call each method for init (warmup) /** @var Test $test */ foreach ($this->_tests as $test) { $test->runTest(1); ...
[ "private", "function", "_warmup", "(", ")", "{", "$", "warmup", "=", "new", "Test", "(", "'warmup'", ",", "function", "(", ")", "{", "}", ")", ";", "$", "this", "->", "_overhead", "=", "$", "warmup", "->", "runTest", "(", "$", "this", "->", "_count...
Runs an empty test to determine the benchmark overhead and run each test once
[ "Runs", "an", "empty", "test", "to", "determine", "the", "benchmark", "overhead", "and", "run", "each", "test", "once" ]
a4af3d2feb558ab9cd78012e0ca5c8dc7872fc69
https://github.com/JBZoo/Profiler/blob/a4af3d2feb558ab9cd78012e0ca5c8dc7872fc69/src/Benchmark.php#L77-L97
21,643
JBZoo/Profiler
src/Benchmark.php
Benchmark.outputTable
public function outputTable(array $lines, $padding = 4) { $pad = function ($string, $width) use ($padding) { if ($width > 0) { return str_pad($string, $width, ' ') . str_repeat(' ', $padding); } else { return str_pad($string, -$width, ' ', STR_PAD_LEFT...
php
public function outputTable(array $lines, $padding = 4) { $pad = function ($string, $width) use ($padding) { if ($width > 0) { return str_pad($string, $width, ' ') . str_repeat(' ', $padding); } else { return str_pad($string, -$width, ' ', STR_PAD_LEFT...
[ "public", "function", "outputTable", "(", "array", "$", "lines", ",", "$", "padding", "=", "4", ")", "{", "$", "pad", "=", "function", "(", "$", "string", ",", "$", "width", ")", "use", "(", "$", "padding", ")", "{", "if", "(", "$", "width", ">",...
Output results in columns, padding right if values are string, left if numeric @param array $lines array(array('Name' => 'Value')); @param integer $padding space between columns
[ "Output", "results", "in", "columns", "padding", "right", "if", "values", "are", "string", "left", "if", "numeric" ]
a4af3d2feb558ab9cd78012e0ca5c8dc7872fc69
https://github.com/JBZoo/Profiler/blob/a4af3d2feb558ab9cd78012e0ca5c8dc7872fc69/src/Benchmark.php#L156-L194
21,644
JBZoo/Profiler
src/Benchmark.php
Benchmark.formatResults
public function formatResults(array $results) { uasort($results['list'], function ($testOne, $testTwo) { if ($testOne['time'] === $testTwo['time']) { return 0; } else { return ($testOne['time'] < $testTwo['time']) ? -1 : 1; } }); ...
php
public function formatResults(array $results) { uasort($results['list'], function ($testOne, $testTwo) { if ($testOne['time'] === $testTwo['time']) { return 0; } else { return ($testOne['time'] < $testTwo['time']) ? -1 : 1; } }); ...
[ "public", "function", "formatResults", "(", "array", "$", "results", ")", "{", "uasort", "(", "$", "results", "[", "'list'", "]", ",", "function", "(", "$", "testOne", ",", "$", "testTwo", ")", "{", "if", "(", "$", "testOne", "[", "'time'", "]", "===...
Format the results, rounding numbers, showing difference percentages and removing a flat time based on the benchmark overhead @param array $results array($name => array('time' => 1.0)) @return array array(array('Test' => $name, 'Time' => '1000 ms', 'Perc' => '100 %'))
[ "Format", "the", "results", "rounding", "numbers", "showing", "difference", "percentages", "and", "removing", "a", "flat", "time", "based", "on", "the", "benchmark", "overhead" ]
a4af3d2feb558ab9cd78012e0ca5c8dc7872fc69
https://github.com/JBZoo/Profiler/blob/a4af3d2feb558ab9cd78012e0ca5c8dc7872fc69/src/Benchmark.php#L203-L256
21,645
zhouyl/mellivora
Mellivora/Database/Eloquent/Relations/BelongsToMany.php
BelongsToMany.shouldSelect
protected function shouldSelect(array $columns = ['*']) { if ($columns === ['*']) { $columns = [$this->related->getTable() . '.*']; } return array_merge($columns, $this->aliasedPivotColumns()); }
php
protected function shouldSelect(array $columns = ['*']) { if ($columns === ['*']) { $columns = [$this->related->getTable() . '.*']; } return array_merge($columns, $this->aliasedPivotColumns()); }
[ "protected", "function", "shouldSelect", "(", "array", "$", "columns", "=", "[", "'*'", "]", ")", "{", "if", "(", "$", "columns", "===", "[", "'*'", "]", ")", "{", "$", "columns", "=", "[", "$", "this", "->", "related", "->", "getTable", "(", ")", ...
Get the select columns for the relation query. @param array $columns @return \Mellivora\Database\Eloquent\Relations\BelongsToMany
[ "Get", "the", "select", "columns", "for", "the", "relation", "query", "." ]
79f844c5c9c25ffbe18d142062e9bc3df00b36a1
https://github.com/zhouyl/mellivora/blob/79f844c5c9c25ffbe18d142062e9bc3df00b36a1/Mellivora/Database/Eloquent/Relations/BelongsToMany.php#L534-L541
21,646
stk2k/net-driver
src/Http/HttpProxyGetRequest.php
HttpProxyGetRequest.getProxyServer
public function getProxyServer() { $proxy_options = $this->getOption(EnumRequestOption::PROXY_OPTIONS, []); return isset($proxy_options[EnumProxyOption::PROXY_SERVER]) ? $proxy_options[EnumProxyOption::PROXY_SERVER] : ''; }
php
public function getProxyServer() { $proxy_options = $this->getOption(EnumRequestOption::PROXY_OPTIONS, []); return isset($proxy_options[EnumProxyOption::PROXY_SERVER]) ? $proxy_options[EnumProxyOption::PROXY_SERVER] : ''; }
[ "public", "function", "getProxyServer", "(", ")", "{", "$", "proxy_options", "=", "$", "this", "->", "getOption", "(", "EnumRequestOption", "::", "PROXY_OPTIONS", ",", "[", "]", ")", ";", "return", "isset", "(", "$", "proxy_options", "[", "EnumProxyOption", ...
Returns proxy server @return string
[ "Returns", "proxy", "server" ]
75e0bc1a95ba430dd9ed9e69f6a0a5dd8f2e7b1c
https://github.com/stk2k/net-driver/blob/75e0bc1a95ba430dd9ed9e69f6a0a5dd8f2e7b1c/src/Http/HttpProxyGetRequest.php#L28-L32
21,647
stk2k/net-driver
src/Http/HttpProxyGetRequest.php
HttpProxyGetRequest.getProxyPort
public function getProxyPort() { $proxy_options = $this->getOption(EnumRequestOption::PROXY_OPTIONS, []); return isset($proxy_options[EnumProxyOption::PROXY_PORT]) ? $proxy_options[EnumProxyOption::PROXY_PORT] : ''; }
php
public function getProxyPort() { $proxy_options = $this->getOption(EnumRequestOption::PROXY_OPTIONS, []); return isset($proxy_options[EnumProxyOption::PROXY_PORT]) ? $proxy_options[EnumProxyOption::PROXY_PORT] : ''; }
[ "public", "function", "getProxyPort", "(", ")", "{", "$", "proxy_options", "=", "$", "this", "->", "getOption", "(", "EnumRequestOption", "::", "PROXY_OPTIONS", ",", "[", "]", ")", ";", "return", "isset", "(", "$", "proxy_options", "[", "EnumProxyOption", ":...
Returns proxy port @return mixed
[ "Returns", "proxy", "port" ]
75e0bc1a95ba430dd9ed9e69f6a0a5dd8f2e7b1c
https://github.com/stk2k/net-driver/blob/75e0bc1a95ba430dd9ed9e69f6a0a5dd8f2e7b1c/src/Http/HttpProxyGetRequest.php#L39-L43
21,648
stk2k/net-driver
src/Http/HttpProxyGetRequest.php
HttpProxyGetRequest.getProxyType
public function getProxyType() { $proxy_options = $this->getOption(EnumRequestOption::PROXY_OPTIONS, []); return isset($proxy_options[EnumProxyOption::PROXY_TYPE]) ? $proxy_options[EnumProxyOption::PROXY_TYPE] : 'http'; }
php
public function getProxyType() { $proxy_options = $this->getOption(EnumRequestOption::PROXY_OPTIONS, []); return isset($proxy_options[EnumProxyOption::PROXY_TYPE]) ? $proxy_options[EnumProxyOption::PROXY_TYPE] : 'http'; }
[ "public", "function", "getProxyType", "(", ")", "{", "$", "proxy_options", "=", "$", "this", "->", "getOption", "(", "EnumRequestOption", "::", "PROXY_OPTIONS", ",", "[", "]", ")", ";", "return", "isset", "(", "$", "proxy_options", "[", "EnumProxyOption", ":...
Returns proxy type available values: 'http' for HTTP proxy 'https' for HTTPS proxy @return string
[ "Returns", "proxy", "type" ]
75e0bc1a95ba430dd9ed9e69f6a0a5dd8f2e7b1c
https://github.com/stk2k/net-driver/blob/75e0bc1a95ba430dd9ed9e69f6a0a5dd8f2e7b1c/src/Http/HttpProxyGetRequest.php#L55-L59
21,649
stk2k/net-driver
src/Http/HttpProxyGetRequest.php
HttpProxyGetRequest.getProxyAuth
public function getProxyAuth() { $proxy_options = $this->getOption(EnumRequestOption::PROXY_OPTIONS, []); return isset($proxy_options[EnumProxyOption::PROXY_AUTH]) ? $proxy_options[EnumProxyOption::PROXY_AUTH] : null; }
php
public function getProxyAuth() { $proxy_options = $this->getOption(EnumRequestOption::PROXY_OPTIONS, []); return isset($proxy_options[EnumProxyOption::PROXY_AUTH]) ? $proxy_options[EnumProxyOption::PROXY_AUTH] : null; }
[ "public", "function", "getProxyAuth", "(", ")", "{", "$", "proxy_options", "=", "$", "this", "->", "getOption", "(", "EnumRequestOption", "::", "PROXY_OPTIONS", ",", "[", "]", ")", ";", "return", "isset", "(", "$", "proxy_options", "[", "EnumProxyOption", ":...
Returns proxy auth available values: 'basic' for BASIC auth null or empty('') for no auth @return string
[ "Returns", "proxy", "auth" ]
75e0bc1a95ba430dd9ed9e69f6a0a5dd8f2e7b1c
https://github.com/stk2k/net-driver/blob/75e0bc1a95ba430dd9ed9e69f6a0a5dd8f2e7b1c/src/Http/HttpProxyGetRequest.php#L71-L75
21,650
hametuha/wpametu
src/WPametu/UI/Field/Textarea.php
TextArea.build_input
protected function build_input($data, array $fields = []){ $fields = implode(' ', $fields); return sprintf('<textarea id="%1$s" name="%1$s" %2$s>%3$s</textarea>%4$s', $this->name, $fields, esc_textarea($data), $this->length_helper($data)); }
php
protected function build_input($data, array $fields = []){ $fields = implode(' ', $fields); return sprintf('<textarea id="%1$s" name="%1$s" %2$s>%3$s</textarea>%4$s', $this->name, $fields, esc_textarea($data), $this->length_helper($data)); }
[ "protected", "function", "build_input", "(", "$", "data", ",", "array", "$", "fields", "=", "[", "]", ")", "{", "$", "fields", "=", "implode", "(", "' '", ",", "$", "fields", ")", ";", "return", "sprintf", "(", "'<textarea id=\"%1$s\" name=\"%1$s\" %2$s>%3$s...
Make input field @param mixed $data @param array $fields @return string
[ "Make", "input", "field" ]
0939373800815a8396291143d2a57967340da5aa
https://github.com/hametuha/wpametu/blob/0939373800815a8396291143d2a57967340da5aa/src/WPametu/UI/Field/Textarea.php#L36-L40
21,651
infusephp/infuse
src/RouteResolver.php
RouteResolver.resolve
public function resolve($route, $req, $res, array $args) { $result = false; if (is_array($route) || is_string($route)) { // method name and controller supplied if (is_string($route) && $req->params('controller')) { $route = [$req->params('controller'), $route]...
php
public function resolve($route, $req, $res, array $args) { $result = false; if (is_array($route) || is_string($route)) { // method name and controller supplied if (is_string($route) && $req->params('controller')) { $route = [$req->params('controller'), $route]...
[ "public", "function", "resolve", "(", "$", "route", ",", "$", "req", ",", "$", "res", ",", "array", "$", "args", ")", "{", "$", "result", "=", "false", ";", "if", "(", "is_array", "(", "$", "route", ")", "||", "is_string", "(", "$", "route", ")",...
Executes a route handler. @param array|string $route array('controller','method') or array('controller') or 'method' @param Request $req @param Response $res @param array $args @throws Exception when the route cannot be resolved. @return Response
[ "Executes", "a", "route", "handler", "." ]
7520b237c69f3d8a07d95d7481b26027ced2ed83
https://github.com/infusephp/infuse/blob/7520b237c69f3d8a07d95d7481b26027ced2ed83/src/RouteResolver.php#L117-L163
21,652
heidelpay/PhpDoc
src/phpDocumentor/Plugin/Core/Transformer/Writer/Xml/InterfaceConverter.php
InterfaceConverter.convert
public function convert(\DOMElement $parent, InterfaceDescriptor $interface) { $child = new \DOMElement('interface'); $parent->appendChild($child); /** @var InterfaceDescriptor $parentInterface */ foreach ($interface->getParent() as $parentInterface) { $parentFqcn = is_s...
php
public function convert(\DOMElement $parent, InterfaceDescriptor $interface) { $child = new \DOMElement('interface'); $parent->appendChild($child); /** @var InterfaceDescriptor $parentInterface */ foreach ($interface->getParent() as $parentInterface) { $parentFqcn = is_s...
[ "public", "function", "convert", "(", "\\", "DOMElement", "$", "parent", ",", "InterfaceDescriptor", "$", "interface", ")", "{", "$", "child", "=", "new", "\\", "DOMElement", "(", "'interface'", ")", ";", "$", "parent", "->", "appendChild", "(", "$", "chil...
Export the given reflected interface definition to the provided parent element. This method creates a new child element on the given parent XML element and takes the properties of the Reflection argument and sets the elements and attributes on the child. If a child DOMElement is provided then the properties and attri...
[ "Export", "the", "given", "reflected", "interface", "definition", "to", "the", "provided", "parent", "element", "." ]
5ac9e842cbd4cbb70900533b240c131f3515ee02
https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Plugin/Core/Transformer/Writer/Xml/InterfaceConverter.php#L66-L97
21,653
webdevvie/pheanstalk-task-queue-bundle
Command/WorkerTenderCommand.php
WorkerTenderCommand.handle
private function handle($key, ChildProcessContainer $child) { $tube = $this->tube; $child->processOutput('child_' . $tube . $key); //send unhealthy child processes to bed (kill em off) if (!$child->checkHealth()) { $child->getReadyForBed(); } //send old ch...
php
private function handle($key, ChildProcessContainer $child) { $tube = $this->tube; $child->processOutput('child_' . $tube . $key); //send unhealthy child processes to bed (kill em off) if (!$child->checkHealth()) { $child->getReadyForBed(); } //send old ch...
[ "private", "function", "handle", "(", "$", "key", ",", "ChildProcessContainer", "$", "child", ")", "{", "$", "tube", "=", "$", "this", "->", "tube", ";", "$", "child", "->", "processOutput", "(", "'child_'", ".", "$", "tube", ".", "$", "key", ")", ";...
Handles all child communication things @param string $key @param ChildProcessContainer $child @return void
[ "Handles", "all", "child", "communication", "things" ]
db5e63a8f844e345dc2e69ce8e94b32d851020eb
https://github.com/webdevvie/pheanstalk-task-queue-bundle/blob/db5e63a8f844e345dc2e69ce8e94b32d851020eb/Command/WorkerTenderCommand.php#L106-L137
21,654
webdevvie/pheanstalk-task-queue-bundle
Command/WorkerTenderCommand.php
WorkerTenderCommand.familyPlanning
private function familyPlanning() { list($total, $available) = $this->countWorkers(); if ($this->shutdownGracefully) { if ($total > 0) { $this->verboseOutput("<info>Shutting down</info> $total remaining children"); foreach ($this->family as $cnr => $child)...
php
private function familyPlanning() { list($total, $available) = $this->countWorkers(); if ($this->shutdownGracefully) { if ($total > 0) { $this->verboseOutput("<info>Shutting down</info> $total remaining children"); foreach ($this->family as $cnr => $child)...
[ "private", "function", "familyPlanning", "(", ")", "{", "list", "(", "$", "total", ",", "$", "available", ")", "=", "$", "this", "->", "countWorkers", "(", ")", ";", "if", "(", "$", "this", "->", "shutdownGracefully", ")", "{", "if", "(", "$", "total...
Produce more hands for the work needed @return void
[ "Produce", "more", "hands", "for", "the", "work", "needed" ]
db5e63a8f844e345dc2e69ce8e94b32d851020eb
https://github.com/webdevvie/pheanstalk-task-queue-bundle/blob/db5e63a8f844e345dc2e69ce8e94b32d851020eb/Command/WorkerTenderCommand.php#L144-L171
21,655
webdevvie/pheanstalk-task-queue-bundle
Command/WorkerTenderCommand.php
WorkerTenderCommand.countWorkers
public function countWorkers() { $total = count($this->family); $busy = 0; $available = 0; foreach ($this->family as &$child) { switch ($child->status) { case ChildProcessContainer::STATUS_ALIVE: case ChildProcessContainer::STATUS_READY: ...
php
public function countWorkers() { $total = count($this->family); $busy = 0; $available = 0; foreach ($this->family as &$child) { switch ($child->status) { case ChildProcessContainer::STATUS_ALIVE: case ChildProcessContainer::STATUS_READY: ...
[ "public", "function", "countWorkers", "(", ")", "{", "$", "total", "=", "count", "(", "$", "this", "->", "family", ")", ";", "$", "busy", "=", "0", ";", "$", "available", "=", "0", ";", "foreach", "(", "$", "this", "->", "family", "as", "&", "$",...
Returns an array with the worker counts @return array
[ "Returns", "an", "array", "with", "the", "worker", "counts" ]
db5e63a8f844e345dc2e69ce8e94b32d851020eb
https://github.com/webdevvie/pheanstalk-task-queue-bundle/blob/db5e63a8f844e345dc2e69ce8e94b32d851020eb/Command/WorkerTenderCommand.php#L178-L196
21,656
webdevvie/pheanstalk-task-queue-bundle
Command/WorkerTenderCommand.php
WorkerTenderCommand.moreOrLess
public function moreOrLess($total, $available) { $shouldHaveMoreWorkers = false; $shouldHaveLessWorkers = false; $minWorkers = $this->input->getOption('min-workers'); $maxWorkers = $this->input->getOption('max-workers'); $spareWorkers = $this->input->getOption('spare-workers'...
php
public function moreOrLess($total, $available) { $shouldHaveMoreWorkers = false; $shouldHaveLessWorkers = false; $minWorkers = $this->input->getOption('min-workers'); $maxWorkers = $this->input->getOption('max-workers'); $spareWorkers = $this->input->getOption('spare-workers'...
[ "public", "function", "moreOrLess", "(", "$", "total", ",", "$", "available", ")", "{", "$", "shouldHaveMoreWorkers", "=", "false", ";", "$", "shouldHaveLessWorkers", "=", "false", ";", "$", "minWorkers", "=", "$", "this", "->", "input", "->", "getOption", ...
Returns two booleans if there should be more or less workers @param integer $total @param integer $busy @param integer $available @return array
[ "Returns", "two", "booleans", "if", "there", "should", "be", "more", "or", "less", "workers" ]
db5e63a8f844e345dc2e69ce8e94b32d851020eb
https://github.com/webdevvie/pheanstalk-task-queue-bundle/blob/db5e63a8f844e345dc2e69ce8e94b32d851020eb/Command/WorkerTenderCommand.php#L206-L229
21,657
webdevvie/pheanstalk-task-queue-bundle
Command/WorkerTenderCommand.php
WorkerTenderCommand.findDisposableWorkers
private function findDisposableWorkers() { $disposableStatusses = array(ChildProcessContainer::STATUS_READY, ChildProcessContainer::STATUS_ALIVE); foreach ($this->family as &$child) { if (in_array($child->status, $disposableStatusses)) { if ($child->getAge() < 10) { ...
php
private function findDisposableWorkers() { $disposableStatusses = array(ChildProcessContainer::STATUS_READY, ChildProcessContainer::STATUS_ALIVE); foreach ($this->family as &$child) { if (in_array($child->status, $disposableStatusses)) { if ($child->getAge() < 10) { ...
[ "private", "function", "findDisposableWorkers", "(", ")", "{", "$", "disposableStatusses", "=", "array", "(", "ChildProcessContainer", "::", "STATUS_READY", ",", "ChildProcessContainer", "::", "STATUS_ALIVE", ")", ";", "foreach", "(", "$", "this", "->", "family", ...
Finds disposable workers, if it finds them it returns true @return boolean
[ "Finds", "disposable", "workers", "if", "it", "finds", "them", "it", "returns", "true" ]
db5e63a8f844e345dc2e69ce8e94b32d851020eb
https://github.com/webdevvie/pheanstalk-task-queue-bundle/blob/db5e63a8f844e345dc2e69ce8e94b32d851020eb/Command/WorkerTenderCommand.php#L236-L251
21,658
webdevvie/pheanstalk-task-queue-bundle
Command/WorkerTenderCommand.php
WorkerTenderCommand.spawnChild
private function spawnChild() { $child = new ChildProcessContainer( $this->consolePath, $this->input->getOption('worker-command'), $this->tube, $this ); $child->start(); return $child; }
php
private function spawnChild() { $child = new ChildProcessContainer( $this->consolePath, $this->input->getOption('worker-command'), $this->tube, $this ); $child->start(); return $child; }
[ "private", "function", "spawnChild", "(", ")", "{", "$", "child", "=", "new", "ChildProcessContainer", "(", "$", "this", "->", "consolePath", ",", "$", "this", "->", "input", "->", "getOption", "(", "'worker-command'", ")", ",", "$", "this", "->", "tube", ...
Spawns a new child @return Child
[ "Spawns", "a", "new", "child" ]
db5e63a8f844e345dc2e69ce8e94b32d851020eb
https://github.com/webdevvie/pheanstalk-task-queue-bundle/blob/db5e63a8f844e345dc2e69ce8e94b32d851020eb/Command/WorkerTenderCommand.php#L271-L281
21,659
bluetree-service/event
src/Event/Base/EventDispatcher.php
EventDispatcher.createEventObject
protected function createEventObject($eventName, array $data) { if (!array_key_exists($eventName, $this->options['events'])) { throw new \InvalidArgumentException('Event is not defined.'); } $namespace = $this->options['events'][$eventName]['object']; $instance = new $na...
php
protected function createEventObject($eventName, array $data) { if (!array_key_exists($eventName, $this->options['events'])) { throw new \InvalidArgumentException('Event is not defined.'); } $namespace = $this->options['events'][$eventName]['object']; $instance = new $na...
[ "protected", "function", "createEventObject", "(", "$", "eventName", ",", "array", "$", "data", ")", "{", "if", "(", "!", "array_key_exists", "(", "$", "eventName", ",", "$", "this", "->", "options", "[", "'events'", "]", ")", ")", "{", "throw", "new", ...
return event object or create it if not exist @param string $eventName @param array $data @return EventInterface @throws \LogicException @throws \InvalidArgumentException
[ "return", "event", "object", "or", "create", "it", "if", "not", "exist" ]
64ef4c77af6284fc22748285d5e527edbdbed69b
https://github.com/bluetree-service/event/blob/64ef4c77af6284fc22748285d5e527edbdbed69b/src/Event/Base/EventDispatcher.php#L89-L103
21,660
bluetree-service/event
src/Event/Base/EventDispatcher.php
EventDispatcher.triggerEvent
public function triggerEvent($name, array $data = []) { try { /** @var EventInterface $event */ $event = $this->createEventObject($name, $data); } catch (\InvalidArgumentException $exception) { return $this; } foreach ($this->options['events'][$na...
php
public function triggerEvent($name, array $data = []) { try { /** @var EventInterface $event */ $event = $this->createEventObject($name, $data); } catch (\InvalidArgumentException $exception) { return $this; } foreach ($this->options['events'][$na...
[ "public", "function", "triggerEvent", "(", "$", "name", ",", "array", "$", "data", "=", "[", "]", ")", "{", "try", "{", "/** @var EventInterface $event */", "$", "event", "=", "$", "this", "->", "createEventObject", "(", "$", "name", ",", "$", "data", ")...
trigger new event with automatic call all subscribed listeners @param string $name @param array $data @return $this @throws \LogicException
[ "trigger", "new", "event", "with", "automatic", "call", "all", "subscribed", "listeners" ]
64ef4c77af6284fc22748285d5e527edbdbed69b
https://github.com/bluetree-service/event/blob/64ef4c77af6284fc22748285d5e527edbdbed69b/src/Event/Base/EventDispatcher.php#L129-L148
21,661
bluetree-service/event
src/Event/Base/EventDispatcher.php
EventDispatcher.addEventListener
public function addEventListener($eventName, array $listeners) { if (!array_key_exists($eventName, $this->options['events'])) { $this->options['events'][$eventName] = [ 'object' =>BaseEvent::class, 'listeners' => $listeners, ]; } $this...
php
public function addEventListener($eventName, array $listeners) { if (!array_key_exists($eventName, $this->options['events'])) { $this->options['events'][$eventName] = [ 'object' =>BaseEvent::class, 'listeners' => $listeners, ]; } $this...
[ "public", "function", "addEventListener", "(", "$", "eventName", ",", "array", "$", "listeners", ")", "{", "if", "(", "!", "array_key_exists", "(", "$", "eventName", ",", "$", "this", "->", "options", "[", "'events'", "]", ")", ")", "{", "$", "this", "...
dynamically add new listener or listeners for given event name listeners are added at end of the list @param string $eventName @param array $listeners @return $this
[ "dynamically", "add", "new", "listener", "or", "listeners", "for", "given", "event", "name", "listeners", "are", "added", "at", "end", "of", "the", "list" ]
64ef4c77af6284fc22748285d5e527edbdbed69b
https://github.com/bluetree-service/event/blob/64ef4c77af6284fc22748285d5e527edbdbed69b/src/Event/Base/EventDispatcher.php#L179-L194
21,662
bluetree-service/event
src/Event/Base/EventDispatcher.php
EventDispatcher.readEventConfiguration
public function readEventConfiguration($path, $type) { if (!file_exists($path)) { throw new \InvalidArgumentException('File ' . $path . 'don\'t exists.'); } $name = '\BlueEvent\Event\Config\\' . ucfirst($type) . 'Config'; if (!class_exists($name)) { throw ne...
php
public function readEventConfiguration($path, $type) { if (!file_exists($path)) { throw new \InvalidArgumentException('File ' . $path . 'don\'t exists.'); } $name = '\BlueEvent\Event\Config\\' . ucfirst($type) . 'Config'; if (!class_exists($name)) { throw ne...
[ "public", "function", "readEventConfiguration", "(", "$", "path", ",", "$", "type", ")", "{", "if", "(", "!", "file_exists", "(", "$", "path", ")", ")", "{", "throw", "new", "\\", "InvalidArgumentException", "(", "'File '", ".", "$", "path", ".", "'don\\...
read configuration from file @param mixed $path @param string $type @return $this @throws \InvalidArgumentException
[ "read", "configuration", "from", "file" ]
64ef4c77af6284fc22748285d5e527edbdbed69b
https://github.com/bluetree-service/event/blob/64ef4c77af6284fc22748285d5e527edbdbed69b/src/Event/Base/EventDispatcher.php#L217-L233
21,663
bluetree-service/event
src/Event/Base/EventDispatcher.php
EventDispatcher.logEvent
public function logEvent(array $events = []) { foreach ($events as $event) { if (!in_array($event, $this->loggerInstance->logEvents, true)) { $this->loggerInstance->logEvents[] = $event; } } return $this; }
php
public function logEvent(array $events = []) { foreach ($events as $event) { if (!in_array($event, $this->loggerInstance->logEvents, true)) { $this->loggerInstance->logEvents[] = $event; } } return $this; }
[ "public", "function", "logEvent", "(", "array", "$", "events", "=", "[", "]", ")", "{", "foreach", "(", "$", "events", "as", "$", "event", ")", "{", "if", "(", "!", "in_array", "(", "$", "event", ",", "$", "this", "->", "loggerInstance", "->", "log...
log given events by given name @param array $events @return $this
[ "log", "given", "events", "by", "given", "name" ]
64ef4c77af6284fc22748285d5e527edbdbed69b
https://github.com/bluetree-service/event/blob/64ef4c77af6284fc22748285d5e527edbdbed69b/src/Event/Base/EventDispatcher.php#L253-L262
21,664
bluetree-service/event
src/Event/Base/EventDispatcher.php
EventDispatcher.getConfiguration
public function getConfiguration($option = null) { if (!is_null($option)) { return $this->options[$option]; } return $this->options; }
php
public function getConfiguration($option = null) { if (!is_null($option)) { return $this->options[$option]; } return $this->options; }
[ "public", "function", "getConfiguration", "(", "$", "option", "=", "null", ")", "{", "if", "(", "!", "is_null", "(", "$", "option", ")", ")", "{", "return", "$", "this", "->", "options", "[", "$", "option", "]", ";", "}", "return", "$", "this", "->...
get complete object configuration or value of single option @param $option string|null @return mixed
[ "get", "complete", "object", "configuration", "or", "value", "of", "single", "option" ]
64ef4c77af6284fc22748285d5e527edbdbed69b
https://github.com/bluetree-service/event/blob/64ef4c77af6284fc22748285d5e527edbdbed69b/src/Event/Base/EventDispatcher.php#L282-L289
21,665
bluetree-service/event
src/Event/Base/EventDispatcher.php
EventDispatcher.addError
protected function addError(\Exception $exception) { $this->errorList[$exception->getCode()] = [ 'message' => $exception->getMessage(), 'line' => $exception->getLine(), 'file' => $exception->getFile(), 'trace' => $exception->getTraceAsString(),...
php
protected function addError(\Exception $exception) { $this->errorList[$exception->getCode()] = [ 'message' => $exception->getMessage(), 'line' => $exception->getLine(), 'file' => $exception->getFile(), 'trace' => $exception->getTraceAsString(),...
[ "protected", "function", "addError", "(", "\\", "Exception", "$", "exception", ")", "{", "$", "this", "->", "errorList", "[", "$", "exception", "->", "getCode", "(", ")", "]", "=", "[", "'message'", "=>", "$", "exception", "->", "getMessage", "(", ")", ...
add new error to list @param \Exception $exception @return $this
[ "add", "new", "error", "to", "list" ]
64ef4c77af6284fc22748285d5e527edbdbed69b
https://github.com/bluetree-service/event/blob/64ef4c77af6284fc22748285d5e527edbdbed69b/src/Event/Base/EventDispatcher.php#L350-L361
21,666
GreenCape/joomla-cli
src/GreenCape/JoomlaCLI/Application.php
Application.addPlugins
private function addPlugins($path) { foreach (glob($path . '/*.php') as $filename) { $commandClass = __NAMESPACE__ . '\\' . basename($filename, '.php') . 'Command'; $command = new $commandClass; $this->add($command); } }
php
private function addPlugins($path) { foreach (glob($path . '/*.php') as $filename) { $commandClass = __NAMESPACE__ . '\\' . basename($filename, '.php') . 'Command'; $command = new $commandClass; $this->add($command); } }
[ "private", "function", "addPlugins", "(", "$", "path", ")", "{", "foreach", "(", "glob", "(", "$", "path", ".", "'/*.php'", ")", "as", "$", "filename", ")", "{", "$", "commandClass", "=", "__NAMESPACE__", ".", "'\\\\'", ".", "basename", "(", "$", "file...
Dynamically add all commands from a path @param string $path The directory with the plugins @return void
[ "Dynamically", "add", "all", "commands", "from", "a", "path" ]
74a6940f27b1f66c99330d4f9e2c5ac314cdd369
https://github.com/GreenCape/joomla-cli/blob/74a6940f27b1f66c99330d4f9e2c5ac314cdd369/src/GreenCape/JoomlaCLI/Application.php#L96-L104
21,667
unclecheese/silverstripe-blubber
code/Sampler.php
Sampler.execute
public function execute() { $results = ArrayList::create(); foreach($this->classes as $c) { if($this->isOmitted($c)) continue; $list = DataList::create($c) ->filter('ClassName', $c) ->limit($this->getLimitFor($c)) ->sort("RAND()"); foreach($list as $record) { $results->push($record...
php
public function execute() { $results = ArrayList::create(); foreach($this->classes as $c) { if($this->isOmitted($c)) continue; $list = DataList::create($c) ->filter('ClassName', $c) ->limit($this->getLimitFor($c)) ->sort("RAND()"); foreach($list as $record) { $results->push($record...
[ "public", "function", "execute", "(", ")", "{", "$", "results", "=", "ArrayList", "::", "create", "(", ")", ";", "foreach", "(", "$", "this", "->", "classes", "as", "$", "c", ")", "{", "if", "(", "$", "this", "->", "isOmitted", "(", "$", "c", ")"...
Executes the query, gets the samples @return ArrayList
[ "Executes", "the", "query", "gets", "the", "samples" ]
f2549bd5eddeb0ca0303a3c09be4a8136fcc6661
https://github.com/unclecheese/silverstripe-blubber/blob/f2549bd5eddeb0ca0303a3c09be4a8136fcc6661/code/Sampler.php#L56-L73
21,668
unclecheese/silverstripe-blubber
code/Sampler.php
Sampler.isOmitted
protected function isOmitted($c) { foreach($this->omissions as $o) { if($c == $o || is_subclass_of($c, $o)) { return true; } } return false; }
php
protected function isOmitted($c) { foreach($this->omissions as $o) { if($c == $o || is_subclass_of($c, $o)) { return true; } } return false; }
[ "protected", "function", "isOmitted", "(", "$", "c", ")", "{", "foreach", "(", "$", "this", "->", "omissions", "as", "$", "o", ")", "{", "if", "(", "$", "c", "==", "$", "o", "||", "is_subclass_of", "(", "$", "c", ",", "$", "o", ")", ")", "{", ...
Returns true if a class is omitted @param string $c The class name @return boolean
[ "Returns", "true", "if", "a", "class", "is", "omitted" ]
f2549bd5eddeb0ca0303a3c09be4a8136fcc6661
https://github.com/unclecheese/silverstripe-blubber/blob/f2549bd5eddeb0ca0303a3c09be4a8136fcc6661/code/Sampler.php#L81-L89
21,669
PHPPowertools/HTML5
src/PowerTools/HTML5/Parser/DOMTreeBuilder.php
HTML5_Parser_DOMTreeBuilder.isAncestor
protected function isAncestor($tagname) { $candidate = $this->current; while ($candidate->nodeType === XML_ELEMENT_NODE) { if ($candidate->tagName == $tagname) { return true; } $candidate = $candidate->parentNode; } return false; }
php
protected function isAncestor($tagname) { $candidate = $this->current; while ($candidate->nodeType === XML_ELEMENT_NODE) { if ($candidate->tagName == $tagname) { return true; } $candidate = $candidate->parentNode; } return false; }
[ "protected", "function", "isAncestor", "(", "$", "tagname", ")", "{", "$", "candidate", "=", "$", "this", "->", "current", ";", "while", "(", "$", "candidate", "->", "nodeType", "===", "XML_ELEMENT_NODE", ")", "{", "if", "(", "$", "candidate", "->", "tag...
Checks if the given tagname is an ancestor of the present candidate. If $this->current or anything above $this->current matches the given tag name, this returns true.
[ "Checks", "if", "the", "given", "tagname", "is", "an", "ancestor", "of", "the", "present", "candidate", "." ]
4ea8caf5b2618a82ca5061dcbb7421b31065c1c7
https://github.com/PHPPowertools/HTML5/blob/4ea8caf5b2618a82ca5061dcbb7421b31065c1c7/src/PowerTools/HTML5/Parser/DOMTreeBuilder.php#L663-L673
21,670
surebert/surebert-framework
src/sb/Graph/Point.php
Point.setPointColor
public function setPointColor($r, $g, $b) { $this->ink['point'] = imagecolorallocate($this->im, $r, $g, $b); }
php
public function setPointColor($r, $g, $b) { $this->ink['point'] = imagecolorallocate($this->im, $r, $g, $b); }
[ "public", "function", "setPointColor", "(", "$", "r", ",", "$", "g", ",", "$", "b", ")", "{", "$", "this", "->", "ink", "[", "'point'", "]", "=", "imagecolorallocate", "(", "$", "this", "->", "im", ",", "$", "r", ",", "$", "g", ",", "$", "b", ...
Sets the point color in rgb format @param integer $r The red value 0-255 @param integer $g The green value 0-255 @param integer $b The blue value 0-255
[ "Sets", "the", "point", "color", "in", "rgb", "format" ]
f2f32eb693bd39385ceb93355efb5b2a429f27ce
https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Graph/Point.php#L143-L147
21,671
surebert/surebert-framework
src/sb/Graph/Point.php
Point.setLineColor
public function setLineColor($r, $g, $b) { $this->ink['line'] = imagecolorallocate($this->im, $r, $g, $b); }
php
public function setLineColor($r, $g, $b) { $this->ink['line'] = imagecolorallocate($this->im, $r, $g, $b); }
[ "public", "function", "setLineColor", "(", "$", "r", ",", "$", "g", ",", "$", "b", ")", "{", "$", "this", "->", "ink", "[", "'line'", "]", "=", "imagecolorallocate", "(", "$", "this", "->", "im", ",", "$", "r", ",", "$", "g", ",", "$", "b", "...
Sets the line color in rgb format @param integer $r The red value 0-255 @param integer $g The green value 0-255 @param integer $b The blue value 0-255
[ "Sets", "the", "line", "color", "in", "rgb", "format" ]
f2f32eb693bd39385ceb93355efb5b2a429f27ce
https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Graph/Point.php#L156-L160
21,672
surebert/surebert-framework
src/sb/Graph/Point.php
Point.setTextColor
public function setTextColor($r, $g, $b) { $this->ink['text'] = imagecolorallocate($this->im, $r, $g, $b); }
php
public function setTextColor($r, $g, $b) { $this->ink['text'] = imagecolorallocate($this->im, $r, $g, $b); }
[ "public", "function", "setTextColor", "(", "$", "r", ",", "$", "g", ",", "$", "b", ")", "{", "$", "this", "->", "ink", "[", "'text'", "]", "=", "imagecolorallocate", "(", "$", "this", "->", "im", ",", "$", "r", ",", "$", "g", ",", "$", "b", "...
Sets the text color in rgb format - labels @param integer $r The red value 0-255 @param integer $g The green value 0-255 @param integer $b The blue value 0-255
[ "Sets", "the", "text", "color", "in", "rgb", "format", "-", "labels" ]
f2f32eb693bd39385ceb93355efb5b2a429f27ce
https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Graph/Point.php#L169-L172
21,673
surebert/surebert-framework
src/sb/Graph/Point.php
Point.setAxisColor
public function setAxisColor($r, $g, $b) { $this->ink['axis'] = imagecolorallocate($this->im, $r, $g, $b); }
php
public function setAxisColor($r, $g, $b) { $this->ink['axis'] = imagecolorallocate($this->im, $r, $g, $b); }
[ "public", "function", "setAxisColor", "(", "$", "r", ",", "$", "g", ",", "$", "b", ")", "{", "$", "this", "->", "ink", "[", "'axis'", "]", "=", "imagecolorallocate", "(", "$", "this", "->", "im", ",", "$", "r", ",", "$", "g", ",", "$", "b", "...
Sets the axis color in rgb format - axis @param integer $r The red value 0-255 @param integer $g The green value 0-255 @param integer $b The blue value 0-255
[ "Sets", "the", "axis", "color", "in", "rgb", "format", "-", "axis" ]
f2f32eb693bd39385ceb93355efb5b2a429f27ce
https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Graph/Point.php#L181-L184
21,674
surebert/surebert-framework
src/sb/Graph/Point.php
Point.createBackground
private function createBackground() { imagefilledrectangle($this->im, 0, 0, $this->width, $this->height, $this->ink['black']); }
php
private function createBackground() { imagefilledrectangle($this->im, 0, 0, $this->width, $this->height, $this->ink['black']); }
[ "private", "function", "createBackground", "(", ")", "{", "imagefilledrectangle", "(", "$", "this", "->", "im", ",", "0", ",", "0", ",", "$", "this", "->", "width", ",", "$", "this", "->", "height", ",", "$", "this", "->", "ink", "[", "'black'", "]",...
Create the backgrround image
[ "Create", "the", "backgrround", "image" ]
f2f32eb693bd39385ceb93355efb5b2a429f27ce
https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Graph/Point.php#L198-L203
21,675
surebert/surebert-framework
src/sb/Graph/Point.php
Point.allocateColors
private function allocateColors() { $this->ink['red'] = imagecolorallocate($this->im, 0xff, 0x00, 0x00); $this->ink['orange'] = imagecolorallocate($this->im, 0xd2, 0x8a, 0x00); $this->ink['yellow'] = imagecolorallocate($this->im, 0xff, 0xff, 0x00); $this->ink['green'] = imagecoloral...
php
private function allocateColors() { $this->ink['red'] = imagecolorallocate($this->im, 0xff, 0x00, 0x00); $this->ink['orange'] = imagecolorallocate($this->im, 0xd2, 0x8a, 0x00); $this->ink['yellow'] = imagecolorallocate($this->im, 0xff, 0xff, 0x00); $this->ink['green'] = imagecoloral...
[ "private", "function", "allocateColors", "(", ")", "{", "$", "this", "->", "ink", "[", "'red'", "]", "=", "imagecolorallocate", "(", "$", "this", "->", "im", ",", "0xff", ",", "0x00", ",", "0x00", ")", ";", "$", "this", "->", "ink", "[", "'orange'", ...
Allocates the default color used
[ "Allocates", "the", "default", "color", "used" ]
f2f32eb693bd39385ceb93355efb5b2a429f27ce
https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Graph/Point.php#L209-L230
21,676
surebert/surebert-framework
src/sb/Graph/Point.php
Point.mapYvalue
private function mapYvalue($value) { $rangeMapper = new \sb\Math\RangeMapper(Array(30, $this->graph_height), Array($this->min, $this->max)); return $rangeMapper->convert($value); }
php
private function mapYvalue($value) { $rangeMapper = new \sb\Math\RangeMapper(Array(30, $this->graph_height), Array($this->min, $this->max)); return $rangeMapper->convert($value); }
[ "private", "function", "mapYvalue", "(", "$", "value", ")", "{", "$", "rangeMapper", "=", "new", "\\", "sb", "\\", "Math", "\\", "RangeMapper", "(", "Array", "(", "30", ",", "$", "this", "->", "graph_height", ")", ",", "Array", "(", "$", "this", "->"...
Converts the range from point to pixel value @param integer $value The value to convert @return integer The number as converted into the pixel range on the graph
[ "Converts", "the", "range", "from", "point", "to", "pixel", "value" ]
f2f32eb693bd39385ceb93355efb5b2a429f27ce
https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Graph/Point.php#L238-L243
21,677
surebert/surebert-framework
src/sb/Graph/Point.php
Point.setValues
private function setValues($values) { $numbers = Array(); foreach ($values as $key => $val) { $value = new \stdClass(); $value->label = trim($key); if (!is_numeric($val)) { $val = null; } $value->value = $val; ...
php
private function setValues($values) { $numbers = Array(); foreach ($values as $key => $val) { $value = new \stdClass(); $value->label = trim($key); if (!is_numeric($val)) { $val = null; } $value->value = $val; ...
[ "private", "function", "setValues", "(", "$", "values", ")", "{", "$", "numbers", "=", "Array", "(", ")", ";", "foreach", "(", "$", "values", "as", "$", "key", "=>", "$", "val", ")", "{", "$", "value", "=", "new", "\\", "stdClass", "(", ")", ";",...
Converts the values into usable data for the drawing of the graph @param array $values
[ "Converts", "the", "values", "into", "usable", "data", "for", "the", "drawing", "of", "the", "graph" ]
f2f32eb693bd39385ceb93355efb5b2a429f27ce
https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Graph/Point.php#L250-L294
21,678
surebert/surebert-framework
src/sb/Graph/Point.php
Point.plotValue
private function plotValue($y) { $rangeMapper = new \sb\Math\RangeMapper(Array( $this->axis_offset, $this->graph_height - $this->axis_offset ), Array($this->max, $this->min)); return $rangeMapper->convert($y); }
php
private function plotValue($y) { $rangeMapper = new \sb\Math\RangeMapper(Array( $this->axis_offset, $this->graph_height - $this->axis_offset ), Array($this->max, $this->min)); return $rangeMapper->convert($y); }
[ "private", "function", "plotValue", "(", "$", "y", ")", "{", "$", "rangeMapper", "=", "new", "\\", "sb", "\\", "Math", "\\", "RangeMapper", "(", "Array", "(", "$", "this", "->", "axis_offset", ",", "$", "this", "->", "graph_height", "-", "$", "this", ...
Converts points on the graph to pixels @param integer $y @return integer The value in pixels
[ "Converts", "points", "on", "the", "graph", "to", "pixels" ]
f2f32eb693bd39385ceb93355efb5b2a429f27ce
https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Graph/Point.php#L341-L348
21,679
surebert/surebert-framework
src/sb/Graph/Point.php
Point.connectPoints
private function connectPoints() { foreach ($this->points as $point) { if (is_null($point->value)) { $last_x = $point->x; $last_y = $point->y; $last_val = $point->value; continue; } if (isset($last_x) && (i...
php
private function connectPoints() { foreach ($this->points as $point) { if (is_null($point->value)) { $last_x = $point->x; $last_y = $point->y; $last_val = $point->value; continue; } if (isset($last_x) && (i...
[ "private", "function", "connectPoints", "(", ")", "{", "foreach", "(", "$", "this", "->", "points", "as", "$", "point", ")", "{", "if", "(", "is_null", "(", "$", "point", "->", "value", ")", ")", "{", "$", "last_x", "=", "$", "point", "->", "x", ...
Connect the points on a graph
[ "Connect", "the", "points", "on", "a", "graph" ]
f2f32eb693bd39385ceb93355efb5b2a429f27ce
https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Graph/Point.php#L354-L373
21,680
surebert/surebert-framework
src/sb/Graph/Point.php
Point.draw
public function draw() { $this->drawYaxis(); if ($this->connect_points == 1) { $this->connectPoints(); } foreach ($this->points as $point) { if ($this->y_axis_hints == 1) { imagedashedline($this->im, $point->x, $this->height, $point->x, ...
php
public function draw() { $this->drawYaxis(); if ($this->connect_points == 1) { $this->connectPoints(); } foreach ($this->points as $point) { if ($this->y_axis_hints == 1) { imagedashedline($this->im, $point->x, $this->height, $point->x, ...
[ "public", "function", "draw", "(", ")", "{", "$", "this", "->", "drawYaxis", "(", ")", ";", "if", "(", "$", "this", "->", "connect_points", "==", "1", ")", "{", "$", "this", "->", "connectPoints", "(", ")", ";", "}", "foreach", "(", "$", "this", ...
Draw the basic graph and plot the points
[ "Draw", "the", "basic", "graph", "and", "plot", "the", "points" ]
f2f32eb693bd39385ceb93355efb5b2a429f27ce
https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Graph/Point.php#L379-L425
21,681
surebert/surebert-framework
src/sb/Graph/Point.php
Point.addHorizontalLine
public function addHorizontalLine($y, $color = 'red', $label = '') { if (!array_key_exists($color, $this->ink)) { throw(new \Exception("Ink color must be in " . implode(",", \array_keys($this->ink)))); } $y = $this->plotValue($y); imageline($this->im...
php
public function addHorizontalLine($y, $color = 'red', $label = '') { if (!array_key_exists($color, $this->ink)) { throw(new \Exception("Ink color must be in " . implode(",", \array_keys($this->ink)))); } $y = $this->plotValue($y); imageline($this->im...
[ "public", "function", "addHorizontalLine", "(", "$", "y", ",", "$", "color", "=", "'red'", ",", "$", "label", "=", "''", ")", "{", "if", "(", "!", "array_key_exists", "(", "$", "color", ",", "$", "this", "->", "ink", ")", ")", "{", "throw", "(", ...
Add a horizontal line @param integer $y The y value @param string $color red, orange, yellow, green, blue, purple @param string $label The line label
[ "Add", "a", "horizontal", "line" ]
f2f32eb693bd39385ceb93355efb5b2a429f27ce
https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Graph/Point.php#L434-L447
21,682
spiral-modules/listing
source/Listing/Prototypes/DependedModificator.php
DependedModificator.loadDependencies
protected function loadDependencies(RecordSelector $selector) { if (empty($this->dependencies)) { return $selector; } foreach ($this->dependencies as $dependency) { $selector = $selector->with( $dependency->getRelation(), $dependency->...
php
protected function loadDependencies(RecordSelector $selector) { if (empty($this->dependencies)) { return $selector; } foreach ($this->dependencies as $dependency) { $selector = $selector->with( $dependency->getRelation(), $dependency->...
[ "protected", "function", "loadDependencies", "(", "RecordSelector", "$", "selector", ")", "{", "if", "(", "empty", "(", "$", "this", "->", "dependencies", ")", ")", "{", "return", "$", "selector", ";", "}", "foreach", "(", "$", "this", "->", "dependencies"...
Apply dependencies for RecordSelector @param RecordSelector $selector @return RecordSelector
[ "Apply", "dependencies", "for", "RecordSelector" ]
89abe8939ce91cbf61b51b99e93ce1e57c8af83c
https://github.com/spiral-modules/listing/blob/89abe8939ce91cbf61b51b99e93ce1e57c8af83c/source/Listing/Prototypes/DependedModificator.php#L72-L86
21,683
LeaseCloud/leasecloud-php-sdk
src/Webook.php
Webook.validateSignature
public static function validateSignature($signature, $payload) { $parts = explode(',', $signature); $parameters = []; $t = 0; // Find the timestamp foreach ($parts as $part) { parse_str($part, $parsed); if (key($parsed) === 't') { $t = ...
php
public static function validateSignature($signature, $payload) { $parts = explode(',', $signature); $parameters = []; $t = 0; // Find the timestamp foreach ($parts as $part) { parse_str($part, $parsed); if (key($parsed) === 't') { $t = ...
[ "public", "static", "function", "validateSignature", "(", "$", "signature", ",", "$", "payload", ")", "{", "$", "parts", "=", "explode", "(", "','", ",", "$", "signature", ")", ";", "$", "parameters", "=", "[", "]", ";", "$", "t", "=", "0", ";", "/...
Validate the webhook signature @param string $signature The string passed in header LeaseCloud-Signature @param string $payload The raw payload @return bool True if the signature is valid, otherwise false
[ "Validate", "the", "webhook", "signature" ]
091b073dd4f79ba915a68c0ed151bd9bfa61e7ca
https://github.com/LeaseCloud/leasecloud-php-sdk/blob/091b073dd4f79ba915a68c0ed151bd9bfa61e7ca/src/Webook.php#L35-L66
21,684
NuclearCMS/Hierarchy
src/Tags/Taggable.php
Taggable.attachTag
public function attachTag($id) { if ( ! $this->tags->contains($id)) { return $this->tags()->attach($id); } }
php
public function attachTag($id) { if ( ! $this->tags->contains($id)) { return $this->tags()->attach($id); } }
[ "public", "function", "attachTag", "(", "$", "id", ")", "{", "if", "(", "!", "$", "this", "->", "tags", "->", "contains", "(", "$", "id", ")", ")", "{", "return", "$", "this", "->", "tags", "(", ")", "->", "attach", "(", "$", "id", ")", ";", ...
Links a tag to the node @param int $id
[ "Links", "a", "tag", "to", "the", "node" ]
535171c5e2db72265313fd2110aec8456e46f459
https://github.com/NuclearCMS/Hierarchy/blob/535171c5e2db72265313fd2110aec8456e46f459/src/Tags/Taggable.php#L36-L42
21,685
bpolaszek/simple-dbal
src/Model/Adapter/Mysqli/MysqliAdapter.php
MysqliAdapter.executeParallel
private function executeParallel($stmt, array $values = null): PromiseInterface { if (is_string($stmt)) { $stmt = $this->emulatePrepare((string) $stmt, $values); } else { if (!$stmt instanceof Statement) { throw new \InvalidArgumentException(sprintf('Expected ...
php
private function executeParallel($stmt, array $values = null): PromiseInterface { if (is_string($stmt)) { $stmt = $this->emulatePrepare((string) $stmt, $values); } else { if (!$stmt instanceof Statement) { throw new \InvalidArgumentException(sprintf('Expected ...
[ "private", "function", "executeParallel", "(", "$", "stmt", ",", "array", "$", "values", "=", "null", ")", ":", "PromiseInterface", "{", "if", "(", "is_string", "(", "$", "stmt", ")", ")", "{", "$", "stmt", "=", "$", "this", "->", "emulatePrepare", "("...
EXPERIMENTAL ! Executes a statement asynchronously. The promise will return a Result object. @param $stmt @param array|null $values @return PromiseInterface
[ "EXPERIMENTAL", "!", "Executes", "a", "statement", "asynchronously", ".", "The", "promise", "will", "return", "a", "Result", "object", "." ]
52cb50d326ba5854191814b470f5e84950ebb6e6
https://github.com/bpolaszek/simple-dbal/blob/52cb50d326ba5854191814b470f5e84950ebb6e6/src/Model/Adapter/Mysqli/MysqliAdapter.php#L232-L266
21,686
watoki/curir
src/protocol/MimeTypes.php
MimeTypes.getType
public static function getType($extension) { foreach (self::$map as $mime => $exts) { if (in_array(strtolower($extension), $exts)) { return $mime; } } return null; }
php
public static function getType($extension) { foreach (self::$map as $mime => $exts) { if (in_array(strtolower($extension), $exts)) { return $mime; } } return null; }
[ "public", "static", "function", "getType", "(", "$", "extension", ")", "{", "foreach", "(", "self", "::", "$", "map", "as", "$", "mime", "=>", "$", "exts", ")", "{", "if", "(", "in_array", "(", "strtolower", "(", "$", "extension", ")", ",", "$", "e...
Retruns MIME type belonging to given file extension or null if not found. @static @param $extension @return null|string
[ "Retruns", "MIME", "type", "belonging", "to", "given", "file", "extension", "or", "null", "if", "not", "found", "." ]
20a44e1d1980f472369991e19ef8d3bafda79a64
https://github.com/watoki/curir/blob/20a44e1d1980f472369991e19ef8d3bafda79a64/src/protocol/MimeTypes.php#L137-L144
21,687
zicht/z
src/Zicht/Tool/PropertyPath/PropertyAccessor.php
PropertyAccessor.setByPath
public static function setByPath(&$subject, array $path, $value) { $ptr = & $subject; foreach ($path as $key) { if (is_object($ptr)) { if (!isset($ptr->$key)) { $ptr->$key = array(); } $ptr = & $ptr->$key; } ...
php
public static function setByPath(&$subject, array $path, $value) { $ptr = & $subject; foreach ($path as $key) { if (is_object($ptr)) { if (!isset($ptr->$key)) { $ptr->$key = array(); } $ptr = & $ptr->$key; } ...
[ "public", "static", "function", "setByPath", "(", "&", "$", "subject", ",", "array", "$", "path", ",", "$", "value", ")", "{", "$", "ptr", "=", "&", "$", "subject", ";", "foreach", "(", "$", "path", "as", "$", "key", ")", "{", "if", "(", "is_obje...
Set a property value by a path of property or key names. @param mixed &$subject @param array $path @param mixed $value @return mixed
[ "Set", "a", "property", "value", "by", "a", "path", "of", "property", "or", "key", "names", "." ]
6a1731dad20b018555a96b726a61d4bf8ec8c886
https://github.com/zicht/z/blob/6a1731dad20b018555a96b726a61d4bf8ec8c886/src/Zicht/Tool/PropertyPath/PropertyAccessor.php#L52-L70
21,688
netvlies/NetvliesFormBundle
Service/FormService.php
FormService.get
public function get($id) { if (!isset($this->forms[$id])) { $contentRepository = $this->container->get('doctrine')->getRepository('NetvliesFormBundle:Form'); $form = $contentRepository->findOneById($id); $formBuilder = $this->container->get('form.factory')->createBuilder...
php
public function get($id) { if (!isset($this->forms[$id])) { $contentRepository = $this->container->get('doctrine')->getRepository('NetvliesFormBundle:Form'); $form = $contentRepository->findOneById($id); $formBuilder = $this->container->get('form.factory')->createBuilder...
[ "public", "function", "get", "(", "$", "id", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "forms", "[", "$", "id", "]", ")", ")", "{", "$", "contentRepository", "=", "$", "this", "->", "container", "->", "get", "(", "'doctrine'", ")...
Builds the form with the requested ID. When a form is requested for the second time, the instance created earlier is returned to ensure only one form instance is used and form properties can be set and retrieved from all locations where the form is used. @param $id @return mixed
[ "Builds", "the", "form", "with", "the", "requested", "ID", ".", "When", "a", "form", "is", "requested", "for", "the", "second", "time", "the", "instance", "created", "earlier", "is", "returned", "to", "ensure", "only", "one", "form", "instance", "is", "use...
93f9a3321d9925040111374e7c1014a6400a2d08
https://github.com/netvlies/NetvliesFormBundle/blob/93f9a3321d9925040111374e7c1014a6400a2d08/Service/FormService.php#L32-L99
21,689
PHPPowertools/HTML5
src/PowerTools/HTML5.php
HTML5.load
public function load($file) { // Handle the case where file is a resource. if (is_resource($file)) { // FIXME: We need a StreamInputStream class. return $this->loadHTML(stream_get_contents($file)); } $input = new HTML5_Inputstream_File($file); return $th...
php
public function load($file) { // Handle the case where file is a resource. if (is_resource($file)) { // FIXME: We need a StreamInputStream class. return $this->loadHTML(stream_get_contents($file)); } $input = new HTML5_Inputstream_File($file); return $th...
[ "public", "function", "load", "(", "$", "file", ")", "{", "// Handle the case where file is a resource.", "if", "(", "is_resource", "(", "$", "file", ")", ")", "{", "// FIXME: We need a StreamInputStream class.", "return", "$", "this", "->", "loadHTML", "(", "stream...
Load and parse an HTML file. This will apply the HTML5 parser, which is tolerant of many varieties of HTML, including XHTML 1, HTML 4, and well-formed HTML 3. Note that in these cases, not all of the old data will be preserved. For example, XHTML's XML declaration will be removed. The rules governing parsing are set ...
[ "Load", "and", "parse", "an", "HTML", "file", "." ]
4ea8caf5b2618a82ca5061dcbb7421b31065c1c7
https://github.com/PHPPowertools/HTML5/blob/4ea8caf5b2618a82ca5061dcbb7421b31065c1c7/src/PowerTools/HTML5.php#L139-L149
21,690
PHPPowertools/HTML5
src/PowerTools/HTML5.php
HTML5.parse
public function parse(HTML5_Inputstream_Interface $input) { $this->errors = array(); $events = new HTML5_Parser_DOMTreeBuilder(false, $this->options); $scanner = new HTML5_Parser_Scanner($input); $parser = new HTML5_Parser_Tokenizer($scanner, $events); $parser->parse(); ...
php
public function parse(HTML5_Inputstream_Interface $input) { $this->errors = array(); $events = new HTML5_Parser_DOMTreeBuilder(false, $this->options); $scanner = new HTML5_Parser_Scanner($input); $parser = new HTML5_Parser_Tokenizer($scanner, $events); $parser->parse(); ...
[ "public", "function", "parse", "(", "HTML5_Inputstream_Interface", "$", "input", ")", "{", "$", "this", "->", "errors", "=", "array", "(", ")", ";", "$", "events", "=", "new", "HTML5_Parser_DOMTreeBuilder", "(", "false", ",", "$", "this", "->", "options", ...
Parse an input stream. Lower-level loading function. This requires an input stream instead of a string, file, or resource.
[ "Parse", "an", "input", "stream", "." ]
4ea8caf5b2618a82ca5061dcbb7421b31065c1c7
https://github.com/PHPPowertools/HTML5/blob/4ea8caf5b2618a82ca5061dcbb7421b31065c1c7/src/PowerTools/HTML5.php#L225-L235
21,691
PHPPowertools/HTML5
src/PowerTools/HTML5.php
HTML5.parseFragment
public function parseFragment(HTML5_Inputstream_Interface $input) { $events = new HTML5_Parser_DOMTreeBuilder(true, $this->options); $scanner = new HTML5_Parser_Scanner($input); $parser = new HTML5_Parser_Tokenizer($scanner, $events); $parser->parse(); $this->errors = $events->g...
php
public function parseFragment(HTML5_Inputstream_Interface $input) { $events = new HTML5_Parser_DOMTreeBuilder(true, $this->options); $scanner = new HTML5_Parser_Scanner($input); $parser = new HTML5_Parser_Tokenizer($scanner, $events); $parser->parse(); $this->errors = $events->g...
[ "public", "function", "parseFragment", "(", "HTML5_Inputstream_Interface", "$", "input", ")", "{", "$", "events", "=", "new", "HTML5_Parser_DOMTreeBuilder", "(", "true", ",", "$", "this", "->", "options", ")", ";", "$", "scanner", "=", "new", "HTML5_Parser_Scann...
Parse an input stream where the stream is a fragment. Lower-level loading function. This requires an input stream instead of a string, file, or resource.
[ "Parse", "an", "input", "stream", "where", "the", "stream", "is", "a", "fragment", "." ]
4ea8caf5b2618a82ca5061dcbb7421b31065c1c7
https://github.com/PHPPowertools/HTML5/blob/4ea8caf5b2618a82ca5061dcbb7421b31065c1c7/src/PowerTools/HTML5.php#L243-L252
21,692
PHPPowertools/HTML5
src/PowerTools/HTML5.php
HTML5.save
public function save($dom, $file, $options = array()) { $close = true; if (is_resource($file)) { $stream = $file; $close = false; } else { $stream = fopen($file, 'w'); } $options = array_merge($this->getOptions(), $options); $rules = ne...
php
public function save($dom, $file, $options = array()) { $close = true; if (is_resource($file)) { $stream = $file; $close = false; } else { $stream = fopen($file, 'w'); } $options = array_merge($this->getOptions(), $options); $rules = ne...
[ "public", "function", "save", "(", "$", "dom", ",", "$", "file", ",", "$", "options", "=", "array", "(", ")", ")", "{", "$", "close", "=", "true", ";", "if", "(", "is_resource", "(", "$", "file", ")", ")", "{", "$", "stream", "=", "$", "file", ...
Save a DOM into a given file as HTML5. @param mixed $dom The DOM to be serialized. @param string $file The filename to be written. @param array $options Configuration options when serializing the DOM. These include: - encode_entities: Text written to the output is escaped by default and not all entities are encoded. I...
[ "Save", "a", "DOM", "into", "a", "given", "file", "as", "HTML5", "." ]
4ea8caf5b2618a82ca5061dcbb7421b31065c1c7
https://github.com/PHPPowertools/HTML5/blob/4ea8caf5b2618a82ca5061dcbb7421b31065c1c7/src/PowerTools/HTML5.php#L267-L284
21,693
PHPPowertools/HTML5
src/PowerTools/HTML5.php
HTML5.saveHTML
public function saveHTML($dom, $options = array()) { $stream = fopen('php://temp', 'w'); $this->save($dom, $stream, array_merge($this->getOptions(), $options)); return stream_get_contents($stream, - 1, 0); }
php
public function saveHTML($dom, $options = array()) { $stream = fopen('php://temp', 'w'); $this->save($dom, $stream, array_merge($this->getOptions(), $options)); return stream_get_contents($stream, - 1, 0); }
[ "public", "function", "saveHTML", "(", "$", "dom", ",", "$", "options", "=", "array", "(", ")", ")", "{", "$", "stream", "=", "fopen", "(", "'php://temp'", ",", "'w'", ")", ";", "$", "this", "->", "save", "(", "$", "dom", ",", "$", "stream", ",",...
Convert a DOM into an HTML5 string. @param mixed $dom The DOM to be serialized. @param array $options Configuration options when serializing the DOM. These include: - encode_entities: Text written to the output is escaped by default and not all entities are encoded. If this is set to true all entities will be encoded....
[ "Convert", "a", "DOM", "into", "an", "HTML5", "string", "." ]
4ea8caf5b2618a82ca5061dcbb7421b31065c1c7
https://github.com/PHPPowertools/HTML5/blob/4ea8caf5b2618a82ca5061dcbb7421b31065c1c7/src/PowerTools/HTML5.php#L299-L304
21,694
Erdiko/core
src/Logger.php
Logger.interpolate
function interpolate($message, array $context = array()) { // build a replacement array with braces around the context keys $replace = array(); foreach ($context as $key => $val) { if ($key == "exception" && $val instanceof \Exception) { $replace['{' . $key . '}']...
php
function interpolate($message, array $context = array()) { // build a replacement array with braces around the context keys $replace = array(); foreach ($context as $key => $val) { if ($key == "exception" && $val instanceof \Exception) { $replace['{' . $key . '}']...
[ "function", "interpolate", "(", "$", "message", ",", "array", "$", "context", "=", "array", "(", ")", ")", "{", "// build a replacement array with braces around the context keys", "$", "replace", "=", "array", "(", ")", ";", "foreach", "(", "$", "context", "as",...
Implementation of Placeholder Interpolation The message MAY contain placeholders which implementors MAY replace with values from the context array. Placeholder names MUST correspond to keys in the context array. @param string $message or an object with a __toString() method @param array $context replacement values for...
[ "Implementation", "of", "Placeholder", "Interpolation", "The", "message", "MAY", "contain", "placeholders", "which", "implementors", "MAY", "replace", "with", "values", "from", "the", "context", "array", ".", "Placeholder", "names", "MUST", "correspond", "to", "keys...
c7947ee973b0ad2fd05a6d1d8ce45696618c8fa6
https://github.com/Erdiko/core/blob/c7947ee973b0ad2fd05a6d1d8ce45696618c8fa6/src/Logger.php#L115-L129
21,695
Erdiko/core
src/Logger.php
Logger.addLogFile
public function addLogFile($key, $logFileName) { $arrayKey=strtolower($key); return $this->_logFiles[$arrayKey] = $logFileName; }
php
public function addLogFile($key, $logFileName) { $arrayKey=strtolower($key); return $this->_logFiles[$arrayKey] = $logFileName; }
[ "public", "function", "addLogFile", "(", "$", "key", ",", "$", "logFileName", ")", "{", "$", "arrayKey", "=", "strtolower", "(", "$", "key", ")", ";", "return", "$", "this", "->", "_logFiles", "[", "$", "arrayKey", "]", "=", "$", "logFileName", ";", ...
Add log file Valid if multiple log files exist @param mixed $key @param string $logFileName @return bool
[ "Add", "log", "file", "Valid", "if", "multiple", "log", "files", "exist" ]
c7947ee973b0ad2fd05a6d1d8ce45696618c8fa6
https://github.com/Erdiko/core/blob/c7947ee973b0ad2fd05a6d1d8ce45696618c8fa6/src/Logger.php#L139-L143
21,696
mothership-ec/composer
src/Composer/Command/HomeCommand.php
HomeCommand.getPackage
protected function getPackage(RepositoryInterface $repos, $name) { $name = strtolower($name); $pool = new Pool('dev'); $pool->addRepository($repos); $matches = $pool->whatProvides($name); foreach ($matches as $index => $package) { // skip providers/replacers ...
php
protected function getPackage(RepositoryInterface $repos, $name) { $name = strtolower($name); $pool = new Pool('dev'); $pool->addRepository($repos); $matches = $pool->whatProvides($name); foreach ($matches as $index => $package) { // skip providers/replacers ...
[ "protected", "function", "getPackage", "(", "RepositoryInterface", "$", "repos", ",", "$", "name", ")", "{", "$", "name", "=", "strtolower", "(", "$", "name", ")", ";", "$", "pool", "=", "new", "Pool", "(", "'dev'", ")", ";", "$", "pool", "->", "addR...
finds a package by name @param RepositoryInterface $repos @param string $name @return CompletePackageInterface
[ "finds", "a", "package", "by", "name" ]
fa6ad031a939d8d33b211e428fdbdd28cfce238c
https://github.com/mothership-ec/composer/blob/fa6ad031a939d8d33b211e428fdbdd28cfce238c/src/Composer/Command/HomeCommand.php#L109-L125
21,697
mothership-ec/composer
src/Composer/Command/HomeCommand.php
HomeCommand.openBrowser
private function openBrowser($url) { $url = ProcessExecutor::escape($url); if (defined('PHP_WINDOWS_VERSION_MAJOR')) { return passthru('start "web" explorer "' . $url . '"'); } passthru('which xdg-open', $linux); passthru('which open', $osx); if (0 === ...
php
private function openBrowser($url) { $url = ProcessExecutor::escape($url); if (defined('PHP_WINDOWS_VERSION_MAJOR')) { return passthru('start "web" explorer "' . $url . '"'); } passthru('which xdg-open', $linux); passthru('which open', $osx); if (0 === ...
[ "private", "function", "openBrowser", "(", "$", "url", ")", "{", "$", "url", "=", "ProcessExecutor", "::", "escape", "(", "$", "url", ")", ";", "if", "(", "defined", "(", "'PHP_WINDOWS_VERSION_MAJOR'", ")", ")", "{", "return", "passthru", "(", "'start \"we...
opens a url in your system default browser @param string $url
[ "opens", "a", "url", "in", "your", "system", "default", "browser" ]
fa6ad031a939d8d33b211e428fdbdd28cfce238c
https://github.com/mothership-ec/composer/blob/fa6ad031a939d8d33b211e428fdbdd28cfce238c/src/Composer/Command/HomeCommand.php#L132-L150
21,698
Baachi/CouchDB
src/CouchDB/DesignDocument/Result.php
Result.getFirstRow
public function getFirstRow() { $rows = $this->data['rows']; if (empty($rows)) { return false; } $row = array_slice($rows, 0, 1); return current($row); }
php
public function getFirstRow() { $rows = $this->data['rows']; if (empty($rows)) { return false; } $row = array_slice($rows, 0, 1); return current($row); }
[ "public", "function", "getFirstRow", "(", ")", "{", "$", "rows", "=", "$", "this", "->", "data", "[", "'rows'", "]", ";", "if", "(", "empty", "(", "$", "rows", ")", ")", "{", "return", "false", ";", "}", "$", "row", "=", "array_slice", "(", "$", ...
Return the first row. @return bool|array
[ "Return", "the", "first", "row", "." ]
6be364c2f3d9c7b1288b1c11115469c91819ff5c
https://github.com/Baachi/CouchDB/blob/6be364c2f3d9c7b1288b1c11115469c91819ff5c/src/CouchDB/DesignDocument/Result.php#L60-L70
21,699
Baachi/CouchDB
src/CouchDB/DesignDocument/Result.php
Result.getLastRow
public function getLastRow() { $rows = $this->data['rows']; if (empty($rows)) { return false; } $row = array_slice($rows, count($rows) - 1); return current($row); }
php
public function getLastRow() { $rows = $this->data['rows']; if (empty($rows)) { return false; } $row = array_slice($rows, count($rows) - 1); return current($row); }
[ "public", "function", "getLastRow", "(", ")", "{", "$", "rows", "=", "$", "this", "->", "data", "[", "'rows'", "]", ";", "if", "(", "empty", "(", "$", "rows", ")", ")", "{", "return", "false", ";", "}", "$", "row", "=", "array_slice", "(", "$", ...
Return the last row. @return bool|array
[ "Return", "the", "last", "row", "." ]
6be364c2f3d9c7b1288b1c11115469c91819ff5c
https://github.com/Baachi/CouchDB/blob/6be364c2f3d9c7b1288b1c11115469c91819ff5c/src/CouchDB/DesignDocument/Result.php#L77-L87