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
Double-Opt-in/php-client-api
src/Client/Commands/Responses/DecryptedCommandResponse.php
DecryptedCommandResponse.resolveActionFromStdClass
protected function resolveActionFromStdClass(stdClass $stdClass) { if (isset($stdClass->data)) $stdClass->data = $this->cryptographyEngine->decrypt($stdClass->data, $this->email); return Action::createFromStdClass($stdClass); }
php
protected function resolveActionFromStdClass(stdClass $stdClass) { if (isset($stdClass->data)) $stdClass->data = $this->cryptographyEngine->decrypt($stdClass->data, $this->email); return Action::createFromStdClass($stdClass); }
[ "protected", "function", "resolveActionFromStdClass", "(", "stdClass", "$", "stdClass", ")", "{", "if", "(", "isset", "(", "$", "stdClass", "->", "data", ")", ")", "$", "stdClass", "->", "data", "=", "$", "this", "->", "cryptographyEngine", "->", "decrypt", ...
resolves an action from a stdClass @param \stdClass $stdClass @return Action
[ "resolves", "an", "action", "from", "a", "stdClass" ]
train
https://github.com/Double-Opt-in/php-client-api/blob/2f17da58ec20a408bbd55b2cdd053bc689f995f4/src/Client/Commands/Responses/DecryptedCommandResponse.php#L51-L57
yoanm/symfony-jsonrpc-http-server-doc
src/Provider/RawDocProvider.php
RawDocProvider.getDoc
public function getDoc($host = null) : array { return $this->serverDocNormalizer->normalize( $this->httpServerDocCreator->create($host) ); }
php
public function getDoc($host = null) : array { return $this->serverDocNormalizer->normalize( $this->httpServerDocCreator->create($host) ); }
[ "public", "function", "getDoc", "(", "$", "host", "=", "null", ")", ":", "array", "{", "return", "$", "this", "->", "serverDocNormalizer", "->", "normalize", "(", "$", "this", "->", "httpServerDocCreator", "->", "create", "(", "$", "host", ")", ")", ";",...
@param string|null $host @return array
[ "@param", "string|null", "$host" ]
train
https://github.com/yoanm/symfony-jsonrpc-http-server-doc/blob/7a59862f74fef29d0e2ad017188977419503ad94/src/Provider/RawDocProvider.php#L36-L41
andrelohmann/silverstripe-extended-image
code/extensions/ExtendedGDBackend.php
ExtendedGDBackend.merge
public function merge(GDBackend $image){ imagealphablending($this->owner->getImageResource(), false); imagesavealpha($this->owner->getImageResource(), true); imagealphablending($image->getImageResource(), false); imagesavealpha($image->getImageResource(), true); $s...
php
public function merge(GDBackend $image){ imagealphablending($this->owner->getImageResource(), false); imagesavealpha($this->owner->getImageResource(), true); imagealphablending($image->getImageResource(), false); imagesavealpha($image->getImageResource(), true); $s...
[ "public", "function", "merge", "(", "GDBackend", "$", "image", ")", "{", "imagealphablending", "(", "$", "this", "->", "owner", "->", "getImageResource", "(", ")", ",", "false", ")", ";", "imagesavealpha", "(", "$", "this", "->", "owner", "->", "getImageRe...
Merge two Images together
[ "Merge", "two", "Images", "together" ]
train
https://github.com/andrelohmann/silverstripe-extended-image/blob/178e9142ae8ff63f9bf36464093379f6e836b90b/code/extensions/ExtendedGDBackend.php#L15-L37
andrelohmann/silverstripe-extended-image
code/extensions/ExtendedGDBackend.php
ExtendedGDBackend.blur
public function blur($intensity) { $image = $this->owner->getImageResource(); switch($intensity){ case 'light': for ($x=1; $x<=10; $x++) imagefilter($image, IMG_FILTER_GAUSSIAN_BLUR); break; case 'strong': ...
php
public function blur($intensity) { $image = $this->owner->getImageResource(); switch($intensity){ case 'light': for ($x=1; $x<=10; $x++) imagefilter($image, IMG_FILTER_GAUSSIAN_BLUR); break; case 'strong': ...
[ "public", "function", "blur", "(", "$", "intensity", ")", "{", "$", "image", "=", "$", "this", "->", "owner", "->", "getImageResource", "(", ")", ";", "switch", "(", "$", "intensity", ")", "{", "case", "'light'", ":", "for", "(", "$", "x", "=", "1"...
blur the image
[ "blur", "the", "image" ]
train
https://github.com/andrelohmann/silverstripe-extended-image/blob/178e9142ae8ff63f9bf36464093379f6e836b90b/code/extensions/ExtendedGDBackend.php#L42-L66
andrelohmann/silverstripe-extended-image
code/extensions/ExtendedGDBackend.php
ExtendedGDBackend.toJpeg
public function toJpeg($backgroundColor, $type) { $image = $this->owner->getImageResource(); switch($type){ case IMAGETYPE_GIF: case IMAGETYPE_PNG: $newGD = imagecreatetruecolor($this->owner->getWidth(), $this->owner->getHeight()); $bg = GDBackend::color_web2gd($newGD, $backgroundColor); ...
php
public function toJpeg($backgroundColor, $type) { $image = $this->owner->getImageResource(); switch($type){ case IMAGETYPE_GIF: case IMAGETYPE_PNG: $newGD = imagecreatetruecolor($this->owner->getWidth(), $this->owner->getHeight()); $bg = GDBackend::color_web2gd($newGD, $backgroundColor); ...
[ "public", "function", "toJpeg", "(", "$", "backgroundColor", ",", "$", "type", ")", "{", "$", "image", "=", "$", "this", "->", "owner", "->", "getImageResource", "(", ")", ";", "switch", "(", "$", "type", ")", "{", "case", "IMAGETYPE_GIF", ":", "case",...
convert to jpeg
[ "convert", "to", "jpeg" ]
train
https://github.com/andrelohmann/silverstripe-extended-image/blob/178e9142ae8ff63f9bf36464093379f6e836b90b/code/extensions/ExtendedGDBackend.php#L144-L165
mihai-stancu/serializer
Serializer/Normalizer/MixedDenormalizer.php
MixedDenormalizer.denormalize
public function denormalize($values, $class, $format = null, array $context = array()) { if (!is_array($values)) { return $values; } $filtered = array_filter( $values, function ($value) use ($class, $format) { return $this->serializer->sup...
php
public function denormalize($values, $class, $format = null, array $context = array()) { if (!is_array($values)) { return $values; } $filtered = array_filter( $values, function ($value) use ($class, $format) { return $this->serializer->sup...
[ "public", "function", "denormalize", "(", "$", "values", ",", "$", "class", ",", "$", "format", "=", "null", ",", "array", "$", "context", "=", "array", "(", ")", ")", "{", "if", "(", "!", "is_array", "(", "$", "values", ")", ")", "{", "return", ...
@param array $values @param string $class @param string $format @param array $context @return array|object
[ "@param", "array", "$values", "@param", "string", "$class", "@param", "string", "$format", "@param", "array", "$context" ]
train
https://github.com/mihai-stancu/serializer/blob/4d96f942a3c44d5b5652868be726af656bf1baad/Serializer/Normalizer/MixedDenormalizer.php#L32-L55
mihai-stancu/serializer
Serializer/Normalizer/MixedDenormalizer.php
MixedDenormalizer.supportsDenormalization
public function supportsDenormalization($data, $type, $format = null) { if ($type !== static::TYPE) { return false; } if (!is_null($data) and !is_scalar($data) and !is_resource($data) and !is_array($data)) { return false; } return true; }
php
public function supportsDenormalization($data, $type, $format = null) { if ($type !== static::TYPE) { return false; } if (!is_null($data) and !is_scalar($data) and !is_resource($data) and !is_array($data)) { return false; } return true; }
[ "public", "function", "supportsDenormalization", "(", "$", "data", ",", "$", "type", ",", "$", "format", "=", "null", ")", "{", "if", "(", "$", "type", "!==", "static", "::", "TYPE", ")", "{", "return", "false", ";", "}", "if", "(", "!", "is_null", ...
@param array $data @param string $type @param string $format @return bool
[ "@param", "array", "$data", "@param", "string", "$type", "@param", "string", "$format" ]
train
https://github.com/mihai-stancu/serializer/blob/4d96f942a3c44d5b5652868be726af656bf1baad/Serializer/Normalizer/MixedDenormalizer.php#L64-L75
meccado/acl-admin-control-panel
src/Middleware/AdminMiddleware.php
AdminMiddleware.handle
public function handle($request, Closure $next) { if (\Auth::check() && \Auth::user()->isAdmin()){ return $next($request); }else if (\Auth::check() && !\Auth::user()->isAdmin()){ return redirect('/')->withErrors('You are not administrator'); } }
php
public function handle($request, Closure $next) { if (\Auth::check() && \Auth::user()->isAdmin()){ return $next($request); }else if (\Auth::check() && !\Auth::user()->isAdmin()){ return redirect('/')->withErrors('You are not administrator'); } }
[ "public", "function", "handle", "(", "$", "request", ",", "Closure", "$", "next", ")", "{", "if", "(", "\\", "Auth", "::", "check", "(", ")", "&&", "\\", "Auth", "::", "user", "(", ")", "->", "isAdmin", "(", ")", ")", "{", "return", "$", "next", ...
Handle an incoming request. @param \Illuminate\Http\Request $request @param \Closure $next @return mixed
[ "Handle", "an", "incoming", "request", "." ]
train
https://github.com/meccado/acl-admin-control-panel/blob/50ac4c0dbf8bd49944ecad6a70708a70411b7378/src/Middleware/AdminMiddleware.php#L16-L23
egeloen/IvorySerializerBundle
DependencyInjection/Compiler/RegisterClassMetadataLoaderPass.php
RegisterClassMetadataLoaderPass.process
public function process(ContainerBuilder $container) { $loaders = []; foreach ($container->findTaggedServiceIds($tag = 'ivory.serializer.loader') as $id => $attributes) { foreach ($attributes as $attribute) { $priority = isset($attribute['priority']) ? $attribute['priori...
php
public function process(ContainerBuilder $container) { $loaders = []; foreach ($container->findTaggedServiceIds($tag = 'ivory.serializer.loader') as $id => $attributes) { foreach ($attributes as $attribute) { $priority = isset($attribute['priority']) ? $attribute['priori...
[ "public", "function", "process", "(", "ContainerBuilder", "$", "container", ")", "{", "$", "loaders", "=", "[", "]", ";", "foreach", "(", "$", "container", "->", "findTaggedServiceIds", "(", "$", "tag", "=", "'ivory.serializer.loader'", ")", "as", "$", "id",...
{@inheritdoc}
[ "{" ]
train
https://github.com/egeloen/IvorySerializerBundle/blob/a2bdd912bf715c61b823cf7257ee232d5c823dd3/DependencyInjection/Compiler/RegisterClassMetadataLoaderPass.php#L28-L60
javiacei/IdeupSimplePaginatorBundle
Paginator/Adapter/AdapterFactory.php
AdapterFactory.createAdapter
public function createAdapter($collection) { if (\is_array($collection)) { $className = 'Array'; } else { try { $r = new \ReflectionClass($collection); $className = $r->getName(); } catch (\ReflectionException $exc) { ...
php
public function createAdapter($collection) { if (\is_array($collection)) { $className = 'Array'; } else { try { $r = new \ReflectionClass($collection); $className = $r->getName(); } catch (\ReflectionException $exc) { ...
[ "public", "function", "createAdapter", "(", "$", "collection", ")", "{", "if", "(", "\\", "is_array", "(", "$", "collection", ")", ")", "{", "$", "className", "=", "'Array'", ";", "}", "else", "{", "try", "{", "$", "r", "=", "new", "\\", "ReflectionC...
This method recieve a data collection and returns the corresponding adapter. @param mixed $collection @return AdapterInterface @throws Ideup\SimplePaginatorBundle\Paginator\Exception\AdapterNotSupportedException
[ "This", "method", "recieve", "a", "data", "collection", "and", "returns", "the", "corresponding", "adapter", "." ]
train
https://github.com/javiacei/IdeupSimplePaginatorBundle/blob/12639a9c75bc403649fc2b2881e190a017d8c5b2/Paginator/Adapter/AdapterFactory.php#L24-L42
jenwachter/html-form
src/Elements/Select.php
Select.compile
public function compile($value = "") { $html = $this->compiledLabel; if (!empty($this->help)) { $html .= "<div class='help'>{$this->help}</div>"; } $hasOptionValue = $this->hasOptionValue($this->options); $html .= "<select name=\"{$this->name}\" {$this->compiledAttr}>"; // handle options in an assoc...
php
public function compile($value = "") { $html = $this->compiledLabel; if (!empty($this->help)) { $html .= "<div class='help'>{$this->help}</div>"; } $hasOptionValue = $this->hasOptionValue($this->options); $html .= "<select name=\"{$this->name}\" {$this->compiledAttr}>"; // handle options in an assoc...
[ "public", "function", "compile", "(", "$", "value", "=", "\"\"", ")", "{", "$", "html", "=", "$", "this", "->", "compiledLabel", ";", "if", "(", "!", "empty", "(", "$", "this", "->", "help", ")", ")", "{", "$", "html", ".=", "\"<div class='help'>{$th...
Builds the HTML of the form field. @param string $value Value of the form field @return null
[ "Builds", "the", "HTML", "of", "the", "form", "field", "." ]
train
https://github.com/jenwachter/html-form/blob/eaece87d474f7da5c25679548fb8f1608a94303c/src/Elements/Select.php#L13-L50
zicht/z-plugin-git
git/Plugin.php
Plugin.appendConfiguration
public function appendConfiguration(ArrayNodeDefinition $rootNode) { $rootNode ->children() ->arrayNode('vcs') ->children() ->scalarNode('url')->end() ->arrayNode('export') ->children(...
php
public function appendConfiguration(ArrayNodeDefinition $rootNode) { $rootNode ->children() ->arrayNode('vcs') ->children() ->scalarNode('url')->end() ->arrayNode('export') ->children(...
[ "public", "function", "appendConfiguration", "(", "ArrayNodeDefinition", "$", "rootNode", ")", "{", "$", "rootNode", "->", "children", "(", ")", "->", "arrayNode", "(", "'vcs'", ")", "->", "children", "(", ")", "->", "scalarNode", "(", "'url'", ")", "->", ...
Appends Git configuration options @param \Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition $rootNode @return mixed|void
[ "Appends", "Git", "configuration", "options" ]
train
https://github.com/zicht/z-plugin-git/blob/0ed336b19a20225f96111e30db1ae59fabdea0e7/git/Plugin.php#L27-L43
phpmob/changmin
src/PhpMob/CmsBundle/Doctrine/ORM/PageRepository.php
PageRepository.findBySlug
public function findBySlug(string $slug, ?string $locale): ?SlugAwareInterface { $queryBuilder = $this->createQueryBuilder('o'); return $queryBuilder ->join('o.translations', 'translation', 'WITH', 'translation.locale = :locale') ->leftJoin('o.template', 'tpl') -...
php
public function findBySlug(string $slug, ?string $locale): ?SlugAwareInterface { $queryBuilder = $this->createQueryBuilder('o'); return $queryBuilder ->join('o.translations', 'translation', 'WITH', 'translation.locale = :locale') ->leftJoin('o.template', 'tpl') -...
[ "public", "function", "findBySlug", "(", "string", "$", "slug", ",", "?", "string", "$", "locale", ")", ":", "?", "SlugAwareInterface", "{", "$", "queryBuilder", "=", "$", "this", "->", "createQueryBuilder", "(", "'o'", ")", ";", "return", "$", "queryBuild...
{@inheritdoc}
[ "{" ]
train
https://github.com/phpmob/changmin/blob/bfebb1561229094d1c138574abab75f2f1d17d66/src/PhpMob/CmsBundle/Doctrine/ORM/PageRepository.php#L26-L41
afrittella/back-project
src/database/migrations/2017_03_10_213644_create_attachments_table.php
CreateAttachmentsTable.up
public function up() { Schema::create($this->table_attachments, function(Blueprint $table) { $table->increments('id'); $table->string('name'); $table->string('original_name'); $table->text('description')->nullable(); $table->boolean('is_main')->def...
php
public function up() { Schema::create($this->table_attachments, function(Blueprint $table) { $table->increments('id'); $table->string('name'); $table->string('original_name'); $table->text('description')->nullable(); $table->boolean('is_main')->def...
[ "public", "function", "up", "(", ")", "{", "Schema", "::", "create", "(", "$", "this", "->", "table_attachments", ",", "function", "(", "Blueprint", "$", "table", ")", "{", "$", "table", "->", "increments", "(", "'id'", ")", ";", "$", "table", "->", ...
Run the migrations. @return void
[ "Run", "the", "migrations", "." ]
train
https://github.com/afrittella/back-project/blob/e1aa2e3ee03d453033f75a4b16f073c60b5f32d1/src/database/migrations/2017_03_10_213644_create_attachments_table.php#L21-L39
phossa2/config
src/Config/Traits/DelegatorWritableTrait.php
DelegatorWritableTrait.isWritable
public function isWritable()/*# : bool */ { foreach ($this->lookup_pool as $reg) { if ($reg instanceof WritableInterface && $reg->isWritable()) { $this->clearLookupCache(); $this->setWritable($reg); return true; } } retu...
php
public function isWritable()/*# : bool */ { foreach ($this->lookup_pool as $reg) { if ($reg instanceof WritableInterface && $reg->isWritable()) { $this->clearLookupCache(); $this->setWritable($reg); return true; } } retu...
[ "public", "function", "isWritable", "(", ")", "/*# : bool */", "{", "foreach", "(", "$", "this", "->", "lookup_pool", "as", "$", "reg", ")", "{", "if", "(", "$", "reg", "instanceof", "WritableInterface", "&&", "$", "reg", "->", "isWritable", "(", ")", ")...
Override `isWritable()` in the WritableTrait. Delegator's writability is base on its registries {@inheritDoc}
[ "Override", "isWritable", "()", "in", "the", "WritableTrait", "." ]
train
https://github.com/phossa2/config/blob/7c046fd2c97633b69545b4745d8bffe28e19b1df/src/Config/Traits/DelegatorWritableTrait.php#L43-L53
phossa2/config
src/Config/Traits/DelegatorWritableTrait.php
DelegatorWritableTrait.setWritable
public function setWritable($writable)/*# : bool */ { if (!is_bool($writable)) { $this->writable = $writable; } elseif (false === $writable) { return $this->setRegistryWritableFalse(); } elseif (!$this->isWritable()) { return $this->setRegistryWritableTrue...
php
public function setWritable($writable)/*# : bool */ { if (!is_bool($writable)) { $this->writable = $writable; } elseif (false === $writable) { return $this->setRegistryWritableFalse(); } elseif (!$this->isWritable()) { return $this->setRegistryWritableTrue...
[ "public", "function", "setWritable", "(", "$", "writable", ")", "/*# : bool */", "{", "if", "(", "!", "is_bool", "(", "$", "writable", ")", ")", "{", "$", "this", "->", "writable", "=", "$", "writable", ";", "}", "elseif", "(", "false", "===", "$", "...
Override `setWritable()` in the WritableTrait {@inheritDoc}
[ "Override", "setWritable", "()", "in", "the", "WritableTrait" ]
train
https://github.com/phossa2/config/blob/7c046fd2c97633b69545b4745d8bffe28e19b1df/src/Config/Traits/DelegatorWritableTrait.php#L60-L71
phossa2/config
src/Config/Traits/DelegatorWritableTrait.php
DelegatorWritableTrait.setRegistryWritableFalse
protected function setRegistryWritableFalse()/*# : bool */ { foreach ($this->lookup_pool as $reg) { if ($reg instanceof WritableInterface && !$reg->setWritable(false)) { return false; } } return true; }
php
protected function setRegistryWritableFalse()/*# : bool */ { foreach ($this->lookup_pool as $reg) { if ($reg instanceof WritableInterface && !$reg->setWritable(false)) { return false; } } return true; }
[ "protected", "function", "setRegistryWritableFalse", "(", ")", "/*# : bool */", "{", "foreach", "(", "$", "this", "->", "lookup_pool", "as", "$", "reg", ")", "{", "if", "(", "$", "reg", "instanceof", "WritableInterface", "&&", "!", "$", "reg", "->", "setWrit...
Set writable to FALSE in all registries @return bool @access protected
[ "Set", "writable", "to", "FALSE", "in", "all", "registries" ]
train
https://github.com/phossa2/config/blob/7c046fd2c97633b69545b4745d8bffe28e19b1df/src/Config/Traits/DelegatorWritableTrait.php#L79-L88
PeekAndPoke/psi
src/Operation/Terminal/MedianOperation.php
MedianOperation.apply
public function apply(\Iterator $set) { /** @var mixed[] $data */ $data = array_values(iterator_to_array($set)); $count = count($data); if ($count === 0) { return 0; } sort($data); $middle = (($count + 1) / 2) - 1; $left = (int) floor...
php
public function apply(\Iterator $set) { /** @var mixed[] $data */ $data = array_values(iterator_to_array($set)); $count = count($data); if ($count === 0) { return 0; } sort($data); $middle = (($count + 1) / 2) - 1; $left = (int) floor...
[ "public", "function", "apply", "(", "\\", "Iterator", "$", "set", ")", "{", "/** @var mixed[] $data */", "$", "data", "=", "array_values", "(", "iterator_to_array", "(", "$", "set", ")", ")", ";", "$", "count", "=", "count", "(", "$", "data", ")", ";", ...
{@inheritdoc} @return float
[ "{", "@inheritdoc", "}" ]
train
https://github.com/PeekAndPoke/psi/blob/cfd45d995d3a2c2ea6ba5b1ce7b5fcc71179456f/src/Operation/Terminal/MedianOperation.php#L24-L44
steeffeen/FancyManiaLinks
FML/Script/Features/CheckBoxFeature.php
CheckBoxFeature.setQuad
public function setQuad(Quad $quad) { $quad->checkId(); $quad->setScriptEvents(true); $this->quad = $quad; return $this; }
php
public function setQuad(Quad $quad) { $quad->checkId(); $quad->setScriptEvents(true); $this->quad = $quad; return $this; }
[ "public", "function", "setQuad", "(", "Quad", "$", "quad", ")", "{", "$", "quad", "->", "checkId", "(", ")", ";", "$", "quad", "->", "setScriptEvents", "(", "true", ")", ";", "$", "this", "->", "quad", "=", "$", "quad", ";", "return", "$", "this", ...
Set the CheckBox Quad @api @param Quad $quad CheckBox Quad @return static
[ "Set", "the", "CheckBox", "Quad" ]
train
https://github.com/steeffeen/FancyManiaLinks/blob/227b0759306f0a3c75873ba50276e4163a93bfa6/FML/Script/Features/CheckBoxFeature.php#L97-L103
steeffeen/FancyManiaLinks
FML/Script/Features/CheckBoxFeature.php
CheckBoxFeature.buildInitScriptText
protected function buildInitScriptText() { $quadId = Builder::getId($this->getQuad()); $entryId = Builder::EMPTY_STRING; if ($this->entry) { $entryId = Builder::getId($this->getEntry()); } $default = Builder::getBoolean($this->default); $ena...
php
protected function buildInitScriptText() { $quadId = Builder::getId($this->getQuad()); $entryId = Builder::EMPTY_STRING; if ($this->entry) { $entryId = Builder::getId($this->getEntry()); } $default = Builder::getBoolean($this->default); $ena...
[ "protected", "function", "buildInitScriptText", "(", ")", "{", "$", "quadId", "=", "Builder", "::", "getId", "(", "$", "this", "->", "getQuad", "(", ")", ")", ";", "$", "entryId", "=", "Builder", "::", "EMPTY_STRING", ";", "if", "(", "$", "this", "->",...
Build the init script text @return string
[ "Build", "the", "init", "script", "text" ]
train
https://github.com/steeffeen/FancyManiaLinks/blob/227b0759306f0a3c75873ba50276e4163a93bfa6/FML/Script/Features/CheckBoxFeature.php#L256-L279
ClanCats/Core
src/classes/CCFile.php
CCFile.mkdir
public static function mkdir( $path ) { if ( !is_dir( dirname( $path ) ) ) { if ( !mkdir( dirname( $path ), 0755, true ) ) { throw new CCException( "CCFile - could not create directory: ".dirname( $path ) ); } } }
php
public static function mkdir( $path ) { if ( !is_dir( dirname( $path ) ) ) { if ( !mkdir( dirname( $path ), 0755, true ) ) { throw new CCException( "CCFile - could not create directory: ".dirname( $path ) ); } } }
[ "public", "static", "function", "mkdir", "(", "$", "path", ")", "{", "if", "(", "!", "is_dir", "(", "dirname", "(", "$", "path", ")", ")", ")", "{", "if", "(", "!", "mkdir", "(", "dirname", "(", "$", "path", ")", ",", "0755", ",", "true", ")", ...
Create a directory @param string $path @return void
[ "Create", "a", "directory" ]
train
https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCFile.php#L72-L81
ClanCats/Core
src/classes/CCFile.php
CCFile.write
public static function write( $path, $content ) { static::mkdir( $path ); // if writing the file fails if ( file_put_contents( $path, $content, LOCK_EX ) === false ) { if ( static::_can_print() ) { CCCli::line( CCCli::color( 'failure', 'red' ).' creating '.$path ); } return false; } ...
php
public static function write( $path, $content ) { static::mkdir( $path ); // if writing the file fails if ( file_put_contents( $path, $content, LOCK_EX ) === false ) { if ( static::_can_print() ) { CCCli::line( CCCli::color( 'failure', 'red' ).' creating '.$path ); } return false; } ...
[ "public", "static", "function", "write", "(", "$", "path", ",", "$", "content", ")", "{", "static", "::", "mkdir", "(", "$", "path", ")", ";", "// if writing the file fails", "if", "(", "file_put_contents", "(", "$", "path", ",", "$", "content", ",", "LO...
save a file @param string $path @param string $content @return bool
[ "save", "a", "file" ]
train
https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCFile.php#L90-L113
ClanCats/Core
src/classes/CCFile.php
CCFile.append
public static function append( $path, $content ) { if ( !is_dir( dirname( $path ) ) ) { if ( !mkdir( dirname( $path ), 0755, true ) ) { throw new CCException( "CCFile - could not create directory: ".dirname( $path ) ); } } return file_put_contents( $path, $content, LOCK_EX | FILE_APPEND ); }
php
public static function append( $path, $content ) { if ( !is_dir( dirname( $path ) ) ) { if ( !mkdir( dirname( $path ), 0755, true ) ) { throw new CCException( "CCFile - could not create directory: ".dirname( $path ) ); } } return file_put_contents( $path, $content, LOCK_EX | FILE_APPEND ); }
[ "public", "static", "function", "append", "(", "$", "path", ",", "$", "content", ")", "{", "if", "(", "!", "is_dir", "(", "dirname", "(", "$", "path", ")", ")", ")", "{", "if", "(", "!", "mkdir", "(", "dirname", "(", "$", "path", ")", ",", "075...
append to a file @param string $path @param string $content @return bool
[ "append", "to", "a", "file" ]
train
https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCFile.php#L122-L132
ClanCats/Core
src/classes/CCFile.php
CCFile.delete
public static function delete( $path ) { $success = false; if ( file_exists( $path ) ) { $success = unlink( $path ); } if ( static::_can_print() ) { if ( $success ) { CCCli::line( CCCli::color( 'removed', 'green' ).' '.$path ); } else { CCCli::line( CCCli::color( 'removing f...
php
public static function delete( $path ) { $success = false; if ( file_exists( $path ) ) { $success = unlink( $path ); } if ( static::_can_print() ) { if ( $success ) { CCCli::line( CCCli::color( 'removed', 'green' ).' '.$path ); } else { CCCli::line( CCCli::color( 'removing f...
[ "public", "static", "function", "delete", "(", "$", "path", ")", "{", "$", "success", "=", "false", ";", "if", "(", "file_exists", "(", "$", "path", ")", ")", "{", "$", "success", "=", "unlink", "(", "$", "path", ")", ";", "}", "if", "(", "static...
Delete a file This function is going to remove a file from your filesystem @param string $path @return bool
[ "Delete", "a", "file", "This", "function", "is", "going", "to", "remove", "a", "file", "from", "your", "filesystem" ]
train
https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCFile.php#L141-L163
ClanCats/Core
src/classes/CCFile.php
CCFile.upload
public static function upload( $key, $path ) { if ( $file = static::upload_path( $key ) ) { return move_uploaded_file( $file, $path ); } return false; }
php
public static function upload( $key, $path ) { if ( $file = static::upload_path( $key ) ) { return move_uploaded_file( $file, $path ); } return false; }
[ "public", "static", "function", "upload", "(", "$", "key", ",", "$", "path", ")", "{", "if", "(", "$", "file", "=", "static", "::", "upload_path", "(", "$", "key", ")", ")", "{", "return", "move_uploaded_file", "(", "$", "file", ",", "$", "path", "...
Move user uploads to another dir @param string $key @param string $path @return bool
[ "Move", "user", "uploads", "to", "another", "dir" ]
train
https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCFile.php#L194-L202
2amigos/yiifoundation
widgets/Magellan.php
Magellan.init
public function init() { $this->assets = array( 'js' => YII_DEBUG ? 'foundation/foundation.magellan.js' : 'foundation.min.js' ); $this->htmlOptions['data-magellan-expedition'] = Enum::NAV_FIXED; parent::init(); }
php
public function init() { $this->assets = array( 'js' => YII_DEBUG ? 'foundation/foundation.magellan.js' : 'foundation.min.js' ); $this->htmlOptions['data-magellan-expedition'] = Enum::NAV_FIXED; parent::init(); }
[ "public", "function", "init", "(", ")", "{", "$", "this", "->", "assets", "=", "array", "(", "'js'", "=>", "YII_DEBUG", "?", "'foundation/foundation.magellan.js'", ":", "'foundation.min.js'", ")", ";", "$", "this", "->", "htmlOptions", "[", "'data-magellan-exped...
Widget's initialization widget
[ "Widget", "s", "initialization", "widget" ]
train
https://github.com/2amigos/yiifoundation/blob/49bed0d3ca1a9bac9299000e48a2661bdc8f9a29/widgets/Magellan.php#L40-L47
2amigos/yiifoundation
widgets/Magellan.php
Magellan.renderMagellan
public function renderMagellan() { $list = array(); foreach ($this->items as $item) { $listItem['url'] = '#' . $item['id']; $listItem['label'] = $item['label']; $listItem['itemOptions'] = array('data-magellan-arrival' => $item['id']); $li...
php
public function renderMagellan() { $list = array(); foreach ($this->items as $item) { $listItem['url'] = '#' . $item['id']; $listItem['label'] = $item['label']; $listItem['itemOptions'] = array('data-magellan-arrival' => $item['id']); $li...
[ "public", "function", "renderMagellan", "(", ")", "{", "$", "list", "=", "array", "(", ")", ";", "foreach", "(", "$", "this", "->", "items", "as", "$", "item", ")", "{", "$", "listItem", "[", "'url'", "]", "=", "'#'", ".", "$", "item", "[", "'id'...
Renders magellan @return string the resulting tag
[ "Renders", "magellan" ]
train
https://github.com/2amigos/yiifoundation/blob/49bed0d3ca1a9bac9299000e48a2661bdc8f9a29/widgets/Magellan.php#L61-L72
webforge-labs/psc-cms
lib/Psc/Code/Generate/AnnotationWriter.php
AnnotationWriter.writeAnnotation
public function writeAnnotation($annotation) { $walkedValues = array(); foreach ($this->extractValues($annotation) as $field=>$value) { $walkedValues[] = $this->walkField($field, $value, $this->inferType($value)); } return '@'.$this->getAnnotationName($annotation).( count($walkedValues) > 0 ?...
php
public function writeAnnotation($annotation) { $walkedValues = array(); foreach ($this->extractValues($annotation) as $field=>$value) { $walkedValues[] = $this->walkField($field, $value, $this->inferType($value)); } return '@'.$this->getAnnotationName($annotation).( count($walkedValues) > 0 ?...
[ "public", "function", "writeAnnotation", "(", "$", "annotation", ")", "{", "$", "walkedValues", "=", "array", "(", ")", ";", "foreach", "(", "$", "this", "->", "extractValues", "(", "$", "annotation", ")", "as", "$", "field", "=>", "$", "value", ")", "...
Annotation ::= "@" AnnotationName ["(" [Values] ")"] AnnotationName ::= QualifiedName | SimpleName QualifiedName ::= NameSpacePart "\" {NameSpacePart "\"}* SimpleName NameSpacePart ::= identifier | null | false | true SimpleName ::= identifier | null | false | true @param PscAnnotation|DoctrineAnnotation $a...
[ "Annotation", "::", "=", "@", "AnnotationName", "[", "(", "[", "Values", "]", ")", "]" ]
train
https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/Code/Generate/AnnotationWriter.php#L39-L46
ufocoder/yii2-SyncSocial
src/behaviors/SynchronizerBehavior.php
SynchronizerBehavior.syncActiveRecord
public function syncActiveRecord( $event ) { $synchronizer = $this->getSynchonizer(); $function = $this->canSyncActiveRecord; $flag = true; $model = $event->sender; if ( is_callable( $function ) && ( $function instanceof Closure ) ) { $flag = $function( $mod...
php
public function syncActiveRecord( $event ) { $synchronizer = $this->getSynchonizer(); $function = $this->canSyncActiveRecord; $flag = true; $model = $event->sender; if ( is_callable( $function ) && ( $function instanceof Closure ) ) { $flag = $function( $mod...
[ "public", "function", "syncActiveRecord", "(", "$", "event", ")", "{", "$", "synchronizer", "=", "$", "this", "->", "getSynchonizer", "(", ")", ";", "$", "function", "=", "$", "this", "->", "canSyncActiveRecord", ";", "$", "flag", "=", "true", ";", "$", ...
@param \yii\base\Event $event @throws Exception
[ "@param", "\\", "yii", "\\", "base", "\\", "Event", "$event" ]
train
https://github.com/ufocoder/yii2-SyncSocial/blob/2dbaaec2dad782c52fdd5b648a31ba7fe2a75e1b/src/behaviors/SynchronizerBehavior.php#L63-L80
ufocoder/yii2-SyncSocial
src/behaviors/SynchronizerBehavior.php
SynchronizerBehavior.afterDelete
public function afterDelete( $event ) { $synchronizer = $this->getSynchonizer(); foreach ( $this->syncServices as $serviceName ) { $synchronizer->deleteSyncModel( $serviceName, $event->sender, $this->syncDelete ); } }
php
public function afterDelete( $event ) { $synchronizer = $this->getSynchonizer(); foreach ( $this->syncServices as $serviceName ) { $synchronizer->deleteSyncModel( $serviceName, $event->sender, $this->syncDelete ); } }
[ "public", "function", "afterDelete", "(", "$", "event", ")", "{", "$", "synchronizer", "=", "$", "this", "->", "getSynchonizer", "(", ")", ";", "foreach", "(", "$", "this", "->", "syncServices", "as", "$", "serviceName", ")", "{", "$", "synchronizer", "-...
@param \yii\base\Event $event @throws Exception
[ "@param", "\\", "yii", "\\", "base", "\\", "Event", "$event" ]
train
https://github.com/ufocoder/yii2-SyncSocial/blob/2dbaaec2dad782c52fdd5b648a31ba7fe2a75e1b/src/behaviors/SynchronizerBehavior.php#L87-L92
webforge-labs/psc-cms
lib/Psc/Doctrine/BaseEntity.php
BaseEntity.callSetter
public function callSetter($field, $value) { $f = 'set'.ucfirst($field); if (!method_exists($this, $f)) throw new \InvalidArgumentException($f.'() existiert nicht in '.\Psc\Code\Code::getClass($this)); return $this->$f($value); }
php
public function callSetter($field, $value) { $f = 'set'.ucfirst($field); if (!method_exists($this, $f)) throw new \InvalidArgumentException($f.'() existiert nicht in '.\Psc\Code\Code::getClass($this)); return $this->$f($value); }
[ "public", "function", "callSetter", "(", "$", "field", ",", "$", "value", ")", "{", "$", "f", "=", "'set'", ".", "ucfirst", "(", "$", "field", ")", ";", "if", "(", "!", "method_exists", "(", "$", "this", ",", "$", "f", ")", ")", "throw", "new", ...
Ruft den Setter für das Feld $field auf dem Entity auf @param string $field der Name des Feldes in CamelCase @return die Rückgabe des Setters
[ "Ruft", "den", "Setter", "für", "das", "Feld", "$field", "auf", "dem", "Entity", "auf" ]
train
https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/Doctrine/BaseEntity.php#L19-L23
webforge-labs/psc-cms
lib/Psc/Doctrine/BaseEntity.php
BaseEntity.callGetter
public function callGetter($field) { $f = 'get'.ucfirst($field); if (!method_exists($this, $f)) throw new \InvalidArgumentException($f.'() existiert nicht in '.\Psc\Code\Code::getClass($this)); return $this->$f(); }
php
public function callGetter($field) { $f = 'get'.ucfirst($field); if (!method_exists($this, $f)) throw new \InvalidArgumentException($f.'() existiert nicht in '.\Psc\Code\Code::getClass($this)); return $this->$f(); }
[ "public", "function", "callGetter", "(", "$", "field", ")", "{", "$", "f", "=", "'get'", ".", "ucfirst", "(", "$", "field", ")", ";", "if", "(", "!", "method_exists", "(", "$", "this", ",", "$", "f", ")", ")", "throw", "new", "\\", "InvalidArgument...
Ruft den Getter für das Feld $field auf dem Entity auf @param string $field der Name des Feldes in CamelCase @return mixed
[ "Ruft", "den", "Getter", "für", "das", "Feld", "$field", "auf", "dem", "Entity", "auf" ]
train
https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/Doctrine/BaseEntity.php#L31-L35
zircote/AMQP
library/AMQP/Util/FrameBuilder.php
FrameBuilder.channelClose
public function channelClose($options) { $args = new Writer(); $args->writeShort($options['reply_code']) ->writeShortStr($options['reply_text']) ->writeShort($options['method_signature'][0]) ->writeShort($options['method_signature'][1]); return $args; ...
php
public function channelClose($options) { $args = new Writer(); $args->writeShort($options['reply_code']) ->writeShortStr($options['reply_text']) ->writeShort($options['method_signature'][0]) ->writeShort($options['method_signature'][1]); return $args; ...
[ "public", "function", "channelClose", "(", "$", "options", ")", "{", "$", "args", "=", "new", "Writer", "(", ")", ";", "$", "args", "->", "writeShort", "(", "$", "options", "[", "'reply_code'", "]", ")", "->", "writeShortStr", "(", "$", "options", "[",...
@param int $replyCode @param string $replyText @param string $classId @param string $methodId @return \AMQP\Wire\Writer
[ "@param", "int", "$replyCode", "@param", "string", "$replyText", "@param", "string", "$classId", "@param", "string", "$methodId" ]
train
https://github.com/zircote/AMQP/blob/b96777b372f556797db4fd0ba02edb18d4bf4a1e/library/AMQP/Util/FrameBuilder.php#L23-L31
zircote/AMQP
library/AMQP/Util/FrameBuilder.php
FrameBuilder.accessRequest
public function accessRequest($realm, $options) { $args = new Writer(); $args->writeShortStr($realm) ->writeBit($options['exclusive']) ->writeBit($options['passive']) ->writeBit($options['active']) ->writeBit($options['write']) ->writeBit($...
php
public function accessRequest($realm, $options) { $args = new Writer(); $args->writeShortStr($realm) ->writeBit($options['exclusive']) ->writeBit($options['passive']) ->writeBit($options['active']) ->writeBit($options['write']) ->writeBit($...
[ "public", "function", "accessRequest", "(", "$", "realm", ",", "$", "options", ")", "{", "$", "args", "=", "new", "Writer", "(", ")", ";", "$", "args", "->", "writeShortStr", "(", "$", "realm", ")", "->", "writeBit", "(", "$", "options", "[", "'exclu...
@param string $realm @param string $exclusive @param string $passive @param bool $active @param bool $write @param bool $read @return \AMQP\Wire\Writer
[ "@param", "string", "$realm", "@param", "string", "$exclusive", "@param", "string", "$passive", "@param", "bool", "$active", "@param", "bool", "$write", "@param", "bool", "$read" ]
train
https://github.com/zircote/AMQP/blob/b96777b372f556797db4fd0ba02edb18d4bf4a1e/library/AMQP/Util/FrameBuilder.php#L79-L89
zircote/AMQP
library/AMQP/Util/FrameBuilder.php
FrameBuilder.exchangeDeclare
public function exchangeDeclare($exchange, $type, $options = array()) { $args = new Writer(); $args->writeShort($options['ticket']) ->writeShortStr($exchange) ->writeShortStr($type) ->writeBit($options['passive']) ->writeBit($options['durable']) ...
php
public function exchangeDeclare($exchange, $type, $options = array()) { $args = new Writer(); $args->writeShort($options['ticket']) ->writeShortStr($exchange) ->writeShortStr($type) ->writeBit($options['passive']) ->writeBit($options['durable']) ...
[ "public", "function", "exchangeDeclare", "(", "$", "exchange", ",", "$", "type", ",", "$", "options", "=", "array", "(", ")", ")", "{", "$", "args", "=", "new", "Writer", "(", ")", ";", "$", "args", "->", "writeShort", "(", "$", "options", "[", "'t...
@param string $exchange @param int $type @param bool $passive @param bool $durable @param bool $autoDelete @param bool $internal @param bool $nowait @param array $arguments @param string $ticket @return \AMQP\Wire\Writer
[ "@param", "string", "$exchange", "@param", "int", "$type", "@param", "bool", "$passive", "@param", "bool", "$durable", "@param", "bool", "$autoDelete", "@param", "bool", "$internal", "@param", "bool", "$nowait", "@param", "array", "$arguments", "@param", "string", ...
train
https://github.com/zircote/AMQP/blob/b96777b372f556797db4fd0ba02edb18d4bf4a1e/library/AMQP/Util/FrameBuilder.php#L104-L117
zircote/AMQP
library/AMQP/Util/FrameBuilder.php
FrameBuilder.exchangeDelete
public function exchangeDelete($exchange, $options) { $args = new Writer(); $args->writeShort($options['ticket']) ->writeShortStr($exchange) ->writeBit($options['if_unused']) ->writeBit($options['no_wait']); return $args; }
php
public function exchangeDelete($exchange, $options) { $args = new Writer(); $args->writeShort($options['ticket']) ->writeShortStr($exchange) ->writeBit($options['if_unused']) ->writeBit($options['no_wait']); return $args; }
[ "public", "function", "exchangeDelete", "(", "$", "exchange", ",", "$", "options", ")", "{", "$", "args", "=", "new", "Writer", "(", ")", ";", "$", "args", "->", "writeShort", "(", "$", "options", "[", "'ticket'", "]", ")", "->", "writeShortStr", "(", ...
@param string $exchange @param bool $ifUnused @param bool $nowait @param string $ticket @return \AMQP\Wire\Writer
[ "@param", "string", "$exchange", "@param", "bool", "$ifUnused", "@param", "bool", "$nowait", "@param", "string", "$ticket" ]
train
https://github.com/zircote/AMQP/blob/b96777b372f556797db4fd0ba02edb18d4bf4a1e/library/AMQP/Util/FrameBuilder.php#L127-L135
zircote/AMQP
library/AMQP/Util/FrameBuilder.php
FrameBuilder.queueBind
public function queueBind($queue, $exchange, $options) { $args = new Writer(); $args->writeShort($options['ticket']) ->writeShortStr($queue) ->writeShortStr($exchange) ->writeShortStr($options['routing_key']) ->writeBit($options['no_wait']) ...
php
public function queueBind($queue, $exchange, $options) { $args = new Writer(); $args->writeShort($options['ticket']) ->writeShortStr($queue) ->writeShortStr($exchange) ->writeShortStr($options['routing_key']) ->writeBit($options['no_wait']) ...
[ "public", "function", "queueBind", "(", "$", "queue", ",", "$", "exchange", ",", "$", "options", ")", "{", "$", "args", "=", "new", "Writer", "(", ")", ";", "$", "args", "->", "writeShort", "(", "$", "options", "[", "'ticket'", "]", ")", "->", "wri...
@param string $queue @param string $exchange @param string $routing_key @param bool $nowait @param array $arguments @param string $ticket @return \AMQP\Wire\Writer
[ "@param", "string", "$queue", "@param", "string", "$exchange", "@param", "string", "$routing_key", "@param", "bool", "$nowait", "@param", "array", "$arguments", "@param", "string", "$ticket" ]
train
https://github.com/zircote/AMQP/blob/b96777b372f556797db4fd0ba02edb18d4bf4a1e/library/AMQP/Util/FrameBuilder.php#L147-L157
zircote/AMQP
library/AMQP/Util/FrameBuilder.php
FrameBuilder.queueDeclare
public function queueDeclare($options) { $args = new Writer(); $args->writeShort($options['ticket']) ->writeShortStr($options['queue']) ->writeBit($options['passive']) ->writeBit($options['durable']) ->writeBit($options['exclusive']) ->writ...
php
public function queueDeclare($options) { $args = new Writer(); $args->writeShort($options['ticket']) ->writeShortStr($options['queue']) ->writeBit($options['passive']) ->writeBit($options['durable']) ->writeBit($options['exclusive']) ->writ...
[ "public", "function", "queueDeclare", "(", "$", "options", ")", "{", "$", "args", "=", "new", "Writer", "(", ")", ";", "$", "args", "->", "writeShort", "(", "$", "options", "[", "'ticket'", "]", ")", "->", "writeShortStr", "(", "$", "options", "[", "...
@param string $queue @param bool $passive @param bool $durable @param bool $exclusive @param bool $autoDelete @param bool $nowait @param array $arguments @param string $ticket @return \AMQP\Wire\Writer
[ "@param", "string", "$queue", "@param", "bool", "$passive", "@param", "bool", "$durable", "@param", "bool", "$exclusive", "@param", "bool", "$autoDelete", "@param", "bool", "$nowait", "@param", "array", "$arguments", "@param", "string", "$ticket" ]
train
https://github.com/zircote/AMQP/blob/b96777b372f556797db4fd0ba02edb18d4bf4a1e/library/AMQP/Util/FrameBuilder.php#L182-L194
zircote/AMQP
library/AMQP/Util/FrameBuilder.php
FrameBuilder.queueDelete
public function queueDelete($options) { $args = new Writer(); $args->writeShort($options['ticket']) ->writeShortStr($options['queue']) ->writeBit($options['if_unused']) ->writeBit($options['if_empty']) ->writeBit($options['no_wait']); return $a...
php
public function queueDelete($options) { $args = new Writer(); $args->writeShort($options['ticket']) ->writeShortStr($options['queue']) ->writeBit($options['if_unused']) ->writeBit($options['if_empty']) ->writeBit($options['no_wait']); return $a...
[ "public", "function", "queueDelete", "(", "$", "options", ")", "{", "$", "args", "=", "new", "Writer", "(", ")", ";", "$", "args", "->", "writeShort", "(", "$", "options", "[", "'ticket'", "]", ")", "->", "writeShortStr", "(", "$", "options", "[", "'...
@param string $queue @param bool $ifUnused @param bool $ifEmpty @param bool $nowait @param string $ticket @return \AMQP\Wire\Writer
[ "@param", "string", "$queue", "@param", "bool", "$ifUnused", "@param", "bool", "$ifEmpty", "@param", "bool", "$nowait", "@param", "string", "$ticket" ]
train
https://github.com/zircote/AMQP/blob/b96777b372f556797db4fd0ba02edb18d4bf4a1e/library/AMQP/Util/FrameBuilder.php#L205-L214
zircote/AMQP
library/AMQP/Util/FrameBuilder.php
FrameBuilder.queuePurge
public function queuePurge($options) { $args = new Writer(); $args->writeShort($options['ticket']) ->writeShortStr($options['queue']) ->writeBit($options['no_wait']); return $args; }
php
public function queuePurge($options) { $args = new Writer(); $args->writeShort($options['ticket']) ->writeShortStr($options['queue']) ->writeBit($options['no_wait']); return $args; }
[ "public", "function", "queuePurge", "(", "$", "options", ")", "{", "$", "args", "=", "new", "Writer", "(", ")", ";", "$", "args", "->", "writeShort", "(", "$", "options", "[", "'ticket'", "]", ")", "->", "writeShortStr", "(", "$", "options", "[", "'q...
@param string $queue @param bool $nowait @param string $ticket @return \AMQP\Wire\Writer
[ "@param", "string", "$queue", "@param", "bool", "$nowait", "@param", "string", "$ticket" ]
train
https://github.com/zircote/AMQP/blob/b96777b372f556797db4fd0ba02edb18d4bf4a1e/library/AMQP/Util/FrameBuilder.php#L223-L230
zircote/AMQP
library/AMQP/Util/FrameBuilder.php
FrameBuilder.basicAck
public function basicAck($deliveryTag, $multiple) { $args = new Writer(); $args->writeLongLong($deliveryTag) ->writeBit($multiple); return $args; }
php
public function basicAck($deliveryTag, $multiple) { $args = new Writer(); $args->writeLongLong($deliveryTag) ->writeBit($multiple); return $args; }
[ "public", "function", "basicAck", "(", "$", "deliveryTag", ",", "$", "multiple", ")", "{", "$", "args", "=", "new", "Writer", "(", ")", ";", "$", "args", "->", "writeLongLong", "(", "$", "deliveryTag", ")", "->", "writeBit", "(", "$", "multiple", ")", ...
@param string $deliveryTag @param bool $multiple @return \AMQP\Wire\Writer
[ "@param", "string", "$deliveryTag", "@param", "bool", "$multiple" ]
train
https://github.com/zircote/AMQP/blob/b96777b372f556797db4fd0ba02edb18d4bf4a1e/library/AMQP/Util/FrameBuilder.php#L238-L244
zircote/AMQP
library/AMQP/Util/FrameBuilder.php
FrameBuilder.basicCancel
public function basicCancel($consumerTag, $nowait) { $args = new Writer(); $args->writeShortStr($consumerTag) ->writeBit($nowait); return $args; }
php
public function basicCancel($consumerTag, $nowait) { $args = new Writer(); $args->writeShortStr($consumerTag) ->writeBit($nowait); return $args; }
[ "public", "function", "basicCancel", "(", "$", "consumerTag", ",", "$", "nowait", ")", "{", "$", "args", "=", "new", "Writer", "(", ")", ";", "$", "args", "->", "writeShortStr", "(", "$", "consumerTag", ")", "->", "writeBit", "(", "$", "nowait", ")", ...
@param $consumerTag @param $nowait @return \AMQP\Wire\Writer
[ "@param", "$consumerTag", "@param", "$nowait" ]
train
https://github.com/zircote/AMQP/blob/b96777b372f556797db4fd0ba02edb18d4bf4a1e/library/AMQP/Util/FrameBuilder.php#L252-L258
zircote/AMQP
library/AMQP/Util/FrameBuilder.php
FrameBuilder.basicConsume
public function basicConsume($options) { $args = new Writer(); $args->writeShort($options['ticket']) ->writeShortStr($options['queue']) ->writeShortStr($options['consumer_tag']) ->writeBit($options['no_local']) ->writeBit($options['no_ack']) ...
php
public function basicConsume($options) { $args = new Writer(); $args->writeShort($options['ticket']) ->writeShortStr($options['queue']) ->writeShortStr($options['consumer_tag']) ->writeBit($options['no_local']) ->writeBit($options['no_ack']) ...
[ "public", "function", "basicConsume", "(", "$", "options", ")", "{", "$", "args", "=", "new", "Writer", "(", ")", ";", "$", "args", "->", "writeShort", "(", "$", "options", "[", "'ticket'", "]", ")", "->", "writeShortStr", "(", "$", "options", "[", "...
@param string $queue @param string $consumerTag @param bool $noLocal @param bool $noAck @param bool $exclusive @param bool $nowait @param string $ticket @return \AMQP\Wire\Writer
[ "@param", "string", "$queue", "@param", "string", "$consumerTag", "@param", "bool", "$noLocal", "@param", "bool", "$noAck", "@param", "bool", "$exclusive", "@param", "bool", "$nowait", "@param", "string", "$ticket" ]
train
https://github.com/zircote/AMQP/blob/b96777b372f556797db4fd0ba02edb18d4bf4a1e/library/AMQP/Util/FrameBuilder.php#L271-L282
zircote/AMQP
library/AMQP/Util/FrameBuilder.php
FrameBuilder.basicGet
public function basicGet($options) { $args = new Writer(); $args->writeShort($options['ticket']) ->writeShortStr($options['queue']) ->writeBit($options['no_ack']); return $args; }
php
public function basicGet($options) { $args = new Writer(); $args->writeShort($options['ticket']) ->writeShortStr($options['queue']) ->writeBit($options['no_ack']); return $args; }
[ "public", "function", "basicGet", "(", "$", "options", ")", "{", "$", "args", "=", "new", "Writer", "(", ")", ";", "$", "args", "->", "writeShort", "(", "$", "options", "[", "'ticket'", "]", ")", "->", "writeShortStr", "(", "$", "options", "[", "'que...
@param string $queue @param bool $noAck @param string $ticket @return \AMQP\Wire\Writer
[ "@param", "string", "$queue", "@param", "bool", "$noAck", "@param", "string", "$ticket" ]
train
https://github.com/zircote/AMQP/blob/b96777b372f556797db4fd0ba02edb18d4bf4a1e/library/AMQP/Util/FrameBuilder.php#L291-L298
zircote/AMQP
library/AMQP/Util/FrameBuilder.php
FrameBuilder.basicPublish
public function basicPublish($options) { $args = new Writer(); $args->writeShort($options['ticket']) ->writeShortStr($options['exchange']) ->writeShortStr($options['routing_key']) ->writeBit($options['mandatory']) ->writeBit($options['immediate']); ...
php
public function basicPublish($options) { $args = new Writer(); $args->writeShort($options['ticket']) ->writeShortStr($options['exchange']) ->writeShortStr($options['routing_key']) ->writeBit($options['mandatory']) ->writeBit($options['immediate']); ...
[ "public", "function", "basicPublish", "(", "$", "options", ")", "{", "$", "args", "=", "new", "Writer", "(", ")", ";", "$", "args", "->", "writeShort", "(", "$", "options", "[", "'ticket'", "]", ")", "->", "writeShortStr", "(", "$", "options", "[", "...
@param string $exchange @param string $routingKey @param bool $mandatory @param bool $immediate @param string $ticket @return \AMQP\Wire\Writer
[ "@param", "string", "$exchange", "@param", "string", "$routingKey", "@param", "bool", "$mandatory", "@param", "bool", "$immediate", "@param", "string", "$ticket" ]
train
https://github.com/zircote/AMQP/blob/b96777b372f556797db4fd0ba02edb18d4bf4a1e/library/AMQP/Util/FrameBuilder.php#L309-L318
zircote/AMQP
library/AMQP/Util/FrameBuilder.php
FrameBuilder.basicQos
public function basicQos($prefetchSize, $prefetchCount, $aGlobal) { $args = new Writer(); $args->writeLong($prefetchSize) ->writeShort($prefetchCount) ->writeBit($aGlobal); return $args; }
php
public function basicQos($prefetchSize, $prefetchCount, $aGlobal) { $args = new Writer(); $args->writeLong($prefetchSize) ->writeShort($prefetchCount) ->writeBit($aGlobal); return $args; }
[ "public", "function", "basicQos", "(", "$", "prefetchSize", ",", "$", "prefetchCount", ",", "$", "aGlobal", ")", "{", "$", "args", "=", "new", "Writer", "(", ")", ";", "$", "args", "->", "writeLong", "(", "$", "prefetchSize", ")", "->", "writeShort", "...
@param int $prefetchSize @param int $prefetchCount @param bool $aGlobal @return \AMQP\Wire\Writer
[ "@param", "int", "$prefetchSize", "@param", "int", "$prefetchCount", "@param", "bool", "$aGlobal" ]
train
https://github.com/zircote/AMQP/blob/b96777b372f556797db4fd0ba02edb18d4bf4a1e/library/AMQP/Util/FrameBuilder.php#L327-L334
zircote/AMQP
library/AMQP/Util/FrameBuilder.php
FrameBuilder.basicReject
public function basicReject($deliveryTag, $reQueue) { $args = new Writer(); $args->writeLongLong($deliveryTag) ->writeBit($reQueue); return $args; }
php
public function basicReject($deliveryTag, $reQueue) { $args = new Writer(); $args->writeLongLong($deliveryTag) ->writeBit($reQueue); return $args; }
[ "public", "function", "basicReject", "(", "$", "deliveryTag", ",", "$", "reQueue", ")", "{", "$", "args", "=", "new", "Writer", "(", ")", ";", "$", "args", "->", "writeLongLong", "(", "$", "deliveryTag", ")", "->", "writeBit", "(", "$", "reQueue", ")",...
@param string $deliveryTag @param bool $reQueue @return \AMQP\Wire\Writer
[ "@param", "string", "$deliveryTag", "@param", "bool", "$reQueue" ]
train
https://github.com/zircote/AMQP/blob/b96777b372f556797db4fd0ba02edb18d4bf4a1e/library/AMQP/Util/FrameBuilder.php#L354-L360
scrutinizer-ci/rabbitmq
src/Scrutinizer/RabbitMQ/Rpc/GroupsVersionExclusionStrategy.php
GroupsVersionExclusionStrategy.shouldSkipProperty
public function shouldSkipProperty(PropertyMetadata $property, NavigatorContext $navigatorContext) { return $this->versionStrategy->shouldSkipProperty($property, $navigatorContext) || $this->groupStrategy->shouldSkipProperty($property, $navigatorContext); }
php
public function shouldSkipProperty(PropertyMetadata $property, NavigatorContext $navigatorContext) { return $this->versionStrategy->shouldSkipProperty($property, $navigatorContext) || $this->groupStrategy->shouldSkipProperty($property, $navigatorContext); }
[ "public", "function", "shouldSkipProperty", "(", "PropertyMetadata", "$", "property", ",", "NavigatorContext", "$", "navigatorContext", ")", "{", "return", "$", "this", "->", "versionStrategy", "->", "shouldSkipProperty", "(", "$", "property", ",", "$", "navigatorCo...
Whether the property should be skipped. @param PropertyMetadata $property @param NavigatorContext $navigatorContext @return boolean
[ "Whether", "the", "property", "should", "be", "skipped", "." ]
train
https://github.com/scrutinizer-ci/rabbitmq/blob/5603f7901de2ad352086287f8d2c65bbae5170d5/src/Scrutinizer/RabbitMQ/Rpc/GroupsVersionExclusionStrategy.php#L40-L44
claroline/ForumBundle
Listener/ForumWidgetListener.php
ForumWidgetListener.onDisplay
public function onDisplay(DisplayWidgetEvent $event) { if (!$this->request) { throw new NoHttpRequestException(); } $workspace = $event->getInstance()->getWorkspace(); $templatePath = 'ClarolineForumBundle:Forum:forumsWorkspaceWidget.html.twig'; $widgetType = 'w...
php
public function onDisplay(DisplayWidgetEvent $event) { if (!$this->request) { throw new NoHttpRequestException(); } $workspace = $event->getInstance()->getWorkspace(); $templatePath = 'ClarolineForumBundle:Forum:forumsWorkspaceWidget.html.twig'; $widgetType = 'w...
[ "public", "function", "onDisplay", "(", "DisplayWidgetEvent", "$", "event", ")", "{", "if", "(", "!", "$", "this", "->", "request", ")", "{", "throw", "new", "NoHttpRequestException", "(", ")", ";", "}", "$", "workspace", "=", "$", "event", "->", "getIns...
@DI\Observe("widget_claroline_forum_widget") @param DisplayWidgetEvent $event @throws \Claroline\CoreBundle\Listener\NoHttpRequestException
[ "@DI", "\\", "Observe", "(", "widget_claroline_forum_widget", ")" ]
train
https://github.com/claroline/ForumBundle/blob/bd85dfd870cacee541ea94fec8e59744bf90eaf4/Listener/ForumWidgetListener.php#L81-L104
qcubed/orm
src/Database/Service.php
Service.initializeDatabaseConnections
public static function initializeDatabaseConnections() { // for backward compatibility, don't use MAX_DB_CONNECTION_INDEX directly, // but check if MAX_DB_CONNECTION_INDEX is defined $intMaxIndex = defined('MAX_DB_CONNECTION_INDEX') ? constant('MAX_DB_CONNECTION_INDEX') : 9; if (def...
php
public static function initializeDatabaseConnections() { // for backward compatibility, don't use MAX_DB_CONNECTION_INDEX directly, // but check if MAX_DB_CONNECTION_INDEX is defined $intMaxIndex = defined('MAX_DB_CONNECTION_INDEX') ? constant('MAX_DB_CONNECTION_INDEX') : 9; if (def...
[ "public", "static", "function", "initializeDatabaseConnections", "(", ")", "{", "// for backward compatibility, don't use MAX_DB_CONNECTION_INDEX directly,", "// but check if MAX_DB_CONNECTION_INDEX is defined", "$", "intMaxIndex", "=", "defined", "(", "'MAX_DB_CONNECTION_INDEX'", ")",...
This call will initialize the database connection(s) as defined by the constants DB_CONNECTION_X, where "X" is the index number of a particular database connection. @throws \Exception @return void
[ "This", "call", "will", "initialize", "the", "database", "connection", "(", "s", ")", "as", "defined", "by", "the", "constants", "DB_CONNECTION_X", "where", "X", "is", "the", "index", "number", "of", "a", "particular", "database", "connection", "." ]
train
https://github.com/qcubed/orm/blob/f320eba671f20874b1f3809c5293f8c02d5b1204/src/Database/Service.php#L43-L99
ClanCats/Core
src/classes/CCError.php
CCError._init
public static function _init() { // we capture non fatal errors only in dev environments if ( ClanCats::in_development() ) { // add a hook to the main resposne CCEvent::mind( 'response.output', function( $output ) { if ( strpos( $output, '</body>' ) === false ) { return $output; } ...
php
public static function _init() { // we capture non fatal errors only in dev environments if ( ClanCats::in_development() ) { // add a hook to the main resposne CCEvent::mind( 'response.output', function( $output ) { if ( strpos( $output, '</body>' ) === false ) { return $output; } ...
[ "public", "static", "function", "_init", "(", ")", "{", "// we capture non fatal errors only in dev environments", "if", "(", "ClanCats", "::", "in_development", "(", ")", ")", "{", "// add a hook to the main resposne", "CCEvent", "::", "mind", "(", "'response.output'", ...
error class init @return void
[ "error", "class", "init" ]
train
https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCError.php#L62-L97
ClanCats/Core
src/classes/CCError.php
CCError.is_fatal_level
private static function is_fatal_level( $level ) { $fatals = array( E_ERROR, E_PARSE, E_CORE_ERROR, E_CORE_WARNING, E_COMPILE_ERROR, E_COMPILE_WARNING, E_DEPRECATED, ); if ( is_object( ClanCats::$config ) && ClanCats::$config instanceof CCConfig ) { if ( in_array( $level, ClanCats::...
php
private static function is_fatal_level( $level ) { $fatals = array( E_ERROR, E_PARSE, E_CORE_ERROR, E_CORE_WARNING, E_COMPILE_ERROR, E_COMPILE_WARNING, E_DEPRECATED, ); if ( is_object( ClanCats::$config ) && ClanCats::$config instanceof CCConfig ) { if ( in_array( $level, ClanCats::...
[ "private", "static", "function", "is_fatal_level", "(", "$", "level", ")", "{", "$", "fatals", "=", "array", "(", "E_ERROR", ",", "E_PARSE", ",", "E_CORE_ERROR", ",", "E_CORE_WARNING", ",", "E_COMPILE_ERROR", ",", "E_COMPILE_WARNING", ",", "E_DEPRECATED", ",", ...
check if a level is fatal @param int $level @return bool
[ "check", "if", "a", "level", "is", "fatal" ]
train
https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCError.php#L105-L126
ClanCats/Core
src/classes/CCError.php
CCError.exception
public static function exception( $exception ) { // clean the main output buffer while ( ob_get_level() > 0 ) { ob_end_clean(); } $error_handler = "\\".CCCORE_NAMESPACE."\\CCError_Handler".( ClanCats::is_cli() ? '_Cli' : '' ); $error_inspector = "\\".CCCORE_NAMESPACE."\\CCError_Inspector"; if ...
php
public static function exception( $exception ) { // clean the main output buffer while ( ob_get_level() > 0 ) { ob_end_clean(); } $error_handler = "\\".CCCORE_NAMESPACE."\\CCError_Handler".( ClanCats::is_cli() ? '_Cli' : '' ); $error_inspector = "\\".CCCORE_NAMESPACE."\\CCError_Inspector"; if ...
[ "public", "static", "function", "exception", "(", "$", "exception", ")", "{", "// clean the main output buffer", "while", "(", "ob_get_level", "(", ")", ">", "0", ")", "{", "ob_end_clean", "(", ")", ";", "}", "$", "error_handler", "=", "\"\\\\\"", ".", "CCCO...
exception handler @param Exception $exception @return void
[ "exception", "handler" ]
train
https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCError.php#L134-L156
ClanCats/Core
src/classes/CCError.php
CCError.error
public static function error( $num, $message, $file, $line ) { $exception = new CCException( static::$error_types[$num]." - ".$message, 0, $num, $file, $line ); if ( static::is_fatal_level( $num ) ) { if ( static::$in_shutdown_process ) { static::exception( $exception ); } else { thro...
php
public static function error( $num, $message, $file, $line ) { $exception = new CCException( static::$error_types[$num]." - ".$message, 0, $num, $file, $line ); if ( static::is_fatal_level( $num ) ) { if ( static::$in_shutdown_process ) { static::exception( $exception ); } else { thro...
[ "public", "static", "function", "error", "(", "$", "num", ",", "$", "message", ",", "$", "file", ",", "$", "line", ")", "{", "$", "exception", "=", "new", "CCException", "(", "static", "::", "$", "error_types", "[", "$", "num", "]", ".", "\" - \"", ...
The error handler converts PHP errors to CCExceptions. These get handled by the CCError exception handler. Also the error handler decides the fatality of an error. @param CCException $exception @return void
[ "The", "error", "handler", "converts", "PHP", "errors", "to", "CCExceptions", ".", "These", "get", "handled", "by", "the", "CCError", "exception", "handler", "." ]
train
https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCError.php#L167-L184
ClanCats/Core
src/classes/CCError.php
CCError.shutdown
public static function shutdown() { // enter shutdown context static::$in_shutdown_process = true; $error = error_get_last(); // if the error is not null and the level is // fatal. Forward the error to our error handler. if ( !is_null( $error ) && static::is_fatal_level( $error['type'] ) ) { ...
php
public static function shutdown() { // enter shutdown context static::$in_shutdown_process = true; $error = error_get_last(); // if the error is not null and the level is // fatal. Forward the error to our error handler. if ( !is_null( $error ) && static::is_fatal_level( $error['type'] ) ) { ...
[ "public", "static", "function", "shutdown", "(", ")", "{", "// enter shutdown context", "static", "::", "$", "in_shutdown_process", "=", "true", ";", "$", "error", "=", "error_get_last", "(", ")", ";", "// if the error is not null and the level is ", "// fatal. Forward ...
shutdown handler @return void
[ "shutdown", "handler" ]
train
https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCError.php#L191-L204
yuncms/framework
src/admin/widgets/Nav.php
Nav.run
public function run() { $tag = ArrayHelper::remove($options, 'tag', 'ul'); return Html::tag($tag, $this->top . $this->renderItems($this->items), $this->options); }
php
public function run() { $tag = ArrayHelper::remove($options, 'tag', 'ul'); return Html::tag($tag, $this->top . $this->renderItems($this->items), $this->options); }
[ "public", "function", "run", "(", ")", "{", "$", "tag", "=", "ArrayHelper", "::", "remove", "(", "$", "options", ",", "'tag'", ",", "'ul'", ")", ";", "return", "Html", "::", "tag", "(", "$", "tag", ",", "$", "this", "->", "top", ".", "$", "this",...
执行 @throws InvalidConfigException
[ "执行" ]
train
https://github.com/yuncms/framework/blob/af42e28ea4ae15ab8eead3f6d119f93863b94154/src/admin/widgets/Nav.php#L135-L139
yuncms/framework
src/admin/widgets/Nav.php
Nav.renderItems
public function renderItems($items) { if (is_string($items)) { return $items; } $lines = []; foreach ($items as $item) { if (is_string($item)) { return $item; } if (!isset ($item['label'])) { throw new In...
php
public function renderItems($items) { if (is_string($items)) { return $items; } $lines = []; foreach ($items as $item) { if (is_string($item)) { return $item; } if (!isset ($item['label'])) { throw new In...
[ "public", "function", "renderItems", "(", "$", "items", ")", "{", "if", "(", "is_string", "(", "$", "items", ")", ")", "{", "return", "$", "items", ";", "}", "$", "lines", "=", "[", "]", ";", "foreach", "(", "$", "items", "as", "$", "item", ")", ...
渲染所以项目 @param $items @return null|string @throws InvalidConfigException
[ "渲染所以项目" ]
train
https://github.com/yuncms/framework/blob/af42e28ea4ae15ab8eead3f6d119f93863b94154/src/admin/widgets/Nav.php#L147-L211
raoul2000/yii2-scrollup-widget
Scrollup.php
Scrollup.init
public function init() { parent::init(); if (! empty($this->theme) && ! in_array($this->theme, $this->_supportedThemes)) { throw new InvalidConfigException('Unsupported built-in theme : ' . $this->theme); } if (isset($this->pluginOptions['animation']) && ! in_array($this->pluginOptions['animation'], $this->...
php
public function init() { parent::init(); if (! empty($this->theme) && ! in_array($this->theme, $this->_supportedThemes)) { throw new InvalidConfigException('Unsupported built-in theme : ' . $this->theme); } if (isset($this->pluginOptions['animation']) && ! in_array($this->pluginOptions['animation'], $this->...
[ "public", "function", "init", "(", ")", "{", "parent", "::", "init", "(", ")", ";", "if", "(", "!", "empty", "(", "$", "this", "->", "theme", ")", "&&", "!", "in_array", "(", "$", "this", "->", "theme", ",", "$", "this", "->", "_supportedThemes", ...
Chekcs validity of theme and animation options
[ "Chekcs", "validity", "of", "theme", "and", "animation", "options" ]
train
https://github.com/raoul2000/yii2-scrollup-widget/blob/54d0d40755d81b039b90bfb36ed90325294b6864/Scrollup.php#L66-L75
raoul2000/yii2-scrollup-widget
Scrollup.php
Scrollup.registerClientScript
public function registerClientScript() { $view = $this->getView(); if (isset($this->theme)) { $path = $view->getAssetManager()->publish(__DIR__ . '/assets/css/themes'); $view->registerCSSFile($path[1] . '/' . $this->theme . '.css'); if ($this->theme == 'image' && isset($this->pluginOptions['scrollText']...
php
public function registerClientScript() { $view = $this->getView(); if (isset($this->theme)) { $path = $view->getAssetManager()->publish(__DIR__ . '/assets/css/themes'); $view->registerCSSFile($path[1] . '/' . $this->theme . '.css'); if ($this->theme == 'image' && isset($this->pluginOptions['scrollText']...
[ "public", "function", "registerClientScript", "(", ")", "{", "$", "view", "=", "$", "this", "->", "getView", "(", ")", ";", "if", "(", "isset", "(", "$", "this", "->", "theme", ")", ")", "{", "$", "path", "=", "$", "view", "->", "getAssetManager", ...
Registers the needed JavaScript and inject the JS initialization code. Note that if a supported theme is set, all css in the assets/css/theme folder are published but only the css for the theme is registred.Moreover, if the select theme is 'image', the 'scrollText plugin option is cleared.
[ "Registers", "the", "needed", "JavaScript", "and", "inject", "the", "JS", "initialization", "code", "." ]
train
https://github.com/raoul2000/yii2-scrollup-widget/blob/54d0d40755d81b039b90bfb36ed90325294b6864/Scrollup.php#L92-L110
fubhy/graphql-php
src/Language/Source.php
Source.getLocation
public function getLocation($position) { $pattern = '/\r\n|[\n\r\u2028\u2029]/g'; $subject = mb_substr($this->body, 0, $position, 'UTF-8'); preg_match_all($pattern, $subject, $matches, PREG_OFFSET_CAPTURE); $location = array_reduce($matches[0], function ($carry, $match) use ($positi...
php
public function getLocation($position) { $pattern = '/\r\n|[\n\r\u2028\u2029]/g'; $subject = mb_substr($this->body, 0, $position, 'UTF-8'); preg_match_all($pattern, $subject, $matches, PREG_OFFSET_CAPTURE); $location = array_reduce($matches[0], function ($carry, $match) use ($positi...
[ "public", "function", "getLocation", "(", "$", "position", ")", "{", "$", "pattern", "=", "'/\\r\\n|[\\n\\r\\u2028\\u2029]/g'", ";", "$", "subject", "=", "mb_substr", "(", "$", "this", "->", "body", ",", "0", ",", "$", "position", ",", "'UTF-8'", ")", ";",...
Takes a Source and a UTF-8 character offset, and returns the corresponding line and column as a SourceLocation. @param $position @return \Fubhy\GraphQL\Language\SourceLocation
[ "Takes", "a", "Source", "and", "a", "UTF", "-", "8", "character", "offset", "and", "returns", "the", "corresponding", "line", "and", "column", "as", "a", "SourceLocation", "." ]
train
https://github.com/fubhy/graphql-php/blob/c1de2233c731ca29e5c5db4c43f3b9db36478c83/src/Language/Source.php#L74-L88
spiral-modules/auth
source/Auth/Middlewares/Firewalls/RedirectFirewall.php
RedirectFirewall.withRedirect
public function withRedirect(UriInterface $uri): self { $middleware = clone $this; $middleware->redirect = $uri; return $middleware; }
php
public function withRedirect(UriInterface $uri): self { $middleware = clone $this; $middleware->redirect = $uri; return $middleware; }
[ "public", "function", "withRedirect", "(", "UriInterface", "$", "uri", ")", ":", "self", "{", "$", "middleware", "=", "clone", "$", "this", ";", "$", "middleware", "->", "redirect", "=", "$", "uri", ";", "return", "$", "middleware", ";", "}" ]
@param UriInterface $uri @return RedirectFirewall
[ "@param", "UriInterface", "$uri" ]
train
https://github.com/spiral-modules/auth/blob/24e2070028f7257e8192914556963a4794428a99/source/Auth/Middlewares/Firewalls/RedirectFirewall.php#L49-L55
spiral-modules/auth
source/Auth/Middlewares/Firewalls/RedirectFirewall.php
RedirectFirewall.denyAccess
public function denyAccess(Request $request, Response $response, callable $next) { return $response->withStatus($this->status)->withHeader( 'Location', (string)$this->redirect ); }
php
public function denyAccess(Request $request, Response $response, callable $next) { return $response->withStatus($this->status)->withHeader( 'Location', (string)$this->redirect ); }
[ "public", "function", "denyAccess", "(", "Request", "$", "request", ",", "Response", "$", "response", ",", "callable", "$", "next", ")", "{", "return", "$", "response", "->", "withStatus", "(", "$", "this", "->", "status", ")", "->", "withHeader", "(", "...
{@inheritdoc}
[ "{" ]
train
https://github.com/spiral-modules/auth/blob/24e2070028f7257e8192914556963a4794428a99/source/Auth/Middlewares/Firewalls/RedirectFirewall.php#L60-L66
joomlatools/joomlatools-platform-legacy
code/base/node.php
JNode.addChild
public function addChild(&$child) { JLog::add('JNode::addChild() is deprecated.', JLog::WARNING, 'deprecated'); if ($child instanceof Jnode) { $child->setParent($this); } }
php
public function addChild(&$child) { JLog::add('JNode::addChild() is deprecated.', JLog::WARNING, 'deprecated'); if ($child instanceof Jnode) { $child->setParent($this); } }
[ "public", "function", "addChild", "(", "&", "$", "child", ")", "{", "JLog", "::", "add", "(", "'JNode::addChild() is deprecated.'", ",", "JLog", "::", "WARNING", ",", "'deprecated'", ")", ";", "if", "(", "$", "child", "instanceof", "Jnode", ")", "{", "$", ...
Add child to this node If the child already has a parent, the link is unset @param JNode &$child The child to be added @return void @since 11.1
[ "Add", "child", "to", "this", "node" ]
train
https://github.com/joomlatools/joomlatools-platform-legacy/blob/3a76944e2f2c415faa6504754c75321a3b478c06/code/base/node.php#L60-L68
joomlatools/joomlatools-platform-legacy
code/base/node.php
JNode.setParent
public function setParent(&$parent) { JLog::add('JNode::setParent() is deprecated.', JLog::WARNING, 'deprecated'); if ($parent instanceof JNode || is_null($parent)) { $hash = spl_object_hash($this); if (!is_null($this->_parent)) { unset($this->_parent->children[$hash]); } if (!is_null($pare...
php
public function setParent(&$parent) { JLog::add('JNode::setParent() is deprecated.', JLog::WARNING, 'deprecated'); if ($parent instanceof JNode || is_null($parent)) { $hash = spl_object_hash($this); if (!is_null($this->_parent)) { unset($this->_parent->children[$hash]); } if (!is_null($pare...
[ "public", "function", "setParent", "(", "&", "$", "parent", ")", "{", "JLog", "::", "add", "(", "'JNode::setParent() is deprecated.'", ",", "JLog", "::", "WARNING", ",", "'deprecated'", ")", ";", "if", "(", "$", "parent", "instanceof", "JNode", "||", "is_nul...
Set the parent of a this node If the node already has a parent, the link is unset @param mixed &$parent The JNode for parent to be set or null @return void @since 11.1
[ "Set", "the", "parent", "of", "a", "this", "node" ]
train
https://github.com/joomlatools/joomlatools-platform-legacy/blob/3a76944e2f2c415faa6504754c75321a3b478c06/code/base/node.php#L81-L101
Nobiles2/smsapi-bundle
DependencyInjection/KCHSmsApiExtension.php
KCHSmsApiExtension.load
public function load(array $configs, ContainerBuilder $container) { $configuration = new Configuration(); $config = $this->processConfiguration($configuration, $configs); $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); $loader->load(...
php
public function load(array $configs, ContainerBuilder $container) { $configuration = new Configuration(); $config = $this->processConfiguration($configuration, $configs); $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); $loader->load(...
[ "public", "function", "load", "(", "array", "$", "configs", ",", "ContainerBuilder", "$", "container", ")", "{", "$", "configuration", "=", "new", "Configuration", "(", ")", ";", "$", "config", "=", "$", "this", "->", "processConfiguration", "(", "$", "con...
{@inheritdoc}
[ "{" ]
train
https://github.com/Nobiles2/smsapi-bundle/blob/f3f5e76e021b6a5da8c8d8accb81c4e283b9faa7/DependencyInjection/KCHSmsApiExtension.php#L21-L43
Nobiles2/smsapi-bundle
DependencyInjection/KCHSmsApiExtension.php
KCHSmsApiExtension.registerFactories
private function registerFactories(ContainerBuilder $container, Definition $clientService, $clientName) { // SmsFactory $container->setDefinition( sprintf('kch_sms_api.sms_factory.%s', $clientName), new Definition('%kch_sms_api.sms_factory.class%') ) ->add...
php
private function registerFactories(ContainerBuilder $container, Definition $clientService, $clientName) { // SmsFactory $container->setDefinition( sprintf('kch_sms_api.sms_factory.%s', $clientName), new Definition('%kch_sms_api.sms_factory.class%') ) ->add...
[ "private", "function", "registerFactories", "(", "ContainerBuilder", "$", "container", ",", "Definition", "$", "clientService", ",", "$", "clientName", ")", "{", "// SmsFactory", "$", "container", "->", "setDefinition", "(", "sprintf", "(", "'kch_sms_api.sms_factory.%...
Method register all library factories for Client. @param ContainerBuilder $container @param Definition $clientService @param $clientName
[ "Method", "register", "all", "library", "factories", "for", "Client", "." ]
train
https://github.com/Nobiles2/smsapi-bundle/blob/f3f5e76e021b6a5da8c8d8accb81c4e283b9faa7/DependencyInjection/KCHSmsApiExtension.php#L52-L93
webforge-labs/psc-cms
lib/Psc/Doctrine/EntityBuilder.php
EntityBuilder.generateI18nAPI
public function generateI18nAPI(ClassBuilderProperty $property, $originalName, $originalFlags = 0x000000, $originalUpperCaseName = NULL) { $originalType = $property->getType()->getType(); $properties = array(); foreach ($this->getLanguages() as $lang) { $properties[$lang] = $this->createProperty(...
php
public function generateI18nAPI(ClassBuilderProperty $property, $originalName, $originalFlags = 0x000000, $originalUpperCaseName = NULL) { $originalType = $property->getType()->getType(); $properties = array(); foreach ($this->getLanguages() as $lang) { $properties[$lang] = $this->createProperty(...
[ "public", "function", "generateI18nAPI", "(", "ClassBuilderProperty", "$", "property", ",", "$", "originalName", ",", "$", "originalFlags", "=", "0x000000", ",", "$", "originalUpperCaseName", "=", "NULL", ")", "{", "$", "originalType", "=", "$", "property", "->"...
Erstellt die i18nAPI für ein i18nProperty i18nPropertyName ist title: erstellt einen virtuellen Getter für den OriginalNamen des Properties (getTitle($lang)) erstellt einen virtuellen Setter für den OriginalNamen des Properties (setTitle($value, $lang)) setI18nTitle(Array $titles); getI18nTitle() -> array gibt es sc...
[ "Erstellt", "die", "i18nAPI", "für", "ein", "i18nProperty" ]
train
https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/Doctrine/EntityBuilder.php#L216-L281
webforge-labs/psc-cms
lib/Psc/Doctrine/EntityBuilder.php
EntityBuilder.createRelation
public function createRelation($relationType, EntityRelationMeta $source, EntityRelationMeta $target, $side = NULL, $updateOtherSide = true) { Code::value($relationType, self::RELATION_MANY_TO_MANY, self::RELATION_MANY_TO_ONE, self::RELATION_ONE_TO_MANY, self::RELATION_ONE_TO_ONE); Code::value($side, self::SIDE...
php
public function createRelation($relationType, EntityRelationMeta $source, EntityRelationMeta $target, $side = NULL, $updateOtherSide = true) { Code::value($relationType, self::RELATION_MANY_TO_MANY, self::RELATION_MANY_TO_ONE, self::RELATION_ONE_TO_MANY, self::RELATION_ONE_TO_ONE); Code::value($side, self::SIDE...
[ "public", "function", "createRelation", "(", "$", "relationType", ",", "EntityRelationMeta", "$", "source", ",", "EntityRelationMeta", "$", "target", ",", "$", "side", "=", "NULL", ",", "$", "updateOtherSide", "=", "true", ")", "{", "Code", "::", "value", "(...
Legacy Interface für den ModelCompiler (für den ersten Wurf) erstellt eine Relation und ruft direkt buildRelation auf @return EntityRelation
[ "Legacy", "Interface", "für", "den", "ModelCompiler", "(", "für", "den", "ersten", "Wurf", ")" ]
train
https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/Doctrine/EntityBuilder.php#L299-L316
webforge-labs/psc-cms
lib/Psc/Doctrine/EntityBuilder.php
EntityBuilder.buildSetMetaGetter
public function buildSetMetaGetter(CodeExporter $codeExporter = NULL) { if (!isset($codeExporter)) $codeExporter = new CodeExporter(new CodeWriter); $code = array(); $code[] = 'return new \Psc\Data\SetMeta(array('; foreach ($this->getProperties() as $property) { if ($property->getWasElevated(...
php
public function buildSetMetaGetter(CodeExporter $codeExporter = NULL) { if (!isset($codeExporter)) $codeExporter = new CodeExporter(new CodeWriter); $code = array(); $code[] = 'return new \Psc\Data\SetMeta(array('; foreach ($this->getProperties() as $property) { if ($property->getWasElevated(...
[ "public", "function", "buildSetMetaGetter", "(", "CodeExporter", "$", "codeExporter", "=", "NULL", ")", "{", "if", "(", "!", "isset", "(", "$", "codeExporter", ")", ")", "$", "codeExporter", "=", "new", "CodeExporter", "(", "new", "CodeWriter", ")", ";", "...
Erstellt eine Funktion die für das Entity eine SetMeta mit allen Properties zurückgibt @chainable
[ "Erstellt", "eine", "Funktion", "die", "für", "das", "Entity", "eine", "SetMeta", "mit", "allen", "Properties", "zurückgibt" ]
train
https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/Doctrine/EntityBuilder.php#L414-L438
webforge-labs/psc-cms
lib/Psc/Doctrine/EntityBuilder.php
EntityBuilder.isMetaProperty
public function isMetaProperty($property) { if (array_key_exists($property->getName(), $this->forcedMetaProperties)) return $this->forcedMetaProperties[$property->getName()]; return TRUE; }
php
public function isMetaProperty($property) { if (array_key_exists($property->getName(), $this->forcedMetaProperties)) return $this->forcedMetaProperties[$property->getName()]; return TRUE; }
[ "public", "function", "isMetaProperty", "(", "$", "property", ")", "{", "if", "(", "array_key_exists", "(", "$", "property", "->", "getName", "(", ")", ",", "$", "this", "->", "forcedMetaProperties", ")", ")", "return", "$", "this", "->", "forcedMetaProperti...
Soll dsa Property z.b. im SetMetaGetter genannt werden?
[ "Soll", "dsa", "Property", "z", ".", "b", ".", "im", "SetMetaGetter", "genannt", "werden?" ]
train
https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/Doctrine/EntityBuilder.php#L443-L447
webforge-labs/psc-cms
lib/Psc/Doctrine/EntityBuilder.php
EntityBuilder.getTableName
public function getTableName() { if (!isset($this->tableName)) { return \Doctrine\Common\Util\Inflector::tableize($this->getEntityName()).'s'; } return $this->tableName; }
php
public function getTableName() { if (!isset($this->tableName)) { return \Doctrine\Common\Util\Inflector::tableize($this->getEntityName()).'s'; } return $this->tableName; }
[ "public", "function", "getTableName", "(", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "tableName", ")", ")", "{", "return", "\\", "Doctrine", "\\", "Common", "\\", "Util", "\\", "Inflector", "::", "tableize", "(", "$", "this", "->", "...
return string@
[ "return", "string" ]
train
https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/Doctrine/EntityBuilder.php#L641-L646
ClanCats/Core
src/classes/CCIn/Instance.php
CCIn_Instance.get
public function get( $key, $default = null ) { if ( !isset( $this->GET[$key] ) ) { return $default; } return $this->GET[$key]; }
php
public function get( $key, $default = null ) { if ( !isset( $this->GET[$key] ) ) { return $default; } return $this->GET[$key]; }
[ "public", "function", "get", "(", "$", "key", ",", "$", "default", "=", "null", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "GET", "[", "$", "key", "]", ")", ")", "{", "return", "$", "default", ";", "}", "return", "$", "this", ...
get a GET param @param string $key @param mixed $default @return mixed
[ "get", "a", "GET", "param" ]
train
https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCIn/Instance.php#L77-L84
ClanCats/Core
src/classes/CCIn/Instance.php
CCIn_Instance.post
public function post( $key, $default = null ) { if ( !isset( $this->POST[$key] ) ) { return $default; } return $this->POST[$key]; }
php
public function post( $key, $default = null ) { if ( !isset( $this->POST[$key] ) ) { return $default; } return $this->POST[$key]; }
[ "public", "function", "post", "(", "$", "key", ",", "$", "default", "=", "null", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "POST", "[", "$", "key", "]", ")", ")", "{", "return", "$", "default", ";", "}", "return", "$", "this", ...
get a POST param @param string $key @param mixed $default @return mixed
[ "get", "a", "POST", "param" ]
train
https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCIn/Instance.php#L104-L111
ClanCats/Core
src/classes/CCIn/Instance.php
CCIn_Instance.server
public function server( $key, $default = null ) { if ( !isset( $this->SERVER[strtoupper( $key )] ) ) { return $default; } return $this->SERVER[strtoupper( $key )]; }
php
public function server( $key, $default = null ) { if ( !isset( $this->SERVER[strtoupper( $key )] ) ) { return $default; } return $this->SERVER[strtoupper( $key )]; }
[ "public", "function", "server", "(", "$", "key", ",", "$", "default", "=", "null", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "SERVER", "[", "strtoupper", "(", "$", "key", ")", "]", ")", ")", "{", "return", "$", "default", ";", ...
get a SERVER param @param string $key @return mixed
[ "get", "a", "SERVER", "param" ]
train
https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCIn/Instance.php#L130-L136
ClanCats/Core
src/classes/CCIn/Instance.php
CCIn_Instance.file
public function file( $key, $default = null ) { if ( !isset( $this->FILES[$key] ) ) { return $default; } return $this->FILES[$key]; }
php
public function file( $key, $default = null ) { if ( !isset( $this->FILES[$key] ) ) { return $default; } return $this->FILES[$key]; }
[ "public", "function", "file", "(", "$", "key", ",", "$", "default", "=", "null", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "FILES", "[", "$", "key", "]", ")", ")", "{", "return", "$", "default", ";", "}", "return", "$", "this",...
get a FILE param @param string $key @param mixed $default @return mixed
[ "get", "a", "FILE", "param" ]
train
https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCIn/Instance.php#L156-L163
ClanCats/Core
src/classes/CCIn/Instance.php
CCIn_Instance.client
public function client( $key = null ) { // check if we already set the client object if ( is_null( $this->client ) ) { // make client $this->client = new \stdClass; /* * get clients ip address */ // Cloudlfare fix if ( $this->has_server( 'HTTP_CF_CONNECTING_IP' ) ) { $this->cli...
php
public function client( $key = null ) { // check if we already set the client object if ( is_null( $this->client ) ) { // make client $this->client = new \stdClass; /* * get clients ip address */ // Cloudlfare fix if ( $this->has_server( 'HTTP_CF_CONNECTING_IP' ) ) { $this->cli...
[ "public", "function", "client", "(", "$", "key", "=", "null", ")", "{", "// check if we already set the client object", "if", "(", "is_null", "(", "$", "this", "->", "client", ")", ")", "{", "// make client ", "$", "this", "->", "client", "=", "new", "\\", ...
get the client data @param string $key @return mixed
[ "get", "the", "client", "data" ]
train
https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCIn/Instance.php#L182-L243
ClanCats/Core
src/classes/CCIn/Instance.php
CCIn_Instance.method
public function method( $is = null ) { if ( !is_null( $is ) ) { return strtoupper( $is ) === $this->method(); } return strtoupper( $this->server( 'HTTP_X_HTTP_METHOD_OVERRIDE', $this->server( 'REQUEST_METHOD', 'GET' ) ) ); }
php
public function method( $is = null ) { if ( !is_null( $is ) ) { return strtoupper( $is ) === $this->method(); } return strtoupper( $this->server( 'HTTP_X_HTTP_METHOD_OVERRIDE', $this->server( 'REQUEST_METHOD', 'GET' ) ) ); }
[ "public", "function", "method", "(", "$", "is", "=", "null", ")", "{", "if", "(", "!", "is_null", "(", "$", "is", ")", ")", "{", "return", "strtoupper", "(", "$", "is", ")", "===", "$", "this", "->", "method", "(", ")", ";", "}", "return", "str...
get the current requesting method GET, POST, PUT, DELETE @param string $is @return string
[ "get", "the", "current", "requesting", "method", "GET", "POST", "PUT", "DELETE" ]
train
https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCIn/Instance.php#L252-L260
ClanCats/Core
src/classes/CCIn/Instance.php
CCIn_Instance.uri
public function uri( $full = false ) { // check if we already set the current uri if ( is_null( $this->uri ) ) { $this->uri = $this->server('REQUEST_URI', '/' ); // fix doubled slashes $this->uri = preg_replace( '/(\/+)/','/', $this->uri ); // remove get params if ( !$full ) { $t...
php
public function uri( $full = false ) { // check if we already set the current uri if ( is_null( $this->uri ) ) { $this->uri = $this->server('REQUEST_URI', '/' ); // fix doubled slashes $this->uri = preg_replace( '/(\/+)/','/', $this->uri ); // remove get params if ( !$full ) { $t...
[ "public", "function", "uri", "(", "$", "full", "=", "false", ")", "{", "// check if we already set the current uri", "if", "(", "is_null", "(", "$", "this", "->", "uri", ")", ")", "{", "$", "this", "->", "uri", "=", "$", "this", "->", "server", "(", "'...
get the requestet uri @param bool $full Don't cut the get params @return string
[ "get", "the", "requestet", "uri" ]
train
https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCIn/Instance.php#L308-L334
ClanCats/Core
src/bundles/Database/Handler/Driver.php
Handler_Driver.connect
public function connect( $conf ) { $connection_params = array(); foreach( $conf as $key => $value ) { if ( is_string( $value ) ) { $connection_params[ '{'.$key.'}' ] = $value; } } $connection_string = \CCStr::replace( $this->connection_string, $connection_params ); $this->connecti...
php
public function connect( $conf ) { $connection_params = array(); foreach( $conf as $key => $value ) { if ( is_string( $value ) ) { $connection_params[ '{'.$key.'}' ] = $value; } } $connection_string = \CCStr::replace( $this->connection_string, $connection_params ); $this->connecti...
[ "public", "function", "connect", "(", "$", "conf", ")", "{", "$", "connection_params", "=", "array", "(", ")", ";", "foreach", "(", "$", "conf", "as", "$", "key", "=>", "$", "value", ")", "{", "if", "(", "is_string", "(", "$", "value", ")", ")", ...
connect to database @param array $conf @return bool
[ "connect", "to", "database" ]
train
https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/bundles/Database/Handler/Driver.php#L34-L61
mihai-stancu/serializer
Serializer/Encoder/UbjsonEncoder.php
UbjsonEncoder.decode
public function decode($data, $format, array $context = array()) { $value = Encoder::decode($data, Encoder::TYPE_ARRAY); return $value; }
php
public function decode($data, $format, array $context = array()) { $value = Encoder::decode($data, Encoder::TYPE_ARRAY); return $value; }
[ "public", "function", "decode", "(", "$", "data", ",", "$", "format", ",", "array", "$", "context", "=", "array", "(", ")", ")", "{", "$", "value", "=", "Encoder", "::", "decode", "(", "$", "data", ",", "Encoder", "::", "TYPE_ARRAY", ")", ";", "ret...
@param string $data @param string $format @param array $context @return mixed
[ "@param", "string", "$data", "@param", "string", "$format", "@param", "array", "$context" ]
train
https://github.com/mihai-stancu/serializer/blob/4d96f942a3c44d5b5652868be726af656bf1baad/Serializer/Encoder/UbjsonEncoder.php#L45-L50
drnkwati/guzzle-promises
src/Promise.php
Promise.__callHandler
public static function __callHandler($index, $value, array $handler) { /** @var PromiseInterface $promise */ $promise = $handler[0]; // The promise may have been cancelled or resolved before placing // this thunk in the queue. if ($promise->getState() !== self::PENDING) { ...
php
public static function __callHandler($index, $value, array $handler) { /** @var PromiseInterface $promise */ $promise = $handler[0]; // The promise may have been cancelled or resolved before placing // this thunk in the queue. if ($promise->getState() !== self::PENDING) { ...
[ "public", "static", "function", "__callHandler", "(", "$", "index", ",", "$", "value", ",", "array", "$", "handler", ")", "{", "/** @var PromiseInterface $promise */", "$", "promise", "=", "$", "handler", "[", "0", "]", ";", "// The promise may have been cancelled...
Call a stack of handlers using a specific callback index and value. @internal @param int $index 1 (resolve) or 2 (reject). @param mixed $value Value to pass to the callback. @param array $handler Array of handler data (promise and callbacks). @return array Returns the next group to resolve.
[ "Call", "a", "stack", "of", "handlers", "using", "a", "specific", "callback", "index", "and", "value", "." ]
train
https://github.com/drnkwati/guzzle-promises/blob/e5c302747c348d618474add41c7d442bb1bfc2cf/src/Promise.php#L193-L219
inc2734/wp-share-buttons
src/App/Contract/Model/Requester.php
Requester._add_localize_script
public function _add_localize_script() { $handle = get_template(); if ( ! wp_script_is( get_template() ) && wp_script_is( get_stylesheet() ) ) { $handle = get_stylesheet(); } $handle = apply_filters( 'inc2734_wp_share_buttons_localize_script_handle', $handle ); wp_localize_script( $handle, 'inc2734_...
php
public function _add_localize_script() { $handle = get_template(); if ( ! wp_script_is( get_template() ) && wp_script_is( get_stylesheet() ) ) { $handle = get_stylesheet(); } $handle = apply_filters( 'inc2734_wp_share_buttons_localize_script_handle', $handle ); wp_localize_script( $handle, 'inc2734_...
[ "public", "function", "_add_localize_script", "(", ")", "{", "$", "handle", "=", "get_template", "(", ")", ";", "if", "(", "!", "wp_script_is", "(", "get_template", "(", ")", ")", "&&", "wp_script_is", "(", "get_stylesheet", "(", ")", ")", ")", "{", "$",...
Setup localize script @return void
[ "Setup", "localize", "script" ]
train
https://github.com/inc2734/wp-share-buttons/blob/cd032893ca083a343f5871e855cce68f4ede3a17/src/App/Contract/Model/Requester.php#L44-L60
inc2734/wp-share-buttons
src/App/Contract/Model/Requester.php
Requester._ajax
public function _ajax() { check_ajax_referer( $this->_get_nonce_key() ); if ( ! isset( $_GET['post_id'] ) ) { $this->_send_json( '-' ); return; } $post_id = sanitize_text_field( wp_unslash( $_GET['post_id'] ) ); $count_cache = new Count_Cache( $post_id, $this->service_name ); $cache = $count_cache-...
php
public function _ajax() { check_ajax_referer( $this->_get_nonce_key() ); if ( ! isset( $_GET['post_id'] ) ) { $this->_send_json( '-' ); return; } $post_id = sanitize_text_field( wp_unslash( $_GET['post_id'] ) ); $count_cache = new Count_Cache( $post_id, $this->service_name ); $cache = $count_cache-...
[ "public", "function", "_ajax", "(", ")", "{", "check_ajax_referer", "(", "$", "this", "->", "_get_nonce_key", "(", ")", ")", ";", "if", "(", "!", "isset", "(", "$", "_GET", "[", "'post_id'", "]", ")", ")", "{", "$", "this", "->", "_send_json", "(", ...
Ajax @return void
[ "Ajax" ]
train
https://github.com/inc2734/wp-share-buttons/blob/cd032893ca083a343f5871e855cce68f4ede3a17/src/App/Contract/Model/Requester.php#L67-L87
inc2734/wp-share-buttons
src/App/Contract/Model/Requester.php
Requester._request
protected function _request() { if ( empty( $_GET['post_id'] ) ) { return '-'; } $permalink = get_permalink( sanitize_text_field( wp_unslash( $_GET['post_id'] ) ) ); if ( ! $permalink ) { return '-'; } if ( 0 === strpos( $permalink, 'http://' ) ) { $count = $this->_get_count( rawurlencode( $perma...
php
protected function _request() { if ( empty( $_GET['post_id'] ) ) { return '-'; } $permalink = get_permalink( sanitize_text_field( wp_unslash( $_GET['post_id'] ) ) ); if ( ! $permalink ) { return '-'; } if ( 0 === strpos( $permalink, 'http://' ) ) { $count = $this->_get_count( rawurlencode( $perma...
[ "protected", "function", "_request", "(", ")", "{", "if", "(", "empty", "(", "$", "_GET", "[", "'post_id'", "]", ")", ")", "{", "return", "'-'", ";", "}", "$", "permalink", "=", "get_permalink", "(", "sanitize_text_field", "(", "wp_unslash", "(", "$", ...
Request to API @return int Count
[ "Request", "to", "API" ]
train
https://github.com/inc2734/wp-share-buttons/blob/cd032893ca083a343f5871e855cce68f4ede3a17/src/App/Contract/Model/Requester.php#L112-L138
inc2734/wp-share-buttons
src/App/Contract/Model/Requester.php
Requester._add
protected function _add( $arg1, $arg2 ) { if ( is_numeric( $arg1 ) && is_numeric( $arg2 ) ) { return $arg1 + $arg2; } elseif ( is_numeric( $arg2 ) ) { return $arg1; } elseif ( is_numeric( $arg2 ) ) { return $arg2; } return '-'; }
php
protected function _add( $arg1, $arg2 ) { if ( is_numeric( $arg1 ) && is_numeric( $arg2 ) ) { return $arg1 + $arg2; } elseif ( is_numeric( $arg2 ) ) { return $arg1; } elseif ( is_numeric( $arg2 ) ) { return $arg2; } return '-'; }
[ "protected", "function", "_add", "(", "$", "arg1", ",", "$", "arg2", ")", "{", "if", "(", "is_numeric", "(", "$", "arg1", ")", "&&", "is_numeric", "(", "$", "arg2", ")", ")", "{", "return", "$", "arg1", "+", "$", "arg2", ";", "}", "elseif", "(", ...
Add count @param int|- $a @param int|- $b
[ "Add", "count" ]
train
https://github.com/inc2734/wp-share-buttons/blob/cd032893ca083a343f5871e855cce68f4ede3a17/src/App/Contract/Model/Requester.php#L146-L156
AydinHassan/cli-md-renderer
src/Renderer/ParagraphRenderer.php
ParagraphRenderer.render
public function render(AbstractBlock $block, CliRenderer $renderer) { if (!($block instanceof Paragraph)) { throw new \InvalidArgumentException(sprintf('Incompatible block type: "%s"', get_class($block))); } return $renderer->renderInlines($block->children()) . "\n"; }
php
public function render(AbstractBlock $block, CliRenderer $renderer) { if (!($block instanceof Paragraph)) { throw new \InvalidArgumentException(sprintf('Incompatible block type: "%s"', get_class($block))); } return $renderer->renderInlines($block->children()) . "\n"; }
[ "public", "function", "render", "(", "AbstractBlock", "$", "block", ",", "CliRenderer", "$", "renderer", ")", "{", "if", "(", "!", "(", "$", "block", "instanceof", "Paragraph", ")", ")", "{", "throw", "new", "\\", "InvalidArgumentException", "(", "sprintf", ...
@param AbstractBlock $block @param CliRenderer $renderer @return string
[ "@param", "AbstractBlock", "$block", "@param", "CliRenderer", "$renderer" ]
train
https://github.com/AydinHassan/cli-md-renderer/blob/521f9ace2aeadd58bf8a3910704be8360f5bd7b2/src/Renderer/ParagraphRenderer.php#L23-L30
rayrutjes/domain-foundation
src/Repository/AggregateRootRepository.php
AggregateRootRepository.load
public function load(AggregateRootIdentifier $aggregateRootIdentifier, $expectedVersion = null) { $eventStream = $this->eventStore->read($this->aggregateRootType, $aggregateRootIdentifier); if ($eventStream->isEmpty()) { throw new AggregateNotFoundException($aggregateRootIdentifier); ...
php
public function load(AggregateRootIdentifier $aggregateRootIdentifier, $expectedVersion = null) { $eventStream = $this->eventStore->read($this->aggregateRootType, $aggregateRootIdentifier); if ($eventStream->isEmpty()) { throw new AggregateNotFoundException($aggregateRootIdentifier); ...
[ "public", "function", "load", "(", "AggregateRootIdentifier", "$", "aggregateRootIdentifier", ",", "$", "expectedVersion", "=", "null", ")", "{", "$", "eventStream", "=", "$", "this", "->", "eventStore", "->", "read", "(", "$", "this", "->", "aggregateRootType",...
@param AggregateRootIdentifier $aggregateRootIdentifier @param int $expectedVersion @return AggregateRoot @throws AggregateNotFoundException
[ "@param", "AggregateRootIdentifier", "$aggregateRootIdentifier", "@param", "int", "$expectedVersion" ]
train
https://github.com/rayrutjes/domain-foundation/blob/2bce7cd6a6612f718e70e3176589c1abf39d1a3e/src/Repository/AggregateRootRepository.php#L78-L98
rayrutjes/domain-foundation
src/Repository/AggregateRootRepository.php
AggregateRootRepository.doSave
public function doSave(AggregateRoot $aggregateRoot) { $eventStream = $aggregateRoot->uncommittedChanges(); if (!$eventStream->isEmpty()) { $this->eventStore->append($this->aggregateRootType, $eventStream); } }
php
public function doSave(AggregateRoot $aggregateRoot) { $eventStream = $aggregateRoot->uncommittedChanges(); if (!$eventStream->isEmpty()) { $this->eventStore->append($this->aggregateRootType, $eventStream); } }
[ "public", "function", "doSave", "(", "AggregateRoot", "$", "aggregateRoot", ")", "{", "$", "eventStream", "=", "$", "aggregateRoot", "->", "uncommittedChanges", "(", ")", ";", "if", "(", "!", "$", "eventStream", "->", "isEmpty", "(", ")", ")", "{", "$", ...
@internal @param AggregateRoot $aggregateRoot
[ "@internal" ]
train
https://github.com/rayrutjes/domain-foundation/blob/2bce7cd6a6612f718e70e3176589c1abf39d1a3e/src/Repository/AggregateRootRepository.php#L105-L112
phpmob/changmin
src/PhpMob/CmsBundle/Form/Type/PageType.php
PageType.buildForm
public function buildForm(FormBuilderInterface $builder, array $options) { $builder ->add('translations', ResourceTranslationsType::class, [ 'label' => 'phpmob.form.page.translations', //'label' => false, 'entry_type' => PageTranslationType::class,...
php
public function buildForm(FormBuilderInterface $builder, array $options) { $builder ->add('translations', ResourceTranslationsType::class, [ 'label' => 'phpmob.form.page.translations', //'label' => false, 'entry_type' => PageTranslationType::class,...
[ "public", "function", "buildForm", "(", "FormBuilderInterface", "$", "builder", ",", "array", "$", "options", ")", "{", "$", "builder", "->", "add", "(", "'translations'", ",", "ResourceTranslationsType", "::", "class", ",", "[", "'label'", "=>", "'phpmob.form.p...
{@inheritdoc}
[ "{" ]
train
https://github.com/phpmob/changmin/blob/bfebb1561229094d1c138574abab75f2f1d17d66/src/PhpMob/CmsBundle/Form/Type/PageType.php#L29-L63
CakeCMS/Core
src/Utility/Macros.php
Macros.get
public function get($key = null) { if (Arr::key($key, $this->_data)) { return $this->_data[$key]; } return $this->_data; }
php
public function get($key = null) { if (Arr::key($key, $this->_data)) { return $this->_data[$key]; } return $this->_data; }
[ "public", "function", "get", "(", "$", "key", "=", "null", ")", "{", "if", "(", "Arr", "::", "key", "(", "$", "key", ",", "$", "this", "->", "_data", ")", ")", "{", "return", "$", "this", "->", "_data", "[", "$", "key", "]", ";", "}", "return...
Get replacement val or all list. @param null|string|int $key @return array
[ "Get", "replacement", "val", "or", "all", "list", "." ]
train
https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/Utility/Macros.php#L60-L67
CakeCMS/Core
src/Utility/Macros.php
Macros.set
public function set($key, $val) { $this->_data = Hash::merge([$key => $val], $this->_data); return $this; }
php
public function set($key, $val) { $this->_data = Hash::merge([$key => $val], $this->_data); return $this; }
[ "public", "function", "set", "(", "$", "key", ",", "$", "val", ")", "{", "$", "this", "->", "_data", "=", "Hash", "::", "merge", "(", "[", "$", "key", "=>", "$", "val", "]", ",", "$", "this", "->", "_data", ")", ";", "return", "$", "this", ";...
Add new value in list. @param string|int $key @param string|int $val @return $this
[ "Add", "new", "value", "in", "list", "." ]
train
https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/Utility/Macros.php#L76-L80
CakeCMS/Core
src/Utility/Macros.php
Macros.text
public function text($text) { foreach ($this->_data as $macros => $value) { $macros = '{' . $macros . '}'; $text = preg_replace('#' . $macros . '#ius', $value, $text); } return $text; }
php
public function text($text) { foreach ($this->_data as $macros => $value) { $macros = '{' . $macros . '}'; $text = preg_replace('#' . $macros . '#ius', $value, $text); } return $text; }
[ "public", "function", "text", "(", "$", "text", ")", "{", "foreach", "(", "$", "this", "->", "_data", "as", "$", "macros", "=>", "$", "value", ")", "{", "$", "macros", "=", "'{'", ".", "$", "macros", ".", "'}'", ";", "$", "text", "=", "preg_repla...
Get replacement text. @param string $text @return string mixed
[ "Get", "replacement", "text", "." ]
train
https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/Utility/Macros.php#L88-L96
lode/fem
src/page.php
page.exception
public function exception($exception, $user_message=null) { if ($exception instanceof \Exception == false) { return $this->error('unknown exception format', response::STATUS_INTERNAL_SERVER_ERROR); } $exception_class = bootstrap::get_library('exception'); $this->data['exception']['current'] = $exception; $th...
php
public function exception($exception, $user_message=null) { if ($exception instanceof \Exception == false) { return $this->error('unknown exception format', response::STATUS_INTERNAL_SERVER_ERROR); } $exception_class = bootstrap::get_library('exception'); $this->data['exception']['current'] = $exception; $th...
[ "public", "function", "exception", "(", "$", "exception", ",", "$", "user_message", "=", "null", ")", "{", "if", "(", "$", "exception", "instanceof", "\\", "Exception", "==", "false", ")", "{", "return", "$", "this", "->", "error", "(", "'unknown exception...
show an error page using an exception @param object $exception one that extends \Exception @param string $user_message optional, human-friendly message to show to the user @return void script execution terminates
[ "show", "an", "error", "page", "using", "an", "exception" ]
train
https://github.com/lode/fem/blob/c1c466c1a904d99452b341c5ae7cbc3e22b106e1/src/page.php#L35-L54
lode/fem
src/page.php
page.error
public function error($reason=null, $code=response::STATUS_INTERNAL_SERVER_ERROR, $user_message=null) { $response = bootstrap::get_library('response'); $error_data = [ 'status_code' => $code, 'status_message' => $response::get_status_message($code), ]; $error_data['status_code_is_'.$code] = true; if ($u...
php
public function error($reason=null, $code=response::STATUS_INTERNAL_SERVER_ERROR, $user_message=null) { $response = bootstrap::get_library('response'); $error_data = [ 'status_code' => $code, 'status_message' => $response::get_status_message($code), ]; $error_data['status_code_is_'.$code] = true; if ($u...
[ "public", "function", "error", "(", "$", "reason", "=", "null", ",", "$", "code", "=", "response", "::", "STATUS_INTERNAL_SERVER_ERROR", ",", "$", "user_message", "=", "null", ")", "{", "$", "response", "=", "bootstrap", "::", "get_library", "(", "'response'...
show an error page @param string $reason technical description, only shown on development environments @param int $code http status code, @see response::STATUS_* @param string $user_message optional, human-friendly message to show to the user @return void script execution terminates
[ "show", "an", "error", "page" ]
train
https://github.com/lode/fem/blob/c1c466c1a904d99452b341c5ae7cbc3e22b106e1/src/page.php#L64-L118
lode/fem
src/page.php
page.show_default_error
private static function show_default_error($error_data) { $template_path = \alsvanzelf\fem\ROOT_DIR.'vendor/alsvanzelf/fem/src/templates/default_error.html'; $template_content = file_get_contents($template_path); $renderer = new \Mustache_Engine(); echo $renderer->render($template_content, $error_data); }
php
private static function show_default_error($error_data) { $template_path = \alsvanzelf\fem\ROOT_DIR.'vendor/alsvanzelf/fem/src/templates/default_error.html'; $template_content = file_get_contents($template_path); $renderer = new \Mustache_Engine(); echo $renderer->render($template_content, $error_data); }
[ "private", "static", "function", "show_default_error", "(", "$", "error_data", ")", "{", "$", "template_path", "=", "\\", "alsvanzelf", "\\", "fem", "\\", "ROOT_DIR", ".", "'vendor/alsvanzelf/fem/src/templates/default_error.html'", ";", "$", "template_content", "=", "...
shows a default error template in case no specific one is set @param array $error_data as build up in ::error() @return void however, mustache has echo'd the html
[ "shows", "a", "default", "error", "template", "in", "case", "no", "specific", "one", "is", "set" ]
train
https://github.com/lode/fem/blob/c1c466c1a904d99452b341c5ae7cbc3e22b106e1/src/page.php#L126-L132
joseph-walker/vector
src/Lib/Logic.php
Logic.__orCombinator
protected static function __orCombinator(array $fs, $a) { return self::any(Arrays::map(function ($c) use ($a) { return $c($a); }, $fs)); }
php
protected static function __orCombinator(array $fs, $a) { return self::any(Arrays::map(function ($c) use ($a) { return $c($a); }, $fs)); }
[ "protected", "static", "function", "__orCombinator", "(", "array", "$", "fs", ",", "$", "a", ")", "{", "return", "self", "::", "any", "(", "Arrays", "::", "map", "(", "function", "(", "$", "c", ")", "use", "(", "$", "a", ")", "{", "return", "$", ...
Logical Or Combinator Given n functions {f1, f2, ..., fn}, combine them in such a way to produce a new function g that returns true given at least one of {f1(x), f2(x), ... fn(x)} return true. @example $funcF = function($x) { return $x >= 5; }; $funcG = function($x) { return $x == 0; }; $combinator = Logic::orCombina...
[ "Logical", "Or", "Combinator" ]
train
https://github.com/joseph-walker/vector/blob/e349aa2e9e0535b1993f9fffc0476e7fd8e113fc/src/Lib/Logic.php#L48-L53
joseph-walker/vector
src/Lib/Logic.php
Logic.__andCombinator
protected static function __andCombinator(array $fs, $a) { return self::all(Arrays::map(function ($c) use ($a) { return $c($a); }, $fs)); }
php
protected static function __andCombinator(array $fs, $a) { return self::all(Arrays::map(function ($c) use ($a) { return $c($a); }, $fs)); }
[ "protected", "static", "function", "__andCombinator", "(", "array", "$", "fs", ",", "$", "a", ")", "{", "return", "self", "::", "all", "(", "Arrays", "::", "map", "(", "function", "(", "$", "c", ")", "use", "(", "$", "a", ")", "{", "return", "$", ...
Logical And Combinator Given n functions {f1, f2, ..., fn}, combine them in such a way to produce a new function g that returns true given {f1(x), f2(x), ... fn(x)} all return true. @example $funcF = function($x) { return $x < 5; }; $funcG = function($x) { return $x > 0; }; $combinator = Logic::andCombinator([$funcF,...
[ "Logical", "And", "Combinator" ]
train
https://github.com/joseph-walker/vector/blob/e349aa2e9e0535b1993f9fffc0476e7fd8e113fc/src/Lib/Logic.php#L75-L80
yuncms/framework
src/models/BaseUser.php
BaseUser.generateAuthKey
public function generateAuthKey() { try { $this->auth_key = Yii::$app->security->generateRandomString(32); } catch (Exception $e) { throw $e; } }
php
public function generateAuthKey() { try { $this->auth_key = Yii::$app->security->generateRandomString(32); } catch (Exception $e) { throw $e; } }
[ "public", "function", "generateAuthKey", "(", ")", "{", "try", "{", "$", "this", "->", "auth_key", "=", "Yii", "::", "$", "app", "->", "security", "->", "generateRandomString", "(", "32", ")", ";", "}", "catch", "(", "Exception", "$", "e", ")", "{", ...
创建 "记住我" 身份验证Key @return void @throws Exception
[ "创建", "记住我", "身份验证Key" ]
train
https://github.com/yuncms/framework/blob/af42e28ea4ae15ab8eead3f6d119f93863b94154/src/models/BaseUser.php#L288-L295
yuncms/framework
src/models/BaseUser.php
BaseUser.generateAccessToken
public function generateAccessToken() { try { $this->access_token = Yii::$app->security->generateRandomString(32); } catch (Exception $e) { throw $e; } }
php
public function generateAccessToken() { try { $this->access_token = Yii::$app->security->generateRandomString(32); } catch (Exception $e) { throw $e; } }
[ "public", "function", "generateAccessToken", "(", ")", "{", "try", "{", "$", "this", "->", "access_token", "=", "Yii", "::", "$", "app", "->", "security", "->", "generateRandomString", "(", "32", ")", ";", "}", "catch", "(", "Exception", "$", "e", ")", ...
创建 "记住我" 身份验证Key @return void @throws Exception
[ "创建", "记住我", "身份验证Key" ]
train
https://github.com/yuncms/framework/blob/af42e28ea4ae15ab8eead3f6d119f93863b94154/src/models/BaseUser.php#L302-L309
yuncms/framework
src/models/BaseUser.php
BaseUser.generateUsername
public function generateUsername() { if ($this->email) { $this->username = explode('@', $this->email)[0]; if ($this->validate(['username'])) { return $this->username; } } else if ($this->nickname) { $this->username = Inflector::slug($th...
php
public function generateUsername() { if ($this->email) { $this->username = explode('@', $this->email)[0]; if ($this->validate(['username'])) { return $this->username; } } else if ($this->nickname) { $this->username = Inflector::slug($th...
[ "public", "function", "generateUsername", "(", ")", "{", "if", "(", "$", "this", "->", "email", ")", "{", "$", "this", "->", "username", "=", "explode", "(", "'@'", ",", "$", "this", "->", "email", ")", "[", "0", "]", ";", "if", "(", "$", "this",...
随机生成一个用户名
[ "随机生成一个用户名" ]
train
https://github.com/yuncms/framework/blob/af42e28ea4ae15ab8eead3f6d119f93863b94154/src/models/BaseUser.php#L314-L333