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
8,000
konservs/brilliant.framework
libraries/MVC/BControllerField.php
BControllerField.useFramework
public function useFramework($alias){ if(!isset($this->controller)){ return false; } $this->controller->frameworks[$alias]=$alias; return true; }
php
public function useFramework($alias){ if(!isset($this->controller)){ return false; } $this->controller->frameworks[$alias]=$alias; return true; }
[ "public", "function", "useFramework", "(", "$", "alias", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "controller", ")", ")", "{", "return", "false", ";", "}", "$", "this", "->", "controller", "->", "frameworks", "[", "$", "alias", "]",...
Add frameform declaration @param string $alias the framework alias @return boolean true if ok
[ "Add", "frameform", "declaration" ]
95f03f1917f746fee98bea8a906ba0588c87762d
https://github.com/konservs/brilliant.framework/blob/95f03f1917f746fee98bea8a906ba0588c87762d/libraries/MVC/BControllerField.php#L96-L102
8,001
qlcorp/VextFramework
src/Qlcorp/VextFramework/CrudModel.php
CrudModel.validate
public function validate() { $validator = Validator::make($this->toArray(), $this->rules, $this->messages); if ($validator->fails()) { $this->errors = $validator->messages(); return false; } else return true; }
php
public function validate() { $validator = Validator::make($this->toArray(), $this->rules, $this->messages); if ($validator->fails()) { $this->errors = $validator->messages(); return false; } else return true; }
[ "public", "function", "validate", "(", ")", "{", "$", "validator", "=", "Validator", "::", "make", "(", "$", "this", "->", "toArray", "(", ")", ",", "$", "this", "->", "rules", ",", "$", "this", "->", "messages", ")", ";", "if", "(", "$", "validato...
Validates generation input @return bool
[ "Validates", "generation", "input" ]
674e59d27ffe573866b14b931b8dd027f50cb740
https://github.com/qlcorp/VextFramework/blob/674e59d27ffe573866b14b931b8dd027f50cb740/src/Qlcorp/VextFramework/CrudModel.php#L45-L54
8,002
easy-system/es-http
src/Uploading/StrategiesQueue.php
StrategiesQueue.attach
public function attach(UploadStrategyInterface $strategy, $priority) { if ($this->started) { throw new RuntimeException('Unable during invoking.'); } if (isset($this->queue[$priority])) { throw new InvalidArgumentException(sprintf( 'The strategy with p...
php
public function attach(UploadStrategyInterface $strategy, $priority) { if ($this->started) { throw new RuntimeException('Unable during invoking.'); } if (isset($this->queue[$priority])) { throw new InvalidArgumentException(sprintf( 'The strategy with p...
[ "public", "function", "attach", "(", "UploadStrategyInterface", "$", "strategy", ",", "$", "priority", ")", "{", "if", "(", "$", "this", "->", "started", ")", "{", "throw", "new", "RuntimeException", "(", "'Unable during invoking.'", ")", ";", "}", "if", "("...
Attaches the upload strategy to specific priority. @param UploadStrategyInterface $strategy The upload strategy @param int $priority The priority @throws \RuntimeException If try to attach during invoking @throws \InvalidArgumentException If the specified priority have already some strateg...
[ "Attaches", "the", "upload", "strategy", "to", "specific", "priority", "." ]
dd5852e94901e147a7546a8715133408ece767a1
https://github.com/easy-system/es-http/blob/dd5852e94901e147a7546a8715133408ece767a1/src/Uploading/StrategiesQueue.php#L61-L80
8,003
easy-system/es-http
src/Uploading/StrategiesQueue.php
StrategiesQueue.detach
public function detach($priority) { if ($this->started) { throw new RuntimeException('Unable during invoking.'); } if (isset($this->queue[$priority])) { unset($this->queue[$priority]); $this->sortedQueue = null; } return $this; }
php
public function detach($priority) { if ($this->started) { throw new RuntimeException('Unable during invoking.'); } if (isset($this->queue[$priority])) { unset($this->queue[$priority]); $this->sortedQueue = null; } return $this; }
[ "public", "function", "detach", "(", "$", "priority", ")", "{", "if", "(", "$", "this", "->", "started", ")", "{", "throw", "new", "RuntimeException", "(", "'Unable during invoking.'", ")", ";", "}", "if", "(", "isset", "(", "$", "this", "->", "queue", ...
Detaches of the upload strategy with the specific priority. @param int $priority The priority @throws \RuntimeException If try to detach during invoking @return self
[ "Detaches", "of", "the", "upload", "strategy", "with", "the", "specific", "priority", "." ]
dd5852e94901e147a7546a8715133408ece767a1
https://github.com/easy-system/es-http/blob/dd5852e94901e147a7546a8715133408ece767a1/src/Uploading/StrategiesQueue.php#L91-L102
8,004
easy-system/es-http
src/Uploading/StrategiesQueue.php
StrategiesQueue.getState
public function getState() { if (empty($this->sortedQueue)) { return; } $current = current($this->sortedQueue) ? current($this->sortedQueue) : end($this->sortedQueue); return $current->getState(); }
php
public function getState() { if (empty($this->sortedQueue)) { return; } $current = current($this->sortedQueue) ? current($this->sortedQueue) : end($this->sortedQueue); return $current->getState(); }
[ "public", "function", "getState", "(", ")", "{", "if", "(", "empty", "(", "$", "this", "->", "sortedQueue", ")", ")", "{", "return", ";", "}", "$", "current", "=", "current", "(", "$", "this", "->", "sortedQueue", ")", "?", "current", "(", "$", "th...
Gets the state of strategy. @return null|int The state of strategy
[ "Gets", "the", "state", "of", "strategy", "." ]
dd5852e94901e147a7546a8715133408ece767a1
https://github.com/easy-system/es-http/blob/dd5852e94901e147a7546a8715133408ece767a1/src/Uploading/StrategiesQueue.php#L144-L154
8,005
easy-system/es-http
src/Uploading/StrategiesQueue.php
StrategiesQueue.hasOperationError
public function hasOperationError() { if (empty($this->sortedQueue)) { return false; } $current = current($this->sortedQueue) ? current($this->sortedQueue) : end($this->sortedQueue); return (bool) ($current::STATE_FAILURE & $current->get...
php
public function hasOperationError() { if (empty($this->sortedQueue)) { return false; } $current = current($this->sortedQueue) ? current($this->sortedQueue) : end($this->sortedQueue); return (bool) ($current::STATE_FAILURE & $current->get...
[ "public", "function", "hasOperationError", "(", ")", "{", "if", "(", "empty", "(", "$", "this", "->", "sortedQueue", ")", ")", "{", "return", "false", ";", "}", "$", "current", "=", "current", "(", "$", "this", "->", "sortedQueue", ")", "?", "current",...
An easy way to check the state to the presence of failure. Any of strategies can decides on failure without break the execution. The queue of strategies returns result of last executed strategy, if any. @return bool Returns true, if the state contains the failure flag, false otherwise
[ "An", "easy", "way", "to", "check", "the", "state", "to", "the", "presence", "of", "failure", "." ]
dd5852e94901e147a7546a8715133408ece767a1
https://github.com/easy-system/es-http/blob/dd5852e94901e147a7546a8715133408ece767a1/src/Uploading/StrategiesQueue.php#L165-L175
8,006
easy-system/es-http
src/Uploading/StrategiesQueue.php
StrategiesQueue.getOperationError
public function getOperationError() { if (empty($this->sortedQueue)) { return; } $current = current($this->sortedQueue) ? current($this->sortedQueue) : end($this->sortedQueue); return $current->getOperationError(); }
php
public function getOperationError() { if (empty($this->sortedQueue)) { return; } $current = current($this->sortedQueue) ? current($this->sortedQueue) : end($this->sortedQueue); return $current->getOperationError(); }
[ "public", "function", "getOperationError", "(", ")", "{", "if", "(", "empty", "(", "$", "this", "->", "sortedQueue", ")", ")", "{", "return", ";", "}", "$", "current", "=", "current", "(", "$", "this", "->", "sortedQueue", ")", "?", "current", "(", "...
Gets the error of last operation. @return null|string The error of last operation, if any
[ "Gets", "the", "error", "of", "last", "operation", "." ]
dd5852e94901e147a7546a8715133408ece767a1
https://github.com/easy-system/es-http/blob/dd5852e94901e147a7546a8715133408ece767a1/src/Uploading/StrategiesQueue.php#L182-L192
8,007
easy-system/es-http
src/Uploading/StrategiesQueue.php
StrategiesQueue.getOperationErrorDescription
public function getOperationErrorDescription() { if (empty($this->sortedQueue)) { return; } $current = current($this->sortedQueue) ? current($this->sortedQueue) : end($this->sortedQueue); return $current->getOperationErrorDescription(); ...
php
public function getOperationErrorDescription() { if (empty($this->sortedQueue)) { return; } $current = current($this->sortedQueue) ? current($this->sortedQueue) : end($this->sortedQueue); return $current->getOperationErrorDescription(); ...
[ "public", "function", "getOperationErrorDescription", "(", ")", "{", "if", "(", "empty", "(", "$", "this", "->", "sortedQueue", ")", ")", "{", "return", ";", "}", "$", "current", "=", "current", "(", "$", "this", "->", "sortedQueue", ")", "?", "current",...
Gets the description of error of last operation. @return null|string The description of error of last operation, if any
[ "Gets", "the", "description", "of", "error", "of", "last", "operation", "." ]
dd5852e94901e147a7546a8715133408ece767a1
https://github.com/easy-system/es-http/blob/dd5852e94901e147a7546a8715133408ece767a1/src/Uploading/StrategiesQueue.php#L199-L209
8,008
pho-adapters/index-neo4j
Neo4j.php
Neo4j.subscribeGraphsystem
protected function subscribeGraphsystem(): void { $this->kernel->events()->on('graphsystem.touched', function(array $var) { $this->index($var); }) ->on('graphsystem.node_deleted', function(string $id) { $this->nodeDeleted($i...
php
protected function subscribeGraphsystem(): void { $this->kernel->events()->on('graphsystem.touched', function(array $var) { $this->index($var); }) ->on('graphsystem.node_deleted', function(string $id) { $this->nodeDeleted($i...
[ "protected", "function", "subscribeGraphsystem", "(", ")", ":", "void", "{", "$", "this", "->", "kernel", "->", "events", "(", ")", "->", "on", "(", "'graphsystem.touched'", ",", "function", "(", "array", "$", "var", ")", "{", "$", "this", "->", "index",...
Listener for kernel events Interfaces graphsystem and indexes in every touch or delete operation. @return void
[ "Listener", "for", "kernel", "events" ]
fb0dd62439e0e4bcf306c7af6bd0f82ad55f9f94
https://github.com/pho-adapters/index-neo4j/blob/fb0dd62439e0e4bcf306c7af6bd0f82ad55f9f94/Neo4j.php#L72-L87
8,009
pho-adapters/index-neo4j
Neo4j.php
Neo4j.indexNode
protected function indexNode(array $entity): void { //$this->kernel->logger()->info("Header qualifies it to be indexed"); $entity["attributes"]["udid"] = $entity["id"]; $cq = sprintf("MERGE (n:%s {udid: {udid}}) SET n = {data}", $entity["label"]); $this->kernel->logger()->info( ...
php
protected function indexNode(array $entity): void { //$this->kernel->logger()->info("Header qualifies it to be indexed"); $entity["attributes"]["udid"] = $entity["id"]; $cq = sprintf("MERGE (n:%s {udid: {udid}}) SET n = {data}", $entity["label"]); $this->kernel->logger()->info( ...
[ "protected", "function", "indexNode", "(", "array", "$", "entity", ")", ":", "void", "{", "//$this->kernel->logger()->info(\"Header qualifies it to be indexed\");", "$", "entity", "[", "\"attributes\"", "]", "[", "\"udid\"", "]", "=", "$", "entity", "[", "\"id\"", "...
Indexes a node @param array $entity In array form. @return void
[ "Indexes", "a", "node" ]
fb0dd62439e0e4bcf306c7af6bd0f82ad55f9f94
https://github.com/pho-adapters/index-neo4j/blob/fb0dd62439e0e4bcf306c7af6bd0f82ad55f9f94/Neo4j.php#L153-L167
8,010
pho-adapters/index-neo4j
Neo4j.php
Neo4j.indexEdge
protected function indexEdge(array $entity): void { //$tail_id = $entity[] $entity["attributes"]["udid"] = $entity["id"]; $cq = sprintf("MATCH(t {udid: {tail}}), (h {udid: {head}}) MERGE (t)-[e:%s {udid: {udid}}]->(h) SET e = {data}", $entity["label"]); $result = $this->client->run($...
php
protected function indexEdge(array $entity): void { //$tail_id = $entity[] $entity["attributes"]["udid"] = $entity["id"]; $cq = sprintf("MATCH(t {udid: {tail}}), (h {udid: {head}}) MERGE (t)-[e:%s {udid: {udid}}]->(h) SET e = {data}", $entity["label"]); $result = $this->client->run($...
[ "protected", "function", "indexEdge", "(", "array", "$", "entity", ")", ":", "void", "{", "//$tail_id = $entity[]", "$", "entity", "[", "\"attributes\"", "]", "[", "\"udid\"", "]", "=", "$", "entity", "[", "\"id\"", "]", ";", "$", "cq", "=", "sprintf", "...
Indexes an edge @param array $entity In array form. @return void
[ "Indexes", "an", "edge" ]
fb0dd62439e0e4bcf306c7af6bd0f82ad55f9f94
https://github.com/pho-adapters/index-neo4j/blob/fb0dd62439e0e4bcf306c7af6bd0f82ad55f9f94/Neo4j.php#L176-L187
8,011
eghojansu/nutrition
src/SQL/Criteria.php
Criteria.buildCriteria
public static function buildCriteria(array $values, $qmMode = false) { reset($values); $qmMode = $qmMode ?: is_numeric(key($values)); if ($qmMode) { $result = array_values($values); array_unshift($result, str_repeat('?,', count($values)-1).'?'); return $...
php
public static function buildCriteria(array $values, $qmMode = false) { reset($values); $qmMode = $qmMode ?: is_numeric(key($values)); if ($qmMode) { $result = array_values($values); array_unshift($result, str_repeat('?,', count($values)-1).'?'); return $...
[ "public", "static", "function", "buildCriteria", "(", "array", "$", "values", ",", "$", "qmMode", "=", "false", ")", "{", "reset", "(", "$", "values", ")", ";", "$", "qmMode", "=", "$", "qmMode", "?", ":", "is_numeric", "(", "key", "(", "$", "values"...
Array to mapper criteria @param array $values @param boolean $qmMode force question mark placeholder @return string
[ "Array", "to", "mapper", "criteria" ]
3941c62aeb6dafda55349a38dd4107d521f8964a
https://github.com/eghojansu/nutrition/blob/3941c62aeb6dafda55349a38dd4107d521f8964a/src/SQL/Criteria.php#L97-L117
8,012
novuso/system
src/Utility/FastHasher.php
FastHasher.hash
public static function hash($value, string $algorithm = 'fnv1a32'): string { $type = gettype($value); switch ($type) { case 'object': if (Validate::isEquatable($value)) { $string = sprintf('e_%s', $value->hashValue()); } else { ...
php
public static function hash($value, string $algorithm = 'fnv1a32'): string { $type = gettype($value); switch ($type) { case 'object': if (Validate::isEquatable($value)) { $string = sprintf('e_%s', $value->hashValue()); } else { ...
[ "public", "static", "function", "hash", "(", "$", "value", ",", "string", "$", "algorithm", "=", "'fnv1a32'", ")", ":", "string", "{", "$", "type", "=", "gettype", "(", "$", "value", ")", ";", "switch", "(", "$", "type", ")", "{", "case", "'object'",...
Creates a string hash for a value @param mixed $value The value @param string $algorithm The hash algorithm @return string
[ "Creates", "a", "string", "hash", "for", "a", "value" ]
e34038b391826edc68d0b5fccfba96642de9d6f0
https://github.com/novuso/system/blob/e34038b391826edc68d0b5fccfba96642de9d6f0/src/Utility/FastHasher.php#L22-L58
8,013
unimatrix/cake
src/Shell/Helper/BenchmarkHelper.php
BenchmarkHelper.output
public function output($args = null) { // calculate diff $diff = $this->end->diff($this->begin); // decide stuff $msg = []; if($diff->d > 0) $msg[] = $this->plural($diff->d, 'd'); if($diff->h > 0) $msg[] = $this->plural($diff->h, 'h'); if($diff->i > 0) $msg[] = $...
php
public function output($args = null) { // calculate diff $diff = $this->end->diff($this->begin); // decide stuff $msg = []; if($diff->d > 0) $msg[] = $this->plural($diff->d, 'd'); if($diff->h > 0) $msg[] = $this->plural($diff->h, 'h'); if($diff->i > 0) $msg[] = $...
[ "public", "function", "output", "(", "$", "args", "=", "null", ")", "{", "// calculate diff", "$", "diff", "=", "$", "this", "->", "end", "->", "diff", "(", "$", "this", "->", "begin", ")", ";", "// decide stuff", "$", "msg", "=", "[", "]", ";", "i...
Calculate execution time @return string
[ "Calculate", "execution", "time" ]
23003aba497822bd473fdbf60514052dda1874fc
https://github.com/unimatrix/cake/blob/23003aba497822bd473fdbf60514052dda1874fc/src/Shell/Helper/BenchmarkHelper.php#L80-L93
8,014
unyx/console
output/formatting/styles/Map.php
Map.get
public function get(string $name, $default = null) : ?interfaces\Style { return $this->items[strtolower($name)] ?? $default; }
php
public function get(string $name, $default = null) : ?interfaces\Style { return $this->items[strtolower($name)] ?? $default; }
[ "public", "function", "get", "(", "string", "$", "name", ",", "$", "default", "=", "null", ")", ":", "?", "interfaces", "\\", "Style", "{", "return", "$", "this", "->", "items", "[", "strtolower", "(", "$", "name", ")", "]", "??", "$", "default", "...
Returns a Style identified by its name. @param string $name The name of the Style to return. @param mixed $default The default value to return when the given Style does not exist in the Collection. @return interfaces\Style The Style or the default value given if the Style couldn't be found.
[ "Returns", "a", "Style", "identified", "by", "its", "name", "." ]
b4a76e08bbb5428b0349c0ec4259a914f81a2957
https://github.com/unyx/console/blob/b4a76e08bbb5428b0349c0ec4259a914f81a2957/output/formatting/styles/Map.php#L38-L41
8,015
unyx/console
output/formatting/styles/Map.php
Map.set
public function set(string $name, interfaces\Style $style) : Map { $this->items[strtolower($name)] = $style; return $this; }
php
public function set(string $name, interfaces\Style $style) : Map { $this->items[strtolower($name)] = $style; return $this; }
[ "public", "function", "set", "(", "string", "$", "name", ",", "interfaces", "\\", "Style", "$", "style", ")", ":", "Map", "{", "$", "this", "->", "items", "[", "strtolower", "(", "$", "name", ")", "]", "=", "$", "style", ";", "return", "$", "this",...
Sets the given Style in the Collection. @param string $name The name the Style should be set as. @param mixed $value The Style to set. @return $this
[ "Sets", "the", "given", "Style", "in", "the", "Collection", "." ]
b4a76e08bbb5428b0349c0ec4259a914f81a2957
https://github.com/unyx/console/blob/b4a76e08bbb5428b0349c0ec4259a914f81a2957/output/formatting/styles/Map.php#L50-L55
8,016
unyx/console
output/formatting/styles/Map.php
Map.contains
public function contains(interfaces\Style $style) : bool { return empty($this->items) ? false : (null !== $this->name($style)); }
php
public function contains(interfaces\Style $style) : bool { return empty($this->items) ? false : (null !== $this->name($style)); }
[ "public", "function", "contains", "(", "interfaces", "\\", "Style", "$", "style", ")", ":", "bool", "{", "return", "empty", "(", "$", "this", "->", "items", ")", "?", "false", ":", "(", "null", "!==", "$", "this", "->", "name", "(", "$", "style", "...
Checks whether the given Style exists in the Collection. @param interfaces\Style $style The Style to search for. @return bool True if the Style exists in the Collection, false otherwise.
[ "Checks", "whether", "the", "given", "Style", "exists", "in", "the", "Collection", "." ]
b4a76e08bbb5428b0349c0ec4259a914f81a2957
https://github.com/unyx/console/blob/b4a76e08bbb5428b0349c0ec4259a914f81a2957/output/formatting/styles/Map.php#L74-L77
8,017
unyx/console
output/formatting/styles/Map.php
Map.name
public function name(interfaces\Style $style) : ?string { foreach ($this->items as $key => $value) { if ($value === $style) { return $key; } } return null; }
php
public function name(interfaces\Style $style) : ?string { foreach ($this->items as $key => $value) { if ($value === $style) { return $key; } } return null; }
[ "public", "function", "name", "(", "interfaces", "\\", "Style", "$", "style", ")", ":", "?", "string", "{", "foreach", "(", "$", "this", "->", "items", "as", "$", "key", "=>", "$", "value", ")", "{", "if", "(", "$", "value", "===", "$", "style", ...
Returns the name a given Style is set as within the Collection. @param interfaces\Style $style The Style to search for. @return string The name of the Style or null if it couldn't be found.
[ "Returns", "the", "name", "a", "given", "Style", "is", "set", "as", "within", "the", "Collection", "." ]
b4a76e08bbb5428b0349c0ec4259a914f81a2957
https://github.com/unyx/console/blob/b4a76e08bbb5428b0349c0ec4259a914f81a2957/output/formatting/styles/Map.php#L112-L121
8,018
laraning/flame
src/Commands/MakeFeatureCommand.php
MakeFeatureCommand.parseFile
protected function parseFile(string $origin, string $destination, array $translations = [], array $conversions = []) { $data = str_replace($translations, $conversions, file_get_contents($origin)); file_put_contents($destination, $data); }
php
protected function parseFile(string $origin, string $destination, array $translations = [], array $conversions = []) { $data = str_replace($translations, $conversions, file_get_contents($origin)); file_put_contents($destination, $data); }
[ "protected", "function", "parseFile", "(", "string", "$", "origin", ",", "string", "$", "destination", ",", "array", "$", "translations", "=", "[", "]", ",", "array", "$", "conversions", "=", "[", "]", ")", "{", "$", "data", "=", "str_replace", "(", "$...
Parses the original file with the respective replacement pairs, and creates the destination file with everything replaced. @param string $origin The original file path. @param string $destination The destination file path. @param array $translations The keys to translate: {{example}}. @param array $conversion...
[ "Parses", "the", "original", "file", "with", "the", "respective", "replacement", "pairs", "and", "creates", "the", "destination", "file", "with", "everything", "replaced", "." ]
42bdc99fd3b7c200707bcc407d7d87390b3a7c37
https://github.com/laraning/flame/blob/42bdc99fd3b7c200707bcc407d7d87390b3a7c37/src/Commands/MakeFeatureCommand.php#L237-L241
8,019
laraning/flame
src/Commands/MakeFeatureCommand.php
MakeFeatureCommand.makeFeatureDirectories
protected function makeFeatureDirectories() { File::makeDirectories([$this->basePath, $this->basePath.'/Twinkles', $this->basePath.'/Panels', $this->basePath.'/Controllers', ]); }
php
protected function makeFeatureDirectories() { File::makeDirectories([$this->basePath, $this->basePath.'/Twinkles', $this->basePath.'/Panels', $this->basePath.'/Controllers', ]); }
[ "protected", "function", "makeFeatureDirectories", "(", ")", "{", "File", "::", "makeDirectories", "(", "[", "$", "this", "->", "basePath", ",", "$", "this", "->", "basePath", ".", "'/Twinkles'", ",", "$", "this", "->", "basePath", ".", "'/Panels'", ",", "...
Creates the Feature directory and sub-directories. @return void
[ "Creates", "the", "Feature", "directory", "and", "sub", "-", "directories", "." ]
42bdc99fd3b7c200707bcc407d7d87390b3a7c37
https://github.com/laraning/flame/blob/42bdc99fd3b7c200707bcc407d7d87390b3a7c37/src/Commands/MakeFeatureCommand.php#L248-L254
8,020
benkle-libs/doctrine-adoption
src/Collector.php
Collector.addAdoptee
public function addAdoptee($for, $adoptee, $discriminator) { if (!isset($this->entities[$for]) || !is_array($this->entities[$for])) { $this->entities[$for] = []; } $this->entities[$for][$discriminator] = $adoptee; return $this; }
php
public function addAdoptee($for, $adoptee, $discriminator) { if (!isset($this->entities[$for]) || !is_array($this->entities[$for])) { $this->entities[$for] = []; } $this->entities[$for][$discriminator] = $adoptee; return $this; }
[ "public", "function", "addAdoptee", "(", "$", "for", ",", "$", "adoptee", ",", "$", "discriminator", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "entities", "[", "$", "for", "]", ")", "||", "!", "is_array", "(", "$", "this", "->", ...
Add adoptee to the collector. @param string $for Class name of the adopting entity @param string $adoptee Class name of the adopted entity @param string $discriminator Name for the discriminator column @return $this
[ "Add", "adoptee", "to", "the", "collector", "." ]
01dcb48d7224c7003fa0acbac5c2ddd54d860fd4
https://github.com/benkle-libs/doctrine-adoption/blob/01dcb48d7224c7003fa0acbac5c2ddd54d860fd4/src/Collector.php#L37-L44
8,021
simonhamp/network-elements
src/Console/Commands/NetworkConfigCommand.php
NetworkConfigCommand.finalizeSetup
protected function finalizeSetup() { // Run migrations if possible $attemptMigrate = false; if ($this->connection === 'sqlite') { $attemptMigrate = $this->createSqliteDatabase(); } else { $attemptMigrate = $this->canConnectToDb(); } sleep(1);...
php
protected function finalizeSetup() { // Run migrations if possible $attemptMigrate = false; if ($this->connection === 'sqlite') { $attemptMigrate = $this->createSqliteDatabase(); } else { $attemptMigrate = $this->canConnectToDb(); } sleep(1);...
[ "protected", "function", "finalizeSetup", "(", ")", "{", "// Run migrations if possible", "$", "attemptMigrate", "=", "false", ";", "if", "(", "$", "this", "->", "connection", "===", "'sqlite'", ")", "{", "$", "attemptMigrate", "=", "$", "this", "->", "createS...
Run main setup after we know we have the .env in place.
[ "Run", "main", "setup", "after", "we", "know", "we", "have", "the", ".", "env", "in", "place", "." ]
17cc17c5dbb8235c0c6e283a55578d72fe2d8ef8
https://github.com/simonhamp/network-elements/blob/17cc17c5dbb8235c0c6e283a55578d72fe2d8ef8/src/Console/Commands/NetworkConfigCommand.php#L214-L258
8,022
simonhamp/network-elements
src/Console/Commands/NetworkConfigCommand.php
NetworkConfigCommand.createSqliteDatabase
protected function createSqliteDatabase() { $dbPath = config('database.connections.sqlite.database'); $createDb = new Process("touch $dbPath"); $createDb->run(); if (! $createDb->isSuccessful()) { $this->warn("I couldn't create your SQLite database file."); $...
php
protected function createSqliteDatabase() { $dbPath = config('database.connections.sqlite.database'); $createDb = new Process("touch $dbPath"); $createDb->run(); if (! $createDb->isSuccessful()) { $this->warn("I couldn't create your SQLite database file."); $...
[ "protected", "function", "createSqliteDatabase", "(", ")", "{", "$", "dbPath", "=", "config", "(", "'database.connections.sqlite.database'", ")", ";", "$", "createDb", "=", "new", "Process", "(", "\"touch $dbPath\"", ")", ";", "$", "createDb", "->", "run", "(", ...
Create the SQLite database file if this is the driver the user wants to use. @return bool
[ "Create", "the", "SQLite", "database", "file", "if", "this", "is", "the", "driver", "the", "user", "wants", "to", "use", "." ]
17cc17c5dbb8235c0c6e283a55578d72fe2d8ef8
https://github.com/simonhamp/network-elements/blob/17cc17c5dbb8235c0c6e283a55578d72fe2d8ef8/src/Console/Commands/NetworkConfigCommand.php#L265-L285
8,023
simonhamp/network-elements
src/Console/Commands/NetworkConfigCommand.php
NetworkConfigCommand.canConnectToDb
protected function canConnectToDb() { $dbServer = $this->validConnections[$this->connection]; try { // Run a simple test that will fail if the database doesn't exist Schema::connection($this->connection)->hasTable('migrations'); return true; } catch (\PDO...
php
protected function canConnectToDb() { $dbServer = $this->validConnections[$this->connection]; try { // Run a simple test that will fail if the database doesn't exist Schema::connection($this->connection)->hasTable('migrations'); return true; } catch (\PDO...
[ "protected", "function", "canConnectToDb", "(", ")", "{", "$", "dbServer", "=", "$", "this", "->", "validConnections", "[", "$", "this", "->", "connection", "]", ";", "try", "{", "// Run a simple test that will fail if the database doesn't exist", "Schema", "::", "c...
Check the database connection @return bool
[ "Check", "the", "database", "connection" ]
17cc17c5dbb8235c0c6e283a55578d72fe2d8ef8
https://github.com/simonhamp/network-elements/blob/17cc17c5dbb8235c0c6e283a55578d72fe2d8ef8/src/Console/Commands/NetworkConfigCommand.php#L292-L309
8,024
simonhamp/network-elements
src/Console/Commands/NetworkConfigCommand.php
NetworkConfigCommand.generateEnv
protected function generateEnv() { $env = null; // Get the existing .env file contents to replace $envPath = $this->laravel->environmentFilePath(); if (! file_exists($envPath)) { // Create the .env file from the example file copy($envPath.'.example', $envPat...
php
protected function generateEnv() { $env = null; // Get the existing .env file contents to replace $envPath = $this->laravel->environmentFilePath(); if (! file_exists($envPath)) { // Create the .env file from the example file copy($envPath.'.example', $envPat...
[ "protected", "function", "generateEnv", "(", ")", "{", "$", "env", "=", "null", ";", "// Get the existing .env file contents to replace", "$", "envPath", "=", "$", "this", "->", "laravel", "->", "environmentFilePath", "(", ")", ";", "if", "(", "!", "file_exists"...
Generate the full .env file by replacing values from original @return string
[ "Generate", "the", "full", ".", "env", "file", "by", "replacing", "values", "from", "original" ]
17cc17c5dbb8235c0c6e283a55578d72fe2d8ef8
https://github.com/simonhamp/network-elements/blob/17cc17c5dbb8235c0c6e283a55578d72fe2d8ef8/src/Console/Commands/NetworkConfigCommand.php#L341-L372
8,025
simonhamp/network-elements
src/Console/Commands/NetworkConfigCommand.php
NetworkConfigCommand.createSymlinks
protected function createSymlinks() { // Symlink the public storage folder if (! file_exists(public_path('storage'))) { $this->call('storage:link'); } // Symlink the public assets folder if (! is_link($sitePath = public_path('network'))) { $this->info...
php
protected function createSymlinks() { // Symlink the public storage folder if (! file_exists(public_path('storage'))) { $this->call('storage:link'); } // Symlink the public assets folder if (! is_link($sitePath = public_path('network'))) { $this->info...
[ "protected", "function", "createSymlinks", "(", ")", "{", "// Symlink the public storage folder", "if", "(", "!", "file_exists", "(", "public_path", "(", "'storage'", ")", ")", ")", "{", "$", "this", "->", "call", "(", "'storage:link'", ")", ";", "}", "// Syml...
Create folder symlinks
[ "Create", "folder", "symlinks" ]
17cc17c5dbb8235c0c6e283a55578d72fe2d8ef8
https://github.com/simonhamp/network-elements/blob/17cc17c5dbb8235c0c6e283a55578d72fe2d8ef8/src/Console/Commands/NetworkConfigCommand.php#L377-L401
8,026
bishopb/vanilla
applications/dashboard/controllers/class.homecontroller.php
HomeController.Initialize
public function Initialize() { $this->Head = new HeadModule($this); $this->AddJsFile('jquery.js'); $this->AddJsFile('jquery.livequery.js'); $this->AddJsFile('jquery.form.js'); $this->AddJsFile('jquery.popup.js'); $this->AddJsFile('jquery.gardenhandleajaxform.js'); $this->AddJsF...
php
public function Initialize() { $this->Head = new HeadModule($this); $this->AddJsFile('jquery.js'); $this->AddJsFile('jquery.livequery.js'); $this->AddJsFile('jquery.form.js'); $this->AddJsFile('jquery.popup.js'); $this->AddJsFile('jquery.gardenhandleajaxform.js'); $this->AddJsF...
[ "public", "function", "Initialize", "(", ")", "{", "$", "this", "->", "Head", "=", "new", "HeadModule", "(", "$", "this", ")", ";", "$", "this", "->", "AddJsFile", "(", "'jquery.js'", ")", ";", "$", "this", "->", "AddJsFile", "(", "'jquery.livequery.js'"...
JS & CSS includes for all methods in this controller. @since 2.0.0 @access public
[ "JS", "&", "CSS", "includes", "for", "all", "methods", "in", "this", "controller", "." ]
8494eb4a4ad61603479015a8054d23ff488364e8
https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/applications/dashboard/controllers/class.homecontroller.php#L29-L40
8,027
bishopb/vanilla
applications/dashboard/controllers/class.homecontroller.php
HomeController.FileNotFound
public function FileNotFound() { $this->RemoveCssFile('admin.css'); $this->AddCssFile('style.css'); $this->MasterView = 'default'; $this->CssClass = 'SplashMessage NoPanel'; if ($this->Data('ViewPaths')) { Trace($this->Data('ViewPaths'), 'View Paths'); } ...
php
public function FileNotFound() { $this->RemoveCssFile('admin.css'); $this->AddCssFile('style.css'); $this->MasterView = 'default'; $this->CssClass = 'SplashMessage NoPanel'; if ($this->Data('ViewPaths')) { Trace($this->Data('ViewPaths'), 'View Paths'); } ...
[ "public", "function", "FileNotFound", "(", ")", "{", "$", "this", "->", "RemoveCssFile", "(", "'admin.css'", ")", ";", "$", "this", "->", "AddCssFile", "(", "'style.css'", ")", ";", "$", "this", "->", "MasterView", "=", "'default'", ";", "$", "this", "->...
A standard 404 File Not Found error message is delivered when this action is encountered. @since 2.0.0 @access public
[ "A", "standard", "404", "File", "Not", "Found", "error", "message", "is", "delivered", "when", "this", "action", "is", "encountered", "." ]
8494eb4a4ad61603479015a8054d23ff488364e8
https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/applications/dashboard/controllers/class.homecontroller.php#L75-L93
8,028
bishopb/vanilla
applications/dashboard/controllers/class.homecontroller.php
HomeController.Permission
public function Permission() { if ($this->DeliveryMethod() == DELIVERY_METHOD_XHTML) { header("HTTP/1.0 401", TRUE, 401); $this->Render(); } else $this->RenderException(PermissionException()); }
php
public function Permission() { if ($this->DeliveryMethod() == DELIVERY_METHOD_XHTML) { header("HTTP/1.0 401", TRUE, 401); $this->Render(); } else $this->RenderException(PermissionException()); }
[ "public", "function", "Permission", "(", ")", "{", "if", "(", "$", "this", "->", "DeliveryMethod", "(", ")", "==", "DELIVERY_METHOD_XHTML", ")", "{", "header", "(", "\"HTTP/1.0 401\"", ",", "TRUE", ",", "401", ")", ";", "$", "this", "->", "Render", "(", ...
Display 'no permission' page. @since 2.0.0 @access public
[ "Display", "no", "permission", "page", "." ]
8494eb4a4ad61603479015a8054d23ff488364e8
https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/applications/dashboard/controllers/class.homecontroller.php#L146-L152
8,029
dmeikle/pesedget
src/Gossamer/Pesedget/Commands/SaveCommand.php
SaveCommand.saveI18nValues
private function saveI18nValues($firstResult, $requestParams, &$locale) { // file_put_contents('/var/www/db-repo/logs/cms.log', print_r($requestParams, true), FILE_APPEND); if(!$this->entity instanceof AbstractI18nEntity || is_null($locale)) { return; } // file_put...
php
private function saveI18nValues($firstResult, $requestParams, &$locale) { // file_put_contents('/var/www/db-repo/logs/cms.log', print_r($requestParams, true), FILE_APPEND); if(!$this->entity instanceof AbstractI18nEntity || is_null($locale)) { return; } // file_put...
[ "private", "function", "saveI18nValues", "(", "$", "firstResult", ",", "$", "requestParams", ",", "&", "$", "locale", ")", "{", "// file_put_contents('/var/www/db-repo/logs/cms.log', print_r($requestParams, true), FILE_APPEND);", "if", "(", "!", "$", "this", "->", "entity...
save child rows into I18n specific to saved entity
[ "save", "child", "rows", "into", "I18n", "specific", "to", "saved", "entity" ]
bcfca25569d1f47c073f08906a710ed895f77b4d
https://github.com/dmeikle/pesedget/blob/bcfca25569d1f47c073f08906a710ed895f77b4d/src/Gossamer/Pesedget/Commands/SaveCommand.php#L192-L219
8,030
phossa2/libs
src/Phossa2/Route/Resolver/ResolverSimple.php
ResolverSimple.searchController
protected function searchController( /*# string */ $controller, /*# string */ $action )/*# : callable */ { $controllerName = $controller . $this->controller_suffix; $actionName = $action . $this->action_suffix; foreach ($this->namespaces as $ns) { $class = $ns . '...
php
protected function searchController( /*# string */ $controller, /*# string */ $action )/*# : callable */ { $controllerName = $controller . $this->controller_suffix; $actionName = $action . $this->action_suffix; foreach ($this->namespaces as $ns) { $class = $ns . '...
[ "protected", "function", "searchController", "(", "/*# string */", "$", "controller", ",", "/*# string */", "$", "action", ")", "/*# : callable */", "{", "$", "controllerName", "=", "$", "controller", ".", "$", "this", "->", "controller_suffix", ";", "$", "actionN...
Search controller base on the name @param string $controller @param string $action @return callable @throws LogicException if not found @access protected
[ "Search", "controller", "base", "on", "the", "name" ]
921e485c8cc29067f279da2cdd06f47a9bddd115
https://github.com/phossa2/libs/blob/921e485c8cc29067f279da2cdd06f47a9bddd115/src/Phossa2/Route/Resolver/ResolverSimple.php#L93-L110
8,031
avoo/FrameworkGeneratorBundle
Generator/Template/Template.php
Template.getBundlePrefix
public function getBundlePrefix(AbstractResourceBundle $bundle = null) { if (is_null($bundle)) { $bundle = $this->bundle; } $containerExtension = new \ReflectionClass($bundle->getContainerExtension()); $applicationName = $containerExtension->getProperty('applicationName'...
php
public function getBundlePrefix(AbstractResourceBundle $bundle = null) { if (is_null($bundle)) { $bundle = $this->bundle; } $containerExtension = new \ReflectionClass($bundle->getContainerExtension()); $applicationName = $containerExtension->getProperty('applicationName'...
[ "public", "function", "getBundlePrefix", "(", "AbstractResourceBundle", "$", "bundle", "=", "null", ")", "{", "if", "(", "is_null", "(", "$", "bundle", ")", ")", "{", "$", "bundle", "=", "$", "this", "->", "bundle", ";", "}", "$", "containerExtension", "...
Return the prefix of the bundle. @param AbstractResourceBundle $bundle @return string
[ "Return", "the", "prefix", "of", "the", "bundle", "." ]
3178268b9e58e6c60c27e0b9ea976944c1f61a48
https://github.com/avoo/FrameworkGeneratorBundle/blob/3178268b9e58e6c60c27e0b9ea976944c1f61a48/Generator/Template/Template.php#L146-L158
8,032
avoo/FrameworkGeneratorBundle
Generator/Template/Template.php
Template.getEntityMetadata
protected function getEntityMetadata($entity, $path = null) { $factory = new DisconnectedMetadataFactory($this->getContainer()->get('doctrine')); return $factory->getClassMetadata($entity, $path)->getMetadata(); }
php
protected function getEntityMetadata($entity, $path = null) { $factory = new DisconnectedMetadataFactory($this->getContainer()->get('doctrine')); return $factory->getClassMetadata($entity, $path)->getMetadata(); }
[ "protected", "function", "getEntityMetadata", "(", "$", "entity", ",", "$", "path", "=", "null", ")", "{", "$", "factory", "=", "new", "DisconnectedMetadataFactory", "(", "$", "this", "->", "getContainer", "(", ")", "->", "get", "(", "'doctrine'", ")", ")"...
Get entity metadata @param string $entity @param string $path @return array @throws MappingException
[ "Get", "entity", "metadata" ]
3178268b9e58e6c60c27e0b9ea976944c1f61a48
https://github.com/avoo/FrameworkGeneratorBundle/blob/3178268b9e58e6c60c27e0b9ea976944c1f61a48/Generator/Template/Template.php#L235-L240
8,033
avoo/FrameworkGeneratorBundle
Generator/Template/Template.php
Template.refExist
protected function refExist($path, $ref) { $content = file_get_contents($path); if (false === strpos($content, $ref)) { return false; } return true; }
php
protected function refExist($path, $ref) { $content = file_get_contents($path); if (false === strpos($content, $ref)) { return false; } return true; }
[ "protected", "function", "refExist", "(", "$", "path", ",", "$", "ref", ")", "{", "$", "content", "=", "file_get_contents", "(", "$", "path", ")", ";", "if", "(", "false", "===", "strpos", "(", "$", "content", ",", "$", "ref", ")", ")", "{", "retur...
Check if the reference exist in path @param string $path @param string $ref @return bool
[ "Check", "if", "the", "reference", "exist", "in", "path" ]
3178268b9e58e6c60c27e0b9ea976944c1f61a48
https://github.com/avoo/FrameworkGeneratorBundle/blob/3178268b9e58e6c60c27e0b9ea976944c1f61a48/Generator/Template/Template.php#L312-L321
8,034
avoo/FrameworkGeneratorBundle
Generator/Template/Template.php
Template.getRoutePrefix
public function getRoutePrefix($entity) { $prefix = strtolower(str_replace(array('\\', '/'), '_', $entity)); if ($prefix && '/' === $prefix[0]) { $prefix = substr($prefix, 1); } return str_replace('/', '_', $prefix); }
php
public function getRoutePrefix($entity) { $prefix = strtolower(str_replace(array('\\', '/'), '_', $entity)); if ($prefix && '/' === $prefix[0]) { $prefix = substr($prefix, 1); } return str_replace('/', '_', $prefix); }
[ "public", "function", "getRoutePrefix", "(", "$", "entity", ")", "{", "$", "prefix", "=", "strtolower", "(", "str_replace", "(", "array", "(", "'\\\\'", ",", "'/'", ")", ",", "'_'", ",", "$", "entity", ")", ")", ";", "if", "(", "$", "prefix", "&&", ...
Get routing prefix @param string $entity @return string
[ "Get", "routing", "prefix" ]
3178268b9e58e6c60c27e0b9ea976944c1f61a48
https://github.com/avoo/FrameworkGeneratorBundle/blob/3178268b9e58e6c60c27e0b9ea976944c1f61a48/Generator/Template/Template.php#L338-L347
8,035
avoo/FrameworkGeneratorBundle
Generator/Template/Template.php
Template.writeOutput
protected function writeOutput($message) { if (is_null($this->output)) { return false; } $this->output->writeln($message); return $this; }
php
protected function writeOutput($message) { if (is_null($this->output)) { return false; } $this->output->writeln($message); return $this; }
[ "protected", "function", "writeOutput", "(", "$", "message", ")", "{", "if", "(", "is_null", "(", "$", "this", "->", "output", ")", ")", "{", "return", "false", ";", "}", "$", "this", "->", "output", "->", "writeln", "(", "$", "message", ")", ";", ...
Write output message @param array|string $message @return $this|bool
[ "Write", "output", "message" ]
3178268b9e58e6c60c27e0b9ea976944c1f61a48
https://github.com/avoo/FrameworkGeneratorBundle/blob/3178268b9e58e6c60c27e0b9ea976944c1f61a48/Generator/Template/Template.php#L450-L459
8,036
superbrave/coding-standards
Superbrave/Sniffs/Commenting/FunctionCommentSniff.php
FunctionCommentSniff.processReturnAboveThrows
protected function processReturnAboveThrows(File $phpcsFile, $stackPtr) { // Fetches the full function docblock $startToken = null; $endToken = null; $docblock = $this->getDocBlock($phpcsFile, $stackPtr, $startToken, $endToken); if ($this->hasInheritDoc($phpcsFile, $stackPtr,...
php
protected function processReturnAboveThrows(File $phpcsFile, $stackPtr) { // Fetches the full function docblock $startToken = null; $endToken = null; $docblock = $this->getDocBlock($phpcsFile, $stackPtr, $startToken, $endToken); if ($this->hasInheritDoc($phpcsFile, $stackPtr,...
[ "protected", "function", "processReturnAboveThrows", "(", "File", "$", "phpcsFile", ",", "$", "stackPtr", ")", "{", "// Fetches the full function docblock", "$", "startToken", "=", "null", ";", "$", "endToken", "=", "null", ";", "$", "docblock", "=", "$", "this"...
A throws call must be below the return call. The Superbrave standards follows the "Symfony Way" in this sniff. @param File $phpcsFile The file being scanned. @param int $stackPtr The position of the current token in the stack passed in $tokens. @return void
[ "A", "throws", "call", "must", "be", "below", "the", "return", "call", "." ]
8237e860a6acd738122a8af58e05df81475c6610
https://github.com/superbrave/coding-standards/blob/8237e860a6acd738122a8af58e05df81475c6610/Superbrave/Sniffs/Commenting/FunctionCommentSniff.php#L49-L104
8,037
superbrave/coding-standards
Superbrave/Sniffs/Commenting/FunctionCommentSniff.php
FunctionCommentSniff.getDocBlock
protected function getDocBlock(File $phpcsFile, $stackPtr, &$startToken = null, &$endToken = null) { // Fetches the full function docblock $startToken = $phpcsFile->findPrevious(T_DOC_COMMENT_OPEN_TAG, $stackPtr - 1); if ($startToken === false) { return ''; } $end...
php
protected function getDocBlock(File $phpcsFile, $stackPtr, &$startToken = null, &$endToken = null) { // Fetches the full function docblock $startToken = $phpcsFile->findPrevious(T_DOC_COMMENT_OPEN_TAG, $stackPtr - 1); if ($startToken === false) { return ''; } $end...
[ "protected", "function", "getDocBlock", "(", "File", "$", "phpcsFile", ",", "$", "stackPtr", ",", "&", "$", "startToken", "=", "null", ",", "&", "$", "endToken", "=", "null", ")", "{", "// Fetches the full function docblock", "$", "startToken", "=", "$", "ph...
Fetches the docblock as string @param File $phpcsFile The file being scanned. @param int $stackPtr The position of the current token in the stack passed in $tokens. @param int|bool $startToken By reference; the token where the docblock starts @param int|bool $endToken By reference; the token where the do...
[ "Fetches", "the", "docblock", "as", "string" ]
8237e860a6acd738122a8af58e05df81475c6610
https://github.com/superbrave/coding-standards/blob/8237e860a6acd738122a8af58e05df81475c6610/Superbrave/Sniffs/Commenting/FunctionCommentSniff.php#L171-L183
8,038
Arbitracker/VCSWrapper
src/main/php/Arbit/VCSWrapper/Cache/Manager.php
Manager.forceCleanup
public static function forceCleanup() { if (self::$path === null) { throw new \RuntimeException("Cache not initilized."); } self::$metaDataHandler->cleanup(self::$size, self::$cleanupRate); }
php
public static function forceCleanup() { if (self::$path === null) { throw new \RuntimeException("Cache not initilized."); } self::$metaDataHandler->cleanup(self::$size, self::$cleanupRate); }
[ "public", "static", "function", "forceCleanup", "(", ")", "{", "if", "(", "self", "::", "$", "path", "===", "null", ")", "{", "throw", "new", "\\", "RuntimeException", "(", "\"Cache not initilized.\"", ")", ";", "}", "self", "::", "$", "metaDataHandler", "...
Force cache cleanup Force a check, if the cache currently exceeds its given size limit. If this is the case this method will start cleaning up the cache. Depending on the used meta data storage and the size of the cache this operation might take some time. @return void
[ "Force", "cache", "cleanup" ]
64907c0c438600ce67d79a5d17f5155563f2bbf2
https://github.com/Arbitracker/VCSWrapper/blob/64907c0c438600ce67d79a5d17f5155563f2bbf2/src/main/php/Arbit/VCSWrapper/Cache/Manager.php#L227-L234
8,039
jelix/composer-module-setup
lib/IniModifier.php
IniModifier.setValue
public function setValue($name, $value, $section = 0, $key = null) { $foundValue = false; $lastKey = -1; // last key in an array value if (isset($this->content[$section])) { // boolean to erase array values if the new value is not a new item for the array $deleteMode ...
php
public function setValue($name, $value, $section = 0, $key = null) { $foundValue = false; $lastKey = -1; // last key in an array value if (isset($this->content[$section])) { // boolean to erase array values if the new value is not a new item for the array $deleteMode ...
[ "public", "function", "setValue", "(", "$", "name", ",", "$", "value", ",", "$", "section", "=", "0", ",", "$", "key", "=", "null", ")", "{", "$", "foundValue", "=", "false", ";", "$", "lastKey", "=", "-", "1", ";", "// last key in an array value", "...
modify an option in the ini file. If the option doesn't exist, it is created. @param string $name the name of the option to modify @param string $value the new value @param string $section the section where to set the item. 0 is the global section @param int $key for option which is an item of array, the k...
[ "modify", "an", "option", "in", "the", "ini", "file", ".", "If", "the", "option", "doesn", "t", "exist", "it", "is", "created", "." ]
0ee2e05a162caa532ce63c7fd12d421144533c37
https://github.com/jelix/composer-module-setup/blob/0ee2e05a162caa532ce63c7fd12d421144533c37/lib/IniModifier.php#L162-L226
8,040
jelix/composer-module-setup
lib/IniModifier.php
IniModifier.setValues
public function setValues($values, $section = 0) { foreach ($values as $name => $val) { if (is_array($val)) { // let's ignore key values, we don't want them $i = 0; foreach ($val as $arval) { $this->setValue($name, $arval, $sect...
php
public function setValues($values, $section = 0) { foreach ($values as $name => $val) { if (is_array($val)) { // let's ignore key values, we don't want them $i = 0; foreach ($val as $arval) { $this->setValue($name, $arval, $sect...
[ "public", "function", "setValues", "(", "$", "values", ",", "$", "section", "=", "0", ")", "{", "foreach", "(", "$", "values", "as", "$", "name", "=>", "$", "val", ")", "{", "if", "(", "is_array", "(", "$", "val", ")", ")", "{", "// let's ignore ke...
modify several options in the ini file. @param array $value associated array with key=>value @param string $section the section where to set the item. 0 is the global section
[ "modify", "several", "options", "in", "the", "ini", "file", "." ]
0ee2e05a162caa532ce63c7fd12d421144533c37
https://github.com/jelix/composer-module-setup/blob/0ee2e05a162caa532ce63c7fd12d421144533c37/lib/IniModifier.php#L234-L247
8,041
jelix/composer-module-setup
lib/IniModifier.php
IniModifier.getValue
public function getValue($name, $section = 0, $key = null) { if (!isset($this->content[$section])) { return; } $arrayValue = array(); $isArray = false; foreach ($this->content[$section] as $k => $item) { if (($item[0] != self::TK_VALUE && $item[0] != s...
php
public function getValue($name, $section = 0, $key = null) { if (!isset($this->content[$section])) { return; } $arrayValue = array(); $isArray = false; foreach ($this->content[$section] as $k => $item) { if (($item[0] != self::TK_VALUE && $item[0] != s...
[ "public", "function", "getValue", "(", "$", "name", ",", "$", "section", "=", "0", ",", "$", "key", "=", "null", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "content", "[", "$", "section", "]", ")", ")", "{", "return", ";", "}", ...
return the value of an option in the ini file. If the option doesn't exist, it returns null. @param string $name the name of the option to retrieve @param string $section the section where the option is. 0 is the global section @param int $key for option which is an item of array, the key in the array @retu...
[ "return", "the", "value", "of", "an", "option", "in", "the", "ini", "file", ".", "If", "the", "option", "doesn", "t", "exist", "it", "returns", "null", "." ]
0ee2e05a162caa532ce63c7fd12d421144533c37
https://github.com/jelix/composer-module-setup/blob/0ee2e05a162caa532ce63c7fd12d421144533c37/lib/IniModifier.php#L389-L430
8,042
jelix/composer-module-setup
lib/IniModifier.php
IniModifier.getValues
public function getValues($section = 0) { if (!isset($this->content[$section])) { return array(); } $values = array(); foreach ($this->content[$section] as $k => $item) { if ($item[0] != self::TK_VALUE && $item[0] != self::TK_ARR_VALUE) { conti...
php
public function getValues($section = 0) { if (!isset($this->content[$section])) { return array(); } $values = array(); foreach ($this->content[$section] as $k => $item) { if ($item[0] != self::TK_VALUE && $item[0] != self::TK_ARR_VALUE) { conti...
[ "public", "function", "getValues", "(", "$", "section", "=", "0", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "content", "[", "$", "section", "]", ")", ")", "{", "return", "array", "(", ")", ";", "}", "$", "values", "=", "array", ...
return all values of a section in the ini file. @param string $section the section from wich we want values. 0 is the global section @return array the list of values, $key=>$value
[ "return", "all", "values", "of", "a", "section", "in", "the", "ini", "file", "." ]
0ee2e05a162caa532ce63c7fd12d421144533c37
https://github.com/jelix/composer-module-setup/blob/0ee2e05a162caa532ce63c7fd12d421144533c37/lib/IniModifier.php#L439-L470
8,043
jelix/composer-module-setup
lib/IniModifier.php
IniModifier.save
public function save($chmod = null) { if ($this->modified) { if (false === @file_put_contents($this->filename, $this->generateIni())) { throw new \Exception('Impossible to write into '.$this->filename); } elseif ($chmod) { chmod($this->filename, $chmod...
php
public function save($chmod = null) { if ($this->modified) { if (false === @file_put_contents($this->filename, $this->generateIni())) { throw new \Exception('Impossible to write into '.$this->filename); } elseif ($chmod) { chmod($this->filename, $chmod...
[ "public", "function", "save", "(", "$", "chmod", "=", "null", ")", "{", "if", "(", "$", "this", "->", "modified", ")", "{", "if", "(", "false", "===", "@", "file_put_contents", "(", "$", "this", "->", "filename", ",", "$", "this", "->", "generateIni"...
save the ini file.
[ "save", "the", "ini", "file", "." ]
0ee2e05a162caa532ce63c7fd12d421144533c37
https://github.com/jelix/composer-module-setup/blob/0ee2e05a162caa532ce63c7fd12d421144533c37/lib/IniModifier.php#L475-L485
8,044
laravel-commode/common
src/LaravelCommode/Common/Controllers/CommodeController.php
CommodeController.checkParametersResolving
private function checkParametersResolving($method, array $params = []) { if (!$this->resolveMethods) { return $params; } return app()->make(ServiceShortCuts::RESOLVER_SERVICE)->resolveMethodParameters($this, $method, $params); }
php
private function checkParametersResolving($method, array $params = []) { if (!$this->resolveMethods) { return $params; } return app()->make(ServiceShortCuts::RESOLVER_SERVICE)->resolveMethodParameters($this, $method, $params); }
[ "private", "function", "checkParametersResolving", "(", "$", "method", ",", "array", "$", "params", "=", "[", "]", ")", "{", "if", "(", "!", "$", "this", "->", "resolveMethods", ")", "{", "return", "$", "params", ";", "}", "return", "app", "(", ")", ...
Determines resolving is enabled. If it's enabled then it returns method resolved parameters, otherwise it returns parameters as they are. @param string $method Method name. @param array $params Array of known parameters. @return mixed
[ "Determines", "resolving", "is", "enabled", ".", "If", "it", "s", "enabled", "then", "it", "returns", "method", "resolved", "parameters", "otherwise", "it", "returns", "parameters", "as", "they", "are", "." ]
5c9289c3ce5bbd934281c4ac7537657d32c5a9ec
https://github.com/laravel-commode/common/blob/5c9289c3ce5bbd934281c4ac7537657d32c5a9ec/src/LaravelCommode/Common/Controllers/CommodeController.php#L41-L48
8,045
laravel-commode/common
src/LaravelCommode/Common/Controllers/CommodeController.php
CommodeController.callAction
public function callAction($method, array $parameters = []) { $isAjax = app()->make('request')->ajax(); $method = $this->checkAjaxMethod($method, $isAjax); $parameters = $this->checkParametersResolving($method, $parameters); return parent::callAction($method, $parameters); }
php
public function callAction($method, array $parameters = []) { $isAjax = app()->make('request')->ajax(); $method = $this->checkAjaxMethod($method, $isAjax); $parameters = $this->checkParametersResolving($method, $parameters); return parent::callAction($method, $parameters); }
[ "public", "function", "callAction", "(", "$", "method", ",", "array", "$", "parameters", "=", "[", "]", ")", "{", "$", "isAjax", "=", "app", "(", ")", "->", "make", "(", "'request'", ")", "->", "ajax", "(", ")", ";", "$", "method", "=", "$", "thi...
Calls controller action. @param string $method @param array $parameters @return mixed
[ "Calls", "controller", "action", "." ]
5c9289c3ce5bbd934281c4ac7537657d32c5a9ec
https://github.com/laravel-commode/common/blob/5c9289c3ce5bbd934281c4ac7537657d32c5a9ec/src/LaravelCommode/Common/Controllers/CommodeController.php#L75-L83
8,046
webbuilders-group/silverstripe-kapost-bridge
code/model/KapostConversionHistory.php
KapostConversionHistory.getDestinationLink
public function getDestinationLink() { $destinationType=$this->DestinationType; if(!empty($destinationType) && class_exists($destinationType) && is_subclass_of($destinationType, 'DataObject')) { $dest=$destinationType::get()->byID($this->DestinationID); if(!empty($dest) && $dest!...
php
public function getDestinationLink() { $destinationType=$this->DestinationType; if(!empty($destinationType) && class_exists($destinationType) && is_subclass_of($destinationType, 'DataObject')) { $dest=$destinationType::get()->byID($this->DestinationID); if(!empty($dest) && $dest!...
[ "public", "function", "getDestinationLink", "(", ")", "{", "$", "destinationType", "=", "$", "this", "->", "DestinationType", ";", "if", "(", "!", "empty", "(", "$", "destinationType", ")", "&&", "class_exists", "(", "$", "destinationType", ")", "&&", "is_su...
Gets the link to the desination in the cms @return string Relative link to the destination page
[ "Gets", "the", "link", "to", "the", "desination", "in", "the", "cms" ]
718f498cad0eec764d19c9081404b2a0c8f44d71
https://github.com/webbuilders-group/silverstripe-kapost-bridge/blob/718f498cad0eec764d19c9081404b2a0c8f44d71/code/model/KapostConversionHistory.php#L134-L150
8,047
webbuilders-group/silverstripe-kapost-bridge
code/model/KapostConversionHistory.php
KapostConversionHistory.getDestinationTypeNice
public function getDestinationTypeNice() { $className=$this->DestinationType; if(class_exists($className)) { $sng=singleton($className); if(method_exists($sng, 'i18n_singular_name')) { return $sng->i18n_singular_name(); }else if(method_exists($sng, 'si...
php
public function getDestinationTypeNice() { $className=$this->DestinationType; if(class_exists($className)) { $sng=singleton($className); if(method_exists($sng, 'i18n_singular_name')) { return $sng->i18n_singular_name(); }else if(method_exists($sng, 'si...
[ "public", "function", "getDestinationTypeNice", "(", ")", "{", "$", "className", "=", "$", "this", "->", "DestinationType", ";", "if", "(", "class_exists", "(", "$", "className", ")", ")", "{", "$", "sng", "=", "singleton", "(", "$", "className", ")", ";...
Gets the singular name of the destination type or just returs what was stored for the destination type if the class does not have one of i18n_singular_name or singular_name or the class does not exist @return string
[ "Gets", "the", "singular", "name", "of", "the", "destination", "type", "or", "just", "returs", "what", "was", "stored", "for", "the", "destination", "type", "if", "the", "class", "does", "not", "have", "one", "of", "i18n_singular_name", "or", "singular_name", ...
718f498cad0eec764d19c9081404b2a0c8f44d71
https://github.com/webbuilders-group/silverstripe-kapost-bridge/blob/718f498cad0eec764d19c9081404b2a0c8f44d71/code/model/KapostConversionHistory.php#L169-L181
8,048
webbuilders-group/silverstripe-kapost-bridge
code/model/KapostConversionHistory.php
KapostConversionHistory.CMSEditLink
public function CMSEditLink() { return Controller::join_links(LeftAndMain::config()->url_base, KapostAdmin::config()->url_segment, 'KapostConversionHistory/EditForm/field/KapostConversionHistory/item', $this->ID, 'edit'); }
php
public function CMSEditLink() { return Controller::join_links(LeftAndMain::config()->url_base, KapostAdmin::config()->url_segment, 'KapostConversionHistory/EditForm/field/KapostConversionHistory/item', $this->ID, 'edit'); }
[ "public", "function", "CMSEditLink", "(", ")", "{", "return", "Controller", "::", "join_links", "(", "LeftAndMain", "::", "config", "(", ")", "->", "url_base", ",", "KapostAdmin", "::", "config", "(", ")", "->", "url_segment", ",", "'KapostConversionHistory/Edit...
Gets the edit link for this conversion history record @return string
[ "Gets", "the", "edit", "link", "for", "this", "conversion", "history", "record" ]
718f498cad0eec764d19c9081404b2a0c8f44d71
https://github.com/webbuilders-group/silverstripe-kapost-bridge/blob/718f498cad0eec764d19c9081404b2a0c8f44d71/code/model/KapostConversionHistory.php#L201-L203
8,049
webbuilders-group/silverstripe-kapost-bridge
code/model/KapostConversionHistory.php
KapostConversionHistory.onAfterWrite
protected function onAfterWrite() { parent::onAfterWrite(); $records=KapostConversionHistory::get()->filter('Created:LessThan', date('Y-m-d H:i:s', strtotime('-'.self::config()->expires_days.' days'))); if($records->count()>0) { foreach($records as $record) { ...
php
protected function onAfterWrite() { parent::onAfterWrite(); $records=KapostConversionHistory::get()->filter('Created:LessThan', date('Y-m-d H:i:s', strtotime('-'.self::config()->expires_days.' days'))); if($records->count()>0) { foreach($records as $record) { ...
[ "protected", "function", "onAfterWrite", "(", ")", "{", "parent", "::", "onAfterWrite", "(", ")", ";", "$", "records", "=", "KapostConversionHistory", "::", "get", "(", ")", "->", "filter", "(", "'Created:LessThan'", ",", "date", "(", "'Y-m-d H:i:s'", ",", "...
Cleans up the conversion history records after X days, after writing to the database where X is defined in the config
[ "Cleans", "up", "the", "conversion", "history", "records", "after", "X", "days", "after", "writing", "to", "the", "database", "where", "X", "is", "defined", "in", "the", "config" ]
718f498cad0eec764d19c9081404b2a0c8f44d71
https://github.com/webbuilders-group/silverstripe-kapost-bridge/blob/718f498cad0eec764d19c9081404b2a0c8f44d71/code/model/KapostConversionHistory.php#L208-L217
8,050
ItinerisLtd/preflight-command
src/ConfigPaths.php
ConfigPaths.mergeAbsPath
public static function mergeAbsPath(array $paths): array { if (defined('ABSPATH')) { $dir = constant('ABSPATH'); $path = trailingslashit($dir) . 'preflight.toml'; $paths[] = normalize_path($path); } return $paths; }
php
public static function mergeAbsPath(array $paths): array { if (defined('ABSPATH')) { $dir = constant('ABSPATH'); $path = trailingslashit($dir) . 'preflight.toml'; $paths[] = normalize_path($path); } return $paths; }
[ "public", "static", "function", "mergeAbsPath", "(", "array", "$", "paths", ")", ":", "array", "{", "if", "(", "defined", "(", "'ABSPATH'", ")", ")", "{", "$", "dir", "=", "constant", "(", "'ABSPATH'", ")", ";", "$", "path", "=", "trailingslashit", "("...
Register preflight.toml under ABSPATH. Used in self::HOOK. @param array $paths The .toml config file paths. @return string[]
[ "Register", "preflight", ".", "toml", "under", "ABSPATH", "." ]
d1c1360ea8d7de0312b5c0c09c9c486949594049
https://github.com/ItinerisLtd/preflight-command/blob/d1c1360ea8d7de0312b5c0c09c9c486949594049/src/ConfigPaths.php#L58-L68
8,051
ItinerisLtd/preflight-command
src/ConfigPaths.php
ConfigPaths.mergePreflightDir
public static function mergePreflightDir(array $paths): array { if (defined('PREFLIGHT_DIR')) { $dir = constant('PREFLIGHT_DIR'); $path = trailingslashit($dir) . 'preflight.toml'; $paths[] = normalize_path($path); } return $paths; }
php
public static function mergePreflightDir(array $paths): array { if (defined('PREFLIGHT_DIR')) { $dir = constant('PREFLIGHT_DIR'); $path = trailingslashit($dir) . 'preflight.toml'; $paths[] = normalize_path($path); } return $paths; }
[ "public", "static", "function", "mergePreflightDir", "(", "array", "$", "paths", ")", ":", "array", "{", "if", "(", "defined", "(", "'PREFLIGHT_DIR'", ")", ")", "{", "$", "dir", "=", "constant", "(", "'PREFLIGHT_DIR'", ")", ";", "$", "path", "=", "traili...
Register preflight.toml under PREFLIGHT_DIR. Used in self::HOOK. @param array $paths The .toml config file paths. @return string[]
[ "Register", "preflight", ".", "toml", "under", "PREFLIGHT_DIR", "." ]
d1c1360ea8d7de0312b5c0c09c9c486949594049
https://github.com/ItinerisLtd/preflight-command/blob/d1c1360ea8d7de0312b5c0c09c9c486949594049/src/ConfigPaths.php#L79-L89
8,052
cityware/city-snmp
src/MIBS/Routes.php
Routes.routeProto
public function routeProto($translate = false) { $s = $this->getSNMP()->subOidWalkLong(self::OID_ROUTE_ENTRY_PROTO, 12, 24); if (!$translate) return $s; return $this->getSNMP()->translate($s, self::$ROUTE_ENTRY_PROTOS); }
php
public function routeProto($translate = false) { $s = $this->getSNMP()->subOidWalkLong(self::OID_ROUTE_ENTRY_PROTO, 12, 24); if (!$translate) return $s; return $this->getSNMP()->translate($s, self::$ROUTE_ENTRY_PROTOS); }
[ "public", "function", "routeProto", "(", "$", "translate", "=", "false", ")", "{", "$", "s", "=", "$", "this", "->", "getSNMP", "(", ")", "->", "subOidWalkLong", "(", "self", "::", "OID_ROUTE_ENTRY_PROTO", ",", "12", ",", "24", ")", ";", "if", "(", "...
Returns the route protocol. > "The routing mechanism via which this route was learned. Inclusion > of values for gateway rout-ing protocols is not intended to imply > that hosts should support those protocols." @param bool $translate If true, use the `$ROUTE_ENTRY_PROTOS` array to return textual representation @retur...
[ "Returns", "the", "route", "protocol", "." ]
831b7485b6c932a84f081d5ceeb9c5f4e7a8641d
https://github.com/cityware/city-snmp/blob/831b7485b6c932a84f081d5ceeb9c5f4e7a8641d/src/MIBS/Routes.php#L282-L289
8,053
cityware/city-snmp
src/MIBS/Routes.php
Routes.routeStatus
public function routeStatus($translate = false) { $s = $this->getSNMP()->subOidWalkLong(self::OID_ROUTE_ENTRY_STATUS, 12, 24); if (!$translate) return $s; return $this->getSNMP()->translate($s, self::$ROUTE_STATUS_TYPES); }
php
public function routeStatus($translate = false) { $s = $this->getSNMP()->subOidWalkLong(self::OID_ROUTE_ENTRY_STATUS, 12, 24); if (!$translate) return $s; return $this->getSNMP()->translate($s, self::$ROUTE_STATUS_TYPES); }
[ "public", "function", "routeStatus", "(", "$", "translate", "=", "false", ")", "{", "$", "s", "=", "$", "this", "->", "getSNMP", "(", ")", "->", "subOidWalkLong", "(", "self", "::", "OID_ROUTE_ENTRY_STATUS", ",", "12", ",", "24", ")", ";", "if", "(", ...
Returns the route status > "The row status variable, used according to row installation and > removal conventions." @return array The routes installation and removal status
[ "Returns", "the", "route", "status" ]
831b7485b6c932a84f081d5ceeb9c5f4e7a8641d
https://github.com/cityware/city-snmp/blob/831b7485b6c932a84f081d5ceeb9c5f4e7a8641d/src/MIBS/Routes.php#L434-L441
8,054
cityware/city-snmp
src/MIBS/Routes.php
Routes.routeDetails
public function routeDetails($translate = false) { $fetchList = [ 'routeDest' => 'destination', 'routeMask' => 'mask', 'routeTos' => 'TOS', 'routeNextHop' => 'nextHop', 'routeIfIndex' => 'ifIndex', 'routeType' => 'type', 'routeP...
php
public function routeDetails($translate = false) { $fetchList = [ 'routeDest' => 'destination', 'routeMask' => 'mask', 'routeTos' => 'TOS', 'routeNextHop' => 'nextHop', 'routeIfIndex' => 'ifIndex', 'routeType' => 'type', 'routeP...
[ "public", "function", "routeDetails", "(", "$", "translate", "=", "false", ")", "{", "$", "fetchList", "=", "[", "'routeDest'", "=>", "'destination'", ",", "'routeMask'", "=>", "'mask'", ",", "'routeTos'", "=>", "'TOS'", ",", "'routeNextHop'", "=>", "'nextHop'...
Utility function to gather all routes into a single array. @param bool $translate Where a called function supports translation, if true then translate @return array Array of routes
[ "Utility", "function", "to", "gather", "all", "routes", "into", "a", "single", "array", "." ]
831b7485b6c932a84f081d5ceeb9c5f4e7a8641d
https://github.com/cityware/city-snmp/blob/831b7485b6c932a84f081d5ceeb9c5f4e7a8641d/src/MIBS/Routes.php#L448-L479
8,055
open-orchestra/open-orchestra-front-bundle
FrontBundle/Twig/GetSpecialPageExtension.php
GetSpecialPageExtension.loadSpecialPages
protected function loadSpecialPages() { $language = $this->siteManager->getSiteLanguage(); $siteId = $this->siteManager->getSiteId(); $this->specialPages = $this->nodeRepository->findAllPublishedSpecialPage($language, $siteId); }
php
protected function loadSpecialPages() { $language = $this->siteManager->getSiteLanguage(); $siteId = $this->siteManager->getSiteId(); $this->specialPages = $this->nodeRepository->findAllPublishedSpecialPage($language, $siteId); }
[ "protected", "function", "loadSpecialPages", "(", ")", "{", "$", "language", "=", "$", "this", "->", "siteManager", "->", "getSiteLanguage", "(", ")", ";", "$", "siteId", "=", "$", "this", "->", "siteManager", "->", "getSiteId", "(", ")", ";", "$", "this...
Load special pages
[ "Load", "special", "pages" ]
3c2cf3998af03e7a69fb6475b71d9c7d65b058bb
https://github.com/open-orchestra/open-orchestra-front-bundle/blob/3c2cf3998af03e7a69fb6475b71d9c7d65b058bb/FrontBundle/Twig/GetSpecialPageExtension.php#L69-L74
8,056
chemel/http-headers
src/HttpHeaders.php
HttpHeaders.getFirefox
public function getFirefox($format = self::FORMAT_GUZZLE, $platfom = 'win7', $lang = 'en') { return $this->getHeaders($platfom.'-firefox-'.$lang, $format); }
php
public function getFirefox($format = self::FORMAT_GUZZLE, $platfom = 'win7', $lang = 'en') { return $this->getHeaders($platfom.'-firefox-'.$lang, $format); }
[ "public", "function", "getFirefox", "(", "$", "format", "=", "self", "::", "FORMAT_GUZZLE", ",", "$", "platfom", "=", "'win7'", ",", "$", "lang", "=", "'en'", ")", "{", "return", "$", "this", "->", "getHeaders", "(", "$", "platfom", ".", "'-firefox-'", ...
Get Firefox headers @param int format @param string platfom @param string lang @return array headers
[ "Get", "Firefox", "headers" ]
0011f68145eccf38c80393385805b8f0868edd07
https://github.com/chemel/http-headers/blob/0011f68145eccf38c80393385805b8f0868edd07/src/HttpHeaders.php#L62-L65
8,057
chemel/http-headers
src/HttpHeaders.php
HttpHeaders.getChrome
public function getChrome($format = self::FORMAT_GUZZLE, $platfom = 'win7', $lang = 'en') { return $this->getHeaders($platfom.'-chrome-'.$lang, $format); }
php
public function getChrome($format = self::FORMAT_GUZZLE, $platfom = 'win7', $lang = 'en') { return $this->getHeaders($platfom.'-chrome-'.$lang, $format); }
[ "public", "function", "getChrome", "(", "$", "format", "=", "self", "::", "FORMAT_GUZZLE", ",", "$", "platfom", "=", "'win7'", ",", "$", "lang", "=", "'en'", ")", "{", "return", "$", "this", "->", "getHeaders", "(", "$", "platfom", ".", "'-chrome-'", "...
Get Chrome headers @param int format @param string platfom @param string lang @return array headers
[ "Get", "Chrome", "headers" ]
0011f68145eccf38c80393385805b8f0868edd07
https://github.com/chemel/http-headers/blob/0011f68145eccf38c80393385805b8f0868edd07/src/HttpHeaders.php#L76-L79
8,058
devbr/pack-blog
Page.php
Page.tmp
function tmp() { //$xlog = new Model\Xlog; //$xlog->decodeAgent(); //Fazendo login //Lib\User::this()->login('admin', 'admin#123'); //Lib\User::this()->setCriptoCookie(); //Lib\User::this()->unsetCriptoCookie(); $user = new Lib\User(); $user->login...
php
function tmp() { //$xlog = new Model\Xlog; //$xlog->decodeAgent(); //Fazendo login //Lib\User::this()->login('admin', 'admin#123'); //Lib\User::this()->setCriptoCookie(); //Lib\User::this()->unsetCriptoCookie(); $user = new Lib\User(); $user->login...
[ "function", "tmp", "(", ")", "{", "//$xlog = new Model\\Xlog;", "//$xlog->decodeAgent();", "//Fazendo login", "//Lib\\User::this()->login('admin', 'admin#123');", "//Lib\\User::this()->setCriptoCookie();", "//Lib\\User::this()->unsetCriptoCookie();", "$", "user", "=", "new", "Lib", "...
TEMP - de le te me
[ "TEMP", "-", "de", "le", "te", "me" ]
4693e36521ee3d08077f0db3e013afb99785cc9d
https://github.com/devbr/pack-blog/blob/4693e36521ee3d08077f0db3e013afb99785cc9d/Page.php#L264-L305
8,059
zepi/turbo-base
Zepi/DataSource/Core/src/Entity/DataRequest.php
DataRequest.hasFilter
public function hasFilter($name) { foreach ($this->filters as $filter) { if ($filter->getFieldName() === $name) { return true; } } return false; }
php
public function hasFilter($name) { foreach ($this->filters as $filter) { if ($filter->getFieldName() === $name) { return true; } } return false; }
[ "public", "function", "hasFilter", "(", "$", "name", ")", "{", "foreach", "(", "$", "this", "->", "filters", "as", "$", "filter", ")", "{", "if", "(", "$", "filter", "->", "getFieldName", "(", ")", "===", "$", "name", ")", "{", "return", "true", ";...
Returns true if the request has a filter for the given name @access public @param string $name @return boolean
[ "Returns", "true", "if", "the", "request", "has", "a", "filter", "for", "the", "given", "name" ]
9a36d8c7649317f55f91b2adf386bd1f04ec02a3
https://github.com/zepi/turbo-base/blob/9a36d8c7649317f55f91b2adf386bd1f04ec02a3/Zepi/DataSource/Core/src/Entity/DataRequest.php#L131-L140
8,060
zepi/turbo-base
Zepi/DataSource/Core/src/Entity/DataRequest.php
DataRequest.getFilter
public function getFilter($name) { foreach ($this->filters as $filter) { if ($filter->getFieldName() === $name) { return $filter; } } return false; }
php
public function getFilter($name) { foreach ($this->filters as $filter) { if ($filter->getFieldName() === $name) { return $filter; } } return false; }
[ "public", "function", "getFilter", "(", "$", "name", ")", "{", "foreach", "(", "$", "this", "->", "filters", "as", "$", "filter", ")", "{", "if", "(", "$", "filter", "->", "getFieldName", "(", ")", "===", "$", "name", ")", "{", "return", "$", "filt...
Returns the Filter object for the given key @access public @param string $name @return false|\Zepi\DataSource\Core\Entity\Filter
[ "Returns", "the", "Filter", "object", "for", "the", "given", "key" ]
9a36d8c7649317f55f91b2adf386bd1f04ec02a3
https://github.com/zepi/turbo-base/blob/9a36d8c7649317f55f91b2adf386bd1f04ec02a3/Zepi/DataSource/Core/src/Entity/DataRequest.php#L149-L158
8,061
zepi/turbo-base
Zepi/DataSource/Core/src/Entity/DataRequest.php
DataRequest.setPage
public function setPage($page) { $this->page = intval($page); if ($this->page == 0) { $this->page = 1; } }
php
public function setPage($page) { $this->page = intval($page); if ($this->page == 0) { $this->page = 1; } }
[ "public", "function", "setPage", "(", "$", "page", ")", "{", "$", "this", "->", "page", "=", "intval", "(", "$", "page", ")", ";", "if", "(", "$", "this", "->", "page", "==", "0", ")", "{", "$", "this", "->", "page", "=", "1", ";", "}", "}" ]
Sets the number of the loaded page @access public @param integer $page
[ "Sets", "the", "number", "of", "the", "loaded", "page" ]
9a36d8c7649317f55f91b2adf386bd1f04ec02a3
https://github.com/zepi/turbo-base/blob/9a36d8c7649317f55f91b2adf386bd1f04ec02a3/Zepi/DataSource/Core/src/Entity/DataRequest.php#L187-L194
8,062
zepi/turbo-base
Zepi/DataSource/Core/src/Entity/DataRequest.php
DataRequest.hasRange
public function hasRange() { return ($this->getOffset() !== false && $this->getOffset() >= 0 && $this->getNumberOfEntries() !== false && $this->getNumberOfEntries() > 0); }
php
public function hasRange() { return ($this->getOffset() !== false && $this->getOffset() >= 0 && $this->getNumberOfEntries() !== false && $this->getNumberOfEntries() > 0); }
[ "public", "function", "hasRange", "(", ")", "{", "return", "(", "$", "this", "->", "getOffset", "(", ")", "!==", "false", "&&", "$", "this", "->", "getOffset", "(", ")", ">=", "0", "&&", "$", "this", "->", "getNumberOfEntries", "(", ")", "!==", "fals...
Returns true if only a range of the result is requested @return boolean
[ "Returns", "true", "if", "only", "a", "range", "of", "the", "result", "is", "requested" ]
9a36d8c7649317f55f91b2adf386bd1f04ec02a3
https://github.com/zepi/turbo-base/blob/9a36d8c7649317f55f91b2adf386bd1f04ec02a3/Zepi/DataSource/Core/src/Entity/DataRequest.php#L238-L241
8,063
joverthegrey/singleton
src/Singleton.php
Singleton.getInstance
public static function getInstance() { // late-static-bound class name $classname = get_called_class(); if (!isset(self::$instances[$classname])) { self::$instances[$classname] = new static; } return self::$instances[$classname]; }
php
public static function getInstance() { // late-static-bound class name $classname = get_called_class(); if (!isset(self::$instances[$classname])) { self::$instances[$classname] = new static; } return self::$instances[$classname]; }
[ "public", "static", "function", "getInstance", "(", ")", "{", "// late-static-bound class name", "$", "classname", "=", "get_called_class", "(", ")", ";", "if", "(", "!", "isset", "(", "self", "::", "$", "instances", "[", "$", "classname", "]", ")", ")", "...
return an instance of the called class @return mixed
[ "return", "an", "instance", "of", "the", "called", "class" ]
069afddc5ed766f7613477b873de0f31f3b6ab92
https://github.com/joverthegrey/singleton/blob/069afddc5ed766f7613477b873de0f31f3b6ab92/src/Singleton.php#L40-L48
8,064
tlumx/tlumx-view
src/TemplatesManager.php
TemplatesManager.addTemplatePath
public function addTemplatePath($namespace, $path) { if (!is_string($namespace) || !is_string($path) || empty($namespace) || empty($path)) { throw new \InvalidArgumentException('Template namespace and path must be a not empty string'); } $this->paths[$namespace] = $this->normali...
php
public function addTemplatePath($namespace, $path) { if (!is_string($namespace) || !is_string($path) || empty($namespace) || empty($path)) { throw new \InvalidArgumentException('Template namespace and path must be a not empty string'); } $this->paths[$namespace] = $this->normali...
[ "public", "function", "addTemplatePath", "(", "$", "namespace", ",", "$", "path", ")", "{", "if", "(", "!", "is_string", "(", "$", "namespace", ")", "||", "!", "is_string", "(", "$", "path", ")", "||", "empty", "(", "$", "namespace", ")", "||", "empt...
Add template path @param string $namespace @param string $path @throws \InvalidArgumentException
[ "Add", "template", "path" ]
9f784eb8092ac2971e05cb478849ade6d485bbfa
https://github.com/tlumx/tlumx-view/blob/9f784eb8092ac2971e05cb478849ade6d485bbfa/src/TemplatesManager.php#L62-L69
8,065
tlumx/tlumx-view
src/TemplatesManager.php
TemplatesManager.getTemplatePath
public function getTemplatePath($namespace) { if (!$this->hasTemplatePath($namespace)) { throw new \RuntimeException("Path with namespace \"".$namespace."\" is not exist"); } $path = $this->paths[$namespace]; if (!is_dir($path)) { throw new \RuntimeException...
php
public function getTemplatePath($namespace) { if (!$this->hasTemplatePath($namespace)) { throw new \RuntimeException("Path with namespace \"".$namespace."\" is not exist"); } $path = $this->paths[$namespace]; if (!is_dir($path)) { throw new \RuntimeException...
[ "public", "function", "getTemplatePath", "(", "$", "namespace", ")", "{", "if", "(", "!", "$", "this", "->", "hasTemplatePath", "(", "$", "namespace", ")", ")", "{", "throw", "new", "\\", "RuntimeException", "(", "\"Path with namespace \\\"\"", ".", "$", "na...
Get themplate path by namespace @param string $namespace @return string @throws \RuntimeException
[ "Get", "themplate", "path", "by", "namespace" ]
9f784eb8092ac2971e05cb478849ade6d485bbfa
https://github.com/tlumx/tlumx-view/blob/9f784eb8092ac2971e05cb478849ade6d485bbfa/src/TemplatesManager.php#L89-L102
8,066
tlumx/tlumx-view
src/TemplatesManager.php
TemplatesManager.addTemplate
public function addTemplate($name, $filename) { if (!is_string($name) || !is_string($filename) || empty($name) || empty($filename)) { throw new \InvalidArgumentException('Template name and filename must be a not empty string'); } $this->templateMap[$name] = $filename; }
php
public function addTemplate($name, $filename) { if (!is_string($name) || !is_string($filename) || empty($name) || empty($filename)) { throw new \InvalidArgumentException('Template name and filename must be a not empty string'); } $this->templateMap[$name] = $filename; }
[ "public", "function", "addTemplate", "(", "$", "name", ",", "$", "filename", ")", "{", "if", "(", "!", "is_string", "(", "$", "name", ")", "||", "!", "is_string", "(", "$", "filename", ")", "||", "empty", "(", "$", "name", ")", "||", "empty", "(", ...
Add template to the map @param string $name @param string $filename @throws \InvalidArgumentException
[ "Add", "template", "to", "the", "map" ]
9f784eb8092ac2971e05cb478849ade6d485bbfa
https://github.com/tlumx/tlumx-view/blob/9f784eb8092ac2971e05cb478849ade6d485bbfa/src/TemplatesManager.php#L142-L149
8,067
tlumx/tlumx-view
src/TemplatesManager.php
TemplatesManager.getTemplate
public function getTemplate($name) { if (!$this->hasTemplate($name)) { throw new \RuntimeException("Template with name \"".$name."\" is not exist"); } $filename = $this->templateMap[$name]; if (!file_exists($filename)) { throw new \RuntimeException("Invalid ...
php
public function getTemplate($name) { if (!$this->hasTemplate($name)) { throw new \RuntimeException("Template with name \"".$name."\" is not exist"); } $filename = $this->templateMap[$name]; if (!file_exists($filename)) { throw new \RuntimeException("Invalid ...
[ "public", "function", "getTemplate", "(", "$", "name", ")", "{", "if", "(", "!", "$", "this", "->", "hasTemplate", "(", "$", "name", ")", ")", "{", "throw", "new", "\\", "RuntimeException", "(", "\"Template with name \\\"\"", ".", "$", "name", ".", "\"\\...
Get template filename @param string $name @return string @throws \RuntimeException
[ "Get", "template", "filename" ]
9f784eb8092ac2971e05cb478849ade6d485bbfa
https://github.com/tlumx/tlumx-view/blob/9f784eb8092ac2971e05cb478849ade6d485bbfa/src/TemplatesManager.php#L169-L182
8,068
niconoe-/asserts
src/Asserts/Categories/AssertCountableTrait.php
AssertCountableTrait.assertEmpty
public static function assertEmpty($countableElement, Throwable $exception): bool { static::makeAssertion(0 === \count($countableElement), $exception); return true; }
php
public static function assertEmpty($countableElement, Throwable $exception): bool { static::makeAssertion(0 === \count($countableElement), $exception); return true; }
[ "public", "static", "function", "assertEmpty", "(", "$", "countableElement", ",", "Throwable", "$", "exception", ")", ":", "bool", "{", "static", "::", "makeAssertion", "(", "0", "===", "\\", "count", "(", "$", "countableElement", ")", ",", "$", "exception",...
Asserts that the given array is empty. @param array|\Countable $countableElement The array or the countable object to assert its emptiness. @param Throwable $exception The exception to throw if the assertion fails. @return bool
[ "Asserts", "that", "the", "given", "array", "is", "empty", "." ]
a33dd3fb8983ae6965533c8ff4ff8380367b561d
https://github.com/niconoe-/asserts/blob/a33dd3fb8983ae6965533c8ff4ff8380367b561d/src/Asserts/Categories/AssertCountableTrait.php#L26-L30
8,069
niconoe-/asserts
src/Asserts/Categories/AssertCountableTrait.php
AssertCountableTrait.assertNotEmpty
public static function assertNotEmpty($countableElement, Throwable $exception): bool { static::makeAssertion(0 !== \count($countableElement), $exception); return true; }
php
public static function assertNotEmpty($countableElement, Throwable $exception): bool { static::makeAssertion(0 !== \count($countableElement), $exception); return true; }
[ "public", "static", "function", "assertNotEmpty", "(", "$", "countableElement", ",", "Throwable", "$", "exception", ")", ":", "bool", "{", "static", "::", "makeAssertion", "(", "0", "!==", "\\", "count", "(", "$", "countableElement", ")", ",", "$", "exceptio...
Asserts that the given array is not empty. @param array|\Countable $countableElement The array or the countable object to assert its emptiness. @param Throwable $exception The exception to throw if the assertion fails. @return bool
[ "Asserts", "that", "the", "given", "array", "is", "not", "empty", "." ]
a33dd3fb8983ae6965533c8ff4ff8380367b561d
https://github.com/niconoe-/asserts/blob/a33dd3fb8983ae6965533c8ff4ff8380367b561d/src/Asserts/Categories/AssertCountableTrait.php#L39-L43
8,070
niconoe-/asserts
src/Asserts/Categories/AssertCountableTrait.php
AssertCountableTrait.assertCount
public static function assertCount($countableElement, int $expected, Throwable $exception): bool { static::makeAssertion(\count($countableElement) === $expected, $exception); return true; }
php
public static function assertCount($countableElement, int $expected, Throwable $exception): bool { static::makeAssertion(\count($countableElement) === $expected, $exception); return true; }
[ "public", "static", "function", "assertCount", "(", "$", "countableElement", ",", "int", "$", "expected", ",", "Throwable", "$", "exception", ")", ":", "bool", "{", "static", "::", "makeAssertion", "(", "\\", "count", "(", "$", "countableElement", ")", "==="...
Asserts that the given array contains the given number of elements. @param array|\Countable $countableElement The array or the countable object to count its content. @param int $expected The number of expected elements. @param Throwable $exception The exception to throw if the assertion fails. @return bool
[ "Asserts", "that", "the", "given", "array", "contains", "the", "given", "number", "of", "elements", "." ]
a33dd3fb8983ae6965533c8ff4ff8380367b561d
https://github.com/niconoe-/asserts/blob/a33dd3fb8983ae6965533c8ff4ff8380367b561d/src/Asserts/Categories/AssertCountableTrait.php#L53-L57
8,071
niconoe-/asserts
src/Asserts/Categories/AssertCountableTrait.php
AssertCountableTrait.assertNotCount
public static function assertNotCount($countableElement, int $notExpected, Throwable $exception): bool { static::makeAssertion(\count($countableElement) !== $notExpected, $exception); return true; }
php
public static function assertNotCount($countableElement, int $notExpected, Throwable $exception): bool { static::makeAssertion(\count($countableElement) !== $notExpected, $exception); return true; }
[ "public", "static", "function", "assertNotCount", "(", "$", "countableElement", ",", "int", "$", "notExpected", ",", "Throwable", "$", "exception", ")", ":", "bool", "{", "static", "::", "makeAssertion", "(", "\\", "count", "(", "$", "countableElement", ")", ...
Asserts that the given array does not contain the given number of elements. @param array|\Countable $countableElement The array or the countable object to count its content. @param int $notExpected The number of not expected elements. @param Throwable $exception The exception to throw if the assertion fails. @return b...
[ "Asserts", "that", "the", "given", "array", "does", "not", "contain", "the", "given", "number", "of", "elements", "." ]
a33dd3fb8983ae6965533c8ff4ff8380367b561d
https://github.com/niconoe-/asserts/blob/a33dd3fb8983ae6965533c8ff4ff8380367b561d/src/Asserts/Categories/AssertCountableTrait.php#L67-L71
8,072
crip-laravel/core
src/Data/RelationInputService.php
RelationInputService.apply
public function apply(Builder $builder, Repository $repository, array $relations = []) { $relations = $this->getRelations($repository, $relations); return $builder->with($relations); }
php
public function apply(Builder $builder, Repository $repository, array $relations = []) { $relations = $this->getRelations($repository, $relations); return $builder->with($relations); }
[ "public", "function", "apply", "(", "Builder", "$", "builder", ",", "Repository", "$", "repository", ",", "array", "$", "relations", "=", "[", "]", ")", "{", "$", "relations", "=", "$", "this", "->", "getRelations", "(", "$", "repository", ",", "$", "r...
Apply eager load relations to query builder @param Builder $builder @param Repository $repository @param array $relations @return Builder
[ "Apply", "eager", "load", "relations", "to", "query", "builder" ]
d58cef97d97fba8b01bec33801452ecbd7c992de
https://github.com/crip-laravel/core/blob/d58cef97d97fba8b01bec33801452ecbd7c992de/src/Data/RelationInputService.php#L35-L40
8,073
crip-laravel/core
src/Data/RelationInputService.php
RelationInputService.getRelations
private function getRelations(Repository $repository, array $relations = []) { // if we have relation array passed, ignore request input if (count($relations) === 0) { $relations = Input::get('with'); if (!is_array($relations)) { $relations = $this->inputServ...
php
private function getRelations(Repository $repository, array $relations = []) { // if we have relation array passed, ignore request input if (count($relations) === 0) { $relations = Input::get('with'); if (!is_array($relations)) { $relations = $this->inputServ...
[ "private", "function", "getRelations", "(", "Repository", "$", "repository", ",", "array", "$", "relations", "=", "[", "]", ")", "{", "// if we have relation array passed, ignore request input", "if", "(", "count", "(", "$", "relations", ")", "===", "0", ")", "{...
Get relation array @param Repository $repository @param array $relations @return array
[ "Get", "relation", "array" ]
d58cef97d97fba8b01bec33801452ecbd7c992de
https://github.com/crip-laravel/core/blob/d58cef97d97fba8b01bec33801452ecbd7c992de/src/Data/RelationInputService.php#L49-L71
8,074
sios13/simox
src/Tag.php
Tag.linkTo
public function linkTo( $path, $text, $is_local_path = true ) { $url = $this->_di->getService( "url" ); if ( $is_local_path ) { $path = $url->get( $path ); } $link = "<a href='$path'>$text</a>"; return $link; }
php
public function linkTo( $path, $text, $is_local_path = true ) { $url = $this->_di->getService( "url" ); if ( $is_local_path ) { $path = $url->get( $path ); } $link = "<a href='$path'>$text</a>"; return $link; }
[ "public", "function", "linkTo", "(", "$", "path", ",", "$", "text", ",", "$", "is_local_path", "=", "true", ")", "{", "$", "url", "=", "$", "this", "->", "_di", "->", "getService", "(", "\"url\"", ")", ";", "if", "(", "$", "is_local_path", ")", "{"...
Creates an HTML anchor tag using the Url Simox service <code> <p>Hello, my name is Simon. Click <?php $this->tag->linkTo( "/blog/", "here" ); ?> to read my blog!</p> <p>Check out my <?php $this->tag->linkTo( "http://www.example.com/", "awesome website", false ); ?>!</p> </code> @param string $path @param string $text...
[ "Creates", "an", "HTML", "anchor", "tag", "using", "the", "Url", "Simox", "service" ]
8be964949ef179aba7eceb3fc6439815a1af2ad2
https://github.com/sios13/simox/blob/8be964949ef179aba7eceb3fc6439815a1af2ad2/src/Tag.php#L88-L100
8,075
railsphp/framework
src/Rails/ActiveRecord/Associations/Associations.php
Associations.associations
public function associations() { if (!$this->associations) { if ($this->getService('rails.config')['use_cache']) { $this->associations = $this->getCachedData(); } else { $this->associations = $this->getAssociationsData(); } } ...
php
public function associations() { if (!$this->associations) { if ($this->getService('rails.config')['use_cache']) { $this->associations = $this->getCachedData(); } else { $this->associations = $this->getAssociationsData(); } } ...
[ "public", "function", "associations", "(", ")", "{", "if", "(", "!", "$", "this", "->", "associations", ")", "{", "if", "(", "$", "this", "->", "getService", "(", "'rails.config'", ")", "[", "'use_cache'", "]", ")", "{", "$", "this", "->", "association...
Get all associations and their options. @return array
[ "Get", "all", "associations", "and", "their", "options", "." ]
2ac9d3e493035dcc68f3c3812423327127327cd5
https://github.com/railsphp/framework/blob/2ac9d3e493035dcc68f3c3812423327127327cd5/src/Rails/ActiveRecord/Associations/Associations.php#L54-L64
8,076
railsphp/framework
src/Rails/ActiveRecord/Associations/Associations.php
Associations.callbacks
public function callbacks() { $dependent = false; $autosave = false; $callbacks = [ 'beforeDestroy' => [], 'beforeSave' => [] ]; foreach ($this->associations() as $data) { switch ($data['type']) { case 'belongsT...
php
public function callbacks() { $dependent = false; $autosave = false; $callbacks = [ 'beforeDestroy' => [], 'beforeSave' => [] ]; foreach ($this->associations() as $data) { switch ($data['type']) { case 'belongsT...
[ "public", "function", "callbacks", "(", ")", "{", "$", "dependent", "=", "false", ";", "$", "autosave", "=", "false", ";", "$", "callbacks", "=", "[", "'beforeDestroy'", "=>", "[", "]", ",", "'beforeSave'", "=>", "[", "]", "]", ";", "foreach", "(", "...
If any of the associations has a 'dependent' option, the before-destroy callback 'alterDependencies' should be called. That method will take care of executing the proper tasks with the dependencies according to the options set. Same with the 'autosave' option. # TODO: Move this info somewhere else? The children's 'aut...
[ "If", "any", "of", "the", "associations", "has", "a", "dependent", "option", "the", "before", "-", "destroy", "callback", "alterDependencies", "should", "be", "called", ".", "That", "method", "will", "take", "care", "of", "executing", "the", "proper", "tasks",...
2ac9d3e493035dcc68f3c3812423327127327cd5
https://github.com/railsphp/framework/blob/2ac9d3e493035dcc68f3c3812423327127327cd5/src/Rails/ActiveRecord/Associations/Associations.php#L133-L179
8,077
rafaelnajera/matcher
Matcher/Matcher.php
Matcher.match
public function match($input) { if ($this->currentState===State::MATCH_FOUND) { return true; } if ($this->noMatch) { return false; } $advancing = true; while ($advancing) { $hasEmpty = false; foreach ($this->states[$thi...
php
public function match($input) { if ($this->currentState===State::MATCH_FOUND) { return true; } if ($this->noMatch) { return false; } $advancing = true; while ($advancing) { $hasEmpty = false; foreach ($this->states[$thi...
[ "public", "function", "match", "(", "$", "input", ")", "{", "if", "(", "$", "this", "->", "currentState", "===", "State", "::", "MATCH_FOUND", ")", "{", "return", "true", ";", "}", "if", "(", "$", "this", "->", "noMatch", ")", "{", "return", "false",...
Processes one input token and changes the state of the pattern accordingly. Returns true if the given input did not cause the pattern go in an unmatched state. @param any $input It can be of any type, the conditions used to build the pattern should know what to do with it. @return boolean
[ "Processes", "one", "input", "token", "and", "changes", "the", "state", "of", "the", "pattern", "accordingly", ".", "Returns", "true", "if", "the", "given", "input", "did", "not", "cause", "the", "pattern", "go", "in", "an", "unmatched", "state", "." ]
f8fb4cf5c4969d8ef7b7377384e972fc3ef9e2cf
https://github.com/rafaelnajera/matcher/blob/f8fb4cf5c4969d8ef7b7377384e972fc3ef9e2cf/Matcher/Matcher.php#L124-L160
8,078
rafaelnajera/matcher
Matcher/Matcher.php
Matcher.callCallbacks
private function callCallbacks(int $initialState, int $endState) { if (isset($this->callbacks[$initialState][$endState]) && is_callable($this->callbacks[$initialState][$endState])) { $this->matched = call_user_func($this->callbacks[$initialState][$endState], $this->matched); ...
php
private function callCallbacks(int $initialState, int $endState) { if (isset($this->callbacks[$initialState][$endState]) && is_callable($this->callbacks[$initialState][$endState])) { $this->matched = call_user_func($this->callbacks[$initialState][$endState], $this->matched); ...
[ "private", "function", "callCallbacks", "(", "int", "$", "initialState", ",", "int", "$", "endState", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "callbacks", "[", "$", "initialState", "]", "[", "$", "endState", "]", ")", "&&", "is_callable", ...
Calls callbacks for the given state number @param int $stateNumber
[ "Calls", "callbacks", "for", "the", "given", "state", "number" ]
f8fb4cf5c4969d8ef7b7377384e972fc3ef9e2cf
https://github.com/rafaelnajera/matcher/blob/f8fb4cf5c4969d8ef7b7377384e972fc3ef9e2cf/Matcher/Matcher.php#L190-L196
8,079
lucifurious/kisma
src/Kisma/Core/Utility/FilterInput.php
FilterInput.smart
public static function smart( $value, $emptyValueIsNull = false ) { if ( is_array( $value ) ) { filter_var_array( $value, FILTER_SANITIZE_STRING ); } switch ( getType( $value ) ) { case 'double': case 'float': $_filter = FI...
php
public static function smart( $value, $emptyValueIsNull = false ) { if ( is_array( $value ) ) { filter_var_array( $value, FILTER_SANITIZE_STRING ); } switch ( getType( $value ) ) { case 'double': case 'float': $_filter = FI...
[ "public", "static", "function", "smart", "(", "$", "value", ",", "$", "emptyValueIsNull", "=", "false", ")", "{", "if", "(", "is_array", "(", "$", "value", ")", ")", "{", "filter_var_array", "(", "$", "value", ",", "FILTER_SANITIZE_STRING", ")", ";", "}"...
Filter chooser based on number or string. Not very smart really. @param mixed $value @param bool $emptyValueIsNull If true, empty() values will be returned as NULL @return mixed
[ "Filter", "chooser", "based", "on", "number", "or", "string", ".", "Not", "very", "smart", "really", "." ]
4cc9954249da4e535b52f154e728935f07e648ae
https://github.com/lucifurious/kisma/blob/4cc9954249da4e535b52f154e728935f07e648ae/src/Kisma/Core/Utility/FilterInput.php#L54-L84
8,080
lucifurious/kisma
src/Kisma/Core/Utility/FilterInput.php
FilterInput.get
public static function get( $type, $key, $defaultValue = null, $filter = FILTER_DEFAULT, $filterOptions = null, $emptyValueIsNull = false ) { // Allow usage as filter_var() if ( is_array( $type ) ) { $_result = filter_var( Option::get( $type, $key, $defaultValue ), $filter, $filt...
php
public static function get( $type, $key, $defaultValue = null, $filter = FILTER_DEFAULT, $filterOptions = null, $emptyValueIsNull = false ) { // Allow usage as filter_var() if ( is_array( $type ) ) { $_result = filter_var( Option::get( $type, $key, $defaultValue ), $filter, $filt...
[ "public", "static", "function", "get", "(", "$", "type", ",", "$", "key", ",", "$", "defaultValue", "=", "null", ",", "$", "filter", "=", "FILTER_DEFAULT", ",", "$", "filterOptions", "=", "null", ",", "$", "emptyValueIsNull", "=", "false", ")", "{", "/...
The master function, performs all filters and gets. Gets around lack of INPUT_SESSION and INPUT_REQUEST support. @param int|array $type One of INPUT_GET, INPUT_POST, INPUT_COOKIE, INPUT_SERVER, INPUT_ENV, INPUT_SESSION and INPUT_REQUEST. You may also pass in an array and use this method to...
[ "The", "master", "function", "performs", "all", "filters", "and", "gets", ".", "Gets", "around", "lack", "of", "INPUT_SESSION", "and", "INPUT_REQUEST", "support", "." ]
4cc9954249da4e535b52f154e728935f07e648ae
https://github.com/lucifurious/kisma/blob/4cc9954249da4e535b52f154e728935f07e648ae/src/Kisma/Core/Utility/FilterInput.php#L106-L150
8,081
slickframework/mvc
src/Router.php
Router.getRouterContainer
public function getRouterContainer() { if (null === $this->routerContainer) { $this->setRouterContainer(new RouterContainer()); $this->routerContainer ->setMapBuilder([$this->getRouteBuilder(), 'build']); } return $this->routerContainer; }
php
public function getRouterContainer() { if (null === $this->routerContainer) { $this->setRouterContainer(new RouterContainer()); $this->routerContainer ->setMapBuilder([$this->getRouteBuilder(), 'build']); } return $this->routerContainer; }
[ "public", "function", "getRouterContainer", "(", ")", "{", "if", "(", "null", "===", "$", "this", "->", "routerContainer", ")", "{", "$", "this", "->", "setRouterContainer", "(", "new", "RouterContainer", "(", ")", ")", ";", "$", "this", "->", "routerConta...
Returns route container @return RouterContainer
[ "Returns", "route", "container" ]
91a6c512f8aaa5a7fb9c1a96f8012d2274dc30ab
https://github.com/slickframework/mvc/blob/91a6c512f8aaa5a7fb9c1a96f8012d2274dc30ab/src/Router.php#L54-L62
8,082
slickframework/mvc
src/Router.php
Router.getMatcher
public function getMatcher() { if (null === $this->matcher) { $this->setMatcher($this->getRouterContainer()->getMatcher()); } return $this->matcher; }
php
public function getMatcher() { if (null === $this->matcher) { $this->setMatcher($this->getRouterContainer()->getMatcher()); } return $this->matcher; }
[ "public", "function", "getMatcher", "(", ")", "{", "if", "(", "null", "===", "$", "this", "->", "matcher", ")", "{", "$", "this", "->", "setMatcher", "(", "$", "this", "->", "getRouterContainer", "(", ")", "->", "getMatcher", "(", ")", ")", ";", "}",...
Gets route matcher for this router @return Matcher
[ "Gets", "route", "matcher", "for", "this", "router" ]
91a6c512f8aaa5a7fb9c1a96f8012d2274dc30ab
https://github.com/slickframework/mvc/blob/91a6c512f8aaa5a7fb9c1a96f8012d2274dc30ab/src/Router.php#L99-L105
8,083
slickframework/mvc
src/Router.php
Router.getRouteBuilder
public function getRouteBuilder() { if (null == $this->routeBuilder) { $this->setRouteBuilder(new RouteBuilder($this->getRouteFile())); } return $this->routeBuilder; }
php
public function getRouteBuilder() { if (null == $this->routeBuilder) { $this->setRouteBuilder(new RouteBuilder($this->getRouteFile())); } return $this->routeBuilder; }
[ "public", "function", "getRouteBuilder", "(", ")", "{", "if", "(", "null", "==", "$", "this", "->", "routeBuilder", ")", "{", "$", "this", "->", "setRouteBuilder", "(", "new", "RouteBuilder", "(", "$", "this", "->", "getRouteFile", "(", ")", ")", ")", ...
Get route builder @return RouteBuilder
[ "Get", "route", "builder" ]
91a6c512f8aaa5a7fb9c1a96f8012d2274dc30ab
https://github.com/slickframework/mvc/blob/91a6c512f8aaa5a7fb9c1a96f8012d2274dc30ab/src/Router.php#L125-L131
8,084
20TRIES/date_range
src/DateRange.php
DateRange.forTimePeriod
public static function forTimePeriod($time_period, Carbon $date_time) { $time_period = self::parseTimePeriod($time_period); switch ($time_period) { case self::HOUR: return static::between( $date_time->copy()->minute(0)->second(0), $...
php
public static function forTimePeriod($time_period, Carbon $date_time) { $time_period = self::parseTimePeriod($time_period); switch ($time_period) { case self::HOUR: return static::between( $date_time->copy()->minute(0)->second(0), $...
[ "public", "static", "function", "forTimePeriod", "(", "$", "time_period", ",", "Carbon", "$", "date_time", ")", "{", "$", "time_period", "=", "self", "::", "parseTimePeriod", "(", "$", "time_period", ")", ";", "switch", "(", "$", "time_period", ")", "{", "...
Gets a date range for a time period. @param string $time_period @param Carbon $date_time @return static
[ "Gets", "a", "date", "range", "for", "a", "time", "period", "." ]
c03099d81fe6ea348f68c2cdaa7f6b39e8efb196
https://github.com/20TRIES/date_range/blob/c03099d81fe6ea348f68c2cdaa7f6b39e8efb196/src/DateRange.php#L224-L239
8,085
20TRIES/date_range
src/DateRange.php
DateRange.spans
public function spans($time_period) { $time_period = self::parseTimePeriod($time_period); // If the date range does not have a bound then it will not span any time periods. if (! $this->isBounded()) { return false; } // After must be positioned at the end of the...
php
public function spans($time_period) { $time_period = self::parseTimePeriod($time_period); // If the date range does not have a bound then it will not span any time periods. if (! $this->isBounded()) { return false; } // After must be positioned at the end of the...
[ "public", "function", "spans", "(", "$", "time_period", ")", "{", "$", "time_period", "=", "self", "::", "parseTimePeriod", "(", "$", "time_period", ")", ";", "// If the date range does not have a bound then it will not span any time periods.", "if", "(", "!", "$", "t...
Determines if a date range spans exactly one entire time period. @param $time_period @return Carbon|boolean The beginning of the time period, or null.
[ "Determines", "if", "a", "date", "range", "spans", "exactly", "one", "entire", "time", "period", "." ]
c03099d81fe6ea348f68c2cdaa7f6b39e8efb196
https://github.com/20TRIES/date_range/blob/c03099d81fe6ea348f68c2cdaa7f6b39e8efb196/src/DateRange.php#L446-L475
8,086
20TRIES/date_range
src/DateRange.php
DateRange.getTimeperiod
public function getTimeperiod() { foreach (array_keys(self::$time_periods) as $time_period) { if (!is_null($this->spans($time_period))) { return $time_period; } } return; }
php
public function getTimeperiod() { foreach (array_keys(self::$time_periods) as $time_period) { if (!is_null($this->spans($time_period))) { return $time_period; } } return; }
[ "public", "function", "getTimeperiod", "(", ")", "{", "foreach", "(", "array_keys", "(", "self", "::", "$", "time_periods", ")", "as", "$", "time_period", ")", "{", "if", "(", "!", "is_null", "(", "$", "this", "->", "spans", "(", "$", "time_period", ")...
Determines the time period that a date range spans. @return string|null A string which corresponds to a class constant time period or null if the date range does not match any supported time spans.
[ "Determines", "the", "time", "period", "that", "a", "date", "range", "spans", "." ]
c03099d81fe6ea348f68c2cdaa7f6b39e8efb196
https://github.com/20TRIES/date_range/blob/c03099d81fe6ea348f68c2cdaa7f6b39e8efb196/src/DateRange.php#L483-L492
8,087
20TRIES/date_range
src/DateRange.php
DateRange.isOpenEnded
public function isOpenEnded() { return is_null($this->before) || (!is_null($this->after) && $this->before->lte($this->after)); }
php
public function isOpenEnded() { return is_null($this->before) || (!is_null($this->after) && $this->before->lte($this->after)); }
[ "public", "function", "isOpenEnded", "(", ")", "{", "return", "is_null", "(", "$", "this", "->", "before", ")", "||", "(", "!", "is_null", "(", "$", "this", "->", "after", ")", "&&", "$", "this", "->", "before", "->", "lte", "(", "$", "this", "->",...
Determines if a date range has an upper bound. @return bool
[ "Determines", "if", "a", "date", "range", "has", "an", "upper", "bound", "." ]
c03099d81fe6ea348f68c2cdaa7f6b39e8efb196
https://github.com/20TRIES/date_range/blob/c03099d81fe6ea348f68c2cdaa7f6b39e8efb196/src/DateRange.php#L499-L502
8,088
20TRIES/date_range
src/DateRange.php
DateRange.combine
public static function combine(array $ranges) { $range = new static(); foreach ($ranges as $cur_range) { $cur_start = $cur_range->after; $cur_end = $cur_range->before; if (is_null($range->before) || $cur_end->lt($range->before)) { $range->before ...
php
public static function combine(array $ranges) { $range = new static(); foreach ($ranges as $cur_range) { $cur_start = $cur_range->after; $cur_end = $cur_range->before; if (is_null($range->before) || $cur_end->lt($range->before)) { $range->before ...
[ "public", "static", "function", "combine", "(", "array", "$", "ranges", ")", "{", "$", "range", "=", "new", "static", "(", ")", ";", "foreach", "(", "$", "ranges", "as", "$", "cur_range", ")", "{", "$", "cur_start", "=", "$", "cur_range", "->", "afte...
Combines a collection of date ranges into a single date range. @param DateRange[] $ranges @return DateRange @TODO Doesn't support open started or open ended ranges. @TODO Doesn't support non-intersecting ranges. @TODO Look at the possibility of implementing an "inersect" method instead.
[ "Combines", "a", "collection", "of", "date", "ranges", "into", "a", "single", "date", "range", "." ]
c03099d81fe6ea348f68c2cdaa7f6b39e8efb196
https://github.com/20TRIES/date_range/blob/c03099d81fe6ea348f68c2cdaa7f6b39e8efb196/src/DateRange.php#L516-L534
8,089
20TRIES/date_range
src/DateRange.php
DateRange.days
public function days() { if ($this->isOpenEnded() || $this->isOpenStarted()) { throw new Exception('The number of days within a range cannot be calculated for ranges that are open ended or open started.'); } return $this->after->diffInDays($this->before); }
php
public function days() { if ($this->isOpenEnded() || $this->isOpenStarted()) { throw new Exception('The number of days within a range cannot be calculated for ranges that are open ended or open started.'); } return $this->after->diffInDays($this->before); }
[ "public", "function", "days", "(", ")", "{", "if", "(", "$", "this", "->", "isOpenEnded", "(", ")", "||", "$", "this", "->", "isOpenStarted", "(", ")", ")", "{", "throw", "new", "Exception", "(", "'The number of days within a range cannot be calculated for range...
Gets the number of days that a date range spans. This is not possible, for obvious reasons, on open ended or open start date ranges. @throws Exception @return int
[ "Gets", "the", "number", "of", "days", "that", "a", "date", "range", "spans", "." ]
c03099d81fe6ea348f68c2cdaa7f6b39e8efb196
https://github.com/20TRIES/date_range/blob/c03099d81fe6ea348f68c2cdaa7f6b39e8efb196/src/DateRange.php#L545-L552
8,090
20TRIES/date_range
src/DateRange.php
DateRange.isOpenStarted
public function isOpenStarted() { return is_null($this->after) || (!is_null($this->before) && $this->before->lte($this->after)); }
php
public function isOpenStarted() { return is_null($this->after) || (!is_null($this->before) && $this->before->lte($this->after)); }
[ "public", "function", "isOpenStarted", "(", ")", "{", "return", "is_null", "(", "$", "this", "->", "after", ")", "||", "(", "!", "is_null", "(", "$", "this", "->", "before", ")", "&&", "$", "this", "->", "before", "->", "lte", "(", "$", "this", "->...
Determines if a date range has a lower bound. @return bool
[ "Determines", "if", "a", "date", "range", "has", "a", "lower", "bound", "." ]
c03099d81fe6ea348f68c2cdaa7f6b39e8efb196
https://github.com/20TRIES/date_range/blob/c03099d81fe6ea348f68c2cdaa7f6b39e8efb196/src/DateRange.php#L559-L562
8,091
20TRIES/date_range
src/DateRange.php
DateRange.getDatePositionIn
protected function getDatePositionIn(Carbon $date_time, $time_period) { // First we need to validate the time period. if (!array_key_exists($time_period, self::$time_periods)) { throw new \InvalidArgumentException('Time period must be one of the time periods listed in the class constants...
php
protected function getDatePositionIn(Carbon $date_time, $time_period) { // First we need to validate the time period. if (!array_key_exists($time_period, self::$time_periods)) { throw new \InvalidArgumentException('Time period must be one of the time periods listed in the class constants...
[ "protected", "function", "getDatePositionIn", "(", "Carbon", "$", "date_time", ",", "$", "time_period", ")", "{", "// First we need to validate the time period.", "if", "(", "!", "array_key_exists", "(", "$", "time_period", ",", "self", "::", "$", "time_periods", ")...
Determines a dates position within a time period. @param Carbon $date_time @param $time_period @return string|null A class constant that represents a time period, or null.
[ "Determines", "a", "dates", "position", "within", "a", "time", "period", "." ]
c03099d81fe6ea348f68c2cdaa7f6b39e8efb196
https://github.com/20TRIES/date_range/blob/c03099d81fe6ea348f68c2cdaa7f6b39e8efb196/src/DateRange.php#L673-L693
8,092
20TRIES/date_range
src/DateRange.php
DateRange.offsetMonthInDate
protected function offsetMonthInDate(Carbon $original_date, $offset) { $original_month = $original_date->month; // Calculate expected month if offset is positive. if ($offset >= 0 && ($original_month + $offset) <= 12) { $expected_month = $original_month + $offset; } else...
php
protected function offsetMonthInDate(Carbon $original_date, $offset) { $original_month = $original_date->month; // Calculate expected month if offset is positive. if ($offset >= 0 && ($original_month + $offset) <= 12) { $expected_month = $original_month + $offset; } else...
[ "protected", "function", "offsetMonthInDate", "(", "Carbon", "$", "original_date", ",", "$", "offset", ")", "{", "$", "original_month", "=", "$", "original_date", "->", "month", ";", "// Calculate expected month if offset is positive.", "if", "(", "$", "offset", ">=...
Offsets a month in a date by a set value; offsets >12 are not currently supported. @param Carbon $original_date @param $offset @return bool @TODO Add support for offsets greater then 12 for months.
[ "Offsets", "a", "month", "in", "a", "date", "by", "a", "set", "value", ";", "offsets", ">", "12", "are", "not", "currently", "supported", "." ]
c03099d81fe6ea348f68c2cdaa7f6b39e8efb196
https://github.com/20TRIES/date_range/blob/c03099d81fe6ea348f68c2cdaa7f6b39e8efb196/src/DateRange.php#L705-L724
8,093
20TRIES/date_range
src/DateRange.php
DateRange.refactorRolledOverDate
protected function refactorRolledOverDate(Carbon $date, Carbon $original_date) { return $date ->subMonth() ->endOfMonth() ->setTime($original_date->hour, $original_date->minute, $original_date->second); }
php
protected function refactorRolledOverDate(Carbon $date, Carbon $original_date) { return $date ->subMonth() ->endOfMonth() ->setTime($original_date->hour, $original_date->minute, $original_date->second); }
[ "protected", "function", "refactorRolledOverDate", "(", "Carbon", "$", "date", ",", "Carbon", "$", "original_date", ")", "{", "return", "$", "date", "->", "subMonth", "(", ")", "->", "endOfMonth", "(", ")", "->", "setTime", "(", "$", "original_date", "->", ...
Adjusts a date that has rolled over back to the previous month; setting the day to the last day of the previous month; time values are maintained. @param Carbon $date @param Carbon $original_date @return \DateTime
[ "Adjusts", "a", "date", "that", "has", "rolled", "over", "back", "to", "the", "previous", "month", ";", "setting", "the", "day", "to", "the", "last", "day", "of", "the", "previous", "month", ";", "time", "values", "are", "maintained", "." ]
c03099d81fe6ea348f68c2cdaa7f6b39e8efb196
https://github.com/20TRIES/date_range/blob/c03099d81fe6ea348f68c2cdaa7f6b39e8efb196/src/DateRange.php#L735-L741
8,094
CatLabInteractive/Neuron
src/Neuron/Core/Template.php
Template.addPath
public static function addPath ($path, $prefix = '', $priority = 0) { if (substr ($path, -1) !== '/') $path .= '/'; if ($prefix) { $name = $prefix . '|' . $path; } else { $name = $path; } // Set priority self::$pathpriorities[$name] = $priority; // Calculate the position based on priority. ...
php
public static function addPath ($path, $prefix = '', $priority = 0) { if (substr ($path, -1) !== '/') $path .= '/'; if ($prefix) { $name = $prefix . '|' . $path; } else { $name = $path; } // Set priority self::$pathpriorities[$name] = $priority; // Calculate the position based on priority. ...
[ "public", "static", "function", "addPath", "(", "$", "path", ",", "$", "prefix", "=", "''", ",", "$", "priority", "=", "0", ")", "{", "if", "(", "substr", "(", "$", "path", ",", "-", "1", ")", "!==", "'/'", ")", "$", "path", ".=", "'/'", ";", ...
Add a folder to the template path. @param $path: path to add @param $prefix: only templates starting with given prefix will be loaded from this path. @param $priority
[ "Add", "a", "folder", "to", "the", "template", "path", "." ]
67dca5349891e23b31a96dcdead893b9491a1b8b
https://github.com/CatLabInteractive/Neuron/blob/67dca5349891e23b31a96dcdead893b9491a1b8b/src/Neuron/Core/Template.php#L99-L126
8,095
CatLabInteractive/Neuron
src/Neuron/Core/Template.php
Template.getFilenames
private static function getFilenames ($template, $all = false) { $out = array (); foreach (self::getPaths () as $v) { // Split prefix and folder $split = explode ('|', $v); if (count ($split) === 2) { $prefix = array_shift ($split); $folder = implode ('|', $split); $templatefixed = subst...
php
private static function getFilenames ($template, $all = false) { $out = array (); foreach (self::getPaths () as $v) { // Split prefix and folder $split = explode ('|', $v); if (count ($split) === 2) { $prefix = array_shift ($split); $folder = implode ('|', $split); $templatefixed = subst...
[ "private", "static", "function", "getFilenames", "(", "$", "template", ",", "$", "all", "=", "false", ")", "{", "$", "out", "=", "array", "(", ")", ";", "foreach", "(", "self", "::", "getPaths", "(", ")", "as", "$", "v", ")", "{", "// Split prefix an...
Return an array of all filenames, or FALSE if none are found. @param $template @param bool $all @return bool|string
[ "Return", "an", "array", "of", "all", "filenames", "or", "FALSE", "if", "none", "are", "found", "." ]
67dca5349891e23b31a96dcdead893b9491a1b8b
https://github.com/CatLabInteractive/Neuron/blob/67dca5349891e23b31a96dcdead893b9491a1b8b/src/Neuron/Core/Template.php#L211-L255
8,096
CatLabInteractive/Neuron
src/Neuron/Core/Template.php
Template.combine
private function combine ($template) { ob_start(); foreach (self::$shares as $k => $v) { ${$k} = $v; } foreach ($this->values as $k => $v) { ${$k} = $v; } if ($ctlbtmpltfiles = $this->getFilenames($template, true)) { foreach ($ctlbtmpltfiles as $ctlbtmpltfile) { include $ctlbtmpltfile; }...
php
private function combine ($template) { ob_start(); foreach (self::$shares as $k => $v) { ${$k} = $v; } foreach ($this->values as $k => $v) { ${$k} = $v; } if ($ctlbtmpltfiles = $this->getFilenames($template, true)) { foreach ($ctlbtmpltfiles as $ctlbtmpltfile) { include $ctlbtmpltfile; }...
[ "private", "function", "combine", "(", "$", "template", ")", "{", "ob_start", "(", ")", ";", "foreach", "(", "self", "::", "$", "shares", "as", "$", "k", "=>", "$", "v", ")", "{", "$", "{", "$", "k", "}", "=", "$", "v", ";", "}", "foreach", "...
Go trough all set template directories and search for a specific template. Concat all of them.
[ "Go", "trough", "all", "set", "template", "directories", "and", "search", "for", "a", "specific", "template", ".", "Concat", "all", "of", "them", "." ]
67dca5349891e23b31a96dcdead893b9491a1b8b
https://github.com/CatLabInteractive/Neuron/blob/67dca5349891e23b31a96dcdead893b9491a1b8b/src/Neuron/Core/Template.php#L338-L360
8,097
mbrevda/aurasql-queryproxy
src/QueryProxy.php
QueryProxy.filter
public function filter() { $opts = func_get_args(); $callable = array_shift($opts); // allow for a false call if (!is_callable($callable)) { return $this; } array_unshift($opts, $this); return call_user_func_array($callable, $opts); }
php
public function filter() { $opts = func_get_args(); $callable = array_shift($opts); // allow for a false call if (!is_callable($callable)) { return $this; } array_unshift($opts, $this); return call_user_func_array($callable, $opts); }
[ "public", "function", "filter", "(", ")", "{", "$", "opts", "=", "func_get_args", "(", ")", ";", "$", "callable", "=", "array_shift", "(", "$", "opts", ")", ";", "// allow for a false call", "if", "(", "!", "is_callable", "(", "$", "callable", ")", ")", ...
Pass current instance to a callable for manipulation and return the processed object @param callable the callable that can minpulate $this @param array $opts to be passed to the function. will be prepeneded with $this @retrun object $this
[ "Pass", "current", "instance", "to", "a", "callable", "for", "manipulation", "and", "return", "the", "processed", "object" ]
e8768a0c482c807aeb11324eea627f8b37cfc01d
https://github.com/mbrevda/aurasql-queryproxy/blob/e8768a0c482c807aeb11324eea627f8b37cfc01d/src/QueryProxy.php#L110-L122
8,098
iriber/cose
src/main/php/Cose/persistence/PersistenceContext.php
PersistenceContext.rollback
public function rollback($unitName=""){ if(empty($unitName)) $unitName = PersistenceConfig::getDefaultUnit(); $entityManager = self::getEntityManager( $unitName ); $entityManager->getConnection()->rollback(); }
php
public function rollback($unitName=""){ if(empty($unitName)) $unitName = PersistenceConfig::getDefaultUnit(); $entityManager = self::getEntityManager( $unitName ); $entityManager->getConnection()->rollback(); }
[ "public", "function", "rollback", "(", "$", "unitName", "=", "\"\"", ")", "{", "if", "(", "empty", "(", "$", "unitName", ")", ")", "$", "unitName", "=", "PersistenceConfig", "::", "getDefaultUnit", "(", ")", ";", "$", "entityManager", "=", "self", "::", ...
se realiza el rolback sobre la unidad de persistencia indicada. si no se indica ninguna se toma la default. @param string $unitName nombre de la unidad de persistencia.
[ "se", "realiza", "el", "rolback", "sobre", "la", "unidad", "de", "persistencia", "indicada", ".", "si", "no", "se", "indica", "ninguna", "se", "toma", "la", "default", "." ]
291ea274a86017bac173fdc7bfcd4fb13419679e
https://github.com/iriber/cose/blob/291ea274a86017bac173fdc7bfcd4fb13419679e/src/main/php/Cose/persistence/PersistenceContext.php#L111-L119
8,099
JumpGateio/ViewResolution
src/JumpGate/ViewResolution/Resolvers/Path.php
Path.setPath
protected function setPath($view) { $this->viewModel = new ViewModel([], $this->layout->getName()); if ($view == null) { $view = $this->findView(); } $this->viewModel->view = $view; viewResolver()->collectDetails($this->viewModel); $this->path = $view;...
php
protected function setPath($view) { $this->viewModel = new ViewModel([], $this->layout->getName()); if ($view == null) { $view = $this->findView(); } $this->viewModel->view = $view; viewResolver()->collectDetails($this->viewModel); $this->path = $view;...
[ "protected", "function", "setPath", "(", "$", "view", ")", "{", "$", "this", "->", "viewModel", "=", "new", "ViewModel", "(", "[", "]", ",", "$", "this", "->", "layout", "->", "getName", "(", ")", ")", ";", "if", "(", "$", "view", "==", "null", "...
Get a valid view path save it. @param $view
[ "Get", "a", "valid", "view", "path", "save", "it", "." ]
49339e160db55876ca2a8fbe15bb3e26148b33f2
https://github.com/JumpGateio/ViewResolution/blob/49339e160db55876ca2a8fbe15bb3e26148b33f2/src/JumpGate/ViewResolution/Resolvers/Path.php#L69-L82