repository_name
stringlengths
5
67
func_path_in_repository
stringlengths
4
234
func_name
stringlengths
0
314
whole_func_string
stringlengths
52
3.87M
language
stringclasses
6 values
func_code_string
stringlengths
52
3.87M
func_code_tokens
listlengths
15
672k
func_documentation_string
stringlengths
1
47.2k
func_documentation_tokens
listlengths
1
3.92k
split_name
stringclasses
1 value
func_code_url
stringlengths
85
339
phramework/validate
src/Validate.php
Validate.email
public static function email($input, $field_name = 'email') { //Define trivial model $model = [ $field_name => ['type' => Validate::TYPE_EMAIL, Validate::REQUIRED] ]; $parameters = [$field_name => $input]; Validate::model($parameters, $model); return $pa...
php
public static function email($input, $field_name = 'email') { //Define trivial model $model = [ $field_name => ['type' => Validate::TYPE_EMAIL, Validate::REQUIRED] ]; $parameters = [$field_name => $input]; Validate::model($parameters, $model); return $pa...
[ "public", "static", "function", "email", "(", "$", "input", ",", "$", "field_name", "=", "'email'", ")", "{", "//Define trivial model", "$", "model", "=", "[", "$", "field_name", "=>", "[", "'type'", "=>", "Validate", "::", "TYPE_EMAIL", ",", "Validate", "...
Validate an email address @param string $input @param string $field_name [optional] Field's name, used in IncorrectParametersException. Optional default is email @return string Return the email address @throws IncorrectParameters If value type is not correct.
[ "Validate", "an", "email", "address" ]
train
https://github.com/phramework/validate/blob/22dd3c4e5f7a77a1a75d92f98444f3e4b7ce5cfc/src/Validate.php#L718-L729
phramework/validate
src/Validate.php
Validate.url
public static function url($input, $field_name = 'url') { //Define trivial model $model = [ $field_name => ['type' => Validate::TYPE_URL, Validate::REQUIRED] ]; $parameters = [$field_name => $input]; Validate::model($parameters, $model); return $paramete...
php
public static function url($input, $field_name = 'url') { //Define trivial model $model = [ $field_name => ['type' => Validate::TYPE_URL, Validate::REQUIRED] ]; $parameters = [$field_name => $input]; Validate::model($parameters, $model); return $paramete...
[ "public", "static", "function", "url", "(", "$", "input", ",", "$", "field_name", "=", "'url'", ")", "{", "//Define trivial model", "$", "model", "=", "[", "$", "field_name", "=>", "[", "'type'", "=>", "Validate", "::", "TYPE_URL", ",", "Validate", "::", ...
Validate a url @param string $input @param string $field_name [optional] Field's name, used in IncorrectParametersException. Optional default is url @return string Return the url @throws IncorrectParameters If value type is not correct.
[ "Validate", "a", "url" ]
train
https://github.com/phramework/validate/blob/22dd3c4e5f7a77a1a75d92f98444f3e4b7ce5cfc/src/Validate.php#L739-L750
phramework/validate
src/Validate.php
Validate.permalink
public static function permalink($input, $field_name = 'permalink') { //Define trivial model $model = [ $field_name => ['type' => Validate::TYPE_PERMALINK, Validate::REQUIRED] ]; $parameters = [$field_name => $input]; Validate::model($parameters, $model); ...
php
public static function permalink($input, $field_name = 'permalink') { //Define trivial model $model = [ $field_name => ['type' => Validate::TYPE_PERMALINK, Validate::REQUIRED] ]; $parameters = [$field_name => $input]; Validate::model($parameters, $model); ...
[ "public", "static", "function", "permalink", "(", "$", "input", ",", "$", "field_name", "=", "'permalink'", ")", "{", "//Define trivial model", "$", "model", "=", "[", "$", "field_name", "=>", "[", "'type'", "=>", "Validate", "::", "TYPE_PERMALINK", ",", "Va...
Validate a permalink id @param string $input @param string $field_name [optional] Field's name, used in IncorrectParametersException. Optional default is permalink @return string Return the permalink @throws IncorrectParameters If value type is not correct.
[ "Validate", "a", "permalink", "id" ]
train
https://github.com/phramework/validate/blob/22dd3c4e5f7a77a1a75d92f98444f3e4b7ce5cfc/src/Validate.php#L760-L771
phramework/validate
src/Validate.php
Validate.enum
public static function enum($input, $values, $field_name = 'enum') { //Check if array was given for $values value if (!is_array($values)) { throw new \Exception('Array is expected as values'); } //Define trivial model $model = [ $field_name => [ ...
php
public static function enum($input, $values, $field_name = 'enum') { //Check if array was given for $values value if (!is_array($values)) { throw new \Exception('Array is expected as values'); } //Define trivial model $model = [ $field_name => [ ...
[ "public", "static", "function", "enum", "(", "$", "input", ",", "$", "values", ",", "$", "field_name", "=", "'enum'", ")", "{", "//Check if array was given for $values value", "if", "(", "!", "is_array", "(", "$", "values", ")", ")", "{", "throw", "new", "...
Check if input value is in allowed values @param string|integer $input Input array to check @param array $values Array of strings or number, defines the allowed input values @param string $field_name [optional] Field's name, used in IncorrectParametersException. Optional default is enum @throws IncorrectParameters If v...
[ "Check", "if", "input", "value", "is", "in", "allowed", "values" ]
train
https://github.com/phramework/validate/blob/22dd3c4e5f7a77a1a75d92f98444f3e4b7ce5cfc/src/Validate.php#L803-L822
phramework/validate
src/Validate.php
Validate.sqlDate
public static function sqlDate($date, $field_name = 'date') { if (preg_match('/^(\d{4})-(\d{2})-(\d{2}) ([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9])$/', $date, $matches)) { if (checkdate($matches[2], $matches[3], $matches[1])) { return $date; } } throw...
php
public static function sqlDate($date, $field_name = 'date') { if (preg_match('/^(\d{4})-(\d{2})-(\d{2}) ([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9])$/', $date, $matches)) { if (checkdate($matches[2], $matches[3], $matches[1])) { return $date; } } throw...
[ "public", "static", "function", "sqlDate", "(", "$", "date", ",", "$", "field_name", "=", "'date'", ")", "{", "if", "(", "preg_match", "(", "'/^(\\d{4})-(\\d{2})-(\\d{2}) ([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9])$/'", ",", "$", "date", ",", "$", "matches", ")", ...
Validate SQL date, datetime @param string $date Input date @param string $field_name [optional] Field's name, used in IncorrectParametersException. Optional default is date @return string @throws IncorrectParameters If value type is not correct.
[ "Validate", "SQL", "date", "datetime" ]
train
https://github.com/phramework/validate/blob/22dd3c4e5f7a77a1a75d92f98444f3e4b7ce5cfc/src/Validate.php#L832-L840
phramework/validate
src/Validate.php
Validate.color
public static function color($input, $type = Validate::COLOR_HEX, $field_name = 'color') { //Define trivial model $model = [ $field_name => ['type' => Validate::TYPE_COLOR, 'color_type' => $type, Validate::REQUIRED] ]; $parameters = [$field_name => $input]; Valid...
php
public static function color($input, $type = Validate::COLOR_HEX, $field_name = 'color') { //Define trivial model $model = [ $field_name => ['type' => Validate::TYPE_COLOR, 'color_type' => $type, Validate::REQUIRED] ]; $parameters = [$field_name => $input]; Valid...
[ "public", "static", "function", "color", "(", "$", "input", ",", "$", "type", "=", "Validate", "::", "COLOR_HEX", ",", "$", "field_name", "=", "'color'", ")", "{", "//Define trivial model", "$", "model", "=", "[", "$", "field_name", "=>", "[", "'type'", ...
Validate color @param type $input Input color @param string $type Color value type. Optional, default is hex @param string $field_name [optional] Field's name, used in IncorrectParametersException. Optional default is color @return string @throws IncorrectParameters If value type is not correct. @todo Implement additio...
[ "Validate", "color" ]
train
https://github.com/phramework/validate/blob/22dd3c4e5f7a77a1a75d92f98444f3e4b7ce5cfc/src/Validate.php#L852-L863
phramework/validate
src/Validate.php
Validate.operator
public static function operator($operator, $field_name = 'operator') { if (!in_array($operator, self::$operators)) { throw new IncorrectParametersException([ $field_name]); } return $operator; }
php
public static function operator($operator, $field_name = 'operator') { if (!in_array($operator, self::$operators)) { throw new IncorrectParametersException([ $field_name]); } return $operator; }
[ "public", "static", "function", "operator", "(", "$", "operator", ",", "$", "field_name", "=", "'operator'", ")", "{", "if", "(", "!", "in_array", "(", "$", "operator", ",", "self", "::", "$", "operators", ")", ")", "{", "throw", "new", "IncorrectParamet...
Validate an operator @param string $operator @param string $field_name [optional] @return string @throws IncorrectParameters If value type is not correct.
[ "Validate", "an", "operator" ]
train
https://github.com/phramework/validate/blob/22dd3c4e5f7a77a1a75d92f98444f3e4b7ce5cfc/src/Validate.php#L872-L878
phramework/validate
src/Validate.php
Validate.regexp
public static function regexp($input, $regexp, $field_name = 'regexp') { //Define trivial model $model = [ $field_name => ['type' => Validate::TYPE_REGEXP, 'regexp' => $regexp, Validate::REQUIRED] ]; $parameters = [$field_name => $input]; Validate::model($paramet...
php
public static function regexp($input, $regexp, $field_name = 'regexp') { //Define trivial model $model = [ $field_name => ['type' => Validate::TYPE_REGEXP, 'regexp' => $regexp, Validate::REQUIRED] ]; $parameters = [$field_name => $input]; Validate::model($paramet...
[ "public", "static", "function", "regexp", "(", "$", "input", ",", "$", "regexp", ",", "$", "field_name", "=", "'regexp'", ")", "{", "//Define trivial model", "$", "model", "=", "[", "$", "field_name", "=>", "[", "'type'", "=>", "Validate", "::", "TYPE_REGE...
Validate a regexp @param string input @param string regexp @param string $field_name [optional] @return string @throws IncorrectParameters If value type is not correct.
[ "Validate", "a", "regexp" ]
train
https://github.com/phramework/validate/blob/22dd3c4e5f7a77a1a75d92f98444f3e4b7ce5cfc/src/Validate.php#L888-L899
phramework/validate
src/Validate.php
Validate.boolean
public static function boolean($input, $field_name = 'boolean') { //Define trivial model $model = [ $field_name => ['type' => Validate::TYPE_BOOLEAN, Validate::REQUIRED] ]; $parameters = [$field_name => $input]; Validate::model($parameters, $model); retu...
php
public static function boolean($input, $field_name = 'boolean') { //Define trivial model $model = [ $field_name => ['type' => Validate::TYPE_BOOLEAN, Validate::REQUIRED] ]; $parameters = [$field_name => $input]; Validate::model($parameters, $model); retu...
[ "public", "static", "function", "boolean", "(", "$", "input", ",", "$", "field_name", "=", "'boolean'", ")", "{", "//Define trivial model", "$", "model", "=", "[", "$", "field_name", "=>", "[", "'type'", "=>", "Validate", "::", "TYPE_BOOLEAN", ",", "Validate...
Validate a regexp @param mixed input @param string $field_name [optional] @return boolean @throws IncorrectParameters If value type is not correct.
[ "Validate", "a", "regexp" ]
train
https://github.com/phramework/validate/blob/22dd3c4e5f7a77a1a75d92f98444f3e4b7ce5cfc/src/Validate.php#L908-L919
eleiva/yii2-noty
Noty.php
Noty.init
public function init() { $view = $this->getView(); $asset = new NotyAsset(); $asset->register($view); if ($this->useAnimateCss) { $cssAsset = new AnimateAsset(); $cssAsset->register($view); } $this->clientOptions['text'] = $this->text; $th...
php
public function init() { $view = $this->getView(); $asset = new NotyAsset(); $asset->register($view); if ($this->useAnimateCss) { $cssAsset = new AnimateAsset(); $cssAsset->register($view); } $this->clientOptions['text'] = $this->text; $th...
[ "public", "function", "init", "(", ")", "{", "$", "view", "=", "$", "this", "->", "getView", "(", ")", ";", "$", "asset", "=", "new", "NotyAsset", "(", ")", ";", "$", "asset", "->", "register", "(", "$", "view", ")", ";", "if", "(", "$", "this"...
Init widget
[ "Init", "widget" ]
train
https://github.com/eleiva/yii2-noty/blob/3af35cda54fcfbc6f9c1c18522faad7de5ba2b05/Noty.php#L54-L67
constant-null/backstubber
src/Core/ContentProcessor.php
ContentProcessor.setDelimiters
public function setDelimiters($begin, $end) { $this->beginDelimiter = $begin; $this->endDelimiter = $end; // for chaining return $this; }
php
public function setDelimiters($begin, $end) { $this->beginDelimiter = $begin; $this->endDelimiter = $end; // for chaining return $this; }
[ "public", "function", "setDelimiters", "(", "$", "begin", ",", "$", "end", ")", "{", "$", "this", "->", "beginDelimiter", "=", "$", "begin", ";", "$", "this", "->", "endDelimiter", "=", "$", "end", ";", "// for chaining", "return", "$", "this", ";", "}...
Set begin and end delimiters which will be used to detect parts to be replaced @param $begin string @param $end string @return $this
[ "Set", "begin", "and", "end", "delimiters", "which", "will", "be", "used", "to", "detect", "parts", "to", "be", "replaced" ]
train
https://github.com/constant-null/backstubber/blob/1e7ee66091bae4e6b709642467609a8566dae479/src/Core/ContentProcessor.php#L82-L90
constant-null/backstubber
src/Core/ContentProcessor.php
ContentProcessor.doRegexpReplace
public function doRegexpReplace($searchPattern, $replaceWith) { $this->content = preg_replace_callback( $searchPattern, function($matches) use ($replaceWith) { $indent = isset($matches['indent']) ? $matches['indent'] : ''; $output = $indent; ...
php
public function doRegexpReplace($searchPattern, $replaceWith) { $this->content = preg_replace_callback( $searchPattern, function($matches) use ($replaceWith) { $indent = isset($matches['indent']) ? $matches['indent'] : ''; $output = $indent; ...
[ "public", "function", "doRegexpReplace", "(", "$", "searchPattern", ",", "$", "replaceWith", ")", "{", "$", "this", "->", "content", "=", "preg_replace_callback", "(", "$", "searchPattern", ",", "function", "(", "$", "matches", ")", "use", "(", "$", "replace...
Immediately replaces part of data using regular expression @param $searchPattern string @param $replaceWith string @return $this
[ "Immediately", "replaces", "part", "of", "data", "using", "regular", "expression" ]
train
https://github.com/constant-null/backstubber/blob/1e7ee66091bae4e6b709642467609a8566dae479/src/Core/ContentProcessor.php#L137-L154
constant-null/backstubber
src/Core/ContentProcessor.php
ContentProcessor.doReplace
public function doReplace($searchFor, $replaceWith) { $this->content = str_replace($searchFor, $replaceWith, $this->content); // for chaining return $this; }
php
public function doReplace($searchFor, $replaceWith) { $this->content = str_replace($searchFor, $replaceWith, $this->content); // for chaining return $this; }
[ "public", "function", "doReplace", "(", "$", "searchFor", ",", "$", "replaceWith", ")", "{", "$", "this", "->", "content", "=", "str_replace", "(", "$", "searchFor", ",", "$", "replaceWith", ",", "$", "this", "->", "content", ")", ";", "// for chaining", ...
Immediately replaces part of data @param $searchFor string @param $replaceWith string @return $this
[ "Immediately", "replaces", "part", "of", "data" ]
train
https://github.com/constant-null/backstubber/blob/1e7ee66091bae4e6b709642467609a8566dae479/src/Core/ContentProcessor.php#L163-L170
constant-null/backstubber
src/Core/ContentProcessor.php
ContentProcessor.replaceBasic
private function replaceBasic($searchFor, $replaceWith) { if ($this->isPrefixUsed()) { $searchFor = $this->globalPrefix . $searchFor; } $this->doReplace($searchFor, $replaceWith); }
php
private function replaceBasic($searchFor, $replaceWith) { if ($this->isPrefixUsed()) { $searchFor = $this->globalPrefix . $searchFor; } $this->doReplace($searchFor, $replaceWith); }
[ "private", "function", "replaceBasic", "(", "$", "searchFor", ",", "$", "replaceWith", ")", "{", "if", "(", "$", "this", "->", "isPrefixUsed", "(", ")", ")", "{", "$", "searchFor", "=", "$", "this", "->", "globalPrefix", ".", "$", "searchFor", ";", "}"...
Replace data using str_replace using prefix (if set) @param $searchFor string @param $replaceWith string
[ "Replace", "data", "using", "str_replace", "using", "prefix", "(", "if", "set", ")" ]
train
https://github.com/constant-null/backstubber/blob/1e7ee66091bae4e6b709642467609a8566dae479/src/Core/ContentProcessor.php#L192-L199
constant-null/backstubber
src/Core/ContentProcessor.php
ContentProcessor.process
public function process($forceOrder = false) { // sort the replacements by descending // (in that way some problems with replacements naming can be avoided) if (!$forceOrder) { array_multisort( array_map('mb_strlen', array_keys($this->replacements)), ...
php
public function process($forceOrder = false) { // sort the replacements by descending // (in that way some problems with replacements naming can be avoided) if (!$forceOrder) { array_multisort( array_map('mb_strlen', array_keys($this->replacements)), ...
[ "public", "function", "process", "(", "$", "forceOrder", "=", "false", ")", "{", "// sort the replacements by descending", "// (in that way some problems with replacements naming can be avoided)", "if", "(", "!", "$", "forceOrder", ")", "{", "array_multisort", "(", "array_m...
Start replacing data @param $forceOrder bool keep user defined order of replacements (conflicts possible) @return $this
[ "Start", "replacing", "data" ]
train
https://github.com/constant-null/backstubber/blob/1e7ee66091bae4e6b709642467609a8566dae479/src/Core/ContentProcessor.php#L207-L228
mremi/Dolist
src/Mremi/Dolist/Contact/SavedContactInfo.php
SavedContactInfo.getHandledCodes
public function getHandledCodes() { return array( self::CODE_PENDING => 'pending', self::CODE_ERROR => 'error', self::CODE_SUCCESS => 'success', self::CODE_UNAUTHORIZED_EMAIL => 'unauthoriz...
php
public function getHandledCodes() { return array( self::CODE_PENDING => 'pending', self::CODE_ERROR => 'error', self::CODE_SUCCESS => 'success', self::CODE_UNAUTHORIZED_EMAIL => 'unauthoriz...
[ "public", "function", "getHandledCodes", "(", ")", "{", "return", "array", "(", "self", "::", "CODE_PENDING", "=>", "'pending'", ",", "self", "::", "CODE_ERROR", "=>", "'error'", ",", "self", "::", "CODE_SUCCESS", "=>", "'success'", ",", "self", "::", "CODE_...
Gets an array of handled codes @return array
[ "Gets", "an", "array", "of", "handled", "codes" ]
train
https://github.com/mremi/Dolist/blob/452c863aba12ef2965bafdb619c0278f8fc732d0/src/Mremi/Dolist/Contact/SavedContactInfo.php#L115-L128
Wonail/wocenter
helpers/CacheManagerHelper.php
CacheManagerHelper.flushAll
public static function flushAll() { $cachesInfo = []; if (empty($caches = self::findCaches())) { return $cachesInfo; } foreach ($caches as $name => $class) { $cachesInfo[] = [ 'name' => $name, 'class' => $class, ...
php
public static function flushAll() { $cachesInfo = []; if (empty($caches = self::findCaches())) { return $cachesInfo; } foreach ($caches as $name => $class) { $cachesInfo[] = [ 'name' => $name, 'class' => $class, ...
[ "public", "static", "function", "flushAll", "(", ")", "{", "$", "cachesInfo", "=", "[", "]", ";", "if", "(", "empty", "(", "$", "caches", "=", "self", "::", "findCaches", "(", ")", ")", ")", "{", "return", "$", "cachesInfo", ";", "}", "foreach", "(...
Flushes all caches registered in the system.
[ "Flushes", "all", "caches", "registered", "in", "the", "system", "." ]
train
https://github.com/Wonail/wocenter/blob/186c15aad008d32fbf5ad75256cf01581dccf9e6/helpers/CacheManagerHelper.php#L21-L37
Wonail/wocenter
helpers/CacheManagerHelper.php
CacheManagerHelper.findCaches
private static function findCaches(array $cachesNames = []) { $caches = []; $components = Yii::$app->getComponents(); $findAll = ($cachesNames === []); foreach ($components as $name => $component) { if (!$findAll && !in_array($name, $cachesNames, true)) { ...
php
private static function findCaches(array $cachesNames = []) { $caches = []; $components = Yii::$app->getComponents(); $findAll = ($cachesNames === []); foreach ($components as $name => $component) { if (!$findAll && !in_array($name, $cachesNames, true)) { ...
[ "private", "static", "function", "findCaches", "(", "array", "$", "cachesNames", "=", "[", "]", ")", "{", "$", "caches", "=", "[", "]", ";", "$", "components", "=", "Yii", "::", "$", "app", "->", "getComponents", "(", ")", ";", "$", "findAll", "=", ...
Returns array of caches in the system, keys are cache components names, values are class names. @param array $cachesNames caches to be found @return array
[ "Returns", "array", "of", "caches", "in", "the", "system", "keys", "are", "cache", "components", "names", "values", "are", "class", "names", "." ]
train
https://github.com/Wonail/wocenter/blob/186c15aad008d32fbf5ad75256cf01581dccf9e6/helpers/CacheManagerHelper.php#L46-L73
sulu/SuluSalesShippingBundle
src/Sulu/Bundle/Sales/OrderBundle/Cart/CartManager.php
CartManager.getUserCart
public function getUserCart( $user = null, $locale = null, $currency = null, $persistEmptyCart = false, $updatePrices = false ) { // cart by session ID if (!$user) { // TODO: get correct locale $locale = 'de'; $cartsArray = ...
php
public function getUserCart( $user = null, $locale = null, $currency = null, $persistEmptyCart = false, $updatePrices = false ) { // cart by session ID if (!$user) { // TODO: get correct locale $locale = 'de'; $cartsArray = ...
[ "public", "function", "getUserCart", "(", "$", "user", "=", "null", ",", "$", "locale", "=", "null", ",", "$", "currency", "=", "null", ",", "$", "persistEmptyCart", "=", "false", ",", "$", "updatePrices", "=", "false", ")", "{", "// cart by session ID", ...
@param UserInterface $user @param null|string $locale @param null|string $currency @param bool $persistEmptyCart Define if an empty cart should be persisted @param bool $updatePrices Defines if prices should be updated @return null|ApiOrder
[ "@param", "UserInterface", "$user", "@param", "null|string", "$locale", "@param", "null|string", "$currency", "@param", "bool", "$persistEmptyCart", "Define", "if", "an", "empty", "cart", "should", "be", "persisted", "@param", "bool", "$updatePrices", "Defines", "if",...
train
https://github.com/sulu/SuluSalesShippingBundle/blob/0d39de262d58579e5679db99a77dbf717d600b5e/src/Sulu/Bundle/Sales/OrderBundle/Cart/CartManager.php#L151-L206
sulu/SuluSalesShippingBundle
src/Sulu/Bundle/Sales/OrderBundle/Cart/CartManager.php
CartManager.submitCartDirectly
public function submitCartDirectly( ApiOrderInterface $cart, UserInterface $user, $locale ) { $orderWasSubmitted = true; try { $this->checkIfCartIsValid($user, $cart, $locale); // set order-date to current date $cart->setOrderDate(new \Da...
php
public function submitCartDirectly( ApiOrderInterface $cart, UserInterface $user, $locale ) { $orderWasSubmitted = true; try { $this->checkIfCartIsValid($user, $cart, $locale); // set order-date to current date $cart->setOrderDate(new \Da...
[ "public", "function", "submitCartDirectly", "(", "ApiOrderInterface", "$", "cart", ",", "UserInterface", "$", "user", ",", "$", "locale", ")", "{", "$", "orderWasSubmitted", "=", "true", ";", "try", "{", "$", "this", "->", "checkIfCartIsValid", "(", "$", "us...
Submits a cart @param ApiOrderInterface $cart @param string $locale @param UserInterface $user @return bool
[ "Submits", "a", "cart" ]
train
https://github.com/sulu/SuluSalesShippingBundle/blob/0d39de262d58579e5679db99a77dbf717d600b5e/src/Sulu/Bundle/Sales/OrderBundle/Cart/CartManager.php#L288-L340
sulu/SuluSalesShippingBundle
src/Sulu/Bundle/Sales/OrderBundle/Cart/CartManager.php
CartManager.checkProductsAvailability
private function checkProductsAvailability(OrderInterface $cart) { // no check needed if ($cart->getItems()->isEmpty()) { return true; } $containsInvalidProducts = false; /** @var \Sulu\Bundle\Sales\CoreBundle\Entity\ItemInterface $item */ foreach ($cart-...
php
private function checkProductsAvailability(OrderInterface $cart) { // no check needed if ($cart->getItems()->isEmpty()) { return true; } $containsInvalidProducts = false; /** @var \Sulu\Bundle\Sales\CoreBundle\Entity\ItemInterface $item */ foreach ($cart-...
[ "private", "function", "checkProductsAvailability", "(", "OrderInterface", "$", "cart", ")", "{", "// no check needed", "if", "(", "$", "cart", "->", "getItems", "(", ")", "->", "isEmpty", "(", ")", ")", "{", "return", "true", ";", "}", "$", "containsInvalid...
Removes items from cart that have no valid shop products applied; and returns if all products are still available @param OrderInterface $cart @return bool If all products are available
[ "Removes", "items", "from", "cart", "that", "have", "no", "valid", "shop", "products", "applied", ";", "and", "returns", "if", "all", "products", "are", "still", "available" ]
train
https://github.com/sulu/SuluSalesShippingBundle/blob/0d39de262d58579e5679db99a77dbf717d600b5e/src/Sulu/Bundle/Sales/OrderBundle/Cart/CartManager.php#L366-L390
sulu/SuluSalesShippingBundle
src/Sulu/Bundle/Sales/OrderBundle/Cart/CartManager.php
CartManager.addProduct
public function addProduct($data, $user = null, $locale = null) { //TODO: locale // get cart $cart = $this->getUserCart($user, $locale, null, true); // define user-id $userId = $user ? $user->getId() : null; $item = $this->orderManager->addItem($data, $locale, $userI...
php
public function addProduct($data, $user = null, $locale = null) { //TODO: locale // get cart $cart = $this->getUserCart($user, $locale, null, true); // define user-id $userId = $user ? $user->getId() : null; $item = $this->orderManager->addItem($data, $locale, $userI...
[ "public", "function", "addProduct", "(", "$", "data", ",", "$", "user", "=", "null", ",", "$", "locale", "=", "null", ")", "{", "//TODO: locale", "// get cart", "$", "cart", "=", "$", "this", "->", "getUserCart", "(", "$", "user", ",", "$", "locale", ...
Adds a product to cart @param array $data @param UserInterface|null $user @param string|null $locale @return null|Order
[ "Adds", "a", "product", "to", "cart" ]
train
https://github.com/sulu/SuluSalesShippingBundle/blob/0d39de262d58579e5679db99a77dbf717d600b5e/src/Sulu/Bundle/Sales/OrderBundle/Cart/CartManager.php#L553-L568
sulu/SuluSalesShippingBundle
src/Sulu/Bundle/Sales/OrderBundle/Cart/CartManager.php
CartManager.updateItem
public function updateItem($itemId, $data, $user = null, $locale = null) { $cart = $this->getUserCart($user, $locale); $userId = $user ? $user->getId() : null; $this->validateOrCreateAddresses($cart, $user); $item = $this->orderManager->getOrderItemById($itemId, $cart->getEntity())...
php
public function updateItem($itemId, $data, $user = null, $locale = null) { $cart = $this->getUserCart($user, $locale); $userId = $user ? $user->getId() : null; $this->validateOrCreateAddresses($cart, $user); $item = $this->orderManager->getOrderItemById($itemId, $cart->getEntity())...
[ "public", "function", "updateItem", "(", "$", "itemId", ",", "$", "data", ",", "$", "user", "=", "null", ",", "$", "locale", "=", "null", ")", "{", "$", "cart", "=", "$", "this", "->", "getUserCart", "(", "$", "user", ",", "$", "locale", ")", ";"...
Update item data @param int $itemId @param array $data @param null|UserInterface $user @param null|string $locale @throws ItemNotFoundException @return null|Order
[ "Update", "item", "data" ]
train
https://github.com/sulu/SuluSalesShippingBundle/blob/0d39de262d58579e5679db99a77dbf717d600b5e/src/Sulu/Bundle/Sales/OrderBundle/Cart/CartManager.php#L582-L601
sulu/SuluSalesShippingBundle
src/Sulu/Bundle/Sales/OrderBundle/Cart/CartManager.php
CartManager.createEmptyCart
protected function createEmptyCart($user, $persist, $currencyCode = null) { $cart = new Order(); $cart->setCreator($user); $cart->setChanger($user); $cart->setCreated(new \DateTime()); $cart->setChanged(new \DateTime()); $cart->setOrderDate(new \DateTime()); ...
php
protected function createEmptyCart($user, $persist, $currencyCode = null) { $cart = new Order(); $cart->setCreator($user); $cart->setChanger($user); $cart->setCreated(new \DateTime()); $cart->setChanged(new \DateTime()); $cart->setOrderDate(new \DateTime()); ...
[ "protected", "function", "createEmptyCart", "(", "$", "user", ",", "$", "persist", ",", "$", "currencyCode", "=", "null", ")", "{", "$", "cart", "=", "new", "Order", "(", ")", ";", "$", "cart", "->", "setCreator", "(", "$", "user", ")", ";", "$", "...
Function creates an empty cart this means an order with status 'in_cart' is created and all necessary data is set @param UserInterface $user @param bool $persist @param null|string $currencyCode @return Order @throws \Sulu\Component\Rest\Exception\EntityNotFoundException
[ "Function", "creates", "an", "empty", "cart", "this", "means", "an", "order", "with", "status", "in_cart", "is", "created", "and", "all", "necessary", "data", "is", "set" ]
train
https://github.com/sulu/SuluSalesShippingBundle/blob/0d39de262d58579e5679db99a77dbf717d600b5e/src/Sulu/Bundle/Sales/OrderBundle/Cart/CartManager.php#L636-L712
sulu/SuluSalesShippingBundle
src/Sulu/Bundle/Sales/OrderBundle/Cart/CartManager.php
CartManager.getNumberItemsAndTotalPrice
public function getNumberItemsAndTotalPrice($user, $locale) { $cart = $this->getUserCart($user, $locale); return array( 'totalItems' => count($cart->getItems()), 'totalPrice' => $cart->getTotalNetPrice(), 'totalPriceFormatted' => $cart->getTotalNetPriceFormatted(...
php
public function getNumberItemsAndTotalPrice($user, $locale) { $cart = $this->getUserCart($user, $locale); return array( 'totalItems' => count($cart->getItems()), 'totalPrice' => $cart->getTotalNetPrice(), 'totalPriceFormatted' => $cart->getTotalNetPriceFormatted(...
[ "public", "function", "getNumberItemsAndTotalPrice", "(", "$", "user", ",", "$", "locale", ")", "{", "$", "cart", "=", "$", "this", "->", "getUserCart", "(", "$", "user", ",", "$", "locale", ")", ";", "return", "array", "(", "'totalItems'", "=>", "count"...
Returns array containing number of items and total-price array('totalItems', 'totalPrice') @param UserInterface $user @param string $locale @return array
[ "Returns", "array", "containing", "number", "of", "items", "and", "total", "-", "price", "array", "(", "totalItems", "totalPrice", ")" ]
train
https://github.com/sulu/SuluSalesShippingBundle/blob/0d39de262d58579e5679db99a77dbf717d600b5e/src/Sulu/Bundle/Sales/OrderBundle/Cart/CartManager.php#L723-L733
sulu/SuluSalesShippingBundle
src/Sulu/Bundle/Sales/OrderBundle/Cart/CartManager.php
CartManager.validateIfItemProductActive
protected function validateIfItemProductActive(ItemInterface $item) { $product = $item->getProduct(); if (!$product) { throw new ProductNotFoundException('item ' . $item->getId()); } if ($product->getStatus()->getId() !== Status::ACTIVE) { throw new ProductN...
php
protected function validateIfItemProductActive(ItemInterface $item) { $product = $item->getProduct(); if (!$product) { throw new ProductNotFoundException('item ' . $item->getId()); } if ($product->getStatus()->getId() !== Status::ACTIVE) { throw new ProductN...
[ "protected", "function", "validateIfItemProductActive", "(", "ItemInterface", "$", "item", ")", "{", "$", "product", "=", "$", "item", "->", "getProduct", "(", ")", ";", "if", "(", "!", "$", "product", ")", "{", "throw", "new", "ProductNotFoundException", "(...
Checks if product of an item is in active state. @param ItemInterface $item @throws ProductNotActiveException @throws ProductNotFoundException @return bool
[ "Checks", "if", "product", "of", "an", "item", "is", "in", "active", "state", "." ]
train
https://github.com/sulu/SuluSalesShippingBundle/blob/0d39de262d58579e5679db99a77dbf717d600b5e/src/Sulu/Bundle/Sales/OrderBundle/Cart/CartManager.php#L778-L791
activecollab/databasestructure
src/Field/Composite/AddressField.php
AddressField.onAddedToType
public function onAddedToType(TypeInterface &$type) { parent::onAddedToType($type); if ($this->getIndexOnCity()) { $type->addIndex(new Index($this->getPrefixedFieldName('city'))); } if ($this->getIndexOnZipCode()) { $type->addIndex(new Index($this->getPrefix...
php
public function onAddedToType(TypeInterface &$type) { parent::onAddedToType($type); if ($this->getIndexOnCity()) { $type->addIndex(new Index($this->getPrefixedFieldName('city'))); } if ($this->getIndexOnZipCode()) { $type->addIndex(new Index($this->getPrefix...
[ "public", "function", "onAddedToType", "(", "TypeInterface", "&", "$", "type", ")", "{", "parent", "::", "onAddedToType", "(", "$", "type", ")", ";", "if", "(", "$", "this", "->", "getIndexOnCity", "(", ")", ")", "{", "$", "type", "->", "addIndex", "("...
{@inheritdoc}
[ "{" ]
train
https://github.com/activecollab/databasestructure/blob/4b2353c4422186bcfce63b3212da3e70e63eb5df/src/Field/Composite/AddressField.php#L173-L192
faustbrian/Laravel-Countries
src/Console/Commands/SeedCurrencies.php
SeedCurrencies.handle
public function handle() { foreach ($this->getModel()->all() as $country) { if (head($country->currency)) { $code = head($country->currency); $country->currencies()->create([ 'code' => $code, 'symbol' => $this->getCurrenc...
php
public function handle() { foreach ($this->getModel()->all() as $country) { if (head($country->currency)) { $code = head($country->currency); $country->currencies()->create([ 'code' => $code, 'symbol' => $this->getCurrenc...
[ "public", "function", "handle", "(", ")", "{", "foreach", "(", "$", "this", "->", "getModel", "(", ")", "->", "all", "(", ")", "as", "$", "country", ")", "{", "if", "(", "head", "(", "$", "country", "->", "currency", ")", ")", "{", "$", "code", ...
Execute the console command. @return mixed
[ "Execute", "the", "console", "command", "." ]
train
https://github.com/faustbrian/Laravel-Countries/blob/3d72301acd37e7f351d9b991dba41807ab68362b/src/Console/Commands/SeedCurrencies.php#L41-L55
faustbrian/Laravel-Countries
src/Console/Commands/SeedCurrencies.php
SeedCurrencies.getCurrencySymbol
private function getCurrencySymbol(string $currencyCode, string $locale): string { $formatter = new NumberFormatter($locale.'@currency='.$currencyCode, NumberFormatter::CURRENCY); return $formatter->getSymbol(NumberFormatter::CURRENCY_SYMBOL); }
php
private function getCurrencySymbol(string $currencyCode, string $locale): string { $formatter = new NumberFormatter($locale.'@currency='.$currencyCode, NumberFormatter::CURRENCY); return $formatter->getSymbol(NumberFormatter::CURRENCY_SYMBOL); }
[ "private", "function", "getCurrencySymbol", "(", "string", "$", "currencyCode", ",", "string", "$", "locale", ")", ":", "string", "{", "$", "formatter", "=", "new", "NumberFormatter", "(", "$", "locale", ".", "'@currency='", ".", "$", "currencyCode", ",", "N...
Get the symbol value for the given locale. @param string $currencyCode @param string $locale @return string
[ "Get", "the", "symbol", "value", "for", "the", "given", "locale", "." ]
train
https://github.com/faustbrian/Laravel-Countries/blob/3d72301acd37e7f351d9b991dba41807ab68362b/src/Console/Commands/SeedCurrencies.php#L65-L70
hudhaifas/silverstripe-dataobject-manager
src/View/DataObjectPageController.php
DataObjectPageController.ObjectSearchForm
public function ObjectSearchForm() { if ($this->hasMethod('getGoogleSiteSearchForm')) { return $this->getGoogleSiteSearchForm()->setTemplate('Form_GoogleSearch'); } $data = $this->request->getVars(); $form = Form::create( $this, 'ObjectSearchForm', F...
php
public function ObjectSearchForm() { if ($this->hasMethod('getGoogleSiteSearchForm')) { return $this->getGoogleSiteSearchForm()->setTemplate('Form_GoogleSearch'); } $data = $this->request->getVars(); $form = Form::create( $this, 'ObjectSearchForm', F...
[ "public", "function", "ObjectSearchForm", "(", ")", "{", "if", "(", "$", "this", "->", "hasMethod", "(", "'getGoogleSiteSearchForm'", ")", ")", "{", "return", "$", "this", "->", "getGoogleSiteSearchForm", "(", ")", "->", "setTemplate", "(", "'Form_GoogleSearch'"...
/ Forms
[ "/", "Forms" ]
train
https://github.com/hudhaifas/silverstripe-dataobject-manager/blob/a8ecaeee785da4d3cdb722e44b40b8eff96e1f82/src/View/DataObjectPageController.php#L312-L335
chriswoodford/foursquare-php
lib/TheTwelve/Foursquare/VenuesGateway.php
VenuesGateway.getVenue
public function getVenue($venueId) { $resource = '/venues/' . $venueId; $response = $this->makeApiRequest($resource); return $response->venue; }
php
public function getVenue($venueId) { $resource = '/venues/' . $venueId; $response = $this->makeApiRequest($resource); return $response->venue; }
[ "public", "function", "getVenue", "(", "$", "venueId", ")", "{", "$", "resource", "=", "'/venues/'", ".", "$", "venueId", ";", "$", "response", "=", "$", "this", "->", "makeApiRequest", "(", "$", "resource", ")", ";", "return", "$", "response", "->", "...
Get venue by ID @param string $venueId @return object
[ "Get", "venue", "by", "ID" ]
train
https://github.com/chriswoodford/foursquare-php/blob/edbfcba2993a101ead8f381394742a4689aec398/lib/TheTwelve/Foursquare/VenuesGateway.php#L12-L18
chriswoodford/foursquare-php
lib/TheTwelve/Foursquare/VenuesGateway.php
VenuesGateway.categories
public function categories() { $resource = '/venues/categories'; $response = $this->makeApiRequest($resource); if(property_exists($response, 'categories')) { return $response->categories; } return array(); }
php
public function categories() { $resource = '/venues/categories'; $response = $this->makeApiRequest($resource); if(property_exists($response, 'categories')) { return $response->categories; } return array(); }
[ "public", "function", "categories", "(", ")", "{", "$", "resource", "=", "'/venues/categories'", ";", "$", "response", "=", "$", "this", "->", "makeApiRequest", "(", "$", "resource", ")", ";", "if", "(", "property_exists", "(", "$", "response", ",", "'cate...
Returns a hierarchical list of categories applied to venues. When designing client applications, please download this list only once per session, but also avoid caching this data for longer than a week to avoid stale information. @return array
[ "Returns", "a", "hierarchical", "list", "of", "categories", "applied", "to", "venues", ".", "When", "designing", "client", "applications", "please", "download", "this", "list", "only", "once", "per", "session", "but", "also", "avoid", "caching", "this", "data", ...
train
https://github.com/chriswoodford/foursquare-php/blob/edbfcba2993a101ead8f381394742a4689aec398/lib/TheTwelve/Foursquare/VenuesGateway.php#L32-L42
chriswoodford/foursquare-php
lib/TheTwelve/Foursquare/VenuesGateway.php
VenuesGateway.managed
public function managed() { $resource = '/venues/managed'; $response = $this->makeApiRequest($resource); if(property_exists($response, 'venues')) { return $response->venues; } return array(); }
php
public function managed() { $resource = '/venues/managed'; $response = $this->makeApiRequest($resource); if(property_exists($response, 'venues')) { return $response->venues; } return array(); }
[ "public", "function", "managed", "(", ")", "{", "$", "resource", "=", "'/venues/managed'", ";", "$", "response", "=", "$", "this", "->", "makeApiRequest", "(", "$", "resource", ")", ";", "if", "(", "property_exists", "(", "$", "response", ",", "'venues'", ...
Get a list of venues the current user manages. @return array
[ "Get", "a", "list", "of", "venues", "the", "current", "user", "manages", "." ]
train
https://github.com/chriswoodford/foursquare-php/blob/edbfcba2993a101ead8f381394742a4689aec398/lib/TheTwelve/Foursquare/VenuesGateway.php#L51-L61
chriswoodford/foursquare-php
lib/TheTwelve/Foursquare/VenuesGateway.php
VenuesGateway.search
public function search(array $params = array()) { $resource = '/venues/search'; $response = $this->makeApiRequest($resource, $params); if(property_exists($response, 'venues')) { return $response->venues; } return array(); }
php
public function search(array $params = array()) { $resource = '/venues/search'; $response = $this->makeApiRequest($resource, $params); if(property_exists($response, 'venues')) { return $response->venues; } return array(); }
[ "public", "function", "search", "(", "array", "$", "params", "=", "array", "(", ")", ")", "{", "$", "resource", "=", "'/venues/search'", ";", "$", "response", "=", "$", "this", "->", "makeApiRequest", "(", "$", "resource", ",", "$", "params", ")", ";",...
Returns a list of venues near the current location, optionally matching a search term. @see https://developer.foursquare.com/docs/venues/search @param array $params @return array
[ "Returns", "a", "list", "of", "venues", "near", "the", "current", "location", "optionally", "matching", "a", "search", "term", "." ]
train
https://github.com/chriswoodford/foursquare-php/blob/edbfcba2993a101ead8f381394742a4689aec398/lib/TheTwelve/Foursquare/VenuesGateway.php#L69-L79
chriswoodford/foursquare-php
lib/TheTwelve/Foursquare/VenuesGateway.php
VenuesGateway.suggestCompletion
public function suggestCompletion(array $params = array()) { $resource = '/venues/suggestcompletion'; $response = $this->makeApiRequest($resource, $params); if(property_exists($response, 'minivenues')) { return $response->minivenues; } return array(); }
php
public function suggestCompletion(array $params = array()) { $resource = '/venues/suggestcompletion'; $response = $this->makeApiRequest($resource, $params); if(property_exists($response, 'minivenues')) { return $response->minivenues; } return array(); }
[ "public", "function", "suggestCompletion", "(", "array", "$", "params", "=", "array", "(", ")", ")", "{", "$", "resource", "=", "'/venues/suggestcompletion'", ";", "$", "response", "=", "$", "this", "->", "makeApiRequest", "(", "$", "resource", ",", "$", "...
Returns a list of mini-venues partially matching the search term, near the location. @see https://developer.foursquare.com/docs/venues/suggestcompletion @param array $params @return array
[ "Returns", "a", "list", "of", "mini", "-", "venues", "partially", "matching", "the", "search", "term", "near", "the", "location", "." ]
train
https://github.com/chriswoodford/foursquare-php/blob/edbfcba2993a101ead8f381394742a4689aec398/lib/TheTwelve/Foursquare/VenuesGateway.php#L87-L97
chriswoodford/foursquare-php
lib/TheTwelve/Foursquare/VenuesGateway.php
VenuesGateway.timeSeries
public function timeSeries(array $params = array()) { $resource = '/venues/timeseries'; $response = $this->makeApiRequest($resource, $params); if(property_exists($response, 'timeseries')) { return $response->timeseries; } return array(); }
php
public function timeSeries(array $params = array()) { $resource = '/venues/timeseries'; $response = $this->makeApiRequest($resource, $params); if(property_exists($response, 'timeseries')) { return $response->timeseries; } return array(); }
[ "public", "function", "timeSeries", "(", "array", "$", "params", "=", "array", "(", ")", ")", "{", "$", "resource", "=", "'/venues/timeseries'", ";", "$", "response", "=", "$", "this", "->", "makeApiRequest", "(", "$", "resource", ",", "$", "params", ")"...
Get daily venue stats for a list of venues over a time range. User must be venue manager. @see https://developer.foursquare.com/docs/venues/timeseries @param array $params @return array
[ "Get", "daily", "venue", "stats", "for", "a", "list", "of", "venues", "over", "a", "time", "range", ".", "User", "must", "be", "venue", "manager", "." ]
train
https://github.com/chriswoodford/foursquare-php/blob/edbfcba2993a101ead8f381394742a4689aec398/lib/TheTwelve/Foursquare/VenuesGateway.php#L106-L116
chriswoodford/foursquare-php
lib/TheTwelve/Foursquare/VenuesGateway.php
VenuesGateway.trending
public function trending(array $params = array()) { $resource = '/venues/trending'; $response = $this->makeApiRequest($resource, $params); if(property_exists($response, 'venues')) { return $response->venues; } return array(); }
php
public function trending(array $params = array()) { $resource = '/venues/trending'; $response = $this->makeApiRequest($resource, $params); if(property_exists($response, 'venues')) { return $response->venues; } return array(); }
[ "public", "function", "trending", "(", "array", "$", "params", "=", "array", "(", ")", ")", "{", "$", "resource", "=", "'/venues/trending'", ";", "$", "response", "=", "$", "this", "->", "makeApiRequest", "(", "$", "resource", ",", "$", "params", ")", ...
Returns a list of venues near the current location with the most people currently checked in. @see https://developer.foursquare.com/docs/venues/trending @param array $params @return array
[ "Returns", "a", "list", "of", "venues", "near", "the", "current", "location", "with", "the", "most", "people", "currently", "checked", "in", "." ]
train
https://github.com/chriswoodford/foursquare-php/blob/edbfcba2993a101ead8f381394742a4689aec398/lib/TheTwelve/Foursquare/VenuesGateway.php#L124-L134
chriswoodford/foursquare-php
lib/TheTwelve/Foursquare/VenuesGateway.php
VenuesGateway.events
public function events($venueId) { $resource = '/venues/' . $venueId . '/events'; $response = $this->makeApiRequest($resource); if(property_exists($response, 'events')) { return $response->events->items; } return array(); }
php
public function events($venueId) { $resource = '/venues/' . $venueId . '/events'; $response = $this->makeApiRequest($resource); if(property_exists($response, 'events')) { return $response->events->items; } return array(); }
[ "public", "function", "events", "(", "$", "venueId", ")", "{", "$", "resource", "=", "'/venues/'", ".", "$", "venueId", ".", "'/events'", ";", "$", "response", "=", "$", "this", "->", "makeApiRequest", "(", "$", "resource", ")", ";", "if", "(", "proper...
Allows you to access information about the current events at a place. @param string $venueId @return array
[ "Allows", "you", "to", "access", "information", "about", "the", "current", "events", "at", "a", "place", "." ]
train
https://github.com/chriswoodford/foursquare-php/blob/edbfcba2993a101ead8f381394742a4689aec398/lib/TheTwelve/Foursquare/VenuesGateway.php#L141-L153
chriswoodford/foursquare-php
lib/TheTwelve/Foursquare/VenuesGateway.php
VenuesGateway.hereNow
public function hereNow($venueId) { $resource = '/venues/' . $venueId . '/herenow'; $response = $this->makeApiRequest($resource); if(property_exists($response, 'hereNow')) { return $response->hereNow->count; } return 0; }
php
public function hereNow($venueId) { $resource = '/venues/' . $venueId . '/herenow'; $response = $this->makeApiRequest($resource); if(property_exists($response, 'hereNow')) { return $response->hereNow->count; } return 0; }
[ "public", "function", "hereNow", "(", "$", "venueId", ")", "{", "$", "resource", "=", "'/venues/'", ".", "$", "venueId", ".", "'/herenow'", ";", "$", "response", "=", "$", "this", "->", "makeApiRequest", "(", "$", "resource", ")", ";", "if", "(", "prop...
Provides a count of how many people are at a given venue. @param string $venueId @return int
[ "Provides", "a", "count", "of", "how", "many", "people", "are", "at", "a", "given", "venue", "." ]
train
https://github.com/chriswoodford/foursquare-php/blob/edbfcba2993a101ead8f381394742a4689aec398/lib/TheTwelve/Foursquare/VenuesGateway.php#L160-L172
chriswoodford/foursquare-php
lib/TheTwelve/Foursquare/VenuesGateway.php
VenuesGateway.hours
public function hours($venueId) { $resource = '/venues/' . $venueId . '/hours'; $response = $this->makeApiRequest($resource); return $response->hours; }
php
public function hours($venueId) { $resource = '/venues/' . $venueId . '/hours'; $response = $this->makeApiRequest($resource); return $response->hours; }
[ "public", "function", "hours", "(", "$", "venueId", ")", "{", "$", "resource", "=", "'/venues/'", ".", "$", "venueId", ".", "'/hours'", ";", "$", "response", "=", "$", "this", "->", "makeApiRequest", "(", "$", "resource", ")", ";", "return", "$", "resp...
Returns hours for a venue. @param string $venueId @return array
[ "Returns", "hours", "for", "a", "venue", "." ]
train
https://github.com/chriswoodford/foursquare-php/blob/edbfcba2993a101ead8f381394742a4689aec398/lib/TheTwelve/Foursquare/VenuesGateway.php#L179-L187
chriswoodford/foursquare-php
lib/TheTwelve/Foursquare/VenuesGateway.php
VenuesGateway.likes
public function likes($venueId) { $resource = '/venues/' . $venueId . '/likes'; $response = $this->makeApiRequest($resource); return $response->likes; }
php
public function likes($venueId) { $resource = '/venues/' . $venueId . '/likes'; $response = $this->makeApiRequest($resource); return $response->likes; }
[ "public", "function", "likes", "(", "$", "venueId", ")", "{", "$", "resource", "=", "'/venues/'", ".", "$", "venueId", ".", "'/likes'", ";", "$", "response", "=", "$", "this", "->", "makeApiRequest", "(", "$", "resource", ")", ";", "return", "$", "resp...
Returns friends and a total count of users who have liked this venue. @param string $venueId @return array
[ "Returns", "friends", "and", "a", "total", "count", "of", "users", "who", "have", "liked", "this", "venue", "." ]
train
https://github.com/chriswoodford/foursquare-php/blob/edbfcba2993a101ead8f381394742a4689aec398/lib/TheTwelve/Foursquare/VenuesGateway.php#L194-L202
chriswoodford/foursquare-php
lib/TheTwelve/Foursquare/VenuesGateway.php
VenuesGateway.links
public function links($venueId) { $resource = '/venues/' . $venueId . '/links'; $response = $this->makeApiRequest($resource); if(property_exists($response, 'links')) { return $response->links->items; } return array(); }
php
public function links($venueId) { $resource = '/venues/' . $venueId . '/links'; $response = $this->makeApiRequest($resource); if(property_exists($response, 'links')) { return $response->links->items; } return array(); }
[ "public", "function", "links", "(", "$", "venueId", ")", "{", "$", "resource", "=", "'/venues/'", ".", "$", "venueId", ".", "'/links'", ";", "$", "response", "=", "$", "this", "->", "makeApiRequest", "(", "$", "resource", ")", ";", "if", "(", "property...
Returns URLs or identifiers from third parties that have been applied to this venue. @param string $venueId @return array
[ "Returns", "URLs", "or", "identifiers", "from", "third", "parties", "that", "have", "been", "applied", "to", "this", "venue", "." ]
train
https://github.com/chriswoodford/foursquare-php/blob/edbfcba2993a101ead8f381394742a4689aec398/lib/TheTwelve/Foursquare/VenuesGateway.php#L209-L221
chriswoodford/foursquare-php
lib/TheTwelve/Foursquare/VenuesGateway.php
VenuesGateway.lists
public function lists($venueId) { $resource = '/venues/' . $venueId . '/listed'; $response = $this->makeApiRequest($resource); if(property_exists($response, 'lists')) { return $response->lists->groups; } return array(); }
php
public function lists($venueId) { $resource = '/venues/' . $venueId . '/listed'; $response = $this->makeApiRequest($resource); if(property_exists($response, 'lists')) { return $response->lists->groups; } return array(); }
[ "public", "function", "lists", "(", "$", "venueId", ")", "{", "$", "resource", "=", "'/venues/'", ".", "$", "venueId", ".", "'/listed'", ";", "$", "response", "=", "$", "this", "->", "makeApiRequest", "(", "$", "resource", ")", ";", "if", "(", "propert...
The lists that this venue appears on. @param string $venueId @return array
[ "The", "lists", "that", "this", "venue", "appears", "on", "." ]
train
https://github.com/chriswoodford/foursquare-php/blob/edbfcba2993a101ead8f381394742a4689aec398/lib/TheTwelve/Foursquare/VenuesGateway.php#L228-L240
chriswoodford/foursquare-php
lib/TheTwelve/Foursquare/VenuesGateway.php
VenuesGateway.nextVenues
public function nextVenues($venueId) { $resource = '/venues/' . $venueId . '/nextvenues'; $response = $this->makeApiRequest($resource); if(property_exists($response, 'nextVenues')) { return $response->nextVenues->items; } return array(); }
php
public function nextVenues($venueId) { $resource = '/venues/' . $venueId . '/nextvenues'; $response = $this->makeApiRequest($resource); if(property_exists($response, 'nextVenues')) { return $response->nextVenues->items; } return array(); }
[ "public", "function", "nextVenues", "(", "$", "venueId", ")", "{", "$", "resource", "=", "'/venues/'", ".", "$", "venueId", ".", "'/nextvenues'", ";", "$", "response", "=", "$", "this", "->", "makeApiRequest", "(", "$", "resource", ")", ";", "if", "(", ...
Returns venues that people often check in to after the current venue. @param $venueId @return array
[ "Returns", "venues", "that", "people", "often", "check", "in", "to", "after", "the", "current", "venue", "." ]
train
https://github.com/chriswoodford/foursquare-php/blob/edbfcba2993a101ead8f381394742a4689aec398/lib/TheTwelve/Foursquare/VenuesGateway.php#L250-L262
chriswoodford/foursquare-php
lib/TheTwelve/Foursquare/VenuesGateway.php
VenuesGateway.photos
public function photos($venueId) { $resource = '/venues/' . $venueId . '/photos'; $response = $this->makeApiRequest($resource); if(property_exists($response, 'photos')) { return $response->photos->items; } return array(); }
php
public function photos($venueId) { $resource = '/venues/' . $venueId . '/photos'; $response = $this->makeApiRequest($resource); if(property_exists($response, 'photos')) { return $response->photos->items; } return array(); }
[ "public", "function", "photos", "(", "$", "venueId", ")", "{", "$", "resource", "=", "'/venues/'", ".", "$", "venueId", ".", "'/photos'", ";", "$", "response", "=", "$", "this", "->", "makeApiRequest", "(", "$", "resource", ")", ";", "if", "(", "proper...
Returns photos for a venue. @param $venueId @return array
[ "Returns", "photos", "for", "a", "venue", "." ]
train
https://github.com/chriswoodford/foursquare-php/blob/edbfcba2993a101ead8f381394742a4689aec398/lib/TheTwelve/Foursquare/VenuesGateway.php#L269-L281
chriswoodford/foursquare-php
lib/TheTwelve/Foursquare/VenuesGateway.php
VenuesGateway.similar
public function similar($venueId) { $resource = '/venues/' . $venueId . '/similar'; $response = $this->makeApiRequest($resource); if(property_exists($response, 'similarVenues')) { return $response->similarVenues->items; } return array(); }
php
public function similar($venueId) { $resource = '/venues/' . $venueId . '/similar'; $response = $this->makeApiRequest($resource); if(property_exists($response, 'similarVenues')) { return $response->similarVenues->items; } return array(); }
[ "public", "function", "similar", "(", "$", "venueId", ")", "{", "$", "resource", "=", "'/venues/'", ".", "$", "venueId", ".", "'/similar'", ";", "$", "response", "=", "$", "this", "->", "makeApiRequest", "(", "$", "resource", ")", ";", "if", "(", "prop...
Returns a list of venues similar to the specified venue. @param $venueId @return array
[ "Returns", "a", "list", "of", "venues", "similar", "to", "the", "specified", "venue", "." ]
train
https://github.com/chriswoodford/foursquare-php/blob/edbfcba2993a101ead8f381394742a4689aec398/lib/TheTwelve/Foursquare/VenuesGateway.php#L288-L300
chriswoodford/foursquare-php
lib/TheTwelve/Foursquare/VenuesGateway.php
VenuesGateway.stats
public function stats($venueId) { $resource = '/venues/' . $venueId . '/stats'; $response = $this->makeApiRequest($resource); if(property_exists($response, 'stats')) { return $response->stats; } return array(); }
php
public function stats($venueId) { $resource = '/venues/' . $venueId . '/stats'; $response = $this->makeApiRequest($resource); if(property_exists($response, 'stats')) { return $response->stats; } return array(); }
[ "public", "function", "stats", "(", "$", "venueId", ")", "{", "$", "resource", "=", "'/venues/'", ".", "$", "venueId", ".", "'/stats'", ";", "$", "response", "=", "$", "this", "->", "makeApiRequest", "(", "$", "resource", ")", ";", "if", "(", "property...
Get venue stats over a given time range. Only available to the manager of a venue. User must be venue manager. @param $venueId @return array
[ "Get", "venue", "stats", "over", "a", "given", "time", "range", ".", "Only", "available", "to", "the", "manager", "of", "a", "venue", ".", "User", "must", "be", "venue", "manager", "." ]
train
https://github.com/chriswoodford/foursquare-php/blob/edbfcba2993a101ead8f381394742a4689aec398/lib/TheTwelve/Foursquare/VenuesGateway.php#L308-L320
chriswoodford/foursquare-php
lib/TheTwelve/Foursquare/VenuesGateway.php
VenuesGateway.tips
public function tips($venueId) { $resource = '/venues/' . $venueId . '/tips'; $response = $this->makeApiRequest($resource); if(property_exists($response, 'tips')) { return $response->tips->items; } return array(); }
php
public function tips($venueId) { $resource = '/venues/' . $venueId . '/tips'; $response = $this->makeApiRequest($resource); if(property_exists($response, 'tips')) { return $response->tips->items; } return array(); }
[ "public", "function", "tips", "(", "$", "venueId", ")", "{", "$", "resource", "=", "'/venues/'", ".", "$", "venueId", ".", "'/tips'", ";", "$", "response", "=", "$", "this", "->", "makeApiRequest", "(", "$", "resource", ")", ";", "if", "(", "property_e...
Returns tips for a venue. @param $venueId @return array
[ "Returns", "tips", "for", "a", "venue", "." ]
train
https://github.com/chriswoodford/foursquare-php/blob/edbfcba2993a101ead8f381394742a4689aec398/lib/TheTwelve/Foursquare/VenuesGateway.php#L327-L339
dengyongbin/loopeer-lib
src/Services/pingpp_sdk/Pingpp/Object.php
Pingpp_Object.constructFrom
public static function constructFrom($values, $apiKey=null) { $class = get_class($this); return self::scopedConstructFrom($class, $values, $apiKey); }
php
public static function constructFrom($values, $apiKey=null) { $class = get_class($this); return self::scopedConstructFrom($class, $values, $apiKey); }
[ "public", "static", "function", "constructFrom", "(", "$", "values", ",", "$", "apiKey", "=", "null", ")", "{", "$", "class", "=", "get_class", "(", "$", "this", ")", ";", "return", "self", "::", "scopedConstructFrom", "(", "$", "class", ",", "$", "val...
@param stdObject $values @param string|null $apiKey @return Pingpp_Object The object of the same class as $this constructed from the given values.
[ "@param", "stdObject", "$values", "@param", "string|null", "$apiKey" ]
train
https://github.com/dengyongbin/loopeer-lib/blob/4609338f6a48666ca96ee380509a5b5cb066808f/src/Services/pingpp_sdk/Pingpp/Object.php#L148-L152
dengyongbin/loopeer-lib
src/Services/pingpp_sdk/Pingpp/Object.php
Pingpp_Object.refreshFrom
public function refreshFrom($values, $apiKey, $partial=false) { $this->_apiKey = $apiKey; // Wipe old state before setting new. This is useful for e.g. updating a // customer, where there is no persistent card parameter. Mark those values // which don't persist as transient ...
php
public function refreshFrom($values, $apiKey, $partial=false) { $this->_apiKey = $apiKey; // Wipe old state before setting new. This is useful for e.g. updating a // customer, where there is no persistent card parameter. Mark those values // which don't persist as transient ...
[ "public", "function", "refreshFrom", "(", "$", "values", ",", "$", "apiKey", ",", "$", "partial", "=", "false", ")", "{", "$", "this", "->", "_apiKey", "=", "$", "apiKey", ";", "// Wipe old state before setting new. This is useful for e.g. updating a", "// customer...
Refreshes this object using the provided values. @param stdObject $values @param string $apiKey @param boolean $partial Defaults to false.
[ "Refreshes", "this", "object", "using", "the", "provided", "values", "." ]
train
https://github.com/dengyongbin/loopeer-lib/blob/4609338f6a48666ca96ee380509a5b5cb066808f/src/Services/pingpp_sdk/Pingpp/Object.php#L161-L191
FrenchFrogs/framework
src/Renderer/Renderer.php
Renderer.addRenderer
public function addRenderer($index, $method = null) { $this->renderers[$index] = is_null($method) ? $index : $method; return $this; }
php
public function addRenderer($index, $method = null) { $this->renderers[$index] = is_null($method) ? $index : $method; return $this; }
[ "public", "function", "addRenderer", "(", "$", "index", ",", "$", "method", "=", "null", ")", "{", "$", "this", "->", "renderers", "[", "$", "index", "]", "=", "is_null", "(", "$", "method", ")", "?", "$", "index", ":", "$", "method", ";", "return"...
Add a single renderer to the renderers container @param $index @param $method @return $this
[ "Add", "a", "single", "renderer", "to", "the", "renderers", "container" ]
train
https://github.com/FrenchFrogs/framework/blob/a4838c698a5600437e87dac6d35ba8ebe32c4395/src/Renderer/Renderer.php#L77-L81
FrenchFrogs/framework
src/Renderer/Renderer.php
Renderer.getRenderer
public function getRenderer($index) { if (!$this->hasRenderer($index)) { throw new \Exception('Renderer not found : ' . $index); } return $this->renderers[$index]; }
php
public function getRenderer($index) { if (!$this->hasRenderer($index)) { throw new \Exception('Renderer not found : ' . $index); } return $this->renderers[$index]; }
[ "public", "function", "getRenderer", "(", "$", "index", ")", "{", "if", "(", "!", "$", "this", "->", "hasRenderer", "(", "$", "index", ")", ")", "{", "throw", "new", "\\", "Exception", "(", "'Renderer not found : '", ".", "$", "index", ")", ";", "}", ...
Return the renderer $index from the filters renderer container @return mixed Callable | string
[ "Return", "the", "renderer", "$index", "from", "the", "filters", "renderer", "container" ]
train
https://github.com/FrenchFrogs/framework/blob/a4838c698a5600437e87dac6d35ba8ebe32c4395/src/Renderer/Renderer.php#L127-L134
FrenchFrogs/framework
src/Renderer/Renderer.php
Renderer.render
public function render($index , ...$params) { $renderer = $this->getRenderer($index); // If it's a anonymous function if (!is_string($renderer) && is_callable($renderer)) { $render = call_user_func_array($renderer, $params); // if it's a local method } els...
php
public function render($index , ...$params) { $renderer = $this->getRenderer($index); // If it's a anonymous function if (!is_string($renderer) && is_callable($renderer)) { $render = call_user_func_array($renderer, $params); // if it's a local method } els...
[ "public", "function", "render", "(", "$", "index", ",", "...", "$", "params", ")", "{", "$", "renderer", "=", "$", "this", "->", "getRenderer", "(", "$", "index", ")", ";", "// If it's a anonymous function", "if", "(", "!", "is_string", "(", "$", "render...
Render element @param ...$params @return mixed
[ "Render", "element" ]
train
https://github.com/FrenchFrogs/framework/blob/a4838c698a5600437e87dac6d35ba8ebe32c4395/src/Renderer/Renderer.php#L154-L174
yosmanyga/resource
src/Yosmanyga/Resource/Reader/Iterator/DirectoryReader.php
DirectoryReader.supports
public function supports(Resource $resource) { if ($resource->hasType()) { if ('directory' == $resource->getType()) { return true; } return false; } if (!$resource->hasMetadata('dir') || !$resource->hasMetadata('type')) { retu...
php
public function supports(Resource $resource) { if ($resource->hasType()) { if ('directory' == $resource->getType()) { return true; } return false; } if (!$resource->hasMetadata('dir') || !$resource->hasMetadata('type')) { retu...
[ "public", "function", "supports", "(", "Resource", "$", "resource", ")", "{", "if", "(", "$", "resource", "->", "hasType", "(", ")", ")", "{", "if", "(", "'directory'", "==", "$", "resource", "->", "getType", "(", ")", ")", "{", "return", "true", ";"...
{@inheritdoc}
[ "{" ]
train
https://github.com/yosmanyga/resource/blob/a8b505c355920a908917a0484f764ddfa63205fa/src/Yosmanyga/Resource/Reader/Iterator/DirectoryReader.php#L50-L65
yosmanyga/resource
src/Yosmanyga/Resource/Reader/Iterator/DirectoryReader.php
DirectoryReader.open
public function open(Resource $resource) { $this->resource = $resource; $this->prepareFinder(); $resource = $this->convertResource($resource, $this->iterator->current()); $this->delegatorReader->open($resource); }
php
public function open(Resource $resource) { $this->resource = $resource; $this->prepareFinder(); $resource = $this->convertResource($resource, $this->iterator->current()); $this->delegatorReader->open($resource); }
[ "public", "function", "open", "(", "Resource", "$", "resource", ")", "{", "$", "this", "->", "resource", "=", "$", "resource", ";", "$", "this", "->", "prepareFinder", "(", ")", ";", "$", "resource", "=", "$", "this", "->", "convertResource", "(", "$",...
{@inheritdoc}
[ "{" ]
train
https://github.com/yosmanyga/resource/blob/a8b505c355920a908917a0484f764ddfa63205fa/src/Yosmanyga/Resource/Reader/Iterator/DirectoryReader.php#L70-L77
yosmanyga/resource
src/Yosmanyga/Resource/Reader/Iterator/DirectoryReader.php
DirectoryReader.current
public function current() { $current = $this->delegatorReader->current(); if (!$current) { $this->iterator->next(); if (!$this->iterator->valid()) { return false; } $resource = $this->convertResource($this->resource, $this->iterator->...
php
public function current() { $current = $this->delegatorReader->current(); if (!$current) { $this->iterator->next(); if (!$this->iterator->valid()) { return false; } $resource = $this->convertResource($this->resource, $this->iterator->...
[ "public", "function", "current", "(", ")", "{", "$", "current", "=", "$", "this", "->", "delegatorReader", "->", "current", "(", ")", ";", "if", "(", "!", "$", "current", ")", "{", "$", "this", "->", "iterator", "->", "next", "(", ")", ";", "if", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/yosmanyga/resource/blob/a8b505c355920a908917a0484f764ddfa63205fa/src/Yosmanyga/Resource/Reader/Iterator/DirectoryReader.php#L82-L99
yosmanyga/resource
src/Yosmanyga/Resource/Reader/Iterator/DirectoryReader.php
DirectoryReader.convertResource
private function convertResource(Resource $resource, \SplFileInfo $file) { return new Resource( array_merge( $resource->getMetadata(), [ 'file' => $file->getRealpath(), ] ), $resource->getMetadata('type')...
php
private function convertResource(Resource $resource, \SplFileInfo $file) { return new Resource( array_merge( $resource->getMetadata(), [ 'file' => $file->getRealpath(), ] ), $resource->getMetadata('type')...
[ "private", "function", "convertResource", "(", "Resource", "$", "resource", ",", "\\", "SplFileInfo", "$", "file", ")", "{", "return", "new", "Resource", "(", "array_merge", "(", "$", "resource", "->", "getMetadata", "(", ")", ",", "[", "'file'", "=>", "$"...
@param \Yosmanyga\Resource\Resource $resource @param \SplFileInfo $file @return \Yosmanyga\Resource\Resource
[ "@param", "\\", "Yosmanyga", "\\", "Resource", "\\", "Resource", "$resource", "@param", "\\", "SplFileInfo", "$file" ]
train
https://github.com/yosmanyga/resource/blob/a8b505c355920a908917a0484f764ddfa63205fa/src/Yosmanyga/Resource/Reader/Iterator/DirectoryReader.php#L148-L159
codeburnerframework/router
src/Parser.php
Parser.parsePattern
public function parsePattern($pattern) { $withoutClosing = rtrim($pattern, "]"); $closingNumber = strlen($pattern) - strlen($withoutClosing); $segments = preg_split("~" . self::DYNAMIC_REGEX . "(*SKIP)(*F)|\[~x", $withoutClosing); $this->parseSegments($segments, $closingNumber, $wi...
php
public function parsePattern($pattern) { $withoutClosing = rtrim($pattern, "]"); $closingNumber = strlen($pattern) - strlen($withoutClosing); $segments = preg_split("~" . self::DYNAMIC_REGEX . "(*SKIP)(*F)|\[~x", $withoutClosing); $this->parseSegments($segments, $closingNumber, $wi...
[ "public", "function", "parsePattern", "(", "$", "pattern", ")", "{", "$", "withoutClosing", "=", "rtrim", "(", "$", "pattern", ",", "\"]\"", ")", ";", "$", "closingNumber", "=", "strlen", "(", "$", "pattern", ")", "-", "strlen", "(", "$", "withoutClosing...
Separate routes pattern with optional parts into n new patterns. @param string $pattern @throws BadRouteException @return array
[ "Separate", "routes", "pattern", "with", "optional", "parts", "into", "n", "new", "patterns", "." ]
train
https://github.com/codeburnerframework/router/blob/2b0e8030303dd08d3fadfc4c57aa37b184a408cd/src/Parser.php#L61-L70
codeburnerframework/router
src/Parser.php
Parser.parseSegments
protected function parseSegments(array $segments, $closingNumber, $withoutClosing) { if ($closingNumber !== count($segments) - 1) { if (preg_match("~" . self::DYNAMIC_REGEX . "(*SKIP)(*F)|\]~x", $withoutClosing)) { throw new BadRouteException(BadRouteException::OPTIONAL_SEGMEN...
php
protected function parseSegments(array $segments, $closingNumber, $withoutClosing) { if ($closingNumber !== count($segments) - 1) { if (preg_match("~" . self::DYNAMIC_REGEX . "(*SKIP)(*F)|\]~x", $withoutClosing)) { throw new BadRouteException(BadRouteException::OPTIONAL_SEGMEN...
[ "protected", "function", "parseSegments", "(", "array", "$", "segments", ",", "$", "closingNumber", ",", "$", "withoutClosing", ")", "{", "if", "(", "$", "closingNumber", "!==", "count", "(", "$", "segments", ")", "-", "1", ")", "{", "if", "(", "preg_mat...
Parse all the possible patterns seeking for an incorrect or incompatible pattern. @param string[] $segments Segments are all the possible patterns made on top of a pattern with optional segments. @param int $closingNumber The count of optional segments. @param string $withoutClosing The pattern without t...
[ "Parse", "all", "the", "possible", "patterns", "seeking", "for", "an", "incorrect", "or", "incompatible", "pattern", "." ]
train
https://github.com/codeburnerframework/router/blob/2b0e8030303dd08d3fadfc4c57aa37b184a408cd/src/Parser.php#L82-L89
codeburnerframework/router
src/Parser.php
Parser.buildSegments
protected function buildSegments(array $segments) { $pattern = ""; $patterns = []; $wildcardTokens = array_keys($this->wildcards); $wildcardRegex = $this->wildcards; foreach ($segments as $n => $segment) { if ($segment === "" && $n !== 0) { thro...
php
protected function buildSegments(array $segments) { $pattern = ""; $patterns = []; $wildcardTokens = array_keys($this->wildcards); $wildcardRegex = $this->wildcards; foreach ($segments as $n => $segment) { if ($segment === "" && $n !== 0) { thro...
[ "protected", "function", "buildSegments", "(", "array", "$", "segments", ")", "{", "$", "pattern", "=", "\"\"", ";", "$", "patterns", "=", "[", "]", ";", "$", "wildcardTokens", "=", "array_keys", "(", "$", "this", "->", "wildcards", ")", ";", "$", "wil...
@param string[] $segments @throws BadRouteException @return array
[ "@param", "string", "[]", "$segments" ]
train
https://github.com/codeburnerframework/router/blob/2b0e8030303dd08d3fadfc4c57aa37b184a408cd/src/Parser.php#L98-L114
phpalchemy/cerberus
src/Alchemy/Component/Cerberus/Model/Map/UserRoleTableMap.php
UserRoleTableMap.getPrimaryKeyHashFromRow
public static function getPrimaryKeyHashFromRow($row, $offset = 0, $indexType = TableMap::TYPE_NUM) { // If the PK cannot be derived from the row, return NULL. if ($row[TableMap::TYPE_NUM == $indexType ? 0 + $offset : static::translateFieldName('UserId', TableMap::TYPE_PHPNAME, $indexType)] === null...
php
public static function getPrimaryKeyHashFromRow($row, $offset = 0, $indexType = TableMap::TYPE_NUM) { // If the PK cannot be derived from the row, return NULL. if ($row[TableMap::TYPE_NUM == $indexType ? 0 + $offset : static::translateFieldName('UserId', TableMap::TYPE_PHPNAME, $indexType)] === null...
[ "public", "static", "function", "getPrimaryKeyHashFromRow", "(", "$", "row", ",", "$", "offset", "=", "0", ",", "$", "indexType", "=", "TableMap", "::", "TYPE_NUM", ")", "{", "// If the PK cannot be derived from the row, return NULL.", "if", "(", "$", "row", "[", ...
Retrieves a string version of the primary key from the DB resultset row that can be used to uniquely identify a row in this table. For tables with a single-column primary key, that simple pkey value will be returned. For tables with a multi-column primary key, a serialize()d version of the primary key will be returne...
[ "Retrieves", "a", "string", "version", "of", "the", "primary", "key", "from", "the", "DB", "resultset", "row", "that", "can", "be", "used", "to", "uniquely", "identify", "a", "row", "in", "this", "table", "." ]
train
https://github.com/phpalchemy/cerberus/blob/3424a360c9bded71eb5b570bc114a7759cb23ec6/src/Alchemy/Component/Cerberus/Model/Map/UserRoleTableMap.php#L215-L223
phpalchemy/cerberus
src/Alchemy/Component/Cerberus/Model/Map/UserRoleTableMap.php
UserRoleTableMap.addSelectColumns
public static function addSelectColumns(Criteria $criteria, $alias = null) { if (null === $alias) { $criteria->addSelectColumn(UserRoleTableMap::COL_USER_ID); $criteria->addSelectColumn(UserRoleTableMap::COL_ROLE_ID); } else { $criteria->addSelectColumn($alias . '...
php
public static function addSelectColumns(Criteria $criteria, $alias = null) { if (null === $alias) { $criteria->addSelectColumn(UserRoleTableMap::COL_USER_ID); $criteria->addSelectColumn(UserRoleTableMap::COL_ROLE_ID); } else { $criteria->addSelectColumn($alias . '...
[ "public", "static", "function", "addSelectColumns", "(", "Criteria", "$", "criteria", ",", "$", "alias", "=", "null", ")", "{", "if", "(", "null", "===", "$", "alias", ")", "{", "$", "criteria", "->", "addSelectColumn", "(", "UserRoleTableMap", "::", "COL_...
Add all the columns needed to create a new object. Note: any columns that were marked with lazyLoad="true" in the XML schema will not be added to the select list and only loaded on demand. @param Criteria $criteria object containing the columns to add. @param string $alias optional table alias @throws PropelExce...
[ "Add", "all", "the", "columns", "needed", "to", "create", "a", "new", "object", "." ]
train
https://github.com/phpalchemy/cerberus/blob/3424a360c9bded71eb5b570bc114a7759cb23ec6/src/Alchemy/Component/Cerberus/Model/Map/UserRoleTableMap.php#L349-L358
phpalchemy/cerberus
src/Alchemy/Component/Cerberus/Model/Map/UserRoleTableMap.php
UserRoleTableMap.buildTableMap
public static function buildTableMap() { $dbMap = Propel::getServiceContainer()->getDatabaseMap(UserRoleTableMap::DATABASE_NAME); if (!$dbMap->hasTable(UserRoleTableMap::TABLE_NAME)) { $dbMap->addTableObject(new UserRoleTableMap()); } }
php
public static function buildTableMap() { $dbMap = Propel::getServiceContainer()->getDatabaseMap(UserRoleTableMap::DATABASE_NAME); if (!$dbMap->hasTable(UserRoleTableMap::TABLE_NAME)) { $dbMap->addTableObject(new UserRoleTableMap()); } }
[ "public", "static", "function", "buildTableMap", "(", ")", "{", "$", "dbMap", "=", "Propel", "::", "getServiceContainer", "(", ")", "->", "getDatabaseMap", "(", "UserRoleTableMap", "::", "DATABASE_NAME", ")", ";", "if", "(", "!", "$", "dbMap", "->", "hasTabl...
Add a TableMap instance to the database for this tableMap class.
[ "Add", "a", "TableMap", "instance", "to", "the", "database", "for", "this", "tableMap", "class", "." ]
train
https://github.com/phpalchemy/cerberus/blob/3424a360c9bded71eb5b570bc114a7759cb23ec6/src/Alchemy/Component/Cerberus/Model/Map/UserRoleTableMap.php#L375-L381
phpalchemy/cerberus
src/Alchemy/Component/Cerberus/Model/Map/UserRoleTableMap.php
UserRoleTableMap.doDelete
public static function doDelete($values, ConnectionInterface $con = null) { if (null === $con) { $con = Propel::getServiceContainer()->getWriteConnection(UserRoleTableMap::DATABASE_NAME); } if ($values instanceof Criteria) { // rename for clarity $criter...
php
public static function doDelete($values, ConnectionInterface $con = null) { if (null === $con) { $con = Propel::getServiceContainer()->getWriteConnection(UserRoleTableMap::DATABASE_NAME); } if ($values instanceof Criteria) { // rename for clarity $criter...
[ "public", "static", "function", "doDelete", "(", "$", "values", ",", "ConnectionInterface", "$", "con", "=", "null", ")", "{", "if", "(", "null", "===", "$", "con", ")", "{", "$", "con", "=", "Propel", "::", "getServiceContainer", "(", ")", "->", "getW...
Performs a DELETE on the database, given a UserRole or Criteria object OR a primary key value. @param mixed $values Criteria or UserRole object or primary key or array of primary keys which is used to create the DELETE statement @param ConnectionInterface $con the connection to use @return int ...
[ "Performs", "a", "DELETE", "on", "the", "database", "given", "a", "UserRole", "or", "Criteria", "object", "OR", "a", "primary", "key", "value", "." ]
train
https://github.com/phpalchemy/cerberus/blob/3424a360c9bded71eb5b570bc114a7759cb23ec6/src/Alchemy/Component/Cerberus/Model/Map/UserRoleTableMap.php#L394-L432
phpalchemy/cerberus
src/Alchemy/Component/Cerberus/Model/Map/UserRoleTableMap.php
UserRoleTableMap.doInsert
public static function doInsert($criteria, ConnectionInterface $con = null) { if (null === $con) { $con = Propel::getServiceContainer()->getWriteConnection(UserRoleTableMap::DATABASE_NAME); } if ($criteria instanceof Criteria) { $criteria = clone $criteria; // rename...
php
public static function doInsert($criteria, ConnectionInterface $con = null) { if (null === $con) { $con = Propel::getServiceContainer()->getWriteConnection(UserRoleTableMap::DATABASE_NAME); } if ($criteria instanceof Criteria) { $criteria = clone $criteria; // rename...
[ "public", "static", "function", "doInsert", "(", "$", "criteria", ",", "ConnectionInterface", "$", "con", "=", "null", ")", "{", "if", "(", "null", "===", "$", "con", ")", "{", "$", "con", "=", "Propel", "::", "getServiceContainer", "(", ")", "->", "ge...
Performs an INSERT on the database, given a UserRole or Criteria object. @param mixed $criteria Criteria or UserRole object containing data that is used to create the INSERT statement. @param ConnectionInterface $con the ConnectionInterface connection to use @return mixed The new primary key. @...
[ "Performs", "an", "INSERT", "on", "the", "database", "given", "a", "UserRole", "or", "Criteria", "object", "." ]
train
https://github.com/phpalchemy/cerberus/blob/3424a360c9bded71eb5b570bc114a7759cb23ec6/src/Alchemy/Component/Cerberus/Model/Map/UserRoleTableMap.php#L454-L475
hrevert/HtUserRegistration
src/Mailer/Mailer.php
Mailer.sendVerificationEmail
public function sendVerificationEmail(UserRegistrationInterface $registrationRecord) { $this->sendMail( $registrationRecord, $this->options->getVerificationEmailSubject(), $this->options->getVerificationEmailTemplate() ); }
php
public function sendVerificationEmail(UserRegistrationInterface $registrationRecord) { $this->sendMail( $registrationRecord, $this->options->getVerificationEmailSubject(), $this->options->getVerificationEmailTemplate() ); }
[ "public", "function", "sendVerificationEmail", "(", "UserRegistrationInterface", "$", "registrationRecord", ")", "{", "$", "this", "->", "sendMail", "(", "$", "registrationRecord", ",", "$", "this", "->", "options", "->", "getVerificationEmailSubject", "(", ")", ","...
{@inheritDoc}
[ "{" ]
train
https://github.com/hrevert/HtUserRegistration/blob/6b4a0cc364153757290ab5eed9ffafe1228f3bd6/src/Mailer/Mailer.php#L35-L42
hrevert/HtUserRegistration
src/Mailer/Mailer.php
Mailer.sendPasswordRequestEmail
public function sendPasswordRequestEmail(UserRegistrationInterface $registrationRecord) { $this->sendMail( $registrationRecord, $this->options->getPasswordRequestEmailSubject(), $this->options->getPasswordRequestEmailTemplate() ); }
php
public function sendPasswordRequestEmail(UserRegistrationInterface $registrationRecord) { $this->sendMail( $registrationRecord, $this->options->getPasswordRequestEmailSubject(), $this->options->getPasswordRequestEmailTemplate() ); }
[ "public", "function", "sendPasswordRequestEmail", "(", "UserRegistrationInterface", "$", "registrationRecord", ")", "{", "$", "this", "->", "sendMail", "(", "$", "registrationRecord", ",", "$", "this", "->", "options", "->", "getPasswordRequestEmailSubject", "(", ")",...
{@inheritDoc}
[ "{" ]
train
https://github.com/hrevert/HtUserRegistration/blob/6b4a0cc364153757290ab5eed9ffafe1228f3bd6/src/Mailer/Mailer.php#L47-L54
hrevert/HtUserRegistration
src/Mailer/Mailer.php
Mailer.sendMail
protected function sendMail(UserRegistrationInterface $registrationRecord, $subject, $template) { $user = $registrationRecord->getUser(); $message = $this->mailService->compose( ['to' => $user->getEmail()], $template, ['user' => $user, 'registrationRecord' => $r...
php
protected function sendMail(UserRegistrationInterface $registrationRecord, $subject, $template) { $user = $registrationRecord->getUser(); $message = $this->mailService->compose( ['to' => $user->getEmail()], $template, ['user' => $user, 'registrationRecord' => $r...
[ "protected", "function", "sendMail", "(", "UserRegistrationInterface", "$", "registrationRecord", ",", "$", "subject", ",", "$", "template", ")", "{", "$", "user", "=", "$", "registrationRecord", "->", "getUser", "(", ")", ";", "$", "message", "=", "$", "thi...
Sends mail @param UserRegistrationInterface $registrationRecord @param string $subject @param string $template
[ "Sends", "mail" ]
train
https://github.com/hrevert/HtUserRegistration/blob/6b4a0cc364153757290ab5eed9ffafe1228f3bd6/src/Mailer/Mailer.php#L63-L80
acasademont/wurfl
WURFL/Logger/LoggerFactory.php
WURFL_Logger_LoggerFactory.createUndetectedDeviceLogger
public static function createUndetectedDeviceLogger($wurflConfig=null) { if (self::isLoggingConfigured($wurflConfig)) { return self::createFileLogger($wurflConfig, "undetected_devices.log"); } return new WURFL_Logger_NullLogger(); }
php
public static function createUndetectedDeviceLogger($wurflConfig=null) { if (self::isLoggingConfigured($wurflConfig)) { return self::createFileLogger($wurflConfig, "undetected_devices.log"); } return new WURFL_Logger_NullLogger(); }
[ "public", "static", "function", "createUndetectedDeviceLogger", "(", "$", "wurflConfig", "=", "null", ")", "{", "if", "(", "self", "::", "isLoggingConfigured", "(", "$", "wurflConfig", ")", ")", "{", "return", "self", "::", "createFileLogger", "(", "$", "wurfl...
Create Logger for undetected devices with filename undetected_devices.log @param WURFL_Configuration_Config $wurflConfig @return WURFL_Logger_Interface Logger object
[ "Create", "Logger", "for", "undetected", "devices", "with", "filename", "undetected_devices", ".", "log" ]
train
https://github.com/acasademont/wurfl/blob/0f4fb6e06b452ba95ad1d15e7d8226d0974b60c2/WURFL/Logger/LoggerFactory.php#L30-L36
acasademont/wurfl
WURFL/Logger/LoggerFactory.php
WURFL_Logger_LoggerFactory.create
public static function create($wurflConfig=null) { if (self::isLoggingConfigured($wurflConfig)) { return self::createFileLogger($wurflConfig, "wurfl.log"); } return new WURFL_Logger_NullLogger(); }
php
public static function create($wurflConfig=null) { if (self::isLoggingConfigured($wurflConfig)) { return self::createFileLogger($wurflConfig, "wurfl.log"); } return new WURFL_Logger_NullLogger(); }
[ "public", "static", "function", "create", "(", "$", "wurflConfig", "=", "null", ")", "{", "if", "(", "self", "::", "isLoggingConfigured", "(", "$", "wurflConfig", ")", ")", "{", "return", "self", "::", "createFileLogger", "(", "$", "wurflConfig", ",", "\"w...
Creates Logger for general logging (not undetected devices) @param WURFL_Configuration_Config $wurflConfig @return WURFL_Logger_Interface Logger object
[ "Creates", "Logger", "for", "general", "logging", "(", "not", "undetected", "devices", ")" ]
train
https://github.com/acasademont/wurfl/blob/0f4fb6e06b452ba95ad1d15e7d8226d0974b60c2/WURFL/Logger/LoggerFactory.php#L43-L49
acasademont/wurfl
WURFL/Logger/LoggerFactory.php
WURFL_Logger_LoggerFactory.createFileLogger
private static function createFileLogger($wurflConfig, $fileName) { $logFileName = self::createLogFile($wurflConfig->logDir, $fileName); return new WURFL_Logger_FileLogger($logFileName); }
php
private static function createFileLogger($wurflConfig, $fileName) { $logFileName = self::createLogFile($wurflConfig->logDir, $fileName); return new WURFL_Logger_FileLogger($logFileName); }
[ "private", "static", "function", "createFileLogger", "(", "$", "wurflConfig", ",", "$", "fileName", ")", "{", "$", "logFileName", "=", "self", "::", "createLogFile", "(", "$", "wurflConfig", "->", "logDir", ",", "$", "fileName", ")", ";", "return", "new", ...
Creates a new file logger @param WURFL_Configuration_Config $wurflConfig @param string $fileName @return WURFL_Logger_FileLogger File logger
[ "Creates", "a", "new", "file", "logger" ]
train
https://github.com/acasademont/wurfl/blob/0f4fb6e06b452ba95ad1d15e7d8226d0974b60c2/WURFL/Logger/LoggerFactory.php#L57-L61
acasademont/wurfl
WURFL/Logger/LoggerFactory.php
WURFL_Logger_LoggerFactory.isLoggingConfigured
private static function isLoggingConfigured($wurflConfig) { if (is_null($wurflConfig)) { return false; } return !is_null($wurflConfig->logDir) && is_writable($wurflConfig->logDir); }
php
private static function isLoggingConfigured($wurflConfig) { if (is_null($wurflConfig)) { return false; } return !is_null($wurflConfig->logDir) && is_writable($wurflConfig->logDir); }
[ "private", "static", "function", "isLoggingConfigured", "(", "$", "wurflConfig", ")", "{", "if", "(", "is_null", "(", "$", "wurflConfig", ")", ")", "{", "return", "false", ";", "}", "return", "!", "is_null", "(", "$", "wurflConfig", "->", "logDir", ")", ...
Returns true if $wurflConfig specifies a Logger @param WURFL_Configuration_Config $wurflConfig @return bool
[ "Returns", "true", "if", "$wurflConfig", "specifies", "a", "Logger" ]
train
https://github.com/acasademont/wurfl/blob/0f4fb6e06b452ba95ad1d15e7d8226d0974b60c2/WURFL/Logger/LoggerFactory.php#L68-L74
acasademont/wurfl
WURFL/Logger/LoggerFactory.php
WURFL_Logger_LoggerFactory.createLogFile
private static function createLogFile($logDir, $fileName) { $file = realpath($logDir . DIRECTORY_SEPARATOR . $fileName); touch($file); return $file; }
php
private static function createLogFile($logDir, $fileName) { $file = realpath($logDir . DIRECTORY_SEPARATOR . $fileName); touch($file); return $file; }
[ "private", "static", "function", "createLogFile", "(", "$", "logDir", ",", "$", "fileName", ")", "{", "$", "file", "=", "realpath", "(", "$", "logDir", ".", "DIRECTORY_SEPARATOR", ".", "$", "fileName", ")", ";", "touch", "(", "$", "file", ")", ";", "re...
Creates a new log file in given $logDir with given $fileName @param string $logDir @param string $fileName @return string Complete filename to created logfile
[ "Creates", "a", "new", "log", "file", "in", "given", "$logDir", "with", "given", "$fileName" ]
train
https://github.com/acasademont/wurfl/blob/0f4fb6e06b452ba95ad1d15e7d8226d0974b60c2/WURFL/Logger/LoggerFactory.php#L82-L87
sanpii/assetic
src/Assetic/Filter/Yui/BaseCompressorFilter.php
BaseCompressorFilter.compress
protected function compress($content, $type, $options = array()) { $commandline =array($this->javaPath); if (null !== $this->stackSize) { array_push($commandline, '-Xss'.$this->stackSize); } array_push($commandline, '-jar', $this->jarPath); foreach ($options as...
php
protected function compress($content, $type, $options = array()) { $commandline =array($this->javaPath); if (null !== $this->stackSize) { array_push($commandline, '-Xss'.$this->stackSize); } array_push($commandline, '-jar', $this->jarPath); foreach ($options as...
[ "protected", "function", "compress", "(", "$", "content", ",", "$", "type", ",", "$", "options", "=", "array", "(", ")", ")", "{", "$", "commandline", "=", "array", "(", "$", "this", "->", "javaPath", ")", ";", "if", "(", "null", "!==", "$", "this"...
Compresses a string. @param string $content The content to compress @param string $type The type of content, either "js" or "css" @param array $options An indexed array of additional options @return string The compressed content
[ "Compresses", "a", "string", "." ]
train
https://github.com/sanpii/assetic/blob/5c446eee54cc396cbbd6e252108f430e6e617c95/src/Assetic/Filter/Yui/BaseCompressorFilter.php#L68-L117
ray-di/Ray.WebFormModule
src/AntiCsrf.php
AntiCsrf.isValid
public function isValid(array $data) { if ($this->isCli) { return true; } return isset($data[self::TOKEN_KEY]) && $data[self::TOKEN_KEY] == $this->getToken(); }
php
public function isValid(array $data) { if ($this->isCli) { return true; } return isset($data[self::TOKEN_KEY]) && $data[self::TOKEN_KEY] == $this->getToken(); }
[ "public", "function", "isValid", "(", "array", "$", "data", ")", "{", "if", "(", "$", "this", "->", "isCli", ")", "{", "return", "true", ";", "}", "return", "isset", "(", "$", "data", "[", "self", "::", "TOKEN_KEY", "]", ")", "&&", "$", "data", "...
@param array $data @return bool
[ "@param", "array", "$data" ]
train
https://github.com/ray-di/Ray.WebFormModule/blob/4b6d33adb4a5c285278a068f3e7a5afdc4e680d9/src/AntiCsrf.php#L50-L57
shawnsandy/ui-pages
src/Controllers/DashController.php
DashController.index
public function index() { $logs = $this->log_collection; $markdown = Storage::disk('markdown')->allFiles(); $env = $this->env->getContent(); return view('page::admin.index', compact('logs', 'markdown', 'env')); }
php
public function index() { $logs = $this->log_collection; $markdown = Storage::disk('markdown')->allFiles(); $env = $this->env->getContent(); return view('page::admin.index', compact('logs', 'markdown', 'env')); }
[ "public", "function", "index", "(", ")", "{", "$", "logs", "=", "$", "this", "->", "log_collection", ";", "$", "markdown", "=", "Storage", "::", "disk", "(", "'markdown'", ")", "->", "allFiles", "(", ")", ";", "$", "env", "=", "$", "this", "->", "e...
Index page @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
[ "Index", "page" ]
train
https://github.com/shawnsandy/ui-pages/blob/11584c12fa3e2b9a5c513f4ec9e2eaf78c206ca8/src/Controllers/DashController.php#L63-L70
vardius/list-bundle
Column/Types/Type/ActionType.php
ActionType.getData
public function getData($entity = null, array $options = []):array { $items = []; if (array_key_exists('actions', $options)) { $actions = $options['actions']; foreach ($actions as $action) { $path = array_key_exists('path', $action) ? $action['path'] : null; ...
php
public function getData($entity = null, array $options = []):array { $items = []; if (array_key_exists('actions', $options)) { $actions = $options['actions']; foreach ($actions as $action) { $path = array_key_exists('path', $action) ? $action['path'] : null; ...
[ "public", "function", "getData", "(", "$", "entity", "=", "null", ",", "array", "$", "options", "=", "[", "]", ")", ":", "array", "{", "$", "items", "=", "[", "]", ";", "if", "(", "array_key_exists", "(", "'actions'", ",", "$", "options", ")", ")",...
{@inheritdoc}
[ "{" ]
train
https://github.com/vardius/list-bundle/blob/70d3079ce22eed7dad7c467fee532aa2f18c68c9/Column/Types/Type/ActionType.php#L35-L55
activecollab/databasestructure
src/Field/Scalar/Traits/UniqueInterface/Implementation.php
Implementation.&
public function &unique(...$context) { $this->is_unique = true; $this->uniquness_context = $context; if ($this instanceof AddIndexInterface) { $this->addIndex(true, $context, IndexInterface::UNIQUE); } return $this; }
php
public function &unique(...$context) { $this->is_unique = true; $this->uniquness_context = $context; if ($this instanceof AddIndexInterface) { $this->addIndex(true, $context, IndexInterface::UNIQUE); } return $this; }
[ "public", "function", "&", "unique", "(", "...", "$", "context", ")", "{", "$", "this", "->", "is_unique", "=", "true", ";", "$", "this", "->", "uniquness_context", "=", "$", "context", ";", "if", "(", "$", "this", "instanceof", "AddIndexInterface", ")",...
{@inheritdoc}
[ "{" ]
train
https://github.com/activecollab/databasestructure/blob/4b2353c4422186bcfce63b3212da3e70e63eb5df/src/Field/Scalar/Traits/UniqueInterface/Implementation.php#L48-L58
datto/php-json-rpc-log
src/Logged/Server.php
Server.reply
public function reply($message) { $this->logger->log($this->level, 'Message received: ' . str_replace("\n", ' ', $message)); $reply = parent::reply($message); if ($reply !== null) { $this->logger->log($this->level, 'Sending reply: ' . str_replace("\n", ' ', $reply)); ...
php
public function reply($message) { $this->logger->log($this->level, 'Message received: ' . str_replace("\n", ' ', $message)); $reply = parent::reply($message); if ($reply !== null) { $this->logger->log($this->level, 'Sending reply: ' . str_replace("\n", ' ', $reply)); ...
[ "public", "function", "reply", "(", "$", "message", ")", "{", "$", "this", "->", "logger", "->", "log", "(", "$", "this", "->", "level", ",", "'Message received: '", ".", "str_replace", "(", "\"\\n\"", ",", "' '", ",", "$", "message", ")", ")", ";", ...
Reads the JSON request/payload from the POST request input and echoes the response (if any). The actual processing is done in JsonRpc\Server's reply() method. @param string $message JSON-RPC request message string @return null|string JSON-RPC response message string (or null if the request was a notification)
[ "Reads", "the", "JSON", "request", "/", "payload", "from", "the", "POST", "request", "input", "and", "echoes", "the", "response", "(", "if", "any", ")", "." ]
train
https://github.com/datto/php-json-rpc-log/blob/f50617868b3f87e326f698ee2cc7c6d805eefb73/src/Logged/Server.php#L45-L58
awethemes/wp-session
src/WP_Session.php
WP_Session.hooks
public function hooks() { // Start and commit the session. add_action( 'plugins_loaded', [ $this, 'start_session' ] ); add_action( 'shutdown', [ $this, 'commit_session' ] ); // Register the garbage collector. add_action( 'wp', [ $this, 'register_garbage_collection' ] ); add_action( $this->get_schedule_name...
php
public function hooks() { // Start and commit the session. add_action( 'plugins_loaded', [ $this, 'start_session' ] ); add_action( 'shutdown', [ $this, 'commit_session' ] ); // Register the garbage collector. add_action( 'wp', [ $this, 'register_garbage_collection' ] ); add_action( $this->get_schedule_name...
[ "public", "function", "hooks", "(", ")", "{", "// Start and commit the session.", "add_action", "(", "'plugins_loaded'", ",", "[", "$", "this", ",", "'start_session'", "]", ")", ";", "add_action", "(", "'shutdown'", ",", "[", "$", "this", ",", "'commit_session'"...
Hooks into WordPress to start, commit and run garbage collector. @return void
[ "Hooks", "into", "WordPress", "to", "start", "commit", "and", "run", "garbage", "collector", "." ]
train
https://github.com/awethemes/wp-session/blob/4819c6392a0dbcbbf547027b70d5af88e7a89d61/src/WP_Session.php#L50-L58
awethemes/wp-session
src/WP_Session.php
WP_Session.start_session
public function start_session() { $session = $this->get_store(); $session_name = $session->get_name(); $session->set_id( isset( $_COOKIE[ $session_name ] ) ? sanitize_text_field( $_COOKIE[ $session_name ] ) : null ); $session->start(); if ( ! $this->running_in_cli() ) { // Add the session identifier to...
php
public function start_session() { $session = $this->get_store(); $session_name = $session->get_name(); $session->set_id( isset( $_COOKIE[ $session_name ] ) ? sanitize_text_field( $_COOKIE[ $session_name ] ) : null ); $session->start(); if ( ! $this->running_in_cli() ) { // Add the session identifier to...
[ "public", "function", "start_session", "(", ")", "{", "$", "session", "=", "$", "this", "->", "get_store", "(", ")", ";", "$", "session_name", "=", "$", "session", "->", "get_name", "(", ")", ";", "$", "session", "->", "set_id", "(", "isset", "(", "$...
Start the session when `plugin_loaded`. @access private @return void
[ "Start", "the", "session", "when", "plugin_loaded", "." ]
train
https://github.com/awethemes/wp-session/blob/4819c6392a0dbcbbf547027b70d5af88e7a89d61/src/WP_Session.php#L67-L82
jan-dolata/crude-crud
src/Http/Controllers/AutocompleteController.php
AutocompleteController.get
public function get(AutocompleteRequest $request, $crudeName, $attr) { $crude = CrudeInstance::get($crudeName); $methodName = 'autocomplete' . $this->underscoreToCamelCase($attr); if (! method_exists($crude, $methodName)) return response()->json([], 200); $term = $reque...
php
public function get(AutocompleteRequest $request, $crudeName, $attr) { $crude = CrudeInstance::get($crudeName); $methodName = 'autocomplete' . $this->underscoreToCamelCase($attr); if (! method_exists($crude, $methodName)) return response()->json([], 200); $term = $reque...
[ "public", "function", "get", "(", "AutocompleteRequest", "$", "request", ",", "$", "crudeName", ",", "$", "attr", ")", "{", "$", "crude", "=", "CrudeInstance", "::", "get", "(", "$", "crudeName", ")", ";", "$", "methodName", "=", "'autocomplete'", ".", "...
Call method to get list for $attr autocomplete input @param Request $request - with 'term' string value @param string $crudeName @param string $attr - form input attribute name @return JSON with array
[ "Call", "method", "to", "get", "list", "for", "$attr", "autocomplete", "input" ]
train
https://github.com/jan-dolata/crude-crud/blob/9129ea08278835cf5cecfd46a90369226ae6bdd7/src/Http/Controllers/AutocompleteController.php#L22-L34
jan-dolata/crude-crud
src/Http/Controllers/AutocompleteController.php
AutocompleteController.label
public function label(AutocompleteRequest $request) { $crude = CrudeInstance::get($request->input('crudeName')); $attr = $this->underscoreToCamelCase($request->input('attr')); $value = $request->input('value'); $methodName = 'label' . $attr; $result = ''; if (method_...
php
public function label(AutocompleteRequest $request) { $crude = CrudeInstance::get($request->input('crudeName')); $attr = $this->underscoreToCamelCase($request->input('attr')); $value = $request->input('value'); $methodName = 'label' . $attr; $result = ''; if (method_...
[ "public", "function", "label", "(", "AutocompleteRequest", "$", "request", ")", "{", "$", "crude", "=", "CrudeInstance", "::", "get", "(", "$", "request", "->", "input", "(", "'crudeName'", ")", ")", ";", "$", "attr", "=", "$", "this", "->", "underscoreT...
Call mathod to get first label for $attr autocomplete input @param Request $request - with 'crudeName' - crude class name 'attr' - attribute name 'value' - model[attr] @return JSON with string
[ "Call", "mathod", "to", "get", "first", "label", "for", "$attr", "autocomplete", "input" ]
train
https://github.com/jan-dolata/crude-crud/blob/9129ea08278835cf5cecfd46a90369226ae6bdd7/src/Http/Controllers/AutocompleteController.php#L44-L56
JustBlackBird/jms-serializer-strict-json
src/StrictJsonDeserializationVisitor.php
StrictJsonDeserializationVisitor.visitString
public function visitString($data, array $type, Context $context) { if (!is_string($data)) { throw TypeMismatchException::fromValue('string', $data, $context); } return parent::visitString($data, $type, $context); }
php
public function visitString($data, array $type, Context $context) { if (!is_string($data)) { throw TypeMismatchException::fromValue('string', $data, $context); } return parent::visitString($data, $type, $context); }
[ "public", "function", "visitString", "(", "$", "data", ",", "array", "$", "type", ",", "Context", "$", "context", ")", "{", "if", "(", "!", "is_string", "(", "$", "data", ")", ")", "{", "throw", "TypeMismatchException", "::", "fromValue", "(", "'string'"...
{@inheritdoc}
[ "{" ]
train
https://github.com/JustBlackBird/jms-serializer-strict-json/blob/db1d1473ccb0de32dfb12ec89c89e028a515d61e/src/StrictJsonDeserializationVisitor.php#L29-L36
JustBlackBird/jms-serializer-strict-json
src/StrictJsonDeserializationVisitor.php
StrictJsonDeserializationVisitor.visitBoolean
public function visitBoolean($data, array $type, Context $context) { if (!is_bool($data)) { throw TypeMismatchException::fromValue('boolean', $data, $context); } return parent::visitBoolean($data, $type, $context); }
php
public function visitBoolean($data, array $type, Context $context) { if (!is_bool($data)) { throw TypeMismatchException::fromValue('boolean', $data, $context); } return parent::visitBoolean($data, $type, $context); }
[ "public", "function", "visitBoolean", "(", "$", "data", ",", "array", "$", "type", ",", "Context", "$", "context", ")", "{", "if", "(", "!", "is_bool", "(", "$", "data", ")", ")", "{", "throw", "TypeMismatchException", "::", "fromValue", "(", "'boolean'"...
{@inheritdoc}
[ "{" ]
train
https://github.com/JustBlackBird/jms-serializer-strict-json/blob/db1d1473ccb0de32dfb12ec89c89e028a515d61e/src/StrictJsonDeserializationVisitor.php#L41-L48
JustBlackBird/jms-serializer-strict-json
src/StrictJsonDeserializationVisitor.php
StrictJsonDeserializationVisitor.visitInteger
public function visitInteger($data, array $type, Context $context) { if (!is_int($data)) { throw TypeMismatchException::fromValue('integer', $data, $context); } return parent::visitInteger($data, $type, $context); }
php
public function visitInteger($data, array $type, Context $context) { if (!is_int($data)) { throw TypeMismatchException::fromValue('integer', $data, $context); } return parent::visitInteger($data, $type, $context); }
[ "public", "function", "visitInteger", "(", "$", "data", ",", "array", "$", "type", ",", "Context", "$", "context", ")", "{", "if", "(", "!", "is_int", "(", "$", "data", ")", ")", "{", "throw", "TypeMismatchException", "::", "fromValue", "(", "'integer'",...
{@inheritdoc}
[ "{" ]
train
https://github.com/JustBlackBird/jms-serializer-strict-json/blob/db1d1473ccb0de32dfb12ec89c89e028a515d61e/src/StrictJsonDeserializationVisitor.php#L53-L60
JustBlackBird/jms-serializer-strict-json
src/StrictJsonDeserializationVisitor.php
StrictJsonDeserializationVisitor.visitDouble
public function visitDouble($data, array $type, Context $context) { if (!is_float($data) && !is_integer($data)) { throw TypeMismatchException::fromValue('double', $data, $context); } return parent::visitDouble($data, $type, $context); }
php
public function visitDouble($data, array $type, Context $context) { if (!is_float($data) && !is_integer($data)) { throw TypeMismatchException::fromValue('double', $data, $context); } return parent::visitDouble($data, $type, $context); }
[ "public", "function", "visitDouble", "(", "$", "data", ",", "array", "$", "type", ",", "Context", "$", "context", ")", "{", "if", "(", "!", "is_float", "(", "$", "data", ")", "&&", "!", "is_integer", "(", "$", "data", ")", ")", "{", "throw", "TypeM...
{@inheritdoc}
[ "{" ]
train
https://github.com/JustBlackBird/jms-serializer-strict-json/blob/db1d1473ccb0de32dfb12ec89c89e028a515d61e/src/StrictJsonDeserializationVisitor.php#L65-L72
keiosweb/moneyright
src/Currency.php
Currency.getCurrencyFromIsoCode
protected function getCurrencyFromIsoCode($isoCode) { $this->prepareCurrencies(); $isoCode = strtolower($isoCode); if (!array_key_exists($isoCode, self::$currencies)) { throw new UnknownCurrencyException('Currency with '.$isoCode.' iso code does not exist!'); } ...
php
protected function getCurrencyFromIsoCode($isoCode) { $this->prepareCurrencies(); $isoCode = strtolower($isoCode); if (!array_key_exists($isoCode, self::$currencies)) { throw new UnknownCurrencyException('Currency with '.$isoCode.' iso code does not exist!'); } ...
[ "protected", "function", "getCurrencyFromIsoCode", "(", "$", "isoCode", ")", "{", "$", "this", "->", "prepareCurrencies", "(", ")", ";", "$", "isoCode", "=", "strtolower", "(", "$", "isoCode", ")", ";", "if", "(", "!", "array_key_exists", "(", "$", "isoCod...
Loads currency information from preloaded data by ISO index @param $isoCode @return array @throws \Keios\MoneyRight\Exceptions\UnknownCurrencyException
[ "Loads", "currency", "information", "from", "preloaded", "data", "by", "ISO", "index" ]
train
https://github.com/keiosweb/moneyright/blob/6c6d8ce34e37e42aa1eebbf45a949bbae6b44780/src/Currency.php#L124-L135
keiosweb/moneyright
src/Currency.php
Currency.fill
protected function fill(array $data) { $this->isoCode = $data['iso_code']; $this->name = $data['name']; $this->symbol = $data['symbol']; $this->subunit = $data['subunit']; $this->symbolFirst = $data['symbol_first']; $this->htmlEntity = $data['html_entity']; $t...
php
protected function fill(array $data) { $this->isoCode = $data['iso_code']; $this->name = $data['name']; $this->symbol = $data['symbol']; $this->subunit = $data['subunit']; $this->symbolFirst = $data['symbol_first']; $this->htmlEntity = $data['html_entity']; $t...
[ "protected", "function", "fill", "(", "array", "$", "data", ")", "{", "$", "this", "->", "isoCode", "=", "$", "data", "[", "'iso_code'", "]", ";", "$", "this", "->", "name", "=", "$", "data", "[", "'name'", "]", ";", "$", "this", "->", "symbol", ...
Protected setter for all fields @param array $data
[ "Protected", "setter", "for", "all", "fields" ]
train
https://github.com/keiosweb/moneyright/blob/6c6d8ce34e37e42aa1eebbf45a949bbae6b44780/src/Currency.php#L142-L161
keiosweb/moneyright
src/Currency.php
Currency.aggregateData
protected function aggregateData() { $data = [ 'iso_code' => $this->isoCode, 'name' => $this->name, 'symbol' => $this->symbol, 'subunit' => $this->subunit, 'symbol_first' => $this->symbolFir...
php
protected function aggregateData() { $data = [ 'iso_code' => $this->isoCode, 'name' => $this->name, 'symbol' => $this->symbol, 'subunit' => $this->subunit, 'symbol_first' => $this->symbolFir...
[ "protected", "function", "aggregateData", "(", ")", "{", "$", "data", "=", "[", "'iso_code'", "=>", "$", "this", "->", "isoCode", ",", "'name'", "=>", "$", "this", "->", "name", ",", "'symbol'", "=>", "$", "this", "->", "symbol", ",", "'subunit'", "=>"...
Prepares data for serialization @return array
[ "Prepares", "data", "for", "serialization" ]
train
https://github.com/keiosweb/moneyright/blob/6c6d8ce34e37e42aa1eebbf45a949bbae6b44780/src/Currency.php#L168-L191
keiosweb/moneyright
src/Currency.php
Currency.unserialize
public function unserialize($serialized) { $currentCurrency = $this->getCurrencyFromIsoCode(unserialize($serialized)); $this->fill($currentCurrency); }
php
public function unserialize($serialized) { $currentCurrency = $this->getCurrencyFromIsoCode(unserialize($serialized)); $this->fill($currentCurrency); }
[ "public", "function", "unserialize", "(", "$", "serialized", ")", "{", "$", "currentCurrency", "=", "$", "this", "->", "getCurrencyFromIsoCode", "(", "unserialize", "(", "$", "serialized", ")", ")", ";", "$", "this", "->", "fill", "(", "$", "currentCurrency"...
Serialization constructor for \Serializable @param string $serialized
[ "Serialization", "constructor", "for", "\\", "Serializable" ]
train
https://github.com/keiosweb/moneyright/blob/6c6d8ce34e37e42aa1eebbf45a949bbae6b44780/src/Currency.php#L318-L323
movoin/one-swoole
src/Protocol/Protocol.php
Protocol.handle
public function handle(Request $request, Response $response): Response { // 解析请求 list($action, $args) = $this->dispatch($request); // 写入请求参数至请求对象 $request = $request->withAttributes($args); // 匹配请求对应中间件 $this->middleware->matchRequest($request); // {{ 执行请求过...
php
public function handle(Request $request, Response $response): Response { // 解析请求 list($action, $args) = $this->dispatch($request); // 写入请求参数至请求对象 $request = $request->withAttributes($args); // 匹配请求对应中间件 $this->middleware->matchRequest($request); // {{ 执行请求过...
[ "public", "function", "handle", "(", "Request", "$", "request", ",", "Response", "$", "response", ")", ":", "Response", "{", "// 解析请求", "list", "(", "$", "action", ",", "$", "args", ")", "=", "$", "this", "->", "dispatch", "(", "$", "request", ")", "...
协议处理 @param \One\Protocol\Contracts\Request $request @param \One\Protocol\Contracts\Response $response @return \One\Protocol\Contracts\Response @throws \One\Protocol\Exceptions\ProtocolException @throws \One\Middleware\Exceptions\MiddlewareException
[ "协议处理" ]
train
https://github.com/movoin/one-swoole/blob/b9b175963ead91416cc50902a04e05ff3ef571de/src/Protocol/Protocol.php#L42-L98
kiwiz/ecl
src/SymbolTable.php
SymbolTable.resolve
public function resolve($sym, $type=Symbol::T_NULL) { $val = $sym; if($sym instanceof \ECL\Symbol) { $val = $this->offsetGet($sym->getName()); if($type == Symbol::T_NULL) { $type = $sym->getType(); } } switch($type) { case Symbol::...
php
public function resolve($sym, $type=Symbol::T_NULL) { $val = $sym; if($sym instanceof \ECL\Symbol) { $val = $this->offsetGet($sym->getName()); if($type == Symbol::T_NULL) { $type = $sym->getType(); } } switch($type) { case Symbol::...
[ "public", "function", "resolve", "(", "$", "sym", ",", "$", "type", "=", "Symbol", "::", "T_NULL", ")", "{", "$", "val", "=", "$", "sym", ";", "if", "(", "$", "sym", "instanceof", "\\", "ECL", "\\", "Symbol", ")", "{", "$", "val", "=", "$", "th...
Check if the input is a Symbol and resolve it if so. @param Symbol|mixed $sym A symbol object or builtin type. @param int $type Data type. @return mixed A resolved symbol or the passed in data.
[ "Check", "if", "the", "input", "is", "a", "Symbol", "and", "resolve", "it", "if", "so", "." ]
train
https://github.com/kiwiz/ecl/blob/6536dd2a4c1905a08cf718bdbef56a22f0e9b488/src/SymbolTable.php#L23-L62
kiwiz/ecl
src/SymbolTable.php
SymbolTable.&
public function &offsetGet($key) { if(!$this->offsetExists($key)) { throw new KeyNotFoundException($key); } return $this->table[$key]->getValue(); }
php
public function &offsetGet($key) { if(!$this->offsetExists($key)) { throw new KeyNotFoundException($key); } return $this->table[$key]->getValue(); }
[ "public", "function", "&", "offsetGet", "(", "$", "key", ")", "{", "if", "(", "!", "$", "this", "->", "offsetExists", "(", "$", "key", ")", ")", "{", "throw", "new", "KeyNotFoundException", "(", "$", "key", ")", ";", "}", "return", "$", "this", "->...
Get the value for a symbol. @param string $key Symbol name. @return Value Symbol value.
[ "Get", "the", "value", "for", "a", "symbol", "." ]
train
https://github.com/kiwiz/ecl/blob/6536dd2a4c1905a08cf718bdbef56a22f0e9b488/src/SymbolTable.php#L69-L74
kiwiz/ecl
src/SymbolTable.php
SymbolTable.offsetSet
public function offsetSet($key, $value) { if(!$this->offsetExists($key)) { $this->table[$key] = new Value($value); } else { $this->table[$key]->setValue($value); } }
php
public function offsetSet($key, $value) { if(!$this->offsetExists($key)) { $this->table[$key] = new Value($value); } else { $this->table[$key]->setValue($value); } }
[ "public", "function", "offsetSet", "(", "$", "key", ",", "$", "value", ")", "{", "if", "(", "!", "$", "this", "->", "offsetExists", "(", "$", "key", ")", ")", "{", "$", "this", "->", "table", "[", "$", "key", "]", "=", "new", "Value", "(", "$",...
Set the value for a symbol. @param string $key Symbol name. @param Value $value Symbol value.
[ "Set", "the", "value", "for", "a", "symbol", "." ]
train
https://github.com/kiwiz/ecl/blob/6536dd2a4c1905a08cf718bdbef56a22f0e9b488/src/SymbolTable.php#L80-L86
o2system/filesystem
src/Files/IniFile.php
IniFile.readFile
public function readFile($filePath = null, array $options = []) { $items = parse_ini_file( $filePath, (empty($options) ? true : $options[ 'sections' ]) ); $this->merge($items); return $items; }
php
public function readFile($filePath = null, array $options = []) { $items = parse_ini_file( $filePath, (empty($options) ? true : $options[ 'sections' ]) ); $this->merge($items); return $items; }
[ "public", "function", "readFile", "(", "$", "filePath", "=", "null", ",", "array", "$", "options", "=", "[", "]", ")", "{", "$", "items", "=", "parse_ini_file", "(", "$", "filePath", ",", "(", "empty", "(", "$", "options", ")", "?", "true", ":", "$...
IniFile::readFile @param string $filePath Path to the file. @param array $options Read file options. @return mixed
[ "IniFile", "::", "readFile" ]
train
https://github.com/o2system/filesystem/blob/58f6515f56bcc92408dc155add570c99a0abb6e8/src/Files/IniFile.php#L38-L50
o2system/filesystem
src/Files/IniFile.php
IniFile.writeFile
public function writeFile($filePath = null, array $options = []) { $filePath = empty($filePath) ? $this->filePath : $filePath; $sections = (empty($options) ? true : $options[ 'sections' ]); $content = null; if ($sections)...
php
public function writeFile($filePath = null, array $options = []) { $filePath = empty($filePath) ? $this->filePath : $filePath; $sections = (empty($options) ? true : $options[ 'sections' ]); $content = null; if ($sections)...
[ "public", "function", "writeFile", "(", "$", "filePath", "=", "null", ",", "array", "$", "options", "=", "[", "]", ")", "{", "$", "filePath", "=", "empty", "(", "$", "filePath", ")", "?", "$", "this", "->", "filePath", ":", "$", "filePath", ";", "$...
IniFile::writeFile @param string $filePath Path to the file. @param array $options Write file options. @return bool Returns TRUE on success or FALSE on failure.
[ "IniFile", "::", "writeFile" ]
train
https://github.com/o2system/filesystem/blob/58f6515f56bcc92408dc155add570c99a0abb6e8/src/Files/IniFile.php#L62-L129
tjbp/laravel-verify-emails
src/Auth/VerifyEmails/VerifyEmailBrokerManager.php
VerifyEmailBrokerManager.resolve
protected function resolve($name) { $config = $this->getConfig($name); if (is_null($config)) { throw new InvalidArgumentException("Email verifier [{$name}] is not defined."); } // The email verification broker uses a token repository to validate tokens // and se...
php
protected function resolve($name) { $config = $this->getConfig($name); if (is_null($config)) { throw new InvalidArgumentException("Email verifier [{$name}] is not defined."); } // The email verification broker uses a token repository to validate tokens // and se...
[ "protected", "function", "resolve", "(", "$", "name", ")", "{", "$", "config", "=", "$", "this", "->", "getConfig", "(", "$", "name", ")", ";", "if", "(", "is_null", "(", "$", "config", ")", ")", "{", "throw", "new", "InvalidArgumentException", "(", ...
Resolve the given broker. @param string $name @return \Illuminate\Contracts\Auth\VerifyEmailBroker
[ "Resolve", "the", "given", "broker", "." ]
train
https://github.com/tjbp/laravel-verify-emails/blob/1e2ac10a696c10f2fdf0d7de6c3388d549bc07c6/src/Auth/VerifyEmails/VerifyEmailBrokerManager.php#L59-L76
tjbp/laravel-verify-emails
src/Auth/VerifyEmails/VerifyEmailBrokerManager.php
VerifyEmailBrokerManager.createTokenRepository
protected function createTokenRepository(array $config) { return new DatabaseTokenRepository( $this->app['db']->connection(), $config['table'], $this->app['config']['app.key'], $config['expire'] ); }
php
protected function createTokenRepository(array $config) { return new DatabaseTokenRepository( $this->app['db']->connection(), $config['table'], $this->app['config']['app.key'], $config['expire'] ); }
[ "protected", "function", "createTokenRepository", "(", "array", "$", "config", ")", "{", "return", "new", "DatabaseTokenRepository", "(", "$", "this", "->", "app", "[", "'db'", "]", "->", "connection", "(", ")", ",", "$", "config", "[", "'table'", "]", ","...
Create a token repository instance based on the given configuration. @param array $config @return \Illuminate\Auth\Passwords\TokenRepositoryInterface
[ "Create", "a", "token", "repository", "instance", "based", "on", "the", "given", "configuration", "." ]
train
https://github.com/tjbp/laravel-verify-emails/blob/1e2ac10a696c10f2fdf0d7de6c3388d549bc07c6/src/Auth/VerifyEmails/VerifyEmailBrokerManager.php#L84-L92
drupol/valuewrapper
src/Resource/StreamResource.php
StreamResource.hash
public function hash(): string { return $this->doHash( $this->type() . \implode('', \stream_get_meta_data($this->value())) ); }
php
public function hash(): string { return $this->doHash( $this->type() . \implode('', \stream_get_meta_data($this->value())) ); }
[ "public", "function", "hash", "(", ")", ":", "string", "{", "return", "$", "this", "->", "doHash", "(", "$", "this", "->", "type", "(", ")", ".", "\\", "implode", "(", "''", ",", "\\", "stream_get_meta_data", "(", "$", "this", "->", "value", "(", "...
{@inheritdoc.
[ "{" ]
train
https://github.com/drupol/valuewrapper/blob/49cc07e4d0284718c24ba6e9cf524c1f4226694e/src/Resource/StreamResource.php#L15-L20