repository_name
stringlengths
5
67
func_path_in_repository
stringlengths
4
234
func_name
stringlengths
0
314
whole_func_string
stringlengths
52
3.87M
language
stringclasses
6 values
func_code_string
stringlengths
52
3.87M
func_code_tokens
listlengths
15
672k
func_documentation_string
stringlengths
1
47.2k
func_documentation_tokens
listlengths
1
3.92k
split_name
stringclasses
1 value
func_code_url
stringlengths
85
339
stubbles/stubbles-webapp-core
src/main/php/routing/Route.php
Route.preIntercept
public function preIntercept($preInterceptor): ConfigurableRoute { if (!is_callable($preInterceptor) && !($preInterceptor instanceof PreInterceptor) && !class_exists((string) $preInterceptor)) { throw new \InvalidArgumentException( 'Given pre interceptor must be a callable, a...
php
public function preIntercept($preInterceptor): ConfigurableRoute { if (!is_callable($preInterceptor) && !($preInterceptor instanceof PreInterceptor) && !class_exists((string) $preInterceptor)) { throw new \InvalidArgumentException( 'Given pre interceptor must be a callable, a...
[ "public", "function", "preIntercept", "(", "$", "preInterceptor", ")", ":", "ConfigurableRoute", "{", "if", "(", "!", "is_callable", "(", "$", "preInterceptor", ")", "&&", "!", "(", "$", "preInterceptor", "instanceof", "PreInterceptor", ")", "&&", "!", "class_...
add a pre interceptor for this route @param string|callable|\stubbles\webapp\interceptor\PreInterceptor $preInterceptor @return \stubbles\webapp\routing\Route @throws \InvalidArgumentException
[ "add", "a", "pre", "interceptor", "for", "this", "route" ]
train
https://github.com/stubbles/stubbles-webapp-core/blob/7705f129011a81d5cc3c76b4b150fab3dadac6a3/src/main/php/routing/Route.php#L226-L238
stubbles/stubbles-webapp-core
src/main/php/routing/Route.php
Route.postIntercept
public function postIntercept($postInterceptor): ConfigurableRoute { if (!is_callable($postInterceptor) && !($postInterceptor instanceof PostInterceptor) && !class_exists((string) $postInterceptor)) { throw new \InvalidArgumentException( 'Given pre interceptor must be a calla...
php
public function postIntercept($postInterceptor): ConfigurableRoute { if (!is_callable($postInterceptor) && !($postInterceptor instanceof PostInterceptor) && !class_exists((string) $postInterceptor)) { throw new \InvalidArgumentException( 'Given pre interceptor must be a calla...
[ "public", "function", "postIntercept", "(", "$", "postInterceptor", ")", ":", "ConfigurableRoute", "{", "if", "(", "!", "is_callable", "(", "$", "postInterceptor", ")", "&&", "!", "(", "$", "postInterceptor", "instanceof", "PostInterceptor", ")", "&&", "!", "c...
add a post interceptor for this route @param string|callable|\stubbles\webapp\interceptor\PostInterceptor $postInterceptor @return \stubbles\webapp\routing\Route @throws \InvalidArgumentException
[ "add", "a", "post", "interceptor", "for", "this", "route" ]
train
https://github.com/stubbles/stubbles-webapp-core/blob/7705f129011a81d5cc3c76b4b150fab3dadac6a3/src/main/php/routing/Route.php#L257-L269
stubbles/stubbles-webapp-core
src/main/php/routing/Route.php
Route.requiresHttps
public function requiresHttps(): bool { if ($this->requiresHttps) { return true; } $this->requiresHttps = $this->routingAnnotations()->requiresHttps(); return $this->requiresHttps; }
php
public function requiresHttps(): bool { if ($this->requiresHttps) { return true; } $this->requiresHttps = $this->routingAnnotations()->requiresHttps(); return $this->requiresHttps; }
[ "public", "function", "requiresHttps", "(", ")", ":", "bool", "{", "if", "(", "$", "this", "->", "requiresHttps", ")", "{", "return", "true", ";", "}", "$", "this", "->", "requiresHttps", "=", "$", "this", "->", "routingAnnotations", "(", ")", "->", "r...
whether route is only available via https @return bool
[ "whether", "route", "is", "only", "available", "via", "https" ]
train
https://github.com/stubbles/stubbles-webapp-core/blob/7705f129011a81d5cc3c76b4b150fab3dadac6a3/src/main/php/routing/Route.php#L297-L305
stubbles/stubbles-webapp-core
src/main/php/routing/Route.php
Route.authConstraint
public function authConstraint(): AuthConstraint { if (null === $this->authConstraint) { $this->authConstraint = new AuthConstraint($this->routingAnnotations()); } return $this->authConstraint; }
php
public function authConstraint(): AuthConstraint { if (null === $this->authConstraint) { $this->authConstraint = new AuthConstraint($this->routingAnnotations()); } return $this->authConstraint; }
[ "public", "function", "authConstraint", "(", ")", ":", "AuthConstraint", "{", "if", "(", "null", "===", "$", "this", "->", "authConstraint", ")", "{", "$", "this", "->", "authConstraint", "=", "new", "AuthConstraint", "(", "$", "this", "->", "routingAnnotati...
returns auth constraint for this route @return \stubbles\webapp\auth\AuthConstraint
[ "returns", "auth", "constraint", "for", "this", "route" ]
train
https://github.com/stubbles/stubbles-webapp-core/blob/7705f129011a81d5cc3c76b4b150fab3dadac6a3/src/main/php/routing/Route.php#L363-L370
stubbles/stubbles-webapp-core
src/main/php/routing/Route.php
Route.supportsMimeType
public function supportsMimeType(string $mimeType, string $class = null): ConfigurableRoute { if (null === $class && !SupportedMimeTypes::provideDefaultClassFor($mimeType)) { throw new \InvalidArgumentException( 'No default class known for mime type ' . $mimeType ...
php
public function supportsMimeType(string $mimeType, string $class = null): ConfigurableRoute { if (null === $class && !SupportedMimeTypes::provideDefaultClassFor($mimeType)) { throw new \InvalidArgumentException( 'No default class known for mime type ' . $mimeType ...
[ "public", "function", "supportsMimeType", "(", "string", "$", "mimeType", ",", "string", "$", "class", "=", "null", ")", ":", "ConfigurableRoute", "{", "if", "(", "null", "===", "$", "class", "&&", "!", "SupportedMimeTypes", "::", "provideDefaultClassFor", "("...
add a mime type which this route supports @param string $mimeType @param string $class optional special class to be used for given mime type on this route @return \stubbles\webapp\routing\Route @throws \InvalidArgumentException
[ "add", "a", "mime", "type", "which", "this", "route", "supports" ]
train
https://github.com/stubbles/stubbles-webapp-core/blob/7705f129011a81d5cc3c76b4b150fab3dadac6a3/src/main/php/routing/Route.php#L380-L395
stubbles/stubbles-webapp-core
src/main/php/routing/Route.php
Route.supportedMimeTypes
public function supportedMimeTypes( array $globalMimeTypes = [], array $globalClasses = [] ): SupportedMimeTypes { if ($this->disableContentNegotation || $this->routingAnnotations()->isContentNegotiationDisabled()) { return SupportedMimeTypes::createWithDisabledContentNeg...
php
public function supportedMimeTypes( array $globalMimeTypes = [], array $globalClasses = [] ): SupportedMimeTypes { if ($this->disableContentNegotation || $this->routingAnnotations()->isContentNegotiationDisabled()) { return SupportedMimeTypes::createWithDisabledContentNeg...
[ "public", "function", "supportedMimeTypes", "(", "array", "$", "globalMimeTypes", "=", "[", "]", ",", "array", "$", "globalClasses", "=", "[", "]", ")", ":", "SupportedMimeTypes", "{", "if", "(", "$", "this", "->", "disableContentNegotation", "||", "$", "thi...
returns list of mime types supported by this route @param string[] $globalMimeTypes optional list of globally supported mime types @param string[] $globalClasses optional list of globally defined mime type classes @return \stubbles\webapp\routing\SupportedMimeTypes
[ "returns", "list", "of", "mime", "types", "supported", "by", "this", "route" ]
train
https://github.com/stubbles/stubbles-webapp-core/blob/7705f129011a81d5cc3c76b4b150fab3dadac6a3/src/main/php/routing/Route.php#L404-L425
stubbles/stubbles-webapp-core
src/main/php/routing/Route.php
Route.routingAnnotations
private function routingAnnotations(): RoutingAnnotations { if (null === $this->routingAnnotations) { $this->routingAnnotations = new RoutingAnnotations($this->target); } return $this->routingAnnotations; }
php
private function routingAnnotations(): RoutingAnnotations { if (null === $this->routingAnnotations) { $this->routingAnnotations = new RoutingAnnotations($this->target); } return $this->routingAnnotations; }
[ "private", "function", "routingAnnotations", "(", ")", ":", "RoutingAnnotations", "{", "if", "(", "null", "===", "$", "this", "->", "routingAnnotations", ")", "{", "$", "this", "->", "routingAnnotations", "=", "new", "RoutingAnnotations", "(", "$", "this", "->...
returns list of callback annotations @return \stubbles\webapp\routing\RoutingAnnotations
[ "returns", "list", "of", "callback", "annotations" ]
train
https://github.com/stubbles/stubbles-webapp-core/blob/7705f129011a81d5cc3c76b4b150fab3dadac6a3/src/main/php/routing/Route.php#L444-L451
stubbles/stubbles-webapp-core
src/main/php/routing/Route.php
Route.asResource
public function asResource(HttpUri $uri, array $globalMimeTypes = []): Resource { $routeUri = $uri->withPath($this->normalizePath()); return new Resource( $this->resourceName(), $this->allowedRequestMethods, $this->requiresHttps() ? $routeUri->toHttps(...
php
public function asResource(HttpUri $uri, array $globalMimeTypes = []): Resource { $routeUri = $uri->withPath($this->normalizePath()); return new Resource( $this->resourceName(), $this->allowedRequestMethods, $this->requiresHttps() ? $routeUri->toHttps(...
[ "public", "function", "asResource", "(", "HttpUri", "$", "uri", ",", "array", "$", "globalMimeTypes", "=", "[", "]", ")", ":", "Resource", "{", "$", "routeUri", "=", "$", "uri", "->", "withPath", "(", "$", "this", "->", "normalizePath", "(", ")", ")", ...
returns route as resource @param \stubbles\peer\http\HttpUri $uri @param string[] $globalMimeTypes list of globally supported mime types @return \stubbles\webapp\routing\api\Resource @since 6.1.0
[ "returns", "route", "as", "resource" ]
train
https://github.com/stubbles/stubbles-webapp-core/blob/7705f129011a81d5cc3c76b4b150fab3dadac6a3/src/main/php/routing/Route.php#L488-L499
stubbles/stubbles-webapp-core
src/main/php/routing/Route.php
Route.normalizePath
private function normalizePath(): string { $path = $this->path; if (substr($path, -1) === '$') { $path = substr($path, 0, strlen($path) - 1); } if (substr($path, -1) === '?') { $path = substr($path, 0, strlen($path) - 1); } return $path; ...
php
private function normalizePath(): string { $path = $this->path; if (substr($path, -1) === '$') { $path = substr($path, 0, strlen($path) - 1); } if (substr($path, -1) === '?') { $path = substr($path, 0, strlen($path) - 1); } return $path; ...
[ "private", "function", "normalizePath", "(", ")", ":", "string", "{", "$", "path", "=", "$", "this", "->", "path", ";", "if", "(", "substr", "(", "$", "path", ",", "-", "1", ")", "===", "'$'", ")", "{", "$", "path", "=", "substr", "(", "$", "pa...
normalizes path for better understanding @return string
[ "normalizes", "path", "for", "better", "understanding" ]
train
https://github.com/stubbles/stubbles-webapp-core/blob/7705f129011a81d5cc3c76b4b150fab3dadac6a3/src/main/php/routing/Route.php#L506-L518
stubbles/stubbles-webapp-core
src/main/php/routing/Route.php
Route.resourceName
private function resourceName() { if ($this->routingAnnotations()->hasName()) { return $this->routingAnnotations()->name(); } if (is_string($this->target) && class_exists($this->target)) { return substr( $this->target, strrpos(...
php
private function resourceName() { if ($this->routingAnnotations()->hasName()) { return $this->routingAnnotations()->name(); } if (is_string($this->target) && class_exists($this->target)) { return substr( $this->target, strrpos(...
[ "private", "function", "resourceName", "(", ")", "{", "if", "(", "$", "this", "->", "routingAnnotations", "(", ")", "->", "hasName", "(", ")", ")", "{", "return", "$", "this", "->", "routingAnnotations", "(", ")", "->", "name", "(", ")", ";", "}", "i...
returns useful name for resource @return string|null
[ "returns", "useful", "name", "for", "resource" ]
train
https://github.com/stubbles/stubbles-webapp-core/blob/7705f129011a81d5cc3c76b4b150fab3dadac6a3/src/main/php/routing/Route.php#L525-L544
danmichaelo/quitesimplexmlelement
src/Danmichaelo/QuiteSimpleXMLElement/SimpleXMLElementWrapper.php
SimpleXMLElementWrapper.getSimpleXMLElement
private function getSimpleXMLElement($elem) { if (gettype($elem) == 'string') { return $this->initFromString($elem); } if (gettype($elem) == 'object') { return $this->initFromObject($elem); } }
php
private function getSimpleXMLElement($elem) { if (gettype($elem) == 'string') { return $this->initFromString($elem); } if (gettype($elem) == 'object') { return $this->initFromObject($elem); } }
[ "private", "function", "getSimpleXMLElement", "(", "$", "elem", ")", "{", "if", "(", "gettype", "(", "$", "elem", ")", "==", "'string'", ")", "{", "return", "$", "this", "->", "initFromString", "(", "$", "elem", ")", ";", "}", "if", "(", "gettype", "...
Internal helper method to get a SimpleXMLElement from either a string or a SimpleXMLElement/QuiteSimpleXMLElement object. @param string|SimpleXMLElement|QuiteSimpleXMLElement $elem @return SimpleXMLElement @throws InvalidXMLException @throws InvalidArgumentException
[ "Internal", "helper", "method", "to", "get", "a", "SimpleXMLElement", "from", "either", "a", "string", "or", "a", "SimpleXMLElement", "/", "QuiteSimpleXMLElement", "object", "." ]
train
https://github.com/danmichaelo/quitesimplexmlelement/blob/566261ac5a789d63fda4ffc328501213772c1b27/src/Danmichaelo/QuiteSimpleXMLElement/SimpleXMLElementWrapper.php#L98-L107
danmichaelo/quitesimplexmlelement
src/Danmichaelo/QuiteSimpleXMLElement/SimpleXMLElementWrapper.php
SimpleXMLElementWrapper.registerXPathNamespace
public function registerXPathNamespace($prefix, $uri) { $this->el->registerXPathNamespace($prefix, $uri); $this->namespaces[$prefix] = $uri; }
php
public function registerXPathNamespace($prefix, $uri) { $this->el->registerXPathNamespace($prefix, $uri); $this->namespaces[$prefix] = $uri; }
[ "public", "function", "registerXPathNamespace", "(", "$", "prefix", ",", "$", "uri", ")", "{", "$", "this", "->", "el", "->", "registerXPathNamespace", "(", "$", "prefix", ",", "$", "uri", ")", ";", "$", "this", "->", "namespaces", "[", "$", "prefix", ...
Register a new xpath namespace. @param string $prefix @param string $uri
[ "Register", "a", "new", "xpath", "namespace", "." ]
train
https://github.com/danmichaelo/quitesimplexmlelement/blob/566261ac5a789d63fda4ffc328501213772c1b27/src/Danmichaelo/QuiteSimpleXMLElement/SimpleXMLElementWrapper.php#L146-L150
danmichaelo/quitesimplexmlelement
src/Danmichaelo/QuiteSimpleXMLElement/SimpleXMLElementWrapper.php
SimpleXMLElementWrapper.registerXPathNamespaces
public function registerXPathNamespaces($namespaces) { // Convenience method to add multiple namespaces at once foreach ($namespaces as $prefix => $uri) { $this->registerXPathNamespace($prefix, $uri); } }
php
public function registerXPathNamespaces($namespaces) { // Convenience method to add multiple namespaces at once foreach ($namespaces as $prefix => $uri) { $this->registerXPathNamespace($prefix, $uri); } }
[ "public", "function", "registerXPathNamespaces", "(", "$", "namespaces", ")", "{", "// Convenience method to add multiple namespaces at once", "foreach", "(", "$", "namespaces", "as", "$", "prefix", "=>", "$", "uri", ")", "{", "$", "this", "->", "registerXPathNamespac...
Register an array of new xpath namespaces. @param array $namespaces
[ "Register", "an", "array", "of", "new", "xpath", "namespaces", "." ]
train
https://github.com/danmichaelo/quitesimplexmlelement/blob/566261ac5a789d63fda4ffc328501213772c1b27/src/Danmichaelo/QuiteSimpleXMLElement/SimpleXMLElementWrapper.php#L157-L163
danmichaelo/quitesimplexmlelement
src/Danmichaelo/QuiteSimpleXMLElement/SimpleXMLElementWrapper.php
SimpleXMLElementWrapper.children
public function children($ns = null) { $ch = is_null($ns) ? $this->el->children() : $this->el->children($this->namespaces[$ns]); $o = []; foreach ($ch as $c) { $o[] = new static($c, $this); } return $o; }
php
public function children($ns = null) { $ch = is_null($ns) ? $this->el->children() : $this->el->children($this->namespaces[$ns]); $o = []; foreach ($ch as $c) { $o[] = new static($c, $this); } return $o; }
[ "public", "function", "children", "(", "$", "ns", "=", "null", ")", "{", "$", "ch", "=", "is_null", "(", "$", "ns", ")", "?", "$", "this", "->", "el", "->", "children", "(", ")", ":", "$", "this", "->", "el", "->", "children", "(", "$", "this",...
Returns child elements. Note: By default, only children without namespace will be returned! You can specify a namespace prefix to get children with that namespace prefix. If you want all child elements, namespaced or not, use `$record->all('child::*')` instead. @param string $ns @return QuiteSimpleXMLElement[]
[ "Returns", "child", "elements", "." ]
train
https://github.com/danmichaelo/quitesimplexmlelement/blob/566261ac5a789d63fda4ffc328501213772c1b27/src/Danmichaelo/QuiteSimpleXMLElement/SimpleXMLElementWrapper.php#L196-L208
danmichaelo/quitesimplexmlelement
src/Danmichaelo/QuiteSimpleXMLElement/SimpleXMLElementWrapper.php
SimpleXMLElementWrapper.attributes
public function attributes($ns = null, $is_prefix = false) { return $this->el->attributes($ns, $is_prefix); }
php
public function attributes($ns = null, $is_prefix = false) { return $this->el->attributes($ns, $is_prefix); }
[ "public", "function", "attributes", "(", "$", "ns", "=", "null", ",", "$", "is_prefix", "=", "false", ")", "{", "return", "$", "this", "->", "el", "->", "attributes", "(", "$", "ns", ",", "$", "is_prefix", ")", ";", "}" ]
Returns and element's attributes. @param string $ns @param bool $is_prefix @return SimpleXMLElement a `SimpleXMLElement` object that can be iterated over to loop through the attributes on the tag.
[ "Returns", "and", "element", "s", "attributes", "." ]
train
https://github.com/danmichaelo/quitesimplexmlelement/blob/566261ac5a789d63fda4ffc328501213772c1b27/src/Danmichaelo/QuiteSimpleXMLElement/SimpleXMLElementWrapper.php#L235-L238
danmichaelo/quitesimplexmlelement
src/Danmichaelo/QuiteSimpleXMLElement/SimpleXMLElementWrapper.php
SimpleXMLElementWrapper.replace
public function replace(QuiteSimpleXMLElement $element) { $oldNode = $this->asDOMElement(); $newNode = $oldNode->ownerDocument->importNode( $element->asDOMElement(), true ); $oldNode->parentNode->replaceChild($newNode, $oldNode); }
php
public function replace(QuiteSimpleXMLElement $element) { $oldNode = $this->asDOMElement(); $newNode = $oldNode->ownerDocument->importNode( $element->asDOMElement(), true ); $oldNode->parentNode->replaceChild($newNode, $oldNode); }
[ "public", "function", "replace", "(", "QuiteSimpleXMLElement", "$", "element", ")", "{", "$", "oldNode", "=", "$", "this", "->", "asDOMElement", "(", ")", ";", "$", "newNode", "=", "$", "oldNode", "->", "ownerDocument", "->", "importNode", "(", "$", "eleme...
Replaces the current node. Thanks to @hakre <http://stackoverflow.com/questions/17661167/how-to-replace-xml-node-with-simplexmlelement-php>. @param QuiteSimpleXMLElement $element
[ "Replaces", "the", "current", "node", ".", "Thanks", "to", "@hakre", "<http", ":", "//", "stackoverflow", ".", "com", "/", "questions", "/", "17661167", "/", "how", "-", "to", "-", "replace", "-", "xml", "-", "node", "-", "with", "-", "simplexmlelement",...
train
https://github.com/danmichaelo/quitesimplexmlelement/blob/566261ac5a789d63fda4ffc328501213772c1b27/src/Danmichaelo/QuiteSimpleXMLElement/SimpleXMLElementWrapper.php#L296-L304
pageon/SlackWebhookMonolog
src/Monolog/SlackWebhookHandler.php
SlackWebhookHandler.write
public function write(array $record) { $curlUtil = $this->curlUtil; $curlSession = curl_init(); curl_setopt($curlSession, CURLOPT_URL, $this->slackConfig->getWebhook()); curl_setopt($curlSession, CURLOPT_POST, true); curl_setopt($curlSession, CURLOPT_RETURNTRANSFER, true); ...
php
public function write(array $record) { $curlUtil = $this->curlUtil; $curlSession = curl_init(); curl_setopt($curlSession, CURLOPT_URL, $this->slackConfig->getWebhook()); curl_setopt($curlSession, CURLOPT_POST, true); curl_setopt($curlSession, CURLOPT_RETURNTRANSFER, true); ...
[ "public", "function", "write", "(", "array", "$", "record", ")", "{", "$", "curlUtil", "=", "$", "this", "->", "curlUtil", ";", "$", "curlSession", "=", "curl_init", "(", ")", ";", "curl_setopt", "(", "$", "curlSession", ",", "CURLOPT_URL", ",", "$", "...
{@inheritdoc}
[ "{" ]
train
https://github.com/pageon/SlackWebhookMonolog/blob/6755060ddd6429620fd4c7decbb95f05463fc36b/src/Monolog/SlackWebhookHandler.php#L54-L66
phramework/jsonapi
src/Controller/DELETE.php
DELETE.handleDELETE
protected static function handleDELETE( $parameters, $method, $headers, $id, $modelClass, $primaryDataParameters = [], $validationCallbacks = [], $viewCallback = null ) { if ($viewCallback !== null && !is_callable($viewCallback)) { ...
php
protected static function handleDELETE( $parameters, $method, $headers, $id, $modelClass, $primaryDataParameters = [], $validationCallbacks = [], $viewCallback = null ) { if ($viewCallback !== null && !is_callable($viewCallback)) { ...
[ "protected", "static", "function", "handleDELETE", "(", "$", "parameters", ",", "$", "method", ",", "$", "headers", ",", "$", "id", ",", "$", "modelClass", ",", "$", "primaryDataParameters", "=", "[", "]", ",", "$", "validationCallbacks", "=", "[", "]", ...
Handle DELETE method On success will respond with 204 No Content @param object $parameters Request parameters @param string $method Request method @param array $headers Request headers @param integer|string $id Requested...
[ "Handle", "DELETE", "method", "On", "success", "will", "respond", "with", "204", "No", "Content" ]
train
https://github.com/phramework/jsonapi/blob/af20882a8b6f6e5be9c8e09e5b87f6c23a4b0726/src/Controller/DELETE.php#L49-L102
huasituo/hstcms
src/Model/CommonConfigModel.php
CommonConfigModel.getConfigByName
static function getConfigByName($namespace, $name) { $info = CommonConfigModel::where('namespace', $namespace) ->where('name', $name) ->first(); if (!empty($info)) { return $info; } return array(); ...
php
static function getConfigByName($namespace, $name) { $info = CommonConfigModel::where('namespace', $namespace) ->where('name', $name) ->first(); if (!empty($info)) { return $info; } return array(); ...
[ "static", "function", "getConfigByName", "(", "$", "namespace", ",", "$", "name", ")", "{", "$", "info", "=", "CommonConfigModel", "::", "where", "(", "'namespace'", ",", "$", "namespace", ")", "->", "where", "(", "'name'", ",", "$", "name", ")", "->", ...
获取某个配置 ok @param string $namespace @param string $name @return array
[ "获取某个配置", "ok" ]
train
https://github.com/huasituo/hstcms/blob/12819979289e58ce38e3e92540aeeb16e205e525/src/Model/CommonConfigModel.php#L43-L52
huasituo/hstcms
src/Model/CommonConfigModel.php
CommonConfigModel.storeConfigs
static function storeConfigs($data) { foreach ($data as $value) { $value['issystem'] = isset($value['issystem']) && $value['issystem'] ? intval($value['issystem']) : 0 ; $value['desc'] = isset($value['desc']) && $value['desc'] ? $value['desc'] : '' ; $value['value'] = is...
php
static function storeConfigs($data) { foreach ($data as $value) { $value['issystem'] = isset($value['issystem']) && $value['issystem'] ? intval($value['issystem']) : 0 ; $value['desc'] = isset($value['desc']) && $value['desc'] ? $value['desc'] : '' ; $value['value'] = is...
[ "static", "function", "storeConfigs", "(", "$", "data", ")", "{", "foreach", "(", "$", "data", "as", "$", "value", ")", "{", "$", "value", "[", "'issystem'", "]", "=", "isset", "(", "$", "value", "[", "'issystem'", "]", ")", "&&", "$", "value", "["...
批量设置配置项 ok @param array $data 待设置的配置项 @return boolean
[ "批量设置配置项", "ok" ]
train
https://github.com/huasituo/hstcms/blob/12819979289e58ce38e3e92540aeeb16e205e525/src/Model/CommonConfigModel.php#L60-L69
huasituo/hstcms
src/Model/CommonConfigModel.php
CommonConfigModel.storeConfig
static function storeConfig($namespace, $name, $value = '', $issystem = 0, $desc = null) { $array = []; list($array['vtype'], $array['value']) = self::_toString($value); $array['desc'] = isset($desc) && $desc ? $desc : '' ; isset($issystem) && $array['issystem'] = $issystem; ...
php
static function storeConfig($namespace, $name, $value = '', $issystem = 0, $desc = null) { $array = []; list($array['vtype'], $array['value']) = self::_toString($value); $array['desc'] = isset($desc) && $desc ? $desc : '' ; isset($issystem) && $array['issystem'] = $issystem; ...
[ "static", "function", "storeConfig", "(", "$", "namespace", ",", "$", "name", ",", "$", "value", "=", "''", ",", "$", "issystem", "=", "0", ",", "$", "desc", "=", "null", ")", "{", "$", "array", "=", "[", "]", ";", "list", "(", "$", "array", "[...
存储配置项 ok @param string $namespace 配置项命名空间 @param string $name 配置项名 @param mixed $value 配置项的值 @param string $issystem 是否为系统 @param string $desc 配置项描述 @return boolean
[ "存储配置项", "ok" ]
train
https://github.com/huasituo/hstcms/blob/12819979289e58ce38e3e92540aeeb16e205e525/src/Model/CommonConfigModel.php#L81-L98
huasituo/hstcms
src/Model/CommonConfigModel.php
CommonConfigModel.deleteConfig
static function deleteConfig($namespace) { $result = CommonConfigModel::where('namespace', $namespace)->delete(); $cacheName = 'config:'.$namespace; Cache::forget($cacheName); return $result; }
php
static function deleteConfig($namespace) { $result = CommonConfigModel::where('namespace', $namespace)->delete(); $cacheName = 'config:'.$namespace; Cache::forget($cacheName); return $result; }
[ "static", "function", "deleteConfig", "(", "$", "namespace", ")", "{", "$", "result", "=", "CommonConfigModel", "::", "where", "(", "'namespace'", ",", "$", "namespace", ")", "->", "delete", "(", ")", ";", "$", "cacheName", "=", "'config:'", ".", "$", "n...
删除配置项 @param string $namespace 配置项所属空间 @return boolean
[ "删除配置项" ]
train
https://github.com/huasituo/hstcms/blob/12819979289e58ce38e3e92540aeeb16e205e525/src/Model/CommonConfigModel.php#L106-L112
huasituo/hstcms
src/Model/CommonConfigModel.php
CommonConfigModel.deleteConfigByName
static function deleteConfigByName($namespace, $name) { $result = CommonConfigModel::where('namespace', $namespace) ->where('name', $name) ->delete(); self::setCache($namespace); return $result; }
php
static function deleteConfigByName($namespace, $name) { $result = CommonConfigModel::where('namespace', $namespace) ->where('name', $name) ->delete(); self::setCache($namespace); return $result; }
[ "static", "function", "deleteConfigByName", "(", "$", "namespace", ",", "$", "name", ")", "{", "$", "result", "=", "CommonConfigModel", "::", "where", "(", "'namespace'", ",", "$", "namespace", ")", "->", "where", "(", "'name'", ",", "$", "name", ")", "-...
删除配置项 ok @param string $namespace 配置项所属空间 @param string $name 配置项名字 @return boolean
[ "删除配置项", "ok" ]
train
https://github.com/huasituo/hstcms/blob/12819979289e58ce38e3e92540aeeb16e205e525/src/Model/CommonConfigModel.php#L121-L128
huasituo/hstcms
src/Model/CommonConfigModel.php
CommonConfigModel._toString
static function _toString($value) { $vtype = 'string'; if (is_array($value)) { $value = serialize($value); $vtype = 'array'; } elseif (is_object($value)) { $value = serialize($value); $vtype = 'object'; } return array($vtype, $...
php
static function _toString($value) { $vtype = 'string'; if (is_array($value)) { $value = serialize($value); $vtype = 'array'; } elseif (is_object($value)) { $value = serialize($value); $vtype = 'object'; } return array($vtype, $...
[ "static", "function", "_toString", "(", "$", "value", ")", "{", "$", "vtype", "=", "'string'", ";", "if", "(", "is_array", "(", "$", "value", ")", ")", "{", "$", "value", "=", "serialize", "(", "$", "value", ")", ";", "$", "vtype", "=", "'array'", ...
将数据转换为字符串 ok @param mixed $value 待处理的数据 @return array 返回处理后的数据,第一个代表该数据的类型,第二个代表该数据处理后的数据串
[ "将数据转换为字符串", "ok" ]
train
https://github.com/huasituo/hstcms/blob/12819979289e58ce38e3e92540aeeb16e205e525/src/Model/CommonConfigModel.php#L136-L147
huasituo/hstcms
src/Model/CommonConfigModel.php
CommonConfigModel._getInfo
static function _getInfo($vtype, $value) { $val = $value; if($vtype =='array' || $vtype == 'object') { $val = unserialize($value); } return $val; }
php
static function _getInfo($vtype, $value) { $val = $value; if($vtype =='array' || $vtype == 'object') { $val = unserialize($value); } return $val; }
[ "static", "function", "_getInfo", "(", "$", "vtype", ",", "$", "value", ")", "{", "$", "val", "=", "$", "value", ";", "if", "(", "$", "vtype", "==", "'array'", "||", "$", "vtype", "==", "'object'", ")", "{", "$", "val", "=", "unserialize", "(", "...
将字符串转为数据 ok @param string $vtype 数据类型 @param mixed $value 待处理的数据 @return array|string 返回处理后的数据
[ "将字符串转为数据", "ok" ]
train
https://github.com/huasituo/hstcms/blob/12819979289e58ce38e3e92540aeeb16e205e525/src/Model/CommonConfigModel.php#L156-L163
huasituo/hstcms
src/Model/CommonConfigModel.php
CommonConfigModel.setCache
static function setCache($namespace) { $cacheData = []; $data = CommonConfigModel::getConfigByNamespace($namespace); foreach ($data as $key => $value) { $cacheData[$value['name']] = [ 'value'=>self::_getInfo($value['vtype'], $value['value']), 'issy...
php
static function setCache($namespace) { $cacheData = []; $data = CommonConfigModel::getConfigByNamespace($namespace); foreach ($data as $key => $value) { $cacheData[$value['name']] = [ 'value'=>self::_getInfo($value['vtype'], $value['value']), 'issy...
[ "static", "function", "setCache", "(", "$", "namespace", ")", "{", "$", "cacheData", "=", "[", "]", ";", "$", "data", "=", "CommonConfigModel", "::", "getConfigByNamespace", "(", "$", "namespace", ")", ";", "foreach", "(", "$", "data", "as", "$", "key", ...
设置数据缓存 ok @param string $namespace @return array 返回处理后的数据
[ "设置数据缓存", "ok" ]
train
https://github.com/huasituo/hstcms/blob/12819979289e58ce38e3e92540aeeb16e205e525/src/Model/CommonConfigModel.php#L171-L185
huasituo/hstcms
src/Model/CommonConfigModel.php
CommonConfigModel.setAllCache
static function setAllCache() { $list = CommonConfigModel::select('namespace')->get(); if($list) { foreach ($list as $key => $value) { self::setCache($value['namespace']); } } return true; }
php
static function setAllCache() { $list = CommonConfigModel::select('namespace')->get(); if($list) { foreach ($list as $key => $value) { self::setCache($value['namespace']); } } return true; }
[ "static", "function", "setAllCache", "(", ")", "{", "$", "list", "=", "CommonConfigModel", "::", "select", "(", "'namespace'", ")", "->", "get", "(", ")", ";", "if", "(", "$", "list", ")", "{", "foreach", "(", "$", "list", "as", "$", "key", "=>", "...
更新全部缓存 ok
[ "更新全部缓存", "ok" ]
train
https://github.com/huasituo/hstcms/blob/12819979289e58ce38e3e92540aeeb16e205e525/src/Model/CommonConfigModel.php#L190-L199
huasituo/hstcms
src/Model/CommonConfigModel.php
CommonConfigModel.get
static function get($namespace, $name = null, $isall = false) { $cacheName = 'config:'.$namespace; if (!Cache::has($cacheName)) { $data = self::setCache($namespace); } else { $data = Cache::get($cacheName, []); if($name) { if(!$isall) retur...
php
static function get($namespace, $name = null, $isall = false) { $cacheName = 'config:'.$namespace; if (!Cache::has($cacheName)) { $data = self::setCache($namespace); } else { $data = Cache::get($cacheName, []); if($name) { if(!$isall) retur...
[ "static", "function", "get", "(", "$", "namespace", ",", "$", "name", "=", "null", ",", "$", "isall", "=", "false", ")", "{", "$", "cacheName", "=", "'config:'", ".", "$", "namespace", ";", "if", "(", "!", "Cache", "::", "has", "(", "$", "cacheName...
======================================================================================================================
[ "======================================================================================================================" ]
train
https://github.com/huasituo/hstcms/blob/12819979289e58ce38e3e92540aeeb16e205e525/src/Model/CommonConfigModel.php#L203-L223
dantleech/glob
lib/DTL/Glob/Finder/PhpcrOdmTraversalFinder.php
PhpcrOdmTraversalFinder.getNode
protected function getNode(array $pathSegments) { $absPath = '/' . implode('/', $pathSegments); return $this->getManager()->find(null, $absPath); }
php
protected function getNode(array $pathSegments) { $absPath = '/' . implode('/', $pathSegments); return $this->getManager()->find(null, $absPath); }
[ "protected", "function", "getNode", "(", "array", "$", "pathSegments", ")", "{", "$", "absPath", "=", "'/'", ".", "implode", "(", "'/'", ",", "$", "pathSegments", ")", ";", "return", "$", "this", "->", "getManager", "(", ")", "->", "find", "(", "null",...
{@inheritDoc}
[ "{" ]
train
https://github.com/dantleech/glob/blob/1f618e6b77a5de4c6b0538d82572fe19cbb1c446/lib/DTL/Glob/Finder/PhpcrOdmTraversalFinder.php#L47-L51
fuelphp/display
src/Parser/Mustache.php
Mustache.setupMustache
public function setupMustache() { $mustacheLoader = new MustacheLoader($this->viewManager); $config = ['loader' => $mustacheLoader]; if ($this->viewManager->cachePath) { $config['cache'] = $this->viewManager->cachePath.'mustache/'; } $this->mustache = new Mustache_Engine($config); }
php
public function setupMustache() { $mustacheLoader = new MustacheLoader($this->viewManager); $config = ['loader' => $mustacheLoader]; if ($this->viewManager->cachePath) { $config['cache'] = $this->viewManager->cachePath.'mustache/'; } $this->mustache = new Mustache_Engine($config); }
[ "public", "function", "setupMustache", "(", ")", "{", "$", "mustacheLoader", "=", "new", "MustacheLoader", "(", "$", "this", "->", "viewManager", ")", ";", "$", "config", "=", "[", "'loader'", "=>", "$", "mustacheLoader", "]", ";", "if", "(", "$", "this"...
Sets up Mustache_Engine
[ "Sets", "up", "Mustache_Engine" ]
train
https://github.com/fuelphp/display/blob/d9a3eddbf80f0fd81beb40d9f4507600ac6611a4/src/Parser/Mustache.php#L51-L62
fuelphp/display
src/Parser/Mustache.php
Mustache.parse
public function parse($file, array $data = []) { $mustache = $this->getMustache(); return $mustache->render($file, $data); }
php
public function parse($file, array $data = []) { $mustache = $this->getMustache(); return $mustache->render($file, $data); }
[ "public", "function", "parse", "(", "$", "file", ",", "array", "$", "data", "=", "[", "]", ")", "{", "$", "mustache", "=", "$", "this", "->", "getMustache", "(", ")", ";", "return", "$", "mustache", "->", "render", "(", "$", "file", ",", "$", "da...
{@inheritdoc}
[ "{" ]
train
https://github.com/fuelphp/display/blob/d9a3eddbf80f0fd81beb40d9f4507600ac6611a4/src/Parser/Mustache.php#L67-L72
php-ddd/command
src/Handler/Locator/CommandHandlerLocator.php
CommandHandlerLocator.getCommandHandlerForCommand
public function getCommandHandlerForCommand(CommandInterface $command) { $commandClassName = get_class($command); if (!$this->isCommandRegistered($commandClassName)) { throw new NoCommandHandlerRegisteredException( sprintf( 'No handler registered to h...
php
public function getCommandHandlerForCommand(CommandInterface $command) { $commandClassName = get_class($command); if (!$this->isCommandRegistered($commandClassName)) { throw new NoCommandHandlerRegisteredException( sprintf( 'No handler registered to h...
[ "public", "function", "getCommandHandlerForCommand", "(", "CommandInterface", "$", "command", ")", "{", "$", "commandClassName", "=", "get_class", "(", "$", "command", ")", ";", "if", "(", "!", "$", "this", "->", "isCommandRegistered", "(", "$", "commandClassNam...
{@inheritdoc}
[ "{" ]
train
https://github.com/php-ddd/command/blob/dbad1d35c8d740c29c3a28d34f4a787c2b14688a/src/Handler/Locator/CommandHandlerLocator.php#L24-L38
php-ddd/command
src/Handler/Locator/CommandHandlerLocator.php
CommandHandlerLocator.register
public function register($commandClassName, CommandHandlerInterface $commandHandler) { $this->assertNamingConventionSatisfied($commandClassName, get_class($commandHandler)); $this->assertImplementsCommandInterface($commandClassName); if ($this->isCommandRegistered($commandClassName)) { ...
php
public function register($commandClassName, CommandHandlerInterface $commandHandler) { $this->assertNamingConventionSatisfied($commandClassName, get_class($commandHandler)); $this->assertImplementsCommandInterface($commandClassName); if ($this->isCommandRegistered($commandClassName)) { ...
[ "public", "function", "register", "(", "$", "commandClassName", ",", "CommandHandlerInterface", "$", "commandHandler", ")", "{", "$", "this", "->", "assertNamingConventionSatisfied", "(", "$", "commandClassName", ",", "get_class", "(", "$", "commandHandler", ")", ")...
@param string $commandClassName @param CommandHandlerInterface $commandHandler @throws InvalidArgumentException
[ "@param", "string", "$commandClassName", "@param", "CommandHandlerInterface", "$commandHandler" ]
train
https://github.com/php-ddd/command/blob/dbad1d35c8d740c29c3a28d34f4a787c2b14688a/src/Handler/Locator/CommandHandlerLocator.php#L54-L70
php-ddd/command
src/Handler/Locator/CommandHandlerLocator.php
CommandHandlerLocator.assertNamingConventionSatisfied
private function assertNamingConventionSatisfied($commandClassName, $handlerClassName) { if (!$this->isNamingConventionSatisfied($commandClassName, $handlerClassName)) { throw new InvalidArgumentException( sprintf( 'Command Handler does not follow naming conve...
php
private function assertNamingConventionSatisfied($commandClassName, $handlerClassName) { if (!$this->isNamingConventionSatisfied($commandClassName, $handlerClassName)) { throw new InvalidArgumentException( sprintf( 'Command Handler does not follow naming conve...
[ "private", "function", "assertNamingConventionSatisfied", "(", "$", "commandClassName", ",", "$", "handlerClassName", ")", "{", "if", "(", "!", "$", "this", "->", "isNamingConventionSatisfied", "(", "$", "commandClassName", ",", "$", "handlerClassName", ")", ")", ...
@param string $commandClassName @param string $handlerClassName @throws InvalidArgumentException
[ "@param", "string", "$commandClassName", "@param", "string", "$handlerClassName" ]
train
https://github.com/php-ddd/command/blob/dbad1d35c8d740c29c3a28d34f4a787c2b14688a/src/Handler/Locator/CommandHandlerLocator.php#L78-L89
php-ddd/command
src/Handler/Locator/CommandHandlerLocator.php
CommandHandlerLocator.isNamingConventionSatisfied
private function isNamingConventionSatisfied($commandClassName, $handlerClassName) { $handlerClassName = ClassUtils::shortName($handlerClassName); return $this->getExpectedHandlerName($commandClassName) === $handlerClassName; }
php
private function isNamingConventionSatisfied($commandClassName, $handlerClassName) { $handlerClassName = ClassUtils::shortName($handlerClassName); return $this->getExpectedHandlerName($commandClassName) === $handlerClassName; }
[ "private", "function", "isNamingConventionSatisfied", "(", "$", "commandClassName", ",", "$", "handlerClassName", ")", "{", "$", "handlerClassName", "=", "ClassUtils", "::", "shortName", "(", "$", "handlerClassName", ")", ";", "return", "$", "this", "->", "getExpe...
@param string $commandClassName @param string $handlerClassName @return bool
[ "@param", "string", "$commandClassName", "@param", "string", "$handlerClassName" ]
train
https://github.com/php-ddd/command/blob/dbad1d35c8d740c29c3a28d34f4a787c2b14688a/src/Handler/Locator/CommandHandlerLocator.php#L97-L102
php-ddd/command
src/Handler/Locator/CommandHandlerLocator.php
CommandHandlerLocator.getExpectedHandlerName
private function getExpectedHandlerName($commandClassName) { $commandClassName = ClassUtils::shortName($commandClassName); if ('Command' === substr($commandClassName, -7)) { $commandClassName = substr($commandClassName, 0, -7); } return $commandClassName.'CommandHandler'...
php
private function getExpectedHandlerName($commandClassName) { $commandClassName = ClassUtils::shortName($commandClassName); if ('Command' === substr($commandClassName, -7)) { $commandClassName = substr($commandClassName, 0, -7); } return $commandClassName.'CommandHandler'...
[ "private", "function", "getExpectedHandlerName", "(", "$", "commandClassName", ")", "{", "$", "commandClassName", "=", "ClassUtils", "::", "shortName", "(", "$", "commandClassName", ")", ";", "if", "(", "'Command'", "===", "substr", "(", "$", "commandClassName", ...
@param string $commandClassName @return string
[ "@param", "string", "$commandClassName" ]
train
https://github.com/php-ddd/command/blob/dbad1d35c8d740c29c3a28d34f4a787c2b14688a/src/Handler/Locator/CommandHandlerLocator.php#L109-L117
opis/storages
cache/Redis.php
Redis.write
public function write($key, $value, $ttl = 0) { $this->redis->set($this->prefix . $key, is_numeric($value) ? $value : serialize($value)); if ($ttl != 0) { $this->redis->expire($this->prefix . $key, $ttl); } return true; }
php
public function write($key, $value, $ttl = 0) { $this->redis->set($this->prefix . $key, is_numeric($value) ? $value : serialize($value)); if ($ttl != 0) { $this->redis->expire($this->prefix . $key, $ttl); } return true; }
[ "public", "function", "write", "(", "$", "key", ",", "$", "value", ",", "$", "ttl", "=", "0", ")", "{", "$", "this", "->", "redis", "->", "set", "(", "$", "this", "->", "prefix", ".", "$", "key", ",", "is_numeric", "(", "$", "value", ")", "?", ...
Store variable in the cache. @param string $key Cache key @param mixed $value The variable to store @param int $ttl (optional) Time to live @return boolean
[ "Store", "variable", "in", "the", "cache", "." ]
train
https://github.com/opis/storages/blob/548dd631239c7cd75c04d17878b677e646540fde/cache/Redis.php#L63-L70
opis/storages
cache/Redis.php
Redis.read
public function read($key) { $data = $this->redis->get($this->prefix . $key); return $data === null ? false : (is_numeric($data) ? $data : unserialize($data)); }
php
public function read($key) { $data = $this->redis->get($this->prefix . $key); return $data === null ? false : (is_numeric($data) ? $data : unserialize($data)); }
[ "public", "function", "read", "(", "$", "key", ")", "{", "$", "data", "=", "$", "this", "->", "redis", "->", "get", "(", "$", "this", "->", "prefix", ".", "$", "key", ")", ";", "return", "$", "data", "===", "null", "?", "false", ":", "(", "is_n...
Fetch variable from the cache. @param string $key Cache key @return mixed
[ "Fetch", "variable", "from", "the", "cache", "." ]
train
https://github.com/opis/storages/blob/548dd631239c7cd75c04d17878b677e646540fde/cache/Redis.php#L79-L83
huasituo/hstcms
src/Console/Generators/MakeManageFounderCommand.php
MakeManageFounderCommand.stepOne
private function stepOne() { $t = $this->option('t'); if($t === 'add') { $this->container['username'] = $this->ask('Please enter the username:', 'admin1'); $this->container['password'] = $this->ask('Please enter the password:', 'admin888'); $this->co...
php
private function stepOne() { $t = $this->option('t'); if($t === 'add') { $this->container['username'] = $this->ask('Please enter the username:', 'admin1'); $this->container['password'] = $this->ask('Please enter the password:', 'admin888'); $this->co...
[ "private", "function", "stepOne", "(", ")", "{", "$", "t", "=", "$", "this", "->", "option", "(", "'t'", ")", ";", "if", "(", "$", "t", "===", "'add'", ")", "{", "$", "this", "->", "container", "[", "'username'", "]", "=", "$", "this", "->", "a...
Step 1: Configure module manifest. @return mixed
[ "Step", "1", ":", "Configure", "module", "manifest", "." ]
train
https://github.com/huasituo/hstcms/blob/12819979289e58ce38e3e92540aeeb16e205e525/src/Console/Generators/MakeManageFounderCommand.php#L84-L146
activecollab/databasestructure
src/Builder/BaseManagerDirBuilder.php
BaseManagerDirBuilder.preBuild
public function preBuild() { $build_path = $this->getBuildPath(); if ($build_path) { if (is_dir($build_path)) { $build_path = rtrim($build_path, DIRECTORY_SEPARATOR); if (!is_dir("$build_path/Manager/Base")) { $old_umask = umask(0); ...
php
public function preBuild() { $build_path = $this->getBuildPath(); if ($build_path) { if (is_dir($build_path)) { $build_path = rtrim($build_path, DIRECTORY_SEPARATOR); if (!is_dir("$build_path/Manager/Base")) { $old_umask = umask(0); ...
[ "public", "function", "preBuild", "(", ")", "{", "$", "build_path", "=", "$", "this", "->", "getBuildPath", "(", ")", ";", "if", "(", "$", "build_path", ")", "{", "if", "(", "is_dir", "(", "$", "build_path", ")", ")", "{", "$", "build_path", "=", "...
Execute prior to type build.
[ "Execute", "prior", "to", "type", "build", "." ]
train
https://github.com/activecollab/databasestructure/blob/4b2353c4422186bcfce63b3212da3e70e63eb5df/src/Builder/BaseManagerDirBuilder.php#L22-L45
stubbles/stubbles-webapp-core
src/main/php/response/Headers.php
Headers.add
public function add(string $name, $value): self { $this->headers[$name] = $value; return $this; }
php
public function add(string $name, $value): self { $this->headers[$name] = $value; return $this; }
[ "public", "function", "add", "(", "string", "$", "name", ",", "$", "value", ")", ":", "self", "{", "$", "this", "->", "headers", "[", "$", "name", "]", "=", "$", "value", ";", "return", "$", "this", ";", "}" ]
adds header with given name @param string $name @param mixed $value @return \stubbles\webapp\response\Headers
[ "adds", "header", "with", "given", "name" ]
train
https://github.com/stubbles/stubbles-webapp-core/blob/7705f129011a81d5cc3c76b4b150fab3dadac6a3/src/main/php/response/Headers.php#L34-L38
stubbles/stubbles-webapp-core
src/main/php/response/Headers.php
Headers.location
public function location($uri): self { return $this->add( 'Location', (($uri instanceof HttpUri) ? ($uri->asStringWithNonDefaultPort()) : ($uri)) ); }
php
public function location($uri): self { return $this->add( 'Location', (($uri instanceof HttpUri) ? ($uri->asStringWithNonDefaultPort()) : ($uri)) ); }
[ "public", "function", "location", "(", "$", "uri", ")", ":", "self", "{", "return", "$", "this", "->", "add", "(", "'Location'", ",", "(", "(", "$", "uri", "instanceof", "HttpUri", ")", "?", "(", "$", "uri", "->", "asStringWithNonDefaultPort", "(", ")"...
adds location header with given uri @param string|\stubbles\peer\http\HttpUri $uri @return \stubbles\webapp\response\Headers
[ "adds", "location", "header", "with", "given", "uri" ]
train
https://github.com/stubbles/stubbles-webapp-core/blob/7705f129011a81d5cc3c76b4b150fab3dadac6a3/src/main/php/response/Headers.php#L59-L65
stubbles/stubbles-webapp-core
src/main/php/response/Headers.php
Headers.acceptable
public function acceptable(array $supportedMimeTypes): self { if (count($supportedMimeTypes) > 0) { $this->add('X-Acceptable', join(', ', $supportedMimeTypes)); } return $this; }
php
public function acceptable(array $supportedMimeTypes): self { if (count($supportedMimeTypes) > 0) { $this->add('X-Acceptable', join(', ', $supportedMimeTypes)); } return $this; }
[ "public", "function", "acceptable", "(", "array", "$", "supportedMimeTypes", ")", ":", "self", "{", "if", "(", "count", "(", "$", "supportedMimeTypes", ")", ">", "0", ")", "{", "$", "this", "->", "add", "(", "'X-Acceptable'", ",", "join", "(", "', '", ...
adds non-standard acceptable header with list of supported mime types @param string[] $supportedMimeTypes @return \stubbles\webapp\response\Headers
[ "adds", "non", "-", "standard", "acceptable", "header", "with", "list", "of", "supported", "mime", "types" ]
train
https://github.com/stubbles/stubbles-webapp-core/blob/7705f129011a81d5cc3c76b4b150fab3dadac6a3/src/main/php/response/Headers.php#L84-L91
stubbles/stubbles-webapp-core
src/main/php/response/Headers.php
Headers.cacheControl
public function cacheControl(): CacheControl { $cacheControl = new CacheControl(); $this->add(CacheControl::HEADER_NAME, $cacheControl); return $cacheControl; }
php
public function cacheControl(): CacheControl { $cacheControl = new CacheControl(); $this->add(CacheControl::HEADER_NAME, $cacheControl); return $cacheControl; }
[ "public", "function", "cacheControl", "(", ")", ":", "CacheControl", "{", "$", "cacheControl", "=", "new", "CacheControl", "(", ")", ";", "$", "this", "->", "add", "(", "CacheControl", "::", "HEADER_NAME", ",", "$", "cacheControl", ")", ";", "return", "$",...
enables the Cache-Control header If no specific directives are enabled the value will be <code>Cache-Control: private</code> by default. @return \stubbles\webapp\response\CacheControl @see http://tools.ietf.org/html/rfc7234#section-5.2 @since 5.1.0
[ "enables", "the", "Cache", "-", "Control", "header" ]
train
https://github.com/stubbles/stubbles-webapp-core/blob/7705f129011a81d5cc3c76b4b150fab3dadac6a3/src/main/php/response/Headers.php#L115-L120
czim/laravel-pxlcms
src/Generator/Writer/Model/Steps/StubReplaceAccessorsAndMutators.php
StubReplaceAccessorsAndMutators.collectNormalBelongsToRelationAccessors
protected function collectNormalBelongsToRelationAccessors() { $accessors = []; foreach ($this->data['relationships']['normal'] as $name => $relationship) { if ($relationship['type'] != Generator::RELATIONSHIP_BELONGS_TO) continue; if ( ! empty($relationship['key']) && snake...
php
protected function collectNormalBelongsToRelationAccessors() { $accessors = []; foreach ($this->data['relationships']['normal'] as $name => $relationship) { if ($relationship['type'] != Generator::RELATIONSHIP_BELONGS_TO) continue; if ( ! empty($relationship['key']) && snake...
[ "protected", "function", "collectNormalBelongsToRelationAccessors", "(", ")", "{", "$", "accessors", "=", "[", "]", ";", "foreach", "(", "$", "this", "->", "data", "[", "'relationships'", "]", "[", "'normal'", "]", "as", "$", "name", "=>", "$", "relationship...
For belongs-to relationships that share foreign key & relation name @return array name => array with properties
[ "For", "belongs", "-", "to", "relationships", "that", "share", "foreign", "key", "&", "relation", "name" ]
train
https://github.com/czim/laravel-pxlcms/blob/910297d2a3f2db86dde51b0e10fe5aad45f1aa1a/src/Generator/Writer/Model/Steps/StubReplaceAccessorsAndMutators.php#L75-L94
gdbots/pbjx-bundle-php
src/Command/ReindexEventsCommand.php
ReindexEventsCommand.execute
protected function execute(InputInterface $input, OutputInterface $output) { $dryRun = $input->getOption('dry-run'); $skipErrors = $input->getOption('skip-errors'); $batchSize = NumberUtils::bound($input->getOption('batch-size'), 1, 1000); $batchDelay = NumberUtils::bound($input->get...
php
protected function execute(InputInterface $input, OutputInterface $output) { $dryRun = $input->getOption('dry-run'); $skipErrors = $input->getOption('skip-errors'); $batchSize = NumberUtils::bound($input->getOption('batch-size'), 1, 1000); $batchDelay = NumberUtils::bound($input->get...
[ "protected", "function", "execute", "(", "InputInterface", "$", "input", ",", "OutputInterface", "$", "output", ")", "{", "$", "dryRun", "=", "$", "input", "->", "getOption", "(", "'dry-run'", ")", ";", "$", "skipErrors", "=", "$", "input", "->", "getOptio...
@param InputInterface $input @param OutputInterface $output @return null
[ "@param", "InputInterface", "$input", "@param", "OutputInterface", "$output" ]
train
https://github.com/gdbots/pbjx-bundle-php/blob/f3c0088583879fc92f13247a0752634bd8696eac/src/Command/ReindexEventsCommand.php#L113-L211
gdbots/pbjx-bundle-php
src/Command/ReindexEventsCommand.php
ReindexEventsCommand.reindex
protected function reindex(array $events, int &$reindexed, SymfonyStyle $io, array $context, int $batch, bool $dryRun = false, bool $skipErrors = false): void { if ($dryRun) { $io->note(sprintf('DRY RUN - Would reindex event batch %d here.', $batch)); } else { try { ...
php
protected function reindex(array $events, int &$reindexed, SymfonyStyle $io, array $context, int $batch, bool $dryRun = false, bool $skipErrors = false): void { if ($dryRun) { $io->note(sprintf('DRY RUN - Would reindex event batch %d here.', $batch)); } else { try { ...
[ "protected", "function", "reindex", "(", "array", "$", "events", ",", "int", "&", "$", "reindexed", ",", "SymfonyStyle", "$", "io", ",", "array", "$", "context", ",", "int", "$", "batch", ",", "bool", "$", "dryRun", "=", "false", ",", "bool", "$", "s...
@param Event[] $events @param int $reindexed @param SymfonyStyle $io @param array $context @param int $batch @param bool $dryRun @param bool $skipErrors @throws \Exception
[ "@param", "Event", "[]", "$events", "@param", "int", "$reindexed", "@param", "SymfonyStyle", "$io", "@param", "array", "$context", "@param", "int", "$batch", "@param", "bool", "$dryRun", "@param", "bool", "$skipErrors" ]
train
https://github.com/gdbots/pbjx-bundle-php/blob/f3c0088583879fc92f13247a0752634bd8696eac/src/Command/ReindexEventsCommand.php#L224-L243
acasademont/wurfl
WURFL/WURFLService.php
WURFL_WURFLService.getDeviceForRequest
public function getDeviceForRequest(WURFL_Request_GenericRequest $request) { $deviceId = $this->deviceIdForRequest($request); return $this->getWrappedDevice($deviceId, $request); }
php
public function getDeviceForRequest(WURFL_Request_GenericRequest $request) { $deviceId = $this->deviceIdForRequest($request); return $this->getWrappedDevice($deviceId, $request); }
[ "public", "function", "getDeviceForRequest", "(", "WURFL_Request_GenericRequest", "$", "request", ")", "{", "$", "deviceId", "=", "$", "this", "->", "deviceIdForRequest", "(", "$", "request", ")", ";", "return", "$", "this", "->", "getWrappedDevice", "(", "$", ...
Returns the Device for the given WURFL_Request_GenericRequest @param WURFL_Request_GenericRequest $request @return WURFL_CustomDevice
[ "Returns", "the", "Device", "for", "the", "given", "WURFL_Request_GenericRequest" ]
train
https://github.com/acasademont/wurfl/blob/0f4fb6e06b452ba95ad1d15e7d8226d0974b60c2/WURFL/WURFLService.php#L62-L66
acasademont/wurfl
WURFL/WURFLService.php
WURFL_WURFLService.getDevice
public function getDevice($deviceID, $request=null) { if ($request !== null) { if (!($request instanceof WURFL_Request_GenericRequest)) { throw new InvalidArgumentException("Error: Request parameter must be null or instance of WURFL_Request_GenericRequest"); } ...
php
public function getDevice($deviceID, $request=null) { if ($request !== null) { if (!($request instanceof WURFL_Request_GenericRequest)) { throw new InvalidArgumentException("Error: Request parameter must be null or instance of WURFL_Request_GenericRequest"); } ...
[ "public", "function", "getDevice", "(", "$", "deviceID", ",", "$", "request", "=", "null", ")", "{", "if", "(", "$", "request", "!==", "null", ")", "{", "if", "(", "!", "(", "$", "request", "instanceof", "WURFL_Request_GenericRequest", ")", ")", "{", "...
Retun a WURFL_Xml_ModelDevice for the given device id. If $request is included, it will be used to resolve virtual capabilties. @param string $deviceID @param WURFL_Request_GenericRequest $request @return WURFL_Xml_ModelDevice
[ "Retun", "a", "WURFL_Xml_ModelDevice", "for", "the", "given", "device", "id", ".", "If", "$request", "is", "included", "it", "will", "be", "used", "to", "resolve", "virtual", "capabilties", "." ]
train
https://github.com/acasademont/wurfl/blob/0f4fb6e06b452ba95ad1d15e7d8226d0974b60c2/WURFL/WURFLService.php#L76-L89
acasademont/wurfl
WURFL/WURFLService.php
WURFL_WURFLService.deviceIdForRequest
private function deviceIdForRequest($request) { $deviceId = $this->_cacheProvider->load($request->id); if (empty($deviceId)) { $generic_normalizer = WURFL_UserAgentHandlerChainFactory::createGenericNormalizers(); $request->userAgentNormalized = $generic_normalizer->normalize(...
php
private function deviceIdForRequest($request) { $deviceId = $this->_cacheProvider->load($request->id); if (empty($deviceId)) { $generic_normalizer = WURFL_UserAgentHandlerChainFactory::createGenericNormalizers(); $request->userAgentNormalized = $generic_normalizer->normalize(...
[ "private", "function", "deviceIdForRequest", "(", "$", "request", ")", "{", "$", "deviceId", "=", "$", "this", "->", "_cacheProvider", "->", "load", "(", "$", "request", "->", "id", ")", ";", "if", "(", "empty", "(", "$", "deviceId", ")", ")", "{", "...
Returns the device id for the device that matches the $request @param WURFL_Request_GenericRequest $request WURFL Request object @return string WURFL device id
[ "Returns", "the", "device", "id", "for", "the", "device", "that", "matches", "the", "$request" ]
train
https://github.com/acasademont/wurfl/blob/0f4fb6e06b452ba95ad1d15e7d8226d0974b60c2/WURFL/WURFLService.php#L132-L152
acasademont/wurfl
WURFL/WURFLService.php
WURFL_WURFLService.getWrappedDevice
private function getWrappedDevice($deviceID, $request = null) { $modelDevices = $this->_cacheProvider->load('DEVS_'.$deviceID); if (empty($modelDevices)) { $modelDevices = $this->_deviceRepository->getDeviceHierarchy($deviceID); } $this->_cacheProvider->save('DEVS_'.$de...
php
private function getWrappedDevice($deviceID, $request = null) { $modelDevices = $this->_cacheProvider->load('DEVS_'.$deviceID); if (empty($modelDevices)) { $modelDevices = $this->_deviceRepository->getDeviceHierarchy($deviceID); } $this->_cacheProvider->save('DEVS_'.$de...
[ "private", "function", "getWrappedDevice", "(", "$", "deviceID", ",", "$", "request", "=", "null", ")", "{", "$", "modelDevices", "=", "$", "this", "->", "_cacheProvider", "->", "load", "(", "'DEVS_'", ".", "$", "deviceID", ")", ";", "if", "(", "empty", ...
Wraps the model device with WURFL_Xml_ModelDevice. This function takes the Device ID and returns the WURFL_CustomDevice with all capabilities. @param string $deviceID @param WURFL_Request_GenericRequest|null $request @return WURFL_CustomDevice
[ "Wraps", "the", "model", "device", "with", "WURFL_Xml_ModelDevice", ".", "This", "function", "takes", "the", "Device", "ID", "and", "returns", "the", "WURFL_CustomDevice", "with", "all", "capabilities", "." ]
train
https://github.com/acasademont/wurfl/blob/0f4fb6e06b452ba95ad1d15e7d8226d0974b60c2/WURFL/WURFLService.php#L162-L184
sohenk/wangeditor3forlaravel
src/WangEditorProvider.php
WangEditorProvider.boot
public function boot(Router $router) { $this->loadViewsFrom(__DIR__ . '/views', 'initialize'); $this->publishes([ __DIR__.'/config/wangeditor.php' => config_path('wangeditor.php'), ], 'config'); $this->publishes([ __DIR__ . '/assets/wangeditor' => public_pat...
php
public function boot(Router $router) { $this->loadViewsFrom(__DIR__ . '/views', 'initialize'); $this->publishes([ __DIR__.'/config/wangeditor.php' => config_path('wangeditor.php'), ], 'config'); $this->publishes([ __DIR__ . '/assets/wangeditor' => public_pat...
[ "public", "function", "boot", "(", "Router", "$", "router", ")", "{", "$", "this", "->", "loadViewsFrom", "(", "__DIR__", ".", "'/views'", ",", "'initialize'", ")", ";", "$", "this", "->", "publishes", "(", "[", "__DIR__", ".", "'/config/wangeditor.php'", ...
Bootstrap the application services. @return void
[ "Bootstrap", "the", "application", "services", "." ]
train
https://github.com/sohenk/wangeditor3forlaravel/blob/a67c6b69926774c9c157920c5380de4aae06fea3/src/WangEditorProvider.php#L24-L43
sohenk/wangeditor3forlaravel
src/WangEditorProvider.php
WangEditorProvider.registerRoute
public function registerRoute($router) { if (!$this->app->routesAreCached()) { $router->group( array_merge( ['namespace' => __NAMESPACE__], config('wangeditor.route.options' ) ), function ($router) { ...
php
public function registerRoute($router) { if (!$this->app->routesAreCached()) { $router->group( array_merge( ['namespace' => __NAMESPACE__], config('wangeditor.route.options' ) ), function ($router) { ...
[ "public", "function", "registerRoute", "(", "$", "router", ")", "{", "if", "(", "!", "$", "this", "->", "app", "->", "routesAreCached", "(", ")", ")", "{", "$", "router", "->", "group", "(", "array_merge", "(", "[", "'namespace'", "=>", "__NAMESPACE__", ...
Register routes. @param $router
[ "Register", "routes", "." ]
train
https://github.com/sohenk/wangeditor3forlaravel/blob/a67c6b69926774c9c157920c5380de4aae06fea3/src/WangEditorProvider.php#L60-L75
o2system/filesystem
src/File.php
File.getContents
public function getContents($useIncludePath = false, $context = null, $offset = 0, $maxlen = 0) { $params[] = $this->getRealPath(); $params[] = $useIncludePath; $params[] = $context; $params[] = $offset; if ($maxlen > 0) { $params[] = $maxlen; } ...
php
public function getContents($useIncludePath = false, $context = null, $offset = 0, $maxlen = 0) { $params[] = $this->getRealPath(); $params[] = $useIncludePath; $params[] = $context; $params[] = $offset; if ($maxlen > 0) { $params[] = $maxlen; } ...
[ "public", "function", "getContents", "(", "$", "useIncludePath", "=", "false", ",", "$", "context", "=", "null", ",", "$", "offset", "=", "0", ",", "$", "maxlen", "=", "0", ")", "{", "$", "params", "[", "]", "=", "$", "this", "->", "getRealPath", "...
File::getContents Reads entire file into a string. @param bool $useIncludePath As of PHP 5 the FILE_USE_INCLUDE_PATH constant can be used to trigger include path search. @param resource $context A valid context resource created with stream_context_create(). If you don't need to use a custom context, you c...
[ "File", "::", "getContents" ]
train
https://github.com/o2system/filesystem/blob/58f6515f56bcc92408dc155add570c99a0abb6e8/src/File.php#L158-L170
o2system/filesystem
src/File.php
File.touch
public function touch($time = null, $atime = null) { $params[] = $this->getRealPath(); $params[] = (isset($time) ? $time : time()); $params[] = (isset($atime) ? $atime : time()); return call_user_func_array('touch', $params); }
php
public function touch($time = null, $atime = null) { $params[] = $this->getRealPath(); $params[] = (isset($time) ? $time : time()); $params[] = (isset($atime) ? $atime : time()); return call_user_func_array('touch', $params); }
[ "public", "function", "touch", "(", "$", "time", "=", "null", ",", "$", "atime", "=", "null", ")", "{", "$", "params", "[", "]", "=", "$", "this", "->", "getRealPath", "(", ")", ";", "$", "params", "[", "]", "=", "(", "isset", "(", "$", "time",...
File::touch @param int $time The touch time. If time is not supplied, the current system time is used. @param int $atime If present, the access time of the given filename is set to the value of atime. Otherwise, it is set to the value passed to the time parameter. If neither are present, the current system time is us...
[ "File", "::", "touch" ]
train
https://github.com/o2system/filesystem/blob/58f6515f56bcc92408dc155add570c99a0abb6e8/src/File.php#L184-L191
o2system/filesystem
src/File.php
File.show
public function show() { if ($mime = $this->getMime()) { $mime = is_array($mime) ? $mime[ 0 ] : $mime; } elseif (is_file($this->getRealPath())) { $mime = 'application/octet-stream'; } $fileSize = filesize($this->getRealPath()); $filename = pa...
php
public function show() { if ($mime = $this->getMime()) { $mime = is_array($mime) ? $mime[ 0 ] : $mime; } elseif (is_file($this->getRealPath())) { $mime = 'application/octet-stream'; } $fileSize = filesize($this->getRealPath()); $filename = pa...
[ "public", "function", "show", "(", ")", "{", "if", "(", "$", "mime", "=", "$", "this", "->", "getMime", "(", ")", ")", "{", "$", "mime", "=", "is_array", "(", "$", "mime", ")", "?", "$", "mime", "[", "0", "]", ":", "$", "mime", ";", "}", "e...
File::show Show file with header. @return void
[ "File", "::", "show" ]
train
https://github.com/o2system/filesystem/blob/58f6515f56bcc92408dc155add570c99a0abb6e8/src/File.php#L202-L255
o2system/filesystem
src/File.php
File.getMime
public function getMime() { $mimes = $this->getMimes(); $ext = strtolower($this->getExtension()); if (isset($mimes[ $ext ])) { return $mimes[ $ext ]; } return false; }
php
public function getMime() { $mimes = $this->getMimes(); $ext = strtolower($this->getExtension()); if (isset($mimes[ $ext ])) { return $mimes[ $ext ]; } return false; }
[ "public", "function", "getMime", "(", ")", "{", "$", "mimes", "=", "$", "this", "->", "getMimes", "(", ")", ";", "$", "ext", "=", "strtolower", "(", "$", "this", "->", "getExtension", "(", ")", ")", ";", "if", "(", "isset", "(", "$", "mimes", "["...
File::getMime Get mime info based on MIME config. @return bool|string|array
[ "File", "::", "getMime" ]
train
https://github.com/o2system/filesystem/blob/58f6515f56bcc92408dc155add570c99a0abb6e8/src/File.php#L266-L276
o2system/filesystem
src/File.php
File.read
public function read($useIncludePath = false, $context = null) { $params[] = $this->getRealPath(); $params[] = $useIncludePath; $params[] = $context; return call_user_func_array('readfile', $params); }
php
public function read($useIncludePath = false, $context = null) { $params[] = $this->getRealPath(); $params[] = $useIncludePath; $params[] = $context; return call_user_func_array('readfile', $params); }
[ "public", "function", "read", "(", "$", "useIncludePath", "=", "false", ",", "$", "context", "=", "null", ")", "{", "$", "params", "[", "]", "=", "$", "this", "->", "getRealPath", "(", ")", ";", "$", "params", "[", "]", "=", "$", "useIncludePath", ...
File::read Outputs a file. @param bool $useIncludePath You can use the optional second parameter and set it to TRUE, if you want to search for the file in the include_path, too. @param resource $context A context stream resource. @return int Returns the number of bytes read from the file. If an error occ...
[ "File", "::", "read" ]
train
https://github.com/o2system/filesystem/blob/58f6515f56bcc92408dc155add570c99a0abb6e8/src/File.php#L315-L322
o2system/filesystem
src/File.php
File.write
public function write($filePath, $contents, $mode = 'wb') { if (false !== ($fp = $this->create($filePath, $mode))) { flock($fp, LOCK_EX); for ($result = $written = 0, $length = strlen($contents); $written < $length; $written += $result) { if (($result = fwrite(...
php
public function write($filePath, $contents, $mode = 'wb') { if (false !== ($fp = $this->create($filePath, $mode))) { flock($fp, LOCK_EX); for ($result = $written = 0, $length = strlen($contents); $written < $length; $written += $result) { if (($result = fwrite(...
[ "public", "function", "write", "(", "$", "filePath", ",", "$", "contents", ",", "$", "mode", "=", "'wb'", ")", "{", "if", "(", "false", "!==", "(", "$", "fp", "=", "$", "this", "->", "create", "(", "$", "filePath", ",", "$", "mode", ")", ")", "...
File::write Writes a file. @param string $contents File contents to write. @param string $mode File handle mode. @return bool
[ "File", "::", "write" ]
train
https://github.com/o2system/filesystem/blob/58f6515f56bcc92408dc155add570c99a0abb6e8/src/File.php#L336-L354
o2system/filesystem
src/File.php
File.create
public function create($filePath = null, $mode = 'wb') { $filePath = isset($filePath) ? $filePath : $this->filePath; $dir = dirname($filePath); if ( ! is_writable($dir)) { if ( ! file_exists($dir)) { mkdir($dir, 0777, true); } } ...
php
public function create($filePath = null, $mode = 'wb') { $filePath = isset($filePath) ? $filePath : $this->filePath; $dir = dirname($filePath); if ( ! is_writable($dir)) { if ( ! file_exists($dir)) { mkdir($dir, 0777, true); } } ...
[ "public", "function", "create", "(", "$", "filePath", "=", "null", ",", "$", "mode", "=", "'wb'", ")", "{", "$", "filePath", "=", "isset", "(", "$", "filePath", ")", "?", "$", "filePath", ":", "$", "this", "->", "filePath", ";", "$", "dir", "=", ...
File::create Create a File @param string|null $filePath @param string $mode @return resource
[ "File", "::", "create" ]
train
https://github.com/o2system/filesystem/blob/58f6515f56bcc92408dc155add570c99a0abb6e8/src/File.php#L368-L386
o2system/filesystem
src/File.php
File.rename
public function rename($newFilename, $context = null) { $params[] = $this->getRealPath(); $params[] = dirname($this->getRealPath()) . DIRECTORY_SEPARATOR . $newFilename; $params[] = $context; return call_user_func_array('rename', $params); }
php
public function rename($newFilename, $context = null) { $params[] = $this->getRealPath(); $params[] = dirname($this->getRealPath()) . DIRECTORY_SEPARATOR . $newFilename; $params[] = $context; return call_user_func_array('rename', $params); }
[ "public", "function", "rename", "(", "$", "newFilename", ",", "$", "context", "=", "null", ")", "{", "$", "params", "[", "]", "=", "$", "this", "->", "getRealPath", "(", ")", ";", "$", "params", "[", "]", "=", "dirname", "(", "$", "this", "->", "...
File::rename Renames a file. @param string $newFilename The new filename. @param null $context Context support was added with PHP 5.0.0. For a description of contexts, refer to Streams. @return bool Returns TRUE on success or FALSE on failure.
[ "File", "::", "rename" ]
train
https://github.com/o2system/filesystem/blob/58f6515f56bcc92408dc155add570c99a0abb6e8/src/File.php#L401-L408
o2system/filesystem
src/File.php
File.copy
public function copy($destination, $context = null) { $params[] = $this->getRealPath(); $params[] = $destination; $params[] = $context; return call_user_func_array('copy', $params); }
php
public function copy($destination, $context = null) { $params[] = $this->getRealPath(); $params[] = $destination; $params[] = $context; return call_user_func_array('copy', $params); }
[ "public", "function", "copy", "(", "$", "destination", ",", "$", "context", "=", "null", ")", "{", "$", "params", "[", "]", "=", "$", "this", "->", "getRealPath", "(", ")", ";", "$", "params", "[", "]", "=", "$", "destination", ";", "$", "params", ...
File::copy Makes a copy of the file source to destination. @param string $destination The destination path. If destination is a URL, the copy operation may fail if the wrapper does not support overwriting of existing files. @param resource $context A valid context resource created with stream_context_create(). ...
[ "File", "::", "copy" ]
train
https://github.com/o2system/filesystem/blob/58f6515f56bcc92408dc155add570c99a0abb6e8/src/File.php#L423-L430
o2system/filesystem
src/File.php
File.delete
public function delete($context = null) { $params[] = $this->getRealPath(); $params[] = $context; return call_user_func_array('unlink', $params); }
php
public function delete($context = null) { $params[] = $this->getRealPath(); $params[] = $context; return call_user_func_array('unlink', $params); }
[ "public", "function", "delete", "(", "$", "context", "=", "null", ")", "{", "$", "params", "[", "]", "=", "$", "this", "->", "getRealPath", "(", ")", ";", "$", "params", "[", "]", "=", "$", "context", ";", "return", "call_user_func_array", "(", "'unl...
File::delete Deletes a file. @param resource $context Context support was added with PHP 5.0.0. For a description of contexts, refer to Streams. @return bool Returns TRUE on success or FALSE on failure.
[ "File", "::", "delete" ]
train
https://github.com/o2system/filesystem/blob/58f6515f56bcc92408dc155add570c99a0abb6e8/src/File.php#L444-L450
drpdigital/json-api-parser
src/RelationshipResourceFinder.php
RelationshipResourceFinder.fromRelationshipType
public function fromRelationshipType($type) { $relationships = $this->getRelationshipsThatMatchType($type); if (count($relationships) === 0) { return null; } $resource = reset($relationships); return new RelationshipResource( key($relationships), ...
php
public function fromRelationshipType($type) { $relationships = $this->getRelationshipsThatMatchType($type); if (count($relationships) === 0) { return null; } $resource = reset($relationships); return new RelationshipResource( key($relationships), ...
[ "public", "function", "fromRelationshipType", "(", "$", "type", ")", "{", "$", "relationships", "=", "$", "this", "->", "getRelationshipsThatMatchType", "(", "$", "type", ")", ";", "if", "(", "count", "(", "$", "relationships", ")", "===", "0", ")", "{", ...
Get a resource from just the relationship type. @param string $type @return \Drp\JsonApiParser\RelationshipResource|null
[ "Get", "a", "resource", "from", "just", "the", "relationship", "type", "." ]
train
https://github.com/drpdigital/json-api-parser/blob/b1ceefc0c19ec326129126253114c121e97ca943/src/RelationshipResourceFinder.php#L29-L43
drpdigital/json-api-parser
src/RelationshipResourceFinder.php
RelationshipResourceFinder.getRelationshipsThatMatchType
protected function getRelationshipsThatMatchType($type) { return array_filter( $this->mapRelationshipsToIdAndData(), function ($relationship) use ($type) { $relationshipType = Arr::get($relationship, 'type'); return Str::snakeCase($type) === Str::snak...
php
protected function getRelationshipsThatMatchType($type) { return array_filter( $this->mapRelationshipsToIdAndData(), function ($relationship) use ($type) { $relationshipType = Arr::get($relationship, 'type'); return Str::snakeCase($type) === Str::snak...
[ "protected", "function", "getRelationshipsThatMatchType", "(", "$", "type", ")", "{", "return", "array_filter", "(", "$", "this", "->", "mapRelationshipsToIdAndData", "(", ")", ",", "function", "(", "$", "relationship", ")", "use", "(", "$", "type", ")", "{", ...
Get all the relationships that their type matches the given type. @param string $type @return array|mixed
[ "Get", "all", "the", "relationships", "that", "their", "type", "matches", "the", "given", "type", "." ]
train
https://github.com/drpdigital/json-api-parser/blob/b1ceefc0c19ec326129126253114c121e97ca943/src/RelationshipResourceFinder.php#L51-L61
drpdigital/json-api-parser
src/RelationshipResourceFinder.php
RelationshipResourceFinder.fromFullyQualifiedRelationships
public function fromFullyQualifiedRelationships(array $relationshipNames) { foreach ($relationshipNames as $relationshipName) { $relationship = $this->getRelationshipResourceForReference($relationshipName); if ($relationship !== null) { return $relationship; ...
php
public function fromFullyQualifiedRelationships(array $relationshipNames) { foreach ($relationshipNames as $relationshipName) { $relationship = $this->getRelationshipResourceForReference($relationshipName); if ($relationship !== null) { return $relationship; ...
[ "public", "function", "fromFullyQualifiedRelationships", "(", "array", "$", "relationshipNames", ")", "{", "foreach", "(", "$", "relationshipNames", "as", "$", "relationshipName", ")", "{", "$", "relationship", "=", "$", "this", "->", "getRelationshipResourceForRefere...
Get a relationship resource from one of the fully qualified relationship referneces. E.g. ['test.test-relationship.test-child'] @param array $relationshipNames @return \Drp\JsonApiParser\RelationshipResource|null
[ "Get", "a", "relationship", "resource", "from", "one", "of", "the", "fully", "qualified", "relationship", "referneces", ".", "E", ".", "g", ".", "[", "test", ".", "test", "-", "relationship", ".", "test", "-", "child", "]" ]
train
https://github.com/drpdigital/json-api-parser/blob/b1ceefc0c19ec326129126253114c121e97ca943/src/RelationshipResourceFinder.php#L70-L81
drpdigital/json-api-parser
src/RelationshipResourceFinder.php
RelationshipResourceFinder.getRelationshipResourceForReference
protected function getRelationshipResourceForReference($fullRelationshipReference) { $relationshipParts = explode('.', $fullRelationshipReference); if (count($relationshipParts) !== 3) { return null; } if ($this->resourceType() !== array_shift($relationshipParts)) { ...
php
protected function getRelationshipResourceForReference($fullRelationshipReference) { $relationshipParts = explode('.', $fullRelationshipReference); if (count($relationshipParts) !== 3) { return null; } if ($this->resourceType() !== array_shift($relationshipParts)) { ...
[ "protected", "function", "getRelationshipResourceForReference", "(", "$", "fullRelationshipReference", ")", "{", "$", "relationshipParts", "=", "explode", "(", "'.'", ",", "$", "fullRelationshipReference", ")", ";", "if", "(", "count", "(", "$", "relationshipParts", ...
Get a relationship resource for a fully qualified reference. @param string $fullRelationshipReference @return \Drp\JsonApiParser\RelationshipResource|null
[ "Get", "a", "relationship", "resource", "for", "a", "fully", "qualified", "reference", "." ]
train
https://github.com/drpdigital/json-api-parser/blob/b1ceefc0c19ec326129126253114c121e97ca943/src/RelationshipResourceFinder.php#L89-L115
Konstantin-Vl/yii2-ulogin-widget
UloginWidget.php
UloginWidget.setStateListener
public function setStateListener($event, $listener) { $js = sprintf( 'uLogin.setStateListener("%s", "%s", %s);', $this->id, $event, $listener ); $this->getView()->registerJs($js); return $this; }
php
public function setStateListener($event, $listener) { $js = sprintf( 'uLogin.setStateListener("%s", "%s", %s);', $this->id, $event, $listener ); $this->getView()->registerJs($js); return $this; }
[ "public", "function", "setStateListener", "(", "$", "event", ",", "$", "listener", ")", "{", "$", "js", "=", "sprintf", "(", "'uLogin.setStateListener(\"%s\", \"%s\", %s);'", ",", "$", "this", "->", "id", ",", "$", "event", ",", "$", "listener", ")", ";", ...
Sets the event handler in the event ulogin @param string $event Js event name @param string $listener Js event handler @return $this @see https://ulogin.ru/help.php#listeners
[ "Sets", "the", "event", "handler", "in", "the", "event", "ulogin" ]
train
https://github.com/Konstantin-Vl/yii2-ulogin-widget/blob/b562b671dbb71926941df148d0d3d5a169a7b489/UloginWidget.php#L110-L121
chriswoodford/foursquare-php
lib/TheTwelve/Foursquare/HttpClient/SymfonyHttpClient.php
SymfonyHttpClient.get
public function get($uri, array $params = array()) { $request = HttpFoundation\Request::create($uri, 'GET', $params); $uri = $request->getUri(); $ch = $this->initCurlHandler($uri); return $this->makeRequest($ch); }
php
public function get($uri, array $params = array()) { $request = HttpFoundation\Request::create($uri, 'GET', $params); $uri = $request->getUri(); $ch = $this->initCurlHandler($uri); return $this->makeRequest($ch); }
[ "public", "function", "get", "(", "$", "uri", ",", "array", "$", "params", "=", "array", "(", ")", ")", "{", "$", "request", "=", "HttpFoundation", "\\", "Request", "::", "create", "(", "$", "uri", ",", "'GET'", ",", "$", "params", ")", ";", "$", ...
(non-PHPdoc) @see \TheTwelve\Foursquare.HttpClient::get()
[ "(", "non", "-", "PHPdoc", ")" ]
train
https://github.com/chriswoodford/foursquare-php/blob/edbfcba2993a101ead8f381394742a4689aec398/lib/TheTwelve/Foursquare/HttpClient/SymfonyHttpClient.php#L14-L23
devhelp/piwik-api
src/Method/Method.php
Method.call
public function call(array $params) { $this->initResolver(); /** * makes sure that 'format' is passed and that 'API' and 'method' * parameters are not overwritten by defaults nor by call parameters */ $defaults = array_merge(array('format' => $this->format), $this...
php
public function call(array $params) { $this->initResolver(); /** * makes sure that 'format' is passed and that 'API' and 'method' * parameters are not overwritten by defaults nor by call parameters */ $defaults = array_merge(array('format' => $this->format), $this...
[ "public", "function", "call", "(", "array", "$", "params", ")", "{", "$", "this", "->", "initResolver", "(", ")", ";", "/**\n * makes sure that 'format' is passed and that 'API' and 'method'\n * parameters are not overwritten by defaults nor by call parameters\n ...
calls piwik api @param array $params @return ResponseInterface
[ "calls", "piwik", "api" ]
train
https://github.com/devhelp/piwik-api/blob/b50569fac9736a87be48228d8a336a84418be8da/src/Method/Method.php#L79-L95
bocharsky-bw/FileNamingResolver
src/NamingStrategy/CallbackNamingStrategy.php
CallbackNamingStrategy.provideName
public function provideName(FileInfo $srcFileInfo) { $func = $this->callback; $dstFileInfo = $func($srcFileInfo); if (!$dstFileInfo instanceof FileInfo) { throw new \RuntimeException( sprintf('Callback naming strategy should return an instance of FileNamingResolv...
php
public function provideName(FileInfo $srcFileInfo) { $func = $this->callback; $dstFileInfo = $func($srcFileInfo); if (!$dstFileInfo instanceof FileInfo) { throw new \RuntimeException( sprintf('Callback naming strategy should return an instance of FileNamingResolv...
[ "public", "function", "provideName", "(", "FileInfo", "$", "srcFileInfo", ")", "{", "$", "func", "=", "$", "this", "->", "callback", ";", "$", "dstFileInfo", "=", "$", "func", "(", "$", "srcFileInfo", ")", ";", "if", "(", "!", "$", "dstFileInfo", "inst...
{@inheritdoc}
[ "{" ]
train
https://github.com/bocharsky-bw/FileNamingResolver/blob/0a0fe86fee0e7acf1ab43a84c1abd51954ce2fbe/src/NamingStrategy/CallbackNamingStrategy.php#L28-L40
awesomite/chariot
src/Pattern/PatternRouter.php
PatternRouter.matchKeyValue
private function matchKeyValue(string $path, array $methods) { foreach ($methods as $method) { $keyValue = $this->keyValueRoutes[$method][$path] ?? null; if (!\is_null($keyValue)) { list($handler, $extraParams) = $keyValue; return new InternalRoute($h...
php
private function matchKeyValue(string $path, array $methods) { foreach ($methods as $method) { $keyValue = $this->keyValueRoutes[$method][$path] ?? null; if (!\is_null($keyValue)) { list($handler, $extraParams) = $keyValue; return new InternalRoute($h...
[ "private", "function", "matchKeyValue", "(", "string", "$", "path", ",", "array", "$", "methods", ")", "{", "foreach", "(", "$", "methods", "as", "$", "method", ")", "{", "$", "keyValue", "=", "$", "this", "->", "keyValueRoutes", "[", "$", "method", "]...
@param string $path @param array $methods @return InternalRouteInterface|null
[ "@param", "string", "$path", "@param", "array", "$methods" ]
train
https://github.com/awesomite/chariot/blob/3229e38537b857be1d352308ba340dc530b12afb/src/Pattern/PatternRouter.php#L303-L315
awesomite/chariot
src/Pattern/PatternRouter.php
PatternRouter.matchSequentiallyForMethods
private function matchSequentiallyForMethods(array $methods, string $path) { if ($result = $this->matchKeyValue($path, $methods)) { return $result; } foreach ($methods as $currentMethod) { foreach ($this->routes[$currentMethod] ?? [] as $handler => $handlerData) { ...
php
private function matchSequentiallyForMethods(array $methods, string $path) { if ($result = $this->matchKeyValue($path, $methods)) { return $result; } foreach ($methods as $currentMethod) { foreach ($this->routes[$currentMethod] ?? [] as $handler => $handlerData) { ...
[ "private", "function", "matchSequentiallyForMethods", "(", "array", "$", "methods", ",", "string", "$", "path", ")", "{", "if", "(", "$", "result", "=", "$", "this", "->", "matchKeyValue", "(", "$", "path", ",", "$", "methods", ")", ")", "{", "return", ...
@param array $methods @param string $path @return InternalRouteInterface|null
[ "@param", "array", "$methods", "@param", "string", "$path" ]
train
https://github.com/awesomite/chariot/blob/3229e38537b857be1d352308ba340dc530b12afb/src/Pattern/PatternRouter.php#L356-L375
awesomite/chariot
src/Pattern/PatternRouter.php
PatternRouter.matchTreeForMethods
private function matchTreeForMethods(array $methods, string $path) { if ($result = $this->matchKeyValue($path, $methods)) { return $result; } $nodesPointer = &$this->nodesTree; $chars = \str_split($path); while (true) { $candidates = \array_merge( ...
php
private function matchTreeForMethods(array $methods, string $path) { if ($result = $this->matchKeyValue($path, $methods)) { return $result; } $nodesPointer = &$this->nodesTree; $chars = \str_split($path); while (true) { $candidates = \array_merge( ...
[ "private", "function", "matchTreeForMethods", "(", "array", "$", "methods", ",", "string", "$", "path", ")", "{", "if", "(", "$", "result", "=", "$", "this", "->", "matchKeyValue", "(", "$", "path", ",", "$", "methods", ")", ")", "{", "return", "$", ...
@param array $methods @param string $path @return InternalRouteInterface|null
[ "@param", "array", "$methods", "@param", "string", "$path" ]
train
https://github.com/awesomite/chariot/blob/3229e38537b857be1d352308ba340dc530b12afb/src/Pattern/PatternRouter.php#L398-L431
prooph/event-store-zf2-adapter
src/Zf2EventStoreAdapter.php
Zf2EventStoreAdapter.dropSchemaFor
public function dropSchemaFor(StreamName $streamName, $returnSql = false) { $dropTable = new DropTable($this->getTable($streamName)); if ($returnSql) { return $dropTable->getSqlString($this->dbAdapter->getPlatform()); } $this->dbAdapter->getDriver() ->getCon...
php
public function dropSchemaFor(StreamName $streamName, $returnSql = false) { $dropTable = new DropTable($this->getTable($streamName)); if ($returnSql) { return $dropTable->getSqlString($this->dbAdapter->getPlatform()); } $this->dbAdapter->getDriver() ->getCon...
[ "public", "function", "dropSchemaFor", "(", "StreamName", "$", "streamName", ",", "$", "returnSql", "=", "false", ")", "{", "$", "dropTable", "=", "new", "DropTable", "(", "$", "this", "->", "getTable", "(", "$", "streamName", ")", ")", ";", "if", "(", ...
Drops a stream table Use this function with caution. All your events will be lost! But it can be useful in migration scenarios. @param StreamName $streamName @param bool $returnSql @return string|null Whether $returnSql is true or not function will return generated sql or execute it directly
[ "Drops", "a", "stream", "table" ]
train
https://github.com/prooph/event-store-zf2-adapter/blob/607223d0e112f85ddc6568bb6bb7c9ca7b83e95b/src/Zf2EventStoreAdapter.php#L256-L267
prooph/event-store-zf2-adapter
src/Zf2EventStoreAdapter.php
Zf2EventStoreAdapter.insertEvent
protected function insertEvent(StreamName $streamName, DomainEvent $e) { $eventData = array( 'event_id' => $e->uuid()->toString(), 'version' => $e->version(), 'event_name' => $e->messageName(), 'event_class' => get_class($e), 'payload' => Serialize...
php
protected function insertEvent(StreamName $streamName, DomainEvent $e) { $eventData = array( 'event_id' => $e->uuid()->toString(), 'version' => $e->version(), 'event_name' => $e->messageName(), 'event_class' => get_class($e), 'payload' => Serialize...
[ "protected", "function", "insertEvent", "(", "StreamName", "$", "streamName", ",", "DomainEvent", "$", "e", ")", "{", "$", "eventData", "=", "array", "(", "'event_id'", "=>", "$", "e", "->", "uuid", "(", ")", "->", "toString", "(", ")", ",", "'version'",...
Insert an event @param StreamName $streamName @param DomainEvent $e @return void
[ "Insert", "an", "event" ]
train
https://github.com/prooph/event-store-zf2-adapter/blob/607223d0e112f85ddc6568bb6bb7c9ca7b83e95b/src/Zf2EventStoreAdapter.php#L276-L294
prooph/event-store-zf2-adapter
src/Zf2EventStoreAdapter.php
Zf2EventStoreAdapter.getTablegateway
protected function getTablegateway(StreamName $streamName) { if (!isset($this->tableGateways[$streamName->toString()])) { $this->tableGateways[$streamName->toString()] = new TableGateway($this->getTable($streamName), $this->dbAdapter); } return $this->tableGateways[$streamName->...
php
protected function getTablegateway(StreamName $streamName) { if (!isset($this->tableGateways[$streamName->toString()])) { $this->tableGateways[$streamName->toString()] = new TableGateway($this->getTable($streamName), $this->dbAdapter); } return $this->tableGateways[$streamName->...
[ "protected", "function", "getTablegateway", "(", "StreamName", "$", "streamName", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "tableGateways", "[", "$", "streamName", "->", "toString", "(", ")", "]", ")", ")", "{", "$", "this", "->", "ta...
Get the corresponding Tablegateway of the given stream name @param StreamName $streamName @return TableGateway
[ "Get", "the", "corresponding", "Tablegateway", "of", "the", "given", "stream", "name" ]
train
https://github.com/prooph/event-store-zf2-adapter/blob/607223d0e112f85ddc6568bb6bb7c9ca7b83e95b/src/Zf2EventStoreAdapter.php#L303-L310
prooph/event-store-zf2-adapter
src/Zf2EventStoreAdapter.php
Zf2EventStoreAdapter.getTable
protected function getTable(StreamName $streamName) { if (isset($this->streamTableMap[$streamName->toString()])) { $tableName = $this->streamTableMap[$streamName->toString()]; } else { $tableName = strtolower($this->getShortStreamName($streamName)); if (strpos($t...
php
protected function getTable(StreamName $streamName) { if (isset($this->streamTableMap[$streamName->toString()])) { $tableName = $this->streamTableMap[$streamName->toString()]; } else { $tableName = strtolower($this->getShortStreamName($streamName)); if (strpos($t...
[ "protected", "function", "getTable", "(", "StreamName", "$", "streamName", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "streamTableMap", "[", "$", "streamName", "->", "toString", "(", ")", "]", ")", ")", "{", "$", "tableName", "=", "$", "this...
Get table name for given stream name @param StreamName $streamName @return string
[ "Get", "table", "name", "for", "given", "stream", "name" ]
train
https://github.com/prooph/event-store-zf2-adapter/blob/607223d0e112f85ddc6568bb6bb7c9ca7b83e95b/src/Zf2EventStoreAdapter.php#L318-L331
activecollab/databasestructure
src/Association/HasOneAssociation.php
HasOneAssociation.buildClassMethods
public function buildClassMethods(StructureInterface $structure, TypeInterface $source_type, TypeInterface $target_type, array &$result) { $namespace = $structure->getNamespace(); if ($namespace) { $namespace = '\\' . ltrim($namespace, '\\'); } $target_instance_class = ...
php
public function buildClassMethods(StructureInterface $structure, TypeInterface $source_type, TypeInterface $target_type, array &$result) { $namespace = $structure->getNamespace(); if ($namespace) { $namespace = '\\' . ltrim($namespace, '\\'); } $target_instance_class = ...
[ "public", "function", "buildClassMethods", "(", "StructureInterface", "$", "structure", ",", "TypeInterface", "$", "source_type", ",", "TypeInterface", "$", "target_type", ",", "array", "&", "$", "result", ")", "{", "$", "namespace", "=", "$", "structure", "->",...
Build class methods. @param StructureInterface $structure @param TypeInterface $source_type @param TypeInterface $target_type @param array $result
[ "Build", "class", "methods", "." ]
train
https://github.com/activecollab/databasestructure/blob/4b2353c4422186bcfce63b3212da3e70e63eb5df/src/Association/HasOneAssociation.php#L118-L177
stubbles/stubbles-webapp-core
src/main/php/session/id/WebBoundSessionId.php
WebBoundSessionId.read
private function read() { if ($this->request->hasParam($this->sessionName)) { return $this->request->readParam($this->sessionName)->ifMatches(self::SESSION_ID_REGEX); } elseif ($this->request->hasCookie($this->sessionName)) { return $this->request->readCookie($this->sessionNa...
php
private function read() { if ($this->request->hasParam($this->sessionName)) { return $this->request->readParam($this->sessionName)->ifMatches(self::SESSION_ID_REGEX); } elseif ($this->request->hasCookie($this->sessionName)) { return $this->request->readCookie($this->sessionNa...
[ "private", "function", "read", "(", ")", "{", "if", "(", "$", "this", "->", "request", "->", "hasParam", "(", "$", "this", "->", "sessionName", ")", ")", "{", "return", "$", "this", "->", "request", "->", "readParam", "(", "$", "this", "->", "session...
reads session id @return string|null
[ "reads", "session", "id" ]
train
https://github.com/stubbles/stubbles-webapp-core/blob/7705f129011a81d5cc3c76b4b150fab3dadac6a3/src/main/php/session/id/WebBoundSessionId.php#L100-L109
stubbles/stubbles-webapp-core
src/main/php/session/id/WebBoundSessionId.php
WebBoundSessionId.regenerate
public function regenerate(): SessionId { $this->id = $this->create(); $this->response->addCookie( Cookie::create($this->sessionName, $this->id)->forPath('/') ); return $this; }
php
public function regenerate(): SessionId { $this->id = $this->create(); $this->response->addCookie( Cookie::create($this->sessionName, $this->id)->forPath('/') ); return $this; }
[ "public", "function", "regenerate", "(", ")", ":", "SessionId", "{", "$", "this", "->", "id", "=", "$", "this", "->", "create", "(", ")", ";", "$", "this", "->", "response", "->", "addCookie", "(", "Cookie", "::", "create", "(", "$", "this", "->", ...
stores session id for given session name @return \stubbles\webapp\session\id\SessionId
[ "stores", "session", "id", "for", "given", "session", "name" ]
train
https://github.com/stubbles/stubbles-webapp-core/blob/7705f129011a81d5cc3c76b4b150fab3dadac6a3/src/main/php/session/id/WebBoundSessionId.php#L126-L133
harp-orm/query
src/Compiler/Aliased.php
Aliased.render
public static function render(SQL\Aliased $aliased) { $content = $aliased->getContent(); if ($content instanceof Query\Select) { $content = "(".Select::render($content).")"; } else { $content = Compiler::name($content); } return Compiler::expression(...
php
public static function render(SQL\Aliased $aliased) { $content = $aliased->getContent(); if ($content instanceof Query\Select) { $content = "(".Select::render($content).")"; } else { $content = Compiler::name($content); } return Compiler::expression(...
[ "public", "static", "function", "render", "(", "SQL", "\\", "Aliased", "$", "aliased", ")", "{", "$", "content", "=", "$", "aliased", "->", "getContent", "(", ")", ";", "if", "(", "$", "content", "instanceof", "Query", "\\", "Select", ")", "{", "$", ...
Render SQL for Aliased @param SQL\Aliased $aliased @return string
[ "Render", "SQL", "for", "Aliased" ]
train
https://github.com/harp-orm/query/blob/98ce2468a0a31fe15ed3692bad32547bf6dbe41a/src/Compiler/Aliased.php#L33-L47
ejsmont-artur/phpProxyBuilder
src/PhpProxyBuilder/Aop/Advice/InstrumentationAdvice.php
InstrumentationAdvice.interceptMethodCall
public function interceptMethodCall(ProceedingJoinPointInterface $jointPoint) { $time = $this->monitor->getTime(); if ($this->namePrefix) { $name = $this->namePrefix; } else { $name = get_class($jointPoint->getTarget()); } if ($this->metricPerMethod) { ...
php
public function interceptMethodCall(ProceedingJoinPointInterface $jointPoint) { $time = $this->monitor->getTime(); if ($this->namePrefix) { $name = $this->namePrefix; } else { $name = get_class($jointPoint->getTarget()); } if ($this->metricPerMethod) { ...
[ "public", "function", "interceptMethodCall", "(", "ProceedingJoinPointInterface", "$", "jointPoint", ")", "{", "$", "time", "=", "$", "this", "->", "monitor", "->", "getTime", "(", ")", ";", "if", "(", "$", "this", "->", "namePrefix", ")", "{", "$", "name"...
In this implementation we measure time and count every method call @param ProceedingJoinPointInterface $jointPoint @return mixed
[ "In", "this", "implementation", "we", "measure", "time", "and", "count", "every", "method", "call" ]
train
https://github.com/ejsmont-artur/phpProxyBuilder/blob/ef7ec14e5d18eeba7a93e3617a0fdb5b146d6480/src/PhpProxyBuilder/Aop/Advice/InstrumentationAdvice.php#L85-L107
drupol/valuewrapper
src/Object/ObjectValue.php
ObjectValue.equals
public function equals(ValueInterface $item, bool $strict = true): bool { return $this->hash() === $item->hash(); }
php
public function equals(ValueInterface $item, bool $strict = true): bool { return $this->hash() === $item->hash(); }
[ "public", "function", "equals", "(", "ValueInterface", "$", "item", ",", "bool", "$", "strict", "=", "true", ")", ":", "bool", "{", "return", "$", "this", "->", "hash", "(", ")", "===", "$", "item", "->", "hash", "(", ")", ";", "}" ]
{@inheritdoc}
[ "{" ]
train
https://github.com/drupol/valuewrapper/blob/49cc07e4d0284718c24ba6e9cf524c1f4226694e/src/Object/ObjectValue.php#L36-L39
WellCommerce/OrderBundle
DataSet/Transformer/OrderProductsTransformer.php
OrderProductsTransformer.transformValue
public function transformValue($value) { $identifiers = explode(',', $value); $criteria = new Criteria(); $criteria->where($criteria->expr()->in('id', $identifiers)); $orderProducts = $this->repository->matching($criteria); $lines = []; $orderProdu...
php
public function transformValue($value) { $identifiers = explode(',', $value); $criteria = new Criteria(); $criteria->where($criteria->expr()->in('id', $identifiers)); $orderProducts = $this->repository->matching($criteria); $lines = []; $orderProdu...
[ "public", "function", "transformValue", "(", "$", "value", ")", "{", "$", "identifiers", "=", "explode", "(", "','", ",", "$", "value", ")", ";", "$", "criteria", "=", "new", "Criteria", "(", ")", ";", "$", "criteria", "->", "where", "(", "$", "crite...
{@inheritdoc}
[ "{" ]
train
https://github.com/WellCommerce/OrderBundle/blob/d72cfb51eab7a1f66f186900d1e2d533a822c424/DataSet/Transformer/OrderProductsTransformer.php#L45-L67
crossjoin/Css
src/Crossjoin/Css/Format/Rule/ConditionAbstract.php
ConditionAbstract.setValue
protected function setValue($value) { if (is_string($value)) { $this->value = $value; } else { throw new \InvalidArgumentException( "Invalid type '" . gettype($value). "' for argument 'value' given." ); } return $this; }
php
protected function setValue($value) { if (is_string($value)) { $this->value = $value; } else { throw new \InvalidArgumentException( "Invalid type '" . gettype($value). "' for argument 'value' given." ); } return $this; }
[ "protected", "function", "setValue", "(", "$", "value", ")", "{", "if", "(", "is_string", "(", "$", "value", ")", ")", "{", "$", "this", "->", "value", "=", "$", "value", ";", "}", "else", "{", "throw", "new", "\\", "InvalidArgumentException", "(", "...
Sets the condition value. @param string $value @return $this
[ "Sets", "the", "condition", "value", "." ]
train
https://github.com/crossjoin/Css/blob/7b50ca94c4bdad60d01cfa327f00b7a600d6f9f3/src/Crossjoin/Css/Format/Rule/ConditionAbstract.php#L29-L40
prooph/link-app-core
src/Service/Factory/DataLocationFactory.php
DataLocationFactory.createService
public function createService(ServiceLocatorInterface $serviceLocator) { $config = $serviceLocator->get('config'); if (!is_array($config)) { throw new \RuntimeException("Expected application config to be an array. Got " . gettype($config)); } if (! isset($config['system...
php
public function createService(ServiceLocatorInterface $serviceLocator) { $config = $serviceLocator->get('config'); if (!is_array($config)) { throw new \RuntimeException("Expected application config to be an array. Got " . gettype($config)); } if (! isset($config['system...
[ "public", "function", "createService", "(", "ServiceLocatorInterface", "$", "serviceLocator", ")", "{", "$", "config", "=", "$", "serviceLocator", "->", "get", "(", "'config'", ")", ";", "if", "(", "!", "is_array", "(", "$", "config", ")", ")", "{", "throw...
Create service @param ServiceLocatorInterface $serviceLocator @throws \RuntimeException @return mixed
[ "Create", "service" ]
train
https://github.com/prooph/link-app-core/blob/835a5945dfa7be7b2cebfa6e84e757ecfd783357/src/Service/Factory/DataLocationFactory.php#L33-L46
chriswoodford/foursquare-php
lib/TheTwelve/Foursquare/UsersGateway.php
UsersGateway.getUser
public function getUser() { $resource = '/users/' . $this->userId; $response = $this->makeAuthenticatedApiRequest($resource); return $response->user; }
php
public function getUser() { $resource = '/users/' . $this->userId; $response = $this->makeAuthenticatedApiRequest($resource); return $response->user; }
[ "public", "function", "getUser", "(", ")", "{", "$", "resource", "=", "'/users/'", ".", "$", "this", "->", "userId", ";", "$", "response", "=", "$", "this", "->", "makeAuthenticatedApiRequest", "(", "$", "resource", ")", ";", "return", "$", "response", "...
get a user @see https://developer.foursquare.com/docs/users/users @return \stdClass
[ "get", "a", "user" ]
train
https://github.com/chriswoodford/foursquare-php/blob/edbfcba2993a101ead8f381394742a4689aec398/lib/TheTwelve/Foursquare/UsersGateway.php#L39-L46
chriswoodford/foursquare-php
lib/TheTwelve/Foursquare/UsersGateway.php
UsersGateway.getBadges
public function getBadges() { $uri = $this->buildUserResourceUri('badges'); $response = $this->makeAuthenticatedApiRequest($uri); return $response->badges; }
php
public function getBadges() { $uri = $this->buildUserResourceUri('badges'); $response = $this->makeAuthenticatedApiRequest($uri); return $response->badges; }
[ "public", "function", "getBadges", "(", ")", "{", "$", "uri", "=", "$", "this", "->", "buildUserResourceUri", "(", "'badges'", ")", ";", "$", "response", "=", "$", "this", "->", "makeAuthenticatedApiRequest", "(", "$", "uri", ")", ";", "return", "$", "re...
Returns badges for a given user. @see https://developer.foursquare.com/docs/users/badges
[ "Returns", "badges", "for", "a", "given", "user", "." ]
train
https://github.com/chriswoodford/foursquare-php/blob/edbfcba2993a101ead8f381394742a4689aec398/lib/TheTwelve/Foursquare/UsersGateway.php#L96-L104
chriswoodford/foursquare-php
lib/TheTwelve/Foursquare/UsersGateway.php
UsersGateway.getCheckins
public function getCheckins(array $options = array()) { $uri = $this->buildUserResourceUri('checkins'); $response = $this->makeAuthenticatedApiRequest($uri, $options); return $response->checkins->items; }
php
public function getCheckins(array $options = array()) { $uri = $this->buildUserResourceUri('checkins'); $response = $this->makeAuthenticatedApiRequest($uri, $options); return $response->checkins->items; }
[ "public", "function", "getCheckins", "(", "array", "$", "options", "=", "array", "(", ")", ")", "{", "$", "uri", "=", "$", "this", "->", "buildUserResourceUri", "(", "'checkins'", ")", ";", "$", "response", "=", "$", "this", "->", "makeAuthenticatedApiRequ...
Returns a history of checkins for the authenticated user. @see https://developer.foursquare.com/docs/users/checkins @param array $options @return array
[ "Returns", "a", "history", "of", "checkins", "for", "the", "authenticated", "user", "." ]
train
https://github.com/chriswoodford/foursquare-php/blob/edbfcba2993a101ead8f381394742a4689aec398/lib/TheTwelve/Foursquare/UsersGateway.php#L112-L120
chriswoodford/foursquare-php
lib/TheTwelve/Foursquare/UsersGateway.php
UsersGateway.getFriends
public function getFriends(array $options = array()) { $uri = $this->buildUserResourceUri('friends'); $response = $this->makeAuthenticatedApiRequest($uri, $options); return $response->friends->items; }
php
public function getFriends(array $options = array()) { $uri = $this->buildUserResourceUri('friends'); $response = $this->makeAuthenticatedApiRequest($uri, $options); return $response->friends->items; }
[ "public", "function", "getFriends", "(", "array", "$", "options", "=", "array", "(", ")", ")", "{", "$", "uri", "=", "$", "this", "->", "buildUserResourceUri", "(", "'friends'", ")", ";", "$", "response", "=", "$", "this", "->", "makeAuthenticatedApiReques...
Returns an array of a user's friends. @see https://developer.foursquare.com/docs/users/friends @param array $options
[ "Returns", "an", "array", "of", "a", "user", "s", "friends", "." ]
train
https://github.com/chriswoodford/foursquare-php/blob/edbfcba2993a101ead8f381394742a4689aec398/lib/TheTwelve/Foursquare/UsersGateway.php#L127-L135
chriswoodford/foursquare-php
lib/TheTwelve/Foursquare/UsersGateway.php
UsersGateway.getTips
public function getTips(array $options = array()) { $uri = $this->buildUserResourceUri('tips'); $response = $this->makeAuthenticatedApiRequest($uri, $options); return $response->tips->items; }
php
public function getTips(array $options = array()) { $uri = $this->buildUserResourceUri('tips'); $response = $this->makeAuthenticatedApiRequest($uri, $options); return $response->tips->items; }
[ "public", "function", "getTips", "(", "array", "$", "options", "=", "array", "(", ")", ")", "{", "$", "uri", "=", "$", "this", "->", "buildUserResourceUri", "(", "'tips'", ")", ";", "$", "response", "=", "$", "this", "->", "makeAuthenticatedApiRequest", ...
Returns an array of a user's tips. @see https://developer.foursquare.com/docs/users/tips @param array $options
[ "Returns", "an", "array", "of", "a", "user", "s", "tips", "." ]
train
https://github.com/chriswoodford/foursquare-php/blob/edbfcba2993a101ead8f381394742a4689aec398/lib/TheTwelve/Foursquare/UsersGateway.php#L142-L150
chriswoodford/foursquare-php
lib/TheTwelve/Foursquare/UsersGateway.php
UsersGateway.getLists
public function getLists(array $options = array()) { $uri = $this->buildUserResourceUri('lists'); $response = $this->makeAuthenticatedApiRequest($uri, $options); return $response->lists; }
php
public function getLists(array $options = array()) { $uri = $this->buildUserResourceUri('lists'); $response = $this->makeAuthenticatedApiRequest($uri, $options); return $response->lists; }
[ "public", "function", "getLists", "(", "array", "$", "options", "=", "array", "(", ")", ")", "{", "$", "uri", "=", "$", "this", "->", "buildUserResourceUri", "(", "'lists'", ")", ";", "$", "response", "=", "$", "this", "->", "makeAuthenticatedApiRequest", ...
A User's Lists. @see https://developer.foursquare.com/docs/users/lists @param array $options
[ "A", "User", "s", "Lists", "." ]
train
https://github.com/chriswoodford/foursquare-php/blob/edbfcba2993a101ead8f381394742a4689aec398/lib/TheTwelve/Foursquare/UsersGateway.php#L157-L165
chriswoodford/foursquare-php
lib/TheTwelve/Foursquare/UsersGateway.php
UsersGateway.getMayorships
public function getMayorships() { $uri = $this->buildUserResourceUri('mayorships'); $response = $this->makeAuthenticatedApiRequest($uri); return $response->mayorships->items; }
php
public function getMayorships() { $uri = $this->buildUserResourceUri('mayorships'); $response = $this->makeAuthenticatedApiRequest($uri); return $response->mayorships->items; }
[ "public", "function", "getMayorships", "(", ")", "{", "$", "uri", "=", "$", "this", "->", "buildUserResourceUri", "(", "'mayorships'", ")", ";", "$", "response", "=", "$", "this", "->", "makeAuthenticatedApiRequest", "(", "$", "uri", ")", ";", "return", "$...
Returns a user's mayorships. @see https://developer.foursquare.com/docs/users/mayorships
[ "Returns", "a", "user", "s", "mayorships", "." ]
train
https://github.com/chriswoodford/foursquare-php/blob/edbfcba2993a101ead8f381394742a4689aec398/lib/TheTwelve/Foursquare/UsersGateway.php#L171-L179
chriswoodford/foursquare-php
lib/TheTwelve/Foursquare/UsersGateway.php
UsersGateway.getPhotos
public function getPhotos(array $options = array()) { $uri = $this->buildUserResourceUri('photos'); $response = $this->makeAuthenticatedApiRequest($uri); return $response->photos->items; }
php
public function getPhotos(array $options = array()) { $uri = $this->buildUserResourceUri('photos'); $response = $this->makeAuthenticatedApiRequest($uri); return $response->photos->items; }
[ "public", "function", "getPhotos", "(", "array", "$", "options", "=", "array", "(", ")", ")", "{", "$", "uri", "=", "$", "this", "->", "buildUserResourceUri", "(", "'photos'", ")", ";", "$", "response", "=", "$", "this", "->", "makeAuthenticatedApiRequest"...
Returns photos from a user. @see https://developer.foursquare.com/docs/users/photos @param array $options
[ "Returns", "photos", "from", "a", "user", "." ]
train
https://github.com/chriswoodford/foursquare-php/blob/edbfcba2993a101ead8f381394742a4689aec398/lib/TheTwelve/Foursquare/UsersGateway.php#L186-L194
chriswoodford/foursquare-php
lib/TheTwelve/Foursquare/UsersGateway.php
UsersGateway.getVenueHistory
public function getVenueHistory(array $options = array()) { $uri = $this->buildUserResourceUri('venuehistory'); $response = $this->makeAuthenticatedApiRequest($uri); return $response->venues->items; }
php
public function getVenueHistory(array $options = array()) { $uri = $this->buildUserResourceUri('venuehistory'); $response = $this->makeAuthenticatedApiRequest($uri); return $response->venues->items; }
[ "public", "function", "getVenueHistory", "(", "array", "$", "options", "=", "array", "(", ")", ")", "{", "$", "uri", "=", "$", "this", "->", "buildUserResourceUri", "(", "'venuehistory'", ")", ";", "$", "response", "=", "$", "this", "->", "makeAuthenticate...
Returns a list of all venues visited by the specified user, along with how many visits and when they were last there. @see https://developer.foursquare.com/docs/users/venuehistory @param array $options
[ "Returns", "a", "list", "of", "all", "venues", "visited", "by", "the", "specified", "user", "along", "with", "how", "many", "visits", "and", "when", "they", "were", "last", "there", "." ]
train
https://github.com/chriswoodford/foursquare-php/blob/edbfcba2993a101ead8f381394742a4689aec398/lib/TheTwelve/Foursquare/UsersGateway.php#L202-L210
chriswoodford/foursquare-php
lib/TheTwelve/Foursquare/UsersGateway.php
UsersGateway.approve
public function approve($friendId) { $uri = $this->buildUserResourceUri('approve', $friendId); $response = $this->makeAuthenticatedApiRequest($uri); return $response->user; }
php
public function approve($friendId) { $uri = $this->buildUserResourceUri('approve', $friendId); $response = $this->makeAuthenticatedApiRequest($uri); return $response->user; }
[ "public", "function", "approve", "(", "$", "friendId", ")", "{", "$", "uri", "=", "$", "this", "->", "buildUserResourceUri", "(", "'approve'", ",", "$", "friendId", ")", ";", "$", "response", "=", "$", "this", "->", "makeAuthenticatedApiRequest", "(", "$",...
Approves a pending friend request from another user. @param string $friendId @return \stdClass
[ "Approves", "a", "pending", "friend", "request", "from", "another", "user", "." ]
train
https://github.com/chriswoodford/foursquare-php/blob/edbfcba2993a101ead8f381394742a4689aec398/lib/TheTwelve/Foursquare/UsersGateway.php#L217-L225
chriswoodford/foursquare-php
lib/TheTwelve/Foursquare/UsersGateway.php
UsersGateway.deny
public function deny($friendId) { $uri = $this->buildUserResourceUri('deny', $friendId); $response = $this->makeAuthenticatedApiRequest($uri); return $response->user; }
php
public function deny($friendId) { $uri = $this->buildUserResourceUri('deny', $friendId); $response = $this->makeAuthenticatedApiRequest($uri); return $response->user; }
[ "public", "function", "deny", "(", "$", "friendId", ")", "{", "$", "uri", "=", "$", "this", "->", "buildUserResourceUri", "(", "'deny'", ",", "$", "friendId", ")", ";", "$", "response", "=", "$", "this", "->", "makeAuthenticatedApiRequest", "(", "$", "ur...
Denies a pending friend request from another user. @param string $friendId @return \stdClass
[ "Denies", "a", "pending", "friend", "request", "from", "another", "user", "." ]
train
https://github.com/chriswoodford/foursquare-php/blob/edbfcba2993a101ead8f381394742a4689aec398/lib/TheTwelve/Foursquare/UsersGateway.php#L232-L240
chriswoodford/foursquare-php
lib/TheTwelve/Foursquare/UsersGateway.php
UsersGateway.request
public function request($friendId) { $uri = $this->buildUserResourceUri('request', $friendId); $response = $this->makeAuthenticatedApiRequest($uri); return $response->user; }
php
public function request($friendId) { $uri = $this->buildUserResourceUri('request', $friendId); $response = $this->makeAuthenticatedApiRequest($uri); return $response->user; }
[ "public", "function", "request", "(", "$", "friendId", ")", "{", "$", "uri", "=", "$", "this", "->", "buildUserResourceUri", "(", "'request'", ",", "$", "friendId", ")", ";", "$", "response", "=", "$", "this", "->", "makeAuthenticatedApiRequest", "(", "$",...
Sends a friend request to another user. If the other user is a page then the requesting user will automatically start following the page. @param string $friendId @return \stdClass
[ "Sends", "a", "friend", "request", "to", "another", "user", ".", "If", "the", "other", "user", "is", "a", "page", "then", "the", "requesting", "user", "will", "automatically", "start", "following", "the", "page", "." ]
train
https://github.com/chriswoodford/foursquare-php/blob/edbfcba2993a101ead8f381394742a4689aec398/lib/TheTwelve/Foursquare/UsersGateway.php#L248-L256
chriswoodford/foursquare-php
lib/TheTwelve/Foursquare/UsersGateway.php
UsersGateway.unfriend
public function unfriend($friendId) { $uri = $this->buildUserResourceUri('unfriend', $friendId); $response = $this->makeAuthenticatedApiRequest($uri); return $response->user; }
php
public function unfriend($friendId) { $uri = $this->buildUserResourceUri('unfriend', $friendId); $response = $this->makeAuthenticatedApiRequest($uri); return $response->user; }
[ "public", "function", "unfriend", "(", "$", "friendId", ")", "{", "$", "uri", "=", "$", "this", "->", "buildUserResourceUri", "(", "'unfriend'", ",", "$", "friendId", ")", ";", "$", "response", "=", "$", "this", "->", "makeAuthenticatedApiRequest", "(", "$...
Cancels any relationship between the acting user and the specified user Removes a friend, unfollows a celebrity, or cancels a pending friend request. @param string $friendId @return \stdClass
[ "Cancels", "any", "relationship", "between", "the", "acting", "user", "and", "the", "specified", "user", "Removes", "a", "friend", "unfollows", "a", "celebrity", "or", "cancels", "a", "pending", "friend", "request", "." ]
train
https://github.com/chriswoodford/foursquare-php/blob/edbfcba2993a101ead8f381394742a4689aec398/lib/TheTwelve/Foursquare/UsersGateway.php#L265-L273