id
int32
0
241k
repo
stringlengths
6
63
path
stringlengths
5
140
func_name
stringlengths
3
151
original_string
stringlengths
84
13k
language
stringclasses
1 value
code
stringlengths
84
13k
code_tokens
list
docstring
stringlengths
3
47.2k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
91
247
187,400
acacha/llum
src/Traits/LaravelConfigFile.php
LaravelConfigFile.setupLaravelConfigFile
private function setupLaravelConfigFile($providers, $aliases) { if ($this->installConfigFile() == -1) { return -1; } $this->addProviders($providers); $this->addAliases($aliases); }
php
private function setupLaravelConfigFile($providers, $aliases) { if ($this->installConfigFile() == -1) { return -1; } $this->addProviders($providers); $this->addAliases($aliases); }
[ "private", "function", "setupLaravelConfigFile", "(", "$", "providers", ",", "$", "aliases", ")", "{", "if", "(", "$", "this", "->", "installConfigFile", "(", ")", "==", "-", "1", ")", "{", "return", "-", "1", ";", "}", "$", "this", "->", "addProviders...
Setup Laravel config file adding providers and aliases. @param $providers @param $aliases @return int
[ "Setup", "Laravel", "config", "file", "adding", "providers", "and", "aliases", "." ]
b17d3c6df5fc0a5a95140652776c2eb1a422be2f
https://github.com/acacha/llum/blob/b17d3c6df5fc0a5a95140652776c2eb1a422be2f/src/Traits/LaravelConfigFile.php#L187-L196
187,401
acacha/llum
src/Traits/LaravelConfigFile.php
LaravelConfigFile.addProviders
protected function addProviders($providers) { foreach ($providers as $provider) { $this->output->writeln('<info>Adding '.$provider.' to Laravel config app.php file</info>'); $this->addProvider($provider); } }
php
protected function addProviders($providers) { foreach ($providers as $provider) { $this->output->writeln('<info>Adding '.$provider.' to Laravel config app.php file</info>'); $this->addProvider($provider); } }
[ "protected", "function", "addProviders", "(", "$", "providers", ")", "{", "foreach", "(", "$", "providers", "as", "$", "provider", ")", "{", "$", "this", "->", "output", "->", "writeln", "(", "'<info>Adding '", ".", "$", "provider", ".", "' to Laravel config...
Add providers to Laravel config file. @param $providers
[ "Add", "providers", "to", "Laravel", "config", "file", "." ]
b17d3c6df5fc0a5a95140652776c2eb1a422be2f
https://github.com/acacha/llum/blob/b17d3c6df5fc0a5a95140652776c2eb1a422be2f/src/Traits/LaravelConfigFile.php#L296-L302
187,402
acacha/llum
src/Traits/LaravelConfigFile.php
LaravelConfigFile.addAliases
protected function addAliases($aliases) { if ($aliases == null) { return; } foreach ($aliases as $alias => $aliasClass) { $this->output->writeln('<info>Adding '.$aliasClass.' to Laravel config app.php file</info>'); $this->addAlias("'$alias' => ".$aliasCla...
php
protected function addAliases($aliases) { if ($aliases == null) { return; } foreach ($aliases as $alias => $aliasClass) { $this->output->writeln('<info>Adding '.$aliasClass.' to Laravel config app.php file</info>'); $this->addAlias("'$alias' => ".$aliasCla...
[ "protected", "function", "addAliases", "(", "$", "aliases", ")", "{", "if", "(", "$", "aliases", "==", "null", ")", "{", "return", ";", "}", "foreach", "(", "$", "aliases", "as", "$", "alias", "=>", "$", "aliasClass", ")", "{", "$", "this", "->", "...
Add aliases to Laravel config file. @param $aliases
[ "Add", "aliases", "to", "Laravel", "config", "file", "." ]
b17d3c6df5fc0a5a95140652776c2eb1a422be2f
https://github.com/acacha/llum/blob/b17d3c6df5fc0a5a95140652776c2eb1a422be2f/src/Traits/LaravelConfigFile.php#L309-L318
187,403
Laravel-Backpack/LangFileManager
src/app/Http/Controllers/LanguageCrudController.php
LanguageCrudController.destroy
public function destroy($id) { $language = Language::find($id); $destroyResult = parent::destroy($id); if ($destroyResult) { \File::deleteDirectory(resource_path('lang/'.$language->abbr)); } return $destroyResult; }
php
public function destroy($id) { $language = Language::find($id); $destroyResult = parent::destroy($id); if ($destroyResult) { \File::deleteDirectory(resource_path('lang/'.$language->abbr)); } return $destroyResult; }
[ "public", "function", "destroy", "(", "$", "id", ")", "{", "$", "language", "=", "Language", "::", "find", "(", "$", "id", ")", ";", "$", "destroyResult", "=", "parent", "::", "destroy", "(", "$", "id", ")", ";", "if", "(", "$", "destroyResult", ")...
After delete remove also the language folder. @param int $id @return string
[ "After", "delete", "remove", "also", "the", "language", "folder", "." ]
c731b9bc31339b8cf52901eb619f9e9cafe8c6f2
https://github.com/Laravel-Backpack/LangFileManager/blob/c731b9bc31339b8cf52901eb619f9e9cafe8c6f2/src/app/Http/Controllers/LanguageCrudController.php#L94-L104
187,404
Laravel-Backpack/LangFileManager
src/app/Services/LangFiles.php
LangFiles.getFileContent
public function getFileContent() { $filepath = $this->getFilePath(); if (is_file($filepath)) { $wordsArray = include $filepath; asort($wordsArray); return $wordsArray; } return false; }
php
public function getFileContent() { $filepath = $this->getFilePath(); if (is_file($filepath)) { $wordsArray = include $filepath; asort($wordsArray); return $wordsArray; } return false; }
[ "public", "function", "getFileContent", "(", ")", "{", "$", "filepath", "=", "$", "this", "->", "getFilePath", "(", ")", ";", "if", "(", "is_file", "(", "$", "filepath", ")", ")", "{", "$", "wordsArray", "=", "include", "$", "filepath", ";", "asort", ...
get the content of a language file as an array sorted ascending. @return array|false
[ "get", "the", "content", "of", "a", "language", "file", "as", "an", "array", "sorted", "ascending", "." ]
c731b9bc31339b8cf52901eb619f9e9cafe8c6f2
https://github.com/Laravel-Backpack/LangFileManager/blob/c731b9bc31339b8cf52901eb619f9e9cafe8c6f2/src/app/Services/LangFiles.php#L34-L46
187,405
Laravel-Backpack/LangFileManager
src/app/Services/LangFiles.php
LangFiles.setFileContent
public function setFileContent($postArray) { $postArray = $this->prepareContent($postArray); $return = (int) file_put_contents( $this->getFilePath(), print_r("<?php \n\n return ".$this->var_export54($postArray).';', true) ); return $return; }
php
public function setFileContent($postArray) { $postArray = $this->prepareContent($postArray); $return = (int) file_put_contents( $this->getFilePath(), print_r("<?php \n\n return ".$this->var_export54($postArray).';', true) ); return $return; }
[ "public", "function", "setFileContent", "(", "$", "postArray", ")", "{", "$", "postArray", "=", "$", "this", "->", "prepareContent", "(", "$", "postArray", ")", ";", "$", "return", "=", "(", "int", ")", "file_put_contents", "(", "$", "this", "->", "getFi...
rewrite the file with the modified texts. @param array $postArray the data received from the form @return int
[ "rewrite", "the", "file", "with", "the", "modified", "texts", "." ]
c731b9bc31339b8cf52901eb619f9e9cafe8c6f2
https://github.com/Laravel-Backpack/LangFileManager/blob/c731b9bc31339b8cf52901eb619f9e9cafe8c6f2/src/app/Services/LangFiles.php#L53-L63
187,406
Laravel-Backpack/LangFileManager
src/app/Services/LangFiles.php
LangFiles.displayInputs
public function displayInputs($fileArray, $parents = [], $parent = '', $level = 0) { $level++; if ($parent) { $parents[] = $parent; } foreach ($fileArray as $key => $item) { if (is_array($item)) { echo view()->make('langfilemanager::language_he...
php
public function displayInputs($fileArray, $parents = [], $parent = '', $level = 0) { $level++; if ($parent) { $parents[] = $parent; } foreach ($fileArray as $key => $item) { if (is_array($item)) { echo view()->make('langfilemanager::language_he...
[ "public", "function", "displayInputs", "(", "$", "fileArray", ",", "$", "parents", "=", "[", "]", ",", "$", "parent", "=", "''", ",", "$", "level", "=", "0", ")", "{", "$", "level", "++", ";", "if", "(", "$", "parent", ")", "{", "$", "parents", ...
display the form that permits the editing. @param array $fileArray the array with all the texts @param array $parents all the ancestor keys of the current key @param string $parent the parent key of the current key @param int $level the current level @return void
[ "display", "the", "form", "that", "permits", "the", "editing", "." ]
c731b9bc31339b8cf52901eb619f9e9cafe8c6f2
https://github.com/Laravel-Backpack/LangFileManager/blob/c731b9bc31339b8cf52901eb619f9e9cafe8c6f2/src/app/Services/LangFiles.php#L130-L143
187,407
Laravel-Backpack/LangFileManager
src/app/Services/LangFiles.php
LangFiles.setArrayValue
private function setArrayValue(&$data, $keys, $value) { foreach ($keys as $key) { $data = &$data[$key]; } return $data = $value; }
php
private function setArrayValue(&$data, $keys, $value) { foreach ($keys as $key) { $data = &$data[$key]; } return $data = $value; }
[ "private", "function", "setArrayValue", "(", "&", "$", "data", ",", "$", "keys", ",", "$", "value", ")", "{", "foreach", "(", "$", "keys", "as", "$", "key", ")", "{", "$", "data", "=", "&", "$", "data", "[", "$", "key", "]", ";", "}", "return",...
set a value in a multidimensional array when knowing the keys. @param array $data the array that will be modified @param array $keys the keys (path) @param string $value the value to be added @return array
[ "set", "a", "value", "in", "a", "multidimensional", "array", "when", "knowing", "the", "keys", "." ]
c731b9bc31339b8cf52901eb619f9e9cafe8c6f2
https://github.com/Laravel-Backpack/LangFileManager/blob/c731b9bc31339b8cf52901eb619f9e9cafe8c6f2/src/app/Services/LangFiles.php#L198-L205
187,408
yectep/phpspreadsheet-bundle
src/Factory.php
Factory.createStreamedResponse
public function createStreamedResponse(Spreadsheet $spreadsheet, $type, $status = 200, $headers = array(), $writerOptions = array()) { $writer = IOFactory::createWriter($spreadsheet, $type); if (!empty($writerOptions)) { $this->applyOptionsToWriter($writer, $writerOptions); } ...
php
public function createStreamedResponse(Spreadsheet $spreadsheet, $type, $status = 200, $headers = array(), $writerOptions = array()) { $writer = IOFactory::createWriter($spreadsheet, $type); if (!empty($writerOptions)) { $this->applyOptionsToWriter($writer, $writerOptions); } ...
[ "public", "function", "createStreamedResponse", "(", "Spreadsheet", "$", "spreadsheet", ",", "$", "type", ",", "$", "status", "=", "200", ",", "$", "headers", "=", "array", "(", ")", ",", "$", "writerOptions", "=", "array", "(", ")", ")", "{", "$", "wr...
Return a StreamedResponse containing the file @param Spreadsheet $spreadsheet @param string $type @param number $status @param array $headers @param array $writerOptions @return \Symfony\Component\HttpFoundation\StreamedResponse
[ "Return", "a", "StreamedResponse", "containing", "the", "file" ]
dd4410f37025e60dd54244e76b3e483b37cd855e
https://github.com/yectep/phpspreadsheet-bundle/blob/dd4410f37025e60dd54244e76b3e483b37cd855e/src/Factory.php#L72-L87
187,409
thecodingmachine/mvc.splash
src/Mouf/Mvc/Splash/Controllers/Admin/SplashInstallController.php
SplashInstallController.defaultAction
public function defaultAction($selfedit = 'false') { $this->selfedit = $selfedit; if ($selfedit == 'true') { $this->moufManager = MoufManager::getMoufManager(); } else { $this->moufManager = MoufManager::getMoufManagerHiddenInstance(); } $this->conte...
php
public function defaultAction($selfedit = 'false') { $this->selfedit = $selfedit; if ($selfedit == 'true') { $this->moufManager = MoufManager::getMoufManager(); } else { $this->moufManager = MoufManager::getMoufManagerHiddenInstance(); } $this->conte...
[ "public", "function", "defaultAction", "(", "$", "selfedit", "=", "'false'", ")", "{", "$", "this", "->", "selfedit", "=", "$", "selfedit", ";", "if", "(", "$", "selfedit", "==", "'true'", ")", "{", "$", "this", "->", "moufManager", "=", "MoufManager", ...
Displays the first install screen. @Action @Logged @param string $selfedit If true, the name of the component must be a component from the Mouf framework itself (internal use only)
[ "Displays", "the", "first", "install", "screen", "." ]
b3a5e32ea97ce2523f04acdc19c3058f82361bb6
https://github.com/thecodingmachine/mvc.splash/blob/b3a5e32ea97ce2523f04acdc19c3058f82361bb6/src/Mouf/Mvc/Splash/Controllers/Admin/SplashInstallController.php#L62-L74
187,410
thecodingmachine/mvc.splash
src/Mouf/Mvc/Splash/Controllers/Admin/SplashInstallController.php
SplashInstallController.configure
public function configure($selfedit = 'false') { $this->selfedit = $selfedit; if ($selfedit == 'true') { $this->moufManager = MoufManager::getMoufManager(); } else { $this->moufManager = MoufManager::getMoufManagerHiddenInstance(); } $classNameMapper...
php
public function configure($selfedit = 'false') { $this->selfedit = $selfedit; if ($selfedit == 'true') { $this->moufManager = MoufManager::getMoufManager(); } else { $this->moufManager = MoufManager::getMoufManagerHiddenInstance(); } $classNameMapper...
[ "public", "function", "configure", "(", "$", "selfedit", "=", "'false'", ")", "{", "$", "this", "->", "selfedit", "=", "$", "selfedit", ";", "if", "(", "$", "selfedit", "==", "'true'", ")", "{", "$", "this", "->", "moufManager", "=", "MoufManager", "::...
Displays the second install screen. @Action @Logged @param string $selfedit If true, the name of the component must be a component from the Mouf framework itself (internal use only)
[ "Displays", "the", "second", "install", "screen", "." ]
b3a5e32ea97ce2523f04acdc19c3058f82361bb6
https://github.com/thecodingmachine/mvc.splash/blob/b3a5e32ea97ce2523f04acdc19c3058f82361bb6/src/Mouf/Mvc/Splash/Controllers/Admin/SplashInstallController.php#L101-L138
187,411
thecodingmachine/mvc.splash
src/Mouf/Mvc/Splash/Controllers/Admin/SplashInstallController.php
SplashInstallController.writeHtAccess
public function writeHtAccess($selfedit = 'false') { if ($selfedit == 'true') { $moufManager = MoufManager::getMoufManager(); } else { $moufManager = MoufManager::getMoufManagerHiddenInstance(); } $this->exludeExtentions = $moufManager->getVariable('splashexl...
php
public function writeHtAccess($selfedit = 'false') { if ($selfedit == 'true') { $moufManager = MoufManager::getMoufManager(); } else { $moufManager = MoufManager::getMoufManagerHiddenInstance(); } $this->exludeExtentions = $moufManager->getVariable('splashexl...
[ "public", "function", "writeHtAccess", "(", "$", "selfedit", "=", "'false'", ")", "{", "if", "(", "$", "selfedit", "==", "'true'", ")", "{", "$", "moufManager", "=", "MoufManager", "::", "getMoufManager", "(", ")", ";", "}", "else", "{", "$", "moufManage...
Write .htaccess. @Action @param string $selfedit
[ "Write", ".", "htaccess", "." ]
b3a5e32ea97ce2523f04acdc19c3058f82361bb6
https://github.com/thecodingmachine/mvc.splash/blob/b3a5e32ea97ce2523f04acdc19c3058f82361bb6/src/Mouf/Mvc/Splash/Controllers/Admin/SplashInstallController.php#L496-L516
187,412
thecodingmachine/mvc.splash
src/Mouf/Mvc/Splash/Controllers/HttpErrorsController.php
HttpErrorsController.createDefault
public static function createDefault(bool $debugMode = true) { $block = new HtmlBlock(); $template = new DefaultSplashTemplate($block); return new self($template, $block, $debugMode); }
php
public static function createDefault(bool $debugMode = true) { $block = new HtmlBlock(); $template = new DefaultSplashTemplate($block); return new self($template, $block, $debugMode); }
[ "public", "static", "function", "createDefault", "(", "bool", "$", "debugMode", "=", "true", ")", "{", "$", "block", "=", "new", "HtmlBlock", "(", ")", ";", "$", "template", "=", "new", "DefaultSplashTemplate", "(", "$", "block", ")", ";", "return", "new...
Creates a default controller. @param bool $debugMode @return HttpErrorsController
[ "Creates", "a", "default", "controller", "." ]
b3a5e32ea97ce2523f04acdc19c3058f82361bb6
https://github.com/thecodingmachine/mvc.splash/blob/b3a5e32ea97ce2523f04acdc19c3058f82361bb6/src/Mouf/Mvc/Splash/Controllers/HttpErrorsController.php#L93-L99
187,413
thecodingmachine/mvc.splash
src/Mouf/Mvc/Splash/Controllers/HttpErrorsController.php
HttpErrorsController.badRequest
public function badRequest(BadRequestException $exception, ServerRequestInterface $request) : ResponseInterface { $this->exception = $exception; $acceptType = $request->getHeader('Accept'); if (is_array($acceptType) && count($acceptType) > 0 && strpos($acceptType[0], 'json') !== false) { ...
php
public function badRequest(BadRequestException $exception, ServerRequestInterface $request) : ResponseInterface { $this->exception = $exception; $acceptType = $request->getHeader('Accept'); if (is_array($acceptType) && count($acceptType) > 0 && strpos($acceptType[0], 'json') !== false) { ...
[ "public", "function", "badRequest", "(", "BadRequestException", "$", "exception", ",", "ServerRequestInterface", "$", "request", ")", ":", "ResponseInterface", "{", "$", "this", "->", "exception", "=", "$", "exception", ";", "$", "acceptType", "=", "$", "request...
This function is called when a HTTP 400 error is triggered by the user. @param ServerRequestInterface $request @return ResponseInterface
[ "This", "function", "is", "called", "when", "a", "HTTP", "400", "error", "is", "triggered", "by", "the", "user", "." ]
b3a5e32ea97ce2523f04acdc19c3058f82361bb6
https://github.com/thecodingmachine/mvc.splash/blob/b3a5e32ea97ce2523f04acdc19c3058f82361bb6/src/Mouf/Mvc/Splash/Controllers/HttpErrorsController.php#L108-L124
187,414
thecodingmachine/mvc.splash
src/Mouf/Mvc/Splash/Controllers/HttpErrorsController.php
HttpErrorsController.pageNotFound
public function pageNotFound(ServerRequestInterface $request) : ResponseInterface { $acceptType = $request->getHeader('Accept'); if (is_array($acceptType) && count($acceptType) > 0 && strpos($acceptType[0], 'json') !== false) { return new JsonResponse(['error' => ['message' => 'Page not ...
php
public function pageNotFound(ServerRequestInterface $request) : ResponseInterface { $acceptType = $request->getHeader('Accept'); if (is_array($acceptType) && count($acceptType) > 0 && strpos($acceptType[0], 'json') !== false) { return new JsonResponse(['error' => ['message' => 'Page not ...
[ "public", "function", "pageNotFound", "(", "ServerRequestInterface", "$", "request", ")", ":", "ResponseInterface", "{", "$", "acceptType", "=", "$", "request", "->", "getHeader", "(", "'Accept'", ")", ";", "if", "(", "is_array", "(", "$", "acceptType", ")", ...
This function is called when a HTTP 404 error is triggered by the user. @param ServerRequestInterface $request @return ResponseInterface
[ "This", "function", "is", "called", "when", "a", "HTTP", "404", "error", "is", "triggered", "by", "the", "user", "." ]
b3a5e32ea97ce2523f04acdc19c3058f82361bb6
https://github.com/thecodingmachine/mvc.splash/blob/b3a5e32ea97ce2523f04acdc19c3058f82361bb6/src/Mouf/Mvc/Splash/Controllers/HttpErrorsController.php#L133-L147
187,415
Alorel/dropbox-v2-php
src/Options/Mixins/ClientModifiedTrait.php
ClientModifiedTrait.setClientModified
public function setClientModified(DateTimeInterface $set) { $this[Option::CLIENT_MODIFIED] = $set->format(Options::DATETIME_FORMAT); return $this; }
php
public function setClientModified(DateTimeInterface $set) { $this[Option::CLIENT_MODIFIED] = $set->format(Options::DATETIME_FORMAT); return $this; }
[ "public", "function", "setClientModified", "(", "DateTimeInterface", "$", "set", ")", "{", "$", "this", "[", "Option", "::", "CLIENT_MODIFIED", "]", "=", "$", "set", "->", "format", "(", "Options", "::", "DATETIME_FORMAT", ")", ";", "return", "$", "this", ...
The value to store as the client_modified timestamp. Dropbox automatically records the time at which the file was written to the Dropbox servers. It can also record an additional timestamp, provided by Dropbox desktop clients, mobile clients, and API apps of when the file was actually created or modified. @author Art ...
[ "The", "value", "to", "store", "as", "the", "client_modified", "timestamp", ".", "Dropbox", "automatically", "records", "the", "time", "at", "which", "the", "file", "was", "written", "to", "the", "Dropbox", "servers", ".", "It", "can", "also", "record", "an"...
06463835c90520ed7cb12dfbd23444757f42e2cf
https://github.com/Alorel/dropbox-v2-php/blob/06463835c90520ed7cb12dfbd23444757f42e2cf/src/Options/Mixins/ClientModifiedTrait.php#L45-L49
187,416
Alorel/dropbox-v2-php
src/Parameters/ThumbnailSize.php
ThumbnailSize.availableSizes
public static function availableSizes() { $r = []; foreach ((new ReflectionClass(ThumbnailSize::class))->getMethods() as $m) { if (preg_match('~^w[0-9]+h[0-9]+$~', $m->getName())) { $r[] = $m->getName(); } }; return $r;...
php
public static function availableSizes() { $r = []; foreach ((new ReflectionClass(ThumbnailSize::class))->getMethods() as $m) { if (preg_match('~^w[0-9]+h[0-9]+$~', $m->getName())) { $r[] = $m->getName(); } }; return $r;...
[ "public", "static", "function", "availableSizes", "(", ")", "{", "$", "r", "=", "[", "]", ";", "foreach", "(", "(", "new", "ReflectionClass", "(", "ThumbnailSize", "::", "class", ")", ")", "->", "getMethods", "(", ")", "as", "$", "m", ")", "{", "if",...
Return a list ov available thumbnail sizes @author Art <a.molcanovas@gmail.com> @return array
[ "Return", "a", "list", "ov", "available", "thumbnail", "sizes" ]
06463835c90520ed7cb12dfbd23444757f42e2cf
https://github.com/Alorel/dropbox-v2-php/blob/06463835c90520ed7cb12dfbd23444757f42e2cf/src/Parameters/ThumbnailSize.php#L99-L108
187,417
Alorel/dropbox-v2-php
src/Parameters/AbstractParameter.php
AbstractParameter.setArg
protected function setArg($key, $value) { if ($value !== null) { $this->args[$key] = $value; } return $this; }
php
protected function setArg($key, $value) { if ($value !== null) { $this->args[$key] = $value; } return $this; }
[ "protected", "function", "setArg", "(", "$", "key", ",", "$", "value", ")", "{", "if", "(", "$", "value", "!==", "null", ")", "{", "$", "this", "->", "args", "[", "$", "key", "]", "=", "$", "value", ";", "}", "return", "$", "this", ";", "}" ]
Sets an argument value @author Art <a.molcanovas@gmail.com> @param string $key The argument @param mixed $value The value @return self
[ "Sets", "an", "argument", "value" ]
06463835c90520ed7cb12dfbd23444757f42e2cf
https://github.com/Alorel/dropbox-v2-php/blob/06463835c90520ed7cb12dfbd23444757f42e2cf/src/Parameters/AbstractParameter.php#L59-L65
187,418
Alorel/dropbox-v2-php
src/Options/Options.php
Options.merge
public static function merge(...$options) { $o = []; foreach ($options as $opt) { if ($opt instanceof Options) { $o = array_merge($o, $opt->toArray()); } elseif (is_array($opt)) { $o = array_merge($o, $opt); ...
php
public static function merge(...$options) { $o = []; foreach ($options as $opt) { if ($opt instanceof Options) { $o = array_merge($o, $opt->toArray()); } elseif (is_array($opt)) { $o = array_merge($o, $opt); ...
[ "public", "static", "function", "merge", "(", "...", "$", "options", ")", "{", "$", "o", "=", "[", "]", ";", "foreach", "(", "$", "options", "as", "$", "opt", ")", "{", "if", "(", "$", "opt", "instanceof", "Options", ")", "{", "$", "o", "=", "a...
Create an Options object from a combination of configuration arrays and other option objects @author Art <a.molcanovas@gmail.com> @param array ...$options The items to merge @return Options
[ "Create", "an", "Options", "object", "from", "a", "combination", "of", "configuration", "arrays", "and", "other", "option", "objects" ]
06463835c90520ed7cb12dfbd23444757f42e2cf
https://github.com/Alorel/dropbox-v2-php/blob/06463835c90520ed7cb12dfbd23444757f42e2cf/src/Options/Options.php#L120-L132
187,419
Alorel/dropbox-v2-php
src/Util.php
Util.trimNulls
public static function trimNulls(array $in) { foreach ($in as $k => $v) { if ($v === null) { unset($in[$k]); } } return $in; }
php
public static function trimNulls(array $in) { foreach ($in as $k => $v) { if ($v === null) { unset($in[$k]); } } return $in; }
[ "public", "static", "function", "trimNulls", "(", "array", "$", "in", ")", "{", "foreach", "(", "$", "in", "as", "$", "k", "=>", "$", "v", ")", "{", "if", "(", "$", "v", "===", "null", ")", "{", "unset", "(", "$", "in", "[", "$", "k", "]", ...
Trims nulls from the input @author Art <a.molcanovas@gmail.com> @param array $in The input @return array The trimmed input
[ "Trims", "nulls", "from", "the", "input" ]
06463835c90520ed7cb12dfbd23444757f42e2cf
https://github.com/Alorel/dropbox-v2-php/blob/06463835c90520ed7cb12dfbd23444757f42e2cf/src/Util.php#L37-L45
187,420
ShopifyExtras/PHP-Shopify-API-Wrapper
src/Client.php
Client.settings
public function settings(array $settings) { $this->settings = array_merge($this->settings, $settings); if ($this->serviceClient) $this->buildClient(); return $this; }
php
public function settings(array $settings) { $this->settings = array_merge($this->settings, $settings); if ($this->serviceClient) $this->buildClient(); return $this; }
[ "public", "function", "settings", "(", "array", "$", "settings", ")", "{", "$", "this", "->", "settings", "=", "array_merge", "(", "$", "this", "->", "settings", ",", "$", "settings", ")", ";", "if", "(", "$", "this", "->", "serviceClient", ")", "$", ...
Merge additional settings with existing and save. Overrides existing settings as well. @param array $settings @return static
[ "Merge", "additional", "settings", "with", "existing", "and", "save", ".", "Overrides", "existing", "settings", "as", "well", "." ]
8c3caf7051080f9d64d5e2c11c2dca8b01b88295
https://github.com/ShopifyExtras/PHP-Shopify-API-Wrapper/blob/8c3caf7051080f9d64d5e2c11c2dca8b01b88295/src/Client.php#L102-L107
187,421
ShopifyExtras/PHP-Shopify-API-Wrapper
src/Client.php
Client.buildClient
private function buildClient() { $client = $this->getBaseClient(); if (!$this->description) { $this->reloadDescription(); } $this->serviceClient = new GuzzleClient( $client, $this->description, array( ...
php
private function buildClient() { $client = $this->getBaseClient(); if (!$this->description) { $this->reloadDescription(); } $this->serviceClient = new GuzzleClient( $client, $this->description, array( ...
[ "private", "function", "buildClient", "(", ")", "{", "$", "client", "=", "$", "this", "->", "getBaseClient", "(", ")", ";", "if", "(", "!", "$", "this", "->", "description", ")", "{", "$", "this", "->", "reloadDescription", "(", ")", ";", "}", "$", ...
Build new service client from descriptions. @return void
[ "Build", "new", "service", "client", "from", "descriptions", "." ]
8c3caf7051080f9d64d5e2c11c2dca8b01b88295
https://github.com/ShopifyExtras/PHP-Shopify-API-Wrapper/blob/8c3caf7051080f9d64d5e2c11c2dca8b01b88295/src/Client.php#L127-L143
187,422
ShopifyExtras/PHP-Shopify-API-Wrapper
src/Client.php
Client.loadBaseClient
private function loadBaseClient(array $settings = []) { if ($this->baseClientAdapter) $settings['adapter'] = $this->baseClientAdapter; return $this->baseClient = new BaseClient($settings); }
php
private function loadBaseClient(array $settings = []) { if ($this->baseClientAdapter) $settings['adapter'] = $this->baseClientAdapter; return $this->baseClient = new BaseClient($settings); }
[ "private", "function", "loadBaseClient", "(", "array", "$", "settings", "=", "[", "]", ")", "{", "if", "(", "$", "this", "->", "baseClientAdapter", ")", "$", "settings", "[", "'adapter'", "]", "=", "$", "this", "->", "baseClientAdapter", ";", "return", "...
Set adapter and create Guzzle base client. @return \GuzzleHttp\Client
[ "Set", "adapter", "and", "create", "Guzzle", "base", "client", "." ]
8c3caf7051080f9d64d5e2c11c2dca8b01b88295
https://github.com/ShopifyExtras/PHP-Shopify-API-Wrapper/blob/8c3caf7051080f9d64d5e2c11c2dca8b01b88295/src/Client.php#L161-L167
187,423
ShopifyExtras/PHP-Shopify-API-Wrapper
src/Client.php
Client.loadConfig
private function loadConfig() { $description = $this->loadResource('service-config'); // initial description building, use api info and build base url $description = $description + [ 'baseUrl' => 'https://'.$this->settings['shopUrl'], 'operations' => [...
php
private function loadConfig() { $description = $this->loadResource('service-config'); // initial description building, use api info and build base url $description = $description + [ 'baseUrl' => 'https://'.$this->settings['shopUrl'], 'operations' => [...
[ "private", "function", "loadConfig", "(", ")", "{", "$", "description", "=", "$", "this", "->", "loadResource", "(", "'service-config'", ")", ";", "// initial description building, use api info and build base url", "$", "description", "=", "$", "description", "+", "["...
Load configuration file and parse resources. @return array
[ "Load", "configuration", "file", "and", "parse", "resources", "." ]
8c3caf7051080f9d64d5e2c11c2dca8b01b88295
https://github.com/ShopifyExtras/PHP-Shopify-API-Wrapper/blob/8c3caf7051080f9d64d5e2c11c2dca8b01b88295/src/Client.php#L187-L209
187,424
ShopifyExtras/PHP-Shopify-API-Wrapper
src/Client.php
Client.loadServiceDescription
private function loadServiceDescription(array $service, array $description) { foreach ($service as $section => $set) { if ($section == 'operations') { // add global parameters to the operation parameters foreach ($set as &$op) $op['parameters']...
php
private function loadServiceDescription(array $service, array $description) { foreach ($service as $section => $set) { if ($section == 'operations') { // add global parameters to the operation parameters foreach ($set as &$op) $op['parameters']...
[ "private", "function", "loadServiceDescription", "(", "array", "$", "service", ",", "array", "$", "description", ")", "{", "foreach", "(", "$", "service", "as", "$", "section", "=>", "$", "set", ")", "{", "if", "(", "$", "section", "==", "'operations'", ...
Load service description from resource, add global parameters to operations. Operations and models added to full description. @param array $service @param array $description @return array
[ "Load", "service", "description", "from", "resource", "add", "global", "parameters", "to", "operations", ".", "Operations", "and", "models", "added", "to", "full", "description", "." ]
8c3caf7051080f9d64d5e2c11c2dca8b01b88295
https://github.com/ShopifyExtras/PHP-Shopify-API-Wrapper/blob/8c3caf7051080f9d64d5e2c11c2dca8b01b88295/src/Client.php#L221-L234
187,425
glpi-project/php-library-glpi
src/Glpi/Api/Rest/ItemHandler.php
ItemHandler.getItem
public function getItem($itemType, $id, array $queryString = []) { $options = []; if ($queryString) { $options['query'] = $queryString; } $response = $this->client->request('get', $itemType . '/' . $id, $options); return [ 'statusCode' => $response->getStatusCode(), ...
php
public function getItem($itemType, $id, array $queryString = []) { $options = []; if ($queryString) { $options['query'] = $queryString; } $response = $this->client->request('get', $itemType . '/' . $id, $options); return [ 'statusCode' => $response->getStatusCode(), ...
[ "public", "function", "getItem", "(", "$", "itemType", ",", "$", "id", ",", "array", "$", "queryString", "=", "[", "]", ")", "{", "$", "options", "=", "[", "]", ";", "if", "(", "$", "queryString", ")", "{", "$", "options", "[", "'query'", "]", "=...
Return the instance fields of itemtype identified by id. @param string $itemType @param integer $id @param array $queryString @return array
[ "Return", "the", "instance", "fields", "of", "itemtype", "identified", "by", "id", "." ]
d4195eb627b0d40c81e21f0c44bd94363a3b32fb
https://github.com/glpi-project/php-library-glpi/blob/d4195eb627b0d40c81e21f0c44bd94363a3b32fb/src/Glpi/Api/Rest/ItemHandler.php#L401-L411
187,426
glpi-project/php-library-glpi
src/Glpi/Api/Rest/Client.php
Client.initSessionByCredentials
public function initSessionByCredentials($user, $password) { $response = $this->request('get', 'initSession', ['auth' => [$user, $password]]); if ($response->getStatusCode() != 200 || !$this->sessionToken = json_decode($response->getBody()->getContents(), true)['session_token']) { $body = ...
php
public function initSessionByCredentials($user, $password) { $response = $this->request('get', 'initSession', ['auth' => [$user, $password]]); if ($response->getStatusCode() != 200 || !$this->sessionToken = json_decode($response->getBody()->getContents(), true)['session_token']) { $body = ...
[ "public", "function", "initSessionByCredentials", "(", "$", "user", ",", "$", "password", ")", "{", "$", "response", "=", "$", "this", "->", "request", "(", "'get'", ",", "'initSession'", ",", "[", "'auth'", "=>", "[", "$", "user", ",", "$", "password", ...
Initialize a session with user credentials @param string $user @param string $password @throws Exception @return boolean
[ "Initialize", "a", "session", "with", "user", "credentials" ]
d4195eb627b0d40c81e21f0c44bd94363a3b32fb
https://github.com/glpi-project/php-library-glpi/blob/d4195eb627b0d40c81e21f0c44bd94363a3b32fb/src/Glpi/Api/Rest/Client.php#L80-L88
187,427
glpi-project/php-library-glpi
src/Glpi/Api/Rest/Client.php
Client.initSessionByUserToken
public function initSessionByUserToken($userToken) { $response = $this->request('get', 'initSession', ['headers' => ['Authorization' => "user_token $userToken"]]); if ($response->getStatusCode() != 200 || !$this->sessionToken = json_decode($response->getBody()->getContents(), true)['session_token']...
php
public function initSessionByUserToken($userToken) { $response = $this->request('get', 'initSession', ['headers' => ['Authorization' => "user_token $userToken"]]); if ($response->getStatusCode() != 200 || !$this->sessionToken = json_decode($response->getBody()->getContents(), true)['session_token']...
[ "public", "function", "initSessionByUserToken", "(", "$", "userToken", ")", "{", "$", "response", "=", "$", "this", "->", "request", "(", "'get'", ",", "'initSession'", ",", "[", "'headers'", "=>", "[", "'Authorization'", "=>", "\"user_token $userToken\"", "]", ...
initialize a session with a user token @param string $userToken @throws Exception @return boolean True if success
[ "initialize", "a", "session", "with", "a", "user", "token" ]
d4195eb627b0d40c81e21f0c44bd94363a3b32fb
https://github.com/glpi-project/php-library-glpi/blob/d4195eb627b0d40c81e21f0c44bd94363a3b32fb/src/Glpi/Api/Rest/Client.php#L99-L107
187,428
glpi-project/php-library-glpi
src/Glpi/Api/Rest/Client.php
Client.killSession
public function killSession() { $response = $this->request('get', 'killSession'); if ($response->getStatusCode() != 200) { $body = json_decode($response->getBody()->getContents()); throw new Exception(ErrorHandler::getMessage($body[0])); } return true; }
php
public function killSession() { $response = $this->request('get', 'killSession'); if ($response->getStatusCode() != 200) { $body = json_decode($response->getBody()->getContents()); throw new Exception(ErrorHandler::getMessage($body[0])); } return true; }
[ "public", "function", "killSession", "(", ")", "{", "$", "response", "=", "$", "this", "->", "request", "(", "'get'", ",", "'killSession'", ")", ";", "if", "(", "$", "response", "->", "getStatusCode", "(", ")", "!=", "200", ")", "{", "$", "body", "="...
Kill client session. @return bool @throws Exception
[ "Kill", "client", "session", "." ]
d4195eb627b0d40c81e21f0c44bd94363a3b32fb
https://github.com/glpi-project/php-library-glpi/blob/d4195eb627b0d40c81e21f0c44bd94363a3b32fb/src/Glpi/Api/Rest/Client.php#L114-L121
187,429
glpi-project/php-library-glpi
src/Glpi/Api/Rest/Client.php
Client.request
public function request($method, $uri, array $options = []) { $apiToken = $this->addTokens(); try { $options['headers']['Content-Type'] = "application/json"; $sessionHeaders = []; if ($apiToken) { if (key_exists('Session-Token', $apiToken) && $apiToken['Session-Token']...
php
public function request($method, $uri, array $options = []) { $apiToken = $this->addTokens(); try { $options['headers']['Content-Type'] = "application/json"; $sessionHeaders = []; if ($apiToken) { if (key_exists('Session-Token', $apiToken) && $apiToken['Session-Token']...
[ "public", "function", "request", "(", "$", "method", ",", "$", "uri", ",", "array", "$", "options", "=", "[", "]", ")", "{", "$", "apiToken", "=", "$", "this", "->", "addTokens", "(", ")", ";", "try", "{", "$", "options", "[", "'headers'", "]", "...
Prepare and send a request to the GLPI Api. @param $method @param $uri @param array $options @return mixed|null|\Psr\Http\Message\ResponseInterface @throws Exception
[ "Prepare", "and", "send", "a", "request", "to", "the", "GLPI", "Api", "." ]
d4195eb627b0d40c81e21f0c44bd94363a3b32fb
https://github.com/glpi-project/php-library-glpi/blob/d4195eb627b0d40c81e21f0c44bd94363a3b32fb/src/Glpi/Api/Rest/Client.php#L132-L159
187,430
glpi-project/php-library-glpi
src/Glpi/Api/Rest/Client.php
Client.addTokens
private function addTokens() { $headers = []; if ($this->appToken !== null) { $headers['App-Token'] = $this->appToken; } if ($this->sessionToken !== null) { $headers['Session-Token'] = $this->sessionToken; } return $headers; }
php
private function addTokens() { $headers = []; if ($this->appToken !== null) { $headers['App-Token'] = $this->appToken; } if ($this->sessionToken !== null) { $headers['Session-Token'] = $this->sessionToken; } return $headers; }
[ "private", "function", "addTokens", "(", ")", "{", "$", "headers", "=", "[", "]", ";", "if", "(", "$", "this", "->", "appToken", "!==", "null", ")", "{", "$", "headers", "[", "'App-Token'", "]", "=", "$", "this", "->", "appToken", ";", "}", "if", ...
generate headers containing session and app tokens for Http client object @return string[]
[ "generate", "headers", "containing", "session", "and", "app", "tokens", "for", "Http", "client", "object" ]
d4195eb627b0d40c81e21f0c44bd94363a3b32fb
https://github.com/glpi-project/php-library-glpi/blob/d4195eb627b0d40c81e21f0c44bd94363a3b32fb/src/Glpi/Api/Rest/Client.php#L184-L194
187,431
glpi-project/php-library-glpi
RoboFile.php
RoboFile.makeChangelog
public function makeChangelog($repository) { $repoPrefix = 'remotes/upstream/'; $parentRevision = 'master'; $currentRevision = 'develop'; $changelog = $this->taskChangelog(); $command = 'git describe --abbrev=0 --tags'; $lastTag = $this->_exec($command)->getMessage(); if ($las...
php
public function makeChangelog($repository) { $repoPrefix = 'remotes/upstream/'; $parentRevision = 'master'; $currentRevision = 'develop'; $changelog = $this->taskChangelog(); $command = 'git describe --abbrev=0 --tags'; $lastTag = $this->_exec($command)->getMessage(); if ($las...
[ "public", "function", "makeChangelog", "(", "$", "repository", ")", "{", "$", "repoPrefix", "=", "'remotes/upstream/'", ";", "$", "parentRevision", "=", "'master'", ";", "$", "currentRevision", "=", "'develop'", ";", "$", "changelog", "=", "$", "this", "->", ...
Task to create the changelog of the project @param string $repository name @return \Robo\Result|\Robo\ResultData @throws Exception
[ "Task", "to", "create", "the", "changelog", "of", "the", "project" ]
d4195eb627b0d40c81e21f0c44bd94363a3b32fb
https://github.com/glpi-project/php-library-glpi/blob/d4195eb627b0d40c81e21f0c44bd94363a3b32fb/RoboFile.php#L34-L85
187,432
glpi-project/php-library-glpi
RoboFile.php
RoboFile.publishRelease
public function publishRelease($repository, $label = 'none', $origin = '') { if (!in_array($label, ['rc', 'beta', 'alpha', 'none'])) { throw new \InvalidArgumentException('Release label, can be rc, beta, alpha or none'); } $this->options['label'] = $label; // changelog generation ...
php
public function publishRelease($repository, $label = 'none', $origin = '') { if (!in_array($label, ['rc', 'beta', 'alpha', 'none'])) { throw new \InvalidArgumentException('Release label, can be rc, beta, alpha or none'); } $this->options['label'] = $label; // changelog generation ...
[ "public", "function", "publishRelease", "(", "$", "repository", ",", "$", "label", "=", "'none'", ",", "$", "origin", "=", "''", ")", "{", "if", "(", "!", "in_array", "(", "$", "label", ",", "[", "'rc'", ",", "'beta'", ",", "'alpha'", ",", "'none'", ...
Task to publish a release similar to git-flow @param $repository @param string $label @param string $origin @throws Exception
[ "Task", "to", "publish", "a", "release", "similar", "to", "git", "-", "flow" ]
d4195eb627b0d40c81e21f0c44bd94363a3b32fb
https://github.com/glpi-project/php-library-glpi/blob/d4195eb627b0d40c81e21f0c44bd94363a3b32fb/RoboFile.php#L94-L142
187,433
glpi-project/php-library-glpi
RoboFile.php
RoboFile.generateNextVersion
private function generateNextVersion($currentVersion) { $type = $this->releaseType; $label = isset($this->options['label']) ? $this->options['label'] : 'none'; // Type validation $validTypes = ['patch', 'minor', 'major']; if (!in_array($type, $validTypes)) { throw new \InvalidAr...
php
private function generateNextVersion($currentVersion) { $type = $this->releaseType; $label = isset($this->options['label']) ? $this->options['label'] : 'none'; // Type validation $validTypes = ['patch', 'minor', 'major']; if (!in_array($type, $validTypes)) { throw new \InvalidAr...
[ "private", "function", "generateNextVersion", "(", "$", "currentVersion", ")", "{", "$", "type", "=", "$", "this", "->", "releaseType", ";", "$", "label", "=", "isset", "(", "$", "this", "->", "options", "[", "'label'", "]", ")", "?", "$", "this", "->"...
Generate the next semantic version @param $currentVersion @return string @throws Exception
[ "Generate", "the", "next", "semantic", "version" ]
d4195eb627b0d40c81e21f0c44bd94363a3b32fb
https://github.com/glpi-project/php-library-glpi/blob/d4195eb627b0d40c81e21f0c44bd94363a3b32fb/RoboFile.php#L167-L237
187,434
glpi-project/php-library-glpi
src/Glpi/Api/Rest/EndPointHandler.php
EndPointHandler.getMyProfiles
public function getMyProfiles() { $response = $this->client->request('get', 'getMyProfiles'); return [ 'statusCode' => $response->getStatusCode(), 'body' => $response->getBody()->getContents(), ]; }
php
public function getMyProfiles() { $response = $this->client->request('get', 'getMyProfiles'); return [ 'statusCode' => $response->getStatusCode(), 'body' => $response->getBody()->getContents(), ]; }
[ "public", "function", "getMyProfiles", "(", ")", "{", "$", "response", "=", "$", "this", "->", "client", "->", "request", "(", "'get'", ",", "'getMyProfiles'", ")", ";", "return", "[", "'statusCode'", "=>", "$", "response", "->", "getStatusCode", "(", ")",...
Return all the profiles associated to logged user. @return array
[ "Return", "all", "the", "profiles", "associated", "to", "logged", "user", "." ]
d4195eb627b0d40c81e21f0c44bd94363a3b32fb
https://github.com/glpi-project/php-library-glpi/blob/d4195eb627b0d40c81e21f0c44bd94363a3b32fb/src/Glpi/Api/Rest/EndPointHandler.php#L61-L67
187,435
glpi-project/php-library-glpi
src/Glpi/Api/Rest/EndPointHandler.php
EndPointHandler.getActiveProfile
public function getActiveProfile() { $response = $this->client->request('get', 'getActiveProfile'); return [ 'statusCode' => $response->getStatusCode(), 'body' => $response->getBody()->getContents(), ]; }
php
public function getActiveProfile() { $response = $this->client->request('get', 'getActiveProfile'); return [ 'statusCode' => $response->getStatusCode(), 'body' => $response->getBody()->getContents(), ]; }
[ "public", "function", "getActiveProfile", "(", ")", "{", "$", "response", "=", "$", "this", "->", "client", "->", "request", "(", "'get'", ",", "'getActiveProfile'", ")", ";", "return", "[", "'statusCode'", "=>", "$", "response", "->", "getStatusCode", "(", ...
Return the current active profile. @return array
[ "Return", "the", "current", "active", "profile", "." ]
d4195eb627b0d40c81e21f0c44bd94363a3b32fb
https://github.com/glpi-project/php-library-glpi/blob/d4195eb627b0d40c81e21f0c44bd94363a3b32fb/src/Glpi/Api/Rest/EndPointHandler.php#L73-L79
187,436
glpi-project/php-library-glpi
src/Glpi/Api/Rest/EndPointHandler.php
EndPointHandler.getActiveEntities
public function getActiveEntities() { $response = $this->client->request('get', 'getActiveEntities'); return [ 'statusCode' => $response->getStatusCode(), 'body' => $response->getBody()->getContents(), ]; }
php
public function getActiveEntities() { $response = $this->client->request('get', 'getActiveEntities'); return [ 'statusCode' => $response->getStatusCode(), 'body' => $response->getBody()->getContents(), ]; }
[ "public", "function", "getActiveEntities", "(", ")", "{", "$", "response", "=", "$", "this", "->", "client", "->", "request", "(", "'get'", ",", "'getActiveEntities'", ")", ";", "return", "[", "'statusCode'", "=>", "$", "response", "->", "getStatusCode", "("...
Return active entities of current logged user. @return array
[ "Return", "active", "entities", "of", "current", "logged", "user", "." ]
d4195eb627b0d40c81e21f0c44bd94363a3b32fb
https://github.com/glpi-project/php-library-glpi/blob/d4195eb627b0d40c81e21f0c44bd94363a3b32fb/src/Glpi/Api/Rest/EndPointHandler.php#L115-L121
187,437
digiaonline/lumen-cors
src/CorsService.php
CorsService.isOriginAllowed
protected function isOriginAllowed(?string $origin) { if ($this->isAllOriginsAllowed()) { return true; } return str_is($this->allowOrigins, $origin); }
php
protected function isOriginAllowed(?string $origin) { if ($this->isAllOriginsAllowed()) { return true; } return str_is($this->allowOrigins, $origin); }
[ "protected", "function", "isOriginAllowed", "(", "?", "string", "$", "origin", ")", "{", "if", "(", "$", "this", "->", "isAllOriginsAllowed", "(", ")", ")", "{", "return", "true", ";", "}", "return", "str_is", "(", "$", "this", "->", "allowOrigins", ",",...
Returns whether or not the origin is allowed. @param string|null $origin @return bool
[ "Returns", "whether", "or", "not", "the", "origin", "is", "allowed", "." ]
3b4e1bdf2486ec1e2f385255f5a3cc53e2516b53
https://github.com/digiaonline/lumen-cors/blob/3b4e1bdf2486ec1e2f385255f5a3cc53e2516b53/src/CorsService.php#L194-L201
187,438
digiaonline/lumen-cors
src/CorsService.php
CorsService.isMethodAllowed
protected function isMethodAllowed(?string $method) { if ($this->isAllMethodsAllowed()) { return true; } return in_array(strtoupper($method), $this->allowMethods); }
php
protected function isMethodAllowed(?string $method) { if ($this->isAllMethodsAllowed()) { return true; } return in_array(strtoupper($method), $this->allowMethods); }
[ "protected", "function", "isMethodAllowed", "(", "?", "string", "$", "method", ")", "{", "if", "(", "$", "this", "->", "isAllMethodsAllowed", "(", ")", ")", "{", "return", "true", ";", "}", "return", "in_array", "(", "strtoupper", "(", "$", "method", ")"...
Returns whether or not the method is allowed. @param string|null $method @return bool
[ "Returns", "whether", "or", "not", "the", "method", "is", "allowed", "." ]
3b4e1bdf2486ec1e2f385255f5a3cc53e2516b53
https://github.com/digiaonline/lumen-cors/blob/3b4e1bdf2486ec1e2f385255f5a3cc53e2516b53/src/CorsService.php#L211-L218
187,439
digiaonline/lumen-cors
src/CorsService.php
CorsService.isHeaderAllowed
protected function isHeaderAllowed(?string $header) { if ($this->isAllHeadersAllowed()) { return true; } return in_array(strtolower($header), $this->allowHeaders); }
php
protected function isHeaderAllowed(?string $header) { if ($this->isAllHeadersAllowed()) { return true; } return in_array(strtolower($header), $this->allowHeaders); }
[ "protected", "function", "isHeaderAllowed", "(", "?", "string", "$", "header", ")", "{", "if", "(", "$", "this", "->", "isAllHeadersAllowed", "(", ")", ")", "{", "return", "true", ";", "}", "return", "in_array", "(", "strtolower", "(", "$", "header", ")"...
Returns whether or not the header is allowed. @param string|null $header @return bool
[ "Returns", "whether", "or", "not", "the", "header", "is", "allowed", "." ]
3b4e1bdf2486ec1e2f385255f5a3cc53e2516b53
https://github.com/digiaonline/lumen-cors/blob/3b4e1bdf2486ec1e2f385255f5a3cc53e2516b53/src/CorsService.php#L228-L235
187,440
eelkevdbos/firebase-php
src/Firebase.php
Firebase.initialize
public static function initialize($url, $token = null, $options = [], $normalizers = []) { //strap guzzle client if it is not set in as resolver property if (!isset(static::$clientResolver)) { static::setClientResolver(function ($options) { $clientOptions = isset($op...
php
public static function initialize($url, $token = null, $options = [], $normalizers = []) { //strap guzzle client if it is not set in as resolver property if (!isset(static::$clientResolver)) { static::setClientResolver(function ($options) { $clientOptions = isset($op...
[ "public", "static", "function", "initialize", "(", "$", "url", ",", "$", "token", "=", "null", ",", "$", "options", "=", "[", "]", ",", "$", "normalizers", "=", "[", "]", ")", "{", "//strap guzzle client if it is not set in as resolver property\r", "if", "(", ...
Default method to initialize a Firebase client, will set the ClientInterface dependency for you if not already set @param string $url @param null|string $token @param array $options
[ "Default", "method", "to", "initialize", "a", "Firebase", "client", "will", "set", "the", "ClientInterface", "dependency", "for", "you", "if", "not", "already", "set" ]
18aa0444773a68643e9ae1bd12118336887f891d
https://github.com/eelkevdbos/firebase-php/blob/18aa0444773a68643e9ae1bd12118336887f891d/src/Firebase.php#L58-L69
187,441
eelkevdbos/firebase-php
src/Firebase.php
Firebase.get
public function get($path = '', Criteria $criteria = null) { $request = $this->createRequest('GET', $path, $criteria); return $this->handleRequest($request); }
php
public function get($path = '', Criteria $criteria = null) { $request = $this->createRequest('GET', $path, $criteria); return $this->handleRequest($request); }
[ "public", "function", "get", "(", "$", "path", "=", "''", ",", "Criteria", "$", "criteria", "=", "null", ")", "{", "$", "request", "=", "$", "this", "->", "createRequest", "(", "'GET'", ",", "$", "path", ",", "$", "criteria", ")", ";", "return", "$...
Read data from path @param $path @return mixed
[ "Read", "data", "from", "path" ]
18aa0444773a68643e9ae1bd12118336887f891d
https://github.com/eelkevdbos/firebase-php/blob/18aa0444773a68643e9ae1bd12118336887f891d/src/Firebase.php#L96-L100
187,442
eelkevdbos/firebase-php
src/Firebase.php
Firebase.set
public function set($path, $value = self::NULL_ARGUMENT) { $request = $this->createRequest('PUT', $path, $value); return $this->handleRequest($request); }
php
public function set($path, $value = self::NULL_ARGUMENT) { $request = $this->createRequest('PUT', $path, $value); return $this->handleRequest($request); }
[ "public", "function", "set", "(", "$", "path", ",", "$", "value", "=", "self", "::", "NULL_ARGUMENT", ")", "{", "$", "request", "=", "$", "this", "->", "createRequest", "(", "'PUT'", ",", "$", "path", ",", "$", "value", ")", ";", "return", "$", "th...
Set data in path @param $path @param $value @return mixed
[ "Set", "data", "in", "path" ]
18aa0444773a68643e9ae1bd12118336887f891d
https://github.com/eelkevdbos/firebase-php/blob/18aa0444773a68643e9ae1bd12118336887f891d/src/Firebase.php#L108-L112
187,443
eelkevdbos/firebase-php
src/Firebase.php
Firebase.createRequest
protected function createRequest($method, $path, $value = null) { list($path, $value) = $this->evaluatePathValueArguments(array($path, $value)); return $this->client->createRequest($method, $this->buildUrl($path), $this->buildOptions($value)); }
php
protected function createRequest($method, $path, $value = null) { list($path, $value) = $this->evaluatePathValueArguments(array($path, $value)); return $this->client->createRequest($method, $this->buildUrl($path), $this->buildOptions($value)); }
[ "protected", "function", "createRequest", "(", "$", "method", ",", "$", "path", ",", "$", "value", "=", "null", ")", "{", "list", "(", "$", "path", ",", "$", "value", ")", "=", "$", "this", "->", "evaluatePathValueArguments", "(", "array", "(", "$", ...
Create a Request object @param string $method @param string $path @param mixed $value @return RequestInterface
[ "Create", "a", "Request", "object" ]
18aa0444773a68643e9ae1bd12118336887f891d
https://github.com/eelkevdbos/firebase-php/blob/18aa0444773a68643e9ae1bd12118336887f891d/src/Firebase.php#L156-L160
187,444
eelkevdbos/firebase-php
src/Firebase.php
Firebase.handleRequest
protected function handleRequest(RequestInterface $request) { if (!$this->getOption('batch', false)) { $response = $this->client->send($request); return $this->normalizeResponse($response); } $this->requests[] = $request; }
php
protected function handleRequest(RequestInterface $request) { if (!$this->getOption('batch', false)) { $response = $this->client->send($request); return $this->normalizeResponse($response); } $this->requests[] = $request; }
[ "protected", "function", "handleRequest", "(", "RequestInterface", "$", "request", ")", "{", "if", "(", "!", "$", "this", "->", "getOption", "(", "'batch'", ",", "false", ")", ")", "{", "$", "response", "=", "$", "this", "->", "client", "->", "send", "...
Stores requests when batching, sends request @param RequestInterface $request @return mixed
[ "Stores", "requests", "when", "batching", "sends", "request" ]
18aa0444773a68643e9ae1bd12118336887f891d
https://github.com/eelkevdbos/firebase-php/blob/18aa0444773a68643e9ae1bd12118336887f891d/src/Firebase.php#L167-L174
187,445
eelkevdbos/firebase-php
src/Firebase.php
Firebase.normalize
public function normalize($normalizer) { if (is_string($normalizer) && isset($this->normalizers[$normalizer])) { $this->normalizer = $this->normalizers[$normalizer]; } else if ($normalizer instanceof NormalizerInterface) { $this->normalizer = $normalizer; ...
php
public function normalize($normalizer) { if (is_string($normalizer) && isset($this->normalizers[$normalizer])) { $this->normalizer = $this->normalizers[$normalizer]; } else if ($normalizer instanceof NormalizerInterface) { $this->normalizer = $normalizer; ...
[ "public", "function", "normalize", "(", "$", "normalizer", ")", "{", "if", "(", "is_string", "(", "$", "normalizer", ")", "&&", "isset", "(", "$", "this", "->", "normalizers", "[", "$", "normalizer", "]", ")", ")", "{", "$", "this", "->", "normalizer",...
Set a normalizer by string or a normalizer instance @param string|NormalizerInterface $normalizer @return $this
[ "Set", "a", "normalizer", "by", "string", "or", "a", "normalizer", "instance" ]
18aa0444773a68643e9ae1bd12118336887f891d
https://github.com/eelkevdbos/firebase-php/blob/18aa0444773a68643e9ae1bd12118336887f891d/src/Firebase.php#L181-L194
187,446
eelkevdbos/firebase-php
src/Firebase.php
Firebase.normalizeResponse
protected function normalizeResponse(ResponseInterface $response) { if (!is_null($this->normalizer)) { return $this->normalizer->normalize($response); } //default responsen is decoded json return $response->json(); }
php
protected function normalizeResponse(ResponseInterface $response) { if (!is_null($this->normalizer)) { return $this->normalizer->normalize($response); } //default responsen is decoded json return $response->json(); }
[ "protected", "function", "normalizeResponse", "(", "ResponseInterface", "$", "response", ")", "{", "if", "(", "!", "is_null", "(", "$", "this", "->", "normalizer", ")", ")", "{", "return", "$", "this", "->", "normalizer", "->", "normalize", "(", "$", "resp...
Normalizes the HTTP Request Client response @param ResponseInterface $response @return mixed
[ "Normalizes", "the", "HTTP", "Request", "Client", "response" ]
18aa0444773a68643e9ae1bd12118336887f891d
https://github.com/eelkevdbos/firebase-php/blob/18aa0444773a68643e9ae1bd12118336887f891d/src/Firebase.php#L201-L209
187,447
eelkevdbos/firebase-php
src/Firebase.php
Firebase.setNormalizers
public function setNormalizers($normalizers) { foreach ($normalizers as $normalizer) { $this->normalizers[$normalizer->getName()] = $normalizer; } return $this; }
php
public function setNormalizers($normalizers) { foreach ($normalizers as $normalizer) { $this->normalizers[$normalizer->getName()] = $normalizer; } return $this; }
[ "public", "function", "setNormalizers", "(", "$", "normalizers", ")", "{", "foreach", "(", "$", "normalizers", "as", "$", "normalizer", ")", "{", "$", "this", "->", "normalizers", "[", "$", "normalizer", "->", "getName", "(", ")", "]", "=", "$", "normali...
Set normalizers in an associative array @param $normalizers @return $this
[ "Set", "normalizers", "in", "an", "associative", "array" ]
18aa0444773a68643e9ae1bd12118336887f891d
https://github.com/eelkevdbos/firebase-php/blob/18aa0444773a68643e9ae1bd12118336887f891d/src/Firebase.php#L216-L222
187,448
eelkevdbos/firebase-php
src/Firebase.php
Firebase.buildUrl
protected function buildUrl($path) { $baseUrl = $this->getOption('base_url'); //add trailing slash to the url if not supplied in the base_url setting nor supplied in path #6 $url = $baseUrl . ((substr($baseUrl, -1) == '/' || substr($path, 0, 1) == '/') ? '' : '/') . $path; i...
php
protected function buildUrl($path) { $baseUrl = $this->getOption('base_url'); //add trailing slash to the url if not supplied in the base_url setting nor supplied in path #6 $url = $baseUrl . ((substr($baseUrl, -1) == '/' || substr($path, 0, 1) == '/') ? '' : '/') . $path; i...
[ "protected", "function", "buildUrl", "(", "$", "path", ")", "{", "$", "baseUrl", "=", "$", "this", "->", "getOption", "(", "'base_url'", ")", ";", "//add trailing slash to the url if not supplied in the base_url setting nor supplied in path #6\r", "$", "url", "=", "$", ...
Prefix url with a base_url if present @param string $path @return string
[ "Prefix", "url", "with", "a", "base_url", "if", "present" ]
18aa0444773a68643e9ae1bd12118336887f891d
https://github.com/eelkevdbos/firebase-php/blob/18aa0444773a68643e9ae1bd12118336887f891d/src/Firebase.php#L247-L259
187,449
eelkevdbos/firebase-php
src/Firebase.php
Firebase.buildQuery
protected function buildQuery($data = null) { $params = array(); if ($data instanceof Criteria) { $params = array_merge($params, $data->getParams()); $params['orderBy'] = $data->getOrderBy(); } if ($token = $this->getOption('token', false)) { ...
php
protected function buildQuery($data = null) { $params = array(); if ($data instanceof Criteria) { $params = array_merge($params, $data->getParams()); $params['orderBy'] = $data->getOrderBy(); } if ($token = $this->getOption('token', false)) { ...
[ "protected", "function", "buildQuery", "(", "$", "data", "=", "null", ")", "{", "$", "params", "=", "array", "(", ")", ";", "if", "(", "$", "data", "instanceof", "Criteria", ")", "{", "$", "params", "=", "array_merge", "(", "$", "params", ",", "$", ...
Build Query parameters for HTTP Request Client @param $data @return array
[ "Build", "Query", "parameters", "for", "HTTP", "Request", "Client" ]
18aa0444773a68643e9ae1bd12118336887f891d
https://github.com/eelkevdbos/firebase-php/blob/18aa0444773a68643e9ae1bd12118336887f891d/src/Firebase.php#L266-L280
187,450
eelkevdbos/firebase-php
src/Firebase.php
Firebase.buildOptions
protected function buildOptions($data = null) { $options = array( 'query' => $this->buildQuery($data), 'debug' => $this->getOption('debug', false), 'timeout' => $this->getOption('timeout', 0) ); if (!is_null($data) && !($data instanceof Criteria))...
php
protected function buildOptions($data = null) { $options = array( 'query' => $this->buildQuery($data), 'debug' => $this->getOption('debug', false), 'timeout' => $this->getOption('timeout', 0) ); if (!is_null($data) && !($data instanceof Criteria))...
[ "protected", "function", "buildOptions", "(", "$", "data", "=", "null", ")", "{", "$", "options", "=", "array", "(", "'query'", "=>", "$", "this", "->", "buildQuery", "(", "$", "data", ")", ",", "'debug'", "=>", "$", "this", "->", "getOption", "(", "...
Build options array for HTTP Request Client @param mixed $data @return array
[ "Build", "options", "array", "for", "HTTP", "Request", "Client" ]
18aa0444773a68643e9ae1bd12118336887f891d
https://github.com/eelkevdbos/firebase-php/blob/18aa0444773a68643e9ae1bd12118336887f891d/src/Firebase.php#L287-L300
187,451
eelkevdbos/firebase-php
src/Firebase.php
Firebase.resolveClient
protected function resolveClient() { if (!isset($this->client)) { $this->setClient(call_user_func(static::$clientResolver, $this->getOptions())); } }
php
protected function resolveClient() { if (!isset($this->client)) { $this->setClient(call_user_func(static::$clientResolver, $this->getOptions())); } }
[ "protected", "function", "resolveClient", "(", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "client", ")", ")", "{", "$", "this", "->", "setClient", "(", "call_user_func", "(", "static", "::", "$", "clientResolver", ",", "$", "this", "->"...
Inject client dependency
[ "Inject", "client", "dependency" ]
18aa0444773a68643e9ae1bd12118336887f891d
https://github.com/eelkevdbos/firebase-php/blob/18aa0444773a68643e9ae1bd12118336887f891d/src/Firebase.php#L336-L341
187,452
eelkevdbos/firebase-php
src/Auth/TokenGenerator.php
TokenGenerator.generateToken
public function generateToken($data, $options = array()) { return $this->encodeToken( $this->buildClaims($options + array('data' => $data)), $this->secret ); }
php
public function generateToken($data, $options = array()) { return $this->encodeToken( $this->buildClaims($options + array('data' => $data)), $this->secret ); }
[ "public", "function", "generateToken", "(", "$", "data", ",", "$", "options", "=", "array", "(", ")", ")", "{", "return", "$", "this", "->", "encodeToken", "(", "$", "this", "->", "buildClaims", "(", "$", "options", "+", "array", "(", "'data'", "=>", ...
Generate a JWT token by specifying data and options @param array|null $data @param array $options @return string
[ "Generate", "a", "JWT", "token", "by", "specifying", "data", "and", "options" ]
18aa0444773a68643e9ae1bd12118336887f891d
https://github.com/eelkevdbos/firebase-php/blob/18aa0444773a68643e9ae1bd12118336887f891d/src/Auth/TokenGenerator.php#L58-L64
187,453
eelkevdbos/firebase-php
src/Auth/TokenGenerator.php
TokenGenerator.encodeToken
protected function encodeToken($claims, $secret, $hashMethod = 'HS256') { if (method_exists($encoder = $this->resolveEncoder(), 'encode')) { return call_user_func_array(array($encoder, 'encode'), array($claims, $secret, $hashMethod)); } throw new MissingEncoderException('N...
php
protected function encodeToken($claims, $secret, $hashMethod = 'HS256') { if (method_exists($encoder = $this->resolveEncoder(), 'encode')) { return call_user_func_array(array($encoder, 'encode'), array($claims, $secret, $hashMethod)); } throw new MissingEncoderException('N...
[ "protected", "function", "encodeToken", "(", "$", "claims", ",", "$", "secret", ",", "$", "hashMethod", "=", "'HS256'", ")", "{", "if", "(", "method_exists", "(", "$", "encoder", "=", "$", "this", "->", "resolveEncoder", "(", ")", ",", "'encode'", ")", ...
Encodes token using a JWT encoder @param array|object $claims @param string $secret @param string $hashMethod @return string @throws MissingEncoderException
[ "Encodes", "token", "using", "a", "JWT", "encoder" ]
18aa0444773a68643e9ae1bd12118336887f891d
https://github.com/eelkevdbos/firebase-php/blob/18aa0444773a68643e9ae1bd12118336887f891d/src/Auth/TokenGenerator.php#L74-L81
187,454
eelkevdbos/firebase-php
src/Auth/TokenGenerator.php
TokenGenerator.buildClaims
protected function buildClaims($options) { $claims = array(); foreach ($this->requiredClaims as $claimKey) { list($key, $claim) = $this->buildClaim($claimKey); $claims[$key] = $claim; } foreach (array_intersect($this->availableClaims, array_keys($op...
php
protected function buildClaims($options) { $claims = array(); foreach ($this->requiredClaims as $claimKey) { list($key, $claim) = $this->buildClaim($claimKey); $claims[$key] = $claim; } foreach (array_intersect($this->availableClaims, array_keys($op...
[ "protected", "function", "buildClaims", "(", "$", "options", ")", "{", "$", "claims", "=", "array", "(", ")", ";", "foreach", "(", "$", "this", "->", "requiredClaims", "as", "$", "claimKey", ")", "{", "list", "(", "$", "key", ",", "$", "claim", ")", ...
Build optional and required claims array @param array $options @return array
[ "Build", "optional", "and", "required", "claims", "array" ]
18aa0444773a68643e9ae1bd12118336887f891d
https://github.com/eelkevdbos/firebase-php/blob/18aa0444773a68643e9ae1bd12118336887f891d/src/Auth/TokenGenerator.php#L105-L120
187,455
eelkevdbos/firebase-php
src/Auth/TokenGenerator.php
TokenGenerator.buildClaim
protected function buildClaim($key, $arg = null) { $claimBuilder = sprintf('build%sClaim', ucfirst($key)); return $this->{$claimBuilder}($arg); }
php
protected function buildClaim($key, $arg = null) { $claimBuilder = sprintf('build%sClaim', ucfirst($key)); return $this->{$claimBuilder}($arg); }
[ "protected", "function", "buildClaim", "(", "$", "key", ",", "$", "arg", "=", "null", ")", "{", "$", "claimBuilder", "=", "sprintf", "(", "'build%sClaim'", ",", "ucfirst", "(", "$", "key", ")", ")", ";", "return", "$", "this", "->", "{", "$", "claimB...
Constructs builder method and executes with arguments @param string $key @param mixed|null $arg @return mixed
[ "Constructs", "builder", "method", "and", "executes", "with", "arguments" ]
18aa0444773a68643e9ae1bd12118336887f891d
https://github.com/eelkevdbos/firebase-php/blob/18aa0444773a68643e9ae1bd12118336887f891d/src/Auth/TokenGenerator.php#L128-L132
187,456
eelkevdbos/firebase-php
src/Auth/TokenGenerator.php
TokenGenerator.getValidTimestamp
protected function getValidTimestamp($value) { if (gettype($value) == 'integer') { return $value; } if ($value instanceof DateTime) { return $value->getTimestamp(); } throw new UnexpectedValueException('Instance of DateTime required for a v...
php
protected function getValidTimestamp($value) { if (gettype($value) == 'integer') { return $value; } if ($value instanceof DateTime) { return $value->getTimestamp(); } throw new UnexpectedValueException('Instance of DateTime required for a v...
[ "protected", "function", "getValidTimestamp", "(", "$", "value", ")", "{", "if", "(", "gettype", "(", "$", "value", ")", "==", "'integer'", ")", "{", "return", "$", "value", ";", "}", "if", "(", "$", "value", "instanceof", "DateTime", ")", "{", "return...
Make sure the tmiestamp is formatted in seconds after epoch @param \DateTime|integer $value @return int @throws \UnexpectedValueException
[ "Make", "sure", "the", "tmiestamp", "is", "formatted", "in", "seconds", "after", "epoch" ]
18aa0444773a68643e9ae1bd12118336887f891d
https://github.com/eelkevdbos/firebase-php/blob/18aa0444773a68643e9ae1bd12118336887f891d/src/Auth/TokenGenerator.php#L200-L211
187,457
eelkevdbos/firebase-php
src/Auth/TokenGenerator.php
TokenGenerator.buildDataClaim
protected function buildDataClaim($value) { @json_encode($value); if (($errorCode = json_last_error()) !== JSON_ERROR_NONE) { throw new UnexpectedValueException($this->jsonErrorMessage($errorCode)); } return array('d', $value); }
php
protected function buildDataClaim($value) { @json_encode($value); if (($errorCode = json_last_error()) !== JSON_ERROR_NONE) { throw new UnexpectedValueException($this->jsonErrorMessage($errorCode)); } return array('d', $value); }
[ "protected", "function", "buildDataClaim", "(", "$", "value", ")", "{", "@", "json_encode", "(", "$", "value", ")", ";", "if", "(", "(", "$", "errorCode", "=", "json_last_error", "(", ")", ")", "!==", "JSON_ERROR_NONE", ")", "{", "throw", "new", "Unexpec...
Tests if data supplied is JSONifiable @param $value @return array @throws UnexpectedValueException
[ "Tests", "if", "data", "supplied", "is", "JSONifiable" ]
18aa0444773a68643e9ae1bd12118336887f891d
https://github.com/eelkevdbos/firebase-php/blob/18aa0444773a68643e9ae1bd12118336887f891d/src/Auth/TokenGenerator.php#L219-L229
187,458
eelkevdbos/firebase-php
src/Auth/TokenGenerator.php
TokenGenerator.jsonErrorMessage
protected function jsonErrorMessage($errorNumber) { $messages = array( JSON_ERROR_NONE => 'No error has occured', JSON_ERROR_DEPTH => 'The maximum stack depth has been exceeded', JSON_ERROR_STATE_MISMATCH => 'Invalid or malformed JSON', JSON_ERROR_CTRL_C...
php
protected function jsonErrorMessage($errorNumber) { $messages = array( JSON_ERROR_NONE => 'No error has occured', JSON_ERROR_DEPTH => 'The maximum stack depth has been exceeded', JSON_ERROR_STATE_MISMATCH => 'Invalid or malformed JSON', JSON_ERROR_CTRL_C...
[ "protected", "function", "jsonErrorMessage", "(", "$", "errorNumber", ")", "{", "$", "messages", "=", "array", "(", "JSON_ERROR_NONE", "=>", "'No error has occured'", ",", "JSON_ERROR_DEPTH", "=>", "'The maximum stack depth has been exceeded'", ",", "JSON_ERROR_STATE_MISMAT...
Returns an error message @param integer $errorNumber @return string
[ "Returns", "an", "error", "message" ]
18aa0444773a68643e9ae1bd12118336887f891d
https://github.com/eelkevdbos/firebase-php/blob/18aa0444773a68643e9ae1bd12118336887f891d/src/Auth/TokenGenerator.php#L236-L247
187,459
eelkevdbos/firebase-php
src/Criteria.php
Criteria.addDoubleQuotes
public static function addDoubleQuotes($input) { $output = $input; if (substr($input, 0, 1) !== '"') { $output = '"' . $output; } if (substr(strrev($input), 0, 1) !== '"') { $output = $output . '"'; } return $output; }
php
public static function addDoubleQuotes($input) { $output = $input; if (substr($input, 0, 1) !== '"') { $output = '"' . $output; } if (substr(strrev($input), 0, 1) !== '"') { $output = $output . '"'; } return $output; }
[ "public", "static", "function", "addDoubleQuotes", "(", "$", "input", ")", "{", "$", "output", "=", "$", "input", ";", "if", "(", "substr", "(", "$", "input", ",", "0", ",", "1", ")", "!==", "'\"'", ")", "{", "$", "output", "=", "'\"'", ".", "$",...
Adds double quotes where necessary @param $input @return string
[ "Adds", "double", "quotes", "where", "necessary" ]
18aa0444773a68643e9ae1bd12118336887f891d
https://github.com/eelkevdbos/firebase-php/blob/18aa0444773a68643e9ae1bd12118336887f891d/src/Criteria.php#L85-L98
187,460
joshrps/laravel-shopify-API-wrapper
src/RocketCode/Shopify/API.php
API.verifyRequest
public function verifyRequest($data = NULL, $bypassTimeCheck = FALSE) { $da = array(); if (is_string($data)) { $each = explode('&', $data); foreach($each as $e) { list($key, $val) = explode('=', $e); $da[$key] = $val; } } elseif (is_array($data)) { $da = $data; } else { thro...
php
public function verifyRequest($data = NULL, $bypassTimeCheck = FALSE) { $da = array(); if (is_string($data)) { $each = explode('&', $data); foreach($each as $e) { list($key, $val) = explode('=', $e); $da[$key] = $val; } } elseif (is_array($data)) { $da = $data; } else { thro...
[ "public", "function", "verifyRequest", "(", "$", "data", "=", "NULL", ",", "$", "bypassTimeCheck", "=", "FALSE", ")", "{", "$", "da", "=", "array", "(", ")", ";", "if", "(", "is_string", "(", "$", "data", ")", ")", "{", "$", "each", "=", "explode",...
Verifies data returned by OAuth call @param array|string $data @return bool @throws \Exception
[ "Verifies", "data", "returned", "by", "OAuth", "call" ]
8754ce106b3393b70bc74f99619602f676ff4ead
https://github.com/joshrps/laravel-shopify-API-wrapper/blob/8754ce106b3393b70bc74f99619602f676ff4ead/src/RocketCode/Shopify/API.php#L31-L77
187,461
joshrps/laravel-shopify-API-wrapper
src/RocketCode/Shopify/API.php
API.getAccessToken
public function getAccessToken($code = '') { $dta = array('client_id' => $this->_API['API_KEY'], 'client_secret' => $this->_API['API_SECRET'], 'code' => $code); $data = $this->call(['METHOD' => 'POST', 'URL' => 'https://' . $this->_API['SHOP_DOMAIN'] . '/admin/oauth/access_token', 'DATA' => $dta], FALSE); retur...
php
public function getAccessToken($code = '') { $dta = array('client_id' => $this->_API['API_KEY'], 'client_secret' => $this->_API['API_SECRET'], 'code' => $code); $data = $this->call(['METHOD' => 'POST', 'URL' => 'https://' . $this->_API['SHOP_DOMAIN'] . '/admin/oauth/access_token', 'DATA' => $dta], FALSE); retur...
[ "public", "function", "getAccessToken", "(", "$", "code", "=", "''", ")", "{", "$", "dta", "=", "array", "(", "'client_id'", "=>", "$", "this", "->", "_API", "[", "'API_KEY'", "]", ",", "'client_secret'", "=>", "$", "this", "->", "_API", "[", "'API_SEC...
Calls API and returns OAuth Access Token, which will be needed for all future requests @param string $code @return mixed @throws \Exception
[ "Calls", "API", "and", "returns", "OAuth", "Access", "Token", "which", "will", "be", "needed", "for", "all", "future", "requests" ]
8754ce106b3393b70bc74f99619602f676ff4ead
https://github.com/joshrps/laravel-shopify-API-wrapper/blob/8754ce106b3393b70bc74f99619602f676ff4ead/src/RocketCode/Shopify/API.php#L85-L91
187,462
joshrps/laravel-shopify-API-wrapper
src/RocketCode/Shopify/API.php
API.installURL
public function installURL($data = array()) { // https://{shop}.myshopify.com/admin/oauth/authorize?client_id={api_key}&scope={scopes}&redirect_uri={redirect_uri} return 'https://' . $this->_API['SHOP_DOMAIN'] . '/admin/oauth/authorize?client_id=' . $this->_API['API_KEY'] . '&scope=' . implode(',', $data['permissi...
php
public function installURL($data = array()) { // https://{shop}.myshopify.com/admin/oauth/authorize?client_id={api_key}&scope={scopes}&redirect_uri={redirect_uri} return 'https://' . $this->_API['SHOP_DOMAIN'] . '/admin/oauth/authorize?client_id=' . $this->_API['API_KEY'] . '&scope=' . implode(',', $data['permissi...
[ "public", "function", "installURL", "(", "$", "data", "=", "array", "(", ")", ")", "{", "// https://{shop}.myshopify.com/admin/oauth/authorize?client_id={api_key}&scope={scopes}&redirect_uri={redirect_uri}", "return", "'https://'", ".", "$", "this", "->", "_API", "[", "'SHO...
Returns a string of the install URL for the app @param array $data @return string
[ "Returns", "a", "string", "of", "the", "install", "URL", "for", "the", "app" ]
8754ce106b3393b70bc74f99619602f676ff4ead
https://github.com/joshrps/laravel-shopify-API-wrapper/blob/8754ce106b3393b70bc74f99619602f676ff4ead/src/RocketCode/Shopify/API.php#L98-L102
187,463
anlutro/php-curl
src/Request.php
Request.setMethod
public function setMethod($method) { $method = strtolower($method); if (!array_key_exists($method, static::$methods)) { throw new \InvalidArgumentException("Method [$method] not a valid HTTP method."); } if ($this->data && !static::$methods[$method]) { throw new \LogicException('Request has POST data, ...
php
public function setMethod($method) { $method = strtolower($method); if (!array_key_exists($method, static::$methods)) { throw new \InvalidArgumentException("Method [$method] not a valid HTTP method."); } if ($this->data && !static::$methods[$method]) { throw new \LogicException('Request has POST data, ...
[ "public", "function", "setMethod", "(", "$", "method", ")", "{", "$", "method", "=", "strtolower", "(", "$", "method", ")", ";", "if", "(", "!", "array_key_exists", "(", "$", "method", ",", "static", "::", "$", "methods", ")", ")", "{", "throw", "new...
Set the HTTP method of the request. @param string $method
[ "Set", "the", "HTTP", "method", "of", "the", "request", "." ]
a2809a2a64cacf83fa7b9e5365b7613635049ef6
https://github.com/anlutro/php-curl/blob/a2809a2a64cacf83fa7b9e5365b7613635049ef6/src/Request.php#L115-L130
187,464
anlutro/php-curl
src/Request.php
Request.setHeader
public function setHeader($key, $value = null, $preserveCase = false) { if ($value === null) { list($key, $value) = explode(':', $value, 2); } if (!$preserveCase) { $key = strtolower($key); } $key = trim($key); $this->headers[$key] = trim($value); return $this; }
php
public function setHeader($key, $value = null, $preserveCase = false) { if ($value === null) { list($key, $value) = explode(':', $value, 2); } if (!$preserveCase) { $key = strtolower($key); } $key = trim($key); $this->headers[$key] = trim($value); return $this; }
[ "public", "function", "setHeader", "(", "$", "key", ",", "$", "value", "=", "null", ",", "$", "preserveCase", "=", "false", ")", "{", "if", "(", "$", "value", "===", "null", ")", "{", "list", "(", "$", "key", ",", "$", "value", ")", "=", "explode...
Set a specific header to be sent with the request. @param string $key Can also be a string in "foo: bar" format @param mixed $value @param boolean $preserveCase
[ "Set", "a", "specific", "header", "to", "be", "sent", "with", "the", "request", "." ]
a2809a2a64cacf83fa7b9e5365b7613635049ef6
https://github.com/anlutro/php-curl/blob/a2809a2a64cacf83fa7b9e5365b7613635049ef6/src/Request.php#L171-L185
187,465
anlutro/php-curl
src/Request.php
Request.getHeader
public function getHeader($key) { $key = strtolower($key); return isset($this->headers[$key]) ? $this->headers[$key] : null; }
php
public function getHeader($key) { $key = strtolower($key); return isset($this->headers[$key]) ? $this->headers[$key] : null; }
[ "public", "function", "getHeader", "(", "$", "key", ")", "{", "$", "key", "=", "strtolower", "(", "$", "key", ")", ";", "return", "isset", "(", "$", "this", "->", "headers", "[", "$", "key", "]", ")", "?", "$", "this", "->", "headers", "[", "$", ...
Get a specific header from the request. @param string $key @return mixed
[ "Get", "a", "specific", "header", "from", "the", "request", "." ]
a2809a2a64cacf83fa7b9e5365b7613635049ef6
https://github.com/anlutro/php-curl/blob/a2809a2a64cacf83fa7b9e5365b7613635049ef6/src/Request.php#L214-L219
187,466
anlutro/php-curl
src/Request.php
Request.updateCookieHeader
private function updateCookieHeader() { $strings = array(); foreach ($this->cookies as $key => $value) { $strings[] = "{$key}={$value}"; } $this->setHeader('cookie', implode('; ', $strings)); }
php
private function updateCookieHeader() { $strings = array(); foreach ($this->cookies as $key => $value) { $strings[] = "{$key}={$value}"; } $this->setHeader('cookie', implode('; ', $strings)); }
[ "private", "function", "updateCookieHeader", "(", ")", "{", "$", "strings", "=", "array", "(", ")", ";", "foreach", "(", "$", "this", "->", "cookies", "as", "$", "key", "=>", "$", "value", ")", "{", "$", "strings", "[", "]", "=", "\"{$key}={$value}\"",...
Read the request cookies and set the cookie header. @return void
[ "Read", "the", "request", "cookies", "and", "set", "the", "cookie", "header", "." ]
a2809a2a64cacf83fa7b9e5365b7613635049ef6
https://github.com/anlutro/php-curl/blob/a2809a2a64cacf83fa7b9e5365b7613635049ef6/src/Request.php#L263-L272
187,467
anlutro/php-curl
src/Request.php
Request.setData
public function setData($data) { if ($data && !static::$methods[$this->method]) { throw new \InvalidArgumentException("HTTP method [$this->method] does not allow POST data."); } $this->data = $data; return $this; }
php
public function setData($data) { if ($data && !static::$methods[$this->method]) { throw new \InvalidArgumentException("HTTP method [$this->method] does not allow POST data."); } $this->data = $data; return $this; }
[ "public", "function", "setData", "(", "$", "data", ")", "{", "if", "(", "$", "data", "&&", "!", "static", "::", "$", "methods", "[", "$", "this", "->", "method", "]", ")", "{", "throw", "new", "\\", "InvalidArgumentException", "(", "\"HTTP method [$this-...
Set the POST data to be sent with the request. @param mixed $data
[ "Set", "the", "POST", "data", "to", "be", "sent", "with", "the", "request", "." ]
a2809a2a64cacf83fa7b9e5365b7613635049ef6
https://github.com/anlutro/php-curl/blob/a2809a2a64cacf83fa7b9e5365b7613635049ef6/src/Request.php#L322-L331
187,468
anlutro/php-curl
src/Request.php
Request.encodeData
public function encodeData() { switch ($this->encoding) { case static::ENCODING_JSON: return json_encode($this->data); case static::ENCODING_QUERY: return (!is_null($this->data) ? http_build_query($this->data) : ''); case static::ENCODING_RAW: return $this->data; default: $msg = "Encoding...
php
public function encodeData() { switch ($this->encoding) { case static::ENCODING_JSON: return json_encode($this->data); case static::ENCODING_QUERY: return (!is_null($this->data) ? http_build_query($this->data) : ''); case static::ENCODING_RAW: return $this->data; default: $msg = "Encoding...
[ "public", "function", "encodeData", "(", ")", "{", "switch", "(", "$", "this", "->", "encoding", ")", "{", "case", "static", "::", "ENCODING_JSON", ":", "return", "json_encode", "(", "$", "this", "->", "data", ")", ";", "case", "static", "::", "ENCODING_...
Encode the POST data as a string. @return string
[ "Encode", "the", "POST", "data", "as", "a", "string", "." ]
a2809a2a64cacf83fa7b9e5365b7613635049ef6
https://github.com/anlutro/php-curl/blob/a2809a2a64cacf83fa7b9e5365b7613635049ef6/src/Request.php#L394-L407
187,469
anlutro/php-curl
src/Request.php
Request.auth
public function auth($user, $pass) { $this->user = $user; $this->pass = $pass; return $this; }
php
public function auth($user, $pass) { $this->user = $user; $this->pass = $pass; return $this; }
[ "public", "function", "auth", "(", "$", "user", ",", "$", "pass", ")", "{", "$", "this", "->", "user", "=", "$", "user", ";", "$", "this", "->", "pass", "=", "$", "pass", ";", "return", "$", "this", ";", "}" ]
Set the HTTP basic username and password. @param string $user @param string $pass @return string
[ "Set", "the", "HTTP", "basic", "username", "and", "password", "." ]
a2809a2a64cacf83fa7b9e5365b7613635049ef6
https://github.com/anlutro/php-curl/blob/a2809a2a64cacf83fa7b9e5365b7613635049ef6/src/Request.php#L464-L470
187,470
anlutro/php-curl
src/cURL.php
cURL.buildUrl
public function buildUrl($url, array $query) { if (empty($query)) { return $url; } $parts = parse_url($url); $queryString = ''; if (isset($parts['query']) && $parts['query']) { $queryString .= $parts['query'].'&'.http_build_query($query); } else { $queryString .= http_build_query($query); } ...
php
public function buildUrl($url, array $query) { if (empty($query)) { return $url; } $parts = parse_url($url); $queryString = ''; if (isset($parts['query']) && $parts['query']) { $queryString .= $parts['query'].'&'.http_build_query($query); } else { $queryString .= http_build_query($query); } ...
[ "public", "function", "buildUrl", "(", "$", "url", ",", "array", "$", "query", ")", "{", "if", "(", "empty", "(", "$", "query", ")", ")", "{", "return", "$", "url", ";", "}", "$", "parts", "=", "parse_url", "(", "$", "url", ")", ";", "$", "quer...
Build an URL with an optional query string. @param string $url the base URL without any query string @param array $query array of GET parameters @return string
[ "Build", "an", "URL", "with", "an", "optional", "query", "string", "." ]
a2809a2a64cacf83fa7b9e5365b7613635049ef6
https://github.com/anlutro/php-curl/blob/a2809a2a64cacf83fa7b9e5365b7613635049ef6/src/cURL.php#L147-L176
187,471
anlutro/php-curl
src/cURL.php
cURL.newRequest
public function newRequest($method, $url, $data = array(), $encoding = Request::ENCODING_QUERY) { $class = $this->requestClass; $request = new $class($this); if ($this->defaultHeaders) { $request->setHeaders($this->defaultHeaders); } if ($this->defaultOptions) { $request->setOptions($this->defaultOpti...
php
public function newRequest($method, $url, $data = array(), $encoding = Request::ENCODING_QUERY) { $class = $this->requestClass; $request = new $class($this); if ($this->defaultHeaders) { $request->setHeaders($this->defaultHeaders); } if ($this->defaultOptions) { $request->setOptions($this->defaultOpti...
[ "public", "function", "newRequest", "(", "$", "method", ",", "$", "url", ",", "$", "data", "=", "array", "(", ")", ",", "$", "encoding", "=", "Request", "::", "ENCODING_QUERY", ")", "{", "$", "class", "=", "$", "this", "->", "requestClass", ";", "$",...
Create a new response object and set its values. @param string $method get, post, etc @param string $url @param mixed $data POST data @param int $encoding Request::ENCODING_* constant specifying how to process the POST data @return Request
[ "Create", "a", "new", "response", "object", "and", "set", "its", "values", "." ]
a2809a2a64cacf83fa7b9e5365b7613635049ef6
https://github.com/anlutro/php-curl/blob/a2809a2a64cacf83fa7b9e5365b7613635049ef6/src/cURL.php#L188-L205
187,472
anlutro/php-curl
src/cURL.php
cURL.newJsonRequest
public function newJsonRequest($method, $url, $data = array()) { return $this->newRequest($method, $url, $data, Request::ENCODING_JSON); }
php
public function newJsonRequest($method, $url, $data = array()) { return $this->newRequest($method, $url, $data, Request::ENCODING_JSON); }
[ "public", "function", "newJsonRequest", "(", "$", "method", ",", "$", "url", ",", "$", "data", "=", "array", "(", ")", ")", "{", "return", "$", "this", "->", "newRequest", "(", "$", "method", ",", "$", "url", ",", "$", "data", ",", "Request", "::",...
Create a new JSON request and set its values. @param string $method get, post etc @param string $url @param mixed $data POST data @return Request
[ "Create", "a", "new", "JSON", "request", "and", "set", "its", "values", "." ]
a2809a2a64cacf83fa7b9e5365b7613635049ef6
https://github.com/anlutro/php-curl/blob/a2809a2a64cacf83fa7b9e5365b7613635049ef6/src/cURL.php#L216-L219
187,473
anlutro/php-curl
src/cURL.php
cURL.prepareRequest
public function prepareRequest(Request $request) { $this->ch = curl_init(); curl_setopt($this->ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($this->ch, CURLOPT_HEADER, true); if ($auth = $request->getUserAndPass()) { curl_setopt($this->ch, CURLOPT_USERPWD, $auth); } curl_setopt($this->ch, CURLOPT_URL, ...
php
public function prepareRequest(Request $request) { $this->ch = curl_init(); curl_setopt($this->ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($this->ch, CURLOPT_HEADER, true); if ($auth = $request->getUserAndPass()) { curl_setopt($this->ch, CURLOPT_USERPWD, $auth); } curl_setopt($this->ch, CURLOPT_URL, ...
[ "public", "function", "prepareRequest", "(", "Request", "$", "request", ")", "{", "$", "this", "->", "ch", "=", "curl_init", "(", ")", ";", "curl_setopt", "(", "$", "this", "->", "ch", ",", "CURLOPT_RETURNTRANSFER", ",", "true", ")", ";", "curl_setopt", ...
Prepare the curl resource for sending a request. @param Request $request @return void
[ "Prepare", "the", "curl", "resource", "for", "sending", "a", "request", "." ]
a2809a2a64cacf83fa7b9e5365b7613635049ef6
https://github.com/anlutro/php-curl/blob/a2809a2a64cacf83fa7b9e5365b7613635049ef6/src/cURL.php#L242-L269
187,474
anlutro/php-curl
src/Response.php
Response.parseHeaders
protected function parseHeaders(array $headers) { $this->headers = array(); // find and set the HTTP status code and reason $firstHeader = array_shift($headers); if (!preg_match('/^HTTP\/\d(\.\d)? [0-9]{3}/', $firstHeader)) { throw new \InvalidArgumentException('Invalid response header'); } list(, $sta...
php
protected function parseHeaders(array $headers) { $this->headers = array(); // find and set the HTTP status code and reason $firstHeader = array_shift($headers); if (!preg_match('/^HTTP\/\d(\.\d)? [0-9]{3}/', $firstHeader)) { throw new \InvalidArgumentException('Invalid response header'); } list(, $sta...
[ "protected", "function", "parseHeaders", "(", "array", "$", "headers", ")", "{", "$", "this", "->", "headers", "=", "array", "(", ")", ";", "// find and set the HTTP status code and reason", "$", "firstHeader", "=", "array_shift", "(", "$", "headers", ")", ";", ...
Parse an array of headers. @param array $headers @return void
[ "Parse", "an", "array", "of", "headers", "." ]
a2809a2a64cacf83fa7b9e5365b7613635049ef6
https://github.com/anlutro/php-curl/blob/a2809a2a64cacf83fa7b9e5365b7613635049ef6/src/Response.php#L84-L138
187,475
acacha/laravel-social
src/Services/LaravelSocialiteService.php
LaravelSocialiteService.getEnvironmentFile
protected function getEnvironmentFile() { return $this->compiler->compile( $this->filesystem->get($this->getSocialiteEnvironmentStubFile()), [ strtoupper($this->socialNetwork) . '_OAUTH_APP_ID' => $this->oauthApp->getId(), strtoupper($this->socialNetwo...
php
protected function getEnvironmentFile() { return $this->compiler->compile( $this->filesystem->get($this->getSocialiteEnvironmentStubFile()), [ strtoupper($this->socialNetwork) . '_OAUTH_APP_ID' => $this->oauthApp->getId(), strtoupper($this->socialNetwo...
[ "protected", "function", "getEnvironmentFile", "(", ")", "{", "return", "$", "this", "->", "compiler", "->", "compile", "(", "$", "this", "->", "filesystem", "->", "get", "(", "$", "this", "->", "getSocialiteEnvironmentStubFile", "(", ")", ")", ",", "[", "...
Get environment file. @return mixed
[ "Get", "environment", "file", "." ]
f7aae2d763b589c0a1b9674077058f5a369b6ef6
https://github.com/acacha/laravel-social/blob/f7aae2d763b589c0a1b9674077058f5a369b6ef6/src/Services/LaravelSocialiteService.php#L106-L116
187,476
acacha/laravel-social
src/Services/ConfigureSocialLogin.php
ConfigureSocialLogin.showInfoAboutSocialNetwork
protected function showInfoAboutSocialNetwork() { $this->command->info('Configuring social network ' . ucfirst($this->name()) . '...'); $this->command->info('Please register a new OAuth app for ' . ucfirst($this->name()) . '. Go to URL <question>' . $this->infoURL() . '</question>'); ...
php
protected function showInfoAboutSocialNetwork() { $this->command->info('Configuring social network ' . ucfirst($this->name()) . '...'); $this->command->info('Please register a new OAuth app for ' . ucfirst($this->name()) . '. Go to URL <question>' . $this->infoURL() . '</question>'); ...
[ "protected", "function", "showInfoAboutSocialNetwork", "(", ")", "{", "$", "this", "->", "command", "->", "info", "(", "'Configuring social network '", ".", "ucfirst", "(", "$", "this", "->", "name", "(", ")", ")", ".", "'...'", ")", ";", "$", "this", "->"...
Show info about social network
[ "Show", "info", "about", "social", "network" ]
f7aae2d763b589c0a1b9674077058f5a369b6ef6
https://github.com/acacha/laravel-social/blob/f7aae2d763b589c0a1b9674077058f5a369b6ef6/src/Services/ConfigureSocialLogin.php#L55-L62
187,477
acacha/laravel-social
src/Services/ConfigureSocialLogin.php
ConfigureSocialLogin.obtainOAuthClientData
protected function obtainOAuthClientData() { $oauth = resolve(\Acacha\LaravelSocial\Services\OAuthApp::class); $oauth->setId(trim($this->command->ask('OAuth client id?'))); $oauth->setSecret(trim($this->command->ask('OAuth client secret?'))); $oauth->setRedirectUrl(trim($this->comman...
php
protected function obtainOAuthClientData() { $oauth = resolve(\Acacha\LaravelSocial\Services\OAuthApp::class); $oauth->setId(trim($this->command->ask('OAuth client id?'))); $oauth->setSecret(trim($this->command->ask('OAuth client secret?'))); $oauth->setRedirectUrl(trim($this->comman...
[ "protected", "function", "obtainOAuthClientData", "(", ")", "{", "$", "oauth", "=", "resolve", "(", "\\", "Acacha", "\\", "LaravelSocial", "\\", "Services", "\\", "OAuthApp", "::", "class", ")", ";", "$", "oauth", "->", "setId", "(", "trim", "(", "$", "t...
Obtain OAuth client data.
[ "Obtain", "OAuth", "client", "data", "." ]
f7aae2d763b589c0a1b9674077058f5a369b6ef6
https://github.com/acacha/laravel-social/blob/f7aae2d763b589c0a1b9674077058f5a369b6ef6/src/Services/ConfigureSocialLogin.php#L67-L77
187,478
acacha/laravel-social
src/Repositories/EloquentSocialUserRepository.php
EloquentSocialUserRepository.findOrCreateUser
public function findOrCreateUser($socialUser) { if ($authUser = $this->find($socialUser)) { if ($user = $authUser->user) { return $user ; } return $this->createUser($socialUser); } $userClass = $this->userModel(); if ($user = $user...
php
public function findOrCreateUser($socialUser) { if ($authUser = $this->find($socialUser)) { if ($user = $authUser->user) { return $user ; } return $this->createUser($socialUser); } $userClass = $this->userModel(); if ($user = $user...
[ "public", "function", "findOrCreateUser", "(", "$", "socialUser", ")", "{", "if", "(", "$", "authUser", "=", "$", "this", "->", "find", "(", "$", "socialUser", ")", ")", "{", "if", "(", "$", "user", "=", "$", "authUser", "->", "user", ")", "{", "re...
Return user if exists; create and return if doesn't. @param $socialUser @return User
[ "Return", "user", "if", "exists", ";", "create", "and", "return", "if", "doesn", "t", "." ]
f7aae2d763b589c0a1b9674077058f5a369b6ef6
https://github.com/acacha/laravel-social/blob/f7aae2d763b589c0a1b9674077058f5a369b6ef6/src/Repositories/EloquentSocialUserRepository.php#L28-L45
187,479
acacha/laravel-social
src/Repositories/EloquentSocialUserRepository.php
EloquentSocialUserRepository.find
public function find($socialUser) { return SocialUser::where('social_id', $socialUser->id) ->where('social_type', $this->provider)->first(); }
php
public function find($socialUser) { return SocialUser::where('social_id', $socialUser->id) ->where('social_type', $this->provider)->first(); }
[ "public", "function", "find", "(", "$", "socialUser", ")", "{", "return", "SocialUser", "::", "where", "(", "'social_id'", ",", "$", "socialUser", "->", "id", ")", "->", "where", "(", "'social_type'", ",", "$", "this", "->", "provider", ")", "->", "first...
Find social user. @param $socialUser @return mixed
[ "Find", "social", "user", "." ]
f7aae2d763b589c0a1b9674077058f5a369b6ef6
https://github.com/acacha/laravel-social/blob/f7aae2d763b589c0a1b9674077058f5a369b6ef6/src/Repositories/EloquentSocialUserRepository.php#L53-L57
187,480
acacha/laravel-social
src/Repositories/EloquentSocialUserRepository.php
EloquentSocialUserRepository.createSocialUser
public function createSocialUser($socialUser, $userId) { return SocialUser::create([ 'user_id' => $userId, 'social_id' => $socialUser->id, 'social_type' => $this->provider, 'nickname' => $socialUser->nickname, 'name' => $socialUser-...
php
public function createSocialUser($socialUser, $userId) { return SocialUser::create([ 'user_id' => $userId, 'social_id' => $socialUser->id, 'social_type' => $this->provider, 'nickname' => $socialUser->nickname, 'name' => $socialUser-...
[ "public", "function", "createSocialUser", "(", "$", "socialUser", ",", "$", "userId", ")", "{", "return", "SocialUser", "::", "create", "(", "[", "'user_id'", "=>", "$", "userId", ",", "'social_id'", "=>", "$", "socialUser", "->", "id", ",", "'social_type'",...
Create social user. @param $socialUser @param $userId @return mixed
[ "Create", "social", "user", "." ]
f7aae2d763b589c0a1b9674077058f5a369b6ef6
https://github.com/acacha/laravel-social/blob/f7aae2d763b589c0a1b9674077058f5a369b6ef6/src/Repositories/EloquentSocialUserRepository.php#L66-L78
187,481
acacha/laravel-social
src/Repositories/EloquentSocialUserRepository.php
EloquentSocialUserRepository.createUser
private function createUser($socialUser) { $user = [ 'name' => $this->validName($socialUser), 'email' => $socialUser->email, ]; if ($this->username() === 'username') { $user['username'] = $socialUser->nickname; } $userClass = $this->userMod...
php
private function createUser($socialUser) { $user = [ 'name' => $this->validName($socialUser), 'email' => $socialUser->email, ]; if ($this->username() === 'username') { $user['username'] = $socialUser->nickname; } $userClass = $this->userMod...
[ "private", "function", "createUser", "(", "$", "socialUser", ")", "{", "$", "user", "=", "[", "'name'", "=>", "$", "this", "->", "validName", "(", "$", "socialUser", ")", ",", "'email'", "=>", "$", "socialUser", "->", "email", ",", "]", ";", "if", "(...
Create regular user. @param $socialUser @return mixed
[ "Create", "regular", "user", "." ]
f7aae2d763b589c0a1b9674077058f5a369b6ef6
https://github.com/acacha/laravel-social/blob/f7aae2d763b589c0a1b9674077058f5a369b6ef6/src/Repositories/EloquentSocialUserRepository.php#L108-L119
187,482
acacha/laravel-social
src/Http/Controllers/SocialProvidersController.php
SocialProvidersController.handleProviderCallback
public function handleProviderCallback($provider) { try { $user = $this->socialProvider->driver($provider)->user(); } catch (Exception $e) { return Redirect::to('auth/' . $provider); } $this->auth->login($this->users->provider($provider)->findOrCreateUser($us...
php
public function handleProviderCallback($provider) { try { $user = $this->socialProvider->driver($provider)->user(); } catch (Exception $e) { return Redirect::to('auth/' . $provider); } $this->auth->login($this->users->provider($provider)->findOrCreateUser($us...
[ "public", "function", "handleProviderCallback", "(", "$", "provider", ")", "{", "try", "{", "$", "user", "=", "$", "this", "->", "socialProvider", "->", "driver", "(", "$", "provider", ")", "->", "user", "(", ")", ";", "}", "catch", "(", "Exception", "...
Obtain the user information from social network. @param $provider @return \Illuminate\Http\RedirectResponse
[ "Obtain", "the", "user", "information", "from", "social", "network", "." ]
f7aae2d763b589c0a1b9674077058f5a369b6ef6
https://github.com/acacha/laravel-social/blob/f7aae2d763b589c0a1b9674077058f5a369b6ef6/src/Http/Controllers/SocialProvidersController.php#L82-L93
187,483
acacha/laravel-social
src/Models/SocialUser.php
SocialUser.getAttributeFromMeta
public function getAttributeFromMeta($key) { if (! $key) { return; } // Here we will determine if the model base class itself contains this given key // since we do not want to treat any of those methods are relationships since // they are all intended as helper ...
php
public function getAttributeFromMeta($key) { if (! $key) { return; } // Here we will determine if the model base class itself contains this given key // since we do not want to treat any of those methods are relationships since // they are all intended as helper ...
[ "public", "function", "getAttributeFromMeta", "(", "$", "key", ")", "{", "if", "(", "!", "$", "key", ")", "{", "return", ";", "}", "// Here we will determine if the model base class itself contains this given key", "// since we do not want to treat any of those methods are rela...
Get an attribute from the meta field. @param string $key @return mixed
[ "Get", "an", "attribute", "from", "the", "meta", "field", "." ]
f7aae2d763b589c0a1b9674077058f5a369b6ef6
https://github.com/acacha/laravel-social/blob/f7aae2d763b589c0a1b9674077058f5a369b6ef6/src/Models/SocialUser.php#L56-L78
187,484
acacha/laravel-social
src/Providers/LaravelSocialServiceProvider.php
LaravelSocialServiceProvider.registerSocialProviderManager
private function registerSocialProviderManager() { $this->app->singleton(\Acacha\LaravelSocial\Contracts\Factory::class, function ($app) { return new SocialProviderManager($app); }); }
php
private function registerSocialProviderManager() { $this->app->singleton(\Acacha\LaravelSocial\Contracts\Factory::class, function ($app) { return new SocialProviderManager($app); }); }
[ "private", "function", "registerSocialProviderManager", "(", ")", "{", "$", "this", "->", "app", "->", "singleton", "(", "\\", "Acacha", "\\", "LaravelSocial", "\\", "Contracts", "\\", "Factory", "::", "class", ",", "function", "(", "$", "app", ")", "{", "...
Register social provider manager.
[ "Register", "social", "provider", "manager", "." ]
f7aae2d763b589c0a1b9674077058f5a369b6ef6
https://github.com/acacha/laravel-social/blob/f7aae2d763b589c0a1b9674077058f5a369b6ef6/src/Providers/LaravelSocialServiceProvider.php#L89-L94
187,485
acacha/laravel-social
src/Providers/LaravelSocialServiceProvider.php
LaravelSocialServiceProvider.registerConfigureSocialServicesManager
private function registerConfigureSocialServicesManager() { $this->app->singleton( \Acacha\LaravelSocial\Contracts\ConfigureSocialServicesFactory::class, function ($app) { return new ConfigureSocialServicesManager($app); } ); }
php
private function registerConfigureSocialServicesManager() { $this->app->singleton( \Acacha\LaravelSocial\Contracts\ConfigureSocialServicesFactory::class, function ($app) { return new ConfigureSocialServicesManager($app); } ); }
[ "private", "function", "registerConfigureSocialServicesManager", "(", ")", "{", "$", "this", "->", "app", "->", "singleton", "(", "\\", "Acacha", "\\", "LaravelSocial", "\\", "Contracts", "\\", "ConfigureSocialServicesFactory", "::", "class", ",", "function", "(", ...
Register configure social services manager.
[ "Register", "configure", "social", "services", "manager", "." ]
f7aae2d763b589c0a1b9674077058f5a369b6ef6
https://github.com/acacha/laravel-social/blob/f7aae2d763b589c0a1b9674077058f5a369b6ef6/src/Providers/LaravelSocialServiceProvider.php#L107-L115
187,486
acacha/laravel-social
src/Providers/LaravelSocialServiceProvider.php
LaravelSocialServiceProvider.registerOAuthApp
private function registerOAuthApp() { $oauth = new OAuthApp(); $this->app->instance(\Acacha\LaravelSocial\Services\OAuthApp::class, $oauth); }
php
private function registerOAuthApp() { $oauth = new OAuthApp(); $this->app->instance(\Acacha\LaravelSocial\Services\OAuthApp::class, $oauth); }
[ "private", "function", "registerOAuthApp", "(", ")", "{", "$", "oauth", "=", "new", "OAuthApp", "(", ")", ";", "$", "this", "->", "app", "->", "instance", "(", "\\", "Acacha", "\\", "LaravelSocial", "\\", "Services", "\\", "OAuthApp", "::", "class", ",",...
Register OAuth App.
[ "Register", "OAuth", "App", "." ]
f7aae2d763b589c0a1b9674077058f5a369b6ef6
https://github.com/acacha/laravel-social/blob/f7aae2d763b589c0a1b9674077058f5a369b6ef6/src/Providers/LaravelSocialServiceProvider.php#L120-L124
187,487
acacha/laravel-social
src/Providers/LaravelSocialServiceProvider.php
LaravelSocialServiceProvider.registerLaravelSocialiteService
private function registerLaravelSocialiteService() { $this->app->bind(\Acacha\LaravelSocial\Services\LaravelSocialiteService::class, function ($app) { return new LaravelSocialiteService( new \Acacha\Filesystem\Compiler\StubFileCompiler(), new \Acacha\Filesystem\Fi...
php
private function registerLaravelSocialiteService() { $this->app->bind(\Acacha\LaravelSocial\Services\LaravelSocialiteService::class, function ($app) { return new LaravelSocialiteService( new \Acacha\Filesystem\Compiler\StubFileCompiler(), new \Acacha\Filesystem\Fi...
[ "private", "function", "registerLaravelSocialiteService", "(", ")", "{", "$", "this", "->", "app", "->", "bind", "(", "\\", "Acacha", "\\", "LaravelSocial", "\\", "Services", "\\", "LaravelSocialiteService", "::", "class", ",", "function", "(", "$", "app", ")"...
Register Laravel Socialite service.
[ "Register", "Laravel", "Socialite", "service", "." ]
f7aae2d763b589c0a1b9674077058f5a369b6ef6
https://github.com/acacha/laravel-social/blob/f7aae2d763b589c0a1b9674077058f5a369b6ef6/src/Providers/LaravelSocialServiceProvider.php#L129-L137
187,488
acacha/laravel-social
src/Providers/LaravelSocialServiceProvider.php
LaravelSocialServiceProvider.registerSocialProviders
private function registerSocialProviders() { foreach ($this->enabled as $provider) { $providerClass = $provider . 'SocialProvider'; $this->app->bind($providerClass, function ($app) use ($providerClass) { $providerClassWithNamespace = 'Acacha\LaravelSocial\SocialProvi...
php
private function registerSocialProviders() { foreach ($this->enabled as $provider) { $providerClass = $provider . 'SocialProvider'; $this->app->bind($providerClass, function ($app) use ($providerClass) { $providerClassWithNamespace = 'Acacha\LaravelSocial\SocialProvi...
[ "private", "function", "registerSocialProviders", "(", ")", "{", "foreach", "(", "$", "this", "->", "enabled", "as", "$", "provider", ")", "{", "$", "providerClass", "=", "$", "provider", ".", "'SocialProvider'", ";", "$", "this", "->", "app", "->", "bind"...
Register social providers.
[ "Register", "social", "providers", "." ]
f7aae2d763b589c0a1b9674077058f5a369b6ef6
https://github.com/acacha/laravel-social/blob/f7aae2d763b589c0a1b9674077058f5a369b6ef6/src/Providers/LaravelSocialServiceProvider.php#L142-L151
187,489
acacha/laravel-social
src/Services/ConfigureGoogleSocialLogin.php
ConfigureGoogleSocialLogin.showOptionalAdditionalInfo
protected function showOptionalAdditionalInfo() { $this->command->info('See step by step tutorial at:'); $url = 'https://blog.damirmiladinov.com/laravel/laravel-5.2-socialite-google-login.html'; $this->command->info(' <question>' . $url . '</question>'); $this->command->info('Remembe...
php
protected function showOptionalAdditionalInfo() { $this->command->info('See step by step tutorial at:'); $url = 'https://blog.damirmiladinov.com/laravel/laravel-5.2-socialite-google-login.html'; $this->command->info(' <question>' . $url . '</question>'); $this->command->info('Remembe...
[ "protected", "function", "showOptionalAdditionalInfo", "(", ")", "{", "$", "this", "->", "command", "->", "info", "(", "'See step by step tutorial at:'", ")", ";", "$", "url", "=", "'https://blog.damirmiladinov.com/laravel/laravel-5.2-socialite-google-login.html'", ";", "$"...
Show optional additional info.
[ "Show", "optional", "additional", "info", "." ]
f7aae2d763b589c0a1b9674077058f5a369b6ef6
https://github.com/acacha/laravel-social/blob/f7aae2d763b589c0a1b9674077058f5a369b6ef6/src/Services/ConfigureGoogleSocialLogin.php#L36-L45
187,490
Yousign/yousign-api-client-php
src/YsApi.php
YsApi.getListCosign
public function getListCosign(array $options = array()) { // Paramètre du service de connexion $params = $options; $this->client = $this->setClientSoap($this->URL_WSDL_COSIGN); $result = $this->client->call('getListCosign', $params, self::API_NAMESPACE, self::API_NAMESPACE, $this->cr...
php
public function getListCosign(array $options = array()) { // Paramètre du service de connexion $params = $options; $this->client = $this->setClientSoap($this->URL_WSDL_COSIGN); $result = $this->client->call('getListCosign', $params, self::API_NAMESPACE, self::API_NAMESPACE, $this->cr...
[ "public", "function", "getListCosign", "(", "array", "$", "options", "=", "array", "(", ")", ")", "{", "// Paramètre du service de connexion", "$", "params", "=", "$", "options", ";", "$", "this", "->", "client", "=", "$", "this", "->", "setClientSoap", "(",...
fonction permettant d'obtenir le listing des co-signatures. @param array $options - [ search: Chaine de caractères permettant une recherche ] - [ firstResult: index de début de recherche ] - [ count: Nombre de résultats voulu ] - [ status: Statut des signatures demandés ] - [ dateBegin: Date de début ] - [ dateEnd: Da...
[ "fonction", "permettant", "d", "obtenir", "le", "listing", "des", "co", "-", "signatures", "." ]
98db46c09d763474bad43e0f5150b84d7224e65e
https://github.com/Yousign/yousign-api-client-php/blob/98db46c09d763474bad43e0f5150b84d7224e65e/src/YsApi.php#L773-L804
187,491
Yousign/yousign-api-client-php
src/YsApi.php
YsApi.updateCosigner
public function updateCosigner($token, array $signerData) { $expectedData = array_intersect_key($signerData, array( 'firstName' => '', 'lastName' => '', 'mail' => '', 'phone' => '', 'proofLevel' => '', 'authenticationMode' => '' ...
php
public function updateCosigner($token, array $signerData) { $expectedData = array_intersect_key($signerData, array( 'firstName' => '', 'lastName' => '', 'mail' => '', 'phone' => '', 'proofLevel' => '', 'authenticationMode' => '' ...
[ "public", "function", "updateCosigner", "(", "$", "token", ",", "array", "$", "signerData", ")", "{", "$", "expectedData", "=", "array_intersect_key", "(", "$", "signerData", ",", "array", "(", "'firstName'", "=>", "''", ",", "'lastName'", "=>", "''", ",", ...
Modifie les informations d'un signataire @param $token @param array $signerData (firstName, lastName, mail, phone, proofLevel, authenticationMode) @return bool|mixed
[ "Modifie", "les", "informations", "d", "un", "signataire" ]
98db46c09d763474bad43e0f5150b84d7224e65e
https://github.com/Yousign/yousign-api-client-php/blob/98db46c09d763474bad43e0f5150b84d7224e65e/src/YsApi.php#L922-L952
187,492
Yousign/yousign-api-client-php
src/YsApi.php
YsApi.archive
public function archive($fileB64, $fileName, $subject, $date2, $type, $author, $comment, $ref, $amount, $tagsLst) { $this->client = $this->setClientSoap($this->URL_WSDL_ARCHIVE); // Construction du tableau des paramètres $fileParam = array('content' => $fileB64, ...
php
public function archive($fileB64, $fileName, $subject, $date2, $type, $author, $comment, $ref, $amount, $tagsLst) { $this->client = $this->setClientSoap($this->URL_WSDL_ARCHIVE); // Construction du tableau des paramètres $fileParam = array('content' => $fileB64, ...
[ "public", "function", "archive", "(", "$", "fileB64", ",", "$", "fileName", ",", "$", "subject", ",", "$", "date2", ",", "$", "type", ",", "$", "author", ",", "$", "comment", ",", "$", "ref", ",", "$", "amount", ",", "$", "tagsLst", ")", "{", "$"...
Fonction permettant d'archiver un ensemble de documents. @param $fileB64 @param $fileName @param $subject @param $date2 @param $type @param $author @param $comment @param $ref @param $amount @param $tagsLst @return bool
[ "Fonction", "permettant", "d", "archiver", "un", "ensemble", "de", "documents", "." ]
98db46c09d763474bad43e0f5150b84d7224e65e
https://github.com/Yousign/yousign-api-client-php/blob/98db46c09d763474bad43e0f5150b84d7224e65e/src/YsApi.php#L1012-L1051
187,493
Yousign/yousign-api-client-php
src/YsApi.php
YsApi.parseParametersFile
private function parseParametersFile($pathParametersFile) { $this->parameters = parse_ini_file($pathParametersFile, true); if (isset($this->parameters['environment'])) { $this->setEnvironment($this->parameters['environment']); } if (isset($this->parameters['login'])) { ...
php
private function parseParametersFile($pathParametersFile) { $this->parameters = parse_ini_file($pathParametersFile, true); if (isset($this->parameters['environment'])) { $this->setEnvironment($this->parameters['environment']); } if (isset($this->parameters['login'])) { ...
[ "private", "function", "parseParametersFile", "(", "$", "pathParametersFile", ")", "{", "$", "this", "->", "parameters", "=", "parse_ini_file", "(", "$", "pathParametersFile", ",", "true", ")", ";", "if", "(", "isset", "(", "$", "this", "->", "parameters", "...
Parse le fichier de configuration. @param $pathParametersFile @return $this
[ "Parse", "le", "fichier", "de", "configuration", "." ]
98db46c09d763474bad43e0f5150b84d7224e65e
https://github.com/Yousign/yousign-api-client-php/blob/98db46c09d763474bad43e0f5150b84d7224e65e/src/YsApi.php#L1176-L1213
187,494
spatie/laravel-authorize
src/Middleware/Authorize.php
Authorize.hasRequiredAbility
protected function hasRequiredAbility($user, $ability = null, $model = null) { if (!$user) { return false; } if (is_null($ability)) { return true; } /* * Some gates may check on number of arguments given. If model * is null, don't p...
php
protected function hasRequiredAbility($user, $ability = null, $model = null) { if (!$user) { return false; } if (is_null($ability)) { return true; } /* * Some gates may check on number of arguments given. If model * is null, don't p...
[ "protected", "function", "hasRequiredAbility", "(", "$", "user", ",", "$", "ability", "=", "null", ",", "$", "model", "=", "null", ")", "{", "if", "(", "!", "$", "user", ")", "{", "return", "false", ";", "}", "if", "(", "is_null", "(", "$", "abilit...
Determine if the currently logged in use has the given ability. @param $user @param string|null $ability @param \Illuminate\Database\Eloquent\Model|null $model @return bool
[ "Determine", "if", "the", "currently", "logged", "in", "use", "has", "the", "given", "ability", "." ]
5b1b9c70916c81403a9737b6c876f38c91b91aaa
https://github.com/spatie/laravel-authorize/blob/5b1b9c70916c81403a9737b6c876f38c91b91aaa/src/Middleware/Authorize.php#L60-L79
187,495
spatie/laravel-authorize
src/Middleware/Authorize.php
Authorize.handleUnauthorizedRequest
protected function handleUnauthorizedRequest($request, $ability = null, $model = null) { if ($request->ajax()) { return response('Forbidden.', Response::HTTP_FORBIDDEN); } if (!$request->user()) { return redirect()->guest(config('laravel-authorize.login_url')); ...
php
protected function handleUnauthorizedRequest($request, $ability = null, $model = null) { if ($request->ajax()) { return response('Forbidden.', Response::HTTP_FORBIDDEN); } if (!$request->user()) { return redirect()->guest(config('laravel-authorize.login_url')); ...
[ "protected", "function", "handleUnauthorizedRequest", "(", "$", "request", ",", "$", "ability", "=", "null", ",", "$", "model", "=", "null", ")", "{", "if", "(", "$", "request", "->", "ajax", "(", ")", ")", "{", "return", "response", "(", "'Forbidden.'",...
Handle the unauthorized request. @param $request @param string|null $ability @param \Illuminate\Database\Eloquent\Model|null $model @throws \Symfony\Component\HttpKernel\Exception\HttpException @return \Illuminate\Contracts\Routing\ResponseFactory|\Illuminate\Http\RedirectResponse|Respon...
[ "Handle", "the", "unauthorized", "request", "." ]
5b1b9c70916c81403a9737b6c876f38c91b91aaa
https://github.com/spatie/laravel-authorize/blob/5b1b9c70916c81403a9737b6c876f38c91b91aaa/src/Middleware/Authorize.php#L92-L103
187,496
hutnikau/job-scheduler
src/ActionInspector/FileActionInspector.php
FileActionInspector.getMessages
private function getMessages() { $messages = []; $content = ''; fseek($this->fh, 0); while (!feof($this->fh)) { $content .= fgets($this->fh); } if ($content) { $messages = json_decode($content, true); } return $messages; }
php
private function getMessages() { $messages = []; $content = ''; fseek($this->fh, 0); while (!feof($this->fh)) { $content .= fgets($this->fh); } if ($content) { $messages = json_decode($content, true); } return $messages; }
[ "private", "function", "getMessages", "(", ")", "{", "$", "messages", "=", "[", "]", ";", "$", "content", "=", "''", ";", "fseek", "(", "$", "this", "->", "fh", ",", "0", ")", ";", "while", "(", "!", "feof", "(", "$", "this", "->", "fh", ")", ...
Get action messages from log file @return array
[ "Get", "action", "messages", "from", "log", "file" ]
8aaa520d9eb6e1e3dcc79ae5d63c41fbcb9f25fc
https://github.com/hutnikau/job-scheduler/blob/8aaa520d9eb6e1e3dcc79ae5d63c41fbcb9f25fc/src/ActionInspector/FileActionInspector.php#L74-L86
187,497
hutnikau/job-scheduler
src/ActionInspector/FileActionInspector.php
FileActionInspector.save
private function save(array $messages) { fseek($this->fh, 0); fwrite($this->fh, json_encode($messages)); }
php
private function save(array $messages) { fseek($this->fh, 0); fwrite($this->fh, json_encode($messages)); }
[ "private", "function", "save", "(", "array", "$", "messages", ")", "{", "fseek", "(", "$", "this", "->", "fh", ",", "0", ")", ";", "fwrite", "(", "$", "this", "->", "fh", ",", "json_encode", "(", "$", "messages", ")", ")", ";", "}" ]
Save action messages to file @param array $messages
[ "Save", "action", "messages", "to", "file" ]
8aaa520d9eb6e1e3dcc79ae5d63c41fbcb9f25fc
https://github.com/hutnikau/job-scheduler/blob/8aaa520d9eb6e1e3dcc79ae5d63c41fbcb9f25fc/src/ActionInspector/FileActionInspector.php#L92-L96
187,498
hutnikau/job-scheduler
src/Job/RRule.php
RRule.getCollection
private function getCollection($constraint) { $rRule = new RecurrRule($this->getRrule(), $this->getStartDate()); $rRuleTransformer = new ArrayTransformer(); return $rRuleTransformer->transform($rRule, $constraint); }
php
private function getCollection($constraint) { $rRule = new RecurrRule($this->getRrule(), $this->getStartDate()); $rRuleTransformer = new ArrayTransformer(); return $rRuleTransformer->transform($rRule, $constraint); }
[ "private", "function", "getCollection", "(", "$", "constraint", ")", "{", "$", "rRule", "=", "new", "RecurrRule", "(", "$", "this", "->", "getRrule", "(", ")", ",", "$", "this", "->", "getStartDate", "(", ")", ")", ";", "$", "rRuleTransformer", "=", "n...
Get recurrence collection by given constraint @param $constraint @return Recurrence[]|\Recurr\RecurrenceCollection @throws \Recurr\Exception\InvalidRRule @throws \Recurr\Exception\InvalidWeekday
[ "Get", "recurrence", "collection", "by", "given", "constraint" ]
8aaa520d9eb6e1e3dcc79ae5d63c41fbcb9f25fc
https://github.com/hutnikau/job-scheduler/blob/8aaa520d9eb6e1e3dcc79ae5d63c41fbcb9f25fc/src/Job/RRule.php#L62-L67
187,499
hutnikau/job-scheduler
src/Action/CallableAction.php
CallableAction.hashCallable
private function hashCallable($callable) { $result = ''; if (is_string($callable)) { $result = $callable; } else if (is_array($callable)) { $callableEntity = array_shift($callable); $result = is_object($callableEntity) ? get_class($callableEntity) : serial...
php
private function hashCallable($callable) { $result = ''; if (is_string($callable)) { $result = $callable; } else if (is_array($callable)) { $callableEntity = array_shift($callable); $result = is_object($callableEntity) ? get_class($callableEntity) : serial...
[ "private", "function", "hashCallable", "(", "$", "callable", ")", "{", "$", "result", "=", "''", ";", "if", "(", "is_string", "(", "$", "callable", ")", ")", "{", "$", "result", "=", "$", "callable", ";", "}", "else", "if", "(", "is_array", "(", "$...
Get unique hash from callable @param $callable @return string
[ "Get", "unique", "hash", "from", "callable" ]
8aaa520d9eb6e1e3dcc79ae5d63c41fbcb9f25fc
https://github.com/hutnikau/job-scheduler/blob/8aaa520d9eb6e1e3dcc79ae5d63c41fbcb9f25fc/src/Action/CallableAction.php#L106-L122