repository_name
stringlengths
5
67
func_path_in_repository
stringlengths
4
234
func_name
stringlengths
0
314
whole_func_string
stringlengths
52
3.87M
language
stringclasses
6 values
func_code_string
stringlengths
52
3.87M
func_code_tokens
listlengths
15
672k
func_documentation_string
stringlengths
1
47.2k
func_documentation_tokens
listlengths
1
3.92k
split_name
stringclasses
1 value
func_code_url
stringlengths
85
339
PHPCompatibility/PHPCompatibility
PHPCompatibility/Sniffs/UseDeclarations/NewGroupUseDeclarationsSniff.php
NewGroupUseDeclarationsSniff.process
public function process(File $phpcsFile, $stackPtr) { if ($this->supportsBelow('7.1') === false) { return; } $tokens = $phpcsFile->getTokens(); $token = $tokens[$stackPtr]; // Deal with PHPCS pre-2.6.0. if ($token['code'] === \T_USE) { $hasC...
php
public function process(File $phpcsFile, $stackPtr) { if ($this->supportsBelow('7.1') === false) { return; } $tokens = $phpcsFile->getTokens(); $token = $tokens[$stackPtr]; // Deal with PHPCS pre-2.6.0. if ($token['code'] === \T_USE) { $hasC...
[ "public", "function", "process", "(", "File", "$", "phpcsFile", ",", "$", "stackPtr", ")", "{", "if", "(", "$", "this", "->", "supportsBelow", "(", "'7.1'", ")", "===", "false", ")", "{", "return", ";", "}", "$", "tokens", "=", "$", "phpcsFile", "->"...
Processes this test, when one of its tokens is encountered. @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. @param int $stackPtr The position of the current token in the stack passed in $tokens. @return void
[ "Processes", "this", "test", "when", "one", "of", "its", "tokens", "is", "encountered", "." ]
train
https://github.com/PHPCompatibility/PHPCompatibility/blob/8451ac21d652156e6742bbada166d28503ef67e4/PHPCompatibility/Sniffs/UseDeclarations/NewGroupUseDeclarationsSniff.php#L53-L104
PHPCompatibility/PHPCompatibility
PHPCompatibility/Sniffs/Lists/ForbiddenEmptyListAssignmentSniff.php
ForbiddenEmptyListAssignmentSniff.register
public function register() { // Set up a list of tokens to disregard when determining whether the list() is empty. // Only needs to be set up once. $this->ignoreTokens = Tokens::$emptyTokens; $this->ignoreTokens[\T_COMMA] = \T_COMMA; $this->i...
php
public function register() { // Set up a list of tokens to disregard when determining whether the list() is empty. // Only needs to be set up once. $this->ignoreTokens = Tokens::$emptyTokens; $this->ignoreTokens[\T_COMMA] = \T_COMMA; $this->i...
[ "public", "function", "register", "(", ")", "{", "// Set up a list of tokens to disregard when determining whether the list() is empty.", "// Only needs to be set up once.", "$", "this", "->", "ignoreTokens", "=", "Tokens", "::", "$", "emptyTokens", ";", "$", "this", "->", ...
Returns an array of tokens this test wants to listen for. @return array
[ "Returns", "an", "array", "of", "tokens", "this", "test", "wants", "to", "listen", "for", "." ]
train
https://github.com/PHPCompatibility/PHPCompatibility/blob/8451ac21d652156e6742bbada166d28503ef67e4/PHPCompatibility/Sniffs/Lists/ForbiddenEmptyListAssignmentSniff.php#L44-L57
PHPCompatibility/PHPCompatibility
PHPCompatibility/Sniffs/Lists/ForbiddenEmptyListAssignmentSniff.php
ForbiddenEmptyListAssignmentSniff.process
public function process(File $phpcsFile, $stackPtr) { if ($this->supportsAbove('7.0') === false) { return; } $tokens = $phpcsFile->getTokens(); if ($tokens[$stackPtr]['code'] === \T_OPEN_SHORT_ARRAY) { if ($this->isShortList($phpcsFile, $stackPtr) === false)...
php
public function process(File $phpcsFile, $stackPtr) { if ($this->supportsAbove('7.0') === false) { return; } $tokens = $phpcsFile->getTokens(); if ($tokens[$stackPtr]['code'] === \T_OPEN_SHORT_ARRAY) { if ($this->isShortList($phpcsFile, $stackPtr) === false)...
[ "public", "function", "process", "(", "File", "$", "phpcsFile", ",", "$", "stackPtr", ")", "{", "if", "(", "$", "this", "->", "supportsAbove", "(", "'7.0'", ")", "===", "false", ")", "{", "return", ";", "}", "$", "tokens", "=", "$", "phpcsFile", "->"...
Processes this test, when one of its tokens is encountered. @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. @param int $stackPtr The position of the current token in the stack passed in $tokens. @return void
[ "Processes", "this", "test", "when", "one", "of", "its", "tokens", "is", "encountered", "." ]
train
https://github.com/PHPCompatibility/PHPCompatibility/blob/8451ac21d652156e6742bbada166d28503ef67e4/PHPCompatibility/Sniffs/Lists/ForbiddenEmptyListAssignmentSniff.php#L68-L110
PHPCompatibility/PHPCompatibility
PHPCompatibility/Sniffs/Interfaces/InternalInterfacesSniff.php
InternalInterfacesSniff.register
public function register() { // Handle case-insensitivity of interface names. $this->internalInterfaces = $this->arrayKeysToLowercase($this->internalInterfaces); $targets = array(\T_CLASS); if (\defined('T_ANON_CLASS')) { $targets[] = \T_ANON_CLASS; } r...
php
public function register() { // Handle case-insensitivity of interface names. $this->internalInterfaces = $this->arrayKeysToLowercase($this->internalInterfaces); $targets = array(\T_CLASS); if (\defined('T_ANON_CLASS')) { $targets[] = \T_ANON_CLASS; } r...
[ "public", "function", "register", "(", ")", "{", "// Handle case-insensitivity of interface names.", "$", "this", "->", "internalInterfaces", "=", "$", "this", "->", "arrayKeysToLowercase", "(", "$", "this", "->", "internalInterfaces", ")", ";", "$", "targets", "=",...
Returns an array of tokens this test wants to listen for. @return array
[ "Returns", "an", "array", "of", "tokens", "this", "test", "wants", "to", "listen", "for", "." ]
train
https://github.com/PHPCompatibility/PHPCompatibility/blob/8451ac21d652156e6742bbada166d28503ef67e4/PHPCompatibility/Sniffs/Interfaces/InternalInterfacesSniff.php#L45-L57
PHPCompatibility/PHPCompatibility
PHPCompatibility/Sniffs/Interfaces/InternalInterfacesSniff.php
InternalInterfacesSniff.process
public function process(File $phpcsFile, $stackPtr) { $interfaces = PHPCSHelper::findImplementedInterfaceNames($phpcsFile, $stackPtr); if (\is_array($interfaces) === false || $interfaces === array()) { return; } foreach ($interfaces as $interface) { $interfa...
php
public function process(File $phpcsFile, $stackPtr) { $interfaces = PHPCSHelper::findImplementedInterfaceNames($phpcsFile, $stackPtr); if (\is_array($interfaces) === false || $interfaces === array()) { return; } foreach ($interfaces as $interface) { $interfa...
[ "public", "function", "process", "(", "File", "$", "phpcsFile", ",", "$", "stackPtr", ")", "{", "$", "interfaces", "=", "PHPCSHelper", "::", "findImplementedInterfaceNames", "(", "$", "phpcsFile", ",", "$", "stackPtr", ")", ";", "if", "(", "\\", "is_array", ...
Processes this test, when one of its tokens is encountered. @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. @param int $stackPtr The position of the current token in the stack passed in $tokens. @return void
[ "Processes", "this", "test", "when", "one", "of", "its", "tokens", "is", "encountered", "." ]
train
https://github.com/PHPCompatibility/PHPCompatibility/blob/8451ac21d652156e6742bbada166d28503ef67e4/PHPCompatibility/Sniffs/Interfaces/InternalInterfacesSniff.php#L69-L91
PHPCompatibility/PHPCompatibility
PHPCompatibility/Sniffs/InitialValue/NewConstantArraysUsingConstSniff.php
NewConstantArraysUsingConstSniff.process
public function process(File $phpcsFile, $stackPtr) { if ($this->supportsBelow('5.5') !== true) { return; } $tokens = $phpcsFile->getTokens(); $find = array( \T_ARRAY => \T_ARRAY, \T_OPEN_SHORT_ARRAY => \T_OPEN_SHORT_ARRAY, );...
php
public function process(File $phpcsFile, $stackPtr) { if ($this->supportsBelow('5.5') !== true) { return; } $tokens = $phpcsFile->getTokens(); $find = array( \T_ARRAY => \T_ARRAY, \T_OPEN_SHORT_ARRAY => \T_OPEN_SHORT_ARRAY, );...
[ "public", "function", "process", "(", "File", "$", "phpcsFile", ",", "$", "stackPtr", ")", "{", "if", "(", "$", "this", "->", "supportsBelow", "(", "'5.5'", ")", "!==", "true", ")", "{", "return", ";", "}", "$", "tokens", "=", "$", "phpcsFile", "->",...
Processes this test, when one of its tokens is encountered. @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. @param int $stackPtr The position of the current token in the stack passed in $tokens. @return void
[ "Processes", "this", "test", "when", "one", "of", "its", "tokens", "is", "encountered", "." ]
train
https://github.com/PHPCompatibility/PHPCompatibility/blob/8451ac21d652156e6742bbada166d28503ef67e4/PHPCompatibility/Sniffs/InitialValue/NewConstantArraysUsingConstSniff.php#L50-L77
PHPCompatibility/PHPCompatibility
PHPCompatibility/Sniffs/Syntax/NewArrayStringDereferencingSniff.php
NewArrayStringDereferencingSniff.process
public function process(File $phpcsFile, $stackPtr) { if ($this->supportsBelow('5.4') === false) { return; } $tokens = $phpcsFile->getTokens(); switch ($tokens[$stackPtr]['code']) { case \T_CONSTANT_ENCAPSED_STRING: $type = 'string literals';...
php
public function process(File $phpcsFile, $stackPtr) { if ($this->supportsBelow('5.4') === false) { return; } $tokens = $phpcsFile->getTokens(); switch ($tokens[$stackPtr]['code']) { case \T_CONSTANT_ENCAPSED_STRING: $type = 'string literals';...
[ "public", "function", "process", "(", "File", "$", "phpcsFile", ",", "$", "stackPtr", ")", "{", "if", "(", "$", "this", "->", "supportsBelow", "(", "'5.4'", ")", "===", "false", ")", "{", "return", ";", "}", "$", "tokens", "=", "$", "phpcsFile", "->"...
Processes this test, when one of its tokens is encountered. @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. @param int $stackPtr The position of the current token in the stack passed in $tokens. @return void
[ "Processes", "this", "test", "when", "one", "of", "its", "tokens", "is", "encountered", "." ]
train
https://github.com/PHPCompatibility/PHPCompatibility/blob/8451ac21d652156e6742bbada166d28503ef67e4/PHPCompatibility/Sniffs/Syntax/NewArrayStringDereferencingSniff.php#L54-L107
PHPCompatibility/PHPCompatibility
PHPCompatibility/Sniffs/ParameterValues/RemovedPCREModifiersSniff.php
RemovedPCREModifiersSniff.processParameters
public function processParameters(File $phpcsFile, $stackPtr, $functionName, $parameters) { // Check the first parameter in the function call as that should contain the regex(es). if (isset($parameters[1]) === false) { return; } $tokens = $phpcsFile->getTokens();...
php
public function processParameters(File $phpcsFile, $stackPtr, $functionName, $parameters) { // Check the first parameter in the function call as that should contain the regex(es). if (isset($parameters[1]) === false) { return; } $tokens = $phpcsFile->getTokens();...
[ "public", "function", "processParameters", "(", "File", "$", "phpcsFile", ",", "$", "stackPtr", ",", "$", "functionName", ",", "$", "parameters", ")", "{", "// Check the first parameter in the function call as that should contain the regex(es).", "if", "(", "isset", "(", ...
Process the parameters of a matched function. @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. @param int $stackPtr The position of the current token in the stack. @param string $functionName The token content (function name) which was matched. @param array ...
[ "Process", "the", "parameters", "of", "a", "matched", "function", "." ]
train
https://github.com/PHPCompatibility/PHPCompatibility/blob/8451ac21d652156e6742bbada166d28503ef67e4/PHPCompatibility/Sniffs/ParameterValues/RemovedPCREModifiersSniff.php#L69-L113
PHPCompatibility/PHPCompatibility
PHPCompatibility/Sniffs/ParameterValues/RemovedPCREModifiersSniff.php
RemovedPCREModifiersSniff.processRegexPattern
protected function processRegexPattern($pattern, File $phpcsFile, $stackPtr, $functionName) { $tokens = $phpcsFile->getTokens(); /* * The pattern might be build up of a combination of strings, variables * and function calls. We are only concerned with the strings. */ ...
php
protected function processRegexPattern($pattern, File $phpcsFile, $stackPtr, $functionName) { $tokens = $phpcsFile->getTokens(); /* * The pattern might be build up of a combination of strings, variables * and function calls. We are only concerned with the strings. */ ...
[ "protected", "function", "processRegexPattern", "(", "$", "pattern", ",", "File", "$", "phpcsFile", ",", "$", "stackPtr", ",", "$", "functionName", ")", "{", "$", "tokens", "=", "$", "phpcsFile", "->", "getTokens", "(", ")", ";", "/*\n * The pattern mi...
Analyse a potential regex pattern for usage of the /e modifier. @param array $pattern Array containing the start and end token pointer of the potential regex pattern and the raw string value of the pattern. @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. @param int ...
[ "Analyse", "a", "potential", "regex", "pattern", "for", "usage", "of", "the", "/", "e", "modifier", "." ]
train
https://github.com/PHPCompatibility/PHPCompatibility/blob/8451ac21d652156e6742bbada166d28503ef67e4/PHPCompatibility/Sniffs/ParameterValues/RemovedPCREModifiersSniff.php#L140-L188
PHPCompatibility/PHPCompatibility
PHPCompatibility/Sniffs/ParameterValues/RemovedPCREModifiersSniff.php
RemovedPCREModifiersSniff.examineModifiers
protected function examineModifiers(File $phpcsFile, $stackPtr, $functionName, $modifiers) { if (strpos($modifiers, 'e') !== false) { $error = '%s() - /e modifier is deprecated since PHP 5.5'; $isError = false; $errorCode = 'Deprecated'; $data = arr...
php
protected function examineModifiers(File $phpcsFile, $stackPtr, $functionName, $modifiers) { if (strpos($modifiers, 'e') !== false) { $error = '%s() - /e modifier is deprecated since PHP 5.5'; $isError = false; $errorCode = 'Deprecated'; $data = arr...
[ "protected", "function", "examineModifiers", "(", "File", "$", "phpcsFile", ",", "$", "stackPtr", ",", "$", "functionName", ",", "$", "modifiers", ")", "{", "if", "(", "strpos", "(", "$", "modifiers", ",", "'e'", ")", "!==", "false", ")", "{", "$", "er...
Examine the regex modifier string. @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. @param int $stackPtr The position of the current token in the stack passed in $tokens. @param string $functionName The function which contained the pattern. @param string ...
[ "Examine", "the", "regex", "modifier", "string", "." ]
train
https://github.com/PHPCompatibility/PHPCompatibility/blob/8451ac21d652156e6742bbada166d28503ef67e4/PHPCompatibility/Sniffs/ParameterValues/RemovedPCREModifiersSniff.php#L202-L218
PHPCompatibility/PHPCompatibility
PHPCompatibility/Sniffs/ParameterValues/NewArrayReduceInitialTypeSniff.php
NewArrayReduceInitialTypeSniff.processParameters
public function processParameters(File $phpcsFile, $stackPtr, $functionName, $parameters) { if (isset($parameters[3]) === false) { return; } $targetParam = $parameters[3]; if ($this->isNumber($phpcsFile, $targetParam['start'], $targetParam['end'], true) !== false) { ...
php
public function processParameters(File $phpcsFile, $stackPtr, $functionName, $parameters) { if (isset($parameters[3]) === false) { return; } $targetParam = $parameters[3]; if ($this->isNumber($phpcsFile, $targetParam['start'], $targetParam['end'], true) !== false) { ...
[ "public", "function", "processParameters", "(", "File", "$", "phpcsFile", ",", "$", "stackPtr", ",", "$", "functionName", ",", "$", "parameters", ")", "{", "if", "(", "isset", "(", "$", "parameters", "[", "3", "]", ")", "===", "false", ")", "{", "retur...
Process the parameters of a matched function. @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. @param int $stackPtr The position of the current token in the stack. @param string $functionName The token content (function name) which was matched. @param array ...
[ "Process", "the", "parameters", "of", "a", "matched", "function", "." ]
train
https://github.com/PHPCompatibility/PHPCompatibility/blob/8451ac21d652156e6742bbada166d28503ef67e4/PHPCompatibility/Sniffs/ParameterValues/NewArrayReduceInitialTypeSniff.php#L74-L105
PHPCompatibility/PHPCompatibility
PHPCompatibility/Sniffs/Upgrade/LowPHPCSSniff.php
LowPHPCSSniff.process
public function process(File $phpcsFile, $stackPtr) { // Don't do anything if the warning has already been thrown or is not necessary. if ($this->examine === false) { return ($phpcsFile->numTokens + 1); } $phpcsVersion = PHPCSHelper::getVersion(); // Don't do an...
php
public function process(File $phpcsFile, $stackPtr) { // Don't do anything if the warning has already been thrown or is not necessary. if ($this->examine === false) { return ($phpcsFile->numTokens + 1); } $phpcsVersion = PHPCSHelper::getVersion(); // Don't do an...
[ "public", "function", "process", "(", "File", "$", "phpcsFile", ",", "$", "stackPtr", ")", "{", "// Don't do anything if the warning has already been thrown or is not necessary.", "if", "(", "$", "this", "->", "examine", "===", "false", ")", "{", "return", "(", "$",...
Processes this test, when one of its tokens is encountered. @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. @param int $stackPtr The position of the current token in the stack passed in $tokens. @return void
[ "Processes", "this", "test", "when", "one", "of", "its", "tokens", "is", "encountered", "." ]
train
https://github.com/PHPCompatibility/PHPCompatibility/blob/8451ac21d652156e6742bbada166d28503ef67e4/PHPCompatibility/Sniffs/Upgrade/LowPHPCSSniff.php#L88-L170
PHPCompatibility/PHPCompatibility
PHPCompatibility/Sniffs/FunctionNameRestrictions/RemovedPHP4StyleConstructorsSniff.php
RemovedPHP4StyleConstructorsSniff.process
public function process(File $phpcsFile, $stackPtr) { if ($this->supportsAbove('7.0') === false) { return; } if ($this->determineNamespace($phpcsFile, $stackPtr) !== '') { /* * Namespaced methods with the same name as the class are treated as ...
php
public function process(File $phpcsFile, $stackPtr) { if ($this->supportsAbove('7.0') === false) { return; } if ($this->determineNamespace($phpcsFile, $stackPtr) !== '') { /* * Namespaced methods with the same name as the class are treated as ...
[ "public", "function", "process", "(", "File", "$", "phpcsFile", ",", "$", "stackPtr", ")", "{", "if", "(", "$", "this", "->", "supportsAbove", "(", "'7.0'", ")", "===", "false", ")", "{", "return", ";", "}", "if", "(", "$", "this", "->", "determineNa...
Processes this test, when one of its tokens is encountered. @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. @param int $stackPtr The position of the current token in the stack passed in $tokens. @return void
[ "Processes", "this", "test", "when", "one", "of", "its", "tokens", "is", "encountered", "." ]
train
https://github.com/PHPCompatibility/PHPCompatibility/blob/8451ac21d652156e6742bbada166d28503ef67e4/PHPCompatibility/Sniffs/FunctionNameRestrictions/RemovedPHP4StyleConstructorsSniff.php#L52-L134
PHPCompatibility/PHPCompatibility
PHPCompatibility/Sniffs/Lists/NewShortListSniff.php
NewShortListSniff.process
public function process(File $phpcsFile, $stackPtr) { if ($this->supportsBelow('7.0') === false) { return; } if ($this->isShortList($phpcsFile, $stackPtr) === false) { return; } $tokens = $phpcsFile->getTokens(); $closer = $tokens[$stackPtr][...
php
public function process(File $phpcsFile, $stackPtr) { if ($this->supportsBelow('7.0') === false) { return; } if ($this->isShortList($phpcsFile, $stackPtr) === false) { return; } $tokens = $phpcsFile->getTokens(); $closer = $tokens[$stackPtr][...
[ "public", "function", "process", "(", "File", "$", "phpcsFile", ",", "$", "stackPtr", ")", "{", "if", "(", "$", "this", "->", "supportsBelow", "(", "'7.0'", ")", "===", "false", ")", "{", "return", ";", "}", "if", "(", "$", "this", "->", "isShortList...
Processes this test, when one of its tokens is encountered. @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. @param int $stackPtr The position of the current token in the stack passed in $tokens. @return void
[ "Processes", "this", "test", "when", "one", "of", "its", "tokens", "is", "encountered", "." ]
train
https://github.com/PHPCompatibility/PHPCompatibility/blob/8451ac21d652156e6742bbada166d28503ef67e4/PHPCompatibility/Sniffs/Lists/NewShortListSniff.php#L52-L78
PHPCompatibility/PHPCompatibility
PHPCompatibility/Sniffs/FunctionUse/ArgumentFunctionsUsageSniff.php
ArgumentFunctionsUsageSniff.process
public function process(File $phpcsFile, $stackPtr) { $tokens = $phpcsFile->getTokens(); $functionLc = strtolower($tokens[$stackPtr]['content']); if (isset($this->targetFunctions[$functionLc]) === false) { return; } // Next non-empty token should be the open ...
php
public function process(File $phpcsFile, $stackPtr) { $tokens = $phpcsFile->getTokens(); $functionLc = strtolower($tokens[$stackPtr]['content']); if (isset($this->targetFunctions[$functionLc]) === false) { return; } // Next non-empty token should be the open ...
[ "public", "function", "process", "(", "File", "$", "phpcsFile", ",", "$", "stackPtr", ")", "{", "$", "tokens", "=", "$", "phpcsFile", "->", "getTokens", "(", ")", ";", "$", "functionLc", "=", "strtolower", "(", "$", "tokens", "[", "$", "stackPtr", "]",...
Processes this test, when one of its tokens is encountered. @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. @param int $stackPtr The position of the current token in the stack passed in $tokens. @return void
[ "Processes", "this", "test", "when", "one", "of", "its", "tokens", "is", "encountered", "." ]
train
https://github.com/PHPCompatibility/PHPCompatibility/blob/8451ac21d652156e6742bbada166d28503ef67e4/PHPCompatibility/Sniffs/FunctionUse/ArgumentFunctionsUsageSniff.php#L70-L163
PHPCompatibility/PHPCompatibility
PHPCompatibility/AbstractNewFeatureSniff.php
AbstractNewFeatureSniff.addError
public function addError(File $phpcsFile, $stackPtr, array $itemInfo, array $errorInfo) { $itemName = $this->getItemName($itemInfo, $errorInfo); $error = $this->getErrorMsgTemplate(); $errorCode = $this->stringToErrorCode($itemName) . 'Found'; $data = array( $ite...
php
public function addError(File $phpcsFile, $stackPtr, array $itemInfo, array $errorInfo) { $itemName = $this->getItemName($itemInfo, $errorInfo); $error = $this->getErrorMsgTemplate(); $errorCode = $this->stringToErrorCode($itemName) . 'Found'; $data = array( $ite...
[ "public", "function", "addError", "(", "File", "$", "phpcsFile", ",", "$", "stackPtr", ",", "array", "$", "itemInfo", ",", "array", "$", "errorInfo", ")", "{", "$", "itemName", "=", "$", "this", "->", "getItemName", "(", "$", "itemInfo", ",", "$", "err...
Generates the error or warning for this item. @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. @param int $stackPtr The position of the relevant token in the stack. @param array $itemInfo Base information about the item. @param array $errorInfo Array w...
[ "Generates", "the", "error", "or", "warning", "for", "this", "item", "." ]
train
https://github.com/PHPCompatibility/PHPCompatibility/blob/8451ac21d652156e6742bbada166d28503ef67e4/PHPCompatibility/AbstractNewFeatureSniff.php#L92-L107
PHPCompatibility/PHPCompatibility
PHPCompatibility/AbstractFunctionCallParameterSniff.php
AbstractFunctionCallParameterSniff.process
public function process(File $phpcsFile, $stackPtr) { if ($this->bowOutEarly() === true) { return; } $tokens = $phpcsFile->getTokens(); $function = $tokens[$stackPtr]['content']; $functionLc = strtolower($function); if (isset($this->targetFunctions...
php
public function process(File $phpcsFile, $stackPtr) { if ($this->bowOutEarly() === true) { return; } $tokens = $phpcsFile->getTokens(); $function = $tokens[$stackPtr]['content']; $functionLc = strtolower($function); if (isset($this->targetFunctions...
[ "public", "function", "process", "(", "File", "$", "phpcsFile", ",", "$", "stackPtr", ")", "{", "if", "(", "$", "this", "->", "bowOutEarly", "(", ")", "===", "true", ")", "{", "return", ";", "}", "$", "tokens", "=", "$", "phpcsFile", "->", "getTokens...
Processes this test, when one of its tokens is encountered. @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. @param int $stackPtr The position of the current token in the stack passed in $tokens. @return void
[ "Processes", "this", "test", "when", "one", "of", "its", "tokens", "is", "encountered", "." ]
train
https://github.com/PHPCompatibility/PHPCompatibility/blob/8451ac21d652156e6742bbada166d28503ef67e4/PHPCompatibility/AbstractFunctionCallParameterSniff.php#L88-L132
PHPCompatibility/PHPCompatibility
PHPCompatibility/Sniffs/ControlStructures/ForbiddenBreakContinueOutsideLoopSniff.php
ForbiddenBreakContinueOutsideLoopSniff.process
public function process(File $phpcsFile, $stackPtr) { $tokens = $phpcsFile->getTokens(); $token = $tokens[$stackPtr]; // Check if the break/continue is within a valid loop structure. if (empty($token['conditions']) === false) { foreach ($token['conditions'] as $tokenCod...
php
public function process(File $phpcsFile, $stackPtr) { $tokens = $phpcsFile->getTokens(); $token = $tokens[$stackPtr]; // Check if the break/continue is within a valid loop structure. if (empty($token['conditions']) === false) { foreach ($token['conditions'] as $tokenCod...
[ "public", "function", "process", "(", "File", "$", "phpcsFile", ",", "$", "stackPtr", ")", "{", "$", "tokens", "=", "$", "phpcsFile", "->", "getTokens", "(", ")", ";", "$", "token", "=", "$", "tokens", "[", "$", "stackPtr", "]", ";", "// Check if the b...
Processes this test, when one of its tokens is encountered. @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. @param int $stackPtr The position of the current token in the stack passed in $tokens. @return void
[ "Processes", "this", "test", "when", "one", "of", "its", "tokens", "is", "encountered", "." ]
train
https://github.com/PHPCompatibility/PHPCompatibility/blob/8451ac21d652156e6742bbada166d28503ef67e4/PHPCompatibility/Sniffs/ControlStructures/ForbiddenBreakContinueOutsideLoopSniff.php#L76-L108
PHPCompatibility/PHPCompatibility
PHPCompatibility/Sniffs/FunctionUse/ArgumentFunctionsReportCurrentValueSniff.php
ArgumentFunctionsReportCurrentValueSniff.process
public function process(File $phpcsFile, $stackPtr) { if ($this->supportsAbove('7.0') === false) { return; } $tokens = $phpcsFile->getTokens(); if (isset($tokens[$stackPtr]['scope_opener'], $tokens[$stackPtr]['scope_closer']) === false) { // Abstract functio...
php
public function process(File $phpcsFile, $stackPtr) { if ($this->supportsAbove('7.0') === false) { return; } $tokens = $phpcsFile->getTokens(); if (isset($tokens[$stackPtr]['scope_opener'], $tokens[$stackPtr]['scope_closer']) === false) { // Abstract functio...
[ "public", "function", "process", "(", "File", "$", "phpcsFile", ",", "$", "stackPtr", ")", "{", "if", "(", "$", "this", "->", "supportsAbove", "(", "'7.0'", ")", "===", "false", ")", "{", "return", ";", "}", "$", "tokens", "=", "$", "phpcsFile", "->"...
Processes this test, when one of its tokens is encountered. @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. @param int $stackPtr The position of the current token in the stack passed in $tokens. @return void
[ "Processes", "this", "test", "when", "one", "of", "its", "tokens", "is", "encountered", "." ]
train
https://github.com/PHPCompatibility/PHPCompatibility/blob/8451ac21d652156e6742bbada166d28503ef67e4/PHPCompatibility/Sniffs/FunctionUse/ArgumentFunctionsReportCurrentValueSniff.php#L120-L438
PHPCompatibility/PHPCompatibility
PHPCompatibility/AbstractRemovedFeatureSniff.php
AbstractRemovedFeatureSniff.getErrorInfo
public function getErrorInfo(array $itemArray, array $itemInfo) { $errorInfo = array( 'deprecated' => '', 'removed' => '', 'alternative' => '', 'error' => false, ); $versionArray = $this->getVersionArray($itemArray); if (em...
php
public function getErrorInfo(array $itemArray, array $itemInfo) { $errorInfo = array( 'deprecated' => '', 'removed' => '', 'alternative' => '', 'error' => false, ); $versionArray = $this->getVersionArray($itemArray); if (em...
[ "public", "function", "getErrorInfo", "(", "array", "$", "itemArray", ",", "array", "$", "itemInfo", ")", "{", "$", "errorInfo", "=", "array", "(", "'deprecated'", "=>", "''", ",", "'removed'", "=>", "''", ",", "'alternative'", "=>", "''", ",", "'error'", ...
Retrieve the relevant detail (version) information for use in an error message. @param array $itemArray Version and other information about the item. @param array $itemInfo Base information about the item. @return array
[ "Retrieve", "the", "relevant", "detail", "(", "version", ")", "information", "for", "use", "in", "an", "error", "message", "." ]
train
https://github.com/PHPCompatibility/PHPCompatibility/blob/8451ac21d652156e6742bbada166d28503ef67e4/PHPCompatibility/AbstractRemovedFeatureSniff.php#L59-L88
PHPCompatibility/PHPCompatibility
PHPCompatibility/AbstractRemovedFeatureSniff.php
AbstractRemovedFeatureSniff.addError
public function addError(File $phpcsFile, $stackPtr, array $itemInfo, array $errorInfo) { $itemName = $this->getItemName($itemInfo, $errorInfo); $error = $this->getErrorMsgTemplate(); $errorCode = $this->stringToErrorCode($itemName); $data = array($itemName); if ($e...
php
public function addError(File $phpcsFile, $stackPtr, array $itemInfo, array $errorInfo) { $itemName = $this->getItemName($itemInfo, $errorInfo); $error = $this->getErrorMsgTemplate(); $errorCode = $this->stringToErrorCode($itemName); $data = array($itemName); if ($e...
[ "public", "function", "addError", "(", "File", "$", "phpcsFile", ",", "$", "stackPtr", ",", "array", "$", "itemInfo", ",", "array", "$", "errorInfo", ")", "{", "$", "itemName", "=", "$", "this", "->", "getItemName", "(", "$", "itemInfo", ",", "$", "err...
Generates the error or warning for this item. @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. @param int $stackPtr The position of the relevant token in the stack. @param array $itemInfo Base information about the item. @param array $errorInfo Array w...
[ "Generates", "the", "error", "or", "warning", "for", "this", "item", "." ]
train
https://github.com/PHPCompatibility/PHPCompatibility/blob/8451ac21d652156e6742bbada166d28503ef67e4/PHPCompatibility/AbstractRemovedFeatureSniff.php#L114-L146
PHPCompatibility/PHPCompatibility
PHPCompatibility/Sniffs/ParameterValues/NewPackFormatSniff.php
NewPackFormatSniff.processParameters
public function processParameters(File $phpcsFile, $stackPtr, $functionName, $parameters) { if (isset($parameters[1]) === false) { return; } $tokens = $phpcsFile->getTokens(); $targetParam = $parameters[1]; for ($i = $targetParam['start']; $i <= $targetPara...
php
public function processParameters(File $phpcsFile, $stackPtr, $functionName, $parameters) { if (isset($parameters[1]) === false) { return; } $tokens = $phpcsFile->getTokens(); $targetParam = $parameters[1]; for ($i = $targetParam['start']; $i <= $targetPara...
[ "public", "function", "processParameters", "(", "File", "$", "phpcsFile", ",", "$", "stackPtr", ",", "$", "functionName", ",", "$", "parameters", ")", "{", "if", "(", "isset", "(", "$", "parameters", "[", "1", "]", ")", "===", "false", ")", "{", "retur...
Process the parameters of a matched function. @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. @param int $stackPtr The position of the current token in the stack. @param string $functionName The token content (function name) which was matched. @param array ...
[ "Process", "the", "parameters", "of", "a", "matched", "function", "." ]
train
https://github.com/PHPCompatibility/PHPCompatibility/blob/8451ac21d652156e6742bbada166d28503ef67e4/PHPCompatibility/Sniffs/ParameterValues/NewPackFormatSniff.php#L79-L122
PHPCompatibility/PHPCompatibility
PHPCompatibility/Sniffs/Interfaces/NewInterfacesSniff.php
NewInterfacesSniff.register
public function register() { // Handle case-insensitivity of interface names. $this->newInterfaces = $this->arrayKeysToLowercase($this->newInterfaces); $this->unsupportedMethods = $this->arrayKeysToLowercase($this->unsupportedMethods); $targets = array( \T_CLASS, ...
php
public function register() { // Handle case-insensitivity of interface names. $this->newInterfaces = $this->arrayKeysToLowercase($this->newInterfaces); $this->unsupportedMethods = $this->arrayKeysToLowercase($this->unsupportedMethods); $targets = array( \T_CLASS, ...
[ "public", "function", "register", "(", ")", "{", "// Handle case-insensitivity of interface names.", "$", "this", "->", "newInterfaces", "=", "$", "this", "->", "arrayKeysToLowercase", "(", "$", "this", "->", "newInterfaces", ")", ";", "$", "this", "->", "unsuppor...
Returns an array of tokens this test wants to listen for. @return array
[ "Returns", "an", "array", "of", "tokens", "this", "test", "wants", "to", "listen", "for", "." ]
train
https://github.com/PHPCompatibility/PHPCompatibility/blob/8451ac21d652156e6742bbada166d28503ef67e4/PHPCompatibility/Sniffs/Interfaces/NewInterfacesSniff.php#L119-L140
PHPCompatibility/PHPCompatibility
PHPCompatibility/Sniffs/Interfaces/NewInterfacesSniff.php
NewInterfacesSniff.process
public function process(File $phpcsFile, $stackPtr) { $tokens = $phpcsFile->getTokens(); switch ($tokens[$stackPtr]['type']) { case 'T_CLASS': case 'T_ANON_CLASS': $this->processClassToken($phpcsFile, $stackPtr); break; case 'T_FU...
php
public function process(File $phpcsFile, $stackPtr) { $tokens = $phpcsFile->getTokens(); switch ($tokens[$stackPtr]['type']) { case 'T_CLASS': case 'T_ANON_CLASS': $this->processClassToken($phpcsFile, $stackPtr); break; case 'T_FU...
[ "public", "function", "process", "(", "File", "$", "phpcsFile", ",", "$", "stackPtr", ")", "{", "$", "tokens", "=", "$", "phpcsFile", "->", "getTokens", "(", ")", ";", "switch", "(", "$", "tokens", "[", "$", "stackPtr", "]", "[", "'type'", "]", ")", ...
Processes this test, when one of its tokens is encountered. @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. @param int $stackPtr The position of the current token in the stack passed in $tokens. @return void
[ "Processes", "this", "test", "when", "one", "of", "its", "tokens", "is", "encountered", "." ]
train
https://github.com/PHPCompatibility/PHPCompatibility/blob/8451ac21d652156e6742bbada166d28503ef67e4/PHPCompatibility/Sniffs/Interfaces/NewInterfacesSniff.php#L152-L182
PHPCompatibility/PHPCompatibility
PHPCompatibility/Sniffs/Interfaces/NewInterfacesSniff.php
NewInterfacesSniff.processClassToken
private function processClassToken(File $phpcsFile, $stackPtr) { $interfaces = PHPCSHelper::findImplementedInterfaceNames($phpcsFile, $stackPtr); if (\is_array($interfaces) === false || $interfaces === array()) { return; } $tokens = $phpcsFile->getTokens(); ...
php
private function processClassToken(File $phpcsFile, $stackPtr) { $interfaces = PHPCSHelper::findImplementedInterfaceNames($phpcsFile, $stackPtr); if (\is_array($interfaces) === false || $interfaces === array()) { return; } $tokens = $phpcsFile->getTokens(); ...
[ "private", "function", "processClassToken", "(", "File", "$", "phpcsFile", ",", "$", "stackPtr", ")", "{", "$", "interfaces", "=", "PHPCSHelper", "::", "findImplementedInterfaceNames", "(", "$", "phpcsFile", ",", "$", "stackPtr", ")", ";", "if", "(", "\\", "...
Processes this test for when a class token is encountered. - Detect classes implementing the new interfaces. - Detect classes implementing the new interfaces with unsupported functions. @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. @param int $stackPtr The position of the current ...
[ "Processes", "this", "test", "for", "when", "a", "class", "token", "is", "encountered", "." ]
train
https://github.com/PHPCompatibility/PHPCompatibility/blob/8451ac21d652156e6742bbada166d28503ef67e4/PHPCompatibility/Sniffs/Interfaces/NewInterfacesSniff.php#L197-L248
PHPCompatibility/PHPCompatibility
PHPCompatibility/Sniffs/FunctionDeclarations/ForbiddenParameterShadowSuperGlobalsSniff.php
ForbiddenParameterShadowSuperGlobalsSniff.process
public function process(File $phpcsFile, $stackPtr) { if ($this->supportsAbove('5.4') === false) { return; } // Get all parameters from function signature. $parameters = PHPCSHelper::getMethodParameters($phpcsFile, $stackPtr); if (empty($parameters) || \is_array(...
php
public function process(File $phpcsFile, $stackPtr) { if ($this->supportsAbove('5.4') === false) { return; } // Get all parameters from function signature. $parameters = PHPCSHelper::getMethodParameters($phpcsFile, $stackPtr); if (empty($parameters) || \is_array(...
[ "public", "function", "process", "(", "File", "$", "phpcsFile", ",", "$", "stackPtr", ")", "{", "if", "(", "$", "this", "->", "supportsAbove", "(", "'5.4'", ")", "===", "false", ")", "{", "return", ";", "}", "// Get all parameters from function signature.", ...
Processes the test. @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. @param int $stackPtr The position of the current token. @return void
[ "Processes", "the", "test", "." ]
train
https://github.com/PHPCompatibility/PHPCompatibility/blob/8451ac21d652156e6742bbada166d28503ef67e4/PHPCompatibility/Sniffs/FunctionDeclarations/ForbiddenParameterShadowSuperGlobalsSniff.php#L57-L78
PHPCompatibility/PHPCompatibility
PHPCompatibility/Sniffs/Lists/NewKeyedListSniff.php
NewKeyedListSniff.process
public function process(File $phpcsFile, $stackPtr) { if ($this->bowOutEarly() === true) { return; } $tokens = $phpcsFile->getTokens(); if ($tokens[$stackPtr]['code'] === \T_OPEN_SHORT_ARRAY && $this->isShortList($phpcsFile, $stackPtr) === false ) { ...
php
public function process(File $phpcsFile, $stackPtr) { if ($this->bowOutEarly() === true) { return; } $tokens = $phpcsFile->getTokens(); if ($tokens[$stackPtr]['code'] === \T_OPEN_SHORT_ARRAY && $this->isShortList($phpcsFile, $stackPtr) === false ) { ...
[ "public", "function", "process", "(", "File", "$", "phpcsFile", ",", "$", "stackPtr", ")", "{", "if", "(", "$", "this", "->", "bowOutEarly", "(", ")", "===", "true", ")", "{", "return", ";", "}", "$", "tokens", "=", "$", "phpcsFile", "->", "getTokens...
Processes this test, when one of its tokens is encountered. @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. @param int $stackPtr The position of the current token in the stack passed in $tokens. @return void
[ "Processes", "this", "test", "when", "one", "of", "its", "tokens", "is", "encountered", "." ]
train
https://github.com/PHPCompatibility/PHPCompatibility/blob/8451ac21d652156e6742bbada166d28503ef67e4/PHPCompatibility/Sniffs/Lists/NewKeyedListSniff.php#L102-L143
PHPCompatibility/PHPCompatibility
PHPCompatibility/Sniffs/Lists/NewKeyedListSniff.php
NewKeyedListSniff.examineList
protected function examineList(File $phpcsFile, $opener, $closer) { $start = $opener; while (($start = $this->hasTargetInList($phpcsFile, $start, $closer)) !== false) { $phpcsFile->addError( 'Specifying keys in list constructs is not supported in PHP 7.0 or earlier.', ...
php
protected function examineList(File $phpcsFile, $opener, $closer) { $start = $opener; while (($start = $this->hasTargetInList($phpcsFile, $start, $closer)) !== false) { $phpcsFile->addError( 'Specifying keys in list constructs is not supported in PHP 7.0 or earlier.', ...
[ "protected", "function", "examineList", "(", "File", "$", "phpcsFile", ",", "$", "opener", ",", "$", "closer", ")", "{", "$", "start", "=", "$", "opener", ";", "while", "(", "(", "$", "start", "=", "$", "this", "->", "hasTargetInList", "(", "$", "php...
Examine the contents of a list construct to determine whether an error needs to be thrown. @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. @param int $opener The position of the list open token. @param int $closer The position of the list close token. @return ...
[ "Examine", "the", "contents", "of", "a", "list", "construct", "to", "determine", "whether", "an", "error", "needs", "to", "be", "thrown", "." ]
train
https://github.com/PHPCompatibility/PHPCompatibility/blob/8451ac21d652156e6742bbada166d28503ef67e4/PHPCompatibility/Sniffs/Lists/NewKeyedListSniff.php#L155-L165
PHPCompatibility/PHPCompatibility
PHPCompatibility/Sniffs/Lists/NewKeyedListSniff.php
NewKeyedListSniff.hasTargetInList
protected function hasTargetInList(File $phpcsFile, $start, $closer) { $tokens = $phpcsFile->getTokens(); for ($i = ($start + 1); $i < $closer; $i++) { if (isset($this->allTargets[$tokens[$i]['code']]) === false) { continue; } if (isset($this->ta...
php
protected function hasTargetInList(File $phpcsFile, $start, $closer) { $tokens = $phpcsFile->getTokens(); for ($i = ($start + 1); $i < $closer; $i++) { if (isset($this->allTargets[$tokens[$i]['code']]) === false) { continue; } if (isset($this->ta...
[ "protected", "function", "hasTargetInList", "(", "File", "$", "phpcsFile", ",", "$", "start", ",", "$", "closer", ")", "{", "$", "tokens", "=", "$", "phpcsFile", "->", "getTokens", "(", ")", ";", "for", "(", "$", "i", "=", "(", "$", "start", "+", "...
Check whether a certain target token exists within a list construct. Skips past nested list constructs, so these can be examined based on their own token. @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. @param int $start The position of the list open token or a token within the l...
[ "Check", "whether", "a", "certain", "target", "token", "exists", "within", "a", "list", "construct", "." ]
train
https://github.com/PHPCompatibility/PHPCompatibility/blob/8451ac21d652156e6742bbada166d28503ef67e4/PHPCompatibility/Sniffs/Lists/NewKeyedListSniff.php#L180-L210
PHPCompatibility/PHPCompatibility
PHPCompatibility/Sniffs/Syntax/NewShortArraySniff.php
NewShortArraySniff.process
public function process(File $phpcsFile, $stackPtr) { if ($this->supportsBelow('5.3') === false) { return; } $tokens = $phpcsFile->getTokens(); $token = $tokens[$stackPtr]; $error = '%s is available since 5.4'; $data = array(); if ($token['typ...
php
public function process(File $phpcsFile, $stackPtr) { if ($this->supportsBelow('5.3') === false) { return; } $tokens = $phpcsFile->getTokens(); $token = $tokens[$stackPtr]; $error = '%s is available since 5.4'; $data = array(); if ($token['typ...
[ "public", "function", "process", "(", "File", "$", "phpcsFile", ",", "$", "stackPtr", ")", "{", "if", "(", "$", "this", "->", "supportsBelow", "(", "'5.3'", ")", "===", "false", ")", "{", "return", ";", "}", "$", "tokens", "=", "$", "phpcsFile", "->"...
Processes this test, when one of its tokens is encountered. @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. @param int $stackPtr The position of the current token in the stack passed in $tokens. @return void
[ "Processes", "this", "test", "when", "one", "of", "its", "tokens", "is", "encountered", "." ]
train
https://github.com/PHPCompatibility/PHPCompatibility/blob/8451ac21d652156e6742bbada166d28503ef67e4/PHPCompatibility/Sniffs/Syntax/NewShortArraySniff.php#L54-L73
PHPCompatibility/PHPCompatibility
PHPCompatibility/Sniffs/Miscellaneous/RemovedAlternativePHPTagsSniff.php
RemovedAlternativePHPTagsSniff.register
public function register() { if (version_compare(\PHP_VERSION_ID, '70000', '<') === true) { // phpcs:ignore PHPCompatibility.IniDirectives.RemovedIniDirectives.asp_tagsRemoved $this->aspTags = (bool) ini_get('asp_tags'); } return array( \T_OPEN_TAG, ...
php
public function register() { if (version_compare(\PHP_VERSION_ID, '70000', '<') === true) { // phpcs:ignore PHPCompatibility.IniDirectives.RemovedIniDirectives.asp_tagsRemoved $this->aspTags = (bool) ini_get('asp_tags'); } return array( \T_OPEN_TAG, ...
[ "public", "function", "register", "(", ")", "{", "if", "(", "version_compare", "(", "\\", "PHP_VERSION_ID", ",", "'70000'", ",", "'<'", ")", "===", "true", ")", "{", "// phpcs:ignore PHPCompatibility.IniDirectives.RemovedIniDirectives.asp_tagsRemoved", "$", "this", "-...
Returns an array of tokens this test wants to listen for. @return array
[ "Returns", "an", "array", "of", "tokens", "this", "test", "wants", "to", "listen", "for", "." ]
train
https://github.com/PHPCompatibility/PHPCompatibility/blob/8451ac21d652156e6742bbada166d28503ef67e4/PHPCompatibility/Sniffs/Miscellaneous/RemovedAlternativePHPTagsSniff.php#L46-L58
PHPCompatibility/PHPCompatibility
PHPCompatibility/Sniffs/Miscellaneous/RemovedAlternativePHPTagsSniff.php
RemovedAlternativePHPTagsSniff.process
public function process(File $phpcsFile, $stackPtr) { if ($this->supportsAbove('7.0') === false) { return; } $tokens = $phpcsFile->getTokens(); $openTag = $tokens[$stackPtr]; $content = trim($openTag['content']); if ($content === '' || $content === '<?p...
php
public function process(File $phpcsFile, $stackPtr) { if ($this->supportsAbove('7.0') === false) { return; } $tokens = $phpcsFile->getTokens(); $openTag = $tokens[$stackPtr]; $content = trim($openTag['content']); if ($content === '' || $content === '<?p...
[ "public", "function", "process", "(", "File", "$", "phpcsFile", ",", "$", "stackPtr", ")", "{", "if", "(", "$", "this", "->", "supportsAbove", "(", "'7.0'", ")", "===", "false", ")", "{", "return", ";", "}", "$", "tokens", "=", "$", "phpcsFile", "->"...
Processes this test, when one of its tokens is encountered. @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. @param int $stackPtr The position of the current token in the stack passed in $tokens. @return void
[ "Processes", "this", "test", "when", "one", "of", "its", "tokens", "is", "encountered", "." ]
train
https://github.com/PHPCompatibility/PHPCompatibility/blob/8451ac21d652156e6742bbada166d28503ef67e4/PHPCompatibility/Sniffs/Miscellaneous/RemovedAlternativePHPTagsSniff.php#L70-L136
PHPCompatibility/PHPCompatibility
PHPCompatibility/Sniffs/Miscellaneous/RemovedAlternativePHPTagsSniff.php
RemovedAlternativePHPTagsSniff.getSnippet
protected function getSnippet($content, $startAt = '', $length = 25) { $startPos = 0; if ($startAt !== '') { $startPos = strpos($content, $startAt); if ($startPos !== false) { $startPos += \strlen($startAt); } } $snippet = substr(...
php
protected function getSnippet($content, $startAt = '', $length = 25) { $startPos = 0; if ($startAt !== '') { $startPos = strpos($content, $startAt); if ($startPos !== false) { $startPos += \strlen($startAt); } } $snippet = substr(...
[ "protected", "function", "getSnippet", "(", "$", "content", ",", "$", "startAt", "=", "''", ",", "$", "length", "=", "25", ")", "{", "$", "startPos", "=", "0", ";", "if", "(", "$", "startAt", "!==", "''", ")", "{", "$", "startPos", "=", "strpos", ...
Get a snippet from a HTML token. @param string $content The content of the HTML token. @param string $startAt Partial string to use as a starting point for the snippet. @param int $length The target length of the snippet to get. Defaults to 25. @return string
[ "Get", "a", "snippet", "from", "a", "HTML", "token", "." ]
train
https://github.com/PHPCompatibility/PHPCompatibility/blob/8451ac21d652156e6742bbada166d28503ef67e4/PHPCompatibility/Sniffs/Miscellaneous/RemovedAlternativePHPTagsSniff.php#L148-L165
PHPCompatibility/PHPCompatibility
PHPCompatibility/Sniffs/Syntax/NewFunctionArrayDereferencingSniff.php
NewFunctionArrayDereferencingSniff.process
public function process(File $phpcsFile, $stackPtr) { if ($this->supportsBelow('5.3') === false) { return; } $tokens = $phpcsFile->getTokens(); // Next non-empty token should be the open parenthesis. $openParenthesis = $phpcsFile->findNext(Tokens::$emptyTokens, ...
php
public function process(File $phpcsFile, $stackPtr) { if ($this->supportsBelow('5.3') === false) { return; } $tokens = $phpcsFile->getTokens(); // Next non-empty token should be the open parenthesis. $openParenthesis = $phpcsFile->findNext(Tokens::$emptyTokens, ...
[ "public", "function", "process", "(", "File", "$", "phpcsFile", ",", "$", "stackPtr", ")", "{", "if", "(", "$", "this", "->", "supportsBelow", "(", "'5.3'", ")", "===", "false", ")", "{", "return", ";", "}", "$", "tokens", "=", "$", "phpcsFile", "->"...
Processes this test, when one of its tokens is encountered. @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. @param int $stackPtr The position of the current token in the stack passed in $tokens. @return void
[ "Processes", "this", "test", "when", "one", "of", "its", "tokens", "is", "encountered", "." ]
train
https://github.com/PHPCompatibility/PHPCompatibility/blob/8451ac21d652156e6742bbada166d28503ef67e4/PHPCompatibility/Sniffs/Syntax/NewFunctionArrayDereferencingSniff.php#L48-L94
PHPCompatibility/PHPCompatibility
PHPCompatibility/PHPCSHelper.php
PHPCSHelper.setConfigData
public static function setConfigData($key, $value, $temp = false) { if (method_exists('\PHP_CodeSniffer\Config', 'setConfigData')) { // PHPCS 3.x. \PHP_CodeSniffer\Config::setConfigData($key, $value, $temp); } else { // PHPCS 2.x. \PHP_CodeSniffer::set...
php
public static function setConfigData($key, $value, $temp = false) { if (method_exists('\PHP_CodeSniffer\Config', 'setConfigData')) { // PHPCS 3.x. \PHP_CodeSniffer\Config::setConfigData($key, $value, $temp); } else { // PHPCS 2.x. \PHP_CodeSniffer::set...
[ "public", "static", "function", "setConfigData", "(", "$", "key", ",", "$", "value", ",", "$", "temp", "=", "false", ")", "{", "if", "(", "method_exists", "(", "'\\PHP_CodeSniffer\\Config'", ",", "'setConfigData'", ")", ")", "{", "// PHPCS 3.x.", "\\", "PHP_...
Pass config data to PHPCS. PHPCS cross-version compatibility helper. @param string $key The name of the config value. @param string|null $value The value to set. If null, the config entry is deleted, reverting it to the default value. @param boolean $temp Set this config data temporarily for this script r...
[ "Pass", "config", "data", "to", "PHPCS", "." ]
train
https://github.com/PHPCompatibility/PHPCompatibility/blob/8451ac21d652156e6742bbada166d28503ef67e4/PHPCompatibility/PHPCSHelper.php#L63-L72
PHPCompatibility/PHPCompatibility
PHPCompatibility/PHPCSHelper.php
PHPCSHelper.getConfigData
public static function getConfigData($key) { if (method_exists('\PHP_CodeSniffer\Config', 'getConfigData')) { // PHPCS 3.x. return \PHP_CodeSniffer\Config::getConfigData($key); } else { // PHPCS 2.x. return \PHP_CodeSniffer::getConfigData($key); ...
php
public static function getConfigData($key) { if (method_exists('\PHP_CodeSniffer\Config', 'getConfigData')) { // PHPCS 3.x. return \PHP_CodeSniffer\Config::getConfigData($key); } else { // PHPCS 2.x. return \PHP_CodeSniffer::getConfigData($key); ...
[ "public", "static", "function", "getConfigData", "(", "$", "key", ")", "{", "if", "(", "method_exists", "(", "'\\PHP_CodeSniffer\\Config'", ",", "'getConfigData'", ")", ")", "{", "// PHPCS 3.x.", "return", "\\", "PHP_CodeSniffer", "\\", "Config", "::", "getConfigD...
Get the value of a single PHPCS config key. @param string $key The name of the config value. @return string|null
[ "Get", "the", "value", "of", "a", "single", "PHPCS", "config", "key", "." ]
train
https://github.com/PHPCompatibility/PHPCompatibility/blob/8451ac21d652156e6742bbada166d28503ef67e4/PHPCompatibility/PHPCSHelper.php#L82-L91
PHPCompatibility/PHPCompatibility
PHPCompatibility/PHPCSHelper.php
PHPCSHelper.getCommandLineData
public static function getCommandLineData(File $phpcsFile, $key) { if (class_exists('\PHP_CodeSniffer\Config')) { // PHPCS 3.x. $config = $phpcsFile->config; if (isset($config->{$key})) { return $config->{$key}; } } else { /...
php
public static function getCommandLineData(File $phpcsFile, $key) { if (class_exists('\PHP_CodeSniffer\Config')) { // PHPCS 3.x. $config = $phpcsFile->config; if (isset($config->{$key})) { return $config->{$key}; } } else { /...
[ "public", "static", "function", "getCommandLineData", "(", "File", "$", "phpcsFile", ",", "$", "key", ")", "{", "if", "(", "class_exists", "(", "'\\PHP_CodeSniffer\\Config'", ")", ")", "{", "// PHPCS 3.x.", "$", "config", "=", "$", "phpcsFile", "->", "config",...
Get the value of a single PHPCS config key. This config key can be set in the `CodeSniffer.conf` file, on the command-line or in a ruleset. @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. @param string $key The name of the config value. @return string|null
[ "Get", "the", "value", "of", "a", "single", "PHPCS", "config", "key", "." ]
train
https://github.com/PHPCompatibility/PHPCompatibility/blob/8451ac21d652156e6742bbada166d28503ef67e4/PHPCompatibility/PHPCSHelper.php#L105-L122
PHPCompatibility/PHPCompatibility
PHPCompatibility/PHPCSHelper.php
PHPCSHelper.findStartOfStatement
public static function findStartOfStatement(File $phpcsFile, $start, $ignore = null) { if (version_compare(self::getVersion(), '2.7.1', '>=') === true) { return $phpcsFile->findStartOfStatement($start, $ignore); } $tokens = $phpcsFile->getTokens(); $endTokens = Tokens...
php
public static function findStartOfStatement(File $phpcsFile, $start, $ignore = null) { if (version_compare(self::getVersion(), '2.7.1', '>=') === true) { return $phpcsFile->findStartOfStatement($start, $ignore); } $tokens = $phpcsFile->getTokens(); $endTokens = Tokens...
[ "public", "static", "function", "findStartOfStatement", "(", "File", "$", "phpcsFile", ",", "$", "start", ",", "$", "ignore", "=", "null", ")", "{", "if", "(", "version_compare", "(", "self", "::", "getVersion", "(", ")", ",", "'2.7.1'", ",", "'>='", ")"...
Returns the position of the first non-whitespace token in a statement. {@internal Duplicate of same method as contained in the `\PHP_CodeSniffer_File` class and introduced in PHPCS 2.1.0 and improved in PHPCS 2.7.1. Once the minimum supported PHPCS version for this standard goes beyond that, this method can be remove...
[ "Returns", "the", "position", "of", "the", "first", "non", "-", "whitespace", "token", "in", "a", "statement", "." ]
train
https://github.com/PHPCompatibility/PHPCompatibility/blob/8451ac21d652156e6742bbada166d28503ef67e4/PHPCompatibility/PHPCSHelper.php#L143-L201
PHPCompatibility/PHPCompatibility
PHPCompatibility/PHPCSHelper.php
PHPCSHelper.findEndOfStatement
public static function findEndOfStatement(File $phpcsFile, $start, $ignore = null) { if (version_compare(self::getVersion(), '3.3.0', '>=') === true) { return $phpcsFile->findEndOfStatement($start, $ignore); } $tokens = $phpcsFile->getTokens(); $endTokens = array( ...
php
public static function findEndOfStatement(File $phpcsFile, $start, $ignore = null) { if (version_compare(self::getVersion(), '3.3.0', '>=') === true) { return $phpcsFile->findEndOfStatement($start, $ignore); } $tokens = $phpcsFile->getTokens(); $endTokens = array( ...
[ "public", "static", "function", "findEndOfStatement", "(", "File", "$", "phpcsFile", ",", "$", "start", ",", "$", "ignore", "=", "null", ")", "{", "if", "(", "version_compare", "(", "self", "::", "getVersion", "(", ")", ",", "'3.3.0'", ",", "'>='", ")", ...
Returns the position of the last non-whitespace token in a statement. {@internal Duplicate of same method as contained in the `\PHP_CodeSniffer_File` class and introduced in PHPCS 2.1.0 and improved in PHPCS 2.7.1 and 3.3.0. Once the minimum supported PHPCS version for this standard goes beyond that, this method can ...
[ "Returns", "the", "position", "of", "the", "last", "non", "-", "whitespace", "token", "in", "a", "statement", "." ]
train
https://github.com/PHPCompatibility/PHPCompatibility/blob/8451ac21d652156e6742bbada166d28503ef67e4/PHPCompatibility/PHPCSHelper.php#L222-L295
PHPCompatibility/PHPCompatibility
PHPCompatibility/PHPCSHelper.php
PHPCSHelper.findExtendedClassName
public static function findExtendedClassName(File $phpcsFile, $stackPtr) { if (version_compare(self::getVersion(), '3.1.0', '>=') === true) { return $phpcsFile->findExtendedClassName($stackPtr); } $tokens = $phpcsFile->getTokens(); // Check for the existence of the toke...
php
public static function findExtendedClassName(File $phpcsFile, $stackPtr) { if (version_compare(self::getVersion(), '3.1.0', '>=') === true) { return $phpcsFile->findExtendedClassName($stackPtr); } $tokens = $phpcsFile->getTokens(); // Check for the existence of the toke...
[ "public", "static", "function", "findExtendedClassName", "(", "File", "$", "phpcsFile", ",", "$", "stackPtr", ")", "{", "if", "(", "version_compare", "(", "self", "::", "getVersion", "(", ")", ",", "'3.1.0'", ",", "'>='", ")", "===", "true", ")", "{", "r...
Returns the name of the class that the specified class extends (works for classes, anonymous classes and interfaces). Returns FALSE on error or if there is no extended class name. {@internal Duplicate of same method as contained in the `\PHP_CodeSniffer_File` class, but with some improvements which have been introduc...
[ "Returns", "the", "name", "of", "the", "class", "that", "the", "specified", "class", "extends", "(", "works", "for", "classes", "anonymous", "classes", "and", "interfaces", ")", "." ]
train
https://github.com/PHPCompatibility/PHPCompatibility/blob/8451ac21d652156e6742bbada166d28503ef67e4/PHPCompatibility/PHPCSHelper.php#L320-L365
PHPCompatibility/PHPCompatibility
PHPCompatibility/PHPCSHelper.php
PHPCSHelper.findImplementedInterfaceNames
public static function findImplementedInterfaceNames(File $phpcsFile, $stackPtr) { if (version_compare(self::getVersion(), '2.7.1', '>') === true) { return $phpcsFile->findImplementedInterfaceNames($stackPtr); } $tokens = $phpcsFile->getTokens(); // Check for the existe...
php
public static function findImplementedInterfaceNames(File $phpcsFile, $stackPtr) { if (version_compare(self::getVersion(), '2.7.1', '>') === true) { return $phpcsFile->findImplementedInterfaceNames($stackPtr); } $tokens = $phpcsFile->getTokens(); // Check for the existe...
[ "public", "static", "function", "findImplementedInterfaceNames", "(", "File", "$", "phpcsFile", ",", "$", "stackPtr", ")", "{", "if", "(", "version_compare", "(", "self", "::", "getVersion", "(", ")", ",", "'2.7.1'", ",", "'>'", ")", "===", "true", ")", "{...
Returns the name(s) of the interface(s) that the specified class implements. Returns FALSE on error or if there are no implemented interface names. {@internal Duplicate of same method as introduced in PHPCS 2.7. This method also includes an improvement we use which was only introduced in PHPCS 2.8.0, so only defer to...
[ "Returns", "the", "name", "(", "s", ")", "of", "the", "interface", "(", "s", ")", "that", "the", "specified", "class", "implements", "." ]
train
https://github.com/PHPCompatibility/PHPCompatibility/blob/8451ac21d652156e6742bbada166d28503ef67e4/PHPCompatibility/PHPCSHelper.php#L385-L432
PHPCompatibility/PHPCompatibility
PHPCompatibility/PHPCSHelper.php
PHPCSHelper.getMethodParameters
public static function getMethodParameters(File $phpcsFile, $stackPtr) { if (version_compare(self::getVersion(), '3.3.0', '>=') === true) { return $phpcsFile->getMethodParameters($stackPtr); } $tokens = $phpcsFile->getTokens(); // Check for the existence of the token. ...
php
public static function getMethodParameters(File $phpcsFile, $stackPtr) { if (version_compare(self::getVersion(), '3.3.0', '>=') === true) { return $phpcsFile->getMethodParameters($stackPtr); } $tokens = $phpcsFile->getTokens(); // Check for the existence of the token. ...
[ "public", "static", "function", "getMethodParameters", "(", "File", "$", "phpcsFile", ",", "$", "stackPtr", ")", "{", "if", "(", "version_compare", "(", "self", "::", "getVersion", "(", ")", ",", "'3.3.0'", ",", "'>='", ")", "===", "true", ")", "{", "ret...
Returns the method parameters for the specified function token. Each parameter is in the following format: <code> 0 => array( 'name' => '$var', // The variable name. 'token' => integer, // The stack pointer to the variable name. 'content' => string, // The full content of the vari...
[ "Returns", "the", "method", "parameters", "for", "the", "specified", "function", "token", "." ]
train
https://github.com/PHPCompatibility/PHPCompatibility/blob/8451ac21d652156e6742bbada166d28503ef67e4/PHPCompatibility/PHPCSHelper.php#L471-L651
PHPCompatibility/PHPCompatibility
PHPCompatibility/Sniffs/ControlStructures/ForbiddenSwitchWithMultipleDefaultBlocksSniff.php
ForbiddenSwitchWithMultipleDefaultBlocksSniff.process
public function process(File $phpcsFile, $stackPtr) { if ($this->supportsAbove('7.0') === false) { return; } $tokens = $phpcsFile->getTokens(); if (isset($tokens[$stackPtr]['scope_closer']) === false) { return; } $defaultToken = $stackPtr; ...
php
public function process(File $phpcsFile, $stackPtr) { if ($this->supportsAbove('7.0') === false) { return; } $tokens = $phpcsFile->getTokens(); if (isset($tokens[$stackPtr]['scope_closer']) === false) { return; } $defaultToken = $stackPtr; ...
[ "public", "function", "process", "(", "File", "$", "phpcsFile", ",", "$", "stackPtr", ")", "{", "if", "(", "$", "this", "->", "supportsAbove", "(", "'7.0'", ")", "===", "false", ")", "{", "return", ";", "}", "$", "tokens", "=", "$", "phpcsFile", "->"...
Processes this test, when one of its tokens is encountered. @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. @param int $stackPtr The position of the current token in the stack passed in $tokens. @return void
[ "Processes", "this", "test", "when", "one", "of", "its", "tokens", "is", "encountered", "." ]
train
https://github.com/PHPCompatibility/PHPCompatibility/blob/8451ac21d652156e6742bbada166d28503ef67e4/PHPCompatibility/Sniffs/ControlStructures/ForbiddenSwitchWithMultipleDefaultBlocksSniff.php#L50-L78
PHPCompatibility/PHPCompatibility
PHPCompatibility/Sniffs/MethodUse/NewDirectCallsToCloneSniff.php
NewDirectCallsToCloneSniff.process
public function process(File $phpcsFile, $stackPtr) { if ($this->supportsBelow('5.6') === false) { return; } $tokens = $phpcsFile->getTokens(); $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); if ($nextNonEmpty === false |...
php
public function process(File $phpcsFile, $stackPtr) { if ($this->supportsBelow('5.6') === false) { return; } $tokens = $phpcsFile->getTokens(); $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); if ($nextNonEmpty === false |...
[ "public", "function", "process", "(", "File", "$", "phpcsFile", ",", "$", "stackPtr", ")", "{", "if", "(", "$", "this", "->", "supportsBelow", "(", "'5.6'", ")", "===", "false", ")", "{", "return", ";", "}", "$", "tokens", "=", "$", "phpcsFile", "->"...
Processes this test, when one of its tokens is encountered. @since 9.1.0 @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. @param int $stackPtr The position of the current token in the stack passed in $tokens. @return void
[ "Processes", "this", "test", "when", "one", "of", "its", "tokens", "is", "encountered", "." ]
train
https://github.com/PHPCompatibility/PHPCompatibility/blob/8451ac21d652156e6742bbada166d28503ef67e4/PHPCompatibility/Sniffs/MethodUse/NewDirectCallsToCloneSniff.php#L59-L96
PHPCompatibility/PHPCompatibility
PHPCompatibility/Sniffs/Keywords/ForbiddenNamesAsDeclaredSniff.php
ForbiddenNamesAsDeclaredSniff.register
public function register() { // Do the list merge only once. $this->allForbiddenNames = array_merge($this->forbiddenNames, $this->softReservedNames); $targets = array( \T_CLASS, \T_INTERFACE, \T_TRAIT, \T_NAMESPACE, \T_STRING, // C...
php
public function register() { // Do the list merge only once. $this->allForbiddenNames = array_merge($this->forbiddenNames, $this->softReservedNames); $targets = array( \T_CLASS, \T_INTERFACE, \T_TRAIT, \T_NAMESPACE, \T_STRING, // C...
[ "public", "function", "register", "(", ")", "{", "// Do the list merge only once.", "$", "this", "->", "allForbiddenNames", "=", "array_merge", "(", "$", "this", "->", "forbiddenNames", ",", "$", "this", "->", "softReservedNames", ")", ";", "$", "targets", "=", ...
Returns an array of tokens this test wants to listen for. @return array
[ "Returns", "an", "array", "of", "tokens", "this", "test", "wants", "to", "listen", "for", "." ]
train
https://github.com/PHPCompatibility/PHPCompatibility/blob/8451ac21d652156e6742bbada166d28503ef67e4/PHPCompatibility/Sniffs/Keywords/ForbiddenNamesAsDeclaredSniff.php#L96-L110
PHPCompatibility/PHPCompatibility
PHPCompatibility/Sniffs/Keywords/ForbiddenNamesAsDeclaredSniff.php
ForbiddenNamesAsDeclaredSniff.process
public function process(File $phpcsFile, $stackPtr) { if ($this->supportsAbove('7.0') === false) { return; } $tokens = $phpcsFile->getTokens(); $tokenCode = $tokens[$stackPtr]['code']; $tokenType = $tokens[$stackPtr]['type']; $tokenConte...
php
public function process(File $phpcsFile, $stackPtr) { if ($this->supportsAbove('7.0') === false) { return; } $tokens = $phpcsFile->getTokens(); $tokenCode = $tokens[$stackPtr]['code']; $tokenType = $tokens[$stackPtr]['type']; $tokenConte...
[ "public", "function", "process", "(", "File", "$", "phpcsFile", ",", "$", "stackPtr", ")", "{", "if", "(", "$", "this", "->", "supportsAbove", "(", "'7.0'", ")", "===", "false", ")", "{", "return", ";", "}", "$", "tokens", "=", "$", "phpcsFile", "->"...
Processes this test, when one of its tokens is encountered. @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. @param int $stackPtr The position of the current token in the stack passed in $tokens. @return void
[ "Processes", "this", "test", "when", "one", "of", "its", "tokens", "is", "encountered", "." ]
train
https://github.com/PHPCompatibility/PHPCompatibility/blob/8451ac21d652156e6742bbada166d28503ef67e4/PHPCompatibility/Sniffs/Keywords/ForbiddenNamesAsDeclaredSniff.php#L122-L247
PHPCompatibility/PHPCompatibility
PHPCompatibility/Sniffs/Syntax/ForbiddenCallTimePassByReferenceSniff.php
ForbiddenCallTimePassByReferenceSniff.process
public function process(File $phpcsFile, $stackPtr) { if ($this->supportsAbove('5.3') === false) { return; } $tokens = $phpcsFile->getTokens(); // Skip tokens that are the names of functions or classes // within their definitions. For example: function myFunctio...
php
public function process(File $phpcsFile, $stackPtr) { if ($this->supportsAbove('5.3') === false) { return; } $tokens = $phpcsFile->getTokens(); // Skip tokens that are the names of functions or classes // within their definitions. For example: function myFunctio...
[ "public", "function", "process", "(", "File", "$", "phpcsFile", ",", "$", "stackPtr", ")", "{", "if", "(", "$", "this", "->", "supportsAbove", "(", "'5.3'", ")", "===", "false", ")", "{", "return", ";", "}", "$", "tokens", "=", "$", "phpcsFile", "->"...
Processes this test, when one of its tokens is encountered. @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. @param int $stackPtr The position of the current token in the stack passed in $tokens. @return void
[ "Processes", "this", "test", "when", "one", "of", "its", "tokens", "is", "encountered", "." ]
train
https://github.com/PHPCompatibility/PHPCompatibility/blob/8451ac21d652156e6742bbada166d28503ef67e4/PHPCompatibility/Sniffs/Syntax/ForbiddenCallTimePassByReferenceSniff.php#L94-L158
PHPCompatibility/PHPCompatibility
PHPCompatibility/Sniffs/Syntax/ForbiddenCallTimePassByReferenceSniff.php
ForbiddenCallTimePassByReferenceSniff.isCallTimePassByReferenceParam
protected function isCallTimePassByReferenceParam(File $phpcsFile, $parameter, $nestingLevel) { $tokens = $phpcsFile->getTokens(); $searchStartToken = $parameter['start'] - 1; $searchEndToken = $parameter['end'] + 1; $nextVariable = $searchStartToken; do { ...
php
protected function isCallTimePassByReferenceParam(File $phpcsFile, $parameter, $nestingLevel) { $tokens = $phpcsFile->getTokens(); $searchStartToken = $parameter['start'] - 1; $searchEndToken = $parameter['end'] + 1; $nextVariable = $searchStartToken; do { ...
[ "protected", "function", "isCallTimePassByReferenceParam", "(", "File", "$", "phpcsFile", ",", "$", "parameter", ",", "$", "nestingLevel", ")", "{", "$", "tokens", "=", "$", "phpcsFile", "->", "getTokens", "(", ")", ";", "$", "searchStartToken", "=", "$", "p...
Determine whether a parameter is passed by reference. @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. @param array $parameter Information on the current parameter to be examined. @param int $nestingLevel Target nesting level. @return bool
[ "Determine", "whether", "a", "parameter", "is", "passed", "by", "reference", "." ]
train
https://github.com/PHPCompatibility/PHPCompatibility/blob/8451ac21d652156e6742bbada166d28503ef67e4/PHPCompatibility/Sniffs/Syntax/ForbiddenCallTimePassByReferenceSniff.php#L171-L252
contentacms/contenta_jsonapi
src/Installer/Form/ModuleConfigureForm.php
ModuleConfigureForm.submitForm
public function submitForm(array &$form, FormStateInterface $form_state) { // Get forms from build info to allow for drush overrides // on default form_state->getValue() that are sent. $build_info = $form_state->getBuildInfo(); $install_state = $build_info['args'][0]['forms']; // Determine form sta...
php
public function submitForm(array &$form, FormStateInterface $form_state) { // Get forms from build info to allow for drush overrides // on default form_state->getValue() that are sent. $build_info = $form_state->getBuildInfo(); $install_state = $build_info['args'][0]['forms']; // Determine form sta...
[ "public", "function", "submitForm", "(", "array", "&", "$", "form", ",", "FormStateInterface", "$", "form_state", ")", "{", "// Get forms from build info to allow for drush overrides", "// on default form_state->getValue() that are sent.", "$", "build_info", "=", "$", "form_s...
{@inheritdoc}
[ "{" ]
train
https://github.com/contentacms/contenta_jsonapi/blob/633c062d80e2214815e47cce0f9643e6e65fc869/src/Installer/Form/ModuleConfigureForm.php#L105-L128
contentacms/contenta_jsonapi
src/Installer/Form/ModuleConfigureForm.php
ModuleConfigureForm.sortByWeights
private static function sortByWeights(array &$array) { uasort($array, function ($a, $b) { $a_weight = isset($a['weight']) ? $a['weight'] : 0; $b_weight = isset($b['weight']) ? $b['weight'] : 0; if ($a_weight == $b_weight) { return ($a['label'] > $b['label']) ? 1 : -1; } return...
php
private static function sortByWeights(array &$array) { uasort($array, function ($a, $b) { $a_weight = isset($a['weight']) ? $a['weight'] : 0; $b_weight = isset($b['weight']) ? $b['weight'] : 0; if ($a_weight == $b_weight) { return ($a['label'] > $b['label']) ? 1 : -1; } return...
[ "private", "static", "function", "sortByWeights", "(", "array", "&", "$", "array", ")", "{", "uasort", "(", "$", "array", ",", "function", "(", "$", "a", ",", "$", "b", ")", "{", "$", "a_weight", "=", "isset", "(", "$", "a", "[", "'weight'", "]", ...
Returns a sorting function to sort an array by weights. If an array element doesn't provide a weight, it will be set to 0. If two elements have the same weight, they are sorted by label. @param array $array The array to be sorted.
[ "Returns", "a", "sorting", "function", "to", "sort", "an", "array", "by", "weights", "." ]
train
https://github.com/contentacms/contenta_jsonapi/blob/633c062d80e2214815e47cce0f9643e6e65fc869/src/Installer/Form/ModuleConfigureForm.php#L139-L149
contentacms/contenta_jsonapi
src/Plugin/Contenta/OptionalModule/AbstractOptionalModule.php
AbstractOptionalModule.buildForm
public function buildForm(array $form, FormStateInterface $form_state) { // Check if this method is overridden. $reflection = new \ReflectionClass($this); foreach ($reflection->getMethods() as $method) { if ($method->name == 'buildForm') { if ($method->class != get_class($this)) { r...
php
public function buildForm(array $form, FormStateInterface $form_state) { // Check if this method is overridden. $reflection = new \ReflectionClass($this); foreach ($reflection->getMethods() as $method) { if ($method->name == 'buildForm') { if ($method->class != get_class($this)) { r...
[ "public", "function", "buildForm", "(", "array", "$", "form", ",", "FormStateInterface", "$", "form_state", ")", "{", "// Check if this method is overridden.", "$", "reflection", "=", "new", "\\", "ReflectionClass", "(", "$", "this", ")", ";", "foreach", "(", "$...
{@inheritdoc}
[ "{" ]
train
https://github.com/contentacms/contenta_jsonapi/blob/633c062d80e2214815e47cce0f9643e6e65fc869/src/Plugin/Contenta/OptionalModule/AbstractOptionalModule.php#L68-L92
contentacms/contenta_jsonapi
modules/recipes_magazin/src/Plugin/migrate/source/RecipeExternalImages.php
RecipeExternalImages.initializeIterator
public function initializeIterator() { $values = []; foreach (parent::initializeIterator() as $row) { if (isset($row[$this->configuration['column']])) { foreach (explode(',', $row[$this->configuration['column']]) as $single_image_url) { if (UrlHelper::isExternal($single_image_url)) { ...
php
public function initializeIterator() { $values = []; foreach (parent::initializeIterator() as $row) { if (isset($row[$this->configuration['column']])) { foreach (explode(',', $row[$this->configuration['column']]) as $single_image_url) { if (UrlHelper::isExternal($single_image_url)) { ...
[ "public", "function", "initializeIterator", "(", ")", "{", "$", "values", "=", "[", "]", ";", "foreach", "(", "parent", "::", "initializeIterator", "(", ")", "as", "$", "row", ")", "{", "if", "(", "isset", "(", "$", "row", "[", "$", "this", "->", "...
{@inheritdoc}
[ "{" ]
train
https://github.com/contentacms/contenta_jsonapi/blob/633c062d80e2214815e47cce0f9643e6e65fc869/modules/recipes_magazin/src/Plugin/migrate/source/RecipeExternalImages.php#L19-L36
contentacms/contenta_jsonapi
modules/recipes_magazin/src/Plugin/migrate/source/CSV.php
CSV.initializeIterator
public function initializeIterator() { // File handler using header-rows-respecting extension of SPLFileObject. $module_handler = $this->getModuleHandler(); $migration_info = $this->migration->getPluginDefinition(); $module = $module_handler->getModule($migration_info['provider']); $this->file = new...
php
public function initializeIterator() { // File handler using header-rows-respecting extension of SPLFileObject. $module_handler = $this->getModuleHandler(); $migration_info = $this->migration->getPluginDefinition(); $module = $module_handler->getModule($migration_info['provider']); $this->file = new...
[ "public", "function", "initializeIterator", "(", ")", "{", "// File handler using header-rows-respecting extension of SPLFileObject.", "$", "module_handler", "=", "$", "this", "->", "getModuleHandler", "(", ")", ";", "$", "migration_info", "=", "$", "this", "->", "migra...
{@inheritdoc}
[ "{" ]
train
https://github.com/contentacms/contenta_jsonapi/blob/633c062d80e2214815e47cce0f9643e6e65fc869/modules/recipes_magazin/src/Plugin/migrate/source/CSV.php#L85-L120
contentacms/contenta_jsonapi
modules/recipes_magazin/src/Plugin/migrate/source/CSV.php
CSV.getIDs
public function getIDs() { $ids = []; foreach ($this->configuration['keys'] as $delta => $value) { if (is_array($value)) { $ids[$delta] = $value; } else { $ids[$value]['type'] = 'string'; } } return $ids; }
php
public function getIDs() { $ids = []; foreach ($this->configuration['keys'] as $delta => $value) { if (is_array($value)) { $ids[$delta] = $value; } else { $ids[$value]['type'] = 'string'; } } return $ids; }
[ "public", "function", "getIDs", "(", ")", "{", "$", "ids", "=", "[", "]", ";", "foreach", "(", "$", "this", "->", "configuration", "[", "'keys'", "]", "as", "$", "delta", "=>", "$", "value", ")", "{", "if", "(", "is_array", "(", "$", "value", ")"...
{@inheritdoc}
[ "{" ]
train
https://github.com/contentacms/contenta_jsonapi/blob/633c062d80e2214815e47cce0f9643e6e65fc869/modules/recipes_magazin/src/Plugin/migrate/source/CSV.php#L125-L136
contentacms/contenta_jsonapi
modules/recipes_magazin/src/Plugin/migrate/source/CSV.php
CSV.fields
public function fields() { $fields = []; foreach ($this->getIterator()->getColumnNames() as $column) { $fields[key($column)] = reset($column); } // Any caller-specified fields with the same names as extracted fields will // override them; any others will be added. if (!empty($this->config...
php
public function fields() { $fields = []; foreach ($this->getIterator()->getColumnNames() as $column) { $fields[key($column)] = reset($column); } // Any caller-specified fields with the same names as extracted fields will // override them; any others will be added. if (!empty($this->config...
[ "public", "function", "fields", "(", ")", "{", "$", "fields", "=", "[", "]", ";", "foreach", "(", "$", "this", "->", "getIterator", "(", ")", "->", "getColumnNames", "(", ")", "as", "$", "column", ")", "{", "$", "fields", "[", "key", "(", "$", "c...
{@inheritdoc}
[ "{" ]
train
https://github.com/contentacms/contenta_jsonapi/blob/633c062d80e2214815e47cce0f9643e6e65fc869/modules/recipes_magazin/src/Plugin/migrate/source/CSV.php#L141-L154
contentacms/contenta_jsonapi
modules/recipes_magazin/src/Plugin/migrate/process/Prepend.php
Prepend.transform
public function transform($value, MigrateExecutableInterface $migrate_executable, Row $row, $destination_property) { if (is_array($value)) { $callback = function ($item) use ($migrate_executable, $row, $destination_property) { return $this->transform( $item, $migrate_executable, ...
php
public function transform($value, MigrateExecutableInterface $migrate_executable, Row $row, $destination_property) { if (is_array($value)) { $callback = function ($item) use ($migrate_executable, $row, $destination_property) { return $this->transform( $item, $migrate_executable, ...
[ "public", "function", "transform", "(", "$", "value", ",", "MigrateExecutableInterface", "$", "migrate_executable", ",", "Row", "$", "row", ",", "$", "destination_property", ")", "{", "if", "(", "is_array", "(", "$", "value", ")", ")", "{", "$", "callback", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/contentacms/contenta_jsonapi/blob/633c062d80e2214815e47cce0f9643e6e65fc869/modules/recipes_magazin/src/Plugin/migrate/process/Prepend.php#L33-L49
contentacms/contenta_jsonapi
modules/contenta_enhancements/src/Form/RevertForm.php
RevertForm.submitForm
public function submitForm(array &$form, FormStateInterface $form_state) { // Use the admin theme in the front-end. $this->siteConfig->set('page.front', '/admin/content'); $this->siteConfig->save(); $this->moduleInstaller->uninstall(['recipes_magazin']); drupal_set_message($this->t('Contenta has suc...
php
public function submitForm(array &$form, FormStateInterface $form_state) { // Use the admin theme in the front-end. $this->siteConfig->set('page.front', '/admin/content'); $this->siteConfig->save(); $this->moduleInstaller->uninstall(['recipes_magazin']); drupal_set_message($this->t('Contenta has suc...
[ "public", "function", "submitForm", "(", "array", "&", "$", "form", ",", "FormStateInterface", "$", "form_state", ")", "{", "// Use the admin theme in the front-end.", "$", "this", "->", "siteConfig", "->", "set", "(", "'page.front'", ",", "'/admin/content'", ")", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/contentacms/contenta_jsonapi/blob/633c062d80e2214815e47cce0f9643e6e65fc869/modules/contenta_enhancements/src/Form/RevertForm.php#L58-L65
contentacms/contenta_jsonapi
modules/recipes_magazin/src/Plugin/migrate/source/Directory.php
Directory.initializeIterator
public function initializeIterator() { $module_handler = $this->getModuleHandler(); $migration_info = $this->migration->getPluginDefinition(); $module = $module_handler->getModule($migration_info['provider']); $it = new \DirectoryIterator(DRUPAL_ROOT . '/' . $module->getPath() . '/' . $this->configurati...
php
public function initializeIterator() { $module_handler = $this->getModuleHandler(); $migration_info = $this->migration->getPluginDefinition(); $module = $module_handler->getModule($migration_info['provider']); $it = new \DirectoryIterator(DRUPAL_ROOT . '/' . $module->getPath() . '/' . $this->configurati...
[ "public", "function", "initializeIterator", "(", ")", "{", "$", "module_handler", "=", "$", "this", "->", "getModuleHandler", "(", ")", ";", "$", "migration_info", "=", "$", "this", "->", "migration", "->", "getPluginDefinition", "(", ")", ";", "$", "module"...
{@inheritdoc}
[ "{" ]
train
https://github.com/contentacms/contenta_jsonapi/blob/633c062d80e2214815e47cce0f9643e6e65fc869/modules/recipes_magazin/src/Plugin/migrate/source/Directory.php#L43-L63
contentacms/contenta_jsonapi
modules/contenta_enhancements/src/ContentaEnhancementsServiceProvider.php
ContentaEnhancementsServiceProvider.alter
public function alter(ContainerBuilder $container) { $cors_config = $container->getParameter('cors.config'); $cors_config['enabled'] = TRUE; $container->setParameter('cors.config', $cors_config); }
php
public function alter(ContainerBuilder $container) { $cors_config = $container->getParameter('cors.config'); $cors_config['enabled'] = TRUE; $container->setParameter('cors.config', $cors_config); }
[ "public", "function", "alter", "(", "ContainerBuilder", "$", "container", ")", "{", "$", "cors_config", "=", "$", "container", "->", "getParameter", "(", "'cors.config'", ")", ";", "$", "cors_config", "[", "'enabled'", "]", "=", "TRUE", ";", "$", "container"...
{@inheritdoc}
[ "{" ]
train
https://github.com/contentacms/contenta_jsonapi/blob/633c062d80e2214815e47cce0f9643e6e65fc869/modules/contenta_enhancements/src/ContentaEnhancementsServiceProvider.php#L16-L20
contentacms/contenta_jsonapi
modules/recipes_magazin/src/Plugin/migrate/process/HtmlInFile.php
HtmlInFile.transform
public function transform($value, MigrateExecutableInterface $migrate_executable, Row $row, $destination_property) { $path = sprintf( '%s/../../../../default_content/%s/%s', __DIR__, $this->configuration['directory'], $row->getSourceProperty($this->configuration['source']) ); if (!fi...
php
public function transform($value, MigrateExecutableInterface $migrate_executable, Row $row, $destination_property) { $path = sprintf( '%s/../../../../default_content/%s/%s', __DIR__, $this->configuration['directory'], $row->getSourceProperty($this->configuration['source']) ); if (!fi...
[ "public", "function", "transform", "(", "$", "value", ",", "MigrateExecutableInterface", "$", "migrate_executable", ",", "Row", "$", "row", ",", "$", "destination_property", ")", "{", "$", "path", "=", "sprintf", "(", "'%s/../../../../default_content/%s/%s'", ",", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/contentacms/contenta_jsonapi/blob/633c062d80e2214815e47cce0f9643e6e65fc869/modules/recipes_magazin/src/Plugin/migrate/process/HtmlInFile.php#L37-L49
contentacms/contenta_jsonapi
modules/recipes_magazin/src/MigrationRunner.php
MigrationRunner.execute
protected function execute(array $migration_ids, $method_name) { array_walk($migration_ids, function ($migration_id) use ($method_name) { /** @var \Drupal\migrate\Plugin\Migration $migration */ if (!$migration = $this->manager->createInstance($migration_id)) { throw new PluginNotFoundException($...
php
protected function execute(array $migration_ids, $method_name) { array_walk($migration_ids, function ($migration_id) use ($method_name) { /** @var \Drupal\migrate\Plugin\Migration $migration */ if (!$migration = $this->manager->createInstance($migration_id)) { throw new PluginNotFoundException($...
[ "protected", "function", "execute", "(", "array", "$", "migration_ids", ",", "$", "method_name", ")", "{", "array_walk", "(", "$", "migration_ids", ",", "function", "(", "$", "migration_id", ")", "use", "(", "$", "method_name", ")", "{", "/** @var \\Drupal\\mi...
Import or remove content from migrations. @param string[] $migration_ids The list of migrations to run. @param string $method_name The method to execute: import or rollback.
[ "Import", "or", "remove", "content", "from", "migrations", "." ]
train
https://github.com/contentacms/contenta_jsonapi/blob/633c062d80e2214815e47cce0f9643e6e65fc869/modules/recipes_magazin/src/MigrationRunner.php#L60-L69
contentacms/contenta_jsonapi
modules/contenta_enhancements/src/EventSubscriber/RoutingDisabler.php
RoutingDisabler.onRouteBuildAlter
public function onRouteBuildAlter(RouteBuildEvent $event) { $collection = $event->getRouteCollection(); array_walk(static::$disabledRoutes, function ($disabledRouteName) use ($collection) { if ($route = $collection->get($disabledRouteName)) { $route->setRequirement('_access', 'FALSE'); } ...
php
public function onRouteBuildAlter(RouteBuildEvent $event) { $collection = $event->getRouteCollection(); array_walk(static::$disabledRoutes, function ($disabledRouteName) use ($collection) { if ($route = $collection->get($disabledRouteName)) { $route->setRequirement('_access', 'FALSE'); } ...
[ "public", "function", "onRouteBuildAlter", "(", "RouteBuildEvent", "$", "event", ")", "{", "$", "collection", "=", "$", "event", "->", "getRouteCollection", "(", ")", ";", "array_walk", "(", "static", "::", "$", "disabledRoutes", ",", "function", "(", "$", "...
Hides routes by denying access to them. @param \Drupal\Core\Routing\RouteBuildEvent $event
[ "Hides", "routes", "by", "denying", "access", "to", "them", "." ]
train
https://github.com/contentacms/contenta_jsonapi/blob/633c062d80e2214815e47cce0f9643e6e65fc869/modules/contenta_enhancements/src/EventSubscriber/RoutingDisabler.php#L23-L30
contentacms/contenta_jsonapi
modules/recipes_magazin/src/Plugin/migrate/source/Terms.php
Terms.initializeIterator
public function initializeIterator() { $values = []; foreach (parent::initializeIterator() as $row) { if (isset($row[$this->configuration['column']])) { $terms = explode(',', $row[$this->configuration['column']]); foreach (array_filter(array_map('trim', $terms)) as $single_term) { ...
php
public function initializeIterator() { $values = []; foreach (parent::initializeIterator() as $row) { if (isset($row[$this->configuration['column']])) { $terms = explode(',', $row[$this->configuration['column']]); foreach (array_filter(array_map('trim', $terms)) as $single_term) { ...
[ "public", "function", "initializeIterator", "(", ")", "{", "$", "values", "=", "[", "]", ";", "foreach", "(", "parent", "::", "initializeIterator", "(", ")", "as", "$", "row", ")", "{", "if", "(", "isset", "(", "$", "row", "[", "$", "this", "->", "...
{@inheritdoc}
[ "{" ]
train
https://github.com/contentacms/contenta_jsonapi/blob/633c062d80e2214815e47cce0f9643e6e65fc869/modules/recipes_magazin/src/Plugin/migrate/source/Terms.php#L17-L30
contentacms/contenta_jsonapi
modules/recipes_magazin/src/CSVFileObject.php
CSVFileObject.current
public function current() { $row = parent::current(); if ($row && !empty($this->columnNames)) { // Only use columns specified in the defined CSV columns. $row = array_intersect_key($row, $this->columnNames); // Set meaningful keys for the columns mentioned in $this->csvColumns. foreach ...
php
public function current() { $row = parent::current(); if ($row && !empty($this->columnNames)) { // Only use columns specified in the defined CSV columns. $row = array_intersect_key($row, $this->columnNames); // Set meaningful keys for the columns mentioned in $this->csvColumns. foreach ...
[ "public", "function", "current", "(", ")", "{", "$", "row", "=", "parent", "::", "current", "(", ")", ";", "if", "(", "$", "row", "&&", "!", "empty", "(", "$", "this", "->", "columnNames", ")", ")", "{", "// Only use columns specified in the defined CSV co...
{@inheritdoc}
[ "{" ]
train
https://github.com/contentacms/contenta_jsonapi/blob/633c062d80e2214815e47cce0f9643e6e65fc869/modules/recipes_magazin/src/CSVFileObject.php#L52-L68
contentacms/contenta_jsonapi
src/Plugin/Contenta/OptionalModule/ContentaGraphQL.php
ContentaGraphQL.buildForm
public function buildForm(array $form, FormStateInterface $form_state) { $form = parent::buildForm($form, $form_state); $link = Link::fromTextAndUrl( 'GraphQL integration in Contenta JS', Url::fromUri('https://github.com/contentacms/contentajs-graphql') )->toString(); $form['contenta_graph...
php
public function buildForm(array $form, FormStateInterface $form_state) { $form = parent::buildForm($form, $form_state); $link = Link::fromTextAndUrl( 'GraphQL integration in Contenta JS', Url::fromUri('https://github.com/contentacms/contentajs-graphql') )->toString(); $form['contenta_graph...
[ "public", "function", "buildForm", "(", "array", "$", "form", ",", "FormStateInterface", "$", "form_state", ")", "{", "$", "form", "=", "parent", "::", "buildForm", "(", "$", "form", ",", "$", "form_state", ")", ";", "$", "link", "=", "Link", "::", "fr...
{@inheritdoc}
[ "{" ]
train
https://github.com/contentacms/contenta_jsonapi/blob/633c062d80e2214815e47cce0f9643e6e65fc869/src/Plugin/Contenta/OptionalModule/ContentaGraphQL.php#L24-L43
hwi/HWIOAuthBundle
Security/Core/Authentication/Token/OAuthToken.php
OAuthToken.setRawToken
public function setRawToken($token) { if (\is_array($token)) { if (isset($token['access_token'])) { $this->accessToken = $token['access_token']; } elseif (isset($token['oauth_token'])) { $this->accessToken = $token['oauth_token']; } else { ...
php
public function setRawToken($token) { if (\is_array($token)) { if (isset($token['access_token'])) { $this->accessToken = $token['access_token']; } elseif (isset($token['oauth_token'])) { $this->accessToken = $token['oauth_token']; } else { ...
[ "public", "function", "setRawToken", "(", "$", "token", ")", "{", "if", "(", "\\", "is_array", "(", "$", "token", ")", ")", "{", "if", "(", "isset", "(", "$", "token", "[", "'access_token'", "]", ")", ")", "{", "$", "this", "->", "accessToken", "="...
@param array|string $token The OAuth token @throws \InvalidArgumentException
[ "@param", "array|string", "$token", "The", "OAuth", "token" ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/Security/Core/Authentication/Token/OAuthToken.php#L102-L135
hwi/HWIOAuthBundle
Security/Core/Authentication/Token/OAuthToken.php
OAuthToken.isExpired
public function isExpired() { if (null === $this->expiresIn) { return false; } return ($this->createdAt + $this->expiresIn - time()) < 30; }
php
public function isExpired() { if (null === $this->expiresIn) { return false; } return ($this->createdAt + $this->expiresIn - time()) < 30; }
[ "public", "function", "isExpired", "(", ")", "{", "if", "(", "null", "===", "$", "this", "->", "expiresIn", ")", "{", "return", "false", ";", "}", "return", "(", "$", "this", "->", "createdAt", "+", "$", "this", "->", "expiresIn", "-", "time", "(", ...
Returns if the `access_token` is expired. @return bool true if the `access_token` is expired
[ "Returns", "if", "the", "access_token", "is", "expired", "." ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/Security/Core/Authentication/Token/OAuthToken.php#L227-L234
hwi/HWIOAuthBundle
Security/Core/Authentication/Token/OAuthToken.php
OAuthToken.serialize
public function serialize() { return serialize([ $this->accessToken, $this->rawToken, $this->refreshToken, $this->expiresIn, $this->createdAt, $this->resourceOwnerName, parent::serialize(), ]); }
php
public function serialize() { return serialize([ $this->accessToken, $this->rawToken, $this->refreshToken, $this->expiresIn, $this->createdAt, $this->resourceOwnerName, parent::serialize(), ]); }
[ "public", "function", "serialize", "(", ")", "{", "return", "serialize", "(", "[", "$", "this", "->", "accessToken", ",", "$", "this", "->", "rawToken", ",", "$", "this", "->", "refreshToken", ",", "$", "this", "->", "expiresIn", ",", "$", "this", "->"...
{@inheritdoc}
[ "{" ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/Security/Core/Authentication/Token/OAuthToken.php#L259-L270
hwi/HWIOAuthBundle
Security/Core/Authentication/Token/OAuthToken.php
OAuthToken.unserialize
public function unserialize($serialized) { $data = unserialize($serialized); // add a few extra elements in the array to ensure that we have enough keys when un-serializing // older data which does not include all properties. $data = array_merge($data, array_fill(0, 4, null)); ...
php
public function unserialize($serialized) { $data = unserialize($serialized); // add a few extra elements in the array to ensure that we have enough keys when un-serializing // older data which does not include all properties. $data = array_merge($data, array_fill(0, 4, null)); ...
[ "public", "function", "unserialize", "(", "$", "serialized", ")", "{", "$", "data", "=", "unserialize", "(", "$", "serialized", ")", ";", "// add a few extra elements in the array to ensure that we have enough keys when un-serializing", "// older data which does not include all p...
{@inheritdoc}
[ "{" ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/Security/Core/Authentication/Token/OAuthToken.php#L275-L296
hwi/HWIOAuthBundle
OAuth/ResourceOwner/WunderlistResourceOwner.php
WunderlistResourceOwner.getUserInformation
public function getUserInformation(array $accessToken, array $extraParameters = []) { $content = $this->doGetUserInformationRequest($this->options['infos_url'], ['access_token' => $accessToken['access_token']]); $response = $this->getUserResponse(); $response->setData($content instanceof Re...
php
public function getUserInformation(array $accessToken, array $extraParameters = []) { $content = $this->doGetUserInformationRequest($this->options['infos_url'], ['access_token' => $accessToken['access_token']]); $response = $this->getUserResponse(); $response->setData($content instanceof Re...
[ "public", "function", "getUserInformation", "(", "array", "$", "accessToken", ",", "array", "$", "extraParameters", "=", "[", "]", ")", "{", "$", "content", "=", "$", "this", "->", "doGetUserInformationRequest", "(", "$", "this", "->", "options", "[", "'info...
{@inheritdoc}
[ "{" ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/OAuth/ResourceOwner/WunderlistResourceOwner.php#L36-L46
hwi/HWIOAuthBundle
OAuth/ResourceOwner/WunderlistResourceOwner.php
WunderlistResourceOwner.doGetUserInformationRequest
protected function doGetUserInformationRequest($url, array $parameters = []) { return $this->httpRequest($url, null, [ 'X-Client-ID' => $this->options['client_id'], 'X-Access-Token' => $parameters['access_token'], ]); }
php
protected function doGetUserInformationRequest($url, array $parameters = []) { return $this->httpRequest($url, null, [ 'X-Client-ID' => $this->options['client_id'], 'X-Access-Token' => $parameters['access_token'], ]); }
[ "protected", "function", "doGetUserInformationRequest", "(", "$", "url", ",", "array", "$", "parameters", "=", "[", "]", ")", "{", "return", "$", "this", "->", "httpRequest", "(", "$", "url", ",", "null", ",", "[", "'X-Client-ID'", "=>", "$", "this", "->...
{@inheritdoc}
[ "{" ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/OAuth/ResourceOwner/WunderlistResourceOwner.php#L51-L57
hwi/HWIOAuthBundle
OAuth/ResourceOwner/JiraResourceOwner.php
JiraResourceOwner.getUserInformation
public function getUserInformation(array $accessToken, array $extraParameters = []) { $parameters = array_merge([ 'oauth_consumer_key' => $this->options['client_id'], 'oauth_timestamp' => time(), 'oauth_nonce' => $this->generateNonce(), 'oauth_version' => '1.0...
php
public function getUserInformation(array $accessToken, array $extraParameters = []) { $parameters = array_merge([ 'oauth_consumer_key' => $this->options['client_id'], 'oauth_timestamp' => time(), 'oauth_nonce' => $this->generateNonce(), 'oauth_version' => '1.0...
[ "public", "function", "getUserInformation", "(", "array", "$", "accessToken", ",", "array", "$", "extraParameters", "=", "[", "]", ")", "{", "$", "parameters", "=", "array_merge", "(", "[", "'oauth_consumer_key'", "=>", "$", "this", "->", "options", "[", "'c...
{@inheritdoc}
[ "{" ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/OAuth/ResourceOwner/JiraResourceOwner.php#L41-L83
hwi/HWIOAuthBundle
OAuth/ResourceOwner/WindowsLiveResourceOwner.php
WindowsLiveResourceOwner.httpRequest
protected function httpRequest($url, $content = null, array $headers = [], $method = null) { // Skip the Content-Type header in GenericOAuth2ResourceOwner::httpRequest return AbstractResourceOwner::httpRequest($url, $content, $headers, $method); }
php
protected function httpRequest($url, $content = null, array $headers = [], $method = null) { // Skip the Content-Type header in GenericOAuth2ResourceOwner::httpRequest return AbstractResourceOwner::httpRequest($url, $content, $headers, $method); }
[ "protected", "function", "httpRequest", "(", "$", "url", ",", "$", "content", "=", "null", ",", "array", "$", "headers", "=", "[", "]", ",", "$", "method", "=", "null", ")", "{", "// Skip the Content-Type header in GenericOAuth2ResourceOwner::httpRequest", "return...
{@inheritdoc}
[ "{" ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/OAuth/ResourceOwner/WindowsLiveResourceOwner.php#L46-L50
hwi/HWIOAuthBundle
OAuth/ResourceOwner/AzureResourceOwner.php
AzureResourceOwner.configure
public function configure() { $this->options['access_token_url'] = sprintf($this->options['access_token_url'], $this->options['application']); $this->options['authorization_url'] = sprintf($this->options['authorization_url'], $this->options['application']); }
php
public function configure() { $this->options['access_token_url'] = sprintf($this->options['access_token_url'], $this->options['application']); $this->options['authorization_url'] = sprintf($this->options['authorization_url'], $this->options['application']); }
[ "public", "function", "configure", "(", ")", "{", "$", "this", "->", "options", "[", "'access_token_url'", "]", "=", "sprintf", "(", "$", "this", "->", "options", "[", "'access_token_url'", "]", ",", "$", "this", "->", "options", "[", "'application'", "]",...
{@inheritdoc}
[ "{" ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/OAuth/ResourceOwner/AzureResourceOwner.php#L37-L41
hwi/HWIOAuthBundle
OAuth/ResourceOwner/AzureResourceOwner.php
AzureResourceOwner.getUserInformation
public function getUserInformation(array $accessToken, array $extraParameters = []) { // from http://stackoverflow.com/a/28748285/624544 list(, $jwt) = explode('.', $accessToken['id_token'], 3); // if the token was urlencoded, do some fixes to ensure that it is valid base64 encoded ...
php
public function getUserInformation(array $accessToken, array $extraParameters = []) { // from http://stackoverflow.com/a/28748285/624544 list(, $jwt) = explode('.', $accessToken['id_token'], 3); // if the token was urlencoded, do some fixes to ensure that it is valid base64 encoded ...
[ "public", "function", "getUserInformation", "(", "array", "$", "accessToken", ",", "array", "$", "extraParameters", "=", "[", "]", ")", "{", "// from http://stackoverflow.com/a/28748285/624544", "list", "(", ",", "$", "jwt", ")", "=", "explode", "(", "'.'", ",",...
{@inheritdoc} @throws \InvalidArgumentException
[ "{", "@inheritdoc", "}" ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/OAuth/ResourceOwner/AzureResourceOwner.php#L64-L90
hwi/HWIOAuthBundle
OAuth/ResourceOwner/AbstractResourceOwner.php
AbstractResourceOwner.getUserResponse
protected function getUserResponse() { $response = new $this->options['user_response_class'](); if ($response instanceof PathUserResponse) { $response->setPaths($this->paths); } return $response; }
php
protected function getUserResponse() { $response = new $this->options['user_response_class'](); if ($response instanceof PathUserResponse) { $response->setPaths($this->paths); } return $response; }
[ "protected", "function", "getUserResponse", "(", ")", "{", "$", "response", "=", "new", "$", "this", "->", "options", "[", "'user_response_class'", "]", "(", ")", ";", "if", "(", "$", "response", "instanceof", "PathUserResponse", ")", "{", "$", "response", ...
Get the response object to return. @return UserResponseInterface
[ "Get", "the", "response", "object", "to", "return", "." ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/OAuth/ResourceOwner/AbstractResourceOwner.php#L207-L215
hwi/HWIOAuthBundle
OAuth/ResourceOwner/AbstractResourceOwner.php
AbstractResourceOwner.normalizeUrl
protected function normalizeUrl($url, array $parameters = []) { $normalizedUrl = $url; if (!empty($parameters)) { $normalizedUrl .= (false !== strpos($url, '?') ? '&' : '?').http_build_query($parameters, '', '&'); } return $normalizedUrl; }
php
protected function normalizeUrl($url, array $parameters = []) { $normalizedUrl = $url; if (!empty($parameters)) { $normalizedUrl .= (false !== strpos($url, '?') ? '&' : '?').http_build_query($parameters, '', '&'); } return $normalizedUrl; }
[ "protected", "function", "normalizeUrl", "(", "$", "url", ",", "array", "$", "parameters", "=", "[", "]", ")", "{", "$", "normalizedUrl", "=", "$", "url", ";", "if", "(", "!", "empty", "(", "$", "parameters", ")", ")", "{", "$", "normalizedUrl", ".="...
@param string $url @param array $parameters @return string
[ "@param", "string", "$url", "@param", "array", "$parameters" ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/OAuth/ResourceOwner/AbstractResourceOwner.php#L223-L231
hwi/HWIOAuthBundle
OAuth/ResourceOwner/AbstractResourceOwner.php
AbstractResourceOwner.httpRequest
protected function httpRequest($url, $content = null, array $headers = [], $method = null) { if (null === $method) { $method = null === $content || '' === $content ? 'GET' : 'POST'; } $headers += ['User-Agent' => 'HWIOAuthBundle (https://github.com/hwi/HWIOAuthBundle)']; ...
php
protected function httpRequest($url, $content = null, array $headers = [], $method = null) { if (null === $method) { $method = null === $content || '' === $content ? 'GET' : 'POST'; } $headers += ['User-Agent' => 'HWIOAuthBundle (https://github.com/hwi/HWIOAuthBundle)']; ...
[ "protected", "function", "httpRequest", "(", "$", "url", ",", "$", "content", "=", "null", ",", "array", "$", "headers", "=", "[", "]", ",", "$", "method", "=", "null", ")", "{", "if", "(", "null", "===", "$", "method", ")", "{", "$", "method", "...
Performs an HTTP request. @param string $url The url to fetch @param string|array $content The content of the request @param array $headers The headers of the request @param string $method The HTTP method to use @throws HttpTransportException @return ResponseInterface The response content
[ "Performs", "an", "HTTP", "request", "." ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/OAuth/ResourceOwner/AbstractResourceOwner.php#L245-L268
hwi/HWIOAuthBundle
OAuth/ResourceOwner/AbstractResourceOwner.php
AbstractResourceOwner.getResponseContent
protected function getResponseContent(ResponseInterface $rawResponse) { // First check that content in response exists, due too bug: https://bugs.php.net/bug.php?id=54484 $content = (string) $rawResponse->getBody(); if (!$content) { return []; } $response = json_...
php
protected function getResponseContent(ResponseInterface $rawResponse) { // First check that content in response exists, due too bug: https://bugs.php.net/bug.php?id=54484 $content = (string) $rawResponse->getBody(); if (!$content) { return []; } $response = json_...
[ "protected", "function", "getResponseContent", "(", "ResponseInterface", "$", "rawResponse", ")", "{", "// First check that content in response exists, due too bug: https://bugs.php.net/bug.php?id=54484", "$", "content", "=", "(", "string", ")", "$", "rawResponse", "->", "getBo...
Get the 'parsed' content based on the response headers. @param ResponseInterface $rawResponse @return array
[ "Get", "the", "parsed", "content", "based", "on", "the", "response", "headers", "." ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/OAuth/ResourceOwner/AbstractResourceOwner.php#L277-L291
hwi/HWIOAuthBundle
OAuth/ResourceOwner/AbstractResourceOwner.php
AbstractResourceOwner.configureOptions
protected function configureOptions(OptionsResolver $resolver) { $resolver->setRequired([ 'client_id', 'client_secret', 'authorization_url', 'access_token_url', 'infos_url', ]); $resolver->setDefaults([ 'scope' => null,...
php
protected function configureOptions(OptionsResolver $resolver) { $resolver->setRequired([ 'client_id', 'client_secret', 'authorization_url', 'access_token_url', 'infos_url', ]); $resolver->setDefaults([ 'scope' => null,...
[ "protected", "function", "configureOptions", "(", "OptionsResolver", "$", "resolver", ")", "{", "$", "resolver", "->", "setRequired", "(", "[", "'client_id'", ",", "'client_secret'", ",", "'authorization_url'", ",", "'access_token_url'", ",", "'infos_url'", ",", "]"...
Configure the option resolver. @param OptionsResolver $resolver @throws \Symfony\Component\OptionsResolver\Exception\AccessException @throws \Symfony\Component\OptionsResolver\Exception\UndefinedOptionsException
[ "Configure", "the", "option", "resolver", "." ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/OAuth/ResourceOwner/AbstractResourceOwner.php#L331-L349
hwi/HWIOAuthBundle
OAuth/ResourceOwner/GitLabResourceOwner.php
GitLabResourceOwner.revokeToken
public function revokeToken($token) { $parameters = [ 'token' => $token, 'client_id' => $this->options['client_id'], 'client_secret' => $this->options['client_secret'], ]; $response = $this->httpRequest( $this->options['revoke_token_url'], ...
php
public function revokeToken($token) { $parameters = [ 'token' => $token, 'client_id' => $this->options['client_id'], 'client_secret' => $this->options['client_secret'], ]; $response = $this->httpRequest( $this->options['revoke_token_url'], ...
[ "public", "function", "revokeToken", "(", "$", "token", ")", "{", "$", "parameters", "=", "[", "'token'", "=>", "$", "token", ",", "'client_id'", "=>", "$", "this", "->", "options", "[", "'client_id'", "]", ",", "'client_secret'", "=>", "$", "this", "->"...
{@inheritdoc}
[ "{" ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/OAuth/ResourceOwner/GitLabResourceOwner.php#L37-L53
hwi/HWIOAuthBundle
DependencyInjection/Security/Factory/OAuthFactory.php
OAuthFactory.addConfiguration
public function addConfiguration(NodeDefinition $node) { parent::addConfiguration($node); $builder = $node->children(); $builder ->scalarNode('login_path')->cannotBeEmpty()->isRequired()->end() ; $this->addOAuthProviderConfiguration($node); $this->addRes...
php
public function addConfiguration(NodeDefinition $node) { parent::addConfiguration($node); $builder = $node->children(); $builder ->scalarNode('login_path')->cannotBeEmpty()->isRequired()->end() ; $this->addOAuthProviderConfiguration($node); $this->addRes...
[ "public", "function", "addConfiguration", "(", "NodeDefinition", "$", "node", ")", "{", "parent", "::", "addConfiguration", "(", "$", "node", ")", ";", "$", "builder", "=", "$", "node", "->", "children", "(", ")", ";", "$", "builder", "->", "scalarNode", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/DependencyInjection/Security/Factory/OAuthFactory.php#L33-L44
hwi/HWIOAuthBundle
DependencyInjection/Security/Factory/OAuthFactory.php
OAuthFactory.createResourceOwnerMap
protected function createResourceOwnerMap(ContainerBuilder $container, $id, array $config) { $definitionClassname = $this->getDefinitionClassname(); $resourceOwnersMap = []; foreach ($config['resource_owners'] as $name => $checkPath) { $resourceOwnersMap[$name] = $checkPath; ...
php
protected function createResourceOwnerMap(ContainerBuilder $container, $id, array $config) { $definitionClassname = $this->getDefinitionClassname(); $resourceOwnersMap = []; foreach ($config['resource_owners'] as $name => $checkPath) { $resourceOwnersMap[$name] = $checkPath; ...
[ "protected", "function", "createResourceOwnerMap", "(", "ContainerBuilder", "$", "container", ",", "$", "id", ",", "array", "$", "config", ")", "{", "$", "definitionClassname", "=", "$", "this", "->", "getDefinitionClassname", "(", ")", ";", "$", "resourceOwners...
Creates a resource owner map for the given configuration. @param ContainerBuilder $container Container to build for @param string $id Firewall id @param array $config Configuration
[ "Creates", "a", "resource", "owner", "map", "for", "the", "given", "configuration", "." ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/DependencyInjection/Security/Factory/OAuthFactory.php#L69-L84
hwi/HWIOAuthBundle
DependencyInjection/Security/Factory/OAuthFactory.php
OAuthFactory.createAuthProvider
protected function createAuthProvider(ContainerBuilder $container, $id, $config, $userProviderId) { $definitionClassname = $this->getDefinitionClassname(); $providerId = 'hwi_oauth.authentication.provider.oauth.'.$id; $this->createResourceOwnerMap($container, $id, $config); $contai...
php
protected function createAuthProvider(ContainerBuilder $container, $id, $config, $userProviderId) { $definitionClassname = $this->getDefinitionClassname(); $providerId = 'hwi_oauth.authentication.provider.oauth.'.$id; $this->createResourceOwnerMap($container, $id, $config); $contai...
[ "protected", "function", "createAuthProvider", "(", "ContainerBuilder", "$", "container", ",", "$", "id", ",", "$", "config", ",", "$", "userProviderId", ")", "{", "$", "definitionClassname", "=", "$", "this", "->", "getDefinitionClassname", "(", ")", ";", "$"...
{@inheritdoc}
[ "{" ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/DependencyInjection/Security/Factory/OAuthFactory.php#L101-L117
hwi/HWIOAuthBundle
DependencyInjection/Security/Factory/OAuthFactory.php
OAuthFactory.createEntryPoint
protected function createEntryPoint($container, $id, $config, $defaultEntryPoint) { $entryPointId = 'hwi_oauth.authentication.entry_point.oauth.'.$id; $definitionClassname = $this->getDefinitionClassname(); $container ->setDefinition($entryPointId, new $definitionClassname('hwi_...
php
protected function createEntryPoint($container, $id, $config, $defaultEntryPoint) { $entryPointId = 'hwi_oauth.authentication.entry_point.oauth.'.$id; $definitionClassname = $this->getDefinitionClassname(); $container ->setDefinition($entryPointId, new $definitionClassname('hwi_...
[ "protected", "function", "createEntryPoint", "(", "$", "container", ",", "$", "id", ",", "$", "config", ",", "$", "defaultEntryPoint", ")", "{", "$", "entryPointId", "=", "'hwi_oauth.authentication.entry_point.oauth.'", ".", "$", "id", ";", "$", "definitionClassna...
{@inheritdoc}
[ "{" ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/DependencyInjection/Security/Factory/OAuthFactory.php#L151-L163
hwi/HWIOAuthBundle
DependencyInjection/Security/Factory/OAuthFactory.php
OAuthFactory.createListener
protected function createListener($container, $id, $config, $userProvider) { $listenerId = parent::createListener($container, $id, $config, $userProvider); $checkPaths = []; foreach ($config['resource_owners'] as $checkPath) { $checkPaths[] = $checkPath; } $cont...
php
protected function createListener($container, $id, $config, $userProvider) { $listenerId = parent::createListener($container, $id, $config, $userProvider); $checkPaths = []; foreach ($config['resource_owners'] as $checkPath) { $checkPaths[] = $checkPath; } $cont...
[ "protected", "function", "createListener", "(", "$", "container", ",", "$", "id", ",", "$", "config", ",", "$", "userProvider", ")", "{", "$", "listenerId", "=", "parent", "::", "createListener", "(", "$", "container", ",", "$", "id", ",", "$", "config",...
{@inheritdoc}
[ "{" ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/DependencyInjection/Security/Factory/OAuthFactory.php#L168-L184
hwi/HWIOAuthBundle
OAuth/Response/LinkedinUserResponse.php
LinkedinUserResponse.getProfilePicture
public function getProfilePicture() { // https://docs.microsoft.com/en-us/linkedin/shared/references/v2/profile/profile-picture $profilePicture = $this->getValueForPath('profilepicture'); if ( !isset($profilePicture['displayImage~']) || !isset($profilePicture['display...
php
public function getProfilePicture() { // https://docs.microsoft.com/en-us/linkedin/shared/references/v2/profile/profile-picture $profilePicture = $this->getValueForPath('profilepicture'); if ( !isset($profilePicture['displayImage~']) || !isset($profilePicture['display...
[ "public", "function", "getProfilePicture", "(", ")", "{", "// https://docs.microsoft.com/en-us/linkedin/shared/references/v2/profile/profile-picture", "$", "profilePicture", "=", "$", "this", "->", "getValueForPath", "(", "'profilepicture'", ")", ";", "if", "(", "!", "isset...
{@inheritdoc}
[ "{" ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/OAuth/Response/LinkedinUserResponse.php#L35-L58
hwi/HWIOAuthBundle
OAuth/Response/LinkedinUserResponse.php
LinkedinUserResponse.getPreferredLocaleValue
protected function getPreferredLocaleValue($path) { $multiLocaleString = $this->getValueForPath($path); $locale = ''; if (isset($multiLocaleString['preferredLocale'])) { $locale = $multiLocaleString['preferredLocale']['language']; if (!empty($multiLocaleString['prefe...
php
protected function getPreferredLocaleValue($path) { $multiLocaleString = $this->getValueForPath($path); $locale = ''; if (isset($multiLocaleString['preferredLocale'])) { $locale = $multiLocaleString['preferredLocale']['language']; if (!empty($multiLocaleString['prefe...
[ "protected", "function", "getPreferredLocaleValue", "(", "$", "path", ")", "{", "$", "multiLocaleString", "=", "$", "this", "->", "getValueForPath", "(", "$", "path", ")", ";", "$", "locale", "=", "''", ";", "if", "(", "isset", "(", "$", "multiLocaleString...
Helper to extract the preferred locale value from MultiLocaleString https://docs.microsoft.com/en-us/linkedin/shared/references/v2/object-types#multilocalestring. @param $path @return mixed
[ "Helper", "to", "extract", "the", "preferred", "locale", "value", "from", "MultiLocaleString", "https", ":", "//", "docs", ".", "microsoft", ".", "com", "/", "en", "-", "us", "/", "linkedin", "/", "shared", "/", "references", "/", "v2", "/", "object", "-...
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/OAuth/Response/LinkedinUserResponse.php#L68-L87
hwi/HWIOAuthBundle
OAuth/ResourceOwner/VkontakteResourceOwner.php
VkontakteResourceOwner.getUserInformation
public function getUserInformation(array $accessToken, array $extraParameters = []) { $url = $this->normalizeUrl($this->options['infos_url'], [ 'access_token' => $accessToken['access_token'], 'fields' => $this->options['fields'], 'name_case' => $this->options['name_case']...
php
public function getUserInformation(array $accessToken, array $extraParameters = []) { $url = $this->normalizeUrl($this->options['infos_url'], [ 'access_token' => $accessToken['access_token'], 'fields' => $this->options['fields'], 'name_case' => $this->options['name_case']...
[ "public", "function", "getUserInformation", "(", "array", "$", "accessToken", ",", "array", "$", "extraParameters", "=", "[", "]", ")", "{", "$", "url", "=", "$", "this", "->", "normalizeUrl", "(", "$", "this", "->", "options", "[", "'infos_url'", "]", "...
{@inheritdoc}
[ "{" ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/OAuth/ResourceOwner/VkontakteResourceOwner.php#L44-L72
hwi/HWIOAuthBundle
OAuth/ResourceOwner/PaypalResourceOwner.php
PaypalResourceOwner.configureOptions
protected function configureOptions(OptionsResolver $resolver) { parent::configureOptions($resolver); $resolver->setDefaults([ 'sandbox' => false, 'scope' => 'openid email', 'authorization_url' => 'https://www.paypal.com/webapps/auth/protocol/openidconnect/v1/aut...
php
protected function configureOptions(OptionsResolver $resolver) { parent::configureOptions($resolver); $resolver->setDefaults([ 'sandbox' => false, 'scope' => 'openid email', 'authorization_url' => 'https://www.paypal.com/webapps/auth/protocol/openidconnect/v1/aut...
[ "protected", "function", "configureOptions", "(", "OptionsResolver", "$", "resolver", ")", "{", "parent", "::", "configureOptions", "(", "$", "resolver", ")", ";", "$", "resolver", "->", "setDefaults", "(", "[", "'sandbox'", "=>", "false", ",", "'scope'", "=>"...
{@inheritdoc}
[ "{" ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/OAuth/ResourceOwner/PaypalResourceOwner.php#L36-L63
hwi/HWIOAuthBundle
HWIOAuthBundle.php
HWIOAuthBundle.build
public function build(ContainerBuilder $container) { parent::build($container); /** @var $extension SecurityExtension */ $extension = $container->getExtension('security'); $extension->addSecurityListenerFactory(new OAuthFactory()); $container->addCompilerPass(new SetResourc...
php
public function build(ContainerBuilder $container) { parent::build($container); /** @var $extension SecurityExtension */ $extension = $container->getExtension('security'); $extension->addSecurityListenerFactory(new OAuthFactory()); $container->addCompilerPass(new SetResourc...
[ "public", "function", "build", "(", "ContainerBuilder", "$", "container", ")", "{", "parent", "::", "build", "(", "$", "container", ")", ";", "/** @var $extension SecurityExtension */", "$", "extension", "=", "$", "container", "->", "getExtension", "(", "'security...
{@inheritdoc}
[ "{" ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/HWIOAuthBundle.php#L30-L39
hwi/HWIOAuthBundle
OAuth/ResourceOwner/Office365ResourceOwner.php
Office365ResourceOwner.getAccessToken
public function getAccessToken(Request $request, $redirectUri, array $extraParameters = []) { $extraParameters = array_merge([ 'resource' => 'https://graph.microsoft.com', ], $extraParameters); return parent::getAccessToken($request, $redirectUri, $extraParameters); }
php
public function getAccessToken(Request $request, $redirectUri, array $extraParameters = []) { $extraParameters = array_merge([ 'resource' => 'https://graph.microsoft.com', ], $extraParameters); return parent::getAccessToken($request, $redirectUri, $extraParameters); }
[ "public", "function", "getAccessToken", "(", "Request", "$", "request", ",", "$", "redirectUri", ",", "array", "$", "extraParameters", "=", "[", "]", ")", "{", "$", "extraParameters", "=", "array_merge", "(", "[", "'resource'", "=>", "'https://graph.microsoft.co...
{@inheritdoc}
[ "{" ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/OAuth/ResourceOwner/Office365ResourceOwner.php#L33-L40
hwi/HWIOAuthBundle
Security/Core/Exception/AccountNotLinkedException.php
AccountNotLinkedException.unserialize
public function unserialize($str) { list( $this->resourceOwnerName, $parentData ) = unserialize($str); parent::unserialize($parentData); }
php
public function unserialize($str) { list( $this->resourceOwnerName, $parentData ) = unserialize($str); parent::unserialize($parentData); }
[ "public", "function", "unserialize", "(", "$", "str", ")", "{", "list", "(", "$", "this", "->", "resourceOwnerName", ",", "$", "parentData", ")", "=", "unserialize", "(", "$", "str", ")", ";", "parent", "::", "unserialize", "(", "$", "parentData", ")", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/Security/Core/Exception/AccountNotLinkedException.php#L101-L109
hwi/HWIOAuthBundle
OAuth/ResourceOwner/InstagramResourceOwner.php
InstagramResourceOwner.doGetUserInformationRequest
protected function doGetUserInformationRequest($url, array $parameters = []) { return $this->httpRequest($this->normalizeUrl($url, $parameters), null, [], 'GET'); }
php
protected function doGetUserInformationRequest($url, array $parameters = []) { return $this->httpRequest($this->normalizeUrl($url, $parameters), null, [], 'GET'); }
[ "protected", "function", "doGetUserInformationRequest", "(", "$", "url", ",", "array", "$", "parameters", "=", "[", "]", ")", "{", "return", "$", "this", "->", "httpRequest", "(", "$", "this", "->", "normalizeUrl", "(", "$", "url", ",", "$", "parameters", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/OAuth/ResourceOwner/InstagramResourceOwner.php#L36-L39
hwi/HWIOAuthBundle
Security/Http/ResourceOwnerMap.php
ResourceOwnerMap.getResourceOwnerByName
public function getResourceOwnerByName($name) { if (!$this->hasResourceOwnerByName($name)) { return null; } return $this->container->get('hwi_oauth.resource_owner.'.$name); }
php
public function getResourceOwnerByName($name) { if (!$this->hasResourceOwnerByName($name)) { return null; } return $this->container->get('hwi_oauth.resource_owner.'.$name); }
[ "public", "function", "getResourceOwnerByName", "(", "$", "name", ")", "{", "if", "(", "!", "$", "this", "->", "hasResourceOwnerByName", "(", "$", "name", ")", ")", "{", "return", "null", ";", "}", "return", "$", "this", "->", "container", "->", "get", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/Security/Http/ResourceOwnerMap.php#L80-L87
hwi/HWIOAuthBundle
Security/Http/ResourceOwnerMap.php
ResourceOwnerMap.getResourceOwnerByRequest
public function getResourceOwnerByRequest(Request $request) { foreach ($this->resourceOwners as $name => $checkPath) { if ($this->httpUtils->checkRequestPath($request, $checkPath)) { return [$this->getResourceOwnerByName($name), $checkPath]; } } retur...
php
public function getResourceOwnerByRequest(Request $request) { foreach ($this->resourceOwners as $name => $checkPath) { if ($this->httpUtils->checkRequestPath($request, $checkPath)) { return [$this->getResourceOwnerByName($name), $checkPath]; } } retur...
[ "public", "function", "getResourceOwnerByRequest", "(", "Request", "$", "request", ")", "{", "foreach", "(", "$", "this", "->", "resourceOwners", "as", "$", "name", "=>", "$", "checkPath", ")", "{", "if", "(", "$", "this", "->", "httpUtils", "->", "checkRe...
{@inheritdoc}
[ "{" ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/Security/Http/ResourceOwnerMap.php#L92-L101
hwi/HWIOAuthBundle
Security/Http/ResourceOwnerMap.php
ResourceOwnerMap.getResourceOwnerCheckPath
public function getResourceOwnerCheckPath($name) { if (isset($this->resourceOwners[$name])) { return $this->resourceOwners[$name]; } return null; }
php
public function getResourceOwnerCheckPath($name) { if (isset($this->resourceOwners[$name])) { return $this->resourceOwners[$name]; } return null; }
[ "public", "function", "getResourceOwnerCheckPath", "(", "$", "name", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "resourceOwners", "[", "$", "name", "]", ")", ")", "{", "return", "$", "this", "->", "resourceOwners", "[", "$", "name", "]", ";"...
{@inheritdoc}
[ "{" ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/Security/Http/ResourceOwnerMap.php#L106-L113
hwi/HWIOAuthBundle
DependencyInjection/HWIOAuthExtension.php
HWIOAuthExtension.load
public function load(array $configs, ContainerBuilder $container) { $loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config/')); $loader->load('http_client.xml'); $loader->load('oauth.xml'); $loader->load('templating.xml'); $loader->load('twig.xm...
php
public function load(array $configs, ContainerBuilder $container) { $loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config/')); $loader->load('http_client.xml'); $loader->load('oauth.xml'); $loader->load('templating.xml'); $loader->load('twig.xm...
[ "public", "function", "load", "(", "array", "$", "configs", ",", "ContainerBuilder", "$", "container", ")", "{", "$", "loader", "=", "new", "XmlFileLoader", "(", "$", "container", ",", "new", "FileLocator", "(", "__DIR__", ".", "'/../Resources/config/'", ")", ...
{@inheritdoc} @throws \Exception @throws \RuntimeException @throws InvalidConfigurationException @throws \Symfony\Component\DependencyInjection\Exception\BadMethodCallException @throws \Symfony\Component\DependencyInjection\Exception\InvalidArgumentException @throws \Symfony\Component\DependencyInjection\Exception\Out...
[ "{", "@inheritdoc", "}" ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/DependencyInjection/HWIOAuthExtension.php#L44-L94
hwi/HWIOAuthBundle
DependencyInjection/HWIOAuthExtension.php
HWIOAuthExtension.createResourceOwnerService
public function createResourceOwnerService(ContainerBuilder $container, $name, array $options) { $definitionClassname = $this->getDefinitionClassname(); // alias services if (isset($options['service'])) { // set the appropriate name for aliased services, compiler pass depends on...
php
public function createResourceOwnerService(ContainerBuilder $container, $name, array $options) { $definitionClassname = $this->getDefinitionClassname(); // alias services if (isset($options['service'])) { // set the appropriate name for aliased services, compiler pass depends on...
[ "public", "function", "createResourceOwnerService", "(", "ContainerBuilder", "$", "container", ",", "$", "name", ",", "array", "$", "options", ")", "{", "$", "definitionClassname", "=", "$", "this", "->", "getDefinitionClassname", "(", ")", ";", "// alias services...
Creates a resource owner service. @param ContainerBuilder $container The container builder @param string $name The name of the service @param array $options Additional options of the service @throws InvalidConfigurationException @throws \Symfony\Component\DependencyInjection\Exception\BadM...
[ "Creates", "a", "resource", "owner", "service", "." ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/DependencyInjection/HWIOAuthExtension.php#L107-L141
hwi/HWIOAuthBundle
DependencyInjection/HWIOAuthExtension.php
HWIOAuthExtension.createConnectIntegration
private function createConnectIntegration(ContainerBuilder $container, array $config) { $definitionClassname = $this->getDefinitionClassname(); if (isset($config['connect'])) { $container->setParameter('hwi_oauth.connect', true); if (isset($config['fosub'])) { ...
php
private function createConnectIntegration(ContainerBuilder $container, array $config) { $definitionClassname = $this->getDefinitionClassname(); if (isset($config['connect'])) { $container->setParameter('hwi_oauth.connect', true); if (isset($config['fosub'])) { ...
[ "private", "function", "createConnectIntegration", "(", "ContainerBuilder", "$", "container", ",", "array", "$", "config", ")", "{", "$", "definitionClassname", "=", "$", "this", "->", "getDefinitionClassname", "(", ")", ";", "if", "(", "isset", "(", "$", "con...
Check of the connect controllers etc should be enabled. @param ContainerBuilder $container @param array $config @throws \Symfony\Component\DependencyInjection\Exception\BadMethodCallException @throws \Symfony\Component\DependencyInjection\Exception\InvalidArgumentException
[ "Check", "of", "the", "connect", "controllers", "etc", "should", "be", "enabled", "." ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/DependencyInjection/HWIOAuthExtension.php#L185-L223