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 |
|---|---|---|---|---|---|---|---|---|---|---|
Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/storage/storage_set.php | ezcMailStorageSet.getNextLine | public function getNextLine()
{
if ( $this->hasMoreMailData === false )
{
$this->nextMail();
$this->hasMoreMailData = true;
}
$line = $this->set->getNextLine();
fputs( $this->writer, $line );
return $line;
} | php | public function getNextLine()
{
if ( $this->hasMoreMailData === false )
{
$this->nextMail();
$this->hasMoreMailData = true;
}
$line = $this->set->getNextLine();
fputs( $this->writer, $line );
return $line;
} | [
"public",
"function",
"getNextLine",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"hasMoreMailData",
"===",
"false",
")",
"{",
"$",
"this",
"->",
"nextMail",
"(",
")",
";",
"$",
"this",
"->",
"hasMoreMailData",
"=",
"true",
";",
"}",
"$",
"line",
"="... | Returns one line of data from the current mail in the set.
Null is returned if there is no current mail in the set or
the end of the mail is reached,
It also writes the line of data to the current file. If the line contains
a Message-ID header then the value in the header will be used to rename the
file.
@return str... | [
"Returns",
"one",
"line",
"of",
"data",
"from",
"the",
"current",
"mail",
"in",
"the",
"set",
"."
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/storage/storage_set.php#L140-L151 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/storage/storage_set.php | ezcMailStorageSet.nextMail | public function nextMail()
{
if ( $this->writer !== null )
{
fclose( $this->writer );
$this->files[] = $this->path . $this->file;
$this->writer = null;
}
$mail = $this->set->nextMail();
if ( $mail === true || $this->hasMoreMailData === fals... | php | public function nextMail()
{
if ( $this->writer !== null )
{
fclose( $this->writer );
$this->files[] = $this->path . $this->file;
$this->writer = null;
}
$mail = $this->set->nextMail();
if ( $mail === true || $this->hasMoreMailData === fals... | [
"public",
"function",
"nextMail",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"writer",
"!==",
"null",
")",
"{",
"fclose",
"(",
"$",
"this",
"->",
"writer",
")",
";",
"$",
"this",
"->",
"files",
"[",
"]",
"=",
"$",
"this",
"->",
"path",
".",
"... | Moves the set to the next mail and returns true upon success.
False is returned if there are no more mail in the set.
@return bool | [
"Moves",
"the",
"set",
"to",
"the",
"next",
"mail",
"and",
"returns",
"true",
"upon",
"success",
"."
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/storage/storage_set.php#L160-L183 |
ronaldborla/chikka | src/Borla/Chikka/Support/Utilities.php | Utilities.extractNumerics | static function extractNumerics($string, array $include = []) {
// Make sure it's string
$string = (string) $string;
// Set numerics
$numerics = '';
// Get length
$len = strlen($string);
// Loop through string
for ($i = 0; $i < $len; $i++) {
// If digit
if (static::isDigit($s... | php | static function extractNumerics($string, array $include = []) {
// Make sure it's string
$string = (string) $string;
// Set numerics
$numerics = '';
// Get length
$len = strlen($string);
// Loop through string
for ($i = 0; $i < $len; $i++) {
// If digit
if (static::isDigit($s... | [
"static",
"function",
"extractNumerics",
"(",
"$",
"string",
",",
"array",
"$",
"include",
"=",
"[",
"]",
")",
"{",
"// Make sure it's string",
"$",
"string",
"=",
"(",
"string",
")",
"$",
"string",
";",
"// Set numerics",
"$",
"numerics",
"=",
"''",
";",
... | Extract numeric
@return string The numeric string | [
"Extract",
"numeric"
] | train | https://github.com/ronaldborla/chikka/blob/446987706f81d5a0efbc8bd6b7d3b259d0527719/src/Borla/Chikka/Support/Utilities.php#L25-L47 |
ronaldborla/chikka | src/Borla/Chikka/Support/Utilities.php | Utilities.parseMobileNumber | static function parseMobileNumber($number) {
// Extract numerics
$numerics = static::extractNumerics($number);
// Set country code
$countryCode = '';
// Get last 10 digits
$short = static::right($numerics, 10, $countryCode);
// Set carrier code
$carriercode = '';
// Get number
$n... | php | static function parseMobileNumber($number) {
// Extract numerics
$numerics = static::extractNumerics($number);
// Set country code
$countryCode = '';
// Get last 10 digits
$short = static::right($numerics, 10, $countryCode);
// Set carrier code
$carriercode = '';
// Get number
$n... | [
"static",
"function",
"parseMobileNumber",
"(",
"$",
"number",
")",
"{",
"// Extract numerics",
"$",
"numerics",
"=",
"static",
"::",
"extractNumerics",
"(",
"$",
"number",
")",
";",
"// Set country code",
"$",
"countryCode",
"=",
"''",
";",
"// Get last 10 digits... | Parse mobile number | [
"Parse",
"mobile",
"number"
] | train | https://github.com/ronaldborla/chikka/blob/446987706f81d5a0efbc8bd6b7d3b259d0527719/src/Borla/Chikka/Support/Utilities.php#L52-L65 |
ronaldborla/chikka | src/Borla/Chikka/Support/Utilities.php | Utilities.right | static function right($str, $len, &$left = null) {
// Get length of string
$strlen = strlen($str);
// Get start
$start = $strlen - $len;
// If start is less than 0
if ($start < 0) {
// Set to 0
$start = 0;
}
// Set left
$left = substr($str, 0, $start);
// Return
r... | php | static function right($str, $len, &$left = null) {
// Get length of string
$strlen = strlen($str);
// Get start
$start = $strlen - $len;
// If start is less than 0
if ($start < 0) {
// Set to 0
$start = 0;
}
// Set left
$left = substr($str, 0, $start);
// Return
r... | [
"static",
"function",
"right",
"(",
"$",
"str",
",",
"$",
"len",
",",
"&",
"$",
"left",
"=",
"null",
")",
"{",
"// Get length of string",
"$",
"strlen",
"=",
"strlen",
"(",
"$",
"str",
")",
";",
"// Get start",
"$",
"start",
"=",
"$",
"strlen",
"-",
... | Get substr | [
"Get",
"substr"
] | train | https://github.com/ronaldborla/chikka/blob/446987706f81d5a0efbc8bd6b7d3b259d0527719/src/Borla/Chikka/Support/Utilities.php#L70-L84 |
ronaldborla/chikka | src/Borla/Chikka/Support/Utilities.php | Utilities.arrayExtract | static function arrayExtract(array $keys, array $array, array $callbacks = []) {
// Set extracted
$extracted = [];
// Loop through keys
foreach ($keys as $key) {
// Add to extracted, only if it exists
if (array_key_exists($key, $array)) {
// Set item
$item = $array[$key];
... | php | static function arrayExtract(array $keys, array $array, array $callbacks = []) {
// Set extracted
$extracted = [];
// Loop through keys
foreach ($keys as $key) {
// Add to extracted, only if it exists
if (array_key_exists($key, $array)) {
// Set item
$item = $array[$key];
... | [
"static",
"function",
"arrayExtract",
"(",
"array",
"$",
"keys",
",",
"array",
"$",
"array",
",",
"array",
"$",
"callbacks",
"=",
"[",
"]",
")",
"{",
"// Set extracted",
"$",
"extracted",
"=",
"[",
"]",
";",
"// Loop through keys",
"foreach",
"(",
"$",
"... | Extract array from array with keys | [
"Extract",
"array",
"from",
"array",
"with",
"keys"
] | train | https://github.com/ronaldborla/chikka/blob/446987706f81d5a0efbc8bd6b7d3b259d0527719/src/Borla/Chikka/Support/Utilities.php#L105-L125 |
ronaldborla/chikka | src/Borla/Chikka/Support/Utilities.php | Utilities.arrayExcept | static function arrayExcept(array $keys, array $array) {
// Except
$except = [];
// Loop through array
foreach ($array as $key=> $item) {
// If key doesn't exist
if ( ! in_array($key, $keys)) {
// Add to except
$except[$key] = $item;
}
}
// Return
return $ex... | php | static function arrayExcept(array $keys, array $array) {
// Except
$except = [];
// Loop through array
foreach ($array as $key=> $item) {
// If key doesn't exist
if ( ! in_array($key, $keys)) {
// Add to except
$except[$key] = $item;
}
}
// Return
return $ex... | [
"static",
"function",
"arrayExcept",
"(",
"array",
"$",
"keys",
",",
"array",
"$",
"array",
")",
"{",
"// Except",
"$",
"except",
"=",
"[",
"]",
";",
"// Loop through array",
"foreach",
"(",
"$",
"array",
"as",
"$",
"key",
"=>",
"$",
"item",
")",
"{",
... | Except | [
"Except"
] | train | https://github.com/ronaldborla/chikka/blob/446987706f81d5a0efbc8bd6b7d3b259d0527719/src/Borla/Chikka/Support/Utilities.php#L130-L143 |
ronaldborla/chikka | src/Borla/Chikka/Support/Utilities.php | Utilities.executeCallback | static function executeCallback($callback, array $params = array()) {
// If callback has @
if (is_string($callback) && strpos($callback, '@') !== false) {
// Split
$arrCallback = explode('@', $callback);
// Set object
$object = class_exists($arrCallback[0]) ? (new $arrCallback[0]()) : nu... | php | static function executeCallback($callback, array $params = array()) {
// If callback has @
if (is_string($callback) && strpos($callback, '@') !== false) {
// Split
$arrCallback = explode('@', $callback);
// Set object
$object = class_exists($arrCallback[0]) ? (new $arrCallback[0]()) : nu... | [
"static",
"function",
"executeCallback",
"(",
"$",
"callback",
",",
"array",
"$",
"params",
"=",
"array",
"(",
")",
")",
"{",
"// If callback has @",
"if",
"(",
"is_string",
"(",
"$",
"callback",
")",
"&&",
"strpos",
"(",
"$",
"callback",
",",
"'@'",
")"... | Execute callback | [
"Execute",
"callback"
] | train | https://github.com/ronaldborla/chikka/blob/446987706f81d5a0efbc8bd6b7d3b259d0527719/src/Borla/Chikka/Support/Utilities.php#L148-L167 |
j-d/draggy | src/Draggy/Autocode/Templates/JavaEntityTemplate.php | JavaEntityTemplate.getFullPackage | public function getFullPackage($entity = null)
{
if (null === $entity) {
$entity = $this->getEntity();
}
return substr($entity->getProject()->getAutocodeConfiguration('package') . '.' . str_replace('/', '.', ($entity->getModule() != '' ? $entity->getModule() . '/' : '') . $this-... | php | public function getFullPackage($entity = null)
{
if (null === $entity) {
$entity = $this->getEntity();
}
return substr($entity->getProject()->getAutocodeConfiguration('package') . '.' . str_replace('/', '.', ($entity->getModule() != '' ? $entity->getModule() . '/' : '') . $this-... | [
"public",
"function",
"getFullPackage",
"(",
"$",
"entity",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"entity",
")",
"{",
"$",
"entity",
"=",
"$",
"this",
"->",
"getEntity",
"(",
")",
";",
"}",
"return",
"substr",
"(",
"$",
"entity",
"-... | @param Entity $entity
@return string | [
"@param",
"Entity",
"$entity"
] | train | https://github.com/j-d/draggy/blob/97ffc66e1aacb5f685d7aac5251c4abb8888d4bb/src/Draggy/Autocode/Templates/JavaEntityTemplate.php#L177-L184 |
mvccore/ext-router-module | src/MvcCore/Ext/Routers/Modules/Route/UrlBuilding.php | UrlBuilding.Url | public function Url (\MvcCore\IRequest & $request, array & $params = [], array & $defaultUrlParams = [], $queryStringParamsSepatator = '&', $splitUrl = FALSE) {
// check reverse initialization
if ($this->reverseParams === NULL) $this->initReverse();
// complete and filter all params to build reverse pattern
if ... | php | public function Url (\MvcCore\IRequest & $request, array & $params = [], array & $defaultUrlParams = [], $queryStringParamsSepatator = '&', $splitUrl = FALSE) {
// check reverse initialization
if ($this->reverseParams === NULL) $this->initReverse();
// complete and filter all params to build reverse pattern
if ... | [
"public",
"function",
"Url",
"(",
"\\",
"MvcCore",
"\\",
"IRequest",
"&",
"$",
"request",
",",
"array",
"&",
"$",
"params",
"=",
"[",
"]",
",",
"array",
"&",
"$",
"defaultUrlParams",
"=",
"[",
"]",
",",
"$",
"queryStringParamsSepatator",
"=",
"'&'",
",... | Complete route URL by given params array and route internal reverse
replacements pattern string. If there are more given params in first
argument than total count of replacement places in reverse pattern,
then create URL with query string params after reverse pattern,
containing that extra record(s) value(s). Returned ... | [
"Complete",
"route",
"URL",
"by",
"given",
"params",
"array",
"and",
"route",
"internal",
"reverse",
"replacements",
"pattern",
"string",
".",
"If",
"there",
"are",
"more",
"given",
"params",
"in",
"first",
"argument",
"than",
"total",
"count",
"of",
"replacem... | train | https://github.com/mvccore/ext-router-module/blob/7695784a451db86cca6a43c98d076803cd0a50a7/src/MvcCore/Ext/Routers/Modules/Route/UrlBuilding.php#L65-L100 |
WellCommerce/AppBundle | EventListener/LayoutBoxSubscriber.php | LayoutBoxSubscriber.onLayoutBoxFormInit | public function onLayoutBoxFormInit(FormEvent $event)
{
$builder = $event->getFormBuilder();
$form = $event->getForm();
$configurators = $this->container->get('layout_box.configurator.collection')->all();
$resource = $event->getResource();
$boxSettings =... | php | public function onLayoutBoxFormInit(FormEvent $event)
{
$builder = $event->getFormBuilder();
$form = $event->getForm();
$configurators = $this->container->get('layout_box.configurator.collection')->all();
$resource = $event->getResource();
$boxSettings =... | [
"public",
"function",
"onLayoutBoxFormInit",
"(",
"FormEvent",
"$",
"event",
")",
"{",
"$",
"builder",
"=",
"$",
"event",
"->",
"getFormBuilder",
"(",
")",
";",
"$",
"form",
"=",
"$",
"event",
"->",
"getForm",
"(",
")",
";",
"$",
"configurators",
"=",
... | Adds configurator fields to main layout box edit form.
Loops through all configurators, renders the fieldset and sets default data
@param FormEvent $event | [
"Adds",
"configurator",
"fields",
"to",
"main",
"layout",
"box",
"edit",
"form",
".",
"Loops",
"through",
"all",
"configurators",
"renders",
"the",
"fieldset",
"and",
"sets",
"default",
"data"
] | train | https://github.com/WellCommerce/AppBundle/blob/2add687d1c898dd0b24afd611d896e3811a0eac3/EventListener/LayoutBoxSubscriber.php#L43-L61 |
WellCommerce/AppBundle | EventListener/LayoutBoxSubscriber.php | LayoutBoxSubscriber.onLayoutBoxPreUpdate | public function onLayoutBoxPreUpdate(EntityEvent $event)
{
$resource = $event->getEntity();
if ($resource instanceof LayoutBox) {
$request = $this->getRequestHelper()->getCurrentRequest();
$settings = $this->getBoxSettingsFromRequest($request);
$settings = $this-... | php | public function onLayoutBoxPreUpdate(EntityEvent $event)
{
$resource = $event->getEntity();
if ($resource instanceof LayoutBox) {
$request = $this->getRequestHelper()->getCurrentRequest();
$settings = $this->getBoxSettingsFromRequest($request);
$settings = $this-... | [
"public",
"function",
"onLayoutBoxPreUpdate",
"(",
"EntityEvent",
"$",
"event",
")",
"{",
"$",
"resource",
"=",
"$",
"event",
"->",
"getEntity",
"(",
")",
";",
"if",
"(",
"$",
"resource",
"instanceof",
"LayoutBox",
")",
"{",
"$",
"request",
"=",
"$",
"th... | Sets resource settings fetched from fieldset corresponding to selected box type
@param EntityEvent $event | [
"Sets",
"resource",
"settings",
"fetched",
"from",
"fieldset",
"corresponding",
"to",
"selected",
"box",
"type"
] | train | https://github.com/WellCommerce/AppBundle/blob/2add687d1c898dd0b24afd611d896e3811a0eac3/EventListener/LayoutBoxSubscriber.php#L68-L77 |
php-lug/lug | src/Bundle/GridBundle/Twig/GridExtension.php | GridExtension.getFunctions | public function getFunctions()
{
$options = ['is_safe' => ['html']];
return [
new \Twig_SimpleFunction('lug_grid', [$this, 'render'], $options),
new \Twig_SimpleFunction('lug_grid_filters', [$this, 'renderFilters'], $options),
new \Twig_SimpleFunction('lug_grid_b... | php | public function getFunctions()
{
$options = ['is_safe' => ['html']];
return [
new \Twig_SimpleFunction('lug_grid', [$this, 'render'], $options),
new \Twig_SimpleFunction('lug_grid_filters', [$this, 'renderFilters'], $options),
new \Twig_SimpleFunction('lug_grid_b... | [
"public",
"function",
"getFunctions",
"(",
")",
"{",
"$",
"options",
"=",
"[",
"'is_safe'",
"=>",
"[",
"'html'",
"]",
"]",
";",
"return",
"[",
"new",
"\\",
"Twig_SimpleFunction",
"(",
"'lug_grid'",
",",
"[",
"$",
"this",
",",
"'render'",
"]",
",",
"$",... | {@inheritdoc} | [
"{"
] | train | https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Bundle/GridBundle/Twig/GridExtension.php#L49-L66 |
php-lug/lug | src/Bundle/GridBundle/Twig/GridExtension.php | GridExtension.renderColumn | public function renderColumn(GridViewInterface $grid, ColumnInterface $column, $data)
{
return $this->renderer->renderColumn($grid, $column, $data);
} | php | public function renderColumn(GridViewInterface $grid, ColumnInterface $column, $data)
{
return $this->renderer->renderColumn($grid, $column, $data);
} | [
"public",
"function",
"renderColumn",
"(",
"GridViewInterface",
"$",
"grid",
",",
"ColumnInterface",
"$",
"column",
",",
"$",
"data",
")",
"{",
"return",
"$",
"this",
"->",
"renderer",
"->",
"renderColumn",
"(",
"$",
"grid",
",",
"$",
"column",
",",
"$",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Bundle/GridBundle/Twig/GridExtension.php#L95-L98 |
php-lug/lug | src/Bundle/GridBundle/Twig/GridExtension.php | GridExtension.renderColumnSortings | public function renderColumnSortings(GridViewInterface $grid, ColumnInterface $column)
{
return $this->renderer->renderColumnSortings($grid, $column);
} | php | public function renderColumnSortings(GridViewInterface $grid, ColumnInterface $column)
{
return $this->renderer->renderColumnSortings($grid, $column);
} | [
"public",
"function",
"renderColumnSortings",
"(",
"GridViewInterface",
"$",
"grid",
",",
"ColumnInterface",
"$",
"column",
")",
"{",
"return",
"$",
"this",
"->",
"renderer",
"->",
"renderColumnSortings",
"(",
"$",
"grid",
",",
"$",
"column",
")",
";",
"}"
] | {@inheritdoc} | [
"{"
] | train | https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Bundle/GridBundle/Twig/GridExtension.php#L103-L106 |
php-lug/lug | src/Bundle/GridBundle/Twig/GridExtension.php | GridExtension.renderColumnSorting | public function renderColumnSorting(GridViewInterface $grid, ColumnInterface $column, $sorting)
{
return $this->renderer->renderColumnSorting($grid, $column, $sorting);
} | php | public function renderColumnSorting(GridViewInterface $grid, ColumnInterface $column, $sorting)
{
return $this->renderer->renderColumnSorting($grid, $column, $sorting);
} | [
"public",
"function",
"renderColumnSorting",
"(",
"GridViewInterface",
"$",
"grid",
",",
"ColumnInterface",
"$",
"column",
",",
"$",
"sorting",
")",
"{",
"return",
"$",
"this",
"->",
"renderer",
"->",
"renderColumnSorting",
"(",
"$",
"grid",
",",
"$",
"column"... | {@inheritdoc} | [
"{"
] | train | https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Bundle/GridBundle/Twig/GridExtension.php#L111-L114 |
php-lug/lug | src/Bundle/GridBundle/Twig/GridExtension.php | GridExtension.renderColumnAction | public function renderColumnAction(GridViewInterface $grid, ActionInterface $action, $data)
{
return $this->renderer->renderColumnAction($grid, $action, $data);
} | php | public function renderColumnAction(GridViewInterface $grid, ActionInterface $action, $data)
{
return $this->renderer->renderColumnAction($grid, $action, $data);
} | [
"public",
"function",
"renderColumnAction",
"(",
"GridViewInterface",
"$",
"grid",
",",
"ActionInterface",
"$",
"action",
",",
"$",
"data",
")",
"{",
"return",
"$",
"this",
"->",
"renderer",
"->",
"renderColumnAction",
"(",
"$",
"grid",
",",
"$",
"action",
"... | {@inheritdoc} | [
"{"
] | train | https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Bundle/GridBundle/Twig/GridExtension.php#L127-L130 |
php-lug/lug | src/Bundle/GridBundle/Twig/GridExtension.php | GridExtension.renderGlobalAction | public function renderGlobalAction(GridViewInterface $grid, ActionInterface $action)
{
return $this->renderer->renderGlobalAction($grid, $action);
} | php | public function renderGlobalAction(GridViewInterface $grid, ActionInterface $action)
{
return $this->renderer->renderGlobalAction($grid, $action);
} | [
"public",
"function",
"renderGlobalAction",
"(",
"GridViewInterface",
"$",
"grid",
",",
"ActionInterface",
"$",
"action",
")",
"{",
"return",
"$",
"this",
"->",
"renderer",
"->",
"renderGlobalAction",
"(",
"$",
"grid",
",",
"$",
"action",
")",
";",
"}"
] | {@inheritdoc} | [
"{"
] | train | https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Bundle/GridBundle/Twig/GridExtension.php#L143-L146 |
php-lug/lug | src/Bundle/GridBundle/Twig/GridExtension.php | GridExtension.renderPager | public function renderPager(Pagerfanta $pager, $name = null, array $options = [])
{
if (isset($options['routeParams']['grid']['reset'])) {
unset($options['routeParams']['grid']);
}
return $this->pagerfantaExtension->renderPagerfanta($pager, $name, $options);
} | php | public function renderPager(Pagerfanta $pager, $name = null, array $options = [])
{
if (isset($options['routeParams']['grid']['reset'])) {
unset($options['routeParams']['grid']);
}
return $this->pagerfantaExtension->renderPagerfanta($pager, $name, $options);
} | [
"public",
"function",
"renderPager",
"(",
"Pagerfanta",
"$",
"pager",
",",
"$",
"name",
"=",
"null",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"options",
"[",
"'routeParams'",
"]",
"[",
"'grid'",
"]",
"[",
... | @param Pagerfanta $pager
@param string|null $name
@param mixed[] $options
@return string | [
"@param",
"Pagerfanta",
"$pager",
"@param",
"string|null",
"$name",
"@param",
"mixed",
"[]",
"$options"
] | train | https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Bundle/GridBundle/Twig/GridExtension.php#L155-L162 |
technote-space/wordpress-plugin-base | src/classes/models/lib/minify.php | Minify.check_cache | private function check_cache( $src, $name ) {
$name = $name . '_minify_cache';
$hash = sha1( $src );
$cache = $this->app->get_shared_object( $name, 'all' );
if ( $cache ) {
if ( isset( $cache[ $hash ] ) ) {
return true;
}
} else {
$cache = [];
}
$cache[ $hash ] = true;
$this->app->set_sha... | php | private function check_cache( $src, $name ) {
$name = $name . '_minify_cache';
$hash = sha1( $src );
$cache = $this->app->get_shared_object( $name, 'all' );
if ( $cache ) {
if ( isset( $cache[ $hash ] ) ) {
return true;
}
} else {
$cache = [];
}
$cache[ $hash ] = true;
$this->app->set_sha... | [
"private",
"function",
"check_cache",
"(",
"$",
"src",
",",
"$",
"name",
")",
"{",
"$",
"name",
"=",
"$",
"name",
".",
"'_minify_cache'",
";",
"$",
"hash",
"=",
"sha1",
"(",
"$",
"src",
")",
";",
"$",
"cache",
"=",
"$",
"this",
"->",
"app",
"->",... | @param string $src
@param string $name
@return bool | [
"@param",
"string",
"$src",
"@param",
"string",
"$name"
] | train | https://github.com/technote-space/wordpress-plugin-base/blob/02cfcba358432a2539af07a69d9db00ff7c14eac/src/classes/models/lib/minify.php#L60-L75 |
technote-space/wordpress-plugin-base | src/classes/models/lib/minify.php | Minify.output_js | public function output_js( $clear_cache = false ) {
if ( $clear_cache ) {
$this->clear_cache( 'script' );
}
if ( empty( $this->_script ) ) {
return;
}
ksort( $this->_script );
$script = implode( "\n", array_map( function ( $s ) {
return implode( "\n", $s );
}, $this->_script ) );
if ( $this->a... | php | public function output_js( $clear_cache = false ) {
if ( $clear_cache ) {
$this->clear_cache( 'script' );
}
if ( empty( $this->_script ) ) {
return;
}
ksort( $this->_script );
$script = implode( "\n", array_map( function ( $s ) {
return implode( "\n", $s );
}, $this->_script ) );
if ( $this->a... | [
"public",
"function",
"output_js",
"(",
"$",
"clear_cache",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"clear_cache",
")",
"{",
"$",
"this",
"->",
"clear_cache",
"(",
"'script'",
")",
";",
"}",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"_script",
")",... | @since 2.9.0 Added: clear cache
@param bool $clear_cache | [
"@since",
"2",
".",
"9",
".",
"0",
"Added",
":",
"clear",
"cache"
] | train | https://github.com/technote-space/wordpress-plugin-base/blob/02cfcba358432a2539af07a69d9db00ff7c14eac/src/classes/models/lib/minify.php#L128-L149 |
technote-space/wordpress-plugin-base | src/classes/models/lib/minify.php | Minify.output_css | public function output_css( $clear_cache = false ) {
if ( $clear_cache ) {
$this->clear_cache( 'style' );
}
if ( empty( $this->_css ) ) {
return;
}
ksort( $this->_css );
$css = implode( "\n", array_map( function ( $s ) {
return implode( "\n", $s );
}, $this->_css ) );
if ( $this->apply_filters... | php | public function output_css( $clear_cache = false ) {
if ( $clear_cache ) {
$this->clear_cache( 'style' );
}
if ( empty( $this->_css ) ) {
return;
}
ksort( $this->_css );
$css = implode( "\n", array_map( function ( $s ) {
return implode( "\n", $s );
}, $this->_css ) );
if ( $this->apply_filters... | [
"public",
"function",
"output_css",
"(",
"$",
"clear_cache",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"clear_cache",
")",
"{",
"$",
"this",
"->",
"clear_cache",
"(",
"'style'",
")",
";",
"}",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"_css",
")",
... | @since 2.9.0 Added: clear cache
@param bool $clear_cache | [
"@since",
"2",
".",
"9",
".",
"0",
"Added",
":",
"clear",
"cache"
] | train | https://github.com/technote-space/wordpress-plugin-base/blob/02cfcba358432a2539af07a69d9db00ff7c14eac/src/classes/models/lib/minify.php#L192-L212 |
brick/di | src/UnresolvedValueException.php | UnresolvedValueException.unresolvedParameter | public static function unresolvedParameter(\ReflectionParameter $parameter) : UnresolvedValueException
{
$message = 'The parameter "%s" from function "%s" could not be resolved';
$message = sprintf($message, self::getParameterName($parameter), self::getFunctionName($parameter));
return new ... | php | public static function unresolvedParameter(\ReflectionParameter $parameter) : UnresolvedValueException
{
$message = 'The parameter "%s" from function "%s" could not be resolved';
$message = sprintf($message, self::getParameterName($parameter), self::getFunctionName($parameter));
return new ... | [
"public",
"static",
"function",
"unresolvedParameter",
"(",
"\\",
"ReflectionParameter",
"$",
"parameter",
")",
":",
"UnresolvedValueException",
"{",
"$",
"message",
"=",
"'The parameter \"%s\" from function \"%s\" could not be resolved'",
";",
"$",
"message",
"=",
"sprintf... | @param \ReflectionParameter $parameter
@return UnresolvedValueException | [
"@param",
"\\",
"ReflectionParameter",
"$parameter"
] | train | https://github.com/brick/di/blob/6ced82ab3623b8f1470317d38cbd2de855e7aa3d/src/UnresolvedValueException.php#L17-L23 |
brick/di | src/UnresolvedValueException.php | UnresolvedValueException.unresolvedProperty | public static function unresolvedProperty(\ReflectionProperty $property) : UnresolvedValueException
{
$message = 'The property %s::$%s could not be resolved';
$message = sprintf($message, $property->getDeclaringClass()->getName(), $property->getName());
return new self($message);
} | php | public static function unresolvedProperty(\ReflectionProperty $property) : UnresolvedValueException
{
$message = 'The property %s::$%s could not be resolved';
$message = sprintf($message, $property->getDeclaringClass()->getName(), $property->getName());
return new self($message);
} | [
"public",
"static",
"function",
"unresolvedProperty",
"(",
"\\",
"ReflectionProperty",
"$",
"property",
")",
":",
"UnresolvedValueException",
"{",
"$",
"message",
"=",
"'The property %s::$%s could not be resolved'",
";",
"$",
"message",
"=",
"sprintf",
"(",
"$",
"mess... | @param \ReflectionProperty $property
@return UnresolvedValueException | [
"@param",
"\\",
"ReflectionProperty",
"$property"
] | train | https://github.com/brick/di/blob/6ced82ab3623b8f1470317d38cbd2de855e7aa3d/src/UnresolvedValueException.php#L30-L36 |
brick/di | src/UnresolvedValueException.php | UnresolvedValueException.getParameterName | private static function getParameterName(\ReflectionParameter $parameter) : string
{
$parameterType = '';
if (null !== $type = $parameter->getType()) {
$parameterType = (string) $type . ' ';
}
return $parameterType . '$' . $parameter->getName();
} | php | private static function getParameterName(\ReflectionParameter $parameter) : string
{
$parameterType = '';
if (null !== $type = $parameter->getType()) {
$parameterType = (string) $type . ' ';
}
return $parameterType . '$' . $parameter->getName();
} | [
"private",
"static",
"function",
"getParameterName",
"(",
"\\",
"ReflectionParameter",
"$",
"parameter",
")",
":",
"string",
"{",
"$",
"parameterType",
"=",
"''",
";",
"if",
"(",
"null",
"!==",
"$",
"type",
"=",
"$",
"parameter",
"->",
"getType",
"(",
")",... | Returns the type (if any) + name of a function parameter.
@param \ReflectionParameter $parameter
@return string | [
"Returns",
"the",
"type",
"(",
"if",
"any",
")",
"+",
"name",
"of",
"a",
"function",
"parameter",
"."
] | train | https://github.com/brick/di/blob/6ced82ab3623b8f1470317d38cbd2de855e7aa3d/src/UnresolvedValueException.php#L45-L54 |
ekuiter/feature-php | FeaturePhp/Exporter/LocalExporter.php | LocalExporter.export | public function export($product) {
$files = $product->generateFiles();
mkdir($this->target, 0777, true);
foreach ($files as $file)
if (!$file->getContent()->copy(fphp\Helper\Path::join($this->target, $file->getTarget())))
throw new LocalExporterException("cou... | php | public function export($product) {
$files = $product->generateFiles();
mkdir($this->target, 0777, true);
foreach ($files as $file)
if (!$file->getContent()->copy(fphp\Helper\Path::join($this->target, $file->getTarget())))
throw new LocalExporterException("cou... | [
"public",
"function",
"export",
"(",
"$",
"product",
")",
"{",
"$",
"files",
"=",
"$",
"product",
"->",
"generateFiles",
"(",
")",
";",
"mkdir",
"(",
"$",
"this",
"->",
"target",
",",
"0777",
",",
"true",
")",
";",
"foreach",
"(",
"$",
"files",
"as... | Exports a product in the local filesystem.
Every generated file is copied to the filesystem at its target path.
@param \FeaturePhp\ProductLine\Product $product | [
"Exports",
"a",
"product",
"in",
"the",
"local",
"filesystem",
".",
"Every",
"generated",
"file",
"is",
"copied",
"to",
"the",
"filesystem",
"at",
"its",
"target",
"path",
"."
] | train | https://github.com/ekuiter/feature-php/blob/daf4a59098802fedcfd1f1a1d07847fcf2fea7bf/FeaturePhp/Exporter/LocalExporter.php#L44-L51 |
oroinc/OroLayoutComponent | Loader/Visitor/ElementDependentVisitor.php | ElementDependentVisitor.endVisit | public function endVisit(VisitContext $visitContext)
{
$writer = $visitContext->createWriter();
$writer->writeln(sprintf('return \'%s\';', $this->elementId));
$method = PhpMethod::create('getElement');
$method->setBody($writer->getContent());
$visitContext->getClass()->setM... | php | public function endVisit(VisitContext $visitContext)
{
$writer = $visitContext->createWriter();
$writer->writeln(sprintf('return \'%s\';', $this->elementId));
$method = PhpMethod::create('getElement');
$method->setBody($writer->getContent());
$visitContext->getClass()->setM... | [
"public",
"function",
"endVisit",
"(",
"VisitContext",
"$",
"visitContext",
")",
"{",
"$",
"writer",
"=",
"$",
"visitContext",
"->",
"createWriter",
"(",
")",
";",
"$",
"writer",
"->",
"writeln",
"(",
"sprintf",
"(",
"'return \\'%s\\';'",
",",
"$",
"this",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/Loader/Visitor/ElementDependentVisitor.php#L34-L43 |
DevGroup-ru/yii2-users-module | src/scenarios/BaseAuthorizationPair.php | BaseAuthorizationPair.findUserByField | protected function findUserByField(LoginForm &$loginForm, $field = 'username')
{
return [
$field,
function ($attribute) use (&$loginForm) {
$user = Yii::createObject(ModelMapHelper::User());
/** @var LazyCache $cache */
$cache = Yii::$a... | php | protected function findUserByField(LoginForm &$loginForm, $field = 'username')
{
return [
$field,
function ($attribute) use (&$loginForm) {
$user = Yii::createObject(ModelMapHelper::User());
/** @var LazyCache $cache */
$cache = Yii::$a... | [
"protected",
"function",
"findUserByField",
"(",
"LoginForm",
"&",
"$",
"loginForm",
",",
"$",
"field",
"=",
"'username'",
")",
"{",
"return",
"[",
"$",
"field",
",",
"function",
"(",
"$",
"attribute",
")",
"use",
"(",
"&",
"$",
"loginForm",
")",
"{",
... | Finds user by specified field(username, email, phone)
@param \DevGroup\Users\models\LoginForm $loginForm
@param string $field
@return array | [
"Finds",
"user",
"by",
"specified",
"field",
"(",
"username",
"email",
"phone",
")",
"@param",
"\\",
"DevGroup",
"\\",
"Users",
"\\",
"models",
"\\",
"LoginForm",
"$loginForm",
"@param",
"string",
"$field"
] | train | https://github.com/DevGroup-ru/yii2-users-module/blob/ff0103dc55c3462627ccc704c33e70c96053f750/src/scenarios/BaseAuthorizationPair.php#L76-L96 |
DevGroup-ru/yii2-users-module | src/scenarios/BaseAuthorizationPair.php | BaseAuthorizationPair.validatePassword | protected function validatePassword(LoginForm &$loginForm)
{
return [
'password',
function ($attribute) use (&$loginForm) {
if ($loginForm->user === null ||
!PasswordHelper::validate($loginForm->password, $loginForm->user->password_hash)
... | php | protected function validatePassword(LoginForm &$loginForm)
{
return [
'password',
function ($attribute) use (&$loginForm) {
if ($loginForm->user === null ||
!PasswordHelper::validate($loginForm->password, $loginForm->user->password_hash)
... | [
"protected",
"function",
"validatePassword",
"(",
"LoginForm",
"&",
"$",
"loginForm",
")",
"{",
"return",
"[",
"'password'",
",",
"function",
"(",
"$",
"attribute",
")",
"use",
"(",
"&",
"$",
"loginForm",
")",
"{",
"if",
"(",
"$",
"loginForm",
"->",
"use... | Adds password validation rule for login scenario
@param \DevGroup\Users\models\LoginForm $loginForm
@return array | [
"Adds",
"password",
"validation",
"rule",
"for",
"login",
"scenario"
] | train | https://github.com/DevGroup-ru/yii2-users-module/blob/ff0103dc55c3462627ccc704c33e70c96053f750/src/scenarios/BaseAuthorizationPair.php#L105-L117 |
DevGroup-ru/yii2-users-module | src/scenarios/BaseAuthorizationPair.php | BaseAuthorizationPair.inactiveUsers | protected function inactiveUsers(LoginForm &$loginForm)
{
if (UsersModule::module()->allowLoginInactiveAccounts === false) {
return [];
}
return [
'username',
function ($attribute) use (&$loginForm) {
if ($loginForm->user !== null && $login... | php | protected function inactiveUsers(LoginForm &$loginForm)
{
if (UsersModule::module()->allowLoginInactiveAccounts === false) {
return [];
}
return [
'username',
function ($attribute) use (&$loginForm) {
if ($loginForm->user !== null && $login... | [
"protected",
"function",
"inactiveUsers",
"(",
"LoginForm",
"&",
"$",
"loginForm",
")",
"{",
"if",
"(",
"UsersModule",
"::",
"module",
"(",
")",
"->",
"allowLoginInactiveAccounts",
"===",
"false",
")",
"{",
"return",
"[",
"]",
";",
"}",
"return",
"[",
"'us... | Adds validation rule to not accept inactive users if such feature is toggled on in module configuration.
@param \DevGroup\Users\models\LoginForm $loginForm
@return array | [
"Adds",
"validation",
"rule",
"to",
"not",
"accept",
"inactive",
"users",
"if",
"such",
"feature",
"is",
"toggled",
"on",
"in",
"module",
"configuration",
"."
] | train | https://github.com/DevGroup-ru/yii2-users-module/blob/ff0103dc55c3462627ccc704c33e70c96053f750/src/scenarios/BaseAuthorizationPair.php#L126-L139 |
mikebarlow/html-helper | src/Html.php | Html.tag | public function tag($tag, $attr = null, $content = null, $close = false)
{
$tag = strtolower($tag);
if (! empty($attr) && is_array($attr)) {
$attr = $this->Attr->attr($attr);
}
if ($close) {
return sprintf('<%s%s>%s</%1$s>', $tag, $attr, $content);
}... | php | public function tag($tag, $attr = null, $content = null, $close = false)
{
$tag = strtolower($tag);
if (! empty($attr) && is_array($attr)) {
$attr = $this->Attr->attr($attr);
}
if ($close) {
return sprintf('<%s%s>%s</%1$s>', $tag, $attr, $content);
}... | [
"public",
"function",
"tag",
"(",
"$",
"tag",
",",
"$",
"attr",
"=",
"null",
",",
"$",
"content",
"=",
"null",
",",
"$",
"close",
"=",
"false",
")",
"{",
"$",
"tag",
"=",
"strtolower",
"(",
"$",
"tag",
")",
";",
"if",
"(",
"!",
"empty",
"(",
... | render a tag
@param string tag to render
@param array attributes for the tag
@param string contents of tag when not self closing
@param bool close the tag?
@return string | [
"render",
"a",
"tag"
] | train | https://github.com/mikebarlow/html-helper/blob/d9d9dc3e92ba3ecd75f3a2e5a5bc2d23f38b5f65/src/Html.php#L50-L63 |
mikebarlow/html-helper | src/Html.php | Html.ul | public function ul($list, $attr = null)
{
$out = $this->tag('ul', $attr);
if (! empty($list) && is_array($list)) {
$out .= $this->processList($list);
}
$out .= $this->tag('/ul');
return $out;
} | php | public function ul($list, $attr = null)
{
$out = $this->tag('ul', $attr);
if (! empty($list) && is_array($list)) {
$out .= $this->processList($list);
}
$out .= $this->tag('/ul');
return $out;
} | [
"public",
"function",
"ul",
"(",
"$",
"list",
",",
"$",
"attr",
"=",
"null",
")",
"{",
"$",
"out",
"=",
"$",
"this",
"->",
"tag",
"(",
"'ul'",
",",
"$",
"attr",
")",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"list",
")",
"&&",
"is_array",
"(",
... | unordered list
@param array Array of items to list / attr
@param array Array of attributes for the ul
@return string | [
"unordered",
"list"
] | train | https://github.com/mikebarlow/html-helper/blob/d9d9dc3e92ba3ecd75f3a2e5a5bc2d23f38b5f65/src/Html.php#L96-L107 |
mikebarlow/html-helper | src/Html.php | Html.processList | public function processList($list, $subListType = 'ul')
{
$out = '';
foreach ($list as $key => $value) {
if (is_array($value) && (isset($value['list']) || isset($value['attr']))) {
$attr = (isset($value['attr'])) ? $value['attr'] : null;
$listAttr = (isse... | php | public function processList($list, $subListType = 'ul')
{
$out = '';
foreach ($list as $key => $value) {
if (is_array($value) && (isset($value['list']) || isset($value['attr']))) {
$attr = (isset($value['attr'])) ? $value['attr'] : null;
$listAttr = (isse... | [
"public",
"function",
"processList",
"(",
"$",
"list",
",",
"$",
"subListType",
"=",
"'ul'",
")",
"{",
"$",
"out",
"=",
"''",
";",
"foreach",
"(",
"$",
"list",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"valu... | process list items
@todo add ability to define sublists from within the list
@param array Array of list items to process
@param string method to use for sub-lists
@return string | [
"process",
"list",
"items"
] | train | https://github.com/mikebarlow/html-helper/blob/d9d9dc3e92ba3ecd75f3a2e5a5bc2d23f38b5f65/src/Html.php#L137-L156 |
mikebarlow/html-helper | src/Html.php | Html.link | public function link($text, $url = null, $attr = null)
{
$url = $this->Router->getUrl($url);
$attr['href'] = $url;
return $this->tag('a', $attr, $text, true);
} | php | public function link($text, $url = null, $attr = null)
{
$url = $this->Router->getUrl($url);
$attr['href'] = $url;
return $this->tag('a', $attr, $text, true);
} | [
"public",
"function",
"link",
"(",
"$",
"text",
",",
"$",
"url",
"=",
"null",
",",
"$",
"attr",
"=",
"null",
")",
"{",
"$",
"url",
"=",
"$",
"this",
"->",
"Router",
"->",
"getUrl",
"(",
"$",
"url",
")",
";",
"$",
"attr",
"[",
"'href'",
"]",
"... | create a link
@param string Link text
@param mixed url data. Will be passed to the router interface for processing
@param array attributes to place on the link tag
@return string | [
"create",
"a",
"link"
] | train | https://github.com/mikebarlow/html-helper/blob/d9d9dc3e92ba3ecd75f3a2e5a5bc2d23f38b5f65/src/Html.php#L166-L171 |
mikebarlow/html-helper | src/Html.php | Html.image | public function image($src, $attr = array())
{
$src = $this->Assets->getImage($src);
$attr['src'] = $src;
return $this->tag('img', $attr);
} | php | public function image($src, $attr = array())
{
$src = $this->Assets->getImage($src);
$attr['src'] = $src;
return $this->tag('img', $attr);
} | [
"public",
"function",
"image",
"(",
"$",
"src",
",",
"$",
"attr",
"=",
"array",
"(",
")",
")",
"{",
"$",
"src",
"=",
"$",
"this",
"->",
"Assets",
"->",
"getImage",
"(",
"$",
"src",
")",
";",
"$",
"attr",
"[",
"'src'",
"]",
"=",
"$",
"src",
";... | create an image
@param mixed image path data - will be passed to the assets interface for processing
@param array attributes to be placed on the img tag
@return string | [
"create",
"an",
"image"
] | train | https://github.com/mikebarlow/html-helper/blob/d9d9dc3e92ba3ecd75f3a2e5a5bc2d23f38b5f65/src/Html.php#L180-L185 |
mikebarlow/html-helper | src/Html.php | Html.style | public function style($src, $attr = array())
{
$src = $this->Assets->getStyle($src);
$attr['href'] = $src;
$attr = array_merge(
array(
'media' => 'screen',
'rel' => 'stylesheet',
'type' => 'text/css'
),
$att... | php | public function style($src, $attr = array())
{
$src = $this->Assets->getStyle($src);
$attr['href'] = $src;
$attr = array_merge(
array(
'media' => 'screen',
'rel' => 'stylesheet',
'type' => 'text/css'
),
$att... | [
"public",
"function",
"style",
"(",
"$",
"src",
",",
"$",
"attr",
"=",
"array",
"(",
")",
")",
"{",
"$",
"src",
"=",
"$",
"this",
"->",
"Assets",
"->",
"getStyle",
"(",
"$",
"src",
")",
";",
"$",
"attr",
"[",
"'href'",
"]",
"=",
"$",
"src",
"... | create a style link
@param mixed style path data - will be passed to the assets interface for processing
@param array attributes to be placed on the link tag
@return string | [
"create",
"a",
"style",
"link"
] | train | https://github.com/mikebarlow/html-helper/blob/d9d9dc3e92ba3ecd75f3a2e5a5bc2d23f38b5f65/src/Html.php#L194-L209 |
mikebarlow/html-helper | src/Html.php | Html.script | public function script($src, $attr = array())
{
$src = $this->Assets->getScript($src);
$attr['src'] = $src;
return $this->tag('script', $attr, '', true);
} | php | public function script($src, $attr = array())
{
$src = $this->Assets->getScript($src);
$attr['src'] = $src;
return $this->tag('script', $attr, '', true);
} | [
"public",
"function",
"script",
"(",
"$",
"src",
",",
"$",
"attr",
"=",
"array",
"(",
")",
")",
"{",
"$",
"src",
"=",
"$",
"this",
"->",
"Assets",
"->",
"getScript",
"(",
"$",
"src",
")",
";",
"$",
"attr",
"[",
"'src'",
"]",
"=",
"$",
"src",
... | create a script tag
@param mixed script path data - will be passed to the assets interface for processing
@param array attributes to be placed on the script tag
@return string | [
"create",
"a",
"script",
"tag"
] | train | https://github.com/mikebarlow/html-helper/blob/d9d9dc3e92ba3ecd75f3a2e5a5bc2d23f38b5f65/src/Html.php#L218-L223 |
mikebarlow/html-helper | src/Html.php | Html.setRouter | public function setRouter($Router)
{
if (! is_object($Router) || ! $Router instanceof Router) {
throw new \InvalidArgumentException(
'The Router Interface must be a valid Router Object'
);
}
$this->Router = $Router;
return true;
} | php | public function setRouter($Router)
{
if (! is_object($Router) || ! $Router instanceof Router) {
throw new \InvalidArgumentException(
'The Router Interface must be a valid Router Object'
);
}
$this->Router = $Router;
return true;
} | [
"public",
"function",
"setRouter",
"(",
"$",
"Router",
")",
"{",
"if",
"(",
"!",
"is_object",
"(",
"$",
"Router",
")",
"||",
"!",
"$",
"Router",
"instanceof",
"Router",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"'The Router Interface m... | check and set the router interface
@param Object Instance of an Router
@return bool
@throws \InvalidArgumentException | [
"check",
"and",
"set",
"the",
"router",
"interface"
] | train | https://github.com/mikebarlow/html-helper/blob/d9d9dc3e92ba3ecd75f3a2e5a5bc2d23f38b5f65/src/Html.php#L232-L242 |
mikebarlow/html-helper | src/Html.php | Html.setAssets | public function setAssets($Assets)
{
if (! is_object($Assets) || ! $Assets instanceof Assets) {
throw new \InvalidArgumentException(
'The Assets Interface must be a valid Assets Object'
);
}
$this->Assets = $Assets;
return true;
} | php | public function setAssets($Assets)
{
if (! is_object($Assets) || ! $Assets instanceof Assets) {
throw new \InvalidArgumentException(
'The Assets Interface must be a valid Assets Object'
);
}
$this->Assets = $Assets;
return true;
} | [
"public",
"function",
"setAssets",
"(",
"$",
"Assets",
")",
"{",
"if",
"(",
"!",
"is_object",
"(",
"$",
"Assets",
")",
"||",
"!",
"$",
"Assets",
"instanceof",
"Assets",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"'The Assets Interface m... | check and set the Asset interface
@param Object Instance of an Assets
@return bool
@throws \InvalidArgumentException | [
"check",
"and",
"set",
"the",
"Asset",
"interface"
] | train | https://github.com/mikebarlow/html-helper/blob/d9d9dc3e92ba3ecd75f3a2e5a5bc2d23f38b5f65/src/Html.php#L251-L261 |
mikebarlow/html-helper | src/Html.php | Html.setForm | public function setForm($Form)
{
if (! is_object($Form) || ! $Form instanceof Helpers\Form) {
throw new \InvalidArgumentException(
'The Form Object must be a valid Helpers\Form Object'
);
}
$this->Form = $Form;
return true;
} | php | public function setForm($Form)
{
if (! is_object($Form) || ! $Form instanceof Helpers\Form) {
throw new \InvalidArgumentException(
'The Form Object must be a valid Helpers\Form Object'
);
}
$this->Form = $Form;
return true;
} | [
"public",
"function",
"setForm",
"(",
"$",
"Form",
")",
"{",
"if",
"(",
"!",
"is_object",
"(",
"$",
"Form",
")",
"||",
"!",
"$",
"Form",
"instanceof",
"Helpers",
"\\",
"Form",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"'The Form Ob... | check and set the Form Object
@param Object Instance of an Helpers\Form
@return bool
@throws \InvalidArgumentException | [
"check",
"and",
"set",
"the",
"Form",
"Object"
] | train | https://github.com/mikebarlow/html-helper/blob/d9d9dc3e92ba3ecd75f3a2e5a5bc2d23f38b5f65/src/Html.php#L270-L280 |
gpupo/common-schema | src/ORM/Entity/Trading/Trading.php | Trading.removePayment | public function removePayment(\Gpupo\CommonSchema\ORM\Entity\Trading\Payment\Payment $payment)
{
return $this->payments->removeElement($payment);
} | php | public function removePayment(\Gpupo\CommonSchema\ORM\Entity\Trading\Payment\Payment $payment)
{
return $this->payments->removeElement($payment);
} | [
"public",
"function",
"removePayment",
"(",
"\\",
"Gpupo",
"\\",
"CommonSchema",
"\\",
"ORM",
"\\",
"Entity",
"\\",
"Trading",
"\\",
"Payment",
"\\",
"Payment",
"$",
"payment",
")",
"{",
"return",
"$",
"this",
"->",
"payments",
"->",
"removeElement",
"(",
... | Remove payment.
@param \Gpupo\CommonSchema\ORM\Entity\Trading\Payment\Payment $payment
@return bool TRUE if this collection contained the specified element, FALSE otherwise | [
"Remove",
"payment",
"."
] | train | https://github.com/gpupo/common-schema/blob/a762d2eb3063b7317c72c69cbb463b1f95b86b0a/src/ORM/Entity/Trading/Trading.php#L138-L141 |
wenbinye/PhalconX | src/Mvc/ViewHelper.php | ViewHelper.endclip | public function endclip()
{
$name = $this->clipName;
if (isset($this->clips[$name])) {
$this->clips[$name] .= ob_get_clean();
} else {
$this->clips[$name] = ob_get_clean();
}
} | php | public function endclip()
{
$name = $this->clipName;
if (isset($this->clips[$name])) {
$this->clips[$name] .= ob_get_clean();
} else {
$this->clips[$name] = ob_get_clean();
}
} | [
"public",
"function",
"endclip",
"(",
")",
"{",
"$",
"name",
"=",
"$",
"this",
"->",
"clipName",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"clips",
"[",
"$",
"name",
"]",
")",
")",
"{",
"$",
"this",
"->",
"clips",
"[",
"$",
"name",
"]",
... | Ends clip | [
"Ends",
"clip"
] | train | https://github.com/wenbinye/PhalconX/blob/0d2e1480e722dde56ccd23b2e8a5c8ac6ac2f8e1/src/Mvc/ViewHelper.php#L40-L48 |
wenbinye/PhalconX | src/Mvc/ViewHelper.php | ViewHelper.baseUrl | public function baseUrl()
{
if (!$this->baseUrl) {
$this->baseUrl = $this->request->getScheme()
. '://' . $this->request->getHttpHost();
}
return $this->baseUrl;
} | php | public function baseUrl()
{
if (!$this->baseUrl) {
$this->baseUrl = $this->request->getScheme()
. '://' . $this->request->getHttpHost();
}
return $this->baseUrl;
} | [
"public",
"function",
"baseUrl",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"baseUrl",
")",
"{",
"$",
"this",
"->",
"baseUrl",
"=",
"$",
"this",
"->",
"request",
"->",
"getScheme",
"(",
")",
".",
"'://'",
".",
"$",
"this",
"->",
"request",
... | Gets the base url
@return string | [
"Gets",
"the",
"base",
"url"
] | train | https://github.com/wenbinye/PhalconX/blob/0d2e1480e722dde56ccd23b2e8a5c8ac6ac2f8e1/src/Mvc/ViewHelper.php#L66-L73 |
wenbinye/PhalconX | src/Mvc/ViewHelper.php | ViewHelper.absoluteUrl | public function absoluteUrl($uri = null, $args = null)
{
if (isset($uri)) {
$uri = '/'. ltrim($uri, "/");
return $this->baseUrl() . $this->url->get($uri, $args);
} else {
return $this->baseUrl() . $this->url->getBaseUri();
}
} | php | public function absoluteUrl($uri = null, $args = null)
{
if (isset($uri)) {
$uri = '/'. ltrim($uri, "/");
return $this->baseUrl() . $this->url->get($uri, $args);
} else {
return $this->baseUrl() . $this->url->getBaseUri();
}
} | [
"public",
"function",
"absoluteUrl",
"(",
"$",
"uri",
"=",
"null",
",",
"$",
"args",
"=",
"null",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"uri",
")",
")",
"{",
"$",
"uri",
"=",
"'/'",
".",
"ltrim",
"(",
"$",
"uri",
",",
"\"/\"",
")",
";",
"re... | Gets absolute url
@return string | [
"Gets",
"absolute",
"url"
] | train | https://github.com/wenbinye/PhalconX/blob/0d2e1480e722dde56ccd23b2e8a5c8ac6ac2f8e1/src/Mvc/ViewHelper.php#L80-L88 |
wenbinye/PhalconX | src/Mvc/ViewHelper.php | ViewHelper.trim | public function trim($str, $charlist = null)
{
return isset($charlist) ? trim($str, $charlist) : trim($str);
} | php | public function trim($str, $charlist = null)
{
return isset($charlist) ? trim($str, $charlist) : trim($str);
} | [
"public",
"function",
"trim",
"(",
"$",
"str",
",",
"$",
"charlist",
"=",
"null",
")",
"{",
"return",
"isset",
"(",
"$",
"charlist",
")",
"?",
"trim",
"(",
"$",
"str",
",",
"$",
"charlist",
")",
":",
"trim",
"(",
"$",
"str",
")",
";",
"}"
] | trim string
@param string $str
@param array $charlist
@return string | [
"trim",
"string"
] | train | https://github.com/wenbinye/PhalconX/blob/0d2e1480e722dde56ccd23b2e8a5c8ac6ac2f8e1/src/Mvc/ViewHelper.php#L97-L100 |
wenbinye/PhalconX | src/Mvc/ViewHelper.php | ViewHelper.ltrim | public function ltrim($str, $charlist = null)
{
return isset($charlist) ? ltrim($str, $charlist) : ltrim($str);
} | php | public function ltrim($str, $charlist = null)
{
return isset($charlist) ? ltrim($str, $charlist) : ltrim($str);
} | [
"public",
"function",
"ltrim",
"(",
"$",
"str",
",",
"$",
"charlist",
"=",
"null",
")",
"{",
"return",
"isset",
"(",
"$",
"charlist",
")",
"?",
"ltrim",
"(",
"$",
"str",
",",
"$",
"charlist",
")",
":",
"ltrim",
"(",
"$",
"str",
")",
";",
"}"
] | left trim string
@param string $str
@param array $charlist
@return string | [
"left",
"trim",
"string"
] | train | https://github.com/wenbinye/PhalconX/blob/0d2e1480e722dde56ccd23b2e8a5c8ac6ac2f8e1/src/Mvc/ViewHelper.php#L109-L112 |
wenbinye/PhalconX | src/Mvc/ViewHelper.php | ViewHelper.rtrim | public function rtrim($str, $charlist = null)
{
return isset($charlist) ? rtrim($str, $charlist) : rtrim($str);
} | php | public function rtrim($str, $charlist = null)
{
return isset($charlist) ? rtrim($str, $charlist) : rtrim($str);
} | [
"public",
"function",
"rtrim",
"(",
"$",
"str",
",",
"$",
"charlist",
"=",
"null",
")",
"{",
"return",
"isset",
"(",
"$",
"charlist",
")",
"?",
"rtrim",
"(",
"$",
"str",
",",
"$",
"charlist",
")",
":",
"rtrim",
"(",
"$",
"str",
")",
";",
"}"
] | right trim string
@param string $str
@param array $charlist
@return string | [
"right",
"trim",
"string"
] | train | https://github.com/wenbinye/PhalconX/blob/0d2e1480e722dde56ccd23b2e8a5c8ac6ac2f8e1/src/Mvc/ViewHelper.php#L121-L124 |
phpnfe/tools | src/Certificado/Pkcs12.php | Pkcs12.zInit | private function zInit($flagCert = false)
{
//se as chaves foram passadas na forma de strings então verificar a validade
if ($flagCert) {
//já que o certificado existe, verificar seu prazo de validade
//o certificado será removido se estiver vencido
if (! $this->i... | php | private function zInit($flagCert = false)
{
//se as chaves foram passadas na forma de strings então verificar a validade
if ($flagCert) {
//já que o certificado existe, verificar seu prazo de validade
//o certificado será removido se estiver vencido
if (! $this->i... | [
"private",
"function",
"zInit",
"(",
"$",
"flagCert",
"=",
"false",
")",
"{",
"//se as chaves foram passadas na forma de strings então verificar a validade",
"if",
"(",
"$",
"flagCert",
")",
"{",
"//já que o certificado existe, verificar seu prazo de validade",
"//o certificado s... | zInit
Método de inicialização da classe irá verificar
os parâmetros, arquivos e validade dos mesmos
Em caso de erro o motivo da falha será indicada na parâmetro
error da classe, os outros parâmetros serão limpos e os
arquivos inválidos serão removidos da pasta.
@param bool $flagCert indica que as chaves já foram passas... | [
"zInit",
"Método",
"de",
"inicialização",
"da",
"classe",
"irá",
"verificar",
"os",
"parâmetros",
"arquivos",
"e",
"validade",
"dos",
"mesmos",
"Em",
"caso",
"de",
"erro",
"o",
"motivo",
"da",
"falha",
"será",
"indicada",
"na",
"parâmetro",
"error",
"da",
"c... | train | https://github.com/phpnfe/tools/blob/303ca311989e0b345071f61b71d2b3bf7ee80454/src/Certificado/Pkcs12.php#L149-L182 |
phpnfe/tools | src/Certificado/Pkcs12.php | Pkcs12.loadPfxFile | public function loadPfxFile(
$pathPfx = '',
$password = '',
$createFiles = true,
$ignoreValidity = false,
$ignoreOwner = false
) {
if (! is_file($pathPfx)) {
throw new Exception(
"O nome do arquivo PFX deve ser passado. Não foi localizado o... | php | public function loadPfxFile(
$pathPfx = '',
$password = '',
$createFiles = true,
$ignoreValidity = false,
$ignoreOwner = false
) {
if (! is_file($pathPfx)) {
throw new Exception(
"O nome do arquivo PFX deve ser passado. Não foi localizado o... | [
"public",
"function",
"loadPfxFile",
"(",
"$",
"pathPfx",
"=",
"''",
",",
"$",
"password",
"=",
"''",
",",
"$",
"createFiles",
"=",
"true",
",",
"$",
"ignoreValidity",
"=",
"false",
",",
"$",
"ignoreOwner",
"=",
"false",
")",
"{",
"if",
"(",
"!",
"is... | loadPfxFile.
@param string $pathPfx caminho completo para o arquivo pfx
@param string $password senha para abrir o certificado pfx
@param bool $createFiles
@param bool $ignoreValidity
@param bool $ignoreOwner
@return bool | [
"loadPfxFile",
"."
] | train | https://github.com/phpnfe/tools/blob/303ca311989e0b345071f61b71d2b3bf7ee80454/src/Certificado/Pkcs12.php#L195-L210 |
phpnfe/tools | src/Certificado/Pkcs12.php | Pkcs12.loadPfx | public function loadPfx(
$pfxContent = '',
$password = '',
$createFiles = true,
$ignoreValidity = false,
$ignoreOwner = false
) {
if ($password == '') {
throw new Exception(
'A senha de acesso para o certificado pfx não pode ser vazia.'
... | php | public function loadPfx(
$pfxContent = '',
$password = '',
$createFiles = true,
$ignoreValidity = false,
$ignoreOwner = false
) {
if ($password == '') {
throw new Exception(
'A senha de acesso para o certificado pfx não pode ser vazia.'
... | [
"public",
"function",
"loadPfx",
"(",
"$",
"pfxContent",
"=",
"''",
",",
"$",
"password",
"=",
"''",
",",
"$",
"createFiles",
"=",
"true",
",",
"$",
"ignoreValidity",
"=",
"false",
",",
"$",
"ignoreOwner",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"pas... | loadPfx
Carrega um novo certificado no formato PFX
Isso deverá ocorrer a cada atualização do certificado digital, ou seja,
pelo menos uma vez por ano, uma vez que a validade do certificado
é anual.
Será verificado também se o certificado pertence realmente ao CNPJ
Essa verificação checa apenas se o certificado pertence... | [
"loadPfx",
"Carrega",
"um",
"novo",
"certificado",
"no",
"formato",
"PFX",
"Isso",
"deverá",
"ocorrer",
"a",
"cada",
"atualização",
"do",
"certificado",
"digital",
"ou",
"seja",
"pelo",
"menos",
"uma",
"vez",
"por",
"ano",
"uma",
"vez",
"que",
"a",
"validade... | train | https://github.com/phpnfe/tools/blob/303ca311989e0b345071f61b71d2b3bf7ee80454/src/Certificado/Pkcs12.php#L234-L283 |
phpnfe/tools | src/Certificado/Pkcs12.php | Pkcs12.zSavePemFiles | private function zSavePemFiles($x509certdata)
{
if (empty($this->pathCerts)) {
throw new Exception(
'Não está definido o diretório para armazenar os certificados.'
);
}
if (! is_dir($this->pathCerts)) {
throw new Exception(
... | php | private function zSavePemFiles($x509certdata)
{
if (empty($this->pathCerts)) {
throw new Exception(
'Não está definido o diretório para armazenar os certificados.'
);
}
if (! is_dir($this->pathCerts)) {
throw new Exception(
... | [
"private",
"function",
"zSavePemFiles",
"(",
"$",
"x509certdata",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"pathCerts",
")",
")",
"{",
"throw",
"new",
"Exception",
"(",
"'Não está definido o diretório para armazenar os certificados.'",
")",
";",
"}",
... | zSavePemFiles.
@param array $x509certdata
@throws Exception
@throws Exception | [
"zSavePemFiles",
"."
] | train | https://github.com/phpnfe/tools/blob/303ca311989e0b345071f61b71d2b3bf7ee80454/src/Certificado/Pkcs12.php#L291-L311 |
phpnfe/tools | src/Certificado/Pkcs12.php | Pkcs12.aadChain | public function aadChain($aCerts = [])
{
$certificate = $this->certKey;
foreach ($aCerts as $cert) {
if (is_file($cert)) {
$dados = file_get_contents($cert);
$certificate .= "\r\n" . $dados;
} else {
$certificate .= "\r\n" . $ce... | php | public function aadChain($aCerts = [])
{
$certificate = $this->certKey;
foreach ($aCerts as $cert) {
if (is_file($cert)) {
$dados = file_get_contents($cert);
$certificate .= "\r\n" . $dados;
} else {
$certificate .= "\r\n" . $ce... | [
"public",
"function",
"aadChain",
"(",
"$",
"aCerts",
"=",
"[",
"]",
")",
"{",
"$",
"certificate",
"=",
"$",
"this",
"->",
"certKey",
";",
"foreach",
"(",
"$",
"aCerts",
"as",
"$",
"cert",
")",
"{",
"if",
"(",
"is_file",
"(",
"$",
"cert",
")",
")... | aadChain.
@param array $aCerts Array com os caminhos completos para cada certificado da cadeia
ou um array com o conteúdo desses certificados
@return void | [
"aadChain",
"."
] | train | https://github.com/phpnfe/tools/blob/303ca311989e0b345071f61b71d2b3bf7ee80454/src/Certificado/Pkcs12.php#L319-L334 |
phpnfe/tools | src/Certificado/Pkcs12.php | Pkcs12.signXML | public function signXML($docxml, $tagid = '')
{
//caso não tenha as chaves cai fora
if ($this->pubKey == '' || $this->priKey == '') {
$msg = 'As chaves não estão disponíveis.';
throw new Exception($msg);
}
//caso não seja informada a tag a ser assinada cai for... | php | public function signXML($docxml, $tagid = '')
{
//caso não tenha as chaves cai fora
if ($this->pubKey == '' || $this->priKey == '') {
$msg = 'As chaves não estão disponíveis.';
throw new Exception($msg);
}
//caso não seja informada a tag a ser assinada cai for... | [
"public",
"function",
"signXML",
"(",
"$",
"docxml",
",",
"$",
"tagid",
"=",
"''",
")",
"{",
"//caso não tenha as chaves cai fora",
"if",
"(",
"$",
"this",
"->",
"pubKey",
"==",
"''",
"||",
"$",
"this",
"->",
"priKey",
"==",
"''",
")",
"{",
"$",
"msg",... | signXML.
@param string $docxml
@param string $tagid
@return string xml assinado
@throws Exception
@throws Exception | [
"signXML",
"."
] | train | https://github.com/phpnfe/tools/blob/303ca311989e0b345071f61b71d2b3bf7ee80454/src/Certificado/Pkcs12.php#L344-L390 |
phpnfe/tools | src/Certificado/Pkcs12.php | Pkcs12.zSignXML | public function zSignXML($xmldoc, $root, $node, $objSSLPriKey)
{
$nsDSIG = 'http://www.w3.org/2000/09/xmldsig#';
$nsCannonMethod = 'http://www.w3.org/TR/2001/REC-xml-c14n-20010315';
$nsSignatureMethod = 'http://www.w3.org/2000/09/xmldsig#rsa-sha1';
$nsTransformMethod1 = 'http://www.w... | php | public function zSignXML($xmldoc, $root, $node, $objSSLPriKey)
{
$nsDSIG = 'http://www.w3.org/2000/09/xmldsig#';
$nsCannonMethod = 'http://www.w3.org/TR/2001/REC-xml-c14n-20010315';
$nsSignatureMethod = 'http://www.w3.org/2000/09/xmldsig#rsa-sha1';
$nsTransformMethod1 = 'http://www.w... | [
"public",
"function",
"zSignXML",
"(",
"$",
"xmldoc",
",",
"$",
"root",
",",
"$",
"node",
",",
"$",
"objSSLPriKey",
")",
"{",
"$",
"nsDSIG",
"=",
"'http://www.w3.org/2000/09/xmldsig#'",
";",
"$",
"nsCannonMethod",
"=",
"'http://www.w3.org/TR/2001/REC-xml-c14n-200103... | zSignXML
Método que provê a assinatura do xml conforme padrão SEFAZ.
@param resource $objSSLPriKey
@return string xml assinado | [
"zSignXML",
"Método",
"que",
"provê",
"a",
"assinatura",
"do",
"xml",
"conforme",
"padrão",
"SEFAZ",
"."
] | train | https://github.com/phpnfe/tools/blob/303ca311989e0b345071f61b71d2b3bf7ee80454/src/Certificado/Pkcs12.php#L398-L503 |
phpnfe/tools | src/Certificado/Pkcs12.php | Pkcs12.zSignatureExists | private function zSignatureExists($dom)
{
$signature = $dom->getElementsByTagName('Signature')->item(0);
if (! isset($signature)) {
return false;
}
return true;
} | php | private function zSignatureExists($dom)
{
$signature = $dom->getElementsByTagName('Signature')->item(0);
if (! isset($signature)) {
return false;
}
return true;
} | [
"private",
"function",
"zSignatureExists",
"(",
"$",
"dom",
")",
"{",
"$",
"signature",
"=",
"$",
"dom",
"->",
"getElementsByTagName",
"(",
"'Signature'",
")",
"->",
"item",
"(",
"0",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"signature",
")",
")",
... | signatureExists
Check se o xml possi a tag Signature.
@param DOMDocument $dom
@return bool | [
"signatureExists",
"Check",
"se",
"o",
"xml",
"possi",
"a",
"tag",
"Signature",
"."
] | train | https://github.com/phpnfe/tools/blob/303ca311989e0b345071f61b71d2b3bf7ee80454/src/Certificado/Pkcs12.php#L511-L519 |
phpnfe/tools | src/Certificado/Pkcs12.php | Pkcs12.verifySignature | public function verifySignature($docxml = '', $tagid = '')
{
if ($docxml == '') {
$msg = 'Não foi passado um xml para a verificação.';
throw new Exception($msg);
}
if ($tagid == '') {
$msg = 'Não foi indicada a TAG a ser verificada.';
throw new... | php | public function verifySignature($docxml = '', $tagid = '')
{
if ($docxml == '') {
$msg = 'Não foi passado um xml para a verificação.';
throw new Exception($msg);
}
if ($tagid == '') {
$msg = 'Não foi indicada a TAG a ser verificada.';
throw new... | [
"public",
"function",
"verifySignature",
"(",
"$",
"docxml",
"=",
"''",
",",
"$",
"tagid",
"=",
"''",
")",
"{",
"if",
"(",
"$",
"docxml",
"==",
"''",
")",
"{",
"$",
"msg",
"=",
"'Não foi passado um xml para a verificação.';",
"",
"throw",
"new",
"Exception... | verifySignature
Verifica a validade da assinatura digital contida no xml.
@param string $docxml conteudo do xml a ser verificado ou o path completo
@param string $tagid tag que foi assinada no documento xml
@return bool
@throws Exception
@throws Exception | [
"verifySignature",
"Verifica",
"a",
"validade",
"da",
"assinatura",
"digital",
"contida",
"no",
"xml",
"."
] | train | https://github.com/phpnfe/tools/blob/303ca311989e0b345071f61b71d2b3bf7ee80454/src/Certificado/Pkcs12.php#L530-L550 |
phpnfe/tools | src/Certificado/Pkcs12.php | Pkcs12.zSignCheck | private function zSignCheck($dom)
{
// Obter e remontar a chave publica do xml
$x509Certificate = $dom->getNodeValue('X509Certificate');
$x509Certificate = "-----BEGIN CERTIFICATE-----\n"
. $this->zSplitLines($x509Certificate)
. "\n-----END CERTIFICATE-----\n";
... | php | private function zSignCheck($dom)
{
// Obter e remontar a chave publica do xml
$x509Certificate = $dom->getNodeValue('X509Certificate');
$x509Certificate = "-----BEGIN CERTIFICATE-----\n"
. $this->zSplitLines($x509Certificate)
. "\n-----END CERTIFICATE-----\n";
... | [
"private",
"function",
"zSignCheck",
"(",
"$",
"dom",
")",
"{",
"// Obter e remontar a chave publica do xml",
"$",
"x509Certificate",
"=",
"$",
"dom",
"->",
"getNodeValue",
"(",
"'X509Certificate'",
")",
";",
"$",
"x509Certificate",
"=",
"\"-----BEGIN CERTIFICATE-----\\... | zSignCheck.
@param DOMDocument $dom
@return bool
@throws Exception | [
"zSignCheck",
"."
] | train | https://github.com/phpnfe/tools/blob/303ca311989e0b345071f61b71d2b3bf7ee80454/src/Certificado/Pkcs12.php#L558-L587 |
phpnfe/tools | src/Certificado/Pkcs12.php | Pkcs12.zDigCheck | private function zDigCheck($dom, $tagid = '')
{
$node = $dom->getNode($tagid, 0);
if (empty($node)) {
throw new Exception(
"A tag < $tagid > não existe no XML!!"
);
}
if (! $this->zSignatureExists($dom)) {
$msg = 'O xml não contêm n... | php | private function zDigCheck($dom, $tagid = '')
{
$node = $dom->getNode($tagid, 0);
if (empty($node)) {
throw new Exception(
"A tag < $tagid > não existe no XML!!"
);
}
if (! $this->zSignatureExists($dom)) {
$msg = 'O xml não contêm n... | [
"private",
"function",
"zDigCheck",
"(",
"$",
"dom",
",",
"$",
"tagid",
"=",
"''",
")",
"{",
"$",
"node",
"=",
"$",
"dom",
"->",
"getNode",
"(",
"$",
"tagid",
",",
"0",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"node",
")",
")",
"{",
"throw",
"... | zDigCheck.
@param DOMDocument $dom
@param string $tagid
@return bool
@throws Exception | [
"zDigCheck",
"."
] | train | https://github.com/phpnfe/tools/blob/303ca311989e0b345071f61b71d2b3bf7ee80454/src/Certificado/Pkcs12.php#L596-L625 |
phpnfe/tools | src/Certificado/Pkcs12.php | Pkcs12.zValidCerts | protected function zValidCerts($pubKey)
{
if (! $data = openssl_x509_read($pubKey)) {
//o dado não é uma chave válida
$this->zRemovePemFiles();
$this->zLeaveParam();
$this->error = 'A chave passada está corrompida ou não é uma chave. Obtenha s chaves corretas!... | php | protected function zValidCerts($pubKey)
{
if (! $data = openssl_x509_read($pubKey)) {
//o dado não é uma chave válida
$this->zRemovePemFiles();
$this->zLeaveParam();
$this->error = 'A chave passada está corrompida ou não é uma chave. Obtenha s chaves corretas!... | [
"protected",
"function",
"zValidCerts",
"(",
"$",
"pubKey",
")",
"{",
"if",
"(",
"!",
"$",
"data",
"=",
"openssl_x509_read",
"(",
"$",
"pubKey",
")",
")",
"{",
"//o dado não é uma chave válida",
"$",
"this",
"->",
"zRemovePemFiles",
"(",
")",
";",
"$",
"th... | zValidCerts
Verifica a data de validade do certificado digital
e compara com a data de hoje.
Caso o certificado tenha expirado o mesmo será removido das
pastas e o método irá retornar false.
@param string $pubKey chave publica
@return bool | [
"zValidCerts",
"Verifica",
"a",
"data",
"de",
"validade",
"do",
"certificado",
"digital",
"e",
"compara",
"com",
"a",
"data",
"de",
"hoje",
".",
"Caso",
"o",
"certificado",
"tenha",
"expirado",
"o",
"mesmo",
"será",
"removido",
"das",
"pastas",
"e",
"o",
"... | train | https://github.com/phpnfe/tools/blob/303ca311989e0b345071f61b71d2b3bf7ee80454/src/Certificado/Pkcs12.php#L636-L667 |
phpnfe/tools | src/Certificado/Pkcs12.php | Pkcs12.zCleanPubKey | protected function zCleanPubKey()
{
//inicializa variavel
$data = '';
//carregar a chave publica
$pubKey = $this->pubKey;
//carrega o certificado em um array usando o LF como referencia
$arCert = explode("\n", $pubKey);
foreach ($arCert as $curData) {
... | php | protected function zCleanPubKey()
{
//inicializa variavel
$data = '';
//carregar a chave publica
$pubKey = $this->pubKey;
//carrega o certificado em um array usando o LF como referencia
$arCert = explode("\n", $pubKey);
foreach ($arCert as $curData) {
... | [
"protected",
"function",
"zCleanPubKey",
"(",
")",
"{",
"//inicializa variavel",
"$",
"data",
"=",
"''",
";",
"//carregar a chave publica",
"$",
"pubKey",
"=",
"$",
"this",
"->",
"pubKey",
";",
"//carrega o certificado em um array usando o LF como referencia",
"$",
"arC... | zCleanPubKey
Remove a informação de inicio e fim do certificado
contido no formato PEM, deixando o certificado (chave publica) pronta para ser
anexada ao xml da NFe.
@return string contendo o certificado limpo | [
"zCleanPubKey",
"Remove",
"a",
"informação",
"de",
"inicio",
"e",
"fim",
"do",
"certificado",
"contido",
"no",
"formato",
"PEM",
"deixando",
"o",
"certificado",
"(",
"chave",
"publica",
")",
"pronta",
"para",
"ser",
"anexada",
"ao",
"xml",
"da",
"NFe",
"."
] | train | https://github.com/phpnfe/tools/blob/303ca311989e0b345071f61b71d2b3bf7ee80454/src/Certificado/Pkcs12.php#L676-L694 |
phpnfe/tools | src/Certificado/Pkcs12.php | Pkcs12.zSplitLines | protected function zSplitLines($cntIn = '')
{
if ($cntIn != '') {
$cnt = rtrim(chunk_split(str_replace(["\r", "\n"], '', $cntIn), 76, "\n"));
} else {
$cnt = $cntIn;
}
return $cnt;
} | php | protected function zSplitLines($cntIn = '')
{
if ($cntIn != '') {
$cnt = rtrim(chunk_split(str_replace(["\r", "\n"], '', $cntIn), 76, "\n"));
} else {
$cnt = $cntIn;
}
return $cnt;
} | [
"protected",
"function",
"zSplitLines",
"(",
"$",
"cntIn",
"=",
"''",
")",
"{",
"if",
"(",
"$",
"cntIn",
"!=",
"''",
")",
"{",
"$",
"cnt",
"=",
"rtrim",
"(",
"chunk_split",
"(",
"str_replace",
"(",
"[",
"\"\\r\"",
",",
"\"\\n\"",
"]",
",",
"''",
",... | zSplitLines
Divide a string do certificado publico em linhas
com 76 caracteres (padrão original).
@param string $cntIn certificado
@return string certificado reformatado | [
"zSplitLines",
"Divide",
"a",
"string",
"do",
"certificado",
"publico",
"em",
"linhas",
"com",
"76",
"caracteres",
"(",
"padrão",
"original",
")",
"."
] | train | https://github.com/phpnfe/tools/blob/303ca311989e0b345071f61b71d2b3bf7ee80454/src/Certificado/Pkcs12.php#L703-L712 |
phpnfe/tools | src/Certificado/Pkcs12.php | Pkcs12.zRemovePemFiles | private function zRemovePemFiles()
{
if (is_file($this->pubKeyFile)) {
unlink($this->pubKeyFile);
}
if (is_file($this->priKeyFile)) {
unlink($this->priKeyFile);
}
if (is_file($this->certKeyFile)) {
unlink($this->certKeyFile);
}
... | php | private function zRemovePemFiles()
{
if (is_file($this->pubKeyFile)) {
unlink($this->pubKeyFile);
}
if (is_file($this->priKeyFile)) {
unlink($this->priKeyFile);
}
if (is_file($this->certKeyFile)) {
unlink($this->certKeyFile);
}
... | [
"private",
"function",
"zRemovePemFiles",
"(",
")",
"{",
"if",
"(",
"is_file",
"(",
"$",
"this",
"->",
"pubKeyFile",
")",
")",
"{",
"unlink",
"(",
"$",
"this",
"->",
"pubKeyFile",
")",
";",
"}",
"if",
"(",
"is_file",
"(",
"$",
"this",
"->",
"priKeyFi... | zRemovePemFiles
Apaga os arquivos PEM do diretório
Isso deve ser feito quando um novo certificado é carregado
ou quando a validade do certificado expirou. | [
"zRemovePemFiles",
"Apaga",
"os",
"arquivos",
"PEM",
"do",
"diretório",
"Isso",
"deve",
"ser",
"feito",
"quando",
"um",
"novo",
"certificado",
"é",
"carregado",
"ou",
"quando",
"a",
"validade",
"do",
"certificado",
"expirou",
"."
] | train | https://github.com/phpnfe/tools/blob/303ca311989e0b345071f61b71d2b3bf7ee80454/src/Certificado/Pkcs12.php#L720-L731 |
phpnfe/tools | src/Certificado/Pkcs12.php | Pkcs12.zLeaveParam | private function zLeaveParam()
{
$this->pfxCert = '';
$this->pubKey = '';
$this->priKey = '';
$this->certKey = '';
$this->pubKeyFile = '';
$this->priKeyFile = '';
$this->certKeyFile = '';
$this->expireTimestamp = '';
} | php | private function zLeaveParam()
{
$this->pfxCert = '';
$this->pubKey = '';
$this->priKey = '';
$this->certKey = '';
$this->pubKeyFile = '';
$this->priKeyFile = '';
$this->certKeyFile = '';
$this->expireTimestamp = '';
} | [
"private",
"function",
"zLeaveParam",
"(",
")",
"{",
"$",
"this",
"->",
"pfxCert",
"=",
"''",
";",
"$",
"this",
"->",
"pubKey",
"=",
"''",
";",
"$",
"this",
"->",
"priKey",
"=",
"''",
";",
"$",
"this",
"->",
"certKey",
"=",
"''",
";",
"$",
"this"... | zLeaveParam
Limpa os parametros da classe. | [
"zLeaveParam",
"Limpa",
"os",
"parametros",
"da",
"classe",
"."
] | train | https://github.com/phpnfe/tools/blob/303ca311989e0b345071f61b71d2b3bf7ee80454/src/Certificado/Pkcs12.php#L737-L747 |
heidelpay/PhpDoc | src/phpDocumentor/Descriptor/DescriptorAbstract.php | DescriptorAbstract.getSummary | public function getSummary()
{
if ($this->summary && strtolower(trim($this->summary)) != '{@inheritdoc}') {
return $this->summary;
}
$parent = $this->getInheritedElement();
if ($parent instanceof DescriptorAbstract) {
return $parent->getSummary();
}
... | php | public function getSummary()
{
if ($this->summary && strtolower(trim($this->summary)) != '{@inheritdoc}') {
return $this->summary;
}
$parent = $this->getInheritedElement();
if ($parent instanceof DescriptorAbstract) {
return $parent->getSummary();
}
... | [
"public",
"function",
"getSummary",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"summary",
"&&",
"strtolower",
"(",
"trim",
"(",
"$",
"this",
"->",
"summary",
")",
")",
"!=",
"'{@inheritdoc}'",
")",
"{",
"return",
"$",
"this",
"->",
"summary",
";",
... | Returns the summary which describes this element.
This method will automatically attempt to inherit the parent's summary if this one has none.
@return string | [
"Returns",
"the",
"summary",
"which",
"describes",
"this",
"element",
"."
] | train | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Descriptor/DescriptorAbstract.php#L148-L160 |
heidelpay/PhpDoc | src/phpDocumentor/Descriptor/DescriptorAbstract.php | DescriptorAbstract.getDescription | public function getDescription()
{
if ($this->description && strpos(strtolower($this->description), '{@inheritdoc}') === false) {
return $this->description;
}
$parentElement = $this->getInheritedElement();
if ($parentElement instanceof DescriptorAbstract) {
$... | php | public function getDescription()
{
if ($this->description && strpos(strtolower($this->description), '{@inheritdoc}') === false) {
return $this->description;
}
$parentElement = $this->getInheritedElement();
if ($parentElement instanceof DescriptorAbstract) {
$... | [
"public",
"function",
"getDescription",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"description",
"&&",
"strpos",
"(",
"strtolower",
"(",
"$",
"this",
"->",
"description",
")",
",",
"'{@inheritdoc}'",
")",
"===",
"false",
")",
"{",
"return",
"$",
"this... | Returns the description for this element.
This method will automatically attempt to inherit the parent's description if this one has none.
@return string | [
"Returns",
"the",
"description",
"for",
"this",
"element",
"."
] | train | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Descriptor/DescriptorAbstract.php#L181-L197 |
heidelpay/PhpDoc | src/phpDocumentor/Descriptor/DescriptorAbstract.php | DescriptorAbstract.getPackage | public function getPackage()
{
$inheritedElement = $this->getInheritedElement();
if ($this->package instanceof PackageDescriptor
&& ! ($this->package->getName() === '\\' && $inheritedElement)) {
return $this->package;
}
if ($inheritedElement instanceof Descri... | php | public function getPackage()
{
$inheritedElement = $this->getInheritedElement();
if ($this->package instanceof PackageDescriptor
&& ! ($this->package->getName() === '\\' && $inheritedElement)) {
return $this->package;
}
if ($inheritedElement instanceof Descri... | [
"public",
"function",
"getPackage",
"(",
")",
"{",
"$",
"inheritedElement",
"=",
"$",
"this",
"->",
"getInheritedElement",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"package",
"instanceof",
"PackageDescriptor",
"&&",
"!",
"(",
"$",
"this",
"->",
"packag... | Returns the package name for this element.
@return PackageDescriptor | [
"Returns",
"the",
"package",
"name",
"for",
"this",
"element",
"."
] | train | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Descriptor/DescriptorAbstract.php#L306-L319 |
wenbinye/PhalconX | src/Php/NodeVisitor.php | NodeVisitor.buildMethods | protected function buildMethods()
{
$refl = new \ReflectionClass($this);
$enterMethods = [];
$leaveMethods = [];
foreach ($refl->getMethods() as $method) {
$name = $method->getName();
if (preg_match('/^(enter|leave).+/', $name) && !preg_match('/^(enter|leave)... | php | protected function buildMethods()
{
$refl = new \ReflectionClass($this);
$enterMethods = [];
$leaveMethods = [];
foreach ($refl->getMethods() as $method) {
$name = $method->getName();
if (preg_match('/^(enter|leave).+/', $name) && !preg_match('/^(enter|leave)... | [
"protected",
"function",
"buildMethods",
"(",
")",
"{",
"$",
"refl",
"=",
"new",
"\\",
"ReflectionClass",
"(",
"$",
"this",
")",
";",
"$",
"enterMethods",
"=",
"[",
"]",
";",
"$",
"leaveMethods",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"refl",
"->",... | collect all rule method according to node type of parameter | [
"collect",
"all",
"rule",
"method",
"according",
"to",
"node",
"type",
"of",
"parameter"
] | train | https://github.com/wenbinye/PhalconX/blob/0d2e1480e722dde56ccd23b2e8a5c8ac6ac2f8e1/src/Php/NodeVisitor.php#L57-L79 |
dave-redfern/somnambulist-value-objects | src/AbstractValueObject.php | AbstractValueObject.equals | public function equals($object): bool
{
if (get_class($this) === get_class($object)) {
$props = Collection::collect((new \ReflectionObject($this))->getProperties());
return $props
->filter(function ($prop) use ($object) {
/** @var \ReflectionPrope... | php | public function equals($object): bool
{
if (get_class($this) === get_class($object)) {
$props = Collection::collect((new \ReflectionObject($this))->getProperties());
return $props
->filter(function ($prop) use ($object) {
/** @var \ReflectionPrope... | [
"public",
"function",
"equals",
"(",
"$",
"object",
")",
":",
"bool",
"{",
"if",
"(",
"get_class",
"(",
"$",
"this",
")",
"===",
"get_class",
"(",
"$",
"object",
")",
")",
"{",
"$",
"props",
"=",
"Collection",
"::",
"collect",
"(",
"(",
"new",
"\\"... | @param AbstractValueObject $object
@return bool | [
"@param",
"AbstractValueObject",
"$object"
] | train | https://github.com/dave-redfern/somnambulist-value-objects/blob/dbae7fea7140b36e105ed3f5e21a42316ea3061f/src/AbstractValueObject.php#L55-L72 |
heidelpay/PhpDoc | src/phpDocumentor/Descriptor/FunctionDescriptor.php | FunctionDescriptor.getResponse | public function getResponse()
{
/** @var Collection|null $returnTags */
$returnTags = $this->getTags()->get('return');
return $returnTags instanceof Collection ? current($returnTags->getAll()) : null;
} | php | public function getResponse()
{
/** @var Collection|null $returnTags */
$returnTags = $this->getTags()->get('return');
return $returnTags instanceof Collection ? current($returnTags->getAll()) : null;
} | [
"public",
"function",
"getResponse",
"(",
")",
"{",
"/** @var Collection|null $returnTags */",
"$",
"returnTags",
"=",
"$",
"this",
"->",
"getTags",
"(",
")",
"->",
"get",
"(",
"'return'",
")",
";",
"return",
"$",
"returnTags",
"instanceof",
"Collection",
"?",
... | {@inheritDoc} | [
"{"
] | train | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Descriptor/FunctionDescriptor.php#L51-L57 |
trunda/SmfMenu | src/Smf/Menu/Renderer/BootstrapNavRenderer.php | BootstrapNavRenderer.setDefaults | protected function setDefaults(array $defaultOptions = array())
{
$defaultOptions = array_merge(array(
'depth' => null,
'ancestorCurrencyDepth' => null,
'currentClass' => 'active',
'ancestorClass' => 'active',
'firstClass' => null,
'las... | php | protected function setDefaults(array $defaultOptions = array())
{
$defaultOptions = array_merge(array(
'depth' => null,
'ancestorCurrencyDepth' => null,
'currentClass' => 'active',
'ancestorClass' => 'active',
'firstClass' => null,
'las... | [
"protected",
"function",
"setDefaults",
"(",
"array",
"$",
"defaultOptions",
"=",
"array",
"(",
")",
")",
"{",
"$",
"defaultOptions",
"=",
"array_merge",
"(",
"array",
"(",
"'depth'",
"=>",
"null",
",",
"'ancestorCurrencyDepth'",
"=>",
"null",
",",
"'currentCl... | Overwriting some options - classes, etc.
@param array $defaultOptions | [
"Overwriting",
"some",
"options",
"-",
"classes",
"etc",
"."
] | train | https://github.com/trunda/SmfMenu/blob/739e74fb664c1f018b4a74142bd28d20c004bac6/src/Smf/Menu/Renderer/BootstrapNavRenderer.php#L19-L31 |
dragonmantank/fillet | src/Fillet/Writer/PostWriter.php | PostWriter.write | public function write($data)
{
$post_date_string = $data['post_date']->format('Y-m-d H:i:s');
$slug = $this->generateSlug($data['title']);
$filename = $data['post_date']->format('Y-m-d') . '-' . $slug;
$headerData = [
'title' => $data['title'],
'date' => $post_date_string,
'layou... | php | public function write($data)
{
$post_date_string = $data['post_date']->format('Y-m-d H:i:s');
$slug = $this->generateSlug($data['title']);
$filename = $data['post_date']->format('Y-m-d') . '-' . $slug;
$headerData = [
'title' => $data['title'],
'date' => $post_date_string,
'layou... | [
"public",
"function",
"write",
"(",
"$",
"data",
")",
"{",
"$",
"post_date_string",
"=",
"$",
"data",
"[",
"'post_date'",
"]",
"->",
"format",
"(",
"'Y-m-d H:i:s'",
")",
";",
"$",
"slug",
"=",
"$",
"this",
"->",
"generateSlug",
"(",
"$",
"data",
"[",
... | Write out a set of data into a file
@param array $data Data to use for constructing the page | [
"Write",
"out",
"a",
"set",
"of",
"data",
"into",
"a",
"file"
] | train | https://github.com/dragonmantank/fillet/blob/b197947608c05ac2318e8f6b296345494004d9c6/src/Fillet/Writer/PostWriter.php#L19-L45 |
kuria/url | src/Url.php | Url.parse | static function parse(string $url, ?int $preferredFormat = self::ABSOLUTE)
{
$components = parse_url($url);
if ($components === false) {
throw new InvalidUrlException(sprintf('The given URL "%s" is invalid', $url));
}
$query = [];
if (isset($components['query']... | php | static function parse(string $url, ?int $preferredFormat = self::ABSOLUTE)
{
$components = parse_url($url);
if ($components === false) {
throw new InvalidUrlException(sprintf('The given URL "%s" is invalid', $url));
}
$query = [];
if (isset($components['query']... | [
"static",
"function",
"parse",
"(",
"string",
"$",
"url",
",",
"?",
"int",
"$",
"preferredFormat",
"=",
"self",
"::",
"ABSOLUTE",
")",
"{",
"$",
"components",
"=",
"parse_url",
"(",
"$",
"url",
")",
";",
"if",
"(",
"$",
"components",
"===",
"false",
... | Parse an URL
@throws InvalidUrlException if the URL is invalid
@return static | [
"Parse",
"an",
"URL"
] | train | https://github.com/kuria/url/blob/5f405abb9bd4b722a907363b3d7c43207365c411/src/Url.php#L63-L86 |
kuria/url | src/Url.php | Url.getFullHost | function getFullHost(): ?string
{
if ($this->host === null) {
return null;
}
$fullHost = $this->host;
if ($this->port !== null) {
$fullHost .= ':' . $this->port;
}
return $fullHost;
} | php | function getFullHost(): ?string
{
if ($this->host === null) {
return null;
}
$fullHost = $this->host;
if ($this->port !== null) {
$fullHost .= ':' . $this->port;
}
return $fullHost;
} | [
"function",
"getFullHost",
"(",
")",
":",
"?",
"string",
"{",
"if",
"(",
"$",
"this",
"->",
"host",
"===",
"null",
")",
"{",
"return",
"null",
";",
"}",
"$",
"fullHost",
"=",
"$",
"this",
"->",
"host",
";",
"if",
"(",
"$",
"this",
"->",
"port",
... | Get host name, including the port, if defined
E.g. example.com:8080 | [
"Get",
"host",
"name",
"including",
"the",
"port",
"if",
"defined"
] | train | https://github.com/kuria/url/blob/5f405abb9bd4b722a907363b3d7c43207365c411/src/Url.php#L113-L126 |
kuria/url | src/Url.php | Url.add | function add(array $parameters): void
{
foreach ($parameters as $parameter => $value) {
$this->query[$parameter] = $value;
}
} | php | function add(array $parameters): void
{
foreach ($parameters as $parameter => $value) {
$this->query[$parameter] = $value;
}
} | [
"function",
"add",
"(",
"array",
"$",
"parameters",
")",
":",
"void",
"{",
"foreach",
"(",
"$",
"parameters",
"as",
"$",
"parameter",
"=>",
"$",
"value",
")",
"{",
"$",
"this",
"->",
"query",
"[",
"$",
"parameter",
"]",
"=",
"$",
"value",
";",
"}",... | Add multiple query parameters
Already defined parameters with the same key will be overriden. | [
"Add",
"multiple",
"query",
"parameters"
] | train | https://github.com/kuria/url/blob/5f405abb9bd4b722a907363b3d7c43207365c411/src/Url.php#L258-L263 |
kuria/url | src/Url.php | Url.build | function build(): string
{
if ($this->host !== null && $this->preferredFormat === static::ABSOLUTE) {
return $this->buildAbsolute();
} else {
return $this->buildRelative();
}
} | php | function build(): string
{
if ($this->host !== null && $this->preferredFormat === static::ABSOLUTE) {
return $this->buildAbsolute();
} else {
return $this->buildRelative();
}
} | [
"function",
"build",
"(",
")",
":",
"string",
"{",
"if",
"(",
"$",
"this",
"->",
"host",
"!==",
"null",
"&&",
"$",
"this",
"->",
"preferredFormat",
"===",
"static",
"::",
"ABSOLUTE",
")",
"{",
"return",
"$",
"this",
"->",
"buildAbsolute",
"(",
")",
"... | Build an absolute or relative URL
- if no host is specified, a relative URL will be returned
- if the host is specified, an absolute URL will be returned
(unless the preferred format option is set to relative)
@see Url::setPreferredFormat() | [
"Build",
"an",
"absolute",
"or",
"relative",
"URL"
] | train | https://github.com/kuria/url/blob/5f405abb9bd4b722a907363b3d7c43207365c411/src/Url.php#L292-L299 |
kuria/url | src/Url.php | Url.buildAbsolute | function buildAbsolute(): string
{
$output = '';
if ($this->host === null) {
throw new IncompleteUrlException('No host specified');
}
// scheme
if ($this->scheme !== null) {
$output .= $this->scheme;
$output .= '://';
} else {
... | php | function buildAbsolute(): string
{
$output = '';
if ($this->host === null) {
throw new IncompleteUrlException('No host specified');
}
// scheme
if ($this->scheme !== null) {
$output .= $this->scheme;
$output .= '://';
} else {
... | [
"function",
"buildAbsolute",
"(",
")",
":",
"string",
"{",
"$",
"output",
"=",
"''",
";",
"if",
"(",
"$",
"this",
"->",
"host",
"===",
"null",
")",
"{",
"throw",
"new",
"IncompleteUrlException",
"(",
"'No host specified'",
")",
";",
"}",
"// scheme",
"if... | Build an absolute URL
@throws IncompleteUrlException if no host is specified | [
"Build",
"an",
"absolute",
"URL"
] | train | https://github.com/kuria/url/blob/5f405abb9bd4b722a907363b3d7c43207365c411/src/Url.php#L306-L335 |
kuria/url | src/Url.php | Url.buildRelative | function buildRelative(): string
{
$output = '';
// path
$output .= $this->path;
// query
if ($this->query) {
$output .= '?';
$output .= $this->getQueryString();
}
// fragment
if ($this->fragment !== null) {
$outp... | php | function buildRelative(): string
{
$output = '';
// path
$output .= $this->path;
// query
if ($this->query) {
$output .= '?';
$output .= $this->getQueryString();
}
// fragment
if ($this->fragment !== null) {
$outp... | [
"function",
"buildRelative",
"(",
")",
":",
"string",
"{",
"$",
"output",
"=",
"''",
";",
"// path",
"$",
"output",
".=",
"$",
"this",
"->",
"path",
";",
"// query",
"if",
"(",
"$",
"this",
"->",
"query",
")",
"{",
"$",
"output",
".=",
"'?'",
";",
... | Build a relative URL | [
"Build",
"a",
"relative",
"URL"
] | train | https://github.com/kuria/url/blob/5f405abb9bd4b722a907363b3d7c43207365c411/src/Url.php#L340-L360 |
mmanos/laravel-casset | src/Mmanos/Casset/Casset.php | Casset.container | public function container($container = 'default')
{
if (!isset($this->containers[$container])) {
$this->containers[$container] = new Container($container);
}
return $this->containers[$container];
} | php | public function container($container = 'default')
{
if (!isset($this->containers[$container])) {
$this->containers[$container] = new Container($container);
}
return $this->containers[$container];
} | [
"public",
"function",
"container",
"(",
"$",
"container",
"=",
"'default'",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"containers",
"[",
"$",
"container",
"]",
")",
")",
"{",
"$",
"this",
"->",
"containers",
"[",
"$",
"container",
"]... | Retrieve the requested asset container object.
@param string $container Name of container.
@return Container | [
"Retrieve",
"the",
"requested",
"asset",
"container",
"object",
"."
] | train | https://github.com/mmanos/laravel-casset/blob/0f7db71211c1daa99bde30afa41da2692a39b81c/src/Mmanos/Casset/Casset.php#L19-L26 |
ezsystems/ezcomments-ls-extension | classes/ezcomutility.php | ezcomUtility.validateURLString | public static function validateURLString( $value )
{
if( preg_match( "/^(java|vb)script:.*/i" , $value ) )
{
return ezpI18n::tr( 'ezcomments/comment/add', 'Javascript code in url is not allowed.' );
}
if( preg_match( "/^mailto:(.*)/i" , $value ) )
{
re... | php | public static function validateURLString( $value )
{
if( preg_match( "/^(java|vb)script:.*/i" , $value ) )
{
return ezpI18n::tr( 'ezcomments/comment/add', 'Javascript code in url is not allowed.' );
}
if( preg_match( "/^mailto:(.*)/i" , $value ) )
{
re... | [
"public",
"static",
"function",
"validateURLString",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"preg_match",
"(",
"\"/^(java|vb)script:.*/i\"",
",",
"$",
"value",
")",
")",
"{",
"return",
"ezpI18n",
"::",
"tr",
"(",
"'ezcomments/comment/add'",
",",
"'Javascript co... | validate url string. URL can not start with javascript/vbscript/mailto | [
"validate",
"url",
"string",
".",
"URL",
"can",
"not",
"start",
"with",
"javascript",
"/",
"vbscript",
"/",
"mailto"
] | train | https://github.com/ezsystems/ezcomments-ls-extension/blob/2b4cd8c34d4a77813e4d6a9c5a0d317a274c63c5/classes/ezcomutility.php#L19-L30 |
xiewulong/yii2-fileupload | oss/libs/guzzle/http/Guzzle/Http/Client.php | Client.preparePharCacert | public function preparePharCacert($md5Check = true)
{
$from = __DIR__ . '/Resources/cacert.pem';
$certFile = sys_get_temp_dir() . '/guzzle-cacert.pem';
if (!file_exists($certFile) && !copy($from, $certFile)) {
throw new RuntimeException("Could not copy {$from} to {$certFile}: " .... | php | public function preparePharCacert($md5Check = true)
{
$from = __DIR__ . '/Resources/cacert.pem';
$certFile = sys_get_temp_dir() . '/guzzle-cacert.pem';
if (!file_exists($certFile) && !copy($from, $certFile)) {
throw new RuntimeException("Could not copy {$from} to {$certFile}: " .... | [
"public",
"function",
"preparePharCacert",
"(",
"$",
"md5Check",
"=",
"true",
")",
"{",
"$",
"from",
"=",
"__DIR__",
".",
"'/Resources/cacert.pem'",
";",
"$",
"certFile",
"=",
"sys_get_temp_dir",
"(",
")",
".",
"'/guzzle-cacert.pem'",
";",
"if",
"(",
"!",
"f... | Copy the cacert.pem file from the phar if it is not in the temp folder and validate the MD5 checksum
@param bool $md5Check Set to false to not perform the MD5 validation
@return string Returns the path to the extracted cacert
@throws RuntimeException if the file cannot be copied or there is a MD5 mismatch | [
"Copy",
"the",
"cacert",
".",
"pem",
"file",
"from",
"the",
"phar",
"if",
"it",
"is",
"not",
"in",
"the",
"temp",
"folder",
"and",
"validate",
"the",
"MD5",
"checksum"
] | train | https://github.com/xiewulong/yii2-fileupload/blob/3e75b17a4a18dd8466e3f57c63136de03470ca82/oss/libs/guzzle/http/Guzzle/Http/Client.php#L344-L359 |
xiewulong/yii2-fileupload | oss/libs/guzzle/http/Guzzle/Http/Client.php | Client.initSsl | protected function initSsl()
{
if ('system' == ($authority = $this->config[self::SSL_CERT_AUTHORITY])) {
return;
}
if ($authority === null) {
$authority = true;
}
if ($authority === true && substr(__FILE__, 0, 7) == 'phar://') {
$authorit... | php | protected function initSsl()
{
if ('system' == ($authority = $this->config[self::SSL_CERT_AUTHORITY])) {
return;
}
if ($authority === null) {
$authority = true;
}
if ($authority === true && substr(__FILE__, 0, 7) == 'phar://') {
$authorit... | [
"protected",
"function",
"initSsl",
"(",
")",
"{",
"if",
"(",
"'system'",
"==",
"(",
"$",
"authority",
"=",
"$",
"this",
"->",
"config",
"[",
"self",
"::",
"SSL_CERT_AUTHORITY",
"]",
")",
")",
"{",
"return",
";",
"}",
"if",
"(",
"$",
"authority",
"==... | Initializes SSL settings | [
"Initializes",
"SSL",
"settings"
] | train | https://github.com/xiewulong/yii2-fileupload/blob/3e75b17a4a18dd8466e3f57c63136de03470ca82/oss/libs/guzzle/http/Guzzle/Http/Client.php#L458-L479 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Base/src/file.php | ezcBaseFile.findRecursiveCallback | static protected function findRecursiveCallback( ezcBaseFileFindContext $context, $sourceDir, $fileName, $fileInfo )
{
// ignore if we have a directory
if ( $fileInfo['mode'] & 0x4000 )
{
return;
}
// update the statistics
$context->elements[] = $sourceDi... | php | static protected function findRecursiveCallback( ezcBaseFileFindContext $context, $sourceDir, $fileName, $fileInfo )
{
// ignore if we have a directory
if ( $fileInfo['mode'] & 0x4000 )
{
return;
}
// update the statistics
$context->elements[] = $sourceDi... | [
"static",
"protected",
"function",
"findRecursiveCallback",
"(",
"ezcBaseFileFindContext",
"$",
"context",
",",
"$",
"sourceDir",
",",
"$",
"fileName",
",",
"$",
"fileInfo",
")",
"{",
"// ignore if we have a directory",
"if",
"(",
"$",
"fileInfo",
"[",
"'mode'",
"... | This is the callback used by findRecursive to collect data.
This callback method works together with walkRecursive() and is called
for every file/and or directory. The $context is a callback specific
container in which data can be stored and shared between the different
calls to the callback function. The walkRecursiv... | [
"This",
"is",
"the",
"callback",
"used",
"by",
"findRecursive",
"to",
"collect",
"data",
"."
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Base/src/file.php#L58-L70 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Base/src/file.php | ezcBaseFile.walkRecursive | static public function walkRecursive( $sourceDir, array $includeFilters = array(), array $excludeFilters = array(), $callback, &$callbackContext )
{
if ( !is_dir( $sourceDir ) )
{
throw new ezcBaseFileNotFoundException( $sourceDir, 'directory' );
}
$elements = array();
... | php | static public function walkRecursive( $sourceDir, array $includeFilters = array(), array $excludeFilters = array(), $callback, &$callbackContext )
{
if ( !is_dir( $sourceDir ) )
{
throw new ezcBaseFileNotFoundException( $sourceDir, 'directory' );
}
$elements = array();
... | [
"static",
"public",
"function",
"walkRecursive",
"(",
"$",
"sourceDir",
",",
"array",
"$",
"includeFilters",
"=",
"array",
"(",
")",
",",
"array",
"$",
"excludeFilters",
"=",
"array",
"(",
")",
",",
"$",
"callback",
",",
"&",
"$",
"callbackContext",
")",
... | Walks files and directories recursively on a file system
This method walks over a directory and calls a callback from every file
and directory it finds. You can use $includeFilters to include only
specific files, and $excludeFilters to exclude certain files from being
returned. The function will always go into subdire... | [
"Walks",
"files",
"and",
"directories",
"recursively",
"on",
"a",
"file",
"system"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Base/src/file.php#L113-L190 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Base/src/file.php | ezcBaseFile.findRecursive | static public function findRecursive( $sourceDir, array $includeFilters = array(), array $excludeFilters = array(), &$statistics = null )
{
// init statistics array
if ( !is_array( $statistics ) || !array_key_exists( 'size', $statistics ) || !array_key_exists( 'count', $statistics ) )
{
... | php | static public function findRecursive( $sourceDir, array $includeFilters = array(), array $excludeFilters = array(), &$statistics = null )
{
// init statistics array
if ( !is_array( $statistics ) || !array_key_exists( 'size', $statistics ) || !array_key_exists( 'count', $statistics ) )
{
... | [
"static",
"public",
"function",
"findRecursive",
"(",
"$",
"sourceDir",
",",
"array",
"$",
"includeFilters",
"=",
"array",
"(",
")",
",",
"array",
"$",
"excludeFilters",
"=",
"array",
"(",
")",
",",
"&",
"$",
"statistics",
"=",
"null",
")",
"{",
"// init... | Finds files recursively on a file system
With this method you can scan the file system for files. You can use
$includeFilters to include only specific files, and $excludeFilters to
exclude certain files from being returned. The function will always go
into subdirectories even if the entry would not have passed the fil... | [
"Finds",
"files",
"recursively",
"on",
"a",
"file",
"system"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Base/src/file.php#L222-L242 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Base/src/file.php | ezcBaseFile.removeRecursive | static public function removeRecursive( $directory )
{
$sourceDir = realpath( $directory );
if ( !$sourceDir )
{
throw new ezcBaseFileNotFoundException( $directory, 'directory' );
}
$d = @dir( $sourceDir );
if ( !$d )
{
throw new ezcBas... | php | static public function removeRecursive( $directory )
{
$sourceDir = realpath( $directory );
if ( !$sourceDir )
{
throw new ezcBaseFileNotFoundException( $directory, 'directory' );
}
$d = @dir( $sourceDir );
if ( !$d )
{
throw new ezcBas... | [
"static",
"public",
"function",
"removeRecursive",
"(",
"$",
"directory",
")",
"{",
"$",
"sourceDir",
"=",
"realpath",
"(",
"$",
"directory",
")",
";",
"if",
"(",
"!",
"$",
"sourceDir",
")",
"{",
"throw",
"new",
"ezcBaseFileNotFoundException",
"(",
"$",
"d... | Removes files and directories recursively from a file system
This method recursively removes the $directory and all its contents.
You should be <b>extremely</b> careful with this method as it has the
potential to erase everything that the current user has access to.
@param string $directory | [
"Removes",
"files",
"and",
"directories",
"recursively",
"from",
"a",
"file",
"system"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Base/src/file.php#L254-L294 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Base/src/file.php | ezcBaseFile.copyRecursive | static public function copyRecursive( $source, $destination, $depth = -1, $dirMode = 0775, $fileMode = 0664 )
{
// Check if source file exists at all.
if ( !is_file( $source ) && !is_dir( $source ) )
{
throw new ezcBaseFileNotFoundException( $source );
}
// Desti... | php | static public function copyRecursive( $source, $destination, $depth = -1, $dirMode = 0775, $fileMode = 0664 )
{
// Check if source file exists at all.
if ( !is_file( $source ) && !is_dir( $source ) )
{
throw new ezcBaseFileNotFoundException( $source );
}
// Desti... | [
"static",
"public",
"function",
"copyRecursive",
"(",
"$",
"source",
",",
"$",
"destination",
",",
"$",
"depth",
"=",
"-",
"1",
",",
"$",
"dirMode",
"=",
"0775",
",",
"$",
"fileMode",
"=",
"0664",
")",
"{",
"// Check if source file exists at all.",
"if",
"... | Recursively copy a file or directory.
Recursively copy a file or directory in $source to the given
destination. If a depth is given, the operation will stop, if the given
recursion depth is reached. A depth of -1 means no limit, while a depth
of 0 means, that only the current file or directory will be copied,
without ... | [
"Recursively",
"copy",
"a",
"file",
"or",
"directory",
"."
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Base/src/file.php#L320-L377 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Base/src/file.php | ezcBaseFile.calculateRelativePath | static public function calculateRelativePath( $path, $base )
{
// Sanitize the paths to use the correct directory separator for the platform
$path = strtr( $path, '\\/', DIRECTORY_SEPARATOR . DIRECTORY_SEPARATOR );
$base = strtr( $base, '\\/', DIRECTORY_SEPARATOR . DIRECTORY_SEPARATOR );
... | php | static public function calculateRelativePath( $path, $base )
{
// Sanitize the paths to use the correct directory separator for the platform
$path = strtr( $path, '\\/', DIRECTORY_SEPARATOR . DIRECTORY_SEPARATOR );
$base = strtr( $base, '\\/', DIRECTORY_SEPARATOR . DIRECTORY_SEPARATOR );
... | [
"static",
"public",
"function",
"calculateRelativePath",
"(",
"$",
"path",
",",
"$",
"base",
")",
"{",
"// Sanitize the paths to use the correct directory separator for the platform",
"$",
"path",
"=",
"strtr",
"(",
"$",
"path",
",",
"'\\\\/'",
",",
"DIRECTORY_SEPARATOR... | Calculates the relative path of the file/directory '$path' to a given
$base path.
$path and $base should be fully absolute paths. This function returns the
answer of "How do I go from $base to $path". If the $path and $base are
the same path, the function returns '.'. This method does not touch the
filesystem.
@param... | [
"Calculates",
"the",
"relative",
"path",
"of",
"the",
"file",
"/",
"directory",
"$path",
"to",
"a",
"given",
"$base",
"path",
"."
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Base/src/file.php#L392-L435 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Base/src/file.php | ezcBaseFile.isAbsolutePath | public static function isAbsolutePath( $path, $os = null )
{
if ( $os === null )
{
$os = ezcBaseFeatures::os();
}
// Stream wrapper like phar can also be considered absolute paths
if ( preg_match( '(^[a-z]{3,}://)S', $path ) )
{
return true;
... | php | public static function isAbsolutePath( $path, $os = null )
{
if ( $os === null )
{
$os = ezcBaseFeatures::os();
}
// Stream wrapper like phar can also be considered absolute paths
if ( preg_match( '(^[a-z]{3,}://)S', $path ) )
{
return true;
... | [
"public",
"static",
"function",
"isAbsolutePath",
"(",
"$",
"path",
",",
"$",
"os",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"os",
"===",
"null",
")",
"{",
"$",
"os",
"=",
"ezcBaseFeatures",
"::",
"os",
"(",
")",
";",
"}",
"// Stream wrapper like phar ca... | Returns whether the passed $path is an absolute path, giving the current $os.
With the $os parameter you can tell this function to use the semantics
for a different operating system to determine whether a path is
absolute. The $os argument defaults to the OS that the script is running
on.
@param string $path
@param s... | [
"Returns",
"whether",
"the",
"passed",
"$path",
"is",
"an",
"absolute",
"path",
"giving",
"the",
"current",
"$os",
"."
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Base/src/file.php#L449-L493 |
shipmile/shipmile-api-php | lib/Shipmile/HttpClient/HttpClient.php | HttpClient.request | public function request($path, $body = null, $httpMethod = 'GET', array $options = array())
{
$headers = array();
$options = array_merge($this->options, $options);
if (isset($options['headers'])) {
$headers = $options['headers'];
unset($options['headers']);
... | php | public function request($path, $body = null, $httpMethod = 'GET', array $options = array())
{
$headers = array();
$options = array_merge($this->options, $options);
if (isset($options['headers'])) {
$headers = $options['headers'];
unset($options['headers']);
... | [
"public",
"function",
"request",
"(",
"$",
"path",
",",
"$",
"body",
"=",
"null",
",",
"$",
"httpMethod",
"=",
"'GET'",
",",
"array",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"$",
"headers",
"=",
"array",
"(",
")",
";",
"$",
"options",
"... | Intermediate function which does three main things
- Transforms the body of request into correct format
- Creates the requests with give parameters
- Returns response body after parsing it into correct format | [
"Intermediate",
"function",
"which",
"does",
"three",
"main",
"things"
] | train | https://github.com/shipmile/shipmile-api-php/blob/b8272613b3a27f0f27e8722cbee277e41e9dfe59/lib/Shipmile/HttpClient/HttpClient.php#L99-L132 |
shipmile/shipmile-api-php | lib/Shipmile/HttpClient/HttpClient.php | HttpClient.createRequest | public function createRequest($httpMethod, $path, $body = null, array $headers = array(), array $options = array())
{
$version = (isset($options['api_version']) ? "/".$options['api_version'] : "");
$path = $version.$path;
return $this->client->createRequest($httpMethod, $path, $headers,... | php | public function createRequest($httpMethod, $path, $body = null, array $headers = array(), array $options = array())
{
$version = (isset($options['api_version']) ? "/".$options['api_version'] : "");
$path = $version.$path;
return $this->client->createRequest($httpMethod, $path, $headers,... | [
"public",
"function",
"createRequest",
"(",
"$",
"httpMethod",
",",
"$",
"path",
",",
"$",
"body",
"=",
"null",
",",
"array",
"$",
"headers",
"=",
"array",
"(",
")",
",",
"array",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"$",
"version",
"=... | Creating a request with the given arguments
If api_version is set, appends it immediately after host | [
"Creating",
"a",
"request",
"with",
"the",
"given",
"arguments"
] | train | https://github.com/shipmile/shipmile-api-php/blob/b8272613b3a27f0f27e8722cbee277e41e9dfe59/lib/Shipmile/HttpClient/HttpClient.php#L139-L146 |
shipmile/shipmile-api-php | lib/Shipmile/HttpClient/HttpClient.php | HttpClient.setBody | public function setBody(RequestInterface $request, $body, $options)
{
return RequestHandler::setBody($request, $body, $options);
} | php | public function setBody(RequestInterface $request, $body, $options)
{
return RequestHandler::setBody($request, $body, $options);
} | [
"public",
"function",
"setBody",
"(",
"RequestInterface",
"$",
"request",
",",
"$",
"body",
",",
"$",
"options",
")",
"{",
"return",
"RequestHandler",
"::",
"setBody",
"(",
"$",
"request",
",",
"$",
"body",
",",
"$",
"options",
")",
";",
"}"
] | Set request body in correct format | [
"Set",
"request",
"body",
"in",
"correct",
"format"
] | train | https://github.com/shipmile/shipmile-api-php/blob/b8272613b3a27f0f27e8722cbee277e41e9dfe59/lib/Shipmile/HttpClient/HttpClient.php#L159-L162 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Database/src/handlers/oracle.php | ezcDbHandlerOracle.processLimitOffset | protected function processLimitOffset( $queryString, $limit, $offset )
{
if ( isset( $limit ) )
{
if ( !isset( $offset ) )
{
$offset = 0;
}
$min = $offset+1;
$max = $offset+$limit;
$queryString = "SELECT * FROM... | php | protected function processLimitOffset( $queryString, $limit, $offset )
{
if ( isset( $limit ) )
{
if ( !isset( $offset ) )
{
$offset = 0;
}
$min = $offset+1;
$max = $offset+$limit;
$queryString = "SELECT * FROM... | [
"protected",
"function",
"processLimitOffset",
"(",
"$",
"queryString",
",",
"$",
"limit",
",",
"$",
"offset",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"limit",
")",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"offset",
")",
")",
"{",
"$",
"offset"... | Returns an SQL query with LIMIT/OFFSET functionality appended.
The LIMIT/OFFSET is added to $queryString.
$limit controls the maximum number of entries in the resultset.
$offset controls where in the resultset results should be
returned from.
@param string $queryString
@param int $limit
@param int $offset
@return str... | [
"Returns",
"an",
"SQL",
"query",
"with",
"LIMIT",
"/",
"OFFSET",
"functionality",
"appended",
"."
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Database/src/handlers/oracle.php#L120-L136 |
chemel/dom-parser-helper | src/HtmlDomParserHelper.php | HtmlDomParserHelper.getClient | public function getClient()
{
if (!$this->client) {
$client = new GuzzleHelper();
$this->configureClient($client);
return $this->client = $client->getClient();
}
return $this->client;
} | php | public function getClient()
{
if (!$this->client) {
$client = new GuzzleHelper();
$this->configureClient($client);
return $this->client = $client->getClient();
}
return $this->client;
} | [
"public",
"function",
"getClient",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"client",
")",
"{",
"$",
"client",
"=",
"new",
"GuzzleHelper",
"(",
")",
";",
"$",
"this",
"->",
"configureClient",
"(",
"$",
"client",
")",
";",
"return",
"$",
"t... | Get new Curl instance
@return Curl curl | [
"Get",
"new",
"Curl",
"instance"
] | train | https://github.com/chemel/dom-parser-helper/blob/0ec7df13b19e3f3df4453023b37cba6bb16eb10a/src/HtmlDomParserHelper.php#L36-L47 |
chemel/dom-parser-helper | src/HtmlDomParserHelper.php | HtmlDomParserHelper.performRequest | public function performRequest($url)
{
$client = $this->getClient();
return $this->response = $client->get($url);
} | php | public function performRequest($url)
{
$client = $this->getClient();
return $this->response = $client->get($url);
} | [
"public",
"function",
"performRequest",
"(",
"$",
"url",
")",
"{",
"$",
"client",
"=",
"$",
"this",
"->",
"getClient",
"(",
")",
";",
"return",
"$",
"this",
"->",
"response",
"=",
"$",
"client",
"->",
"get",
"(",
"$",
"url",
")",
";",
"}"
] | Perform HTTP request
@param string url
@return CurlResponse response | [
"Perform",
"HTTP",
"request"
] | train | https://github.com/chemel/dom-parser-helper/blob/0ec7df13b19e3f3df4453023b37cba6bb16eb10a/src/HtmlDomParserHelper.php#L66-L71 |
chemel/dom-parser-helper | src/HtmlDomParserHelper.php | HtmlDomParserHelper.parse | public function parse($url)
{
$content = $this->performRequest($url)->getBody()->getContents();
$content = $this->convertEncodingToUTF8($content);
return $this->getHtmlDomParser($content);
} | php | public function parse($url)
{
$content = $this->performRequest($url)->getBody()->getContents();
$content = $this->convertEncodingToUTF8($content);
return $this->getHtmlDomParser($content);
} | [
"public",
"function",
"parse",
"(",
"$",
"url",
")",
"{",
"$",
"content",
"=",
"$",
"this",
"->",
"performRequest",
"(",
"$",
"url",
")",
"->",
"getBody",
"(",
")",
"->",
"getContents",
"(",
")",
";",
"$",
"content",
"=",
"$",
"this",
"->",
"conver... | Parse webpage
@return string url; | [
"Parse",
"webpage"
] | train | https://github.com/chemel/dom-parser-helper/blob/0ec7df13b19e3f3df4453023b37cba6bb16eb10a/src/HtmlDomParserHelper.php#L102-L109 |
chemel/dom-parser-helper | src/HtmlDomParserHelper.php | HtmlDomParserHelper.getPageTitle | public function getPageTitle()
{
if (!$this->parser) {
return;
}
$node = $this->parser->find('title', 0);
if ($node) {
return $node->innertext;
}
} | php | public function getPageTitle()
{
if (!$this->parser) {
return;
}
$node = $this->parser->find('title', 0);
if ($node) {
return $node->innertext;
}
} | [
"public",
"function",
"getPageTitle",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"parser",
")",
"{",
"return",
";",
"}",
"$",
"node",
"=",
"$",
"this",
"->",
"parser",
"->",
"find",
"(",
"'title'",
",",
"0",
")",
";",
"if",
"(",
"$",
"no... | Get page title
@return string title | [
"Get",
"page",
"title"
] | train | https://github.com/chemel/dom-parser-helper/blob/0ec7df13b19e3f3df4453023b37cba6bb16eb10a/src/HtmlDomParserHelper.php#L136-L147 |
chemel/dom-parser-helper | src/HtmlDomParserHelper.php | HtmlDomParserHelper.getPageDescription | public function getPageDescription()
{
if (!$this->parser) {
return;
}
$node = $this->parser->find('meta[name=description]', 0);
if ($node) {
return $node->getAttribute('content');
}
} | php | public function getPageDescription()
{
if (!$this->parser) {
return;
}
$node = $this->parser->find('meta[name=description]', 0);
if ($node) {
return $node->getAttribute('content');
}
} | [
"public",
"function",
"getPageDescription",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"parser",
")",
"{",
"return",
";",
"}",
"$",
"node",
"=",
"$",
"this",
"->",
"parser",
"->",
"find",
"(",
"'meta[name=description]'",
",",
"0",
")",
";",
"i... | Get page description
@return string description | [
"Get",
"page",
"description"
] | train | https://github.com/chemel/dom-parser-helper/blob/0ec7df13b19e3f3df4453023b37cba6bb16eb10a/src/HtmlDomParserHelper.php#L154-L165 |
chemel/dom-parser-helper | src/HtmlDomParserHelper.php | HtmlDomParserHelper.getPageKeywords | public function getPageKeywords()
{
if (!$this->parser) {
return;
}
$node = $this->parser->find('meta[name=keywords]', 0);
if ($node) {
return $node->getAttribute('content');
}
} | php | public function getPageKeywords()
{
if (!$this->parser) {
return;
}
$node = $this->parser->find('meta[name=keywords]', 0);
if ($node) {
return $node->getAttribute('content');
}
} | [
"public",
"function",
"getPageKeywords",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"parser",
")",
"{",
"return",
";",
"}",
"$",
"node",
"=",
"$",
"this",
"->",
"parser",
"->",
"find",
"(",
"'meta[name=keywords]'",
",",
"0",
")",
";",
"if",
... | Get page keywords
@return string url | [
"Get",
"page",
"keywords"
] | train | https://github.com/chemel/dom-parser-helper/blob/0ec7df13b19e3f3df4453023b37cba6bb16eb10a/src/HtmlDomParserHelper.php#L172-L183 |
chemel/dom-parser-helper | src/HtmlDomParserHelper.php | HtmlDomParserHelper.getPageCanonical | public function getPageCanonical()
{
if (!$this->parser) {
return;
}
$node = $this->parser->find('link[rel=canonical]', 0);
if ($node) {
return $node->getAttribute('href');
}
} | php | public function getPageCanonical()
{
if (!$this->parser) {
return;
}
$node = $this->parser->find('link[rel=canonical]', 0);
if ($node) {
return $node->getAttribute('href');
}
} | [
"public",
"function",
"getPageCanonical",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"parser",
")",
"{",
"return",
";",
"}",
"$",
"node",
"=",
"$",
"this",
"->",
"parser",
"->",
"find",
"(",
"'link[rel=canonical]'",
",",
"0",
")",
";",
"if",
... | Get page canonical url
@return string url | [
"Get",
"page",
"canonical",
"url"
] | train | https://github.com/chemel/dom-parser-helper/blob/0ec7df13b19e3f3df4453023b37cba6bb16eb10a/src/HtmlDomParserHelper.php#L190-L201 |
chemel/dom-parser-helper | src/HtmlDomParserHelper.php | HtmlDomParserHelper.getPageFavicon | public function getPageFavicon()
{
if (!$this->parser) {
return;
}
$node = $this->parser->find('link[rel=shortcut], link[rel=icon], link[rel=shortcut icon]', 0);
if ($node) {
return $node->getAttribute('href');
}
} | php | public function getPageFavicon()
{
if (!$this->parser) {
return;
}
$node = $this->parser->find('link[rel=shortcut], link[rel=icon], link[rel=shortcut icon]', 0);
if ($node) {
return $node->getAttribute('href');
}
} | [
"public",
"function",
"getPageFavicon",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"parser",
")",
"{",
"return",
";",
"}",
"$",
"node",
"=",
"$",
"this",
"->",
"parser",
"->",
"find",
"(",
"'link[rel=shortcut], link[rel=icon], link[rel=shortcut icon]'",... | Get page favicon url
@return string url | [
"Get",
"page",
"favicon",
"url"
] | train | https://github.com/chemel/dom-parser-helper/blob/0ec7df13b19e3f3df4453023b37cba6bb16eb10a/src/HtmlDomParserHelper.php#L208-L219 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.