id int32 0 241k | repo stringlengths 6 63 | path stringlengths 5 140 | func_name stringlengths 3 151 | original_string stringlengths 84 13k | language stringclasses 1
value | code stringlengths 84 13k | code_tokens list | docstring stringlengths 3 47.2k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 91 247 |
|---|---|---|---|---|---|---|---|---|---|---|---|
235,600 | covex-nn/vfs | src/Partition.php | Partition.getFsRoot | private function getFsRoot(): ?string
{
if (null === $this->fsRoot) {
$tempDir = rtrim(sys_get_temp_dir(), '\\/');
do {
$name = $tempDir.'/'.uniqid('vfs', true);
} while (file_exists($name));
$this->fs->mkdir($name);
$this->fsRoot... | php | private function getFsRoot(): ?string
{
if (null === $this->fsRoot) {
$tempDir = rtrim(sys_get_temp_dir(), '\\/');
do {
$name = $tempDir.'/'.uniqid('vfs', true);
} while (file_exists($name));
$this->fs->mkdir($name);
$this->fsRoot... | [
"private",
"function",
"getFsRoot",
"(",
")",
":",
"?",
"string",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"fsRoot",
")",
"{",
"$",
"tempDir",
"=",
"rtrim",
"(",
"sys_get_temp_dir",
"(",
")",
",",
"'\\\\/'",
")",
";",
"do",
"{",
"$",
"name... | Create own temp directory and return path. | [
"Create",
"own",
"temp",
"directory",
"and",
"return",
"path",
"."
] | 77ee7406ab32508c4671adf1153dc5b67bdab599 | https://github.com/covex-nn/vfs/blob/77ee7406ab32508c4671adf1153dc5b67bdab599/src/Partition.php#L589-L603 |
235,601 | twanhaverkamp/core-bundle | Twig/PaginatorExtension.php | PaginatorExtension.paginate | public function paginate(
\Twig_Environment $twig,
PaginatorInterface $paginator,
string $template = '@Core/pagination/default.html.twig'
) {
return $twig->render($template, array(
'available_pages' => $paginator->getAvailablePages(),
'current_page' => $pagina... | php | public function paginate(
\Twig_Environment $twig,
PaginatorInterface $paginator,
string $template = '@Core/pagination/default.html.twig'
) {
return $twig->render($template, array(
'available_pages' => $paginator->getAvailablePages(),
'current_page' => $pagina... | [
"public",
"function",
"paginate",
"(",
"\\",
"Twig_Environment",
"$",
"twig",
",",
"PaginatorInterface",
"$",
"paginator",
",",
"string",
"$",
"template",
"=",
"'@Core/pagination/default.html.twig'",
")",
"{",
"return",
"$",
"twig",
"->",
"render",
"(",
"$",
"te... | Render the given paginator
@param \Twig_Environment $twig
@param PaginatorInterface $paginator
@param string $template
@return string
@throws \Twig_Error_Loader
@throws \Twig_Error_Runtime
@throws \Twig_Error_Syntax | [
"Render",
"the",
"given",
"paginator"
] | 04ccf69c159566a850ed9d048d09accd12e68e26 | https://github.com/twanhaverkamp/core-bundle/blob/04ccf69c159566a850ed9d048d09accd12e68e26/Twig/PaginatorExtension.php#L48-L61 |
235,602 | twanhaverkamp/core-bundle | Twig/PaginatorExtension.php | PaginatorExtension.getNextUrl | private function getNextUrl(PaginatorInterface $paginator) : ?string
{
$page = $paginator->getCurrentPage();
if (++$page <= $paginator->getAvailablePages()) {
return $this->generateUrl(
$this->getRoute(),
$this->getMergedParams(['page' => $page])
... | php | private function getNextUrl(PaginatorInterface $paginator) : ?string
{
$page = $paginator->getCurrentPage();
if (++$page <= $paginator->getAvailablePages()) {
return $this->generateUrl(
$this->getRoute(),
$this->getMergedParams(['page' => $page])
... | [
"private",
"function",
"getNextUrl",
"(",
"PaginatorInterface",
"$",
"paginator",
")",
":",
"?",
"string",
"{",
"$",
"page",
"=",
"$",
"paginator",
"->",
"getCurrentPage",
"(",
")",
";",
"if",
"(",
"++",
"$",
"page",
"<=",
"$",
"paginator",
"->",
"getAva... | Get next URL
@param PaginatorInterface $paginator
@return string|null | [
"Get",
"next",
"URL"
] | 04ccf69c159566a850ed9d048d09accd12e68e26 | https://github.com/twanhaverkamp/core-bundle/blob/04ccf69c159566a850ed9d048d09accd12e68e26/Twig/PaginatorExtension.php#L70-L82 |
235,603 | twanhaverkamp/core-bundle | Twig/PaginatorExtension.php | PaginatorExtension.getPreviousUrl | private function getPreviousUrl(PaginatorInterface $paginator) : ?string
{
$page = $paginator->getCurrentPage();
if (--$page >= 1) {
return $this->generateUrl(
$this->getRoute(),
$this->getMergedParams(['page' => $page])
);
}
... | php | private function getPreviousUrl(PaginatorInterface $paginator) : ?string
{
$page = $paginator->getCurrentPage();
if (--$page >= 1) {
return $this->generateUrl(
$this->getRoute(),
$this->getMergedParams(['page' => $page])
);
}
... | [
"private",
"function",
"getPreviousUrl",
"(",
"PaginatorInterface",
"$",
"paginator",
")",
":",
"?",
"string",
"{",
"$",
"page",
"=",
"$",
"paginator",
"->",
"getCurrentPage",
"(",
")",
";",
"if",
"(",
"--",
"$",
"page",
">=",
"1",
")",
"{",
"return",
... | Get previous URL
@param PaginatorInterface $paginator
@return string|null | [
"Get",
"previous",
"URL"
] | 04ccf69c159566a850ed9d048d09accd12e68e26 | https://github.com/twanhaverkamp/core-bundle/blob/04ccf69c159566a850ed9d048d09accd12e68e26/Twig/PaginatorExtension.php#L91-L103 |
235,604 | zugoripls/laravel-framework | src/Illuminate/Routing/Router.php | Router.callFilter | protected function callFilter($filter, $request, $response = null)
{
return $this->events->until('router.'.$filter, array($request, $response));
} | php | protected function callFilter($filter, $request, $response = null)
{
return $this->events->until('router.'.$filter, array($request, $response));
} | [
"protected",
"function",
"callFilter",
"(",
"$",
"filter",
",",
"$",
"request",
",",
"$",
"response",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"events",
"->",
"until",
"(",
"'router.'",
".",
"$",
"filter",
",",
"array",
"(",
"$",
"request",
... | Call the given filter with the request and response.
@param string $filter
@param \Illuminate\Http\Request $request
@param \Illuminate\Http\Response $response
@return mixed | [
"Call",
"the",
"given",
"filter",
"with",
"the",
"request",
"and",
"response",
"."
] | 90fa2b0e7a9b7786a6f02a9f10aba6a21ac03655 | https://github.com/zugoripls/laravel-framework/blob/90fa2b0e7a9b7786a6f02a9f10aba6a21ac03655/src/Illuminate/Routing/Router.php#L1005-L1008 |
235,605 | zugoripls/laravel-framework | src/Illuminate/Routing/Router.php | Router.filterSupportsMethod | protected function filterSupportsMethod($filter, $method)
{
$methods = $filter['methods'];
return is_null($methods) || in_array($method, $methods);
} | php | protected function filterSupportsMethod($filter, $method)
{
$methods = $filter['methods'];
return is_null($methods) || in_array($method, $methods);
} | [
"protected",
"function",
"filterSupportsMethod",
"(",
"$",
"filter",
",",
"$",
"method",
")",
"{",
"$",
"methods",
"=",
"$",
"filter",
"[",
"'methods'",
"]",
";",
"return",
"is_null",
"(",
"$",
"methods",
")",
"||",
"in_array",
"(",
"$",
"method",
",",
... | Determine if the given pattern filters applies to a given method.
@param array $filter
@param array $method
@return bool | [
"Determine",
"if",
"the",
"given",
"pattern",
"filters",
"applies",
"to",
"a",
"given",
"method",
"."
] | 90fa2b0e7a9b7786a6f02a9f10aba6a21ac03655 | https://github.com/zugoripls/laravel-framework/blob/90fa2b0e7a9b7786a6f02a9f10aba6a21ac03655/src/Illuminate/Routing/Router.php#L1116-L1121 |
235,606 | zugoripls/laravel-framework | src/Illuminate/Routing/Router.php | Router.callRouteFilter | public function callRouteFilter($filter, $parameters, $route, $request, $response = null)
{
$data = array_merge(array($route, $request, $response), $parameters);
return $this->events->until('router.filter: '.$filter, $this->cleanFilterParameters($data));
} | php | public function callRouteFilter($filter, $parameters, $route, $request, $response = null)
{
$data = array_merge(array($route, $request, $response), $parameters);
return $this->events->until('router.filter: '.$filter, $this->cleanFilterParameters($data));
} | [
"public",
"function",
"callRouteFilter",
"(",
"$",
"filter",
",",
"$",
"parameters",
",",
"$",
"route",
",",
"$",
"request",
",",
"$",
"response",
"=",
"null",
")",
"{",
"$",
"data",
"=",
"array_merge",
"(",
"array",
"(",
"$",
"route",
",",
"$",
"req... | Call the given route filter.
@param string $filter
@param array $parameters
@param \Illuminate\Routing\Route $route
@param \Illuminate\Http\Request $request
@param \Illuminate\Http\Response|null $response
@return mixed | [
"Call",
"the",
"given",
"route",
"filter",
"."
] | 90fa2b0e7a9b7786a6f02a9f10aba6a21ac03655 | https://github.com/zugoripls/laravel-framework/blob/90fa2b0e7a9b7786a6f02a9f10aba6a21ac03655/src/Illuminate/Routing/Router.php#L1166-L1171 |
235,607 | open-orchestra/open-orchestra-media-admin-bundle | MediaAdmin/MediaForm/Strategy/ImageStrategy.php | ImageStrategy.cropAlternative | protected function cropAlternative(FormInterface $form)
{
$needFlush = false;
foreach ($this->thumbnailConfig as $format => $parameters) {
$x = $form->get('coordinates')->get($format)->get('x')->getData();
$y = $form->get('coordinates')->get($format)->get('y')->getData();
... | php | protected function cropAlternative(FormInterface $form)
{
$needFlush = false;
foreach ($this->thumbnailConfig as $format => $parameters) {
$x = $form->get('coordinates')->get($format)->get('x')->getData();
$y = $form->get('coordinates')->get($format)->get('y')->getData();
... | [
"protected",
"function",
"cropAlternative",
"(",
"FormInterface",
"$",
"form",
")",
"{",
"$",
"needFlush",
"=",
"false",
";",
"foreach",
"(",
"$",
"this",
"->",
"thumbnailConfig",
"as",
"$",
"format",
"=>",
"$",
"parameters",
")",
"{",
"$",
"x",
"=",
"$"... | Crop a new Alternative if required
@param FormInterface $form | [
"Crop",
"a",
"new",
"Alternative",
"if",
"required"
] | 743fa00a6491b84d67221e215a806d8b210bf773 | https://github.com/open-orchestra/open-orchestra-media-admin-bundle/blob/743fa00a6491b84d67221e215a806d8b210bf773/MediaAdmin/MediaForm/Strategy/ImageStrategy.php#L75-L93 |
235,608 | open-orchestra/open-orchestra-media-admin-bundle | MediaAdmin/MediaForm/Strategy/ImageStrategy.php | ImageStrategy.overrideAlternative | protected function overrideAlternative(FormInterface $form)
{
$needFlush = false;
foreach ($this->thumbnailConfig as $format => $parameters) {
$file = $form->get('files')->get($format)->get('file')->getData();
if (null !== $file) {
$media = $form->getData();
... | php | protected function overrideAlternative(FormInterface $form)
{
$needFlush = false;
foreach ($this->thumbnailConfig as $format => $parameters) {
$file = $form->get('files')->get($format)->get('file')->getData();
if (null !== $file) {
$media = $form->getData();
... | [
"protected",
"function",
"overrideAlternative",
"(",
"FormInterface",
"$",
"form",
")",
"{",
"$",
"needFlush",
"=",
"false",
";",
"foreach",
"(",
"$",
"this",
"->",
"thumbnailConfig",
"as",
"$",
"format",
"=>",
"$",
"parameters",
")",
"{",
"$",
"file",
"="... | Override an alternative if required
@param FormInterface $form | [
"Override",
"an",
"alternative",
"if",
"required"
] | 743fa00a6491b84d67221e215a806d8b210bf773 | https://github.com/open-orchestra/open-orchestra-media-admin-bundle/blob/743fa00a6491b84d67221e215a806d8b210bf773/MediaAdmin/MediaForm/Strategy/ImageStrategy.php#L100-L118 |
235,609 | pickles2/node-pickles2-module-editor | php/gpi.php | gpi.gpi | public function gpi($data){
// var_dump($data);
if( !preg_match('/^[a-zA-Z0-9\_]+$/s', $data['api']) ){
return false;
}
// API をロードして実行
if( is_file(__DIR__.'/gpis/'.urlencode($data['api']).'.php') ){
$Api = include(__DIR__.'/gpis/'.urlencode($data['api']).'.php');
$result = $Api($this->px2me, $data... | php | public function gpi($data){
// var_dump($data);
if( !preg_match('/^[a-zA-Z0-9\_]+$/s', $data['api']) ){
return false;
}
// API をロードして実行
if( is_file(__DIR__.'/gpis/'.urlencode($data['api']).'.php') ){
$Api = include(__DIR__.'/gpis/'.urlencode($data['api']).'.php');
$result = $Api($this->px2me, $data... | [
"public",
"function",
"gpi",
"(",
"$",
"data",
")",
"{",
"// var_dump($data);",
"if",
"(",
"!",
"preg_match",
"(",
"'/^[a-zA-Z0-9\\_]+$/s'",
",",
"$",
"data",
"[",
"'api'",
"]",
")",
")",
"{",
"return",
"false",
";",
"}",
"// API をロードして実行",
"if",
"(",
"i... | General Purpose Interface | [
"General",
"Purpose",
"Interface"
] | a4270c09cb047b119ccb28eef654e223cc33f3c8 | https://github.com/pickles2/node-pickles2-module-editor/blob/a4270c09cb047b119ccb28eef654e223cc33f3c8/php/gpi.php#L29-L44 |
235,610 | ItalyStrap/debug | src/Debug/Visual_Hook.php | Visual_Hook.get_visual_hook | public function get_visual_hook() {
printf(
'<div class="filter-container"><p class="filter-name">%s</p>%s</div>',
current_filter(),
empty( $this->options['show_hooked_callable'] ) ? '' : $this->hooked->get_hooked_list( current_filter(), false )
);
} | php | public function get_visual_hook() {
printf(
'<div class="filter-container"><p class="filter-name">%s</p>%s</div>',
current_filter(),
empty( $this->options['show_hooked_callable'] ) ? '' : $this->hooked->get_hooked_list( current_filter(), false )
);
} | [
"public",
"function",
"get_visual_hook",
"(",
")",
"{",
"printf",
"(",
"'<div class=\"filter-container\"><p class=\"filter-name\">%s</p>%s</div>'",
",",
"current_filter",
"(",
")",
",",
"empty",
"(",
"$",
"this",
"->",
"options",
"[",
"'show_hooked_callable'",
"]",
")",... | Get the HTML snippet
@param string $value [description]
@return string [description] | [
"Get",
"the",
"HTML",
"snippet"
] | 955951b3df3a5c91bdc4cba51348645ccca6bddd | https://github.com/ItalyStrap/debug/blob/955951b3df3a5c91bdc4cba51348645ccca6bddd/src/Debug/Visual_Hook.php#L135-L142 |
235,611 | chilimatic/config-component | src/Adapter/File.php | File.getConfigFileContent | private function getConfigFileContent(string $configPath) : array
{
// if empty just skip it
if (!filesize($configPath)) {
return [];
}
// read the file handler
$config = file_get_contents($configPath);
// check for linebreaks
if (strpos($config,... | php | private function getConfigFileContent(string $configPath) : array
{
// if empty just skip it
if (!filesize($configPath)) {
return [];
}
// read the file handler
$config = file_get_contents($configPath);
// check for linebreaks
if (strpos($config,... | [
"private",
"function",
"getConfigFileContent",
"(",
"string",
"$",
"configPath",
")",
":",
"array",
"{",
"// if empty just skip it",
"if",
"(",
"!",
"filesize",
"(",
"$",
"configPath",
")",
")",
"{",
"return",
"[",
"]",
";",
"}",
"// read the file handler",
"$... | reads the specific config file
@param string $configPath
@return array | [
"reads",
"the",
"specific",
"config",
"file"
] | 9e3bba36373928ccaa816c5344728248d42da040 | https://github.com/chilimatic/config-component/blob/9e3bba36373928ccaa816c5344728248d42da040/src/Adapter/File.php#L362-L382 |
235,612 | codebobbly/dvoconnector | Classes/Mapper/Generic.php | Generic.mapToAbstractEntity | public function mapToAbstractEntity($entity)
{
$entityStack = new \SplStack();
$this->mapXMLElementToEntity($this->xml, $entity, $entityStack);
} | php | public function mapToAbstractEntity($entity)
{
$entityStack = new \SplStack();
$this->mapXMLElementToEntity($this->xml, $entity, $entityStack);
} | [
"public",
"function",
"mapToAbstractEntity",
"(",
"$",
"entity",
")",
"{",
"$",
"entityStack",
"=",
"new",
"\\",
"SplStack",
"(",
")",
";",
"$",
"this",
"->",
"mapXMLElementToEntity",
"(",
"$",
"this",
"->",
"xml",
",",
"$",
"entity",
",",
"$",
"entitySt... | Map XML to AbstractEntity
@param AbstractEntity $entity Abstract Entity
@return void | [
"Map",
"XML",
"to",
"AbstractEntity"
] | 9b63790d2fc9fd21bf415b4a5757678895b73bbc | https://github.com/codebobbly/dvoconnector/blob/9b63790d2fc9fd21bf415b4a5757678895b73bbc/Classes/Mapper/Generic.php#L41-L46 |
235,613 | codebobbly/dvoconnector | Classes/Mapper/Generic.php | Generic.mapToPropertyAttribut | protected function mapToPropertyAttribut($property, $value, $xmlEntry, $entity, $stackEntity)
{
$this->mapToProperty($property, $value, $xmlEntry, $entity, $stackEntity);
} | php | protected function mapToPropertyAttribut($property, $value, $xmlEntry, $entity, $stackEntity)
{
$this->mapToProperty($property, $value, $xmlEntry, $entity, $stackEntity);
} | [
"protected",
"function",
"mapToPropertyAttribut",
"(",
"$",
"property",
",",
"$",
"value",
",",
"$",
"xmlEntry",
",",
"$",
"entity",
",",
"$",
"stackEntity",
")",
"{",
"$",
"this",
"->",
"mapToProperty",
"(",
"$",
"property",
",",
"$",
"value",
",",
"$",... | map attribut the value to the property
@param string property
@param string value
@param \SimpleXMLElement xmlElement
@param AbstractEntity Entity
@param \SplStack stackEntity | [
"map",
"attribut",
"the",
"value",
"to",
"the",
"property"
] | 9b63790d2fc9fd21bf415b4a5757678895b73bbc | https://github.com/codebobbly/dvoconnector/blob/9b63790d2fc9fd21bf415b4a5757678895b73bbc/Classes/Mapper/Generic.php#L154-L157 |
235,614 | codebobbly/dvoconnector | Classes/Mapper/Generic.php | Generic.mapToPropertyTagname | protected function mapToPropertyTagname($property, $value, $xmlEntry, $entity, $stackEntity)
{
if ($this->mapToProperty($property, $value, $xmlEntry, $entity, $stackEntity) === false) {
$this->mapXMLElementToEntity($xmlEntry, $entity, $stackEntity);
}
} | php | protected function mapToPropertyTagname($property, $value, $xmlEntry, $entity, $stackEntity)
{
if ($this->mapToProperty($property, $value, $xmlEntry, $entity, $stackEntity) === false) {
$this->mapXMLElementToEntity($xmlEntry, $entity, $stackEntity);
}
} | [
"protected",
"function",
"mapToPropertyTagname",
"(",
"$",
"property",
",",
"$",
"value",
",",
"$",
"xmlEntry",
",",
"$",
"entity",
",",
"$",
"stackEntity",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"mapToProperty",
"(",
"$",
"property",
",",
"$",
"value",... | map tag the value to the property
@param string property
@param string value
@param \SimpleXMLElement xmlElement
@param AbstractEntity Entity
@param \SplStack stackEntity | [
"map",
"tag",
"the",
"value",
"to",
"the",
"property"
] | 9b63790d2fc9fd21bf415b4a5757678895b73bbc | https://github.com/codebobbly/dvoconnector/blob/9b63790d2fc9fd21bf415b4a5757678895b73bbc/Classes/Mapper/Generic.php#L169-L174 |
235,615 | codebobbly/dvoconnector | Classes/Mapper/Generic.php | Generic.mapToProperty | protected function mapToProperty($property, $value, $xmlEntry, $entity, $stackEntity)
{
$classSchema = $this->reflectionService->getClassSchema(get_class($entity));
if ($classSchema->hasProperty($property)) {
$propertyDefinition = $classSchema->getProperty($property);
switc... | php | protected function mapToProperty($property, $value, $xmlEntry, $entity, $stackEntity)
{
$classSchema = $this->reflectionService->getClassSchema(get_class($entity));
if ($classSchema->hasProperty($property)) {
$propertyDefinition = $classSchema->getProperty($property);
switc... | [
"protected",
"function",
"mapToProperty",
"(",
"$",
"property",
",",
"$",
"value",
",",
"$",
"xmlEntry",
",",
"$",
"entity",
",",
"$",
"stackEntity",
")",
"{",
"$",
"classSchema",
"=",
"$",
"this",
"->",
"reflectionService",
"->",
"getClassSchema",
"(",
"g... | map the value to the property
@param string property
@param string value
@param \SimpleXMLElement xmlElement
@param AbstractEntity Entity
@param \SplStack stackEntity
@return bool | [
"map",
"the",
"value",
"to",
"the",
"property"
] | 9b63790d2fc9fd21bf415b4a5757678895b73bbc | https://github.com/codebobbly/dvoconnector/blob/9b63790d2fc9fd21bf415b4a5757678895b73bbc/Classes/Mapper/Generic.php#L187-L237 |
235,616 | codebobbly/dvoconnector | Classes/Mapper/Generic.php | Generic.mapXMLElementToEntity | protected function mapXMLElementToEntity($xmlEntry, $entity, $stackEntity)
{
$stackEntity->push($entity);
foreach ($xmlEntry->attributes() as $name => $attribut) {
$value = $this->mapAttributValue($xmlEntry, $name, $attribut->__toString(), $stackEntity);
$entityForAttribut ... | php | protected function mapXMLElementToEntity($xmlEntry, $entity, $stackEntity)
{
$stackEntity->push($entity);
foreach ($xmlEntry->attributes() as $name => $attribut) {
$value = $this->mapAttributValue($xmlEntry, $name, $attribut->__toString(), $stackEntity);
$entityForAttribut ... | [
"protected",
"function",
"mapXMLElementToEntity",
"(",
"$",
"xmlEntry",
",",
"$",
"entity",
",",
"$",
"stackEntity",
")",
"{",
"$",
"stackEntity",
"->",
"push",
"(",
"$",
"entity",
")",
";",
"foreach",
"(",
"$",
"xmlEntry",
"->",
"attributes",
"(",
")",
... | map XML Element to Entity
@param \SimpleXMLElement xmlElement
@param AbstractEntity Entity
@param \SplStack stackEntity | [
"map",
"XML",
"Element",
"to",
"Entity"
] | 9b63790d2fc9fd21bf415b4a5757678895b73bbc | https://github.com/codebobbly/dvoconnector/blob/9b63790d2fc9fd21bf415b4a5757678895b73bbc/Classes/Mapper/Generic.php#L246-L269 |
235,617 | cityware/city-monitoring | src/Jobs/Devices/Wmi/Disk.php | Disk.getDiskData | public function getDiskData($wmiConnection) {
$LogicalDisk = $wmiConnection->query("SELECT Size, FreeSpace, DeviceID FROM Win32_LogicalDisk");
$return = Array();
$index = 0;
foreach ($LogicalDisk as $wmi_LogicalDisk) {
if (isset($wmi_LogicalDisk->Size) and $wmi_LogicalDisk... | php | public function getDiskData($wmiConnection) {
$LogicalDisk = $wmiConnection->query("SELECT Size, FreeSpace, DeviceID FROM Win32_LogicalDisk");
$return = Array();
$index = 0;
foreach ($LogicalDisk as $wmi_LogicalDisk) {
if (isset($wmi_LogicalDisk->Size) and $wmi_LogicalDisk... | [
"public",
"function",
"getDiskData",
"(",
"$",
"wmiConnection",
")",
"{",
"$",
"LogicalDisk",
"=",
"$",
"wmiConnection",
"->",
"query",
"(",
"\"SELECT Size, FreeSpace, DeviceID FROM Win32_LogicalDisk\"",
")",
";",
"$",
"return",
"=",
"Array",
"(",
")",
";",
"$",
... | Return Disk Data
@param object $wmiConnection
@return array | [
"Return",
"Disk",
"Data"
] | 0eb4e7ade7e2028093109856e67a317743b2e048 | https://github.com/cityware/city-monitoring/blob/0eb4e7ade7e2028093109856e67a317743b2e048/src/Jobs/Devices/Wmi/Disk.php#L23-L44 |
235,618 | tekreme73/FrametekLight | src/Collections/RecursiveCollection.php | RecursiveCollection.hasIn | protected function hasIn($key, $in)
{
$keys = explode($this->getSeparator(), $key, 2);
if (count($keys) <= 0) {
return false;
} else {
if (! isset($in[$keys[0]])) {
return false;
} else {
if (count($keys) >= 2) {
... | php | protected function hasIn($key, $in)
{
$keys = explode($this->getSeparator(), $key, 2);
if (count($keys) <= 0) {
return false;
} else {
if (! isset($in[$keys[0]])) {
return false;
} else {
if (count($keys) >= 2) {
... | [
"protected",
"function",
"hasIn",
"(",
"$",
"key",
",",
"$",
"in",
")",
"{",
"$",
"keys",
"=",
"explode",
"(",
"$",
"this",
"->",
"getSeparator",
"(",
")",
",",
"$",
"key",
",",
"2",
")",
";",
"if",
"(",
"count",
"(",
"$",
"keys",
")",
"<=",
... | Does the collection have a given key?
Warn: Recursive function
@param string $key
The data key
@param array $in
The folder uses for the recursion
@return boolean If the collection have the given key | [
"Does",
"the",
"collection",
"have",
"a",
"given",
"key?"
] | 7a40e8dd14490488d80741d6a6fe5d9c2bcc7bd5 | https://github.com/tekreme73/FrametekLight/blob/7a40e8dd14490488d80741d6a6fe5d9c2bcc7bd5/src/Collections/RecursiveCollection.php#L128-L144 |
235,619 | acacha/ebre_escool_model | src/TeacherAcademicPeriod.php | TeacherAcademicPeriod.scopeActive | public function scopeActive($query)
{
return $this->scopeActiveOn($query,
AcademicPeriod::current()->get()->first()->id);
} | php | public function scopeActive($query)
{
return $this->scopeActiveOn($query,
AcademicPeriod::current()->get()->first()->id);
} | [
"public",
"function",
"scopeActive",
"(",
"$",
"query",
")",
"{",
"return",
"$",
"this",
"->",
"scopeActiveOn",
"(",
"$",
"query",
",",
"AcademicPeriod",
"::",
"current",
"(",
")",
"->",
"get",
"(",
")",
"->",
"first",
"(",
")",
"->",
"id",
")",
";",... | Only teachers active for current period.
@param \Illuminate\Database\Eloquent\Builder $query
@return mixed | [
"Only",
"teachers",
"active",
"for",
"current",
"period",
"."
] | 91c0b870714490baa9500215a6dc07935e525a75 | https://github.com/acacha/ebre_escool_model/blob/91c0b870714490baa9500215a6dc07935e525a75/src/TeacherAcademicPeriod.php#L51-L55 |
235,620 | easy-system/es-events | src/AbstractEvent.php | AbstractEvent.getParam | public function getParam($name, $default = null)
{
if (isset($this->params[$name])) {
return $this->params[$name];
}
return $default;
} | php | public function getParam($name, $default = null)
{
if (isset($this->params[$name])) {
return $this->params[$name];
}
return $default;
} | [
"public",
"function",
"getParam",
"(",
"$",
"name",
",",
"$",
"default",
"=",
"null",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"params",
"[",
"$",
"name",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"params",
"[",
"$",
"name",
... | Gets parameter.
If the parameter does not exist, the $default value will be returned.
@param string $name The parameter name
@param mixed $default Optional; the default value
@return mixed The parameter value if present, $default otherwise | [
"Gets",
"parameter",
"."
] | f6a86f71d78dad7af4765db69fcd0ab6004924a3 | https://github.com/easy-system/es-events/blob/f6a86f71d78dad7af4765db69fcd0ab6004924a3/src/AbstractEvent.php#L84-L91 |
235,621 | easy-system/es-events | src/AbstractEvent.php | AbstractEvent.setResult | public function setResult($name = null, $result = null)
{
if (null === $result) {
$result = $name;
array_push($this->results, $result);
return $this;
}
$this->results[(string) $name] = $result;
return $this;
} | php | public function setResult($name = null, $result = null)
{
if (null === $result) {
$result = $name;
array_push($this->results, $result);
return $this;
}
$this->results[(string) $name] = $result;
return $this;
} | [
"public",
"function",
"setResult",
"(",
"$",
"name",
"=",
"null",
",",
"$",
"result",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"result",
")",
"{",
"$",
"result",
"=",
"$",
"name",
";",
"array_push",
"(",
"$",
"this",
"->",
"results",
... | Sets event result.
Any listener can store in instance of event some result.
If the result is not named, it is added to the results stack.
@param string $name Optional; the name of result
@param mixed $result The result value
@return AbstractEvent | [
"Sets",
"event",
"result",
"."
] | f6a86f71d78dad7af4765db69fcd0ab6004924a3 | https://github.com/easy-system/es-events/blob/f6a86f71d78dad7af4765db69fcd0ab6004924a3/src/AbstractEvent.php#L114-L126 |
235,622 | easy-system/es-events | src/AbstractEvent.php | AbstractEvent.getResult | public function getResult($name = null, $default = null)
{
if (null === $name) {
return end($this->results);
}
if (! isset($this->results[$name])) {
return $default;
}
return $this->results[$name];
} | php | public function getResult($name = null, $default = null)
{
if (null === $name) {
return end($this->results);
}
if (! isset($this->results[$name])) {
return $default;
}
return $this->results[$name];
} | [
"public",
"function",
"getResult",
"(",
"$",
"name",
"=",
"null",
",",
"$",
"default",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"name",
")",
"{",
"return",
"end",
"(",
"$",
"this",
"->",
"results",
")",
";",
"}",
"if",
"(",
"!",
"i... | Gets event result.
If the result name is not specified, returns the last result.
If the result with specified name does not exist, the $default value
will be returned.
@param string $name Optional; the name of result
@param mixed $default Optional; the default result value
@return mixed The result of event | [
"Gets",
"event",
"result",
"."
] | f6a86f71d78dad7af4765db69fcd0ab6004924a3 | https://github.com/easy-system/es-events/blob/f6a86f71d78dad7af4765db69fcd0ab6004924a3/src/AbstractEvent.php#L140-L150 |
235,623 | n0m4dz/laracasa | Zend/Gdata/MimeBodyString.php | Zend_Gdata_MimeBodyString.read | public function read($bytesRequested)
{
$len = strlen($this->_sourceString);
if($this->_bytesRead == $len) {
return FALSE;
} else if($bytesRequested > $len - $this->_bytesRead) {
$bytesRequested = $len - $this->_bytesRead;
}
$buffer = substr($this->_sourceString, $... | php | public function read($bytesRequested)
{
$len = strlen($this->_sourceString);
if($this->_bytesRead == $len) {
return FALSE;
} else if($bytesRequested > $len - $this->_bytesRead) {
$bytesRequested = $len - $this->_bytesRead;
}
$buffer = substr($this->_sourceString, $... | [
"public",
"function",
"read",
"(",
"$",
"bytesRequested",
")",
"{",
"$",
"len",
"=",
"strlen",
"(",
"$",
"this",
"->",
"_sourceString",
")",
";",
"if",
"(",
"$",
"this",
"->",
"_bytesRead",
"==",
"$",
"len",
")",
"{",
"return",
"FALSE",
";",
"}",
"... | Read the next chunk of the string.
@param integer $bytesRequested The size of the chunk that is to be read.
@return string A corresponding piece of the string. | [
"Read",
"the",
"next",
"chunk",
"of",
"the",
"string",
"."
] | 6141f0c16c7d4453275e3b74be5041f336085c91 | https://github.com/n0m4dz/laracasa/blob/6141f0c16c7d4453275e3b74be5041f336085c91/Zend/Gdata/MimeBodyString.php#L66-L79 |
235,624 | samsonos/cms_input_select | src/Select.php | Select.build | public function build($string = '', $groupSeparator = ',', $viewSeparator = ':')
{
// Clear options data
$this->options = array();
// Split string into groups and iterate them
foreach (explode($groupSeparator, $string) as $group) {
// Split group into view -> value
... | php | public function build($string = '', $groupSeparator = ',', $viewSeparator = ':')
{
// Clear options data
$this->options = array();
// Split string into groups and iterate them
foreach (explode($groupSeparator, $string) as $group) {
// Split group into view -> value
... | [
"public",
"function",
"build",
"(",
"$",
"string",
"=",
"''",
",",
"$",
"groupSeparator",
"=",
"','",
",",
"$",
"viewSeparator",
"=",
"':'",
")",
"{",
"// Clear options data",
"$",
"this",
"->",
"options",
"=",
"array",
"(",
")",
";",
"// Split string into... | Parse string into select options
@param string $string Input string
@param string $groupSeparator Separator string for groups
@param string $viewSeparator Separator string for view/value
@return Select Chaining | [
"Parse",
"string",
"into",
"select",
"options"
] | c5ea7cb3d14ef6451f89dcbc77c16f1084064532 | https://github.com/samsonos/cms_input_select/blob/c5ea7cb3d14ef6451f89dcbc77c16f1084064532/src/Select.php#L30-L61 |
235,625 | php-kit/flow | src/Flow/Flow.php | Flow.combine | static function combine ($inputs, array $fields = null, $flags = 2)
{
$mul = new MultipleIterator($flags);
foreach (iterator ($inputs) as $k => $it)
$mul->attachIterator (iterator ($it), isset($fields) ? $fields[$k] : $k);
return new static ($mul);
} | php | static function combine ($inputs, array $fields = null, $flags = 2)
{
$mul = new MultipleIterator($flags);
foreach (iterator ($inputs) as $k => $it)
$mul->attachIterator (iterator ($it), isset($fields) ? $fields[$k] : $k);
return new static ($mul);
} | [
"static",
"function",
"combine",
"(",
"$",
"inputs",
",",
"array",
"$",
"fields",
"=",
"null",
",",
"$",
"flags",
"=",
"2",
")",
"{",
"$",
"mul",
"=",
"new",
"MultipleIterator",
"(",
"$",
"flags",
")",
";",
"foreach",
"(",
"iterator",
"(",
"$",
"in... | Creates a Flow from a list of iterable inputs that iterates over all of them in parallel.
The generated sequence is comprised of array items where each one contains an iteration step from each one of the
inputs. The key for the value from each input corresponds (by default) to the original key for the
input on the ori... | [
"Creates",
"a",
"Flow",
"from",
"a",
"list",
"of",
"iterable",
"inputs",
"that",
"iterates",
"over",
"all",
"of",
"them",
"in",
"parallel",
"."
] | eab8d85202046538449dd9e05d8b5b945c7f55ff | https://github.com/php-kit/flow/blob/eab8d85202046538449dd9e05d8b5b945c7f55ff/src/Flow/Flow.php#L106-L112 |
235,626 | php-kit/flow | src/Flow/Flow.php | Flow.sequence | static function sequence ($list)
{
$a = new AppendIterator;
foreach (iterator ($list) as $it)
$a->append (iterator ($it));
return new static ($a);
} | php | static function sequence ($list)
{
$a = new AppendIterator;
foreach (iterator ($list) as $it)
$a->append (iterator ($it));
return new static ($a);
} | [
"static",
"function",
"sequence",
"(",
"$",
"list",
")",
"{",
"$",
"a",
"=",
"new",
"AppendIterator",
";",
"foreach",
"(",
"iterator",
"(",
"$",
"list",
")",
"as",
"$",
"it",
")",
"$",
"a",
"->",
"append",
"(",
"iterator",
"(",
"$",
"it",
")",
")... | Concatenates the specified iterables and iterates them in sequence.
>**Caution**
<p><br>When using {@see iterator_to_array()} to copy the values of the resulting sequence into an array, you
have to set the optional `use_key` argument to `FALSE`.<br>
When `use_key` is not `FALSE` any keys reoccuring in inner iterators ... | [
"Concatenates",
"the",
"specified",
"iterables",
"and",
"iterates",
"them",
"in",
"sequence",
"."
] | eab8d85202046538449dd9e05d8b5b945c7f55ff | https://github.com/php-kit/flow/blob/eab8d85202046538449dd9e05d8b5b945c7f55ff/src/Flow/Flow.php#L151-L157 |
235,627 | php-kit/flow | src/Flow/Flow.php | Flow.all | function all ()
{
if (!isset ($this->data))
$this->data = iterator_to_array ($this->it);
return $this->data;
} | php | function all ()
{
if (!isset ($this->data))
$this->data = iterator_to_array ($this->it);
return $this->data;
} | [
"function",
"all",
"(",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"data",
")",
")",
"$",
"this",
"->",
"data",
"=",
"iterator_to_array",
"(",
"$",
"this",
"->",
"it",
")",
";",
"return",
"$",
"this",
"->",
"data",
";",
"}"
] | Materializes the current iterator chain into an array.
<p>It preserves the original keys (unlike {@see Flow::pack()}).
><p>Beware of issues with concatenated iterators that generate the same keys. See {@see append()}
@return array | [
"Materializes",
"the",
"current",
"iterator",
"chain",
"into",
"an",
"array",
"."
] | eab8d85202046538449dd9e05d8b5b945c7f55ff | https://github.com/php-kit/flow/blob/eab8d85202046538449dd9e05d8b5b945c7f55ff/src/Flow/Flow.php#L178-L183 |
235,628 | php-kit/flow | src/Flow/Flow.php | Flow.append | function append ($list)
{
$cur = $this->getIterator ();
if ($cur instanceof AppendIterator) {
foreach (iterator ($list) as $it)
$cur->append (iterator ($it));
}
else {
$a = new AppendIterator;
$a->append ($cur);
foreach (iterator ($list) as $it)
$a->append (iter... | php | function append ($list)
{
$cur = $this->getIterator ();
if ($cur instanceof AppendIterator) {
foreach (iterator ($list) as $it)
$cur->append (iterator ($it));
}
else {
$a = new AppendIterator;
$a->append ($cur);
foreach (iterator ($list) as $it)
$a->append (iter... | [
"function",
"append",
"(",
"$",
"list",
")",
"{",
"$",
"cur",
"=",
"$",
"this",
"->",
"getIterator",
"(",
")",
";",
"if",
"(",
"$",
"cur",
"instanceof",
"AppendIterator",
")",
"{",
"foreach",
"(",
"iterator",
"(",
"$",
"list",
")",
"as",
"$",
"it",... | Appends one or more iterators to the current one and sets a new iterator that iterates over all of them.
<p>**Note:** an optimization is performed if the current iterator is already an {@see AppendIterator}.
> ##### Caution
When using {@see iterator_to_array()} to copy the values of the resulting sequence into an arr... | [
"Appends",
"one",
"or",
"more",
"iterators",
"to",
"the",
"current",
"one",
"and",
"sets",
"a",
"new",
"iterator",
"that",
"iterates",
"over",
"all",
"of",
"them",
"."
] | eab8d85202046538449dd9e05d8b5b945c7f55ff | https://github.com/php-kit/flow/blob/eab8d85202046538449dd9e05d8b5b945c7f55ff/src/Flow/Flow.php#L201-L216 |
235,629 | php-kit/flow | src/Flow/Flow.php | Flow.apply | function apply ($traversableClass)
{
$args = func_get_args ();
$args[0] = $this->getIterator ();
$c = new \ReflectionClass ($traversableClass);
$this->setIterator ($c->newInstanceArgs ($args));
return $this;
} | php | function apply ($traversableClass)
{
$args = func_get_args ();
$args[0] = $this->getIterator ();
$c = new \ReflectionClass ($traversableClass);
$this->setIterator ($c->newInstanceArgs ($args));
return $this;
} | [
"function",
"apply",
"(",
"$",
"traversableClass",
")",
"{",
"$",
"args",
"=",
"func_get_args",
"(",
")",
";",
"$",
"args",
"[",
"0",
"]",
"=",
"$",
"this",
"->",
"getIterator",
"(",
")",
";",
"$",
"c",
"=",
"new",
"\\",
"ReflectionClass",
"(",
"$"... | Instantiates an outer iterator and chains it to the current iterator.
Ex:
```
Query::range (1,10)->apply ('RegexIterator', '/^1/')->all ()
```
@param string $traversableClass The name of a {@see Traversable} class whose constructor receives an
iterator as a first argument.
@param mixed ...$args Additional a... | [
"Instantiates",
"an",
"outer",
"iterator",
"and",
"chains",
"it",
"to",
"the",
"current",
"iterator",
"."
] | eab8d85202046538449dd9e05d8b5b945c7f55ff | https://github.com/php-kit/flow/blob/eab8d85202046538449dd9e05d8b5b945c7f55ff/src/Flow/Flow.php#L231-L238 |
235,630 | php-kit/flow | src/Flow/Flow.php | Flow.concat | function concat ()
{
$a = new AppendIterator;
foreach ($this->getIterator () as $it)
$a->append (iterator ($it));
$this->setIterator ($a);
return $this;
} | php | function concat ()
{
$a = new AppendIterator;
foreach ($this->getIterator () as $it)
$a->append (iterator ($it));
$this->setIterator ($a);
return $this;
} | [
"function",
"concat",
"(",
")",
"{",
"$",
"a",
"=",
"new",
"AppendIterator",
";",
"foreach",
"(",
"$",
"this",
"->",
"getIterator",
"(",
")",
"as",
"$",
"it",
")",
"$",
"a",
"->",
"append",
"(",
"iterator",
"(",
"$",
"it",
")",
")",
";",
"$",
"... | Assumes the current iterator is a sequence of iterables and sets a new iterator that iterates over all of them.
>**Caution**
<p><br>When using {@see iterator_to_array()} to copy the values of the resulting sequence into an array, you
have to set the optional `use_key` argument to `FALSE`.<br>
When `use_key` is not `FA... | [
"Assumes",
"the",
"current",
"iterator",
"is",
"a",
"sequence",
"of",
"iterables",
"and",
"sets",
"a",
"new",
"iterator",
"that",
"iterates",
"over",
"all",
"of",
"them",
"."
] | eab8d85202046538449dd9e05d8b5b945c7f55ff | https://github.com/php-kit/flow/blob/eab8d85202046538449dd9e05d8b5b945c7f55ff/src/Flow/Flow.php#L264-L271 |
235,631 | php-kit/flow | src/Flow/Flow.php | Flow.each | function each (callable $fn)
{
foreach ($this->getIterator () as $k => $v)
if ($fn ($v, $k) === false) break;
return $this;
} | php | function each (callable $fn)
{
foreach ($this->getIterator () as $k => $v)
if ($fn ($v, $k) === false) break;
return $this;
} | [
"function",
"each",
"(",
"callable",
"$",
"fn",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"getIterator",
"(",
")",
"as",
"$",
"k",
"=>",
"$",
"v",
")",
"if",
"(",
"$",
"fn",
"(",
"$",
"v",
",",
"$",
"k",
")",
"===",
"false",
")",
"break",
... | Calls a function for every element in the iterator.
@param callable $fn A callback that receives the current value and key; it can, optionally, return `false` to break
the loop.
@return $this | [
"Calls",
"a",
"function",
"for",
"every",
"element",
"in",
"the",
"iterator",
"."
] | eab8d85202046538449dd9e05d8b5b945c7f55ff | https://github.com/php-kit/flow/blob/eab8d85202046538449dd9e05d8b5b945c7f55ff/src/Flow/Flow.php#L300-L305 |
235,632 | php-kit/flow | src/Flow/Flow.php | Flow.expand | function expand (callable $fn, $keepOriginals = false)
{
$keepOriginals ? $this->intercalate ($fn) : $this->map ($fn);
return $this->unfold ();
} | php | function expand (callable $fn, $keepOriginals = false)
{
$keepOriginals ? $this->intercalate ($fn) : $this->map ($fn);
return $this->unfold ();
} | [
"function",
"expand",
"(",
"callable",
"$",
"fn",
",",
"$",
"keepOriginals",
"=",
"false",
")",
"{",
"$",
"keepOriginals",
"?",
"$",
"this",
"->",
"intercalate",
"(",
"$",
"fn",
")",
":",
"$",
"this",
"->",
"map",
"(",
"$",
"fn",
")",
";",
"return"... | Expands values from the current iteration into their own iterations and provides a new iteration that concatenates
all of them.
<p>This is done by replacing each value on the current iteration by the values generated by a new iterator
returned by a user-supplied function called for each of the original values.
<br>Thi... | [
"Expands",
"values",
"from",
"the",
"current",
"iteration",
"into",
"their",
"own",
"iterations",
"and",
"provides",
"a",
"new",
"iteration",
"that",
"concatenates",
"all",
"of",
"them",
"."
] | eab8d85202046538449dd9e05d8b5b945c7f55ff | https://github.com/php-kit/flow/blob/eab8d85202046538449dd9e05d8b5b945c7f55ff/src/Flow/Flow.php#L325-L329 |
235,633 | php-kit/flow | src/Flow/Flow.php | Flow.fetch | function fetch ()
{
$it = $this->getIterator ();
if (!$this->fetching) {
$this->fetching = true;
$it->rewind ();
}
if ($it->valid ()) {
$v = $it->current ();
$it->next ();
return $v;
}
return false;
} | php | function fetch ()
{
$it = $this->getIterator ();
if (!$this->fetching) {
$this->fetching = true;
$it->rewind ();
}
if ($it->valid ()) {
$v = $it->current ();
$it->next ();
return $v;
}
return false;
} | [
"function",
"fetch",
"(",
")",
"{",
"$",
"it",
"=",
"$",
"this",
"->",
"getIterator",
"(",
")",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"fetching",
")",
"{",
"$",
"this",
"->",
"fetching",
"=",
"true",
";",
"$",
"it",
"->",
"rewind",
"(",
")",
... | Gets the current value from the composite iterator and iterates to the next.
This is a shortcut way of reading one single data item from the iteration.
It also takes care of rewinding the iterator when called for the first time.
@return mixed|false `false` when the iteration is finished. | [
"Gets",
"the",
"current",
"value",
"from",
"the",
"composite",
"iterator",
"and",
"iterates",
"to",
"the",
"next",
"."
] | eab8d85202046538449dd9e05d8b5b945c7f55ff | https://github.com/php-kit/flow/blob/eab8d85202046538449dd9e05d8b5b945c7f55ff/src/Flow/Flow.php#L339-L352 |
235,634 | php-kit/flow | src/Flow/Flow.php | Flow.fetchKey | function fetchKey ()
{
$it = $this->getIterator ();
if (!$this->fetching) {
$this->fetching = true;
$it->rewind ();
}
if ($it->valid ()) {
$k = $it->key ();
$it->next ();
return $k;
}
return false;
} | php | function fetchKey ()
{
$it = $this->getIterator ();
if (!$this->fetching) {
$this->fetching = true;
$it->rewind ();
}
if ($it->valid ()) {
$k = $it->key ();
$it->next ();
return $k;
}
return false;
} | [
"function",
"fetchKey",
"(",
")",
"{",
"$",
"it",
"=",
"$",
"this",
"->",
"getIterator",
"(",
")",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"fetching",
")",
"{",
"$",
"this",
"->",
"fetching",
"=",
"true",
";",
"$",
"it",
"->",
"rewind",
"(",
")... | Gets the current key from the composite iterator and iterates to the next.
This is a shortcut way of reading one single data item from the iteration.
It also takes care of rewinding the iterator when called for the first time.
@return mixed|false `false` when the iteration is finished. | [
"Gets",
"the",
"current",
"key",
"from",
"the",
"composite",
"iterator",
"and",
"iterates",
"to",
"the",
"next",
"."
] | eab8d85202046538449dd9e05d8b5b945c7f55ff | https://github.com/php-kit/flow/blob/eab8d85202046538449dd9e05d8b5b945c7f55ff/src/Flow/Flow.php#L362-L375 |
235,635 | php-kit/flow | src/Flow/Flow.php | Flow.intercalate | function intercalate (callable $fn)
{
return $this->map (function ($v, &$k) use ($fn) {
$r = $fn ($v, $k);
if (is_iterable ($r))
return new HeadAndTailIterator ($v, $r, $k, true);
return $r;
})->unfold ();
} | php | function intercalate (callable $fn)
{
return $this->map (function ($v, &$k) use ($fn) {
$r = $fn ($v, $k);
if (is_iterable ($r))
return new HeadAndTailIterator ($v, $r, $k, true);
return $r;
})->unfold ();
} | [
"function",
"intercalate",
"(",
"callable",
"$",
"fn",
")",
"{",
"return",
"$",
"this",
"->",
"map",
"(",
"function",
"(",
"$",
"v",
",",
"&",
"$",
"k",
")",
"use",
"(",
"$",
"fn",
")",
"{",
"$",
"r",
"=",
"$",
"fn",
"(",
"$",
"v",
",",
"$"... | Appends to each item a new one computed by the specified function. This doubles the size of the iteration set.
<p>**Note:** the resulting iteration may have duplicate keys. Use {@see reindex()} to normalize them.
@param callable $fn A callback that receives both the value and the key of the item being iterated on ... | [
"Appends",
"to",
"each",
"item",
"a",
"new",
"one",
"computed",
"by",
"the",
"specified",
"function",
".",
"This",
"doubles",
"the",
"size",
"of",
"the",
"iteration",
"set",
"."
] | eab8d85202046538449dd9e05d8b5b945c7f55ff | https://github.com/php-kit/flow/blob/eab8d85202046538449dd9e05d8b5b945c7f55ff/src/Flow/Flow.php#L417-L425 |
235,636 | php-kit/flow | src/Flow/Flow.php | Flow.map | function map (callable $fn, $arg = null)
{
$this->setIterator (new MapIterator ($this->getIterator (), $fn, $arg));
return $this;
} | php | function map (callable $fn, $arg = null)
{
$this->setIterator (new MapIterator ($this->getIterator (), $fn, $arg));
return $this;
} | [
"function",
"map",
"(",
"callable",
"$",
"fn",
",",
"$",
"arg",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"setIterator",
"(",
"new",
"MapIterator",
"(",
"$",
"this",
"->",
"getIterator",
"(",
")",
",",
"$",
"fn",
",",
"$",
"arg",
")",
")",
";",
... | Transforms the iterated data using a callback function.
@param callable $fn A callback that receives a value, a key and an option extra argument, and returns the new
value.<br> It can also receive the key by reference and change it.
<p>Ex:<code> ->map (function ($v, &$k) { $k = $k * 10; return $v * 100; })</code>
@p... | [
"Transforms",
"the",
"iterated",
"data",
"using",
"a",
"callback",
"function",
"."
] | eab8d85202046538449dd9e05d8b5b945c7f55ff | https://github.com/php-kit/flow/blob/eab8d85202046538449dd9e05d8b5b945c7f55ff/src/Flow/Flow.php#L453-L457 |
235,637 | php-kit/flow | src/Flow/Flow.php | Flow.mapAndFilter | function mapAndFilter (callable $fn, $arg = null)
{
$this->setIterator (new CallbackFilterIterator (new MapIterator ($this->getIterator (), $fn, $arg), function ($v) {
return isset ($v);
}));
return $this;
} | php | function mapAndFilter (callable $fn, $arg = null)
{
$this->setIterator (new CallbackFilterIterator (new MapIterator ($this->getIterator (), $fn, $arg), function ($v) {
return isset ($v);
}));
return $this;
} | [
"function",
"mapAndFilter",
"(",
"callable",
"$",
"fn",
",",
"$",
"arg",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"setIterator",
"(",
"new",
"CallbackFilterIterator",
"(",
"new",
"MapIterator",
"(",
"$",
"this",
"->",
"getIterator",
"(",
")",
",",
"$",
... | Transforms each input data item, optionally filtering it out.
@param callable $fn A callback that receives a value and key and returns a new value or `null` to discard it.<br>
It can also receive the key by reference and change it.
<p>Ex:<code> ->mapAndFilter (function ($v,&$k) { $k=$k*10; return $v>5? $v*100:null;}... | [
"Transforms",
"each",
"input",
"data",
"item",
"optionally",
"filtering",
"it",
"out",
"."
] | eab8d85202046538449dd9e05d8b5b945c7f55ff | https://github.com/php-kit/flow/blob/eab8d85202046538449dd9e05d8b5b945c7f55ff/src/Flow/Flow.php#L469-L475 |
235,638 | php-kit/flow | src/Flow/Flow.php | Flow.pack | function pack ()
{
$this->data = isset ($this->data) ? array_values ($this->data) : iterator_to_array ($this->it, false);
return $this;
} | php | function pack ()
{
$this->data = isset ($this->data) ? array_values ($this->data) : iterator_to_array ($this->it, false);
return $this;
} | [
"function",
"pack",
"(",
")",
"{",
"$",
"this",
"->",
"data",
"=",
"isset",
"(",
"$",
"this",
"->",
"data",
")",
"?",
"array_values",
"(",
"$",
"this",
"->",
"data",
")",
":",
"iterator_to_array",
"(",
"$",
"this",
"->",
"it",
",",
"false",
")",
... | Materializes and reindexes the current data into a series of sequential integer keys.
<p>Access {@see all()} on the result to get the resulting array.
<p>This is useful to extract the data as a linear array with no discontinuous keys.
><p>This is faster than {@see reindex()} bit it materializes the data. This should... | [
"Materializes",
"and",
"reindexes",
"the",
"current",
"data",
"into",
"a",
"series",
"of",
"sequential",
"integer",
"keys",
"."
] | eab8d85202046538449dd9e05d8b5b945c7f55ff | https://github.com/php-kit/flow/blob/eab8d85202046538449dd9e05d8b5b945c7f55ff/src/Flow/Flow.php#L521-L525 |
235,639 | php-kit/flow | src/Flow/Flow.php | Flow.prepend | function prepend ($list)
{
$a = new AppendIterator;
foreach (iterator ($list) as $it)
$a->append (iterator ($it));
$a->append ($this->getIterator ());
$this->setIterator ($a);
return $this;
} | php | function prepend ($list)
{
$a = new AppendIterator;
foreach (iterator ($list) as $it)
$a->append (iterator ($it));
$a->append ($this->getIterator ());
$this->setIterator ($a);
return $this;
} | [
"function",
"prepend",
"(",
"$",
"list",
")",
"{",
"$",
"a",
"=",
"new",
"AppendIterator",
";",
"foreach",
"(",
"iterator",
"(",
"$",
"list",
")",
"as",
"$",
"it",
")",
"$",
"a",
"->",
"append",
"(",
"iterator",
"(",
"$",
"it",
")",
")",
";",
"... | Prepends one or more iterators to the current one and sets a new iterator that iterates over all of them.
> ##### Caution
See {@see append()}
@param mixed $list A sequence of iterables to prepend.
@return $this | [
"Prepends",
"one",
"or",
"more",
"iterators",
"to",
"the",
"current",
"one",
"and",
"sets",
"a",
"new",
"iterator",
"that",
"iterates",
"over",
"all",
"of",
"them",
"."
] | eab8d85202046538449dd9e05d8b5b945c7f55ff | https://github.com/php-kit/flow/blob/eab8d85202046538449dd9e05d8b5b945c7f55ff/src/Flow/Flow.php#L536-L544 |
235,640 | php-kit/flow | src/Flow/Flow.php | Flow.prependValue | function prependValue ($value, $key = 0)
{
$this->setIterator (new HeadAndTailIterator ($value, $this->getIterator (), $key, true));
return $this;
} | php | function prependValue ($value, $key = 0)
{
$this->setIterator (new HeadAndTailIterator ($value, $this->getIterator (), $key, true));
return $this;
} | [
"function",
"prependValue",
"(",
"$",
"value",
",",
"$",
"key",
"=",
"0",
")",
"{",
"$",
"this",
"->",
"setIterator",
"(",
"new",
"HeadAndTailIterator",
"(",
"$",
"value",
",",
"$",
"this",
"->",
"getIterator",
"(",
")",
",",
"$",
"key",
",",
"true",... | Prepends a single value to the current iteration and sets a new iterator that iterates over that value and all
values of the previously set iterator.
> ##### Caution
See {@see append()}
@param mixed $value The value to be prepended.
@param mixed $key The key to be prepended.
@return $this | [
"Prepends",
"a",
"single",
"value",
"to",
"the",
"current",
"iteration",
"and",
"sets",
"a",
"new",
"iterator",
"that",
"iterates",
"over",
"that",
"value",
"and",
"all",
"values",
"of",
"the",
"previously",
"set",
"iterator",
"."
] | eab8d85202046538449dd9e05d8b5b945c7f55ff | https://github.com/php-kit/flow/blob/eab8d85202046538449dd9e05d8b5b945c7f55ff/src/Flow/Flow.php#L557-L561 |
235,641 | php-kit/flow | src/Flow/Flow.php | Flow.recursive | function recursive (callable $fn, $mode = RecursiveIteratorIterator::SELF_FIRST)
{
$this->setIterator (new RecursiveIteratorIterator (new RecursiveIterator ($this->getIterator (), $fn), $mode));
return $this;
} | php | function recursive (callable $fn, $mode = RecursiveIteratorIterator::SELF_FIRST)
{
$this->setIterator (new RecursiveIteratorIterator (new RecursiveIterator ($this->getIterator (), $fn), $mode));
return $this;
} | [
"function",
"recursive",
"(",
"callable",
"$",
"fn",
",",
"$",
"mode",
"=",
"RecursiveIteratorIterator",
"::",
"SELF_FIRST",
")",
"{",
"$",
"this",
"->",
"setIterator",
"(",
"new",
"RecursiveIteratorIterator",
"(",
"new",
"RecursiveIterator",
"(",
"$",
"this",
... | Wraps a recursive iterator over the current iterator.
@param callable $fn A callback that receives the current node's value, key and nesting depth, and returns an
iterable for the node's children or `null` if the node has no children.
@param int $mode One of the constants from RecursiveIteratorIterator:
<p> 0 =... | [
"Wraps",
"a",
"recursive",
"iterator",
"over",
"the",
"current",
"iterator",
"."
] | eab8d85202046538449dd9e05d8b5b945c7f55ff | https://github.com/php-kit/flow/blob/eab8d85202046538449dd9e05d8b5b945c7f55ff/src/Flow/Flow.php#L574-L578 |
235,642 | php-kit/flow | src/Flow/Flow.php | Flow.recursiveUnfold | function recursiveUnfold (callable $fn, $keepOriginals = false)
{
$w = function ($v, $k, $d) use ($fn, &$w, $keepOriginals) {
$r = $fn ($v, $k, $d);
if (is_iterableEx ($r)) {
$it = new UnfoldIterator (new MapIterator ($r, $w, $d + 1), UnfoldIterator::USE_ORIGINAL_KEYS);
return $keepOri... | php | function recursiveUnfold (callable $fn, $keepOriginals = false)
{
$w = function ($v, $k, $d) use ($fn, &$w, $keepOriginals) {
$r = $fn ($v, $k, $d);
if (is_iterableEx ($r)) {
$it = new UnfoldIterator (new MapIterator ($r, $w, $d + 1), UnfoldIterator::USE_ORIGINAL_KEYS);
return $keepOri... | [
"function",
"recursiveUnfold",
"(",
"callable",
"$",
"fn",
",",
"$",
"keepOriginals",
"=",
"false",
")",
"{",
"$",
"w",
"=",
"function",
"(",
"$",
"v",
",",
"$",
"k",
",",
"$",
"d",
")",
"use",
"(",
"$",
"fn",
",",
"&",
"$",
"w",
",",
"$",
"k... | Maps some or all iteration values to sub-iterations recursively and unfolds them into a single iteration.
<p>This is an alternative way to recursively iterate nested structures. Note that values that map to iterables
will not show up themselves on the final iteration unless `$keepOriginals` is `true` (ex: on a filesys... | [
"Maps",
"some",
"or",
"all",
"iteration",
"values",
"to",
"sub",
"-",
"iterations",
"recursively",
"and",
"unfolds",
"them",
"into",
"a",
"single",
"iteration",
"."
] | eab8d85202046538449dd9e05d8b5b945c7f55ff | https://github.com/php-kit/flow/blob/eab8d85202046538449dd9e05d8b5b945c7f55ff/src/Flow/Flow.php#L597-L611 |
235,643 | php-kit/flow | src/Flow/Flow.php | Flow.regex | function regex ($regexp, $preg_flags = 0, $useKeys = false)
{
$this->setIterator (
new RegexIterator ($this->getIterator (), $regexp, RegexIterator::ALL_MATCHES,
$useKeys ? RegexIterator::USE_KEY : 0,
$preg_flags)
);
return $this;
} | php | function regex ($regexp, $preg_flags = 0, $useKeys = false)
{
$this->setIterator (
new RegexIterator ($this->getIterator (), $regexp, RegexIterator::ALL_MATCHES,
$useKeys ? RegexIterator::USE_KEY : 0,
$preg_flags)
);
return $this;
} | [
"function",
"regex",
"(",
"$",
"regexp",
",",
"$",
"preg_flags",
"=",
"0",
",",
"$",
"useKeys",
"=",
"false",
")",
"{",
"$",
"this",
"->",
"setIterator",
"(",
"new",
"RegexIterator",
"(",
"$",
"this",
"->",
"getIterator",
"(",
")",
",",
"$",
"regexp"... | Transforms data into arrays of regular expression matches for each item.
@param string $regexp The regular expression to match.
@param int $preg_flags The regular expression flags. Can be a combination of: PREG_PATTERN_ORDER,
PREG_SET_ORDER, PREG_OFFSET_CAPTURE.
@param bool $useKeys When `true`, the iterat... | [
"Transforms",
"data",
"into",
"arrays",
"of",
"regular",
"expression",
"matches",
"for",
"each",
"item",
"."
] | eab8d85202046538449dd9e05d8b5b945c7f55ff | https://github.com/php-kit/flow/blob/eab8d85202046538449dd9e05d8b5b945c7f55ff/src/Flow/Flow.php#L643-L651 |
235,644 | php-kit/flow | src/Flow/Flow.php | Flow.regexExtract | function regexExtract ($regexp, $preg_flags = 0, $useKeys = false)
{
$this->setIterator (
new RegexIterator ($this->getIterator (), $regexp, RegexIterator::GET_MATCH,
$useKeys ? RegexIterator::USE_KEY : 0,
$preg_flags)
);
return $this;
} | php | function regexExtract ($regexp, $preg_flags = 0, $useKeys = false)
{
$this->setIterator (
new RegexIterator ($this->getIterator (), $regexp, RegexIterator::GET_MATCH,
$useKeys ? RegexIterator::USE_KEY : 0,
$preg_flags)
);
return $this;
} | [
"function",
"regexExtract",
"(",
"$",
"regexp",
",",
"$",
"preg_flags",
"=",
"0",
",",
"$",
"useKeys",
"=",
"false",
")",
"{",
"$",
"this",
"->",
"setIterator",
"(",
"new",
"RegexIterator",
"(",
"$",
"this",
"->",
"getIterator",
"(",
")",
",",
"$",
"... | Transforms data by extracting the first regular expression match for each item.
@param string $regexp The regular expression to match.
@param int $preg_flags The regular expression flags. Can be 0 or PREG_OFFSET_CAPTURE.
@param bool $useKeys When `true`, the iterated keys will be used instead of the corres... | [
"Transforms",
"data",
"by",
"extracting",
"the",
"first",
"regular",
"expression",
"match",
"for",
"each",
"item",
"."
] | eab8d85202046538449dd9e05d8b5b945c7f55ff | https://github.com/php-kit/flow/blob/eab8d85202046538449dd9e05d8b5b945c7f55ff/src/Flow/Flow.php#L661-L669 |
235,645 | php-kit/flow | src/Flow/Flow.php | Flow.regexMap | function regexMap ($regexp, $replaceWith, $useKeys = false)
{
$this->setIterator (
new RegexIterator ($this->getIterator (), $regexp, RegexIterator::REPLACE, $useKeys ? RegexIterator::USE_KEY : 0)
);
$this->it->replacement = $replaceWith;
return $this;
} | php | function regexMap ($regexp, $replaceWith, $useKeys = false)
{
$this->setIterator (
new RegexIterator ($this->getIterator (), $regexp, RegexIterator::REPLACE, $useKeys ? RegexIterator::USE_KEY : 0)
);
$this->it->replacement = $replaceWith;
return $this;
} | [
"function",
"regexMap",
"(",
"$",
"regexp",
",",
"$",
"replaceWith",
",",
"$",
"useKeys",
"=",
"false",
")",
"{",
"$",
"this",
"->",
"setIterator",
"(",
"new",
"RegexIterator",
"(",
"$",
"this",
"->",
"getIterator",
"(",
")",
",",
"$",
"regexp",
",",
... | Transforms each string data item into another using a regular expression.
@param string $regexp The regular expression to match.
@param string $replaceWith Literal content with $N placeholders, where N is the capture group index.
@param bool $useKeys When `true`, the iterated keys will be used instead of th... | [
"Transforms",
"each",
"string",
"data",
"item",
"into",
"another",
"using",
"a",
"regular",
"expression",
"."
] | eab8d85202046538449dd9e05d8b5b945c7f55ff | https://github.com/php-kit/flow/blob/eab8d85202046538449dd9e05d8b5b945c7f55ff/src/Flow/Flow.php#L679-L686 |
235,646 | php-kit/flow | src/Flow/Flow.php | Flow.regexSplit | function regexSplit ($regexp, $preg_flags = 0, $useKeys = false)
{
$this->setIterator (
new RegexIterator ($this->getIterator (), $regexp, RegexIterator::SPLIT, $useKeys ? RegexIterator::USE_KEY : 0,
$preg_flags)
);
return $this;
} | php | function regexSplit ($regexp, $preg_flags = 0, $useKeys = false)
{
$this->setIterator (
new RegexIterator ($this->getIterator (), $regexp, RegexIterator::SPLIT, $useKeys ? RegexIterator::USE_KEY : 0,
$preg_flags)
);
return $this;
} | [
"function",
"regexSplit",
"(",
"$",
"regexp",
",",
"$",
"preg_flags",
"=",
"0",
",",
"$",
"useKeys",
"=",
"false",
")",
"{",
"$",
"this",
"->",
"setIterator",
"(",
"new",
"RegexIterator",
"(",
"$",
"this",
"->",
"getIterator",
"(",
")",
",",
"$",
"re... | Splits each data item into arrays of strings using a regular expression.
@param string $regexp The regular expression to match.
@param int $preg_flags The regular expression flags. Can be a combination of: PREG_SPLIT_NO_EMPTY,
PREG_SPLIT_DELIM_CAPTURE, PREG_SPLIT_OFFSET_CAPTURE.
@param bool $useKeys When `... | [
"Splits",
"each",
"data",
"item",
"into",
"arrays",
"of",
"strings",
"using",
"a",
"regular",
"expression",
"."
] | eab8d85202046538449dd9e05d8b5b945c7f55ff | https://github.com/php-kit/flow/blob/eab8d85202046538449dd9e05d8b5b945c7f55ff/src/Flow/Flow.php#L697-L704 |
235,647 | php-kit/flow | src/Flow/Flow.php | Flow.reindex | function reindex ($i = 0, $st = 1)
{
$this->setIterator (new ReindexIterator($this->getIterator (), $i, $st));
return $this;
} | php | function reindex ($i = 0, $st = 1)
{
$this->setIterator (new ReindexIterator($this->getIterator (), $i, $st));
return $this;
} | [
"function",
"reindex",
"(",
"$",
"i",
"=",
"0",
",",
"$",
"st",
"=",
"1",
")",
"{",
"$",
"this",
"->",
"setIterator",
"(",
"new",
"ReindexIterator",
"(",
"$",
"this",
"->",
"getIterator",
"(",
")",
",",
"$",
"i",
",",
"$",
"st",
")",
")",
";",
... | Reindexes the current data into a series of sequential integer values, starting from the specified value.
@param int $i The new starting value for the keys sequence.
@param int $st The incremental step.
@return $this | [
"Reindexes",
"the",
"current",
"data",
"into",
"a",
"series",
"of",
"sequential",
"integer",
"values",
"starting",
"from",
"the",
"specified",
"value",
"."
] | eab8d85202046538449dd9e05d8b5b945c7f55ff | https://github.com/php-kit/flow/blob/eab8d85202046538449dd9e05d8b5b945c7f55ff/src/Flow/Flow.php#L713-L717 |
235,648 | php-kit/flow | src/Flow/Flow.php | Flow.repeatWhile | function repeatWhile (callable $fn)
{
$this->setIterator ($it = new LoopIterator ($this->getIterator ()));
$it->test ($fn);
return $this;
} | php | function repeatWhile (callable $fn)
{
$this->setIterator ($it = new LoopIterator ($this->getIterator ()));
$it->test ($fn);
return $this;
} | [
"function",
"repeatWhile",
"(",
"callable",
"$",
"fn",
")",
"{",
"$",
"this",
"->",
"setIterator",
"(",
"$",
"it",
"=",
"new",
"LoopIterator",
"(",
"$",
"this",
"->",
"getIterator",
"(",
")",
")",
")",
";",
"$",
"it",
"->",
"test",
"(",
"$",
"fn",
... | Repeats the iteration until the callback returns `false`.
<p>**Note:** the resulting iteration may have duplicate keys. Use {@see reindex()} to normalize them.
@param callable $fn A callback that receives the current iteration value and key, and returns a boolean.
@return $this | [
"Repeats",
"the",
"iteration",
"until",
"the",
"callback",
"returns",
"false",
"."
] | eab8d85202046538449dd9e05d8b5b945c7f55ff | https://github.com/php-kit/flow/blob/eab8d85202046538449dd9e05d8b5b945c7f55ff/src/Flow/Flow.php#L745-L750 |
235,649 | php-kit/flow | src/Flow/Flow.php | Flow.reverse | function reverse ($preserveKeys = false)
{
$this->pack ();
$this->it = $this->array_reverse_iterator ($this->data, $preserveKeys);
unset ($this->data);
return $this;
} | php | function reverse ($preserveKeys = false)
{
$this->pack ();
$this->it = $this->array_reverse_iterator ($this->data, $preserveKeys);
unset ($this->data);
return $this;
} | [
"function",
"reverse",
"(",
"$",
"preserveKeys",
"=",
"false",
")",
"{",
"$",
"this",
"->",
"pack",
"(",
")",
";",
"$",
"this",
"->",
"it",
"=",
"$",
"this",
"->",
"array_reverse_iterator",
"(",
"$",
"this",
"->",
"data",
",",
"$",
"preserveKeys",
")... | Reverses the order of iteration.
Note: this method materializes the data.
@param bool $preserveKeys If set to `true` numeric keys are preserved. Non-numeric keys are not affected by this
setting and will always be preserved.
@return $this | [
"Reverses",
"the",
"order",
"of",
"iteration",
"."
] | eab8d85202046538449dd9e05d8b5b945c7f55ff | https://github.com/php-kit/flow/blob/eab8d85202046538449dd9e05d8b5b945c7f55ff/src/Flow/Flow.php#L761-L767 |
235,650 | php-kit/flow | src/Flow/Flow.php | Flow.slice | function slice ($offset = 0, $count = -1)
{
$this->setIterator (new LimitIterator ($this->getIterator (), $offset, $count));
return $this;
} | php | function slice ($offset = 0, $count = -1)
{
$this->setIterator (new LimitIterator ($this->getIterator (), $offset, $count));
return $this;
} | [
"function",
"slice",
"(",
"$",
"offset",
"=",
"0",
",",
"$",
"count",
"=",
"-",
"1",
")",
"{",
"$",
"this",
"->",
"setIterator",
"(",
"new",
"LimitIterator",
"(",
"$",
"this",
"->",
"getIterator",
"(",
")",
",",
"$",
"offset",
",",
"$",
"count",
... | Limits iteration to the specified range.
@param int $offset Starts at 0.
@param int $count -1 = all.
@return $this | [
"Limits",
"iteration",
"to",
"the",
"specified",
"range",
"."
] | eab8d85202046538449dd9e05d8b5b945c7f55ff | https://github.com/php-kit/flow/blob/eab8d85202046538449dd9e05d8b5b945c7f55ff/src/Flow/Flow.php#L806-L810 |
235,651 | php-kit/flow | src/Flow/Flow.php | Flow.sort | function sort ($type = 'sort', $flags = SORT_REGULAR, callable $fn = null)
{
if (!isset (self::$SORT_TYPES[$type]))
throw new InvalidArgumentException ("Bad sort type: $type");
$n = self::$SORT_TYPES[$type];
$this->all (); // force materialization of data.
switch ($n) {
case 1:
$t... | php | function sort ($type = 'sort', $flags = SORT_REGULAR, callable $fn = null)
{
if (!isset (self::$SORT_TYPES[$type]))
throw new InvalidArgumentException ("Bad sort type: $type");
$n = self::$SORT_TYPES[$type];
$this->all (); // force materialization of data.
switch ($n) {
case 1:
$t... | [
"function",
"sort",
"(",
"$",
"type",
"=",
"'sort'",
",",
"$",
"flags",
"=",
"SORT_REGULAR",
",",
"callable",
"$",
"fn",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"self",
"::",
"$",
"SORT_TYPES",
"[",
"$",
"type",
"]",
")",
")",
"throw... | Sorts the data by its keys.
Note: this method materializes the data.
@param string $type The type of sort to perform.<br>
One of:
'asort' | 'arsort' | 'krsort' | 'ksort' | 'natcasesort' | 'natsort' | 'rsort' | 'shuffle' |
'sort' | 'uasort' | 'uksort' | 'usort'
@param int $flags One or more of the SORT_XXX con... | [
"Sorts",
"the",
"data",
"by",
"its",
"keys",
"."
] | eab8d85202046538449dd9e05d8b5b945c7f55ff | https://github.com/php-kit/flow/blob/eab8d85202046538449dd9e05d8b5b945c7f55ff/src/Flow/Flow.php#L825-L843 |
235,652 | php-kit/flow | src/Flow/Flow.php | Flow.swap | function swap (callable $fn)
{
$this->pack ();
$this->data = $fn ($this->data);
return $this;
} | php | function swap (callable $fn)
{
$this->pack ();
$this->data = $fn ($this->data);
return $this;
} | [
"function",
"swap",
"(",
"callable",
"$",
"fn",
")",
"{",
"$",
"this",
"->",
"pack",
"(",
")",
";",
"$",
"this",
"->",
"data",
"=",
"$",
"fn",
"(",
"$",
"this",
"->",
"data",
")",
";",
"return",
"$",
"this",
";",
"}"
] | Replaces the current data set by another.
@param callable $fn A callback that receives as argument an array of the current data and returns the
new data array.
@return $this | [
"Replaces",
"the",
"current",
"data",
"set",
"by",
"another",
"."
] | eab8d85202046538449dd9e05d8b5b945c7f55ff | https://github.com/php-kit/flow/blob/eab8d85202046538449dd9e05d8b5b945c7f55ff/src/Flow/Flow.php#L852-L857 |
235,653 | php-kit/flow | src/Flow/Flow.php | Flow.whereMatch | function whereMatch ($regexp, $preg_flags = 0, $useKeys = false)
{
$this->setIterator (new RegexIterator ($this->getIterator (), $regexp, RegexIterator::MATCH,
$useKeys ? RegexIterator::USE_KEY : 0, $preg_flags));
return $this;
} | php | function whereMatch ($regexp, $preg_flags = 0, $useKeys = false)
{
$this->setIterator (new RegexIterator ($this->getIterator (), $regexp, RegexIterator::MATCH,
$useKeys ? RegexIterator::USE_KEY : 0, $preg_flags));
return $this;
} | [
"function",
"whereMatch",
"(",
"$",
"regexp",
",",
"$",
"preg_flags",
"=",
"0",
",",
"$",
"useKeys",
"=",
"false",
")",
"{",
"$",
"this",
"->",
"setIterator",
"(",
"new",
"RegexIterator",
"(",
"$",
"this",
"->",
"getIterator",
"(",
")",
",",
"$",
"re... | Filters data using a regular expression test.
@param string $regexp The regular expression to match.
@param int $preg_flags The regular expression flags. Can be 0 or PREG_OFFSET_CAPTURE.
@param bool $useKeys When `true`, the iterated keys will be used instead of the corresponding values.
@return $this | [
"Filters",
"data",
"using",
"a",
"regular",
"expression",
"test",
"."
] | eab8d85202046538449dd9e05d8b5b945c7f55ff | https://github.com/php-kit/flow/blob/eab8d85202046538449dd9e05d8b5b945c7f55ff/src/Flow/Flow.php#L902-L907 |
235,654 | php-kit/flow | src/Flow/Flow.php | Flow.array_reverse_iterator | private function array_reverse_iterator (array $a, $preserveKeys = false)
{
if ($preserveKeys)
for (end ($a); ($key = key ($a)) !== null; prev ($a))
yield $key => current ($a);
else for (end ($a); ($key = key ($a)) !== null; prev ($a))
yield current ($a);
} | php | private function array_reverse_iterator (array $a, $preserveKeys = false)
{
if ($preserveKeys)
for (end ($a); ($key = key ($a)) !== null; prev ($a))
yield $key => current ($a);
else for (end ($a); ($key = key ($a)) !== null; prev ($a))
yield current ($a);
} | [
"private",
"function",
"array_reverse_iterator",
"(",
"array",
"$",
"a",
",",
"$",
"preserveKeys",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"preserveKeys",
")",
"for",
"(",
"end",
"(",
"$",
"a",
")",
";",
"(",
"$",
"key",
"=",
"key",
"(",
"$",
"a",
... | Returns an iterator that iterates an array on reverse.
@param array $a
@param bool $preserveKeys If set to `true` numeric keys are preserved. Non-numeric keys are not affected by this
setting and will always be preserved.
@return \Generator | [
"Returns",
"an",
"iterator",
"that",
"iterates",
"an",
"array",
"on",
"reverse",
"."
] | eab8d85202046538449dd9e05d8b5b945c7f55ff | https://github.com/php-kit/flow/blob/eab8d85202046538449dd9e05d8b5b945c7f55ff/src/Flow/Flow.php#L929-L936 |
235,655 | thecodingmachine/utils.i18n.fine | src/Mouf/Utils/I18n/Fine/FineMessageFile.php | FineMessageFile.load | public function load($file) {
$this->file = $file;
$msg = array();
@include($file);
$this->msg = $msg;
} | php | public function load($file) {
$this->file = $file;
$msg = array();
@include($file);
$this->msg = $msg;
} | [
"public",
"function",
"load",
"(",
"$",
"file",
")",
"{",
"$",
"this",
"->",
"file",
"=",
"$",
"file",
";",
"$",
"msg",
"=",
"array",
"(",
")",
";",
"@",
"include",
"(",
"$",
"file",
")",
";",
"$",
"this",
"->",
"msg",
"=",
"$",
"msg",
";",
... | Loads the php file
@var $file The path to the file to be loaded | [
"Loads",
"the",
"php",
"file"
] | 69c165497bc5c202892fdc8022591eddbb8e0e3b | https://github.com/thecodingmachine/utils.i18n.fine/blob/69c165497bc5c202892fdc8022591eddbb8e0e3b/src/Mouf/Utils/I18n/Fine/FineMessageFile.php#L29-L36 |
235,656 | cityware/city-utility | src/PortScanner.php | PortScanner.scanPortRange | public function scanPortRange() {
if (strtolower($this->typePort) == 'tcp') {
$hostIp = $this->hostIP;
} else if (strtolower($this->typePort) == 'udp') {
$hostIp = "udp://$this->hostIP";
} else {
throw new \Exception('Port Type undefined!');
}
... | php | public function scanPortRange() {
if (strtolower($this->typePort) == 'tcp') {
$hostIp = $this->hostIP;
} else if (strtolower($this->typePort) == 'udp') {
$hostIp = "udp://$this->hostIP";
} else {
throw new \Exception('Port Type undefined!');
}
... | [
"public",
"function",
"scanPortRange",
"(",
")",
"{",
"if",
"(",
"strtolower",
"(",
"$",
"this",
"->",
"typePort",
")",
"==",
"'tcp'",
")",
"{",
"$",
"hostIp",
"=",
"$",
"this",
"->",
"hostIP",
";",
"}",
"else",
"if",
"(",
"strtolower",
"(",
"$",
"... | Scan range ports in host
@return array
@throws \Exception | [
"Scan",
"range",
"ports",
"in",
"host"
] | fadd33233cdaf743d87c3c30e341f2b96e96e476 | https://github.com/cityware/city-utility/blob/fadd33233cdaf743d87c3c30e341f2b96e96e476/src/PortScanner.php#L122-L141 |
235,657 | tonicforhealth/health-checker-check-email | src/Email/Receive/EmailReceiveCheck.php | EmailReceiveCheck.removeOldItems | private function removeOldItems()
{
$emailSendReceiveOld = $this
->getEmailSendReceiveColl()
->findAll($this->findOldEmailReceiveOldCallback());
/** @var EmailSendReceive $emailSendCheckI */
foreach ($emailSendReceiveOld as $emailSendCheckI) {
$this->getEm... | php | private function removeOldItems()
{
$emailSendReceiveOld = $this
->getEmailSendReceiveColl()
->findAll($this->findOldEmailReceiveOldCallback());
/** @var EmailSendReceive $emailSendCheckI */
foreach ($emailSendReceiveOld as $emailSendCheckI) {
$this->getEm... | [
"private",
"function",
"removeOldItems",
"(",
")",
"{",
"$",
"emailSendReceiveOld",
"=",
"$",
"this",
"->",
"getEmailSendReceiveColl",
"(",
")",
"->",
"findAll",
"(",
"$",
"this",
"->",
"findOldEmailReceiveOldCallback",
"(",
")",
")",
";",
"/** @var EmailSendRecei... | remove old items. | [
"remove",
"old",
"items",
"."
] | 2fb0c6f3708ccaeb113405adf8da0e34f4c28ca8 | https://github.com/tonicforhealth/health-checker-check-email/blob/2fb0c6f3708ccaeb113405adf8da0e34f4c28ca8/src/Email/Receive/EmailReceiveCheck.php#L202-L213 |
235,658 | GrupaZero/core | src/Gzero/Core/Models/File.php | File.setInfoAttribute | public function setInfoAttribute($value)
{
return ($value) ? $this->attributes['info'] = json_encode($value) : $this->attributes['info'] = null;
} | php | public function setInfoAttribute($value)
{
return ($value) ? $this->attributes['info'] = json_encode($value) : $this->attributes['info'] = null;
} | [
"public",
"function",
"setInfoAttribute",
"(",
"$",
"value",
")",
"{",
"return",
"(",
"$",
"value",
")",
"?",
"$",
"this",
"->",
"attributes",
"[",
"'info'",
"]",
"=",
"json_encode",
"(",
"$",
"value",
")",
":",
"$",
"this",
"->",
"attributes",
"[",
... | Set the info value
@param string $value info value
@return string | [
"Set",
"the",
"info",
"value"
] | 093e515234fa0385b259ba4d8bc7832174a44eab | https://github.com/GrupaZero/core/blob/093e515234fa0385b259ba4d8bc7832174a44eab/src/Gzero/Core/Models/File.php#L152-L155 |
235,659 | GrupaZero/core | src/Gzero/Core/Models/File.php | File.removeExistingTranslation | public function removeExistingTranslation($languageCode)
{
return $this->translations()
->where('file_id', $this->id)
->where('language_code', $languageCode)
->delete();
} | php | public function removeExistingTranslation($languageCode)
{
return $this->translations()
->where('file_id', $this->id)
->where('language_code', $languageCode)
->delete();
} | [
"public",
"function",
"removeExistingTranslation",
"(",
"$",
"languageCode",
")",
"{",
"return",
"$",
"this",
"->",
"translations",
"(",
")",
"->",
"where",
"(",
"'file_id'",
",",
"$",
"this",
"->",
"id",
")",
"->",
"where",
"(",
"'language_code'",
",",
"$... | Function removes file translations in provided language code
@param string $languageCode language code
@return mixed | [
"Function",
"removes",
"file",
"translations",
"in",
"provided",
"language",
"code"
] | 093e515234fa0385b259ba4d8bc7832174a44eab | https://github.com/GrupaZero/core/blob/093e515234fa0385b259ba4d8bc7832174a44eab/src/Gzero/Core/Models/File.php#L176-L182 |
235,660 | dlabas/DlcDoctrine | src/DlcDoctrine/Mapper/AbstractMapper.php | AbstractMapper.getQueryableProperties | public function getQueryableProperties()
{
$classMetadata = $this->getObjectManager()
->getClassMetadata($this->getEntityClass());
$fields = $classMetadata->getFieldNames();
$alias = $this->getEntityClassAlias();
foreach ($fields as $key => &$field) {... | php | public function getQueryableProperties()
{
$classMetadata = $this->getObjectManager()
->getClassMetadata($this->getEntityClass());
$fields = $classMetadata->getFieldNames();
$alias = $this->getEntityClassAlias();
foreach ($fields as $key => &$field) {... | [
"public",
"function",
"getQueryableProperties",
"(",
")",
"{",
"$",
"classMetadata",
"=",
"$",
"this",
"->",
"getObjectManager",
"(",
")",
"->",
"getClassMetadata",
"(",
"$",
"this",
"->",
"getEntityClass",
"(",
")",
")",
";",
"$",
"fields",
"=",
"$",
"cla... | Returns a list of fields for the query condition
@return array | [
"Returns",
"a",
"list",
"of",
"fields",
"for",
"the",
"query",
"condition"
] | 1e754c208197e9aa7a9d58efcc726e109aaa6edf | https://github.com/dlabas/DlcDoctrine/blob/1e754c208197e9aa7a9d58efcc726e109aaa6edf/src/DlcDoctrine/Mapper/AbstractMapper.php#L125-L143 |
235,661 | dlabas/DlcDoctrine | src/DlcDoctrine/Mapper/AbstractMapper.php | AbstractMapper.getOrderByIdentifier | public function getOrderByIdentifier($orderBy)
{
$objectManager = $this->getObjectManager();
$classMetadata = $objectManager->getClassMetadata($this->getEntityClass());
if (strpos($orderBy, '::') === false) {
if (!$classMetadata->hasField($orderBy)) {
throw new ... | php | public function getOrderByIdentifier($orderBy)
{
$objectManager = $this->getObjectManager();
$classMetadata = $objectManager->getClassMetadata($this->getEntityClass());
if (strpos($orderBy, '::') === false) {
if (!$classMetadata->hasField($orderBy)) {
throw new ... | [
"public",
"function",
"getOrderByIdentifier",
"(",
"$",
"orderBy",
")",
"{",
"$",
"objectManager",
"=",
"$",
"this",
"->",
"getObjectManager",
"(",
")",
";",
"$",
"classMetadata",
"=",
"$",
"objectManager",
"->",
"getClassMetadata",
"(",
"$",
"this",
"->",
"... | Returns the column identifier for the order by property
@param sting $orderBy
@throws \InvalidArgumentException
@return string | [
"Returns",
"the",
"column",
"identifier",
"for",
"the",
"order",
"by",
"property"
] | 1e754c208197e9aa7a9d58efcc726e109aaa6edf | https://github.com/dlabas/DlcDoctrine/blob/1e754c208197e9aa7a9d58efcc726e109aaa6edf/src/DlcDoctrine/Mapper/AbstractMapper.php#L152-L203 |
235,662 | dlabas/DlcDoctrine | src/DlcDoctrine/Mapper/AbstractMapper.php | AbstractMapper.addJoinTablesToQueryBuilder | protected function addJoinTablesToQueryBuilder(QueryBuilder $queryBuilder)
{
$objectManager = $this->getObjectManager();
$entityAlias = $this->getEntityClassAlias();
$classMetaData = $objectManager->getClassMetadata($this->getEntityClass());
$assocMappings = $classMetaData->getAss... | php | protected function addJoinTablesToQueryBuilder(QueryBuilder $queryBuilder)
{
$objectManager = $this->getObjectManager();
$entityAlias = $this->getEntityClassAlias();
$classMetaData = $objectManager->getClassMetadata($this->getEntityClass());
$assocMappings = $classMetaData->getAss... | [
"protected",
"function",
"addJoinTablesToQueryBuilder",
"(",
"QueryBuilder",
"$",
"queryBuilder",
")",
"{",
"$",
"objectManager",
"=",
"$",
"this",
"->",
"getObjectManager",
"(",
")",
";",
"$",
"entityAlias",
"=",
"$",
"this",
"->",
"getEntityClassAlias",
"(",
"... | Adds joins for all association mappings to the query builder
@param QueryBuilder $queryBuilder | [
"Adds",
"joins",
"for",
"all",
"association",
"mappings",
"to",
"the",
"query",
"builder"
] | 1e754c208197e9aa7a9d58efcc726e109aaa6edf | https://github.com/dlabas/DlcDoctrine/blob/1e754c208197e9aa7a9d58efcc726e109aaa6edf/src/DlcDoctrine/Mapper/AbstractMapper.php#L210-L225 |
235,663 | dlabas/DlcDoctrine | src/DlcDoctrine/Mapper/AbstractMapper.php | AbstractMapper.addFilterToQueryBuilder | protected function addFilterToQueryBuilder(array $filter, QueryBuilder $queryBuilder)
{
$objectManager = $this->getObjectManager();
$entityClassAlias = $this->getEntityClassAlias();
$classMetaData = $objectManager->getClassMetadata($this->getEntityClass());
$assocMappings = ... | php | protected function addFilterToQueryBuilder(array $filter, QueryBuilder $queryBuilder)
{
$objectManager = $this->getObjectManager();
$entityClassAlias = $this->getEntityClassAlias();
$classMetaData = $objectManager->getClassMetadata($this->getEntityClass());
$assocMappings = ... | [
"protected",
"function",
"addFilterToQueryBuilder",
"(",
"array",
"$",
"filter",
",",
"QueryBuilder",
"$",
"queryBuilder",
")",
"{",
"$",
"objectManager",
"=",
"$",
"this",
"->",
"getObjectManager",
"(",
")",
";",
"$",
"entityClassAlias",
"=",
"$",
"this",
"->... | Adds filter conditions to query bilder
@param array $filter
@param QueryBuilder $queryBuilder
@throws \InvalidArgumentException
@return integer | [
"Adds",
"filter",
"conditions",
"to",
"query",
"bilder"
] | 1e754c208197e9aa7a9d58efcc726e109aaa6edf | https://github.com/dlabas/DlcDoctrine/blob/1e754c208197e9aa7a9d58efcc726e109aaa6edf/src/DlcDoctrine/Mapper/AbstractMapper.php#L235-L260 |
235,664 | loopsframework/base | src/Loops.php | Loops.hasService | public function hasService($name, $resolve = TRUE) {
if(array_key_exists($name, $this->services)) {
return TRUE;
}
if(!$resolve) {
return FALSE;
}
$classname = "Loops\\Service\\".Misc::camelize($name);
if(class_exists($classname)) {
... | php | public function hasService($name, $resolve = TRUE) {
if(array_key_exists($name, $this->services)) {
return TRUE;
}
if(!$resolve) {
return FALSE;
}
$classname = "Loops\\Service\\".Misc::camelize($name);
if(class_exists($classname)) {
... | [
"public",
"function",
"hasService",
"(",
"$",
"name",
",",
"$",
"resolve",
"=",
"TRUE",
")",
"{",
"if",
"(",
"array_key_exists",
"(",
"$",
"name",
",",
"$",
"this",
"->",
"services",
")",
")",
"{",
"return",
"TRUE",
";",
"}",
"if",
"(",
"!",
"$",
... | Checks if a service exists
@param string $name The name of the service
@param bool $resolve Specified if Loops should try to resolve unloaded services from the Loops\Service namespace.
@return bool TRUE if the service is registered (or can be created from the Loops\Service namespace if $resolve is TRUE, see getService... | [
"Checks",
"if",
"a",
"service",
"exists"
] | 5a15172ed4e543d7d5ecd8bd65e31f26bab3d192 | https://github.com/loopsframework/base/blob/5a15172ed4e543d7d5ecd8bd65e31f26bab3d192/src/Loops.php#L74-L97 |
235,665 | loopsframework/base | src/Loops.php | Loops.createService | public function createService($name, ArrayObject $config = NULL, $merge_into_config = FALSE) {
if($merge_into_config) {
$service_config = $this->config->offsetExists($name) ? $this->config->offsetGet($name) : new ArrayObject;
if(is_array($service_config)) {
$service_conf... | php | public function createService($name, ArrayObject $config = NULL, $merge_into_config = FALSE) {
if($merge_into_config) {
$service_config = $this->config->offsetExists($name) ? $this->config->offsetGet($name) : new ArrayObject;
if(is_array($service_config)) {
$service_conf... | [
"public",
"function",
"createService",
"(",
"$",
"name",
",",
"ArrayObject",
"$",
"config",
"=",
"NULL",
",",
"$",
"merge_into_config",
"=",
"FALSE",
")",
"{",
"if",
"(",
"$",
"merge_into_config",
")",
"{",
"$",
"service_config",
"=",
"$",
"this",
"->",
... | Creates a new instance of a service
@param $name The service name
@param array $config
@return Loops\Service\ServiceInterface The new service | [
"Creates",
"a",
"new",
"instance",
"of",
"a",
"service"
] | 5a15172ed4e543d7d5ecd8bd65e31f26bab3d192 | https://github.com/loopsframework/base/blob/5a15172ed4e543d7d5ecd8bd65e31f26bab3d192/src/Loops.php#L133-L179 |
235,666 | loopsframework/base | src/Loops.php | Loops.registerService | public function registerService($name, $service, array $params = [], $shared = TRUE) {
if(is_callable($service)) {
$this->services[$name] = [ "shared" => $shared, "params" => $params, "callback" => $service ];
}
elseif(is_object($service)) {
$this->services[$name] = [ "sh... | php | public function registerService($name, $service, array $params = [], $shared = TRUE) {
if(is_callable($service)) {
$this->services[$name] = [ "shared" => $shared, "params" => $params, "callback" => $service ];
}
elseif(is_object($service)) {
$this->services[$name] = [ "sh... | [
"public",
"function",
"registerService",
"(",
"$",
"name",
",",
"$",
"service",
",",
"array",
"$",
"params",
"=",
"[",
"]",
",",
"$",
"shared",
"=",
"TRUE",
")",
"{",
"if",
"(",
"is_callable",
"(",
"$",
"service",
")",
")",
"{",
"$",
"this",
"->",
... | Registers a custom Service
@param string $name The service name
@param mixed $service A service class name as string, a callable (which returns the service) or an Object that is the service itself.
@param array $params If $service is a string/callable: Parameters that are passed to the constructor/callable when the se... | [
"Registers",
"a",
"custom",
"Service"
] | 5a15172ed4e543d7d5ecd8bd65e31f26bab3d192 | https://github.com/loopsframework/base/blob/5a15172ed4e543d7d5ecd8bd65e31f26bab3d192/src/Loops.php#L189-L202 |
235,667 | jmpantoja/planb-utils | src/Type/Path/PathTree.php | PathTree.getTree | public function getTree(): array
{
$tree = [];
$size = count($this->segments);
for ($index = 0; $index < $size; $index = $index + 1) {
$temp = array_slice($this->segments, 0, $index + 1);
$path = implode(DIRECTORY_SEPARATOR, $temp);
$tree[] = Path::norma... | php | public function getTree(): array
{
$tree = [];
$size = count($this->segments);
for ($index = 0; $index < $size; $index = $index + 1) {
$temp = array_slice($this->segments, 0, $index + 1);
$path = implode(DIRECTORY_SEPARATOR, $temp);
$tree[] = Path::norma... | [
"public",
"function",
"getTree",
"(",
")",
":",
"array",
"{",
"$",
"tree",
"=",
"[",
"]",
";",
"$",
"size",
"=",
"count",
"(",
"$",
"this",
"->",
"segments",
")",
";",
"for",
"(",
"$",
"index",
"=",
"0",
";",
"$",
"index",
"<",
"$",
"size",
"... | Devuelve el arbol de directorios, desde la raiz hasta la ruta actual,
como un array de strings
@return string[] | [
"Devuelve",
"el",
"arbol",
"de",
"directorios",
"desde",
"la",
"raiz",
"hasta",
"la",
"ruta",
"actual",
"como",
"un",
"array",
"de",
"strings"
] | d17fbced4a285275928f8428ee56e269eb851690 | https://github.com/jmpantoja/planb-utils/blob/d17fbced4a285275928f8428ee56e269eb851690/src/Type/Path/PathTree.php#L61-L74 |
235,668 | jmpantoja/planb-utils | src/Type/Path/PathTree.php | PathTree.getPathTree | public function getPathTree(): array
{
$tree = [];
foreach ($this->getTree() as $branch) {
$tree[] = Path::make($branch);
}
return $tree;
} | php | public function getPathTree(): array
{
$tree = [];
foreach ($this->getTree() as $branch) {
$tree[] = Path::make($branch);
}
return $tree;
} | [
"public",
"function",
"getPathTree",
"(",
")",
":",
"array",
"{",
"$",
"tree",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"getTree",
"(",
")",
"as",
"$",
"branch",
")",
"{",
"$",
"tree",
"[",
"]",
"=",
"Path",
"::",
"make",
"(",
"$"... | Devuelve el arbol de directorios, desde la raiz hasta la ruta actual,
como un array de objetos Paths
@return \PlanB\Type\Path\Path[] | [
"Devuelve",
"el",
"arbol",
"de",
"directorios",
"desde",
"la",
"raiz",
"hasta",
"la",
"ruta",
"actual",
"como",
"un",
"array",
"de",
"objetos",
"Paths"
] | d17fbced4a285275928f8428ee56e269eb851690 | https://github.com/jmpantoja/planb-utils/blob/d17fbced4a285275928f8428ee56e269eb851690/src/Type/Path/PathTree.php#L95-L103 |
235,669 | fabsgc/framework | Core/Pdo/PdoStatement.php | PdoStatement.bindValue | public function bindValue($parameter, $value, $data_type = \PDO::PARAM_STR) {
$this->_debugBindValues[$parameter] = $value;
parent::bindValue($parameter, $value, $data_type);
} | php | public function bindValue($parameter, $value, $data_type = \PDO::PARAM_STR) {
$this->_debugBindValues[$parameter] = $value;
parent::bindValue($parameter, $value, $data_type);
} | [
"public",
"function",
"bindValue",
"(",
"$",
"parameter",
",",
"$",
"value",
",",
"$",
"data_type",
"=",
"\\",
"PDO",
"::",
"PARAM_STR",
")",
"{",
"$",
"this",
"->",
"_debugBindValues",
"[",
"$",
"parameter",
"]",
"=",
"$",
"value",
";",
"parent",
"::"... | override binvalue to keep in memory the vars
@access public
@param $parameter string
@param $value string
@param $data_type int
@return bool|void
@since 3.0
@package Gcs\Framework\Core\Pdo | [
"override",
"binvalue",
"to",
"keep",
"in",
"memory",
"the",
"vars"
] | 45e58182aba6a3c6381970a1fd3c17662cff2168 | https://github.com/fabsgc/framework/blob/45e58182aba6a3c6381970a1fd3c17662cff2168/Core/Pdo/PdoStatement.php#L47-L50 |
235,670 | fabsgc/framework | Core/Pdo/PdoStatement.php | PdoStatement.debugQuery | public function debugQuery($replaced = true) {
$q = $this->queryString;
if (!$replaced) {
return $q;
}
else {
if (count($this->_debugBindValues) > 0) {
return preg_replace_callback('/:([0-9a-z_]+)/i', [$this, '_debugReplaceBindValue'], $q);
... | php | public function debugQuery($replaced = true) {
$q = $this->queryString;
if (!$replaced) {
return $q;
}
else {
if (count($this->_debugBindValues) > 0) {
return preg_replace_callback('/:([0-9a-z_]+)/i', [$this, '_debugReplaceBindValue'], $q);
... | [
"public",
"function",
"debugQuery",
"(",
"$",
"replaced",
"=",
"true",
")",
"{",
"$",
"q",
"=",
"$",
"this",
"->",
"queryString",
";",
"if",
"(",
"!",
"$",
"replaced",
")",
"{",
"return",
"$",
"q",
";",
"}",
"else",
"{",
"if",
"(",
"count",
"(",
... | return query with vars or not
@access public
@param $replaced boolean
@return string
@since 3.0
@package Gcs\Framework\Core\Pdo | [
"return",
"query",
"with",
"vars",
"or",
"not"
] | 45e58182aba6a3c6381970a1fd3c17662cff2168 | https://github.com/fabsgc/framework/blob/45e58182aba6a3c6381970a1fd3c17662cff2168/Core/Pdo/PdoStatement.php#L85-L99 |
235,671 | fabsgc/framework | Core/Pdo/PdoStatement.php | PdoStatement._debugReplaceBindValue | protected function _debugReplaceBindValue($m) {
$v = $this->_debugBindValues[':' . $m[1]];
switch (gettype($v)) {
case 'boolean' :
return $v;
break;
case 'integer' :
return $v;
break;
case 'double' :
... | php | protected function _debugReplaceBindValue($m) {
$v = $this->_debugBindValues[':' . $m[1]];
switch (gettype($v)) {
case 'boolean' :
return $v;
break;
case 'integer' :
return $v;
break;
case 'double' :
... | [
"protected",
"function",
"_debugReplaceBindValue",
"(",
"$",
"m",
")",
"{",
"$",
"v",
"=",
"$",
"this",
"->",
"_debugBindValues",
"[",
"':'",
".",
"$",
"m",
"[",
"1",
"]",
"]",
";",
"switch",
"(",
"gettype",
"(",
"$",
"v",
")",
")",
"{",
"case",
... | replace vars in the query
@access protected
@param $m array
@return string
@since 3.0
@package Gcs\Framework\Core\Pdo | [
"replace",
"vars",
"in",
"the",
"query"
] | 45e58182aba6a3c6381970a1fd3c17662cff2168 | https://github.com/fabsgc/framework/blob/45e58182aba6a3c6381970a1fd3c17662cff2168/Core/Pdo/PdoStatement.php#L110-L138 |
235,672 | flywheel2/security | validators/traits/ValidateTrait.php | ValidateTrait.CreditCard | public static function CreditCard ($value, $options) {
//
$number_pattern_list = [
'American Express' => [
"/^34[0-9]{13}$/",
"/^37[0-9]{13}$/",
],
'China UnionPay' => [
"/^62212[6-9][0-9]{10}$/",
"/^6221[3-9][0-9][0-9]{10}$/",
"/^622[2-8] [0-9]{12}$/",
"/^6229[01][0-9][0-9]{10}$/",... | php | public static function CreditCard ($value, $options) {
//
$number_pattern_list = [
'American Express' => [
"/^34[0-9]{13}$/",
"/^37[0-9]{13}$/",
],
'China UnionPay' => [
"/^62212[6-9][0-9]{10}$/",
"/^6221[3-9][0-9][0-9]{10}$/",
"/^622[2-8] [0-9]{12}$/",
"/^6229[01][0-9][0-9]{10}$/",... | [
"public",
"static",
"function",
"CreditCard",
"(",
"$",
"value",
",",
"$",
"options",
")",
"{",
"//",
"$",
"number_pattern_list",
"=",
"[",
"'American Express'",
"=>",
"[",
"\"/^34[0-9]{13}$/\"",
",",
"\"/^37[0-9]{13}$/\"",
",",
"]",
",",
"'China UnionPay'",
"=>... | Credit card check | [
"Credit",
"card",
"check"
] | beb3f82dc21922696f3ee720c36fff341cabc132 | https://github.com/flywheel2/security/blob/beb3f82dc21922696f3ee720c36fff341cabc132/validators/traits/ValidateTrait.php#L314-L373 |
235,673 | flextype-components/html | Html.php | Html.toText | public static function toText(string $value, bool $double_encode = true) : string
{
return htmlspecialchars($value, ENT_QUOTES, 'utf-8', $double_encode);
} | php | public static function toText(string $value, bool $double_encode = true) : string
{
return htmlspecialchars($value, ENT_QUOTES, 'utf-8', $double_encode);
} | [
"public",
"static",
"function",
"toText",
"(",
"string",
"$",
"value",
",",
"bool",
"$",
"double_encode",
"=",
"true",
")",
":",
"string",
"{",
"return",
"htmlspecialchars",
"(",
"$",
"value",
",",
"ENT_QUOTES",
",",
"'utf-8'",
",",
"$",
"double_encode",
"... | Convert special characters to HTML entities. All untrusted content
should be passed through this method to prevent XSS injections.
echo Html::toText('test');
@param string $value String to convert
@param bool $double_encode Encode existing entities
@return string | [
"Convert",
"special",
"characters",
"to",
"HTML",
"entities",
".",
"All",
"untrusted",
"content",
"should",
"be",
"passed",
"through",
"this",
"method",
"to",
"prevent",
"XSS",
"injections",
"."
] | 8cd40014314eb96380a37560ff511aba9a806240 | https://github.com/flextype-components/html/blob/8cd40014314eb96380a37560ff511aba9a806240/Html.php#L75-L78 |
235,674 | flextype-components/html | Html.php | Html.arrow | public static function arrow(string $direction) : string
{
switch ($direction) {
case "up": $output = '<span class="arrow">↑</span>'; break;
case "down": $output = '<span class="arrow">↓</span>'; break;
case "left": $output = '<span class="arrow">←</sp... | php | public static function arrow(string $direction) : string
{
switch ($direction) {
case "up": $output = '<span class="arrow">↑</span>'; break;
case "down": $output = '<span class="arrow">↓</span>'; break;
case "left": $output = '<span class="arrow">←</sp... | [
"public",
"static",
"function",
"arrow",
"(",
"string",
"$",
"direction",
")",
":",
"string",
"{",
"switch",
"(",
"$",
"direction",
")",
"{",
"case",
"\"up\"",
":",
"$",
"output",
"=",
"'<span class=\"arrow\">↑</span>'",
";",
"break",
";",
"case",
"\"do... | Create an arrow
echo Html::arrow('right');
@param string $direction Arrow direction [up,down,left,right]
@return string | [
"Create",
"an",
"arrow"
] | 8cd40014314eb96380a37560ff511aba9a806240 | https://github.com/flextype-components/html/blob/8cd40014314eb96380a37560ff511aba9a806240/Html.php#L163-L173 |
235,675 | flextype-components/html | Html.php | Html.anchor | public static function anchor(string $title, string $url = '', array $attributes = null) : string
{
// Add link
if ($url !== '') $attributes['href'] = $url;
return '<a'.Html::attributes($attributes).'>'.$title.'</a>';
} | php | public static function anchor(string $title, string $url = '', array $attributes = null) : string
{
// Add link
if ($url !== '') $attributes['href'] = $url;
return '<a'.Html::attributes($attributes).'>'.$title.'</a>';
} | [
"public",
"static",
"function",
"anchor",
"(",
"string",
"$",
"title",
",",
"string",
"$",
"url",
"=",
"''",
",",
"array",
"$",
"attributes",
"=",
"null",
")",
":",
"string",
"{",
"// Add link",
"if",
"(",
"$",
"url",
"!==",
"''",
")",
"$",
"attribut... | Create HTML link anchor.
echo Html::anchor('About', 'http://sitename.com/about');
@param string $title Anchor title
@param string $url Anchor url
@param array $attributes Anchor attributes
@return string | [
"Create",
"HTML",
"link",
"anchor",
"."
] | 8cd40014314eb96380a37560ff511aba9a806240 | https://github.com/flextype-components/html/blob/8cd40014314eb96380a37560ff511aba9a806240/Html.php#L185-L190 |
235,676 | flextype-components/html | Html.php | Html.doctype | public static function doctype(string $type = 'html5')
{
$doctypes = ['xhtml11' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">',
'xhtml1-strict' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/... | php | public static function doctype(string $type = 'html5')
{
$doctypes = ['xhtml11' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">',
'xhtml1-strict' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/... | [
"public",
"static",
"function",
"doctype",
"(",
"string",
"$",
"type",
"=",
"'html5'",
")",
"{",
"$",
"doctypes",
"=",
"[",
"'xhtml11'",
"=>",
"'<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\" \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">'",
",",
"'xhtml1-strict'",
... | Generate document type declarations
echo Html::doctype('html5');
@param string $type Doctype to generated
@return mixed | [
"Generate",
"document",
"type",
"declarations"
] | 8cd40014314eb96380a37560ff511aba9a806240 | https://github.com/flextype-components/html/blob/8cd40014314eb96380a37560ff511aba9a806240/Html.php#L217-L229 |
235,677 | kapiphp/http | Uri.php | Uri._validateState | private function _validateState()
{
if (!$this->getAuthority()) {
if (0 === strpos($this->path, '//')) {
throw new InvalidArgumentException('The path of a URI without an authority must not start with two slashes "//"');
}
if (!$this->scheme && false !== st... | php | private function _validateState()
{
if (!$this->getAuthority()) {
if (0 === strpos($this->path, '//')) {
throw new InvalidArgumentException('The path of a URI without an authority must not start with two slashes "//"');
}
if (!$this->scheme && false !== st... | [
"private",
"function",
"_validateState",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"getAuthority",
"(",
")",
")",
"{",
"if",
"(",
"0",
"===",
"strpos",
"(",
"$",
"this",
"->",
"path",
",",
"'//'",
")",
")",
"{",
"throw",
"new",
"InvalidArgu... | Valid Uri State
@throws \InvalidArgumentException | [
"Valid",
"Uri",
"State"
] | 476fcf45dadd75aa5ef8503752d15f7e7b83e57d | https://github.com/kapiphp/http/blob/476fcf45dadd75aa5ef8503752d15f7e7b83e57d/Uri.php#L344-L356 |
235,678 | flextype-components/arr | Arr.php | Arr.sort | public static function sort(array $array, string $field, string $direction = 'ASC', $method = SORT_REGULAR) : array
{
if (count($array) > 0) {
// Create the helper array
foreach ($array as $key => $row) {
$helper[$key] = function_exists('mb_strtolower') ? mb_str... | php | public static function sort(array $array, string $field, string $direction = 'ASC', $method = SORT_REGULAR) : array
{
if (count($array) > 0) {
// Create the helper array
foreach ($array as $key => $row) {
$helper[$key] = function_exists('mb_strtolower') ? mb_str... | [
"public",
"static",
"function",
"sort",
"(",
"array",
"$",
"array",
",",
"string",
"$",
"field",
",",
"string",
"$",
"direction",
"=",
"'ASC'",
",",
"$",
"method",
"=",
"SORT_REGULAR",
")",
":",
"array",
"{",
"if",
"(",
"count",
"(",
"$",
"array",
")... | Sorts a multi-dimensional array by a certain column
$new_array = Arr::sort($old_array, 'title');
@param array $array The source array
@param string $field The name of the column
@param string $direction Order type DESC (descending) or ASC (ascending)
@param const $method A PHP sort method flag or 'na... | [
"Sorts",
"a",
"multi",
"-",
"dimensional",
"array",
"by",
"a",
"certain",
"column"
] | 56ba878de83dff02f9455caf4e80c85e265f3488 | https://github.com/flextype-components/arr/blob/56ba878de83dff02f9455caf4e80c85e265f3488/Arr.php#L28-L55 |
235,679 | flextype-components/arr | Arr.php | Arr.set | public static function set(array &$array, string $path, $value)
{
// Get segments from path
$segments = explode('.', $path);
// Loop through segments
while (count($segments) > 1) {
$segment = array_shift($segments);
if (!isset($array[$segment]) || !is_array($... | php | public static function set(array &$array, string $path, $value)
{
// Get segments from path
$segments = explode('.', $path);
// Loop through segments
while (count($segments) > 1) {
$segment = array_shift($segments);
if (!isset($array[$segment]) || !is_array($... | [
"public",
"static",
"function",
"set",
"(",
"array",
"&",
"$",
"array",
",",
"string",
"$",
"path",
",",
"$",
"value",
")",
"{",
"// Get segments from path",
"$",
"segments",
"=",
"explode",
"(",
"'.'",
",",
"$",
"path",
")",
";",
"// Loop through segments... | Sets an array value using "dot notation".
Arr::set($array, 'foo.bar', 'value');
@access public
@param array $array Array you want to modify
@param string $path Array path
@param mixed $value Value to set | [
"Sets",
"an",
"array",
"value",
"using",
"dot",
"notation",
"."
] | 56ba878de83dff02f9455caf4e80c85e265f3488 | https://github.com/flextype-components/arr/blob/56ba878de83dff02f9455caf4e80c85e265f3488/Arr.php#L67-L81 |
235,680 | flextype-components/arr | Arr.php | Arr.keyExists | public static function keyExists(array $array, $path) : bool
{
foreach (explode('.', $path) as $segment) {
if (! is_array($array) or ! array_key_exists($segment, $array)) {
return false;
}
$array = $array[$segment];
}
return true;
} | php | public static function keyExists(array $array, $path) : bool
{
foreach (explode('.', $path) as $segment) {
if (! is_array($array) or ! array_key_exists($segment, $array)) {
return false;
}
$array = $array[$segment];
}
return true;
} | [
"public",
"static",
"function",
"keyExists",
"(",
"array",
"$",
"array",
",",
"$",
"path",
")",
":",
"bool",
"{",
"foreach",
"(",
"explode",
"(",
"'.'",
",",
"$",
"path",
")",
"as",
"$",
"segment",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
... | Checks if the given dot-notated key exists in the array.
if (Arr::keyExists($array, 'foo.bar')) {
// Do something...
}
@param array $array The search array
@param mixed $path Array path
@return bool | [
"Checks",
"if",
"the",
"given",
"dot",
"-",
"notated",
"key",
"exists",
"in",
"the",
"array",
"."
] | 56ba878de83dff02f9455caf4e80c85e265f3488 | https://github.com/flextype-components/arr/blob/56ba878de83dff02f9455caf4e80c85e265f3488/Arr.php#L163-L174 |
235,681 | flextype-components/arr | Arr.php | Arr.createFromJson | public static function createFromJson(string $json, bool $assoc = true, int $depth = 512 , int $options = 0) : array
{
return json_decode($json, $assoc, $depth, $options);
} | php | public static function createFromJson(string $json, bool $assoc = true, int $depth = 512 , int $options = 0) : array
{
return json_decode($json, $assoc, $depth, $options);
} | [
"public",
"static",
"function",
"createFromJson",
"(",
"string",
"$",
"json",
",",
"bool",
"$",
"assoc",
"=",
"true",
",",
"int",
"$",
"depth",
"=",
"512",
",",
"int",
"$",
"options",
"=",
"0",
")",
":",
"array",
"{",
"return",
"json_decode",
"(",
"$... | Create an new Array from JSON string.
$str = '{"firstName":"John", "lastName":"Doe"}';
// Array['firstName' => 'John', 'lastName' => 'Doe']
$array = Arr::createFromJson($str);
@param string $json The JSON string
@return array | [
"Create",
"an",
"new",
"Array",
"from",
"JSON",
"string",
"."
] | 56ba878de83dff02f9455caf4e80c85e265f3488 | https://github.com/flextype-components/arr/blob/56ba878de83dff02f9455caf4e80c85e265f3488/Arr.php#L236-L239 |
235,682 | flextype-components/arr | Arr.php | Arr.overwrite | public static function overwrite(array $array1, array $array2) : array
{
foreach (array_intersect_key($array2, $array1) as $key => $value) {
$array1[$key] = $value;
}
if (func_num_args() > 2) {
foreach (array_slice(func_get_args(), 2) as $array2) {
fo... | php | public static function overwrite(array $array1, array $array2) : array
{
foreach (array_intersect_key($array2, $array1) as $key => $value) {
$array1[$key] = $value;
}
if (func_num_args() > 2) {
foreach (array_slice(func_get_args(), 2) as $array2) {
fo... | [
"public",
"static",
"function",
"overwrite",
"(",
"array",
"$",
"array1",
",",
"array",
"$",
"array2",
")",
":",
"array",
"{",
"foreach",
"(",
"array_intersect_key",
"(",
"$",
"array2",
",",
"$",
"array1",
")",
"as",
"$",
"key",
"=>",
"$",
"value",
")"... | Overwrites an array with values from input arrays.
Keys that do not exist in the first array will not be added!
$array1 = array('name' => 'john', 'mood' => 'happy', 'food' => 'bacon');
$array2 = array('name' => 'jack', 'food' => 'tacos', 'drink' => 'beer');
// Overwrite the values of $array1 with $array2
$array = Arr... | [
"Overwrites",
"an",
"array",
"with",
"values",
"from",
"input",
"arrays",
".",
"Keys",
"that",
"do",
"not",
"exist",
"in",
"the",
"first",
"array",
"will",
"not",
"be",
"added!"
] | 56ba878de83dff02f9455caf4e80c85e265f3488 | https://github.com/flextype-components/arr/blob/56ba878de83dff02f9455caf4e80c85e265f3488/Arr.php#L333-L348 |
235,683 | dmeikle/ra | src/Gossamer/Ra/Security/Handlers/AuthenticationHandler.php | AuthenticationHandler.execute | public function execute() {
$this->container->set('securityContext', $this->securityContext);
if (is_null($this->node) || !array_key_exists('authentication', $this->node)) {
return;
}
if (array_key_exists('security', $this->node) && (!$this->node['security'] || $this->node['... | php | public function execute() {
$this->container->set('securityContext', $this->securityContext);
if (is_null($this->node) || !array_key_exists('authentication', $this->node)) {
return;
}
if (array_key_exists('security', $this->node) && (!$this->node['security'] || $this->node['... | [
"public",
"function",
"execute",
"(",
")",
"{",
"$",
"this",
"->",
"container",
"->",
"set",
"(",
"'securityContext'",
",",
"$",
"this",
"->",
"securityContext",
")",
";",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"node",
")",
"||",
"!",
"array_key... | main method called. calls the provider and gets the provider to
authenticate the user
@return type | [
"main",
"method",
"called",
".",
"calls",
"the",
"provider",
"and",
"gets",
"the",
"provider",
"to",
"authenticate",
"the",
"user"
] | dc4ea01d6111f1b7e71963ea5907ddd8322af119 | https://github.com/dmeikle/ra/blob/dc4ea01d6111f1b7e71963ea5907ddd8322af119/src/Gossamer/Ra/Security/Handlers/AuthenticationHandler.php#L111-L141 |
235,684 | PentagonalProject/SlimService | src/ModularCollection.php | ModularCollection.scan | public function scan() : ModularCollection
{
if ($this->hasScanned) {
return $this;
}
/**
* @var SplFileInfo $path
*/
foreach (new RecursiveDirectoryIterator($this->getModularDirectory()) as $path) {
$baseName = $path->getBaseName();
... | php | public function scan() : ModularCollection
{
if ($this->hasScanned) {
return $this;
}
/**
* @var SplFileInfo $path
*/
foreach (new RecursiveDirectoryIterator($this->getModularDirectory()) as $path) {
$baseName = $path->getBaseName();
... | [
"public",
"function",
"scan",
"(",
")",
":",
"ModularCollection",
"{",
"if",
"(",
"$",
"this",
"->",
"hasScanned",
")",
"{",
"return",
"$",
"this",
";",
"}",
"/**\n * @var SplFileInfo $path\n */",
"foreach",
"(",
"new",
"RecursiveDirectoryIterator",
... | Scan ModularAbstract Directory
@return ModularCollection | [
"Scan",
"ModularAbstract",
"Directory"
] | 65df2ad530e28b6d72aad5394a0872760aad44cb | https://github.com/PentagonalProject/SlimService/blob/65df2ad530e28b6d72aad5394a0872760aad44cb/src/ModularCollection.php#L139-L200 |
235,685 | PentagonalProject/SlimService | src/ModularCollection.php | ModularCollection.& | protected function &internalGetModular(string $name) : ModularAbstract
{
$modularName = $this->sanitizeModularName($name);
if (!$modularName) {
throw new InvalidArgumentException(
"Please insert not an empty arguments",
E_USER_ERROR
);
... | php | protected function &internalGetModular(string $name) : ModularAbstract
{
$modularName = $this->sanitizeModularName($name);
if (!$modularName) {
throw new InvalidArgumentException(
"Please insert not an empty arguments",
E_USER_ERROR
);
... | [
"protected",
"function",
"&",
"internalGetModular",
"(",
"string",
"$",
"name",
")",
":",
"ModularAbstract",
"{",
"$",
"modularName",
"=",
"$",
"this",
"->",
"sanitizeModularName",
"(",
"$",
"name",
")",
";",
"if",
"(",
"!",
"$",
"modularName",
")",
"{",
... | Get Modular Given By Name
@access protected
@param string $name
@return ModularAbstract
@throws InvalidModularException
@throws Exception | [
"Get",
"Modular",
"Given",
"By",
"Name"
] | 65df2ad530e28b6d72aad5394a0872760aad44cb | https://github.com/PentagonalProject/SlimService/blob/65df2ad530e28b6d72aad5394a0872760aad44cb/src/ModularCollection.php#L283-L343 |
235,686 | PentagonalProject/SlimService | src/ModularCollection.php | ModularCollection.getAllModularInfo | public function getAllModularInfo()
{
$modularInfo = new Collection();
foreach ($this->getAllValidModular() as $modularName => $modular) {
$modularInfo[$modularName] = $this->getModularInformation($modularName);
}
return $modularInfo;
} | php | public function getAllModularInfo()
{
$modularInfo = new Collection();
foreach ($this->getAllValidModular() as $modularName => $modular) {
$modularInfo[$modularName] = $this->getModularInformation($modularName);
}
return $modularInfo;
} | [
"public",
"function",
"getAllModularInfo",
"(",
")",
"{",
"$",
"modularInfo",
"=",
"new",
"Collection",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"getAllValidModular",
"(",
")",
"as",
"$",
"modularName",
"=>",
"$",
"modular",
")",
"{",
"$",
"modu... | Get All ModularAbstract Info
@return Collection|Collection[] | [
"Get",
"All",
"ModularAbstract",
"Info"
] | 65df2ad530e28b6d72aad5394a0872760aad44cb | https://github.com/PentagonalProject/SlimService/blob/65df2ad530e28b6d72aad5394a0872760aad44cb/src/ModularCollection.php#L361-L369 |
235,687 | PentagonalProject/SlimService | src/ModularCollection.php | ModularCollection.hasLoaded | public function hasLoaded(string $name)
{
$modularName = $this->sanitizeModularName($name);
return $modularName && !empty($this->loadedModular[$modularName]);
} | php | public function hasLoaded(string $name)
{
$modularName = $this->sanitizeModularName($name);
return $modularName && !empty($this->loadedModular[$modularName]);
} | [
"public",
"function",
"hasLoaded",
"(",
"string",
"$",
"name",
")",
"{",
"$",
"modularName",
"=",
"$",
"this",
"->",
"sanitizeModularName",
"(",
"$",
"name",
")",
";",
"return",
"$",
"modularName",
"&&",
"!",
"empty",
"(",
"$",
"this",
"->",
"loadedModul... | Check If Modular Has Loaded
@param string $name
@return bool | [
"Check",
"If",
"Modular",
"Has",
"Loaded"
] | 65df2ad530e28b6d72aad5394a0872760aad44cb | https://github.com/PentagonalProject/SlimService/blob/65df2ad530e28b6d72aad5394a0872760aad44cb/src/ModularCollection.php#L407-L411 |
235,688 | thecmsthread/modules | src/Plugin.php | Plugin.get | public function get(string $name = null): \TheCMSThread\Classes\Plugin
{
if (empty($name) === false && empty($this->plugins[$name]) === false) {
return $this->plugins[$name];
} else {
throw new \InvalidArgumentException("Plugin not found");
}
} | php | public function get(string $name = null): \TheCMSThread\Classes\Plugin
{
if (empty($name) === false && empty($this->plugins[$name]) === false) {
return $this->plugins[$name];
} else {
throw new \InvalidArgumentException("Plugin not found");
}
} | [
"public",
"function",
"get",
"(",
"string",
"$",
"name",
"=",
"null",
")",
":",
"\\",
"TheCMSThread",
"\\",
"Classes",
"\\",
"Plugin",
"{",
"if",
"(",
"empty",
"(",
"$",
"name",
")",
"===",
"false",
"&&",
"empty",
"(",
"$",
"this",
"->",
"plugins",
... | Returns a plugin object
@param string $name The name the plugin is registered under.
@return TheCMSThread\Classes\Plugin
@throws InvalidArgumentException | [
"Returns",
"a",
"plugin",
"object"
] | ccc7a5cc188f5ba3e4575db86cac46104153861b | https://github.com/thecmsthread/modules/blob/ccc7a5cc188f5ba3e4575db86cac46104153861b/src/Plugin.php#L75-L82 |
235,689 | thecmsthread/modules | src/Plugin.php | Plugin.runAll | public function runAll(): string
{
$result = '';
foreach ($this->getAll() as $plugin) {
$result .= (string) $plugin->run();
}
return $result;
} | php | public function runAll(): string
{
$result = '';
foreach ($this->getAll() as $plugin) {
$result .= (string) $plugin->run();
}
return $result;
} | [
"public",
"function",
"runAll",
"(",
")",
":",
"string",
"{",
"$",
"result",
"=",
"''",
";",
"foreach",
"(",
"$",
"this",
"->",
"getAll",
"(",
")",
"as",
"$",
"plugin",
")",
"{",
"$",
"result",
".=",
"(",
"string",
")",
"$",
"plugin",
"->",
"run"... | Runs the list of all active plugin objects
@return string | [
"Runs",
"the",
"list",
"of",
"all",
"active",
"plugin",
"objects"
] | ccc7a5cc188f5ba3e4575db86cac46104153861b | https://github.com/thecmsthread/modules/blob/ccc7a5cc188f5ba3e4575db86cac46104153861b/src/Plugin.php#L89-L96 |
235,690 | thecmsthread/modules | src/Plugin.php | Plugin.run | public function run(string $name = null): string
{
return (string) $this->get($name)->run();
} | php | public function run(string $name = null): string
{
return (string) $this->get($name)->run();
} | [
"public",
"function",
"run",
"(",
"string",
"$",
"name",
"=",
"null",
")",
":",
"string",
"{",
"return",
"(",
"string",
")",
"$",
"this",
"->",
"get",
"(",
"$",
"name",
")",
"->",
"run",
"(",
")",
";",
"}"
] | Runs a plugin object
@param string $name The name the plugin is registered under.
@return string | [
"Runs",
"a",
"plugin",
"object"
] | ccc7a5cc188f5ba3e4575db86cac46104153861b | https://github.com/thecmsthread/modules/blob/ccc7a5cc188f5ba3e4575db86cac46104153861b/src/Plugin.php#L105-L108 |
235,691 | thecmsthread/modules | src/Plugin.php | Plugin.stylesAll | public function stylesAll(): array
{
$styles = [];
foreach ($this->getAll() as $name => $plugin) {
$styles[$name] = $plugin->styles();
}
return $styles;
} | php | public function stylesAll(): array
{
$styles = [];
foreach ($this->getAll() as $name => $plugin) {
$styles[$name] = $plugin->styles();
}
return $styles;
} | [
"public",
"function",
"stylesAll",
"(",
")",
":",
"array",
"{",
"$",
"styles",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"getAll",
"(",
")",
"as",
"$",
"name",
"=>",
"$",
"plugin",
")",
"{",
"$",
"styles",
"[",
"$",
"name",
"]",
"=... | Returns the list of all active plugin stylesheets
@return array | [
"Returns",
"the",
"list",
"of",
"all",
"active",
"plugin",
"stylesheets"
] | ccc7a5cc188f5ba3e4575db86cac46104153861b | https://github.com/thecmsthread/modules/blob/ccc7a5cc188f5ba3e4575db86cac46104153861b/src/Plugin.php#L115-L122 |
235,692 | thecmsthread/modules | src/Plugin.php | Plugin.scriptsAll | public function scriptsAll(): array
{
$scripts = [];
foreach ($this->getAll() as $name => $plugin) {
$scripts[$name] = $plugin->scripts();
}
return $scripts;
} | php | public function scriptsAll(): array
{
$scripts = [];
foreach ($this->getAll() as $name => $plugin) {
$scripts[$name] = $plugin->scripts();
}
return $scripts;
} | [
"public",
"function",
"scriptsAll",
"(",
")",
":",
"array",
"{",
"$",
"scripts",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"getAll",
"(",
")",
"as",
"$",
"name",
"=>",
"$",
"plugin",
")",
"{",
"$",
"scripts",
"[",
"$",
"name",
"]",
... | Returns the list of all active plugin scripts
@return array | [
"Returns",
"the",
"list",
"of",
"all",
"active",
"plugin",
"scripts"
] | ccc7a5cc188f5ba3e4575db86cac46104153861b | https://github.com/thecmsthread/modules/blob/ccc7a5cc188f5ba3e4575db86cac46104153861b/src/Plugin.php#L141-L148 |
235,693 | coolms/common | src/Form/View/Helper/FormStatic.php | FormStatic.renderHelper | protected function renderHelper($name, $value, ElementInterface $element)
{
$helper = $this->getView()->plugin($name);
if ($helper instanceof HtmlContainer && $helper->getTagName()) {
$this->shouldWrap = false;
return $helper($value, $element->getAttributes());
}
... | php | protected function renderHelper($name, $value, ElementInterface $element)
{
$helper = $this->getView()->plugin($name);
if ($helper instanceof HtmlContainer && $helper->getTagName()) {
$this->shouldWrap = false;
return $helper($value, $element->getAttributes());
}
... | [
"protected",
"function",
"renderHelper",
"(",
"$",
"name",
",",
"$",
"value",
",",
"ElementInterface",
"$",
"element",
")",
"{",
"$",
"helper",
"=",
"$",
"this",
"->",
"getView",
"(",
")",
"->",
"plugin",
"(",
"$",
"name",
")",
";",
"if",
"(",
"$",
... | Render value by helper name
@param string $name
@param mixed $value
@param ElementInterface $element
@return string | [
"Render",
"value",
"by",
"helper",
"name"
] | 3572993cdcdb2898cdde396a2f1de9864b193660 | https://github.com/coolms/common/blob/3572993cdcdb2898cdde396a2f1de9864b193660/src/Form/View/Helper/FormStatic.php#L112-L122 |
235,694 | coolms/common | src/Form/View/Helper/FormStatic.php | FormStatic.renderInstance | protected function renderInstance(ElementInterface $element)
{
$value = $this->getElementValue($element);
foreach ($this->classMap as $class => $pluginName) {
if ($value instanceof $class) {
return $this->renderHelper($pluginName, $value, $element);
}
... | php | protected function renderInstance(ElementInterface $element)
{
$value = $this->getElementValue($element);
foreach ($this->classMap as $class => $pluginName) {
if ($value instanceof $class) {
return $this->renderHelper($pluginName, $value, $element);
}
... | [
"protected",
"function",
"renderInstance",
"(",
"ElementInterface",
"$",
"element",
")",
"{",
"$",
"value",
"=",
"$",
"this",
"->",
"getElementValue",
"(",
"$",
"element",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"classMap",
"as",
"$",
"class",
"=>",
... | Render element by instance map
@param ElementInterface $element
@return string|null | [
"Render",
"element",
"by",
"instance",
"map"
] | 3572993cdcdb2898cdde396a2f1de9864b193660 | https://github.com/coolms/common/blob/3572993cdcdb2898cdde396a2f1de9864b193660/src/Form/View/Helper/FormStatic.php#L130-L141 |
235,695 | asbsoft/yii2module-content_2_170309 | models/ContentMenuBuilder.php | ContentMenuBuilder._prepare | protected static function _prepare()
{
if (empty(static::$_module)) {
$module = Module::getModuleByClassname(Module::className());
if (!empty($module)) {
static::$_sysControllerUid = "/sys/main";
static::$_routeActionView = "/{$module->uniqueId}/main/v... | php | protected static function _prepare()
{
if (empty(static::$_module)) {
$module = Module::getModuleByClassname(Module::className());
if (!empty($module)) {
static::$_sysControllerUid = "/sys/main";
static::$_routeActionView = "/{$module->uniqueId}/main/v... | [
"protected",
"static",
"function",
"_prepare",
"(",
")",
"{",
"if",
"(",
"empty",
"(",
"static",
"::",
"$",
"_module",
")",
")",
"{",
"$",
"module",
"=",
"Module",
"::",
"getModuleByClassname",
"(",
"Module",
"::",
"className",
"(",
")",
")",
";",
"if"... | Init usable vars | [
"Init",
"usable",
"vars"
] | 9e7ee40fd48ef9656a9f95379f20bf6a4004187b | https://github.com/asbsoft/yii2module-content_2_170309/blob/9e7ee40fd48ef9656a9f95379f20bf6a4004187b/models/ContentMenuBuilder.php#L28-L39 |
235,696 | asbsoft/yii2module-content_2_170309 | models/ContentMenuBuilder.php | ContentMenuBuilder.checkRoutesLink | protected static function checkRoutesLink($node)
{
$nodeLink = static::$_model->getNodePath($node);
// find route
$result = false;
foreach (Yii::$app->urlManager->rules as $nextRule) {
if (RoutesBuilder::properRule($nextRule, $nodeLink)) {
$result = true... | php | protected static function checkRoutesLink($node)
{
$nodeLink = static::$_model->getNodePath($node);
// find route
$result = false;
foreach (Yii::$app->urlManager->rules as $nextRule) {
if (RoutesBuilder::properRule($nextRule, $nodeLink)) {
$result = true... | [
"protected",
"static",
"function",
"checkRoutesLink",
"(",
"$",
"node",
")",
"{",
"$",
"nodeLink",
"=",
"static",
"::",
"$",
"_model",
"->",
"getNodePath",
"(",
"$",
"node",
")",
";",
"// find route ",
"$",
"result",
"=",
"false",
";",
"foreach",
"(",
"Y... | For node without 'text' check if exists such route for any another module.
If such route exists will return link for menu.
@param Content $node
@return string|false | [
"For",
"node",
"without",
"text",
"check",
"if",
"exists",
"such",
"route",
"for",
"any",
"another",
"module",
".",
"If",
"such",
"route",
"exists",
"will",
"return",
"link",
"for",
"menu",
"."
] | 9e7ee40fd48ef9656a9f95379f20bf6a4004187b | https://github.com/asbsoft/yii2module-content_2_170309/blob/9e7ee40fd48ef9656a9f95379f20bf6a4004187b/models/ContentMenuBuilder.php#L143-L164 |
235,697 | asbsoft/yii2module-content_2_170309 | models/ContentMenuBuilder.php | ContentMenuBuilder.createContentLink | protected static function createContentLink($node)
{
static::_prepare();
$url = false;
// node with external/internal link: get URL from 'route' field
if (empty($node->text) && !empty($node->route)) {
$url = static::routeToLink($node->route);
}
// site t... | php | protected static function createContentLink($node)
{
static::_prepare();
$url = false;
// node with external/internal link: get URL from 'route' field
if (empty($node->text) && !empty($node->route)) {
$url = static::routeToLink($node->route);
}
// site t... | [
"protected",
"static",
"function",
"createContentLink",
"(",
"$",
"node",
")",
"{",
"static",
"::",
"_prepare",
"(",
")",
";",
"$",
"url",
"=",
"false",
";",
"// node with external/internal link: get URL from 'route' field",
"if",
"(",
"empty",
"(",
"$",
"node",
... | Create link for node.
@param Content $node
@return string|false | [
"Create",
"link",
"for",
"node",
"."
] | 9e7ee40fd48ef9656a9f95379f20bf6a4004187b | https://github.com/asbsoft/yii2module-content_2_170309/blob/9e7ee40fd48ef9656a9f95379f20bf6a4004187b/models/ContentMenuBuilder.php#L171-L199 |
235,698 | asbsoft/yii2module-content_2_170309 | models/ContentMenuBuilder.php | ContentMenuBuilder.routeToLink | public static function routeToLink($strRoute, $ctrlLinkPrefix = null)
{
if (empty($ctrlLinkPrefix)) {
static::_prepare();
$ctrlLinkPrefix = Url::toRoute([static::$_sysControllerUid]);
}
$strRoute = trim($strRoute);
$url = $route = false;
if (substr($st... | php | public static function routeToLink($strRoute, $ctrlLinkPrefix = null)
{
if (empty($ctrlLinkPrefix)) {
static::_prepare();
$ctrlLinkPrefix = Url::toRoute([static::$_sysControllerUid]);
}
$strRoute = trim($strRoute);
$url = $route = false;
if (substr($st... | [
"public",
"static",
"function",
"routeToLink",
"(",
"$",
"strRoute",
",",
"$",
"ctrlLinkPrefix",
"=",
"null",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"ctrlLinkPrefix",
")",
")",
"{",
"static",
"::",
"_prepare",
"(",
")",
";",
"$",
"ctrlLinkPrefix",
"=",
... | Convert route to link.
@param string $strRoute string representation of route in PHP5.4+ []-notation
@param string $ctrlLinkPrefix current controller links prefix
@return string|false | [
"Convert",
"route",
"to",
"link",
"."
] | 9e7ee40fd48ef9656a9f95379f20bf6a4004187b | https://github.com/asbsoft/yii2module-content_2_170309/blob/9e7ee40fd48ef9656a9f95379f20bf6a4004187b/models/ContentMenuBuilder.php#L207-L241 |
235,699 | asbsoft/yii2module-content_2_170309 | models/ContentMenuBuilder.php | ContentMenuBuilder.convertRouteStrToArray | protected static function convertRouteStrToArray($strRoute)
{
/*
try {
$route = @eval("return $strRoute;"); // security problem
} catch (Exception $ex) {
return false;
}
*/
$str = trim($strRoute);
if (substr($str, 0, 1) == '[' && substr($str, -1, 1) ==... | php | protected static function convertRouteStrToArray($strRoute)
{
/*
try {
$route = @eval("return $strRoute;"); // security problem
} catch (Exception $ex) {
return false;
}
*/
$str = trim($strRoute);
if (substr($str, 0, 1) == '[' && substr($str, -1, 1) ==... | [
"protected",
"static",
"function",
"convertRouteStrToArray",
"(",
"$",
"strRoute",
")",
"{",
"/*\n try {\n $route = @eval(\"return $strRoute;\"); // security problem\n } catch (Exception $ex) {\n return false;\n }\n*/",
"$",
"str",
"=",
"trim",
... | Convert string array definition to array.
@param string $strRoute string representation of route
@return array|false array representation of route or false on error | [
"Convert",
"string",
"array",
"definition",
"to",
"array",
"."
] | 9e7ee40fd48ef9656a9f95379f20bf6a4004187b | https://github.com/asbsoft/yii2module-content_2_170309/blob/9e7ee40fd48ef9656a9f95379f20bf6a4004187b/models/ContentMenuBuilder.php#L248-L301 |
Subsets and Splits
Yii Code Samples
Gathers all records from test, train, and validation sets that contain the word 'yii', providing a basic filtered view of the dataset relevant to Yii-related content.