id int32 0 241k | repo stringlengths 6 63 | path stringlengths 5 140 | func_name stringlengths 3 151 | original_string stringlengths 84 13k | language stringclasses 1
value | code stringlengths 84 13k | code_tokens list | docstring stringlengths 3 47.2k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 91 247 |
|---|---|---|---|---|---|---|---|---|---|---|---|
235,500 | liftkit/document | src/Document/Html.php | Html.addScript | public function addScript ($src, $prepend = false)
{
if ($prepend) {
array_unshift($this->scriptUrls, $src);
} else {
$this->scriptUrls[] = $src;
}
$html = '<script type="text/javascript" src="' . $this->sanitize($src) . '"></script>';
$this->addHeader($html, $prepend);
} | php | public function addScript ($src, $prepend = false)
{
if ($prepend) {
array_unshift($this->scriptUrls, $src);
} else {
$this->scriptUrls[] = $src;
}
$html = '<script type="text/javascript" src="' . $this->sanitize($src) . '"></script>';
$this->addHeader($html, $prepend);
} | [
"public",
"function",
"addScript",
"(",
"$",
"src",
",",
"$",
"prepend",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"prepend",
")",
"{",
"array_unshift",
"(",
"$",
"this",
"->",
"scriptUrls",
",",
"$",
"src",
")",
";",
"}",
"else",
"{",
"$",
"this",
... | addScript function.
Adds scripts to head.
@access public
@param string $src
@param bool $prepend (default: false)
@return void | [
"addScript",
"function",
"."
] | 1f6d409c780e42f1c1d177e70039b039e28e2c53 | https://github.com/liftkit/document/blob/1f6d409c780e42f1c1d177e70039b039e28e2c53/src/Document/Html.php#L119-L130 |
235,501 | liftkit/document | src/Document/Html.php | Html.addStylesheet | public function addStylesheet ($src, $prepend = false)
{
if ($prepend) {
array_unshift($this->stylesheetUrls, $src);
} else {
$this->stylesheetUrls[] = $src;
}
$html = '<link rel="stylesheet" type="text/css" href="' . $this->sanitize($src) . '" />';
$this->addHeader($html, $prepend);
} | php | public function addStylesheet ($src, $prepend = false)
{
if ($prepend) {
array_unshift($this->stylesheetUrls, $src);
} else {
$this->stylesheetUrls[] = $src;
}
$html = '<link rel="stylesheet" type="text/css" href="' . $this->sanitize($src) . '" />';
$this->addHeader($html, $prepend);
} | [
"public",
"function",
"addStylesheet",
"(",
"$",
"src",
",",
"$",
"prepend",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"prepend",
")",
"{",
"array_unshift",
"(",
"$",
"this",
"->",
"stylesheetUrls",
",",
"$",
"src",
")",
";",
"}",
"else",
"{",
"$",
"... | addStylesheet function.
Addes stylesheets to head.
@access public
@param string $src
@param bool $prepend (default: false)
@return void | [
"addStylesheet",
"function",
"."
] | 1f6d409c780e42f1c1d177e70039b039e28e2c53 | https://github.com/liftkit/document/blob/1f6d409c780e42f1c1d177e70039b039e28e2c53/src/Document/Html.php#L145-L156 |
235,502 | MESD/JasperReportViewerBundle | Controller/ReportViewerController.php | ReportViewerController.historyAction | public function historyAction($reportUri = null) {
//Determine whether to show or hide the report home button
$hideHome = $this->container->get('request')->query->get('hideHome') ?: 'false';
//Render and return
$response = new Response($this->container->get('templating')->render(
... | php | public function historyAction($reportUri = null) {
//Determine whether to show or hide the report home button
$hideHome = $this->container->get('request')->query->get('hideHome') ?: 'false';
//Render and return
$response = new Response($this->container->get('templating')->render(
... | [
"public",
"function",
"historyAction",
"(",
"$",
"reportUri",
"=",
"null",
")",
"{",
"//Determine whether to show or hide the report home button",
"$",
"hideHome",
"=",
"$",
"this",
"->",
"container",
"->",
"get",
"(",
"'request'",
")",
"->",
"query",
"->",
"get",... | Display information and history for a given report
@param string $reportUri The url encoded uri of the report to show info for
@return Response Rendered page | [
"Display",
"information",
"and",
"history",
"for",
"a",
"given",
"report"
] | d51ff079ba79b35c549a7ac472a305d416060d86 | https://github.com/MESD/JasperReportViewerBundle/blob/d51ff079ba79b35c549a7ac472a305d416060d86/Controller/ReportViewerController.php#L105-L118 |
235,503 | MESD/JasperReportViewerBundle | Controller/ReportViewerController.php | ReportViewerController.loadPage | protected function loadPage($requestId, $page) {
//Create an array that will be converted into the json response
$response = array('success' => true, 'output' => '');
//Load the report
$rl = $this->container->get('mesd.jasper.report.loader')->getReportLoader();
try {
... | php | protected function loadPage($requestId, $page) {
//Create an array that will be converted into the json response
$response = array('success' => true, 'output' => '');
//Load the report
$rl = $this->container->get('mesd.jasper.report.loader')->getReportLoader();
try {
... | [
"protected",
"function",
"loadPage",
"(",
"$",
"requestId",
",",
"$",
"page",
")",
"{",
"//Create an array that will be converted into the json response",
"$",
"response",
"=",
"array",
"(",
"'success'",
"=>",
"true",
",",
"'output'",
"=>",
"''",
")",
";",
"//Load... | Loads a page from the report store
@param string $requestId The request id of the cached report
@param string $page The page number to display
@return array The response array | [
"Loads",
"a",
"page",
"from",
"the",
"report",
"store"
] | d51ff079ba79b35c549a7ac472a305d416060d86 | https://github.com/MESD/JasperReportViewerBundle/blob/d51ff079ba79b35c549a7ac472a305d416060d86/Controller/ReportViewerController.php#L151-L175 |
235,504 | MESD/JasperReportViewerBundle | Controller/ReportViewerController.php | ReportViewerController.executeAction | public function executeAction($reportUri, Request $request) {
//Decode the report uri
$decodedReportUri = urldecode($reportUri);
//Get the form again
$form = $this->container->get('mesd.jasper.report.client')->buildReportInputForm(
$decodedReportUri, null, array('data' => $r... | php | public function executeAction($reportUri, Request $request) {
//Decode the report uri
$decodedReportUri = urldecode($reportUri);
//Get the form again
$form = $this->container->get('mesd.jasper.report.client')->buildReportInputForm(
$decodedReportUri, null, array('data' => $r... | [
"public",
"function",
"executeAction",
"(",
"$",
"reportUri",
",",
"Request",
"$",
"request",
")",
"{",
"//Decode the report uri",
"$",
"decodedReportUri",
"=",
"urldecode",
"(",
"$",
"reportUri",
")",
";",
"//Get the form again",
"$",
"form",
"=",
"$",
"this",
... | Runs a report
@param string $reportUri The jasper server uri for the report
@param Request $request The request from the submitted request input form
@return JsonResponse Json Response giving links to the output or what errors occured | [
"Runs",
"a",
"report"
] | d51ff079ba79b35c549a7ac472a305d416060d86 | https://github.com/MESD/JasperReportViewerBundle/blob/d51ff079ba79b35c549a7ac472a305d416060d86/Controller/ReportViewerController.php#L186-L221 |
235,505 | MESD/JasperReportViewerBundle | Controller/ReportViewerController.php | ReportViewerController.listJsonAction | public function listJsonAction() {
//Get the folder
$folderUri = $this->container->get('request')->query->get('id');
//Set folder uri to null to use the default if the root is requested ('#')
if ('#' === $folderUri) {
$folder = null;
} else {
$folder = $f... | php | public function listJsonAction() {
//Get the folder
$folderUri = $this->container->get('request')->query->get('id');
//Set folder uri to null to use the default if the root is requested ('#')
if ('#' === $folderUri) {
$folder = null;
} else {
$folder = $f... | [
"public",
"function",
"listJsonAction",
"(",
")",
"{",
"//Get the folder",
"$",
"folderUri",
"=",
"$",
"this",
"->",
"container",
"->",
"get",
"(",
"'request'",
")",
"->",
"query",
"->",
"get",
"(",
"'id'",
")",
";",
"//Set folder uri to null to use the default ... | Gets the resources contained in the requested folder
Folder name comes in via a query string parameter ('#' to use the default)
@return JsonResponse The Json Object of the returned resources | [
"Gets",
"the",
"resources",
"contained",
"in",
"the",
"requested",
"folder"
] | d51ff079ba79b35c549a7ac472a305d416060d86 | https://github.com/MESD/JasperReportViewerBundle/blob/d51ff079ba79b35c549a7ac472a305d416060d86/Controller/ReportViewerController.php#L231-L271 |
235,506 | MESD/JasperReportViewerBundle | Controller/ReportViewerController.php | ReportViewerController.reportHistoryJsonAction | public function reportHistoryJsonAction($reportUri = null) {
//Get the sent parameters from datatables
$limit = $this->container->get('request')->query->get('length');
$offset = $this->container->get('request')->query->get('start');
//Create a new repsonse array that will be converte... | php | public function reportHistoryJsonAction($reportUri = null) {
//Get the sent parameters from datatables
$limit = $this->container->get('request')->query->get('length');
$offset = $this->container->get('request')->query->get('start');
//Create a new repsonse array that will be converte... | [
"public",
"function",
"reportHistoryJsonAction",
"(",
"$",
"reportUri",
"=",
"null",
")",
"{",
"//Get the sent parameters from datatables",
"$",
"limit",
"=",
"$",
"this",
"->",
"container",
"->",
"get",
"(",
"'request'",
")",
"->",
"query",
"->",
"get",
"(",
... | Returns the json of a
@param string $reportUri Url encoded report uri
@return Response The json representation of this reports history table | [
"Returns",
"the",
"json",
"of",
"a"
] | d51ff079ba79b35c549a7ac472a305d416060d86 | https://github.com/MESD/JasperReportViewerBundle/blob/d51ff079ba79b35c549a7ac472a305d416060d86/Controller/ReportViewerController.php#L281-L340 |
235,507 | FiveLab/ResourceBundle | src/EventListener/ValidateResourceListener.php | ValidateResourceListener.onKernelControllerArguments | public function onKernelControllerArguments(FilterControllerArgumentsEvent $event): void
{
$arguments = $event->getArguments();
foreach ($arguments as $argument) {
if ($argument instanceof ResourceInterface) {
$violationList = $this->validator->validate($argument);
... | php | public function onKernelControllerArguments(FilterControllerArgumentsEvent $event): void
{
$arguments = $event->getArguments();
foreach ($arguments as $argument) {
if ($argument instanceof ResourceInterface) {
$violationList = $this->validator->validate($argument);
... | [
"public",
"function",
"onKernelControllerArguments",
"(",
"FilterControllerArgumentsEvent",
"$",
"event",
")",
":",
"void",
"{",
"$",
"arguments",
"=",
"$",
"event",
"->",
"getArguments",
"(",
")",
";",
"foreach",
"(",
"$",
"arguments",
"as",
"$",
"argument",
... | Listen kernel.controller_arguments event for validate input resources
@param FilterControllerArgumentsEvent $event
@throws ViolationListException | [
"Listen",
"kernel",
".",
"controller_arguments",
"event",
"for",
"validate",
"input",
"resources"
] | 048fce7be5357dc23fef1402ef8ca213489e8154 | https://github.com/FiveLab/ResourceBundle/blob/048fce7be5357dc23fef1402ef8ca213489e8154/src/EventListener/ValidateResourceListener.php#L50-L63 |
235,508 | metashock/Jm_Autoloader | lib/php/Jm/Autoloader.php | Jm_Autoloader.addPath | public function addPath($path, $namespace = '', $prepend = FALSE) {
if ($prepend === TRUE) {
return $this->prependPath($path, $namespace);
} else {
if (!empty($namespace)) {
$path = array (
$path, str_replace('_', '/', $namespace)
... | php | public function addPath($path, $namespace = '', $prepend = FALSE) {
if ($prepend === TRUE) {
return $this->prependPath($path, $namespace);
} else {
if (!empty($namespace)) {
$path = array (
$path, str_replace('_', '/', $namespace)
... | [
"public",
"function",
"addPath",
"(",
"$",
"path",
",",
"$",
"namespace",
"=",
"''",
",",
"$",
"prepend",
"=",
"FALSE",
")",
"{",
"if",
"(",
"$",
"prepend",
"===",
"TRUE",
")",
"{",
"return",
"$",
"this",
"->",
"prependPath",
"(",
"$",
"path",
",",... | Adds a path to the search path array
@param string $path A classpath
@param string $namespace The root namespace of $path. If not empty or
omitted Jm_Autoloader expects that classes in
the path are named like $namespace_Class_Name
@param boolean $prepend If set to true the path will be prepended
instead of be... | [
"Adds",
"a",
"path",
"to",
"the",
"search",
"path",
"array"
] | 0173dcef12a7f988985518685407ed33ede149a9 | https://github.com/metashock/Jm_Autoloader/blob/0173dcef12a7f988985518685407ed33ede149a9/lib/php/Jm/Autoloader.php#L126-L138 |
235,509 | bishopb/vanilla | library/core/class.router.php | Gdn_Router.SetRoute | public function SetRoute($Route, $Destination, $Type, $Save = TRUE) {
$Key = $this->_EncodeRouteKey($Route);
SaveToConfig('Routes.'.$Key, array($Destination, $Type), $Save);
$this->_LoadRoutes();
} | php | public function SetRoute($Route, $Destination, $Type, $Save = TRUE) {
$Key = $this->_EncodeRouteKey($Route);
SaveToConfig('Routes.'.$Key, array($Destination, $Type), $Save);
$this->_LoadRoutes();
} | [
"public",
"function",
"SetRoute",
"(",
"$",
"Route",
",",
"$",
"Destination",
",",
"$",
"Type",
",",
"$",
"Save",
"=",
"TRUE",
")",
"{",
"$",
"Key",
"=",
"$",
"this",
"->",
"_EncodeRouteKey",
"(",
"$",
"Route",
")",
";",
"SaveToConfig",
"(",
"'Routes... | Update or add a route to the config table
@param string $Route
@param string $Destination
@param string $Type
@param bool $Save Optional. Save this to the config or just in memory? | [
"Update",
"or",
"add",
"a",
"route",
"to",
"the",
"config",
"table"
] | 8494eb4a4ad61603479015a8054d23ff488364e8 | https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/library/core/class.router.php#L75-L79 |
235,510 | wasabi-cms/cms | src/Model/Table/PagesTable.php | PagesTable.getForFrontend | public function getForFrontend($pageId)
{
return $this->find()
->contain(['Current', 'Attributes'])
->formatResults([$this, 'formatAttributes'])
->where([$this->aliasField('id') => $pageId])
->first();
} | php | public function getForFrontend($pageId)
{
return $this->find()
->contain(['Current', 'Attributes'])
->formatResults([$this, 'formatAttributes'])
->where([$this->aliasField('id') => $pageId])
->first();
} | [
"public",
"function",
"getForFrontend",
"(",
"$",
"pageId",
")",
"{",
"return",
"$",
"this",
"->",
"find",
"(",
")",
"->",
"contain",
"(",
"[",
"'Current'",
",",
"'Attributes'",
"]",
")",
"->",
"formatResults",
"(",
"[",
"$",
"this",
",",
"'formatAttribu... | Find a single page including content and attributes for output in the frontend.
@param int $pageId The page id.
@return Page|null | [
"Find",
"a",
"single",
"page",
"including",
"content",
"and",
"attributes",
"for",
"output",
"in",
"the",
"frontend",
"."
] | 2787b6422ea1d719cf49951b3253fd0ac31d22ca | https://github.com/wasabi-cms/cms/blob/2787b6422ea1d719cf49951b3253fd0ac31d22ca/src/Model/Table/PagesTable.php#L181-L188 |
235,511 | znframework/package-security | Injection.php | Injection.encode | public static function encode(String $string) : String
{
$secBadChars = Properties::$injectionBadChars;
if( ! empty($secBadChars) )
{
foreach( $secBadChars as $badChar => $changeChar )
{
if( is_numeric($badChar) )
{
... | php | public static function encode(String $string) : String
{
$secBadChars = Properties::$injectionBadChars;
if( ! empty($secBadChars) )
{
foreach( $secBadChars as $badChar => $changeChar )
{
if( is_numeric($badChar) )
{
... | [
"public",
"static",
"function",
"encode",
"(",
"String",
"$",
"string",
")",
":",
"String",
"{",
"$",
"secBadChars",
"=",
"Properties",
"::",
"$",
"injectionBadChars",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"secBadChars",
")",
")",
"{",
"foreach",
"(",
... | Encode Injection Chars
@param string $string
@return string | [
"Encode",
"Injection",
"Chars"
] | dfced60e243ab9f52a1b5bbdb695bfc39b26cac0 | https://github.com/znframework/package-security/blob/dfced60e243ab9f52a1b5bbdb695bfc39b26cac0/Injection.php#L32-L52 |
235,512 | znframework/package-security | Injection.php | Injection.nailEncode | public static function nailEncode(String $str) : String
{
$str = str_replace(array_keys(self::$nailChars), array_values(self::$nailChars), $str);
return $str;
} | php | public static function nailEncode(String $str) : String
{
$str = str_replace(array_keys(self::$nailChars), array_values(self::$nailChars), $str);
return $str;
} | [
"public",
"static",
"function",
"nailEncode",
"(",
"String",
"$",
"str",
")",
":",
"String",
"{",
"$",
"str",
"=",
"str_replace",
"(",
"array_keys",
"(",
"self",
"::",
"$",
"nailChars",
")",
",",
"array_values",
"(",
"self",
"::",
"$",
"nailChars",
")",
... | Encode Nail Chars
@param string $string
@return string | [
"Encode",
"Nail",
"Chars"
] | dfced60e243ab9f52a1b5bbdb695bfc39b26cac0 | https://github.com/znframework/package-security/blob/dfced60e243ab9f52a1b5bbdb695bfc39b26cac0/Injection.php#L73-L78 |
235,513 | znframework/package-security | Injection.php | Injection.nailDecode | public static function nailDecode(String $str) : String
{
$str = str_replace(array_values(self::$nailChars), array_keys(self::$nailChars), $str);
return $str;
} | php | public static function nailDecode(String $str) : String
{
$str = str_replace(array_values(self::$nailChars), array_keys(self::$nailChars), $str);
return $str;
} | [
"public",
"static",
"function",
"nailDecode",
"(",
"String",
"$",
"str",
")",
":",
"String",
"{",
"$",
"str",
"=",
"str_replace",
"(",
"array_values",
"(",
"self",
"::",
"$",
"nailChars",
")",
",",
"array_keys",
"(",
"self",
"::",
"$",
"nailChars",
")",
... | Decode Nail Chars
@param string $string
@return string | [
"Decode",
"Nail",
"Chars"
] | dfced60e243ab9f52a1b5bbdb695bfc39b26cac0 | https://github.com/znframework/package-security/blob/dfced60e243ab9f52a1b5bbdb695bfc39b26cac0/Injection.php#L87-L92 |
235,514 | webriq/core | module/Menu/src/Grid/Menu/Model/Menu/Mapper.php | Mapper.parseProxyData | protected function parseProxyData( & $data )
{
if ( empty( $data ) )
{
return array();
}
$result = array();
foreach ( json_decode( $data, true ) as $field )
{
if ( empty( $field['name'] ) )
{
continue;
}... | php | protected function parseProxyData( & $data )
{
if ( empty( $data ) )
{
return array();
}
$result = array();
foreach ( json_decode( $data, true ) as $field )
{
if ( empty( $field['name'] ) )
{
continue;
}... | [
"protected",
"function",
"parseProxyData",
"(",
"&",
"$",
"data",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"data",
")",
")",
"{",
"return",
"array",
"(",
")",
";",
"}",
"$",
"result",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"json_decode",
"(",
... | Parse proxy-data
Like:
<pre>
<struct>
[{"name":"{key}","value":"{value}"}]
...
</struct>
</pre>
@param string $data
@return array | [
"Parse",
"proxy",
"-",
"data"
] | cfeb6e8a4732561c2215ec94e736c07f9b8bc990 | https://github.com/webriq/core/blob/cfeb6e8a4732561c2215ec94e736c07f9b8bc990/module/Menu/src/Grid/Menu/Model/Menu/Mapper.php#L367-L419 |
235,515 | webriq/core | module/Menu/src/Grid/Menu/Model/Menu/Mapper.php | Mapper.findRenderList | public function findRenderList( $id = null )
{
$platform = $this->getDbAdapter()
->getPlatform();
$columns = $this->getSelectColumns();
$columns['_depth'] = new Sql\Expression( '(' .
$this->sql( null )
->select( array( 'parent' => static... | php | public function findRenderList( $id = null )
{
$platform = $this->getDbAdapter()
->getPlatform();
$columns = $this->getSelectColumns();
$columns['_depth'] = new Sql\Expression( '(' .
$this->sql( null )
->select( array( 'parent' => static... | [
"public",
"function",
"findRenderList",
"(",
"$",
"id",
"=",
"null",
")",
"{",
"$",
"platform",
"=",
"$",
"this",
"->",
"getDbAdapter",
"(",
")",
"->",
"getPlatform",
"(",
")",
";",
"$",
"columns",
"=",
"$",
"this",
"->",
"getSelectColumns",
"(",
")",
... | Find render-list
@param int|null $id
@return \Menu\Model\Menu\StructureInterface[] | [
"Find",
"render",
"-",
"list"
] | cfeb6e8a4732561c2215ec94e736c07f9b8bc990 | https://github.com/webriq/core/blob/cfeb6e8a4732561c2215ec94e736c07f9b8bc990/module/Menu/src/Grid/Menu/Model/Menu/Mapper.php#L455-L503 |
235,516 | webriq/core | module/Menu/src/Grid/Menu/Model/Menu/Mapper.php | Mapper.saveSingleProperty | private function saveSingleProperty( $id, $name, $value )
{
$sql = $this->sql( $this->getTableInSchema(
static::$propertyTableName
) );
$update = $sql->update()
->set( array(
'value' => $value,
) )
... | php | private function saveSingleProperty( $id, $name, $value )
{
$sql = $this->sql( $this->getTableInSchema(
static::$propertyTableName
) );
$update = $sql->update()
->set( array(
'value' => $value,
) )
... | [
"private",
"function",
"saveSingleProperty",
"(",
"$",
"id",
",",
"$",
"name",
",",
"$",
"value",
")",
"{",
"$",
"sql",
"=",
"$",
"this",
"->",
"sql",
"(",
"$",
"this",
"->",
"getTableInSchema",
"(",
"static",
"::",
"$",
"propertyTableName",
")",
")",
... | Save a single property
@param int $id
@param string $name
@param mixed $value
@return int | [
"Save",
"a",
"single",
"property"
] | cfeb6e8a4732561c2215ec94e736c07f9b8bc990 | https://github.com/webriq/core/blob/cfeb6e8a4732561c2215ec94e736c07f9b8bc990/module/Menu/src/Grid/Menu/Model/Menu/Mapper.php#L513-L547 |
235,517 | webriq/core | module/Menu/src/Grid/Menu/Model/Menu/Mapper.php | Mapper.saveProperty | protected function saveProperty( $id, $name, $value )
{
$rows = 0;
$sql = $this->sql( $this->getTableInSchema(
static::$propertyTableName
) );
$like = strtr( $name, array(
'\\' => '\\\\',
'%' => '\%',
'_' => '\_',
) ) . '.... | php | protected function saveProperty( $id, $name, $value )
{
$rows = 0;
$sql = $this->sql( $this->getTableInSchema(
static::$propertyTableName
) );
$like = strtr( $name, array(
'\\' => '\\\\',
'%' => '\%',
'_' => '\_',
) ) . '.... | [
"protected",
"function",
"saveProperty",
"(",
"$",
"id",
",",
"$",
"name",
",",
"$",
"value",
")",
"{",
"$",
"rows",
"=",
"0",
";",
"$",
"sql",
"=",
"$",
"this",
"->",
"sql",
"(",
"$",
"this",
"->",
"getTableInSchema",
"(",
"static",
"::",
"$",
"... | Save a property
@param int $id
@param string $name
@param mixed $value
@return int | [
"Save",
"a",
"property"
] | cfeb6e8a4732561c2215ec94e736c07f9b8bc990 | https://github.com/webriq/core/blob/cfeb6e8a4732561c2215ec94e736c07f9b8bc990/module/Menu/src/Grid/Menu/Model/Menu/Mapper.php#L557-L627 |
235,518 | webriq/core | module/Menu/src/Grid/Menu/Model/Menu/Mapper.php | Mapper.saveLabel | protected function saveLabel( $id, $label )
{
$locale = $this->getLocale();
$sql = $this->sql( $this->getTableInSchema(
static::$labelTableName
) );
$update = $sql->update()
->set( array(
'label' => $label,
... | php | protected function saveLabel( $id, $label )
{
$locale = $this->getLocale();
$sql = $this->sql( $this->getTableInSchema(
static::$labelTableName
) );
$update = $sql->update()
->set( array(
'label' => $label,
... | [
"protected",
"function",
"saveLabel",
"(",
"$",
"id",
",",
"$",
"label",
")",
"{",
"$",
"locale",
"=",
"$",
"this",
"->",
"getLocale",
"(",
")",
";",
"$",
"sql",
"=",
"$",
"this",
"->",
"sql",
"(",
"$",
"this",
"->",
"getTableInSchema",
"(",
"stati... | Save a label
@param int $id
@param string $label
@return int | [
"Save",
"a",
"label"
] | cfeb6e8a4732561c2215ec94e736c07f9b8bc990 | https://github.com/webriq/core/blob/cfeb6e8a4732561c2215ec94e736c07f9b8bc990/module/Menu/src/Grid/Menu/Model/Menu/Mapper.php#L636-L671 |
235,519 | webriq/core | module/Menu/src/Grid/Menu/Model/Menu/Mapper.php | Mapper.interleaveParagraphs | public function interleaveParagraphs( $updateNode, $likeNode )
{
return $this->sql()
->menu_interleave_paragraph( (int) $updateNode,
(int) $likeNode );
} | php | public function interleaveParagraphs( $updateNode, $likeNode )
{
return $this->sql()
->menu_interleave_paragraph( (int) $updateNode,
(int) $likeNode );
} | [
"public",
"function",
"interleaveParagraphs",
"(",
"$",
"updateNode",
",",
"$",
"likeNode",
")",
"{",
"return",
"$",
"this",
"->",
"sql",
"(",
")",
"->",
"menu_interleave_paragraph",
"(",
"(",
"int",
")",
"$",
"updateNode",
",",
"(",
"int",
")",
"$",
"li... | Interleave paragraph-nodes
Update $updateNode's descendant menu-paragraphs
to be more like in $likeNode's.
@param int $updateNode
@param int $likeNode
@return bool | [
"Interleave",
"paragraph",
"-",
"nodes"
] | cfeb6e8a4732561c2215ec94e736c07f9b8bc990 | https://github.com/webriq/core/blob/cfeb6e8a4732561c2215ec94e736c07f9b8bc990/module/Menu/src/Grid/Menu/Model/Menu/Mapper.php#L739-L744 |
235,520 | mchorse/crystal-edge.php | src/FileSystemExport.php | FileSystemExport.export | public function export(Logger $logger = null)
{
foreach ($this->site->process() as $path => $content)
{
$dest = "{$this->path}/$path";
$folder = substr($dest, 0, strrpos($dest, '/'));
if (!is_dir($folder))
{
mkdir($folder,... | php | public function export(Logger $logger = null)
{
foreach ($this->site->process() as $path => $content)
{
$dest = "{$this->path}/$path";
$folder = substr($dest, 0, strrpos($dest, '/'));
if (!is_dir($folder))
{
mkdir($folder,... | [
"public",
"function",
"export",
"(",
"Logger",
"$",
"logger",
"=",
"null",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"site",
"->",
"process",
"(",
")",
"as",
"$",
"path",
"=>",
"$",
"content",
")",
"{",
"$",
"dest",
"=",
"\"{$this->path}/$path\"",
... | Export a site to build folder | [
"Export",
"a",
"site",
"to",
"build",
"folder"
] | b030f3a124be9ac0b76ed180ca31035180ab9321 | https://github.com/mchorse/crystal-edge.php/blob/b030f3a124be9ac0b76ed180ca31035180ab9321/src/FileSystemExport.php#L35-L54 |
235,521 | SergioMadness/framework | framework/components/i18n/Fabric.php | Fabric.getTranslator | public function getTranslator($type, array $params = [])
{
$result = null;
if (!isset($params['language'])) {
throw new \Exception('Need \'language\' param');
}
switch ($type) {
case interfaces\Translator::TRANSLATOR_FILE:
$result = new FileTr... | php | public function getTranslator($type, array $params = [])
{
$result = null;
if (!isset($params['language'])) {
throw new \Exception('Need \'language\' param');
}
switch ($type) {
case interfaces\Translator::TRANSLATOR_FILE:
$result = new FileTr... | [
"public",
"function",
"getTranslator",
"(",
"$",
"type",
",",
"array",
"$",
"params",
"=",
"[",
"]",
")",
"{",
"$",
"result",
"=",
"null",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"params",
"[",
"'language'",
"]",
")",
")",
"{",
"throw",
"new",
"\... | Get translator by type
@param string $type
@param array $params
@return \pwf\components\i18n\interfaces\Translator | [
"Get",
"translator",
"by",
"type"
] | a5038eb926a5038b9a331d0cb6a68d7fc3cf1f1e | https://github.com/SergioMadness/framework/blob/a5038eb926a5038b9a331d0cb6a68d7fc3cf1f1e/framework/components/i18n/Fabric.php#L15-L69 |
235,522 | broeser/sanitor | src/SanitizableTrait.php | SanitizableTrait.getFilteredValue | public function getFilteredValue() {
if(!$this->getSanitizer() instanceof Sanitizer) {
throw new \Exception('You have to assign a sanitizer first!');
}
return $this->getSanitizer()->filter($this->getRawValue());
} | php | public function getFilteredValue() {
if(!$this->getSanitizer() instanceof Sanitizer) {
throw new \Exception('You have to assign a sanitizer first!');
}
return $this->getSanitizer()->filter($this->getRawValue());
} | [
"public",
"function",
"getFilteredValue",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"getSanitizer",
"(",
")",
"instanceof",
"Sanitizer",
")",
"{",
"throw",
"new",
"\\",
"Exception",
"(",
"'You have to assign a sanitizer first!'",
")",
";",
"}",
"return... | Returns the filtered value of this
@return mixed
@throws Exception | [
"Returns",
"the",
"filtered",
"value",
"of",
"this"
] | 580e539a2747e3d66527cbbde968004743481a5c | https://github.com/broeser/sanitor/blob/580e539a2747e3d66527cbbde968004743481a5c/src/SanitizableTrait.php#L39-L45 |
235,523 | bearframework/emails-addon | classes/Emails.php | Emails.send | public function send(\BearFramework\Emails\Email $email): void
{
$app = App::get();
$email = clone($email);
if ($this->hasEventListeners('beforeSendEmail')) {
$eventDetails = new \BearFramework\Emails\BeforeSendEmailEventDetails($email);
$this->dispatchEvent('beforeS... | php | public function send(\BearFramework\Emails\Email $email): void
{
$app = App::get();
$email = clone($email);
if ($this->hasEventListeners('beforeSendEmail')) {
$eventDetails = new \BearFramework\Emails\BeforeSendEmailEventDetails($email);
$this->dispatchEvent('beforeS... | [
"public",
"function",
"send",
"(",
"\\",
"BearFramework",
"\\",
"Emails",
"\\",
"Email",
"$",
"email",
")",
":",
"void",
"{",
"$",
"app",
"=",
"App",
"::",
"get",
"(",
")",
";",
"$",
"email",
"=",
"clone",
"(",
"$",
"email",
")",
";",
"if",
"(",
... | Sends a email.
@param \BearFramework\Emails\Email $email The email to send.
@return void No value is returned.
@throws \Exception | [
"Sends",
"a",
"email",
"."
] | 43a68c47e2b1d231dc69a324249ff5f6827201ca | https://github.com/bearframework/emails-addon/blob/43a68c47e2b1d231dc69a324249ff5f6827201ca/classes/Emails.php#L73-L108 |
235,524 | treehouselabs/domain | src/TreeHouse/Domain/AbstractAggregate.php | AbstractAggregate.mutate | private function mutate($event)
{
$method = 'on' . (string) new EventName($event);
if (method_exists($this, $method)) {
$this->$method($event);
} else {
throw new \RuntimeException(sprintf('Method %s does not exist on aggregate %s', $method, get_class($this)));
... | php | private function mutate($event)
{
$method = 'on' . (string) new EventName($event);
if (method_exists($this, $method)) {
$this->$method($event);
} else {
throw new \RuntimeException(sprintf('Method %s does not exist on aggregate %s', $method, get_class($this)));
... | [
"private",
"function",
"mutate",
"(",
"$",
"event",
")",
"{",
"$",
"method",
"=",
"'on'",
".",
"(",
"string",
")",
"new",
"EventName",
"(",
"$",
"event",
")",
";",
"if",
"(",
"method_exists",
"(",
"$",
"this",
",",
"$",
"method",
")",
")",
"{",
"... | Update in-memory state.
@param object $event | [
"Update",
"in",
"-",
"memory",
"state",
"."
] | e22b319307b985dcac94687b1c2b5418b41f1998 | https://github.com/treehouselabs/domain/blob/e22b319307b985dcac94687b1c2b5418b41f1998/src/TreeHouse/Domain/AbstractAggregate.php#L14-L23 |
235,525 | myerscode/utilities-numbers | src/Utility.php | Utility.divide | public function divide($number): Utility
{
$divisible = new static($number);
if ($divisible->value() == 0 || $this->number == 0) {
throw new DivisionByZeroError();
}
$value = $this->number / $divisible->value();
return new static($value);
} | php | public function divide($number): Utility
{
$divisible = new static($number);
if ($divisible->value() == 0 || $this->number == 0) {
throw new DivisionByZeroError();
}
$value = $this->number / $divisible->value();
return new static($value);
} | [
"public",
"function",
"divide",
"(",
"$",
"number",
")",
":",
"Utility",
"{",
"$",
"divisible",
"=",
"new",
"static",
"(",
"$",
"number",
")",
";",
"if",
"(",
"$",
"divisible",
"->",
"value",
"(",
")",
"==",
"0",
"||",
"$",
"this",
"->",
"number",
... | Divide the number by the number
@param $number
@return Utility
@throws NonNumericValueException
@throws \DivisionByZeroError | [
"Divide",
"the",
"number",
"by",
"the",
"number"
] | c2ee8bffcda5fda425572bc3e195e9afb795f843 | https://github.com/myerscode/utilities-numbers/blob/c2ee8bffcda5fda425572bc3e195e9afb795f843/src/Utility.php#L95-L106 |
235,526 | myerscode/utilities-numbers | src/Utility.php | Utility.factors | public function factors(): array
{
// 0 has infinite factors
if ($this->number === 0 || !is_int($this->number)) {
throw new InvalidNumberException();
}
$x = abs($this->number);
$sqrx = floor(sqrt($x));
$factors = [];
for ($i = 1; $i <= $sqrx; $i+... | php | public function factors(): array
{
// 0 has infinite factors
if ($this->number === 0 || !is_int($this->number)) {
throw new InvalidNumberException();
}
$x = abs($this->number);
$sqrx = floor(sqrt($x));
$factors = [];
for ($i = 1; $i <= $sqrx; $i+... | [
"public",
"function",
"factors",
"(",
")",
":",
"array",
"{",
"// 0 has infinite factors",
"if",
"(",
"$",
"this",
"->",
"number",
"===",
"0",
"||",
"!",
"is_int",
"(",
"$",
"this",
"->",
"number",
")",
")",
"{",
"throw",
"new",
"InvalidNumberException",
... | Get the factors for the number
@return array
@throws InvalidNumberException | [
"Get",
"the",
"factors",
"for",
"the",
"number"
] | c2ee8bffcda5fda425572bc3e195e9afb795f843 | https://github.com/myerscode/utilities-numbers/blob/c2ee8bffcda5fda425572bc3e195e9afb795f843/src/Utility.php#L114-L135 |
235,527 | myerscode/utilities-numbers | src/Utility.php | Utility.isNegative | public function isNegative(): bool
{
if ($this->number === 0 ){
throw new IsZeroException('0 is neither positive or negative');
}
return (!is_int($this->number) && $this->number < 0 || $this->number < 0);
} | php | public function isNegative(): bool
{
if ($this->number === 0 ){
throw new IsZeroException('0 is neither positive or negative');
}
return (!is_int($this->number) && $this->number < 0 || $this->number < 0);
} | [
"public",
"function",
"isNegative",
"(",
")",
":",
"bool",
"{",
"if",
"(",
"$",
"this",
"->",
"number",
"===",
"0",
")",
"{",
"throw",
"new",
"IsZeroException",
"(",
"'0 is neither positive or negative'",
")",
";",
"}",
"return",
"(",
"!",
"is_int",
"(",
... | Is the number negative
@return bool
@throws IsZeroException | [
"Is",
"the",
"number",
"negative"
] | c2ee8bffcda5fda425572bc3e195e9afb795f843 | https://github.com/myerscode/utilities-numbers/blob/c2ee8bffcda5fda425572bc3e195e9afb795f843/src/Utility.php#L156-L162 |
235,528 | myerscode/utilities-numbers | src/Utility.php | Utility.magnitude | public function magnitude(): Utility
{
if ($this->number == 0) {
$magnitude = 0;
} else {
$magnitude = floor(log10(abs($this->number)));
}
return new static($magnitude);
} | php | public function magnitude(): Utility
{
if ($this->number == 0) {
$magnitude = 0;
} else {
$magnitude = floor(log10(abs($this->number)));
}
return new static($magnitude);
} | [
"public",
"function",
"magnitude",
"(",
")",
":",
"Utility",
"{",
"if",
"(",
"$",
"this",
"->",
"number",
"==",
"0",
")",
"{",
"$",
"magnitude",
"=",
"0",
";",
"}",
"else",
"{",
"$",
"magnitude",
"=",
"floor",
"(",
"log10",
"(",
"abs",
"(",
"$",
... | Get the order of magnitude of the number
@return Utility
@throws NonNumericValueException | [
"Get",
"the",
"order",
"of",
"magnitude",
"of",
"the",
"number"
] | c2ee8bffcda5fda425572bc3e195e9afb795f843 | https://github.com/myerscode/utilities-numbers/blob/c2ee8bffcda5fda425572bc3e195e9afb795f843/src/Utility.php#L183-L192 |
235,529 | myerscode/utilities-numbers | src/Utility.php | Utility.pad | private function pad($padding = 1, $direction = STR_PAD_BOTH): string
{
return str_pad($this->number, $padding, 0, $direction);
} | php | private function pad($padding = 1, $direction = STR_PAD_BOTH): string
{
return str_pad($this->number, $padding, 0, $direction);
} | [
"private",
"function",
"pad",
"(",
"$",
"padding",
"=",
"1",
",",
"$",
"direction",
"=",
"STR_PAD_BOTH",
")",
":",
"string",
"{",
"return",
"str_pad",
"(",
"$",
"this",
"->",
"number",
",",
"$",
"padding",
",",
"0",
",",
"$",
"direction",
")",
";",
... | Add padding to the number
@param int $padding
@param int $direction
@return string | [
"Add",
"padding",
"to",
"the",
"number"
] | c2ee8bffcda5fda425572bc3e195e9afb795f843 | https://github.com/myerscode/utilities-numbers/blob/c2ee8bffcda5fda425572bc3e195e9afb795f843/src/Utility.php#L259-L262 |
235,530 | myerscode/utilities-numbers | src/Utility.php | Utility.round | private function round($number, $precision, int $mode): Utility
{
if ($precision < 0) {
throw new InvalidNumberException('Precision value should be greater or equal to zero');
}
$value = round($number, $precision, $mode);
return new static($value);
} | php | private function round($number, $precision, int $mode): Utility
{
if ($precision < 0) {
throw new InvalidNumberException('Precision value should be greater or equal to zero');
}
$value = round($number, $precision, $mode);
return new static($value);
} | [
"private",
"function",
"round",
"(",
"$",
"number",
",",
"$",
"precision",
",",
"int",
"$",
"mode",
")",
":",
"Utility",
"{",
"if",
"(",
"$",
"precision",
"<",
"0",
")",
"{",
"throw",
"new",
"InvalidNumberException",
"(",
"'Precision value should be greater ... | Round a number
@param $number
@param int $precision
@param int $mode
@return Utility
@throws InvalidNumberException
@throws NonNumericValueException | [
"Round",
"a",
"number"
] | c2ee8bffcda5fda425572bc3e195e9afb795f843 | https://github.com/myerscode/utilities-numbers/blob/c2ee8bffcda5fda425572bc3e195e9afb795f843/src/Utility.php#L310-L319 |
235,531 | myerscode/utilities-numbers | src/Utility.php | Utility.roundDown | public function roundDown(int $precision = 0): Utility
{
return $this->round($this->number, $precision, PHP_ROUND_HALF_DOWN);
} | php | public function roundDown(int $precision = 0): Utility
{
return $this->round($this->number, $precision, PHP_ROUND_HALF_DOWN);
} | [
"public",
"function",
"roundDown",
"(",
"int",
"$",
"precision",
"=",
"0",
")",
":",
"Utility",
"{",
"return",
"$",
"this",
"->",
"round",
"(",
"$",
"this",
"->",
"number",
",",
"$",
"precision",
",",
"PHP_ROUND_HALF_DOWN",
")",
";",
"}"
] | Round down the number
@param int $precision
@return Utility
@throws InvalidNumberException
@throws NonNumericValueException | [
"Round",
"down",
"the",
"number"
] | c2ee8bffcda5fda425572bc3e195e9afb795f843 | https://github.com/myerscode/utilities-numbers/blob/c2ee8bffcda5fda425572bc3e195e9afb795f843/src/Utility.php#L330-L333 |
235,532 | myerscode/utilities-numbers | src/Utility.php | Utility.roundUp | public function roundUp(int $precision = 0): Utility
{
return $this->round($this->number, $precision, PHP_ROUND_HALF_UP);
} | php | public function roundUp(int $precision = 0): Utility
{
return $this->round($this->number, $precision, PHP_ROUND_HALF_UP);
} | [
"public",
"function",
"roundUp",
"(",
"int",
"$",
"precision",
"=",
"0",
")",
":",
"Utility",
"{",
"return",
"$",
"this",
"->",
"round",
"(",
"$",
"this",
"->",
"number",
",",
"$",
"precision",
",",
"PHP_ROUND_HALF_UP",
")",
";",
"}"
] | Round up the number
@param int $precision
@return Utility
@throws InvalidNumberException
@throws NonNumericValueException | [
"Round",
"up",
"the",
"number"
] | c2ee8bffcda5fda425572bc3e195e9afb795f843 | https://github.com/myerscode/utilities-numbers/blob/c2ee8bffcda5fda425572bc3e195e9afb795f843/src/Utility.php#L344-L347 |
235,533 | nattreid/security | src/Model/Users/User.php | User.setUsername | public function setUsername(string $username): void
{
if (Strings::match($username, '/[^A-Za-z0-9_]/')) {
throw new InvalidArgumentException('Username contains invalid characters');
}
/* @var $repository UsersRepository */
$repository = $this->getRepository();
$user = $repository->getByUsername($username... | php | public function setUsername(string $username): void
{
if (Strings::match($username, '/[^A-Za-z0-9_]/')) {
throw new InvalidArgumentException('Username contains invalid characters');
}
/* @var $repository UsersRepository */
$repository = $this->getRepository();
$user = $repository->getByUsername($username... | [
"public",
"function",
"setUsername",
"(",
"string",
"$",
"username",
")",
":",
"void",
"{",
"if",
"(",
"Strings",
"::",
"match",
"(",
"$",
"username",
",",
"'/[^A-Za-z0-9_]/'",
")",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"'Username contains... | Ulozi uzivatelske jmeno
@param string $username
@throws UniqueConstraintViolationException
@throws InvalidArgumentException | [
"Ulozi",
"uzivatelske",
"jmeno"
] | ed649e5bdf453cea2d5352e643dbf201193de01d | https://github.com/nattreid/security/blob/ed649e5bdf453cea2d5352e643dbf201193de01d/src/Model/Users/User.php#L65-L78 |
235,534 | nattreid/security | src/Model/Users/User.php | User.getterRoleConstants | public function getterRoleConstants(): array
{
$result = [];
$roles = $this->roles->get();
/* @var $role AclRole */
foreach ($roles as $role) {
$result[] = $role->name;
}
return $result;
} | php | public function getterRoleConstants(): array
{
$result = [];
$roles = $this->roles->get();
/* @var $role AclRole */
foreach ($roles as $role) {
$result[] = $role->name;
}
return $result;
} | [
"public",
"function",
"getterRoleConstants",
"(",
")",
":",
"array",
"{",
"$",
"result",
"=",
"[",
"]",
";",
"$",
"roles",
"=",
"$",
"this",
"->",
"roles",
"->",
"get",
"(",
")",
";",
"/* @var $role AclRole */",
"foreach",
"(",
"$",
"roles",
"as",
"$",... | Vrati jmena roli
@return array | [
"Vrati",
"jmena",
"roli"
] | ed649e5bdf453cea2d5352e643dbf201193de01d | https://github.com/nattreid/security/blob/ed649e5bdf453cea2d5352e643dbf201193de01d/src/Model/Users/User.php#L136-L145 |
235,535 | nattreid/security | src/Model/Users/User.php | User.getterRoleTitles | protected function getterRoleTitles(): array
{
$result = [];
$roles = $this->roles->get();
/* @var $role AclRole */
foreach ($roles as $role) {
$result[] = $role->title;
}
return $result;
} | php | protected function getterRoleTitles(): array
{
$result = [];
$roles = $this->roles->get();
/* @var $role AclRole */
foreach ($roles as $role) {
$result[] = $role->title;
}
return $result;
} | [
"protected",
"function",
"getterRoleTitles",
"(",
")",
":",
"array",
"{",
"$",
"result",
"=",
"[",
"]",
";",
"$",
"roles",
"=",
"$",
"this",
"->",
"roles",
"->",
"get",
"(",
")",
";",
"/* @var $role AclRole */",
"foreach",
"(",
"$",
"roles",
"as",
"$",... | Vrati nazvy roli
@return array | [
"Vrati",
"nazvy",
"roli"
] | ed649e5bdf453cea2d5352e643dbf201193de01d | https://github.com/nattreid/security/blob/ed649e5bdf453cea2d5352e643dbf201193de01d/src/Model/Users/User.php#L151-L160 |
235,536 | jnjxp/html | src/Helper/Styles.php | Styles.inline | public function inline($style, array $attr = null)
{
$attr = $this->escaper->attr(
$this->fixInlineAttr($attr)
);
return "<style {$attr}>{$style}</style>";
} | php | public function inline($style, array $attr = null)
{
$attr = $this->escaper->attr(
$this->fixInlineAttr($attr)
);
return "<style {$attr}>{$style}</style>";
} | [
"public",
"function",
"inline",
"(",
"$",
"style",
",",
"array",
"$",
"attr",
"=",
"null",
")",
"{",
"$",
"attr",
"=",
"$",
"this",
"->",
"escaper",
"->",
"attr",
"(",
"$",
"this",
"->",
"fixInlineAttr",
"(",
"$",
"attr",
")",
")",
";",
"return",
... | makes an internal style tag
@param string $style css snippet
@param null|array $attr attributes for style tag
@return string
@access public | [
"makes",
"an",
"internal",
"style",
"tag"
] | a38f130c19ab0a60ea52bc1d2560a68d2048d292 | https://github.com/jnjxp/html/blob/a38f130c19ab0a60ea52bc1d2560a68d2048d292/src/Helper/Styles.php#L67-L73 |
235,537 | jnjxp/html | src/Helper/Styles.php | Styles.inlineCond | public function inlineCond($cond, $style, array $attr = null)
{
$style = $this->inline($style, $attr);
$cond = $this->escaper->html($cond);
return "<!--[if {$cond}]>{$style}<![endif]-->";
} | php | public function inlineCond($cond, $style, array $attr = null)
{
$style = $this->inline($style, $attr);
$cond = $this->escaper->html($cond);
return "<!--[if {$cond}]>{$style}<![endif]-->";
} | [
"public",
"function",
"inlineCond",
"(",
"$",
"cond",
",",
"$",
"style",
",",
"array",
"$",
"attr",
"=",
"null",
")",
"{",
"$",
"style",
"=",
"$",
"this",
"->",
"inline",
"(",
"$",
"style",
",",
"$",
"attr",
")",
";",
"$",
"cond",
"=",
"$",
"th... | add inline conditional style
@param string $cond ie condition
@param string $style css snippet
@param null|array $attr attributes for style tag
@return string
@access public | [
"add",
"inline",
"conditional",
"style"
] | a38f130c19ab0a60ea52bc1d2560a68d2048d292 | https://github.com/jnjxp/html/blob/a38f130c19ab0a60ea52bc1d2560a68d2048d292/src/Helper/Styles.php#L86-L91 |
235,538 | jnjxp/html | src/Helper/Styles.php | Styles.addInline | public function addInline($style, array $attr = null, $position = 1000)
{
$this->addElement(
$position,
$this->inline($style, $attr)
);
return $this;
} | php | public function addInline($style, array $attr = null, $position = 1000)
{
$this->addElement(
$position,
$this->inline($style, $attr)
);
return $this;
} | [
"public",
"function",
"addInline",
"(",
"$",
"style",
",",
"array",
"$",
"attr",
"=",
"null",
",",
"$",
"position",
"=",
"1000",
")",
"{",
"$",
"this",
"->",
"addElement",
"(",
"$",
"position",
",",
"$",
"this",
"->",
"inline",
"(",
"$",
"style",
"... | add inline css
@param string $style css snippet
@param null|array $attr attributes for style tag
@param int $position sort
@return Styles
@access public | [
"add",
"inline",
"css"
] | a38f130c19ab0a60ea52bc1d2560a68d2048d292 | https://github.com/jnjxp/html/blob/a38f130c19ab0a60ea52bc1d2560a68d2048d292/src/Helper/Styles.php#L104-L111 |
235,539 | jnjxp/html | src/Helper/Styles.php | Styles.addInlineCond | public function addInlineCond(
$cond,
$style,
array $attr = null,
$position = 1000
) {
$this->addElement(
$position,
$this->inlineCond($cond, $style, $attr)
);
return $this;
} | php | public function addInlineCond(
$cond,
$style,
array $attr = null,
$position = 1000
) {
$this->addElement(
$position,
$this->inlineCond($cond, $style, $attr)
);
return $this;
} | [
"public",
"function",
"addInlineCond",
"(",
"$",
"cond",
",",
"$",
"style",
",",
"array",
"$",
"attr",
"=",
"null",
",",
"$",
"position",
"=",
"1000",
")",
"{",
"$",
"this",
"->",
"addElement",
"(",
"$",
"position",
",",
"$",
"this",
"->",
"inlineCon... | add inline conditional css
@param string $cond ie condition
@param string $style css snippet
@param null|array $attr attributes for style tag
@param int $position sort
@return Styles
@access public | [
"add",
"inline",
"conditional",
"css"
] | a38f130c19ab0a60ea52bc1d2560a68d2048d292 | https://github.com/jnjxp/html/blob/a38f130c19ab0a60ea52bc1d2560a68d2048d292/src/Helper/Styles.php#L125-L136 |
235,540 | jnjxp/html | src/Helper/Styles.php | Styles.inlineCaptureStart | public function inlineCaptureStart(array $attr = null, $position = 1000)
{
$this->capture[] = [
'func' => 'addInline',
'args' => [
'style' => '',
$attr,
$position
]
];
ob_start();
return $this;
} | php | public function inlineCaptureStart(array $attr = null, $position = 1000)
{
$this->capture[] = [
'func' => 'addInline',
'args' => [
'style' => '',
$attr,
$position
]
];
ob_start();
return $this;
} | [
"public",
"function",
"inlineCaptureStart",
"(",
"array",
"$",
"attr",
"=",
"null",
",",
"$",
"position",
"=",
"1000",
")",
"{",
"$",
"this",
"->",
"capture",
"[",
"]",
"=",
"[",
"'func'",
"=>",
"'addInline'",
",",
"'args'",
"=>",
"[",
"'style'",
"=>",... | capture inline snippet
@param null|array $attr attributes for style tag
@param int $position sort
@return Styles
@access public | [
"capture",
"inline",
"snippet"
] | a38f130c19ab0a60ea52bc1d2560a68d2048d292 | https://github.com/jnjxp/html/blob/a38f130c19ab0a60ea52bc1d2560a68d2048d292/src/Helper/Styles.php#L148-L161 |
235,541 | jnjxp/html | src/Helper/Styles.php | Styles.inlineCondCaptureStart | public function inlineCondCaptureStart(
$cond,
array $attr = null,
$position = 1000
) {
$this->capture[] = [
'func' => 'addInlineCond',
'args' => [
$cond,
'style' => '',
$attr,
$position
... | php | public function inlineCondCaptureStart(
$cond,
array $attr = null,
$position = 1000
) {
$this->capture[] = [
'func' => 'addInlineCond',
'args' => [
$cond,
'style' => '',
$attr,
$position
... | [
"public",
"function",
"inlineCondCaptureStart",
"(",
"$",
"cond",
",",
"array",
"$",
"attr",
"=",
"null",
",",
"$",
"position",
"=",
"1000",
")",
"{",
"$",
"this",
"->",
"capture",
"[",
"]",
"=",
"[",
"'func'",
"=>",
"'addInlineCond'",
",",
"'args'",
"... | capture inline conditional style
@param mixed $cond ie condition
@param null|array $attr attributes for style tag
@param int $position sort
@return Styles
@access public | [
"capture",
"inline",
"conditional",
"style"
] | a38f130c19ab0a60ea52bc1d2560a68d2048d292 | https://github.com/jnjxp/html/blob/a38f130c19ab0a60ea52bc1d2560a68d2048d292/src/Helper/Styles.php#L174-L191 |
235,542 | bfitech/zapmin | src/AdminStoreTables.php | AdminStoreTables.init | public static function init(AdminStore $admin_store) {
self::$admin_store = $admin_store;
self::$sql = $admin_store->store;
self::$logger = $admin_store->logger;
} | php | public static function init(AdminStore $admin_store) {
self::$admin_store = $admin_store;
self::$sql = $admin_store->store;
self::$logger = $admin_store->logger;
} | [
"public",
"static",
"function",
"init",
"(",
"AdminStore",
"$",
"admin_store",
")",
"{",
"self",
"::",
"$",
"admin_store",
"=",
"$",
"admin_store",
";",
"self",
"::",
"$",
"sql",
"=",
"$",
"admin_store",
"->",
"store",
";",
"self",
"::",
"$",
"logger",
... | Initialize object.
@param AdminStore $admin_store An instance of AdminStore. | [
"Initialize",
"object",
"."
] | 4aebbe0e727328a9632f80b2e6ba4aef6a2fabfe | https://github.com/bfitech/zapmin/blob/4aebbe0e727328a9632f80b2e6ba4aef6a2fabfe/src/AdminStoreTables.php#L29-L33 |
235,543 | bfitech/zapmin | src/AdminStoreTables.php | AdminStoreTables.drop | public static function drop() {
foreach([
"DROP VIEW IF EXISTS v_usess",
"DROP TABLE IF EXISTS usess",
"DROP TABLE IF EXISTS udata",
"DROP TABLE IF EXISTS meta",
] as $drop) {
// @codeCoverageIgnoreStart
try {
self::$sql->query_raw($drop);
} catch(SQLError $e) {
$msg = "Cannot drop data... | php | public static function drop() {
foreach([
"DROP VIEW IF EXISTS v_usess",
"DROP TABLE IF EXISTS usess",
"DROP TABLE IF EXISTS udata",
"DROP TABLE IF EXISTS meta",
] as $drop) {
// @codeCoverageIgnoreStart
try {
self::$sql->query_raw($drop);
} catch(SQLError $e) {
$msg = "Cannot drop data... | [
"public",
"static",
"function",
"drop",
"(",
")",
"{",
"foreach",
"(",
"[",
"\"DROP VIEW IF EXISTS v_usess\"",
",",
"\"DROP TABLE IF EXISTS usess\"",
",",
"\"DROP TABLE IF EXISTS udata\"",
",",
"\"DROP TABLE IF EXISTS meta\"",
",",
"]",
"as",
"$",
"drop",
")",
"{",
"/... | Drop existing tables. | [
"Drop",
"existing",
"tables",
"."
] | 4aebbe0e727328a9632f80b2e6ba4aef6a2fabfe | https://github.com/bfitech/zapmin/blob/4aebbe0e727328a9632f80b2e6ba4aef6a2fabfe/src/AdminStoreTables.php#L45-L62 |
235,544 | bfitech/zapmin | src/AdminStoreTables.php | AdminStoreTables.exists | public static function exists($force_create_table=null) {
$sql = self::$sql;
$sql::$logger->deactivate();
try {
$sql->query("SELECT 1 FROM udata LIMIT 1");
$sql::$logger->activate();
if ($force_create_table) {
self::drop();
self::$logger->info("Zapmin: Recreating tables.");
return false;
}... | php | public static function exists($force_create_table=null) {
$sql = self::$sql;
$sql::$logger->deactivate();
try {
$sql->query("SELECT 1 FROM udata LIMIT 1");
$sql::$logger->activate();
if ($force_create_table) {
self::drop();
self::$logger->info("Zapmin: Recreating tables.");
return false;
}... | [
"public",
"static",
"function",
"exists",
"(",
"$",
"force_create_table",
"=",
"null",
")",
"{",
"$",
"sql",
"=",
"self",
"::",
"$",
"sql",
";",
"$",
"sql",
"::",
"$",
"logger",
"->",
"deactivate",
"(",
")",
";",
"try",
"{",
"$",
"sql",
"->",
"quer... | Check if tables exist.
@param bool $force_create_table Recreate tables if true.
@return bool True if tables exist. | [
"Check",
"if",
"tables",
"exist",
"."
] | 4aebbe0e727328a9632f80b2e6ba4aef6a2fabfe | https://github.com/bfitech/zapmin/blob/4aebbe0e727328a9632f80b2e6ba4aef6a2fabfe/src/AdminStoreTables.php#L70-L86 |
235,545 | bfitech/zapmin | src/AdminStoreTables.php | AdminStoreTables.fragments | public static function fragments($expiration=7200) {
$sql = self::$sql;
$args = [];
$args['index'] = $sql->stmt_fragment('index');
$args['engine'] = $sql->stmt_fragment('engine');
$args['dtnow'] = $sql->stmt_fragment('datetime');
$args['expire'] = $sql->stmt_fragment(
'datetime', ['delta' => $expiration... | php | public static function fragments($expiration=7200) {
$sql = self::$sql;
$args = [];
$args['index'] = $sql->stmt_fragment('index');
$args['engine'] = $sql->stmt_fragment('engine');
$args['dtnow'] = $sql->stmt_fragment('datetime');
$args['expire'] = $sql->stmt_fragment(
'datetime', ['delta' => $expiration... | [
"public",
"static",
"function",
"fragments",
"(",
"$",
"expiration",
"=",
"7200",
")",
"{",
"$",
"sql",
"=",
"self",
"::",
"$",
"sql",
";",
"$",
"args",
"=",
"[",
"]",
";",
"$",
"args",
"[",
"'index'",
"]",
"=",
"$",
"sql",
"->",
"stmt_fragment",
... | SQL statement fragments.
@param int $expiration Regular session expiration duration,
in second. | [
"SQL",
"statement",
"fragments",
"."
] | 4aebbe0e727328a9632f80b2e6ba4aef6a2fabfe | https://github.com/bfitech/zapmin/blob/4aebbe0e727328a9632f80b2e6ba4aef6a2fabfe/src/AdminStoreTables.php#L94-L105 |
235,546 | bfitech/zapmin | src/AdminStoreTables.php | AdminStoreTables.install | public static function install($expiration=7200) {
$dtnow = $expire = null;
extract(self::fragments($expiration));
$sql = self::$sql;
# user table
$user_table = ("
CREATE TABLE udata (
uid %s,
uname VARCHAR(64) UNIQUE,
upass VARCHAR(64),
usalt VARCHAR(16),
since TIMESTAMP NOT NULL DE... | php | public static function install($expiration=7200) {
$dtnow = $expire = null;
extract(self::fragments($expiration));
$sql = self::$sql;
# user table
$user_table = ("
CREATE TABLE udata (
uid %s,
uname VARCHAR(64) UNIQUE,
upass VARCHAR(64),
usalt VARCHAR(16),
since TIMESTAMP NOT NULL DE... | [
"public",
"static",
"function",
"install",
"(",
"$",
"expiration",
"=",
"7200",
")",
"{",
"$",
"dtnow",
"=",
"$",
"expire",
"=",
"null",
";",
"extract",
"(",
"self",
"::",
"fragments",
"(",
"$",
"expiration",
")",
")",
";",
"$",
"sql",
"=",
"self",
... | Install tables.
@param int $expiration Regular session expiration duration,
in second.
@note In case of email addresses:
- Unique and null in one column is not portable. Must check
email uniqueness manually.
- Email verification must be held separately. Table only
reserves a column for it. | [
"Install",
"tables",
"."
] | 4aebbe0e727328a9632f80b2e6ba4aef6a2fabfe | https://github.com/bfitech/zapmin/blob/4aebbe0e727328a9632f80b2e6ba4aef6a2fabfe/src/AdminStoreTables.php#L118-L194 |
235,547 | bfitech/zapmin | src/AdminStoreTables.php | AdminStoreTables.upgrade | public static function upgrade() {
$sql = self::$sql;
$sql::$logger->deactivate();
try {
$version = $sql->query(
"SELECT version FROM meta LIMIT 1")['version'];
} catch(SQLError $e) {
$sql::$logger->activate();
return self::upgrade_tables();
}
$sql::$logger->activate();
if (0 <= version_com... | php | public static function upgrade() {
$sql = self::$sql;
$sql::$logger->deactivate();
try {
$version = $sql->query(
"SELECT version FROM meta LIMIT 1")['version'];
} catch(SQLError $e) {
$sql::$logger->activate();
return self::upgrade_tables();
}
$sql::$logger->activate();
if (0 <= version_com... | [
"public",
"static",
"function",
"upgrade",
"(",
")",
"{",
"$",
"sql",
"=",
"self",
"::",
"$",
"sql",
";",
"$",
"sql",
"::",
"$",
"logger",
"->",
"deactivate",
"(",
")",
";",
"try",
"{",
"$",
"version",
"=",
"$",
"sql",
"->",
"query",
"(",
"\"SELE... | Check if tables need upgrade. | [
"Check",
"if",
"tables",
"need",
"upgrade",
"."
] | 4aebbe0e727328a9632f80b2e6ba4aef6a2fabfe | https://github.com/bfitech/zapmin/blob/4aebbe0e727328a9632f80b2e6ba4aef6a2fabfe/src/AdminStoreTables.php#L199-L217 |
235,548 | bfitech/zapmin | src/AdminStoreTables.php | AdminStoreTables.upgrade_tables | private static function upgrade_tables($from_version=null) {
$sql = self::$sql;
if (!$from_version) {
$from_version = '0.0';
$sql->query_raw("
CREATE TABLE meta (
version VARCHAR(24) NOT NULL DEFAULT '0.0'
);
");
$sql->insert('meta', [
'version' => self::TABLE_VERSION,
]);
} else... | php | private static function upgrade_tables($from_version=null) {
$sql = self::$sql;
if (!$from_version) {
$from_version = '0.0';
$sql->query_raw("
CREATE TABLE meta (
version VARCHAR(24) NOT NULL DEFAULT '0.0'
);
");
$sql->insert('meta', [
'version' => self::TABLE_VERSION,
]);
} else... | [
"private",
"static",
"function",
"upgrade_tables",
"(",
"$",
"from_version",
"=",
"null",
")",
"{",
"$",
"sql",
"=",
"self",
"::",
"$",
"sql",
";",
"if",
"(",
"!",
"$",
"from_version",
")",
"{",
"$",
"from_version",
"=",
"'0.0'",
";",
"$",
"sql",
"->... | Upgrade tables. | [
"Upgrade",
"tables",
"."
] | 4aebbe0e727328a9632f80b2e6ba4aef6a2fabfe | https://github.com/bfitech/zapmin/blob/4aebbe0e727328a9632f80b2e6ba4aef6a2fabfe/src/AdminStoreTables.php#L222-L247 |
235,549 | affinity4/config | src/Loader/Json.php | Json.input | public function input($file_content)
{
$this->file_content = $file_content;
$this->parsed_content = json_decode($this->file_content, true);
} | php | public function input($file_content)
{
$this->file_content = $file_content;
$this->parsed_content = json_decode($this->file_content, true);
} | [
"public",
"function",
"input",
"(",
"$",
"file_content",
")",
"{",
"$",
"this",
"->",
"file_content",
"=",
"$",
"file_content",
";",
"$",
"this",
"->",
"parsed_content",
"=",
"json_decode",
"(",
"$",
"this",
"->",
"file_content",
",",
"true",
")",
";",
"... | Get raw JSON content and convert to array using json_decode
@author Luke Watts <luke@affinity4.ie>
@since 1.1.0
@param $file_content string
@return void | [
"Get",
"raw",
"JSON",
"content",
"and",
"convert",
"to",
"array",
"using",
"json_decode"
] | df25bbf0839626af9b70b885e28bf32b1ad8d94a | https://github.com/affinity4/config/blob/df25bbf0839626af9b70b885e28bf32b1ad8d94a/src/Loader/Json.php#L59-L64 |
235,550 | routegroup/native-media | src/Traits/Fileable.php | Fileable.files | public function files()
{
return $this->morphToMany(
config('media.model', \Routegroup\Media\File::class),
'mediables',
null,
null,
'media_id'
)
->withPivot('type')
->whereNotNull('mediables.type')
->with... | php | public function files()
{
return $this->morphToMany(
config('media.model', \Routegroup\Media\File::class),
'mediables',
null,
null,
'media_id'
)
->withPivot('type')
->whereNotNull('mediables.type')
->with... | [
"public",
"function",
"files",
"(",
")",
"{",
"return",
"$",
"this",
"->",
"morphToMany",
"(",
"config",
"(",
"'media.model'",
",",
"\\",
"Routegroup",
"\\",
"Media",
"\\",
"File",
"::",
"class",
")",
",",
"'mediables'",
",",
"null",
",",
"null",
",",
... | Has many files.
@return \Illuminate\Database\Eloquent\Relations\BelongsToMany | [
"Has",
"many",
"files",
"."
] | 5ea35c46c2ac1019e277ec4fe698f17581524631 | https://github.com/routegroup/native-media/blob/5ea35c46c2ac1019e277ec4fe698f17581524631/src/Traits/Fileable.php#L32-L44 |
235,551 | asbsoft/yii2module-users_0_170112 | models/User.php | User.profileRules | public function profileRules()
{
return [
[['username', 'password', 'email'], 'required', 'on' => self::SCENARIO_CREATE],
['username', 'match', 'pattern' => '/^[A-Za-z][A-Za-z0-9\-\.\ ]+$/i',
'message' => Yii::t($this->tcModule, 'Only latin letters, digits, hyphen, p... | php | public function profileRules()
{
return [
[['username', 'password', 'email'], 'required', 'on' => self::SCENARIO_CREATE],
['username', 'match', 'pattern' => '/^[A-Za-z][A-Za-z0-9\-\.\ ]+$/i',
'message' => Yii::t($this->tcModule, 'Only latin letters, digits, hyphen, p... | [
"public",
"function",
"profileRules",
"(",
")",
"{",
"return",
"[",
"[",
"[",
"'username'",
",",
"'password'",
",",
"'email'",
"]",
",",
"'required'",
",",
"'on'",
"=>",
"self",
"::",
"SCENARIO_CREATE",
"]",
",",
"[",
"'username'",
",",
"'match'",
",",
"... | Part of rules for common use with ProfileForm.
Rules with fields length, patterns be best in single place. | [
"Part",
"of",
"rules",
"for",
"common",
"use",
"with",
"ProfileForm",
".",
"Rules",
"with",
"fields",
"length",
"patterns",
"be",
"best",
"in",
"single",
"place",
"."
] | 3906fdde2d5fdd54637f2b5246d52fe91ec5f648 | https://github.com/asbsoft/yii2module-users_0_170112/blob/3906fdde2d5fdd54637f2b5246d52fe91ec5f648/models/User.php#L107-L122 |
235,552 | bytorsten/graphql-subscriptions | src/Rules/SingleFieldSubscriptions.php | SingleFieldSubscriptions.getVisitor | public function getVisitor(ValidationContext $context)
{
return [
NodeKind::OPERATION_DEFINITION => function (OperationDefinitionNode $node) use ($context) {
if ($node->operation === 'subscription') {
if (count($node->selectionSet->selections) !== 1) {
... | php | public function getVisitor(ValidationContext $context)
{
return [
NodeKind::OPERATION_DEFINITION => function (OperationDefinitionNode $node) use ($context) {
if ($node->operation === 'subscription') {
if (count($node->selectionSet->selections) !== 1) {
... | [
"public",
"function",
"getVisitor",
"(",
"ValidationContext",
"$",
"context",
")",
"{",
"return",
"[",
"NodeKind",
"::",
"OPERATION_DEFINITION",
"=>",
"function",
"(",
"OperationDefinitionNode",
"$",
"node",
")",
"use",
"(",
"$",
"context",
")",
"{",
"if",
"("... | Returns structure suitable for GraphQL\Language\Visitor
@see \GraphQL\Language\Visitor
@param ValidationContext $context
@return array | [
"Returns",
"structure",
"suitable",
"for",
"GraphQL",
"\\",
"Language",
"\\",
"Visitor"
] | c47b40c0c1762439573029cfef49fee5a6ca7a08 | https://github.com/bytorsten/graphql-subscriptions/blob/c47b40c0c1762439573029cfef49fee5a6ca7a08/src/Rules/SingleFieldSubscriptions.php#L28-L44 |
235,553 | gossi/trixionary | src/TrixionaryModule.php | TrixionaryModule.getSkillsPath | public function getSkillsPath(Sport $sport) {
return $this->getSportPath($sport)->append($this->getSkillsSegment($sport));
} | php | public function getSkillsPath(Sport $sport) {
return $this->getSportPath($sport)->append($this->getSkillsSegment($sport));
} | [
"public",
"function",
"getSkillsPath",
"(",
"Sport",
"$",
"sport",
")",
"{",
"return",
"$",
"this",
"->",
"getSportPath",
"(",
"$",
"sport",
")",
"->",
"append",
"(",
"$",
"this",
"->",
"getSkillsSegment",
"(",
"$",
"sport",
")",
")",
";",
"}"
] | Returns the path for skills for the given sport
@param Sport $sport
@return Path | [
"Returns",
"the",
"path",
"for",
"skills",
"for",
"the",
"given",
"sport"
] | 221a6c5322473d7d7f8e322958a3ee46d87da150 | https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/TrixionaryModule.php#L150-L152 |
235,554 | gossi/trixionary | src/TrixionaryModule.php | TrixionaryModule.getSkillPath | public function getSkillPath(Skill $skill) {
return $this->getSkillsPath($skill->getSport())->append($this->getSkillSegment($skill));
} | php | public function getSkillPath(Skill $skill) {
return $this->getSkillsPath($skill->getSport())->append($this->getSkillSegment($skill));
} | [
"public",
"function",
"getSkillPath",
"(",
"Skill",
"$",
"skill",
")",
"{",
"return",
"$",
"this",
"->",
"getSkillsPath",
"(",
"$",
"skill",
"->",
"getSport",
"(",
")",
")",
"->",
"append",
"(",
"$",
"this",
"->",
"getSkillSegment",
"(",
"$",
"skill",
... | Returns the path for the given skill
@param Skill $skill
@return Path | [
"Returns",
"the",
"path",
"for",
"the",
"given",
"skill"
] | 221a6c5322473d7d7f8e322958a3ee46d87da150 | https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/TrixionaryModule.php#L178-L180 |
235,555 | gossi/trixionary | src/TrixionaryModule.php | TrixionaryModule.getSkillUrl | public function getSkillUrl(Skill $skill) {
return $this->getSkillsUrl($skill->getSport()) . '/' . $this->getSkillSegment($skill);
} | php | public function getSkillUrl(Skill $skill) {
return $this->getSkillsUrl($skill->getSport()) . '/' . $this->getSkillSegment($skill);
} | [
"public",
"function",
"getSkillUrl",
"(",
"Skill",
"$",
"skill",
")",
"{",
"return",
"$",
"this",
"->",
"getSkillsUrl",
"(",
"$",
"skill",
"->",
"getSport",
"(",
")",
")",
".",
"'/'",
".",
"$",
"this",
"->",
"getSkillSegment",
"(",
"$",
"skill",
")",
... | Returns the url for the given skill
@param Skill $skill
@return string | [
"Returns",
"the",
"url",
"for",
"the",
"given",
"skill"
] | 221a6c5322473d7d7f8e322958a3ee46d87da150 | https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/TrixionaryModule.php#L187-L189 |
235,556 | samurai-fw/samurai | src/Console/Controller/UtilityController.php | UtilityController.locatorAction | public function locatorAction()
{
$arg = $this->request->get('args');
// task execute.
if (($task = $this->request->get('tasks')) || ($task = $this->request->get('option.T'))) {
return [self::FORWARD_ACTION, 'task.list'];
} elseif ($this->isTask($arg)) {
retu... | php | public function locatorAction()
{
$arg = $this->request->get('args');
// task execute.
if (($task = $this->request->get('tasks')) || ($task = $this->request->get('option.T'))) {
return [self::FORWARD_ACTION, 'task.list'];
} elseif ($this->isTask($arg)) {
retu... | [
"public",
"function",
"locatorAction",
"(",
")",
"{",
"$",
"arg",
"=",
"$",
"this",
"->",
"request",
"->",
"get",
"(",
"'args'",
")",
";",
"// task execute.",
"if",
"(",
"(",
"$",
"task",
"=",
"$",
"this",
"->",
"request",
"->",
"get",
"(",
"'tasks'"... | action locator action. | [
"action",
"locator",
"action",
"."
] | 7ca3847b13f86e2847a17ab5e8e4e20893021d5a | https://github.com/samurai-fw/samurai/blob/7ca3847b13f86e2847a17ab5e8e4e20893021d5a/src/Console/Controller/UtilityController.php#L51-L83 |
235,557 | samurai-fw/samurai | src/Console/Controller/UtilityController.php | UtilityController.versionAction | public function versionAction()
{
$this->assign('version', Samurai::getVersion());
$this->assign('state', Samurai::getState());
return self::VIEW_TEMPLATE;
} | php | public function versionAction()
{
$this->assign('version', Samurai::getVersion());
$this->assign('state', Samurai::getState());
return self::VIEW_TEMPLATE;
} | [
"public",
"function",
"versionAction",
"(",
")",
"{",
"$",
"this",
"->",
"assign",
"(",
"'version'",
",",
"Samurai",
"::",
"getVersion",
"(",
")",
")",
";",
"$",
"this",
"->",
"assign",
"(",
"'state'",
",",
"Samurai",
"::",
"getState",
"(",
")",
")",
... | show version action. | [
"show",
"version",
"action",
"."
] | 7ca3847b13f86e2847a17ab5e8e4e20893021d5a | https://github.com/samurai-fw/samurai/blob/7ca3847b13f86e2847a17ab5e8e4e20893021d5a/src/Console/Controller/UtilityController.php#L90-L95 |
235,558 | samurai-fw/samurai | src/Console/Controller/UtilityController.php | UtilityController.usageAction | public function usageAction()
{
$this->assign('version', Samurai::getVersion());
$this->assign('state', Samurai::getState());
$this->assign('script', './app'); // TODO: $this->request->getScript()
return self::VIEW_TEMPLATE;
} | php | public function usageAction()
{
$this->assign('version', Samurai::getVersion());
$this->assign('state', Samurai::getState());
$this->assign('script', './app'); // TODO: $this->request->getScript()
return self::VIEW_TEMPLATE;
} | [
"public",
"function",
"usageAction",
"(",
")",
"{",
"$",
"this",
"->",
"assign",
"(",
"'version'",
",",
"Samurai",
"::",
"getVersion",
"(",
")",
")",
";",
"$",
"this",
"->",
"assign",
"(",
"'state'",
",",
"Samurai",
"::",
"getState",
"(",
")",
")",
"... | show usage action. | [
"show",
"usage",
"action",
"."
] | 7ca3847b13f86e2847a17ab5e8e4e20893021d5a | https://github.com/samurai-fw/samurai/blob/7ca3847b13f86e2847a17ab5e8e4e20893021d5a/src/Console/Controller/UtilityController.php#L101-L107 |
235,559 | samurai-fw/samurai | src/Console/Controller/UtilityController.php | UtilityController.serverAction | public function serverAction()
{
chdir($this->application->config('directory.document_root'));
$host = $this->request->get('host', 'localhost');
$port = $this->request->get('port', 8888);
passthru(sprintf('php -S %s:%s index.php', $host, $port));
} | php | public function serverAction()
{
chdir($this->application->config('directory.document_root'));
$host = $this->request->get('host', 'localhost');
$port = $this->request->get('port', 8888);
passthru(sprintf('php -S %s:%s index.php', $host, $port));
} | [
"public",
"function",
"serverAction",
"(",
")",
"{",
"chdir",
"(",
"$",
"this",
"->",
"application",
"->",
"config",
"(",
"'directory.document_root'",
")",
")",
";",
"$",
"host",
"=",
"$",
"this",
"->",
"request",
"->",
"get",
"(",
"'host'",
",",
"'local... | start server action. | [
"start",
"server",
"action",
"."
] | 7ca3847b13f86e2847a17ab5e8e4e20893021d5a | https://github.com/samurai-fw/samurai/blob/7ca3847b13f86e2847a17ab5e8e4e20893021d5a/src/Console/Controller/UtilityController.php#L113-L119 |
235,560 | JaredClemence/binn | src/builders/KeyValueByteGenerator.php | KeyValueByteGenerator.readNextKeyValuePair | public function readNextKeyValuePair( $truncatedString ) : ContainerElement {
$keyBytes = $this->extractKeyBytes( $truncatedString );
$remainingBytes = substr( $truncatedString, $keyBytes->getLength() );
$data = $this->readData( $remainingBytes );
return new ContainerElement($keyBytes, $... | php | public function readNextKeyValuePair( $truncatedString ) : ContainerElement {
$keyBytes = $this->extractKeyBytes( $truncatedString );
$remainingBytes = substr( $truncatedString, $keyBytes->getLength() );
$data = $this->readData( $remainingBytes );
return new ContainerElement($keyBytes, $... | [
"public",
"function",
"readNextKeyValuePair",
"(",
"$",
"truncatedString",
")",
":",
"ContainerElement",
"{",
"$",
"keyBytes",
"=",
"$",
"this",
"->",
"extractKeyBytes",
"(",
"$",
"truncatedString",
")",
";",
"$",
"remainingBytes",
"=",
"substr",
"(",
"$",
"tr... | This method receives a data string that is already truncated.
The expectation is that the first bytes will represent the key, then a series
of bytes will represent the value. That value will end either at the beginning of the
next data structure or the end of the data string.
@param type $truncatedString | [
"This",
"method",
"receives",
"a",
"data",
"string",
"that",
"is",
"already",
"truncated",
".",
"The",
"expectation",
"is",
"that",
"the",
"first",
"bytes",
"will",
"represent",
"the",
"key",
"then",
"a",
"series",
"of",
"bytes",
"will",
"represent",
"the",
... | 838591e7a92c0f257c09a1df141d80737a20f7d9 | https://github.com/JaredClemence/binn/blob/838591e7a92c0f257c09a1df141d80737a20f7d9/src/builders/KeyValueByteGenerator.php#L53-L58 |
235,561 | romanmatyus/FileMailer | src/FileMailer/FileMailer.php | FileMailer.send | public function send(Message $message)
{
$content = $message->generateMessage();
preg_match('~Message-ID: <(?<message_id>\w+)[^>]+>~', $content, $matches);
$path = $this->tempDir . '/'. $this->prefix . $matches['message_id'] . '.' . self::FILE_EXTENSION;
if (($bytes = file_put_contents($path, $content)) === ... | php | public function send(Message $message)
{
$content = $message->generateMessage();
preg_match('~Message-ID: <(?<message_id>\w+)[^>]+>~', $content, $matches);
$path = $this->tempDir . '/'. $this->prefix . $matches['message_id'] . '.' . self::FILE_EXTENSION;
if (($bytes = file_put_contents($path, $content)) === ... | [
"public",
"function",
"send",
"(",
"Message",
"$",
"message",
")",
"{",
"$",
"content",
"=",
"$",
"message",
"->",
"generateMessage",
"(",
")",
";",
"preg_match",
"(",
"'~Message-ID: <(?<message_id>\\w+)[^>]+>~'",
",",
"$",
"content",
",",
"$",
"matches",
")",... | Store mail to file.
@param Message $message
@return int | [
"Store",
"mail",
"to",
"file",
"."
] | 732685f5505ea764fe76cc92bc4ffbc3b4ea917b | https://github.com/romanmatyus/FileMailer/blob/732685f5505ea764fe76cc92bc4ffbc3b4ea917b/src/FileMailer/FileMailer.php#L66-L78 |
235,562 | ytubes/videos | controllers/CategoryController.php | CategoryController.actionIndex | public function actionIndex($slug, $page = 1, $sort = '')
{
$this->trigger(self::EVENT_BEFORE_CATEGORY_SHOW);
$data['slug'] = $slug;
$data['sort'] = $sort;
$data['page'] = (int) $page;
$data['route'] = '/' . $this->getRoute();
// Ищем категорию
$data['categ... | php | public function actionIndex($slug, $page = 1, $sort = '')
{
$this->trigger(self::EVENT_BEFORE_CATEGORY_SHOW);
$data['slug'] = $slug;
$data['sort'] = $sort;
$data['page'] = (int) $page;
$data['route'] = '/' . $this->getRoute();
// Ищем категорию
$data['categ... | [
"public",
"function",
"actionIndex",
"(",
"$",
"slug",
",",
"$",
"page",
"=",
"1",
",",
"$",
"sort",
"=",
"''",
")",
"{",
"$",
"this",
"->",
"trigger",
"(",
"self",
"::",
"EVENT_BEFORE_CATEGORY_SHOW",
")",
";",
"$",
"data",
"[",
"'slug'",
"]",
"=",
... | Lists categorized Videos models.
@return mixed | [
"Lists",
"categorized",
"Videos",
"models",
"."
] | a35ecb1f8e38381063fbd757683a13df3a8cbc48 | https://github.com/ytubes/videos/blob/a35ecb1f8e38381063fbd757683a13df3a8cbc48/controllers/CategoryController.php#L56-L95 |
235,563 | khooz/commons | src/MrAudioGuy/Commons/Arr.php | Arr.pluck | public static function pluck (array $array, $keys)
{
if (!is_array($keys))
{
$keys = func_get_args();
array_shift($keys);
}
return array_intersect_key($array, array_flip($keys));
} | php | public static function pluck (array $array, $keys)
{
if (!is_array($keys))
{
$keys = func_get_args();
array_shift($keys);
}
return array_intersect_key($array, array_flip($keys));
} | [
"public",
"static",
"function",
"pluck",
"(",
"array",
"$",
"array",
",",
"$",
"keys",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"keys",
")",
")",
"{",
"$",
"keys",
"=",
"func_get_args",
"(",
")",
";",
"array_shift",
"(",
"$",
"keys",
")",
... | Plucks keys from an array
@param array $array
@param $keys
@return array | [
"Plucks",
"keys",
"from",
"an",
"array"
] | d426df97075e66e19f7576e89bdd954c699914f4 | https://github.com/khooz/commons/blob/d426df97075e66e19f7576e89bdd954c699914f4/src/MrAudioGuy/Commons/Arr.php#L20-L29 |
235,564 | khooz/commons | src/MrAudioGuy/Commons/Arr.php | Arr.is_associative | public static function is_associative (array $array)
{
foreach ($array as $k => $v)
{
$t = str_replace((int)$k, '', $k);
if (!empty($t))
{
if (!static::is_int($k))
{
return true;
}
}
}
return false;
} | php | public static function is_associative (array $array)
{
foreach ($array as $k => $v)
{
$t = str_replace((int)$k, '', $k);
if (!empty($t))
{
if (!static::is_int($k))
{
return true;
}
}
}
return false;
} | [
"public",
"static",
"function",
"is_associative",
"(",
"array",
"$",
"array",
")",
"{",
"foreach",
"(",
"$",
"array",
"as",
"$",
"k",
"=>",
"$",
"v",
")",
"{",
"$",
"t",
"=",
"str_replace",
"(",
"(",
"int",
")",
"$",
"k",
",",
"''",
",",
"$",
"... | Determines if an array is associative
@param array $array
@return bool | [
"Determines",
"if",
"an",
"array",
"is",
"associative"
] | d426df97075e66e19f7576e89bdd954c699914f4 | https://github.com/khooz/commons/blob/d426df97075e66e19f7576e89bdd954c699914f4/src/MrAudioGuy/Commons/Arr.php#L57-L72 |
235,565 | jsiefer/class-mocker | src/ClassMocker.php | ClassMocker.enable | public function enable()
{
spl_autoload_register([$this, 'autoload'], true, true);
spl_autoload_register([$this, 'autoloadOptional'], true, false);
return $this;
} | php | public function enable()
{
spl_autoload_register([$this, 'autoload'], true, true);
spl_autoload_register([$this, 'autoloadOptional'], true, false);
return $this;
} | [
"public",
"function",
"enable",
"(",
")",
"{",
"spl_autoload_register",
"(",
"[",
"$",
"this",
",",
"'autoload'",
"]",
",",
"true",
",",
"true",
")",
";",
"spl_autoload_register",
"(",
"[",
"$",
"this",
",",
"'autoloadOptional'",
"]",
",",
"true",
",",
"... | Enable class mocker by registering the auto loader
@return $this | [
"Enable",
"class",
"mocker",
"by",
"registering",
"the",
"auto",
"loader"
] | a355fc9bece8e6f27fbfd09b1631234f7d73a791 | https://github.com/jsiefer/class-mocker/blob/a355fc9bece8e6f27fbfd09b1631234f7d73a791/src/ClassMocker.php#L68-L73 |
235,566 | jsiefer/class-mocker | src/ClassMocker.php | ClassMocker.mock | public function mock($pattern, $ifNotExist = false)
{
if ($ifNotExist) {
$this->_optionalMockPatterns[] = $pattern;
} else {
$this->_mockPatterns[] = $pattern;
}
return $this;
} | php | public function mock($pattern, $ifNotExist = false)
{
if ($ifNotExist) {
$this->_optionalMockPatterns[] = $pattern;
} else {
$this->_mockPatterns[] = $pattern;
}
return $this;
} | [
"public",
"function",
"mock",
"(",
"$",
"pattern",
",",
"$",
"ifNotExist",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"ifNotExist",
")",
"{",
"$",
"this",
"->",
"_optionalMockPatterns",
"[",
"]",
"=",
"$",
"pattern",
";",
"}",
"else",
"{",
"$",
"this",
... | Mock any class matching the given pattern
e.g.
mock('Mage*')
mock('Mage*Collection')
mock('Foo\Bar\*')
@param string $pattern
@param bool $ifNotExist
@return $this | [
"Mock",
"any",
"class",
"matching",
"the",
"given",
"pattern"
] | a355fc9bece8e6f27fbfd09b1631234f7d73a791 | https://github.com/jsiefer/class-mocker/blob/a355fc9bece8e6f27fbfd09b1631234f7d73a791/src/ClassMocker.php#L114-L123 |
235,567 | jsiefer/class-mocker | src/ClassMocker.php | ClassMocker.generateAndLoadClass | public function generateAndLoadClass($className)
{
if (class_exists($className, false)) {
throw new \RuntimeException("Unable to generate and load already existing class '$className'");
}
$filename = $this->findFile($className);
if (!$filename || !file_exists($filename)... | php | public function generateAndLoadClass($className)
{
if (class_exists($className, false)) {
throw new \RuntimeException("Unable to generate and load already existing class '$className'");
}
$filename = $this->findFile($className);
if (!$filename || !file_exists($filename)... | [
"public",
"function",
"generateAndLoadClass",
"(",
"$",
"className",
")",
"{",
"if",
"(",
"class_exists",
"(",
"$",
"className",
",",
"false",
")",
")",
"{",
"throw",
"new",
"\\",
"RuntimeException",
"(",
"\"Unable to generate and load already existing class '$classNa... | Generate and load the given class
@param string $className
@throws \Exception
@return void | [
"Generate",
"and",
"load",
"the",
"given",
"class"
] | a355fc9bece8e6f27fbfd09b1631234f7d73a791 | https://github.com/jsiefer/class-mocker/blob/a355fc9bece8e6f27fbfd09b1631234f7d73a791/src/ClassMocker.php#L215-L235 |
235,568 | jsiefer/class-mocker | src/ClassMocker.php | ClassMocker._autoload | protected function _autoload($patterns, $className)
{
foreach ($patterns as $pattern) {
if (!fnmatch($pattern, $className, FNM_NOESCAPE)) {
continue;
}
$this->generateAndLoadClass($className);
return true;
}
return false;
} | php | protected function _autoload($patterns, $className)
{
foreach ($patterns as $pattern) {
if (!fnmatch($pattern, $className, FNM_NOESCAPE)) {
continue;
}
$this->generateAndLoadClass($className);
return true;
}
return false;
} | [
"protected",
"function",
"_autoload",
"(",
"$",
"patterns",
",",
"$",
"className",
")",
"{",
"foreach",
"(",
"$",
"patterns",
"as",
"$",
"pattern",
")",
"{",
"if",
"(",
"!",
"fnmatch",
"(",
"$",
"pattern",
",",
"$",
"className",
",",
"FNM_NOESCAPE",
")... | Autoload class if matching any of given patterns
@param string[] $patterns
@param string $className
@return bool | [
"Autoload",
"class",
"if",
"matching",
"any",
"of",
"given",
"patterns"
] | a355fc9bece8e6f27fbfd09b1631234f7d73a791 | https://github.com/jsiefer/class-mocker/blob/a355fc9bece8e6f27fbfd09b1631234f7d73a791/src/ClassMocker.php#L245-L256 |
235,569 | jsiefer/class-mocker | src/ClassMocker.php | ClassMocker.evalContent | private function evalContent(FileGenerator $classFileGenerator)
{
$code = $classFileGenerator->generate();
$code = substr($code, 6); // remove <?php
eval($code);
} | php | private function evalContent(FileGenerator $classFileGenerator)
{
$code = $classFileGenerator->generate();
$code = substr($code, 6); // remove <?php
eval($code);
} | [
"private",
"function",
"evalContent",
"(",
"FileGenerator",
"$",
"classFileGenerator",
")",
"{",
"$",
"code",
"=",
"$",
"classFileGenerator",
"->",
"generate",
"(",
")",
";",
"$",
"code",
"=",
"substr",
"(",
"$",
"code",
",",
"6",
")",
";",
"// remove <?ph... | Eval file content
@param FileGenerator $classFileGenerator | [
"Eval",
"file",
"content"
] | a355fc9bece8e6f27fbfd09b1631234f7d73a791 | https://github.com/jsiefer/class-mocker/blob/a355fc9bece8e6f27fbfd09b1631234f7d73a791/src/ClassMocker.php#L263-L269 |
235,570 | jsiefer/class-mocker | src/ClassMocker.php | ClassMocker.findFile | protected function findFile($className)
{
$genDir = $this->getGenerationDir();
if (!$genDir) {
return null;
}
$path = [$genDir];
$path[] = str_replace('\\', DIRECTORY_SEPARATOR, $className) . '.php';
$path = implode(DIRECTORY_SEPARATOR, $path);
... | php | protected function findFile($className)
{
$genDir = $this->getGenerationDir();
if (!$genDir) {
return null;
}
$path = [$genDir];
$path[] = str_replace('\\', DIRECTORY_SEPARATOR, $className) . '.php';
$path = implode(DIRECTORY_SEPARATOR, $path);
... | [
"protected",
"function",
"findFile",
"(",
"$",
"className",
")",
"{",
"$",
"genDir",
"=",
"$",
"this",
"->",
"getGenerationDir",
"(",
")",
";",
"if",
"(",
"!",
"$",
"genDir",
")",
"{",
"return",
"null",
";",
"}",
"$",
"path",
"=",
"[",
"$",
"genDir... | Retrieve file for class name
@param string $className
@return string
@throws \Exception | [
"Retrieve",
"file",
"for",
"class",
"name"
] | a355fc9bece8e6f27fbfd09b1631234f7d73a791 | https://github.com/jsiefer/class-mocker/blob/a355fc9bece8e6f27fbfd09b1631234f7d73a791/src/ClassMocker.php#L279-L302 |
235,571 | geniv/nette-filters | src/FilterLatte.php | FilterLatte.addTag | public static function addTag(string $string, string $tag): string
{
$lastPoint = strrpos($string, '.');
return ($tag ? substr_replace($string, sprintf('.%s.', $tag), $lastPoint, 1) : $string);
} | php | public static function addTag(string $string, string $tag): string
{
$lastPoint = strrpos($string, '.');
return ($tag ? substr_replace($string, sprintf('.%s.', $tag), $lastPoint, 1) : $string);
} | [
"public",
"static",
"function",
"addTag",
"(",
"string",
"$",
"string",
",",
"string",
"$",
"tag",
")",
":",
"string",
"{",
"$",
"lastPoint",
"=",
"strrpos",
"(",
"$",
"string",
",",
"'.'",
")",
";",
"return",
"(",
"$",
"tag",
"?",
"substr_replace",
... | Add tag.
@param string $string
@param string $tag
@return string | [
"Add",
"tag",
"."
] | 0e7838d7b9c9be6c3ecf17f54353830b30eecea7 | https://github.com/geniv/nette-filters/blob/0e7838d7b9c9be6c3ecf17f54353830b30eecea7/src/FilterLatte.php#L47-L51 |
235,572 | geniv/nette-filters | src/FilterLatte.php | FilterLatte.dateDiff | public static function dateDiff(DateTime $from = null, DateTime $to = null, string $format = 'Y-m-d H:i:s'): string
{
if (!$from) {
return '';
}
if (!$to) { // if not define to then to date is set today
$to = new DateTime();
}
return $from->diff($to)->... | php | public static function dateDiff(DateTime $from = null, DateTime $to = null, string $format = 'Y-m-d H:i:s'): string
{
if (!$from) {
return '';
}
if (!$to) { // if not define to then to date is set today
$to = new DateTime();
}
return $from->diff($to)->... | [
"public",
"static",
"function",
"dateDiff",
"(",
"DateTime",
"$",
"from",
"=",
"null",
",",
"DateTime",
"$",
"to",
"=",
"null",
",",
"string",
"$",
"format",
"=",
"'Y-m-d H:i:s'",
")",
":",
"string",
"{",
"if",
"(",
"!",
"$",
"from",
")",
"{",
"retur... | Date diff.
@param DateTime|null $from
@param DateTime|null $to
@param string $format
@return string
@throws \Exception | [
"Date",
"diff",
"."
] | 0e7838d7b9c9be6c3ecf17f54353830b30eecea7 | https://github.com/geniv/nette-filters/blob/0e7838d7b9c9be6c3ecf17f54353830b30eecea7/src/FilterLatte.php#L75-L84 |
235,573 | geniv/nette-filters | src/FilterLatte.php | FilterLatte.googleMapsLink | public static function googleMapsLink(string $query): string
{
$result = $query;
if ($query) {
$result = 'https://www.google.com/maps/search/?api=1&query=' . $query;
}
return $result;
} | php | public static function googleMapsLink(string $query): string
{
$result = $query;
if ($query) {
$result = 'https://www.google.com/maps/search/?api=1&query=' . $query;
}
return $result;
} | [
"public",
"static",
"function",
"googleMapsLink",
"(",
"string",
"$",
"query",
")",
":",
"string",
"{",
"$",
"result",
"=",
"$",
"query",
";",
"if",
"(",
"$",
"query",
")",
"{",
"$",
"result",
"=",
"'https://www.google.com/maps/search/?api=1&query='",
".",
"... | Google maps link.
@see https://developers.google.com/maps/documentation/urls/guide
@param string $query
@return string | [
"Google",
"maps",
"link",
"."
] | 0e7838d7b9c9be6c3ecf17f54353830b30eecea7 | https://github.com/geniv/nette-filters/blob/0e7838d7b9c9be6c3ecf17f54353830b30eecea7/src/FilterLatte.php#L94-L101 |
235,574 | geniv/nette-filters | src/FilterLatte.php | FilterLatte.toUrl | public static function toUrl(string $url, string $scheme = 'http://'): string
{
$http = preg_match('/^http[s]?:\/\//', $url);
return (!$http ? $scheme : '') . $url;
} | php | public static function toUrl(string $url, string $scheme = 'http://'): string
{
$http = preg_match('/^http[s]?:\/\//', $url);
return (!$http ? $scheme : '') . $url;
} | [
"public",
"static",
"function",
"toUrl",
"(",
"string",
"$",
"url",
",",
"string",
"$",
"scheme",
"=",
"'http://'",
")",
":",
"string",
"{",
"$",
"http",
"=",
"preg_match",
"(",
"'/^http[s]?:\\/\\//'",
",",
"$",
"url",
")",
";",
"return",
"(",
"!",
"$"... | To url.
@param string $url
@param string $scheme
@return string | [
"To",
"url",
"."
] | 0e7838d7b9c9be6c3ecf17f54353830b30eecea7 | https://github.com/geniv/nette-filters/blob/0e7838d7b9c9be6c3ecf17f54353830b30eecea7/src/FilterLatte.php#L111-L115 |
235,575 | geniv/nette-filters | src/FilterLatte.php | FilterLatte.realUrl | public static function realUrl(string $value)
{
list($scheme, $url) = explode('//', $value);
$reverse = explode('/', $url);
$arr = [];
foreach ($reverse as $item) {
$arr[] = $item;
if ($item == '..') {
array_pop($arr); // remove 2x from arra... | php | public static function realUrl(string $value)
{
list($scheme, $url) = explode('//', $value);
$reverse = explode('/', $url);
$arr = [];
foreach ($reverse as $item) {
$arr[] = $item;
if ($item == '..') {
array_pop($arr); // remove 2x from arra... | [
"public",
"static",
"function",
"realUrl",
"(",
"string",
"$",
"value",
")",
"{",
"list",
"(",
"$",
"scheme",
",",
"$",
"url",
")",
"=",
"explode",
"(",
"'//'",
",",
"$",
"value",
")",
";",
"$",
"reverse",
"=",
"explode",
"(",
"'/'",
",",
"$",
"u... | Real url.
@param string $value
@return string | [
"Real",
"url",
"."
] | 0e7838d7b9c9be6c3ecf17f54353830b30eecea7 | https://github.com/geniv/nette-filters/blob/0e7838d7b9c9be6c3ecf17f54353830b30eecea7/src/FilterLatte.php#L124-L137 |
235,576 | rollun-com/rollun-permission | src/Permission/src/Authentication/AuthenticationChain.php | AuthenticationChain.authenticate | public function authenticate(ServerRequestInterface $request): ?UserInterface
{
foreach ($this->authenticationServices as $authenticationService) {
$user = $authenticationService->authenticate($request);
if ($user !== null) {
return $user;
}
}
... | php | public function authenticate(ServerRequestInterface $request): ?UserInterface
{
foreach ($this->authenticationServices as $authenticationService) {
$user = $authenticationService->authenticate($request);
if ($user !== null) {
return $user;
}
}
... | [
"public",
"function",
"authenticate",
"(",
"ServerRequestInterface",
"$",
"request",
")",
":",
"?",
"UserInterface",
"{",
"foreach",
"(",
"$",
"this",
"->",
"authenticationServices",
"as",
"$",
"authenticationService",
")",
"{",
"$",
"user",
"=",
"$",
"authentic... | Chain available authentication services and try authenticate using it
If no one authentication service can authenticate return null
Other way return user from first service that can authenticate
Last authentication service provide an unauthorized response if no one can authenticate
@param ServerRequestInterface $reque... | [
"Chain",
"available",
"authentication",
"services",
"and",
"try",
"authenticate",
"using",
"it",
"If",
"no",
"one",
"authentication",
"service",
"can",
"authenticate",
"return",
"null",
"Other",
"way",
"return",
"user",
"from",
"first",
"service",
"that",
"can",
... | 9f58c814337fcfd1e52ecfbf496f95d276d8217e | https://github.com/rollun-com/rollun-permission/blob/9f58c814337fcfd1e52ecfbf496f95d276d8217e/src/Permission/src/Authentication/AuthenticationChain.php#L50-L61 |
235,577 | AnonymPHP/Anonym-Library | src/Anonym/Application/ServiceProvider.php | ServiceProvider.registerProvider | public function registerProvider($provider){
$providers = (array) $provider;
foreach($providers as $provider){
$this->app()['config']->add('general.providers', $provider);
}
} | php | public function registerProvider($provider){
$providers = (array) $provider;
foreach($providers as $provider){
$this->app()['config']->add('general.providers', $provider);
}
} | [
"public",
"function",
"registerProvider",
"(",
"$",
"provider",
")",
"{",
"$",
"providers",
"=",
"(",
"array",
")",
"$",
"provider",
";",
"foreach",
"(",
"$",
"providers",
"as",
"$",
"provider",
")",
"{",
"$",
"this",
"->",
"app",
"(",
")",
"[",
"'co... | You can register your providers with string or array data.
@param array|string $provider
@return $this | [
"You",
"can",
"register",
"your",
"providers",
"with",
"string",
"or",
"array",
"data",
"."
] | c967ad804f84e8fb204593a0959cda2fed5ae075 | https://github.com/AnonymPHP/Anonym-Library/blob/c967ad804f84e8fb204593a0959cda2fed5ae075/src/Anonym/Application/ServiceProvider.php#L108-L114 |
235,578 | marando/phpSOFA | src/Marando/IAU/iauApcs13.php | iauApcs13.Apcs13 | public static function Apcs13($date1, $date2, array $pv, iauASTROM $astrom) {
$ehpv = [];
$ebpv = [];
/* Earth barycentric & heliocentric position/velocity (au, au/d). */
IAU::Epv00($date1, $date2, $ehpv, $ebpv);
/* Compute the star-independent astrometry parameters. */
IAU::Apcs($date1, $date... | php | public static function Apcs13($date1, $date2, array $pv, iauASTROM $astrom) {
$ehpv = [];
$ebpv = [];
/* Earth barycentric & heliocentric position/velocity (au, au/d). */
IAU::Epv00($date1, $date2, $ehpv, $ebpv);
/* Compute the star-independent astrometry parameters. */
IAU::Apcs($date1, $date... | [
"public",
"static",
"function",
"Apcs13",
"(",
"$",
"date1",
",",
"$",
"date2",
",",
"array",
"$",
"pv",
",",
"iauASTROM",
"$",
"astrom",
")",
"{",
"$",
"ehpv",
"=",
"[",
"]",
";",
"$",
"ebpv",
"=",
"[",
"]",
";",
"/* Earth barycentric & heliocentric p... | - - - - - - - - - -
i a u A p c s 1 3
- - - - - - - - - -
For an observer whose geocentric position and velocity are known,
prepare star-independent astrometry parameters for transformations
between ICRS and GCRS. The Earth ephemeris is from SOFA models.
The parameters produced by this function are required in the s... | [
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"i",
"a",
"u",
"A",
"p",
"c",
"s",
"1",
"3",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-"
] | 757fa49fe335ae1210eaa7735473fd4388b13f07 | https://github.com/marando/phpSOFA/blob/757fa49fe335ae1210eaa7735473fd4388b13f07/src/Marando/IAU/iauApcs13.php#L127-L138 |
235,579 | setrun/setrun-component-user | src/services/AuthService.php | AuthService.auth | public function auth(LoginForm $form): User
{
$this->checkFailure();
$user = $this->user->findByUsernameOrEmail($form->username);
if (!$user || !$user->validatePassword($form->password)) {
$this->setFailure();
throw new \DomainException($this->i18n->t('setrun/user', '... | php | public function auth(LoginForm $form): User
{
$this->checkFailure();
$user = $this->user->findByUsernameOrEmail($form->username);
if (!$user || !$user->validatePassword($form->password)) {
$this->setFailure();
throw new \DomainException($this->i18n->t('setrun/user', '... | [
"public",
"function",
"auth",
"(",
"LoginForm",
"$",
"form",
")",
":",
"User",
"{",
"$",
"this",
"->",
"checkFailure",
"(",
")",
";",
"$",
"user",
"=",
"$",
"this",
"->",
"user",
"->",
"findByUsernameOrEmail",
"(",
"$",
"form",
"->",
"username",
")",
... | User auth.
@param LoginForm $form
@return User | [
"User",
"auth",
"."
] | 6aca4c62f099918032b66da1f94d7565694a0735 | https://github.com/setrun/setrun-component-user/blob/6aca4c62f099918032b66da1f94d7565694a0735/src/services/AuthService.php#L57-L73 |
235,580 | setrun/setrun-component-user | src/services/AuthService.php | AuthService.checkFailure | private function checkFailure() : void
{
$failure = (int) $this->session->get('failure', 0);
$time = (int) $this->session->get('failure_time', time());
if ($failure >= static::FAILURE) {
if ($time >= time()) {
throw new \DomainException($this->i18n->t(
... | php | private function checkFailure() : void
{
$failure = (int) $this->session->get('failure', 0);
$time = (int) $this->session->get('failure_time', time());
if ($failure >= static::FAILURE) {
if ($time >= time()) {
throw new \DomainException($this->i18n->t(
... | [
"private",
"function",
"checkFailure",
"(",
")",
":",
"void",
"{",
"$",
"failure",
"=",
"(",
"int",
")",
"$",
"this",
"->",
"session",
"->",
"get",
"(",
"'failure'",
",",
"0",
")",
";",
"$",
"time",
"=",
"(",
"int",
")",
"$",
"this",
"->",
"sessi... | Check for failure of access.
@return void | [
"Check",
"for",
"failure",
"of",
"access",
"."
] | 6aca4c62f099918032b66da1f94d7565694a0735 | https://github.com/setrun/setrun-component-user/blob/6aca4c62f099918032b66da1f94d7565694a0735/src/services/AuthService.php#L79-L93 |
235,581 | setrun/setrun-component-user | src/services/AuthService.php | AuthService.setFailure | private function setFailure() : void
{
$this->session->set('failure', $this->session->get('failure') + 1);
$this->session->set('failure_time', time() + (int) static::FAILURE_TIME);
} | php | private function setFailure() : void
{
$this->session->set('failure', $this->session->get('failure') + 1);
$this->session->set('failure_time', time() + (int) static::FAILURE_TIME);
} | [
"private",
"function",
"setFailure",
"(",
")",
":",
"void",
"{",
"$",
"this",
"->",
"session",
"->",
"set",
"(",
"'failure'",
",",
"$",
"this",
"->",
"session",
"->",
"get",
"(",
"'failure'",
")",
"+",
"1",
")",
";",
"$",
"this",
"->",
"session",
"... | Set a failure.
@return void | [
"Set",
"a",
"failure",
"."
] | 6aca4c62f099918032b66da1f94d7565694a0735 | https://github.com/setrun/setrun-component-user/blob/6aca4c62f099918032b66da1f94d7565694a0735/src/services/AuthService.php#L99-L103 |
235,582 | okaufmann/google-movies-client | src/GoogleMoviesClient/HttpClient/Adapter/AbstractAdapter.php | AbstractAdapter.createApiException | protected function createApiException(Request $request, Response $response)
{
//$errors = json_decode((string) $response->getBody());
return new HttpRequestException(
$response->getCode(),
$response->getBody(),
$request,
$response
);
} | php | protected function createApiException(Request $request, Response $response)
{
//$errors = json_decode((string) $response->getBody());
return new HttpRequestException(
$response->getCode(),
$response->getBody(),
$request,
$response
);
} | [
"protected",
"function",
"createApiException",
"(",
"Request",
"$",
"request",
",",
"Response",
"$",
"response",
")",
"{",
"//$errors = json_decode((string) $response->getBody());",
"return",
"new",
"HttpRequestException",
"(",
"$",
"response",
"->",
"getCode",
"(",
")"... | Create the unified exception to throw.
@param Request $request
@param Response $response
@return HttpRequestException | [
"Create",
"the",
"unified",
"exception",
"to",
"throw",
"."
] | 70ad4d3c640016cf24a0fd45ed8509029a6c02c6 | https://github.com/okaufmann/google-movies-client/blob/70ad4d3c640016cf24a0fd45ed8509029a6c02c6/src/GoogleMoviesClient/HttpClient/Adapter/AbstractAdapter.php#L33-L43 |
235,583 | OpenResourceManager/client-php | src/Client/Account.php | Account.detachFromDuty | public function detachFromDuty($id = null, $identifier = null, $username = null, $duty_id = null, $code = null)
{
$fields = [];
if (!is_null($id)) $fields['id'] = $id;
if (!is_null($identifier)) $fields['identifier'] = $identifier;
if (!is_null($username)) $fields['username'] = $use... | php | public function detachFromDuty($id = null, $identifier = null, $username = null, $duty_id = null, $code = null)
{
$fields = [];
if (!is_null($id)) $fields['id'] = $id;
if (!is_null($identifier)) $fields['identifier'] = $identifier;
if (!is_null($username)) $fields['username'] = $use... | [
"public",
"function",
"detachFromDuty",
"(",
"$",
"id",
"=",
"null",
",",
"$",
"identifier",
"=",
"null",
",",
"$",
"username",
"=",
"null",
",",
"$",
"duty_id",
"=",
"null",
",",
"$",
"code",
"=",
"null",
")",
"{",
"$",
"fields",
"=",
"[",
"]",
... | Detach Account From Duty
Detach this account from a duty. Using either the account ID, identifier, or username with either the duty ID or code.
@param int $id
@param string $identifier
@param string $username
@param int $duty_id
@param string $code
@return \Unirest\Response | [
"Detach",
"Account",
"From",
"Duty"
] | fa468e3425d32f97294fefed77a7f096f3f8cc86 | https://github.com/OpenResourceManager/client-php/blob/fa468e3425d32f97294fefed77a7f096f3f8cc86/src/Client/Account.php#L307-L318 |
235,584 | OpenResourceManager/client-php | src/Client/Account.php | Account.attachToDuty | public function attachToDuty($id = null, $identifier = null, $username = null, $duty_id = null, $code = null)
{
$fields = [];
if (!is_null($id)) $fields['id'] = $id;
if (!is_null($identifier)) $fields['identifier'] = $identifier;
if (!is_null($username)) $fields['username'] = $usern... | php | public function attachToDuty($id = null, $identifier = null, $username = null, $duty_id = null, $code = null)
{
$fields = [];
if (!is_null($id)) $fields['id'] = $id;
if (!is_null($identifier)) $fields['identifier'] = $identifier;
if (!is_null($username)) $fields['username'] = $usern... | [
"public",
"function",
"attachToDuty",
"(",
"$",
"id",
"=",
"null",
",",
"$",
"identifier",
"=",
"null",
",",
"$",
"username",
"=",
"null",
",",
"$",
"duty_id",
"=",
"null",
",",
"$",
"code",
"=",
"null",
")",
"{",
"$",
"fields",
"=",
"[",
"]",
";... | Attach Account To Duty
Attach this account to a duty. Using either the account ID, identifier, or username with either the duty ID or code.
@param int $id
@param string $identifier
@param string $username
@param int $duty_id
@param string $code
@return \Unirest\Response | [
"Attach",
"Account",
"To",
"Duty"
] | fa468e3425d32f97294fefed77a7f096f3f8cc86 | https://github.com/OpenResourceManager/client-php/blob/fa468e3425d32f97294fefed77a7f096f3f8cc86/src/Client/Account.php#L332-L343 |
235,585 | OpenResourceManager/client-php | src/Client/Account.php | Account.detachFromSchool | public function detachFromSchool($id = null, $identifier = null, $username = null, $school_id = null, $code = null)
{
$fields = [];
if (!is_null($id)) $fields['id'] = $id;
if (!is_null($identifier)) $fields['identifier'] = $identifier;
if (!is_null($username)) $fields['username'] = ... | php | public function detachFromSchool($id = null, $identifier = null, $username = null, $school_id = null, $code = null)
{
$fields = [];
if (!is_null($id)) $fields['id'] = $id;
if (!is_null($identifier)) $fields['identifier'] = $identifier;
if (!is_null($username)) $fields['username'] = ... | [
"public",
"function",
"detachFromSchool",
"(",
"$",
"id",
"=",
"null",
",",
"$",
"identifier",
"=",
"null",
",",
"$",
"username",
"=",
"null",
",",
"$",
"school_id",
"=",
"null",
",",
"$",
"code",
"=",
"null",
")",
"{",
"$",
"fields",
"=",
"[",
"]"... | Detach Account From School
Detach this account from a school. Using either the account ID, identifier, or username with either the school ID or code.
@param int $id
@param string $identifier
@param string $username
@param int $school_id
@param string $code
@return \Unirest\Response | [
"Detach",
"Account",
"From",
"School"
] | fa468e3425d32f97294fefed77a7f096f3f8cc86 | https://github.com/OpenResourceManager/client-php/blob/fa468e3425d32f97294fefed77a7f096f3f8cc86/src/Client/Account.php#L357-L368 |
235,586 | OpenResourceManager/client-php | src/Client/Account.php | Account.attachToSchool | public function attachToSchool($id = null, $identifier = null, $username = null, $school_id = null, $code = null)
{
$fields = [];
if (!is_null($id)) $fields['id'] = $id;
if (!is_null($identifier)) $fields['identifier'] = $identifier;
if (!is_null($username)) $fields['username'] = $u... | php | public function attachToSchool($id = null, $identifier = null, $username = null, $school_id = null, $code = null)
{
$fields = [];
if (!is_null($id)) $fields['id'] = $id;
if (!is_null($identifier)) $fields['identifier'] = $identifier;
if (!is_null($username)) $fields['username'] = $u... | [
"public",
"function",
"attachToSchool",
"(",
"$",
"id",
"=",
"null",
",",
"$",
"identifier",
"=",
"null",
",",
"$",
"username",
"=",
"null",
",",
"$",
"school_id",
"=",
"null",
",",
"$",
"code",
"=",
"null",
")",
"{",
"$",
"fields",
"=",
"[",
"]",
... | Attach Account To School
Attach this account to a school. Using either the account ID, identifier, or username with either the school ID or code.
@param int $id
@param string $identifier
@param string $username
@param int $school_id
@param string $code
@return \Unirest\Response | [
"Attach",
"Account",
"To",
"School"
] | fa468e3425d32f97294fefed77a7f096f3f8cc86 | https://github.com/OpenResourceManager/client-php/blob/fa468e3425d32f97294fefed77a7f096f3f8cc86/src/Client/Account.php#L382-L393 |
235,587 | OpenResourceManager/client-php | src/Client/Account.php | Account.detachFromCourse | public function detachFromCourse($id = null, $identifier = null, $username = null, $course_id = null, $code = null)
{
$fields = [];
if (!is_null($id)) $fields['id'] = $id;
if (!is_null($identifier)) $fields['identifier'] = $identifier;
if (!is_null($username)) $fields['username'] = ... | php | public function detachFromCourse($id = null, $identifier = null, $username = null, $course_id = null, $code = null)
{
$fields = [];
if (!is_null($id)) $fields['id'] = $id;
if (!is_null($identifier)) $fields['identifier'] = $identifier;
if (!is_null($username)) $fields['username'] = ... | [
"public",
"function",
"detachFromCourse",
"(",
"$",
"id",
"=",
"null",
",",
"$",
"identifier",
"=",
"null",
",",
"$",
"username",
"=",
"null",
",",
"$",
"course_id",
"=",
"null",
",",
"$",
"code",
"=",
"null",
")",
"{",
"$",
"fields",
"=",
"[",
"]"... | Detach Account From Course
Detach this account from a course. Using either the account ID, identifier, or username with either the course ID or code.
@param int $id
@param string $identifier
@param string $username
@param int $course_id
@param string $code
@return \Unirest\Response | [
"Detach",
"Account",
"From",
"Course"
] | fa468e3425d32f97294fefed77a7f096f3f8cc86 | https://github.com/OpenResourceManager/client-php/blob/fa468e3425d32f97294fefed77a7f096f3f8cc86/src/Client/Account.php#L407-L418 |
235,588 | OpenResourceManager/client-php | src/Client/Account.php | Account.attachToCourse | public function attachToCourse($id = null, $identifier = null, $username = null, $course_id = null, $code = null)
{
$fields = [];
if (!is_null($id)) $fields['id'] = $id;
if (!is_null($identifier)) $fields['identifier'] = $identifier;
if (!is_null($username)) $fields['username'] = $u... | php | public function attachToCourse($id = null, $identifier = null, $username = null, $course_id = null, $code = null)
{
$fields = [];
if (!is_null($id)) $fields['id'] = $id;
if (!is_null($identifier)) $fields['identifier'] = $identifier;
if (!is_null($username)) $fields['username'] = $u... | [
"public",
"function",
"attachToCourse",
"(",
"$",
"id",
"=",
"null",
",",
"$",
"identifier",
"=",
"null",
",",
"$",
"username",
"=",
"null",
",",
"$",
"course_id",
"=",
"null",
",",
"$",
"code",
"=",
"null",
")",
"{",
"$",
"fields",
"=",
"[",
"]",
... | Attach Account To Course
Attach this account to a course. Using either the account ID, identifier, or username with either the course ID or code.
@param int $id
@param string $identifier
@param string $username
@param int $course_id
@param string $code
@return \Unirest\Response | [
"Attach",
"Account",
"To",
"Course"
] | fa468e3425d32f97294fefed77a7f096f3f8cc86 | https://github.com/OpenResourceManager/client-php/blob/fa468e3425d32f97294fefed77a7f096f3f8cc86/src/Client/Account.php#L432-L443 |
235,589 | OpenResourceManager/client-php | src/Client/Account.php | Account.detachFromDepartment | public function detachFromDepartment($id = null, $identifier = null, $username = null, $department_id = null, $code = null)
{
$fields = [];
if (!is_null($id)) $fields['id'] = $id;
if (!is_null($identifier)) $fields['identifier'] = $identifier;
if (!is_null($username)) $fields['usern... | php | public function detachFromDepartment($id = null, $identifier = null, $username = null, $department_id = null, $code = null)
{
$fields = [];
if (!is_null($id)) $fields['id'] = $id;
if (!is_null($identifier)) $fields['identifier'] = $identifier;
if (!is_null($username)) $fields['usern... | [
"public",
"function",
"detachFromDepartment",
"(",
"$",
"id",
"=",
"null",
",",
"$",
"identifier",
"=",
"null",
",",
"$",
"username",
"=",
"null",
",",
"$",
"department_id",
"=",
"null",
",",
"$",
"code",
"=",
"null",
")",
"{",
"$",
"fields",
"=",
"[... | Detach Account From Department
Detach this account from a department. Using either the account ID, identifier, or username with either the department ID or code.
@param int $id
@param string $identifier
@param string $username
@param int $department_id
@param string $code
@return \Unirest\Response | [
"Detach",
"Account",
"From",
"Department"
] | fa468e3425d32f97294fefed77a7f096f3f8cc86 | https://github.com/OpenResourceManager/client-php/blob/fa468e3425d32f97294fefed77a7f096f3f8cc86/src/Client/Account.php#L457-L468 |
235,590 | OpenResourceManager/client-php | src/Client/Account.php | Account.attachToDepartment | public function attachToDepartment($id = null, $identifier = null, $username = null, $department_id = null, $code = null)
{
$fields = [];
if (!is_null($id)) $fields['id'] = $id;
if (!is_null($identifier)) $fields['identifier'] = $identifier;
if (!is_null($username)) $fields['usernam... | php | public function attachToDepartment($id = null, $identifier = null, $username = null, $department_id = null, $code = null)
{
$fields = [];
if (!is_null($id)) $fields['id'] = $id;
if (!is_null($identifier)) $fields['identifier'] = $identifier;
if (!is_null($username)) $fields['usernam... | [
"public",
"function",
"attachToDepartment",
"(",
"$",
"id",
"=",
"null",
",",
"$",
"identifier",
"=",
"null",
",",
"$",
"username",
"=",
"null",
",",
"$",
"department_id",
"=",
"null",
",",
"$",
"code",
"=",
"null",
")",
"{",
"$",
"fields",
"=",
"[",... | Attach Account To Department
Attach this account to a department. Using either the account ID, identifier, or username with either the department ID or code.
@param int $id
@param string $identifier
@param string $username
@param int $department_id
@param string $code
@return \Unirest\Response | [
"Attach",
"Account",
"To",
"Department"
] | fa468e3425d32f97294fefed77a7f096f3f8cc86 | https://github.com/OpenResourceManager/client-php/blob/fa468e3425d32f97294fefed77a7f096f3f8cc86/src/Client/Account.php#L482-L493 |
235,591 | OpenResourceManager/client-php | src/Client/Account.php | Account.detachFromRoom | public function detachFromRoom($id = null, $identifier = null, $username = null, $room_id = null, $code = null)
{
$fields = [];
if (!is_null($id)) $fields['id'] = $id;
if (!is_null($identifier)) $fields['identifier'] = $identifier;
if (!is_null($username)) $fields['username'] = $use... | php | public function detachFromRoom($id = null, $identifier = null, $username = null, $room_id = null, $code = null)
{
$fields = [];
if (!is_null($id)) $fields['id'] = $id;
if (!is_null($identifier)) $fields['identifier'] = $identifier;
if (!is_null($username)) $fields['username'] = $use... | [
"public",
"function",
"detachFromRoom",
"(",
"$",
"id",
"=",
"null",
",",
"$",
"identifier",
"=",
"null",
",",
"$",
"username",
"=",
"null",
",",
"$",
"room_id",
"=",
"null",
",",
"$",
"code",
"=",
"null",
")",
"{",
"$",
"fields",
"=",
"[",
"]",
... | Detach Account From Room
Detach this account from a room. Using either the account ID, identifier, or username with either the room ID or code.
@param int $id
@param string $identifier
@param string $username
@param int $room_id
@param string $code
@return \Unirest\Response | [
"Detach",
"Account",
"From",
"Room"
] | fa468e3425d32f97294fefed77a7f096f3f8cc86 | https://github.com/OpenResourceManager/client-php/blob/fa468e3425d32f97294fefed77a7f096f3f8cc86/src/Client/Account.php#L507-L518 |
235,592 | OpenResourceManager/client-php | src/Client/Account.php | Account.attachToRoom | public function attachToRoom($id = null, $identifier = null, $username = null, $room_id = null, $code = null)
{
$fields = [];
if (!is_null($id)) $fields['id'] = $id;
if (!is_null($identifier)) $fields['identifier'] = $identifier;
if (!is_null($username)) $fields['username'] = $usern... | php | public function attachToRoom($id = null, $identifier = null, $username = null, $room_id = null, $code = null)
{
$fields = [];
if (!is_null($id)) $fields['id'] = $id;
if (!is_null($identifier)) $fields['identifier'] = $identifier;
if (!is_null($username)) $fields['username'] = $usern... | [
"public",
"function",
"attachToRoom",
"(",
"$",
"id",
"=",
"null",
",",
"$",
"identifier",
"=",
"null",
",",
"$",
"username",
"=",
"null",
",",
"$",
"room_id",
"=",
"null",
",",
"$",
"code",
"=",
"null",
")",
"{",
"$",
"fields",
"=",
"[",
"]",
";... | Attach Account To Room
Attach this account to a room. Using either the account ID, identifier, or username with either the room ID or code.
@param int $id
@param string $identifier
@param string $username
@param int $room_id
@param string $code
@return \Unirest\Response | [
"Attach",
"Account",
"To",
"Room"
] | fa468e3425d32f97294fefed77a7f096f3f8cc86 | https://github.com/OpenResourceManager/client-php/blob/fa468e3425d32f97294fefed77a7f096f3f8cc86/src/Client/Account.php#L532-L543 |
235,593 | wasabi-cms/core | src/Controller/BackendAppController.php | BackendAppController._allow | protected function _allow()
{
$url = Wasabi::getCurrentUrlArray();
if ($this->Guardian->isGuestAction($url)) {
$this->Auth->allow($this->request->params['action']);
}
} | php | protected function _allow()
{
$url = Wasabi::getCurrentUrlArray();
if ($this->Guardian->isGuestAction($url)) {
$this->Auth->allow($this->request->params['action']);
}
} | [
"protected",
"function",
"_allow",
"(",
")",
"{",
"$",
"url",
"=",
"Wasabi",
"::",
"getCurrentUrlArray",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"Guardian",
"->",
"isGuestAction",
"(",
"$",
"url",
")",
")",
"{",
"$",
"this",
"->",
"Auth",
"->",
... | Allow all guest actions.
@return void | [
"Allow",
"all",
"guest",
"actions",
"."
] | 0eadbb64d2fc201bacc63c93814adeca70e08f90 | https://github.com/wasabi-cms/core/blob/0eadbb64d2fc201bacc63c93814adeca70e08f90/src/Controller/BackendAppController.php#L198-L204 |
235,594 | covex-nn/vfs | src/Partition.php | Partition.getList | public function getList(string $path)
{
$entity = $this->getEntity($path);
if (null !== $entity && $entity->file_exists() && $entity->is_dir()) {
$files = [];
$changes = $this->getChanges();
$own = $changes->own($path);
if (!($entity instanceof Virtu... | php | public function getList(string $path)
{
$entity = $this->getEntity($path);
if (null !== $entity && $entity->file_exists() && $entity->is_dir()) {
$files = [];
$changes = $this->getChanges();
$own = $changes->own($path);
if (!($entity instanceof Virtu... | [
"public",
"function",
"getList",
"(",
"string",
"$",
"path",
")",
"{",
"$",
"entity",
"=",
"$",
"this",
"->",
"getEntity",
"(",
"$",
"path",
")",
";",
"if",
"(",
"null",
"!==",
"$",
"entity",
"&&",
"$",
"entity",
"->",
"file_exists",
"(",
")",
"&&"... | Get list of files inside directory path.
@return EntityInterface[]|null | [
"Get",
"list",
"of",
"files",
"inside",
"directory",
"path",
"."
] | 77ee7406ab32508c4671adf1153dc5b67bdab599 | https://github.com/covex-nn/vfs/blob/77ee7406ab32508c4671adf1153dc5b67bdab599/src/Partition.php#L145-L194 |
235,595 | covex-nn/vfs | src/Partition.php | Partition.tempnam | public function tempnam(): string
{
$root = $this->getFsRoot();
do {
++$this->fsCounter;
$name = $root.'/'.$this->fsCounter;
} while (file_exists($name));
return $name;
} | php | public function tempnam(): string
{
$root = $this->getFsRoot();
do {
++$this->fsCounter;
$name = $root.'/'.$this->fsCounter;
} while (file_exists($name));
return $name;
} | [
"public",
"function",
"tempnam",
"(",
")",
":",
"string",
"{",
"$",
"root",
"=",
"$",
"this",
"->",
"getFsRoot",
"(",
")",
";",
"do",
"{",
"++",
"$",
"this",
"->",
"fsCounter",
";",
"$",
"name",
"=",
"$",
"root",
".",
"'/'",
".",
"$",
"this",
"... | Get unique filename. | [
"Get",
"unique",
"filename",
"."
] | 77ee7406ab32508c4671adf1153dc5b67bdab599 | https://github.com/covex-nn/vfs/blob/77ee7406ab32508c4671adf1153dc5b67bdab599/src/Partition.php#L384-L393 |
235,596 | covex-nn/vfs | src/Partition.php | Partition.commit | public function commit(): void
{
if (null !== $this->changes) {
$this->commitInternal($this->changes);
$this->changes = null;
}
} | php | public function commit(): void
{
if (null !== $this->changes) {
$this->commitInternal($this->changes);
$this->changes = null;
}
} | [
"public",
"function",
"commit",
"(",
")",
":",
"void",
"{",
"if",
"(",
"null",
"!==",
"$",
"this",
"->",
"changes",
")",
"{",
"$",
"this",
"->",
"commitInternal",
"(",
"$",
"this",
"->",
"changes",
")",
";",
"$",
"this",
"->",
"changes",
"=",
"null... | Commit changes to real FS. | [
"Commit",
"changes",
"to",
"real",
"FS",
"."
] | 77ee7406ab32508c4671adf1153dc5b67bdab599 | https://github.com/covex-nn/vfs/blob/77ee7406ab32508c4671adf1153dc5b67bdab599/src/Partition.php#L457-L464 |
235,597 | covex-nn/vfs | src/Partition.php | Partition.setRoot | protected function setRoot(EntityInterface $entity): void
{
if (!$entity->file_exists() || !$entity->is_dir()) {
throw new Exception('Root directory is not valid');
}
$this->root = $entity;
} | php | protected function setRoot(EntityInterface $entity): void
{
if (!$entity->file_exists() || !$entity->is_dir()) {
throw new Exception('Root directory is not valid');
}
$this->root = $entity;
} | [
"protected",
"function",
"setRoot",
"(",
"EntityInterface",
"$",
"entity",
")",
":",
"void",
"{",
"if",
"(",
"!",
"$",
"entity",
"->",
"file_exists",
"(",
")",
"||",
"!",
"$",
"entity",
"->",
"is_dir",
"(",
")",
")",
"{",
"throw",
"new",
"Exception",
... | Init root. | [
"Init",
"root",
"."
] | 77ee7406ab32508c4671adf1153dc5b67bdab599 | https://github.com/covex-nn/vfs/blob/77ee7406ab32508c4671adf1153dc5b67bdab599/src/Partition.php#L469-L476 |
235,598 | covex-nn/vfs | src/Partition.php | Partition.getChanges | protected function getChanges(): Changes
{
if (null === $this->changes) {
$this->changes = new Changes();
}
return $this->changes;
} | php | protected function getChanges(): Changes
{
if (null === $this->changes) {
$this->changes = new Changes();
}
return $this->changes;
} | [
"protected",
"function",
"getChanges",
"(",
")",
":",
"Changes",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"changes",
")",
"{",
"$",
"this",
"->",
"changes",
"=",
"new",
"Changes",
"(",
")",
";",
"}",
"return",
"$",
"this",
"->",
"changes",
... | Get FS-changes object. | [
"Get",
"FS",
"-",
"changes",
"object",
"."
] | 77ee7406ab32508c4671adf1153dc5b67bdab599 | https://github.com/covex-nn/vfs/blob/77ee7406ab32508c4671adf1153dc5b67bdab599/src/Partition.php#L481-L488 |
235,599 | covex-nn/vfs | src/Partition.php | Partition.commitInternal | private function commitInternal(Changes $changes, string $path = ''): void
{
$root = $this->getRoot();
$rootpath = $root->path();
if ($path) {
$path .= '/';
}
$own = $changes->own();
foreach ($own as $filename => $vEntity) {
$filepath = $path... | php | private function commitInternal(Changes $changes, string $path = ''): void
{
$root = $this->getRoot();
$rootpath = $root->path();
if ($path) {
$path .= '/';
}
$own = $changes->own();
foreach ($own as $filename => $vEntity) {
$filepath = $path... | [
"private",
"function",
"commitInternal",
"(",
"Changes",
"$",
"changes",
",",
"string",
"$",
"path",
"=",
"''",
")",
":",
"void",
"{",
"$",
"root",
"=",
"$",
"this",
"->",
"getRoot",
"(",
")",
";",
"$",
"rootpath",
"=",
"$",
"root",
"->",
"path",
"... | Commit changes into real FS.
Если удалено и не существовало с самого начала
- ничего не делаем
Иначе если когда-то не существовало
- удаляем всё RДерево
- Если сейчас существует, то
- переносим всё VДерево
Иначе если это файл, то
- удаляем RФайл
- копируем VФайл на место RФайла
По всем subtree
- сделать тоже самое, е... | [
"Commit",
"changes",
"into",
"real",
"FS",
"."
] | 77ee7406ab32508c4671adf1153dc5b67bdab599 | https://github.com/covex-nn/vfs/blob/77ee7406ab32508c4671adf1153dc5b67bdab599/src/Partition.php#L506-L558 |
Subsets and Splits
Yii Code Samples
Gathers all records from test, train, and validation sets that contain the word 'yii', providing a basic filtered view of the dataset relevant to Yii-related content.