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
partition
stringclasses
1 value
SpoonX/SxBootstrap
src/SxBootstrap/View/Helper/Bootstrap/NavigationMenu.php
NavigationMenu.renderDropDownMenu
public function renderDropDownMenu($container = null, array $options = array()) { $menu = $this->getNavigationMenu()->renderMenu($container, $options); $query = new Query($menu, strtolower(mb_detect_encoding($menu))); $uls = $query->execute('li>ul'); /** @var \DOMElement $ul */ ...
php
public function renderDropDownMenu($container = null, array $options = array()) { $menu = $this->getNavigationMenu()->renderMenu($container, $options); $query = new Query($menu, strtolower(mb_detect_encoding($menu))); $uls = $query->execute('li>ul'); /** @var \DOMElement $ul */ ...
[ "public", "function", "renderDropDownMenu", "(", "$", "container", "=", "null", ",", "array", "$", "options", "=", "array", "(", ")", ")", "{", "$", "menu", "=", "$", "this", "->", "getNavigationMenu", "(", ")", "->", "renderMenu", "(", "$", "container",...
Render a dropdown menu @param string|\SpiffyNavigation\Container|null $container @param array $options @return string
[ "Render", "a", "dropdown", "menu" ]
768b02e3b65f7dfe560e821cb0ff41ad3f86b3b6
https://github.com/SpoonX/SxBootstrap/blob/768b02e3b65f7dfe560e821cb0ff41ad3f86b3b6/src/SxBootstrap/View/Helper/Bootstrap/NavigationMenu.php#L37-L66
train
SpoonX/SxBootstrap
src/SxBootstrap/View/Helper/Bootstrap/NavigationMenu.php
NavigationMenu.addCss
protected function addCss($css, \DOMElement $el) { $el->setAttribute( 'class', $el->getAttribute('class') ? $el->getAttribute('class') . ' ' . $css : $css ); return $el; }
php
protected function addCss($css, \DOMElement $el) { $el->setAttribute( 'class', $el->getAttribute('class') ? $el->getAttribute('class') . ' ' . $css : $css ); return $el; }
[ "protected", "function", "addCss", "(", "$", "css", ",", "\\", "DOMElement", "$", "el", ")", "{", "$", "el", "->", "setAttribute", "(", "'class'", ",", "$", "el", "->", "getAttribute", "(", "'class'", ")", "?", "$", "el", "->", "getAttribute", "(", "...
Add css to a DomElement @param $css @param \DOMElement $el @return \DOMElement
[ "Add", "css", "to", "a", "DomElement" ]
768b02e3b65f7dfe560e821cb0ff41ad3f86b3b6
https://github.com/SpoonX/SxBootstrap/blob/768b02e3b65f7dfe560e821cb0ff41ad3f86b3b6/src/SxBootstrap/View/Helper/Bootstrap/NavigationMenu.php#L75-L85
train
Nextpertise/PdoBulk
src/PdoBulk/PdoBulk.php
PdoBulk.flushQueue
public function flushQueue($table, $onduplicate = null) { if (gettype($table) != 'string') { throw new Exception('First parameter should be string, ' . gettype($table) . ' given.'); } if (isset($this->queue[$table]) && $this->queue[$table]) { // Define query $query = "INSERT INTO `" . $table . "` (`" . i...
php
public function flushQueue($table, $onduplicate = null) { if (gettype($table) != 'string') { throw new Exception('First parameter should be string, ' . gettype($table) . ' given.'); } if (isset($this->queue[$table]) && $this->queue[$table]) { // Define query $query = "INSERT INTO `" . $table . "` (`" . i...
[ "public", "function", "flushQueue", "(", "$", "table", ",", "$", "onduplicate", "=", "null", ")", "{", "if", "(", "gettype", "(", "$", "table", ")", "!=", "'string'", ")", "{", "throw", "new", "Exception", "(", "'First parameter should be string, '", ".", ...
Bulk insert logic
[ "Bulk", "insert", "logic" ]
21426f998fe292c11c356e75ffa6f716e2c507c7
https://github.com/Nextpertise/PdoBulk/blob/21426f998fe292c11c356e75ffa6f716e2c507c7/src/PdoBulk/PdoBulk.php#L31-L81
train
chilimatic/chilimatic-framework
lib/cache/engine/Memcached.php
Memcached.deleteFromList
public function deleteFromList($key_array = array()) { if (empty($key_array)) return false; foreach ($key_array as $key_del) { if (empty($this->cacheListing)) break; foreach ($this->cacheListing as $key) { if (mb_strpos(mb_strtolower($key), mb_strtolower($ke...
php
public function deleteFromList($key_array = array()) { if (empty($key_array)) return false; foreach ($key_array as $key_del) { if (empty($this->cacheListing)) break; foreach ($this->cacheListing as $key) { if (mb_strpos(mb_strtolower($key), mb_strtolower($ke...
[ "public", "function", "deleteFromList", "(", "$", "key_array", "=", "array", "(", ")", ")", "{", "if", "(", "empty", "(", "$", "key_array", ")", ")", "return", "false", ";", "foreach", "(", "$", "key_array", "as", "$", "key_del", ")", "{", "if", "(",...
delete memcached values based on an input array @param array $key_array @return bool
[ "delete", "memcached", "values", "based", "on", "an", "input", "array" ]
8df7f12e75d75d3fd2197a58c80d39cbb4b9ff12
https://github.com/chilimatic/chilimatic-framework/blob/8df7f12e75d75d3fd2197a58c80d39cbb4b9ff12/lib/cache/engine/Memcached.php#L256-L269
train
gbprod/doctrine-specification
src/DoctrineSpecification/Handler.php
Handler.handle
public function handle(Specification $spec) { $factory = $this->registry->getFactory($spec); return $factory->create($spec, $this->qb); }
php
public function handle(Specification $spec) { $factory = $this->registry->getFactory($spec); return $factory->create($spec, $this->qb); }
[ "public", "function", "handle", "(", "Specification", "$", "spec", ")", "{", "$", "factory", "=", "$", "this", "->", "registry", "->", "getFactory", "(", "$", "spec", ")", ";", "return", "$", "factory", "->", "create", "(", "$", "spec", ",", "$", "th...
handle specification for queryfactory @param Specification $spec @return Base
[ "handle", "specification", "for", "queryfactory" ]
348e8ec31547f4949a193d21b3a1d5cdb48b23cb
https://github.com/gbprod/doctrine-specification/blob/348e8ec31547f4949a193d21b3a1d5cdb48b23cb/src/DoctrineSpecification/Handler.php#L56-L61
train
WolfMicrosystems/ldap
src/WMS/Library/Ldap/Enum/AbstractEnum.php
AbstractEnum.isValid
public static function isValid($value) { if (__CLASS__ === get_called_class()) { throw new \RuntimeException('Cannot call isValid() on ' . __CLASS__); } $reflectionClass = new \ReflectionClass(get_called_class()); $validValues = $reflectionClass->getConstants(); ...
php
public static function isValid($value) { if (__CLASS__ === get_called_class()) { throw new \RuntimeException('Cannot call isValid() on ' . __CLASS__); } $reflectionClass = new \ReflectionClass(get_called_class()); $validValues = $reflectionClass->getConstants(); ...
[ "public", "static", "function", "isValid", "(", "$", "value", ")", "{", "if", "(", "__CLASS__", "===", "get_called_class", "(", ")", ")", "{", "throw", "new", "\\", "RuntimeException", "(", "'Cannot call isValid() on '", ".", "__CLASS__", ")", ";", "}", "$",...
Checks if the value is valid according to the enumeration. @param mixed $value @return bool @throws \RuntimeException
[ "Checks", "if", "the", "value", "is", "valid", "according", "to", "the", "enumeration", "." ]
872bbdc6127a41f0c51f2aa73425b8063a5c8148
https://github.com/WolfMicrosystems/ldap/blob/872bbdc6127a41f0c51f2aa73425b8063a5c8148/src/WMS/Library/Ldap/Enum/AbstractEnum.php#L28-L48
train
spiral/views
src/ViewSource.php
ViewSource.withCode
public function withCode(string $code): ViewSource { $context = clone $this; $context->code = $code; return $context; }
php
public function withCode(string $code): ViewSource { $context = clone $this; $context->code = $code; return $context; }
[ "public", "function", "withCode", "(", "string", "$", "code", ")", ":", "ViewSource", "{", "$", "context", "=", "clone", "$", "this", ";", "$", "context", "->", "code", "=", "$", "code", ";", "return", "$", "context", ";", "}" ]
Get source copy with redefined code. @param string $code @return self
[ "Get", "source", "copy", "with", "redefined", "code", "." ]
0e35697204dfffabf71546d20e89f14b50414a9a
https://github.com/spiral/views/blob/0e35697204dfffabf71546d20e89f14b50414a9a/src/ViewSource.php#L87-L93
train
g4code/http
src/Response.php
Response.setRedirect
public function setRedirect($url, $code = 302) { $this->canSendHeaders(true); $this->setHeader('Location', $url, true) ->setHttpResponseCode($code); return $this; }
php
public function setRedirect($url, $code = 302) { $this->canSendHeaders(true); $this->setHeader('Location', $url, true) ->setHttpResponseCode($code); return $this; }
[ "public", "function", "setRedirect", "(", "$", "url", ",", "$", "code", "=", "302", ")", "{", "$", "this", "->", "canSendHeaders", "(", "true", ")", ";", "$", "this", "->", "setHeader", "(", "'Location'", ",", "$", "url", ",", "true", ")", "->", "s...
Set redirect URL Sets Location header and response code. Forces replacement of any prior redirects. @param string $url @param int $code @return \G4\Http\Response
[ "Set", "redirect", "URL" ]
270a6b30d49a3656aea6d85e400f18293427926e
https://github.com/g4code/http/blob/270a6b30d49a3656aea6d85e400f18293427926e/src/Response.php#L146-L153
train
g4code/http
src/Response.php
Response.sendHeaders
public function sendHeaders() { // Only check if we can send headers if we have headers to send if (count($this->_headersRaw) || count($this->_headers) || (200 != $this->_httpResponseCode)) { $this->canSendHeaders(true); } elseif (200 == $this->_httpResponseCode) { //...
php
public function sendHeaders() { // Only check if we can send headers if we have headers to send if (count($this->_headersRaw) || count($this->_headers) || (200 != $this->_httpResponseCode)) { $this->canSendHeaders(true); } elseif (200 == $this->_httpResponseCode) { //...
[ "public", "function", "sendHeaders", "(", ")", "{", "// Only check if we can send headers if we have headers to send", "if", "(", "count", "(", "$", "this", "->", "_headersRaw", ")", "||", "count", "(", "$", "this", "->", "_headers", ")", "||", "(", "200", "!=",...
Send all headers Sends any headers specified. If an {@link setHttpResponseCode() HTTP response code} has been specified, it is sent with the first header. @return \G4\Http\Response
[ "Send", "all", "headers" ]
270a6b30d49a3656aea6d85e400f18293427926e
https://github.com/g4code/http/blob/270a6b30d49a3656aea6d85e400f18293427926e/src/Response.php#L289-L325
train
g4code/http
src/Response.php
Response.setBody
public function setBody($content, $name = null) { if ((null === $name) || !is_string($name)) { $this->_body = array('default' => (string) $content); } else { $this->_body[$name] = (string) $content; } return $this; }
php
public function setBody($content, $name = null) { if ((null === $name) || !is_string($name)) { $this->_body = array('default' => (string) $content); } else { $this->_body[$name] = (string) $content; } return $this; }
[ "public", "function", "setBody", "(", "$", "content", ",", "$", "name", "=", "null", ")", "{", "if", "(", "(", "null", "===", "$", "name", ")", "||", "!", "is_string", "(", "$", "name", ")", ")", "{", "$", "this", "->", "_body", "=", "array", "...
Set body content If $name is not passed, or is not a string, resets the entire body and sets the 'default' key to $content. If $name is a string, sets the named segment in the body array to $content. @param string $content @param null|string $name @return \G4\Http\Response
[ "Set", "body", "content" ]
270a6b30d49a3656aea6d85e400f18293427926e
https://github.com/g4code/http/blob/270a6b30d49a3656aea6d85e400f18293427926e/src/Response.php#L340-L349
train
g4code/http
src/Response.php
Response.appendBody
public function appendBody($content, $name = null) { if ((null === $name) || !is_string($name)) { if (isset($this->_body['default'])) { $this->_body['default'] .= (string) $content; } else { return $this->append('default', $content); } ...
php
public function appendBody($content, $name = null) { if ((null === $name) || !is_string($name)) { if (isset($this->_body['default'])) { $this->_body['default'] .= (string) $content; } else { return $this->append('default', $content); } ...
[ "public", "function", "appendBody", "(", "$", "content", ",", "$", "name", "=", "null", ")", "{", "if", "(", "(", "null", "===", "$", "name", ")", "||", "!", "is_string", "(", "$", "name", ")", ")", "{", "if", "(", "isset", "(", "$", "this", "-...
Append content to the body content @param string $content @param null|string $name @return \G4\Http\Response
[ "Append", "content", "to", "the", "body", "content" ]
270a6b30d49a3656aea6d85e400f18293427926e
https://github.com/g4code/http/blob/270a6b30d49a3656aea6d85e400f18293427926e/src/Response.php#L358-L373
train
g4code/http
src/Response.php
Response.clearBody
public function clearBody($name = null) { if (null !== $name) { $name = (string) $name; if (isset($this->_body[$name])) { unset($this->_body[$name]); return true; } return false; } $this->_body = array(); ...
php
public function clearBody($name = null) { if (null !== $name) { $name = (string) $name; if (isset($this->_body[$name])) { unset($this->_body[$name]); return true; } return false; } $this->_body = array(); ...
[ "public", "function", "clearBody", "(", "$", "name", "=", "null", ")", "{", "if", "(", "null", "!==", "$", "name", ")", "{", "$", "name", "=", "(", "string", ")", "$", "name", ";", "if", "(", "isset", "(", "$", "this", "->", "_body", "[", "$", ...
Clear body array With no arguments, clears the entire body array. Given a $name, clears just that named segment; if no segment matching $name exists, returns false to indicate an error. @param string $name Named segment to clear @return boolean
[ "Clear", "body", "array" ]
270a6b30d49a3656aea6d85e400f18293427926e
https://github.com/g4code/http/blob/270a6b30d49a3656aea6d85e400f18293427926e/src/Response.php#L385-L399
train
g4code/http
src/Response.php
Response.append
public function append($name, $content) { if (!is_string($name)) { throw new \Exception('Invalid body segment key ("' . gettype($name) . '")'); } if (isset($this->_body[$name])) { unset($this->_body[$name]); } $this->_body[$name] = (string) $content;...
php
public function append($name, $content) { if (!is_string($name)) { throw new \Exception('Invalid body segment key ("' . gettype($name) . '")'); } if (isset($this->_body[$name])) { unset($this->_body[$name]); } $this->_body[$name] = (string) $content;...
[ "public", "function", "append", "(", "$", "name", ",", "$", "content", ")", "{", "if", "(", "!", "is_string", "(", "$", "name", ")", ")", "{", "throw", "new", "\\", "Exception", "(", "'Invalid body segment key (\"'", ".", "gettype", "(", "$", "name", "...
Append a named body segment to the body content array If segment already exists, replaces with $content and places at end of array. @param string $name @param string $content @return \G4\Http\Response
[ "Append", "a", "named", "body", "segment", "to", "the", "body", "content", "array" ]
270a6b30d49a3656aea6d85e400f18293427926e
https://github.com/g4code/http/blob/270a6b30d49a3656aea6d85e400f18293427926e/src/Response.php#L437-L449
train
g4code/http
src/Response.php
Response.insert
public function insert($name, $content, $parent = null, $before = false) { if (!is_string($name)) { throw new \Exception('Invalid body segment key ("' . gettype($name) . '")'); } if ((null !== $parent) && !is_string($parent)) { throw new \Exception('Invalid body segm...
php
public function insert($name, $content, $parent = null, $before = false) { if (!is_string($name)) { throw new \Exception('Invalid body segment key ("' . gettype($name) . '")'); } if ((null !== $parent) && !is_string($parent)) { throw new \Exception('Invalid body segm...
[ "public", "function", "insert", "(", "$", "name", ",", "$", "content", ",", "$", "parent", "=", "null", ",", "$", "before", "=", "false", ")", "{", "if", "(", "!", "is_string", "(", "$", "name", ")", ")", "{", "throw", "new", "\\", "Exception", "...
Insert a named segment into the body content array @param string $name @param string $content @param string $parent @param boolean $before Whether to insert the new segment before or after the parent. Defaults to false (after) @return \G4\Http\Response
[ "Insert", "a", "named", "segment", "into", "the", "body", "content", "array" ]
270a6b30d49a3656aea6d85e400f18293427926e
https://github.com/g4code/http/blob/270a6b30d49a3656aea6d85e400f18293427926e/src/Response.php#L487-L527
train
g4code/http
src/Response.php
Response.hasExceptionOfType
public function hasExceptionOfType($type) { foreach ($this->_exceptions as $e) { if ($e instanceof $type) { return true; } } return false; }
php
public function hasExceptionOfType($type) { foreach ($this->_exceptions as $e) { if ($e instanceof $type) { return true; } } return false; }
[ "public", "function", "hasExceptionOfType", "(", "$", "type", ")", "{", "foreach", "(", "$", "this", "->", "_exceptions", "as", "$", "e", ")", "{", "if", "(", "$", "e", "instanceof", "$", "type", ")", "{", "return", "true", ";", "}", "}", "return", ...
Does the response object contain an exception of a given type? @param string $type @return boolean
[ "Does", "the", "response", "object", "contain", "an", "exception", "of", "a", "given", "type?" ]
270a6b30d49a3656aea6d85e400f18293427926e
https://github.com/g4code/http/blob/270a6b30d49a3656aea6d85e400f18293427926e/src/Response.php#L578-L587
train
g4code/http
src/Response.php
Response.hasExceptionOfMessage
public function hasExceptionOfMessage($message) { foreach ($this->_exceptions as $e) { if ($message == $e->getMessage()) { return true; } } return false; }
php
public function hasExceptionOfMessage($message) { foreach ($this->_exceptions as $e) { if ($message == $e->getMessage()) { return true; } } return false; }
[ "public", "function", "hasExceptionOfMessage", "(", "$", "message", ")", "{", "foreach", "(", "$", "this", "->", "_exceptions", "as", "$", "e", ")", "{", "if", "(", "$", "message", "==", "$", "e", "->", "getMessage", "(", ")", ")", "{", "return", "tr...
Does the response object contain an exception with a given message? @param string $message @return boolean
[ "Does", "the", "response", "object", "contain", "an", "exception", "with", "a", "given", "message?" ]
270a6b30d49a3656aea6d85e400f18293427926e
https://github.com/g4code/http/blob/270a6b30d49a3656aea6d85e400f18293427926e/src/Response.php#L595-L604
train
g4code/http
src/Response.php
Response.hasExceptionOfCode
public function hasExceptionOfCode($code) { $code = (int) $code; foreach ($this->_exceptions as $e) { if ($code == $e->getCode()) { return true; } } return false; }
php
public function hasExceptionOfCode($code) { $code = (int) $code; foreach ($this->_exceptions as $e) { if ($code == $e->getCode()) { return true; } } return false; }
[ "public", "function", "hasExceptionOfCode", "(", "$", "code", ")", "{", "$", "code", "=", "(", "int", ")", "$", "code", ";", "foreach", "(", "$", "this", "->", "_exceptions", "as", "$", "e", ")", "{", "if", "(", "$", "code", "==", "$", "e", "->",...
Does the response object contain an exception with a given code? @param int $code @return boolean
[ "Does", "the", "response", "object", "contain", "an", "exception", "with", "a", "given", "code?" ]
270a6b30d49a3656aea6d85e400f18293427926e
https://github.com/g4code/http/blob/270a6b30d49a3656aea6d85e400f18293427926e/src/Response.php#L612-L622
train
g4code/http
src/Response.php
Response.getExceptionByType
public function getExceptionByType($type) { $exceptions = array(); foreach ($this->_exceptions as $e) { if ($e instanceof $type) { $exceptions[] = $e; } } if (empty($exceptions)) { $exceptions = false; } return $ex...
php
public function getExceptionByType($type) { $exceptions = array(); foreach ($this->_exceptions as $e) { if ($e instanceof $type) { $exceptions[] = $e; } } if (empty($exceptions)) { $exceptions = false; } return $ex...
[ "public", "function", "getExceptionByType", "(", "$", "type", ")", "{", "$", "exceptions", "=", "array", "(", ")", ";", "foreach", "(", "$", "this", "->", "_exceptions", "as", "$", "e", ")", "{", "if", "(", "$", "e", "instanceof", "$", "type", ")", ...
Retrieve all exceptions of a given type @param string $type @return false|array
[ "Retrieve", "all", "exceptions", "of", "a", "given", "type" ]
270a6b30d49a3656aea6d85e400f18293427926e
https://github.com/g4code/http/blob/270a6b30d49a3656aea6d85e400f18293427926e/src/Response.php#L630-L644
train
g4code/http
src/Response.php
Response.getExceptionByMessage
public function getExceptionByMessage($message) { $exceptions = array(); foreach ($this->_exceptions as $e) { if ($message == $e->getMessage()) { $exceptions[] = $e; } } if (empty($exceptions)) { $exceptions = false; } ...
php
public function getExceptionByMessage($message) { $exceptions = array(); foreach ($this->_exceptions as $e) { if ($message == $e->getMessage()) { $exceptions[] = $e; } } if (empty($exceptions)) { $exceptions = false; } ...
[ "public", "function", "getExceptionByMessage", "(", "$", "message", ")", "{", "$", "exceptions", "=", "array", "(", ")", ";", "foreach", "(", "$", "this", "->", "_exceptions", "as", "$", "e", ")", "{", "if", "(", "$", "message", "==", "$", "e", "->",...
Retrieve all exceptions of a given message @param string $message @return false|array
[ "Retrieve", "all", "exceptions", "of", "a", "given", "message" ]
270a6b30d49a3656aea6d85e400f18293427926e
https://github.com/g4code/http/blob/270a6b30d49a3656aea6d85e400f18293427926e/src/Response.php#L652-L666
train
g4code/http
src/Response.php
Response.getExceptionByCode
public function getExceptionByCode($code) { $code = (int) $code; $exceptions = array(); foreach ($this->_exceptions as $e) { if ($code == $e->getCode()) { $exceptions[] = $e; } } if (empty($exceptions)) { $exceptions ...
php
public function getExceptionByCode($code) { $code = (int) $code; $exceptions = array(); foreach ($this->_exceptions as $e) { if ($code == $e->getCode()) { $exceptions[] = $e; } } if (empty($exceptions)) { $exceptions ...
[ "public", "function", "getExceptionByCode", "(", "$", "code", ")", "{", "$", "code", "=", "(", "int", ")", "$", "code", ";", "$", "exceptions", "=", "array", "(", ")", ";", "foreach", "(", "$", "this", "->", "_exceptions", "as", "$", "e", ")", "{",...
Retrieve all exceptions of a given code @param mixed $code @return void
[ "Retrieve", "all", "exceptions", "of", "a", "given", "code" ]
270a6b30d49a3656aea6d85e400f18293427926e
https://github.com/g4code/http/blob/270a6b30d49a3656aea6d85e400f18293427926e/src/Response.php#L674-L689
train
g4code/http
src/Response.php
Response.sendResponse
public function sendResponse() { $this->sendHeaders(); if ($this->isException() && $this->renderExceptions()) { $exceptions = ''; foreach ($this->getException() as $e) { $exceptions .= $e->__toString() . "\n"; } ech...
php
public function sendResponse() { $this->sendHeaders(); if ($this->isException() && $this->renderExceptions()) { $exceptions = ''; foreach ($this->getException() as $e) { $exceptions .= $e->__toString() . "\n"; } ech...
[ "public", "function", "sendResponse", "(", ")", "{", "$", "this", "->", "sendHeaders", "(", ")", ";", "if", "(", "$", "this", "->", "isException", "(", ")", "&&", "$", "this", "->", "renderExceptions", "(", ")", ")", "{", "$", "exceptions", "=", "''"...
Send the response, including all headers, rendering exceptions if so requested. @return void
[ "Send", "the", "response", "including", "all", "headers", "rendering", "exceptions", "if", "so", "requested", "." ]
270a6b30d49a3656aea6d85e400f18293427926e
https://github.com/g4code/http/blob/270a6b30d49a3656aea6d85e400f18293427926e/src/Response.php#L716-L732
train
Fuzzyma/contao-eloquent-bundle
Traits/ContaoFilesModelTrait.php
ContaoFilesModelTrait.getContaoFile
private function getContaoFile($uuid) { $uuid = StringUtil::deserialize($uuid); if (is_array($uuid)) return FilesModel::findMultipleByUuids($uuid); return FilesModel::findByUuid($uuid); }
php
private function getContaoFile($uuid) { $uuid = StringUtil::deserialize($uuid); if (is_array($uuid)) return FilesModel::findMultipleByUuids($uuid); return FilesModel::findByUuid($uuid); }
[ "private", "function", "getContaoFile", "(", "$", "uuid", ")", "{", "$", "uuid", "=", "StringUtil", "::", "deserialize", "(", "$", "uuid", ")", ";", "if", "(", "is_array", "(", "$", "uuid", ")", ")", "return", "FilesModel", "::", "findMultipleByUuids", "...
Always return a contao file model since its more suitable when working with contao
[ "Always", "return", "a", "contao", "file", "model", "since", "its", "more", "suitable", "when", "working", "with", "contao" ]
d5af2a3f48807db278ec3c92df463171f9514179
https://github.com/Fuzzyma/contao-eloquent-bundle/blob/d5af2a3f48807db278ec3c92df463171f9514179/Traits/ContaoFilesModelTrait.php#L19-L25
train
Fuzzyma/contao-eloquent-bundle
Traits/ContaoFilesModelTrait.php
ContaoFilesModelTrait.setContaoFile
private function setContaoFile($file) { if (is_array($file)) { return serialize(array_map([__CLASS__, 'setContaoFile'], $file)); } if ($file instanceof FilesModel) { return $file->uuid; } if (Validator::isStringUuid($file)) { return String...
php
private function setContaoFile($file) { if (is_array($file)) { return serialize(array_map([__CLASS__, 'setContaoFile'], $file)); } if ($file instanceof FilesModel) { return $file->uuid; } if (Validator::isStringUuid($file)) { return String...
[ "private", "function", "setContaoFile", "(", "$", "file", ")", "{", "if", "(", "is_array", "(", "$", "file", ")", ")", "{", "return", "serialize", "(", "array_map", "(", "[", "__CLASS__", ",", "'setContaoFile'", "]", ",", "$", "file", ")", ")", ";", ...
we check if its a file model and extract the uuid. If its a string we convert it.
[ "we", "check", "if", "its", "a", "file", "model", "and", "extract", "the", "uuid", ".", "If", "its", "a", "string", "we", "convert", "it", "." ]
d5af2a3f48807db278ec3c92df463171f9514179
https://github.com/Fuzzyma/contao-eloquent-bundle/blob/d5af2a3f48807db278ec3c92df463171f9514179/Traits/ContaoFilesModelTrait.php#L28-L41
train
octris/sqlbuilder
libs/Sqlbuilder.php
Sqlbuilder.resolveSnippet
public function resolveSnippet($name, array &$parameters) { $name = strtoupper($name); if (isset($this->clauses[$name])) { $snippet = $this->clauses[$name]->resolveClauses($parameters); } elseif (isset($this->snippets[$name])) { $snippet = $this->snippets[$name]; ...
php
public function resolveSnippet($name, array &$parameters) { $name = strtoupper($name); if (isset($this->clauses[$name])) { $snippet = $this->clauses[$name]->resolveClauses($parameters); } elseif (isset($this->snippets[$name])) { $snippet = $this->snippets[$name]; ...
[ "public", "function", "resolveSnippet", "(", "$", "name", ",", "array", "&", "$", "parameters", ")", "{", "$", "name", "=", "strtoupper", "(", "$", "name", ")", ";", "if", "(", "isset", "(", "$", "this", "->", "clauses", "[", "$", "name", "]", ")",...
Resolve template snippet. @param string $name Name of snippet to resolve. @param array $parameters Parameters for resolving snippet. @return array Array of resolved template snippet and parameters.
[ "Resolve", "template", "snippet", "." ]
d22a494fd4814b3245fce20b4076eec1b382ffd3
https://github.com/octris/sqlbuilder/blob/d22a494fd4814b3245fce20b4076eec1b382ffd3/libs/Sqlbuilder.php#L60-L73
train
octris/sqlbuilder
libs/Sqlbuilder.php
Sqlbuilder.resolveParameter
public function resolveParameter($idx, $type, $name) { return $this->dialect->resolveParameter($idx, $type, $name); }
php
public function resolveParameter($idx, $type, $name) { return $this->dialect->resolveParameter($idx, $type, $name); }
[ "public", "function", "resolveParameter", "(", "$", "idx", ",", "$", "type", ",", "$", "name", ")", "{", "return", "$", "this", "->", "dialect", "->", "resolveParameter", "(", "$", "idx", ",", "$", "type", ",", "$", "name", ")", ";", "}" ]
Resolve query parameter. @param int $idx Position of the parameter in the query. @param string $type Type of the parameter. @param string $name Name of the parameter.
[ "Resolve", "query", "parameter", "." ]
d22a494fd4814b3245fce20b4076eec1b382ffd3
https://github.com/octris/sqlbuilder/blob/d22a494fd4814b3245fce20b4076eec1b382ffd3/libs/Sqlbuilder.php#L82-L85
train
octris/sqlbuilder
libs/Sqlbuilder.php
Sqlbuilder.addClause
protected function addClause($name, $sql, array $parameters, $joiner, $prefix = '', $postfix = '', $is_inclusive = false) { $name = strtoupper($name); if (!isset($this->clauses[$name])) { $this->clauses[$name] = new \Octris\Sqlbuilder\Clauses($joiner, $prefix, $postfix); } ...
php
protected function addClause($name, $sql, array $parameters, $joiner, $prefix = '', $postfix = '', $is_inclusive = false) { $name = strtoupper($name); if (!isset($this->clauses[$name])) { $this->clauses[$name] = new \Octris\Sqlbuilder\Clauses($joiner, $prefix, $postfix); } ...
[ "protected", "function", "addClause", "(", "$", "name", ",", "$", "sql", ",", "array", "$", "parameters", ",", "$", "joiner", ",", "$", "prefix", "=", "''", ",", "$", "postfix", "=", "''", ",", "$", "is_inclusive", "=", "false", ")", "{", "$", "nam...
Add clause. @param string $name Name of clause to add. @param string $sql SQL snippet of clause. @param array $parameters Parameters for clause. @param string $joiner String to ...
[ "Add", "clause", "." ]
d22a494fd4814b3245fce20b4076eec1b382ffd3
https://github.com/octris/sqlbuilder/blob/d22a494fd4814b3245fce20b4076eec1b382ffd3/libs/Sqlbuilder.php#L125-L134
train
octris/sqlbuilder
libs/Sqlbuilder.php
Sqlbuilder.addPaging
public function addPaging($limit, $page = 1) { $this->addClause('PAGING', $this->dialect->getLimitString($limit, ($page - 1) * $limit), [], '', '', "\n", false); return $this; }
php
public function addPaging($limit, $page = 1) { $this->addClause('PAGING', $this->dialect->getLimitString($limit, ($page - 1) * $limit), [], '', '', "\n", false); return $this; }
[ "public", "function", "addPaging", "(", "$", "limit", ",", "$", "page", "=", "1", ")", "{", "$", "this", "->", "addClause", "(", "'PAGING'", ",", "$", "this", "->", "dialect", "->", "getLimitString", "(", "$", "limit", ",", "(", "$", "page", "-", "...
Add paging. @param int $limit Limit rows to return. @param int $page Optional page to start querying at. @return \Octris\Sqlbuilder This instance for method chaining.
[ "Add", "paging", "." ]
d22a494fd4814b3245fce20b4076eec1b382ffd3
https://github.com/octris/sqlbuilder/blob/d22a494fd4814b3245fce20b4076eec1b382ffd3/libs/Sqlbuilder.php#L295-L300
train
buse974/Dal
src/Dal/Mapper/AbstractMapper.php
AbstractMapper.requestPdo
public function requestPdo($request, $param = null) { $this->result = $this->tableGateway->requestPdo($request, $param); return $this->result; }
php
public function requestPdo($request, $param = null) { $this->result = $this->tableGateway->requestPdo($request, $param); return $this->result; }
[ "public", "function", "requestPdo", "(", "$", "request", ",", "$", "param", "=", "null", ")", "{", "$", "this", "->", "result", "=", "$", "this", "->", "tableGateway", "->", "requestPdo", "(", "$", "request", ",", "$", "param", ")", ";", "return", "$...
Excecute request directly by PDO. @param string $request @param array $param @return \Dal\Db\ResultSet\ResultSet
[ "Excecute", "request", "directly", "by", "PDO", "." ]
faeac9e260c5e675bc7ed1fcea77c7ba251bf8ab
https://github.com/buse974/Dal/blob/faeac9e260c5e675bc7ed1fcea77c7ba251bf8ab/src/Dal/Mapper/AbstractMapper.php#L74-L79
train
buse974/Dal
src/Dal/Mapper/AbstractMapper.php
AbstractMapper.selectWith
public function selectWith(\Zend\Db\Sql\Select $select) { if ($this->usePaginator === true) { return $this->initPaginator($select); } $this->result = $this->tableGateway->selectWith($select); return $this->result; }
php
public function selectWith(\Zend\Db\Sql\Select $select) { if ($this->usePaginator === true) { return $this->initPaginator($select); } $this->result = $this->tableGateway->selectWith($select); return $this->result; }
[ "public", "function", "selectWith", "(", "\\", "Zend", "\\", "Db", "\\", "Sql", "\\", "Select", "$", "select", ")", "{", "if", "(", "$", "this", "->", "usePaginator", "===", "true", ")", "{", "return", "$", "this", "->", "initPaginator", "(", "$", "s...
Select request. @param \Zend\Db\Sql\Select @return \Zend\Db\ResultSet\ResultSet
[ "Select", "request", "." ]
faeac9e260c5e675bc7ed1fcea77c7ba251bf8ab
https://github.com/buse974/Dal/blob/faeac9e260c5e675bc7ed1fcea77c7ba251bf8ab/src/Dal/Mapper/AbstractMapper.php#L143-L152
train
buse974/Dal
src/Dal/Mapper/AbstractMapper.php
AbstractMapper.fetchAll
public function fetchAll() { if ($this->usePaginator === true) { return $this->initPaginator($this->tableGateway->getSql()->select()); } $this->result = $this->tableGateway->select(); return $this->result; }
php
public function fetchAll() { if ($this->usePaginator === true) { return $this->initPaginator($this->tableGateway->getSql()->select()); } $this->result = $this->tableGateway->select(); return $this->result; }
[ "public", "function", "fetchAll", "(", ")", "{", "if", "(", "$", "this", "->", "usePaginator", "===", "true", ")", "{", "return", "$", "this", "->", "initPaginator", "(", "$", "this", "->", "tableGateway", "->", "getSql", "(", ")", "->", "select", "(",...
Fetch All. @return \Zend\Db\ResultSet\ResultSet
[ "Fetch", "All", "." ]
faeac9e260c5e675bc7ed1fcea77c7ba251bf8ab
https://github.com/buse974/Dal/blob/faeac9e260c5e675bc7ed1fcea77c7ba251bf8ab/src/Dal/Mapper/AbstractMapper.php#L159-L167
train
buse974/Dal
src/Dal/Mapper/AbstractMapper.php
AbstractMapper.deleteWith
public function deleteWith(\Zend\Db\Sql\Delete $delete) { return $this->tableGateway->deleteWith($delete); }
php
public function deleteWith(\Zend\Db\Sql\Delete $delete) { return $this->tableGateway->deleteWith($delete); }
[ "public", "function", "deleteWith", "(", "\\", "Zend", "\\", "Db", "\\", "Sql", "\\", "Delete", "$", "delete", ")", "{", "return", "$", "this", "->", "tableGateway", "->", "deleteWith", "(", "$", "delete", ")", ";", "}" ]
Delete request. @param \Zend\Db\Sql\Delete @return int
[ "Delete", "request", "." ]
faeac9e260c5e675bc7ed1fcea77c7ba251bf8ab
https://github.com/buse974/Dal/blob/faeac9e260c5e675bc7ed1fcea77c7ba251bf8ab/src/Dal/Mapper/AbstractMapper.php#L176-L179
train
buse974/Dal
src/Dal/Mapper/AbstractMapper.php
AbstractMapper.insertWith
public function insertWith(\Zend\Db\Sql\Insert $insert) { return $this->tableGateway->insertWith($insert); }
php
public function insertWith(\Zend\Db\Sql\Insert $insert) { return $this->tableGateway->insertWith($insert); }
[ "public", "function", "insertWith", "(", "\\", "Zend", "\\", "Db", "\\", "Sql", "\\", "Insert", "$", "insert", ")", "{", "return", "$", "this", "->", "tableGateway", "->", "insertWith", "(", "$", "insert", ")", ";", "}" ]
Insert request. @param \Zend\Db\Sql\Insert @return int
[ "Insert", "request", "." ]
faeac9e260c5e675bc7ed1fcea77c7ba251bf8ab
https://github.com/buse974/Dal/blob/faeac9e260c5e675bc7ed1fcea77c7ba251bf8ab/src/Dal/Mapper/AbstractMapper.php#L188-L191
train
buse974/Dal
src/Dal/Mapper/AbstractMapper.php
AbstractMapper.updateWith
public function updateWith(\Zend\Db\Sql\Update $update) { return $this->tableGateway->updateWith($update); }
php
public function updateWith(\Zend\Db\Sql\Update $update) { return $this->tableGateway->updateWith($update); }
[ "public", "function", "updateWith", "(", "\\", "Zend", "\\", "Db", "\\", "Sql", "\\", "Update", "$", "update", ")", "{", "return", "$", "this", "->", "tableGateway", "->", "updateWith", "(", "$", "update", ")", ";", "}" ]
Update request. @param \Zend\Db\Sql\Update @return int
[ "Update", "request", "." ]
faeac9e260c5e675bc7ed1fcea77c7ba251bf8ab
https://github.com/buse974/Dal/blob/faeac9e260c5e675bc7ed1fcea77c7ba251bf8ab/src/Dal/Mapper/AbstractMapper.php#L200-L203
train
buse974/Dal
src/Dal/Mapper/AbstractMapper.php
AbstractMapper.fetchRow
public function fetchRow($column, $value) { $where = array($column, $value); return $this->tableGateway->select($where)->current(); }
php
public function fetchRow($column, $value) { $where = array($column, $value); return $this->tableGateway->select($where)->current(); }
[ "public", "function", "fetchRow", "(", "$", "column", ",", "$", "value", ")", "{", "$", "where", "=", "array", "(", "$", "column", ",", "$", "value", ")", ";", "return", "$", "this", "->", "tableGateway", "->", "select", "(", "$", "where", ")", "->...
Get row. @param string $column @param multitype $value @return \Dal\Model\AbstractModel
[ "Get", "row", "." ]
faeac9e260c5e675bc7ed1fcea77c7ba251bf8ab
https://github.com/buse974/Dal/blob/faeac9e260c5e675bc7ed1fcea77c7ba251bf8ab/src/Dal/Mapper/AbstractMapper.php#L213-L218
train
buse974/Dal
src/Dal/Mapper/AbstractMapper.php
AbstractMapper.delete
public function delete(AbstractModel $model) { $array = $model->toArrayCurrent(); if (empty($array)) { throw new \Exception('Error : delete used an empty model'); } return $this->tableGateway->delete($array); }
php
public function delete(AbstractModel $model) { $array = $model->toArrayCurrent(); if (empty($array)) { throw new \Exception('Error : delete used an empty model'); } return $this->tableGateway->delete($array); }
[ "public", "function", "delete", "(", "AbstractModel", "$", "model", ")", "{", "$", "array", "=", "$", "model", "->", "toArrayCurrent", "(", ")", ";", "if", "(", "empty", "(", "$", "array", ")", ")", "{", "throw", "new", "\\", "Exception", "(", "'Erro...
Delete full modele. @param \Dal\Model\AbstractModel $model @return bool
[ "Delete", "full", "modele", "." ]
faeac9e260c5e675bc7ed1fcea77c7ba251bf8ab
https://github.com/buse974/Dal/blob/faeac9e260c5e675bc7ed1fcea77c7ba251bf8ab/src/Dal/Mapper/AbstractMapper.php#L272-L281
train
buse974/Dal
src/Dal/Mapper/AbstractMapper.php
AbstractMapper.usePaginator
public function usePaginator($options) { if ($options === null) { $this->usePaginator = false; return $this; } $this->usePaginator = true; $this->paginatorOptions['s'] = (isset($options['s'])) ? $options['s'] : null; $this->paginatorOptions['d'] = (...
php
public function usePaginator($options) { if ($options === null) { $this->usePaginator = false; return $this; } $this->usePaginator = true; $this->paginatorOptions['s'] = (isset($options['s'])) ? $options['s'] : null; $this->paginatorOptions['d'] = (...
[ "public", "function", "usePaginator", "(", "$", "options", ")", "{", "if", "(", "$", "options", "===", "null", ")", "{", "$", "this", "->", "usePaginator", "=", "false", ";", "return", "$", "this", ";", "}", "$", "this", "->", "usePaginator", "=", "t...
Set the mapper options and enable the mapper. @param array $options @return AbstractMapper
[ "Set", "the", "mapper", "options", "and", "enable", "the", "mapper", "." ]
faeac9e260c5e675bc7ed1fcea77c7ba251bf8ab
https://github.com/buse974/Dal/blob/faeac9e260c5e675bc7ed1fcea77c7ba251bf8ab/src/Dal/Mapper/AbstractMapper.php#L290-L308
train
buse974/Dal
src/Dal/Mapper/AbstractMapper.php
AbstractMapper.initPaginator
protected function initPaginator($select) { $this->usePaginator = false; $this->paginator = new Paginator( $select, $this->tableGateway->getAdapter(), $this->tableGateway->getResultSetPrototype()); if (isset($this->paginatorOption...
php
protected function initPaginator($select) { $this->usePaginator = false; $this->paginator = new Paginator( $select, $this->tableGateway->getAdapter(), $this->tableGateway->getResultSetPrototype()); if (isset($this->paginatorOption...
[ "protected", "function", "initPaginator", "(", "$", "select", ")", "{", "$", "this", "->", "usePaginator", "=", "false", ";", "$", "this", "->", "paginator", "=", "new", "Paginator", "(", "$", "select", ",", "$", "this", "->", "tableGateway", "->", "getA...
Init the paginator with a select object. @param \Zend\Db\Sql\Select|array $select @return mixed
[ "Init", "the", "paginator", "with", "a", "select", "object", "." ]
faeac9e260c5e675bc7ed1fcea77c7ba251bf8ab
https://github.com/buse974/Dal/blob/faeac9e260c5e675bc7ed1fcea77c7ba251bf8ab/src/Dal/Mapper/AbstractMapper.php#L317-L346
train
buse974/Dal
src/Dal/Mapper/AbstractMapper.php
AbstractMapper.printSql
public function printSql(\Zend\Db\Sql\SqlInterface $request) { return $request->getSqlString($this->tableGateway->getAdapter()->getPlatform()); }
php
public function printSql(\Zend\Db\Sql\SqlInterface $request) { return $request->getSqlString($this->tableGateway->getAdapter()->getPlatform()); }
[ "public", "function", "printSql", "(", "\\", "Zend", "\\", "Db", "\\", "Sql", "\\", "SqlInterface", "$", "request", ")", "{", "return", "$", "request", "->", "getSqlString", "(", "$", "this", "->", "tableGateway", "->", "getAdapter", "(", ")", "->", "get...
Return request sql. @param \Zend\Db\Sql\SqlInterface $request @return string
[ "Return", "request", "sql", "." ]
faeac9e260c5e675bc7ed1fcea77c7ba251bf8ab
https://github.com/buse974/Dal/blob/faeac9e260c5e675bc7ed1fcea77c7ba251bf8ab/src/Dal/Mapper/AbstractMapper.php#L371-L374
train
phpalchemy/phpalchemy
Alchemy/Component/ClassLoader/ClassLoader.php
ClassLoader.register
public function register($namespace, $includePath) { if (array_key_exists($namespace, $this->includePaths)) { throw new \Exception("Error: Namespace '$namespace' is already registered!"); } $this->includePaths[$namespace] = rtrim($includePath, DS) . DS; }
php
public function register($namespace, $includePath) { if (array_key_exists($namespace, $this->includePaths)) { throw new \Exception("Error: Namespace '$namespace' is already registered!"); } $this->includePaths[$namespace] = rtrim($includePath, DS) . DS; }
[ "public", "function", "register", "(", "$", "namespace", ",", "$", "includePath", ")", "{", "if", "(", "array_key_exists", "(", "$", "namespace", ",", "$", "this", "->", "includePaths", ")", ")", "{", "throw", "new", "\\", "Exception", "(", "\"Error: Names...
Register a determinated namespace and its include path to find it. @param string $namespace namespace of a class given @param string $includePath path where the class exists
[ "Register", "a", "determinated", "namespace", "and", "its", "include", "path", "to", "find", "it", "." ]
5b7e9b13acfda38c61b2da2639e8a56f298dc32e
https://github.com/phpalchemy/phpalchemy/blob/5b7e9b13acfda38c61b2da2639e8a56f298dc32e/Alchemy/Component/ClassLoader/ClassLoader.php#L70-L77
train
phpalchemy/phpalchemy
Alchemy/Component/ClassLoader/ClassLoader.php
ClassLoader.registerClass
public function registerClass($className, $includeFile) { if (array_key_exists($className, $this->includePaths)) { throw new \Exception("Error: Class '$className' is already registered!"); } $this->includePaths[$className] = $includeFile; }
php
public function registerClass($className, $includeFile) { if (array_key_exists($className, $this->includePaths)) { throw new \Exception("Error: Class '$className' is already registered!"); } $this->includePaths[$className] = $includeFile; }
[ "public", "function", "registerClass", "(", "$", "className", ",", "$", "includeFile", ")", "{", "if", "(", "array_key_exists", "(", "$", "className", ",", "$", "this", "->", "includePaths", ")", ")", "{", "throw", "new", "\\", "Exception", "(", "\"Error: ...
Register a determinated class to autoloader Example: $classLoader = ClassLoader::getInstance(); $classLoader->registerClass('MyClass', '/classes/class.myclass.php'); This is useful when we want to add autoloading to a class without naming convention and therefore the class name is different of class file, or the clas...
[ "Register", "a", "determinated", "class", "to", "autoloader" ]
5b7e9b13acfda38c61b2da2639e8a56f298dc32e
https://github.com/phpalchemy/phpalchemy/blob/5b7e9b13acfda38c61b2da2639e8a56f298dc32e/Alchemy/Component/ClassLoader/ClassLoader.php#L90-L97
train
honeylex/honeylex
app/lib/Console/Scaffold/SkeletonGenerator.php
SkeletonGenerator.createFolders
protected function createFolders() { foreach ($this->getFolderStructure() as $folder) { $newFolder = $this->twigStringRenderer->renderToString($folder, $this->data); $this->fs->mkdir($this->targetPath.DIRECTORY_SEPARATOR.$newFolder, self::DIRECTORY_MODE); $msg = '[mkdir]...
php
protected function createFolders() { foreach ($this->getFolderStructure() as $folder) { $newFolder = $this->twigStringRenderer->renderToString($folder, $this->data); $this->fs->mkdir($this->targetPath.DIRECTORY_SEPARATOR.$newFolder, self::DIRECTORY_MODE); $msg = '[mkdir]...
[ "protected", "function", "createFolders", "(", ")", "{", "foreach", "(", "$", "this", "->", "getFolderStructure", "(", ")", "as", "$", "folder", ")", "{", "$", "newFolder", "=", "$", "this", "->", "twigStringRenderer", "->", "renderToString", "(", "$", "fo...
Creates all folders specified by getFolderStructure within the target location.
[ "Creates", "all", "folders", "specified", "by", "getFolderStructure", "within", "the", "target", "location", "." ]
ad0a177ec365793a2c3813b948a1750c77ef00c1
https://github.com/honeylex/honeylex/blob/ad0a177ec365793a2c3813b948a1750c77ef00c1/app/lib/Console/Scaffold/SkeletonGenerator.php#L120-L131
train
honeylex/honeylex
app/lib/Console/Scaffold/SkeletonGenerator.php
SkeletonGenerator.copyFiles
protected function copyFiles() { $skeletonFinder = new SkeletonFinder($this->lookupPaths); $sourcePath = $skeletonFinder->findByName($this->skeletonName)->getRealpath(); $finder = $this->getFinderForFilesToCopy($sourcePath); foreach ($finder as $file) { $targetFilePath ...
php
protected function copyFiles() { $skeletonFinder = new SkeletonFinder($this->lookupPaths); $sourcePath = $skeletonFinder->findByName($this->skeletonName)->getRealpath(); $finder = $this->getFinderForFilesToCopy($sourcePath); foreach ($finder as $file) { $targetFilePath ...
[ "protected", "function", "copyFiles", "(", ")", "{", "$", "skeletonFinder", "=", "new", "SkeletonFinder", "(", "$", "this", "->", "lookupPaths", ")", ";", "$", "sourcePath", "=", "$", "skeletonFinder", "->", "findByName", "(", "$", "this", "->", "skeletonNam...
Copies all files from the source location to the target location.
[ "Copies", "all", "files", "from", "the", "source", "location", "to", "the", "target", "location", "." ]
ad0a177ec365793a2c3813b948a1750c77ef00c1
https://github.com/honeylex/honeylex/blob/ad0a177ec365793a2c3813b948a1750c77ef00c1/app/lib/Console/Scaffold/SkeletonGenerator.php#L136-L155
train
honeylex/honeylex
app/lib/Console/Scaffold/SkeletonGenerator.php
SkeletonGenerator.renderTemplates
protected function renderTemplates() { $finder = new Finder; $finder->files()->name('*'.self::TEMPLATE_FILENAME_EXTENSION)->in($this->targetPath); $twigRenderer = TwigRenderer::create( [ 'twig_extensions' => [ new ProjectExtension($this->configProvider) ], ...
php
protected function renderTemplates() { $finder = new Finder; $finder->files()->name('*'.self::TEMPLATE_FILENAME_EXTENSION)->in($this->targetPath); $twigRenderer = TwigRenderer::create( [ 'twig_extensions' => [ new ProjectExtension($this->configProvider) ], ...
[ "protected", "function", "renderTemplates", "(", ")", "{", "$", "finder", "=", "new", "Finder", ";", "$", "finder", "->", "files", "(", ")", "->", "name", "(", "'*'", ".", "self", "::", "TEMPLATE_FILENAME_EXTENSION", ")", "->", "in", "(", "$", "this", ...
Renders all files within the target location whose extension is ".tmpl.twig" onto a file that has the same name without that extension. After the rendering all the ".tmpl.twig" files will be deleted in the target location.
[ "Renders", "all", "files", "within", "the", "target", "location", "whose", "extension", "is", ".", "tmpl", ".", "twig", "onto", "a", "file", "that", "has", "the", "same", "name", "without", "that", "extension", ".", "After", "the", "rendering", "all", "the...
ad0a177ec365793a2c3813b948a1750c77ef00c1
https://github.com/honeylex/honeylex/blob/ad0a177ec365793a2c3813b948a1750c77ef00c1/app/lib/Console/Scaffold/SkeletonGenerator.php#L176-L217
train
bluetree-service/data
src/Calculation/Math.php
Math.end
public static function end($edition, $used, $start, $timeNow) { if (!$used) { return 0; } $end = $edition / ($used / ($timeNow - $start)); $end += $timeNow; return $end; }
php
public static function end($edition, $used, $start, $timeNow) { if (!$used) { return 0; } $end = $edition / ($used / ($timeNow - $start)); $end += $timeNow; return $end; }
[ "public", "static", "function", "end", "(", "$", "edition", ",", "$", "used", ",", "$", "start", ",", "$", "timeNow", ")", "{", "if", "(", "!", "$", "used", ")", "{", "return", "0", ";", "}", "$", "end", "=", "$", "edition", "/", "(", "$", "u...
Estimate time to end, by given current usage value and max value @param float $edition maximum number of value @param float $used how many was used @param integer $start start time in unix timestamp @param integer $timeNow current unix timestamp @return integer estimated end time in unix timestamp
[ "Estimate", "time", "to", "end", "by", "given", "current", "usage", "value", "and", "max", "value" ]
a8df78ee4f7b97b862f989d3effc75f022fd75cb
https://github.com/bluetree-service/data/blob/a8df78ee4f7b97b862f989d3effc75f022fd75cb/src/Calculation/Math.php#L71-L81
train
3ev/wordpress-core
src/Tev/Field/Model/AuthorField.php
AuthorField.getValue
public function getValue() { $val = $this->base['value']; if (is_array($val)) { if (isset($val['ID'])) { return $this->authorFactory->create($val['ID']); } else { $authors = array(); foreach ($val as $a) { ...
php
public function getValue() { $val = $this->base['value']; if (is_array($val)) { if (isset($val['ID'])) { return $this->authorFactory->create($val['ID']); } else { $authors = array(); foreach ($val as $a) { ...
[ "public", "function", "getValue", "(", ")", "{", "$", "val", "=", "$", "this", "->", "base", "[", "'value'", "]", ";", "if", "(", "is_array", "(", "$", "val", ")", ")", "{", "if", "(", "isset", "(", "$", "val", "[", "'ID'", "]", ")", ")", "{"...
Get a single author object or array of author objects. If no authors are configured, returned will result will be an empty array if this is a mutli-select, or null if not. @return \Tev\Author\Model\Author|\Tev\Author\Model\Author[]|null
[ "Get", "a", "single", "author", "object", "or", "array", "of", "author", "objects", "." ]
da674fbec5bf3d5bd2a2141680a4c141113eb6b0
https://github.com/3ev/wordpress-core/blob/da674fbec5bf3d5bd2a2141680a4c141113eb6b0/src/Tev/Field/Model/AuthorField.php#L43-L66
train
deweller/php-cliopts
src/CLIOpts/Help/ConsoleFormat.php
ConsoleFormat.applyformatToText
public static function applyformatToText() { $args = func_get_args(); $count = func_num_args(); $text = $args[$count - 1]; if ($count == 1) { return $text; } $mode_texts = array_slice($args, 0, $count - 1); return self::buildEscapeCodes($mode_texts).$text.self::buildEscapeCodes('plain'); }
php
public static function applyformatToText() { $args = func_get_args(); $count = func_num_args(); $text = $args[$count - 1]; if ($count == 1) { return $text; } $mode_texts = array_slice($args, 0, $count - 1); return self::buildEscapeCodes($mode_texts).$text.self::buildEscapeCodes('plain'); }
[ "public", "static", "function", "applyformatToText", "(", ")", "{", "$", "args", "=", "func_get_args", "(", ")", ";", "$", "count", "=", "func_num_args", "(", ")", ";", "$", "text", "=", "$", "args", "[", "$", "count", "-", "1", "]", ";", "if", "("...
Applies one or more console formatting codes to text @param string $mode A mode like bold or black. This can be repeated numerous times. @param string $text the text to be formatted @return string a formatted version of $text
[ "Applies", "one", "or", "more", "console", "formatting", "codes", "to", "text" ]
1923f3a7ad24062c6279c725579ff3af15141dec
https://github.com/deweller/php-cliopts/blob/1923f3a7ad24062c6279c725579ff3af15141dec/src/CLIOpts/Help/ConsoleFormat.php#L57-L67
train
deweller/php-cliopts
src/CLIOpts/Help/ConsoleFormat.php
ConsoleFormat.buildEscapeCodes
protected static function buildEscapeCodes($mode_texts) { if (!is_array($mode_texts)) { $mode_texts = array($mode_texts); } $code_text = ''; foreach ($mode_texts as $mode) { $constant_name = 'self::CONSOLE_'.strtoupper($mode); if (defined($constant_name)) { $code_text .= (strlen($code_t...
php
protected static function buildEscapeCodes($mode_texts) { if (!is_array($mode_texts)) { $mode_texts = array($mode_texts); } $code_text = ''; foreach ($mode_texts as $mode) { $constant_name = 'self::CONSOLE_'.strtoupper($mode); if (defined($constant_name)) { $code_text .= (strlen($code_t...
[ "protected", "static", "function", "buildEscapeCodes", "(", "$", "mode_texts", ")", "{", "if", "(", "!", "is_array", "(", "$", "mode_texts", ")", ")", "{", "$", "mode_texts", "=", "array", "(", "$", "mode_texts", ")", ";", "}", "$", "code_text", "=", "...
builds ANSI escape codes @param mixed $mode_texts An array of mode texts like bold or white. Can also be a single string. @return string ANSI escape code to activate the modes
[ "builds", "ANSI", "escape", "codes" ]
1923f3a7ad24062c6279c725579ff3af15141dec
https://github.com/deweller/php-cliopts/blob/1923f3a7ad24062c6279c725579ff3af15141dec/src/CLIOpts/Help/ConsoleFormat.php#L82-L94
train
newestindustry/ginger-rest
src/Ginger/Url.php
Url.getParameter
public function getParameter($key) { if(isset($this->queryParts[$key])) { return $this->queryParts[$key]; } else { return false; } }
php
public function getParameter($key) { if(isset($this->queryParts[$key])) { return $this->queryParts[$key]; } else { return false; } }
[ "public", "function", "getParameter", "(", "$", "key", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "queryParts", "[", "$", "key", "]", ")", ")", "{", "return", "$", "this", "->", "queryParts", "[", "$", "key", "]", ";", "}", "else", "{"...
getParameter function. @access public @param mixed $key @return void
[ "getParameter", "function", "." ]
482b77dc122a60ab0bf143a3c4a1e67168985c83
https://github.com/newestindustry/ginger-rest/blob/482b77dc122a60ab0bf143a3c4a1e67168985c83/src/Ginger/Url.php#L127-L134
train
newup/core
src/Filesystem/Generators/PathTreeArrayFormat.php
PathTreeArrayFormat.getPathForTreeGenerator
private function getPathForTreeGenerator($pathKey, $path) { // If the $path is an array, it most likely already contains // the information we need, such as if the target is a file or directory. if (is_array($path) && array_key_exists('type', $path) && array_key_exists('path', $path)) { ...
php
private function getPathForTreeGenerator($pathKey, $path) { // If the $path is an array, it most likely already contains // the information we need, such as if the target is a file or directory. if (is_array($path) && array_key_exists('type', $path) && array_key_exists('path', $path)) { ...
[ "private", "function", "getPathForTreeGenerator", "(", "$", "pathKey", ",", "$", "path", ")", "{", "// If the $path is an array, it most likely already contains", "// the information we need, such as if the target is a file or directory.", "if", "(", "is_array", "(", "$", "path",...
Converts the key and path into an array that various tree generators expect. This function does NOT process the path using any renderers. @param $pathKey @param $path @return mixed @throws InvalidArgumentException
[ "Converts", "the", "key", "and", "path", "into", "an", "array", "that", "various", "tree", "generators", "expect", "." ]
54128903e7775e67d63284d958b46862c8df71f9
https://github.com/newup/core/blob/54128903e7775e67d63284d958b46862c8df71f9/src/Filesystem/Generators/PathTreeArrayFormat.php#L22-L49
train
andyburton/Sonic-Framework
src/Memcached.php
Memcached.create
public function create ($exclude = array (), $cache = FALSE) { // If we're not caching or there is no memcached object just call parent if ($cache === FALSE || !($this->memcached instanceof \Memcached)) { return parent::create ($exclude); } // Call parent method $parent = parent::create ($ex...
php
public function create ($exclude = array (), $cache = FALSE) { // If we're not caching or there is no memcached object just call parent if ($cache === FALSE || !($this->memcached instanceof \Memcached)) { return parent::create ($exclude); } // Call parent method $parent = parent::create ($ex...
[ "public", "function", "create", "(", "$", "exclude", "=", "array", "(", ")", ",", "$", "cache", "=", "FALSE", ")", "{", "// If we're not caching or there is no memcached object just call parent", "if", "(", "$", "cache", "===", "FALSE", "||", "!", "(", "$", "t...
Create object in the database and set in memcached @param array $exclude Attributes not to set @param integer|boolean $cache Number of seconds to cache the object for 0 = cache never expires, FALSE = do not cache @return boolean
[ "Create", "object", "in", "the", "database", "and", "set", "in", "memcached" ]
a5999448a0abab4d542413002a780ede391e7374
https://github.com/andyburton/Sonic-Framework/blob/a5999448a0abab4d542413002a780ede391e7374/src/Memcached.php#L28-L55
train
andyburton/Sonic-Framework
src/Memcached.php
Memcached.read
public function read ($pkValue = FALSE, $cache = FALSE) { // If we're not caching or there is no memcached object just call parent if ($cache === FALSE || !($this->memcached instanceof \Memcached)) { return parent::read ($pkValue); } // If there is a key value passed set it if ($pkValue !== ...
php
public function read ($pkValue = FALSE, $cache = FALSE) { // If we're not caching or there is no memcached object just call parent if ($cache === FALSE || !($this->memcached instanceof \Memcached)) { return parent::read ($pkValue); } // If there is a key value passed set it if ($pkValue !== ...
[ "public", "function", "read", "(", "$", "pkValue", "=", "FALSE", ",", "$", "cache", "=", "FALSE", ")", "{", "// If we're not caching or there is no memcached object just call parent", "if", "(", "$", "cache", "===", "FALSE", "||", "!", "(", "$", "this", "->", ...
Read an object from memcached if it exists, otherwise load the object from the database and then cache it @param mixed $pkValue Primary key value @param integer|boolean $cache Number of seconds to cache the object for 0 = cache never expires, FALSE = do not cache @return boolean
[ "Read", "an", "object", "from", "memcached", "if", "it", "exists", "otherwise", "load", "the", "object", "from", "the", "database", "and", "then", "cache", "it" ]
a5999448a0abab4d542413002a780ede391e7374
https://github.com/andyburton/Sonic-Framework/blob/a5999448a0abab4d542413002a780ede391e7374/src/Memcached.php#L67-L117
train
andyburton/Sonic-Framework
src/Memcached.php
Memcached.delete
public function delete ($pkValue = FALSE) { // If there is no key value passed set it if ($pkValue === FALSE) { $pkValue = $this->iget (static::$pk); } // Call parent method $parent = parent::delete ($pkValue); if ($parent === FALSE) { return FALSE; } // If there is a memcac...
php
public function delete ($pkValue = FALSE) { // If there is no key value passed set it if ($pkValue === FALSE) { $pkValue = $this->iget (static::$pk); } // Call parent method $parent = parent::delete ($pkValue); if ($parent === FALSE) { return FALSE; } // If there is a memcac...
[ "public", "function", "delete", "(", "$", "pkValue", "=", "FALSE", ")", "{", "// If there is no key value passed set it", "if", "(", "$", "pkValue", "===", "FALSE", ")", "{", "$", "pkValue", "=", "$", "this", "->", "iget", "(", "static", "::", "$", "pk", ...
Delete an object in the database and memcached @param mixed $pkValue Primary key value @return boolean
[ "Delete", "an", "object", "in", "the", "database", "and", "memcached" ]
a5999448a0abab4d542413002a780ede391e7374
https://github.com/andyburton/Sonic-Framework/blob/a5999448a0abab4d542413002a780ede391e7374/src/Memcached.php#L165-L195
train
andyburton/Sonic-Framework
src/Memcached.php
Memcached.getCacheAttributes
private function getCacheAttributes () { $attributes = array (); foreach (array_keys (self::$attributes) as $name) { $attributes[$name] = $this->iget ($name); } return $attributes; }
php
private function getCacheAttributes () { $attributes = array (); foreach (array_keys (self::$attributes) as $name) { $attributes[$name] = $this->iget ($name); } return $attributes; }
[ "private", "function", "getCacheAttributes", "(", ")", "{", "$", "attributes", "=", "array", "(", ")", ";", "foreach", "(", "array_keys", "(", "self", "::", "$", "attributes", ")", "as", "$", "name", ")", "{", "$", "attributes", "[", "$", "name", "]", ...
Return object attributes to cache @return array
[ "Return", "object", "attributes", "to", "cache" ]
a5999448a0abab4d542413002a780ede391e7374
https://github.com/andyburton/Sonic-Framework/blob/a5999448a0abab4d542413002a780ede391e7374/src/Memcached.php#L225-L237
train
andyburton/Sonic-Framework
src/Memcached.php
Memcached.setCacheAttributes
private function setCacheAttributes ($arr) { foreach ($arr as $name => $val) { $this->iset ($name, $val, FALSE); } }
php
private function setCacheAttributes ($arr) { foreach ($arr as $name => $val) { $this->iset ($name, $val, FALSE); } }
[ "private", "function", "setCacheAttributes", "(", "$", "arr", ")", "{", "foreach", "(", "$", "arr", "as", "$", "name", "=>", "$", "val", ")", "{", "$", "this", "->", "iset", "(", "$", "name", ",", "$", "val", ",", "FALSE", ")", ";", "}", "}" ]
Set object attributes from cache @return array
[ "Set", "object", "attributes", "from", "cache" ]
a5999448a0abab4d542413002a780ede391e7374
https://github.com/andyburton/Sonic-Framework/blob/a5999448a0abab4d542413002a780ede391e7374/src/Memcached.php#L245-L253
train
kmfk/slowdb
src/Database.php
Database.getCollection
public function getCollection($name) { $name = strtolower($name); if ($this->collections->containsKey($name)) { return $this->collections->get($name); } $this->collections->set($name, $this->createCollection($name)); return $this->collections->get($name); }
php
public function getCollection($name) { $name = strtolower($name); if ($this->collections->containsKey($name)) { return $this->collections->get($name); } $this->collections->set($name, $this->createCollection($name)); return $this->collections->get($name); }
[ "public", "function", "getCollection", "(", "$", "name", ")", "{", "$", "name", "=", "strtolower", "(", "$", "name", ")", ";", "if", "(", "$", "this", "->", "collections", "->", "containsKey", "(", "$", "name", ")", ")", "{", "return", "$", "this", ...
Gets a Collection by name Collections are idempotent, we create a collection if it does not exist or return existing collections @param string $name The name of the Collection @return Collection
[ "Gets", "a", "Collection", "by", "name" ]
7461771b8ddc0c9887e2ee69a76ff5ffc763974c
https://github.com/kmfk/slowdb/blob/7461771b8ddc0c9887e2ee69a76ff5ffc763974c/src/Database.php#L67-L78
train
kmfk/slowdb
src/Database.php
Database.all
public function all() { $results = []; foreach ($this->collections as $collection) { $results[] = array_merge(['name' => $collection->name], $collection->info()); } return $results; }
php
public function all() { $results = []; foreach ($this->collections as $collection) { $results[] = array_merge(['name' => $collection->name], $collection->info()); } return $results; }
[ "public", "function", "all", "(", ")", "{", "$", "results", "=", "[", "]", ";", "foreach", "(", "$", "this", "->", "collections", "as", "$", "collection", ")", "{", "$", "results", "[", "]", "=", "array_merge", "(", "[", "'name'", "=>", "$", "colle...
Lists the available Collections by name @return array
[ "Lists", "the", "available", "Collections", "by", "name" ]
7461771b8ddc0c9887e2ee69a76ff5ffc763974c
https://github.com/kmfk/slowdb/blob/7461771b8ddc0c9887e2ee69a76ff5ffc763974c/src/Database.php#L85-L93
train
kmfk/slowdb
src/Database.php
Database.drop
public function drop($collection) { if (!$this->collections->containsKey($collection)) { return false; } $this->collections->get($collection)->drop(); $this->collections->remove($collection); return true; }
php
public function drop($collection) { if (!$this->collections->containsKey($collection)) { return false; } $this->collections->get($collection)->drop(); $this->collections->remove($collection); return true; }
[ "public", "function", "drop", "(", "$", "collection", ")", "{", "if", "(", "!", "$", "this", "->", "collections", "->", "containsKey", "(", "$", "collection", ")", ")", "{", "return", "false", ";", "}", "$", "this", "->", "collections", "->", "get", ...
Drops a Collection - removing all data @param string $collection The name of the Collection to drop
[ "Drops", "a", "Collection", "-", "removing", "all", "data" ]
7461771b8ddc0c9887e2ee69a76ff5ffc763974c
https://github.com/kmfk/slowdb/blob/7461771b8ddc0c9887e2ee69a76ff5ffc763974c/src/Database.php#L100-L110
train
kmfk/slowdb
src/Database.php
Database.loadCollections
private function loadCollections() { $collections = new ArrayCollection(); $finder = new Finder(); $finder->files()->name('*.dat')->in($this->filepath); foreach ($finder as $file) { $name = $file->getBasename('.dat'); $collections->set($name, $this->createCo...
php
private function loadCollections() { $collections = new ArrayCollection(); $finder = new Finder(); $finder->files()->name('*.dat')->in($this->filepath); foreach ($finder as $file) { $name = $file->getBasename('.dat'); $collections->set($name, $this->createCo...
[ "private", "function", "loadCollections", "(", ")", "{", "$", "collections", "=", "new", "ArrayCollection", "(", ")", ";", "$", "finder", "=", "new", "Finder", "(", ")", ";", "$", "finder", "->", "files", "(", ")", "->", "name", "(", "'*.dat'", ")", ...
Loads the collections for the Database @return ArrayCollection
[ "Loads", "the", "collections", "for", "the", "Database" ]
7461771b8ddc0c9887e2ee69a76ff5ffc763974c
https://github.com/kmfk/slowdb/blob/7461771b8ddc0c9887e2ee69a76ff5ffc763974c/src/Database.php#L127-L140
train
samsonos/php_core
src/loader/ContainerManager.php
ContainerManager.collectXmlMetadata
public function collectXmlMetadata(array $metadataCollection) : array { // If config path is exists if (file_exists($this->configPath)) { // Init resolver $xmlConfigurator = new XmlResolver(new CollectionClassResolver([ Scope::class, Name::clas...
php
public function collectXmlMetadata(array $metadataCollection) : array { // If config path is exists if (file_exists($this->configPath)) { // Init resolver $xmlConfigurator = new XmlResolver(new CollectionClassResolver([ Scope::class, Name::clas...
[ "public", "function", "collectXmlMetadata", "(", "array", "$", "metadataCollection", ")", ":", "array", "{", "// If config path is exists", "if", "(", "file_exists", "(", "$", "this", "->", "configPath", ")", ")", "{", "// Init resolver", "$", "xmlConfigurator", "...
Get xml metadata collection @param array $metadataCollection @return array @throws \Exception
[ "Get", "xml", "metadata", "collection" ]
15f30528e2efab9e9cf16e9aad3899edced49de1
https://github.com/samsonos/php_core/blob/15f30528e2efab9e9cf16e9aad3899edced49de1/src/loader/ContainerManager.php#L79-L103
train
samsonos/php_core
src/loader/ContainerManager.php
ContainerManager.getDefaultPropertyValue
public function getDefaultPropertyValue($className, $propertyName) { $reflection = new \ReflectionClass($className); $values = $reflection->getDefaultProperties(); return $values[$propertyName] ?? null; }
php
public function getDefaultPropertyValue($className, $propertyName) { $reflection = new \ReflectionClass($className); $values = $reflection->getDefaultProperties(); return $values[$propertyName] ?? null; }
[ "public", "function", "getDefaultPropertyValue", "(", "$", "className", ",", "$", "propertyName", ")", "{", "$", "reflection", "=", "new", "\\", "ReflectionClass", "(", "$", "className", ")", ";", "$", "values", "=", "$", "reflection", "->", "getDefaultPropert...
Get default property value by property name @param $className @param $propertyName @return null
[ "Get", "default", "property", "value", "by", "property", "name" ]
15f30528e2efab9e9cf16e9aad3899edced49de1
https://github.com/samsonos/php_core/blob/15f30528e2efab9e9cf16e9aad3899edced49de1/src/loader/ContainerManager.php#L112-L117
train
samsonos/php_core
src/loader/ContainerManager.php
ContainerManager.createMetadata
public function createMetadata($class, $name, $path, $scope = 'module') : ClassMetadata { $metadata = new ClassMetadata(); $class = ltrim($class, '\\'); $name = strtolower(ltrim($name, '\\')); $metadata->className = $class; $metadata->name = str_replace(['\\', '/'], '_', $nam...
php
public function createMetadata($class, $name, $path, $scope = 'module') : ClassMetadata { $metadata = new ClassMetadata(); $class = ltrim($class, '\\'); $name = strtolower(ltrim($name, '\\')); $metadata->className = $class; $metadata->name = str_replace(['\\', '/'], '_', $nam...
[ "public", "function", "createMetadata", "(", "$", "class", ",", "$", "name", ",", "$", "path", ",", "$", "scope", "=", "'module'", ")", ":", "ClassMetadata", "{", "$", "metadata", "=", "new", "ClassMetadata", "(", ")", ";", "$", "class", "=", "ltrim", ...
Create metadata for module @param $class @param $name @param $path @param string $scope @return ClassMetadata
[ "Create", "metadata", "for", "module" ]
15f30528e2efab9e9cf16e9aad3899edced49de1
https://github.com/samsonos/php_core/blob/15f30528e2efab9e9cf16e9aad3899edced49de1/src/loader/ContainerManager.php#L128-L154
train
samsonos/php_core
src/loader/ContainerManager.php
ContainerManager.collectAnnotationMetadata
public function collectAnnotationMetadata($classes, $metadataCollection) { // Load annotation and parse classes new Injectable(); new InjectArgument(['var' => 'type']); new Service(['value' => '']); $reader = new AnnotationReader(); $resolver = new AnnotationResolver...
php
public function collectAnnotationMetadata($classes, $metadataCollection) { // Load annotation and parse classes new Injectable(); new InjectArgument(['var' => 'type']); new Service(['value' => '']); $reader = new AnnotationReader(); $resolver = new AnnotationResolver...
[ "public", "function", "collectAnnotationMetadata", "(", "$", "classes", ",", "$", "metadataCollection", ")", "{", "// Load annotation and parse classes", "new", "Injectable", "(", ")", ";", "new", "InjectArgument", "(", "[", "'var'", "=>", "'type'", "]", ")", ";",...
Get annotation metadata @param $classes @param $metadataCollection @return array|\samsonframework\container\metadata\ClassMetadata[]
[ "Get", "annotation", "metadata" ]
15f30528e2efab9e9cf16e9aad3899edced49de1
https://github.com/samsonos/php_core/blob/15f30528e2efab9e9cf16e9aad3899edced49de1/src/loader/ContainerManager.php#L269-L287
train
danhanly/signalert
src/Signalert/Resolver.php
Resolver.getRenderer
public function getRenderer() { // Attempt to retrieve the renderer config $config = new Config($this->configDirectory); $rendererClass = $config->getRenderer(); // Validate Renderer Class $reflection = new ReflectionClass($rendererClass); // Ensure class is built wit...
php
public function getRenderer() { // Attempt to retrieve the renderer config $config = new Config($this->configDirectory); $rendererClass = $config->getRenderer(); // Validate Renderer Class $reflection = new ReflectionClass($rendererClass); // Ensure class is built wit...
[ "public", "function", "getRenderer", "(", ")", "{", "// Attempt to retrieve the renderer config", "$", "config", "=", "new", "Config", "(", "$", "this", "->", "configDirectory", ")", ";", "$", "rendererClass", "=", "$", "config", "->", "getRenderer", "(", ")", ...
Returns a valid renderer class @return RendererInterface @throws Exception\SignalertInvalidRendererException @throws SignalertResolverException
[ "Returns", "a", "valid", "renderer", "class" ]
21ee50e3fc0352306a2966b555984b5c9eada582
https://github.com/danhanly/signalert/blob/21ee50e3fc0352306a2966b555984b5c9eada582/src/Signalert/Resolver.php#L32-L45
train
danhanly/signalert
src/Signalert/Resolver.php
Resolver.getDriver
public function getDriver() { // Attempt to retrieve the driver config $config = new Config($this->configDirectory); $driverClass = $config->getDriver(); // Validate Driver Class $reflection = new ReflectionClass($driverClass); // Ensure class is built with the correc...
php
public function getDriver() { // Attempt to retrieve the driver config $config = new Config($this->configDirectory); $driverClass = $config->getDriver(); // Validate Driver Class $reflection = new ReflectionClass($driverClass); // Ensure class is built with the correc...
[ "public", "function", "getDriver", "(", ")", "{", "// Attempt to retrieve the driver config", "$", "config", "=", "new", "Config", "(", "$", "this", "->", "configDirectory", ")", ";", "$", "driverClass", "=", "$", "config", "->", "getDriver", "(", ")", ";", ...
Returns a valid driver class @return DriverInterface @throws SignalertResolverException
[ "Returns", "a", "valid", "driver", "class" ]
21ee50e3fc0352306a2966b555984b5c9eada582
https://github.com/danhanly/signalert/blob/21ee50e3fc0352306a2966b555984b5c9eada582/src/Signalert/Resolver.php#L53-L67
train
skillberto/SonataExtendedAdminBundle
Controller/CRUDController.php
CRUDController.activateAction
public function activateAction() { $object = $this->getObject(); if (method_exists($object, 'setActive') && method_exists($object, 'getActive')) { $object->setActive(($object->getActive()==1) ? 0 : 1); } $this->admin->update($object); ...
php
public function activateAction() { $object = $this->getObject(); if (method_exists($object, 'setActive') && method_exists($object, 'getActive')) { $object->setActive(($object->getActive()==1) ? 0 : 1); } $this->admin->update($object); ...
[ "public", "function", "activateAction", "(", ")", "{", "$", "object", "=", "$", "this", "->", "getObject", "(", ")", ";", "if", "(", "method_exists", "(", "$", "object", ",", "'setActive'", ")", "&&", "method_exists", "(", "$", "object", ",", "'getActive...
Activate or inactivate the object @throws Symfony\Component\HttpKernel\Exception\NotFoundHttpException; @return Symfony\Component\HttpFoundation\RedirectResponse
[ "Activate", "or", "inactivate", "the", "object" ]
5ca04cab25181e78b7ee4e866ae0567bd074fa41
https://github.com/skillberto/SonataExtendedAdminBundle/blob/5ca04cab25181e78b7ee4e866ae0567bd074fa41/Controller/CRUDController.php#L23-L34
train
oliwierptak/Everon1
src/Everon/Helper/Asserts/IsArray.php
IsArray.assertIsArray
public function assertIsArray($value, $message='%s must be an Array', $exception='Asserts') { if (isset($value) === false || is_array($value) === false) { $this->throwException($exception, $message, $value); } }
php
public function assertIsArray($value, $message='%s must be an Array', $exception='Asserts') { if (isset($value) === false || is_array($value) === false) { $this->throwException($exception, $message, $value); } }
[ "public", "function", "assertIsArray", "(", "$", "value", ",", "$", "message", "=", "'%s must be an Array'", ",", "$", "exception", "=", "'Asserts'", ")", "{", "if", "(", "isset", "(", "$", "value", ")", "===", "false", "||", "is_array", "(", "$", "value...
Verifies that the specified condition is array. The assertion fails if the condition is not array. @param mixed $value @param string $message @param string $exception @throws \Everon\Exception\Asserts
[ "Verifies", "that", "the", "specified", "condition", "is", "array", ".", "The", "assertion", "fails", "if", "the", "condition", "is", "not", "array", "." ]
ac93793d1fa517a8394db5f00062f1925dc218a3
https://github.com/oliwierptak/Everon1/blob/ac93793d1fa517a8394db5f00062f1925dc218a3/src/Everon/Helper/Asserts/IsArray.php#L23-L28
train
RowlandOti/ooglee-blogmodule
src/OoGlee/Application/Entities/Post/Category/CategoryResponse.php
PostResponse.make
public function make(ICategory $category) { //$category->setResponse($this->response->view('admin.categorys.view', compact('category'))); $category->setResponse($this->response->view(\OogleeBConfig::get('config.category_view.view'), compact('category'))); }
php
public function make(ICategory $category) { //$category->setResponse($this->response->view('admin.categorys.view', compact('category'))); $category->setResponse($this->response->view(\OogleeBConfig::get('config.category_view.view'), compact('category'))); }
[ "public", "function", "make", "(", "ICategory", "$", "category", ")", "{", "//$category->setResponse($this->response->view('admin.categorys.view', compact('category')));\r", "$", "category", "->", "setResponse", "(", "$", "this", "->", "response", "->", "view", "(", "\\",...
Make the category response. @param ICategory $category
[ "Make", "the", "category", "response", "." ]
d9c0fe4745bb09f8b94047b0cda4fd7438cde16a
https://github.com/RowlandOti/ooglee-blogmodule/blob/d9c0fe4745bb09f8b94047b0cda4fd7438cde16a/src/OoGlee/Application/Entities/Post/Category/CategoryResponse.php#L40-L44
train
alphacomm/alpharpc
src/AlphaRPC/Manager/WorkerHandler/Worker.php
Worker.addAction
public function addAction($action) { if ($action instanceof Action) { $action = $action->getName(); } $this->actionList[] = $action; $this->valid = null; return $this; }
php
public function addAction($action) { if ($action instanceof Action) { $action = $action->getName(); } $this->actionList[] = $action; $this->valid = null; return $this; }
[ "public", "function", "addAction", "(", "$", "action", ")", "{", "if", "(", "$", "action", "instanceof", "Action", ")", "{", "$", "action", "=", "$", "action", "->", "getName", "(", ")", ";", "}", "$", "this", "->", "actionList", "[", "]", "=", "$"...
Adds a action name to the list of actions the worker listens to. @param Action $action @return Worker
[ "Adds", "a", "action", "name", "to", "the", "list", "of", "actions", "the", "worker", "listens", "to", "." ]
cf162854500554c4ba8d39f2675de35a49c30ed0
https://github.com/alphacomm/alpharpc/blob/cf162854500554c4ba8d39f2675de35a49c30ed0/src/AlphaRPC/Manager/WorkerHandler/Worker.php#L126-L135
train
Synapse-Cmf/synapse-cmf
src/Synapse/Cmf/Framework/Media/Image/Entity/Image.php
Image.getFormattedImage
public function getFormattedImage($format) { $formatName = $format instanceof FormatInterface ? $format->getName() : $format ; return $this->formattedImages ->filter(function (FormattedImageInterface $formattedImage) use ($formatName) { re...
php
public function getFormattedImage($format) { $formatName = $format instanceof FormatInterface ? $format->getName() : $format ; return $this->formattedImages ->filter(function (FormattedImageInterface $formattedImage) use ($formatName) { re...
[ "public", "function", "getFormattedImage", "(", "$", "format", ")", "{", "$", "formatName", "=", "$", "format", "instanceof", "FormatInterface", "?", "$", "format", "->", "getName", "(", ")", ":", "$", "format", ";", "return", "$", "this", "->", "formatted...
Returns image formatted for given format name or FormatInterface object. @param string|FormatInterface $format @return FormattedImageInterface|null
[ "Returns", "image", "formatted", "for", "given", "format", "name", "or", "FormatInterface", "object", "." ]
d8122a4150a83d5607289724425cf35c56a5e880
https://github.com/Synapse-Cmf/synapse-cmf/blob/d8122a4150a83d5607289724425cf35c56a5e880/src/Synapse/Cmf/Framework/Media/Image/Entity/Image.php#L213-L228
train
Synapse-Cmf/synapse-cmf
src/Synapse/Cmf/Framework/Media/Image/Entity/Image.php
Image.getFormatWebPath
public function getFormatWebPath($format = null) { if (!$format = $format ?: $this->defaultFormat) { return $this->getWebPath(); } return ($formattedImage = $this->getFormattedImage($format)) ? $formattedImage->getWebPath() : $this->getWebPath() ;...
php
public function getFormatWebPath($format = null) { if (!$format = $format ?: $this->defaultFormat) { return $this->getWebPath(); } return ($formattedImage = $this->getFormattedImage($format)) ? $formattedImage->getWebPath() : $this->getWebPath() ;...
[ "public", "function", "getFormatWebPath", "(", "$", "format", "=", "null", ")", "{", "if", "(", "!", "$", "format", "=", "$", "format", "?", ":", "$", "this", "->", "defaultFormat", ")", "{", "return", "$", "this", "->", "getWebPath", "(", ")", ";", ...
Returns requested format web path, or original one, if format doesnt exists. @param string|FormatInterface $format @return string
[ "Returns", "requested", "format", "web", "path", "or", "original", "one", "if", "format", "doesnt", "exists", "." ]
d8122a4150a83d5607289724425cf35c56a5e880
https://github.com/Synapse-Cmf/synapse-cmf/blob/d8122a4150a83d5607289724425cf35c56a5e880/src/Synapse/Cmf/Framework/Media/Image/Entity/Image.php#L237-L247
train
nasumilu/geometry
src/MultiSurface.php
MultiSurface.getArea
public function getArea(): float { $event = new MeasurementOpEvent($this); $this->fireOperationEvent(MeasurementOpEvent::AREA_EVENT, $event); return $event->getResults(); }
php
public function getArea(): float { $event = new MeasurementOpEvent($this); $this->fireOperationEvent(MeasurementOpEvent::AREA_EVENT, $event); return $event->getResults(); }
[ "public", "function", "getArea", "(", ")", ":", "float", "{", "$", "event", "=", "new", "MeasurementOpEvent", "(", "$", "this", ")", ";", "$", "this", "->", "fireOperationEvent", "(", "MeasurementOpEvent", "::", "AREA_EVENT", ",", "$", "event", ")", ";", ...
Gets the area of this MultiSurface, as measured in the spatial reference system of this Surface. @return float
[ "Gets", "the", "area", "of", "this", "MultiSurface", "as", "measured", "in", "the", "spatial", "reference", "system", "of", "this", "Surface", "." ]
000fafe3e61f1d0682952ad236b7486dded65eae
https://github.com/nasumilu/geometry/blob/000fafe3e61f1d0682952ad236b7486dded65eae/src/MultiSurface.php#L65-L69
train
nasumilu/geometry
src/MultiSurface.php
MultiSurface.getPointOnSurface
public function getPointOnSurface(): Point { $event = new ProcessOpEvent($this); $this->fireOperationEvent(ProcessOpEvent::POINT_ON_SURFACE_EVENT, $event); return $event->getResults(); }
php
public function getPointOnSurface(): Point { $event = new ProcessOpEvent($this); $this->fireOperationEvent(ProcessOpEvent::POINT_ON_SURFACE_EVENT, $event); return $event->getResults(); }
[ "public", "function", "getPointOnSurface", "(", ")", ":", "Point", "{", "$", "event", "=", "new", "ProcessOpEvent", "(", "$", "this", ")", ";", "$", "this", "->", "fireOperationEvent", "(", "ProcessOpEvent", "::", "POINT_ON_SURFACE_EVENT", ",", "$", "event", ...
Gets a Point guaranteed to be on the MultiSurface. @return \Nasumilu\Geometry\Geometry
[ "Gets", "a", "Point", "guaranteed", "to", "be", "on", "the", "MultiSurface", "." ]
000fafe3e61f1d0682952ad236b7486dded65eae
https://github.com/nasumilu/geometry/blob/000fafe3e61f1d0682952ad236b7486dded65eae/src/MultiSurface.php#L88-L92
train
siriusphp/filtration
src/Filtrator.php
Filtrator.add
function add($selector, $callbackOrFilterName = null, $options = null, $recursive = false, $priority = 0) { /** * $selector is actually an array with filters * * @example $filtrator->add(array( * 'title' => array('trim', array('truncate', '{"limit":100}')) ...
php
function add($selector, $callbackOrFilterName = null, $options = null, $recursive = false, $priority = 0) { /** * $selector is actually an array with filters * * @example $filtrator->add(array( * 'title' => array('trim', array('truncate', '{"limit":100}')) ...
[ "function", "add", "(", "$", "selector", ",", "$", "callbackOrFilterName", "=", "null", ",", "$", "options", "=", "null", ",", "$", "recursive", "=", "false", ",", "$", "priority", "=", "0", ")", "{", "/**\n * $selector is actually an array with filters\...
Add a filter to the filters stack @example // normal callback $filtrator->add('title', '\strip_tags'); // anonymous function $filtrator->add('title', function($value){ return $value . '!!!'; }); // filter class from the library registered on the $filtersMap $filtrator->add('title', 'normalizedate', array('format' => '...
[ "Add", "a", "filter", "to", "the", "filters", "stack" ]
9f96592484f6d326e8bb8d5957be604a1622d08f
https://github.com/siriusphp/filtration/blob/9f96592484f6d326e8bb8d5957be604a1622d08f/src/Filtrator.php#L58-L124
train
siriusphp/filtration
src/Filtrator.php
Filtrator.remove
function remove($selector, $callbackOrName = true) { if (array_key_exists($selector, $this->filters)) { if ($callbackOrName === true) { unset($this->filters[$selector]); } else { if (! is_object($callbackOrName)) { $filter = $this->...
php
function remove($selector, $callbackOrName = true) { if (array_key_exists($selector, $this->filters)) { if ($callbackOrName === true) { unset($this->filters[$selector]); } else { if (! is_object($callbackOrName)) { $filter = $this->...
[ "function", "remove", "(", "$", "selector", ",", "$", "callbackOrName", "=", "true", ")", "{", "if", "(", "array_key_exists", "(", "$", "selector", ",", "$", "this", "->", "filters", ")", ")", "{", "if", "(", "$", "callbackOrName", "===", "true", ")", ...
Remove a filter from the stack @param string $selector @param bool|callable|string|TRUE $callbackOrName @throws \InvalidArgumentException @return \Sirius\Filtration\Filtrator
[ "Remove", "a", "filter", "from", "the", "stack" ]
9f96592484f6d326e8bb8d5957be604a1622d08f
https://github.com/siriusphp/filtration/blob/9f96592484f6d326e8bb8d5957be604a1622d08f/src/Filtrator.php#L183-L200
train
siriusphp/filtration
src/Filtrator.php
Filtrator.filter
function filter($data = array()) { if (! is_array($data)) { return $data; } // first apply the filters to the ROOT if (isset($this->filters[self::SELECTOR_ROOT])) { /* @var $rootFilters FilterSet */ $rootFilters = $this->filters[self::SELECTOR_ROOT...
php
function filter($data = array()) { if (! is_array($data)) { return $data; } // first apply the filters to the ROOT if (isset($this->filters[self::SELECTOR_ROOT])) { /* @var $rootFilters FilterSet */ $rootFilters = $this->filters[self::SELECTOR_ROOT...
[ "function", "filter", "(", "$", "data", "=", "array", "(", ")", ")", "{", "if", "(", "!", "is_array", "(", "$", "data", ")", ")", "{", "return", "$", "data", ";", "}", "// first apply the filters to the ROOT", "if", "(", "isset", "(", "$", "this", "-...
Apply filters to an array @param array $data @return array
[ "Apply", "filters", "to", "an", "array" ]
9f96592484f6d326e8bb8d5957be604a1622d08f
https://github.com/siriusphp/filtration/blob/9f96592484f6d326e8bb8d5957be604a1622d08f/src/Filtrator.php#L218-L233
train
siriusphp/filtration
src/Filtrator.php
Filtrator.filterItem
function filterItem($data, $valueIdentifier) { $value = Utils::arrayGetByPath($data, $valueIdentifier); $value = $this->applyFilters($value, $valueIdentifier, $data); if (is_array($value)) { foreach (array_keys($value) as $k) { $value[$k] = $this->filterItem($data...
php
function filterItem($data, $valueIdentifier) { $value = Utils::arrayGetByPath($data, $valueIdentifier); $value = $this->applyFilters($value, $valueIdentifier, $data); if (is_array($value)) { foreach (array_keys($value) as $k) { $value[$k] = $this->filterItem($data...
[ "function", "filterItem", "(", "$", "data", ",", "$", "valueIdentifier", ")", "{", "$", "value", "=", "Utils", "::", "arrayGetByPath", "(", "$", "data", ",", "$", "valueIdentifier", ")", ";", "$", "value", "=", "$", "this", "->", "applyFilters", "(", "...
Apply filters on a single item in the array @param array $data @param string $valueIdentifier @return mixed
[ "Apply", "filters", "on", "a", "single", "item", "in", "the", "array" ]
9f96592484f6d326e8bb8d5957be604a1622d08f
https://github.com/siriusphp/filtration/blob/9f96592484f6d326e8bb8d5957be604a1622d08f/src/Filtrator.php#L242-L252
train
siriusphp/filtration
src/Filtrator.php
Filtrator.applyFilters
function applyFilters($value, $valueIdentifier, $context) { foreach ($this->filters as $selector => $filterSet) { /* @var $filterSet FilterSet */ if ($selector != self::SELECTOR_ROOT && $this->itemMatchesSelector($valueIdentifier, $selector)) { $value = $filterSet->ap...
php
function applyFilters($value, $valueIdentifier, $context) { foreach ($this->filters as $selector => $filterSet) { /* @var $filterSet FilterSet */ if ($selector != self::SELECTOR_ROOT && $this->itemMatchesSelector($valueIdentifier, $selector)) { $value = $filterSet->ap...
[ "function", "applyFilters", "(", "$", "value", ",", "$", "valueIdentifier", ",", "$", "context", ")", "{", "foreach", "(", "$", "this", "->", "filters", "as", "$", "selector", "=>", "$", "filterSet", ")", "{", "/* @var $filterSet FilterSet */", "if", "(", ...
Apply filters to a single value @param mixed $value value of the item @param string $valueIdentifier array element path (eg: 'key' or 'key[0][subkey]') @param mixed $context @return mixed
[ "Apply", "filters", "to", "a", "single", "value" ]
9f96592484f6d326e8bb8d5957be604a1622d08f
https://github.com/siriusphp/filtration/blob/9f96592484f6d326e8bb8d5957be604a1622d08f/src/Filtrator.php#L264-L273
train
siriusphp/filtration
src/Filtrator.php
Filtrator.itemMatchesSelector
protected function itemMatchesSelector($item, $selector) { // the selector is a simple path identifier // NOT something like key[*][subkey] if (strpos($selector, '*') === false) { return $item === $selector; } $regex = '/' . str_replace('*', '[^\]]+', str_replace(...
php
protected function itemMatchesSelector($item, $selector) { // the selector is a simple path identifier // NOT something like key[*][subkey] if (strpos($selector, '*') === false) { return $item === $selector; } $regex = '/' . str_replace('*', '[^\]]+', str_replace(...
[ "protected", "function", "itemMatchesSelector", "(", "$", "item", ",", "$", "selector", ")", "{", "// the selector is a simple path identifier", "// NOT something like key[*][subkey]", "if", "(", "strpos", "(", "$", "selector", ",", "'*'", ")", "===", "false", ")", ...
Checks if an item matches a selector @example $this->('key[subkey]', 'key[*]') -> true; $this->('key[subkey]', 'subkey') -> false; @param string $item @param string $selector @return boolean number
[ "Checks", "if", "an", "item", "matches", "a", "selector" ]
9f96592484f6d326e8bb8d5957be604a1622d08f
https://github.com/siriusphp/filtration/blob/9f96592484f6d326e8bb8d5957be604a1622d08f/src/Filtrator.php#L285-L300
train
scarwu/Pack
src/Pack/HTML.php
HTML.get
public function get($html = null) { if (null === $html) { if (file_exists($this->_path)) { $html = file_get_contents($this->_path); } } $this->_path = null; return $this->parse($html); }
php
public function get($html = null) { if (null === $html) { if (file_exists($this->_path)) { $html = file_get_contents($this->_path); } } $this->_path = null; return $this->parse($html); }
[ "public", "function", "get", "(", "$", "html", "=", "null", ")", "{", "if", "(", "null", "===", "$", "html", ")", "{", "if", "(", "file_exists", "(", "$", "this", "->", "_path", ")", ")", "{", "$", "html", "=", "file_get_contents", "(", "$", "thi...
Get Packed HTML @param string @param string
[ "Get", "Packed", "HTML" ]
284e3273b18ac963f597893059c0b0d34fa15695
https://github.com/scarwu/Pack/blob/284e3273b18ac963f597893059c0b0d34fa15695/src/Pack/HTML.php#L41-L52
train
Etenil/assegai
src/assegai/modules/mail/services/ses/utilities/hadoopstep.class.php
CFHadoopStep.run_hive_script
public static function run_hive_script($script, $args = null) { if (!$args) $args = array(); $args = is_array($args) ? $args : array($args); $args = array_merge(array('--run-hive-script', '--args', '-f', $script), $args); return self::hive_pig_script('hive', $args); }
php
public static function run_hive_script($script, $args = null) { if (!$args) $args = array(); $args = is_array($args) ? $args : array($args); $args = array_merge(array('--run-hive-script', '--args', '-f', $script), $args); return self::hive_pig_script('hive', $args); }
[ "public", "static", "function", "run_hive_script", "(", "$", "script", ",", "$", "args", "=", "null", ")", "{", "if", "(", "!", "$", "args", ")", "$", "args", "=", "array", "(", ")", ";", "$", "args", "=", "is_array", "(", "$", "args", ")", "?", ...
Step that runs a Hive script on your job flow. @param string $script (Required) The script to run with `script-runner.jar`. @param array $args (Optional) An indexed array of arguments to pass to the script. @return array A standard array that is intended to be passed into a <CFStepConfig> object. @link http://hive.apa...
[ "Step", "that", "runs", "a", "Hive", "script", "on", "your", "job", "flow", "." ]
d43cce1a88f1c332f60dd0a4374b17764852af9e
https://github.com/Etenil/assegai/blob/d43cce1a88f1c332f60dd0a4374b17764852af9e/src/assegai/modules/mail/services/ses/utilities/hadoopstep.class.php#L62-L69
train
Etenil/assegai
src/assegai/modules/mail/services/ses/utilities/hadoopstep.class.php
CFHadoopStep.run_pig_script
public static function run_pig_script($script, $args = null) { if (!$args) $args = array(); $args = is_array($args) ? $args : array($args); $args = array_merge(array('--run-pig-script', '--args', '-f', $script), $args); return self::hive_pig_script('pig', $args); }
php
public static function run_pig_script($script, $args = null) { if (!$args) $args = array(); $args = is_array($args) ? $args : array($args); $args = array_merge(array('--run-pig-script', '--args', '-f', $script), $args); return self::hive_pig_script('pig', $args); }
[ "public", "static", "function", "run_pig_script", "(", "$", "script", ",", "$", "args", "=", "null", ")", "{", "if", "(", "!", "$", "args", ")", "$", "args", "=", "array", "(", ")", ";", "$", "args", "=", "is_array", "(", "$", "args", ")", "?", ...
Step that runs a Pig script on your job flow. @param string $script (Required) The script to run with `script-runner.jar`. @param array $args (Optional) An indexed array of arguments to pass to the script. @return array A standard array that is intended to be passed into a <CFStepConfig> object. @link http://pig.apach...
[ "Step", "that", "runs", "a", "Pig", "script", "on", "your", "job", "flow", "." ]
d43cce1a88f1c332f60dd0a4374b17764852af9e
https://github.com/Etenil/assegai/blob/d43cce1a88f1c332f60dd0a4374b17764852af9e/src/assegai/modules/mail/services/ses/utilities/hadoopstep.class.php#L90-L97
train
lrezek/Arachnid
src/LRezek/Arachnid/Meta/Reflection.php
Reflection.normalizeProperty
public static function normalizeProperty($property) { //Remove an underscore, so you can do get_date() if(substr($property,0,1) == '_') { $property = substr($property, 1); } $property = lcfirst($property); // //Deal with famil-'ies', make it 'family' // ...
php
public static function normalizeProperty($property) { //Remove an underscore, so you can do get_date() if(substr($property,0,1) == '_') { $property = substr($property, 1); } $property = lcfirst($property); // //Deal with famil-'ies', make it 'family' // ...
[ "public", "static", "function", "normalizeProperty", "(", "$", "property", ")", "{", "//Remove an underscore, so you can do get_date()", "if", "(", "substr", "(", "$", "property", ",", "0", ",", "1", ")", "==", "'_'", ")", "{", "$", "property", "=", "substr", ...
Normalizes a property name, by making it lowercase and stripping off "ies" or "s" @param string $property Property name to sigularize. @return string Singularized property name.
[ "Normalizes", "a", "property", "name", "by", "making", "it", "lowercase", "and", "stripping", "off", "ies", "or", "s" ]
fbfc2c6f9d1dbfeef6f677813c12c570d5ea750a
https://github.com/lrezek/Arachnid/blob/fbfc2c6f9d1dbfeef6f677813c12c570d5ea750a/src/LRezek/Arachnid/Meta/Reflection.php#L38-L60
train
composer-synchronizer/composer-synchronizer
src/Helpers.php
Helpers.copy
public static function copy(string $source, string $dest, bool $override = false): void { if (is_file($source)) { self::copyFile($source, $dest, $override); return; } if ( ! is_dir($source)) { Helpers::consoleMessage("File or directory '%s' not found.", [$source]); return; } $sourceHandle = ope...
php
public static function copy(string $source, string $dest, bool $override = false): void { if (is_file($source)) { self::copyFile($source, $dest, $override); return; } if ( ! is_dir($source)) { Helpers::consoleMessage("File or directory '%s' not found.", [$source]); return; } $sourceHandle = ope...
[ "public", "static", "function", "copy", "(", "string", "$", "source", ",", "string", "$", "dest", ",", "bool", "$", "override", "=", "false", ")", ":", "void", "{", "if", "(", "is_file", "(", "$", "source", ")", ")", "{", "self", "::", "copyFile", ...
Copies files recursively and automatically creates nested directories
[ "Copies", "files", "recursively", "and", "automatically", "creates", "nested", "directories" ]
ca1c2f4dd05e0142148c030dba63b5081edb2bc3
https://github.com/composer-synchronizer/composer-synchronizer/blob/ca1c2f4dd05e0142148c030dba63b5081edb2bc3/src/Helpers.php#L78-L115
train
Dhii/output-renderer-abstract
src/CaptureOutputCapableTrait.php
CaptureOutputCapableTrait._captureOutput
protected function _captureOutput(callable $callable, $args = null) { // Default if (is_null($args)) { $args = []; } ob_start(); $this->_invokeCallable($callable, $args); $output = ob_get_clean(); return $output; }
php
protected function _captureOutput(callable $callable, $args = null) { // Default if (is_null($args)) { $args = []; } ob_start(); $this->_invokeCallable($callable, $args); $output = ob_get_clean(); return $output; }
[ "protected", "function", "_captureOutput", "(", "callable", "$", "callable", ",", "$", "args", "=", "null", ")", "{", "// Default", "if", "(", "is_null", "(", "$", "args", ")", ")", "{", "$", "args", "=", "[", "]", ";", "}", "ob_start", "(", ")", "...
Invokes the given callable, and returns the output as a string. @since [*next-version*] @param callable $callable The callable that may produce output. @param array|stdClass|Traversable|null $args The arguments to invoke the callable with. Defaults to empty array. @throws InvalidArgumentEx...
[ "Invokes", "the", "given", "callable", "and", "returns", "the", "output", "as", "a", "string", "." ]
0f6e5eed940025332dd1986d6c771e10f7197b1a
https://github.com/Dhii/output-renderer-abstract/blob/0f6e5eed940025332dd1986d6c771e10f7197b1a/src/CaptureOutputCapableTrait.php#L32-L44
train
diasbruno/stc
lib/stc/DataValidator.php
DataValidator.walker
private function walker($keys, &$arr) { if (count($keys) == 0) { return true; } $current = array_shift($keys); return (is_array($arr) ? array_key_exists($current, $arr) : false) && ((is_array($arr[$current])) ? $this->walker($keys, $arr[$current]) : ...
php
private function walker($keys, &$arr) { if (count($keys) == 0) { return true; } $current = array_shift($keys); return (is_array($arr) ? array_key_exists($current, $arr) : false) && ((is_array($arr[$current])) ? $this->walker($keys, $arr[$current]) : ...
[ "private", "function", "walker", "(", "$", "keys", ",", "&", "$", "arr", ")", "{", "if", "(", "count", "(", "$", "keys", ")", "==", "0", ")", "{", "return", "true", ";", "}", "$", "current", "=", "array_shift", "(", "$", "keys", ")", ";", "retu...
Recursive walker to check. @param $keys array | List of keys. @param $arr array | A hash list to check. @return bool
[ "Recursive", "walker", "to", "check", "." ]
43f62c3b28167bff76274f954e235413a9e9c707
https://github.com/diasbruno/stc/blob/43f62c3b28167bff76274f954e235413a9e9c707/lib/stc/DataValidator.php#L33-L47
train
diasbruno/stc
lib/stc/DataValidator.php
DataValidator.validate
public function validate(&$arr) { if (count($this->list) == 0) { return true; } $ok = true; foreach ($this->list as $key => $value) { $list = explode('.', $value); $ok = $ok && $this->walker($list, $arr); } return $ok; }
php
public function validate(&$arr) { if (count($this->list) == 0) { return true; } $ok = true; foreach ($this->list as $key => $value) { $list = explode('.', $value); $ok = $ok && $this->walker($list, $arr); } return $ok; }
[ "public", "function", "validate", "(", "&", "$", "arr", ")", "{", "if", "(", "count", "(", "$", "this", "->", "list", ")", "==", "0", ")", "{", "return", "true", ";", "}", "$", "ok", "=", "true", ";", "foreach", "(", "$", "this", "->", "list", ...
Tries to validate a hash list. @param $arr array | The array to check. @return bool
[ "Tries", "to", "validate", "a", "hash", "list", "." ]
43f62c3b28167bff76274f954e235413a9e9c707
https://github.com/diasbruno/stc/blob/43f62c3b28167bff76274f954e235413a9e9c707/lib/stc/DataValidator.php#L54-L68
train
opis/events
src/EventDispatcher.php
EventDispatcher.handle
public function handle(string $event, callable $callback, int $priority = 0): Route { return $this->collection->createRoute($event, $callback)->set('priority', $priority); }
php
public function handle(string $event, callable $callback, int $priority = 0): Route { return $this->collection->createRoute($event, $callback)->set('priority', $priority); }
[ "public", "function", "handle", "(", "string", "$", "event", ",", "callable", "$", "callback", ",", "int", "$", "priority", "=", "0", ")", ":", "Route", "{", "return", "$", "this", "->", "collection", "->", "createRoute", "(", "$", "event", ",", "$", ...
Handle an event @param string $event Event's name @param callable $callback Callback @param int $priority (optional) Event's priority @return Route
[ "Handle", "an", "event" ]
97f34bd0334975580ee915661c79880061c1bf1a
https://github.com/opis/events/blob/97f34bd0334975580ee915661c79880061c1bf1a/src/EventDispatcher.php#L54-L57
train
opis/events
src/EventDispatcher.php
EventDispatcher.emit
public function emit(string $name, bool $cancelable = false): Event { return $this->dispatch(new Event($name, $cancelable)); }
php
public function emit(string $name, bool $cancelable = false): Event { return $this->dispatch(new Event($name, $cancelable)); }
[ "public", "function", "emit", "(", "string", "$", "name", ",", "bool", "$", "cancelable", "=", "false", ")", ":", "Event", "{", "return", "$", "this", "->", "dispatch", "(", "new", "Event", "(", "$", "name", ",", "$", "cancelable", ")", ")", ";", "...
Emits an event @param string $name Event's name @param boolean $cancelable (optional) Cancelable event @return Event
[ "Emits", "an", "event" ]
97f34bd0334975580ee915661c79880061c1bf1a
https://github.com/opis/events/blob/97f34bd0334975580ee915661c79880061c1bf1a/src/EventDispatcher.php#L67-L70
train
schpill/thin
src/Facebook.php
Facebook.getFacebookHelper
public function getFacebookHelper() { $redirectHelper = new FacebookRedirectLoginHelper( $this->getRedirectUrl(), $this->appId, $this->appSecret ); $redirectHelper->disableSessionStatusCheck(); return $redirectHelp...
php
public function getFacebookHelper() { $redirectHelper = new FacebookRedirectLoginHelper( $this->getRedirectUrl(), $this->appId, $this->appSecret ); $redirectHelper->disableSessionStatusCheck(); return $redirectHelp...
[ "public", "function", "getFacebookHelper", "(", ")", "{", "$", "redirectHelper", "=", "new", "FacebookRedirectLoginHelper", "(", "$", "this", "->", "getRedirectUrl", "(", ")", ",", "$", "this", "->", "appId", ",", "$", "this", "->", "appSecret", ")", ";", ...
Get Facebook Redirect Login Helper. @return FacebookRedirectLoginHelper
[ "Get", "Facebook", "Redirect", "Login", "Helper", "." ]
a9102d9d6f70e8b0f6be93153f70849f46489ee1
https://github.com/schpill/thin/blob/a9102d9d6f70e8b0f6be93153f70849f46489ee1/src/Facebook.php#L114-L125
train
schpill/thin
src/Facebook.php
Facebook.getLoginUrl
public function getLoginUrl($scope = array(), $version = null) { $scope = $this->getScope($scope); return $this->getFacebookHelper()->getLoginUrl($scope, $version); }
php
public function getLoginUrl($scope = array(), $version = null) { $scope = $this->getScope($scope); return $this->getFacebookHelper()->getLoginUrl($scope, $version); }
[ "public", "function", "getLoginUrl", "(", "$", "scope", "=", "array", "(", ")", ",", "$", "version", "=", "null", ")", "{", "$", "scope", "=", "$", "this", "->", "getScope", "(", "$", "scope", ")", ";", "return", "$", "this", "->", "getFacebookHelper...
Get Login Url. @param array $scope @param null $version @return string
[ "Get", "Login", "Url", "." ]
a9102d9d6f70e8b0f6be93153f70849f46489ee1
https://github.com/schpill/thin/blob/a9102d9d6f70e8b0f6be93153f70849f46489ee1/src/Facebook.php#L207-L212
train
schpill/thin
src/Facebook.php
Facebook.getCallback
public function getCallback() { $token = $this->getAccessToken(); if ( ! empty($token)) { $this->putSessionToken($token); return true; } return false; }
php
public function getCallback() { $token = $this->getAccessToken(); if ( ! empty($token)) { $this->putSessionToken($token); return true; } return false; }
[ "public", "function", "getCallback", "(", ")", "{", "$", "token", "=", "$", "this", "->", "getAccessToken", "(", ")", ";", "if", "(", "!", "empty", "(", "$", "token", ")", ")", "{", "$", "this", "->", "putSessionToken", "(", "$", "token", ")", ";",...
Get callback from facebook. @return boolean
[ "Get", "callback", "from", "facebook", "." ]
a9102d9d6f70e8b0f6be93153f70849f46489ee1
https://github.com/schpill/thin/blob/a9102d9d6f70e8b0f6be93153f70849f46489ee1/src/Facebook.php#L304-L314
train
schpill/thin
src/Facebook.php
Facebook.api
public function api($method, $path, $parameters = null, $version = null, $etag = null) { $session = new FacebookSession($this->getAccessToken()); $request = with(new FacebookRequest($session, $method, $path, $parameters, $version, $etag)) ->execute() ->ge...
php
public function api($method, $path, $parameters = null, $version = null, $etag = null) { $session = new FacebookSession($this->getAccessToken()); $request = with(new FacebookRequest($session, $method, $path, $parameters, $version, $etag)) ->execute() ->ge...
[ "public", "function", "api", "(", "$", "method", ",", "$", "path", ",", "$", "parameters", "=", "null", ",", "$", "version", "=", "null", ",", "$", "etag", "=", "null", ")", "{", "$", "session", "=", "new", "FacebookSession", "(", "$", "this", "->"...
Facebook API Call. @param string $method The request method. @param string $path The end points path. @param mixed $parameters Parameters. @param string $version The specified version of Api. @param mixed $etag @return mixed
[ "Facebook", "API", "Call", "." ]
a9102d9d6f70e8b0f6be93153f70849f46489ee1
https://github.com/schpill/thin/blob/a9102d9d6f70e8b0f6be93153f70849f46489ee1/src/Facebook.php#L357-L366
train
schpill/thin
src/Facebook.php
Facebook.get
public function get($path, $parameters = null, $version = null, $etag = null) { return $this->api('GET', $path, $parameters, $version, $etag); }
php
public function get($path, $parameters = null, $version = null, $etag = null) { return $this->api('GET', $path, $parameters, $version, $etag); }
[ "public", "function", "get", "(", "$", "path", ",", "$", "parameters", "=", "null", ",", "$", "version", "=", "null", ",", "$", "etag", "=", "null", ")", "{", "return", "$", "this", "->", "api", "(", "'GET'", ",", "$", "path", ",", "$", "paramete...
Facebook API Request with "GET" method. @param string $path @param string|null|mixed $parameters @param string|null|mixed $version @param string|null|mixed $etag @return mixed
[ "Facebook", "API", "Request", "with", "GET", "method", "." ]
a9102d9d6f70e8b0f6be93153f70849f46489ee1
https://github.com/schpill/thin/blob/a9102d9d6f70e8b0f6be93153f70849f46489ee1/src/Facebook.php#L377-L380
train
schpill/thin
src/Facebook.php
Facebook.post
public function post($path, $parameters = null, $version = null, $etag = null) { return $this->api('POST', $path, $parameters, $version, $etag); }
php
public function post($path, $parameters = null, $version = null, $etag = null) { return $this->api('POST', $path, $parameters, $version, $etag); }
[ "public", "function", "post", "(", "$", "path", ",", "$", "parameters", "=", "null", ",", "$", "version", "=", "null", ",", "$", "etag", "=", "null", ")", "{", "return", "$", "this", "->", "api", "(", "'POST'", ",", "$", "path", ",", "$", "parame...
Facebook API Request with "POST" method. @param string $path @param string|null|mixed $parameters @param string|null|mixed $version @param string|null|mixed $etag @return mixed
[ "Facebook", "API", "Request", "with", "POST", "method", "." ]
a9102d9d6f70e8b0f6be93153f70849f46489ee1
https://github.com/schpill/thin/blob/a9102d9d6f70e8b0f6be93153f70849f46489ee1/src/Facebook.php#L391-L394
train
schpill/thin
src/Facebook.php
Facebook.delete
public function delete($path, $parameters = null, $version = null, $etag = null) { return $this->api('DELETE', $path, $parameters, $version, $etag); }
php
public function delete($path, $parameters = null, $version = null, $etag = null) { return $this->api('DELETE', $path, $parameters, $version, $etag); }
[ "public", "function", "delete", "(", "$", "path", ",", "$", "parameters", "=", "null", ",", "$", "version", "=", "null", ",", "$", "etag", "=", "null", ")", "{", "return", "$", "this", "->", "api", "(", "'DELETE'", ",", "$", "path", ",", "$", "pa...
Facebook API Request with "DELETE" method. @param string $path @param string|null|mixed $parameters @param string|null|mixed $version @param string|null|mixed $etag @return mixed
[ "Facebook", "API", "Request", "with", "DELETE", "method", "." ]
a9102d9d6f70e8b0f6be93153f70849f46489ee1
https://github.com/schpill/thin/blob/a9102d9d6f70e8b0f6be93153f70849f46489ee1/src/Facebook.php#L405-L408
train
schpill/thin
src/Facebook.php
Facebook.put
public function put($path, $parameters = null, $version = null, $etag = null) { return $this->api('PUT', $path, $parameters, $version, $etag); }
php
public function put($path, $parameters = null, $version = null, $etag = null) { return $this->api('PUT', $path, $parameters, $version, $etag); }
[ "public", "function", "put", "(", "$", "path", ",", "$", "parameters", "=", "null", ",", "$", "version", "=", "null", ",", "$", "etag", "=", "null", ")", "{", "return", "$", "this", "->", "api", "(", "'PUT'", ",", "$", "path", ",", "$", "paramete...
Facebook API Request with "PUT" method. @param string $path @param string|null|mixed $parameters @param string|null|mixed $version @param string|null|mixed $etag @return mixed
[ "Facebook", "API", "Request", "with", "PUT", "method", "." ]
a9102d9d6f70e8b0f6be93153f70849f46489ee1
https://github.com/schpill/thin/blob/a9102d9d6f70e8b0f6be93153f70849f46489ee1/src/Facebook.php#L419-L422
train
schpill/thin
src/Facebook.php
Facebook.patch
public function patch($path, $parameters = null, $version = null, $etag = null) { return $this->api('PATCH', $path, $parameters, $version, $etag); }
php
public function patch($path, $parameters = null, $version = null, $etag = null) { return $this->api('PATCH', $path, $parameters, $version, $etag); }
[ "public", "function", "patch", "(", "$", "path", ",", "$", "parameters", "=", "null", ",", "$", "version", "=", "null", ",", "$", "etag", "=", "null", ")", "{", "return", "$", "this", "->", "api", "(", "'PATCH'", ",", "$", "path", ",", "$", "para...
Facebook API Request with "PATCH" method. @param string $path @param string|null|mixed $parameters @param string|null|mixed $version @param string|null|mixed $etag @return mixed
[ "Facebook", "API", "Request", "with", "PATCH", "method", "." ]
a9102d9d6f70e8b0f6be93153f70849f46489ee1
https://github.com/schpill/thin/blob/a9102d9d6f70e8b0f6be93153f70849f46489ee1/src/Facebook.php#L433-L436
train
schpill/thin
src/Facebook.php
Facebook.getProfile
public function getProfile($parameters = [], $version = null, $etag = null) { return $this->get('/me', $parameters, $version, $etag); }
php
public function getProfile($parameters = [], $version = null, $etag = null) { return $this->get('/me', $parameters, $version, $etag); }
[ "public", "function", "getProfile", "(", "$", "parameters", "=", "[", "]", ",", "$", "version", "=", "null", ",", "$", "etag", "=", "null", ")", "{", "return", "$", "this", "->", "get", "(", "'/me'", ",", "$", "parameters", ",", "$", "version", ","...
Get user profile. @param array $parameters @param null $version @param null $etag @return mixed
[ "Get", "user", "profile", "." ]
a9102d9d6f70e8b0f6be93153f70849f46489ee1
https://github.com/schpill/thin/blob/a9102d9d6f70e8b0f6be93153f70849f46489ee1/src/Facebook.php#L446-L449
train
infusephp/auth
src/Libs/Strategy/TraditionalStrategy.php
TraditionalStrategy.verifyPassword
public function verifyPassword(UserInterface $user, $password) { if (!$password) { return false; } $hashedPassword = $user->getHashedPassword(); if (!$hashedPassword) { return false; } return password_verify($password, $hashedPassword); }
php
public function verifyPassword(UserInterface $user, $password) { if (!$password) { return false; } $hashedPassword = $user->getHashedPassword(); if (!$hashedPassword) { return false; } return password_verify($password, $hashedPassword); }
[ "public", "function", "verifyPassword", "(", "UserInterface", "$", "user", ",", "$", "password", ")", "{", "if", "(", "!", "$", "password", ")", "{", "return", "false", ";", "}", "$", "hashedPassword", "=", "$", "user", "->", "getHashedPassword", "(", ")...
Checks if a given password matches the user's password. @param UserInterface $user @param string $password @return bool
[ "Checks", "if", "a", "given", "password", "matches", "the", "user", "s", "password", "." ]
720280b4b2635572f331afe8d082e3e88cf54eb7
https://github.com/infusephp/auth/blob/720280b4b2635572f331afe8d082e3e88cf54eb7/src/Libs/Strategy/TraditionalStrategy.php#L142-L154
train
infusephp/auth
src/Libs/Strategy/TraditionalStrategy.php
TraditionalStrategy.getRateLimiter
function getRateLimiter() { if ($this->rateLimiter) { return $this->rateLimiter; } $app = $this->auth->getApp(); $class = $app['config']->get('auth.loginRateLimiter', NullRateLimiter::class); $this->rateLimiter = new $class(); if (method_exists($this->ra...
php
function getRateLimiter() { if ($this->rateLimiter) { return $this->rateLimiter; } $app = $this->auth->getApp(); $class = $app['config']->get('auth.loginRateLimiter', NullRateLimiter::class); $this->rateLimiter = new $class(); if (method_exists($this->ra...
[ "function", "getRateLimiter", "(", ")", "{", "if", "(", "$", "this", "->", "rateLimiter", ")", "{", "return", "$", "this", "->", "rateLimiter", ";", "}", "$", "app", "=", "$", "this", "->", "auth", "->", "getApp", "(", ")", ";", "$", "class", "=", ...
Gets the login rate limiter. @return \Infuse\Auth\Interfaces\LoginRateLimiterInterface
[ "Gets", "the", "login", "rate", "limiter", "." ]
720280b4b2635572f331afe8d082e3e88cf54eb7
https://github.com/infusephp/auth/blob/720280b4b2635572f331afe8d082e3e88cf54eb7/src/Libs/Strategy/TraditionalStrategy.php#L161-L176
train