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
198,800
SuPa86000/ZF2Assetic
src/Assetic/Util/CssUtils.php
CssUtils.extractImports
public static function extractImports($content) { $imports = array(); static::filterImports($content, function($matches) use(& $imports) { $imports[] = $matches['url']; }); return array_unique($imports); }
php
public static function extractImports($content) { $imports = array(); static::filterImports($content, function($matches) use(& $imports) { $imports[] = $matches['url']; }); return array_unique($imports); }
[ "public", "static", "function", "extractImports", "(", "$", "content", ")", "{", "$", "imports", "=", "array", "(", ")", ";", "static", "::", "filterImports", "(", "$", "content", ",", "function", "(", "$", "matches", ")", "use", "(", "&", "$", "import...
Extracts all references from the supplied CSS content. @param string $content The CSS content @return array An array of unique URLs
[ "Extracts", "all", "references", "from", "the", "supplied", "CSS", "content", "." ]
3c432f321b5acdc9649f7d2cc80ce4ed98351f93
https://github.com/SuPa86000/ZF2Assetic/blob/3c432f321b5acdc9649f7d2cc80ce4ed98351f93/src/Assetic/Util/CssUtils.php#L100-L108
198,801
AmericanCouncils/WebServicesBundle
Debug/ImprovedStackTrace.php
ImprovedStackTrace.getTrace
static function getTrace($e, $seen = null) { $starter = $seen ? 'Caused by: ' : ''; $result = array(); if (!$seen) $seen = array(); $trace = $e->getTrace(); $prev = $e->getPrevious(); $result[] = sprintf('%s%s: %s', $starter, get_class($e), $e->getMessage()); ...
php
static function getTrace($e, $seen = null) { $starter = $seen ? 'Caused by: ' : ''; $result = array(); if (!$seen) $seen = array(); $trace = $e->getTrace(); $prev = $e->getPrevious(); $result[] = sprintf('%s%s: %s', $starter, get_class($e), $e->getMessage()); ...
[ "static", "function", "getTrace", "(", "$", "e", ",", "$", "seen", "=", "null", ")", "{", "$", "starter", "=", "$", "seen", "?", "'Caused by: '", ":", "''", ";", "$", "result", "=", "array", "(", ")", ";", "if", "(", "!", "$", "seen", ")", "$",...
Returns a string describing in detail the stack context of an exception.
[ "Returns", "a", "string", "describing", "in", "detail", "the", "stack", "context", "of", "an", "exception", "." ]
3f6270ecf31138ba2271a94a407c0d1a05542929
https://github.com/AmericanCouncils/WebServicesBundle/blob/3f6270ecf31138ba2271a94a407c0d1a05542929/Debug/ImprovedStackTrace.php#L13-L46
198,802
johnkrovitch/SamBundle
src/Configuration/Loader/ConfigurationLoader.php
ConfigurationLoader.loadFromFile
public function loadFromFile($path) { // the file should exists $fileSystem = new Filesystem(); if (!$fileSystem->exists($path)) { throw new FileNotFoundException(); } // the file should be a yml file $configurationFile = new SplFileInfo($path); ...
php
public function loadFromFile($path) { // the file should exists $fileSystem = new Filesystem(); if (!$fileSystem->exists($path)) { throw new FileNotFoundException(); } // the file should be a yml file $configurationFile = new SplFileInfo($path); ...
[ "public", "function", "loadFromFile", "(", "$", "path", ")", "{", "// the file should exists", "$", "fileSystem", "=", "new", "Filesystem", "(", ")", ";", "if", "(", "!", "$", "fileSystem", "->", "exists", "(", "$", "path", ")", ")", "{", "throw", "new",...
Load the configuration from a yaml file in the file system. @param string $path @return array @throws Exception
[ "Load", "the", "configuration", "from", "a", "yaml", "file", "in", "the", "file", "system", "." ]
6cc08ef2dd8f7cd5c33ee27818edd4697afa435e
https://github.com/johnkrovitch/SamBundle/blob/6cc08ef2dd8f7cd5c33ee27818edd4697afa435e/src/Configuration/Loader/ConfigurationLoader.php#L40-L60
198,803
gplcart/cli
controllers/commands/State.php
State.cmdGetState
public function cmdGetState() { $result = $this->getListState(); $this->outputFormat($result); $this->outputFormatTableState($result); $this->output(); }
php
public function cmdGetState() { $result = $this->getListState(); $this->outputFormat($result); $this->outputFormatTableState($result); $this->output(); }
[ "public", "function", "cmdGetState", "(", ")", "{", "$", "result", "=", "$", "this", "->", "getListState", "(", ")", ";", "$", "this", "->", "outputFormat", "(", "$", "result", ")", ";", "$", "this", "->", "outputFormatTableState", "(", "$", "result", ...
Callback for "state-get" command
[ "Callback", "for", "state", "-", "get", "command" ]
e57dba53e291a225b4bff0c0d9b23d685dd1c125
https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/State.php#L40-L46
198,804
gplcart/cli
controllers/commands/State.php
State.cmdUpdateState
public function cmdUpdateState() { $params = $this->getParam(); if (empty($params[0]) || count($params) < 2) { $this->errorAndExit($this->text('Invalid command')); } if (!is_numeric($params[0])) { $this->errorAndExit($this->text('Invalid argument')); ...
php
public function cmdUpdateState() { $params = $this->getParam(); if (empty($params[0]) || count($params) < 2) { $this->errorAndExit($this->text('Invalid command')); } if (!is_numeric($params[0])) { $this->errorAndExit($this->text('Invalid argument')); ...
[ "public", "function", "cmdUpdateState", "(", ")", "{", "$", "params", "=", "$", "this", "->", "getParam", "(", ")", ";", "if", "(", "empty", "(", "$", "params", "[", "0", "]", ")", "||", "count", "(", "$", "params", ")", "<", "2", ")", "{", "$"...
Callback for "state-update" command
[ "Callback", "for", "state", "-", "update", "command" ]
e57dba53e291a225b4bff0c0d9b23d685dd1c125
https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/State.php#L101-L120
198,805
gplcart/cli
controllers/commands/State.php
State.getListState
protected function getListState() { $id = $this->getParam(0); if (!isset($id)) { $list = $this->state->getList(); $this->limitArray($list); return $list; } if ($this->getParam('country')) { $list = $this->state->getList(array('country...
php
protected function getListState() { $id = $this->getParam(0); if (!isset($id)) { $list = $this->state->getList(); $this->limitArray($list); return $list; } if ($this->getParam('country')) { $list = $this->state->getList(array('country...
[ "protected", "function", "getListState", "(", ")", "{", "$", "id", "=", "$", "this", "->", "getParam", "(", "0", ")", ";", "if", "(", "!", "isset", "(", "$", "id", ")", ")", "{", "$", "list", "=", "$", "this", "->", "state", "->", "getList", "(...
Returns an array of country states @return array
[ "Returns", "an", "array", "of", "country", "states" ]
e57dba53e291a225b4bff0c0d9b23d685dd1c125
https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/State.php#L126-L153
198,806
gplcart/cli
controllers/commands/State.php
State.submitAddState
protected function submitAddState() { $this->setSubmitted(null, $this->getParam()); $this->validateComponent('state'); $this->addState(); }
php
protected function submitAddState() { $this->setSubmitted(null, $this->getParam()); $this->validateComponent('state'); $this->addState(); }
[ "protected", "function", "submitAddState", "(", ")", "{", "$", "this", "->", "setSubmitted", "(", "null", ",", "$", "this", "->", "getParam", "(", ")", ")", ";", "$", "this", "->", "validateComponent", "(", "'state'", ")", ";", "$", "this", "->", "addS...
Add a new country state at once
[ "Add", "a", "new", "country", "state", "at", "once" ]
e57dba53e291a225b4bff0c0d9b23d685dd1c125
https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/State.php#L198-L203
198,807
gplcart/cli
controllers/commands/State.php
State.addState
protected function addState() { if (!$this->isError()) { $state_id = $this->state->add($this->getSubmitted()); if (empty($state_id)) { $this->errorAndExit($this->text('Unexpected result')); } $this->line($state_id); } }
php
protected function addState() { if (!$this->isError()) { $state_id = $this->state->add($this->getSubmitted()); if (empty($state_id)) { $this->errorAndExit($this->text('Unexpected result')); } $this->line($state_id); } }
[ "protected", "function", "addState", "(", ")", "{", "if", "(", "!", "$", "this", "->", "isError", "(", ")", ")", "{", "$", "state_id", "=", "$", "this", "->", "state", "->", "add", "(", "$", "this", "->", "getSubmitted", "(", ")", ")", ";", "if",...
Add a new country state
[ "Add", "a", "new", "country", "state" ]
e57dba53e291a225b4bff0c0d9b23d685dd1c125
https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/State.php#L208-L217
198,808
gplcart/cli
controllers/commands/State.php
State.wizardAddState
protected function wizardAddState() { $this->validatePrompt('code', $this->text('Code'), 'state'); $this->validatePrompt('name', $this->text('Name'), 'state'); $this->validatePrompt('country', $this->text('Country'), 'state'); $this->validatePrompt('zone_id', $this->text('Zone'), 'st...
php
protected function wizardAddState() { $this->validatePrompt('code', $this->text('Code'), 'state'); $this->validatePrompt('name', $this->text('Name'), 'state'); $this->validatePrompt('country', $this->text('Country'), 'state'); $this->validatePrompt('zone_id', $this->text('Zone'), 'st...
[ "protected", "function", "wizardAddState", "(", ")", "{", "$", "this", "->", "validatePrompt", "(", "'code'", ",", "$", "this", "->", "text", "(", "'Code'", ")", ",", "'state'", ")", ";", "$", "this", "->", "validatePrompt", "(", "'name'", ",", "$", "t...
Add a new country state step by step
[ "Add", "a", "new", "country", "state", "step", "by", "step" ]
e57dba53e291a225b4bff0c0d9b23d685dd1c125
https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/State.php#L222-L232
198,809
ndavison/groundwork-framework
src/Groundwork/Classes/Router.php
Router.matchRequest
public function matchRequest($requestedRoute, $httpMethod) { // Iterate through each route that has been registered foreach ($this->routes as $route => $callback) { // Convert the route to a regex pattern $routeRx = preg_replace( '%/:([^ /...
php
public function matchRequest($requestedRoute, $httpMethod) { // Iterate through each route that has been registered foreach ($this->routes as $route => $callback) { // Convert the route to a regex pattern $routeRx = preg_replace( '%/:([^ /...
[ "public", "function", "matchRequest", "(", "$", "requestedRoute", ",", "$", "httpMethod", ")", "{", "// Iterate through each route that has been registered", "foreach", "(", "$", "this", "->", "routes", "as", "$", "route", "=>", "$", "callback", ")", "{", "// Conv...
Compares the requested route param with the registered routes and checks whether there is a match - true on a match, false if not. @param string $requestedRoute @param string $httpMethod @return boolean
[ "Compares", "the", "requested", "route", "param", "with", "the", "registered", "routes", "and", "checks", "whether", "there", "is", "a", "match", "-", "true", "on", "a", "match", "false", "if", "not", "." ]
c3d22a1410c8d8a07b4ca1f99a35a1181516cd6c
https://github.com/ndavison/groundwork-framework/blob/c3d22a1410c8d8a07b4ca1f99a35a1181516cd6c/src/Groundwork/Classes/Router.php#L127-L169
198,810
ndavison/groundwork-framework
src/Groundwork/Classes/Router.php
Router.getClosure
public function getClosure($app) { // Confirm the matched property is a key in the routes array if (!isset($this->routes[$this->matched])) return false; $callback = $this->routes[$this->matched]; // Is the callback a string? If so, it should be the n...
php
public function getClosure($app) { // Confirm the matched property is a key in the routes array if (!isset($this->routes[$this->matched])) return false; $callback = $this->routes[$this->matched]; // Is the callback a string? If so, it should be the n...
[ "public", "function", "getClosure", "(", "$", "app", ")", "{", "// Confirm the matched property is a key in the routes array", "if", "(", "!", "isset", "(", "$", "this", "->", "routes", "[", "$", "this", "->", "matched", "]", ")", ")", "return", "false", ";", ...
Returns a Closure instance which contains the logic to generate the output for the requested route, or false. @param Application $app @return \Closure|boolean
[ "Returns", "a", "Closure", "instance", "which", "contains", "the", "logic", "to", "generate", "the", "output", "for", "the", "requested", "route", "or", "false", "." ]
c3d22a1410c8d8a07b4ca1f99a35a1181516cd6c
https://github.com/ndavison/groundwork-framework/blob/c3d22a1410c8d8a07b4ca1f99a35a1181516cd6c/src/Groundwork/Classes/Router.php#L178-L219
198,811
netlogix/Netlogix.Crud
Classes/Netlogix/Crud/Domain/Service/SerializationService.php
SerializationService.jsonEncode
public function jsonEncode($object, UriBuilder $uriBuilder, $metaDataProcessorGroup = NULL) { return json_encode($this->process($object, $uriBuilder, $metaDataProcessorGroup)); }
php
public function jsonEncode($object, UriBuilder $uriBuilder, $metaDataProcessorGroup = NULL) { return json_encode($this->process($object, $uriBuilder, $metaDataProcessorGroup)); }
[ "public", "function", "jsonEncode", "(", "$", "object", ",", "UriBuilder", "$", "uriBuilder", ",", "$", "metaDataProcessorGroup", "=", "NULL", ")", "{", "return", "json_encode", "(", "$", "this", "->", "process", "(", "$", "object", ",", "$", "uriBuilder", ...
Returns JsonEncode of the given object. If UriPointers are found in the DTO hierarchy, the UriBuilder is required to resolve them. @param $object @param UriBuilder $uriBuilder @param string $metaDataProcessorGroup @return string
[ "Returns", "JsonEncode", "of", "the", "given", "object", ".", "If", "UriPointers", "are", "found", "in", "the", "DTO", "hierarchy", "the", "UriBuilder", "is", "required", "to", "resolve", "them", "." ]
61438827ba6b0a7a63cd2f08a294967ed5928144
https://github.com/netlogix/Netlogix.Crud/blob/61438827ba6b0a7a63cd2f08a294967ed5928144/Classes/Netlogix/Crud/Domain/Service/SerializationService.php#L134-L138
198,812
netlogix/Netlogix.Crud
Classes/Netlogix/Crud/Domain/Service/SerializationService.php
SerializationService.process
public function process($object, UriBuilder $uriBuilder, $metaDataProcessorGroup = NULL) { $formerConfigurationStackAttributes = array( 'cacheTagService', 'metaDataProcessors', 'metaDataProcessorStorage', 'uriBuilder', 'propertyPath', ); /* * Remember previous state */ array_unshift($this...
php
public function process($object, UriBuilder $uriBuilder, $metaDataProcessorGroup = NULL) { $formerConfigurationStackAttributes = array( 'cacheTagService', 'metaDataProcessors', 'metaDataProcessorStorage', 'uriBuilder', 'propertyPath', ); /* * Remember previous state */ array_unshift($this...
[ "public", "function", "process", "(", "$", "object", ",", "UriBuilder", "$", "uriBuilder", ",", "$", "metaDataProcessorGroup", "=", "NULL", ")", "{", "$", "formerConfigurationStackAttributes", "=", "array", "(", "'cacheTagService'", ",", "'metaDataProcessors'", ",",...
Basically TearUp and TearDown of the processing environment. The processing mechanism is another method. @param $object @param UriBuilder $uriBuilder @param string $metaDataProcessorGroup @return mixed
[ "Basically", "TearUp", "and", "TearDown", "of", "the", "processing", "environment", ".", "The", "processing", "mechanism", "is", "another", "method", "." ]
61438827ba6b0a7a63cd2f08a294967ed5928144
https://github.com/netlogix/Netlogix.Crud/blob/61438827ba6b0a7a63cd2f08a294967ed5928144/Classes/Netlogix/Crud/Domain/Service/SerializationService.php#L149-L200
198,813
netlogix/Netlogix.Crud
Classes/Netlogix/Crud/Domain/Service/SerializationService.php
SerializationService.processInternal
protected function processInternal($object) { if (is_scalar($object)) { return $object; } elseif (is_array($object)) { return $this->processCollectionType($object, array_keys($object)); } elseif ($object instanceof \DateTime) { return $object->format(DateTimeConverter::DEFAULT_DATE_FORMAT); } elseif (i...
php
protected function processInternal($object) { if (is_scalar($object)) { return $object; } elseif (is_array($object)) { return $this->processCollectionType($object, array_keys($object)); } elseif ($object instanceof \DateTime) { return $object->format(DateTimeConverter::DEFAULT_DATE_FORMAT); } elseif (i...
[ "protected", "function", "processInternal", "(", "$", "object", ")", "{", "if", "(", "is_scalar", "(", "$", "object", ")", ")", "{", "return", "$", "object", ";", "}", "elseif", "(", "is_array", "(", "$", "object", ")", ")", "{", "return", "$", "this...
Dispatcher which kind of processing has to be done. @param mixed $object @return mixed
[ "Dispatcher", "which", "kind", "of", "processing", "has", "to", "be", "done", "." ]
61438827ba6b0a7a63cd2f08a294967ed5928144
https://github.com/netlogix/Netlogix.Crud/blob/61438827ba6b0a7a63cd2f08a294967ed5928144/Classes/Netlogix/Crud/Domain/Service/SerializationService.php#L208-L240
198,814
netlogix/Netlogix.Crud
Classes/Netlogix/Crud/Domain/Service/SerializationService.php
SerializationService.processCollectionType
protected function processCollectionType($collection, $collectionKeys) { $result = []; foreach ($collectionKeys as $collectionKey) { array_push($this->propertyPath, $collectionKey); $value = ObjectAccess::getProperty($collection, $collectionKey); $result[$collectionKey] = $this->processInternal($value); ...
php
protected function processCollectionType($collection, $collectionKeys) { $result = []; foreach ($collectionKeys as $collectionKey) { array_push($this->propertyPath, $collectionKey); $value = ObjectAccess::getProperty($collection, $collectionKey); $result[$collectionKey] = $this->processInternal($value); ...
[ "protected", "function", "processCollectionType", "(", "$", "collection", ",", "$", "collectionKeys", ")", "{", "$", "result", "=", "[", "]", ";", "foreach", "(", "$", "collectionKeys", "as", "$", "collectionKey", ")", "{", "array_push", "(", "$", "this", ...
This method handles "collection types", which are DTOs and arrays. Each individual property of those collection type is processed according internal processing rules. There might be MetaData content available for each property. Although those are applied to each collection type, those work best when being applied to D...
[ "This", "method", "handles", "collection", "types", "which", "are", "DTOs", "and", "arrays", "." ]
61438827ba6b0a7a63cd2f08a294967ed5928144
https://github.com/netlogix/Netlogix.Crud/blob/61438827ba6b0a7a63cd2f08a294967ed5928144/Classes/Netlogix/Crud/Domain/Service/SerializationService.php#L279-L290
198,815
netlogix/Netlogix.Crud
Classes/Netlogix/Crud/Domain/Service/SerializationService.php
SerializationService.processUriPointer
protected function processUriPointer(UriPointer $uriPointer) { $uri = $this->uriBuilder ->reset() ->setCreateAbsoluteUri(TRUE) ->uriFor($uriPointer->getActionName(), $uriPointer->getArguments(), $uriPointer->getControllerName(), $uriPointer->getPackageKey(), $uriPointer->getSubPackageKey()); return $uri; ...
php
protected function processUriPointer(UriPointer $uriPointer) { $uri = $this->uriBuilder ->reset() ->setCreateAbsoluteUri(TRUE) ->uriFor($uriPointer->getActionName(), $uriPointer->getArguments(), $uriPointer->getControllerName(), $uriPointer->getPackageKey(), $uriPointer->getSubPackageKey()); return $uri; ...
[ "protected", "function", "processUriPointer", "(", "UriPointer", "$", "uriPointer", ")", "{", "$", "uri", "=", "$", "this", "->", "uriBuilder", "->", "reset", "(", ")", "->", "setCreateAbsoluteUri", "(", "TRUE", ")", "->", "uriFor", "(", "$", "uriPointer", ...
UriPointers are a special type, because they are meant to create a very specific and unique uri string. FIXME: Introduce a service that handles this uri building. @param UriPointer $uriPointer @return string
[ "UriPointers", "are", "a", "special", "type", "because", "they", "are", "meant", "to", "create", "a", "very", "specific", "and", "unique", "uri", "string", "." ]
61438827ba6b0a7a63cd2f08a294967ed5928144
https://github.com/netlogix/Netlogix.Crud/blob/61438827ba6b0a7a63cd2f08a294967ed5928144/Classes/Netlogix/Crud/Domain/Service/SerializationService.php#L300-L307
198,816
netlogix/Netlogix.Crud
Classes/Netlogix/Crud/Domain/Service/SerializationService.php
SerializationService.getMetaData
protected function getMetaData($propertyPath, $processedValue, $object) { $metaData = []; foreach ($this->metaDataProcessors as $metaDataProcessorKey => $metaDataProcessorConfiguration) { if (!isset($this->metaDataProcessorStorage[$metaDataProcessorKey])) { $this->metaDataProcessorStorage[$metaDataProcessor...
php
protected function getMetaData($propertyPath, $processedValue, $object) { $metaData = []; foreach ($this->metaDataProcessors as $metaDataProcessorKey => $metaDataProcessorConfiguration) { if (!isset($this->metaDataProcessorStorage[$metaDataProcessorKey])) { $this->metaDataProcessorStorage[$metaDataProcessor...
[ "protected", "function", "getMetaData", "(", "$", "propertyPath", ",", "$", "processedValue", ",", "$", "object", ")", "{", "$", "metaData", "=", "[", "]", ";", "foreach", "(", "$", "this", "->", "metaDataProcessors", "as", "$", "metaDataProcessorKey", "=>",...
Returns MetaData for the given property Additional information can be any kind of data that is necessary for the client to process its model but does not belong to the domain data. Those can be e.g. th "readOnly" attribute or pre-fetched content of an Pointer. FIXME: Define how to configure this. Maybe add configurat...
[ "Returns", "MetaData", "for", "the", "given", "property" ]
61438827ba6b0a7a63cd2f08a294967ed5928144
https://github.com/netlogix/Netlogix.Crud/blob/61438827ba6b0a7a63cd2f08a294967ed5928144/Classes/Netlogix/Crud/Domain/Service/SerializationService.php#L326-L344
198,817
rafrsr/lib-array2object
src/Parser/ObjectParser.php
ObjectParser.extractClass
private function extractClass($regEx, $classContent) { preg_match($regEx, $classContent, $matches); if (isset($matches[1]) && class_exists($matches[1])) { return $matches[1]; } return; }
php
private function extractClass($regEx, $classContent) { preg_match($regEx, $classContent, $matches); if (isset($matches[1]) && class_exists($matches[1])) { return $matches[1]; } return; }
[ "private", "function", "extractClass", "(", "$", "regEx", ",", "$", "classContent", ")", "{", "preg_match", "(", "$", "regEx", ",", "$", "classContent", ",", "$", "matches", ")", ";", "if", "(", "isset", "(", "$", "matches", "[", "1", "]", ")", "&&",...
Extract class usage from origin class content using regular expresion. @param $regEx @param $classContent
[ "Extract", "class", "usage", "from", "origin", "class", "content", "using", "regular", "expresion", "." ]
d15db63b5f5740dbc7c2213373320445785856ef
https://github.com/rafrsr/lib-array2object/blob/d15db63b5f5740dbc7c2213373320445785856ef/src/Parser/ObjectParser.php#L117-L125
198,818
mwyatt/core
src/AbstractController.php
AbstractController.redirect
public function redirect($key, $config = [], $statusCode = 302) { $router = $this->getService('Router'); $url = $this->getService('Url'); $urlNew = $url->generate($key, $config); $router->redirect($urlNew, $statusCode); }
php
public function redirect($key, $config = [], $statusCode = 302) { $router = $this->getService('Router'); $url = $this->getService('Url'); $urlNew = $url->generate($key, $config); $router->redirect($urlNew, $statusCode); }
[ "public", "function", "redirect", "(", "$", "key", ",", "$", "config", "=", "[", "]", ",", "$", "statusCode", "=", "302", ")", "{", "$", "router", "=", "$", "this", "->", "getService", "(", "'Router'", ")", ";", "$", "url", "=", "$", "this", "->"...
deprecated and must use redirectAbs
[ "deprecated", "and", "must", "use", "redirectAbs" ]
8ea9d67cc84fe6aff17a469c703d5492dbcd93ed
https://github.com/mwyatt/core/blob/8ea9d67cc84fe6aff17a469c703d5492dbcd93ed/src/AbstractController.php#L61-L67
198,819
mwyatt/core
src/AbstractController.php
AbstractController.redirectAbs
public function redirectAbs($url, $statusCode = 302) { $router = $this->getService('Router'); $router->redirect($url, $statusCode); exit; }
php
public function redirectAbs($url, $statusCode = 302) { $router = $this->getService('Router'); $router->redirect($url, $statusCode); exit; }
[ "public", "function", "redirectAbs", "(", "$", "url", ",", "$", "statusCode", "=", "302", ")", "{", "$", "router", "=", "$", "this", "->", "getService", "(", "'Router'", ")", ";", "$", "router", "->", "redirect", "(", "$", "url", ",", "$", "statusCod...
must be renamed to redirect in next major version @param string $url absolute @param integer $statusCode
[ "must", "be", "renamed", "to", "redirect", "in", "next", "major", "version" ]
8ea9d67cc84fe6aff17a469c703d5492dbcd93ed
https://github.com/mwyatt/core/blob/8ea9d67cc84fe6aff17a469c703d5492dbcd93ed/src/AbstractController.php#L75-L80
198,820
Hnto/nuki
src/Handlers/Core/ThrowableHandling.php
ThrowableHandling.toOutput
private function toOutput(\Throwable $t) { //Write to output $renderer = new \Nuki\Handlers\Http\Output\Renderers\RawRenderer(); $response = new \Nuki\Handlers\Http\Output\Response($renderer); $content = get_class($t) . ': '; $content .= $t->getMessage(); $content .= ' in '; $content .= $t-...
php
private function toOutput(\Throwable $t) { //Write to output $renderer = new \Nuki\Handlers\Http\Output\Renderers\RawRenderer(); $response = new \Nuki\Handlers\Http\Output\Response($renderer); $content = get_class($t) . ': '; $content .= $t->getMessage(); $content .= ' in '; $content .= $t-...
[ "private", "function", "toOutput", "(", "\\", "Throwable", "$", "t", ")", "{", "//Write to output", "$", "renderer", "=", "new", "\\", "Nuki", "\\", "Handlers", "\\", "Http", "\\", "Output", "\\", "Renderers", "\\", "RawRenderer", "(", ")", ";", "$", "re...
Write to output @param \Throwable $t @return mixed
[ "Write", "to", "output" ]
c3fb16244e8d611c335a88e3b9c9ee7d81fafc0c
https://github.com/Hnto/nuki/blob/c3fb16244e8d611c335a88e3b9c9ee7d81fafc0c/src/Handlers/Core/ThrowableHandling.php#L46-L63
198,821
Hnto/nuki
src/Handlers/Core/ThrowableHandling.php
ThrowableHandling.toUserOutput
private function toUserOutput(string $msg) { $renderer = new \Nuki\Handlers\Http\Output\Renderers\RawRenderer(); $response = new \Nuki\Handlers\Http\Output\Response($renderer); $renderer->setContent(new \Nuki\Models\IO\Output\Content($msg)); $response->httpStatusCode(\Nuki\Models\IO\Output\Http::HTTP_...
php
private function toUserOutput(string $msg) { $renderer = new \Nuki\Handlers\Http\Output\Renderers\RawRenderer(); $response = new \Nuki\Handlers\Http\Output\Response($renderer); $renderer->setContent(new \Nuki\Models\IO\Output\Content($msg)); $response->httpStatusCode(\Nuki\Models\IO\Output\Http::HTTP_...
[ "private", "function", "toUserOutput", "(", "string", "$", "msg", ")", "{", "$", "renderer", "=", "new", "\\", "Nuki", "\\", "Handlers", "\\", "Http", "\\", "Output", "\\", "Renderers", "\\", "RawRenderer", "(", ")", ";", "$", "response", "=", "new", "...
Write message to user output @param string $msg @return mixed
[ "Write", "message", "to", "user", "output" ]
c3fb16244e8d611c335a88e3b9c9ee7d81fafc0c
https://github.com/Hnto/nuki/blob/c3fb16244e8d611c335a88e3b9c9ee7d81fafc0c/src/Handlers/Core/ThrowableHandling.php#L71-L82
198,822
mrstroz/yii2-wavecms-page
components/helpers/Front.php
Front.imgUrl
public static function imgUrl($file, $folder = false) { $src = '@web/images/'; if ($folder !== false) { $src .= $folder . '/'; } $src .= $file; return Url::to($src); }
php
public static function imgUrl($file, $folder = false) { $src = '@web/images/'; if ($folder !== false) { $src .= $folder . '/'; } $src .= $file; return Url::to($src); }
[ "public", "static", "function", "imgUrl", "(", "$", "file", ",", "$", "folder", "=", "false", ")", "{", "$", "src", "=", "'@web/images/'", ";", "if", "(", "$", "folder", "!==", "false", ")", "{", "$", "src", ".=", "$", "folder", ".", "'/'", ";", ...
Get image url by filename @param $file @param bool $folder @return string
[ "Get", "image", "url", "by", "filename" ]
c7f867ffc5abd86814230c360aec9b30b6d2e819
https://github.com/mrstroz/yii2-wavecms-page/blob/c7f867ffc5abd86814230c360aec9b30b6d2e819/components/helpers/Front.php#L37-L46
198,823
mrstroz/yii2-wavecms-page
components/helpers/Front.php
Front.img
public static function img($file, $folder = false, array $options = []) { return Html::img(self::imgUrl($file, $folder), $options); }
php
public static function img($file, $folder = false, array $options = []) { return Html::img(self::imgUrl($file, $folder), $options); }
[ "public", "static", "function", "img", "(", "$", "file", ",", "$", "folder", "=", "false", ",", "array", "$", "options", "=", "[", "]", ")", "{", "return", "Html", "::", "img", "(", "self", "::", "imgUrl", "(", "$", "file", ",", "$", "folder", ")...
Display img tag @param string $file @param bool $folder @param array $options @return string
[ "Display", "img", "tag" ]
c7f867ffc5abd86814230c360aec9b30b6d2e819
https://github.com/mrstroz/yii2-wavecms-page/blob/c7f867ffc5abd86814230c360aec9b30b6d2e819/components/helpers/Front.php#L55-L58
198,824
mrstroz/yii2-wavecms-page
components/helpers/Front.php
Front.linkUrl
public static function linkUrl($pageId, $pageUrl) { if (self::$pages === null) { self::initPages(); } if ($pageUrl) { if (strpos($pageUrl, 'http') === 0) { return Url::to($pageUrl); } return Url::to([$pageUrl]); } ...
php
public static function linkUrl($pageId, $pageUrl) { if (self::$pages === null) { self::initPages(); } if ($pageUrl) { if (strpos($pageUrl, 'http') === 0) { return Url::to($pageUrl); } return Url::to([$pageUrl]); } ...
[ "public", "static", "function", "linkUrl", "(", "$", "pageId", ",", "$", "pageUrl", ")", "{", "if", "(", "self", "::", "$", "pages", "===", "null", ")", "{", "self", "::", "initPages", "(", ")", ";", "}", "if", "(", "$", "pageUrl", ")", "{", "if"...
Get page url by id @param $pageId @param $pageUrl @return string @throws \yii\base\InvalidConfigException
[ "Get", "page", "url", "by", "id" ]
c7f867ffc5abd86814230c360aec9b30b6d2e819
https://github.com/mrstroz/yii2-wavecms-page/blob/c7f867ffc5abd86814230c360aec9b30b6d2e819/components/helpers/Front.php#L67-L88
198,825
mrstroz/yii2-wavecms-page
components/helpers/Front.php
Front.link
public static function link($menu, $text, array $options = [], array $fields = []) { if ($menu instanceof ActiveRecord) { if (!$fields) { $fields = self::$fields; } if ($menu->{$fields['page_blank']}) { $options['target'] = '_blank'; ...
php
public static function link($menu, $text, array $options = [], array $fields = []) { if ($menu instanceof ActiveRecord) { if (!$fields) { $fields = self::$fields; } if ($menu->{$fields['page_blank']}) { $options['target'] = '_blank'; ...
[ "public", "static", "function", "link", "(", "$", "menu", ",", "$", "text", ",", "array", "$", "options", "=", "[", "]", ",", "array", "$", "fields", "=", "[", "]", ")", "{", "if", "(", "$", "menu", "instanceof", "ActiveRecord", ")", "{", "if", "...
Display link by page @param mixed $menu @param $text Html:a text @param array $options Html:a options @param array $fields @return bool|string @throws \yii\base\InvalidConfigException
[ "Display", "link", "by", "page" ]
c7f867ffc5abd86814230c360aec9b30b6d2e819
https://github.com/mrstroz/yii2-wavecms-page/blob/c7f867ffc5abd86814230c360aec9b30b6d2e819/components/helpers/Front.php#L100-L119
198,826
mrstroz/yii2-wavecms-page
components/helpers/Front.php
Front.isLinkActive
public static function isLinkActive($menu, array $fields = []) { if ($menu instanceof ActiveRecord) { if (self::$pages === null) { self::initPages(); } if (!$fields) { $fields = self::$fields; } /** Check if page_u...
php
public static function isLinkActive($menu, array $fields = []) { if ($menu instanceof ActiveRecord) { if (self::$pages === null) { self::initPages(); } if (!$fields) { $fields = self::$fields; } /** Check if page_u...
[ "public", "static", "function", "isLinkActive", "(", "$", "menu", ",", "array", "$", "fields", "=", "[", "]", ")", "{", "if", "(", "$", "menu", "instanceof", "ActiveRecord", ")", "{", "if", "(", "self", "::", "$", "pages", "===", "null", ")", "{", ...
Check if page is active @param mixed $menu @param array $fields @return bool @throws \yii\base\InvalidConfigException
[ "Check", "if", "page", "is", "active" ]
c7f867ffc5abd86814230c360aec9b30b6d2e819
https://github.com/mrstroz/yii2-wavecms-page/blob/c7f867ffc5abd86814230c360aec9b30b6d2e819/components/helpers/Front.php#L128-L162
198,827
mrstroz/yii2-wavecms-page
components/helpers/Front.php
Front.youTubeId
public static function youTubeId($url) { parse_str(parse_url($url, PHP_URL_QUERY), $vars); if (isset($vars['v'])) { return $vars['v']; } return false; }
php
public static function youTubeId($url) { parse_str(parse_url($url, PHP_URL_QUERY), $vars); if (isset($vars['v'])) { return $vars['v']; } return false; }
[ "public", "static", "function", "youTubeId", "(", "$", "url", ")", "{", "parse_str", "(", "parse_url", "(", "$", "url", ",", "PHP_URL_QUERY", ")", ",", "$", "vars", ")", ";", "if", "(", "isset", "(", "$", "vars", "[", "'v'", "]", ")", ")", "{", "...
Return movie ID based on YouTube url @param $url @return mixed
[ "Return", "movie", "ID", "based", "on", "YouTube", "url" ]
c7f867ffc5abd86814230c360aec9b30b6d2e819
https://github.com/mrstroz/yii2-wavecms-page/blob/c7f867ffc5abd86814230c360aec9b30b6d2e819/components/helpers/Front.php#L169-L176
198,828
mrstroz/yii2-wavecms-page
components/helpers/Front.php
Front.initPages
private static function initPages() { $modelPage = Yii::createObject(Page::class); $pages = $modelPage::find()->getMap()->asArray()->all(); if ($pages) { foreach ($pages as $page) { self::$pages[$page['id']] = $page; } } }
php
private static function initPages() { $modelPage = Yii::createObject(Page::class); $pages = $modelPage::find()->getMap()->asArray()->all(); if ($pages) { foreach ($pages as $page) { self::$pages[$page['id']] = $page; } } }
[ "private", "static", "function", "initPages", "(", ")", "{", "$", "modelPage", "=", "Yii", "::", "createObject", "(", "Page", "::", "class", ")", ";", "$", "pages", "=", "$", "modelPage", "::", "find", "(", ")", "->", "getMap", "(", ")", "->", "asArr...
Init pages array @throws \yii\base\InvalidConfigException
[ "Init", "pages", "array" ]
c7f867ffc5abd86814230c360aec9b30b6d2e819
https://github.com/mrstroz/yii2-wavecms-page/blob/c7f867ffc5abd86814230c360aec9b30b6d2e819/components/helpers/Front.php#L182-L193
198,829
PenoaksDev/Milky-Framework
src/Milky/Database/Eloquent/Nested/NestedModel.php
NestedModel.getDescendantsAndSelf
public function getDescendantsAndSelf( $columns = ['*'] ) { if ( is_array( $columns ) ) return $this->descendantsAndSelf()->get( $columns ); $arguments = func_get_args(); $limit = intval( array_shift( $arguments ) ); $columns = array_shift( $arguments ) ?: ['*']; return $this->descendantsAndSelf()->lim...
php
public function getDescendantsAndSelf( $columns = ['*'] ) { if ( is_array( $columns ) ) return $this->descendantsAndSelf()->get( $columns ); $arguments = func_get_args(); $limit = intval( array_shift( $arguments ) ); $columns = array_shift( $arguments ) ?: ['*']; return $this->descendantsAndSelf()->lim...
[ "public", "function", "getDescendantsAndSelf", "(", "$", "columns", "=", "[", "'*'", "]", ")", "{", "if", "(", "is_array", "(", "$", "columns", ")", ")", "return", "$", "this", "->", "descendantsAndSelf", "(", ")", "->", "get", "(", "$", "columns", ")"...
Retrieve all nested children an self. @param array $columns @return Collection
[ "Retrieve", "all", "nested", "children", "an", "self", "." ]
8afd7156610a70371aa5b1df50b8a212bf7b142c
https://github.com/PenoaksDev/Milky-Framework/blob/8afd7156610a70371aa5b1df50b8a212bf7b142c/src/Milky/Database/Eloquent/Nested/NestedModel.php#L787-L798
198,830
PenoaksDev/Milky-Framework
src/Milky/Database/Eloquent/Nested/NestedModel.php
NestedModel.moveToNewParent
public function moveToNewParent() { $pid = static::$moveToNewParentId; if ( is_null( $pid ) ) $this->makeRoot(); else if ( $pid !== false ) $this->makeChildOf( $pid ); }
php
public function moveToNewParent() { $pid = static::$moveToNewParentId; if ( is_null( $pid ) ) $this->makeRoot(); else if ( $pid !== false ) $this->makeChildOf( $pid ); }
[ "public", "function", "moveToNewParent", "(", ")", "{", "$", "pid", "=", "static", "::", "$", "moveToNewParentId", ";", "if", "(", "is_null", "(", "$", "pid", ")", ")", "$", "this", "->", "makeRoot", "(", ")", ";", "else", "if", "(", "$", "pid", "!...
Move to the new parent if appropiate. @return void
[ "Move", "to", "the", "new", "parent", "if", "appropiate", "." ]
8afd7156610a70371aa5b1df50b8a212bf7b142c
https://github.com/PenoaksDev/Milky-Framework/blob/8afd7156610a70371aa5b1df50b8a212bf7b142c/src/Milky/Database/Eloquent/Nested/NestedModel.php#L1117-L1125
198,831
PenoaksDev/Milky-Framework
src/Milky/Database/Eloquent/Nested/NestedModel.php
NestedModel.restoreDescendants
public function restoreDescendants() { if ( is_null( $this->getRight() ) || is_null( $this->getLeft() ) ) return; $self = $this; $this->getConnection()->transaction( function () use ( $self ) { $self->newNestedSetQuery()->withTrashed()->where( $self->getLeftColumnName(), '>', $self->getLeft() )->where(...
php
public function restoreDescendants() { if ( is_null( $this->getRight() ) || is_null( $this->getLeft() ) ) return; $self = $this; $this->getConnection()->transaction( function () use ( $self ) { $self->newNestedSetQuery()->withTrashed()->where( $self->getLeftColumnName(), '>', $self->getLeft() )->where(...
[ "public", "function", "restoreDescendants", "(", ")", "{", "if", "(", "is_null", "(", "$", "this", "->", "getRight", "(", ")", ")", "||", "is_null", "(", "$", "this", "->", "getLeft", "(", ")", ")", ")", "return", ";", "$", "self", "=", "$", "this"...
Restores all of the current node's descendants. @return void
[ "Restores", "all", "of", "the", "current", "node", "s", "descendants", "." ]
8afd7156610a70371aa5b1df50b8a212bf7b142c
https://github.com/PenoaksDev/Milky-Framework/blob/8afd7156610a70371aa5b1df50b8a212bf7b142c/src/Milky/Database/Eloquent/Nested/NestedModel.php#L1246-L1260
198,832
PenoaksDev/Milky-Framework
src/Milky/Database/Eloquent/Nested/NestedModel.php
NestedModel.determineDepth
protected function determineDepth( $node, $nesting = 0 ) { // Traverse back up the ancestry chain and add to the nesting level count while ( $parent = $node->parent()->first() ) { $nesting = $nesting + 1; $node = $parent; } return [$node, $nesting]; }
php
protected function determineDepth( $node, $nesting = 0 ) { // Traverse back up the ancestry chain and add to the nesting level count while ( $parent = $node->parent()->first() ) { $nesting = $nesting + 1; $node = $parent; } return [$node, $nesting]; }
[ "protected", "function", "determineDepth", "(", "$", "node", ",", "$", "nesting", "=", "0", ")", "{", "// Traverse back up the ancestry chain and add to the nesting level count", "while", "(", "$", "parent", "=", "$", "node", "->", "parent", "(", ")", "->", "first...
Return an array with the last node we could reach and its nesting level @param Baum\Node $node @param integer $nesting @return array
[ "Return", "an", "array", "with", "the", "last", "node", "we", "could", "reach", "and", "its", "nesting", "level" ]
8afd7156610a70371aa5b1df50b8a212bf7b142c
https://github.com/PenoaksDev/Milky-Framework/blob/8afd7156610a70371aa5b1df50b8a212bf7b142c/src/Milky/Database/Eloquent/Nested/NestedModel.php#L1337-L1348
198,833
NukaCode/core
src/NukaCode/Core/Http/Controllers/BaseController.php
BaseController.setJavascriptData
protected function setJavascriptData($key, $value = null) { if (is_array($key)) { JavaScriptFacade::put($key); } else { JavaScriptFacade::put([$key => $value]); } }
php
protected function setJavascriptData($key, $value = null) { if (is_array($key)) { JavaScriptFacade::put($key); } else { JavaScriptFacade::put([$key => $value]); } }
[ "protected", "function", "setJavascriptData", "(", "$", "key", ",", "$", "value", "=", "null", ")", "{", "if", "(", "is_array", "(", "$", "key", ")", ")", "{", "JavaScriptFacade", "::", "put", "(", "$", "key", ")", ";", "}", "else", "{", "JavaScriptF...
Pass data directly to Javascript. @link https://github.com/laracasts/PHP-Vars-To-Js-Transformer @param mixed $key @param mixed $value @return $this
[ "Pass", "data", "directly", "to", "Javascript", "." ]
75b20903fb068a7df22cdec34ae729279fbaab3c
https://github.com/NukaCode/core/blob/75b20903fb068a7df22cdec34ae729279fbaab3c/src/NukaCode/Core/Http/Controllers/BaseController.php#L75-L82
198,834
ddrv-test/firmapi-core
src/Object/Company.php
Company.actionAdd
protected function actionAdd($params=array()) { $response = array( 'errors' => array(), 'data' => array(), ); $values = $this->company->prepareParams($params); if (empty($values['name'])) { $response['errors'][] = 'cmp01'; } ...
php
protected function actionAdd($params=array()) { $response = array( 'errors' => array(), 'data' => array(), ); $values = $this->company->prepareParams($params); if (empty($values['name'])) { $response['errors'][] = 'cmp01'; } ...
[ "protected", "function", "actionAdd", "(", "$", "params", "=", "array", "(", ")", ")", "{", "$", "response", "=", "array", "(", "'errors'", "=>", "array", "(", ")", ",", "'data'", "=>", "array", "(", ")", ",", ")", ";", "$", "values", "=", "$", "...
Add company. @param array $params @return array
[ "Add", "company", "." ]
8f8843f0fb134568e7764cabd5039e15c579976d
https://github.com/ddrv-test/firmapi-core/blob/8f8843f0fb134568e7764cabd5039e15c579976d/src/Object/Company.php#L75-L107
198,835
Weblab-nl/restclient
src/RESTClient.php
RESTClient.put
public function put($url, $params, $options = [], $headers = []) { return $this->update('put', $url, $params, $options, $headers); }
php
public function put($url, $params, $options = [], $headers = []) { return $this->update('put', $url, $params, $options, $headers); }
[ "public", "function", "put", "(", "$", "url", ",", "$", "params", ",", "$", "options", "=", "[", "]", ",", "$", "headers", "=", "[", "]", ")", "{", "return", "$", "this", "->", "update", "(", "'put'", ",", "$", "url", ",", "$", "params", ",", ...
Do a PUT request @param string $url @param array $params @param array $options @param array $headers @return mixed @throws \Exception
[ "Do", "a", "PUT", "request" ]
6bc4e7890580b7b31e78032e40be5a67122b0dd0
https://github.com/Weblab-nl/restclient/blob/6bc4e7890580b7b31e78032e40be5a67122b0dd0/src/RESTClient.php#L115-L117
198,836
Weblab-nl/restclient
src/RESTClient.php
RESTClient.update
protected function update($type, $url, $params, $options = [], $headers = []) { return $this->makeCall($type, $url, $params, $options, $headers); }
php
protected function update($type, $url, $params, $options = [], $headers = []) { return $this->makeCall($type, $url, $params, $options, $headers); }
[ "protected", "function", "update", "(", "$", "type", ",", "$", "url", ",", "$", "params", ",", "$", "options", "=", "[", "]", ",", "$", "headers", "=", "[", "]", ")", "{", "return", "$", "this", "->", "makeCall", "(", "$", "type", ",", "$", "ur...
Proxy function for both edit requests types @param string $type @param string $url @param array $params @param array $options @param array $headers @return mixed @throws \Exception
[ "Proxy", "function", "for", "both", "edit", "requests", "types" ]
6bc4e7890580b7b31e78032e40be5a67122b0dd0
https://github.com/Weblab-nl/restclient/blob/6bc4e7890580b7b31e78032e40be5a67122b0dd0/src/RESTClient.php#L144-L146
198,837
Weblab-nl/restclient
src/RESTClient.php
RESTClient.makeCall
protected function makeCall($type, $url, $params, $options, $headers) { // Throw exception when adapter is not set if (!isset($this->adapter)) { throw new NoAdapterException('No adapter set'); } // Remove potential leading slashes if (substr($url, 0, 1) === '/') { ...
php
protected function makeCall($type, $url, $params, $options, $headers) { // Throw exception when adapter is not set if (!isset($this->adapter)) { throw new NoAdapterException('No adapter set'); } // Remove potential leading slashes if (substr($url, 0, 1) === '/') { ...
[ "protected", "function", "makeCall", "(", "$", "type", ",", "$", "url", ",", "$", "params", ",", "$", "options", ",", "$", "headers", ")", "{", "// Throw exception when adapter is not set", "if", "(", "!", "isset", "(", "$", "this", "->", "adapter", ")", ...
Calls the adapter which will perform the request @param string $type @param string $url @param array $params @param array $options @param array $headers @return Result @throws NoAdapterException @throws \Exception
[ "Calls", "the", "adapter", "which", "will", "perform", "the", "request" ]
6bc4e7890580b7b31e78032e40be5a67122b0dd0
https://github.com/Weblab-nl/restclient/blob/6bc4e7890580b7b31e78032e40be5a67122b0dd0/src/RESTClient.php#L174-L190
198,838
Weblab-nl/restclient
src/RESTClient.php
RESTClient.runResponseHandler
protected function runResponseHandler(Result $result, $type, $url, $params) { // Check if a status specific handler isset or else fallback to the default if (isset($this->responseHandlers[$result->getStatus()])) { $handler = $this->responseHandlers[$result->getStatus()]; } else { ...
php
protected function runResponseHandler(Result $result, $type, $url, $params) { // Check if a status specific handler isset or else fallback to the default if (isset($this->responseHandlers[$result->getStatus()])) { $handler = $this->responseHandlers[$result->getStatus()]; } else { ...
[ "protected", "function", "runResponseHandler", "(", "Result", "$", "result", ",", "$", "type", ",", "$", "url", ",", "$", "params", ")", "{", "// Check if a status specific handler isset or else fallback to the default", "if", "(", "isset", "(", "$", "this", "->", ...
Run the correct response handler function @param Result $result @param string $type @param string $url @param array $params @return Result @throws \Exception
[ "Run", "the", "correct", "response", "handler", "function" ]
6bc4e7890580b7b31e78032e40be5a67122b0dd0
https://github.com/Weblab-nl/restclient/blob/6bc4e7890580b7b31e78032e40be5a67122b0dd0/src/RESTClient.php#L215-L234
198,839
proem-components/service
AssetManager.php
AssetManager.set
public function set($index, AssetInterface $asset) { $this->data[$index] = $asset; $this->provides[] = $asset->is(); return $this; }
php
public function set($index, AssetInterface $asset) { $this->data[$index] = $asset; $this->provides[] = $asset->is(); return $this; }
[ "public", "function", "set", "(", "$", "index", ",", "AssetInterface", "$", "asset", ")", "{", "$", "this", "->", "data", "[", "$", "index", "]", "=", "$", "asset", ";", "$", "this", "->", "provides", "[", "]", "=", "$", "asset", "->", "is", "(",...
Store an Asset container by named index. @param string $index The index the asset will be referenced by. @param Proem\Service\AssetInterface $asset @return Proem\Service\AssetManagerInterface
[ "Store", "an", "Asset", "container", "by", "named", "index", "." ]
8c8e9547f16ecaa2789482f34947618f96e453cc
https://github.com/proem-components/service/blob/8c8e9547f16ecaa2789482f34947618f96e453cc/AssetManager.php#L75-L80
198,840
proem-components/service
AssetManager.php
AssetManager.get
public function get($index, array $params = [], $asAsset = false) { if (!$asAsset) { return isset($this->data[$index]) ? $this->data[$index]->fetch($params, $this) : null; } return isset($this->data[$index]) ? $this->data[$index] : null; }
php
public function get($index, array $params = [], $asAsset = false) { if (!$asAsset) { return isset($this->data[$index]) ? $this->data[$index]->fetch($params, $this) : null; } return isset($this->data[$index]) ? $this->data[$index] : null; }
[ "public", "function", "get", "(", "$", "index", ",", "array", "$", "params", "=", "[", "]", ",", "$", "asAsset", "=", "false", ")", "{", "if", "(", "!", "$", "asAsset", ")", "{", "return", "isset", "(", "$", "this", "->", "data", "[", "$", "ind...
Retrieve an asset. Returns an instantiated obejct by default or optionaly the asset container itself. @param string $index The index the asset is referenced by @param array $params Allow last minute setting of parameters. @param bool Wether or not to return the asset's object or container @return object The object pr...
[ "Retrieve", "an", "asset", "." ]
8c8e9547f16ecaa2789482f34947618f96e453cc
https://github.com/proem-components/service/blob/8c8e9547f16ecaa2789482f34947618f96e453cc/AssetManager.php#L93-L100
198,841
lassodatasystems/LassoMailParserBundle
Parser.php
Parser.parse
public function parse($mail) { // Initial /** @var Part $mailPart */ $mailPart = $this->workAroundMissingBoundary( $this->partFactory->getPart($mail), $mail ); $partTreeFactory = new PartTreeFactory($this->partFactory); $partTree = $partTreeFa...
php
public function parse($mail) { // Initial /** @var Part $mailPart */ $mailPart = $this->workAroundMissingBoundary( $this->partFactory->getPart($mail), $mail ); $partTreeFactory = new PartTreeFactory($this->partFactory); $partTree = $partTreeFa...
[ "public", "function", "parse", "(", "$", "mail", ")", "{", "// Initial", "/** @var Part $mailPart */", "$", "mailPart", "=", "$", "this", "->", "workAroundMissingBoundary", "(", "$", "this", "->", "partFactory", "->", "getPart", "(", "$", "mail", ")", ",", "...
Accepts the raw email as a string, including headers and body. Has to be called before the other functions are available. @param string $mail @return ParsedMail
[ "Accepts", "the", "raw", "email", "as", "a", "string", "including", "headers", "and", "body", ".", "Has", "to", "be", "called", "before", "the", "other", "functions", "are", "available", "." ]
c7d2bde3034462fd305e38481cfb737b50eede0a
https://github.com/lassodatasystems/LassoMailParserBundle/blob/c7d2bde3034462fd305e38481cfb737b50eede0a/Parser.php#L57-L88
198,842
lassodatasystems/LassoMailParserBundle
Parser.php
Parser.workAroundMissingBoundary
private function workAroundMissingBoundary(Part $part, $rawMailBody) { try { $part->countParts(); } catch (RuntimeException $e) { if (count($part->getHeaders()) > 0 && $part->getHeaders()->has('Content-Type') && array_key_exists('boundary', $th...
php
private function workAroundMissingBoundary(Part $part, $rawMailBody) { try { $part->countParts(); } catch (RuntimeException $e) { if (count($part->getHeaders()) > 0 && $part->getHeaders()->has('Content-Type') && array_key_exists('boundary', $th...
[ "private", "function", "workAroundMissingBoundary", "(", "Part", "$", "part", ",", "$", "rawMailBody", ")", "{", "try", "{", "$", "part", "->", "countParts", "(", ")", ";", "}", "catch", "(", "RuntimeException", "$", "e", ")", "{", "if", "(", "count", ...
Some emails are missing a MIME closing boundary. This violations the standard, but most software still handles it well - except the Zend Framework, who rather don't want to accommodate broken emails. Since they don't provide any meaningful way to test if the message was decoded correctly (like a $part->test() method o...
[ "Some", "emails", "are", "missing", "a", "MIME", "closing", "boundary", ".", "This", "violations", "the", "standard", "but", "most", "software", "still", "handles", "it", "well", "-", "except", "the", "Zend", "Framework", "who", "rather", "don", "t", "want",...
c7d2bde3034462fd305e38481cfb737b50eede0a
https://github.com/lassodatasystems/LassoMailParserBundle/blob/c7d2bde3034462fd305e38481cfb737b50eede0a/Parser.php#L106-L128
198,843
lassodatasystems/LassoMailParserBundle
Parser.php
Parser.getLoggingEmails
private function getLoggingEmails($mail, $parts) { $emailAddresses = $this->flattenEmailAddresses( $this->getAllEmailAddresses($parts) ); $messageIds = []; $headers = $mail->getHeaders(); if (!empty($headers) && $headers->has('message-id')) { $mess...
php
private function getLoggingEmails($mail, $parts) { $emailAddresses = $this->flattenEmailAddresses( $this->getAllEmailAddresses($parts) ); $messageIds = []; $headers = $mail->getHeaders(); if (!empty($headers) && $headers->has('message-id')) { $mess...
[ "private", "function", "getLoggingEmails", "(", "$", "mail", ",", "$", "parts", ")", "{", "$", "emailAddresses", "=", "$", "this", "->", "flattenEmailAddresses", "(", "$", "this", "->", "getAllEmailAddresses", "(", "$", "parts", ")", ")", ";", "$", "messag...
Returns a list of all emails in the parser, including the message id. This is mostly useful for logging. @param Part $mail @param Part[] $parts @return array
[ "Returns", "a", "list", "of", "all", "emails", "in", "the", "parser", "including", "the", "message", "id", ".", "This", "is", "mostly", "useful", "for", "logging", "." ]
c7d2bde3034462fd305e38481cfb737b50eede0a
https://github.com/lassodatasystems/LassoMailParserBundle/blob/c7d2bde3034462fd305e38481cfb737b50eede0a/Parser.php#L141-L169
198,844
lassodatasystems/LassoMailParserBundle
Parser.php
Parser.flattenEmailAddresses
private function flattenEmailAddresses($emailAddressesByField) { $flattened = []; foreach ($emailAddressesByField as $field => $emailAddresses) { foreach ($emailAddresses as $emailAddress) { $flattened[] = $emailAddress; } } return array_unique($f...
php
private function flattenEmailAddresses($emailAddressesByField) { $flattened = []; foreach ($emailAddressesByField as $field => $emailAddresses) { foreach ($emailAddresses as $emailAddress) { $flattened[] = $emailAddress; } } return array_unique($f...
[ "private", "function", "flattenEmailAddresses", "(", "$", "emailAddressesByField", ")", "{", "$", "flattened", "=", "[", "]", ";", "foreach", "(", "$", "emailAddressesByField", "as", "$", "field", "=>", "$", "emailAddresses", ")", "{", "foreach", "(", "$", "...
Takes the hash of email address and the field they were found in and returns a flattened array of those email addresses. @param $emailAddressesByField @return array
[ "Takes", "the", "hash", "of", "email", "address", "and", "the", "field", "they", "were", "found", "in", "and", "returns", "a", "flattened", "array", "of", "those", "email", "addresses", "." ]
c7d2bde3034462fd305e38481cfb737b50eede0a
https://github.com/lassodatasystems/LassoMailParserBundle/blob/c7d2bde3034462fd305e38481cfb737b50eede0a/Parser.php#L179-L188
198,845
lassodatasystems/LassoMailParserBundle
Parser.php
Parser.getAddressesFromFieldInPart
private function getAddressesFromFieldInPart($field, Part $part) { $addresses = []; $headers = $part->getHeaders(); if (empty($headers)) { return $addresses; } if (!$headers->has($field)) { return $addresses; } /** @var AbstractAddre...
php
private function getAddressesFromFieldInPart($field, Part $part) { $addresses = []; $headers = $part->getHeaders(); if (empty($headers)) { return $addresses; } if (!$headers->has($field)) { return $addresses; } /** @var AbstractAddre...
[ "private", "function", "getAddressesFromFieldInPart", "(", "$", "field", ",", "Part", "$", "part", ")", "{", "$", "addresses", "=", "[", "]", ";", "$", "headers", "=", "$", "part", "->", "getHeaders", "(", ")", ";", "if", "(", "empty", "(", "$", "hea...
Retrieves the addresses from a specific field in a part @param string $field @param Part $part @return array
[ "Retrieves", "the", "addresses", "from", "a", "specific", "field", "in", "a", "part" ]
c7d2bde3034462fd305e38481cfb737b50eede0a
https://github.com/lassodatasystems/LassoMailParserBundle/blob/c7d2bde3034462fd305e38481cfb737b50eede0a/Parser.php#L223-L254
198,846
fridge-project/dbal
src/Fridge/DBAL/SchemaManager/SQLCollector/AlterTableSQLCollector.php
AlterTableSQLCollector.init
public function init() { $this->renameTableQueries = array(); $this->dropCheckQueries = array(); $this->dropForeignKeyQueries = array(); $this->dropIndexQueries = array(); $this->dropPrimaryKeyQueries = array(); $this->dropColumnQueries = array(); $this->alter...
php
public function init() { $this->renameTableQueries = array(); $this->dropCheckQueries = array(); $this->dropForeignKeyQueries = array(); $this->dropIndexQueries = array(); $this->dropPrimaryKeyQueries = array(); $this->dropColumnQueries = array(); $this->alter...
[ "public", "function", "init", "(", ")", "{", "$", "this", "->", "renameTableQueries", "=", "array", "(", ")", ";", "$", "this", "->", "dropCheckQueries", "=", "array", "(", ")", ";", "$", "this", "->", "dropForeignKeyQueries", "=", "array", "(", ")", "...
Reinitilizes SQL collector.
[ "Reinitilizes", "SQL", "collector", "." ]
d0b8c3551922d696836487aa0eb1bd74014edcd4
https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/SchemaManager/SQLCollector/AlterTableSQLCollector.php#L112-L126
198,847
fridge-project/dbal
src/Fridge/DBAL/SchemaManager/SQLCollector/AlterTableSQLCollector.php
AlterTableSQLCollector.collect
public function collect(TableDiff $tableDiff) { if ($tableDiff->getOldAsset()->getName() !== $tableDiff->getNewAsset()->getName()) { $this->renameTableQueries = array_merge( $this->renameTableQueries, $this->platform->getRenameTableSQLQueries($tableDiff) ...
php
public function collect(TableDiff $tableDiff) { if ($tableDiff->getOldAsset()->getName() !== $tableDiff->getNewAsset()->getName()) { $this->renameTableQueries = array_merge( $this->renameTableQueries, $this->platform->getRenameTableSQLQueries($tableDiff) ...
[ "public", "function", "collect", "(", "TableDiff", "$", "tableDiff", ")", "{", "if", "(", "$", "tableDiff", "->", "getOldAsset", "(", ")", "->", "getName", "(", ")", "!==", "$", "tableDiff", "->", "getNewAsset", "(", ")", "->", "getName", "(", ")", ")"...
Collects queries to alter tables. @param \Fridge\DBAL\Schema\Diff\TableDiff $tableDiff The table difference.
[ "Collects", "queries", "to", "alter", "tables", "." ]
d0b8c3551922d696836487aa0eb1bd74014edcd4
https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/SchemaManager/SQLCollector/AlterTableSQLCollector.php#L133-L147
198,848
fridge-project/dbal
src/Fridge/DBAL/SchemaManager/SQLCollector/AlterTableSQLCollector.php
AlterTableSQLCollector.getQueries
public function getQueries() { return array_merge( $this->getRenameTableQueries(), $this->getDropCheckQueries(), $this->getDropForeignKeyQueries(), $this->getDropIndexQueries(), $this->getDropPrimaryKeyQueries(), $this->getDropColumnQue...
php
public function getQueries() { return array_merge( $this->getRenameTableQueries(), $this->getDropCheckQueries(), $this->getDropForeignKeyQueries(), $this->getDropIndexQueries(), $this->getDropPrimaryKeyQueries(), $this->getDropColumnQue...
[ "public", "function", "getQueries", "(", ")", "{", "return", "array_merge", "(", "$", "this", "->", "getRenameTableQueries", "(", ")", ",", "$", "this", "->", "getDropCheckQueries", "(", ")", ",", "$", "this", "->", "getDropForeignKeyQueries", "(", ")", ",",...
Gets the queries collected to alter the table. @return array The queries collected to alter the table.
[ "Gets", "the", "queries", "collected", "to", "alter", "the", "table", "." ]
d0b8c3551922d696836487aa0eb1bd74014edcd4
https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/SchemaManager/SQLCollector/AlterTableSQLCollector.php#L274-L290
198,849
fridge-project/dbal
src/Fridge/DBAL/SchemaManager/SQLCollector/AlterTableSQLCollector.php
AlterTableSQLCollector.collectColumns
private function collectColumns(TableDiff $tableDiff) { foreach ($tableDiff->getCreatedColumns() as $column) { $this->createColumnQueries = array_merge( $this->createColumnQueries, $this->platform->getCreateColumnSQLQueries($column, $tableDiff->getNewAsset()->getN...
php
private function collectColumns(TableDiff $tableDiff) { foreach ($tableDiff->getCreatedColumns() as $column) { $this->createColumnQueries = array_merge( $this->createColumnQueries, $this->platform->getCreateColumnSQLQueries($column, $tableDiff->getNewAsset()->getN...
[ "private", "function", "collectColumns", "(", "TableDiff", "$", "tableDiff", ")", "{", "foreach", "(", "$", "tableDiff", "->", "getCreatedColumns", "(", ")", "as", "$", "column", ")", "{", "$", "this", "->", "createColumnQueries", "=", "array_merge", "(", "$...
Collects queries about column to alter a table. @param \Fridge\DBAL\Schema\Diff\TableDiff $tableDiff The table difference.
[ "Collects", "queries", "about", "column", "to", "alter", "a", "table", "." ]
d0b8c3551922d696836487aa0eb1bd74014edcd4
https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/SchemaManager/SQLCollector/AlterTableSQLCollector.php#L297-L319
198,850
fridge-project/dbal
src/Fridge/DBAL/SchemaManager/SQLCollector/AlterTableSQLCollector.php
AlterTableSQLCollector.collectPrimaryKeys
private function collectPrimaryKeys(TableDiff $tableDiff) { if ($tableDiff->getCreatedPrimaryKey() !== null) { $this->createPrimaryKeyQueries = array_merge( $this->createPrimaryKeyQueries, $this->platform->getCreatePrimaryKeySQLQueries( $tableD...
php
private function collectPrimaryKeys(TableDiff $tableDiff) { if ($tableDiff->getCreatedPrimaryKey() !== null) { $this->createPrimaryKeyQueries = array_merge( $this->createPrimaryKeyQueries, $this->platform->getCreatePrimaryKeySQLQueries( $tableD...
[ "private", "function", "collectPrimaryKeys", "(", "TableDiff", "$", "tableDiff", ")", "{", "if", "(", "$", "tableDiff", "->", "getCreatedPrimaryKey", "(", ")", "!==", "null", ")", "{", "$", "this", "->", "createPrimaryKeyQueries", "=", "array_merge", "(", "$",...
Collect queries about primary keys to alter a table. @param \Fridge\DBAL\Schema\Diff\TableDiff $tableDiff The table difference.
[ "Collect", "queries", "about", "primary", "keys", "to", "alter", "a", "table", "." ]
d0b8c3551922d696836487aa0eb1bd74014edcd4
https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/SchemaManager/SQLCollector/AlterTableSQLCollector.php#L326-L347
198,851
fridge-project/dbal
src/Fridge/DBAL/SchemaManager/SQLCollector/AlterTableSQLCollector.php
AlterTableSQLCollector.collectForeignKeys
private function collectForeignKeys(TableDiff $tableDiff) { foreach ($tableDiff->getCreatedForeignKeys() as $foreignKey) { $this->createForeignKeyQueries = array_merge( $this->createForeignKeyQueries, $this->platform->getCreateForeignKeySQLQueries($foreignKey, $ta...
php
private function collectForeignKeys(TableDiff $tableDiff) { foreach ($tableDiff->getCreatedForeignKeys() as $foreignKey) { $this->createForeignKeyQueries = array_merge( $this->createForeignKeyQueries, $this->platform->getCreateForeignKeySQLQueries($foreignKey, $ta...
[ "private", "function", "collectForeignKeys", "(", "TableDiff", "$", "tableDiff", ")", "{", "foreach", "(", "$", "tableDiff", "->", "getCreatedForeignKeys", "(", ")", "as", "$", "foreignKey", ")", "{", "$", "this", "->", "createForeignKeyQueries", "=", "array_mer...
Collects queries about foreign keys to alter a table. @param \Fridge\DBAL\Schema\Diff\TableDiff $tableDiff The table difference.
[ "Collects", "queries", "about", "foreign", "keys", "to", "alter", "a", "table", "." ]
d0b8c3551922d696836487aa0eb1bd74014edcd4
https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/SchemaManager/SQLCollector/AlterTableSQLCollector.php#L354-L369
198,852
fridge-project/dbal
src/Fridge/DBAL/SchemaManager/SQLCollector/AlterTableSQLCollector.php
AlterTableSQLCollector.collectIndexes
private function collectIndexes(TableDiff $tableDiff) { foreach ($tableDiff->getCreatedIndexes() as $index) { $this->createIndexQueries = array_merge( $this->createIndexQueries, $this->platform->getCreateIndexSQLQueries($index, $tableDiff->getNewAsset()->getName()...
php
private function collectIndexes(TableDiff $tableDiff) { foreach ($tableDiff->getCreatedIndexes() as $index) { $this->createIndexQueries = array_merge( $this->createIndexQueries, $this->platform->getCreateIndexSQLQueries($index, $tableDiff->getNewAsset()->getName()...
[ "private", "function", "collectIndexes", "(", "TableDiff", "$", "tableDiff", ")", "{", "foreach", "(", "$", "tableDiff", "->", "getCreatedIndexes", "(", ")", "as", "$", "index", ")", "{", "$", "this", "->", "createIndexQueries", "=", "array_merge", "(", "$",...
Collects queries about indexes to alter a table. @param \Fridge\DBAL\Schema\Diff\TableDiff $tableDiff The table difference.
[ "Collects", "queries", "about", "indexes", "to", "alter", "a", "table", "." ]
d0b8c3551922d696836487aa0eb1bd74014edcd4
https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/SchemaManager/SQLCollector/AlterTableSQLCollector.php#L376-L391
198,853
fridge-project/dbal
src/Fridge/DBAL/SchemaManager/SQLCollector/AlterTableSQLCollector.php
AlterTableSQLCollector.collectChecks
private function collectChecks(TableDiff $tableDiff) { foreach ($tableDiff->getCreatedChecks() as $check) { $this->createCheckQueries = array_merge( $this->createCheckQueries, $this->platform->getCreateCheckSQLQueries($check, $tableDiff->getNewAsset()->getName()) ...
php
private function collectChecks(TableDiff $tableDiff) { foreach ($tableDiff->getCreatedChecks() as $check) { $this->createCheckQueries = array_merge( $this->createCheckQueries, $this->platform->getCreateCheckSQLQueries($check, $tableDiff->getNewAsset()->getName()) ...
[ "private", "function", "collectChecks", "(", "TableDiff", "$", "tableDiff", ")", "{", "foreach", "(", "$", "tableDiff", "->", "getCreatedChecks", "(", ")", "as", "$", "check", ")", "{", "$", "this", "->", "createCheckQueries", "=", "array_merge", "(", "$", ...
Collects queries about checks to alter a table. @param \Fridge\DBAL\Schema\Diff\TableDiff $tableDiff The table difference.
[ "Collects", "queries", "about", "checks", "to", "alter", "a", "table", "." ]
d0b8c3551922d696836487aa0eb1bd74014edcd4
https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/SchemaManager/SQLCollector/AlterTableSQLCollector.php#L398-L413
198,854
SlaxWeb/Hooks
src/Factory.php
Factory.init
public static function init(Config $config): Container { $logger = Logger::init($config); return new Container($logger); }
php
public static function init(Config $config): Container { $logger = Logger::init($config); return new Container($logger); }
[ "public", "static", "function", "init", "(", "Config", "$", "config", ")", ":", "Container", "{", "$", "logger", "=", "Logger", "::", "init", "(", "$", "config", ")", ";", "return", "new", "Container", "(", "$", "logger", ")", ";", "}" ]
Initiate Hooks Container Init the logger through its own factory and create an object of the Hooks container, and return it to the caller. For this the configuration component is required, so the logger can be instantiated. @param \SlaxWeb\Config\Container $config Configuration component @return \SlaxWeb\Hooks\Contai...
[ "Initiate", "Hooks", "Container" ]
678f4d5425c27e0dd2a61b68d59bfb2793955b91
https://github.com/SlaxWeb/Hooks/blob/678f4d5425c27e0dd2a61b68d59bfb2793955b91/src/Factory.php#L32-L36
198,855
horntell/php-sdk
lib/guzzle/GuzzleHttp/Event/RequestEvents.php
RequestEvents.emitBefore
public static function emitBefore(TransactionInterface $transaction) { $request = $transaction->getRequest(); try { $request->getEmitter()->emit( 'before', new BeforeEvent($transaction) ); } catch (RequestException $e) { // ...
php
public static function emitBefore(TransactionInterface $transaction) { $request = $transaction->getRequest(); try { $request->getEmitter()->emit( 'before', new BeforeEvent($transaction) ); } catch (RequestException $e) { // ...
[ "public", "static", "function", "emitBefore", "(", "TransactionInterface", "$", "transaction", ")", "{", "$", "request", "=", "$", "transaction", "->", "getRequest", "(", ")", ";", "try", "{", "$", "request", "->", "getEmitter", "(", ")", "->", "emit", "("...
Emits the before send event for a request and emits an error event if an error is encountered during the before send. @param TransactionInterface $transaction @throws RequestException
[ "Emits", "the", "before", "send", "event", "for", "a", "request", "and", "emits", "an", "error", "event", "if", "an", "error", "is", "encountered", "during", "the", "before", "send", "." ]
e5205e9396a21b754d5651a8aa5898da5922a1b7
https://github.com/horntell/php-sdk/blob/e5205e9396a21b754d5651a8aa5898da5922a1b7/lib/guzzle/GuzzleHttp/Event/RequestEvents.php#L33-L55
198,856
horntell/php-sdk
lib/guzzle/GuzzleHttp/Event/RequestEvents.php
RequestEvents.emitComplete
public static function emitComplete( TransactionInterface $transaction, array $stats = [] ) { $request = $transaction->getRequest(); $transaction->getResponse()->setEffectiveUrl($request->getUrl()); try { $request->getEmitter()->emit( 'complete', ...
php
public static function emitComplete( TransactionInterface $transaction, array $stats = [] ) { $request = $transaction->getRequest(); $transaction->getResponse()->setEffectiveUrl($request->getUrl()); try { $request->getEmitter()->emit( 'complete', ...
[ "public", "static", "function", "emitComplete", "(", "TransactionInterface", "$", "transaction", ",", "array", "$", "stats", "=", "[", "]", ")", "{", "$", "request", "=", "$", "transaction", "->", "getRequest", "(", ")", ";", "$", "transaction", "->", "get...
Emits the complete event for a request and emits an error event if an error is encountered during the after send. @param TransactionInterface $transaction Transaction to emit for @param array $stats Transfer stats @throws RequestException
[ "Emits", "the", "complete", "event", "for", "a", "request", "and", "emits", "an", "error", "event", "if", "an", "error", "is", "encountered", "during", "the", "after", "send", "." ]
e5205e9396a21b754d5651a8aa5898da5922a1b7
https://github.com/horntell/php-sdk/blob/e5205e9396a21b754d5651a8aa5898da5922a1b7/lib/guzzle/GuzzleHttp/Event/RequestEvents.php#L66-L80
198,857
horntell/php-sdk
lib/guzzle/GuzzleHttp/Event/RequestEvents.php
RequestEvents.emitError
public static function emitError( TransactionInterface $transaction, \Exception $e, array $stats = [] ) { $request = $transaction->getRequest(); // Convert non-request exception to a wrapped exception if (!($e instanceof RequestException)) { $e = new Requ...
php
public static function emitError( TransactionInterface $transaction, \Exception $e, array $stats = [] ) { $request = $transaction->getRequest(); // Convert non-request exception to a wrapped exception if (!($e instanceof RequestException)) { $e = new Requ...
[ "public", "static", "function", "emitError", "(", "TransactionInterface", "$", "transaction", ",", "\\", "Exception", "$", "e", ",", "array", "$", "stats", "=", "[", "]", ")", "{", "$", "request", "=", "$", "transaction", "->", "getRequest", "(", ")", ";...
Emits an error event for a request and accounts for the propagation of an error event being stopped to prevent the exception from being thrown. @param TransactionInterface $transaction @param \Exception $e @param array $stats @throws \GuzzleHttp\Exception\RequestException
[ "Emits", "an", "error", "event", "for", "a", "request", "and", "accounts", "for", "the", "propagation", "of", "an", "error", "event", "being", "stopped", "to", "prevent", "the", "exception", "from", "being", "thrown", "." ]
e5205e9396a21b754d5651a8aa5898da5922a1b7
https://github.com/horntell/php-sdk/blob/e5205e9396a21b754d5651a8aa5898da5922a1b7/lib/guzzle/GuzzleHttp/Event/RequestEvents.php#L106-L130
198,858
horntell/php-sdk
lib/guzzle/GuzzleHttp/Event/RequestEvents.php
RequestEvents.convertEventArray
public static function convertEventArray( array $options, array $events, $handler ) { foreach ($events as $name) { if (!isset($options[$name])) { $options[$name] = [$handler]; } elseif (is_callable($options[$name])) { $options[$...
php
public static function convertEventArray( array $options, array $events, $handler ) { foreach ($events as $name) { if (!isset($options[$name])) { $options[$name] = [$handler]; } elseif (is_callable($options[$name])) { $options[$...
[ "public", "static", "function", "convertEventArray", "(", "array", "$", "options", ",", "array", "$", "events", ",", "$", "handler", ")", "{", "foreach", "(", "$", "events", "as", "$", "name", ")", "{", "if", "(", "!", "isset", "(", "$", "options", "...
Converts an array of event options into a formatted array of valid event configuration. @param array $options Event array to convert @param array $events Event names to convert in the options array. @param mixed $handler Event handler to utilize @return array @throws \InvalidArgumentException if the event config is ...
[ "Converts", "an", "array", "of", "event", "options", "into", "a", "formatted", "array", "of", "valid", "event", "configuration", "." ]
e5205e9396a21b754d5651a8aa5898da5922a1b7
https://github.com/horntell/php-sdk/blob/e5205e9396a21b754d5651a8aa5898da5922a1b7/lib/guzzle/GuzzleHttp/Event/RequestEvents.php#L144-L166
198,859
Raphhh/puppy-application
src/Controller/FrontController.php
FrontController.addController
public function addController($uriPattern, callable $controller, $method='', $contentType='') { $routeBuilder = new RouteBuilder(); $routeBuilder ->addUriPattern($uriPattern) ->addController($controller, $this->getAppController()) ->addMethod($method) ...
php
public function addController($uriPattern, callable $controller, $method='', $contentType='') { $routeBuilder = new RouteBuilder(); $routeBuilder ->addUriPattern($uriPattern) ->addController($controller, $this->getAppController()) ->addMethod($method) ...
[ "public", "function", "addController", "(", "$", "uriPattern", ",", "callable", "$", "controller", ",", "$", "method", "=", "''", ",", "$", "contentType", "=", "''", ")", "{", "$", "routeBuilder", "=", "new", "RouteBuilder", "(", ")", ";", "$", "routeBui...
Adds a controller to the list of observed controllers. @param string $uriPattern @param callable $controller @param string $method @param string $contentType @return \Puppy\Route\Route
[ "Adds", "a", "controller", "to", "the", "list", "of", "observed", "controllers", "." ]
9291543cd28e19a2986abd7fb146898ca5f5f5da
https://github.com/Raphhh/puppy-application/blob/9291543cd28e19a2986abd7fb146898ca5f5f5da/src/Controller/FrontController.php#L44-L56
198,860
Raphhh/puppy-application
src/Controller/FrontController.php
FrontController.call
public function call(Request $request) { if($request !== $this->getRequestStack()->getCurrentRequest()){ $this->getRequestStack()->push($request); } if(!$request->getRequestFormat(null) && $request->getAcceptableContentTypes()){ $request->setRequestFormat($request->g...
php
public function call(Request $request) { if($request !== $this->getRequestStack()->getCurrentRequest()){ $this->getRequestStack()->push($request); } if(!$request->getRequestFormat(null) && $request->getAcceptableContentTypes()){ $request->setRequestFormat($request->g...
[ "public", "function", "call", "(", "Request", "$", "request", ")", "{", "if", "(", "$", "request", "!==", "$", "this", "->", "getRequestStack", "(", ")", "->", "getCurrentRequest", "(", ")", ")", "{", "$", "this", "->", "getRequestStack", "(", ")", "->...
Calls the controller matched with the request uri. @param Request $request @return Response
[ "Calls", "the", "controller", "matched", "with", "the", "request", "uri", "." ]
9291543cd28e19a2986abd7fb146898ca5f5f5da
https://github.com/Raphhh/puppy-application/blob/9291543cd28e19a2986abd7fb146898ca5f5f5da/src/Controller/FrontController.php#L64-L82
198,861
ValkSystems/bootbuilder
src/bootbuilder/Controls/TextArea.php
TextArea.renderBasic
public function renderBasic() { $html = "<textarea rows='$this->rows'"; $html .= " " . $this->getCompiledAttributes("form-control"); $html .= ">"; $html .= $this->value; $html .= "</textarea>"; return $html; }
php
public function renderBasic() { $html = "<textarea rows='$this->rows'"; $html .= " " . $this->getCompiledAttributes("form-control"); $html .= ">"; $html .= $this->value; $html .= "</textarea>"; return $html; }
[ "public", "function", "renderBasic", "(", ")", "{", "$", "html", "=", "\"<textarea rows='$this->rows'\"", ";", "$", "html", ".=", "\" \"", ".", "$", "this", "->", "getCompiledAttributes", "(", "\"form-control\"", ")", ";", "$", "html", ".=", "\">\"", ";", "$...
Render basics of textarea
[ "Render", "basics", "of", "textarea" ]
7601a403f42eba47ce4cf02a3c852d5196b1d860
https://github.com/ValkSystems/bootbuilder/blob/7601a403f42eba47ce4cf02a3c852d5196b1d860/src/bootbuilder/Controls/TextArea.php#L26-L33
198,862
SlaxWeb/Router
src/Response.php
Response.addContent
public function addContent(string $content): \Symfony\Component\HttpFoundation\Response { return $this->setContent($this->getContent() . $content); }
php
public function addContent(string $content): \Symfony\Component\HttpFoundation\Response { return $this->setContent($this->getContent() . $content); }
[ "public", "function", "addContent", "(", "string", "$", "content", ")", ":", "\\", "Symfony", "\\", "Component", "\\", "HttpFoundation", "\\", "Response", "{", "return", "$", "this", "->", "setContent", "(", "$", "this", "->", "getContent", "(", ")", ".", ...
Add To Content Add retrieved input to the end of already existing content in the Response object. @param string $content Content to be added. @return \Symfony\Component\HttpFoundation\Response
[ "Add", "To", "Content" ]
b4a25655710638c71787a8498d267a663ef2e819
https://github.com/SlaxWeb/Router/blob/b4a25655710638c71787a8498d267a663ef2e819/src/Response.php#L39-L42
198,863
nicolasdewez/webhome-common
Client/AbstractClient.php
AbstractClient.deserialize
protected function deserialize(ResponseInterface $response, $type, $format = 'json') { try { return $this->serializer->deserialize( (string) $response->getBody(), $type, $format ); } catch (\Exception $exception) { $...
php
protected function deserialize(ResponseInterface $response, $type, $format = 'json') { try { return $this->serializer->deserialize( (string) $response->getBody(), $type, $format ); } catch (\Exception $exception) { $...
[ "protected", "function", "deserialize", "(", "ResponseInterface", "$", "response", ",", "$", "type", ",", "$", "format", "=", "'json'", ")", "{", "try", "{", "return", "$", "this", "->", "serializer", "->", "deserialize", "(", "(", "string", ")", "$", "r...
Deserializes request content. @param ResponseInterface $response @param string $type @param string $format @return mixed @throws \Exception
[ "Deserializes", "request", "content", "." ]
a9f6f83fa929ebd0510818c388cfb1ed44b87205
https://github.com/nicolasdewez/webhome-common/blob/a9f6f83fa929ebd0510818c388cfb1ed44b87205/Client/AbstractClient.php#L95-L114
198,864
Subscribo/psr-http-message-tools
src/Factories/RequestFactory.php
RequestFactory.make
public static function make($uri, $data = null, array $queryParameters = [], array $headers = [], $method = null, $contentType = null, $contentCharset = null) { if (is_null($method)) { $method = is_null($data) ? static::METHOD_GET : static::METHOD_POST; } $uri = UriFactory::make(...
php
public static function make($uri, $data = null, array $queryParameters = [], array $headers = [], $method = null, $contentType = null, $contentCharset = null) { if (is_null($method)) { $method = is_null($data) ? static::METHOD_GET : static::METHOD_POST; } $uri = UriFactory::make(...
[ "public", "static", "function", "make", "(", "$", "uri", ",", "$", "data", "=", "null", ",", "array", "$", "queryParameters", "=", "[", "]", ",", "array", "$", "headers", "=", "[", "]", ",", "$", "method", "=", "null", ",", "$", "contentType", "=",...
Makes PSR-7 compliant Request object from provided parameters @param UriInterface|string $uri @param null|string|array $data @param array $queryParameters @param array $headers @param null|string $method @param null|string $contentType @param null|string $contentCharset @return RequestInterface @throws InvalidArgument...
[ "Makes", "PSR", "-", "7", "compliant", "Request", "object", "from", "provided", "parameters" ]
b1dfa0b1dd646f353634b5c9603fd6c75a7b73bd
https://github.com/Subscribo/psr-http-message-tools/blob/b1dfa0b1dd646f353634b5c9603fd6c75a7b73bd/src/Factories/RequestFactory.php#L40-L71
198,865
Subscribo/psr-http-message-tools
src/Factories/RequestFactory.php
RequestFactory.extractCharset
private static function extractCharset(array $contentTypeParts) { foreach ($contentTypeParts as $part) { $elements = explode('=', $part); $key = trim(array_shift($elements)); if (strtolower($key) === 'charset') { $value = trim(reset($elements)); ...
php
private static function extractCharset(array $contentTypeParts) { foreach ($contentTypeParts as $part) { $elements = explode('=', $part); $key = trim(array_shift($elements)); if (strtolower($key) === 'charset') { $value = trim(reset($elements)); ...
[ "private", "static", "function", "extractCharset", "(", "array", "$", "contentTypeParts", ")", "{", "foreach", "(", "$", "contentTypeParts", "as", "$", "part", ")", "{", "$", "elements", "=", "explode", "(", "'='", ",", "$", "part", ")", ";", "$", "key",...
Tries to extract charset from pre-parsed part of Content-Type value @param array $contentTypeParts @return null|string
[ "Tries", "to", "extract", "charset", "from", "pre", "-", "parsed", "part", "of", "Content", "-", "Type", "value" ]
b1dfa0b1dd646f353634b5c9603fd6c75a7b73bd
https://github.com/Subscribo/psr-http-message-tools/blob/b1dfa0b1dd646f353634b5c9603fd6c75a7b73bd/src/Factories/RequestFactory.php#L100-L111
198,866
gmazzap/HooksMock
src/HooksMock.php
HooksMock.hasAction
public static function hasAction($hook = '', callable $callback = null, $priority = null) { return static::hasHook('action', $hook, $callback, $priority); }
php
public static function hasAction($hook = '', callable $callback = null, $priority = null) { return static::hasHook('action', $hook, $callback, $priority); }
[ "public", "static", "function", "hasAction", "(", "$", "hook", "=", "''", ",", "callable", "$", "callback", "=", "null", ",", "$", "priority", "=", "null", ")", "{", "return", "static", "::", "hasHook", "(", "'action'", ",", "$", "hook", ",", "$", "c...
Check if an action hook is added. Optionally check a specific callback and and priority. @param string $hook Hook to check @param callable $callback Callback to check @param int $priority Priority to check @return boolean
[ "Check", "if", "an", "action", "hook", "is", "added", ".", "Optionally", "check", "a", "specific", "callback", "and", "and", "priority", "." ]
b34b5819b96876f23daea9b7fde1b58925da6eab
https://github.com/gmazzap/HooksMock/blob/b34b5819b96876f23daea9b7fde1b58925da6eab/src/HooksMock.php#L159-L162
198,867
gmazzap/HooksMock
src/HooksMock.php
HooksMock.hasFilter
public static function hasFilter($hook = '', callable $callback = null, $priority = null) { return static::hasHook('filter', $hook, $callback, $priority); }
php
public static function hasFilter($hook = '', callable $callback = null, $priority = null) { return static::hasHook('filter', $hook, $callback, $priority); }
[ "public", "static", "function", "hasFilter", "(", "$", "hook", "=", "''", ",", "callable", "$", "callback", "=", "null", ",", "$", "priority", "=", "null", ")", "{", "return", "static", "::", "hasHook", "(", "'filter'", ",", "$", "hook", ",", "$", "c...
Check if an filter hook is added. Optionally check a specific callback and and priority. @param string $hook Hook to check @param callable $callback Callback to check @param int $priority Priority to check @return boolean
[ "Check", "if", "an", "filter", "hook", "is", "added", ".", "Optionally", "check", "a", "specific", "callback", "and", "and", "priority", "." ]
b34b5819b96876f23daea9b7fde1b58925da6eab
https://github.com/gmazzap/HooksMock/blob/b34b5819b96876f23daea9b7fde1b58925da6eab/src/HooksMock.php#L172-L175
198,868
gmazzap/HooksMock
src/HooksMock.php
HooksMock.hasHookFired
public static function hasHookFired($type = 'action', $hook = null) { if (! in_array($type, ['action', 'filter'], true)) { $type = 'action'; } $target = $type === 'filter' ? 'filters' : 'actions'; if (empty($hook) || ! is_string($hook)) { $msg = __METHOD__.' n...
php
public static function hasHookFired($type = 'action', $hook = null) { if (! in_array($type, ['action', 'filter'], true)) { $type = 'action'; } $target = $type === 'filter' ? 'filters' : 'actions'; if (empty($hook) || ! is_string($hook)) { $msg = __METHOD__.' n...
[ "public", "static", "function", "hasHookFired", "(", "$", "type", "=", "'action'", ",", "$", "hook", "=", "null", ")", "{", "if", "(", "!", "in_array", "(", "$", "type", ",", "[", "'action'", ",", "'filter'", "]", ",", "true", ")", ")", "{", "$", ...
Check if an hook is was fired. @param string $type Type of hook, 'action' or 'filter' @param string $hook Filter hook to check @return boolean
[ "Check", "if", "an", "hook", "is", "was", "fired", "." ]
b34b5819b96876f23daea9b7fde1b58925da6eab
https://github.com/gmazzap/HooksMock/blob/b34b5819b96876f23daea9b7fde1b58925da6eab/src/HooksMock.php#L184-L196
198,869
gmazzap/HooksMock
src/HooksMock.php
HooksMock.assertActionAdded
public static function assertActionAdded( $hook = '', $callback = null, $priority = null, $argsNum = null ) { static::assertHookAdded('action', $hook, $callback, $priority, $argsNum); }
php
public static function assertActionAdded( $hook = '', $callback = null, $priority = null, $argsNum = null ) { static::assertHookAdded('action', $hook, $callback, $priority, $argsNum); }
[ "public", "static", "function", "assertActionAdded", "(", "$", "hook", "=", "''", ",", "$", "callback", "=", "null", ",", "$", "priority", "=", "null", ",", "$", "argsNum", "=", "null", ")", "{", "static", "::", "assertHookAdded", "(", "'action'", ",", ...
Check if an action is added and throws a exceptions otherwise. @param string $hook Action hook to check @param callable $callback Callback to check @param int $priority Priority to check @param int $argsNum Number of accepted arguments to check
[ "Check", "if", "an", "action", "is", "added", "and", "throws", "a", "exceptions", "otherwise", "." ]
b34b5819b96876f23daea9b7fde1b58925da6eab
https://github.com/gmazzap/HooksMock/blob/b34b5819b96876f23daea9b7fde1b58925da6eab/src/HooksMock.php#L228-L235
198,870
gmazzap/HooksMock
src/HooksMock.php
HooksMock.assertFilterAdded
public static function assertFilterAdded( $hook = '', callable $callback = null, $priority = null, $numArgs = null ) { static::assertHookAdded('filter', $hook, $callback, $priority, $numArgs); }
php
public static function assertFilterAdded( $hook = '', callable $callback = null, $priority = null, $numArgs = null ) { static::assertHookAdded('filter', $hook, $callback, $priority, $numArgs); }
[ "public", "static", "function", "assertFilterAdded", "(", "$", "hook", "=", "''", ",", "callable", "$", "callback", "=", "null", ",", "$", "priority", "=", "null", ",", "$", "numArgs", "=", "null", ")", "{", "static", "::", "assertHookAdded", "(", "'filt...
Check if a filter is added and throws an exceptions otherwise. @param string $hook Filter hook to check @param callable $callback Callback to check @param int $priority Priority to check @param int $numArgs Number of accepted arguments to check
[ "Check", "if", "a", "filter", "is", "added", "and", "throws", "an", "exceptions", "otherwise", "." ]
b34b5819b96876f23daea9b7fde1b58925da6eab
https://github.com/gmazzap/HooksMock/blob/b34b5819b96876f23daea9b7fde1b58925da6eab/src/HooksMock.php#L245-L252
198,871
wasinger/adaptimage
src/ResponsiveImages/ResponsiveImage.php
ResponsiveImage.getSrcsetAttributeValue
public function getSrcsetAttributeValue() { $srcset = []; foreach ($this->versions as $id) { $srcset[] = sprintf('%s %sw', $id->getUrl(), $id->getWidth()); } return join(', ', $srcset); }
php
public function getSrcsetAttributeValue() { $srcset = []; foreach ($this->versions as $id) { $srcset[] = sprintf('%s %sw', $id->getUrl(), $id->getWidth()); } return join(', ', $srcset); }
[ "public", "function", "getSrcsetAttributeValue", "(", ")", "{", "$", "srcset", "=", "[", "]", ";", "foreach", "(", "$", "this", "->", "versions", "as", "$", "id", ")", "{", "$", "srcset", "[", "]", "=", "sprintf", "(", "'%s %sw'", ",", "$", "id", "...
Get the value for the "srcset" HTML attribute @return string
[ "Get", "the", "value", "for", "the", "srcset", "HTML", "attribute" ]
7b529b25081b399451c8bbd56d0cef7daaa83ec4
https://github.com/wasinger/adaptimage/blob/7b529b25081b399451c8bbd56d0cef7daaa83ec4/src/ResponsiveImages/ResponsiveImage.php#L87-L94
198,872
wasinger/adaptimage
src/ResponsiveImages/ResponsiveImage.php
ResponsiveImage.getDefaultImageInfo
public function getDefaultImageInfo() { if (isset($this->versions[$this->class->getDefaultWidth()])) { return $this->versions[$this->class->getDefaultWidth()]; } else { // if the image is smaller than the class default width, // $this->versions[$this->class->getDe...
php
public function getDefaultImageInfo() { if (isset($this->versions[$this->class->getDefaultWidth()])) { return $this->versions[$this->class->getDefaultWidth()]; } else { // if the image is smaller than the class default width, // $this->versions[$this->class->getDe...
[ "public", "function", "getDefaultImageInfo", "(", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "versions", "[", "$", "this", "->", "class", "->", "getDefaultWidth", "(", ")", "]", ")", ")", "{", "return", "$", "this", "->", "versions", "[", ...
Get WebImageInfo object for the default image size @return \Wa72\AdaptImage\WebImageInfo
[ "Get", "WebImageInfo", "object", "for", "the", "default", "image", "size" ]
7b529b25081b399451c8bbd56d0cef7daaa83ec4
https://github.com/wasinger/adaptimage/blob/7b529b25081b399451c8bbd56d0cef7daaa83ec4/src/ResponsiveImages/ResponsiveImage.php#L121-L132
198,873
wasinger/adaptimage
src/ResponsiveImages/ResponsiveImage.php
ResponsiveImage.createResizedVersions
public function createResizedVersions(ImageResizer $resizer) { foreach ($this->class->getImageResizeDefinitions() as $ird) { $resizer->resize($ird, $this->original_ifi, true); } }
php
public function createResizedVersions(ImageResizer $resizer) { foreach ($this->class->getImageResizeDefinitions() as $ird) { $resizer->resize($ird, $this->original_ifi, true); } }
[ "public", "function", "createResizedVersions", "(", "ImageResizer", "$", "resizer", ")", "{", "foreach", "(", "$", "this", "->", "class", "->", "getImageResizeDefinitions", "(", ")", "as", "$", "ird", ")", "{", "$", "resizer", "->", "resize", "(", "$", "ir...
Really create all resized versions of this image @param ImageResizer $resizer @throws \Exception
[ "Really", "create", "all", "resized", "versions", "of", "this", "image" ]
7b529b25081b399451c8bbd56d0cef7daaa83ec4
https://github.com/wasinger/adaptimage/blob/7b529b25081b399451c8bbd56d0cef7daaa83ec4/src/ResponsiveImages/ResponsiveImage.php#L140-L145
198,874
wasinger/adaptimage
src/ResponsiveImages/ResponsiveImage.php
ResponsiveImage.getResizedVersion
public function getResizedVersion(ImageResizer $resizer, $width) { if (!$this->class->hasWidth($width)) { throw new WidthNotAllowedException($width); } return $resizer->resize( $this->class->getImageResizeDefinitionByWidth($width), $this->original_ifi, ...
php
public function getResizedVersion(ImageResizer $resizer, $width) { if (!$this->class->hasWidth($width)) { throw new WidthNotAllowedException($width); } return $resizer->resize( $this->class->getImageResizeDefinitionByWidth($width), $this->original_ifi, ...
[ "public", "function", "getResizedVersion", "(", "ImageResizer", "$", "resizer", ",", "$", "width", ")", "{", "if", "(", "!", "$", "this", "->", "class", "->", "hasWidth", "(", "$", "width", ")", ")", "{", "throw", "new", "WidthNotAllowedException", "(", ...
Resize the image to a defined width and return the corresponding ImageFileInfo object @param ImageResizer $resizer @param int $width The desired width; it must be a width that is availaible in the image class @return ImageFileInfo The ImageFileInfo object pointing to the resized image file @throws \Exception
[ "Resize", "the", "image", "to", "a", "defined", "width", "and", "return", "the", "corresponding", "ImageFileInfo", "object" ]
7b529b25081b399451c8bbd56d0cef7daaa83ec4
https://github.com/wasinger/adaptimage/blob/7b529b25081b399451c8bbd56d0cef7daaa83ec4/src/ResponsiveImages/ResponsiveImage.php#L155-L165
198,875
ezra-obiwale/dSCore
src/Core/ACore.php
ACore.className
protected function className($suffix = '') { $exp = explode('\\', $this->getClass()); return (!empty($suffix) && substr($exp[count($exp) - 1], (strlen($exp[count($exp) - 1]) - strlen($suffix))) === $suffix) ? substr($exp[count($exp) - 1], 0, (strlen($exp[count($exp) - 1]) - strlen($suffix))) : $exp[count(...
php
protected function className($suffix = '') { $exp = explode('\\', $this->getClass()); return (!empty($suffix) && substr($exp[count($exp) - 1], (strlen($exp[count($exp) - 1]) - strlen($suffix))) === $suffix) ? substr($exp[count($exp) - 1], 0, (strlen($exp[count($exp) - 1]) - strlen($suffix))) : $exp[count(...
[ "protected", "function", "className", "(", "$", "suffix", "=", "''", ")", "{", "$", "exp", "=", "explode", "(", "'\\\\'", ",", "$", "this", "->", "getClass", "(", ")", ")", ";", "return", "(", "!", "empty", "(", "$", "suffix", ")", "&&", "substr", ...
Fetches the class name @param string $suffix @access protected @return string
[ "Fetches", "the", "class", "name" ]
dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d
https://github.com/ezra-obiwale/dSCore/blob/dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d/src/Core/ACore.php#L21-L28
198,876
ezra-obiwale/dSCore
src/Core/ACore.php
ACore.getNamespace
protected function getNamespace() { $np = explode('\\', $this->getClass()); unset($np[count($np) - 1]); return join('\\', $np); }
php
protected function getNamespace() { $np = explode('\\', $this->getClass()); unset($np[count($np) - 1]); return join('\\', $np); }
[ "protected", "function", "getNamespace", "(", ")", "{", "$", "np", "=", "explode", "(", "'\\\\'", ",", "$", "this", "->", "getClass", "(", ")", ")", ";", "unset", "(", "$", "np", "[", "count", "(", "$", "np", ")", "-", "1", "]", ")", ";", "retu...
Fetches the namespace of the current class @return string
[ "Fetches", "the", "namespace", "of", "the", "current", "class" ]
dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d
https://github.com/ezra-obiwale/dSCore/blob/dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d/src/Core/ACore.php#L34-L38
198,877
shgysk8zer0/core_api
traits/xml_exception.php
XML_Exception.ExceptionAsXML
final protected function ExceptionAsXML(\Exception $e, \DOMNode &$par) { //echo $e . PHP_EOL . print_r($par, true); $exc = $par->appendChild($this->createElement('Exception')); $exc->appendChild($this->createElement('File', $e->getFile())); $exc->appendChild($this->createElement('Line', $e->getLine())); $ex...
php
final protected function ExceptionAsXML(\Exception $e, \DOMNode &$par) { //echo $e . PHP_EOL . print_r($par, true); $exc = $par->appendChild($this->createElement('Exception')); $exc->appendChild($this->createElement('File', $e->getFile())); $exc->appendChild($this->createElement('Line', $e->getLine())); $ex...
[ "final", "protected", "function", "ExceptionAsXML", "(", "\\", "Exception", "$", "e", ",", "\\", "DOMNode", "&", "$", "par", ")", "{", "//echo $e . PHP_EOL . print_r($par, true);", "$", "exc", "=", "$", "par", "->", "appendChild", "(", "$", "this", "->", "c...
Converts a PHP Exception into a populated XML node @param Exception $e The exception thrown & caught @param DOMNode $par The parent node to be appending to @return void $par is a pointer
[ "Converts", "a", "PHP", "Exception", "into", "a", "populated", "XML", "node" ]
9e9b8baf761af874b95256ad2462e55fbb2b2e58
https://github.com/shgysk8zer0/core_api/blob/9e9b8baf761af874b95256ad2462e55fbb2b2e58/traits/xml_exception.php#L32-L66
198,878
vainproject/vain-user
src/User/Auth/Access/Traits/PermissionTrait.php
PermissionTrait.boot
public static function boot() { parent::boot(); static::deleting(function ($permission) { if (!method_exists(config('access.permission'), 'bootSoftDeletes')) { $permission->roles()->sync([]); } return true; }); }
php
public static function boot() { parent::boot(); static::deleting(function ($permission) { if (!method_exists(config('access.permission'), 'bootSoftDeletes')) { $permission->roles()->sync([]); } return true; }); }
[ "public", "static", "function", "boot", "(", ")", "{", "parent", "::", "boot", "(", ")", ";", "static", "::", "deleting", "(", "function", "(", "$", "permission", ")", "{", "if", "(", "!", "method_exists", "(", "config", "(", "'access.permission'", ")", ...
Boot the permission model Attach event listener to remove the many-to-many records when trying to delete Will NOT delete any records if the permission model uses soft deletes. @return void|bool
[ "Boot", "the", "permission", "model", "Attach", "event", "listener", "to", "remove", "the", "many", "-", "to", "-", "many", "records", "when", "trying", "to", "delete", "Will", "NOT", "delete", "any", "records", "if", "the", "permission", "model", "uses", ...
1c059faa61ebf289fcaea39a90b4523cfc9d6efc
https://github.com/vainproject/vain-user/blob/1c059faa61ebf289fcaea39a90b4523cfc9d6efc/src/User/Auth/Access/Traits/PermissionTrait.php#L24-L34
198,879
mwyatt/core
src/Pagination.php
Pagination.getLimit
public function getLimit($end = false) { $bottom = ($this->maxPerPage * ($this->pageCurrent - 1)); $top = $this->maxPerPage; if ($end === false) { return array($bottom, $top); } if ($end === 0) { return $bottom; } if ($end === 1) { ...
php
public function getLimit($end = false) { $bottom = ($this->maxPerPage * ($this->pageCurrent - 1)); $top = $this->maxPerPage; if ($end === false) { return array($bottom, $top); } if ($end === 0) { return $bottom; } if ($end === 1) { ...
[ "public", "function", "getLimit", "(", "$", "end", "=", "false", ")", "{", "$", "bottom", "=", "(", "$", "this", "->", "maxPerPage", "*", "(", "$", "this", "->", "pageCurrent", "-", "1", ")", ")", ";", "$", "top", "=", "$", "this", "->", "maxPerP...
get a limit array usable in an sql query @param boolean $end ? @return array|int
[ "get", "a", "limit", "array", "usable", "in", "an", "sql", "query" ]
8ea9d67cc84fe6aff17a469c703d5492dbcd93ed
https://github.com/mwyatt/core/blob/8ea9d67cc84fe6aff17a469c703d5492dbcd93ed/src/Pagination.php#L79-L92
198,880
mwyatt/core
src/Pagination.php
Pagination.generate
public function generate($pageCurrent, $totalRows) { $this->totalRows = $totalRows; $this->setPossiblePages(); $this->setPageCurrent($pageCurrent); if ($this->possiblePages < 2) { return; } $pageCurrent = $this->pageCurrent; $pagination = $this->...
php
public function generate($pageCurrent, $totalRows) { $this->totalRows = $totalRows; $this->setPossiblePages(); $this->setPageCurrent($pageCurrent); if ($this->possiblePages < 2) { return; } $pageCurrent = $this->pageCurrent; $pagination = $this->...
[ "public", "function", "generate", "(", "$", "pageCurrent", ",", "$", "totalRows", ")", "{", "$", "this", "->", "totalRows", "=", "$", "totalRows", ";", "$", "this", "->", "setPossiblePages", "(", ")", ";", "$", "this", "->", "setPageCurrent", "(", "$", ...
build the pagination array @return array
[ "build", "the", "pagination", "array" ]
8ea9d67cc84fe6aff17a469c703d5492dbcd93ed
https://github.com/mwyatt/core/blob/8ea9d67cc84fe6aff17a469c703d5492dbcd93ed/src/Pagination.php#L99-L127
198,881
mwyatt/core
src/Pagination.php
Pagination.urlBuildPageLink
protected function urlBuildPageLink($page) { $url = $this->url; $urlBase = $url->generate() . $url->getPath(); $queryParts = $url->getQueryArray(); $queryParts['page'] = $page; return $urlBase . '?' . http_build_query($queryParts); }
php
protected function urlBuildPageLink($page) { $url = $this->url; $urlBase = $url->generate() . $url->getPath(); $queryParts = $url->getQueryArray(); $queryParts['page'] = $page; return $urlBase . '?' . http_build_query($queryParts); }
[ "protected", "function", "urlBuildPageLink", "(", "$", "page", ")", "{", "$", "url", "=", "$", "this", "->", "url", ";", "$", "urlBase", "=", "$", "url", "->", "generate", "(", ")", ".", "$", "url", "->", "getPath", "(", ")", ";", "$", "queryParts"...
add the page to the query string create an absolute url @param int $page @return string absolute url
[ "add", "the", "page", "to", "the", "query", "string", "create", "an", "absolute", "url" ]
8ea9d67cc84fe6aff17a469c703d5492dbcd93ed
https://github.com/mwyatt/core/blob/8ea9d67cc84fe6aff17a469c703d5492dbcd93ed/src/Pagination.php#L165-L172
198,882
mwyatt/core
src/Pagination.php
Pagination.setPageCurrent
protected function setPageCurrent($page) { // need both of these? $page += 0; $page = (int) $page; // cant be below 1 $page = $page ? $page : 1; // cant be above possible if ($page > $this->possiblePages) { $page = $this->possiblePages; ...
php
protected function setPageCurrent($page) { // need both of these? $page += 0; $page = (int) $page; // cant be below 1 $page = $page ? $page : 1; // cant be above possible if ($page > $this->possiblePages) { $page = $this->possiblePages; ...
[ "protected", "function", "setPageCurrent", "(", "$", "page", ")", "{", "// need both of these?", "$", "page", "+=", "0", ";", "$", "page", "=", "(", "int", ")", "$", "page", ";", "// cant be below 1", "$", "page", "=", "$", "page", "?", "$", "page", ":...
page is set within the constraints of lowest and highest value @param int $page
[ "page", "is", "set", "within", "the", "constraints", "of", "lowest", "and", "highest", "value" ]
8ea9d67cc84fe6aff17a469c703d5492dbcd93ed
https://github.com/mwyatt/core/blob/8ea9d67cc84fe6aff17a469c703d5492dbcd93ed/src/Pagination.php#L179-L195
198,883
zapheus/zapheus
src/Routing/Route.php
Route.regex
public function regex() { // Turn "(/)" into "/?" $uri = preg_replace('#\(/\)#', '/?', $this->uri); // Create capture group for ":parameter", replaces ":parameter" $uri = $this->capture($uri, '/:(' . self::ALLOWED_REGEX . ')/'); // Create capture group for '{parameter}', re...
php
public function regex() { // Turn "(/)" into "/?" $uri = preg_replace('#\(/\)#', '/?', $this->uri); // Create capture group for ":parameter", replaces ":parameter" $uri = $this->capture($uri, '/:(' . self::ALLOWED_REGEX . ')/'); // Create capture group for '{parameter}', re...
[ "public", "function", "regex", "(", ")", "{", "// Turn \"(/)\" into \"/?\"", "$", "uri", "=", "preg_replace", "(", "'#\\(/\\)#'", ",", "'/?'", ",", "$", "this", "->", "uri", ")", ";", "// Create capture group for \":parameter\", replaces \":parameter\"", "$", "uri", ...
Returns a regular expression pattern from the given URI. @link https://stackoverflow.com/q/30130913 @return string
[ "Returns", "a", "regular", "expression", "pattern", "from", "the", "given", "URI", "." ]
96618b5cee7d20b6700d0475e4334ae4b5163a6b
https://github.com/zapheus/zapheus/blob/96618b5cee7d20b6700d0475e4334ae4b5163a6b/src/Routing/Route.php#L112-L125
198,884
zapheus/zapheus
src/Routing/Route.php
Route.capture
protected function capture($pattern, $search) { $replace = '(?<$1>' . self::ALLOWED_REGEX . ')'; return preg_replace($search, $replace, $pattern); }
php
protected function capture($pattern, $search) { $replace = '(?<$1>' . self::ALLOWED_REGEX . ')'; return preg_replace($search, $replace, $pattern); }
[ "protected", "function", "capture", "(", "$", "pattern", ",", "$", "search", ")", "{", "$", "replace", "=", "'(?<$1>'", ".", "self", "::", "ALLOWED_REGEX", ".", "')'", ";", "return", "preg_replace", "(", "$", "search", ",", "$", "replace", ",", "$", "p...
Capture the specified regular expressions. @param string $pattern @param string $search @return string
[ "Capture", "the", "specified", "regular", "expressions", "." ]
96618b5cee7d20b6700d0475e4334ae4b5163a6b
https://github.com/zapheus/zapheus/blob/96618b5cee7d20b6700d0475e4334ae4b5163a6b/src/Routing/Route.php#L144-L149
198,885
sndsgd/sndsgd-field
src/field/Collection.php
Collection.addField
public function addField(Field $field) { $name = $field->getName(); if (array_key_exists($name, $this->fields)) { throw new DuplicateFieldNameException($name); } $this->fields[$name] = $field; foreach ($field->getAliases() as $alias) { if (array_key_ex...
php
public function addField(Field $field) { $name = $field->getName(); if (array_key_exists($name, $this->fields)) { throw new DuplicateFieldNameException($name); } $this->fields[$name] = $field; foreach ($field->getAliases() as $alias) { if (array_key_ex...
[ "public", "function", "addField", "(", "Field", "$", "field", ")", "{", "$", "name", "=", "$", "field", "->", "getName", "(", ")", ";", "if", "(", "array_key_exists", "(", "$", "name", ",", "$", "this", "->", "fields", ")", ")", "{", "throw", "new"...
Define a field @param \sndsgd\Field $field The field to define @return \sndsgd\field\Collection
[ "Define", "a", "field" ]
34ac3aabfe031bd9b259b3b93e84964b04031334
https://github.com/sndsgd/sndsgd-field/blob/34ac3aabfe031bd9b259b3b93e84964b04031334/src/field/Collection.php#L102-L117
198,886
sndsgd/sndsgd-field
src/field/Collection.php
Collection.removeField
public function removeField($name) { if (($field = $this->getField($name)) === null) { return false; } foreach ($field->getAliases() as $alias) { unset($this->fieldAliases[$alias]); } unset($this->fields[$name]); return true; }
php
public function removeField($name) { if (($field = $this->getField($name)) === null) { return false; } foreach ($field->getAliases() as $alias) { unset($this->fieldAliases[$alias]); } unset($this->fields[$name]); return true; }
[ "public", "function", "removeField", "(", "$", "name", ")", "{", "if", "(", "(", "$", "field", "=", "$", "this", "->", "getField", "(", "$", "name", ")", ")", "===", "null", ")", "{", "return", "false", ";", "}", "foreach", "(", "$", "field", "->...
Remove a field from the collection @param string $name A field name or alias @return boolean Whether or not a field was removed
[ "Remove", "a", "field", "from", "the", "collection" ]
34ac3aabfe031bd9b259b3b93e84964b04031334
https://github.com/sndsgd/sndsgd-field/blob/34ac3aabfe031bd9b259b3b93e84964b04031334/src/field/Collection.php#L139-L150
198,887
sndsgd/sndsgd-field
src/field/Collection.php
Collection.getField
public function getField($name) { if (array_key_exists($name, $this->fields)) { return $this->fields[$name]; } else if (array_key_exists($name, $this->fieldAliases)) { $name = $this->fieldAliases[$name]; return $this->fields[$name]; } retur...
php
public function getField($name) { if (array_key_exists($name, $this->fields)) { return $this->fields[$name]; } else if (array_key_exists($name, $this->fieldAliases)) { $name = $this->fieldAliases[$name]; return $this->fields[$name]; } retur...
[ "public", "function", "getField", "(", "$", "name", ")", "{", "if", "(", "array_key_exists", "(", "$", "name", ",", "$", "this", "->", "fields", ")", ")", "{", "return", "$", "this", "->", "fields", "[", "$", "name", "]", ";", "}", "else", "if", ...
Get a field instance @param string $name An alias or name of the field to get @return \sndsgd\Field|null @return \sndsgd\Field The field was found @return null The field was NOT found
[ "Get", "a", "field", "instance" ]
34ac3aabfe031bd9b259b3b93e84964b04031334
https://github.com/sndsgd/sndsgd-field/blob/34ac3aabfe031bd9b259b3b93e84964b04031334/src/field/Collection.php#L160-L170
198,888
sndsgd/sndsgd-field
src/field/Collection.php
Collection.getFields
public function getFields($visibility = Field::VISIBILITY_PUBLIC) { $ret = []; foreach ($this->fields as $name => $field) { if ($field->getVisibility() & $visibility) { $ret[$name] = $field; } } return $ret; }
php
public function getFields($visibility = Field::VISIBILITY_PUBLIC) { $ret = []; foreach ($this->fields as $name => $field) { if ($field->getVisibility() & $visibility) { $ret[$name] = $field; } } return $ret; }
[ "public", "function", "getFields", "(", "$", "visibility", "=", "Field", "::", "VISIBILITY_PUBLIC", ")", "{", "$", "ret", "=", "[", "]", ";", "foreach", "(", "$", "this", "->", "fields", "as", "$", "name", "=>", "$", "field", ")", "{", "if", "(", "...
Get an associative array of the fields in this collection @param integer $visibility A bitmask to filter fields by visibility @return array<string,sndsgd\Field>
[ "Get", "an", "associative", "array", "of", "the", "fields", "in", "this", "collection" ]
34ac3aabfe031bd9b259b3b93e84964b04031334
https://github.com/sndsgd/sndsgd-field/blob/34ac3aabfe031bd9b259b3b93e84964b04031334/src/field/Collection.php#L178-L187
198,889
sndsgd/sndsgd-field
src/field/Collection.php
Collection.addValues
public function addValues(array $fieldValues) { foreach ($fieldValues as $fieldName => $values) { $values = Arr::cast($values); if (null === ($field = $this->getField($fieldName))) { $message = "unknown field"; $len = count($values); if...
php
public function addValues(array $fieldValues) { foreach ($fieldValues as $fieldName => $values) { $values = Arr::cast($values); if (null === ($field = $this->getField($fieldName))) { $message = "unknown field"; $len = count($values); if...
[ "public", "function", "addValues", "(", "array", "$", "fieldValues", ")", "{", "foreach", "(", "$", "fieldValues", "as", "$", "fieldName", "=>", "$", "values", ")", "{", "$", "values", "=", "Arr", "::", "cast", "(", "$", "values", ")", ";", "if", "("...
Add values to the fields in the collection @param array<string,mixed> $fieldValues
[ "Add", "values", "to", "the", "fields", "in", "the", "collection" ]
34ac3aabfe031bd9b259b3b93e84964b04031334
https://github.com/sndsgd/sndsgd-field/blob/34ac3aabfe031bd9b259b3b93e84964b04031334/src/field/Collection.php#L194-L214
198,890
sndsgd/sndsgd-field
src/field/Collection.php
Collection.validate
public function validate() { # addValues adds validation errors for unknown values $errs = count($this->errors); $dataKey = constant(get_called_class()."::EVENT_DATA_KEY"); if ($this->beforeValidate() !== true) { return false; } foreach ($this->fields as...
php
public function validate() { # addValues adds validation errors for unknown values $errs = count($this->errors); $dataKey = constant(get_called_class()."::EVENT_DATA_KEY"); if ($this->beforeValidate() !== true) { return false; } foreach ($this->fields as...
[ "public", "function", "validate", "(", ")", "{", "# addValues adds validation errors for unknown values", "$", "errs", "=", "count", "(", "$", "this", "->", "errors", ")", ";", "$", "dataKey", "=", "constant", "(", "get_called_class", "(", ")", ".", "\"::EVENT_D...
Validate the all the fields @return boolean
[ "Validate", "the", "all", "the", "fields" ]
34ac3aabfe031bd9b259b3b93e84964b04031334
https://github.com/sndsgd/sndsgd-field/blob/34ac3aabfe031bd9b259b3b93e84964b04031334/src/field/Collection.php#L221-L244
198,891
sndsgd/sndsgd-field
src/field/Collection.php
Collection.addError
public function addError(Error $error, $prepend = false) { if ($prepend === true) { array_unshift($this->errors, $error); } else { $this->errors[] = $error; } return count($this->errors); }
php
public function addError(Error $error, $prepend = false) { if ($prepend === true) { array_unshift($this->errors, $error); } else { $this->errors[] = $error; } return count($this->errors); }
[ "public", "function", "addError", "(", "Error", "$", "error", ",", "$", "prepend", "=", "false", ")", "{", "if", "(", "$", "prepend", "===", "true", ")", "{", "array_unshift", "(", "$", "this", "->", "errors", ",", "$", "error", ")", ";", "}", "els...
Add a validation error @param \sndsgd\field\Error $error @param boolean $prepend Add the error to the beginning @return integer The total number of validation errors
[ "Add", "a", "validation", "error" ]
34ac3aabfe031bd9b259b3b93e84964b04031334
https://github.com/sndsgd/sndsgd-field/blob/34ac3aabfe031bd9b259b3b93e84964b04031334/src/field/Collection.php#L253-L262
198,892
sndsgd/sndsgd-field
src/field/Collection.php
Collection.getErrors
public function getErrors($name = null) { if ($name === null) { return $this->errors; } $ret = []; foreach ($this->errors as $error) { if ($error->getName() === $name) { $ret[] = $error; } } return $ret; }
php
public function getErrors($name = null) { if ($name === null) { return $this->errors; } $ret = []; foreach ($this->errors as $error) { if ($error->getName() === $name) { $ret[] = $error; } } return $ret; }
[ "public", "function", "getErrors", "(", "$", "name", "=", "null", ")", "{", "if", "(", "$", "name", "===", "null", ")", "{", "return", "$", "this", "->", "errors", ";", "}", "$", "ret", "=", "[", "]", ";", "foreach", "(", "$", "this", "->", "er...
Get validation errors for one or all fields @param string|null $name The name of a field to get validation errors for @return array<\sndsgd\field\Error>
[ "Get", "validation", "errors", "for", "one", "or", "all", "fields" ]
34ac3aabfe031bd9b259b3b93e84964b04031334
https://github.com/sndsgd/sndsgd-field/blob/34ac3aabfe031bd9b259b3b93e84964b04031334/src/field/Collection.php#L280-L293
198,893
sndsgd/sndsgd-field
src/field/Collection.php
Collection.exportErrors
public function exportErrors() { $ret = []; foreach ($this->errors as $error) { $ret[] = $error->export(); } return $ret; }
php
public function exportErrors() { $ret = []; foreach ($this->errors as $error) { $ret[] = $error->export(); } return $ret; }
[ "public", "function", "exportErrors", "(", ")", "{", "$", "ret", "=", "[", "]", ";", "foreach", "(", "$", "this", "->", "errors", "as", "$", "error", ")", "{", "$", "ret", "[", "]", "=", "$", "error", "->", "export", "(", ")", ";", "}", "return...
Export validation errors for all fields @return array<string,mixed>
[ "Export", "validation", "errors", "for", "all", "fields" ]
34ac3aabfe031bd9b259b3b93e84964b04031334
https://github.com/sndsgd/sndsgd-field/blob/34ac3aabfe031bd9b259b3b93e84964b04031334/src/field/Collection.php#L300-L307
198,894
sndsgd/sndsgd-field
src/field/Collection.php
Collection.exportFieldValue
public function exportFieldValue($name, $exportHandler = null) { if (!is_string($name)) { throw new InvalidArgumentException( "invalid value provided for 'name'; ". "expecting a field name as string" ); } else if (($field = $this->getFi...
php
public function exportFieldValue($name, $exportHandler = null) { if (!is_string($name)) { throw new InvalidArgumentException( "invalid value provided for 'name'; ". "expecting a field name as string" ); } else if (($field = $this->getFi...
[ "public", "function", "exportFieldValue", "(", "$", "name", ",", "$", "exportHandler", "=", "null", ")", "{", "if", "(", "!", "is_string", "(", "$", "name", ")", ")", "{", "throw", "new", "InvalidArgumentException", "(", "\"invalid value provided for 'name'; \""...
Convenience method to get a particular field value @param string $name The field name @param integer|null $exportHandler AN export handler @return mixed @throws \InvalidArgumentException If provided name does not exist
[ "Convenience", "method", "to", "get", "a", "particular", "field", "value" ]
34ac3aabfe031bd9b259b3b93e84964b04031334
https://github.com/sndsgd/sndsgd-field/blob/34ac3aabfe031bd9b259b3b93e84964b04031334/src/field/Collection.php#L317-L329
198,895
sndsgd/sndsgd-field
src/field/Collection.php
Collection.exportValues
public function exportValues() { $ret = []; foreach ($this->fields as $field) { if ($field->getExportHandler() !== Field::EXPORT_SKIP) { $ret[$field->getName()] = $field->exportValue(); } } return $ret; }
php
public function exportValues() { $ret = []; foreach ($this->fields as $field) { if ($field->getExportHandler() !== Field::EXPORT_SKIP) { $ret[$field->getName()] = $field->exportValue(); } } return $ret; }
[ "public", "function", "exportValues", "(", ")", "{", "$", "ret", "=", "[", "]", ";", "foreach", "(", "$", "this", "->", "fields", "as", "$", "field", ")", "{", "if", "(", "$", "field", "->", "getExportHandler", "(", ")", "!==", "Field", "::", "EXPO...
Get all field values using their respective export handlers @return array<string,mixed>
[ "Get", "all", "field", "values", "using", "their", "respective", "export", "handlers" ]
34ac3aabfe031bd9b259b3b93e84964b04031334
https://github.com/sndsgd/sndsgd-field/blob/34ac3aabfe031bd9b259b3b93e84964b04031334/src/field/Collection.php#L336-L345
198,896
DreadLabs/VantomasWebsite
src/Twitter/AccessControl/Authorization/BearerToken.php
BearerToken.initializeCredentials
private function initializeCredentials() { $this->credentials = base64_encode( sprintf( '%s:%s', urlencode($this->configuration->getConsumerKey()), urlencode($this->configuration->getConsumerSecret()) ) ); }
php
private function initializeCredentials() { $this->credentials = base64_encode( sprintf( '%s:%s', urlencode($this->configuration->getConsumerKey()), urlencode($this->configuration->getConsumerSecret()) ) ); }
[ "private", "function", "initializeCredentials", "(", ")", "{", "$", "this", "->", "credentials", "=", "base64_encode", "(", "sprintf", "(", "'%s:%s'", ",", "urlencode", "(", "$", "this", "->", "configuration", "->", "getConsumerKey", "(", ")", ")", ",", "url...
Initializes the bearer token credentials in the expected format @see https://dev.twitter.com/docs/auth/application-only-auth @return void
[ "Initializes", "the", "bearer", "token", "credentials", "in", "the", "expected", "format" ]
7f85f2b45bdf5ed9fa9d320c805c416bf99cd668
https://github.com/DreadLabs/VantomasWebsite/blob/7f85f2b45bdf5ed9fa9d320c805c416bf99cd668/src/Twitter/AccessControl/Authorization/BearerToken.php#L86-L95
198,897
kambalabs/KmbPuppetDb
src/KmbPuppetDb/Service/FactNames.php
FactNames.getAll
public function getAll() { $request = new KmbPuppetDb\Request('/fact-names'); $response = $this->getPuppetDbClient()->send($request); return (array) $response->getData(); }
php
public function getAll() { $request = new KmbPuppetDb\Request('/fact-names'); $response = $this->getPuppetDbClient()->send($request); return (array) $response->getData(); }
[ "public", "function", "getAll", "(", ")", "{", "$", "request", "=", "new", "KmbPuppetDb", "\\", "Request", "(", "'/fact-names'", ")", ";", "$", "response", "=", "$", "this", "->", "getPuppetDbClient", "(", ")", "->", "send", "(", "$", "request", ")", "...
Get all fact names. @return array
[ "Get", "all", "fact", "names", "." ]
df56a275cf00f4402cf121a2e99149168f1f8b2d
https://github.com/kambalabs/KmbPuppetDb/blob/df56a275cf00f4402cf121a2e99149168f1f8b2d/src/KmbPuppetDb/Service/FactNames.php#L35-L40
198,898
phossa/phossa-di
src/Phossa/Di/Definition/DefinitionAwareTrait.php
DefinitionAwareTrait.getParameter
protected function getParameter(/*# string */ $name) { if ($this->hasResolver()) { $found = $this->getResolver()->get($name); } else { // break into parts by '.' $parts = explode('.', $name); $found = $this->parameters; while (null !== ($pa...
php
protected function getParameter(/*# string */ $name) { if ($this->hasResolver()) { $found = $this->getResolver()->get($name); } else { // break into parts by '.' $parts = explode('.', $name); $found = $this->parameters; while (null !== ($pa...
[ "protected", "function", "getParameter", "(", "/*# string */", "$", "name", ")", "{", "if", "(", "$", "this", "->", "hasResolver", "(", ")", ")", "{", "$", "found", "=", "$", "this", "->", "getResolver", "(", ")", "->", "get", "(", "$", "name", ")", ...
Get this paramter's value either a string or an associate array ```php $this->set('cache.dir', '/var/tmp'); // will return an array ['dir' => '/var/tmp']; $result = $this->getParameter('cache'); // will return a string, 'var/tmp' $result = $this->getParameter('cache.dir'); ``` @param string $name parameter name @r...
[ "Get", "this", "paramter", "s", "value", "either", "a", "string", "or", "an", "associate", "array" ]
bbe1e95b081068e2bc49c6cd465f38aab0374be5
https://github.com/phossa/phossa-di/blob/bbe1e95b081068e2bc49c6cd465f38aab0374be5/src/Phossa/Di/Definition/DefinitionAwareTrait.php#L350-L375
198,899
phossa/phossa-di
src/Phossa/Di/Definition/DefinitionAwareTrait.php
DefinitionAwareTrait.fixServices
protected function fixServices(array &$definitions) { foreach ($definitions as $id => $def) { if (is_array($def)) { if (!isset($def['class'])) { $def = ['class' => $def]; } elseif (!is_array($def['class'])) { $def['class'] =...
php
protected function fixServices(array &$definitions) { foreach ($definitions as $id => $def) { if (is_array($def)) { if (!isset($def['class'])) { $def = ['class' => $def]; } elseif (!is_array($def['class'])) { $def['class'] =...
[ "protected", "function", "fixServices", "(", "array", "&", "$", "definitions", ")", "{", "foreach", "(", "$", "definitions", "as", "$", "id", "=>", "$", "def", ")", "{", "if", "(", "is_array", "(", "$", "def", ")", ")", "{", "if", "(", "!", "isset"...
Normalize service definitions @param array &$definitions @return void @access protected
[ "Normalize", "service", "definitions" ]
bbe1e95b081068e2bc49c6cd465f38aab0374be5
https://github.com/phossa/phossa-di/blob/bbe1e95b081068e2bc49c6cd465f38aab0374be5/src/Phossa/Di/Definition/DefinitionAwareTrait.php#L384-L398