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
30,100
marcelog/PAGI
src/PAGI/Node/Node.php
Node.resetInput
protected function resetInput() { if ($this->minInput === 0) { $this->state = self::STATE_COMPLETE; } else { $this->state = self::STATE_TIMEOUT; } $this->input = self::DTMF_NONE; return $this; }
php
protected function resetInput() { if ($this->minInput === 0) { $this->state = self::STATE_COMPLETE; } else { $this->state = self::STATE_TIMEOUT; } $this->input = self::DTMF_NONE; return $this; }
[ "protected", "function", "resetInput", "(", ")", "{", "if", "(", "$", "this", "->", "minInput", "===", "0", ")", "{", "$", "this", "->", "state", "=", "self", "::", "STATE_COMPLETE", ";", "}", "else", "{", "$", "this", "->", "state", "=", "self", "...
Internally used to clear the input per input attempt. Also resets state to TIMEOUT. @return Node
[ "Internally", "used", "to", "clear", "the", "input", "per", "input", "attempt", ".", "Also", "resets", "state", "to", "TIMEOUT", "." ]
c72d50304716c60a8c016eaf2b0faf2fca72f46d
https://github.com/marcelog/PAGI/blob/c72d50304716c60a8c016eaf2b0faf2fca72f46d/src/PAGI/Node/Node.php#L1112-L1121
30,101
marcelog/PAGI
src/PAGI/Node/Node.php
Node.doInput
protected function doInput() { /* @var $result IReadResult */ $this->resetInput(); $this->inputAttemptsUsed++; $result = $this->playPrePromptMessages(); if (!$this->acceptPrePromptInputAsInput) { $result = $this->playPromptMessages(); if ($result !== n...
php
protected function doInput() { /* @var $result IReadResult */ $this->resetInput(); $this->inputAttemptsUsed++; $result = $this->playPrePromptMessages(); if (!$this->acceptPrePromptInputAsInput) { $result = $this->playPromptMessages(); if ($result !== n...
[ "protected", "function", "doInput", "(", ")", "{", "/* @var $result IReadResult */", "$", "this", "->", "resetInput", "(", ")", ";", "$", "this", "->", "inputAttemptsUsed", "++", ";", "$", "result", "=", "$", "this", "->", "playPrePromptMessages", "(", ")", ...
Internally used to accept input from the user. Plays pre prompt messages, prompt, and waits for a complete input or cancel. @return void
[ "Internally", "used", "to", "accept", "input", "from", "the", "user", ".", "Plays", "pre", "prompt", "messages", "prompt", "and", "waits", "for", "a", "complete", "input", "or", "cancel", "." ]
c72d50304716c60a8c016eaf2b0faf2fca72f46d
https://github.com/marcelog/PAGI/blob/c72d50304716c60a8c016eaf2b0faf2fca72f46d/src/PAGI/Node/Node.php#L1129-L1178
30,102
marcelog/PAGI
src/PAGI/Node/Node.php
Node.run
public function run() { $this->inputAttemptsUsed = 0; if ($this->executeBeforeRun !== null) { $callback = $this->executeBeforeRun; $callback($this); } for ($attempts = 0; $attempts < $this->totalAttemptsForInput; $attempts++) { $this->doInput(); ...
php
public function run() { $this->inputAttemptsUsed = 0; if ($this->executeBeforeRun !== null) { $callback = $this->executeBeforeRun; $callback($this); } for ($attempts = 0; $attempts < $this->totalAttemptsForInput; $attempts++) { $this->doInput(); ...
[ "public", "function", "run", "(", ")", "{", "$", "this", "->", "inputAttemptsUsed", "=", "0", ";", "if", "(", "$", "this", "->", "executeBeforeRun", "!==", "null", ")", "{", "$", "callback", "=", "$", "this", "->", "executeBeforeRun", ";", "$", "callba...
Executes this node. @return Node
[ "Executes", "this", "node", "." ]
c72d50304716c60a8c016eaf2b0faf2fca72f46d
https://github.com/marcelog/PAGI/blob/c72d50304716c60a8c016eaf2b0faf2fca72f46d/src/PAGI/Node/Node.php#L1242-L1304
30,103
marcelog/PAGI
src/PAGI/Node/Node.php
Node.stateToString
protected function stateToString($state) { switch ($state) { case self::STATE_CANCEL: return "cancel"; case self::STATE_COMPLETE: return "complete"; case self::STATE_NOT_RUN: // a string like 'foo' matches here? return "not ...
php
protected function stateToString($state) { switch ($state) { case self::STATE_CANCEL: return "cancel"; case self::STATE_COMPLETE: return "complete"; case self::STATE_NOT_RUN: // a string like 'foo' matches here? return "not ...
[ "protected", "function", "stateToString", "(", "$", "state", ")", "{", "switch", "(", "$", "state", ")", "{", "case", "self", "::", "STATE_CANCEL", ":", "return", "\"cancel\"", ";", "case", "self", "::", "STATE_COMPLETE", ":", "return", "\"complete\"", ";", ...
Maps the current node state to a human readable string. @param integer $state One of the STATE_* constants. @return string @throws Exception\NodeException
[ "Maps", "the", "current", "node", "state", "to", "a", "human", "readable", "string", "." ]
c72d50304716c60a8c016eaf2b0faf2fca72f46d
https://github.com/marcelog/PAGI/blob/c72d50304716c60a8c016eaf2b0faf2fca72f46d/src/PAGI/Node/Node.php#L1339-L1355
30,104
marcelog/PAGI
src/PAGI/Node/NodeController.php
NodeController.jumpTo
public function jumpTo($name) { if (!isset($this->nodes[$name])) { throw new NodeException("Unknown node: $name"); } // Cant make this recursive because php does not support tail // recursion optimization. while ($name !== false) { $node = $this->nodes...
php
public function jumpTo($name) { if (!isset($this->nodes[$name])) { throw new NodeException("Unknown node: $name"); } // Cant make this recursive because php does not support tail // recursion optimization. while ($name !== false) { $node = $this->nodes...
[ "public", "function", "jumpTo", "(", "$", "name", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "nodes", "[", "$", "name", "]", ")", ")", "{", "throw", "new", "NodeException", "(", "\"Unknown node: $name\"", ")", ";", "}", "// Cant make th...
Runs a node and process the result. @param string $name Node to run. @return void @throws NodeException
[ "Runs", "a", "node", "and", "process", "the", "result", "." ]
c72d50304716c60a8c016eaf2b0faf2fca72f46d
https://github.com/marcelog/PAGI/blob/c72d50304716c60a8c016eaf2b0faf2fca72f46d/src/PAGI/Node/NodeController.php#L85-L98
30,105
marcelog/PAGI
src/PAGI/Node/NodeController.php
NodeController.processNodeResult
protected function processNodeResult(Node $node) { $ret = false; $name = $node->getName(); if (isset($this->nodeResults[$name])) { foreach ($this->nodeResults[$name] as $resultInfo) { /* @var $resultInfo NodeActionCommand */ if ($resultInfo->applie...
php
protected function processNodeResult(Node $node) { $ret = false; $name = $node->getName(); if (isset($this->nodeResults[$name])) { foreach ($this->nodeResults[$name] as $resultInfo) { /* @var $resultInfo NodeActionCommand */ if ($resultInfo->applie...
[ "protected", "function", "processNodeResult", "(", "Node", "$", "node", ")", "{", "$", "ret", "=", "false", ";", "$", "name", "=", "$", "node", "->", "getName", "(", ")", ";", "if", "(", "isset", "(", "$", "this", "->", "nodeResults", "[", "$", "na...
Process the result of the given node. Returns false if no other nodes should be run, or a string with the next node name. @param Node $node Node that was run. @return string|false
[ "Process", "the", "result", "of", "the", "given", "node", ".", "Returns", "false", "if", "no", "other", "nodes", "should", "be", "run", "or", "a", "string", "with", "the", "next", "node", "name", "." ]
c72d50304716c60a8c016eaf2b0faf2fca72f46d
https://github.com/marcelog/PAGI/blob/c72d50304716c60a8c016eaf2b0faf2fca72f46d/src/PAGI/Node/NodeController.php#L108-L140
30,106
marcelog/PAGI
src/PAGI/Node/NodeController.php
NodeController.registerResult
public function registerResult($name) { $nodeActionCommand = new NodeActionCommand(); if (!isset($this->nodeResults[$name])) { $this->nodeResults[$name] = array(); } $this->nodeResults[$name][] = $nodeActionCommand; return $nodeActionCommand->whenNode($name); ...
php
public function registerResult($name) { $nodeActionCommand = new NodeActionCommand(); if (!isset($this->nodeResults[$name])) { $this->nodeResults[$name] = array(); } $this->nodeResults[$name][] = $nodeActionCommand; return $nodeActionCommand->whenNode($name); ...
[ "public", "function", "registerResult", "(", "$", "name", ")", "{", "$", "nodeActionCommand", "=", "new", "NodeActionCommand", "(", ")", ";", "if", "(", "!", "isset", "(", "$", "this", "->", "nodeResults", "[", "$", "name", "]", ")", ")", "{", "$", "...
Registers a new node result to be taken into account when the given node is ran. @param string $name @return NodeActionCommand
[ "Registers", "a", "new", "node", "result", "to", "be", "taken", "into", "account", "when", "the", "given", "node", "is", "ran", "." ]
c72d50304716c60a8c016eaf2b0faf2fca72f46d
https://github.com/marcelog/PAGI/blob/c72d50304716c60a8c016eaf2b0faf2fca72f46d/src/PAGI/Node/NodeController.php#L150-L158
30,107
marcelog/PAGI
src/PAGI/Node/NodeController.php
NodeController.register
public function register($name) { $node = $this->client->createNode($name); $this->nodes[$name] = $node; return $node; }
php
public function register($name) { $node = $this->client->createNode($name); $this->nodes[$name] = $node; return $node; }
[ "public", "function", "register", "(", "$", "name", ")", "{", "$", "node", "=", "$", "this", "->", "client", "->", "createNode", "(", "$", "name", ")", ";", "$", "this", "->", "nodes", "[", "$", "name", "]", "=", "$", "node", ";", "return", "$", ...
Registers a new node in the application. Returns the created node. @param string $name The node to be registered @return \PAGI\Node\Node
[ "Registers", "a", "new", "node", "in", "the", "application", ".", "Returns", "the", "created", "node", "." ]
c72d50304716c60a8c016eaf2b0faf2fca72f46d
https://github.com/marcelog/PAGI/blob/c72d50304716c60a8c016eaf2b0faf2fca72f46d/src/PAGI/Node/NodeController.php#L167-L172
30,108
marcelog/PAGI
src/PAGI/Node/NodeController.php
NodeController.setAgiClient
public function setAgiClient(IClient $client) { $this->client = $client; $this->logger = $this->client->getAsteriskLogger(); return $this; }
php
public function setAgiClient(IClient $client) { $this->client = $client; $this->logger = $this->client->getAsteriskLogger(); return $this; }
[ "public", "function", "setAgiClient", "(", "IClient", "$", "client", ")", "{", "$", "this", "->", "client", "=", "$", "client", ";", "$", "this", "->", "logger", "=", "$", "this", "->", "client", "->", "getAsteriskLogger", "(", ")", ";", "return", "$",...
Sets the pagi client to use by this node. @param \PAGI\Client\IClient $client @return NodeController
[ "Sets", "the", "pagi", "client", "to", "use", "by", "this", "node", "." ]
c72d50304716c60a8c016eaf2b0faf2fca72f46d
https://github.com/marcelog/PAGI/blob/c72d50304716c60a8c016eaf2b0faf2fca72f46d/src/PAGI/Node/NodeController.php#L194-L199
30,109
marcelog/PAGI
src/PAGI/Node/NodeController.php
NodeController.logDebug
protected function logDebug($msg) { $logger = $this->client->getAsteriskLogger(); $ani = $this->client->getChannelVariables()->getCallerIdName(); $dnis = $this->client->getChannelVariables()->getDNIS(); $logger->debug("NodeController: {$this->name}: $ani -> $dnis: $msg"); }
php
protected function logDebug($msg) { $logger = $this->client->getAsteriskLogger(); $ani = $this->client->getChannelVariables()->getCallerIdName(); $dnis = $this->client->getChannelVariables()->getDNIS(); $logger->debug("NodeController: {$this->name}: $ani -> $dnis: $msg"); }
[ "protected", "function", "logDebug", "(", "$", "msg", ")", "{", "$", "logger", "=", "$", "this", "->", "client", "->", "getAsteriskLogger", "(", ")", ";", "$", "ani", "=", "$", "this", "->", "client", "->", "getChannelVariables", "(", ")", "->", "getCa...
Used internally to log debug messages @param string $msg @return void
[ "Used", "internally", "to", "log", "debug", "messages" ]
c72d50304716c60a8c016eaf2b0faf2fca72f46d
https://github.com/marcelog/PAGI/blob/c72d50304716c60a8c016eaf2b0faf2fca72f46d/src/PAGI/Node/NodeController.php#L208-L214
30,110
marcelog/PAGI
src/PAGI/ChannelVariables/Impl/ChannelVariablesFacade.php
ChannelVariablesFacade.getAGIVariable
protected function getAGIVariable($key) { if (!isset($this->variables[$key])) { return false; } return $this->variables[$key]; }
php
protected function getAGIVariable($key) { if (!isset($this->variables[$key])) { return false; } return $this->variables[$key]; }
[ "protected", "function", "getAGIVariable", "(", "$", "key", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "variables", "[", "$", "key", "]", ")", ")", "{", "return", "false", ";", "}", "return", "$", "this", "->", "variables", "[", "$"...
Returns the given variable. Returns false if not set. @param string $key Variable to get. @return string
[ "Returns", "the", "given", "variable", ".", "Returns", "false", "if", "not", "set", "." ]
c72d50304716c60a8c016eaf2b0faf2fca72f46d
https://github.com/marcelog/PAGI/blob/c72d50304716c60a8c016eaf2b0faf2fca72f46d/src/PAGI/ChannelVariables/Impl/ChannelVariablesFacade.php#L67-L73
30,111
marcelog/PAGI
src/PAGI/Client/AbstractClient.php
AbstractClient.readEnvironmentVariable
protected function readEnvironmentVariable($line) { list($key, $value) = explode(':', substr($line, 4), 2); if (strncmp($key, 'arg_', 4) === 0) { $this->arguments[substr($key, 4)] = $value; } else { $this->variables[$key] = $value; } }
php
protected function readEnvironmentVariable($line) { list($key, $value) = explode(':', substr($line, 4), 2); if (strncmp($key, 'arg_', 4) === 0) { $this->arguments[substr($key, 4)] = $value; } else { $this->variables[$key] = $value; } }
[ "protected", "function", "readEnvironmentVariable", "(", "$", "line", ")", "{", "list", "(", "$", "key", ",", "$", "value", ")", "=", "explode", "(", "':'", ",", "substr", "(", "$", "line", ",", "4", ")", ",", "2", ")", ";", "if", "(", "strncmp", ...
Will read and save an environment variable as either a variable or an argument. @param string $line @return void
[ "Will", "read", "and", "save", "an", "environment", "variable", "as", "either", "a", "variable", "or", "an", "argument", "." ]
c72d50304716c60a8c016eaf2b0faf2fca72f46d
https://github.com/marcelog/PAGI/blob/c72d50304716c60a8c016eaf2b0faf2fca72f46d/src/PAGI/Client/AbstractClient.php#L721-L729
30,112
n1crack/datatables
src/QueryBuilder.php
QueryBuilder.setColumnAttributes
public function setColumnAttributes(): void { $columns = $this->request->get('columns'); if ($columns) { $attributes = array_column($columns, null, 'data'); foreach ($attributes as $index => $attr) { if ($this->columns->visible()->isExists($index)) { ...
php
public function setColumnAttributes(): void { $columns = $this->request->get('columns'); if ($columns) { $attributes = array_column($columns, null, 'data'); foreach ($attributes as $index => $attr) { if ($this->columns->visible()->isExists($index)) { ...
[ "public", "function", "setColumnAttributes", "(", ")", ":", "void", "{", "$", "columns", "=", "$", "this", "->", "request", "->", "get", "(", "'columns'", ")", ";", "if", "(", "$", "columns", ")", "{", "$", "attributes", "=", "array_column", "(", "$", ...
Assign column attributes
[ "Assign", "column", "attributes" ]
80cfe6a9190602d39c5ae601115e0f2792b7cca5
https://github.com/n1crack/datatables/blob/80cfe6a9190602d39c5ae601115e0f2792b7cca5/src/QueryBuilder.php#L88-L101
30,113
n1crack/datatables
src/Iterators/ColumnCollection.php
ColumnCollection.getByName
public function getByName($name): Column { $lookup = array_column($this->getArrayCopy(), null, 'name'); return $lookup[$name]; }
php
public function getByName($name): Column { $lookup = array_column($this->getArrayCopy(), null, 'name'); return $lookup[$name]; }
[ "public", "function", "getByName", "(", "$", "name", ")", ":", "Column", "{", "$", "lookup", "=", "array_column", "(", "$", "this", "->", "getArrayCopy", "(", ")", ",", "null", ",", "'name'", ")", ";", "return", "$", "lookup", "[", "$", "name", "]", ...
it returns Column object by its name @param $name @return Column
[ "it", "returns", "Column", "object", "by", "its", "name" ]
80cfe6a9190602d39c5ae601115e0f2792b7cca5
https://github.com/n1crack/datatables/blob/80cfe6a9190602d39c5ae601115e0f2792b7cca5/src/Iterators/ColumnCollection.php#L52-L57
30,114
magroski/frogg
src/Model.php
Model.saveOrFail
public function saveOrFail(?array $data = null, ?array $whiteList = null) : void { $return = parent::save($data, $whiteList); if ($return === false) { throw new UnableToSaveRecord('Unable to save entity. Details: ' . json_encode($this->getMessages())); } }
php
public function saveOrFail(?array $data = null, ?array $whiteList = null) : void { $return = parent::save($data, $whiteList); if ($return === false) { throw new UnableToSaveRecord('Unable to save entity. Details: ' . json_encode($this->getMessages())); } }
[ "public", "function", "saveOrFail", "(", "?", "array", "$", "data", "=", "null", ",", "?", "array", "$", "whiteList", "=", "null", ")", ":", "void", "{", "$", "return", "=", "parent", "::", "save", "(", "$", "data", ",", "$", "whiteList", ")", ";",...
Save the entity or throw an exception. @param mixed[] $data @param mixed[] $whiteList @throws \Frogg\Exception\UnableToSaveRecord
[ "Save", "the", "entity", "or", "throw", "an", "exception", "." ]
669da2ed337e3a8477c5c99cfcf76503fd58b540
https://github.com/magroski/frogg/blob/669da2ed337e3a8477c5c99cfcf76503fd58b540/src/Model.php#L185-L192
30,115
magroski/frogg
src/Services/SqsClient.php
SqsClient.sendDelayedMessage
public function sendDelayedMessage(string $message, int $delay = 0) { $delay = max(0, $delay); $delay = min(900, $delay); $this->sqsClient->sendMessage([ 'DelaySeconds' => $delay, 'MessageBody' => $message, 'QueueUrl' => $this->queueUrl, ]); ...
php
public function sendDelayedMessage(string $message, int $delay = 0) { $delay = max(0, $delay); $delay = min(900, $delay); $this->sqsClient->sendMessage([ 'DelaySeconds' => $delay, 'MessageBody' => $message, 'QueueUrl' => $this->queueUrl, ]); ...
[ "public", "function", "sendDelayedMessage", "(", "string", "$", "message", ",", "int", "$", "delay", "=", "0", ")", "{", "$", "delay", "=", "max", "(", "0", ",", "$", "delay", ")", ";", "$", "delay", "=", "min", "(", "900", ",", "$", "delay", ")"...
Sends a message to AWS SQS service @param string $message The content of the message, must be text or a json_encoded array @param int $delay Delay in seconds. Min: 0 Max: 900 (15 minutes)
[ "Sends", "a", "message", "to", "AWS", "SQS", "service" ]
669da2ed337e3a8477c5c99cfcf76503fd58b540
https://github.com/magroski/frogg/blob/669da2ed337e3a8477c5c99cfcf76503fd58b540/src/Services/SqsClient.php#L56-L65
30,116
magroski/frogg
src/Upload.php
Upload.translate
function translate($str, $tokens = []) { if (array_key_exists($str, $this->translation)) { $str = $this->translation[$str]; } if (is_array($tokens) && sizeof($tokens) > 0) { $str = vsprintf($str, $tokens); } return $str; }
php
function translate($str, $tokens = []) { if (array_key_exists($str, $this->translation)) { $str = $this->translation[$str]; } if (is_array($tokens) && sizeof($tokens) > 0) { $str = vsprintf($str, $tokens); } return $str; }
[ "function", "translate", "(", "$", "str", ",", "$", "tokens", "=", "[", "]", ")", "{", "if", "(", "array_key_exists", "(", "$", "str", ",", "$", "this", "->", "translation", ")", ")", "{", "$", "str", "=", "$", "this", "->", "translation", "[", "...
Translate error messages @access private @param string $str Message to translate @param array $tokens Optional token values @return string Translated string
[ "Translate", "error", "messages" ]
669da2ed337e3a8477c5c99cfcf76503fd58b540
https://github.com/magroski/frogg/blob/669da2ed337e3a8477c5c99cfcf76503fd58b540/src/Upload.php#L2644-L2654
30,117
magroski/frogg
src/Upload.php
Upload.temp_dir
function temp_dir() { $dir = ''; if (function_exists('sys_get_temp_dir')) { $dir = sys_get_temp_dir(); } if (!$dir && $tmp = getenv('TMP')) { $dir = $tmp; } if (!$dir && $tmp = getenv('TEMP')) { $dir = $tmp; } if (!$...
php
function temp_dir() { $dir = ''; if (function_exists('sys_get_temp_dir')) { $dir = sys_get_temp_dir(); } if (!$dir && $tmp = getenv('TMP')) { $dir = $tmp; } if (!$dir && $tmp = getenv('TEMP')) { $dir = $tmp; } if (!$...
[ "function", "temp_dir", "(", ")", "{", "$", "dir", "=", "''", ";", "if", "(", "function_exists", "(", "'sys_get_temp_dir'", ")", ")", "{", "$", "dir", "=", "sys_get_temp_dir", "(", ")", ";", "}", "if", "(", "!", "$", "dir", "&&", "$", "tmp", "=", ...
Returns the temp directory @access private @return string Temp directory string
[ "Returns", "the", "temp", "directory" ]
669da2ed337e3a8477c5c99cfcf76503fd58b540
https://github.com/magroski/frogg/blob/669da2ed337e3a8477c5c99cfcf76503fd58b540/src/Upload.php#L2662-L2693
30,118
magroski/frogg
src/Sms/Tww.php
Tww.send
public function send(array $data) { $phone = preg_replace("/[(,),\-,\s]/", "", $data['to']); $phone = preg_replace('/^' . preg_quote('+55', '/') . '/', '', $phone); $text = self::sanitizeText($data['text']); $url = 'http://webservices.twwwireless.com.br/reluzcap/wsreluzca...
php
public function send(array $data) { $phone = preg_replace("/[(,),\-,\s]/", "", $data['to']); $phone = preg_replace('/^' . preg_quote('+55', '/') . '/', '', $phone); $text = self::sanitizeText($data['text']); $url = 'http://webservices.twwwireless.com.br/reluzcap/wsreluzca...
[ "public", "function", "send", "(", "array", "$", "data", ")", "{", "$", "phone", "=", "preg_replace", "(", "\"/[(,),\\-,\\s]/\"", ",", "\"\"", ",", "$", "data", "[", "'to'", "]", ")", ";", "$", "phone", "=", "preg_replace", "(", "'/^'", ".", "preg_quot...
Send a sms using Tww API @param array $data ['id', 'text', 'to'] Key-value array * 'id' - recipient unique identifier * 'text' - message that will be sent * 'to' - number without country code, @return bool|string
[ "Send", "a", "sms", "using", "Tww", "API" ]
669da2ed337e3a8477c5c99cfcf76503fd58b540
https://github.com/magroski/frogg/blob/669da2ed337e3a8477c5c99cfcf76503fd58b540/src/Sms/Tww.php#L30-L55
30,119
magroski/frogg
src/Permalink.php
Permalink.create
public function create() : string { return $this->prefix . self::createSlug($this->title) . $this->suffix; }
php
public function create() : string { return $this->prefix . self::createSlug($this->title) . $this->suffix; }
[ "public", "function", "create", "(", ")", ":", "string", "{", "return", "$", "this", "->", "prefix", ".", "self", "::", "createSlug", "(", "$", "this", "->", "title", ")", ".", "$", "this", "->", "suffix", ";", "}" ]
Creates the permalink @return string
[ "Creates", "the", "permalink" ]
669da2ed337e3a8477c5c99cfcf76503fd58b540
https://github.com/magroski/frogg/blob/669da2ed337e3a8477c5c99cfcf76503fd58b540/src/Permalink.php#L51-L54
30,120
Bacon/BaconStringUtils
src/BaconStringUtils/Slugifier.php
Slugifier.slugify
public function slugify($string) { $decoder = $this->getUniDecoder(); if (null !== $decoder) { $string = $decoder->decode($string); } $string = strtolower($string); $string = str_replace("'", '', $string); $string = preg_replace('([^a-zA-Z0-9_-]+)', '-',...
php
public function slugify($string) { $decoder = $this->getUniDecoder(); if (null !== $decoder) { $string = $decoder->decode($string); } $string = strtolower($string); $string = str_replace("'", '', $string); $string = preg_replace('([^a-zA-Z0-9_-]+)', '-',...
[ "public", "function", "slugify", "(", "$", "string", ")", "{", "$", "decoder", "=", "$", "this", "->", "getUniDecoder", "(", ")", ";", "if", "(", "null", "!==", "$", "decoder", ")", "{", "$", "string", "=", "$", "decoder", "->", "decode", "(", "$",...
Slugifies a string. @param string $string @return string
[ "Slugifies", "a", "string", "." ]
3d7818aca25190149a9a2415a0928d4964d6007e
https://github.com/Bacon/BaconStringUtils/blob/3d7818aca25190149a9a2415a0928d4964d6007e/src/BaconStringUtils/Slugifier.php#L25-L40
30,121
magroski/frogg
src/Controller.php
Controller.utf8WithoutBom
protected function utf8WithoutBom($string) { if ($string === null) { return null; } $bom = pack('H*', 'EFBBBF'); $string = str_replace($bom, '', $string); return $string; }
php
protected function utf8WithoutBom($string) { if ($string === null) { return null; } $bom = pack('H*', 'EFBBBF'); $string = str_replace($bom, '', $string); return $string; }
[ "protected", "function", "utf8WithoutBom", "(", "$", "string", ")", "{", "if", "(", "$", "string", "===", "null", ")", "{", "return", "null", ";", "}", "$", "bom", "=", "pack", "(", "'H*'", ",", "'EFBBBF'", ")", ";", "$", "string", "=", "str_replace"...
Remove BOM of UTF8 string @param string $string @return string
[ "Remove", "BOM", "of", "UTF8", "string" ]
669da2ed337e3a8477c5c99cfcf76503fd58b540
https://github.com/magroski/frogg/blob/669da2ed337e3a8477c5c99cfcf76503fd58b540/src/Controller.php#L295-L306
30,122
magroski/frogg
src/Services/GMaps.php
GMaps.calculateDistance
public function calculateDistance($locationA, $locationB, $metric = false) : int { $locationA = is_array($locationA) ? implode(',', $locationA) : $locationA; $locationB = is_array($locationB) ? implode(',', $locationB) : $locationB; if ($locationA == $locationB) { return 0; ...
php
public function calculateDistance($locationA, $locationB, $metric = false) : int { $locationA = is_array($locationA) ? implode(',', $locationA) : $locationA; $locationB = is_array($locationB) ? implode(',', $locationB) : $locationB; if ($locationA == $locationB) { return 0; ...
[ "public", "function", "calculateDistance", "(", "$", "locationA", ",", "$", "locationB", ",", "$", "metric", "=", "false", ")", ":", "int", "{", "$", "locationA", "=", "is_array", "(", "$", "locationA", ")", "?", "implode", "(", "','", ",", "$", "locat...
Calculate the route distance between two locations @param mixed $locationA 'City,State' string or [city,state] array @param mixed $locationB 'City,State' string or [city,state] array @param bool $metric (default = false) flag to indicate if the result should be returned in metric or imperial @return int Distance ...
[ "Calculate", "the", "route", "distance", "between", "two", "locations" ]
669da2ed337e3a8477c5c99cfcf76503fd58b540
https://github.com/magroski/frogg/blob/669da2ed337e3a8477c5c99cfcf76503fd58b540/src/Services/GMaps.php#L34-L56
30,123
magroski/frogg
src/Services/GMaps.php
GMaps.generateLink
public function generateLink(string $keyword) : string { $response = file_get_contents('https://maps.googleapis.com/maps/api/place/textsearch/json?query=' . urlencode($keyword) . '&key=' . $this->apiKey); $data = json_decode($response); if (empty($data->results) || $data->status == 'ZER...
php
public function generateLink(string $keyword) : string { $response = file_get_contents('https://maps.googleapis.com/maps/api/place/textsearch/json?query=' . urlencode($keyword) . '&key=' . $this->apiKey); $data = json_decode($response); if (empty($data->results) || $data->status == 'ZER...
[ "public", "function", "generateLink", "(", "string", "$", "keyword", ")", ":", "string", "{", "$", "response", "=", "file_get_contents", "(", "'https://maps.googleapis.com/maps/api/place/textsearch/json?query='", ".", "urlencode", "(", "$", "keyword", ")", ".", "'&key...
Search the most relevant place based on a keyword and return a link to its location @param string $keyword An address or place. Ex: '5th Avenue, New York' or 'Eiffel Tower' @return string A GoogleMaps link @throws \Exception When the given address was not found
[ "Search", "the", "most", "relevant", "place", "based", "on", "a", "keyword", "and", "return", "a", "link", "to", "its", "location" ]
669da2ed337e3a8477c5c99cfcf76503fd58b540
https://github.com/magroski/frogg/blob/669da2ed337e3a8477c5c99cfcf76503fd58b540/src/Services/GMaps.php#L67-L80
30,124
magroski/frogg
src/Model/ResultSet.php
ResultSet.getAttribute
public function getAttribute(string $attributeName) : array { if ($this->isEmpty()) { return []; } $entries = $this->toArray(); if (!array_key_exists($attributeName, $entries[0])) { throw new InvalidAttributeException($attributeName); } retur...
php
public function getAttribute(string $attributeName) : array { if ($this->isEmpty()) { return []; } $entries = $this->toArray(); if (!array_key_exists($attributeName, $entries[0])) { throw new InvalidAttributeException($attributeName); } retur...
[ "public", "function", "getAttribute", "(", "string", "$", "attributeName", ")", ":", "array", "{", "if", "(", "$", "this", "->", "isEmpty", "(", ")", ")", "{", "return", "[", "]", ";", "}", "$", "entries", "=", "$", "this", "->", "toArray", "(", ")...
Returns an array containing the values of a given attribute of each object in the ResultSet @param string $attributeName Attribute name @return array @throws InvalidAttributeException When the attribute is not found on the object
[ "Returns", "an", "array", "containing", "the", "values", "of", "a", "given", "attribute", "of", "each", "object", "in", "the", "ResultSet" ]
669da2ed337e3a8477c5c99cfcf76503fd58b540
https://github.com/magroski/frogg/blob/669da2ed337e3a8477c5c99cfcf76503fd58b540/src/Model/ResultSet.php#L20-L32
30,125
magroski/frogg
src/Model/ResultSet.php
ResultSet.toObjectArray
public function toObjectArray() : array { if ($this->isEmpty()) { return []; } $skeleton = $this->_model; return array_map(function ($entry) use ($skeleton) { return Model::cloneResult($skeleton, $entry); }, $this->toArray()); }
php
public function toObjectArray() : array { if ($this->isEmpty()) { return []; } $skeleton = $this->_model; return array_map(function ($entry) use ($skeleton) { return Model::cloneResult($skeleton, $entry); }, $this->toArray()); }
[ "public", "function", "toObjectArray", "(", ")", ":", "array", "{", "if", "(", "$", "this", "->", "isEmpty", "(", ")", ")", "{", "return", "[", "]", ";", "}", "$", "skeleton", "=", "$", "this", "->", "_model", ";", "return", "array_map", "(", "func...
Returns the ResultSet as an array containg instances of each entry original Model @return array
[ "Returns", "the", "ResultSet", "as", "an", "array", "containg", "instances", "of", "each", "entry", "original", "Model" ]
669da2ed337e3a8477c5c99cfcf76503fd58b540
https://github.com/magroski/frogg/blob/669da2ed337e3a8477c5c99cfcf76503fd58b540/src/Model/ResultSet.php#L113-L124
30,126
0x46616c6b/etherpad-lite-client
src/EtherpadLite/Request.php
Request.send
public function send(): ResponseInterface { $client = new HttpClient(['base_uri' => $this->url]); return $client->get( $this->getUrlPath(), [ 'query' => $this->getParams(), ] ); }
php
public function send(): ResponseInterface { $client = new HttpClient(['base_uri' => $this->url]); return $client->get( $this->getUrlPath(), [ 'query' => $this->getParams(), ] ); }
[ "public", "function", "send", "(", ")", ":", "ResponseInterface", "{", "$", "client", "=", "new", "HttpClient", "(", "[", "'base_uri'", "=>", "$", "this", "->", "url", "]", ")", ";", "return", "$", "client", "->", "get", "(", "$", "this", "->", "getU...
Send the built request url against the etherpad lite instance @return ResponseInterface
[ "Send", "the", "built", "request", "url", "against", "the", "etherpad", "lite", "instance" ]
30dd5b3fb21af88ea59aff18b3abb7c150ae7218
https://github.com/0x46616c6b/etherpad-lite-client/blob/30dd5b3fb21af88ea59aff18b3abb7c150ae7218/src/EtherpadLite/Request.php#L46-L56
30,127
0x46616c6b/etherpad-lite-client
src/EtherpadLite/Request.php
Request.getUrlPath
protected function getUrlPath(): string { $existingPath = parse_url($this->url, PHP_URL_PATH); return $existingPath.sprintf( '/api/%s/%s', Client::API_VERSION, $this->method ); }
php
protected function getUrlPath(): string { $existingPath = parse_url($this->url, PHP_URL_PATH); return $existingPath.sprintf( '/api/%s/%s', Client::API_VERSION, $this->method ); }
[ "protected", "function", "getUrlPath", "(", ")", ":", "string", "{", "$", "existingPath", "=", "parse_url", "(", "$", "this", "->", "url", ",", "PHP_URL_PATH", ")", ";", "return", "$", "existingPath", ".", "sprintf", "(", "'/api/%s/%s'", ",", "Client", "::...
Returns the path of the request url @return string
[ "Returns", "the", "path", "of", "the", "request", "url" ]
30dd5b3fb21af88ea59aff18b3abb7c150ae7218
https://github.com/0x46616c6b/etherpad-lite-client/blob/30dd5b3fb21af88ea59aff18b3abb7c150ae7218/src/EtherpadLite/Request.php#L63-L72
30,128
0x46616c6b/etherpad-lite-client
src/EtherpadLite/Client.php
Client.generatePadID
public function generatePadID(): string { $chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; $length = 16; $padID = ""; for ($i = 0; $i < $length; $i++) { $padID .= $chars[rand() % strlen($chars)]; } return $padID; }
php
public function generatePadID(): string { $chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; $length = 16; $padID = ""; for ($i = 0; $i < $length; $i++) { $padID .= $chars[rand() % strlen($chars)]; } return $padID; }
[ "public", "function", "generatePadID", "(", ")", ":", "string", "{", "$", "chars", "=", "\"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\"", ";", "$", "length", "=", "16", ";", "$", "padID", "=", "\"\"", ";", "for", "(", "$", "i", "=", "0", ...
Generates a random padID @return string
[ "Generates", "a", "random", "padID" ]
30dd5b3fb21af88ea59aff18b3abb7c150ae7218
https://github.com/0x46616c6b/etherpad-lite-client/blob/30dd5b3fb21af88ea59aff18b3abb7c150ae7218/src/EtherpadLite/Client.php#L100-L111
30,129
magroski/frogg
src/Sms/Twilio.php
Twilio.send
public function send(array $data) { $text = self::sanitizeText($data['text']); $to = preg_replace("/[(,),\-,\s]/", "", $data['to']); $from = preg_replace("/[(,),\-,\s]/", "", $data['from']); $this->client->messages->create($to, ['from' => $from, 'body' => $text]); return ...
php
public function send(array $data) { $text = self::sanitizeText($data['text']); $to = preg_replace("/[(,),\-,\s]/", "", $data['to']); $from = preg_replace("/[(,),\-,\s]/", "", $data['from']); $this->client->messages->create($to, ['from' => $from, 'body' => $text]); return ...
[ "public", "function", "send", "(", "array", "$", "data", ")", "{", "$", "text", "=", "self", "::", "sanitizeText", "(", "$", "data", "[", "'text'", "]", ")", ";", "$", "to", "=", "preg_replace", "(", "\"/[(,),\\-,\\s]/\"", ",", "\"\"", ",", "$", "dat...
Send a sms using Twilio Rest API @param array $data ['text', 'to', 'from'] Key-value array * 'text' - message that will be sent * 'to' - number without country code, * 'from' - number that will send the message, @return bool
[ "Send", "a", "sms", "using", "Twilio", "Rest", "API" ]
669da2ed337e3a8477c5c99cfcf76503fd58b540
https://github.com/magroski/frogg/blob/669da2ed337e3a8477c5c99cfcf76503fd58b540/src/Sms/Twilio.php#L33-L42
30,130
magroski/frogg
src/TextParser.php
TextParser.maxLengthByWords
static function maxLengthByWords($str, $len = 50) { $str = self::removeHTMLSpecialChars($str); $cut = "\x1\x2\x3"; $str = strip_tags($str); list($str) = explode($cut, wordwrap($str, $len, $cut)); return $str; }
php
static function maxLengthByWords($str, $len = 50) { $str = self::removeHTMLSpecialChars($str); $cut = "\x1\x2\x3"; $str = strip_tags($str); list($str) = explode($cut, wordwrap($str, $len, $cut)); return $str; }
[ "static", "function", "maxLengthByWords", "(", "$", "str", ",", "$", "len", "=", "50", ")", "{", "$", "str", "=", "self", "::", "removeHTMLSpecialChars", "(", "$", "str", ")", ";", "$", "cut", "=", "\"\\x1\\x2\\x3\"", ";", "$", "str", "=", "strip_tags"...
This function is used to set the max length of a string without cutting the words @param string $str The string you want to shorten @param int $len the string maximum length @return null|string|string[]
[ "This", "function", "is", "used", "to", "set", "the", "max", "length", "of", "a", "string", "without", "cutting", "the", "words" ]
669da2ed337e3a8477c5c99cfcf76503fd58b540
https://github.com/magroski/frogg/blob/669da2ed337e3a8477c5c99cfcf76503fd58b540/src/TextParser.php#L16-L24
30,131
magroski/frogg
src/S3/Image.php
Image.getFromInput
public function getFromInput($name = false) { if ($name) { $this->img = $_FILES[$name]; $this->handle = new Upload($this->img); $this->_new_name = $this->s3->sanitizeFilename(uniqid("", true) . $this->handle->file_src_name); } }
php
public function getFromInput($name = false) { if ($name) { $this->img = $_FILES[$name]; $this->handle = new Upload($this->img); $this->_new_name = $this->s3->sanitizeFilename(uniqid("", true) . $this->handle->file_src_name); } }
[ "public", "function", "getFromInput", "(", "$", "name", "=", "false", ")", "{", "if", "(", "$", "name", ")", "{", "$", "this", "->", "img", "=", "$", "_FILES", "[", "$", "name", "]", ";", "$", "this", "->", "handle", "=", "new", "Upload", "(", ...
Load an image from a form file input @param bool $name File input name attribute @return void -
[ "Load", "an", "image", "from", "a", "form", "file", "input" ]
669da2ed337e3a8477c5c99cfcf76503fd58b540
https://github.com/magroski/frogg/blob/669da2ed337e3a8477c5c99cfcf76503fd58b540/src/S3/Image.php#L41-L48
30,132
magroski/frogg
src/S3/Image.php
Image.getFromPath
public function getFromPath($name = false, $path = false) { if ($path && $name) { $this->img = $path . '/' . $name; $this->handle = new Upload($this->img); $this->_new_name = $this->s3->sanitizeFilename(uniqid("", true) . $this->handle->file_src_name); } ...
php
public function getFromPath($name = false, $path = false) { if ($path && $name) { $this->img = $path . '/' . $name; $this->handle = new Upload($this->img); $this->_new_name = $this->s3->sanitizeFilename(uniqid("", true) . $this->handle->file_src_name); } ...
[ "public", "function", "getFromPath", "(", "$", "name", "=", "false", ",", "$", "path", "=", "false", ")", "{", "if", "(", "$", "path", "&&", "$", "name", ")", "{", "$", "this", "->", "img", "=", "$", "path", ".", "'/'", ".", "$", "name", ";", ...
Load an image from a system path @param bool $name File name @param bool $path File path @return void -
[ "Load", "an", "image", "from", "a", "system", "path" ]
669da2ed337e3a8477c5c99cfcf76503fd58b540
https://github.com/magroski/frogg/blob/669da2ed337e3a8477c5c99cfcf76503fd58b540/src/S3/Image.php#L58-L65
30,133
magroski/frogg
src/S3/Image.php
Image.getFromURL
public function getFromURL($url, $name = false) { $tmp_path = sys_get_temp_dir() . '/'; if (Validator::validate(Validator::V_LINK, $url)) { $image = getimagesize($url); switch ($image['mime']) { case 'image/gif': case 'image/png': ...
php
public function getFromURL($url, $name = false) { $tmp_path = sys_get_temp_dir() . '/'; if (Validator::validate(Validator::V_LINK, $url)) { $image = getimagesize($url); switch ($image['mime']) { case 'image/gif': case 'image/png': ...
[ "public", "function", "getFromURL", "(", "$", "url", ",", "$", "name", "=", "false", ")", "{", "$", "tmp_path", "=", "sys_get_temp_dir", "(", ")", ".", "'/'", ";", "if", "(", "Validator", "::", "validate", "(", "Validator", "::", "V_LINK", ",", "$", ...
Load an image from a given url @param string $url File url @param bool $name Optional name of the destiny file @return bool
[ "Load", "an", "image", "from", "a", "given", "url" ]
669da2ed337e3a8477c5c99cfcf76503fd58b540
https://github.com/magroski/frogg/blob/669da2ed337e3a8477c5c99cfcf76503fd58b540/src/S3/Image.php#L75-L117
30,134
magroski/frogg
src/S3/Image.php
Image.save
public function save($path = 'i') { $tmp_path = sys_get_temp_dir() . '/'; $this->handle->process($tmp_path); $this->s3->sendFile($tmp_path . $this->handle->file_dst_name, $path, $this->_new_name); unlink($tmp_path . $this->handle->file_dst_name); return $this->_new_name; ...
php
public function save($path = 'i') { $tmp_path = sys_get_temp_dir() . '/'; $this->handle->process($tmp_path); $this->s3->sendFile($tmp_path . $this->handle->file_dst_name, $path, $this->_new_name); unlink($tmp_path . $this->handle->file_dst_name); return $this->_new_name; ...
[ "public", "function", "save", "(", "$", "path", "=", "'i'", ")", "{", "$", "tmp_path", "=", "sys_get_temp_dir", "(", ")", ".", "'/'", ";", "$", "this", "->", "handle", "->", "process", "(", "$", "tmp_path", ")", ";", "$", "this", "->", "s3", "->", ...
Save the current image on the desired path @param string $path File system path to save the image to
[ "Save", "the", "current", "image", "on", "the", "desired", "path" ]
669da2ed337e3a8477c5c99cfcf76503fd58b540
https://github.com/magroski/frogg/blob/669da2ed337e3a8477c5c99cfcf76503fd58b540/src/S3/Image.php#L205-L214
30,135
magroski/frogg
src/S3/Image.php
Image.saveFixedWidth
public function saveFixedWidth($width, $path = 'i') { $this->handle->image_resize = true; $this->handle->image_ratio_y = true; $this->handle->image_x = $width; $tmp_path = sys_get_temp_dir() . '/'; $this->handle->process($tmp_path); $this->s3->sendFile($tmp_p...
php
public function saveFixedWidth($width, $path = 'i') { $this->handle->image_resize = true; $this->handle->image_ratio_y = true; $this->handle->image_x = $width; $tmp_path = sys_get_temp_dir() . '/'; $this->handle->process($tmp_path); $this->s3->sendFile($tmp_p...
[ "public", "function", "saveFixedWidth", "(", "$", "width", ",", "$", "path", "=", "'i'", ")", "{", "$", "this", "->", "handle", "->", "image_resize", "=", "true", ";", "$", "this", "->", "handle", "->", "image_ratio_y", "=", "true", ";", "$", "this", ...
Save the current image with fixed width @param string $width the width of the new image @param string $path File system path to save the image to
[ "Save", "the", "current", "image", "with", "fixed", "width" ]
669da2ed337e3a8477c5c99cfcf76503fd58b540
https://github.com/magroski/frogg/blob/669da2ed337e3a8477c5c99cfcf76503fd58b540/src/S3/Image.php#L222-L235
30,136
magroski/frogg
src/S3/Image.php
Image.saveFixedHeight
public function saveFixedHeight($height, $path = 'i') { $this->handle->image_resize = true; $this->handle->image_ratio_x = true; $this->handle->image_y = $height; $tmp_path = sys_get_temp_dir() . '/'; $this->handle->process($tmp_path); $this->s3->sendFile($tm...
php
public function saveFixedHeight($height, $path = 'i') { $this->handle->image_resize = true; $this->handle->image_ratio_x = true; $this->handle->image_y = $height; $tmp_path = sys_get_temp_dir() . '/'; $this->handle->process($tmp_path); $this->s3->sendFile($tm...
[ "public", "function", "saveFixedHeight", "(", "$", "height", ",", "$", "path", "=", "'i'", ")", "{", "$", "this", "->", "handle", "->", "image_resize", "=", "true", ";", "$", "this", "->", "handle", "->", "image_ratio_x", "=", "true", ";", "$", "this",...
Save the current image with fixed height @param string $height the height of the new image @param string $path File system path to save the image to
[ "Save", "the", "current", "image", "with", "fixed", "height" ]
669da2ed337e3a8477c5c99cfcf76503fd58b540
https://github.com/magroski/frogg/blob/669da2ed337e3a8477c5c99cfcf76503fd58b540/src/S3/Image.php#L243-L256
30,137
magroski/frogg
src/S3/Image.php
Image.saveMaxWidthHeight
public function saveMaxWidthHeight($width, $height = 20000, $path = 'i') { $this->handle->image_resize = true; $this->handle->image_ratio = true; $this->handle->image_x = $width; $this->handle->image_y = $height; $tmp_path = sys_get_temp_dir() . '/'; $this...
php
public function saveMaxWidthHeight($width, $height = 20000, $path = 'i') { $this->handle->image_resize = true; $this->handle->image_ratio = true; $this->handle->image_x = $width; $this->handle->image_y = $height; $tmp_path = sys_get_temp_dir() . '/'; $this...
[ "public", "function", "saveMaxWidthHeight", "(", "$", "width", ",", "$", "height", "=", "20000", ",", "$", "path", "=", "'i'", ")", "{", "$", "this", "->", "handle", "->", "image_resize", "=", "true", ";", "$", "this", "->", "handle", "->", "image_rati...
Save the current image with max width and height keeping ratio @param int $width max width of the image @param int $height max height of the image @param string $path File system path to save the image to
[ "Save", "the", "current", "image", "with", "max", "width", "and", "height", "keeping", "ratio" ]
669da2ed337e3a8477c5c99cfcf76503fd58b540
https://github.com/magroski/frogg/blob/669da2ed337e3a8477c5c99cfcf76503fd58b540/src/S3/Image.php#L265-L279
30,138
magroski/frogg
src/S3/Image.php
Image.isImage
public static function isImage($name) { if (isset($_FILES[$name])) { $tempFile = $_FILES[$name]['tmp_name']; if (!empty($tempFile) && file_exists($tempFile)) { $image = getimagesize($tempFile); switch ($image['mime']) { case 'image/...
php
public static function isImage($name) { if (isset($_FILES[$name])) { $tempFile = $_FILES[$name]['tmp_name']; if (!empty($tempFile) && file_exists($tempFile)) { $image = getimagesize($tempFile); switch ($image['mime']) { case 'image/...
[ "public", "static", "function", "isImage", "(", "$", "name", ")", "{", "if", "(", "isset", "(", "$", "_FILES", "[", "$", "name", "]", ")", ")", "{", "$", "tempFile", "=", "$", "_FILES", "[", "$", "name", "]", "[", "'tmp_name'", "]", ";", "if", ...
Checks whether a file is an image @param string $name Name of the $_FILES[] field to be checked @return bool
[ "Checks", "whether", "a", "file", "is", "an", "image" ]
669da2ed337e3a8477c5c99cfcf76503fd58b540
https://github.com/magroski/frogg/blob/669da2ed337e3a8477c5c99cfcf76503fd58b540/src/S3/Image.php#L310-L340
30,139
magroski/frogg
src/S3/Image.php
Image.getImageSize
public static function getImageSize($name) { if (isset($_FILES[$name])) { $tempFile = $_FILES[$name]['tmp_name']; if (!empty($tempFile) && file_exists($tempFile)) { $size = getimagesize($tempFile); return $size; } } return...
php
public static function getImageSize($name) { if (isset($_FILES[$name])) { $tempFile = $_FILES[$name]['tmp_name']; if (!empty($tempFile) && file_exists($tempFile)) { $size = getimagesize($tempFile); return $size; } } return...
[ "public", "static", "function", "getImageSize", "(", "$", "name", ")", "{", "if", "(", "isset", "(", "$", "_FILES", "[", "$", "name", "]", ")", ")", "{", "$", "tempFile", "=", "$", "_FILES", "[", "$", "name", "]", "[", "'tmp_name'", "]", ";", "if...
Returns the image width ans height @param string $name Name of the $_FILES[] field to be checked @return array|bool
[ "Returns", "the", "image", "width", "ans", "height" ]
669da2ed337e3a8477c5c99cfcf76503fd58b540
https://github.com/magroski/frogg/blob/669da2ed337e3a8477c5c99cfcf76503fd58b540/src/S3/Image.php#L349-L361
30,140
magroski/frogg
src/CurlInterface.php
CurlInterface.deleteReq
public function deleteReq(string $url, $data = [], $dataQuery = []) { $query = http_build_query($dataQuery); $params = implode('/', $data); $ch = curl_init($url . $params . '?' . $query); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE"); curl_setopt($ch, CURLOPT_RETURNT...
php
public function deleteReq(string $url, $data = [], $dataQuery = []) { $query = http_build_query($dataQuery); $params = implode('/', $data); $ch = curl_init($url . $params . '?' . $query); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE"); curl_setopt($ch, CURLOPT_RETURNT...
[ "public", "function", "deleteReq", "(", "string", "$", "url", ",", "$", "data", "=", "[", "]", ",", "$", "dataQuery", "=", "[", "]", ")", "{", "$", "query", "=", "http_build_query", "(", "$", "dataQuery", ")", ";", "$", "params", "=", "implode", "(...
Send a DELETE request with its data as PARAMS @param string $url Url to call @param array $data Simple array with params to be passed @param array $dataQuery Key-value array to be json_encoded @return string request result
[ "Send", "a", "DELETE", "request", "with", "its", "data", "as", "PARAMS" ]
669da2ed337e3a8477c5c99cfcf76503fd58b540
https://github.com/magroski/frogg/blob/669da2ed337e3a8477c5c99cfcf76503fd58b540/src/CurlInterface.php#L153-L173
30,141
magroski/frogg
src/CurlInterface.php
CurlInterface.putReq
public function putReq(string $url, $data = [], $dataQuery = []) { $query = http_build_query($dataQuery); $ch = curl_init($url . '?' . $query); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT"); curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data)); curl_setopt($ch, CURLOP...
php
public function putReq(string $url, $data = [], $dataQuery = []) { $query = http_build_query($dataQuery); $ch = curl_init($url . '?' . $query); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT"); curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data)); curl_setopt($ch, CURLOP...
[ "public", "function", "putReq", "(", "string", "$", "url", ",", "$", "data", "=", "[", "]", ",", "$", "dataQuery", "=", "[", "]", ")", "{", "$", "query", "=", "http_build_query", "(", "$", "dataQuery", ")", ";", "$", "ch", "=", "curl_init", "(", ...
Send a PUT request with its data as PARAMS @param string $url Url to call @param array $data Key-value array with params @param array $dataQuery Key-value array to be json_encoded @return string request result
[ "Send", "a", "PUT", "request", "with", "its", "data", "as", "PARAMS" ]
669da2ed337e3a8477c5c99cfcf76503fd58b540
https://github.com/magroski/frogg/blob/669da2ed337e3a8477c5c99cfcf76503fd58b540/src/CurlInterface.php#L184-L205
30,142
0x46616c6b/etherpad-lite-client
src/EtherpadLite/Response.php
Response.getData
public function getData($key = null, $defaultValue = null) { $data = $this->getPropertyFromData('data'); if (null !== $key) { return isset($data[$key]) ? $data[$key] : $defaultValue; } return $data; }
php
public function getData($key = null, $defaultValue = null) { $data = $this->getPropertyFromData('data'); if (null !== $key) { return isset($data[$key]) ? $data[$key] : $defaultValue; } return $data; }
[ "public", "function", "getData", "(", "$", "key", "=", "null", ",", "$", "defaultValue", "=", "null", ")", "{", "$", "data", "=", "$", "this", "->", "getPropertyFromData", "(", "'data'", ")", ";", "if", "(", "null", "!==", "$", "key", ")", "{", "re...
Get Response Data Array. By default the whole array will be returned. In order to retrieve just a key based response, provide an array Key. ```php $response = (new Client())->createAuthorIfNotExistsFor(1, 'John Doe'); $authorId = $response->getData('authorID'); ``` @param string $key Access a given key from the data...
[ "Get", "Response", "Data", "Array", "." ]
30dd5b3fb21af88ea59aff18b3abb7c150ae7218
https://github.com/0x46616c6b/etherpad-lite-client/blob/30dd5b3fb21af88ea59aff18b3abb7c150ae7218/src/EtherpadLite/Response.php#L60-L69
30,143
Bacon/BaconStringUtils
src/BaconStringUtils/UniDecoder.php
UniDecoder.decode
public function decode($string) { $return = ''; foreach (preg_split('()u', $string, -1, PREG_SPLIT_NO_EMPTY) as $char) { $codepoint = $this->uniOrd($char); if ($codepoint < 0x80) { // Basic ASCII $return .= chr($codepoint); co...
php
public function decode($string) { $return = ''; foreach (preg_split('()u', $string, -1, PREG_SPLIT_NO_EMPTY) as $char) { $codepoint = $this->uniOrd($char); if ($codepoint < 0x80) { // Basic ASCII $return .= chr($codepoint); co...
[ "public", "function", "decode", "(", "$", "string", ")", "{", "$", "return", "=", "''", ";", "foreach", "(", "preg_split", "(", "'()u'", ",", "$", "string", ",", "-", "1", ",", "PREG_SPLIT_NO_EMPTY", ")", "as", "$", "char", ")", "{", "$", "codepoint"...
Decodes an UTF-8 encoded unicode string to ASCII. @param string $string @return string
[ "Decodes", "an", "UTF", "-", "8", "encoded", "unicode", "string", "to", "ASCII", "." ]
3d7818aca25190149a9a2415a0928d4964d6007e
https://github.com/Bacon/BaconStringUtils/blob/3d7818aca25190149a9a2415a0928d4964d6007e/src/BaconStringUtils/UniDecoder.php#L32-L63
30,144
Bacon/BaconStringUtils
src/BaconStringUtils/UniDecoder.php
UniDecoder.uniOrd
protected function uniOrd($char) { $h = ord($char[0]); if ($h <= 0x7f) { return $h; } elseif ($h < 0xc2) { return null; } elseif ($h <= 0xdf) { return ($h & 0x1f) << 6 | (ord($char[1]) & 0x3f); } elseif ($h <= 0xef) { return ($...
php
protected function uniOrd($char) { $h = ord($char[0]); if ($h <= 0x7f) { return $h; } elseif ($h < 0xc2) { return null; } elseif ($h <= 0xdf) { return ($h & 0x1f) << 6 | (ord($char[1]) & 0x3f); } elseif ($h <= 0xef) { return ($...
[ "protected", "function", "uniOrd", "(", "$", "char", ")", "{", "$", "h", "=", "ord", "(", "$", "char", "[", "0", "]", ")", ";", "if", "(", "$", "h", "<=", "0x7f", ")", "{", "return", "$", "h", ";", "}", "elseif", "(", "$", "h", "<", "0xc2",...
Gets unicode codepoint from character. @param string $char @return integer
[ "Gets", "unicode", "codepoint", "from", "character", "." ]
3d7818aca25190149a9a2415a0928d4964d6007e
https://github.com/Bacon/BaconStringUtils/blob/3d7818aca25190149a9a2415a0928d4964d6007e/src/BaconStringUtils/UniDecoder.php#L71-L91
30,145
magroski/frogg
src/Services/Google/DistanceMatrixAPI.php
DistanceMatrixAPI.calculateDistanceMatrix
public function calculateDistanceMatrix(array $origins, array $destinations) : DistanceMatrixResponse { $formattedOrigins = $this->formatEntities($origins); $formattedDestinations = $this->formatEntities($destinations); $query = http_build_query([ 'origins' => $formatt...
php
public function calculateDistanceMatrix(array $origins, array $destinations) : DistanceMatrixResponse { $formattedOrigins = $this->formatEntities($origins); $formattedDestinations = $this->formatEntities($destinations); $query = http_build_query([ 'origins' => $formatt...
[ "public", "function", "calculateDistanceMatrix", "(", "array", "$", "origins", ",", "array", "$", "destinations", ")", ":", "DistanceMatrixResponse", "{", "$", "formattedOrigins", "=", "$", "this", "->", "formatEntities", "(", "$", "origins", ")", ";", "$", "f...
Calculates the distance between multiple origins and destinations @param DistanceMatrixLocation[] $origins @param DistanceMatrixLocation[] $destinations As Google always return the distance value in meters (not km), the function multiplies the result by 0.62 (km:mile) to calculate an approximation in imperial. Obs: B...
[ "Calculates", "the", "distance", "between", "multiple", "origins", "and", "destinations" ]
669da2ed337e3a8477c5c99cfcf76503fd58b540
https://github.com/magroski/frogg/blob/669da2ed337e3a8477c5c99cfcf76503fd58b540/src/Services/Google/DistanceMatrixAPI.php#L37-L69
30,146
SIELOnline/libAcumulus
src/WooCommerce/WooCommerce2/Invoice/Creator.php
Creator.getSourceMeta
public function getSourceMeta($property) { $value = get_post_meta($this->invoiceSource->getId(), $property, true); // get_post_meta() can return false or ''. if (empty($value)) { // Not found: indicate so by returning null. $value = null; } return $val...
php
public function getSourceMeta($property) { $value = get_post_meta($this->invoiceSource->getId(), $property, true); // get_post_meta() can return false or ''. if (empty($value)) { // Not found: indicate so by returning null. $value = null; } return $val...
[ "public", "function", "getSourceMeta", "(", "$", "property", ")", "{", "$", "value", "=", "get_post_meta", "(", "$", "this", "->", "invoiceSource", "->", "getId", "(", ")", ",", "$", "property", ",", "true", ")", ";", "// get_post_meta() can return false or ''...
Token callback to access the post meta when resolving tokens. @param string $property @return null|string The value for the meta data with the given name, null if not available.
[ "Token", "callback", "to", "access", "the", "post", "meta", "when", "resolving", "tokens", "." ]
82f8d6c9c4929c41948c97d6cfdfac3f27c37255
https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/WooCommerce/WooCommerce2/Invoice/Creator.php#L50-L59
30,147
SIELOnline/libAcumulus
src/WooCommerce/WooCommerce2/Invoice/Creator.php
Creator.getOrderMeta
public function getOrderMeta($property) { /** @var \WC_Order $order */ $order = $this->invoiceSource->getOrder()->getSource(); $value = get_post_meta( $order->id, $property, true); // get_post_meta() can return false or ''. if (empty($value)) { // Not found: indicate so b...
php
public function getOrderMeta($property) { /** @var \WC_Order $order */ $order = $this->invoiceSource->getOrder()->getSource(); $value = get_post_meta( $order->id, $property, true); // get_post_meta() can return false or ''. if (empty($value)) { // Not found: indicate so b...
[ "public", "function", "getOrderMeta", "(", "$", "property", ")", "{", "/** @var \\WC_Order $order */", "$", "order", "=", "$", "this", "->", "invoiceSource", "->", "getOrder", "(", ")", "->", "getSource", "(", ")", ";", "$", "value", "=", "get_post_meta", "(...
Token callback to access the order post meta when resolving tokens. @param string $property @return null|string The value for the meta data with the given name, null if not available.
[ "Token", "callback", "to", "access", "the", "order", "post", "meta", "when", "resolving", "tokens", "." ]
82f8d6c9c4929c41948c97d6cfdfac3f27c37255
https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/WooCommerce/WooCommerce2/Invoice/Creator.php#L69-L80
30,148
SIELOnline/libAcumulus
src/Config/Config.php
Config.load
protected function load() { if (!$this->isConfigurationLoaded) { $this->values = $this->getDefaults(); $values = $this->getConfigStore()->load(); if (is_array($values)) { $this->values = array_merge($this->getDefaults(), $values); } ...
php
protected function load() { if (!$this->isConfigurationLoaded) { $this->values = $this->getDefaults(); $values = $this->getConfigStore()->load(); if (is_array($values)) { $this->values = array_merge($this->getDefaults(), $values); } ...
[ "protected", "function", "load", "(", ")", "{", "if", "(", "!", "$", "this", "->", "isConfigurationLoaded", ")", "{", "$", "this", "->", "values", "=", "$", "this", "->", "getDefaults", "(", ")", ";", "$", "values", "=", "$", "this", "->", "getConfig...
Loads the configuration from the actual configuration provider.
[ "Loads", "the", "configuration", "from", "the", "actual", "configuration", "provider", "." ]
82f8d6c9c4929c41948c97d6cfdfac3f27c37255
https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Config/Config.php#L100-L111
30,149
SIELOnline/libAcumulus
src/Config/Config.php
Config.save
public function save(array $values) { // Log values in a notice but without the password. $copy = $values; if (!empty($copy[Tag::Password])) { $copy[Tag::Password] = 'REMOVED FOR SECURITY'; } $this->log->notice('ConfigStore::save(): saving %s', serialize($copy)); ...
php
public function save(array $values) { // Log values in a notice but without the password. $copy = $values; if (!empty($copy[Tag::Password])) { $copy[Tag::Password] = 'REMOVED FOR SECURITY'; } $this->log->notice('ConfigStore::save(): saving %s', serialize($copy)); ...
[ "public", "function", "save", "(", "array", "$", "values", ")", "{", "// Log values in a notice but without the password.", "$", "copy", "=", "$", "values", ";", "if", "(", "!", "empty", "(", "$", "copy", "[", "Tag", "::", "Password", "]", ")", ")", "{", ...
Saves the configuration to the actual configuration provider. @param array $values A keyed array that contains the values to store, this may be a subset of the possible keys. Keys that are not present will not be changed. @return bool Success.
[ "Saves", "the", "configuration", "to", "the", "actual", "configuration", "provider", "." ]
82f8d6c9c4929c41948c97d6cfdfac3f27c37255
https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Config/Config.php#L123-L150
30,150
SIELOnline/libAcumulus
src/Config/Config.php
Config.castValues
protected function castValues(array $values) { $keyInfos = $this->getKeyInfo(); foreach ($keyInfos as $key => $keyInfo) { if (array_key_exists($key, $values)) { switch ($keyInfo['type']) { case 'string': if (!is_string($values[$...
php
protected function castValues(array $values) { $keyInfos = $this->getKeyInfo(); foreach ($keyInfos as $key => $keyInfo) { if (array_key_exists($key, $values)) { switch ($keyInfo['type']) { case 'string': if (!is_string($values[$...
[ "protected", "function", "castValues", "(", "array", "$", "values", ")", "{", "$", "keyInfos", "=", "$", "this", "->", "getKeyInfo", "(", ")", ";", "foreach", "(", "$", "keyInfos", "as", "$", "key", "=>", "$", "keyInfo", ")", "{", "if", "(", "array_k...
Casts the values to their correct types. Values that come from a submitted form are all strings. Values that come from the config store might be null. However, internally we work with booleans or integers. So after reading from the config store or form, we cast the values to their expected types. @param array $values...
[ "Casts", "the", "values", "to", "their", "correct", "types", "." ]
82f8d6c9c4929c41948c97d6cfdfac3f27c37255
https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Config/Config.php#L165-L195
30,151
SIELOnline/libAcumulus
src/Config/Config.php
Config.removeValuesNotToBeStored
protected function removeValuesNotToBeStored(array $values) { $result = array(); $keys = $this->getKeys(); $defaults = $this->getDefaults(); foreach ($keys as $key) { if (isset($values[$key]) && (!isset($defaults[$key]) || $values[$key] !== $defaults[$key])) { ...
php
protected function removeValuesNotToBeStored(array $values) { $result = array(); $keys = $this->getKeys(); $defaults = $this->getDefaults(); foreach ($keys as $key) { if (isset($values[$key]) && (!isset($defaults[$key]) || $values[$key] !== $defaults[$key])) { ...
[ "protected", "function", "removeValuesNotToBeStored", "(", "array", "$", "values", ")", "{", "$", "result", "=", "array", "(", ")", ";", "$", "keys", "=", "$", "this", "->", "getKeys", "(", ")", ";", "$", "defaults", "=", "$", "this", "->", "getDefault...
Removes configuration values that do not have to be stored. Values that do not have to be stored: - Values that are not set. - Values that equal their default value. - Keys that are unknown. @param array $values The array to remove values from. @return array The passed in set of values reduced to values that should ...
[ "Removes", "configuration", "values", "that", "do", "not", "have", "to", "be", "stored", "." ]
82f8d6c9c4929c41948c97d6cfdfac3f27c37255
https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Config/Config.php#L211-L222
30,152
SIELOnline/libAcumulus
src/Config/Config.php
Config.set
public function set($key, $value) { $this->load(); $oldValue = isset($this->values[$key]) ? $this->values[$key] : null; $this->values[$key] = $value; return $oldValue; }
php
public function set($key, $value) { $this->load(); $oldValue = isset($this->values[$key]) ? $this->values[$key] : null; $this->values[$key] = $value; return $oldValue; }
[ "public", "function", "set", "(", "$", "key", ",", "$", "value", ")", "{", "$", "this", "->", "load", "(", ")", ";", "$", "oldValue", "=", "isset", "(", "$", "this", "->", "values", "[", "$", "key", "]", ")", "?", "$", "this", "->", "values", ...
Sets the internal value of the specified configuration key. This value will not be stored, use save() for that. @param string $key The configuration value to set. @param mixed $value The new value for the configuration key. @return mixed The old value.
[ "Sets", "the", "internal", "value", "of", "the", "specified", "configuration", "key", "." ]
82f8d6c9c4929c41948c97d6cfdfac3f27c37255
https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Config/Config.php#L254-L260
30,153
SIELOnline/libAcumulus
src/Config/Config.php
Config.getCredentials
public function getCredentials() { $result = $this->getSettingsByGroup('credentials'); // No separate key for now. $result[Tag::EmailOnWarning] = $result[Tag::EmailOnError]; return $result; }
php
public function getCredentials() { $result = $this->getSettingsByGroup('credentials'); // No separate key for now. $result[Tag::EmailOnWarning] = $result[Tag::EmailOnError]; return $result; }
[ "public", "function", "getCredentials", "(", ")", "{", "$", "result", "=", "$", "this", "->", "getSettingsByGroup", "(", "'credentials'", ")", ";", "// No separate key for now.", "$", "result", "[", "Tag", "::", "EmailOnWarning", "]", "=", "$", "result", "[", ...
Returns the contract credentials to authenticate with the Acumulus API. @return array A keyed array with the keys: - contractcode - username - password - emailonerror - emailonwarning
[ "Returns", "the", "contract", "credentials", "to", "authenticate", "with", "the", "Acumulus", "API", "." ]
82f8d6c9c4929c41948c97d6cfdfac3f27c37255
https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Config/Config.php#L295-L301
30,154
SIELOnline/libAcumulus
src/Config/Config.php
Config.getSettingsByGroup
protected function getSettingsByGroup($group) { $result = array(); foreach ($this->getKeyInfo() as $key => $keyInfo) { if ($keyInfo['group'] === $group) { $result[$key] = $this->get($key); } } return $result; }
php
protected function getSettingsByGroup($group) { $result = array(); foreach ($this->getKeyInfo() as $key => $keyInfo) { if ($keyInfo['group'] === $group) { $result[$key] = $this->get($key); } } return $result; }
[ "protected", "function", "getSettingsByGroup", "(", "$", "group", ")", "{", "$", "result", "=", "array", "(", ")", ";", "foreach", "(", "$", "this", "->", "getKeyInfo", "(", ")", "as", "$", "key", "=>", "$", "keyInfo", ")", "{", "if", "(", "$", "ke...
Get all settings belonging to the same group. @param string $group @return array An array of settings.
[ "Get", "all", "settings", "belonging", "to", "the", "same", "group", "." ]
82f8d6c9c4929c41948c97d6cfdfac3f27c37255
https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Config/Config.php#L433-L442
30,155
SIELOnline/libAcumulus
src/Config/Config.php
Config.getKeys
public function getKeys() { $result = $this->getKeyInfo(); array_filter($result, function ($item) { return $item['group'] !== 'environment'; }); return array_keys($result); }
php
public function getKeys() { $result = $this->getKeyInfo(); array_filter($result, function ($item) { return $item['group'] !== 'environment'; }); return array_keys($result); }
[ "public", "function", "getKeys", "(", ")", "{", "$", "result", "=", "$", "this", "->", "getKeyInfo", "(", ")", ";", "array_filter", "(", "$", "result", ",", "function", "(", "$", "item", ")", "{", "return", "$", "item", "[", "'group'", "]", "!==", ...
Returns a list of keys that are stored in the shop specific config store. @return array
[ "Returns", "a", "list", "of", "keys", "that", "are", "stored", "in", "the", "shop", "specific", "config", "store", "." ]
82f8d6c9c4929c41948c97d6cfdfac3f27c37255
https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Config/Config.php#L449-L456
30,156
SIELOnline/libAcumulus
src/Config/Config.php
Config.getConfigDefaults
protected function getConfigDefaults() { $result = $this->getKeyInfo(); $result = array_map(function ($item) { return $item['default']; }, $result); return $result; }
php
protected function getConfigDefaults() { $result = $this->getKeyInfo(); $result = array_map(function ($item) { return $item['default']; }, $result); return $result; }
[ "protected", "function", "getConfigDefaults", "(", ")", "{", "$", "result", "=", "$", "this", "->", "getKeyInfo", "(", ")", ";", "$", "result", "=", "array_map", "(", "function", "(", "$", "item", ")", "{", "return", "$", "item", "[", "'default'", "]",...
Returns a set of default values for the various config settings. Not to be used in isolation, use geDefaults() instead. @return array
[ "Returns", "a", "set", "of", "default", "values", "for", "the", "various", "config", "settings", "." ]
82f8d6c9c4929c41948c97d6cfdfac3f27c37255
https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Config/Config.php#L475-L482
30,157
SIELOnline/libAcumulus
src/Config/Config.php
Config.getHostName
protected function getHostName() { if (!empty($_SERVER['REQUEST_URI'])) { $hostName = parse_url($_SERVER['REQUEST_URI'], PHP_URL_HOST); } if (!empty($hostName)) { if ($pos = strpos($hostName, 'www.') !== false) { $hostName = substr($hostName, $pos + st...
php
protected function getHostName() { if (!empty($_SERVER['REQUEST_URI'])) { $hostName = parse_url($_SERVER['REQUEST_URI'], PHP_URL_HOST); } if (!empty($hostName)) { if ($pos = strpos($hostName, 'www.') !== false) { $hostName = substr($hostName, $pos + st...
[ "protected", "function", "getHostName", "(", ")", "{", "if", "(", "!", "empty", "(", "$", "_SERVER", "[", "'REQUEST_URI'", "]", ")", ")", "{", "$", "hostName", "=", "parse_url", "(", "$", "_SERVER", "[", "'REQUEST_URI'", "]", ",", "PHP_URL_HOST", ")", ...
Returns the hostname of the current request. The hostname is returned without www. so it can be used as domain name in constructing e-mail addresses. @return string The hostname of the current request.
[ "Returns", "the", "hostname", "of", "the", "current", "request", "." ]
82f8d6c9c4929c41948c97d6cfdfac3f27c37255
https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Config/Config.php#L505-L518
30,158
SIELOnline/libAcumulus
src/Config/Config.php
Config.upgrade
public function upgrade($currentVersion) { $result = true; if (version_compare($currentVersion, '4.5.0', '<')) { $result = $this->upgrade450(); } if (version_compare($currentVersion, '4.5.3', '<')) { $result = $this->upgrade453() && $result; } ...
php
public function upgrade($currentVersion) { $result = true; if (version_compare($currentVersion, '4.5.0', '<')) { $result = $this->upgrade450(); } if (version_compare($currentVersion, '4.5.3', '<')) { $result = $this->upgrade453() && $result; } ...
[ "public", "function", "upgrade", "(", "$", "currentVersion", ")", "{", "$", "result", "=", "true", ";", "if", "(", "version_compare", "(", "$", "currentVersion", ",", "'4.5.0'", ",", "'<'", ")", ")", "{", "$", "result", "=", "$", "this", "->", "upgrade...
Upgrade the datamodel to the given version. This method is only called when the module gets updated. @param string $currentVersion The current version of the module. @return bool Success.
[ "Upgrade", "the", "datamodel", "to", "the", "given", "version", "." ]
82f8d6c9c4929c41948c97d6cfdfac3f27c37255
https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Config/Config.php#L940-L985
30,159
SIELOnline/libAcumulus
src/Config/Config.php
Config.upgrade450
protected function upgrade450() { $result = true; // Keep track of settings that should be updated. $newSettings = array(); // 1) Log level. switch ($this->get('logLevel')) { case Log::Error: case Log::Warning: // This is often not giv...
php
protected function upgrade450() { $result = true; // Keep track of settings that should be updated. $newSettings = array(); // 1) Log level. switch ($this->get('logLevel')) { case Log::Error: case Log::Warning: // This is often not giv...
[ "protected", "function", "upgrade450", "(", ")", "{", "$", "result", "=", "true", ";", "// Keep track of settings that should be updated.", "$", "newSettings", "=", "array", "(", ")", ";", "// 1) Log level.", "switch", "(", "$", "this", "->", "get", "(", "'logLe...
4.5.0 upgrade. - Log level: added level info and set log level to notice if it currently is error or warning. - Debug mode: the values of test mode and stay local are switched. Stay local is no longer used, so both these 2 values become the new test mode. @return bool
[ "4", ".", "5", ".", "0", "upgrade", "." ]
82f8d6c9c4929c41948c97d6cfdfac3f27c37255
https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Config/Config.php#L998-L1029
30,160
SIELOnline/libAcumulus
src/Config/Config.php
Config.upgrade453
protected function upgrade453() { // Keep track of settings that should be updated. $newSettings = array(); if ($this->get('triggerInvoiceSendEvent') == 2) { $newSettings['triggerInvoiceEvent'] = PluginConfig::TriggerInvoiceEvent_Create; } else { $newSettings[...
php
protected function upgrade453() { // Keep track of settings that should be updated. $newSettings = array(); if ($this->get('triggerInvoiceSendEvent') == 2) { $newSettings['triggerInvoiceEvent'] = PluginConfig::TriggerInvoiceEvent_Create; } else { $newSettings[...
[ "protected", "function", "upgrade453", "(", ")", "{", "// Keep track of settings that should be updated.", "$", "newSettings", "=", "array", "(", ")", ";", "if", "(", "$", "this", "->", "get", "(", "'triggerInvoiceSendEvent'", ")", "==", "2", ")", "{", "$", "n...
4.5.3 upgrade. - setting triggerInvoiceSendEvent removed. - setting triggerInvoiceEvent introduced. @return bool
[ "4", ".", "5", ".", "3", "upgrade", "." ]
82f8d6c9c4929c41948c97d6cfdfac3f27c37255
https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Config/Config.php#L1039-L1050
30,161
SIELOnline/libAcumulus
src/Config/Config.php
Config.upgrade460
protected function upgrade460() { $result = true; $newSettings = array(); if ($this->get('removeEmptyShipping') !== null) { $newSettings['sendEmptyShipping'] = !$this->get('removeEmptyShipping'); } if (!empty($newSettings)) { $result = $this->save($n...
php
protected function upgrade460() { $result = true; $newSettings = array(); if ($this->get('removeEmptyShipping') !== null) { $newSettings['sendEmptyShipping'] = !$this->get('removeEmptyShipping'); } if (!empty($newSettings)) { $result = $this->save($n...
[ "protected", "function", "upgrade460", "(", ")", "{", "$", "result", "=", "true", ";", "$", "newSettings", "=", "array", "(", ")", ";", "if", "(", "$", "this", "->", "get", "(", "'removeEmptyShipping'", ")", "!==", "null", ")", "{", "$", "newSettings",...
4.6.0 upgrade. - setting removeEmptyShipping inverted. @return bool
[ "4", ".", "6", ".", "0", "upgrade", "." ]
82f8d6c9c4929c41948c97d6cfdfac3f27c37255
https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Config/Config.php#L1059-L1072
30,162
SIELOnline/libAcumulus
src/Config/Config.php
Config.upgrade470
protected function upgrade470() { $result = true; $newSettings = array(); if ($this->get('salutation') && strpos($this->get('salutation'), '[#') !== false) { $newSettings['salutation'] = str_replace('[#', '[', $this->get('salutation')); } if (!empty($newSettings...
php
protected function upgrade470() { $result = true; $newSettings = array(); if ($this->get('salutation') && strpos($this->get('salutation'), '[#') !== false) { $newSettings['salutation'] = str_replace('[#', '[', $this->get('salutation')); } if (!empty($newSettings...
[ "protected", "function", "upgrade470", "(", ")", "{", "$", "result", "=", "true", ";", "$", "newSettings", "=", "array", "(", ")", ";", "if", "(", "$", "this", "->", "get", "(", "'salutation'", ")", "&&", "strpos", "(", "$", "this", "->", "get", "(...
4.7.0 upgrade. - salutation could already use token, but with old syntax: remove # after [. @return bool
[ "4", ".", "7", ".", "0", "upgrade", "." ]
82f8d6c9c4929c41948c97d6cfdfac3f27c37255
https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Config/Config.php#L1081-L1094
30,163
SIELOnline/libAcumulus
src/Config/Config.php
Config.upgrade540
protected function upgrade540() { $result = true; // ConfigStore::save should store all settings in 1 serialized value. $configStore = $this->getConfigStore(); if (method_exists($configStore, 'loadOld')) { $values = $configStore->loadOld($this->getKeys()); $r...
php
protected function upgrade540() { $result = true; // ConfigStore::save should store all settings in 1 serialized value. $configStore = $this->getConfigStore(); if (method_exists($configStore, 'loadOld')) { $values = $configStore->loadOld($this->getKeys()); $r...
[ "protected", "function", "upgrade540", "(", ")", "{", "$", "result", "=", "true", ";", "// ConfigStore::save should store all settings in 1 serialized value.", "$", "configStore", "=", "$", "this", "->", "getConfigStore", "(", ")", ";", "if", "(", "method_exists", "...
5.4.0 upgrade. - ConfigStore->save should store all settings in 1 serialized value. @return bool
[ "5", ".", "4", ".", "0", "upgrade", "." ]
82f8d6c9c4929c41948c97d6cfdfac3f27c37255
https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Config/Config.php#L1138-L1150
30,164
SIELOnline/libAcumulus
src/Config/Config.php
Config.upgrade541
protected function upgrade541() { $result = true; $doSave = false; $configStore = $this->getConfigStore(); $values = $configStore->load(); array_walk_recursive($values, function(&$value) use (&$doSave) { if (is_string($value) && strpos($value, 'originalInvoiceSour...
php
protected function upgrade541() { $result = true; $doSave = false; $configStore = $this->getConfigStore(); $values = $configStore->load(); array_walk_recursive($values, function(&$value) use (&$doSave) { if (is_string($value) && strpos($value, 'originalInvoiceSour...
[ "protected", "function", "upgrade541", "(", ")", "{", "$", "result", "=", "true", ";", "$", "doSave", "=", "false", ";", "$", "configStore", "=", "$", "this", "->", "getConfigStore", "(", ")", ";", "$", "values", "=", "$", "configStore", "->", "load", ...
5.4.1 upgrade. - property source originalInvoiceSource renamed to order. @return bool
[ "5", ".", "4", ".", "1", "upgrade", "." ]
82f8d6c9c4929c41948c97d6cfdfac3f27c37255
https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Config/Config.php#L1159-L1176
30,165
SIELOnline/libAcumulus
src/Helpers/TranslationCollection.php
TranslationCollection.get
public function get($language) { $result = array(); if (isset($this->{$language})) { $result = $this->{$language}; } if ($language !== 'nl' && isset($this->nl)) { $result += $this->nl; } return $result; }
php
public function get($language) { $result = array(); if (isset($this->{$language})) { $result = $this->{$language}; } if ($language !== 'nl' && isset($this->nl)) { $result += $this->nl; } return $result; }
[ "public", "function", "get", "(", "$", "language", ")", "{", "$", "result", "=", "array", "(", ")", ";", "if", "(", "isset", "(", "$", "this", "->", "{", "$", "language", "}", ")", ")", "{", "$", "result", "=", "$", "this", "->", "{", "$", "l...
Returns a set of translations for the given language, completed with Dutch translations if no translation for the given language for some key was defined. @param string $language @return array A keyed array with translations.
[ "Returns", "a", "set", "of", "translations", "for", "the", "given", "language", "completed", "with", "Dutch", "translations", "if", "no", "translation", "for", "the", "given", "language", "for", "some", "key", "was", "defined", "." ]
82f8d6c9c4929c41948c97d6cfdfac3f27c37255
https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Helpers/TranslationCollection.php#L25-L35
30,166
SIELOnline/libAcumulus
src/Invoice/FlattenerInvoiceLines.php
FlattenerInvoiceLines.flattenInvoiceLines
protected function flattenInvoiceLines(array $lines) { $result = array(); foreach ($lines as $line) { $children = null; // Ignore children if we do not want to show them. // If it has children, flatten them and determine how to add them. if (array_key...
php
protected function flattenInvoiceLines(array $lines) { $result = array(); foreach ($lines as $line) { $children = null; // Ignore children if we do not want to show them. // If it has children, flatten them and determine how to add them. if (array_key...
[ "protected", "function", "flattenInvoiceLines", "(", "array", "$", "lines", ")", "{", "$", "result", "=", "array", "(", ")", ";", "foreach", "(", "$", "lines", "as", "$", "line", ")", "{", "$", "children", "=", "null", ";", "// Ignore children if we do not...
Flattens the invoice lines for variants or composed products. Invoice lines may recursively contain other invoice lines to indicate that a product has variant lines or is a composed product (if supported by the webshop). With composed or variant child lines, amounts may appear twice. This will also be corrected by th...
[ "Flattens", "the", "invoice", "lines", "for", "variants", "or", "composed", "products", "." ]
82f8d6c9c4929c41948c97d6cfdfac3f27c37255
https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Invoice/FlattenerInvoiceLines.php#L88-L127
30,167
SIELOnline/libAcumulus
src/Invoice/FlattenerInvoiceLines.php
FlattenerInvoiceLines.keepSeparateLines
protected function keepSeparateLines(array $parent, array $children) { $invoiceSettings = $this->config->getInvoiceSettings(); if (!$this->haveSameVatRate($children)) { // We MUST keep them separate to retain correct vat info. $separateLines = true; } elseif (!$invoic...
php
protected function keepSeparateLines(array $parent, array $children) { $invoiceSettings = $this->config->getInvoiceSettings(); if (!$this->haveSameVatRate($children)) { // We MUST keep them separate to retain correct vat info. $separateLines = true; } elseif (!$invoic...
[ "protected", "function", "keepSeparateLines", "(", "array", "$", "parent", ",", "array", "$", "children", ")", "{", "$", "invoiceSettings", "=", "$", "this", "->", "config", "->", "getInvoiceSettings", "(", ")", ";", "if", "(", "!", "$", "this", "->", "h...
Determines whether to keep the children on separate lines. This base implementation decides based on: - Whether all lines have the same VAT rate (different VAT rates => keep) - The settings for: * optionsShow * optionsAllOn1Line * optionsAllOnOwnLine * optionsMaxLength Override if you want other logic to decide on. ...
[ "Determines", "whether", "to", "keep", "the", "children", "on", "separate", "lines", "." ]
82f8d6c9c4929c41948c97d6cfdfac3f27c37255
https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Invoice/FlattenerInvoiceLines.php#L150-L168
30,168
SIELOnline/libAcumulus
src/Invoice/FlattenerInvoiceLines.php
FlattenerInvoiceLines.getMergedLinesText
protected function getMergedLinesText(array $parent, array $children) { $childrenTexts = array(); foreach ($children as $child) { $childrenTexts[] = $child[Tag::Product]; } $childrenText = ' (' . implode(', ', $childrenTexts) . ')'; return $parent[Tag::Product] . ...
php
protected function getMergedLinesText(array $parent, array $children) { $childrenTexts = array(); foreach ($children as $child) { $childrenTexts[] = $child[Tag::Product]; } $childrenText = ' (' . implode(', ', $childrenTexts) . ')'; return $parent[Tag::Product] . ...
[ "protected", "function", "getMergedLinesText", "(", "array", "$", "parent", ",", "array", "$", "children", ")", "{", "$", "childrenTexts", "=", "array", "(", ")", ";", "foreach", "(", "$", "children", "as", "$", "child", ")", "{", "$", "childrenTexts", "...
Returns a 'product' field for the merged lines. @param array $parent The parent invoice line. @param array[] $children The child invoice lines. @return string The concatenated product texts.
[ "Returns", "a", "product", "field", "for", "the", "merged", "lines", "." ]
82f8d6c9c4929c41948c97d6cfdfac3f27c37255
https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Invoice/FlattenerInvoiceLines.php#L181-L189
30,169
SIELOnline/libAcumulus
src/Invoice/FlattenerInvoiceLines.php
FlattenerInvoiceLines.correctInfoBetweenParentAndChildren
protected function correctInfoBetweenParentAndChildren(array &$parent, array &$children) { if (!empty($children)) { $parent[Meta::Parent] = $this->parentIndex; $parent[Meta::NumberOfChildren] = count($children); foreach ($children as &$child) { $child[Tag:...
php
protected function correctInfoBetweenParentAndChildren(array &$parent, array &$children) { if (!empty($children)) { $parent[Meta::Parent] = $this->parentIndex; $parent[Meta::NumberOfChildren] = count($children); foreach ($children as &$child) { $child[Tag:...
[ "protected", "function", "correctInfoBetweenParentAndChildren", "(", "array", "&", "$", "parent", ",", "array", "&", "$", "children", ")", "{", "if", "(", "!", "empty", "(", "$", "children", ")", ")", "{", "$", "parent", "[", "Meta", "::", "Parent", "]",...
Allows to correct or remove info between or from parent and child lines. This method is called before the child lines are added to the set of invoice lines. This base implementation performs the following actions: - Add meta data to parent and children to link them to each other. - Indent product descriptions of the ...
[ "Allows", "to", "correct", "or", "remove", "info", "between", "or", "from", "parent", "and", "child", "lines", "." ]
82f8d6c9c4929c41948c97d6cfdfac3f27c37255
https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Invoice/FlattenerInvoiceLines.php#L214-L225
30,170
SIELOnline/libAcumulus
src/Invoice/FlattenerInvoiceLines.php
FlattenerInvoiceLines.collectInfoFromChildren
protected function collectInfoFromChildren(array $parent, array $children) { $invoiceSettings = $this->config->getInvoiceSettings(); if (!$invoiceSettings['optionsShow']) { $parent[Meta::ChildrenNotShown] = count($children); } else { $parent[Tag::Product] = $this->get...
php
protected function collectInfoFromChildren(array $parent, array $children) { $invoiceSettings = $this->config->getInvoiceSettings(); if (!$invoiceSettings['optionsShow']) { $parent[Meta::ChildrenNotShown] = count($children); } else { $parent[Tag::Product] = $this->get...
[ "protected", "function", "collectInfoFromChildren", "(", "array", "$", "parent", ",", "array", "$", "children", ")", "{", "$", "invoiceSettings", "=", "$", "this", "->", "config", "->", "getInvoiceSettings", "(", ")", ";", "if", "(", "!", "$", "invoiceSettin...
Allows to collect info from the child lines and add it to the parent. This method is called before the child lines are merged into the parent invoice line. This base implementation merges the product descriptions from the child lines into the parent product description. Situations that may have to be covered by web ...
[ "Allows", "to", "collect", "info", "from", "the", "child", "lines", "and", "add", "it", "to", "the", "parent", "." ]
82f8d6c9c4929c41948c97d6cfdfac3f27c37255
https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Invoice/FlattenerInvoiceLines.php#L256-L266
30,171
SIELOnline/libAcumulus
src/Invoice/FlattenerInvoiceLines.php
FlattenerInvoiceLines.copyVatInfoToChildren
protected function copyVatInfoToChildren(array $parent, array $children) { static $vatMetaInfoTags = array( Meta::VatRateMin, Meta::VatRateMax, Meta::VatRateLookup, Meta::VatRateLookupLabel, Meta::VatRateLookupSource, Meta::VatRateLooku...
php
protected function copyVatInfoToChildren(array $parent, array $children) { static $vatMetaInfoTags = array( Meta::VatRateMin, Meta::VatRateMax, Meta::VatRateLookup, Meta::VatRateLookupLabel, Meta::VatRateLookupSource, Meta::VatRateLooku...
[ "protected", "function", "copyVatInfoToChildren", "(", "array", "$", "parent", ",", "array", "$", "children", ")", "{", "static", "$", "vatMetaInfoTags", "=", "array", "(", "Meta", "::", "VatRateMin", ",", "Meta", "::", "VatRateMax", ",", "Meta", "::", "VatR...
Copies vat info from the parent to all children. In Magento, VAT info on the children may contain a 0 vat rate. To correct this, we copy the vat information (rate, source, correction info). @param array $parent The parent invoice line. @param array[] $children The child invoice lines. @return array[] The child invoi...
[ "Copies", "vat", "info", "from", "the", "parent", "to", "all", "children", "." ]
82f8d6c9c4929c41948c97d6cfdfac3f27c37255
https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Invoice/FlattenerInvoiceLines.php#L390-L430
30,172
SIELOnline/libAcumulus
src/Invoice/FlattenerInvoiceLines.php
FlattenerInvoiceLines.copyVatInfoToParent
protected function copyVatInfoToParent(array $parent, array $children) { $parent[Meta::VatAmount] = 0; // Copy vat rate info from a child when the parent has no vat rate info. if (empty($parent[Tag::VatRate]) || Number::isZero($parent[Tag::VatRate])) { $parent[Tag::VatRate] = Com...
php
protected function copyVatInfoToParent(array $parent, array $children) { $parent[Meta::VatAmount] = 0; // Copy vat rate info from a child when the parent has no vat rate info. if (empty($parent[Tag::VatRate]) || Number::isZero($parent[Tag::VatRate])) { $parent[Tag::VatRate] = Com...
[ "protected", "function", "copyVatInfoToParent", "(", "array", "$", "parent", ",", "array", "$", "children", ")", "{", "$", "parent", "[", "Meta", "::", "VatAmount", "]", "=", "0", ";", "// Copy vat rate info from a child when the parent has no vat rate info.", "if", ...
Copies vat info to the parent. This prevents that amounts appear twice on the invoice. @param array $parent The parent invoice line. @param array[] $children The child invoice lines. @return array The parent invoice line with price info removed.
[ "Copies", "vat", "info", "to", "the", "parent", "." ]
82f8d6c9c4929c41948c97d6cfdfac3f27c37255
https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Invoice/FlattenerInvoiceLines.php#L445-L467
30,173
SIELOnline/libAcumulus
src/Invoice/FlattenerInvoiceLines.php
FlattenerInvoiceLines.removePriceInfoFromChildren
protected function removePriceInfoFromChildren(array $children) { foreach ($children as &$child) { $child[Tag::UnitPrice] = 0; $child[Meta::UnitPriceInc] = 0; unset($child[Meta::LineAmount]); unset($child[Meta::LineAmountInc]); unset($child[Meta::L...
php
protected function removePriceInfoFromChildren(array $children) { foreach ($children as &$child) { $child[Tag::UnitPrice] = 0; $child[Meta::UnitPriceInc] = 0; unset($child[Meta::LineAmount]); unset($child[Meta::LineAmountInc]); unset($child[Meta::L...
[ "protected", "function", "removePriceInfoFromChildren", "(", "array", "$", "children", ")", "{", "foreach", "(", "$", "children", "as", "&", "$", "child", ")", "{", "$", "child", "[", "Tag", "::", "UnitPrice", "]", "=", "0", ";", "$", "child", "[", "Me...
Removes price info from all children. This can prevent that amounts appear twice on the invoice. This can only be done if all children have the same vat rate as the parent, otherwise the price (and vat) info should remain on the children and be removed from the parent. @param array[] $children The child invoice lines...
[ "Removes", "price", "info", "from", "all", "children", "." ]
82f8d6c9c4929c41948c97d6cfdfac3f27c37255
https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Invoice/FlattenerInvoiceLines.php#L483-L493
30,174
SIELOnline/libAcumulus
src/Invoice/FlattenerInvoiceLines.php
FlattenerInvoiceLines.removePriceInfoFromParent
protected function removePriceInfoFromParent(array $parent) { $parent[Tag::UnitPrice] = 0; $parent[Meta::UnitPriceInc] = 0; unset($parent[Meta::LineAmount]); unset($parent[Meta::LineAmountInc]); unset($parent[Meta::LineDiscountAmountInc]); return $parent; }
php
protected function removePriceInfoFromParent(array $parent) { $parent[Tag::UnitPrice] = 0; $parent[Meta::UnitPriceInc] = 0; unset($parent[Meta::LineAmount]); unset($parent[Meta::LineAmountInc]); unset($parent[Meta::LineDiscountAmountInc]); return $parent; }
[ "protected", "function", "removePriceInfoFromParent", "(", "array", "$", "parent", ")", "{", "$", "parent", "[", "Tag", "::", "UnitPrice", "]", "=", "0", ";", "$", "parent", "[", "Meta", "::", "UnitPriceInc", "]", "=", "0", ";", "unset", "(", "$", "par...
Removes price info from the parent. This can prevent that amounts appear twice on the invoice. @param array $parent The parent invoice line. @return array The parent invoice line with price info removed.
[ "Removes", "price", "info", "from", "the", "parent", "." ]
82f8d6c9c4929c41948c97d6cfdfac3f27c37255
https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Invoice/FlattenerInvoiceLines.php#L506-L514
30,175
SIELOnline/libAcumulus
src/Invoice/FlattenerInvoiceLines.php
FlattenerInvoiceLines.getAppearingVatRates
protected function getAppearingVatRates(array $lines) { $vatRates = array(); foreach ($lines as $line) { if (isset($line[Tag::VatRate])) { $vatRate = sprintf('%.1f', $line[Tag::VatRate]); if (isset($vatRates[$vatRate])) { $vatRates[$vat...
php
protected function getAppearingVatRates(array $lines) { $vatRates = array(); foreach ($lines as $line) { if (isset($line[Tag::VatRate])) { $vatRate = sprintf('%.1f', $line[Tag::VatRate]); if (isset($vatRates[$vatRate])) { $vatRates[$vat...
[ "protected", "function", "getAppearingVatRates", "(", "array", "$", "lines", ")", "{", "$", "vatRates", "=", "array", "(", ")", ";", "foreach", "(", "$", "lines", "as", "$", "line", ")", "{", "if", "(", "isset", "(", "$", "line", "[", "Tag", "::", ...
Returns a list of vat rates that actually appear in the given lines. @param array[] $lines an array of invoice lines. @return array An array with the vat rates as key and the number of times they appear in the invoice lines as value.
[ "Returns", "a", "list", "of", "vat", "rates", "that", "actually", "appear", "in", "the", "given", "lines", "." ]
82f8d6c9c4929c41948c97d6cfdfac3f27c37255
https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Invoice/FlattenerInvoiceLines.php#L545-L559
30,176
ipunkt/rancherize
app/Services/DockerService.php
DockerService.build
public function build(string $imageName, $dockerfile = null) { if( $dockerfile === null ) $dockerfile = 'Dockerfile'; $this->requireProcess(); $process = ProcessBuilder::create([ 'docker', 'build', '-f', $dockerfile, '-t', $imageName, '.' ]) ->setTimeout(null)->getProcess(); $this->processHelper-...
php
public function build(string $imageName, $dockerfile = null) { if( $dockerfile === null ) $dockerfile = 'Dockerfile'; $this->requireProcess(); $process = ProcessBuilder::create([ 'docker', 'build', '-f', $dockerfile, '-t', $imageName, '.' ]) ->setTimeout(null)->getProcess(); $this->processHelper-...
[ "public", "function", "build", "(", "string", "$", "imageName", ",", "$", "dockerfile", "=", "null", ")", "{", "if", "(", "$", "dockerfile", "===", "null", ")", "$", "dockerfile", "=", "'Dockerfile'", ";", "$", "this", "->", "requireProcess", "(", ")", ...
Build the given image using the given dockerfile or 'Dockerfile' if none is given @param string $imageName @param string $dockerfile
[ "Build", "the", "given", "image", "using", "the", "given", "dockerfile", "or", "Dockerfile", "if", "none", "is", "given" ]
3c226da686b283e7fef961a9a79b54db53b8757b
https://github.com/ipunkt/rancherize/blob/3c226da686b283e7fef961a9a79b54db53b8757b/app/Services/DockerService.php#L25-L42
30,177
ipunkt/rancherize
app/Services/DockerService.php
DockerService.login
public function login($username, $password, $server = null) { $this->requireProcess(); $commandArguments = [ 'docker', 'login', '-u', $username, '--password-stdin' ]; if( !empty($server) ) $commandArguments[] = $server; $process = ProcessBuilder...
php
public function login($username, $password, $server = null) { $this->requireProcess(); $commandArguments = [ 'docker', 'login', '-u', $username, '--password-stdin' ]; if( !empty($server) ) $commandArguments[] = $server; $process = ProcessBuilder...
[ "public", "function", "login", "(", "$", "username", ",", "$", "password", ",", "$", "server", "=", "null", ")", "{", "$", "this", "->", "requireProcess", "(", ")", ";", "$", "commandArguments", "=", "[", "'docker'", ",", "'login'", ",", "'-u'", ",", ...
login to Dockerhub using the given username and password @param $username @param $password @param string|null $server
[ "login", "to", "Dockerhub", "using", "the", "given", "username", "and", "password" ]
3c226da686b283e7fef961a9a79b54db53b8757b
https://github.com/ipunkt/rancherize/blob/3c226da686b283e7fef961a9a79b54db53b8757b/app/Services/DockerService.php#L51-L72
30,178
ipunkt/rancherize
app/Services/DockerService.php
DockerService.push
public function push(string $imageName, string $server = null) { $this->requireProcess(); $process = ProcessBuilder::create([ 'docker', 'push', $imageName ]) ->setTimeout(null)->getProcess(); $this->processHelper->run($this->output, $process, null, null, OutputInterface::VERBOSITY_NORMAL); if($proces...
php
public function push(string $imageName, string $server = null) { $this->requireProcess(); $process = ProcessBuilder::create([ 'docker', 'push', $imageName ]) ->setTimeout(null)->getProcess(); $this->processHelper->run($this->output, $process, null, null, OutputInterface::VERBOSITY_NORMAL); if($proces...
[ "public", "function", "push", "(", "string", "$", "imageName", ",", "string", "$", "server", "=", "null", ")", "{", "$", "this", "->", "requireProcess", "(", ")", ";", "$", "process", "=", "ProcessBuilder", "::", "create", "(", "[", "'docker'", ",", "'...
Push the given image to dockerhub. You will most likely need to login before using this @param string $imageName @param string|null $server
[ "Push", "the", "given", "image", "to", "dockerhub", ".", "You", "will", "most", "likely", "need", "to", "login", "before", "using", "this" ]
3c226da686b283e7fef961a9a79b54db53b8757b
https://github.com/ipunkt/rancherize/blob/3c226da686b283e7fef961a9a79b54db53b8757b/app/Services/DockerService.php#L80-L92
30,179
ipunkt/rancherize
app/Services/DockerService.php
DockerService.buildImages
public function buildImages(string $directory, string $projectName) { $this->requireProcess(); $process = ProcessBuilder::create([ 'docker-compose', '-p', $projectName, '-f', $directory.'/docker-compose.yml', 'build' ]) ->setTimeout(null)->getProcess(); $this->processHelper->run($this->output, $process...
php
public function buildImages(string $directory, string $projectName) { $this->requireProcess(); $process = ProcessBuilder::create([ 'docker-compose', '-p', $projectName, '-f', $directory.'/docker-compose.yml', 'build' ]) ->setTimeout(null)->getProcess(); $this->processHelper->run($this->output, $process...
[ "public", "function", "buildImages", "(", "string", "$", "directory", ",", "string", "$", "projectName", ")", "{", "$", "this", "->", "requireProcess", "(", ")", ";", "$", "process", "=", "ProcessBuilder", "::", "create", "(", "[", "'docker-compose'", ",", ...
Have docker-compose perform image builds @param string $directory @param string $projectName
[ "Have", "docker", "-", "compose", "perform", "image", "builds" ]
3c226da686b283e7fef961a9a79b54db53b8757b
https://github.com/ipunkt/rancherize/blob/3c226da686b283e7fef961a9a79b54db53b8757b/app/Services/DockerService.php#L101-L113
30,180
SIELOnline/libAcumulus
src/Invoice/Result.php
Result.getSendStatusText
protected function getSendStatusText() { switch ($this->sendStatus) { case self::NotSent_WrongStatus: $message = empty($this->sendStatusArguments) ? 'reason_not_sent_triggerCreditNoteEvent_None' : 'reason_not_sent_wrongStatus'; ...
php
protected function getSendStatusText() { switch ($this->sendStatus) { case self::NotSent_WrongStatus: $message = empty($this->sendStatusArguments) ? 'reason_not_sent_triggerCreditNoteEvent_None' : 'reason_not_sent_wrongStatus'; ...
[ "protected", "function", "getSendStatusText", "(", ")", "{", "switch", "(", "$", "this", "->", "sendStatus", ")", "{", "case", "self", "::", "NotSent_WrongStatus", ":", "$", "message", "=", "empty", "(", "$", "this", "->", "sendStatusArguments", ")", "?", ...
Returns a translated string indicating the reason for the action taken. @return string
[ "Returns", "a", "translated", "string", "indicating", "the", "reason", "for", "the", "action", "taken", "." ]
82f8d6c9c4929c41948c97d6cfdfac3f27c37255
https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Invoice/Result.php#L166-L225
30,181
SIELOnline/libAcumulus
src/Invoice/Result.php
Result.getLogText
public function getLogText($addReqResp) { $action = $this->getActionText(); $reason = $this->getSendStatusText(); $message = sprintf($this->t('message_invoice_reason'), $action, $reason); if ($this->hasBeenSent() || $this->getSendStatus() === self::NotSent_LocalErrors) { ...
php
public function getLogText($addReqResp) { $action = $this->getActionText(); $reason = $this->getSendStatusText(); $message = sprintf($this->t('message_invoice_reason'), $action, $reason); if ($this->hasBeenSent() || $this->getSendStatus() === self::NotSent_LocalErrors) { ...
[ "public", "function", "getLogText", "(", "$", "addReqResp", ")", "{", "$", "action", "=", "$", "this", "->", "getActionText", "(", ")", ";", "$", "reason", "=", "$", "this", "->", "getSendStatusText", "(", ")", ";", "$", "message", "=", "sprintf", "(",...
Returns a translated sentence that can be used for logging. The returned sentence indicated what happened and why. If the invoice was sent or local errors prevented it being sent, then the returned string also includes any messages (warnings, errors, or exception). @param int $addReqResp Whether to add the raw reques...
[ "Returns", "a", "translated", "sentence", "that", "can", "be", "used", "for", "logging", "." ]
82f8d6c9c4929c41948c97d6cfdfac3f27c37255
https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Invoice/Result.php#L240-L258
30,182
SIELOnline/libAcumulus
src/OpenCart/Helpers/FormRenderer.php
FormRenderer.handleRequired
protected function handleRequired(array $field) { if (!empty($field['attributes']['required'])) { if (empty($this->elementWrapperClass)) { $this->elementWrapperClass = ''; } else { $this->elementWrapperClass .= ' '; } $this->ele...
php
protected function handleRequired(array $field) { if (!empty($field['attributes']['required'])) { if (empty($this->elementWrapperClass)) { $this->elementWrapperClass = ''; } else { $this->elementWrapperClass .= ' '; } $this->ele...
[ "protected", "function", "handleRequired", "(", "array", "$", "field", ")", "{", "if", "(", "!", "empty", "(", "$", "field", "[", "'attributes'", "]", "[", "'required'", "]", ")", ")", "{", "if", "(", "empty", "(", "$", "this", "->", "elementWrapperCla...
Handles required fields. @param array $field
[ "Handles", "required", "fields", "." ]
82f8d6c9c4929c41948c97d6cfdfac3f27c37255
https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/OpenCart/Helpers/FormRenderer.php#L57-L67
30,183
SIELOnline/libAcumulus
src/Shop/ConfigForm.php
ConfigForm.validateAccountFields
protected function validateAccountFields() { $regexpEmail = '/^[^@<>,; "\']+@([^.@ ,;]+\.)+[^.@ ,;]+$/'; if (empty($this->submittedValues[Tag::ContractCode])) { $this->errorMessages[Tag::ContractCode] = $this->t('message_validate_contractcode_0'); } elseif (!is_numeric($this->su...
php
protected function validateAccountFields() { $regexpEmail = '/^[^@<>,; "\']+@([^.@ ,;]+\.)+[^.@ ,;]+$/'; if (empty($this->submittedValues[Tag::ContractCode])) { $this->errorMessages[Tag::ContractCode] = $this->t('message_validate_contractcode_0'); } elseif (!is_numeric($this->su...
[ "protected", "function", "validateAccountFields", "(", ")", "{", "$", "regexpEmail", "=", "'/^[^@<>,; \"\\']+@([^.@ ,;]+\\.)+[^.@ ,;]+$/'", ";", "if", "(", "empty", "(", "$", "this", "->", "submittedValues", "[", "Tag", "::", "ContractCode", "]", ")", ")", "{", ...
Validates fields in the account settings fieldset.
[ "Validates", "fields", "in", "the", "account", "settings", "fieldset", "." ]
82f8d6c9c4929c41948c97d6cfdfac3f27c37255
https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Shop/ConfigForm.php#L44-L77
30,184
SIELOnline/libAcumulus
src/Shop/ConfigForm.php
ConfigForm.validateShopFields
protected function validateShopFields() { // Check if this fieldset was rendered. if (!$this->isKey('nature_shop')) { return; } // Check that required fields are filled. if (!isset($this->submittedValues['nature_shop'])) { $this->errorMessages['nature...
php
protected function validateShopFields() { // Check if this fieldset was rendered. if (!$this->isKey('nature_shop')) { return; } // Check that required fields are filled. if (!isset($this->submittedValues['nature_shop'])) { $this->errorMessages['nature...
[ "protected", "function", "validateShopFields", "(", ")", "{", "// Check if this fieldset was rendered.", "if", "(", "!", "$", "this", "->", "isKey", "(", "'nature_shop'", ")", ")", "{", "return", ";", "}", "// Check that required fields are filled.", "if", "(", "!",...
Validates fields in the shop settings fieldset.
[ "Validates", "fields", "in", "the", "shop", "settings", "fieldset", "." ]
82f8d6c9c4929c41948c97d6cfdfac3f27c37255
https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Shop/ConfigForm.php#L82-L133
30,185
SIELOnline/libAcumulus
src/Shop/ConfigForm.php
ConfigForm.getAccountFields
protected function getAccountFields() { return array( Tag::ContractCode => array( 'type' => 'text', 'label' => $this->t('field_code'), 'attributes' => array( 'required' => true, 'size' => 20, ...
php
protected function getAccountFields() { return array( Tag::ContractCode => array( 'type' => 'text', 'label' => $this->t('field_code'), 'attributes' => array( 'required' => true, 'size' => 20, ...
[ "protected", "function", "getAccountFields", "(", ")", "{", "return", "array", "(", "Tag", "::", "ContractCode", "=>", "array", "(", "'type'", "=>", "'text'", ",", "'label'", "=>", "$", "this", "->", "t", "(", "'field_code'", ")", ",", "'attributes'", "=>"...
Returns the set of account related fields. The fields returned: - contractcode - username - password - emailonerror @return array[] The set of account related fields.
[ "Returns", "the", "set", "of", "account", "related", "fields", "." ]
82f8d6c9c4929c41948c97d6cfdfac3f27c37255
https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Shop/ConfigForm.php#L237-L274
30,186
SIELOnline/libAcumulus
src/Shop/ConfigForm.php
ConfigForm.getTriggerFields
protected function getTriggerFields() { $orderStatusesList = $this->getOrderStatusesList(); $fields = array( 'triggerOrderStatus' => array( 'name' => 'triggerOrderStatus[]', 'type' => 'select', 'label' => $this->t('field_triggerOrderStatus'...
php
protected function getTriggerFields() { $orderStatusesList = $this->getOrderStatusesList(); $fields = array( 'triggerOrderStatus' => array( 'name' => 'triggerOrderStatus[]', 'type' => 'select', 'label' => $this->t('field_triggerOrderStatus'...
[ "protected", "function", "getTriggerFields", "(", ")", "{", "$", "orderStatusesList", "=", "$", "this", "->", "getOrderStatusesList", "(", ")", ";", "$", "fields", "=", "array", "(", "'triggerOrderStatus'", "=>", "array", "(", "'name'", "=>", "'triggerOrderStatu...
Returns the set of trigger related fields. The fields returned: - triggerOrderStatus - triggerInvoiceEvent @return array[] The set of trigger related fields.
[ "Returns", "the", "set", "of", "trigger", "related", "fields", "." ]
82f8d6c9c4929c41948c97d6cfdfac3f27c37255
https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Shop/ConfigForm.php#L354-L373
30,187
SIELOnline/libAcumulus
src/Shop/ConfigForm.php
ConfigForm.getPluginFields
protected function getPluginFields() { return array( 'debug' => array( 'type' => 'radio', 'label' => $this->t('field_debug'), 'description' => $this->t('desc_debug'), 'options' => array( PluginConfig::Send_SendAn...
php
protected function getPluginFields() { return array( 'debug' => array( 'type' => 'radio', 'label' => $this->t('field_debug'), 'description' => $this->t('desc_debug'), 'options' => array( PluginConfig::Send_SendAn...
[ "protected", "function", "getPluginFields", "(", ")", "{", "return", "array", "(", "'debug'", "=>", "array", "(", "'type'", "=>", "'radio'", ",", "'label'", "=>", "$", "this", "->", "t", "(", "'field_debug'", ")", ",", "'description'", "=>", "$", "this", ...
Returns the set of plugin related fields. The fields returned: - debug - logLevel - versionInformation - versionInformationDesc @return array[] The set of plugin related fields.
[ "Returns", "the", "set", "of", "plugin", "related", "fields", "." ]
82f8d6c9c4929c41948c97d6cfdfac3f27c37255
https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Shop/ConfigForm.php#L439-L469
30,188
SIELOnline/libAcumulus
src/Shop/ConfigForm.php
ConfigForm.getPaymentMethodsFieldset
protected function getPaymentMethodsFieldset(array $paymentMethods, $key, array $options) { $fieldset = array( 'type' => 'fieldset', 'legend' => $this->t("{$key}Fieldset"), 'description' => $this->t("desc_{$key}Fieldset"), 'fields' => array(), ); ...
php
protected function getPaymentMethodsFieldset(array $paymentMethods, $key, array $options) { $fieldset = array( 'type' => 'fieldset', 'legend' => $this->t("{$key}Fieldset"), 'description' => $this->t("desc_{$key}Fieldset"), 'fields' => array(), ); ...
[ "protected", "function", "getPaymentMethodsFieldset", "(", "array", "$", "paymentMethods", ",", "$", "key", ",", "array", "$", "options", ")", "{", "$", "fieldset", "=", "array", "(", "'type'", "=>", "'fieldset'", ",", "'legend'", "=>", "$", "this", "->", ...
Returns a fieldset with a select per payment method. @param array $paymentMethods Array of payment methods (id => label) @param string $key Prefix of the keys to use for the different ids. @param array $options Options for all the selects. @return array The fieldset definition.
[ "Returns", "a", "fieldset", "with", "a", "select", "per", "payment", "method", "." ]
82f8d6c9c4929c41948c97d6cfdfac3f27c37255
https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Shop/ConfigForm.php#L508-L526
30,189
SIELOnline/libAcumulus
src/Shop/ConfigForm.php
ConfigForm.getNatureOptions
protected function getNatureOptions() { return array( PluginConfig::Nature_Both => $this->t('option_nature_1'), PluginConfig::Nature_Products => $this->t('option_nature_2'), PluginConfig::Nature_Services => $this->t('option_nature_3'), ); }
php
protected function getNatureOptions() { return array( PluginConfig::Nature_Both => $this->t('option_nature_1'), PluginConfig::Nature_Products => $this->t('option_nature_2'), PluginConfig::Nature_Services => $this->t('option_nature_3'), ); }
[ "protected", "function", "getNatureOptions", "(", ")", "{", "return", "array", "(", "PluginConfig", "::", "Nature_Both", "=>", "$", "this", "->", "t", "(", "'option_nature_1'", ")", ",", "PluginConfig", "::", "Nature_Products", "=>", "$", "this", "->", "t", ...
Returns a list of options for the nature field. @return string[] An array keyed by the option values and having translated descriptions as values.
[ "Returns", "a", "list", "of", "options", "for", "the", "nature", "field", "." ]
82f8d6c9c4929c41948c97d6cfdfac3f27c37255
https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Shop/ConfigForm.php#L547-L554
30,190
SIELOnline/libAcumulus
src/Shop/ConfigForm.php
ConfigForm.getForeignVatOptions
protected function getForeignVatOptions() { return array( PluginConfig::ForeignVat_Both => $this->t('option_foreignVat_1'), PluginConfig::ForeignVat_No => $this->t('option_foreignVat_2'), PluginConfig::ForeignVat_Only => $this->t('option_foreignVat_3'), ); }
php
protected function getForeignVatOptions() { return array( PluginConfig::ForeignVat_Both => $this->t('option_foreignVat_1'), PluginConfig::ForeignVat_No => $this->t('option_foreignVat_2'), PluginConfig::ForeignVat_Only => $this->t('option_foreignVat_3'), ); }
[ "protected", "function", "getForeignVatOptions", "(", ")", "{", "return", "array", "(", "PluginConfig", "::", "ForeignVat_Both", "=>", "$", "this", "->", "t", "(", "'option_foreignVat_1'", ")", ",", "PluginConfig", "::", "ForeignVat_No", "=>", "$", "this", "->",...
Returns a list of options for the foreign vat field. @return string[] An array keyed by the option values and having translated descriptions as values.
[ "Returns", "a", "list", "of", "options", "for", "the", "foreign", "vat", "field", "." ]
82f8d6c9c4929c41948c97d6cfdfac3f27c37255
https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Shop/ConfigForm.php#L563-L570
30,191
SIELOnline/libAcumulus
src/Shop/ConfigForm.php
ConfigForm.getVatFreeProductsOptions
protected function getVatFreeProductsOptions() { return array( PluginConfig::VatFreeProducts_Both => $this->t('option_vatFreeProducts_1'), PluginConfig::VatFreeProducts_No => $this->t('option_vatFreeProducts_2'), PluginConfig::VatFreeProducts_Only => $this->t('option_vatF...
php
protected function getVatFreeProductsOptions() { return array( PluginConfig::VatFreeProducts_Both => $this->t('option_vatFreeProducts_1'), PluginConfig::VatFreeProducts_No => $this->t('option_vatFreeProducts_2'), PluginConfig::VatFreeProducts_Only => $this->t('option_vatF...
[ "protected", "function", "getVatFreeProductsOptions", "(", ")", "{", "return", "array", "(", "PluginConfig", "::", "VatFreeProducts_Both", "=>", "$", "this", "->", "t", "(", "'option_vatFreeProducts_1'", ")", ",", "PluginConfig", "::", "VatFreeProducts_No", "=>", "$...
Returns a list of options for the vat free products field. @return string[] An array keyed by the option values and having translated descriptions as values.
[ "Returns", "a", "list", "of", "options", "for", "the", "vat", "free", "products", "field", "." ]
82f8d6c9c4929c41948c97d6cfdfac3f27c37255
https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Shop/ConfigForm.php#L579-L586
30,192
SIELOnline/libAcumulus
src/Shop/ConfigForm.php
ConfigForm.getMarginProductsOptions
protected function getMarginProductsOptions() { return array( PluginConfig::MarginProducts_Both => $this->t('option_marginProducts_1'), PluginConfig::MarginProducts_No => $this->t('option_marginProducts_2'), PluginConfig::MarginProducts_Only => $this->t('option_marginProd...
php
protected function getMarginProductsOptions() { return array( PluginConfig::MarginProducts_Both => $this->t('option_marginProducts_1'), PluginConfig::MarginProducts_No => $this->t('option_marginProducts_2'), PluginConfig::MarginProducts_Only => $this->t('option_marginProd...
[ "protected", "function", "getMarginProductsOptions", "(", ")", "{", "return", "array", "(", "PluginConfig", "::", "MarginProducts_Both", "=>", "$", "this", "->", "t", "(", "'option_marginProducts_1'", ")", ",", "PluginConfig", "::", "MarginProducts_No", "=>", "$", ...
Returns a list of options for the margin products field. @return string[] An array keyed by the option values and having translated descriptions as values.
[ "Returns", "a", "list", "of", "options", "for", "the", "margin", "products", "field", "." ]
82f8d6c9c4929c41948c97d6cfdfac3f27c37255
https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Shop/ConfigForm.php#L595-L602
30,193
ems-project/EMSCommonBundle
Storage/Service/AbstractUrlStorage.php
AbstractUrlStorage.getPath
protected function getPath(string $hash, ?string $cacheContext = null, bool $confirmed = true, string $ds = '/'): string { $folderName = $this->getBaseUrl(); if (!$confirmed) { $folderName .= $ds . 'uploads'; } //isolate cached files if ($cacheContext) { ...
php
protected function getPath(string $hash, ?string $cacheContext = null, bool $confirmed = true, string $ds = '/'): string { $folderName = $this->getBaseUrl(); if (!$confirmed) { $folderName .= $ds . 'uploads'; } //isolate cached files if ($cacheContext) { ...
[ "protected", "function", "getPath", "(", "string", "$", "hash", ",", "?", "string", "$", "cacheContext", "=", "null", ",", "bool", "$", "confirmed", "=", "true", ",", "string", "$", "ds", "=", "'/'", ")", ":", "string", "{", "$", "folderName", "=", "...
returns the a file path or a resource url that can be handled by file function such as fopen
[ "returns", "the", "a", "file", "path", "or", "a", "resource", "url", "that", "can", "be", "handled", "by", "file", "function", "such", "as", "fopen" ]
994fce2f727ebf702d327ba4cfce53d3c75bcef5
https://github.com/ems-project/EMSCommonBundle/blob/994fce2f727ebf702d327ba4cfce53d3c75bcef5/Storage/Service/AbstractUrlStorage.php#L20-L44
30,194
SIELOnline/libAcumulus
src/Shop/AcumulusEntryManager.php
AcumulusEntryManager.convertDbResultToAcumulusEntries
protected function convertDbResultToAcumulusEntries($result, $ignoreLock = true) { if (empty($result)) { $result = null; } elseif (is_object($result)) { $result = $this->container->getAcumulusEntry($result); if ($ignoreLock && $result->isSendLock()) { ...
php
protected function convertDbResultToAcumulusEntries($result, $ignoreLock = true) { if (empty($result)) { $result = null; } elseif (is_object($result)) { $result = $this->container->getAcumulusEntry($result); if ($ignoreLock && $result->isSendLock()) { ...
[ "protected", "function", "convertDbResultToAcumulusEntries", "(", "$", "result", ",", "$", "ignoreLock", "=", "true", ")", "{", "if", "(", "empty", "(", "$", "result", ")", ")", "{", "$", "result", "=", "null", ";", "}", "elseif", "(", "is_object", "(", ...
Converts the results of a DB query to AcumulusEntries. @param object|array[]|object[] $result The DB query result. @param bool $ignoreLock Whether to return an entry that serves as a send lock (false) or ignore it (true) @return \Siel\Acumulus\Shop\AcumulusEntry|\Siel\Acumulus\Shop\AcumulusEntry[]|null
[ "Converts", "the", "results", "of", "a", "DB", "query", "to", "AcumulusEntries", "." ]
82f8d6c9c4929c41948c97d6cfdfac3f27c37255
https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Shop/AcumulusEntryManager.php#L78-L103
30,195
SIELOnline/libAcumulus
src/Shop/AcumulusEntryManager.php
AcumulusEntryManager.lockForSending
public function lockForSending(Source $invoiceSource) { return $this->insert($invoiceSource, AcumulusEntry::lockEntryId, AcumulusEntry::lockToken, $this->sqlNow()); }
php
public function lockForSending(Source $invoiceSource) { return $this->insert($invoiceSource, AcumulusEntry::lockEntryId, AcumulusEntry::lockToken, $this->sqlNow()); }
[ "public", "function", "lockForSending", "(", "Source", "$", "invoiceSource", ")", "{", "return", "$", "this", "->", "insert", "(", "$", "invoiceSource", ",", "AcumulusEntry", "::", "lockEntryId", ",", "AcumulusEntry", "::", "lockToken", ",", "$", "this", "->",...
Locks an invoice source for sending twice. To prevent two processes or threads to send an invoice twice, the sending process sets a lock on the invoiceSource by already creating an AcumulusEntry for it before starting to send. That record will contain some special values by which it can be recognised as a lock instead...
[ "Locks", "an", "invoice", "source", "for", "sending", "twice", "." ]
82f8d6c9c4929c41948c97d6cfdfac3f27c37255
https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Shop/AcumulusEntryManager.php#L120-L123
30,196
SIELOnline/libAcumulus
src/Shop/AcumulusEntryManager.php
AcumulusEntryManager.deleteLock
public function deleteLock(Source $invoiceSource) { $entry = $this->getByInvoiceSource($invoiceSource, false); if ($entry === null) { // - The process that had the lock may have failed sending the // invoice to Acumulus and has removed the lock (e.g. a connection ...
php
public function deleteLock(Source $invoiceSource) { $entry = $this->getByInvoiceSource($invoiceSource, false); if ($entry === null) { // - The process that had the lock may have failed sending the // invoice to Acumulus and has removed the lock (e.g. a connection ...
[ "public", "function", "deleteLock", "(", "Source", "$", "invoiceSource", ")", "{", "$", "entry", "=", "$", "this", "->", "getByInvoiceSource", "(", "$", "invoiceSource", ",", "false", ")", ";", "if", "(", "$", "entry", "===", "null", ")", "{", "// - The ...
Deletes the lock for sending on the given invoice source. @param Source $invoiceSource The invoice source to delete the lock for. @return int One of the AcumulusEntry::Lock_... constants describing the status of the lock.
[ "Deletes", "the", "lock", "for", "sending", "on", "the", "given", "invoice", "source", "." ]
82f8d6c9c4929c41948c97d6cfdfac3f27c37255
https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Shop/AcumulusEntryManager.php#L135-L153
30,197
SIELOnline/libAcumulus
src/Shop/AcumulusEntryManager.php
AcumulusEntryManager.save
public function save(Source $invoiceSource, $entryId, $token) { $now = $this->sqlNow(); $record = $this->getByInvoiceSource($invoiceSource, false); if ($record === null) { $result = $this->insert($invoiceSource, $entryId, $token, $now); } else { $result = $thi...
php
public function save(Source $invoiceSource, $entryId, $token) { $now = $this->sqlNow(); $record = $this->getByInvoiceSource($invoiceSource, false); if ($record === null) { $result = $this->insert($invoiceSource, $entryId, $token, $now); } else { $result = $thi...
[ "public", "function", "save", "(", "Source", "$", "invoiceSource", ",", "$", "entryId", ",", "$", "token", ")", "{", "$", "now", "=", "$", "this", "->", "sqlNow", "(", ")", ";", "$", "record", "=", "$", "this", "->", "getByInvoiceSource", "(", "$", ...
Saves the Acumulus entry for the given order in the web shop's database. This default implementation calls getByInvoiceSource() to determine whether to subsequently call insert() or update(). So normally, a child class should implement insert() and update() and not override this method. @param \Siel\Acumulus\Invoice...
[ "Saves", "the", "Acumulus", "entry", "for", "the", "given", "order", "in", "the", "web", "shop", "s", "database", "." ]
82f8d6c9c4929c41948c97d6cfdfac3f27c37255
https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Shop/AcumulusEntryManager.php#L175-L185
30,198
SIELOnline/libAcumulus
src/Shop/AcumulusEntryManager.php
AcumulusEntryManager.deleteByEntryId
public function deleteByEntryId($entryId) { $entryId = (int) $entryId; if ($entryId >= 2) { $entry = $this->getByEntryId($entryId); if ($entry instanceof AcumulusEntry) { return $this->delete($entry); } } return true; }
php
public function deleteByEntryId($entryId) { $entryId = (int) $entryId; if ($entryId >= 2) { $entry = $this->getByEntryId($entryId); if ($entry instanceof AcumulusEntry) { return $this->delete($entry); } } return true; }
[ "public", "function", "deleteByEntryId", "(", "$", "entryId", ")", "{", "$", "entryId", "=", "(", "int", ")", "$", "entryId", ";", "if", "(", "$", "entryId", ">=", "2", ")", "{", "$", "entry", "=", "$", "this", "->", "getByEntryId", "(", "$", "entr...
Deletes the Acumulus entry for the given entry id. @param int $entryId The Acumulus entry id to delete. @return bool Success.
[ "Deletes", "the", "Acumulus", "entry", "for", "the", "given", "entry", "id", "." ]
82f8d6c9c4929c41948c97d6cfdfac3f27c37255
https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Shop/AcumulusEntryManager.php#L241-L251
30,199
SIELOnline/libAcumulus
src/PrestaShop/Invoice/Creator.php
Creator.mergeProductLines
public function mergeProductLines(array $productLines, array $taxLines) { $result = array(); // Key the product lines on id_order_detail, so we can easily add the // tax lines in the 2nd loop. foreach ($productLines as $productLine) { $result[$productLine['id_order_detail...
php
public function mergeProductLines(array $productLines, array $taxLines) { $result = array(); // Key the product lines on id_order_detail, so we can easily add the // tax lines in the 2nd loop. foreach ($productLines as $productLine) { $result[$productLine['id_order_detail...
[ "public", "function", "mergeProductLines", "(", "array", "$", "productLines", ",", "array", "$", "taxLines", ")", "{", "$", "result", "=", "array", "(", ")", ";", "// Key the product lines on id_order_detail, so we can easily add the", "// tax lines in the 2nd loop.", "fo...
Merges the product and tax details arrays. @param array $productLines @param array $taxLines @return array
[ "Merges", "the", "product", "and", "tax", "details", "arrays", "." ]
82f8d6c9c4929c41948c97d6cfdfac3f27c37255
https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/PrestaShop/Invoice/Creator.php#L124-L138