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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
36,300 | CeusMedia/Common | src/UI/HTML/Exception/Trace.php | UI_HTML_Exception_Trace.renderFromTrace | public static function renderFromTrace( $trace )
{
if( !is_array( $trace ) )
throw new InvalidArgumentException( "Trace must be an array" );
if( !count( $trace ) )
return '';
$i = 0;
$j = 0;
$list = array();
foreach( $trace as $key => $trace )
{
$step = self::renderTraceStep( $trace, $i++, $j );... | php | public static function renderFromTrace( $trace )
{
if( !is_array( $trace ) )
throw new InvalidArgumentException( "Trace must be an array" );
if( !count( $trace ) )
return '';
$i = 0;
$j = 0;
$list = array();
foreach( $trace as $key => $trace )
{
$step = self::renderTraceStep( $trace, $i++, $j );... | [
"public",
"static",
"function",
"renderFromTrace",
"(",
"$",
"trace",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"trace",
")",
")",
"throw",
"new",
"InvalidArgumentException",
"(",
"\"Trace must be an array\"",
")",
";",
"if",
"(",
"!",
"count",
"(",
... | Renders exception trace HTML code from exception trace array.
@access public
@param array $trace Trace of exception
@return string | [
"Renders",
"exception",
"trace",
"HTML",
"code",
"from",
"exception",
"trace",
"array",
"."
] | 1138adf9341782a6284c05884989f7497532bcf4 | https://github.com/CeusMedia/Common/blob/1138adf9341782a6284c05884989f7497532bcf4/src/UI/HTML/Exception/Trace.php#L60-L78 |
36,301 | CeusMedia/Common | src/UI/HTML/Exception/Trace.php | UI_HTML_Exception_Trace.renderArgumentArray | protected static function renderArgumentArray( $array )
{
$list = array();
foreach( $array as $key => $value )
{
$type = self::renderArgumentType( $value );
$string = self::renderArgument( $value );
$list[] = UI_HTML_Tag::create( 'dt', $type." ".$key );
$list[] = UI_HTML_Tag::create( 'dd', $string );... | php | protected static function renderArgumentArray( $array )
{
$list = array();
foreach( $array as $key => $value )
{
$type = self::renderArgumentType( $value );
$string = self::renderArgument( $value );
$list[] = UI_HTML_Tag::create( 'dt', $type." ".$key );
$list[] = UI_HTML_Tag::create( 'dd', $string );... | [
"protected",
"static",
"function",
"renderArgumentArray",
"(",
"$",
"array",
")",
"{",
"$",
"list",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"array",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"$",
"type",
"=",
"self",
"::",
"renderArgu... | Renders an argument array.
@access protected
@static
@param array $array Array to render
@return string | [
"Renders",
"an",
"argument",
"array",
"."
] | 1138adf9341782a6284c05884989f7497532bcf4 | https://github.com/CeusMedia/Common/blob/1138adf9341782a6284c05884989f7497532bcf4/src/UI/HTML/Exception/Trace.php#L123-L136 |
36,302 | CeusMedia/Common | src/UI/HTML/Exception/Trace.php | UI_HTML_Exception_Trace.renderArgumentType | protected static function renderArgumentType( $argument )
{
$type = gettype( $argument );
$length = '';
if( $type == 'string' )
$length = '('.strlen( $argument ).')';
else if( $type == 'array' || $argument instanceof Countable )
$length = '('.count( $argument ).')';
$type = ucFirst( strtolower( getty... | php | protected static function renderArgumentType( $argument )
{
$type = gettype( $argument );
$length = '';
if( $type == 'string' )
$length = '('.strlen( $argument ).')';
else if( $type == 'array' || $argument instanceof Countable )
$length = '('.count( $argument ).')';
$type = ucFirst( strtolower( getty... | [
"protected",
"static",
"function",
"renderArgumentType",
"(",
"$",
"argument",
")",
"{",
"$",
"type",
"=",
"gettype",
"(",
"$",
"argument",
")",
";",
"$",
"length",
"=",
"''",
";",
"if",
"(",
"$",
"type",
"==",
"'string'",
")",
"$",
"length",
"=",
"'... | Renders formatted argument type.
@access protected
@static
@param string $argument Argument to render type for
@return string | [
"Renders",
"formatted",
"argument",
"type",
"."
] | 1138adf9341782a6284c05884989f7497532bcf4 | https://github.com/CeusMedia/Common/blob/1138adf9341782a6284c05884989f7497532bcf4/src/UI/HTML/Exception/Trace.php#L145-L155 |
36,303 | CeusMedia/Common | src/UI/HTML/Exception/Trace.php | UI_HTML_Exception_Trace.secureString | protected static function secureString( $string, $maxLength = 0, $mask = '…' )
{
if( $maxLength && strlen( $string ) > $maxLength )
$value = Alg_Text_Trimmer::trimCentric( $string, $maxLength, $mask );
// $string = addslashes( $string );
$string = htmlentities( $string, ENT_QUOTES, 'UTF-8' );
$string ... | php | protected static function secureString( $string, $maxLength = 0, $mask = '…' )
{
if( $maxLength && strlen( $string ) > $maxLength )
$value = Alg_Text_Trimmer::trimCentric( $string, $maxLength, $mask );
// $string = addslashes( $string );
$string = htmlentities( $string, ENT_QUOTES, 'UTF-8' );
$string ... | [
"protected",
"static",
"function",
"secureString",
"(",
"$",
"string",
",",
"$",
"maxLength",
"=",
"0",
",",
"$",
"mask",
"=",
"'…'",
")",
"{",
"if",
"(",
"$",
"maxLength",
"&&",
"strlen",
"(",
"$",
"string",
")",
">",
"$",
"maxLength",
")",
"... | Applies filters on content string to avoid injections.
@access public
@static
@param string $string String to secure
@param integer $maxLength Number of characters to show at most
@param string $mask Mask to show for cutted content
@return string | [
"Applies",
"filters",
"on",
"content",
"string",
"to",
"avoid",
"injections",
"."
] | 1138adf9341782a6284c05884989f7497532bcf4 | https://github.com/CeusMedia/Common/blob/1138adf9341782a6284c05884989f7497532bcf4/src/UI/HTML/Exception/Trace.php#L223-L231 |
36,304 | CeusMedia/Common | src/UI/HTML/Image.php | UI_HTML_Image.render | public function render()
{
$attributes = $this->getAttributes();
if( empty( $this->url ) )
throw new InvalidArgumentException( 'Image URL is empty' );
$attributes['title'] = (string) $this->title;
$attributes['alt'] = (string) $this->title;
$attributes['src'] = $this->url;
return UI_HTML_Tag::create... | php | public function render()
{
$attributes = $this->getAttributes();
if( empty( $this->url ) )
throw new InvalidArgumentException( 'Image URL is empty' );
$attributes['title'] = (string) $this->title;
$attributes['alt'] = (string) $this->title;
$attributes['src'] = $this->url;
return UI_HTML_Tag::create... | [
"public",
"function",
"render",
"(",
")",
"{",
"$",
"attributes",
"=",
"$",
"this",
"->",
"getAttributes",
"(",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"url",
")",
")",
"throw",
"new",
"InvalidArgumentException",
"(",
"'Image URL is empty'",
... | Returns rendered HTML Element.
@access public
@return string | [
"Returns",
"rendered",
"HTML",
"Element",
"."
] | 1138adf9341782a6284c05884989f7497532bcf4 | https://github.com/CeusMedia/Common/blob/1138adf9341782a6284c05884989f7497532bcf4/src/UI/HTML/Image.php#L68-L77 |
36,305 | CeusMedia/Common | src/Alg/Search/Strange.php | Alg_Search_Strange.search | public function search( $array, $key, $left = FALSE, $right = FALSE )
{
if( !$right )
{
$left = 0;
$right = sizeof( $array ) - 1;
$this->counter = 0;
}
$this->counter++;
$index1 = round( $left + ( $right - $left ) / 3, 0 );
$index2 = round( $left + ( ( $right-$left ) / 3 ) * 2, 0 );
/... | php | public function search( $array, $key, $left = FALSE, $right = FALSE )
{
if( !$right )
{
$left = 0;
$right = sizeof( $array ) - 1;
$this->counter = 0;
}
$this->counter++;
$index1 = round( $left + ( $right - $left ) / 3, 0 );
$index2 = round( $left + ( ( $right-$left ) / 3 ) * 2, 0 );
/... | [
"public",
"function",
"search",
"(",
"$",
"array",
",",
"$",
"key",
",",
"$",
"left",
"=",
"FALSE",
",",
"$",
"right",
"=",
"FALSE",
")",
"{",
"if",
"(",
"!",
"$",
"right",
")",
"{",
"$",
"left",
"=",
"0",
";",
"$",
"right",
"=",
"sizeof",
"(... | Searches in List and returns position if found.
@access public
@param array $ist List to search in
@param mixed $search Element to search
@param int $left Left bound
@param int $right Right bound
@return int | [
"Searches",
"in",
"List",
"and",
"returns",
"position",
"if",
"found",
"."
] | 1138adf9341782a6284c05884989f7497532bcf4 | https://github.com/CeusMedia/Common/blob/1138adf9341782a6284c05884989f7497532bcf4/src/Alg/Search/Strange.php#L52-L76 |
36,306 | ncou/Chiron | src/Chiron/Handler/Formatter/ViewFormatter.php | ViewFormatter.format | public function format(ServerRequestInterface $request, Throwable $e): string
{
// This class doesn't show debug information, so by default we hide the php exception behind a neutral http 500 error.
if (! $e instanceof HttpException) {
$e = new \Chiron\Http\Exception\Server\InternalServe... | php | public function format(ServerRequestInterface $request, Throwable $e): string
{
// This class doesn't show debug information, so by default we hide the php exception behind a neutral http 500 error.
if (! $e instanceof HttpException) {
$e = new \Chiron\Http\Exception\Server\InternalServe... | [
"public",
"function",
"format",
"(",
"ServerRequestInterface",
"$",
"request",
",",
"Throwable",
"$",
"e",
")",
":",
"string",
"{",
"// This class doesn't show debug information, so by default we hide the php exception behind a neutral http 500 error.",
"if",
"(",
"!",
"$",
"... | Render JSON error.
@param \Throwable $e
@return string | [
"Render",
"JSON",
"error",
"."
] | bfb6f85faba0e54005896b09a7c34e456d1a1bed | https://github.com/ncou/Chiron/blob/bfb6f85faba0e54005896b09a7c34e456d1a1bed/src/Chiron/Handler/Formatter/ViewFormatter.php#L38-L69 |
36,307 | ncou/Chiron | src/Chiron/Handler/Formatter/ViewFormatter.php | ViewFormatter.canFormat | public function canFormat(Throwable $e): bool
{
$statusCode = $e instanceof HttpException ? $e->getStatusCode() : 500;
return $this->renderer->exists("errors/{$statusCode}");
} | php | public function canFormat(Throwable $e): bool
{
$statusCode = $e instanceof HttpException ? $e->getStatusCode() : 500;
return $this->renderer->exists("errors/{$statusCode}");
} | [
"public",
"function",
"canFormat",
"(",
"Throwable",
"$",
"e",
")",
":",
"bool",
"{",
"$",
"statusCode",
"=",
"$",
"e",
"instanceof",
"HttpException",
"?",
"$",
"e",
"->",
"getStatusCode",
"(",
")",
":",
"500",
";",
"return",
"$",
"this",
"->",
"render... | Can we format the exception?
@param \Throwable $e
@return bool | [
"Can",
"we",
"format",
"the",
"exception?"
] | bfb6f85faba0e54005896b09a7c34e456d1a1bed | https://github.com/ncou/Chiron/blob/bfb6f85faba0e54005896b09a7c34e456d1a1bed/src/Chiron/Handler/Formatter/ViewFormatter.php#L98-L103 |
36,308 | Assasz/yggdrasil | src/Yggdrasil/Utils/Service/ServiceDTOGenerator.php | ServiceDTOGenerator.generateClass | private function generateClass(): ServiceDTOGenerator
{
$this->DTOFile = (new PhpFile())
->addComment('This file is auto-generated.');
$namespace = $this->inputData['namespace'] . '\\' . $this->inputData['module'] . 'Module\\' . $this->inputData['type'];
$this->DTOClass = $this... | php | private function generateClass(): ServiceDTOGenerator
{
$this->DTOFile = (new PhpFile())
->addComment('This file is auto-generated.');
$namespace = $this->inputData['namespace'] . '\\' . $this->inputData['module'] . 'Module\\' . $this->inputData['type'];
$this->DTOClass = $this... | [
"private",
"function",
"generateClass",
"(",
")",
":",
"ServiceDTOGenerator",
"{",
"$",
"this",
"->",
"DTOFile",
"=",
"(",
"new",
"PhpFile",
"(",
")",
")",
"->",
"addComment",
"(",
"'This file is auto-generated.'",
")",
";",
"$",
"namespace",
"=",
"$",
"this... | Generates service DTO class
@return ServiceDTOGenerator | [
"Generates",
"service",
"DTO",
"class"
] | bee9bef7713b85799cdd3e9b23dccae33154f3b3 | https://github.com/Assasz/yggdrasil/blob/bee9bef7713b85799cdd3e9b23dccae33154f3b3/src/Yggdrasil/Utils/Service/ServiceDTOGenerator.php#L67-L81 |
36,309 | Assasz/yggdrasil | src/Yggdrasil/Utils/Service/ServiceDTOGenerator.php | ServiceDTOGenerator.generateProperties | private function generateProperties(): ServiceDTOGenerator
{
foreach ($this->inputData['properties'] as $name => $type) {
if ('datetime' === $type) {
$type = '\DateTime';
}
$this->DTOClass
->addProperty($name)
->setVisibili... | php | private function generateProperties(): ServiceDTOGenerator
{
foreach ($this->inputData['properties'] as $name => $type) {
if ('datetime' === $type) {
$type = '\DateTime';
}
$this->DTOClass
->addProperty($name)
->setVisibili... | [
"private",
"function",
"generateProperties",
"(",
")",
":",
"ServiceDTOGenerator",
"{",
"foreach",
"(",
"$",
"this",
"->",
"inputData",
"[",
"'properties'",
"]",
"as",
"$",
"name",
"=>",
"$",
"type",
")",
"{",
"if",
"(",
"'datetime'",
"===",
"$",
"type",
... | Generates service DTO properties
@return ServiceDTOGenerator | [
"Generates",
"service",
"DTO",
"properties"
] | bee9bef7713b85799cdd3e9b23dccae33154f3b3 | https://github.com/Assasz/yggdrasil/blob/bee9bef7713b85799cdd3e9b23dccae33154f3b3/src/Yggdrasil/Utils/Service/ServiceDTOGenerator.php#L88-L103 |
36,310 | Assasz/yggdrasil | src/Yggdrasil/Utils/Service/ServiceDTOGenerator.php | ServiceDTOGenerator.generateMethods | private function generateMethods(): ServiceDTOGenerator
{
foreach ($this->inputData['properties'] as $name => $type) {
$this
->generateGetter($name, $type)
->generateSetter($name, $type);
}
return $this;
} | php | private function generateMethods(): ServiceDTOGenerator
{
foreach ($this->inputData['properties'] as $name => $type) {
$this
->generateGetter($name, $type)
->generateSetter($name, $type);
}
return $this;
} | [
"private",
"function",
"generateMethods",
"(",
")",
":",
"ServiceDTOGenerator",
"{",
"foreach",
"(",
"$",
"this",
"->",
"inputData",
"[",
"'properties'",
"]",
"as",
"$",
"name",
"=>",
"$",
"type",
")",
"{",
"$",
"this",
"->",
"generateGetter",
"(",
"$",
... | Generates service DTO methods
@return ServiceDTOGenerator | [
"Generates",
"service",
"DTO",
"methods"
] | bee9bef7713b85799cdd3e9b23dccae33154f3b3 | https://github.com/Assasz/yggdrasil/blob/bee9bef7713b85799cdd3e9b23dccae33154f3b3/src/Yggdrasil/Utils/Service/ServiceDTOGenerator.php#L110-L119 |
36,311 | Assasz/yggdrasil | src/Yggdrasil/Utils/Service/ServiceDTOGenerator.php | ServiceDTOGenerator.saveFile | private function saveFile(): void
{
$sourceCode = Helpers::tabsToSpaces((string) $this->DTOFile);
$fullPath = implode('/', [
dirname(__DIR__, 7) . '/src',
$this->inputData['namespace'],
$this->inputData['module'] . 'Module',
$this->inputData['type'],
... | php | private function saveFile(): void
{
$sourceCode = Helpers::tabsToSpaces((string) $this->DTOFile);
$fullPath = implode('/', [
dirname(__DIR__, 7) . '/src',
$this->inputData['namespace'],
$this->inputData['module'] . 'Module',
$this->inputData['type'],
... | [
"private",
"function",
"saveFile",
"(",
")",
":",
"void",
"{",
"$",
"sourceCode",
"=",
"Helpers",
"::",
"tabsToSpaces",
"(",
"(",
"string",
")",
"$",
"this",
"->",
"DTOFile",
")",
";",
"$",
"fullPath",
"=",
"implode",
"(",
"'/'",
",",
"[",
"dirname",
... | Saves service DTO file in given path | [
"Saves",
"service",
"DTO",
"file",
"in",
"given",
"path"
] | bee9bef7713b85799cdd3e9b23dccae33154f3b3 | https://github.com/Assasz/yggdrasil/blob/bee9bef7713b85799cdd3e9b23dccae33154f3b3/src/Yggdrasil/Utils/Service/ServiceDTOGenerator.php#L186-L207 |
36,312 | CeusMedia/Common | src/Net/API/DDNSS.php | Net_API_DDNSS.update | static public function update( $key, $hosts ){
if( is_array( $hosts ) )
$hosts = implode( ",", $hosts );
$url = sprintf( self::$urlUpdate, $key, $hosts );
try{
$reader = new Net_Reader( $url );
$reader->setUserAgent( "cURL" );
$response = strip_tags( $reader->read() );
if( !preg_match( "/Updated [... | php | static public function update( $key, $hosts ){
if( is_array( $hosts ) )
$hosts = implode( ",", $hosts );
$url = sprintf( self::$urlUpdate, $key, $hosts );
try{
$reader = new Net_Reader( $url );
$reader->setUserAgent( "cURL" );
$response = strip_tags( $reader->read() );
if( !preg_match( "/Updated [... | [
"static",
"public",
"function",
"update",
"(",
"$",
"key",
",",
"$",
"hosts",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"hosts",
")",
")",
"$",
"hosts",
"=",
"implode",
"(",
"\",\"",
",",
"$",
"hosts",
")",
";",
"$",
"url",
"=",
"sprintf",
"(",
... | Updated host or hosts.
@static
@param string $key Auth key from DDNSS
@param string|array $hosts Host or list of hosts
@return integer Number of updated hosts
@todo parse response header DDNSS-Response
@todo and handle update errors | [
"Updated",
"host",
"or",
"hosts",
"."
] | 1138adf9341782a6284c05884989f7497532bcf4 | https://github.com/CeusMedia/Common/blob/1138adf9341782a6284c05884989f7497532bcf4/src/Net/API/DDNSS.php#L55-L71 |
36,313 | CeusMedia/Common | src/XML/DOM/Formater.php | XML_DOM_Formater.format | public static function format( $xml, $leadingTabs = FALSE )
{
$validator = new XML_DOM_SyntaxValidator();
if( !$validator->validate( $xml ) )
throw new InvalidArgumentException( 'String is no valid XML' );
$document = new DOMDocument();
$document->preserveWhiteSpace = FALSE;
$document->loadXml( $xml );
... | php | public static function format( $xml, $leadingTabs = FALSE )
{
$validator = new XML_DOM_SyntaxValidator();
if( !$validator->validate( $xml ) )
throw new InvalidArgumentException( 'String is no valid XML' );
$document = new DOMDocument();
$document->preserveWhiteSpace = FALSE;
$document->loadXml( $xml );
... | [
"public",
"static",
"function",
"format",
"(",
"$",
"xml",
",",
"$",
"leadingTabs",
"=",
"FALSE",
")",
"{",
"$",
"validator",
"=",
"new",
"XML_DOM_SyntaxValidator",
"(",
")",
";",
"if",
"(",
"!",
"$",
"validator",
"->",
"validate",
"(",
"$",
"xml",
")"... | Formats a XML String with Line Breaks and Indention and returns it.
@access public
@static
@param string $xml XML String to format
@param boolean $leadingTabs Flag: replace leading spaces by tabs
@return string | [
"Formats",
"a",
"XML",
"String",
"with",
"Line",
"Breaks",
"and",
"Indention",
"and",
"returns",
"it",
"."
] | 1138adf9341782a6284c05884989f7497532bcf4 | https://github.com/CeusMedia/Common/blob/1138adf9341782a6284c05884989f7497532bcf4/src/XML/DOM/Formater.php#L52-L72 |
36,314 | CeusMedia/Common | src/XML/DOM/Formater.php | XML_DOM_Formater.recode | public static function recode( $xml, $encodeTo = "UTF-8" )
{
$validator = new XML_DOM_SyntaxValidator();
if( !$validator->validate( $xml ) )
throw new InvalidArgumentException( 'String is no valid XML' );
$encodeTo = strtoupper( $encodeTo );
$document = new DOMDocument();
$document->loadXml( $xml );
... | php | public static function recode( $xml, $encodeTo = "UTF-8" )
{
$validator = new XML_DOM_SyntaxValidator();
if( !$validator->validate( $xml ) )
throw new InvalidArgumentException( 'String is no valid XML' );
$encodeTo = strtoupper( $encodeTo );
$document = new DOMDocument();
$document->loadXml( $xml );
... | [
"public",
"static",
"function",
"recode",
"(",
"$",
"xml",
",",
"$",
"encodeTo",
"=",
"\"UTF-8\"",
")",
"{",
"$",
"validator",
"=",
"new",
"XML_DOM_SyntaxValidator",
"(",
")",
";",
"if",
"(",
"!",
"$",
"validator",
"->",
"validate",
"(",
"$",
"xml",
")... | Recodes a XML String to another Character Set.
@access public
@static
@param string $xml XML String to format
@param string $encodeTo Character Set to encode to
@see http://www.iana.org/assignments/character-sets
@return string | [
"Recodes",
"a",
"XML",
"String",
"to",
"another",
"Character",
"Set",
"."
] | 1138adf9341782a6284c05884989f7497532bcf4 | https://github.com/CeusMedia/Common/blob/1138adf9341782a6284c05884989f7497532bcf4/src/XML/DOM/Formater.php#L83-L103 |
36,315 | CeusMedia/Common | src/UI/HTML/CountryFlagIcon.php | UI_HTML_CountryFlagIcon.build | public static function build( $languageCode, $title = NULL, $class = NULL )
{
if( !$languageCode )
throw new InvalidArgumentException( 'No country language code given' );
$languageCode = self::transformCode( $languageCode );
$url = self::$imageBaseUri.$languageCode.".".self::$imageExtension;
$code = UI_... | php | public static function build( $languageCode, $title = NULL, $class = NULL )
{
if( !$languageCode )
throw new InvalidArgumentException( 'No country language code given' );
$languageCode = self::transformCode( $languageCode );
$url = self::$imageBaseUri.$languageCode.".".self::$imageExtension;
$code = UI_... | [
"public",
"static",
"function",
"build",
"(",
"$",
"languageCode",
",",
"$",
"title",
"=",
"NULL",
",",
"$",
"class",
"=",
"NULL",
")",
"{",
"if",
"(",
"!",
"$",
"languageCode",
")",
"throw",
"new",
"InvalidArgumentException",
"(",
"'No country language code... | Builds HTML Code of Country Flag Icon statically.
@access public
@param string $languageCode Language Code or ISO Code of Country
@param string $title Title and alternative Text of Image (needed for valid XHTML)
@param string $class CSS Class
@return string HTML Code of Country Flag Icon | [
"Builds",
"HTML",
"Code",
"of",
"Country",
"Flag",
"Icon",
"statically",
"."
] | 1138adf9341782a6284c05884989f7497532bcf4 | https://github.com/CeusMedia/Common/blob/1138adf9341782a6284c05884989f7497532bcf4/src/UI/HTML/CountryFlagIcon.php#L62-L70 |
36,316 | CeusMedia/Common | src/UI/HTML/CountryFlagIcon.php | UI_HTML_CountryFlagIcon.transformCode | protected static function transformCode( $languageCode )
{
$isoCode = $languageCode;
if( $languageCode == "en" || $languageCode == "uk" )
$isoCode = "gb";
if( $languageCode == "cs" )
$isoCode = "cz";
return $isoCode;
} | php | protected static function transformCode( $languageCode )
{
$isoCode = $languageCode;
if( $languageCode == "en" || $languageCode == "uk" )
$isoCode = "gb";
if( $languageCode == "cs" )
$isoCode = "cz";
return $isoCode;
} | [
"protected",
"static",
"function",
"transformCode",
"(",
"$",
"languageCode",
")",
"{",
"$",
"isoCode",
"=",
"$",
"languageCode",
";",
"if",
"(",
"$",
"languageCode",
"==",
"\"en\"",
"||",
"$",
"languageCode",
"==",
"\"uk\"",
")",
"$",
"isoCode",
"=",
"\"g... | Transforms special Language Codes to ISO Codes. To be overwritten.
@access protected
@param string $languageCode Language Code
@return string | [
"Transforms",
"special",
"Language",
"Codes",
"to",
"ISO",
"Codes",
".",
"To",
"be",
"overwritten",
"."
] | 1138adf9341782a6284c05884989f7497532bcf4 | https://github.com/CeusMedia/Common/blob/1138adf9341782a6284c05884989f7497532bcf4/src/UI/HTML/CountryFlagIcon.php#L78-L86 |
36,317 | meritoo/common-library | src/Utilities/Xml.php | Xml.mergeNodes | public static function mergeNodes(SimpleXMLElement $element1, SimpleXMLElement $element2)
{
$document1 = new DOMDocument();
$document2 = new DOMDocument();
$document1->loadXML($element1->asXML());
$document2->loadXML($element2->asXML());
$path = new DOMXPath($document2);
... | php | public static function mergeNodes(SimpleXMLElement $element1, SimpleXMLElement $element2)
{
$document1 = new DOMDocument();
$document2 = new DOMDocument();
$document1->loadXML($element1->asXML());
$document2->loadXML($element2->asXML());
$path = new DOMXPath($document2);
... | [
"public",
"static",
"function",
"mergeNodes",
"(",
"SimpleXMLElement",
"$",
"element1",
",",
"SimpleXMLElement",
"$",
"element2",
")",
"{",
"$",
"document1",
"=",
"new",
"DOMDocument",
"(",
")",
";",
"$",
"document2",
"=",
"new",
"DOMDocument",
"(",
")",
";"... | Merges nodes of given elements.
Returns merged instance of SimpleXMLElement.
@param SimpleXMLElement $element1 First element to merge
@param SimpleXMLElement $element2 Second element to merge
@return SimpleXMLElement | [
"Merges",
"nodes",
"of",
"given",
"elements",
".",
"Returns",
"merged",
"instance",
"of",
"SimpleXMLElement",
"."
] | b166b8b805ae97c15688d27323cae8976bd0f6dc | https://github.com/meritoo/common-library/blob/b166b8b805ae97c15688d27323cae8976bd0f6dc/src/Utilities/Xml.php#L31-L53 |
36,318 | CeusMedia/Common | src/Alg/SgmlTagReader.php | Alg_SgmlTagReader.getNodeName | public static function getNodeName( $string, $transform = 0 )
{
$data = self::getTagData( $string );
switch( $transform )
{
case self::TRANSFORM_LOWERCASE: return strtolower( $data['nodename'] );
case self::TRANSFORM_UPPERCASE: return strtoupper( $data['nodename'] );
default: return $data['nodename'... | php | public static function getNodeName( $string, $transform = 0 )
{
$data = self::getTagData( $string );
switch( $transform )
{
case self::TRANSFORM_LOWERCASE: return strtolower( $data['nodename'] );
case self::TRANSFORM_UPPERCASE: return strtoupper( $data['nodename'] );
default: return $data['nodename'... | [
"public",
"static",
"function",
"getNodeName",
"(",
"$",
"string",
",",
"$",
"transform",
"=",
"0",
")",
"{",
"$",
"data",
"=",
"self",
"::",
"getTagData",
"(",
"$",
"string",
")",
";",
"switch",
"(",
"$",
"transform",
")",
"{",
"case",
"self",
"::",... | Returns Node Name from Tag.
@access public
@static
@param string $string String containing exactly 1 SGML based Tag
@return string | [
"Returns",
"Node",
"Name",
"from",
"Tag",
"."
] | 1138adf9341782a6284c05884989f7497532bcf4 | https://github.com/CeusMedia/Common/blob/1138adf9341782a6284c05884989f7497532bcf4/src/Alg/SgmlTagReader.php#L78-L87 |
36,319 | CeusMedia/Common | src/Alg/SgmlTagReader.php | Alg_SgmlTagReader.getTagData | public static function getTagData( $string, $transformKeys = 0 )
{
$string = trim( $string );
$attributes = array();
$content = "";
$nodename = "";
if( preg_match( "@^<([a-z]+)@", $string, $results ) )
$nodename = $results[1];
if( preg_match( "@>([^<]*)<@", $string, $results ) )
$content = $results... | php | public static function getTagData( $string, $transformKeys = 0 )
{
$string = trim( $string );
$attributes = array();
$content = "";
$nodename = "";
if( preg_match( "@^<([a-z]+)@", $string, $results ) )
$nodename = $results[1];
if( preg_match( "@>([^<]*)<@", $string, $results ) )
$content = $results... | [
"public",
"static",
"function",
"getTagData",
"(",
"$",
"string",
",",
"$",
"transformKeys",
"=",
"0",
")",
"{",
"$",
"string",
"=",
"trim",
"(",
"$",
"string",
")",
";",
"$",
"attributes",
"=",
"array",
"(",
")",
";",
"$",
"content",
"=",
"\"\"",
... | Returns all Information from a Tag.
@access public
@static
@param string $string String containing exactly 1 SGML based Tag
@return array | [
"Returns",
"all",
"Information",
"from",
"a",
"Tag",
"."
] | 1138adf9341782a6284c05884989f7497532bcf4 | https://github.com/CeusMedia/Common/blob/1138adf9341782a6284c05884989f7497532bcf4/src/Alg/SgmlTagReader.php#L96-L136 |
36,320 | CeusMedia/Common | src/UI/HTML/EventMonthCalendar.php | UI_HTML_EventMonthCalendar.modifyDay | protected function modifyDay( $day )
{
$classes = array();
if( (int)$this->getOption( 'show_day' ) == $day )
$classes[] = 'shown';
if( in_array( $day, $this->events ) )
{
$url = $this->getOption( 'url' );
$url .= "&".$this->getOption( 'carrier_year' )."=".$this->getOption( 'show_year' );
$... | php | protected function modifyDay( $day )
{
$classes = array();
if( (int)$this->getOption( 'show_day' ) == $day )
$classes[] = 'shown';
if( in_array( $day, $this->events ) )
{
$url = $this->getOption( 'url' );
$url .= "&".$this->getOption( 'carrier_year' )."=".$this->getOption( 'show_year' );
$... | [
"protected",
"function",
"modifyDay",
"(",
"$",
"day",
")",
"{",
"$",
"classes",
"=",
"array",
"(",
")",
";",
"if",
"(",
"(",
"int",
")",
"$",
"this",
"->",
"getOption",
"(",
"'show_day'",
")",
"==",
"$",
"day",
")",
"$",
"classes",
"[",
"]",
"="... | Modification of Cell Content of Days - to be overwritten.
@access protected
@param string $day Number of Day to modify
@return string | [
"Modification",
"of",
"Cell",
"Content",
"of",
"Days",
"-",
"to",
"be",
"overwritten",
"."
] | 1138adf9341782a6284c05884989f7497532bcf4 | https://github.com/CeusMedia/Common/blob/1138adf9341782a6284c05884989f7497532bcf4/src/UI/HTML/EventMonthCalendar.php#L65-L81 |
36,321 | CeusMedia/Common | src/FS/File/Configuration/Converter.php | FS_File_Configuration_Converter.convertIniToJson | public static function convertIniToJson( $sourceFile, $targetFile )
{
$data = self::loadIni( $sourceFile );
return self::saveJson( $targetFile, $data );
} | php | public static function convertIniToJson( $sourceFile, $targetFile )
{
$data = self::loadIni( $sourceFile );
return self::saveJson( $targetFile, $data );
} | [
"public",
"static",
"function",
"convertIniToJson",
"(",
"$",
"sourceFile",
",",
"$",
"targetFile",
")",
"{",
"$",
"data",
"=",
"self",
"::",
"loadIni",
"(",
"$",
"sourceFile",
")",
";",
"return",
"self",
"::",
"saveJson",
"(",
"$",
"targetFile",
",",
"$... | Converts Configuration File from INI to JSON and returns Length of Target File.
@access public
@static
@param string $sourceFile File Name of Source File
@param string $targetFile File Name of Target File
@return int | [
"Converts",
"Configuration",
"File",
"from",
"INI",
"to",
"JSON",
"and",
"returns",
"Length",
"of",
"Target",
"File",
"."
] | 1138adf9341782a6284c05884989f7497532bcf4 | https://github.com/CeusMedia/Common/blob/1138adf9341782a6284c05884989f7497532bcf4/src/FS/File/Configuration/Converter.php#L63-L67 |
36,322 | CeusMedia/Common | src/FS/File/Configuration/Converter.php | FS_File_Configuration_Converter.convertIniToXml | public static function convertIniToXml( $sourceFile, $targetFile )
{
$data = self::loadIni( $sourceFile );
return self::saveXml( $targetFile, $data );
} | php | public static function convertIniToXml( $sourceFile, $targetFile )
{
$data = self::loadIni( $sourceFile );
return self::saveXml( $targetFile, $data );
} | [
"public",
"static",
"function",
"convertIniToXml",
"(",
"$",
"sourceFile",
",",
"$",
"targetFile",
")",
"{",
"$",
"data",
"=",
"self",
"::",
"loadIni",
"(",
"$",
"sourceFile",
")",
";",
"return",
"self",
"::",
"saveXml",
"(",
"$",
"targetFile",
",",
"$",... | Converts Configuration File from INI to XML and returns Length of Target File.
@access public
@static
@param string $sourceFile File Name of Source File
@param string $targetFile File Name of Target File
@return int | [
"Converts",
"Configuration",
"File",
"from",
"INI",
"to",
"XML",
"and",
"returns",
"Length",
"of",
"Target",
"File",
"."
] | 1138adf9341782a6284c05884989f7497532bcf4 | https://github.com/CeusMedia/Common/blob/1138adf9341782a6284c05884989f7497532bcf4/src/FS/File/Configuration/Converter.php#L77-L81 |
36,323 | CeusMedia/Common | src/FS/File/Configuration/Converter.php | FS_File_Configuration_Converter.convertJsonToIni | public static function convertJsonToIni( $sourceFile, $targetFile )
{
$data = self::loadJson( $sourceFile );
return self::saveIni( $targetFile, $data );
} | php | public static function convertJsonToIni( $sourceFile, $targetFile )
{
$data = self::loadJson( $sourceFile );
return self::saveIni( $targetFile, $data );
} | [
"public",
"static",
"function",
"convertJsonToIni",
"(",
"$",
"sourceFile",
",",
"$",
"targetFile",
")",
"{",
"$",
"data",
"=",
"self",
"::",
"loadJson",
"(",
"$",
"sourceFile",
")",
";",
"return",
"self",
"::",
"saveIni",
"(",
"$",
"targetFile",
",",
"$... | Converts Configuration File from JSON to INI and returns Length of Target File.
@access public
@static
@param string $sourceFile File Name of Source File
@param string $targetFile File Name of Target File
@return int | [
"Converts",
"Configuration",
"File",
"from",
"JSON",
"to",
"INI",
"and",
"returns",
"Length",
"of",
"Target",
"File",
"."
] | 1138adf9341782a6284c05884989f7497532bcf4 | https://github.com/CeusMedia/Common/blob/1138adf9341782a6284c05884989f7497532bcf4/src/FS/File/Configuration/Converter.php#L91-L95 |
36,324 | CeusMedia/Common | src/FS/File/Configuration/Converter.php | FS_File_Configuration_Converter.convertJsonToXml | public static function convertJsonToXml( $sourceFile, $targetFile )
{
$data = self::loadJson( $sourceFile );
return self::saveXml( $targetFile, $data );
} | php | public static function convertJsonToXml( $sourceFile, $targetFile )
{
$data = self::loadJson( $sourceFile );
return self::saveXml( $targetFile, $data );
} | [
"public",
"static",
"function",
"convertJsonToXml",
"(",
"$",
"sourceFile",
",",
"$",
"targetFile",
")",
"{",
"$",
"data",
"=",
"self",
"::",
"loadJson",
"(",
"$",
"sourceFile",
")",
";",
"return",
"self",
"::",
"saveXml",
"(",
"$",
"targetFile",
",",
"$... | Converts Configuration File from JSON to XML and returns Length of Target File.
@access public
@static
@param string $sourceFile File Name of Source File
@param string $targetFile File Name of Target File
@return int | [
"Converts",
"Configuration",
"File",
"from",
"JSON",
"to",
"XML",
"and",
"returns",
"Length",
"of",
"Target",
"File",
"."
] | 1138adf9341782a6284c05884989f7497532bcf4 | https://github.com/CeusMedia/Common/blob/1138adf9341782a6284c05884989f7497532bcf4/src/FS/File/Configuration/Converter.php#L105-L109 |
36,325 | CeusMedia/Common | src/FS/File/Configuration/Converter.php | FS_File_Configuration_Converter.convertXmlToIni | public static function convertXmlToIni( $sourceFile, $targetFile )
{
$data = self::loadXml( $sourceFile );
return self::saveIni( $targetFile, $data );
} | php | public static function convertXmlToIni( $sourceFile, $targetFile )
{
$data = self::loadXml( $sourceFile );
return self::saveIni( $targetFile, $data );
} | [
"public",
"static",
"function",
"convertXmlToIni",
"(",
"$",
"sourceFile",
",",
"$",
"targetFile",
")",
"{",
"$",
"data",
"=",
"self",
"::",
"loadXml",
"(",
"$",
"sourceFile",
")",
";",
"return",
"self",
"::",
"saveIni",
"(",
"$",
"targetFile",
",",
"$",... | Converts Configuration File from XML to INI and returns Length of Target File.
@access public
@static
@param string $sourceFile File Name of Source File
@param string $targetFile File Name of Target File
@return int | [
"Converts",
"Configuration",
"File",
"from",
"XML",
"to",
"INI",
"and",
"returns",
"Length",
"of",
"Target",
"File",
"."
] | 1138adf9341782a6284c05884989f7497532bcf4 | https://github.com/CeusMedia/Common/blob/1138adf9341782a6284c05884989f7497532bcf4/src/FS/File/Configuration/Converter.php#L119-L123 |
36,326 | CeusMedia/Common | src/FS/File/Configuration/Converter.php | FS_File_Configuration_Converter.convertXmlToJson | public static function convertXmlToJson( $sourceFile, $targetFile )
{
$data = self::loadXml( $sourceFile );
return self::saveJson( $targetFile, $data );
} | php | public static function convertXmlToJson( $sourceFile, $targetFile )
{
$data = self::loadXml( $sourceFile );
return self::saveJson( $targetFile, $data );
} | [
"public",
"static",
"function",
"convertXmlToJson",
"(",
"$",
"sourceFile",
",",
"$",
"targetFile",
")",
"{",
"$",
"data",
"=",
"self",
"::",
"loadXml",
"(",
"$",
"sourceFile",
")",
";",
"return",
"self",
"::",
"saveJson",
"(",
"$",
"targetFile",
",",
"$... | Converts Configuration File from XML to JSON and returns Length of Target File.
@access public
@static
@param string $sourceFile File Name of Source File
@param string $targetFile File Name of Target File
@return int | [
"Converts",
"Configuration",
"File",
"from",
"XML",
"to",
"JSON",
"and",
"returns",
"Length",
"of",
"Target",
"File",
"."
] | 1138adf9341782a6284c05884989f7497532bcf4 | https://github.com/CeusMedia/Common/blob/1138adf9341782a6284c05884989f7497532bcf4/src/FS/File/Configuration/Converter.php#L133-L137 |
36,327 | CeusMedia/Common | src/FS/File/Configuration/Converter.php | FS_File_Configuration_Converter.loadIni | protected static function loadIni( $fileName )
{
$reader = new FS_File_INI_Reader( $fileName, TRUE );
$ini = $reader->getCommentedProperties();
foreach( $ini as $sectionName => $sectionData )
{
foreach( $sectionData as $pair )
{
$item = array(
'key' => $pair['key'],
'value' => $pair['valu... | php | protected static function loadIni( $fileName )
{
$reader = new FS_File_INI_Reader( $fileName, TRUE );
$ini = $reader->getCommentedProperties();
foreach( $ini as $sectionName => $sectionData )
{
foreach( $sectionData as $pair )
{
$item = array(
'key' => $pair['key'],
'value' => $pair['valu... | [
"protected",
"static",
"function",
"loadIni",
"(",
"$",
"fileName",
")",
"{",
"$",
"reader",
"=",
"new",
"FS_File_INI_Reader",
"(",
"$",
"fileName",
",",
"TRUE",
")",
";",
"$",
"ini",
"=",
"$",
"reader",
"->",
"getCommentedProperties",
"(",
")",
";",
"fo... | Loads Configuration Data from INI File.
@access protected
@static
@param string $fileName File Name of INI File.
@return array | [
"Loads",
"Configuration",
"Data",
"from",
"INI",
"File",
"."
] | 1138adf9341782a6284c05884989f7497532bcf4 | https://github.com/CeusMedia/Common/blob/1138adf9341782a6284c05884989f7497532bcf4/src/FS/File/Configuration/Converter.php#L146-L176 |
36,328 | CeusMedia/Common | src/FS/File/Configuration/Converter.php | FS_File_Configuration_Converter.loadJson | protected static function loadJson( $fileName )
{
$json = FS_File_Reader::load( $fileName );
$json = ADT_JSON_Converter::convertToArray( $json );
foreach( $json as $sectionName => $sectionData )
{
foreach( $sectionData as $pairKey => $pairData )
{
$pairData = array_merge( array( 'key' => $pairKey ), ... | php | protected static function loadJson( $fileName )
{
$json = FS_File_Reader::load( $fileName );
$json = ADT_JSON_Converter::convertToArray( $json );
foreach( $json as $sectionName => $sectionData )
{
foreach( $sectionData as $pairKey => $pairData )
{
$pairData = array_merge( array( 'key' => $pairKey ), ... | [
"protected",
"static",
"function",
"loadJson",
"(",
"$",
"fileName",
")",
"{",
"$",
"json",
"=",
"FS_File_Reader",
"::",
"load",
"(",
"$",
"fileName",
")",
";",
"$",
"json",
"=",
"ADT_JSON_Converter",
"::",
"convertToArray",
"(",
"$",
"json",
")",
";",
"... | Loads Configuration Data from JSON File.
@access protected
@static
@param string $fileName File Name of JSON File.
@return array | [
"Loads",
"Configuration",
"Data",
"from",
"JSON",
"File",
"."
] | 1138adf9341782a6284c05884989f7497532bcf4 | https://github.com/CeusMedia/Common/blob/1138adf9341782a6284c05884989f7497532bcf4/src/FS/File/Configuration/Converter.php#L185-L198 |
36,329 | CeusMedia/Common | src/FS/File/Configuration/Converter.php | FS_File_Configuration_Converter.loadXml | protected static function loadXml( $fileName )
{
$xml = XML_ElementReader::readFile( $fileName );
foreach( $xml as $sectionNode )
{
$sectionName = $sectionNode->getAttribute( 'name' );
foreach( $sectionNode as $valueNode )
{
$item = array(
'key' => $valueNode->getAttribute( 'name' ),
'val... | php | protected static function loadXml( $fileName )
{
$xml = XML_ElementReader::readFile( $fileName );
foreach( $xml as $sectionNode )
{
$sectionName = $sectionNode->getAttribute( 'name' );
foreach( $sectionNode as $valueNode )
{
$item = array(
'key' => $valueNode->getAttribute( 'name' ),
'val... | [
"protected",
"static",
"function",
"loadXml",
"(",
"$",
"fileName",
")",
"{",
"$",
"xml",
"=",
"XML_ElementReader",
"::",
"readFile",
"(",
"$",
"fileName",
")",
";",
"foreach",
"(",
"$",
"xml",
"as",
"$",
"sectionNode",
")",
"{",
"$",
"sectionName",
"=",... | Loads Configuration Data from XML File.
@access protected
@static
@param string $fileName File Name of XML File.
@return array | [
"Loads",
"Configuration",
"Data",
"from",
"XML",
"File",
"."
] | 1138adf9341782a6284c05884989f7497532bcf4 | https://github.com/CeusMedia/Common/blob/1138adf9341782a6284c05884989f7497532bcf4/src/FS/File/Configuration/Converter.php#L207-L228 |
36,330 | CeusMedia/Common | src/FS/File/Configuration/Converter.php | FS_File_Configuration_Converter.saveIni | protected static function saveIni( $fileName, $data )
{
$creator = new FS_File_INI_Creator( TRUE );
foreach( $data as $sectionName => $sectionData )
{
$creator->addSection( $sectionName );
foreach( $sectionData as $pair )
{
switch( $pair['type'] )
{
case 'string':
$pair['value'] = '"'... | php | protected static function saveIni( $fileName, $data )
{
$creator = new FS_File_INI_Creator( TRUE );
foreach( $data as $sectionName => $sectionData )
{
$creator->addSection( $sectionName );
foreach( $sectionData as $pair )
{
switch( $pair['type'] )
{
case 'string':
$pair['value'] = '"'... | [
"protected",
"static",
"function",
"saveIni",
"(",
"$",
"fileName",
",",
"$",
"data",
")",
"{",
"$",
"creator",
"=",
"new",
"FS_File_INI_Creator",
"(",
"TRUE",
")",
";",
"foreach",
"(",
"$",
"data",
"as",
"$",
"sectionName",
"=>",
"$",
"sectionData",
")"... | Saves Configuration Data as INI File and returns Number of written Bytes.
@access protected
@static
@param string $fileName File Name of INI File
@param array $data Configuration Data as Array
@return int | [
"Saves",
"Configuration",
"Data",
"as",
"INI",
"File",
"and",
"returns",
"Number",
"of",
"written",
"Bytes",
"."
] | 1138adf9341782a6284c05884989f7497532bcf4 | https://github.com/CeusMedia/Common/blob/1138adf9341782a6284c05884989f7497532bcf4/src/FS/File/Configuration/Converter.php#L238-L261 |
36,331 | CeusMedia/Common | src/FS/File/Configuration/Converter.php | FS_File_Configuration_Converter.saveJson | protected static function saveJson( $fileName, $data )
{
$json = array();
foreach( $data as $sectionName => $sectionData )
{
foreach( $sectionData as $pair )
{
$key = $pair['key'];
unset( $pair['key'] );
$json[$sectionName][$key] = $pair;
}
}
$json = ADT_JSON_Formater::format( $json, TRU... | php | protected static function saveJson( $fileName, $data )
{
$json = array();
foreach( $data as $sectionName => $sectionData )
{
foreach( $sectionData as $pair )
{
$key = $pair['key'];
unset( $pair['key'] );
$json[$sectionName][$key] = $pair;
}
}
$json = ADT_JSON_Formater::format( $json, TRU... | [
"protected",
"static",
"function",
"saveJson",
"(",
"$",
"fileName",
",",
"$",
"data",
")",
"{",
"$",
"json",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"data",
"as",
"$",
"sectionName",
"=>",
"$",
"sectionData",
")",
"{",
"foreach",
"(",
"$",... | Saves Configuration Data as JSON File and returns Number of written Bytes.
@access protected
@static
@param string $fileName File Name of JSON File
@param array $data Configuration Data as Array
@return int | [
"Saves",
"Configuration",
"Data",
"as",
"JSON",
"File",
"and",
"returns",
"Number",
"of",
"written",
"Bytes",
"."
] | 1138adf9341782a6284c05884989f7497532bcf4 | https://github.com/CeusMedia/Common/blob/1138adf9341782a6284c05884989f7497532bcf4/src/FS/File/Configuration/Converter.php#L271-L285 |
36,332 | CeusMedia/Common | src/FS/File/Configuration/Converter.php | FS_File_Configuration_Converter.saveXml | protected static function saveXml( $fileName, $data )
{
$root = new XML_DOM_Node( "configuration" );
foreach( $data as $sectionName => $sectionData )
{
$sectionNode = new XML_DOM_Node( "section" );
$sectionNode->setAttribute( 'name', $sectionName );
foreach( $sectionData as $pair )
{
$comment ... | php | protected static function saveXml( $fileName, $data )
{
$root = new XML_DOM_Node( "configuration" );
foreach( $data as $sectionName => $sectionData )
{
$sectionNode = new XML_DOM_Node( "section" );
$sectionNode->setAttribute( 'name', $sectionName );
foreach( $sectionData as $pair )
{
$comment ... | [
"protected",
"static",
"function",
"saveXml",
"(",
"$",
"fileName",
",",
"$",
"data",
")",
"{",
"$",
"root",
"=",
"new",
"XML_DOM_Node",
"(",
"\"configuration\"",
")",
";",
"foreach",
"(",
"$",
"data",
"as",
"$",
"sectionName",
"=>",
"$",
"sectionData",
... | Saves Configuration Data as XML File and returns Number of written Bytes.
@access protected
@static
@param string $fileName File Name of XML File
@param array $data Configuration Data as Array
@return int | [
"Saves",
"Configuration",
"Data",
"as",
"XML",
"File",
"and",
"returns",
"Number",
"of",
"written",
"Bytes",
"."
] | 1138adf9341782a6284c05884989f7497532bcf4 | https://github.com/CeusMedia/Common/blob/1138adf9341782a6284c05884989f7497532bcf4/src/FS/File/Configuration/Converter.php#L295-L315 |
36,333 | CeusMedia/Common | src/FS/File/JSON/Reader.php | FS_File_JSON_Reader.load | public static function load( $filePath, $asArray = NULL )
{
$reader = new FS_File_JSON_Reader( $filePath );
return $reader->read( $asArray );
} | php | public static function load( $filePath, $asArray = NULL )
{
$reader = new FS_File_JSON_Reader( $filePath );
return $reader->read( $asArray );
} | [
"public",
"static",
"function",
"load",
"(",
"$",
"filePath",
",",
"$",
"asArray",
"=",
"NULL",
")",
"{",
"$",
"reader",
"=",
"new",
"FS_File_JSON_Reader",
"(",
"$",
"filePath",
")",
";",
"return",
"$",
"reader",
"->",
"read",
"(",
"$",
"asArray",
")",... | Reads a JSON file to an object or array statically.
@access public
@param string $filePath Path to JSON file
@param bool $asArray Flag: read into an array
@return object|array | [
"Reads",
"a",
"JSON",
"file",
"to",
"an",
"object",
"or",
"array",
"statically",
"."
] | 1138adf9341782a6284c05884989f7497532bcf4 | https://github.com/CeusMedia/Common/blob/1138adf9341782a6284c05884989f7497532bcf4/src/FS/File/JSON/Reader.php#L75-L79 |
36,334 | CeusMedia/Common | src/FS/File/JSON/Reader.php | FS_File_JSON_Reader.read | public function read( $asArray = NULL )
{
$json = FS_File_Reader::load( $this->filePath );
$data = json_decode( $json, $asArray );
if( json_last_error() !== JSON_ERROR_NONE ){
$message = 'Decoding JSON failed (%s): %s';
$message = vsprintf( $message, array(
ADT_Constant::getKeyByValue( 'JSON_ERROR_', j... | php | public function read( $asArray = NULL )
{
$json = FS_File_Reader::load( $this->filePath );
$data = json_decode( $json, $asArray );
if( json_last_error() !== JSON_ERROR_NONE ){
$message = 'Decoding JSON failed (%s): %s';
$message = vsprintf( $message, array(
ADT_Constant::getKeyByValue( 'JSON_ERROR_', j... | [
"public",
"function",
"read",
"(",
"$",
"asArray",
"=",
"NULL",
")",
"{",
"$",
"json",
"=",
"FS_File_Reader",
"::",
"load",
"(",
"$",
"this",
"->",
"filePath",
")",
";",
"$",
"data",
"=",
"json_decode",
"(",
"$",
"json",
",",
"$",
"asArray",
")",
"... | Reads the JSON file to an object or array.
@access public
@param bool $asArray Flag: read into an array
@return object|array
@throws RuntimeException if parsing failed | [
"Reads",
"the",
"JSON",
"file",
"to",
"an",
"object",
"or",
"array",
"."
] | 1138adf9341782a6284c05884989f7497532bcf4 | https://github.com/CeusMedia/Common/blob/1138adf9341782a6284c05884989f7497532bcf4/src/FS/File/JSON/Reader.php#L96-L109 |
36,335 | ncou/Chiron | src/Chiron/Http/Middleware/SecurityHeadersMiddleware.php | SecurityHeadersMiddleware.compileHeaders | private function compileHeaders(): array
{
return array_merge(
$this->security['settings']['enable-hsts'] ? $this->hsts() : [],
$this->security['settings']['enable-hpkp'] ? $this->hpkp() : [],
$this->security['settings']['enable-ect'] ? $this->ect() : [],
$thi... | php | private function compileHeaders(): array
{
return array_merge(
$this->security['settings']['enable-hsts'] ? $this->hsts() : [],
$this->security['settings']['enable-hpkp'] ? $this->hpkp() : [],
$this->security['settings']['enable-ect'] ? $this->ect() : [],
$thi... | [
"private",
"function",
"compileHeaders",
"(",
")",
":",
"array",
"{",
"return",
"array_merge",
"(",
"$",
"this",
"->",
"security",
"[",
"'settings'",
"]",
"[",
"'enable-hsts'",
"]",
"?",
"$",
"this",
"->",
"hsts",
"(",
")",
":",
"[",
"]",
",",
"$",
"... | Compile the security HTTP headers.
@return array | [
"Compile",
"the",
"security",
"HTTP",
"headers",
"."
] | bfb6f85faba0e54005896b09a7c34e456d1a1bed | https://github.com/ncou/Chiron/blob/bfb6f85faba0e54005896b09a7c34e456d1a1bed/src/Chiron/Http/Middleware/SecurityHeadersMiddleware.php#L91-L99 |
36,336 | ncou/Chiron | src/Chiron/Http/Middleware/SecurityHeadersMiddleware.php | SecurityHeadersMiddleware.hpkp | private function hpkp(): array
{
// TODO : lever une exception si les champs hashes et max-age sont vide, car ils doivent tous les deux avoir une valeur chacun (cad un hash au minimum + un maxage)
$values = [];
foreach ($this->security['hpkp']['hashes'] as $hash) {
$values[] = sp... | php | private function hpkp(): array
{
// TODO : lever une exception si les champs hashes et max-age sont vide, car ils doivent tous les deux avoir une valeur chacun (cad un hash au minimum + un maxage)
$values = [];
foreach ($this->security['hpkp']['hashes'] as $hash) {
$values[] = sp... | [
"private",
"function",
"hpkp",
"(",
")",
":",
"array",
"{",
"// TODO : lever une exception si les champs hashes et max-age sont vide, car ils doivent tous les deux avoir une valeur chacun (cad un hash au minimum + un maxage)",
"$",
"values",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",... | Get HPKP header.
@see https://tools.ietf.org/html/rfc7469
@return array | [
"Get",
"HPKP",
"header",
"."
] | bfb6f85faba0e54005896b09a7c34e456d1a1bed | https://github.com/ncou/Chiron/blob/bfb6f85faba0e54005896b09a7c34e456d1a1bed/src/Chiron/Http/Middleware/SecurityHeadersMiddleware.php#L129-L148 |
36,337 | ncou/Chiron | src/Chiron/Http/Middleware/SecurityHeadersMiddleware.php | SecurityHeadersMiddleware.ect | private function ect(): array
{
$ect = "max-age={$this->security['ect']['max-age']}";
if ($this->security['ect']['enforce']) {
$ect .= ', enforce';
}
if (! empty($this->security['ect']['report-uri'])) {
$ect .= sprintf(', report-uri="%s"', $this->security['ec... | php | private function ect(): array
{
$ect = "max-age={$this->security['ect']['max-age']}";
if ($this->security['ect']['enforce']) {
$ect .= ', enforce';
}
if (! empty($this->security['ect']['report-uri'])) {
$ect .= sprintf(', report-uri="%s"', $this->security['ec... | [
"private",
"function",
"ect",
"(",
")",
":",
"array",
"{",
"$",
"ect",
"=",
"\"max-age={$this->security['ect']['max-age']}\"",
";",
"if",
"(",
"$",
"this",
"->",
"security",
"[",
"'ect'",
"]",
"[",
"'enforce'",
"]",
")",
"{",
"$",
"ect",
".=",
"', enforce'... | Get Expect-CT header.
@see https://tools.ietf.org/html/draft-ietf-httpbis-expect-ct-03
@return array | [
"Get",
"Expect",
"-",
"CT",
"header",
"."
] | bfb6f85faba0e54005896b09a7c34e456d1a1bed | https://github.com/ncou/Chiron/blob/bfb6f85faba0e54005896b09a7c34e456d1a1bed/src/Chiron/Http/Middleware/SecurityHeadersMiddleware.php#L157-L169 |
36,338 | CeusMedia/Common | src/UI/HTML/Tree/LayerMenu.php | UI_HTML_Tree_LayerMenu.buildMenuFromOpml | public function buildMenuFromOpml( $opml )
{
$list = Alg_Tree_Menu_Converter::convertFromOpml( $opml, $this->rootLabel );
return $this->buildMenuFromMenuList( $list );
} | php | public function buildMenuFromOpml( $opml )
{
$list = Alg_Tree_Menu_Converter::convertFromOpml( $opml, $this->rootLabel );
return $this->buildMenuFromMenuList( $list );
} | [
"public",
"function",
"buildMenuFromOpml",
"(",
"$",
"opml",
")",
"{",
"$",
"list",
"=",
"Alg_Tree_Menu_Converter",
"::",
"convertFromOpml",
"(",
"$",
"opml",
",",
"$",
"this",
"->",
"rootLabel",
")",
";",
"return",
"$",
"this",
"->",
"buildMenuFromMenuList",
... | Builds Layer Menu from OPML String.
@access public
@param string $opml OPML String
@return | [
"Builds",
"Layer",
"Menu",
"from",
"OPML",
"String",
"."
] | 1138adf9341782a6284c05884989f7497532bcf4 | https://github.com/CeusMedia/Common/blob/1138adf9341782a6284c05884989f7497532bcf4/src/UI/HTML/Tree/LayerMenu.php#L155-L159 |
36,339 | Assasz/yggdrasil | src/Yggdrasil/Core/Controller/AbstractController.php | AbstractController.render | protected function render(string $view, array $params = []): Response
{
$this->getTemplateEngine()->addGlobal('_request', $this->getRequest());
$template = $this->getTemplateEngine()->render($view, $params);
return $this->getResponse()->setContent($template);
} | php | protected function render(string $view, array $params = []): Response
{
$this->getTemplateEngine()->addGlobal('_request', $this->getRequest());
$template = $this->getTemplateEngine()->render($view, $params);
return $this->getResponse()->setContent($template);
} | [
"protected",
"function",
"render",
"(",
"string",
"$",
"view",
",",
"array",
"$",
"params",
"=",
"[",
"]",
")",
":",
"Response",
"{",
"$",
"this",
"->",
"getTemplateEngine",
"(",
")",
"->",
"addGlobal",
"(",
"'_request'",
",",
"$",
"this",
"->",
"getRe... | Renders given view as response
@param string $view Name of view file
@param array $params Parameters supposed to be passed to the view
@return Response | [
"Renders",
"given",
"view",
"as",
"response"
] | bee9bef7713b85799cdd3e9b23dccae33154f3b3 | https://github.com/Assasz/yggdrasil/blob/bee9bef7713b85799cdd3e9b23dccae33154f3b3/src/Yggdrasil/Core/Controller/AbstractController.php#L63-L69 |
36,340 | Assasz/yggdrasil | src/Yggdrasil/Core/Controller/AbstractController.php | AbstractController.redirectToAction | protected function redirectToAction(string $alias = null, array $params = []): RedirectResponse
{
if (empty($alias)) {
$routerConfig = $this->getRouter()->getConfiguration();
$alias = "{$routerConfig->getDefaultController()}:{$routerConfig->getDefaultAction()}";
}
$q... | php | protected function redirectToAction(string $alias = null, array $params = []): RedirectResponse
{
if (empty($alias)) {
$routerConfig = $this->getRouter()->getConfiguration();
$alias = "{$routerConfig->getDefaultController()}:{$routerConfig->getDefaultAction()}";
}
$q... | [
"protected",
"function",
"redirectToAction",
"(",
"string",
"$",
"alias",
"=",
"null",
",",
"array",
"$",
"params",
"=",
"[",
"]",
")",
":",
"RedirectResponse",
"{",
"if",
"(",
"empty",
"(",
"$",
"alias",
")",
")",
"{",
"$",
"routerConfig",
"=",
"$",
... | Redirects to given action
@param string? $alias Alias of action like Controller:action, if left empty default action will be chosen
@param array $params Parameters supposed to be passed to the action
@return RedirectResponse | [
"Redirects",
"to",
"given",
"action"
] | bee9bef7713b85799cdd3e9b23dccae33154f3b3 | https://github.com/Assasz/yggdrasil/blob/bee9bef7713b85799cdd3e9b23dccae33154f3b3/src/Yggdrasil/Core/Controller/AbstractController.php#L92-L103 |
36,341 | CeusMedia/Common | src/FS/File/CSS/Reader.php | FS_File_CSS_Reader.setFileName | public function setFileName( $fileName ){
$this->fileName = $fileName;
$this->sheet = self::load( $fileName );
} | php | public function setFileName( $fileName ){
$this->fileName = $fileName;
$this->sheet = self::load( $fileName );
} | [
"public",
"function",
"setFileName",
"(",
"$",
"fileName",
")",
"{",
"$",
"this",
"->",
"fileName",
"=",
"$",
"fileName",
";",
"$",
"this",
"->",
"sheet",
"=",
"self",
"::",
"load",
"(",
"$",
"fileName",
")",
";",
"}"
] | Points reader to a CSS file which will be parsed and stored internally.
@access public
@param string $fileName Relative or absolute file URI
@return void | [
"Points",
"reader",
"to",
"a",
"CSS",
"file",
"which",
"will",
"be",
"parsed",
"and",
"stored",
"internally",
"."
] | 1138adf9341782a6284c05884989f7497532bcf4 | https://github.com/CeusMedia/Common/blob/1138adf9341782a6284c05884989f7497532bcf4/src/FS/File/CSS/Reader.php#L99-L102 |
36,342 | CeusMedia/Common | src/ADT/Tree/BinaryNode.php | ADT_Tree_BinaryNode.add | public function add( $value )
{
if( !isset( $this->value ) )
return $this->value = $value;
if( $value == $this->value)
return -1;
if( $value < $this->value )
{
if( $this->left )
$this->left->add( $value );
else
$this->left = new ADT_Tree_BinaryNode( $value );
}
else if( $va... | php | public function add( $value )
{
if( !isset( $this->value ) )
return $this->value = $value;
if( $value == $this->value)
return -1;
if( $value < $this->value )
{
if( $this->left )
$this->left->add( $value );
else
$this->left = new ADT_Tree_BinaryNode( $value );
}
else if( $va... | [
"public",
"function",
"add",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"value",
")",
")",
"return",
"$",
"this",
"->",
"value",
"=",
"$",
"value",
";",
"if",
"(",
"$",
"value",
"==",
"$",
"this",
"->",
"value... | Adds a Node to the Tree.
@access public
@param mixed $value Value to be added to the Tree
@return void | [
"Adds",
"a",
"Node",
"to",
"the",
"Tree",
"."
] | 1138adf9341782a6284c05884989f7497532bcf4 | https://github.com/CeusMedia/Common/blob/1138adf9341782a6284c05884989f7497532bcf4/src/ADT/Tree/BinaryNode.php#L65-L85 |
36,343 | CeusMedia/Common | src/ADT/Tree/BinaryNode.php | ADT_Tree_BinaryNode.countNodes | public function countNodes()
{
$nodes = 1;
if( $this->left || $this->right )
{
if( $this->left )
$nodes += $this->left->countNodes();
if( $this->right )
$nodes += $this->right->countNodes();
}
return $nodes;
} | php | public function countNodes()
{
$nodes = 1;
if( $this->left || $this->right )
{
if( $this->left )
$nodes += $this->left->countNodes();
if( $this->right )
$nodes += $this->right->countNodes();
}
return $nodes;
} | [
"public",
"function",
"countNodes",
"(",
")",
"{",
"$",
"nodes",
"=",
"1",
";",
"if",
"(",
"$",
"this",
"->",
"left",
"||",
"$",
"this",
"->",
"right",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"left",
")",
"$",
"nodes",
"+=",
"$",
"this",
"->",
... | Returns the amount of Nodes in the Tree.
@access public
@return int | [
"Returns",
"the",
"amount",
"of",
"Nodes",
"in",
"the",
"Tree",
"."
] | 1138adf9341782a6284c05884989f7497532bcf4 | https://github.com/CeusMedia/Common/blob/1138adf9341782a6284c05884989f7497532bcf4/src/ADT/Tree/BinaryNode.php#L92-L103 |
36,344 | CeusMedia/Common | src/ADT/Tree/BinaryNode.php | ADT_Tree_BinaryNode.getHeight | public function getHeight()
{
$left_height = $this->left ? $this->left->getHeight() : 0; // Rekursiver Aufruf des linken Teilbaumes
$right_height = $this->right ? $this->right->getHeight() : 0; // Rekursiver Aufruf des rechten Teilbaumes
$height = max( $left_height, $right_height ); // Vergleich... | php | public function getHeight()
{
$left_height = $this->left ? $this->left->getHeight() : 0; // Rekursiver Aufruf des linken Teilbaumes
$right_height = $this->right ? $this->right->getHeight() : 0; // Rekursiver Aufruf des rechten Teilbaumes
$height = max( $left_height, $right_height ); // Vergleich... | [
"public",
"function",
"getHeight",
"(",
")",
"{",
"$",
"left_height",
"=",
"$",
"this",
"->",
"left",
"?",
"$",
"this",
"->",
"left",
"->",
"getHeight",
"(",
")",
":",
"0",
";",
"// Rekursiver Aufruf des linken Teilbaumes\r",
"$",
"right_height",
"=",
"$",
... | Returns the height of the Tree.
@access public
@return int | [
"Returns",
"the",
"height",
"of",
"the",
"Tree",
"."
] | 1138adf9341782a6284c05884989f7497532bcf4 | https://github.com/CeusMedia/Common/blob/1138adf9341782a6284c05884989f7497532bcf4/src/ADT/Tree/BinaryNode.php#L110-L117 |
36,345 | CeusMedia/Common | src/ADT/Tree/BinaryNode.php | ADT_Tree_BinaryNode.search | public function search( $value )
{
if( $value == $this->value )
return $this;
else if( $value < $this->value )
{
if( $this->left )
return $this->left->search( $value );
}
else if( $value > $this->value )
{
if( $this->right )
return $this->right->search( $value );
}
return... | php | public function search( $value )
{
if( $value == $this->value )
return $this;
else if( $value < $this->value )
{
if( $this->left )
return $this->left->search( $value );
}
else if( $value > $this->value )
{
if( $this->right )
return $this->right->search( $value );
}
return... | [
"public",
"function",
"search",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"value",
"==",
"$",
"this",
"->",
"value",
")",
"return",
"$",
"this",
";",
"else",
"if",
"(",
"$",
"value",
"<",
"$",
"this",
"->",
"value",
")",
"{",
"if",
"(",
"$",... | Indicates wheter a Value can be found in the Tree.
@access public
@param mixed $value Value to be found in the Tree
@return void | [
"Indicates",
"wheter",
"a",
"Value",
"can",
"be",
"found",
"in",
"the",
"Tree",
"."
] | 1138adf9341782a6284c05884989f7497532bcf4 | https://github.com/CeusMedia/Common/blob/1138adf9341782a6284c05884989f7497532bcf4/src/ADT/Tree/BinaryNode.php#L159-L174 |
36,346 | CeusMedia/Common | src/ADT/Tree/BinaryNode.php | ADT_Tree_BinaryNode.toList | public function toList( $dir = NULL )
{
$array = array();
if( !$dir || $dir == "lwr" )
{
if( $this->left )
$array = array_merge( $array, $this->left->toList( $dir ) );
$array = array_merge( $array, array( $this->value ) );
if( $this->right )
$array = array_merge( $array, $this->right->t... | php | public function toList( $dir = NULL )
{
$array = array();
if( !$dir || $dir == "lwr" )
{
if( $this->left )
$array = array_merge( $array, $this->left->toList( $dir ) );
$array = array_merge( $array, array( $this->value ) );
if( $this->right )
$array = array_merge( $array, $this->right->t... | [
"public",
"function",
"toList",
"(",
"$",
"dir",
"=",
"NULL",
")",
"{",
"$",
"array",
"=",
"array",
"(",
")",
";",
"if",
"(",
"!",
"$",
"dir",
"||",
"$",
"dir",
"==",
"\"lwr\"",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"left",
")",
"$",
"array... | Runs through the Tree in any Directions and returns the Tree as List.
@access public
@param string $dir Direction to run through the Tree (lwr|rwl|wlr|wrl)
@return array | [
"Runs",
"through",
"the",
"Tree",
"in",
"any",
"Directions",
"and",
"returns",
"the",
"Tree",
"as",
"List",
"."
] | 1138adf9341782a6284c05884989f7497532bcf4 | https://github.com/CeusMedia/Common/blob/1138adf9341782a6284c05884989f7497532bcf4/src/ADT/Tree/BinaryNode.php#L182-L218 |
36,347 | CeusMedia/Common | src/ADT/Tree/BinaryNode.php | ADT_Tree_BinaryNode.toTable | public function toTable()
{
$code = "<table cellspacing=1 cellpadding=0>\n<tr><td colspan=2 align=center><hr>".$this->value."</td></tr>";
if( $this->left || $this->right )
{
$code .= "<tr><td align=center valign=top>";
if( $this->left )
$code .= $this->left->toTable();
else
$code .= "&n... | php | public function toTable()
{
$code = "<table cellspacing=1 cellpadding=0>\n<tr><td colspan=2 align=center><hr>".$this->value."</td></tr>";
if( $this->left || $this->right )
{
$code .= "<tr><td align=center valign=top>";
if( $this->left )
$code .= $this->left->toTable();
else
$code .= "&n... | [
"public",
"function",
"toTable",
"(",
")",
"{",
"$",
"code",
"=",
"\"<table cellspacing=1 cellpadding=0>\\n<tr><td colspan=2 align=center><hr>\"",
".",
"$",
"this",
"->",
"value",
".",
"\"</td></tr>\"",
";",
"if",
"(",
"$",
"this",
"->",
"left",
"||",
"$",
"this",... | Returns the Tree as HTML-Table.
@access public
@return string | [
"Returns",
"the",
"Tree",
"as",
"HTML",
"-",
"Table",
"."
] | 1138adf9341782a6284c05884989f7497532bcf4 | https://github.com/CeusMedia/Common/blob/1138adf9341782a6284c05884989f7497532bcf4/src/ADT/Tree/BinaryNode.php#L225-L244 |
36,348 | CeusMedia/Common | src/XML/RSS/SimpleParser.php | XML_RSS_SimpleParser.parse | public static function parse( $xml )
{
$channelData = array();
$itemList = array();
$xml = new SimpleXMLElement( $xml );
foreach( $xml->channel->children() as $nodeName => $nodeValue )
{
if( $nodeName == "image" && $nodeValue->children() )
{
$channelData[$nodeName] = self::readSubSet( $nodeValue )... | php | public static function parse( $xml )
{
$channelData = array();
$itemList = array();
$xml = new SimpleXMLElement( $xml );
foreach( $xml->channel->children() as $nodeName => $nodeValue )
{
if( $nodeName == "image" && $nodeValue->children() )
{
$channelData[$nodeName] = self::readSubSet( $nodeValue )... | [
"public",
"static",
"function",
"parse",
"(",
"$",
"xml",
")",
"{",
"$",
"channelData",
"=",
"array",
"(",
")",
";",
"$",
"itemList",
"=",
"array",
"(",
")",
";",
"$",
"xml",
"=",
"new",
"SimpleXMLElement",
"(",
"$",
"xml",
")",
";",
"foreach",
"("... | Reads RSS from XML statically and returns Array containing Channel Data and Items.
@access public
@static
@param string $xml XML String to read
@return array | [
"Reads",
"RSS",
"from",
"XML",
"statically",
"and",
"returns",
"Array",
"containing",
"Channel",
"Data",
"and",
"Items",
"."
] | 1138adf9341782a6284c05884989f7497532bcf4 | https://github.com/CeusMedia/Common/blob/1138adf9341782a6284c05884989f7497532bcf4/src/XML/RSS/SimpleParser.php#L49-L84 |
36,349 | CeusMedia/Common | src/XML/RSS/SimpleParser.php | XML_RSS_SimpleParser.readSubSet | protected static function readSubSet( $node )
{
$item = array();
foreach( $node->children() as $nodeName => $nodeValue )
$item[$nodeName] = (string) $nodeValue;
return $item;
} | php | protected static function readSubSet( $node )
{
$item = array();
foreach( $node->children() as $nodeName => $nodeValue )
$item[$nodeName] = (string) $nodeValue;
return $item;
} | [
"protected",
"static",
"function",
"readSubSet",
"(",
"$",
"node",
")",
"{",
"$",
"item",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"node",
"->",
"children",
"(",
")",
"as",
"$",
"nodeName",
"=>",
"$",
"nodeValue",
")",
"$",
"item",
"[",
"$... | Reads Subset of Node.
@access protected
@static
@param SimpleXMLElement $node Subset Node
@return array | [
"Reads",
"Subset",
"of",
"Node",
"."
] | 1138adf9341782a6284c05884989f7497532bcf4 | https://github.com/CeusMedia/Common/blob/1138adf9341782a6284c05884989f7497532bcf4/src/XML/RSS/SimpleParser.php#L93-L99 |
36,350 | CeusMedia/Common | src/UI/HTML/Options.php | UI_HTML_Options.buildCode | public function buildCode()
{
$select = UI_HTML_Elements::Select( $this->name, $this->options, $this->class );
return $select;
} | php | public function buildCode()
{
$select = UI_HTML_Elements::Select( $this->name, $this->options, $this->class );
return $select;
} | [
"public",
"function",
"buildCode",
"(",
")",
"{",
"$",
"select",
"=",
"UI_HTML_Elements",
"::",
"Select",
"(",
"$",
"this",
"->",
"name",
",",
"$",
"this",
"->",
"options",
",",
"$",
"this",
"->",
"class",
")",
";",
"return",
"$",
"select",
";",
"}"
... | Builds HTML Code of Select Box.
@access public
@return string | [
"Builds",
"HTML",
"Code",
"of",
"Select",
"Box",
"."
] | 1138adf9341782a6284c05884989f7497532bcf4 | https://github.com/CeusMedia/Common/blob/1138adf9341782a6284c05884989f7497532bcf4/src/UI/HTML/Options.php#L69-L73 |
36,351 | CeusMedia/Common | src/UI/HTML/Options.php | UI_HTML_Options.buildScript | public function buildScript()
{
$options = array(
'url' => $this->url,
'async' => $this->async,
'cache' => $this->cache,
'data' => $this->data,
'selected' => $this->selected
);
return UI_HTML_JQuery::buildPluginCall( 'ajaxOptions', "select[name='".$this->name."']", $options );
} | php | public function buildScript()
{
$options = array(
'url' => $this->url,
'async' => $this->async,
'cache' => $this->cache,
'data' => $this->data,
'selected' => $this->selected
);
return UI_HTML_JQuery::buildPluginCall( 'ajaxOptions', "select[name='".$this->name."']", $options );
} | [
"public",
"function",
"buildScript",
"(",
")",
"{",
"$",
"options",
"=",
"array",
"(",
"'url'",
"=>",
"$",
"this",
"->",
"url",
",",
"'async'",
"=>",
"$",
"this",
"->",
"async",
",",
"'cache'",
"=>",
"$",
"this",
"->",
"cache",
",",
"'data'",
"=>",
... | Builds JavaScript Code for AJAX Options.
@access public
@return string | [
"Builds",
"JavaScript",
"Code",
"for",
"AJAX",
"Options",
"."
] | 1138adf9341782a6284c05884989f7497532bcf4 | https://github.com/CeusMedia/Common/blob/1138adf9341782a6284c05884989f7497532bcf4/src/UI/HTML/Options.php#L80-L90 |
36,352 | CeusMedia/Common | src/Alg/UnitFormater.php | Alg_UnitFormater.formatNumber | public static function formatNumber( $float, $unit = 1, $precision = 0 )
{
Deprecation::getInstance()->setExceptionVersion( '0.8' )
->message( 'Use one of the other methods instead' );
if( (int) $unit )
{
$float = $float / $unit;
if( is_int( $precision ) )
$float = round( $float, $precision );
}
... | php | public static function formatNumber( $float, $unit = 1, $precision = 0 )
{
Deprecation::getInstance()->setExceptionVersion( '0.8' )
->message( 'Use one of the other methods instead' );
if( (int) $unit )
{
$float = $float / $unit;
if( is_int( $precision ) )
$float = round( $float, $precision );
}
... | [
"public",
"static",
"function",
"formatNumber",
"(",
"$",
"float",
",",
"$",
"unit",
"=",
"1",
",",
"$",
"precision",
"=",
"0",
")",
"{",
"Deprecation",
"::",
"getInstance",
"(",
")",
"->",
"setExceptionVersion",
"(",
"'0.8'",
")",
"->",
"message",
"(",
... | Formats Number.
@access public
@static
@param float $float Number to format
@param int $unit Number of Digits for dot to move to left
@param int $precision Number of Digits after dot
@return void
@deprecated uncomplete method, please remove | [
"Formats",
"Number",
"."
] | 1138adf9341782a6284c05884989f7497532bcf4 | https://github.com/CeusMedia/Common/blob/1138adf9341782a6284c05884989f7497532bcf4/src/Alg/UnitFormater.php#L239-L250 |
36,353 | CeusMedia/Common | src/Alg/Sort/Bubble.php | Alg_Sort_Bubble.sort | public static function sort($list)
{
for( $i=sizeof( $list ) - 1; $i>=1; $i-- )
for( $j=0; $j<$i; $j++ )
if( $list[$j] > $list[$j+1] )
self::swap( $list, $j, $j + 1 );
return $list;
} | php | public static function sort($list)
{
for( $i=sizeof( $list ) - 1; $i>=1; $i-- )
for( $j=0; $j<$i; $j++ )
if( $list[$j] > $list[$j+1] )
self::swap( $list, $j, $j + 1 );
return $list;
} | [
"public",
"static",
"function",
"sort",
"(",
"$",
"list",
")",
"{",
"for",
"(",
"$",
"i",
"=",
"sizeof",
"(",
"$",
"list",
")",
"-",
"1",
";",
"$",
"i",
">=",
"1",
";",
"$",
"i",
"--",
")",
"for",
"(",
"$",
"j",
"=",
"0",
";",
"$",
"j",
... | Sorts List with Bubble Sort.
@access public
@static
@param array $list List to sort
@return array | [
"Sorts",
"List",
"with",
"Bubble",
"Sort",
"."
] | 1138adf9341782a6284c05884989f7497532bcf4 | https://github.com/CeusMedia/Common/blob/1138adf9341782a6284c05884989f7497532bcf4/src/Alg/Sort/Bubble.php#L48-L55 |
36,354 | CeusMedia/Common | src/FS/File/JSON/Config.php | FS_File_JSON_Config.save | public function save(){
$json = $this->data->toJson();
if( $this->format )
$json = ADT_JSON_Formater::format( $json );
return FS_File_Writer::save( $this->fileName, $json );
} | php | public function save(){
$json = $this->data->toJson();
if( $this->format )
$json = ADT_JSON_Formater::format( $json );
return FS_File_Writer::save( $this->fileName, $json );
} | [
"public",
"function",
"save",
"(",
")",
"{",
"$",
"json",
"=",
"$",
"this",
"->",
"data",
"->",
"toJson",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"format",
")",
"$",
"json",
"=",
"ADT_JSON_Formater",
"::",
"format",
"(",
"$",
"json",
")",
";... | Save node structure to JSON file.
@access public
@return integer Number of saved bytes | [
"Save",
"node",
"structure",
"to",
"JSON",
"file",
"."
] | 1138adf9341782a6284c05884989f7497532bcf4 | https://github.com/CeusMedia/Common/blob/1138adf9341782a6284c05884989f7497532bcf4/src/FS/File/JSON/Config.php#L90-L95 |
36,355 | CeusMedia/Common | src/Alg/Parcel/Packer.php | Alg_Parcel_Packer.calculatePackage | public function calculatePackage( $articleList )
{
$this->packetList = array(); // reset Packet List
foreach( $articleList as $name => $quantity ) // iterate Article List
if( !$quantity ) // and remove all Articles
unset( $articleList[$name] ); ... | php | public function calculatePackage( $articleList )
{
$this->packetList = array(); // reset Packet List
foreach( $articleList as $name => $quantity ) // iterate Article List
if( !$quantity ) // and remove all Articles
unset( $articleList[$name] ); ... | [
"public",
"function",
"calculatePackage",
"(",
"$",
"articleList",
")",
"{",
"$",
"this",
"->",
"packetList",
"=",
"array",
"(",
")",
";",
"// reset Packet List",
"foreach",
"(",
"$",
"articleList",
"as",
"$",
"name",
"=>",
"$",
"quantity",
")",
"// iterat... | Calculates Packages for Articles and returns Packet List.
@access public
@param array $articleList Array of Articles and their Quantities.
@return array | [
"Calculates",
"Packages",
"for",
"Articles",
"and",
"returns",
"Packet",
"List",
"."
] | 1138adf9341782a6284c05884989f7497532bcf4 | https://github.com/CeusMedia/Common/blob/1138adf9341782a6284c05884989f7497532bcf4/src/Alg/Parcel/Packer.php#L75-L142 |
36,356 | CeusMedia/Common | src/Alg/Parcel/Packer.php | Alg_Parcel_Packer.getLargestArticle | protected function getLargestArticle( $articleList )
{
$largestPacketName = $this->getNameOfLargestPacket();
$articleVolumes = $this->volumes[$largestPacketName];
asort( $articleVolumes );
$articleKeys = array_keys( $articleVolumes );
do
{
$articleName = array_pop( $articleKeys );
if( array_key_exis... | php | protected function getLargestArticle( $articleList )
{
$largestPacketName = $this->getNameOfLargestPacket();
$articleVolumes = $this->volumes[$largestPacketName];
asort( $articleVolumes );
$articleKeys = array_keys( $articleVolumes );
do
{
$articleName = array_pop( $articleKeys );
if( array_key_exis... | [
"protected",
"function",
"getLargestArticle",
"(",
"$",
"articleList",
")",
"{",
"$",
"largestPacketName",
"=",
"$",
"this",
"->",
"getNameOfLargestPacket",
"(",
")",
";",
"$",
"articleVolumes",
"=",
"$",
"this",
"->",
"volumes",
"[",
"$",
"largestPacketName",
... | Returns the largest Article from an Article List by Article Volume.
@access protected
@param array $articleList Array of Articles and their Quantities.
@return string | [
"Returns",
"the",
"largest",
"Article",
"from",
"an",
"Article",
"List",
"by",
"Article",
"Volume",
"."
] | 1138adf9341782a6284c05884989f7497532bcf4 | https://github.com/CeusMedia/Common/blob/1138adf9341782a6284c05884989f7497532bcf4/src/Alg/Parcel/Packer.php#L177-L190 |
36,357 | CeusMedia/Common | src/Alg/Parcel/Packer.php | Alg_Parcel_Packer.getNameOfLargerPacket | protected function getNameOfLargerPacket( $packetName )
{
$keys = array_keys( $this->packets );
$index = array_search( $packetName, $keys );
$next = array_pop( array_slice( $keys, $index + 1, 1 ) );
return $next;
} | php | protected function getNameOfLargerPacket( $packetName )
{
$keys = array_keys( $this->packets );
$index = array_search( $packetName, $keys );
$next = array_pop( array_slice( $keys, $index + 1, 1 ) );
return $next;
} | [
"protected",
"function",
"getNameOfLargerPacket",
"(",
"$",
"packetName",
")",
"{",
"$",
"keys",
"=",
"array_keys",
"(",
"$",
"this",
"->",
"packets",
")",
";",
"$",
"index",
"=",
"array_search",
"(",
"$",
"packetName",
",",
"$",
"keys",
")",
";",
"$",
... | Returns Name of next larger Packet.
@access protected
@param string $packetName Packet Name to get next larger Packet for
@return string | [
"Returns",
"Name",
"of",
"next",
"larger",
"Packet",
"."
] | 1138adf9341782a6284c05884989f7497532bcf4 | https://github.com/CeusMedia/Common/blob/1138adf9341782a6284c05884989f7497532bcf4/src/Alg/Parcel/Packer.php#L198-L204 |
36,358 | CeusMedia/Common | src/Alg/Parcel/Packer.php | Alg_Parcel_Packer.getNameOfLargestPacket | protected function getNameOfLargestPacket()
{
$packets = $this->packets;
asort( $packets );
$packetName = key( array_slice( $packets, -1 ) );
return $packetName;
} | php | protected function getNameOfLargestPacket()
{
$packets = $this->packets;
asort( $packets );
$packetName = key( array_slice( $packets, -1 ) );
return $packetName;
} | [
"protected",
"function",
"getNameOfLargestPacket",
"(",
")",
"{",
"$",
"packets",
"=",
"$",
"this",
"->",
"packets",
";",
"asort",
"(",
"$",
"packets",
")",
";",
"$",
"packetName",
"=",
"key",
"(",
"array_slice",
"(",
"$",
"packets",
",",
"-",
"1",
")"... | Returns Name of largest Packet from Packet Definition.
@access protected
@return string | [
"Returns",
"Name",
"of",
"largest",
"Packet",
"from",
"Packet",
"Definition",
"."
] | 1138adf9341782a6284c05884989f7497532bcf4 | https://github.com/CeusMedia/Common/blob/1138adf9341782a6284c05884989f7497532bcf4/src/Alg/Parcel/Packer.php#L211-L217 |
36,359 | CeusMedia/Common | src/Alg/Parcel/Packer.php | Alg_Parcel_Packer.getNameOfSmallestPacketForArticle | protected function getNameOfSmallestPacketForArticle( $articleName )
{
foreach( array_keys( $this->packets ) as $packetName )
if( $this->volumes[$packetName][$articleName] <= 1 )
return $packetName;
} | php | protected function getNameOfSmallestPacketForArticle( $articleName )
{
foreach( array_keys( $this->packets ) as $packetName )
if( $this->volumes[$packetName][$articleName] <= 1 )
return $packetName;
} | [
"protected",
"function",
"getNameOfSmallestPacketForArticle",
"(",
"$",
"articleName",
")",
"{",
"foreach",
"(",
"array_keys",
"(",
"$",
"this",
"->",
"packets",
")",
"as",
"$",
"packetName",
")",
"if",
"(",
"$",
"this",
"->",
"volumes",
"[",
"$",
"packetNam... | Returns Name of smallest Packet for an Article.
@access protected
@param string $articleName Name of Article to get smallest Article for
@return string | [
"Returns",
"Name",
"of",
"smallest",
"Packet",
"for",
"an",
"Article",
"."
] | 1138adf9341782a6284c05884989f7497532bcf4 | https://github.com/CeusMedia/Common/blob/1138adf9341782a6284c05884989f7497532bcf4/src/Alg/Parcel/Packer.php#L225-L230 |
36,360 | CeusMedia/Common | src/Alg/Parcel/Packer.php | Alg_Parcel_Packer.replacePacket | public function replacePacket( $index, $packet )
{
if( !isset( $this->packetList[$index] ) )
throw new OutOfRangeException( 'Invalid Packet Index.' );
$this->packetList[$index] = $packet;
} | php | public function replacePacket( $index, $packet )
{
if( !isset( $this->packetList[$index] ) )
throw new OutOfRangeException( 'Invalid Packet Index.' );
$this->packetList[$index] = $packet;
} | [
"public",
"function",
"replacePacket",
"(",
"$",
"index",
",",
"$",
"packet",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"packetList",
"[",
"$",
"index",
"]",
")",
")",
"throw",
"new",
"OutOfRangeException",
"(",
"'Invalid Packet Index.'",
... | Replaces a Packet from current Packet List with another Packet.
@access public
@param int $index Index of Packet to replace
@param Alg_Parcel_packet $packet Packet to set for another Packet
@return void | [
"Replaces",
"a",
"Packet",
"from",
"current",
"Packet",
"List",
"with",
"another",
"Packet",
"."
] | 1138adf9341782a6284c05884989f7497532bcf4 | https://github.com/CeusMedia/Common/blob/1138adf9341782a6284c05884989f7497532bcf4/src/Alg/Parcel/Packer.php#L278-L283 |
36,361 | CeusMedia/Common | src/XML/OPML/FileReader.php | XML_OPML_FileReader.load | public static function load( $fileName )
{
$file = new FS_File_Reader( $fileName );
if( !$file->exists() )
throw new Exception( "File '".$fileName."' is not existing." );
$xml = $file->readString();
$parser = new XML_OPML_Parser();
return $parser->parse( $xml );
} | php | public static function load( $fileName )
{
$file = new FS_File_Reader( $fileName );
if( !$file->exists() )
throw new Exception( "File '".$fileName."' is not existing." );
$xml = $file->readString();
$parser = new XML_OPML_Parser();
return $parser->parse( $xml );
} | [
"public",
"static",
"function",
"load",
"(",
"$",
"fileName",
")",
"{",
"$",
"file",
"=",
"new",
"FS_File_Reader",
"(",
"$",
"fileName",
")",
";",
"if",
"(",
"!",
"$",
"file",
"->",
"exists",
"(",
")",
")",
"throw",
"new",
"Exception",
"(",
"\"File '... | Loads a OPML File statically.
@access public
@static
@param string $fileName URI of OPML File
@return bool | [
"Loads",
"a",
"OPML",
"File",
"statically",
"."
] | 1138adf9341782a6284c05884989f7497532bcf4 | https://github.com/CeusMedia/Common/blob/1138adf9341782a6284c05884989f7497532bcf4/src/XML/OPML/FileReader.php#L62-L70 |
36,362 | smasty/Neevo | src/Neevo/Parser.php | Parser.parse | public function parse(){
$where = $order = $group = $limit = $q = '';
$source = $this->parseSource();
if($this->stmt->getConditions())
$where = $this->parseWhere();
if($this->stmt instanceof Result && $this->stmt->getGrouping())
$group = $this->parseGrouping();
if($this->stmt->getSorting())
$order =... | php | public function parse(){
$where = $order = $group = $limit = $q = '';
$source = $this->parseSource();
if($this->stmt->getConditions())
$where = $this->parseWhere();
if($this->stmt instanceof Result && $this->stmt->getGrouping())
$group = $this->parseGrouping();
if($this->stmt->getSorting())
$order =... | [
"public",
"function",
"parse",
"(",
")",
"{",
"$",
"where",
"=",
"$",
"order",
"=",
"$",
"group",
"=",
"$",
"limit",
"=",
"$",
"q",
"=",
"''",
";",
"$",
"source",
"=",
"$",
"this",
"->",
"parseSource",
"(",
")",
";",
"if",
"(",
"$",
"this",
"... | Parses the given statement.
@return string The SQL statement | [
"Parses",
"the",
"given",
"statement",
"."
] | 3a1bf7e8ce24d453bb27dca3a9aca86852789f11 | https://github.com/smasty/Neevo/blob/3a1bf7e8ce24d453bb27dca3a9aca86852789f11/src/Neevo/Parser.php#L45-L68 |
36,363 | smasty/Neevo | src/Neevo/Parser.php | Parser.parseSelectStmt | protected function parseSelectStmt(){
$cols = $this->stmt->getColumns();
list($source, $where, $group, $order) = $this->clauses;
foreach($cols as $key => $col){
$col = preg_match('~^[\w.]+$~', $col) ? ":$col" : $col;
$cols[$key] = $this->tryDelimite($col);
}
$cols = implode(', ', $cols);
return $this... | php | protected function parseSelectStmt(){
$cols = $this->stmt->getColumns();
list($source, $where, $group, $order) = $this->clauses;
foreach($cols as $key => $col){
$col = preg_match('~^[\w.]+$~', $col) ? ":$col" : $col;
$cols[$key] = $this->tryDelimite($col);
}
$cols = implode(', ', $cols);
return $this... | [
"protected",
"function",
"parseSelectStmt",
"(",
")",
"{",
"$",
"cols",
"=",
"$",
"this",
"->",
"stmt",
"->",
"getColumns",
"(",
")",
";",
"list",
"(",
"$",
"source",
",",
"$",
"where",
",",
"$",
"group",
",",
"$",
"order",
")",
"=",
"$",
"this",
... | Parses SELECT statement.
@return string | [
"Parses",
"SELECT",
"statement",
"."
] | 3a1bf7e8ce24d453bb27dca3a9aca86852789f11 | https://github.com/smasty/Neevo/blob/3a1bf7e8ce24d453bb27dca3a9aca86852789f11/src/Neevo/Parser.php#L75-L85 |
36,364 | smasty/Neevo | src/Neevo/Parser.php | Parser.parseInsertStmt | protected function parseInsertStmt(){
$cols = array();
foreach($this->escapeValue($this->stmt->getValues()) as $col => $value){
$cols[] = $this->parseFieldName($col);
$values[] = $value;
}
$data = ' (' . implode(', ', $cols) . ")\nVALUES (" . implode(', ', $values). ')';
return 'INSERT INTO ' . $this->... | php | protected function parseInsertStmt(){
$cols = array();
foreach($this->escapeValue($this->stmt->getValues()) as $col => $value){
$cols[] = $this->parseFieldName($col);
$values[] = $value;
}
$data = ' (' . implode(', ', $cols) . ")\nVALUES (" . implode(', ', $values). ')';
return 'INSERT INTO ' . $this->... | [
"protected",
"function",
"parseInsertStmt",
"(",
")",
"{",
"$",
"cols",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"escapeValue",
"(",
"$",
"this",
"->",
"stmt",
"->",
"getValues",
"(",
")",
")",
"as",
"$",
"col",
"=>",
"$",
"v... | Parses INSERT statement.
@return string | [
"Parses",
"INSERT",
"statement",
"."
] | 3a1bf7e8ce24d453bb27dca3a9aca86852789f11 | https://github.com/smasty/Neevo/blob/3a1bf7e8ce24d453bb27dca3a9aca86852789f11/src/Neevo/Parser.php#L92-L101 |
36,365 | smasty/Neevo | src/Neevo/Parser.php | Parser.parseSource | protected function parseSource(){
if(!$this->stmt instanceof Result)
return $this->escapeValue($this->stmt->getTable(), Manager::IDENTIFIER);
// Simple table
if($this->stmt->getTable() !== null){
$source = $this->escapeValue($this->stmt->getTable(), Manager::IDENTIFIER);
}
// Sub-select
else{
$sub... | php | protected function parseSource(){
if(!$this->stmt instanceof Result)
return $this->escapeValue($this->stmt->getTable(), Manager::IDENTIFIER);
// Simple table
if($this->stmt->getTable() !== null){
$source = $this->escapeValue($this->stmt->getTable(), Manager::IDENTIFIER);
}
// Sub-select
else{
$sub... | [
"protected",
"function",
"parseSource",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"stmt",
"instanceof",
"Result",
")",
"return",
"$",
"this",
"->",
"escapeValue",
"(",
"$",
"this",
"->",
"stmt",
"->",
"getTable",
"(",
")",
",",
"Manager",
"::",... | Parses statement source.
@return string | [
"Parses",
"statement",
"source",
"."
] | 3a1bf7e8ce24d453bb27dca3a9aca86852789f11 | https://github.com/smasty/Neevo/blob/3a1bf7e8ce24d453bb27dca3a9aca86852789f11/src/Neevo/Parser.php#L133-L176 |
36,366 | smasty/Neevo | src/Neevo/Parser.php | Parser.parseWhere | protected function parseWhere(){
$conds = $this->stmt->getConditions();
// Unset glue on last condition
unset($conds[count($conds)-1]['glue']);
$conditions = array();
foreach($conds as $cond){
// Conditions with modifiers
if($cond['simple'] === false){
$values = $this->escapeValue($cond['values']... | php | protected function parseWhere(){
$conds = $this->stmt->getConditions();
// Unset glue on last condition
unset($conds[count($conds)-1]['glue']);
$conditions = array();
foreach($conds as $cond){
// Conditions with modifiers
if($cond['simple'] === false){
$values = $this->escapeValue($cond['values']... | [
"protected",
"function",
"parseWhere",
"(",
")",
"{",
"$",
"conds",
"=",
"$",
"this",
"->",
"stmt",
"->",
"getConditions",
"(",
")",
";",
"// Unset glue on last condition",
"unset",
"(",
"$",
"conds",
"[",
"count",
"(",
"$",
"conds",
")",
"-",
"1",
"]",
... | Parses WHERE clause.
@return string | [
"Parses",
"WHERE",
"clause",
"."
] | 3a1bf7e8ce24d453bb27dca3a9aca86852789f11 | https://github.com/smasty/Neevo/blob/3a1bf7e8ce24d453bb27dca3a9aca86852789f11/src/Neevo/Parser.php#L183-L238 |
36,367 | smasty/Neevo | src/Neevo/Parser.php | Parser.parseSorting | protected function parseSorting(){
$order = array();
foreach($this->stmt->getSorting() as $rule){
list($field, $type) = $rule;
$order[] = $this->tryDelimite($field) . ($type !== null ? ' ' . $type : '');
}
return "\nORDER BY " . implode(', ', $order);
} | php | protected function parseSorting(){
$order = array();
foreach($this->stmt->getSorting() as $rule){
list($field, $type) = $rule;
$order[] = $this->tryDelimite($field) . ($type !== null ? ' ' . $type : '');
}
return "\nORDER BY " . implode(', ', $order);
} | [
"protected",
"function",
"parseSorting",
"(",
")",
"{",
"$",
"order",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"stmt",
"->",
"getSorting",
"(",
")",
"as",
"$",
"rule",
")",
"{",
"list",
"(",
"$",
"field",
",",
"$",
"type",
... | Parses ORDER BY clause.
@return string | [
"Parses",
"ORDER",
"BY",
"clause",
"."
] | 3a1bf7e8ce24d453bb27dca3a9aca86852789f11 | https://github.com/smasty/Neevo/blob/3a1bf7e8ce24d453bb27dca3a9aca86852789f11/src/Neevo/Parser.php#L245-L252 |
36,368 | smasty/Neevo | src/Neevo/Parser.php | Parser.parseGrouping | protected function parseGrouping(){
list($group, $having) = $this->stmt->getGrouping();
return $this->tryDelimite("\nGROUP BY $group" . ($having !== null ? " HAVING $having" : ''));
} | php | protected function parseGrouping(){
list($group, $having) = $this->stmt->getGrouping();
return $this->tryDelimite("\nGROUP BY $group" . ($having !== null ? " HAVING $having" : ''));
} | [
"protected",
"function",
"parseGrouping",
"(",
")",
"{",
"list",
"(",
"$",
"group",
",",
"$",
"having",
")",
"=",
"$",
"this",
"->",
"stmt",
"->",
"getGrouping",
"(",
")",
";",
"return",
"$",
"this",
"->",
"tryDelimite",
"(",
"\"\\nGROUP BY $group\"",
".... | Parses GROUP BY clause.
@return string | [
"Parses",
"GROUP",
"BY",
"clause",
"."
] | 3a1bf7e8ce24d453bb27dca3a9aca86852789f11 | https://github.com/smasty/Neevo/blob/3a1bf7e8ce24d453bb27dca3a9aca86852789f11/src/Neevo/Parser.php#L259-L262 |
36,369 | smasty/Neevo | src/Neevo/Parser.php | Parser.parseFieldName | protected function parseFieldName($field, $table = false){
// preg_replace callback behaviour
if(is_array($field))
$field = $field[0];
if($field instanceof Literal)
return $field->value;
$field = trim($field);
if($field === '*')
return $field;
if(strpos($field, ' '))
return $field;
$field ... | php | protected function parseFieldName($field, $table = false){
// preg_replace callback behaviour
if(is_array($field))
$field = $field[0];
if($field instanceof Literal)
return $field->value;
$field = trim($field);
if($field === '*')
return $field;
if(strpos($field, ' '))
return $field;
$field ... | [
"protected",
"function",
"parseFieldName",
"(",
"$",
"field",
",",
"$",
"table",
"=",
"false",
")",
"{",
"// preg_replace callback behaviour",
"if",
"(",
"is_array",
"(",
"$",
"field",
")",
")",
"$",
"field",
"=",
"$",
"field",
"[",
"0",
"]",
";",
"if",
... | Parses column name.
@param string|array|Literal $field
@param bool $table Parse table name.
@return string | [
"Parses",
"column",
"name",
"."
] | 3a1bf7e8ce24d453bb27dca3a9aca86852789f11 | https://github.com/smasty/Neevo/blob/3a1bf7e8ce24d453bb27dca3a9aca86852789f11/src/Neevo/Parser.php#L271-L294 |
36,370 | smasty/Neevo | src/Neevo/Parser.php | Parser.applyModifiers | protected function applyModifiers($expr, array $modifiers, array $values){
foreach($modifiers as &$mod){
$mod = preg_quote("/$mod/");
}
$expr = $this->tryDelimite($expr);
return preg_replace($modifiers, $values, $expr, 1);
} | php | protected function applyModifiers($expr, array $modifiers, array $values){
foreach($modifiers as &$mod){
$mod = preg_quote("/$mod/");
}
$expr = $this->tryDelimite($expr);
return preg_replace($modifiers, $values, $expr, 1);
} | [
"protected",
"function",
"applyModifiers",
"(",
"$",
"expr",
",",
"array",
"$",
"modifiers",
",",
"array",
"$",
"values",
")",
"{",
"foreach",
"(",
"$",
"modifiers",
"as",
"&",
"$",
"mod",
")",
"{",
"$",
"mod",
"=",
"preg_quote",
"(",
"\"/$mod/\"",
")"... | Applies modifiers to expression.
@param string $expr
@param array $modifiers
@param array $values
@return string | [
"Applies",
"modifiers",
"to",
"expression",
"."
] | 3a1bf7e8ce24d453bb27dca3a9aca86852789f11 | https://github.com/smasty/Neevo/blob/3a1bf7e8ce24d453bb27dca3a9aca86852789f11/src/Neevo/Parser.php#L383-L389 |
36,371 | CeusMedia/Common | src/UI/HTML/Tree/FolderView.php | UI_HTML_Tree_FolderView.getHtml | public function getHtml( $currentId, $attributes = array(), $linkNodes = FALSE, $classNode = "folder", $classLeaf = "file" )
{
$nodes = new ArrayObject();
$this->readRecursive( $this->path, $currentId, $nodes, $linkNodes, $classNode, $classLeaf );
return $this->view->constructTree( $nodes, $currentId, $attribute... | php | public function getHtml( $currentId, $attributes = array(), $linkNodes = FALSE, $classNode = "folder", $classLeaf = "file" )
{
$nodes = new ArrayObject();
$this->readRecursive( $this->path, $currentId, $nodes, $linkNodes, $classNode, $classLeaf );
return $this->view->constructTree( $nodes, $currentId, $attribute... | [
"public",
"function",
"getHtml",
"(",
"$",
"currentId",
",",
"$",
"attributes",
"=",
"array",
"(",
")",
",",
"$",
"linkNodes",
"=",
"FALSE",
",",
"$",
"classNode",
"=",
"\"folder\"",
",",
"$",
"classLeaf",
"=",
"\"file\"",
")",
"{",
"$",
"nodes",
"=",
... | Returns HTML Code of Tree.
@access public
@param string $currentId ID current selected in Tree
@param array $attributes Attributes for List Tag
@param string $linkNodes Link Nodes (no Icons possible)
@param string $classNode CSS Class of Nodes / Folders
@param string $classLeaf CSS Class of Leafes ... | [
"Returns",
"HTML",
"Code",
"of",
"Tree",
"."
] | 1138adf9341782a6284c05884989f7497532bcf4 | https://github.com/CeusMedia/Common/blob/1138adf9341782a6284c05884989f7497532bcf4/src/UI/HTML/Tree/FolderView.php#L72-L77 |
36,372 | CeusMedia/Common | src/UI/HTML/Tree/FolderView.php | UI_HTML_Tree_FolderView.getScript | public function getScript( $selector, $cookieId = NULL, $animated = "fast", $unique = FALSE, $collapsed = FALSE )
{
return $this->view->buildJavaScript( $selector, $cookieId, $animated, $unique, $collapsed );
} | php | public function getScript( $selector, $cookieId = NULL, $animated = "fast", $unique = FALSE, $collapsed = FALSE )
{
return $this->view->buildJavaScript( $selector, $cookieId, $animated, $unique, $collapsed );
} | [
"public",
"function",
"getScript",
"(",
"$",
"selector",
",",
"$",
"cookieId",
"=",
"NULL",
",",
"$",
"animated",
"=",
"\"fast\"",
",",
"$",
"unique",
"=",
"FALSE",
",",
"$",
"collapsed",
"=",
"FALSE",
")",
"{",
"return",
"$",
"this",
"->",
"view",
"... | Returns JavaScript Code to call Plugin.
@access public
@param string $selector JQuery Selector of Tree
@param string $cookieId Store Tree in Cookie
@param string $animated Speed of Animation (fast|slow)
@param bool $unique Flag: open only 1 Node in every Level
@param bool $collapsed Flag: start wi... | [
"Returns",
"JavaScript",
"Code",
"to",
"call",
"Plugin",
"."
] | 1138adf9341782a6284c05884989f7497532bcf4 | https://github.com/CeusMedia/Common/blob/1138adf9341782a6284c05884989f7497532bcf4/src/UI/HTML/Tree/FolderView.php#L89-L92 |
36,373 | CeusMedia/Common | src/UI/HTML/Tree/FolderView.php | UI_HTML_Tree_FolderView.readRecursive | protected function readRecursive( $path, $currentId, &$nodes, $linkNodes, $classNode = "folder", $classLeaf = "file" )
{
$files = array();
$index = new DirectoryIterator( $path );
foreach( $index as $file )
{
if( $file->isDot() )
continue;
if( preg_match( "@^\.\w@", $file->getFilename() ) )
cont... | php | protected function readRecursive( $path, $currentId, &$nodes, $linkNodes, $classNode = "folder", $classLeaf = "file" )
{
$files = array();
$index = new DirectoryIterator( $path );
foreach( $index as $file )
{
if( $file->isDot() )
continue;
if( preg_match( "@^\.\w@", $file->getFilename() ) )
cont... | [
"protected",
"function",
"readRecursive",
"(",
"$",
"path",
",",
"$",
"currentId",
",",
"&",
"$",
"nodes",
",",
"$",
"linkNodes",
",",
"$",
"classNode",
"=",
"\"folder\"",
",",
"$",
"classLeaf",
"=",
"\"file\"",
")",
"{",
"$",
"files",
"=",
"array",
"(... | Reads Folder recursive.
@access protected
@param string $path Path to Folder to index
@param string $currentId ID current selected in Tree
@param ArrayObject $nodes Array Object of Folders and Files
@param string $linkNodes Link Nodes (no Icons possible)
@param string $classNode CSS Class of Nodes... | [
"Reads",
"Folder",
"recursive",
"."
] | 1138adf9341782a6284c05884989f7497532bcf4 | https://github.com/CeusMedia/Common/blob/1138adf9341782a6284c05884989f7497532bcf4/src/UI/HTML/Tree/FolderView.php#L105-L147 |
36,374 | CeusMedia/Common | src/FS/File/CSS/Combiner.php | FS_File_CSS_Combiner.combineFile | public function combineFile( $fileUri )
{
$pathName = dirname( realpath( $fileUri ) )."/";
$fileBase = preg_replace( "@\.css@", "", basename( $fileUri ));
if( !file_exists( $fileUri ) )
throw new Exception( "Style File '".$fileUri."' is not existing." );
$this->statistics = array();
$content = fil... | php | public function combineFile( $fileUri )
{
$pathName = dirname( realpath( $fileUri ) )."/";
$fileBase = preg_replace( "@\.css@", "", basename( $fileUri ));
if( !file_exists( $fileUri ) )
throw new Exception( "Style File '".$fileUri."' is not existing." );
$this->statistics = array();
$content = fil... | [
"public",
"function",
"combineFile",
"(",
"$",
"fileUri",
")",
"{",
"$",
"pathName",
"=",
"dirname",
"(",
"realpath",
"(",
"$",
"fileUri",
")",
")",
".",
"\"/\"",
";",
"$",
"fileBase",
"=",
"preg_replace",
"(",
"\"@\\.css@\"",
",",
"\"\"",
",",
"basename... | Combines all CSS Files imported in Style File, saves Combination File and returns File URI of Combination File.
@access public
@param string $styleFile File Name of Style without Extension (iE. style.css,import.css,default.css)
@param bool $verbose Flag: list loaded CSS Files
@return string | [
"Combines",
"all",
"CSS",
"Files",
"imported",
"in",
"Style",
"File",
"saves",
"Combination",
"File",
"and",
"returns",
"File",
"URI",
"of",
"Combination",
"File",
"."
] | 1138adf9341782a6284c05884989f7497532bcf4 | https://github.com/CeusMedia/Common/blob/1138adf9341782a6284c05884989f7497532bcf4/src/FS/File/CSS/Combiner.php#L58-L76 |
36,375 | CeusMedia/Common | src/FS/File/CSS/Combiner.php | FS_File_CSS_Combiner.combineString | public function combineString( $path, $content, $throwException = FALSE )
{
$listLines = array();
$listImport = array();
$this->statistics['sizeOriginal'] = 0;
$this->statistics['sizeCombined'] = 0;
$this->statistics['sizeCompressed'] = 0;
$this->statistics['numberFiles'] = 0;
$this->statistics['filesFou... | php | public function combineString( $path, $content, $throwException = FALSE )
{
$listLines = array();
$listImport = array();
$this->statistics['sizeOriginal'] = 0;
$this->statistics['sizeCombined'] = 0;
$this->statistics['sizeCompressed'] = 0;
$this->statistics['numberFiles'] = 0;
$this->statistics['filesFou... | [
"public",
"function",
"combineString",
"(",
"$",
"path",
",",
"$",
"content",
",",
"$",
"throwException",
"=",
"FALSE",
")",
"{",
"$",
"listLines",
"=",
"array",
"(",
")",
";",
"$",
"listImport",
"=",
"array",
"(",
")",
";",
"$",
"this",
"->",
"stati... | Combines all CSS Files imported in CSS String and returns Combination String;
@access public
@param string $path Style Path
@param string $styleFile File Name of Style without Extension (iE. style.css,import.css,default.css)
@return string | [
"Combines",
"all",
"CSS",
"Files",
"imported",
"in",
"CSS",
"String",
"and",
"returns",
"Combination",
"String",
";"
] | 1138adf9341782a6284c05884989f7497532bcf4 | https://github.com/CeusMedia/Common/blob/1138adf9341782a6284c05884989f7497532bcf4/src/FS/File/CSS/Combiner.php#L85-L132 |
36,376 | CeusMedia/Common | src/UI/HTML/Tree/FolderCheckView.php | UI_HTML_Tree_FolderCheckView.buildRecursive | protected function buildRecursive( $path, $level = 0, $pathRoot = NULL )
{
if( !$pathRoot )
$pathRoot = $path;
$list = array(); // empty Array for current Level Items
$lister = new FS_Folder_Lister( $path ); // create Lister for Folder Contents
$lister->showFolders( $this->s... | php | protected function buildRecursive( $path, $level = 0, $pathRoot = NULL )
{
if( !$pathRoot )
$pathRoot = $path;
$list = array(); // empty Array for current Level Items
$lister = new FS_Folder_Lister( $path ); // create Lister for Folder Contents
$lister->showFolders( $this->s... | [
"protected",
"function",
"buildRecursive",
"(",
"$",
"path",
",",
"$",
"level",
"=",
"0",
",",
"$",
"pathRoot",
"=",
"NULL",
")",
"{",
"if",
"(",
"!",
"$",
"pathRoot",
")",
"$",
"pathRoot",
"=",
"$",
"path",
";",
"$",
"list",
"=",
"array",
"(",
"... | Builds recursively nested HTML Lists and Items from Folder Structure.
@access public
@param string $path URI (local only) of Folder to list
@param int $level Current nesting depth
@return string | [
"Builds",
"recursively",
"nested",
"HTML",
"Lists",
"and",
"Items",
"from",
"Folder",
"Structure",
"."
] | 1138adf9341782a6284c05884989f7497532bcf4 | https://github.com/CeusMedia/Common/blob/1138adf9341782a6284c05884989f7497532bcf4/src/UI/HTML/Tree/FolderCheckView.php#L88-L120 |
36,377 | CeusMedia/Common | src/FS/File/Arc/TarBzip.php | FS_File_Arc_TarBzip.open | public function open( $fileName )
{
if( !file_exists( $fileName ) ) // If the tar file doesn't exist...
throw new RuntimeException( 'TBZ file "'.$fileName.'" is not existing.' );
$this->fileName = $fileName;
$this->readBzipTar( $fileName );
} | php | public function open( $fileName )
{
if( !file_exists( $fileName ) ) // If the tar file doesn't exist...
throw new RuntimeException( 'TBZ file "'.$fileName.'" is not existing.' );
$this->fileName = $fileName;
$this->readBzipTar( $fileName );
} | [
"public",
"function",
"open",
"(",
"$",
"fileName",
")",
"{",
"if",
"(",
"!",
"file_exists",
"(",
"$",
"fileName",
")",
")",
"// If the tar file doesn't exist...\r",
"throw",
"new",
"RuntimeException",
"(",
"'TBZ file \"'",
".",
"$",
"fileName",
".",
"'\" is not... | Opens an existing Tar Bzip File and loads contents.
@access public
@param string $fileName Name of Tar Bzip Archive to open
@return bool | [
"Opens",
"an",
"existing",
"Tar",
"Bzip",
"File",
"and",
"loads",
"contents",
"."
] | 1138adf9341782a6284c05884989f7497532bcf4 | https://github.com/CeusMedia/Common/blob/1138adf9341782a6284c05884989f7497532bcf4/src/FS/File/Arc/TarBzip.php#L60-L66 |
36,378 | CeusMedia/Common | src/FS/File/Arc/TarBzip.php | FS_File_Arc_TarBzip.readBzipTar | private function readBzipTar( $fileName )
{
$f = new FS_File_Arc_Bzip( $fileName );
$this->content = $f->readString();
$this->parseTar(); // Parse the TAR file
return true;
} | php | private function readBzipTar( $fileName )
{
$f = new FS_File_Arc_Bzip( $fileName );
$this->content = $f->readString();
$this->parseTar(); // Parse the TAR file
return true;
} | [
"private",
"function",
"readBzipTar",
"(",
"$",
"fileName",
")",
"{",
"$",
"f",
"=",
"new",
"FS_File_Arc_Bzip",
"(",
"$",
"fileName",
")",
";",
"$",
"this",
"->",
"content",
"=",
"$",
"f",
"->",
"readString",
"(",
")",
";",
"$",
"this",
"->",
"parseT... | Reads an existing Tar Bzip File.
@access private
@param string $fileName Name of Tar Bzip Archive to read
@return bool | [
"Reads",
"an",
"existing",
"Tar",
"Bzip",
"File",
"."
] | 1138adf9341782a6284c05884989f7497532bcf4 | https://github.com/CeusMedia/Common/blob/1138adf9341782a6284c05884989f7497532bcf4/src/FS/File/Arc/TarBzip.php#L74-L80 |
36,379 | CeusMedia/Common | src/FS/File/Arc/TarBzip.php | FS_File_Arc_TarBzip.save | public function save( $fileName = false )
{
if( !$fileName )
{
if( !$this->fileName )
throw new RuntimeException( 'No TBZ file name for saving given.' );
$fileName = $this->fileName;
}
$this->generateTar(); // Encode processed files into TAR file format
$f = new FS_File_Arc_Bzip... | php | public function save( $fileName = false )
{
if( !$fileName )
{
if( !$this->fileName )
throw new RuntimeException( 'No TBZ file name for saving given.' );
$fileName = $this->fileName;
}
$this->generateTar(); // Encode processed files into TAR file format
$f = new FS_File_Arc_Bzip... | [
"public",
"function",
"save",
"(",
"$",
"fileName",
"=",
"false",
")",
"{",
"if",
"(",
"!",
"$",
"fileName",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"fileName",
")",
"throw",
"new",
"RuntimeException",
"(",
"'No TBZ file name for saving given.'",
")",... | Write down the currently loaded Tar Bzip Archive.
@access public
@param string $fileName Name of Tar Bzip Archive to save
@return bool | [
"Write",
"down",
"the",
"currently",
"loaded",
"Tar",
"Bzip",
"Archive",
"."
] | 1138adf9341782a6284c05884989f7497532bcf4 | https://github.com/CeusMedia/Common/blob/1138adf9341782a6284c05884989f7497532bcf4/src/FS/File/Arc/TarBzip.php#L88-L100 |
36,380 | CeusMedia/Common | src/Net/HTTP/Request/Receiver.php | Net_HTTP_Request_Receiver.getAllFromSource | public function getAllFromSource( $source, $strict = FALSE )
{
$source = strtolower( $source );
if( isset( $this->sources[$source] ) )
return new ADT_List_Dictionary( $this->sources[$source] );
if( !$strict )
return array();
throw new InvalidArgumentException( 'Invalid source "'.$source.'"' );
} | php | public function getAllFromSource( $source, $strict = FALSE )
{
$source = strtolower( $source );
if( isset( $this->sources[$source] ) )
return new ADT_List_Dictionary( $this->sources[$source] );
if( !$strict )
return array();
throw new InvalidArgumentException( 'Invalid source "'.$source.'"' );
} | [
"public",
"function",
"getAllFromSource",
"(",
"$",
"source",
",",
"$",
"strict",
"=",
"FALSE",
")",
"{",
"$",
"source",
"=",
"strtolower",
"(",
"$",
"source",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"sources",
"[",
"$",
"source",
"]",
... | Reads and returns Data from Sources.
@access public
@param string $source Source key (not case sensitive) (get,post,files[,session,cookie])
@param bool $strict Flag: throw exception if not set, otherwise return NULL
@throws InvalidArgumentException if key is not set in source and strict is on
@return array Pa... | [
"Reads",
"and",
"returns",
"Data",
"from",
"Sources",
"."
] | 1138adf9341782a6284c05884989f7497532bcf4 | https://github.com/CeusMedia/Common/blob/1138adf9341782a6284c05884989f7497532bcf4/src/Net/HTTP/Request/Receiver.php#L105-L113 |
36,381 | CeusMedia/Common | src/Net/HTTP/Request/Receiver.php | Net_HTTP_Request_Receiver.getFromSource | public function getFromSource( $key, $source, $strict = FALSE )
{
$data = $this->getAllFromSource( $source );
if( isset( $data[$key] ) )
return $data[$key];
if( !$strict )
return NULL;
throw new InvalidArgumentException( 'Invalid key "'.$key.'" in source "'.$source.'"' );
} | php | public function getFromSource( $key, $source, $strict = FALSE )
{
$data = $this->getAllFromSource( $source );
if( isset( $data[$key] ) )
return $data[$key];
if( !$strict )
return NULL;
throw new InvalidArgumentException( 'Invalid key "'.$key.'" in source "'.$source.'"' );
} | [
"public",
"function",
"getFromSource",
"(",
"$",
"key",
",",
"$",
"source",
",",
"$",
"strict",
"=",
"FALSE",
")",
"{",
"$",
"data",
"=",
"$",
"this",
"->",
"getAllFromSource",
"(",
"$",
"source",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"data",
"["... | Returns value or null by its key in a specified source.
@access public
@param string $key ...
@param string $source Source key (not case sensitive) (get,post,files[,session,cookie])
@param bool $strict Flag: throw exception if not set, otherwise return NULL
@throws InvalidArgumentException if key is not set ... | [
"Returns",
"value",
"or",
"null",
"by",
"its",
"key",
"in",
"a",
"specified",
"source",
"."
] | 1138adf9341782a6284c05884989f7497532bcf4 | https://github.com/CeusMedia/Common/blob/1138adf9341782a6284c05884989f7497532bcf4/src/Net/HTTP/Request/Receiver.php#L124-L132 |
36,382 | meritoo/common-library | src/Utilities/Miscellaneous.php | Miscellaneous.checkboxValue2Boolean | public static function checkboxValue2Boolean($checkboxValue)
{
$mapping = [
'on' => true,
'off' => false,
];
$clearValue = strtolower(trim($checkboxValue));
if (isset($mapping[$clearValue])) {
return $mapping[$clearValue];
}
ret... | php | public static function checkboxValue2Boolean($checkboxValue)
{
$mapping = [
'on' => true,
'off' => false,
];
$clearValue = strtolower(trim($checkboxValue));
if (isset($mapping[$clearValue])) {
return $mapping[$clearValue];
}
ret... | [
"public",
"static",
"function",
"checkboxValue2Boolean",
"(",
"$",
"checkboxValue",
")",
"{",
"$",
"mapping",
"=",
"[",
"'on'",
"=>",
"true",
",",
"'off'",
"=>",
"false",
",",
"]",
";",
"$",
"clearValue",
"=",
"strtolower",
"(",
"trim",
"(",
"$",
"checkb... | Converts checkbox value to boolean
@param string $checkboxValue Checkbox value
@return bool | [
"Converts",
"checkbox",
"value",
"to",
"boolean"
] | b166b8b805ae97c15688d27323cae8976bd0f6dc | https://github.com/meritoo/common-library/blob/b166b8b805ae97c15688d27323cae8976bd0f6dc/src/Utilities/Miscellaneous.php#L125-L139 |
36,383 | meritoo/common-library | src/Utilities/Miscellaneous.php | Miscellaneous.includeFileExtension | public static function includeFileExtension($fileName, $extension)
{
$fileExtension = self::getFileExtension($fileName, true);
/*
* File has given extension?
* Nothing to do
*/
if ($fileExtension === strtolower($extension)) {
return $fileName;
... | php | public static function includeFileExtension($fileName, $extension)
{
$fileExtension = self::getFileExtension($fileName, true);
/*
* File has given extension?
* Nothing to do
*/
if ($fileExtension === strtolower($extension)) {
return $fileName;
... | [
"public",
"static",
"function",
"includeFileExtension",
"(",
"$",
"fileName",
",",
"$",
"extension",
")",
"{",
"$",
"fileExtension",
"=",
"self",
"::",
"getFileExtension",
"(",
"$",
"fileName",
",",
"true",
")",
";",
"/*\n * File has given extension?\n ... | Returns name of file with given extension after verification if it contains the extension
@param string $fileName The file name to verify
@param string $extension The extension to verify and include
@return string | [
"Returns",
"name",
"of",
"file",
"with",
"given",
"extension",
"after",
"verification",
"if",
"it",
"contains",
"the",
"extension"
] | b166b8b805ae97c15688d27323cae8976bd0f6dc | https://github.com/meritoo/common-library/blob/b166b8b805ae97c15688d27323cae8976bd0f6dc/src/Utilities/Miscellaneous.php#L159-L172 |
36,384 | meritoo/common-library | src/Utilities/Miscellaneous.php | Miscellaneous.getFileExtension | public static function getFileExtension($fileName, $asLowerCase = false)
{
$extension = '';
$matches = [];
if (preg_match('|(.+)\.(.+)|', $fileName, $matches)) {
$extension = end($matches);
}
if ($asLowerCase) {
return strtolower($extension);
... | php | public static function getFileExtension($fileName, $asLowerCase = false)
{
$extension = '';
$matches = [];
if (preg_match('|(.+)\.(.+)|', $fileName, $matches)) {
$extension = end($matches);
}
if ($asLowerCase) {
return strtolower($extension);
... | [
"public",
"static",
"function",
"getFileExtension",
"(",
"$",
"fileName",
",",
"$",
"asLowerCase",
"=",
"false",
")",
"{",
"$",
"extension",
"=",
"''",
";",
"$",
"matches",
"=",
"[",
"]",
";",
"if",
"(",
"preg_match",
"(",
"'|(.+)\\.(.+)|'",
",",
"$",
... | Returns file extension
@param string $fileName File name
@param bool $asLowerCase (optional) if true extension is returned as lowercase string
@return string | [
"Returns",
"file",
"extension"
] | b166b8b805ae97c15688d27323cae8976bd0f6dc | https://github.com/meritoo/common-library/blob/b166b8b805ae97c15688d27323cae8976bd0f6dc/src/Utilities/Miscellaneous.php#L181-L195 |
36,385 | meritoo/common-library | src/Utilities/Miscellaneous.php | Miscellaneous.getFileNameFromPath | public static function getFileNameFromPath($path)
{
$matches = [];
$pattern = sprintf('|([^\%s.]+\.[A-Za-z0-9.]+)$|', DIRECTORY_SEPARATOR);
if ((bool)preg_match($pattern, $path, $matches)) {
return $matches[1];
}
return '';
} | php | public static function getFileNameFromPath($path)
{
$matches = [];
$pattern = sprintf('|([^\%s.]+\.[A-Za-z0-9.]+)$|', DIRECTORY_SEPARATOR);
if ((bool)preg_match($pattern, $path, $matches)) {
return $matches[1];
}
return '';
} | [
"public",
"static",
"function",
"getFileNameFromPath",
"(",
"$",
"path",
")",
"{",
"$",
"matches",
"=",
"[",
"]",
";",
"$",
"pattern",
"=",
"sprintf",
"(",
"'|([^\\%s.]+\\.[A-Za-z0-9.]+)$|'",
",",
"DIRECTORY_SEPARATOR",
")",
";",
"if",
"(",
"(",
"bool",
")",... | Returns file name from given path
@param string $path A path that contains file name
@return string | [
"Returns",
"file",
"name",
"from",
"given",
"path"
] | b166b8b805ae97c15688d27323cae8976bd0f6dc | https://github.com/meritoo/common-library/blob/b166b8b805ae97c15688d27323cae8976bd0f6dc/src/Utilities/Miscellaneous.php#L203-L213 |
36,386 | meritoo/common-library | src/Utilities/Miscellaneous.php | Miscellaneous.getUniqueFileName | public static function getUniqueFileName($originalFileName, $objectId = 0)
{
$withoutExtension = self::getFileNameWithoutExtension($originalFileName);
$extension = self::getFileExtension($originalFileName, true);
/*
* Let's clear name of file
*
* Attention.
... | php | public static function getUniqueFileName($originalFileName, $objectId = 0)
{
$withoutExtension = self::getFileNameWithoutExtension($originalFileName);
$extension = self::getFileExtension($originalFileName, true);
/*
* Let's clear name of file
*
* Attention.
... | [
"public",
"static",
"function",
"getUniqueFileName",
"(",
"$",
"originalFileName",
",",
"$",
"objectId",
"=",
"0",
")",
"{",
"$",
"withoutExtension",
"=",
"self",
"::",
"getFileNameWithoutExtension",
"(",
"$",
"originalFileName",
")",
";",
"$",
"extension",
"=",... | Returns unique name for file based on given original name
@param string $originalFileName Original name of the file
@param int $objectId (optional) Object ID, the ID of database's row. May be included into the
generated / unique name.
@return string | [
"Returns",
"unique",
"name",
"for",
"file",
"based",
"on",
"given",
"original",
"name"
] | b166b8b805ae97c15688d27323cae8976bd0f6dc | https://github.com/meritoo/common-library/blob/b166b8b805ae97c15688d27323cae8976bd0f6dc/src/Utilities/Miscellaneous.php#L223-L250 |
36,387 | meritoo/common-library | src/Utilities/Miscellaneous.php | Miscellaneous.getFileNameWithoutExtension | public static function getFileNameWithoutExtension($fileName)
{
$matches = [];
if (is_string($fileName) && (bool)preg_match('|(.+)\.(.+)|', $fileName, $matches)) {
return $matches[1];
}
return '';
} | php | public static function getFileNameWithoutExtension($fileName)
{
$matches = [];
if (is_string($fileName) && (bool)preg_match('|(.+)\.(.+)|', $fileName, $matches)) {
return $matches[1];
}
return '';
} | [
"public",
"static",
"function",
"getFileNameWithoutExtension",
"(",
"$",
"fileName",
")",
"{",
"$",
"matches",
"=",
"[",
"]",
";",
"if",
"(",
"is_string",
"(",
"$",
"fileName",
")",
"&&",
"(",
"bool",
")",
"preg_match",
"(",
"'|(.+)\\.(.+)|'",
",",
"$",
... | Returns file name without extension
@param string $fileName The file name
@return string | [
"Returns",
"file",
"name",
"without",
"extension"
] | b166b8b805ae97c15688d27323cae8976bd0f6dc | https://github.com/meritoo/common-library/blob/b166b8b805ae97c15688d27323cae8976bd0f6dc/src/Utilities/Miscellaneous.php#L258-L267 |
36,388 | meritoo/common-library | src/Utilities/Miscellaneous.php | Miscellaneous.toLatin | public static function toLatin($string, $lowerCaseHuman = true, $replacementChar = '-')
{
if (is_string($string)) {
$string = trim($string);
}
/*
* Empty value?
* Nothing to do
*/
if (empty($string)) {
return '';
}
... | php | public static function toLatin($string, $lowerCaseHuman = true, $replacementChar = '-')
{
if (is_string($string)) {
$string = trim($string);
}
/*
* Empty value?
* Nothing to do
*/
if (empty($string)) {
return '';
}
... | [
"public",
"static",
"function",
"toLatin",
"(",
"$",
"string",
",",
"$",
"lowerCaseHuman",
"=",
"true",
",",
"$",
"replacementChar",
"=",
"'-'",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"string",
")",
")",
"{",
"$",
"string",
"=",
"trim",
"(",
"$"... | Converts given string characters to latin characters
@param string $string String to convert
@param bool $lowerCaseHuman (optional) If is set to true, converted string is returned as lowercase and
human-readable. Otherwise - as original.
@param string $replacementChar (optional) Replacement character for a... | [
"Converts",
"given",
"string",
"characters",
"to",
"latin",
"characters"
] | b166b8b805ae97c15688d27323cae8976bd0f6dc | https://github.com/meritoo/common-library/blob/b166b8b805ae97c15688d27323cae8976bd0f6dc/src/Utilities/Miscellaneous.php#L310-L354 |
36,389 | meritoo/common-library | src/Utilities/Miscellaneous.php | Miscellaneous.getUniqueString | public static function getUniqueString($prefix = '', $hashed = false)
{
$unique = uniqid($prefix, true);
if ($hashed) {
return sha1($unique);
}
return $unique;
} | php | public static function getUniqueString($prefix = '', $hashed = false)
{
$unique = uniqid($prefix, true);
if ($hashed) {
return sha1($unique);
}
return $unique;
} | [
"public",
"static",
"function",
"getUniqueString",
"(",
"$",
"prefix",
"=",
"''",
",",
"$",
"hashed",
"=",
"false",
")",
"{",
"$",
"unique",
"=",
"uniqid",
"(",
"$",
"prefix",
",",
"true",
")",
";",
"if",
"(",
"$",
"hashed",
")",
"{",
"return",
"sh... | Returns unique string
@param string $prefix (optional) Prefix of the unique string. May be used while generating the unique
string simultaneously on several hosts at the same microsecond.
@param bool $hashed (optional) If is set to true, the unique string is hashed additionally. Otherwise - not.
@return string | [
"Returns",
"unique",
"string"
] | b166b8b805ae97c15688d27323cae8976bd0f6dc | https://github.com/meritoo/common-library/blob/b166b8b805ae97c15688d27323cae8976bd0f6dc/src/Utilities/Miscellaneous.php#L364-L373 |
36,390 | meritoo/common-library | src/Utilities/Miscellaneous.php | Miscellaneous.replace | public static function replace($subject, $search, $replacement, $quoteStrings = false)
{
/*
* Unknown source or item to find or replacement is an empty array?
* Nothing to do
*/
if (empty($subject) || empty($search) || [] === $replacement) {
return $subject;
... | php | public static function replace($subject, $search, $replacement, $quoteStrings = false)
{
/*
* Unknown source or item to find or replacement is an empty array?
* Nothing to do
*/
if (empty($subject) || empty($search) || [] === $replacement) {
return $subject;
... | [
"public",
"static",
"function",
"replace",
"(",
"$",
"subject",
",",
"$",
"search",
",",
"$",
"replacement",
",",
"$",
"quoteStrings",
"=",
"false",
")",
"{",
"/*\n * Unknown source or item to find or replacement is an empty array?\n * Nothing to do\n ... | Replaces part of string with other string or strings.
There is a few combination of what should be searched and with what it should be replaced.
@param array|string $subject The string or an array of strings to search and replace
@param array|string $search String or pattern or array of patterns to find. It... | [
"Replaces",
"part",
"of",
"string",
"with",
"other",
"string",
"or",
"strings",
".",
"There",
"is",
"a",
"few",
"combination",
"of",
"what",
"should",
"be",
"searched",
"and",
"with",
"what",
"it",
"should",
"be",
"replaced",
"."
] | b166b8b805ae97c15688d27323cae8976bd0f6dc | https://github.com/meritoo/common-library/blob/b166b8b805ae97c15688d27323cae8976bd0f6dc/src/Utilities/Miscellaneous.php#L412-L520 |
36,391 | meritoo/common-library | src/Utilities/Miscellaneous.php | Miscellaneous.substringToWord | public static function substringToWord($text, $maxLength, $suffix = '...')
{
$effect = $text;
$textLength = mb_strlen($text, 'utf-8');
$suffixLength = mb_strlen($suffix, 'utf-8');
$maxLength -= $suffixLength;
if ($textLength > $maxLength) {
$effect = mb_substr(... | php | public static function substringToWord($text, $maxLength, $suffix = '...')
{
$effect = $text;
$textLength = mb_strlen($text, 'utf-8');
$suffixLength = mb_strlen($suffix, 'utf-8');
$maxLength -= $suffixLength;
if ($textLength > $maxLength) {
$effect = mb_substr(... | [
"public",
"static",
"function",
"substringToWord",
"(",
"$",
"text",
",",
"$",
"maxLength",
",",
"$",
"suffix",
"=",
"'...'",
")",
"{",
"$",
"effect",
"=",
"$",
"text",
";",
"$",
"textLength",
"=",
"mb_strlen",
"(",
"$",
"text",
",",
"'utf-8'",
")",
... | Returns part of string preserving words
@param string $text The string / text
@param int $maxLength Maximum length of given string
@param string $suffix (optional) The suffix to add at the end of string
@return string | [
"Returns",
"part",
"of",
"string",
"preserving",
"words"
] | b166b8b805ae97c15688d27323cae8976bd0f6dc | https://github.com/meritoo/common-library/blob/b166b8b805ae97c15688d27323cae8976bd0f6dc/src/Utilities/Miscellaneous.php#L566-L587 |
36,392 | meritoo/common-library | src/Utilities/Miscellaneous.php | Miscellaneous.breakLongText | public static function breakLongText(
$text,
$perLine = 100,
$separator = '<br>',
$encoding = 'utf-8',
$proportionalAberration = 20
) {
$effect = $text;
$textLength = mb_strlen($text);
if (!empty($text) && $textLength > $perLine) {
/*
... | php | public static function breakLongText(
$text,
$perLine = 100,
$separator = '<br>',
$encoding = 'utf-8',
$proportionalAberration = 20
) {
$effect = $text;
$textLength = mb_strlen($text);
if (!empty($text) && $textLength > $perLine) {
/*
... | [
"public",
"static",
"function",
"breakLongText",
"(",
"$",
"text",
",",
"$",
"perLine",
"=",
"100",
",",
"$",
"separator",
"=",
"'<br>'",
",",
"$",
"encoding",
"=",
"'utf-8'",
",",
"$",
"proportionalAberration",
"=",
"20",
")",
"{",
"$",
"effect",
"=",
... | Breaks long text
@param string $text The text to check and break
@param int $perLine (optional) Characters count per line. Default: 100.
@param string $separator (optional) Separator that is placed between lines. Default: "<br>".
@param string $encoding (o... | [
"Breaks",
"long",
"text"
] | b166b8b805ae97c15688d27323cae8976bd0f6dc | https://github.com/meritoo/common-library/blob/b166b8b805ae97c15688d27323cae8976bd0f6dc/src/Utilities/Miscellaneous.php#L599-L676 |
36,393 | meritoo/common-library | src/Utilities/Miscellaneous.php | Miscellaneous.removeDirectory | public static function removeDirectory($directoryPath, $contentOnly = false)
{
/*
* Directory does not exist?
* Nothing to do
*/
if (!file_exists($directoryPath)) {
return null;
}
/*
* It's not a directory?
* Let's treat it li... | php | public static function removeDirectory($directoryPath, $contentOnly = false)
{
/*
* Directory does not exist?
* Nothing to do
*/
if (!file_exists($directoryPath)) {
return null;
}
/*
* It's not a directory?
* Let's treat it li... | [
"public",
"static",
"function",
"removeDirectory",
"(",
"$",
"directoryPath",
",",
"$",
"contentOnly",
"=",
"false",
")",
"{",
"/*\n * Directory does not exist?\n * Nothing to do\n */",
"if",
"(",
"!",
"file_exists",
"(",
"$",
"directoryPath",
")",... | Removes the directory.
If not empty, removes also contents.
@param string $directoryPath Directory path
@param bool $contentOnly (optional) If is set to true, only content of the directory is removed, not
directory itself. Otherwise - directory is removed too (default behaviour).
@return null|bool | [
"Removes",
"the",
"directory",
".",
"If",
"not",
"empty",
"removes",
"also",
"contents",
"."
] | b166b8b805ae97c15688d27323cae8976bd0f6dc | https://github.com/meritoo/common-library/blob/b166b8b805ae97c15688d27323cae8976bd0f6dc/src/Utilities/Miscellaneous.php#L687-L721 |
36,394 | meritoo/common-library | src/Utilities/Miscellaneous.php | Miscellaneous.getCamelCase | public static function getCamelCase($string, $separator = ' ')
{
if (empty($string)) {
return '';
}
$effect = '';
$members = explode($separator, $string);
foreach ($members as $key => $value) {
$value = mb_strtolower($value);
if (0 === $... | php | public static function getCamelCase($string, $separator = ' ')
{
if (empty($string)) {
return '';
}
$effect = '';
$members = explode($separator, $string);
foreach ($members as $key => $value) {
$value = mb_strtolower($value);
if (0 === $... | [
"public",
"static",
"function",
"getCamelCase",
"(",
"$",
"string",
",",
"$",
"separator",
"=",
"' '",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"string",
")",
")",
"{",
"return",
"''",
";",
"}",
"$",
"effect",
"=",
"''",
";",
"$",
"members",
"=",
... | Returns the string in camel case
@param string $string The string to convert e.g. this-is-eXamplE (return: thisIsExample)
@param string $separator (optional) Separator used to find parts of the string, e.g. '-' or ','
@return string | [
"Returns",
"the",
"string",
"in",
"camel",
"case"
] | b166b8b805ae97c15688d27323cae8976bd0f6dc | https://github.com/meritoo/common-library/blob/b166b8b805ae97c15688d27323cae8976bd0f6dc/src/Utilities/Miscellaneous.php#L741-L761 |
36,395 | meritoo/common-library | src/Utilities/Miscellaneous.php | Miscellaneous.lowercaseFirst | public static function lowercaseFirst($text, $restLowercase = null)
{
if (empty($text)) {
return '';
}
$effect = $text;
if ($restLowercase) {
$effect = mb_strtolower($effect);
} elseif (false === $restLowercase) {
$effect = mb_strtoupper(... | php | public static function lowercaseFirst($text, $restLowercase = null)
{
if (empty($text)) {
return '';
}
$effect = $text;
if ($restLowercase) {
$effect = mb_strtolower($effect);
} elseif (false === $restLowercase) {
$effect = mb_strtoupper(... | [
"public",
"static",
"function",
"lowercaseFirst",
"(",
"$",
"text",
",",
"$",
"restLowercase",
"=",
"null",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"text",
")",
")",
"{",
"return",
"''",
";",
"}",
"$",
"effect",
"=",
"$",
"text",
";",
"if",
"(",
... | Make a string's first character lowercase
@param string $text The text to get first character lowercase
@param null|bool $restLowercase (optional) Information that to do with rest of given string
@return string
Values of the $restLowercase argument:
- null (default): nothing is done with the string
- true... | [
"Make",
"a",
"string",
"s",
"first",
"character",
"lowercase"
] | b166b8b805ae97c15688d27323cae8976bd0f6dc | https://github.com/meritoo/common-library/blob/b166b8b805ae97c15688d27323cae8976bd0f6dc/src/Utilities/Miscellaneous.php#L775-L790 |
36,396 | meritoo/common-library | src/Utilities/Miscellaneous.php | Miscellaneous.quoteValue | public static function quoteValue($value, $useApostrophe = true)
{
if (is_string($value)) {
$quotes = '"';
if ($useApostrophe) {
$quotes = '\'';
}
$value = sprintf('%s%s%s', $quotes, $value, $quotes);
}
return $value;
} | php | public static function quoteValue($value, $useApostrophe = true)
{
if (is_string($value)) {
$quotes = '"';
if ($useApostrophe) {
$quotes = '\'';
}
$value = sprintf('%s%s%s', $quotes, $value, $quotes);
}
return $value;
} | [
"public",
"static",
"function",
"quoteValue",
"(",
"$",
"value",
",",
"$",
"useApostrophe",
"=",
"true",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"value",
")",
")",
"{",
"$",
"quotes",
"=",
"'\"'",
";",
"if",
"(",
"$",
"useApostrophe",
")",
"{",
... | Quotes given value with apostrophes or quotation marks
@param mixed $value The value to quote
@param bool $useApostrophe (optional) If is set to true, apostrophes are used. Otherwise - quotation marks.
@return string | [
"Quotes",
"given",
"value",
"with",
"apostrophes",
"or",
"quotation",
"marks"
] | b166b8b805ae97c15688d27323cae8976bd0f6dc | https://github.com/meritoo/common-library/blob/b166b8b805ae97c15688d27323cae8976bd0f6dc/src/Utilities/Miscellaneous.php#L828-L841 |
36,397 | meritoo/common-library | src/Utilities/Miscellaneous.php | Miscellaneous.getStringWithoutLastElement | public static function getStringWithoutLastElement($string, $separator)
{
$elements = self::getStringElements($string, $separator);
$lastKey = Arrays::getLastKey($elements);
unset($elements[$lastKey]);
return implode($separator, $elements);
} | php | public static function getStringWithoutLastElement($string, $separator)
{
$elements = self::getStringElements($string, $separator);
$lastKey = Arrays::getLastKey($elements);
unset($elements[$lastKey]);
return implode($separator, $elements);
} | [
"public",
"static",
"function",
"getStringWithoutLastElement",
"(",
"$",
"string",
",",
"$",
"separator",
")",
"{",
"$",
"elements",
"=",
"self",
"::",
"getStringElements",
"(",
"$",
"string",
",",
"$",
"separator",
")",
";",
"$",
"lastKey",
"=",
"Arrays",
... | Returns string without the last element.
The string should contain given separator.
@param string $string The string to check
@param string $separator The separator which divides elements of string
@return string | [
"Returns",
"string",
"without",
"the",
"last",
"element",
".",
"The",
"string",
"should",
"contain",
"given",
"separator",
"."
] | b166b8b805ae97c15688d27323cae8976bd0f6dc | https://github.com/meritoo/common-library/blob/b166b8b805ae97c15688d27323cae8976bd0f6dc/src/Utilities/Miscellaneous.php#L875-L883 |
36,398 | meritoo/common-library | src/Utilities/Miscellaneous.php | Miscellaneous.getStringElements | public static function getStringElements($string, $separator)
{
$matches = [];
$pattern = sprintf('|[^\%s]+|', $separator);
$matchCount = preg_match_all($pattern, $string, $matches);
if ($matchCount > 1) {
return $matches[0];
}
return [];
} | php | public static function getStringElements($string, $separator)
{
$matches = [];
$pattern = sprintf('|[^\%s]+|', $separator);
$matchCount = preg_match_all($pattern, $string, $matches);
if ($matchCount > 1) {
return $matches[0];
}
return [];
} | [
"public",
"static",
"function",
"getStringElements",
"(",
"$",
"string",
",",
"$",
"separator",
")",
"{",
"$",
"matches",
"=",
"[",
"]",
";",
"$",
"pattern",
"=",
"sprintf",
"(",
"'|[^\\%s]+|'",
",",
"$",
"separator",
")",
";",
"$",
"matchCount",
"=",
... | Returns elements of given string divided by given separator
@param string $string The string to check
@param string $separator The separator which divides elements of string
@return array | [
"Returns",
"elements",
"of",
"given",
"string",
"divided",
"by",
"given",
"separator"
] | b166b8b805ae97c15688d27323cae8976bd0f6dc | https://github.com/meritoo/common-library/blob/b166b8b805ae97c15688d27323cae8976bd0f6dc/src/Utilities/Miscellaneous.php#L892-L903 |
36,399 | meritoo/common-library | src/Utilities/Miscellaneous.php | Miscellaneous.getLastElementOfString | public static function getLastElementOfString($string, $separator)
{
$elements = self::getStringElements($string, $separator);
/*
* No elements?
* Nothing to do
*/
if (empty($elements)) {
return null;
}
$element = Arrays::getLastElemen... | php | public static function getLastElementOfString($string, $separator)
{
$elements = self::getStringElements($string, $separator);
/*
* No elements?
* Nothing to do
*/
if (empty($elements)) {
return null;
}
$element = Arrays::getLastElemen... | [
"public",
"static",
"function",
"getLastElementOfString",
"(",
"$",
"string",
",",
"$",
"separator",
")",
"{",
"$",
"elements",
"=",
"self",
"::",
"getStringElements",
"(",
"$",
"string",
",",
"$",
"separator",
")",
";",
"/*\n * No elements?\n * No... | Returns the last element of given string divided by given separator
@param string $string The string to check
@param string $separator The separator which divides elements of string
@return null|string | [
"Returns",
"the",
"last",
"element",
"of",
"given",
"string",
"divided",
"by",
"given",
"separator"
] | b166b8b805ae97c15688d27323cae8976bd0f6dc | https://github.com/meritoo/common-library/blob/b166b8b805ae97c15688d27323cae8976bd0f6dc/src/Utilities/Miscellaneous.php#L912-L927 |
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.