repository_name stringlengths 5 67 | func_path_in_repository stringlengths 4 234 | func_name stringlengths 0 314 | whole_func_string stringlengths 52 3.87M | language stringclasses 6
values | func_code_string stringlengths 52 3.87M | func_code_tokens listlengths 15 672k | func_documentation_string stringlengths 1 47.2k | func_documentation_tokens listlengths 1 3.92k | split_name stringclasses 1
value | func_code_url stringlengths 85 339 |
|---|---|---|---|---|---|---|---|---|---|---|
heidelpay/PhpDoc | src/phpDocumentor/Plugin/Core/Transformer/Writer/Xml/TraitConverter.php | TraitConverter.convert | public function convert(\DOMElement $parent, TraitDescriptor $trait)
{
$child = new \DOMElement('trait');
$parent->appendChild($child);
$namespace = $trait->getNamespace()->getFullyQualifiedStructuralElementName();
$child->setAttribute('namespace', ltrim($namespace, '\\'));
... | php | public function convert(\DOMElement $parent, TraitDescriptor $trait)
{
$child = new \DOMElement('trait');
$parent->appendChild($child);
$namespace = $trait->getNamespace()->getFullyQualifiedStructuralElementName();
$child->setAttribute('namespace', ltrim($namespace, '\\'));
... | [
"public",
"function",
"convert",
"(",
"\\",
"DOMElement",
"$",
"parent",
",",
"TraitDescriptor",
"$",
"trait",
")",
"{",
"$",
"child",
"=",
"new",
"\\",
"DOMElement",
"(",
"'trait'",
")",
";",
"$",
"parent",
"->",
"appendChild",
"(",
"$",
"child",
")",
... | Export the given reflected Trait definition to the provided parent element.
This method creates a new child element on the given parent XML element
and takes the properties of the Reflection argument and sets the
elements and attributes on the child.
If a child DOMElement is provided then the properties and attribute... | [
"Export",
"the",
"given",
"reflected",
"Trait",
"definition",
"to",
"the",
"provided",
"parent",
"element",
"."
] | train | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Plugin/Core/Transformer/Writer/Xml/TraitConverter.php#L66-L89 |
zhouyl/mellivora | Mellivora/View/Compilers/BladeCompiler.php | BladeCompiler.compile | public function compile($path = null)
{
if ($path) {
$this->setPath($path);
}
if (!is_null($this->cachePath)) {
if (!is_file($path)) {
throw new \RuntimeException("File does not exist at path {$path}");
}
file_put_contents(
... | php | public function compile($path = null)
{
if ($path) {
$this->setPath($path);
}
if (!is_null($this->cachePath)) {
if (!is_file($path)) {
throw new \RuntimeException("File does not exist at path {$path}");
}
file_put_contents(
... | [
"public",
"function",
"compile",
"(",
"$",
"path",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"path",
")",
"{",
"$",
"this",
"->",
"setPath",
"(",
"$",
"path",
")",
";",
"}",
"if",
"(",
"!",
"is_null",
"(",
"$",
"this",
"->",
"cachePath",
")",
")",... | Compile the view at the given path.
@param string $path
@return void | [
"Compile",
"the",
"view",
"at",
"the",
"given",
"path",
"."
] | train | https://github.com/zhouyl/mellivora/blob/79f844c5c9c25ffbe18d142062e9bc3df00b36a1/Mellivora/View/Compilers/BladeCompiler.php#L114-L130 |
ekuiter/feature-php | FeaturePhp/Specification/ChunkSpecification.php | ChunkSpecification.fromArrayAndSettings | public static function fromArrayAndSettings($cfg, $settings, $artifact = null) {
$chunkSpecification = new static($cfg, $settings->getDirectory());
$chunkSpecification->set("source", null);
$chunkSpecification->set("target", fphp\Helper\Path::join(
$settings->getOptional("target", nu... | php | public static function fromArrayAndSettings($cfg, $settings, $artifact = null) {
$chunkSpecification = new static($cfg, $settings->getDirectory());
$chunkSpecification->set("source", null);
$chunkSpecification->set("target", fphp\Helper\Path::join(
$settings->getOptional("target", nu... | [
"public",
"static",
"function",
"fromArrayAndSettings",
"(",
"$",
"cfg",
",",
"$",
"settings",
",",
"$",
"artifact",
"=",
"null",
")",
"{",
"$",
"chunkSpecification",
"=",
"new",
"static",
"(",
"$",
"cfg",
",",
"$",
"settings",
"->",
"getDirectory",
"(",
... | Creates a chunk specification from a plain settings array.
The settings context is taken into consideration to generate paths
relative to the settings.
@param array $cfg a plain settings array
@param \FeaturePhp\Settings $settings the settings context
@param \FeaturePhp\Artifact\Artifact $artifact is ignored
@return Ch... | [
"Creates",
"a",
"chunk",
"specification",
"from",
"a",
"plain",
"settings",
"array",
".",
"The",
"settings",
"context",
"is",
"taken",
"into",
"consideration",
"to",
"generate",
"paths",
"relative",
"to",
"the",
"settings",
"."
] | train | https://github.com/ekuiter/feature-php/blob/daf4a59098802fedcfd1f1a1d07847fcf2fea7bf/FeaturePhp/Specification/ChunkSpecification.php#L57-L63 |
OKTOTV/OktolabMediaBundle | Model/SpriteService.php | SpriteService.getSpriteWebvttForEpisode | public function getSpriteWebvttForEpisode($episode, $player_type = "jwplayer")
{
$this->calculateInterval($episode);
switch ($player_type) {
case 'jwplayer':
return $this->getSpriteWebvttForJwPlayer($episode);
break;
default:
r... | php | public function getSpriteWebvttForEpisode($episode, $player_type = "jwplayer")
{
$this->calculateInterval($episode);
switch ($player_type) {
case 'jwplayer':
return $this->getSpriteWebvttForJwPlayer($episode);
break;
default:
r... | [
"public",
"function",
"getSpriteWebvttForEpisode",
"(",
"$",
"episode",
",",
"$",
"player_type",
"=",
"\"jwplayer\"",
")",
"{",
"$",
"this",
"->",
"calculateInterval",
"(",
"$",
"episode",
")",
";",
"switch",
"(",
"$",
"player_type",
")",
"{",
"case",
"'jwpl... | returns webvtt formated string for webplayers to display thumbnails | [
"returns",
"webvtt",
"formated",
"string",
"for",
"webplayers",
"to",
"display",
"thumbnails"
] | train | https://github.com/OKTOTV/OktolabMediaBundle/blob/f9c1eac4f6b19d2ab25288b301dd0d9350478bb3/Model/SpriteService.php#L23-L35 |
OKTOTV/OktolabMediaBundle | Model/SpriteService.php | SpriteService.calculateInterval | private function calculateInterval($episode)
{
$max_image = floor(65500/$this->sprite_height);
$calculated_interval = ceil($episode->getDuration()/$max_image);
if ($calculated_interval > $this->sprite_interval) {
$this->sprite_interval = $calculated_interval;
}
} | php | private function calculateInterval($episode)
{
$max_image = floor(65500/$this->sprite_height);
$calculated_interval = ceil($episode->getDuration()/$max_image);
if ($calculated_interval > $this->sprite_interval) {
$this->sprite_interval = $calculated_interval;
}
} | [
"private",
"function",
"calculateInterval",
"(",
"$",
"episode",
")",
"{",
"$",
"max_image",
"=",
"floor",
"(",
"65500",
"/",
"$",
"this",
"->",
"sprite_height",
")",
";",
"$",
"calculated_interval",
"=",
"ceil",
"(",
"$",
"episode",
"->",
"getDuration",
"... | calculates the interval time for the length of an episode and considers jpeg dimension limit of 65500 px. | [
"calculates",
"the",
"interval",
"time",
"for",
"the",
"length",
"of",
"an",
"episode",
"and",
"considers",
"jpeg",
"dimension",
"limit",
"of",
"65500",
"px",
"."
] | train | https://github.com/OKTOTV/OktolabMediaBundle/blob/f9c1eac4f6b19d2ab25288b301dd0d9350478bb3/Model/SpriteService.php#L66-L73 |
eghojansu/moe | src/tools/Markdown.php | Markdown._a | protected function _a($str) {
$self=$this;
return preg_replace_callback(
'/(?<!\\\\)\[(.+?)(?!\\\\)\]\h*\(<?(.*?)>?(?:\h*"(.*?)"\h*)?\)/',
function($expr) use($self) {
return '<a href="'.$self->esc($expr[2]).'"'.
(empty($expr[3])?
'':
(' title="'.$self->esc($expr[3]).'"')).
'>'.$self... | php | protected function _a($str) {
$self=$this;
return preg_replace_callback(
'/(?<!\\\\)\[(.+?)(?!\\\\)\]\h*\(<?(.*?)>?(?:\h*"(.*?)"\h*)?\)/',
function($expr) use($self) {
return '<a href="'.$self->esc($expr[2]).'"'.
(empty($expr[3])?
'':
(' title="'.$self->esc($expr[3]).'"')).
'>'.$self... | [
"protected",
"function",
"_a",
"(",
"$",
"str",
")",
"{",
"$",
"self",
"=",
"$",
"this",
";",
"return",
"preg_replace_callback",
"(",
"'/(?<!\\\\\\\\)\\[(.+?)(?!\\\\\\\\)\\]\\h*\\(<?(.*?)>?(?:\\h*\"(.*?)\"\\h*)?\\)/'",
",",
"function",
"(",
"$",
"expr",
")",
"use",
... | Process anchor span
@return string
@param $str string | [
"Process",
"anchor",
"span"
] | train | https://github.com/eghojansu/moe/blob/f58ec75a3116d1a572782256e2b38bb9aab95e3c/src/tools/Markdown.php#L356-L369 |
eghojansu/moe | src/tools/Markdown.php | Markdown._auto | protected function _auto($str) {
$self=$this;
return preg_replace_callback(
'/`.*?<(.+?)>.*?`|<(.+?)>/',
function($expr) use($self) {
if (empty($expr[1]) && parse_url($expr[2],PHP_URL_SCHEME)) {
$expr[2]=$self->esc($expr[2]);
return '<a href="'.$expr[2].'">'.$expr[2].'</a>';
}
return $ex... | php | protected function _auto($str) {
$self=$this;
return preg_replace_callback(
'/`.*?<(.+?)>.*?`|<(.+?)>/',
function($expr) use($self) {
if (empty($expr[1]) && parse_url($expr[2],PHP_URL_SCHEME)) {
$expr[2]=$self->esc($expr[2]);
return '<a href="'.$expr[2].'">'.$expr[2].'</a>';
}
return $ex... | [
"protected",
"function",
"_auto",
"(",
"$",
"str",
")",
"{",
"$",
"self",
"=",
"$",
"this",
";",
"return",
"preg_replace_callback",
"(",
"'/`.*?<(.+?)>.*?`|<(.+?)>/'",
",",
"function",
"(",
"$",
"expr",
")",
"use",
"(",
"$",
"self",
")",
"{",
"if",
"(",
... | Auto-convert links
@return string
@param $str string | [
"Auto",
"-",
"convert",
"links"
] | train | https://github.com/eghojansu/moe/blob/f58ec75a3116d1a572782256e2b38bb9aab95e3c/src/tools/Markdown.php#L376-L389 |
eghojansu/moe | src/tools/Markdown.php | Markdown._code | protected function _code($str) {
$self=$this;
return preg_replace_callback(
'/`` (.+?) ``|(?<!\\\\)`(.+?)(?!\\\\)`/',
function($expr) use($self) {
return '<code>'.
$self->esc(empty($expr[1])?$expr[2]:$expr[1]).'</code>';
},
$str
);
} | php | protected function _code($str) {
$self=$this;
return preg_replace_callback(
'/`` (.+?) ``|(?<!\\\\)`(.+?)(?!\\\\)`/',
function($expr) use($self) {
return '<code>'.
$self->esc(empty($expr[1])?$expr[2]:$expr[1]).'</code>';
},
$str
);
} | [
"protected",
"function",
"_code",
"(",
"$",
"str",
")",
"{",
"$",
"self",
"=",
"$",
"this",
";",
"return",
"preg_replace_callback",
"(",
"'/`` (.+?) ``|(?<!\\\\\\\\)`(.+?)(?!\\\\\\\\)`/'",
",",
"function",
"(",
"$",
"expr",
")",
"use",
"(",
"$",
"self",
")",
... | Process code span
@return string
@param $str string | [
"Process",
"code",
"span"
] | train | https://github.com/eghojansu/moe/blob/f58ec75a3116d1a572782256e2b38bb9aab95e3c/src/tools/Markdown.php#L396-L406 |
eghojansu/moe | src/tools/Markdown.php | Markdown.esc | function esc($str) {
if (!$this->special)
$this->special=array(
'...'=>'…',
'(tm)'=>'™',
'(r)'=>'®',
'(c)'=>'©'
);
foreach ($this->special as $key=>$val)
$str=preg_replace('/'.preg_quote($key,'/').'/i',$val,$str);
return htmlspecialchars($str,ENT_COMPAT,
Base::ins... | php | function esc($str) {
if (!$this->special)
$this->special=array(
'...'=>'…',
'(tm)'=>'™',
'(r)'=>'®',
'(c)'=>'©'
);
foreach ($this->special as $key=>$val)
$str=preg_replace('/'.preg_quote($key,'/').'/i',$val,$str);
return htmlspecialchars($str,ENT_COMPAT,
Base::ins... | [
"function",
"esc",
"(",
"$",
"str",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"special",
")",
"$",
"this",
"->",
"special",
"=",
"array",
"(",
"'...'",
"=>",
"'…'",
",",
"'(tm)'",
"=>",
"'™'",
",",
"'(r)'",
"=>",
"'®'",
",",
"'(... | Convert characters to HTML entities
@return string
@param $str string | [
"Convert",
"characters",
"to",
"HTML",
"entities"
] | train | https://github.com/eghojansu/moe/blob/f58ec75a3116d1a572782256e2b38bb9aab95e3c/src/tools/Markdown.php#L413-L425 |
old-town/workflow-designer-server | src/View/ApiProblemInjectResponse.php | ApiProblemInjectResponse.attach | public function attach(EventManagerInterface $events, $priority = 1)
{
$this->listeners[] = $events->attach(ViewEvent::EVENT_RESPONSE, [$this, 'injectResponse'], $priority);
} | php | public function attach(EventManagerInterface $events, $priority = 1)
{
$this->listeners[] = $events->attach(ViewEvent::EVENT_RESPONSE, [$this, 'injectResponse'], $priority);
} | [
"public",
"function",
"attach",
"(",
"EventManagerInterface",
"$",
"events",
",",
"$",
"priority",
"=",
"1",
")",
"{",
"$",
"this",
"->",
"listeners",
"[",
"]",
"=",
"$",
"events",
"->",
"attach",
"(",
"ViewEvent",
"::",
"EVENT_RESPONSE",
",",
"[",
"$",
... | {@inheritDoc} | [
"{"
] | train | https://github.com/old-town/workflow-designer-server/blob/6389c5a515861cc8e0b769f1ca7be12c6b78c611/src/View/ApiProblemInjectResponse.php#L29-L32 |
old-town/workflow-designer-server | src/View/ApiProblemInjectResponse.php | ApiProblemInjectResponse.injectResponse | public function injectResponse(ViewEvent $e)
{
$model = $e->getModel();
if (!$model instanceof ApiProblemModel) {
// Model is not an ApiProblemModel; we cannot handle it here
return null;
}
/** @var Request $request */
$request = $e->getRequest();
... | php | public function injectResponse(ViewEvent $e)
{
$model = $e->getModel();
if (!$model instanceof ApiProblemModel) {
// Model is not an ApiProblemModel; we cannot handle it here
return null;
}
/** @var Request $request */
$request = $e->getRequest();
... | [
"public",
"function",
"injectResponse",
"(",
"ViewEvent",
"$",
"e",
")",
"{",
"$",
"model",
"=",
"$",
"e",
"->",
"getModel",
"(",
")",
";",
"if",
"(",
"!",
"$",
"model",
"instanceof",
"ApiProblemModel",
")",
"{",
"// Model is not an ApiProblemModel; we cannot ... | @param ViewEvent $e
@return null
@throws \Zend\Config\Exception\RuntimeException
@throws \Zend\Http\Exception\InvalidArgumentException | [
"@param",
"ViewEvent",
"$e"
] | train | https://github.com/old-town/workflow-designer-server/blob/6389c5a515861cc8e0b769f1ca7be12c6b78c611/src/View/ApiProblemInjectResponse.php#L42-L77 |
old-town/workflow-designer-server | src/View/ApiProblemInjectResponse.php | ApiProblemInjectResponse.getStatusCodeFromApiProblem | protected function getStatusCodeFromApiProblem(ApiProblem $problem)
{
$problemData = $problem->toArray();
$status = array_key_exists('status', $problemData) ? $problemData['status'] : 0;
if ($status < 100 || $status >= 600) {
return 500;
}
return $status;
} | php | protected function getStatusCodeFromApiProblem(ApiProblem $problem)
{
$problemData = $problem->toArray();
$status = array_key_exists('status', $problemData) ? $problemData['status'] : 0;
if ($status < 100 || $status >= 600) {
return 500;
}
return $status;
} | [
"protected",
"function",
"getStatusCodeFromApiProblem",
"(",
"ApiProblem",
"$",
"problem",
")",
"{",
"$",
"problemData",
"=",
"$",
"problem",
"->",
"toArray",
"(",
")",
";",
"$",
"status",
"=",
"array_key_exists",
"(",
"'status'",
",",
"$",
"problemData",
")",... | Retrieve the HTTP status from an ApiProblem object
Ensures that the status falls within the acceptable range (100 - 599).
@param ApiProblem $problem
@return int | [
"Retrieve",
"the",
"HTTP",
"status",
"from",
"an",
"ApiProblem",
"object"
] | train | https://github.com/old-town/workflow-designer-server/blob/6389c5a515861cc8e0b769f1ca7be12c6b78c611/src/View/ApiProblemInjectResponse.php#L87-L97 |
arndtteunissen/column-layout | Classes/Utility/ColumnLayoutUtility.php | ColumnLayoutUtility.getSizesFor | public static function getSizesFor(string $size, string $type, int $pageUid): array
{
$settings = ColumnLayoutUtility::getColumnLayoutSettings($pageUid);
if (!array_key_exists($size . '.', $settings['sizes.'])) {
throw new Exception(sprintf('The given size "%s" is not defined in the gri... | php | public static function getSizesFor(string $size, string $type, int $pageUid): array
{
$settings = ColumnLayoutUtility::getColumnLayoutSettings($pageUid);
if (!array_key_exists($size . '.', $settings['sizes.'])) {
throw new Exception(sprintf('The given size "%s" is not defined in the gri... | [
"public",
"static",
"function",
"getSizesFor",
"(",
"string",
"$",
"size",
",",
"string",
"$",
"type",
",",
"int",
"$",
"pageUid",
")",
":",
"array",
"{",
"$",
"settings",
"=",
"ColumnLayoutUtility",
"::",
"getColumnLayoutSettings",
"(",
"$",
"pageUid",
")",... | Calculates the column sizes for the given size and the given size type
@param string $size name of the sizes identifier (e.g. large, medium)
@param string $type size type (e.g. columns, offset, order)
@param int $pageUid the page which's TSConfig should be used
@return array of column sizes
@throws Exception when the ... | [
"Calculates",
"the",
"column",
"sizes",
"for",
"the",
"given",
"size",
"and",
"the",
"given",
"size",
"type"
] | train | https://github.com/arndtteunissen/column-layout/blob/ad737068eef3b084d4d0e3a48e6a3d8277af9560/Classes/Utility/ColumnLayoutUtility.php#L31-L44 |
arndtteunissen/column-layout | Classes/Utility/ColumnLayoutUtility.php | ColumnLayoutUtility.processColumnSizes | protected static function processColumnSizes(string $values, int $maxColumns)
{
$columns = [];
if ($values == '*') {
$columns = range(0, $maxColumns);
} else {
$values = explode(',', $values);
foreach ($values as $value) {
if (strpos($valu... | php | protected static function processColumnSizes(string $values, int $maxColumns)
{
$columns = [];
if ($values == '*') {
$columns = range(0, $maxColumns);
} else {
$values = explode(',', $values);
foreach ($values as $value) {
if (strpos($valu... | [
"protected",
"static",
"function",
"processColumnSizes",
"(",
"string",
"$",
"values",
",",
"int",
"$",
"maxColumns",
")",
"{",
"$",
"columns",
"=",
"[",
"]",
";",
"if",
"(",
"$",
"values",
"==",
"'*'",
")",
"{",
"$",
"columns",
"=",
"range",
"(",
"0... | Processes values of size types (e.g. columns, offset, order) and generates an array of column sizes for that type.
@param string $values
@param int $maxColumns
@return array | [
"Processes",
"values",
"of",
"size",
"types",
"(",
"e",
".",
"g",
".",
"columns",
"offset",
"order",
")",
"and",
"generates",
"an",
"array",
"of",
"column",
"sizes",
"for",
"that",
"type",
"."
] | train | https://github.com/arndtteunissen/column-layout/blob/ad737068eef3b084d4d0e3a48e6a3d8277af9560/Classes/Utility/ColumnLayoutUtility.php#L53-L72 |
arndtteunissen/column-layout | Classes/Utility/ColumnLayoutUtility.php | ColumnLayoutUtility.getColumnLayoutSettings | public static function getColumnLayoutSettings(int $page): array
{
$pageTSConfig = BackendUtility::getPagesTSconfig($page);
if (!array_key_exists('column_layout.', $pageTSConfig['mod.'])) {
throw new Exception(sprintf('No column layout found for page "%d". Please define the column_layou... | php | public static function getColumnLayoutSettings(int $page): array
{
$pageTSConfig = BackendUtility::getPagesTSconfig($page);
if (!array_key_exists('column_layout.', $pageTSConfig['mod.'])) {
throw new Exception(sprintf('No column layout found for page "%d". Please define the column_layou... | [
"public",
"static",
"function",
"getColumnLayoutSettings",
"(",
"int",
"$",
"page",
")",
":",
"array",
"{",
"$",
"pageTSConfig",
"=",
"BackendUtility",
"::",
"getPagesTSconfig",
"(",
"$",
"page",
")",
";",
"if",
"(",
"!",
"array_key_exists",
"(",
"'column_layo... | Returns the column layout configuration from page TSConfig.
@param int $page uid of the page
@return array column layout settings
@throws Exception when the column_layout setting hasn't been defined | [
"Returns",
"the",
"column",
"layout",
"configuration",
"from",
"page",
"TSConfig",
"."
] | train | https://github.com/arndtteunissen/column-layout/blob/ad737068eef3b084d4d0e3a48e6a3d8277af9560/Classes/Utility/ColumnLayoutUtility.php#L81-L90 |
arndtteunissen/column-layout | Classes/Utility/ColumnLayoutUtility.php | ColumnLayoutUtility.hydrateLayoutConfigFlexFormData | public static function hydrateLayoutConfigFlexFormData($flexFormData): array
{
$dataStructure = $flexFormData;
if (is_string($flexFormData)) {
$dataStructure = GeneralUtility::xml2array($flexFormData);
}
// Level: FlexForm Sheets
return array_map(function ($sheet... | php | public static function hydrateLayoutConfigFlexFormData($flexFormData): array
{
$dataStructure = $flexFormData;
if (is_string($flexFormData)) {
$dataStructure = GeneralUtility::xml2array($flexFormData);
}
// Level: FlexForm Sheets
return array_map(function ($sheet... | [
"public",
"static",
"function",
"hydrateLayoutConfigFlexFormData",
"(",
"$",
"flexFormData",
")",
":",
"array",
"{",
"$",
"dataStructure",
"=",
"$",
"flexFormData",
";",
"if",
"(",
"is_string",
"(",
"$",
"flexFormData",
")",
")",
"{",
"$",
"dataStructure",
"="... | Simplify a FlexForm DataStructure array.
Removes all unnecessary sheet, field or value identifiers.
@param string|array $flexFormData either a converted FlexForm array or the raw FlexForm string
@return array simplified FlexForm data structure | [
"Simplify",
"a",
"FlexForm",
"DataStructure",
"array",
".",
"Removes",
"all",
"unnecessary",
"sheet",
"field",
"or",
"value",
"identifiers",
"."
] | train | https://github.com/arndtteunissen/column-layout/blob/ad737068eef3b084d4d0e3a48e6a3d8277af9560/Classes/Utility/ColumnLayoutUtility.php#L99-L114 |
php-lug/lug | src/Component/Grid/Model/Grid.php | Grid.getColumn | public function getColumn($name)
{
if (!$this->hasColumn($name)) {
throw new InvalidArgumentException(sprintf('The column "%s" could not be found.', $name));
}
return $this->columns[$name];
} | php | public function getColumn($name)
{
if (!$this->hasColumn($name)) {
throw new InvalidArgumentException(sprintf('The column "%s" could not be found.', $name));
}
return $this->columns[$name];
} | [
"public",
"function",
"getColumn",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"hasColumn",
"(",
"$",
"name",
")",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"sprintf",
"(",
"'The column \"%s\" could not be found.'",
",",
"... | {@inheritdoc} | [
"{"
] | train | https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Component/Grid/Model/Grid.php#L136-L143 |
php-lug/lug | src/Component/Grid/Model/Grid.php | Grid.getFilter | public function getFilter($name)
{
if (!$this->hasFilter($name)) {
throw new InvalidArgumentException(sprintf('The filter "%s" could not be found.', $name));
}
return $this->filters[$name];
} | php | public function getFilter($name)
{
if (!$this->hasFilter($name)) {
throw new InvalidArgumentException(sprintf('The filter "%s" could not be found.', $name));
}
return $this->filters[$name];
} | [
"public",
"function",
"getFilter",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"hasFilter",
"(",
"$",
"name",
")",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"sprintf",
"(",
"'The filter \"%s\" could not be found.'",
",",
"... | {@inheritdoc} | [
"{"
] | train | https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Component/Grid/Model/Grid.php#L172-L179 |
php-lug/lug | src/Component/Grid/Model/Grid.php | Grid.getSort | public function getSort($name)
{
if (!$this->hasSort($name)) {
throw new InvalidArgumentException(sprintf('The sort "%s" could not be found.', $name));
}
return $this->sorts[$name];
} | php | public function getSort($name)
{
if (!$this->hasSort($name)) {
throw new InvalidArgumentException(sprintf('The sort "%s" could not be found.', $name));
}
return $this->sorts[$name];
} | [
"public",
"function",
"getSort",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"hasSort",
"(",
"$",
"name",
")",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"sprintf",
"(",
"'The sort \"%s\" could not be found.'",
",",
"$",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Component/Grid/Model/Grid.php#L208-L215 |
php-lug/lug | src/Component/Grid/Model/Grid.php | Grid.getGlobalAction | public function getGlobalAction($name)
{
if (!$this->hasGlobalAction($name)) {
throw new InvalidArgumentException(sprintf('The global action "%s" could not be found.', $name));
}
return $this->globalActions[$name];
} | php | public function getGlobalAction($name)
{
if (!$this->hasGlobalAction($name)) {
throw new InvalidArgumentException(sprintf('The global action "%s" could not be found.', $name));
}
return $this->globalActions[$name];
} | [
"public",
"function",
"getGlobalAction",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"hasGlobalAction",
"(",
"$",
"name",
")",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"sprintf",
"(",
"'The global action \"%s\" could not be f... | {@inheritdoc} | [
"{"
] | train | https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Component/Grid/Model/Grid.php#L244-L251 |
php-lug/lug | src/Component/Grid/Model/Grid.php | Grid.getColumnAction | public function getColumnAction($name)
{
if (!$this->hasColumnAction($name)) {
throw new InvalidArgumentException(sprintf('The column action "%s" could not be found.', $name));
}
return $this->columnActions[$name];
} | php | public function getColumnAction($name)
{
if (!$this->hasColumnAction($name)) {
throw new InvalidArgumentException(sprintf('The column action "%s" could not be found.', $name));
}
return $this->columnActions[$name];
} | [
"public",
"function",
"getColumnAction",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"hasColumnAction",
"(",
"$",
"name",
")",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"sprintf",
"(",
"'The column action \"%s\" could not be f... | {@inheritdoc} | [
"{"
] | train | https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Component/Grid/Model/Grid.php#L280-L287 |
php-lug/lug | src/Component/Grid/Model/Grid.php | Grid.getBatch | public function getBatch($name)
{
if (!$this->hasBatch($name)) {
throw new InvalidArgumentException(sprintf('The batch "%s" could not be found.', $name));
}
return $this->batches[$name];
} | php | public function getBatch($name)
{
if (!$this->hasBatch($name)) {
throw new InvalidArgumentException(sprintf('The batch "%s" could not be found.', $name));
}
return $this->batches[$name];
} | [
"public",
"function",
"getBatch",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"hasBatch",
"(",
"$",
"name",
")",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"sprintf",
"(",
"'The batch \"%s\" could not be found.'",
",",
"$",... | {@inheritdoc} | [
"{"
] | train | https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Component/Grid/Model/Grid.php#L316-L323 |
php-lug/lug | src/Component/Grid/Model/Grid.php | Grid.getOption | public function getOption($name)
{
if (!$this->hasOption($name)) {
throw new OptionNotFoundException(sprintf('The grid option "%s" could not be found.', $name));
}
return $this->options[$name];
} | php | public function getOption($name)
{
if (!$this->hasOption($name)) {
throw new OptionNotFoundException(sprintf('The grid option "%s" could not be found.', $name));
}
return $this->options[$name];
} | [
"public",
"function",
"getOption",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"hasOption",
"(",
"$",
"name",
")",
")",
"{",
"throw",
"new",
"OptionNotFoundException",
"(",
"sprintf",
"(",
"'The grid option \"%s\" could not be found.'",
",",... | {@inheritdoc} | [
"{"
] | train | https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Component/Grid/Model/Grid.php#L368-L375 |
frdl/webfan | .ApplicationComposer/lib/webdof/SumaTag.php | SumaTag.loadDefaults | public function loadDefaults()
{
$this->addSe('*.google.*', 'q');
$this->addSe('*.yahoo.*', 'p');
$this->addSe('*.live.*', 'q');
$this->addSe('*.bing.*', 'q');
$this->addSe('*.aolsvc.*', 'q');
$this->addSe('suche.webfan.de', 'q');
} | php | public function loadDefaults()
{
$this->addSe('*.google.*', 'q');
$this->addSe('*.yahoo.*', 'p');
$this->addSe('*.live.*', 'q');
$this->addSe('*.bing.*', 'q');
$this->addSe('*.aolsvc.*', 'q');
$this->addSe('suche.webfan.de', 'q');
} | [
"public",
"function",
"loadDefaults",
"(",
")",
"{",
"$",
"this",
"->",
"addSe",
"(",
"'*.google.*'",
",",
"'q'",
")",
";",
"$",
"this",
"->",
"addSe",
"(",
"'*.yahoo.*'",
",",
"'p'",
")",
";",
"$",
"this",
"->",
"addSe",
"(",
"'*.live.*'",
",",
"'q'... | /*
Example settings:
'google', 'q',
'yahoo', 'p',
'live', 'q',
'aolsvc', 'q',
'bing', 'q',
'suche.webfan.de', 'q',
Test:
'localhost', 'q', | [
"/",
"*",
"Example",
"settings",
":",
"google",
"q",
"yahoo",
"p",
"live",
"q",
"aolsvc",
"q",
"bing",
"q",
"suche",
".",
"webfan",
".",
"de",
"q",
"Test",
":",
"localhost",
"q"
] | train | https://github.com/frdl/webfan/blob/84d270377685224e891cd9d571b103b36f05b845/.ApplicationComposer/lib/webdof/SumaTag.php#L50-L58 |
frdl/webfan | .ApplicationComposer/lib/webdof/SumaTag.php | SumaTag.addSe | public function addSe($host, $kpn)
{
$host = trim($host);
$regex = str_replace('.', '\\.', $host);
if(substr($host, 0, 1) !== '*')$regex = '^'.$regex;
if(substr($host, -1, 1) !== '*')$regex.= '$';
$regex = str_replace('*', '', $regex);
$this->se[$host] = array(
... | php | public function addSe($host, $kpn)
{
$host = trim($host);
$regex = str_replace('.', '\\.', $host);
if(substr($host, 0, 1) !== '*')$regex = '^'.$regex;
if(substr($host, -1, 1) !== '*')$regex.= '$';
$regex = str_replace('*', '', $regex);
$this->se[$host] = array(
... | [
"public",
"function",
"addSe",
"(",
"$",
"host",
",",
"$",
"kpn",
")",
"{",
"$",
"host",
"=",
"trim",
"(",
"$",
"host",
")",
";",
"$",
"regex",
"=",
"str_replace",
"(",
"'.'",
",",
"'\\\\.'",
",",
"$",
"host",
")",
";",
"if",
"(",
"substr",
"("... | /*
addSe - add search engine
@param string $host E.g.: 'sub.google.com' OR '*.google.com' OR 'google.*' OR '*.*'
@param string $kpn - keywordParameterName - The query parameter of the referer url where the search-keyword is found
e.g. for google it is 'q'
e.g. for yahoo it is 'p' | [
"/",
"*",
"addSe",
"-",
"add",
"search",
"engine"
] | train | https://github.com/frdl/webfan/blob/84d270377685224e891cd9d571b103b36f05b845/.ApplicationComposer/lib/webdof/SumaTag.php#L67-L81 |
frdl/webfan | .ApplicationComposer/lib/webdof/SumaTag.php | SumaTag.check | public function check($ref = NULL, $loc = NULL)
{
if($loc === NULL || parse_url($loc) === FALSE)
{
$u = $this->u->getU();
$loc = $u->location;
}
if($ref === NULL)$ref = strip_tags($_SERVER['HTTP_REFERER']);
$ru = parse_url($ref);
if($ref === '' || $ru === FALSE)return FALSE;... | php | public function check($ref = NULL, $loc = NULL)
{
if($loc === NULL || parse_url($loc) === FALSE)
{
$u = $this->u->getU();
$loc = $u->location;
}
if($ref === NULL)$ref = strip_tags($_SERVER['HTTP_REFERER']);
$ru = parse_url($ref);
if($ref === '' || $ru === FALSE)return FALSE;... | [
"public",
"function",
"check",
"(",
"$",
"ref",
"=",
"NULL",
",",
"$",
"loc",
"=",
"NULL",
")",
"{",
"if",
"(",
"$",
"loc",
"===",
"NULL",
"||",
"parse_url",
"(",
"$",
"loc",
")",
"===",
"FALSE",
")",
"{",
"$",
"u",
"=",
"$",
"this",
"->",
"u... | /*
check - check for keyword in referer !Returns only the first match!
@param string $ref - referer url to check
@param string $loc - url found on your page - OPTIONAL
@return FALSE || array(host, keyword, url) | [
"/",
"*",
"check",
"-",
"check",
"for",
"keyword",
"in",
"referer",
"!Returns",
"only",
"the",
"first",
"match!",
"@param",
"string",
"$ref",
"-",
"referer",
"url",
"to",
"check",
"@param",
"string",
"$loc",
"-",
"url",
"found",
"on",
"your",
"page",
"-"... | train | https://github.com/frdl/webfan/blob/84d270377685224e891cd9d571b103b36f05b845/.ApplicationComposer/lib/webdof/SumaTag.php#L108-L133 |
thelia-modules/CustomerGroup | Model/Base/CustomerGroupI18n.php | CustomerGroupI18n.setId | public function setId($v)
{
if ($v !== null) {
$v = (int) $v;
}
if ($this->id !== $v) {
$this->id = $v;
$this->modifiedColumns[CustomerGroupI18nTableMap::ID] = true;
}
if ($this->aCustomerGroup !== null && $this->aCustomerGroup->getId() !... | php | public function setId($v)
{
if ($v !== null) {
$v = (int) $v;
}
if ($this->id !== $v) {
$this->id = $v;
$this->modifiedColumns[CustomerGroupI18nTableMap::ID] = true;
}
if ($this->aCustomerGroup !== null && $this->aCustomerGroup->getId() !... | [
"public",
"function",
"setId",
"(",
"$",
"v",
")",
"{",
"if",
"(",
"$",
"v",
"!==",
"null",
")",
"{",
"$",
"v",
"=",
"(",
"int",
")",
"$",
"v",
";",
"}",
"if",
"(",
"$",
"this",
"->",
"id",
"!==",
"$",
"v",
")",
"{",
"$",
"this",
"->",
... | Set the value of [id] column.
@param int $v new value
@return \CustomerGroup\Model\CustomerGroupI18n The current object (for fluent API support) | [
"Set",
"the",
"value",
"of",
"[",
"id",
"]",
"column",
"."
] | train | https://github.com/thelia-modules/CustomerGroup/blob/672cc64c686812f6a95cf0d702111f93d8c0e850/Model/Base/CustomerGroupI18n.php#L415-L432 |
thelia-modules/CustomerGroup | Model/Base/CustomerGroupI18n.php | CustomerGroupI18n.ensureConsistency | public function ensureConsistency()
{
if ($this->aCustomerGroup !== null && $this->id !== $this->aCustomerGroup->getId()) {
$this->aCustomerGroup = null;
}
} | php | public function ensureConsistency()
{
if ($this->aCustomerGroup !== null && $this->id !== $this->aCustomerGroup->getId()) {
$this->aCustomerGroup = null;
}
} | [
"public",
"function",
"ensureConsistency",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"aCustomerGroup",
"!==",
"null",
"&&",
"$",
"this",
"->",
"id",
"!==",
"$",
"this",
"->",
"aCustomerGroup",
"->",
"getId",
"(",
")",
")",
"{",
"$",
"this",
"->",
... | Checks and repairs the internal consistency of the object.
This method is executed after an already-instantiated object is re-hydrated
from the database. It exists to check any foreign keys to make sure that
the objects related to the current object are correct based on foreign key.
You can override this method in t... | [
"Checks",
"and",
"repairs",
"the",
"internal",
"consistency",
"of",
"the",
"object",
"."
] | train | https://github.com/thelia-modules/CustomerGroup/blob/672cc64c686812f6a95cf0d702111f93d8c0e850/Model/Base/CustomerGroupI18n.php#L577-L582 |
thelia-modules/CustomerGroup | Model/Base/CustomerGroupI18n.php | CustomerGroupI18n.doSave | protected function doSave(ConnectionInterface $con)
{
$affectedRows = 0; // initialize var to track total num of affected rows
if (!$this->alreadyInSave) {
$this->alreadyInSave = true;
// We call the save method on the following object(s) if they
// were passed t... | php | protected function doSave(ConnectionInterface $con)
{
$affectedRows = 0; // initialize var to track total num of affected rows
if (!$this->alreadyInSave) {
$this->alreadyInSave = true;
// We call the save method on the following object(s) if they
// were passed t... | [
"protected",
"function",
"doSave",
"(",
"ConnectionInterface",
"$",
"con",
")",
"{",
"$",
"affectedRows",
"=",
"0",
";",
"// initialize var to track total num of affected rows",
"if",
"(",
"!",
"$",
"this",
"->",
"alreadyInSave",
")",
"{",
"$",
"this",
"->",
"al... | Performs the work of inserting or updating the row in the database.
If the object is new, it inserts it; otherwise an update is performed.
All related objects are also updated in this method.
@param ConnectionInterface $con
@return int The number of rows affected by this insert/update and any referri... | [
"Performs",
"the",
"work",
"of",
"inserting",
"or",
"updating",
"the",
"row",
"in",
"the",
"database",
"."
] | train | https://github.com/thelia-modules/CustomerGroup/blob/672cc64c686812f6a95cf0d702111f93d8c0e850/Model/Base/CustomerGroupI18n.php#L727-L761 |
thelia-modules/CustomerGroup | Model/Base/CustomerGroupI18n.php | CustomerGroupI18n.buildCriteria | public function buildCriteria()
{
$criteria = new Criteria(CustomerGroupI18nTableMap::DATABASE_NAME);
if ($this->isColumnModified(CustomerGroupI18nTableMap::ID)) $criteria->add(CustomerGroupI18nTableMap::ID, $this->id);
if ($this->isColumnModified(CustomerGroupI18nTableMap::LOCALE)) $criter... | php | public function buildCriteria()
{
$criteria = new Criteria(CustomerGroupI18nTableMap::DATABASE_NAME);
if ($this->isColumnModified(CustomerGroupI18nTableMap::ID)) $criteria->add(CustomerGroupI18nTableMap::ID, $this->id);
if ($this->isColumnModified(CustomerGroupI18nTableMap::LOCALE)) $criter... | [
"public",
"function",
"buildCriteria",
"(",
")",
"{",
"$",
"criteria",
"=",
"new",
"Criteria",
"(",
"CustomerGroupI18nTableMap",
"::",
"DATABASE_NAME",
")",
";",
"if",
"(",
"$",
"this",
"->",
"isColumnModified",
"(",
"CustomerGroupI18nTableMap",
"::",
"ID",
")",... | Build a Criteria object containing the values of all modified columns in this object.
@return Criteria The Criteria object containing all modified values. | [
"Build",
"a",
"Criteria",
"object",
"containing",
"the",
"values",
"of",
"all",
"modified",
"columns",
"in",
"this",
"object",
"."
] | train | https://github.com/thelia-modules/CustomerGroup/blob/672cc64c686812f6a95cf0d702111f93d8c0e850/Model/Base/CustomerGroupI18n.php#L1004-L1014 |
thelia-modules/CustomerGroup | Model/Base/CustomerGroupI18n.php | CustomerGroupI18n.setCustomerGroup | public function setCustomerGroup(ChildCustomerGroup $v = null)
{
if ($v === null) {
$this->setId(NULL);
} else {
$this->setId($v->getId());
}
$this->aCustomerGroup = $v;
// Add binding for other direction of this n:n relationship.
// If this ... | php | public function setCustomerGroup(ChildCustomerGroup $v = null)
{
if ($v === null) {
$this->setId(NULL);
} else {
$this->setId($v->getId());
}
$this->aCustomerGroup = $v;
// Add binding for other direction of this n:n relationship.
// If this ... | [
"public",
"function",
"setCustomerGroup",
"(",
"ChildCustomerGroup",
"$",
"v",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"v",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"setId",
"(",
"NULL",
")",
";",
"}",
"else",
"{",
"$",
"this",
"->",
"setId",
"("... | Declares an association between this object and a ChildCustomerGroup object.
@param ChildCustomerGroup $v
@return \CustomerGroup\Model\CustomerGroupI18n The current object (for fluent API support)
@throws PropelException | [
"Declares",
"an",
"association",
"between",
"this",
"object",
"and",
"a",
"ChildCustomerGroup",
"object",
"."
] | train | https://github.com/thelia-modules/CustomerGroup/blob/672cc64c686812f6a95cf0d702111f93d8c0e850/Model/Base/CustomerGroupI18n.php#L1120-L1138 |
thelia-modules/CustomerGroup | Model/Base/CustomerGroupI18n.php | CustomerGroupI18n.getCustomerGroup | public function getCustomerGroup(ConnectionInterface $con = null)
{
if ($this->aCustomerGroup === null && ($this->id !== null)) {
$this->aCustomerGroup = ChildCustomerGroupQuery::create()->findPk($this->id, $con);
/* The following can be used additionally to
guarantee... | php | public function getCustomerGroup(ConnectionInterface $con = null)
{
if ($this->aCustomerGroup === null && ($this->id !== null)) {
$this->aCustomerGroup = ChildCustomerGroupQuery::create()->findPk($this->id, $con);
/* The following can be used additionally to
guarantee... | [
"public",
"function",
"getCustomerGroup",
"(",
"ConnectionInterface",
"$",
"con",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"aCustomerGroup",
"===",
"null",
"&&",
"(",
"$",
"this",
"->",
"id",
"!==",
"null",
")",
")",
"{",
"$",
"this",
"->",... | Get the associated ChildCustomerGroup object
@param ConnectionInterface $con Optional Connection object.
@return ChildCustomerGroup The associated ChildCustomerGroup object.
@throws PropelException | [
"Get",
"the",
"associated",
"ChildCustomerGroup",
"object"
] | train | https://github.com/thelia-modules/CustomerGroup/blob/672cc64c686812f6a95cf0d702111f93d8c0e850/Model/Base/CustomerGroupI18n.php#L1148-L1162 |
99designs/ergo-http | src/Url.php | Url.getHostWithPort | public function getHostWithPort()
{
if ($this->hasPort() && (!$this->hasDefaultPort() || !$this->isPortDefault())) {
return $this->getHost() . ':' . $this->getPort();
} else {
return $this->getHost();
}
} | php | public function getHostWithPort()
{
if ($this->hasPort() && (!$this->hasDefaultPort() || !$this->isPortDefault())) {
return $this->getHost() . ':' . $this->getPort();
} else {
return $this->getHost();
}
} | [
"public",
"function",
"getHostWithPort",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"hasPort",
"(",
")",
"&&",
"(",
"!",
"$",
"this",
"->",
"hasDefaultPort",
"(",
")",
"||",
"!",
"$",
"this",
"->",
"isPortDefault",
"(",
")",
")",
")",
"{",
"retur... | Host, including port unless it is the default port for the scheme.
@return string | [
"Host",
"including",
"port",
"unless",
"it",
"is",
"the",
"default",
"port",
"for",
"the",
"scheme",
"."
] | train | https://github.com/99designs/ergo-http/blob/979b789f2e011a1cb70a00161e6b7bcd0d2e9c71/src/Url.php#L89-L96 |
99designs/ergo-http | src/Url.php | Url.getDefaultPort | public function getDefaultPort()
{
if (!$this->hasDefaultPort()) throw new UrlException(sprintf(
"No default port for URL '%s'",
$this->_inputString
));
$scheme = $this->getScheme();
if ($scheme == 'http') return 80;
elseif ($scheme == 'https') return... | php | public function getDefaultPort()
{
if (!$this->hasDefaultPort()) throw new UrlException(sprintf(
"No default port for URL '%s'",
$this->_inputString
));
$scheme = $this->getScheme();
if ($scheme == 'http') return 80;
elseif ($scheme == 'https') return... | [
"public",
"function",
"getDefaultPort",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"hasDefaultPort",
"(",
")",
")",
"throw",
"new",
"UrlException",
"(",
"sprintf",
"(",
"\"No default port for URL '%s'\"",
",",
"$",
"this",
"->",
"_inputString",
")",
"... | The default TCP port for the scheme of the URL
@return int or null | [
"The",
"default",
"TCP",
"port",
"for",
"the",
"scheme",
"of",
"the",
"URL"
] | train | https://github.com/99designs/ergo-http/blob/979b789f2e011a1cb70a00161e6b7bcd0d2e9c71/src/Url.php#L176-L187 |
99designs/ergo-http | src/Url.php | Url.getHostRelativeUrl | public function getHostRelativeUrl()
{
$url = $this->getPath();
if ($this->hasQueryString()) $url .= '?' . $this->getQueryString();
if ($this->hasFragmentString()) $url .= '#' . $this->getFragmentString();
return $url;
} | php | public function getHostRelativeUrl()
{
$url = $this->getPath();
if ($this->hasQueryString()) $url .= '?' . $this->getQueryString();
if ($this->hasFragmentString()) $url .= '#' . $this->getFragmentString();
return $url;
} | [
"public",
"function",
"getHostRelativeUrl",
"(",
")",
"{",
"$",
"url",
"=",
"$",
"this",
"->",
"getPath",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"hasQueryString",
"(",
")",
")",
"$",
"url",
".=",
"'?'",
".",
"$",
"this",
"->",
"getQueryString",... | The URL components after the host.
@return string | [
"The",
"URL",
"components",
"after",
"the",
"host",
"."
] | train | https://github.com/99designs/ergo-http/blob/979b789f2e011a1cb70a00161e6b7bcd0d2e9c71/src/Url.php#L210-L216 |
99designs/ergo-http | src/Url.php | Url.getUrlForPath | public function getUrlForPath($path)
{
$fragments = parse_url($path);
if (!isset($fragments['path']))
throw new UrlException("URL is not a valid path: '$path'");
$newUrl = clone $this;
$newUrl->_fragments['path'] = $fragments['path'];
// overwrite RHS component... | php | public function getUrlForPath($path)
{
$fragments = parse_url($path);
if (!isset($fragments['path']))
throw new UrlException("URL is not a valid path: '$path'");
$newUrl = clone $this;
$newUrl->_fragments['path'] = $fragments['path'];
// overwrite RHS component... | [
"public",
"function",
"getUrlForPath",
"(",
"$",
"path",
")",
"{",
"$",
"fragments",
"=",
"parse_url",
"(",
"$",
"path",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"fragments",
"[",
"'path'",
"]",
")",
")",
"throw",
"new",
"UrlException",
"(",
"\"U... | Builds a URL with a different path component
@return Url | [
"Builds",
"a",
"URL",
"with",
"a",
"different",
"path",
"component"
] | train | https://github.com/99designs/ergo-http/blob/979b789f2e011a1cb70a00161e6b7bcd0d2e9c71/src/Url.php#L235-L257 |
99designs/ergo-http | src/Url.php | Url.getUrlForHost | public function getUrlForHost($host)
{
$newUrl = clone $this;
$newUrl->_fragments['host'] = $host;
$newUrl->_inputString = $newUrl->__toString();
return $newUrl;
} | php | public function getUrlForHost($host)
{
$newUrl = clone $this;
$newUrl->_fragments['host'] = $host;
$newUrl->_inputString = $newUrl->__toString();
return $newUrl;
} | [
"public",
"function",
"getUrlForHost",
"(",
"$",
"host",
")",
"{",
"$",
"newUrl",
"=",
"clone",
"$",
"this",
";",
"$",
"newUrl",
"->",
"_fragments",
"[",
"'host'",
"]",
"=",
"$",
"host",
";",
"$",
"newUrl",
"->",
"_inputString",
"=",
"$",
"newUrl",
"... | Builds a URL with a different host
@return Url | [
"Builds",
"a",
"URL",
"with",
"a",
"different",
"host"
] | train | https://github.com/99designs/ergo-http/blob/979b789f2e011a1cb70a00161e6b7bcd0d2e9c71/src/Url.php#L263-L270 |
99designs/ergo-http | src/Url.php | Url.getUrlForScheme | public function getUrlForScheme($scheme)
{
$newUrl = clone $this;
$wasDefaultPort = ($newUrl->hasScheme() && $newUrl->isPortDefault());
$newUrl->_fragments['scheme'] = $scheme;
if ($wasDefaultPort) {
$newUrl->_fragments['port'] = $newUrl->getDefaultPort();
}
... | php | public function getUrlForScheme($scheme)
{
$newUrl = clone $this;
$wasDefaultPort = ($newUrl->hasScheme() && $newUrl->isPortDefault());
$newUrl->_fragments['scheme'] = $scheme;
if ($wasDefaultPort) {
$newUrl->_fragments['port'] = $newUrl->getDefaultPort();
}
... | [
"public",
"function",
"getUrlForScheme",
"(",
"$",
"scheme",
")",
"{",
"$",
"newUrl",
"=",
"clone",
"$",
"this",
";",
"$",
"wasDefaultPort",
"=",
"(",
"$",
"newUrl",
"->",
"hasScheme",
"(",
")",
"&&",
"$",
"newUrl",
"->",
"isPortDefault",
"(",
")",
")"... | Builds a URL with a different scheme
@return Url | [
"Builds",
"a",
"URL",
"with",
"a",
"different",
"scheme"
] | train | https://github.com/99designs/ergo-http/blob/979b789f2e011a1cb70a00161e6b7bcd0d2e9c71/src/Url.php#L276-L290 |
99designs/ergo-http | src/Url.php | Url.getUrlForFragment | public function getUrlForFragment($fragment)
{
$newUrl = clone $this;
$newUrl->_fragments['fragment'] = $fragment;
$newUrl->_inputString = $newUrl->__toString();
return $newUrl;
} | php | public function getUrlForFragment($fragment)
{
$newUrl = clone $this;
$newUrl->_fragments['fragment'] = $fragment;
$newUrl->_inputString = $newUrl->__toString();
return $newUrl;
} | [
"public",
"function",
"getUrlForFragment",
"(",
"$",
"fragment",
")",
"{",
"$",
"newUrl",
"=",
"clone",
"$",
"this",
";",
"$",
"newUrl",
"->",
"_fragments",
"[",
"'fragment'",
"]",
"=",
"$",
"fragment",
";",
"$",
"newUrl",
"->",
"_inputString",
"=",
"$",... | Builds a url with a different fragment (the part after # in the url)
@param string
@return Url | [
"Builds",
"a",
"url",
"with",
"a",
"different",
"fragment",
"(",
"the",
"part",
"after",
"#",
"in",
"the",
"url",
")"
] | train | https://github.com/99designs/ergo-http/blob/979b789f2e011a1cb70a00161e6b7bcd0d2e9c71/src/Url.php#L297-L303 |
99designs/ergo-http | src/Url.php | Url._joinPathComponents | private function _joinPathComponents($path)
{
$result = null;
foreach (func_get_args() as $p) {
$leading = substr($p, 0, 1);
$trailing = substr($result, -1);
if (!empty($p) && $leading != '/' && $leading != '?' && $trailing != '/')
$result .= '/';... | php | private function _joinPathComponents($path)
{
$result = null;
foreach (func_get_args() as $p) {
$leading = substr($p, 0, 1);
$trailing = substr($result, -1);
if (!empty($p) && $leading != '/' && $leading != '?' && $trailing != '/')
$result .= '/';... | [
"private",
"function",
"_joinPathComponents",
"(",
"$",
"path",
")",
"{",
"$",
"result",
"=",
"null",
";",
"foreach",
"(",
"func_get_args",
"(",
")",
"as",
"$",
"p",
")",
"{",
"$",
"leading",
"=",
"substr",
"(",
"$",
"p",
",",
"0",
",",
"1",
")",
... | Join path/querystring/fragment components together | [
"Join",
"path",
"/",
"querystring",
"/",
"fragment",
"components",
"together"
] | train | https://github.com/99designs/ergo-http/blob/979b789f2e011a1cb70a00161e6b7bcd0d2e9c71/src/Url.php#L308-L321 |
99designs/ergo-http | src/Url.php | Url.getUrlForRelativePath | public function getUrlForRelativePath($path)
{
return $this->getUrlForPath(
$this->_joinPathComponents($this->getPath(), ltrim($path, '/')));
} | php | public function getUrlForRelativePath($path)
{
return $this->getUrlForPath(
$this->_joinPathComponents($this->getPath(), ltrim($path, '/')));
} | [
"public",
"function",
"getUrlForRelativePath",
"(",
"$",
"path",
")",
"{",
"return",
"$",
"this",
"->",
"getUrlForPath",
"(",
"$",
"this",
"->",
"_joinPathComponents",
"(",
"$",
"this",
"->",
"getPath",
"(",
")",
",",
"ltrim",
"(",
"$",
"path",
",",
"'/'... | Builds a URL with a path component that is relative to the current one
@return Url | [
"Builds",
"a",
"URL",
"with",
"a",
"path",
"component",
"that",
"is",
"relative",
"to",
"the",
"current",
"one"
] | train | https://github.com/99designs/ergo-http/blob/979b789f2e011a1cb70a00161e6b7bcd0d2e9c71/src/Url.php#L327-L331 |
99designs/ergo-http | src/Url.php | Url.getUrlForMergedParameters | public function getUrlForMergedParameters($queryParameters)
{
if ($this->hasQueryString()) {
$querystring = new QueryString($this->getQueryString());
$querystring->addParameters($queryParameters);
$queryParameters = $querystring->toArray();
}
return $this... | php | public function getUrlForMergedParameters($queryParameters)
{
if ($this->hasQueryString()) {
$querystring = new QueryString($this->getQueryString());
$querystring->addParameters($queryParameters);
$queryParameters = $querystring->toArray();
}
return $this... | [
"public",
"function",
"getUrlForMergedParameters",
"(",
"$",
"queryParameters",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"hasQueryString",
"(",
")",
")",
"{",
"$",
"querystring",
"=",
"new",
"QueryString",
"(",
"$",
"this",
"->",
"getQueryString",
"(",
")",
... | Builds a URL with added/merged query parameters
@param array $queryParameters | [
"Builds",
"a",
"URL",
"with",
"added",
"/",
"merged",
"query",
"parameters"
] | train | https://github.com/99designs/ergo-http/blob/979b789f2e011a1cb70a00161e6b7bcd0d2e9c71/src/Url.php#L349-L358 |
DotZecker/Larafeed | src/Larafeed.php | Larafeed.setEntry | public function setEntry(Entry $entry)
{
$entry->format = $this->format;
$entry->prepare();
$this->entries->add($entry);
} | php | public function setEntry(Entry $entry)
{
$entry->format = $this->format;
$entry->prepare();
$this->entries->add($entry);
} | [
"public",
"function",
"setEntry",
"(",
"Entry",
"$",
"entry",
")",
"{",
"$",
"entry",
"->",
"format",
"=",
"$",
"this",
"->",
"format",
";",
"$",
"entry",
"->",
"prepare",
"(",
")",
";",
"$",
"this",
"->",
"entries",
"->",
"add",
"(",
"$",
"entry",... | Prepare and push the entry to the feed (if it's valid)
@param Entry $entry
@return void | [
"Prepare",
"and",
"push",
"the",
"entry",
"to",
"the",
"feed",
"(",
"if",
"it",
"s",
"valid",
")"
] | train | https://github.com/DotZecker/Larafeed/blob/d696e2f97b584ed690fe7ba4ac5d739e266c75dd/src/Larafeed.php#L82-L88 |
DotZecker/Larafeed | src/Larafeed.php | Larafeed.addAuthor | public function addAuthor($author)
{
if (!is_array($author)) {
$author = ['name' => $author];
}
$this->authors->add((object) $author);
} | php | public function addAuthor($author)
{
if (!is_array($author)) {
$author = ['name' => $author];
}
$this->authors->add((object) $author);
} | [
"public",
"function",
"addAuthor",
"(",
"$",
"author",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"author",
")",
")",
"{",
"$",
"author",
"=",
"[",
"'name'",
"=>",
"$",
"author",
"]",
";",
"}",
"$",
"this",
"->",
"authors",
"->",
"add",
"(",... | Add an Author to the feed
@param mixed $author It can be an array with name, email and uri,
or just and string with the name. | [
"Add",
"an",
"Author",
"to",
"the",
"feed"
] | train | https://github.com/DotZecker/Larafeed/blob/d696e2f97b584ed690fe7ba4ac5d739e266c75dd/src/Larafeed.php#L108-L115 |
DotZecker/Larafeed | src/Larafeed.php | Larafeed.render | public function render()
{
$this->prepare();
$view = $this->twig->render(sprintf('%s.twig.html', $this->format), ['feed' => $this]);
return Response::create(
$view,
200,
[
'Content-Type' => "{$this->getContentType()}; charset={$this->char... | php | public function render()
{
$this->prepare();
$view = $this->twig->render(sprintf('%s.twig.html', $this->format), ['feed' => $this]);
return Response::create(
$view,
200,
[
'Content-Type' => "{$this->getContentType()}; charset={$this->char... | [
"public",
"function",
"render",
"(",
")",
"{",
"$",
"this",
"->",
"prepare",
"(",
")",
";",
"$",
"view",
"=",
"$",
"this",
"->",
"twig",
"->",
"render",
"(",
"sprintf",
"(",
"'%s.twig.html'",
",",
"$",
"this",
"->",
"format",
")",
",",
"[",
"'feed'... | Prepare the feed and if it's valid, renders it
@return Response | [
"Prepare",
"the",
"feed",
"and",
"if",
"it",
"s",
"valid",
"renders",
"it"
] | train | https://github.com/DotZecker/Larafeed/blob/d696e2f97b584ed690fe7ba4ac5d739e266c75dd/src/Larafeed.php#L122-L135 |
simbiosis-group/yii2-helper | actions/AutoCompleteAction.php | AutoCompleteAction.run | public function run()
{
$data = [];
if ($this->term) {
$data = $this->query->asArray()->all();
}
Yii::$app->response->format = Response::FORMAT_JSON;
return $data;
} | php | public function run()
{
$data = [];
if ($this->term) {
$data = $this->query->asArray()->all();
}
Yii::$app->response->format = Response::FORMAT_JSON;
return $data;
} | [
"public",
"function",
"run",
"(",
")",
"{",
"$",
"data",
"=",
"[",
"]",
";",
"if",
"(",
"$",
"this",
"->",
"term",
")",
"{",
"$",
"data",
"=",
"$",
"this",
"->",
"query",
"->",
"asArray",
"(",
")",
"->",
"all",
"(",
")",
";",
"}",
"Yii",
":... | Runs the action
@return string result content | [
"Runs",
"the",
"action"
] | train | https://github.com/simbiosis-group/yii2-helper/blob/c85c4204dd06b16e54210e75fe6deb51869d1dd9/actions/AutoCompleteAction.php#L38-L48 |
ronaldborla/chikka | src/Borla/Chikka/Models/Mobile.php | Mobile.format | public function format($format) {
// C = Country Code
// c = Carrier code
// n = Number
return str_replace(
['C', 'c', 'n', 'l'],
[$this->country->code, $this->carrier->code, $this->number, $this->getLocalCode()],
$format);
} | php | public function format($format) {
// C = Country Code
// c = Carrier code
// n = Number
return str_replace(
['C', 'c', 'n', 'l'],
[$this->country->code, $this->carrier->code, $this->number, $this->getLocalCode()],
$format);
} | [
"public",
"function",
"format",
"(",
"$",
"format",
")",
"{",
"// C = Country Code",
"// c = Carrier code",
"// n = Number",
"return",
"str_replace",
"(",
"[",
"'C'",
",",
"'c'",
",",
"'n'",
",",
"'l'",
"]",
",",
"[",
"$",
"this",
"->",
"country",
"->",
"c... | Format number | [
"Format",
"number"
] | train | https://github.com/ronaldborla/chikka/blob/446987706f81d5a0efbc8bd6b7d3b259d0527719/src/Borla/Chikka/Models/Mobile.php#L66-L74 |
expectation-php/expect | src/configurator/FileConfigurator.php | FileConfigurator.configure | public function configure()
{
$registry = new DefaultMatcherRegistry();
$packages = $this->config->getMatcherRegistrars();
foreach ($packages as $package) {
$package->registerTo($registry);
}
$dictionary = $registry->toDictionary();
$matcherFactory = new... | php | public function configure()
{
$registry = new DefaultMatcherRegistry();
$packages = $this->config->getMatcherRegistrars();
foreach ($packages as $package) {
$package->registerTo($registry);
}
$dictionary = $registry->toDictionary();
$matcherFactory = new... | [
"public",
"function",
"configure",
"(",
")",
"{",
"$",
"registry",
"=",
"new",
"DefaultMatcherRegistry",
"(",
")",
";",
"$",
"packages",
"=",
"$",
"this",
"->",
"config",
"->",
"getMatcherRegistrars",
"(",
")",
";",
"foreach",
"(",
"$",
"packages",
"as",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/expectation-php/expect/blob/1a32c5af37f3dc8dabe4e8eedeeb21aea16ce139/src/configurator/FileConfigurator.php#L48-L63 |
Eresus/EresusCMS | src/core/classes/helpers/PaginationHelper.php | PaginationHelper.rewind | public function rewind()
{
$this->items = array();
$this->prepareUrlTemplate();
/*
* Если страниц больше чем задано показывать за один раз, то будем показывать только часть
* страниц, наиболее близких к текущей.
*/
if ($this->total > $this->size)
... | php | public function rewind()
{
$this->items = array();
$this->prepareUrlTemplate();
/*
* Если страниц больше чем задано показывать за один раз, то будем показывать только часть
* страниц, наиболее близких к текущей.
*/
if ($this->total > $this->size)
... | [
"public",
"function",
"rewind",
"(",
")",
"{",
"$",
"this",
"->",
"items",
"=",
"array",
"(",
")",
";",
"$",
"this",
"->",
"prepareUrlTemplate",
"(",
")",
";",
"/*\n * Если страниц больше чем задано показывать за один раз, то будем показывать только часть\n ... | Подготовливает объект к первой итерации
@return void
@since 2.14
@see Iterator::rewind()
@internal | [
"Подготовливает",
"объект",
"к",
"первой",
"итерации"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/classes/helpers/PaginationHelper.php#L313-L376 |
Eresus/EresusCMS | src/core/classes/helpers/PaginationHelper.php | PaginationHelper.render | public function render()
{
$tmpl = new Eresus_Template($this->getTemplate());
$data = array('pagination' => $this);
return $tmpl->compile($data);
} | php | public function render()
{
$tmpl = new Eresus_Template($this->getTemplate());
$data = array('pagination' => $this);
return $tmpl->compile($data);
} | [
"public",
"function",
"render",
"(",
")",
"{",
"$",
"tmpl",
"=",
"new",
"Eresus_Template",
"(",
"$",
"this",
"->",
"getTemplate",
"(",
")",
")",
";",
"$",
"data",
"=",
"array",
"(",
"'pagination'",
"=>",
"$",
"this",
")",
";",
"return",
"$",
"tmpl",
... | Создаёт разметку переключателя страниц
@return string HTML
@since 2.14 | [
"Создаёт",
"разметку",
"переключателя",
"страниц"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/classes/helpers/PaginationHelper.php#L416-L423 |
Eresus/EresusCMS | src/core/classes/helpers/PaginationHelper.php | PaginationHelper.itemFactory | private function itemFactory($pageNumber, $title = null)
{
return array(
'url' => sprintf($this->urlTemplate, $pageNumber),
'title' => $title ? $title : $pageNumber,
'current' => false
);
} | php | private function itemFactory($pageNumber, $title = null)
{
return array(
'url' => sprintf($this->urlTemplate, $pageNumber),
'title' => $title ? $title : $pageNumber,
'current' => false
);
} | [
"private",
"function",
"itemFactory",
"(",
"$",
"pageNumber",
",",
"$",
"title",
"=",
"null",
")",
"{",
"return",
"array",
"(",
"'url'",
"=>",
"sprintf",
"(",
"$",
"this",
"->",
"urlTemplate",
",",
"$",
"pageNumber",
")",
",",
"'title'",
"=>",
"$",
"ti... | Создаёт элемент нумерации
@param int $pageNumber Номер страницы
@param string $title[optional] Название страницы
@return array
@since 2.14 | [
"Создаёт",
"элемент",
"нумерации"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/classes/helpers/PaginationHelper.php#L451-L458 |
surebert/surebert-framework | src/sb/Excel/Writer.php | Writer.setCell | public function setCell($cell, $value, $type = "auto")
{
if ($type == "auto") {
$type = \gettype($value);
}
if (\is_array($cell)) {
$parts["row"] = $cell[0];
$parts["col"] = $cell[1];
} else {
$parts = $this->refToArray($cell);
... | php | public function setCell($cell, $value, $type = "auto")
{
if ($type == "auto") {
$type = \gettype($value);
}
if (\is_array($cell)) {
$parts["row"] = $cell[0];
$parts["col"] = $cell[1];
} else {
$parts = $this->refToArray($cell);
... | [
"public",
"function",
"setCell",
"(",
"$",
"cell",
",",
"$",
"value",
",",
"$",
"type",
"=",
"\"auto\"",
")",
"{",
"if",
"(",
"$",
"type",
"==",
"\"auto\"",
")",
"{",
"$",
"type",
"=",
"\\",
"gettype",
"(",
"$",
"value",
")",
";",
"}",
"if",
"(... | Set the value of an individual cell
@param mixed An excel cell reference such as A1, or an array in the
format of ($row, $col) usign zero-based integers
@param mixed the value to put in this cell
@param the type of value (string|integer). Autodetects by default
@return boolean Success | [
"Set",
"the",
"value",
"of",
"an",
"individual",
"cell"
] | train | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Excel/Writer.php#L60-L111 |
surebert/surebert-framework | src/sb/Excel/Writer.php | Writer.setRow | public function setRow($row, $values)
{
if (!\is_array($values)) {
\trigger_error("Values must be an array.", E_USER_ERROR);
return false;
}
if (intval($row) < 1) {
\trigger_error("Row number must be an integer greater than 1.", E_USER_ERROR);
... | php | public function setRow($row, $values)
{
if (!\is_array($values)) {
\trigger_error("Values must be an array.", E_USER_ERROR);
return false;
}
if (intval($row) < 1) {
\trigger_error("Row number must be an integer greater than 1.", E_USER_ERROR);
... | [
"public",
"function",
"setRow",
"(",
"$",
"row",
",",
"$",
"values",
")",
"{",
"if",
"(",
"!",
"\\",
"is_array",
"(",
"$",
"values",
")",
")",
"{",
"\\",
"trigger_error",
"(",
"\"Values must be an array.\"",
",",
"E_USER_ERROR",
")",
";",
"return",
"fals... | Set the values for a row
@param integer The Excel row number to place these values
@param array An array of values
@return boolean Success | [
"Set",
"the",
"values",
"for",
"a",
"row"
] | train | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Excel/Writer.php#L120-L139 |
surebert/surebert-framework | src/sb/Excel/Writer.php | Writer.setColumn | public function setColumn($col, $values)
{
if (!\is_array($values)) {
\trigger_error("Values must be an array.", E_USER_ERROR);
return false;
}
if (\is_numeric($col)) {
\trigger_error("Column must be a letter, eg column D.", E_USER_ERROR);
retu... | php | public function setColumn($col, $values)
{
if (!\is_array($values)) {
\trigger_error("Values must be an array.", E_USER_ERROR);
return false;
}
if (\is_numeric($col)) {
\trigger_error("Column must be a letter, eg column D.", E_USER_ERROR);
retu... | [
"public",
"function",
"setColumn",
"(",
"$",
"col",
",",
"$",
"values",
")",
"{",
"if",
"(",
"!",
"\\",
"is_array",
"(",
"$",
"values",
")",
")",
"{",
"\\",
"trigger_error",
"(",
"\"Values must be an array.\"",
",",
"E_USER_ERROR",
")",
";",
"return",
"f... | undocumented function
@param string The Excel column letter
@param array An array of values
@return Success | [
"undocumented",
"function"
] | train | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Excel/Writer.php#L148-L167 |
surebert/surebert-framework | src/sb/Excel/Writer.php | Writer.outputWithHeaders | public function outputWithHeaders($filename = 'output.xls')
{
\header("Expires: " . date("r", 0));
\header("Last-Modified: " . gmdate("r") . " GMT");
\header("Content-Type: application/x-msexcel");
\header("Content-Disposition: attachment; filename=" . $filename);
echo $this-... | php | public function outputWithHeaders($filename = 'output.xls')
{
\header("Expires: " . date("r", 0));
\header("Last-Modified: " . gmdate("r") . " GMT");
\header("Content-Type: application/x-msexcel");
\header("Content-Disposition: attachment; filename=" . $filename);
echo $this-... | [
"public",
"function",
"outputWithHeaders",
"(",
"$",
"filename",
"=",
"'output.xls'",
")",
"{",
"\\",
"header",
"(",
"\"Expires: \"",
".",
"date",
"(",
"\"r\"",
",",
"0",
")",
")",
";",
"\\",
"header",
"(",
"\"Last-Modified: \"",
".",
"gmdate",
"(",
"\"r\"... | Stream this file over HTTP
@return void | [
"Stream",
"this",
"file",
"over",
"HTTP"
] | train | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Excel/Writer.php#L174-L181 |
surebert/surebert-framework | src/sb/Excel/Writer.php | Writer.refToArray | protected function refToArray($ref)
{
$offset = 64;
$len = strlen($ref);
$div = 0;
for ($i = 0; $i < $len; $i++) {
$char = substr($ref, $i, 1);
if (is_numeric($char)) {
$div = $i;
break;
}
}
if ($di... | php | protected function refToArray($ref)
{
$offset = 64;
$len = strlen($ref);
$div = 0;
for ($i = 0; $i < $len; $i++) {
$char = substr($ref, $i, 1);
if (is_numeric($char)) {
$div = $i;
break;
}
}
if ($di... | [
"protected",
"function",
"refToArray",
"(",
"$",
"ref",
")",
"{",
"$",
"offset",
"=",
"64",
";",
"$",
"len",
"=",
"strlen",
"(",
"$",
"ref",
")",
";",
"$",
"div",
"=",
"0",
";",
"for",
"(",
"$",
"i",
"=",
"0",
";",
"$",
"i",
"<",
"$",
"len"... | Convert a Excel Cell Reference to an array of component integers -- A5 becomes (6, 0);
@param string An Excel cell reference such as A1, B7
@return array An associative array of row/column integers | [
"Convert",
"a",
"Excel",
"Cell",
"Reference",
"to",
"an",
"array",
"of",
"component",
"integers",
"--",
"A5",
"becomes",
"(",
"6",
"0",
")",
";"
] | train | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Excel/Writer.php#L212-L243 |
romainbessugesmeusy/php-datagrid | library/RBM/Datagrid/Data/Processor/ArrayProcessor.php | ArrayProcessor._sort | protected function _sort()
{
if (!isset($this->_sorts) || count($this->_sorts) === 0) {
return;
}
$columns = $this->_dataGrid->getActiveColumnsOrdered();
$sorts = $this->_sorts;
$sortPosition = $this->_sortPositions;
usort($this->_output, fun... | php | protected function _sort()
{
if (!isset($this->_sorts) || count($this->_sorts) === 0) {
return;
}
$columns = $this->_dataGrid->getActiveColumnsOrdered();
$sorts = $this->_sorts;
$sortPosition = $this->_sortPositions;
usort($this->_output, fun... | [
"protected",
"function",
"_sort",
"(",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"_sorts",
")",
"||",
"count",
"(",
"$",
"this",
"->",
"_sorts",
")",
"===",
"0",
")",
"{",
"return",
";",
"}",
"$",
"columns",
"=",
"$",
"this",
"... | Performs an array_multisort, based on the sorts defined | [
"Performs",
"an",
"array_multisort",
"based",
"on",
"the",
"sorts",
"defined"
] | train | https://github.com/romainbessugesmeusy/php-datagrid/blob/18f7ae15845fcf61520bbfc946771242bf1091c9/library/RBM/Datagrid/Data/Processor/ArrayProcessor.php#L72-L104 |
romainbessugesmeusy/php-datagrid | library/RBM/Datagrid/Data/Processor/ArrayProcessor.php | ArrayProcessor._truncate | protected function _truncate()
{
if (!$this->getLimit()->isNull()) {
if (is_null($this->getLimit()->getCount())) {
$this->_output = array_splice($this->_output, $this->getLimit()->getStart());
} else {
$this->_output = array_splice($this->_output, $thi... | php | protected function _truncate()
{
if (!$this->getLimit()->isNull()) {
if (is_null($this->getLimit()->getCount())) {
$this->_output = array_splice($this->_output, $this->getLimit()->getStart());
} else {
$this->_output = array_splice($this->_output, $thi... | [
"protected",
"function",
"_truncate",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"getLimit",
"(",
")",
"->",
"isNull",
"(",
")",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"getLimit",
"(",
")",
"->",
"getCount",
"(",
")",
")",... | Simply splice the array | [
"Simply",
"splice",
"the",
"array"
] | train | https://github.com/romainbessugesmeusy/php-datagrid/blob/18f7ae15845fcf61520bbfc946771242bf1091c9/library/RBM/Datagrid/Data/Processor/ArrayProcessor.php#L109-L118 |
gdbots/iam-php | src/RevokeRolesFromAppHandler.php | RevokeRolesFromAppHandler.createAppRolesRevoked | protected function createAppRolesRevoked(RevokeRolesFromApp $command, Pbjx $pbjx): AppRolesRevoked
{
/** @var AppRolesRevoked $event */
$event = AppRolesRevokedV1Mixin::findOne()->createMessage();
return $event;
} | php | protected function createAppRolesRevoked(RevokeRolesFromApp $command, Pbjx $pbjx): AppRolesRevoked
{
/** @var AppRolesRevoked $event */
$event = AppRolesRevokedV1Mixin::findOne()->createMessage();
return $event;
} | [
"protected",
"function",
"createAppRolesRevoked",
"(",
"RevokeRolesFromApp",
"$",
"command",
",",
"Pbjx",
"$",
"pbjx",
")",
":",
"AppRolesRevoked",
"{",
"/** @var AppRolesRevoked $event */",
"$",
"event",
"=",
"AppRolesRevokedV1Mixin",
"::",
"findOne",
"(",
")",
"->",... | @param RevokeRolesFromApp $command
@param Pbjx $pbjx
@return AppRolesRevoked | [
"@param",
"RevokeRolesFromApp",
"$command",
"@param",
"Pbjx",
"$pbjx"
] | train | https://github.com/gdbots/iam-php/blob/3dbfa602de183a7ac5fb5140304e8cf4c4b15ab3/src/RevokeRolesFromAppHandler.php#L68-L73 |
ekuiter/feature-php | FeaturePhp/Model/ConstraintSolver.php | ConstraintSolver.mandatory | private static function mandatory($feature) {
if ($feature->getParent() && $feature->getMandatory())
return Logic::equiv(Logic::is($feature), Logic::is($feature->getParent()));
} | php | private static function mandatory($feature) {
if ($feature->getParent() && $feature->getMandatory())
return Logic::equiv(Logic::is($feature), Logic::is($feature->getParent()));
} | [
"private",
"static",
"function",
"mandatory",
"(",
"$",
"feature",
")",
"{",
"if",
"(",
"$",
"feature",
"->",
"getParent",
"(",
")",
"&&",
"$",
"feature",
"->",
"getMandatory",
"(",
")",
")",
"return",
"Logic",
"::",
"equiv",
"(",
"Logic",
"::",
"is",
... | Semantics for a mandatory feature.
A mandatory feature is selected iff its parent is selected.
@param Feature $feature
@return callable | [
"Semantics",
"for",
"a",
"mandatory",
"feature",
".",
"A",
"mandatory",
"feature",
"is",
"selected",
"iff",
"its",
"parent",
"is",
"selected",
"."
] | train | https://github.com/ekuiter/feature-php/blob/daf4a59098802fedcfd1f1a1d07847fcf2fea7bf/FeaturePhp/Model/ConstraintSolver.php#L117-L120 |
ekuiter/feature-php | FeaturePhp/Model/ConstraintSolver.php | ConstraintSolver.optional | private static function optional($feature) {
if ($feature->getParent())
return Logic::implies(Logic::is($feature), Logic::is($feature->getParent()));
} | php | private static function optional($feature) {
if ($feature->getParent())
return Logic::implies(Logic::is($feature), Logic::is($feature->getParent()));
} | [
"private",
"static",
"function",
"optional",
"(",
"$",
"feature",
")",
"{",
"if",
"(",
"$",
"feature",
"->",
"getParent",
"(",
")",
")",
"return",
"Logic",
"::",
"implies",
"(",
"Logic",
"::",
"is",
"(",
"$",
"feature",
")",
",",
"Logic",
"::",
"is",... | Semantics for an optional feature.
If an optional feature is selected, its parent is selected.
@param Feature $feature
@return callable | [
"Semantics",
"for",
"an",
"optional",
"feature",
".",
"If",
"an",
"optional",
"feature",
"is",
"selected",
"its",
"parent",
"is",
"selected",
"."
] | train | https://github.com/ekuiter/feature-php/blob/daf4a59098802fedcfd1f1a1d07847fcf2fea7bf/FeaturePhp/Model/ConstraintSolver.php#L128-L131 |
ekuiter/feature-php | FeaturePhp/Model/ConstraintSolver.php | ConstraintSolver.alternative | private static function alternative($feature) {
if ($feature->getAlternative()) {
$children = array();
foreach ($feature->getChildren() as $child)
$children[] = Logic::is($child);
$alternativeConstraints = array();
for ($i = 0; $i < count($childre... | php | private static function alternative($feature) {
if ($feature->getAlternative()) {
$children = array();
foreach ($feature->getChildren() as $child)
$children[] = Logic::is($child);
$alternativeConstraints = array();
for ($i = 0; $i < count($childre... | [
"private",
"static",
"function",
"alternative",
"(",
"$",
"feature",
")",
"{",
"if",
"(",
"$",
"feature",
"->",
"getAlternative",
"(",
")",
")",
"{",
"$",
"children",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"feature",
"->",
"getChildren",
"("... | Semantics for a feature that provides an alternative choice.
Exactly one child of such a feature is selected.
@param Feature $feature
@return callable | [
"Semantics",
"for",
"a",
"feature",
"that",
"provides",
"an",
"alternative",
"choice",
".",
"Exactly",
"one",
"child",
"of",
"such",
"a",
"feature",
"is",
"selected",
"."
] | train | https://github.com/ekuiter/feature-php/blob/daf4a59098802fedcfd1f1a1d07847fcf2fea7bf/FeaturePhp/Model/ConstraintSolver.php#L139-L154 |
ekuiter/feature-php | FeaturePhp/Model/ConstraintSolver.php | ConstraintSolver._or | private static function _or($feature) {
if ($feature->getOr()) {
$children = array();
foreach ($feature->getChildren() as $child)
$children[] = Logic::is($child);
return Logic::equiv(Logic::is($feature),
call_user_func_array("\F... | php | private static function _or($feature) {
if ($feature->getOr()) {
$children = array();
foreach ($feature->getChildren() as $child)
$children[] = Logic::is($child);
return Logic::equiv(Logic::is($feature),
call_user_func_array("\F... | [
"private",
"static",
"function",
"_or",
"(",
"$",
"feature",
")",
"{",
"if",
"(",
"$",
"feature",
"->",
"getOr",
"(",
")",
")",
"{",
"$",
"children",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"feature",
"->",
"getChildren",
"(",
")",
"as",
... | Semantics for a feature that provides a choice using an inclusive or.
At least one child of such a feature is selected.
@param Feature $feature
@return callable | [
"Semantics",
"for",
"a",
"feature",
"that",
"provides",
"a",
"choice",
"using",
"an",
"inclusive",
"or",
".",
"At",
"least",
"one",
"child",
"of",
"such",
"a",
"feature",
"is",
"selected",
"."
] | train | https://github.com/ekuiter/feature-php/blob/daf4a59098802fedcfd1f1a1d07847fcf2fea7bf/FeaturePhp/Model/ConstraintSolver.php#L162-L170 |
ekuiter/feature-php | FeaturePhp/Model/ConstraintSolver.php | ConstraintSolver.crossTreeConstraint | private function crossTreeConstraint($rule) {
$op = $rule->getName();
$num = $rule->count();
if ($op === "eq" && $num === 2)
return Logic::equiv($this->crossTreeConstraint($rule->children()[0]),
$this->crossTreeConstraint($rule->children()[1]));
... | php | private function crossTreeConstraint($rule) {
$op = $rule->getName();
$num = $rule->count();
if ($op === "eq" && $num === 2)
return Logic::equiv($this->crossTreeConstraint($rule->children()[0]),
$this->crossTreeConstraint($rule->children()[1]));
... | [
"private",
"function",
"crossTreeConstraint",
"(",
"$",
"rule",
")",
"{",
"$",
"op",
"=",
"$",
"rule",
"->",
"getName",
"(",
")",
";",
"$",
"num",
"=",
"$",
"rule",
"->",
"count",
"(",
")",
";",
"if",
"(",
"$",
"op",
"===",
"\"eq\"",
"&&",
"$",
... | Transforms a cross-tree constraint from an XML rule to a formula.
@param \SimpleXMLElement $rule
@return callable | [
"Transforms",
"a",
"cross",
"-",
"tree",
"constraint",
"from",
"an",
"XML",
"rule",
"to",
"a",
"formula",
"."
] | train | https://github.com/ekuiter/feature-php/blob/daf4a59098802fedcfd1f1a1d07847fcf2fea7bf/FeaturePhp/Model/ConstraintSolver.php#L177-L199 |
heidelpay/PhpDoc | src/phpDocumentor/Plugin/Core/Descriptor/Validator/ValidatorAbstract.php | ValidatorAbstract.dispatch | public function dispatch($name, $event)
{
if (!$this->event_dispatcher) {
return null;
}
if (!$this->event_dispatcher instanceof Dispatcher) {
throw new \Exception(
'Expected the event dispatcher to be an instance of phpDocumentor\Event\Dispatcher'
... | php | public function dispatch($name, $event)
{
if (!$this->event_dispatcher) {
return null;
}
if (!$this->event_dispatcher instanceof Dispatcher) {
throw new \Exception(
'Expected the event dispatcher to be an instance of phpDocumentor\Event\Dispatcher'
... | [
"public",
"function",
"dispatch",
"(",
"$",
"name",
",",
"$",
"event",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"event_dispatcher",
")",
"{",
"return",
"null",
";",
"}",
"if",
"(",
"!",
"$",
"this",
"->",
"event_dispatcher",
"instanceof",
"Dispatch... | Dispatches an event to the Event Dispatcher.
This method tries to dispatch an event; if no Event Dispatcher has been
set than this method will explicitly not fail and return null.
By not failing we make the Event Dispatcher optional and is it easier
for people to re-use this component in their own application.
@para... | [
"Dispatches",
"an",
"event",
"to",
"the",
"Event",
"Dispatcher",
"."
] | train | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Plugin/Core/Descriptor/Validator/ValidatorAbstract.php#L115-L128 |
heidelpay/PhpDoc | src/phpDocumentor/Plugin/Core/Descriptor/Validator/ValidatorAbstract.php | ValidatorAbstract.logParserError | public function logParserError($type, $code, $line, $variables = array())
{
$message = $this->__($code, $variables);
$this->log($message, LogLevel::ERROR);
$this->dispatch(
'parser.log',
LogEvent::createInstance($this)
->setMessage($message)
... | php | public function logParserError($type, $code, $line, $variables = array())
{
$message = $this->__($code, $variables);
$this->log($message, LogLevel::ERROR);
$this->dispatch(
'parser.log',
LogEvent::createInstance($this)
->setMessage($message)
... | [
"public",
"function",
"logParserError",
"(",
"$",
"type",
",",
"$",
"code",
",",
"$",
"line",
",",
"$",
"variables",
"=",
"array",
"(",
")",
")",
"{",
"$",
"message",
"=",
"$",
"this",
"->",
"__",
"(",
"$",
"code",
",",
"$",
"variables",
")",
";"... | Dispatches a parser error to be logged.
@param string $type The logging priority as string
@param string $code The message to log.
@param string $line The line number where the error occurred..
@param string[] $variables an array with message substitution variables.
@return void | [
"Dispatches",
"a",
"parser",
"error",
"to",
"be",
"logged",
"."
] | train | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Plugin/Core/Descriptor/Validator/ValidatorAbstract.php#L158-L170 |
heidelpay/PhpDoc | src/phpDocumentor/Plugin/Core/Descriptor/Validator/ValidatorAbstract.php | ValidatorAbstract.__ | public function __($message, $variables = array())
{
if (!$this->translate) {
return vsprintf($message, $variables);
}
$translator = $this->translate;
return vsprintf($translator->translate($message), $variables);
} | php | public function __($message, $variables = array())
{
if (!$this->translate) {
return vsprintf($message, $variables);
}
$translator = $this->translate;
return vsprintf($translator->translate($message), $variables);
} | [
"public",
"function",
"__",
"(",
"$",
"message",
",",
"$",
"variables",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"translate",
")",
"{",
"return",
"vsprintf",
"(",
"$",
"message",
",",
"$",
"variables",
")",
";",
"}",
"... | Translates the ID or message in the given language.
Translation messages may contain any formatting as used by the php
vsprintf function.
@param string $message ID or message to translate.
@param array $variables Variables to use for substitution.
@codingStandardsIgnoreStart
@return string | [
"Translates",
"the",
"ID",
"or",
"message",
"in",
"the",
"given",
"language",
"."
] | train | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Plugin/Core/Descriptor/Validator/ValidatorAbstract.php#L196-L205 |
alevilar/ristorantino-vendor | Printers/Lib/PrinterOutput/CupsPrinterOutput.php | CupsPrinterOutput.send | public function send( $printaitorViewObj ) {
$texto = $printaitorViewObj->viewTextRender;
$idFiscalPrinter = $printaitorViewObj->printerId;
$hostname = $printaitorViewObj->hostName;
if ( empty($hostname) ) {
$hostname = Configure::read('Print... | php | public function send( $printaitorViewObj ) {
$texto = $printaitorViewObj->viewTextRender;
$idFiscalPrinter = $printaitorViewObj->printerId;
$hostname = $printaitorViewObj->hostName;
if ( empty($hostname) ) {
$hostname = Configure::read('Print... | [
"public",
"function",
"send",
"(",
"$",
"printaitorViewObj",
")",
"{",
"$",
"texto",
"=",
"$",
"printaitorViewObj",
"->",
"viewTextRender",
";",
"$",
"idFiscalPrinter",
"=",
"$",
"printaitorViewObj",
"->",
"printerId",
";",
"$",
"hostname",
"=",
"$",
"printait... | Comando cups de impresion
@param PrintaitorViewObj
@return type boolean true si salio todo bien false caso contrario | [
"Comando",
"cups",
"de",
"impresion"
] | train | https://github.com/alevilar/ristorantino-vendor/blob/6b91a1e20cc0ba09a1968d77e3de6512cfa2d966/Printers/Lib/PrinterOutput/CupsPrinterOutput.php#L37-L93 |
php-lug/lug | src/Bundle/GridBundle/Model/Filter.php | Filter.getFormOption | public function getFormOption($name)
{
if (!$this->hasFormOption($name)) {
throw new OptionNotFoundException(sprintf('The filter form option "%s" could not be found.', $name));
}
return $this->formOptions[$name];
} | php | public function getFormOption($name)
{
if (!$this->hasFormOption($name)) {
throw new OptionNotFoundException(sprintf('The filter form option "%s" could not be found.', $name));
}
return $this->formOptions[$name];
} | [
"public",
"function",
"getFormOption",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"hasFormOption",
"(",
"$",
"name",
")",
")",
"{",
"throw",
"new",
"OptionNotFoundException",
"(",
"sprintf",
"(",
"'The filter form option \"%s\" could not be f... | {@inheritdoc} | [
"{"
] | train | https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Bundle/GridBundle/Model/Filter.php#L83-L90 |
syzygypl/page-media-set-bundle | Service/PageMediaSetService.php | PageMediaSetService.getPageMediaSet | private function getPageMediaSet(HasMediaSetInterface $page)
{
if (false === $this->preloadedMediaSets) {
$data = $this->repository
->createQueryBuilder('pm')
->join(Media::class, 'media', Join::WITH, 'pm.media = media.id')
->select(['pm.pageType',... | php | private function getPageMediaSet(HasMediaSetInterface $page)
{
if (false === $this->preloadedMediaSets) {
$data = $this->repository
->createQueryBuilder('pm')
->join(Media::class, 'media', Join::WITH, 'pm.media = media.id')
->select(['pm.pageType',... | [
"private",
"function",
"getPageMediaSet",
"(",
"HasMediaSetInterface",
"$",
"page",
")",
"{",
"if",
"(",
"false",
"===",
"$",
"this",
"->",
"preloadedMediaSets",
")",
"{",
"$",
"data",
"=",
"$",
"this",
"->",
"repository",
"->",
"createQueryBuilder",
"(",
"'... | @param HasMediaSetInterface $page
@return PageMedia[] | [
"@param",
"HasMediaSetInterface",
"$page"
] | train | https://github.com/syzygypl/page-media-set-bundle/blob/013d5321518755b07d292d63d5b3f1ddeb635107/Service/PageMediaSetService.php#L56-L78 |
mothership-ec/composer | src/Composer/IO/BaseIO.php | BaseIO.loadConfiguration | public function loadConfiguration(Config $config)
{
// reload oauth token from config if available
if ($tokens = $config->get('github-oauth')) {
foreach ($tokens as $domain => $token) {
if (!preg_match('{^[a-z0-9]+$}', $token)) {
throw new \UnexpectedV... | php | public function loadConfiguration(Config $config)
{
// reload oauth token from config if available
if ($tokens = $config->get('github-oauth')) {
foreach ($tokens as $domain => $token) {
if (!preg_match('{^[a-z0-9]+$}', $token)) {
throw new \UnexpectedV... | [
"public",
"function",
"loadConfiguration",
"(",
"Config",
"$",
"config",
")",
"{",
"// reload oauth token from config if available",
"if",
"(",
"$",
"tokens",
"=",
"$",
"config",
"->",
"get",
"(",
"'github-oauth'",
")",
")",
"{",
"foreach",
"(",
"$",
"tokens",
... | {@inheritDoc} | [
"{"
] | train | https://github.com/mothership-ec/composer/blob/fa6ad031a939d8d33b211e428fdbdd28cfce238c/src/Composer/IO/BaseIO.php#L61-L82 |
gdbots/iam-php | src/Util/AppPbjxHelperTrait.php | AppPbjxHelperTrait.createEventFromCommand | protected function createEventFromCommand(Command $command, string $suffix): Event
{
$curie = $command::schema()->getCurie();
$eventCurie = "{$curie->getVendor()}:{$curie->getPackage()}:event:app-{$suffix}";
/** @var Event $class */
$class = MessageResolver::resolveCurie(SchemaCurie... | php | protected function createEventFromCommand(Command $command, string $suffix): Event
{
$curie = $command::schema()->getCurie();
$eventCurie = "{$curie->getVendor()}:{$curie->getPackage()}:event:app-{$suffix}";
/** @var Event $class */
$class = MessageResolver::resolveCurie(SchemaCurie... | [
"protected",
"function",
"createEventFromCommand",
"(",
"Command",
"$",
"command",
",",
"string",
"$",
"suffix",
")",
":",
"Event",
"{",
"$",
"curie",
"=",
"$",
"command",
"::",
"schema",
"(",
")",
"->",
"getCurie",
"(",
")",
";",
"$",
"eventCurie",
"=",... | @param Command $command
@param string $suffix
@return Event | [
"@param",
"Command",
"$command",
"@param",
"string",
"$suffix"
] | train | https://github.com/gdbots/iam-php/blob/3dbfa602de183a7ac5fb5140304e8cf4c4b15ab3/src/Util/AppPbjxHelperTrait.php#L31-L39 |
gordalina/mangopay-php | src/Gordalina/Mangopay/Request/RequestModel.php | RequestModel.handle | public function handle(ResponseInterface $response)
{
$class = get_class($this->model);
$model = new $class();
$model->jsonUnserialize($response->getBody());
$response->setModel($model);
} | php | public function handle(ResponseInterface $response)
{
$class = get_class($this->model);
$model = new $class();
$model->jsonUnserialize($response->getBody());
$response->setModel($model);
} | [
"public",
"function",
"handle",
"(",
"ResponseInterface",
"$",
"response",
")",
"{",
"$",
"class",
"=",
"get_class",
"(",
"$",
"this",
"->",
"model",
")",
";",
"$",
"model",
"=",
"new",
"$",
"class",
"(",
")",
";",
"$",
"model",
"->",
"jsonUnserialize"... | {@inheritdoc} | [
"{"
] | train | https://github.com/gordalina/mangopay-php/blob/6807992416d964e25670d961b66dbccd7a46ef62/src/Gordalina/Mangopay/Request/RequestModel.php#L35-L43 |
MASNathan/Parser | src/Data/Content.php | Content.from | public function from($type)
{
switch ($type) {
case 'ini':
$this->data = Ini::decode($this->string);
break;
case 'json':
$this->data = Json::decode($this->string);
break;
case 'php':
$this->... | php | public function from($type)
{
switch ($type) {
case 'ini':
$this->data = Ini::decode($this->string);
break;
case 'json':
$this->data = Json::decode($this->string);
break;
case 'php':
$this->... | [
"public",
"function",
"from",
"(",
"$",
"type",
")",
"{",
"switch",
"(",
"$",
"type",
")",
"{",
"case",
"'ini'",
":",
"$",
"this",
"->",
"data",
"=",
"Ini",
"::",
"decode",
"(",
"$",
"this",
"->",
"string",
")",
";",
"break",
";",
"case",
"'json'... | Specifies the structure type which the content will be parsed from
@param string $type Type [ini, json, php, xml or yaml]
@return Content | [
"Specifies",
"the",
"structure",
"type",
"which",
"the",
"content",
"will",
"be",
"parsed",
"from"
] | train | https://github.com/MASNathan/Parser/blob/0f55402b99b1e071bdcd6277b9268f783ca25e34/src/Data/Content.php#L82-L111 |
MASNathan/Parser | src/Data/Content.php | Content.to | public function to($type)
{
switch ($type) {
case 'ini':
$this->string = Ini::encode($this->data);
break;
case 'json':
$this->string = Json::encode($this->data, $this->prettyOutput);
break;
case 'php':
... | php | public function to($type)
{
switch ($type) {
case 'ini':
$this->string = Ini::encode($this->data);
break;
case 'json':
$this->string = Json::encode($this->data, $this->prettyOutput);
break;
case 'php':
... | [
"public",
"function",
"to",
"(",
"$",
"type",
")",
"{",
"switch",
"(",
"$",
"type",
")",
"{",
"case",
"'ini'",
":",
"$",
"this",
"->",
"string",
"=",
"Ini",
"::",
"encode",
"(",
"$",
"this",
"->",
"data",
")",
";",
"break",
";",
"case",
"'json'",... | Specifies the format you want to encode the data to
@param string $type Type [ini, json, php, xml or yaml]
@return string | [
"Specifies",
"the",
"format",
"you",
"want",
"to",
"encode",
"the",
"data",
"to"
] | train | https://github.com/MASNathan/Parser/blob/0f55402b99b1e071bdcd6277b9268f783ca25e34/src/Data/Content.php#L118-L147 |
99designs/ergo-http | src/Request.php | Request.copy | public function copy($headers = false, $body = false, $url = false, $method = false)
{
$copy = clone $this;
if ($headers !== false) $copy->_headers = new HeaderCollection($headers);
if ($body !== false) $copy->_body = $body;
if ($url !== false) $copy->_url = $url;
if ($metho... | php | public function copy($headers = false, $body = false, $url = false, $method = false)
{
$copy = clone $this;
if ($headers !== false) $copy->_headers = new HeaderCollection($headers);
if ($body !== false) $copy->_body = $body;
if ($url !== false) $copy->_url = $url;
if ($metho... | [
"public",
"function",
"copy",
"(",
"$",
"headers",
"=",
"false",
",",
"$",
"body",
"=",
"false",
",",
"$",
"url",
"=",
"false",
",",
"$",
"method",
"=",
"false",
")",
"{",
"$",
"copy",
"=",
"clone",
"$",
"this",
";",
"if",
"(",
"$",
"headers",
... | Creates a new Request object with the parameters specified, or uses
the current object's parameters
@return object | [
"Creates",
"a",
"new",
"Request",
"object",
"with",
"the",
"parameters",
"specified",
"or",
"uses",
"the",
"current",
"object",
"s",
"parameters"
] | train | https://github.com/99designs/ergo-http/blob/979b789f2e011a1cb70a00161e6b7bcd0d2e9c71/src/Request.php#L87-L99 |
kouks/laravel-filters | src/Filters/Filter.php | Filter.apply | public function apply(Builder $builder)
{
$this->builder = $builder;
// We need to select all columns from the original
// table, since many joins can mess up the selected fields
$this->builder->select("{$this->getTableName()}.*");
foreach ($this->filters() as $name => $val... | php | public function apply(Builder $builder)
{
$this->builder = $builder;
// We need to select all columns from the original
// table, since many joins can mess up the selected fields
$this->builder->select("{$this->getTableName()}.*");
foreach ($this->filters() as $name => $val... | [
"public",
"function",
"apply",
"(",
"Builder",
"$",
"builder",
")",
"{",
"$",
"this",
"->",
"builder",
"=",
"$",
"builder",
";",
"// We need to select all columns from the original",
"// table, since many joins can mess up the selected fields",
"$",
"this",
"->",
"builder... | Applies all available filters.
@param \Illuminate\Database\Eloquent\Builder $builder
@return \Illuminate\Database\Eloquent\Builder | [
"Applies",
"all",
"available",
"filters",
"."
] | train | https://github.com/kouks/laravel-filters/blob/c1a594fd40173dcbb454ea7ec59818a919fff6bd/src/Filters/Filter.php#L66-L79 |
kouks/laravel-filters | src/Filters/Filter.php | Filter.resolve | protected function resolve($column, $key, $last, callable $callback)
{
if (! strpos($column, '.')) {
return $callback("{$last}.{$column}", $key);
}
$scope = strstr($column, '.', true);
$singular = str_singular($scope);
$next = substr(strstr($column, '.'), 1);
... | php | protected function resolve($column, $key, $last, callable $callback)
{
if (! strpos($column, '.')) {
return $callback("{$last}.{$column}", $key);
}
$scope = strstr($column, '.', true);
$singular = str_singular($scope);
$next = substr(strstr($column, '.'), 1);
... | [
"protected",
"function",
"resolve",
"(",
"$",
"column",
",",
"$",
"key",
",",
"$",
"last",
",",
"callable",
"$",
"callback",
")",
"{",
"if",
"(",
"!",
"strpos",
"(",
"$",
"column",
",",
"'.'",
")",
")",
"{",
"return",
"$",
"callback",
"(",
"\"{$las... | Recursively build up the query.
@param string $column
@param string $key
@param string $last
@param callable $callback
@return void | [
"Recursively",
"build",
"up",
"the",
"query",
"."
] | train | https://github.com/kouks/laravel-filters/blob/c1a594fd40173dcbb454ea7ec59818a919fff6bd/src/Filters/Filter.php#L121-L138 |
songshenzong/log | src/Middleware.php | Middleware.handle | public function handle($request, Closure $next)
{
try {
$response = $next($request);
} catch (Exception $e) {
$response = $this->handleException($request, $e);
} catch (Error $error) {
$e = new FatalThrowableError($error);
$response = $t... | php | public function handle($request, Closure $next)
{
try {
$response = $next($request);
} catch (Exception $e) {
$response = $this->handleException($request, $e);
} catch (Error $error) {
$e = new FatalThrowableError($error);
$response = $t... | [
"public",
"function",
"handle",
"(",
"$",
"request",
",",
"Closure",
"$",
"next",
")",
"{",
"try",
"{",
"$",
"response",
"=",
"$",
"next",
"(",
"$",
"request",
")",
";",
"}",
"catch",
"(",
"Exception",
"$",
"e",
")",
"{",
"$",
"response",
"=",
"$... | Handle an incoming request.
@param Request $request
@param Closure $next
@return mixed
@throws DebugBarException
@throws Exception | [
"Handle",
"an",
"incoming",
"request",
"."
] | train | https://github.com/songshenzong/log/blob/b1e01f7994da47737866eabf82367490eab17c46/src/Middleware.php#L55-L70 |
giftcards/Encryption | Form/Type/Extension/EncryptTypeExtension.php | EncryptTypeExtension.buildForm | public function buildForm(FormBuilderInterface $builder, array $options)
{
if ($options['encryption_profile'] === false) {
return;
}
$builder->addModelTransformer(new EncryptTransformer(
$this->cipherTextGenerator,
$options['encryption_profile']
... | php | public function buildForm(FormBuilderInterface $builder, array $options)
{
if ($options['encryption_profile'] === false) {
return;
}
$builder->addModelTransformer(new EncryptTransformer(
$this->cipherTextGenerator,
$options['encryption_profile']
... | [
"public",
"function",
"buildForm",
"(",
"FormBuilderInterface",
"$",
"builder",
",",
"array",
"$",
"options",
")",
"{",
"if",
"(",
"$",
"options",
"[",
"'encryption_profile'",
"]",
"===",
"false",
")",
"{",
"return",
";",
"}",
"$",
"builder",
"->",
"addMod... | Builds the form.
This method is called after the extended type has built the form to
further modify it.
@see FormTypeInterface::buildForm()
@param FormBuilderInterface $builder The form builder
@param array $options The options | [
"Builds",
"the",
"form",
"."
] | train | https://github.com/giftcards/Encryption/blob/a48f92408538e2ffe1c8603f168d57803aad7100/Form/Type/Extension/EncryptTypeExtension.php#L41-L51 |
technote-space/wordpress-plugin-base | src/traits/presenter.php | Presenter.get_view | public function get_view( $name, $args = [], $echo = false, $error = true, $remove_nl = false ) {
$name = trim( $name, '/' . DS );
$name = str_replace( '/', DS, $name );
$name .= '.php';
$path = null;
foreach ( $this->get_check_view_dirs() as $dir ) {
$dir = rtrim( $dir, DS . '/' );
if ( is_readable( $d... | php | public function get_view( $name, $args = [], $echo = false, $error = true, $remove_nl = false ) {
$name = trim( $name, '/' . DS );
$name = str_replace( '/', DS, $name );
$name .= '.php';
$path = null;
foreach ( $this->get_check_view_dirs() as $dir ) {
$dir = rtrim( $dir, DS . '/' );
if ( is_readable( $d... | [
"public",
"function",
"get_view",
"(",
"$",
"name",
",",
"$",
"args",
"=",
"[",
"]",
",",
"$",
"echo",
"=",
"false",
",",
"$",
"error",
"=",
"true",
",",
"$",
"remove_nl",
"=",
"false",
")",
"{",
"$",
"name",
"=",
"trim",
"(",
"$",
"name",
",",... | @param string $name
@param array $args
@param bool $echo
@param bool $error
@param bool $remove_nl
@return string | [
"@param",
"string",
"$name",
"@param",
"array",
"$args",
"@param",
"bool",
"$echo",
"@param",
"bool",
"$error",
"@param",
"bool",
"$remove_nl"
] | train | https://github.com/technote-space/wordpress-plugin-base/blob/02cfcba358432a2539af07a69d9db00ff7c14eac/src/traits/presenter.php#L59-L96 |
technote-space/wordpress-plugin-base | src/traits/presenter.php | Presenter.get_presenter_args | private function get_presenter_args( $args ) {
$args['field'] = array_merge( $this->app->utility->array_get( $args, 'field', [] ), $this->app->input->all() );
if ( $this instanceof \Technote\Interfaces\Nonce ) {
$args['nonce_key'] = $this->get_nonce_key();
$args['nonce_value'] = $this->create_nonce();
}
... | php | private function get_presenter_args( $args ) {
$args['field'] = array_merge( $this->app->utility->array_get( $args, 'field', [] ), $this->app->input->all() );
if ( $this instanceof \Technote\Interfaces\Nonce ) {
$args['nonce_key'] = $this->get_nonce_key();
$args['nonce_value'] = $this->create_nonce();
}
... | [
"private",
"function",
"get_presenter_args",
"(",
"$",
"args",
")",
"{",
"$",
"args",
"[",
"'field'",
"]",
"=",
"array_merge",
"(",
"$",
"this",
"->",
"app",
"->",
"utility",
"->",
"array_get",
"(",
"$",
"args",
",",
"'field'",
",",
"[",
"]",
")",
",... | @param array $args
@return array | [
"@param",
"array",
"$args"
] | train | https://github.com/technote-space/wordpress-plugin-base/blob/02cfcba358432a2539af07a69d9db00ff7c14eac/src/traits/presenter.php#L110-L123 |
technote-space/wordpress-plugin-base | src/traits/presenter.php | Presenter.form | public function form( $name, $args = [], $overwrite = [], $echo = true, $error = true ) {
return $this->get_view( 'include/form/' . trim( $name, '/' . DS ), array_replace_recursive( $args, $overwrite ), $echo, $error );
} | php | public function form( $name, $args = [], $overwrite = [], $echo = true, $error = true ) {
return $this->get_view( 'include/form/' . trim( $name, '/' . DS ), array_replace_recursive( $args, $overwrite ), $echo, $error );
} | [
"public",
"function",
"form",
"(",
"$",
"name",
",",
"$",
"args",
"=",
"[",
"]",
",",
"$",
"overwrite",
"=",
"[",
"]",
",",
"$",
"echo",
"=",
"true",
",",
"$",
"error",
"=",
"true",
")",
"{",
"return",
"$",
"this",
"->",
"get_view",
"(",
"'incl... | @param string $name
@param array $args
@param array $overwrite
@param bool $echo
@param bool $error
@return string | [
"@param",
"string",
"$name",
"@param",
"array",
"$args",
"@param",
"array",
"$overwrite",
"@param",
"bool",
"$echo",
"@param",
"bool",
"$error"
] | train | https://github.com/technote-space/wordpress-plugin-base/blob/02cfcba358432a2539af07a69d9db00ff7c14eac/src/traits/presenter.php#L143-L145 |
technote-space/wordpress-plugin-base | src/traits/presenter.php | Presenter.old | public function old( $name, $data, $key = null, $default = '', $checkbox = false ) {
if ( is_array( $data ) ) {
$default = $this->app->utility->array_get( $data, $key, $default );
} elseif ( $data instanceof \stdClass ) {
$default = property_exists( $data, $key ) ? $data->$key : $default;
} elseif ( ! isset... | php | public function old( $name, $data, $key = null, $default = '', $checkbox = false ) {
if ( is_array( $data ) ) {
$default = $this->app->utility->array_get( $data, $key, $default );
} elseif ( $data instanceof \stdClass ) {
$default = property_exists( $data, $key ) ? $data->$key : $default;
} elseif ( ! isset... | [
"public",
"function",
"old",
"(",
"$",
"name",
",",
"$",
"data",
",",
"$",
"key",
"=",
"null",
",",
"$",
"default",
"=",
"''",
",",
"$",
"checkbox",
"=",
"false",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"data",
")",
")",
"{",
"$",
"default",... | @param string $name
@param mixed $data
@param string|null $key
@param string $default
@param bool $checkbox
@return mixed | [
"@param",
"string",
"$name",
"@param",
"mixed",
"$data",
"@param",
"string|null",
"$key",
"@param",
"string",
"$default",
"@param",
"bool",
"$checkbox"
] | train | https://github.com/technote-space/wordpress-plugin-base/blob/02cfcba358432a2539af07a69d9db00ff7c14eac/src/traits/presenter.php#L156-L176 |
technote-space/wordpress-plugin-base | src/traits/presenter.php | Presenter.h | public function h( $value, $translate = false, $echo = true, $escape = true, ...$args ) {
if ( $translate ) {
$value = $this->app->translate( $value );
}
if ( ! empty( $args ) ) {
$value = sprintf( $value, ...$args );
}
if ( $escape ) {
$value = esc_html( $value );
$value = nl2br( $value );
}
... | php | public function h( $value, $translate = false, $echo = true, $escape = true, ...$args ) {
if ( $translate ) {
$value = $this->app->translate( $value );
}
if ( ! empty( $args ) ) {
$value = sprintf( $value, ...$args );
}
if ( $escape ) {
$value = esc_html( $value );
$value = nl2br( $value );
}
... | [
"public",
"function",
"h",
"(",
"$",
"value",
",",
"$",
"translate",
"=",
"false",
",",
"$",
"echo",
"=",
"true",
",",
"$",
"escape",
"=",
"true",
",",
"...",
"$",
"args",
")",
"{",
"if",
"(",
"$",
"translate",
")",
"{",
"$",
"value",
"=",
"$",... | @param string $value
@param bool $translate
@param bool $echo
@param bool $escape
@param array $args
@return string | [
"@param",
"string",
"$value",
"@param",
"bool",
"$translate",
"@param",
"bool",
"$echo",
"@param",
"bool",
"$escape",
"@param",
"array",
"$args"
] | train | https://github.com/technote-space/wordpress-plugin-base/blob/02cfcba358432a2539af07a69d9db00ff7c14eac/src/traits/presenter.php#L238-L254 |
technote-space/wordpress-plugin-base | src/traits/presenter.php | Presenter.url | public function url( $url, $contents, $translate = false, $new_tab = false, $args = [], $echo = true, $escape = true ) {
$overwrite = [
'href' => $url,
'contents' => $this->h( $contents, $translate, false, $escape ),
];
if ( $new_tab ) {
$overwrite['target'] = '_blank';
}
return $this->get_view(... | php | public function url( $url, $contents, $translate = false, $new_tab = false, $args = [], $echo = true, $escape = true ) {
$overwrite = [
'href' => $url,
'contents' => $this->h( $contents, $translate, false, $escape ),
];
if ( $new_tab ) {
$overwrite['target'] = '_blank';
}
return $this->get_view(... | [
"public",
"function",
"url",
"(",
"$",
"url",
",",
"$",
"contents",
",",
"$",
"translate",
"=",
"false",
",",
"$",
"new_tab",
"=",
"false",
",",
"$",
"args",
"=",
"[",
"]",
",",
"$",
"echo",
"=",
"true",
",",
"$",
"escape",
"=",
"true",
")",
"{... | @param string $url
@param string $contents
@param bool $translate
@param bool $new_tab
@param array $args
@param bool $echo
@param bool $escape
@return string | [
"@param",
"string",
"$url",
"@param",
"string",
"$contents",
"@param",
"bool",
"$translate",
"@param",
"bool",
"$new_tab",
"@param",
"array",
"$args",
"@param",
"bool",
"$echo",
"@param",
"bool",
"$escape"
] | train | https://github.com/technote-space/wordpress-plugin-base/blob/02cfcba358432a2539af07a69d9db00ff7c14eac/src/traits/presenter.php#L310-L320 |
technote-space/wordpress-plugin-base | src/traits/presenter.php | Presenter.get_assets_version | private function get_assets_version( $append_version, $q = 'v' ) {
if ( ! $append_version ) {
return '';
}
$append = trim( $this->apply_filters( 'assets_version' ) );
if ( $append !== '' ) {
if ( $q ) {
return '?' . $q . '=' . $append;
}
return '?' . $append;
}
return '';
} | php | private function get_assets_version( $append_version, $q = 'v' ) {
if ( ! $append_version ) {
return '';
}
$append = trim( $this->apply_filters( 'assets_version' ) );
if ( $append !== '' ) {
if ( $q ) {
return '?' . $q . '=' . $append;
}
return '?' . $append;
}
return '';
} | [
"private",
"function",
"get_assets_version",
"(",
"$",
"append_version",
",",
"$",
"q",
"=",
"'v'",
")",
"{",
"if",
"(",
"!",
"$",
"append_version",
")",
"{",
"return",
"''",
";",
"}",
"$",
"append",
"=",
"trim",
"(",
"$",
"this",
"->",
"apply_filters"... | @since 2.0.3 Changed: trim assets_version
@param bool $append_version
@param string $q
@return string | [
"@since",
"2",
".",
"0",
".",
"3",
"Changed",
":",
"trim",
"assets_version"
] | train | https://github.com/technote-space/wordpress-plugin-base/blob/02cfcba358432a2539af07a69d9db00ff7c14eac/src/traits/presenter.php#L330-L344 |
technote-space/wordpress-plugin-base | src/traits/presenter.php | Presenter.get_check_assets_dirs | private function get_check_assets_dirs( $allow_multiple = false ) {
$dirs = [];
if ( $this->app->is_theme ) {
if ( $allow_multiple ) {
$dirs[ $this->app->define->lib_assets_dir ] = $this->app->define->lib_assets_url;
$dirs[ $this->app->define->plugin_assets_dir ] = $this->app->define->plugin_assets_ur... | php | private function get_check_assets_dirs( $allow_multiple = false ) {
$dirs = [];
if ( $this->app->is_theme ) {
if ( $allow_multiple ) {
$dirs[ $this->app->define->lib_assets_dir ] = $this->app->define->lib_assets_url;
$dirs[ $this->app->define->plugin_assets_dir ] = $this->app->define->plugin_assets_ur... | [
"private",
"function",
"get_check_assets_dirs",
"(",
"$",
"allow_multiple",
"=",
"false",
")",
"{",
"$",
"dirs",
"=",
"[",
"]",
";",
"if",
"(",
"$",
"this",
"->",
"app",
"->",
"is_theme",
")",
"{",
"if",
"(",
"$",
"allow_multiple",
")",
"{",
"$",
"di... | @since 2.10.1 Added: $allow_multiple param
@since 2.10.1 Improved: for theme (#115)
@param bool $allow_multiple
@return array | [
"@since",
"2",
".",
"10",
".",
"1",
"Added",
":",
"$allow_multiple",
"param",
"@since",
"2",
".",
"10",
".",
"1",
"Improved",
":",
"for",
"theme",
"(",
"#115",
")"
] | train | https://github.com/technote-space/wordpress-plugin-base/blob/02cfcba358432a2539af07a69d9db00ff7c14eac/src/traits/presenter.php#L354-L372 |
technote-space/wordpress-plugin-base | src/traits/presenter.php | Presenter.get_assets | private function get_assets( $path, $default = '', $url = false, $append_version = true ) {
if ( empty( $path ) ) {
return '';
}
$path = trim( $path );
$path = trim( $path, '/' . DS );
$path = str_replace( '/', DS, $path );
foreach ( $this->get_check_assets_dirs() as $_dir => $_url ) {
$_dir = rtrim... | php | private function get_assets( $path, $default = '', $url = false, $append_version = true ) {
if ( empty( $path ) ) {
return '';
}
$path = trim( $path );
$path = trim( $path, '/' . DS );
$path = str_replace( '/', DS, $path );
foreach ( $this->get_check_assets_dirs() as $_dir => $_url ) {
$_dir = rtrim... | [
"private",
"function",
"get_assets",
"(",
"$",
"path",
",",
"$",
"default",
"=",
"''",
",",
"$",
"url",
"=",
"false",
",",
"$",
"append_version",
"=",
"true",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"path",
")",
")",
"{",
"return",
"''",
";",
"}"... | @param string $path
@param string $default
@param bool $url
@param bool $append_version
@return string | [
"@param",
"string",
"$path",
"@param",
"string",
"$default",
"@param",
"bool",
"$url",
"@param",
"bool",
"$append_version"
] | train | https://github.com/technote-space/wordpress-plugin-base/blob/02cfcba358432a2539af07a69d9db00ff7c14eac/src/traits/presenter.php#L382-L406 |
technote-space/wordpress-plugin-base | src/traits/presenter.php | Presenter.get_img_url | public function get_img_url( $path, $default = 'img/no_img.png', $append_version = true ) {
return empty( $path ) ? '' : $this->get_assets_url( 'img/' . $path, $default, $append_version );
} | php | public function get_img_url( $path, $default = 'img/no_img.png', $append_version = true ) {
return empty( $path ) ? '' : $this->get_assets_url( 'img/' . $path, $default, $append_version );
} | [
"public",
"function",
"get_img_url",
"(",
"$",
"path",
",",
"$",
"default",
"=",
"'img/no_img.png'",
",",
"$",
"append_version",
"=",
"true",
")",
"{",
"return",
"empty",
"(",
"$",
"path",
")",
"?",
"''",
":",
"$",
"this",
"->",
"get_assets_url",
"(",
... | @param string $path
@param string $default
@param bool $append_version
@return string | [
"@param",
"string",
"$path",
"@param",
"string",
"$default",
"@param",
"bool",
"$append_version"
] | train | https://github.com/technote-space/wordpress-plugin-base/blob/02cfcba358432a2539af07a69d9db00ff7c14eac/src/traits/presenter.php#L436-L438 |
technote-space/wordpress-plugin-base | src/traits/presenter.php | Presenter.assets | public function assets( $url, $view, $args, $field, $echo = true ) {
return $this->get_view( $view, array_merge( $args, [
$field => $url,
] ), $echo, true, true );
} | php | public function assets( $url, $view, $args, $field, $echo = true ) {
return $this->get_view( $view, array_merge( $args, [
$field => $url,
] ), $echo, true, true );
} | [
"public",
"function",
"assets",
"(",
"$",
"url",
",",
"$",
"view",
",",
"$",
"args",
",",
"$",
"field",
",",
"$",
"echo",
"=",
"true",
")",
"{",
"return",
"$",
"this",
"->",
"get_view",
"(",
"$",
"view",
",",
"array_merge",
"(",
"$",
"args",
",",... | @param string $url
@param string $view
@param array $args
@param string $field
@param bool $echo
@return string | [
"@param",
"string",
"$url",
"@param",
"string",
"$view",
"@param",
"array",
"$args",
"@param",
"string",
"$field",
"@param",
"bool",
"$echo"
] | train | https://github.com/technote-space/wordpress-plugin-base/blob/02cfcba358432a2539af07a69d9db00ff7c14eac/src/traits/presenter.php#L469-L473 |
technote-space/wordpress-plugin-base | src/traits/presenter.php | Presenter.img | public function img( $path, $args = [], $echo = true ) {
return $this->assets( $this->get_img_url( $path ), 'include/img', $args, 'src', $echo );
} | php | public function img( $path, $args = [], $echo = true ) {
return $this->assets( $this->get_img_url( $path ), 'include/img', $args, 'src', $echo );
} | [
"public",
"function",
"img",
"(",
"$",
"path",
",",
"$",
"args",
"=",
"[",
"]",
",",
"$",
"echo",
"=",
"true",
")",
"{",
"return",
"$",
"this",
"->",
"assets",
"(",
"$",
"this",
"->",
"get_img_url",
"(",
"$",
"path",
")",
",",
"'include/img'",
",... | @param string $path
@param array $args
@param bool $echo
@return string | [
"@param",
"string",
"$path",
"@param",
"array",
"$args",
"@param",
"bool",
"$echo"
] | train | https://github.com/technote-space/wordpress-plugin-base/blob/02cfcba358432a2539af07a69d9db00ff7c14eac/src/traits/presenter.php#L482-L484 |
technote-space/wordpress-plugin-base | src/traits/presenter.php | Presenter.css | public function css( $path, $priority = 10 ) {
$css = $this->get_css_path( $path );
if ( ! empty( $css ) ) {
$this->app->minify->register_css_file( $css, $priority );
return true;
}
return false;
} | php | public function css( $path, $priority = 10 ) {
$css = $this->get_css_path( $path );
if ( ! empty( $css ) ) {
$this->app->minify->register_css_file( $css, $priority );
return true;
}
return false;
} | [
"public",
"function",
"css",
"(",
"$",
"path",
",",
"$",
"priority",
"=",
"10",
")",
"{",
"$",
"css",
"=",
"$",
"this",
"->",
"get_css_path",
"(",
"$",
"path",
")",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"css",
")",
")",
"{",
"$",
"this",
"-... | @param string $path
@param int $priority
@return bool | [
"@param",
"string",
"$path",
"@param",
"int",
"$priority"
] | train | https://github.com/technote-space/wordpress-plugin-base/blob/02cfcba358432a2539af07a69d9db00ff7c14eac/src/traits/presenter.php#L512-L521 |
technote-space/wordpress-plugin-base | src/traits/presenter.php | Presenter.js | public function js( $path, $priority = 10 ) {
$js = $this->get_js_path( $path );
if ( ! empty( $js ) ) {
$this->app->minify->register_js_file( $js, $priority );
return true;
}
return false;
} | php | public function js( $path, $priority = 10 ) {
$js = $this->get_js_path( $path );
if ( ! empty( $js ) ) {
$this->app->minify->register_js_file( $js, $priority );
return true;
}
return false;
} | [
"public",
"function",
"js",
"(",
"$",
"path",
",",
"$",
"priority",
"=",
"10",
")",
"{",
"$",
"js",
"=",
"$",
"this",
"->",
"get_js_path",
"(",
"$",
"path",
")",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"js",
")",
")",
"{",
"$",
"this",
"->",
... | @param string $path
@param int $priority
@return bool | [
"@param",
"string",
"$path",
"@param",
"int",
"$priority"
] | train | https://github.com/technote-space/wordpress-plugin-base/blob/02cfcba358432a2539af07a69d9db00ff7c14eac/src/traits/presenter.php#L529-L538 |
technote-space/wordpress-plugin-base | src/traits/presenter.php | Presenter.enqueue_style | public function enqueue_style( $handle, $file, $depends = [], $ver = false, $media = 'all', $dir = 'css' ) {
$path = $dir . DS . $file;
$result = false;
$_handle = $handle;
$index = 0;
foreach ( $this->get_check_assets_dirs( true ) as $_dir => $_url ) {
$_dir = rtrim( $_dir, DS . '/' );
if ( file_... | php | public function enqueue_style( $handle, $file, $depends = [], $ver = false, $media = 'all', $dir = 'css' ) {
$path = $dir . DS . $file;
$result = false;
$_handle = $handle;
$index = 0;
foreach ( $this->get_check_assets_dirs( true ) as $_dir => $_url ) {
$_dir = rtrim( $_dir, DS . '/' );
if ( file_... | [
"public",
"function",
"enqueue_style",
"(",
"$",
"handle",
",",
"$",
"file",
",",
"$",
"depends",
"=",
"[",
"]",
",",
"$",
"ver",
"=",
"false",
",",
"$",
"media",
"=",
"'all'",
",",
"$",
"dir",
"=",
"'css'",
")",
"{",
"$",
"path",
"=",
"$",
"di... | @since 2.10.1 Improved: for theme (#115)
@param string $handle
@param string $file
@param array $depends
@param string|bool|null $ver
@param string $media
@param string $dir
@return bool | [
"@since",
"2",
".",
"10",
".",
"1",
"Improved",
":",
"for",
"theme",
"(",
"#115",
")"
] | train | https://github.com/technote-space/wordpress-plugin-base/blob/02cfcba358432a2539af07a69d9db00ff7c14eac/src/traits/presenter.php#L552-L572 |
technote-space/wordpress-plugin-base | src/traits/presenter.php | Presenter.enqueue_script | public function enqueue_script( $handle, $file, $depends = [], $ver = false, $in_footer = true, $dir = 'js' ) {
$path = $dir . DS . $file;
$result = false;
$_handle = $handle;
$index = 0;
foreach ( $this->get_check_assets_dirs( true ) as $_dir => $_url ) {
$_dir = rtrim( $_dir, DS . '/' );
if ( fi... | php | public function enqueue_script( $handle, $file, $depends = [], $ver = false, $in_footer = true, $dir = 'js' ) {
$path = $dir . DS . $file;
$result = false;
$_handle = $handle;
$index = 0;
foreach ( $this->get_check_assets_dirs( true ) as $_dir => $_url ) {
$_dir = rtrim( $_dir, DS . '/' );
if ( fi... | [
"public",
"function",
"enqueue_script",
"(",
"$",
"handle",
",",
"$",
"file",
",",
"$",
"depends",
"=",
"[",
"]",
",",
"$",
"ver",
"=",
"false",
",",
"$",
"in_footer",
"=",
"true",
",",
"$",
"dir",
"=",
"'js'",
")",
"{",
"$",
"path",
"=",
"$",
... | @since 2.10.1 Improved: for theme (#115)
@param string $handle
@param string $file
@param array $depends
@param string|bool|null $ver
@param bool $in_footer
@param string $dir
@return bool | [
"@since",
"2",
".",
"10",
".",
"1",
"Improved",
":",
"for",
"theme",
"(",
"#115",
")"
] | train | https://github.com/technote-space/wordpress-plugin-base/blob/02cfcba358432a2539af07a69d9db00ff7c14eac/src/traits/presenter.php#L586-L606 |
technote-space/wordpress-plugin-base | src/traits/presenter.php | Presenter.set_script_translations | public function set_script_translations( $handle ) {
if ( $this->_set_script_translations ) {
return;
}
$this->_set_script_translations = true;
$text_domain = $this->app->get_text_domain();
if ( empty( $text_domain ) ) {
return;
}
if ( function_exists( 'wp_set_script_translations... | php | public function set_script_translations( $handle ) {
if ( $this->_set_script_translations ) {
return;
}
$this->_set_script_translations = true;
$text_domain = $this->app->get_text_domain();
if ( empty( $text_domain ) ) {
return;
}
if ( function_exists( 'wp_set_script_translations... | [
"public",
"function",
"set_script_translations",
"(",
"$",
"handle",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_set_script_translations",
")",
"{",
"return",
";",
"}",
"$",
"this",
"->",
"_set_script_translations",
"=",
"true",
";",
"$",
"text_domain",
"=",
"... | @since 1.1.73
@param string $handle | [
"@since",
"1",
".",
"1",
".",
"73"
] | train | https://github.com/technote-space/wordpress-plugin-base/blob/02cfcba358432a2539af07a69d9db00ff7c14eac/src/traits/presenter.php#L658-L678 |
ekuiter/feature-php | FeaturePhp/ProductLine/ProductRenderer.php | ProductRenderer._render | public function _render($textOnly) {
$featureNum = count($this->product->getConfiguration()->getSelectedFeatures());
$fileNum = count($this->files);
$str = "";
$maxLen = fphp\Helper\_String::getMaxLength($this->files, "getTarget");
if ($textOnly)
$str .= "\nProduct ... | php | public function _render($textOnly) {
$featureNum = count($this->product->getConfiguration()->getSelectedFeatures());
$fileNum = count($this->files);
$str = "";
$maxLen = fphp\Helper\_String::getMaxLength($this->files, "getTarget");
if ($textOnly)
$str .= "\nProduct ... | [
"public",
"function",
"_render",
"(",
"$",
"textOnly",
")",
"{",
"$",
"featureNum",
"=",
"count",
"(",
"$",
"this",
"->",
"product",
"->",
"getConfiguration",
"(",
")",
"->",
"getSelectedFeatures",
"(",
")",
")",
";",
"$",
"fileNum",
"=",
"count",
"(",
... | Returns the product analysis.
@param bool $textOnly whether to render text or HTML
@return string | [
"Returns",
"the",
"product",
"analysis",
"."
] | train | https://github.com/ekuiter/feature-php/blob/daf4a59098802fedcfd1f1a1d07847fcf2fea7bf/FeaturePhp/ProductLine/ProductRenderer.php#L47-L85 |
eghojansu/moe | src/AbstractModel.php | AbstractModel.table | public function table()
{
if (!$this->_properties['table_name']) {
$class = explode('\\', get_called_class());
$this->_properties['table_name'] = Instance::snakecase(lcfirst(end($class)));
}
return $this->_properties['table_name'];
} | php | public function table()
{
if (!$this->_properties['table_name']) {
$class = explode('\\', get_called_class());
$this->_properties['table_name'] = Instance::snakecase(lcfirst(end($class)));
}
return $this->_properties['table_name'];
} | [
"public",
"function",
"table",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"_properties",
"[",
"'table_name'",
"]",
")",
"{",
"$",
"class",
"=",
"explode",
"(",
"'\\\\'",
",",
"get_called_class",
"(",
")",
")",
";",
"$",
"this",
"->",
"_propert... | Return table name | [
"Return",
"table",
"name"
] | train | https://github.com/eghojansu/moe/blob/f58ec75a3116d1a572782256e2b38bb9aab95e3c/src/AbstractModel.php#L160-L168 |
eghojansu/moe | src/AbstractModel.php | AbstractModel.field | public function field($name)
{
return isset($this->_properties['fields'][$name])?
$this->_properties['fields'][$name]:null;
} | php | public function field($name)
{
return isset($this->_properties['fields'][$name])?
$this->_properties['fields'][$name]:null;
} | [
"public",
"function",
"field",
"(",
"$",
"name",
")",
"{",
"return",
"isset",
"(",
"$",
"this",
"->",
"_properties",
"[",
"'fields'",
"]",
"[",
"$",
"name",
"]",
")",
"?",
"$",
"this",
"->",
"_properties",
"[",
"'fields'",
"]",
"[",
"$",
"name",
"]... | return field alias | [
"return",
"field",
"alias"
] | train | https://github.com/eghojansu/moe/blob/f58ec75a3116d1a572782256e2b38bb9aab95e3c/src/AbstractModel.php#L278-L282 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.