id int32 0 241k | repo stringlengths 6 63 | path stringlengths 5 140 | func_name stringlengths 3 151 | original_string stringlengths 84 13k | language stringclasses 1
value | code stringlengths 84 13k | code_tokens list | docstring stringlengths 3 47.2k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 91 247 |
|---|---|---|---|---|---|---|---|---|---|---|---|
203,600 | airbornfoxx/commandcenter | src/Flyingfoxx/CommandCenter/MainCommandTranslator.php | MainCommandTranslator.toHandler | public function toHandler($command)
{
$class = get_class($command);
$offset = ($this->positionAt('Command', $class)) ?: $this->positionAt('Request', $class);
$handlerClass = substr_replace($class, 'Handler', $offset);
if (!class_exists($handlerClass)) {
$message = "Comma... | php | public function toHandler($command)
{
$class = get_class($command);
$offset = ($this->positionAt('Command', $class)) ?: $this->positionAt('Request', $class);
$handlerClass = substr_replace($class, 'Handler', $offset);
if (!class_exists($handlerClass)) {
$message = "Comma... | [
"public",
"function",
"toHandler",
"(",
"$",
"command",
")",
"{",
"$",
"class",
"=",
"get_class",
"(",
"$",
"command",
")",
";",
"$",
"offset",
"=",
"(",
"$",
"this",
"->",
"positionAt",
"(",
"'Command'",
",",
"$",
"class",
")",
")",
"?",
":",
"$",... | Translate a command to its respective handler.
@param $command
@return mixed
@throws HandlerNotRegisteredException | [
"Translate",
"a",
"command",
"to",
"its",
"respective",
"handler",
"."
] | ee4f8d0981c69f8cd3410793988def4d809fdaa6 | https://github.com/airbornfoxx/commandcenter/blob/ee4f8d0981c69f8cd3410793988def4d809fdaa6/src/Flyingfoxx/CommandCenter/MainCommandTranslator.php#L19-L31 |
203,601 | airbornfoxx/commandcenter | src/Flyingfoxx/CommandCenter/MainCommandTranslator.php | MainCommandTranslator.toValidator | public function toValidator($command)
{
$class = get_class($command);
$offset = ($this->positionAt('Command', $class)) ?: $this->positionAt('Request', $class);
return substr_replace($class, 'Validator', $offset);
} | php | public function toValidator($command)
{
$class = get_class($command);
$offset = ($this->positionAt('Command', $class)) ?: $this->positionAt('Request', $class);
return substr_replace($class, 'Validator', $offset);
} | [
"public",
"function",
"toValidator",
"(",
"$",
"command",
")",
"{",
"$",
"class",
"=",
"get_class",
"(",
"$",
"command",
")",
";",
"$",
"offset",
"=",
"(",
"$",
"this",
"->",
"positionAt",
"(",
"'Command'",
",",
"$",
"class",
")",
")",
"?",
":",
"$... | Translate a command to its respective validator.
@param $command
@return mixed | [
"Translate",
"a",
"command",
"to",
"its",
"respective",
"validator",
"."
] | ee4f8d0981c69f8cd3410793988def4d809fdaa6 | https://github.com/airbornfoxx/commandcenter/blob/ee4f8d0981c69f8cd3410793988def4d809fdaa6/src/Flyingfoxx/CommandCenter/MainCommandTranslator.php#L39-L45 |
203,602 | antaresproject/translations | src/Http/Breadcrumb/Breadcrumb.php | Breadcrumb.onTranslationList | public function onTranslationList()
{
$this->breadcrumbs->register('translations', function($breadcrumbs) {
$breadcrumbs->push('Translations', handles('antares::translations/index/' . area()));
});
$this->shareOnView('translations');
} | php | public function onTranslationList()
{
$this->breadcrumbs->register('translations', function($breadcrumbs) {
$breadcrumbs->push('Translations', handles('antares::translations/index/' . area()));
});
$this->shareOnView('translations');
} | [
"public",
"function",
"onTranslationList",
"(",
")",
"{",
"$",
"this",
"->",
"breadcrumbs",
"->",
"register",
"(",
"'translations'",
",",
"function",
"(",
"$",
"breadcrumbs",
")",
"{",
"$",
"breadcrumbs",
"->",
"push",
"(",
"'Translations'",
",",
"handles",
... | on translations list | [
"on",
"translations",
"list"
] | 63097aeb97f18c5aeeef7dcf15f0c67959951685 | https://github.com/antaresproject/translations/blob/63097aeb97f18c5aeeef7dcf15f0c67959951685/src/Http/Breadcrumb/Breadcrumb.php#L33-L40 |
203,603 | antaresproject/translations | src/Http/Breadcrumb/Breadcrumb.php | Breadcrumb.onLanguageAdd | public function onLanguageAdd()
{
$this->onTranslationList();
$this->breadcrumbs->register('languages', function($breadcrumbs) {
$breadcrumbs->parent('translations');
$breadcrumbs->push('Languages', handles('antares::translations/languages/index'));
});
$this-... | php | public function onLanguageAdd()
{
$this->onTranslationList();
$this->breadcrumbs->register('languages', function($breadcrumbs) {
$breadcrumbs->parent('translations');
$breadcrumbs->push('Languages', handles('antares::translations/languages/index'));
});
$this-... | [
"public",
"function",
"onLanguageAdd",
"(",
")",
"{",
"$",
"this",
"->",
"onTranslationList",
"(",
")",
";",
"$",
"this",
"->",
"breadcrumbs",
"->",
"register",
"(",
"'languages'",
",",
"function",
"(",
"$",
"breadcrumbs",
")",
"{",
"$",
"breadcrumbs",
"->... | on language add | [
"on",
"language",
"add"
] | 63097aeb97f18c5aeeef7dcf15f0c67959951685 | https://github.com/antaresproject/translations/blob/63097aeb97f18c5aeeef7dcf15f0c67959951685/src/Http/Breadcrumb/Breadcrumb.php#L45-L57 |
203,604 | antaresproject/translations | src/Http/Breadcrumb/Breadcrumb.php | Breadcrumb.onImportTranslations | public function onImportTranslations()
{
$this->onTranslationList();
$this->breadcrumbs->register('translations-import', function($breadcrumbs) {
$breadcrumbs->parent('translations');
$breadcrumbs->push('Import translations');
});
$this->shareOnView('translati... | php | public function onImportTranslations()
{
$this->onTranslationList();
$this->breadcrumbs->register('translations-import', function($breadcrumbs) {
$breadcrumbs->parent('translations');
$breadcrumbs->push('Import translations');
});
$this->shareOnView('translati... | [
"public",
"function",
"onImportTranslations",
"(",
")",
"{",
"$",
"this",
"->",
"onTranslationList",
"(",
")",
";",
"$",
"this",
"->",
"breadcrumbs",
"->",
"register",
"(",
"'translations-import'",
",",
"function",
"(",
"$",
"breadcrumbs",
")",
"{",
"$",
"br... | on import translations | [
"on",
"import",
"translations"
] | 63097aeb97f18c5aeeef7dcf15f0c67959951685 | https://github.com/antaresproject/translations/blob/63097aeb97f18c5aeeef7dcf15f0c67959951685/src/Http/Breadcrumb/Breadcrumb.php#L62-L70 |
203,605 | antaresproject/translations | src/Http/Breadcrumb/Breadcrumb.php | Breadcrumb.onLanguagesList | public function onLanguagesList()
{
$this->breadcrumbs->register('translations', function($breadcrumbs) {
$breadcrumbs->push('Translations', handles('antares::translations/index/' . area()), ['force_link' => true]);
});
$this->shareOnView('translations');
} | php | public function onLanguagesList()
{
$this->breadcrumbs->register('translations', function($breadcrumbs) {
$breadcrumbs->push('Translations', handles('antares::translations/index/' . area()), ['force_link' => true]);
});
$this->shareOnView('translations');
} | [
"public",
"function",
"onLanguagesList",
"(",
")",
"{",
"$",
"this",
"->",
"breadcrumbs",
"->",
"register",
"(",
"'translations'",
",",
"function",
"(",
"$",
"breadcrumbs",
")",
"{",
"$",
"breadcrumbs",
"->",
"push",
"(",
"'Translations'",
",",
"handles",
"(... | On languages list | [
"On",
"languages",
"list"
] | 63097aeb97f18c5aeeef7dcf15f0c67959951685 | https://github.com/antaresproject/translations/blob/63097aeb97f18c5aeeef7dcf15f0c67959951685/src/Http/Breadcrumb/Breadcrumb.php#L75-L82 |
203,606 | WellCommerce/CatalogBundle | Controller/Admin/AttributeController.php | AttributeController.ajaxIndexAction | public function ajaxIndexAction(Request $request): Response
{
if (!$request->isXmlHttpRequest()) {
return $this->redirectToAction('index');
}
$attributeGroupId = (int)$request->request->get('id');
$attributeGroup = $this->getManager()->findAttributeGroup($attri... | php | public function ajaxIndexAction(Request $request): Response
{
if (!$request->isXmlHttpRequest()) {
return $this->redirectToAction('index');
}
$attributeGroupId = (int)$request->request->get('id');
$attributeGroup = $this->getManager()->findAttributeGroup($attri... | [
"public",
"function",
"ajaxIndexAction",
"(",
"Request",
"$",
"request",
")",
":",
"Response",
"{",
"if",
"(",
"!",
"$",
"request",
"->",
"isXmlHttpRequest",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"redirectToAction",
"(",
"'index'",
")",
";",
"... | Ajax action for listing attributes in variants editor
@param Request $request
@return Response | [
"Ajax",
"action",
"for",
"listing",
"attributes",
"in",
"variants",
"editor"
] | b1809190298f6c6c04c472dbfd763c1ad0b68630 | https://github.com/WellCommerce/CatalogBundle/blob/b1809190298f6c6c04c472dbfd763c1ad0b68630/Controller/Admin/AttributeController.php#L35-L47 |
203,607 | WellCommerce/CatalogBundle | Controller/Admin/AttributeController.php | AttributeController.ajaxAddAction | public function ajaxAddAction(Request $request): Response
{
if (!$request->isXmlHttpRequest()) {
return $this->redirectToAction('index');
}
$attributeName = $request->request->get('name');
$attributeGroupId = (int)$request->request->get('set');
... | php | public function ajaxAddAction(Request $request): Response
{
if (!$request->isXmlHttpRequest()) {
return $this->redirectToAction('index');
}
$attributeName = $request->request->get('name');
$attributeGroupId = (int)$request->request->get('set');
... | [
"public",
"function",
"ajaxAddAction",
"(",
"Request",
"$",
"request",
")",
":",
"Response",
"{",
"if",
"(",
"!",
"$",
"request",
"->",
"isXmlHttpRequest",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"redirectToAction",
"(",
"'index'",
")",
";",
"}"... | Adds new attribute value using ajax request
@param Request $request
@return Response | [
"Adds",
"new",
"attribute",
"value",
"using",
"ajax",
"request"
] | b1809190298f6c6c04c472dbfd763c1ad0b68630 | https://github.com/WellCommerce/CatalogBundle/blob/b1809190298f6c6c04c472dbfd763c1ad0b68630/Controller/Admin/AttributeController.php#L56-L78 |
203,608 | twistor/flysystem-memory-adapter | src/MemoryAdapter.php | MemoryAdapter.createFromPath | public static function createFromPath($path)
{
if (!is_dir($path) || !is_readable($path)) {
throw new \LogicException(sprintf('%s does not exist or is not readable.', $path));
}
return static::createFromFilesystem(new Filesystem(new Local($path)));
} | php | public static function createFromPath($path)
{
if (!is_dir($path) || !is_readable($path)) {
throw new \LogicException(sprintf('%s does not exist or is not readable.', $path));
}
return static::createFromFilesystem(new Filesystem(new Local($path)));
} | [
"public",
"static",
"function",
"createFromPath",
"(",
"$",
"path",
")",
"{",
"if",
"(",
"!",
"is_dir",
"(",
"$",
"path",
")",
"||",
"!",
"is_readable",
"(",
"$",
"path",
")",
")",
"{",
"throw",
"new",
"\\",
"LogicException",
"(",
"sprintf",
"(",
"'%... | Creates a Memory adapter from a filesystem folder.
@param string $path The path to the folder.
@return MemoryAdapter A new memory adapter. | [
"Creates",
"a",
"Memory",
"adapter",
"from",
"a",
"filesystem",
"folder",
"."
] | 614f184d855135c1d55b1a579feabaf577de62b1 | https://github.com/twistor/flysystem-memory-adapter/blob/614f184d855135c1d55b1a579feabaf577de62b1/src/MemoryAdapter.php#L37-L44 |
203,609 | twistor/flysystem-memory-adapter | src/MemoryAdapter.php | MemoryAdapter.createFromFilesystem | public static function createFromFilesystem(FilesystemInterface $filesystem)
{
$filesystem->addPlugin(new ListWith());
$adapter = new static();
$config = new Config();
foreach ($filesystem->listWith(['timestamp', 'visibility'], '', true) as $meta) {
if ($meta['type'] ==... | php | public static function createFromFilesystem(FilesystemInterface $filesystem)
{
$filesystem->addPlugin(new ListWith());
$adapter = new static();
$config = new Config();
foreach ($filesystem->listWith(['timestamp', 'visibility'], '', true) as $meta) {
if ($meta['type'] ==... | [
"public",
"static",
"function",
"createFromFilesystem",
"(",
"FilesystemInterface",
"$",
"filesystem",
")",
"{",
"$",
"filesystem",
"->",
"addPlugin",
"(",
"new",
"ListWith",
"(",
")",
")",
";",
"$",
"adapter",
"=",
"new",
"static",
"(",
")",
";",
"$",
"co... | Creates a Memory adapter from a Flysystem filesystem.
@param FilesystemInterface $filesystem The Flysystem filesystem.
@return self A new memory adapter. | [
"Creates",
"a",
"Memory",
"adapter",
"from",
"a",
"Flysystem",
"filesystem",
"."
] | 614f184d855135c1d55b1a579feabaf577de62b1 | https://github.com/twistor/flysystem-memory-adapter/blob/614f184d855135c1d55b1a579feabaf577de62b1/src/MemoryAdapter.php#L53-L72 |
203,610 | twistor/flysystem-memory-adapter | src/MemoryAdapter.php | MemoryAdapter.emptyDirectory | protected function emptyDirectory($directory)
{
foreach ($this->doListContents($directory, true) as $path) {
$this->deletePath($path);
}
} | php | protected function emptyDirectory($directory)
{
foreach ($this->doListContents($directory, true) as $path) {
$this->deletePath($path);
}
} | [
"protected",
"function",
"emptyDirectory",
"(",
"$",
"directory",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"doListContents",
"(",
"$",
"directory",
",",
"true",
")",
"as",
"$",
"path",
")",
"{",
"$",
"this",
"->",
"deletePath",
"(",
"$",
"path",
")... | Empties a directory.
@param string $directory | [
"Empties",
"a",
"directory",
"."
] | 614f184d855135c1d55b1a579feabaf577de62b1 | https://github.com/twistor/flysystem-memory-adapter/blob/614f184d855135c1d55b1a579feabaf577de62b1/src/MemoryAdapter.php#L313-L318 |
203,611 | twistor/flysystem-memory-adapter | src/MemoryAdapter.php | MemoryAdapter.ensureSubDirs | protected function ensureSubDirs($directory, Config $config = null)
{
$config = $config ?: new Config();
return $this->createDir(Util::dirname($directory), $config);
} | php | protected function ensureSubDirs($directory, Config $config = null)
{
$config = $config ?: new Config();
return $this->createDir(Util::dirname($directory), $config);
} | [
"protected",
"function",
"ensureSubDirs",
"(",
"$",
"directory",
",",
"Config",
"$",
"config",
"=",
"null",
")",
"{",
"$",
"config",
"=",
"$",
"config",
"?",
":",
"new",
"Config",
"(",
")",
";",
"return",
"$",
"this",
"->",
"createDir",
"(",
"Util",
... | Ensures that the sub-directories of a directory exist.
@param string $directory The directory.
@param Config|null $config Optionl configuration.
@return bool True on success, false on failure. | [
"Ensures",
"that",
"the",
"sub",
"-",
"directories",
"of",
"a",
"directory",
"exist",
"."
] | 614f184d855135c1d55b1a579feabaf577de62b1 | https://github.com/twistor/flysystem-memory-adapter/blob/614f184d855135c1d55b1a579feabaf577de62b1/src/MemoryAdapter.php#L328-L333 |
203,612 | twistor/flysystem-memory-adapter | src/MemoryAdapter.php | MemoryAdapter.getFileKeys | protected function getFileKeys($path, array $keys)
{
if (!$this->hasFile($path)) {
return false;
}
return $this->getKeys($path, $keys);
} | php | protected function getFileKeys($path, array $keys)
{
if (!$this->hasFile($path)) {
return false;
}
return $this->getKeys($path, $keys);
} | [
"protected",
"function",
"getFileKeys",
"(",
"$",
"path",
",",
"array",
"$",
"keys",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"hasFile",
"(",
"$",
"path",
")",
")",
"{",
"return",
"false",
";",
"}",
"return",
"$",
"this",
"->",
"getKeys",
"(",
... | Returns the keys for a file.
@param string $path
@param array $keys
@return array|false | [
"Returns",
"the",
"keys",
"for",
"a",
"file",
"."
] | 614f184d855135c1d55b1a579feabaf577de62b1 | https://github.com/twistor/flysystem-memory-adapter/blob/614f184d855135c1d55b1a579feabaf577de62b1/src/MemoryAdapter.php#L343-L350 |
203,613 | twistor/flysystem-memory-adapter | src/MemoryAdapter.php | MemoryAdapter.getKeys | protected function getKeys($path, array $keys)
{
if (!$this->has($path)) {
return false;
}
$return = [];
foreach ($keys as $key) {
if ($key === 'path') {
$return[$key] = $path;
continue;
}
$return[$key]... | php | protected function getKeys($path, array $keys)
{
if (!$this->has($path)) {
return false;
}
$return = [];
foreach ($keys as $key) {
if ($key === 'path') {
$return[$key] = $path;
continue;
}
$return[$key]... | [
"protected",
"function",
"getKeys",
"(",
"$",
"path",
",",
"array",
"$",
"keys",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"has",
"(",
"$",
"path",
")",
")",
"{",
"return",
"false",
";",
"}",
"$",
"return",
"=",
"[",
"]",
";",
"foreach",
"("... | Returns the keys for a path.
@param string $path
@param array $keys
@return array|false | [
"Returns",
"the",
"keys",
"for",
"a",
"path",
"."
] | 614f184d855135c1d55b1a579feabaf577de62b1 | https://github.com/twistor/flysystem-memory-adapter/blob/614f184d855135c1d55b1a579feabaf577de62b1/src/MemoryAdapter.php#L360-L377 |
203,614 | ekyna/AdminBundle | Controller/Resource/SortableTrait.php | SortableTrait.moveUpAction | public function moveUpAction(Request $request)
{
$context = $this->loadContext($request);
$resource = $context->getResource();
$this->isGranted('EDIT', $resource);
$this->move($resource, -1);
return $this->redirectToReferer($this->generateUrl(
$this->config->g... | php | public function moveUpAction(Request $request)
{
$context = $this->loadContext($request);
$resource = $context->getResource();
$this->isGranted('EDIT', $resource);
$this->move($resource, -1);
return $this->redirectToReferer($this->generateUrl(
$this->config->g... | [
"public",
"function",
"moveUpAction",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"context",
"=",
"$",
"this",
"->",
"loadContext",
"(",
"$",
"request",
")",
";",
"$",
"resource",
"=",
"$",
"context",
"->",
"getResource",
"(",
")",
";",
"$",
"this",... | Move up the resource.
@param Request $request
@return \Symfony\Component\HttpFoundation\Response | [
"Move",
"up",
"the",
"resource",
"."
] | 3f58e253ae9cf651add7f3d587caec80eaea459a | https://github.com/ekyna/AdminBundle/blob/3f58e253ae9cf651add7f3d587caec80eaea459a/Controller/Resource/SortableTrait.php#L20-L34 |
203,615 | ekyna/AdminBundle | Controller/Resource/SortableTrait.php | SortableTrait.move | protected function move($resource, $movement)
{
$resource->setPosition($resource->getPosition() + $movement);
// TODO use ResourceManager
$event = $this->getOperator()->update($resource);
$event->toFlashes($this->getFlashBag());
} | php | protected function move($resource, $movement)
{
$resource->setPosition($resource->getPosition() + $movement);
// TODO use ResourceManager
$event = $this->getOperator()->update($resource);
$event->toFlashes($this->getFlashBag());
} | [
"protected",
"function",
"move",
"(",
"$",
"resource",
",",
"$",
"movement",
")",
"{",
"$",
"resource",
"->",
"setPosition",
"(",
"$",
"resource",
"->",
"getPosition",
"(",
")",
"+",
"$",
"movement",
")",
";",
"// TODO use ResourceManager",
"$",
"event",
"... | Move the resource.
@param $resource
@param $movement | [
"Move",
"the",
"resource",
"."
] | 3f58e253ae9cf651add7f3d587caec80eaea459a | https://github.com/ekyna/AdminBundle/blob/3f58e253ae9cf651add7f3d587caec80eaea459a/Controller/Resource/SortableTrait.php#L64-L71 |
203,616 | praxisnetau/silverware-navigation | src/Components/AnchorNavigation.php | AnchorNavigation.getAnchors | public function getAnchors()
{
$list = ArrayList::create();
if ($page = $this->getCurrentPage(Page::class)) {
$html = HTMLValue::create($page->Content);
$anchors = $html->query("//*[@id]");
foreach ($anchors as $anch... | php | public function getAnchors()
{
$list = ArrayList::create();
if ($page = $this->getCurrentPage(Page::class)) {
$html = HTMLValue::create($page->Content);
$anchors = $html->query("//*[@id]");
foreach ($anchors as $anch... | [
"public",
"function",
"getAnchors",
"(",
")",
"{",
"$",
"list",
"=",
"ArrayList",
"::",
"create",
"(",
")",
";",
"if",
"(",
"$",
"page",
"=",
"$",
"this",
"->",
"getCurrentPage",
"(",
"Page",
"::",
"class",
")",
")",
"{",
"$",
"html",
"=",
"HTMLVal... | Answers an array list of anchors identified within the current page content.
@return ArrayList | [
"Answers",
"an",
"array",
"list",
"of",
"anchors",
"identified",
"within",
"the",
"current",
"page",
"content",
"."
] | 04e6f3003c2871348d5bba7869d4fc273641627e | https://github.com/praxisnetau/silverware-navigation/blob/04e6f3003c2871348d5bba7869d4fc273641627e/src/Components/AnchorNavigation.php#L232-L256 |
203,617 | phPoirot/Client-OAuth2 | src/Assertion/AssertByInternalServer.php | AssertByInternalServer.assertToken | function assertToken($tokenStr)
{
if (false === $token = $this->_accessTokens->findByIdentifier((string) $tokenStr))
throw new exOAuthAccessDenied;
$accessToken = new AccessTokenEntity(
new HydrateGetters($token) );
return $accessToken;
} | php | function assertToken($tokenStr)
{
if (false === $token = $this->_accessTokens->findByIdentifier((string) $tokenStr))
throw new exOAuthAccessDenied;
$accessToken = new AccessTokenEntity(
new HydrateGetters($token) );
return $accessToken;
} | [
"function",
"assertToken",
"(",
"$",
"tokenStr",
")",
"{",
"if",
"(",
"false",
"===",
"$",
"token",
"=",
"$",
"this",
"->",
"_accessTokens",
"->",
"findByIdentifier",
"(",
"(",
"string",
")",
"$",
"tokenStr",
")",
")",
"throw",
"new",
"exOAuthAccessDenied"... | Validate Authorize Token With OAuth Server
note: implement grant extension http request
@param string $tokenStr
@return iAccessTokenEntity
@throws exOAuthAccessDenied Access Denied | [
"Validate",
"Authorize",
"Token",
"With",
"OAuth",
"Server"
] | 8745fd54afbbb185669b9e38b1241ecc8ffc7268 | https://github.com/phPoirot/Client-OAuth2/blob/8745fd54afbbb185669b9e38b1241ecc8ffc7268/src/Assertion/AssertByInternalServer.php#L42-L52 |
203,618 | Etenil/assegai | src/assegai/modules/forms/fields/Field.php | Field.getType | function getType()
{
if($this->_type) {
return $this->_type;
}
else {
$myclass = get_class($this);
return strtolower(substr($myclass, strrpos($myclass, '\\') + 1, -5));
}
} | php | function getType()
{
if($this->_type) {
return $this->_type;
}
else {
$myclass = get_class($this);
return strtolower(substr($myclass, strrpos($myclass, '\\') + 1, -5));
}
} | [
"function",
"getType",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_type",
")",
"{",
"return",
"$",
"this",
"->",
"_type",
";",
"}",
"else",
"{",
"$",
"myclass",
"=",
"get_class",
"(",
"$",
"this",
")",
";",
"return",
"strtolower",
"(",
"substr",... | This essentially returns the field's class name without the "Field" part. | [
"This",
"essentially",
"returns",
"the",
"field",
"s",
"class",
"name",
"without",
"the",
"Field",
"part",
"."
] | d43cce1a88f1c332f60dd0a4374b17764852af9e | https://github.com/Etenil/assegai/blob/d43cce1a88f1c332f60dd0a4374b17764852af9e/src/assegai/modules/forms/fields/Field.php#L111-L120 |
203,619 | schpill/thin | src/Navigation/Page/Uri.php | Zend_Navigation_Page_Uri.setUri | public function setUri($uri)
{
if (null !== $uri && !is_string($uri)) {
require_once 'Zend/Navigation/Exception.php';
throw new Zend_Navigation_Exception(
'Invalid argument: $uri must be a string or null');
}
$this->_uri = $uri;
return $th... | php | public function setUri($uri)
{
if (null !== $uri && !is_string($uri)) {
require_once 'Zend/Navigation/Exception.php';
throw new Zend_Navigation_Exception(
'Invalid argument: $uri must be a string or null');
}
$this->_uri = $uri;
return $th... | [
"public",
"function",
"setUri",
"(",
"$",
"uri",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"uri",
"&&",
"!",
"is_string",
"(",
"$",
"uri",
")",
")",
"{",
"require_once",
"'Zend/Navigation/Exception.php'",
";",
"throw",
"new",
"Zend_Navigation_Exception",
"(",... | Sets page URI
@param string $uri page URI, must a string or null
@return Zend_Navigation_Page_Uri fluent interface, returns self
@throws Zend_Navigation_Exception if $uri is invalid | [
"Sets",
"page",
"URI"
] | a9102d9d6f70e8b0f6be93153f70849f46489ee1 | https://github.com/schpill/thin/blob/a9102d9d6f70e8b0f6be93153f70849f46489ee1/src/Navigation/Page/Uri.php#L53-L63 |
203,620 | Synapse-Cmf/synapse-cmf | src/Synapse/Page/Bundle/Action/Page/CreateAction.php | CreateAction.resolve | public function resolve()
{
$this->page
->setName($this->name)
->setOnline(!empty($this->online))
->setTitle($this->title)
->setMeta(array('title' => $this->title))
->setPath($this->getFullPath())
;
$this->assertEntityIsValid($this... | php | public function resolve()
{
$this->page
->setName($this->name)
->setOnline(!empty($this->online))
->setTitle($this->title)
->setMeta(array('title' => $this->title))
->setPath($this->getFullPath())
;
$this->assertEntityIsValid($this... | [
"public",
"function",
"resolve",
"(",
")",
"{",
"$",
"this",
"->",
"page",
"->",
"setName",
"(",
"$",
"this",
"->",
"name",
")",
"->",
"setOnline",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"online",
")",
")",
"->",
"setTitle",
"(",
"$",
"this",
... | Page creation method.
@return Page | [
"Page",
"creation",
"method",
"."
] | d8122a4150a83d5607289724425cf35c56a5e880 | https://github.com/Synapse-Cmf/synapse-cmf/blob/d8122a4150a83d5607289724425cf35c56a5e880/src/Synapse/Page/Bundle/Action/Page/CreateAction.php#L62-L80 |
203,621 | Synapse-Cmf/synapse-cmf | src/Synapse/Page/Bundle/Action/Page/CreateAction.php | CreateAction.generateFullPath | protected function generateFullPath()
{
return $this->fullPath = $this->pathGenerator
->generatePath($this->page, $this->path ?: '')
;
} | php | protected function generateFullPath()
{
return $this->fullPath = $this->pathGenerator
->generatePath($this->page, $this->path ?: '')
;
} | [
"protected",
"function",
"generateFullPath",
"(",
")",
"{",
"return",
"$",
"this",
"->",
"fullPath",
"=",
"$",
"this",
"->",
"pathGenerator",
"->",
"generatePath",
"(",
"$",
"this",
"->",
"page",
",",
"$",
"this",
"->",
"path",
"?",
":",
"''",
")",
";"... | Generate page full path.
@return string | [
"Generate",
"page",
"full",
"path",
"."
] | d8122a4150a83d5607289724425cf35c56a5e880 | https://github.com/Synapse-Cmf/synapse-cmf/blob/d8122a4150a83d5607289724425cf35c56a5e880/src/Synapse/Page/Bundle/Action/Page/CreateAction.php#L136-L141 |
203,622 | RadialCorp/magento-core | src/app/code/community/Radial/Core/Model/Abstract/Send.php | EbayEnterprise_Order_Model_Abstract_Send._sendRequest | protected function _sendRequest()
{
$logger = $this->_logger;
$logContext = $this->_logContext;
$response = null;
try {
$response = $this->_api
->setRequestBody($this->_request)
->send()
->getResponseBody();
} catch... | php | protected function _sendRequest()
{
$logger = $this->_logger;
$logContext = $this->_logContext;
$response = null;
try {
$response = $this->_api
->setRequestBody($this->_request)
->send()
->getResponseBody();
} catch... | [
"protected",
"function",
"_sendRequest",
"(",
")",
"{",
"$",
"logger",
"=",
"$",
"this",
"->",
"_logger",
";",
"$",
"logContext",
"=",
"$",
"this",
"->",
"_logContext",
";",
"$",
"response",
"=",
"null",
";",
"try",
"{",
"$",
"response",
"=",
"$",
"t... | Sending the payload request and returning the response.
@return IPayload | null | [
"Sending",
"the",
"payload",
"request",
"and",
"returning",
"the",
"response",
"."
] | 9bb5f218d9caf79eab8598f4f8447037a0cc6355 | https://github.com/RadialCorp/magento-core/blob/9bb5f218d9caf79eab8598f4f8447037a0cc6355/src/app/code/community/Radial/Core/Model/Abstract/Send.php#L119-L152 |
203,623 | phavour/phavour | Phavour/Application.php | Application.setCacheAdapter | public function setCacheAdapter(AdapterAbstract $adapter)
{
if ($this->isSetup) {
$e = new ApplicationIsAlreadySetupException('You cannot set the cache after calling setup()');
$this->error($e);
}
$this->cache = $adapter;
} | php | public function setCacheAdapter(AdapterAbstract $adapter)
{
if ($this->isSetup) {
$e = new ApplicationIsAlreadySetupException('You cannot set the cache after calling setup()');
$this->error($e);
}
$this->cache = $adapter;
} | [
"public",
"function",
"setCacheAdapter",
"(",
"AdapterAbstract",
"$",
"adapter",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isSetup",
")",
"{",
"$",
"e",
"=",
"new",
"ApplicationIsAlreadySetupException",
"(",
"'You cannot set the cache after calling setup()'",
")",
";... | Set an application level cache adapter.
This adapter will be made available to all runnables
@param AdapterAbstract $adapter | [
"Set",
"an",
"application",
"level",
"cache",
"adapter",
".",
"This",
"adapter",
"will",
"be",
"made",
"available",
"to",
"all",
"runnables"
] | 2246f78203312eb2e23fdb0f776f790e81b4d20f | https://github.com/phavour/phavour/blob/2246f78203312eb2e23fdb0f776f790e81b4d20f/Phavour/Application.php#L134-L142 |
203,624 | phavour/phavour | Phavour/Application.php | Application.setup | public function setup()
{
$this->request = new Request();
$this->response = new Response();
$this->env = new Environment();
$this->mode = $this->env->getMode();
if (!$this->env->isProduction() || $this->cache == null) {
$this->cache = new AdapterNull();
}
... | php | public function setup()
{
$this->request = new Request();
$this->response = new Response();
$this->env = new Environment();
$this->mode = $this->env->getMode();
if (!$this->env->isProduction() || $this->cache == null) {
$this->cache = new AdapterNull();
}
... | [
"public",
"function",
"setup",
"(",
")",
"{",
"$",
"this",
"->",
"request",
"=",
"new",
"Request",
"(",
")",
";",
"$",
"this",
"->",
"response",
"=",
"new",
"Response",
"(",
")",
";",
"$",
"this",
"->",
"env",
"=",
"new",
"Environment",
"(",
")",
... | Setup the application, assigns all the packages, config,
routes | [
"Setup",
"the",
"application",
"assigns",
"all",
"the",
"packages",
"config",
"routes"
] | 2246f78203312eb2e23fdb0f776f790e81b4d20f | https://github.com/phavour/phavour/blob/2246f78203312eb2e23fdb0f776f790e81b4d20f/Phavour/Application.php#L148-L168 |
203,625 | phavour/phavour | Phavour/Application.php | Application.loadPackages | private function loadPackages()
{
foreach ($this->packages as $package) {
/** @var $package \Phavour\Package */
$this->packagesMetadata[$package->getPackageName()] = array(
'namespace' => $package->getNamespace(),
'route_path' => $package->getRoutePath... | php | private function loadPackages()
{
foreach ($this->packages as $package) {
/** @var $package \Phavour\Package */
$this->packagesMetadata[$package->getPackageName()] = array(
'namespace' => $package->getNamespace(),
'route_path' => $package->getRoutePath... | [
"private",
"function",
"loadPackages",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"packages",
"as",
"$",
"package",
")",
"{",
"/** @var $package \\Phavour\\Package */",
"$",
"this",
"->",
"packagesMetadata",
"[",
"$",
"package",
"->",
"getPackageName",
"(... | Load the package metadata from the given list | [
"Load",
"the",
"package",
"metadata",
"from",
"the",
"given",
"list"
] | 2246f78203312eb2e23fdb0f776f790e81b4d20f | https://github.com/phavour/phavour/blob/2246f78203312eb2e23fdb0f776f790e81b4d20f/Phavour/Application.php#L281-L293 |
203,626 | phavour/phavour | Phavour/Application.php | Application.getRunnable | private function getRunnable($package, $class, $method, $className)
{
$view = $this->getViewFor($package, $class, $method);
$instance = new $className($this->request, $this->response, $view, $this->env, $this->cache, $this->router, $this->config);
/* @var $instance Runnable */
$insta... | php | private function getRunnable($package, $class, $method, $className)
{
$view = $this->getViewFor($package, $class, $method);
$instance = new $className($this->request, $this->response, $view, $this->env, $this->cache, $this->router, $this->config);
/* @var $instance Runnable */
$insta... | [
"private",
"function",
"getRunnable",
"(",
"$",
"package",
",",
"$",
"class",
",",
"$",
"method",
",",
"$",
"className",
")",
"{",
"$",
"view",
"=",
"$",
"this",
"->",
"getViewFor",
"(",
"$",
"package",
",",
"$",
"class",
",",
"$",
"method",
")",
"... | Get the corresponding runnable for the given parameters
@param string $package
@param string $class
@param string $method
@param string $className
@return \Phavour\Runnable | [
"Get",
"the",
"corresponding",
"runnable",
"for",
"the",
"given",
"parameters"
] | 2246f78203312eb2e23fdb0f776f790e81b4d20f | https://github.com/phavour/phavour/blob/2246f78203312eb2e23fdb0f776f790e81b4d20f/Phavour/Application.php#L526-L534 |
203,627 | phavour/phavour | Phavour/Application.php | Application.getViewFor | private function getViewFor($package, $class, $method)
{
$view = new View($this, $package, $class, $method);
$view->setRouter($this->router);
$view->setConfig($this->config);
return $view;
} | php | private function getViewFor($package, $class, $method)
{
$view = new View($this, $package, $class, $method);
$view->setRouter($this->router);
$view->setConfig($this->config);
return $view;
} | [
"private",
"function",
"getViewFor",
"(",
"$",
"package",
",",
"$",
"class",
",",
"$",
"method",
")",
"{",
"$",
"view",
"=",
"new",
"View",
"(",
"$",
"this",
",",
"$",
"package",
",",
"$",
"class",
",",
"$",
"method",
")",
";",
"$",
"view",
"->",... | Retrieve an instance of View for a given package, class, method combination
@param string $package
@param string $class
@param string $method
@return \Phavour\Runnable\View | [
"Retrieve",
"an",
"instance",
"of",
"View",
"for",
"a",
"given",
"package",
"class",
"method",
"combination"
] | 2246f78203312eb2e23fdb0f776f790e81b4d20f | https://github.com/phavour/phavour/blob/2246f78203312eb2e23fdb0f776f790e81b4d20f/Phavour/Application.php#L543-L550 |
203,628 | RadialCorp/magento-core | src/app/code/community/Radial/Core/Model/Api.php | Radial_Core_Model_Api.request | public function request(
DOMDocument $doc,
$xsdName,
$uri,
$timeout = self::DEFAULT_TIMEOUT,
$adapter = self::DEFAULT_ADAPTER,
Zend_Http_Client $client = null,
$apiKey = null
) {
if (!$apiKey) {
$apiKey = Mage::helper('radial_core')->getCon... | php | public function request(
DOMDocument $doc,
$xsdName,
$uri,
$timeout = self::DEFAULT_TIMEOUT,
$adapter = self::DEFAULT_ADAPTER,
Zend_Http_Client $client = null,
$apiKey = null
) {
if (!$apiKey) {
$apiKey = Mage::helper('radial_core')->getCon... | [
"public",
"function",
"request",
"(",
"DOMDocument",
"$",
"doc",
",",
"$",
"xsdName",
",",
"$",
"uri",
",",
"$",
"timeout",
"=",
"self",
"::",
"DEFAULT_TIMEOUT",
",",
"$",
"adapter",
"=",
"self",
"::",
"DEFAULT_ADAPTER",
",",
"Zend_Http_Client",
"$",
"clie... | Call the API.
@param DOMDocument $doc The document to send in the request body
@param string $xsdName The basename of the xsd file to validate $doc (The dirname is in config.xml)
@param string $uri The uri to send the request to
@param int $timeout The amount of time in seconds after which the connection is terminated... | [
"Call",
"the",
"API",
"."
] | 9bb5f218d9caf79eab8598f4f8447037a0cc6355 | https://github.com/RadialCorp/magento-core/blob/9bb5f218d9caf79eab8598f4f8447037a0cc6355/src/app/code/community/Radial/Core/Model/Api.php#L73-L102 |
203,629 | RadialCorp/magento-core | src/app/code/community/Radial/Core/Model/Api.php | Radial_Core_Model_Api._processResponse | protected function _processResponse(Zend_Http_Response $response, $uri)
{
$this->_status = $response->getStatus();
$config = $this->_getHandlerConfig($this->_getHandlerKey($response));
$logMethod = isset($config['logger']) ? $config['logger'] : 'debug';
$logData = array_merge(['rom_r... | php | protected function _processResponse(Zend_Http_Response $response, $uri)
{
$this->_status = $response->getStatus();
$config = $this->_getHandlerConfig($this->_getHandlerKey($response));
$logMethod = isset($config['logger']) ? $config['logger'] : 'debug';
$logData = array_merge(['rom_r... | [
"protected",
"function",
"_processResponse",
"(",
"Zend_Http_Response",
"$",
"response",
",",
"$",
"uri",
")",
"{",
"$",
"this",
"->",
"_status",
"=",
"$",
"response",
"->",
"getStatus",
"(",
")",
";",
"$",
"config",
"=",
"$",
"this",
"->",
"_getHandlerCon... | log the response and return the result of the configured handler method.
@param Zend_Http_Response $response
@param string $uri
@return string response body or empty | [
"log",
"the",
"response",
"and",
"return",
"the",
"result",
"of",
"the",
"configured",
"handler",
"method",
"."
] | 9bb5f218d9caf79eab8598f4f8447037a0cc6355 | https://github.com/RadialCorp/magento-core/blob/9bb5f218d9caf79eab8598f4f8447037a0cc6355/src/app/code/community/Radial/Core/Model/Api.php#L136-L154 |
203,630 | RadialCorp/magento-core | src/app/code/community/Radial/Core/Model/Api.php | Radial_Core_Model_Api.schemaValidate | public function schemaValidate(DOMDocument $doc, $xsdName)
{
$errors = array();
set_error_handler(function ($errno, $errstr) use (&$errors) {
$errors[] = "'$errstr' [Errno $errno]";
});
$cfg = Mage::helper('radial_core')->getConfigModel();
$isValid = $doc->schemaV... | php | public function schemaValidate(DOMDocument $doc, $xsdName)
{
$errors = array();
set_error_handler(function ($errno, $errstr) use (&$errors) {
$errors[] = "'$errstr' [Errno $errno]";
});
$cfg = Mage::helper('radial_core')->getConfigModel();
$isValid = $doc->schemaV... | [
"public",
"function",
"schemaValidate",
"(",
"DOMDocument",
"$",
"doc",
",",
"$",
"xsdName",
")",
"{",
"$",
"errors",
"=",
"array",
"(",
")",
";",
"set_error_handler",
"(",
"function",
"(",
"$",
"errno",
",",
"$",
"errstr",
")",
"use",
"(",
"&",
"$",
... | Validates the DOM against a validation schema,
which should be a full path to an xsd for this DOMDocument.
@param DomDocument $doc The document to validate
@param string $xsdName xsd file basename with which to validate the doc
@throws Radial_Core_Exception_InvalidXml when the schema is invalid
@return self | [
"Validates",
"the",
"DOM",
"against",
"a",
"validation",
"schema",
"which",
"should",
"be",
"a",
"full",
"path",
"to",
"an",
"xsd",
"for",
"this",
"DOMDocument",
"."
] | 9bb5f218d9caf79eab8598f4f8447037a0cc6355 | https://github.com/RadialCorp/magento-core/blob/9bb5f218d9caf79eab8598f4f8447037a0cc6355/src/app/code/community/Radial/Core/Model/Api.php#L171-L189 |
203,631 | RadialCorp/magento-core | src/app/code/community/Radial/Core/Model/Api.php | Radial_Core_Model_Api._processException | protected function _processException(Zend_Http_Client_Exception $exception, $uri)
{
$this->_status = 0;
$config = $this->_getHandlerConfig($this->_getHandlerKey());
$logMethod = isset($config['logger']) ? $config['logger'] : 'debug';
// the zend http client throws exceptions that are... | php | protected function _processException(Zend_Http_Client_Exception $exception, $uri)
{
$this->_status = 0;
$config = $this->_getHandlerConfig($this->_getHandlerKey());
$logMethod = isset($config['logger']) ? $config['logger'] : 'debug';
// the zend http client throws exceptions that are... | [
"protected",
"function",
"_processException",
"(",
"Zend_Http_Client_Exception",
"$",
"exception",
",",
"$",
"uri",
")",
"{",
"$",
"this",
"->",
"_status",
"=",
"0",
";",
"$",
"config",
"=",
"$",
"this",
"->",
"_getHandlerConfig",
"(",
"$",
"this",
"->",
"... | handle the exception thrown by the zend client and return the result of the
configured handler.
@param Zend_Http_Client_Exception $exception
@param string $uri
@return string | [
"handle",
"the",
"exception",
"thrown",
"by",
"the",
"zend",
"client",
"and",
"return",
"the",
"result",
"of",
"the",
"configured",
"handler",
"."
] | 9bb5f218d9caf79eab8598f4f8447037a0cc6355 | https://github.com/RadialCorp/magento-core/blob/9bb5f218d9caf79eab8598f4f8447037a0cc6355/src/app/code/community/Radial/Core/Model/Api.php#L197-L209 |
203,632 | RadialCorp/magento-core | src/app/code/community/Radial/Core/Model/Api.php | Radial_Core_Model_Api._getHandlerKey | protected function _getHandlerKey(Zend_Http_Response $response = null)
{
if ($response) {
$code = $response->getStatus();
if ($response->isSuccessful() || $response->isRedirect()) {
return 'success';
} elseif ($code < 500 && $code >= 400) {
... | php | protected function _getHandlerKey(Zend_Http_Response $response = null)
{
if ($response) {
$code = $response->getStatus();
if ($response->isSuccessful() || $response->isRedirect()) {
return 'success';
} elseif ($code < 500 && $code >= 400) {
... | [
"protected",
"function",
"_getHandlerKey",
"(",
"Zend_Http_Response",
"$",
"response",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"response",
")",
"{",
"$",
"code",
"=",
"$",
"response",
"->",
"getStatus",
"(",
")",
";",
"if",
"(",
"$",
"response",
"->",
"... | return a string that is a key to the handler config for the class of status codes.
@param Zend_Http_Response $response
@return string | [
"return",
"a",
"string",
"that",
"is",
"a",
"key",
"to",
"the",
"handler",
"config",
"for",
"the",
"class",
"of",
"status",
"codes",
"."
] | 9bb5f218d9caf79eab8598f4f8447037a0cc6355 | https://github.com/RadialCorp/magento-core/blob/9bb5f218d9caf79eab8598f4f8447037a0cc6355/src/app/code/community/Radial/Core/Model/Api.php#L239-L254 |
203,633 | beyoio/beyod | Parser.php | Parser.input | public function input($buffer, $connection)
{
$len = strlen($buffer);
if ($this->max_packet_size >0 && $len >= $this->max_packet_size) {
throw new \Exception($connection.' request packet size exceed max_packet_size ', Server::ERROR_LARGE_PACKET);
}
retur... | php | public function input($buffer, $connection)
{
$len = strlen($buffer);
if ($this->max_packet_size >0 && $len >= $this->max_packet_size) {
throw new \Exception($connection.' request packet size exceed max_packet_size ', Server::ERROR_LARGE_PACKET);
}
retur... | [
"public",
"function",
"input",
"(",
"$",
"buffer",
",",
"$",
"connection",
")",
"{",
"$",
"len",
"=",
"strlen",
"(",
"$",
"buffer",
")",
";",
"if",
"(",
"$",
"this",
"->",
"max_packet_size",
">",
"0",
"&&",
"$",
"len",
">=",
"$",
"this",
"->",
"m... | Determines whether the current connection has received the complete packet,
zero value indicates that a complete packet is not received yet,
positive value indicates that a complete packet has been received and represents the number of bytes of the packet,
negative value indicates that the data is invalid or unrecogniz... | [
"Determines",
"whether",
"the",
"current",
"connection",
"has",
"received",
"the",
"complete",
"packet",
"zero",
"value",
"indicates",
"that",
"a",
"complete",
"packet",
"is",
"not",
"received",
"yet",
"positive",
"value",
"indicates",
"that",
"a",
"complete",
"... | 11941db9c4ae4abbca6c8e634d21873c690efc79 | https://github.com/beyoio/beyod/blob/11941db9c4ae4abbca6c8e634d21873c690efc79/Parser.php#L51-L60 |
203,634 | kiwi-26/line-bot-test-helper | src/WebhookEvent.php | WebhookEvent.body | public function body() {
$event = [];
if (!empty($this->replyToken)) {
$event['replyToken'] = $this->replyToken;
}
$event['type'] = $this->eventType();
$event['timestamp'] = time();
$event['source'] = $this->source;
$event['message'] = $this->message;
... | php | public function body() {
$event = [];
if (!empty($this->replyToken)) {
$event['replyToken'] = $this->replyToken;
}
$event['type'] = $this->eventType();
$event['timestamp'] = time();
$event['source'] = $this->source;
$event['message'] = $this->message;
... | [
"public",
"function",
"body",
"(",
")",
"{",
"$",
"event",
"=",
"[",
"]",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"replyToken",
")",
")",
"{",
"$",
"event",
"[",
"'replyToken'",
"]",
"=",
"$",
"this",
"->",
"replyToken",
";",
"}",
... | Build webhook event and return body.
Original webhook request body has this signature.
@return String json encoded body. | [
"Build",
"webhook",
"event",
"and",
"return",
"body",
".",
"Original",
"webhook",
"request",
"body",
"has",
"this",
"signature",
"."
] | e1d6fb611e73016a5242c4b28238686926f262ba | https://github.com/kiwi-26/line-bot-test-helper/blob/e1d6fb611e73016a5242c4b28238686926f262ba/src/WebhookEvent.php#L40-L51 |
203,635 | luoxiaojun1992/lb_framework | components/traits/lb/Config.php | Config.getCustomConfig | public function getCustomConfig($name = '')
{
$custom_config = $this->getConfigByName('custom');
return $name ? ($custom_config[$name] ?? null) : $custom_config;
} | php | public function getCustomConfig($name = '')
{
$custom_config = $this->getConfigByName('custom');
return $name ? ($custom_config[$name] ?? null) : $custom_config;
} | [
"public",
"function",
"getCustomConfig",
"(",
"$",
"name",
"=",
"''",
")",
"{",
"$",
"custom_config",
"=",
"$",
"this",
"->",
"getConfigByName",
"(",
"'custom'",
")",
";",
"return",
"$",
"name",
"?",
"(",
"$",
"custom_config",
"[",
"$",
"name",
"]",
"?... | Get Custom Configuration
@param string $name
@return array|null | [
"Get",
"Custom",
"Configuration"
] | 12a865729e7738d7d1e07371ad7203243c4571fa | https://github.com/luoxiaojun1992/lb_framework/blob/12a865729e7738d7d1e07371ad7203243c4571fa/components/traits/lb/Config.php#L100-L104 |
203,636 | luoxiaojun1992/lb_framework | components/traits/lb/Config.php | Config.getConfigByName | public function getConfigByName($config_name)
{
if ($this->isSingle()) {
if (isset($this->containers['config'])) {
return $this->containers['config']->get($config_name);
}
}
return [];
} | php | public function getConfigByName($config_name)
{
if ($this->isSingle()) {
if (isset($this->containers['config'])) {
return $this->containers['config']->get($config_name);
}
}
return [];
} | [
"public",
"function",
"getConfigByName",
"(",
"$",
"config_name",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isSingle",
"(",
")",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"containers",
"[",
"'config'",
"]",
")",
")",
"{",
"return",
"$",
... | Get Configuration By Name
@param $config_name
@return array | [
"Get",
"Configuration",
"By",
"Name"
] | 12a865729e7738d7d1e07371ad7203243c4571fa | https://github.com/luoxiaojun1992/lb_framework/blob/12a865729e7738d7d1e07371ad7203243c4571fa/components/traits/lb/Config.php#L215-L223 |
203,637 | luoxiaojun1992/lb_framework | components/traits/lb/Config.php | Config.getUrlManagerConfig | public function getUrlManagerConfig($item)
{
$urlManager = $this->getConfigByName('urlManager');
if (isset($urlManager[$item])) {
return $urlManager[$item];
}
return false;
} | php | public function getUrlManagerConfig($item)
{
$urlManager = $this->getConfigByName('urlManager');
if (isset($urlManager[$item])) {
return $urlManager[$item];
}
return false;
} | [
"public",
"function",
"getUrlManagerConfig",
"(",
"$",
"item",
")",
"{",
"$",
"urlManager",
"=",
"$",
"this",
"->",
"getConfigByName",
"(",
"'urlManager'",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"urlManager",
"[",
"$",
"item",
"]",
")",
")",
"{",
"ret... | Get Url Manager Config By Item Name
@param $item
@return bool | [
"Get",
"Url",
"Manager",
"Config",
"By",
"Item",
"Name"
] | 12a865729e7738d7d1e07371ad7203243c4571fa | https://github.com/luoxiaojun1992/lb_framework/blob/12a865729e7738d7d1e07371ad7203243c4571fa/components/traits/lb/Config.php#L231-L238 |
203,638 | luoxiaojun1992/lb_framework | components/traits/lb/Config.php | Config.getJsFiles | public function getJsFiles($controller_id, $template_id)
{
$js_files = [];
$asset_config = $this->getConfigByName('assets');
if (isset($asset_config[$controller_id][$template_id]['js'])) {
$js_files = $asset_config[$controller_id][$template_id]['js'];
}
return $js... | php | public function getJsFiles($controller_id, $template_id)
{
$js_files = [];
$asset_config = $this->getConfigByName('assets');
if (isset($asset_config[$controller_id][$template_id]['js'])) {
$js_files = $asset_config[$controller_id][$template_id]['js'];
}
return $js... | [
"public",
"function",
"getJsFiles",
"(",
"$",
"controller_id",
",",
"$",
"template_id",
")",
"{",
"$",
"js_files",
"=",
"[",
"]",
";",
"$",
"asset_config",
"=",
"$",
"this",
"->",
"getConfigByName",
"(",
"'assets'",
")",
";",
"if",
"(",
"isset",
"(",
"... | Get Js Files
@param $controller_id
@param $template_id
@return array | [
"Get",
"Js",
"Files"
] | 12a865729e7738d7d1e07371ad7203243c4571fa | https://github.com/luoxiaojun1992/lb_framework/blob/12a865729e7738d7d1e07371ad7203243c4571fa/components/traits/lb/Config.php#L267-L275 |
203,639 | luoxiaojun1992/lb_framework | components/traits/lb/Config.php | Config.getCssFiles | public function getCssFiles($controller_id, $template_id)
{
$css_files = [];
$asset_config = $this->getConfigByName('assets');
if (isset($asset_config[$controller_id][$template_id]['css'])) {
$css_files = $asset_config[$controller_id][$template_id]['css'];
}
retur... | php | public function getCssFiles($controller_id, $template_id)
{
$css_files = [];
$asset_config = $this->getConfigByName('assets');
if (isset($asset_config[$controller_id][$template_id]['css'])) {
$css_files = $asset_config[$controller_id][$template_id]['css'];
}
retur... | [
"public",
"function",
"getCssFiles",
"(",
"$",
"controller_id",
",",
"$",
"template_id",
")",
"{",
"$",
"css_files",
"=",
"[",
"]",
";",
"$",
"asset_config",
"=",
"$",
"this",
"->",
"getConfigByName",
"(",
"'assets'",
")",
";",
"if",
"(",
"isset",
"(",
... | Get Css Files
@param $controller_id
@param $template_id
@return array | [
"Get",
"Css",
"Files"
] | 12a865729e7738d7d1e07371ad7203243c4571fa | https://github.com/luoxiaojun1992/lb_framework/blob/12a865729e7738d7d1e07371ad7203243c4571fa/components/traits/lb/Config.php#L284-L292 |
203,640 | Synapse-Cmf/synapse-cmf | src/Synapse/Cmf/Framework/Engine/Decorator/Component/ComponentDecorator.php | ComponentDecorator.prepare | public function prepare(
$content,
ThemeInterface $theme,
TemplateInterface $template,
ZoneInterface $zone,
ComponentInterface $component
) {
$this->contextStack->push(
$this->contextBuilder
->setContent($content)
->setTheme... | php | public function prepare(
$content,
ThemeInterface $theme,
TemplateInterface $template,
ZoneInterface $zone,
ComponentInterface $component
) {
$this->contextStack->push(
$this->contextBuilder
->setContent($content)
->setTheme... | [
"public",
"function",
"prepare",
"(",
"$",
"content",
",",
"ThemeInterface",
"$",
"theme",
",",
"TemplateInterface",
"$",
"template",
",",
"ZoneInterface",
"$",
"zone",
",",
"ComponentInterface",
"$",
"component",
")",
"{",
"$",
"this",
"->",
"contextStack",
"... | Prepare decorator context.
@param ContentInterface|Content $content
@param ThemeInterface $theme
@param TemplateInterface $template
@param ZoneInterface $zone
@param ComponentInterface $component
@return self | [
"Prepare",
"decorator",
"context",
"."
] | d8122a4150a83d5607289724425cf35c56a5e880 | https://github.com/Synapse-Cmf/synapse-cmf/blob/d8122a4150a83d5607289724425cf35c56a5e880/src/Synapse/Cmf/Framework/Engine/Decorator/Component/ComponentDecorator.php#L64-L82 |
203,641 | znframework/package-hypertext | BootstrapAttributes.php | BootstrapAttributes.usePropertyOptions | protected function usePropertyOptions($selector, $content, $type)
{
$this->isBootstrapAttribute('on', function($return) use($type)
{
$this->settings['attr']['on'] = Base::suffix($return, '.bs.' . $type);
});
return $this->bootstrapObjectOptions($selector === 'all' ? '[da... | php | protected function usePropertyOptions($selector, $content, $type)
{
$this->isBootstrapAttribute('on', function($return) use($type)
{
$this->settings['attr']['on'] = Base::suffix($return, '.bs.' . $type);
});
return $this->bootstrapObjectOptions($selector === 'all' ? '[da... | [
"protected",
"function",
"usePropertyOptions",
"(",
"$",
"selector",
",",
"$",
"content",
",",
"$",
"type",
")",
"{",
"$",
"this",
"->",
"isBootstrapAttribute",
"(",
"'on'",
",",
"function",
"(",
"$",
"return",
")",
"use",
"(",
"$",
"type",
")",
"{",
"... | Protected use property options | [
"Protected",
"use",
"property",
"options"
] | 12bbc3bd47a2fae735f638a3e01cc82c1b9c9005 | https://github.com/znframework/package-hypertext/blob/12bbc3bd47a2fae735f638a3e01cc82c1b9c9005/BootstrapAttributes.php#L56-L64 |
203,642 | Etenil/assegai | src/assegai/modules/mail/services/ses/utilities/complextype.class.php | CFComplexType.json | public static function json($json, $member = '', $default_key = '')
{
return self::option_group(json_decode($json, true), $member, $default_key);
} | php | public static function json($json, $member = '', $default_key = '')
{
return self::option_group(json_decode($json, true), $member, $default_key);
} | [
"public",
"static",
"function",
"json",
"(",
"$",
"json",
",",
"$",
"member",
"=",
"''",
",",
"$",
"default_key",
"=",
"''",
")",
"{",
"return",
"self",
"::",
"option_group",
"(",
"json_decode",
"(",
"$",
"json",
",",
"true",
")",
",",
"$",
"member",... | Takes a JSON object, as a string, to convert to query string keys.
@param string $json (Required) A JSON object. The JSON string should use canonical rules (e.g., double quotes, quoted keys) as is required by PHP's <php:json_encode()> function.
@param string $member (Optional) The name of the "member" property that AW... | [
"Takes",
"a",
"JSON",
"object",
"as",
"a",
"string",
"to",
"convert",
"to",
"query",
"string",
"keys",
"."
] | d43cce1a88f1c332f60dd0a4374b17764852af9e | https://github.com/Etenil/assegai/blob/d43cce1a88f1c332f60dd0a4374b17764852af9e/src/assegai/modules/mail/services/ses/utilities/complextype.class.php#L39-L42 |
203,643 | Etenil/assegai | src/assegai/modules/mail/services/ses/utilities/complextype.class.php | CFComplexType.yaml | public static function yaml($yaml, $member = '', $default_key = '')
{
return self::option_group(sfYaml::load($yaml), $member, $default_key);
} | php | public static function yaml($yaml, $member = '', $default_key = '')
{
return self::option_group(sfYaml::load($yaml), $member, $default_key);
} | [
"public",
"static",
"function",
"yaml",
"(",
"$",
"yaml",
",",
"$",
"member",
"=",
"''",
",",
"$",
"default_key",
"=",
"''",
")",
"{",
"return",
"self",
"::",
"option_group",
"(",
"sfYaml",
"::",
"load",
"(",
"$",
"yaml",
")",
",",
"$",
"member",
"... | Takes a YAML object, as a string, to convert to query string keys.
@param string $yaml (Required) A YAML object.
@param string $member (Optional) The name of the "member" property that AWS uses for lists in certain services. Defaults to an empty string.
@param string $default_key (Optional) The default key to use when... | [
"Takes",
"a",
"YAML",
"object",
"as",
"a",
"string",
"to",
"convert",
"to",
"query",
"string",
"keys",
"."
] | d43cce1a88f1c332f60dd0a4374b17764852af9e | https://github.com/Etenil/assegai/blob/d43cce1a88f1c332f60dd0a4374b17764852af9e/src/assegai/modules/mail/services/ses/utilities/complextype.class.php#L52-L55 |
203,644 | alekitto/metadata | lib/Exception/InvalidArgumentException.php | InvalidArgumentException.create | public static function create($reason): self
{
$arguments = func_get_args();
switch ($reason) {
case static::CLASS_DOES_NOT_EXIST:
$message = sprintf('Class %s does not exist. Cannot retrieve its metadata', $arguments[1]);
return new static($message);
... | php | public static function create($reason): self
{
$arguments = func_get_args();
switch ($reason) {
case static::CLASS_DOES_NOT_EXIST:
$message = sprintf('Class %s does not exist. Cannot retrieve its metadata', $arguments[1]);
return new static($message);
... | [
"public",
"static",
"function",
"create",
"(",
"$",
"reason",
")",
":",
"self",
"{",
"$",
"arguments",
"=",
"func_get_args",
"(",
")",
";",
"switch",
"(",
"$",
"reason",
")",
"{",
"case",
"static",
"::",
"CLASS_DOES_NOT_EXIST",
":",
"$",
"message",
"=",
... | Create a new instance of InvalidArgumentException with meaningful message.
@param $reason
@return self | [
"Create",
"a",
"new",
"instance",
"of",
"InvalidArgumentException",
"with",
"meaningful",
"message",
"."
] | 0422ac8d7fe72d5fa8cc51b6f1e173866e8afb2c | https://github.com/alekitto/metadata/blob/0422ac8d7fe72d5fa8cc51b6f1e173866e8afb2c/lib/Exception/InvalidArgumentException.php#L20-L62 |
203,645 | event-bus/event-dispatcher | src/Util/Pattern/PatternFactory.php | PatternFactory.getPatternFor | public static function getPatternFor(Pattern $parent, $word)
{
if (self::isWildcard($word)) {
return self::getWildcardPattern($parent, $word);
}
return new Word($word);
} | php | public static function getPatternFor(Pattern $parent, $word)
{
if (self::isWildcard($word)) {
return self::getWildcardPattern($parent, $word);
}
return new Word($word);
} | [
"public",
"static",
"function",
"getPatternFor",
"(",
"Pattern",
"$",
"parent",
",",
"$",
"word",
")",
"{",
"if",
"(",
"self",
"::",
"isWildcard",
"(",
"$",
"word",
")",
")",
"{",
"return",
"self",
"::",
"getWildcardPattern",
"(",
"$",
"parent",
",",
"... | Builds a pattern node based on a given word and its parent.
@param Pattern $parent The parent pattern object, in case a loop node will be built.
@param string $word A single word from a composite pattern.
@return Pattern A pattern object. | [
"Builds",
"a",
"pattern",
"node",
"based",
"on",
"a",
"given",
"word",
"and",
"its",
"parent",
"."
] | 0954a9fe0084fbd096b1c32e386c21fb4754b5ff | https://github.com/event-bus/event-dispatcher/blob/0954a9fe0084fbd096b1c32e386c21fb4754b5ff/src/Util/Pattern/PatternFactory.php#L20-L27 |
203,646 | as3io/modlr | src/Models/Collections/ModelCollection.php | ModelCollection.loadFromStore | protected function loadFromStore()
{
if (false === $this->isLoaded()) {
// Loads collection from the database on iteration.
$models = $this->store->loadCollection($this);
$this->setModels($models);
$this->loaded = true;
}
} | php | protected function loadFromStore()
{
if (false === $this->isLoaded()) {
// Loads collection from the database on iteration.
$models = $this->store->loadCollection($this);
$this->setModels($models);
$this->loaded = true;
}
} | [
"protected",
"function",
"loadFromStore",
"(",
")",
"{",
"if",
"(",
"false",
"===",
"$",
"this",
"->",
"isLoaded",
"(",
")",
")",
"{",
"// Loads collection from the database on iteration.",
"$",
"models",
"=",
"$",
"this",
"->",
"store",
"->",
"loadCollection",
... | Loads this collection from the store. | [
"Loads",
"this",
"collection",
"from",
"the",
"store",
"."
] | 7e684b88bb22a2e18397df9402075c6533084b16 | https://github.com/as3io/modlr/blob/7e684b88bb22a2e18397df9402075c6533084b16/src/Models/Collections/ModelCollection.php#L103-L111 |
203,647 | alphacomm/alpharpc | src/AlphaRPC/Worker/WorkerCommunication.php | WorkerCommunication.setDelay | public function setDelay($delay)
{
if (!ctype_digit((string) $delay)) {
throw new \InvalidArgumentException('Delay must be a number.');
}
$this->delay = $delay;
return $this;
} | php | public function setDelay($delay)
{
if (!ctype_digit((string) $delay)) {
throw new \InvalidArgumentException('Delay must be a number.');
}
$this->delay = $delay;
return $this;
} | [
"public",
"function",
"setDelay",
"(",
"$",
"delay",
")",
"{",
"if",
"(",
"!",
"ctype_digit",
"(",
"(",
"string",
")",
"$",
"delay",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"'Delay must be a number.'",
")",
";",
"}",
"$",
"t... | The time it takes for the handler to respond.
@param int $delay
@throws \InvalidArgumentException
@return WorkerCommunication | [
"The",
"time",
"it",
"takes",
"for",
"the",
"handler",
"to",
"respond",
"."
] | cf162854500554c4ba8d39f2675de35a49c30ed0 | https://github.com/alphacomm/alpharpc/blob/cf162854500554c4ba8d39f2675de35a49c30ed0/src/AlphaRPC/Worker/WorkerCommunication.php#L115-L123 |
203,648 | alphacomm/alpharpc | src/AlphaRPC/Worker/WorkerCommunication.php | WorkerCommunication.start | public function start()
{
$this->workerHandlerReady = true;
$this->serviceStreamReady = true;
$this->sendToService(new ActionListRequest());
} | php | public function start()
{
$this->workerHandlerReady = true;
$this->serviceStreamReady = true;
$this->sendToService(new ActionListRequest());
} | [
"public",
"function",
"start",
"(",
")",
"{",
"$",
"this",
"->",
"workerHandlerReady",
"=",
"true",
";",
"$",
"this",
"->",
"serviceStreamReady",
"=",
"true",
";",
"$",
"this",
"->",
"sendToService",
"(",
"new",
"ActionListRequest",
"(",
")",
")",
";",
"... | Initializes the worker. | [
"Initializes",
"the",
"worker",
"."
] | cf162854500554c4ba8d39f2675de35a49c30ed0 | https://github.com/alphacomm/alpharpc/blob/cf162854500554c4ba8d39f2675de35a49c30ed0/src/AlphaRPC/Worker/WorkerCommunication.php#L128-L133 |
203,649 | alphacomm/alpharpc | src/AlphaRPC/Worker/WorkerCommunication.php | WorkerCommunication.process | public function process()
{
if ($this->worker->getState() == Worker::INVALID) {
throw new \RuntimeException('Invalid state to process.');
}
$expiry = 5000 + $this->delay;
if ($this->worker->isExpired($expiry)) {
$this->getLogger()->debug('Worker is expired, n... | php | public function process()
{
if ($this->worker->getState() == Worker::INVALID) {
throw new \RuntimeException('Invalid state to process.');
}
$expiry = 5000 + $this->delay;
if ($this->worker->isExpired($expiry)) {
$this->getLogger()->debug('Worker is expired, n... | [
"public",
"function",
"process",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"worker",
"->",
"getState",
"(",
")",
"==",
"Worker",
"::",
"INVALID",
")",
"{",
"throw",
"new",
"\\",
"RuntimeException",
"(",
"'Invalid state to process.'",
")",
";",
"}",
"$... | Perform one service cycle.
This method checks whether there are any new requests to be handled,
either from the Worker Handler or from the Service. | [
"Perform",
"one",
"service",
"cycle",
".",
"This",
"method",
"checks",
"whether",
"there",
"are",
"any",
"new",
"requests",
"to",
"be",
"handled",
"either",
"from",
"the",
"Worker",
"Handler",
"or",
"from",
"the",
"Service",
"."
] | cf162854500554c4ba8d39f2675de35a49c30ed0 | https://github.com/alphacomm/alpharpc/blob/cf162854500554c4ba8d39f2675de35a49c30ed0/src/AlphaRPC/Worker/WorkerCommunication.php#L140-L168 |
203,650 | alphacomm/alpharpc | src/AlphaRPC/Worker/WorkerCommunication.php | WorkerCommunication.createWorkerHandlerStream | protected function createWorkerHandlerStream(Socket $socket)
{
$socket->setId('manager');
$this->getPoller()->add($socket, ZMQ::POLL_IN);
$that = $this;
$this->workerHandlerStream = $socket->getStream();
$this->workerHandlerStream->addListener(StreamInterface::MESSAGE, funct... | php | protected function createWorkerHandlerStream(Socket $socket)
{
$socket->setId('manager');
$this->getPoller()->add($socket, ZMQ::POLL_IN);
$that = $this;
$this->workerHandlerStream = $socket->getStream();
$this->workerHandlerStream->addListener(StreamInterface::MESSAGE, funct... | [
"protected",
"function",
"createWorkerHandlerStream",
"(",
"Socket",
"$",
"socket",
")",
"{",
"$",
"socket",
"->",
"setId",
"(",
"'manager'",
")",
";",
"$",
"this",
"->",
"getPoller",
"(",
")",
"->",
"add",
"(",
"$",
"socket",
",",
"ZMQ",
"::",
"POLL_IN"... | Creates a socket to communicate with the worker handler.
@param Socket $socket
@return null | [
"Creates",
"a",
"socket",
"to",
"communicate",
"with",
"the",
"worker",
"handler",
"."
] | cf162854500554c4ba8d39f2675de35a49c30ed0 | https://github.com/alphacomm/alpharpc/blob/cf162854500554c4ba8d39f2675de35a49c30ed0/src/AlphaRPC/Worker/WorkerCommunication.php#L177-L195 |
203,651 | alphacomm/alpharpc | src/AlphaRPC/Worker/WorkerCommunication.php | WorkerCommunication.createServiceStream | protected function createServiceStream(Socket $socket)
{
$socket->setId('worker_service');
$this->getPoller()->add($socket, ZMQ::POLL_IN);
$that = $this;
$this->serviceStream = $socket->getStream();
$this->serviceStream->addListener(StreamInterface::MESSAGE, function (Messag... | php | protected function createServiceStream(Socket $socket)
{
$socket->setId('worker_service');
$this->getPoller()->add($socket, ZMQ::POLL_IN);
$that = $this;
$this->serviceStream = $socket->getStream();
$this->serviceStream->addListener(StreamInterface::MESSAGE, function (Messag... | [
"protected",
"function",
"createServiceStream",
"(",
"Socket",
"$",
"socket",
")",
"{",
"$",
"socket",
"->",
"setId",
"(",
"'worker_service'",
")",
";",
"$",
"this",
"->",
"getPoller",
"(",
")",
"->",
"add",
"(",
"$",
"socket",
",",
"ZMQ",
"::",
"POLL_IN... | Creates a socket to communicate with the service.
@param Socket $socket
@return null | [
"Creates",
"a",
"socket",
"to",
"communicate",
"with",
"the",
"service",
"."
] | cf162854500554c4ba8d39f2675de35a49c30ed0 | https://github.com/alphacomm/alpharpc/blob/cf162854500554c4ba8d39f2675de35a49c30ed0/src/AlphaRPC/Worker/WorkerCommunication.php#L204-L222 |
203,652 | alphacomm/alpharpc | src/AlphaRPC/Worker/WorkerCommunication.php | WorkerCommunication.onWorkerHandlerMessage | public function onWorkerHandlerMessage(MessageInterface $msg)
{
$this->workerHandlerReady = true;
$this->worker->touch();
if ($msg instanceof Destroy) {
$this->worker->setState(Worker::INVALID);
return;
}
if ($msg instanceof ExecuteJobRequest) {
... | php | public function onWorkerHandlerMessage(MessageInterface $msg)
{
$this->workerHandlerReady = true;
$this->worker->touch();
if ($msg instanceof Destroy) {
$this->worker->setState(Worker::INVALID);
return;
}
if ($msg instanceof ExecuteJobRequest) {
... | [
"public",
"function",
"onWorkerHandlerMessage",
"(",
"MessageInterface",
"$",
"msg",
")",
"{",
"$",
"this",
"->",
"workerHandlerReady",
"=",
"true",
";",
"$",
"this",
"->",
"worker",
"->",
"touch",
"(",
")",
";",
"if",
"(",
"$",
"msg",
"instanceof",
"Destr... | Handles a Message from the Worker Handler.
@param MessageInterface $msg | [
"Handles",
"a",
"Message",
"from",
"the",
"Worker",
"Handler",
"."
] | cf162854500554c4ba8d39f2675de35a49c30ed0 | https://github.com/alphacomm/alpharpc/blob/cf162854500554c4ba8d39f2675de35a49c30ed0/src/AlphaRPC/Worker/WorkerCommunication.php#L243-L267 |
203,653 | alphacomm/alpharpc | src/AlphaRPC/Worker/WorkerCommunication.php | WorkerCommunication.handleHeartbeatResponse | private function handleHeartbeatResponse()
{
$state = $this->worker->getState();
if (Worker::BUSY == $state) {
/**
* We should only reply in the following cases:
* - A heartbeat is about to expire.
* - We have a result.
*/
r... | php | private function handleHeartbeatResponse()
{
$state = $this->worker->getState();
if (Worker::BUSY == $state) {
/**
* We should only reply in the following cases:
* - A heartbeat is about to expire.
* - We have a result.
*/
r... | [
"private",
"function",
"handleHeartbeatResponse",
"(",
")",
"{",
"$",
"state",
"=",
"$",
"this",
"->",
"worker",
"->",
"getState",
"(",
")",
";",
"if",
"(",
"Worker",
"::",
"BUSY",
"==",
"$",
"state",
")",
"{",
"/**\n * We should only reply in the ... | Handles the heartbeat response from the worker handler. | [
"Handles",
"the",
"heartbeat",
"response",
"from",
"the",
"worker",
"handler",
"."
] | cf162854500554c4ba8d39f2675de35a49c30ed0 | https://github.com/alphacomm/alpharpc/blob/cf162854500554c4ba8d39f2675de35a49c30ed0/src/AlphaRPC/Worker/WorkerCommunication.php#L272-L308 |
203,654 | alphacomm/alpharpc | src/AlphaRPC/Worker/WorkerCommunication.php | WorkerCommunication.onServiceMessage | public function onServiceMessage(MessageInterface $msg)
{
$this->serviceStreamReady = true;
$this->getLogger()->debug('Received Service Message of Type: '.get_class($msg));
if ($msg instanceof ActionListResponse) {
$actions = $msg->getActions();
$this->getLogger()->... | php | public function onServiceMessage(MessageInterface $msg)
{
$this->serviceStreamReady = true;
$this->getLogger()->debug('Received Service Message of Type: '.get_class($msg));
if ($msg instanceof ActionListResponse) {
$actions = $msg->getActions();
$this->getLogger()->... | [
"public",
"function",
"onServiceMessage",
"(",
"MessageInterface",
"$",
"msg",
")",
"{",
"$",
"this",
"->",
"serviceStreamReady",
"=",
"true",
";",
"$",
"this",
"->",
"getLogger",
"(",
")",
"->",
"debug",
"(",
"'Received Service Message of Type: '",
".",
"get_cl... | Handles a Message from the Service Handler.
@param MessageInterface $msg | [
"Handles",
"a",
"Message",
"from",
"the",
"Service",
"Handler",
"."
] | cf162854500554c4ba8d39f2675de35a49c30ed0 | https://github.com/alphacomm/alpharpc/blob/cf162854500554c4ba8d39f2675de35a49c30ed0/src/AlphaRPC/Worker/WorkerCommunication.php#L315-L344 |
203,655 | alphacomm/alpharpc | src/AlphaRPC/Worker/WorkerCommunication.php | WorkerCommunication.startJob | public function startJob(ExecuteJobRequest $request)
{
$this->worker->setState(Worker::BUSY);
$requestId = $request->getRequestId();
$action = $request->getAction();
if (!$this->worker->hasAction($action)) {
$this->getLogger()->debug('Action '.$action.' not found.');
... | php | public function startJob(ExecuteJobRequest $request)
{
$this->worker->setState(Worker::BUSY);
$requestId = $request->getRequestId();
$action = $request->getAction();
if (!$this->worker->hasAction($action)) {
$this->getLogger()->debug('Action '.$action.' not found.');
... | [
"public",
"function",
"startJob",
"(",
"ExecuteJobRequest",
"$",
"request",
")",
"{",
"$",
"this",
"->",
"worker",
"->",
"setState",
"(",
"Worker",
"::",
"BUSY",
")",
";",
"$",
"requestId",
"=",
"$",
"request",
"->",
"getRequestId",
"(",
")",
";",
"$",
... | Starts a Job.
@param ExecuteJobRequest $request | [
"Starts",
"a",
"Job",
"."
] | cf162854500554c4ba8d39f2675de35a49c30ed0 | https://github.com/alphacomm/alpharpc/blob/cf162854500554c4ba8d39f2675de35a49c30ed0/src/AlphaRPC/Worker/WorkerCommunication.php#L351-L366 |
203,656 | alphacomm/alpharpc | src/AlphaRPC/Worker/WorkerCommunication.php | WorkerCommunication.heartbeat | public function heartbeat()
{
$state = $this->worker->getState();
if (!in_array($state, array(Worker::BUSY, Worker::READY))) {
return;
}
// Detect manager crash.
$timeout = 2500;
if (!$this->worker->isExpired($timeout)) {
// Worker is pretty a... | php | public function heartbeat()
{
$state = $this->worker->getState();
if (!in_array($state, array(Worker::BUSY, Worker::READY))) {
return;
}
// Detect manager crash.
$timeout = 2500;
if (!$this->worker->isExpired($timeout)) {
// Worker is pretty a... | [
"public",
"function",
"heartbeat",
"(",
")",
"{",
"$",
"state",
"=",
"$",
"this",
"->",
"worker",
"->",
"getState",
"(",
")",
";",
"if",
"(",
"!",
"in_array",
"(",
"$",
"state",
",",
"array",
"(",
"Worker",
"::",
"BUSY",
",",
"Worker",
"::",
"READY... | Performs a heartbeat with the Worker Handler. | [
"Performs",
"a",
"heartbeat",
"with",
"the",
"Worker",
"Handler",
"."
] | cf162854500554c4ba8d39f2675de35a49c30ed0 | https://github.com/alphacomm/alpharpc/blob/cf162854500554c4ba8d39f2675de35a49c30ed0/src/AlphaRPC/Worker/WorkerCommunication.php#L371-L399 |
203,657 | alphacomm/alpharpc | src/AlphaRPC/Worker/WorkerCommunication.php | WorkerCommunication.handleResult | public function handleResult()
{
// No result
$result = $this->worker->getResult();
if ($result === null) {
return;
}
// Invalid worker state, wait for a response first.
if (!$this->isWorkerHandlerReady()) {
return;
}
$this->s... | php | public function handleResult()
{
// No result
$result = $this->worker->getResult();
if ($result === null) {
return;
}
// Invalid worker state, wait for a response first.
if (!$this->isWorkerHandlerReady()) {
return;
}
$this->s... | [
"public",
"function",
"handleResult",
"(",
")",
"{",
"// No result",
"$",
"result",
"=",
"$",
"this",
"->",
"worker",
"->",
"getResult",
"(",
")",
";",
"if",
"(",
"$",
"result",
"===",
"null",
")",
"{",
"return",
";",
"}",
"// Invalid worker state, wait fo... | Sends when the Service is done working, this sends the result to the Worker Handler. | [
"Sends",
"when",
"the",
"Service",
"is",
"done",
"working",
"this",
"sends",
"the",
"result",
"to",
"the",
"Worker",
"Handler",
"."
] | cf162854500554c4ba8d39f2675de35a49c30ed0 | https://github.com/alphacomm/alpharpc/blob/cf162854500554c4ba8d39f2675de35a49c30ed0/src/AlphaRPC/Worker/WorkerCommunication.php#L404-L419 |
203,658 | alphacomm/alpharpc | src/AlphaRPC/Worker/WorkerCommunication.php | WorkerCommunication.sendToWorkerHandler | public function sendToWorkerHandler(MessageInterface $msg)
{
if (!$this->isWorkerHandlerReady()) {
$this->getLogger()->debug('WorkerHandler socket not ready to send.');
return;
}
$this->workerHandlerReady = false;
$this->workerHandlerStream->send($msg);
... | php | public function sendToWorkerHandler(MessageInterface $msg)
{
if (!$this->isWorkerHandlerReady()) {
$this->getLogger()->debug('WorkerHandler socket not ready to send.');
return;
}
$this->workerHandlerReady = false;
$this->workerHandlerStream->send($msg);
... | [
"public",
"function",
"sendToWorkerHandler",
"(",
"MessageInterface",
"$",
"msg",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"isWorkerHandlerReady",
"(",
")",
")",
"{",
"$",
"this",
"->",
"getLogger",
"(",
")",
"->",
"debug",
"(",
"'WorkerHandler socket no... | Send the given Message to the Worker Handler.
@param MessageInterface $msg | [
"Send",
"the",
"given",
"Message",
"to",
"the",
"Worker",
"Handler",
"."
] | cf162854500554c4ba8d39f2675de35a49c30ed0 | https://github.com/alphacomm/alpharpc/blob/cf162854500554c4ba8d39f2675de35a49c30ed0/src/AlphaRPC/Worker/WorkerCommunication.php#L426-L436 |
203,659 | alphacomm/alpharpc | src/AlphaRPC/Worker/WorkerCommunication.php | WorkerCommunication.sendToService | public function sendToService(MessageInterface $msg)
{
if (!$this->isServiceStreamReady()) {
$this->getLogger()->debug('Service socket not ready to send.');
return;
}
$this->getLogger()->debug('Sending to service.');
$this->serviceStreamReady = false;
... | php | public function sendToService(MessageInterface $msg)
{
if (!$this->isServiceStreamReady()) {
$this->getLogger()->debug('Service socket not ready to send.');
return;
}
$this->getLogger()->debug('Sending to service.');
$this->serviceStreamReady = false;
... | [
"public",
"function",
"sendToService",
"(",
"MessageInterface",
"$",
"msg",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"isServiceStreamReady",
"(",
")",
")",
"{",
"$",
"this",
"->",
"getLogger",
"(",
")",
"->",
"debug",
"(",
"'Service socket not ready to s... | Send the given Message to the Service.
@param MessageInterface $msg | [
"Send",
"the",
"given",
"Message",
"to",
"the",
"Service",
"."
] | cf162854500554c4ba8d39f2675de35a49c30ed0 | https://github.com/alphacomm/alpharpc/blob/cf162854500554c4ba8d39f2675de35a49c30ed0/src/AlphaRPC/Worker/WorkerCommunication.php#L443-L454 |
203,660 | plumphp/plum-excel | src/ExcelWriter.php | ExcelWriter.finish | public function finish()
{
$writer = $this->writer;
if (!$writer) {
$writer = PHPExcel_IOFactory::createWriter($this->excel, $this->format);
}
$writer->save($this->filename);
} | php | public function finish()
{
$writer = $this->writer;
if (!$writer) {
$writer = PHPExcel_IOFactory::createWriter($this->excel, $this->format);
}
$writer->save($this->filename);
} | [
"public",
"function",
"finish",
"(",
")",
"{",
"$",
"writer",
"=",
"$",
"this",
"->",
"writer",
";",
"if",
"(",
"!",
"$",
"writer",
")",
"{",
"$",
"writer",
"=",
"PHPExcel_IOFactory",
"::",
"createWriter",
"(",
"$",
"this",
"->",
"excel",
",",
"$",
... | Finish the writer. | [
"Finish",
"the",
"writer",
"."
] | cc1dd308901b836676e077b13f01c0c87845c5f6 | https://github.com/plumphp/plum-excel/blob/cc1dd308901b836676e077b13f01c0c87845c5f6/src/ExcelWriter.php#L156-L163 |
203,661 | strident/Aegis | src/Aegis/Authentication/Authenticator/DelegatingAuthenticator.php | DelegatingAuthenticator.delegateAuthenticator | private function delegateAuthenticator(TokenInterface $token)
{
if ( ! $authenticator = $this->resolveAuthenticator($token)) {
throw new \RuntimeException(sprintf(
'No authentication authenticator found for token: "%s".',
get_class($token)
));
... | php | private function delegateAuthenticator(TokenInterface $token)
{
if ( ! $authenticator = $this->resolveAuthenticator($token)) {
throw new \RuntimeException(sprintf(
'No authentication authenticator found for token: "%s".',
get_class($token)
));
... | [
"private",
"function",
"delegateAuthenticator",
"(",
"TokenInterface",
"$",
"token",
")",
"{",
"if",
"(",
"!",
"$",
"authenticator",
"=",
"$",
"this",
"->",
"resolveAuthenticator",
"(",
"$",
"token",
")",
")",
"{",
"throw",
"new",
"\\",
"RuntimeException",
"... | Delegate a authenticator for a token.
@param TokenInterface $token
@return DelegatingAuthenticator | [
"Delegate",
"a",
"authenticator",
"for",
"a",
"token",
"."
] | 954bd3d24808d77271844276ae31b41f4f039bd5 | https://github.com/strident/Aegis/blob/954bd3d24808d77271844276ae31b41f4f039bd5/src/Aegis/Authentication/Authenticator/DelegatingAuthenticator.php#L123-L133 |
203,662 | strident/Aegis | src/Aegis/Authentication/Authenticator/DelegatingAuthenticator.php | DelegatingAuthenticator.resolveAuthenticator | private function resolveAuthenticator(TokenInterface $token)
{
foreach ($this->authenticators as $authenticator) {
if ($authenticator->supports($token)) {
return $authenticator;
}
}
return false;
} | php | private function resolveAuthenticator(TokenInterface $token)
{
foreach ($this->authenticators as $authenticator) {
if ($authenticator->supports($token)) {
return $authenticator;
}
}
return false;
} | [
"private",
"function",
"resolveAuthenticator",
"(",
"TokenInterface",
"$",
"token",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"authenticators",
"as",
"$",
"authenticator",
")",
"{",
"if",
"(",
"$",
"authenticator",
"->",
"supports",
"(",
"$",
"token",
")"... | Resolve a token to its authenticator.
@param TokenInterface $token
@return mixed | [
"Resolve",
"a",
"token",
"to",
"its",
"authenticator",
"."
] | 954bd3d24808d77271844276ae31b41f4f039bd5 | https://github.com/strident/Aegis/blob/954bd3d24808d77271844276ae31b41f4f039bd5/src/Aegis/Authentication/Authenticator/DelegatingAuthenticator.php#L142-L151 |
203,663 | tigron/skeleton-error | lib/Skeleton/Error/Handler/Basic.php | Basic.handle | public function handle() {
// If this is a reqular exception, always quit, else check the type
if (!($this->exception instanceof \ErrorException)) {
$this->quit = true;
} else {
// Only quit after specific error types
switch ($this->exception->getSeverity()) {
case E_ERROR:
case E_CORE_ERROR:
... | php | public function handle() {
// If this is a reqular exception, always quit, else check the type
if (!($this->exception instanceof \ErrorException)) {
$this->quit = true;
} else {
// Only quit after specific error types
switch ($this->exception->getSeverity()) {
case E_ERROR:
case E_CORE_ERROR:
... | [
"public",
"function",
"handle",
"(",
")",
"{",
"// If this is a reqular exception, always quit, else check the type",
"if",
"(",
"!",
"(",
"$",
"this",
"->",
"exception",
"instanceof",
"\\",
"ErrorException",
")",
")",
"{",
"$",
"this",
"->",
"quit",
"=",
"true",
... | Handle an error with the most basic handler
@return string | [
"Handle",
"an",
"error",
"with",
"the",
"most",
"basic",
"handler"
] | c0671ad52a4386d95179f1c47bedfdf754ee3611 | https://github.com/tigron/skeleton-error/blob/c0671ad52a4386d95179f1c47bedfdf754ee3611/lib/Skeleton/Error/Handler/Basic.php#L24-L39 |
203,664 | tigron/skeleton-error | lib/Skeleton/Error/Handler/Basic.php | Basic.get_subject | public static function get_subject($exception) {
$application = null;
try {
$application = \Skeleton\Core\Application::get();
} catch (\Exception $e) {}
if ($application === null) {
$hostname = 'unknown';
$name = 'unknown';
} else {
$hostname = $application->hostname;
$name = $application->na... | php | public static function get_subject($exception) {
$application = null;
try {
$application = \Skeleton\Core\Application::get();
} catch (\Exception $e) {}
if ($application === null) {
$hostname = 'unknown';
$name = 'unknown';
} else {
$hostname = $application->hostname;
$name = $application->na... | [
"public",
"static",
"function",
"get_subject",
"(",
"$",
"exception",
")",
"{",
"$",
"application",
"=",
"null",
";",
"try",
"{",
"$",
"application",
"=",
"\\",
"Skeleton",
"\\",
"Core",
"\\",
"Application",
"::",
"get",
"(",
")",
";",
"}",
"catch",
"(... | Produce a subject based on the error
@param $exception (can be \Throwable or \Exception)
@return string | [
"Produce",
"a",
"subject",
"based",
"on",
"the",
"error"
] | c0671ad52a4386d95179f1c47bedfdf754ee3611 | https://github.com/tigron/skeleton-error/blob/c0671ad52a4386d95179f1c47bedfdf754ee3611/lib/Skeleton/Error/Handler/Basic.php#L61-L83 |
203,665 | tigron/skeleton-error | lib/Skeleton/Error/Handler/Basic.php | Basic.get_html | public static function get_html($exception) {
$subject = self::get_subject($exception);
if ($exception instanceof \ErrorException) {
$error_type = \Skeleton\Error\Util\Misc::translate_error_code($exception->getSeverity());
} else {
$error_type = 'Exception';
}
$error_info = '';
$error_info .= 'Error... | php | public static function get_html($exception) {
$subject = self::get_subject($exception);
if ($exception instanceof \ErrorException) {
$error_type = \Skeleton\Error\Util\Misc::translate_error_code($exception->getSeverity());
} else {
$error_type = 'Exception';
}
$error_info = '';
$error_info .= 'Error... | [
"public",
"static",
"function",
"get_html",
"(",
"$",
"exception",
")",
"{",
"$",
"subject",
"=",
"self",
"::",
"get_subject",
"(",
"$",
"exception",
")",
";",
"if",
"(",
"$",
"exception",
"instanceof",
"\\",
"ErrorException",
")",
"{",
"$",
"error_type",
... | Produce some HTML around the error
@param $exception (can be \Throwable or \Exception)
@return string | [
"Produce",
"some",
"HTML",
"around",
"the",
"error"
] | c0671ad52a4386d95179f1c47bedfdf754ee3611 | https://github.com/tigron/skeleton-error/blob/c0671ad52a4386d95179f1c47bedfdf754ee3611/lib/Skeleton/Error/Handler/Basic.php#L91-L150 |
203,666 | harp-orm/harp | src/Repo.php | Repo.loadRelFor | public function loadRelFor(Models $models, $relName, $flags = null)
{
$rel = $this->getRelOrError($relName);
$foreign = $rel->loadModelsIfAvailable($models, $flags);
$rel->linkModels($models, $foreign, function (AbstractLink $link) {
$class = get_class($link->getModel());
... | php | public function loadRelFor(Models $models, $relName, $flags = null)
{
$rel = $this->getRelOrError($relName);
$foreign = $rel->loadModelsIfAvailable($models, $flags);
$rel->linkModels($models, $foreign, function (AbstractLink $link) {
$class = get_class($link->getModel());
... | [
"public",
"function",
"loadRelFor",
"(",
"Models",
"$",
"models",
",",
"$",
"relName",
",",
"$",
"flags",
"=",
"null",
")",
"{",
"$",
"rel",
"=",
"$",
"this",
"->",
"getRelOrError",
"(",
"$",
"relName",
")",
";",
"$",
"foreign",
"=",
"$",
"rel",
"-... | Load models for a given relation.
@param Models $models
@param string $relName
@return Models
@throws InvalidArgumentException If $relName does not belong to repo | [
"Load",
"models",
"for",
"a",
"given",
"relation",
"."
] | e0751696521164c86ccd0a76d708df490efd8306 | https://github.com/harp-orm/harp/blob/e0751696521164c86ccd0a76d708df490efd8306/src/Repo.php#L137-L149 |
203,667 | harp-orm/harp | src/Repo.php | Repo.loadAllRelsFor | public function loadAllRelsFor(Models $models, array $rels, $flags = null)
{
$rels = Arr::toAssoc($rels);
foreach ($rels as $relName => $childRels) {
$foreign = $this->loadRelFor($models, $relName, $flags);
if ($childRels) {
$rel = $this->getRel($relName);
... | php | public function loadAllRelsFor(Models $models, array $rels, $flags = null)
{
$rels = Arr::toAssoc($rels);
foreach ($rels as $relName => $childRels) {
$foreign = $this->loadRelFor($models, $relName, $flags);
if ($childRels) {
$rel = $this->getRel($relName);
... | [
"public",
"function",
"loadAllRelsFor",
"(",
"Models",
"$",
"models",
",",
"array",
"$",
"rels",
",",
"$",
"flags",
"=",
"null",
")",
"{",
"$",
"rels",
"=",
"Arr",
"::",
"toAssoc",
"(",
"$",
"rels",
")",
";",
"foreach",
"(",
"$",
"rels",
"as",
"$",... | Load all the models for the provided relations. This is the meat of the eager loading
@param Models $models
@param array $rels
@param int $flags
@return Repo $this | [
"Load",
"all",
"the",
"models",
"for",
"the",
"provided",
"relations",
".",
"This",
"is",
"the",
"meat",
"of",
"the",
"eager",
"loading"
] | e0751696521164c86ccd0a76d708df490efd8306 | https://github.com/harp-orm/harp/blob/e0751696521164c86ccd0a76d708df490efd8306/src/Repo.php#L159-L173 |
203,668 | harp-orm/harp | src/Repo.php | Repo.updateModels | public function updateModels(Models $models)
{
foreach ($models as $model) {
if ($model->isSoftDeleted()) {
$this->dispatchBeforeEvent($model, Event::DELETE);
} else {
$this->dispatchBeforeEvent($model, Event::UPDATE);
$this->dispatchBe... | php | public function updateModels(Models $models)
{
foreach ($models as $model) {
if ($model->isSoftDeleted()) {
$this->dispatchBeforeEvent($model, Event::DELETE);
} else {
$this->dispatchBeforeEvent($model, Event::UPDATE);
$this->dispatchBe... | [
"public",
"function",
"updateModels",
"(",
"Models",
"$",
"models",
")",
"{",
"foreach",
"(",
"$",
"models",
"as",
"$",
"model",
")",
"{",
"if",
"(",
"$",
"model",
"->",
"isSoftDeleted",
"(",
")",
")",
"{",
"$",
"this",
"->",
"dispatchBeforeEvent",
"("... | Call all the events associated with model updates. Perform the update itself.
@param Models $models
@return Repo $this | [
"Call",
"all",
"the",
"events",
"associated",
"with",
"model",
"updates",
".",
"Perform",
"the",
"update",
"itself",
"."
] | e0751696521164c86ccd0a76d708df490efd8306 | https://github.com/harp-orm/harp/blob/e0751696521164c86ccd0a76d708df490efd8306/src/Repo.php#L181-L207 |
203,669 | harp-orm/harp | src/Repo.php | Repo.deleteModels | public function deleteModels(Models $models)
{
foreach ($models as $model) {
$this->dispatchBeforeEvent($model, Event::DELETE);
}
$this->deleteAll()->executeModels($models);
foreach ($models as $model) {
$this->dispatchAfterEvent($model, Event::DELETE);
... | php | public function deleteModels(Models $models)
{
foreach ($models as $model) {
$this->dispatchBeforeEvent($model, Event::DELETE);
}
$this->deleteAll()->executeModels($models);
foreach ($models as $model) {
$this->dispatchAfterEvent($model, Event::DELETE);
... | [
"public",
"function",
"deleteModels",
"(",
"Models",
"$",
"models",
")",
"{",
"foreach",
"(",
"$",
"models",
"as",
"$",
"model",
")",
"{",
"$",
"this",
"->",
"dispatchBeforeEvent",
"(",
"$",
"model",
",",
"Event",
"::",
"DELETE",
")",
";",
"}",
"$",
... | Call all the events associated with model deletion. Perform the deletion itself.
@param Models $models
@return Repo $this | [
"Call",
"all",
"the",
"events",
"associated",
"with",
"model",
"deletion",
".",
"Perform",
"the",
"deletion",
"itself",
"."
] | e0751696521164c86ccd0a76d708df490efd8306 | https://github.com/harp-orm/harp/blob/e0751696521164c86ccd0a76d708df490efd8306/src/Repo.php#L215-L228 |
203,670 | harp-orm/harp | src/Repo.php | Repo.insertModels | public function insertModels(Models $models)
{
foreach ($models as $model) {
$this->dispatchBeforeEvent($model, Event::INSERT);
$this->dispatchBeforeEvent($model, Event::SAVE);
}
$this->insertAll()->executeModels($models);
foreach ($models as $model) {
... | php | public function insertModels(Models $models)
{
foreach ($models as $model) {
$this->dispatchBeforeEvent($model, Event::INSERT);
$this->dispatchBeforeEvent($model, Event::SAVE);
}
$this->insertAll()->executeModels($models);
foreach ($models as $model) {
... | [
"public",
"function",
"insertModels",
"(",
"Models",
"$",
"models",
")",
"{",
"foreach",
"(",
"$",
"models",
"as",
"$",
"model",
")",
"{",
"$",
"this",
"->",
"dispatchBeforeEvent",
"(",
"$",
"model",
",",
"Event",
"::",
"INSERT",
")",
";",
"$",
"this",... | Call all the events associated with model insertion. Perform the insertion itself.
@param Models $models
@return Repo $this | [
"Call",
"all",
"the",
"events",
"associated",
"with",
"model",
"insertion",
".",
"Perform",
"the",
"insertion",
"itself",
"."
] | e0751696521164c86ccd0a76d708df490efd8306 | https://github.com/harp-orm/harp/blob/e0751696521164c86ccd0a76d708df490efd8306/src/Repo.php#L236-L255 |
203,671 | Phpillip/phpillip | src/Console/Command/WatchCommand.php | WatchCommand.build | protected function build(OutputInterface $output)
{
$this->command->run($this->input, $output);
$this->lastBuild = new DateTime();
} | php | protected function build(OutputInterface $output)
{
$this->command->run($this->input, $output);
$this->lastBuild = new DateTime();
} | [
"protected",
"function",
"build",
"(",
"OutputInterface",
"$",
"output",
")",
"{",
"$",
"this",
"->",
"command",
"->",
"run",
"(",
"$",
"this",
"->",
"input",
",",
"$",
"output",
")",
";",
"$",
"this",
"->",
"lastBuild",
"=",
"new",
"DateTime",
"(",
... | Run the build command
@param OutputInterface $output | [
"Run",
"the",
"build",
"command"
] | c37afaafb536361e7e0b564659f1cd5b80b98be9 | https://github.com/Phpillip/phpillip/blob/c37afaafb536361e7e0b564659f1cd5b80b98be9/src/Console/Command/WatchCommand.php#L88-L93 |
203,672 | prooph/processing | library/Processor/Process.php | Process.setUp | public static function setUp(NodeName $nodeName, array $tasks, array $config = array())
{
/** @var $instance Process */
$instance = new static();
$instance->assertConfig($config);
$processId = ProcessId::generate();
$taskList = TaskList::scheduleTasks(TaskListId::linkWith(... | php | public static function setUp(NodeName $nodeName, array $tasks, array $config = array())
{
/** @var $instance Process */
$instance = new static();
$instance->assertConfig($config);
$processId = ProcessId::generate();
$taskList = TaskList::scheduleTasks(TaskListId::linkWith(... | [
"public",
"static",
"function",
"setUp",
"(",
"NodeName",
"$",
"nodeName",
",",
"array",
"$",
"tasks",
",",
"array",
"$",
"config",
"=",
"array",
"(",
")",
")",
"{",
"/** @var $instance Process */",
"$",
"instance",
"=",
"new",
"static",
"(",
")",
";",
"... | Creates new process from given tasks and config
@param NodeName $nodeName
@param Task[] $tasks
@param array $config
@return static | [
"Creates",
"new",
"process",
"from",
"given",
"tasks",
"and",
"config"
] | a2947bccbffeecc4ca93a15e38ab53814e3e53e5 | https://github.com/prooph/processing/blob/a2947bccbffeecc4ca93a15e38ab53814e3e53e5/library/Processor/Process.php#L102-L116 |
203,673 | prooph/processing | library/Processor/Process.php | Process.receiveMessage | public function receiveMessage($message, WorkflowEngine $workflowEngine)
{
if ($message instanceof WorkflowMessage) {
if (MessageNameUtils::isProcessingCommand($message->messageName())) {
$this->perform($workflowEngine, $message);
return;
}
... | php | public function receiveMessage($message, WorkflowEngine $workflowEngine)
{
if ($message instanceof WorkflowMessage) {
if (MessageNameUtils::isProcessingCommand($message->messageName())) {
$this->perform($workflowEngine, $message);
return;
}
... | [
"public",
"function",
"receiveMessage",
"(",
"$",
"message",
",",
"WorkflowEngine",
"$",
"workflowEngine",
")",
"{",
"if",
"(",
"$",
"message",
"instanceof",
"WorkflowMessage",
")",
"{",
"if",
"(",
"MessageNameUtils",
"::",
"isProcessingCommand",
"(",
"$",
"mess... | A Process can start or continue with the next step after it has received a message
@param WorkflowMessage|LogMessage $message
@param WorkflowEngine $workflowEngine
@throws \RuntimeException
@return void | [
"A",
"Process",
"can",
"start",
"or",
"continue",
"with",
"the",
"next",
"step",
"after",
"it",
"has",
"received",
"a",
"message"
] | a2947bccbffeecc4ca93a15e38ab53814e3e53e5 | https://github.com/prooph/processing/blob/a2947bccbffeecc4ca93a15e38ab53814e3e53e5/library/Processor/Process.php#L168-L197 |
203,674 | oliwierptak/Everon1 | src/Everon/Helper/Asserts/IsEmpty.php | IsEmpty.assertIsEmpty | public function assertIsEmpty($value, $message='%s must not be empty', $exception='Asserts')
{
if (isset($value) === false || empty($value)) {
$this->throwException($exception, $message, $value);
}
} | php | public function assertIsEmpty($value, $message='%s must not be empty', $exception='Asserts')
{
if (isset($value) === false || empty($value)) {
$this->throwException($exception, $message, $value);
}
} | [
"public",
"function",
"assertIsEmpty",
"(",
"$",
"value",
",",
"$",
"message",
"=",
"'%s must not be empty'",
",",
"$",
"exception",
"=",
"'Asserts'",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"value",
")",
"===",
"false",
"||",
"empty",
"(",
"$",
"value",... | Verifies that the specified condition is not empty.
The assertion fails if the condition is empty.
@param mixed $value
@param string $message
@param string $exception
@throws \Everon\Exception\Asserts | [
"Verifies",
"that",
"the",
"specified",
"condition",
"is",
"not",
"empty",
".",
"The",
"assertion",
"fails",
"if",
"the",
"condition",
"is",
"empty",
"."
] | ac93793d1fa517a8394db5f00062f1925dc218a3 | https://github.com/oliwierptak/Everon1/blob/ac93793d1fa517a8394db5f00062f1925dc218a3/src/Everon/Helper/Asserts/IsEmpty.php#L23-L28 |
203,675 | haldayne/fox | src/Expression.php | Expression.makeCallable | private static function makeCallable($expression)
{
if (! array_key_exists($expression, static::$map)) {
$return = "return ($expression);";
try {
$lambda = create_function(static::$signature, $return);
} catch (\ParseError $ex) {
$lambda = ... | php | private static function makeCallable($expression)
{
if (! array_key_exists($expression, static::$map)) {
$return = "return ($expression);";
try {
$lambda = create_function(static::$signature, $return);
} catch (\ParseError $ex) {
$lambda = ... | [
"private",
"static",
"function",
"makeCallable",
"(",
"$",
"expression",
")",
"{",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"expression",
",",
"static",
"::",
"$",
"map",
")",
")",
"{",
"$",
"return",
"=",
"\"return ($expression);\"",
";",
"try",
"{",... | Given a string expression, turn that into an anonymous function.
Cache the result, so as to keep memory impacts low.
@throw \LogicException | [
"Given",
"a",
"string",
"expression",
"turn",
"that",
"into",
"an",
"anonymous",
"function",
".",
"Cache",
"the",
"result",
"so",
"as",
"to",
"keep",
"memory",
"impacts",
"low",
"."
] | f5dcc3798cca0fdbfc6f448c5cb5a174eaab60eb | https://github.com/haldayne/fox/blob/f5dcc3798cca0fdbfc6f448c5cb5a174eaab60eb/src/Expression.php#L124-L145 |
203,676 | stonedz/pff2 | src/modules/cookies/Cookies.php | Cookies.setCookie | public function setCookie($cookieName, $value = null, $expire = null) {
if ($expire !== null) {
$expire = time() + (60 * 60 * $expire);
}
if (setcookie($cookieName, $this->encodeCookie($value), $expire, "/")) {
return true;
} else {
return false;
... | php | public function setCookie($cookieName, $value = null, $expire = null) {
if ($expire !== null) {
$expire = time() + (60 * 60 * $expire);
}
if (setcookie($cookieName, $this->encodeCookie($value), $expire, "/")) {
return true;
} else {
return false;
... | [
"public",
"function",
"setCookie",
"(",
"$",
"cookieName",
",",
"$",
"value",
"=",
"null",
",",
"$",
"expire",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"expire",
"!==",
"null",
")",
"{",
"$",
"expire",
"=",
"time",
"(",
")",
"+",
"(",
"60",
"*",
... | Sets a cookie in the user's browser
@param string $cookieName
@param string|null $value The value to store in the cookie
@param int|null $expire how many HOURS the cookie will be valid (set to 0 for session time)
@return bool | [
"Sets",
"a",
"cookie",
"in",
"the",
"user",
"s",
"browser"
] | ec3b087d4d4732816f61ac487f0cb25511e0da88 | https://github.com/stonedz/pff2/blob/ec3b087d4d4732816f61ac487f0cb25511e0da88/src/modules/cookies/Cookies.php#L41-L51 |
203,677 | stonedz/pff2 | src/modules/cookies/Cookies.php | Cookies.getCookie | public function getCookie($cookieName) {
if (isset($_COOKIE[$cookieName])) {
return $this->decodeCookie($_COOKIE[$cookieName]);
} else {
return false;
}
} | php | public function getCookie($cookieName) {
if (isset($_COOKIE[$cookieName])) {
return $this->decodeCookie($_COOKIE[$cookieName]);
} else {
return false;
}
} | [
"public",
"function",
"getCookie",
"(",
"$",
"cookieName",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"_COOKIE",
"[",
"$",
"cookieName",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"decodeCookie",
"(",
"$",
"_COOKIE",
"[",
"$",
"cookieName",
"]",
"... | Check if a cookie is set and returns its content
@param string $cookieName
@return bool
@retrurn string | [
"Check",
"if",
"a",
"cookie",
"is",
"set",
"and",
"returns",
"its",
"content"
] | ec3b087d4d4732816f61ac487f0cb25511e0da88 | https://github.com/stonedz/pff2/blob/ec3b087d4d4732816f61ac487f0cb25511e0da88/src/modules/cookies/Cookies.php#L76-L82 |
203,678 | mpaleo/view-tags | src/ViewTags/TagsContainer.php | TagsContainer.taggedWith | public function taggedWith($tag)
{
$results = [];
if (isset($this->tags[$tag]))
{
foreach ($this->tags[$tag] as $view)
{
$results[] = $view;
}
}
return $results;
} | php | public function taggedWith($tag)
{
$results = [];
if (isset($this->tags[$tag]))
{
foreach ($this->tags[$tag] as $view)
{
$results[] = $view;
}
}
return $results;
} | [
"public",
"function",
"taggedWith",
"(",
"$",
"tag",
")",
"{",
"$",
"results",
"=",
"[",
"]",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"tags",
"[",
"$",
"tag",
"]",
")",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"tags",
"[",
"$",
"... | Return all the views for a given tag.
@param $tag
@return array | [
"Return",
"all",
"the",
"views",
"for",
"a",
"given",
"tag",
"."
] | 7ca3308b616738e744a0435f581bbd705e59cad6 | https://github.com/mpaleo/view-tags/blob/7ca3308b616738e744a0435f581bbd705e59cad6/src/ViewTags/TagsContainer.php#L41-L55 |
203,679 | newup/core | src/Templates/Renderers/TemplateRenderer.php | TemplateRenderer.registerFilters | private function registerFilters()
{
$filters = config('app.render_filters', []);
foreach ($filters as $filter) {
$filter = app($filter);
if ($filter instanceof FilterContract) {
$this->twigEnvironment->addFilter(new \Twig_SimpleFilter($filter->getName(), $f... | php | private function registerFilters()
{
$filters = config('app.render_filters', []);
foreach ($filters as $filter) {
$filter = app($filter);
if ($filter instanceof FilterContract) {
$this->twigEnvironment->addFilter(new \Twig_SimpleFilter($filter->getName(), $f... | [
"private",
"function",
"registerFilters",
"(",
")",
"{",
"$",
"filters",
"=",
"config",
"(",
"'app.render_filters'",
",",
"[",
"]",
")",
";",
"foreach",
"(",
"$",
"filters",
"as",
"$",
"filter",
")",
"{",
"$",
"filter",
"=",
"app",
"(",
"$",
"filter",
... | Registers the template filters. | [
"Registers",
"the",
"template",
"filters",
"."
] | 54128903e7775e67d63284d958b46862c8df71f9 | https://github.com/newup/core/blob/54128903e7775e67d63284d958b46862c8df71f9/src/Templates/Renderers/TemplateRenderer.php#L112-L125 |
203,680 | newup/core | src/Templates/Renderers/TemplateRenderer.php | TemplateRenderer.addPath | public function addPath($path)
{
try {
$this->twigFileLoader->addPath($path);
} catch (\Twig_Error_Loader $e) {
throw new InvalidPathException($e->getMessage());
}
} | php | public function addPath($path)
{
try {
$this->twigFileLoader->addPath($path);
} catch (\Twig_Error_Loader $e) {
throw new InvalidPathException($e->getMessage());
}
} | [
"public",
"function",
"addPath",
"(",
"$",
"path",
")",
"{",
"try",
"{",
"$",
"this",
"->",
"twigFileLoader",
"->",
"addPath",
"(",
"$",
"path",
")",
";",
"}",
"catch",
"(",
"\\",
"Twig_Error_Loader",
"$",
"e",
")",
"{",
"throw",
"new",
"InvalidPathExc... | Adds a path to the template environment.
@param $path
@throws InvalidPathException | [
"Adds",
"a",
"path",
"to",
"the",
"template",
"environment",
"."
] | 54128903e7775e67d63284d958b46862c8df71f9 | https://github.com/newup/core/blob/54128903e7775e67d63284d958b46862c8df71f9/src/Templates/Renderers/TemplateRenderer.php#L148-L155 |
203,681 | newup/core | src/Templates/Renderers/TemplateRenderer.php | TemplateRenderer.getData | public function getData()
{
$systemInformation = [];
$systemInformation['newup_version'] = Application::VERSION;
return $this->dataArray + $systemInformation + $this->collectData();
} | php | public function getData()
{
$systemInformation = [];
$systemInformation['newup_version'] = Application::VERSION;
return $this->dataArray + $systemInformation + $this->collectData();
} | [
"public",
"function",
"getData",
"(",
")",
"{",
"$",
"systemInformation",
"=",
"[",
"]",
";",
"$",
"systemInformation",
"[",
"'newup_version'",
"]",
"=",
"Application",
"::",
"VERSION",
";",
"return",
"$",
"this",
"->",
"dataArray",
"+",
"$",
"systemInformat... | Gets the environment data.
@return array | [
"Gets",
"the",
"environment",
"data",
"."
] | 54128903e7775e67d63284d958b46862c8df71f9 | https://github.com/newup/core/blob/54128903e7775e67d63284d958b46862c8df71f9/src/Templates/Renderers/TemplateRenderer.php#L203-L209 |
203,682 | newup/core | src/Templates/Renderers/TemplateRenderer.php | TemplateRenderer.render | public function render($templateName)
{
try {
return $this->twigEnvironment->render($templateName, $this->getData());
} catch (SecurityException $e) {
throw new SecurityException($e->getMessage(), $e->getCode(), $e);
} catch (\Twig_Error_Runtime $e) {
thro... | php | public function render($templateName)
{
try {
return $this->twigEnvironment->render($templateName, $this->getData());
} catch (SecurityException $e) {
throw new SecurityException($e->getMessage(), $e->getCode(), $e);
} catch (\Twig_Error_Runtime $e) {
thro... | [
"public",
"function",
"render",
"(",
"$",
"templateName",
")",
"{",
"try",
"{",
"return",
"$",
"this",
"->",
"twigEnvironment",
"->",
"render",
"(",
"$",
"templateName",
",",
"$",
"this",
"->",
"getData",
"(",
")",
")",
";",
"}",
"catch",
"(",
"Securit... | Renders a template by name.
@param $templateName
@return string
@throws InvalidTemplateException
@throws InvalidSyntaxException
@throws RuntimeException
@throws SecurityException | [
"Renders",
"a",
"template",
"by",
"name",
"."
] | 54128903e7775e67d63284d958b46862c8df71f9 | https://github.com/newup/core/blob/54128903e7775e67d63284d958b46862c8df71f9/src/Templates/Renderers/TemplateRenderer.php#L232-L251 |
203,683 | newup/core | src/Templates/Renderers/TemplateRenderer.php | TemplateRenderer.renderString | public function renderString($templateString)
{
try {
return $this->twigStringEnvironment->render($templateString, $this->getData());
} catch (SecurityException $e) {
throw new SecurityException($e->getMessage(), $e->getCode(), $e);
} catch (\Twig_Error_Runtime $e) {
... | php | public function renderString($templateString)
{
try {
return $this->twigStringEnvironment->render($templateString, $this->getData());
} catch (SecurityException $e) {
throw new SecurityException($e->getMessage(), $e->getCode(), $e);
} catch (\Twig_Error_Runtime $e) {
... | [
"public",
"function",
"renderString",
"(",
"$",
"templateString",
")",
"{",
"try",
"{",
"return",
"$",
"this",
"->",
"twigStringEnvironment",
"->",
"render",
"(",
"$",
"templateString",
",",
"$",
"this",
"->",
"getData",
"(",
")",
")",
";",
"}",
"catch",
... | Renders a string as a template.
@param $templateString
@return string
@throws InvalidTemplateException
@throws InvalidSyntaxException
@throws RuntimeException
@throws SecurityException | [
"Renders",
"a",
"string",
"as",
"a",
"template",
"."
] | 54128903e7775e67d63284d958b46862c8df71f9 | https://github.com/newup/core/blob/54128903e7775e67d63284d958b46862c8df71f9/src/Templates/Renderers/TemplateRenderer.php#L263-L282 |
203,684 | newup/core | src/Templates/Renderers/TemplateRenderer.php | TemplateRenderer.collectData | public function collectData()
{
$collectedData = [];
foreach ($this->dataCollectors as $collector) {
$collectedData = $collectedData + $collector->collect();
}
return $collectedData;
} | php | public function collectData()
{
$collectedData = [];
foreach ($this->dataCollectors as $collector) {
$collectedData = $collectedData + $collector->collect();
}
return $collectedData;
} | [
"public",
"function",
"collectData",
"(",
")",
"{",
"$",
"collectedData",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"dataCollectors",
"as",
"$",
"collector",
")",
"{",
"$",
"collectedData",
"=",
"$",
"collectedData",
"+",
"$",
"collector",
"... | Collects all data from data collectors.
@return array | [
"Collects",
"all",
"data",
"from",
"data",
"collectors",
"."
] | 54128903e7775e67d63284d958b46862c8df71f9 | https://github.com/newup/core/blob/54128903e7775e67d63284d958b46862c8df71f9/src/Templates/Renderers/TemplateRenderer.php#L309-L318 |
203,685 | tarsana/syntax | src/NumberSyntax.php | NumberSyntax.instance | public static function instance() : NumberSyntax
{
if (self::$instance === null)
self::$instance = new NumberSyntax;
return self::$instance;
} | php | public static function instance() : NumberSyntax
{
if (self::$instance === null)
self::$instance = new NumberSyntax;
return self::$instance;
} | [
"public",
"static",
"function",
"instance",
"(",
")",
":",
"NumberSyntax",
"{",
"if",
"(",
"self",
"::",
"$",
"instance",
"===",
"null",
")",
"self",
"::",
"$",
"instance",
"=",
"new",
"NumberSyntax",
";",
"return",
"self",
"::",
"$",
"instance",
";",
... | Returns the NumberSyntax instance.
@return Tarsana\Syntax\NumberSyntax | [
"Returns",
"the",
"NumberSyntax",
"instance",
"."
] | fd3f8a25e3be0e391c8fd486ccfcffe913ade534 | https://github.com/tarsana/syntax/blob/fd3f8a25e3be0e391c8fd486ccfcffe913ade534/src/NumberSyntax.php#L20-L25 |
203,686 | Etenil/assegai | src/assegai/modules/mail/services/ses/sdk.class.php | CFRuntime.set_hostname | public function set_hostname($hostname, $port_number = null)
{
if ($this->override_hostname)
{
$this->hostname = $hostname;
if ($port_number)
{
$this->port_number = $port_number;
$this->hostname .= ':' . (string) $this->port_number;
}
}
return $this;
} | php | public function set_hostname($hostname, $port_number = null)
{
if ($this->override_hostname)
{
$this->hostname = $hostname;
if ($port_number)
{
$this->port_number = $port_number;
$this->hostname .= ':' . (string) $this->port_number;
}
}
return $this;
} | [
"public",
"function",
"set_hostname",
"(",
"$",
"hostname",
",",
"$",
"port_number",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"override_hostname",
")",
"{",
"$",
"this",
"->",
"hostname",
"=",
"$",
"hostname",
";",
"if",
"(",
"$",
"port_num... | Set the hostname to connect to. This is useful for alternate services that are API-compatible with
AWS, but run from a different hostname.
@param string $hostname (Required) The alternate hostname to use in place of the default one. Useful for mock or test applications living on different hostnames.
@param integer $po... | [
"Set",
"the",
"hostname",
"to",
"connect",
"to",
".",
"This",
"is",
"useful",
"for",
"alternate",
"services",
"that",
"are",
"API",
"-",
"compatible",
"with",
"AWS",
"but",
"run",
"from",
"a",
"different",
"hostname",
"."
] | d43cce1a88f1c332f60dd0a4374b17764852af9e | https://github.com/Etenil/assegai/blob/d43cce1a88f1c332f60dd0a4374b17764852af9e/src/assegai/modules/mail/services/ses/sdk.class.php#L478-L492 |
203,687 | Etenil/assegai | src/assegai/modules/mail/services/ses/sdk.class.php | CFRuntime.set_cache_config | public function set_cache_config($location, $gzip = true)
{
// If we have an array, we're probably passing in Memcached servers and ports.
if (is_array($location))
{
$this->cache_class = 'CacheMC';
}
else
{
// I would expect locations like `/tmp/cache`, `pdo.mysql://user:pass@hostname:port`, `pdo.sql... | php | public function set_cache_config($location, $gzip = true)
{
// If we have an array, we're probably passing in Memcached servers and ports.
if (is_array($location))
{
$this->cache_class = 'CacheMC';
}
else
{
// I would expect locations like `/tmp/cache`, `pdo.mysql://user:pass@hostname:port`, `pdo.sql... | [
"public",
"function",
"set_cache_config",
"(",
"$",
"location",
",",
"$",
"gzip",
"=",
"true",
")",
"{",
"// If we have an array, we're probably passing in Memcached servers and ports.",
"if",
"(",
"is_array",
"(",
"$",
"location",
")",
")",
"{",
"$",
"this",
"->",
... | Set the caching configuration to use for response caching.
@param string $location (Required) <p>The location to store the cache object in. This may vary by cache method.</p><ul><li>File - The local file system paths such as <code>./cache</code> (relative) or <code>/tmp/cache/</code> (absolute). The location must be s... | [
"Set",
"the",
"caching",
"configuration",
"to",
"use",
"for",
"response",
"caching",
"."
] | d43cce1a88f1c332f60dd0a4374b17764852af9e | https://github.com/Etenil/assegai/blob/d43cce1a88f1c332f60dd0a4374b17764852af9e/src/assegai/modules/mail/services/ses/sdk.class.php#L562-L599 |
203,688 | Etenil/assegai | src/assegai/modules/mail/services/ses/sdk.class.php | CFRuntime.batch | public function batch(CFBatchRequest &$queue = null)
{
if ($queue)
{
$this->batch_object = $queue;
}
elseif ($this->internal_batch_object)
{
$this->batch_object = &$this->internal_batch_object;
}
else
{
$this->internal_batch_object = new $this->batch_class();
$this->batch_object = &$this->i... | php | public function batch(CFBatchRequest &$queue = null)
{
if ($queue)
{
$this->batch_object = $queue;
}
elseif ($this->internal_batch_object)
{
$this->batch_object = &$this->internal_batch_object;
}
else
{
$this->internal_batch_object = new $this->batch_class();
$this->batch_object = &$this->i... | [
"public",
"function",
"batch",
"(",
"CFBatchRequest",
"&",
"$",
"queue",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"queue",
")",
"{",
"$",
"this",
"->",
"batch_object",
"=",
"$",
"queue",
";",
"}",
"elseif",
"(",
"$",
"this",
"->",
"internal_batch_object"... | Specifies that the intended request should be queued for a later batch request.
@param CFBatchRequest $queue (Optional) The <CFBatchRequest> instance to use for managing batch requests. If not available, it generates a new instance of <CFBatchRequest>.
@return $this A reference to the current instance. | [
"Specifies",
"that",
"the",
"intended",
"request",
"should",
"be",
"queued",
"for",
"a",
"later",
"batch",
"request",
"."
] | d43cce1a88f1c332f60dd0a4374b17764852af9e | https://github.com/Etenil/assegai/blob/d43cce1a88f1c332f60dd0a4374b17764852af9e/src/assegai/modules/mail/services/ses/sdk.class.php#L1083-L1102 |
203,689 | Etenil/assegai | src/assegai/modules/mail/services/ses/sdk.class.php | CFRuntime.send | public function send($clear_after_send = true)
{
if ($this->use_batch_flow)
{
// When we send the request, disable batch flow.
$this->use_batch_flow = false;
// If we're not caching, simply send the request.
if (!$this->use_cache_flow)
{
$response = $this->batch_object->send();
$parsed_data... | php | public function send($clear_after_send = true)
{
if ($this->use_batch_flow)
{
// When we send the request, disable batch flow.
$this->use_batch_flow = false;
// If we're not caching, simply send the request.
if (!$this->use_cache_flow)
{
$response = $this->batch_object->send();
$parsed_data... | [
"public",
"function",
"send",
"(",
"$",
"clear_after_send",
"=",
"true",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"use_batch_flow",
")",
"{",
"// When we send the request, disable batch flow.",
"$",
"this",
"->",
"use_batch_flow",
"=",
"false",
";",
"// If we're no... | Executes the batch request queue by sending all queued requests.
@param boolean $clear_after_send (Optional) Whether or not to clear the batch queue after sending a request. Defaults to `true`. Set this to `false` if you are caching batch responses and want to retrieve results later.
@return array An array of <CFRespo... | [
"Executes",
"the",
"batch",
"request",
"queue",
"by",
"sending",
"all",
"queued",
"requests",
"."
] | d43cce1a88f1c332f60dd0a4374b17764852af9e | https://github.com/Etenil/assegai/blob/d43cce1a88f1c332f60dd0a4374b17764852af9e/src/assegai/modules/mail/services/ses/sdk.class.php#L1110-L1166 |
203,690 | Etenil/assegai | src/assegai/modules/mail/services/ses/sdk.class.php | CFRuntime.parse_callback | public function parse_callback($response, $headers = null)
{
// Shorten this so we have a (mostly) single code path
if (isset($response->body))
{
if (is_string($response->body))
{
$body = $response->body;
}
else
{
return $response;
}
}
elseif (is_string($response))
{
$body = $r... | php | public function parse_callback($response, $headers = null)
{
// Shorten this so we have a (mostly) single code path
if (isset($response->body))
{
if (is_string($response->body))
{
$body = $response->body;
}
else
{
return $response;
}
}
elseif (is_string($response))
{
$body = $r... | [
"public",
"function",
"parse_callback",
"(",
"$",
"response",
",",
"$",
"headers",
"=",
"null",
")",
"{",
"// Shorten this so we have a (mostly) single code path",
"if",
"(",
"isset",
"(",
"$",
"response",
"->",
"body",
")",
")",
"{",
"if",
"(",
"is_string",
"... | Parses a response body into a PHP object if appropriate.
@param CFResponse|string $response (Required) The <CFResponse> object to parse, or an XML string that would otherwise be a response body.
@param string $content_type (Optional) The content-type to use when determining how to parse the content.
@return CFResponse... | [
"Parses",
"a",
"response",
"body",
"into",
"a",
"PHP",
"object",
"if",
"appropriate",
"."
] | d43cce1a88f1c332f60dd0a4374b17764852af9e | https://github.com/Etenil/assegai/blob/d43cce1a88f1c332f60dd0a4374b17764852af9e/src/assegai/modules/mail/services/ses/sdk.class.php#L1175-L1284 |
203,691 | Etenil/assegai | src/assegai/modules/mail/services/ses/sdk.class.php | CFLoader.autoloader | public static function autoloader($class)
{
$path = dirname(__FILE__) . DIRECTORY_SEPARATOR;
// Amazon SDK classes
if (strstr($class, 'Amazon'))
{
$path .= 'services' . DIRECTORY_SEPARATOR . str_ireplace('Amazon', '', strtolower($class)) . '.class.php';
}
// Utility classes
elseif (strstr($class, 'C... | php | public static function autoloader($class)
{
$path = dirname(__FILE__) . DIRECTORY_SEPARATOR;
// Amazon SDK classes
if (strstr($class, 'Amazon'))
{
$path .= 'services' . DIRECTORY_SEPARATOR . str_ireplace('Amazon', '', strtolower($class)) . '.class.php';
}
// Utility classes
elseif (strstr($class, 'C... | [
"public",
"static",
"function",
"autoloader",
"(",
"$",
"class",
")",
"{",
"$",
"path",
"=",
"dirname",
"(",
"__FILE__",
")",
".",
"DIRECTORY_SEPARATOR",
";",
"// Amazon SDK classes",
"if",
"(",
"strstr",
"(",
"$",
"class",
",",
"'Amazon'",
")",
")",
"{",
... | Automatically load classes that aren't included.
@param string $class (Required) The classname to load.
@return void | [
"Automatically",
"load",
"classes",
"that",
"aren",
"t",
"included",
"."
] | d43cce1a88f1c332f60dd0a4374b17764852af9e | https://github.com/Etenil/assegai/blob/d43cce1a88f1c332f60dd0a4374b17764852af9e/src/assegai/modules/mail/services/ses/sdk.class.php#L1391-L1440 |
203,692 | IftekherSunny/Planet-Framework | src/Sun/Http/Response.php | Response.html | public function html($data)
{
if(is_array($data)) {
echo $this->json($data);
} else {
echo $data;
}
if($this->app->config('session.enable')) {
$this->session->create('previous_uri', $_SERVER['REQUEST_URI']);
$this->session->c... | php | public function html($data)
{
if(is_array($data)) {
echo $this->json($data);
} else {
echo $data;
}
if($this->app->config('session.enable')) {
$this->session->create('previous_uri', $_SERVER['REQUEST_URI']);
$this->session->c... | [
"public",
"function",
"html",
"(",
"$",
"data",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"data",
")",
")",
"{",
"echo",
"$",
"this",
"->",
"json",
"(",
"$",
"data",
")",
";",
"}",
"else",
"{",
"echo",
"$",
"data",
";",
"}",
"if",
"(",
"$",
... | To response with html
@param string $data | [
"To",
"response",
"with",
"html"
] | 530e772fb97695c1c4e1af73f81675f189474d9f | https://github.com/IftekherSunny/Planet-Framework/blob/530e772fb97695c1c4e1af73f81675f189474d9f/src/Sun/Http/Response.php#L39-L51 |
203,693 | IftekherSunny/Planet-Framework | src/Sun/Http/Response.php | Response.json | public function json($data, $status = 200)
{
$this->header('Content-Type: application/json');
$this->statusCode($status);
return json_encode($data);
} | php | public function json($data, $status = 200)
{
$this->header('Content-Type: application/json');
$this->statusCode($status);
return json_encode($data);
} | [
"public",
"function",
"json",
"(",
"$",
"data",
",",
"$",
"status",
"=",
"200",
")",
"{",
"$",
"this",
"->",
"header",
"(",
"'Content-Type: application/json'",
")",
";",
"$",
"this",
"->",
"statusCode",
"(",
"$",
"status",
")",
";",
"return",
"json_encod... | To response with json
@param string $data
@param int $status
@return string | [
"To",
"response",
"with",
"json"
] | 530e772fb97695c1c4e1af73f81675f189474d9f | https://github.com/IftekherSunny/Planet-Framework/blob/530e772fb97695c1c4e1af73f81675f189474d9f/src/Sun/Http/Response.php#L61-L68 |
203,694 | IftekherSunny/Planet-Framework | src/Sun/Http/Response.php | Response.download | public function download($path, $removeDownloadedFile = false)
{
if(!file_exists($path)) {
throw new Exception("File [ $path ] not found.");
}
$filename = pathinfo($path, PATHINFO_BASENAME );
header("Content-Description: File Transfer");
header("Content... | php | public function download($path, $removeDownloadedFile = false)
{
if(!file_exists($path)) {
throw new Exception("File [ $path ] not found.");
}
$filename = pathinfo($path, PATHINFO_BASENAME );
header("Content-Description: File Transfer");
header("Content... | [
"public",
"function",
"download",
"(",
"$",
"path",
",",
"$",
"removeDownloadedFile",
"=",
"false",
")",
"{",
"if",
"(",
"!",
"file_exists",
"(",
"$",
"path",
")",
")",
"{",
"throw",
"new",
"Exception",
"(",
"\"File [ $path ] not found.\"",
")",
";",
"}",
... | Http Response to download file
@param string $path
@param bool $removeDownloadedFile
@throws Exception | [
"Http",
"Response",
"to",
"download",
"file"
] | 530e772fb97695c1c4e1af73f81675f189474d9f | https://github.com/IftekherSunny/Planet-Framework/blob/530e772fb97695c1c4e1af73f81675f189474d9f/src/Sun/Http/Response.php#L78-L95 |
203,695 | acacha/forge-publish | src/Console/Commands/PublishDeploymentScript.php | PublishDeploymentScript.updateDeploymentScript | protected function updateDeploymentScript()
{
$this->info('Updating deployment script for site ' . $this->site . '...');
$this->url = $this->obtainAPIURLEndpoint('update_deployment_script_uri');
if (! File::exists($this->file)) {
$this->error("File " . $this->file . " doesn't e... | php | protected function updateDeploymentScript()
{
$this->info('Updating deployment script for site ' . $this->site . '...');
$this->url = $this->obtainAPIURLEndpoint('update_deployment_script_uri');
if (! File::exists($this->file)) {
$this->error("File " . $this->file . " doesn't e... | [
"protected",
"function",
"updateDeploymentScript",
"(",
")",
"{",
"$",
"this",
"->",
"info",
"(",
"'Updating deployment script for site '",
".",
"$",
"this",
"->",
"site",
".",
"'...'",
")",
";",
"$",
"this",
"->",
"url",
"=",
"$",
"this",
"->",
"obtainAPIUR... | Update deployment script. | [
"Update",
"deployment",
"script",
"."
] | 010779e3d2297c763b82dc3fbde992edffb3a6c6 | https://github.com/acacha/forge-publish/blob/010779e3d2297c763b82dc3fbde992edffb3a6c6/src/Console/Commands/PublishDeploymentScript.php#L109-L130 |
203,696 | acacha/forge-publish | src/Console/Commands/PublishDeploymentScript.php | PublishDeploymentScript.obtainAPIURLEndpoint | protected function obtainAPIURLEndpoint($type)
{
$uri = str_replace('{forgeserver}', $this->server, config('forge-publish.' . $type));
$uri = str_replace('{forgesite}', $this->site, $uri);
return config('forge-publish.url') . $uri;
} | php | protected function obtainAPIURLEndpoint($type)
{
$uri = str_replace('{forgeserver}', $this->server, config('forge-publish.' . $type));
$uri = str_replace('{forgesite}', $this->site, $uri);
return config('forge-publish.url') . $uri;
} | [
"protected",
"function",
"obtainAPIURLEndpoint",
"(",
"$",
"type",
")",
"{",
"$",
"uri",
"=",
"str_replace",
"(",
"'{forgeserver}'",
",",
"$",
"this",
"->",
"server",
",",
"config",
"(",
"'forge-publish.'",
".",
"$",
"type",
")",
")",
";",
"$",
"uri",
"=... | Obtain API URL endpoint.
@return string | [
"Obtain",
"API",
"URL",
"endpoint",
"."
] | 010779e3d2297c763b82dc3fbde992edffb3a6c6 | https://github.com/acacha/forge-publish/blob/010779e3d2297c763b82dc3fbde992edffb3a6c6/src/Console/Commands/PublishDeploymentScript.php#L137-L142 |
203,697 | makinacorpus/drupal-calista | src/EventDispatcher/ViewEventSubscriber.php | ViewEventSubscriber.onTwigView | public function onTwigView(ViewEvent $event)
{
$view = $event->getView();
if (function_exists('drupal_add_library') && $view instanceof TwigView) {
drupal_add_library('calista', 'calista_page');
/*
if ($event->getView()->visualSearchIsEnabled()) {
... | php | public function onTwigView(ViewEvent $event)
{
$view = $event->getView();
if (function_exists('drupal_add_library') && $view instanceof TwigView) {
drupal_add_library('calista', 'calista_page');
/*
if ($event->getView()->visualSearchIsEnabled()) {
... | [
"public",
"function",
"onTwigView",
"(",
"ViewEvent",
"$",
"event",
")",
"{",
"$",
"view",
"=",
"$",
"event",
"->",
"getView",
"(",
")",
";",
"if",
"(",
"function_exists",
"(",
"'drupal_add_library'",
")",
"&&",
"$",
"view",
"instanceof",
"TwigView",
")",
... | Add JS libraries
@param ViewEvent $event | [
"Add",
"JS",
"libraries"
] | cceb6b975fc3e80f0f83c803fc6f6a9ac5852b53 | https://github.com/makinacorpus/drupal-calista/blob/cceb6b975fc3e80f0f83c803fc6f6a9ac5852b53/src/EventDispatcher/ViewEventSubscriber.php#L31-L43 |
203,698 | infusephp/auth | src/Jobs/GarbageCollection.php | GarbageCollection.run | public function run()
{
$res1 = $this->gcPersistent();
$res2 = $this->gcUserLinks();
$res3 = $this->gcActive();
return $res1 && $res2 && $res3;
} | php | public function run()
{
$res1 = $this->gcPersistent();
$res2 = $this->gcUserLinks();
$res3 = $this->gcActive();
return $res1 && $res2 && $res3;
} | [
"public",
"function",
"run",
"(",
")",
"{",
"$",
"res1",
"=",
"$",
"this",
"->",
"gcPersistent",
"(",
")",
";",
"$",
"res2",
"=",
"$",
"this",
"->",
"gcUserLinks",
"(",
")",
";",
"$",
"res3",
"=",
"$",
"this",
"->",
"gcActive",
"(",
")",
";",
"... | Runs the auth garbage collection.
@return array | [
"Runs",
"the",
"auth",
"garbage",
"collection",
"."
] | 720280b4b2635572f331afe8d082e3e88cf54eb7 | https://github.com/infusephp/auth/blob/720280b4b2635572f331afe8d082e3e88cf54eb7/src/Jobs/GarbageCollection.php#L33-L40 |
203,699 | infusephp/auth | src/Jobs/GarbageCollection.php | GarbageCollection.gcPersistent | private function gcPersistent()
{
return (bool) $this->app['database']->getDefault()
->delete('PersistentSessions')
->where('created_at', U::unixToDb(time() - PersistentSession::$sessionLength), '<')
->execute();
} | php | private function gcPersistent()
{
return (bool) $this->app['database']->getDefault()
->delete('PersistentSessions')
->where('created_at', U::unixToDb(time() - PersistentSession::$sessionLength), '<')
->execute();
} | [
"private",
"function",
"gcPersistent",
"(",
")",
"{",
"return",
"(",
"bool",
")",
"$",
"this",
"->",
"app",
"[",
"'database'",
"]",
"->",
"getDefault",
"(",
")",
"->",
"delete",
"(",
"'PersistentSessions'",
")",
"->",
"where",
"(",
"'created_at'",
",",
"... | Clears out expired persistent sessions.
@return bool | [
"Clears",
"out",
"expired",
"persistent",
"sessions",
"."
] | 720280b4b2635572f331afe8d082e3e88cf54eb7 | https://github.com/infusephp/auth/blob/720280b4b2635572f331afe8d082e3e88cf54eb7/src/Jobs/GarbageCollection.php#L60-L66 |
Subsets and Splits
Yii Code Samples
Gathers all records from test, train, and validation sets that contain the word 'yii', providing a basic filtered view of the dataset relevant to Yii-related content.