id int32 0 241k | repo stringlengths 6 63 | path stringlengths 5 140 | func_name stringlengths 3 151 | original_string stringlengths 84 13k | language stringclasses 1
value | code stringlengths 84 13k | code_tokens list | docstring stringlengths 3 47.2k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 91 247 |
|---|---|---|---|---|---|---|---|---|---|---|---|
16,400 | itgalaxy/bin-wrapper | src/BinWrapper.php | BinWrapper.binCheck | private function binCheck($bin, $args = ['--help'])
{
$isExecutable = is_executable($bin);
if (!$isExecutable) {
throw new \Exception(
'Couldn\'t execute the ' . $bin . ' binary. Make sure it has the right permissions.'
);
}
exec($bin . ' ' .... | php | private function binCheck($bin, $args = ['--help'])
{
$isExecutable = is_executable($bin);
if (!$isExecutable) {
throw new \Exception(
'Couldn\'t execute the ' . $bin . ' binary. Make sure it has the right permissions.'
);
}
exec($bin . ' ' .... | [
"private",
"function",
"binCheck",
"(",
"$",
"bin",
",",
"$",
"args",
"=",
"[",
"'--help'",
"]",
")",
"{",
"$",
"isExecutable",
"=",
"is_executable",
"(",
"$",
"bin",
")",
";",
"if",
"(",
"!",
"$",
"isExecutable",
")",
"{",
"throw",
"new",
"\\",
"E... | Todo move to separatly repository | [
"Todo",
"move",
"to",
"separatly",
"repository"
] | f4217cb6a1ae5a2abea180255ba14ef264118d43 | https://github.com/itgalaxy/bin-wrapper/blob/f4217cb6a1ae5a2abea180255ba14ef264118d43/src/BinWrapper.php#L198-L215 |
16,401 | hollodotme/TreeMDown | src/FileSystem/Tree.php | Tree.getLeafObject | public function getLeafObject( string $filepath ) : Leaf
{
$leafObject = new $this->leafObjectClass( $this->search, $filepath );
if ( $leafObject instanceof Leaf )
{
return $leafObject;
}
throw new \RuntimeException( sprintf( '%s is not a subclass of %s\\Leaf', $this->leafObjectClass, __NAMESPACE__ ) );... | php | public function getLeafObject( string $filepath ) : Leaf
{
$leafObject = new $this->leafObjectClass( $this->search, $filepath );
if ( $leafObject instanceof Leaf )
{
return $leafObject;
}
throw new \RuntimeException( sprintf( '%s is not a subclass of %s\\Leaf', $this->leafObjectClass, __NAMESPACE__ ) );... | [
"public",
"function",
"getLeafObject",
"(",
"string",
"$",
"filepath",
")",
":",
"Leaf",
"{",
"$",
"leafObject",
"=",
"new",
"$",
"this",
"->",
"leafObjectClass",
"(",
"$",
"this",
"->",
"search",
",",
"$",
"filepath",
")",
";",
"if",
"(",
"$",
"leafOb... | Return a new leaf object
@param string $filepath
@throws \RuntimeException
@return Leaf | [
"Return",
"a",
"new",
"leaf",
"object"
] | 462c4118c70b68963e0176d540fc8502730ffe27 | https://github.com/hollodotme/TreeMDown/blob/462c4118c70b68963e0176d540fc8502730ffe27/src/FileSystem/Tree.php#L197-L207 |
16,402 | BugBuster1701/banner | classes/BannerImage.php | BannerImage.getBannerImageSize | public function getBannerImageSize($BannerImage,$BannerType)
{
switch ($BannerType)
{
case self::BANNER_TYPE_INTERN :
return $this->getImageSizeInternal($BannerImage);
break;
case self::BANNER_TYPE_EXTERN :
return $this->getImageSizeExternal($BannerImage);
break;
case self::BANNER_TYPE_TEX... | php | public function getBannerImageSize($BannerImage,$BannerType)
{
switch ($BannerType)
{
case self::BANNER_TYPE_INTERN :
return $this->getImageSizeInternal($BannerImage);
break;
case self::BANNER_TYPE_EXTERN :
return $this->getImageSizeExternal($BannerImage);
break;
case self::BANNER_TYPE_TEX... | [
"public",
"function",
"getBannerImageSize",
"(",
"$",
"BannerImage",
",",
"$",
"BannerType",
")",
"{",
"switch",
"(",
"$",
"BannerType",
")",
"{",
"case",
"self",
"::",
"BANNER_TYPE_INTERN",
":",
"return",
"$",
"this",
"->",
"getImageSizeInternal",
"(",
"$",
... | Get the size of an image
@param string $BannerImage Image path/link
@param string $BannerType intern,extern,text
@return mixed $array / false | [
"Get",
"the",
"size",
"of",
"an",
"image"
] | 3ffac36837923194ab0ebaf308c0b23a3684b005 | https://github.com/BugBuster1701/banner/blob/3ffac36837923194ab0ebaf308c0b23a3684b005/classes/BannerImage.php#L85-L102 |
16,403 | BugBuster1701/banner | classes/BannerImage.php | BannerImage.getImageSizeInternal | protected function getImageSizeInternal($BannerImage)
{
try
{
$arrImageSize = getimagesize(TL_ROOT . '/' . $BannerImage);
}
catch (\Exception $e)
{
$arrImageSize = false;
}
if ($arrImageSize === false)
{
//Workaround for PHP without zlib on SWC files
... | php | protected function getImageSizeInternal($BannerImage)
{
try
{
$arrImageSize = getimagesize(TL_ROOT . '/' . $BannerImage);
}
catch (\Exception $e)
{
$arrImageSize = false;
}
if ($arrImageSize === false)
{
//Workaround for PHP without zlib on SWC files
... | [
"protected",
"function",
"getImageSizeInternal",
"(",
"$",
"BannerImage",
")",
"{",
"try",
"{",
"$",
"arrImageSize",
"=",
"getimagesize",
"(",
"TL_ROOT",
".",
"'/'",
".",
"$",
"BannerImage",
")",
";",
"}",
"catch",
"(",
"\\",
"Exception",
"$",
"e",
")",
... | Get the size of an internal image
@param string $BannerImage Image path
@return mixed $array / false | [
"Get",
"the",
"size",
"of",
"an",
"internal",
"image"
] | 3ffac36837923194ab0ebaf308c0b23a3684b005 | https://github.com/BugBuster1701/banner/blob/3ffac36837923194ab0ebaf308c0b23a3684b005/classes/BannerImage.php#L110-L129 |
16,404 | BugBuster1701/banner | classes/BannerImage.php | BannerImage.getImageSizeExternal | protected function getImageSizeExternal($BannerImage)
{
$token = md5(uniqid(rand(), true));
$tmpImage = 'system/tmp/mod_banner_fe_'.$token.'.tmp';
// HOOK: proxy module
if ( \Config::get('useProxy')
&& in_array('proxy', \ModuleLoader::getActive())
)
{
$objRequest = new \ProxyReques... | php | protected function getImageSizeExternal($BannerImage)
{
$token = md5(uniqid(rand(), true));
$tmpImage = 'system/tmp/mod_banner_fe_'.$token.'.tmp';
// HOOK: proxy module
if ( \Config::get('useProxy')
&& in_array('proxy', \ModuleLoader::getActive())
)
{
$objRequest = new \ProxyReques... | [
"protected",
"function",
"getImageSizeExternal",
"(",
"$",
"BannerImage",
")",
"{",
"$",
"token",
"=",
"md5",
"(",
"uniqid",
"(",
"rand",
"(",
")",
",",
"true",
")",
")",
";",
"$",
"tmpImage",
"=",
"'system/tmp/mod_banner_fe_'",
".",
"$",
"token",
".",
"... | Get the size of an external image
@param string $BannerImage Image link
@return mixed $array / false | [
"Get",
"the",
"size",
"of",
"an",
"external",
"image"
] | 3ffac36837923194ab0ebaf308c0b23a3684b005 | https://github.com/BugBuster1701/banner/blob/3ffac36837923194ab0ebaf308c0b23a3684b005/classes/BannerImage.php#L137-L190 |
16,405 | BugBuster1701/banner | classes/BannerImage.php | BannerImage.getImageSizeCompressed | protected function getImageSizeCompressed($BannerImage)
{
$arrImageSize = false;
$res = $this->uncompressSwcData($BannerImage);
if ($res)
{
// width,height
$arrImageSize = array($res[0], $res[1], 13); // 13 = SWC
}
ModuleBannerLog::writeLog(__METHOD__ , __LINE__ , 'Image Size: '. print_r($arrImageSi... | php | protected function getImageSizeCompressed($BannerImage)
{
$arrImageSize = false;
$res = $this->uncompressSwcData($BannerImage);
if ($res)
{
// width,height
$arrImageSize = array($res[0], $res[1], 13); // 13 = SWC
}
ModuleBannerLog::writeLog(__METHOD__ , __LINE__ , 'Image Size: '. print_r($arrImageSi... | [
"protected",
"function",
"getImageSizeCompressed",
"(",
"$",
"BannerImage",
")",
"{",
"$",
"arrImageSize",
"=",
"false",
";",
"$",
"res",
"=",
"$",
"this",
"->",
"uncompressSwcData",
"(",
"$",
"BannerImage",
")",
";",
"if",
"(",
"$",
"res",
")",
"{",
"//... | getimagesize without zlib doesn't work
workaround for this
@param string $BannerImage Image
@return mixed $array / false | [
"getimagesize",
"without",
"zlib",
"doesn",
"t",
"work",
"workaround",
"for",
"this"
] | 3ffac36837923194ab0ebaf308c0b23a3684b005 | https://github.com/BugBuster1701/banner/blob/3ffac36837923194ab0ebaf308c0b23a3684b005/classes/BannerImage.php#L199-L211 |
16,406 | BugBuster1701/banner | classes/BannerImage.php | BannerImage.getBannerImageSizeNew | public function getBannerImageSizeNew($oldWidth,$oldHeight,$newWidth=0,$newHeight=0)
{
$Width = $oldWidth; //Default, and flash require this
$Height = $oldHeight; //Default, and flash require this
$oriSize = true; //Attribute for images without conversion
if ($newWidth > 0 && $newHeight > 0)
{
... | php | public function getBannerImageSizeNew($oldWidth,$oldHeight,$newWidth=0,$newHeight=0)
{
$Width = $oldWidth; //Default, and flash require this
$Height = $oldHeight; //Default, and flash require this
$oriSize = true; //Attribute for images without conversion
if ($newWidth > 0 && $newHeight > 0)
{
... | [
"public",
"function",
"getBannerImageSizeNew",
"(",
"$",
"oldWidth",
",",
"$",
"oldHeight",
",",
"$",
"newWidth",
"=",
"0",
",",
"$",
"newHeight",
"=",
"0",
")",
"{",
"$",
"Width",
"=",
"$",
"oldWidth",
";",
"//Default, and flash require this",
"$",
"Height"... | Calculate the new size for witdh and height
@param int $oldWidth ,mandatory
@param int $oldHeight ,mandatory
@param int $newWidth ,optional
@param int $newHeight ,optional
@return array $Width,$Height,$oriSize | [
"Calculate",
"the",
"new",
"size",
"for",
"witdh",
"and",
"height"
] | 3ffac36837923194ab0ebaf308c0b23a3684b005 | https://github.com/BugBuster1701/banner/blob/3ffac36837923194ab0ebaf308c0b23a3684b005/classes/BannerImage.php#L323-L348 |
16,407 | BugBuster1701/banner | classes/BannerImage.php | BannerImage.getCheckBannerImageSize | public function getCheckBannerImageSize($arrImageSize, $maxWidth, $maxHeight)
{
//$arrImageSize[0] Breite (max 250px in BE)
//$arrImageSize[1] Hoehe (max 40px in BE)
//$arrImageSize[2] Type
if ($arrImageSize[0] > $arrImageSize[1]) // Breite > Hoehe = Landscape ==
{
if ($arrImageSize[0] > $maxWidth)
... | php | public function getCheckBannerImageSize($arrImageSize, $maxWidth, $maxHeight)
{
//$arrImageSize[0] Breite (max 250px in BE)
//$arrImageSize[1] Hoehe (max 40px in BE)
//$arrImageSize[2] Type
if ($arrImageSize[0] > $arrImageSize[1]) // Breite > Hoehe = Landscape ==
{
if ($arrImageSize[0] > $maxWidth)
... | [
"public",
"function",
"getCheckBannerImageSize",
"(",
"$",
"arrImageSize",
",",
"$",
"maxWidth",
",",
"$",
"maxHeight",
")",
"{",
"//$arrImageSize[0] Breite (max 250px in BE)",
"//$arrImageSize[1] Hoehe (max 40px in BE)",
"//$arrImageSize[2] Type",
"if",
"(",
"$",
"arrImage... | Calculate the new size if necessary by comparing with maxWidth and maxHeight
@param array $arrImageSize
@param int $maxWidth
@param int $maxHeight
@return array $Width,$Height,$oriSize | [
"Calculate",
"the",
"new",
"size",
"if",
"necessary",
"by",
"comparing",
"with",
"maxWidth",
"and",
"maxHeight"
] | 3ffac36837923194ab0ebaf308c0b23a3684b005 | https://github.com/BugBuster1701/banner/blob/3ffac36837923194ab0ebaf308c0b23a3684b005/classes/BannerImage.php#L358-L408 |
16,408 | BugBuster1701/banner | classes/BannerImage.php | BannerImage.getCheckBannerImageFallback | public function getCheckBannerImageFallback($BannerImage, $intWidth, $intHeight)
{
$fallback_content = false;
$path_parts = pathinfo($BannerImage);
if ( is_file(TL_ROOT . '/' . $path_parts['dirname'] . '/' . $path_parts['filename'].'.jpg') )
{
$fallback_ext = '.jpg';
$fallback_content = tru... | php | public function getCheckBannerImageFallback($BannerImage, $intWidth, $intHeight)
{
$fallback_content = false;
$path_parts = pathinfo($BannerImage);
if ( is_file(TL_ROOT . '/' . $path_parts['dirname'] . '/' . $path_parts['filename'].'.jpg') )
{
$fallback_ext = '.jpg';
$fallback_content = tru... | [
"public",
"function",
"getCheckBannerImageFallback",
"(",
"$",
"BannerImage",
",",
"$",
"intWidth",
",",
"$",
"intHeight",
")",
"{",
"$",
"fallback_content",
"=",
"false",
";",
"$",
"path_parts",
"=",
"pathinfo",
"(",
"$",
"BannerImage",
")",
";",
"if",
"(",... | Search and get a flash fallback image path if exists
@param string $BannerImage Image path (flash file)
@param int $maxWidth Flash file width
@param int $maxHeight Flash file height
@return mixed $string/false Fallback image path / false | [
"Search",
"and",
"get",
"a",
"flash",
"fallback",
"image",
"path",
"if",
"exists"
] | 3ffac36837923194ab0ebaf308c0b23a3684b005 | https://github.com/BugBuster1701/banner/blob/3ffac36837923194ab0ebaf308c0b23a3684b005/classes/BannerImage.php#L418-L448 |
16,409 | readdle/fqdb | src/Readdle/Database/FQDBProvider.php | FQDBProvider.defaultFQDB | public static function defaultFQDB() {
if (self::$defaultFQDB)
return self::$defaultFQDB;
if (is_callable(self::$FQDBCreatorCallback))
return self::setDefaultFQDB(call_user_func(self::$FQDBCreatorCallback));
} | php | public static function defaultFQDB() {
if (self::$defaultFQDB)
return self::$defaultFQDB;
if (is_callable(self::$FQDBCreatorCallback))
return self::setDefaultFQDB(call_user_func(self::$FQDBCreatorCallback));
} | [
"public",
"static",
"function",
"defaultFQDB",
"(",
")",
"{",
"if",
"(",
"self",
"::",
"$",
"defaultFQDB",
")",
"return",
"self",
"::",
"$",
"defaultFQDB",
";",
"if",
"(",
"is_callable",
"(",
"self",
"::",
"$",
"FQDBCreatorCallback",
")",
")",
"return",
... | returns default FQDB
@return \Readdle\Database\FQDB | [
"returns",
"default",
"FQDB"
] | 4ef2e8f3343a7c8fbb309c243be502a160c42083 | https://github.com/readdle/fqdb/blob/4ef2e8f3343a7c8fbb309c243be502a160c42083/src/Readdle/Database/FQDBProvider.php#L128-L134 |
16,410 | VDMi/Guzzle-oAuth | src/GuzzleOauth/Consumer/Google.php | Google.getUserEmail | public function getUserEmail($info = NULL) {
if (empty($info)) {
$info = $this->getUserInfo();
}
$emails = $info->get('emails');
if (is_array($emails) && count($emails)) {
$email = reset($emails);
return $email['value'];
}
} | php | public function getUserEmail($info = NULL) {
if (empty($info)) {
$info = $this->getUserInfo();
}
$emails = $info->get('emails');
if (is_array($emails) && count($emails)) {
$email = reset($emails);
return $email['value'];
}
} | [
"public",
"function",
"getUserEmail",
"(",
"$",
"info",
"=",
"NULL",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"info",
")",
")",
"{",
"$",
"info",
"=",
"$",
"this",
"->",
"getUserInfo",
"(",
")",
";",
"}",
"$",
"emails",
"=",
"$",
"info",
"->",
"... | Google can return an array of emails.
We only give back the first one, since we request one e-mail address | [
"Google",
"can",
"return",
"an",
"array",
"of",
"emails",
".",
"We",
"only",
"give",
"back",
"the",
"first",
"one",
"since",
"we",
"request",
"one",
"e",
"-",
"mail",
"address"
] | e2b2561e4e402e13ba605082bf768b29942f90cb | https://github.com/VDMi/Guzzle-oAuth/blob/e2b2561e4e402e13ba605082bf768b29942f90cb/src/GuzzleOauth/Consumer/Google.php#L13-L22 |
16,411 | gdbots/pbjx-bundle-php | src/PbjxTokenSigner.php | PbjxTokenSigner.sign | public function sign(string $content, string $aud, ?string $kid = null): PbjxToken
{
$kid = $kid ?: $this->defaultKid;
return PbjxToken::create($content, $aud, $kid, $this->getSecret($kid));
} | php | public function sign(string $content, string $aud, ?string $kid = null): PbjxToken
{
$kid = $kid ?: $this->defaultKid;
return PbjxToken::create($content, $aud, $kid, $this->getSecret($kid));
} | [
"public",
"function",
"sign",
"(",
"string",
"$",
"content",
",",
"string",
"$",
"aud",
",",
"?",
"string",
"$",
"kid",
"=",
"null",
")",
":",
"PbjxToken",
"{",
"$",
"kid",
"=",
"$",
"kid",
"?",
":",
"$",
"this",
"->",
"defaultKid",
";",
"return",
... | Creates a new signed token for the provided content.
@param string $content Pbjx content that is being signed
@param string $aud Pbjx endpoint this token will be sent to
@param string $kid Key ID to use to sign the token.
@return PbjxToken | [
"Creates",
"a",
"new",
"signed",
"token",
"for",
"the",
"provided",
"content",
"."
] | f3c0088583879fc92f13247a0752634bd8696eac | https://github.com/gdbots/pbjx-bundle-php/blob/f3c0088583879fc92f13247a0752634bd8696eac/src/PbjxTokenSigner.php#L71-L75 |
16,412 | gdbots/pbjx-bundle-php | src/PbjxTokenSigner.php | PbjxTokenSigner.validate | public function validate(string $content, string $aud, string $token): void
{
$actualToken = PbjxToken::fromString($token);
$expectedToken = PbjxToken::create(
$content,
$aud,
$actualToken->getKid(),
$this->getSecret($actualToken->getKid()),
... | php | public function validate(string $content, string $aud, string $token): void
{
$actualToken = PbjxToken::fromString($token);
$expectedToken = PbjxToken::create(
$content,
$aud,
$actualToken->getKid(),
$this->getSecret($actualToken->getKid()),
... | [
"public",
"function",
"validate",
"(",
"string",
"$",
"content",
",",
"string",
"$",
"aud",
",",
"string",
"$",
"token",
")",
":",
"void",
"{",
"$",
"actualToken",
"=",
"PbjxToken",
"::",
"fromString",
"(",
"$",
"token",
")",
";",
"$",
"expectedToken",
... | Validates that the provided token is valid and okay to use
and also creates a new token with the same secret and content
and compares our result to the provided token to determine
if they are an exact match.
If no exception is thrown the token is valid.
@param string $content Pbjx content that has been signed
@param ... | [
"Validates",
"that",
"the",
"provided",
"token",
"is",
"valid",
"and",
"okay",
"to",
"use",
"and",
"also",
"creates",
"a",
"new",
"token",
"with",
"the",
"same",
"secret",
"and",
"content",
"and",
"compares",
"our",
"result",
"to",
"the",
"provided",
"toke... | f3c0088583879fc92f13247a0752634bd8696eac | https://github.com/gdbots/pbjx-bundle-php/blob/f3c0088583879fc92f13247a0752634bd8696eac/src/PbjxTokenSigner.php#L91-L108 |
16,413 | axelitus/php-base | src/Str.php | Str.beginsWith | public static function beginsWith($input, $search, $caseInsensitive = false, $encoding = self::DEFAULT_ENCODING)
{
$substr = static::sub($input, 0, static::length($search), $encoding);
return (static::compare($substr, $search, $caseInsensitive) === 0);
} | php | public static function beginsWith($input, $search, $caseInsensitive = false, $encoding = self::DEFAULT_ENCODING)
{
$substr = static::sub($input, 0, static::length($search), $encoding);
return (static::compare($substr, $search, $caseInsensitive) === 0);
} | [
"public",
"static",
"function",
"beginsWith",
"(",
"$",
"input",
",",
"$",
"search",
",",
"$",
"caseInsensitive",
"=",
"false",
",",
"$",
"encoding",
"=",
"self",
"::",
"DEFAULT_ENCODING",
")",
"{",
"$",
"substr",
"=",
"static",
"::",
"sub",
"(",
"$",
... | Verifies if a string begins with a substring.
Uses the multibyte function if available with the given encoding $encoding.
The comparison is case-sensitive by default.
@param string $input The input string to compare to.
@param string $search The substring to compare the beginning to.
@param bool ... | [
"Verifies",
"if",
"a",
"string",
"begins",
"with",
"a",
"substring",
"."
] | c2da680c1f0c3ee93ae6a8be5adaacd0caf7d075 | https://github.com/axelitus/php-base/blob/c2da680c1f0c3ee93ae6a8be5adaacd0caf7d075/src/Str.php#L198-L203 |
16,414 | axelitus/php-base | src/Str.php | Str.endsWith | public static function endsWith($input, $search, $caseInsensitive = false, $encoding = self::DEFAULT_ENCODING)
{
if (($length = static::length($search, $encoding)) == 0) {
return true;
}
$substr = static::sub($input, -$length, $length, $encoding);
return (static::compar... | php | public static function endsWith($input, $search, $caseInsensitive = false, $encoding = self::DEFAULT_ENCODING)
{
if (($length = static::length($search, $encoding)) == 0) {
return true;
}
$substr = static::sub($input, -$length, $length, $encoding);
return (static::compar... | [
"public",
"static",
"function",
"endsWith",
"(",
"$",
"input",
",",
"$",
"search",
",",
"$",
"caseInsensitive",
"=",
"false",
",",
"$",
"encoding",
"=",
"self",
"::",
"DEFAULT_ENCODING",
")",
"{",
"if",
"(",
"(",
"$",
"length",
"=",
"static",
"::",
"le... | Verifies if a string ends with a substring.
Uses the multibyte function if available with the given encoding $encoding.
The comparison is case-sensitive by default.
@param string $input The input string to compare to.
@param string $search The substring to compare the ending to.
@param bool $case... | [
"Verifies",
"if",
"a",
"string",
"ends",
"with",
"a",
"substring",
"."
] | c2da680c1f0c3ee93ae6a8be5adaacd0caf7d075 | https://github.com/axelitus/php-base/blob/c2da680c1f0c3ee93ae6a8be5adaacd0caf7d075/src/Str.php#L219-L228 |
16,415 | axelitus/php-base | src/Str.php | Str.isOneOf | public static function isOneOf($input, array $values, $caseInsensitive = false, $returnIndex = false)
{
if (is_null($input)) {
return false;
}
foreach ($values as $index => $str) {
if (static::equals($input, $str, $caseInsensitive)) {
return ($returnI... | php | public static function isOneOf($input, array $values, $caseInsensitive = false, $returnIndex = false)
{
if (is_null($input)) {
return false;
}
foreach ($values as $index => $str) {
if (static::equals($input, $str, $caseInsensitive)) {
return ($returnI... | [
"public",
"static",
"function",
"isOneOf",
"(",
"$",
"input",
",",
"array",
"$",
"values",
",",
"$",
"caseInsensitive",
"=",
"false",
",",
"$",
"returnIndex",
"=",
"false",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"input",
")",
")",
"{",
"return",
"... | Verifies if the input string is one of the values of the given array.
Verifies if the input string is one of the values of the given array. Each of the values
of the array is matched against the input string. The index of the value that matched can
be returned instead of the default bool value. The comparison can be c... | [
"Verifies",
"if",
"the",
"input",
"string",
"is",
"one",
"of",
"the",
"values",
"of",
"the",
"given",
"array",
"."
] | c2da680c1f0c3ee93ae6a8be5adaacd0caf7d075 | https://github.com/axelitus/php-base/blob/c2da680c1f0c3ee93ae6a8be5adaacd0caf7d075/src/Str.php#L246-L259 |
16,416 | axelitus/php-base | src/Str.php | Str.match | public static function match($input, $pattern, array &$matches = null, $flags = 0, $offset = 0)
{
return preg_match($pattern, $input, $matches, $flags, $offset);
} | php | public static function match($input, $pattern, array &$matches = null, $flags = 0, $offset = 0)
{
return preg_match($pattern, $input, $matches, $flags, $offset);
} | [
"public",
"static",
"function",
"match",
"(",
"$",
"input",
",",
"$",
"pattern",
",",
"array",
"&",
"$",
"matches",
"=",
"null",
",",
"$",
"flags",
"=",
"0",
",",
"$",
"offset",
"=",
"0",
")",
"{",
"return",
"preg_match",
"(",
"$",
"pattern",
",",
... | Searches the input string for a match to the regular expression given in pattern.
@param string $input The input string.
@param string $pattern The pattern to search for, as a string.
@param array $matches If matches is provided, then it is filled with the results of search.
$matches[0] will contain the text that m... | [
"Searches",
"the",
"input",
"string",
"for",
"a",
"match",
"to",
"the",
"regular",
"expression",
"given",
"in",
"pattern",
"."
] | c2da680c1f0c3ee93ae6a8be5adaacd0caf7d075 | https://github.com/axelitus/php-base/blob/c2da680c1f0c3ee93ae6a8be5adaacd0caf7d075/src/Str.php#L276-L279 |
16,417 | axelitus/php-base | src/Str.php | Str.length | public static function length($input, $encoding = self::DEFAULT_ENCODING)
{
return function_exists('mb_strlen') ? mb_strlen($input, $encoding) : strlen($input);
} | php | public static function length($input, $encoding = self::DEFAULT_ENCODING)
{
return function_exists('mb_strlen') ? mb_strlen($input, $encoding) : strlen($input);
} | [
"public",
"static",
"function",
"length",
"(",
"$",
"input",
",",
"$",
"encoding",
"=",
"self",
"::",
"DEFAULT_ENCODING",
")",
"{",
"return",
"function_exists",
"(",
"'mb_strlen'",
")",
"?",
"mb_strlen",
"(",
"$",
"input",
",",
"$",
"encoding",
")",
":",
... | Gets the length of the given string.
Uses the multibyte function if available with the given encoding $encoding.
@author FuelPHP (http://fuelphp.com)
@param string $input The input string.
@param string $encoding The encoding of the input string for multibyte functions.
@return int Returns the length of the str... | [
"Gets",
"the",
"length",
"of",
"the",
"given",
"string",
"."
] | c2da680c1f0c3ee93ae6a8be5adaacd0caf7d075 | https://github.com/axelitus/php-base/blob/c2da680c1f0c3ee93ae6a8be5adaacd0caf7d075/src/Str.php#L297-L300 |
16,418 | axelitus/php-base | src/Str.php | Str.replace | public static function replace(
$input,
$search,
$replace,
$caseInsensitive = false,
$encoding = self::DEFAULT_ENCODING,
&$count = null
) {
return function_exists('mb_strlen')
? static::mbStrReplaceCaller($search, $replace, $input, $caseInsensitive... | php | public static function replace(
$input,
$search,
$replace,
$caseInsensitive = false,
$encoding = self::DEFAULT_ENCODING,
&$count = null
) {
return function_exists('mb_strlen')
? static::mbStrReplaceCaller($search, $replace, $input, $caseInsensitive... | [
"public",
"static",
"function",
"replace",
"(",
"$",
"input",
",",
"$",
"search",
",",
"$",
"replace",
",",
"$",
"caseInsensitive",
"=",
"false",
",",
"$",
"encoding",
"=",
"self",
"::",
"DEFAULT_ENCODING",
",",
"&",
"$",
"count",
"=",
"null",
")",
"{"... | Replaces a substring inside a string.
@param string $input The input string
@param string $search The substring to be replaced
@param string $replace The substring replacement
@param bool $caseInsensitive Whether the comparison should be case sensitive
@param string $encoding The en... | [
"Replaces",
"a",
"substring",
"inside",
"a",
"string",
"."
] | c2da680c1f0c3ee93ae6a8be5adaacd0caf7d075 | https://github.com/axelitus/php-base/blob/c2da680c1f0c3ee93ae6a8be5adaacd0caf7d075/src/Str.php#L380-L394 |
16,419 | axelitus/php-base | src/Str.php | Str.mbStrReplaceCaller | protected static function mbStrReplaceCaller(
$search,
$replace,
$subject,
$caseInsensitive = false,
$encoding = self::DEFAULT_ENCODING,
&$count = null
) {
if (is_array($subject)) {
$result = [];
foreach ($subject as $item) {
... | php | protected static function mbStrReplaceCaller(
$search,
$replace,
$subject,
$caseInsensitive = false,
$encoding = self::DEFAULT_ENCODING,
&$count = null
) {
if (is_array($subject)) {
$result = [];
foreach ($subject as $item) {
... | [
"protected",
"static",
"function",
"mbStrReplaceCaller",
"(",
"$",
"search",
",",
"$",
"replace",
",",
"$",
"subject",
",",
"$",
"caseInsensitive",
"=",
"false",
",",
"$",
"encoding",
"=",
"self",
"::",
"DEFAULT_ENCODING",
",",
"&",
"$",
"count",
"=",
"nul... | Replaces a substring inside a string with multi-byte support
@param string|array $search
@param string|array $replace
@param string|array $subject
@param bool $caseInsensitive
@param string $encoding
@param int $count
@return array|string
@see https://github.com/faceleg/php-mb_str_replace
@... | [
"Replaces",
"a",
"substring",
"inside",
"a",
"string",
"with",
"multi",
"-",
"byte",
"support"
] | c2da680c1f0c3ee93ae6a8be5adaacd0caf7d075 | https://github.com/axelitus/php-base/blob/c2da680c1f0c3ee93ae6a8be5adaacd0caf7d075/src/Str.php#L410-L444 |
16,420 | axelitus/php-base | src/Str.php | Str.mbStrReplaceInternal | protected static function mbStrReplaceInternal(
$search,
$replace,
$subject,
$caseInsensitive = false,
$encoding = self::DEFAULT_ENCODING,
&$count = null
) {
$searchLength = mb_strlen($search, $encoding);
$subjectLength = mb_strlen($subject, $encoding)... | php | protected static function mbStrReplaceInternal(
$search,
$replace,
$subject,
$caseInsensitive = false,
$encoding = self::DEFAULT_ENCODING,
&$count = null
) {
$searchLength = mb_strlen($search, $encoding);
$subjectLength = mb_strlen($subject, $encoding)... | [
"protected",
"static",
"function",
"mbStrReplaceInternal",
"(",
"$",
"search",
",",
"$",
"replace",
",",
"$",
"subject",
",",
"$",
"caseInsensitive",
"=",
"false",
",",
"$",
"encoding",
"=",
"self",
"::",
"DEFAULT_ENCODING",
",",
"&",
"$",
"count",
"=",
"n... | Implementation of mb_str_replace. Do not call directly.
@param string|array $search
@param string|array $replace
@param string|array $subject
@param bool $caseInsensitive
@param string $encoding
@param int $count
@return string
@see https://github.com/faceleg/php-mb_str_replace
@SuppressWa... | [
"Implementation",
"of",
"mb_str_replace",
".",
"Do",
"not",
"call",
"directly",
"."
] | c2da680c1f0c3ee93ae6a8be5adaacd0caf7d075 | https://github.com/axelitus/php-base/blob/c2da680c1f0c3ee93ae6a8be5adaacd0caf7d075/src/Str.php#L460-L495 |
16,421 | axelitus/php-base | src/Str.php | Str.truncate | public static function truncate($input, $limit, $continuation = '...', $isHtml = false)
{
$offset = 0;
$tags = [];
if ($isHtml) {
$input = static::truncateHtml($input, $limit, $offset, $tags);
}
$newString = static::sub($input, 0, $limit = min(static::length($inp... | php | public static function truncate($input, $limit, $continuation = '...', $isHtml = false)
{
$offset = 0;
$tags = [];
if ($isHtml) {
$input = static::truncateHtml($input, $limit, $offset, $tags);
}
$newString = static::sub($input, 0, $limit = min(static::length($inp... | [
"public",
"static",
"function",
"truncate",
"(",
"$",
"input",
",",
"$",
"limit",
",",
"$",
"continuation",
"=",
"'...'",
",",
"$",
"isHtml",
"=",
"false",
")",
"{",
"$",
"offset",
"=",
"0",
";",
"$",
"tags",
"=",
"[",
"]",
";",
"if",
"(",
"$",
... | Truncates a string to the given length.
Truncates a string to the given length. It will optionally preserve HTML tags if $is_html is set to true.
@author FuelPHP (http://fuelphp.com)
@param string $input The string to truncate.
@param int $limit The number of characters to truncate to.
@param ... | [
"Truncates",
"a",
"string",
"to",
"the",
"given",
"length",
"."
] | c2da680c1f0c3ee93ae6a8be5adaacd0caf7d075 | https://github.com/axelitus/php-base/blob/c2da680c1f0c3ee93ae6a8be5adaacd0caf7d075/src/Str.php#L512-L525 |
16,422 | axelitus/php-base | src/Str.php | Str.lower | public static function lower($input, $encoding = self::DEFAULT_ENCODING)
{
return function_exists('mb_strtolower')
? mb_strtolower($input, $encoding)
: strtolower($input);
} | php | public static function lower($input, $encoding = self::DEFAULT_ENCODING)
{
return function_exists('mb_strtolower')
? mb_strtolower($input, $encoding)
: strtolower($input);
} | [
"public",
"static",
"function",
"lower",
"(",
"$",
"input",
",",
"$",
"encoding",
"=",
"self",
"::",
"DEFAULT_ENCODING",
")",
"{",
"return",
"function_exists",
"(",
"'mb_strtolower'",
")",
"?",
"mb_strtolower",
"(",
"$",
"input",
",",
"$",
"encoding",
")",
... | Returns a lowercased string.
Returns a lowercased string. The $encoding parameter is used to determine the input string encoding
and thus use the proper method. The functions uses mb_strtolower if present and falls back to strtolower.
@author FuelPHP (http://fuelphp.com)
@param string $input The input string
@par... | [
"Returns",
"a",
"lowercased",
"string",
"."
] | c2da680c1f0c3ee93ae6a8be5adaacd0caf7d075 | https://github.com/axelitus/php-base/blob/c2da680c1f0c3ee93ae6a8be5adaacd0caf7d075/src/Str.php#L600-L605 |
16,423 | axelitus/php-base | src/Str.php | Str.upper | public static function upper($input, $encoding = self::DEFAULT_ENCODING)
{
return function_exists('mb_strtoupper')
? mb_strtoupper($input, $encoding)
: strtoupper($input);
} | php | public static function upper($input, $encoding = self::DEFAULT_ENCODING)
{
return function_exists('mb_strtoupper')
? mb_strtoupper($input, $encoding)
: strtoupper($input);
} | [
"public",
"static",
"function",
"upper",
"(",
"$",
"input",
",",
"$",
"encoding",
"=",
"self",
"::",
"DEFAULT_ENCODING",
")",
"{",
"return",
"function_exists",
"(",
"'mb_strtoupper'",
")",
"?",
"mb_strtoupper",
"(",
"$",
"input",
",",
"$",
"encoding",
")",
... | Returns an uppercased string.
Returns an uppercased string. The $encoding parameter is used to determine the input string encoding
and thus use the proper method. The functions uses mb_strtoupper if present and falls back to strtoupper.
@author FuelPHP (http://fuelphp.com)
@param string $input The input string
@p... | [
"Returns",
"an",
"uppercased",
"string",
"."
] | c2da680c1f0c3ee93ae6a8be5adaacd0caf7d075 | https://github.com/axelitus/php-base/blob/c2da680c1f0c3ee93ae6a8be5adaacd0caf7d075/src/Str.php#L620-L625 |
16,424 | axelitus/php-base | src/Str.php | Str.lcfirst | public static function lcfirst($input, $encoding = self::DEFAULT_ENCODING)
{
return function_exists('mb_strtolower')
? mb_strtolower(mb_substr($input, 0, 1, $encoding), $encoding) .
mb_substr($input, 1, mb_strlen($input, $encoding), $encoding)
: lcfirst($input);
} | php | public static function lcfirst($input, $encoding = self::DEFAULT_ENCODING)
{
return function_exists('mb_strtolower')
? mb_strtolower(mb_substr($input, 0, 1, $encoding), $encoding) .
mb_substr($input, 1, mb_strlen($input, $encoding), $encoding)
: lcfirst($input);
} | [
"public",
"static",
"function",
"lcfirst",
"(",
"$",
"input",
",",
"$",
"encoding",
"=",
"self",
"::",
"DEFAULT_ENCODING",
")",
"{",
"return",
"function_exists",
"(",
"'mb_strtolower'",
")",
"?",
"mb_strtolower",
"(",
"mb_substr",
"(",
"$",
"input",
",",
"0"... | Returns a string with the first char as lowercase.
Returns a string with the first char as lowercase. The other characters in the string are left untouched.
The $encoding parameter is used to determine the input string encoding and thus use the proper method.
The function uses mb_strtolower, mb_mb_substr and mb_strlen... | [
"Returns",
"a",
"string",
"with",
"the",
"first",
"char",
"as",
"lowercase",
"."
] | c2da680c1f0c3ee93ae6a8be5adaacd0caf7d075 | https://github.com/axelitus/php-base/blob/c2da680c1f0c3ee93ae6a8be5adaacd0caf7d075/src/Str.php#L641-L647 |
16,425 | axelitus/php-base | src/Str.php | Str.ucfirst | public static function ucfirst($input, $encoding = self::DEFAULT_ENCODING)
{
return function_exists('mb_strtoupper')
? mb_strtoupper(mb_substr($input, 0, 1, $encoding), $encoding) .
mb_substr($input, 1, mb_strlen($input, $encoding), $encoding)
: ucfirst($input);
} | php | public static function ucfirst($input, $encoding = self::DEFAULT_ENCODING)
{
return function_exists('mb_strtoupper')
? mb_strtoupper(mb_substr($input, 0, 1, $encoding), $encoding) .
mb_substr($input, 1, mb_strlen($input, $encoding), $encoding)
: ucfirst($input);
} | [
"public",
"static",
"function",
"ucfirst",
"(",
"$",
"input",
",",
"$",
"encoding",
"=",
"self",
"::",
"DEFAULT_ENCODING",
")",
"{",
"return",
"function_exists",
"(",
"'mb_strtoupper'",
")",
"?",
"mb_strtoupper",
"(",
"mb_substr",
"(",
"$",
"input",
",",
"0"... | Returns a string with the first char as uppercase.
Returns a string with the first char as uppercase. The other characters in the string are left untouched.
The $encoding parameter is used to determine the input string encoding and thus use the proper method.
The function uses mb_strtoupper, mb_mb_substr and mb_strlen... | [
"Returns",
"a",
"string",
"with",
"the",
"first",
"char",
"as",
"uppercase",
"."
] | c2da680c1f0c3ee93ae6a8be5adaacd0caf7d075 | https://github.com/axelitus/php-base/blob/c2da680c1f0c3ee93ae6a8be5adaacd0caf7d075/src/Str.php#L663-L669 |
16,426 | axelitus/php-base | src/Str.php | Str.ucwords | public static function ucwords($input, $encoding = self::DEFAULT_ENCODING)
{
return function_exists('mb_convert_case')
? mb_convert_case($input, MB_CASE_TITLE, $encoding)
: ucwords(strtolower($input));
} | php | public static function ucwords($input, $encoding = self::DEFAULT_ENCODING)
{
return function_exists('mb_convert_case')
? mb_convert_case($input, MB_CASE_TITLE, $encoding)
: ucwords(strtolower($input));
} | [
"public",
"static",
"function",
"ucwords",
"(",
"$",
"input",
",",
"$",
"encoding",
"=",
"self",
"::",
"DEFAULT_ENCODING",
")",
"{",
"return",
"function_exists",
"(",
"'mb_convert_case'",
")",
"?",
"mb_convert_case",
"(",
"$",
"input",
",",
"MB_CASE_TITLE",
",... | Returns a string with the words capitalized.
Returns a string with the words capitalized. The $encoding parameter is used to determine the input string
encoding and thus use the proper method. The function uses mb_convert_case if present and falls back to ucwords.
The ucwords function normally does not lowercase the i... | [
"Returns",
"a",
"string",
"with",
"the",
"words",
"capitalized",
"."
] | c2da680c1f0c3ee93ae6a8be5adaacd0caf7d075 | https://github.com/axelitus/php-base/blob/c2da680c1f0c3ee93ae6a8be5adaacd0caf7d075/src/Str.php#L685-L690 |
16,427 | axelitus/php-base | src/Str.php | Str.studlyBuildPattern | protected static function studlyBuildPattern(array $separators)
{
$pattern = '';
foreach ($separators as $separator) {
$pattern .= '|' . preg_quote($separator);
}
$pattern = '/(^' . $pattern . ')(.)/';
return $pattern;
} | php | protected static function studlyBuildPattern(array $separators)
{
$pattern = '';
foreach ($separators as $separator) {
$pattern .= '|' . preg_quote($separator);
}
$pattern = '/(^' . $pattern . ')(.)/';
return $pattern;
} | [
"protected",
"static",
"function",
"studlyBuildPattern",
"(",
"array",
"$",
"separators",
")",
"{",
"$",
"pattern",
"=",
"''",
";",
"foreach",
"(",
"$",
"separators",
"as",
"$",
"separator",
")",
"{",
"$",
"pattern",
".=",
"'|'",
".",
"preg_quote",
"(",
... | Builds the studly patter with the given separators.
@param array $separators The array of separators to use.
@return string Returns the built studly pattern. | [
"Builds",
"the",
"studly",
"patter",
"with",
"the",
"given",
"separators",
"."
] | c2da680c1f0c3ee93ae6a8be5adaacd0caf7d075 | https://github.com/axelitus/php-base/blob/c2da680c1f0c3ee93ae6a8be5adaacd0caf7d075/src/Str.php#L740-L749 |
16,428 | axelitus/php-base | src/Str.php | Str.nsprintf | public static function nsprintf($format, array $args = [])
{
// Filter unnamed %s strings that should not be processed
$filterRegex = '/%s/';
$format = preg_replace($filterRegex, '#[:~s]#', $format);
// The pattern to match variables
$pattern = '/(?<=%)([a-zA-Z0-9_]\w*)(?=\$... | php | public static function nsprintf($format, array $args = [])
{
// Filter unnamed %s strings that should not be processed
$filterRegex = '/%s/';
$format = preg_replace($filterRegex, '#[:~s]#', $format);
// The pattern to match variables
$pattern = '/(?<=%)([a-zA-Z0-9_]\w*)(?=\$... | [
"public",
"static",
"function",
"nsprintf",
"(",
"$",
"format",
",",
"array",
"$",
"args",
"=",
"[",
"]",
")",
"{",
"// Filter unnamed %s strings that should not be processed",
"$",
"filterRegex",
"=",
"'/%s/'",
";",
"$",
"format",
"=",
"preg_replace",
"(",
"$",... | Function sprintf for named variables inside format.
Args are only used if found in the format.
Predefined tags (which can be overwritten passing them as args):
%cr$s -> \r
%lf$s -> \n
%crlf$s -> \r\n
%tab$s -> \t
This method is based on the work of Nate Bessette (www.twitter.com/frickenate)
@param string $format The... | [
"Function",
"sprintf",
"for",
"named",
"variables",
"inside",
"format",
"."
] | c2da680c1f0c3ee93ae6a8be5adaacd0caf7d075 | https://github.com/axelitus/php-base/blob/c2da680c1f0c3ee93ae6a8be5adaacd0caf7d075/src/Str.php#L872-L904 |
16,429 | ryanwachtl/silverstripe-foundation-forms | code/forms/FoundationSwitchField.php | FoundationSwitchField.getSource | public function getSource() {
if (is_array($this->source)) {
if (count($this->source) != 2) {
user_error('FoundationSwitchField::getSource(): accepts only 2 options', E_USER_ERROR);
}
return array_slice($this->source, 0, 2);
}
} | php | public function getSource() {
if (is_array($this->source)) {
if (count($this->source) != 2) {
user_error('FoundationSwitchField::getSource(): accepts only 2 options', E_USER_ERROR);
}
return array_slice($this->source, 0, 2);
}
} | [
"public",
"function",
"getSource",
"(",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"this",
"->",
"source",
")",
")",
"{",
"if",
"(",
"count",
"(",
"$",
"this",
"->",
"source",
")",
"!=",
"2",
")",
"{",
"user_error",
"(",
"'FoundationSwitchField::getSou... | Gets the first two items from source array, since SwitchField only works with two values.
@return array | [
"Gets",
"the",
"first",
"two",
"items",
"from",
"source",
"array",
"since",
"SwitchField",
"only",
"works",
"with",
"two",
"values",
"."
] | 9055449fcb895811187124d81e57b7c93948403f | https://github.com/ryanwachtl/silverstripe-foundation-forms/blob/9055449fcb895811187124d81e57b7c93948403f/code/forms/FoundationSwitchField.php#L26-L33 |
16,430 | gintonicweb/GintonicCMS | src/Shell/GintonicShell.php | GintonicShell.cleanup | public function cleanup()
{
Cache::clear(false, 'default');
Cache::clear(false, '_cake_model_');
Cache::clear(false, '_cake_core_');
$this->dispatchShell('orm_cache clear');
$this->dispatchShell('orm_cache build');
} | php | public function cleanup()
{
Cache::clear(false, 'default');
Cache::clear(false, '_cake_model_');
Cache::clear(false, '_cake_core_');
$this->dispatchShell('orm_cache clear');
$this->dispatchShell('orm_cache build');
} | [
"public",
"function",
"cleanup",
"(",
")",
"{",
"Cache",
"::",
"clear",
"(",
"false",
",",
"'default'",
")",
";",
"Cache",
"::",
"clear",
"(",
"false",
",",
"'_cake_model_'",
")",
";",
"Cache",
"::",
"clear",
"(",
"false",
",",
"'_cake_core_'",
")",
";... | Clears the cache
@return void | [
"Clears",
"the",
"cache"
] | b34445fecea56a7d432d0f3e2f988cde8ead746b | https://github.com/gintonicweb/GintonicCMS/blob/b34445fecea56a7d432d0f3e2f988cde8ead746b/src/Shell/GintonicShell.php#L42-L49 |
16,431 | gintonicweb/GintonicCMS | src/Shell/GintonicShell.php | GintonicShell.migrate | public function migrate($plugin = null)
{
$plugin = ($plugin === null)? '' : ' -p ' . $plugin;
$this->dispatchShell('migrations migrate' . $plugin);
} | php | public function migrate($plugin = null)
{
$plugin = ($plugin === null)? '' : ' -p ' . $plugin;
$this->dispatchShell('migrations migrate' . $plugin);
} | [
"public",
"function",
"migrate",
"(",
"$",
"plugin",
"=",
"null",
")",
"{",
"$",
"plugin",
"=",
"(",
"$",
"plugin",
"===",
"null",
")",
"?",
"''",
":",
"' -p '",
".",
"$",
"plugin",
";",
"$",
"this",
"->",
"dispatchShell",
"(",
"'migrations migrate'",
... | Run the migration, optionally for a plugin
@param string $plugin Plugin name (optional)
@return void | [
"Run",
"the",
"migration",
"optionally",
"for",
"a",
"plugin"
] | b34445fecea56a7d432d0f3e2f988cde8ead746b | https://github.com/gintonicweb/GintonicCMS/blob/b34445fecea56a7d432d0f3e2f988cde8ead746b/src/Shell/GintonicShell.php#L57-L61 |
16,432 | mayoturis/properties-ini | src/FileSaver.php | FileSaver.save | public function save($fileName, $values, $map = null) {
if ($map !== null) {
$output = $this->createOutputWithMap($values,$map);
} else {
$output = $this->createOutput($values);
}
$this->saveToFile($fileName, $output);
} | php | public function save($fileName, $values, $map = null) {
if ($map !== null) {
$output = $this->createOutputWithMap($values,$map);
} else {
$output = $this->createOutput($values);
}
$this->saveToFile($fileName, $output);
} | [
"public",
"function",
"save",
"(",
"$",
"fileName",
",",
"$",
"values",
",",
"$",
"map",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"map",
"!==",
"null",
")",
"{",
"$",
"output",
"=",
"$",
"this",
"->",
"createOutputWithMap",
"(",
"$",
"values",
",",
... | Writes configuration array to file
@param string $fileName File name
@param array $values Configuration values
@param array|null $map File map | [
"Writes",
"configuration",
"array",
"to",
"file"
] | 79d56d8174637b1124eb90a41ffa3dca4c4a4e93 | https://github.com/mayoturis/properties-ini/blob/79d56d8174637b1124eb90a41ffa3dca4c4a4e93/src/FileSaver.php#L24-L32 |
16,433 | mayoturis/properties-ini | src/FileSaver.php | FileSaver.createOutputWithMap | public function createOutputWithMap(array $values, array $map) {
$output = '';
foreach ($map as $outputLine) {
if ($outputLine['type'] == 'empty') {
$output .= PHP_EOL;
} elseif($outputLine['type'] == 'comment') {
$output .= $outputLine['value'] . PHP_EOL;
} else {
$output .= $this->createLine(... | php | public function createOutputWithMap(array $values, array $map) {
$output = '';
foreach ($map as $outputLine) {
if ($outputLine['type'] == 'empty') {
$output .= PHP_EOL;
} elseif($outputLine['type'] == 'comment') {
$output .= $outputLine['value'] . PHP_EOL;
} else {
$output .= $this->createLine(... | [
"public",
"function",
"createOutputWithMap",
"(",
"array",
"$",
"values",
",",
"array",
"$",
"map",
")",
"{",
"$",
"output",
"=",
"''",
";",
"foreach",
"(",
"$",
"map",
"as",
"$",
"outputLine",
")",
"{",
"if",
"(",
"$",
"outputLine",
"[",
"'type'",
"... | Creates output string with provided map
@param array $values Configuration values
@param array $map
@return string | [
"Creates",
"output",
"string",
"with",
"provided",
"map"
] | 79d56d8174637b1124eb90a41ffa3dca4c4a4e93 | https://github.com/mayoturis/properties-ini/blob/79d56d8174637b1124eb90a41ffa3dca4c4a4e93/src/FileSaver.php#L41-L58 |
16,434 | mayoturis/properties-ini | src/FileSaver.php | FileSaver.createOutput | public function createOutput($values) {
$output = '';
foreach ($values as $key => $value) {
$output .= $this->createLine($key, $value) . PHP_EOL;
}
return $output;
} | php | public function createOutput($values) {
$output = '';
foreach ($values as $key => $value) {
$output .= $this->createLine($key, $value) . PHP_EOL;
}
return $output;
} | [
"public",
"function",
"createOutput",
"(",
"$",
"values",
")",
"{",
"$",
"output",
"=",
"''",
";",
"foreach",
"(",
"$",
"values",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"$",
"output",
".=",
"$",
"this",
"->",
"createLine",
"(",
"$",
"key",... | Creates output string from configuration values
@param array $values Configuration values
@return string | [
"Creates",
"output",
"string",
"from",
"configuration",
"values"
] | 79d56d8174637b1124eb90a41ffa3dca4c4a4e93 | https://github.com/mayoturis/properties-ini/blob/79d56d8174637b1124eb90a41ffa3dca4c4a4e93/src/FileSaver.php#L66-L73 |
16,435 | phossa2/middleware | src/Middleware/Queue.php | Queue.fillTheQueue | protected function fillTheQueue(array $middlewares)
{
foreach ($middlewares as $mw) {
// with conditions specified
if (is_array($mw)) {
$this->push($mw[0], $mw[1]);
// no condition
} else {
$this->push($mw);
}
... | php | protected function fillTheQueue(array $middlewares)
{
foreach ($middlewares as $mw) {
// with conditions specified
if (is_array($mw)) {
$this->push($mw[0], $mw[1]);
// no condition
} else {
$this->push($mw);
}
... | [
"protected",
"function",
"fillTheQueue",
"(",
"array",
"$",
"middlewares",
")",
"{",
"foreach",
"(",
"$",
"middlewares",
"as",
"$",
"mw",
")",
"{",
"// with conditions specified",
"if",
"(",
"is_array",
"(",
"$",
"mw",
")",
")",
"{",
"$",
"this",
"->",
"... | Fill the queue with middlewares
@param array $middlewares
@access protected | [
"Fill",
"the",
"queue",
"with",
"middlewares"
] | 518e97ae48077f2c11adcd3c2393830ed7ab7ce7 | https://github.com/phossa2/middleware/blob/518e97ae48077f2c11adcd3c2393830ed7ab7ce7/src/Middleware/Queue.php#L145-L157 |
16,436 | phossa2/middleware | src/Middleware/Queue.php | Queue.evalCondition | protected function evalCondition(
$condition,
RequestInterface $request,
ResponseInterface $response
)/*# : bool */ {
// instanceof ConditionInterface
if (is_object($condition) && $condition instanceof ConditionInterface) {
return $condition->evaluate($request, $r... | php | protected function evalCondition(
$condition,
RequestInterface $request,
ResponseInterface $response
)/*# : bool */ {
// instanceof ConditionInterface
if (is_object($condition) && $condition instanceof ConditionInterface) {
return $condition->evaluate($request, $r... | [
"protected",
"function",
"evalCondition",
"(",
"$",
"condition",
",",
"RequestInterface",
"$",
"request",
",",
"ResponseInterface",
"$",
"response",
")",
"/*# : bool */",
"{",
"// instanceof ConditionInterface",
"if",
"(",
"is_object",
"(",
"$",
"condition",
")",
"&... | Evaluate the condition
support both a callable returns bool value or an object instance of
ConditionInterface.
@param ConditionInterface|callable $condition
@param RequestInterface $request
@param ResponseInterface $response
@return bool
@throws LogicException if condition is invalid
@access protected | [
"Evaluate",
"the",
"condition"
] | 518e97ae48077f2c11adcd3c2393830ed7ab7ce7 | https://github.com/phossa2/middleware/blob/518e97ae48077f2c11adcd3c2393830ed7ab7ce7/src/Middleware/Queue.php#L204-L224 |
16,437 | paulzi/multicurl | MultiCurl.php | MultiCurl.add | public function add($request)
{
$this->onBefore($request);
array_push($this->_requests, $request);
curl_multi_add_handle($this->_mh, $request->curl);
$this->_updated = true;
} | php | public function add($request)
{
$this->onBefore($request);
array_push($this->_requests, $request);
curl_multi_add_handle($this->_mh, $request->curl);
$this->_updated = true;
} | [
"public",
"function",
"add",
"(",
"$",
"request",
")",
"{",
"$",
"this",
"->",
"onBefore",
"(",
"$",
"request",
")",
";",
"array_push",
"(",
"$",
"this",
"->",
"_requests",
",",
"$",
"request",
")",
";",
"curl_multi_add_handle",
"(",
"$",
"this",
"->",... | Add request to execute
@param MultiCurlRequest $request | [
"Add",
"request",
"to",
"execute"
] | 2e326d868add238bb2820f3271e235bfed12e5cb | https://github.com/paulzi/multicurl/blob/2e326d868add238bb2820f3271e235bfed12e5cb/MultiCurl.php#L47-L53 |
16,438 | FrenchFrogs/framework | src/Table/Column/Link.php | Link.getBindedLink | public function getBindedLink($row = [])
{
$bind = array_intersect_key($row, array_fill_keys($this->getBinds(), ''));
// patch pour les paramètre bindé en query
$link = str_replace('%25', '%', $this->getLink());
return vsprintf($link, $bind);
} | php | public function getBindedLink($row = [])
{
$bind = array_intersect_key($row, array_fill_keys($this->getBinds(), ''));
// patch pour les paramètre bindé en query
$link = str_replace('%25', '%', $this->getLink());
return vsprintf($link, $bind);
} | [
"public",
"function",
"getBindedLink",
"(",
"$",
"row",
"=",
"[",
"]",
")",
"{",
"$",
"bind",
"=",
"array_intersect_key",
"(",
"$",
"row",
",",
"array_fill_keys",
"(",
"$",
"this",
"->",
"getBinds",
"(",
")",
",",
"''",
")",
")",
";",
"// patch pour le... | Return the binded link
@param array $row
@return string | [
"Return",
"the",
"binded",
"link"
] | a4838c698a5600437e87dac6d35ba8ebe32c4395 | https://github.com/FrenchFrogs/framework/blob/a4838c698a5600437e87dac6d35ba8ebe32c4395/src/Table/Column/Link.php#L154-L161 |
16,439 | joomla-framework/profiler | src/Profiler.php | Profiler.getTimeBetween | public function getTimeBetween($first, $second)
{
if (!isset($this->lookup[$first]))
{
throw new \LogicException(
sprintf(
'The point %s was not marked in the profiler %s.',
$first,
$this->name
)
);
}
if (!isset($this->lookup[$second]))
{
throw new \LogicException(
sprint... | php | public function getTimeBetween($first, $second)
{
if (!isset($this->lookup[$first]))
{
throw new \LogicException(
sprintf(
'The point %s was not marked in the profiler %s.',
$first,
$this->name
)
);
}
if (!isset($this->lookup[$second]))
{
throw new \LogicException(
sprint... | [
"public",
"function",
"getTimeBetween",
"(",
"$",
"first",
",",
"$",
"second",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"lookup",
"[",
"$",
"first",
"]",
")",
")",
"{",
"throw",
"new",
"\\",
"LogicException",
"(",
"sprintf",
"(",
... | Get the elapsed time in seconds between the two points.
@param string $first The name of the first point.
@param string $second The name of the second point.
@return float The elapsed time between these points in seconds.
@since 1.0
@throws \LogicException If the points were not marked. | [
"Get",
"the",
"elapsed",
"time",
"in",
"seconds",
"between",
"the",
"two",
"points",
"."
] | efdea10dc547d8fa853be6737100c844be227ca6 | https://github.com/joomla-framework/profiler/blob/efdea10dc547d8fa853be6737100c844be227ca6/src/Profiler.php#L269-L300 |
16,440 | joomla-framework/profiler | src/Profiler.php | Profiler.setStart | public function setStart($timeStamp = 0.0, $memoryBytes = 0)
{
if (!empty($this->points))
{
throw new \RuntimeException('The start point cannot be adjusted after points are added to the profiler.');
}
$this->startTimeStamp = $timeStamp;
$this->startMemoryBytes = $memoryBytes;
$point = new ProfilePoi... | php | public function setStart($timeStamp = 0.0, $memoryBytes = 0)
{
if (!empty($this->points))
{
throw new \RuntimeException('The start point cannot be adjusted after points are added to the profiler.');
}
$this->startTimeStamp = $timeStamp;
$this->startMemoryBytes = $memoryBytes;
$point = new ProfilePoi... | [
"public",
"function",
"setStart",
"(",
"$",
"timeStamp",
"=",
"0.0",
",",
"$",
"memoryBytes",
"=",
"0",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"points",
")",
")",
"{",
"throw",
"new",
"\\",
"RuntimeException",
"(",
"'The start point... | Creates a profile point with the specified starting time and memory.
This method will only add a point if no other points have been added as the ProfilePointInterface objects created before changing
the start point would result in inaccurate measurements.
@param float $timeStamp Unix timestamp in microseconds... | [
"Creates",
"a",
"profile",
"point",
"with",
"the",
"specified",
"starting",
"time",
"and",
"memory",
"."
] | efdea10dc547d8fa853be6737100c844be227ca6 | https://github.com/joomla-framework/profiler/blob/efdea10dc547d8fa853be6737100c844be227ca6/src/Profiler.php#L460-L479 |
16,441 | verschoof/bunq-api | src/Service/DefaultInstallationService.php | DefaultInstallationService.install | public function install()
{
$publicKey = $this->certificateStorage->load(CertificateType::PUBLIC_KEY());
$response = $this->sendInstallationPostRequest(
'/v1/installation',
[
'json' => [
'client_public_key' => $publicKey->toString(),
... | php | public function install()
{
$publicKey = $this->certificateStorage->load(CertificateType::PUBLIC_KEY());
$response = $this->sendInstallationPostRequest(
'/v1/installation',
[
'json' => [
'client_public_key' => $publicKey->toString(),
... | [
"public",
"function",
"install",
"(",
")",
"{",
"$",
"publicKey",
"=",
"$",
"this",
"->",
"certificateStorage",
"->",
"load",
"(",
"CertificateType",
"::",
"PUBLIC_KEY",
"(",
")",
")",
";",
"$",
"response",
"=",
"$",
"this",
"->",
"sendInstallationPostReques... | Registers your public key with the Bunq API.
@return array | [
"Registers",
"your",
"public",
"key",
"with",
"the",
"Bunq",
"API",
"."
] | df9aa19f384275f4f0deb26de0cb5e5f8b45ffcd | https://github.com/verschoof/bunq-api/blob/df9aa19f384275f4f0deb26de0cb5e5f8b45ffcd/src/Service/DefaultInstallationService.php#L60-L79 |
16,442 | verschoof/bunq-api | src/Service/DefaultInstallationService.php | DefaultInstallationService.registerDevice | public function registerDevice(Token $token)
{
$this->sendInstallationPostRequest(
'/v1/device-server',
[
'headers' => [
'X-Bunq-Client-Authentication' => $token->toString(),
],
'json' => [
'de... | php | public function registerDevice(Token $token)
{
$this->sendInstallationPostRequest(
'/v1/device-server',
[
'headers' => [
'X-Bunq-Client-Authentication' => $token->toString(),
],
'json' => [
'de... | [
"public",
"function",
"registerDevice",
"(",
"Token",
"$",
"token",
")",
"{",
"$",
"this",
"->",
"sendInstallationPostRequest",
"(",
"'/v1/device-server'",
",",
"[",
"'headers'",
"=>",
"[",
"'X-Bunq-Client-Authentication'",
"=>",
"$",
"token",
"->",
"toString",
"(... | Registers a device with the Bunq API.
@param Token $token
return void | [
"Registers",
"a",
"device",
"with",
"the",
"Bunq",
"API",
"."
] | df9aa19f384275f4f0deb26de0cb5e5f8b45ffcd | https://github.com/verschoof/bunq-api/blob/df9aa19f384275f4f0deb26de0cb5e5f8b45ffcd/src/Service/DefaultInstallationService.php#L88-L103 |
16,443 | verschoof/bunq-api | src/Service/DefaultInstallationService.php | DefaultInstallationService.createSession | public function createSession(Token $token)
{
$response = $this->sendInstallationPostRequest(
'/v1/session-server',
[
'headers' => [
'X-Bunq-Client-Authentication' => $token->toString(),
],
'json' => [
... | php | public function createSession(Token $token)
{
$response = $this->sendInstallationPostRequest(
'/v1/session-server',
[
'headers' => [
'X-Bunq-Client-Authentication' => $token->toString(),
],
'json' => [
... | [
"public",
"function",
"createSession",
"(",
"Token",
"$",
"token",
")",
"{",
"$",
"response",
"=",
"$",
"this",
"->",
"sendInstallationPostRequest",
"(",
"'/v1/session-server'",
",",
"[",
"'headers'",
"=>",
"[",
"'X-Bunq-Client-Authentication'",
"=>",
"$",
"token"... | Registers a session with the Bunq API.
@param Token $token
@return array | [
"Registers",
"a",
"session",
"with",
"the",
"Bunq",
"API",
"."
] | df9aa19f384275f4f0deb26de0cb5e5f8b45ffcd | https://github.com/verschoof/bunq-api/blob/df9aa19f384275f4f0deb26de0cb5e5f8b45ffcd/src/Service/DefaultInstallationService.php#L112-L129 |
16,444 | verschoof/bunq-api | src/Service/DefaultInstallationService.php | DefaultInstallationService.sendInstallationPostRequest | private function sendInstallationPostRequest($url, array $options = [])
{
try {
return $this->httpClient->request('POST', $url, $options);
} catch (ClientException $exception) {
throw new BunqException($exception);
}
} | php | private function sendInstallationPostRequest($url, array $options = [])
{
try {
return $this->httpClient->request('POST', $url, $options);
} catch (ClientException $exception) {
throw new BunqException($exception);
}
} | [
"private",
"function",
"sendInstallationPostRequest",
"(",
"$",
"url",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"try",
"{",
"return",
"$",
"this",
"->",
"httpClient",
"->",
"request",
"(",
"'POST'",
",",
"$",
"url",
",",
"$",
"options",
"... | Sends a post request using the installation HTTP Client
@param $url
@param array $options
@return ResponseInterface
@throws BunqException | [
"Sends",
"a",
"post",
"request",
"using",
"the",
"installation",
"HTTP",
"Client"
] | df9aa19f384275f4f0deb26de0cb5e5f8b45ffcd | https://github.com/verschoof/bunq-api/blob/df9aa19f384275f4f0deb26de0cb5e5f8b45ffcd/src/Service/DefaultInstallationService.php#L140-L147 |
16,445 | mremi/Dolist | src/Mremi/Dolist/Authentication/AuthenticationManager.php | AuthenticationManager.authenticate | private function authenticate()
{
$try = 0;
while (true) {
$try++;
try {
$response = $this->soapClient->__soapCall('GetAuthenticationToken', array(array(
'authenticationRequest' => $this->authenticationRequest->toArray(),
... | php | private function authenticate()
{
$try = 0;
while (true) {
$try++;
try {
$response = $this->soapClient->__soapCall('GetAuthenticationToken', array(array(
'authenticationRequest' => $this->authenticationRequest->toArray(),
... | [
"private",
"function",
"authenticate",
"(",
")",
"{",
"$",
"try",
"=",
"0",
";",
"while",
"(",
"true",
")",
"{",
"$",
"try",
"++",
";",
"try",
"{",
"$",
"response",
"=",
"$",
"this",
"->",
"soapClient",
"->",
"__soapCall",
"(",
"'GetAuthenticationToken... | Calls the authentication API
@return AuthenticationTokenResponse
@throws \SoapFault | [
"Calls",
"the",
"authentication",
"API"
] | 452c863aba12ef2965bafdb619c0278f8fc732d0 | https://github.com/mremi/Dolist/blob/452c863aba12ef2965bafdb619c0278f8fc732d0/src/Mremi/Dolist/Authentication/AuthenticationManager.php#L83-L109 |
16,446 | fsi-open/datasource-bundle | DataSource/Extension/Symfony/Form/Field/FormFieldExtension.php | FormFieldExtension.getForm | protected function getForm(FieldTypeInterface $field, $force = false)
{
$datasource = $field->getDataSource();
if ($datasource === null) {
return null;
}
if (!$field->getOption('form_filter')) {
return null;
}
$field_oid = spl_object_hash($f... | php | protected function getForm(FieldTypeInterface $field, $force = false)
{
$datasource = $field->getDataSource();
if ($datasource === null) {
return null;
}
if (!$field->getOption('form_filter')) {
return null;
}
$field_oid = spl_object_hash($f... | [
"protected",
"function",
"getForm",
"(",
"FieldTypeInterface",
"$",
"field",
",",
"$",
"force",
"=",
"false",
")",
"{",
"$",
"datasource",
"=",
"$",
"field",
"->",
"getDataSource",
"(",
")",
";",
"if",
"(",
"$",
"datasource",
"===",
"null",
")",
"{",
"... | Builds form.
@param FieldTypeInterface $field
@param bool $force
@return FormInterface|null | [
"Builds",
"form",
"."
] | 06964672c838af9f4125065e3a90b2df4e8aa077 | https://github.com/fsi-open/datasource-bundle/blob/06964672c838af9f4125065e3a90b2df4e8aa077/DataSource/Extension/Symfony/Form/Field/FormFieldExtension.php#L175-L238 |
16,447 | codezero-be/cookie | src/VanillaCookie.php | VanillaCookie.decrypt | private function decrypt($cookieValue)
{
if ($this->encrypter && ! empty($cookieValue)) {
return $this->encrypter->decrypt($cookieValue);
}
return $cookieValue;
} | php | private function decrypt($cookieValue)
{
if ($this->encrypter && ! empty($cookieValue)) {
return $this->encrypter->decrypt($cookieValue);
}
return $cookieValue;
} | [
"private",
"function",
"decrypt",
"(",
"$",
"cookieValue",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"encrypter",
"&&",
"!",
"empty",
"(",
"$",
"cookieValue",
")",
")",
"{",
"return",
"$",
"this",
"->",
"encrypter",
"->",
"decrypt",
"(",
"$",
"cookieValu... | Decrypt a cookie
@param string $cookieValue
@return string | [
"Decrypt",
"a",
"cookie"
] | 5300089c9dc7bd48c9865d53c3aed8bd513da6d2 | https://github.com/codezero-be/cookie/blob/5300089c9dc7bd48c9865d53c3aed8bd513da6d2/src/VanillaCookie.php#L135-L142 |
16,448 | kiwiz/ecl | src/ExpressionLanguage.php | ExpressionLanguage.evaluate | public function evaluate($expression, $values=[]) {
if(is_array($values)) {
return parent::evaluate($expression, $values);
} else {
return $this->parse($expression, $values->getKeys())->getNodes()->evaluate($this->functions, $values);
}
} | php | public function evaluate($expression, $values=[]) {
if(is_array($values)) {
return parent::evaluate($expression, $values);
} else {
return $this->parse($expression, $values->getKeys())->getNodes()->evaluate($this->functions, $values);
}
} | [
"public",
"function",
"evaluate",
"(",
"$",
"expression",
",",
"$",
"values",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"values",
")",
")",
"{",
"return",
"parent",
"::",
"evaluate",
"(",
"$",
"expression",
",",
"$",
"values",
")",
... | Evaluate an expression.
Overridden to allow passing in a SymbolTable.
@param \Symfony\Component\ExpressionLanguage\Expression|string $expression
@param SymbolTable|array|\ArrayAccess $values
@return mixed | [
"Evaluate",
"an",
"expression",
".",
"Overridden",
"to",
"allow",
"passing",
"in",
"a",
"SymbolTable",
"."
] | 6536dd2a4c1905a08cf718bdbef56a22f0e9b488 | https://github.com/kiwiz/ecl/blob/6536dd2a4c1905a08cf718bdbef56a22f0e9b488/src/ExpressionLanguage.php#L53-L59 |
16,449 | tjbp/laravel-verify-emails | src/Foundation/Auth/VerifiesEmails.php | VerifiesEmails.resend | public function resend(Request $request)
{
$user = Auth::user();
if ($user->getVerified()) {
return redirect()->back();
}
$response = VerifyEmail::sendVerificationLink($user, function (Message $message) use ($user) {
$message->subject($user->getVerifyEmailSu... | php | public function resend(Request $request)
{
$user = Auth::user();
if ($user->getVerified()) {
return redirect()->back();
}
$response = VerifyEmail::sendVerificationLink($user, function (Message $message) use ($user) {
$message->subject($user->getVerifyEmailSu... | [
"public",
"function",
"resend",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"user",
"=",
"Auth",
"::",
"user",
"(",
")",
";",
"if",
"(",
"$",
"user",
"->",
"getVerified",
"(",
")",
")",
"{",
"return",
"redirect",
"(",
")",
"->",
"back",
"(",
"... | Send another verification email.
@param \Illuminate\Http\Request $request
@return \Illuminate\Http\Response | [
"Send",
"another",
"verification",
"email",
"."
] | 1e2ac10a696c10f2fdf0d7de6c3388d549bc07c6 | https://github.com/tjbp/laravel-verify-emails/blob/1e2ac10a696c10f2fdf0d7de6c3388d549bc07c6/src/Foundation/Auth/VerifiesEmails.php#L28-L44 |
16,450 | tjbp/laravel-verify-emails | src/Foundation/Auth/VerifiesEmails.php | VerifiesEmails.verify | public function verify($token)
{
$response = VerifyEmail::verify(Auth::user(), $token);
switch ($response) {
case VerifyEmail::EMAIL_VERIFIED:
return redirect($this->redirectPath())->with('status', trans($response));
default:
return redirect(... | php | public function verify($token)
{
$response = VerifyEmail::verify(Auth::user(), $token);
switch ($response) {
case VerifyEmail::EMAIL_VERIFIED:
return redirect($this->redirectPath())->with('status', trans($response));
default:
return redirect(... | [
"public",
"function",
"verify",
"(",
"$",
"token",
")",
"{",
"$",
"response",
"=",
"VerifyEmail",
"::",
"verify",
"(",
"Auth",
"::",
"user",
"(",
")",
",",
"$",
"token",
")",
";",
"switch",
"(",
"$",
"response",
")",
"{",
"case",
"VerifyEmail",
"::",... | Attempt to verify a user.
@param string $token
@return \Illuminate\Http\Response | [
"Attempt",
"to",
"verify",
"a",
"user",
"."
] | 1e2ac10a696c10f2fdf0d7de6c3388d549bc07c6 | https://github.com/tjbp/laravel-verify-emails/blob/1e2ac10a696c10f2fdf0d7de6c3388d549bc07c6/src/Foundation/Auth/VerifiesEmails.php#L52-L64 |
16,451 | FrenchFrogs/framework | src/Table/Table/Columns.php | Columns.addColumn | public function addColumn(Column\Column $column)
{
// Join column to the table
$column->setTable($this);
// Add renderer to column if it didn't has one
if (!$column->hasRenderer()) {
$column->setRenderer($this->getRenderer());
}
$this->columns[$column->g... | php | public function addColumn(Column\Column $column)
{
// Join column to the table
$column->setTable($this);
// Add renderer to column if it didn't has one
if (!$column->hasRenderer()) {
$column->setRenderer($this->getRenderer());
}
$this->columns[$column->g... | [
"public",
"function",
"addColumn",
"(",
"Column",
"\\",
"Column",
"$",
"column",
")",
"{",
"// Join column to the table",
"$",
"column",
"->",
"setTable",
"(",
"$",
"this",
")",
";",
"// Add renderer to column if it didn't has one",
"if",
"(",
"!",
"$",
"column",
... | Add a single column to the column container
@param Column\Column $column
@return $this | [
"Add",
"a",
"single",
"column",
"to",
"the",
"column",
"container"
] | a4838c698a5600437e87dac6d35ba8ebe32c4395 | https://github.com/FrenchFrogs/framework/blob/a4838c698a5600437e87dac6d35ba8ebe32c4395/src/Table/Table/Columns.php#L52-L65 |
16,452 | FrenchFrogs/framework | src/Table/Table/Columns.php | Columns.getColumnByIndex | public function getColumnByIndex($index)
{
$keys = array_keys($this->columns);
if (empty($keys[$index]) || empty($column = $this->columns[$keys[$index]])) {
throw new \InvalidArgumentException('Table don\'t have a column index : ' . $index);
}
return $column;
} | php | public function getColumnByIndex($index)
{
$keys = array_keys($this->columns);
if (empty($keys[$index]) || empty($column = $this->columns[$keys[$index]])) {
throw new \InvalidArgumentException('Table don\'t have a column index : ' . $index);
}
return $column;
} | [
"public",
"function",
"getColumnByIndex",
"(",
"$",
"index",
")",
"{",
"$",
"keys",
"=",
"array_keys",
"(",
"$",
"this",
"->",
"columns",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"keys",
"[",
"$",
"index",
"]",
")",
"||",
"empty",
"(",
"$",
"column"... | Return the column from his index
@return Column\Column $column | [
"Return",
"the",
"column",
"from",
"his",
"index"
] | a4838c698a5600437e87dac6d35ba8ebe32c4395 | https://github.com/FrenchFrogs/framework/blob/a4838c698a5600437e87dac6d35ba8ebe32c4395/src/Table/Table/Columns.php#L126-L134 |
16,453 | FrenchFrogs/framework | src/Table/Table/Columns.php | Columns.addRemoteBoolean | public function addRemoteBoolean($name, $label = '', $function = null)
{
$c = new Column\RemoteBoolean($name, $label, $function);
$this->addColumn($c);
return $c;
} | php | public function addRemoteBoolean($name, $label = '', $function = null)
{
$c = new Column\RemoteBoolean($name, $label, $function);
$this->addColumn($c);
return $c;
} | [
"public",
"function",
"addRemoteBoolean",
"(",
"$",
"name",
",",
"$",
"label",
"=",
"''",
",",
"$",
"function",
"=",
"null",
")",
"{",
"$",
"c",
"=",
"new",
"Column",
"\\",
"RemoteBoolean",
"(",
"$",
"name",
",",
"$",
"label",
",",
"$",
"function",
... | Add boolean switch
@param $name
@param string $label
@return \FrenchFrogs\Table\Column\RemoteBoolean | [
"Add",
"boolean",
"switch"
] | a4838c698a5600437e87dac6d35ba8ebe32c4395 | https://github.com/FrenchFrogs/framework/blob/a4838c698a5600437e87dac6d35ba8ebe32c4395/src/Table/Table/Columns.php#L268-L274 |
16,454 | FrenchFrogs/framework | src/Table/Table/Columns.php | Columns.addRemoteText | public function addRemoteText($name, $label = '', $function = null)
{
$c = new Column\RemoteText($name, $label, $function);
$this->addColumn($c);
return $c;
} | php | public function addRemoteText($name, $label = '', $function = null)
{
$c = new Column\RemoteText($name, $label, $function);
$this->addColumn($c);
return $c;
} | [
"public",
"function",
"addRemoteText",
"(",
"$",
"name",
",",
"$",
"label",
"=",
"''",
",",
"$",
"function",
"=",
"null",
")",
"{",
"$",
"c",
"=",
"new",
"Column",
"\\",
"RemoteText",
"(",
"$",
"name",
",",
"$",
"label",
",",
"$",
"function",
")",
... | Add remote text
@param $name
@param string $label
@return \FrenchFrogs\Table\Column\RemoteText | [
"Add",
"remote",
"text"
] | a4838c698a5600437e87dac6d35ba8ebe32c4395 | https://github.com/FrenchFrogs/framework/blob/a4838c698a5600437e87dac6d35ba8ebe32c4395/src/Table/Table/Columns.php#L284-L290 |
16,455 | FrenchFrogs/framework | src/Table/Table/Columns.php | Columns.addRemoteSelect | public function addRemoteSelect($name, $label = '', $index = null, $option = [], $function = null)
{
$c = new Column\RemoteSelect($name, $label, $index, $option, $function);
$this->addColumn($c);
return $c;
} | php | public function addRemoteSelect($name, $label = '', $index = null, $option = [], $function = null)
{
$c = new Column\RemoteSelect($name, $label, $index, $option, $function);
$this->addColumn($c);
return $c;
} | [
"public",
"function",
"addRemoteSelect",
"(",
"$",
"name",
",",
"$",
"label",
"=",
"''",
",",
"$",
"index",
"=",
"null",
",",
"$",
"option",
"=",
"[",
"]",
",",
"$",
"function",
"=",
"null",
")",
"{",
"$",
"c",
"=",
"new",
"Column",
"\\",
"Remote... | Add remote select
@param $name
@param string $label
@return \FrenchFrogs\Table\Column\RemoteSelect | [
"Add",
"remote",
"select"
] | a4838c698a5600437e87dac6d35ba8ebe32c4395 | https://github.com/FrenchFrogs/framework/blob/a4838c698a5600437e87dac6d35ba8ebe32c4395/src/Table/Table/Columns.php#L299-L305 |
16,456 | FrenchFrogs/framework | src/Table/Table/Columns.php | Columns.addButton | public function addButton($name, $label = '%s', $link = '#', $binds = [], $attr = [] )
{
$c = new Column\Button($name, $label, $link, $binds, $attr);
$c->setOptionAsDefault();
$this->addColumn($c);
return $c;
} | php | public function addButton($name, $label = '%s', $link = '#', $binds = [], $attr = [] )
{
$c = new Column\Button($name, $label, $link, $binds, $attr);
$c->setOptionAsDefault();
$this->addColumn($c);
return $c;
} | [
"public",
"function",
"addButton",
"(",
"$",
"name",
",",
"$",
"label",
"=",
"'%s'",
",",
"$",
"link",
"=",
"'#'",
",",
"$",
"binds",
"=",
"[",
"]",
",",
"$",
"attr",
"=",
"[",
"]",
")",
"{",
"$",
"c",
"=",
"new",
"Column",
"\\",
"Button",
"(... | Add as Button Column
@param $name
@param string $label
@param string $link
@param array $binds
@param array $attr
@return \FrenchFrogs\Table\Column\Button | [
"Add",
"as",
"Button",
"Column"
] | a4838c698a5600437e87dac6d35ba8ebe32c4395 | https://github.com/FrenchFrogs/framework/blob/a4838c698a5600437e87dac6d35ba8ebe32c4395/src/Table/Table/Columns.php#L372-L379 |
16,457 | FrenchFrogs/framework | src/Table/Table/Columns.php | Columns.addButtonEdit | public function addButtonEdit($link = '#', $binds = [], $is_remote = true, $method = 'post')
{
$c = new Column\Button(configurator()->get('button.edit.name'), configurator()->get('button.edit.label'), $link, $binds);
$c->setOptionAsPrimary();
$c->icon(configurator()->get('button.edit.icon'... | php | public function addButtonEdit($link = '#', $binds = [], $is_remote = true, $method = 'post')
{
$c = new Column\Button(configurator()->get('button.edit.name'), configurator()->get('button.edit.label'), $link, $binds);
$c->setOptionAsPrimary();
$c->icon(configurator()->get('button.edit.icon'... | [
"public",
"function",
"addButtonEdit",
"(",
"$",
"link",
"=",
"'#'",
",",
"$",
"binds",
"=",
"[",
"]",
",",
"$",
"is_remote",
"=",
"true",
",",
"$",
"method",
"=",
"'post'",
")",
"{",
"$",
"c",
"=",
"new",
"Column",
"\\",
"Button",
"(",
"configurat... | Add default edit button
@param string $link
@param array $binds
@param array $attr
@return \FrenchFrogs\Table\Column\Button | [
"Add",
"default",
"edit",
"button"
] | a4838c698a5600437e87dac6d35ba8ebe32c4395 | https://github.com/FrenchFrogs/framework/blob/a4838c698a5600437e87dac6d35ba8ebe32c4395/src/Table/Table/Columns.php#L420-L433 |
16,458 | FrenchFrogs/framework | src/Table/Table/Columns.php | Columns.addButtonDelete | public function addButtonDelete($link = '#', $binds = [], $is_remote = true, $method = 'delete')
{
$c = new Column\Button(configurator()->get('button.delete.name'), configurator()->get('button.delete.label'), $link, $binds);
$c->setOptionAsDanger();
$c->icon(configurator()->get('button.delet... | php | public function addButtonDelete($link = '#', $binds = [], $is_remote = true, $method = 'delete')
{
$c = new Column\Button(configurator()->get('button.delete.name'), configurator()->get('button.delete.label'), $link, $binds);
$c->setOptionAsDanger();
$c->icon(configurator()->get('button.delet... | [
"public",
"function",
"addButtonDelete",
"(",
"$",
"link",
"=",
"'#'",
",",
"$",
"binds",
"=",
"[",
"]",
",",
"$",
"is_remote",
"=",
"true",
",",
"$",
"method",
"=",
"'delete'",
")",
"{",
"$",
"c",
"=",
"new",
"Column",
"\\",
"Button",
"(",
"config... | Add default delete button
@param string $link
@param array $binds
@param array $attr
@return \FrenchFrogs\Table\Column\Button | [
"Add",
"default",
"delete",
"button"
] | a4838c698a5600437e87dac6d35ba8ebe32c4395 | https://github.com/FrenchFrogs/framework/blob/a4838c698a5600437e87dac6d35ba8ebe32c4395/src/Table/Table/Columns.php#L443-L453 |
16,459 | FrenchFrogs/framework | src/Table/Table/Columns.php | Columns.addContainer | public function addContainer($name, $label = '', $attr = [])
{
$c = new Column\Container($name, $label, $attr);
$this->addColumn($c);
return $c;
} | php | public function addContainer($name, $label = '', $attr = [])
{
$c = new Column\Container($name, $label, $attr);
$this->addColumn($c);
return $c;
} | [
"public",
"function",
"addContainer",
"(",
"$",
"name",
",",
"$",
"label",
"=",
"''",
",",
"$",
"attr",
"=",
"[",
"]",
")",
"{",
"$",
"c",
"=",
"new",
"Column",
"\\",
"Container",
"(",
"$",
"name",
",",
"$",
"label",
",",
"$",
"attr",
")",
";",... | Add a container columns
@param $name
@param string $label
@param array $attr
@return \FrenchFrogs\Table\Column\Container | [
"Add",
"a",
"container",
"columns"
] | a4838c698a5600437e87dac6d35ba8ebe32c4395 | https://github.com/FrenchFrogs/framework/blob/a4838c698a5600437e87dac6d35ba8ebe32c4395/src/Table/Table/Columns.php#L465-L470 |
16,460 | jpuck/color-mixer | src/Mixer.php | Mixer.addColor | public function addColor($color)
{
if ( ! $color instanceof Color ) {
$color = new Color($color);
}
$this->colors []= $color;
} | php | public function addColor($color)
{
if ( ! $color instanceof Color ) {
$color = new Color($color);
}
$this->colors []= $color;
} | [
"public",
"function",
"addColor",
"(",
"$",
"color",
")",
"{",
"if",
"(",
"!",
"$",
"color",
"instanceof",
"Color",
")",
"{",
"$",
"color",
"=",
"new",
"Color",
"(",
"$",
"color",
")",
";",
"}",
"$",
"this",
"->",
"colors",
"[",
"]",
"=",
"$",
... | Adds a color to the Mixer.
@param mixed Color object or string
@return null | [
"Adds",
"a",
"color",
"to",
"the",
"Mixer",
"."
] | cea01c3082a921a35e00ae0a287c795d9fd73ada | https://github.com/jpuck/color-mixer/blob/cea01c3082a921a35e00ae0a287c795d9fd73ada/src/Mixer.php#L28-L35 |
16,461 | jpuck/color-mixer | src/Mixer.php | Mixer.mix | public function mix() : Color
{
foreach ($this->colors as $color) {
$colors = $color->dec();
$reds []= $colors[0];
$greens[]= $colors[1];
$blues []= $colors[2];
}
$red = dechex( round(array_sum($reds) / count($reds) ) );
$green =... | php | public function mix() : Color
{
foreach ($this->colors as $color) {
$colors = $color->dec();
$reds []= $colors[0];
$greens[]= $colors[1];
$blues []= $colors[2];
}
$red = dechex( round(array_sum($reds) / count($reds) ) );
$green =... | [
"public",
"function",
"mix",
"(",
")",
":",
"Color",
"{",
"foreach",
"(",
"$",
"this",
"->",
"colors",
"as",
"$",
"color",
")",
"{",
"$",
"colors",
"=",
"$",
"color",
"->",
"dec",
"(",
")",
";",
"$",
"reds",
"[",
"]",
"=",
"$",
"colors",
"[",
... | Get the mixed color.
@return Color Returns a new Color object from the Mixer. | [
"Get",
"the",
"mixed",
"color",
"."
] | cea01c3082a921a35e00ae0a287c795d9fd73ada | https://github.com/jpuck/color-mixer/blob/cea01c3082a921a35e00ae0a287c795d9fd73ada/src/Mixer.php#L52-L73 |
16,462 | FrenchFrogs/framework | src/Table/Table/Table.php | Table.isSourceQueryBuilder | public function isSourceQueryBuilder()
{
return is_object($this->getSource()) && get_class($this->getSource()) == \Illuminate\Database\Query\Builder::class;
} | php | public function isSourceQueryBuilder()
{
return is_object($this->getSource()) && get_class($this->getSource()) == \Illuminate\Database\Query\Builder::class;
} | [
"public",
"function",
"isSourceQueryBuilder",
"(",
")",
"{",
"return",
"is_object",
"(",
"$",
"this",
"->",
"getSource",
"(",
")",
")",
"&&",
"get_class",
"(",
"$",
"this",
"->",
"getSource",
"(",
")",
")",
"==",
"\\",
"Illuminate",
"\\",
"Database",
"\\... | Return true if the source is an instance of \Illuminate\Database\Query\Builder
@return bool | [
"Return",
"true",
"if",
"the",
"source",
"is",
"an",
"instance",
"of",
"\\",
"Illuminate",
"\\",
"Database",
"\\",
"Query",
"\\",
"Builder"
] | a4838c698a5600437e87dac6d35ba8ebe32c4395 | https://github.com/FrenchFrogs/framework/blob/a4838c698a5600437e87dac6d35ba8ebe32c4395/src/Table/Table/Table.php#L261-L264 |
16,463 | FrenchFrogs/framework | src/Table/Table/Table.php | Table.extractJson | public function extractJson()
{
foreach($this->getRows() as &$row) {
foreach($this->getJsonFields() as $field) {
if (isset($row[$field])) {
$data = json_decode($row[$field], JSON_OBJECT_AS_ARRAY);
foreach((array) $data as $k => $v) {
... | php | public function extractJson()
{
foreach($this->getRows() as &$row) {
foreach($this->getJsonFields() as $field) {
if (isset($row[$field])) {
$data = json_decode($row[$field], JSON_OBJECT_AS_ARRAY);
foreach((array) $data as $k => $v) {
... | [
"public",
"function",
"extractJson",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"getRows",
"(",
")",
"as",
"&",
"$",
"row",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"getJsonFields",
"(",
")",
"as",
"$",
"field",
")",
"{",
"if",
"(",
"i... | Extract json data
@return $this | [
"Extract",
"json",
"data"
] | a4838c698a5600437e87dac6d35ba8ebe32c4395 | https://github.com/FrenchFrogs/framework/blob/a4838c698a5600437e87dac6d35ba8ebe32c4395/src/Table/Table/Table.php#L409-L425 |
16,464 | axelitus/php-base | src/BigFloat.php | BigFloat.isEven | public static function isEven($value, $scale = null)
{
if (!static::is($value)) {
throw new \InvalidArgumentException(
"The \$value parameter must be of type float (or string representing a big float)."
);
}
return static::equals(static::mod($value, 2... | php | public static function isEven($value, $scale = null)
{
if (!static::is($value)) {
throw new \InvalidArgumentException(
"The \$value parameter must be of type float (or string representing a big float)."
);
}
return static::equals(static::mod($value, 2... | [
"public",
"static",
"function",
"isEven",
"(",
"$",
"value",
",",
"$",
"scale",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"static",
"::",
"is",
"(",
"$",
"value",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"\"The \\$value paramete... | Tests if the given value is even.
@param float|string $value The value to test.
@param null|int $scale The scale to use for BCMath functions.
If null is given the value set by {@link bcscale()} is used.
@throws \InvalidArgumentException
@return bool Returns true if the given value is even, false otherwise. | [
"Tests",
"if",
"the",
"given",
"value",
"is",
"even",
"."
] | c2da680c1f0c3ee93ae6a8be5adaacd0caf7d075 | https://github.com/axelitus/php-base/blob/c2da680c1f0c3ee93ae6a8be5adaacd0caf7d075/src/BigFloat.php#L53-L62 |
16,465 | axelitus/php-base | src/BigFloat.php | BigFloat.isOdd | public static function isOdd($value, $scale = null)
{
if (!static::is($value)) {
throw new \InvalidArgumentException(
"The \$value parameter must be of type float (or string representing a big float)."
);
}
return static::equals(static::abs(static::mo... | php | public static function isOdd($value, $scale = null)
{
if (!static::is($value)) {
throw new \InvalidArgumentException(
"The \$value parameter must be of type float (or string representing a big float)."
);
}
return static::equals(static::abs(static::mo... | [
"public",
"static",
"function",
"isOdd",
"(",
"$",
"value",
",",
"$",
"scale",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"static",
"::",
"is",
"(",
"$",
"value",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"\"The \\$value parameter... | Tests if the given value is odd.
@param float|string $value The value to test.
@param null|int $scale The scale to use for BCMath functions.
If null is given the value set by {@link bcscale()} is used.
@throws \InvalidArgumentException
@return bool Returns true if the given value is odd, false otherwise. | [
"Tests",
"if",
"the",
"given",
"value",
"is",
"odd",
"."
] | c2da680c1f0c3ee93ae6a8be5adaacd0caf7d075 | https://github.com/axelitus/php-base/blob/c2da680c1f0c3ee93ae6a8be5adaacd0caf7d075/src/BigFloat.php#L74-L83 |
16,466 | axelitus/php-base | src/BigFloat.php | BigFloat.inRange | public static function inRange($value, $lower, $upper, $lowerExclusive = false, $upperExclusive = false)
{
if (!static::is($value) || !static::is($lower) || !static::is($upper)) {
throw new \InvalidArgumentException(
"The \$value, \$lower and \$upper parameters must be of type fl... | php | public static function inRange($value, $lower, $upper, $lowerExclusive = false, $upperExclusive = false)
{
if (!static::is($value) || !static::is($lower) || !static::is($upper)) {
throw new \InvalidArgumentException(
"The \$value, \$lower and \$upper parameters must be of type fl... | [
"public",
"static",
"function",
"inRange",
"(",
"$",
"value",
",",
"$",
"lower",
",",
"$",
"upper",
",",
"$",
"lowerExclusive",
"=",
"false",
",",
"$",
"upperExclusive",
"=",
"false",
")",
"{",
"if",
"(",
"!",
"static",
"::",
"is",
"(",
"$",
"value",... | Tests if an integer is in a range.
Tests if a value is in a range. The function will correct the limits if inverted. The tested range
can be set to have its lower and upper limits inclusive (bounds closed) or exclusive (bounds opened) using
the $lowerExclusive and $upperExclusive parameters (all possible variations: ]... | [
"Tests",
"if",
"an",
"integer",
"is",
"in",
"a",
"range",
"."
] | c2da680c1f0c3ee93ae6a8be5adaacd0caf7d075 | https://github.com/axelitus/php-base/blob/c2da680c1f0c3ee93ae6a8be5adaacd0caf7d075/src/BigFloat.php#L178-L198 |
16,467 | axelitus/php-base | src/BigFloat.php | BigFloat.abs | public static function abs($float)
{
if (!static::is($float)) {
throw new \InvalidArgumentException(
"The \$float parameter must be of type float (or string representing a big float)."
);
}
if (Float::is($float)) {
return Float::abs($float... | php | public static function abs($float)
{
if (!static::is($float)) {
throw new \InvalidArgumentException(
"The \$float parameter must be of type float (or string representing a big float)."
);
}
if (Float::is($float)) {
return Float::abs($float... | [
"public",
"static",
"function",
"abs",
"(",
"$",
"float",
")",
"{",
"if",
"(",
"!",
"static",
"::",
"is",
"(",
"$",
"float",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"\"The \\$float parameter must be of type float (or string representi... | Gets the absolute value of the given float.
@param int|string $float The number to get the absolute value of.
@return int|string Returns the absolute value of the given float. | [
"Gets",
"the",
"absolute",
"value",
"of",
"the",
"given",
"float",
"."
] | c2da680c1f0c3ee93ae6a8be5adaacd0caf7d075 | https://github.com/axelitus/php-base/blob/c2da680c1f0c3ee93ae6a8be5adaacd0caf7d075/src/BigFloat.php#L245-L258 |
16,468 | phramework/jsonapi | src/Controller/Base.php | Base.viewData | public static function viewData(
$data,
$links = null,
$meta = null,
$included = null
) {
$viewParameters = new \stdClass();
if ($links) {
$viewParameters->links = $links;
}
$viewParameters->data = $data;
if ($included !== null) ... | php | public static function viewData(
$data,
$links = null,
$meta = null,
$included = null
) {
$viewParameters = new \stdClass();
if ($links) {
$viewParameters->links = $links;
}
$viewParameters->data = $data;
if ($included !== null) ... | [
"public",
"static",
"function",
"viewData",
"(",
"$",
"data",
",",
"$",
"links",
"=",
"null",
",",
"$",
"meta",
"=",
"null",
",",
"$",
"included",
"=",
"null",
")",
"{",
"$",
"viewParameters",
"=",
"new",
"\\",
"stdClass",
"(",
")",
";",
"if",
"(",... | View JSONAPI data
@param object $data
@uses \Phramework\Viewers\JSONAPI
@return boolean | [
"View",
"JSONAPI",
"data"
] | af20882a8b6f6e5be9c8e09e5b87f6c23a4b0726 | https://github.com/phramework/jsonapi/blob/af20882a8b6f6e5be9c8e09e5b87f6c23a4b0726/src/Controller/Base.php#L85-L112 |
16,469 | phramework/jsonapi | src/Controller/Base.php | Base.getRequestInclude | protected static function getRequestInclude($parameters, $modelClass = null)
{
//work with arrays
if (!is_object($parameters) && is_array($parameters)) {
$parameters = (object) $parameters;
}
$include = [];
if ($modelClass !== null) {
//Add additiona... | php | protected static function getRequestInclude($parameters, $modelClass = null)
{
//work with arrays
if (!is_object($parameters) && is_array($parameters)) {
$parameters = (object) $parameters;
}
$include = [];
if ($modelClass !== null) {
//Add additiona... | [
"protected",
"static",
"function",
"getRequestInclude",
"(",
"$",
"parameters",
",",
"$",
"modelClass",
"=",
"null",
")",
"{",
"//work with arrays",
"if",
"(",
"!",
"is_object",
"(",
"$",
"parameters",
")",
"&&",
"is_array",
"(",
"$",
"parameters",
")",
")",... | Extract included related resources from parameters
@param object $parameters Request parameters
@param string|null $modelClass If not null, will add additional include by default from resource model's relationships
@return string[] | [
"Extract",
"included",
"related",
"resources",
"from",
"parameters"
] | af20882a8b6f6e5be9c8e09e5b87f6c23a4b0726 | https://github.com/phramework/jsonapi/blob/af20882a8b6f6e5be9c8e09e5b87f6c23a4b0726/src/Controller/Base.php#L120-L148 |
16,470 | phramework/jsonapi | src/Controller/Base.php | Base.getRequestData | protected static function getRequestData($parameters)
{
//work with objects
if (!is_object($parameters) && is_array($parameters)) {
$parameters = (object) $parameters;
}
//Require data
Request::requireParameters($parameters, ['data']);
return $parameters... | php | protected static function getRequestData($parameters)
{
//work with objects
if (!is_object($parameters) && is_array($parameters)) {
$parameters = (object) $parameters;
}
//Require data
Request::requireParameters($parameters, ['data']);
return $parameters... | [
"protected",
"static",
"function",
"getRequestData",
"(",
"$",
"parameters",
")",
"{",
"//work with objects",
"if",
"(",
"!",
"is_object",
"(",
"$",
"parameters",
")",
"&&",
"is_array",
"(",
"$",
"parameters",
")",
")",
"{",
"$",
"parameters",
"=",
"(",
"o... | Get request primary data
@param object $parameters Request parameters
@uses Request::requireParameters
@return object|object[] | [
"Get",
"request",
"primary",
"data"
] | af20882a8b6f6e5be9c8e09e5b87f6c23a4b0726 | https://github.com/phramework/jsonapi/blob/af20882a8b6f6e5be9c8e09e5b87f6c23a4b0726/src/Controller/Base.php#L196-L207 |
16,471 | phramework/jsonapi | src/Controller/Base.php | Base.getRequestRelationships | protected static function getRequestRelationships($parameters)
{
//work with objects
if (!is_object($parameters) && is_array($parameters)) {
$parameters = (object) $parameters;
}
//Require data
Request::requireParameters($parameters, ['data']);
//Require... | php | protected static function getRequestRelationships($parameters)
{
//work with objects
if (!is_object($parameters) && is_array($parameters)) {
$parameters = (object) $parameters;
}
//Require data
Request::requireParameters($parameters, ['data']);
//Require... | [
"protected",
"static",
"function",
"getRequestRelationships",
"(",
"$",
"parameters",
")",
"{",
"//work with objects",
"if",
"(",
"!",
"is_object",
"(",
"$",
"parameters",
")",
"&&",
"is_array",
"(",
"$",
"parameters",
")",
")",
"{",
"$",
"parameters",
"=",
... | Get request relationships if any attributes.
@param object $parameters Request parameters
@return object | [
"Get",
"request",
"relationships",
"if",
"any",
"attributes",
"."
] | af20882a8b6f6e5be9c8e09e5b87f6c23a4b0726 | https://github.com/phramework/jsonapi/blob/af20882a8b6f6e5be9c8e09e5b87f6c23a4b0726/src/Controller/Base.php#L214-L230 |
16,472 | sasedev/composer-plugin-filecopier | src/Sasedev/Composer/Plugin/Filescopier/Processor.php | Processor.startsWith | private function startsWith($string, $prefix) {
return $prefix === "" || strrpos($string, $prefix, -strlen($string)) !== FALSE;
} | php | private function startsWith($string, $prefix) {
return $prefix === "" || strrpos($string, $prefix, -strlen($string)) !== FALSE;
} | [
"private",
"function",
"startsWith",
"(",
"$",
"string",
",",
"$",
"prefix",
")",
"{",
"return",
"$",
"prefix",
"===",
"\"\"",
"||",
"strrpos",
"(",
"$",
"string",
",",
"$",
"prefix",
",",
"-",
"strlen",
"(",
"$",
"string",
")",
")",
"!==",
"FALSE",
... | Check if a string starts with a prefix
@param string $string
@param string $prefix
@return boolean | [
"Check",
"if",
"a",
"string",
"starts",
"with",
"a",
"prefix"
] | 0cb2430d9a95b3955e05a8fe43054751c08b9f07 | https://github.com/sasedev/composer-plugin-filecopier/blob/0cb2430d9a95b3955e05a8fe43054751c08b9f07/src/Sasedev/Composer/Plugin/Filescopier/Processor.php#L189-L191 |
16,473 | sasedev/composer-plugin-filecopier | src/Sasedev/Composer/Plugin/Filescopier/Processor.php | Processor.endswith | private function endswith($string, $suffix)
{
$strlen = strlen($string);
$testlen = strlen($suffix);
if ($testlen > $strlen) {
return false;
}
return substr_compare($string, $suffix, -$testlen) === 0;
} | php | private function endswith($string, $suffix)
{
$strlen = strlen($string);
$testlen = strlen($suffix);
if ($testlen > $strlen) {
return false;
}
return substr_compare($string, $suffix, -$testlen) === 0;
} | [
"private",
"function",
"endswith",
"(",
"$",
"string",
",",
"$",
"suffix",
")",
"{",
"$",
"strlen",
"=",
"strlen",
"(",
"$",
"string",
")",
";",
"$",
"testlen",
"=",
"strlen",
"(",
"$",
"suffix",
")",
";",
"if",
"(",
"$",
"testlen",
">",
"$",
"st... | Check if a string ends with a suffix
@param string $string
@param string $suffix
@return boolean | [
"Check",
"if",
"a",
"string",
"ends",
"with",
"a",
"suffix"
] | 0cb2430d9a95b3955e05a8fe43054751c08b9f07 | https://github.com/sasedev/composer-plugin-filecopier/blob/0cb2430d9a95b3955e05a8fe43054751c08b9f07/src/Sasedev/Composer/Plugin/Filescopier/Processor.php#L201-L210 |
16,474 | harp-orm/query | src/Compiler/Delete.php | Delete.render | public static function render(Query\Delete $query)
{
return Compiler::withDb($query->getDb(), function () use ($query) {
return Compiler::expression(array(
'DELETE',
$query->getType(),
Aliased::combine($query->getTable()),
Compiler:... | php | public static function render(Query\Delete $query)
{
return Compiler::withDb($query->getDb(), function () use ($query) {
return Compiler::expression(array(
'DELETE',
$query->getType(),
Aliased::combine($query->getTable()),
Compiler:... | [
"public",
"static",
"function",
"render",
"(",
"Query",
"\\",
"Delete",
"$",
"query",
")",
"{",
"return",
"Compiler",
"::",
"withDb",
"(",
"$",
"query",
"->",
"getDb",
"(",
")",
",",
"function",
"(",
")",
"use",
"(",
"$",
"query",
")",
"{",
"return",... | Render a Delete object
@param Query\Delete $query
@return string | [
"Render",
"a",
"Delete",
"object"
] | 98ce2468a0a31fe15ed3692bad32547bf6dbe41a | https://github.com/harp-orm/query/blob/98ce2468a0a31fe15ed3692bad32547bf6dbe41a/src/Compiler/Delete.php#L19-L33 |
16,475 | darkwebdesign/doctrine-unit-testing | src/Mocks/CacheRegionMock.php | CacheRegionMock.getReturn | private function getReturn($method, $default)
{
if (isset($this->returns[$method]) && ! empty($this->returns[$method])) {
return array_shift($this->returns[$method]);
}
return $default;
} | php | private function getReturn($method, $default)
{
if (isset($this->returns[$method]) && ! empty($this->returns[$method])) {
return array_shift($this->returns[$method]);
}
return $default;
} | [
"private",
"function",
"getReturn",
"(",
"$",
"method",
",",
"$",
"default",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"returns",
"[",
"$",
"method",
"]",
")",
"&&",
"!",
"empty",
"(",
"$",
"this",
"->",
"returns",
"[",
"$",
"method",
... | Dequeue a value for a specific method invocation
@param string $method
@param mixed $default
@return mixed | [
"Dequeue",
"a",
"value",
"for",
"a",
"specific",
"method",
"invocation"
] | 0daf50359563bc0679925e573a7105d6cd57168a | https://github.com/darkwebdesign/doctrine-unit-testing/blob/0daf50359563bc0679925e573a7105d6cd57168a/src/Mocks/CacheRegionMock.php#L39-L46 |
16,476 | bestit/commercetools-order-export-bundle | src/DependencyInjection/Configuration.php | Configuration.getConfigTreeBuilder | public function getConfigTreeBuilder()
{
$builder = new TreeBuilder();
$rootNode = $builder->root('best_it_ct_order_export');
$rootNode
->children()
->arrayNode('commercetools_client')
->isRequired()
->children()
... | php | public function getConfigTreeBuilder()
{
$builder = new TreeBuilder();
$rootNode = $builder->root('best_it_ct_order_export');
$rootNode
->children()
->arrayNode('commercetools_client')
->isRequired()
->children()
... | [
"public",
"function",
"getConfigTreeBuilder",
"(",
")",
"{",
"$",
"builder",
"=",
"new",
"TreeBuilder",
"(",
")",
";",
"$",
"rootNode",
"=",
"$",
"builder",
"->",
"root",
"(",
"'best_it_ct_order_export'",
")",
";",
"$",
"rootNode",
"->",
"children",
"(",
"... | Parses the config.
@return TreeBuilder | [
"Parses",
"the",
"config",
"."
] | 44bd0dedff6edab5ecf5803dcf6d24ffe0dbf845 | https://github.com/bestit/commercetools-order-export-bundle/blob/44bd0dedff6edab5ecf5803dcf6d24ffe0dbf845/src/DependencyInjection/Configuration.php#L21-L76 |
16,477 | Atlantic18/CoralCoreBundle | Service/Request/Request.php | Request.isCacheable | private function isCacheable(RequestHandleInterface $handle)
{
if(null === $this->cache)
{
return false;
}
if($handle->getMethod() != self::GET)
{
return false;
}
return true;
} | php | private function isCacheable(RequestHandleInterface $handle)
{
if(null === $this->cache)
{
return false;
}
if($handle->getMethod() != self::GET)
{
return false;
}
return true;
} | [
"private",
"function",
"isCacheable",
"(",
"RequestHandleInterface",
"$",
"handle",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"cache",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"$",
"handle",
"->",
"getMethod",
"(",
")",
"!=",
"sel... | Returns true if handle is possible to be cached
@param RequestHandleInterface $handle Request handle
@return boolean True if can be cached | [
"Returns",
"true",
"if",
"handle",
"is",
"possible",
"to",
"be",
"cached"
] | 7d74ffaf51046ad13cbfc2b0b69d656a499f38ab | https://github.com/Atlantic18/CoralCoreBundle/blob/7d74ffaf51046ad13cbfc2b0b69d656a499f38ab/Service/Request/Request.php#L49-L61 |
16,478 | stubbles/stubbles-webapp-core | src/main/php/routing/Routing.php | Routing.onGet | public function onGet(string $path, $target): ConfigurableRoute
{
return $this->addRoute(new Route($path, $target, 'GET'));
} | php | public function onGet(string $path, $target): ConfigurableRoute
{
return $this->addRoute(new Route($path, $target, 'GET'));
} | [
"public",
"function",
"onGet",
"(",
"string",
"$",
"path",
",",
"$",
"target",
")",
":",
"ConfigurableRoute",
"{",
"return",
"$",
"this",
"->",
"addRoute",
"(",
"new",
"Route",
"(",
"$",
"path",
",",
"$",
"target",
",",
"'GET'",
")",
")",
";",
"}"
] | reply with given class or callable for GET request on given path
@param string $path path this route is applicable for
@param string|callable|\stubbles\webapp\Target $target code to be executed when the route is active
@return \stubbles\webapp\routing\ConfigurableRoute | [
"reply",
"with",
"given",
"class",
"or",
"callable",
"for",
"GET",
"request",
"on",
"given",
"path"
] | 7705f129011a81d5cc3c76b4b150fab3dadac6a3 | https://github.com/stubbles/stubbles-webapp-core/blob/7705f129011a81d5cc3c76b4b150fab3dadac6a3/src/main/php/routing/Routing.php#L88-L91 |
16,479 | stubbles/stubbles-webapp-core | src/main/php/routing/Routing.php | Routing.passThroughOnGet | public function passThroughOnGet(
string $path = '/[a-zA-Z0-9-_]+.html$',
$target = HtmlFilePassThrough::class
): ConfigurableRoute {
return $this->onGet($path, $target);
} | php | public function passThroughOnGet(
string $path = '/[a-zA-Z0-9-_]+.html$',
$target = HtmlFilePassThrough::class
): ConfigurableRoute {
return $this->onGet($path, $target);
} | [
"public",
"function",
"passThroughOnGet",
"(",
"string",
"$",
"path",
"=",
"'/[a-zA-Z0-9-_]+.html$'",
",",
"$",
"target",
"=",
"HtmlFilePassThrough",
"::",
"class",
")",
":",
"ConfigurableRoute",
"{",
"return",
"$",
"this",
"->",
"onGet",
"(",
"$",
"path",
","... | reply with HTML file stored in pages path
@param string $path optional path this route is applicable for
@param string|callable|\stubbles\webapp\Target $target optional code to be executed when the route is active
@return \stubbles\webapp\routing\ConfigurableRoute
@since ... | [
"reply",
"with",
"HTML",
"file",
"stored",
"in",
"pages",
"path"
] | 7705f129011a81d5cc3c76b4b150fab3dadac6a3 | https://github.com/stubbles/stubbles-webapp-core/blob/7705f129011a81d5cc3c76b4b150fab3dadac6a3/src/main/php/routing/Routing.php#L101-L106 |
16,480 | stubbles/stubbles-webapp-core | src/main/php/routing/Routing.php | Routing.apiIndexOnGet | public function apiIndexOnGet(string $path): ConfigurableRoute
{
return $this->onGet($path, new Index($this->routes, $this->mimeTypes));
} | php | public function apiIndexOnGet(string $path): ConfigurableRoute
{
return $this->onGet($path, new Index($this->routes, $this->mimeTypes));
} | [
"public",
"function",
"apiIndexOnGet",
"(",
"string",
"$",
"path",
")",
":",
"ConfigurableRoute",
"{",
"return",
"$",
"this",
"->",
"onGet",
"(",
"$",
"path",
",",
"new",
"Index",
"(",
"$",
"this",
"->",
"routes",
",",
"$",
"this",
"->",
"mimeTypes",
"... | reply with API index overview
@param string $path
@return \stubbles\webapp\routing\ConfigurableRoute
@since 6.1.0 | [
"reply",
"with",
"API",
"index",
"overview"
] | 7705f129011a81d5cc3c76b4b150fab3dadac6a3 | https://github.com/stubbles/stubbles-webapp-core/blob/7705f129011a81d5cc3c76b4b150fab3dadac6a3/src/main/php/routing/Routing.php#L115-L118 |
16,481 | stubbles/stubbles-webapp-core | src/main/php/routing/Routing.php | Routing.redirectOnGet | public function redirectOnGet(string $path, $target, int $statusCode = 302): ConfigurableRoute
{
return $this->onGet($path, new Redirect($target, $statusCode));
} | php | public function redirectOnGet(string $path, $target, int $statusCode = 302): ConfigurableRoute
{
return $this->onGet($path, new Redirect($target, $statusCode));
} | [
"public",
"function",
"redirectOnGet",
"(",
"string",
"$",
"path",
",",
"$",
"target",
",",
"int",
"$",
"statusCode",
"=",
"302",
")",
":",
"ConfigurableRoute",
"{",
"return",
"$",
"this",
"->",
"onGet",
"(",
"$",
"path",
",",
"new",
"Redirect",
"(",
"... | reply with a redirect
If the given $target is a string it is used in different ways:
- if the string starts with http it is assumed to be a complete uri
- else it is assumed to be a path within the application
@param string $path path this route is applicable for
@param string|... | [
"reply",
"with",
"a",
"redirect"
] | 7705f129011a81d5cc3c76b4b150fab3dadac6a3 | https://github.com/stubbles/stubbles-webapp-core/blob/7705f129011a81d5cc3c76b4b150fab3dadac6a3/src/main/php/routing/Routing.php#L133-L136 |
16,482 | stubbles/stubbles-webapp-core | src/main/php/routing/Routing.php | Routing.onHead | public function onHead(string $path, $target): ConfigurableRoute
{
return $this->addRoute(new Route($path, $target, 'HEAD'));
} | php | public function onHead(string $path, $target): ConfigurableRoute
{
return $this->addRoute(new Route($path, $target, 'HEAD'));
} | [
"public",
"function",
"onHead",
"(",
"string",
"$",
"path",
",",
"$",
"target",
")",
":",
"ConfigurableRoute",
"{",
"return",
"$",
"this",
"->",
"addRoute",
"(",
"new",
"Route",
"(",
"$",
"path",
",",
"$",
"target",
",",
"'HEAD'",
")",
")",
";",
"}"
... | reply with given class or callable for HEAD request on given path
@param string $path path this route is applicable for
@param string|callable|\stubbles\webapp\Target $target code to be executed when the route is active
@return \stubbles\webapp\routing\ConfigurableRoute | [
"reply",
"with",
"given",
"class",
"or",
"callable",
"for",
"HEAD",
"request",
"on",
"given",
"path"
] | 7705f129011a81d5cc3c76b4b150fab3dadac6a3 | https://github.com/stubbles/stubbles-webapp-core/blob/7705f129011a81d5cc3c76b4b150fab3dadac6a3/src/main/php/routing/Routing.php#L145-L148 |
16,483 | stubbles/stubbles-webapp-core | src/main/php/routing/Routing.php | Routing.onPost | public function onPost(string $path, $target): ConfigurableRoute
{
return $this->addRoute(new Route($path, $target, 'POST'));
} | php | public function onPost(string $path, $target): ConfigurableRoute
{
return $this->addRoute(new Route($path, $target, 'POST'));
} | [
"public",
"function",
"onPost",
"(",
"string",
"$",
"path",
",",
"$",
"target",
")",
":",
"ConfigurableRoute",
"{",
"return",
"$",
"this",
"->",
"addRoute",
"(",
"new",
"Route",
"(",
"$",
"path",
",",
"$",
"target",
",",
"'POST'",
")",
")",
";",
"}"
... | reply with given class or callable for POST request on given path
@param string $path path this route is applicable for
@param string|callable|\stubbles\webapp\Target $target code to be executed when the route is active
@return \stubbles\webapp\routing\ConfigurableRoute | [
"reply",
"with",
"given",
"class",
"or",
"callable",
"for",
"POST",
"request",
"on",
"given",
"path"
] | 7705f129011a81d5cc3c76b4b150fab3dadac6a3 | https://github.com/stubbles/stubbles-webapp-core/blob/7705f129011a81d5cc3c76b4b150fab3dadac6a3/src/main/php/routing/Routing.php#L157-L160 |
16,484 | stubbles/stubbles-webapp-core | src/main/php/routing/Routing.php | Routing.onPut | public function onPut(string $path, $target): ConfigurableRoute
{
return $this->addRoute(new Route($path, $target, 'PUT'));
} | php | public function onPut(string $path, $target): ConfigurableRoute
{
return $this->addRoute(new Route($path, $target, 'PUT'));
} | [
"public",
"function",
"onPut",
"(",
"string",
"$",
"path",
",",
"$",
"target",
")",
":",
"ConfigurableRoute",
"{",
"return",
"$",
"this",
"->",
"addRoute",
"(",
"new",
"Route",
"(",
"$",
"path",
",",
"$",
"target",
",",
"'PUT'",
")",
")",
";",
"}"
] | reply with given class or callable for PUT request on given path
@param string $path path this route is applicable for
@param string|callable|\stubbles\webapp\Target $target code to be executed when the route is active
@return \stubbles\webapp\routing\ConfigurableRoute | [
"reply",
"with",
"given",
"class",
"or",
"callable",
"for",
"PUT",
"request",
"on",
"given",
"path"
] | 7705f129011a81d5cc3c76b4b150fab3dadac6a3 | https://github.com/stubbles/stubbles-webapp-core/blob/7705f129011a81d5cc3c76b4b150fab3dadac6a3/src/main/php/routing/Routing.php#L169-L172 |
16,485 | stubbles/stubbles-webapp-core | src/main/php/routing/Routing.php | Routing.onDelete | public function onDelete(string $path, $target): ConfigurableRoute
{
return $this->addRoute(new Route($path, $target, 'DELETE'));
} | php | public function onDelete(string $path, $target): ConfigurableRoute
{
return $this->addRoute(new Route($path, $target, 'DELETE'));
} | [
"public",
"function",
"onDelete",
"(",
"string",
"$",
"path",
",",
"$",
"target",
")",
":",
"ConfigurableRoute",
"{",
"return",
"$",
"this",
"->",
"addRoute",
"(",
"new",
"Route",
"(",
"$",
"path",
",",
"$",
"target",
",",
"'DELETE'",
")",
")",
";",
... | reply with given class or callable for DELETE request on given path
@param string $path path this route is applicable for
@param string|callable|\stubbles\webapp\Target $target code to be executed when the route is active
@return \stubbles\webapp\routing\ConfigurableRoute | [
"reply",
"with",
"given",
"class",
"or",
"callable",
"for",
"DELETE",
"request",
"on",
"given",
"path"
] | 7705f129011a81d5cc3c76b4b150fab3dadac6a3 | https://github.com/stubbles/stubbles-webapp-core/blob/7705f129011a81d5cc3c76b4b150fab3dadac6a3/src/main/php/routing/Routing.php#L181-L184 |
16,486 | stubbles/stubbles-webapp-core | src/main/php/routing/Routing.php | Routing.findResource | public function findResource($uri, string $requestMethod = null): UriResource
{
$calledUri = CalledUri::castFrom($uri, $requestMethod);
$matchingRoutes = $this->routes->match($calledUri);
if ($matchingRoutes->hasExactMatch()) {
return $this->handleMatchingRoute(
... | php | public function findResource($uri, string $requestMethod = null): UriResource
{
$calledUri = CalledUri::castFrom($uri, $requestMethod);
$matchingRoutes = $this->routes->match($calledUri);
if ($matchingRoutes->hasExactMatch()) {
return $this->handleMatchingRoute(
... | [
"public",
"function",
"findResource",
"(",
"$",
"uri",
",",
"string",
"$",
"requestMethod",
"=",
"null",
")",
":",
"UriResource",
"{",
"$",
"calledUri",
"=",
"CalledUri",
"::",
"castFrom",
"(",
"$",
"uri",
",",
"$",
"requestMethod",
")",
";",
"$",
"match... | returns resource which is applicable for given request
@param string|\stubbles\webapp\routing\CalledUri $uri actually called uri
@param string $requestMethod optional when $calledUri is an instance of stubbles\webapp\routing\CalledUri
@return \stubbles\webapp\routi... | [
"returns",
"resource",
"which",
"is",
"applicable",
"for",
"given",
"request"
] | 7705f129011a81d5cc3c76b4b150fab3dadac6a3 | https://github.com/stubbles/stubbles-webapp-core/blob/7705f129011a81d5cc3c76b4b150fab3dadac6a3/src/main/php/routing/Routing.php#L221-L245 |
16,487 | stubbles/stubbles-webapp-core | src/main/php/routing/Routing.php | Routing.handleMatchingRoute | private function handleMatchingRoute(CalledUri $calledUri, Route $route): UriResource
{
if ($route->requiresAuth()) {
return new ProtectedResource(
$route->authConstraint(),
$this->resolveResource($calledUri, $route),
$this->injector
);... | php | private function handleMatchingRoute(CalledUri $calledUri, Route $route): UriResource
{
if ($route->requiresAuth()) {
return new ProtectedResource(
$route->authConstraint(),
$this->resolveResource($calledUri, $route),
$this->injector
);... | [
"private",
"function",
"handleMatchingRoute",
"(",
"CalledUri",
"$",
"calledUri",
",",
"Route",
"$",
"route",
")",
":",
"UriResource",
"{",
"if",
"(",
"$",
"route",
"->",
"requiresAuth",
"(",
")",
")",
"{",
"return",
"new",
"ProtectedResource",
"(",
"$",
"... | creates a processable route for given route
@param \stubbles\webapp\routing\CalledUri $calledUri
@param \stubbles\webapp\routing\Route $route
@return \stubbles\webapp\routing\UriResource | [
"creates",
"a",
"processable",
"route",
"for",
"given",
"route"
] | 7705f129011a81d5cc3c76b4b150fab3dadac6a3 | https://github.com/stubbles/stubbles-webapp-core/blob/7705f129011a81d5cc3c76b4b150fab3dadac6a3/src/main/php/routing/Routing.php#L254-L265 |
16,488 | stubbles/stubbles-webapp-core | src/main/php/routing/Routing.php | Routing.resolveResource | private function resolveResource(CalledUri $calledUri, Route $route): ResolvingResource
{
return new ResolvingResource(
$this->injector,
$calledUri,
$this->collectInterceptors($calledUri, $route),
$this->supportedMimeTypes($route),
... | php | private function resolveResource(CalledUri $calledUri, Route $route): ResolvingResource
{
return new ResolvingResource(
$this->injector,
$calledUri,
$this->collectInterceptors($calledUri, $route),
$this->supportedMimeTypes($route),
... | [
"private",
"function",
"resolveResource",
"(",
"CalledUri",
"$",
"calledUri",
",",
"Route",
"$",
"route",
")",
":",
"ResolvingResource",
"{",
"return",
"new",
"ResolvingResource",
"(",
"$",
"this",
"->",
"injector",
",",
"$",
"calledUri",
",",
"$",
"this",
"... | creates matching route
@param \stubbles\webapp\routing\CalledUri $calledUri
@param \stubbles\webapp\routing\Route $route
@return \stubbles\webapp\routing\ResolvingResource | [
"creates",
"matching",
"route"
] | 7705f129011a81d5cc3c76b4b150fab3dadac6a3 | https://github.com/stubbles/stubbles-webapp-core/blob/7705f129011a81d5cc3c76b4b150fab3dadac6a3/src/main/php/routing/Routing.php#L274-L283 |
16,489 | stubbles/stubbles-webapp-core | src/main/php/routing/Routing.php | Routing.handleNonMethodMatchingRoutes | private function handleNonMethodMatchingRoutes(
CalledUri $calledUri,
MatchingRoutes $matchingRoutes
): UriResource {
if ($calledUri->methodEquals('OPTIONS')) {
return new ResourceOptions(
$this->injector,
$calledUri,
... | php | private function handleNonMethodMatchingRoutes(
CalledUri $calledUri,
MatchingRoutes $matchingRoutes
): UriResource {
if ($calledUri->methodEquals('OPTIONS')) {
return new ResourceOptions(
$this->injector,
$calledUri,
... | [
"private",
"function",
"handleNonMethodMatchingRoutes",
"(",
"CalledUri",
"$",
"calledUri",
",",
"MatchingRoutes",
"$",
"matchingRoutes",
")",
":",
"UriResource",
"{",
"if",
"(",
"$",
"calledUri",
"->",
"methodEquals",
"(",
"'OPTIONS'",
")",
")",
"{",
"return",
... | creates a processable route when a route can be found regardless of request method
@param \stubbles\webapp\routing\CalledUri $calledUri
@param \stubbles\webapp\routing\MatchingRoutes $matchingRoutes
@return \stubbles\webapp\routing\UriResource | [
"creates",
"a",
"processable",
"route",
"when",
"a",
"route",
"can",
"be",
"found",
"regardless",
"of",
"request",
"method"
] | 7705f129011a81d5cc3c76b4b150fab3dadac6a3 | https://github.com/stubbles/stubbles-webapp-core/blob/7705f129011a81d5cc3c76b4b150fab3dadac6a3/src/main/php/routing/Routing.php#L292-L314 |
16,490 | stubbles/stubbles-webapp-core | src/main/php/routing/Routing.php | Routing.preInterceptOnGet | public function preInterceptOnGet($preInterceptor, string $path = null): RoutingConfigurator
{
return $this->preIntercept($preInterceptor, $path, 'GET');
} | php | public function preInterceptOnGet($preInterceptor, string $path = null): RoutingConfigurator
{
return $this->preIntercept($preInterceptor, $path, 'GET');
} | [
"public",
"function",
"preInterceptOnGet",
"(",
"$",
"preInterceptor",
",",
"string",
"$",
"path",
"=",
"null",
")",
":",
"RoutingConfigurator",
"{",
"return",
"$",
"this",
"->",
"preIntercept",
"(",
"$",
"preInterceptor",
",",
"$",
"path",
",",
"'GET'",
")"... | pre intercept with given class or callable on all GET requests
@param string|callable|\stubbles\webapp\intercepto\PreInterceptor $preInterceptor pre interceptor to add
@param string $path optional path for which pre interceptor should be executed
@... | [
"pre",
"intercept",
"with",
"given",
"class",
"or",
"callable",
"on",
"all",
"GET",
"requests"
] | 7705f129011a81d5cc3c76b4b150fab3dadac6a3 | https://github.com/stubbles/stubbles-webapp-core/blob/7705f129011a81d5cc3c76b4b150fab3dadac6a3/src/main/php/routing/Routing.php#L323-L326 |
16,491 | stubbles/stubbles-webapp-core | src/main/php/routing/Routing.php | Routing.preInterceptOnHead | public function preInterceptOnHead($preInterceptor, string $path = null): RoutingConfigurator
{
return $this->preIntercept($preInterceptor, $path, 'HEAD');
} | php | public function preInterceptOnHead($preInterceptor, string $path = null): RoutingConfigurator
{
return $this->preIntercept($preInterceptor, $path, 'HEAD');
} | [
"public",
"function",
"preInterceptOnHead",
"(",
"$",
"preInterceptor",
",",
"string",
"$",
"path",
"=",
"null",
")",
":",
"RoutingConfigurator",
"{",
"return",
"$",
"this",
"->",
"preIntercept",
"(",
"$",
"preInterceptor",
",",
"$",
"path",
",",
"'HEAD'",
"... | pre intercept with given class or callable on all HEAD requests
@param string|callable|\stubbles\webapp\interceptor\PreInterceptor $preInterceptor pre interceptor to add
@param string $path optional path for which pre interceptor should be execute... | [
"pre",
"intercept",
"with",
"given",
"class",
"or",
"callable",
"on",
"all",
"HEAD",
"requests"
] | 7705f129011a81d5cc3c76b4b150fab3dadac6a3 | https://github.com/stubbles/stubbles-webapp-core/blob/7705f129011a81d5cc3c76b4b150fab3dadac6a3/src/main/php/routing/Routing.php#L335-L338 |
16,492 | stubbles/stubbles-webapp-core | src/main/php/routing/Routing.php | Routing.preInterceptOnPost | public function preInterceptOnPost($preInterceptor, string $path = null): RoutingConfigurator
{
return $this->preIntercept($preInterceptor, $path, 'POST');
} | php | public function preInterceptOnPost($preInterceptor, string $path = null): RoutingConfigurator
{
return $this->preIntercept($preInterceptor, $path, 'POST');
} | [
"public",
"function",
"preInterceptOnPost",
"(",
"$",
"preInterceptor",
",",
"string",
"$",
"path",
"=",
"null",
")",
":",
"RoutingConfigurator",
"{",
"return",
"$",
"this",
"->",
"preIntercept",
"(",
"$",
"preInterceptor",
",",
"$",
"path",
",",
"'POST'",
"... | pre intercept with given class or callable on all POST requests
@param string|callable|\stubbles\webapp\interceptor\PreInterceptor $preInterceptor pre interceptor to add
@param string $path optional path for which pre interceptor should be execute... | [
"pre",
"intercept",
"with",
"given",
"class",
"or",
"callable",
"on",
"all",
"POST",
"requests"
] | 7705f129011a81d5cc3c76b4b150fab3dadac6a3 | https://github.com/stubbles/stubbles-webapp-core/blob/7705f129011a81d5cc3c76b4b150fab3dadac6a3/src/main/php/routing/Routing.php#L347-L350 |
16,493 | stubbles/stubbles-webapp-core | src/main/php/routing/Routing.php | Routing.preInterceptOnPut | public function preInterceptOnPut($preInterceptor, string $path = null): RoutingConfigurator
{
return $this->preIntercept($preInterceptor, $path, 'PUT');
} | php | public function preInterceptOnPut($preInterceptor, string $path = null): RoutingConfigurator
{
return $this->preIntercept($preInterceptor, $path, 'PUT');
} | [
"public",
"function",
"preInterceptOnPut",
"(",
"$",
"preInterceptor",
",",
"string",
"$",
"path",
"=",
"null",
")",
":",
"RoutingConfigurator",
"{",
"return",
"$",
"this",
"->",
"preIntercept",
"(",
"$",
"preInterceptor",
",",
"$",
"path",
",",
"'PUT'",
")"... | pre intercept with given class or callable on all PUT requests
@param string|callable|\stubbles\webapp\interceptor\PreInterceptor $preInterceptor pre interceptor to add
@param string $path optional path for which pre interceptor should be executed... | [
"pre",
"intercept",
"with",
"given",
"class",
"or",
"callable",
"on",
"all",
"PUT",
"requests"
] | 7705f129011a81d5cc3c76b4b150fab3dadac6a3 | https://github.com/stubbles/stubbles-webapp-core/blob/7705f129011a81d5cc3c76b4b150fab3dadac6a3/src/main/php/routing/Routing.php#L359-L362 |
16,494 | stubbles/stubbles-webapp-core | src/main/php/routing/Routing.php | Routing.preInterceptOnDelete | public function preInterceptOnDelete($preInterceptor, string $path = null): RoutingConfigurator
{
return $this->preIntercept($preInterceptor, $path, 'DELETE');
} | php | public function preInterceptOnDelete($preInterceptor, string $path = null): RoutingConfigurator
{
return $this->preIntercept($preInterceptor, $path, 'DELETE');
} | [
"public",
"function",
"preInterceptOnDelete",
"(",
"$",
"preInterceptor",
",",
"string",
"$",
"path",
"=",
"null",
")",
":",
"RoutingConfigurator",
"{",
"return",
"$",
"this",
"->",
"preIntercept",
"(",
"$",
"preInterceptor",
",",
"$",
"path",
",",
"'DELETE'",... | pre intercept with given class or callable on all DELETE requests
@param string|callable|\stubbles\webapp\interceptor\PreInterceptor $preInterceptor pre interceptor to add
@param string $path optional path for which pre interceptor should be execu... | [
"pre",
"intercept",
"with",
"given",
"class",
"or",
"callable",
"on",
"all",
"DELETE",
"requests"
] | 7705f129011a81d5cc3c76b4b150fab3dadac6a3 | https://github.com/stubbles/stubbles-webapp-core/blob/7705f129011a81d5cc3c76b4b150fab3dadac6a3/src/main/php/routing/Routing.php#L371-L374 |
16,495 | stubbles/stubbles-webapp-core | src/main/php/routing/Routing.php | Routing.preIntercept | public function preIntercept($preInterceptor, string $path = null, string $requestMethod = null): RoutingConfigurator
{
if (!is_callable($preInterceptor) && !($preInterceptor instanceof PreInterceptor) && !class_exists((string) $preInterceptor)) {
throw new \InvalidArgumentException(
... | php | public function preIntercept($preInterceptor, string $path = null, string $requestMethod = null): RoutingConfigurator
{
if (!is_callable($preInterceptor) && !($preInterceptor instanceof PreInterceptor) && !class_exists((string) $preInterceptor)) {
throw new \InvalidArgumentException(
... | [
"public",
"function",
"preIntercept",
"(",
"$",
"preInterceptor",
",",
"string",
"$",
"path",
"=",
"null",
",",
"string",
"$",
"requestMethod",
"=",
"null",
")",
":",
"RoutingConfigurator",
"{",
"if",
"(",
"!",
"is_callable",
"(",
"$",
"preInterceptor",
")",... | pre intercept with given class or callable on all requests
@param string|callable|\stubbles\webapp\interceptor\PreInterceptor $preInterceptor pre interceptor to add
@param string $path optional path for which pre interceptor should be executed
@pa... | [
"pre",
"intercept",
"with",
"given",
"class",
"or",
"callable",
"on",
"all",
"requests"
] | 7705f129011a81d5cc3c76b4b150fab3dadac6a3 | https://github.com/stubbles/stubbles-webapp-core/blob/7705f129011a81d5cc3c76b4b150fab3dadac6a3/src/main/php/routing/Routing.php#L385-L401 |
16,496 | stubbles/stubbles-webapp-core | src/main/php/routing/Routing.php | Routing.postInterceptOnGet | public function postInterceptOnGet($postInterceptor, string $path = null): RoutingConfigurator
{
return $this->postIntercept($postInterceptor, $path, 'GET');
} | php | public function postInterceptOnGet($postInterceptor, string $path = null): RoutingConfigurator
{
return $this->postIntercept($postInterceptor, $path, 'GET');
} | [
"public",
"function",
"postInterceptOnGet",
"(",
"$",
"postInterceptor",
",",
"string",
"$",
"path",
"=",
"null",
")",
":",
"RoutingConfigurator",
"{",
"return",
"$",
"this",
"->",
"postIntercept",
"(",
"$",
"postInterceptor",
",",
"$",
"path",
",",
"'GET'",
... | post intercept with given class or callable on all GET requests
@param string|callable|\stubbles\webapp\interceptor\PostInterceptor $postInterceptor post interceptor to add
@param string $path optional path for which post interceptor should be e... | [
"post",
"intercept",
"with",
"given",
"class",
"or",
"callable",
"on",
"all",
"GET",
"requests"
] | 7705f129011a81d5cc3c76b4b150fab3dadac6a3 | https://github.com/stubbles/stubbles-webapp-core/blob/7705f129011a81d5cc3c76b4b150fab3dadac6a3/src/main/php/routing/Routing.php#L410-L413 |
16,497 | stubbles/stubbles-webapp-core | src/main/php/routing/Routing.php | Routing.postInterceptOnHead | public function postInterceptOnHead($postInterceptor, string $path = null): RoutingConfigurator
{
return $this->postIntercept($postInterceptor, $path, 'HEAD');
} | php | public function postInterceptOnHead($postInterceptor, string $path = null): RoutingConfigurator
{
return $this->postIntercept($postInterceptor, $path, 'HEAD');
} | [
"public",
"function",
"postInterceptOnHead",
"(",
"$",
"postInterceptor",
",",
"string",
"$",
"path",
"=",
"null",
")",
":",
"RoutingConfigurator",
"{",
"return",
"$",
"this",
"->",
"postIntercept",
"(",
"$",
"postInterceptor",
",",
"$",
"path",
",",
"'HEAD'",... | post intercept with given class or callable on all HEAD requests
@param string|callable|\stubbles\webapp\interceptor\PostInterceptor $postInterceptor post interceptor to add
@param string $path optional path for which post interceptor should be ... | [
"post",
"intercept",
"with",
"given",
"class",
"or",
"callable",
"on",
"all",
"HEAD",
"requests"
] | 7705f129011a81d5cc3c76b4b150fab3dadac6a3 | https://github.com/stubbles/stubbles-webapp-core/blob/7705f129011a81d5cc3c76b4b150fab3dadac6a3/src/main/php/routing/Routing.php#L422-L425 |
16,498 | stubbles/stubbles-webapp-core | src/main/php/routing/Routing.php | Routing.postInterceptOnPost | public function postInterceptOnPost($postInterceptor, string $path = null): RoutingConfigurator
{
return $this->postIntercept($postInterceptor, $path, 'POST');
} | php | public function postInterceptOnPost($postInterceptor, string $path = null): RoutingConfigurator
{
return $this->postIntercept($postInterceptor, $path, 'POST');
} | [
"public",
"function",
"postInterceptOnPost",
"(",
"$",
"postInterceptor",
",",
"string",
"$",
"path",
"=",
"null",
")",
":",
"RoutingConfigurator",
"{",
"return",
"$",
"this",
"->",
"postIntercept",
"(",
"$",
"postInterceptor",
",",
"$",
"path",
",",
"'POST'",... | post intercept with given class or callable on all POST requests
@param string|callable|\stubbles\webapp\interceptor\PostInterceptor $postInterceptor post interceptor to add
@param string $path optional path for which post interceptor should be ... | [
"post",
"intercept",
"with",
"given",
"class",
"or",
"callable",
"on",
"all",
"POST",
"requests"
] | 7705f129011a81d5cc3c76b4b150fab3dadac6a3 | https://github.com/stubbles/stubbles-webapp-core/blob/7705f129011a81d5cc3c76b4b150fab3dadac6a3/src/main/php/routing/Routing.php#L434-L437 |
16,499 | stubbles/stubbles-webapp-core | src/main/php/routing/Routing.php | Routing.postInterceptOnPut | public function postInterceptOnPut($postInterceptor, string $path = null): RoutingConfigurator
{
return $this->postIntercept($postInterceptor, $path, 'PUT');
} | php | public function postInterceptOnPut($postInterceptor, string $path = null): RoutingConfigurator
{
return $this->postIntercept($postInterceptor, $path, 'PUT');
} | [
"public",
"function",
"postInterceptOnPut",
"(",
"$",
"postInterceptor",
",",
"string",
"$",
"path",
"=",
"null",
")",
":",
"RoutingConfigurator",
"{",
"return",
"$",
"this",
"->",
"postIntercept",
"(",
"$",
"postInterceptor",
",",
"$",
"path",
",",
"'PUT'",
... | post intercept with given class or callable on all PUT requests
@param string|callable|\stubbles\webapp\interceptor\PostInterceptor $postInterceptor post interceptor to add
@param string $path optional path for which post interceptor should be e... | [
"post",
"intercept",
"with",
"given",
"class",
"or",
"callable",
"on",
"all",
"PUT",
"requests"
] | 7705f129011a81d5cc3c76b4b150fab3dadac6a3 | https://github.com/stubbles/stubbles-webapp-core/blob/7705f129011a81d5cc3c76b4b150fab3dadac6a3/src/main/php/routing/Routing.php#L446-L449 |
Subsets and Splits
Yii Code Samples
Gathers all records from test, train, and validation sets that contain the word 'yii', providing a basic filtered view of the dataset relevant to Yii-related content.