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
21,700
inhere/php-librarys
src/Traits/FixedEventTrait.php
FixedEventTrait.off
public function off(string $event) { if (false === ($key = array_search($event, $this->getSupportedEvents(), true))) { return null; } if (!isset($this->eventHandlers[$key]) || !($cb = $this->eventHandlers[$key])) { return null; } $this->eventHandlers...
php
public function off(string $event) { if (false === ($key = array_search($event, $this->getSupportedEvents(), true))) { return null; } if (!isset($this->eventHandlers[$key]) || !($cb = $this->eventHandlers[$key])) { return null; } $this->eventHandlers...
[ "public", "function", "off", "(", "string", "$", "event", ")", "{", "if", "(", "false", "===", "(", "$", "key", "=", "array_search", "(", "$", "event", ",", "$", "this", "->", "getSupportedEvents", "(", ")", ",", "true", ")", ")", ")", "{", "return...
remove event handler @param string $event @return bool
[ "remove", "event", "handler" ]
e6ca598685469794f310e3ab0e2bc19519cd0ae6
https://github.com/inhere/php-librarys/blob/e6ca598685469794f310e3ab0e2bc19519cd0ae6/src/Traits/FixedEventTrait.php#L124-L137
21,701
oroinc/OroLayoutComponent
DeferredLayoutManipulator.php
DeferredLayoutManipulator.calculateActionCount
protected function calculateActionCount() { $counter = 0; foreach ($this->actions as $actions) { $counter += count($actions); } return $counter; }
php
protected function calculateActionCount() { $counter = 0; foreach ($this->actions as $actions) { $counter += count($actions); } return $counter; }
[ "protected", "function", "calculateActionCount", "(", ")", "{", "$", "counter", "=", "0", ";", "foreach", "(", "$", "this", "->", "actions", "as", "$", "actions", ")", "{", "$", "counter", "+=", "count", "(", "$", "actions", ")", ";", "}", "return", ...
Returns the total number of actions in all groups @return int
[ "Returns", "the", "total", "number", "of", "actions", "in", "all", "groups" ]
682a96672393d81c63728e47c4a4c3618c515be0
https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/DeferredLayoutManipulator.php#L378-L386
21,702
oroinc/OroLayoutComponent
DeferredLayoutManipulator.php
DeferredLayoutManipulator.removeNotImportantRemainingActions
protected function removeNotImportantRemainingActions() { // remove remaining 'move' actions if (!empty($this->actions[self::GROUP_ADD])) { foreach ($this->actions[self::GROUP_ADD] as $index => $action) { if ($action[0] === self::MOVE) { unset($this->a...
php
protected function removeNotImportantRemainingActions() { // remove remaining 'move' actions if (!empty($this->actions[self::GROUP_ADD])) { foreach ($this->actions[self::GROUP_ADD] as $index => $action) { if ($action[0] === self::MOVE) { unset($this->a...
[ "protected", "function", "removeNotImportantRemainingActions", "(", ")", "{", "// remove remaining 'move' actions", "if", "(", "!", "empty", "(", "$", "this", "->", "actions", "[", "self", "::", "GROUP_ADD", "]", ")", ")", "{", "foreach", "(", "$", "this", "->...
Checks if there are any not executed actions and remove actions which are not important
[ "Checks", "if", "there", "are", "any", "not", "executed", "actions", "and", "remove", "actions", "which", "are", "not", "important" ]
682a96672393d81c63728e47c4a4c3618c515be0
https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/DeferredLayoutManipulator.php#L405-L419
21,703
oroinc/OroLayoutComponent
DeferredLayoutManipulator.php
DeferredLayoutManipulator.isActionReadyToExecute
protected function isActionReadyToExecute($key, $args) { switch ($key) { case self::ADD: $parentId = $args[1]; $siblingId = $args[4]; return !$parentId || ( $this->rawLayoutBuilder->...
php
protected function isActionReadyToExecute($key, $args) { switch ($key) { case self::ADD: $parentId = $args[1]; $siblingId = $args[4]; return !$parentId || ( $this->rawLayoutBuilder->...
[ "protected", "function", "isActionReadyToExecute", "(", "$", "key", ",", "$", "args", ")", "{", "switch", "(", "$", "key", ")", "{", "case", "self", "::", "ADD", ":", "$", "parentId", "=", "$", "args", "[", "1", "]", ";", "$", "siblingId", "=", "$"...
Checks whether an action is ready to execute @param string $key The action key @param array $args The action arguments @return bool @SuppressWarnings(PHPMD.CyclomaticComplexity)
[ "Checks", "whether", "an", "action", "is", "ready", "to", "execute" ]
682a96672393d81c63728e47c4a4c3618c515be0
https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/DeferredLayoutManipulator.php#L510-L559
21,704
oroinc/OroLayoutComponent
DeferredLayoutManipulator.php
DeferredLayoutManipulator.executeActions
protected function executeActions($group) { $executedCount = 0; reset($this->actions[$group]); while (list($index, $action) = each($this->actions[$group])) { if ($this->isActionReadyToExecute($action[0], $action[2])) { $executedCount += $this->executeAction($index...
php
protected function executeActions($group) { $executedCount = 0; reset($this->actions[$group]); while (list($index, $action) = each($this->actions[$group])) { if ($this->isActionReadyToExecute($action[0], $action[2])) { $executedCount += $this->executeAction($index...
[ "protected", "function", "executeActions", "(", "$", "group", ")", "{", "$", "executedCount", "=", "0", ";", "reset", "(", "$", "this", "->", "actions", "[", "$", "group", "]", ")", ";", "while", "(", "list", "(", "$", "index", ",", "$", "action", ...
Executes actions from the given group Use this method if the group does not contain depended each other actions @param string $group @return int The number of executed actions
[ "Executes", "actions", "from", "the", "given", "group", "Use", "this", "method", "if", "the", "group", "does", "not", "contain", "depended", "each", "other", "actions" ]
682a96672393d81c63728e47c4a4c3618c515be0
https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/DeferredLayoutManipulator.php#L569-L581
21,705
oroinc/OroLayoutComponent
DeferredLayoutManipulator.php
DeferredLayoutManipulator.executeDependedActions
protected function executeDependedActions($group) { $executedCount = 0; $continue = true; while ($continue) { $continue = false; $hasExecuted = false; $hasSkipped = false; reset($this->actions[$group]); while (list($index, ...
php
protected function executeDependedActions($group) { $executedCount = 0; $continue = true; while ($continue) { $continue = false; $hasExecuted = false; $hasSkipped = false; reset($this->actions[$group]); while (list($index, ...
[ "protected", "function", "executeDependedActions", "(", "$", "group", ")", "{", "$", "executedCount", "=", "0", ";", "$", "continue", "=", "true", ";", "while", "(", "$", "continue", ")", "{", "$", "continue", "=", "false", ";", "$", "hasExecuted", "=", ...
Executes depended actions from the given group Use this method if the group can contain depended each other actions This method guarantee that all actions are executed in the order they are registered @param string $group @return int The number of executed actions
[ "Executes", "depended", "actions", "from", "the", "given", "group", "Use", "this", "method", "if", "the", "group", "can", "contain", "depended", "each", "other", "actions", "This", "method", "guarantee", "that", "all", "actions", "are", "executed", "in", "the"...
682a96672393d81c63728e47c4a4c3618c515be0
https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/DeferredLayoutManipulator.php#L592-L623
21,706
spiral-modules/listing
source/Listing/Listing.php
Listing.setSelector
public function setSelector(PaginatorAwareInterface $selector) { $this->validateSelector($selector); $this->selector = $selector; return $this; }
php
public function setSelector(PaginatorAwareInterface $selector) { $this->validateSelector($selector); $this->selector = $selector; return $this; }
[ "public", "function", "setSelector", "(", "PaginatorAwareInterface", "$", "selector", ")", "{", "$", "this", "->", "validateSelector", "(", "$", "selector", ")", ";", "$", "this", "->", "selector", "=", "$", "selector", ";", "return", "$", "this", ";", "}"...
Set active listing selector. @param RecordSelector|DocumentSelector|PaginatorAwareInterface $selector @return $this @throws InvalidSelectorException
[ "Set", "active", "listing", "selector", "." ]
89abe8939ce91cbf61b51b99e93ce1e57c8af83c
https://github.com/spiral-modules/listing/blob/89abe8939ce91cbf61b51b99e93ce1e57c8af83c/source/Listing/Listing.php#L93-L99
21,707
spiral-modules/listing
source/Listing/Listing.php
Listing.setLimits
public function setLimits(array $limits = []) { if (empty($limits)) { throw new ListingException("You must provide at least one limit option"); } $this->limits = array_values($limits); return $this; }
php
public function setLimits(array $limits = []) { if (empty($limits)) { throw new ListingException("You must provide at least one limit option"); } $this->limits = array_values($limits); return $this; }
[ "public", "function", "setLimits", "(", "array", "$", "limits", "=", "[", "]", ")", "{", "if", "(", "empty", "(", "$", "limits", ")", ")", "{", "throw", "new", "ListingException", "(", "\"You must provide at least one limit option\"", ")", ";", "}", "$", "...
Set allowed pagination limits @param array $limits @return $this
[ "Set", "allowed", "pagination", "limits" ]
89abe8939ce91cbf61b51b99e93ce1e57c8af83c
https://github.com/spiral-modules/listing/blob/89abe8939ce91cbf61b51b99e93ce1e57c8af83c/source/Listing/Listing.php#L227-L236
21,708
spiral-modules/listing
source/Listing/Listing.php
Listing.createPaginator
protected function createPaginator() { $paginator = new Paginator($this->getLimit()); $paginator = $paginator->withPage($this->getPage()); return $paginator; }
php
protected function createPaginator() { $paginator = new Paginator($this->getLimit()); $paginator = $paginator->withPage($this->getPage()); return $paginator; }
[ "protected", "function", "createPaginator", "(", ")", "{", "$", "paginator", "=", "new", "Paginator", "(", "$", "this", "->", "getLimit", "(", ")", ")", ";", "$", "paginator", "=", "$", "paginator", "->", "withPage", "(", "$", "this", "->", "getPage", ...
Get paginator associated with current listing @return Paginator
[ "Get", "paginator", "associated", "with", "current", "listing" ]
89abe8939ce91cbf61b51b99e93ce1e57c8af83c
https://github.com/spiral-modules/listing/blob/89abe8939ce91cbf61b51b99e93ce1e57c8af83c/source/Listing/Listing.php#L402-L408
21,709
spiral-modules/listing
source/Listing/Listing.php
Listing.getLimit
protected function getLimit() { $limit = $this->activeState()->getLimit(); if (!in_array($limit, $this->limits)) { //We are using lowest limit by default return $this->limits[0]; } return $limit; }
php
protected function getLimit() { $limit = $this->activeState()->getLimit(); if (!in_array($limit, $this->limits)) { //We are using lowest limit by default return $this->limits[0]; } return $limit; }
[ "protected", "function", "getLimit", "(", ")", "{", "$", "limit", "=", "$", "this", "->", "activeState", "(", ")", "->", "getLimit", "(", ")", ";", "if", "(", "!", "in_array", "(", "$", "limit", ",", "$", "this", "->", "limits", ")", ")", "{", "/...
Get active pagination limit @return int
[ "Get", "active", "pagination", "limit" ]
89abe8939ce91cbf61b51b99e93ce1e57c8af83c
https://github.com/spiral-modules/listing/blob/89abe8939ce91cbf61b51b99e93ce1e57c8af83c/source/Listing/Listing.php#L415-L424
21,710
kouks/laravel-filters
src/Filters/Behavior/Searchable.php
Searchable.search
public function search($pattern = null) { if (! $pattern) { return; } foreach ($this->searchable as $column) { $this->resolveSearch($column, $pattern); } }
php
public function search($pattern = null) { if (! $pattern) { return; } foreach ($this->searchable as $column) { $this->resolveSearch($column, $pattern); } }
[ "public", "function", "search", "(", "$", "pattern", "=", "null", ")", "{", "if", "(", "!", "$", "pattern", ")", "{", "return", ";", "}", "foreach", "(", "$", "this", "->", "searchable", "as", "$", "column", ")", "{", "$", "this", "->", "resolveSea...
Searches given columns. @param string $pattern @return void
[ "Searches", "given", "columns", "." ]
c1a594fd40173dcbb454ea7ec59818a919fff6bd
https://github.com/kouks/laravel-filters/blob/c1a594fd40173dcbb454ea7ec59818a919fff6bd/src/Filters/Behavior/Searchable.php#L13-L22
21,711
kouks/laravel-filters
src/Filters/Behavior/Searchable.php
Searchable.resolveSearch
protected function resolveSearch($column, $key) { $this->resolve($column, $key, $this->getTableName(), function ($query, $pattern) { $this->builder->orWhere($query, 'LIKE', "%{$pattern}%"); }); }
php
protected function resolveSearch($column, $key) { $this->resolve($column, $key, $this->getTableName(), function ($query, $pattern) { $this->builder->orWhere($query, 'LIKE', "%{$pattern}%"); }); }
[ "protected", "function", "resolveSearch", "(", "$", "column", ",", "$", "key", ")", "{", "$", "this", "->", "resolve", "(", "$", "column", ",", "$", "key", ",", "$", "this", "->", "getTableName", "(", ")", ",", "function", "(", "$", "query", ",", "...
Recursively build up the search query. @param string $column @param string $key @return void
[ "Recursively", "build", "up", "the", "search", "query", "." ]
c1a594fd40173dcbb454ea7ec59818a919fff6bd
https://github.com/kouks/laravel-filters/blob/c1a594fd40173dcbb454ea7ec59818a919fff6bd/src/Filters/Behavior/Searchable.php#L31-L36
21,712
willhoffmann/domuserp-php
src/Resources/People/Data/PersonData.php
PersonData.address
public function address(array $address) { if (! isset($this->data->addresses)) { $this->data->addresses = []; } return $this->data->addresses[] = (object) $address; }
php
public function address(array $address) { if (! isset($this->data->addresses)) { $this->data->addresses = []; } return $this->data->addresses[] = (object) $address; }
[ "public", "function", "address", "(", "array", "$", "address", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "data", "->", "addresses", ")", ")", "{", "$", "this", "->", "data", "->", "addresses", "=", "[", "]", ";", "}", "return", "...
Put a address on person data @param array $address @return object
[ "Put", "a", "address", "on", "person", "data" ]
44e77a4f02b0252bc26cae4c0e6b2b7d578f10a6
https://github.com/willhoffmann/domuserp-php/blob/44e77a4f02b0252bc26cae4c0e6b2b7d578f10a6/src/Resources/People/Data/PersonData.php#L15-L22
21,713
willhoffmann/domuserp-php
src/Resources/People/Data/PersonData.php
PersonData.contacts
public function contacts(array $contact) { if (! isset($this->data->contacts)) { $this->data->contacts = []; } return $this->data->contacts[] = (object) $contact; }
php
public function contacts(array $contact) { if (! isset($this->data->contacts)) { $this->data->contacts = []; } return $this->data->contacts[] = (object) $contact; }
[ "public", "function", "contacts", "(", "array", "$", "contact", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "data", "->", "contacts", ")", ")", "{", "$", "this", "->", "data", "->", "contacts", "=", "[", "]", ";", "}", "return", "$...
Put a contact on person data @param array $contact @return object
[ "Put", "a", "contact", "on", "person", "data" ]
44e77a4f02b0252bc26cae4c0e6b2b7d578f10a6
https://github.com/willhoffmann/domuserp-php/blob/44e77a4f02b0252bc26cae4c0e6b2b7d578f10a6/src/Resources/People/Data/PersonData.php#L30-L37
21,714
willhoffmann/domuserp-php
src/Resources/People/Data/PersonData.php
PersonData.references
public function references(array $reference = null) { if (! isset($this->data->references)) { $this->data->references = []; } return $this->data->contacts[] = (object) $reference; }
php
public function references(array $reference = null) { if (! isset($this->data->references)) { $this->data->references = []; } return $this->data->contacts[] = (object) $reference; }
[ "public", "function", "references", "(", "array", "$", "reference", "=", "null", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "data", "->", "references", ")", ")", "{", "$", "this", "->", "data", "->", "references", "=", "[", "]", ";"...
Put a commercial reference on person data @param array $reference @return object
[ "Put", "a", "commercial", "reference", "on", "person", "data" ]
44e77a4f02b0252bc26cae4c0e6b2b7d578f10a6
https://github.com/willhoffmann/domuserp-php/blob/44e77a4f02b0252bc26cae4c0e6b2b7d578f10a6/src/Resources/People/Data/PersonData.php#L45-L52
21,715
gedex/php-janrain-api
lib/Janrain/Api/Capture/Access.php
Access.getAuthorizationCode
public function getAuthorizationCode(array $params) { if (isset($params['transaction_state'])) { $params['transaction_state'] = json_encode($params['transaction_state']); } return $this->post('access/getAuthorizationCode', $params); }
php
public function getAuthorizationCode(array $params) { if (isset($params['transaction_state'])) { $params['transaction_state'] = json_encode($params['transaction_state']); } return $this->post('access/getAuthorizationCode', $params); }
[ "public", "function", "getAuthorizationCode", "(", "array", "$", "params", ")", "{", "if", "(", "isset", "(", "$", "params", "[", "'transaction_state'", "]", ")", ")", "{", "$", "params", "[", "'transaction_state'", "]", "=", "json_encode", "(", "$", "para...
Get an authorization code that can be exchanged for an `access_token` and a `refresh_token`. @param array $params @link http://developers.janrain.com/documentation/api-methods/capture/access-codes-and-tokens/getauthorizationcode/
[ "Get", "an", "authorization", "code", "that", "can", "be", "exchanged", "for", "an", "access_token", "and", "a", "refresh_token", "." ]
6283f68454e0ad5211ac620f1d337df38cd49597
https://github.com/gedex/php-janrain-api/blob/6283f68454e0ad5211ac620f1d337df38cd49597/lib/Janrain/Api/Capture/Access.php#L29-L36
21,716
zicht/z
src/Zicht/Tool/Command/TaskCommand.php
TaskCommand.addResolvableOption
public function addResolvableOption($name, $shortcut = null, $mode = null, $help = null, $default = null) { $this->opts[] = $name; return parent::addOption($name, $shortcut, $mode, $help, $default); }
php
public function addResolvableOption($name, $shortcut = null, $mode = null, $help = null, $default = null) { $this->opts[] = $name; return parent::addOption($name, $shortcut, $mode, $help, $default); }
[ "public", "function", "addResolvableOption", "(", "$", "name", ",", "$", "shortcut", "=", "null", ",", "$", "mode", "=", "null", ",", "$", "help", "=", "null", ",", "$", "default", "=", "null", ")", "{", "$", "this", "->", "opts", "[", "]", "=", ...
will add the given option the opt stack so it will resolved for the z plugin. @param string $name @param null $shortcut @param null $mode @param null $help @param null $default @return $this
[ "will", "add", "the", "given", "option", "the", "opt", "stack", "so", "it", "will", "resolved", "for", "the", "z", "plugin", "." ]
6a1731dad20b018555a96b726a61d4bf8ec8c886
https://github.com/zicht/z/blob/6a1731dad20b018555a96b726a61d4bf8ec8c886/src/Zicht/Tool/Command/TaskCommand.php#L126-L130
21,717
zicht/z
src/Zicht/Tool/Command/TaskCommand.php
TaskCommand.execute
protected function execute(InputInterface $input, Output\OutputInterface $output) { foreach ($this->getDefinition()->getArguments() as $arg) { if ($arg->getName() === 'command') { continue; } if ($input->getArgument($arg->getName())) { $thi...
php
protected function execute(InputInterface $input, Output\OutputInterface $output) { foreach ($this->getDefinition()->getArguments() as $arg) { if ($arg->getName() === 'command') { continue; } if ($input->getArgument($arg->getName())) { $thi...
[ "protected", "function", "execute", "(", "InputInterface", "$", "input", ",", "Output", "\\", "OutputInterface", "$", "output", ")", "{", "foreach", "(", "$", "this", "->", "getDefinition", "(", ")", "->", "getArguments", "(", ")", "as", "$", "arg", ")", ...
Executes the specified task @param \Symfony\Component\Console\Input\InputInterface $input @param \Symfony\Component\Console\Output\OutputInterface $output @return mixed
[ "Executes", "the", "specified", "task" ]
6a1731dad20b018555a96b726a61d4bf8ec8c886
https://github.com/zicht/z/blob/6a1731dad20b018555a96b726a61d4bf8ec8c886/src/Zicht/Tool/Command/TaskCommand.php#L214-L248
21,718
raideer/twitch-api
src/Resources/Chat.php
Chat.getEmoticonImages
public function getEmoticonImages($params = []) { $defaults = [ 'emotesets' => null, ]; return $this->wrapper->request('GET', 'chat/emoticon_images', ['query' => $this->resolveOptions($params, $defaults)]); }
php
public function getEmoticonImages($params = []) { $defaults = [ 'emotesets' => null, ]; return $this->wrapper->request('GET', 'chat/emoticon_images', ['query' => $this->resolveOptions($params, $defaults)]); }
[ "public", "function", "getEmoticonImages", "(", "$", "params", "=", "[", "]", ")", "{", "$", "defaults", "=", "[", "'emotesets'", "=>", "null", ",", "]", ";", "return", "$", "this", "->", "wrapper", "->", "request", "(", "'GET'", ",", "'chat/emoticon_ima...
Returns a list of emoticons. Learn more: https://github.com/justintv/Twitch-API/blob/master/v3_resources/chat.md#get-chatemoticon_images @param array $params Optional parameters @return array
[ "Returns", "a", "list", "of", "emoticons", "." ]
27ebf1dcb0315206300d507600b6a82ebe33d57e
https://github.com/raideer/twitch-api/blob/27ebf1dcb0315206300d507600b6a82ebe33d57e/src/Resources/Chat.php#L58-L65
21,719
Erdiko/core
src/datasource/File.php
File.createDir
private function createDir($path) { if (!is_dir($path)) { $success = mkdir($path, 0775, true); if (!$success) { throw new \Exception("Cannot create folder {$path}. Check file system permissions."); } } }
php
private function createDir($path) { if (!is_dir($path)) { $success = mkdir($path, 0775, true); if (!$success) { throw new \Exception("Cannot create folder {$path}. Check file system permissions."); } } }
[ "private", "function", "createDir", "(", "$", "path", ")", "{", "if", "(", "!", "is_dir", "(", "$", "path", ")", ")", "{", "$", "success", "=", "mkdir", "(", "$", "path", ",", "0775", ",", "true", ")", ";", "if", "(", "!", "$", "success", ")", ...
Create Directory If path doesn't exist, create it
[ "Create", "Directory", "If", "path", "doesn", "t", "exist", "create", "it" ]
c7947ee973b0ad2fd05a6d1d8ce45696618c8fa6
https://github.com/Erdiko/core/blob/c7947ee973b0ad2fd05a6d1d8ce45696618c8fa6/src/datasource/File.php#L43-L51
21,720
Erdiko/core
src/datasource/File.php
File.read
public function read($filename, $pathToFile = null) { if(!$this->fileExists($filename, $pathToFile)) throw new \Exception("File, '{$filename}', does not exist."); if ($pathToFile==null) { return file_get_contents($this->_filePath."/".$filename); } else { ...
php
public function read($filename, $pathToFile = null) { if(!$this->fileExists($filename, $pathToFile)) throw new \Exception("File, '{$filename}', does not exist."); if ($pathToFile==null) { return file_get_contents($this->_filePath."/".$filename); } else { ...
[ "public", "function", "read", "(", "$", "filename", ",", "$", "pathToFile", "=", "null", ")", "{", "if", "(", "!", "$", "this", "->", "fileExists", "(", "$", "filename", ",", "$", "pathToFile", ")", ")", "throw", "new", "\\", "Exception", "(", "\"Fil...
Read string to file @param string $filename @param string $pathToFile @return string
[ "Read", "string", "to", "file" ]
c7947ee973b0ad2fd05a6d1d8ce45696618c8fa6
https://github.com/Erdiko/core/blob/c7947ee973b0ad2fd05a6d1d8ce45696618c8fa6/src/datasource/File.php#L84-L94
21,721
Erdiko/core
src/datasource/File.php
File.move
public function move($filename, $pathTo, $pathFrom = null) { if ($pathFrom==null) { $pathFrom=$this->_filePath; } if (file_exists($pathFrom."/".$filename)) { $this->createDir($pathTo); return rename($pathFrom."/".$filename, $pathTo."/".$filename); ...
php
public function move($filename, $pathTo, $pathFrom = null) { if ($pathFrom==null) { $pathFrom=$this->_filePath; } if (file_exists($pathFrom."/".$filename)) { $this->createDir($pathTo); return rename($pathFrom."/".$filename, $pathTo."/".$filename); ...
[ "public", "function", "move", "(", "$", "filename", ",", "$", "pathTo", ",", "$", "pathFrom", "=", "null", ")", "{", "if", "(", "$", "pathFrom", "==", "null", ")", "{", "$", "pathFrom", "=", "$", "this", "->", "_filePath", ";", "}", "if", "(", "f...
Move a file @param string $filename @param string $pathTo @param string $pathToFrom @return bool
[ "Move", "a", "file" ]
c7947ee973b0ad2fd05a6d1d8ce45696618c8fa6
https://github.com/Erdiko/core/blob/c7947ee973b0ad2fd05a6d1d8ce45696618c8fa6/src/datasource/File.php#L123-L134
21,722
caffeinated/beverage
src/Traits/MultiSingleton.php
MultiSingleton.getInstance
public static function getInstance($name = 'default') { if (isset(static::$instances[$name])) { return static::$instances[$name]; } $instance = new static(); static::$instances[$name] = $instance; return $instance; }
php
public static function getInstance($name = 'default') { if (isset(static::$instances[$name])) { return static::$instances[$name]; } $instance = new static(); static::$instances[$name] = $instance; return $instance; }
[ "public", "static", "function", "getInstance", "(", "$", "name", "=", "'default'", ")", "{", "if", "(", "isset", "(", "static", "::", "$", "instances", "[", "$", "name", "]", ")", ")", "{", "return", "static", "::", "$", "instances", "[", "$", "name"...
Get the current instance. @param string $name @return static
[ "Get", "the", "current", "instance", "." ]
c7d612a1d3bc1baddc97fec60ab17224550efaf3
https://github.com/caffeinated/beverage/blob/c7d612a1d3bc1baddc97fec60ab17224550efaf3/src/Traits/MultiSingleton.php#L49-L60
21,723
PeeHaa/AsyncTwitter
src/Api/Request/Search/Search.php
Search.geocode
public function geocode(string $latitude, string $longitude, string $radius): Search { $this->parameters['geocode'] = sprintf('%s %s %s', $latitude, $longitude, $radius); return $this; }
php
public function geocode(string $latitude, string $longitude, string $radius): Search { $this->parameters['geocode'] = sprintf('%s %s %s', $latitude, $longitude, $radius); return $this; }
[ "public", "function", "geocode", "(", "string", "$", "latitude", ",", "string", "$", "longitude", ",", "string", "$", "radius", ")", ":", "Search", "{", "$", "this", "->", "parameters", "[", "'geocode'", "]", "=", "sprintf", "(", "'%s %s %s'", ",", "$", ...
use string instead of float
[ "use", "string", "instead", "of", "float" ]
a968909e7ed470bd87a0f25ef0c494338273c29c
https://github.com/PeeHaa/AsyncTwitter/blob/a968909e7ed470bd87a0f25ef0c494338273c29c/src/Api/Request/Search/Search.php#L25-L30
21,724
inhere/php-librarys
src/Helpers/DataHelper.php
DataHelper.toObject
public static function toObject($array, $class = \stdClass::class) { $object = new $class; foreach ($array as $name => $value) { $name = trim($name); if (!$name || is_numeric($name)) { continue; } $object->$name = \is_array($value) ?...
php
public static function toObject($array, $class = \stdClass::class) { $object = new $class; foreach ($array as $name => $value) { $name = trim($name); if (!$name || is_numeric($name)) { continue; } $object->$name = \is_array($value) ?...
[ "public", "static", "function", "toObject", "(", "$", "array", ",", "$", "class", "=", "\\", "stdClass", "::", "class", ")", "{", "$", "object", "=", "new", "$", "class", ";", "foreach", "(", "$", "array", "as", "$", "name", "=>", "$", "value", ")"...
data to array @param array|\Traversable $array @param string $class @return mixed
[ "data", "to", "array" ]
e6ca598685469794f310e3ab0e2bc19519cd0ae6
https://github.com/inhere/php-librarys/blob/e6ca598685469794f310e3ab0e2bc19519cd0ae6/src/Helpers/DataHelper.php#L75-L90
21,725
inhere/php-librarys
src/Helpers/DataHelper.php
DataHelper.safeOutput
public static function safeOutput($string, $clearTag = false) { if (!$clearTag) { $string = strip_tags($string); } return @self::htmlentitiesUTF8($string); }
php
public static function safeOutput($string, $clearTag = false) { if (!$clearTag) { $string = strip_tags($string); } return @self::htmlentitiesUTF8($string); }
[ "public", "static", "function", "safeOutput", "(", "$", "string", ",", "$", "clearTag", "=", "false", ")", "{", "if", "(", "!", "$", "clearTag", ")", "{", "$", "string", "=", "strip_tags", "(", "$", "string", ")", ";", "}", "return", "@", "self", "...
Sanitize a string @param string $string String to sanitize @param bool $clearTag clear html tag @return string Sanitized string
[ "Sanitize", "a", "string" ]
e6ca598685469794f310e3ab0e2bc19519cd0ae6
https://github.com/inhere/php-librarys/blob/e6ca598685469794f310e3ab0e2bc19519cd0ae6/src/Helpers/DataHelper.php#L98-L105
21,726
gyselroth/micro-container
src/Config.php
Config.get
public function get(string $name): array { if (isset($this->compiled[$name])) { $config = $this->compiled[$name]; } else { $this->compiled[$name] = $this->createServiceConfig($name); $config = $this->compiled[$name]; } if (!isset($config['use'])) ...
php
public function get(string $name): array { if (isset($this->compiled[$name])) { $config = $this->compiled[$name]; } else { $this->compiled[$name] = $this->createServiceConfig($name); $config = $this->compiled[$name]; } if (!isset($config['use'])) ...
[ "public", "function", "get", "(", "string", "$", "name", ")", ":", "array", "{", "if", "(", "isset", "(", "$", "this", "->", "compiled", "[", "$", "name", "]", ")", ")", "{", "$", "config", "=", "$", "this", "->", "compiled", "[", "$", "name", ...
Get service configuration.
[ "Get", "service", "configuration", "." ]
728cf35af9645648392c50752b4b555d491bac4e
https://github.com/gyselroth/micro-container/blob/728cf35af9645648392c50752b4b555d491bac4e/src/Config.php#L65-L79
21,727
gyselroth/micro-container
src/Config.php
Config.getEnv
public function getEnv(string $param): string { if (preg_match_all('#\{ENV\(([A-Za-z0-9_]+)(?:(,?)([^}]*))\)\}#', $param, $matches)) { if (4 !== count($matches)) { return $param; } for ($i = 0; $i < count($matches[0]); ++$i) { $param = $th...
php
public function getEnv(string $param): string { if (preg_match_all('#\{ENV\(([A-Za-z0-9_]+)(?:(,?)([^}]*))\)\}#', $param, $matches)) { if (4 !== count($matches)) { return $param; } for ($i = 0; $i < count($matches[0]); ++$i) { $param = $th...
[ "public", "function", "getEnv", "(", "string", "$", "param", ")", ":", "string", "{", "if", "(", "preg_match_all", "(", "'#\\{ENV\\(([A-Za-z0-9_]+)(?:(,?)([^}]*))\\)\\}#'", ",", "$", "param", ",", "$", "matches", ")", ")", "{", "if", "(", "4", "!==", "count"...
Parse env param.
[ "Parse", "env", "param", "." ]
728cf35af9645648392c50752b4b555d491bac4e
https://github.com/gyselroth/micro-container/blob/728cf35af9645648392c50752b4b555d491bac4e/src/Config.php#L84-L99
21,728
gyselroth/micro-container
src/Config.php
Config.parseEnv
protected function parseEnv(string $param, array $variables, int $key): string { $env = getenv($variables[1][$key]); if (false === $env && !empty($variables[3][$key])) { return str_replace($variables[0][$key], $variables[3][$key], $param); } if (false === $env) { ...
php
protected function parseEnv(string $param, array $variables, int $key): string { $env = getenv($variables[1][$key]); if (false === $env && !empty($variables[3][$key])) { return str_replace($variables[0][$key], $variables[3][$key], $param); } if (false === $env) { ...
[ "protected", "function", "parseEnv", "(", "string", "$", "param", ",", "array", "$", "variables", ",", "int", "$", "key", ")", ":", "string", "{", "$", "env", "=", "getenv", "(", "$", "variables", "[", "1", "]", "[", "$", "key", "]", ")", ";", "i...
Parse env.
[ "Parse", "env", "." ]
728cf35af9645648392c50752b4b555d491bac4e
https://github.com/gyselroth/micro-container/blob/728cf35af9645648392c50752b4b555d491bac4e/src/Config.php#L104-L115
21,729
gyselroth/micro-container
src/Config.php
Config.createServiceConfig
protected function createServiceConfig(string $name): array { $config = []; if ($this->has($name)) { $config = $this->config[$name]; } $class = $name; if (isset($config['use'])) { if (!is_string($config['use'])) { throw new Exception\...
php
protected function createServiceConfig(string $name): array { $config = []; if ($this->has($name)) { $config = $this->config[$name]; } $class = $name; if (isset($config['use'])) { if (!is_string($config['use'])) { throw new Exception\...
[ "protected", "function", "createServiceConfig", "(", "string", "$", "name", ")", ":", "array", "{", "$", "config", "=", "[", "]", ";", "if", "(", "$", "this", "->", "has", "(", "$", "name", ")", ")", "{", "$", "config", "=", "$", "this", "->", "c...
Create service config.
[ "Create", "service", "config", "." ]
728cf35af9645648392c50752b4b555d491bac4e
https://github.com/gyselroth/micro-container/blob/728cf35af9645648392c50752b4b555d491bac4e/src/Config.php#L120-L154
21,730
gyselroth/micro-container
src/Config.php
Config.mergeServiceConfig
protected function mergeServiceConfig(string $name, string $class, array $config): array { $config = array_merge($this->getServiceDefaults(), $config); if (!class_exists($class) && !interface_exists($class)) { return $config; } if (false === $config['merge']) { ...
php
protected function mergeServiceConfig(string $name, string $class, array $config): array { $config = array_merge($this->getServiceDefaults(), $config); if (!class_exists($class) && !interface_exists($class)) { return $config; } if (false === $config['merge']) { ...
[ "protected", "function", "mergeServiceConfig", "(", "string", "$", "name", ",", "string", "$", "class", ",", "array", "$", "config", ")", ":", "array", "{", "$", "config", "=", "array_merge", "(", "$", "this", "->", "getServiceDefaults", "(", ")", ",", "...
Find parent classes or interfaces and merge service configurations.
[ "Find", "parent", "classes", "or", "interfaces", "and", "merge", "service", "configurations", "." ]
728cf35af9645648392c50752b4b555d491bac4e
https://github.com/gyselroth/micro-container/blob/728cf35af9645648392c50752b4b555d491bac4e/src/Config.php#L174-L201
21,731
gyselroth/micro-container
src/Config.php
Config.getConfigTree
protected function getConfigTree(): array { $tree = [$this->getConfig()]; $parent = $this->container; while ($parent = $parent->getParent()) { $tree[] = $parent->getConfig()->getConfig(); } return $tree; }
php
protected function getConfigTree(): array { $tree = [$this->getConfig()]; $parent = $this->container; while ($parent = $parent->getParent()) { $tree[] = $parent->getConfig()->getConfig(); } return $tree; }
[ "protected", "function", "getConfigTree", "(", ")", ":", "array", "{", "$", "tree", "=", "[", "$", "this", "->", "getConfig", "(", ")", "]", ";", "$", "parent", "=", "$", "this", "->", "container", ";", "while", "(", "$", "parent", "=", "$", "paren...
Get config tree.
[ "Get", "config", "tree", "." ]
728cf35af9645648392c50752b4b555d491bac4e
https://github.com/gyselroth/micro-container/blob/728cf35af9645648392c50752b4b555d491bac4e/src/Config.php#L206-L215
21,732
m4grio/bangkok-insurance-php
src/Client/ParamsMapperTrait.php
ParamsMapperTrait.mergeParams
public function mergeParams($method, Array $params = []) { $result = parent::mergeParams($method, $params); foreach ($this->map as $oldKey => $newKey) { if (array_key_exists($oldKey, $result[$method])) { $result[$method][$newKey] = $result[$method][$oldKey]; ...
php
public function mergeParams($method, Array $params = []) { $result = parent::mergeParams($method, $params); foreach ($this->map as $oldKey => $newKey) { if (array_key_exists($oldKey, $result[$method])) { $result[$method][$newKey] = $result[$method][$oldKey]; ...
[ "public", "function", "mergeParams", "(", "$", "method", ",", "Array", "$", "params", "=", "[", "]", ")", "{", "$", "result", "=", "parent", "::", "mergeParams", "(", "$", "method", ",", "$", "params", ")", ";", "foreach", "(", "$", "this", "->", "...
Merge and remap params @param $method @param array $params @return mixed
[ "Merge", "and", "remap", "params" ]
400266d043abe6b7cacb9da36064cbb169149c2a
https://github.com/m4grio/bangkok-insurance-php/blob/400266d043abe6b7cacb9da36064cbb169149c2a/src/Client/ParamsMapperTrait.php#L27-L41
21,733
MASNathan/Parser
src/Type/Ini.php
Ini.encode
public static function encode($data) { $data = (array) $data; $resultString = self::loopEncode($data); return trim($resultString, PHP_EOL); }
php
public static function encode($data) { $data = (array) $data; $resultString = self::loopEncode($data); return trim($resultString, PHP_EOL); }
[ "public", "static", "function", "encode", "(", "$", "data", ")", "{", "$", "data", "=", "(", "array", ")", "$", "data", ";", "$", "resultString", "=", "self", "::", "loopEncode", "(", "$", "data", ")", ";", "return", "trim", "(", "$", "resultString",...
Encodes an array to ini strutcture @param array $data Data to encode @return string
[ "Encodes", "an", "array", "to", "ini", "strutcture" ]
0f55402b99b1e071bdcd6277b9268f783ca25e34
https://github.com/MASNathan/Parser/blob/0f55402b99b1e071bdcd6277b9268f783ca25e34/src/Type/Ini.php#L12-L19
21,734
MASNathan/Parser
src/Type/Ini.php
Ini.loopEncode
public static function loopEncode($data, array $parent = array()) { $resultString = ''; foreach ($data as $key => $value) { if (is_array($value)) { //subsection case //merge all the sections into one array... $sec = array_merge((array) $par...
php
public static function loopEncode($data, array $parent = array()) { $resultString = ''; foreach ($data as $key => $value) { if (is_array($value)) { //subsection case //merge all the sections into one array... $sec = array_merge((array) $par...
[ "public", "static", "function", "loopEncode", "(", "$", "data", ",", "array", "$", "parent", "=", "array", "(", ")", ")", "{", "$", "resultString", "=", "''", ";", "foreach", "(", "$", "data", "as", "$", "key", "=>", "$", "value", ")", "{", "if", ...
Method to look the data and encode it to ini format @param array $data Data to encode @param array $parent Parent array, in case of recursive arrays @return string
[ "Method", "to", "look", "the", "data", "and", "encode", "it", "to", "ini", "format" ]
0f55402b99b1e071bdcd6277b9268f783ca25e34
https://github.com/MASNathan/Parser/blob/0f55402b99b1e071bdcd6277b9268f783ca25e34/src/Type/Ini.php#L27-L45
21,735
NuclearCMS/Hierarchy
src/Tags/Tag.php
Tag.firstByTitleOrCreate
public static function firstByTitleOrCreate($title, $locale = null) { $tag = Tag::whereTranslation('title', $title, $locale)->first(); if (is_null($tag)) { $attributes = compact('title'); if ($locale) { $attributes = [$locale => $attribut...
php
public static function firstByTitleOrCreate($title, $locale = null) { $tag = Tag::whereTranslation('title', $title, $locale)->first(); if (is_null($tag)) { $attributes = compact('title'); if ($locale) { $attributes = [$locale => $attribut...
[ "public", "static", "function", "firstByTitleOrCreate", "(", "$", "title", ",", "$", "locale", "=", "null", ")", "{", "$", "tag", "=", "Tag", "::", "whereTranslation", "(", "'title'", ",", "$", "title", ",", "$", "locale", ")", "->", "first", "(", ")",...
Finds a tag by title or creates it @param string $title @param string $locale @return Tag
[ "Finds", "a", "tag", "by", "title", "or", "creates", "it" ]
535171c5e2db72265313fd2110aec8456e46f459
https://github.com/NuclearCMS/Hierarchy/blob/535171c5e2db72265313fd2110aec8456e46f459/src/Tags/Tag.php#L138-L155
21,736
codezero-be/laravel-localizer
src/LocalizerServiceProvider.php
LocalizerServiceProvider.registerLocalizer
protected function registerLocalizer() { $this->app->bind(Localizer::class, function ($app) { $locales = $app['config']->get("{$this->name}.supported-locales"); $detectors = $app['config']->get("{$this->name}.detectors"); $stores = $app['config']->get("{$this->name}.store...
php
protected function registerLocalizer() { $this->app->bind(Localizer::class, function ($app) { $locales = $app['config']->get("{$this->name}.supported-locales"); $detectors = $app['config']->get("{$this->name}.detectors"); $stores = $app['config']->get("{$this->name}.store...
[ "protected", "function", "registerLocalizer", "(", ")", "{", "$", "this", "->", "app", "->", "bind", "(", "Localizer", "::", "class", ",", "function", "(", "$", "app", ")", "{", "$", "locales", "=", "$", "app", "[", "'config'", "]", "->", "get", "(",...
Register Localizer. @return void
[ "Register", "Localizer", "." ]
812692796a73bd38fc205404d8ef90df5bfa0d83
https://github.com/codezero-be/laravel-localizer/blob/812692796a73bd38fc205404d8ef90df5bfa0d83/src/LocalizerServiceProvider.php#L65-L74
21,737
gyselroth/micro-container
src/RuntimeContainer.php
RuntimeContainer.resolve
public function resolve(string $name, ?array $parameters = null) { if (isset($this->service[$name])) { return $this->service[$name]; } if ($this->config->has($name)) { return $this->wrapService($name, $parameters); } if (null !== $this->parent_servic...
php
public function resolve(string $name, ?array $parameters = null) { if (isset($this->service[$name])) { return $this->service[$name]; } if ($this->config->has($name)) { return $this->wrapService($name, $parameters); } if (null !== $this->parent_servic...
[ "public", "function", "resolve", "(", "string", "$", "name", ",", "?", "array", "$", "parameters", "=", "null", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "service", "[", "$", "name", "]", ")", ")", "{", "return", "$", "this", "->", "s...
Resolve service.
[ "Resolve", "service", "." ]
728cf35af9645648392c50752b4b555d491bac4e
https://github.com/gyselroth/micro-container/blob/728cf35af9645648392c50752b4b555d491bac4e/src/RuntimeContainer.php#L109-L132
21,738
gyselroth/micro-container
src/RuntimeContainer.php
RuntimeContainer.storeService
protected function storeService(string $name, array $config, $service) { if (false === $config['singleton']) { return $service; } $this->service[$name] = $service; if (isset($this->children[$name])) { $this->children[$name]->setParentService($service); ...
php
protected function storeService(string $name, array $config, $service) { if (false === $config['singleton']) { return $service; } $this->service[$name] = $service; if (isset($this->children[$name])) { $this->children[$name]->setParentService($service); ...
[ "protected", "function", "storeService", "(", "string", "$", "name", ",", "array", "$", "config", ",", "$", "service", ")", "{", "if", "(", "false", "===", "$", "config", "[", "'singleton'", "]", ")", "{", "return", "$", "service", ";", "}", "$", "th...
Store service.
[ "Store", "service", "." ]
728cf35af9645648392c50752b4b555d491bac4e
https://github.com/gyselroth/micro-container/blob/728cf35af9645648392c50752b4b555d491bac4e/src/RuntimeContainer.php#L137-L149
21,739
gyselroth/micro-container
src/RuntimeContainer.php
RuntimeContainer.wrapService
protected function wrapService(string $name, ?array $parameters = null) { $config = $this->config->get($name); if (true === $config['wrap']) { $that = $this; return function () use ($that, $name, $parameters) { return $that->autoWireClass($name, $parameters);...
php
protected function wrapService(string $name, ?array $parameters = null) { $config = $this->config->get($name); if (true === $config['wrap']) { $that = $this; return function () use ($that, $name, $parameters) { return $that->autoWireClass($name, $parameters);...
[ "protected", "function", "wrapService", "(", "string", "$", "name", ",", "?", "array", "$", "parameters", "=", "null", ")", "{", "$", "config", "=", "$", "this", "->", "config", "->", "get", "(", "$", "name", ")", ";", "if", "(", "true", "===", "$"...
Wrap resolved service in callable if enabled.
[ "Wrap", "resolved", "service", "in", "callable", "if", "enabled", "." ]
728cf35af9645648392c50752b4b555d491bac4e
https://github.com/gyselroth/micro-container/blob/728cf35af9645648392c50752b4b555d491bac4e/src/RuntimeContainer.php#L154-L166
21,740
gyselroth/micro-container
src/RuntimeContainer.php
RuntimeContainer.autoWireClass
protected function autoWireClass(string $name, ?array $parameters = null) { $config = $this->config->get($name); $class = $config['use']; if (null !== $parameters) { $config['singleton'] = false; } if (preg_match('#^\{([^{}]+)\}$#', $class, $match)) { ...
php
protected function autoWireClass(string $name, ?array $parameters = null) { $config = $this->config->get($name); $class = $config['use']; if (null !== $parameters) { $config['singleton'] = false; } if (preg_match('#^\{([^{}]+)\}$#', $class, $match)) { ...
[ "protected", "function", "autoWireClass", "(", "string", "$", "name", ",", "?", "array", "$", "parameters", "=", "null", ")", "{", "$", "config", "=", "$", "this", "->", "config", "->", "get", "(", "$", "name", ")", ";", "$", "class", "=", "$", "co...
Auto wire.
[ "Auto", "wire", "." ]
728cf35af9645648392c50752b4b555d491bac4e
https://github.com/gyselroth/micro-container/blob/728cf35af9645648392c50752b4b555d491bac4e/src/RuntimeContainer.php#L171-L203
21,741
gyselroth/micro-container
src/RuntimeContainer.php
RuntimeContainer.wireReference
protected function wireReference(string $name, string $reference, array $config) { $service = $this->get($reference); $reflection = new ReflectionClass(get_class($service)); $config = $this->config->get($name); $service = $this->prepareService($name, $service, $reflection, $config); ...
php
protected function wireReference(string $name, string $reference, array $config) { $service = $this->get($reference); $reflection = new ReflectionClass(get_class($service)); $config = $this->config->get($name); $service = $this->prepareService($name, $service, $reflection, $config); ...
[ "protected", "function", "wireReference", "(", "string", "$", "name", ",", "string", "$", "reference", ",", "array", "$", "config", ")", "{", "$", "service", "=", "$", "this", "->", "get", "(", "$", "reference", ")", ";", "$", "reflection", "=", "new",...
Wire named referenced service.
[ "Wire", "named", "referenced", "service", "." ]
728cf35af9645648392c50752b4b555d491bac4e
https://github.com/gyselroth/micro-container/blob/728cf35af9645648392c50752b4b555d491bac4e/src/RuntimeContainer.php#L208-L216
21,742
gyselroth/micro-container
src/RuntimeContainer.php
RuntimeContainer.getProxyInstance
protected function getProxyInstance(string $name, ReflectionClass $class, array $arguments, array $config) { $factory = new LazyLoadingValueHolderFactory(); $that = $this; return $factory->createProxy( $class->getName(), function (&$wrappedObject, $proxy, $method, $p...
php
protected function getProxyInstance(string $name, ReflectionClass $class, array $arguments, array $config) { $factory = new LazyLoadingValueHolderFactory(); $that = $this; return $factory->createProxy( $class->getName(), function (&$wrappedObject, $proxy, $method, $p...
[ "protected", "function", "getProxyInstance", "(", "string", "$", "name", ",", "ReflectionClass", "$", "class", ",", "array", "$", "arguments", ",", "array", "$", "config", ")", "{", "$", "factory", "=", "new", "LazyLoadingValueHolderFactory", "(", ")", ";", ...
Create proxy instance.
[ "Create", "proxy", "instance", "." ]
728cf35af9645648392c50752b4b555d491bac4e
https://github.com/gyselroth/micro-container/blob/728cf35af9645648392c50752b4b555d491bac4e/src/RuntimeContainer.php#L233-L245
21,743
gyselroth/micro-container
src/RuntimeContainer.php
RuntimeContainer.getRealInstance
protected function getRealInstance(string $name, ReflectionClass $class, array $arguments, array $config) { $instance = $class->newInstanceArgs($arguments); $instance = $this->prepareService($name, $instance, $class, $config); return $instance; }
php
protected function getRealInstance(string $name, ReflectionClass $class, array $arguments, array $config) { $instance = $class->newInstanceArgs($arguments); $instance = $this->prepareService($name, $instance, $class, $config); return $instance; }
[ "protected", "function", "getRealInstance", "(", "string", "$", "name", ",", "ReflectionClass", "$", "class", ",", "array", "$", "arguments", ",", "array", "$", "config", ")", "{", "$", "instance", "=", "$", "class", "->", "newInstanceArgs", "(", "$", "arg...
Create real instance.
[ "Create", "real", "instance", "." ]
728cf35af9645648392c50752b4b555d491bac4e
https://github.com/gyselroth/micro-container/blob/728cf35af9645648392c50752b4b555d491bac4e/src/RuntimeContainer.php#L250-L256
21,744
gyselroth/micro-container
src/RuntimeContainer.php
RuntimeContainer.autoWireMethod
protected function autoWireMethod(string $name, ReflectionMethod $method, array $config, ?array $parameters = null): array { $params = $method->getParameters(); $args = []; foreach ($params as $param) { $type = $param->getClass(); $param_name = $param->getName(); ...
php
protected function autoWireMethod(string $name, ReflectionMethod $method, array $config, ?array $parameters = null): array { $params = $method->getParameters(); $args = []; foreach ($params as $param) { $type = $param->getClass(); $param_name = $param->getName(); ...
[ "protected", "function", "autoWireMethod", "(", "string", "$", "name", ",", "ReflectionMethod", "$", "method", ",", "array", "$", "config", ",", "?", "array", "$", "parameters", "=", "null", ")", ":", "array", "{", "$", "params", "=", "$", "method", "->"...
Autowire method.
[ "Autowire", "method", "." ]
728cf35af9645648392c50752b4b555d491bac4e
https://github.com/gyselroth/micro-container/blob/728cf35af9645648392c50752b4b555d491bac4e/src/RuntimeContainer.php#L298-L328
21,745
gyselroth/micro-container
src/RuntimeContainer.php
RuntimeContainer.resolveServiceArgument
protected function resolveServiceArgument(string $name, ReflectionClass $type, ReflectionParameter $param) { $type_class = $type->getName(); if ($type_class === $name) { throw new RuntimeException('class '.$type_class.' can not depend on itself'); } try { re...
php
protected function resolveServiceArgument(string $name, ReflectionClass $type, ReflectionParameter $param) { $type_class = $type->getName(); if ($type_class === $name) { throw new RuntimeException('class '.$type_class.' can not depend on itself'); } try { re...
[ "protected", "function", "resolveServiceArgument", "(", "string", "$", "name", ",", "ReflectionClass", "$", "type", ",", "ReflectionParameter", "$", "param", ")", "{", "$", "type_class", "=", "$", "type", "->", "getName", "(", ")", ";", "if", "(", "$", "ty...
Resolve service argument.
[ "Resolve", "service", "argument", "." ]
728cf35af9645648392c50752b4b555d491bac4e
https://github.com/gyselroth/micro-container/blob/728cf35af9645648392c50752b4b555d491bac4e/src/RuntimeContainer.php#L333-L350
21,746
gyselroth/micro-container
src/RuntimeContainer.php
RuntimeContainer.parseParam
protected function parseParam($param, string $name) { if (is_iterable($param)) { foreach ($param as $key => $value) { $param[$key] = $this->parseParam($value, $name); } return $param; } if (is_string($param)) { $param = $this-...
php
protected function parseParam($param, string $name) { if (is_iterable($param)) { foreach ($param as $key => $value) { $param[$key] = $this->parseParam($value, $name); } return $param; } if (is_string($param)) { $param = $this-...
[ "protected", "function", "parseParam", "(", "$", "param", ",", "string", "$", "name", ")", "{", "if", "(", "is_iterable", "(", "$", "param", ")", ")", "{", "foreach", "(", "$", "param", "as", "$", "key", "=>", "$", "value", ")", "{", "$", "param", ...
Parse param value.
[ "Parse", "param", "value", "." ]
728cf35af9645648392c50752b4b555d491bac4e
https://github.com/gyselroth/micro-container/blob/728cf35af9645648392c50752b4b555d491bac4e/src/RuntimeContainer.php#L355-L379
21,747
gyselroth/micro-container
src/RuntimeContainer.php
RuntimeContainer.traverseTree
protected function traverseTree(string $current_service, string $service) { if (isset($this->children[$current_service])) { return $this->children[$current_service]->get($service); } $config = $this->config->get($current_service); if (isset($config['services'])) { ...
php
protected function traverseTree(string $current_service, string $service) { if (isset($this->children[$current_service])) { return $this->children[$current_service]->get($service); } $config = $this->config->get($current_service); if (isset($config['services'])) { ...
[ "protected", "function", "traverseTree", "(", "string", "$", "current_service", ",", "string", "$", "service", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "children", "[", "$", "current_service", "]", ")", ")", "{", "return", "$", "this", "->",...
Locate service.
[ "Locate", "service", "." ]
728cf35af9645648392c50752b4b555d491bac4e
https://github.com/gyselroth/micro-container/blob/728cf35af9645648392c50752b4b555d491bac4e/src/RuntimeContainer.php#L384-L398
21,748
jarod2011/SimpleConcurrentRequestClient
src/SimpleConcurrent.php
RequestClient._getClient
private function _getClient(): ClientInterface { if (! $this->client instanceof ClientInterface) $this->client = new Client($this->clientConfig); return $this->client; }
php
private function _getClient(): ClientInterface { if (! $this->client instanceof ClientInterface) $this->client = new Client($this->clientConfig); return $this->client; }
[ "private", "function", "_getClient", "(", ")", ":", "ClientInterface", "{", "if", "(", "!", "$", "this", "->", "client", "instanceof", "ClientInterface", ")", "$", "this", "->", "client", "=", "new", "Client", "(", "$", "this", "->", "clientConfig", ")", ...
get a client implements \GuzzleHttp\ClientInterface @return ClientInterface
[ "get", "a", "client", "implements", "\\", "GuzzleHttp", "\\", "ClientInterface" ]
d9759e7978c0b8e4a3504f85db5983aa6146c91f
https://github.com/jarod2011/SimpleConcurrentRequestClient/blob/d9759e7978c0b8e4a3504f85db5983aa6146c91f/src/SimpleConcurrent.php#L434-L438
21,749
jarod2011/SimpleConcurrentRequestClient
src/SimpleConcurrent.php
RequestClient.addClientHeader
public function addClientHeader(string $headerName, $headerValue): self { $this->clientConfig['headers'][$headerName] = $headerValue; return $this; }
php
public function addClientHeader(string $headerName, $headerValue): self { $this->clientConfig['headers'][$headerName] = $headerValue; return $this; }
[ "public", "function", "addClientHeader", "(", "string", "$", "headerName", ",", "$", "headerValue", ")", ":", "self", "{", "$", "this", "->", "clientConfig", "[", "'headers'", "]", "[", "$", "headerName", "]", "=", "$", "headerValue", ";", "return", "$", ...
add a client request header @param string $headerName @param mixed $headerValue @return self
[ "add", "a", "client", "request", "header" ]
d9759e7978c0b8e4a3504f85db5983aa6146c91f
https://github.com/jarod2011/SimpleConcurrentRequestClient/blob/d9759e7978c0b8e4a3504f85db5983aa6146c91f/src/SimpleConcurrent.php#L457-L461
21,750
jarod2011/SimpleConcurrentRequestClient
src/SimpleConcurrent.php
RequestClient._responseSuccessHandle
private function _responseSuccessHandle($response, $index) { try { if (! $response instanceof ResponseInterface) throw new UnknowResponseExpection($response); $result = $response->getBody()->getContents(); $cbk = $this->requestList[$index]->getSuccessCallbackList(); ...
php
private function _responseSuccessHandle($response, $index) { try { if (! $response instanceof ResponseInterface) throw new UnknowResponseExpection($response); $result = $response->getBody()->getContents(); $cbk = $this->requestList[$index]->getSuccessCallbackList(); ...
[ "private", "function", "_responseSuccessHandle", "(", "$", "response", ",", "$", "index", ")", "{", "try", "{", "if", "(", "!", "$", "response", "instanceof", "ResponseInterface", ")", "throw", "new", "UnknowResponseExpection", "(", "$", "response", ")", ";", ...
when request successed this method will be called @param mixed $response @param int $index @throws \Exception
[ "when", "request", "successed", "this", "method", "will", "be", "called" ]
d9759e7978c0b8e4a3504f85db5983aa6146c91f
https://github.com/jarod2011/SimpleConcurrentRequestClient/blob/d9759e7978c0b8e4a3504f85db5983aa6146c91f/src/SimpleConcurrent.php#L557-L574
21,751
jarod2011/SimpleConcurrentRequestClient
src/SimpleConcurrent.php
RequestClient._responseFailHandle
private function _responseFailHandle($error, $index) { $cbk = $this->requestList[$index]->getFailCallbackList(); if (! empty($cbk)) { $error = array_reduce($cbk, function ($prev, $cb) { return $cb($prev); }, $error); } $response = new SimpleRes...
php
private function _responseFailHandle($error, $index) { $cbk = $this->requestList[$index]->getFailCallbackList(); if (! empty($cbk)) { $error = array_reduce($cbk, function ($prev, $cb) { return $cb($prev); }, $error); } $response = new SimpleRes...
[ "private", "function", "_responseFailHandle", "(", "$", "error", ",", "$", "index", ")", "{", "$", "cbk", "=", "$", "this", "->", "requestList", "[", "$", "index", "]", "->", "getFailCallbackList", "(", ")", ";", "if", "(", "!", "empty", "(", "$", "c...
when request failed this method will be called @param mixed $error @param int $index
[ "when", "request", "failed", "this", "method", "will", "be", "called" ]
d9759e7978c0b8e4a3504f85db5983aa6146c91f
https://github.com/jarod2011/SimpleConcurrentRequestClient/blob/d9759e7978c0b8e4a3504f85db5983aa6146c91f/src/SimpleConcurrent.php#L581-L592
21,752
jarod2011/SimpleConcurrentRequestClient
src/SimpleConcurrent.php
RequestClient._getRequestPool
private function _getRequestPool(): Pool { return new Pool($this->_getClient(), $this->_getRequestPromise(), [ 'concurrency' => max(1, $this->configOfConcurrency), 'fulfilled' => function () { call_user_func_array([$this, '_responseSuccessHandle'], func_get_args()); ...
php
private function _getRequestPool(): Pool { return new Pool($this->_getClient(), $this->_getRequestPromise(), [ 'concurrency' => max(1, $this->configOfConcurrency), 'fulfilled' => function () { call_user_func_array([$this, '_responseSuccessHandle'], func_get_args()); ...
[ "private", "function", "_getRequestPool", "(", ")", ":", "Pool", "{", "return", "new", "Pool", "(", "$", "this", "->", "_getClient", "(", ")", ",", "$", "this", "->", "_getRequestPromise", "(", ")", ",", "[", "'concurrency'", "=>", "max", "(", "1", ","...
build a request pool implements \GuzzleHttp\Pool @return Pool
[ "build", "a", "request", "pool", "implements", "\\", "GuzzleHttp", "\\", "Pool" ]
d9759e7978c0b8e4a3504f85db5983aa6146c91f
https://github.com/jarod2011/SimpleConcurrentRequestClient/blob/d9759e7978c0b8e4a3504f85db5983aa6146c91f/src/SimpleConcurrent.php#L610-L621
21,753
jarod2011/SimpleConcurrentRequestClient
src/SimpleConcurrent.php
RequestClient.customSetting
public function customSetting(string $settingKey, $settingValue): self { $this->clientConfig[$settingKey] = $settingValue; return $this; }
php
public function customSetting(string $settingKey, $settingValue): self { $this->clientConfig[$settingKey] = $settingValue; return $this; }
[ "public", "function", "customSetting", "(", "string", "$", "settingKey", ",", "$", "settingValue", ")", ":", "self", "{", "$", "this", "->", "clientConfig", "[", "$", "settingKey", "]", "=", "$", "settingValue", ";", "return", "$", "this", ";", "}" ]
add or modify client config by custom @return self
[ "add", "or", "modify", "client", "config", "by", "custom" ]
d9759e7978c0b8e4a3504f85db5983aa6146c91f
https://github.com/jarod2011/SimpleConcurrentRequestClient/blob/d9759e7978c0b8e4a3504f85db5983aa6146c91f/src/SimpleConcurrent.php#L648-L652
21,754
alevilar/ristorantino-vendor
Risto/Controller/Component/Auth/PinAuthenticate.php
PinAuthenticate.authenticate
public function authenticate(CakeRequest $request, CakeResponse $response) { App::uses('MtSites', 'MtSites./Utility/MtSites'); // solo utilizar el logueo con PIN desde un Tenant if ( !MtSites::isTenant() ) { return false; } $userModel = $this->settings['userModel']; list(, $model) = pluginSplit($userMod...
php
public function authenticate(CakeRequest $request, CakeResponse $response) { App::uses('MtSites', 'MtSites./Utility/MtSites'); // solo utilizar el logueo con PIN desde un Tenant if ( !MtSites::isTenant() ) { return false; } $userModel = $this->settings['userModel']; list(, $model) = pluginSplit($userMod...
[ "public", "function", "authenticate", "(", "CakeRequest", "$", "request", ",", "CakeResponse", "$", "response", ")", "{", "App", "::", "uses", "(", "'MtSites'", ",", "'MtSites./Utility/MtSites'", ")", ";", "// solo utilizar el logueo con PIN desde un Tenant", "if", "(...
Authenticates the identity contained in a request. Will use the `settings.userModel`, and `settings.fields` to find POST data that is used to find a matching record in the `settings.userModel`. Will return false if there is no post data, either username or pin is missing, or if the scope conditions have not been met. ...
[ "Authenticates", "the", "identity", "contained", "in", "a", "request", ".", "Will", "use", "the", "settings", ".", "userModel", "and", "settings", ".", "fields", "to", "find", "POST", "data", "that", "is", "used", "to", "find", "a", "matching", "record", "...
6b91a1e20cc0ba09a1968d77e3de6512cfa2d966
https://github.com/alevilar/ristorantino-vendor/blob/6b91a1e20cc0ba09a1968d77e3de6512cfa2d966/Risto/Controller/Component/Auth/PinAuthenticate.php#L81-L96
21,755
heidelpay/PhpDoc
src/phpDocumentor/Plugin/Scrybe/Converter/Metadata/Glossary.php
Glossary.addTerm
public function addTerm($term, $filename, $line_number) { if (!isset($this[$term])) { $this[$term] = array(); } if (!isset($this[$term][$filename])) { $this[$term][$filename] = array(); } $this[$term][$filename][] = $line_number; }
php
public function addTerm($term, $filename, $line_number) { if (!isset($this[$term])) { $this[$term] = array(); } if (!isset($this[$term][$filename])) { $this[$term][$filename] = array(); } $this[$term][$filename][] = $line_number; }
[ "public", "function", "addTerm", "(", "$", "term", ",", "$", "filename", ",", "$", "line_number", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "[", "$", "term", "]", ")", ")", "{", "$", "this", "[", "$", "term", "]", "=", "array", "(", ...
Adds a glossary term to the collection. @param string $term @param string $filename @param int $line_number @return void
[ "Adds", "a", "glossary", "term", "to", "the", "collection", "." ]
5ac9e842cbd4cbb70900533b240c131f3515ee02
https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Plugin/Scrybe/Converter/Metadata/Glossary.php#L48-L58
21,756
wenbinye/PhalconX
src/Db/Schema/Column.php
Column.fromColumn
public static function fromColumn(Db\Column $column) { $data = $column->toArray(); if (isset($data['type']) && is_integer($data['type'])) { $data['type'] = self::getTypeName($data['type']); } if (isset($data['bindType']) && is_integer($data['bindType'])) { $da...
php
public static function fromColumn(Db\Column $column) { $data = $column->toArray(); if (isset($data['type']) && is_integer($data['type'])) { $data['type'] = self::getTypeName($data['type']); } if (isset($data['bindType']) && is_integer($data['bindType'])) { $da...
[ "public", "static", "function", "fromColumn", "(", "Db", "\\", "Column", "$", "column", ")", "{", "$", "data", "=", "$", "column", "->", "toArray", "(", ")", ";", "if", "(", "isset", "(", "$", "data", "[", "'type'", "]", ")", "&&", "is_integer", "(...
create column object
[ "create", "column", "object" ]
0d2e1480e722dde56ccd23b2e8a5c8ac6ac2f8e1
https://github.com/wenbinye/PhalconX/blob/0d2e1480e722dde56ccd23b2e8a5c8ac6ac2f8e1/src/Db/Schema/Column.php#L42-L53
21,757
surebert/surebert-framework
src/sb/JSON/RPC2/Client.php
Client.useEncryption
public function useEncryption($key) { $this->encryptor = new \sb\Encryption\ForTransmission($key); $this->encryption_key = $key; }
php
public function useEncryption($key) { $this->encryptor = new \sb\Encryption\ForTransmission($key); $this->encryption_key = $key; }
[ "public", "function", "useEncryption", "(", "$", "key", ")", "{", "$", "this", "->", "encryptor", "=", "new", "\\", "sb", "\\", "Encryption", "\\", "ForTransmission", "(", "$", "key", ")", ";", "$", "this", "->", "encryption_key", "=", "$", "key", ";",...
Sets the key that data is encrypted with and turns on encryption, the server must use the same key @param $key String
[ "Sets", "the", "key", "that", "data", "is", "encrypted", "with", "and", "turns", "on", "encryption", "the", "server", "must", "use", "the", "same", "key" ]
f2f32eb693bd39385ceb93355efb5b2a429f27ce
https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/JSON/RPC2/Client.php#L114-L118
21,758
surebert/surebert-framework
src/sb/JSON/RPC2/Client.php
Client.addCookie
public function addCookie($cookie = Array()) { foreach ($cookie as $key => $val) { if (isset($this->encryption_key)) { $val = $this->encryptor->encrypt($val); } $this->cookies[$key] = $val; } }
php
public function addCookie($cookie = Array()) { foreach ($cookie as $key => $val) { if (isset($this->encryption_key)) { $val = $this->encryptor->encrypt($val); } $this->cookies[$key] = $val; } }
[ "public", "function", "addCookie", "(", "$", "cookie", "=", "Array", "(", ")", ")", "{", "foreach", "(", "$", "cookie", "as", "$", "key", "=>", "$", "val", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "encryption_key", ")", ")", "{", "$"...
Adds a cookie to send to the server @param $cookie Array('key' => 'val');
[ "Adds", "a", "cookie", "to", "send", "to", "the", "server" ]
f2f32eb693bd39385ceb93355efb5b2a429f27ce
https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/JSON/RPC2/Client.php#L124-L133
21,759
surebert/surebert-framework
src/sb/JSON/RPC2/Client.php
Client.processResponse
protected function processResponse($str) { if (!empty($this->encryption_key)) { $str = $this->encryptor->decrypt($str); } $this->logResponse($str); //check if response body is serialized json_response object and just unserialize and return if it is if ($this->p...
php
protected function processResponse($str) { if (!empty($this->encryption_key)) { $str = $this->encryptor->decrypt($str); } $this->logResponse($str); //check if response body is serialized json_response object and just unserialize and return if it is if ($this->p...
[ "protected", "function", "processResponse", "(", "$", "str", ")", "{", "if", "(", "!", "empty", "(", "$", "this", "->", "encryption_key", ")", ")", "{", "$", "str", "=", "$", "this", "->", "encryptor", "->", "decrypt", "(", "$", "str", ")", ";", "}...
Break down the received data into headers and response and then handle gz encoding, encryption, utf, etc @param $str The data returned from the socket connection @return string The body of the message
[ "Break", "down", "the", "received", "data", "into", "headers", "and", "response", "and", "then", "handle", "gz", "encoding", "encryption", "utf", "etc" ]
f2f32eb693bd39385ceb93355efb5b2a429f27ce
https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/JSON/RPC2/Client.php#L234-L267
21,760
MASNathan/Parser
src/Parser.php
Parser.files
public static function files(array $listOfFiles) { $listOfContents = array(); foreach ($listOfFiles as $key => $filepath) { $listOfContents[$key] = self::file($filepath); } return $listOfContents; }
php
public static function files(array $listOfFiles) { $listOfContents = array(); foreach ($listOfFiles as $key => $filepath) { $listOfContents[$key] = self::file($filepath); } return $listOfContents; }
[ "public", "static", "function", "files", "(", "array", "$", "listOfFiles", ")", "{", "$", "listOfContents", "=", "array", "(", ")", ";", "foreach", "(", "$", "listOfFiles", "as", "$", "key", "=>", "$", "filepath", ")", "{", "$", "listOfContents", "[", ...
Creates an array of objects from multiple files @param array $listOfFiles List of file paths @return array
[ "Creates", "an", "array", "of", "objects", "from", "multiple", "files" ]
0f55402b99b1e071bdcd6277b9268f783ca25e34
https://github.com/MASNathan/Parser/blob/0f55402b99b1e071bdcd6277b9268f783ca25e34/src/Parser.php#L36-L43
21,761
ezsystems/ezcomments-ls-extension
datatypes/ezcomcomments/ezcomcommentstype.php
ezcomCommentsType.fetchObjectAttributeHTTPInput
function fetchObjectAttributeHTTPInput( $http, $base, $contentObjectAttribute ) { $enabledName = $base . '_ezcomcomments_enabled_' . $contentObjectAttribute->attribute( 'id' ); $shownName = $base . '_ezcomcomments_shown_' . $contentObjectAttribute->attribute( 'id' ); $enabledValue = -1; ...
php
function fetchObjectAttributeHTTPInput( $http, $base, $contentObjectAttribute ) { $enabledName = $base . '_ezcomcomments_enabled_' . $contentObjectAttribute->attribute( 'id' ); $shownName = $base . '_ezcomcomments_shown_' . $contentObjectAttribute->attribute( 'id' ); $enabledValue = -1; ...
[ "function", "fetchObjectAttributeHTTPInput", "(", "$", "http", ",", "$", "base", ",", "$", "contentObjectAttribute", ")", "{", "$", "enabledName", "=", "$", "base", ".", "'_ezcomcomments_enabled_'", ".", "$", "contentObjectAttribute", "->", "attribute", "(", "'id'...
put the option enabled of ezcomcomment into data_int of contentobjectattribute @see kernel/classes/eZDataType#fetchObjectAttributeHTTPInput($http, $base, $objectAttribute)
[ "put", "the", "option", "enabled", "of", "ezcomcomment", "into", "data_int", "of", "contentobjectattribute" ]
2b4cd8c34d4a77813e4d6a9c5a0d317a274c63c5
https://github.com/ezsystems/ezcomments-ls-extension/blob/2b4cd8c34d4a77813e4d6a9c5a0d317a274c63c5/datatypes/ezcomcomments/ezcomcommentstype.php#L117-L134
21,762
ezsystems/ezcomments-ls-extension
datatypes/ezcomcomments/ezcomcommentstype.php
ezcomCommentsType.deleteStoredObjectAttribute
function deleteStoredObjectAttribute( $contentObjectAttribute, $version = null ) { $version = $contentObjectAttribute->objectVersion(); if ( !is_null( $version ) && $version->attribute( 'status' ) == eZContentObjectVersion::STATUS_PUBLISHED ) { $contentObjectID = $co...
php
function deleteStoredObjectAttribute( $contentObjectAttribute, $version = null ) { $version = $contentObjectAttribute->objectVersion(); if ( !is_null( $version ) && $version->attribute( 'status' ) == eZContentObjectVersion::STATUS_PUBLISHED ) { $contentObjectID = $co...
[ "function", "deleteStoredObjectAttribute", "(", "$", "contentObjectAttribute", ",", "$", "version", "=", "null", ")", "{", "$", "version", "=", "$", "contentObjectAttribute", "->", "objectVersion", "(", ")", ";", "if", "(", "!", "is_null", "(", "$", "version",...
When deleting the content object, deleting all the comments. @see kernel/classes/eZDataType#deleteStoredObjectAttribute($objectAttribute, $version)
[ "When", "deleting", "the", "content", "object", "deleting", "all", "the", "comments", "." ]
2b4cd8c34d4a77813e4d6a9c5a0d317a274c63c5
https://github.com/ezsystems/ezcomments-ls-extension/blob/2b4cd8c34d4a77813e4d6a9c5a0d317a274c63c5/datatypes/ezcomcomments/ezcomcommentstype.php#L152-L164
21,763
snapwp/snap-blade
src/Blade_Service_Provider.php
Blade_Service_Provider.add_blade
public function add_blade() { $blade = new Snap_Blade( Theme_Utils::get_active_theme_path(Config::get('theme.templates_directory')), Theme_Utils::get_active_theme_path(\trailingslashit(Config::get('theme.cache_directory')) . 'templates'), Config::get('blade.development_mo...
php
public function add_blade() { $blade = new Snap_Blade( Theme_Utils::get_active_theme_path(Config::get('theme.templates_directory')), Theme_Utils::get_active_theme_path(\trailingslashit(Config::get('theme.cache_directory')) . 'templates'), Config::get('blade.development_mo...
[ "public", "function", "add_blade", "(", ")", "{", "$", "blade", "=", "new", "Snap_Blade", "(", "Theme_Utils", "::", "get_active_theme_path", "(", "Config", "::", "get", "(", "'theme.templates_directory'", ")", ")", ",", "Theme_Utils", "::", "get_active_theme_path"...
Creates the Snap_blade instance, and adds to service container. @since 1.0.0
[ "Creates", "the", "Snap_blade", "instance", "and", "adds", "to", "service", "container", "." ]
41e004e93440f6b58638b64dc8d20cca4a0546fa
https://github.com/snapwp/snap-blade/blob/41e004e93440f6b58638b64dc8d20cca4a0546fa/src/Blade_Service_Provider.php#L58-L85
21,764
snapwp/snap-blade
src/Blade_Service_Provider.php
Blade_Service_Provider.add_directives
private function add_directives($blade) { $blade->directive( 'simplemenu', function ($expression) { \preg_match('/\( *(.*) * as *([^\)]*)/', $expression, $matches); $iteratee = \trim($matches[1]); $iter...
php
private function add_directives($blade) { $blade->directive( 'simplemenu', function ($expression) { \preg_match('/\( *(.*) * as *([^\)]*)/', $expression, $matches); $iteratee = \trim($matches[1]); $iter...
[ "private", "function", "add_directives", "(", "$", "blade", ")", "{", "$", "blade", "->", "directive", "(", "'simplemenu'", ",", "function", "(", "$", "expression", ")", "{", "\\", "preg_match", "(", "'/\\( *(.*) * as *([^\\)]*)/'", ",", "$", "expression", ","...
Add custom directives to blade. @since 1.0.0 @param BladeOne $blade The BladeOne service.
[ "Add", "custom", "directives", "to", "blade", "." ]
41e004e93440f6b58638b64dc8d20cca4a0546fa
https://github.com/snapwp/snap-blade/blob/41e004e93440f6b58638b64dc8d20cca4a0546fa/src/Blade_Service_Provider.php#L134-L225
21,765
snapwp/snap-blade
src/Blade_Service_Provider.php
Blade_Service_Provider.add_wp_directives
private function add_wp_directives($blade) { $blade->directive( 'wphead', function () { return '<?php wp_head(); ?>'; } ); $blade->directive( 'wpfooter', function () { return '<?php wp_footer(); ?>';...
php
private function add_wp_directives($blade) { $blade->directive( 'wphead', function () { return '<?php wp_head(); ?>'; } ); $blade->directive( 'wpfooter', function () { return '<?php wp_footer(); ?>';...
[ "private", "function", "add_wp_directives", "(", "$", "blade", ")", "{", "$", "blade", "->", "directive", "(", "'wphead'", ",", "function", "(", ")", "{", "return", "'<?php wp_head(); ?>'", ";", "}", ")", ";", "$", "blade", "->", "directive", "(", "'wpfoot...
Add custom directives for WordPress functions to blade. @since 1.0.0 @param BladeOne $blade The BladeOne service.
[ "Add", "custom", "directives", "for", "WordPress", "functions", "to", "blade", "." ]
41e004e93440f6b58638b64dc8d20cca4a0546fa
https://github.com/snapwp/snap-blade/blob/41e004e93440f6b58638b64dc8d20cca4a0546fa/src/Blade_Service_Provider.php#L234-L305
21,766
NuclearCMS/Hierarchy
src/Repositories/NodeFieldRepository.php
NodeFieldRepository.create
public function create($id, array $attributes) { $typeModelName = $this->getTypeModelName(); $nodeType = $typeModelName::findOrFail($id); $nodeField = $nodeType->addField($attributes); $this->builderService->buildField( $nodeField->getName(), $nodeField->ge...
php
public function create($id, array $attributes) { $typeModelName = $this->getTypeModelName(); $nodeType = $typeModelName::findOrFail($id); $nodeField = $nodeType->addField($attributes); $this->builderService->buildField( $nodeField->getName(), $nodeField->ge...
[ "public", "function", "create", "(", "$", "id", ",", "array", "$", "attributes", ")", "{", "$", "typeModelName", "=", "$", "this", "->", "getTypeModelName", "(", ")", ";", "$", "nodeType", "=", "$", "typeModelName", "::", "findOrFail", "(", "$", "id", ...
Creates a node field @param int $id @param array $attributes @return NodeFieldContract
[ "Creates", "a", "node", "field" ]
535171c5e2db72265313fd2110aec8456e46f459
https://github.com/NuclearCMS/Hierarchy/blob/535171c5e2db72265313fd2110aec8456e46f459/src/Repositories/NodeFieldRepository.php#L15-L32
21,767
NuclearCMS/Hierarchy
src/Repositories/NodeFieldRepository.php
NodeFieldRepository.destroy
public function destroy($id) { $modelName = $this->getModelName(); $nodeField = $modelName::findOrFail($id); $nodeField->delete(); $this->builderService->destroyField( $nodeField->getName(), $nodeField->nodeType->getName(), $nodeField->nodeType ...
php
public function destroy($id) { $modelName = $this->getModelName(); $nodeField = $modelName::findOrFail($id); $nodeField->delete(); $this->builderService->destroyField( $nodeField->getName(), $nodeField->nodeType->getName(), $nodeField->nodeType ...
[ "public", "function", "destroy", "(", "$", "id", ")", "{", "$", "modelName", "=", "$", "this", "->", "getModelName", "(", ")", ";", "$", "nodeField", "=", "$", "modelName", "::", "findOrFail", "(", "$", "id", ")", ";", "$", "nodeField", "->", "delete...
Destroys a node field @param int $id @return NodeFieldContract
[ "Destroys", "a", "node", "field" ]
535171c5e2db72265313fd2110aec8456e46f459
https://github.com/NuclearCMS/Hierarchy/blob/535171c5e2db72265313fd2110aec8456e46f459/src/Repositories/NodeFieldRepository.php#L40-L54
21,768
zicht/z
src/Zicht/Tool/Command/Descriptor/TextDescriptor.php
TextDescriptor.splitDefinition
public function splitDefinition(InputDefinition $definition) { /** @var InputDefinition[] $ret */ $ret = array( new InputDefinition(), new InputDefinition() ); foreach ($definition->getArguments() as $arg) { $ret[0]->addArgument($arg); ...
php
public function splitDefinition(InputDefinition $definition) { /** @var InputDefinition[] $ret */ $ret = array( new InputDefinition(), new InputDefinition() ); foreach ($definition->getArguments() as $arg) { $ret[0]->addArgument($arg); ...
[ "public", "function", "splitDefinition", "(", "InputDefinition", "$", "definition", ")", "{", "/** @var InputDefinition[] $ret */", "$", "ret", "=", "array", "(", "new", "InputDefinition", "(", ")", ",", "new", "InputDefinition", "(", ")", ")", ";", "foreach", "...
Splits the definition in an internal and public one, the latter representing whatever is shown to the user, the former representing the options that are hidden. @param \Symfony\Component\Console\Input\InputDefinition $definition @return InputDefinition[]
[ "Splits", "the", "definition", "in", "an", "internal", "and", "public", "one", "the", "latter", "representing", "whatever", "is", "shown", "to", "the", "user", "the", "former", "representing", "the", "options", "that", "are", "hidden", "." ]
6a1731dad20b018555a96b726a61d4bf8ec8c886
https://github.com/zicht/z/blob/6a1731dad20b018555a96b726a61d4bf8ec8c886/src/Zicht/Tool/Command/Descriptor/TextDescriptor.php#L74-L90
21,769
trunda/SmfMenu
src/Smf/Menu/Renderer/Manager.php
Manager.addRenderer
public function addRenderer($name, $renderer, $overwrite = false) { if (isset($this->renderers[$name]) && !$overwrite) { throw new InvalidArgumentException("Renderer with name '$name' is already registered."); } unset($this->renderers[$name]); // Is class? Exists? ...
php
public function addRenderer($name, $renderer, $overwrite = false) { if (isset($this->renderers[$name]) && !$overwrite) { throw new InvalidArgumentException("Renderer with name '$name' is already registered."); } unset($this->renderers[$name]); // Is class? Exists? ...
[ "public", "function", "addRenderer", "(", "$", "name", ",", "$", "renderer", ",", "$", "overwrite", "=", "false", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "renderers", "[", "$", "name", "]", ")", "&&", "!", "$", "overwrite", ")", "{", ...
Ads renderer with given name @param string $name Name of the renderer @param string|IRenderer $renderer Renderer class name or instance @param bool $overwrite Should be overwritten renderer with this name if exists? @return IManager Fluent interface @throws InvalidArgumentException If the renderer with given name alrea...
[ "Ads", "renderer", "with", "given", "name" ]
739e74fb664c1f018b4a74142bd28d20c004bac6
https://github.com/trunda/SmfMenu/blob/739e74fb664c1f018b4a74142bd28d20c004bac6/src/Smf/Menu/Renderer/Manager.php#L25-L37
21,770
trunda/SmfMenu
src/Smf/Menu/Renderer/Manager.php
Manager.getRenderer
public function getRenderer($name) { // default if ($name === null) { if ($this->defaultRenderer !== null) { $name = $this->defaultRenderer; } else if (count($this->renderers) > 0) { $name = key($this->renderers); } } ...
php
public function getRenderer($name) { // default if ($name === null) { if ($this->defaultRenderer !== null) { $name = $this->defaultRenderer; } else if (count($this->renderers) > 0) { $name = key($this->renderers); } } ...
[ "public", "function", "getRenderer", "(", "$", "name", ")", "{", "// default", "if", "(", "$", "name", "===", "null", ")", "{", "if", "(", "$", "this", "->", "defaultRenderer", "!==", "null", ")", "{", "$", "name", "=", "$", "this", "->", "defaultRen...
Returns instance of the renderer @param string $name Name of the renderer @return IRenderer Renderer instance @throws InvalidArgumentException If the renderer with given name does not exist
[ "Returns", "instance", "of", "the", "renderer" ]
739e74fb664c1f018b4a74142bd28d20c004bac6
https://github.com/trunda/SmfMenu/blob/739e74fb664c1f018b4a74142bd28d20c004bac6/src/Smf/Menu/Renderer/Manager.php#L59-L84
21,771
digipolisgent/robo-digipolis-package
src/PackageProject.php
PackageProject.getFiles
protected function getFiles() { $this->mirrorDir(); $this->prepareMirrorDir(); $this->printTaskInfo('Retrieving files to package.'); $mirrorFinder = new Finder(); $mirrorFinder->ignoreDotFiles(false); $add = []; $mirrorFinder ->in($this->tmpDir) ...
php
protected function getFiles() { $this->mirrorDir(); $this->prepareMirrorDir(); $this->printTaskInfo('Retrieving files to package.'); $mirrorFinder = new Finder(); $mirrorFinder->ignoreDotFiles(false); $add = []; $mirrorFinder ->in($this->tmpDir) ...
[ "protected", "function", "getFiles", "(", ")", "{", "$", "this", "->", "mirrorDir", "(", ")", ";", "$", "this", "->", "prepareMirrorDir", "(", ")", ";", "$", "this", "->", "printTaskInfo", "(", "'Retrieving files to package.'", ")", ";", "$", "mirrorFinder",...
Get the files and directories to package. @return array The list of files and directories to package.
[ "Get", "the", "files", "and", "directories", "to", "package", "." ]
6f206f32d910992d27b2a1b4dda1c5e7d8259b75
https://github.com/digipolisgent/robo-digipolis-package/blob/6f206f32d910992d27b2a1b4dda1c5e7d8259b75/src/PackageProject.php#L117-L132
21,772
digipolisgent/robo-digipolis-package
src/PackageProject.php
PackageProject.mirrorDir
protected function mirrorDir() { if (!$this->useTmpDir) { $this->tmpDir = $this->dir; return; } $this->tmpDir = md5(time()); if (file_exists($this->tmpDir)) { $this->fs->remove($this->tmpDir); } $this->printTaskInfo(sprintf( ...
php
protected function mirrorDir() { if (!$this->useTmpDir) { $this->tmpDir = $this->dir; return; } $this->tmpDir = md5(time()); if (file_exists($this->tmpDir)) { $this->fs->remove($this->tmpDir); } $this->printTaskInfo(sprintf( ...
[ "protected", "function", "mirrorDir", "(", ")", "{", "if", "(", "!", "$", "this", "->", "useTmpDir", ")", "{", "$", "this", "->", "tmpDir", "=", "$", "this", "->", "dir", ";", "return", ";", "}", "$", "this", "->", "tmpDir", "=", "md5", "(", "tim...
Mirror the directory to a temp directory.
[ "Mirror", "the", "directory", "to", "a", "temp", "directory", "." ]
6f206f32d910992d27b2a1b4dda1c5e7d8259b75
https://github.com/digipolisgent/robo-digipolis-package/blob/6f206f32d910992d27b2a1b4dda1c5e7d8259b75/src/PackageProject.php#L137-L186
21,773
digipolisgent/robo-digipolis-package
src/PackageProject.php
PackageProject.prepareMirrorDir
protected function prepareMirrorDir() { $this->printTaskInfo(sprintf('Preparing directory %s.', $this->tmpDir)); if (empty($this->ignoreFileNames)) { return; } $files = new Finder(); $files->in($this->tmpDir); $files->ignoreDotFiles(false); $files-...
php
protected function prepareMirrorDir() { $this->printTaskInfo(sprintf('Preparing directory %s.', $this->tmpDir)); if (empty($this->ignoreFileNames)) { return; } $files = new Finder(); $files->in($this->tmpDir); $files->ignoreDotFiles(false); $files-...
[ "protected", "function", "prepareMirrorDir", "(", ")", "{", "$", "this", "->", "printTaskInfo", "(", "sprintf", "(", "'Preparing directory %s.'", ",", "$", "this", "->", "tmpDir", ")", ")", ";", "if", "(", "empty", "(", "$", "this", "->", "ignoreFileNames", ...
Removes files that should not be packaged from the mirrored directory.
[ "Removes", "files", "that", "should", "not", "be", "packaged", "from", "the", "mirrored", "directory", "." ]
6f206f32d910992d27b2a1b4dda1c5e7d8259b75
https://github.com/digipolisgent/robo-digipolis-package/blob/6f206f32d910992d27b2a1b4dda1c5e7d8259b75/src/PackageProject.php#L191-L207
21,774
inhere/php-librarys
src/Helpers/UtilHelper.php
UtilHelper.fd
public static function fd($object, $type = 'log') { $types = array('log', 'debug', 'info', 'warn', 'error', 'assert'); if (!\in_array($type, $types, true)) { $type = 'log'; } $data = json_encode($object); echo '<script type="text/javascript">console.' . $type ....
php
public static function fd($object, $type = 'log') { $types = array('log', 'debug', 'info', 'warn', 'error', 'assert'); if (!\in_array($type, $types, true)) { $type = 'log'; } $data = json_encode($object); echo '<script type="text/javascript">console.' . $type ....
[ "public", "static", "function", "fd", "(", "$", "object", ",", "$", "type", "=", "'log'", ")", "{", "$", "types", "=", "array", "(", "'log'", ",", "'debug'", ",", "'info'", ",", "'warn'", ",", "'error'", ",", "'assert'", ")", ";", "if", "(", "!", ...
Display a var dump in firebug console @param mixed $object Object to display @param string $type
[ "Display", "a", "var", "dump", "in", "firebug", "console" ]
e6ca598685469794f310e3ab0e2bc19519cd0ae6
https://github.com/inhere/php-librarys/blob/e6ca598685469794f310e3ab0e2bc19519cd0ae6/src/Helpers/UtilHelper.php#L16-L27
21,775
PHPPowertools/HTML5
src/PowerTools/HTML5/Parser/Tokenizer.php
HTML5_Parser_Tokenizer.parse
public function parse() { $p = 0; do { $p = $this->scanner->position(); $this->consumeData(); // FIXME: Add infinite loop protection. } while ($this->carryOn); }
php
public function parse() { $p = 0; do { $p = $this->scanner->position(); $this->consumeData(); // FIXME: Add infinite loop protection. } while ($this->carryOn); }
[ "public", "function", "parse", "(", ")", "{", "$", "p", "=", "0", ";", "do", "{", "$", "p", "=", "$", "this", "->", "scanner", "->", "position", "(", ")", ";", "$", "this", "->", "consumeData", "(", ")", ";", "// FIXME: Add infinite loop protection.", ...
Begin parsing. This will begin scanning the document, tokenizing as it goes. Tokens are emitted into the event handler. Tokenizing will continue until the document is completely read. Errors are emitted into the event handler, but the parser will attempt to continue parsing until the entire input stream is read.
[ "Begin", "parsing", "." ]
4ea8caf5b2618a82ca5061dcbb7421b31065c1c7
https://github.com/PHPPowertools/HTML5/blob/4ea8caf5b2618a82ca5061dcbb7421b31065c1c7/src/PowerTools/HTML5/Parser/Tokenizer.php#L154-L162
21,776
PHPPowertools/HTML5
src/PowerTools/HTML5/Parser/Tokenizer.php
HTML5_Parser_Tokenizer.setTextMode
public function setTextMode($textmode, $untilTag = null) { $this->textMode = $textmode & (HTML5_Elements::TEXT_RAW | HTML5_Elements::TEXT_RCDATA); $this->untilTag = $untilTag; }
php
public function setTextMode($textmode, $untilTag = null) { $this->textMode = $textmode & (HTML5_Elements::TEXT_RAW | HTML5_Elements::TEXT_RCDATA); $this->untilTag = $untilTag; }
[ "public", "function", "setTextMode", "(", "$", "textmode", ",", "$", "untilTag", "=", "null", ")", "{", "$", "this", "->", "textMode", "=", "$", "textmode", "&", "(", "HTML5_Elements", "::", "TEXT_RAW", "|", "HTML5_Elements", "::", "TEXT_RCDATA", ")", ";",...
Set the text mode for the character data reader. HTML5 defines three different modes for reading text: - Normal: Read until a tag is encountered. - RCDATA: Read until a tag is encountered, but skip a few otherwise- special characters. - Raw: Read until a special closing tag is encountered (viz. pre, script) This allo...
[ "Set", "the", "text", "mode", "for", "the", "character", "data", "reader", "." ]
4ea8caf5b2618a82ca5061dcbb7421b31065c1c7
https://github.com/PHPPowertools/HTML5/blob/4ea8caf5b2618a82ca5061dcbb7421b31065c1c7/src/PowerTools/HTML5/Parser/Tokenizer.php#L184-L187
21,777
PHPPowertools/HTML5
src/PowerTools/HTML5/Parser/Tokenizer.php
HTML5_Parser_Tokenizer.consumeData
protected function consumeData() { // Character Ref /* * $this->characterReference() || $this->tagOpen() || $this->eof() || $this->characterData(); */ $this->characterReference(); $this->tagOpen(); $this->eof(); $this->characterData(); return $t...
php
protected function consumeData() { // Character Ref /* * $this->characterReference() || $this->tagOpen() || $this->eof() || $this->characterData(); */ $this->characterReference(); $this->tagOpen(); $this->eof(); $this->characterData(); return $t...
[ "protected", "function", "consumeData", "(", ")", "{", "// Character Ref", "/*\n * $this->characterReference() || $this->tagOpen() || $this->eof() || $this->characterData();\n */", "$", "this", "->", "characterReference", "(", ")", ";", "$", "this", "->", "tagOpen...
Consume a character and make a move. HTML5 8.2.4.1
[ "Consume", "a", "character", "and", "make", "a", "move", ".", "HTML5", "8", ".", "2", ".", "4", ".", "1" ]
4ea8caf5b2618a82ca5061dcbb7421b31065c1c7
https://github.com/PHPPowertools/HTML5/blob/4ea8caf5b2618a82ca5061dcbb7421b31065c1c7/src/PowerTools/HTML5/Parser/Tokenizer.php#L193-L204
21,778
PHPPowertools/HTML5
src/PowerTools/HTML5/Parser/Tokenizer.php
HTML5_Parser_Tokenizer.characterData
protected function characterData() { if ($this->scanner->current() === false) { return false; } switch ($this->textMode) { case HTML5_Elements::TEXT_RAW: return $this->rawText(); case HTML5_Elements::TEXT_RCDATA: return $this->r...
php
protected function characterData() { if ($this->scanner->current() === false) { return false; } switch ($this->textMode) { case HTML5_Elements::TEXT_RAW: return $this->rawText(); case HTML5_Elements::TEXT_RCDATA: return $this->r...
[ "protected", "function", "characterData", "(", ")", "{", "if", "(", "$", "this", "->", "scanner", "->", "current", "(", ")", "===", "false", ")", "{", "return", "false", ";", "}", "switch", "(", "$", "this", "->", "textMode", ")", "{", "case", "HTML5...
Parse anything that looks like character data. Different rules apply based on the current text mode. @see HTML5_Elements::TEXT_RAW HTML5_Elements::TEXT_RCDATA.
[ "Parse", "anything", "that", "looks", "like", "character", "data", "." ]
4ea8caf5b2618a82ca5061dcbb7421b31065c1c7
https://github.com/PHPPowertools/HTML5/blob/4ea8caf5b2618a82ca5061dcbb7421b31065c1c7/src/PowerTools/HTML5/Parser/Tokenizer.php#L213-L229
21,779
PHPPowertools/HTML5
src/PowerTools/HTML5/Parser/Tokenizer.php
HTML5_Parser_Tokenizer.text
protected function text() { $tok = $this->scanner->current(); // This should never happen... if ($tok === false) { return false; } // Null if ($tok === "\00") { $this->parseError("Received null character."); } // fprintf(STDOUT, "W...
php
protected function text() { $tok = $this->scanner->current(); // This should never happen... if ($tok === false) { return false; } // Null if ($tok === "\00") { $this->parseError("Received null character."); } // fprintf(STDOUT, "W...
[ "protected", "function", "text", "(", ")", "{", "$", "tok", "=", "$", "this", "->", "scanner", "->", "current", "(", ")", ";", "// This should never happen...", "if", "(", "$", "tok", "===", "false", ")", "{", "return", "false", ";", "}", "// Null", "i...
This buffers the current token as character data.
[ "This", "buffers", "the", "current", "token", "as", "character", "data", "." ]
4ea8caf5b2618a82ca5061dcbb7421b31065c1c7
https://github.com/PHPPowertools/HTML5/blob/4ea8caf5b2618a82ca5061dcbb7421b31065c1c7/src/PowerTools/HTML5/Parser/Tokenizer.php#L234-L249
21,780
PHPPowertools/HTML5
src/PowerTools/HTML5/Parser/Tokenizer.php
HTML5_Parser_Tokenizer.rawText
protected function rawText() { if (is_null($this->untilTag)) { return $this->text(); } $sequence = '</' . $this->untilTag . '>'; $txt = $this->readUntilSequence($sequence); $this->events->text($txt); $this->setTextMode(0); return $this->endTag(); }
php
protected function rawText() { if (is_null($this->untilTag)) { return $this->text(); } $sequence = '</' . $this->untilTag . '>'; $txt = $this->readUntilSequence($sequence); $this->events->text($txt); $this->setTextMode(0); return $this->endTag(); }
[ "protected", "function", "rawText", "(", ")", "{", "if", "(", "is_null", "(", "$", "this", "->", "untilTag", ")", ")", "{", "return", "$", "this", "->", "text", "(", ")", ";", "}", "$", "sequence", "=", "'</'", ".", "$", "this", "->", "untilTag", ...
Read text in RAW mode.
[ "Read", "text", "in", "RAW", "mode", "." ]
4ea8caf5b2618a82ca5061dcbb7421b31065c1c7
https://github.com/PHPPowertools/HTML5/blob/4ea8caf5b2618a82ca5061dcbb7421b31065c1c7/src/PowerTools/HTML5/Parser/Tokenizer.php#L254-L263
21,781
PHPPowertools/HTML5
src/PowerTools/HTML5/Parser/Tokenizer.php
HTML5_Parser_Tokenizer.rcdata
protected function rcdata() { if (is_null($this->untilTag)) { return $this->text(); } $sequence = '</' . $this->untilTag . '>'; $txt = ''; $tok = $this->scanner->current(); while ($tok !== false && !($tok == '<' && ($this->sequenceMatches($sequence) || $this->...
php
protected function rcdata() { if (is_null($this->untilTag)) { return $this->text(); } $sequence = '</' . $this->untilTag . '>'; $txt = ''; $tok = $this->scanner->current(); while ($tok !== false && !($tok == '<' && ($this->sequenceMatches($sequence) || $this->...
[ "protected", "function", "rcdata", "(", ")", "{", "if", "(", "is_null", "(", "$", "this", "->", "untilTag", ")", ")", "{", "return", "$", "this", "->", "text", "(", ")", ";", "}", "$", "sequence", "=", "'</'", ".", "$", "this", "->", "untilTag", ...
Read text in RCDATA mode.
[ "Read", "text", "in", "RCDATA", "mode", "." ]
4ea8caf5b2618a82ca5061dcbb7421b31065c1c7
https://github.com/PHPPowertools/HTML5/blob/4ea8caf5b2618a82ca5061dcbb7421b31065c1c7/src/PowerTools/HTML5/Parser/Tokenizer.php#L268-L287
21,782
PHPPowertools/HTML5
src/PowerTools/HTML5/Parser/Tokenizer.php
HTML5_Parser_Tokenizer.eof
protected function eof() { if ($this->scanner->current() === false) { // fprintf(STDOUT, "EOF"); $this->flushBuffer(); $this->events->eof(); $this->carryOn = false; return true; } return false; }
php
protected function eof() { if ($this->scanner->current() === false) { // fprintf(STDOUT, "EOF"); $this->flushBuffer(); $this->events->eof(); $this->carryOn = false; return true; } return false; }
[ "protected", "function", "eof", "(", ")", "{", "if", "(", "$", "this", "->", "scanner", "->", "current", "(", ")", "===", "false", ")", "{", "// fprintf(STDOUT, \"EOF\");", "$", "this", "->", "flushBuffer", "(", ")", ";", "$", "this", "->", "events", "...
If the document is read, emit an EOF event.
[ "If", "the", "document", "is", "read", "emit", "an", "EOF", "event", "." ]
4ea8caf5b2618a82ca5061dcbb7421b31065c1c7
https://github.com/PHPPowertools/HTML5/blob/4ea8caf5b2618a82ca5061dcbb7421b31065c1c7/src/PowerTools/HTML5/Parser/Tokenizer.php#L292-L301
21,783
PHPPowertools/HTML5
src/PowerTools/HTML5/Parser/Tokenizer.php
HTML5_Parser_Tokenizer.tagOpen
protected function tagOpen() { if ($this->scanner->current() != '<') { return false; } // Any buffered text data can go out now. $this->flushBuffer(); $this->scanner->next(); return $this->markupDeclaration() || $this->endTag() || $this->processingInstructi...
php
protected function tagOpen() { if ($this->scanner->current() != '<') { return false; } // Any buffered text data can go out now. $this->flushBuffer(); $this->scanner->next(); return $this->markupDeclaration() || $this->endTag() || $this->processingInstructi...
[ "protected", "function", "tagOpen", "(", ")", "{", "if", "(", "$", "this", "->", "scanner", "->", "current", "(", ")", "!=", "'<'", ")", "{", "return", "false", ";", "}", "// Any buffered text data can go out now.", "$", "this", "->", "flushBuffer", "(", "...
Emit a tagStart event on encountering a tag. 8.2.4.8
[ "Emit", "a", "tagStart", "event", "on", "encountering", "a", "tag", "." ]
4ea8caf5b2618a82ca5061dcbb7421b31065c1c7
https://github.com/PHPPowertools/HTML5/blob/4ea8caf5b2618a82ca5061dcbb7421b31065c1c7/src/PowerTools/HTML5/Parser/Tokenizer.php#L325-L338
21,784
PHPPowertools/HTML5
src/PowerTools/HTML5/Parser/Tokenizer.php
HTML5_Parser_Tokenizer.markupDeclaration
protected function markupDeclaration() { if ($this->scanner->current() != '!') { return false; } $tok = $this->scanner->next(); // Comment: if ($tok == '-' && $this->scanner->peek() == '-') { $this->scanner->next(); // Consume the other '-' $...
php
protected function markupDeclaration() { if ($this->scanner->current() != '!') { return false; } $tok = $this->scanner->next(); // Comment: if ($tok == '-' && $this->scanner->peek() == '-') { $this->scanner->next(); // Consume the other '-' $...
[ "protected", "function", "markupDeclaration", "(", ")", "{", "if", "(", "$", "this", "->", "scanner", "->", "current", "(", ")", "!=", "'!'", ")", "{", "return", "false", ";", "}", "$", "tok", "=", "$", "this", "->", "scanner", "->", "next", "(", "...
Look for markup.
[ "Look", "for", "markup", "." ]
4ea8caf5b2618a82ca5061dcbb7421b31065c1c7
https://github.com/PHPPowertools/HTML5/blob/4ea8caf5b2618a82ca5061dcbb7421b31065c1c7/src/PowerTools/HTML5/Parser/Tokenizer.php#L343-L365
21,785
PHPPowertools/HTML5
src/PowerTools/HTML5/Parser/Tokenizer.php
HTML5_Parser_Tokenizer.endTag
protected function endTag() { if ($this->scanner->current() != '/') { return false; } $tok = $this->scanner->next(); // a-zA-Z -> tagname // > -> parse error // EOF -> parse error // -> parse error if (!ctype_alpha($tok)) { $this->...
php
protected function endTag() { if ($this->scanner->current() != '/') { return false; } $tok = $this->scanner->next(); // a-zA-Z -> tagname // > -> parse error // EOF -> parse error // -> parse error if (!ctype_alpha($tok)) { $this->...
[ "protected", "function", "endTag", "(", ")", "{", "if", "(", "$", "this", "->", "scanner", "->", "current", "(", ")", "!=", "'/'", ")", "{", "return", "false", ";", "}", "$", "tok", "=", "$", "this", "->", "scanner", "->", "next", "(", ")", ";", ...
Consume an end tag. 8.2.4.9
[ "Consume", "an", "end", "tag", ".", "8", ".", "2", ".", "4", ".", "9" ]
4ea8caf5b2618a82ca5061dcbb7421b31065c1c7
https://github.com/PHPPowertools/HTML5/blob/4ea8caf5b2618a82ca5061dcbb7421b31065c1c7/src/PowerTools/HTML5/Parser/Tokenizer.php#L371-L402
21,786
PHPPowertools/HTML5
src/PowerTools/HTML5/Parser/Tokenizer.php
HTML5_Parser_Tokenizer.tagName
protected function tagName() { $tok = $this->scanner->current(); if (!ctype_alpha($tok)) { return false; } // We know this is at least one char. $name = strtolower($this->scanner->charsWhile(":_-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz")); ...
php
protected function tagName() { $tok = $this->scanner->current(); if (!ctype_alpha($tok)) { return false; } // We know this is at least one char. $name = strtolower($this->scanner->charsWhile(":_-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz")); ...
[ "protected", "function", "tagName", "(", ")", "{", "$", "tok", "=", "$", "this", "->", "scanner", "->", "current", "(", ")", ";", "if", "(", "!", "ctype_alpha", "(", "$", "tok", ")", ")", "{", "return", "false", ";", "}", "// We know this is at least o...
Consume a tag name and body. 8.2.4.10
[ "Consume", "a", "tag", "name", "and", "body", ".", "8", ".", "2", ".", "4", ".", "10" ]
4ea8caf5b2618a82ca5061dcbb7421b31065c1c7
https://github.com/PHPPowertools/HTML5/blob/4ea8caf5b2618a82ca5061dcbb7421b31065c1c7/src/PowerTools/HTML5/Parser/Tokenizer.php#L408-L442
21,787
PHPPowertools/HTML5
src/PowerTools/HTML5/Parser/Tokenizer.php
HTML5_Parser_Tokenizer.isTagEnd
protected function isTagEnd(&$selfClose) { $tok = $this->scanner->current(); if ($tok == '/') { $this->scanner->next(); $this->scanner->whitespace(); if ($this->scanner->current() == '>') { $selfClose = true; return true; } ...
php
protected function isTagEnd(&$selfClose) { $tok = $this->scanner->current(); if ($tok == '/') { $this->scanner->next(); $this->scanner->whitespace(); if ($this->scanner->current() == '>') { $selfClose = true; return true; } ...
[ "protected", "function", "isTagEnd", "(", "&", "$", "selfClose", ")", "{", "$", "tok", "=", "$", "this", "->", "scanner", "->", "current", "(", ")", ";", "if", "(", "$", "tok", "==", "'/'", ")", "{", "$", "this", "->", "scanner", "->", "next", "(...
Check if the scanner has reached the end of a tag.
[ "Check", "if", "the", "scanner", "has", "reached", "the", "end", "of", "a", "tag", "." ]
4ea8caf5b2618a82ca5061dcbb7421b31065c1c7
https://github.com/PHPPowertools/HTML5/blob/4ea8caf5b2618a82ca5061dcbb7421b31065c1c7/src/PowerTools/HTML5/Parser/Tokenizer.php#L447-L475
21,788
PHPPowertools/HTML5
src/PowerTools/HTML5/Parser/Tokenizer.php
HTML5_Parser_Tokenizer.attribute
protected function attribute(&$attributes) { $tok = $this->scanner->current(); if ($tok == '/' || $tok == '>' || $tok === false) { return false; } if ($tok == '<') { $this->parseError("Unexepcted '<' inside of attributes list."); // Push the < back on...
php
protected function attribute(&$attributes) { $tok = $this->scanner->current(); if ($tok == '/' || $tok == '>' || $tok === false) { return false; } if ($tok == '<') { $this->parseError("Unexepcted '<' inside of attributes list."); // Push the < back on...
[ "protected", "function", "attribute", "(", "&", "$", "attributes", ")", "{", "$", "tok", "=", "$", "this", "->", "scanner", "->", "current", "(", ")", ";", "if", "(", "$", "tok", "==", "'/'", "||", "$", "tok", "==", "'>'", "||", "$", "tok", "==="...
Parse attributes from inside of a tag.
[ "Parse", "attributes", "from", "inside", "of", "a", "tag", "." ]
4ea8caf5b2618a82ca5061dcbb7421b31065c1c7
https://github.com/PHPPowertools/HTML5/blob/4ea8caf5b2618a82ca5061dcbb7421b31065c1c7/src/PowerTools/HTML5/Parser/Tokenizer.php#L480-L531
21,789
PHPPowertools/HTML5
src/PowerTools/HTML5/Parser/Tokenizer.php
HTML5_Parser_Tokenizer.attributeValue
protected function attributeValue() { if ($this->scanner->current() != '=') { return null; } $this->scanner->next(); // 8.1.2.3 $this->scanner->whitespace(); $tok = $this->scanner->current(); switch ($tok) { case "\n": case "\f...
php
protected function attributeValue() { if ($this->scanner->current() != '=') { return null; } $this->scanner->next(); // 8.1.2.3 $this->scanner->whitespace(); $tok = $this->scanner->current(); switch ($tok) { case "\n": case "\f...
[ "protected", "function", "attributeValue", "(", ")", "{", "if", "(", "$", "this", "->", "scanner", "->", "current", "(", ")", "!=", "'='", ")", "{", "return", "null", ";", "}", "$", "this", "->", "scanner", "->", "next", "(", ")", ";", "// 8.1.2.3", ...
Consume an attribute value. 8.2.4.37 and after.
[ "Consume", "an", "attribute", "value", ".", "8", ".", "2", ".", "4", ".", "37", "and", "after", "." ]
4ea8caf5b2618a82ca5061dcbb7421b31065c1c7
https://github.com/PHPPowertools/HTML5/blob/4ea8caf5b2618a82ca5061dcbb7421b31065c1c7/src/PowerTools/HTML5/Parser/Tokenizer.php#L537-L568
21,790
PHPPowertools/HTML5
src/PowerTools/HTML5/Parser/Tokenizer.php
HTML5_Parser_Tokenizer.quotedAttributeValue
protected function quotedAttributeValue($quote) { $stoplist = "\f" . $quote; $val = ''; $tok = $this->scanner->current(); while (strspn($tok, $stoplist) == 0 && $tok !== false) { if ($tok == '&') { $val .= $this->decodeCharacterReference(true); ...
php
protected function quotedAttributeValue($quote) { $stoplist = "\f" . $quote; $val = ''; $tok = $this->scanner->current(); while (strspn($tok, $stoplist) == 0 && $tok !== false) { if ($tok == '&') { $val .= $this->decodeCharacterReference(true); ...
[ "protected", "function", "quotedAttributeValue", "(", "$", "quote", ")", "{", "$", "stoplist", "=", "\"\\f\"", ".", "$", "quote", ";", "$", "val", "=", "''", ";", "$", "tok", "=", "$", "this", "->", "scanner", "->", "current", "(", ")", ";", "while",...
Get an attribute value string. @param string $quote IMPORTANT: This is a series of chars! Any one of which will be considered termination of an attribute's value. E.g. "\"'" will stop at either ' or ". @return string The attribute value.
[ "Get", "an", "attribute", "value", "string", "." ]
4ea8caf5b2618a82ca5061dcbb7421b31065c1c7
https://github.com/PHPPowertools/HTML5/blob/4ea8caf5b2618a82ca5061dcbb7421b31065c1c7/src/PowerTools/HTML5/Parser/Tokenizer.php#L579-L594
21,791
PHPPowertools/HTML5
src/PowerTools/HTML5/Parser/Tokenizer.php
HTML5_Parser_Tokenizer.bogusComment
protected function bogusComment($leading = '') { // TODO: This can be done more efficiently when the // scanner exposes a readUntil() method. $comment = $leading; $tok = $this->scanner->current(); do { $comment .= $tok; $tok = $this->scanner->next(); ...
php
protected function bogusComment($leading = '') { // TODO: This can be done more efficiently when the // scanner exposes a readUntil() method. $comment = $leading; $tok = $this->scanner->current(); do { $comment .= $tok; $tok = $this->scanner->next(); ...
[ "protected", "function", "bogusComment", "(", "$", "leading", "=", "''", ")", "{", "// TODO: This can be done more efficiently when the", "// scanner exposes a readUntil() method.", "$", "comment", "=", "$", "leading", ";", "$", "tok", "=", "$", "this", "->", "scanner...
Consume malformed markup as if it were a comment. 8.2.4.44 The spec requires that the ENTIRE tag-like thing be enclosed inside of the comment. So this will generate comments like: &lt;!--&lt/+foo&gt;--&gt; @param string $leading Prepend any leading characters. This essentially negates the need to backtrack, but it's...
[ "Consume", "malformed", "markup", "as", "if", "it", "were", "a", "comment", ".", "8", ".", "2", ".", "4", ".", "44" ]
4ea8caf5b2618a82ca5061dcbb7421b31065c1c7
https://github.com/PHPPowertools/HTML5/blob/4ea8caf5b2618a82ca5061dcbb7421b31065c1c7/src/PowerTools/HTML5/Parser/Tokenizer.php#L629-L645
21,792
PHPPowertools/HTML5
src/PowerTools/HTML5/Parser/Tokenizer.php
HTML5_Parser_Tokenizer.comment
protected function comment() { $tok = $this->scanner->current(); $comment = ''; // <!-->. Emit an empty comment because 8.2.4.46 says to. if ($tok == '>') { // Parse error. Emit the comment token. $this->parseError("Expected comment data, got '>'"); $...
php
protected function comment() { $tok = $this->scanner->current(); $comment = ''; // <!-->. Emit an empty comment because 8.2.4.46 says to. if ($tok == '>') { // Parse error. Emit the comment token. $this->parseError("Expected comment data, got '>'"); $...
[ "protected", "function", "comment", "(", ")", "{", "$", "tok", "=", "$", "this", "->", "scanner", "->", "current", "(", ")", ";", "$", "comment", "=", "''", ";", "// <!-->. Emit an empty comment because 8.2.4.46 says to.", "if", "(", "$", "tok", "==", "'>'",...
Read a comment. Expects the first tok to be inside of the comment.
[ "Read", "a", "comment", "." ]
4ea8caf5b2618a82ca5061dcbb7421b31065c1c7
https://github.com/PHPPowertools/HTML5/blob/4ea8caf5b2618a82ca5061dcbb7421b31065c1c7/src/PowerTools/HTML5/Parser/Tokenizer.php#L652-L677
21,793
PHPPowertools/HTML5
src/PowerTools/HTML5/Parser/Tokenizer.php
HTML5_Parser_Tokenizer.isCommentEnd
protected function isCommentEnd() { // EOF if ($this->scanner->current() === false) { // Hit the end. $this->parseError("Unexpected EOF in a comment."); return true; } // If it doesn't start with -, not the end. if ($this->scanner->current() !...
php
protected function isCommentEnd() { // EOF if ($this->scanner->current() === false) { // Hit the end. $this->parseError("Unexpected EOF in a comment."); return true; } // If it doesn't start with -, not the end. if ($this->scanner->current() !...
[ "protected", "function", "isCommentEnd", "(", ")", "{", "// EOF", "if", "(", "$", "this", "->", "scanner", "->", "current", "(", ")", "===", "false", ")", "{", "// Hit the end.", "$", "this", "->", "parseError", "(", "\"Unexpected EOF in a comment.\"", ")", ...
Check if the scanner has reached the end of a comment.
[ "Check", "if", "the", "scanner", "has", "reached", "the", "end", "of", "a", "comment", "." ]
4ea8caf5b2618a82ca5061dcbb7421b31065c1c7
https://github.com/PHPPowertools/HTML5/blob/4ea8caf5b2618a82ca5061dcbb7421b31065c1c7/src/PowerTools/HTML5/Parser/Tokenizer.php#L682-L703
21,794
PHPPowertools/HTML5
src/PowerTools/HTML5/Parser/Tokenizer.php
HTML5_Parser_Tokenizer.quotedString
protected function quotedString($stopchars) { $tok = $this->scanner->current(); if ($tok == '"' || $tok == "'") { $this->scanner->next(); $ret = $this->scanner->charsUntil($tok . $stopchars); if ($this->scanner->current() == $tok) { $this->scanner->nex...
php
protected function quotedString($stopchars) { $tok = $this->scanner->current(); if ($tok == '"' || $tok == "'") { $this->scanner->next(); $ret = $this->scanner->charsUntil($tok . $stopchars); if ($this->scanner->current() == $tok) { $this->scanner->nex...
[ "protected", "function", "quotedString", "(", "$", "stopchars", ")", "{", "$", "tok", "=", "$", "this", "->", "scanner", "->", "current", "(", ")", ";", "if", "(", "$", "tok", "==", "'\"'", "||", "$", "tok", "==", "\"'\"", ")", "{", "$", "this", ...
Utility for reading a quoted string. @param string $stopchars Characters (in addition to a close-quote) that should stop the string. E.g. sometimes '>' is higher precedence than '"' or "'". @return mixed String if one is found (quotations omitted)
[ "Utility", "for", "reading", "a", "quoted", "string", "." ]
4ea8caf5b2618a82ca5061dcbb7421b31065c1c7
https://github.com/PHPPowertools/HTML5/blob/4ea8caf5b2618a82ca5061dcbb7421b31065c1c7/src/PowerTools/HTML5/Parser/Tokenizer.php#L827-L841
21,795
PHPPowertools/HTML5
src/PowerTools/HTML5/Parser/Tokenizer.php
HTML5_Parser_Tokenizer.cdataSection
protected function cdataSection() { if ($this->scanner->current() != '[') { return false; } $cdata = ''; $this->scanner->next(); $chars = $this->scanner->charsWhile('CDAT'); if ($chars != 'CDATA' || $this->scanner->current() != '[') { $this->parse...
php
protected function cdataSection() { if ($this->scanner->current() != '[') { return false; } $cdata = ''; $this->scanner->next(); $chars = $this->scanner->charsWhile('CDAT'); if ($chars != 'CDATA' || $this->scanner->current() != '[') { $this->parse...
[ "protected", "function", "cdataSection", "(", ")", "{", "if", "(", "$", "this", "->", "scanner", "->", "current", "(", ")", "!=", "'['", ")", "{", "return", "false", ";", "}", "$", "cdata", "=", "''", ";", "$", "this", "->", "scanner", "->", "next"...
Handle a CDATA section.
[ "Handle", "a", "CDATA", "section", "." ]
4ea8caf5b2618a82ca5061dcbb7421b31065c1c7
https://github.com/PHPPowertools/HTML5/blob/4ea8caf5b2618a82ca5061dcbb7421b31065c1c7/src/PowerTools/HTML5/Parser/Tokenizer.php#L846-L875
21,796
PHPPowertools/HTML5
src/PowerTools/HTML5/Parser/Tokenizer.php
HTML5_Parser_Tokenizer.processingInstruction
protected function processingInstruction() { if ($this->scanner->current() != '?') { return false; } $tok = $this->scanner->next(); $procName = $this->scanner->getAsciiAlpha(); $white = strlen($this->scanner->whitespace()); // If not a PI, send to bogusComme...
php
protected function processingInstruction() { if ($this->scanner->current() != '?') { return false; } $tok = $this->scanner->next(); $procName = $this->scanner->getAsciiAlpha(); $white = strlen($this->scanner->whitespace()); // If not a PI, send to bogusComme...
[ "protected", "function", "processingInstruction", "(", ")", "{", "if", "(", "$", "this", "->", "scanner", "->", "current", "(", ")", "!=", "'?'", ")", "{", "return", "false", ";", "}", "$", "tok", "=", "$", "this", "->", "scanner", "->", "next", "(",...
Handle a processing instruction. XML processing instructions are supposed to be ignored in HTML5, treated as "bogus comments". However, since we're not a user agent, we allow them. We consume until ?> and then issue a EventListener::processingInstruction() event.
[ "Handle", "a", "processing", "instruction", "." ]
4ea8caf5b2618a82ca5061dcbb7421b31065c1c7
https://github.com/PHPPowertools/HTML5/blob/4ea8caf5b2618a82ca5061dcbb7421b31065c1c7/src/PowerTools/HTML5/Parser/Tokenizer.php#L888-L921
21,797
PHPPowertools/HTML5
src/PowerTools/HTML5/Parser/Tokenizer.php
HTML5_Parser_Tokenizer.readUntilSequence
protected function readUntilSequence($sequence) { $buffer = ''; // Optimization for reading larger blocks faster. $first = substr($sequence, 0, 1); while ($this->scanner->current() !== false) { $buffer .= $this->scanner->charsUntil($first); // Stop as soon as we...
php
protected function readUntilSequence($sequence) { $buffer = ''; // Optimization for reading larger blocks faster. $first = substr($sequence, 0, 1); while ($this->scanner->current() !== false) { $buffer .= $this->scanner->charsUntil($first); // Stop as soon as we...
[ "protected", "function", "readUntilSequence", "(", "$", "sequence", ")", "{", "$", "buffer", "=", "''", ";", "// Optimization for reading larger blocks faster.", "$", "first", "=", "substr", "(", "$", "sequence", ",", "0", ",", "1", ")", ";", "while", "(", "...
Read from the input stream until we get to the desired sequene or hit the end of the input stream.
[ "Read", "from", "the", "input", "stream", "until", "we", "get", "to", "the", "desired", "sequene", "or", "hit", "the", "end", "of", "the", "input", "stream", "." ]
4ea8caf5b2618a82ca5061dcbb7421b31065c1c7
https://github.com/PHPPowertools/HTML5/blob/4ea8caf5b2618a82ca5061dcbb7421b31065c1c7/src/PowerTools/HTML5/Parser/Tokenizer.php#L931-L950
21,798
PHPPowertools/HTML5
src/PowerTools/HTML5/Parser/Tokenizer.php
HTML5_Parser_Tokenizer.sequenceMatches
protected function sequenceMatches($sequence) { $len = strlen($sequence); $buffer = ''; for ($i = 0; $i < $len; ++$i) { $buffer .= $this->scanner->current(); // EOF. Rewind and let the caller handle it. if ($this->scanner->current() === false) { ...
php
protected function sequenceMatches($sequence) { $len = strlen($sequence); $buffer = ''; for ($i = 0; $i < $len; ++$i) { $buffer .= $this->scanner->current(); // EOF. Rewind and let the caller handle it. if ($this->scanner->current() === false) { ...
[ "protected", "function", "sequenceMatches", "(", "$", "sequence", ")", "{", "$", "len", "=", "strlen", "(", "$", "sequence", ")", ";", "$", "buffer", "=", "''", ";", "for", "(", "$", "i", "=", "0", ";", "$", "i", "<", "$", "len", ";", "++", "$"...
Check if upcomming chars match the given sequence. This will read the stream for the $sequence. If it's found, this will return true. If not, return false. Since this unconsumes any chars it reads, the caller will still need to read the next sequence, even if this returns true. Example: $this->sequenceMatches('</scri...
[ "Check", "if", "upcomming", "chars", "match", "the", "given", "sequence", "." ]
4ea8caf5b2618a82ca5061dcbb7421b31065c1c7
https://github.com/PHPPowertools/HTML5/blob/4ea8caf5b2618a82ca5061dcbb7421b31065c1c7/src/PowerTools/HTML5/Parser/Tokenizer.php#L965-L981
21,799
PHPPowertools/HTML5
src/PowerTools/HTML5/Parser/Tokenizer.php
HTML5_Parser_Tokenizer.flushBuffer
protected function flushBuffer() { if ($this->text === '') { return; } $this->events->text($this->text); $this->text = ''; }
php
protected function flushBuffer() { if ($this->text === '') { return; } $this->events->text($this->text); $this->text = ''; }
[ "protected", "function", "flushBuffer", "(", ")", "{", "if", "(", "$", "this", "->", "text", "===", "''", ")", "{", "return", ";", "}", "$", "this", "->", "events", "->", "text", "(", "$", "this", "->", "text", ")", ";", "$", "this", "->", "text"...
Send a TEXT event with the contents of the text buffer. This emits an HTML5_Parser_EventHandler::text() event with the current contents of the temporary text buffer. (The buffer is used to group as much PCDATA as we can instead of emitting lots and lots of TEXT events.)
[ "Send", "a", "TEXT", "event", "with", "the", "contents", "of", "the", "text", "buffer", "." ]
4ea8caf5b2618a82ca5061dcbb7421b31065c1c7
https://github.com/PHPPowertools/HTML5/blob/4ea8caf5b2618a82ca5061dcbb7421b31065c1c7/src/PowerTools/HTML5/Parser/Tokenizer.php#L990-L996