repository_name stringlengths 5 67 | func_path_in_repository stringlengths 4 234 | func_name stringlengths 0 314 | whole_func_string stringlengths 52 3.87M | language stringclasses 6
values | func_code_string stringlengths 52 3.87M | func_code_tokens listlengths 15 672k | func_documentation_string stringlengths 1 47.2k | func_documentation_tokens listlengths 1 3.92k | split_name stringclasses 1
value | func_code_url stringlengths 85 339 |
|---|---|---|---|---|---|---|---|---|---|---|
Vectrex/vxPHP | src/Database/Util.php | Util.getAlias | public static function getAlias(DatabaseInterface $connection, $aliasText, $tableName, $id = 0, $column = 'alias') {
$replace = [
'~(ä|ä)~' => 'ae',
'~(ö|ö)~' => 'oe',
'~(ü|ü)~' => 'ue',
'~(ß|ß)~' => 'ss',
'~\W+~' => '_',
'~(^_+|_+$)~' => ''
];
$primaryKeyName = $conne... | php | public static function getAlias(DatabaseInterface $connection, $aliasText, $tableName, $id = 0, $column = 'alias') {
$replace = [
'~(ä|ä)~' => 'ae',
'~(ö|ö)~' => 'oe',
'~(ü|ü)~' => 'ue',
'~(ß|ß)~' => 'ss',
'~\W+~' => '_',
'~(^_+|_+$)~' => ''
];
$primaryKeyName = $conne... | [
"public",
"static",
"function",
"getAlias",
"(",
"DatabaseInterface",
"$",
"connection",
",",
"$",
"aliasText",
",",
"$",
"tableName",
",",
"$",
"id",
"=",
"0",
",",
"$",
"column",
"=",
"'alias'",
")",
"{",
"$",
"replace",
"=",
"[",
"'~(ä|ä)~'\t",
"... | checks whether $aliasText in $column is already present
if $aliasText is found, numeric increments are added to it
if $id is set, this record is left out from checking
returns string which is unique in $column
currently works only with single-field primary keys
@param DatabaseInterface $connection
@param string $alia... | [
"checks",
"whether",
"$aliasText",
"in",
"$column",
"is",
"already",
"present",
"if",
"$aliasText",
"is",
"found",
"numeric",
"increments",
"are",
"added",
"to",
"it",
"if",
"$id",
"is",
"set",
"this",
"record",
"is",
"left",
"out",
"from",
"checking",
"retu... | train | https://github.com/Vectrex/vxPHP/blob/295c21b00e7ef6085efcdf5b64fabb28d499b5a6/src/Database/Util.php#L130-L170 |
raykolbe/CKEditorModule | src/CKEditorModule/View/Helper/CKEditor.php | CKEditor.getRenderedEditor | public function getRenderedEditor($id, array $options = array())
{
$config = clone $this->options;
$config->setFromArray($options);
$basePath = $this->getView()->basePath($config->getBasePath());
$editor = new \CKEditor($basePath);
return $editor->replace($i... | php | public function getRenderedEditor($id, array $options = array())
{
$config = clone $this->options;
$config->setFromArray($options);
$basePath = $this->getView()->basePath($config->getBasePath());
$editor = new \CKEditor($basePath);
return $editor->replace($i... | [
"public",
"function",
"getRenderedEditor",
"(",
"$",
"id",
",",
"array",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"$",
"config",
"=",
"clone",
"$",
"this",
"->",
"options",
";",
"$",
"config",
"->",
"setFromArray",
"(",
"$",
"options",
")",
... | Generates output needed for CKEditor.
@param string $id The DOM ID to apply this editor to.
@param array $options An array of options specific to this instance.
@return string The HTML output. | [
"Generates",
"output",
"needed",
"for",
"CKEditor",
"."
] | train | https://github.com/raykolbe/CKEditorModule/blob/5088cc4ab085ee1e4ba9ee9d0209c27082c90259/src/CKEditorModule/View/Helper/CKEditor.php#L81-L90 |
raykolbe/CKEditorModule | src/CKEditorModule/View/Helper/CKEditor.php | CKEditor.optionsToCKEditorConfig | protected function optionsToCKEditorConfig(Options $options)
{
$config = array();
foreach ($options->toArray() as $key => $value) {
if (!array_key_exists($key, static::$optionsToConfigMap)) {
continue;
}
if (in_array($key, static::$opt... | php | protected function optionsToCKEditorConfig(Options $options)
{
$config = array();
foreach ($options->toArray() as $key => $value) {
if (!array_key_exists($key, static::$optionsToConfigMap)) {
continue;
}
if (in_array($key, static::$opt... | [
"protected",
"function",
"optionsToCKEditorConfig",
"(",
"Options",
"$",
"options",
")",
"{",
"$",
"config",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"options",
"->",
"toArray",
"(",
")",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"if",
... | Translates our internal Options object into a usable config array
for CKEditor.
@param \CKEditor\Options $options
@return array | [
"Translates",
"our",
"internal",
"Options",
"object",
"into",
"a",
"usable",
"config",
"array",
"for",
"CKEditor",
"."
] | train | https://github.com/raykolbe/CKEditorModule/blob/5088cc4ab085ee1e4ba9ee9d0209c27082c90259/src/CKEditorModule/View/Helper/CKEditor.php#L99-L121 |
Kris-Kuiper/sFire-Framework | src/Cache/Cache.php | Cache.setDriver | public function setDriver($driver) {
if(false === is_string($driver)) {
return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($driver)), E_USER_ERROR);
}
if(false === class_exists($driver)) {
$driver = __NAMESP... | php | public function setDriver($driver) {
if(false === is_string($driver)) {
return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($driver)), E_USER_ERROR);
}
if(false === class_exists($driver)) {
$driver = __NAMESP... | [
"public",
"function",
"setDriver",
"(",
"$",
"driver",
")",
"{",
"if",
"(",
"false",
"===",
"is_string",
"(",
"$",
"driver",
")",
")",
"{",
"return",
"trigger_error",
"(",
"sprintf",
"(",
"'Argument 1 passed to %s() must be of the type string, \"%s\" given'",
",",
... | Sets the driver
@param string $driver
@return sFire\Cache\Cache | [
"Sets",
"the",
"driver"
] | train | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/Cache/Cache.php#L34-L52 |
Kris-Kuiper/sFire-Framework | src/Cache/Cache.php | Cache.set | public function set($key, $value, $expiration = 300) {
if(false === ('-' . intval($expiration) == '-' . $expiration)) {
return trigger_error(sprintf('Argument 3 passed to %s() must be of the type integer, "%s" given', __METHOD__, gettype($expiration)), E_USER_ERROR);
}
$this -> call() -> set... | php | public function set($key, $value, $expiration = 300) {
if(false === ('-' . intval($expiration) == '-' . $expiration)) {
return trigger_error(sprintf('Argument 3 passed to %s() must be of the type integer, "%s" given', __METHOD__, gettype($expiration)), E_USER_ERROR);
}
$this -> call() -> set... | [
"public",
"function",
"set",
"(",
"$",
"key",
",",
"$",
"value",
",",
"$",
"expiration",
"=",
"300",
")",
"{",
"if",
"(",
"false",
"===",
"(",
"'-'",
".",
"intval",
"(",
"$",
"expiration",
")",
"==",
"'-'",
".",
"$",
"expiration",
")",
")",
"{",
... | Set new cache by key name
@param mixed $key
@param mixed $value
@param int $expiration
@return sFire\Cache\Cache | [
"Set",
"new",
"cache",
"by",
"key",
"name"
] | train | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/Cache/Cache.php#L62-L70 |
Kris-Kuiper/sFire-Framework | src/Cache/Cache.php | Cache.touch | public function touch($key, $expiration = null) {
if(null !== $expiration && false === ('-' . intval($expiration) == '-' . $expiration)) {
return trigger_error(sprintf('Argument 2 passed to %s() must be of the type integer, "%s" given', __METHOD__, gettype($expiration)), E_USER_ERROR);
}
$this -> ca... | php | public function touch($key, $expiration = null) {
if(null !== $expiration && false === ('-' . intval($expiration) == '-' . $expiration)) {
return trigger_error(sprintf('Argument 2 passed to %s() must be of the type integer, "%s" given', __METHOD__, gettype($expiration)), E_USER_ERROR);
}
$this -> ca... | [
"public",
"function",
"touch",
"(",
"$",
"key",
",",
"$",
"expiration",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"expiration",
"&&",
"false",
"===",
"(",
"'-'",
".",
"intval",
"(",
"$",
"expiration",
")",
"==",
"'-'",
".",
"$",
"expira... | Reset lifetime of a cached file
@param mixed $key
@param int $expiration
@return sFire\Cache\Cache | [
"Reset",
"lifetime",
"of",
"a",
"cached",
"file"
] | train | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/Cache/Cache.php#L113-L121 |
Kris-Kuiper/sFire-Framework | src/Cache/Cache.php | Cache.call | private function call() {
if(null === $this -> driver) {
return trigger_error('Driver is not set. Set the driver with the setDriver() method', E_USER_ERROR);
}
if(null === $this -> driverInstance) {
$this -> driverInstance = new $this -> driver();
}
... | php | private function call() {
if(null === $this -> driver) {
return trigger_error('Driver is not set. Set the driver with the setDriver() method', E_USER_ERROR);
}
if(null === $this -> driverInstance) {
$this -> driverInstance = new $this -> driver();
}
... | [
"private",
"function",
"call",
"(",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"driver",
")",
"{",
"return",
"trigger_error",
"(",
"'Driver is not set. Set the driver with the setDriver() method'",
",",
"E_USER_ERROR",
")",
";",
"}",
"if",
"(",
"null... | Check if driver is set and returns it
@return mixed | [
"Check",
"if",
"driver",
"is",
"set",
"and",
"returns",
"it"
] | train | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/Cache/Cache.php#L137-L148 |
dms-org/common.structure | src/DateTime/TimeRange.php | TimeRange.contains | public function contains(TimeOfDay $time) : bool
{
return $this->start->isEarlierThanOrEqual($time) && $this->end->isLaterThanOrEqual($time);
} | php | public function contains(TimeOfDay $time) : bool
{
return $this->start->isEarlierThanOrEqual($time) && $this->end->isLaterThanOrEqual($time);
} | [
"public",
"function",
"contains",
"(",
"TimeOfDay",
"$",
"time",
")",
":",
"bool",
"{",
"return",
"$",
"this",
"->",
"start",
"->",
"isEarlierThanOrEqual",
"(",
"$",
"time",
")",
"&&",
"$",
"this",
"->",
"end",
"->",
"isLaterThanOrEqual",
"(",
"$",
"time... | Returns whether the supplied time is within (inclusive) the time range.
@param TimeOfDay $time
@return bool | [
"Returns",
"whether",
"the",
"supplied",
"time",
"is",
"within",
"(",
"inclusive",
")",
"the",
"time",
"range",
"."
] | train | https://github.com/dms-org/common.structure/blob/23f122182f60df5ec847047a81a39c8aab019ff1/src/DateTime/TimeRange.php#L68-L71 |
dms-org/common.structure | src/DateTime/TimeRange.php | TimeRange.containsExclusive | public function containsExclusive(TimeOfDay $time) : bool
{
return $this->start->isEarlierThan($time) && $this->end->isLaterThan($time);
} | php | public function containsExclusive(TimeOfDay $time) : bool
{
return $this->start->isEarlierThan($time) && $this->end->isLaterThan($time);
} | [
"public",
"function",
"containsExclusive",
"(",
"TimeOfDay",
"$",
"time",
")",
":",
"bool",
"{",
"return",
"$",
"this",
"->",
"start",
"->",
"isEarlierThan",
"(",
"$",
"time",
")",
"&&",
"$",
"this",
"->",
"end",
"->",
"isLaterThan",
"(",
"$",
"time",
... | Returns whether the supplied time is within (exclusive) the time range.
@param TimeOfDay $time
@return bool | [
"Returns",
"whether",
"the",
"supplied",
"time",
"is",
"within",
"(",
"exclusive",
")",
"the",
"time",
"range",
"."
] | train | https://github.com/dms-org/common.structure/blob/23f122182f60df5ec847047a81a39c8aab019ff1/src/DateTime/TimeRange.php#L80-L83 |
dms-org/common.structure | src/DateTime/TimeRange.php | TimeRange.encompasses | public function encompasses(TimeRange $otherRange) : bool
{
return $this->start->isEarlierThanOrEqual($otherRange->start) && $this->end->isLaterThanOrEqual($otherRange->end);
} | php | public function encompasses(TimeRange $otherRange) : bool
{
return $this->start->isEarlierThanOrEqual($otherRange->start) && $this->end->isLaterThanOrEqual($otherRange->end);
} | [
"public",
"function",
"encompasses",
"(",
"TimeRange",
"$",
"otherRange",
")",
":",
"bool",
"{",
"return",
"$",
"this",
"->",
"start",
"->",
"isEarlierThanOrEqual",
"(",
"$",
"otherRange",
"->",
"start",
")",
"&&",
"$",
"this",
"->",
"end",
"->",
"isLaterT... | Returns whether the supplied time range is encompassed by this
time range.
@param TimeRange $otherRange
@return bool | [
"Returns",
"whether",
"the",
"supplied",
"time",
"range",
"is",
"encompassed",
"by",
"this",
"time",
"range",
"."
] | train | https://github.com/dms-org/common.structure/blob/23f122182f60df5ec847047a81a39c8aab019ff1/src/DateTime/TimeRange.php#L93-L96 |
dms-org/common.structure | src/DateTime/TimeRange.php | TimeRange.overlapsExclusive | public function overlapsExclusive(TimeRange $otherRange) : bool
{
return $this->containsExclusive($otherRange->start) || $this->containsExclusive($otherRange->end)
|| $this->encompasses($otherRange)
|| $otherRange->encompasses($this);
} | php | public function overlapsExclusive(TimeRange $otherRange) : bool
{
return $this->containsExclusive($otherRange->start) || $this->containsExclusive($otherRange->end)
|| $this->encompasses($otherRange)
|| $otherRange->encompasses($this);
} | [
"public",
"function",
"overlapsExclusive",
"(",
"TimeRange",
"$",
"otherRange",
")",
":",
"bool",
"{",
"return",
"$",
"this",
"->",
"containsExclusive",
"(",
"$",
"otherRange",
"->",
"start",
")",
"||",
"$",
"this",
"->",
"containsExclusive",
"(",
"$",
"othe... | Returns whether the supplied time range overlaps (exclusive) this time range.
@param TimeRange $otherRange
@return bool | [
"Returns",
"whether",
"the",
"supplied",
"time",
"range",
"overlaps",
"(",
"exclusive",
")",
"this",
"time",
"range",
"."
] | train | https://github.com/dms-org/common.structure/blob/23f122182f60df5ec847047a81a39c8aab019ff1/src/DateTime/TimeRange.php#L119-L124 |
fulgurio/LightCMSBundle | Utils/LightCMSUtils.php | LightCMSUtils.getUploadDir | static function getUploadDir($withUploadUrl = TRUE)
{
$dir = __DIR__ . '/../../../../web/';
if (!is_dir($dir))
{
$dir = __DIR__ . '/../../../../../web';
if (!is_dir($dir))
{
$dir = __DIR__ . '/../../../../../../web';
if (!is... | php | static function getUploadDir($withUploadUrl = TRUE)
{
$dir = __DIR__ . '/../../../../web/';
if (!is_dir($dir))
{
$dir = __DIR__ . '/../../../../../web';
if (!is_dir($dir))
{
$dir = __DIR__ . '/../../../../../../web';
if (!is... | [
"static",
"function",
"getUploadDir",
"(",
"$",
"withUploadUrl",
"=",
"TRUE",
")",
"{",
"$",
"dir",
"=",
"__DIR__",
".",
"'/../../../../web/'",
";",
"if",
"(",
"!",
"is_dir",
"(",
"$",
"dir",
")",
")",
"{",
"$",
"dir",
"=",
"__DIR__",
".",
"'/../../../... | Get upload file dir
@throws \Exception | [
"Get",
"upload",
"file",
"dir"
] | train | https://github.com/fulgurio/LightCMSBundle/blob/66319af52b97b6552b7c391ee370538263f42d10/Utils/LightCMSUtils.php#L23-L50 |
fulgurio/LightCMSBundle | Utils/LightCMSUtils.php | LightCMSUtils.getThumbFilename | static public function getThumbFilename($filename, $mimeType, $size)
{
if (substr($mimeType, 0, 5) == 'image')
{
$pos = mb_strrpos($filename, '.');
if ($pos === FALSE)
{
return $filename . '_' . $size['width'] . 'x' . $size['height'];
}... | php | static public function getThumbFilename($filename, $mimeType, $size)
{
if (substr($mimeType, 0, 5) == 'image')
{
$pos = mb_strrpos($filename, '.');
if ($pos === FALSE)
{
return $filename . '_' . $size['width'] . 'x' . $size['height'];
}... | [
"static",
"public",
"function",
"getThumbFilename",
"(",
"$",
"filename",
",",
"$",
"mimeType",
",",
"$",
"size",
")",
"{",
"if",
"(",
"substr",
"(",
"$",
"mimeType",
",",
"0",
",",
"5",
")",
"==",
"'image'",
")",
"{",
"$",
"pos",
"=",
"mb_strrpos",
... | Get thumb filename for a specified size
@param string $filename
@param string $mimeType
@param array $size Contains width and height
@return string | [
"Get",
"thumb",
"filename",
"for",
"a",
"specified",
"size"
] | train | https://github.com/fulgurio/LightCMSBundle/blob/66319af52b97b6552b7c391ee370538263f42d10/Utils/LightCMSUtils.php#L70-L92 |
fulgurio/LightCMSBundle | Utils/LightCMSUtils.php | LightCMSUtils.cropPicture | static function cropPicture($sourcefile, $destfile, $fw, $fh, $jpegquality = 80)
{
list($ow, $oh, $from_type) = getimagesize($sourcefile);
switch($from_type)
{
case 1: // GIF
$srcImage = imageCreateFromGif($sourcefile) or die('Impossible de convertir cette image')... | php | static function cropPicture($sourcefile, $destfile, $fw, $fh, $jpegquality = 80)
{
list($ow, $oh, $from_type) = getimagesize($sourcefile);
switch($from_type)
{
case 1: // GIF
$srcImage = imageCreateFromGif($sourcefile) or die('Impossible de convertir cette image')... | [
"static",
"function",
"cropPicture",
"(",
"$",
"sourcefile",
",",
"$",
"destfile",
",",
"$",
"fw",
",",
"$",
"fh",
",",
"$",
"jpegquality",
"=",
"80",
")",
"{",
"list",
"(",
"$",
"ow",
",",
"$",
"oh",
",",
"$",
"from_type",
")",
"=",
"getimagesize"... | Image cropper
@param string $sourcefile
@param string $destfile
@param number $fw
@param number $fh
@param number $jpegquality
@todo : use Exception | [
"Image",
"cropper"
] | train | https://github.com/fulgurio/LightCMSBundle/blob/66319af52b97b6552b7c391ee370538263f42d10/Utils/LightCMSUtils.php#L104-L135 |
fulgurio/LightCMSBundle | Utils/LightCMSUtils.php | LightCMSUtils.makeSlug | static public function makeSlug($title, $isFile = FALSE)
{
$slug = strtr(
utf8_decode(mb_strtolower($title, 'UTF-8')),
utf8_decode(
'àáâãäåòóôõöøèéêëçìíîïùúûüÿñ'),
'aaaaaaooooooeeeeciiiiuuuuyn');
if ($isFile)
{
... | php | static public function makeSlug($title, $isFile = FALSE)
{
$slug = strtr(
utf8_decode(mb_strtolower($title, 'UTF-8')),
utf8_decode(
'àáâãäåòóôõöøèéêëçìíîïùúûüÿñ'),
'aaaaaaooooooeeeeciiiiuuuuyn');
if ($isFile)
{
... | [
"static",
"public",
"function",
"makeSlug",
"(",
"$",
"title",
",",
"$",
"isFile",
"=",
"FALSE",
")",
"{",
"$",
"slug",
"=",
"strtr",
"(",
"utf8_decode",
"(",
"mb_strtolower",
"(",
"$",
"title",
",",
"'UTF-8'",
")",
")",
",",
"utf8_decode",
"(",
"'àáâã... | Generate slug
@param string $title
@param boolean $isFile Allow "_" and "." characters if TRUE
@return string | [
"Generate",
"slug"
] | train | https://github.com/fulgurio/LightCMSBundle/blob/66319af52b97b6552b7c391ee370538263f42d10/Utils/LightCMSUtils.php#L144-L156 |
mwyatt/core | src/Cookie.php | Cookie.set | public function set($key, $value, $time)
{
if (isset($_COOKIE[$key])) {
setcookie($key, $value);
} else {
setcookie($key, $value, $time);
}
} | php | public function set($key, $value, $time)
{
if (isset($_COOKIE[$key])) {
setcookie($key, $value);
} else {
setcookie($key, $value, $time);
}
} | [
"public",
"function",
"set",
"(",
"$",
"key",
",",
"$",
"value",
",",
"$",
"time",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"_COOKIE",
"[",
"$",
"key",
"]",
")",
")",
"{",
"setcookie",
"(",
"$",
"key",
",",
"$",
"value",
")",
";",
"}",
"else",... | If output exists prior to calling this function, setcookie() will fail
and return FALSE. If setcookie() successfully runs, it will return
TRUE. This does not indicate whether the user accepted the cookie.
updates the cookie if already set
@param string $key
@param string $value
@param int $time epoch | [
"If",
"output",
"exists",
"prior",
"to",
"calling",
"this",
"function",
"setcookie",
"()",
"will",
"fail",
"and",
"return",
"FALSE",
".",
"If",
"setcookie",
"()",
"successfully",
"runs",
"it",
"will",
"return",
"TRUE",
".",
"This",
"does",
"not",
"indicate",... | train | https://github.com/mwyatt/core/blob/8ea9d67cc84fe6aff17a469c703d5492dbcd93ed/src/Cookie.php#L26-L33 |
koolkode/view | src/AbstractViewRenderer.php | AbstractViewRenderer.partial | protected function partial($resource, array $data = [])
{
if($resource instanceof ViewModelInterface)
{
return $this->view->render($resource, true);
}
return $this->view->render(new ViewModel($this->view->resolveResourcePath($resource), $data), true);
} | php | protected function partial($resource, array $data = [])
{
if($resource instanceof ViewModelInterface)
{
return $this->view->render($resource, true);
}
return $this->view->render(new ViewModel($this->view->resolveResourcePath($resource), $data), true);
} | [
"protected",
"function",
"partial",
"(",
"$",
"resource",
",",
"array",
"$",
"data",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"$",
"resource",
"instanceof",
"ViewModelInterface",
")",
"{",
"return",
"$",
"this",
"->",
"view",
"->",
"render",
"(",
"$",
"reso... | Render a partial view and return the generated output.
@param string|ViewModelInterface $resource
@param array<string, mixed> $data | [
"Render",
"a",
"partial",
"view",
"and",
"return",
"the",
"generated",
"output",
"."
] | train | https://github.com/koolkode/view/blob/70a6784611c7184805d5a18fe6f7e534e4e44c59/src/AbstractViewRenderer.php#L59-L67 |
ThomasSquall/PHPMagicAnnotations | src/Reflection/Reflector.php | Reflector.getProperty | public function getProperty($name)
{
if ($this->reflected->hasProperty($name))
return $this->annotations['properties'][$name];
return null;
} | php | public function getProperty($name)
{
if ($this->reflected->hasProperty($name))
return $this->annotations['properties'][$name];
return null;
} | [
"public",
"function",
"getProperty",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"reflected",
"->",
"hasProperty",
"(",
"$",
"name",
")",
")",
"return",
"$",
"this",
"->",
"annotations",
"[",
"'properties'",
"]",
"[",
"$",
"name",
"]",
... | Returns the reflected parameter.
@param string $name
@return ReflectionProperty | [
"Returns",
"the",
"reflected",
"parameter",
"."
] | train | https://github.com/ThomasSquall/PHPMagicAnnotations/blob/3a733fa6e1ca9ebdfdfb7250f67e7aceb6a4c001/src/Reflection/Reflector.php#L96-L102 |
ThomasSquall/PHPMagicAnnotations | src/Reflection/Reflector.php | Reflector.getMethod | public function getMethod($name)
{
if ($this->reflected->hasMethod($name))
return $this->annotations['methods'][$name];
return null;
} | php | public function getMethod($name)
{
if ($this->reflected->hasMethod($name))
return $this->annotations['methods'][$name];
return null;
} | [
"public",
"function",
"getMethod",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"reflected",
"->",
"hasMethod",
"(",
"$",
"name",
")",
")",
"return",
"$",
"this",
"->",
"annotations",
"[",
"'methods'",
"]",
"[",
"$",
"name",
"]",
";",
... | Returns the reflected method.
@param string $name
@return ReflectionMethod | [
"Returns",
"the",
"reflected",
"method",
"."
] | train | https://github.com/ThomasSquall/PHPMagicAnnotations/blob/3a733fa6e1ca9ebdfdfb7250f67e7aceb6a4c001/src/Reflection/Reflector.php#L118-L124 |
Bistro/Router | lib/Bistro/Router/Router.php | Router.match | public function match($method, $url)
{
$params = array();
foreach ($this->routes as $name => $route)
{
if ($route->isMatch($method, $url))
{
$params = $route->getMatchedParams();
break;
}
}
return $params;
} | php | public function match($method, $url)
{
$params = array();
foreach ($this->routes as $name => $route)
{
if ($route->isMatch($method, $url))
{
$params = $route->getMatchedParams();
break;
}
}
return $params;
} | [
"public",
"function",
"match",
"(",
"$",
"method",
",",
"$",
"url",
")",
"{",
"$",
"params",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"routes",
"as",
"$",
"name",
"=>",
"$",
"route",
")",
"{",
"if",
"(",
"$",
"route",
"->... | Loops through all of the registered routes and tries to find a match.
@param string $method The http request method
@param string $url The url to match
@return array An array of matches params or an empty array | [
"Loops",
"through",
"all",
"of",
"the",
"registered",
"routes",
"and",
"tries",
"to",
"find",
"a",
"match",
"."
] | train | https://github.com/Bistro/Router/blob/ab5c3fff119c0e6c43c05300122b236afabfff41/lib/Bistro/Router/Router.php#L53-L67 |
Bistro/Router | lib/Bistro/Router/Router.php | Router.add | public function add($name, $pattern, $responds_to = array("GET", "POST", "PUT", "DELETE"))
{
$route = new Route($this->sub_directory.$pattern, $responds_to);
$this->routes[$name] = $route;
return $route;
} | php | public function add($name, $pattern, $responds_to = array("GET", "POST", "PUT", "DELETE"))
{
$route = new Route($this->sub_directory.$pattern, $responds_to);
$this->routes[$name] = $route;
return $route;
} | [
"public",
"function",
"add",
"(",
"$",
"name",
",",
"$",
"pattern",
",",
"$",
"responds_to",
"=",
"array",
"(",
"\"GET\"",
",",
"\"POST\"",
",",
"\"PUT\"",
",",
"\"DELETE\"",
")",
")",
"{",
"$",
"route",
"=",
"new",
"Route",
"(",
"$",
"this",
"->",
... | Adds a route.
@param string $name The route name
@param string $pattern The pattern for the route to match
@param array $responds_to An array of http verbs the route responds to.
@return \Bistro\Router\Route | [
"Adds",
"a",
"route",
"."
] | train | https://github.com/Bistro/Router/blob/ab5c3fff119c0e6c43c05300122b236afabfff41/lib/Bistro/Router/Router.php#L77-L82 |
Bistro/Router | lib/Bistro/Router/Router.php | Router.url | public function url($name, $params = array())
{
if ( ! array_key_exists($name, $this->routes))
{
throw new \UnexpectedValueException("A route with the name {$name} was not found");
}
$route = $this->routes[$name];
return $route->url($params);
} | php | public function url($name, $params = array())
{
if ( ! array_key_exists($name, $this->routes))
{
throw new \UnexpectedValueException("A route with the name {$name} was not found");
}
$route = $this->routes[$name];
return $route->url($params);
} | [
"public",
"function",
"url",
"(",
"$",
"name",
",",
"$",
"params",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"name",
",",
"$",
"this",
"->",
"routes",
")",
")",
"{",
"throw",
"new",
"\\",
"UnexpectedValueExceptio... | Reverse routing helper.
@throws \UnexpectedValueException
@param string $name The route name
@param array $params Route parameters
@return string The route url | [
"Reverse",
"routing",
"helper",
"."
] | train | https://github.com/Bistro/Router/blob/ab5c3fff119c0e6c43c05300122b236afabfff41/lib/Bistro/Router/Router.php#L141-L150 |
EvanDarwin/JSend | src/JSendResponse.php | JSendResponse.getArray | public function getArray()
{
$errors = empty($this->errors) ? null : $this->errors;
$response = array(
'status' => $this->getStatus(),
'data' => $this->data,
'errors' => $errors,
);
if (!is_null($this->code)) {
$response['code'] = $this->code;
}
if (!is_null(... | php | public function getArray()
{
$errors = empty($this->errors) ? null : $this->errors;
$response = array(
'status' => $this->getStatus(),
'data' => $this->data,
'errors' => $errors,
);
if (!is_null($this->code)) {
$response['code'] = $this->code;
}
if (!is_null(... | [
"public",
"function",
"getArray",
"(",
")",
"{",
"$",
"errors",
"=",
"empty",
"(",
"$",
"this",
"->",
"errors",
")",
"?",
"null",
":",
"$",
"this",
"->",
"errors",
";",
"$",
"response",
"=",
"array",
"(",
"'status'",
"=>",
"$",
"this",
"->",
"getSt... | Returns the array version of the request response
@return array | [
"Returns",
"the",
"array",
"version",
"of",
"the",
"request",
"response"
] | train | https://github.com/EvanDarwin/JSend/blob/a31f7590e8503590d10012510ffc50a0ef064d02/src/JSendResponse.php#L117-L136 |
geoffroy-aubry/ErrorHandler | src/GAubry/ErrorHandler/ErrorHandler.php | ErrorHandler.addExcludedPath | public function addExcludedPath($sPath, $bEnforce = false)
{
if (substr($sPath, -1) !== '/') {
$sPath .= '/';
}
if (! $bEnforce) {
$sPath = realpath($sPath);
}
if (! in_array($sPath, $this->aExcludedPaths)) {
$this->aExcludedPaths[] = $sPat... | php | public function addExcludedPath($sPath, $bEnforce = false)
{
if (substr($sPath, -1) !== '/') {
$sPath .= '/';
}
if (! $bEnforce) {
$sPath = realpath($sPath);
}
if (! in_array($sPath, $this->aExcludedPaths)) {
$this->aExcludedPaths[] = $sPat... | [
"public",
"function",
"addExcludedPath",
"(",
"$",
"sPath",
",",
"$",
"bEnforce",
"=",
"false",
")",
"{",
"if",
"(",
"substr",
"(",
"$",
"sPath",
",",
"-",
"1",
")",
"!==",
"'/'",
")",
"{",
"$",
"sPath",
".=",
"'/'",
";",
"}",
"if",
"(",
"!",
"... | Allows to ignore errors on some paths, useful with old libraries and deprecated code…
Trailing slash is optional.
@param string $sPath
@param bool $bEnforce By default all paths are normalized with realpath().
Set TRUE to avoid normalization.
Useful, for example, with some external PHP modules:
Couchbase PHP module ... | [
"Allows",
"to",
"ignore",
"errors",
"on",
"some",
"paths",
"useful",
"with",
"old",
"libraries",
"and",
"deprecated",
"code…",
"Trailing",
"slash",
"is",
"optional",
"."
] | train | https://github.com/geoffroy-aubry/ErrorHandler/blob/77575e8e0e4312f9a5f334e27c33549ec6adb35b/src/GAubry/ErrorHandler/ErrorHandler.php#L155-L166 |
geoffroy-aubry/ErrorHandler | src/GAubry/ErrorHandler/ErrorHandler.php | ErrorHandler.internalErrorHandler | public function internalErrorHandler($iErrNo, $sErrStr, $sErrFile, $iErrLine)
{
// Si l'erreur provient d'un répertoire exclu de ce handler, alors l'ignorer.
foreach ($this->aExcludedPaths as $sExcludedPath) {
if (stripos($sErrFile, $sExcludedPath) === 0) {
return true;
... | php | public function internalErrorHandler($iErrNo, $sErrStr, $sErrFile, $iErrLine)
{
// Si l'erreur provient d'un répertoire exclu de ce handler, alors l'ignorer.
foreach ($this->aExcludedPaths as $sExcludedPath) {
if (stripos($sErrFile, $sExcludedPath) === 0) {
return true;
... | [
"public",
"function",
"internalErrorHandler",
"(",
"$",
"iErrNo",
",",
"$",
"sErrStr",
",",
"$",
"sErrFile",
",",
"$",
"iErrLine",
")",
"{",
"// Si l'erreur provient d'un répertoire exclu de ce handler, alors l'ignorer.",
"foreach",
"(",
"$",
"this",
"->",
"aExcludedPat... | Customized error handler function: throws an Exception with the message error if @ operator not used
and error source is not in excluded paths.
@param int $iErrNo level of the error raised.
@param string $sErrStr the error message.
@param string $sErrFile the filename that the error was raised in.
@param int ... | [
"Customized",
"error",
"handler",
"function",
":",
"throws",
"an",
"Exception",
"with",
"the",
"message",
"error",
"if",
"@",
"operator",
"not",
"used",
"and",
"error",
"source",
"is",
"not",
"in",
"excluded",
"paths",
"."
] | train | https://github.com/geoffroy-aubry/ErrorHandler/blob/77575e8e0e4312f9a5f334e27c33549ec6adb35b/src/GAubry/ErrorHandler/ErrorHandler.php#L201-L226 |
geoffroy-aubry/ErrorHandler | src/GAubry/ErrorHandler/ErrorHandler.php | ErrorHandler.internalExceptionHandler | public function internalExceptionHandler(\Exception $oException)
{
if (! $this->aConfig['display_errors'] && ini_get('error_log') !== '' && ! $this->bIsRunningFromCLI) {
call_user_func($this->callbackGenericDisplay, $oException);
}
$this->log($oException);
if ($oException... | php | public function internalExceptionHandler(\Exception $oException)
{
if (! $this->aConfig['display_errors'] && ini_get('error_log') !== '' && ! $this->bIsRunningFromCLI) {
call_user_func($this->callbackGenericDisplay, $oException);
}
$this->log($oException);
if ($oException... | [
"public",
"function",
"internalExceptionHandler",
"(",
"\\",
"Exception",
"$",
"oException",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"aConfig",
"[",
"'display_errors'",
"]",
"&&",
"ini_get",
"(",
"'error_log'",
")",
"!==",
"''",
"&&",
"!",
"$",
"this"... | Exception handler.
@SuppressWarnings(ExitExpression)
@param \Exception $oException | [
"Exception",
"handler",
".",
"@SuppressWarnings",
"(",
"ExitExpression",
")"
] | train | https://github.com/geoffroy-aubry/ErrorHandler/blob/77575e8e0e4312f9a5f334e27c33549ec6adb35b/src/GAubry/ErrorHandler/ErrorHandler.php#L234-L246 |
geoffroy-aubry/ErrorHandler | src/GAubry/ErrorHandler/ErrorHandler.php | ErrorHandler.internalShutdownFunction | public function internalShutdownFunction()
{
$aError = error_get_last();
if (! $this->aConfig['display_errors'] && is_array($aError) && $aError['type'] === E_ERROR) {
$oException = new \ErrorException(
$aError['message'],
$this->aConfig['default_error_code... | php | public function internalShutdownFunction()
{
$aError = error_get_last();
if (! $this->aConfig['display_errors'] && is_array($aError) && $aError['type'] === E_ERROR) {
$oException = new \ErrorException(
$aError['message'],
$this->aConfig['default_error_code... | [
"public",
"function",
"internalShutdownFunction",
"(",
")",
"{",
"$",
"aError",
"=",
"error_get_last",
"(",
")",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"aConfig",
"[",
"'display_errors'",
"]",
"&&",
"is_array",
"(",
"$",
"aError",
")",
"&&",
"$",
"aErro... | Registered shutdown function. | [
"Registered",
"shutdown",
"function",
"."
] | train | https://github.com/geoffroy-aubry/ErrorHandler/blob/77575e8e0e4312f9a5f334e27c33549ec6adb35b/src/GAubry/ErrorHandler/ErrorHandler.php#L260-L277 |
geoffroy-aubry/ErrorHandler | src/GAubry/ErrorHandler/ErrorHandler.php | ErrorHandler.log | public function log($mError)
{
if (is_array($mError) || (is_object($mError) && ! ($mError instanceof \Exception))) {
$mError = print_r($mError, true);
}
if ($this->aConfig['display_errors']) {
if ($this->bIsRunningFromCLI) {
file_put_contents('php://s... | php | public function log($mError)
{
if (is_array($mError) || (is_object($mError) && ! ($mError instanceof \Exception))) {
$mError = print_r($mError, true);
}
if ($this->aConfig['display_errors']) {
if ($this->bIsRunningFromCLI) {
file_put_contents('php://s... | [
"public",
"function",
"log",
"(",
"$",
"mError",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"mError",
")",
"||",
"(",
"is_object",
"(",
"$",
"mError",
")",
"&&",
"!",
"(",
"$",
"mError",
"instanceof",
"\\",
"Exception",
")",
")",
")",
"{",
"$",
"... | According to context, logs specified error into STDERR, STDOUT or via error_log().
@param mixed $mError Error to log. Can be string, array or object. | [
"According",
"to",
"context",
"logs",
"specified",
"error",
"into",
"STDERR",
"STDOUT",
"or",
"via",
"error_log",
"()",
"."
] | train | https://github.com/geoffroy-aubry/ErrorHandler/blob/77575e8e0e4312f9a5f334e27c33549ec6adb35b/src/GAubry/ErrorHandler/ErrorHandler.php#L285-L302 |
SCLInternet/SclCurrency | src/SCL/Currency/Money/Calculator.php | Calculator.performOperationOn2Currencies | private function performOperationOn2Currencies($operation)
{
$this->assertCurrenciesMatch();
return new Money(
$operation($this->valueA->getUnits(), $this->valueB->getUnits()),
$this->valueA->getCurrency()
);
} | php | private function performOperationOn2Currencies($operation)
{
$this->assertCurrenciesMatch();
return new Money(
$operation($this->valueA->getUnits(), $this->valueB->getUnits()),
$this->valueA->getCurrency()
);
} | [
"private",
"function",
"performOperationOn2Currencies",
"(",
"$",
"operation",
")",
"{",
"$",
"this",
"->",
"assertCurrenciesMatch",
"(",
")",
";",
"return",
"new",
"Money",
"(",
"$",
"operation",
"(",
"$",
"this",
"->",
"valueA",
"->",
"getUnits",
"(",
")",... | @param callable $operation Signature: int function(int $a, int $b)
@return Money | [
"@param",
"callable",
"$operation",
"Signature",
":",
"int",
"function",
"(",
"int",
"$a",
"int",
"$b",
")"
] | train | https://github.com/SCLInternet/SclCurrency/blob/788f0ff5d4a3146368a09eb3869cbb0559a9866a/src/SCL/Currency/Money/Calculator.php#L55-L63 |
rollerworks/search-core | Value/ValuesBag.php | ValuesBag.removeExcludedSimpleValue | public function removeExcludedSimpleValue(int $index)
{
if (isset($this->simpleExcludedValues[$index])) {
unset($this->simpleExcludedValues[$index]);
--$this->valuesCount;
}
return $this;
} | php | public function removeExcludedSimpleValue(int $index)
{
if (isset($this->simpleExcludedValues[$index])) {
unset($this->simpleExcludedValues[$index]);
--$this->valuesCount;
}
return $this;
} | [
"public",
"function",
"removeExcludedSimpleValue",
"(",
"int",
"$",
"index",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"simpleExcludedValues",
"[",
"$",
"index",
"]",
")",
")",
"{",
"unset",
"(",
"$",
"this",
"->",
"simpleExcludedValues",
"[",
... | Remove a simple excluded value by index.
@param int $index
@return static | [
"Remove",
"a",
"simple",
"excluded",
"value",
"by",
"index",
"."
] | train | https://github.com/rollerworks/search-core/blob/6b5671b8c4d6298906ded768261b0a59845140fb/Value/ValuesBag.php#L141-L150 |
rollerworks/search-core | Value/ValuesBag.php | ValuesBag.get | public function get(string $type): array
{
if (!isset($this->values[$type])) {
return [];
}
return $this->values[$type];
} | php | public function get(string $type): array
{
if (!isset($this->values[$type])) {
return [];
}
return $this->values[$type];
} | [
"public",
"function",
"get",
"(",
"string",
"$",
"type",
")",
":",
"array",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"values",
"[",
"$",
"type",
"]",
")",
")",
"{",
"return",
"[",
"]",
";",
"}",
"return",
"$",
"this",
"->",
"values... | Get all values from a specific type.
@return ValueHolder[] | [
"Get",
"all",
"values",
"from",
"a",
"specific",
"type",
"."
] | train | https://github.com/rollerworks/search-core/blob/6b5671b8c4d6298906ded768261b0a59845140fb/Value/ValuesBag.php#L157-L164 |
rollerworks/search-core | Value/ValuesBag.php | ValuesBag.has | public function has(string $type): bool
{
return isset($this->values[$type]) && \count($this->values[$type]) > 0;
} | php | public function has(string $type): bool
{
return isset($this->values[$type]) && \count($this->values[$type]) > 0;
} | [
"public",
"function",
"has",
"(",
"string",
"$",
"type",
")",
":",
"bool",
"{",
"return",
"isset",
"(",
"$",
"this",
"->",
"values",
"[",
"$",
"type",
"]",
")",
"&&",
"\\",
"count",
"(",
"$",
"this",
"->",
"values",
"[",
"$",
"type",
"]",
")",
... | Get a single value by type and index.
@return bool | [
"Get",
"a",
"single",
"value",
"by",
"type",
"and",
"index",
"."
] | train | https://github.com/rollerworks/search-core/blob/6b5671b8c4d6298906ded768261b0a59845140fb/Value/ValuesBag.php#L171-L174 |
rollerworks/search-core | Value/ValuesBag.php | ValuesBag.remove | public function remove(string $type, int $index)
{
if (isset($this->values[$type][$index])) {
unset($this->values[$type][$index]);
--$this->valuesCount;
}
return $this;
} | php | public function remove(string $type, int $index)
{
if (isset($this->values[$type][$index])) {
unset($this->values[$type][$index]);
--$this->valuesCount;
}
return $this;
} | [
"public",
"function",
"remove",
"(",
"string",
"$",
"type",
",",
"int",
"$",
"index",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"values",
"[",
"$",
"type",
"]",
"[",
"$",
"index",
"]",
")",
")",
"{",
"unset",
"(",
"$",
"this",
"->",... | Remove a value by type and index.
@return ValuesBag New ValuesBag object with the referenced values removed | [
"Remove",
"a",
"value",
"by",
"type",
"and",
"index",
"."
] | train | https://github.com/rollerworks/search-core/blob/6b5671b8c4d6298906ded768261b0a59845140fb/Value/ValuesBag.php#L181-L190 |
dms-org/common.structure | src/Colour/Colour.php | Colour.define | protected function define(ClassDefinition $class)
{
$class->property($this->red)->asInt();
$class->property($this->green)->asInt();
$class->property($this->blue)->asInt();
} | php | protected function define(ClassDefinition $class)
{
$class->property($this->red)->asInt();
$class->property($this->green)->asInt();
$class->property($this->blue)->asInt();
} | [
"protected",
"function",
"define",
"(",
"ClassDefinition",
"$",
"class",
")",
"{",
"$",
"class",
"->",
"property",
"(",
"$",
"this",
"->",
"red",
")",
"->",
"asInt",
"(",
")",
";",
"$",
"class",
"->",
"property",
"(",
"$",
"this",
"->",
"green",
")",... | Defines the structure of this class.
@param ClassDefinition $class | [
"Defines",
"the",
"structure",
"of",
"this",
"class",
"."
] | train | https://github.com/dms-org/common.structure/blob/23f122182f60df5ec847047a81a39c8aab019ff1/src/Colour/Colour.php#L67-L74 |
dms-org/common.structure | src/Colour/Colour.php | Colour.fromRgbString | public static function fromRgbString(string $string) : Colour
{
list($r, $g, $b) = ColourStringParser::parseRgbString($string);
return new self($r, $g, $b);
} | php | public static function fromRgbString(string $string) : Colour
{
list($r, $g, $b) = ColourStringParser::parseRgbString($string);
return new self($r, $g, $b);
} | [
"public",
"static",
"function",
"fromRgbString",
"(",
"string",
"$",
"string",
")",
":",
"Colour",
"{",
"list",
"(",
"$",
"r",
",",
"$",
"g",
",",
"$",
"b",
")",
"=",
"ColourStringParser",
"::",
"parseRgbString",
"(",
"$",
"string",
")",
";",
"return",... | Creates a new colour from the supplied rgb string value
@param string $string eg: "rgb(100, 100, 100)"
@return Colour
@throws InvalidArgumentException | [
"Creates",
"a",
"new",
"colour",
"from",
"the",
"supplied",
"rgb",
"string",
"value"
] | train | https://github.com/dms-org/common.structure/blob/23f122182f60df5ec847047a81a39c8aab019ff1/src/Colour/Colour.php#L84-L89 |
dms-org/common.structure | src/Colour/Colour.php | Colour.fromHexString | public static function fromHexString(string $string) : Colour
{
list($r, $g, $b) = ColourStringParser::parseHexString($string);
return new self($r, $g, $b);
} | php | public static function fromHexString(string $string) : Colour
{
list($r, $g, $b) = ColourStringParser::parseHexString($string);
return new self($r, $g, $b);
} | [
"public",
"static",
"function",
"fromHexString",
"(",
"string",
"$",
"string",
")",
":",
"Colour",
"{",
"list",
"(",
"$",
"r",
",",
"$",
"g",
",",
"$",
"b",
")",
"=",
"ColourStringParser",
"::",
"parseHexString",
"(",
"$",
"string",
")",
";",
"return",... | Creates a new colour from the supplied hex value
@param string $string
@return Colour | [
"Creates",
"a",
"new",
"colour",
"from",
"the",
"supplied",
"hex",
"value"
] | train | https://github.com/dms-org/common.structure/blob/23f122182f60df5ec847047a81a39c8aab019ff1/src/Colour/Colour.php#L98-L103 |
dms-org/common.structure | src/Colour/Colour.php | Colour.toHexString | public function toHexString() : string
{
return '#' . sprintf('%02x', $this->red) . sprintf('%02x', $this->green) . sprintf('%02x', $this->blue);
} | php | public function toHexString() : string
{
return '#' . sprintf('%02x', $this->red) . sprintf('%02x', $this->green) . sprintf('%02x', $this->blue);
} | [
"public",
"function",
"toHexString",
"(",
")",
":",
"string",
"{",
"return",
"'#'",
".",
"sprintf",
"(",
"'%02x'",
",",
"$",
"this",
"->",
"red",
")",
".",
"sprintf",
"(",
"'%02x'",
",",
"$",
"this",
"->",
"green",
")",
".",
"sprintf",
"(",
"'%02x'",... | Gets the colour as a hex string.
@return string | [
"Gets",
"the",
"colour",
"as",
"a",
"hex",
"string",
"."
] | train | https://github.com/dms-org/common.structure/blob/23f122182f60df5ec847047a81a39c8aab019ff1/src/Colour/Colour.php#L144-L147 |
LartTyler/Doze | src/Serializer/EntityNormalizer.php | EntityNormalizer.getAttributes | protected function getAttributes($object, $format = null, array $context) {
return $this->extractAttributes($object, $format, $context);
} | php | protected function getAttributes($object, $format = null, array $context) {
return $this->extractAttributes($object, $format, $context);
} | [
"protected",
"function",
"getAttributes",
"(",
"$",
"object",
",",
"$",
"format",
"=",
"null",
",",
"array",
"$",
"context",
")",
"{",
"return",
"$",
"this",
"->",
"extractAttributes",
"(",
"$",
"object",
",",
"$",
"format",
",",
"$",
"context",
")",
"... | {@inheritdoc} | [
"{"
] | train | https://github.com/LartTyler/Doze/blob/b23b03f89b042e42b0c8a95a65fa00498fb7837f/src/Serializer/EntityNormalizer.php#L24-L26 |
LartTyler/Doze | src/Serializer/EntityNormalizer.php | EntityNormalizer.getAttributeValue | protected function getAttributeValue($object, $attribute, $format = null, array $context = []) {
$value = parent::getAttributeValue($object, $attribute, $format, $context);
if ($value instanceof EntityInterface && !$this->isExplicitlyAllowed($attribute, $context))
return $value->getId();
return $value;
... | php | protected function getAttributeValue($object, $attribute, $format = null, array $context = []) {
$value = parent::getAttributeValue($object, $attribute, $format, $context);
if ($value instanceof EntityInterface && !$this->isExplicitlyAllowed($attribute, $context))
return $value->getId();
return $value;
... | [
"protected",
"function",
"getAttributeValue",
"(",
"$",
"object",
",",
"$",
"attribute",
",",
"$",
"format",
"=",
"null",
",",
"array",
"$",
"context",
"=",
"[",
"]",
")",
"{",
"$",
"value",
"=",
"parent",
"::",
"getAttributeValue",
"(",
"$",
"object",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/LartTyler/Doze/blob/b23b03f89b042e42b0c8a95a65fa00498fb7837f/src/Serializer/EntityNormalizer.php#L48-L55 |
robertmain/communique | src/Communique.php | Communique._call | protected function _call(\Communique\RESTClientRequest $request, $debug = null) {
foreach ($this->_interceptors as $request_interceptor) {
$request = $request_interceptor->request($request);
}
$response = $this->_http->request($request);
foreach ($this->_interceptors as $response_interceptor) {
$response ... | php | protected function _call(\Communique\RESTClientRequest $request, $debug = null) {
foreach ($this->_interceptors as $request_interceptor) {
$request = $request_interceptor->request($request);
}
$response = $this->_http->request($request);
foreach ($this->_interceptors as $response_interceptor) {
$response ... | [
"protected",
"function",
"_call",
"(",
"\\",
"Communique",
"\\",
"RESTClientRequest",
"$",
"request",
",",
"$",
"debug",
"=",
"null",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"_interceptors",
"as",
"$",
"request_interceptor",
")",
"{",
"$",
"request",
... | Makes the HTTP request using the chosen HTTP client.
@param \Communique\RESTClientRequest $request A RESTClientRequest object encapsulating the request
@param callable $debug A debugging callback to be run after the request has finished. This function is expected to accept two parameters, \Communique\RESTClientReques... | [
"Makes",
"the",
"HTTP",
"request",
"using",
"the",
"chosen",
"HTTP",
"client",
"."
] | train | https://github.com/robertmain/communique/blob/025d4f0f9bc391f6f9fc653a363158d2f83e9051/src/Communique.php#L75-L87 |
robertmain/communique | src/Communique.php | Communique.put | public function put($url, $payload, array $headers = array(), $debug = null) {
$request = new \Communique\RESTClientRequest('put', $this->_BASE_URL . $url, $payload, $headers);
return $this->_call($request, $debug);
} | php | public function put($url, $payload, array $headers = array(), $debug = null) {
$request = new \Communique\RESTClientRequest('put', $this->_BASE_URL . $url, $payload, $headers);
return $this->_call($request, $debug);
} | [
"public",
"function",
"put",
"(",
"$",
"url",
",",
"$",
"payload",
",",
"array",
"$",
"headers",
"=",
"array",
"(",
")",
",",
"$",
"debug",
"=",
"null",
")",
"{",
"$",
"request",
"=",
"new",
"\\",
"Communique",
"\\",
"RESTClientRequest",
"(",
"'put'"... | Make an HTTP PUT request
@param String $url The API to make the request to
@param mixed $payload The payload of the request(any data you wish to send across)
@param array $headers Any headers you want to add to the request(optional)
@param callable $debug A function to be used for request debugging.
This func... | [
"Make",
"an",
"HTTP",
"PUT",
"request"
] | train | https://github.com/robertmain/communique/blob/025d4f0f9bc391f6f9fc653a363158d2f83e9051/src/Communique.php#L112-L115 |
dpiquet/Mapping | src/Mapping.php | Mapping.addMapping | public function addMapping($key, array $accepted_names, $required = true)
{
$lower_accepted_names = [];
foreach($accepted_names as $name) {
$lower_name = strtolower($name);
if ($this->getMapping($lower_name) !== false) {
throw new MappingOverlapException(spr... | php | public function addMapping($key, array $accepted_names, $required = true)
{
$lower_accepted_names = [];
foreach($accepted_names as $name) {
$lower_name = strtolower($name);
if ($this->getMapping($lower_name) !== false) {
throw new MappingOverlapException(spr... | [
"public",
"function",
"addMapping",
"(",
"$",
"key",
",",
"array",
"$",
"accepted_names",
",",
"$",
"required",
"=",
"true",
")",
"{",
"$",
"lower_accepted_names",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"accepted_names",
"as",
"$",
"name",
")",
"{",
... | Add a mapping expectation
@param string $key Mapping identifier
@param array $accepted_names Allowed columns names
@param boolean $required Column is required
@return $this
@throws MappingOverlapException | [
"Add",
"a",
"mapping",
"expectation"
] | train | https://github.com/dpiquet/Mapping/blob/13cccfa490003a12b1c047c0c21f6a24815dd4ba/src/Mapping.php#L35-L56 |
dpiquet/Mapping | src/Mapping.php | Mapping.getMapping | protected function getMapping($name)
{
foreach($this->mappings as $key => $data) {
if (in_array(strtolower($name), $data['accepted_names'])) {
return $key;
}
}
return false;
} | php | protected function getMapping($name)
{
foreach($this->mappings as $key => $data) {
if (in_array(strtolower($name), $data['accepted_names'])) {
return $key;
}
}
return false;
} | [
"protected",
"function",
"getMapping",
"(",
"$",
"name",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"mappings",
"as",
"$",
"key",
"=>",
"$",
"data",
")",
"{",
"if",
"(",
"in_array",
"(",
"strtolower",
"(",
"$",
"name",
")",
",",
"$",
"data",
"[",... | Get a mapped column index
@param string $name
@return int|false | [
"Get",
"a",
"mapped",
"column",
"index"
] | train | https://github.com/dpiquet/Mapping/blob/13cccfa490003a12b1c047c0c21f6a24815dd4ba/src/Mapping.php#L76-L85 |
dpiquet/Mapping | src/Mapping.php | Mapping.map | public function map(array $columns)
{
$maps = [];
$seenKeys = [];
foreach($columns as $index => $column_name) {
$key = $this->getMapping($column_name);
if ($key === false) {
continue;
}
if (in_array($key, $seenKeys)) {
... | php | public function map(array $columns)
{
$maps = [];
$seenKeys = [];
foreach($columns as $index => $column_name) {
$key = $this->getMapping($column_name);
if ($key === false) {
continue;
}
if (in_array($key, $seenKeys)) {
... | [
"public",
"function",
"map",
"(",
"array",
"$",
"columns",
")",
"{",
"$",
"maps",
"=",
"[",
"]",
";",
"$",
"seenKeys",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"columns",
"as",
"$",
"index",
"=>",
"$",
"column_name",
")",
"{",
"$",
"key",
"=",
... | Map columns on array
@param array $columns Array to map
@return array mappings
@throws MappingIncompleteException
@throws OverlapColumnException | [
"Map",
"columns",
"on",
"array"
] | train | https://github.com/dpiquet/Mapping/blob/13cccfa490003a12b1c047c0c21f6a24815dd4ba/src/Mapping.php#L96-L128 |
fond-of/spryker-companies-rest-api | src/FondOfSpryker/Zed/CompaniesRestApi/Business/Company/CompanyReader.php | CompanyReader.findCompanyByExternalReference | public function findCompanyByExternalReference(
RestCompaniesRequestAttributesTransfer $restCompaniesRequestAttributesTransfer
): RestCompaniesResponseTransfer {
$companyTransfer = $this->findByExternalReference(
$restCompaniesRequestAttributesTransfer->getExternalReference()
);
... | php | public function findCompanyByExternalReference(
RestCompaniesRequestAttributesTransfer $restCompaniesRequestAttributesTransfer
): RestCompaniesResponseTransfer {
$companyTransfer = $this->findByExternalReference(
$restCompaniesRequestAttributesTransfer->getExternalReference()
);
... | [
"public",
"function",
"findCompanyByExternalReference",
"(",
"RestCompaniesRequestAttributesTransfer",
"$",
"restCompaniesRequestAttributesTransfer",
")",
":",
"RestCompaniesResponseTransfer",
"{",
"$",
"companyTransfer",
"=",
"$",
"this",
"->",
"findByExternalReference",
"(",
... | @param \Generated\Shared\Transfer\RestCompaniesRequestAttributesTransfer $restCompaniesRequestAttributesTransfer
@return \Generated\Shared\Transfer\RestCompaniesResponseTransfer | [
"@param",
"\\",
"Generated",
"\\",
"Shared",
"\\",
"Transfer",
"\\",
"RestCompaniesRequestAttributesTransfer",
"$restCompaniesRequestAttributesTransfer"
] | train | https://github.com/fond-of/spryker-companies-rest-api/blob/0df688aa37cd6d18f90ac2af0a1cbc39357d94d7/src/FondOfSpryker/Zed/CompaniesRestApi/Business/Company/CompanyReader.php#L34-L46 |
fond-of/spryker-companies-rest-api | src/FondOfSpryker/Zed/CompaniesRestApi/Business/Company/CompanyReader.php | CompanyReader.createCompanyResponseTransfer | protected function createCompanyResponseTransfer(CompanyTransfer $companyTransfer): RestCompaniesResponseTransfer
{
$restCompaniesResponseAttributesTransfer = new RestCompaniesResponseAttributesTransfer();
$restCompaniesResponseAttributesTransfer->fromArray(
$companyTransfer->toArray(),... | php | protected function createCompanyResponseTransfer(CompanyTransfer $companyTransfer): RestCompaniesResponseTransfer
{
$restCompaniesResponseAttributesTransfer = new RestCompaniesResponseAttributesTransfer();
$restCompaniesResponseAttributesTransfer->fromArray(
$companyTransfer->toArray(),... | [
"protected",
"function",
"createCompanyResponseTransfer",
"(",
"CompanyTransfer",
"$",
"companyTransfer",
")",
":",
"RestCompaniesResponseTransfer",
"{",
"$",
"restCompaniesResponseAttributesTransfer",
"=",
"new",
"RestCompaniesResponseAttributesTransfer",
"(",
")",
";",
"$",
... | @param \Generated\Shared\Transfer\CompanyTransfer $companyTransfer
@return \Generated\Shared\Transfer\RestCompaniesResponseTransfer | [
"@param",
"\\",
"Generated",
"\\",
"Shared",
"\\",
"Transfer",
"\\",
"CompanyTransfer",
"$companyTransfer"
] | train | https://github.com/fond-of/spryker-companies-rest-api/blob/0df688aa37cd6d18f90ac2af0a1cbc39357d94d7/src/FondOfSpryker/Zed/CompaniesRestApi/Business/Company/CompanyReader.php#L53-L68 |
fridge-project/dbal | src/Fridge/DBAL/Type/TimeType.php | TimeType.convertToDatabaseValue | public function convertToDatabaseValue($value, PlatformInterface $platform)
{
return ($value === null) ? null : $value->format($platform->getTimeFormat());
} | php | public function convertToDatabaseValue($value, PlatformInterface $platform)
{
return ($value === null) ? null : $value->format($platform->getTimeFormat());
} | [
"public",
"function",
"convertToDatabaseValue",
"(",
"$",
"value",
",",
"PlatformInterface",
"$",
"platform",
")",
"{",
"return",
"(",
"$",
"value",
"===",
"null",
")",
"?",
"null",
":",
"$",
"value",
"->",
"format",
"(",
"$",
"platform",
"->",
"getTimeFor... | {@inheritdoc} | [
"{"
] | train | https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/Type/TimeType.php#L35-L38 |
fridge-project/dbal | src/Fridge/DBAL/Type/TimeType.php | TimeType.convertToPHPValue | public function convertToPHPValue($value, PlatformInterface $platform)
{
if ($value === null) {
return;
}
$val = \DateTime::createFromFormat($platform->getTimeFormat(), $value);
if ($val === false) {
throw TypeException::conversionToPHPFailed($value, $this->... | php | public function convertToPHPValue($value, PlatformInterface $platform)
{
if ($value === null) {
return;
}
$val = \DateTime::createFromFormat($platform->getTimeFormat(), $value);
if ($val === false) {
throw TypeException::conversionToPHPFailed($value, $this->... | [
"public",
"function",
"convertToPHPValue",
"(",
"$",
"value",
",",
"PlatformInterface",
"$",
"platform",
")",
"{",
"if",
"(",
"$",
"value",
"===",
"null",
")",
"{",
"return",
";",
"}",
"$",
"val",
"=",
"\\",
"DateTime",
"::",
"createFromFormat",
"(",
"$"... | {@inheritdoc}
@throws \Fridge\DBAL\Exception\TypeException If the database value can not be convert to his PHP value. | [
"{",
"@inheritdoc",
"}"
] | train | https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/Type/TimeType.php#L45-L58 |
TitaPHP/framework | src/TitaPHP/Helpers/NumberFormatter.php | NumberFormatter.currency | public static function currency( $value, $decimals = 2, $currencyCode = null )
{
$app = Application::instance();
$currencyCode = $currencyCode ?: $app->getConfig('app.settings.currency');
$nf = new \NumberFormatter(\Locale::getDefault(), \NumberFormatter::CURRENCY);
$nf->setAttribute(\NumberFormatter::MAX_FRA... | php | public static function currency( $value, $decimals = 2, $currencyCode = null )
{
$app = Application::instance();
$currencyCode = $currencyCode ?: $app->getConfig('app.settings.currency');
$nf = new \NumberFormatter(\Locale::getDefault(), \NumberFormatter::CURRENCY);
$nf->setAttribute(\NumberFormatter::MAX_FRA... | [
"public",
"static",
"function",
"currency",
"(",
"$",
"value",
",",
"$",
"decimals",
"=",
"2",
",",
"$",
"currencyCode",
"=",
"null",
")",
"{",
"$",
"app",
"=",
"Application",
"::",
"instance",
"(",
")",
";",
"$",
"currencyCode",
"=",
"$",
"currencyCod... | returns a string with currency formatted accordingly to locale settings
@param string $value
@param string $decimals
@param string $currencyCode
@return string | [
"returns",
"a",
"string",
"with",
"currency",
"formatted",
"accordingly",
"to",
"locale",
"settings"
] | train | https://github.com/TitaPHP/framework/blob/72283a45733a49c1d9c1fc0eba22ff13a802295c/src/TitaPHP/Helpers/NumberFormatter.php#L14-L22 |
TitaPHP/framework | src/TitaPHP/Helpers/NumberFormatter.php | NumberFormatter.decimal | public static function decimal( $value, $decimals = 2 )
{
$nf = new \NumberFormatter(\Locale::getDefault(), \NumberFormatter::DECIMAL);
$nf->setAttribute(\NumberFormatter::MAX_FRACTION_DIGITS, $decimals);
return $nf->format($value);
} | php | public static function decimal( $value, $decimals = 2 )
{
$nf = new \NumberFormatter(\Locale::getDefault(), \NumberFormatter::DECIMAL);
$nf->setAttribute(\NumberFormatter::MAX_FRACTION_DIGITS, $decimals);
return $nf->format($value);
} | [
"public",
"static",
"function",
"decimal",
"(",
"$",
"value",
",",
"$",
"decimals",
"=",
"2",
")",
"{",
"$",
"nf",
"=",
"new",
"\\",
"NumberFormatter",
"(",
"\\",
"Locale",
"::",
"getDefault",
"(",
")",
",",
"\\",
"NumberFormatter",
"::",
"DECIMAL",
")... | returns a string with decimal formatted accordingly to locale settings
@param string $value
@param string $decimals
@return string | [
"returns",
"a",
"string",
"with",
"decimal",
"formatted",
"accordingly",
"to",
"locale",
"settings"
] | train | https://github.com/TitaPHP/framework/blob/72283a45733a49c1d9c1fc0eba22ff13a802295c/src/TitaPHP/Helpers/NumberFormatter.php#L30-L35 |
TitaPHP/framework | src/TitaPHP/Helpers/NumberFormatter.php | NumberFormatter.percentage | public static function percentage( $value, $decimals = 0 )
{
$nf = new \NumberFormatter(\Locale::getDefault(), \NumberFormatter::PERCENT);
$nf->setAttribute(\NumberFormatter::MAX_FRACTION_DIGITS, $decimals);
return $value > 1 ? $nf->format($value) : $nf->format($value);
} | php | public static function percentage( $value, $decimals = 0 )
{
$nf = new \NumberFormatter(\Locale::getDefault(), \NumberFormatter::PERCENT);
$nf->setAttribute(\NumberFormatter::MAX_FRACTION_DIGITS, $decimals);
return $value > 1 ? $nf->format($value) : $nf->format($value);
} | [
"public",
"static",
"function",
"percentage",
"(",
"$",
"value",
",",
"$",
"decimals",
"=",
"0",
")",
"{",
"$",
"nf",
"=",
"new",
"\\",
"NumberFormatter",
"(",
"\\",
"Locale",
"::",
"getDefault",
"(",
")",
",",
"\\",
"NumberFormatter",
"::",
"PERCENT",
... | returns a string with percentage formatted accordingly to Yii dateFormatter
@param $value
@param $decimals
@return string | [
"returns",
"a",
"string",
"with",
"percentage",
"formatted",
"accordingly",
"to",
"Yii",
"dateFormatter"
] | train | https://github.com/TitaPHP/framework/blob/72283a45733a49c1d9c1fc0eba22ff13a802295c/src/TitaPHP/Helpers/NumberFormatter.php#L54-L59 |
devlabmtl/haven-cms | Entity/HtmlContent.php | HtmlContent.addTranslation | public function addTranslation(\Haven\CmsBundle\Entity\HtmlContentTranslation $translations) {
$translations->setParent($this);
$this->translations[] = $translations;
return $this;
} | php | public function addTranslation(\Haven\CmsBundle\Entity\HtmlContentTranslation $translations) {
$translations->setParent($this);
$this->translations[] = $translations;
return $this;
} | [
"public",
"function",
"addTranslation",
"(",
"\\",
"Haven",
"\\",
"CmsBundle",
"\\",
"Entity",
"\\",
"HtmlContentTranslation",
"$",
"translations",
")",
"{",
"$",
"translations",
"->",
"setParent",
"(",
"$",
"this",
")",
";",
"$",
"this",
"->",
"translations",... | Add translations
@param \Haven\CmsBundle\Entity\HtmlContentTranslation $translations
@return HtmlContent | [
"Add",
"translations"
] | train | https://github.com/devlabmtl/haven-cms/blob/c20761a07c201a966dbda1f3eae33617f80e1ece/Entity/HtmlContent.php#L105-L110 |
devlabmtl/haven-cms | Entity/HtmlContent.php | HtmlContent.removeTranslation | public function removeTranslation(\Haven\CmsBundle\Entity\HtmlContentTranslation $translations) {
$this->translations->removeElement($translations);
} | php | public function removeTranslation(\Haven\CmsBundle\Entity\HtmlContentTranslation $translations) {
$this->translations->removeElement($translations);
} | [
"public",
"function",
"removeTranslation",
"(",
"\\",
"Haven",
"\\",
"CmsBundle",
"\\",
"Entity",
"\\",
"HtmlContentTranslation",
"$",
"translations",
")",
"{",
"$",
"this",
"->",
"translations",
"->",
"removeElement",
"(",
"$",
"translations",
")",
";",
"}"
] | Remove translations
@param \Haven\CmsBundle\Entity\HtmlContentTranslation $translations | [
"Remove",
"translations"
] | train | https://github.com/devlabmtl/haven-cms/blob/c20761a07c201a966dbda1f3eae33617f80e1ece/Entity/HtmlContent.php#L117-L119 |
shrink0r/php-schema | src/Property/FloatProperty.php | FloatProperty.validate | public function validate($value)
{
return is_float($value) ? Ok::unit() : Error::unit([ Error::NON_FLOAT ]);
} | php | public function validate($value)
{
return is_float($value) ? Ok::unit() : Error::unit([ Error::NON_FLOAT ]);
} | [
"public",
"function",
"validate",
"(",
"$",
"value",
")",
"{",
"return",
"is_float",
"(",
"$",
"value",
")",
"?",
"Ok",
"::",
"unit",
"(",
")",
":",
"Error",
"::",
"unit",
"(",
"[",
"Error",
"::",
"NON_FLOAT",
"]",
")",
";",
"}"
] | Tells if a given value is a valid float.
@param mixed $value
@return ResultInterface Returns Ok if the value is valid, otherwise an Error is returned. | [
"Tells",
"if",
"a",
"given",
"value",
"is",
"a",
"valid",
"float",
"."
] | train | https://github.com/shrink0r/php-schema/blob/94293fe897af376dd9d05962e2c516079409dd29/src/Property/FloatProperty.php#L18-L21 |
kambalabs/KmbCache | src/KmbCache/Service/NodeStatisticsDataContextBuilderFactory.php | NodeStatisticsDataContextBuilderFactory.createService | public function createService(ServiceLocatorInterface $serviceLocator)
{
$service = new NodeStatisticsDataContextBuilder();
/** @var QueryBuilderInterface $queryBuilder */
$queryBuilder = $serviceLocator->get('KmbPuppetDb\Query\NodesEnvironmentsQueryBuilder');
$service->setNodesEnvi... | php | public function createService(ServiceLocatorInterface $serviceLocator)
{
$service = new NodeStatisticsDataContextBuilder();
/** @var QueryBuilderInterface $queryBuilder */
$queryBuilder = $serviceLocator->get('KmbPuppetDb\Query\NodesEnvironmentsQueryBuilder');
$service->setNodesEnvi... | [
"public",
"function",
"createService",
"(",
"ServiceLocatorInterface",
"$",
"serviceLocator",
")",
"{",
"$",
"service",
"=",
"new",
"NodeStatisticsDataContextBuilder",
"(",
")",
";",
"/** @var QueryBuilderInterface $queryBuilder */",
"$",
"queryBuilder",
"=",
"$",
"servic... | Create service
@param ServiceLocatorInterface $serviceLocator
@return mixed | [
"Create",
"service"
] | train | https://github.com/kambalabs/KmbCache/blob/9865ccde8f17fa5ad0ace103e50c164559a389f0/src/KmbCache/Service/NodeStatisticsDataContextBuilderFactory.php#L36-L49 |
jenskooij/cloudcontrol | src/components/FormComponent.php | FormComponent.run | public function run(Storage $storage)
{
parent::run($storage);
$this->checkParameters();
$this->checkRequiredParameters();
$this->setFormId();
$this->initialize($storage);
$this->checkSubmit($storage);
} | php | public function run(Storage $storage)
{
parent::run($storage);
$this->checkParameters();
$this->checkRequiredParameters();
$this->setFormId();
$this->initialize($storage);
$this->checkSubmit($storage);
} | [
"public",
"function",
"run",
"(",
"Storage",
"$",
"storage",
")",
"{",
"parent",
"::",
"run",
"(",
"$",
"storage",
")",
";",
"$",
"this",
"->",
"checkParameters",
"(",
")",
";",
"$",
"this",
"->",
"checkRequiredParameters",
"(",
")",
";",
"$",
"this",
... | @param Storage $storage
@return void
@throws \Exception | [
"@param",
"Storage",
"$storage"
] | train | https://github.com/jenskooij/cloudcontrol/blob/76e5d9ac8f9c50d06d39a995d13cc03742536548/src/components/FormComponent.php#L74-L82 |
jenskooij/cloudcontrol | src/components/FormComponent.php | FormComponent.render | public function render($application = null)
{
$request = $this->setPathBackup();
$form = $this->renderTemplate($this->subTemplate);
$this->resetPathBackup($request);
$this->setFormParameter($form);
parent::render($application);
} | php | public function render($application = null)
{
$request = $this->setPathBackup();
$form = $this->renderTemplate($this->subTemplate);
$this->resetPathBackup($request);
$this->setFormParameter($form);
parent::render($application);
} | [
"public",
"function",
"render",
"(",
"$",
"application",
"=",
"null",
")",
"{",
"$",
"request",
"=",
"$",
"this",
"->",
"setPathBackup",
"(",
")",
";",
"$",
"form",
"=",
"$",
"this",
"->",
"renderTemplate",
"(",
"$",
"this",
"->",
"subTemplate",
")",
... | @param null|Application $application
@throws \Exception | [
"@param",
"null|Application",
"$application"
] | train | https://github.com/jenskooij/cloudcontrol/blob/76e5d9ac8f9c50d06d39a995d13cc03742536548/src/components/FormComponent.php#L89-L97 |
jenskooij/cloudcontrol | src/components/FormComponent.php | FormComponent.checkParameters | protected function checkParameters()
{
$this->checkDocumentTypeParameter();
$this->checkResponseFolderParameter();
$this->checkSubTemplateParameter();
$this->checkFormParameterNameParameter();
$this->checkThankYouMessageParameter();
$this->checkSubmitOncePerSessionPar... | php | protected function checkParameters()
{
$this->checkDocumentTypeParameter();
$this->checkResponseFolderParameter();
$this->checkSubTemplateParameter();
$this->checkFormParameterNameParameter();
$this->checkThankYouMessageParameter();
$this->checkSubmitOncePerSessionPar... | [
"protected",
"function",
"checkParameters",
"(",
")",
"{",
"$",
"this",
"->",
"checkDocumentTypeParameter",
"(",
")",
";",
"$",
"this",
"->",
"checkResponseFolderParameter",
"(",
")",
";",
"$",
"this",
"->",
"checkSubTemplateParameter",
"(",
")",
";",
"$",
"th... | Checks if parameters were given in the CMS configuration and
sets them to their respective fields | [
"Checks",
"if",
"parameters",
"were",
"given",
"in",
"the",
"CMS",
"configuration",
"and",
"sets",
"them",
"to",
"their",
"respective",
"fields"
] | train | https://github.com/jenskooij/cloudcontrol/blob/76e5d9ac8f9c50d06d39a995d13cc03742536548/src/components/FormComponent.php#L103-L111 |
jenskooij/cloudcontrol | src/components/FormComponent.php | FormComponent.initialize | protected function initialize($storage)
{
$this->parameters[self::PARAMETER_SMALLEST_IMAGE] = $storage->getImageSet()->getSmallestImageSet();
$this->parameters[self::PARAMETER_CMS_PREFIX] = '';
$this->parameters[self::PARAMETER_DOCUMENT_TYPE] = $this->storage->getDocumentTypes()->getDocumen... | php | protected function initialize($storage)
{
$this->parameters[self::PARAMETER_SMALLEST_IMAGE] = $storage->getImageSet()->getSmallestImageSet();
$this->parameters[self::PARAMETER_CMS_PREFIX] = '';
$this->parameters[self::PARAMETER_DOCUMENT_TYPE] = $this->storage->getDocumentTypes()->getDocumen... | [
"protected",
"function",
"initialize",
"(",
"$",
"storage",
")",
"{",
"$",
"this",
"->",
"parameters",
"[",
"self",
"::",
"PARAMETER_SMALLEST_IMAGE",
"]",
"=",
"$",
"storage",
"->",
"getImageSet",
"(",
")",
"->",
"getSmallestImageSet",
"(",
")",
";",
"$",
... | Sets variables needed for rendering the form template
@param Storage $storage | [
"Sets",
"variables",
"needed",
"for",
"rendering",
"the",
"form",
"template"
] | train | https://github.com/jenskooij/cloudcontrol/blob/76e5d9ac8f9c50d06d39a995d13cc03742536548/src/components/FormComponent.php#L118-L128 |
jenskooij/cloudcontrol | src/components/FormComponent.php | FormComponent.checkSubmit | protected function checkSubmit($storage)
{
if ($this->isFormSubmitted($this->request) && $this->isSubmitAllowed()) {
$postValues = $this->getPostValues($this->request);
$this->setUserSessionBackup();
$storage->getDocuments()->addDocument($postValues);
$this->r... | php | protected function checkSubmit($storage)
{
if ($this->isFormSubmitted($this->request) && $this->isSubmitAllowed()) {
$postValues = $this->getPostValues($this->request);
$this->setUserSessionBackup();
$storage->getDocuments()->addDocument($postValues);
$this->r... | [
"protected",
"function",
"checkSubmit",
"(",
"$",
"storage",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isFormSubmitted",
"(",
"$",
"this",
"->",
"request",
")",
"&&",
"$",
"this",
"->",
"isSubmitAllowed",
"(",
")",
")",
"{",
"$",
"postValues",
"=",
"$",... | If the form has been submitted, save the document
Calls $this->postSubmit() afterwards
@param Storage $storage
@throws \Exception | [
"If",
"the",
"form",
"has",
"been",
"submitted",
"save",
"the",
"document",
"Calls",
"$this",
"-",
">",
"postSubmit",
"()",
"afterwards"
] | train | https://github.com/jenskooij/cloudcontrol/blob/76e5d9ac8f9c50d06d39a995d13cc03742536548/src/components/FormComponent.php#L137-L147 |
jenskooij/cloudcontrol | src/components/FormComponent.php | FormComponent.setFormId | protected function setFormId()
{
if (isset($_SESSION[self::SESSION_PARAMETER_FORM_COMPONENT][$this->formParameterName][self::PARAMETER_FORM_ID])) {
$this->formId = $_SESSION[self::SESSION_PARAMETER_FORM_COMPONENT][$this->formParameterName][self::PARAMETER_FORM_ID];
} else {
$... | php | protected function setFormId()
{
if (isset($_SESSION[self::SESSION_PARAMETER_FORM_COMPONENT][$this->formParameterName][self::PARAMETER_FORM_ID])) {
$this->formId = $_SESSION[self::SESSION_PARAMETER_FORM_COMPONENT][$this->formParameterName][self::PARAMETER_FORM_ID];
} else {
$... | [
"protected",
"function",
"setFormId",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"_SESSION",
"[",
"self",
"::",
"SESSION_PARAMETER_FORM_COMPONENT",
"]",
"[",
"$",
"this",
"->",
"formParameterName",
"]",
"[",
"self",
"::",
"PARAMETER_FORM_ID",
"]",
")",
")"... | Sets a unique id for this particular form, so it can recognize
it when a submit occurs | [
"Sets",
"a",
"unique",
"id",
"for",
"this",
"particular",
"form",
"so",
"it",
"can",
"recognize",
"it",
"when",
"a",
"submit",
"occurs"
] | train | https://github.com/jenskooij/cloudcontrol/blob/76e5d9ac8f9c50d06d39a995d13cc03742536548/src/components/FormComponent.php#L169-L178 |
jenskooij/cloudcontrol | src/components/FormComponent.php | FormComponent.setUserSessionBackup | protected function setUserSessionBackup()
{
$this->userSessionBackup = isset($_SESSION[self::SESSION_PARAMETER_CLOUDCONTROL]) ? $_SESSION[self::SESSION_PARAMETER_CLOUDCONTROL] : null;
$fakeUser = new \stdClass();
$fakeUser->username = self::SESSION_PARAMETER_FORM_COMPONENT;
$_SESSION... | php | protected function setUserSessionBackup()
{
$this->userSessionBackup = isset($_SESSION[self::SESSION_PARAMETER_CLOUDCONTROL]) ? $_SESSION[self::SESSION_PARAMETER_CLOUDCONTROL] : null;
$fakeUser = new \stdClass();
$fakeUser->username = self::SESSION_PARAMETER_FORM_COMPONENT;
$_SESSION... | [
"protected",
"function",
"setUserSessionBackup",
"(",
")",
"{",
"$",
"this",
"->",
"userSessionBackup",
"=",
"isset",
"(",
"$",
"_SESSION",
"[",
"self",
"::",
"SESSION_PARAMETER_CLOUDCONTROL",
"]",
")",
"?",
"$",
"_SESSION",
"[",
"self",
"::",
"SESSION_PARAMETER... | Temporarily stores the current user session in a backup variable
and sets a fake user instead | [
"Temporarily",
"stores",
"the",
"current",
"user",
"session",
"in",
"a",
"backup",
"variable",
"and",
"sets",
"a",
"fake",
"user",
"instead"
] | train | https://github.com/jenskooij/cloudcontrol/blob/76e5d9ac8f9c50d06d39a995d13cc03742536548/src/components/FormComponent.php#L198-L204 |
jenskooij/cloudcontrol | src/components/FormComponent.php | FormComponent.restoreUserSessionBackup | protected function restoreUserSessionBackup()
{
if ($this->userSessionBackup === null) {
unset($_SESSION[self::SESSION_PARAMETER_CLOUDCONTROL]);
} else {
$_SESSION[self::SESSION_PARAMETER_CLOUDCONTROL] = $this->userSessionBackup;
}
} | php | protected function restoreUserSessionBackup()
{
if ($this->userSessionBackup === null) {
unset($_SESSION[self::SESSION_PARAMETER_CLOUDCONTROL]);
} else {
$_SESSION[self::SESSION_PARAMETER_CLOUDCONTROL] = $this->userSessionBackup;
}
} | [
"protected",
"function",
"restoreUserSessionBackup",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"userSessionBackup",
"===",
"null",
")",
"{",
"unset",
"(",
"$",
"_SESSION",
"[",
"self",
"::",
"SESSION_PARAMETER_CLOUDCONTROL",
"]",
")",
";",
"}",
"else",
"{... | Removes the fake user and restores the existing user
session if it was there | [
"Removes",
"the",
"fake",
"user",
"and",
"restores",
"the",
"existing",
"user",
"session",
"if",
"it",
"was",
"there"
] | train | https://github.com/jenskooij/cloudcontrol/blob/76e5d9ac8f9c50d06d39a995d13cc03742536548/src/components/FormComponent.php#L210-L217 |
jenskooij/cloudcontrol | src/components/FormComponent.php | FormComponent.checkFormIdInPost | private function checkFormIdInPost($request)
{
if (!isset($request::$post[self::PARAMETER_FORM_ID])) {
return false;
}
if (!$request::$post[self::PARAMETER_FORM_ID] === $this->formId) {
return false;
}
return true;
} | php | private function checkFormIdInPost($request)
{
if (!isset($request::$post[self::PARAMETER_FORM_ID])) {
return false;
}
if (!$request::$post[self::PARAMETER_FORM_ID] === $this->formId) {
return false;
}
return true;
} | [
"private",
"function",
"checkFormIdInPost",
"(",
"$",
"request",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"request",
"::",
"$",
"post",
"[",
"self",
"::",
"PARAMETER_FORM_ID",
"]",
")",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"!",
"$",
... | Checks if form id is set in _POST variable
@param $request
@return bool | [
"Checks",
"if",
"form",
"id",
"is",
"set",
"in",
"_POST",
"variable"
] | train | https://github.com/jenskooij/cloudcontrol/blob/76e5d9ac8f9c50d06d39a995d13cc03742536548/src/components/FormComponent.php#L364-L375 |
jenskooij/cloudcontrol | src/components/FormComponent.php | FormComponent.checkFormIdInSession | private function checkFormIdInSession()
{
if (!isset($_SESSION[self::SESSION_PARAMETER_FORM_COMPONENT][$this->formParameterName][self::PARAMETER_FORM_ID])) {
return false;
}
if (!$_SESSION[self::SESSION_PARAMETER_FORM_COMPONENT][$this->formParameterName][self::PARAMETER_FORM_ID]... | php | private function checkFormIdInSession()
{
if (!isset($_SESSION[self::SESSION_PARAMETER_FORM_COMPONENT][$this->formParameterName][self::PARAMETER_FORM_ID])) {
return false;
}
if (!$_SESSION[self::SESSION_PARAMETER_FORM_COMPONENT][$this->formParameterName][self::PARAMETER_FORM_ID]... | [
"private",
"function",
"checkFormIdInSession",
"(",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"_SESSION",
"[",
"self",
"::",
"SESSION_PARAMETER_FORM_COMPONENT",
"]",
"[",
"$",
"this",
"->",
"formParameterName",
"]",
"[",
"self",
"::",
"PARAMETER_FORM_ID",
"... | Checks if form is is set in _SESSION variable
@return bool | [
"Checks",
"if",
"form",
"is",
"is",
"set",
"in",
"_SESSION",
"variable"
] | train | https://github.com/jenskooij/cloudcontrol/blob/76e5d9ac8f9c50d06d39a995d13cc03742536548/src/components/FormComponent.php#L381-L392 |
DreadLabs/app-migration | src/Mediator.php | Mediator.negotiate | public function negotiate()
{
// This is a workaround for PHP5.5, @see https://github.com/sebastianbergmann/phpunit-mock-objects/issues/143#issuecomment-108148498
$catchedException = null;
try {
$this->lock->acquire();
$this->executeMigrations();
} catch (Loc... | php | public function negotiate()
{
// This is a workaround for PHP5.5, @see https://github.com/sebastianbergmann/phpunit-mock-objects/issues/143#issuecomment-108148498
$catchedException = null;
try {
$this->lock->acquire();
$this->executeMigrations();
} catch (Loc... | [
"public",
"function",
"negotiate",
"(",
")",
"{",
"// This is a workaround for PHP5.5, @see https://github.com/sebastianbergmann/phpunit-mock-objects/issues/143#issuecomment-108148498",
"$",
"catchedException",
"=",
"null",
";",
"try",
"{",
"$",
"this",
"->",
"lock",
"->",
"acq... | Negotiates the migration process
@return void
@throws MigrationException If something went wrong with the involved
components | [
"Negotiates",
"the",
"migration",
"process"
] | train | https://github.com/DreadLabs/app-migration/blob/a416d770c51db28db9750251b40cd4f13e57c148/src/Mediator.php#L72-L99 |
DreadLabs/app-migration | src/Mediator.php | Mediator.executeMigrations | private function executeMigrations()
{
if ($this->migrator->needsToRun()) {
$latestVersion = $this->migrator->migrate();
$this->logger->info('Migrate all migrations up to version ' . $latestVersion . '.');
}
} | php | private function executeMigrations()
{
if ($this->migrator->needsToRun()) {
$latestVersion = $this->migrator->migrate();
$this->logger->info('Migrate all migrations up to version ' . $latestVersion . '.');
}
} | [
"private",
"function",
"executeMigrations",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"migrator",
"->",
"needsToRun",
"(",
")",
")",
"{",
"$",
"latestVersion",
"=",
"$",
"this",
"->",
"migrator",
"->",
"migrate",
"(",
")",
";",
"$",
"this",
"->",
... | Executes migrations
@return void | [
"Executes",
"migrations"
] | train | https://github.com/DreadLabs/app-migration/blob/a416d770c51db28db9750251b40cd4f13e57c148/src/Mediator.php#L106-L112 |
Innmind/Math | src/Geometry/Theorem/AlKashi.php | AlKashi.angle | public static function angle(
Segment $a,
Segment $b,
Segment $c
): Degree {
$a = $a->length();
$b = $b->length();
$c = $c->length();
$longest = max($a, $b, $c);
$opposites = (new Set(Number::class))
->add($a)
->add($b)
... | php | public static function angle(
Segment $a,
Segment $b,
Segment $c
): Degree {
$a = $a->length();
$b = $b->length();
$c = $c->length();
$longest = max($a, $b, $c);
$opposites = (new Set(Number::class))
->add($a)
->add($b)
... | [
"public",
"static",
"function",
"angle",
"(",
"Segment",
"$",
"a",
",",
"Segment",
"$",
"b",
",",
"Segment",
"$",
"c",
")",
":",
"Degree",
"{",
"$",
"a",
"=",
"$",
"a",
"->",
"length",
"(",
")",
";",
"$",
"b",
"=",
"$",
"b",
"->",
"length",
"... | Return the angle between a and b sides | [
"Return",
"the",
"angle",
"between",
"a",
"and",
"b",
"sides"
] | train | https://github.com/Innmind/Math/blob/ac9ad4dd1852c145e90f5edc0f38a873b125a50b/src/Geometry/Theorem/AlKashi.php#L55-L86 |
davewwww/Ispec | src/Dwo/Ispec/Helper/IpInfoHelper.php | IpInfoHelper.getIp | public static function getIp(IpInfo $ipInfo)
{
$ip = $ipInfo->ip;
if (empty($ip)) {
if (empty($ipInfo->subnet)) {
throw new IspecException('no ip found');
}
list($ip) = explode('/', $ipInfo->subnet, 2);
}
return $ip;
} | php | public static function getIp(IpInfo $ipInfo)
{
$ip = $ipInfo->ip;
if (empty($ip)) {
if (empty($ipInfo->subnet)) {
throw new IspecException('no ip found');
}
list($ip) = explode('/', $ipInfo->subnet, 2);
}
return $ip;
} | [
"public",
"static",
"function",
"getIp",
"(",
"IpInfo",
"$",
"ipInfo",
")",
"{",
"$",
"ip",
"=",
"$",
"ipInfo",
"->",
"ip",
";",
"if",
"(",
"empty",
"(",
"$",
"ip",
")",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"ipInfo",
"->",
"subnet",
")",
")"... | @param IpInfo $ipInfo
@return IpInfo
@throws IspecException | [
"@param",
"IpInfo",
"$ipInfo"
] | train | https://github.com/davewwww/Ispec/blob/06e40344eaad27715c87c8f6830ab4894e89736d/src/Dwo/Ispec/Helper/IpInfoHelper.php#L22-L34 |
davewwww/Ispec | src/Dwo/Ispec/Helper/IpInfoHelper.php | IpInfoHelper.isIpInSubnets | public static function isIpInSubnets($ip, array $entries, &$entryReturn = null)
{
$ipObj = Factory::getAddress($ip);
foreach ($entries as $entry) {
if (Factory::getExpression(self::getSubnet($entry))->matches($ipObj)) {
$entryReturn = $entry;
return true... | php | public static function isIpInSubnets($ip, array $entries, &$entryReturn = null)
{
$ipObj = Factory::getAddress($ip);
foreach ($entries as $entry) {
if (Factory::getExpression(self::getSubnet($entry))->matches($ipObj)) {
$entryReturn = $entry;
return true... | [
"public",
"static",
"function",
"isIpInSubnets",
"(",
"$",
"ip",
",",
"array",
"$",
"entries",
",",
"&",
"$",
"entryReturn",
"=",
"null",
")",
"{",
"$",
"ipObj",
"=",
"Factory",
"::",
"getAddress",
"(",
"$",
"ip",
")",
";",
"foreach",
"(",
"$",
"entr... | @param string $ip
@param array|IpInfo[] $entries
@param mixed $entryReturn
@return bool | [
"@param",
"string",
"$ip",
"@param",
"array|IpInfo",
"[]",
"$entries",
"@param",
"mixed",
"$entryReturn"
] | train | https://github.com/davewwww/Ispec/blob/06e40344eaad27715c87c8f6830ab4894e89736d/src/Dwo/Ispec/Helper/IpInfoHelper.php#L43-L56 |
davewwww/Ispec | src/Dwo/Ispec/Helper/IpInfoHelper.php | IpInfoHelper.getSubnet | public static function getSubnet($data)
{
$subnet = null;
if ($data instanceof IpInfo) {
$subnet = $data->subnet;
} elseif (is_array($data) && isset($data['subnet'])) {
$subnet = $data['subnet'];
} else {
throw new IspecException('key "subnet" is ... | php | public static function getSubnet($data)
{
$subnet = null;
if ($data instanceof IpInfo) {
$subnet = $data->subnet;
} elseif (is_array($data) && isset($data['subnet'])) {
$subnet = $data['subnet'];
} else {
throw new IspecException('key "subnet" is ... | [
"public",
"static",
"function",
"getSubnet",
"(",
"$",
"data",
")",
"{",
"$",
"subnet",
"=",
"null",
";",
"if",
"(",
"$",
"data",
"instanceof",
"IpInfo",
")",
"{",
"$",
"subnet",
"=",
"$",
"data",
"->",
"subnet",
";",
"}",
"elseif",
"(",
"is_array",
... | @return object|array $data
@return string
@throws IspecException | [
"@return",
"object|array",
"$data"
] | train | https://github.com/davewwww/Ispec/blob/06e40344eaad27715c87c8f6830ab4894e89736d/src/Dwo/Ispec/Helper/IpInfoHelper.php#L64-L77 |
fridge-project/dbal | src/Fridge/DBAL/Driver/MysqliDriver.php | MysqliDriver.connect | public function connect(array $parameters, $username = null, $password = null, array $driverOptions = array())
{
return new MysqliConnection($parameters, $username, $password);
} | php | public function connect(array $parameters, $username = null, $password = null, array $driverOptions = array())
{
return new MysqliConnection($parameters, $username, $password);
} | [
"public",
"function",
"connect",
"(",
"array",
"$",
"parameters",
",",
"$",
"username",
"=",
"null",
",",
"$",
"password",
"=",
"null",
",",
"array",
"$",
"driverOptions",
"=",
"array",
"(",
")",
")",
"{",
"return",
"new",
"MysqliConnection",
"(",
"$",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/Driver/MysqliDriver.php#L29-L32 |
PenoaksDev/Milky-Framework | src/Milky/Framework.php | Framework.buildPath | public function buildPath()
{
$slugs = func_get_args();
if ( is_array( $slugs[0] ) )
$slugs = $slugs[0];
if ( count( $slugs ) == 0 )
return $this->basePath;
if ( Str::startsWith( $slugs[0], '__' ) )
{
$key = substr( $slugs[0], 2 );
if ( $key == 'base' )
$slugs[0] = $this->basePath;
else... | php | public function buildPath()
{
$slugs = func_get_args();
if ( is_array( $slugs[0] ) )
$slugs = $slugs[0];
if ( count( $slugs ) == 0 )
return $this->basePath;
if ( Str::startsWith( $slugs[0], '__' ) )
{
$key = substr( $slugs[0], 2 );
if ( $key == 'base' )
$slugs[0] = $this->basePath;
else... | [
"public",
"function",
"buildPath",
"(",
")",
"{",
"$",
"slugs",
"=",
"func_get_args",
"(",
")",
";",
"if",
"(",
"is_array",
"(",
"$",
"slugs",
"[",
"0",
"]",
")",
")",
"$",
"slugs",
"=",
"$",
"slugs",
"[",
"0",
"]",
";",
"if",
"(",
"count",
"("... | Append args to the base path
@return string
@throws FrameworkException | [
"Append",
"args",
"to",
"the",
"base",
"path"
] | train | https://github.com/PenoaksDev/Milky-Framework/blob/8afd7156610a70371aa5b1df50b8a212bf7b142c/src/Milky/Framework.php#L237-L279 |
PenoaksDev/Milky-Framework | src/Milky/Framework.php | Framework.environment | public static function environment()
{
$env = static::fw()->config->get( 'app.env', 'production' );
if ( func_num_args() > 0 )
{
$patterns = is_array( func_get_arg( 0 ) ) ? func_get_arg( 0 ) : func_get_args();
foreach ( $patterns as $pattern )
if ( Str::is( $pattern, $env ) )
return true;
re... | php | public static function environment()
{
$env = static::fw()->config->get( 'app.env', 'production' );
if ( func_num_args() > 0 )
{
$patterns = is_array( func_get_arg( 0 ) ) ? func_get_arg( 0 ) : func_get_args();
foreach ( $patterns as $pattern )
if ( Str::is( $pattern, $env ) )
return true;
re... | [
"public",
"static",
"function",
"environment",
"(",
")",
"{",
"$",
"env",
"=",
"static",
"::",
"fw",
"(",
")",
"->",
"config",
"->",
"get",
"(",
"'app.env'",
",",
"'production'",
")",
";",
"if",
"(",
"func_num_args",
"(",
")",
">",
"0",
")",
"{",
"... | Get or check the current application environment.
@param mixed
@return string | [
"Get",
"or",
"check",
"the",
"current",
"application",
"environment",
"."
] | train | https://github.com/PenoaksDev/Milky-Framework/blob/8afd7156610a70371aa5b1df50b8a212bf7b142c/src/Milky/Framework.php#L335-L351 |
Subscribo/klarna-invoice-sdk-wrapped | src/Language.php | KlarnaLanguage.fromCode | public static function fromCode($val)
{
$val = strtoupper($val);
if (array_key_exists($val, self::$_languages)) {
return self::$_languages[$val];
}
return null;
} | php | public static function fromCode($val)
{
$val = strtoupper($val);
if (array_key_exists($val, self::$_languages)) {
return self::$_languages[$val];
}
return null;
} | [
"public",
"static",
"function",
"fromCode",
"(",
"$",
"val",
")",
"{",
"$",
"val",
"=",
"strtoupper",
"(",
"$",
"val",
")",
";",
"if",
"(",
"array_key_exists",
"(",
"$",
"val",
",",
"self",
"::",
"$",
"_languages",
")",
")",
"{",
"return",
"self",
... | Converts a language code, e.g. 'de' to the KlarnaLanguage constant.
@param string $val language code
@return int|null | [
"Converts",
"a",
"language",
"code",
"e",
".",
"g",
".",
"de",
"to",
"the",
"KlarnaLanguage",
"constant",
"."
] | train | https://github.com/Subscribo/klarna-invoice-sdk-wrapped/blob/4a45ddd9ec444f5a6d02628ad65e635a3e12611c/src/Language.php#L92-L99 |
Subscribo/klarna-invoice-sdk-wrapped | src/Language.php | KlarnaLanguage.getCode | public static function getCode($val)
{
if (self::$_languageFlip === array()) {
self::$_languageFlip = array_flip(self::$_languages);
}
if (array_key_exists($val, self::$_languageFlip)) {
return strtolower(self::$_languageFlip[$val]);
}
return null;
... | php | public static function getCode($val)
{
if (self::$_languageFlip === array()) {
self::$_languageFlip = array_flip(self::$_languages);
}
if (array_key_exists($val, self::$_languageFlip)) {
return strtolower(self::$_languageFlip[$val]);
}
return null;
... | [
"public",
"static",
"function",
"getCode",
"(",
"$",
"val",
")",
"{",
"if",
"(",
"self",
"::",
"$",
"_languageFlip",
"===",
"array",
"(",
")",
")",
"{",
"self",
"::",
"$",
"_languageFlip",
"=",
"array_flip",
"(",
"self",
"::",
"$",
"_languages",
")",
... | Converts a KlarnaLanguage constant to the respective language code.
@param int $val KlarnaLanguage constant
@return lowercase string|null | [
"Converts",
"a",
"KlarnaLanguage",
"constant",
"to",
"the",
"respective",
"language",
"code",
"."
] | train | https://github.com/Subscribo/klarna-invoice-sdk-wrapped/blob/4a45ddd9ec444f5a6d02628ad65e635a3e12611c/src/Language.php#L108-L117 |
rafflesargentina/l5-filterable-sortable | src/QuerySorters.php | QuerySorters.apply | public function apply(Builder $builder)
{
$this->builder = $builder;
if (method_exists($this, $this->orderBy())) {
call_user_func([$this, $this->orderBy()]);
}
return $this->builder;
} | php | public function apply(Builder $builder)
{
$this->builder = $builder;
if (method_exists($this, $this->orderBy())) {
call_user_func([$this, $this->orderBy()]);
}
return $this->builder;
} | [
"public",
"function",
"apply",
"(",
"Builder",
"$",
"builder",
")",
"{",
"$",
"this",
"->",
"builder",
"=",
"$",
"builder",
";",
"if",
"(",
"method_exists",
"(",
"$",
"this",
",",
"$",
"this",
"->",
"orderBy",
"(",
")",
")",
")",
"{",
"call_user_func... | Apply the sorter to the builder.
@param Builder $builder The builder instance.
@return Builder | [
"Apply",
"the",
"sorter",
"to",
"the",
"builder",
"."
] | train | https://github.com/rafflesargentina/l5-filterable-sortable/blob/eb3ecf399145ec7c5241ba2134ed0bea2057e6c3/src/QuerySorters.php#L82-L91 |
rafflesargentina/l5-filterable-sortable | src/QuerySorters.php | QuerySorters.listOrderByKeys | public static function listOrderByKeys()
{
$classMethods = get_class_methods(get_class());
$calledClassMethods = get_class_methods(get_called_class());
$filteredMethods = array_filter(
$calledClassMethods, function ($calledClassMethod) use ($classMethods) {
retur... | php | public static function listOrderByKeys()
{
$classMethods = get_class_methods(get_class());
$calledClassMethods = get_class_methods(get_called_class());
$filteredMethods = array_filter(
$calledClassMethods, function ($calledClassMethod) use ($classMethods) {
retur... | [
"public",
"static",
"function",
"listOrderByKeys",
"(",
")",
"{",
"$",
"classMethods",
"=",
"get_class_methods",
"(",
"get_class",
"(",
")",
")",
";",
"$",
"calledClassMethods",
"=",
"get_class_methods",
"(",
"get_called_class",
"(",
")",
")",
";",
"$",
"filte... | Pluck all sorters from class methods.
@return array | [
"Pluck",
"all",
"sorters",
"from",
"class",
"methods",
"."
] | train | https://github.com/rafflesargentina/l5-filterable-sortable/blob/eb3ecf399145ec7c5241ba2134ed0bea2057e6c3/src/QuerySorters.php#L139-L156 |
rafflesargentina/l5-filterable-sortable | src/QuerySorters.php | QuerySorters.getAppliedSorters | public static function getAppliedSorters()
{
$order = static::getOrderKey();
$orderBy = static::getOrderByKey();
$applied = \Illuminate\Support\Facades\Request::only($order, $orderBy);
$applied = array_filter($applied);
$default = [
$orderBy => static::getDefau... | php | public static function getAppliedSorters()
{
$order = static::getOrderKey();
$orderBy = static::getOrderByKey();
$applied = \Illuminate\Support\Facades\Request::only($order, $orderBy);
$applied = array_filter($applied);
$default = [
$orderBy => static::getDefau... | [
"public",
"static",
"function",
"getAppliedSorters",
"(",
")",
"{",
"$",
"order",
"=",
"static",
"::",
"getOrderKey",
"(",
")",
";",
"$",
"orderBy",
"=",
"static",
"::",
"getOrderByKey",
"(",
")",
";",
"$",
"applied",
"=",
"\\",
"Illuminate",
"\\",
"Supp... | Get applied sorters from request or fallback to default.
@return array | [
"Get",
"applied",
"sorters",
"from",
"request",
"or",
"fallback",
"to",
"default",
"."
] | train | https://github.com/rafflesargentina/l5-filterable-sortable/blob/eb3ecf399145ec7c5241ba2134ed0bea2057e6c3/src/QuerySorters.php#L163-L178 |
RetItaliaSpA/AuthenticationBundle | Security/GoogleAuthenticator.php | GoogleAuthenticator.getCredentials | public function getCredentials(Request $request)
{
// this method is only called if supports() returns true
// For Symfony lower than 3.4 the supports method need to be called manually here:
// if (!$this->supports($request)) {
// return null;
// }
$accessToken=... | php | public function getCredentials(Request $request)
{
// this method is only called if supports() returns true
// For Symfony lower than 3.4 the supports method need to be called manually here:
// if (!$this->supports($request)) {
// return null;
// }
$accessToken=... | [
"public",
"function",
"getCredentials",
"(",
"Request",
"$",
"request",
")",
"{",
"// this method is only called if supports() returns true",
"// For Symfony lower than 3.4 the supports method need to be called manually here:",
"// if (!$this->supports($request)) {",
"// return null;",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/RetItaliaSpA/AuthenticationBundle/blob/4c2b28d0d290a68ade9215f872c417749deea2cd/Security/GoogleAuthenticator.php#L93-L109 |
RetItaliaSpA/AuthenticationBundle | Security/GoogleAuthenticator.php | GoogleAuthenticator.getUser | public function getUser($credentials, UserProviderInterface $userProvider)
{
/** @var GoogleUser $googleUser */
$googleUser = $this->getGoogleClient()
->fetchUserFromToken($credentials);
$email = $googleUser->getEmail();
//Setto la variabile autorizzato a false
... | php | public function getUser($credentials, UserProviderInterface $userProvider)
{
/** @var GoogleUser $googleUser */
$googleUser = $this->getGoogleClient()
->fetchUserFromToken($credentials);
$email = $googleUser->getEmail();
//Setto la variabile autorizzato a false
... | [
"public",
"function",
"getUser",
"(",
"$",
"credentials",
",",
"UserProviderInterface",
"$",
"userProvider",
")",
"{",
"/** @var GoogleUser $googleUser */",
"$",
"googleUser",
"=",
"$",
"this",
"->",
"getGoogleClient",
"(",
")",
"->",
"fetchUserFromToken",
"(",
"$",... | {@inheritdoc} | [
"{"
] | train | https://github.com/RetItaliaSpA/AuthenticationBundle/blob/4c2b28d0d290a68ade9215f872c417749deea2cd/Security/GoogleAuthenticator.php#L114-L153 |
RetItaliaSpA/AuthenticationBundle | Security/GoogleAuthenticator.php | GoogleAuthenticator.checkCredentials | public function checkCredentials($credentials, UserInterface $user)
{
/*if ($user->getPassword() === $credentials['password']) {
return true;
}*/
//return true;
if (empty($user->getIdUtente()))
throw new CustomUserMessageAuthenticationException($this->failMess... | php | public function checkCredentials($credentials, UserInterface $user)
{
/*if ($user->getPassword() === $credentials['password']) {
return true;
}*/
//return true;
if (empty($user->getIdUtente()))
throw new CustomUserMessageAuthenticationException($this->failMess... | [
"public",
"function",
"checkCredentials",
"(",
"$",
"credentials",
",",
"UserInterface",
"$",
"user",
")",
"{",
"/*if ($user->getPassword() === $credentials['password']) {\n return true;\n }*/",
"//return true;",
"if",
"(",
"empty",
"(",
"$",
"user",
"->",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/RetItaliaSpA/AuthenticationBundle/blob/4c2b28d0d290a68ade9215f872c417749deea2cd/Security/GoogleAuthenticator.php#L168-L177 |
RetItaliaSpA/AuthenticationBundle | Security/GoogleAuthenticator.php | GoogleAuthenticator.onAuthenticationSuccess | public function onAuthenticationSuccess(Request $request, TokenInterface $token, $providerKey)
{
$session = $request->getSession();
// on success, let the request continue
$key = '_security.main.target_path'; #where "main" is your firewall name
//check if the referrer session key h... | php | public function onAuthenticationSuccess(Request $request, TokenInterface $token, $providerKey)
{
$session = $request->getSession();
// on success, let the request continue
$key = '_security.main.target_path'; #where "main" is your firewall name
//check if the referrer session key h... | [
"public",
"function",
"onAuthenticationSuccess",
"(",
"Request",
"$",
"request",
",",
"TokenInterface",
"$",
"token",
",",
"$",
"providerKey",
")",
"{",
"$",
"session",
"=",
"$",
"request",
"->",
"getSession",
"(",
")",
";",
"// on success, let the request continu... | {@inheritdoc} | [
"{"
] | train | https://github.com/RetItaliaSpA/AuthenticationBundle/blob/4c2b28d0d290a68ade9215f872c417749deea2cd/Security/GoogleAuthenticator.php#L182-L203 |
RetItaliaSpA/AuthenticationBundle | Security/GoogleAuthenticator.php | GoogleAuthenticator.onAuthenticationFailure | public function onAuthenticationFailure(Request $request, AuthenticationException $exception)
{
$request->getSession()->set(Security::AUTHENTICATION_ERROR, $exception);
$url = $this->router->generate('nonAutorizzato');
return new RedirectResponse($url);
} | php | public function onAuthenticationFailure(Request $request, AuthenticationException $exception)
{
$request->getSession()->set(Security::AUTHENTICATION_ERROR, $exception);
$url = $this->router->generate('nonAutorizzato');
return new RedirectResponse($url);
} | [
"public",
"function",
"onAuthenticationFailure",
"(",
"Request",
"$",
"request",
",",
"AuthenticationException",
"$",
"exception",
")",
"{",
"$",
"request",
"->",
"getSession",
"(",
")",
"->",
"set",
"(",
"Security",
"::",
"AUTHENTICATION_ERROR",
",",
"$",
"exce... | {@inheritdoc} | [
"{"
] | train | https://github.com/RetItaliaSpA/AuthenticationBundle/blob/4c2b28d0d290a68ade9215f872c417749deea2cd/Security/GoogleAuthenticator.php#L208-L213 |
RetItaliaSpA/AuthenticationBundle | Security/GoogleAuthenticator.php | GoogleAuthenticator.start | public function start(Request $request, AuthenticationException $authException = null)
{
$url = $this->router->generate('login');
return new RedirectResponse($url);
} | php | public function start(Request $request, AuthenticationException $authException = null)
{
$url = $this->router->generate('login');
return new RedirectResponse($url);
} | [
"public",
"function",
"start",
"(",
"Request",
"$",
"request",
",",
"AuthenticationException",
"$",
"authException",
"=",
"null",
")",
"{",
"$",
"url",
"=",
"$",
"this",
"->",
"router",
"->",
"generate",
"(",
"'login'",
")",
";",
"return",
"new",
"Redirect... | {@inheritdoc} | [
"{"
] | train | https://github.com/RetItaliaSpA/AuthenticationBundle/blob/4c2b28d0d290a68ade9215f872c417749deea2cd/Security/GoogleAuthenticator.php#L218-L222 |
RetItaliaSpA/AuthenticationBundle | Security/GoogleAuthenticator.php | GoogleAuthenticator.controllaAutorizzazione | private function controllaAutorizzazione($user) {
//Preimposto autorizzato a false
$autorizzato=false;
//Innanzitutto controllo se l'entity utente non è vuota
if (!empty($user)) {
//Controllo se l'utente ha un'autorizzazione per l'applicazione
$autorizzazioni=$... | php | private function controllaAutorizzazione($user) {
//Preimposto autorizzato a false
$autorizzato=false;
//Innanzitutto controllo se l'entity utente non è vuota
if (!empty($user)) {
//Controllo se l'utente ha un'autorizzazione per l'applicazione
$autorizzazioni=$... | [
"private",
"function",
"controllaAutorizzazione",
"(",
"$",
"user",
")",
"{",
"//Preimposto autorizzato a false",
"$",
"autorizzato",
"=",
"false",
";",
"//Innanzitutto controllo se l'entity utente non è vuota",
"if",
"(",
"!",
"empty",
"(",
"$",
"user",
")",
")",
"{"... | Questa funzione verifica se l'utente è autorizzato per uno specifico application id
@param $user
@return bool | [
"Questa",
"funzione",
"verifica",
"se",
"l",
"utente",
"è",
"autorizzato",
"per",
"uno",
"specifico",
"application",
"id"
] | train | https://github.com/RetItaliaSpA/AuthenticationBundle/blob/4c2b28d0d290a68ade9215f872c417749deea2cd/Security/GoogleAuthenticator.php#L238-L263 |
kherge-abandoned/lib-observer | src/lib/Phine/Observer/ArrayCollection.php | ArrayCollection.offsetSet | public function offsetSet($id, $subject)
{
if ($this->isSubjectRegistered($id)) {
$this->replaceSubject($id, $subject);
} else {
$this->registerSubject($id, $subject);
}
} | php | public function offsetSet($id, $subject)
{
if ($this->isSubjectRegistered($id)) {
$this->replaceSubject($id, $subject);
} else {
$this->registerSubject($id, $subject);
}
} | [
"public",
"function",
"offsetSet",
"(",
"$",
"id",
",",
"$",
"subject",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isSubjectRegistered",
"(",
"$",
"id",
")",
")",
"{",
"$",
"this",
"->",
"replaceSubject",
"(",
"$",
"id",
",",
"$",
"subject",
")",
";"... | {@inheritDoc} | [
"{"
] | train | https://github.com/kherge-abandoned/lib-observer/blob/a3ed2f81c79a056ba1fc4949e03c3e1601665106/src/lib/Phine/Observer/ArrayCollection.php#L46-L53 |
OpenConext-Attic/OpenConext-engineblock-metadata | src/MetadataRepository/CompositeMetadataRepository.php | CompositeMetadataRepository.appendVisitor | public function appendVisitor(VisitorInterface $visitor)
{
foreach ($this->orderedRepositories as $repository) {
$repository->appendVisitor($visitor);
}
} | php | public function appendVisitor(VisitorInterface $visitor)
{
foreach ($this->orderedRepositories as $repository) {
$repository->appendVisitor($visitor);
}
} | [
"public",
"function",
"appendVisitor",
"(",
"VisitorInterface",
"$",
"visitor",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"orderedRepositories",
"as",
"$",
"repository",
")",
"{",
"$",
"repository",
"->",
"appendVisitor",
"(",
"$",
"visitor",
")",
";",
"}... | {@inheritdoc} | [
"{"
] | train | https://github.com/OpenConext-Attic/OpenConext-engineblock-metadata/blob/236e2f52ef9cf28e71404544a1c4388f63ee535d/src/MetadataRepository/CompositeMetadataRepository.php#L66-L71 |
OpenConext-Attic/OpenConext-engineblock-metadata | src/MetadataRepository/CompositeMetadataRepository.php | CompositeMetadataRepository.appendFilter | public function appendFilter(FilterInterface $filter)
{
foreach ($this->orderedRepositories as $repository) {
$repository->appendFilter(clone $filter);
}
return $this;
} | php | public function appendFilter(FilterInterface $filter)
{
foreach ($this->orderedRepositories as $repository) {
$repository->appendFilter(clone $filter);
}
return $this;
} | [
"public",
"function",
"appendFilter",
"(",
"FilterInterface",
"$",
"filter",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"orderedRepositories",
"as",
"$",
"repository",
")",
"{",
"$",
"repository",
"->",
"appendFilter",
"(",
"clone",
"$",
"filter",
")",
";"... | {@inheritdoc} | [
"{"
] | train | https://github.com/OpenConext-Attic/OpenConext-engineblock-metadata/blob/236e2f52ef9cf28e71404544a1c4388f63ee535d/src/MetadataRepository/CompositeMetadataRepository.php#L76-L82 |
OpenConext-Attic/OpenConext-engineblock-metadata | src/MetadataRepository/CompositeMetadataRepository.php | CompositeMetadataRepository.fetchEntityByEntityId | public function fetchEntityByEntityId($entityId)
{
foreach ($this->orderedRepositories as $repository) {
$entity = $repository->findEntityByEntityId($entityId);
if ($entity) {
return $entity;
}
}
throw new EntityNotFoundException("Unable ... | php | public function fetchEntityByEntityId($entityId)
{
foreach ($this->orderedRepositories as $repository) {
$entity = $repository->findEntityByEntityId($entityId);
if ($entity) {
return $entity;
}
}
throw new EntityNotFoundException("Unable ... | [
"public",
"function",
"fetchEntityByEntityId",
"(",
"$",
"entityId",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"orderedRepositories",
"as",
"$",
"repository",
")",
"{",
"$",
"entity",
"=",
"$",
"repository",
"->",
"findEntityByEntityId",
"(",
"$",
"entityId... | {@inheritdoc} | [
"{"
] | train | https://github.com/OpenConext-Attic/OpenConext-engineblock-metadata/blob/236e2f52ef9cf28e71404544a1c4388f63ee535d/src/MetadataRepository/CompositeMetadataRepository.php#L87-L98 |
OpenConext-Attic/OpenConext-engineblock-metadata | src/MetadataRepository/CompositeMetadataRepository.php | CompositeMetadataRepository.fetchServiceProviderByEntityId | public function fetchServiceProviderByEntityId($entityId)
{
foreach ($this->orderedRepositories as $repository) {
$entity = $repository->findServiceProviderByEntityId($entityId);
if ($entity) {
return $entity;
}
}
throw new EntityNotFound... | php | public function fetchServiceProviderByEntityId($entityId)
{
foreach ($this->orderedRepositories as $repository) {
$entity = $repository->findServiceProviderByEntityId($entityId);
if ($entity) {
return $entity;
}
}
throw new EntityNotFound... | [
"public",
"function",
"fetchServiceProviderByEntityId",
"(",
"$",
"entityId",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"orderedRepositories",
"as",
"$",
"repository",
")",
"{",
"$",
"entity",
"=",
"$",
"repository",
"->",
"findServiceProviderByEntityId",
"(",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/OpenConext-Attic/OpenConext-engineblock-metadata/blob/236e2f52ef9cf28e71404544a1c4388f63ee535d/src/MetadataRepository/CompositeMetadataRepository.php#L103-L114 |
OpenConext-Attic/OpenConext-engineblock-metadata | src/MetadataRepository/CompositeMetadataRepository.php | CompositeMetadataRepository.fetchIdentityProviderByEntityId | public function fetchIdentityProviderByEntityId($entityId)
{
foreach ($this->orderedRepositories as $repository) {
$entity = $repository->findIdentityProviderByEntityId($entityId);
if ($entity) {
return $entity;
}
}
throw new EntityNotFou... | php | public function fetchIdentityProviderByEntityId($entityId)
{
foreach ($this->orderedRepositories as $repository) {
$entity = $repository->findIdentityProviderByEntityId($entityId);
if ($entity) {
return $entity;
}
}
throw new EntityNotFou... | [
"public",
"function",
"fetchIdentityProviderByEntityId",
"(",
"$",
"entityId",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"orderedRepositories",
"as",
"$",
"repository",
")",
"{",
"$",
"entity",
"=",
"$",
"repository",
"->",
"findIdentityProviderByEntityId",
"("... | {@inheritdoc} | [
"{"
] | train | https://github.com/OpenConext-Attic/OpenConext-engineblock-metadata/blob/236e2f52ef9cf28e71404544a1c4388f63ee535d/src/MetadataRepository/CompositeMetadataRepository.php#L119-L130 |
OpenConext-Attic/OpenConext-engineblock-metadata | src/MetadataRepository/CompositeMetadataRepository.php | CompositeMetadataRepository.findEntityByEntityId | public function findEntityByEntityId($entityId)
{
foreach ($this->orderedRepositories as $repository) {
$entity = $repository->findEntityByEntityId($entityId);
if ($entity) {
return $entity;
}
}
return null;
} | php | public function findEntityByEntityId($entityId)
{
foreach ($this->orderedRepositories as $repository) {
$entity = $repository->findEntityByEntityId($entityId);
if ($entity) {
return $entity;
}
}
return null;
} | [
"public",
"function",
"findEntityByEntityId",
"(",
"$",
"entityId",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"orderedRepositories",
"as",
"$",
"repository",
")",
"{",
"$",
"entity",
"=",
"$",
"repository",
"->",
"findEntityByEntityId",
"(",
"$",
"entityId"... | {@inheritdoc} | [
"{"
] | train | https://github.com/OpenConext-Attic/OpenConext-engineblock-metadata/blob/236e2f52ef9cf28e71404544a1c4388f63ee535d/src/MetadataRepository/CompositeMetadataRepository.php#L135-L145 |
OpenConext-Attic/OpenConext-engineblock-metadata | src/MetadataRepository/CompositeMetadataRepository.php | CompositeMetadataRepository.findIdentityProviderByEntityId | public function findIdentityProviderByEntityId($entityId)
{
foreach ($this->orderedRepositories as $repository) {
$entity = $repository->findIdentityProviderByEntityId($entityId);
if ($entity) {
return $entity;
}
}
return null;
} | php | public function findIdentityProviderByEntityId($entityId)
{
foreach ($this->orderedRepositories as $repository) {
$entity = $repository->findIdentityProviderByEntityId($entityId);
if ($entity) {
return $entity;
}
}
return null;
} | [
"public",
"function",
"findIdentityProviderByEntityId",
"(",
"$",
"entityId",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"orderedRepositories",
"as",
"$",
"repository",
")",
"{",
"$",
"entity",
"=",
"$",
"repository",
"->",
"findIdentityProviderByEntityId",
"(",... | {@inheritdoc} | [
"{"
] | train | https://github.com/OpenConext-Attic/OpenConext-engineblock-metadata/blob/236e2f52ef9cf28e71404544a1c4388f63ee535d/src/MetadataRepository/CompositeMetadataRepository.php#L150-L160 |
OpenConext-Attic/OpenConext-engineblock-metadata | src/MetadataRepository/CompositeMetadataRepository.php | CompositeMetadataRepository.findServiceProviderByEntityId | public function findServiceProviderByEntityId($entityId, LoggerInterface $logger = null)
{
foreach ($this->orderedRepositories as $repository) {
$entity = $repository->findServiceProviderByEntityId($entityId);
if ($entity) {
return $entity;
}
}
... | php | public function findServiceProviderByEntityId($entityId, LoggerInterface $logger = null)
{
foreach ($this->orderedRepositories as $repository) {
$entity = $repository->findServiceProviderByEntityId($entityId);
if ($entity) {
return $entity;
}
}
... | [
"public",
"function",
"findServiceProviderByEntityId",
"(",
"$",
"entityId",
",",
"LoggerInterface",
"$",
"logger",
"=",
"null",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"orderedRepositories",
"as",
"$",
"repository",
")",
"{",
"$",
"entity",
"=",
"$",
"... | {@inheritdoc} | [
"{"
] | train | https://github.com/OpenConext-Attic/OpenConext-engineblock-metadata/blob/236e2f52ef9cf28e71404544a1c4388f63ee535d/src/MetadataRepository/CompositeMetadataRepository.php#L165-L175 |
OpenConext-Attic/OpenConext-engineblock-metadata | src/MetadataRepository/CompositeMetadataRepository.php | CompositeMetadataRepository.findIdentityProviders | public function findIdentityProviders()
{
$identityProviders = array();
foreach ($this->orderedRepositories as $repository) {
$repositoryIdentityProviders = $repository->findIdentityProviders();
foreach ($repositoryIdentityProviders as $identityProvider) {
// ... | php | public function findIdentityProviders()
{
$identityProviders = array();
foreach ($this->orderedRepositories as $repository) {
$repositoryIdentityProviders = $repository->findIdentityProviders();
foreach ($repositoryIdentityProviders as $identityProvider) {
// ... | [
"public",
"function",
"findIdentityProviders",
"(",
")",
"{",
"$",
"identityProviders",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"orderedRepositories",
"as",
"$",
"repository",
")",
"{",
"$",
"repositoryIdentityProviders",
"=",
"$",
"rep... | {@inheritdoc} | [
"{"
] | train | https://github.com/OpenConext-Attic/OpenConext-engineblock-metadata/blob/236e2f52ef9cf28e71404544a1c4388f63ee535d/src/MetadataRepository/CompositeMetadataRepository.php#L180-L196 |
OpenConext-Attic/OpenConext-engineblock-metadata | src/MetadataRepository/CompositeMetadataRepository.php | CompositeMetadataRepository.findAllIdentityProviderEntityIds | public function findAllIdentityProviderEntityIds()
{
$identityProviderEntityIds = array();
foreach ($this->orderedRepositories as $repository) {
$identityProviderEntityIds = array_merge(
$identityProviderEntityIds,
$repository->findAllIdentityProviderEntit... | php | public function findAllIdentityProviderEntityIds()
{
$identityProviderEntityIds = array();
foreach ($this->orderedRepositories as $repository) {
$identityProviderEntityIds = array_merge(
$identityProviderEntityIds,
$repository->findAllIdentityProviderEntit... | [
"public",
"function",
"findAllIdentityProviderEntityIds",
"(",
")",
"{",
"$",
"identityProviderEntityIds",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"orderedRepositories",
"as",
"$",
"repository",
")",
"{",
"$",
"identityProviderEntityIds",
"... | {@inheritdoc} | [
"{"
] | train | https://github.com/OpenConext-Attic/OpenConext-engineblock-metadata/blob/236e2f52ef9cf28e71404544a1c4388f63ee535d/src/MetadataRepository/CompositeMetadataRepository.php#L201-L211 |
OpenConext-Attic/OpenConext-engineblock-metadata | src/MetadataRepository/CompositeMetadataRepository.php | CompositeMetadataRepository.findReservedSchacHomeOrganizations | public function findReservedSchacHomeOrganizations()
{
$schacHomeOrganizations = array();
foreach ($this->orderedRepositories as $repository) {
$schacHomeOrganizations = array_merge(
$schacHomeOrganizations,
$repository->findReservedSchacHomeOrganizations(... | php | public function findReservedSchacHomeOrganizations()
{
$schacHomeOrganizations = array();
foreach ($this->orderedRepositories as $repository) {
$schacHomeOrganizations = array_merge(
$schacHomeOrganizations,
$repository->findReservedSchacHomeOrganizations(... | [
"public",
"function",
"findReservedSchacHomeOrganizations",
"(",
")",
"{",
"$",
"schacHomeOrganizations",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"orderedRepositories",
"as",
"$",
"repository",
")",
"{",
"$",
"schacHomeOrganizations",
"=",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/OpenConext-Attic/OpenConext-engineblock-metadata/blob/236e2f52ef9cf28e71404544a1c4388f63ee535d/src/MetadataRepository/CompositeMetadataRepository.php#L216-L226 |
OpenConext-Attic/OpenConext-engineblock-metadata | src/MetadataRepository/CompositeMetadataRepository.php | CompositeMetadataRepository.findEntitiesPublishableInEdugain | public function findEntitiesPublishableInEdugain(MetadataRepositoryInterface $repository = null)
{
$entityIndex = array();
$entities = array();
foreach ($this->orderedRepositories as $repository) {
$repositoryEntities = $repository->findEntitiesPublishableInEdugain($this);
... | php | public function findEntitiesPublishableInEdugain(MetadataRepositoryInterface $repository = null)
{
$entityIndex = array();
$entities = array();
foreach ($this->orderedRepositories as $repository) {
$repositoryEntities = $repository->findEntitiesPublishableInEdugain($this);
... | [
"public",
"function",
"findEntitiesPublishableInEdugain",
"(",
"MetadataRepositoryInterface",
"$",
"repository",
"=",
"null",
")",
"{",
"$",
"entityIndex",
"=",
"array",
"(",
")",
";",
"$",
"entities",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/OpenConext-Attic/OpenConext-engineblock-metadata/blob/236e2f52ef9cf28e71404544a1c4388f63ee535d/src/MetadataRepository/CompositeMetadataRepository.php#L231-L252 |
OpenConext-Attic/OpenConext-engineblock-metadata | src/MetadataRepository/CompositeMetadataRepository.php | CompositeMetadataRepository.fetchEntityManipulation | public function fetchEntityManipulation(AbstractRole $entity)
{
foreach ($this->orderedRepositories as $repository) {
if (!$repository->findEntityByEntityId($entity->entityId)) {
continue;
}
return $repository->fetchEntityManipulation($entity);
}
... | php | public function fetchEntityManipulation(AbstractRole $entity)
{
foreach ($this->orderedRepositories as $repository) {
if (!$repository->findEntityByEntityId($entity->entityId)) {
continue;
}
return $repository->fetchEntityManipulation($entity);
}
... | [
"public",
"function",
"fetchEntityManipulation",
"(",
"AbstractRole",
"$",
"entity",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"orderedRepositories",
"as",
"$",
"repository",
")",
"{",
"if",
"(",
"!",
"$",
"repository",
"->",
"findEntityByEntityId",
"(",
"$... | {@inheritdoc} | [
"{"
] | train | https://github.com/OpenConext-Attic/OpenConext-engineblock-metadata/blob/236e2f52ef9cf28e71404544a1c4388f63ee535d/src/MetadataRepository/CompositeMetadataRepository.php#L257-L270 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.