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
189,200
ejsmont-artur/php-circuit-breaker
src/Ejsmont/CircuitBreaker/Core/CircuitBreaker.php
CircuitBreaker.getSetting
private function getSetting($serviceName, $variable) { // make sure there are settings for the service if (!isset($this->settings[$serviceName])) { $this->settings[$serviceName] = array( 'maxFailures' => $this->defaultMaxFailures, 'retryTimeout' => $this-...
php
private function getSetting($serviceName, $variable) { // make sure there are settings for the service if (!isset($this->settings[$serviceName])) { $this->settings[$serviceName] = array( 'maxFailures' => $this->defaultMaxFailures, 'retryTimeout' => $this-...
[ "private", "function", "getSetting", "(", "$", "serviceName", ",", "$", "variable", ")", "{", "// make sure there are settings for the service\r", "if", "(", "!", "isset", "(", "$", "this", "->", "settings", "[", "$", "serviceName", "]", ")", ")", "{", "$", ...
Load setting or initialise service name with defaults for faster lookups @param string $serviceName what service to look for @param string $variable what setting to look for @return int
[ "Load", "setting", "or", "initialise", "service", "name", "with", "defaults", "for", "faster", "lookups" ]
e733eddfa28b4e42ae34836b07ae149b273b90bd
https://github.com/ejsmont-artur/php-circuit-breaker/blob/e733eddfa28b4e42ae34836b07ae149b273b90bd/src/Ejsmont/CircuitBreaker/Core/CircuitBreaker.php#L90-L99
189,201
blockavel/lara-block-io
src/LaraBlockIo.php
LaraBlockIo.setAmountsPrecision
protected function setAmountsPrecision($array) { $amounts = explode(',', str_replace(' ', '', $array['amounts'])); unset($array['amounts']); $temp = []; try { foreach ($amounts as $amount) { $temp[] = bcadd($amount, '0', 8); } ret...
php
protected function setAmountsPrecision($array) { $amounts = explode(',', str_replace(' ', '', $array['amounts'])); unset($array['amounts']); $temp = []; try { foreach ($amounts as $amount) { $temp[] = bcadd($amount, '0', 8); } ret...
[ "protected", "function", "setAmountsPrecision", "(", "$", "array", ")", "{", "$", "amounts", "=", "explode", "(", "','", ",", "str_replace", "(", "' '", ",", "''", ",", "$", "array", "[", "'amounts'", "]", ")", ")", ";", "unset", "(", "$", "array", "...
Verifying the presicion of the provided amounts. You need to have the php7.0-bcmath package installed. To install it in ubuntu run: sudo apt-get updatesudo apt-get install php7.0-bcmath @param array $array @return string|Exception
[ "Verifying", "the", "presicion", "of", "the", "provided", "amounts", ".", "You", "need", "to", "have", "the", "php7", ".", "0", "-", "bcmath", "package", "installed", "." ]
f502195cf10a0c535f85f61d68e3c93b7258e8e1
https://github.com/blockavel/lara-block-io/blob/f502195cf10a0c535f85f61d68e3c93b7258e8e1/src/LaraBlockIo.php#L226-L244
189,202
blockavel/lara-block-io
src/LaraBlockIo.php
LaraBlockIo.withdraw
public function withdraw($amounts, $toAddresses, $nonce = null) { $array = [ 'amounts' => $amounts, 'to_addresses' => $toAddresses, 'nonce' => $nonce, ]; return $this->blockIo->withdraw( $this->setAmountsPrecision($array) ...
php
public function withdraw($amounts, $toAddresses, $nonce = null) { $array = [ 'amounts' => $amounts, 'to_addresses' => $toAddresses, 'nonce' => $nonce, ]; return $this->blockIo->withdraw( $this->setAmountsPrecision($array) ...
[ "public", "function", "withdraw", "(", "$", "amounts", ",", "$", "toAddresses", ",", "$", "nonce", "=", "null", ")", "{", "$", "array", "=", "[", "'amounts'", "=>", "$", "amounts", ",", "'to_addresses'", "=>", "$", "toAddresses", ",", "'nonce'", "=>", ...
Withdraws amount of coins from any addresses in your account to up to 2500 destination addresses. If you have more than 2500 unarchived addresses on your account, you cannot use this method for withdrawal. Please use the more granular withdrawFromAddressesToAddresses, or withdrawFromLabelsToLabels methods instead. @pa...
[ "Withdraws", "amount", "of", "coins", "from", "any", "addresses", "in", "your", "account", "to", "up", "to", "2500", "destination", "addresses", ".", "If", "you", "have", "more", "than", "2500", "unarchived", "addresses", "on", "your", "account", "you", "can...
f502195cf10a0c535f85f61d68e3c93b7258e8e1
https://github.com/blockavel/lara-block-io/blob/f502195cf10a0c535f85f61d68e3c93b7258e8e1/src/LaraBlockIo.php#L280-L291
189,203
blockavel/lara-block-io
src/LaraBlockIo.php
LaraBlockIo.getTransactionsByAddresses
public function getTransactionsByAddresses( $type, $addresses, $beforeTx = null ) { if (is_null($beforeTx)) { $array = [ 'type' => $type, 'addresses' => $addresses, ]; } else { $array = [ 'type' => ...
php
public function getTransactionsByAddresses( $type, $addresses, $beforeTx = null ) { if (is_null($beforeTx)) { $array = [ 'type' => $type, 'addresses' => $addresses, ]; } else { $array = [ 'type' => ...
[ "public", "function", "getTransactionsByAddresses", "(", "$", "type", ",", "$", "addresses", ",", "$", "beforeTx", "=", "null", ")", "{", "if", "(", "is_null", "(", "$", "beforeTx", ")", ")", "{", "$", "array", "=", "[", "'type'", "=>", "$", "type", ...
Returns various data for the last 25 transactions spent or received. You can optionally specify a before_tx parameter to get earlier transactions. You can use this method to query for addresses that are not on your account. Each result provides a confidence rating that shows the network's belief in the transaction's ...
[ "Returns", "various", "data", "for", "the", "last", "25", "transactions", "spent", "or", "received", ".", "You", "can", "optionally", "specify", "a", "before_tx", "parameter", "to", "get", "earlier", "transactions", "." ]
f502195cf10a0c535f85f61d68e3c93b7258e8e1
https://github.com/blockavel/lara-block-io/blob/f502195cf10a0c535f85f61d68e3c93b7258e8e1/src/LaraBlockIo.php#L474-L491
189,204
blockavel/lara-block-io
src/LaraBlockIo.php
LaraBlockIo.getNotConfirmedTxs
public function getNotConfirmedTxs($toAddress, $confidenceThreshold) { $txs = $this->blockIo->get_transactions( ['addresses' => $toAddress, 'type' => 'received'] )->data->txs; $txs = array_where($txs, function ($value) use ($confidenceThreshold) { ...
php
public function getNotConfirmedTxs($toAddress, $confidenceThreshold) { $txs = $this->blockIo->get_transactions( ['addresses' => $toAddress, 'type' => 'received'] )->data->txs; $txs = array_where($txs, function ($value) use ($confidenceThreshold) { ...
[ "public", "function", "getNotConfirmedTxs", "(", "$", "toAddress", ",", "$", "confidenceThreshold", ")", "{", "$", "txs", "=", "$", "this", "->", "blockIo", "->", "get_transactions", "(", "[", "'addresses'", "=>", "$", "toAddress", ",", "'type'", "=>", "'rec...
Look for incoming transactions, and know when they have been processed. We can get the number of pending transactions related to an address by asking for the confidence treshold and the recipient adress as inputs. @param $toAddress string Containing comma separated addresses values @param $confidenceThreshold duble C...
[ "Look", "for", "incoming", "transactions", "and", "know", "when", "they", "have", "been", "processed", "." ]
f502195cf10a0c535f85f61d68e3c93b7258e8e1
https://github.com/blockavel/lara-block-io/blob/f502195cf10a0c535f85f61d68e3c93b7258e8e1/src/LaraBlockIo.php#L625-L643
189,205
blockavel/lara-block-io
src/LaraBlockIo.php
LaraBlockIo.createMultiSigAddress
public function createMultiSigAddress( $label, $reqSigs, $s1, $s2, $s3 = null, $s4 = null ) { $passphrases_array = []; if (!is_null($s4)) {...
php
public function createMultiSigAddress( $label, $reqSigs, $s1, $s2, $s3 = null, $s4 = null ) { $passphrases_array = []; if (!is_null($s4)) {...
[ "public", "function", "createMultiSigAddress", "(", "$", "label", ",", "$", "reqSigs", ",", "$", "s1", ",", "$", "s2", ",", "$", "s3", "=", "null", ",", "$", "s4", "=", "null", ")", "{", "$", "passphrases_array", "=", "[", "]", ";", "if", "(", "!...
Create a MultiSig address. @params $label string Containing the label of the address @params $reqSigs integer Contining a value between 1 and 4 @params $s1,$s2,$s3, $s4 string Containing the passphrases for signing @return object Contains MultiSig address details
[ "Create", "a", "MultiSig", "address", "." ]
f502195cf10a0c535f85f61d68e3c93b7258e8e1
https://github.com/blockavel/lara-block-io/blob/f502195cf10a0c535f85f61d68e3c93b7258e8e1/src/LaraBlockIo.php#L689-L725
189,206
blockavel/lara-block-io
src/LaraBlockIo.php
LaraBlockIo.multiSigWithdraw
public function multiSigWithdraw($label, $toAddresses, $amount) { $array = [ 'from_labels' => $label, 'to_addresses' => $toAddresses, 'amounts' => $amount, ]; $response = $this->blockIo->withdraw_from_dtrust_address($array); $reference_id =...
php
public function multiSigWithdraw($label, $toAddresses, $amount) { $array = [ 'from_labels' => $label, 'to_addresses' => $toAddresses, 'amounts' => $amount, ]; $response = $this->blockIo->withdraw_from_dtrust_address($array); $reference_id =...
[ "public", "function", "multiSigWithdraw", "(", "$", "label", ",", "$", "toAddresses", ",", "$", "amount", ")", "{", "$", "array", "=", "[", "'from_labels'", "=>", "$", "label", ",", "'to_addresses'", "=>", "$", "toAddresses", ",", "'amounts'", "=>", "$", ...
Perform a MultiSig withdraw, returns the withdraw object and the withdraw reference id for later signing off the withdraw. @params $label string Containing the label of a dtrust address @params $toAddresses string Containing comma separated addresses values @return object Contains details of withdaw and its reference...
[ "Perform", "a", "MultiSig", "withdraw", "returns", "the", "withdraw", "object", "and", "the", "withdraw", "reference", "id", "for", "later", "signing", "off", "the", "withdraw", "." ]
f502195cf10a0c535f85f61d68e3c93b7258e8e1
https://github.com/blockavel/lara-block-io/blob/f502195cf10a0c535f85f61d68e3c93b7258e8e1/src/LaraBlockIo.php#L750-L763
189,207
blockavel/lara-block-io
src/LaraBlockIo.php
LaraBlockIo.signMultiSigWithdraw
public function signMultiSigWithdraw($reference_id, $passphrase) { $response = $this->getMultiSigWithdraw($reference_id); $key = $this->getKey($passphrase); $signature = &$key; foreach ($response->data->details->inputs as &$input) { $dataToSign = $input->data_to_sign; ...
php
public function signMultiSigWithdraw($reference_id, $passphrase) { $response = $this->getMultiSigWithdraw($reference_id); $key = $this->getKey($passphrase); $signature = &$key; foreach ($response->data->details->inputs as &$input) { $dataToSign = $input->data_to_sign; ...
[ "public", "function", "signMultiSigWithdraw", "(", "$", "reference_id", ",", "$", "passphrase", ")", "{", "$", "response", "=", "$", "this", "->", "getMultiSigWithdraw", "(", "$", "reference_id", ")", ";", "$", "key", "=", "$", "this", "->", "getKey", "(",...
Sign a MultiSig withdraw. @params $referenceId string Containing the reference id of withdraw @params $passphrase string Containing a valid siing passphrase @return object Contains details of transaction or required signatures
[ "Sign", "a", "MultiSig", "withdraw", "." ]
f502195cf10a0c535f85f61d68e3c93b7258e8e1
https://github.com/blockavel/lara-block-io/blob/f502195cf10a0c535f85f61d68e3c93b7258e8e1/src/LaraBlockIo.php#L825-L853
189,208
yajra/laravel-auditable
src/AuditableTrait.php
AuditableTrait.getCreatedByNameAttribute
public function getCreatedByNameAttribute() { if ($this->{$this->getCreatedByColumn()}) { return $this->creator->first_name . ' ' . $this->creator->last_name; } return ''; }
php
public function getCreatedByNameAttribute() { if ($this->{$this->getCreatedByColumn()}) { return $this->creator->first_name . ' ' . $this->creator->last_name; } return ''; }
[ "public", "function", "getCreatedByNameAttribute", "(", ")", "{", "if", "(", "$", "this", "->", "{", "$", "this", "->", "getCreatedByColumn", "(", ")", "}", ")", "{", "return", "$", "this", "->", "creator", "->", "first_name", ".", "' '", ".", "$", "th...
Get created by user full name. @return string
[ "Get", "created", "by", "user", "full", "name", "." ]
7a03356b363004ea200c85dcfd1a65f1a55a925e
https://github.com/yajra/laravel-auditable/blob/7a03356b363004ea200c85dcfd1a65f1a55a925e/src/AuditableTrait.php#L65-L72
189,209
yajra/laravel-auditable
src/AuditableTrait.php
AuditableTrait.getUpdatedByNameAttribute
public function getUpdatedByNameAttribute() { if ($this->{$this->getUpdatedByColumn()}) { return $this->updater->first_name . ' ' . $this->updater->last_name; } return ''; }
php
public function getUpdatedByNameAttribute() { if ($this->{$this->getUpdatedByColumn()}) { return $this->updater->first_name . ' ' . $this->updater->last_name; } return ''; }
[ "public", "function", "getUpdatedByNameAttribute", "(", ")", "{", "if", "(", "$", "this", "->", "{", "$", "this", "->", "getUpdatedByColumn", "(", ")", "}", ")", "{", "return", "$", "this", "->", "updater", "->", "first_name", ".", "' '", ".", "$", "th...
Get updated by user full name. @return string
[ "Get", "updated", "by", "user", "full", "name", "." ]
7a03356b363004ea200c85dcfd1a65f1a55a925e
https://github.com/yajra/laravel-auditable/blob/7a03356b363004ea200c85dcfd1a65f1a55a925e/src/AuditableTrait.php#L91-L98
189,210
wdalmut/simple-mvc
src/Router.php
Router.match
public function match(Request $request, $route = false) { if (count($this->_childs)) { $route = $this->_match($request, $route); } if (!$route) { $route = $this->_default($request)->merge($route); } if (!$route) { throw new RuntimeExcept...
php
public function match(Request $request, $route = false) { if (count($this->_childs)) { $route = $this->_match($request, $route); } if (!$route) { $route = $this->_default($request)->merge($route); } if (!$route) { throw new RuntimeExcept...
[ "public", "function", "match", "(", "Request", "$", "request", ",", "$", "route", "=", "false", ")", "{", "if", "(", "count", "(", "$", "this", "->", "_childs", ")", ")", "{", "$", "route", "=", "$", "this", "->", "_match", "(", "$", "request", "...
Match a request on a route @param Request the actual request @return Route
[ "Match", "a", "request", "on", "a", "route" ]
0657d1f53cfbb44c43f97f1260a0fd5d6a557295
https://github.com/wdalmut/simple-mvc/blob/0657d1f53cfbb44c43f97f1260a0fd5d6a557295/src/Router.php#L17-L33
189,211
yajra/laravel-auditable
src/AuditableTraitObserver.php
AuditableTraitObserver.creating
public function creating(Model $model) { if (! $model->created_by) { $model->created_by = $this->getAuthenticatedUserId(); } if (! $model->updated_by) { $model->updated_by = $this->getAuthenticatedUserId(); } }
php
public function creating(Model $model) { if (! $model->created_by) { $model->created_by = $this->getAuthenticatedUserId(); } if (! $model->updated_by) { $model->updated_by = $this->getAuthenticatedUserId(); } }
[ "public", "function", "creating", "(", "Model", "$", "model", ")", "{", "if", "(", "!", "$", "model", "->", "created_by", ")", "{", "$", "model", "->", "created_by", "=", "$", "this", "->", "getAuthenticatedUserId", "(", ")", ";", "}", "if", "(", "!"...
Model's creating event hook. @param Model $model
[ "Model", "s", "creating", "event", "hook", "." ]
7a03356b363004ea200c85dcfd1a65f1a55a925e
https://github.com/yajra/laravel-auditable/blob/7a03356b363004ea200c85dcfd1a65f1a55a925e/src/AuditableTraitObserver.php#L14-L23
189,212
wdalmut/simple-mvc
src/Dispatcher.php
Dispatcher.dispatch
public function dispatch(Route $route) { do { $this->getEventManager()->publish("pre.dispatch", array($route, $this)); $protoView = $this->_view->cloneThis(); $controllerClassName = $route->getControllerName() . "Controller"; $action = $route->getActionName()...
php
public function dispatch(Route $route) { do { $this->getEventManager()->publish("pre.dispatch", array($route, $this)); $protoView = $this->_view->cloneThis(); $controllerClassName = $route->getControllerName() . "Controller"; $action = $route->getActionName()...
[ "public", "function", "dispatch", "(", "Route", "$", "route", ")", "{", "do", "{", "$", "this", "->", "getEventManager", "(", ")", "->", "publish", "(", "\"pre.dispatch\"", ",", "array", "(", "$", "route", ",", "$", "this", ")", ")", ";", "$", "proto...
dispatch an action
[ "dispatch", "an", "action" ]
0657d1f53cfbb44c43f97f1260a0fd5d6a557295
https://github.com/wdalmut/simple-mvc/blob/0657d1f53cfbb44c43f97f1260a0fd5d6a557295/src/Dispatcher.php#L87-L147
189,213
wdalmut/simple-mvc
src/Controller.php
Controller.redirect
public function redirect($url, $header=301) { $this->disableLayout(); $this->setNoRender(); $this->_params["dispatcher"]->clearHeaders(); $this->_params["dispatcher"]->addHeader("Location", $url, $header); }
php
public function redirect($url, $header=301) { $this->disableLayout(); $this->setNoRender(); $this->_params["dispatcher"]->clearHeaders(); $this->_params["dispatcher"]->addHeader("Location", $url, $header); }
[ "public", "function", "redirect", "(", "$", "url", ",", "$", "header", "=", "301", ")", "{", "$", "this", "->", "disableLayout", "(", ")", ";", "$", "this", "->", "setNoRender", "(", ")", ";", "$", "this", "->", "_params", "[", "\"dispatcher\"", "]",...
Using the dispatcher
[ "Using", "the", "dispatcher" ]
0657d1f53cfbb44c43f97f1260a0fd5d6a557295
https://github.com/wdalmut/simple-mvc/blob/0657d1f53cfbb44c43f97f1260a0fd5d6a557295/src/Controller.php#L110-L117
189,214
RobBrazier/Laravel_Piwik
src/RobBrazier/Piwik/Piwik.php
Piwik.convertUrl
protected function convertUrl($url, $https) { $scheme = ($https) ? 'https' : 'http'; $parser = new Url($url); $parser->setScheme($scheme); return $parser->__toString(); }
php
protected function convertUrl($url, $https) { $scheme = ($https) ? 'https' : 'http'; $parser = new Url($url); $parser->setScheme($scheme); return $parser->__toString(); }
[ "protected", "function", "convertUrl", "(", "$", "url", ",", "$", "https", ")", "{", "$", "scheme", "=", "(", "$", "https", ")", "?", "'https'", ":", "'http'", ";", "$", "parser", "=", "new", "Url", "(", "$", "url", ")", ";", "$", "parser", "->",...
Convert URL from HTTP to HTTPS and vice versa. @param string $url @param bool $https @return string
[ "Convert", "URL", "from", "HTTP", "to", "HTTPS", "and", "vice", "versa", "." ]
af955a0e07be41896f3b36470fb5298c2ca271ba
https://github.com/RobBrazier/Laravel_Piwik/blob/af955a0e07be41896f3b36470fb5298c2ca271ba/src/RobBrazier/Piwik/Piwik.php#L56-L63
189,215
RobBrazier/Laravel_Piwik
src/RobBrazier/Piwik/Piwik.php
Piwik.getTag
public function getTag() { $piwikUrl = $this->getPiwikUrl(); $tag = <<<'EOT' <script type="text/javascript"> var _paq = _paq || []; (function(){ var u=(("https:" == document.location.protocol) ? "%s/" : "%s/"); _paq.push(['setSiteId', %s]); _paq.push(['setTrackerUrl', u+'piwik.php']); _paq.push(['t...
php
public function getTag() { $piwikUrl = $this->getPiwikUrl(); $tag = <<<'EOT' <script type="text/javascript"> var _paq = _paq || []; (function(){ var u=(("https:" == document.location.protocol) ? "%s/" : "%s/"); _paq.push(['setSiteId', %s]); _paq.push(['setTrackerUrl', u+'piwik.php']); _paq.push(['t...
[ "public", "function", "getTag", "(", ")", "{", "$", "piwikUrl", "=", "$", "this", "->", "getPiwikUrl", "(", ")", ";", "$", "tag", "=", " <<<'EOT'\n<script type=\"text/javascript\">\nvar _paq = _paq || [];\n(function(){ var u=((\"https:\" == document.location.protocol) ? \"%s/\"...
Get javascript tag for use in tracking the website. @return string
[ "Get", "javascript", "tag", "for", "use", "in", "tracking", "the", "website", "." ]
af955a0e07be41896f3b36470fb5298c2ca271ba
https://github.com/RobBrazier/Laravel_Piwik/blob/af955a0e07be41896f3b36470fb5298c2ca271ba/src/RobBrazier/Piwik/Piwik.php#L202-L226
189,216
wdalmut/simple-mvc
src/Route.php
Route.merge
public function merge($parent) { $merged = clone $this; if ($parent) { //Merge with parent route ($this->getActionName()) ? $merged->setActionName($this->getActionName()) : $merged->setActionName($parent->getActioName()); ($this->g...
php
public function merge($parent) { $merged = clone $this; if ($parent) { //Merge with parent route ($this->getActionName()) ? $merged->setActionName($this->getActionName()) : $merged->setActionName($parent->getActioName()); ($this->g...
[ "public", "function", "merge", "(", "$", "parent", ")", "{", "$", "merged", "=", "clone", "$", "this", ";", "if", "(", "$", "parent", ")", "{", "//Merge with parent route", "(", "$", "this", "->", "getActionName", "(", ")", ")", "?", "$", "merged", "...
Merge parent route with this @param Route $route The parent route @return Route mixed route
[ "Merge", "parent", "route", "with", "this" ]
0657d1f53cfbb44c43f97f1260a0fd5d6a557295
https://github.com/wdalmut/simple-mvc/blob/0657d1f53cfbb44c43f97f1260a0fd5d6a557295/src/Route.php#L48-L65
189,217
cardinity/cardinity-sdk-php
src/Method/Validator.php
Validator.validate
public function validate(MethodInterface $method) { $constraints = $method->getValidationConstraints(); if (empty($constraints)) { return; } $violations = $this->validator->validate( $method->getAttributes(), $constraints ); $coun...
php
public function validate(MethodInterface $method) { $constraints = $method->getValidationConstraints(); if (empty($constraints)) { return; } $violations = $this->validator->validate( $method->getAttributes(), $constraints ); $coun...
[ "public", "function", "validate", "(", "MethodInterface", "$", "method", ")", "{", "$", "constraints", "=", "$", "method", "->", "getValidationConstraints", "(", ")", ";", "if", "(", "empty", "(", "$", "constraints", ")", ")", "{", "return", ";", "}", "$...
Validates given method values against its constraints @param MethodInterface $method @throws Exception\InvalidAttributeValue
[ "Validates", "given", "method", "values", "against", "its", "constraints" ]
602f6c40f81d4dfae0e1e9f327736c2c2e31a82b
https://github.com/cardinity/cardinity-sdk-php/blob/602f6c40f81d4dfae0e1e9f327736c2c2e31a82b/src/Method/Validator.php#L27-L47
189,218
cardinity/cardinity-sdk-php
src/Exception/Request.php
Request.getErrorsAsString
public function getErrorsAsString() { $string = ''; foreach ($this->getErrors() as $error) { $string .= sprintf( "%s: %s", $error['field'], $error['message'] ); if (isset($error['rejected'])) { $strin...
php
public function getErrorsAsString() { $string = ''; foreach ($this->getErrors() as $error) { $string .= sprintf( "%s: %s", $error['field'], $error['message'] ); if (isset($error['rejected'])) { $strin...
[ "public", "function", "getErrorsAsString", "(", ")", "{", "$", "string", "=", "''", ";", "foreach", "(", "$", "this", "->", "getErrors", "(", ")", "as", "$", "error", ")", "{", "$", "string", ".=", "sprintf", "(", "\"%s: %s\"", ",", "$", "error", "["...
Errors in string form @return string
[ "Errors", "in", "string", "form" ]
602f6c40f81d4dfae0e1e9f327736c2c2e31a82b
https://github.com/cardinity/cardinity-sdk-php/blob/602f6c40f81d4dfae0e1e9f327736c2c2e31a82b/src/Exception/Request.php#L46-L62
189,219
cardinity/cardinity-sdk-php
src/Client.php
Client.create
public static function create(array $options = [], $logger = Client::LOG_NONE) { $oauth = new Oauth1([ 'token_secret' => '', 'consumer_key' => $options['consumerKey'], 'consumer_secret' => $options['consumerSecret'] ]); $stack = HandlerStack::create(); ...
php
public static function create(array $options = [], $logger = Client::LOG_NONE) { $oauth = new Oauth1([ 'token_secret' => '', 'consumer_key' => $options['consumerKey'], 'consumer_secret' => $options['consumerSecret'] ]); $stack = HandlerStack::create(); ...
[ "public", "static", "function", "create", "(", "array", "$", "options", "=", "[", "]", ",", "$", "logger", "=", "Client", "::", "LOG_NONE", ")", "{", "$", "oauth", "=", "new", "Oauth1", "(", "[", "'token_secret'", "=>", "''", ",", "'consumer_key'", "=>...
Public factory method to create instance of Client. @param array $options Available properties: [ 'consumerKey' => 'foo', 'consumerSecret' => 'bar', ] @param LoggerInterface $logger Logs messages. @return self
[ "Public", "factory", "method", "to", "create", "instance", "of", "Client", "." ]
602f6c40f81d4dfae0e1e9f327736c2c2e31a82b
https://github.com/cardinity/cardinity-sdk-php/blob/602f6c40f81d4dfae0e1e9f327736c2c2e31a82b/src/Client.php#L54-L84
189,220
cardinity/cardinity-sdk-php
src/Client.php
Client.call
public function call(MethodInterface $method) { $this->validator->validate($method); return $this->handleRequest($method); }
php
public function call(MethodInterface $method) { $this->validator->validate($method); return $this->handleRequest($method); }
[ "public", "function", "call", "(", "MethodInterface", "$", "method", ")", "{", "$", "this", "->", "validator", "->", "validate", "(", "$", "method", ")", ";", "return", "$", "this", "->", "handleRequest", "(", "$", "method", ")", ";", "}" ]
Call the given method. @param MethodInterface $method @return ResultObjectInterface|array
[ "Call", "the", "given", "method", "." ]
602f6c40f81d4dfae0e1e9f327736c2c2e31a82b
https://github.com/cardinity/cardinity-sdk-php/blob/602f6c40f81d4dfae0e1e9f327736c2c2e31a82b/src/Client.php#L106-L111
189,221
cardinity/cardinity-sdk-php
src/Client.php
Client.getOptions
private function getOptions(MethodInterface $method) { if ($method->getMethod() == $method::GET) { return [ 'query' => $method->getAttributes(), ]; } return [ 'headers' => [ 'Content-Type' => 'application/json', ...
php
private function getOptions(MethodInterface $method) { if ($method->getMethod() == $method::GET) { return [ 'query' => $method->getAttributes(), ]; } return [ 'headers' => [ 'Content-Type' => 'application/json', ...
[ "private", "function", "getOptions", "(", "MethodInterface", "$", "method", ")", "{", "if", "(", "$", "method", "->", "getMethod", "(", ")", "==", "$", "method", "::", "GET", ")", "{", "return", "[", "'query'", "=>", "$", "method", "->", "getAttributes",...
Prepare request options for particular method @param MethodInterface $method @return array
[ "Prepare", "request", "options", "for", "particular", "method" ]
602f6c40f81d4dfae0e1e9f327736c2c2e31a82b
https://github.com/cardinity/cardinity-sdk-php/blob/602f6c40f81d4dfae0e1e9f327736c2c2e31a82b/src/Client.php#L149-L166
189,222
cardinity/cardinity-sdk-php
src/Client.php
Client.prepareAttributes
private function prepareAttributes(array $data) { foreach ($data as $key => &$value) { if (is_array($value)) { $data[$key] = $this->prepareAttributes($value); continue; } if (is_float($value)) { $value = sprintf("%01.2f", $...
php
private function prepareAttributes(array $data) { foreach ($data as $key => &$value) { if (is_array($value)) { $data[$key] = $this->prepareAttributes($value); continue; } if (is_float($value)) { $value = sprintf("%01.2f", $...
[ "private", "function", "prepareAttributes", "(", "array", "$", "data", ")", "{", "foreach", "(", "$", "data", "as", "$", "key", "=>", "&", "$", "value", ")", "{", "if", "(", "is_array", "(", "$", "value", ")", ")", "{", "$", "data", "[", "$", "ke...
Prepare request attributes @param array $data @return array
[ "Prepare", "request", "attributes" ]
602f6c40f81d4dfae0e1e9f327736c2c2e31a82b
https://github.com/cardinity/cardinity-sdk-php/blob/602f6c40f81d4dfae0e1e9f327736c2c2e31a82b/src/Client.php#L173-L187
189,223
marcioAlmada/annotations
src/DynamicParser.php
DynamicParser.parse
public function parse($docblock) { $docblock = $this->getDocblockTagsSection($docblock); $annotations = $this->parseAnnotations($docblock); foreach ($annotations as &$value) { if (1 == count($value)) { $value = $value[0]; } } return $a...
php
public function parse($docblock) { $docblock = $this->getDocblockTagsSection($docblock); $annotations = $this->parseAnnotations($docblock); foreach ($annotations as &$value) { if (1 == count($value)) { $value = $value[0]; } } return $a...
[ "public", "function", "parse", "(", "$", "docblock", ")", "{", "$", "docblock", "=", "$", "this", "->", "getDocblockTagsSection", "(", "$", "docblock", ")", ";", "$", "annotations", "=", "$", "this", "->", "parseAnnotations", "(", "$", "docblock", ")", "...
Parse a given docblock @param string $docblock @return array
[ "Parse", "a", "given", "docblock" ]
b0eaa76362d4c27dbba1cdab1025684d044907e0
https://github.com/marcioAlmada/annotations/blob/b0eaa76362d4c27dbba1cdab1025684d044907e0/src/DynamicParser.php#L46-L57
189,224
marcioAlmada/annotations
src/DynamicParser.php
DynamicParser.getDocblockTagsSection
protected function getDocblockTagsSection($docblock) { $docblock = $this->sanitizeDocblock($docblock); preg_match('/^\s*\\'.self::TOKEN_ANNOTATION_IDENTIFIER.'/m', $docblock, $matches, PREG_OFFSET_CAPTURE); // return found docblock tag section or empty string return isset($matches[0...
php
protected function getDocblockTagsSection($docblock) { $docblock = $this->sanitizeDocblock($docblock); preg_match('/^\s*\\'.self::TOKEN_ANNOTATION_IDENTIFIER.'/m', $docblock, $matches, PREG_OFFSET_CAPTURE); // return found docblock tag section or empty string return isset($matches[0...
[ "protected", "function", "getDocblockTagsSection", "(", "$", "docblock", ")", "{", "$", "docblock", "=", "$", "this", "->", "sanitizeDocblock", "(", "$", "docblock", ")", ";", "preg_match", "(", "'/^\\s*\\\\'", ".", "self", "::", "TOKEN_ANNOTATION_IDENTIFIER", "...
Filters docblock tags section, removing unwanted long and short descriptions @param string $docblock A docblok string without delimiters @return string Tag section from given docblock
[ "Filters", "docblock", "tags", "section", "removing", "unwanted", "long", "and", "short", "descriptions" ]
b0eaa76362d4c27dbba1cdab1025684d044907e0
https://github.com/marcioAlmada/annotations/blob/b0eaa76362d4c27dbba1cdab1025684d044907e0/src/DynamicParser.php#L65-L72
189,225
marcioAlmada/annotations
src/AnnotationsBag.php
AnnotationsBag.get
public function get($key, $defaut = null) { if ($this->has($key)) { return $this->attributes[$key]; } return $defaut; }
php
public function get($key, $defaut = null) { if ($this->has($key)) { return $this->attributes[$key]; } return $defaut; }
[ "public", "function", "get", "(", "$", "key", ",", "$", "defaut", "=", "null", ")", "{", "if", "(", "$", "this", "->", "has", "(", "$", "key", ")", ")", "{", "return", "$", "this", "->", "attributes", "[", "$", "key", "]", ";", "}", "return", ...
Retrieves a single annotation value @param string $key A valid annotation tag, should match parser rules @param mixed $defaut Default value in case $key is not set @return mixed|null
[ "Retrieves", "a", "single", "annotation", "value" ]
b0eaa76362d4c27dbba1cdab1025684d044907e0
https://github.com/marcioAlmada/annotations/blob/b0eaa76362d4c27dbba1cdab1025684d044907e0/src/AnnotationsBag.php#L80-L87
189,226
marcioAlmada/annotations
src/AnnotationsBag.php
AnnotationsBag.getAsArray
public function getAsArray($key) { if (! $this->has($key)) { return []; } $res = $this->attributes[$key]; if (is_null($res)) { return [null]; } return (array) $res; }
php
public function getAsArray($key) { if (! $this->has($key)) { return []; } $res = $this->attributes[$key]; if (is_null($res)) { return [null]; } return (array) $res; }
[ "public", "function", "getAsArray", "(", "$", "key", ")", "{", "if", "(", "!", "$", "this", "->", "has", "(", "$", "key", ")", ")", "{", "return", "[", "]", ";", "}", "$", "res", "=", "$", "this", "->", "attributes", "[", "$", "key", "]", ";"...
Retrieve annotation values as an array even if there's only one single value @param string $key A valid annotation tag, should match parser rules @return array
[ "Retrieve", "annotation", "values", "as", "an", "array", "even", "if", "there", "s", "only", "one", "single", "value" ]
b0eaa76362d4c27dbba1cdab1025684d044907e0
https://github.com/marcioAlmada/annotations/blob/b0eaa76362d4c27dbba1cdab1025684d044907e0/src/AnnotationsBag.php#L95-L106
189,227
marcioAlmada/annotations
src/AnnotationsBag.php
AnnotationsBag.grep
public function grep($pattern) { $results = array_intersect_key($this->attributes, array_flip( RegexGuard::getGuard()->grep($pattern, array_keys($this->attributes)) )); return new static($results); }
php
public function grep($pattern) { $results = array_intersect_key($this->attributes, array_flip( RegexGuard::getGuard()->grep($pattern, array_keys($this->attributes)) )); return new static($results); }
[ "public", "function", "grep", "(", "$", "pattern", ")", "{", "$", "results", "=", "array_intersect_key", "(", "$", "this", "->", "attributes", ",", "array_flip", "(", "RegexGuard", "::", "getGuard", "(", ")", "->", "grep", "(", "$", "pattern", ",", "arra...
Filters annotations based on a regexp @param string $pattern valid regexp @return \Minime\Annotations\AnnotationsBag Annotations collection with filtered results
[ "Filters", "annotations", "based", "on", "a", "regexp" ]
b0eaa76362d4c27dbba1cdab1025684d044907e0
https://github.com/marcioAlmada/annotations/blob/b0eaa76362d4c27dbba1cdab1025684d044907e0/src/AnnotationsBag.php#L114-L121
189,228
marcioAlmada/annotations
src/AnnotationsBag.php
AnnotationsBag.useNamespace
public function useNamespace($pattern, array $delimiters = ['.', '\\']) { $mask = implode('', $delimiters); $consumer = '(' . implode('|', array_map('preg_quote', $delimiters)) .')'; $namespace_pattern = '/^' . preg_quote(rtrim($pattern, $mask)) . $consumer . '/'; $iterator = new ...
php
public function useNamespace($pattern, array $delimiters = ['.', '\\']) { $mask = implode('', $delimiters); $consumer = '(' . implode('|', array_map('preg_quote', $delimiters)) .')'; $namespace_pattern = '/^' . preg_quote(rtrim($pattern, $mask)) . $consumer . '/'; $iterator = new ...
[ "public", "function", "useNamespace", "(", "$", "pattern", ",", "array", "$", "delimiters", "=", "[", "'.'", ",", "'\\\\'", "]", ")", "{", "$", "mask", "=", "implode", "(", "''", ",", "$", "delimiters", ")", ";", "$", "consumer", "=", "'('", ".", "...
Isolates a given namespace of annotations. @param string $pattern namespace @param array $delimiters possible namespace delimiters to mask @return \Minime\Annotations\AnnotationsBag
[ "Isolates", "a", "given", "namespace", "of", "annotations", "." ]
b0eaa76362d4c27dbba1cdab1025684d044907e0
https://github.com/marcioAlmada/annotations/blob/b0eaa76362d4c27dbba1cdab1025684d044907e0/src/AnnotationsBag.php#L130-L140
189,229
marcioAlmada/annotations
src/Types/ConcreteType.php
ConcreteType.parse
public function parse($value, $class = null) { if (! class_exists($class)) { throw new ParserException("Concrete annotation expects {$class} to exist."); } $prototype = (new JsonType)->parse($value); if ($prototype instanceof stdClass) { if (! $this->isProto...
php
public function parse($value, $class = null) { if (! class_exists($class)) { throw new ParserException("Concrete annotation expects {$class} to exist."); } $prototype = (new JsonType)->parse($value); if ($prototype instanceof stdClass) { if (! $this->isProto...
[ "public", "function", "parse", "(", "$", "value", ",", "$", "class", "=", "null", ")", "{", "if", "(", "!", "class_exists", "(", "$", "class", ")", ")", "{", "throw", "new", "ParserException", "(", "\"Concrete annotation expects {$class} to exist.\"", ")", "...
Process a value to be a concrete annotation @param string $value json string @param string $class name of concrete annotation type (class) @throws \Minime\Annotations\ParserException @return object
[ "Process", "a", "value", "to", "be", "a", "concrete", "annotation" ]
b0eaa76362d4c27dbba1cdab1025684d044907e0
https://github.com/marcioAlmada/annotations/blob/b0eaa76362d4c27dbba1cdab1025684d044907e0/src/Types/ConcreteType.php#L21-L42
189,230
marcioAlmada/annotations
src/Types/ConcreteType.php
ConcreteType.makeInstance
protected function makeInstance($class, stdClass $prototype) { $reflection = new ReflectionClass($class); if (isset($prototype->__construct)) { $instance = $reflection->newInstanceArgs($prototype->__construct); unset($prototype->__construct); } else { $ins...
php
protected function makeInstance($class, stdClass $prototype) { $reflection = new ReflectionClass($class); if (isset($prototype->__construct)) { $instance = $reflection->newInstanceArgs($prototype->__construct); unset($prototype->__construct); } else { $ins...
[ "protected", "function", "makeInstance", "(", "$", "class", ",", "stdClass", "$", "prototype", ")", "{", "$", "reflection", "=", "new", "ReflectionClass", "(", "$", "class", ")", ";", "if", "(", "isset", "(", "$", "prototype", "->", "__construct", ")", "...
Creates and hydrates a concrete annotation class @param string $class full qualified class name @param stdClass $prototype object prototype @return object hydrated concrete annotation class
[ "Creates", "and", "hydrates", "a", "concrete", "annotation", "class" ]
b0eaa76362d4c27dbba1cdab1025684d044907e0
https://github.com/marcioAlmada/annotations/blob/b0eaa76362d4c27dbba1cdab1025684d044907e0/src/Types/ConcreteType.php#L58-L69
189,231
marcioAlmada/annotations
src/Types/ConcreteType.php
ConcreteType.doMethodConfiguration
protected function doMethodConfiguration($instance, stdClass $prototype) { foreach ($prototype as $method => $args) { call_user_func_array([$instance, $method], $args); } return $instance; }
php
protected function doMethodConfiguration($instance, stdClass $prototype) { foreach ($prototype as $method => $args) { call_user_func_array([$instance, $method], $args); } return $instance; }
[ "protected", "function", "doMethodConfiguration", "(", "$", "instance", ",", "stdClass", "$", "prototype", ")", "{", "foreach", "(", "$", "prototype", "as", "$", "method", "=>", "$", "args", ")", "{", "call_user_func_array", "(", "[", "$", "instance", ",", ...
Do configuration injection through method calls @param object $instance concrete annotation instance @param stdClass $prototype object prototype @return object hydrated concrete annotation class
[ "Do", "configuration", "injection", "through", "method", "calls" ]
b0eaa76362d4c27dbba1cdab1025684d044907e0
https://github.com/marcioAlmada/annotations/blob/b0eaa76362d4c27dbba1cdab1025684d044907e0/src/Types/ConcreteType.php#L78-L85
189,232
marcioAlmada/annotations
src/Types/ConcreteType.php
ConcreteType.isPrototypeSchemaValid
protected function isPrototypeSchemaValid(stdclass $prototype) { foreach ($prototype as $method => $args) { if (! is_array($args)) { return false; } } return true; }
php
protected function isPrototypeSchemaValid(stdclass $prototype) { foreach ($prototype as $method => $args) { if (! is_array($args)) { return false; } } return true; }
[ "protected", "function", "isPrototypeSchemaValid", "(", "stdclass", "$", "prototype", ")", "{", "foreach", "(", "$", "prototype", "as", "$", "method", "=>", "$", "args", ")", "{", "if", "(", "!", "is_array", "(", "$", "args", ")", ")", "{", "return", "...
Validates a prototype object @param stdClass $prototype object prototype @return boolean true if prototype is valid
[ "Validates", "a", "prototype", "object" ]
b0eaa76362d4c27dbba1cdab1025684d044907e0
https://github.com/marcioAlmada/annotations/blob/b0eaa76362d4c27dbba1cdab1025684d044907e0/src/Types/ConcreteType.php#L93-L102
189,233
cardinity/cardinity-sdk-php
src/Http/Guzzle/ExceptionMapper.php
ExceptionMapper.get
public function get(ClientException $exception, MethodInterface $method) { $map = $this->getMap(); if ($this->supports($exception, $map)) { return $this->create( $this->getMappedClass($exception, $map), $exception, $method ); ...
php
public function get(ClientException $exception, MethodInterface $method) { $map = $this->getMap(); if ($this->supports($exception, $map)) { return $this->create( $this->getMappedClass($exception, $map), $exception, $method ); ...
[ "public", "function", "get", "(", "ClientException", "$", "exception", ",", "MethodInterface", "$", "method", ")", "{", "$", "map", "=", "$", "this", "->", "getMap", "(", ")", ";", "if", "(", "$", "this", "->", "supports", "(", "$", "exception", ",", ...
Get mapped exception @param ClientException $exception @param MethodInterface $method @return Cardinity\Exception\Request
[ "Get", "mapped", "exception" ]
602f6c40f81d4dfae0e1e9f327736c2c2e31a82b
https://github.com/cardinity/cardinity-sdk-php/blob/602f6c40f81d4dfae0e1e9f327736c2c2e31a82b/src/Http/Guzzle/ExceptionMapper.php#L29-L45
189,234
cardinity/cardinity-sdk-php
src/Method/ResultObjectMapper.php
ResultObjectMapper.getSetterName
private function getSetterName($field) { $parts = explode('_', $field); array_map('ucfirst', $parts); $name = 'set' . implode('', $parts); return $name; }
php
private function getSetterName($field) { $parts = explode('_', $field); array_map('ucfirst', $parts); $name = 'set' . implode('', $parts); return $name; }
[ "private", "function", "getSetterName", "(", "$", "field", ")", "{", "$", "parts", "=", "explode", "(", "'_'", ",", "$", "field", ")", ";", "array_map", "(", "'ucfirst'", ",", "$", "parts", ")", ";", "$", "name", "=", "'set'", ".", "implode", "(", ...
Extracts camelCased setter name from underscore notation. Eg. my_field_name => myFieldName @param string $field @return string
[ "Extracts", "camelCased", "setter", "name", "from", "underscore", "notation", ".", "Eg", ".", "my_field_name", "=", ">", "myFieldName" ]
602f6c40f81d4dfae0e1e9f327736c2c2e31a82b
https://github.com/cardinity/cardinity-sdk-php/blob/602f6c40f81d4dfae0e1e9f327736c2c2e31a82b/src/Method/ResultObjectMapper.php#L64-L71
189,235
cardinity/cardinity-sdk-php
src/Method/ResultObjectMapper.php
ResultObjectMapper.transformPaymentInstrumentValue
private function transformPaymentInstrumentValue(array $data, $method) { if ($method == 'card') { $instrument = new PaymentInstrumentCard(); } elseif ($method == 'recurring') { $instrument = new PaymentInstrumentRecurring(); } else { throw new Exception\Ru...
php
private function transformPaymentInstrumentValue(array $data, $method) { if ($method == 'card') { $instrument = new PaymentInstrumentCard(); } elseif ($method == 'recurring') { $instrument = new PaymentInstrumentRecurring(); } else { throw new Exception\Ru...
[ "private", "function", "transformPaymentInstrumentValue", "(", "array", "$", "data", ",", "$", "method", ")", "{", "if", "(", "$", "method", "==", "'card'", ")", "{", "$", "instrument", "=", "new", "PaymentInstrumentCard", "(", ")", ";", "}", "elseif", "("...
Transform PaymentInstrument result array to object @param array $data @param string $method @return PaymentInstrumentCard|PaymentInstrumentRecurring @throws Exception\Runtime for unsupported methods
[ "Transform", "PaymentInstrument", "result", "array", "to", "object" ]
602f6c40f81d4dfae0e1e9f327736c2c2e31a82b
https://github.com/cardinity/cardinity-sdk-php/blob/602f6c40f81d4dfae0e1e9f327736c2c2e31a82b/src/Method/ResultObjectMapper.php#L80-L93
189,236
marcioAlmada/annotations
src/Types/DynamicType.php
DynamicType.parse
public function parse($value, $annotation = null) { if ('' === $value) return true; // implicit boolean $json = JsonType::jsonDecode($value); if (JSON_ERROR_NONE === json_last_error()) { return $json; } elseif (false !== ($int = filter_var($value, FILTER_VALIDAT...
php
public function parse($value, $annotation = null) { if ('' === $value) return true; // implicit boolean $json = JsonType::jsonDecode($value); if (JSON_ERROR_NONE === json_last_error()) { return $json; } elseif (false !== ($int = filter_var($value, FILTER_VALIDAT...
[ "public", "function", "parse", "(", "$", "value", ",", "$", "annotation", "=", "null", ")", "{", "if", "(", "''", "===", "$", "value", ")", "return", "true", ";", "// implicit boolean", "$", "json", "=", "JsonType", "::", "jsonDecode", "(", "$", "value...
Parse a given undefined type value @param string $value @param null $annotation Unused @return mixed
[ "Parse", "a", "given", "undefined", "type", "value" ]
b0eaa76362d4c27dbba1cdab1025684d044907e0
https://github.com/marcioAlmada/annotations/blob/b0eaa76362d4c27dbba1cdab1025684d044907e0/src/Types/DynamicType.php#L17-L34
189,237
marcioAlmada/annotations
src/Types/IntegerType.php
IntegerType.parse
public function parse($value, $annotation = null) { if (false === ($value = filter_var($value, FILTER_VALIDATE_INT))) { throw new ParserException("Raw value must be integer. Invalid value '{$value}' given."); } return $value; }
php
public function parse($value, $annotation = null) { if (false === ($value = filter_var($value, FILTER_VALIDATE_INT))) { throw new ParserException("Raw value must be integer. Invalid value '{$value}' given."); } return $value; }
[ "public", "function", "parse", "(", "$", "value", ",", "$", "annotation", "=", "null", ")", "{", "if", "(", "false", "===", "(", "$", "value", "=", "filter_var", "(", "$", "value", ",", "FILTER_VALIDATE_INT", ")", ")", ")", "{", "throw", "new", "Pars...
Filter a value to be an Integer @param string $value @param null $annotation Unused @throws \Minime\Annotations\ParserException @return integer
[ "Filter", "a", "value", "to", "be", "an", "Integer" ]
b0eaa76362d4c27dbba1cdab1025684d044907e0
https://github.com/marcioAlmada/annotations/blob/b0eaa76362d4c27dbba1cdab1025684d044907e0/src/Types/IntegerType.php#L19-L26
189,238
marcioAlmada/annotations
src/Types/FloatType.php
FloatType.parse
public function parse($value, $annotation = null) { if (false === ($value = filter_var($value, FILTER_VALIDATE_FLOAT))) { throw new ParserException("Raw value must be float. Invalid value '{$value}' given."); } return $value; }
php
public function parse($value, $annotation = null) { if (false === ($value = filter_var($value, FILTER_VALIDATE_FLOAT))) { throw new ParserException("Raw value must be float. Invalid value '{$value}' given."); } return $value; }
[ "public", "function", "parse", "(", "$", "value", ",", "$", "annotation", "=", "null", ")", "{", "if", "(", "false", "===", "(", "$", "value", "=", "filter_var", "(", "$", "value", ",", "FILTER_VALIDATE_FLOAT", ")", ")", ")", "{", "throw", "new", "Pa...
Filter a value to be a Float @param string $value @param null $annotation Unused @throws \Minime\Annotations\ParserException @return float
[ "Filter", "a", "value", "to", "be", "a", "Float" ]
b0eaa76362d4c27dbba1cdab1025684d044907e0
https://github.com/marcioAlmada/annotations/blob/b0eaa76362d4c27dbba1cdab1025684d044907e0/src/Types/FloatType.php#L19-L26
189,239
cardinity/cardinity-sdk-php
src/Method/ResultObject.php
ResultObject.serialize
public function serialize($toJson = true) { $data = []; $getters = $this->classGetters(get_class($this)); foreach ($getters as $method) { $property = $this->propertyName($method); $value = $this->$method(); if (is_float($value)) { $value ...
php
public function serialize($toJson = true) { $data = []; $getters = $this->classGetters(get_class($this)); foreach ($getters as $method) { $property = $this->propertyName($method); $value = $this->$method(); if (is_float($value)) { $value ...
[ "public", "function", "serialize", "(", "$", "toJson", "=", "true", ")", "{", "$", "data", "=", "[", "]", ";", "$", "getters", "=", "$", "this", "->", "classGetters", "(", "get_class", "(", "$", "this", ")", ")", ";", "foreach", "(", "$", "getters"...
Serializes result object to json object @param boolean $toJson encode result to json @return array|object
[ "Serializes", "result", "object", "to", "json", "object" ]
602f6c40f81d4dfae0e1e9f327736c2c2e31a82b
https://github.com/cardinity/cardinity-sdk-php/blob/602f6c40f81d4dfae0e1e9f327736c2c2e31a82b/src/Method/ResultObject.php#L39-L64
189,240
cardinity/cardinity-sdk-php
src/Method/ResultObject.php
ResultObject.unserialize
public function unserialize($string) { $data = json_decode($string); foreach ($data as $property => $value) { $method = $this->setterName($property); if (is_numeric($value) && strstr($value, '.')) { $value = floatval($value); } elseif (is_object($...
php
public function unserialize($string) { $data = json_decode($string); foreach ($data as $property => $value) { $method = $this->setterName($property); if (is_numeric($value) && strstr($value, '.')) { $value = floatval($value); } elseif (is_object($...
[ "public", "function", "unserialize", "(", "$", "string", ")", "{", "$", "data", "=", "json_decode", "(", "$", "string", ")", ";", "foreach", "(", "$", "data", "as", "$", "property", "=>", "$", "value", ")", "{", "$", "method", "=", "$", "this", "->...
Loads result object values from json object @param string $string json @return void
[ "Loads", "result", "object", "values", "from", "json", "object" ]
602f6c40f81d4dfae0e1e9f327736c2c2e31a82b
https://github.com/cardinity/cardinity-sdk-php/blob/602f6c40f81d4dfae0e1e9f327736c2c2e31a82b/src/Method/ResultObject.php#L71-L107
189,241
marcioAlmada/annotations
src/Types/JsonType.php
JsonType.parse
public function parse($value, $annotation = null) { $json = static::jsonDecode($value); if (JSON_ERROR_NONE != json_last_error()) { throw new ParserException("Raw value must be a valid JSON string. Invalid value '{$value}' given."); } return $json; }
php
public function parse($value, $annotation = null) { $json = static::jsonDecode($value); if (JSON_ERROR_NONE != json_last_error()) { throw new ParserException("Raw value must be a valid JSON string. Invalid value '{$value}' given."); } return $json; }
[ "public", "function", "parse", "(", "$", "value", ",", "$", "annotation", "=", "null", ")", "{", "$", "json", "=", "static", "::", "jsonDecode", "(", "$", "value", ")", ";", "if", "(", "JSON_ERROR_NONE", "!=", "json_last_error", "(", ")", ")", "{", "...
Filter a value to be a Json @param string $value @param null $annotation Unused @throws \Minime\Annotations\ParserException @return mixed
[ "Filter", "a", "value", "to", "be", "a", "Json" ]
b0eaa76362d4c27dbba1cdab1025684d044907e0
https://github.com/marcioAlmada/annotations/blob/b0eaa76362d4c27dbba1cdab1025684d044907e0/src/Types/JsonType.php#L19-L27
189,242
marcioAlmada/annotations
src/Types/JsonType.php
JsonType.jsonDecode
public static function jsonDecode($value) { if (defined('JSON_PARSER_NOTSTRICT')) { // pecl-json-c ext $decoded = json_decode($value, false, 512, JSON_PARSER_NOTSTRICT); } else { // json-ext $decoded = json_decode($value); } return $decoded; }
php
public static function jsonDecode($value) { if (defined('JSON_PARSER_NOTSTRICT')) { // pecl-json-c ext $decoded = json_decode($value, false, 512, JSON_PARSER_NOTSTRICT); } else { // json-ext $decoded = json_decode($value); } return $decoded; }
[ "public", "static", "function", "jsonDecode", "(", "$", "value", ")", "{", "if", "(", "defined", "(", "'JSON_PARSER_NOTSTRICT'", ")", ")", "{", "// pecl-json-c ext", "$", "decoded", "=", "json_decode", "(", "$", "value", ",", "false", ",", "512", ",", "JSO...
Wrapper fo json_decode function that keeps parser portable between json-ext and pecl-json-c extensions @param string $value json string @return mixed
[ "Wrapper", "fo", "json_decode", "function", "that", "keeps", "parser", "portable", "between", "json", "-", "ext", "and", "pecl", "-", "json", "-", "c", "extensions" ]
b0eaa76362d4c27dbba1cdab1025684d044907e0
https://github.com/marcioAlmada/annotations/blob/b0eaa76362d4c27dbba1cdab1025684d044907e0/src/Types/JsonType.php#L36-L45
189,243
marcioAlmada/annotations
src/Parser.php
Parser.parseValue
protected function parseValue($value, $key = null) { $value = trim($value); $type = '\Minime\\Annotations\\Types\\DynamicType'; if (preg_match($this->typesPattern, $value, $found)) { // strong typed $type = $found[1]; $value = trim(substr($value, strlen($type))); ...
php
protected function parseValue($value, $key = null) { $value = trim($value); $type = '\Minime\\Annotations\\Types\\DynamicType'; if (preg_match($this->typesPattern, $value, $found)) { // strong typed $type = $found[1]; $value = trim(substr($value, strlen($type))); ...
[ "protected", "function", "parseValue", "(", "$", "value", ",", "$", "key", "=", "null", ")", "{", "$", "value", "=", "trim", "(", "$", "value", ")", ";", "$", "type", "=", "'\\Minime\\\\Annotations\\\\Types\\\\DynamicType'", ";", "if", "(", "preg_match", "...
Parse a single annotation value @param string $value @param string $key @return mixed
[ "Parse", "a", "single", "annotation", "value" ]
b0eaa76362d4c27dbba1cdab1025684d044907e0
https://github.com/marcioAlmada/annotations/blob/b0eaa76362d4c27dbba1cdab1025684d044907e0/src/Parser.php#L65-L78
189,244
adbario/slim-secure-session-middleware
src/SecureSessionHandler.php
SecureSessionHandler.encrypt
protected function encrypt($data) { $salt = random_bytes(16); $salted = hash('sha512', $this->key . $salt, true); $key = substr($salted, 0, 32); $iv = substr($salted, 32, 16); $encryptedData = openssl_encrypt($data, 'AES-256-CBC', $key, OPENSSL_RAW_DATA, $iv); ...
php
protected function encrypt($data) { $salt = random_bytes(16); $salted = hash('sha512', $this->key . $salt, true); $key = substr($salted, 0, 32); $iv = substr($salted, 32, 16); $encryptedData = openssl_encrypt($data, 'AES-256-CBC', $key, OPENSSL_RAW_DATA, $iv); ...
[ "protected", "function", "encrypt", "(", "$", "data", ")", "{", "$", "salt", "=", "random_bytes", "(", "16", ")", ";", "$", "salted", "=", "hash", "(", "'sha512'", ",", "$", "this", "->", "key", ".", "$", "salt", ",", "true", ")", ";", "$", "key"...
Encrypt session data @param string $data Session data @return string
[ "Encrypt", "session", "data" ]
f107191506b2c362f06f201f998891f315d6aaec
https://github.com/adbario/slim-secure-session-middleware/blob/f107191506b2c362f06f201f998891f315d6aaec/src/SecureSessionHandler.php#L65-L75
189,245
adbario/slim-secure-session-middleware
src/SecureSessionHandler.php
SecureSessionHandler.decrypt
protected function decrypt($data) { $data = base64_decode($data); $salt = substr($data, 0, 16); $data = substr($data, 16); $salted = hash('sha512', $this->key . $salt, true); $key = substr($salted, 0, 32); $iv = substr($salted, 32, 16); return openssl...
php
protected function decrypt($data) { $data = base64_decode($data); $salt = substr($data, 0, 16); $data = substr($data, 16); $salted = hash('sha512', $this->key . $salt, true); $key = substr($salted, 0, 32); $iv = substr($salted, 32, 16); return openssl...
[ "protected", "function", "decrypt", "(", "$", "data", ")", "{", "$", "data", "=", "base64_decode", "(", "$", "data", ")", ";", "$", "salt", "=", "substr", "(", "$", "data", ",", "0", ",", "16", ")", ";", "$", "data", "=", "substr", "(", "$", "d...
Decrypt session data @param string $data Encrypted session data @return string
[ "Decrypt", "session", "data" ]
f107191506b2c362f06f201f998891f315d6aaec
https://github.com/adbario/slim-secure-session-middleware/blob/f107191506b2c362f06f201f998891f315d6aaec/src/SecureSessionHandler.php#L83-L94
189,246
lazyjsonmapper/lazyjsonmapper
src/LazyJsonMapper.php
LazyJsonMapper.assignObjectData
final public function assignObjectData( array $objectData = [], $requireAnalysis = false) { // Save the provided JSON data array. $this->_objectData = $objectData; // Recursively look for missing/bad JSON properties, if scan requested. // NOTE: "Bad" in this case inc...
php
final public function assignObjectData( array $objectData = [], $requireAnalysis = false) { // Save the provided JSON data array. $this->_objectData = $objectData; // Recursively look for missing/bad JSON properties, if scan requested. // NOTE: "Bad" in this case inc...
[ "final", "public", "function", "assignObjectData", "(", "array", "$", "objectData", "=", "[", "]", ",", "$", "requireAnalysis", "=", "false", ")", "{", "// Save the provided JSON data array.", "$", "this", "->", "_objectData", "=", "$", "objectData", ";", "// Re...
Assign a new internal JSON data array for this object. This is used by the constructor for assigning the initial internal data state, but can also be very useful for users who want to manually replace the contents of their object at a later time. For example, it might suit your project design better to first construc...
[ "Assign", "a", "new", "internal", "JSON", "data", "array", "for", "this", "object", "." ]
51e093b50f4de15d2d64548b3ca743713eed6ee9
https://github.com/lazyjsonmapper/lazyjsonmapper/blob/51e093b50f4de15d2d64548b3ca743713eed6ee9/src/LazyJsonMapper.php#L747-L786
189,247
lazyjsonmapper/lazyjsonmapper
src/LazyJsonMapper.php
LazyJsonMapper.exportObjectDataCopy
final public function exportObjectDataCopy( $objectRepresentation = 'array') { if (!in_array($objectRepresentation, ['stdClass', 'array'], true)) { throw new LazyJsonMapperException(sprintf( 'Invalid object representation type "%s". Must be either "stdClass" or "array".',...
php
final public function exportObjectDataCopy( $objectRepresentation = 'array') { if (!in_array($objectRepresentation, ['stdClass', 'array'], true)) { throw new LazyJsonMapperException(sprintf( 'Invalid object representation type "%s". Must be either "stdClass" or "array".',...
[ "final", "public", "function", "exportObjectDataCopy", "(", "$", "objectRepresentation", "=", "'array'", ")", "{", "if", "(", "!", "in_array", "(", "$", "objectRepresentation", ",", "[", "'stdClass'", ",", "'array'", "]", ",", "true", ")", ")", "{", "throw",...
Get a processed copy of this object instance's internal data contents. It is recommended that you save the result if you intend to re-use it multiple times, since each call to this function will need to perform copying and data conversion from our internal object representation. Note that the conversion process will ...
[ "Get", "a", "processed", "copy", "of", "this", "object", "instance", "s", "internal", "data", "contents", "." ]
51e093b50f4de15d2d64548b3ca743713eed6ee9
https://github.com/lazyjsonmapper/lazyjsonmapper/blob/51e093b50f4de15d2d64548b3ca743713eed6ee9/src/LazyJsonMapper.php#L1144-L1235
189,248
lazyjsonmapper/lazyjsonmapper
src/LazyJsonMapper.php
LazyJsonMapper.asJson
final public function asJson( $options = 0, $depth = 512) { if (!is_int($options) || !is_int($depth)) { throw new LazyJsonMapperException('Invalid non-integer function argument.'); } // Create a fully-validated, fully-converted final object-tree. // NOTE:...
php
final public function asJson( $options = 0, $depth = 512) { if (!is_int($options) || !is_int($depth)) { throw new LazyJsonMapperException('Invalid non-integer function argument.'); } // Create a fully-validated, fully-converted final object-tree. // NOTE:...
[ "final", "public", "function", "asJson", "(", "$", "options", "=", "0", ",", "$", "depth", "=", "512", ")", "{", "if", "(", "!", "is_int", "(", "$", "options", ")", "||", "!", "is_int", "(", "$", "depth", ")", ")", "{", "throw", "new", "LazyJsonM...
Get a processed representation of this object instance's data as JSON. This helper gives you a JSON string representation of the object's internal data, and provides the necessary interface to fully control the JSON encoding process. It handles all steps for you and wraps everything in nice exceptions, and will even ...
[ "Get", "a", "processed", "representation", "of", "this", "object", "instance", "s", "data", "as", "JSON", "." ]
51e093b50f4de15d2d64548b3ca743713eed6ee9
https://github.com/lazyjsonmapper/lazyjsonmapper/blob/51e093b50f4de15d2d64548b3ca743713eed6ee9/src/LazyJsonMapper.php#L1330-L1352
189,249
lazyjsonmapper/lazyjsonmapper
src/LazyJsonMapper.php
LazyJsonMapper.printJson
final public function printJson( $prettyPrint = true, $depth = 512) { // NOTE: These options are important. For display purposes, we don't // want escaped slashes or `\uXXXX` hex versions of UTF-8 characters. $options = ($prettyPrint ? JSON_PRETTY_PRINT : 0) | JSON_UNESCAPED_...
php
final public function printJson( $prettyPrint = true, $depth = 512) { // NOTE: These options are important. For display purposes, we don't // want escaped slashes or `\uXXXX` hex versions of UTF-8 characters. $options = ($prettyPrint ? JSON_PRETTY_PRINT : 0) | JSON_UNESCAPED_...
[ "final", "public", "function", "printJson", "(", "$", "prettyPrint", "=", "true", ",", "$", "depth", "=", "512", ")", "{", "// NOTE: These options are important. For display purposes, we don't", "// want escaped slashes or `\\uXXXX` hex versions of UTF-8 characters.", "$", "opt...
Print a processed representation of this object instance's data as JSON. This helper is provided as a quick and easy debug feature, instead of having to manually write something like `var_dump($item->asJson())`. And it's also a much better alternative than PHP's common but totally unreadable `var_dump($item->asArray(...
[ "Print", "a", "processed", "representation", "of", "this", "object", "instance", "s", "data", "as", "JSON", "." ]
51e093b50f4de15d2d64548b3ca743713eed6ee9
https://github.com/lazyjsonmapper/lazyjsonmapper/blob/51e093b50f4de15d2d64548b3ca743713eed6ee9/src/LazyJsonMapper.php#L1390-L1404
189,250
lazyjsonmapper/lazyjsonmapper
src/LazyJsonMapper.php
LazyJsonMapper.exportClassAnalysis
final public function exportClassAnalysis( $recursiveScan = true) { $result = new ClassAnalysis(); // All problems with OUR class will get filed under our class name. $definitionSource = get_class($this); // Ensure that all object-data properties exist in our class definiti...
php
final public function exportClassAnalysis( $recursiveScan = true) { $result = new ClassAnalysis(); // All problems with OUR class will get filed under our class name. $definitionSource = get_class($this); // Ensure that all object-data properties exist in our class definiti...
[ "final", "public", "function", "exportClassAnalysis", "(", "$", "recursiveScan", "=", "true", ")", "{", "$", "result", "=", "new", "ClassAnalysis", "(", ")", ";", "// All problems with OUR class will get filed under our class name.", "$", "definitionSource", "=", "get_c...
Analyze the entire object and check for undefined or bad JSON properties. This lets you analyze the object data & map to look for the following: 1. Undefined JSON properties that need to be defined in your classes so that their existence becomes permanent and therefore safer to use (since defined properties are alway...
[ "Analyze", "the", "entire", "object", "and", "check", "for", "undefined", "or", "bad", "JSON", "properties", "." ]
51e093b50f4de15d2d64548b3ca743713eed6ee9
https://github.com/lazyjsonmapper/lazyjsonmapper/blob/51e093b50f4de15d2d64548b3ca743713eed6ee9/src/LazyJsonMapper.php#L1581-L1693
189,251
lazyjsonmapper/lazyjsonmapper
src/LazyJsonMapper.php
LazyJsonMapper._hasPropertyDefinitionOrData
final protected function _hasPropertyDefinitionOrData( $propName) { return isset($this->_compiledPropertyMapLink[$propName]) || array_key_exists($propName, $this->_objectData); }
php
final protected function _hasPropertyDefinitionOrData( $propName) { return isset($this->_compiledPropertyMapLink[$propName]) || array_key_exists($propName, $this->_objectData); }
[ "final", "protected", "function", "_hasPropertyDefinitionOrData", "(", "$", "propName", ")", "{", "return", "isset", "(", "$", "this", "->", "_compiledPropertyMapLink", "[", "$", "propName", "]", ")", "||", "array_key_exists", "(", "$", "propName", ",", "$", "...
Check if a property definition or an object instance data value exists. These are properties that are either defined in the JSON property map for the class OR that exist in the object instance's data. `NOTE:` This is the RECOMMENDED function for checking if a property is valid, since properties ARE VALID if they exis...
[ "Check", "if", "a", "property", "definition", "or", "an", "object", "instance", "data", "value", "exists", "." ]
51e093b50f4de15d2d64548b3ca743713eed6ee9
https://github.com/lazyjsonmapper/lazyjsonmapper/blob/51e093b50f4de15d2d64548b3ca743713eed6ee9/src/LazyJsonMapper.php#L1727-L1732
189,252
lazyjsonmapper/lazyjsonmapper
src/LazyJsonMapper.php
LazyJsonMapper._getPropertyDefinition
final protected function _getPropertyDefinition( $propName, $allowUndefined = true) { if (isset($this->_compiledPropertyMapLink[$propName])) { // Custom class property definition exists, so use that. Properties // defined in the class map are always valid even if not ...
php
final protected function _getPropertyDefinition( $propName, $allowUndefined = true) { if (isset($this->_compiledPropertyMapLink[$propName])) { // Custom class property definition exists, so use that. Properties // defined in the class map are always valid even if not ...
[ "final", "protected", "function", "_getPropertyDefinition", "(", "$", "propName", ",", "$", "allowUndefined", "=", "true", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "_compiledPropertyMapLink", "[", "$", "propName", "]", ")", ")", "{", "// Custom ...
Get the property definition for an object data property. If the property doesn't exist in the class definition but exists in the object instance's data, then it will be treated as an undefined & untyped property. This ensures that the user can access undefined properties too! However, you should always strive to keep...
[ "Get", "the", "property", "definition", "for", "an", "object", "data", "property", "." ]
51e093b50f4de15d2d64548b3ca743713eed6ee9
https://github.com/lazyjsonmapper/lazyjsonmapper/blob/51e093b50f4de15d2d64548b3ca743713eed6ee9/src/LazyJsonMapper.php#L1784-L1803
189,253
lazyjsonmapper/lazyjsonmapper
src/LazyJsonMapper.php
LazyJsonMapper.&
final protected function &_getProperty( $propName, $createMissingValue = false) { // Check if the property exists in class/data and get its definition. $propDef = $this->_getPropertyDefinition($propName); // Throws. // Assign the appropriate reference to the "$value" variabl...
php
final protected function &_getProperty( $propName, $createMissingValue = false) { // Check if the property exists in class/data and get its definition. $propDef = $this->_getPropertyDefinition($propName); // Throws. // Assign the appropriate reference to the "$value" variabl...
[ "final", "protected", "function", "&", "_getProperty", "(", "$", "propName", ",", "$", "createMissingValue", "=", "false", ")", "{", "// Check if the property exists in class/data and get its definition.", "$", "propDef", "=", "$", "this", "->", "_getPropertyDefinition", ...
Get the value of an object data property. This function automatically reads the object instance's data and converts the value to the correct type on-the-fly. If that part of the data-array is an object, it will be lazy-created the first time it's requested. `NOTE:` If the object instance's internal data doesn't conta...
[ "Get", "the", "value", "of", "an", "object", "data", "property", "." ]
51e093b50f4de15d2d64548b3ca743713eed6ee9
https://github.com/lazyjsonmapper/lazyjsonmapper/blob/51e093b50f4de15d2d64548b3ca743713eed6ee9/src/LazyJsonMapper.php#L1921-L1972
189,254
lazyjsonmapper/lazyjsonmapper
src/LazyJsonMapper.php
LazyJsonMapper._isProperty
final protected function _isProperty( $propName) { // Object instance's data has the property and it evaluates to true? return array_key_exists($propName, $this->_objectData) && (bool) $this->_objectData[$propName]; }
php
final protected function _isProperty( $propName) { // Object instance's data has the property and it evaluates to true? return array_key_exists($propName, $this->_objectData) && (bool) $this->_objectData[$propName]; }
[ "final", "protected", "function", "_isProperty", "(", "$", "propName", ")", "{", "// Object instance's data has the property and it evaluates to true?", "return", "array_key_exists", "(", "$", "propName", ",", "$", "this", "->", "_objectData", ")", "&&", "(", "bool", ...
Check if an object data property exists and its value evaluates to TRUE. @param string $propName The property name. @return bool
[ "Check", "if", "an", "object", "data", "property", "exists", "and", "its", "value", "evaluates", "to", "TRUE", "." ]
51e093b50f4de15d2d64548b3ca743713eed6ee9
https://github.com/lazyjsonmapper/lazyjsonmapper/blob/51e093b50f4de15d2d64548b3ca743713eed6ee9/src/LazyJsonMapper.php#L1981-L1987
189,255
lazyjsonmapper/lazyjsonmapper
src/LazyJsonMapper.php
LazyJsonMapper._setProperty
final protected function _setProperty( $propName, $value) { // Check if the property exists in class/data and get its definition. $propDef = $this->_getPropertyDefinition($propName); // Throws. // Map the value to the appropriate type and validate it. ValueConverter:...
php
final protected function _setProperty( $propName, $value) { // Check if the property exists in class/data and get its definition. $propDef = $this->_getPropertyDefinition($propName); // Throws. // Map the value to the appropriate type and validate it. ValueConverter:...
[ "final", "protected", "function", "_setProperty", "(", "$", "propName", ",", "$", "value", ")", "{", "// Check if the property exists in class/data and get its definition.", "$", "propDef", "=", "$", "this", "->", "_getPropertyDefinition", "(", "$", "propName", ")", "...
Set an object data property to a new value. @param string $propName The property name. @param mixed $value The new value for the property. `NULL` is always allowed as the new value, regardless of type. @throws LazyJsonMapperException If the new value isn't legal for that property, or if the property doesn't exist...
[ "Set", "an", "object", "data", "property", "to", "a", "new", "value", "." ]
51e093b50f4de15d2d64548b3ca743713eed6ee9
https://github.com/lazyjsonmapper/lazyjsonmapper/blob/51e093b50f4de15d2d64548b3ca743713eed6ee9/src/LazyJsonMapper.php#L2003-L2020
189,256
lazyjsonmapper/lazyjsonmapper
src/LazyJsonMapper.php
LazyJsonMapper.serialize
final public function serialize() { // Tell all of our LJM-properties to pack themselves as plain arrays. // NOTE: We don't do any value-conversion or validation of properties, // since that's not our job. The user wants to SERIALIZE our data, so // translation of array entries to "c...
php
final public function serialize() { // Tell all of our LJM-properties to pack themselves as plain arrays. // NOTE: We don't do any value-conversion or validation of properties, // since that's not our job. The user wants to SERIALIZE our data, so // translation of array entries to "c...
[ "final", "public", "function", "serialize", "(", ")", "{", "// Tell all of our LJM-properties to pack themselves as plain arrays.", "// NOTE: We don't do any value-conversion or validation of properties,", "// since that's not our job. The user wants to SERIALIZE our data, so", "// translation o...
Called during serialization of the object. You are not supposed to call this directly. Instead, use PHP's global `serialize()` call: ```php $savedStr = serialize($obj); ``` This serializer is thin and efficient. It simply recursively packs all nested, internal `LazyJsonMapper` objects as a single, plain data array, ...
[ "Called", "during", "serialization", "of", "the", "object", "." ]
51e093b50f4de15d2d64548b3ca743713eed6ee9
https://github.com/lazyjsonmapper/lazyjsonmapper/blob/51e093b50f4de15d2d64548b3ca743713eed6ee9/src/LazyJsonMapper.php#L2482-L2533
189,257
lazyjsonmapper/lazyjsonmapper
src/LazyJsonMapper.php
LazyJsonMapper.unserialize
final public function unserialize( $serialized = null) { $objectData = null; try { // Attempt to unpack the serialized data. Do not @suppress any // syntax errors, since the user needs to know if they've provided // a bad serialized string (or even a non-...
php
final public function unserialize( $serialized = null) { $objectData = null; try { // Attempt to unpack the serialized data. Do not @suppress any // syntax errors, since the user needs to know if they've provided // a bad serialized string (or even a non-...
[ "final", "public", "function", "unserialize", "(", "$", "serialized", "=", "null", ")", "{", "$", "objectData", "=", "null", ";", "try", "{", "// Attempt to unpack the serialized data. Do not @suppress any", "// syntax errors, since the user needs to know if they've provided", ...
Called during unserialization of the object. You are not supposed to call this directly. Instead, use PHP's global `unserialize()` call: ```php $restoredObj = unserialize($savedStr); ``` This unserializer is thin and efficient. It simply unpacks the serialized raw data array and uses it as the new object's data, wit...
[ "Called", "during", "unserialization", "of", "the", "object", "." ]
51e093b50f4de15d2d64548b3ca743713eed6ee9
https://github.com/lazyjsonmapper/lazyjsonmapper/blob/51e093b50f4de15d2d64548b3ca743713eed6ee9/src/LazyJsonMapper.php#L2583-L2620
189,258
lazyjsonmapper/lazyjsonmapper
src/Magic/PropertyTranslation.php
PropertyTranslation._propToFunctionCase
protected function _propToFunctionCase( $propName) { // To translate a property name to FunctionCase, we must simply convert // any leading lowercase (a-z) character to uppercase, as well as any // (a-z) that comes after an underscore. In the latter case, the // underscore mu...
php
protected function _propToFunctionCase( $propName) { // To translate a property name to FunctionCase, we must simply convert // any leading lowercase (a-z) character to uppercase, as well as any // (a-z) that comes after an underscore. In the latter case, the // underscore mu...
[ "protected", "function", "_propToFunctionCase", "(", "$", "propName", ")", "{", "// To translate a property name to FunctionCase, we must simply convert", "// any leading lowercase (a-z) character to uppercase, as well as any", "// (a-z) that comes after an underscore. In the latter case, the", ...
Converts a property name to FunctionCase. See input/output examples in class documentation above. @param string $propName The property name, as either `snake_case` or `camelCase`. The translations will differ based on which style is used. (That's intentional.) @return string
[ "Converts", "a", "property", "name", "to", "FunctionCase", "." ]
51e093b50f4de15d2d64548b3ca743713eed6ee9
https://github.com/lazyjsonmapper/lazyjsonmapper/blob/51e093b50f4de15d2d64548b3ca743713eed6ee9/src/Magic/PropertyTranslation.php#L125-L190
189,259
lazyjsonmapper/lazyjsonmapper
src/Magic/SpecialOperators.php
SpecialOperators.encodeOperators
public static function encodeOperators( $str) { if (self::$_translations === null) { self::_buildTranslations(); } return strtr($str, self::$_translations['encode']); }
php
public static function encodeOperators( $str) { if (self::$_translations === null) { self::_buildTranslations(); } return strtr($str, self::$_translations['encode']); }
[ "public", "static", "function", "encodeOperators", "(", "$", "str", ")", "{", "if", "(", "self", "::", "$", "_translations", "===", "null", ")", "{", "self", "::", "_buildTranslations", "(", ")", ";", "}", "return", "strtr", "(", "$", "str", ",", "self...
Encode special operators. @param string $str Input string. @return string Output string.
[ "Encode", "special", "operators", "." ]
51e093b50f4de15d2d64548b3ca743713eed6ee9
https://github.com/lazyjsonmapper/lazyjsonmapper/blob/51e093b50f4de15d2d64548b3ca743713eed6ee9/src/Magic/SpecialOperators.php#L49-L57
189,260
lazyjsonmapper/lazyjsonmapper
src/Magic/SpecialOperators.php
SpecialOperators.decodeOperators
public static function decodeOperators( $str) { if (self::$_translations === null) { self::_buildTranslations(); } // NOTE: preg_replace_callback() was over 6x slower than strtr() here. return strtr($str, self::$_translations['decode']); }
php
public static function decodeOperators( $str) { if (self::$_translations === null) { self::_buildTranslations(); } // NOTE: preg_replace_callback() was over 6x slower than strtr() here. return strtr($str, self::$_translations['decode']); }
[ "public", "static", "function", "decodeOperators", "(", "$", "str", ")", "{", "if", "(", "self", "::", "$", "_translations", "===", "null", ")", "{", "self", "::", "_buildTranslations", "(", ")", ";", "}", "// NOTE: preg_replace_callback() was over 6x slower than ...
Decode special operators. @param string $str Input string. @return string Output string.
[ "Decode", "special", "operators", "." ]
51e093b50f4de15d2d64548b3ca743713eed6ee9
https://github.com/lazyjsonmapper/lazyjsonmapper/blob/51e093b50f4de15d2d64548b3ca743713eed6ee9/src/Magic/SpecialOperators.php#L66-L75
189,261
lazyjsonmapper/lazyjsonmapper
src/Magic/SpecialOperators.php
SpecialOperators._buildTranslations
private static function _buildTranslations() { // This operator list was based on the following lists: // http://php.net/manual/en/language.operators.precedence.php // http://php.net/manual/en/language.operators.execution.php // and general PHP code structures (`$` and `;` operators,...
php
private static function _buildTranslations() { // This operator list was based on the following lists: // http://php.net/manual/en/language.operators.precedence.php // http://php.net/manual/en/language.operators.execution.php // and general PHP code structures (`$` and `;` operators,...
[ "private", "static", "function", "_buildTranslations", "(", ")", "{", "// This operator list was based on the following lists:", "// http://php.net/manual/en/language.operators.precedence.php", "// http://php.net/manual/en/language.operators.execution.php", "// and general PHP code structures (`...
Build the table of special operator translations. PHP doesn't allow these special operators in function names, so we cannot legally generate such function names. Instead, we'll encode the operators with a sequence that will never appear in our normal algorithm's output. For example, if the user has a property named `...
[ "Build", "the", "table", "of", "special", "operator", "translations", "." ]
51e093b50f4de15d2d64548b3ca743713eed6ee9
https://github.com/lazyjsonmapper/lazyjsonmapper/blob/51e093b50f4de15d2d64548b3ca743713eed6ee9/src/Magic/SpecialOperators.php#L114-L168
189,262
lazyjsonmapper/lazyjsonmapper
src/Utilities.php
Utilities.createStrictClassPath
public static function createStrictClassPath( $className = '') { if (is_string($className) && strlen($className) > 0) { // Prepend "\" if missing, to force PHP to use the global namespace. if ($className[0] !== '\\') { $className = '\\'.$className; ...
php
public static function createStrictClassPath( $className = '') { if (is_string($className) && strlen($className) > 0) { // Prepend "\" if missing, to force PHP to use the global namespace. if ($className[0] !== '\\') { $className = '\\'.$className; ...
[ "public", "static", "function", "createStrictClassPath", "(", "$", "className", "=", "''", ")", "{", "if", "(", "is_string", "(", "$", "className", ")", "&&", "strlen", "(", "$", "className", ")", ">", "0", ")", "{", "// Prepend \"\\\" if missing, to force PHP...
Create a strict, global class path. This helper ensures that the input is a non-empty string, and then automatically prepends a leading `\` if missing, so that PHP understands that the class search MUST happen only in the global namespace. @param string $className The class name to convert. @return string|null Strin...
[ "Create", "a", "strict", "global", "class", "path", "." ]
51e093b50f4de15d2d64548b3ca743713eed6ee9
https://github.com/lazyjsonmapper/lazyjsonmapper/blob/51e093b50f4de15d2d64548b3ca743713eed6ee9/src/Utilities.php#L40-L53
189,263
lazyjsonmapper/lazyjsonmapper
src/Utilities.php
Utilities.splitStrictClassPath
public static function splitStrictClassPath( $strictClassPath = '') { // Split on the rightmost backslash. In a strict path there's always at // least one backslash, for the leading "global namespace" backslash. $lastDelimPos = strrpos($strictClassPath, '\\'); // Global: "". ...
php
public static function splitStrictClassPath( $strictClassPath = '') { // Split on the rightmost backslash. In a strict path there's always at // least one backslash, for the leading "global namespace" backslash. $lastDelimPos = strrpos($strictClassPath, '\\'); // Global: "". ...
[ "public", "static", "function", "splitStrictClassPath", "(", "$", "strictClassPath", "=", "''", ")", "{", "// Split on the rightmost backslash. In a strict path there's always at", "// least one backslash, for the leading \"global namespace\" backslash.", "$", "lastDelimPos", "=", "s...
Splits a strict class-path into its namespace and class name components. To rejoin them later, just use: `'namespace' + '\\' + 'class'`. The class path should be in `get_class()` aka `TheClass::class` format. @param string $strictClassPath Class output of `createStrictClassPath()`. @return array Associative array w...
[ "Splits", "a", "strict", "class", "-", "path", "into", "its", "namespace", "and", "class", "name", "components", "." ]
51e093b50f4de15d2d64548b3ca743713eed6ee9
https://github.com/lazyjsonmapper/lazyjsonmapper/blob/51e093b50f4de15d2d64548b3ca743713eed6ee9/src/Utilities.php#L68-L83
189,264
lazyjsonmapper/lazyjsonmapper
src/Utilities.php
Utilities.createRelativeClassPath
public static function createRelativeClassPath( array $sourceComponents, array $targetComponents) { $sourceNs = &$sourceComponents['namespace']; $targetNs = &$targetComponents['namespace']; $finalType = null; // If either the source or the target lives in the global ...
php
public static function createRelativeClassPath( array $sourceComponents, array $targetComponents) { $sourceNs = &$sourceComponents['namespace']; $targetNs = &$targetComponents['namespace']; $finalType = null; // If either the source or the target lives in the global ...
[ "public", "static", "function", "createRelativeClassPath", "(", "array", "$", "sourceComponents", ",", "array", "$", "targetComponents", ")", "{", "$", "sourceNs", "=", "&", "$", "sourceComponents", "[", "'namespace'", "]", ";", "$", "targetNs", "=", "&", "$",...
Compare two class paths and generate the shortest path between them. @param array $sourceComponents Source class as `splitStrictClassPath()`. @param array $targetComponents Target class as `splitStrictClassPath()`. @return string The final path to reach from the source to the target. @see Utilities::splitStrictClass...
[ "Compare", "two", "class", "paths", "and", "generate", "the", "shortest", "path", "between", "them", "." ]
51e093b50f4de15d2d64548b3ca743713eed6ee9
https://github.com/lazyjsonmapper/lazyjsonmapper/blob/51e093b50f4de15d2d64548b3ca743713eed6ee9/src/Utilities.php#L95-L136
189,265
lazyjsonmapper/lazyjsonmapper
src/Utilities.php
Utilities.atomicWrite
public static function atomicWrite( $filename, $data, $atomicSuffix = 'atomictmp') { // Perform an exclusive (locked) overwrite to a temporary file. $filenameTmp = sprintf('%s.%s', $filename, $atomicSuffix); $writeResult = @file_put_contents($filenameTmp, $data, LOCK_...
php
public static function atomicWrite( $filename, $data, $atomicSuffix = 'atomictmp') { // Perform an exclusive (locked) overwrite to a temporary file. $filenameTmp = sprintf('%s.%s', $filename, $atomicSuffix); $writeResult = @file_put_contents($filenameTmp, $data, LOCK_...
[ "public", "static", "function", "atomicWrite", "(", "$", "filename", ",", "$", "data", ",", "$", "atomicSuffix", "=", "'atomictmp'", ")", "{", "// Perform an exclusive (locked) overwrite to a temporary file.", "$", "filenameTmp", "=", "sprintf", "(", "'%s.%s'", ",", ...
Atomic filewriter. Safely writes new contents to a file using an atomic two-step process. If the script is killed before the write is complete, only the temporary trash file will be corrupted. The algorithm also ensures that 100% of the bytes were written to disk. @param string $filename Filename to write the da...
[ "Atomic", "filewriter", "." ]
51e093b50f4de15d2d64548b3ca743713eed6ee9
https://github.com/lazyjsonmapper/lazyjsonmapper/blob/51e093b50f4de15d2d64548b3ca743713eed6ee9/src/Utilities.php#L154-L179
189,266
lazyjsonmapper/lazyjsonmapper
src/Property/PropertyDefinition.php
PropertyDefinition.asString
public function asString() { return sprintf( '%s%s%s', $this->isObjectType ? '\\' : '', $this->propType !== null ? $this->propType : 'mixed', str_repeat('[]', $this->arrayDepth) ); }
php
public function asString() { return sprintf( '%s%s%s', $this->isObjectType ? '\\' : '', $this->propType !== null ? $this->propType : 'mixed', str_repeat('[]', $this->arrayDepth) ); }
[ "public", "function", "asString", "(", ")", "{", "return", "sprintf", "(", "'%s%s%s'", ",", "$", "this", "->", "isObjectType", "?", "'\\\\'", ":", "''", ",", "$", "this", "->", "propType", "!==", "null", "?", "$", "this", "->", "propType", ":", "'mixed...
Get the property definition as its string representation. The string perfectly represents the property definition, and can therefore even be used when constructing other object instances. @return string
[ "Get", "the", "property", "definition", "as", "its", "string", "representation", "." ]
51e093b50f4de15d2d64548b3ca743713eed6ee9
https://github.com/lazyjsonmapper/lazyjsonmapper/blob/51e093b50f4de15d2d64548b3ca743713eed6ee9/src/Property/PropertyDefinition.php#L306-L314
189,267
maxirus/fedex-tracking-api-wrapper
src/FedEx.php
FedEx.setVersion
public function setVersion($service_id, $major, $intermediate, $minor) { $this->service_id = $service_id; $this->major = $major; $this->intermediate = $intermediate; $this->minor = $minor; }
php
public function setVersion($service_id, $major, $intermediate, $minor) { $this->service_id = $service_id; $this->major = $major; $this->intermediate = $intermediate; $this->minor = $minor; }
[ "public", "function", "setVersion", "(", "$", "service_id", ",", "$", "major", ",", "$", "intermediate", ",", "$", "minor", ")", "{", "$", "this", "->", "service_id", "=", "$", "service_id", ";", "$", "this", "->", "major", "=", "$", "major", ";", "$...
Sets the API service to be used and the version information. @param string // Service to use, ie. "trck" @param int // Major version to use, ie. 9 @param int // Intermediate version to use, ie. 1 @param int // Minor version to use, ie. 0
[ "Sets", "the", "API", "service", "to", "be", "used", "and", "the", "version", "information", "." ]
20e7536447c9b28f1ddb909dcf8c8d5f1393892c
https://github.com/maxirus/fedex-tracking-api-wrapper/blob/20e7536447c9b28f1ddb909dcf8c8d5f1393892c/src/FedEx.php#L95-L100
189,268
maxirus/fedex-tracking-api-wrapper
src/FedEx.php
FedEx.buildRequest
public function buildRequest($addReq = null) { // Build Authentication $this->request['WebAuthenticationDetail'] = array( 'UserCredential'=> array( 'Key' => $this->key, 'Password' => $this->password ) ); //Build Client Detail $this->request['ClientDetail'] = array( 'AccountNumber' =...
php
public function buildRequest($addReq = null) { // Build Authentication $this->request['WebAuthenticationDetail'] = array( 'UserCredential'=> array( 'Key' => $this->key, 'Password' => $this->password ) ); //Build Client Detail $this->request['ClientDetail'] = array( 'AccountNumber' =...
[ "public", "function", "buildRequest", "(", "$", "addReq", "=", "null", ")", "{", "// Build Authentication", "$", "this", "->", "request", "[", "'WebAuthenticationDetail'", "]", "=", "array", "(", "'UserCredential'", "=>", "array", "(", "'Key'", "=>", "$", "thi...
Builds and returns the basic request array to be sent with each request to the FedEx API. This assumes the setVersion method has already been called by an extended class. Takes an optional parameter, $addReq. This parameter is used to set the additonal request details. These details are determined by the particular se...
[ "Builds", "and", "returns", "the", "basic", "request", "array", "to", "be", "sent", "with", "each", "request", "to", "the", "FedEx", "API", ".", "This", "assumes", "the", "setVersion", "method", "has", "already", "been", "called", "by", "an", "extended", "...
20e7536447c9b28f1ddb909dcf8c8d5f1393892c
https://github.com/maxirus/fedex-tracking-api-wrapper/blob/20e7536447c9b28f1ddb909dcf8c8d5f1393892c/src/FedEx.php#L114-L149
189,269
lazyjsonmapper/lazyjsonmapper
examples/unpredictable_data.php
UnpredictableContainer.getUserList
public function getUserList() { // Tell LazyJsonMapper to give us all of our internal data as an array. // NOTE: This creates a COPY of the array. It's not attached to the main // storage, which means that any changes we make to the new array aren't // going to affect the actual Lazy...
php
public function getUserList() { // Tell LazyJsonMapper to give us all of our internal data as an array. // NOTE: This creates a COPY of the array. It's not attached to the main // storage, which means that any changes we make to the new array aren't // going to affect the actual Lazy...
[ "public", "function", "getUserList", "(", ")", "{", "// Tell LazyJsonMapper to give us all of our internal data as an array.", "// NOTE: This creates a COPY of the array. It's not attached to the main", "// storage, which means that any changes we make to the new array aren't", "// going to affect...
Get the list of users. @throws LazyJsonMapperException @return array Associative array of key-value pairs, keyed by userID.
[ "Get", "the", "list", "of", "users", "." ]
51e093b50f4de15d2d64548b3ca743713eed6ee9
https://github.com/lazyjsonmapper/lazyjsonmapper/blob/51e093b50f4de15d2d64548b3ca743713eed6ee9/examples/unpredictable_data.php#L61-L94
189,270
lazyjsonmapper/lazyjsonmapper
examples/unpredictable_data.php
UnpredictableContainerWithSetter.syncUserList
public function syncUserList() { // If no internal cache exists yet, get its value from LazyJsonMapper. if ($this->_userList === null) { $this->getUserList(); // Builds our "_userList" variable. Throws. } // Now, we need to create a new, internal LazyJsonMapper data arra...
php
public function syncUserList() { // If no internal cache exists yet, get its value from LazyJsonMapper. if ($this->_userList === null) { $this->getUserList(); // Builds our "_userList" variable. Throws. } // Now, we need to create a new, internal LazyJsonMapper data arra...
[ "public", "function", "syncUserList", "(", ")", "{", "// If no internal cache exists yet, get its value from LazyJsonMapper.", "if", "(", "$", "this", "->", "_userList", "===", "null", ")", "{", "$", "this", "->", "getUserList", "(", ")", ";", "// Builds our \"_userLi...
Syncs the user list cache with the LazyJsonMapper core storage. Note that we could build these steps into `setUserList()`. But by having it as a separate function, you are able to just update specific User objects and then call `syncUserList()` to write them back to the core. @throws LazyJsonMapperException
[ "Syncs", "the", "user", "list", "cache", "with", "the", "LazyJsonMapper", "core", "storage", "." ]
51e093b50f4de15d2d64548b3ca743713eed6ee9
https://github.com/lazyjsonmapper/lazyjsonmapper/blob/51e093b50f4de15d2d64548b3ca743713eed6ee9/examples/unpredictable_data.php#L208-L231
189,271
lazyjsonmapper/lazyjsonmapper
examples/unpredictable_data.php
UnpredictableMixtureContainer.getEmployees
public function getEmployees() { if ($this->_employees === null) { // Use the internal _getProperty() API to read the actual property. // NOTE: This function only throws if "employees" contains any // invalid non-basic data. Only basic PHP types are accepted. ...
php
public function getEmployees() { if ($this->_employees === null) { // Use the internal _getProperty() API to read the actual property. // NOTE: This function only throws if "employees" contains any // invalid non-basic data. Only basic PHP types are accepted. ...
[ "public", "function", "getEmployees", "(", ")", "{", "if", "(", "$", "this", "->", "_employees", "===", "null", ")", "{", "// Use the internal _getProperty() API to read the actual property.", "// NOTE: This function only throws if \"employees\" contains any", "// invalid non-bas...
Get the list of employees. NOTE: This overrides the normal, automatic LazyJsonMapper getter! By naming our function identically, we override its behavior! @throws LazyJsonMapperException @return array
[ "Get", "the", "list", "of", "employees", "." ]
51e093b50f4de15d2d64548b3ca743713eed6ee9
https://github.com/lazyjsonmapper/lazyjsonmapper/blob/51e093b50f4de15d2d64548b3ca743713eed6ee9/examples/unpredictable_data.php#L357-L373
189,272
lazyjsonmapper/lazyjsonmapper
examples/unpredictable_data.php
UnpredictableMixtureContainer.setEmployees
public function setEmployees( array $employees) { $this->_employees = $employees; // We now need to construct a new, inner value for the property. Since // it's a "mixed" property, it only accepts basic PHP types. $newInnerValue = []; foreach ($this->_employees as $k...
php
public function setEmployees( array $employees) { $this->_employees = $employees; // We now need to construct a new, inner value for the property. Since // it's a "mixed" property, it only accepts basic PHP types. $newInnerValue = []; foreach ($this->_employees as $k...
[ "public", "function", "setEmployees", "(", "array", "$", "employees", ")", "{", "$", "this", "->", "_employees", "=", "$", "employees", ";", "// We now need to construct a new, inner value for the property. Since", "// it's a \"mixed\" property, it only accepts basic PHP types.",...
Set the list of employees. NOTE: This overrides the normal, automatic LazyJsonMapper setter! By naming our function identically, we override its behavior! @param array $employees @throws LazyJsonMapperException @return $this
[ "Set", "the", "list", "of", "employees", "." ]
51e093b50f4de15d2d64548b3ca743713eed6ee9
https://github.com/lazyjsonmapper/lazyjsonmapper/blob/51e093b50f4de15d2d64548b3ca743713eed6ee9/examples/unpredictable_data.php#L387-L407
189,273
lazyjsonmapper/lazyjsonmapper
examples/unpredictable_data.php
CoreUnpredictableContainer.getData
public function getData() { if ($this->_cache === null) { $this->_cache = $this->asArray(); // Throws. } if ($this->_type !== null) { foreach ($this->_cache as &$value) { if (is_array($value)) { $value = new $this->_type($value); /...
php
public function getData() { if ($this->_cache === null) { $this->_cache = $this->asArray(); // Throws. } if ($this->_type !== null) { foreach ($this->_cache as &$value) { if (is_array($value)) { $value = new $this->_type($value); /...
[ "public", "function", "getData", "(", ")", "{", "if", "(", "$", "this", "->", "_cache", "===", "null", ")", "{", "$", "this", "->", "_cache", "=", "$", "this", "->", "asArray", "(", ")", ";", "// Throws.", "}", "if", "(", "$", "this", "->", "_typ...
Get the data array of this unpredictable container. @throws LazyJsonMapperException @return array
[ "Get", "the", "data", "array", "of", "this", "unpredictable", "container", "." ]
51e093b50f4de15d2d64548b3ca743713eed6ee9
https://github.com/lazyjsonmapper/lazyjsonmapper/blob/51e093b50f4de15d2d64548b3ca743713eed6ee9/examples/unpredictable_data.php#L537-L552
189,274
lazyjsonmapper/lazyjsonmapper
examples/unpredictable_data.php
CoreUnpredictableContainer.setData
public function setData( array $value) { $this->_cache = $value; $newObjectData = []; foreach ($this->_cache as $k => $v) { $newObjectData[$k] = is_object($v) && $v instanceof LazyJsonMapper ? $v->asArray() // Throws. ...
php
public function setData( array $value) { $this->_cache = $value; $newObjectData = []; foreach ($this->_cache as $k => $v) { $newObjectData[$k] = is_object($v) && $v instanceof LazyJsonMapper ? $v->asArray() // Throws. ...
[ "public", "function", "setData", "(", "array", "$", "value", ")", "{", "$", "this", "->", "_cache", "=", "$", "value", ";", "$", "newObjectData", "=", "[", "]", ";", "foreach", "(", "$", "this", "->", "_cache", "as", "$", "k", "=>", "$", "v", ")"...
Set the data array of this unpredictable container. @param array $value The new data array. @throws LazyJsonMapperException @return $this
[ "Set", "the", "data", "array", "of", "this", "unpredictable", "container", "." ]
51e093b50f4de15d2d64548b3ca743713eed6ee9
https://github.com/lazyjsonmapper/lazyjsonmapper/blob/51e093b50f4de15d2d64548b3ca743713eed6ee9/examples/unpredictable_data.php#L563-L578
189,275
lazyjsonmapper/lazyjsonmapper
src/Export/ClassAnalysis.php
ClassAnalysis.mergeAnalysis
public function mergeAnalysis( ClassAnalysis $other) { $this->bad_definitions = array_merge_recursive( $this->bad_definitions, $other->bad_definitions ); $this->missing_definitions = array_merge_recursive( $this->missing_definitions, $o...
php
public function mergeAnalysis( ClassAnalysis $other) { $this->bad_definitions = array_merge_recursive( $this->bad_definitions, $other->bad_definitions ); $this->missing_definitions = array_merge_recursive( $this->missing_definitions, $o...
[ "public", "function", "mergeAnalysis", "(", "ClassAnalysis", "$", "other", ")", "{", "$", "this", "->", "bad_definitions", "=", "array_merge_recursive", "(", "$", "this", "->", "bad_definitions", ",", "$", "other", "->", "bad_definitions", ")", ";", "$", "this...
Merge another ClassAnalysis object's result into this instance. @param ClassAnalysis $other The other object instance.
[ "Merge", "another", "ClassAnalysis", "object", "s", "result", "into", "this", "instance", "." ]
51e093b50f4de15d2d64548b3ca743713eed6ee9
https://github.com/lazyjsonmapper/lazyjsonmapper/blob/51e093b50f4de15d2d64548b3ca743713eed6ee9/src/Export/ClassAnalysis.php#L67-L78
189,276
lazyjsonmapper/lazyjsonmapper
src/Export/ClassAnalysis.php
ClassAnalysis.addProblem
public function addProblem( $definitionSource, $problemType, $problemMessage) { if (!is_string($definitionSource) || !is_string($problemMessage)) { throw new LazyJsonMapperException('The definitionSource and problemMessage parameters must be strings.'); } ...
php
public function addProblem( $definitionSource, $problemType, $problemMessage) { if (!is_string($definitionSource) || !is_string($problemMessage)) { throw new LazyJsonMapperException('The definitionSource and problemMessage parameters must be strings.'); } ...
[ "public", "function", "addProblem", "(", "$", "definitionSource", ",", "$", "problemType", ",", "$", "problemMessage", ")", "{", "if", "(", "!", "is_string", "(", "$", "definitionSource", ")", "||", "!", "is_string", "(", "$", "problemMessage", ")", ")", "...
Adds a problem description to the internal state. @param string $definitionSource The class which has the problem. @param string $problemType Type of problem. Either `bad_definitions` or `missing_definitions`. @param string $problemMessage A message describing the actual problem. @throws LazyJsonMapperExceptio...
[ "Adds", "a", "problem", "description", "to", "the", "internal", "state", "." ]
51e093b50f4de15d2d64548b3ca743713eed6ee9
https://github.com/lazyjsonmapper/lazyjsonmapper/blob/51e093b50f4de15d2d64548b3ca743713eed6ee9/src/Export/ClassAnalysis.php#L92-L109
189,277
lazyjsonmapper/lazyjsonmapper
src/Export/ClassAnalysis.php
ClassAnalysis.generateNiceSummaries
public function generateNiceSummaries() { $problemSummaries = []; if (!empty($this->bad_definitions)) { // Build a nice string containing all encountered bad definitions. $strSubChunks = []; foreach ($this->bad_definitions as $className => $messages) { ...
php
public function generateNiceSummaries() { $problemSummaries = []; if (!empty($this->bad_definitions)) { // Build a nice string containing all encountered bad definitions. $strSubChunks = []; foreach ($this->bad_definitions as $className => $messages) { ...
[ "public", "function", "generateNiceSummaries", "(", ")", "{", "$", "problemSummaries", "=", "[", "]", ";", "if", "(", "!", "empty", "(", "$", "this", "->", "bad_definitions", ")", ")", "{", "// Build a nice string containing all encountered bad definitions.", "$", ...
Generates nicely formatted problem summaries for this class analysis. @return array An array with formatted messages for every type of analysis which actually had errors, keyed by the problem type. If no errors, the returned array will be empty. @see ClassAnalysis::hasProblems() @see ClassAnalysis::generateNiceSummar...
[ "Generates", "nicely", "formatted", "problem", "summaries", "for", "this", "class", "analysis", "." ]
51e093b50f4de15d2d64548b3ca743713eed6ee9
https://github.com/lazyjsonmapper/lazyjsonmapper/blob/51e093b50f4de15d2d64548b3ca743713eed6ee9/src/Export/ClassAnalysis.php#L157-L190
189,278
adbario/slim-secure-session-middleware
src/Session.php
Session.setTo
public function setTo($namespace, $key, $value = null) { $oldNamespace = $this->namespace; $this->setNamespace($namespace); $this->set($key, $value); $this->setNamespace($oldNamespace); }
php
public function setTo($namespace, $key, $value = null) { $oldNamespace = $this->namespace; $this->setNamespace($namespace); $this->set($key, $value); $this->setNamespace($oldNamespace); }
[ "public", "function", "setTo", "(", "$", "namespace", ",", "$", "key", ",", "$", "value", "=", "null", ")", "{", "$", "oldNamespace", "=", "$", "this", "->", "namespace", ";", "$", "this", "->", "setNamespace", "(", "$", "namespace", ")", ";", "$", ...
Set session value or array of values to specific namespace @param string $namespace Session namespace @param mixed $key Session key or an array of keys and values @param mixed|null $value Session value to set if key is not an array
[ "Set", "session", "value", "or", "array", "of", "values", "to", "specific", "namespace" ]
f107191506b2c362f06f201f998891f315d6aaec
https://github.com/adbario/slim-secure-session-middleware/blob/f107191506b2c362f06f201f998891f315d6aaec/src/Session.php#L72-L78
189,279
adbario/slim-secure-session-middleware
src/Session.php
Session.addTo
public function addTo($namespace, $key, $value = null) { $oldNamespace = $this->namespace; $this->setNamespace($namespace); $this->add($key, $value); $this->setNamespace($oldNamespace); }
php
public function addTo($namespace, $key, $value = null) { $oldNamespace = $this->namespace; $this->setNamespace($namespace); $this->add($key, $value); $this->setNamespace($oldNamespace); }
[ "public", "function", "addTo", "(", "$", "namespace", ",", "$", "key", ",", "$", "value", "=", "null", ")", "{", "$", "oldNamespace", "=", "$", "this", "->", "namespace", ";", "$", "this", "->", "setNamespace", "(", "$", "namespace", ")", ";", "$", ...
Add session value or array of values to specific namespace @param string $namespace Session namespace @param mixed $key Session key or an array of keys and values @param mixed|null $value Session value to add if key is not an array
[ "Add", "session", "value", "or", "array", "of", "values", "to", "specific", "namespace" ]
f107191506b2c362f06f201f998891f315d6aaec
https://github.com/adbario/slim-secure-session-middleware/blob/f107191506b2c362f06f201f998891f315d6aaec/src/Session.php#L87-L93
189,280
adbario/slim-secure-session-middleware
src/Session.php
Session.getFrom
public function getFrom($namespace, $key = null, $default = null) { if (isset($_SESSION[$namespace])) { $oldNamespace = $this->namespace; $this->setNamespace($namespace); $result = $this->get($key, $default); $this->setNamespace($oldNamespace); re...
php
public function getFrom($namespace, $key = null, $default = null) { if (isset($_SESSION[$namespace])) { $oldNamespace = $this->namespace; $this->setNamespace($namespace); $result = $this->get($key, $default); $this->setNamespace($oldNamespace); re...
[ "public", "function", "getFrom", "(", "$", "namespace", ",", "$", "key", "=", "null", ",", "$", "default", "=", "null", ")", "{", "if", "(", "isset", "(", "$", "_SESSION", "[", "$", "namespace", "]", ")", ")", "{", "$", "oldNamespace", "=", "$", ...
Get session value from specific namespace @param string $namespace Session namespace @param mixed|null $key Session key @param mixed|null $default Default value @return mixed
[ "Get", "session", "value", "from", "specific", "namespace" ]
f107191506b2c362f06f201f998891f315d6aaec
https://github.com/adbario/slim-secure-session-middleware/blob/f107191506b2c362f06f201f998891f315d6aaec/src/Session.php#L103-L114
189,281
adbario/slim-secure-session-middleware
src/Session.php
Session.hasIn
public function hasIn($namespace, $key) { if (isset($_SESSION[$namespace])) { $oldNamespace = $this->namespace; $this->setNamespace($namespace); $result = $this->has($key); $this->setNamespace($oldNamespace); return $result; } }
php
public function hasIn($namespace, $key) { if (isset($_SESSION[$namespace])) { $oldNamespace = $this->namespace; $this->setNamespace($namespace); $result = $this->has($key); $this->setNamespace($oldNamespace); return $result; } }
[ "public", "function", "hasIn", "(", "$", "namespace", ",", "$", "key", ")", "{", "if", "(", "isset", "(", "$", "_SESSION", "[", "$", "namespace", "]", ")", ")", "{", "$", "oldNamespace", "=", "$", "this", "->", "namespace", ";", "$", "this", "->", ...
Check if session value is set in specific namespace @param string $namespace Session namespace @param string $key Session key @return bool
[ "Check", "if", "session", "value", "is", "set", "in", "specific", "namespace" ]
f107191506b2c362f06f201f998891f315d6aaec
https://github.com/adbario/slim-secure-session-middleware/blob/f107191506b2c362f06f201f998891f315d6aaec/src/Session.php#L123-L133
189,282
adbario/slim-secure-session-middleware
src/Session.php
Session.deleteFrom
public function deleteFrom($namespace, $key) { if (isset($_SESSION[$namespace])) { $oldNamespace = $this->namespace; $this->setNamespace($namespace); $this->delete($key); $this->setNamespace($oldNamespace); } }
php
public function deleteFrom($namespace, $key) { if (isset($_SESSION[$namespace])) { $oldNamespace = $this->namespace; $this->setNamespace($namespace); $this->delete($key); $this->setNamespace($oldNamespace); } }
[ "public", "function", "deleteFrom", "(", "$", "namespace", ",", "$", "key", ")", "{", "if", "(", "isset", "(", "$", "_SESSION", "[", "$", "namespace", "]", ")", ")", "{", "$", "oldNamespace", "=", "$", "this", "->", "namespace", ";", "$", "this", "...
Delete session key or array of keys from specific namespace @param string $namespace Session namespace @param mixed $key Session key or array of keys
[ "Delete", "session", "key", "or", "array", "of", "keys", "from", "specific", "namespace" ]
f107191506b2c362f06f201f998891f315d6aaec
https://github.com/adbario/slim-secure-session-middleware/blob/f107191506b2c362f06f201f998891f315d6aaec/src/Session.php#L141-L149
189,283
adbario/slim-secure-session-middleware
src/Session.php
Session.clearFrom
public function clearFrom($namespace, $key = null) { $oldNamespace = $this->namespace; $this->setNamespace($namespace); $this->clear($key); $this->setNamespace($oldNamespace); }
php
public function clearFrom($namespace, $key = null) { $oldNamespace = $this->namespace; $this->setNamespace($namespace); $this->clear($key); $this->setNamespace($oldNamespace); }
[ "public", "function", "clearFrom", "(", "$", "namespace", ",", "$", "key", "=", "null", ")", "{", "$", "oldNamespace", "=", "$", "this", "->", "namespace", ";", "$", "this", "->", "setNamespace", "(", "$", "namespace", ")", ";", "$", "this", "->", "c...
Delete all session values from specific namespace @param string $namespace Session namespace @param mixed|null $key Session key or array of keys
[ "Delete", "all", "session", "values", "from", "specific", "namespace" ]
f107191506b2c362f06f201f998891f315d6aaec
https://github.com/adbario/slim-secure-session-middleware/blob/f107191506b2c362f06f201f998891f315d6aaec/src/Session.php#L157-L163
189,284
lazyjsonmapper/lazyjsonmapper
devtools/checkStyle.php
styleChecker._processFile
private function _processFile( $filePath) { $hasProblems = false; $hasVisibilityProblems = false; $fileName = basename($filePath); $inputLines = @file($filePath); $outputLines = []; if ($inputLines === false) { // We were unable to read the input ...
php
private function _processFile( $filePath) { $hasProblems = false; $hasVisibilityProblems = false; $fileName = basename($filePath); $inputLines = @file($filePath); $outputLines = []; if ($inputLines === false) { // We were unable to read the input ...
[ "private", "function", "_processFile", "(", "$", "filePath", ")", "{", "$", "hasProblems", "=", "false", ";", "$", "hasVisibilityProblems", "=", "false", ";", "$", "fileName", "=", "basename", "(", "$", "filePath", ")", ";", "$", "inputLines", "=", "@", ...
Process single file. @param string $filePath @return bool TRUE if the file has codestyle problems, otherwise FALSE.
[ "Process", "single", "file", "." ]
51e093b50f4de15d2d64548b3ca743713eed6ee9
https://github.com/lazyjsonmapper/lazyjsonmapper/blob/51e093b50f4de15d2d64548b3ca743713eed6ee9/devtools/checkStyle.php#L110-L200
189,285
maxirus/fedex-tracking-api-wrapper
src/TrackService/Track.php
Track.getByTrackingId
public function getByTrackingId($id) { // Request syntax needed to track by tracking id $this->request['SelectionDetails'] = array( 'PackageIdentifier' => array( 'Type' => 'TRACKING_NUMBER_OR_DOORTAG', 'Value' => $id // Tracking ID to track ) ); $req = $this->buildRequest($this->request)...
php
public function getByTrackingId($id) { // Request syntax needed to track by tracking id $this->request['SelectionDetails'] = array( 'PackageIdentifier' => array( 'Type' => 'TRACKING_NUMBER_OR_DOORTAG', 'Value' => $id // Tracking ID to track ) ); $req = $this->buildRequest($this->request)...
[ "public", "function", "getByTrackingId", "(", "$", "id", ")", "{", "// Request syntax needed to track by tracking id", "$", "this", "->", "request", "[", "'SelectionDetails'", "]", "=", "array", "(", "'PackageIdentifier'", "=>", "array", "(", "'Type'", "=>", "'TRACK...
Gets the tracking detials for the given tracking number and returns the FedEx request as an object. @param string // Tracking # @return SoapClient Object
[ "Gets", "the", "tracking", "detials", "for", "the", "given", "tracking", "number", "and", "returns", "the", "FedEx", "request", "as", "an", "object", "." ]
20e7536447c9b28f1ddb909dcf8c8d5f1393892c
https://github.com/maxirus/fedex-tracking-api-wrapper/blob/20e7536447c9b28f1ddb909dcf8c8d5f1393892c/src/TrackService/Track.php#L42-L55
189,286
efficiently/larasset
src/Efficiently/Larasset/Asset.php
Asset.javascriptIncludeTag
public function javascriptIncludeTag($sources = "application", $attributes = []) { // E.g. javascript_include_tag('app'); => app-9fcd9b50e5cb047af35d3c5a4b55f73f.js $args = func_get_args(); if (is_array(last($args))) { $attributes = array_pop($args); } else { ...
php
public function javascriptIncludeTag($sources = "application", $attributes = []) { // E.g. javascript_include_tag('app'); => app-9fcd9b50e5cb047af35d3c5a4b55f73f.js $args = func_get_args(); if (is_array(last($args))) { $attributes = array_pop($args); } else { ...
[ "public", "function", "javascriptIncludeTag", "(", "$", "sources", "=", "\"application\"", ",", "$", "attributes", "=", "[", "]", ")", "{", "// E.g. javascript_include_tag('app'); => app-9fcd9b50e5cb047af35d3c5a4b55f73f.js", "$", "args", "=", "func_get_args", "(", ")", ...
Returns an HTML script tag for the sources and attributes specified as arguments. @param array|string $sources default "application" @param array $attributes HTML attributes @return string
[ "Returns", "an", "HTML", "script", "tag", "for", "the", "sources", "and", "attributes", "specified", "as", "arguments", "." ]
1c95efb059f0c9b9868b8898e330822aec1f8f7e
https://github.com/efficiently/larasset/blob/1c95efb059f0c9b9868b8898e330822aec1f8f7e/src/Efficiently/Larasset/Asset.php#L61-L87
189,287
efficiently/larasset
src/Efficiently/Larasset/Asset.php
Asset.stylesheetLinkTag
public function stylesheetLinkTag($sources = "application", $attributes = []) { // E.g. stylesheet_link_tag('app', ['media'=>'all']); => app-fa2ce4b45369a106436f229ca9e52bee.css $args = func_get_args(); if (is_array(last($args))) { $attributes = array_pop($args); } else {...
php
public function stylesheetLinkTag($sources = "application", $attributes = []) { // E.g. stylesheet_link_tag('app', ['media'=>'all']); => app-fa2ce4b45369a106436f229ca9e52bee.css $args = func_get_args(); if (is_array(last($args))) { $attributes = array_pop($args); } else {...
[ "public", "function", "stylesheetLinkTag", "(", "$", "sources", "=", "\"application\"", ",", "$", "attributes", "=", "[", "]", ")", "{", "// E.g. stylesheet_link_tag('app', ['media'=>'all']); => app-fa2ce4b45369a106436f229ca9e52bee.css", "$", "args", "=", "func_get_args", "...
Returns a HTML stylesheet link tag for the sources and attributes specified as arguments. @param array|string $sources default "application" @param array $attributes HTML attributes @return string
[ "Returns", "a", "HTML", "stylesheet", "link", "tag", "for", "the", "sources", "and", "attributes", "specified", "as", "arguments", "." ]
1c95efb059f0c9b9868b8898e330822aec1f8f7e
https://github.com/efficiently/larasset/blob/1c95efb059f0c9b9868b8898e330822aec1f8f7e/src/Efficiently/Larasset/Asset.php#L96-L122
189,288
efficiently/larasset
src/Efficiently/Larasset/Asset.php
Asset.faviconLinkTag
public function faviconLinkTag($source = null, $attributes = []) { // E.g. favicon_link_tag('favicon.ico', ['rel' => 'shortcut icon']); => // <link href='http://localhost/assets/favicon.ico' rel="shortcut icon" type="image/vnd.microsoft.icon"> $source = $source ?: "favicon.ico"; ...
php
public function faviconLinkTag($source = null, $attributes = []) { // E.g. favicon_link_tag('favicon.ico', ['rel' => 'shortcut icon']); => // <link href='http://localhost/assets/favicon.ico' rel="shortcut icon" type="image/vnd.microsoft.icon"> $source = $source ?: "favicon.ico"; ...
[ "public", "function", "faviconLinkTag", "(", "$", "source", "=", "null", ",", "$", "attributes", "=", "[", "]", ")", "{", "// E.g. favicon_link_tag('favicon.ico', ['rel' => 'shortcut icon']); =>", "// <link href='http://localhost/assets/favicon.ico' rel=\"shortcut icon\" type=...
Returns a HTML favicon link tag for the source and attributes specified as arguments. @param string $source Relative URL @param array $attributes HTML attributes @return string
[ "Returns", "a", "HTML", "favicon", "link", "tag", "for", "the", "source", "and", "attributes", "specified", "as", "arguments", "." ]
1c95efb059f0c9b9868b8898e330822aec1f8f7e
https://github.com/efficiently/larasset/blob/1c95efb059f0c9b9868b8898e330822aec1f8f7e/src/Efficiently/Larasset/Asset.php#L131-L143
189,289
efficiently/larasset
src/Efficiently/Larasset/Asset.php
Asset.imageTag
public function imageTag($source, $alt = null, $attributes = []) { $assetsOptions = ['host' => array_pull($attributes, 'host', $this->assetsHost)]; // E.g. image_tag('logo.png', "My Logo"); => <img src="http://localhost/assets/logo-f2331bb588d007ba354e5fa406f9f4aa.png" alt="My Logo"> $alt =...
php
public function imageTag($source, $alt = null, $attributes = []) { $assetsOptions = ['host' => array_pull($attributes, 'host', $this->assetsHost)]; // E.g. image_tag('logo.png', "My Logo"); => <img src="http://localhost/assets/logo-f2331bb588d007ba354e5fa406f9f4aa.png" alt="My Logo"> $alt =...
[ "public", "function", "imageTag", "(", "$", "source", ",", "$", "alt", "=", "null", ",", "$", "attributes", "=", "[", "]", ")", "{", "$", "assetsOptions", "=", "[", "'host'", "=>", "array_pull", "(", "$", "attributes", ",", "'host'", ",", "$", "this"...
Returns an HTML image element for the source and attributes specified as arguments from the assets pipeline. @param string $source Relative URL @param string $alt @param array $attributes HTML attributes @return string
[ "Returns", "an", "HTML", "image", "element", "for", "the", "source", "and", "attributes", "specified", "as", "arguments", "from", "the", "assets", "pipeline", "." ]
1c95efb059f0c9b9868b8898e330822aec1f8f7e
https://github.com/efficiently/larasset/blob/1c95efb059f0c9b9868b8898e330822aec1f8f7e/src/Efficiently/Larasset/Asset.php#L153-L161
189,290
efficiently/larasset
src/Efficiently/Larasset/Asset.php
Asset.assetPath
public function assetPath($source, array $options = []) { $source = (string) $source; if (! $source) { return ""; // Short circuit } if (preg_match(static::URI_REGEXP, $source)) { return $source;// Short circuit } $assetPrefix = array_get($op...
php
public function assetPath($source, array $options = []) { $source = (string) $source; if (! $source) { return ""; // Short circuit } if (preg_match(static::URI_REGEXP, $source)) { return $source;// Short circuit } $assetPrefix = array_get($op...
[ "public", "function", "assetPath", "(", "$", "source", ",", "array", "$", "options", "=", "[", "]", ")", "{", "$", "source", "=", "(", "string", ")", "$", "source", ";", "if", "(", "!", "$", "source", ")", "{", "return", "\"\"", ";", "// Short circ...
Computes the path to asset in public directory. @param string $source @param array $options @return string
[ "Computes", "the", "path", "to", "asset", "in", "public", "directory", "." ]
1c95efb059f0c9b9868b8898e330822aec1f8f7e
https://github.com/efficiently/larasset/blob/1c95efb059f0c9b9868b8898e330822aec1f8f7e/src/Efficiently/Larasset/Asset.php#L170-L217
189,291
efficiently/larasset
src/Efficiently/Larasset/Commands/AssetsCommand.php
AssetsCommand.copyCommand
protected function copyCommand() { $sys = strtoupper(PHP_OS); if (substr($sys, 0, 3) == "WIN") { $copyCommand = "xcopy"; } elseif ($sys == "LINUX") { $copyCommand = "cp"; } else { $copyCommand = "cp"; // MacOS } return $copyComman...
php
protected function copyCommand() { $sys = strtoupper(PHP_OS); if (substr($sys, 0, 3) == "WIN") { $copyCommand = "xcopy"; } elseif ($sys == "LINUX") { $copyCommand = "cp"; } else { $copyCommand = "cp"; // MacOS } return $copyComman...
[ "protected", "function", "copyCommand", "(", ")", "{", "$", "sys", "=", "strtoupper", "(", "PHP_OS", ")", ";", "if", "(", "substr", "(", "$", "sys", ",", "0", ",", "3", ")", "==", "\"WIN\"", ")", "{", "$", "copyCommand", "=", "\"xcopy\"", ";", "}",...
Returns the copy comment specific to your OS @return string
[ "Returns", "the", "copy", "comment", "specific", "to", "your", "OS" ]
1c95efb059f0c9b9868b8898e330822aec1f8f7e
https://github.com/efficiently/larasset/blob/1c95efb059f0c9b9868b8898e330822aec1f8f7e/src/Efficiently/Larasset/Commands/AssetsCommand.php#L37-L50
189,292
adbario/slim-secure-session-middleware
src/SessionMiddleware.php
SessionMiddleware.start
protected function start(Request $request) { $settings = $this->settings; // Enable strict mode ini_set('session.use_strict_mode', 1); // Use cookies and only cookies to store session id ini_set('session.use_cookies', 1); ini_set('session.use_only_cookies', 1); ...
php
protected function start(Request $request) { $settings = $this->settings; // Enable strict mode ini_set('session.use_strict_mode', 1); // Use cookies and only cookies to store session id ini_set('session.use_cookies', 1); ini_set('session.use_only_cookies', 1); ...
[ "protected", "function", "start", "(", "Request", "$", "request", ")", "{", "$", "settings", "=", "$", "this", "->", "settings", ";", "// Enable strict mode", "ini_set", "(", "'session.use_strict_mode'", ",", "1", ")", ";", "// Use cookies and only cookies to store ...
Configure and start session @param Request $request PSR7 request
[ "Configure", "and", "start", "session" ]
f107191506b2c362f06f201f998891f315d6aaec
https://github.com/adbario/slim-secure-session-middleware/blob/f107191506b2c362f06f201f998891f315d6aaec/src/SessionMiddleware.php#L86-L171
189,293
lazyjsonmapper/lazyjsonmapper
src/Property/PropertyMapCompiler.php
PropertyMapCompiler._compile
private function _compile() { // There's nothing to do if the class is already in the cache. if (isset($this->_propertyMapCache->classMaps[$this->_solveClassName])) { return; // Abort. } // Let's compile the desired "solve-class", since it wasn't cached. // NOTE:...
php
private function _compile() { // There's nothing to do if the class is already in the cache. if (isset($this->_propertyMapCache->classMaps[$this->_solveClassName])) { return; // Abort. } // Let's compile the desired "solve-class", since it wasn't cached. // NOTE:...
[ "private", "function", "_compile", "(", ")", "{", "// There's nothing to do if the class is already in the cache.", "if", "(", "isset", "(", "$", "this", "->", "_propertyMapCache", "->", "classMaps", "[", "$", "this", "->", "_solveClassName", "]", ")", ")", "{", "...
The real, internal compiler algorithm entry point. MUST be wrapped in another function which handles compilation failures! @throws BadPropertyDefinitionException @throws BadPropertyMapException @throws CircularPropertyMapException @see PropertyMapCompiler::compile() The wrapper entry point.
[ "The", "real", "internal", "compiler", "algorithm", "entry", "point", "." ]
51e093b50f4de15d2d64548b3ca743713eed6ee9
https://github.com/lazyjsonmapper/lazyjsonmapper/blob/51e093b50f4de15d2d64548b3ca743713eed6ee9/src/Property/PropertyMapCompiler.php#L359-L547
189,294
lazyjsonmapper/lazyjsonmapper
src/Property/PropertyMapCompiler.php
PropertyMapCompiler._reflectSolveClassHierarchy
private function _reflectSolveClassHierarchy() { if (!empty($this->_classHierarchy)) { throw new BadPropertyMapException('Detected multiple calls to _reflectSolveClassHierarchy().'); } try { // Begin reflecting the "solve-class". And completely refuse to ...
php
private function _reflectSolveClassHierarchy() { if (!empty($this->_classHierarchy)) { throw new BadPropertyMapException('Detected multiple calls to _reflectSolveClassHierarchy().'); } try { // Begin reflecting the "solve-class". And completely refuse to ...
[ "private", "function", "_reflectSolveClassHierarchy", "(", ")", "{", "if", "(", "!", "empty", "(", "$", "this", "->", "_classHierarchy", ")", ")", "{", "throw", "new", "BadPropertyMapException", "(", "'Detected multiple calls to _reflectSolveClassHierarchy().'", ")", ...
Reflect all classes in the solve-class hierarchy. Builds a list of all classes in the inheritance chain, with the base-level class as the first element, and the solve-class as the last element. (The order is important!) @throws BadPropertyMapException
[ "Reflect", "all", "classes", "in", "the", "solve", "-", "class", "hierarchy", "." ]
51e093b50f4de15d2d64548b3ca743713eed6ee9
https://github.com/lazyjsonmapper/lazyjsonmapper/blob/51e093b50f4de15d2d64548b3ca743713eed6ee9/src/Property/PropertyMapCompiler.php#L558-L604
189,295
lazyjsonmapper/lazyjsonmapper
src/Property/PropertyMapCompiler.php
PropertyMapCompiler._checkCurrentLocks
private function _checkCurrentLocks() { foreach ($this->_classHierarchy as $classInfo) { // FATAL: If any part of our class hierarchy is already locked ("is // being compiled right now", higher up the call stack), then it's a // bad map with circular "import"-statements. ...
php
private function _checkCurrentLocks() { foreach ($this->_classHierarchy as $classInfo) { // FATAL: If any part of our class hierarchy is already locked ("is // being compiled right now", higher up the call stack), then it's a // bad map with circular "import"-statements. ...
[ "private", "function", "_checkCurrentLocks", "(", ")", "{", "foreach", "(", "$", "this", "->", "_classHierarchy", "as", "$", "classInfo", ")", "{", "// FATAL: If any part of our class hierarchy is already locked (\"is", "// being compiled right now\", higher up the call stack), t...
Check for already-locked classes in the solve-class hierarchy. Analyzes the solve-class hierarchy and verifies that we don't violate any current anti-circular map locks. @throws CircularPropertyMapException
[ "Check", "for", "already", "-", "locked", "classes", "in", "the", "solve", "-", "class", "hierarchy", "." ]
51e093b50f4de15d2d64548b3ca743713eed6ee9
https://github.com/lazyjsonmapper/lazyjsonmapper/blob/51e093b50f4de15d2d64548b3ca743713eed6ee9/src/Property/PropertyMapCompiler.php#L614-L635
189,296
lazyjsonmapper/lazyjsonmapper
src/Property/PropertyMapCompiler.php
PropertyMapCompiler._lockUncompiledClasses
private function _lockUncompiledClasses() { if (!empty($this->_ourCompilerClassLocks)) { throw new BadPropertyMapException('Detected multiple calls to _lockUncompiledClasses().'); } foreach ($this->_classHierarchy as $classInfo) { // If the class isn't already compil...
php
private function _lockUncompiledClasses() { if (!empty($this->_ourCompilerClassLocks)) { throw new BadPropertyMapException('Detected multiple calls to _lockUncompiledClasses().'); } foreach ($this->_classHierarchy as $classInfo) { // If the class isn't already compil...
[ "private", "function", "_lockUncompiledClasses", "(", ")", "{", "if", "(", "!", "empty", "(", "$", "this", "->", "_ourCompilerClassLocks", ")", ")", "{", "throw", "new", "BadPropertyMapException", "(", "'Detected multiple calls to _lockUncompiledClasses().'", ")", ";"...
Lock all uncompiled classes in the solve-class hierarchy. @throws BadPropertyMapException
[ "Lock", "all", "uncompiled", "classes", "in", "the", "solve", "-", "class", "hierarchy", "." ]
51e093b50f4de15d2d64548b3ca743713eed6ee9
https://github.com/lazyjsonmapper/lazyjsonmapper/blob/51e093b50f4de15d2d64548b3ca743713eed6ee9/src/Property/PropertyMapCompiler.php#L642-L663
189,297
lazyjsonmapper/lazyjsonmapper
src/Property/PropertyMapCompiler.php
PropertyMapCompiler._processCurrentClass
private function _processCurrentClass() { // We must always begin by reflecting its "JSON_PROPERTY_MAP" class // constant to determine if this particular class in the hierarchy // re-defines its value (compared to inheriting it from its "extends" // parent). This protects against acc...
php
private function _processCurrentClass() { // We must always begin by reflecting its "JSON_PROPERTY_MAP" class // constant to determine if this particular class in the hierarchy // re-defines its value (compared to inheriting it from its "extends" // parent). This protects against acc...
[ "private", "function", "_processCurrentClass", "(", ")", "{", "// We must always begin by reflecting its \"JSON_PROPERTY_MAP\" class", "// constant to determine if this particular class in the hierarchy", "// re-defines its value (compared to inheriting it from its \"extends\"", "// parent). This ...
Process the current class in the solve-class hierarchy. @throws BadPropertyDefinitionException @throws BadPropertyMapException @throws CircularPropertyMapException
[ "Process", "the", "current", "class", "in", "the", "solve", "-", "class", "hierarchy", "." ]
51e093b50f4de15d2d64548b3ca743713eed6ee9
https://github.com/lazyjsonmapper/lazyjsonmapper/blob/51e093b50f4de15d2d64548b3ca743713eed6ee9/src/Property/PropertyMapCompiler.php#L672-L878
189,298
lazyjsonmapper/lazyjsonmapper
src/Property/PropertyMapCompiler.php
PropertyMapCompiler._processPropertyMapEntry
private function _processPropertyMapEntry( $propName, $propDefStr) { if (is_string($propName) && is_string($propDefStr)) { // This is a string key -> string value pair, so let's attempt to // compile it as a regular property definition and then add it to /...
php
private function _processPropertyMapEntry( $propName, $propDefStr) { if (is_string($propName) && is_string($propDefStr)) { // This is a string key -> string value pair, so let's attempt to // compile it as a regular property definition and then add it to /...
[ "private", "function", "_processPropertyMapEntry", "(", "$", "propName", ",", "$", "propDefStr", ")", "{", "if", "(", "is_string", "(", "$", "propName", ")", "&&", "is_string", "(", "$", "propDefStr", ")", ")", "{", "// This is a string key -> string value pair, s...
Process a property map entry for the current class. Validates and compiles a map entry, and merges it with the current class property map if everything went okay and the entry was new/different. @param string|int $propName The property name, or a numeric array key. @param mixed $propDefStr Should be a string d...
[ "Process", "a", "property", "map", "entry", "for", "the", "current", "class", "." ]
51e093b50f4de15d2d64548b3ca743713eed6ee9
https://github.com/lazyjsonmapper/lazyjsonmapper/blob/51e093b50f4de15d2d64548b3ca743713eed6ee9/src/Property/PropertyMapCompiler.php#L896-L953
189,299
lazyjsonmapper/lazyjsonmapper
src/Property/PropertyMapCompiler.php
PropertyMapCompiler._processPropertyDefinitionString
private function _processPropertyDefinitionString( $propName, $propDefStr) { try { // Validates the definition and throws if bad. // NOTE: The namespace argument here is INCREDIBLY important. It's // what allows each class to refer to classes relative to i...
php
private function _processPropertyDefinitionString( $propName, $propDefStr) { try { // Validates the definition and throws if bad. // NOTE: The namespace argument here is INCREDIBLY important. It's // what allows each class to refer to classes relative to i...
[ "private", "function", "_processPropertyDefinitionString", "(", "$", "propName", ",", "$", "propDefStr", ")", "{", "try", "{", "// Validates the definition and throws if bad.", "// NOTE: The namespace argument here is INCREDIBLY important. It's", "// what allows each class to refer to ...
Compile a property definition string and add it to the current class. Attempts to compile the definition, and then appends it to the current class' final compiled map, IF the definition is valid and describes a new/different value compared to what's already in the current class map. @param string $propName The prop...
[ "Compile", "a", "property", "definition", "string", "and", "add", "it", "to", "the", "current", "class", "." ]
51e093b50f4de15d2d64548b3ca743713eed6ee9
https://github.com/lazyjsonmapper/lazyjsonmapper/blob/51e093b50f4de15d2d64548b3ca743713eed6ee9/src/Property/PropertyMapCompiler.php#L967-L1049