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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
32,500 | firebrandhq/silverstripe-hail | src/Models/Image.php | Image.getRelativeCenterY | public function getRelativeCenterY()
{
$pos = 50;
if ($this->FaceCentreY > 0 && $this->OriginalHeight > 0) {
$pos = $this->FaceCentreY / $this->OriginalHeight * 100;
$pos = ($pos > 100 || $pos < 0) ? 50 : $pos;
}
return $pos;
} | php | public function getRelativeCenterY()
{
$pos = 50;
if ($this->FaceCentreY > 0 && $this->OriginalHeight > 0) {
$pos = $this->FaceCentreY / $this->OriginalHeight * 100;
$pos = ($pos > 100 || $pos < 0) ? 50 : $pos;
}
return $pos;
} | [
"public",
"function",
"getRelativeCenterY",
"(",
")",
"{",
"$",
"pos",
"=",
"50",
";",
"if",
"(",
"$",
"this",
"->",
"FaceCentreY",
">",
"0",
"&&",
"$",
"this",
"->",
"OriginalHeight",
">",
"0",
")",
"{",
"$",
"pos",
"=",
"$",
"this",
"->",
"FaceCe... | Get the Y axis for the relative center of this image
@return int | [
"Get",
"the",
"Y",
"axis",
"for",
"the",
"relative",
"center",
"of",
"this",
"image"
] | fd655b7a568f8d5f6a8f888f39368618596f794e | https://github.com/firebrandhq/silverstripe-hail/blob/fd655b7a568f8d5f6a8f888f39368618596f794e/src/Models/Image.php#L209-L218 |
32,501 | oasmobile/php-http | src/ServiceProviders/Security/AbstractSimplePreAuthenticator.php | AbstractSimplePreAuthenticator.createAuthenticatedToken | protected function createAuthenticatedToken($user, $credentials, $providerKey)
{
return new PreAuthenticatedToken($user, $credentials, $providerKey, $user->getRoles());
} | php | protected function createAuthenticatedToken($user, $credentials, $providerKey)
{
return new PreAuthenticatedToken($user, $credentials, $providerKey, $user->getRoles());
} | [
"protected",
"function",
"createAuthenticatedToken",
"(",
"$",
"user",
",",
"$",
"credentials",
",",
"$",
"providerKey",
")",
"{",
"return",
"new",
"PreAuthenticatedToken",
"(",
"$",
"user",
",",
"$",
"credentials",
",",
"$",
"providerKey",
",",
"$",
"user",
... | Creates an authenticated token upon authentication success.
Inherited class can override this method to provide their own pre-authenticated token implementation
@param string|UserInterface $user The user
@param mixed $credentials The user credentials
@param string $providerKey The ... | [
"Creates",
"an",
"authenticated",
"token",
"upon",
"authentication",
"success",
"."
] | a7570893742286c30222c393891aeb6857064f37 | https://github.com/oasmobile/php-http/blob/a7570893742286c30222c393891aeb6857064f37/src/ServiceProviders/Security/AbstractSimplePreAuthenticator.php#L79-L82 |
32,502 | arillo/silverstripe-elements | src/VersionedGridFieldItemRequestExtension.php | VersionedGridFieldItemRequestExtension.updateFormActions | public function updateFormActions(FieldList $actions)
{
if (is_a($this->owner->getRecord(), ElementBase::class))
{
$actions->removeByName('action_doUnpublish');
if ($archive = $actions->fieldByName('action_doArchive'))
{
$archive
... | php | public function updateFormActions(FieldList $actions)
{
if (is_a($this->owner->getRecord(), ElementBase::class))
{
$actions->removeByName('action_doUnpublish');
if ($archive = $actions->fieldByName('action_doArchive'))
{
$archive
... | [
"public",
"function",
"updateFormActions",
"(",
"FieldList",
"$",
"actions",
")",
"{",
"if",
"(",
"is_a",
"(",
"$",
"this",
"->",
"owner",
"->",
"getRecord",
"(",
")",
",",
"ElementBase",
"::",
"class",
")",
")",
"{",
"$",
"actions",
"->",
"removeByName"... | Remove unpublish action
@param FieldList $actions
@return FieldList | [
"Remove",
"unpublish",
"action"
] | faa95a6487efe6e28101db5319529aa7e575fa90 | https://github.com/arillo/silverstripe-elements/blob/faa95a6487efe6e28101db5319529aa7e575fa90/src/VersionedGridFieldItemRequestExtension.php#L13-L30 |
32,503 | appaydin/pd-mailer | DependencyInjection/PdMailerExtension.php | PdMailerExtension.load | public function load(array $configs, ContainerBuilder $container)
{
// Load Configuration
$configuration = new Configuration();
$config = $this->processConfiguration($configuration, $configs);
// Set Parameters
$container->setParameter('pd_mailer.logger_active', $config['log... | php | public function load(array $configs, ContainerBuilder $container)
{
// Load Configuration
$configuration = new Configuration();
$config = $this->processConfiguration($configuration, $configs);
// Set Parameters
$container->setParameter('pd_mailer.logger_active', $config['log... | [
"public",
"function",
"load",
"(",
"array",
"$",
"configs",
",",
"ContainerBuilder",
"$",
"container",
")",
"{",
"// Load Configuration",
"$",
"configuration",
"=",
"new",
"Configuration",
"(",
")",
";",
"$",
"config",
"=",
"$",
"this",
"->",
"processConfigura... | Load Bundle Config and Services.
@param array $configs
@param ContainerBuilder $container
@throws \Exception | [
"Load",
"Bundle",
"Config",
"and",
"Services",
"."
] | c701cf6778e9c8991ae4b74dbf5e7d3d77310c0f | https://github.com/appaydin/pd-mailer/blob/c701cf6778e9c8991ae4b74dbf5e7d3d77310c0f/DependencyInjection/PdMailerExtension.php#L37-L68 |
32,504 | gocom/textpattern-installer | src/Textpattern/Composer/Installer/Plugin/Base.php | Base.find | protected function find($directory)
{
if (!file_exists($directory) || !is_dir($directory) || !is_readable($directory)) {
return false;
}
$iterator = new \RecursiveDirectoryIterator(realpath($directory));
return new \RecursiveIteratorIterator($iterator);
} | php | protected function find($directory)
{
if (!file_exists($directory) || !is_dir($directory) || !is_readable($directory)) {
return false;
}
$iterator = new \RecursiveDirectoryIterator(realpath($directory));
return new \RecursiveIteratorIterator($iterator);
} | [
"protected",
"function",
"find",
"(",
"$",
"directory",
")",
"{",
"if",
"(",
"!",
"file_exists",
"(",
"$",
"directory",
")",
"||",
"!",
"is_dir",
"(",
"$",
"directory",
")",
"||",
"!",
"is_readable",
"(",
"$",
"directory",
")",
")",
"{",
"return",
"f... | Lists the package contents.
@param string $directory
@return RecursiveIteratorIterator|bool | [
"Lists",
"the",
"package",
"contents",
"."
] | 804271de54177ebd294a4a19d409ae7fc2317935 | https://github.com/gocom/textpattern-installer/blob/804271de54177ebd294a4a19d409ae7fc2317935/src/Textpattern/Composer/Installer/Plugin/Base.php#L84-L92 |
32,505 | gocom/textpattern-installer | src/Textpattern/Composer/Installer/Plugin/Base.php | Base.package | protected function package()
{
foreach ((array) $this->plugin as $plugin) {
$this->package[] = base64_encode(gzencode(serialize((array) $plugin)));
}
} | php | protected function package()
{
foreach ((array) $this->plugin as $plugin) {
$this->package[] = base64_encode(gzencode(serialize((array) $plugin)));
}
} | [
"protected",
"function",
"package",
"(",
")",
"{",
"foreach",
"(",
"(",
"array",
")",
"$",
"this",
"->",
"plugin",
"as",
"$",
"plugin",
")",
"{",
"$",
"this",
"->",
"package",
"[",
"]",
"=",
"base64_encode",
"(",
"gzencode",
"(",
"serialize",
"(",
"(... | Packages the plugin data. | [
"Packages",
"the",
"plugin",
"data",
"."
] | 804271de54177ebd294a4a19d409ae7fc2317935 | https://github.com/gocom/textpattern-installer/blob/804271de54177ebd294a4a19d409ae7fc2317935/src/Textpattern/Composer/Installer/Plugin/Base.php#L97-L102 |
32,506 | gocom/textpattern-installer | src/Textpattern/Composer/Installer/Plugin/Base.php | Base.update | public function update()
{
foreach ((array) $this->package as $package) {
$_POST['plugin64'] = $package;
ob_start();
plugin_install();
ob_end_clean();
}
} | php | public function update()
{
foreach ((array) $this->package as $package) {
$_POST['plugin64'] = $package;
ob_start();
plugin_install();
ob_end_clean();
}
} | [
"public",
"function",
"update",
"(",
")",
"{",
"foreach",
"(",
"(",
"array",
")",
"$",
"this",
"->",
"package",
"as",
"$",
"package",
")",
"{",
"$",
"_POST",
"[",
"'plugin64'",
"]",
"=",
"$",
"package",
";",
"ob_start",
"(",
")",
";",
"plugin_install... | Updates a plugin. | [
"Updates",
"a",
"plugin",
"."
] | 804271de54177ebd294a4a19d409ae7fc2317935 | https://github.com/gocom/textpattern-installer/blob/804271de54177ebd294a4a19d409ae7fc2317935/src/Textpattern/Composer/Installer/Plugin/Base.php#L119-L127 |
32,507 | gocom/textpattern-installer | src/Textpattern/Composer/Installer/Plugin/Base.php | Base.path | protected function path($path)
{
if (strpos($path, './') === 0) {
return $this->dir . '/' . substr($path, 2);
}
if (strpos($path, '../') === 0) {
return dirname($this->dir) . '/' . substr($path, 3);
}
return $path;
} | php | protected function path($path)
{
if (strpos($path, './') === 0) {
return $this->dir . '/' . substr($path, 2);
}
if (strpos($path, '../') === 0) {
return dirname($this->dir) . '/' . substr($path, 3);
}
return $path;
} | [
"protected",
"function",
"path",
"(",
"$",
"path",
")",
"{",
"if",
"(",
"strpos",
"(",
"$",
"path",
",",
"'./'",
")",
"===",
"0",
")",
"{",
"return",
"$",
"this",
"->",
"dir",
".",
"'/'",
".",
"substr",
"(",
"$",
"path",
",",
"2",
")",
";",
"... | Forms absolute file path.
@param string $path
@return string | [
"Forms",
"absolute",
"file",
"path",
"."
] | 804271de54177ebd294a4a19d409ae7fc2317935 | https://github.com/gocom/textpattern-installer/blob/804271de54177ebd294a4a19d409ae7fc2317935/src/Textpattern/Composer/Installer/Plugin/Base.php#L152-L163 |
32,508 | gocom/textpattern-installer | src/Textpattern/Composer/Installer/Plugin/Base.php | Base.getRelativePath | protected function getRelativePath($from, $to)
{
$from = explode('/', str_replace('\\', '/', $from));
$to = explode('/', str_replace('\\', '/', $to));
foreach ($from as $depth => $dir) {
if (isset($to[$depth]) && $dir === $to[$depth]) {
unset($to[$depth], $from[$... | php | protected function getRelativePath($from, $to)
{
$from = explode('/', str_replace('\\', '/', $from));
$to = explode('/', str_replace('\\', '/', $to));
foreach ($from as $depth => $dir) {
if (isset($to[$depth]) && $dir === $to[$depth]) {
unset($to[$depth], $from[$... | [
"protected",
"function",
"getRelativePath",
"(",
"$",
"from",
",",
"$",
"to",
")",
"{",
"$",
"from",
"=",
"explode",
"(",
"'/'",
",",
"str_replace",
"(",
"'\\\\'",
",",
"'/'",
",",
"$",
"from",
")",
")",
";",
"$",
"to",
"=",
"explode",
"(",
"'/'",
... | Gets a relative path to a file.
@param string $from The path from
@param string $to The path to
@return string | [
"Gets",
"a",
"relative",
"path",
"to",
"a",
"file",
"."
] | 804271de54177ebd294a4a19d409ae7fc2317935 | https://github.com/gocom/textpattern-installer/blob/804271de54177ebd294a4a19d409ae7fc2317935/src/Textpattern/Composer/Installer/Plugin/Base.php#L172-L188 |
32,509 | appaydin/pd-mailer | Controller/MailController.php | MailController.list | public function list(Request $request, PaginatorInterface $paginator)
{
// Get Query
$query = $this->getDoctrine()
->getRepository($this->getParameter('pd_mailer.mail_template_class'))
->createQueryBuilder('m');
// Get Result
$pagination = $paginator->paginat... | php | public function list(Request $request, PaginatorInterface $paginator)
{
// Get Query
$query = $this->getDoctrine()
->getRepository($this->getParameter('pd_mailer.mail_template_class'))
->createQueryBuilder('m');
// Get Result
$pagination = $paginator->paginat... | [
"public",
"function",
"list",
"(",
"Request",
"$",
"request",
",",
"PaginatorInterface",
"$",
"paginator",
")",
"{",
"// Get Query",
"$",
"query",
"=",
"$",
"this",
"->",
"getDoctrine",
"(",
")",
"->",
"getRepository",
"(",
"$",
"this",
"->",
"getParameter",... | List Mail Templates.
@param Request $request
@IsGranted("ROLE_MAIL_TEMPLATELIST")
@return \Symfony\Component\HttpFoundation\Response | [
"List",
"Mail",
"Templates",
"."
] | c701cf6778e9c8991ae4b74dbf5e7d3d77310c0f | https://github.com/appaydin/pd-mailer/blob/c701cf6778e9c8991ae4b74dbf5e7d3d77310c0f/Controller/MailController.php#L42-L64 |
32,510 | appaydin/pd-mailer | Controller/MailController.php | MailController.addTemplate | public function addTemplate(Request $request, ParameterBagInterface $bag, $id = null)
{
// Find Template
$mailLog = $this
->getDoctrine()
->getRepository($this->getParameter('pd_mailer.mail_log_class'))
->findOneBy(['id' => $id]);
// Create New Mail Log
... | php | public function addTemplate(Request $request, ParameterBagInterface $bag, $id = null)
{
// Find Template
$mailLog = $this
->getDoctrine()
->getRepository($this->getParameter('pd_mailer.mail_log_class'))
->findOneBy(['id' => $id]);
// Create New Mail Log
... | [
"public",
"function",
"addTemplate",
"(",
"Request",
"$",
"request",
",",
"ParameterBagInterface",
"$",
"bag",
",",
"$",
"id",
"=",
"null",
")",
"{",
"// Find Template",
"$",
"mailLog",
"=",
"$",
"this",
"->",
"getDoctrine",
"(",
")",
"->",
"getRepository",
... | Add Templates.
@param Request $request
@param MailLog $mailLog
@IsGranted("ROLE_MAIL_TEMPLATEADD")
@return \Symfony\Component\HttpFoundation\Response | [
"Add",
"Templates",
"."
] | c701cf6778e9c8991ae4b74dbf5e7d3d77310c0f | https://github.com/appaydin/pd-mailer/blob/c701cf6778e9c8991ae4b74dbf5e7d3d77310c0f/Controller/MailController.php#L76-L127 |
32,511 | appaydin/pd-mailer | Controller/MailController.php | MailController.editTemplate | public function editTemplate(Request $request, ParameterBagInterface $bag, $id)
{
// Find Template
$mailTemplate = $this
->getDoctrine()
->getRepository($this->getParameter('pd_mailer.mail_template_class'))
->findOneBy(['id' => $id]);
if (!$mailTemplate) t... | php | public function editTemplate(Request $request, ParameterBagInterface $bag, $id)
{
// Find Template
$mailTemplate = $this
->getDoctrine()
->getRepository($this->getParameter('pd_mailer.mail_template_class'))
->findOneBy(['id' => $id]);
if (!$mailTemplate) t... | [
"public",
"function",
"editTemplate",
"(",
"Request",
"$",
"request",
",",
"ParameterBagInterface",
"$",
"bag",
",",
"$",
"id",
")",
"{",
"// Find Template",
"$",
"mailTemplate",
"=",
"$",
"this",
"->",
"getDoctrine",
"(",
")",
"->",
"getRepository",
"(",
"$... | Edit Templates.
@param Request $request
@param MailTemplate $mailTemplate
@IsGranted("ROLE_MAIL_TEMPLATEEDIT")
@return \Symfony\Component\HttpFoundation\Response | [
"Edit",
"Templates",
"."
] | c701cf6778e9c8991ae4b74dbf5e7d3d77310c0f | https://github.com/appaydin/pd-mailer/blob/c701cf6778e9c8991ae4b74dbf5e7d3d77310c0f/Controller/MailController.php#L139-L173 |
32,512 | appaydin/pd-mailer | Controller/MailController.php | MailController.deleteTemplate | public function deleteTemplate(Request $request, $id)
{
// Find Template
$mailTemplate = $this
->getDoctrine()
->getRepository($this->getParameter('pd_mailer.mail_template_class'))
->findOneBy(['id' => $id]);
// Not Found
if (null === $mailTemplat... | php | public function deleteTemplate(Request $request, $id)
{
// Find Template
$mailTemplate = $this
->getDoctrine()
->getRepository($this->getParameter('pd_mailer.mail_template_class'))
->findOneBy(['id' => $id]);
// Not Found
if (null === $mailTemplat... | [
"public",
"function",
"deleteTemplate",
"(",
"Request",
"$",
"request",
",",
"$",
"id",
")",
"{",
"// Find Template",
"$",
"mailTemplate",
"=",
"$",
"this",
"->",
"getDoctrine",
"(",
")",
"->",
"getRepository",
"(",
"$",
"this",
"->",
"getParameter",
"(",
... | Delete Templates.
@param Request $request
@param MailTemplate $mailTemplate
@IsGranted("ROLE_MAIL_TEMPLATEDELETE")
@return \Symfony\Component\HttpFoundation\Response | [
"Delete",
"Templates",
"."
] | c701cf6778e9c8991ae4b74dbf5e7d3d77310c0f | https://github.com/appaydin/pd-mailer/blob/c701cf6778e9c8991ae4b74dbf5e7d3d77310c0f/Controller/MailController.php#L185-L207 |
32,513 | appaydin/pd-mailer | Controller/MailController.php | MailController.logger | public function logger(Request $request, PaginatorInterface $paginator)
{
// Get Logs
$query = $this->getDoctrine()
->getRepository($this->getParameter('pd_mailer.mail_log_class'))
->createQueryBuilder('m')
->orderBy('m.id', 'DESC')
->getQuery();
... | php | public function logger(Request $request, PaginatorInterface $paginator)
{
// Get Logs
$query = $this->getDoctrine()
->getRepository($this->getParameter('pd_mailer.mail_log_class'))
->createQueryBuilder('m')
->orderBy('m.id', 'DESC')
->getQuery();
... | [
"public",
"function",
"logger",
"(",
"Request",
"$",
"request",
",",
"PaginatorInterface",
"$",
"paginator",
")",
"{",
"// Get Logs",
"$",
"query",
"=",
"$",
"this",
"->",
"getDoctrine",
"(",
")",
"->",
"getRepository",
"(",
"$",
"this",
"->",
"getParameter"... | View Mail Logs.
@param Request $request
@IsGranted("ROLE_MAIL_LOGGER")
@return \Symfony\Component\HttpFoundation\Response | [
"View",
"Mail",
"Logs",
"."
] | c701cf6778e9c8991ae4b74dbf5e7d3d77310c0f | https://github.com/appaydin/pd-mailer/blob/c701cf6778e9c8991ae4b74dbf5e7d3d77310c0f/Controller/MailController.php#L252-L273 |
32,514 | appaydin/pd-mailer | Controller/MailController.php | MailController.viewLog | public function viewLog(TranslatorInterface $translator, $id)
{
// Find Template
$log = $this
->getDoctrine()
->getRepository($this->getParameter('pd_mailer.mail_log_class'))
->findOneBy(['id' => $id]);
if (!$log) throw $this->createNotFoundException();
... | php | public function viewLog(TranslatorInterface $translator, $id)
{
// Find Template
$log = $this
->getDoctrine()
->getRepository($this->getParameter('pd_mailer.mail_log_class'))
->findOneBy(['id' => $id]);
if (!$log) throw $this->createNotFoundException();
... | [
"public",
"function",
"viewLog",
"(",
"TranslatorInterface",
"$",
"translator",
",",
"$",
"id",
")",
"{",
"// Find Template",
"$",
"log",
"=",
"$",
"this",
"->",
"getDoctrine",
"(",
")",
"->",
"getRepository",
"(",
"$",
"this",
"->",
"getParameter",
"(",
"... | View Log.
@param MailLog $log
@IsGranted("ROLE_MAIL_VIEWLOG")
@return \Symfony\Component\HttpFoundation\Response | [
"View",
"Log",
"."
] | c701cf6778e9c8991ae4b74dbf5e7d3d77310c0f | https://github.com/appaydin/pd-mailer/blob/c701cf6778e9c8991ae4b74dbf5e7d3d77310c0f/Controller/MailController.php#L284-L310 |
32,515 | appaydin/pd-mailer | Controller/MailController.php | MailController.deleteLog | public function deleteLog(Request $request, $mailLog)
{
// Not Found
if (null === $mailLog && !$request->request->has('id')) {
$this->addFlash('error', 'sorry_not_existing');
return $this->redirectToRoute('admin_mail_logger');
}
// Convert Array
$mai... | php | public function deleteLog(Request $request, $mailLog)
{
// Not Found
if (null === $mailLog && !$request->request->has('id')) {
$this->addFlash('error', 'sorry_not_existing');
return $this->redirectToRoute('admin_mail_logger');
}
// Convert Array
$mai... | [
"public",
"function",
"deleteLog",
"(",
"Request",
"$",
"request",
",",
"$",
"mailLog",
")",
"{",
"// Not Found",
"if",
"(",
"null",
"===",
"$",
"mailLog",
"&&",
"!",
"$",
"request",
"->",
"request",
"->",
"has",
"(",
"'id'",
")",
")",
"{",
"$",
"thi... | Delete Logs.
@param Request $request
@param $mailLog
@IsGranted("ROLE_MAIL_LOGDELETE")
@return \Symfony\Component\HttpFoundation\Response | [
"Delete",
"Logs",
"."
] | c701cf6778e9c8991ae4b74dbf5e7d3d77310c0f | https://github.com/appaydin/pd-mailer/blob/c701cf6778e9c8991ae4b74dbf5e7d3d77310c0f/Controller/MailController.php#L322-L347 |
32,516 | appaydin/pd-mailer | Controller/MailController.php | MailController.swiftEventFilter | private function swiftEventFilter(TranslatorInterface $translator, $event): string
{
switch ($event) {
case \Swift_Events_SendEvent::RESULT_SUCCESS:
return $translator->trans('RESULT_SUCCESS');
case \Swift_Events_SendEvent::RESULT_FAILED:
return $trans... | php | private function swiftEventFilter(TranslatorInterface $translator, $event): string
{
switch ($event) {
case \Swift_Events_SendEvent::RESULT_SUCCESS:
return $translator->trans('RESULT_SUCCESS');
case \Swift_Events_SendEvent::RESULT_FAILED:
return $trans... | [
"private",
"function",
"swiftEventFilter",
"(",
"TranslatorInterface",
"$",
"translator",
",",
"$",
"event",
")",
":",
"string",
"{",
"switch",
"(",
"$",
"event",
")",
"{",
"case",
"\\",
"Swift_Events_SendEvent",
"::",
"RESULT_SUCCESS",
":",
"return",
"$",
"tr... | Swift Event.
@param $event
@return string | [
"Swift",
"Event",
"."
] | c701cf6778e9c8991ae4b74dbf5e7d3d77310c0f | https://github.com/appaydin/pd-mailer/blob/c701cf6778e9c8991ae4b74dbf5e7d3d77310c0f/Controller/MailController.php#L376-L394 |
32,517 | arillo/silverstripe-elements | src/ElementBase.php | ElementBase.generateElementSortForHolder | public function generateElementSortForHolder()
{
if (!$this->Sort)
{
$holderFilter = ['PageID' => $this->PageID];
if ($this->ElementID) $holderFilter = ['ElementID' => $this->ElementID];
$this->Sort = self::get()
->filter($holderFilter)
... | php | public function generateElementSortForHolder()
{
if (!$this->Sort)
{
$holderFilter = ['PageID' => $this->PageID];
if ($this->ElementID) $holderFilter = ['ElementID' => $this->ElementID];
$this->Sort = self::get()
->filter($holderFilter)
... | [
"public",
"function",
"generateElementSortForHolder",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"Sort",
")",
"{",
"$",
"holderFilter",
"=",
"[",
"'PageID'",
"=>",
"$",
"this",
"->",
"PageID",
"]",
";",
"if",
"(",
"$",
"this",
"->",
"ElementID",... | Generate next Sort value on element creation.
@return ElementBase | [
"Generate",
"next",
"Sort",
"value",
"on",
"element",
"creation",
"."
] | faa95a6487efe6e28101db5319529aa7e575fa90 | https://github.com/arillo/silverstripe-elements/blob/faa95a6487efe6e28101db5319529aa7e575fa90/src/ElementBase.php#L129-L142 |
32,518 | arillo/silverstripe-elements | src/ElementBase.php | ElementBase.getCMSTypeInfo | public function getCMSTypeInfo()
{
$data = ArrayData::create([
'Icon' => $this->config()->icon,
'Type' => $this->getType(),
]);
// Add versioned states (rendered as a circle over the icon)
if ($this->hasExtension(Versioned::class)) {
$data->IsVers... | php | public function getCMSTypeInfo()
{
$data = ArrayData::create([
'Icon' => $this->config()->icon,
'Type' => $this->getType(),
]);
// Add versioned states (rendered as a circle over the icon)
if ($this->hasExtension(Versioned::class)) {
$data->IsVers... | [
"public",
"function",
"getCMSTypeInfo",
"(",
")",
"{",
"$",
"data",
"=",
"ArrayData",
"::",
"create",
"(",
"[",
"'Icon'",
"=>",
"$",
"this",
"->",
"config",
"(",
")",
"->",
"icon",
",",
"'Type'",
"=>",
"$",
"this",
"->",
"getType",
"(",
")",
",",
"... | Type info for GridField usage.
@return string | [
"Type",
"info",
"for",
"GridField",
"usage",
"."
] | faa95a6487efe6e28101db5319529aa7e575fa90 | https://github.com/arillo/silverstripe-elements/blob/faa95a6487efe6e28101db5319529aa7e575fa90/src/ElementBase.php#L207-L233 |
32,519 | arillo/silverstripe-elements | src/ElementBase.php | ElementBase.getHolderPage | public function getHolderPage()
{
if (!$this->PageID && !$this->ElementID) return null;
$holder = $this->getHolder();
while (
$holder
&& $holder->exists()
&& !is_a($holder, SiteTree::class)
) {
$holder = $holder->getHolder();
}... | php | public function getHolderPage()
{
if (!$this->PageID && !$this->ElementID) return null;
$holder = $this->getHolder();
while (
$holder
&& $holder->exists()
&& !is_a($holder, SiteTree::class)
) {
$holder = $holder->getHolder();
}... | [
"public",
"function",
"getHolderPage",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"PageID",
"&&",
"!",
"$",
"this",
"->",
"ElementID",
")",
"return",
"null",
";",
"$",
"holder",
"=",
"$",
"this",
"->",
"getHolder",
"(",
")",
";",
"while",
"(... | Recursive look up for holder page. | [
"Recursive",
"look",
"up",
"for",
"holder",
"page",
"."
] | faa95a6487efe6e28101db5319529aa7e575fa90 | https://github.com/arillo/silverstripe-elements/blob/faa95a6487efe6e28101db5319529aa7e575fa90/src/ElementBase.php#L327-L341 |
32,520 | arillo/silverstripe-elements | src/ElementBase.php | ElementBase.Render | public function Render(
$IsPos = null,
$IsFirst = null,
$IsLast = null,
$IsEvenOdd = null
) {
$this->IsPos = $IsPos;
$this->IsFirst = $IsFirst;
$this->IsLast = $IsLast;
$this->IsEvenOdd = $IsEvenOdd;
$controller = Controller::curr();
re... | php | public function Render(
$IsPos = null,
$IsFirst = null,
$IsLast = null,
$IsEvenOdd = null
) {
$this->IsPos = $IsPos;
$this->IsFirst = $IsFirst;
$this->IsLast = $IsLast;
$this->IsEvenOdd = $IsEvenOdd;
$controller = Controller::curr();
re... | [
"public",
"function",
"Render",
"(",
"$",
"IsPos",
"=",
"null",
",",
"$",
"IsFirst",
"=",
"null",
",",
"$",
"IsLast",
"=",
"null",
",",
"$",
"IsEvenOdd",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"IsPos",
"=",
"$",
"IsPos",
";",
"$",
"this",
"->"... | Render for template useage.
@param int $IsPos
@param bool $IsFirst
@param bool $IsLast
@param bool $IsEvenOdd | [
"Render",
"for",
"template",
"useage",
"."
] | faa95a6487efe6e28101db5319529aa7e575fa90 | https://github.com/arillo/silverstripe-elements/blob/faa95a6487efe6e28101db5319529aa7e575fa90/src/ElementBase.php#L463-L478 |
32,521 | arillo/silverstripe-elements | src/ElementBase.php | ElementBase.publishPage | public function publishPage()
{
$look = true;
$parent = $this;
while($look)
{
if ($parent = $parent->getHolder())
{
if (is_a($parent, SiteTree::class))
{
$look = false;
}
} else {
... | php | public function publishPage()
{
$look = true;
$parent = $this;
while($look)
{
if ($parent = $parent->getHolder())
{
if (is_a($parent, SiteTree::class))
{
$look = false;
}
} else {
... | [
"public",
"function",
"publishPage",
"(",
")",
"{",
"$",
"look",
"=",
"true",
";",
"$",
"parent",
"=",
"$",
"this",
";",
"while",
"(",
"$",
"look",
")",
"{",
"if",
"(",
"$",
"parent",
"=",
"$",
"parent",
"->",
"getHolder",
"(",
")",
")",
"{",
"... | Publish holder page, trigger publish all sub elements. | [
"Publish",
"holder",
"page",
"trigger",
"publish",
"all",
"sub",
"elements",
"."
] | faa95a6487efe6e28101db5319529aa7e575fa90 | https://github.com/arillo/silverstripe-elements/blob/faa95a6487efe6e28101db5319529aa7e575fa90/src/ElementBase.php#L483-L505 |
32,522 | arillo/silverstripe-elements | src/ElementBase.php | ElementBase.deleteLocalisedRecords | public function deleteLocalisedRecords()
{
if ($this->hasExtension(self::FLUENT_CLASS))
{
$localisedTables = $this->getLocalisedTables();
$tableClasses = ClassInfo::ancestry($this->owner, true);
foreach ($tableClasses as $class)
{
$tab... | php | public function deleteLocalisedRecords()
{
if ($this->hasExtension(self::FLUENT_CLASS))
{
$localisedTables = $this->getLocalisedTables();
$tableClasses = ClassInfo::ancestry($this->owner, true);
foreach ($tableClasses as $class)
{
$tab... | [
"public",
"function",
"deleteLocalisedRecords",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"hasExtension",
"(",
"self",
"::",
"FLUENT_CLASS",
")",
")",
"{",
"$",
"localisedTables",
"=",
"$",
"this",
"->",
"getLocalisedTables",
"(",
")",
";",
"$",
"tableC... | Execute record deletion, even when localised records in non-current locale exist.
@return ElementBase | [
"Execute",
"record",
"deletion",
"even",
"when",
"localised",
"records",
"in",
"non",
"-",
"current",
"locale",
"exist",
"."
] | faa95a6487efe6e28101db5319529aa7e575fa90 | https://github.com/arillo/silverstripe-elements/blob/faa95a6487efe6e28101db5319529aa7e575fa90/src/ElementBase.php#L533-L585 |
32,523 | appaydin/pd-mailer | Menu/MailerMenu.php | MailerMenu.createMenu | public function createMenu(array $options = []): ItemInterface
{
// Create Root
$menu = $this->createRoot('mail_manager')->setChildAttr([
'class' => 'nav nav-pills',
'data-parent' => 'admin_mail_list',
]);
// Create Menu Items
$menu
->addC... | php | public function createMenu(array $options = []): ItemInterface
{
// Create Root
$menu = $this->createRoot('mail_manager')->setChildAttr([
'class' => 'nav nav-pills',
'data-parent' => 'admin_mail_list',
]);
// Create Menu Items
$menu
->addC... | [
"public",
"function",
"createMenu",
"(",
"array",
"$",
"options",
"=",
"[",
"]",
")",
":",
"ItemInterface",
"{",
"// Create Root",
"$",
"menu",
"=",
"$",
"this",
"->",
"createRoot",
"(",
"'mail_manager'",
")",
"->",
"setChildAttr",
"(",
"[",
"'class'",
"=>... | Mail Manager Custom Menus.
@param array $options
@return ItemInterface | [
"Mail",
"Manager",
"Custom",
"Menus",
"."
] | c701cf6778e9c8991ae4b74dbf5e7d3d77310c0f | https://github.com/appaydin/pd-mailer/blob/c701cf6778e9c8991ae4b74dbf5e7d3d77310c0f/Menu/MailerMenu.php#L33-L54 |
32,524 | davidecesarano/Embryo-Http | Embryo/Http/Factory/UriFactory.php | UriFactory.createUriFromServer | public function createUriFromServer(array $server): UriInterface
{
// scheme, host, post, user, pass
$scheme = (empty($server['HTTPS']) || $server['HTTPS'] === 'off') ? 'http' : 'https';
$host = (isset($server['HTTP_HOST'])) ? $server['HTTP_HOST'] : $server['SERVER_NAME'];
... | php | public function createUriFromServer(array $server): UriInterface
{
// scheme, host, post, user, pass
$scheme = (empty($server['HTTPS']) || $server['HTTPS'] === 'off') ? 'http' : 'https';
$host = (isset($server['HTTP_HOST'])) ? $server['HTTP_HOST'] : $server['SERVER_NAME'];
... | [
"public",
"function",
"createUriFromServer",
"(",
"array",
"$",
"server",
")",
":",
"UriInterface",
"{",
"// scheme, host, post, user, pass",
"$",
"scheme",
"=",
"(",
"empty",
"(",
"$",
"server",
"[",
"'HTTPS'",
"]",
")",
"||",
"$",
"server",
"[",
"'HTTPS'",
... | Creates new Uri from array.
@param array $server
@return UriInterface | [
"Creates",
"new",
"Uri",
"from",
"array",
"."
] | 5ff81c07fbff3abed051d710f0837544465887c8 | https://github.com/davidecesarano/Embryo-Http/blob/5ff81c07fbff3abed051d710f0837544465887c8/Embryo/Http/Factory/UriFactory.php#L38-L66 |
32,525 | firebrandhq/silverstripe-hail | src/Models/Video.php | Video.importingColor | protected function importingColor($SSName, $data)
{
$color = $this->{$SSName};
if (!$color) {
$color = new Color();
}
$this->Fetched = date("Y-m-d H:i:s");
$color->OrganisationID = $this->OrganisationID;
$color->HailOrgID = $this->HailOrgID;
$color... | php | protected function importingColor($SSName, $data)
{
$color = $this->{$SSName};
if (!$color) {
$color = new Color();
}
$this->Fetched = date("Y-m-d H:i:s");
$color->OrganisationID = $this->OrganisationID;
$color->HailOrgID = $this->HailOrgID;
$color... | [
"protected",
"function",
"importingColor",
"(",
"$",
"SSName",
",",
"$",
"data",
")",
"{",
"$",
"color",
"=",
"$",
"this",
"->",
"{",
"$",
"SSName",
"}",
";",
"if",
"(",
"!",
"$",
"color",
")",
"{",
"$",
"color",
"=",
"new",
"Color",
"(",
")",
... | Process the colors
@param $SSName
@param $data | [
"Process",
"the",
"colors"
] | fd655b7a568f8d5f6a8f888f39368618596f794e | https://github.com/firebrandhq/silverstripe-hail/blob/fd655b7a568f8d5f6a8f888f39368618596f794e/src/Models/Video.php#L218-L230 |
32,526 | oasmobile/php-http | src/ServiceProviders/Security/AbstractSimplePreAuthenticationPolicy.php | AbstractSimplePreAuthenticationPolicy.getAuthenticationProvider | public function getAuthenticationProvider(Container $app, $firewallName, $options)
{
return new SimpleAuthenticationProvider(
$this->getPreAuthenticator(),
$this->getUserProvider($app, $firewallName),
$firewallName
);
} | php | public function getAuthenticationProvider(Container $app, $firewallName, $options)
{
return new SimpleAuthenticationProvider(
$this->getPreAuthenticator(),
$this->getUserProvider($app, $firewallName),
$firewallName
);
} | [
"public",
"function",
"getAuthenticationProvider",
"(",
"Container",
"$",
"app",
",",
"$",
"firewallName",
",",
"$",
"options",
")",
"{",
"return",
"new",
"SimpleAuthenticationProvider",
"(",
"$",
"this",
"->",
"getPreAuthenticator",
"(",
")",
",",
"$",
"this",
... | If string is returned, it must be either "anonymous" or "dao"
@param Container $app
@param $firewallName
@param $options
@return string|AuthenticationProviderInterface | [
"If",
"string",
"is",
"returned",
"it",
"must",
"be",
"either",
"anonymous",
"or",
"dao"
] | a7570893742286c30222c393891aeb6857064f37 | https://github.com/oasmobile/php-http/blob/a7570893742286c30222c393891aeb6857064f37/src/ServiceProviders/Security/AbstractSimplePreAuthenticationPolicy.php#L35-L42 |
32,527 | oasmobile/php-http | src/ExtendedArgumentValueResolver.php | ExtendedArgumentValueResolver.supports | public function supports(Request $request, ArgumentMetadata $argument)
{
$classname = $argument->getType();
if (!\class_exists($classname)) {
return false;
}
if (\array_key_exists($classname, $this->mappingParameters)) {
return true;
}
else {
... | php | public function supports(Request $request, ArgumentMetadata $argument)
{
$classname = $argument->getType();
if (!\class_exists($classname)) {
return false;
}
if (\array_key_exists($classname, $this->mappingParameters)) {
return true;
}
else {
... | [
"public",
"function",
"supports",
"(",
"Request",
"$",
"request",
",",
"ArgumentMetadata",
"$",
"argument",
")",
"{",
"$",
"classname",
"=",
"$",
"argument",
"->",
"getType",
"(",
")",
";",
"if",
"(",
"!",
"\\",
"class_exists",
"(",
"$",
"classname",
")"... | Whether this resolver can resolve the value for the given ArgumentMetadata.
@param Request $request
@param ArgumentMetadata $argument
@return bool | [
"Whether",
"this",
"resolver",
"can",
"resolve",
"the",
"value",
"for",
"the",
"given",
"ArgumentMetadata",
"."
] | a7570893742286c30222c393891aeb6857064f37 | https://github.com/oasmobile/php-http/blob/a7570893742286c30222c393891aeb6857064f37/src/ExtendedArgumentValueResolver.php#L37-L55 |
32,528 | appaydin/pd-mailer | SwiftMailer/PdSwiftMessage.php | PdSwiftMessage.setTemplateId | public function setTemplateId(string $templateId = null)
{
if (!$this->setHeaderFieldModel('TemplateID', $templateId)) {
$this->getHeaders()->addTextHeader('TemplateID', $templateId);
}
return $this;
} | php | public function setTemplateId(string $templateId = null)
{
if (!$this->setHeaderFieldModel('TemplateID', $templateId)) {
$this->getHeaders()->addTextHeader('TemplateID', $templateId);
}
return $this;
} | [
"public",
"function",
"setTemplateId",
"(",
"string",
"$",
"templateId",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"setHeaderFieldModel",
"(",
"'TemplateID'",
",",
"$",
"templateId",
")",
")",
"{",
"$",
"this",
"->",
"getHeaders",
"(",
")... | Set Message Content Template ID.
@param string|null $templateId
@return $this | [
"Set",
"Message",
"Content",
"Template",
"ID",
"."
] | c701cf6778e9c8991ae4b74dbf5e7d3d77310c0f | https://github.com/appaydin/pd-mailer/blob/c701cf6778e9c8991ae4b74dbf5e7d3d77310c0f/SwiftMailer/PdSwiftMessage.php#L30-L37 |
32,529 | gocom/textpattern-installer | src/Textpattern/Composer/Installer/Installer/Base.php | Base.install | public function install(InstalledRepositoryInterface $repo, PackageInterface $package)
{
new Textpattern();
parent::install($repo, $package);
$plugin = new $this->textpatternPackager($this->getInstallPath($package), $package);
$plugin->install();
} | php | public function install(InstalledRepositoryInterface $repo, PackageInterface $package)
{
new Textpattern();
parent::install($repo, $package);
$plugin = new $this->textpatternPackager($this->getInstallPath($package), $package);
$plugin->install();
} | [
"public",
"function",
"install",
"(",
"InstalledRepositoryInterface",
"$",
"repo",
",",
"PackageInterface",
"$",
"package",
")",
"{",
"new",
"Textpattern",
"(",
")",
";",
"parent",
"::",
"install",
"(",
"$",
"repo",
",",
"$",
"package",
")",
";",
"$",
"plu... | Writes the plugin package to the database on install.
@param InstalledRepositoryInterface $repo
@param PackageInterface $package | [
"Writes",
"the",
"plugin",
"package",
"to",
"the",
"database",
"on",
"install",
"."
] | 804271de54177ebd294a4a19d409ae7fc2317935 | https://github.com/gocom/textpattern-installer/blob/804271de54177ebd294a4a19d409ae7fc2317935/src/Textpattern/Composer/Installer/Installer/Base.php#L68-L74 |
32,530 | gocom/textpattern-installer | src/Textpattern/Composer/Installer/Installer/Base.php | Base.update | public function update(InstalledRepositoryInterface $repo, PackageInterface $initial, PackageInterface $target)
{
new Textpattern();
parent::update($repo, $initial, $target);
$plugin = new $this->textpatternPackager($this->getInstallPath($target), $target);
$plugin->update();
} | php | public function update(InstalledRepositoryInterface $repo, PackageInterface $initial, PackageInterface $target)
{
new Textpattern();
parent::update($repo, $initial, $target);
$plugin = new $this->textpatternPackager($this->getInstallPath($target), $target);
$plugin->update();
} | [
"public",
"function",
"update",
"(",
"InstalledRepositoryInterface",
"$",
"repo",
",",
"PackageInterface",
"$",
"initial",
",",
"PackageInterface",
"$",
"target",
")",
"{",
"new",
"Textpattern",
"(",
")",
";",
"parent",
"::",
"update",
"(",
"$",
"repo",
",",
... | Runs updater on package updates.
@param InstalledRepositoryInterface $repo
@param PackageInterface $initial
@param PackageInterface $target | [
"Runs",
"updater",
"on",
"package",
"updates",
"."
] | 804271de54177ebd294a4a19d409ae7fc2317935 | https://github.com/gocom/textpattern-installer/blob/804271de54177ebd294a4a19d409ae7fc2317935/src/Textpattern/Composer/Installer/Installer/Base.php#L83-L89 |
32,531 | davidecesarano/Embryo-Http | Embryo/Http/Message/UploadedFile.php | UploadedFile.getStream | public function getStream(): StreamInterface
{
if ($this->moved) {
throw new \RuntimeException(sprintf('Uploaded file %1s has already been moved', $this->clientFilename));
}
return $this->file;
} | php | public function getStream(): StreamInterface
{
if ($this->moved) {
throw new \RuntimeException(sprintf('Uploaded file %1s has already been moved', $this->clientFilename));
}
return $this->file;
} | [
"public",
"function",
"getStream",
"(",
")",
":",
"StreamInterface",
"{",
"if",
"(",
"$",
"this",
"->",
"moved",
")",
"{",
"throw",
"new",
"\\",
"RuntimeException",
"(",
"sprintf",
"(",
"'Uploaded file %1s has already been moved'",
",",
"$",
"this",
"->",
"cli... | Retrieves a stream representing the uploaded file.
This method returns a StreamInterface instance, representing the
uploaded file.
@return StreamInterface
@throws RuntimeException | [
"Retrieves",
"a",
"stream",
"representing",
"the",
"uploaded",
"file",
"."
] | 5ff81c07fbff3abed051d710f0837544465887c8 | https://github.com/davidecesarano/Embryo-Http/blob/5ff81c07fbff3abed051d710f0837544465887c8/Embryo/Http/Message/UploadedFile.php#L84-L90 |
32,532 | davidecesarano/Embryo-Http | Embryo/Http/Message/UploadedFile.php | UploadedFile.moveTo | public function moveTo($targetPath)
{
if ($this->moved) {
throw new \RuntimeException('Uploaded file already moved');
}
if (!is_string($targetPath) || $targetPath === '') {
throw new \InvalidArgumentException('Target path must be a non empty s... | php | public function moveTo($targetPath)
{
if ($this->moved) {
throw new \RuntimeException('Uploaded file already moved');
}
if (!is_string($targetPath) || $targetPath === '') {
throw new \InvalidArgumentException('Target path must be a non empty s... | [
"public",
"function",
"moveTo",
"(",
"$",
"targetPath",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"moved",
")",
"{",
"throw",
"new",
"\\",
"RuntimeException",
"(",
"'Uploaded file already moved'",
")",
";",
"}",
"if",
"(",
"!",
"is_string",
"(",
"$",
"targ... | Moves the uploaded file to a new location.
@see http://php.net/is_uploaded_file
@see http://php.net/move_uploaded_file
@param string $targetPath
@throws InvalidArgumentException
@throws RuntimeException | [
"Moves",
"the",
"uploaded",
"file",
"to",
"a",
"new",
"location",
"."
] | 5ff81c07fbff3abed051d710f0837544465887c8 | https://github.com/davidecesarano/Embryo-Http/blob/5ff81c07fbff3abed051d710f0837544465887c8/Embryo/Http/Message/UploadedFile.php#L101-L138 |
32,533 | gocom/textpattern-installer | src/Textpattern/Composer/Installer/Plugin/Manifest.php | Manifest.find | protected function find($directory)
{
if ($iterator = parent::find($directory)) {
new Textpattern();
foreach ($this->manifestNames as $manifestName) {
foreach ($iterator as $file) {
if (basename($file) === $manifestName && $this->isManifest($file)... | php | protected function find($directory)
{
if ($iterator = parent::find($directory)) {
new Textpattern();
foreach ($this->manifestNames as $manifestName) {
foreach ($iterator as $file) {
if (basename($file) === $manifestName && $this->isManifest($file)... | [
"protected",
"function",
"find",
"(",
"$",
"directory",
")",
"{",
"if",
"(",
"$",
"iterator",
"=",
"parent",
"::",
"find",
"(",
"$",
"directory",
")",
")",
"{",
"new",
"Textpattern",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"manifestNames",
... | Find the plugin project directory and manifest from the package.
@param string $directory
@return bool | [
"Find",
"the",
"plugin",
"project",
"directory",
"and",
"manifest",
"from",
"the",
"package",
"."
] | 804271de54177ebd294a4a19d409ae7fc2317935 | https://github.com/gocom/textpattern-installer/blob/804271de54177ebd294a4a19d409ae7fc2317935/src/Textpattern/Composer/Installer/Plugin/Manifest.php#L75-L95 |
32,534 | gocom/textpattern-installer | src/Textpattern/Composer/Installer/Plugin/Manifest.php | Manifest.isManifest | protected function isManifest($file)
{
if (is_file($file) && is_readable($file)) {
if ($contents = file_get_contents($file)) {
$this->manifest = @json_decode($contents);
if ($this->manifest && isset($this->manifest->name) && is_string($this->manifest->name)) {
... | php | protected function isManifest($file)
{
if (is_file($file) && is_readable($file)) {
if ($contents = file_get_contents($file)) {
$this->manifest = @json_decode($contents);
if ($this->manifest && isset($this->manifest->name) && is_string($this->manifest->name)) {
... | [
"protected",
"function",
"isManifest",
"(",
"$",
"file",
")",
"{",
"if",
"(",
"is_file",
"(",
"$",
"file",
")",
"&&",
"is_readable",
"(",
"$",
"file",
")",
")",
"{",
"if",
"(",
"$",
"contents",
"=",
"file_get_contents",
"(",
"$",
"file",
")",
")",
... | Whether a file is a valid plugin manifest.
This function makes sure the file contains JSON, the name property
follows plugin naming convention and the parent directory is the same
as the name property.
A valid plugin name follows the pattern {pfx}_{pluginName}, where the
{pfx} is the plugin author prefix and the {plu... | [
"Whether",
"a",
"file",
"is",
"a",
"valid",
"plugin",
"manifest",
"."
] | 804271de54177ebd294a4a19d409ae7fc2317935 | https://github.com/gocom/textpattern-installer/blob/804271de54177ebd294a4a19d409ae7fc2317935/src/Textpattern/Composer/Installer/Plugin/Manifest.php#L111-L128 |
32,535 | gocom/textpattern-installer | src/Textpattern/Composer/Installer/Plugin/Manifest.php | Manifest.code | protected function code()
{
$files = $out = [];
if (isset($this->manifest->code->file)) {
$files = array_map([$this, 'path'], (array) $this->manifest->code->file);
} else {
if (($cwd = getcwd()) !== false && chdir($this->dir)) {
$files = (array) glob(... | php | protected function code()
{
$files = $out = [];
if (isset($this->manifest->code->file)) {
$files = array_map([$this, 'path'], (array) $this->manifest->code->file);
} else {
if (($cwd = getcwd()) !== false && chdir($this->dir)) {
$files = (array) glob(... | [
"protected",
"function",
"code",
"(",
")",
"{",
"$",
"files",
"=",
"$",
"out",
"=",
"[",
"]",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"manifest",
"->",
"code",
"->",
"file",
")",
")",
"{",
"$",
"files",
"=",
"array_map",
"(",
"[",
"$",... | Plugin code template.
Generates PHP source code that either imports
.php files in the directory or the files
specified with the 'file' property of 'code'.
@return string | [
"Plugin",
"code",
"template",
"."
] | 804271de54177ebd294a4a19d409ae7fc2317935 | https://github.com/gocom/textpattern-installer/blob/804271de54177ebd294a4a19d409ae7fc2317935/src/Textpattern/Composer/Installer/Plugin/Manifest.php#L213-L244 |
32,536 | gocom/textpattern-installer | src/Textpattern/Composer/Installer/Plugin/Manifest.php | Manifest.textpack | protected function textpack()
{
$textpacks = $this->dir . '/textpacks';
if (!file_exists($textpacks) || !is_dir($textpacks) || !is_readable($textpacks)) {
return '';
}
if (($cwd = getcwd()) === false || !chdir($textpacks)) {
return '';
}
$ou... | php | protected function textpack()
{
$textpacks = $this->dir . '/textpacks';
if (!file_exists($textpacks) || !is_dir($textpacks) || !is_readable($textpacks)) {
return '';
}
if (($cwd = getcwd()) === false || !chdir($textpacks)) {
return '';
}
$ou... | [
"protected",
"function",
"textpack",
"(",
")",
"{",
"$",
"textpacks",
"=",
"$",
"this",
"->",
"dir",
".",
"'/textpacks'",
";",
"if",
"(",
"!",
"file_exists",
"(",
"$",
"textpacks",
")",
"||",
"!",
"is_dir",
"(",
"$",
"textpacks",
")",
"||",
"!",
"is_... | Gets Textpacks.
@return string | [
"Gets",
"Textpacks",
"."
] | 804271de54177ebd294a4a19d409ae7fc2317935 | https://github.com/gocom/textpattern-installer/blob/804271de54177ebd294a4a19d409ae7fc2317935/src/Textpattern/Composer/Installer/Plugin/Manifest.php#L251-L282 |
32,537 | gocom/textpattern-installer | src/Textpattern/Composer/Installer/Plugin/Manifest.php | Manifest.help | protected function help()
{
$out = [];
if (isset($this->manifest->help) && is_string($this->manifest->help)) {
return (string) $this->manifest->help;
}
if (empty($this->manifest->help->file)) {
$files = $this->helpNames;
} else {
$files =... | php | protected function help()
{
$out = [];
if (isset($this->manifest->help) && is_string($this->manifest->help)) {
return (string) $this->manifest->help;
}
if (empty($this->manifest->help->file)) {
$files = $this->helpNames;
} else {
$files =... | [
"protected",
"function",
"help",
"(",
")",
"{",
"$",
"out",
"=",
"[",
"]",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"manifest",
"->",
"help",
")",
"&&",
"is_string",
"(",
"$",
"this",
"->",
"manifest",
"->",
"help",
")",
")",
"{",
"return... | Gets help files.
@return string | [
"Gets",
"help",
"files",
"."
] | 804271de54177ebd294a4a19d409ae7fc2317935 | https://github.com/gocom/textpattern-installer/blob/804271de54177ebd294a4a19d409ae7fc2317935/src/Textpattern/Composer/Installer/Plugin/Manifest.php#L289-L312 |
32,538 | flipboxfactory/craft-ember | src/objects/SiteMutatorTrait.php | SiteMutatorTrait.getSiteId | public function getSiteId()
{
if (null === $this->siteId && null !== $this->site) {
$this->siteId = $this->site->id;
}
return $this->siteId;
} | php | public function getSiteId()
{
if (null === $this->siteId && null !== $this->site) {
$this->siteId = $this->site->id;
}
return $this->siteId;
} | [
"public",
"function",
"getSiteId",
"(",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"siteId",
"&&",
"null",
"!==",
"$",
"this",
"->",
"site",
")",
"{",
"$",
"this",
"->",
"siteId",
"=",
"$",
"this",
"->",
"site",
"->",
"id",
";",
"}",
... | Get associated siteId
@return int|null | [
"Get",
"associated",
"siteId"
] | 9185b885b404b1cb272a0983023eb7c6c0df61c8 | https://github.com/flipboxfactory/craft-ember/blob/9185b885b404b1cb272a0983023eb7c6c0df61c8/src/objects/SiteMutatorTrait.php#L45-L52 |
32,539 | ninjify/nunjuck | src/Environment.php | Environment.setup | public static function setup(string $dir): void
{
self::setupTester();
self::setupTimezone();
self::setupVariables($dir);
self::setupGlobalVariables();
} | php | public static function setup(string $dir): void
{
self::setupTester();
self::setupTimezone();
self::setupVariables($dir);
self::setupGlobalVariables();
} | [
"public",
"static",
"function",
"setup",
"(",
"string",
"$",
"dir",
")",
":",
"void",
"{",
"self",
"::",
"setupTester",
"(",
")",
";",
"self",
"::",
"setupTimezone",
"(",
")",
";",
"self",
"::",
"setupVariables",
"(",
"$",
"dir",
")",
";",
"self",
":... | Magic setup method | [
"Magic",
"setup",
"method"
] | 0381d3330e769c4712ab063b32200a1d52333a5c | https://github.com/ninjify/nunjuck/blob/0381d3330e769c4712ab063b32200a1d52333a5c/src/Environment.php#L30-L36 |
32,540 | ninjify/nunjuck | src/Environment.php | Environment.setupGlobalVariables | public static function setupGlobalVariables(): void
{
$_SERVER = array_intersect_key($_SERVER, array_flip([
'PHP_SELF',
'SCRIPT_NAME',
'SERVER_ADDR',
'SERVER_SOFTWARE',
'HTTP_HOST',
'DOCUMENT_ROOT',
'OS',
'argc',
'argv',
]));
$_SERVER['REQUEST_TIME'] = 1234567890;
$_ENV = $_GET = $_P... | php | public static function setupGlobalVariables(): void
{
$_SERVER = array_intersect_key($_SERVER, array_flip([
'PHP_SELF',
'SCRIPT_NAME',
'SERVER_ADDR',
'SERVER_SOFTWARE',
'HTTP_HOST',
'DOCUMENT_ROOT',
'OS',
'argc',
'argv',
]));
$_SERVER['REQUEST_TIME'] = 1234567890;
$_ENV = $_GET = $_P... | [
"public",
"static",
"function",
"setupGlobalVariables",
"(",
")",
":",
"void",
"{",
"$",
"_SERVER",
"=",
"array_intersect_key",
"(",
"$",
"_SERVER",
",",
"array_flip",
"(",
"[",
"'PHP_SELF'",
",",
"'SCRIPT_NAME'",
",",
"'SERVER_ADDR'",
",",
"'SERVER_SOFTWARE'",
... | Configure global variables | [
"Configure",
"global",
"variables"
] | 0381d3330e769c4712ab063b32200a1d52333a5c | https://github.com/ninjify/nunjuck/blob/0381d3330e769c4712ab063b32200a1d52333a5c/src/Environment.php#L104-L119 |
32,541 | ninjify/nunjuck | src/Environment.php | Environment.setupRobotLoader | public static function setupRobotLoader(?callable $callback = null): void
{
$loader = new RobotLoader();
$loader->setTempDirectory(CACHE_DIR);
if ($callback !== null) {
$callback($loader);
} else {
$loader->addDirectory(ENGINE_DIR);
$loader->addDirectory(APP_DIR);
$loader->setAutoRefresh(true);
... | php | public static function setupRobotLoader(?callable $callback = null): void
{
$loader = new RobotLoader();
$loader->setTempDirectory(CACHE_DIR);
if ($callback !== null) {
$callback($loader);
} else {
$loader->addDirectory(ENGINE_DIR);
$loader->addDirectory(APP_DIR);
$loader->setAutoRefresh(true);
... | [
"public",
"static",
"function",
"setupRobotLoader",
"(",
"?",
"callable",
"$",
"callback",
"=",
"null",
")",
":",
"void",
"{",
"$",
"loader",
"=",
"new",
"RobotLoader",
"(",
")",
";",
"$",
"loader",
"->",
"setTempDirectory",
"(",
"CACHE_DIR",
")",
";",
"... | Configure robot loader | [
"Configure",
"robot",
"loader"
] | 0381d3330e769c4712ab063b32200a1d52333a5c | https://github.com/ninjify/nunjuck/blob/0381d3330e769c4712ab063b32200a1d52333a5c/src/Environment.php#L124-L138 |
32,542 | firebrandhq/silverstripe-hail | src/Forms/GridFieldFetchButton.php | GridFieldFetchButton.getHTMLFragments | public function getHTMLFragments($gridField)
{
//Disable button if there is already a job running, and add a class to the progress button to trigger the display
$jobs = FetchJob::get()->filter(['Status:not' => ['Done', 'Error']]);
$current = $jobs->First();
$global = $current && $cur... | php | public function getHTMLFragments($gridField)
{
//Disable button if there is already a job running, and add a class to the progress button to trigger the display
$jobs = FetchJob::get()->filter(['Status:not' => ['Done', 'Error']]);
$current = $jobs->First();
$global = $current && $cur... | [
"public",
"function",
"getHTMLFragments",
"(",
"$",
"gridField",
")",
"{",
"//Disable button if there is already a job running, and add a class to the progress button to trigger the display",
"$",
"jobs",
"=",
"FetchJob",
"::",
"get",
"(",
")",
"->",
"filter",
"(",
"[",
"'S... | Returns the Fetch Button html
@param GridField $gridField
@return array | [
"Returns",
"the",
"Fetch",
"Button",
"html"
] | fd655b7a568f8d5f6a8f888f39368618596f794e | https://github.com/firebrandhq/silverstripe-hail/blob/fd655b7a568f8d5f6a8f888f39368618596f794e/src/Forms/GridFieldFetchButton.php#L37-L60 |
32,543 | flipboxfactory/craft-ember | src/queries/OrderByTrait.php | OrderByTrait.applyOrderByParams | protected function applyOrderByParams(Connection $db)
{
if ($this->orderBy === null) {
return;
}
// Any other empty value means we should set it
if (empty($this->orderBy)) {
$this->applyEmptyOrderByParams($db);
}
$this->orderBy($this->orderBy... | php | protected function applyOrderByParams(Connection $db)
{
if ($this->orderBy === null) {
return;
}
// Any other empty value means we should set it
if (empty($this->orderBy)) {
$this->applyEmptyOrderByParams($db);
}
$this->orderBy($this->orderBy... | [
"protected",
"function",
"applyOrderByParams",
"(",
"Connection",
"$",
"db",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"orderBy",
"===",
"null",
")",
"{",
"return",
";",
"}",
"// Any other empty value means we should set it",
"if",
"(",
"empty",
"(",
"$",
"this"... | Applies the 'fixedOrder' and 'orderBy' params to the query being prepared.
@param Connection|null $db The database connection used to generate the SQL statement.
If this parameter is not given, the `db` application component will be used. | [
"Applies",
"the",
"fixedOrder",
"and",
"orderBy",
"params",
"to",
"the",
"query",
"being",
"prepared",
"."
] | 9185b885b404b1cb272a0983023eb7c6c0df61c8 | https://github.com/flipboxfactory/craft-ember/blob/9185b885b404b1cb272a0983023eb7c6c0df61c8/src/queries/OrderByTrait.php#L52-L64 |
32,544 | firebrandhq/silverstripe-hail | src/Models/Article.php | Article.fetchImages | public function fetchImages()
{
try {
$api_client = new Client();
$list = $api_client->getImagesByArticles($this->HailID);
} catch (\Exception $ex) {
return;
}
$hailIdList = [];
// Clean before importing
$this->ImageGa... | php | public function fetchImages()
{
try {
$api_client = new Client();
$list = $api_client->getImagesByArticles($this->HailID);
} catch (\Exception $ex) {
return;
}
$hailIdList = [];
// Clean before importing
$this->ImageGa... | [
"public",
"function",
"fetchImages",
"(",
")",
"{",
"try",
"{",
"$",
"api_client",
"=",
"new",
"Client",
"(",
")",
";",
"$",
"list",
"=",
"$",
"api_client",
"->",
"getImagesByArticles",
"(",
"$",
"this",
"->",
"HailID",
")",
";",
"}",
"catch",
"(",
"... | Fetch the image gallery of this article from the Hail API
@return void
@throws | [
"Fetch",
"the",
"image",
"gallery",
"of",
"this",
"article",
"from",
"the",
"Hail",
"API"
] | fd655b7a568f8d5f6a8f888f39368618596f794e | https://github.com/firebrandhq/silverstripe-hail/blob/fd655b7a568f8d5f6a8f888f39368618596f794e/src/Models/Article.php#L187-L218 |
32,545 | firebrandhq/silverstripe-hail | src/Models/Article.php | Article.fetchVideos | public function fetchVideos()
{
try {
$api_client = new Client();
$list = $api_client->getVideosByArticles($this->HailID);
} catch (\Exception $ex) {
return;
}
$hailIdList = [];
// CLean before importing
$this->VideoGall... | php | public function fetchVideos()
{
try {
$api_client = new Client();
$list = $api_client->getVideosByArticles($this->HailID);
} catch (\Exception $ex) {
return;
}
$hailIdList = [];
// CLean before importing
$this->VideoGall... | [
"public",
"function",
"fetchVideos",
"(",
")",
"{",
"try",
"{",
"$",
"api_client",
"=",
"new",
"Client",
"(",
")",
";",
"$",
"list",
"=",
"$",
"api_client",
"->",
"getVideosByArticles",
"(",
"$",
"this",
"->",
"HailID",
")",
";",
"}",
"catch",
"(",
"... | Fetch the video gallery of this article from the Hail API
@return void
@throws | [
"Fetch",
"the",
"video",
"gallery",
"of",
"this",
"article",
"from",
"the",
"Hail",
"API"
] | fd655b7a568f8d5f6a8f888f39368618596f794e | https://github.com/firebrandhq/silverstripe-hail/blob/fd655b7a568f8d5f6a8f888f39368618596f794e/src/Models/Article.php#L226-L255 |
32,546 | firebrandhq/silverstripe-hail | src/Models/Article.php | Article.Link | public function Link()
{
$ctrl = Controller::curr();
if ($ctrl instanceof HailPageController) {
$link = $ctrl->Link();
} else {
//If outside HailPageController try to find the first Hail Page
$page = HailPage::get()->first();
if (!empty... | php | public function Link()
{
$ctrl = Controller::curr();
if ($ctrl instanceof HailPageController) {
$link = $ctrl->Link();
} else {
//If outside HailPageController try to find the first Hail Page
$page = HailPage::get()->first();
if (!empty... | [
"public",
"function",
"Link",
"(",
")",
"{",
"$",
"ctrl",
"=",
"Controller",
"::",
"curr",
"(",
")",
";",
"if",
"(",
"$",
"ctrl",
"instanceof",
"HailPageController",
")",
"{",
"$",
"link",
"=",
"$",
"ctrl",
"->",
"Link",
"(",
")",
";",
"}",
"else",... | Return the Article link for the current HailPageController
@return string | [
"Return",
"the",
"Article",
"link",
"for",
"the",
"current",
"HailPageController"
] | fd655b7a568f8d5f6a8f888f39368618596f794e | https://github.com/firebrandhq/silverstripe-hail/blob/fd655b7a568f8d5f6a8f888f39368618596f794e/src/Models/Article.php#L262-L280 |
32,547 | firebrandhq/silverstripe-hail | src/Models/Article.php | Article.getLinkForPage | public function getLinkForPage($page)
{
return $page->Link() . "article/" . $this->HailID . '/' . Convert::raw2url($this->Title);
} | php | public function getLinkForPage($page)
{
return $page->Link() . "article/" . $this->HailID . '/' . Convert::raw2url($this->Title);
} | [
"public",
"function",
"getLinkForPage",
"(",
"$",
"page",
")",
"{",
"return",
"$",
"page",
"->",
"Link",
"(",
")",
".",
"\"article/\"",
".",
"$",
"this",
"->",
"HailID",
".",
"'/'",
".",
"Convert",
"::",
"raw2url",
"(",
"$",
"this",
"->",
"Title",
")... | Return the Article link for specified HailPage
@param HailPage $page
@return string | [
"Return",
"the",
"Article",
"link",
"for",
"specified",
"HailPage"
] | fd655b7a568f8d5f6a8f888f39368618596f794e | https://github.com/firebrandhq/silverstripe-hail/blob/fd655b7a568f8d5f6a8f888f39368618596f794e/src/Models/Article.php#L288-L291 |
32,548 | firebrandhq/silverstripe-hail | src/Models/Article.php | Article.getTagList | public function getTagList()
{
$string = '';
foreach ($this->PublicTags() as $t) {
$string .= Convert::raw2url($t->Name) . ' ';
}
return trim($string);
} | php | public function getTagList()
{
$string = '';
foreach ($this->PublicTags() as $t) {
$string .= Convert::raw2url($t->Name) . ' ';
}
return trim($string);
} | [
"public",
"function",
"getTagList",
"(",
")",
"{",
"$",
"string",
"=",
"''",
";",
"foreach",
"(",
"$",
"this",
"->",
"PublicTags",
"(",
")",
"as",
"$",
"t",
")",
"{",
"$",
"string",
".=",
"Convert",
"::",
"raw2url",
"(",
"$",
"t",
"->",
"Name",
"... | List of this Article's public tag names separated by spaces.
Suitable to be used as CSS classes.
@return string | [
"List",
"of",
"this",
"Article",
"s",
"public",
"tag",
"names",
"separated",
"by",
"spaces",
"."
] | fd655b7a568f8d5f6a8f888f39368618596f794e | https://github.com/firebrandhq/silverstripe-hail/blob/fd655b7a568f8d5f6a8f888f39368618596f794e/src/Models/Article.php#L340-L347 |
32,549 | firebrandhq/silverstripe-hail | src/Models/Article.php | Article.getAllImages | public function getAllImages()
{
$images = new ArrayList();
if ($this->hasHeroImage()) {
$images->push($this->HeroImage());
}
if ($this->hasGalleryImages()) {
$images->merge($this->ImageGallery());
}
$images->removeDuplicates('HailID')... | php | public function getAllImages()
{
$images = new ArrayList();
if ($this->hasHeroImage()) {
$images->push($this->HeroImage());
}
if ($this->hasGalleryImages()) {
$images->merge($this->ImageGallery());
}
$images->removeDuplicates('HailID')... | [
"public",
"function",
"getAllImages",
"(",
")",
"{",
"$",
"images",
"=",
"new",
"ArrayList",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"hasHeroImage",
"(",
")",
")",
"{",
"$",
"images",
"->",
"push",
"(",
"$",
"this",
"->",
"HeroImage",
"(",
")"... | List of this Article's images
Includes the Hero Image
@return ArrayList | [
"List",
"of",
"this",
"Article",
"s",
"images"
] | fd655b7a568f8d5f6a8f888f39368618596f794e | https://github.com/firebrandhq/silverstripe-hail/blob/fd655b7a568f8d5f6a8f888f39368618596f794e/src/Models/Article.php#L356-L368 |
32,550 | firebrandhq/silverstripe-hail | src/Models/Article.php | Article.getAllVideos | public function getAllVideos()
{
$videos = new ArrayList();
if ($this->hasHeroVideo()) {
$videos->push($this->HeroVideo());
}
if ($this->hasGalleryVideos()) {
$videos->merge($this->VideoGallery());
}
$videos->removeDuplicates('HailID')... | php | public function getAllVideos()
{
$videos = new ArrayList();
if ($this->hasHeroVideo()) {
$videos->push($this->HeroVideo());
}
if ($this->hasGalleryVideos()) {
$videos->merge($this->VideoGallery());
}
$videos->removeDuplicates('HailID')... | [
"public",
"function",
"getAllVideos",
"(",
")",
"{",
"$",
"videos",
"=",
"new",
"ArrayList",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"hasHeroVideo",
"(",
")",
")",
"{",
"$",
"videos",
"->",
"push",
"(",
"$",
"this",
"->",
"HeroVideo",
"(",
")"... | List of this Article's videos
Includes the Hero Video
@return ArrayList | [
"List",
"of",
"this",
"Article",
"s",
"videos"
] | fd655b7a568f8d5f6a8f888f39368618596f794e | https://github.com/firebrandhq/silverstripe-hail/blob/fd655b7a568f8d5f6a8f888f39368618596f794e/src/Models/Article.php#L377-L389 |
32,551 | czim/laravel-processor | src/PipelineProcessor.php | PipelineProcessor.doProcessing | protected function doProcessing()
{
$this->prepareProcessContext();
// initialization process pipeline
$initSteps = $this->initProcessSteps();
if ( ! empty($initSteps)) {
$this->context = app(Pipeline::class)
->send($this->context)
-... | php | protected function doProcessing()
{
$this->prepareProcessContext();
// initialization process pipeline
$initSteps = $this->initProcessSteps();
if ( ! empty($initSteps)) {
$this->context = app(Pipeline::class)
->send($this->context)
-... | [
"protected",
"function",
"doProcessing",
"(",
")",
"{",
"$",
"this",
"->",
"prepareProcessContext",
"(",
")",
";",
"// initialization process pipeline",
"$",
"initSteps",
"=",
"$",
"this",
"->",
"initProcessSteps",
"(",
")",
";",
"if",
"(",
"!",
"empty",
"(",
... | Performs the actual processing | [
"Performs",
"the",
"actual",
"processing"
] | 3d0025cd463653b7a8981ff52cebdafbe978f000 | https://github.com/czim/laravel-processor/blob/3d0025cd463653b7a8981ff52cebdafbe978f000/src/PipelineProcessor.php#L77-L131 |
32,552 | flipboxfactory/craft-ember | src/helpers/ObjectHelper.php | ObjectHelper.findClassFromConfig | public static function findClassFromConfig(&$config, bool $removeClass = false)
{
// Normalize the config
if (is_string($config)) {
// Set as class
$class = $config;
// Clear class from config
$config = '';
} elseif (is_object($config)) {
... | php | public static function findClassFromConfig(&$config, bool $removeClass = false)
{
// Normalize the config
if (is_string($config)) {
// Set as class
$class = $config;
// Clear class from config
$config = '';
} elseif (is_object($config)) {
... | [
"public",
"static",
"function",
"findClassFromConfig",
"(",
"&",
"$",
"config",
",",
"bool",
"$",
"removeClass",
"=",
"false",
")",
"{",
"// Normalize the config",
"if",
"(",
"is_string",
"(",
"$",
"config",
")",
")",
"{",
"// Set as class",
"$",
"class",
"=... | Find a class from a config
@param $config
@param bool $removeClass
@return null|string | [
"Find",
"a",
"class",
"from",
"a",
"config"
] | 9185b885b404b1cb272a0983023eb7c6c0df61c8 | https://github.com/flipboxfactory/craft-ember/blob/9185b885b404b1cb272a0983023eb7c6c0df61c8/src/helpers/ObjectHelper.php#L126-L157 |
32,553 | flipboxfactory/craft-ember | src/records/FieldAttributeTrait.php | FieldAttributeTrait.getFieldId | public function getFieldId()
{
$fieldId = $this->getAttribute('fieldId');
if (null === $fieldId && null !== $this->field) {
$fieldId = $this->$fieldId = $this->field->id;
}
return $fieldId;
} | php | public function getFieldId()
{
$fieldId = $this->getAttribute('fieldId');
if (null === $fieldId && null !== $this->field) {
$fieldId = $this->$fieldId = $this->field->id;
}
return $fieldId;
} | [
"public",
"function",
"getFieldId",
"(",
")",
"{",
"$",
"fieldId",
"=",
"$",
"this",
"->",
"getAttribute",
"(",
"'fieldId'",
")",
";",
"if",
"(",
"null",
"===",
"$",
"fieldId",
"&&",
"null",
"!==",
"$",
"this",
"->",
"field",
")",
"{",
"$",
"fieldId"... | Get associated fieldId
@return int|null | [
"Get",
"associated",
"fieldId"
] | 9185b885b404b1cb272a0983023eb7c6c0df61c8 | https://github.com/flipboxfactory/craft-ember/blob/9185b885b404b1cb272a0983023eb7c6c0df61c8/src/records/FieldAttributeTrait.php#L54-L62 |
32,554 | faustbrian/Laravel-Alert | src/Alert.php | Alert.success | public function success($message, ?string $title = null): self
{
return $this->flash($message, config('laravel-alert.classes.success'), $title);
} | php | public function success($message, ?string $title = null): self
{
return $this->flash($message, config('laravel-alert.classes.success'), $title);
} | [
"public",
"function",
"success",
"(",
"$",
"message",
",",
"?",
"string",
"$",
"title",
"=",
"null",
")",
":",
"self",
"{",
"return",
"$",
"this",
"->",
"flash",
"(",
"$",
"message",
",",
"config",
"(",
"'laravel-alert.classes.success'",
")",
",",
"$",
... | Flash a success alert.
@param string|array $message
@param string|null $title
@return \BrianFaust\Alert\Alert | [
"Flash",
"a",
"success",
"alert",
"."
] | d9a039b0395130e882f44b4ceb63b1d77a5429f6 | https://github.com/faustbrian/Laravel-Alert/blob/d9a039b0395130e882f44b4ceb63b1d77a5429f6/src/Alert.php#L71-L74 |
32,555 | davidecesarano/Embryo-Http | Embryo/Http/Message/Traits/RequestTrait.php | RequestTrait.setRequestTarget | protected function setRequestTarget(string $path, string $query)
{
$target = $path;
if ($target === '') {
$target = '/';
}
if ($query != '') {
$target .= '?'.$query;
}
return $target;
... | php | protected function setRequestTarget(string $path, string $query)
{
$target = $path;
if ($target === '') {
$target = '/';
}
if ($query != '') {
$target .= '?'.$query;
}
return $target;
... | [
"protected",
"function",
"setRequestTarget",
"(",
"string",
"$",
"path",
",",
"string",
"$",
"query",
")",
"{",
"$",
"target",
"=",
"$",
"path",
";",
"if",
"(",
"$",
"target",
"===",
"''",
")",
"{",
"$",
"target",
"=",
"'/'",
";",
"}",
"if",
"(",
... | Sets request target.
@param string $path
@param string $query
@return string | [
"Sets",
"request",
"target",
"."
] | 5ff81c07fbff3abed051d710f0837544465887c8 | https://github.com/davidecesarano/Embryo-Http/blob/5ff81c07fbff3abed051d710f0837544465887c8/Embryo/Http/Message/Traits/RequestTrait.php#L48-L59 |
32,556 | appaydin/pd-mailer | Form/TemplateForm.php | TemplateForm.getLanguageList | public function getLanguageList(ParameterBagInterface $bag)
{
$allLangs = Intl::getLanguageBundle()->getLanguageNames();
return array_flip(array_intersect_key($allLangs, array_flip($bag->get('pd_mailer.active_language'))));
} | php | public function getLanguageList(ParameterBagInterface $bag)
{
$allLangs = Intl::getLanguageBundle()->getLanguageNames();
return array_flip(array_intersect_key($allLangs, array_flip($bag->get('pd_mailer.active_language'))));
} | [
"public",
"function",
"getLanguageList",
"(",
"ParameterBagInterface",
"$",
"bag",
")",
"{",
"$",
"allLangs",
"=",
"Intl",
"::",
"getLanguageBundle",
"(",
")",
"->",
"getLanguageNames",
"(",
")",
";",
"return",
"array_flip",
"(",
"array_intersect_key",
"(",
"$",... | Return Active Language List.
@param ParameterBagInterface $bag
@return array|bool | [
"Return",
"Active",
"Language",
"List",
"."
] | c701cf6778e9c8991ae4b74dbf5e7d3d77310c0f | https://github.com/appaydin/pd-mailer/blob/c701cf6778e9c8991ae4b74dbf5e7d3d77310c0f/Form/TemplateForm.php#L94-L99 |
32,557 | Ifnot/statistics | src/Interval.php | Interval.step | public function step($step = null)
{
if (isset($step)) {
$this->step = $step;
return $this;
} else {
return $this->step;
}
} | php | public function step($step = null)
{
if (isset($step)) {
$this->step = $step;
return $this;
} else {
return $this->step;
}
} | [
"public",
"function",
"step",
"(",
"$",
"step",
"=",
"null",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"step",
")",
")",
"{",
"$",
"this",
"->",
"step",
"=",
"$",
"step",
";",
"return",
"$",
"this",
";",
"}",
"else",
"{",
"return",
"$",
"this",
... | Set or get the step of the interval
@param null $step
@return $this|null | [
"Set",
"or",
"get",
"the",
"step",
"of",
"the",
"interval"
] | 9aba4b193b76cfdd87547b6d319917815704e5b1 | https://github.com/Ifnot/statistics/blob/9aba4b193b76cfdd87547b6d319917815704e5b1/src/Interval.php#L44-L52 |
32,558 | Ifnot/statistics | src/Interval.php | Interval.start | public function start(Carbon $date = null)
{
if (isset($date)) {
$date->hour = 0;
$date->minute = 0;
$date->second = 0;
$this->start = $date;
return $this;
} else {
return $this->start;
}
} | php | public function start(Carbon $date = null)
{
if (isset($date)) {
$date->hour = 0;
$date->minute = 0;
$date->second = 0;
$this->start = $date;
return $this;
} else {
return $this->start;
}
} | [
"public",
"function",
"start",
"(",
"Carbon",
"$",
"date",
"=",
"null",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"date",
")",
")",
"{",
"$",
"date",
"->",
"hour",
"=",
"0",
";",
"$",
"date",
"->",
"minute",
"=",
"0",
";",
"$",
"date",
"->",
"s... | Set or get the start date of the interval
@param Carbon|null $date
@return $this|Carbon | [
"Set",
"or",
"get",
"the",
"start",
"date",
"of",
"the",
"interval"
] | 9aba4b193b76cfdd87547b6d319917815704e5b1 | https://github.com/Ifnot/statistics/blob/9aba4b193b76cfdd87547b6d319917815704e5b1/src/Interval.php#L60-L73 |
32,559 | Ifnot/statistics | src/Interval.php | Interval.getStepIndexFromDate | public function getStepIndexFromDate(Carbon $date)
{
switch ($this->step) {
case "yearly":
$date->month = 1;
case "monthly":
$date->day = 1;
case "daily":
$date->hour = 0;
case "hourly":
$date->mi... | php | public function getStepIndexFromDate(Carbon $date)
{
switch ($this->step) {
case "yearly":
$date->month = 1;
case "monthly":
$date->day = 1;
case "daily":
$date->hour = 0;
case "hourly":
$date->mi... | [
"public",
"function",
"getStepIndexFromDate",
"(",
"Carbon",
"$",
"date",
")",
"{",
"switch",
"(",
"$",
"this",
"->",
"step",
")",
"{",
"case",
"\"yearly\"",
":",
"$",
"date",
"->",
"month",
"=",
"1",
";",
"case",
"\"monthly\"",
":",
"$",
"date",
"->",... | Converting a date to his step index according to the step precision of the interval
@param Carbon $date
@return string | [
"Converting",
"a",
"date",
"to",
"his",
"step",
"index",
"according",
"to",
"the",
"step",
"precision",
"of",
"the",
"interval"
] | 9aba4b193b76cfdd87547b6d319917815704e5b1 | https://github.com/Ifnot/statistics/blob/9aba4b193b76cfdd87547b6d319917815704e5b1/src/Interval.php#L123-L140 |
32,560 | Ifnot/statistics | src/Interval.php | Interval.getStepFormat | public function getStepFormat()
{
if ($this->lang == 'en') {
switch ($this->step) {
case self::$YEARLY:
return 'Y';
break;
case self::$MONTHLY:
return 'Y-m';
break;
cas... | php | public function getStepFormat()
{
if ($this->lang == 'en') {
switch ($this->step) {
case self::$YEARLY:
return 'Y';
break;
case self::$MONTHLY:
return 'Y-m';
break;
cas... | [
"public",
"function",
"getStepFormat",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"lang",
"==",
"'en'",
")",
"{",
"switch",
"(",
"$",
"this",
"->",
"step",
")",
"{",
"case",
"self",
"::",
"$",
"YEARLY",
":",
"return",
"'Y'",
";",
"break",
";",
... | Get the step index format of the step precision
@return array | [
"Get",
"the",
"step",
"index",
"format",
"of",
"the",
"step",
"precision"
] | 9aba4b193b76cfdd87547b6d319917815704e5b1 | https://github.com/Ifnot/statistics/blob/9aba4b193b76cfdd87547b6d319917815704e5b1/src/Interval.php#L147-L182 |
32,561 | Ifnot/statistics | src/Interval.php | Interval.getStepIncrement | public function getStepIncrement()
{
switch ($this->step) {
case self::$YEARLY:
return '+1 year';
break;
case self::$MONTHLY:
return '+1 month';
break;
case self::$DAILY:
return '+1 day';
... | php | public function getStepIncrement()
{
switch ($this->step) {
case self::$YEARLY:
return '+1 year';
break;
case self::$MONTHLY:
return '+1 month';
break;
case self::$DAILY:
return '+1 day';
... | [
"public",
"function",
"getStepIncrement",
"(",
")",
"{",
"switch",
"(",
"$",
"this",
"->",
"step",
")",
"{",
"case",
"self",
"::",
"$",
"YEARLY",
":",
"return",
"'+1 year'",
";",
"break",
";",
"case",
"self",
"::",
"$",
"MONTHLY",
":",
"return",
"'+1 m... | Get the string corresponding to the incrementation of each steps
@return string | [
"Get",
"the",
"string",
"corresponding",
"to",
"the",
"incrementation",
"of",
"each",
"steps"
] | 9aba4b193b76cfdd87547b6d319917815704e5b1 | https://github.com/Ifnot/statistics/blob/9aba4b193b76cfdd87547b6d319917815704e5b1/src/Interval.php#L189-L205 |
32,562 | davidecesarano/Embryo-Http | Embryo/Http/Factory/ServerRequestFactory.php | ServerRequestFactory.createServerRequestFromServer | public function createServerRequestFromServer(): ServerRequestInterface
{
$method = $_SERVER['REQUEST_METHOD'];
$uri = (new UriFactory)->createUriFromServer($_SERVER);
$files = (new UploadedFileFactory)->createUploadedFileFromServer($_FILES);
$... | php | public function createServerRequestFromServer(): ServerRequestInterface
{
$method = $_SERVER['REQUEST_METHOD'];
$uri = (new UriFactory)->createUriFromServer($_SERVER);
$files = (new UploadedFileFactory)->createUploadedFileFromServer($_FILES);
$... | [
"public",
"function",
"createServerRequestFromServer",
"(",
")",
":",
"ServerRequestInterface",
"{",
"$",
"method",
"=",
"$",
"_SERVER",
"[",
"'REQUEST_METHOD'",
"]",
";",
"$",
"uri",
"=",
"(",
"new",
"UriFactory",
")",
"->",
"createUriFromServer",
"(",
"$",
"... | Creates a new server-side request from server.
@return ServerRequestInterface | [
"Creates",
"a",
"new",
"server",
"-",
"side",
"request",
"from",
"server",
"."
] | 5ff81c07fbff3abed051d710f0837544465887c8 | https://github.com/davidecesarano/Embryo-Http/blob/5ff81c07fbff3abed051d710f0837544465887c8/Embryo/Http/Factory/ServerRequestFactory.php#L39-L51 |
32,563 | Vectorface/cache | src/SQLCache.php | SQLCache.get | public function get($key)
{
try {
$stmt = $this->getStatement(__METHOD__, self::GET_SQL);
$stmt->execute(array($key));
} catch (\PDOException $e) {
return false;
}
$result = $stmt->fetchColumn();
return empty($result) ? false : unserialize(... | php | public function get($key)
{
try {
$stmt = $this->getStatement(__METHOD__, self::GET_SQL);
$stmt->execute(array($key));
} catch (\PDOException $e) {
return false;
}
$result = $stmt->fetchColumn();
return empty($result) ? false : unserialize(... | [
"public",
"function",
"get",
"(",
"$",
"key",
")",
"{",
"try",
"{",
"$",
"stmt",
"=",
"$",
"this",
"->",
"getStatement",
"(",
"__METHOD__",
",",
"self",
"::",
"GET_SQL",
")",
";",
"$",
"stmt",
"->",
"execute",
"(",
"array",
"(",
"$",
"key",
")",
... | Attempt to retrieve an entry from the cache.
The value will be unserialized before it is returned.
@return mixed Returns the value stored for the given key, or false on failure. | [
"Attempt",
"to",
"retrieve",
"an",
"entry",
"from",
"the",
"cache",
"."
] | 159f4aeaf639da7a1f7e1d4e5e719a279442658b | https://github.com/Vectorface/cache/blob/159f4aeaf639da7a1f7e1d4e5e719a279442658b/src/SQLCache.php#L95-L105 |
32,564 | Vectorface/cache | src/SQLCache.php | SQLCache.clean | public function clean()
{
try {
$this->conn->exec(self::CLEAN_SQL);
} catch (\PDOException $e) {
return false;
}
return true;
} | php | public function clean()
{
try {
$this->conn->exec(self::CLEAN_SQL);
} catch (\PDOException $e) {
return false;
}
return true;
} | [
"public",
"function",
"clean",
"(",
")",
"{",
"try",
"{",
"$",
"this",
"->",
"conn",
"->",
"exec",
"(",
"self",
"::",
"CLEAN_SQL",
")",
";",
"}",
"catch",
"(",
"\\",
"PDOException",
"$",
"e",
")",
"{",
"return",
"false",
";",
"}",
"return",
"true",... | Remove any expired items from the cache.
@return bool True if successful, false otherwise. | [
"Remove",
"any",
"expired",
"items",
"from",
"the",
"cache",
"."
] | 159f4aeaf639da7a1f7e1d4e5e719a279442658b | https://github.com/Vectorface/cache/blob/159f4aeaf639da7a1f7e1d4e5e719a279442658b/src/SQLCache.php#L156-L164 |
32,565 | Vectorface/cache | src/SQLCache.php | SQLCache.flush | public function flush()
{
try {
$this->conn->exec(self::FLUSH_SQL);
} catch (\PDOException $e) {
return false;
}
return true;
} | php | public function flush()
{
try {
$this->conn->exec(self::FLUSH_SQL);
} catch (\PDOException $e) {
return false;
}
return true;
} | [
"public",
"function",
"flush",
"(",
")",
"{",
"try",
"{",
"$",
"this",
"->",
"conn",
"->",
"exec",
"(",
"self",
"::",
"FLUSH_SQL",
")",
";",
"}",
"catch",
"(",
"\\",
"PDOException",
"$",
"e",
")",
"{",
"return",
"false",
";",
"}",
"return",
"true",... | Flush the cache; Empty it of all entries.
@return bool True if successful, false otherwise. | [
"Flush",
"the",
"cache",
";",
"Empty",
"it",
"of",
"all",
"entries",
"."
] | 159f4aeaf639da7a1f7e1d4e5e719a279442658b | https://github.com/Vectorface/cache/blob/159f4aeaf639da7a1f7e1d4e5e719a279442658b/src/SQLCache.php#L171-L179 |
32,566 | Vectorface/cache | src/SQLCache.php | SQLCache.getStatement | private function getStatement($method, $sql)
{
if (empty($this->statements[$method])) {
$this->statements[$method] = $this->conn->prepare($sql);
}
return $this->statements[$method];
} | php | private function getStatement($method, $sql)
{
if (empty($this->statements[$method])) {
$this->statements[$method] = $this->conn->prepare($sql);
}
return $this->statements[$method];
} | [
"private",
"function",
"getStatement",
"(",
"$",
"method",
",",
"$",
"sql",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"statements",
"[",
"$",
"method",
"]",
")",
")",
"{",
"$",
"this",
"->",
"statements",
"[",
"$",
"method",
"]",
"=",
... | Get a prepared statement for the given method's SQL.
The result is stored internally to limit repeated preparing of SQL.
@param string $method The method name to for which this statement applies.
@param string $sql The SQL statement associated with the given method.
@return \PDOStatement Returns the prepared statemen... | [
"Get",
"a",
"prepared",
"statement",
"for",
"the",
"given",
"method",
"s",
"SQL",
"."
] | 159f4aeaf639da7a1f7e1d4e5e719a279442658b | https://github.com/Vectorface/cache/blob/159f4aeaf639da7a1f7e1d4e5e719a279442658b/src/SQLCache.php#L190-L196 |
32,567 | gocom/textpattern-installer | src/Textpattern/Composer/Installer/Plugin/Package.php | Package.find | protected function find($directory)
{
if ($iterator = parent::find($directory)) {
foreach ($iterator as $file) {
if (is_file($file) && is_readable($file) && $contents = file_get_contents($file)) {
if (preg_match($this->packageNamePattern, basename($file))) {
... | php | protected function find($directory)
{
if ($iterator = parent::find($directory)) {
foreach ($iterator as $file) {
if (is_file($file) && is_readable($file) && $contents = file_get_contents($file)) {
if (preg_match($this->packageNamePattern, basename($file))) {
... | [
"protected",
"function",
"find",
"(",
"$",
"directory",
")",
"{",
"if",
"(",
"$",
"iterator",
"=",
"parent",
"::",
"find",
"(",
"$",
"directory",
")",
")",
"{",
"foreach",
"(",
"$",
"iterator",
"as",
"$",
"file",
")",
"{",
"if",
"(",
"is_file",
"("... | Finds plugin packages.
@param string $directory
@return bool | [
"Finds",
"plugin",
"packages",
"."
] | 804271de54177ebd294a4a19d409ae7fc2317935 | https://github.com/gocom/textpattern-installer/blob/804271de54177ebd294a4a19d409ae7fc2317935/src/Textpattern/Composer/Installer/Plugin/Package.php#L47-L63 |
32,568 | davidecesarano/Embryo-Http | Embryo/Http/Message/Response.php | Response.withStatus | public function withStatus($status, $reasonPhrase = '')
{
$status = $this->filterStatus($status);
$reasonPhrase = $this->filterReasonPhrase($status, $reasonPhrase);
$clone = clone $this;
$clone->status = $status;
$clone->reasonPhrase = $reasonPhrase;
... | php | public function withStatus($status, $reasonPhrase = '')
{
$status = $this->filterStatus($status);
$reasonPhrase = $this->filterReasonPhrase($status, $reasonPhrase);
$clone = clone $this;
$clone->status = $status;
$clone->reasonPhrase = $reasonPhrase;
... | [
"public",
"function",
"withStatus",
"(",
"$",
"status",
",",
"$",
"reasonPhrase",
"=",
"''",
")",
"{",
"$",
"status",
"=",
"$",
"this",
"->",
"filterStatus",
"(",
"$",
"status",
")",
";",
"$",
"reasonPhrase",
"=",
"$",
"this",
"->",
"filterReasonPhrase",... | Returns an instance with the specified status code and, optionally, reason phrase.
@param int $status
@param string $reasonPhrase
@return static
@throws InvalidArgumentException | [
"Returns",
"an",
"instance",
"with",
"the",
"specified",
"status",
"code",
"and",
"optionally",
"reason",
"phrase",
"."
] | 5ff81c07fbff3abed051d710f0837544465887c8 | https://github.com/davidecesarano/Embryo-Http/blob/5ff81c07fbff3abed051d710f0837544465887c8/Embryo/Http/Message/Response.php#L68-L77 |
32,569 | gocom/textpattern-installer | src/Textpattern/Composer/Installer/Installer/AdminTheme.php | AdminTheme.getInstallPath | public function getInstallPath(PackageInterface $package)
{
$textpattern = new Textpattern();
$path = $textpattern->getRelativePath();
$themes = $path . '/admin-themes';
// Textpattern <= 4.5.x uses 'theme' directory.
if (!file_exists($themes)) {
$themes = $path ... | php | public function getInstallPath(PackageInterface $package)
{
$textpattern = new Textpattern();
$path = $textpattern->getRelativePath();
$themes = $path . '/admin-themes';
// Textpattern <= 4.5.x uses 'theme' directory.
if (!file_exists($themes)) {
$themes = $path ... | [
"public",
"function",
"getInstallPath",
"(",
"PackageInterface",
"$",
"package",
")",
"{",
"$",
"textpattern",
"=",
"new",
"Textpattern",
"(",
")",
";",
"$",
"path",
"=",
"$",
"textpattern",
"->",
"getRelativePath",
"(",
")",
";",
"$",
"themes",
"=",
"$",
... | Points the package to the theme directory.
@param PackageInterface $package
@return string | [
"Points",
"the",
"package",
"to",
"the",
"theme",
"directory",
"."
] | 804271de54177ebd294a4a19d409ae7fc2317935 | https://github.com/gocom/textpattern-installer/blob/804271de54177ebd294a4a19d409ae7fc2317935/src/Textpattern/Composer/Installer/Installer/AdminTheme.php#L54-L66 |
32,570 | CradlePHP/cradle-system | src/Fieldset/Validator.php | Validator.getUpdateErrors | public static function getUpdateErrors(array $data, array $errors = [])
{
if (isset($data['singular']) && empty($data['singular'])) {
$errors['singular'] = 'Singular is required';
}
if (isset($data['plural']) && empty($data['plural'])) {
$errors['plural'] = 'Plural i... | php | public static function getUpdateErrors(array $data, array $errors = [])
{
if (isset($data['singular']) && empty($data['singular'])) {
$errors['singular'] = 'Singular is required';
}
if (isset($data['plural']) && empty($data['plural'])) {
$errors['plural'] = 'Plural i... | [
"public",
"static",
"function",
"getUpdateErrors",
"(",
"array",
"$",
"data",
",",
"array",
"$",
"errors",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"data",
"[",
"'singular'",
"]",
")",
"&&",
"empty",
"(",
"$",
"data",
"[",
"'singular'",... | Returns Table Update Errors
@param *array $data
@param array $errors
@return array | [
"Returns",
"Table",
"Update",
"Errors"
] | 3dda31fbc7e4523fdcc87e18a7ab852116cbdc6c | https://github.com/CradlePHP/cradle-system/blob/3dda31fbc7e4523fdcc87e18a7ab852116cbdc6c/src/Fieldset/Validator.php#L72-L91 |
32,571 | Vectorface/cache | src/TempFileCache.php | TempFileCache.getTempDir | private function getTempDir($directory)
{
if (empty($directory) || !is_string($directory)) {
$classParts = explode("\\", get_called_class());
return sys_get_temp_dir() . '/' . end($classParts);
} elseif (strpos($directory, '/') !== 0) {
return sys_get_temp_dir() ... | php | private function getTempDir($directory)
{
if (empty($directory) || !is_string($directory)) {
$classParts = explode("\\", get_called_class());
return sys_get_temp_dir() . '/' . end($classParts);
} elseif (strpos($directory, '/') !== 0) {
return sys_get_temp_dir() ... | [
"private",
"function",
"getTempDir",
"(",
"$",
"directory",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"directory",
")",
"||",
"!",
"is_string",
"(",
"$",
"directory",
")",
")",
"{",
"$",
"classParts",
"=",
"explode",
"(",
"\"\\\\\"",
",",
"get_called_class... | Generate a consistent temporary directory based on a requested directory name.
@param string $directory The name or path of a temporary directory.
@return string The directory name, resolved to a full path. | [
"Generate",
"a",
"consistent",
"temporary",
"directory",
"based",
"on",
"a",
"requested",
"directory",
"name",
"."
] | 159f4aeaf639da7a1f7e1d4e5e719a279442658b | https://github.com/Vectorface/cache/blob/159f4aeaf639da7a1f7e1d4e5e719a279442658b/src/TempFileCache.php#L50-L60 |
32,572 | Vectorface/cache | src/TempFileCache.php | TempFileCache.getCacheFiles | private function getCacheFiles()
{
if (!($files = @scandir($this->directory, 1))) {
return false;
}
$negExtLen = -1 * strlen($this->extension);
$return = array();
foreach ($files as $file) {
if (substr($file, $negExtLen) === $this->extension) {
... | php | private function getCacheFiles()
{
if (!($files = @scandir($this->directory, 1))) {
return false;
}
$negExtLen = -1 * strlen($this->extension);
$return = array();
foreach ($files as $file) {
if (substr($file, $negExtLen) === $this->extension) {
... | [
"private",
"function",
"getCacheFiles",
"(",
")",
"{",
"if",
"(",
"!",
"(",
"$",
"files",
"=",
"@",
"scandir",
"(",
"$",
"this",
"->",
"directory",
",",
"1",
")",
")",
")",
"{",
"return",
"false",
";",
"}",
"$",
"negExtLen",
"=",
"-",
"1",
"*",
... | Finds all files with the cache extension in the cache directory
@return Array Returns an array of filenames that represent cached entries. | [
"Finds",
"all",
"files",
"with",
"the",
"cache",
"extension",
"in",
"the",
"cache",
"directory"
] | 159f4aeaf639da7a1f7e1d4e5e719a279442658b | https://github.com/Vectorface/cache/blob/159f4aeaf639da7a1f7e1d4e5e719a279442658b/src/TempFileCache.php#L166-L180 |
32,573 | gocom/textpattern-installer | src/Textpattern/Composer/Installer/Textpattern/Find.php | Find.find | public function find($directory)
{
if (($path = $this->isConfig('./textpattern/config.php')) !== false) {
return realpath($path);
}
if (!file_exists($directory) || !is_dir($directory) || !is_readable($directory)) {
return false;
}
$iterator = new \Re... | php | public function find($directory)
{
if (($path = $this->isConfig('./textpattern/config.php')) !== false) {
return realpath($path);
}
if (!file_exists($directory) || !is_dir($directory) || !is_readable($directory)) {
return false;
}
$iterator = new \Re... | [
"public",
"function",
"find",
"(",
"$",
"directory",
")",
"{",
"if",
"(",
"(",
"$",
"path",
"=",
"$",
"this",
"->",
"isConfig",
"(",
"'./textpattern/config.php'",
")",
")",
"!==",
"false",
")",
"{",
"return",
"realpath",
"(",
"$",
"path",
")",
";",
"... | Finds the closest Textpattern installation path.
@param string The directory
@return string|bool The path, or FALSE | [
"Finds",
"the",
"closest",
"Textpattern",
"installation",
"path",
"."
] | 804271de54177ebd294a4a19d409ae7fc2317935 | https://github.com/gocom/textpattern-installer/blob/804271de54177ebd294a4a19d409ae7fc2317935/src/Textpattern/Composer/Installer/Textpattern/Find.php#L74-L94 |
32,574 | gocom/textpattern-installer | src/Textpattern/Composer/Installer/Textpattern/Find.php | Find.isConfig | protected function isConfig($file)
{
if (basename($file) === 'config.php' && is_file($file) && is_readable($file)) {
$contents = file_get_contents($file);
if ($contents && strpos($contents, 'txpcfg') !== false && file_exists(dirname($file) . '/publish.php')) {
return... | php | protected function isConfig($file)
{
if (basename($file) === 'config.php' && is_file($file) && is_readable($file)) {
$contents = file_get_contents($file);
if ($contents && strpos($contents, 'txpcfg') !== false && file_exists(dirname($file) . '/publish.php')) {
return... | [
"protected",
"function",
"isConfig",
"(",
"$",
"file",
")",
"{",
"if",
"(",
"basename",
"(",
"$",
"file",
")",
"===",
"'config.php'",
"&&",
"is_file",
"(",
"$",
"file",
")",
"&&",
"is_readable",
"(",
"$",
"file",
")",
")",
"{",
"$",
"contents",
"=",
... | Whether the file is a config.php.
@param string $file The filename
@return string|bool Path to the directory, or FALSE | [
"Whether",
"the",
"file",
"is",
"a",
"config",
".",
"php",
"."
] | 804271de54177ebd294a4a19d409ae7fc2317935 | https://github.com/gocom/textpattern-installer/blob/804271de54177ebd294a4a19d409ae7fc2317935/src/Textpattern/Composer/Installer/Textpattern/Find.php#L102-L113 |
32,575 | gocom/textpattern-installer | src/Textpattern/Composer/Installer/Textpattern/Find.php | Find.getRelativePath | public function getRelativePath()
{
$current = realpath('./');
if ($current !== false && strpos(self::$path.'/', $current.'/') === 0) {
return rtrim('./' . substr(self::$path, strlen($current) + 1), '\\/');
}
throw new \InvalidArgumentException(
'Unable to r... | php | public function getRelativePath()
{
$current = realpath('./');
if ($current !== false && strpos(self::$path.'/', $current.'/') === 0) {
return rtrim('./' . substr(self::$path, strlen($current) + 1), '\\/');
}
throw new \InvalidArgumentException(
'Unable to r... | [
"public",
"function",
"getRelativePath",
"(",
")",
"{",
"$",
"current",
"=",
"realpath",
"(",
"'./'",
")",
";",
"if",
"(",
"$",
"current",
"!==",
"false",
"&&",
"strpos",
"(",
"self",
"::",
"$",
"path",
".",
"'/'",
",",
"$",
"current",
".",
"'/'",
... | Gets relative path to the Textpattern installation.
The path is relative to the current working directory.
@return string The path
@throws \InvalidArgumentException | [
"Gets",
"relative",
"path",
"to",
"the",
"Textpattern",
"installation",
"."
] | 804271de54177ebd294a4a19d409ae7fc2317935 | https://github.com/gocom/textpattern-installer/blob/804271de54177ebd294a4a19d409ae7fc2317935/src/Textpattern/Composer/Installer/Textpattern/Find.php#L123-L135 |
32,576 | peterkahl/Apple-iOS-build | src/iOSbuild.php | iOSbuild.getVersion | public static function getVersion($needle) {
self::populate();
if (array_key_exists($needle, self::$BuildVer)) {
return self::$BuildVer[$needle];
}
$builds = array();
$versions = array();
foreach (self::$BuildVer as $code => $val) {
$builds[] = $code;
$versions[] = $val;
... | php | public static function getVersion($needle) {
self::populate();
if (array_key_exists($needle, self::$BuildVer)) {
return self::$BuildVer[$needle];
}
$builds = array();
$versions = array();
foreach (self::$BuildVer as $code => $val) {
$builds[] = $code;
$versions[] = $val;
... | [
"public",
"static",
"function",
"getVersion",
"(",
"$",
"needle",
")",
"{",
"self",
"::",
"populate",
"(",
")",
";",
"if",
"(",
"array_key_exists",
"(",
"$",
"needle",
",",
"self",
"::",
"$",
"BuildVer",
")",
")",
"{",
"return",
"self",
"::",
"$",
"B... | Takes iOS build code and returns corresponding iOS version.
@param string $needle
@return mixed
@throws \Exception | [
"Takes",
"iOS",
"build",
"code",
"and",
"returns",
"corresponding",
"iOS",
"version",
"."
] | 90c0e0db5e87f2f4487048ecb6b81a3395e33cab | https://github.com/peterkahl/Apple-iOS-build/blob/90c0e0db5e87f2f4487048ecb6b81a3395e33cab/src/iOSbuild.php#L49-L78 |
32,577 | peterkahl/Apple-iOS-build | src/iOSbuild.php | iOSbuild.populate | private static function populate() {
$arr = array();
$epoch = 0;
if (!isset(self::$BuildVer) || !is_array(self::$BuildVer)) {
require __DIR__ .'/data.php';
if (empty($arr) || !is_array($arr) || empty($epoch)) {
throw new \Exception('Error fetching file data.php');
}
self::$Da... | php | private static function populate() {
$arr = array();
$epoch = 0;
if (!isset(self::$BuildVer) || !is_array(self::$BuildVer)) {
require __DIR__ .'/data.php';
if (empty($arr) || !is_array($arr) || empty($epoch)) {
throw new \Exception('Error fetching file data.php');
}
self::$Da... | [
"private",
"static",
"function",
"populate",
"(",
")",
"{",
"$",
"arr",
"=",
"array",
"(",
")",
";",
"$",
"epoch",
"=",
"0",
";",
"if",
"(",
"!",
"isset",
"(",
"self",
"::",
"$",
"BuildVer",
")",
"||",
"!",
"is_array",
"(",
"self",
"::",
"$",
"... | Populates associative array of iOS versions.
@throws \Exception | [
"Populates",
"associative",
"array",
"of",
"iOS",
"versions",
"."
] | 90c0e0db5e87f2f4487048ecb6b81a3395e33cab | https://github.com/peterkahl/Apple-iOS-build/blob/90c0e0db5e87f2f4487048ecb6b81a3395e33cab/src/iOSbuild.php#L87-L98 |
32,578 | peterkahl/Apple-iOS-build | src/iOSbuild.php | iOSbuild.getCalendarUA | public static function getCalendarUA($min = '5.0') {
if (strpos($min, '.') === false && ctype_digit($min)) {
$mins[0] = $min;
$mins[1] = 0;
}
else {
$mins = explode('.', $min);
}
$builds = array();
$versions = array();
$n = 0;
self::populate();
foreach (sel... | php | public static function getCalendarUA($min = '5.0') {
if (strpos($min, '.') === false && ctype_digit($min)) {
$mins[0] = $min;
$mins[1] = 0;
}
else {
$mins = explode('.', $min);
}
$builds = array();
$versions = array();
$n = 0;
self::populate();
foreach (sel... | [
"public",
"static",
"function",
"getCalendarUA",
"(",
"$",
"min",
"=",
"'5.0'",
")",
"{",
"if",
"(",
"strpos",
"(",
"$",
"min",
",",
"'.'",
")",
"===",
"false",
"&&",
"ctype_digit",
"(",
"$",
"min",
")",
")",
"{",
"$",
"mins",
"[",
"0",
"]",
"=",... | Returns a randomly chosen iOS Calendar User Agent string.
@param string $min .... minimum version
Format: 'MAJOR.MINOR' (1 dot only)
@return string
@throws \Exception | [
"Returns",
"a",
"randomly",
"chosen",
"iOS",
"Calendar",
"User",
"Agent",
"string",
"."
] | 90c0e0db5e87f2f4487048ecb6b81a3395e33cab | https://github.com/peterkahl/Apple-iOS-build/blob/90c0e0db5e87f2f4487048ecb6b81a3395e33cab/src/iOSbuild.php#L133-L156 |
32,579 | davidecesarano/Embryo-Http | Embryo/Http/Message/Traits/ResponseTrait.php | ResponseTrait.filterStatus | protected function filterStatus(int $status)
{
$messages = $this->getMessages();
if (!isset($messages[$status])) {
throw new \InvalidArgumentException('Invalid HTTP status code');
}
return $status;
} | php | protected function filterStatus(int $status)
{
$messages = $this->getMessages();
if (!isset($messages[$status])) {
throw new \InvalidArgumentException('Invalid HTTP status code');
}
return $status;
} | [
"protected",
"function",
"filterStatus",
"(",
"int",
"$",
"status",
")",
"{",
"$",
"messages",
"=",
"$",
"this",
"->",
"getMessages",
"(",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"messages",
"[",
"$",
"status",
"]",
")",
")",
"{",
"throw",
"ne... | Validates Http status code.
@param int $status
@return int
@throws InvalidArgumentException | [
"Validates",
"Http",
"status",
"code",
"."
] | 5ff81c07fbff3abed051d710f0837544465887c8 | https://github.com/davidecesarano/Embryo-Http/blob/5ff81c07fbff3abed051d710f0837544465887c8/Embryo/Http/Message/Traits/ResponseTrait.php#L103-L110 |
32,580 | davidecesarano/Embryo-Http | Embryo/Http/Message/Traits/ResponseTrait.php | ResponseTrait.filterReasonPhrase | protected function filterReasonPhrase(int $status, string $reasonPhrase = '')
{
$messages = $this->getMessages();
if ($reasonPhrase === '' && isset($messages[$status])) {
$reasonPhrase = $messages[$status];
}
return $reasonPhrase;
} | php | protected function filterReasonPhrase(int $status, string $reasonPhrase = '')
{
$messages = $this->getMessages();
if ($reasonPhrase === '' && isset($messages[$status])) {
$reasonPhrase = $messages[$status];
}
return $reasonPhrase;
} | [
"protected",
"function",
"filterReasonPhrase",
"(",
"int",
"$",
"status",
",",
"string",
"$",
"reasonPhrase",
"=",
"''",
")",
"{",
"$",
"messages",
"=",
"$",
"this",
"->",
"getMessages",
"(",
")",
";",
"if",
"(",
"$",
"reasonPhrase",
"===",
"''",
"&&",
... | Validates Http status reason phrase
@param int $status
@param string $reasonPhrase
@return string
@throws InvalidArgumentException | [
"Validates",
"Http",
"status",
"reason",
"phrase"
] | 5ff81c07fbff3abed051d710f0837544465887c8 | https://github.com/davidecesarano/Embryo-Http/blob/5ff81c07fbff3abed051d710f0837544465887c8/Embryo/Http/Message/Traits/ResponseTrait.php#L120-L127 |
32,581 | davidecesarano/Embryo-Http | Embryo/Http/Message/Traits/ResponseTrait.php | ResponseTrait.withRedirect | public function withRedirect($url, $status = null)
{
$response = $this->withHeader('Location', (string)$url);
if (is_null($status) && $this->getStatusCode() === 200) {
$status = 302;
}
if (!is_null($status)) {
return $response->with... | php | public function withRedirect($url, $status = null)
{
$response = $this->withHeader('Location', (string)$url);
if (is_null($status) && $this->getStatusCode() === 200) {
$status = 302;
}
if (!is_null($status)) {
return $response->with... | [
"public",
"function",
"withRedirect",
"(",
"$",
"url",
",",
"$",
"status",
"=",
"null",
")",
"{",
"$",
"response",
"=",
"$",
"this",
"->",
"withHeader",
"(",
"'Location'",
",",
"(",
"string",
")",
"$",
"url",
")",
";",
"if",
"(",
"is_null",
"(",
"$... | Prepares the response object to return an HTTP redirect
response to the client.
@param string|UriInterface $url
@param int|null $status
@return static | [
"Prepares",
"the",
"response",
"object",
"to",
"return",
"an",
"HTTP",
"redirect",
"response",
"to",
"the",
"client",
"."
] | 5ff81c07fbff3abed051d710f0837544465887c8 | https://github.com/davidecesarano/Embryo-Http/blob/5ff81c07fbff3abed051d710f0837544465887c8/Embryo/Http/Message/Traits/ResponseTrait.php#L149-L159 |
32,582 | davidecesarano/Embryo-Http | Embryo/Http/Message/Traits/ResponseTrait.php | ResponseTrait.withJson | public function withJson($data, int $status = null, int $options = 0)
{
$json = json_encode($data, $options);
if ($json === false) {
throw new \RuntimeException(json_last_error_msg(), json_last_error());
}
$response = $this->write($jso... | php | public function withJson($data, int $status = null, int $options = 0)
{
$json = json_encode($data, $options);
if ($json === false) {
throw new \RuntimeException(json_last_error_msg(), json_last_error());
}
$response = $this->write($jso... | [
"public",
"function",
"withJson",
"(",
"$",
"data",
",",
"int",
"$",
"status",
"=",
"null",
",",
"int",
"$",
"options",
"=",
"0",
")",
"{",
"$",
"json",
"=",
"json_encode",
"(",
"$",
"data",
",",
"$",
"options",
")",
";",
"if",
"(",
"$",
"json",
... | Prepares the response object to return an HTTP json
response to the client.
@param mixed $data
@param int $status
@param int $options
@return static
@throws RuntimeException | [
"Prepares",
"the",
"response",
"object",
"to",
"return",
"an",
"HTTP",
"json",
"response",
"to",
"the",
"client",
"."
] | 5ff81c07fbff3abed051d710f0837544465887c8 | https://github.com/davidecesarano/Embryo-Http/blob/5ff81c07fbff3abed051d710f0837544465887c8/Embryo/Http/Message/Traits/ResponseTrait.php#L171-L185 |
32,583 | flipboxfactory/craft-ember | src/elements/ExplicitElementTrait.php | ExplicitElementTrait.getOne | public static function getOne($criteria)
{
if (null === ($element = static::findOne($criteria))) {
throw new ElementNotFoundException(
sprintf(
"Organization not found with the following criteria: %s",
Json::encode($criteria)
... | php | public static function getOne($criteria)
{
if (null === ($element = static::findOne($criteria))) {
throw new ElementNotFoundException(
sprintf(
"Organization not found with the following criteria: %s",
Json::encode($criteria)
... | [
"public",
"static",
"function",
"getOne",
"(",
"$",
"criteria",
")",
"{",
"if",
"(",
"null",
"===",
"(",
"$",
"element",
"=",
"static",
"::",
"findOne",
"(",
"$",
"criteria",
")",
")",
")",
"{",
"throw",
"new",
"ElementNotFoundException",
"(",
"sprintf",... | Returns a single element instance by a primary key or a set of element criteria parameters.
The method accepts:
- an int: query by a single ID value and return the corresponding element (or null if not found).
- an array of name-value pairs: query by a set of parameter values and return the first element
matching all... | [
"Returns",
"a",
"single",
"element",
"instance",
"by",
"a",
"primary",
"key",
"or",
"a",
"set",
"of",
"element",
"criteria",
"parameters",
"."
] | 9185b885b404b1cb272a0983023eb7c6c0df61c8 | https://github.com/flipboxfactory/craft-ember/blob/9185b885b404b1cb272a0983023eb7c6c0df61c8/src/elements/ExplicitElementTrait.php#L112-L124 |
32,584 | Vectorface/cache | src/TieredCache.php | TieredCache.get | public function get($entry)
{
$value = false;
foreach ($this->caches as $cache) {
$value = $cache->get($entry);
if ($value !== false) {
return $value;
}
}
return $value;
} | php | public function get($entry)
{
$value = false;
foreach ($this->caches as $cache) {
$value = $cache->get($entry);
if ($value !== false) {
return $value;
}
}
return $value;
} | [
"public",
"function",
"get",
"(",
"$",
"entry",
")",
"{",
"$",
"value",
"=",
"false",
";",
"foreach",
"(",
"$",
"this",
"->",
"caches",
"as",
"$",
"cache",
")",
"{",
"$",
"value",
"=",
"$",
"cache",
"->",
"get",
"(",
"$",
"entry",
")",
";",
"if... | Get an entry from the first cache that can provide a value.
@param string $entry The cache key.
@return mixed The cached value, or FALSE if not found. | [
"Get",
"an",
"entry",
"from",
"the",
"first",
"cache",
"that",
"can",
"provide",
"a",
"value",
"."
] | 159f4aeaf639da7a1f7e1d4e5e719a279442658b | https://github.com/Vectorface/cache/blob/159f4aeaf639da7a1f7e1d4e5e719a279442658b/src/TieredCache.php#L63-L74 |
32,585 | Vectorface/cache | src/TieredCache.php | TieredCache.set | public function set($entry, $value, $ttl = false)
{
$setCallback = function ($setSuccess, $cache) use ($entry, $value, $ttl) {
return $setSuccess || $cache->set($entry, $value, $ttl);
};
return array_reduce($this->caches, $setCallback, false);
} | php | public function set($entry, $value, $ttl = false)
{
$setCallback = function ($setSuccess, $cache) use ($entry, $value, $ttl) {
return $setSuccess || $cache->set($entry, $value, $ttl);
};
return array_reduce($this->caches, $setCallback, false);
} | [
"public",
"function",
"set",
"(",
"$",
"entry",
",",
"$",
"value",
",",
"$",
"ttl",
"=",
"false",
")",
"{",
"$",
"setCallback",
"=",
"function",
"(",
"$",
"setSuccess",
",",
"$",
"cache",
")",
"use",
"(",
"$",
"entry",
",",
"$",
"value",
",",
"$"... | Set an entry in all caches in the stack.
@param string $entry The cache key.
@param mixed $value The value to be stored.
@param int $ttl The time-to-live for the cache entry.
@return bool Returns true if saving succeeded to any cache in the stack. | [
"Set",
"an",
"entry",
"in",
"all",
"caches",
"in",
"the",
"stack",
"."
] | 159f4aeaf639da7a1f7e1d4e5e719a279442658b | https://github.com/Vectorface/cache/blob/159f4aeaf639da7a1f7e1d4e5e719a279442658b/src/TieredCache.php#L84-L90 |
32,586 | Vectorface/cache | src/TieredCache.php | TieredCache.clean | public function clean()
{
$cleanCallback = function ($allCleaned, $cache) {
return $allCleaned && $cache->clean();
};
return array_reduce($this->caches, $cleanCallback, true);
} | php | public function clean()
{
$cleanCallback = function ($allCleaned, $cache) {
return $allCleaned && $cache->clean();
};
return array_reduce($this->caches, $cleanCallback, true);
} | [
"public",
"function",
"clean",
"(",
")",
"{",
"$",
"cleanCallback",
"=",
"function",
"(",
"$",
"allCleaned",
",",
"$",
"cache",
")",
"{",
"return",
"$",
"allCleaned",
"&&",
"$",
"cache",
"->",
"clean",
"(",
")",
";",
"}",
";",
"return",
"array_reduce",... | Perform a clean operation on all caches.
@return bool Returns true if clean succeeded on all caches in the stack. | [
"Perform",
"a",
"clean",
"operation",
"on",
"all",
"caches",
"."
] | 159f4aeaf639da7a1f7e1d4e5e719a279442658b | https://github.com/Vectorface/cache/blob/159f4aeaf639da7a1f7e1d4e5e719a279442658b/src/TieredCache.php#L111-L117 |
32,587 | Vectorface/cache | src/TieredCache.php | TieredCache.flush | public function flush()
{
$flushCallback = function ($allFlushed, $cache) {
return $allFlushed && $cache->flush();
};
return array_reduce($this->caches, $flushCallback, true);
} | php | public function flush()
{
$flushCallback = function ($allFlushed, $cache) {
return $allFlushed && $cache->flush();
};
return array_reduce($this->caches, $flushCallback, true);
} | [
"public",
"function",
"flush",
"(",
")",
"{",
"$",
"flushCallback",
"=",
"function",
"(",
"$",
"allFlushed",
",",
"$",
"cache",
")",
"{",
"return",
"$",
"allFlushed",
"&&",
"$",
"cache",
"->",
"flush",
"(",
")",
";",
"}",
";",
"return",
"array_reduce",... | Perform a flush operation on all caches.
@return bool Returns true if flush succeeded on all caches in the stack. | [
"Perform",
"a",
"flush",
"operation",
"on",
"all",
"caches",
"."
] | 159f4aeaf639da7a1f7e1d4e5e719a279442658b | https://github.com/Vectorface/cache/blob/159f4aeaf639da7a1f7e1d4e5e719a279442658b/src/TieredCache.php#L124-L130 |
32,588 | flipboxfactory/craft-ember | src/objects/ElementMutatorTrait.php | ElementMutatorTrait.setElement | public function setElement($element = null)
{
$this->element = null;
if (!$element = $this->internalResolveElement($element)) {
$this->element = $this->elementId = null;
} else {
/** @var Element $element */
$this->elementId = $element->id;
$t... | php | public function setElement($element = null)
{
$this->element = null;
if (!$element = $this->internalResolveElement($element)) {
$this->element = $this->elementId = null;
} else {
/** @var Element $element */
$this->elementId = $element->id;
$t... | [
"public",
"function",
"setElement",
"(",
"$",
"element",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"element",
"=",
"null",
";",
"if",
"(",
"!",
"$",
"element",
"=",
"$",
"this",
"->",
"internalResolveElement",
"(",
"$",
"element",
")",
")",
"{",
"$",... | Associate a element
@param mixed $element
@return $this | [
"Associate",
"a",
"element"
] | 9185b885b404b1cb272a0983023eb7c6c0df61c8 | https://github.com/flipboxfactory/craft-ember/blob/9185b885b404b1cb272a0983023eb7c6c0df61c8/src/objects/ElementMutatorTrait.php#L61-L74 |
32,589 | arillo/silverstripe-elements | src/ElementsExtension.php | ElementsExtension.move_elements_manager | public static function move_elements_manager(
FieldList $fields,
string $relationName,
string $newTabName = 'Root.Main',
string $insertBefore = null
): FieldList
{
$itemsGf = $fields->dataFieldByName($relationName);
$fields
->removeByName($relationName... | php | public static function move_elements_manager(
FieldList $fields,
string $relationName,
string $newTabName = 'Root.Main',
string $insertBefore = null
): FieldList
{
$itemsGf = $fields->dataFieldByName($relationName);
$fields
->removeByName($relationName... | [
"public",
"static",
"function",
"move_elements_manager",
"(",
"FieldList",
"$",
"fields",
",",
"string",
"$",
"relationName",
",",
"string",
"$",
"newTabName",
"=",
"'Root.Main'",
",",
"string",
"$",
"insertBefore",
"=",
"null",
")",
":",
"FieldList",
"{",
"$"... | Move an elements gridfield to an other tab.
@param FieldList $fields
@param string $relationName
@param string $newTabName
@param string $insertBefore optional: insert before an other field
@return FieldList the altered fields | [
"Move",
"an",
"elements",
"gridfield",
"to",
"an",
"other",
"tab",
"."
] | faa95a6487efe6e28101db5319529aa7e575fa90 | https://github.com/arillo/silverstripe-elements/blob/faa95a6487efe6e28101db5319529aa7e575fa90/src/ElementsExtension.php#L86-L100 |
32,590 | arillo/silverstripe-elements | src/ElementsExtension.php | ElementsExtension.create_default_elements | public static function create_default_elements(SiteTree $record): int
{
$count = 0;
if (!$record || !$record->ID)
{
throw new SS_HTTPResponse_Exception("Bad record ID #" . (int)$data['ID'], 404);
}
if ($relationNames = ElementsExtension::page_element_relation_nam... | php | public static function create_default_elements(SiteTree $record): int
{
$count = 0;
if (!$record || !$record->ID)
{
throw new SS_HTTPResponse_Exception("Bad record ID #" . (int)$data['ID'], 404);
}
if ($relationNames = ElementsExtension::page_element_relation_nam... | [
"public",
"static",
"function",
"create_default_elements",
"(",
"SiteTree",
"$",
"record",
")",
":",
"int",
"{",
"$",
"count",
"=",
"0",
";",
"if",
"(",
"!",
"$",
"record",
"||",
"!",
"$",
"record",
"->",
"ID",
")",
"{",
"throw",
"new",
"SS_HTTPRespons... | Create_default elements , if setup via config @see self::getDefaultElements().
@param SiteTree $record
@return int | [
"Create_default",
"elements",
"if",
"setup",
"via",
"config"
] | faa95a6487efe6e28101db5319529aa7e575fa90 | https://github.com/arillo/silverstripe-elements/blob/faa95a6487efe6e28101db5319529aa7e575fa90/src/ElementsExtension.php#L107-L141 |
32,591 | arillo/silverstripe-elements | src/ElementsExtension.php | ElementsExtension.validate_class_inheritance | public static function validate_class_inheritance(array $relation): array
{
return array_filter($relation, function($className)
{
if (
ClassInfo::exists($className)
&& (is_a(singleton($className), ElementBase::class))
) {
return... | php | public static function validate_class_inheritance(array $relation): array
{
return array_filter($relation, function($className)
{
if (
ClassInfo::exists($className)
&& (is_a(singleton($className), ElementBase::class))
) {
return... | [
"public",
"static",
"function",
"validate_class_inheritance",
"(",
"array",
"$",
"relation",
")",
":",
"array",
"{",
"return",
"array_filter",
"(",
"$",
"relation",
",",
"function",
"(",
"$",
"className",
")",
"{",
"if",
"(",
"ClassInfo",
"::",
"exists",
"("... | Check if all provied classes derive from ElementBase.
@param array $relation
@return array | [
"Check",
"if",
"all",
"provied",
"classes",
"derive",
"from",
"ElementBase",
"."
] | faa95a6487efe6e28101db5319529aa7e575fa90 | https://github.com/arillo/silverstripe-elements/blob/faa95a6487efe6e28101db5319529aa7e575fa90/src/ElementsExtension.php#L148-L160 |
32,592 | arillo/silverstripe-elements | src/ElementsExtension.php | ElementsExtension.onAfterDelete | public function onAfterDelete()
{
$staged = Versioned::get_by_stage($this->owner->ClassName, Versioned::DRAFT)
->byID($this->owner->ID)
;
$live = Versioned::get_by_stage($this->owner->ClassName, Versioned::LIVE)
->byID($this->owner->ID)
;
if (!$stage... | php | public function onAfterDelete()
{
$staged = Versioned::get_by_stage($this->owner->ClassName, Versioned::DRAFT)
->byID($this->owner->ID)
;
$live = Versioned::get_by_stage($this->owner->ClassName, Versioned::LIVE)
->byID($this->owner->ID)
;
if (!$stage... | [
"public",
"function",
"onAfterDelete",
"(",
")",
"{",
"$",
"staged",
"=",
"Versioned",
"::",
"get_by_stage",
"(",
"$",
"this",
"->",
"owner",
"->",
"ClassName",
",",
"Versioned",
"::",
"DRAFT",
")",
"->",
"byID",
"(",
"$",
"this",
"->",
"owner",
"->",
... | Remove all related elements | [
"Remove",
"all",
"related",
"elements"
] | faa95a6487efe6e28101db5319529aa7e575fa90 | https://github.com/arillo/silverstripe-elements/blob/faa95a6487efe6e28101db5319529aa7e575fa90/src/ElementsExtension.php#L273-L293 |
32,593 | arillo/silverstripe-elements | src/ElementsExtension.php | ElementsExtension.ElementsByRelation | public function ElementsByRelation(string $relationName)
{
$filter = [ 'RelationName' => $relationName ];
if (
$this->owner->hasExtension(ElementBase::FLUENT_CLASS)
&& !is_a(Controller::curr(), LeftAndMain::class)
) {
$filter['Visible'] = true;
}
... | php | public function ElementsByRelation(string $relationName)
{
$filter = [ 'RelationName' => $relationName ];
if (
$this->owner->hasExtension(ElementBase::FLUENT_CLASS)
&& !is_a(Controller::curr(), LeftAndMain::class)
) {
$filter['Visible'] = true;
}
... | [
"public",
"function",
"ElementsByRelation",
"(",
"string",
"$",
"relationName",
")",
"{",
"$",
"filter",
"=",
"[",
"'RelationName'",
"=>",
"$",
"relationName",
"]",
";",
"if",
"(",
"$",
"this",
"->",
"owner",
"->",
"hasExtension",
"(",
"ElementBase",
"::",
... | Getter for items by relation name
@param string $relationName
@return DataList | [
"Getter",
"for",
"items",
"by",
"relation",
"name"
] | faa95a6487efe6e28101db5319529aa7e575fa90 | https://github.com/arillo/silverstripe-elements/blob/faa95a6487efe6e28101db5319529aa7e575fa90/src/ElementsExtension.php#L324-L338 |
32,594 | arillo/silverstripe-elements | src/ElementsExtension.php | ElementsExtension.gridFieldForElementRelation | public function gridFieldForElementRelation(
FieldList $fields,
$relationName,
$relation
) {
// sort relations
asort($relation);
$config = GridFieldConfig_RelationEditor::create()
->removeComponentsByType(GridFieldDeleteAction::class)
->remove... | php | public function gridFieldForElementRelation(
FieldList $fields,
$relationName,
$relation
) {
// sort relations
asort($relation);
$config = GridFieldConfig_RelationEditor::create()
->removeComponentsByType(GridFieldDeleteAction::class)
->remove... | [
"public",
"function",
"gridFieldForElementRelation",
"(",
"FieldList",
"$",
"fields",
",",
"$",
"relationName",
",",
"$",
"relation",
")",
"{",
"// sort relations",
"asort",
"(",
"$",
"relation",
")",
";",
"$",
"config",
"=",
"GridFieldConfig_RelationEditor",
"::"... | Adds a GridField for a elements relation
@param FieldList $fields
@param string $relationName
@return DataObject | [
"Adds",
"a",
"GridField",
"for",
"a",
"elements",
"relation"
] | faa95a6487efe6e28101db5319529aa7e575fa90 | https://github.com/arillo/silverstripe-elements/blob/faa95a6487efe6e28101db5319529aa7e575fa90/src/ElementsExtension.php#L347-L443 |
32,595 | jmikola/WildcardEventDispatcher | src/Jmikola/WildcardEventDispatcher/LazyListenerPattern.php | LazyListenerPattern.getListener | public function getListener()
{
if (!isset($this->listener) && isset($this->listenerProvider)) {
$this->listener = call_user_func($this->listenerProvider);
unset($this->listenerProvider);
}
return $this->listener;
} | php | public function getListener()
{
if (!isset($this->listener) && isset($this->listenerProvider)) {
$this->listener = call_user_func($this->listenerProvider);
unset($this->listenerProvider);
}
return $this->listener;
} | [
"public",
"function",
"getListener",
"(",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"listener",
")",
"&&",
"isset",
"(",
"$",
"this",
"->",
"listenerProvider",
")",
")",
"{",
"$",
"this",
"->",
"listener",
"=",
"call_user_func",
"(",
... | Get the pattern listener, initializing it lazily from its provider.
@return callback | [
"Get",
"the",
"pattern",
"listener",
"initializing",
"it",
"lazily",
"from",
"its",
"provider",
"."
] | cc3257181cfc25a025b049348c5f9053e83ec627 | https://github.com/jmikola/WildcardEventDispatcher/blob/cc3257181cfc25a025b049348c5f9053e83ec627/src/Jmikola/WildcardEventDispatcher/LazyListenerPattern.php#L36-L44 |
32,596 | JanDC/css-from-html-extractor | src/Css/Processor.php | Processor.getCssFromStyleTags | public function getCssFromStyleTags($html)
{
$css = '';
$matches = array();
preg_match_all('|<style(?:\s.*)?>(.*)</style>|isU', $html, $matches);
if (!empty($matches[1])) {
foreach ($matches[1] as $match) {
$css .= trim($match) . "\n";
}
... | php | public function getCssFromStyleTags($html)
{
$css = '';
$matches = array();
preg_match_all('|<style(?:\s.*)?>(.*)</style>|isU', $html, $matches);
if (!empty($matches[1])) {
foreach ($matches[1] as $match) {
$css .= trim($match) . "\n";
}
... | [
"public",
"function",
"getCssFromStyleTags",
"(",
"$",
"html",
")",
"{",
"$",
"css",
"=",
"''",
";",
"$",
"matches",
"=",
"array",
"(",
")",
";",
"preg_match_all",
"(",
"'|<style(?:\\s.*)?>(.*)</style>|isU'",
",",
"$",
"html",
",",
"$",
"matches",
")",
";"... | Get the CSS from the style-tags in the given HTML-string
@param string $html
@return string | [
"Get",
"the",
"CSS",
"from",
"the",
"style",
"-",
"tags",
"in",
"the",
"given",
"HTML",
"-",
"string"
] | e471a1e9ea00f800cb20e014079050cb2d9ad57c | https://github.com/JanDC/css-from-html-extractor/blob/e471a1e9ea00f800cb20e014079050cb2d9ad57c/src/Css/Processor.php#L43-L56 |
32,597 | Vectorface/cache | src/PHPCache.php | PHPCache.get | public function get($key)
{
if (isset($this->cache[$key])) {
list($expires, $value) = $this->cache[$key];
if (!$expires || ($expires >= microtime(true))) {
return $value;
}
unset($this->cache[$key]);
}
return false;
} | php | public function get($key)
{
if (isset($this->cache[$key])) {
list($expires, $value) = $this->cache[$key];
if (!$expires || ($expires >= microtime(true))) {
return $value;
}
unset($this->cache[$key]);
}
return false;
} | [
"public",
"function",
"get",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"cache",
"[",
"$",
"key",
"]",
")",
")",
"{",
"list",
"(",
"$",
"expires",
",",
"$",
"value",
")",
"=",
"$",
"this",
"->",
"cache",
"[",
"$",
... | Fetch a cache entry by key.
@param String $key The key for the entry to fetch
@return mixed The value stored in the cache for $key | [
"Fetch",
"a",
"cache",
"entry",
"by",
"key",
"."
] | 159f4aeaf639da7a1f7e1d4e5e719a279442658b | https://github.com/Vectorface/cache/blob/159f4aeaf639da7a1f7e1d4e5e719a279442658b/src/PHPCache.php#L30-L40 |
32,598 | czim/laravel-processor | src/AbstractProcessor.php | AbstractProcessor.process | public function process(DataObjectInterface $data = null)
{
if ( ! is_null($data)) {
$this->data = $data;
}
$this->before();
$this->doProcessing();
$this->after();
return $this->getResult();
} | php | public function process(DataObjectInterface $data = null)
{
if ( ! is_null($data)) {
$this->data = $data;
}
$this->before();
$this->doProcessing();
$this->after();
return $this->getResult();
} | [
"public",
"function",
"process",
"(",
"DataObjectInterface",
"$",
"data",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"is_null",
"(",
"$",
"data",
")",
")",
"{",
"$",
"this",
"->",
"data",
"=",
"$",
"data",
";",
"}",
"$",
"this",
"->",
"before",
"(",
... | Process the data sent
@param DataObjectInterface $data
@return ProcessorResult | [
"Process",
"the",
"data",
"sent"
] | 3d0025cd463653b7a8981ff52cebdafbe978f000 | https://github.com/czim/laravel-processor/blob/3d0025cd463653b7a8981ff52cebdafbe978f000/src/AbstractProcessor.php#L62-L75 |
32,599 | czim/laravel-processor | src/AbstractProcessor.php | AbstractProcessor.setExtraData | public function setExtraData($data)
{
if (is_a($data, Arrayable::class)) {
$data = $data->toArray();
}
if ( ! is_array($data)) {
$data = [ $data ];
}
$this->extraData = $data;
return $this;
} | php | public function setExtraData($data)
{
if (is_a($data, Arrayable::class)) {
$data = $data->toArray();
}
if ( ! is_array($data)) {
$data = [ $data ];
}
$this->extraData = $data;
return $this;
} | [
"public",
"function",
"setExtraData",
"(",
"$",
"data",
")",
"{",
"if",
"(",
"is_a",
"(",
"$",
"data",
",",
"Arrayable",
"::",
"class",
")",
")",
"{",
"$",
"data",
"=",
"$",
"data",
"->",
"toArray",
"(",
")",
";",
"}",
"if",
"(",
"!",
"is_array",... | Set extra data that the processor should use during the import
@param array|Arrayable $data
@return $this | [
"Set",
"extra",
"data",
"that",
"the",
"processor",
"should",
"use",
"during",
"the",
"import"
] | 3d0025cd463653b7a8981ff52cebdafbe978f000 | https://github.com/czim/laravel-processor/blob/3d0025cd463653b7a8981ff52cebdafbe978f000/src/AbstractProcessor.php#L84-L97 |
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.