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
13,500
ronan-gloo/jade-php
src/Jade/Lexer.php
Lexer.scan
protected function scan($regex, $type) { if (preg_match($regex, $this->input, $matches)) { $this->consume($matches[0]); return $this->token($type, isset($matches[1]) && mb_strlen($matches[1]) > 0 ? $matches[1] : ''); } }
php
protected function scan($regex, $type) { if (preg_match($regex, $this->input, $matches)) { $this->consume($matches[0]); return $this->token($type, isset($matches[1]) && mb_strlen($matches[1]) > 0 ? $matches[1] : ''); } }
[ "protected", "function", "scan", "(", "$", "regex", ",", "$", "type", ")", "{", "if", "(", "preg_match", "(", "$", "regex", ",", "$", "this", "->", "input", ",", "$", "matches", ")", ")", "{", "$", "this", "->", "consume", "(", "$", "matches", "[...
Helper to create tokens
[ "Helper", "to", "create", "tokens" ]
77230d2eef2f0d4f045292a5906162f0c0499421
https://github.com/ronan-gloo/jade-php/blob/77230d2eef2f0d4f045292a5906162f0c0499421/src/Jade/Lexer.php#L111-L118
13,501
ronan-gloo/jade-php
src/Jade/Lexer.php
Lexer.lookahead
public function lookahead($number = 1) { $fetch = $number - count($this->stash); while ($fetch-- > 0) { $this->stash[] = $this->next(); } return $this->stash[--$number]; }
php
public function lookahead($number = 1) { $fetch = $number - count($this->stash); while ($fetch-- > 0) { $this->stash[] = $this->next(); } return $this->stash[--$number]; }
[ "public", "function", "lookahead", "(", "$", "number", "=", "1", ")", "{", "$", "fetch", "=", "$", "number", "-", "count", "(", "$", "this", "->", "stash", ")", ";", "while", "(", "$", "fetch", "--", ">", "0", ")", "{", "$", "this", "->", "stas...
Lookahead token 'n'. @param integer $number number of tokens to predict @return Object predicted token
[ "Lookahead", "token", "n", "." ]
77230d2eef2f0d4f045292a5906162f0c0499421
https://github.com/ronan-gloo/jade-php/blob/77230d2eef2f0d4f045292a5906162f0c0499421/src/Jade/Lexer.php#L137-L146
13,502
ronan-gloo/jade-php
src/Jade/Lexer.php
Lexer.scanEOS
protected function scanEOS() { if (!$this->length()) { if (count($this->indentStack)) { array_shift($this->indentStack); return $this->token('outdent'); } return $this->token('eos'); } }
php
protected function scanEOS() { if (!$this->length()) { if (count($this->indentStack)) { array_shift($this->indentStack); return $this->token('outdent'); } return $this->token('eos'); } }
[ "protected", "function", "scanEOS", "(", ")", "{", "if", "(", "!", "$", "this", "->", "length", "(", ")", ")", "{", "if", "(", "count", "(", "$", "this", "->", "indentStack", ")", ")", "{", "array_shift", "(", "$", "this", "->", "indentStack", ")",...
Scan EOS from input & return it if found. @return Object|null
[ "Scan", "EOS", "from", "input", "&", "return", "it", "if", "found", "." ]
77230d2eef2f0d4f045292a5906162f0c0499421
https://github.com/ronan-gloo/jade-php/blob/77230d2eef2f0d4f045292a5906162f0c0499421/src/Jade/Lexer.php#L196-L208
13,503
ronan-gloo/jade-php
src/Jade/Lexer.php
Lexer.scanComment
protected function scanComment() { if (preg_match('/^ *\/\/(-)?([^\n]*)/', $this->input, $matches)) { $this->consume($matches[0]); $token = $this->token('comment', isset($matches[2]) ? $matches[2] : ''); $token->buffer = '-' !== $matches[1]; return $t...
php
protected function scanComment() { if (preg_match('/^ *\/\/(-)?([^\n]*)/', $this->input, $matches)) { $this->consume($matches[0]); $token = $this->token('comment', isset($matches[2]) ? $matches[2] : ''); $token->buffer = '-' !== $matches[1]; return $t...
[ "protected", "function", "scanComment", "(", ")", "{", "if", "(", "preg_match", "(", "'/^ *\\/\\/(-)?([^\\n]*)/'", ",", "$", "this", "->", "input", ",", "$", "matches", ")", ")", "{", "$", "this", "->", "consume", "(", "$", "matches", "[", "0", "]", ")...
Scan comment from input & return it if found. @return Object|null
[ "Scan", "comment", "from", "input", "&", "return", "it", "if", "found", "." ]
77230d2eef2f0d4f045292a5906162f0c0499421
https://github.com/ronan-gloo/jade-php/blob/77230d2eef2f0d4f045292a5906162f0c0499421/src/Jade/Lexer.php#L233-L242
13,504
antarestupin/Accessible
lib/Accessible/Reader/ConstraintsReader.php
ConstraintsReader.isConstraintsValidationEnabled
public static function isConstraintsValidationEnabled($objectClasses, $annotationReader) { $enabled = Configuration::isConstraintsValidationEnabled(); foreach ($objectClasses as $class) { if ($annotationReader->getClassAnnotation($class, self::$disableConstraintsValidationAnnotationClas...
php
public static function isConstraintsValidationEnabled($objectClasses, $annotationReader) { $enabled = Configuration::isConstraintsValidationEnabled(); foreach ($objectClasses as $class) { if ($annotationReader->getClassAnnotation($class, self::$disableConstraintsValidationAnnotationClas...
[ "public", "static", "function", "isConstraintsValidationEnabled", "(", "$", "objectClasses", ",", "$", "annotationReader", ")", "{", "$", "enabled", "=", "Configuration", "::", "isConstraintsValidationEnabled", "(", ")", ";", "foreach", "(", "$", "objectClasses", "a...
Indicates wether the constraints validation is enabled or not for the given object. @param array $objectClasses The classes of the object to read. @param \Doctrine\Common\Annotations\Reader $annotationReader The annotation reader to use. @return boolean True if the validation is enabled, else false.
[ "Indicates", "wether", "the", "constraints", "validation", "is", "enabled", "or", "not", "for", "the", "given", "object", "." ]
d12ce93d72f74c099dfd2109371fcd6ddfffdca4
https://github.com/antarestupin/Accessible/blob/d12ce93d72f74c099dfd2109371fcd6ddfffdca4/lib/Accessible/Reader/ConstraintsReader.php#L31-L47
13,505
antarestupin/Accessible
lib/Accessible/Reader/ConstraintsReader.php
ConstraintsReader.validatePropertyValue
public static function validatePropertyValue($object, $property, $value) { return Configuration::getConstraintsValidator()->validatePropertyValue($object, $property, $value); }
php
public static function validatePropertyValue($object, $property, $value) { return Configuration::getConstraintsValidator()->validatePropertyValue($object, $property, $value); }
[ "public", "static", "function", "validatePropertyValue", "(", "$", "object", ",", "$", "property", ",", "$", "value", ")", "{", "return", "Configuration", "::", "getConstraintsValidator", "(", ")", "->", "validatePropertyValue", "(", "$", "object", ",", "$", "...
Validates the given value compared to given property constraints. If the value is valid, a call to `count` to the object returned by this method should give 0. @param object $object The object to compare. @param string $property The name of the reference property. @param mixed $value The value to check. @return...
[ "Validates", "the", "given", "value", "compared", "to", "given", "property", "constraints", ".", "If", "the", "value", "is", "valid", "a", "call", "to", "count", "to", "the", "object", "returned", "by", "this", "method", "should", "give", "0", "." ]
d12ce93d72f74c099dfd2109371fcd6ddfffdca4
https://github.com/antarestupin/Accessible/blob/d12ce93d72f74c099dfd2109371fcd6ddfffdca4/lib/Accessible/Reader/ConstraintsReader.php#L61-L64
13,506
nyeholt/silverstripe-simplewiki
code/pages/WikiPage.php
WikiPage.onBeforeWrite
protected function onBeforeWrite() { parent::onBeforeWrite(); // Changes in 2.4 mean that $this->Content can now become polluted with UTF-8 HTML entitised garbage // we'll leave this legacy conversion in for now? $this->Content = str_replace('
', '', $this->Content); $formatter = $this->getFormatter(); ...
php
protected function onBeforeWrite() { parent::onBeforeWrite(); // Changes in 2.4 mean that $this->Content can now become polluted with UTF-8 HTML entitised garbage // we'll leave this legacy conversion in for now? $this->Content = str_replace('
', '', $this->Content); $formatter = $this->getFormatter(); ...
[ "protected", "function", "onBeforeWrite", "(", ")", "{", "parent", "::", "onBeforeWrite", "(", ")", ";", "// Changes in 2.4 mean that $this->Content can now become polluted with UTF-8 HTML entitised garbage", "// we'll leave this legacy conversion in for now?", "$", "this", "->", "...
Before writing, convert any page links to appropriate new, non-published, pages @see sapphire/core/model/SiteTree#onBeforeWrite()
[ "Before", "writing", "convert", "any", "page", "links", "to", "appropriate", "new", "non", "-", "published", "pages" ]
ecffed0d75be1454901e1cb24633472b8f67c967
https://github.com/nyeholt/silverstripe-simplewiki/blob/ecffed0d75be1454901e1cb24633472b8f67c967/code/pages/WikiPage.php#L84-L103
13,507
nyeholt/silverstripe-simplewiki
code/pages/WikiPage.php
WikiPage.getCMSFields
public function getCMSFields() { $fields = parent::getCMSFields(); $options = $this->getEditorTypeOptions(); $fields->addFieldToTab('Root.Behaviour', new OptionsetField('EditorType', _t('WikiPage.EDITORTYPE', 'Editor Type'), $options)); // if we're not using the HTML editor type, we should just use a textar...
php
public function getCMSFields() { $fields = parent::getCMSFields(); $options = $this->getEditorTypeOptions(); $fields->addFieldToTab('Root.Behaviour', new OptionsetField('EditorType', _t('WikiPage.EDITORTYPE', 'Editor Type'), $options)); // if we're not using the HTML editor type, we should just use a textar...
[ "public", "function", "getCMSFields", "(", ")", "{", "$", "fields", "=", "parent", "::", "getCMSFields", "(", ")", ";", "$", "options", "=", "$", "this", "->", "getEditorTypeOptions", "(", ")", ";", "$", "fields", "->", "addFieldToTab", "(", "'Root.Behavio...
Get the CMS fields @see sapphire/core/model/SiteTree#getCMSFields()
[ "Get", "the", "CMS", "fields" ]
ecffed0d75be1454901e1cb24633472b8f67c967
https://github.com/nyeholt/silverstripe-simplewiki/blob/ecffed0d75be1454901e1cb24633472b8f67c967/code/pages/WikiPage.php#L125-L138
13,508
nyeholt/silverstripe-simplewiki
code/pages/WikiPage.php
WikiPage.getActualEditorType
public function getActualEditorType() { if ($this->EditorType && $this->EditorType != 'Inherit') { return $this->EditorType; } $parent = $this->getParent(); $editorType = 'Wiki'; while ($parent != null && $parent instanceof WikiPage) { if ($parent->EditorType && $parent->EditorType != 'Inherit') { ...
php
public function getActualEditorType() { if ($this->EditorType && $this->EditorType != 'Inherit') { return $this->EditorType; } $parent = $this->getParent(); $editorType = 'Wiki'; while ($parent != null && $parent instanceof WikiPage) { if ($parent->EditorType && $parent->EditorType != 'Inherit') { ...
[ "public", "function", "getActualEditorType", "(", ")", "{", "if", "(", "$", "this", "->", "EditorType", "&&", "$", "this", "->", "EditorType", "!=", "'Inherit'", ")", "{", "return", "$", "this", "->", "EditorType", ";", "}", "$", "parent", "=", "$", "t...
Return the editor type to use for this item. Will interrogate parents if needbe @return String
[ "Return", "the", "editor", "type", "to", "use", "for", "this", "item", ".", "Will", "interrogate", "parents", "if", "needbe" ]
ecffed0d75be1454901e1cb24633472b8f67c967
https://github.com/nyeholt/silverstripe-simplewiki/blob/ecffed0d75be1454901e1cb24633472b8f67c967/code/pages/WikiPage.php#L155-L170
13,509
nyeholt/silverstripe-simplewiki
code/pages/WikiPage.php
WikiPage.getFormatter
public function getFormatter($formatter=null) { if (!$formatter) { $formatter = $this->getActualEditorType(); } if (!isset(self::$registered_formatters[$formatter])) { throw new Exception("Formatter $formatter does not exist"); } return self::$registered_formatters[$formatter]; }
php
public function getFormatter($formatter=null) { if (!$formatter) { $formatter = $this->getActualEditorType(); } if (!isset(self::$registered_formatters[$formatter])) { throw new Exception("Formatter $formatter does not exist"); } return self::$registered_formatters[$formatter]; }
[ "public", "function", "getFormatter", "(", "$", "formatter", "=", "null", ")", "{", "if", "(", "!", "$", "formatter", ")", "{", "$", "formatter", "=", "$", "this", "->", "getActualEditorType", "(", ")", ";", "}", "if", "(", "!", "isset", "(", "self",...
Gets the formatter for a given type. If none specified, gets the current formatter @return SimpleWikiFormatter
[ "Gets", "the", "formatter", "for", "a", "given", "type", ".", "If", "none", "specified", "gets", "the", "current", "formatter" ]
ecffed0d75be1454901e1cb24633472b8f67c967
https://github.com/nyeholt/silverstripe-simplewiki/blob/ecffed0d75be1454901e1cb24633472b8f67c967/code/pages/WikiPage.php#L177-L187
13,510
nyeholt/silverstripe-simplewiki
code/pages/WikiPage.php
WikiPage.ParsedContent
public function ParsedContent() { $formatter = $this->getFormatter(); $content = $formatter->formatContent($this); // purify the output - we don't want people breaking pages if we set purify=true if (self::$purify_output) { include_once SIMPLEWIKI_DIR . '/thirdparty/htmlpurifier-4.0.0-lite/library/HTMLPurif...
php
public function ParsedContent() { $formatter = $this->getFormatter(); $content = $formatter->formatContent($this); // purify the output - we don't want people breaking pages if we set purify=true if (self::$purify_output) { include_once SIMPLEWIKI_DIR . '/thirdparty/htmlpurifier-4.0.0-lite/library/HTMLPurif...
[ "public", "function", "ParsedContent", "(", ")", "{", "$", "formatter", "=", "$", "this", "->", "getFormatter", "(", ")", ";", "$", "content", "=", "$", "formatter", "->", "formatContent", "(", "$", "this", ")", ";", "// purify the output - we don't want peopl...
Retrieves the page's content, passed through any necessary parsing eg Wiki based content @return String
[ "Retrieves", "the", "page", "s", "content", "passed", "through", "any", "necessary", "parsing", "eg", "Wiki", "based", "content" ]
ecffed0d75be1454901e1cb24633472b8f67c967
https://github.com/nyeholt/silverstripe-simplewiki/blob/ecffed0d75be1454901e1cb24633472b8f67c967/code/pages/WikiPage.php#L195-L208
13,511
nyeholt/silverstripe-simplewiki
code/pages/WikiPage.php
WikiPage.getWikiRoot
public function getWikiRoot() { $current = $this; $parent = $current->Parent(); while ($parent instanceof WikiPage) { $current = $parent; $parent = $current->Parent(); } return $current; }
php
public function getWikiRoot() { $current = $this; $parent = $current->Parent(); while ($parent instanceof WikiPage) { $current = $parent; $parent = $current->Parent(); } return $current; }
[ "public", "function", "getWikiRoot", "(", ")", "{", "$", "current", "=", "$", "this", ";", "$", "parent", "=", "$", "current", "->", "Parent", "(", ")", ";", "while", "(", "$", "parent", "instanceof", "WikiPage", ")", "{", "$", "current", "=", "$", ...
Get the root of the wiki that this wiki page exists in @return WikiPage
[ "Get", "the", "root", "of", "the", "wiki", "that", "this", "wiki", "page", "exists", "in" ]
ecffed0d75be1454901e1cb24633472b8f67c967
https://github.com/nyeholt/silverstripe-simplewiki/blob/ecffed0d75be1454901e1cb24633472b8f67c967/code/pages/WikiPage.php#L225-L233
13,512
nyeholt/silverstripe-simplewiki
code/pages/WikiPage.php
WikiPage.lock
public function lock($member = null) { if (!$member) { $member = Member::currentUser(); } // set the updated lock expiry based on now + lock timeout $this->WikiLastEditor = $member->Email; $this->WikiLockExpiry = date('Y-m-d H:i:s', time() + $this->config()->get('lock_time')); // save it with us as the...
php
public function lock($member = null) { if (!$member) { $member = Member::currentUser(); } // set the updated lock expiry based on now + lock timeout $this->WikiLastEditor = $member->Email; $this->WikiLockExpiry = date('Y-m-d H:i:s', time() + $this->config()->get('lock_time')); // save it with us as the...
[ "public", "function", "lock", "(", "$", "member", "=", "null", ")", "{", "if", "(", "!", "$", "member", ")", "{", "$", "member", "=", "Member", "::", "currentUser", "(", ")", ";", "}", "// set the updated lock expiry based on now + lock timeout", "$", "this"...
Lock the page for the current user @param Member $member The user to lock the page for
[ "Lock", "the", "page", "for", "the", "current", "user" ]
ecffed0d75be1454901e1cb24633472b8f67c967
https://github.com/nyeholt/silverstripe-simplewiki/blob/ecffed0d75be1454901e1cb24633472b8f67c967/code/pages/WikiPage.php#L241-L252
13,513
nyeholt/silverstripe-simplewiki
code/pages/WikiPage.php
WikiPage_Controller.edit
public function edit() { HtmlEditorField::include_js(); // Requirements::javascript('simplewiki/javascript/sslinks/editor_plugin_src.js'); $existing = $this->getEditingLocks($this->data(), true); // oops, we've somehow got here even though we shouldn't have if ($existing && $existing['user'] != Member::curren...
php
public function edit() { HtmlEditorField::include_js(); // Requirements::javascript('simplewiki/javascript/sslinks/editor_plugin_src.js'); $existing = $this->getEditingLocks($this->data(), true); // oops, we've somehow got here even though we shouldn't have if ($existing && $existing['user'] != Member::curren...
[ "public", "function", "edit", "(", ")", "{", "HtmlEditorField", "::", "include_js", "(", ")", ";", "//\t\tRequirements::javascript('simplewiki/javascript/sslinks/editor_plugin_src.js');", "$", "existing", "=", "$", "this", "->", "getEditingLocks", "(", "$", "this", "->"...
Action handler for editing this wiki page Creates a form that's used for editing the page's content, as well as adding in a couple of additional toolbar actions for adding a simple link and a simple image
[ "Action", "handler", "for", "editing", "this", "wiki", "page" ]
ecffed0d75be1454901e1cb24633472b8f67c967
https://github.com/nyeholt/silverstripe-simplewiki/blob/ecffed0d75be1454901e1cb24633472b8f67c967/code/pages/WikiPage.php#L387-L405
13,514
nyeholt/silverstripe-simplewiki
code/pages/WikiPage.php
WikiPage_Controller.EditForm
public function EditForm() { // make sure to load fresh from db $record = DataObject::get_by_id('WikiPage', $this->data()->ID); $formatter = $record->getFormatter(); $editorField = $formatter->getEditingField($record); $helpLink = $formatter->getHelpUrl(); $fields = FieldList::create( new LiteralFi...
php
public function EditForm() { // make sure to load fresh from db $record = DataObject::get_by_id('WikiPage', $this->data()->ID); $formatter = $record->getFormatter(); $editorField = $formatter->getEditingField($record); $helpLink = $formatter->getHelpUrl(); $fields = FieldList::create( new LiteralFi...
[ "public", "function", "EditForm", "(", ")", "{", "// make sure to load fresh from db", "$", "record", "=", "DataObject", "::", "get_by_id", "(", "'WikiPage'", ",", "$", "this", "->", "data", "(", ")", "->", "ID", ")", ";", "$", "formatter", "=", "$", "reco...
Creates the form used for editing the page's content @return Form
[ "Creates", "the", "form", "used", "for", "editing", "the", "page", "s", "content" ]
ecffed0d75be1454901e1cb24633472b8f67c967
https://github.com/nyeholt/silverstripe-simplewiki/blob/ecffed0d75be1454901e1cb24633472b8f67c967/code/pages/WikiPage.php#L412-L462
13,515
nyeholt/silverstripe-simplewiki
code/pages/WikiPage.php
WikiPage_Controller.revert
public function revert() { if ($this->data()->IsModifiedOnStage) { $this->data()->doRevertToLive(); } return $this->redirect($this->data()->Link() . '?stage=Live'); }
php
public function revert() { if ($this->data()->IsModifiedOnStage) { $this->data()->doRevertToLive(); } return $this->redirect($this->data()->Link() . '?stage=Live'); }
[ "public", "function", "revert", "(", ")", "{", "if", "(", "$", "this", "->", "data", "(", ")", "->", "IsModifiedOnStage", ")", "{", "$", "this", "->", "data", "(", ")", "->", "doRevertToLive", "(", ")", ";", "}", "return", "$", "this", "->", "redir...
Option for the user to revert the changes made since it was last published
[ "Option", "for", "the", "user", "to", "revert", "the", "changes", "made", "since", "it", "was", "last", "published" ]
ecffed0d75be1454901e1cb24633472b8f67c967
https://github.com/nyeholt/silverstripe-simplewiki/blob/ecffed0d75be1454901e1cb24633472b8f67c967/code/pages/WikiPage.php#L501-L506
13,516
nyeholt/silverstripe-simplewiki
code/pages/WikiPage.php
WikiPage_Controller.delete
public function delete() { $page = $this->data(); /* @var $page Page */ if ($page) { $parent = $page->Parent(); $ID = $page->ID; $page->deleteFromStage('Live'); // only fully delete if we're autopublishing stuff.. a bit counter // intuitive, but works pretty well if (WikiPage::$auto_publish) {...
php
public function delete() { $page = $this->data(); /* @var $page Page */ if ($page) { $parent = $page->Parent(); $ID = $page->ID; $page->deleteFromStage('Live'); // only fully delete if we're autopublishing stuff.. a bit counter // intuitive, but works pretty well if (WikiPage::$auto_publish) {...
[ "public", "function", "delete", "(", ")", "{", "$", "page", "=", "$", "this", "->", "data", "(", ")", ";", "/* @var $page Page */", "if", "(", "$", "page", ")", "{", "$", "parent", "=", "$", "page", "->", "Parent", "(", ")", ";", "$", "ID", "=", ...
Deletes the current page and returns the user to the parent of the now deleted page.
[ "Deletes", "the", "current", "page", "and", "returns", "the", "user", "to", "the", "parent", "of", "the", "now", "deleted", "page", "." ]
ecffed0d75be1454901e1cb24633472b8f67c967
https://github.com/nyeholt/silverstripe-simplewiki/blob/ecffed0d75be1454901e1cb24633472b8f67c967/code/pages/WikiPage.php#L513-L534
13,517
nyeholt/silverstripe-simplewiki
code/pages/WikiPage.php
WikiPage_Controller.addpage
public function addpage($args) { if (!Permission::check(MANAGE_WIKI_PAGES)) { return Security::permissionFailure($this); } $pageName = trim($args['NewPageName']); $createType = $args['CreateType'] ? $args['CreateType'] : 'child'; if (!strlen($pageName)) { throw new Exception("Invalid page name"); } ...
php
public function addpage($args) { if (!Permission::check(MANAGE_WIKI_PAGES)) { return Security::permissionFailure($this); } $pageName = trim($args['NewPageName']); $createType = $args['CreateType'] ? $args['CreateType'] : 'child'; if (!strlen($pageName)) { throw new Exception("Invalid page name"); } ...
[ "public", "function", "addpage", "(", "$", "args", ")", "{", "if", "(", "!", "Permission", "::", "check", "(", "MANAGE_WIKI_PAGES", ")", ")", "{", "return", "Security", "::", "permissionFailure", "(", "$", "this", ")", ";", "}", "$", "pageName", "=", "...
Creates an entirely new page as a child of the current page, or 'after' a selected page.
[ "Creates", "an", "entirely", "new", "page", "as", "a", "child", "of", "the", "current", "page", "or", "after", "a", "selected", "page", "." ]
ecffed0d75be1454901e1cb24633472b8f67c967
https://github.com/nyeholt/silverstripe-simplewiki/blob/ecffed0d75be1454901e1cb24633472b8f67c967/code/pages/WikiPage.php#L540-L586
13,518
nyeholt/silverstripe-simplewiki
code/pages/WikiPage.php
WikiPage_Controller.save
public function save($data, $form) { if (!$this->data()->canEdit()) { return Security::permissionFailure($this); } $existing = $this->getEditingLocks($this->data(), true); // oops, we've somehow got here even though we shouldn't have if ($existing && $existing['user'] != Member::currentUser()->Email) { ...
php
public function save($data, $form) { if (!$this->data()->canEdit()) { return Security::permissionFailure($this); } $existing = $this->getEditingLocks($this->data(), true); // oops, we've somehow got here even though we shouldn't have if ($existing && $existing['user'] != Member::currentUser()->Email) { ...
[ "public", "function", "save", "(", "$", "data", ",", "$", "form", ")", "{", "if", "(", "!", "$", "this", "->", "data", "(", ")", "->", "canEdit", "(", ")", ")", "{", "return", "Security", "::", "permissionFailure", "(", "$", "this", ")", ";", "}"...
Save the submitted data @return
[ "Save", "the", "submitted", "data" ]
ecffed0d75be1454901e1cb24633472b8f67c967
https://github.com/nyeholt/silverstripe-simplewiki/blob/ecffed0d75be1454901e1cb24633472b8f67c967/code/pages/WikiPage.php#L608-L626
13,519
nyeholt/silverstripe-simplewiki
code/pages/WikiPage.php
WikiPage_Controller.Form
public function Form() { // The editing form hasn't been put in place by the 'edit' action // so lets just show the status form $append = ''; if (!$this->form) { if (WikiPage::$show_edit_button || $this->data()->canEdit()) { // create the information form $this->form = $this->StatusForm(); } } ...
php
public function Form() { // The editing form hasn't been put in place by the 'edit' action // so lets just show the status form $append = ''; if (!$this->form) { if (WikiPage::$show_edit_button || $this->data()->canEdit()) { // create the information form $this->form = $this->StatusForm(); } } ...
[ "public", "function", "Form", "(", ")", "{", "// The editing form hasn't been put in place by the 'edit' action", "// so lets just show the status form", "$", "append", "=", "''", ";", "if", "(", "!", "$", "this", "->", "form", ")", "{", "if", "(", "WikiPage", "::",...
Return the form to the user if it exists, otherwise some information about who is currently editing @return Form
[ "Return", "the", "form", "to", "the", "user", "if", "it", "exists", "otherwise", "some", "information", "about", "who", "is", "currently", "editing" ]
ecffed0d75be1454901e1cb24633472b8f67c967
https://github.com/nyeholt/silverstripe-simplewiki/blob/ecffed0d75be1454901e1cb24633472b8f67c967/code/pages/WikiPage.php#L685-L703
13,520
nyeholt/silverstripe-simplewiki
code/pages/WikiPage.php
WikiPage_Controller.StatusForm
public function StatusForm() { $existing = $this->getEditingLocks($this->data()); if ($existing && $existing['user'] != Member::currentUser()->Email) { $fields = FieldList::create( new ReadonlyField('ExistingEditor', '', _t('WikiPage.EXISTINGEDITOR', 'This page is currently locked for editing by ' . $exi...
php
public function StatusForm() { $existing = $this->getEditingLocks($this->data()); if ($existing && $existing['user'] != Member::currentUser()->Email) { $fields = FieldList::create( new ReadonlyField('ExistingEditor', '', _t('WikiPage.EXISTINGEDITOR', 'This page is currently locked for editing by ' . $exi...
[ "public", "function", "StatusForm", "(", ")", "{", "$", "existing", "=", "$", "this", "->", "getEditingLocks", "(", "$", "this", "->", "data", "(", ")", ")", ";", "if", "(", "$", "existing", "&&", "$", "existing", "[", "'user'", "]", "!=", "Member", ...
Gets the status form that is used by users to trigger the editing mode if they have the relevant access to it. @return Form
[ "Gets", "the", "status", "form", "that", "is", "used", "by", "users", "to", "trigger", "the", "editing", "mode", "if", "they", "have", "the", "relevant", "access", "to", "it", "." ]
ecffed0d75be1454901e1cb24633472b8f67c967
https://github.com/nyeholt/silverstripe-simplewiki/blob/ecffed0d75be1454901e1cb24633472b8f67c967/code/pages/WikiPage.php#L711-L727
13,521
nyeholt/silverstripe-simplewiki
code/pages/WikiPage.php
WikiPage_Controller.updatelock
public function updatelock($data) { if ($this->data()->ID && $this->data()->canEdit()) { $lock = $this->getEditingLocks($this->data(), true); $response = new stdClass(); $response->status = 1; if ($lock != null && $lock['user'] != Member::currentUser()->Email) { // someone else has stolen it ! $re...
php
public function updatelock($data) { if ($this->data()->ID && $this->data()->canEdit()) { $lock = $this->getEditingLocks($this->data(), true); $response = new stdClass(); $response->status = 1; if ($lock != null && $lock['user'] != Member::currentUser()->Email) { // someone else has stolen it ! $re...
[ "public", "function", "updatelock", "(", "$", "data", ")", "{", "if", "(", "$", "this", "->", "data", "(", ")", "->", "ID", "&&", "$", "this", "->", "data", "(", ")", "->", "canEdit", "(", ")", ")", "{", "$", "lock", "=", "$", "this", "->", "...
Updates the lock timeout for the given object @param <type> $data
[ "Updates", "the", "lock", "timeout", "for", "the", "given", "object" ]
ecffed0d75be1454901e1cb24633472b8f67c967
https://github.com/nyeholt/silverstripe-simplewiki/blob/ecffed0d75be1454901e1cb24633472b8f67c967/code/pages/WikiPage.php#L734-L746
13,522
nyeholt/silverstripe-simplewiki
code/pages/WikiPage.php
WikiPage_Controller.getEditingLocks
protected function getEditingLocks($page, $doLock=false) { $currentStage = Versioned::current_stage(); Versioned::reading_stage('Stage'); $filter = array( 'WikiPage.ID' => $page->ID, 'WikiLockExpiry' => date('Y-m-d H:i:s'), ); $user = Member::currentUser(); $currentLock = WikiPage::get()->filter($f...
php
protected function getEditingLocks($page, $doLock=false) { $currentStage = Versioned::current_stage(); Versioned::reading_stage('Stage'); $filter = array( 'WikiPage.ID' => $page->ID, 'WikiLockExpiry' => date('Y-m-d H:i:s'), ); $user = Member::currentUser(); $currentLock = WikiPage::get()->filter($f...
[ "protected", "function", "getEditingLocks", "(", "$", "page", ",", "$", "doLock", "=", "false", ")", "{", "$", "currentStage", "=", "Versioned", "::", "current_stage", "(", ")", ";", "Versioned", "::", "reading_stage", "(", "'Stage'", ")", ";", "$", "filte...
Lock the page for editing @param SiteTree $page The page being edited @param boolean $doLock Whether to actually lock the page for ourselves @return array The names of any existing editors
[ "Lock", "the", "page", "for", "editing" ]
ecffed0d75be1454901e1cb24633472b8f67c967
https://github.com/nyeholt/silverstripe-simplewiki/blob/ecffed0d75be1454901e1cb24633472b8f67c967/code/pages/WikiPage.php#L758-L790
13,523
nyeholt/silverstripe-simplewiki
code/pages/WikiPage.php
WikiPage_Controller.objectdetails
public function objectdetails() { $response = new stdClass; if (isset($_GET['ID'])) { $type = null; if (isset($_GET['type'])) { $type = $_GET['type'] == 'href' ? 'SiteTree' : 'File'; } else { $type = 'SiteTree'; } $object = DataObject::get_by_id($type, $_GET['ID']); $response->Title = $o...
php
public function objectdetails() { $response = new stdClass; if (isset($_GET['ID'])) { $type = null; if (isset($_GET['type'])) { $type = $_GET['type'] == 'href' ? 'SiteTree' : 'File'; } else { $type = 'SiteTree'; } $object = DataObject::get_by_id($type, $_GET['ID']); $response->Title = $o...
[ "public", "function", "objectdetails", "(", ")", "{", "$", "response", "=", "new", "stdClass", ";", "if", "(", "isset", "(", "$", "_GET", "[", "'ID'", "]", ")", ")", "{", "$", "type", "=", "null", ";", "if", "(", "isset", "(", "$", "_GET", "[", ...
Retrieves information about a selected image for the frontend image insertion tool - hacky for now, ideally need to pull through the backend ImageForm @return string
[ "Retrieves", "information", "about", "a", "selected", "image", "for", "the", "frontend", "image", "insertion", "tool", "-", "hacky", "for", "now", "ideally", "need", "to", "pull", "through", "the", "backend", "ImageForm" ]
ecffed0d75be1454901e1cb24633472b8f67c967
https://github.com/nyeholt/silverstripe-simplewiki/blob/ecffed0d75be1454901e1cb24633472b8f67c967/code/pages/WikiPage.php#L843-L871
13,524
itrnka/ha-framework
src/ha/Component/Password/PasswordDefault.php
PasswordDefault.setValue
public function setValue(string $rawValue) : void { if (strlen($rawValue) < 8) { throw new PasswordPolicyException('Password is too short@' . __METHOD__); } $this->rawValue = $rawValue; }
php
public function setValue(string $rawValue) : void { if (strlen($rawValue) < 8) { throw new PasswordPolicyException('Password is too short@' . __METHOD__); } $this->rawValue = $rawValue; }
[ "public", "function", "setValue", "(", "string", "$", "rawValue", ")", ":", "void", "{", "if", "(", "strlen", "(", "$", "rawValue", ")", "<", "8", ")", "{", "throw", "new", "PasswordPolicyException", "(", "'Password is too short@'", ".", "__METHOD__", ")", ...
Set password value. @param string $rawValue @throws PasswordPolicyException
[ "Set", "password", "value", "." ]
a72b09c28f8e966c37f98a0004e4fbbce80df42c
https://github.com/itrnka/ha-framework/blob/a72b09c28f8e966c37f98a0004e4fbbce80df42c/src/ha/Component/Password/PasswordDefault.php#L34-L40
13,525
itrnka/ha-framework
src/ha/Component/Password/PasswordDefault.php
PasswordDefault.verify
public function verify(string $hash) : bool { if (is_null($this->rawValue)) { return false; } return password_verify($this->rawValue, $hash); }
php
public function verify(string $hash) : bool { if (is_null($this->rawValue)) { return false; } return password_verify($this->rawValue, $hash); }
[ "public", "function", "verify", "(", "string", "$", "hash", ")", ":", "bool", "{", "if", "(", "is_null", "(", "$", "this", "->", "rawValue", ")", ")", "{", "return", "false", ";", "}", "return", "password_verify", "(", "$", "this", "->", "rawValue", ...
Verify password hash @param string $hash @return bool
[ "Verify", "password", "hash" ]
a72b09c28f8e966c37f98a0004e4fbbce80df42c
https://github.com/itrnka/ha-framework/blob/a72b09c28f8e966c37f98a0004e4fbbce80df42c/src/ha/Component/Password/PasswordDefault.php#L72-L78
13,526
PandaPlatform/framework
src/Panda/Routing/Route.php
Route.getParameterNames
public function getParameterNames() { if (isset($this->parameterNames)) { return $this->parameterNames; } return $this->parameterNames = $this->compileParameterNames(); }
php
public function getParameterNames() { if (isset($this->parameterNames)) { return $this->parameterNames; } return $this->parameterNames = $this->compileParameterNames(); }
[ "public", "function", "getParameterNames", "(", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "parameterNames", ")", ")", "{", "return", "$", "this", "->", "parameterNames", ";", "}", "return", "$", "this", "->", "parameterNames", "=", "$", "this...
Get all of the parameter names for the route. @return array
[ "Get", "all", "of", "the", "parameter", "names", "for", "the", "route", "." ]
a78cf051b379896b5a4d5df620988e37a0e632f5
https://github.com/PandaPlatform/framework/blob/a78cf051b379896b5a4d5df620988e37a0e632f5/src/Panda/Routing/Route.php#L262-L269
13,527
PandaPlatform/framework
src/Panda/Routing/Route.php
Route.getParameter
public function getParameter($name, $default = null) { try { return ArrayHelper::get($this->getParameters(), $name, $default); } catch (Exception $ex) { return $default; } }
php
public function getParameter($name, $default = null) { try { return ArrayHelper::get($this->getParameters(), $name, $default); } catch (Exception $ex) { return $default; } }
[ "public", "function", "getParameter", "(", "$", "name", ",", "$", "default", "=", "null", ")", "{", "try", "{", "return", "ArrayHelper", "::", "get", "(", "$", "this", "->", "getParameters", "(", ")", ",", "$", "name", ",", "$", "default", ")", ";", ...
Get a given parameter from the route. @param string $name @param mixed $default @return string|object
[ "Get", "a", "given", "parameter", "from", "the", "route", "." ]
a78cf051b379896b5a4d5df620988e37a0e632f5
https://github.com/PandaPlatform/framework/blob/a78cf051b379896b5a4d5df620988e37a0e632f5/src/Panda/Routing/Route.php#L293-L300
13,528
PandaPlatform/framework
src/Panda/Routing/Route.php
Route.compileRoute
protected function compileRoute() { $uri = preg_replace('/\{(\w+?)\?\}/', '{$1}', $this->uri); $this->compiled = (new SymfonyRoute($uri, $optionals = [], $requirements = [], [], $domain = ''))->compile(); }
php
protected function compileRoute() { $uri = preg_replace('/\{(\w+?)\?\}/', '{$1}', $this->uri); $this->compiled = (new SymfonyRoute($uri, $optionals = [], $requirements = [], [], $domain = ''))->compile(); }
[ "protected", "function", "compileRoute", "(", ")", "{", "$", "uri", "=", "preg_replace", "(", "'/\\{(\\w+?)\\?\\}/'", ",", "'{$1}'", ",", "$", "this", "->", "uri", ")", ";", "$", "this", "->", "compiled", "=", "(", "new", "SymfonyRoute", "(", "$", "uri",...
Compile the current route. @throws LogicException
[ "Compile", "the", "current", "route", "." ]
a78cf051b379896b5a4d5df620988e37a0e632f5
https://github.com/PandaPlatform/framework/blob/a78cf051b379896b5a4d5df620988e37a0e632f5/src/Panda/Routing/Route.php#L377-L382
13,529
PandaPlatform/framework
src/Panda/Routing/Route.php
Route.runCallable
protected function runCallable() { $parameters = $this->resolveMethodDependencies( $this->getParametersWithoutNulls(), new ReflectionFunction($this->action['uses']) ); $callable = $this->action['uses']; return call_user_func_array($callable, $parameters); }
php
protected function runCallable() { $parameters = $this->resolveMethodDependencies( $this->getParametersWithoutNulls(), new ReflectionFunction($this->action['uses']) ); $callable = $this->action['uses']; return call_user_func_array($callable, $parameters); }
[ "protected", "function", "runCallable", "(", ")", "{", "$", "parameters", "=", "$", "this", "->", "resolveMethodDependencies", "(", "$", "this", "->", "getParametersWithoutNulls", "(", ")", ",", "new", "ReflectionFunction", "(", "$", "this", "->", "action", "[...
Run the route action as callable and return the response. @return mixed @throws LogicException
[ "Run", "the", "route", "action", "as", "callable", "and", "return", "the", "response", "." ]
a78cf051b379896b5a4d5df620988e37a0e632f5
https://github.com/PandaPlatform/framework/blob/a78cf051b379896b5a4d5df620988e37a0e632f5/src/Panda/Routing/Route.php#L443-L452
13,530
nyeholt/silverstripe-simplewiki
thirdparty/htmlpurifier-4.0.0-lite/library/HTMLPurifier/Config.php
HTMLPurifier_Config.getBatchSerial
public function getBatchSerial($namespace) { if (empty($this->serials[$namespace])) { $batch = $this->getBatch($namespace); unset($batch['DefinitionRev']); $this->serials[$namespace] = md5(serialize($batch)); } return $this->serials[$namespace]; }
php
public function getBatchSerial($namespace) { if (empty($this->serials[$namespace])) { $batch = $this->getBatch($namespace); unset($batch['DefinitionRev']); $this->serials[$namespace] = md5(serialize($batch)); } return $this->serials[$namespace]; }
[ "public", "function", "getBatchSerial", "(", "$", "namespace", ")", "{", "if", "(", "empty", "(", "$", "this", "->", "serials", "[", "$", "namespace", "]", ")", ")", "{", "$", "batch", "=", "$", "this", "->", "getBatch", "(", "$", "namespace", ")", ...
Returns a md5 signature of a segment of the configuration object that uniquely identifies that particular configuration @note Revision is handled specially and is removed from the batch before processing! @param $namespace Namespace to get serial for
[ "Returns", "a", "md5", "signature", "of", "a", "segment", "of", "the", "configuration", "object", "that", "uniquely", "identifies", "that", "particular", "configuration" ]
ecffed0d75be1454901e1cb24633472b8f67c967
https://github.com/nyeholt/silverstripe-simplewiki/blob/ecffed0d75be1454901e1cb24633472b8f67c967/thirdparty/htmlpurifier-4.0.0-lite/library/HTMLPurifier/Config.php#L197-L204
13,531
nyeholt/silverstripe-simplewiki
thirdparty/htmlpurifier-4.0.0-lite/library/HTMLPurifier/Config.php
HTMLPurifier_Config.getSerial
public function getSerial() { if (empty($this->serial)) { $this->serial = md5(serialize($this->getAll())); } return $this->serial; }
php
public function getSerial() { if (empty($this->serial)) { $this->serial = md5(serialize($this->getAll())); } return $this->serial; }
[ "public", "function", "getSerial", "(", ")", "{", "if", "(", "empty", "(", "$", "this", "->", "serial", ")", ")", "{", "$", "this", "->", "serial", "=", "md5", "(", "serialize", "(", "$", "this", "->", "getAll", "(", ")", ")", ")", ";", "}", "r...
Returns a md5 signature for the entire configuration object that uniquely identifies that particular configuration
[ "Returns", "a", "md5", "signature", "for", "the", "entire", "configuration", "object", "that", "uniquely", "identifies", "that", "particular", "configuration" ]
ecffed0d75be1454901e1cb24633472b8f67c967
https://github.com/nyeholt/silverstripe-simplewiki/blob/ecffed0d75be1454901e1cb24633472b8f67c967/thirdparty/htmlpurifier-4.0.0-lite/library/HTMLPurifier/Config.php#L210-L215
13,532
nyeholt/silverstripe-simplewiki
thirdparty/htmlpurifier-4.0.0-lite/library/HTMLPurifier/Config.php
HTMLPurifier_Config.getAll
public function getAll() { if (!$this->finalized) $this->autoFinalize(); $ret = array(); foreach ($this->plist->squash() as $name => $value) { list($ns, $key) = explode('.', $name, 2); $ret[$ns][$key] = $value; } return $ret; }
php
public function getAll() { if (!$this->finalized) $this->autoFinalize(); $ret = array(); foreach ($this->plist->squash() as $name => $value) { list($ns, $key) = explode('.', $name, 2); $ret[$ns][$key] = $value; } return $ret; }
[ "public", "function", "getAll", "(", ")", "{", "if", "(", "!", "$", "this", "->", "finalized", ")", "$", "this", "->", "autoFinalize", "(", ")", ";", "$", "ret", "=", "array", "(", ")", ";", "foreach", "(", "$", "this", "->", "plist", "->", "squa...
Retrieves all directives, organized by namespace @warning This is a pretty inefficient function, avoid if you can
[ "Retrieves", "all", "directives", "organized", "by", "namespace" ]
ecffed0d75be1454901e1cb24633472b8f67c967
https://github.com/nyeholt/silverstripe-simplewiki/blob/ecffed0d75be1454901e1cb24633472b8f67c967/thirdparty/htmlpurifier-4.0.0-lite/library/HTMLPurifier/Config.php#L221-L229
13,533
nyeholt/silverstripe-simplewiki
thirdparty/htmlpurifier-4.0.0-lite/library/HTMLPurifier/Config.php
HTMLPurifier_Config.prepareArrayFromForm
public static function prepareArrayFromForm($array, $index = false, $allowed = true, $mq_fix = true, $schema = null) { if ($index !== false) $array = (isset($array[$index]) && is_array($array[$index])) ? $array[$index] : array(); $mq = $mq_fix && function_exists('get_magic_quotes_gpc') && get_magic_quot...
php
public static function prepareArrayFromForm($array, $index = false, $allowed = true, $mq_fix = true, $schema = null) { if ($index !== false) $array = (isset($array[$index]) && is_array($array[$index])) ? $array[$index] : array(); $mq = $mq_fix && function_exists('get_magic_quotes_gpc') && get_magic_quot...
[ "public", "static", "function", "prepareArrayFromForm", "(", "$", "array", ",", "$", "index", "=", "false", ",", "$", "allowed", "=", "true", ",", "$", "mq_fix", "=", "true", ",", "$", "schema", "=", "null", ")", "{", "if", "(", "$", "index", "!==", ...
Prepares an array from a form into something usable for the more strict parts of HTMLPurifier_Config
[ "Prepares", "an", "array", "from", "a", "form", "into", "something", "usable", "for", "the", "more", "strict", "parts", "of", "HTMLPurifier_Config" ]
ecffed0d75be1454901e1cb24633472b8f67c967
https://github.com/nyeholt/silverstripe-simplewiki/blob/ecffed0d75be1454901e1cb24633472b8f67c967/thirdparty/htmlpurifier-4.0.0-lite/library/HTMLPurifier/Config.php#L489-L507
13,534
nyeholt/silverstripe-simplewiki
thirdparty/htmlpurifier-4.0.0-lite/library/HTMLPurifier/Config.php
HTMLPurifier_Config.triggerError
protected function triggerError($msg, $no) { // determine previous stack frame $backtrace = debug_backtrace(); if ($this->chatty && isset($backtrace[1])) { $frame = $backtrace[1]; $extra = " on line {$frame['line']} in file {$frame['file']}"; } else { ...
php
protected function triggerError($msg, $no) { // determine previous stack frame $backtrace = debug_backtrace(); if ($this->chatty && isset($backtrace[1])) { $frame = $backtrace[1]; $extra = " on line {$frame['line']} in file {$frame['file']}"; } else { ...
[ "protected", "function", "triggerError", "(", "$", "msg", ",", "$", "no", ")", "{", "// determine previous stack frame", "$", "backtrace", "=", "debug_backtrace", "(", ")", ";", "if", "(", "$", "this", "->", "chatty", "&&", "isset", "(", "$", "backtrace", ...
Produces a nicely formatted error message by supplying the stack frame information from two levels up and OUTSIDE of HTMLPurifier_Config.
[ "Produces", "a", "nicely", "formatted", "error", "message", "by", "supplying", "the", "stack", "frame", "information", "from", "two", "levels", "up", "and", "OUTSIDE", "of", "HTMLPurifier_Config", "." ]
ecffed0d75be1454901e1cb24633472b8f67c967
https://github.com/nyeholt/silverstripe-simplewiki/blob/ecffed0d75be1454901e1cb24633472b8f67c967/thirdparty/htmlpurifier-4.0.0-lite/library/HTMLPurifier/Config.php#L555-L565
13,535
terdia/legato-framework
src/Mail/Mail.php
Mail.send
public static function send($params) { $params = array_merge([ 'subject' => '', 'view' => '', 'body' => '', 'bodyHtml' => '', 'to' => [], 'bcc' => [], 'cc' => [], 'replyTo' => [], ...
php
public static function send($params) { $params = array_merge([ 'subject' => '', 'view' => '', 'body' => '', 'bodyHtml' => '', 'to' => [], 'bcc' => [], 'cc' => [], 'replyTo' => [], ...
[ "public", "static", "function", "send", "(", "$", "params", ")", "{", "$", "params", "=", "array_merge", "(", "[", "'subject'", "=>", "''", ",", "'view'", "=>", "''", ",", "'body'", "=>", "''", ",", "'bodyHtml'", "=>", "''", ",", "'to'", "=>", "[", ...
Send message using chosen driver. @param $params @return int|mixed
[ "Send", "message", "using", "chosen", "driver", "." ]
44057c1c3c6f3e9643e9fade51bd417860fafda8
https://github.com/terdia/legato-framework/blob/44057c1c3c6f3e9643e9fade51bd417860fafda8/src/Mail/Mail.php#L52-L81
13,536
ssnepenthe/soter
src/class-slack-notifier.php
Slack_Notifier.build_attachment_fields
protected function build_attachment_fields( Vulnerabilities $vulnerabilities ) { $fields = []; foreach ( $vulnerabilities as $vulnerability ) { $fixed_in = $vulnerability->fixed_in ? 'Fixed in v' . $vulnerability->fixed_in : 'Not fixed yet'; $wpvdb_url = "https://wpvulndb.com/vulnerabilities/{$vulner...
php
protected function build_attachment_fields( Vulnerabilities $vulnerabilities ) { $fields = []; foreach ( $vulnerabilities as $vulnerability ) { $fixed_in = $vulnerability->fixed_in ? 'Fixed in v' . $vulnerability->fixed_in : 'Not fixed yet'; $wpvdb_url = "https://wpvulndb.com/vulnerabilities/{$vulner...
[ "protected", "function", "build_attachment_fields", "(", "Vulnerabilities", "$", "vulnerabilities", ")", "{", "$", "fields", "=", "[", "]", ";", "foreach", "(", "$", "vulnerabilities", "as", "$", "vulnerability", ")", "{", "$", "fixed_in", "=", "$", "vulnerabi...
Generates the fields array for the message attachment. @param Vulnerabilities $vulnerabilities List of vulnerabilities. @return array
[ "Generates", "the", "fields", "array", "for", "the", "message", "attachment", "." ]
f6d7032f8562e23c2ee8dbf9d60ef1114c8cdce7
https://github.com/ssnepenthe/soter/blob/f6d7032f8562e23c2ee8dbf9d60ef1114c8cdce7/src/class-slack-notifier.php#L92-L108
13,537
inpsyde/wp-db-tools
src/Db/WpDbAdapter.php
WpDbAdapter.query
public function query( $query, $options = 0 ) { $result = $this->wpdb->get_results( (string) $query ); $this->last_affected_rows = (int) $this->wpdb->rows_affected; $this->last_insert_id = (int) $this->wpdb->insert_id; $this->last_statement = NULL; if ( ! is_array( $result ) ) $r...
php
public function query( $query, $options = 0 ) { $result = $this->wpdb->get_results( (string) $query ); $this->last_affected_rows = (int) $this->wpdb->rows_affected; $this->last_insert_id = (int) $this->wpdb->insert_id; $this->last_statement = NULL; if ( ! is_array( $result ) ) $r...
[ "public", "function", "query", "(", "$", "query", ",", "$", "options", "=", "0", ")", "{", "$", "result", "=", "$", "this", "->", "wpdb", "->", "get_results", "(", "(", "string", ")", "$", "query", ")", ";", "$", "this", "->", "last_affected_rows", ...
Executes a plain SQL query and return the results @param $query @param int $options @return \WpDbTools\Type\Result
[ "Executes", "a", "plain", "SQL", "query", "and", "return", "the", "results" ]
f16f4a96e1e326733ab0ef940e2c9247b6285694
https://github.com/inpsyde/wp-db-tools/blob/f16f4a96e1e326733ab0ef940e2c9247b6285694/src/Db/WpDbAdapter.php#L76-L86
13,538
inpsyde/wp-db-tools
src/Db/WpDbAdapter.php
WpDbAdapter.query_statement
public function query_statement( Statement $statement, array $data, $options = 0 ) { $query = call_user_func_array( [ $this->wpdb, 'prepare' ], array_merge( [ (string) $statement] , $data ) ); $result = $this->query( $query ); $this->last_statement = $statement; return $result; }
php
public function query_statement( Statement $statement, array $data, $options = 0 ) { $query = call_user_func_array( [ $this->wpdb, 'prepare' ], array_merge( [ (string) $statement] , $data ) ); $result = $this->query( $query ); $this->last_statement = $statement; return $result; }
[ "public", "function", "query_statement", "(", "Statement", "$", "statement", ",", "array", "$", "data", ",", "$", "options", "=", "0", ")", "{", "$", "query", "=", "call_user_func_array", "(", "[", "$", "this", "->", "wpdb", ",", "'prepare'", "]", ",", ...
Executes a Statement and return a Result @param Statement $statement @param array $data @param int $options (Optional) @return Result
[ "Executes", "a", "Statement", "and", "return", "a", "Result" ]
f16f4a96e1e326733ab0ef940e2c9247b6285694
https://github.com/inpsyde/wp-db-tools/blob/f16f4a96e1e326733ab0ef940e2c9247b6285694/src/Db/WpDbAdapter.php#L97-L107
13,539
inpsyde/wp-db-tools
src/Db/WpDbAdapter.php
WpDbAdapter.execute_statement
public function execute_statement( Statement $statement, array $data, $options = 0 ) { $this->query_statement( $statement, $data, $options ); return $this->last_affected_rows(); }
php
public function execute_statement( Statement $statement, array $data, $options = 0 ) { $this->query_statement( $statement, $data, $options ); return $this->last_affected_rows(); }
[ "public", "function", "execute_statement", "(", "Statement", "$", "statement", ",", "array", "$", "data", ",", "$", "options", "=", "0", ")", "{", "$", "this", "->", "query_statement", "(", "$", "statement", ",", "$", "data", ",", "$", "options", ")", ...
Executes a Statement and return the number of affected rows @param Statement $statement @param array $data @param int $options (Optional) @return int
[ "Executes", "a", "Statement", "and", "return", "the", "number", "of", "affected", "rows" ]
f16f4a96e1e326733ab0ef940e2c9247b6285694
https://github.com/inpsyde/wp-db-tools/blob/f16f4a96e1e326733ab0ef940e2c9247b6285694/src/Db/WpDbAdapter.php#L118-L123
13,540
inpsyde/wp-db-tools
src/Db/WpDbAdapter.php
WpDbAdapter.last_insert_id
public function last_insert_id( Statement $statement = NULL ) { if ( $statement && ! $this->last_statement === $statement ) return FALSE; return $this->last_insert_id; }
php
public function last_insert_id( Statement $statement = NULL ) { if ( $statement && ! $this->last_statement === $statement ) return FALSE; return $this->last_insert_id; }
[ "public", "function", "last_insert_id", "(", "Statement", "$", "statement", "=", "NULL", ")", "{", "if", "(", "$", "statement", "&&", "!", "$", "this", "->", "last_statement", "===", "$", "statement", ")", "return", "FALSE", ";", "return", "$", "this", "...
Returns the inserted ID of the last executed statement. If a statement is provided it should be verified that it is the same as the last executed one. @param Statement $statement (Optional) @return int|false
[ "Returns", "the", "inserted", "ID", "of", "the", "last", "executed", "statement", ".", "If", "a", "statement", "is", "provided", "it", "should", "be", "verified", "that", "it", "is", "the", "same", "as", "the", "last", "executed", "one", "." ]
f16f4a96e1e326733ab0ef940e2c9247b6285694
https://github.com/inpsyde/wp-db-tools/blob/f16f4a96e1e326733ab0ef940e2c9247b6285694/src/Db/WpDbAdapter.php#L133-L139
13,541
inpsyde/wp-db-tools
src/Db/WpDbAdapter.php
WpDbAdapter.last_affected_rows
public function last_affected_rows( Statement $statement = NULL ) { if ( $statement && ! $this->last_statement === $statement ) return FALSE; return $this->last_affected_rows; }
php
public function last_affected_rows( Statement $statement = NULL ) { if ( $statement && ! $this->last_statement === $statement ) return FALSE; return $this->last_affected_rows; }
[ "public", "function", "last_affected_rows", "(", "Statement", "$", "statement", "=", "NULL", ")", "{", "if", "(", "$", "statement", "&&", "!", "$", "this", "->", "last_statement", "===", "$", "statement", ")", "return", "FALSE", ";", "return", "$", "this",...
Returns the number of affected rows of the last executed statement. If a statement is provided it should be verified that it is the same as the last executed one. @param Statement $statement (Optional) @return mixed
[ "Returns", "the", "number", "of", "affected", "rows", "of", "the", "last", "executed", "statement", ".", "If", "a", "statement", "is", "provided", "it", "should", "be", "verified", "that", "it", "is", "the", "same", "as", "the", "last", "executed", "one", ...
f16f4a96e1e326733ab0ef940e2c9247b6285694
https://github.com/inpsyde/wp-db-tools/blob/f16f4a96e1e326733ab0ef940e2c9247b6285694/src/Db/WpDbAdapter.php#L150-L156
13,542
webtrendi/clapp
src/Clapp/CommandLineArgumentDefinition.php
CommandLineArgumentDefinition.paramExists
public function paramExists($name) { if (!$this->isParsed) { $this->parseDefinitions(); } //if if (strlen($name) == 1) { return isset($this->shortNames[$name]); } else { return isset($this->longNames[$name]); } //if }
php
public function paramExists($name) { if (!$this->isParsed) { $this->parseDefinitions(); } //if if (strlen($name) == 1) { return isset($this->shortNames[$name]); } else { return isset($this->longNames[$name]); } //if }
[ "public", "function", "paramExists", "(", "$", "name", ")", "{", "if", "(", "!", "$", "this", "->", "isParsed", ")", "{", "$", "this", "->", "parseDefinitions", "(", ")", ";", "}", "//if", "if", "(", "strlen", "(", "$", "name", ")", "==", "1", ")...
checks if parameter is allowed @author Patrick Forget <patforg at webtrendi.com> @param string $name either short or long name of the parameter to check @return boolean true if definition exisits, false otherwise
[ "checks", "if", "parameter", "is", "allowed" ]
2747f7abaefd70c107ef553e01f3d812cfa8241c
https://github.com/webtrendi/clapp/blob/2747f7abaefd70c107ef553e01f3d812cfa8241c/src/Clapp/CommandLineArgumentDefinition.php#L85-L96
13,543
webtrendi/clapp
src/Clapp/CommandLineArgumentDefinition.php
CommandLineArgumentDefinition.allowsValue
public function allowsValue($name) { if (!$this->isParsed) { $this->parseDefinitions(); } //if $longName = (strlen($name) == 1 ? ( isset($this->shortNames[$name]) ? $this->shortNames[$name] : '') : $name); if (isset($this->longNames[$longName])) { return $th...
php
public function allowsValue($name) { if (!$this->isParsed) { $this->parseDefinitions(); } //if $longName = (strlen($name) == 1 ? ( isset($this->shortNames[$name]) ? $this->shortNames[$name] : '') : $name); if (isset($this->longNames[$longName])) { return $th...
[ "public", "function", "allowsValue", "(", "$", "name", ")", "{", "if", "(", "!", "$", "this", "->", "isParsed", ")", "{", "$", "this", "->", "parseDefinitions", "(", ")", ";", "}", "//if", "$", "longName", "=", "(", "strlen", "(", "$", "name", ")",...
checks if parameter allows a value if so what type @author Patrick Forget <patforg at webtrendi.com> @param string $name either short or long name of the parameter to check @return boolean|string false doesn't allow value, The value "string" or "integer" depending which type it allows
[ "checks", "if", "parameter", "allows", "a", "value", "if", "so", "what", "type" ]
2747f7abaefd70c107ef553e01f3d812cfa8241c
https://github.com/webtrendi/clapp/blob/2747f7abaefd70c107ef553e01f3d812cfa8241c/src/Clapp/CommandLineArgumentDefinition.php#L108-L121
13,544
webtrendi/clapp
src/Clapp/CommandLineArgumentDefinition.php
CommandLineArgumentDefinition.getValueType
public function getValueType($name) { if (!$this->isParsed) { $this->parseDefinitions(); } //if $longName = (strlen($name) == 1 ? ( isset($this->shortNames[$name]) ? $this->shortNames[$name] : '') : $name); if (isset($this->longNames[$longName]['parameterType']) ...
php
public function getValueType($name) { if (!$this->isParsed) { $this->parseDefinitions(); } //if $longName = (strlen($name) == 1 ? ( isset($this->shortNames[$name]) ? $this->shortNames[$name] : '') : $name); if (isset($this->longNames[$longName]['parameterType']) ...
[ "public", "function", "getValueType", "(", "$", "name", ")", "{", "if", "(", "!", "$", "this", "->", "isParsed", ")", "{", "$", "this", "->", "parseDefinitions", "(", ")", ";", "}", "//if", "$", "longName", "=", "(", "strlen", "(", "$", "name", ")"...
returns the type of value allowed @author Patrick Forget <patforg at webtrendi.com>
[ "returns", "the", "type", "of", "value", "allowed" ]
2747f7abaefd70c107ef553e01f3d812cfa8241c
https://github.com/webtrendi/clapp/blob/2747f7abaefd70c107ef553e01f3d812cfa8241c/src/Clapp/CommandLineArgumentDefinition.php#L128-L142
13,545
webtrendi/clapp
src/Clapp/CommandLineArgumentDefinition.php
CommandLineArgumentDefinition.getShortName
public function getShortName($name) { if (!$this->isParsed) { $this->parseDefinitions(); } //if if (isset($this->longNames[$name])) { return $this->longNames[$name]['shortName']; } else { return null; } //if }
php
public function getShortName($name) { if (!$this->isParsed) { $this->parseDefinitions(); } //if if (isset($this->longNames[$name])) { return $this->longNames[$name]['shortName']; } else { return null; } //if }
[ "public", "function", "getShortName", "(", "$", "name", ")", "{", "if", "(", "!", "$", "this", "->", "isParsed", ")", "{", "$", "this", "->", "parseDefinitions", "(", ")", ";", "}", "//if", "if", "(", "isset", "(", "$", "this", "->", "longNames", "...
retreive short name of a parameter using its long name @author Patrick Forget <patforg at webtrendi.com> @param string $name long name of the parameter to check @return string character of the short name or null if it doesn't exist
[ "retreive", "short", "name", "of", "a", "parameter", "using", "its", "long", "name" ]
2747f7abaefd70c107ef553e01f3d812cfa8241c
https://github.com/webtrendi/clapp/blob/2747f7abaefd70c107ef553e01f3d812cfa8241c/src/Clapp/CommandLineArgumentDefinition.php#L178-L189
13,546
webtrendi/clapp
src/Clapp/CommandLineArgumentDefinition.php
CommandLineArgumentDefinition.getLongName
public function getLongName($name) { if (!$this->isParsed) { $this->parseDefinitions(); } //if if (isset($this->shortNames[$name])) { return $this->shortNames[$name]; } else { return null; } //if }
php
public function getLongName($name) { if (!$this->isParsed) { $this->parseDefinitions(); } //if if (isset($this->shortNames[$name])) { return $this->shortNames[$name]; } else { return null; } //if }
[ "public", "function", "getLongName", "(", "$", "name", ")", "{", "if", "(", "!", "$", "this", "->", "isParsed", ")", "{", "$", "this", "->", "parseDefinitions", "(", ")", ";", "}", "//if", "if", "(", "isset", "(", "$", "this", "->", "shortNames", "...
retreive long name of a parameter using its short name @author Patrick Forget <patforg at webtrendi.com> @param string $name short name of the parameter to check @return string long name or null if it doesn't exist
[ "retreive", "long", "name", "of", "a", "parameter", "using", "its", "short", "name" ]
2747f7abaefd70c107ef553e01f3d812cfa8241c
https://github.com/webtrendi/clapp/blob/2747f7abaefd70c107ef553e01f3d812cfa8241c/src/Clapp/CommandLineArgumentDefinition.php#L200-L211
13,547
webtrendi/clapp
src/Clapp/CommandLineArgumentDefinition.php
CommandLineArgumentDefinition.getDescription
public function getDescription($name) { if (!$this->isParsed) { $this->parseDefinitions(); } //if $longName = (strlen($name) == 1 ? ( isset($this->shortNames[$name]) ? $this->shortNames[$name] : '') : $name); if (isset($this->longNames[$longName])) { return ...
php
public function getDescription($name) { if (!$this->isParsed) { $this->parseDefinitions(); } //if $longName = (strlen($name) == 1 ? ( isset($this->shortNames[$name]) ? $this->shortNames[$name] : '') : $name); if (isset($this->longNames[$longName])) { return ...
[ "public", "function", "getDescription", "(", "$", "name", ")", "{", "if", "(", "!", "$", "this", "->", "isParsed", ")", "{", "$", "this", "->", "parseDefinitions", "(", ")", ";", "}", "//if", "$", "longName", "=", "(", "strlen", "(", "$", "name", "...
retreive description of a paramter @author Patrick Forget <patforg at webtrendi.com> @param string $name either short or long name of the parameter to check @return string description or null if it doesn't exist
[ "retreive", "description", "of", "a", "paramter" ]
2747f7abaefd70c107ef553e01f3d812cfa8241c
https://github.com/webtrendi/clapp/blob/2747f7abaefd70c107ef553e01f3d812cfa8241c/src/Clapp/CommandLineArgumentDefinition.php#L222-L235
13,548
webtrendi/clapp
src/Clapp/CommandLineArgumentDefinition.php
CommandLineArgumentDefinition.getUsage
public function getUsage() { if (!$this->isParsed) { $this->parseDefinitions(); } //if /* build list of argument names and calculate the first column width so we can pad to align definitions */ $firstCol = array(); $longestDef = 0; ...
php
public function getUsage() { if (!$this->isParsed) { $this->parseDefinitions(); } //if /* build list of argument names and calculate the first column width so we can pad to align definitions */ $firstCol = array(); $longestDef = 0; ...
[ "public", "function", "getUsage", "(", ")", "{", "if", "(", "!", "$", "this", "->", "isParsed", ")", "{", "$", "this", "->", "parseDefinitions", "(", ")", ";", "}", "//if", "/* build list of argument names and calculate\n the first column width so we can pad...
builds a usage definition based on definition of params @author Patrick Forget <patforg at webtrendi.com>
[ "builds", "a", "usage", "definition", "based", "on", "definition", "of", "params" ]
2747f7abaefd70c107ef553e01f3d812cfa8241c
https://github.com/webtrendi/clapp/blob/2747f7abaefd70c107ef553e01f3d812cfa8241c/src/Clapp/CommandLineArgumentDefinition.php#L242-L293
13,549
webtrendi/clapp
src/Clapp/CommandLineArgumentDefinition.php
CommandLineArgumentDefinition.parseDefinitions
protected function parseDefinitions() { foreach ($this->definitions as $nameDef => $description) { $nameParts = explode("|", $nameDef); if (sizeof($nameParts) !== 2) { throw new \UnexpectedValueException("Unexpected argument name definition expecting \"longName|char\...
php
protected function parseDefinitions() { foreach ($this->definitions as $nameDef => $description) { $nameParts = explode("|", $nameDef); if (sizeof($nameParts) !== 2) { throw new \UnexpectedValueException("Unexpected argument name definition expecting \"longName|char\...
[ "protected", "function", "parseDefinitions", "(", ")", "{", "foreach", "(", "$", "this", "->", "definitions", "as", "$", "nameDef", "=>", "$", "description", ")", "{", "$", "nameParts", "=", "explode", "(", "\"|\"", ",", "$", "nameDef", ")", ";", "if", ...
parses the definitions @author Patrick Forget <patforg at webtrendi.com>
[ "parses", "the", "definitions" ]
2747f7abaefd70c107ef553e01f3d812cfa8241c
https://github.com/webtrendi/clapp/blob/2747f7abaefd70c107ef553e01f3d812cfa8241c/src/Clapp/CommandLineArgumentDefinition.php#L301-L388
13,550
BenConstable/lock
src/BenConstable/Lock/Lock.php
Lock.acquire
public function acquire() { if (!$this->locked) { $this->fp = @fopen($this->filePath, 'a'); if (!$this->fp || !flock($this->fp, LOCK_EX | LOCK_NB)) { throw new LockException("Could not get lock on {$this->filePath}"); } else { $this->locke...
php
public function acquire() { if (!$this->locked) { $this->fp = @fopen($this->filePath, 'a'); if (!$this->fp || !flock($this->fp, LOCK_EX | LOCK_NB)) { throw new LockException("Could not get lock on {$this->filePath}"); } else { $this->locke...
[ "public", "function", "acquire", "(", ")", "{", "if", "(", "!", "$", "this", "->", "locked", ")", "{", "$", "this", "->", "fp", "=", "@", "fopen", "(", "$", "this", "->", "filePath", ",", "'a'", ")", ";", "if", "(", "!", "$", "this", "->", "f...
Acquire a lock on the resource. @return \BenConstable\Lock\Lock This, for chaining @throws \BenConstable\Lock\Exception\LockException If lock could not be acquired
[ "Acquire", "a", "lock", "on", "the", "resource", "." ]
40b86cf8c2c4f90374d79c0b0d76999e99ed32c6
https://github.com/BenConstable/lock/blob/40b86cf8c2c4f90374d79c0b0d76999e99ed32c6/src/BenConstable/Lock/Lock.php#L64-L77
13,551
BenConstable/lock
src/BenConstable/Lock/Lock.php
Lock.release
public function release() { if ($this->locked) { flock($this->fp, LOCK_UN); fclose($this->fp); $this->fp = null; $this->locked = false; } return $this; }
php
public function release() { if ($this->locked) { flock($this->fp, LOCK_UN); fclose($this->fp); $this->fp = null; $this->locked = false; } return $this; }
[ "public", "function", "release", "(", ")", "{", "if", "(", "$", "this", "->", "locked", ")", "{", "flock", "(", "$", "this", "->", "fp", ",", "LOCK_UN", ")", ";", "fclose", "(", "$", "this", "->", "fp", ")", ";", "$", "this", "->", "fp", "=", ...
Release the lock on the resource, if we have one. @return \BenConstable\Lock\Lock This, for chaining
[ "Release", "the", "lock", "on", "the", "resource", "if", "we", "have", "one", "." ]
40b86cf8c2c4f90374d79c0b0d76999e99ed32c6
https://github.com/BenConstable/lock/blob/40b86cf8c2c4f90374d79c0b0d76999e99ed32c6/src/BenConstable/Lock/Lock.php#L84-L95
13,552
econic/CsvReader
Classes/Econic/CsvReader/Reader.php
Reader.addKeys
public function addKeys($keys) { foreach ((array)$keys as $position => $key) { $this->keys[$position] = $key; } return $this; }
php
public function addKeys($keys) { foreach ((array)$keys as $position => $key) { $this->keys[$position] = $key; } return $this; }
[ "public", "function", "addKeys", "(", "$", "keys", ")", "{", "foreach", "(", "(", "array", ")", "$", "keys", "as", "$", "position", "=>", "$", "key", ")", "{", "$", "this", "->", "keys", "[", "$", "position", "]", "=", "$", "key", ";", "}", "re...
Sets the keys for the properties Existing keys will be overridden only when necessary @param array $keys two dimensional array with the keys
[ "Sets", "the", "keys", "for", "the", "properties", "Existing", "keys", "will", "be", "overridden", "only", "when", "necessary" ]
d650c278ab0602ffe1f5847580e0cf0f1c8167ae
https://github.com/econic/CsvReader/blob/d650c278ab0602ffe1f5847580e0cf0f1c8167ae/Classes/Econic/CsvReader/Reader.php#L254-L259
13,553
econic/CsvReader
Classes/Econic/CsvReader/Reader.php
Reader.setKey
public function setKey($location, $key) { $this->keys[(integer)$location] = (string)$key; return $this; }
php
public function setKey($location, $key) { $this->keys[(integer)$location] = (string)$key; return $this; }
[ "public", "function", "setKey", "(", "$", "location", ",", "$", "key", ")", "{", "$", "this", "->", "keys", "[", "(", "integer", ")", "$", "location", "]", "=", "(", "string", ")", "$", "key", ";", "return", "$", "this", ";", "}" ]
Sets the key for a property @param integer $location which key should be replaced @param string $key what the new associative key should be named like
[ "Sets", "the", "key", "for", "a", "property" ]
d650c278ab0602ffe1f5847580e0cf0f1c8167ae
https://github.com/econic/CsvReader/blob/d650c278ab0602ffe1f5847580e0cf0f1c8167ae/Classes/Econic/CsvReader/Reader.php#L267-L270
13,554
econic/CsvReader
Classes/Econic/CsvReader/Reader.php
Reader.resetModifiers
public function resetModifiers($key = false) { if ($key) { unset($this->modifiers[$key]); } else { $this->modifiers = array(); } return $this; }
php
public function resetModifiers($key = false) { if ($key) { unset($this->modifiers[$key]); } else { $this->modifiers = array(); } return $this; }
[ "public", "function", "resetModifiers", "(", "$", "key", "=", "false", ")", "{", "if", "(", "$", "key", ")", "{", "unset", "(", "$", "this", "->", "modifiers", "[", "$", "key", "]", ")", ";", "}", "else", "{", "$", "this", "->", "modifiers", "=",...
resets the modifiers
[ "resets", "the", "modifiers" ]
d650c278ab0602ffe1f5847580e0cf0f1c8167ae
https://github.com/econic/CsvReader/blob/d650c278ab0602ffe1f5847580e0cf0f1c8167ae/Classes/Econic/CsvReader/Reader.php#L304-L311
13,555
econic/CsvReader
Classes/Econic/CsvReader/Reader.php
Reader.parse
public function parse() { $lines = str_getcsv($this->source, $this->newline, $this->enclosure, $this->escape); // add keys from headline if available if ($this->getSourceHasHeadline()) { $keys = explode($this->delimiter, $lines[0]); $this->addKeys($keys); unset($lines[0]); } foreach ($lines as $li...
php
public function parse() { $lines = str_getcsv($this->source, $this->newline, $this->enclosure, $this->escape); // add keys from headline if available if ($this->getSourceHasHeadline()) { $keys = explode($this->delimiter, $lines[0]); $this->addKeys($keys); unset($lines[0]); } foreach ($lines as $li...
[ "public", "function", "parse", "(", ")", "{", "$", "lines", "=", "str_getcsv", "(", "$", "this", "->", "source", ",", "$", "this", "->", "newline", ",", "$", "this", "->", "enclosure", ",", "$", "this", "->", "escape", ")", ";", "// add keys from headl...
main function, parses the source and returns the result array @return array result
[ "main", "function", "parses", "the", "source", "and", "returns", "the", "result", "array" ]
d650c278ab0602ffe1f5847580e0cf0f1c8167ae
https://github.com/econic/CsvReader/blob/d650c278ab0602ffe1f5847580e0cf0f1c8167ae/Classes/Econic/CsvReader/Reader.php#L318-L364
13,556
nyeholt/silverstripe-simplewiki
thirdparty/htmlpurifier-4.0.0-lite/library/HTMLPurifier/PropertyList.php
HTMLPurifier_PropertyList.squash
public function squash($force = false) { if ($this->cache !== null && !$force) return $this->cache; if ($this->parent) { return $this->cache = array_merge($this->parent->squash($force), $this->data); } else { return $this->cache = $this->data; } }
php
public function squash($force = false) { if ($this->cache !== null && !$force) return $this->cache; if ($this->parent) { return $this->cache = array_merge($this->parent->squash($force), $this->data); } else { return $this->cache = $this->data; } }
[ "public", "function", "squash", "(", "$", "force", "=", "false", ")", "{", "if", "(", "$", "this", "->", "cache", "!==", "null", "&&", "!", "$", "force", ")", "return", "$", "this", "->", "cache", ";", "if", "(", "$", "this", "->", "parent", ")",...
Squashes this property list and all of its property lists into a single array, and returns the array. This value is cached by default. @param $force If true, ignores the cache and regenerates the array.
[ "Squashes", "this", "property", "list", "and", "all", "of", "its", "property", "lists", "into", "a", "single", "array", "and", "returns", "the", "array", ".", "This", "value", "is", "cached", "by", "default", "." ]
ecffed0d75be1454901e1cb24633472b8f67c967
https://github.com/nyeholt/silverstripe-simplewiki/blob/ecffed0d75be1454901e1cb24633472b8f67c967/thirdparty/htmlpurifier-4.0.0-lite/library/HTMLPurifier/PropertyList.php#L62-L69
13,557
ignasbernotas/console
src/Process/Signals.php
Signals.handleExit
public function handleExit(\Closure $callback) { // You cannot assign a signal handler for SIGKILL $this->append(SIGHUP, $callback); $this->append(SIGINT, $callback); $this->append(SIGQUIT, $callback); $this->append(SIGTERM, $callback); }
php
public function handleExit(\Closure $callback) { // You cannot assign a signal handler for SIGKILL $this->append(SIGHUP, $callback); $this->append(SIGINT, $callback); $this->append(SIGQUIT, $callback); $this->append(SIGTERM, $callback); }
[ "public", "function", "handleExit", "(", "\\", "Closure", "$", "callback", ")", "{", "// You cannot assign a signal handler for SIGKILL", "$", "this", "->", "append", "(", "SIGHUP", ",", "$", "callback", ")", ";", "$", "this", "->", "append", "(", "SIGINT", ",...
Handle application exit signals @param \Closure $callback callback to run after the signal is received @return void
[ "Handle", "application", "exit", "signals" ]
909e613b140413062424d6a465da08aac355be55
https://github.com/ignasbernotas/console/blob/909e613b140413062424d6a465da08aac355be55/src/Process/Signals.php#L23-L31
13,558
ignasbernotas/console
src/Process/Signals.php
Signals.append
public function append($signal, Closure $callback) { if (empty($this->listeners)) { declare(ticks = 1); } $this->listeners[$signal] = $callback; pcntl_signal($signal, [$this, "executeListener"]); return $this; }
php
public function append($signal, Closure $callback) { if (empty($this->listeners)) { declare(ticks = 1); } $this->listeners[$signal] = $callback; pcntl_signal($signal, [$this, "executeListener"]); return $this; }
[ "public", "function", "append", "(", "$", "signal", ",", "Closure", "$", "callback", ")", "{", "if", "(", "empty", "(", "$", "this", "->", "listeners", ")", ")", "{", "declare", "(", "ticks", "=", "1", ")", ";", "}", "$", "this", "->", "listeners",...
Add signal listener @param int $signal signal id @param \Closure $callback function to run when the signal is received @return $this
[ "Add", "signal", "listener" ]
909e613b140413062424d6a465da08aac355be55
https://github.com/ignasbernotas/console/blob/909e613b140413062424d6a465da08aac355be55/src/Process/Signals.php#L42-L53
13,559
ignasbernotas/console
src/Process/Signals.php
Signals.executeListener
public function executeListener($signal, $exit = true) { $return = null; if (isset($this->listeners[$signal])) { $return = call_user_func_array($this->listeners[$signal], [$signal]); } if (true === $exit) { // exit the application posix_kill(posi...
php
public function executeListener($signal, $exit = true) { $return = null; if (isset($this->listeners[$signal])) { $return = call_user_func_array($this->listeners[$signal], [$signal]); } if (true === $exit) { // exit the application posix_kill(posi...
[ "public", "function", "executeListener", "(", "$", "signal", ",", "$", "exit", "=", "true", ")", "{", "$", "return", "=", "null", ";", "if", "(", "isset", "(", "$", "this", "->", "listeners", "[", "$", "signal", "]", ")", ")", "{", "$", "return", ...
Method which is executed when a signal is received @param int $signal signal Id @param bool $exit @return mixed
[ "Method", "which", "is", "executed", "when", "a", "signal", "is", "received" ]
909e613b140413062424d6a465da08aac355be55
https://github.com/ignasbernotas/console/blob/909e613b140413062424d6a465da08aac355be55/src/Process/Signals.php#L63-L77
13,560
chippyash/Strong-Type
src/Chippyash/Type/TypeFactory.php
TypeFactory.create
public static function create($type, $value, $extra = null) { switch (strtolower($type)) { case 'int': case 'integer': return self::createInt($value); case 'float': case 'double': return self::createFloat($value); ca...
php
public static function create($type, $value, $extra = null) { switch (strtolower($type)) { case 'int': case 'integer': return self::createInt($value); case 'float': case 'double': return self::createFloat($value); ca...
[ "public", "static", "function", "create", "(", "$", "type", ",", "$", "value", ",", "$", "extra", "=", "null", ")", "{", "switch", "(", "strtolower", "(", "$", "type", ")", ")", "{", "case", "'int'", ":", "case", "'integer'", ":", "return", "self", ...
Generic type factory @param string $type @param mixed $value @param mixed $extra required for some types @return \Chippyash\Type\AbstractType @throws InvalidTypeException
[ "Generic", "type", "factory" ]
9d364c10c68c10f768254fb25b0b1db3dbef6fa9
https://github.com/chippyash/Strong-Type/blob/9d364c10c68c10f768254fb25b0b1db3dbef6fa9/src/Chippyash/Type/TypeFactory.php#L39-L66
13,561
chippyash/Strong-Type
src/Chippyash/Type/TypeFactory.php
TypeFactory.createInt
public static function createInt($value) { if ($value instanceof NumericTypeInterface) { return $value->asIntType(); } if (!is_numeric($value)) { throw new \InvalidArgumentException("'{$value}' is no valid numeric for IntType"); } if (self::getRequired...
php
public static function createInt($value) { if ($value instanceof NumericTypeInterface) { return $value->asIntType(); } if (!is_numeric($value)) { throw new \InvalidArgumentException("'{$value}' is no valid numeric for IntType"); } if (self::getRequired...
[ "public", "static", "function", "createInt", "(", "$", "value", ")", "{", "if", "(", "$", "value", "instanceof", "NumericTypeInterface", ")", "{", "return", "$", "value", "->", "asIntType", "(", ")", ";", "}", "if", "(", "!", "is_numeric", "(", "$", "v...
Create an IntType @param mixed $value @return \Chippyash\Type\Number\IntType @throws \InvalidArgumentException
[ "Create", "an", "IntType" ]
9d364c10c68c10f768254fb25b0b1db3dbef6fa9
https://github.com/chippyash/Strong-Type/blob/9d364c10c68c10f768254fb25b0b1db3dbef6fa9/src/Chippyash/Type/TypeFactory.php#L76-L89
13,562
chippyash/Strong-Type
src/Chippyash/Type/TypeFactory.php
TypeFactory.createFloat
public static function createFloat($value) { if ($value instanceof NumericTypeInterface) { return $value->asFloatType(); } if (!is_numeric($value)) { throw new \InvalidArgumentException("'{$value}' is no valid numeric for FloatType"); } if (se...
php
public static function createFloat($value) { if ($value instanceof NumericTypeInterface) { return $value->asFloatType(); } if (!is_numeric($value)) { throw new \InvalidArgumentException("'{$value}' is no valid numeric for FloatType"); } if (se...
[ "public", "static", "function", "createFloat", "(", "$", "value", ")", "{", "if", "(", "$", "value", "instanceof", "NumericTypeInterface", ")", "{", "return", "$", "value", "->", "asFloatType", "(", ")", ";", "}", "if", "(", "!", "is_numeric", "(", "$", ...
Create a FloatType @param mixed $value @return \Chippyash\Type\Number\FloatType|\Chippyash\Type\Number\Rational\GMPRationalType @throws \InvalidArgumentException
[ "Create", "a", "FloatType" ]
9d364c10c68c10f768254fb25b0b1db3dbef6fa9
https://github.com/chippyash/Strong-Type/blob/9d364c10c68c10f768254fb25b0b1db3dbef6fa9/src/Chippyash/Type/TypeFactory.php#L99-L113
13,563
iP1SMS/ip1-php-sdk
src/Recipient/RecipientFactory.php
RecipientFactory.createContactFromStdClass
public static function createContactFromStdClass(\stdClass $stdContact): Contact { if (empty($stdContact->FirstName)) { throw new \InvalidArgumentException("stdClass argument must contain FirstName attribute"); } if (empty($stdContact->Phone)) { throw new \InvalidArgu...
php
public static function createContactFromStdClass(\stdClass $stdContact): Contact { if (empty($stdContact->FirstName)) { throw new \InvalidArgumentException("stdClass argument must contain FirstName attribute"); } if (empty($stdContact->Phone)) { throw new \InvalidArgu...
[ "public", "static", "function", "createContactFromStdClass", "(", "\\", "stdClass", "$", "stdContact", ")", ":", "Contact", "{", "if", "(", "empty", "(", "$", "stdContact", "->", "FirstName", ")", ")", "{", "throw", "new", "\\", "InvalidArgumentException", "("...
Creates a Contact using the stdClass given. @param \stdClass $stdContact An stdClass object matching the format of the IP1 SMS API. @return Contact @throws \InvalidArgumentException Thrown when required parameters in the argument is missing.
[ "Creates", "a", "Contact", "using", "the", "stdClass", "given", "." ]
348e6572a279363ba689c9e0f5689b83a25930f5
https://github.com/iP1SMS/ip1-php-sdk/blob/348e6572a279363ba689c9e0f5689b83a25930f5/src/Recipient/RecipientFactory.php#L37-L56
13,564
iP1SMS/ip1-php-sdk
src/Recipient/RecipientFactory.php
RecipientFactory.createContactFromAttributes
public static function createContactFromAttributes( string $firstName, string $phoneNumber, ?string $lastName = null, ?string $title = null, ?string $organization = null, ?string $email = null, ?string $notes = null ) : Contact { return new Contact( ...
php
public static function createContactFromAttributes( string $firstName, string $phoneNumber, ?string $lastName = null, ?string $title = null, ?string $organization = null, ?string $email = null, ?string $notes = null ) : Contact { return new Contact( ...
[ "public", "static", "function", "createContactFromAttributes", "(", "string", "$", "firstName", ",", "string", "$", "phoneNumber", ",", "?", "string", "$", "lastName", "=", "null", ",", "?", "string", "$", "title", "=", "null", ",", "?", "string", "$", "or...
Creates a Contact using the parameters given. @param string $firstName The first name of the contact in question. @param string $phoneNumber Contact phone number: with country code and without spaces and dashes. @param string|null $lastName Contact last name. @param string|null $title Contact t...
[ "Creates", "a", "Contact", "using", "the", "parameters", "given", "." ]
348e6572a279363ba689c9e0f5689b83a25930f5
https://github.com/iP1SMS/ip1-php-sdk/blob/348e6572a279363ba689c9e0f5689b83a25930f5/src/Recipient/RecipientFactory.php#L68-L86
13,565
iP1SMS/ip1-php-sdk
src/Recipient/RecipientFactory.php
RecipientFactory.createProcessedContactFromStdClassArray
public static function createProcessedContactFromStdClassArray(array $contactArray): ClassValidationArray { $contacts = new ClassValidationArray(); foreach ($contactArray as $c) { $contacts[] = self::createProcessedContactFromStdClass($c); } return $contacts; }
php
public static function createProcessedContactFromStdClassArray(array $contactArray): ClassValidationArray { $contacts = new ClassValidationArray(); foreach ($contactArray as $c) { $contacts[] = self::createProcessedContactFromStdClass($c); } return $contacts; }
[ "public", "static", "function", "createProcessedContactFromStdClassArray", "(", "array", "$", "contactArray", ")", ":", "ClassValidationArray", "{", "$", "contacts", "=", "new", "ClassValidationArray", "(", ")", ";", "foreach", "(", "$", "contactArray", "as", "$", ...
Take an array filled with contact stdClasses and returns a ClassValidationArray filled with ProcessedContact. @param array $contactArray An array filled with stdClass contacts. @return ClassValidationArray Filled with ProcessedContact.
[ "Take", "an", "array", "filled", "with", "contact", "stdClasses", "and", "returns", "a", "ClassValidationArray", "filled", "with", "ProcessedContact", "." ]
348e6572a279363ba689c9e0f5689b83a25930f5
https://github.com/iP1SMS/ip1-php-sdk/blob/348e6572a279363ba689c9e0f5689b83a25930f5/src/Recipient/RecipientFactory.php#L102-L109
13,566
iP1SMS/ip1-php-sdk
src/Recipient/RecipientFactory.php
RecipientFactory.createProcessedContactFromStdClass
public static function createProcessedContactFromStdClass(\stdClass $stdContact): ProcessedContact { if (empty($stdContact->FirstName)) { throw new \InvalidArgumentException("stdClass argument must contain FirstName attribute"); } if (empty($stdContact->Phone)) { thro...
php
public static function createProcessedContactFromStdClass(\stdClass $stdContact): ProcessedContact { if (empty($stdContact->FirstName)) { throw new \InvalidArgumentException("stdClass argument must contain FirstName attribute"); } if (empty($stdContact->Phone)) { thro...
[ "public", "static", "function", "createProcessedContactFromStdClass", "(", "\\", "stdClass", "$", "stdContact", ")", ":", "ProcessedContact", "{", "if", "(", "empty", "(", "$", "stdContact", "->", "FirstName", ")", ")", "{", "throw", "new", "\\", "InvalidArgumen...
Creates a ProcessedContact using the stdClass given. @param \stdClass $stdContact An stdClass object matching the format of the IP1 SMS API. @return ProcessedContact @throws \InvalidArgumentException Thrown when required parameters in the argument is missing.
[ "Creates", "a", "ProcessedContact", "using", "the", "stdClass", "given", "." ]
348e6572a279363ba689c9e0f5689b83a25930f5
https://github.com/iP1SMS/ip1-php-sdk/blob/348e6572a279363ba689c9e0f5689b83a25930f5/src/Recipient/RecipientFactory.php#L116-L138
13,567
iP1SMS/ip1-php-sdk
src/Recipient/RecipientFactory.php
RecipientFactory.createProcessedGroupFromStdClass
public static function createProcessedGroupFromStdClass(\stdClass $stdGroup): ProcessedGroup { return new ProcessedGroup( $stdGroup->Name, $stdGroup->Color, $stdGroup->ID, $stdGroup->OwnerID, new \DateTime($stdGroup->Created), new \Date...
php
public static function createProcessedGroupFromStdClass(\stdClass $stdGroup): ProcessedGroup { return new ProcessedGroup( $stdGroup->Name, $stdGroup->Color, $stdGroup->ID, $stdGroup->OwnerID, new \DateTime($stdGroup->Created), new \Date...
[ "public", "static", "function", "createProcessedGroupFromStdClass", "(", "\\", "stdClass", "$", "stdGroup", ")", ":", "ProcessedGroup", "{", "return", "new", "ProcessedGroup", "(", "$", "stdGroup", "->", "Name", ",", "$", "stdGroup", "->", "Color", ",", "$", "...
Takes a stdClass group and returns a ProcessedGroup. @param \stdClass $stdGroup A single stdClass group. @return ProcessedGroup
[ "Takes", "a", "stdClass", "group", "and", "returns", "a", "ProcessedGroup", "." ]
348e6572a279363ba689c9e0f5689b83a25930f5
https://github.com/iP1SMS/ip1-php-sdk/blob/348e6572a279363ba689c9e0f5689b83a25930f5/src/Recipient/RecipientFactory.php#L153-L163
13,568
iP1SMS/ip1-php-sdk
src/Recipient/RecipientFactory.php
RecipientFactory.createProcessedOutGoingSMSFromStdClass
public static function createProcessedOutGoingSMSFromStdClass(\stdClass $stdClassSMS): ProcessedOutGoingSMS { return new ProcessedOutGoingSMS( $stdClassSMS->From, $stdClassSMS->Message, $stdClassSMS->To, $stdClassSMS->ID, new \DateTime($stdClassSM...
php
public static function createProcessedOutGoingSMSFromStdClass(\stdClass $stdClassSMS): ProcessedOutGoingSMS { return new ProcessedOutGoingSMS( $stdClassSMS->From, $stdClassSMS->Message, $stdClassSMS->To, $stdClassSMS->ID, new \DateTime($stdClassSM...
[ "public", "static", "function", "createProcessedOutGoingSMSFromStdClass", "(", "\\", "stdClass", "$", "stdClassSMS", ")", ":", "ProcessedOutGoingSMS", "{", "return", "new", "ProcessedOutGoingSMS", "(", "$", "stdClassSMS", "->", "From", ",", "$", "stdClassSMS", "->", ...
Creates a ProcessedOutGoingSMS from an stdClass object. @param \stdClass $stdClassSMS An stdClass. @return ProcessedOutGoingSMS
[ "Creates", "a", "ProcessedOutGoingSMS", "from", "an", "stdClass", "object", "." ]
348e6572a279363ba689c9e0f5689b83a25930f5
https://github.com/iP1SMS/ip1-php-sdk/blob/348e6572a279363ba689c9e0f5689b83a25930f5/src/Recipient/RecipientFactory.php#L223-L236
13,569
iP1SMS/ip1-php-sdk
src/Recipient/RecipientFactory.php
RecipientFactory.createProcessedOutGoingSMSFromStdClassArray
public static function createProcessedOutGoingSMSFromStdClassArray(array $stdClassArray): ClassValidationArray { $array = new ClassValidationArray(ProcessedOutGoingSMS::class); foreach ($stdClassArray as $stdClass) { $array[]= self::createProcessedOutGoingSMSFromStdClass($stdClass); ...
php
public static function createProcessedOutGoingSMSFromStdClassArray(array $stdClassArray): ClassValidationArray { $array = new ClassValidationArray(ProcessedOutGoingSMS::class); foreach ($stdClassArray as $stdClass) { $array[]= self::createProcessedOutGoingSMSFromStdClass($stdClass); ...
[ "public", "static", "function", "createProcessedOutGoingSMSFromStdClassArray", "(", "array", "$", "stdClassArray", ")", ":", "ClassValidationArray", "{", "$", "array", "=", "new", "ClassValidationArray", "(", "ProcessedOutGoingSMS", "::", "class", ")", ";", "foreach", ...
Creates a ClassValidationArray filled with ProcessedOutGoingSMS given an array of stdClass. @param array $stdClassArray An array of stdClass OutGoingSMS. @return ClassValidationArray Filled with ProcessedOutGoingSMS.
[ "Creates", "a", "ClassValidationArray", "filled", "with", "ProcessedOutGoingSMS", "given", "an", "array", "of", "stdClass", "." ]
348e6572a279363ba689c9e0f5689b83a25930f5
https://github.com/iP1SMS/ip1-php-sdk/blob/348e6572a279363ba689c9e0f5689b83a25930f5/src/Recipient/RecipientFactory.php#L242-L249
13,570
delatbabel/site-config
src/Repository/ConfigLoaderRepository.php
ConfigLoaderRepository.fetchConfig
public function fetchConfig() { if (Cache::has($this->getCacheKey())) { return Cache::get($this->getCacheKey()); } return null; }
php
public function fetchConfig() { if (Cache::has($this->getCacheKey())) { return Cache::get($this->getCacheKey()); } return null; }
[ "public", "function", "fetchConfig", "(", ")", "{", "if", "(", "Cache", "::", "has", "(", "$", "this", "->", "getCacheKey", "(", ")", ")", ")", "{", "return", "Cache", "::", "get", "(", "$", "this", "->", "getCacheKey", "(", ")", ")", ";", "}", "...
Fetch the stored config from the cache. @return mixed
[ "Fetch", "the", "stored", "config", "from", "the", "cache", "." ]
e547e63f5ea7140036bb3fe46ff47143b4f93d0f
https://github.com/delatbabel/site-config/blob/e547e63f5ea7140036bb3fe46ff47143b4f93d0f/src/Repository/ConfigLoaderRepository.php#L78-L85
13,571
delatbabel/site-config
src/Repository/ConfigLoaderRepository.php
ConfigLoaderRepository.loadEnvironment
public function loadEnvironment() { // Fetch the current application environment. $this->environment = app()->environment(); $this->website_id = null; // Fetch the current web site data and check to see if it has an // alternative environment. $website_data = Websit...
php
public function loadEnvironment() { // Fetch the current application environment. $this->environment = app()->environment(); $this->website_id = null; // Fetch the current web site data and check to see if it has an // alternative environment. $website_data = Websit...
[ "public", "function", "loadEnvironment", "(", ")", "{", "// Fetch the current application environment.", "$", "this", "->", "environment", "=", "app", "(", ")", "->", "environment", "(", ")", ";", "$", "this", "->", "website_id", "=", "null", ";", "// Fetch the ...
Loads the internal website_id and environment @return ConfigLoaderRepository
[ "Loads", "the", "internal", "website_id", "and", "environment" ]
e547e63f5ea7140036bb3fe46ff47143b4f93d0f
https://github.com/delatbabel/site-config/blob/e547e63f5ea7140036bb3fe46ff47143b4f93d0f/src/Repository/ConfigLoaderRepository.php#L115-L135
13,572
delatbabel/site-config
src/Repository/ConfigLoaderRepository.php
ConfigLoaderRepository.loadConfiguration
public function loadConfiguration() { /** @var ConfigLoaderRepository $repository */ $repository = $this->loadEnvironment(); $cache = $repository->fetchConfig(); if (! empty($cache)) { return $cache; } $config = []; // Fetch all groups, and fetc...
php
public function loadConfiguration() { /** @var ConfigLoaderRepository $repository */ $repository = $this->loadEnvironment(); $cache = $repository->fetchConfig(); if (! empty($cache)) { return $cache; } $config = []; // Fetch all groups, and fetc...
[ "public", "function", "loadConfiguration", "(", ")", "{", "/** @var ConfigLoaderRepository $repository */", "$", "repository", "=", "$", "this", "->", "loadEnvironment", "(", ")", ";", "$", "cache", "=", "$", "repository", "->", "fetchConfig", "(", ")", ";", "if...
Load the database backed configuration. This function does the work of loading the entire site configuration from the database and returns it as a group => [key=>value] set. The configuration is retrieved from cache if it already exists there, and stored into the cache after it is loaded. @return array
[ "Load", "the", "database", "backed", "configuration", "." ]
e547e63f5ea7140036bb3fe46ff47143b4f93d0f
https://github.com/delatbabel/site-config/blob/e547e63f5ea7140036bb3fe46ff47143b4f93d0f/src/Repository/ConfigLoaderRepository.php#L147-L172
13,573
delatbabel/site-config
src/Repository/ConfigLoaderRepository.php
ConfigLoaderRepository.setRunningConfiguration
public function setRunningConfiguration(RepositoryContract $config) { // Load the configuration into the current running config. foreach ($this->loadConfiguration() as $group => $groupConfig) { $config->set($group, $groupConfig); } }
php
public function setRunningConfiguration(RepositoryContract $config) { // Load the configuration into the current running config. foreach ($this->loadConfiguration() as $group => $groupConfig) { $config->set($group, $groupConfig); } }
[ "public", "function", "setRunningConfiguration", "(", "RepositoryContract", "$", "config", ")", "{", "// Load the configuration into the current running config.", "foreach", "(", "$", "this", "->", "loadConfiguration", "(", ")", "as", "$", "group", "=>", "$", "groupConf...
Load the database backed configuration and save it Load the database backed configuration and save it into the current running config @param RepositoryContract $config @return void
[ "Load", "the", "database", "backed", "configuration", "and", "save", "it" ]
e547e63f5ea7140036bb3fe46ff47143b4f93d0f
https://github.com/delatbabel/site-config/blob/e547e63f5ea7140036bb3fe46ff47143b4f93d0f/src/Repository/ConfigLoaderRepository.php#L183-L189
13,574
guillaumemonet/Rad
src/Rad/Utils/Filter.php
Filter.matchFilter
public static function matchFilter(array &$datas, array $get) { if (sizeof($get) > 0) { $datas = array_filter($datas, function($obj) use($get) { return array_intersect_assoc((array) $obj, $get) == $get; }); } }
php
public static function matchFilter(array &$datas, array $get) { if (sizeof($get) > 0) { $datas = array_filter($datas, function($obj) use($get) { return array_intersect_assoc((array) $obj, $get) == $get; }); } }
[ "public", "static", "function", "matchFilter", "(", "array", "&", "$", "datas", ",", "array", "$", "get", ")", "{", "if", "(", "sizeof", "(", "$", "get", ")", ">", "0", ")", "{", "$", "datas", "=", "array_filter", "(", "$", "datas", ",", "function"...
Return mathing objects with get filter @param array $datas @param array $get
[ "Return", "mathing", "objects", "with", "get", "filter" ]
cb9932f570cf3c2a7197f81e1d959c2729989e59
https://github.com/guillaumemonet/Rad/blob/cb9932f570cf3c2a7197f81e1d959c2729989e59/src/Rad/Utils/Filter.php#L45-L51
13,575
venta/framework
src/Framework/Kernel/Bootstrap/ErrorHandling.php
ErrorHandling.registerErrorRenderer
private function registerErrorRenderer() { if ($this->kernel()->isCli()) { $this->container()->bind(ErrorRendererContract::class, ConsoleErrorRenderer::class); } else { $this->container()->bind(ErrorRendererContract::class, HttpErrorRenderer::class); } }
php
private function registerErrorRenderer() { if ($this->kernel()->isCli()) { $this->container()->bind(ErrorRendererContract::class, ConsoleErrorRenderer::class); } else { $this->container()->bind(ErrorRendererContract::class, HttpErrorRenderer::class); } }
[ "private", "function", "registerErrorRenderer", "(", ")", "{", "if", "(", "$", "this", "->", "kernel", "(", ")", "->", "isCli", "(", ")", ")", "{", "$", "this", "->", "container", "(", ")", "->", "bind", "(", "ErrorRendererContract", "::", "class", ","...
Registers the default error renderer.
[ "Registers", "the", "default", "error", "renderer", "." ]
514a7854cc69f84f47e62a58cc55efd68b7c9f83
https://github.com/venta/framework/blob/514a7854cc69f84f47e62a58cc55efd68b7c9f83/src/Framework/Kernel/Bootstrap/ErrorHandling.php#L42-L49
13,576
venta/framework
src/Framework/Kernel/Bootstrap/ErrorHandling.php
ErrorHandling.registerErrorReporters
private function registerErrorReporters() { $this->container()->factory( ErrorReporterAggregateContract::class, function () { $reporters = new ErrorReporterAggregate($this->container()); $reporters->push(LogErrorReporter::class); retur...
php
private function registerErrorReporters() { $this->container()->factory( ErrorReporterAggregateContract::class, function () { $reporters = new ErrorReporterAggregate($this->container()); $reporters->push(LogErrorReporter::class); retur...
[ "private", "function", "registerErrorReporters", "(", ")", "{", "$", "this", "->", "container", "(", ")", "->", "factory", "(", "ErrorReporterAggregateContract", "::", "class", ",", "function", "(", ")", "{", "$", "reporters", "=", "new", "ErrorReporterAggregate...
Registers default error reporters.
[ "Registers", "default", "error", "reporters", "." ]
514a7854cc69f84f47e62a58cc55efd68b7c9f83
https://github.com/venta/framework/blob/514a7854cc69f84f47e62a58cc55efd68b7c9f83/src/Framework/Kernel/Bootstrap/ErrorHandling.php#L54-L66
13,577
venta/framework
src/Http/src/Cookie.php
Cookie.freezeExpiration
private function freezeExpiration(DateTimeInterface $expires): DateTimeImmutable { if (!$expires instanceof DateTimeImmutable) { $expires = new DateTimeImmutable($expires->format(DateTime::ISO8601), $expires->getTimezone()); } return $expires; }
php
private function freezeExpiration(DateTimeInterface $expires): DateTimeImmutable { if (!$expires instanceof DateTimeImmutable) { $expires = new DateTimeImmutable($expires->format(DateTime::ISO8601), $expires->getTimezone()); } return $expires; }
[ "private", "function", "freezeExpiration", "(", "DateTimeInterface", "$", "expires", ")", ":", "DateTimeImmutable", "{", "if", "(", "!", "$", "expires", "instanceof", "DateTimeImmutable", ")", "{", "$", "expires", "=", "new", "DateTimeImmutable", "(", "$", "expi...
Creates immutable date time instance from the provided one. @param DateTimeInterface $expires @return DateTimeImmutable
[ "Creates", "immutable", "date", "time", "instance", "from", "the", "provided", "one", "." ]
514a7854cc69f84f47e62a58cc55efd68b7c9f83
https://github.com/venta/framework/blob/514a7854cc69f84f47e62a58cc55efd68b7c9f83/src/Http/src/Cookie.php#L263-L270
13,578
Im0rtality/Underscore
src/Mutator/ShuffleMutator.php
ShuffleMutator.shuffleAssoc
private function shuffleAssoc(array $values) { $keys = array_keys($values); shuffle($keys); $output = []; foreach ($keys as $key) { $output[$key] = $values[$key]; } return $output; }
php
private function shuffleAssoc(array $values) { $keys = array_keys($values); shuffle($keys); $output = []; foreach ($keys as $key) { $output[$key] = $values[$key]; } return $output; }
[ "private", "function", "shuffleAssoc", "(", "array", "$", "values", ")", "{", "$", "keys", "=", "array_keys", "(", "$", "values", ")", ";", "shuffle", "(", "$", "keys", ")", ";", "$", "output", "=", "[", "]", ";", "foreach", "(", "$", "keys", "as",...
Shuffle an array while preserving keys. @param array $values @return array
[ "Shuffle", "an", "array", "while", "preserving", "keys", "." ]
2deb95cfd340761d00ecd0f033e67ce600f2b535
https://github.com/Im0rtality/Underscore/blob/2deb95cfd340761d00ecd0f033e67ce600f2b535/src/Mutator/ShuffleMutator.php#L30-L41
13,579
mimmi20/Wurfl
src/Handlers/AbstractHandler.php
AbstractHandler.updateUserAgentsWithDeviceIDMap
final public function updateUserAgentsWithDeviceIDMap($userAgent, $deviceID) { if (isset($this->userAgentsWithDeviceID[$this->normalizeUserAgent($userAgent)])) { $this->logger->debug($this->userAgentsWithDeviceID[$this->normalizeUserAgent($userAgent)] . "\t"); //old_id $this->logger-...
php
final public function updateUserAgentsWithDeviceIDMap($userAgent, $deviceID) { if (isset($this->userAgentsWithDeviceID[$this->normalizeUserAgent($userAgent)])) { $this->logger->debug($this->userAgentsWithDeviceID[$this->normalizeUserAgent($userAgent)] . "\t"); //old_id $this->logger-...
[ "final", "public", "function", "updateUserAgentsWithDeviceIDMap", "(", "$", "userAgent", ",", "$", "deviceID", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "userAgentsWithDeviceID", "[", "$", "this", "->", "normalizeUserAgent", "(", "$", "userAgent", ...
Updates the map containing the classified user agents. These are stored in the associative array userAgentsWithDeviceID like user_agent => deviceID. Before adding the user agent to the map it normalizes by using the normalizeUserAgent function. @see normalizeUserAgent() @see userAgentsWithDeviceID @param string $use...
[ "Updates", "the", "map", "containing", "the", "classified", "user", "agents", ".", "These", "are", "stored", "in", "the", "associative", "array", "userAgentsWithDeviceID", "like", "user_agent", "=", ">", "deviceID", ".", "Before", "adding", "the", "user", "agent...
443ed0d73a0b9a21ebd0d6ddf1e32669b9de44ec
https://github.com/mimmi20/Wurfl/blob/443ed0d73a0b9a21ebd0d6ddf1e32669b9de44ec/src/Handlers/AbstractHandler.php#L169-L179
13,580
mimmi20/Wurfl
src/Handlers/AbstractHandler.php
AbstractHandler.getUserAgentsForBucket
public function getUserAgentsForBucket() { if (empty($this->userAgents)) { $this->userAgents = $this->persistenceProvider->load($this->getPrefix(self::PREFIX_UA_BUCKET)); } return $this->userAgents; }
php
public function getUserAgentsForBucket() { if (empty($this->userAgents)) { $this->userAgents = $this->persistenceProvider->load($this->getPrefix(self::PREFIX_UA_BUCKET)); } return $this->userAgents; }
[ "public", "function", "getUserAgentsForBucket", "(", ")", "{", "if", "(", "empty", "(", "$", "this", "->", "userAgents", ")", ")", "{", "$", "this", "->", "userAgents", "=", "$", "this", "->", "persistenceProvider", "->", "load", "(", "$", "this", "->", ...
Returns a list of User Agents associated with the bucket @return array User agents
[ "Returns", "a", "list", "of", "User", "Agents", "associated", "with", "the", "bucket" ]
443ed0d73a0b9a21ebd0d6ddf1e32669b9de44ec
https://github.com/mimmi20/Wurfl/blob/443ed0d73a0b9a21ebd0d6ddf1e32669b9de44ec/src/Handlers/AbstractHandler.php#L238-L245
13,581
mimmi20/Wurfl
src/VirtualCapability/Tool/DeviceFactory.php
DeviceFactory.normalizeBrowser
private static function normalizeBrowser(Device $device) { if ($device->getBrowser()->name === 'IE' && preg_match('#Trident/([\d\.]+)#', $device->getDeviceUa(), $matches)) { if (array_key_exists($matches[1], self::$trident_map)) { $compatibilityViewCheck = self::$trident_map[$mat...
php
private static function normalizeBrowser(Device $device) { if ($device->getBrowser()->name === 'IE' && preg_match('#Trident/([\d\.]+)#', $device->getDeviceUa(), $matches)) { if (array_key_exists($matches[1], self::$trident_map)) { $compatibilityViewCheck = self::$trident_map[$mat...
[ "private", "static", "function", "normalizeBrowser", "(", "Device", "$", "device", ")", "{", "if", "(", "$", "device", "->", "getBrowser", "(", ")", "->", "name", "===", "'IE'", "&&", "preg_match", "(", "'#Trident/([\\d\\.]+)#'", ",", "$", "device", "->", ...
normalize the Browser Information @param \Wurfl\VirtualCapability\Tool\Device $device
[ "normalize", "the", "Browser", "Information" ]
443ed0d73a0b9a21ebd0d6ddf1e32669b9de44ec
https://github.com/mimmi20/Wurfl/blob/443ed0d73a0b9a21ebd0d6ddf1e32669b9de44ec/src/VirtualCapability/Tool/DeviceFactory.php#L909-L922
13,582
astronati/php-fantasy-football-quotations-parser
src/Map/Row/Normalizer/Field/NormalizedFieldsContainer.php
NormalizedFieldsContainer.add
public function add(string $type, RowFieldNormalizerInterface $normalizer) { $this->normalizers[$type] = $normalizer; return $this; }
php
public function add(string $type, RowFieldNormalizerInterface $normalizer) { $this->normalizers[$type] = $normalizer; return $this; }
[ "public", "function", "add", "(", "string", "$", "type", ",", "RowFieldNormalizerInterface", "$", "normalizer", ")", "{", "$", "this", "->", "normalizers", "[", "$", "type", "]", "=", "$", "normalizer", ";", "return", "$", "this", ";", "}" ]
Add a new normalized field @param string $type The name of the field @param RowFieldNormalizerInterface $normalizer @return $this
[ "Add", "a", "new", "normalized", "field" ]
1214f313c325ac7e9fc4d5218b85b3d7234f7bf3
https://github.com/astronati/php-fantasy-football-quotations-parser/blob/1214f313c325ac7e9fc4d5218b85b3d7234f7bf3/src/Map/Row/Normalizer/Field/NormalizedFieldsContainer.php#L18-L22
13,583
nyeholt/silverstripe-simplewiki
thirdparty/htmlpurifier-4.0.0-lite/library/HTMLPurifier/HTMLModuleManager.php
HTMLPurifier_HTMLModuleManager.addModule
public function addModule($module) { $this->registerModule($module); if (is_object($module)) $module = $module->name; $this->userModules[] = $module; }
php
public function addModule($module) { $this->registerModule($module); if (is_object($module)) $module = $module->name; $this->userModules[] = $module; }
[ "public", "function", "addModule", "(", "$", "module", ")", "{", "$", "this", "->", "registerModule", "(", "$", "module", ")", ";", "if", "(", "is_object", "(", "$", "module", ")", ")", "$", "module", "=", "$", "module", "->", "name", ";", "$", "th...
Adds a module to the current doctype by first registering it, and then tacking it on to the active doctype
[ "Adds", "a", "module", "to", "the", "current", "doctype", "by", "first", "registering", "it", "and", "then", "tacking", "it", "on", "to", "the", "active", "doctype" ]
ecffed0d75be1454901e1cb24633472b8f67c967
https://github.com/nyeholt/silverstripe-simplewiki/blob/ecffed0d75be1454901e1cb24633472b8f67c967/thirdparty/htmlpurifier-4.0.0-lite/library/HTMLPurifier/HTMLModuleManager.php#L181-L185
13,584
nyeholt/silverstripe-simplewiki
thirdparty/htmlpurifier-4.0.0-lite/library/HTMLPurifier/HTMLModuleManager.php
HTMLPurifier_HTMLModuleManager.getElements
public function getElements() { $elements = array(); foreach ($this->modules as $module) { if (!$this->trusted && !$module->safe) continue; foreach ($module->info as $name => $v) { if (isset($elements[$name])) continue; $elements[$name] = $this->g...
php
public function getElements() { $elements = array(); foreach ($this->modules as $module) { if (!$this->trusted && !$module->safe) continue; foreach ($module->info as $name => $v) { if (isset($elements[$name])) continue; $elements[$name] = $this->g...
[ "public", "function", "getElements", "(", ")", "{", "$", "elements", "=", "array", "(", ")", ";", "foreach", "(", "$", "this", "->", "modules", "as", "$", "module", ")", "{", "if", "(", "!", "$", "this", "->", "trusted", "&&", "!", "$", "module", ...
Retrieves merged element definitions. @return Array of HTMLPurifier_ElementDef
[ "Retrieves", "merged", "element", "definitions", "." ]
ecffed0d75be1454901e1cb24633472b8f67c967
https://github.com/nyeholt/silverstripe-simplewiki/blob/ecffed0d75be1454901e1cb24633472b8f67c967/thirdparty/htmlpurifier-4.0.0-lite/library/HTMLPurifier/HTMLModuleManager.php#L299-L318
13,585
wpup/digster
src/extensions/class-i18n-extensions.php
I18n_Extensions.trans
public function trans( $message ) { $theme = wp_get_theme(); $domain = $theme->get( 'TextDomain' ); return __( $message, $domain ); }
php
public function trans( $message ) { $theme = wp_get_theme(); $domain = $theme->get( 'TextDomain' ); return __( $message, $domain ); }
[ "public", "function", "trans", "(", "$", "message", ")", "{", "$", "theme", "=", "wp_get_theme", "(", ")", ";", "$", "domain", "=", "$", "theme", "->", "get", "(", "'TextDomain'", ")", ";", "return", "__", "(", "$", "message", ",", "$", "domain", "...
Translate message. @param string $message @return string
[ "Translate", "message", "." ]
9ef9626ce82673af698bc0976d6c38a532e4a6d9
https://github.com/wpup/digster/blob/9ef9626ce82673af698bc0976d6c38a532e4a6d9/src/extensions/class-i18n-extensions.php#L46-L50
13,586
cbednarski/pharcc
src/cbednarski/Pharcc/Config.php
Config.loadFile
public static function loadFile($path) { if (!realpath($path)) { throw new \RuntimeException('Unable to load configuration file from ' . $path); } $data = Yaml::parse($path); return new static(pathinfo($path, PATHINFO_DIRNAME), $data); }
php
public static function loadFile($path) { if (!realpath($path)) { throw new \RuntimeException('Unable to load configuration file from ' . $path); } $data = Yaml::parse($path); return new static(pathinfo($path, PATHINFO_DIRNAME), $data); }
[ "public", "static", "function", "loadFile", "(", "$", "path", ")", "{", "if", "(", "!", "realpath", "(", "$", "path", ")", ")", "{", "throw", "new", "\\", "RuntimeException", "(", "'Unable to load configuration file from '", ".", "$", "path", ")", ";", "}"...
Load configuration data from the specified file @param string $path Read this config file @return self @throws \RuntimeException
[ "Load", "configuration", "data", "from", "the", "specified", "file" ]
562f9d3d13d2856de6a7ca846a83fe70897baaea
https://github.com/cbednarski/pharcc/blob/562f9d3d13d2856de6a7ca846a83fe70897baaea/src/cbednarski/Pharcc/Config.php#L22-L31
13,587
webtrendi/clapp
src/Clapp/CommandArgumentFilter.php
CommandArgumentFilter.getParam
public function getParam($name) { if (!$this->parsed) { $this->parseParams(); } //if $longName = strlen($name) === 1 ? $this->definitions->getLongName($name) : $name; if (isset($this->params[$longName])) { return $this->params[$longName]; } else { ...
php
public function getParam($name) { if (!$this->parsed) { $this->parseParams(); } //if $longName = strlen($name) === 1 ? $this->definitions->getLongName($name) : $name; if (isset($this->params[$longName])) { return $this->params[$longName]; } else { ...
[ "public", "function", "getParam", "(", "$", "name", ")", "{", "if", "(", "!", "$", "this", "->", "parsed", ")", "{", "$", "this", "->", "parseParams", "(", ")", ";", "}", "//if", "$", "longName", "=", "strlen", "(", "$", "name", ")", "===", "1", ...
returns parameter matching provided name @author Patrick Forget <patforg at webtrendi.com> @param string name of the paramter to retreive @return mixed if param the param appears only once the method will return 1 if the parameter doesn't take a value. The specified value for that param will returned if it does take...
[ "returns", "parameter", "matching", "provided", "name" ]
2747f7abaefd70c107ef553e01f3d812cfa8241c
https://github.com/webtrendi/clapp/blob/2747f7abaefd70c107ef553e01f3d812cfa8241c/src/Clapp/CommandArgumentFilter.php#L88-L105
13,588
PandaPlatform/framework
src/Panda/Support/Helpers/UrlHelper.php
UrlHelper.get
public static function get($url, $parameters = [], $host = null, $protocol = null) { // Check url arguments if (empty($url)) { throw new InvalidArgumentException(__METHOD__ . ': The given url is empty.'); } // Get current url info $urlInfo = static::info($url); ...
php
public static function get($url, $parameters = [], $host = null, $protocol = null) { // Check url arguments if (empty($url)) { throw new InvalidArgumentException(__METHOD__ . ': The given url is empty.'); } // Get current url info $urlInfo = static::info($url); ...
[ "public", "static", "function", "get", "(", "$", "url", ",", "$", "parameters", "=", "[", "]", ",", "$", "host", "=", "null", ",", "$", "protocol", "=", "null", ")", "{", "// Check url arguments", "if", "(", "empty", "(", "$", "url", ")", ")", "{",...
Creates and returns a url with parameters in url encoding. @param string $url The base url. @param array $parameters An associative array of parameters as key => value. @param string $host @param string $protocol @return string @throws InvalidArgumentException
[ "Creates", "and", "returns", "a", "url", "with", "parameters", "in", "url", "encoding", "." ]
a78cf051b379896b5a4d5df620988e37a0e632f5
https://github.com/PandaPlatform/framework/blob/a78cf051b379896b5a4d5df620988e37a0e632f5/src/Panda/Support/Helpers/UrlHelper.php#L33-L58
13,589
joomla-projects/jorobo
src/Tasks/Build/Base.php
Base.addFiles
public function addFiles($type, $fileArray) { $method = 'add' . ucfirst($type) . "Files"; if (method_exists($this, $method)) { $this->$method($fileArray); } else { $this->say('Missing method: ' . $method); } return true; }
php
public function addFiles($type, $fileArray) { $method = 'add' . ucfirst($type) . "Files"; if (method_exists($this, $method)) { $this->$method($fileArray); } else { $this->say('Missing method: ' . $method); } return true; }
[ "public", "function", "addFiles", "(", "$", "type", ",", "$", "fileArray", ")", "{", "$", "method", "=", "'add'", ".", "ucfirst", "(", "$", "type", ")", ".", "\"Files\"", ";", "if", "(", "method_exists", "(", "$", "this", ",", "$", "method", ")", "...
Add files to array @param string $type - Type (media, component etc.) @param array $fileArray - File array @return bool @since 1.0
[ "Add", "files", "to", "array" ]
e72dd0ed15f387739f67cacdbc2c0bd1b427f317
https://github.com/joomla-projects/jorobo/blob/e72dd0ed15f387739f67cacdbc2c0bd1b427f317/src/Tasks/Build/Base.php#L116-L130
13,590
joomla-projects/jorobo
src/Tasks/Build/Base.php
Base.getFiles
public function getFiles($type) { $f = $type . 'Files'; if (property_exists($this, $f)) { return self::${$f}; } $this->say('Missing Files: ' . $type); return ""; }
php
public function getFiles($type) { $f = $type . 'Files'; if (property_exists($this, $f)) { return self::${$f}; } $this->say('Missing Files: ' . $type); return ""; }
[ "public", "function", "getFiles", "(", "$", "type", ")", "{", "$", "f", "=", "$", "type", ".", "'Files'", ";", "if", "(", "property_exists", "(", "$", "this", ",", "$", "f", ")", ")", "{", "return", "self", "::", "$", "{", "$", "f", "}", ";", ...
Retrieve the files @param string $type Type (media, component etc.) @return mixed @since 1.0
[ "Retrieve", "the", "files" ]
e72dd0ed15f387739f67cacdbc2c0bd1b427f317
https://github.com/joomla-projects/jorobo/blob/e72dd0ed15f387739f67cacdbc2c0bd1b427f317/src/Tasks/Build/Base.php#L141-L153
13,591
joomla-projects/jorobo
src/Tasks/Build/Base.php
Base.copyTarget
protected function copyTarget($path, $tar) { $map = array(); $hdl = opendir($path); while ($entry = readdir($hdl)) { $p = $path . "/" . $entry; // Ignore hidden files if (substr($entry, 0, 1) != '.') { if (isset($this->getJConfig()->exclude) && in_array($entry, explode(',', $this->getJCo...
php
protected function copyTarget($path, $tar) { $map = array(); $hdl = opendir($path); while ($entry = readdir($hdl)) { $p = $path . "/" . $entry; // Ignore hidden files if (substr($entry, 0, 1) != '.') { if (isset($this->getJConfig()->exclude) && in_array($entry, explode(',', $this->getJCo...
[ "protected", "function", "copyTarget", "(", "$", "path", ",", "$", "tar", ")", "{", "$", "map", "=", "array", "(", ")", ";", "$", "hdl", "=", "opendir", "(", "$", "path", ")", ";", "while", "(", "$", "entry", "=", "readdir", "(", "$", "hdl", ")...
Copies the files and maps them into an array @param string $path - Folder path @param string $tar - Target path @return array @since 1.0
[ "Copies", "the", "files", "and", "maps", "them", "into", "an", "array" ]
e72dd0ed15f387739f67cacdbc2c0bd1b427f317
https://github.com/joomla-projects/jorobo/blob/e72dd0ed15f387739f67cacdbc2c0bd1b427f317/src/Tasks/Build/Base.php#L236-L270
13,592
joomla-projects/jorobo
src/Tasks/Build/Base.php
Base.generatePluginFileList
public function generatePluginFileList($files, $plugin) { if (!count($files)) { return ""; } $text = array(); foreach ($files as $f) { foreach ($f as $type => $value) { $p = ""; if ($value == $plugin . ".php") { $p = ' plugin="' . $plugin . '"'; } $text[] = "<" . $typ...
php
public function generatePluginFileList($files, $plugin) { if (!count($files)) { return ""; } $text = array(); foreach ($files as $f) { foreach ($f as $type => $value) { $p = ""; if ($value == $plugin . ".php") { $p = ' plugin="' . $plugin . '"'; } $text[] = "<" . $typ...
[ "public", "function", "generatePluginFileList", "(", "$", "files", ",", "$", "plugin", ")", "{", "if", "(", "!", "count", "(", "$", "files", ")", ")", "{", "return", "\"\"", ";", "}", "$", "text", "=", "array", "(", ")", ";", "foreach", "(", "$", ...
Generate a list of files for plugins @param array $files Files and Folders array @param string $plugin The plugin file @return string @since 1.0
[ "Generate", "a", "list", "of", "files", "for", "plugins" ]
e72dd0ed15f387739f67cacdbc2c0bd1b427f317
https://github.com/joomla-projects/jorobo/blob/e72dd0ed15f387739f67cacdbc2c0bd1b427f317/src/Tasks/Build/Base.php#L379-L405
13,593
joomla-projects/jorobo
src/Tasks/Build/Base.php
Base.generateModuleFileList
public function generateModuleFileList($files, $module) { if (!count($files)) { return ""; } $text = array(); foreach ($files as $f) { foreach ($f as $type => $value) { $p = ""; if ($value == $module . ".php") { $p = ' module="' . $module . '"'; } $text[] = "<" . $typ...
php
public function generateModuleFileList($files, $module) { if (!count($files)) { return ""; } $text = array(); foreach ($files as $f) { foreach ($f as $type => $value) { $p = ""; if ($value == $module . ".php") { $p = ' module="' . $module . '"'; } $text[] = "<" . $typ...
[ "public", "function", "generateModuleFileList", "(", "$", "files", ",", "$", "module", ")", "{", "if", "(", "!", "count", "(", "$", "files", ")", ")", "{", "return", "\"\"", ";", "}", "$", "text", "=", "array", "(", ")", ";", "foreach", "(", "$", ...
Generate a list of files for modules @param array $files Files and Folders array @param string $module The module @return string @since 1.0
[ "Generate", "a", "list", "of", "files", "for", "modules" ]
e72dd0ed15f387739f67cacdbc2c0bd1b427f317
https://github.com/joomla-projects/jorobo/blob/e72dd0ed15f387739f67cacdbc2c0bd1b427f317/src/Tasks/Build/Base.php#L417-L443
13,594
joomla-projects/jorobo
src/Tasks/Build/Base.php
Base.resetFiles
public function resetFiles() { self::$backendFiles = array(); self::$backendLanguageFiles = array(); self::$frontendFiles = array(); self::$frontendLanguageFiles = array(); self::$mediaFiles = array(); }
php
public function resetFiles() { self::$backendFiles = array(); self::$backendLanguageFiles = array(); self::$frontendFiles = array(); self::$frontendLanguageFiles = array(); self::$mediaFiles = array(); }
[ "public", "function", "resetFiles", "(", ")", "{", "self", "::", "$", "backendFiles", "=", "array", "(", ")", ";", "self", "::", "$", "backendLanguageFiles", "=", "array", "(", ")", ";", "self", "::", "$", "frontendFiles", "=", "array", "(", ")", ";", ...
Reset the files list, before build another part @return void @since 1.0
[ "Reset", "the", "files", "list", "before", "build", "another", "part" ]
e72dd0ed15f387739f67cacdbc2c0bd1b427f317
https://github.com/joomla-projects/jorobo/blob/e72dd0ed15f387739f67cacdbc2c0bd1b427f317/src/Tasks/Build/Base.php#L452-L459
13,595
yidas/php-google-api-client-helper
src/services/People.php
People.findByResource
public static function findByResource($resourceName, $optParams=[]) { $optParams = ($optParams) ? $optParams : [ 'personFields' => self::$personFields, ]; self::$person = self::getService()->people->get($resourceName, $optParams); self::$resource...
php
public static function findByResource($resourceName, $optParams=[]) { $optParams = ($optParams) ? $optParams : [ 'personFields' => self::$personFields, ]; self::$person = self::getService()->people->get($resourceName, $optParams); self::$resource...
[ "public", "static", "function", "findByResource", "(", "$", "resourceName", ",", "$", "optParams", "=", "[", "]", ")", "{", "$", "optParams", "=", "(", "$", "optParams", ")", "?", "$", "optParams", ":", "[", "'personFields'", "=>", "self", "::", "$", "...
find a contact to cache @param string $resourceName The resource name of the contact. @param array $optParams @return self
[ "find", "a", "contact", "to", "cache" ]
e0edfebc41fb4e55bcf4125af58304894a2863fe
https://github.com/yidas/php-google-api-client-helper/blob/e0edfebc41fb4e55bcf4125af58304894a2863fe/src/services/People.php#L160-L171
13,596
yidas/php-google-api-client-helper
src/services/People.php
People.listPeopleConnections
public static function listPeopleConnections($optParams=[]) { $optParams = ($optParams) ? $optParams : [ 'pageSize' => 0, 'personFields' => self::$personFields, ]; return self::getService()->people_connections->listPeopleConnections('people/me', $optParams); ...
php
public static function listPeopleConnections($optParams=[]) { $optParams = ($optParams) ? $optParams : [ 'pageSize' => 0, 'personFields' => self::$personFields, ]; return self::getService()->people_connections->listPeopleConnections('people/me', $optParams); ...
[ "public", "static", "function", "listPeopleConnections", "(", "$", "optParams", "=", "[", "]", ")", "{", "$", "optParams", "=", "(", "$", "optParams", ")", "?", "$", "optParams", ":", "[", "'pageSize'", "=>", "0", ",", "'personFields'", "=>", "self", "::...
list People Connections @param array $optParams @return object Google listPeopleConnections()
[ "list", "People", "Connections" ]
e0edfebc41fb4e55bcf4125af58304894a2863fe
https://github.com/yidas/php-google-api-client-helper/blob/e0edfebc41fb4e55bcf4125af58304894a2863fe/src/services/People.php#L179-L187
13,597
yidas/php-google-api-client-helper
src/services/People.php
People.getSimpleContacts
public static function getSimpleContacts() { $contactObj = self::listPeopleConnections(); // Parser $contacts = []; if (count($contactObj->getConnections()) != 0) { foreach ($contactObj->getConnections() as $person) { ...
php
public static function getSimpleContacts() { $contactObj = self::listPeopleConnections(); // Parser $contacts = []; if (count($contactObj->getConnections()) != 0) { foreach ($contactObj->getConnections() as $person) { ...
[ "public", "static", "function", "getSimpleContacts", "(", ")", "{", "$", "contactObj", "=", "self", "::", "listPeopleConnections", "(", ")", ";", "// Parser\r", "$", "contacts", "=", "[", "]", ";", "if", "(", "count", "(", "$", "contactObj", "->", "getConn...
Get simple contact data with parser @return array Contacts
[ "Get", "simple", "contact", "data", "with", "parser" ]
e0edfebc41fb4e55bcf4125af58304894a2863fe
https://github.com/yidas/php-google-api-client-helper/blob/e0edfebc41fb4e55bcf4125af58304894a2863fe/src/services/People.php#L194-L224
13,598
yidas/php-google-api-client-helper
src/services/People.php
People.createContact
public static function createContact() { $person = self::getPerson(); // New person check if (isset($person->resourceName)) { throw new Exception("You should use newPeron() before create", 500); } return self::getService()->people->createContact...
php
public static function createContact() { $person = self::getPerson(); // New person check if (isset($person->resourceName)) { throw new Exception("You should use newPeron() before create", 500); } return self::getService()->people->createContact...
[ "public", "static", "function", "createContact", "(", ")", "{", "$", "person", "=", "self", "::", "getPerson", "(", ")", ";", "// New person check\r", "if", "(", "isset", "(", "$", "person", "->", "resourceName", ")", ")", "{", "throw", "new", "Exception",...
Create a People Contact @return Google_Service_PeopleService_Person
[ "Create", "a", "People", "Contact" ]
e0edfebc41fb4e55bcf4125af58304894a2863fe
https://github.com/yidas/php-google-api-client-helper/blob/e0edfebc41fb4e55bcf4125af58304894a2863fe/src/services/People.php#L231-L241
13,599
yidas/php-google-api-client-helper
src/services/People.php
People.updateContact
public static function updateContact($optParams=null) { self::checkFind(); // Default opt helper $optParams = (is_null($optParams)) ? ['updatePersonFields' => self::$personFields] : $optParams; return self::getService()->people->upd...
php
public static function updateContact($optParams=null) { self::checkFind(); // Default opt helper $optParams = (is_null($optParams)) ? ['updatePersonFields' => self::$personFields] : $optParams; return self::getService()->people->upd...
[ "public", "static", "function", "updateContact", "(", "$", "optParams", "=", "null", ")", "{", "self", "::", "checkFind", "(", ")", ";", "// Default opt helper\r", "$", "optParams", "=", "(", "is_null", "(", "$", "optParams", ")", ")", "?", "[", "'updatePe...
Update a People Contact @param array $optParams Optional parameters. @return Google_Service_PeopleService_PeopleEmpty
[ "Update", "a", "People", "Contact" ]
e0edfebc41fb4e55bcf4125af58304894a2863fe
https://github.com/yidas/php-google-api-client-helper/blob/e0edfebc41fb4e55bcf4125af58304894a2863fe/src/services/People.php#L249-L259