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
movoin/one-swoole
src/Middleware/Manager.php
Manager.executeTerminators
public function executeTerminators(Request $request, Response $response): Response { $middlewares = $this->filterMiddleware(Terminator::class); foreach ($middlewares as $middleware) { $response = $middleware->doTerminate($request, $response); } unset($middlewares); ...
php
public function executeTerminators(Request $request, Response $response): Response { $middlewares = $this->filterMiddleware(Terminator::class); foreach ($middlewares as $middleware) { $response = $middleware->doTerminate($request, $response); } unset($middlewares); ...
[ "public", "function", "executeTerminators", "(", "Request", "$", "request", ",", "Response", "$", "response", ")", ":", "Response", "{", "$", "middlewares", "=", "$", "this", "->", "filterMiddleware", "(", "Terminator", "::", "class", ")", ";", "foreach", "(...
执行匹配的结束器 @param \One\Protocol\Contracts\Request $request @param \One\Protocol\Contracts\Response $response @return \One\Protocol\Contracts\Response
[ "执行匹配的结束器" ]
train
https://github.com/movoin/one-swoole/blob/b9b175963ead91416cc50902a04e05ff3ef571de/src/Middleware/Manager.php#L162-L173
movoin/one-swoole
src/Middleware/Manager.php
Manager.addMatched
protected function addMatched(string $name) { if (! isset($this->matched[$name])) { $this->matched[$name] = $this->newMiddleware($name); } }
php
protected function addMatched(string $name) { if (! isset($this->matched[$name])) { $this->matched[$name] = $this->newMiddleware($name); } }
[ "protected", "function", "addMatched", "(", "string", "$", "name", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "matched", "[", "$", "name", "]", ")", ")", "{", "$", "this", "->", "matched", "[", "$", "name", "]", "=", "$", "this", ...
添加已匹配的中间件 @param string $name @throws \One\Middleware\Exceptions\MiddlewareException
[ "添加已匹配的中间件" ]
train
https://github.com/movoin/one-swoole/blob/b9b175963ead91416cc50902a04e05ff3ef571de/src/Middleware/Manager.php#L196-L201
movoin/one-swoole
src/Middleware/Manager.php
Manager.newMiddleware
protected function newMiddleware(string $name): Middleware { try { $middleware = Reflection::newInstance($name); } catch (ReflectionException $e) { throw new MiddlewareException('Middleware error while retrieving "%s"', $name, 0, $e); } return $middleware; ...
php
protected function newMiddleware(string $name): Middleware { try { $middleware = Reflection::newInstance($name); } catch (ReflectionException $e) { throw new MiddlewareException('Middleware error while retrieving "%s"', $name, 0, $e); } return $middleware; ...
[ "protected", "function", "newMiddleware", "(", "string", "$", "name", ")", ":", "Middleware", "{", "try", "{", "$", "middleware", "=", "Reflection", "::", "newInstance", "(", "$", "name", ")", ";", "}", "catch", "(", "ReflectionException", "$", "e", ")", ...
实例化中间件 @param string $name @return \One\Middleware\Contracts\Middleware @throws \One\Middleware\Exceptions\MiddlewareException
[ "实例化中间件" ]
train
https://github.com/movoin/one-swoole/blob/b9b175963ead91416cc50902a04e05ff3ef571de/src/Middleware/Manager.php#L211-L220
ekyna/GlsUniBox
Api/Service.php
Service.getLabel
static public function getLabel($code) { static::isValid($code); switch ($code) { case static::EBP : return 'Euro Business Parcel'; case static::GBP : return 'Global Business Parcel'; case static::EP : return 'Expre...
php
static public function getLabel($code) { static::isValid($code); switch ($code) { case static::EBP : return 'Euro Business Parcel'; case static::GBP : return 'Global Business Parcel'; case static::EP : return 'Expre...
[ "static", "public", "function", "getLabel", "(", "$", "code", ")", "{", "static", "::", "isValid", "(", "$", "code", ")", ";", "switch", "(", "$", "code", ")", "{", "case", "static", "::", "EBP", ":", "return", "'Euro Business Parcel'", ";", "case", "s...
Returns the label for the given product code. @param string $code @return string
[ "Returns", "the", "label", "for", "the", "given", "product", "code", "." ]
train
https://github.com/ekyna/GlsUniBox/blob/b474271ba355c3917074422306dc64abf09584d0/Api/Service.php#L90-L109
ekyna/GlsUniBox
Api/Service.php
Service.getChoices
static public function getChoices() { $choices = []; foreach (static::getCodes() as $code) { $choices[static::getLabel($code)] = $code; } return $choices; }
php
static public function getChoices() { $choices = []; foreach (static::getCodes() as $code) { $choices[static::getLabel($code)] = $code; } return $choices; }
[ "static", "public", "function", "getChoices", "(", ")", "{", "$", "choices", "=", "[", "]", ";", "foreach", "(", "static", "::", "getCodes", "(", ")", "as", "$", "code", ")", "{", "$", "choices", "[", "static", "::", "getLabel", "(", "$", "code", "...
Returns the choices. @return array
[ "Returns", "the", "choices", "." ]
train
https://github.com/ekyna/GlsUniBox/blob/b474271ba355c3917074422306dc64abf09584d0/Api/Service.php#L116-L125
ekyna/GlsUniBox
Api/Service.php
Service.getUniShip
static function getUniShip($code) { static::isValid($code); switch ($code) { case static::EBP : return 'CC'; case static::GBP : return 'FF'; case static::EP : case static::SHD : case static::FDF : ...
php
static function getUniShip($code) { static::isValid($code); switch ($code) { case static::EBP : return 'CC'; case static::GBP : return 'FF'; case static::EP : case static::SHD : case static::FDF : ...
[ "static", "function", "getUniShip", "(", "$", "code", ")", "{", "static", "::", "isValid", "(", "$", "code", ")", ";", "switch", "(", "$", "code", ")", "{", "case", "static", "::", "EBP", ":", "return", "'CC'", ";", "case", "static", "::", "GBP", "...
Returns the "UNI Ship" equivalent product code. @param string $code @return string
[ "Returns", "the", "UNI", "Ship", "equivalent", "product", "code", "." ]
train
https://github.com/ekyna/GlsUniBox/blob/b474271ba355c3917074422306dc64abf09584d0/Api/Service.php#L162-L179
fuzz-productions/laravel-api-data
src/Traits/Transformations.php
Transformations.transformEntity
public function transformEntity($entity, $transformer = null, SerializerAbstract $serializer = null): array { $transformer = $transformer ?: $this->getTransformerFromClassProperty(); $results = $this->transform()->resourceWith($entity, $transformer)->usingPaginatorIfPaged(); if ($serializer) { return $resul...
php
public function transformEntity($entity, $transformer = null, SerializerAbstract $serializer = null): array { $transformer = $transformer ?: $this->getTransformerFromClassProperty(); $results = $this->transform()->resourceWith($entity, $transformer)->usingPaginatorIfPaged(); if ($serializer) { return $resul...
[ "public", "function", "transformEntity", "(", "$", "entity", ",", "$", "transformer", "=", "null", ",", "SerializerAbstract", "$", "serializer", "=", "null", ")", ":", "array", "{", "$", "transformer", "=", "$", "transformer", "?", ":", "$", "this", "->", ...
Shortcut method for serializing and transforming an entity. @param $entity @param TransformerAbstract|callable|string|null $transformer @param SerializerAbstract|null $serializer @return array
[ "Shortcut", "method", "for", "serializing", "and", "transforming", "an", "entity", "." ]
train
https://github.com/fuzz-productions/laravel-api-data/blob/25e181860d2f269b3b212195944c2bca95b411bb/src/Traits/Transformations.php#L36-L47
fuzz-productions/laravel-api-data
src/Traits/Transformations.php
Transformations.getTransformerFromClassProperty
protected function getTransformerFromClassProperty() { if (! isset($this->transformer) || ! $this->isTransformer($this->transformer)) { throw new \InvalidArgumentException('You cannot transform the entity without providing a valid Transformer. Verify your transformer extends ' . TransformerAbstract::class); } ...
php
protected function getTransformerFromClassProperty() { if (! isset($this->transformer) || ! $this->isTransformer($this->transformer)) { throw new \InvalidArgumentException('You cannot transform the entity without providing a valid Transformer. Verify your transformer extends ' . TransformerAbstract::class); } ...
[ "protected", "function", "getTransformerFromClassProperty", "(", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "transformer", ")", "||", "!", "$", "this", "->", "isTransformer", "(", "$", "this", "->", "transformer", ")", ")", "{", "throw", ...
Gets the transformer from the class and validates it's a correct serializer. @throws \InvalidArgumentException - If the class property does not set a proper Transformer. @return TransformerAbstract
[ "Gets", "the", "transformer", "from", "the", "class", "and", "validates", "it", "s", "a", "correct", "serializer", "." ]
train
https://github.com/fuzz-productions/laravel-api-data/blob/25e181860d2f269b3b212195944c2bca95b411bb/src/Traits/Transformations.php#L56-L65
huasituo/hstcms
src/Providers/RouteServiceProvider.php
RouteServiceProvider.mapApiRoutes
protected function mapApiRoutes() { Route::group([ 'middleware' => 'api', 'namespace' => $this->namespace.'\Api', 'domain' => config('hstcms.apiDomain') ? config('hstcms.apiDomain') : env('APP_URL'), 'prefix' => config('hstcms.apiDomain') ? '' : confi...
php
protected function mapApiRoutes() { Route::group([ 'middleware' => 'api', 'namespace' => $this->namespace.'\Api', 'domain' => config('hstcms.apiDomain') ? config('hstcms.apiDomain') : env('APP_URL'), 'prefix' => config('hstcms.apiDomain') ? '' : confi...
[ "protected", "function", "mapApiRoutes", "(", ")", "{", "Route", "::", "group", "(", "[", "'middleware'", "=>", "'api'", ",", "'namespace'", "=>", "$", "this", "->", "namespace", ".", "'\\Api'", ",", "'domain'", "=>", "config", "(", "'hstcms.apiDomain'", ")"...
Define the "api" routes for the module. These routes are typically stateless. @return void
[ "Define", "the", "api", "routes", "for", "the", "module", "." ]
train
https://github.com/huasituo/hstcms/blob/12819979289e58ce38e3e92540aeeb16e205e525/src/Providers/RouteServiceProvider.php#L72-L82
huasituo/hstcms
src/Providers/RouteServiceProvider.php
RouteServiceProvider.mapOpenRoutes
protected function mapOpenRoutes() { Route::group([ 'middleware' => 'api', 'namespace' => $this->namespace.'\Open', 'prefix' => config('open.apiDomain') ? config('open.apiDomain') : env('APP_URL'), 'prefix' => config('open.apiDomain') ? 'api/cms' : 'o...
php
protected function mapOpenRoutes() { Route::group([ 'middleware' => 'api', 'namespace' => $this->namespace.'\Open', 'prefix' => config('open.apiDomain') ? config('open.apiDomain') : env('APP_URL'), 'prefix' => config('open.apiDomain') ? 'api/cms' : 'o...
[ "protected", "function", "mapOpenRoutes", "(", ")", "{", "Route", "::", "group", "(", "[", "'middleware'", "=>", "'api'", ",", "'namespace'", "=>", "$", "this", "->", "namespace", ".", "'\\Open'", ",", "'prefix'", "=>", "config", "(", "'open.apiDomain'", ")"...
开放平台API
[ "开放平台API" ]
train
https://github.com/huasituo/hstcms/blob/12819979289e58ce38e3e92540aeeb16e205e525/src/Providers/RouteServiceProvider.php#L85-L95
muxtor/yii2-pkk5-module
src/controllers/Pkk5consoleController.php
Pkk5consoleController.actionParse
public function actionParse($param) { $model = new ParseForm(); $model->kadastr = $param; $data = $model->parse(); echo $this->render('parse',['data'=>$data]); }
php
public function actionParse($param) { $model = new ParseForm(); $model->kadastr = $param; $data = $model->parse(); echo $this->render('parse',['data'=>$data]); }
[ "public", "function", "actionParse", "(", "$", "param", ")", "{", "$", "model", "=", "new", "ParseForm", "(", ")", ";", "$", "model", "->", "kadastr", "=", "$", "param", ";", "$", "data", "=", "$", "model", "->", "parse", "(", ")", ";", "echo", "...
Lists all Pkk5kadastr models. @return mixed
[ "Lists", "all", "Pkk5kadastr", "models", "." ]
train
https://github.com/muxtor/yii2-pkk5-module/blob/09be77ddd171c66df53ec89d229d0cc5c0a9ad94/src/controllers/Pkk5consoleController.php#L21-L28
pageon/SlackWebhookMonolog
src/Slack/Webhook.php
Webhook.setUrl
private function setUrl(Url $url) { $urlValidationRegex = '_https:\/\/hooks.slack.com\/services\/[\w\/]+$_iuS'; if (!preg_match($urlValidationRegex, (string) $url)) { throw new InvalidUrlException( sprintf( 'The url: "%s" is not a valid url. ...
php
private function setUrl(Url $url) { $urlValidationRegex = '_https:\/\/hooks.slack.com\/services\/[\w\/]+$_iuS'; if (!preg_match($urlValidationRegex, (string) $url)) { throw new InvalidUrlException( sprintf( 'The url: "%s" is not a valid url. ...
[ "private", "function", "setUrl", "(", "Url", "$", "url", ")", "{", "$", "urlValidationRegex", "=", "'_https:\\/\\/hooks.slack.com\\/services\\/[\\w\\/]+$_iuS'", ";", "if", "(", "!", "preg_match", "(", "$", "urlValidationRegex", ",", "(", "string", ")", "$", "url",...
This wil set the url if it is valid. @param Url $url @throws InvalidUrlException When it is not a valid webhook url of slack @return self
[ "This", "wil", "set", "the", "url", "if", "it", "is", "valid", "." ]
train
https://github.com/pageon/SlackWebhookMonolog/blob/6755060ddd6429620fd4c7decbb95f05463fc36b/src/Slack/Webhook.php#L58-L74
rozdol/bi
src/Utils/Html.php
Html.tabs_ajax
function tabs_ajax($items = [], $placeholder = '') { if ($placeholder=='') { $placeholder='tab_page_'.uniqid(); $placeholder_div="<div id='$placeholder'></div>"; } foreach ($items as $name => $link) { $list.="<li><a href='#' data-toggle='tab' onclick='aja...
php
function tabs_ajax($items = [], $placeholder = '') { if ($placeholder=='') { $placeholder='tab_page_'.uniqid(); $placeholder_div="<div id='$placeholder'></div>"; } foreach ($items as $name => $link) { $list.="<li><a href='#' data-toggle='tab' onclick='aja...
[ "function", "tabs_ajax", "(", "$", "items", "=", "[", "]", ",", "$", "placeholder", "=", "''", ")", "{", "if", "(", "$", "placeholder", "==", "''", ")", "{", "$", "placeholder", "=", "'tab_page_'", ".", "uniqid", "(", ")", ";", "$", "placeholder_div"...
====
[ "====" ]
train
https://github.com/rozdol/bi/blob/f63d6b219cc4a7bb25b1865905a2a888ce6ce855/src/Utils/Html.php#L1149-L1167
rozdol/bi
src/Utils/Html.php
Html.dropzoneJS
function dropzoneJS($formdata = '', $text = 'Drop files here') { $related_data=json_decode($formdata, true); //echo $this->pre_display($related_data,$formdata); exit; foreach ($related_data as $key => $value) { $hidden.=$this->form_hidden($key, $value); } $out=' ...
php
function dropzoneJS($formdata = '', $text = 'Drop files here') { $related_data=json_decode($formdata, true); //echo $this->pre_display($related_data,$formdata); exit; foreach ($related_data as $key => $value) { $hidden.=$this->form_hidden($key, $value); } $out=' ...
[ "function", "dropzoneJS", "(", "$", "formdata", "=", "''", ",", "$", "text", "=", "'Drop files here'", ")", "{", "$", "related_data", "=", "json_decode", "(", "$", "formdata", ",", "true", ")", ";", "//echo $this->pre_display($related_data,$formdata); exit;", "for...
}
[ "}" ]
train
https://github.com/rozdol/bi/blob/f63d6b219cc4a7bb25b1865905a2a888ce6ce855/src/Utils/Html.php#L2741-L2794
jpuck/color-mixer
src/Color.php
Color.dec
public function dec() : array { $colors = str_split( $this->hex('no-hash'), 2 ); return array_map(function($color){ return hexdec($color); }, $colors); }
php
public function dec() : array { $colors = str_split( $this->hex('no-hash'), 2 ); return array_map(function($color){ return hexdec($color); }, $colors); }
[ "public", "function", "dec", "(", ")", ":", "array", "{", "$", "colors", "=", "str_split", "(", "$", "this", "->", "hex", "(", "'no-hash'", ")", ",", "2", ")", ";", "return", "array_map", "(", "function", "(", "$", "color", ")", "{", "return", "hex...
Get the CSS decimal color. @return array Returns rgb integer decimal colors.
[ "Get", "the", "CSS", "decimal", "color", "." ]
train
https://github.com/jpuck/color-mixer/blob/cea01c3082a921a35e00ae0a287c795d9fd73ada/src/Color.php#L58-L65
jpuck/color-mixer
src/Color.php
Color.validateHexColorString
public static function validateHexColorString(string $hex) : bool { // optional leading hash # $length = strlen( ltrim($hex, '#') ); // must be 3 or 6 characters switch ($length) { case 3: break; case 6: break; default: return false; } ...
php
public static function validateHexColorString(string $hex) : bool { // optional leading hash # $length = strlen( ltrim($hex, '#') ); // must be 3 or 6 characters switch ($length) { case 3: break; case 6: break; default: return false; } ...
[ "public", "static", "function", "validateHexColorString", "(", "string", "$", "hex", ")", ":", "bool", "{", "// optional leading hash #", "$", "length", "=", "strlen", "(", "ltrim", "(", "$", "hex", ",", "'#'", ")", ")", ";", "// must be 3 or 6 characters", "s...
Validates CSS hexadecimal color. @param string $hex CSS hexadecimal color with optional leading hash # @return bool Returns true if valid CSS hexadecimal color, otherwise false.
[ "Validates", "CSS", "hexadecimal", "color", "." ]
train
https://github.com/jpuck/color-mixer/blob/cea01c3082a921a35e00ae0a287c795d9fd73ada/src/Color.php#L74-L87
jan-dolata/crude-crud
src/Http/Controllers/ThumbnailController.php
ThumbnailController.upload
public function upload(ThumbnailRequest $request) { $crudeName = $request->input('crudeName'); $crude = CrudeInstance::get($crudeName); $column = $request->input('columnName'); $file = $request->file()['file']; $id = $request->input('modelId'); $model = $crude->uploa...
php
public function upload(ThumbnailRequest $request) { $crudeName = $request->input('crudeName'); $crude = CrudeInstance::get($crudeName); $column = $request->input('columnName'); $file = $request->file()['file']; $id = $request->input('modelId'); $model = $crude->uploa...
[ "public", "function", "upload", "(", "ThumbnailRequest", "$", "request", ")", "{", "$", "crudeName", "=", "$", "request", "->", "input", "(", "'crudeName'", ")", ";", "$", "crude", "=", "CrudeInstance", "::", "get", "(", "$", "crudeName", ")", ";", "$", ...
Handle thumbnail upload @author Wojciech Jurkowski <w.jurkowski@holonglobe.com>
[ "Handle", "thumbnail", "upload" ]
train
https://github.com/jan-dolata/crude-crud/blob/9129ea08278835cf5cecfd46a90369226ae6bdd7/src/Http/Controllers/ThumbnailController.php#L18-L29
jan-dolata/crude-crud
src/Http/Controllers/ThumbnailController.php
ThumbnailController.delete
public function delete(ThumbnailRequest $request) { $crudeName = $request->input('crudeName'); $crude = CrudeInstance::get($crudeName); $id = $request->input('model_id'); $column = $request->input('model_column'); $model = $crude->deleteThumbnailByIdAndColumn($id, $column); ...
php
public function delete(ThumbnailRequest $request) { $crudeName = $request->input('crudeName'); $crude = CrudeInstance::get($crudeName); $id = $request->input('model_id'); $column = $request->input('model_column'); $model = $crude->deleteThumbnailByIdAndColumn($id, $column); ...
[ "public", "function", "delete", "(", "ThumbnailRequest", "$", "request", ")", "{", "$", "crudeName", "=", "$", "request", "->", "input", "(", "'crudeName'", ")", ";", "$", "crude", "=", "CrudeInstance", "::", "get", "(", "$", "crudeName", ")", ";", "$", ...
delete thumbnail file @author Wojciech Jurkowski <w.jurkowski@holonglobe.com>
[ "delete", "thumbnail", "file" ]
train
https://github.com/jan-dolata/crude-crud/blob/9129ea08278835cf5cecfd46a90369226ae6bdd7/src/Http/Controllers/ThumbnailController.php#L35-L45
WellCommerce/CoreBundle
Form/DataTransformer/EntityToIdentifierTransformer.php
EntityToIdentifierTransformer.transform
public function transform($modelData) { if (null === $modelData) { return 0; } $meta = $this->getRepository()->getMetadata(); $identifier = $meta->getSingleIdentifierFieldName(); return $this->propertyAccessor->getValue($modelData, $identifier); }
php
public function transform($modelData) { if (null === $modelData) { return 0; } $meta = $this->getRepository()->getMetadata(); $identifier = $meta->getSingleIdentifierFieldName(); return $this->propertyAccessor->getValue($modelData, $identifier); }
[ "public", "function", "transform", "(", "$", "modelData", ")", "{", "if", "(", "null", "===", "$", "modelData", ")", "{", "return", "0", ";", "}", "$", "meta", "=", "$", "this", "->", "getRepository", "(", ")", "->", "getMetadata", "(", ")", ";", "...
{@inheritdoc}
[ "{" ]
train
https://github.com/WellCommerce/CoreBundle/blob/984fbd544d4b10cf11e54e0f3c304d100deb6842/Form/DataTransformer/EntityToIdentifierTransformer.php#L27-L37
WellCommerce/CoreBundle
Form/DataTransformer/EntityToIdentifierTransformer.php
EntityToIdentifierTransformer.reverseTransform
public function reverseTransform($modelData, PropertyPathInterface $propertyPath, $value) { if (null !== $value) { $entity = $this->getRepository()->find($value); $this->propertyAccessor->setValue($modelData, $propertyPath, $entity); } }
php
public function reverseTransform($modelData, PropertyPathInterface $propertyPath, $value) { if (null !== $value) { $entity = $this->getRepository()->find($value); $this->propertyAccessor->setValue($modelData, $propertyPath, $entity); } }
[ "public", "function", "reverseTransform", "(", "$", "modelData", ",", "PropertyPathInterface", "$", "propertyPath", ",", "$", "value", ")", "{", "if", "(", "null", "!==", "$", "value", ")", "{", "$", "entity", "=", "$", "this", "->", "getRepository", "(", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/WellCommerce/CoreBundle/blob/984fbd544d4b10cf11e54e0f3c304d100deb6842/Form/DataTransformer/EntityToIdentifierTransformer.php#L42-L48
huasituo/hstcms
src/Libraries/HuasituoApi/ApiBase.php
ApiBase.request
protected function request($url, $data, $headers=array()) { try{ $result = $this->validate($url, $data); if($result !== true) { return $result; } $params = array(); // 特殊处理 $this->proccessRequest($url, $params, $data, $...
php
protected function request($url, $data, $headers=array()) { try{ $result = $this->validate($url, $data); if($result !== true) { return $result; } $params = array(); // 特殊处理 $this->proccessRequest($url, $params, $data, $...
[ "protected", "function", "request", "(", "$", "url", ",", "$", "data", ",", "$", "headers", "=", "array", "(", ")", ")", "{", "try", "{", "$", "result", "=", "$", "this", "->", "validate", "(", "$", "url", ",", "$", "data", ")", ";", "if", "(",...
Api 请求 @param string $url @param mixed $data @return mixed
[ "Api", "请求" ]
train
https://github.com/huasituo/hstcms/blob/12819979289e58ce38e3e92540aeeb16e205e525/src/Libraries/HuasituoApi/ApiBase.php#L88-L112
BugBuster1701/banner
public/conban_clicks.php
BannerClicks.run
public function run() { // Input a digit >0 ? if ( 0 == (int)$this->intBID ) { if ( 0 == (int)$this->intDEFBID ) { header('HTTP/1.1 501 Not Implemented'); throw new \ErrorException('Invalid Banner ID (' . \Input::get('bid') . ')',2,1,basename(__FILE__),__LINE__); } } //Ba...
php
public function run() { // Input a digit >0 ? if ( 0 == (int)$this->intBID ) { if ( 0 == (int)$this->intDEFBID ) { header('HTTP/1.1 501 Not Implemented'); throw new \ErrorException('Invalid Banner ID (' . \Input::get('bid') . ')',2,1,basename(__FILE__),__LINE__); } } //Ba...
[ "public", "function", "run", "(", ")", "{", "// Input a digit >0 ?", "if", "(", "0", "==", "(", "int", ")", "$", "this", "->", "intBID", ")", "{", "if", "(", "0", "==", "(", "int", ")", "$", "this", "->", "intDEFBID", ")", "{", "header", "(", "'H...
Get URL, Count Click, ReDirect
[ "Get", "URL", "Count", "Click", "ReDirect" ]
train
https://github.com/BugBuster1701/banner/blob/3ffac36837923194ab0ebaf308c0b23a3684b005/public/conban_clicks.php#L82-L235
BugBuster1701/banner
public/conban_clicks.php
BannerClicks.getRedirectType
protected function getRedirectType($BID) { // aus BID die CatID // über CatID in tl_module.banner_categories die tl_module.banner_redirect // Schleife über alle zeilen, falls mehrere $objCat = \Database::getInstance()->prepare("SELECT pid as CatID ...
php
protected function getRedirectType($BID) { // aus BID die CatID // über CatID in tl_module.banner_categories die tl_module.banner_redirect // Schleife über alle zeilen, falls mehrere $objCat = \Database::getInstance()->prepare("SELECT pid as CatID ...
[ "protected", "function", "getRedirectType", "(", "$", "BID", ")", "{", "// aus BID die CatID", "// über CatID in tl_module.banner_categories die tl_module.banner_redirect", "// Schleife über alle zeilen, falls mehrere", "$", "objCat", "=", "\\", "Database", "::", "getInstance", "...
Search Banner Redirect Definition @return int 301,302
[ "Search", "Banner", "Redirect", "Definition" ]
train
https://github.com/BugBuster1701/banner/blob/3ffac36837923194ab0ebaf308c0b23a3684b005/public/conban_clicks.php#L243-L308
BugBuster1701/banner
public/conban_clicks.php
BannerClicks.getSetReClickBlocker
protected function getSetReClickBlocker() { //$ClientIP = bin2hex(sha1(\Environment::get('remoteAddr'),true)); // sha1 20 Zeichen, bin2hex 40 zeichen $BannerID = $this->intBID; if ( $this->getReClickBlockerId($BannerID) === false ) { // nichts geblockt, also blocken fürs den nächsten Aufr...
php
protected function getSetReClickBlocker() { //$ClientIP = bin2hex(sha1(\Environment::get('remoteAddr'),true)); // sha1 20 Zeichen, bin2hex 40 zeichen $BannerID = $this->intBID; if ( $this->getReClickBlockerId($BannerID) === false ) { // nichts geblockt, also blocken fürs den nächsten Aufr...
[ "protected", "function", "getSetReClickBlocker", "(", ")", "{", "//$ClientIP = bin2hex(sha1(\\Environment::get('remoteAddr'),true)); // sha1 20 Zeichen, bin2hex 40 zeichen", "$", "BannerID", "=", "$", "this", "->", "intBID", ";", "if", "(", "$", "this", "->", "getReClickBlock...
ReClick Blocker @return bool false/true = no ban / ban
[ "ReClick", "Blocker" ]
train
https://github.com/BugBuster1701/banner/blob/3ffac36837923194ab0ebaf308c0b23a3684b005/public/conban_clicks.php#L316-L334
BugBuster1701/banner
public/conban_clicks.php
BannerClicks.checkBot
protected function checkBot() { if (isset($GLOBALS['TL_CONFIG']['mod_banner_bot_check']) && (int)$GLOBALS['TL_CONFIG']['mod_banner_bot_check'] == 0 ) { //fuer debug log_message('bannerCheckBot abgeschaltet','Banner.log'); return false; //Bot Suche abgeschaltet ueber localco...
php
protected function checkBot() { if (isset($GLOBALS['TL_CONFIG']['mod_banner_bot_check']) && (int)$GLOBALS['TL_CONFIG']['mod_banner_bot_check'] == 0 ) { //fuer debug log_message('bannerCheckBot abgeschaltet','Banner.log'); return false; //Bot Suche abgeschaltet ueber localco...
[ "protected", "function", "checkBot", "(", ")", "{", "if", "(", "isset", "(", "$", "GLOBALS", "[", "'TL_CONFIG'", "]", "[", "'mod_banner_bot_check'", "]", ")", "&&", "(", "int", ")", "$", "GLOBALS", "[", "'TL_CONFIG'", "]", "[", "'mod_banner_bot_check'", "]...
Spider Bot Check @return true = found, false = not found
[ "Spider", "Bot", "Check" ]
train
https://github.com/BugBuster1701/banner/blob/3ffac36837923194ab0ebaf308c0b23a3684b005/public/conban_clicks.php#L340-L356
BugBuster1701/banner
public/conban_clicks.php
BannerClicks.checkUserAgent
protected function checkUserAgent() { if ( \Environment::get('httpUserAgent') ) { $UserAgent = trim( \Environment::get('httpUserAgent') ); } else { return false; // Ohne Absender keine Suche } $objUserAgent = \Database::getInstance()->prepare("SELE...
php
protected function checkUserAgent() { if ( \Environment::get('httpUserAgent') ) { $UserAgent = trim( \Environment::get('httpUserAgent') ); } else { return false; // Ohne Absender keine Suche } $objUserAgent = \Database::getInstance()->prepare("SELE...
[ "protected", "function", "checkUserAgent", "(", ")", "{", "if", "(", "\\", "Environment", "::", "get", "(", "'httpUserAgent'", ")", ")", "{", "$", "UserAgent", "=", "trim", "(", "\\", "Environment", "::", "get", "(", "'httpUserAgent'", ")", ")", ";", "}"...
HTTP_USER_AGENT Special Check
[ "HTTP_USER_AGENT", "Special", "Check" ]
train
https://github.com/BugBuster1701/banner/blob/3ffac36837923194ab0ebaf308c0b23a3684b005/public/conban_clicks.php#L361-L398
BugBuster1701/banner
public/conban_clicks.php
BannerClicks.getReClickBlockerId
protected function getReClickBlockerId($banner_id=0) { $this->getSession('ReClickBlocker'); if ( count($this->_session) ) { reset($this->_session); foreach ($this->_session as $key => $val) { if ( $key == $banner_id && ...
php
protected function getReClickBlockerId($banner_id=0) { $this->getSession('ReClickBlocker'); if ( count($this->_session) ) { reset($this->_session); foreach ($this->_session as $key => $val) { if ( $key == $banner_id && ...
[ "protected", "function", "getReClickBlockerId", "(", "$", "banner_id", "=", "0", ")", "{", "$", "this", "->", "getSession", "(", "'ReClickBlocker'", ")", ";", "if", "(", "count", "(", "$", "this", "->", "_session", ")", ")", "{", "reset", "(", "$", "th...
Get ReClick Blocker, Get Banner ID if the timestamp .... @param boolean true if blocked | false
[ "Get", "ReClick", "Blocker", "Get", "Banner", "ID", "if", "the", "timestamp", "...." ]
train
https://github.com/BugBuster1701/banner/blob/3ffac36837923194ab0ebaf308c0b23a3684b005/public/conban_clicks.php#L433-L451
czim/laravel-pxlcms
src/Generator/Writer/Model/Steps/StubReplaceScopes.php
StubReplaceScopes.getCmsOrderedConfigReplace
protected function getCmsOrderedConfigReplace() { $orderColumns = $this->data['ordered_by'] ?: []; // for now, ignore the ordering if the column to order on is translated $translatedOrderColumns = array_intersect(array_keys($orderColumns ), $this->data['translated_attributes']); ...
php
protected function getCmsOrderedConfigReplace() { $orderColumns = $this->data['ordered_by'] ?: []; // for now, ignore the ordering if the column to order on is translated $translatedOrderColumns = array_intersect(array_keys($orderColumns ), $this->data['translated_attributes']); ...
[ "protected", "function", "getCmsOrderedConfigReplace", "(", ")", "{", "$", "orderColumns", "=", "$", "this", "->", "data", "[", "'ordered_by'", "]", "?", ":", "[", "]", ";", "// for now, ignore the ordering if the column to order on is translated", "$", "translatedOrder...
Returns the replace required depending on whether the CMS module has automatic sorting for defined columns @return string
[ "Returns", "the", "replace", "required", "depending", "on", "whether", "the", "CMS", "module", "has", "automatic", "sorting", "for", "defined", "columns" ]
train
https://github.com/czim/laravel-pxlcms/blob/910297d2a3f2db86dde51b0e10fe5aad45f1aa1a/src/Generator/Writer/Model/Steps/StubReplaceScopes.php#L87-L131
czim/laravel-pxlcms
src/Generator/Writer/Model/Steps/StubReplaceScopes.php
StubReplaceScopes.useScopeActive
protected function useScopeActive() { if (is_null($this->data['scope_active'])) { return config('pxlcms.generator.models.scopes.only_active') === CmsModelWriter::SCOPE_METHOD; } return (bool) $this->data['scope_active']; }
php
protected function useScopeActive() { if (is_null($this->data['scope_active'])) { return config('pxlcms.generator.models.scopes.only_active') === CmsModelWriter::SCOPE_METHOD; } return (bool) $this->data['scope_active']; }
[ "protected", "function", "useScopeActive", "(", ")", "{", "if", "(", "is_null", "(", "$", "this", "->", "data", "[", "'scope_active'", "]", ")", ")", "{", "return", "config", "(", "'pxlcms.generator.models.scopes.only_active'", ")", "===", "CmsModelWriter", "::"...
Returns whether we're using a global scope for active @return bool
[ "Returns", "whether", "we", "re", "using", "a", "global", "scope", "for", "active" ]
train
https://github.com/czim/laravel-pxlcms/blob/910297d2a3f2db86dde51b0e10fe5aad45f1aa1a/src/Generator/Writer/Model/Steps/StubReplaceScopes.php#L149-L156
czim/laravel-pxlcms
src/Generator/Writer/Model/Steps/StubReplaceScopes.php
StubReplaceScopes.useScopePosition
protected function useScopePosition() { if (is_null($this->data['scope_position'])) { return config('pxlcms.generator.models.scopes.position_order') === CmsModelWriter::SCOPE_METHOD; } return (bool) $this->data['scope_position']; }
php
protected function useScopePosition() { if (is_null($this->data['scope_position'])) { return config('pxlcms.generator.models.scopes.position_order') === CmsModelWriter::SCOPE_METHOD; } return (bool) $this->data['scope_position']; }
[ "protected", "function", "useScopePosition", "(", ")", "{", "if", "(", "is_null", "(", "$", "this", "->", "data", "[", "'scope_position'", "]", ")", ")", "{", "return", "config", "(", "'pxlcms.generator.models.scopes.position_order'", ")", "===", "CmsModelWriter",...
Returns whether we're using a global scope for position @return bool
[ "Returns", "whether", "we", "re", "using", "a", "global", "scope", "for", "position" ]
train
https://github.com/czim/laravel-pxlcms/blob/910297d2a3f2db86dde51b0e10fe5aad45f1aa1a/src/Generator/Writer/Model/Steps/StubReplaceScopes.php#L163-L170
huasituo/hstcms
src/Database/Migrations/2016_11_23_152536_create_common_config_table.php
CreateCommonConfigTable.up
public function up() { // Schema::create('common_config', function (Blueprint $table) { $table->increments('id')->comment('ID'); $table->string('name', 30)->default('')->comment(hst_lang('hstcms::public.name')); $table->string('namespace', 30)->default(''...
php
public function up() { // Schema::create('common_config', function (Blueprint $table) { $table->increments('id')->comment('ID'); $table->string('name', 30)->default('')->comment(hst_lang('hstcms::public.name')); $table->string('namespace', 30)->default(''...
[ "public", "function", "up", "(", ")", "{", "//", "Schema", "::", "create", "(", "'common_config'", ",", "function", "(", "Blueprint", "$", "table", ")", "{", "$", "table", "->", "increments", "(", "'id'", ")", "->", "comment", "(", "'ID'", ")", ";", ...
Run the migrations. @return void
[ "Run", "the", "migrations", "." ]
train
https://github.com/huasituo/hstcms/blob/12819979289e58ce38e3e92540aeeb16e205e525/src/Database/Migrations/2016_11_23_152536_create_common_config_table.php#L18-L32
BugBuster1701/banner
classes/BannerStatisticsHelper.php
BannerStatisticsHelper.getCatID
protected function getCatID() { $objBannerCatID = \Database::getInstance()->prepare("SELECT MIN(pid) AS ID FROM tl_b...
php
protected function getCatID() { $objBannerCatID = \Database::getInstance()->prepare("SELECT MIN(pid) AS ID FROM tl_b...
[ "protected", "function", "getCatID", "(", ")", "{", "$", "objBannerCatID", "=", "\\", "Database", "::", "getInstance", "(", ")", "->", "prepare", "(", "\"SELECT \n MIN(pid) AS ID \n ...
Get min category id @deprecated @return number CatID 0|min(pid)
[ "Get", "min", "category", "id" ]
train
https://github.com/BugBuster1701/banner/blob/3ffac36837923194ab0ebaf308c0b23a3684b005/classes/BannerStatisticsHelper.php#L89-L105
BugBuster1701/banner
classes/BannerStatisticsHelper.php
BannerStatisticsHelper.getBannersByCatID
protected function getBannersByCatID($CatID = 0) { $arrBanners = array(); if ($CatID == -1) { // all Categories $objBanners = \Database::getInstance() ->prepare("SELECT tb.id ...
php
protected function getBannersByCatID($CatID = 0) { $arrBanners = array(); if ($CatID == -1) { // all Categories $objBanners = \Database::getInstance() ->prepare("SELECT tb.id ...
[ "protected", "function", "getBannersByCatID", "(", "$", "CatID", "=", "0", ")", "{", "$", "arrBanners", "=", "array", "(", ")", ";", "if", "(", "$", "CatID", "==", "-", "1", ")", "{", "// all Categories", "$", "objBanners", "=", "\\", "Database", "::",...
Get banners by category id @param integer $CatID @return array $arrBanners
[ "Get", "banners", "by", "category", "id" ]
train
https://github.com/BugBuster1701/banner/blob/3ffac36837923194ab0ebaf308c0b23a3684b005/classes/BannerStatisticsHelper.php#L125-L219
BugBuster1701/banner
classes/BannerStatisticsHelper.php
BannerStatisticsHelper.getBannerCategories
protected function getBannerCategories($banner_number) { // Kat sammeln $objBannerCat = \Database::getInstance() ->prepare("SELECT id , title FR...
php
protected function getBannerCategories($banner_number) { // Kat sammeln $objBannerCat = \Database::getInstance() ->prepare("SELECT id , title FR...
[ "protected", "function", "getBannerCategories", "(", "$", "banner_number", ")", "{", "// Kat sammeln", "$", "objBannerCat", "=", "\\", "Database", "::", "getInstance", "(", ")", "->", "prepare", "(", "\"SELECT \n id \n ...
Get banner categories @deprecated @param integer $banner_number @return array $arrBannerCats
[ "Get", "banner", "categories" ]
train
https://github.com/BugBuster1701/banner/blob/3ffac36837923194ab0ebaf308c0b23a3684b005/classes/BannerStatisticsHelper.php#L228-L290
BugBuster1701/banner
classes/BannerStatisticsHelper.php
BannerStatisticsHelper.getBannerCategoriesByUsergroups
protected function getBannerCategoriesByUsergroups() { $arrBannerCats = array(); $objBannerCat = \Database::getInstance() ->prepare("SELECT `id` , `title` ...
php
protected function getBannerCategoriesByUsergroups() { $arrBannerCats = array(); $objBannerCat = \Database::getInstance() ->prepare("SELECT `id` , `title` ...
[ "protected", "function", "getBannerCategoriesByUsergroups", "(", ")", "{", "$", "arrBannerCats", "=", "array", "(", ")", ";", "$", "objBannerCat", "=", "\\", "Database", "::", "getInstance", "(", ")", "->", "prepare", "(", "\"SELECT\n ...
Get banner categories by usergroups @param array $Usergroups @return array
[ "Get", "banner", "categories", "by", "usergroups" ]
train
https://github.com/BugBuster1701/banner/blob/3ffac36837923194ab0ebaf308c0b23a3684b005/classes/BannerStatisticsHelper.php#L298-L334
BugBuster1701/banner
classes/BannerStatisticsHelper.php
BannerStatisticsHelper.setBannerURL
protected function setBannerURL( &$Banner ) { //Banner Ziel per Page? if ($Banner['banner_jumpTo'] > 0) { //url generieren $objBannerNextPage = \Database::getInstance() ->prepare("SELECT ...
php
protected function setBannerURL( &$Banner ) { //Banner Ziel per Page? if ($Banner['banner_jumpTo'] > 0) { //url generieren $objBannerNextPage = \Database::getInstance() ->prepare("SELECT ...
[ "protected", "function", "setBannerURL", "(", "&", "$", "Banner", ")", "{", "//Banner Ziel per Page?", "if", "(", "$", "Banner", "[", "'banner_jumpTo'", "]", ">", "0", ")", "{", "//url generieren", "$", "objBannerNextPage", "=", "\\", "Database", "::", "getIns...
Set banner_url @param referenz $Banner
[ "Set", "banner_url" ]
train
https://github.com/BugBuster1701/banner/blob/3ffac36837923194ab0ebaf308c0b23a3684b005/classes/BannerStatisticsHelper.php#L342-L371
BugBuster1701/banner
classes/BannerStatisticsHelper.php
BannerStatisticsHelper.setBannerPublishedActive
protected function setBannerPublishedActive( &$Banner ) { if ( ($Banner['banner_published'] == 1) && ($Banner['banner_start'] == '' || $Banner['banner_start'] <= time() ) && ($Banner['banner_stop'] == '' || $Banner['banner_stop'] > time() ) ) { $Ba...
php
protected function setBannerPublishedActive( &$Banner ) { if ( ($Banner['banner_published'] == 1) && ($Banner['banner_start'] == '' || $Banner['banner_start'] <= time() ) && ($Banner['banner_stop'] == '' || $Banner['banner_stop'] > time() ) ) { $Ba...
[ "protected", "function", "setBannerPublishedActive", "(", "&", "$", "Banner", ")", "{", "if", "(", "(", "$", "Banner", "[", "'banner_published'", "]", "==", "1", ")", "&&", "(", "$", "Banner", "[", "'banner_start'", "]", "==", "''", "||", "$", "Banner", ...
Set banner_published @param referenz $Banner
[ "Set", "banner_published" ]
train
https://github.com/BugBuster1701/banner/blob/3ffac36837923194ab0ebaf308c0b23a3684b005/classes/BannerStatisticsHelper.php#L378-L413
BugBuster1701/banner
classes/BannerStatisticsHelper.php
BannerStatisticsHelper.getMaxViewsClicksStatus
protected function getMaxViewsClicksStatus( &$Banner ) { $intMaxViews = false; $intMaxClicks= false; if ($Banner['banner_until'] == 1 && $Banner['banner_views_until'] != '' && $Banner['banner_views'] >= $Banner['banner_views_until'] ) { ...
php
protected function getMaxViewsClicksStatus( &$Banner ) { $intMaxViews = false; $intMaxClicks= false; if ($Banner['banner_until'] == 1 && $Banner['banner_views_until'] != '' && $Banner['banner_views'] >= $Banner['banner_views_until'] ) { ...
[ "protected", "function", "getMaxViewsClicksStatus", "(", "&", "$", "Banner", ")", "{", "$", "intMaxViews", "=", "false", ";", "$", "intMaxClicks", "=", "false", ";", "if", "(", "$", "Banner", "[", "'banner_until'", "]", "==", "1", "&&", "$", "Banner", "[...
Get status of maxviews and maxclicks @param array $Banner @return array array(bool $intMaxViews, bool $intMaxClicks)
[ "Get", "status", "of", "maxviews", "and", "maxclicks" ]
train
https://github.com/BugBuster1701/banner/blob/3ffac36837923194ab0ebaf308c0b23a3684b005/classes/BannerStatisticsHelper.php#L421-L445
BugBuster1701/banner
classes/BannerStatisticsHelper.php
BannerStatisticsHelper.setZero
protected function setZero() { //Banner $intBID = (int)\Input::post('zid',true) ; if ($intBID>0) { \Database::getInstance()->prepare("UPDATE tl_banner_stat SET ...
php
protected function setZero() { //Banner $intBID = (int)\Input::post('zid',true) ; if ($intBID>0) { \Database::getInstance()->prepare("UPDATE tl_banner_stat SET ...
[ "protected", "function", "setZero", "(", ")", "{", "//Banner", "$", "intBID", "=", "(", "int", ")", "\\", "Input", "::", "post", "(", "'zid'", ",", "true", ")", ";", "if", "(", "$", "intBID", ">", "0", ")", "{", "\\", "Database", "::", "getInstance...
Statistic, set on zero
[ "Statistic", "set", "on", "zero" ]
train
https://github.com/BugBuster1701/banner/blob/3ffac36837923194ab0ebaf308c0b23a3684b005/classes/BannerStatisticsHelper.php#L450-L485
BugBuster1701/banner
classes/BannerStatisticsHelper.php
BannerStatisticsHelper.isUserInBannerStatGroups
protected function isUserInBannerStatGroups($banner_stat_groups, $banner_stat_protected) { if ( true === $this->User->isAdmin ) { //DEBUG log_message('Ich bin Admin', 'banner.log'); return true; // Admin darf immer } //wenn Schutz nicht aktiviert ist, darf je...
php
protected function isUserInBannerStatGroups($banner_stat_groups, $banner_stat_protected) { if ( true === $this->User->isAdmin ) { //DEBUG log_message('Ich bin Admin', 'banner.log'); return true; // Admin darf immer } //wenn Schutz nicht aktiviert ist, darf je...
[ "protected", "function", "isUserInBannerStatGroups", "(", "$", "banner_stat_groups", ",", "$", "banner_stat_protected", ")", "{", "if", "(", "true", "===", "$", "this", "->", "User", "->", "isAdmin", ")", "{", "//DEBUG log_message('Ich bin Admin', 'banner.log');", "re...
Check if User member of group in banner statistik groups @param string DB Field "banner_stat_groups", serialized array @return bool true / false
[ "Check", "if", "User", "member", "of", "group", "in", "banner", "statistik", "groups" ]
train
https://github.com/BugBuster1701/banner/blob/3ffac36837923194ab0ebaf308c0b23a3684b005/classes/BannerStatisticsHelper.php#L493-L524
BugBuster1701/banner
classes/BannerReferrer.php
BannerReferrer.reset
protected function reset() { //NEVER TRUST USER INPUT if (function_exists('filter_var')) // Adjustment for hoster without the filter extension { $this->_http_referrer = isset($_SERVER['HTTP_REFERER']) ? filter_var($_SERVER['HTTP_REFERER'], FILTER_SANITIZE_URL) : self::REFERRER_UNKNOWN ; ...
php
protected function reset() { //NEVER TRUST USER INPUT if (function_exists('filter_var')) // Adjustment for hoster without the filter extension { $this->_http_referrer = isset($_SERVER['HTTP_REFERER']) ? filter_var($_SERVER['HTTP_REFERER'], FILTER_SANITIZE_URL) : self::REFERRER_UNKNOWN ; ...
[ "protected", "function", "reset", "(", ")", "{", "//NEVER TRUST USER INPUT", "if", "(", "function_exists", "(", "'filter_var'", ")", ")", "// Adjustment for hoster without the filter extension", "{", "$", "this", "->", "_http_referrer", "=", "isset", "(", "$", "_SERVE...
Reset all properties
[ "Reset", "all", "properties" ]
train
https://github.com/BugBuster1701/banner/blob/3ffac36837923194ab0ebaf308c0b23a3684b005/classes/BannerReferrer.php#L72-L90
BugBuster1701/banner
classes/BannerReferrer.php
BannerReferrer.vhost
protected function vhost() { if (isset($_SERVER['HTTP_X_FORWARDED_HOST'])) { return preg_replace('/[^A-Za-z0-9\[\]\.:-]/', '', rtrim($_SERVER['HTTP_X_FORWARDED_HOST'],'/')); } $host = rtrim($_SERVER['HTTP_HOST']); if ($host == '') { $host = rtrim($_SERVER['SERVER_NAME']); } $host = preg_repla...
php
protected function vhost() { if (isset($_SERVER['HTTP_X_FORWARDED_HOST'])) { return preg_replace('/[^A-Za-z0-9\[\]\.:-]/', '', rtrim($_SERVER['HTTP_X_FORWARDED_HOST'],'/')); } $host = rtrim($_SERVER['HTTP_HOST']); if ($host == '') { $host = rtrim($_SERVER['SERVER_NAME']); } $host = preg_repla...
[ "protected", "function", "vhost", "(", ")", "{", "if", "(", "isset", "(", "$", "_SERVER", "[", "'HTTP_X_FORWARDED_HOST'", "]", ")", ")", "{", "return", "preg_replace", "(", "'/[^A-Za-z0-9\\[\\]\\.:-]/'", ",", "''", ",", "rtrim", "(", "$", "_SERVER", "[", "...
Return the current URL without path or query string or protocol @return string
[ "Return", "the", "current", "URL", "without", "path", "or", "query", "string", "or", "protocol" ]
train
https://github.com/BugBuster1701/banner/blob/3ffac36837923194ab0ebaf308c0b23a3684b005/classes/BannerReferrer.php#L132-L146
tequila/mongodb-php-lib
src/OptionsResolver/Command/CreateCollectionResolver.php
CreateCollectionResolver.resolve
public function resolve(array $options = []) { $options = parent::resolve($options); if (!isset($options['size']) && isset($options['capped']) && true === $options['capped']) { throw new InvalidArgumentException( 'The option "size" is required for capped collections.' ...
php
public function resolve(array $options = []) { $options = parent::resolve($options); if (!isset($options['size']) && isset($options['capped']) && true === $options['capped']) { throw new InvalidArgumentException( 'The option "size" is required for capped collections.' ...
[ "public", "function", "resolve", "(", "array", "$", "options", "=", "[", "]", ")", "{", "$", "options", "=", "parent", "::", "resolve", "(", "$", "options", ")", ";", "if", "(", "!", "isset", "(", "$", "options", "[", "'size'", "]", ")", "&&", "i...
{@inheritdoc}
[ "{" ]
train
https://github.com/tequila/mongodb-php-lib/blob/49a25f45268df358f5ceb40a655d9a7ddc6db4f7/src/OptionsResolver/Command/CreateCollectionResolver.php#L15-L37
tequila/mongodb-php-lib
src/OptionsResolver/Command/CreateCollectionResolver.php
CreateCollectionResolver.configureOptions
protected function configureOptions() { CollationConfigurator::configure($this); WriteConcernConfigurator::configure($this); $this->setDefined([ 'capped', 'size', 'max', 'flags', 'storageEngine', 'validator', ...
php
protected function configureOptions() { CollationConfigurator::configure($this); WriteConcernConfigurator::configure($this); $this->setDefined([ 'capped', 'size', 'max', 'flags', 'storageEngine', 'validator', ...
[ "protected", "function", "configureOptions", "(", ")", "{", "CollationConfigurator", "::", "configure", "(", "$", "this", ")", ";", "WriteConcernConfigurator", "::", "configure", "(", "$", "this", ")", ";", "$", "this", "->", "setDefined", "(", "[", "'capped'"...
{@inheritdoc}
[ "{" ]
train
https://github.com/tequila/mongodb-php-lib/blob/49a25f45268df358f5ceb40a655d9a7ddc6db4f7/src/OptionsResolver/Command/CreateCollectionResolver.php#L42-L76
gintonicweb/GintonicCMS
src/Controller/Component/SetupComponent.php
SetupComponent.runMigration
public function runMigration($plugin) { $command = new Migrate(); $output = new NullOutput(); $input = new ArrayInput(['--plugin' => $plugin]); $resultCode = $command->run($input, $output); }
php
public function runMigration($plugin) { $command = new Migrate(); $output = new NullOutput(); $input = new ArrayInput(['--plugin' => $plugin]); $resultCode = $command->run($input, $output); }
[ "public", "function", "runMigration", "(", "$", "plugin", ")", "{", "$", "command", "=", "new", "Migrate", "(", ")", ";", "$", "output", "=", "new", "NullOutput", "(", ")", ";", "$", "input", "=", "new", "ArrayInput", "(", "[", "'--plugin'", "=>", "$...
Runs the migrations for a given plugin @param string $plugin Name of the plugin @return void
[ "Runs", "the", "migrations", "for", "a", "given", "plugin" ]
train
https://github.com/gintonicweb/GintonicCMS/blob/b34445fecea56a7d432d0f3e2f988cde8ead746b/src/Controller/Component/SetupComponent.php#L19-L25
gintonicweb/GintonicCMS
src/Controller/Component/SetupComponent.php
SetupComponent.tableExists
public function tableExists($tableName, $connectionName = 'default') { try { $db = ConnectionManager::get($connectionName); $collection = $db->schemaCollection(); $tables = $collection->listTables(); if (in_array($tableName, $tables)) { return ...
php
public function tableExists($tableName, $connectionName = 'default') { try { $db = ConnectionManager::get($connectionName); $collection = $db->schemaCollection(); $tables = $collection->listTables(); if (in_array($tableName, $tables)) { return ...
[ "public", "function", "tableExists", "(", "$", "tableName", ",", "$", "connectionName", "=", "'default'", ")", "{", "try", "{", "$", "db", "=", "ConnectionManager", "::", "get", "(", "$", "connectionName", ")", ";", "$", "collection", "=", "$", "db", "->...
Check whether table is exists in database or not. @param string $tableName Name of the table to check. @param string $connectionName Connection to use @return bool True if table exists, False else.
[ "Check", "whether", "table", "is", "exists", "in", "database", "or", "not", "." ]
train
https://github.com/gintonicweb/GintonicCMS/blob/b34445fecea56a7d432d0f3e2f988cde8ead746b/src/Controller/Component/SetupComponent.php#L34-L47
gintonicweb/GintonicCMS
src/Controller/Component/SetupComponent.php
SetupComponent.databaseConnection
public function databaseConnection($dataSource = 'default') { try { $connection = ConnectionManager::get($dataSource); $connected = $connection->connect(); } catch (MissingConnectionException $connectionError) { $connected = false; } return $connec...
php
public function databaseConnection($dataSource = 'default') { try { $connection = ConnectionManager::get($dataSource); $connected = $connection->connect(); } catch (MissingConnectionException $connectionError) { $connected = false; } return $connec...
[ "public", "function", "databaseConnection", "(", "$", "dataSource", "=", "'default'", ")", "{", "try", "{", "$", "connection", "=", "ConnectionManager", "::", "get", "(", "$", "dataSource", ")", ";", "$", "connected", "=", "$", "connection", "->", "connect",...
Test database connection. @param type $dataSource name of data source. @return bool True if we're able to connect to the database
[ "Test", "database", "connection", "." ]
train
https://github.com/gintonicweb/GintonicCMS/blob/b34445fecea56a7d432d0f3e2f988cde8ead746b/src/Controller/Component/SetupComponent.php#L55-L64
Atlantic18/CoralCoreBundle
Service/Connector/CoralConnector.php
CoralConnector.doRequest
public function doRequest($method, $uri, $data = null) { $method = strtoupper($method); if( $method != Request::GET && $method != Request::POST && $method != Request::DELETE ) { throw new ConnectorException("Invalid method [$method] for...
php
public function doRequest($method, $uri, $data = null) { $method = strtoupper($method); if( $method != Request::GET && $method != Request::POST && $method != Request::DELETE ) { throw new ConnectorException("Invalid method [$method] for...
[ "public", "function", "doRequest", "(", "$", "method", ",", "$", "uri", ",", "$", "data", "=", "null", ")", "{", "$", "method", "=", "strtoupper", "(", "$", "method", ")", ";", "if", "(", "$", "method", "!=", "Request", "::", "GET", "&&", "$", "m...
Create request to CORAL backend @param string $method Method name @param string $uri Service URI @param array $payload Data to be sent @return JsonParser Response
[ "Create", "request", "to", "CORAL", "backend" ]
train
https://github.com/Atlantic18/CoralCoreBundle/blob/7d74ffaf51046ad13cbfc2b0b69d656a499f38ab/Service/Connector/CoralConnector.php#L51-L83
movoin/one-swoole
src/Routing/Provider.php
Provider.register
public function register() { $this->bind('router', function ($server) { $router = new Router; $docs = $server->get('annotation'); foreach ($docs as $class => $doc) { $router->addRoute($doc['methods'], $doc['route'], $class); } uns...
php
public function register() { $this->bind('router', function ($server) { $router = new Router; $docs = $server->get('annotation'); foreach ($docs as $class => $doc) { $router->addRoute($doc['methods'], $doc['route'], $class); } uns...
[ "public", "function", "register", "(", ")", "{", "$", "this", "->", "bind", "(", "'router'", ",", "function", "(", "$", "server", ")", "{", "$", "router", "=", "new", "Router", ";", "$", "docs", "=", "$", "server", "->", "get", "(", "'annotation'", ...
注册服务
[ "注册服务" ]
train
https://github.com/movoin/one-swoole/blob/b9b175963ead91416cc50902a04e05ff3ef571de/src/Routing/Provider.php#L22-L36
stubbles/stubbles-webapp-core
src/main/php/auth/session/CachingAuthorizationProvider.php
CachingAuthorizationProvider.roles
public function roles(User $user) { if ($this->session->hasValue(Roles::SESSION_KEY)) { return $this->session->value(Roles::SESSION_KEY); } $roles = $this->authorizationProvider->roles($user); $this->session->putValue(Roles::SESSION_KEY, $roles); return $roles; ...
php
public function roles(User $user) { if ($this->session->hasValue(Roles::SESSION_KEY)) { return $this->session->value(Roles::SESSION_KEY); } $roles = $this->authorizationProvider->roles($user); $this->session->putValue(Roles::SESSION_KEY, $roles); return $roles; ...
[ "public", "function", "roles", "(", "User", "$", "user", ")", "{", "if", "(", "$", "this", "->", "session", "->", "hasValue", "(", "Roles", "::", "SESSION_KEY", ")", ")", "{", "return", "$", "this", "->", "session", "->", "value", "(", "Roles", "::",...
returns the roles available for this request and user @param \stubbles\webapp\auth\User $user @return \stubbles\webapp\auth\Roles|null
[ "returns", "the", "roles", "available", "for", "this", "request", "and", "user" ]
train
https://github.com/stubbles/stubbles-webapp-core/blob/7705f129011a81d5cc3c76b4b150fab3dadac6a3/src/main/php/auth/session/CachingAuthorizationProvider.php#L55-L64
comelyio/comely
src/Comely/IO/Translator/Translator.php
Translator.translate
public function translate(string $key, ?string $lang = null): ?string { try { // Validate key $key = strtolower($key); if (!preg_match('/^[a-z0-9\.\-\_]+$/', $key)) { throw new TranslatorException('Invalid translation key'); } // G...
php
public function translate(string $key, ?string $lang = null): ?string { try { // Validate key $key = strtolower($key); if (!preg_match('/^[a-z0-9\.\-\_]+$/', $key)) { throw new TranslatorException('Invalid translation key'); } // G...
[ "public", "function", "translate", "(", "string", "$", "key", ",", "?", "string", "$", "lang", "=", "null", ")", ":", "?", "string", "{", "try", "{", "// Validate key", "$", "key", "=", "strtolower", "(", "$", "key", ")", ";", "if", "(", "!", "preg...
Return string translation or NULL (if translation is not found) On failure to read/compile language files, an E_USER_WARNING will be triggered and NULL returned @param string $key @param null|string $lang @return null|string
[ "Return", "string", "translation", "or", "NULL", "(", "if", "translation", "is", "not", "found", ")", "On", "failure", "to", "read", "/", "compile", "language", "files", "an", "E_USER_WARNING", "will", "be", "triggered", "and", "NULL", "returned" ]
train
https://github.com/comelyio/comely/blob/561ea7aef36fea347a1a79d3ee5597d4057ddf82/src/Comely/IO/Translator/Translator.php#L230-L265
gintonicweb/requirejs
src/View/Helper/RequireHelper.php
RequireHelper.load
public function load(array $configFiles = []) { $this->config('configFiles', $configFiles); $inlineConfig = $this->_getInlineConfig(); $loader = $this->_getLoader(); $modules = $this->_getModules(); $this->_requireLoaded = true; return $inlineConfig . $loader . $modul...
php
public function load(array $configFiles = []) { $this->config('configFiles', $configFiles); $inlineConfig = $this->_getInlineConfig(); $loader = $this->_getLoader(); $modules = $this->_getModules(); $this->_requireLoaded = true; return $inlineConfig . $loader . $modul...
[ "public", "function", "load", "(", "array", "$", "configFiles", "=", "[", "]", ")", "{", "$", "this", "->", "config", "(", "'configFiles'", ",", "$", "configFiles", ")", ";", "$", "inlineConfig", "=", "$", "this", "->", "_getInlineConfig", "(", ")", ";...
Fetch all previously loaded modules and requirejs lib path and outputs the `<script>` tag to initialize the loader. Parameters accept the plugin notation so it's possible to load the files like this $this->Require->load('Requirejs.require', 'TwbsTheme.main'); @param array $configFiles additional config files to load ...
[ "Fetch", "all", "previously", "loaded", "modules", "and", "requirejs", "lib", "path", "and", "outputs", "the", "<script", ">", "tag", "to", "initialize", "the", "loader", "." ]
train
https://github.com/gintonicweb/requirejs/blob/befcd9f2e2f4b0f321e9af5b2ad3f37991d2a9e2/src/View/Helper/RequireHelper.php#L61-L69
gintonicweb/requirejs
src/View/Helper/RequireHelper.php
RequireHelper._getAppBase
protected function _getAppBase() { $baseUrl = Configure::read('App.base'); if (!$baseUrl) { $request = Router::getRequest(true); if (!$request) { $baseUrl = ''; } else { $baseUrl = $request->base; } } ret...
php
protected function _getAppBase() { $baseUrl = Configure::read('App.base'); if (!$baseUrl) { $request = Router::getRequest(true); if (!$request) { $baseUrl = ''; } else { $baseUrl = $request->base; } } ret...
[ "protected", "function", "_getAppBase", "(", ")", "{", "$", "baseUrl", "=", "Configure", "::", "read", "(", "'App.base'", ")", ";", "if", "(", "!", "$", "baseUrl", ")", "{", "$", "request", "=", "Router", "::", "getRequest", "(", "true", ")", ";", "i...
Return the content of CakePHP App.base. If the App.base value is false, it returns the generated URL automatically by mimicking how CakePHP add the base to its URL. @return string the application base directory
[ "Return", "the", "content", "of", "CakePHP", "App", ".", "base", ".", "If", "the", "App", ".", "base", "value", "is", "false", "it", "returns", "the", "generated", "URL", "automatically", "by", "mimicking", "how", "CakePHP", "add", "the", "base", "to", "...
train
https://github.com/gintonicweb/requirejs/blob/befcd9f2e2f4b0f321e9af5b2ad3f37991d2a9e2/src/View/Helper/RequireHelper.php#L78-L90
gintonicweb/requirejs
src/View/Helper/RequireHelper.php
RequireHelper._getInlineConfig
protected function _getInlineConfig() { $script = "var require = "; $script .= json_encode($this->config('inlineConfig'), JSON_UNESCAPED_SLASHES); return $this->Html->scriptBlock($script); }
php
protected function _getInlineConfig() { $script = "var require = "; $script .= json_encode($this->config('inlineConfig'), JSON_UNESCAPED_SLASHES); return $this->Html->scriptBlock($script); }
[ "protected", "function", "_getInlineConfig", "(", ")", "{", "$", "script", "=", "\"var require = \"", ";", "$", "script", ".=", "json_encode", "(", "$", "this", "->", "config", "(", "'inlineConfig'", ")", ",", "JSON_UNESCAPED_SLASHES", ")", ";", "return", "$",...
Return a `<script>` block that initializes the requirejs main configuration file and loads all modules that have been loaded. Note that the requirejs library must be loaded before this block @return string content of the `<script>` tag that initialize requirejs
[ "Return", "a", "<script", ">", "block", "that", "initializes", "the", "requirejs", "main", "configuration", "file", "and", "loads", "all", "modules", "that", "have", "been", "loaded", "." ]
train
https://github.com/gintonicweb/requirejs/blob/befcd9f2e2f4b0f321e9af5b2ad3f37991d2a9e2/src/View/Helper/RequireHelper.php#L100-L105
gintonicweb/requirejs
src/View/Helper/RequireHelper.php
RequireHelper._getModules
protected function _getModules() { $modules = implode(',', $this->_modules); $configFiles = $this->config('configFiles'); foreach ($configFiles as $key => $config) { $config = $this->Url->assetUrl($config, [ 'pathPrefix' => Configure::read('App.jsBaseUrl'), ...
php
protected function _getModules() { $modules = implode(',', $this->_modules); $configFiles = $this->config('configFiles'); foreach ($configFiles as $key => $config) { $config = $this->Url->assetUrl($config, [ 'pathPrefix' => Configure::read('App.jsBaseUrl'), ...
[ "protected", "function", "_getModules", "(", ")", "{", "$", "modules", "=", "implode", "(", "','", ",", "$", "this", "->", "_modules", ")", ";", "$", "configFiles", "=", "$", "this", "->", "config", "(", "'configFiles'", ")", ";", "foreach", "(", "$", ...
Return a `<script>` block that initializes the requirejs main configuration file and loads all modules that have been loaded. Note that the requirejs library must be loaded before this block @return string content of the `<script>` tag that initialize requirejs
[ "Return", "a", "<script", ">", "block", "that", "initializes", "the", "requirejs", "main", "configuration", "file", "and", "loads", "all", "modules", "that", "have", "been", "loaded", "." ]
train
https://github.com/gintonicweb/requirejs/blob/befcd9f2e2f4b0f321e9af5b2ad3f37991d2a9e2/src/View/Helper/RequireHelper.php#L115-L135
gintonicweb/requirejs
src/View/Helper/RequireHelper.php
RequireHelper.module
public function module($name) { list($plugin, $path) = $this->_View->pluginSplit($name, false); if (!empty($plugin)) { $name = $this->Url->assetUrl($name, [ 'pathPrefix' => Configure::read('App.jsBaseUrl'), 'ext' => '.js', ]); } ...
php
public function module($name) { list($plugin, $path) = $this->_View->pluginSplit($name, false); if (!empty($plugin)) { $name = $this->Url->assetUrl($name, [ 'pathPrefix' => Configure::read('App.jsBaseUrl'), 'ext' => '.js', ]); } ...
[ "public", "function", "module", "(", "$", "name", ")", "{", "list", "(", "$", "plugin", ",", "$", "path", ")", "=", "$", "this", "->", "_View", "->", "pluginSplit", "(", "$", "name", ",", "false", ")", ";", "if", "(", "!", "empty", "(", "$", "p...
Add a javascript module to be loaded on the page. Every module that is called prior to the load() command should be pre-loaded and will be outputted along with the loader. Every module that comes after the loader, for example via ajax, should be loaded right away by setting the "preLoad" option to false @param strin...
[ "Add", "a", "javascript", "module", "to", "be", "loaded", "on", "the", "page", "." ]
train
https://github.com/gintonicweb/requirejs/blob/befcd9f2e2f4b0f321e9af5b2ad3f37991d2a9e2/src/View/Helper/RequireHelper.php#L159-L172
aboutcoders/enum-serializer-bundle
DependencyInjection/AbcEnumSerializerExtension.php
AbcEnumSerializerExtension.load
public function load(array $configs, ContainerBuilder $container) { $configuration = new Configuration(); $config = $this->processConfiguration($configuration, $configs); $loader = new XmlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config')); if (isset($c...
php
public function load(array $configs, ContainerBuilder $container) { $configuration = new Configuration(); $config = $this->processConfiguration($configuration, $configs); $loader = new XmlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config')); if (isset($c...
[ "public", "function", "load", "(", "array", "$", "configs", ",", "ContainerBuilder", "$", "container", ")", "{", "$", "configuration", "=", "new", "Configuration", "(", ")", ";", "$", "config", "=", "$", "this", "->", "processConfiguration", "(", "$", "con...
{@inheritDoc}
[ "{" ]
train
https://github.com/aboutcoders/enum-serializer-bundle/blob/e8a48e8d6d52b2f8fc896e9789fbb9fbbc38164f/DependencyInjection/AbcEnumSerializerExtension.php#L27-L46
Eye4web/E4WZfcUserRedirectUrl
src/E4W/ZfcUser/RedirectUrl/Factory/Options/ModuleOptionsFactory.php
ModuleOptionsFactory.createService
public function createService(ServiceLocatorInterface $serviceLocator) { $config = $serviceLocator->get('Config'); $service = new ModuleOptions($config['e4wzfcuserredirecturl']); return $service; }
php
public function createService(ServiceLocatorInterface $serviceLocator) { $config = $serviceLocator->get('Config'); $service = new ModuleOptions($config['e4wzfcuserredirecturl']); return $service; }
[ "public", "function", "createService", "(", "ServiceLocatorInterface", "$", "serviceLocator", ")", "{", "$", "config", "=", "$", "serviceLocator", "->", "get", "(", "'Config'", ")", ";", "$", "service", "=", "new", "ModuleOptions", "(", "$", "config", "[", "...
Create options @param ServiceLocatorInterface $serviceLocator @return SocialService
[ "Create", "options" ]
train
https://github.com/Eye4web/E4WZfcUserRedirectUrl/blob/e757f4a127b9c48a4e14fbaf4fc0bf271735874e/src/E4W/ZfcUser/RedirectUrl/Factory/Options/ModuleOptionsFactory.php#L17-L23
yosmanyga/resource
src/Yosmanyga/Resource/Reader/Iterator/IniFileReader.php
IniFileReader.supports
public function supports(Resource $resource) { if ($resource->hasType()) { if ('ini' == $resource->getType()) { return true; } return false; } if ($resource->hasMetadata('file') && in_array(pathinfo($resource->getMetadata('file'), PATHINF...
php
public function supports(Resource $resource) { if ($resource->hasType()) { if ('ini' == $resource->getType()) { return true; } return false; } if ($resource->hasMetadata('file') && in_array(pathinfo($resource->getMetadata('file'), PATHINF...
[ "public", "function", "supports", "(", "Resource", "$", "resource", ")", "{", "if", "(", "$", "resource", "->", "hasType", "(", ")", ")", "{", "if", "(", "'ini'", "==", "$", "resource", "->", "getType", "(", ")", ")", "{", "return", "true", ";", "}...
{@inheritdoc}
[ "{" ]
train
https://github.com/yosmanyga/resource/blob/a8b505c355920a908917a0484f764ddfa63205fa/src/Yosmanyga/Resource/Reader/Iterator/IniFileReader.php#L17-L32
yosmanyga/resource
src/Yosmanyga/Resource/Reader/Iterator/IniFileReader.php
IniFileReader.open
public function open(Resource $resource) { $file = $resource->getMetadata('file'); if (!is_file($file)) { throw new \InvalidArgumentException(sprintf('File "%s" not found.', $file)); } try { $data = parse_ini_file($file, true); } catch (\Exception $e...
php
public function open(Resource $resource) { $file = $resource->getMetadata('file'); if (!is_file($file)) { throw new \InvalidArgumentException(sprintf('File "%s" not found.', $file)); } try { $data = parse_ini_file($file, true); } catch (\Exception $e...
[ "public", "function", "open", "(", "Resource", "$", "resource", ")", "{", "$", "file", "=", "$", "resource", "->", "getMetadata", "(", "'file'", ")", ";", "if", "(", "!", "is_file", "(", "$", "file", ")", ")", "{", "throw", "new", "\\", "InvalidArgum...
{@inheritdoc}
[ "{" ]
train
https://github.com/yosmanyga/resource/blob/a8b505c355920a908917a0484f764ddfa63205fa/src/Yosmanyga/Resource/Reader/Iterator/IniFileReader.php#L37-L53
yosmanyga/resource
src/Yosmanyga/Resource/Reader/Iterator/IniFileReader.php
IniFileReader.close
public function close() { if (!isset($this->inMemoryReader)) { throw new \RuntimeException('The resource needs to be open.'); } $this->inMemoryReader->close(); unset($this->inMemoryReader); }
php
public function close() { if (!isset($this->inMemoryReader)) { throw new \RuntimeException('The resource needs to be open.'); } $this->inMemoryReader->close(); unset($this->inMemoryReader); }
[ "public", "function", "close", "(", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "inMemoryReader", ")", ")", "{", "throw", "new", "\\", "RuntimeException", "(", "'The resource needs to be open.'", ")", ";", "}", "$", "this", "->", "inMemoryRe...
{@inheritdoc}
[ "{" ]
train
https://github.com/yosmanyga/resource/blob/a8b505c355920a908917a0484f764ddfa63205fa/src/Yosmanyga/Resource/Reader/Iterator/IniFileReader.php#L82-L90
braincrafted/arrayquery
src/Braincrafted/ArrayQuery/WhereEvaluation.php
WhereEvaluation.evaluate
public function evaluate(array $item, array $clause) { if (false === isset($clause['key']) || false === isset($clause['value']) || false === isset($clause['operator']) ) { throw new \InvalidArgumentException('Clause must contain "key", "value" and operator.'); ...
php
public function evaluate(array $item, array $clause) { if (false === isset($clause['key']) || false === isset($clause['value']) || false === isset($clause['operator']) ) { throw new \InvalidArgumentException('Clause must contain "key", "value" and operator.'); ...
[ "public", "function", "evaluate", "(", "array", "$", "item", ",", "array", "$", "clause", ")", "{", "if", "(", "false", "===", "isset", "(", "$", "clause", "[", "'key'", "]", ")", "||", "false", "===", "isset", "(", "$", "clause", "[", "'value'", "...
Evaluates the given item with the given clause. @param array $item The item to evaluate. @param array $clause The clause to evaluate the item with. Has to contain `key`, `value` and `operator` and can optionally also contain `filters`. `filters` can be either a string or an array. @return boolean `true` if the item...
[ "Evaluates", "the", "given", "item", "with", "the", "given", "clause", "." ]
train
https://github.com/braincrafted/arrayquery/blob/8b0c44ee76cea796589422f52e2f7130676b9bd1/src/Braincrafted/ArrayQuery/WhereEvaluation.php#L77-L98
braincrafted/arrayquery
src/Braincrafted/ArrayQuery/WhereEvaluation.php
WhereEvaluation.evaluateFilters
protected function evaluateFilters($value, array $clause) { if (true === isset($clause['filters'])) { if (false === is_array($clause['filters'])) { $clause['filters'] = [ $clause['filters'] ]; } foreach ($clause['filters'] as $filter) { $va...
php
protected function evaluateFilters($value, array $clause) { if (true === isset($clause['filters'])) { if (false === is_array($clause['filters'])) { $clause['filters'] = [ $clause['filters'] ]; } foreach ($clause['filters'] as $filter) { $va...
[ "protected", "function", "evaluateFilters", "(", "$", "value", ",", "array", "$", "clause", ")", "{", "if", "(", "true", "===", "isset", "(", "$", "clause", "[", "'filters'", "]", ")", ")", "{", "if", "(", "false", "===", "is_array", "(", "$", "claus...
Evaluates the given value with the given clause. @param mixed $value The value to evaluate. @param array $clause The clause to evaluate the item with. @return mixed The evaluated value. @throws Braincrafted\ArrayQuery\Exception\UnkownFilterException if the given filter does not exist. @see evaluate()
[ "Evaluates", "the", "given", "value", "with", "the", "given", "clause", "." ]
train
https://github.com/braincrafted/arrayquery/blob/8b0c44ee76cea796589422f52e2f7130676b9bd1/src/Braincrafted/ArrayQuery/WhereEvaluation.php#L112-L124
vardius/list-bundle
Column/Column.php
Column.getData
public function getData($entity, string $responseType = 'html') { $data = $this->type->getData($entity, $this->options); if ($responseType === 'html') { return $this->templating->render( $this->options['view'], $data, $this->options ...
php
public function getData($entity, string $responseType = 'html') { $data = $this->type->getData($entity, $this->options); if ($responseType === 'html') { return $this->templating->render( $this->options['view'], $data, $this->options ...
[ "public", "function", "getData", "(", "$", "entity", ",", "string", "$", "responseType", "=", "'html'", ")", "{", "$", "data", "=", "$", "this", "->", "type", "->", "getData", "(", "$", "entity", ",", "$", "this", "->", "options", ")", ";", "if", "...
{@inheritdoc}
[ "{" ]
train
https://github.com/vardius/list-bundle/blob/70d3079ce22eed7dad7c467fee532aa2f18c68c9/Column/Column.php#L51-L63
vespolina/VespolinaCommerceBundle
Controller/Product/ProductAdminController.php
ProductController.listAction
public function listAction() { $products = $this->container->get('vespolina.product_manager')->findBy(array()); return $this->container->get('templating')->renderResponse('VespolinaCommerceBundle:Product:list.html.'.$this->getEngine(), array('products' => $products)); }
php
public function listAction() { $products = $this->container->get('vespolina.product_manager')->findBy(array()); return $this->container->get('templating')->renderResponse('VespolinaCommerceBundle:Product:list.html.'.$this->getEngine(), array('products' => $products)); }
[ "public", "function", "listAction", "(", ")", "{", "$", "products", "=", "$", "this", "->", "container", "->", "get", "(", "'vespolina.product_manager'", ")", "->", "findBy", "(", "array", "(", ")", ")", ";", "return", "$", "this", "->", "container", "->...
Show all products
[ "Show", "all", "products" ]
train
https://github.com/vespolina/VespolinaCommerceBundle/blob/0644dd2c0fb39637a0a6c2838b02e17bc480bdbc/Controller/Product/ProductAdminController.php#L28-L33
vespolina/VespolinaCommerceBundle
Controller/Product/ProductAdminController.php
ProductController.detailAction
public function detailAction($id) { $product = $this->container->get('vespolina.product_manager')->findProductById($id); if (!$product) { throw new NotFoundHttpException('The product does not exist!'); } return $this->container->get('templating')->renderResponse('Vespol...
php
public function detailAction($id) { $product = $this->container->get('vespolina.product_manager')->findProductById($id); if (!$product) { throw new NotFoundHttpException('The product does not exist!'); } return $this->container->get('templating')->renderResponse('Vespol...
[ "public", "function", "detailAction", "(", "$", "id", ")", "{", "$", "product", "=", "$", "this", "->", "container", "->", "get", "(", "'vespolina.product_manager'", ")", "->", "findProductById", "(", "$", "id", ")", ";", "if", "(", "!", "$", "product", ...
Show one product by object id
[ "Show", "one", "product", "by", "object", "id" ]
train
https://github.com/vespolina/VespolinaCommerceBundle/blob/0644dd2c0fb39637a0a6c2838b02e17bc480bdbc/Controller/Product/ProductAdminController.php#L38-L47
vespolina/VespolinaCommerceBundle
Controller/Product/ProductAdminController.php
ProductController.editAction
public function editAction($id) { $product = $this->container->get('vespolina.product_manager')->findProductById($id); if (!$product) { throw new NotFoundHttpException('The product does not exist!'); } $formHandler = $this->container->get('vespolina.product.form.handler...
php
public function editAction($id) { $product = $this->container->get('vespolina.product_manager')->findProductById($id); if (!$product) { throw new NotFoundHttpException('The product does not exist!'); } $formHandler = $this->container->get('vespolina.product.form.handler...
[ "public", "function", "editAction", "(", "$", "id", ")", "{", "$", "product", "=", "$", "this", "->", "container", "->", "get", "(", "'vespolina.product_manager'", ")", "->", "findProductById", "(", "$", "id", ")", ";", "if", "(", "!", "$", "product", ...
Edit one product, show the edit form
[ "Edit", "one", "product", "show", "the", "edit", "form" ]
train
https://github.com/vespolina/VespolinaCommerceBundle/blob/0644dd2c0fb39637a0a6c2838b02e17bc480bdbc/Controller/Product/ProductAdminController.php#L52-L78
vespolina/VespolinaCommerceBundle
Controller/Product/ProductAdminController.php
ProductController.deleteAction
public function deleteAction($id) { $product = $this->container->get('vespolina.product_manager')->findProductById($id); if (!$product) { throw new NotFoundHttpException('The product does not exist!'); } $dm = $this->container->get('doctrine.odm.mongodb.document_manager...
php
public function deleteAction($id) { $product = $this->container->get('vespolina.product_manager')->findProductById($id); if (!$product) { throw new NotFoundHttpException('The product does not exist!'); } $dm = $this->container->get('doctrine.odm.mongodb.document_manager...
[ "public", "function", "deleteAction", "(", "$", "id", ")", "{", "$", "product", "=", "$", "this", "->", "container", "->", "get", "(", "'vespolina.product_manager'", ")", "->", "findProductById", "(", "$", "id", ")", ";", "if", "(", "!", "$", "product", ...
Delete one product, then show list
[ "Delete", "one", "product", "then", "show", "list" ]
train
https://github.com/vespolina/VespolinaCommerceBundle/blob/0644dd2c0fb39637a0a6c2838b02e17bc480bdbc/Controller/Product/ProductAdminController.php#L83-L98
vespolina/VespolinaCommerceBundle
Controller/Product/ProductAdminController.php
ProductController.newAction
public function newAction() { $form = $this->container->get('vespolina.product.form'); return $this->container->get('templating')->renderResponse('VespolinaCommerceBundle:Product:new.html.'.$this->getEngine(), array( 'form' => $form->createView(), 'configur...
php
public function newAction() { $form = $this->container->get('vespolina.product.form'); return $this->container->get('templating')->renderResponse('VespolinaCommerceBundle:Product:new.html.'.$this->getEngine(), array( 'form' => $form->createView(), 'configur...
[ "public", "function", "newAction", "(", ")", "{", "$", "form", "=", "$", "this", "->", "container", "->", "get", "(", "'vespolina.product.form'", ")", ";", "return", "$", "this", "->", "container", "->", "get", "(", "'templating'", ")", "->", "renderRespon...
Show the new form
[ "Show", "the", "new", "form" ]
train
https://github.com/vespolina/VespolinaCommerceBundle/blob/0644dd2c0fb39637a0a6c2838b02e17bc480bdbc/Controller/Product/ProductAdminController.php#L103-L112
vespolina/VespolinaCommerceBundle
Controller/Product/ProductAdminController.php
ProductController.createAction
public function createAction() { $form = $this->container->get('vespolina.product.form'); $formHandler = $this->container->get('vespolina.product.form.handler'); $process = $formHandler->process(); if ($process) { $user = $form->getData(); $this->setFlash('v...
php
public function createAction() { $form = $this->container->get('vespolina.product.form'); $formHandler = $this->container->get('vespolina.product.form.handler'); $process = $formHandler->process(); if ($process) { $user = $form->getData(); $this->setFlash('v...
[ "public", "function", "createAction", "(", ")", "{", "$", "form", "=", "$", "this", "->", "container", "->", "get", "(", "'vespolina.product.form'", ")", ";", "$", "formHandler", "=", "$", "this", "->", "container", "->", "get", "(", "'vespolina.product.form...
Create a product
[ "Create", "a", "product" ]
train
https://github.com/vespolina/VespolinaCommerceBundle/blob/0644dd2c0fb39637a0a6c2838b02e17bc480bdbc/Controller/Product/ProductAdminController.php#L117-L135
DevGroup-ru/yii2-intent-analytics
src/IntentAnalyticsModule.php
IntentAnalyticsModule.bootstrap
public function bootstrap($app) { $this->buildModelMap(); $app->on(Application::EVENT_AFTER_REQUEST, function () { $this->process(); }); }
php
public function bootstrap($app) { $this->buildModelMap(); $app->on(Application::EVENT_AFTER_REQUEST, function () { $this->process(); }); }
[ "public", "function", "bootstrap", "(", "$", "app", ")", "{", "$", "this", "->", "buildModelMap", "(", ")", ";", "$", "app", "->", "on", "(", "Application", "::", "EVENT_AFTER_REQUEST", ",", "function", "(", ")", "{", "$", "this", "->", "process", "(",...
Bootstrap method to be called during application bootstrap stage. @param Application $app the application currently running
[ "Bootstrap", "method", "to", "be", "called", "during", "application", "bootstrap", "stage", "." ]
train
https://github.com/DevGroup-ru/yii2-intent-analytics/blob/53937d44df8c73dca402cc7351b018e6758c3af6/src/IntentAnalyticsModule.php#L131-L137
DevGroup-ru/yii2-intent-analytics
src/IntentAnalyticsModule.php
IntentAnalyticsModule.buildModelMap
private function buildModelMap() { $this->modelMap = ArrayHelper::merge($this->defaultModelMap, $this->modelMap); foreach ($this->modelMap as $modelName => $configuration) { Yii::$container->set($configuration['class'], $configuration); } }
php
private function buildModelMap() { $this->modelMap = ArrayHelper::merge($this->defaultModelMap, $this->modelMap); foreach ($this->modelMap as $modelName => $configuration) { Yii::$container->set($configuration['class'], $configuration); } }
[ "private", "function", "buildModelMap", "(", ")", "{", "$", "this", "->", "modelMap", "=", "ArrayHelper", "::", "merge", "(", "$", "this", "->", "defaultModelMap", ",", "$", "this", "->", "modelMap", ")", ";", "foreach", "(", "$", "this", "->", "modelMap...
Builds model map, setups di container
[ "Builds", "model", "map", "setups", "di", "container" ]
train
https://github.com/DevGroup-ru/yii2-intent-analytics/blob/53937d44df8c73dca402cc7351b018e6758c3af6/src/IntentAnalyticsModule.php#L142-L148
DevGroup-ru/yii2-intent-analytics
src/IntentAnalyticsModule.php
IntentAnalyticsModule.createVisitor
private function createVisitor() { $this->visitor = Yii::$container->get($this->modelMap['Visitor']['class']); $this->visitor->save(); return $this->visitor; }
php
private function createVisitor() { $this->visitor = Yii::$container->get($this->modelMap['Visitor']['class']); $this->visitor->save(); return $this->visitor; }
[ "private", "function", "createVisitor", "(", ")", "{", "$", "this", "->", "visitor", "=", "Yii", "::", "$", "container", "->", "get", "(", "$", "this", "->", "modelMap", "[", "'Visitor'", "]", "[", "'class'", "]", ")", ";", "$", "this", "->", "visito...
Create Visitor record @return Visitor @throws \yii\base\InvalidConfigException
[ "Create", "Visitor", "record" ]
train
https://github.com/DevGroup-ru/yii2-intent-analytics/blob/53937d44df8c73dca402cc7351b018e6758c3af6/src/IntentAnalyticsModule.php#L156-L161
DevGroup-ru/yii2-intent-analytics
src/IntentAnalyticsModule.php
IntentAnalyticsModule.saveVisitor
private function saveVisitor() { Yii::$app->session->set($this->visitorCookieName, $this->visitor->getPrimaryKey()); if (!Yii::$app->request->cookies->has($this->visitorCookieName)) { $this->setVisitorCookie(); return; } $cookie = Yii::$app->request->cookies...
php
private function saveVisitor() { Yii::$app->session->set($this->visitorCookieName, $this->visitor->getPrimaryKey()); if (!Yii::$app->request->cookies->has($this->visitorCookieName)) { $this->setVisitorCookie(); return; } $cookie = Yii::$app->request->cookies...
[ "private", "function", "saveVisitor", "(", ")", "{", "Yii", "::", "$", "app", "->", "session", "->", "set", "(", "$", "this", "->", "visitorCookieName", ",", "$", "this", "->", "visitor", "->", "getPrimaryKey", "(", ")", ")", ";", "if", "(", "!", "Yi...
Store visitor_id in session and if require in cookie
[ "Store", "visitor_id", "in", "session", "and", "if", "require", "in", "cookie" ]
train
https://github.com/DevGroup-ru/yii2-intent-analytics/blob/53937d44df8c73dca402cc7351b018e6758c3af6/src/IntentAnalyticsModule.php#L166-L179
DevGroup-ru/yii2-intent-analytics
src/IntentAnalyticsModule.php
IntentAnalyticsModule.setVisitorCookie
private function setVisitorCookie() { Yii::$app->response->cookies->add(new Cookie([ 'name' => $this->visitorCookieName, 'value' => $this->visitor->getPrimaryKey(), 'expire' => time() + $this->visitorCookieTime, ])); }
php
private function setVisitorCookie() { Yii::$app->response->cookies->add(new Cookie([ 'name' => $this->visitorCookieName, 'value' => $this->visitor->getPrimaryKey(), 'expire' => time() + $this->visitorCookieTime, ])); }
[ "private", "function", "setVisitorCookie", "(", ")", "{", "Yii", "::", "$", "app", "->", "response", "->", "cookies", "->", "add", "(", "new", "Cookie", "(", "[", "'name'", "=>", "$", "this", "->", "visitorCookieName", ",", "'value'", "=>", "$", "this", ...
Add visitor cookie
[ "Add", "visitor", "cookie" ]
train
https://github.com/DevGroup-ru/yii2-intent-analytics/blob/53937d44df8c73dca402cc7351b018e6758c3af6/src/IntentAnalyticsModule.php#L184-L191
DevGroup-ru/yii2-intent-analytics
src/IntentAnalyticsModule.php
IntentAnalyticsModule.hasVisitor
public function hasVisitor($visitor_id) { if ($this->visitor !== null) { return true; } /** * @var Visitor $model */ $model = Yii::$container->get($this->modelMap['Visitor']['class']); $this->visitor = $model->find() ->where(['id' => ...
php
public function hasVisitor($visitor_id) { if ($this->visitor !== null) { return true; } /** * @var Visitor $model */ $model = Yii::$container->get($this->modelMap['Visitor']['class']); $this->visitor = $model->find() ->where(['id' => ...
[ "public", "function", "hasVisitor", "(", "$", "visitor_id", ")", "{", "if", "(", "$", "this", "->", "visitor", "!==", "null", ")", "{", "return", "true", ";", "}", "/**\n * @var Visitor $model\n */", "$", "model", "=", "Yii", "::", "$", "cont...
Check if visitor exists @param int $visitor_id @return bool @throws \yii\base\InvalidConfigException
[ "Check", "if", "visitor", "exists" ]
train
https://github.com/DevGroup-ru/yii2-intent-analytics/blob/53937d44df8c73dca402cc7351b018e6758c3af6/src/IntentAnalyticsModule.php#L200-L213
DevGroup-ru/yii2-intent-analytics
src/IntentAnalyticsModule.php
IntentAnalyticsModule.getVisitor
public function getVisitor() { if ($this->visitor !== null) { return $this->visitor; } if (Yii::$app->session->has($this->visitorCookieName)) { $visitor_id = Yii::$app->session->get($this->visitorCookieName); } elseif (Yii::$app->request->cookies->has($this->...
php
public function getVisitor() { if ($this->visitor !== null) { return $this->visitor; } if (Yii::$app->session->has($this->visitorCookieName)) { $visitor_id = Yii::$app->session->get($this->visitorCookieName); } elseif (Yii::$app->request->cookies->has($this->...
[ "public", "function", "getVisitor", "(", ")", "{", "if", "(", "$", "this", "->", "visitor", "!==", "null", ")", "{", "return", "$", "this", "->", "visitor", ";", "}", "if", "(", "Yii", "::", "$", "app", "->", "session", "->", "has", "(", "$", "th...
Return current Visitor @return Visitor
[ "Return", "current", "Visitor" ]
train
https://github.com/DevGroup-ru/yii2-intent-analytics/blob/53937d44df8c73dca402cc7351b018e6758c3af6/src/IntentAnalyticsModule.php#L220-L236
DevGroup-ru/yii2-intent-analytics
src/IntentAnalyticsModule.php
IntentAnalyticsModule.process
public function process() { $this->getVisitor(); $this->saveVisitor(); if (!$this->visitor->hasUserId() && !Yii::$app->user->isGuest) { $this->visitor->setUserId(Yii::$app->user->identity->getId()); } if ($this->detectFirstVisitSource) { } if (...
php
public function process() { $this->getVisitor(); $this->saveVisitor(); if (!$this->visitor->hasUserId() && !Yii::$app->user->isGuest) { $this->visitor->setUserId(Yii::$app->user->identity->getId()); } if ($this->detectFirstVisitSource) { } if (...
[ "public", "function", "process", "(", ")", "{", "$", "this", "->", "getVisitor", "(", ")", ";", "$", "this", "->", "saveVisitor", "(", ")", ";", "if", "(", "!", "$", "this", "->", "visitor", "->", "hasUserId", "(", ")", "&&", "!", "Yii", "::", "$...
Fills $this->visitor
[ "Fills", "$this", "-", ">", "visitor" ]
train
https://github.com/DevGroup-ru/yii2-intent-analytics/blob/53937d44df8c73dca402cc7351b018e6758c3af6/src/IntentAnalyticsModule.php#L241-L265
movoin/one-swoole
src/Validation/Validators/RequiredValidator.php
RequiredValidator.validate
protected function validate(array $attributes, string $name, array $parameters): bool { if (isset($attributes[$name]) && ! empty($attributes[$name])) { return true; } $this->addError($name, $parameters, '%s 必须填写'); return false; }
php
protected function validate(array $attributes, string $name, array $parameters): bool { if (isset($attributes[$name]) && ! empty($attributes[$name])) { return true; } $this->addError($name, $parameters, '%s 必须填写'); return false; }
[ "protected", "function", "validate", "(", "array", "$", "attributes", ",", "string", "$", "name", ",", "array", "$", "parameters", ")", ":", "bool", "{", "if", "(", "isset", "(", "$", "attributes", "[", "$", "name", "]", ")", "&&", "!", "empty", "(",...
校验规则 @param array $attributes @param string $name @param array $parameters @return bool
[ "校验规则" ]
train
https://github.com/movoin/one-swoole/blob/b9b175963ead91416cc50902a04e05ff3ef571de/src/Validation/Validators/RequiredValidator.php#L33-L42
avoo/SerializerTranslation
Configuration/Metadata/Driver/YamlDriver.php
YamlDriver.loadMetadataFromFile
protected function loadMetadataFromFile(\ReflectionClass $class, $file) { $config = Yaml::parse(file_get_contents($file)); if (!isset($config[$name = $class->getName()])) { throw new \RuntimeException(sprintf('Expected metadata for class %s to be defined in %s.', $name, $file)); ...
php
protected function loadMetadataFromFile(\ReflectionClass $class, $file) { $config = Yaml::parse(file_get_contents($file)); if (!isset($config[$name = $class->getName()])) { throw new \RuntimeException(sprintf('Expected metadata for class %s to be defined in %s.', $name, $file)); ...
[ "protected", "function", "loadMetadataFromFile", "(", "\\", "ReflectionClass", "$", "class", ",", "$", "file", ")", "{", "$", "config", "=", "Yaml", "::", "parse", "(", "file_get_contents", "(", "$", "file", ")", ")", ";", "if", "(", "!", "isset", "(", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/avoo/SerializerTranslation/blob/e66de5482adb944197a36874465ef144b293a157/Configuration/Metadata/Driver/YamlDriver.php#L44-L70
czim/laravel-pxlcms
src/Models/Scopes/CmsOrdered.php
CmsOrdered.getQualifiedOrderByColumns
public function getQualifiedOrderByColumns() { $columns = $this->cmsOrderBy; $qualified = []; if (empty($columns)) return []; foreach ($columns as $column => $direction) { $qualified[ $this->getTable() . '.' . $column ] = $direction; } return $qualifi...
php
public function getQualifiedOrderByColumns() { $columns = $this->cmsOrderBy; $qualified = []; if (empty($columns)) return []; foreach ($columns as $column => $direction) { $qualified[ $this->getTable() . '.' . $column ] = $direction; } return $qualifi...
[ "public", "function", "getQualifiedOrderByColumns", "(", ")", "{", "$", "columns", "=", "$", "this", "->", "cmsOrderBy", ";", "$", "qualified", "=", "[", "]", ";", "if", "(", "empty", "(", "$", "columns", ")", ")", "return", "[", "]", ";", "foreach", ...
Get the fully qualified column name for applying the scope @return string
[ "Get", "the", "fully", "qualified", "column", "name", "for", "applying", "the", "scope" ]
train
https://github.com/czim/laravel-pxlcms/blob/910297d2a3f2db86dde51b0e10fe5aad45f1aa1a/src/Models/Scopes/CmsOrdered.php#L20-L32
jan-dolata/crude-crud
src/Http/Controllers/ApiController.php
ApiController.index
public function index(ApiRequest $request) { $this->crude = CrudeInstance::get($request->crudeName); $page = $request->input('page', 1); $numRows = $request->input('numRows', config('crude.defaults.numRows')); $sortAttr = $request->input('sortAttr', config('crude.defaults.sortAttr')...
php
public function index(ApiRequest $request) { $this->crude = CrudeInstance::get($request->crudeName); $page = $request->input('page', 1); $numRows = $request->input('numRows', config('crude.defaults.numRows')); $sortAttr = $request->input('sortAttr', config('crude.defaults.sortAttr')...
[ "public", "function", "index", "(", "ApiRequest", "$", "request", ")", "{", "$", "this", "->", "crude", "=", "CrudeInstance", "::", "get", "(", "$", "request", "->", "crudeName", ")", ";", "$", "page", "=", "$", "request", "->", "input", "(", "'page'",...
Fetch collection
[ "Fetch", "collection" ]
train
https://github.com/jan-dolata/crude-crud/blob/9129ea08278835cf5cecfd46a90369226ae6bdd7/src/Http/Controllers/ApiController.php#L27-L70
jan-dolata/crude-crud
src/Http/Controllers/ApiController.php
ApiController.store
public function store(ApiStoreRequest $request, $crudeName) { $this->crude = CrudeInstance::get($request->crudeName); $model = $this->crude->store($request->all()); return $this->successResponse([ 'model' => $model, 'message' => $this->crude->getCrudeSetup()->trans(...
php
public function store(ApiStoreRequest $request, $crudeName) { $this->crude = CrudeInstance::get($request->crudeName); $model = $this->crude->store($request->all()); return $this->successResponse([ 'model' => $model, 'message' => $this->crude->getCrudeSetup()->trans(...
[ "public", "function", "store", "(", "ApiStoreRequest", "$", "request", ",", "$", "crudeName", ")", "{", "$", "this", "->", "crude", "=", "CrudeInstance", "::", "get", "(", "$", "request", "->", "crudeName", ")", ";", "$", "model", "=", "$", "this", "->...
Add new model
[ "Add", "new", "model" ]
train
https://github.com/jan-dolata/crude-crud/blob/9129ea08278835cf5cecfd46a90369226ae6bdd7/src/Http/Controllers/ApiController.php#L75-L85
jan-dolata/crude-crud
src/Http/Controllers/ApiController.php
ApiController.update
public function update(ApiUpdateRequest $request, $crudeName, $id) { $this->crude = CrudeInstance::get($request->crudeName); $model = $this->crude->updateById($id, $request->all()); return $this->successResponse([ 'model' => $model, 'message' => $this->crude->getCru...
php
public function update(ApiUpdateRequest $request, $crudeName, $id) { $this->crude = CrudeInstance::get($request->crudeName); $model = $this->crude->updateById($id, $request->all()); return $this->successResponse([ 'model' => $model, 'message' => $this->crude->getCru...
[ "public", "function", "update", "(", "ApiUpdateRequest", "$", "request", ",", "$", "crudeName", ",", "$", "id", ")", "{", "$", "this", "->", "crude", "=", "CrudeInstance", "::", "get", "(", "$", "request", "->", "crudeName", ")", ";", "$", "model", "="...
Update model
[ "Update", "model" ]
train
https://github.com/jan-dolata/crude-crud/blob/9129ea08278835cf5cecfd46a90369226ae6bdd7/src/Http/Controllers/ApiController.php#L90-L100
jan-dolata/crude-crud
src/Http/Controllers/ApiController.php
ApiController.destroy
public function destroy(ApiDeleteRequest $request, $crudeName, $id) { $this->crude = CrudeInstance::get($request->crudeName); $model = $this->crude->deleteById($id); return $this->successResponse([ 'message' => $this->crude->getCrudeSetup()->trans('item_has_been_removed') ...
php
public function destroy(ApiDeleteRequest $request, $crudeName, $id) { $this->crude = CrudeInstance::get($request->crudeName); $model = $this->crude->deleteById($id); return $this->successResponse([ 'message' => $this->crude->getCrudeSetup()->trans('item_has_been_removed') ...
[ "public", "function", "destroy", "(", "ApiDeleteRequest", "$", "request", ",", "$", "crudeName", ",", "$", "id", ")", "{", "$", "this", "->", "crude", "=", "CrudeInstance", "::", "get", "(", "$", "request", "->", "crudeName", ")", ";", "$", "model", "=...
Remove model
[ "Remove", "model" ]
train
https://github.com/jan-dolata/crude-crud/blob/9129ea08278835cf5cecfd46a90369226ae6bdd7/src/Http/Controllers/ApiController.php#L105-L114
movoin/one-swoole
src/Event/Listener.php
Listener.setHandler
public function setHandler($handler) { if (Assert::array($handler)) { $this->handler = function (Event $event) use ($handler) { return call_user_func_array($handler, [$event]); }; } elseif (Assert::instanceOf($handler, '\\Closure')) { $this->handle...
php
public function setHandler($handler) { if (Assert::array($handler)) { $this->handler = function (Event $event) use ($handler) { return call_user_func_array($handler, [$event]); }; } elseif (Assert::instanceOf($handler, '\\Closure')) { $this->handle...
[ "public", "function", "setHandler", "(", "$", "handler", ")", "{", "if", "(", "Assert", "::", "array", "(", "$", "handler", ")", ")", "{", "$", "this", "->", "handler", "=", "function", "(", "Event", "$", "event", ")", "use", "(", "$", "handler", "...
设置事件处理句柄 @param \Closure|array $handler @throws \InvalidArgumentException
[ "设置事件处理句柄" ]
train
https://github.com/movoin/one-swoole/blob/b9b175963ead91416cc50902a04e05ff3ef571de/src/Event/Listener.php#L68-L79
kderyabin/logger
src/OptionsTrait.php
OptionsTrait.getOptionOrDefault
public function getOptionOrDefault($name) { return isset($this->options[$name]) ? $this->options[$name] : $this->getDefault($name); }
php
public function getOptionOrDefault($name) { return isset($this->options[$name]) ? $this->options[$name] : $this->getDefault($name); }
[ "public", "function", "getOptionOrDefault", "(", "$", "name", ")", "{", "return", "isset", "(", "$", "this", "->", "options", "[", "$", "name", "]", ")", "?", "$", "this", "->", "options", "[", "$", "name", "]", ":", "$", "this", "->", "getDefault", ...
Get an option value by name or a default option with the same name. @param $name @return mixed
[ "Get", "an", "option", "value", "by", "name", "or", "a", "default", "option", "with", "the", "same", "name", "." ]
train
https://github.com/kderyabin/logger/blob/683890192b37fe9d36611972e12c2994669f5b85/src/OptionsTrait.php#L56-L59
sulu/SuluSalesShippingBundle
src/Sulu/Bundle/Sales/CoreBundle/Api/Item.php
Item.getPriceFormatted
public function getPriceFormatted($locale = null) { $formatter = $this->getFormatter($locale); return $formatter->format((float)$this->entity->getPrice()); }
php
public function getPriceFormatted($locale = null) { $formatter = $this->getFormatter($locale); return $formatter->format((float)$this->entity->getPrice()); }
[ "public", "function", "getPriceFormatted", "(", "$", "locale", "=", "null", ")", "{", "$", "formatter", "=", "$", "this", "->", "getFormatter", "(", "$", "locale", ")", ";", "return", "$", "formatter", "->", "format", "(", "(", "float", ")", "$", "this...
@VirtualProperty @SerializedName("priceFormatted") @Groups({"Default","cart"}) @return string
[ "@VirtualProperty", "@SerializedName", "(", "priceFormatted", ")", "@Groups", "(", "{", "Default", "cart", "}", ")" ]
train
https://github.com/sulu/SuluSalesShippingBundle/blob/0d39de262d58579e5679db99a77dbf717d600b5e/src/Sulu/Bundle/Sales/CoreBundle/Api/Item.php#L404-L409
sulu/SuluSalesShippingBundle
src/Sulu/Bundle/Sales/CoreBundle/Api/Item.php
Item.getUnitPriceFormatted
public function getUnitPriceFormatted($locale = null) { $formatter = $this->getFormatter($locale); return $formatter->format((float)$this->getUnitPrice()); }
php
public function getUnitPriceFormatted($locale = null) { $formatter = $this->getFormatter($locale); return $formatter->format((float)$this->getUnitPrice()); }
[ "public", "function", "getUnitPriceFormatted", "(", "$", "locale", "=", "null", ")", "{", "$", "formatter", "=", "$", "this", "->", "getFormatter", "(", "$", "locale", ")", ";", "return", "$", "formatter", "->", "format", "(", "(", "float", ")", "$", "...
@VirtualProperty @SerializedName("unitPriceFormatted") @Groups({"Default","cart"}) @return string
[ "@VirtualProperty", "@SerializedName", "(", "unitPriceFormatted", ")", "@Groups", "(", "{", "Default", "cart", "}", ")" ]
train
https://github.com/sulu/SuluSalesShippingBundle/blob/0d39de262d58579e5679db99a77dbf717d600b5e/src/Sulu/Bundle/Sales/CoreBundle/Api/Item.php#L438-L443
sulu/SuluSalesShippingBundle
src/Sulu/Bundle/Sales/CoreBundle/Api/Item.php
Item.getTotalNetPriceFormatted
public function getTotalNetPriceFormatted($locale = null) { $formatter = $this->getFormatter($locale); return $formatter->format((float)$this->entity->getTotalNetPrice()); }
php
public function getTotalNetPriceFormatted($locale = null) { $formatter = $this->getFormatter($locale); return $formatter->format((float)$this->entity->getTotalNetPrice()); }
[ "public", "function", "getTotalNetPriceFormatted", "(", "$", "locale", "=", "null", ")", "{", "$", "formatter", "=", "$", "this", "->", "getFormatter", "(", "$", "locale", ")", ";", "return", "$", "formatter", "->", "format", "(", "(", "float", ")", "$",...
@VirtualProperty @SerializedName("totalNetPriceFormatted") @Groups({"Default","cart"}) @return string
[ "@VirtualProperty", "@SerializedName", "(", "totalNetPriceFormatted", ")", "@Groups", "(", "{", "Default", "cart", "}", ")" ]
train
https://github.com/sulu/SuluSalesShippingBundle/blob/0d39de262d58579e5679db99a77dbf717d600b5e/src/Sulu/Bundle/Sales/CoreBundle/Api/Item.php#L452-L457
sulu/SuluSalesShippingBundle
src/Sulu/Bundle/Sales/CoreBundle/Api/Item.php
Item.setProduct
public function setProduct($product = null) { $productEntity = $product; // if api-product - temporarily save if ($product instanceof ApiProductInterface) { $this->tempProduct = $product; $productEntity = $product->getEntity(); } $this->entity->setProd...
php
public function setProduct($product = null) { $productEntity = $product; // if api-product - temporarily save if ($product instanceof ApiProductInterface) { $this->tempProduct = $product; $productEntity = $product->getEntity(); } $this->entity->setProd...
[ "public", "function", "setProduct", "(", "$", "product", "=", "null", ")", "{", "$", "productEntity", "=", "$", "product", ";", "// if api-product - temporarily save", "if", "(", "$", "product", "instanceof", "ApiProductInterface", ")", "{", "$", "this", "->", ...
@param $product @return Item
[ "@param", "$product" ]
train
https://github.com/sulu/SuluSalesShippingBundle/blob/0d39de262d58579e5679db99a77dbf717d600b5e/src/Sulu/Bundle/Sales/CoreBundle/Api/Item.php#L719-L730
sulu/SuluSalesShippingBundle
src/Sulu/Bundle/Sales/CoreBundle/Api/Item.php
Item.getFormatter
private function getFormatter($locale = 'de-AT') { $formatter = new \NumberFormatter($locale, \NumberFormatter::DECIMAL); $formatter->setAttribute(\NumberFormatter::MIN_FRACTION_DIGITS, 2); $formatter->setAttribute(\NumberFormatter::DECIMAL_ALWAYS_SHOWN, 1); return $formatter; }
php
private function getFormatter($locale = 'de-AT') { $formatter = new \NumberFormatter($locale, \NumberFormatter::DECIMAL); $formatter->setAttribute(\NumberFormatter::MIN_FRACTION_DIGITS, 2); $formatter->setAttribute(\NumberFormatter::DECIMAL_ALWAYS_SHOWN, 1); return $formatter; }
[ "private", "function", "getFormatter", "(", "$", "locale", "=", "'de-AT'", ")", "{", "$", "formatter", "=", "new", "\\", "NumberFormatter", "(", "$", "locale", ",", "\\", "NumberFormatter", "::", "DECIMAL", ")", ";", "$", "formatter", "->", "setAttribute", ...
@param $locale @return Formatter
[ "@param", "$locale" ]
train
https://github.com/sulu/SuluSalesShippingBundle/blob/0d39de262d58579e5679db99a77dbf717d600b5e/src/Sulu/Bundle/Sales/CoreBundle/Api/Item.php#L791-L798
dantleech/glob
lib/DTL/Glob/Finder/AbstractTraversalFinder.php
AbstractTraversalFinder.find
public function find($selector) { if ($selector == '/') { return array($this->getNode(array())); } $segments = $this->parser->parse($selector); $result = array(); $this->traverse($segments, $result); return $result; }
php
public function find($selector) { if ($selector == '/') { return array($this->getNode(array())); } $segments = $this->parser->parse($selector); $result = array(); $this->traverse($segments, $result); return $result; }
[ "public", "function", "find", "(", "$", "selector", ")", "{", "if", "(", "$", "selector", "==", "'/'", ")", "{", "return", "array", "(", "$", "this", "->", "getNode", "(", "array", "(", ")", ")", ")", ";", "}", "$", "segments", "=", "$", "this", ...
{@inheritDoc}
[ "{" ]
train
https://github.com/dantleech/glob/blob/1f618e6b77a5de4c6b0538d82572fe19cbb1c446/lib/DTL/Glob/Finder/AbstractTraversalFinder.php#L45-L57
dantleech/glob
lib/DTL/Glob/Finder/AbstractTraversalFinder.php
AbstractTraversalFinder.traverse
private function traverse(array $segments, &$result = array(), $node = null) { $path = array(); if (null !== $node) { $path = explode('/', substr($node->getPath(), 1)); } do { list($element, $bitmask) = array_shift($segments); if ($bitmask & Sel...
php
private function traverse(array $segments, &$result = array(), $node = null) { $path = array(); if (null !== $node) { $path = explode('/', substr($node->getPath(), 1)); } do { list($element, $bitmask) = array_shift($segments); if ($bitmask & Sel...
[ "private", "function", "traverse", "(", "array", "$", "segments", ",", "&", "$", "result", "=", "array", "(", ")", ",", "$", "node", "=", "null", ")", "{", "$", "path", "=", "array", "(", ")", ";", "if", "(", "null", "!==", "$", "node", ")", "{...
Traverse the node @param NodeInterface|null $node The node to traverse, if it exists yet @param array $segments The element => token stack @param array $result The result @return null
[ "Traverse", "the", "node" ]
train
https://github.com/dantleech/glob/blob/1f618e6b77a5de4c6b0538d82572fe19cbb1c446/lib/DTL/Glob/Finder/AbstractTraversalFinder.php#L68-L108
sulu/SuluSalesShippingBundle
src/Sulu/Bundle/Sales/CoreBundle/Widgets/FlowOfDocuments.php
FlowOfDocuments.addEntry
protected function addEntry($id, $number, $type, DateTime $date, $route, $pdfUrl, $translationKey = '') { $this->entries[] = array( 'id' => $id, 'number' => $number, 'type' => $type, 'date' => $date, 'route' => $route, 'pdfUrl' => $pdfU...
php
protected function addEntry($id, $number, $type, DateTime $date, $route, $pdfUrl, $translationKey = '') { $this->entries[] = array( 'id' => $id, 'number' => $number, 'type' => $type, 'date' => $date, 'route' => $route, 'pdfUrl' => $pdfU...
[ "protected", "function", "addEntry", "(", "$", "id", ",", "$", "number", ",", "$", "type", ",", "DateTime", "$", "date", ",", "$", "route", ",", "$", "pdfUrl", ",", "$", "translationKey", "=", "''", ")", "{", "$", "this", "->", "entries", "[", "]",...
Creates and adds an entry to the exisiting entries @param String|Number $id @param String $number @param String $type @param DateTime $date @param String $route @param String $pdfUrl @param String $translationKey
[ "Creates", "and", "adds", "an", "entry", "to", "the", "exisiting", "entries" ]
train
https://github.com/sulu/SuluSalesShippingBundle/blob/0d39de262d58579e5679db99a77dbf717d600b5e/src/Sulu/Bundle/Sales/CoreBundle/Widgets/FlowOfDocuments.php#L48-L59
cabalphp/route
src/Route.php
Route.map
public function map($optionsOrMethod, $path, $handler) { $this->options = $this->defaultOptions($optionsOrMethod); $this->path = $path; $this->handler = $handler; return $this; }
php
public function map($optionsOrMethod, $path, $handler) { $this->options = $this->defaultOptions($optionsOrMethod); $this->path = $path; $this->handler = $handler; return $this; }
[ "public", "function", "map", "(", "$", "optionsOrMethod", ",", "$", "path", ",", "$", "handler", ")", "{", "$", "this", "->", "options", "=", "$", "this", "->", "defaultOptions", "(", "$", "optionsOrMethod", ")", ";", "$", "this", "->", "path", "=", ...
Undocumented function @param string $optionsOrMethod @param string|mixed $path @param \Cabal\Route\Route $handler @return void
[ "Undocumented", "function" ]
train
https://github.com/cabalphp/route/blob/13959fa0c3f6777cb9a9290c9b032dd514cd33b7/src/Route.php#L31-L37
yoanm/php-jsonrpc-http-server-openapi-doc-sdk
src/App/Normalizer/Component/ExternalSchemaListDocNormalizer.php
ExternalSchemaListDocNormalizer.normalize
public function normalize(ServerDoc $doc) : array { return array_merge( $this->getMethodsExternalSchemaList($doc), $this->getMethodErrorsExternalSchemaList($doc), $this->getServerErrorsExtraSchemaList($doc) ); }
php
public function normalize(ServerDoc $doc) : array { return array_merge( $this->getMethodsExternalSchemaList($doc), $this->getMethodErrorsExternalSchemaList($doc), $this->getServerErrorsExtraSchemaList($doc) ); }
[ "public", "function", "normalize", "(", "ServerDoc", "$", "doc", ")", ":", "array", "{", "return", "array_merge", "(", "$", "this", "->", "getMethodsExternalSchemaList", "(", "$", "doc", ")", ",", "$", "this", "->", "getMethodErrorsExternalSchemaList", "(", "$...
@param ServerDoc $doc @return array @throws \ReflectionException
[ "@param", "ServerDoc", "$doc" ]
train
https://github.com/yoanm/php-jsonrpc-http-server-openapi-doc-sdk/blob/52d6bb5d0671e0363bbf482c3c75fef97d7d1d5e/src/App/Normalizer/Component/ExternalSchemaListDocNormalizer.php#L42-L49
yoanm/php-jsonrpc-http-server-openapi-doc-sdk
src/App/Normalizer/Component/ExternalSchemaListDocNormalizer.php
ExternalSchemaListDocNormalizer.getMethodsExternalSchemaList
protected function getMethodsExternalSchemaList(ServerDoc $doc) : array { $list = []; foreach ($doc->getMethodList() as $method) { // Merge extra definitions $list = array_merge($list, $this->getMethodExternalSchemaList($method)); } return $list; }
php
protected function getMethodsExternalSchemaList(ServerDoc $doc) : array { $list = []; foreach ($doc->getMethodList() as $method) { // Merge extra definitions $list = array_merge($list, $this->getMethodExternalSchemaList($method)); } return $list; }
[ "protected", "function", "getMethodsExternalSchemaList", "(", "ServerDoc", "$", "doc", ")", ":", "array", "{", "$", "list", "=", "[", "]", ";", "foreach", "(", "$", "doc", "->", "getMethodList", "(", ")", "as", "$", "method", ")", "{", "// Merge extra defi...
@param ServerDoc $doc @return array @throws \ReflectionException
[ "@param", "ServerDoc", "$doc" ]
train
https://github.com/yoanm/php-jsonrpc-http-server-openapi-doc-sdk/blob/52d6bb5d0671e0363bbf482c3c75fef97d7d1d5e/src/App/Normalizer/Component/ExternalSchemaListDocNormalizer.php#L58-L67
yoanm/php-jsonrpc-http-server-openapi-doc-sdk
src/App/Normalizer/Component/ExternalSchemaListDocNormalizer.php
ExternalSchemaListDocNormalizer.getMethodErrorsExternalSchemaList
protected function getMethodErrorsExternalSchemaList(ServerDoc $doc) : array { $list = []; foreach ($doc->getMethodList() as $method) { foreach ($method->getCustomErrorList() as $errorDoc) { $key = $this->definitionRefResolver->getErrorDefinitionId( $e...
php
protected function getMethodErrorsExternalSchemaList(ServerDoc $doc) : array { $list = []; foreach ($doc->getMethodList() as $method) { foreach ($method->getCustomErrorList() as $errorDoc) { $key = $this->definitionRefResolver->getErrorDefinitionId( $e...
[ "protected", "function", "getMethodErrorsExternalSchemaList", "(", "ServerDoc", "$", "doc", ")", ":", "array", "{", "$", "list", "=", "[", "]", ";", "foreach", "(", "$", "doc", "->", "getMethodList", "(", ")", "as", "$", "method", ")", "{", "foreach", "(...
@param ServerDoc $doc @return array @throws \ReflectionException
[ "@param", "ServerDoc", "$doc" ]
train
https://github.com/yoanm/php-jsonrpc-http-server-openapi-doc-sdk/blob/52d6bb5d0671e0363bbf482c3c75fef97d7d1d5e/src/App/Normalizer/Component/ExternalSchemaListDocNormalizer.php#L76-L90
yoanm/php-jsonrpc-http-server-openapi-doc-sdk
src/App/Normalizer/Component/ExternalSchemaListDocNormalizer.php
ExternalSchemaListDocNormalizer.getServerErrorsExtraSchemaList
protected function getServerErrorsExtraSchemaList(ServerDoc $doc) : array { $list = []; foreach ($doc->getGlobalErrorList() as $errorDoc) { $key = $this->definitionRefResolver->getErrorDefinitionId( $errorDoc, DefinitionRefResolver::CUSTOM_ERROR_DEFINITION...
php
protected function getServerErrorsExtraSchemaList(ServerDoc $doc) : array { $list = []; foreach ($doc->getGlobalErrorList() as $errorDoc) { $key = $this->definitionRefResolver->getErrorDefinitionId( $errorDoc, DefinitionRefResolver::CUSTOM_ERROR_DEFINITION...
[ "protected", "function", "getServerErrorsExtraSchemaList", "(", "ServerDoc", "$", "doc", ")", ":", "array", "{", "$", "list", "=", "[", "]", ";", "foreach", "(", "$", "doc", "->", "getGlobalErrorList", "(", ")", "as", "$", "errorDoc", ")", "{", "$", "key...
@param ServerDoc $doc @return array @throws \ReflectionException
[ "@param", "ServerDoc", "$doc" ]
train
https://github.com/yoanm/php-jsonrpc-http-server-openapi-doc-sdk/blob/52d6bb5d0671e0363bbf482c3c75fef97d7d1d5e/src/App/Normalizer/Component/ExternalSchemaListDocNormalizer.php#L100-L120