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
esperecyan/dictionary-php
src/serializer/CatchfeelingSerializer.php
CatchfeelingSerializer.serializeWord
protected function serializeWord(array $word): string { if (!isset($word['type'][0]) || $word['type'][0] !== 'selection') { $answers = $this->getOrderedAnswers($word); if ($answers) { foreach ($answers as $answer) { if (strpos($answer, '//') === fa...
php
protected function serializeWord(array $word): string { if (!isset($word['type'][0]) || $word['type'][0] !== 'selection') { $answers = $this->getOrderedAnswers($word); if ($answers) { foreach ($answers as $answer) { if (strpos($answer, '//') === fa...
[ "protected", "function", "serializeWord", "(", "array", "$", "word", ")", ":", "string", "{", "if", "(", "!", "isset", "(", "$", "word", "[", "'type'", "]", "[", "0", "]", ")", "||", "$", "word", "[", "'type'", "]", "[", "0", "]", "!==", "'select...
一つのお題を表す配列を直列化します。 @param (string|string[]|float)[][] $word @return string 末尾に改行 (CRLF) を含みます。直列化できないお題だった場合は空文字列を返します。
[ "一つのお題を表す配列を直列化します。" ]
train
https://github.com/esperecyan/dictionary-php/blob/14fad08fb43006995c763094e8e7ed0dc0e26676/src/serializer/CatchfeelingSerializer.php#L13-L54
gregorybesson/PlaygroundCore
src/Validator/MailDomain.php
MailDomain.setFile
public function setFile($file) { if (empty($file) || false === stream_resolve_include_path($file)) { throw new Exception\InvalidArgumentException('Invalid options to validator provided'); } $this->options['file'] = $file; return $this; }
php
public function setFile($file) { if (empty($file) || false === stream_resolve_include_path($file)) { throw new Exception\InvalidArgumentException('Invalid options to validator provided'); } $this->options['file'] = $file; return $this; }
[ "public", "function", "setFile", "(", "$", "file", ")", "{", "if", "(", "empty", "(", "$", "file", ")", "||", "false", "===", "stream_resolve_include_path", "(", "$", "file", ")", ")", "{", "throw", "new", "Exception", "\\", "InvalidArgumentException", "("...
Sets the path to the file @param string $path to the file @return MailDomain Provides a fluent interface @throws Exception\InvalidArgumentException When file is not found
[ "Sets", "the", "path", "to", "the", "file" ]
train
https://github.com/gregorybesson/PlaygroundCore/blob/f8dfa4c7660b54354933b3c28c0cf35304a649df/src/Validator/MailDomain.php#L48-L56
Atlantic18/CoralCoreBundle
CoralCoreBundle.php
CoralCoreBundle.build
public function build(ContainerBuilder $container) { parent::build($container); $container->registerExtension(new CoralCoreExtension()); $container->addCompilerPass(new ConnectorCompilerPass); }
php
public function build(ContainerBuilder $container) { parent::build($container); $container->registerExtension(new CoralCoreExtension()); $container->addCompilerPass(new ConnectorCompilerPass); }
[ "public", "function", "build", "(", "ContainerBuilder", "$", "container", ")", "{", "parent", "::", "build", "(", "$", "container", ")", ";", "$", "container", "->", "registerExtension", "(", "new", "CoralCoreExtension", "(", ")", ")", ";", "$", "container",...
Builds the bundle. It is only ever called once when the cache is empty. This method can be overridden to register compilation passes, other extensions, ... @param ContainerBuilder $container A ContainerBuilder instance
[ "Builds", "the", "bundle", "." ]
train
https://github.com/Atlantic18/CoralCoreBundle/blob/7d74ffaf51046ad13cbfc2b0b69d656a499f38ab/CoralCoreBundle.php#L27-L34
movoin/one-swoole
src/Logging/Provider.php
Provider.register
public function register() { $this->bind('logger', function ($server) { $name = $server->getProcessName(); $path = $this->config('runtime_path', '') . '/logs/' . $name . '.log'; return new Logger($name, $path); }); }
php
public function register() { $this->bind('logger', function ($server) { $name = $server->getProcessName(); $path = $this->config('runtime_path', '') . '/logs/' . $name . '.log'; return new Logger($name, $path); }); }
[ "public", "function", "register", "(", ")", "{", "$", "this", "->", "bind", "(", "'logger'", ",", "function", "(", "$", "server", ")", "{", "$", "name", "=", "$", "server", "->", "getProcessName", "(", ")", ";", "$", "path", "=", "$", "this", "->",...
注册服务 @return void
[ "注册服务" ]
train
https://github.com/movoin/one-swoole/blob/b9b175963ead91416cc50902a04e05ff3ef571de/src/Logging/Provider.php#L24-L32
discophp/framework
core/twig/tag/PageNode.php
PageNode.compile
public function compile(\Twig_Compiler $compiler) { $compiler->addDebugInfo($this) ->write("list(\$context['page'], ") ->subcompile($this->getNode('elementsTarget')) ->raw(') = \Disco\twig\PageNode::page(') ->subcompile($this->getNode('criteria')) ->r...
php
public function compile(\Twig_Compiler $compiler) { $compiler->addDebugInfo($this) ->write("list(\$context['page'], ") ->subcompile($this->getNode('elementsTarget')) ->raw(') = \Disco\twig\PageNode::page(') ->subcompile($this->getNode('criteria')) ->r...
[ "public", "function", "compile", "(", "\\", "Twig_Compiler", "$", "compiler", ")", "{", "$", "compiler", "->", "addDebugInfo", "(", "$", "this", ")", "->", "write", "(", "\"list(\\$context['page'], \"", ")", "->", "subcompile", "(", "$", "this", "->", "getNo...
Provide the functionality for compiling a {{page}} {{endpage}} tag. @param \Twig_Compiler $compiler A \Twig_compliler instance. @return void
[ "Provide", "the", "functionality", "for", "compiling", "a", "{{", "page", "}}", "{{", "endpage", "}}", "tag", "." ]
train
https://github.com/discophp/framework/blob/40ff3ea5225810534195494dc6c21083da4d1356/core/twig/tag/PageNode.php#L20-L33
discophp/framework
core/twig/tag/PageNode.php
PageNode.page
public static function page($object){ $page = \Disco\classes\Router::$paginateCurrentPage; $parent = get_parent_class($object); if($parent === 'Disco\classes\LookUp'){ $object->page($page); $copy = clone $object; return Array( (new \Disco...
php
public static function page($object){ $page = \Disco\classes\Router::$paginateCurrentPage; $parent = get_parent_class($object); if($parent === 'Disco\classes\LookUp'){ $object->page($page); $copy = clone $object; return Array( (new \Disco...
[ "public", "static", "function", "page", "(", "$", "object", ")", "{", "$", "page", "=", "\\", "Disco", "\\", "classes", "\\", "Router", "::", "$", "paginateCurrentPage", ";", "$", "parent", "=", "get_parent_class", "(", "$", "object", ")", ";", "if", "...
The method the twig tag `page` uses to perform pagination on lookups and models. @param \Disco\classes\Lookup|\Disco\classes\Model $object A instance of a class that extends {@link \Disco\classes\LookUp} or {@link \Disco\classes\Model}. @return array The first element is the {@link \Disco\classes\Paginate}, the seco...
[ "The", "method", "the", "twig", "tag", "page", "uses", "to", "perform", "pagination", "on", "lookups", "and", "models", "." ]
train
https://github.com/discophp/framework/blob/40ff3ea5225810534195494dc6c21083da4d1356/core/twig/tag/PageNode.php#L49-L85
avoo/SerializerTranslation
Configuration/Metadata/VirtualPropertyMetadata.php
VirtualPropertyMetadata.serialize
public function serialize() { return serialize(array( parent::serialize(), $this->parameters, $this->domain, $this->locale )); }
php
public function serialize() { return serialize(array( parent::serialize(), $this->parameters, $this->domain, $this->locale )); }
[ "public", "function", "serialize", "(", ")", "{", "return", "serialize", "(", "array", "(", "parent", "::", "serialize", "(", ")", ",", "$", "this", "->", "parameters", ",", "$", "this", "->", "domain", ",", "$", "this", "->", "locale", ")", ")", ";"...
{@inheritdoc}
[ "{" ]
train
https://github.com/avoo/SerializerTranslation/blob/e66de5482adb944197a36874465ef144b293a157/Configuration/Metadata/VirtualPropertyMetadata.php#L70-L78
avoo/SerializerTranslation
Configuration/Metadata/VirtualPropertyMetadata.php
VirtualPropertyMetadata.unserialize
public function unserialize($str) { list( $parentStr, $this->parameters, $this->domain, $this->locale ) = unserialize($str); parent::unserialize($parentStr); }
php
public function unserialize($str) { list( $parentStr, $this->parameters, $this->domain, $this->locale ) = unserialize($str); parent::unserialize($parentStr); }
[ "public", "function", "unserialize", "(", "$", "str", ")", "{", "list", "(", "$", "parentStr", ",", "$", "this", "->", "parameters", ",", "$", "this", "->", "domain", ",", "$", "this", "->", "locale", ")", "=", "unserialize", "(", "$", "str", ")", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/avoo/SerializerTranslation/blob/e66de5482adb944197a36874465ef144b293a157/Configuration/Metadata/VirtualPropertyMetadata.php#L83-L93
matthiasbayer/datadog-client
src/Bayer/DataDogClient/Factory.php
Factory.buildMetric
public static function buildMetric($name, array $points, array $options = array()) { $metric = new Metric($name, $points); foreach ($options as $property => $value) { self::setProperty($metric, $property, $value); } return $metric; }
php
public static function buildMetric($name, array $points, array $options = array()) { $metric = new Metric($name, $points); foreach ($options as $property => $value) { self::setProperty($metric, $property, $value); } return $metric; }
[ "public", "static", "function", "buildMetric", "(", "$", "name", ",", "array", "$", "points", ",", "array", "$", "options", "=", "array", "(", ")", ")", "{", "$", "metric", "=", "new", "Metric", "(", "$", "name", ",", "$", "points", ")", ";", "fore...
@param string $name @param array $points @param array $options @return Metric
[ "@param", "string", "$name", "@param", "array", "$points", "@param", "array", "$options" ]
train
https://github.com/matthiasbayer/datadog-client/blob/e625132c34bf36f783077c9ee4ed3214633cd272/src/Bayer/DataDogClient/Factory.php#L23-L31
matthiasbayer/datadog-client
src/Bayer/DataDogClient/Factory.php
Factory.buildEvent
public static function buildEvent($text, $title = '', array $options = array()) { $event = new Event($text, $title); foreach ($options as $property => $value) { self::setProperty($event, $property, $value); } return $event; }
php
public static function buildEvent($text, $title = '', array $options = array()) { $event = new Event($text, $title); foreach ($options as $property => $value) { self::setProperty($event, $property, $value); } return $event; }
[ "public", "static", "function", "buildEvent", "(", "$", "text", ",", "$", "title", "=", "''", ",", "array", "$", "options", "=", "array", "(", ")", ")", "{", "$", "event", "=", "new", "Event", "(", "$", "text", ",", "$", "title", ")", ";", "forea...
@param string $text @param string $title @param array $options @return Event
[ "@param", "string", "$text", "@param", "string", "$title", "@param", "array", "$options" ]
train
https://github.com/matthiasbayer/datadog-client/blob/e625132c34bf36f783077c9ee4ed3214633cd272/src/Bayer/DataDogClient/Factory.php#L40-L48
tonicospinelli/class-generation
src/ClassGeneration/Property.php
Property.setType
public function setType($type) { $this->type = (string)$type; $this->getDocBlock()->getTagCollection()->removeByName(Tag::TAG_VAR); $tag = Tag::createFromProperty($this); $this->getDocBlock()->addTag($tag); return $this; }
php
public function setType($type) { $this->type = (string)$type; $this->getDocBlock()->getTagCollection()->removeByName(Tag::TAG_VAR); $tag = Tag::createFromProperty($this); $this->getDocBlock()->addTag($tag); return $this; }
[ "public", "function", "setType", "(", "$", "type", ")", "{", "$", "this", "->", "type", "=", "(", "string", ")", "$", "type", ";", "$", "this", "->", "getDocBlock", "(", ")", "->", "getTagCollection", "(", ")", "->", "removeByName", "(", "Tag", "::",...
Sets the property's type. @param string $type @return Property
[ "Sets", "the", "property", "s", "type", "." ]
train
https://github.com/tonicospinelli/class-generation/blob/eee63bdb68c066b25b885b57b23656e809381a76/src/ClassGeneration/Property.php#L146-L156
tonicospinelli/class-generation
src/ClassGeneration/Property.php
Property.toString
public function toString() { $static = ''; if ($this->isStatic()) { $static = 'static '; } $value = ''; if ($this->hasValue()) { $value = ' = ' . var_export($this->getValue(), true); } $property = $this->getDocBlock()->toString() . $t...
php
public function toString() { $static = ''; if ($this->isStatic()) { $static = 'static '; } $value = ''; if ($this->hasValue()) { $value = ' = ' . var_export($this->getValue(), true); } $property = $this->getDocBlock()->toString() . $t...
[ "public", "function", "toString", "(", ")", "{", "$", "static", "=", "''", ";", "if", "(", "$", "this", "->", "isStatic", "(", ")", ")", "{", "$", "static", "=", "'static '", ";", "}", "$", "value", "=", "''", ";", "if", "(", "$", "this", "->",...
{@inheritdoc}
[ "{" ]
train
https://github.com/tonicospinelli/class-generation/blob/eee63bdb68c066b25b885b57b23656e809381a76/src/ClassGeneration/Property.php#L246-L266
gdbots/pbjx-bundle-php
src/Command/TailEventsCommand.php
TailEventsCommand.execute
protected function execute(InputInterface $input, OutputInterface $output) { $errOutput = $output instanceof ConsoleOutputInterface ? $output->getErrorOutput() : $output; $output->setVerbosity(OutputInterface::VERBOSITY_QUIET); $errOutput->setVerbosity(OutputInterface::VERBOSITY_NORMAL); ...
php
protected function execute(InputInterface $input, OutputInterface $output) { $errOutput = $output instanceof ConsoleOutputInterface ? $output->getErrorOutput() : $output; $output->setVerbosity(OutputInterface::VERBOSITY_QUIET); $errOutput->setVerbosity(OutputInterface::VERBOSITY_NORMAL); ...
[ "protected", "function", "execute", "(", "InputInterface", "$", "input", ",", "OutputInterface", "$", "output", ")", "{", "$", "errOutput", "=", "$", "output", "instanceof", "ConsoleOutputInterface", "?", "$", "output", "->", "getErrorOutput", "(", ")", ":", "...
@param InputInterface $input @param OutputInterface $output @return null
[ "@param", "InputInterface", "$input", "@param", "OutputInterface", "$output" ]
train
https://github.com/gdbots/pbjx-bundle-php/blob/f3c0088583879fc92f13247a0752634bd8696eac/src/Command/TailEventsCommand.php#L79-L111
pickles2/px2-sitemapexcel
php/apis/xlsx2csv.php
xlsx2csv.convert
public function convert( $path_xlsx, $path_csv ){ $this->path_xlsx = $path_xlsx; $this->path_csv = $path_csv; $this->path_tmp_csv = $path_csv.'.tmp'.time(); do{ $this->path_tmp_csv = $path_csv.'.tmp'.time(); } while( is_file($this->path_tmp_csv) ); // ページID自動発行のための情報をリセット $this->auto_id_num = 0; // 通し...
php
public function convert( $path_xlsx, $path_csv ){ $this->path_xlsx = $path_xlsx; $this->path_csv = $path_csv; $this->path_tmp_csv = $path_csv.'.tmp'.time(); do{ $this->path_tmp_csv = $path_csv.'.tmp'.time(); } while( is_file($this->path_tmp_csv) ); // ページID自動発行のための情報をリセット $this->auto_id_num = 0; // 通し...
[ "public", "function", "convert", "(", "$", "path_xlsx", ",", "$", "path_csv", ")", "{", "$", "this", "->", "path_xlsx", "=", "$", "path_xlsx", ";", "$", "this", "->", "path_csv", "=", "$", "path_csv", ";", "$", "this", "->", "path_tmp_csv", "=", "$", ...
xlsxからサイトマップCSVを出力する。
[ "xlsxからサイトマップCSVを出力する。" ]
train
https://github.com/pickles2/px2-sitemapexcel/blob/fbfa207ee9b2e4bd977aadf69a935d3fade51fea/php/apis/xlsx2csv.php#L51-L323
pickles2/px2-sitemapexcel
php/apis/xlsx2csv.php
xlsx2csv.output_csv_row
private function output_csv_row( $row ){ $this->px->fs()->mkdir(dirname($this->path_tmp_csv)); file_put_contents( $this->path_tmp_csv, $this->px->fs()->mk_csv( array($row), array('charset'=>'UTF-8') ), FILE_APPEND|LOCK_EX ); return $res; }
php
private function output_csv_row( $row ){ $this->px->fs()->mkdir(dirname($this->path_tmp_csv)); file_put_contents( $this->path_tmp_csv, $this->px->fs()->mk_csv( array($row), array('charset'=>'UTF-8') ), FILE_APPEND|LOCK_EX ); return $res; }
[ "private", "function", "output_csv_row", "(", "$", "row", ")", "{", "$", "this", "->", "px", "->", "fs", "(", ")", "->", "mkdir", "(", "dirname", "(", "$", "this", "->", "path_tmp_csv", ")", ")", ";", "file_put_contents", "(", "$", "this", "->", "pat...
サイトマップの行を一時ファイルに出力する @return boolean result
[ "サイトマップの行を一時ファイルに出力する" ]
train
https://github.com/pickles2/px2-sitemapexcel/blob/fbfa207ee9b2e4bd977aadf69a935d3fade51fea/php/apis/xlsx2csv.php#L329-L340
pickles2/px2-sitemapexcel
php/apis/xlsx2csv.php
xlsx2csv.generate_auto_page_id
private function generate_auto_page_id(){ $this->auto_id_num ++; $rtn = 'sitemapExcel_auto_id_'.$this->extless_basename.'-'.intval($this->auto_id_num); return $rtn; }
php
private function generate_auto_page_id(){ $this->auto_id_num ++; $rtn = 'sitemapExcel_auto_id_'.$this->extless_basename.'-'.intval($this->auto_id_num); return $rtn; }
[ "private", "function", "generate_auto_page_id", "(", ")", "{", "$", "this", "->", "auto_id_num", "++", ";", "$", "rtn", "=", "'sitemapExcel_auto_id_'", ".", "$", "this", "->", "extless_basename", ".", "'-'", ".", "intval", "(", "$", "this", "->", "auto_id_nu...
ページIDを自動生成する
[ "ページIDを自動生成する" ]
train
https://github.com/pickles2/px2-sitemapexcel/blob/fbfa207ee9b2e4bd977aadf69a935d3fade51fea/php/apis/xlsx2csv.php#L353-L357
pickles2/px2-sitemapexcel
php/apis/xlsx2csv.php
xlsx2csv.regulize_path
private function regulize_path($path){ switch( $this->px->get_path_type($path) ){ case 'full_url': case 'data': case 'javascript': case 'anchor': break; default: $parsed_url = parse_url($path); $path_path = preg_replace( '/(?:\?|\#).*$/', '', $path); $path_path = preg_replace( '/\/$/s',...
php
private function regulize_path($path){ switch( $this->px->get_path_type($path) ){ case 'full_url': case 'data': case 'javascript': case 'anchor': break; default: $parsed_url = parse_url($path); $path_path = preg_replace( '/(?:\?|\#).*$/', '', $path); $path_path = preg_replace( '/\/$/s',...
[ "private", "function", "regulize_path", "(", "$", "path", ")", "{", "switch", "(", "$", "this", "->", "px", "->", "get_path_type", "(", "$", "path", ")", ")", "{", "case", "'full_url'", ":", "case", "'data'", ":", "case", "'javascript'", ":", "case", "...
パス文字列の正規化
[ "パス文字列の正規化" ]
train
https://github.com/pickles2/px2-sitemapexcel/blob/fbfa207ee9b2e4bd977aadf69a935d3fade51fea/php/apis/xlsx2csv.php#L362-L377
pickles2/px2-sitemapexcel
php/apis/xlsx2csv.php
xlsx2csv.parse_definition
private function parse_definition( $objPHPExcel, $sheetIndex = 0 ){ $rtn = array(); $objPHPExcel->setActiveSheetIndex($sheetIndex); $objSheet = $objPHPExcel->getActiveSheet(); parse_str( $objSheet->getCell('A1')->getCalculatedValue(), $rtn ); $rtn['tbl_highest_row'] = $objSheet->getHighestRow(); // e.g. 10 ...
php
private function parse_definition( $objPHPExcel, $sheetIndex = 0 ){ $rtn = array(); $objPHPExcel->setActiveSheetIndex($sheetIndex); $objSheet = $objPHPExcel->getActiveSheet(); parse_str( $objSheet->getCell('A1')->getCalculatedValue(), $rtn ); $rtn['tbl_highest_row'] = $objSheet->getHighestRow(); // e.g. 10 ...
[ "private", "function", "parse_definition", "(", "$", "objPHPExcel", ",", "$", "sheetIndex", "=", "0", ")", "{", "$", "rtn", "=", "array", "(", ")", ";", "$", "objPHPExcel", "->", "setActiveSheetIndex", "(", "$", "sheetIndex", ")", ";", "$", "objSheet", "...
xlsxの構造定義設定を解析する
[ "xlsxの構造定義設定を解析する" ]
train
https://github.com/pickles2/px2-sitemapexcel/blob/fbfa207ee9b2e4bd977aadf69a935d3fade51fea/php/apis/xlsx2csv.php#L382-L442
pipelinersales/pipeliner-php-sdk
src/PipelinerSales/ApiClient/Query/Criteria.php
Criteria.toUrlQuery
public function toUrlQuery() { $queryData = array(); foreach (self::$properties as $p => $setter) { if ($this->$p !== null) { $queryData[$p] = $this->$p; } } return http_build_query($queryData); }
php
public function toUrlQuery() { $queryData = array(); foreach (self::$properties as $p => $setter) { if ($this->$p !== null) { $queryData[$p] = $this->$p; } } return http_build_query($queryData); }
[ "public", "function", "toUrlQuery", "(", ")", "{", "$", "queryData", "=", "array", "(", ")", ";", "foreach", "(", "self", "::", "$", "properties", "as", "$", "p", "=>", "$", "setter", ")", "{", "if", "(", "$", "this", "->", "$", "p", "!==", "null...
Returns the resulting url-encoded query string. @return string
[ "Returns", "the", "resulting", "url", "-", "encoded", "query", "string", "." ]
train
https://github.com/pipelinersales/pipeliner-php-sdk/blob/a020149ffde815be17634542010814cf854c3d5f/src/PipelinerSales/ApiClient/Query/Criteria.php#L68-L77
pipelinersales/pipeliner-php-sdk
src/PipelinerSales/ApiClient/Query/Criteria.php
Criteria.set
public function set($criteria) { if ($criteria instanceof Criteria) { //this is much faster than using the same method that's used for arrays (see below) $this->limit = $criteria->limit; $this->offset = $criteria->offset; $this->sort = $criteria->sort; ...
php
public function set($criteria) { if ($criteria instanceof Criteria) { //this is much faster than using the same method that's used for arrays (see below) $this->limit = $criteria->limit; $this->offset = $criteria->offset; $this->sort = $criteria->sort; ...
[ "public", "function", "set", "(", "$", "criteria", ")", "{", "if", "(", "$", "criteria", "instanceof", "Criteria", ")", "{", "//this is much faster than using the same method that's used for arrays (see below)", "$", "this", "->", "limit", "=", "$", "criteria", "->", ...
Sets multiple parameters at once. @param mixed $criteria Can be one of the following: <ul> <li>Another Criteria object - copies that object's criteria into this one. Competely replaces the current object's values, unsetting those which have not been set in $criteria</li> <li>An array - sets the parameters present in t...
[ "Sets", "multiple", "parameters", "at", "once", "." ]
train
https://github.com/pipelinersales/pipeliner-php-sdk/blob/a020149ffde815be17634542010814cf854c3d5f/src/PipelinerSales/ApiClient/Query/Criteria.php#L247-L269
pipelinersales/pipeliner-php-sdk
src/PipelinerSales/ApiClient/Query/Criteria.php
Criteria.parseHttpQuery
private function parseHttpQuery($query) { /* can't use parse_str, because the minimum supported PHP version * is 5.3, which still has the magic_quotes_gpc option that affects its * result, so some users could hypothetically have that enabled */ if (empty($query)) { retu...
php
private function parseHttpQuery($query) { /* can't use parse_str, because the minimum supported PHP version * is 5.3, which still has the magic_quotes_gpc option that affects its * result, so some users could hypothetically have that enabled */ if (empty($query)) { retu...
[ "private", "function", "parseHttpQuery", "(", "$", "query", ")", "{", "/* can't use parse_str, because the minimum supported PHP version\n * is 5.3, which still has the magic_quotes_gpc option that affects its\n * result, so some users could hypothetically have that enabled */", "i...
Parses a http query into a key-value array, similar to PHP's parse_str function. @param string $query query string (without a leading question mark) @return array
[ "Parses", "a", "http", "query", "into", "a", "key", "-", "value", "array", "similar", "to", "PHP", "s", "parse_str", "function", "." ]
train
https://github.com/pipelinersales/pipeliner-php-sdk/blob/a020149ffde815be17634542010814cf854c3d5f/src/PipelinerSales/ApiClient/Query/Criteria.php#L276-L292
innobrig/flex-input
src/Input.php
Input.fromCookie
public static function fromCookie ($key, $default=null, $filter=null, $args=array()) { if (!$key) { return self::filterArray ($_COOKIE, $filter, $args); } return self::getPassedValue ($key, $default, 'C', $filter, $args); }
php
public static function fromCookie ($key, $default=null, $filter=null, $args=array()) { if (!$key) { return self::filterArray ($_COOKIE, $filter, $args); } return self::getPassedValue ($key, $default, 'C', $filter, $args); }
[ "public", "static", "function", "fromCookie", "(", "$", "key", ",", "$", "default", "=", "null", ",", "$", "filter", "=", "null", ",", "$", "args", "=", "array", "(", ")", ")", "{", "if", "(", "!", "$", "key", ")", "{", "return", "self", "::", ...
Wrapper for COOKIE input @param string $key The input field to return. @param mixed $default The value to return if the requested field is not found (optional) (default=false). @param string $filter The filter directive to apply to the retrieved input (optional) (default=null) @param array $args The filter p...
[ "Wrapper", "for", "COOKIE", "input" ]
train
https://github.com/innobrig/flex-input/blob/81db6cd22820d310d35be9a71d545dafffb21c64/src/Input.php#L33-L40
innobrig/flex-input
src/Input.php
Input.fromDelete
public static function fromDelete ($key, $default=null, $filter=null, $args=array()) { if (!$key) { $values = array(); parse_str (file_get_contents("php://input"), $values); return self::filterArray ($values, $filter, $args); } return self::getPassedValue...
php
public static function fromDelete ($key, $default=null, $filter=null, $args=array()) { if (!$key) { $values = array(); parse_str (file_get_contents("php://input"), $values); return self::filterArray ($values, $filter, $args); } return self::getPassedValue...
[ "public", "static", "function", "fromDelete", "(", "$", "key", ",", "$", "default", "=", "null", ",", "$", "filter", "=", "null", ",", "$", "args", "=", "array", "(", ")", ")", "{", "if", "(", "!", "$", "key", ")", "{", "$", "values", "=", "arr...
Wrapper for DELETE input @param string $key The input field to return. @param mixed $default The value to return if the requested field is not found (optional) (default=false). @param string $filter The filter directive to apply to the retrieved input (optional) (default=null) @param array $args The filter p...
[ "Wrapper", "for", "DELETE", "input" ]
train
https://github.com/innobrig/flex-input/blob/81db6cd22820d310d35be9a71d545dafffb21c64/src/Input.php#L54-L63
innobrig/flex-input
src/Input.php
Input.fromFiles
public static function fromFiles ($key, $default=null, $filter=null, $args=array()) { if (!$key) { return self::filterArray ($_FILES, $filter, $args); } return self::getPassedValue ($key, $default, 'F', $filter, $args); }
php
public static function fromFiles ($key, $default=null, $filter=null, $args=array()) { if (!$key) { return self::filterArray ($_FILES, $filter, $args); } return self::getPassedValue ($key, $default, 'F', $filter, $args); }
[ "public", "static", "function", "fromFiles", "(", "$", "key", ",", "$", "default", "=", "null", ",", "$", "filter", "=", "null", ",", "$", "args", "=", "array", "(", ")", ")", "{", "if", "(", "!", "$", "key", ")", "{", "return", "self", "::", "...
Wrapper for FILES input @param string $key The input field to return. @param mixed $default The value to return if the requested field is not found (optional) (default=false). @param string $filter The filter directive to apply to the retrieved input (optional) (default=null) @param array $args The filter pr...
[ "Wrapper", "for", "FILES", "input" ]
train
https://github.com/innobrig/flex-input/blob/81db6cd22820d310d35be9a71d545dafffb21c64/src/Input.php#L77-L84
innobrig/flex-input
src/Input.php
Input.fromGet
public static function fromGet ($key, $default=null, $filter=null, $args=array()) { if (!$key) { return self::filterArray ($_GET, $filter, $args); } return self::getPassedValue ($key, $default, 'G', $filter, $args); }
php
public static function fromGet ($key, $default=null, $filter=null, $args=array()) { if (!$key) { return self::filterArray ($_GET, $filter, $args); } return self::getPassedValue ($key, $default, 'G', $filter, $args); }
[ "public", "static", "function", "fromGet", "(", "$", "key", ",", "$", "default", "=", "null", ",", "$", "filter", "=", "null", ",", "$", "args", "=", "array", "(", ")", ")", "{", "if", "(", "!", "$", "key", ")", "{", "return", "self", "::", "fi...
Wrapper for GET input @param string $key The input field to return. @param mixed $default The value to return if the requested field is not found (optional) (default=false). @param string $filter The filter directive to apply to the retrieved input (optional) (default=null) @param array $args The filter proc...
[ "Wrapper", "for", "GET", "input" ]
train
https://github.com/innobrig/flex-input/blob/81db6cd22820d310d35be9a71d545dafffb21c64/src/Input.php#L98-L105
innobrig/flex-input
src/Input.php
Input.fromPost
public static function fromPost ($key, $default=null, $filter=null, $args=array()) { if (!$key) { return self::filterArray ($_POST, $filter, $args); } return self::getPassedValue ($key, $default, 'P', $filter, $args); }
php
public static function fromPost ($key, $default=null, $filter=null, $args=array()) { if (!$key) { return self::filterArray ($_POST, $filter, $args); } return self::getPassedValue ($key, $default, 'P', $filter, $args); }
[ "public", "static", "function", "fromPost", "(", "$", "key", ",", "$", "default", "=", "null", ",", "$", "filter", "=", "null", ",", "$", "args", "=", "array", "(", ")", ")", "{", "if", "(", "!", "$", "key", ")", "{", "return", "self", "::", "f...
Wrapper for POST input @param string $key The input field to return. @param mixed $default The value to return if the requested field is not found (optional) (default=false). @param string $filter The filter directive to apply to the retrieved input (optional) (default=null) @param array $args The filter pro...
[ "Wrapper", "for", "POST", "input" ]
train
https://github.com/innobrig/flex-input/blob/81db6cd22820d310d35be9a71d545dafffb21c64/src/Input.php#L119-L126
innobrig/flex-input
src/Input.php
Input.fromRequest
public static function fromRequest ($key, $default=null, $filter=null, $args=array()) { if (!$key) { return self::filterArray ($_REQUEST, $filter, $args); } return self::getPassedValue ($key, $default, 'R', $filter, $args); }
php
public static function fromRequest ($key, $default=null, $filter=null, $args=array()) { if (!$key) { return self::filterArray ($_REQUEST, $filter, $args); } return self::getPassedValue ($key, $default, 'R', $filter, $args); }
[ "public", "static", "function", "fromRequest", "(", "$", "key", ",", "$", "default", "=", "null", ",", "$", "filter", "=", "null", ",", "$", "args", "=", "array", "(", ")", ")", "{", "if", "(", "!", "$", "key", ")", "{", "return", "self", "::", ...
Wrapper for REQUEST input @param string $key The input field to return. @param mixed $default The value to return if the requested field is not found (optional) (default=false). @param string $filter The filter directive to apply to the retrieved input (optional) (default=null) @param array $args The filter ...
[ "Wrapper", "for", "REQUEST", "input" ]
train
https://github.com/innobrig/flex-input/blob/81db6cd22820d310d35be9a71d545dafffb21c64/src/Input.php#L184-L191
innobrig/flex-input
src/Input.php
Input.getPassedValue
public static function getPassedValue ($key, $default=null, $source=null, $filter=null, $args=array(), $doTrim=true) { if (!$key) { throw new \Exception ('Empty key passed to Input::getPassedValue()'); } if (!$source) { $source = 'REQUEST'; } else { ...
php
public static function getPassedValue ($key, $default=null, $source=null, $filter=null, $args=array(), $doTrim=true) { if (!$key) { throw new \Exception ('Empty key passed to Input::getPassedValue()'); } if (!$source) { $source = 'REQUEST'; } else { ...
[ "public", "static", "function", "getPassedValue", "(", "$", "key", ",", "$", "default", "=", "null", ",", "$", "source", "=", "null", ",", "$", "filter", "=", "null", ",", "$", "args", "=", "array", "(", ")", ",", "$", "doTrim", "=", "true", ")", ...
Return the requested key using filter_var() from input in a safe way. This function is safe to use for recursive arrays and either returns a non-empty string (or array) or the (optional) default. @param string $key The input field to return. @param mixed $default The value to return if the requested field is not...
[ "Return", "the", "requested", "key", "using", "filter_var", "()", "from", "input", "in", "a", "safe", "way", "." ]
train
https://github.com/innobrig/flex-input/blob/81db6cd22820d310d35be9a71d545dafffb21c64/src/Input.php#L209-L319
innobrig/flex-input
src/Input.php
Input.filterArray
protected static function filterArray (array $values, $filter=null, $args=array(), $doTrim=true) { if (!$values) { return $values; } if (!$filter) { $filter = self::$defaultFilter; } if (!$args) { $args = array ('flags' => self::$defaultF...
php
protected static function filterArray (array $values, $filter=null, $args=array(), $doTrim=true) { if (!$values) { return $values; } if (!$filter) { $filter = self::$defaultFilter; } if (!$args) { $args = array ('flags' => self::$defaultF...
[ "protected", "static", "function", "filterArray", "(", "array", "$", "values", ",", "$", "filter", "=", "null", ",", "$", "args", "=", "array", "(", ")", ",", "$", "doTrim", "=", "true", ")", "{", "if", "(", "!", "$", "values", ")", "{", "return", ...
Filter an array item by item. This function is recursive array safe. @param array $values The array to filter @param string $filter The filter directive to apply to the retrieved input (optional) (default=null) @param array $args The filter processing args to apply (optional) (default=array()) @param bool $do...
[ "Filter", "an", "array", "item", "by", "item", ".", "This", "function", "is", "recursive", "array", "safe", "." ]
train
https://github.com/innobrig/flex-input/blob/81db6cd22820d310d35be9a71d545dafffb21c64/src/Input.php#L332-L355
innobrig/flex-input
src/Input.php
Input.decodeEntites
public static function decodeEntites ($data, $fields) { if (!$data) { return $data; } if (!is_array ($fields)) { $fields = [$fields]; } if (!is_array ($data)) { foreach ($fields as $field) { if (is_object($data) && isset($...
php
public static function decodeEntites ($data, $fields) { if (!$data) { return $data; } if (!is_array ($fields)) { $fields = [$fields]; } if (!is_array ($data)) { foreach ($fields as $field) { if (is_object($data) && isset($...
[ "public", "static", "function", "decodeEntites", "(", "$", "data", ",", "$", "fields", ")", "{", "if", "(", "!", "$", "data", ")", "{", "return", "$", "data", ";", "}", "if", "(", "!", "is_array", "(", "$", "fields", ")", ")", "{", "$", "fields",...
Decode previously encoded HTML entiries WARNING: Only do this if you know you can trust the received input, this is not safe for user-submitted content! @param mixed $data The field|array|object to decode @param bool $fields The array|object fields to decode @return mixed The data with html decoded entities
[ "Decode", "previously", "encoded", "HTML", "entiries", "WARNING", ":", "Only", "do", "this", "if", "you", "know", "you", "can", "trust", "the", "received", "input", "this", "is", "not", "safe", "for", "user", "-", "submitted", "content!" ]
train
https://github.com/innobrig/flex-input/blob/81db6cd22820d310d35be9a71d545dafffb21c64/src/Input.php#L385-L416
Wonail/wocenter
traits/LoadModelTrait.php
LoadModelTrait.loadModel
protected function loadModel($modelClass, $id, $throwException = true, $config = []) { if (!class_exists($modelClass)) { throw new InvalidConfigException("Model Class `{$modelClass}` does not exists"); } $model = $modelClass::findOne($id); if (!is_object($model)) { ...
php
protected function loadModel($modelClass, $id, $throwException = true, $config = []) { if (!class_exists($modelClass)) { throw new InvalidConfigException("Model Class `{$modelClass}` does not exists"); } $model = $modelClass::findOne($id); if (!is_object($model)) { ...
[ "protected", "function", "loadModel", "(", "$", "modelClass", ",", "$", "id", ",", "$", "throwException", "=", "true", ",", "$", "config", "=", "[", "]", ")", "{", "if", "(", "!", "class_exists", "(", "$", "modelClass", ")", ")", "{", "throw", "new",...
根据模型主键获取相关数据,如果数据不存在,则抛出400异常 @param \yii\db\ActiveRecord|string $modelClass 模型对象 @param integer $id 主键ID @param boolean $throwException 是否允许抛出异常 @param array $config 配置模型属性 e.g. ['scenario' => 'update'] @return null|\yii\db\ActiveRecord @throws InvalidConfigException @throws NotFoundHttpException if the model cannot...
[ "根据模型主键获取相关数据,如果数据不存在,则抛出400异常" ]
train
https://github.com/Wonail/wocenter/blob/186c15aad008d32fbf5ad75256cf01581dccf9e6/traits/LoadModelTrait.php#L29-L47
puli/twig-extension
src/CacheWarmer/TwigTemplateCacheWarmer.php
TwigTemplateCacheWarmer.warmUp
public function warmUp($cacheDir) { $iterator = new ResourceFilterIterator( new RecursiveResourceIteratorIterator( new ResourceCollectionIterator( $this->repo->get('/')->listChildren(), ResourceCollectionIterator::CURRENT_AS_PATH ...
php
public function warmUp($cacheDir) { $iterator = new ResourceFilterIterator( new RecursiveResourceIteratorIterator( new ResourceCollectionIterator( $this->repo->get('/')->listChildren(), ResourceCollectionIterator::CURRENT_AS_PATH ...
[ "public", "function", "warmUp", "(", "$", "cacheDir", ")", "{", "$", "iterator", "=", "new", "ResourceFilterIterator", "(", "new", "RecursiveResourceIteratorIterator", "(", "new", "ResourceCollectionIterator", "(", "$", "this", "->", "repo", "->", "get", "(", "'...
Warms up the cache. @param string $cacheDir The cache directory @throws RuntimeException If setEnvironment() wasn't called
[ "Warms", "up", "the", "cache", "." ]
train
https://github.com/puli/twig-extension/blob/b19fce610aa9fda5d86c73045ed5b9d378c47b93/src/CacheWarmer/TwigTemplateCacheWarmer.php#L59-L80
christeredvartsen/sysinfo
src/SysInfo/Linux/Disk.php
Disk.sumField
private function sumField($devices = null, $partitions = null, $field) { $result = 0; if ($devices) { $devices = (array) $devices; } if (is_array($devices)) { $devices = array_flip($devices); } if ($partitions) { $partitions = (array...
php
private function sumField($devices = null, $partitions = null, $field) { $result = 0; if ($devices) { $devices = (array) $devices; } if (is_array($devices)) { $devices = array_flip($devices); } if ($partitions) { $partitions = (array...
[ "private", "function", "sumField", "(", "$", "devices", "=", "null", ",", "$", "partitions", "=", "null", ",", "$", "field", ")", "{", "$", "result", "=", "0", ";", "if", "(", "$", "devices", ")", "{", "$", "devices", "=", "(", "array", ")", "$",...
Calcuate a sum @param string|string[] $devices The name of the device to fetch, for instance "sda", or an array of device names: array('hda', 'hdb'). @param int|int[] $partitions Which partition(s) to fetch info about. @return int
[ "Calcuate", "a", "sum" ]
train
https://github.com/christeredvartsen/sysinfo/blob/f1a8acb2997a41b52e9da970e5db041acd5b2ea3/src/SysInfo/Linux/Disk.php#L86-L120
huasituo/hstcms
src/Providers/GeneratorServiceProvider.php
GeneratorServiceProvider.register
public function register() { $generators = [ 'command.make.hstcms' => \Huasituo\Hstcms\Console\Generators\MakeInstallCommand::class, 'command.make.hstcms.manage.founder' => \Huasituo\Hstcms\Console\Generators\MakeManageFounderCommand::class, 'command....
php
public function register() { $generators = [ 'command.make.hstcms' => \Huasituo\Hstcms\Console\Generators\MakeInstallCommand::class, 'command.make.hstcms.manage.founder' => \Huasituo\Hstcms\Console\Generators\MakeManageFounderCommand::class, 'command....
[ "public", "function", "register", "(", ")", "{", "$", "generators", "=", "[", "'command.make.hstcms'", "=>", "\\", "Huasituo", "\\", "Hstcms", "\\", "Console", "\\", "Generators", "\\", "MakeInstallCommand", "::", "class", ",", "'command.make.hstcms.manage.founder'"...
Register the application services.
[ "Register", "the", "application", "services", "." ]
train
https://github.com/huasituo/hstcms/blob/12819979289e58ce38e3e92540aeeb16e205e525/src/Providers/GeneratorServiceProvider.php#L24-L38
movoin/one-swoole
src/Context/Payload.php
Payload.withCode
public function withCode(int $code): PayloadInterface { if ($this->code === $code) { return $this; } $clone = clone $this; $clone->code = $code; return $clone; }
php
public function withCode(int $code): PayloadInterface { if ($this->code === $code) { return $this; } $clone = clone $this; $clone->code = $code; return $clone; }
[ "public", "function", "withCode", "(", "int", "$", "code", ")", ":", "PayloadInterface", "{", "if", "(", "$", "this", "->", "code", "===", "$", "code", ")", "{", "return", "$", "this", ";", "}", "$", "clone", "=", "clone", "$", "this", ";", "$", ...
根据指定状态码克隆一个新的基本数据 @param int $code @return \One\Context\Contracts\Payload
[ "根据指定状态码克隆一个新的基本数据" ]
train
https://github.com/movoin/one-swoole/blob/b9b175963ead91416cc50902a04e05ff3ef571de/src/Context/Payload.php#L88-L98
movoin/one-swoole
src/Context/Payload.php
Payload.withMessage
public function withMessage(string $message): PayloadInterface { if ($this->message === $message) { return $this; } $clone = clone $this; $clone->message = $message; return $clone; }
php
public function withMessage(string $message): PayloadInterface { if ($this->message === $message) { return $this; } $clone = clone $this; $clone->message = $message; return $clone; }
[ "public", "function", "withMessage", "(", "string", "$", "message", ")", ":", "PayloadInterface", "{", "if", "(", "$", "this", "->", "message", "===", "$", "message", ")", "{", "return", "$", "this", ";", "}", "$", "clone", "=", "clone", "$", "this", ...
根据指定的消息数组克隆一个新的基本数据 @param string $message @return \One\Context\Contracts\Payload
[ "根据指定的消息数组克隆一个新的基本数据" ]
train
https://github.com/movoin/one-swoole/blob/b9b175963ead91416cc50902a04e05ff3ef571de/src/Context/Payload.php#L117-L127
movoin/one-swoole
src/Context/Payload.php
Payload.withData
public function withData($data): PayloadInterface { if ($this->data === $data) { return $this; } $clone = clone $this; $clone->data = $data; return $clone; }
php
public function withData($data): PayloadInterface { if ($this->data === $data) { return $this; } $clone = clone $this; $clone->data = $data; return $clone; }
[ "public", "function", "withData", "(", "$", "data", ")", ":", "PayloadInterface", "{", "if", "(", "$", "this", "->", "data", "===", "$", "data", ")", "{", "return", "$", "this", ";", "}", "$", "clone", "=", "clone", "$", "this", ";", "$", "clone", ...
根据指定的输出数组克隆一个新的基本数据 @param mixed $data @return \One\Context\Contracts\Payload
[ "根据指定的输出数组克隆一个新的基本数据" ]
train
https://github.com/movoin/one-swoole/blob/b9b175963ead91416cc50902a04e05ff3ef571de/src/Context/Payload.php#L146-L156
movoin/one-swoole
src/Context/Payload.php
Payload.withError
public function withError(string $error): PayloadInterface { if ($this->error === $error) { return $this; } $clone = clone $this; $clone->error = $error; return $clone; }
php
public function withError(string $error): PayloadInterface { if ($this->error === $error) { return $this; } $clone = clone $this; $clone->error = $error; return $clone; }
[ "public", "function", "withError", "(", "string", "$", "error", ")", ":", "PayloadInterface", "{", "if", "(", "$", "this", "->", "error", "===", "$", "error", ")", "{", "return", "$", "this", ";", "}", "$", "clone", "=", "clone", "$", "this", ";", ...
根据指定的错误数组克隆一个新的基本数据 @param string $error @return \One\Context\Contracts\Payload
[ "根据指定的错误数组克隆一个新的基本数据" ]
train
https://github.com/movoin/one-swoole/blob/b9b175963ead91416cc50902a04e05ff3ef571de/src/Context/Payload.php#L175-L185
movoin/one-swoole
src/Context/Payload.php
Payload.withOptions
public function withOptions(array $options): PayloadInterface { if ($this->options === $options) { return $this; } $clone = clone $this; $clone->options = $options; return $clone; }
php
public function withOptions(array $options): PayloadInterface { if ($this->options === $options) { return $this; } $clone = clone $this; $clone->options = $options; return $clone; }
[ "public", "function", "withOptions", "(", "array", "$", "options", ")", ":", "PayloadInterface", "{", "if", "(", "$", "this", "->", "options", "===", "$", "options", ")", "{", "return", "$", "this", ";", "}", "$", "clone", "=", "clone", "$", "this", ...
根据指定的选项数组克隆一个新的基本数据 @param array $options @return \One\Context\Contracts\Payload
[ "根据指定的选项数组克隆一个新的基本数据" ]
train
https://github.com/movoin/one-swoole/blob/b9b175963ead91416cc50902a04e05ff3ef571de/src/Context/Payload.php#L204-L214
movoin/one-swoole
src/Context/Payload.php
Payload.toArray
public function toArray(): array { $payload = [ 'code' => $this->getCode() ]; if (! empty($this->getMessage())) { $payload['message'] = $this->getMessage(); } if (! empty($this->getError())) { $payload['error'] = $this->getError(); ...
php
public function toArray(): array { $payload = [ 'code' => $this->getCode() ]; if (! empty($this->getMessage())) { $payload['message'] = $this->getMessage(); } if (! empty($this->getError())) { $payload['error'] = $this->getError(); ...
[ "public", "function", "toArray", "(", ")", ":", "array", "{", "$", "payload", "=", "[", "'code'", "=>", "$", "this", "->", "getCode", "(", ")", "]", ";", "if", "(", "!", "empty", "(", "$", "this", "->", "getMessage", "(", ")", ")", ")", "{", "$...
获得数组内容 @return array
[ "获得数组内容" ]
train
https://github.com/movoin/one-swoole/blob/b9b175963ead91416cc50902a04e05ff3ef571de/src/Context/Payload.php#L231-L254
shawnsandy/ui-pages
src/Controllers/GithubLoginController.php
GithubLoginController.handleAuth
public function handleAuth(Request $request) { try { $user = Socialite::with('github')->stateless()->user(); } catch (Exception $e) { return redirect('/dash-login'); } $request->session()->put( config('pagekit.session_key', 'pagekit_session'), [ ...
php
public function handleAuth(Request $request) { try { $user = Socialite::with('github')->stateless()->user(); } catch (Exception $e) { return redirect('/dash-login'); } $request->session()->put( config('pagekit.session_key', 'pagekit_session'), [ ...
[ "public", "function", "handleAuth", "(", "Request", "$", "request", ")", "{", "try", "{", "$", "user", "=", "Socialite", "::", "with", "(", "'github'", ")", "->", "stateless", "(", ")", "->", "user", "(", ")", ";", "}", "catch", "(", "Exception", "$"...
Handles the request from the provider @param Request $request @return Redirect
[ "Handles", "the", "request", "from", "the", "provider" ]
train
https://github.com/shawnsandy/ui-pages/blob/11584c12fa3e2b9a5c513f4ec9e2eaf78c206ca8/src/Controllers/GithubLoginController.php#L50-L68
shawnsandy/ui-pages
src/Controllers/GithubLoginController.php
GithubLoginController.loginUser
protected function loginUser($user) { $this->session->put( config('pagekit.session_key', 'pagekit_session'), [ 'github_id' => $user->id, 'github_name' => $user->name, 'github_email' => $user->email ] ); $this->sessio...
php
protected function loginUser($user) { $this->session->put( config('pagekit.session_key', 'pagekit_session'), [ 'github_id' => $user->id, 'github_name' => $user->name, 'github_email' => $user->email ] ); $this->sessio...
[ "protected", "function", "loginUser", "(", "$", "user", ")", "{", "$", "this", "->", "session", "->", "put", "(", "config", "(", "'pagekit.session_key'", ",", "'pagekit_session'", ")", ",", "[", "'github_id'", "=>", "$", "user", "->", "id", ",", "'github_n...
Checks if the user credentials matches the credentials stored in the config @param $user
[ "Checks", "if", "the", "user", "credentials", "matches", "the", "credentials", "stored", "in", "the", "config" ]
train
https://github.com/shawnsandy/ui-pages/blob/11584c12fa3e2b9a5c513f4ec9e2eaf78c206ca8/src/Controllers/GithubLoginController.php#L76-L87
gregorybesson/PlaygroundCore
src/TwitterCard/Config.php
Config.getTags
public function getTags($useDefault = null) { if (is_null($useDefault)) { $useDefault = $this->useDefault; } $tags = array(); foreach ($this->tags as $tag) { if (!array_key_exists($tag->getProperty(), $tags)) { $tags[$tag->getProperty()] = $tag...
php
public function getTags($useDefault = null) { if (is_null($useDefault)) { $useDefault = $this->useDefault; } $tags = array(); foreach ($this->tags as $tag) { if (!array_key_exists($tag->getProperty(), $tags)) { $tags[$tag->getProperty()] = $tag...
[ "public", "function", "getTags", "(", "$", "useDefault", "=", "null", ")", "{", "if", "(", "is_null", "(", "$", "useDefault", ")", ")", "{", "$", "useDefault", "=", "$", "this", "->", "useDefault", ";", "}", "$", "tags", "=", "array", "(", ")", ";"...
return the tags merged with the defaults @return array
[ "return", "the", "tags", "merged", "with", "the", "defaults" ]
train
https://github.com/gregorybesson/PlaygroundCore/blob/f8dfa4c7660b54354933b3c28c0cf35304a649df/src/TwitterCard/Config.php#L89-L108
WellCommerce/CoreBundle
Helper/Request/RequestHelper.php
RequestHelper.getCurrentRequest
public function getCurrentRequest() { if (null === $this->request) { $this->request = $this->requestStack->getMasterRequest(); } return $this->request; }
php
public function getCurrentRequest() { if (null === $this->request) { $this->request = $this->requestStack->getMasterRequest(); } return $this->request; }
[ "public", "function", "getCurrentRequest", "(", ")", "{", "if", "(", "null", "===", "$", "this", "->", "request", ")", "{", "$", "this", "->", "request", "=", "$", "this", "->", "requestStack", "->", "getMasterRequest", "(", ")", ";", "}", "return", "$...
{@inheritdoc}
[ "{" ]
train
https://github.com/WellCommerce/CoreBundle/blob/984fbd544d4b10cf11e54e0f3c304d100deb6842/Helper/Request/RequestHelper.php#L55-L62
WellCommerce/CoreBundle
Helper/Request/RequestHelper.php
RequestHelper.getSessionAttribute
public function getSessionAttribute(string $name, $default = null) { if (null !== $this->getCurrentRequest() && $this->request->hasSession()) { return $this->request->getSession()->get($name, $default); } return $default; }
php
public function getSessionAttribute(string $name, $default = null) { if (null !== $this->getCurrentRequest() && $this->request->hasSession()) { return $this->request->getSession()->get($name, $default); } return $default; }
[ "public", "function", "getSessionAttribute", "(", "string", "$", "name", ",", "$", "default", "=", "null", ")", "{", "if", "(", "null", "!==", "$", "this", "->", "getCurrentRequest", "(", ")", "&&", "$", "this", "->", "request", "->", "hasSession", "(", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/WellCommerce/CoreBundle/blob/984fbd544d4b10cf11e54e0f3c304d100deb6842/Helper/Request/RequestHelper.php#L79-L86
WellCommerce/CoreBundle
Helper/Request/RequestHelper.php
RequestHelper.setSessionAttribute
public function setSessionAttribute(string $name, $value) { if (null === $this->getCurrentRequest() || false === $this->request->hasSession()) { throw new \LogicException('Cannot set session attributes without valid session.'); } return $this->request->getSession()->set(...
php
public function setSessionAttribute(string $name, $value) { if (null === $this->getCurrentRequest() || false === $this->request->hasSession()) { throw new \LogicException('Cannot set session attributes without valid session.'); } return $this->request->getSession()->set(...
[ "public", "function", "setSessionAttribute", "(", "string", "$", "name", ",", "$", "value", ")", "{", "if", "(", "null", "===", "$", "this", "->", "getCurrentRequest", "(", ")", "||", "false", "===", "$", "this", "->", "request", "->", "hasSession", "(",...
{@inheritdoc}
[ "{" ]
train
https://github.com/WellCommerce/CoreBundle/blob/984fbd544d4b10cf11e54e0f3c304d100deb6842/Helper/Request/RequestHelper.php#L91-L98
WellCommerce/CoreBundle
Helper/Request/RequestHelper.php
RequestHelper.hasSessionAttribute
public function hasSessionAttribute(string $name): bool { if (null !== $this->getCurrentRequest() && $this->request->hasSession()) { return $this->request->getSession()->has($name); } return false; }
php
public function hasSessionAttribute(string $name): bool { if (null !== $this->getCurrentRequest() && $this->request->hasSession()) { return $this->request->getSession()->has($name); } return false; }
[ "public", "function", "hasSessionAttribute", "(", "string", "$", "name", ")", ":", "bool", "{", "if", "(", "null", "!==", "$", "this", "->", "getCurrentRequest", "(", ")", "&&", "$", "this", "->", "request", "->", "hasSession", "(", ")", ")", "{", "ret...
{@inheritdoc}
[ "{" ]
train
https://github.com/WellCommerce/CoreBundle/blob/984fbd544d4b10cf11e54e0f3c304d100deb6842/Helper/Request/RequestHelper.php#L103-L110
WellCommerce/CoreBundle
Helper/Request/RequestHelper.php
RequestHelper.getSessionId
public function getSessionId(): string { if (null !== $this->getCurrentRequest() && $this->request->hasSession()) { return $this->request->getSession()->getId(); } return ''; }
php
public function getSessionId(): string { if (null !== $this->getCurrentRequest() && $this->request->hasSession()) { return $this->request->getSession()->getId(); } return ''; }
[ "public", "function", "getSessionId", "(", ")", ":", "string", "{", "if", "(", "null", "!==", "$", "this", "->", "getCurrentRequest", "(", ")", "&&", "$", "this", "->", "request", "->", "hasSession", "(", ")", ")", "{", "return", "$", "this", "->", "...
{@inheritdoc}
[ "{" ]
train
https://github.com/WellCommerce/CoreBundle/blob/984fbd544d4b10cf11e54e0f3c304d100deb6842/Helper/Request/RequestHelper.php#L115-L122
WellCommerce/CoreBundle
Helper/Request/RequestHelper.php
RequestHelper.getSessionName
public function getSessionName(): string { if (null !== $this->getCurrentRequest() && $this->request->hasSession()) { return $this->request->getSession()->getName(); } return ''; }
php
public function getSessionName(): string { if (null !== $this->getCurrentRequest() && $this->request->hasSession()) { return $this->request->getSession()->getName(); } return ''; }
[ "public", "function", "getSessionName", "(", ")", ":", "string", "{", "if", "(", "null", "!==", "$", "this", "->", "getCurrentRequest", "(", ")", "&&", "$", "this", "->", "request", "->", "hasSession", "(", ")", ")", "{", "return", "$", "this", "->", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/WellCommerce/CoreBundle/blob/984fbd544d4b10cf11e54e0f3c304d100deb6842/Helper/Request/RequestHelper.php#L127-L134
WellCommerce/CoreBundle
Helper/Request/RequestHelper.php
RequestHelper.hasRequestBagParam
public function hasRequestBagParam(string $name): bool { if ($this->getCurrentRequest() instanceof Request) { return $this->request->request->has($name); } return false; }
php
public function hasRequestBagParam(string $name): bool { if ($this->getCurrentRequest() instanceof Request) { return $this->request->request->has($name); } return false; }
[ "public", "function", "hasRequestBagParam", "(", "string", "$", "name", ")", ":", "bool", "{", "if", "(", "$", "this", "->", "getCurrentRequest", "(", ")", "instanceof", "Request", ")", "{", "return", "$", "this", "->", "request", "->", "request", "->", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/WellCommerce/CoreBundle/blob/984fbd544d4b10cf11e54e0f3c304d100deb6842/Helper/Request/RequestHelper.php#L139-L146
WellCommerce/CoreBundle
Helper/Request/RequestHelper.php
RequestHelper.hasRequestBagParams
public function hasRequestBagParams(array $params = []): bool { foreach ($params as $param) { if (!$this->hasRequestBagParam($param)) { return false; } } return true; }
php
public function hasRequestBagParams(array $params = []): bool { foreach ($params as $param) { if (!$this->hasRequestBagParam($param)) { return false; } } return true; }
[ "public", "function", "hasRequestBagParams", "(", "array", "$", "params", "=", "[", "]", ")", ":", "bool", "{", "foreach", "(", "$", "params", "as", "$", "param", ")", "{", "if", "(", "!", "$", "this", "->", "hasRequestBagParam", "(", "$", "param", "...
{@inheritdoc}
[ "{" ]
train
https://github.com/WellCommerce/CoreBundle/blob/984fbd544d4b10cf11e54e0f3c304d100deb6842/Helper/Request/RequestHelper.php#L151-L160
WellCommerce/CoreBundle
Helper/Request/RequestHelper.php
RequestHelper.getRequestBagParam
public function getRequestBagParam(string $name, $default = null, int $filter = FILTER_SANITIZE_SPECIAL_CHARS) { if (false === $this->hasRequestBagParam($name)) { return $default; } return $this->request->request->filter($name, $default, $filter); }
php
public function getRequestBagParam(string $name, $default = null, int $filter = FILTER_SANITIZE_SPECIAL_CHARS) { if (false === $this->hasRequestBagParam($name)) { return $default; } return $this->request->request->filter($name, $default, $filter); }
[ "public", "function", "getRequestBagParam", "(", "string", "$", "name", ",", "$", "default", "=", "null", ",", "int", "$", "filter", "=", "FILTER_SANITIZE_SPECIAL_CHARS", ")", "{", "if", "(", "false", "===", "$", "this", "->", "hasRequestBagParam", "(", "$",...
{@inheritdoc}
[ "{" ]
train
https://github.com/WellCommerce/CoreBundle/blob/984fbd544d4b10cf11e54e0f3c304d100deb6842/Helper/Request/RequestHelper.php#L165-L172
WellCommerce/CoreBundle
Helper/Request/RequestHelper.php
RequestHelper.getQueryBagParam
public function getQueryBagParam(string $name, $default = null, int $filter = FILTER_SANITIZE_SPECIAL_CHARS) { if (null === $this->getCurrentRequest() || false === $this->request->query->has($name)) { return $default; } return $this->request->query->filter($name, $defaul...
php
public function getQueryBagParam(string $name, $default = null, int $filter = FILTER_SANITIZE_SPECIAL_CHARS) { if (null === $this->getCurrentRequest() || false === $this->request->query->has($name)) { return $default; } return $this->request->query->filter($name, $defaul...
[ "public", "function", "getQueryBagParam", "(", "string", "$", "name", ",", "$", "default", "=", "null", ",", "int", "$", "filter", "=", "FILTER_SANITIZE_SPECIAL_CHARS", ")", "{", "if", "(", "null", "===", "$", "this", "->", "getCurrentRequest", "(", ")", "...
{@inheritdoc}
[ "{" ]
train
https://github.com/WellCommerce/CoreBundle/blob/984fbd544d4b10cf11e54e0f3c304d100deb6842/Helper/Request/RequestHelper.php#L177-L184
WellCommerce/CoreBundle
Helper/Request/RequestHelper.php
RequestHelper.hasAttributesBagParam
public function hasAttributesBagParam(string $name): bool { if ($this->getCurrentRequest() instanceof Request) { return $this->request->attributes->has($name); } return false; }
php
public function hasAttributesBagParam(string $name): bool { if ($this->getCurrentRequest() instanceof Request) { return $this->request->attributes->has($name); } return false; }
[ "public", "function", "hasAttributesBagParam", "(", "string", "$", "name", ")", ":", "bool", "{", "if", "(", "$", "this", "->", "getCurrentRequest", "(", ")", "instanceof", "Request", ")", "{", "return", "$", "this", "->", "request", "->", "attributes", "-...
{@inheritdoc}
[ "{" ]
train
https://github.com/WellCommerce/CoreBundle/blob/984fbd544d4b10cf11e54e0f3c304d100deb6842/Helper/Request/RequestHelper.php#L189-L196
WellCommerce/CoreBundle
Helper/Request/RequestHelper.php
RequestHelper.hasAttributesBagParams
public function hasAttributesBagParams(array $params = []): bool { foreach ($params as $param) { if (!$this->hasAttributesBagParam($param)) { return false; } } return true; }
php
public function hasAttributesBagParams(array $params = []): bool { foreach ($params as $param) { if (!$this->hasAttributesBagParam($param)) { return false; } } return true; }
[ "public", "function", "hasAttributesBagParams", "(", "array", "$", "params", "=", "[", "]", ")", ":", "bool", "{", "foreach", "(", "$", "params", "as", "$", "param", ")", "{", "if", "(", "!", "$", "this", "->", "hasAttributesBagParam", "(", "$", "param...
{@inheritdoc}
[ "{" ]
train
https://github.com/WellCommerce/CoreBundle/blob/984fbd544d4b10cf11e54e0f3c304d100deb6842/Helper/Request/RequestHelper.php#L201-L210
WellCommerce/CoreBundle
Helper/Request/RequestHelper.php
RequestHelper.getAttributesBagParam
public function getAttributesBagParam(string $name, $default = null, int $filter = FILTER_SANITIZE_SPECIAL_CHARS) { if (false === $this->hasAttributesBagParam($name)) { return $default; } return $this->request->attributes->filter($name, $default, $filter); }
php
public function getAttributesBagParam(string $name, $default = null, int $filter = FILTER_SANITIZE_SPECIAL_CHARS) { if (false === $this->hasAttributesBagParam($name)) { return $default; } return $this->request->attributes->filter($name, $default, $filter); }
[ "public", "function", "getAttributesBagParam", "(", "string", "$", "name", ",", "$", "default", "=", "null", ",", "int", "$", "filter", "=", "FILTER_SANITIZE_SPECIAL_CHARS", ")", "{", "if", "(", "false", "===", "$", "this", "->", "hasAttributesBagParam", "(", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/WellCommerce/CoreBundle/blob/984fbd544d4b10cf11e54e0f3c304d100deb6842/Helper/Request/RequestHelper.php#L215-L222
WellCommerce/CoreBundle
Helper/Request/RequestHelper.php
RequestHelper.getCurrentLocale
public function getCurrentLocale(): string { if (null !== $this->getCurrentRequest()) { return $this->getCurrentRequest()->getLocale(); } return $this->fallbackLocale; }
php
public function getCurrentLocale(): string { if (null !== $this->getCurrentRequest()) { return $this->getCurrentRequest()->getLocale(); } return $this->fallbackLocale; }
[ "public", "function", "getCurrentLocale", "(", ")", ":", "string", "{", "if", "(", "null", "!==", "$", "this", "->", "getCurrentRequest", "(", ")", ")", "{", "return", "$", "this", "->", "getCurrentRequest", "(", ")", "->", "getLocale", "(", ")", ";", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/WellCommerce/CoreBundle/blob/984fbd544d4b10cf11e54e0f3c304d100deb6842/Helper/Request/RequestHelper.php#L227-L234
sokil/php-rest
src/Sokil/Rest/Client/Factory.php
Factory.getConnection
public function getConnection() { if(!$this->_connection) { $this->_connection = new \Guzzle\Http\Client($this->getHost()); } return $this->_connection; }
php
public function getConnection() { if(!$this->_connection) { $this->_connection = new \Guzzle\Http\Client($this->getHost()); } return $this->_connection; }
[ "public", "function", "getConnection", "(", ")", "{", "if", "(", "!", "$", "this", "->", "_connection", ")", "{", "$", "this", "->", "_connection", "=", "new", "\\", "Guzzle", "\\", "Http", "\\", "Client", "(", "$", "this", "->", "getHost", "(", ")",...
Get Guzzle RESTful client @return \Guzzle\Http\Client
[ "Get", "Guzzle", "RESTful", "client" ]
train
https://github.com/sokil/php-rest/blob/5399d4ca38d3595de68598605d3d0d70f7ecfc7b/src/Sokil/Rest/Client/Factory.php#L63-L70
huasituo/hstcms
src/Libraries/Fields/Textarea.php
Textarea.option
public function option($option) { $option['width'] = isset($option['width']) ? $option['width'] : 300; $option['height'] = isset($option['height']) ? $option['height'] : 100; $option['value'] = isset($option['value']) ? $option['value'] : ''; $option['fvalue'] = isset($option['fvalue']) ? $option['fvalue'] : ...
php
public function option($option) { $option['width'] = isset($option['width']) ? $option['width'] : 300; $option['height'] = isset($option['height']) ? $option['height'] : 100; $option['value'] = isset($option['value']) ? $option['value'] : ''; $option['fvalue'] = isset($option['fvalue']) ? $option['fvalue'] : ...
[ "public", "function", "option", "(", "$", "option", ")", "{", "$", "option", "[", "'width'", "]", "=", "isset", "(", "$", "option", "[", "'width'", "]", ")", "?", "$", "option", "[", "'width'", "]", ":", "300", ";", "$", "option", "[", "'height'", ...
字段相关属性参数 @param array $value 值 @return string
[ "字段相关属性参数" ]
train
https://github.com/huasituo/hstcms/blob/12819979289e58ce38e3e92540aeeb16e205e525/src/Libraries/Fields/Textarea.php#L32-L56
prooph/link-app-core
src/Service/SystemConfigProvider.php
SystemConfigProvider.initialize
public function initialize($instance, ServiceLocatorInterface $serviceLocator) { if ($instance instanceof NeedsSystemConfig) { if ($serviceLocator instanceof ControllerManager) { $serviceLocator = $serviceLocator->getServiceLocator(); } $instance->setSyste...
php
public function initialize($instance, ServiceLocatorInterface $serviceLocator) { if ($instance instanceof NeedsSystemConfig) { if ($serviceLocator instanceof ControllerManager) { $serviceLocator = $serviceLocator->getServiceLocator(); } $instance->setSyste...
[ "public", "function", "initialize", "(", "$", "instance", ",", "ServiceLocatorInterface", "$", "serviceLocator", ")", "{", "if", "(", "$", "instance", "instanceof", "NeedsSystemConfig", ")", "{", "if", "(", "$", "serviceLocator", "instanceof", "ControllerManager", ...
Initialize @param $instance @param ServiceLocatorInterface $serviceLocator @return mixed
[ "Initialize" ]
train
https://github.com/prooph/link-app-core/blob/835a5945dfa7be7b2cebfa6e84e757ecfd783357/src/Service/SystemConfigProvider.php#L35-L43
geo6/php-text-tools
src/Text.php
Text.diff
public static function diff($old, $new): array { if (!is_array($old)) { $old = preg_split("/[\s]+/", $old); } if (!is_array($new)) { $new = preg_split("/[\s]+/", $new); } $oldNormalized = array_map(function (string $str) { return strtouppe...
php
public static function diff($old, $new): array { if (!is_array($old)) { $old = preg_split("/[\s]+/", $old); } if (!is_array($new)) { $new = preg_split("/[\s]+/", $new); } $oldNormalized = array_map(function (string $str) { return strtouppe...
[ "public", "static", "function", "diff", "(", "$", "old", ",", "$", "new", ")", ":", "array", "{", "if", "(", "!", "is_array", "(", "$", "old", ")", ")", "{", "$", "old", "=", "preg_split", "(", "\"/[\\s]+/\"", ",", "$", "old", ")", ";", "}", "i...
@author Paul Butler <github@paulbutler.org> @author Mike Robinson @author Jonathan Beliën <jbe@geo6.be> @see https://github.com/paulgb/simplediff/blob/master/php/simplediff.php @param string|array $old @param string|array $new
[ "@author", "Paul", "Butler", "<github@paulbutler", ".", "org", ">", "@author", "Mike", "Robinson", "@author", "Jonathan", "Beliën", "<jbe@geo6", ".", "be", ">" ]
train
https://github.com/geo6/php-text-tools/blob/f50fd42cfb323ae32dce58d5c1d44398d0102f08/src/Text.php#L27-L73
geo6/php-text-tools
src/Text.php
Text.renderDiff
public static function renderDiff(array $diff): array { $returnOld = ''; $returnNew = ''; foreach ($diff as $k) { if (is_array($k)) { $returnOld .= (!empty($k['deleted']) ? '<del>'.implode(' ', $k['deleted']).'</del> ' : ''); $returnNew .= (!empty...
php
public static function renderDiff(array $diff): array { $returnOld = ''; $returnNew = ''; foreach ($diff as $k) { if (is_array($k)) { $returnOld .= (!empty($k['deleted']) ? '<del>'.implode(' ', $k['deleted']).'</del> ' : ''); $returnNew .= (!empty...
[ "public", "static", "function", "renderDiff", "(", "array", "$", "diff", ")", ":", "array", "{", "$", "returnOld", "=", "''", ";", "$", "returnNew", "=", "''", ";", "foreach", "(", "$", "diff", "as", "$", "k", ")", "{", "if", "(", "is_array", "(", ...
@author Paul Butler <github@paulbutler.org> @author Mike Robinson @author Jonathan Beliën <jbe@geo6.be> @see https://github.com/paulgb/simplediff/blob/master/php/simplediff.php
[ "@author", "Paul", "Butler", "<github@paulbutler", ".", "org", ">", "@author", "Mike", "Robinson", "@author", "Jonathan", "Beliën", "<jbe@geo6", ".", "be", ">" ]
train
https://github.com/geo6/php-text-tools/blob/f50fd42cfb323ae32dce58d5c1d44398d0102f08/src/Text.php#L82-L101
puli/discovery
src/InMemoryDiscovery.php
InMemoryDiscovery.addBindingType
public function addBindingType(BindingType $type) { if (isset($this->types[$type->getName()])) { throw DuplicateTypeException::forTypeName($type->getName()); } $this->types[$type->getName()] = $type; }
php
public function addBindingType(BindingType $type) { if (isset($this->types[$type->getName()])) { throw DuplicateTypeException::forTypeName($type->getName()); } $this->types[$type->getName()] = $type; }
[ "public", "function", "addBindingType", "(", "BindingType", "$", "type", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "types", "[", "$", "type", "->", "getName", "(", ")", "]", ")", ")", "{", "throw", "DuplicateTypeException", "::", "forTypeName...
{@inheritdoc}
[ "{" ]
train
https://github.com/puli/discovery/blob/975f5e099563f1096bfabc17fbe4d1816408ad98/src/InMemoryDiscovery.php#L44-L51
puli/discovery
src/InMemoryDiscovery.php
InMemoryDiscovery.removeBindingType
public function removeBindingType($typeName) { Assert::stringNotEmpty($typeName, 'The type class must be a non-empty string. Got: %s'); unset($this->types[$typeName]); $this->removeBindingsWithTypeName($typeName); }
php
public function removeBindingType($typeName) { Assert::stringNotEmpty($typeName, 'The type class must be a non-empty string. Got: %s'); unset($this->types[$typeName]); $this->removeBindingsWithTypeName($typeName); }
[ "public", "function", "removeBindingType", "(", "$", "typeName", ")", "{", "Assert", "::", "stringNotEmpty", "(", "$", "typeName", ",", "'The type class must be a non-empty string. Got: %s'", ")", ";", "unset", "(", "$", "this", "->", "types", "[", "$", "typeName"...
{@inheritdoc}
[ "{" ]
train
https://github.com/puli/discovery/blob/975f5e099563f1096bfabc17fbe4d1816408ad98/src/InMemoryDiscovery.php#L56-L63
puli/discovery
src/InMemoryDiscovery.php
InMemoryDiscovery.getBindingType
public function getBindingType($typeName) { Assert::stringNotEmpty($typeName, 'The type class must be a non-empty string. Got: %s'); if (!isset($this->types[$typeName])) { throw NoSuchTypeException::forTypeName($typeName); } return $this->types[$typeName]; }
php
public function getBindingType($typeName) { Assert::stringNotEmpty($typeName, 'The type class must be a non-empty string. Got: %s'); if (!isset($this->types[$typeName])) { throw NoSuchTypeException::forTypeName($typeName); } return $this->types[$typeName]; }
[ "public", "function", "getBindingType", "(", "$", "typeName", ")", "{", "Assert", "::", "stringNotEmpty", "(", "$", "typeName", ",", "'The type class must be a non-empty string. Got: %s'", ")", ";", "if", "(", "!", "isset", "(", "$", "this", "->", "types", "[", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/puli/discovery/blob/975f5e099563f1096bfabc17fbe4d1816408ad98/src/InMemoryDiscovery.php#L87-L96
puli/discovery
src/InMemoryDiscovery.php
InMemoryDiscovery.addBinding
public function addBinding(Binding $binding) { $typeName = $binding->getTypeName(); $this->initializeBinding($binding); $this->bindingsByTypeName[$typeName][] = $binding; }
php
public function addBinding(Binding $binding) { $typeName = $binding->getTypeName(); $this->initializeBinding($binding); $this->bindingsByTypeName[$typeName][] = $binding; }
[ "public", "function", "addBinding", "(", "Binding", "$", "binding", ")", "{", "$", "typeName", "=", "$", "binding", "->", "getTypeName", "(", ")", ";", "$", "this", "->", "initializeBinding", "(", "$", "binding", ")", ";", "$", "this", "->", "bindingsByT...
{@inheritdoc}
[ "{" ]
train
https://github.com/puli/discovery/blob/975f5e099563f1096bfabc17fbe4d1816408ad98/src/InMemoryDiscovery.php#L117-L124
puli/discovery
src/InMemoryDiscovery.php
InMemoryDiscovery.findBindings
public function findBindings($typeName, Expression $expr = null) { Assert::stringNotEmpty($typeName, 'The type class must be a non-empty string. Got: %s'); if (!isset($this->bindingsByTypeName[$typeName])) { return array(); } $bindings = $this->bindingsByTypeName[$typeN...
php
public function findBindings($typeName, Expression $expr = null) { Assert::stringNotEmpty($typeName, 'The type class must be a non-empty string. Got: %s'); if (!isset($this->bindingsByTypeName[$typeName])) { return array(); } $bindings = $this->bindingsByTypeName[$typeN...
[ "public", "function", "findBindings", "(", "$", "typeName", ",", "Expression", "$", "expr", "=", "null", ")", "{", "Assert", "::", "stringNotEmpty", "(", "$", "typeName", ",", "'The type class must be a non-empty string. Got: %s'", ")", ";", "if", "(", "!", "iss...
{@inheritdoc}
[ "{" ]
train
https://github.com/puli/discovery/blob/975f5e099563f1096bfabc17fbe4d1816408ad98/src/InMemoryDiscovery.php#L129-L144
puli/discovery
src/InMemoryDiscovery.php
InMemoryDiscovery.getBindings
public function getBindings() { $bindings = array(); foreach ($this->bindingsByTypeName as $bindingsOfType) { foreach ($bindingsOfType as $binding) { $bindings[] = $binding; } } return $bindings; }
php
public function getBindings() { $bindings = array(); foreach ($this->bindingsByTypeName as $bindingsOfType) { foreach ($bindingsOfType as $binding) { $bindings[] = $binding; } } return $bindings; }
[ "public", "function", "getBindings", "(", ")", "{", "$", "bindings", "=", "array", "(", ")", ";", "foreach", "(", "$", "this", "->", "bindingsByTypeName", "as", "$", "bindingsOfType", ")", "{", "foreach", "(", "$", "bindingsOfType", "as", "$", "binding", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/puli/discovery/blob/975f5e099563f1096bfabc17fbe4d1816408ad98/src/InMemoryDiscovery.php#L149-L160
puli/discovery
src/InMemoryDiscovery.php
InMemoryDiscovery.removeBindingsThatMatch
protected function removeBindingsThatMatch(Expression $expr) { foreach ($this->bindingsByTypeName as $typeName => $bindings) { foreach ($bindings as $key => $binding) { if ($expr->evaluate($binding)) { unset($this->bindingsByTypeName[$typeName][$key]); ...
php
protected function removeBindingsThatMatch(Expression $expr) { foreach ($this->bindingsByTypeName as $typeName => $bindings) { foreach ($bindings as $key => $binding) { if ($expr->evaluate($binding)) { unset($this->bindingsByTypeName[$typeName][$key]); ...
[ "protected", "function", "removeBindingsThatMatch", "(", "Expression", "$", "expr", ")", "{", "foreach", "(", "$", "this", "->", "bindingsByTypeName", "as", "$", "typeName", "=>", "$", "bindings", ")", "{", "foreach", "(", "$", "bindings", "as", "$", "key", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/puli/discovery/blob/975f5e099563f1096bfabc17fbe4d1816408ad98/src/InMemoryDiscovery.php#L173-L186
puli/discovery
src/InMemoryDiscovery.php
InMemoryDiscovery.removeBindingsWithTypeNameThatMatch
protected function removeBindingsWithTypeNameThatMatch($typeName, Expression $expr) { if (!isset($this->bindingsByTypeName[$typeName])) { return; } foreach ($this->bindingsByTypeName[$typeName] as $key => $binding) { if ($expr->evaluate($binding)) { u...
php
protected function removeBindingsWithTypeNameThatMatch($typeName, Expression $expr) { if (!isset($this->bindingsByTypeName[$typeName])) { return; } foreach ($this->bindingsByTypeName[$typeName] as $key => $binding) { if ($expr->evaluate($binding)) { u...
[ "protected", "function", "removeBindingsWithTypeNameThatMatch", "(", "$", "typeName", ",", "Expression", "$", "expr", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "bindingsByTypeName", "[", "$", "typeName", "]", ")", ")", "{", "return", ";", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/puli/discovery/blob/975f5e099563f1096bfabc17fbe4d1816408ad98/src/InMemoryDiscovery.php#L203-L218
puli/discovery
src/InMemoryDiscovery.php
InMemoryDiscovery.hasBindingsThatMatch
protected function hasBindingsThatMatch(Expression $expr) { foreach ($this->bindingsByTypeName as $typeName => $bindings) { foreach ($bindings as $key => $binding) { if ($expr->evaluate($binding)) { return true; } } } ...
php
protected function hasBindingsThatMatch(Expression $expr) { foreach ($this->bindingsByTypeName as $typeName => $bindings) { foreach ($bindings as $key => $binding) { if ($expr->evaluate($binding)) { return true; } } } ...
[ "protected", "function", "hasBindingsThatMatch", "(", "Expression", "$", "expr", ")", "{", "foreach", "(", "$", "this", "->", "bindingsByTypeName", "as", "$", "typeName", "=>", "$", "bindings", ")", "{", "foreach", "(", "$", "bindings", "as", "$", "key", "...
{@inheritdoc}
[ "{" ]
train
https://github.com/puli/discovery/blob/975f5e099563f1096bfabc17fbe4d1816408ad98/src/InMemoryDiscovery.php#L231-L242
puli/discovery
src/InMemoryDiscovery.php
InMemoryDiscovery.hasBindingsWithTypeNameThatMatch
protected function hasBindingsWithTypeNameThatMatch($typeName, Expression $expr) { if (!isset($this->bindingsByTypeName[$typeName])) { return false; } foreach ($this->bindingsByTypeName[$typeName] as $binding) { if ($expr->evaluate($binding)) { return...
php
protected function hasBindingsWithTypeNameThatMatch($typeName, Expression $expr) { if (!isset($this->bindingsByTypeName[$typeName])) { return false; } foreach ($this->bindingsByTypeName[$typeName] as $binding) { if ($expr->evaluate($binding)) { return...
[ "protected", "function", "hasBindingsWithTypeNameThatMatch", "(", "$", "typeName", ",", "Expression", "$", "expr", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "bindingsByTypeName", "[", "$", "typeName", "]", ")", ")", "{", "return", "false", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/puli/discovery/blob/975f5e099563f1096bfabc17fbe4d1816408ad98/src/InMemoryDiscovery.php#L255-L268
goblindegook/Syllables
src/Template/Loader/Taxonomy.php
Taxonomy._prepare_filter
protected function _prepare_filter() { $term = \get_queried_object(); if ( ! empty( $term->slug ) && ! empty( $term->taxonomy ) ) { $this->term = $term->slug; $this->taxonomy = $term->taxonomy; } }
php
protected function _prepare_filter() { $term = \get_queried_object(); if ( ! empty( $term->slug ) && ! empty( $term->taxonomy ) ) { $this->term = $term->slug; $this->taxonomy = $term->taxonomy; } }
[ "protected", "function", "_prepare_filter", "(", ")", "{", "$", "term", "=", "\\", "get_queried_object", "(", ")", ";", "if", "(", "!", "empty", "(", "$", "term", "->", "slug", ")", "&&", "!", "empty", "(", "$", "term", "->", "taxonomy", ")", ")", ...
Prepares the object when the filter is applied. @uses \get_queried_object() @codeCoverageIgnore
[ "Prepares", "the", "object", "when", "the", "filter", "is", "applied", "." ]
train
https://github.com/goblindegook/Syllables/blob/1a98cd15e37595a85b242242f88fee38c4e36acc/src/Template/Loader/Taxonomy.php#L53-L60
goblindegook/Syllables
src/Template/Loader/Taxonomy.php
Taxonomy._should_load_template
protected function _should_load_template() { return ( \is_tax() || \is_category() || \is_tag() ) && ! empty( $this->term ) && in_array( $this->taxonomy, $this->taxonomies ); }
php
protected function _should_load_template() { return ( \is_tax() || \is_category() || \is_tag() ) && ! empty( $this->term ) && in_array( $this->taxonomy, $this->taxonomies ); }
[ "protected", "function", "_should_load_template", "(", ")", "{", "return", "(", "\\", "is_tax", "(", ")", "||", "\\", "is_category", "(", ")", "||", "\\", "is_tag", "(", ")", ")", "&&", "!", "empty", "(", "$", "this", "->", "term", ")", "&&", "in_arr...
Determines whether a custom template for a taxonomy term should be loaded. @return boolean Whether a custom template should be loaded. @uses \is_category() @uses \is_tag() @uses \is_tax() @codeCoverageIgnore
[ "Determines", "whether", "a", "custom", "template", "for", "a", "taxonomy", "term", "should", "be", "loaded", "." ]
train
https://github.com/goblindegook/Syllables/blob/1a98cd15e37595a85b242242f88fee38c4e36acc/src/Template/Loader/Taxonomy.php#L73-L77
movoin/one-swoole
example/app/Actions/MiddlewareAcmeAction.php
MiddlewareAcmeAction.run
protected function run(Request $request) { $payload = new Payload; if ($request->get('acme') === 1) { $payload = $payload->withMessage('Acme Interceptor is work'); } return $payload; }
php
protected function run(Request $request) { $payload = new Payload; if ($request->get('acme') === 1) { $payload = $payload->withMessage('Acme Interceptor is work'); } return $payload; }
[ "protected", "function", "run", "(", "Request", "$", "request", ")", "{", "$", "payload", "=", "new", "Payload", ";", "if", "(", "$", "request", "->", "get", "(", "'acme'", ")", "===", "1", ")", "{", "$", "payload", "=", "$", "payload", "->", "with...
响应请求 @param \One\Protocol\Contracts\Request $request @return \One\Context\Contracts\Payload
[ "响应请求" ]
train
https://github.com/movoin/one-swoole/blob/b9b175963ead91416cc50902a04e05ff3ef571de/example/app/Actions/MiddlewareAcmeAction.php#L34-L43
activecollab/databasestructure
src/Builder/BaseTypeClassBuilder.php
BaseTypeClassBuilder.buildFields
private function buildFields(array $fields, $indent, array &$result) { $stringified_field_names = []; $fields_with_default_value = []; foreach ($fields as $field) { if ($field instanceof ScalarField && $field->getShouldBeAddedToModel()) { $stringified_field_names...
php
private function buildFields(array $fields, $indent, array &$result) { $stringified_field_names = []; $fields_with_default_value = []; foreach ($fields as $field) { if ($field instanceof ScalarField && $field->getShouldBeAddedToModel()) { $stringified_field_names...
[ "private", "function", "buildFields", "(", "array", "$", "fields", ",", "$", "indent", ",", "array", "&", "$", "result", ")", "{", "$", "stringified_field_names", "=", "[", "]", ";", "$", "fields_with_default_value", "=", "[", "]", ";", "foreach", "(", "...
Build field definitions. @param FieldInterface[] $fields @param string $indent @param array $result
[ "Build", "field", "definitions", "." ]
train
https://github.com/activecollab/databasestructure/blob/4b2353c4422186bcfce63b3212da3e70e63eb5df/src/Builder/BaseTypeClassBuilder.php#L273-L311
activecollab/databasestructure
src/Builder/BaseTypeClassBuilder.php
BaseTypeClassBuilder.buildGeneratedFields
public function buildGeneratedFields(array $generated_field_names, $indent, array &$result) { $result[] = ''; $result[] = $indent . '/**'; $result[] = $indent . ' * Generated fields that are loaded, but not managed by the entity..'; $result[] = $indent . ' *'; $result[] = $in...
php
public function buildGeneratedFields(array $generated_field_names, $indent, array &$result) { $result[] = ''; $result[] = $indent . '/**'; $result[] = $indent . ' * Generated fields that are loaded, but not managed by the entity..'; $result[] = $indent . ' *'; $result[] = $in...
[ "public", "function", "buildGeneratedFields", "(", "array", "$", "generated_field_names", ",", "$", "indent", ",", "array", "&", "$", "result", ")", "{", "$", "result", "[", "]", "=", "''", ";", "$", "result", "[", "]", "=", "$", "indent", ".", "'/**'"...
Build a list of generated fields. @param string[] $generated_field_names @param string $indent @param array $result
[ "Build", "a", "list", "of", "generated", "fields", "." ]
train
https://github.com/activecollab/databasestructure/blob/4b2353c4422186bcfce63b3212da3e70e63eb5df/src/Builder/BaseTypeClassBuilder.php#L320-L331
activecollab/databasestructure
src/Builder/BaseTypeClassBuilder.php
BaseTypeClassBuilder.buildGeneratedFieldGetter
private function buildGeneratedFieldGetter($field_name, $caster, $indent, array &$result) { $short_getter = null; switch ($caster) { case ValueCasterInterface::CAST_INT: $return_type = 'int'; break; case ValueCasterInterface::CAST_FLOAT: ...
php
private function buildGeneratedFieldGetter($field_name, $caster, $indent, array &$result) { $short_getter = null; switch ($caster) { case ValueCasterInterface::CAST_INT: $return_type = 'int'; break; case ValueCasterInterface::CAST_FLOAT: ...
[ "private", "function", "buildGeneratedFieldGetter", "(", "$", "field_name", ",", "$", "caster", ",", "$", "indent", ",", "array", "&", "$", "result", ")", "{", "$", "short_getter", "=", "null", ";", "switch", "(", "$", "caster", ")", "{", "case", "ValueC...
Build getter for generated field. @param string $field_name @param string $caster @param string $indent @param array $result
[ "Build", "getter", "for", "generated", "field", "." ]
train
https://github.com/activecollab/databasestructure/blob/4b2353c4422186bcfce63b3212da3e70e63eb5df/src/Builder/BaseTypeClassBuilder.php#L466-L528
activecollab/databasestructure
src/Builder/BaseTypeClassBuilder.php
BaseTypeClassBuilder.useShortGetterName
private function useShortGetterName($field_name) { return substr($field_name, 0, 3) === 'is_' || in_array(substr($field_name, 0, 4), ['has_', 'had_', 'was_']) || in_array(substr($field_name, 0, 5), ['were_', 'have_']); }
php
private function useShortGetterName($field_name) { return substr($field_name, 0, 3) === 'is_' || in_array(substr($field_name, 0, 4), ['has_', 'had_', 'was_']) || in_array(substr($field_name, 0, 5), ['were_', 'have_']); }
[ "private", "function", "useShortGetterName", "(", "$", "field_name", ")", "{", "return", "substr", "(", "$", "field_name", ",", "0", ",", "3", ")", "===", "'is_'", "||", "in_array", "(", "substr", "(", "$", "field_name", ",", "0", ",", "4", ")", ",", ...
Return true if we should use a short getter name. @param string $field_name @return bool
[ "Return", "true", "if", "we", "should", "use", "a", "short", "getter", "name", "." ]
train
https://github.com/activecollab/databasestructure/blob/4b2353c4422186bcfce63b3212da3e70e63eb5df/src/Builder/BaseTypeClassBuilder.php#L536-L539
activecollab/databasestructure
src/Builder/BaseTypeClassBuilder.php
BaseTypeClassBuilder.buildJsonSerialize
private function buildJsonSerialize(array $serialize, $indent, array &$result) { if (count($serialize)) { $result[] = ''; $result[] = $indent . '/**'; $result[] = $indent . ' * Prepare object properties so they can be serialized to JSON.'; $result[] = $indent ...
php
private function buildJsonSerialize(array $serialize, $indent, array &$result) { if (count($serialize)) { $result[] = ''; $result[] = $indent . '/**'; $result[] = $indent . ' * Prepare object properties so they can be serialized to JSON.'; $result[] = $indent ...
[ "private", "function", "buildJsonSerialize", "(", "array", "$", "serialize", ",", "$", "indent", ",", "array", "&", "$", "result", ")", "{", "if", "(", "count", "(", "$", "serialize", ")", ")", "{", "$", "result", "[", "]", "=", "''", ";", "$", "re...
Build JSON serialize method, if we need to serialize extra fields. @param array $serialize @param string $indent @param array $result
[ "Build", "JSON", "serialize", "method", "if", "we", "need", "to", "serialize", "extra", "fields", "." ]
train
https://github.com/activecollab/databasestructure/blob/4b2353c4422186bcfce63b3212da3e70e63eb5df/src/Builder/BaseTypeClassBuilder.php#L548-L568
activecollab/databasestructure
src/Builder/BaseTypeClassBuilder.php
BaseTypeClassBuilder.buildValidatePresenceLinesForScalarField
private function buildValidatePresenceLinesForScalarField(ScalarField $field, $line_indent, array &$validator_lines) { if ($field instanceof RequiredInterface && $field instanceof UniqueInterface) { if ($field->isRequired() && $field->isUnique()) { $validator_lines[] = $line_inde...
php
private function buildValidatePresenceLinesForScalarField(ScalarField $field, $line_indent, array &$validator_lines) { if ($field instanceof RequiredInterface && $field instanceof UniqueInterface) { if ($field->isRequired() && $field->isUnique()) { $validator_lines[] = $line_inde...
[ "private", "function", "buildValidatePresenceLinesForScalarField", "(", "ScalarField", "$", "field", ",", "$", "line_indent", ",", "array", "&", "$", "validator_lines", ")", "{", "if", "(", "$", "field", "instanceof", "RequiredInterface", "&&", "$", "field", "inst...
Build validate lines for scalar fields. @param ScalarField $field @param string $line_indent @param array $validator_lines
[ "Build", "validate", "lines", "for", "scalar", "fields", "." ]
train
https://github.com/activecollab/databasestructure/blob/4b2353c4422186bcfce63b3212da3e70e63eb5df/src/Builder/BaseTypeClassBuilder.php#L628-L643
activecollab/databasestructure
src/Builder/BaseTypeClassBuilder.php
BaseTypeClassBuilder.buildValidateUniquenessLine
private function buildValidateUniquenessLine($field_name, array $context) { $field_names = [var_export($field_name, true)]; foreach ($context as $v) { $field_names[] = var_export($v, true); } return '$validator->unique(' . implode(', ', $field_names) . ');'; }
php
private function buildValidateUniquenessLine($field_name, array $context) { $field_names = [var_export($field_name, true)]; foreach ($context as $v) { $field_names[] = var_export($v, true); } return '$validator->unique(' . implode(', ', $field_names) . ');'; }
[ "private", "function", "buildValidateUniquenessLine", "(", "$", "field_name", ",", "array", "$", "context", ")", "{", "$", "field_names", "=", "[", "var_export", "(", "$", "field_name", ",", "true", ")", "]", ";", "foreach", "(", "$", "context", "as", "$",...
Build validator uniqueness line. @param string $field_name @param array $context @return string
[ "Build", "validator", "uniqueness", "line", "." ]
train
https://github.com/activecollab/databasestructure/blob/4b2353c4422186bcfce63b3212da3e70e63eb5df/src/Builder/BaseTypeClassBuilder.php#L663-L672
huasituo/hstcms
src/Libraries/HstcmsEmail.php
HstcmsEmail.sendMail
static function sendMail($data, $view) { $res = Mail::send( $view, ['data' => $data], function ($message) use ($data) { $message->to($data['email'])->subject($data['title']); }); return $res ? true : false; }
php
static function sendMail($data, $view) { $res = Mail::send( $view, ['data' => $data], function ($message) use ($data) { $message->to($data['email'])->subject($data['title']); }); return $res ? true : false; }
[ "static", "function", "sendMail", "(", "$", "data", ",", "$", "view", ")", "{", "$", "res", "=", "Mail", "::", "send", "(", "$", "view", ",", "[", "'data'", "=>", "$", "data", "]", ",", "function", "(", "$", "message", ")", "use", "(", "$", "da...
发送邮件 @param array $data @param str $view @return bool
[ "发送邮件" ]
train
https://github.com/huasituo/hstcms/blob/12819979289e58ce38e3e92540aeeb16e205e525/src/Libraries/HstcmsEmail.php#L26-L33
e0ipso/drupal-unit-autoload
src/AutoloaderBootstrap.php
AutoloaderBootstrap.register
public function register() { if ($this->checkLoadedAutoloader()) { return; } // Parse the composer.json. $composer_config = $this->getConfig(); $this->registerDrupalPaths($composer_config); $this->registerPsr($composer_config); }
php
public function register() { if ($this->checkLoadedAutoloader()) { return; } // Parse the composer.json. $composer_config = $this->getConfig(); $this->registerDrupalPaths($composer_config); $this->registerPsr($composer_config); }
[ "public", "function", "register", "(", ")", "{", "if", "(", "$", "this", "->", "checkLoadedAutoloader", "(", ")", ")", "{", "return", ";", "}", "// Parse the composer.json.", "$", "composer_config", "=", "$", "this", "->", "getConfig", "(", ")", ";", "$", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/e0ipso/drupal-unit-autoload/blob/7ce147b269c7333eca31e2cd04b736d6274b9cbf/src/AutoloaderBootstrap.php#L72-L80
e0ipso/drupal-unit-autoload
src/AutoloaderBootstrap.php
AutoloaderBootstrap.registerDrupalPaths
protected function registerDrupalPaths($composer_config) { if (empty($composer_config['class-location'])) { return; } $this->loader->setClassMap((array) $composer_config['class-location']); $this->load(); }
php
protected function registerDrupalPaths($composer_config) { if (empty($composer_config['class-location'])) { return; } $this->loader->setClassMap((array) $composer_config['class-location']); $this->load(); }
[ "protected", "function", "registerDrupalPaths", "(", "$", "composer_config", ")", "{", "if", "(", "empty", "(", "$", "composer_config", "[", "'class-location'", "]", ")", ")", "{", "return", ";", "}", "$", "this", "->", "loader", "->", "setClassMap", "(", ...
Register the path based autoloader. @param object $composer_config The Composer configuration.
[ "Register", "the", "path", "based", "autoloader", "." ]
train
https://github.com/e0ipso/drupal-unit-autoload/blob/7ce147b269c7333eca31e2cd04b736d6274b9cbf/src/AutoloaderBootstrap.php#L102-L108
e0ipso/drupal-unit-autoload
src/AutoloaderBootstrap.php
AutoloaderBootstrap.registerPsr
protected function registerPsr(array $composer_config) { $psr0 = $psr4 = array(); if (!empty($composer_config['psr-0'])) { $psr0 = (array) $composer_config['psr-0']; } if (!empty($composer_config['psr-4'])) { $psr4 = (array) $composer_config['psr-4']; } if (empty($psr4) && empty($psr...
php
protected function registerPsr(array $composer_config) { $psr0 = $psr4 = array(); if (!empty($composer_config['psr-0'])) { $psr0 = (array) $composer_config['psr-0']; } if (!empty($composer_config['psr-4'])) { $psr4 = (array) $composer_config['psr-4']; } if (empty($psr4) && empty($psr...
[ "protected", "function", "registerPsr", "(", "array", "$", "composer_config", ")", "{", "$", "psr0", "=", "$", "psr4", "=", "array", "(", ")", ";", "if", "(", "!", "empty", "(", "$", "composer_config", "[", "'psr-0'", "]", ")", ")", "{", "$", "psr0",...
Use Composer's autoloader to register the PRS-0 and PSR-4 paths. @param array $composer_config The Composer configuration.
[ "Use", "Composer", "s", "autoloader", "to", "register", "the", "PRS", "-", "0", "and", "PSR", "-", "4", "paths", "." ]
train
https://github.com/e0ipso/drupal-unit-autoload/blob/7ce147b269c7333eca31e2cd04b736d6274b9cbf/src/AutoloaderBootstrap.php#L116-L132
e0ipso/drupal-unit-autoload
src/AutoloaderBootstrap.php
AutoloaderBootstrap.getConfig
public function getConfig() { // Initialize empty configuration. $config = [ 'psr-0' => [], 'psr-4' => [], 'class-location' => [], ]; // Find the tokenized paths. $psrs = array( 'psr-0' => $this->classLoader->getPrefixes(), 'psr-4' => $this->classLoader->getPrefixesPsr...
php
public function getConfig() { // Initialize empty configuration. $config = [ 'psr-0' => [], 'psr-4' => [], 'class-location' => [], ]; // Find the tokenized paths. $psrs = array( 'psr-0' => $this->classLoader->getPrefixes(), 'psr-4' => $this->classLoader->getPrefixesPsr...
[ "public", "function", "getConfig", "(", ")", "{", "// Initialize empty configuration.", "$", "config", "=", "[", "'psr-0'", "=>", "[", "]", ",", "'psr-4'", "=>", "[", "]", ",", "'class-location'", "=>", "[", "]", ",", "]", ";", "// Find the tokenized paths.", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/e0ipso/drupal-unit-autoload/blob/7ce147b269c7333eca31e2cd04b736d6274b9cbf/src/AutoloaderBootstrap.php#L145-L192
gintonicweb/GintonicCMS
src/Controller/Admin/UsersController.php
UsersController.beforeFilter
public function beforeFilter(Event $event) { $this->Users->hasOne('Roles', [ 'className' => 'Permissions.Roles', ]); $action = $this->Crud->action(); $action->config('scaffold.fields_blacklist', ['password', 'token']); $action->config('scaffold.fields', [ ...
php
public function beforeFilter(Event $event) { $this->Users->hasOne('Roles', [ 'className' => 'Permissions.Roles', ]); $action = $this->Crud->action(); $action->config('scaffold.fields_blacklist', ['password', 'token']); $action->config('scaffold.fields', [ ...
[ "public", "function", "beforeFilter", "(", "Event", "$", "event", ")", "{", "$", "this", "->", "Users", "->", "hasOne", "(", "'Roles'", ",", "[", "'className'", "=>", "'Permissions.Roles'", ",", "]", ")", ";", "$", "action", "=", "$", "this", "->", "Cr...
{@inheritDoc}
[ "{" ]
train
https://github.com/gintonicweb/GintonicCMS/blob/b34445fecea56a7d432d0f3e2f988cde8ead746b/src/Controller/Admin/UsersController.php#L24-L49
gintonicweb/GintonicCMS
src/Controller/Admin/UsersController.php
UsersController.index
public function index() { $action = $this->Crud->action(); $action->config('scaffold.fields_blacklist', ['created', 'modified']); $this->Crud->execute(); }
php
public function index() { $action = $this->Crud->action(); $action->config('scaffold.fields_blacklist', ['created', 'modified']); $this->Crud->execute(); }
[ "public", "function", "index", "(", ")", "{", "$", "action", "=", "$", "this", "->", "Crud", "->", "action", "(", ")", ";", "$", "action", "->", "config", "(", "'scaffold.fields_blacklist'", ",", "[", "'created'", ",", "'modified'", "]", ")", ";", "$",...
Index method Don't show created and modified fields @return void
[ "Index", "method", "Don", "t", "show", "created", "and", "modified", "fields" ]
train
https://github.com/gintonicweb/GintonicCMS/blob/b34445fecea56a7d432d0f3e2f988cde8ead746b/src/Controller/Admin/UsersController.php#L57-L62
gintonicweb/GintonicCMS
src/Controller/Admin/UsersController.php
UsersController.view
public function view() { $action = $this->Crud->action(); $action->config('scaffold.relations', false); $this->Crud->execute(); }
php
public function view() { $action = $this->Crud->action(); $action->config('scaffold.relations', false); $this->Crud->execute(); }
[ "public", "function", "view", "(", ")", "{", "$", "action", "=", "$", "this", "->", "Crud", "->", "action", "(", ")", ";", "$", "action", "->", "config", "(", "'scaffold.relations'", ",", "false", ")", ";", "$", "this", "->", "Crud", "->", "execute",...
View method Related models are blacklisted because the role is already present in the main user panel @return void
[ "View", "method", "Related", "models", "are", "blacklisted", "because", "the", "role", "is", "already", "present", "in", "the", "main", "user", "panel" ]
train
https://github.com/gintonicweb/GintonicCMS/blob/b34445fecea56a7d432d0f3e2f988cde8ead746b/src/Controller/Admin/UsersController.php#L71-L76
fuelphp/display
src/Parser/HandlebarsLoader.php
HandlebarsLoader.findView
public function findView($name) { if (substr($name, -11) !== '.handlebars' && substr($name, -4) !== '.hbs') { $name = $this->prefix . $name . '.handlebars'; } if ( ! $file = parent::findView($name)) { throw new ViewNotFoundException('Could not locate: '.$name); } return $file; }
php
public function findView($name) { if (substr($name, -11) !== '.handlebars' && substr($name, -4) !== '.hbs') { $name = $this->prefix . $name . '.handlebars'; } if ( ! $file = parent::findView($name)) { throw new ViewNotFoundException('Could not locate: '.$name); } return $file; }
[ "public", "function", "findView", "(", "$", "name", ")", "{", "if", "(", "substr", "(", "$", "name", ",", "-", "11", ")", "!==", "'.handlebars'", "&&", "substr", "(", "$", "name", ",", "-", "4", ")", "!==", "'.hbs'", ")", "{", "$", "name", "=", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/fuelphp/display/blob/d9a3eddbf80f0fd81beb40d9f4507600ac6611a4/src/Parser/HandlebarsLoader.php#L52-L65
tequila/mongodb-php-lib
src/Query.php
Query.getOptions
public function getOptions(Server $server) { if (isset($this->options['collation']) && !$server->supportsCollation()) { throw new UnsupportedException( 'Option "collation" is not supported by the server.' ); } if (isset($this->options['readConcern']))...
php
public function getOptions(Server $server) { if (isset($this->options['collation']) && !$server->supportsCollation()) { throw new UnsupportedException( 'Option "collation" is not supported by the server.' ); } if (isset($this->options['readConcern']))...
[ "public", "function", "getOptions", "(", "Server", "$", "server", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "options", "[", "'collation'", "]", ")", "&&", "!", "$", "server", "->", "supportsCollation", "(", ")", ")", "{", "throw", "new", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/tequila/mongodb-php-lib/blob/49a25f45268df358f5ceb40a655d9a7ddc6db4f7/src/Query.php#L46-L65
drupol/valuewrapper
src/Object/ClosureObject.php
ClosureObject.hash
public function hash(): string { return $this->doHash($this->type() . $this->serializer->serialize($this->value())); }
php
public function hash(): string { return $this->doHash($this->type() . $this->serializer->serialize($this->value())); }
[ "public", "function", "hash", "(", ")", ":", "string", "{", "return", "$", "this", "->", "doHash", "(", "$", "this", "->", "type", "(", ")", ".", "$", "this", "->", "serializer", "->", "serialize", "(", "$", "this", "->", "value", "(", ")", ")", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/drupol/valuewrapper/blob/49cc07e4d0284718c24ba6e9cf524c1f4226694e/src/Object/ClosureObject.php#L42-L45
drupol/valuewrapper
src/Object/ClosureObject.php
ClosureObject.unserialize
public function unserialize($serialized) { $unserialized = \unserialize($serialized); $this->set( $this->serializer->unserialize(\base64_decode($unserialized['value'], true)) ); }
php
public function unserialize($serialized) { $unserialized = \unserialize($serialized); $this->set( $this->serializer->unserialize(\base64_decode($unserialized['value'], true)) ); }
[ "public", "function", "unserialize", "(", "$", "serialized", ")", "{", "$", "unserialized", "=", "\\", "unserialize", "(", "$", "serialized", ")", ";", "$", "this", "->", "set", "(", "$", "this", "->", "serializer", "->", "unserialize", "(", "\\", "base6...
{@inheritdoc}
[ "{" ]
train
https://github.com/drupol/valuewrapper/blob/49cc07e4d0284718c24ba6e9cf524c1f4226694e/src/Object/ClosureObject.php#L60-L67
sohenk/wangeditor3forlaravel
src/WangEditorController.php
WangEditorController.serve
public function serve(Request $request) { $res = [ 'errno' => 9999, 'data' => [], 'info' => '上传图片失败,原因为:非法传参' ]; if ($request->hasFile('ChooseFile')) { $files = $request->file('ChooseFile'); $maxCount = config(...
php
public function serve(Request $request) { $res = [ 'errno' => 9999, 'data' => [], 'info' => '上传图片失败,原因为:非法传参' ]; if ($request->hasFile('ChooseFile')) { $files = $request->file('ChooseFile'); $maxCount = config(...
[ "public", "function", "serve", "(", "Request", "$", "request", ")", "{", "$", "res", "=", "[", "'errno'", "=>", "9999", ",", "'data'", "=>", "[", "]", ",", "'info'", "=>", "'上传图片失败,原因为:非法传参'", "]", ";", "if", "(", "$", "request", "->", "hasFile", "("...
Processing upload files @param Request $request @return string
[ "Processing", "upload", "files" ]
train
https://github.com/sohenk/wangeditor3forlaravel/blob/a67c6b69926774c9c157920c5380de4aae06fea3/src/WangEditorController.php#L27-L84
phpalchemy/cerberus
src/Alchemy/Component/Cerberus/Model/Base/LoginLog.php
LoginLog.getDateTime
public function getDateTime($format = NULL) { if ($format === null) { return $this->date_time; } else { return $this->date_time instanceof \DateTime ? $this->date_time->format($format) : null; } }
php
public function getDateTime($format = NULL) { if ($format === null) { return $this->date_time; } else { return $this->date_time instanceof \DateTime ? $this->date_time->format($format) : null; } }
[ "public", "function", "getDateTime", "(", "$", "format", "=", "NULL", ")", "{", "if", "(", "$", "format", "===", "null", ")", "{", "return", "$", "this", "->", "date_time", ";", "}", "else", "{", "return", "$", "this", "->", "date_time", "instanceof", ...
Get the [optionally formatted] temporal [date_time] column value. @param string $format The date/time format string (either date()-style or strftime()-style). If format is NULL, then the raw \DateTime object will be returned. @return string|\DateTime Formatted date/time value as string or \DateTime object (if f...
[ "Get", "the", "[", "optionally", "formatted", "]", "temporal", "[", "date_time", "]", "column", "value", "." ]
train
https://github.com/phpalchemy/cerberus/blob/3424a360c9bded71eb5b570bc114a7759cb23ec6/src/Alchemy/Component/Cerberus/Model/Base/LoginLog.php#L373-L380
phpalchemy/cerberus
src/Alchemy/Component/Cerberus/Model/Base/LoginLog.php
LoginLog.setDateTime
public function setDateTime($v) { $dt = PropelDateTime::newInstance($v, null, '\DateTime'); if ($this->date_time !== null || $dt !== null) { if ($dt !== $this->date_time) { $this->date_time = $dt; $this->modifiedColumns[LoginLogTableMap::COL_DATE_TIME] = t...
php
public function setDateTime($v) { $dt = PropelDateTime::newInstance($v, null, '\DateTime'); if ($this->date_time !== null || $dt !== null) { if ($dt !== $this->date_time) { $this->date_time = $dt; $this->modifiedColumns[LoginLogTableMap::COL_DATE_TIME] = t...
[ "public", "function", "setDateTime", "(", "$", "v", ")", "{", "$", "dt", "=", "PropelDateTime", "::", "newInstance", "(", "$", "v", ",", "null", ",", "'\\DateTime'", ")", ";", "if", "(", "$", "this", "->", "date_time", "!==", "null", "||", "$", "dt",...
Sets the value of [date_time] column to a normalized version of the date/time value specified. @param mixed $v string, integer (timestamp), or \DateTime value. Empty strings are treated as NULL. @return $this|\Alchemy\Component\Cerberus\Model\LoginLog The current object (for fluent API support)
[ "Sets", "the", "value", "of", "[", "date_time", "]", "column", "to", "a", "normalized", "version", "of", "the", "date", "/", "time", "value", "specified", "." ]
train
https://github.com/phpalchemy/cerberus/blob/3424a360c9bded71eb5b570bc114a7759cb23ec6/src/Alchemy/Component/Cerberus/Model/Base/LoginLog.php#L599-L610
phpalchemy/cerberus
src/Alchemy/Component/Cerberus/Model/Base/LoginLog.php
LoginLog.setUserId
public function setUserId($v) { if ($v !== null) { $v = (string) $v; } if ($this->user_id !== $v) { $this->user_id = $v; $this->modifiedColumns[LoginLogTableMap::COL_USER_ID] = true; } return $this; }
php
public function setUserId($v) { if ($v !== null) { $v = (string) $v; } if ($this->user_id !== $v) { $this->user_id = $v; $this->modifiedColumns[LoginLogTableMap::COL_USER_ID] = true; } return $this; }
[ "public", "function", "setUserId", "(", "$", "v", ")", "{", "if", "(", "$", "v", "!==", "null", ")", "{", "$", "v", "=", "(", "string", ")", "$", "v", ";", "}", "if", "(", "$", "this", "->", "user_id", "!==", "$", "v", ")", "{", "$", "this"...
Set the value of [user_id] column. @param string $v new value @return $this|\Alchemy\Component\Cerberus\Model\LoginLog The current object (for fluent API support)
[ "Set", "the", "value", "of", "[", "user_id", "]", "column", "." ]
train
https://github.com/phpalchemy/cerberus/blob/3424a360c9bded71eb5b570bc114a7759cb23ec6/src/Alchemy/Component/Cerberus/Model/Base/LoginLog.php#L618-L630
phpalchemy/cerberus
src/Alchemy/Component/Cerberus/Model/Base/LoginLog.php
LoginLog.setSessionId
public function setSessionId($v) { if ($v !== null) { $v = (string) $v; } if ($this->session_id !== $v) { $this->session_id = $v; $this->modifiedColumns[LoginLogTableMap::COL_SESSION_ID] = true; } return $this; }
php
public function setSessionId($v) { if ($v !== null) { $v = (string) $v; } if ($this->session_id !== $v) { $this->session_id = $v; $this->modifiedColumns[LoginLogTableMap::COL_SESSION_ID] = true; } return $this; }
[ "public", "function", "setSessionId", "(", "$", "v", ")", "{", "if", "(", "$", "v", "!==", "null", ")", "{", "$", "v", "=", "(", "string", ")", "$", "v", ";", "}", "if", "(", "$", "this", "->", "session_id", "!==", "$", "v", ")", "{", "$", ...
Set the value of [session_id] column. @param string $v new value @return $this|\Alchemy\Component\Cerberus\Model\LoginLog The current object (for fluent API support)
[ "Set", "the", "value", "of", "[", "session_id", "]", "column", "." ]
train
https://github.com/phpalchemy/cerberus/blob/3424a360c9bded71eb5b570bc114a7759cb23ec6/src/Alchemy/Component/Cerberus/Model/Base/LoginLog.php#L658-L670
phpalchemy/cerberus
src/Alchemy/Component/Cerberus/Model/Base/LoginLog.php
LoginLog.setClientIp
public function setClientIp($v) { if ($v !== null) { $v = (string) $v; } if ($this->client_ip !== $v) { $this->client_ip = $v; $this->modifiedColumns[LoginLogTableMap::COL_CLIENT_IP] = true; } return $this; }
php
public function setClientIp($v) { if ($v !== null) { $v = (string) $v; } if ($this->client_ip !== $v) { $this->client_ip = $v; $this->modifiedColumns[LoginLogTableMap::COL_CLIENT_IP] = true; } return $this; }
[ "public", "function", "setClientIp", "(", "$", "v", ")", "{", "if", "(", "$", "v", "!==", "null", ")", "{", "$", "v", "=", "(", "string", ")", "$", "v", ";", "}", "if", "(", "$", "this", "->", "client_ip", "!==", "$", "v", ")", "{", "$", "t...
Set the value of [client_ip] column. @param string $v new value @return $this|\Alchemy\Component\Cerberus\Model\LoginLog The current object (for fluent API support)
[ "Set", "the", "value", "of", "[", "client_ip", "]", "column", "." ]
train
https://github.com/phpalchemy/cerberus/blob/3424a360c9bded71eb5b570bc114a7759cb23ec6/src/Alchemy/Component/Cerberus/Model/Base/LoginLog.php#L698-L710