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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
19,500 | ClanCats/Core | src/classes/CCFile.php | CCFile.upload | public static function upload( $key, $path )
{
if ( $file = static::upload_path( $key ) ) {
return move_uploaded_file( $file, $path );
}
return false;
} | php | public static function upload( $key, $path )
{
if ( $file = static::upload_path( $key ) ) {
return move_uploaded_file( $file, $path );
}
return false;
} | [
"public",
"static",
"function",
"upload",
"(",
"$",
"key",
",",
"$",
"path",
")",
"{",
"if",
"(",
"$",
"file",
"=",
"static",
"::",
"upload_path",
"(",
"$",
"key",
")",
")",
"{",
"return",
"move_uploaded_file",
"(",
"$",
"file",
",",
"$",
"path",
"... | Move user uploads to another dir
@param string $key
@param string $path
@return bool | [
"Move",
"user",
"uploads",
"to",
"another",
"dir"
] | 9f6ec72c1a439de4b253d0223f1029f7f85b6ef8 | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCFile.php#L194-L202 |
19,501 | ClanCats/Core | src/classes/CCError.php | CCError._init | public static function _init()
{
// we capture non fatal errors only in dev environments
if ( ClanCats::in_development() )
{
// add a hook to the main resposne
CCEvent::mind( 'response.output', function( $output ) {
if ( strpos( $output, '</body>' ) === false )
{
return $output;
}
... | php | public static function _init()
{
// we capture non fatal errors only in dev environments
if ( ClanCats::in_development() )
{
// add a hook to the main resposne
CCEvent::mind( 'response.output', function( $output ) {
if ( strpos( $output, '</body>' ) === false )
{
return $output;
}
... | [
"public",
"static",
"function",
"_init",
"(",
")",
"{",
"// we capture non fatal errors only in dev environments",
"if",
"(",
"ClanCats",
"::",
"in_development",
"(",
")",
")",
"{",
"// add a hook to the main resposne",
"CCEvent",
"::",
"mind",
"(",
"'response.output'",
... | error class init
@return void | [
"error",
"class",
"init"
] | 9f6ec72c1a439de4b253d0223f1029f7f85b6ef8 | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCError.php#L62-L97 |
19,502 | ClanCats/Core | src/classes/CCError.php | CCError.is_fatal_level | private static function is_fatal_level( $level )
{
$fatals = array(
E_ERROR,
E_PARSE,
E_CORE_ERROR,
E_CORE_WARNING,
E_COMPILE_ERROR,
E_COMPILE_WARNING,
E_DEPRECATED,
);
if ( is_object( ClanCats::$config ) && ClanCats::$config instanceof CCConfig )
{
if ( in_array( $level, ClanCats::... | php | private static function is_fatal_level( $level )
{
$fatals = array(
E_ERROR,
E_PARSE,
E_CORE_ERROR,
E_CORE_WARNING,
E_COMPILE_ERROR,
E_COMPILE_WARNING,
E_DEPRECATED,
);
if ( is_object( ClanCats::$config ) && ClanCats::$config instanceof CCConfig )
{
if ( in_array( $level, ClanCats::... | [
"private",
"static",
"function",
"is_fatal_level",
"(",
"$",
"level",
")",
"{",
"$",
"fatals",
"=",
"array",
"(",
"E_ERROR",
",",
"E_PARSE",
",",
"E_CORE_ERROR",
",",
"E_CORE_WARNING",
",",
"E_COMPILE_ERROR",
",",
"E_COMPILE_WARNING",
",",
"E_DEPRECATED",
",",
... | check if a level is fatal
@param int $level
@return bool | [
"check",
"if",
"a",
"level",
"is",
"fatal"
] | 9f6ec72c1a439de4b253d0223f1029f7f85b6ef8 | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCError.php#L105-L126 |
19,503 | ClanCats/Core | src/classes/CCError.php | CCError.error | public static function error( $num, $message, $file, $line )
{
$exception = new CCException( static::$error_types[$num]." - ".$message, 0, $num, $file, $line );
if ( static::is_fatal_level( $num ) )
{
if ( static::$in_shutdown_process )
{
static::exception( $exception );
} else
{
thro... | php | public static function error( $num, $message, $file, $line )
{
$exception = new CCException( static::$error_types[$num]." - ".$message, 0, $num, $file, $line );
if ( static::is_fatal_level( $num ) )
{
if ( static::$in_shutdown_process )
{
static::exception( $exception );
} else
{
thro... | [
"public",
"static",
"function",
"error",
"(",
"$",
"num",
",",
"$",
"message",
",",
"$",
"file",
",",
"$",
"line",
")",
"{",
"$",
"exception",
"=",
"new",
"CCException",
"(",
"static",
"::",
"$",
"error_types",
"[",
"$",
"num",
"]",
".",
"\" - \"",
... | The error handler converts PHP errors to CCExceptions.
These get handled by the CCError exception handler.
Also the error handler decides the fatality of an error.
@param CCException $exception
@return void | [
"The",
"error",
"handler",
"converts",
"PHP",
"errors",
"to",
"CCExceptions",
".",
"These",
"get",
"handled",
"by",
"the",
"CCError",
"exception",
"handler",
"."
] | 9f6ec72c1a439de4b253d0223f1029f7f85b6ef8 | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCError.php#L167-L184 |
19,504 | raoul2000/yii2-scrollup-widget | Scrollup.php | Scrollup.init | public function init()
{
parent::init();
if (! empty($this->theme) && ! in_array($this->theme, $this->_supportedThemes)) {
throw new InvalidConfigException('Unsupported built-in theme : ' . $this->theme);
}
if (isset($this->pluginOptions['animation']) && ! in_array($this->pluginOptions['animation'], $this->... | php | public function init()
{
parent::init();
if (! empty($this->theme) && ! in_array($this->theme, $this->_supportedThemes)) {
throw new InvalidConfigException('Unsupported built-in theme : ' . $this->theme);
}
if (isset($this->pluginOptions['animation']) && ! in_array($this->pluginOptions['animation'], $this->... | [
"public",
"function",
"init",
"(",
")",
"{",
"parent",
"::",
"init",
"(",
")",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"theme",
")",
"&&",
"!",
"in_array",
"(",
"$",
"this",
"->",
"theme",
",",
"$",
"this",
"->",
"_supportedThemes",
... | Chekcs validity of theme and animation options | [
"Chekcs",
"validity",
"of",
"theme",
"and",
"animation",
"options"
] | 54d0d40755d81b039b90bfb36ed90325294b6864 | https://github.com/raoul2000/yii2-scrollup-widget/blob/54d0d40755d81b039b90bfb36ed90325294b6864/Scrollup.php#L66-L75 |
19,505 | raoul2000/yii2-scrollup-widget | Scrollup.php | Scrollup.registerClientScript | public function registerClientScript()
{
$view = $this->getView();
if (isset($this->theme)) {
$path = $view->getAssetManager()->publish(__DIR__ . '/assets/css/themes');
$view->registerCSSFile($path[1] . '/' . $this->theme . '.css');
if ($this->theme == 'image' && isset($this->pluginOptions['scrollText']... | php | public function registerClientScript()
{
$view = $this->getView();
if (isset($this->theme)) {
$path = $view->getAssetManager()->publish(__DIR__ . '/assets/css/themes');
$view->registerCSSFile($path[1] . '/' . $this->theme . '.css');
if ($this->theme == 'image' && isset($this->pluginOptions['scrollText']... | [
"public",
"function",
"registerClientScript",
"(",
")",
"{",
"$",
"view",
"=",
"$",
"this",
"->",
"getView",
"(",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"theme",
")",
")",
"{",
"$",
"path",
"=",
"$",
"view",
"->",
"getAssetManager",
... | Registers the needed JavaScript and inject the JS initialization code.
Note that if a supported theme is set, all css in the assets/css/theme folder are published
but only the css for the theme is registred.Moreover, if the select theme is 'image', the
'scrollText plugin option is cleared. | [
"Registers",
"the",
"needed",
"JavaScript",
"and",
"inject",
"the",
"JS",
"initialization",
"code",
"."
] | 54d0d40755d81b039b90bfb36ed90325294b6864 | https://github.com/raoul2000/yii2-scrollup-widget/blob/54d0d40755d81b039b90bfb36ed90325294b6864/Scrollup.php#L92-L110 |
19,506 | fubhy/graphql-php | src/Language/Source.php | Source.getLocation | public function getLocation($position)
{
$pattern = '/\r\n|[\n\r\u2028\u2029]/g';
$subject = mb_substr($this->body, 0, $position, 'UTF-8');
preg_match_all($pattern, $subject, $matches, PREG_OFFSET_CAPTURE);
$location = array_reduce($matches[0], function ($carry, $match) use ($positi... | php | public function getLocation($position)
{
$pattern = '/\r\n|[\n\r\u2028\u2029]/g';
$subject = mb_substr($this->body, 0, $position, 'UTF-8');
preg_match_all($pattern, $subject, $matches, PREG_OFFSET_CAPTURE);
$location = array_reduce($matches[0], function ($carry, $match) use ($positi... | [
"public",
"function",
"getLocation",
"(",
"$",
"position",
")",
"{",
"$",
"pattern",
"=",
"'/\\r\\n|[\\n\\r\\u2028\\u2029]/g'",
";",
"$",
"subject",
"=",
"mb_substr",
"(",
"$",
"this",
"->",
"body",
",",
"0",
",",
"$",
"position",
",",
"'UTF-8'",
")",
";",... | Takes a Source and a UTF-8 character offset, and returns the
corresponding line and column as a SourceLocation.
@param $position
@return \Fubhy\GraphQL\Language\SourceLocation | [
"Takes",
"a",
"Source",
"and",
"a",
"UTF",
"-",
"8",
"character",
"offset",
"and",
"returns",
"the",
"corresponding",
"line",
"and",
"column",
"as",
"a",
"SourceLocation",
"."
] | c1de2233c731ca29e5c5db4c43f3b9db36478c83 | https://github.com/fubhy/graphql-php/blob/c1de2233c731ca29e5c5db4c43f3b9db36478c83/src/Language/Source.php#L74-L88 |
19,507 | joomlatools/joomlatools-platform-legacy | code/base/node.php | JNode.addChild | public function addChild(&$child)
{
JLog::add('JNode::addChild() is deprecated.', JLog::WARNING, 'deprecated');
if ($child instanceof Jnode)
{
$child->setParent($this);
}
} | php | public function addChild(&$child)
{
JLog::add('JNode::addChild() is deprecated.', JLog::WARNING, 'deprecated');
if ($child instanceof Jnode)
{
$child->setParent($this);
}
} | [
"public",
"function",
"addChild",
"(",
"&",
"$",
"child",
")",
"{",
"JLog",
"::",
"add",
"(",
"'JNode::addChild() is deprecated.'",
",",
"JLog",
"::",
"WARNING",
",",
"'deprecated'",
")",
";",
"if",
"(",
"$",
"child",
"instanceof",
"Jnode",
")",
"{",
"$",
... | Add child to this node
If the child already has a parent, the link is unset
@param JNode &$child The child to be added
@return void
@since 11.1 | [
"Add",
"child",
"to",
"this",
"node"
] | 3a76944e2f2c415faa6504754c75321a3b478c06 | https://github.com/joomlatools/joomlatools-platform-legacy/blob/3a76944e2f2c415faa6504754c75321a3b478c06/code/base/node.php#L60-L68 |
19,508 | joomlatools/joomlatools-platform-legacy | code/base/node.php | JNode.setParent | public function setParent(&$parent)
{
JLog::add('JNode::setParent() is deprecated.', JLog::WARNING, 'deprecated');
if ($parent instanceof JNode || is_null($parent))
{
$hash = spl_object_hash($this);
if (!is_null($this->_parent))
{
unset($this->_parent->children[$hash]);
}
if (!is_null($pare... | php | public function setParent(&$parent)
{
JLog::add('JNode::setParent() is deprecated.', JLog::WARNING, 'deprecated');
if ($parent instanceof JNode || is_null($parent))
{
$hash = spl_object_hash($this);
if (!is_null($this->_parent))
{
unset($this->_parent->children[$hash]);
}
if (!is_null($pare... | [
"public",
"function",
"setParent",
"(",
"&",
"$",
"parent",
")",
"{",
"JLog",
"::",
"add",
"(",
"'JNode::setParent() is deprecated.'",
",",
"JLog",
"::",
"WARNING",
",",
"'deprecated'",
")",
";",
"if",
"(",
"$",
"parent",
"instanceof",
"JNode",
"||",
"is_nul... | Set the parent of a this node
If the node already has a parent, the link is unset
@param mixed &$parent The JNode for parent to be set or null
@return void
@since 11.1 | [
"Set",
"the",
"parent",
"of",
"a",
"this",
"node"
] | 3a76944e2f2c415faa6504754c75321a3b478c06 | https://github.com/joomlatools/joomlatools-platform-legacy/blob/3a76944e2f2c415faa6504754c75321a3b478c06/code/base/node.php#L81-L101 |
19,509 | Nobiles2/smsapi-bundle | DependencyInjection/KCHSmsApiExtension.php | KCHSmsApiExtension.registerFactories | private function registerFactories(ContainerBuilder $container, Definition $clientService, $clientName)
{
// SmsFactory
$container->setDefinition(
sprintf('kch_sms_api.sms_factory.%s', $clientName),
new Definition('%kch_sms_api.sms_factory.class%')
)
->add... | php | private function registerFactories(ContainerBuilder $container, Definition $clientService, $clientName)
{
// SmsFactory
$container->setDefinition(
sprintf('kch_sms_api.sms_factory.%s', $clientName),
new Definition('%kch_sms_api.sms_factory.class%')
)
->add... | [
"private",
"function",
"registerFactories",
"(",
"ContainerBuilder",
"$",
"container",
",",
"Definition",
"$",
"clientService",
",",
"$",
"clientName",
")",
"{",
"// SmsFactory",
"$",
"container",
"->",
"setDefinition",
"(",
"sprintf",
"(",
"'kch_sms_api.sms_factory.%... | Method register all library factories for Client.
@param ContainerBuilder $container
@param Definition $clientService
@param $clientName | [
"Method",
"register",
"all",
"library",
"factories",
"for",
"Client",
"."
] | f3f5e76e021b6a5da8c8d8accb81c4e283b9faa7 | https://github.com/Nobiles2/smsapi-bundle/blob/f3f5e76e021b6a5da8c8d8accb81c4e283b9faa7/DependencyInjection/KCHSmsApiExtension.php#L52-L93 |
19,510 | webforge-labs/psc-cms | lib/Psc/Doctrine/EntityBuilder.php | EntityBuilder.isMetaProperty | public function isMetaProperty($property) {
if (array_key_exists($property->getName(), $this->forcedMetaProperties)) return $this->forcedMetaProperties[$property->getName()];
return TRUE;
} | php | public function isMetaProperty($property) {
if (array_key_exists($property->getName(), $this->forcedMetaProperties)) return $this->forcedMetaProperties[$property->getName()];
return TRUE;
} | [
"public",
"function",
"isMetaProperty",
"(",
"$",
"property",
")",
"{",
"if",
"(",
"array_key_exists",
"(",
"$",
"property",
"->",
"getName",
"(",
")",
",",
"$",
"this",
"->",
"forcedMetaProperties",
")",
")",
"return",
"$",
"this",
"->",
"forcedMetaProperti... | Soll dsa Property z.b. im SetMetaGetter genannt werden? | [
"Soll",
"dsa",
"Property",
"z",
".",
"b",
".",
"im",
"SetMetaGetter",
"genannt",
"werden?"
] | 467bfa2547e6b4fa487d2d7f35fa6cc618dbc763 | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/Doctrine/EntityBuilder.php#L443-L447 |
19,511 | ClanCats/Core | src/classes/CCIn/Instance.php | CCIn_Instance.get | public function get( $key, $default = null )
{
if ( !isset( $this->GET[$key] ) )
{
return $default;
}
return $this->GET[$key];
} | php | public function get( $key, $default = null )
{
if ( !isset( $this->GET[$key] ) )
{
return $default;
}
return $this->GET[$key];
} | [
"public",
"function",
"get",
"(",
"$",
"key",
",",
"$",
"default",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"GET",
"[",
"$",
"key",
"]",
")",
")",
"{",
"return",
"$",
"default",
";",
"}",
"return",
"$",
"this",
... | get a GET param
@param string $key
@param mixed $default
@return mixed | [
"get",
"a",
"GET",
"param"
] | 9f6ec72c1a439de4b253d0223f1029f7f85b6ef8 | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCIn/Instance.php#L77-L84 |
19,512 | ClanCats/Core | src/classes/CCIn/Instance.php | CCIn_Instance.post | public function post( $key, $default = null )
{
if ( !isset( $this->POST[$key] ) )
{
return $default;
}
return $this->POST[$key];
} | php | public function post( $key, $default = null )
{
if ( !isset( $this->POST[$key] ) )
{
return $default;
}
return $this->POST[$key];
} | [
"public",
"function",
"post",
"(",
"$",
"key",
",",
"$",
"default",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"POST",
"[",
"$",
"key",
"]",
")",
")",
"{",
"return",
"$",
"default",
";",
"}",
"return",
"$",
"this",
... | get a POST param
@param string $key
@param mixed $default
@return mixed | [
"get",
"a",
"POST",
"param"
] | 9f6ec72c1a439de4b253d0223f1029f7f85b6ef8 | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCIn/Instance.php#L104-L111 |
19,513 | ClanCats/Core | src/classes/CCIn/Instance.php | CCIn_Instance.server | public function server( $key, $default = null ) {
if ( !isset( $this->SERVER[strtoupper( $key )] ) )
{
return $default;
}
return $this->SERVER[strtoupper( $key )];
} | php | public function server( $key, $default = null ) {
if ( !isset( $this->SERVER[strtoupper( $key )] ) )
{
return $default;
}
return $this->SERVER[strtoupper( $key )];
} | [
"public",
"function",
"server",
"(",
"$",
"key",
",",
"$",
"default",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"SERVER",
"[",
"strtoupper",
"(",
"$",
"key",
")",
"]",
")",
")",
"{",
"return",
"$",
"default",
";",
... | get a SERVER param
@param string $key
@return mixed | [
"get",
"a",
"SERVER",
"param"
] | 9f6ec72c1a439de4b253d0223f1029f7f85b6ef8 | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCIn/Instance.php#L130-L136 |
19,514 | ClanCats/Core | src/classes/CCIn/Instance.php | CCIn_Instance.file | public function file( $key, $default = null )
{
if ( !isset( $this->FILES[$key] ) )
{
return $default;
}
return $this->FILES[$key];
} | php | public function file( $key, $default = null )
{
if ( !isset( $this->FILES[$key] ) )
{
return $default;
}
return $this->FILES[$key];
} | [
"public",
"function",
"file",
"(",
"$",
"key",
",",
"$",
"default",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"FILES",
"[",
"$",
"key",
"]",
")",
")",
"{",
"return",
"$",
"default",
";",
"}",
"return",
"$",
"this",... | get a FILE param
@param string $key
@param mixed $default
@return mixed | [
"get",
"a",
"FILE",
"param"
] | 9f6ec72c1a439de4b253d0223f1029f7f85b6ef8 | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCIn/Instance.php#L156-L163 |
19,515 | ClanCats/Core | src/classes/CCIn/Instance.php | CCIn_Instance.client | public function client( $key = null ) {
// check if we already set the client object
if ( is_null( $this->client ) )
{
// make client
$this->client = new \stdClass;
/*
* get clients ip address
*/
// Cloudlfare fix
if ( $this->has_server( 'HTTP_CF_CONNECTING_IP' ) )
{
$this->cli... | php | public function client( $key = null ) {
// check if we already set the client object
if ( is_null( $this->client ) )
{
// make client
$this->client = new \stdClass;
/*
* get clients ip address
*/
// Cloudlfare fix
if ( $this->has_server( 'HTTP_CF_CONNECTING_IP' ) )
{
$this->cli... | [
"public",
"function",
"client",
"(",
"$",
"key",
"=",
"null",
")",
"{",
"// check if we already set the client object",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"client",
")",
")",
"{",
"// make client ",
"$",
"this",
"->",
"client",
"=",
"new",
"\\",
... | get the client data
@param string $key
@return mixed | [
"get",
"the",
"client",
"data"
] | 9f6ec72c1a439de4b253d0223f1029f7f85b6ef8 | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCIn/Instance.php#L182-L243 |
19,516 | ClanCats/Core | src/classes/CCIn/Instance.php | CCIn_Instance.method | public function method( $is = null )
{
if ( !is_null( $is ) )
{
return strtoupper( $is ) === $this->method();
}
return strtoupper( $this->server( 'HTTP_X_HTTP_METHOD_OVERRIDE', $this->server( 'REQUEST_METHOD', 'GET' ) ) );
} | php | public function method( $is = null )
{
if ( !is_null( $is ) )
{
return strtoupper( $is ) === $this->method();
}
return strtoupper( $this->server( 'HTTP_X_HTTP_METHOD_OVERRIDE', $this->server( 'REQUEST_METHOD', 'GET' ) ) );
} | [
"public",
"function",
"method",
"(",
"$",
"is",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"is_null",
"(",
"$",
"is",
")",
")",
"{",
"return",
"strtoupper",
"(",
"$",
"is",
")",
"===",
"$",
"this",
"->",
"method",
"(",
")",
";",
"}",
"return",
"str... | get the current requesting method
GET, POST, PUT, DELETE
@param string $is
@return string | [
"get",
"the",
"current",
"requesting",
"method",
"GET",
"POST",
"PUT",
"DELETE"
] | 9f6ec72c1a439de4b253d0223f1029f7f85b6ef8 | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCIn/Instance.php#L252-L260 |
19,517 | ClanCats/Core | src/classes/CCIn/Instance.php | CCIn_Instance.uri | public function uri( $full = false )
{
// check if we already set the current uri
if ( is_null( $this->uri ) )
{
$this->uri = $this->server('REQUEST_URI', '/' );
// fix doubled slashes
$this->uri = preg_replace( '/(\/+)/','/', $this->uri );
// remove get params
if ( !$full )
{
$t... | php | public function uri( $full = false )
{
// check if we already set the current uri
if ( is_null( $this->uri ) )
{
$this->uri = $this->server('REQUEST_URI', '/' );
// fix doubled slashes
$this->uri = preg_replace( '/(\/+)/','/', $this->uri );
// remove get params
if ( !$full )
{
$t... | [
"public",
"function",
"uri",
"(",
"$",
"full",
"=",
"false",
")",
"{",
"// check if we already set the current uri",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"uri",
")",
")",
"{",
"$",
"this",
"->",
"uri",
"=",
"$",
"this",
"->",
"server",
"(",
"'... | get the requestet uri
@param bool $full Don't cut the get params
@return string | [
"get",
"the",
"requestet",
"uri"
] | 9f6ec72c1a439de4b253d0223f1029f7f85b6ef8 | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCIn/Instance.php#L308-L334 |
19,518 | ClanCats/Core | src/bundles/Database/Handler/Driver.php | Handler_Driver.connect | public function connect( $conf )
{
$connection_params = array();
foreach( $conf as $key => $value )
{
if ( is_string( $value ) )
{
$connection_params[ '{'.$key.'}' ] = $value;
}
}
$connection_string = \CCStr::replace( $this->connection_string, $connection_params );
$this->connecti... | php | public function connect( $conf )
{
$connection_params = array();
foreach( $conf as $key => $value )
{
if ( is_string( $value ) )
{
$connection_params[ '{'.$key.'}' ] = $value;
}
}
$connection_string = \CCStr::replace( $this->connection_string, $connection_params );
$this->connecti... | [
"public",
"function",
"connect",
"(",
"$",
"conf",
")",
"{",
"$",
"connection_params",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"conf",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"value",
")",
")",
... | connect to database
@param array $conf
@return bool | [
"connect",
"to",
"database"
] | 9f6ec72c1a439de4b253d0223f1029f7f85b6ef8 | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/bundles/Database/Handler/Driver.php#L34-L61 |
19,519 | drnkwati/guzzle-promises | src/Promise.php | Promise.__callHandler | public static function __callHandler($index, $value, array $handler)
{
/** @var PromiseInterface $promise */
$promise = $handler[0];
// The promise may have been cancelled or resolved before placing
// this thunk in the queue.
if ($promise->getState() !== self::PENDING) {
... | php | public static function __callHandler($index, $value, array $handler)
{
/** @var PromiseInterface $promise */
$promise = $handler[0];
// The promise may have been cancelled or resolved before placing
// this thunk in the queue.
if ($promise->getState() !== self::PENDING) {
... | [
"public",
"static",
"function",
"__callHandler",
"(",
"$",
"index",
",",
"$",
"value",
",",
"array",
"$",
"handler",
")",
"{",
"/** @var PromiseInterface $promise */",
"$",
"promise",
"=",
"$",
"handler",
"[",
"0",
"]",
";",
"// The promise may have been cancelled... | Call a stack of handlers using a specific callback index and value.
@internal
@param int $index 1 (resolve) or 2 (reject).
@param mixed $value Value to pass to the callback.
@param array $handler Array of handler data (promise and callbacks).
@return array Returns the next group to resolve. | [
"Call",
"a",
"stack",
"of",
"handlers",
"using",
"a",
"specific",
"callback",
"index",
"and",
"value",
"."
] | e5c302747c348d618474add41c7d442bb1bfc2cf | https://github.com/drnkwati/guzzle-promises/blob/e5c302747c348d618474add41c7d442bb1bfc2cf/src/Promise.php#L193-L219 |
19,520 | inc2734/wp-share-buttons | src/App/Contract/Model/Requester.php | Requester._add_localize_script | public function _add_localize_script() {
$handle = get_template();
if ( ! wp_script_is( get_template() ) && wp_script_is( get_stylesheet() ) ) {
$handle = get_stylesheet();
}
$handle = apply_filters( 'inc2734_wp_share_buttons_localize_script_handle', $handle );
wp_localize_script(
$handle,
'inc2734_... | php | public function _add_localize_script() {
$handle = get_template();
if ( ! wp_script_is( get_template() ) && wp_script_is( get_stylesheet() ) ) {
$handle = get_stylesheet();
}
$handle = apply_filters( 'inc2734_wp_share_buttons_localize_script_handle', $handle );
wp_localize_script(
$handle,
'inc2734_... | [
"public",
"function",
"_add_localize_script",
"(",
")",
"{",
"$",
"handle",
"=",
"get_template",
"(",
")",
";",
"if",
"(",
"!",
"wp_script_is",
"(",
"get_template",
"(",
")",
")",
"&&",
"wp_script_is",
"(",
"get_stylesheet",
"(",
")",
")",
")",
"{",
"$",... | Setup localize script
@return void | [
"Setup",
"localize",
"script"
] | cd032893ca083a343f5871e855cce68f4ede3a17 | https://github.com/inc2734/wp-share-buttons/blob/cd032893ca083a343f5871e855cce68f4ede3a17/src/App/Contract/Model/Requester.php#L44-L60 |
19,521 | CakeCMS/Core | src/Utility/Macros.php | Macros.get | public function get($key = null)
{
if (Arr::key($key, $this->_data)) {
return $this->_data[$key];
}
return $this->_data;
} | php | public function get($key = null)
{
if (Arr::key($key, $this->_data)) {
return $this->_data[$key];
}
return $this->_data;
} | [
"public",
"function",
"get",
"(",
"$",
"key",
"=",
"null",
")",
"{",
"if",
"(",
"Arr",
"::",
"key",
"(",
"$",
"key",
",",
"$",
"this",
"->",
"_data",
")",
")",
"{",
"return",
"$",
"this",
"->",
"_data",
"[",
"$",
"key",
"]",
";",
"}",
"return... | Get replacement val or all list.
@param null|string|int $key
@return array | [
"Get",
"replacement",
"val",
"or",
"all",
"list",
"."
] | f9cba7aa0043a10e5c35bd45fbad158688a09a96 | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/Utility/Macros.php#L60-L67 |
19,522 | CakeCMS/Core | src/Utility/Macros.php | Macros.set | public function set($key, $val)
{
$this->_data = Hash::merge([$key => $val], $this->_data);
return $this;
} | php | public function set($key, $val)
{
$this->_data = Hash::merge([$key => $val], $this->_data);
return $this;
} | [
"public",
"function",
"set",
"(",
"$",
"key",
",",
"$",
"val",
")",
"{",
"$",
"this",
"->",
"_data",
"=",
"Hash",
"::",
"merge",
"(",
"[",
"$",
"key",
"=>",
"$",
"val",
"]",
",",
"$",
"this",
"->",
"_data",
")",
";",
"return",
"$",
"this",
";... | Add new value in list.
@param string|int $key
@param string|int $val
@return $this | [
"Add",
"new",
"value",
"in",
"list",
"."
] | f9cba7aa0043a10e5c35bd45fbad158688a09a96 | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/Utility/Macros.php#L76-L80 |
19,523 | CakeCMS/Core | src/Utility/Macros.php | Macros.text | public function text($text)
{
foreach ($this->_data as $macros => $value) {
$macros = '{' . $macros . '}';
$text = preg_replace('#' . $macros . '#ius', $value, $text);
}
return $text;
} | php | public function text($text)
{
foreach ($this->_data as $macros => $value) {
$macros = '{' . $macros . '}';
$text = preg_replace('#' . $macros . '#ius', $value, $text);
}
return $text;
} | [
"public",
"function",
"text",
"(",
"$",
"text",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"_data",
"as",
"$",
"macros",
"=>",
"$",
"value",
")",
"{",
"$",
"macros",
"=",
"'{'",
".",
"$",
"macros",
".",
"'}'",
";",
"$",
"text",
"=",
"preg_repla... | Get replacement text.
@param string $text
@return string mixed | [
"Get",
"replacement",
"text",
"."
] | f9cba7aa0043a10e5c35bd45fbad158688a09a96 | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/Utility/Macros.php#L88-L96 |
19,524 | lode/fem | src/page.php | page.exception | public function exception($exception, $user_message=null) {
if ($exception instanceof \Exception == false) {
return $this->error('unknown exception format', response::STATUS_INTERNAL_SERVER_ERROR);
}
$exception_class = bootstrap::get_library('exception');
$this->data['exception']['current'] = $exception;
$th... | php | public function exception($exception, $user_message=null) {
if ($exception instanceof \Exception == false) {
return $this->error('unknown exception format', response::STATUS_INTERNAL_SERVER_ERROR);
}
$exception_class = bootstrap::get_library('exception');
$this->data['exception']['current'] = $exception;
$th... | [
"public",
"function",
"exception",
"(",
"$",
"exception",
",",
"$",
"user_message",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"exception",
"instanceof",
"\\",
"Exception",
"==",
"false",
")",
"{",
"return",
"$",
"this",
"->",
"error",
"(",
"'unknown exception... | show an error page using an exception
@param object $exception one that extends \Exception
@param string $user_message optional, human-friendly message to show to the user
@return void script execution terminates | [
"show",
"an",
"error",
"page",
"using",
"an",
"exception"
] | c1c466c1a904d99452b341c5ae7cbc3e22b106e1 | https://github.com/lode/fem/blob/c1c466c1a904d99452b341c5ae7cbc3e22b106e1/src/page.php#L35-L54 |
19,525 | lode/fem | src/page.php | page.error | public function error($reason=null, $code=response::STATUS_INTERNAL_SERVER_ERROR, $user_message=null) {
$response = bootstrap::get_library('response');
$error_data = [
'status_code' => $code,
'status_message' => $response::get_status_message($code),
];
$error_data['status_code_is_'.$code] = true;
if ($u... | php | public function error($reason=null, $code=response::STATUS_INTERNAL_SERVER_ERROR, $user_message=null) {
$response = bootstrap::get_library('response');
$error_data = [
'status_code' => $code,
'status_message' => $response::get_status_message($code),
];
$error_data['status_code_is_'.$code] = true;
if ($u... | [
"public",
"function",
"error",
"(",
"$",
"reason",
"=",
"null",
",",
"$",
"code",
"=",
"response",
"::",
"STATUS_INTERNAL_SERVER_ERROR",
",",
"$",
"user_message",
"=",
"null",
")",
"{",
"$",
"response",
"=",
"bootstrap",
"::",
"get_library",
"(",
"'response'... | show an error page
@param string $reason technical description, only shown on development environments
@param int $code http status code, @see response::STATUS_*
@param string $user_message optional, human-friendly message to show to the user
@return void script execution terminates | [
"show",
"an",
"error",
"page"
] | c1c466c1a904d99452b341c5ae7cbc3e22b106e1 | https://github.com/lode/fem/blob/c1c466c1a904d99452b341c5ae7cbc3e22b106e1/src/page.php#L64-L118 |
19,526 | lode/fem | src/page.php | page.show_default_error | private static function show_default_error($error_data) {
$template_path = \alsvanzelf\fem\ROOT_DIR.'vendor/alsvanzelf/fem/src/templates/default_error.html';
$template_content = file_get_contents($template_path);
$renderer = new \Mustache_Engine();
echo $renderer->render($template_content, $error_data);
} | php | private static function show_default_error($error_data) {
$template_path = \alsvanzelf\fem\ROOT_DIR.'vendor/alsvanzelf/fem/src/templates/default_error.html';
$template_content = file_get_contents($template_path);
$renderer = new \Mustache_Engine();
echo $renderer->render($template_content, $error_data);
} | [
"private",
"static",
"function",
"show_default_error",
"(",
"$",
"error_data",
")",
"{",
"$",
"template_path",
"=",
"\\",
"alsvanzelf",
"\\",
"fem",
"\\",
"ROOT_DIR",
".",
"'vendor/alsvanzelf/fem/src/templates/default_error.html'",
";",
"$",
"template_content",
"=",
"... | shows a default error template in case no specific one is set
@param array $error_data as build up in ::error()
@return void however, mustache has echo'd the html | [
"shows",
"a",
"default",
"error",
"template",
"in",
"case",
"no",
"specific",
"one",
"is",
"set"
] | c1c466c1a904d99452b341c5ae7cbc3e22b106e1 | https://github.com/lode/fem/blob/c1c466c1a904d99452b341c5ae7cbc3e22b106e1/src/page.php#L126-L132 |
19,527 | joseph-walker/vector | src/Lib/Logic.php | Logic.__orCombinator | protected static function __orCombinator(array $fs, $a)
{
return self::any(Arrays::map(function ($c) use ($a) {
return $c($a);
}, $fs));
} | php | protected static function __orCombinator(array $fs, $a)
{
return self::any(Arrays::map(function ($c) use ($a) {
return $c($a);
}, $fs));
} | [
"protected",
"static",
"function",
"__orCombinator",
"(",
"array",
"$",
"fs",
",",
"$",
"a",
")",
"{",
"return",
"self",
"::",
"any",
"(",
"Arrays",
"::",
"map",
"(",
"function",
"(",
"$",
"c",
")",
"use",
"(",
"$",
"a",
")",
"{",
"return",
"$",
... | Logical Or Combinator
Given n functions {f1, f2, ..., fn}, combine them in such a way to produce a new
function g that returns true given at least one of {f1(x), f2(x), ... fn(x)} return true.
@example
$funcF = function($x) { return $x >= 5; };
$funcG = function($x) { return $x == 0; };
$combinator = Logic::orCombina... | [
"Logical",
"Or",
"Combinator"
] | e349aa2e9e0535b1993f9fffc0476e7fd8e113fc | https://github.com/joseph-walker/vector/blob/e349aa2e9e0535b1993f9fffc0476e7fd8e113fc/src/Lib/Logic.php#L48-L53 |
19,528 | joseph-walker/vector | src/Lib/Logic.php | Logic.__andCombinator | protected static function __andCombinator(array $fs, $a)
{
return self::all(Arrays::map(function ($c) use ($a) {
return $c($a);
}, $fs));
} | php | protected static function __andCombinator(array $fs, $a)
{
return self::all(Arrays::map(function ($c) use ($a) {
return $c($a);
}, $fs));
} | [
"protected",
"static",
"function",
"__andCombinator",
"(",
"array",
"$",
"fs",
",",
"$",
"a",
")",
"{",
"return",
"self",
"::",
"all",
"(",
"Arrays",
"::",
"map",
"(",
"function",
"(",
"$",
"c",
")",
"use",
"(",
"$",
"a",
")",
"{",
"return",
"$",
... | Logical And Combinator
Given n functions {f1, f2, ..., fn}, combine them in such a way to produce a new
function g that returns true given {f1(x), f2(x), ... fn(x)} all return true.
@example
$funcF = function($x) { return $x < 5; };
$funcG = function($x) { return $x > 0; };
$combinator = Logic::andCombinator([$funcF,... | [
"Logical",
"And",
"Combinator"
] | e349aa2e9e0535b1993f9fffc0476e7fd8e113fc | https://github.com/joseph-walker/vector/blob/e349aa2e9e0535b1993f9fffc0476e7fd8e113fc/src/Lib/Logic.php#L75-L80 |
19,529 | yuncms/framework | src/models/BaseUser.php | BaseUser.loadAllowance | public function loadAllowance($request, $action)
{
$allowance = Yii::$app->cache->get($action->controller->id . ':' . $action->id . ':' . $this->id . '_allowance');
$allowanceUpdatedAt = Yii::$app->cache->get($action->controller->id . ':' . $action->id . ':' . $this->id . '_allowance_update_at');
... | php | public function loadAllowance($request, $action)
{
$allowance = Yii::$app->cache->get($action->controller->id . ':' . $action->id . ':' . $this->id . '_allowance');
$allowanceUpdatedAt = Yii::$app->cache->get($action->controller->id . ':' . $action->id . ':' . $this->id . '_allowance_update_at');
... | [
"public",
"function",
"loadAllowance",
"(",
"$",
"request",
",",
"$",
"action",
")",
"{",
"$",
"allowance",
"=",
"Yii",
"::",
"$",
"app",
"->",
"cache",
"->",
"get",
"(",
"$",
"action",
"->",
"controller",
"->",
"id",
".",
"':'",
".",
"$",
"action",
... | Loads the number of allowed requests and the corresponding timestamp from a persistent storage.
@param \yii\web\Request $request the current request
@param \yii\base\Action $action the action to be executed
@return array an array of two elements. The first element is the number of allowed requests,
and the second eleme... | [
"Loads",
"the",
"number",
"of",
"allowed",
"requests",
"and",
"the",
"corresponding",
"timestamp",
"from",
"a",
"persistent",
"storage",
"."
] | af42e28ea4ae15ab8eead3f6d119f93863b94154 | https://github.com/yuncms/framework/blob/af42e28ea4ae15ab8eead3f6d119f93863b94154/src/models/BaseUser.php#L444-L453 |
19,530 | yuncms/framework | src/models/BaseUser.php | BaseUser.saveAllowance | public function saveAllowance($request, $action, $allowance, $timestamp)
{
Yii::$app->cache->set($action->controller->id . ':' . $action->id . ':' . $this->id . '_allowance', $allowance, 60);
Yii::$app->cache->set($action->controller->id . ':' . $action->id . ':' . $this->id . '_allowance_update_at'... | php | public function saveAllowance($request, $action, $allowance, $timestamp)
{
Yii::$app->cache->set($action->controller->id . ':' . $action->id . ':' . $this->id . '_allowance', $allowance, 60);
Yii::$app->cache->set($action->controller->id . ':' . $action->id . ':' . $this->id . '_allowance_update_at'... | [
"public",
"function",
"saveAllowance",
"(",
"$",
"request",
",",
"$",
"action",
",",
"$",
"allowance",
",",
"$",
"timestamp",
")",
"{",
"Yii",
"::",
"$",
"app",
"->",
"cache",
"->",
"set",
"(",
"$",
"action",
"->",
"controller",
"->",
"id",
".",
"':'... | Saves the number of allowed requests and the corresponding timestamp to a persistent storage.
@param \yii\web\Request $request the current request
@param \yii\base\Action $action the action to be executed
@param int $allowance the number of allowed requests remaining.
@param int $timestamp the current timestamp. | [
"Saves",
"the",
"number",
"of",
"allowed",
"requests",
"and",
"the",
"corresponding",
"timestamp",
"to",
"a",
"persistent",
"storage",
"."
] | af42e28ea4ae15ab8eead3f6d119f93863b94154 | https://github.com/yuncms/framework/blob/af42e28ea4ae15ab8eead3f6d119f93863b94154/src/models/BaseUser.php#L462-L466 |
19,531 | necrox87/yii2-nudity-detector | Image.php | Image.rgbXY | public function rgbXY($x, $y) {
$color = $this->colorXY($x, $y);
return array(($color >> 16) & 0xFF, ($color >> 8) & 0xFF, $color & 0xFF);
} | php | public function rgbXY($x, $y) {
$color = $this->colorXY($x, $y);
return array(($color >> 16) & 0xFF, ($color >> 8) & 0xFF, $color & 0xFF);
} | [
"public",
"function",
"rgbXY",
"(",
"$",
"x",
",",
"$",
"y",
")",
"{",
"$",
"color",
"=",
"$",
"this",
"->",
"colorXY",
"(",
"$",
"x",
",",
"$",
"y",
")",
";",
"return",
"array",
"(",
"(",
"$",
"color",
">>",
"16",
")",
"&",
"0xFF",
",",
"(... | Returns RGB array of pixel's color
@param int $x
@param int $y | [
"Returns",
"RGB",
"array",
"of",
"pixel",
"s",
"color"
] | 59474b1480f5ed53a17f06551318d30c3765d143 | https://github.com/necrox87/yii2-nudity-detector/blob/59474b1480f5ed53a17f06551318d30c3765d143/Image.php#L110-L113 |
19,532 | necrox87/yii2-nudity-detector | Image.php | Image.create | public function create() {
switch($this->info[2]) {
case IMAGETYPE_JPEG:
$this->resource = imagecreatefromjpeg($this->file);
break;
case IMAGETYPE_GIF:
$this->resource = imagecreatefromgif($this->file);
break;
ca... | php | public function create() {
switch($this->info[2]) {
case IMAGETYPE_JPEG:
$this->resource = imagecreatefromjpeg($this->file);
break;
case IMAGETYPE_GIF:
$this->resource = imagecreatefromgif($this->file);
break;
ca... | [
"public",
"function",
"create",
"(",
")",
"{",
"switch",
"(",
"$",
"this",
"->",
"info",
"[",
"2",
"]",
")",
"{",
"case",
"IMAGETYPE_JPEG",
":",
"$",
"this",
"->",
"resource",
"=",
"imagecreatefromjpeg",
"(",
"$",
"this",
"->",
"file",
")",
";",
"bre... | Create an image resource | [
"Create",
"an",
"image",
"resource"
] | 59474b1480f5ed53a17f06551318d30c3765d143 | https://github.com/necrox87/yii2-nudity-detector/blob/59474b1480f5ed53a17f06551318d30c3765d143/Image.php#L119-L134 |
19,533 | necrox87/yii2-nudity-detector | Image.php | Image.save | public function save($file, $type = IMAGETYPE_JPEG, $quality = 75,
$permissions = false) {
// create directory if necessary
$dir = dirname($file);
if(!file_exists($dir)) {
$mask = umask();
mkdir($dir, 0777, true);
umask($mask);
... | php | public function save($file, $type = IMAGETYPE_JPEG, $quality = 75,
$permissions = false) {
// create directory if necessary
$dir = dirname($file);
if(!file_exists($dir)) {
$mask = umask();
mkdir($dir, 0777, true);
umask($mask);
... | [
"public",
"function",
"save",
"(",
"$",
"file",
",",
"$",
"type",
"=",
"IMAGETYPE_JPEG",
",",
"$",
"quality",
"=",
"75",
",",
"$",
"permissions",
"=",
"false",
")",
"{",
"// create directory if necessary",
"$",
"dir",
"=",
"dirname",
"(",
"$",
"file",
")... | Save image to file
@param string $file File path
@param int $type Image type constant
@param int $quality JPEG compression quality from 0 to 100
@param int $permissions Unix file permissions | [
"Save",
"image",
"to",
"file"
] | 59474b1480f5ed53a17f06551318d30c3765d143 | https://github.com/necrox87/yii2-nudity-detector/blob/59474b1480f5ed53a17f06551318d30c3765d143/Image.php#L162-L193 |
19,534 | necrox87/yii2-nudity-detector | Image.php | Image.fitResize | public function fitResize($max_width = 150, $max_height = 150, $min_width = 20, $min_height = 20) {
$kw = $max_width / $this->width();
$kh = $max_height / $this->height();
if($kw > $kh) {
$new_h = $max_height;
$new_w = round($kh * $this->width());
} else {
... | php | public function fitResize($max_width = 150, $max_height = 150, $min_width = 20, $min_height = 20) {
$kw = $max_width / $this->width();
$kh = $max_height / $this->height();
if($kw > $kh) {
$new_h = $max_height;
$new_w = round($kh * $this->width());
} else {
... | [
"public",
"function",
"fitResize",
"(",
"$",
"max_width",
"=",
"150",
",",
"$",
"max_height",
"=",
"150",
",",
"$",
"min_width",
"=",
"20",
",",
"$",
"min_height",
"=",
"20",
")",
"{",
"$",
"kw",
"=",
"$",
"max_width",
"/",
"$",
"this",
"->",
"widt... | Fit the image with the same proportion into an area
@param int $max_width
@param int $max_height
@param int $min_width
@param int $min_height
@return Image | [
"Fit",
"the",
"image",
"with",
"the",
"same",
"proportion",
"into",
"an",
"area"
] | 59474b1480f5ed53a17f06551318d30c3765d143 | https://github.com/necrox87/yii2-nudity-detector/blob/59474b1480f5ed53a17f06551318d30c3765d143/Image.php#L258-L272 |
19,535 | necrox87/yii2-nudity-detector | Image.php | Image.scaleResize | public function scaleResize($width, $height) {
// calculate source coordinates
$kw = $this->width() / $width;
$kh = $this->height() / $height;
if($kh < $kw) {
$src_h = $this->height();
$src_y = 0;
$src_w = round($kh * $width);
$src_x = rou... | php | public function scaleResize($width, $height) {
// calculate source coordinates
$kw = $this->width() / $width;
$kh = $this->height() / $height;
if($kh < $kw) {
$src_h = $this->height();
$src_y = 0;
$src_w = round($kh * $width);
$src_x = rou... | [
"public",
"function",
"scaleResize",
"(",
"$",
"width",
",",
"$",
"height",
")",
"{",
"// calculate source coordinates",
"$",
"kw",
"=",
"$",
"this",
"->",
"width",
"(",
")",
"/",
"$",
"width",
";",
"$",
"kh",
"=",
"$",
"this",
"->",
"height",
"(",
"... | Resize image correctly scaled and than crop
the necessary area
@param int $width New width
@param int $height New height | [
"Resize",
"image",
"correctly",
"scaled",
"and",
"than",
"crop",
"the",
"necessary",
"area"
] | 59474b1480f5ed53a17f06551318d30c3765d143 | https://github.com/necrox87/yii2-nudity-detector/blob/59474b1480f5ed53a17f06551318d30c3765d143/Image.php#L281-L306 |
19,536 | okitcom/ok-lib-php | src/Service/BaseService.php | BaseService.getAttribute | public function getAttribute($attributes, $name) {
foreach($attributes as $a) {
if ($a->key == $name) {
return $a->value;
}
}
return null;
} | php | public function getAttribute($attributes, $name) {
foreach($attributes as $a) {
if ($a->key == $name) {
return $a->value;
}
}
return null;
} | [
"public",
"function",
"getAttribute",
"(",
"$",
"attributes",
",",
"$",
"name",
")",
"{",
"foreach",
"(",
"$",
"attributes",
"as",
"$",
"a",
")",
"{",
"if",
"(",
"$",
"a",
"->",
"key",
"==",
"$",
"name",
")",
"{",
"return",
"$",
"a",
"->",
"value... | Returns the value of attribute with name
@param $attributes array of attributes
@param $name string Attribute's name
@return mixed Attribute value | [
"Returns",
"the",
"value",
"of",
"attribute",
"with",
"name"
] | 1f441f3d216af7c952788e864bfe66bc4f089467 | https://github.com/okitcom/ok-lib-php/blob/1f441f3d216af7c952788e864bfe66bc4f089467/src/Service/BaseService.php#L33-L40 |
19,537 | shiftio/safestream-php-sdk | src/Http/SafeStreamHttpClient.php | SafeStreamHttpClient.getAuthToken | public function getAuthToken() {
try {
$response = $this->client->request('GET', "authenticate/accessToken", ['headers' => [
'x-api-client-id' => $this->clientId,
'x-api-key' => $this->apiKey
]]);
$this->authToken = json_decode($response->getB... | php | public function getAuthToken() {
try {
$response = $this->client->request('GET', "authenticate/accessToken", ['headers' => [
'x-api-client-id' => $this->clientId,
'x-api-key' => $this->apiKey
]]);
$this->authToken = json_decode($response->getB... | [
"public",
"function",
"getAuthToken",
"(",
")",
"{",
"try",
"{",
"$",
"response",
"=",
"$",
"this",
"->",
"client",
"->",
"request",
"(",
"'GET'",
",",
"\"authenticate/accessToken\"",
",",
"[",
"'headers'",
"=>",
"[",
"'x-api-client-id'",
"=>",
"$",
"this",
... | Gets an authorization token using the clients API key. Most requests to the SafeStream API
require an authorization token.
@return mixed: The JSON decoded response
@throws SafeStreamHttpAuthException
@throws SafeStreamHttpBadRequestException
@throws SafeStreamHttpException
@throws SafeStreamHttpThrottleException | [
"Gets",
"an",
"authorization",
"token",
"using",
"the",
"clients",
"API",
"key",
".",
"Most",
"requests",
"to",
"the",
"SafeStream",
"API",
"require",
"an",
"authorization",
"token",
"."
] | 1957cd5574725b24da1bbff9059aa30a9ca123c2 | https://github.com/shiftio/safestream-php-sdk/blob/1957cd5574725b24da1bbff9059aa30a9ca123c2/src/Http/SafeStreamHttpClient.php#L167-L180 |
19,538 | jacobemerick/pqp | src/Display.php | Display.getReadableTime | protected function getReadableTime($time, $percision = 3)
{
$unit = 's';
if ($time < 1) {
$time *= 1000;
$percision = 0;
$unit = 'ms';
} elseif ($time > 60) {
$time /= 60;
$unit = 'm';
}
$time = number_format($time, ... | php | protected function getReadableTime($time, $percision = 3)
{
$unit = 's';
if ($time < 1) {
$time *= 1000;
$percision = 0;
$unit = 'ms';
} elseif ($time > 60) {
$time /= 60;
$unit = 'm';
}
$time = number_format($time, ... | [
"protected",
"function",
"getReadableTime",
"(",
"$",
"time",
",",
"$",
"percision",
"=",
"3",
")",
"{",
"$",
"unit",
"=",
"'s'",
";",
"if",
"(",
"$",
"time",
"<",
"1",
")",
"{",
"$",
"time",
"*=",
"1000",
";",
"$",
"percision",
"=",
"0",
";",
... | Formatter for human-readable time
Only handles time up to 60 minutes gracefully
@param double $time
@param integer $percision
@return string | [
"Formatter",
"for",
"human",
"-",
"readable",
"time",
"Only",
"handles",
"time",
"up",
"to",
"60",
"minutes",
"gracefully"
] | 08276f050425d1ab71e7ca3b897eb8c409ccbe70 | https://github.com/jacobemerick/pqp/blob/08276f050425d1ab71e7ca3b897eb8c409ccbe70/src/Display.php#L311-L324 |
19,539 | jacobemerick/pqp | src/Display.php | Display.getReadableMemory | protected function getReadableMemory($size, $percision = 2)
{
$unitOptions = array('b', 'k', 'M', 'G');
$base = log($size, 1024);
$memory = round(pow(1024, $base - floor($base)), $percision);
$unit = $unitOptions[floor($base)];
return "{$memory} {$unit}";
} | php | protected function getReadableMemory($size, $percision = 2)
{
$unitOptions = array('b', 'k', 'M', 'G');
$base = log($size, 1024);
$memory = round(pow(1024, $base - floor($base)), $percision);
$unit = $unitOptions[floor($base)];
return "{$memory} {$unit}";
} | [
"protected",
"function",
"getReadableMemory",
"(",
"$",
"size",
",",
"$",
"percision",
"=",
"2",
")",
"{",
"$",
"unitOptions",
"=",
"array",
"(",
"'b'",
",",
"'k'",
",",
"'M'",
",",
"'G'",
")",
";",
"$",
"base",
"=",
"log",
"(",
"$",
"size",
",",
... | Formatter for human-readable memory
Only handles time up to a few gigs gracefully
@param double $size
@param integer $percision | [
"Formatter",
"for",
"human",
"-",
"readable",
"memory",
"Only",
"handles",
"time",
"up",
"to",
"a",
"few",
"gigs",
"gracefully"
] | 08276f050425d1ab71e7ca3b897eb8c409ccbe70 | https://github.com/jacobemerick/pqp/blob/08276f050425d1ab71e7ca3b897eb8c409ccbe70/src/Display.php#L333-L342 |
19,540 | hendrikmaus/reynaldo | src/Elements/BaseElement.php | BaseElement.addContentElement | public function addContentElement(ApiElement $element)
{
$newContent = [];
$rawElements = [];
$content = $this->getContent();
if ($this->hasCopy()) {
$newContent[] = array_shift($content);
}
foreach ($content as $resourceGroup) {
if (!is_arra... | php | public function addContentElement(ApiElement $element)
{
$newContent = [];
$rawElements = [];
$content = $this->getContent();
if ($this->hasCopy()) {
$newContent[] = array_shift($content);
}
foreach ($content as $resourceGroup) {
if (!is_arra... | [
"public",
"function",
"addContentElement",
"(",
"ApiElement",
"$",
"element",
")",
"{",
"$",
"newContent",
"=",
"[",
"]",
";",
"$",
"rawElements",
"=",
"[",
"]",
";",
"$",
"content",
"=",
"$",
"this",
"->",
"getContent",
"(",
")",
";",
"if",
"(",
"$"... | Add content element to the current content
This method has to be used sequentially while querying the recursive
element tree. It will replace the raw content element one by one, top to bottom.
Example:
- copy element
- raw array element (1)
- raw array element (2)
Calling `addContentElement` with a resource element... | [
"Add",
"content",
"element",
"to",
"the",
"current",
"content"
] | be100f56e8f39d86d16ce9222838d20f462e8678 | https://github.com/hendrikmaus/reynaldo/blob/be100f56e8f39d86d16ce9222838d20f462e8678/src/Elements/BaseElement.php#L52-L74 |
19,541 | hendrikmaus/reynaldo | src/Elements/BaseElement.php | BaseElement.getCopyText | public function getCopyText()
{
$content = $this->getContent();
$copy = array_shift($content);
if (!is_array($copy)) {
return null;
}
if ($copy['element'] !== 'copy') {
return null;
}
return $copy['content'];
} | php | public function getCopyText()
{
$content = $this->getContent();
$copy = array_shift($content);
if (!is_array($copy)) {
return null;
}
if ($copy['element'] !== 'copy') {
return null;
}
return $copy['content'];
} | [
"public",
"function",
"getCopyText",
"(",
")",
"{",
"$",
"content",
"=",
"$",
"this",
"->",
"getContent",
"(",
")",
";",
"$",
"copy",
"=",
"array_shift",
"(",
"$",
"content",
")",
";",
"if",
"(",
"!",
"is_array",
"(",
"$",
"copy",
")",
")",
"{",
... | Get the copy text of the current element; raw markdown likely
@api
@return string|null | [
"Get",
"the",
"copy",
"text",
"of",
"the",
"current",
"element",
";",
"raw",
"markdown",
"likely"
] | be100f56e8f39d86d16ce9222838d20f462e8678 | https://github.com/hendrikmaus/reynaldo/blob/be100f56e8f39d86d16ce9222838d20f462e8678/src/Elements/BaseElement.php#L109-L123 |
19,542 | hendrikmaus/reynaldo | src/Elements/BaseElement.php | BaseElement.hasClass | public function hasClass($className)
{
foreach ($this->meta['classes'] as $classInMeta) {
if ($classInMeta === $className) {
return true;
}
}
return false;
} | php | public function hasClass($className)
{
foreach ($this->meta['classes'] as $classInMeta) {
if ($classInMeta === $className) {
return true;
}
}
return false;
} | [
"public",
"function",
"hasClass",
"(",
"$",
"className",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"meta",
"[",
"'classes'",
"]",
"as",
"$",
"classInMeta",
")",
"{",
"if",
"(",
"$",
"classInMeta",
"===",
"$",
"className",
")",
"{",
"return",
"true",... | Check whether or not this element has a given class
@param string $className e.g. 'resourceGroup', 'messageBody'
@return bool | [
"Check",
"whether",
"or",
"not",
"this",
"element",
"has",
"a",
"given",
"class"
] | be100f56e8f39d86d16ce9222838d20f462e8678 | https://github.com/hendrikmaus/reynaldo/blob/be100f56e8f39d86d16ce9222838d20f462e8678/src/Elements/BaseElement.php#L199-L208 |
19,543 | webforge-labs/psc-cms | lib/PHPWord/PHPWord/Section.php | PHPWord_Section.addTOC | public function addTOC($styleFont = null, $styleTOC = null) {
$toc = new PHPWord_TOC($styleFont, $styleTOC);
$this->_elementCollection[] = $toc;
return $toc;
} | php | public function addTOC($styleFont = null, $styleTOC = null) {
$toc = new PHPWord_TOC($styleFont, $styleTOC);
$this->_elementCollection[] = $toc;
return $toc;
} | [
"public",
"function",
"addTOC",
"(",
"$",
"styleFont",
"=",
"null",
",",
"$",
"styleTOC",
"=",
"null",
")",
"{",
"$",
"toc",
"=",
"new",
"PHPWord_TOC",
"(",
"$",
"styleFont",
",",
"$",
"styleTOC",
")",
";",
"$",
"this",
"->",
"_elementCollection",
"[",... | Add a Table-of-Contents Element
@param mixed $styleFont
@param mixed $styleTOC
@return PHPWord_TOC | [
"Add",
"a",
"Table",
"-",
"of",
"-",
"Contents",
"Element"
] | 467bfa2547e6b4fa487d2d7f35fa6cc618dbc763 | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/PHPWord/PHPWord/Section.php#L269-L273 |
19,544 | webforge-labs/psc-cms | lib/PHPWord/PHPWord/Section.php | PHPWord_Section.addTitle | public function addTitle($text, $depth = 1) {
$styles = PHPWord_Style::getStyles();
if(array_key_exists('Heading_'.$depth, $styles)) {
$style = 'Heading'.$depth;
} else {
$style = null;
}
$title = new PHPWord_Section_Title($text, $depth, $style);
$data = PHPWord_TOC::addTitle($text, $depth);
$... | php | public function addTitle($text, $depth = 1) {
$styles = PHPWord_Style::getStyles();
if(array_key_exists('Heading_'.$depth, $styles)) {
$style = 'Heading'.$depth;
} else {
$style = null;
}
$title = new PHPWord_Section_Title($text, $depth, $style);
$data = PHPWord_TOC::addTitle($text, $depth);
$... | [
"public",
"function",
"addTitle",
"(",
"$",
"text",
",",
"$",
"depth",
"=",
"1",
")",
"{",
"$",
"styles",
"=",
"PHPWord_Style",
"::",
"getStyles",
"(",
")",
";",
"if",
"(",
"array_key_exists",
"(",
"'Heading_'",
".",
"$",
"depth",
",",
"$",
"styles",
... | Add a Title Element
@param string $text
@param int $depth
@return PHPWord_Section_Title | [
"Add",
"a",
"Title",
"Element"
] | 467bfa2547e6b4fa487d2d7f35fa6cc618dbc763 | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/PHPWord/PHPWord/Section.php#L282-L301 |
19,545 | dreamfactorysoftware/df-file | src/Components/RemoteFileSystem.php | RemoteFileSystem.deleteContainers | public function deleteContainers($containers, $force = false)
{
if (!empty($containers)) {
if (!isset($containers[0])) {
// single folder, make into array
$containers = [$containers];
}
foreach ($containers as $key => $folder) {
... | php | public function deleteContainers($containers, $force = false)
{
if (!empty($containers)) {
if (!isset($containers[0])) {
// single folder, make into array
$containers = [$containers];
}
foreach ($containers as $key => $folder) {
... | [
"public",
"function",
"deleteContainers",
"(",
"$",
"containers",
",",
"$",
"force",
"=",
"false",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"containers",
")",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"containers",
"[",
"0",
"]",
")",
")",
... | Delete multiple containers and all of their content
@param array $containers
@param bool $force Force a delete if it is not empty
@throws DfException
@return array | [
"Delete",
"multiple",
"containers",
"and",
"all",
"of",
"their",
"content"
] | e78aaec3e1d6585b5e7fe9b7646af4b1180ecd66 | https://github.com/dreamfactorysoftware/df-file/blob/e78aaec3e1d6585b5e7fe9b7646af4b1180ecd66/src/Components/RemoteFileSystem.php#L79-L103 |
19,546 | geekwright/Po | src/PoInitAbstract.php | PoInitAbstract.msginitFile | public function msginitFile(string $filename): PoFile
{
if (!is_readable($filename)) {
$source = false;
} else {
$source = file_get_contents($filename);
}
if (false===$source) {
throw new FileNotReadableException($filename);
}
retur... | php | public function msginitFile(string $filename): PoFile
{
if (!is_readable($filename)) {
$source = false;
} else {
$source = file_get_contents($filename);
}
if (false===$source) {
throw new FileNotReadableException($filename);
}
retur... | [
"public",
"function",
"msginitFile",
"(",
"string",
"$",
"filename",
")",
":",
"PoFile",
"{",
"if",
"(",
"!",
"is_readable",
"(",
"$",
"filename",
")",
")",
"{",
"$",
"source",
"=",
"false",
";",
"}",
"else",
"{",
"$",
"source",
"=",
"file_get_contents... | Inspect the supplied source file, capture gettext references as a PoFile object
@param string $filename name of source file
@return PoFile
@throws FileNotReadableException | [
"Inspect",
"the",
"supplied",
"source",
"file",
"capture",
"gettext",
"references",
"as",
"a",
"PoFile",
"object"
] | 9474d059a83b64e6242cc41e5c5b7a08bc57e4e2 | https://github.com/geekwright/Po/blob/9474d059a83b64e6242cc41e5c5b7a08bc57e4e2/src/PoInitAbstract.php#L173-L184 |
19,547 | geekwright/Po | src/PoInitAbstract.php | PoInitAbstract.escapeForPo | public function escapeForPo(string $string): string
{
if ($string[0]=='"' || $string[0]=="'") {
$string = substr($string, 1, -1);
}
$string = str_replace("\r\n", "\n", $string);
$string = stripcslashes($string);
return addcslashes($string, "\0..\37\"");
} | php | public function escapeForPo(string $string): string
{
if ($string[0]=='"' || $string[0]=="'") {
$string = substr($string, 1, -1);
}
$string = str_replace("\r\n", "\n", $string);
$string = stripcslashes($string);
return addcslashes($string, "\0..\37\"");
} | [
"public",
"function",
"escapeForPo",
"(",
"string",
"$",
"string",
")",
":",
"string",
"{",
"if",
"(",
"$",
"string",
"[",
"0",
"]",
"==",
"'\"'",
"||",
"$",
"string",
"[",
"0",
"]",
"==",
"\"'\"",
")",
"{",
"$",
"string",
"=",
"substr",
"(",
"$"... | Prepare a string from tokenized output for use in a po file. Remove any
surrounding quotes, escape control characters and double quotes.
@param string $string raw string (T_STRING) identified by php token_get_all
@return string | [
"Prepare",
"a",
"string",
"from",
"tokenized",
"output",
"for",
"use",
"in",
"a",
"po",
"file",
".",
"Remove",
"any",
"surrounding",
"quotes",
"escape",
"control",
"characters",
"and",
"double",
"quotes",
"."
] | 9474d059a83b64e6242cc41e5c5b7a08bc57e4e2 | https://github.com/geekwright/Po/blob/9474d059a83b64e6242cc41e5c5b7a08bc57e4e2/src/PoInitAbstract.php#L204-L212 |
19,548 | geekwright/Po | src/PoInitAbstract.php | PoInitAbstract.checkPhpFormatFlag | public function checkPhpFormatFlag(PoEntry $entry): void
{
if (preg_match(
'#(?<!%)%(?:\d+\$)?[+-]?(?:[ 0]|\'.{1})?-?\d*(?:\.\d+)?[bcdeEufFgGosxX]#',
$entry->get(PoTokens::MESSAGE) . $entry->get(PoTokens::PLURAL)
)) {
$entry->addFlag('php-format');
}
} | php | public function checkPhpFormatFlag(PoEntry $entry): void
{
if (preg_match(
'#(?<!%)%(?:\d+\$)?[+-]?(?:[ 0]|\'.{1})?-?\d*(?:\.\d+)?[bcdeEufFgGosxX]#',
$entry->get(PoTokens::MESSAGE) . $entry->get(PoTokens::PLURAL)
)) {
$entry->addFlag('php-format');
}
} | [
"public",
"function",
"checkPhpFormatFlag",
"(",
"PoEntry",
"$",
"entry",
")",
":",
"void",
"{",
"if",
"(",
"preg_match",
"(",
"'#(?<!%)%(?:\\d+\\$)?[+-]?(?:[ 0]|\\'.{1})?-?\\d*(?:\\.\\d+)?[bcdeEufFgGosxX]#'",
",",
"$",
"entry",
"->",
"get",
"(",
"PoTokens",
"::",
"ME... | Check the supplied entry for sprintf directives and set php-format flag if found
@param PoEntry $entry entry to check
@return void | [
"Check",
"the",
"supplied",
"entry",
"for",
"sprintf",
"directives",
"and",
"set",
"php",
"-",
"format",
"flag",
"if",
"found"
] | 9474d059a83b64e6242cc41e5c5b7a08bc57e4e2 | https://github.com/geekwright/Po/blob/9474d059a83b64e6242cc41e5c5b7a08bc57e4e2/src/PoInitAbstract.php#L221-L229 |
19,549 | spiral-modules/scaffolder | source/Scaffolder/Commands/CommandCommand.php | CommandCommand.perform | public function perform()
{
/** @var CommandDeclaration $declaration */
$declaration = $this->createDeclaration(compact('alias'));
$declaration->setAlias($this->argument('alias') ?? $this->argument('name'));
$declaration->setDescription((string)$this->option('description'));
... | php | public function perform()
{
/** @var CommandDeclaration $declaration */
$declaration = $this->createDeclaration(compact('alias'));
$declaration->setAlias($this->argument('alias') ?? $this->argument('name'));
$declaration->setDescription((string)$this->option('description'));
... | [
"public",
"function",
"perform",
"(",
")",
"{",
"/** @var CommandDeclaration $declaration */",
"$",
"declaration",
"=",
"$",
"this",
"->",
"createDeclaration",
"(",
"compact",
"(",
"'alias'",
")",
")",
";",
"$",
"declaration",
"->",
"setAlias",
"(",
"$",
"this",... | Create command declaration. | [
"Create",
"command",
"declaration",
"."
] | 9be9dd0da6e4b02232db24e797fe5c288afbbddf | https://github.com/spiral-modules/scaffolder/blob/9be9dd0da6e4b02232db24e797fe5c288afbbddf/source/Scaffolder/Commands/CommandCommand.php#L36-L45 |
19,550 | Chill-project/Main | Entity/User.php | User.isGroupCenterPresentOnce | public function isGroupCenterPresentOnce(ExecutionContextInterface $context)
{
$groupCentersIds = array();
foreach ($this->getGroupCenters() as $groupCenter) {
if (in_array($groupCenter->getId(), $groupCentersIds)) {
$context->buildViolation("The user has already those pe... | php | public function isGroupCenterPresentOnce(ExecutionContextInterface $context)
{
$groupCentersIds = array();
foreach ($this->getGroupCenters() as $groupCenter) {
if (in_array($groupCenter->getId(), $groupCentersIds)) {
$context->buildViolation("The user has already those pe... | [
"public",
"function",
"isGroupCenterPresentOnce",
"(",
"ExecutionContextInterface",
"$",
"context",
")",
"{",
"$",
"groupCentersIds",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"getGroupCenters",
"(",
")",
"as",
"$",
"groupCenter",
")",
"{... | This function check that groupCenter are present only once. The validator
use this function to avoid a user to be associated to the same groupCenter
more than once. | [
"This",
"function",
"check",
"that",
"groupCenter",
"are",
"present",
"only",
"once",
".",
"The",
"validator",
"use",
"this",
"function",
"to",
"avoid",
"a",
"user",
"to",
"be",
"associated",
"to",
"the",
"same",
"groupCenter",
"more",
"than",
"once",
"."
] | 384cb6c793072a4f1047dc5cafc2157ee2419f60 | https://github.com/Chill-project/Main/blob/384cb6c793072a4f1047dc5cafc2157ee2419f60/Entity/User.php#L216-L228 |
19,551 | alanpich/slender | src/Core/Util/Util.php | Util.stringStartsWith | public static function stringStartsWith($str, $prefix)
{
if(is_array($prefix)){
foreach($prefix as $p){
if($p === "" || strpos($str, $p) === 0){
return true;
};
}
return false;
}
return $prefix === "" || ... | php | public static function stringStartsWith($str, $prefix)
{
if(is_array($prefix)){
foreach($prefix as $p){
if($p === "" || strpos($str, $p) === 0){
return true;
};
}
return false;
}
return $prefix === "" || ... | [
"public",
"static",
"function",
"stringStartsWith",
"(",
"$",
"str",
",",
"$",
"prefix",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"prefix",
")",
")",
"{",
"foreach",
"(",
"$",
"prefix",
"as",
"$",
"p",
")",
"{",
"if",
"(",
"$",
"p",
"===",
"\"\... | Does a string start with another string?
@param string $str The string to check
@param string|array $prefix The prefix to check for
@return bool | [
"Does",
"a",
"string",
"start",
"with",
"another",
"string?"
] | 247f5c08af20cda95b116eb5d9f6f623d61e8a8a | https://github.com/alanpich/slender/blob/247f5c08af20cda95b116eb5d9f6f623d61e8a8a/src/Core/Util/Util.php#L77-L88 |
19,552 | alanpich/slender | src/Core/Util/Util.php | Util.stringEndsWith | public static function stringEndsWith($str, $postfix)
{
if(is_array($postfix)){
foreach($postfix as $p){
if($p === "" || substr($str, -strlen($p)) === $p){
return true;
}
}
return false;
}
return $postfix... | php | public static function stringEndsWith($str, $postfix)
{
if(is_array($postfix)){
foreach($postfix as $p){
if($p === "" || substr($str, -strlen($p)) === $p){
return true;
}
}
return false;
}
return $postfix... | [
"public",
"static",
"function",
"stringEndsWith",
"(",
"$",
"str",
",",
"$",
"postfix",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"postfix",
")",
")",
"{",
"foreach",
"(",
"$",
"postfix",
"as",
"$",
"p",
")",
"{",
"if",
"(",
"$",
"p",
"===",
"\"... | Does a string end with another string?
@param string $str The string to check
@param string|array $postfix The postfix to check for
@return bool | [
"Does",
"a",
"string",
"end",
"with",
"another",
"string?"
] | 247f5c08af20cda95b116eb5d9f6f623d61e8a8a | https://github.com/alanpich/slender/blob/247f5c08af20cda95b116eb5d9f6f623d61e8a8a/src/Core/Util/Util.php#L98-L109 |
19,553 | 4devs/ElfinderPhpConnector | FileInfo.php | FileInfo.toArray | public function toArray()
{
$data = array(
'name' => $this->name,
'hash' => $this->hash,
'phash' => $this->phash,
'mime' => $this->mime,
'ts' => $this->ts,
'size' => $this->size,
'dirs' => $this->dirs,
'read' => ... | php | public function toArray()
{
$data = array(
'name' => $this->name,
'hash' => $this->hash,
'phash' => $this->phash,
'mime' => $this->mime,
'ts' => $this->ts,
'size' => $this->size,
'dirs' => $this->dirs,
'read' => ... | [
"public",
"function",
"toArray",
"(",
")",
"{",
"$",
"data",
"=",
"array",
"(",
"'name'",
"=>",
"$",
"this",
"->",
"name",
",",
"'hash'",
"=>",
"$",
"this",
"->",
"hash",
",",
"'phash'",
"=>",
"$",
"this",
"->",
"phash",
",",
"'mime'",
"=>",
"$",
... | FileInfo return as array.
@return array | [
"FileInfo",
"return",
"as",
"array",
"."
] | 510e295dcafeaa0f796986ad87b3ed5f6b0d9338 | https://github.com/4devs/ElfinderPhpConnector/blob/510e295dcafeaa0f796986ad87b3ed5f6b0d9338/FileInfo.php#L574-L602 |
19,554 | okitcom/ok-lib-php | src/Model/Cash/LineItem.php | LineItem.create | public static function create($quantity, $productCode, $description, $amount, $vat, $currency = "EUR") {
$item = new LineItem;
$item->quantity = $quantity;
$item->productCode = $productCode;
$item->description = $description;
$item->amount = $amount;
$item->vat = $vat;
... | php | public static function create($quantity, $productCode, $description, $amount, $vat, $currency = "EUR") {
$item = new LineItem;
$item->quantity = $quantity;
$item->productCode = $productCode;
$item->description = $description;
$item->amount = $amount;
$item->vat = $vat;
... | [
"public",
"static",
"function",
"create",
"(",
"$",
"quantity",
",",
"$",
"productCode",
",",
"$",
"description",
",",
"$",
"amount",
",",
"$",
"vat",
",",
"$",
"currency",
"=",
"\"EUR\"",
")",
"{",
"$",
"item",
"=",
"new",
"LineItem",
";",
"$",
"ite... | LineItem creator.
@param int $quantity
@param string $productCode
@param string $description
@param Amount $amount
@param int $vat
@param string $currency
@return LineItem | [
"LineItem",
"creator",
"."
] | 1f441f3d216af7c952788e864bfe66bc4f089467 | https://github.com/okitcom/ok-lib-php/blob/1f441f3d216af7c952788e864bfe66bc4f089467/src/Model/Cash/LineItem.php#L66-L75 |
19,555 | slashworks/control-bundle | src/Slashworks/AppBundle/Model/om/BaseCountryQuery.php | BaseCountryQuery.create | public static function create($modelAlias = null, $criteria = null)
{
if ($criteria instanceof CountryQuery) {
return $criteria;
}
$query = new CountryQuery(null, null, $modelAlias);
if ($criteria instanceof Criteria) {
$query->mergeWith($criteria);
}... | php | public static function create($modelAlias = null, $criteria = null)
{
if ($criteria instanceof CountryQuery) {
return $criteria;
}
$query = new CountryQuery(null, null, $modelAlias);
if ($criteria instanceof Criteria) {
$query->mergeWith($criteria);
}... | [
"public",
"static",
"function",
"create",
"(",
"$",
"modelAlias",
"=",
"null",
",",
"$",
"criteria",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"criteria",
"instanceof",
"CountryQuery",
")",
"{",
"return",
"$",
"criteria",
";",
"}",
"$",
"query",
"=",
"new... | Returns a new CountryQuery object.
@param string $modelAlias The alias of a model in the query
@param CountryQuery|Criteria $criteria Optional Criteria to build the query from
@return CountryQuery | [
"Returns",
"a",
"new",
"CountryQuery",
"object",
"."
] | 2ba86d96f1f41f9424e2229c4e2b13017e973f89 | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Model/om/BaseCountryQuery.php#L79-L91 |
19,556 | slashworks/control-bundle | src/Slashworks/AppBundle/Model/om/BaseCountryQuery.php | BaseCountryQuery.filterByEn | public function filterByEn($en = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($en)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $en)) {
$en = str_replace('*', '%', $en);
$comparison = Criteria:... | php | public function filterByEn($en = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($en)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $en)) {
$en = str_replace('*', '%', $en);
$comparison = Criteria:... | [
"public",
"function",
"filterByEn",
"(",
"$",
"en",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"comparison",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"en",
")",
")",
"{",
"$",
"comparison",
"=",
"... | Filter the query on the en column
Example usage:
<code>
$query->filterByEn('fooValue'); // WHERE en = 'fooValue'
$query->filterByEn('%fooValue%'); // WHERE en LIKE '%fooValue%'
</code>
@param string $en The value to use as filter.
Accepts wildcards (* and % trigger a LIKE)
@param string $comparison Operator... | [
"Filter",
"the",
"query",
"on",
"the",
"en",
"column"
] | 2ba86d96f1f41f9424e2229c4e2b13017e973f89 | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Model/om/BaseCountryQuery.php#L330-L342 |
19,557 | slashworks/control-bundle | src/Slashworks/AppBundle/Model/om/BaseCountryQuery.php | BaseCountryQuery.filterByDe | public function filterByDe($de = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($de)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $de)) {
$de = str_replace('*', '%', $de);
$comparison = Criteria:... | php | public function filterByDe($de = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($de)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $de)) {
$de = str_replace('*', '%', $de);
$comparison = Criteria:... | [
"public",
"function",
"filterByDe",
"(",
"$",
"de",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"comparison",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"de",
")",
")",
"{",
"$",
"comparison",
"=",
"... | Filter the query on the de column
Example usage:
<code>
$query->filterByDe('fooValue'); // WHERE de = 'fooValue'
$query->filterByDe('%fooValue%'); // WHERE de LIKE '%fooValue%'
</code>
@param string $de The value to use as filter.
Accepts wildcards (* and % trigger a LIKE)
@param string $comparison Operator... | [
"Filter",
"the",
"query",
"on",
"the",
"de",
"column"
] | 2ba86d96f1f41f9424e2229c4e2b13017e973f89 | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Model/om/BaseCountryQuery.php#L359-L371 |
19,558 | steeffeen/FancyManiaLinks | FML/Stylesheet/Stylesheet.php | Stylesheet.addStyle | public function addStyle(Style $style)
{
if (!in_array($style, $this->styles, true)) {
array_push($this->styles, $style);
}
return $this;
} | php | public function addStyle(Style $style)
{
if (!in_array($style, $this->styles, true)) {
array_push($this->styles, $style);
}
return $this;
} | [
"public",
"function",
"addStyle",
"(",
"Style",
"$",
"style",
")",
"{",
"if",
"(",
"!",
"in_array",
"(",
"$",
"style",
",",
"$",
"this",
"->",
"styles",
",",
"true",
")",
")",
"{",
"array_push",
"(",
"$",
"this",
"->",
"styles",
",",
"$",
"style",
... | Add a new Style
@api
@param Style $style The Style to be added
@return static | [
"Add",
"a",
"new",
"Style"
] | 227b0759306f0a3c75873ba50276e4163a93bfa6 | https://github.com/steeffeen/FancyManiaLinks/blob/227b0759306f0a3c75873ba50276e4163a93bfa6/FML/Stylesheet/Stylesheet.php#L59-L65 |
19,559 | steeffeen/FancyManiaLinks | FML/Stylesheet/Stylesheet.php | Stylesheet.addStyle3d | public function addStyle3d(Style3d $style3d)
{
if (!in_array($style3d, $this->styles3d, true)) {
array_push($this->styles3d, $style3d);
}
return $this;
} | php | public function addStyle3d(Style3d $style3d)
{
if (!in_array($style3d, $this->styles3d, true)) {
array_push($this->styles3d, $style3d);
}
return $this;
} | [
"public",
"function",
"addStyle3d",
"(",
"Style3d",
"$",
"style3d",
")",
"{",
"if",
"(",
"!",
"in_array",
"(",
"$",
"style3d",
",",
"$",
"this",
"->",
"styles3d",
",",
"true",
")",
")",
"{",
"array_push",
"(",
"$",
"this",
"->",
"styles3d",
",",
"$",... | Add a new Style3d
@api
@param Style3d $style3d The Style3d to be added
@return static | [
"Add",
"a",
"new",
"Style3d"
] | 227b0759306f0a3c75873ba50276e4163a93bfa6 | https://github.com/steeffeen/FancyManiaLinks/blob/227b0759306f0a3c75873ba50276e4163a93bfa6/FML/Stylesheet/Stylesheet.php#L97-L103 |
19,560 | steeffeen/FancyManiaLinks | FML/Stylesheet/Stylesheet.php | Stylesheet.getMood | public function getMood($createIfEmpty = true)
{
if (!$this->mood && $createIfEmpty) {
$this->createMood();
}
return $this->mood;
} | php | public function getMood($createIfEmpty = true)
{
if (!$this->mood && $createIfEmpty) {
$this->createMood();
}
return $this->mood;
} | [
"public",
"function",
"getMood",
"(",
"$",
"createIfEmpty",
"=",
"true",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"mood",
"&&",
"$",
"createIfEmpty",
")",
"{",
"$",
"this",
"->",
"createMood",
"(",
")",
";",
"}",
"return",
"$",
"this",
"->",
"m... | Get the Mood
@api
@param bool $createIfEmpty (optional) If the Mood should be created if it doesn't exist yet
@return Mood | [
"Get",
"the",
"Mood"
] | 227b0759306f0a3c75873ba50276e4163a93bfa6 | https://github.com/steeffeen/FancyManiaLinks/blob/227b0759306f0a3c75873ba50276e4163a93bfa6/FML/Stylesheet/Stylesheet.php#L138-L144 |
19,561 | steeffeen/FancyManiaLinks | FML/Stylesheet/Stylesheet.php | Stylesheet.createMood | public function createMood()
{
if ($this->mood) {
return $this->mood;
}
$mood = new Mood();
$this->setMood($mood);
return $this->mood;
} | php | public function createMood()
{
if ($this->mood) {
return $this->mood;
}
$mood = new Mood();
$this->setMood($mood);
return $this->mood;
} | [
"public",
"function",
"createMood",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"mood",
")",
"{",
"return",
"$",
"this",
"->",
"mood",
";",
"}",
"$",
"mood",
"=",
"new",
"Mood",
"(",
")",
";",
"$",
"this",
"->",
"setMood",
"(",
"$",
"mood",
")... | Create a new Mood if necessary
@api
@return Mood | [
"Create",
"a",
"new",
"Mood",
"if",
"necessary"
] | 227b0759306f0a3c75873ba50276e4163a93bfa6 | https://github.com/steeffeen/FancyManiaLinks/blob/227b0759306f0a3c75873ba50276e4163a93bfa6/FML/Stylesheet/Stylesheet.php#L165-L173 |
19,562 | steeffeen/FancyManiaLinks | FML/Stylesheet/Stylesheet.php | Stylesheet.render | public function render(\DOMDocument $domDocument)
{
$stylesheetXml = $domDocument->createElement("stylesheet");
if ($this->styles3d) {
$stylesXml = $domDocument->createElement("frame3dstyles");
$stylesheetXml->appendChild($stylesXml);
foreach ($this->styles3d as $... | php | public function render(\DOMDocument $domDocument)
{
$stylesheetXml = $domDocument->createElement("stylesheet");
if ($this->styles3d) {
$stylesXml = $domDocument->createElement("frame3dstyles");
$stylesheetXml->appendChild($stylesXml);
foreach ($this->styles3d as $... | [
"public",
"function",
"render",
"(",
"\\",
"DOMDocument",
"$",
"domDocument",
")",
"{",
"$",
"stylesheetXml",
"=",
"$",
"domDocument",
"->",
"createElement",
"(",
"\"stylesheet\"",
")",
";",
"if",
"(",
"$",
"this",
"->",
"styles3d",
")",
"{",
"$",
"stylesX... | Render the Stylesheet
@param \DOMDocument $domDocument DOMDocument for which the Stylesheet should be rendered
@return \DOMElement | [
"Render",
"the",
"Stylesheet"
] | 227b0759306f0a3c75873ba50276e4163a93bfa6 | https://github.com/steeffeen/FancyManiaLinks/blob/227b0759306f0a3c75873ba50276e4163a93bfa6/FML/Stylesheet/Stylesheet.php#L181-L197 |
19,563 | Lansoweb/LosReCaptcha | src/Form/View/Helper/Captcha/Invisible.php | Invisible.renderHiddenInput | private function renderHiddenInput($responseName, $responseId)
{
$pattern = '<input type="hidden" %s%s';
$closingBracket = $this->getInlineClosingBracket();
$attributes = $this->createAttributesString([
'name' => $responseName,
'id' => $responseId,
]... | php | private function renderHiddenInput($responseName, $responseId)
{
$pattern = '<input type="hidden" %s%s';
$closingBracket = $this->getInlineClosingBracket();
$attributes = $this->createAttributesString([
'name' => $responseName,
'id' => $responseId,
]... | [
"private",
"function",
"renderHiddenInput",
"(",
"$",
"responseName",
",",
"$",
"responseId",
")",
"{",
"$",
"pattern",
"=",
"'<input type=\"hidden\" %s%s'",
";",
"$",
"closingBracket",
"=",
"$",
"this",
"->",
"getInlineClosingBracket",
"(",
")",
";",
"$",
"attr... | Render hidden input elements for the response
@param string $responseName
@param string $responseId
@return string | [
"Render",
"hidden",
"input",
"elements",
"for",
"the",
"response"
] | 8df866995501db087c3850f97fd2b6547632e6ed | https://github.com/Lansoweb/LosReCaptcha/blob/8df866995501db087c3850f97fd2b6547632e6ed/src/Form/View/Helper/Captcha/Invisible.php#L74-L86 |
19,564 | maniaplanet/matchmaking-lobby | MatchMakingLobby/Match/Plugin.php | Plugin.prepare | protected function prepare($match)
{
\ManiaLive\Utilities\Logger::debug($match);
$this->players = array_fill_keys($match->players, Services\PlayerInfo::PLAYER_STATE_NOT_CONNECTED);
$this->match = $match;
$this->matchId = $match->id;
Label::EraseAll();
foreach($match->players as $login)
{
$t... | php | protected function prepare($match)
{
\ManiaLive\Utilities\Logger::debug($match);
$this->players = array_fill_keys($match->players, Services\PlayerInfo::PLAYER_STATE_NOT_CONNECTED);
$this->match = $match;
$this->matchId = $match->id;
Label::EraseAll();
foreach($match->players as $login)
{
$t... | [
"protected",
"function",
"prepare",
"(",
"$",
"match",
")",
"{",
"\\",
"ManiaLive",
"\\",
"Utilities",
"\\",
"Logger",
"::",
"debug",
"(",
"$",
"match",
")",
";",
"$",
"this",
"->",
"players",
"=",
"array_fill_keys",
"(",
"$",
"match",
"->",
"players",
... | Prepare the server config to host a match
Then wait players' connection
@param Services\Match $match | [
"Prepare",
"the",
"server",
"config",
"to",
"host",
"a",
"match",
"Then",
"wait",
"players",
"connection"
] | 384f22cdd2cfb0204a071810549eaf1eb01d8b7f | https://github.com/maniaplanet/matchmaking-lobby/blob/384f22cdd2cfb0204a071810549eaf1eb01d8b7f/MatchMakingLobby/Match/Plugin.php#L569-L598 |
19,565 | maniaplanet/matchmaking-lobby | MatchMakingLobby/Match/Plugin.php | Plugin.end | protected function end()
{
\ManiaLive\Utilities\Logger::debug('end()');
$this->showTansfertLabel(null, -50);
foreach($this->storage->players as $player)
{
try
{
$this->connection->sendOpenLink((string) $player->login, '#qjoin='.$this->lobby->backLink, 1);
}
catch (\DedicatedApi\Xmlr... | php | protected function end()
{
\ManiaLive\Utilities\Logger::debug('end()');
$this->showTansfertLabel(null, -50);
foreach($this->storage->players as $player)
{
try
{
$this->connection->sendOpenLink((string) $player->login, '#qjoin='.$this->lobby->backLink, 1);
}
catch (\DedicatedApi\Xmlr... | [
"protected",
"function",
"end",
"(",
")",
"{",
"\\",
"ManiaLive",
"\\",
"Utilities",
"\\",
"Logger",
"::",
"debug",
"(",
"'end()'",
")",
";",
"$",
"this",
"->",
"showTansfertLabel",
"(",
"null",
",",
"-",
"50",
")",
";",
"foreach",
"(",
"$",
"this",
... | Free the match for the lobby | [
"Free",
"the",
"match",
"for",
"the",
"lobby"
] | 384f22cdd2cfb0204a071810549eaf1eb01d8b7f | https://github.com/maniaplanet/matchmaking-lobby/blob/384f22cdd2cfb0204a071810549eaf1eb01d8b7f/MatchMakingLobby/Match/Plugin.php#L775-L803 |
19,566 | titon/db | src/Titon/Db/Behavior/SlugBehavior.php | SlugBehavior.makeUnique | public function makeUnique($id, $slug) {
$repo = $this->getRepository();
$scope = $this->getConfig('scope');
/** @type \Titon\Db\Query $query */
foreach ([
$repo->select()->where($this->getConfig('slug'), $slug),
$repo->select()->where($this->getConfig('slug'), '... | php | public function makeUnique($id, $slug) {
$repo = $this->getRepository();
$scope = $this->getConfig('scope');
/** @type \Titon\Db\Query $query */
foreach ([
$repo->select()->where($this->getConfig('slug'), $slug),
$repo->select()->where($this->getConfig('slug'), '... | [
"public",
"function",
"makeUnique",
"(",
"$",
"id",
",",
"$",
"slug",
")",
"{",
"$",
"repo",
"=",
"$",
"this",
"->",
"getRepository",
"(",
")",
";",
"$",
"scope",
"=",
"$",
"this",
"->",
"getConfig",
"(",
"'scope'",
")",
";",
"/** @type \\Titon\\Db\\Qu... | Validate the slug is unique by querying for other slugs.
If the slug is not unique, append a count to it.
@param int|int[] $id
@param string $slug
@return string | [
"Validate",
"the",
"slug",
"is",
"unique",
"by",
"querying",
"for",
"other",
"slugs",
".",
"If",
"the",
"slug",
"is",
"not",
"unique",
"append",
"a",
"count",
"to",
"it",
"."
] | fbc5159d1ce9d2139759c9367565986981485604 | https://github.com/titon/db/blob/fbc5159d1ce9d2139759c9367565986981485604/src/Titon/Db/Behavior/SlugBehavior.php#L50-L78 |
19,567 | titon/db | src/Titon/Db/Behavior/SlugBehavior.php | SlugBehavior.preSave | public function preSave(Event $event, Query $query, $id, array &$data) {
$config = $this->allConfig();
if (empty($data) || empty($data[$config['field']]) || !empty($data[$config['slug']])) {
return true;
} else if ($query->getType() === Query::UPDATE && !$config['onUpdate']) {
... | php | public function preSave(Event $event, Query $query, $id, array &$data) {
$config = $this->allConfig();
if (empty($data) || empty($data[$config['field']]) || !empty($data[$config['slug']])) {
return true;
} else if ($query->getType() === Query::UPDATE && !$config['onUpdate']) {
... | [
"public",
"function",
"preSave",
"(",
"Event",
"$",
"event",
",",
"Query",
"$",
"query",
",",
"$",
"id",
",",
"array",
"&",
"$",
"data",
")",
"{",
"$",
"config",
"=",
"$",
"this",
"->",
"allConfig",
"(",
")",
";",
"if",
"(",
"empty",
"(",
"$",
... | Before a save occurs, generate a unique slug using another field as the base.
If no data exists, or the base doesn't exist, or the slug is already set, exit early.
@param \Titon\Event\Event $event
@param \Titon\Db\Query $query
@param int|int[] $id
@param array $data
@return bool | [
"Before",
"a",
"save",
"occurs",
"generate",
"a",
"unique",
"slug",
"using",
"another",
"field",
"as",
"the",
"base",
".",
"If",
"no",
"data",
"exists",
"or",
"the",
"base",
"doesn",
"t",
"exist",
"or",
"the",
"slug",
"is",
"already",
"set",
"exit",
"e... | fbc5159d1ce9d2139759c9367565986981485604 | https://github.com/titon/db/blob/fbc5159d1ce9d2139759c9367565986981485604/src/Titon/Db/Behavior/SlugBehavior.php#L90-L114 |
19,568 | slashworks/control-bundle | src/Slashworks/BackendBundle/Model/om/BaseUserQuery.php | BaseUserQuery.create | public static function create($modelAlias = null, $criteria = null)
{
if ($criteria instanceof UserQuery) {
return $criteria;
}
$query = new UserQuery(null, null, $modelAlias);
if ($criteria instanceof Criteria) {
$query->mergeWith($criteria);
}
... | php | public static function create($modelAlias = null, $criteria = null)
{
if ($criteria instanceof UserQuery) {
return $criteria;
}
$query = new UserQuery(null, null, $modelAlias);
if ($criteria instanceof Criteria) {
$query->mergeWith($criteria);
}
... | [
"public",
"static",
"function",
"create",
"(",
"$",
"modelAlias",
"=",
"null",
",",
"$",
"criteria",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"criteria",
"instanceof",
"UserQuery",
")",
"{",
"return",
"$",
"criteria",
";",
"}",
"$",
"query",
"=",
"new",
... | Returns a new UserQuery object.
@param string $modelAlias The alias of a model in the query
@param UserQuery|Criteria $criteria Optional Criteria to build the query from
@return UserQuery | [
"Returns",
"a",
"new",
"UserQuery",
"object",
"."
] | 2ba86d96f1f41f9424e2229c4e2b13017e973f89 | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/BackendBundle/Model/om/BaseUserQuery.php#L120-L132 |
19,569 | slashworks/control-bundle | src/Slashworks/BackendBundle/Model/om/BaseUserQuery.php | BaseUserQuery.filterBySalt | public function filterBySalt($salt = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($salt)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $salt)) {
$salt = str_replace('*', '%', $salt);
$comparison... | php | public function filterBySalt($salt = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($salt)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $salt)) {
$salt = str_replace('*', '%', $salt);
$comparison... | [
"public",
"function",
"filterBySalt",
"(",
"$",
"salt",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"comparison",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"salt",
")",
")",
"{",
"$",
"comparison",
"=... | Filter the query on the salt column
Example usage:
<code>
$query->filterBySalt('fooValue'); // WHERE salt = 'fooValue'
$query->filterBySalt('%fooValue%'); // WHERE salt LIKE '%fooValue%'
</code>
@param string $salt The value to use as filter.
Accepts wildcards (* and % trigger a LIKE)
@param string $compari... | [
"Filter",
"the",
"query",
"on",
"the",
"salt",
"column"
] | 2ba86d96f1f41f9424e2229c4e2b13017e973f89 | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/BackendBundle/Model/om/BaseUserQuery.php#L400-L412 |
19,570 | slashworks/control-bundle | src/Slashworks/BackendBundle/Model/om/BaseUserQuery.php | BaseUserQuery.filterByFirstname | public function filterByFirstname($firstname = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($firstname)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $firstname)) {
$firstname = str_replace('*', '%', $firstname... | php | public function filterByFirstname($firstname = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($firstname)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $firstname)) {
$firstname = str_replace('*', '%', $firstname... | [
"public",
"function",
"filterByFirstname",
"(",
"$",
"firstname",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"comparison",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"firstname",
")",
")",
"{",
"$",
"co... | Filter the query on the firstname column
Example usage:
<code>
$query->filterByFirstname('fooValue'); // WHERE firstname = 'fooValue'
$query->filterByFirstname('%fooValue%'); // WHERE firstname LIKE '%fooValue%'
</code>
@param string $firstname The value to use as filter.
Accepts wildcards (* and % trigger a LI... | [
"Filter",
"the",
"query",
"on",
"the",
"firstname",
"column"
] | 2ba86d96f1f41f9424e2229c4e2b13017e973f89 | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/BackendBundle/Model/om/BaseUserQuery.php#L429-L441 |
19,571 | slashworks/control-bundle | src/Slashworks/BackendBundle/Model/om/BaseUserQuery.php | BaseUserQuery.filterByLastname | public function filterByLastname($lastname = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($lastname)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $lastname)) {
$lastname = str_replace('*', '%', $lastname);
... | php | public function filterByLastname($lastname = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($lastname)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $lastname)) {
$lastname = str_replace('*', '%', $lastname);
... | [
"public",
"function",
"filterByLastname",
"(",
"$",
"lastname",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"comparison",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"lastname",
")",
")",
"{",
"$",
"compa... | Filter the query on the lastname column
Example usage:
<code>
$query->filterByLastname('fooValue'); // WHERE lastname = 'fooValue'
$query->filterByLastname('%fooValue%'); // WHERE lastname LIKE '%fooValue%'
</code>
@param string $lastname The value to use as filter.
Accepts wildcards (* and % trigger a LIKE)
@p... | [
"Filter",
"the",
"query",
"on",
"the",
"lastname",
"column"
] | 2ba86d96f1f41f9424e2229c4e2b13017e973f89 | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/BackendBundle/Model/om/BaseUserQuery.php#L458-L470 |
19,572 | slashworks/control-bundle | src/Slashworks/BackendBundle/Model/om/BaseUserQuery.php | BaseUserQuery.filterByPhone | public function filterByPhone($phone = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($phone)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $phone)) {
$phone = str_replace('*', '%', $phone);
$comp... | php | public function filterByPhone($phone = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($phone)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $phone)) {
$phone = str_replace('*', '%', $phone);
$comp... | [
"public",
"function",
"filterByPhone",
"(",
"$",
"phone",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"comparison",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"phone",
")",
")",
"{",
"$",
"comparison",
... | Filter the query on the phone column
Example usage:
<code>
$query->filterByPhone('fooValue'); // WHERE phone = 'fooValue'
$query->filterByPhone('%fooValue%'); // WHERE phone LIKE '%fooValue%'
</code>
@param string $phone The value to use as filter.
Accepts wildcards (* and % trigger a LIKE)
@param string $c... | [
"Filter",
"the",
"query",
"on",
"the",
"phone",
"column"
] | 2ba86d96f1f41f9424e2229c4e2b13017e973f89 | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/BackendBundle/Model/om/BaseUserQuery.php#L516-L528 |
19,573 | slashworks/control-bundle | src/Slashworks/BackendBundle/Model/om/BaseUserQuery.php | BaseUserQuery.filterByMemo | public function filterByMemo($memo = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($memo)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $memo)) {
$memo = str_replace('*', '%', $memo);
$comparison... | php | public function filterByMemo($memo = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($memo)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $memo)) {
$memo = str_replace('*', '%', $memo);
$comparison... | [
"public",
"function",
"filterByMemo",
"(",
"$",
"memo",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"comparison",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"memo",
")",
")",
"{",
"$",
"comparison",
"=... | Filter the query on the memo column
Example usage:
<code>
$query->filterByMemo('fooValue'); // WHERE memo = 'fooValue'
$query->filterByMemo('%fooValue%'); // WHERE memo LIKE '%fooValue%'
</code>
@param string $memo The value to use as filter.
Accepts wildcards (* and % trigger a LIKE)
@param string $compari... | [
"Filter",
"the",
"query",
"on",
"the",
"memo",
"column"
] | 2ba86d96f1f41f9424e2229c4e2b13017e973f89 | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/BackendBundle/Model/om/BaseUserQuery.php#L545-L557 |
19,574 | slashworks/control-bundle | src/Slashworks/BackendBundle/Model/om/BaseUserQuery.php | BaseUserQuery.filterByActivated | public function filterByActivated($activated = null, $comparison = null)
{
if (is_string($activated)) {
$activated = in_array(strtolower($activated), array('false', 'off', '-', 'no', 'n', '0', '')) ? false : true;
}
return $this->addUsingAlias(UserPeer::ACTIVATED, $activated, $c... | php | public function filterByActivated($activated = null, $comparison = null)
{
if (is_string($activated)) {
$activated = in_array(strtolower($activated), array('false', 'off', '-', 'no', 'n', '0', '')) ? false : true;
}
return $this->addUsingAlias(UserPeer::ACTIVATED, $activated, $c... | [
"public",
"function",
"filterByActivated",
"(",
"$",
"activated",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"activated",
")",
")",
"{",
"$",
"activated",
"=",
"in_array",
"(",
"strtolower",
"(",
"$",
... | Filter the query on the activated column
Example usage:
<code>
$query->filterByActivated(true); // WHERE activated = true
$query->filterByActivated('yes'); // WHERE activated = true
</code>
@param boolean|string $activated The value to use as filter.
Non-boolean arguments are converted using the following rules:
... | [
"Filter",
"the",
"query",
"on",
"the",
"activated",
"column"
] | 2ba86d96f1f41f9424e2229c4e2b13017e973f89 | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/BackendBundle/Model/om/BaseUserQuery.php#L577-L584 |
19,575 | slashworks/control-bundle | src/Slashworks/BackendBundle/Model/om/BaseUserQuery.php | BaseUserQuery.filterByLastLogin | public function filterByLastLogin($lastLogin = null, $comparison = null)
{
if (is_array($lastLogin)) {
$useMinMax = false;
if (isset($lastLogin['min'])) {
$this->addUsingAlias(UserPeer::LAST_LOGIN, $lastLogin['min'], Criteria::GREATER_EQUAL);
$useMinMa... | php | public function filterByLastLogin($lastLogin = null, $comparison = null)
{
if (is_array($lastLogin)) {
$useMinMax = false;
if (isset($lastLogin['min'])) {
$this->addUsingAlias(UserPeer::LAST_LOGIN, $lastLogin['min'], Criteria::GREATER_EQUAL);
$useMinMa... | [
"public",
"function",
"filterByLastLogin",
"(",
"$",
"lastLogin",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"lastLogin",
")",
")",
"{",
"$",
"useMinMax",
"=",
"false",
";",
"if",
"(",
"isset",
"(",
"... | Filter the query on the last_login column
Example usage:
<code>
$query->filterByLastLogin('2011-03-14'); // WHERE last_login = '2011-03-14'
$query->filterByLastLogin('now'); // WHERE last_login = '2011-03-14'
$query->filterByLastLogin(array('max' => 'yesterday')); // WHERE last_login < '2011-03-13'
</code>
@param ... | [
"Filter",
"the",
"query",
"on",
"the",
"last_login",
"column"
] | 2ba86d96f1f41f9424e2229c4e2b13017e973f89 | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/BackendBundle/Model/om/BaseUserQuery.php#L606-L627 |
19,576 | ivliev/imagefly | src/Ivliev/Imagefly/Imagefly.php | Imagefly._set_params | private function _set_params()
{
// Get values from request
$params = \Request::route('params');
$filepath = $this->config['abs_path'] . '/' . \Request::route('imagepath');
// echo $params; exit;
// If enforcing params, ensure it's a match
if ($this-... | php | private function _set_params()
{
// Get values from request
$params = \Request::route('params');
$filepath = $this->config['abs_path'] . '/' . \Request::route('imagepath');
// echo $params; exit;
// If enforcing params, ensure it's a match
if ($this-... | [
"private",
"function",
"_set_params",
"(",
")",
"{",
"// Get values from request",
"$",
"params",
"=",
"\\",
"Request",
"::",
"route",
"(",
"'params'",
")",
";",
"$",
"filepath",
"=",
"$",
"this",
"->",
"config",
"[",
"'abs_path'",
"]",
".",
"'/'",
".",
... | Sets the operations params from the url | [
"Sets",
"the",
"operations",
"params",
"from",
"the",
"url"
] | 0363eb37cc0748292a2142f0ec9027827e9d4eba | https://github.com/ivliev/imagefly/blob/0363eb37cc0748292a2142f0ec9027827e9d4eba/src/Ivliev/Imagefly/Imagefly.php#L165-L233 |
19,577 | ivliev/imagefly | src/Ivliev/Imagefly/Imagefly.php | Imagefly._cached_required | private function _cached_required()
{
$image_info = getimagesize($this->source_file);
if (($this->url_params['w'] == $image_info[0]) and ($this->url_params['h'] == $image_info[1])) {
$this->serve_default = TRUE;
return FALSE;
}
return TRUE;
... | php | private function _cached_required()
{
$image_info = getimagesize($this->source_file);
if (($this->url_params['w'] == $image_info[0]) and ($this->url_params['h'] == $image_info[1])) {
$this->serve_default = TRUE;
return FALSE;
}
return TRUE;
... | [
"private",
"function",
"_cached_required",
"(",
")",
"{",
"$",
"image_info",
"=",
"getimagesize",
"(",
"$",
"this",
"->",
"source_file",
")",
";",
"if",
"(",
"(",
"$",
"this",
"->",
"url_params",
"[",
"'w'",
"]",
"==",
"$",
"image_info",
"[",
"0",
"]",... | Checks that the param dimensions are are lower then current image dimensions
@return boolean | [
"Checks",
"that",
"the",
"param",
"dimensions",
"are",
"are",
"lower",
"then",
"current",
"image",
"dimensions"
] | 0363eb37cc0748292a2142f0ec9027827e9d4eba | https://github.com/ivliev/imagefly/blob/0363eb37cc0748292a2142f0ec9027827e9d4eba/src/Ivliev/Imagefly/Imagefly.php#L250-L260 |
19,578 | ivliev/imagefly | src/Ivliev/Imagefly/Imagefly.php | Imagefly._encoded_filename | private function _encoded_filename()
{
$ext = strtolower(pathinfo($this->source_file, PATHINFO_EXTENSION));
$encode = md5($this->source_file . http_build_query($this->url_params));
// Build the parts of the filename
$encoded_name = $encode . '-' . $this->source_modified . '.... | php | private function _encoded_filename()
{
$ext = strtolower(pathinfo($this->source_file, PATHINFO_EXTENSION));
$encode = md5($this->source_file . http_build_query($this->url_params));
// Build the parts of the filename
$encoded_name = $encode . '-' . $this->source_modified . '.... | [
"private",
"function",
"_encoded_filename",
"(",
")",
"{",
"$",
"ext",
"=",
"strtolower",
"(",
"pathinfo",
"(",
"$",
"this",
"->",
"source_file",
",",
"PATHINFO_EXTENSION",
")",
")",
";",
"$",
"encode",
"=",
"md5",
"(",
"$",
"this",
"->",
"source_file",
... | Returns a hash of the filepath and params plus last modified of source to be used as a unique filename
@return string | [
"Returns",
"a",
"hash",
"of",
"the",
"filepath",
"and",
"params",
"plus",
"last",
"modified",
"of",
"source",
"to",
"be",
"used",
"as",
"a",
"unique",
"filename"
] | 0363eb37cc0748292a2142f0ec9027827e9d4eba | https://github.com/ivliev/imagefly/blob/0363eb37cc0748292a2142f0ec9027827e9d4eba/src/Ivliev/Imagefly/Imagefly.php#L267-L276 |
19,579 | ivliev/imagefly | src/Ivliev/Imagefly/Imagefly.php | Imagefly._create_headers | private function _create_headers($file_data)
{
// Create the required header vars
$last_modified = gmdate('D, d M Y H:i:s', filemtime($file_data)) . ' GMT';
$filesystem = new \Illuminate\Filesystem\Filesystem;
$content_type = $filesystem->mimeType($file_data);
// $content_typ... | php | private function _create_headers($file_data)
{
// Create the required header vars
$last_modified = gmdate('D, d M Y H:i:s', filemtime($file_data)) . ' GMT';
$filesystem = new \Illuminate\Filesystem\Filesystem;
$content_type = $filesystem->mimeType($file_data);
// $content_typ... | [
"private",
"function",
"_create_headers",
"(",
"$",
"file_data",
")",
"{",
"// Create the required header vars",
"$",
"last_modified",
"=",
"gmdate",
"(",
"'D, d M Y H:i:s'",
",",
"filemtime",
"(",
"$",
"file_data",
")",
")",
".",
"' GMT'",
";",
"$",
"filesystem",... | Create the image HTTP headers
@param
string path to the file to server (either default or cached version) | [
"Create",
"the",
"image",
"HTTP",
"headers"
] | 0363eb37cc0748292a2142f0ec9027827e9d4eba | https://github.com/ivliev/imagefly/blob/0363eb37cc0748292a2142f0ec9027827e9d4eba/src/Ivliev/Imagefly/Imagefly.php#L336-L375 |
19,580 | ivliev/imagefly | src/Ivliev/Imagefly/Imagefly.php | Imagefly._modified_headers | private function _modified_headers($last_modified)
{
$modified_since = (isset($_SERVER['HTTP_IF_MODIFIED_SINCE'])) ? stripslashes($_SERVER['HTTP_IF_MODIFIED_SINCE']) : FALSE;
if (! $modified_since or $modified_since != $last_modified)
return;
// Nothing ... | php | private function _modified_headers($last_modified)
{
$modified_since = (isset($_SERVER['HTTP_IF_MODIFIED_SINCE'])) ? stripslashes($_SERVER['HTTP_IF_MODIFIED_SINCE']) : FALSE;
if (! $modified_since or $modified_since != $last_modified)
return;
// Nothing ... | [
"private",
"function",
"_modified_headers",
"(",
"$",
"last_modified",
")",
"{",
"$",
"modified_since",
"=",
"(",
"isset",
"(",
"$",
"_SERVER",
"[",
"'HTTP_IF_MODIFIED_SINCE'",
"]",
")",
")",
"?",
"stripslashes",
"(",
"$",
"_SERVER",
"[",
"'HTTP_IF_MODIFIED_SINC... | Rerurns 304 Not Modified HTTP headers if required and exits
@param
string header formatted date | [
"Rerurns",
"304",
"Not",
"Modified",
"HTTP",
"headers",
"if",
"required",
"and",
"exits"
] | 0363eb37cc0748292a2142f0ec9027827e9d4eba | https://github.com/ivliev/imagefly/blob/0363eb37cc0748292a2142f0ec9027827e9d4eba/src/Ivliev/Imagefly/Imagefly.php#L383-L394 |
19,581 | ivliev/imagefly | src/Ivliev/Imagefly/Imagefly.php | Imagefly._serve_file | private function _serve_file()
{
// Set either the source or cache file as our datasource
if ($this->serve_default) {
$file_data = $this->source_file;
} else {
$file_data = $this->cached_file;
}
// Output the file
$this->_output_file($... | php | private function _serve_file()
{
// Set either the source or cache file as our datasource
if ($this->serve_default) {
$file_data = $this->source_file;
} else {
$file_data = $this->cached_file;
}
// Output the file
$this->_output_file($... | [
"private",
"function",
"_serve_file",
"(",
")",
"{",
"// Set either the source or cache file as our datasource",
"if",
"(",
"$",
"this",
"->",
"serve_default",
")",
"{",
"$",
"file_data",
"=",
"$",
"this",
"->",
"source_file",
";",
"}",
"else",
"{",
"$",
"file_d... | Decide which filesource we are using and serve | [
"Decide",
"which",
"filesource",
"we",
"are",
"using",
"and",
"serve"
] | 0363eb37cc0748292a2142f0ec9027827e9d4eba | https://github.com/ivliev/imagefly/blob/0363eb37cc0748292a2142f0ec9027827e9d4eba/src/Ivliev/Imagefly/Imagefly.php#L399-L410 |
19,582 | ivliev/imagefly | src/Ivliev/Imagefly/Imagefly.php | Imagefly._output_file | private function _output_file($file_data)
{
// Create the headers
$this->_create_headers($file_data);
// Get the file data
$data = file_get_contents($file_data);
// Send the image to the browser in bite-sized chunks
$chunk_size = 1024 * 8;
$f... | php | private function _output_file($file_data)
{
// Create the headers
$this->_create_headers($file_data);
// Get the file data
$data = file_get_contents($file_data);
// Send the image to the browser in bite-sized chunks
$chunk_size = 1024 * 8;
$f... | [
"private",
"function",
"_output_file",
"(",
"$",
"file_data",
")",
"{",
"// Create the headers",
"$",
"this",
"->",
"_create_headers",
"(",
"$",
"file_data",
")",
";",
"// Get the file data",
"$",
"data",
"=",
"file_get_contents",
"(",
"$",
"file_data",
")",
";"... | Outputs the cached image file and exits
@param
string path to the file to server (either default or cached version) | [
"Outputs",
"the",
"cached",
"image",
"file",
"and",
"exits"
] | 0363eb37cc0748292a2142f0ec9027827e9d4eba | https://github.com/ivliev/imagefly/blob/0363eb37cc0748292a2142f0ec9027827e9d4eba/src/Ivliev/Imagefly/Imagefly.php#L418-L440 |
19,583 | devmobgroup/postcodes | src/Providers/HttpProvider.php | HttpProvider.getClient | public function getClient(): ClientInterface
{
if (! isset($this->client)) {
$this->client = new GuzzleClient();
}
return $this->client;
} | php | public function getClient(): ClientInterface
{
if (! isset($this->client)) {
$this->client = new GuzzleClient();
}
return $this->client;
} | [
"public",
"function",
"getClient",
"(",
")",
":",
"ClientInterface",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"client",
")",
")",
"{",
"$",
"this",
"->",
"client",
"=",
"new",
"GuzzleClient",
"(",
")",
";",
"}",
"return",
"$",
"this",
... | Get the Http client.
@return \GuzzleHttp\ClientInterface | [
"Get",
"the",
"Http",
"client",
"."
] | 1a8438fd960a8f50ec28d61af94560892b529f12 | https://github.com/devmobgroup/postcodes/blob/1a8438fd960a8f50ec28d61af94560892b529f12/src/Providers/HttpProvider.php#L39-L46 |
19,584 | devmobgroup/postcodes | src/Providers/HttpProvider.php | HttpProvider.lookup | public function lookup(string $postcode, string $number): array
{
$input = [
'postcode' => $postcode,
'number' => $number
];
// Create http request to send
$request = $this->request($input);
$response = null;
try {
// Make request... | php | public function lookup(string $postcode, string $number): array
{
$input = [
'postcode' => $postcode,
'number' => $number
];
// Create http request to send
$request = $this->request($input);
$response = null;
try {
// Make request... | [
"public",
"function",
"lookup",
"(",
"string",
"$",
"postcode",
",",
"string",
"$",
"number",
")",
":",
"array",
"{",
"$",
"input",
"=",
"[",
"'postcode'",
"=>",
"$",
"postcode",
",",
"'number'",
"=>",
"$",
"number",
"]",
";",
"// Create http request to se... | Lookup an address by postcode and house number.
@param string $postcode
@param string $number
@return \DevMob\Postcodes\Address\Address[]
@throws \DevMob\Postcodes\Exceptions\NoSuchCombinationException
@throws \DevMob\Postcodes\Exceptions\PostcodesException | [
"Lookup",
"an",
"address",
"by",
"postcode",
"and",
"house",
"number",
"."
] | 1a8438fd960a8f50ec28d61af94560892b529f12 | https://github.com/devmobgroup/postcodes/blob/1a8438fd960a8f50ec28d61af94560892b529f12/src/Providers/HttpProvider.php#L58-L90 |
19,585 | webforge-labs/psc-cms | lib/Psc/Data/FileCache.php | FileCache.remove | public function remove($key) {
$file = $this->getFile($this->getKey($key));
$file->delete();
return $this;
} | php | public function remove($key) {
$file = $this->getFile($this->getKey($key));
$file->delete();
return $this;
} | [
"public",
"function",
"remove",
"(",
"$",
"key",
")",
"{",
"$",
"file",
"=",
"$",
"this",
"->",
"getFile",
"(",
"$",
"this",
"->",
"getKey",
"(",
"$",
"key",
")",
")",
";",
"$",
"file",
"->",
"delete",
"(",
")",
";",
"return",
"$",
"this",
";",... | Entfernt die Dateia us dem Cache
@chainable | [
"Entfernt",
"die",
"Dateia",
"us",
"dem",
"Cache"
] | 467bfa2547e6b4fa487d2d7f35fa6cc618dbc763 | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/Data/FileCache.php#L96-L100 |
19,586 | jfusion/org.jfusion.framework | src/Installer/Framework.php | Framework.uninstall | public static function uninstall()
{
$results = array();
//see if any mods from jfusion plugins need to be removed
$plugins = Factory::getPlugins('all', false, 0);
foreach($plugins as $plugin) {
$model = new Plugin();
$result = $model->uninstall($plugin->name);
$r = new stdClass();
$result['statu... | php | public static function uninstall()
{
$results = array();
//see if any mods from jfusion plugins need to be removed
$plugins = Factory::getPlugins('all', false, 0);
foreach($plugins as $plugin) {
$model = new Plugin();
$result = $model->uninstall($plugin->name);
$r = new stdClass();
$result['statu... | [
"public",
"static",
"function",
"uninstall",
"(",
")",
"{",
"$",
"results",
"=",
"array",
"(",
")",
";",
"//see if any mods from jfusion plugins need to be removed",
"$",
"plugins",
"=",
"Factory",
"::",
"getPlugins",
"(",
"'all'",
",",
"false",
",",
"0",
")",
... | method to uninstall the component
@return stdClass[] with status/message field for plugin uninstall info | [
"method",
"to",
"uninstall",
"the",
"component"
] | 65771963f23ccabcf1f867eb17c9452299cfe683 | https://github.com/jfusion/org.jfusion.framework/blob/65771963f23ccabcf1f867eb17c9452299cfe683/src/Installer/Framework.php#L226-L267 |
19,587 | yuncms/framework | src/admin/widgets/Box.php | Box.renderTools | protected function renderTools()
{
$tools = '';
if($this->collapseButton !== false){
$tools .= '<a class="collapse-link"><i class="fa fa-chevron-up"></i></a>';
}
if ($this->closeButton !== false) {
$tools .= '<a class="close-link"><i class="fa fa-times"></i></... | php | protected function renderTools()
{
$tools = '';
if($this->collapseButton !== false){
$tools .= '<a class="collapse-link"><i class="fa fa-chevron-up"></i></a>';
}
if ($this->closeButton !== false) {
$tools .= '<a class="close-link"><i class="fa fa-times"></i></... | [
"protected",
"function",
"renderTools",
"(",
")",
"{",
"$",
"tools",
"=",
"''",
";",
"if",
"(",
"$",
"this",
"->",
"collapseButton",
"!==",
"false",
")",
"{",
"$",
"tools",
".=",
"'<a class=\"collapse-link\"><i class=\"fa fa-chevron-up\"></i></a>'",
";",
"}",
"i... | Renders the tools
@return string the rendering result | [
"Renders",
"the",
"tools"
] | af42e28ea4ae15ab8eead3f6d119f93863b94154 | https://github.com/yuncms/framework/blob/af42e28ea4ae15ab8eead3f6d119f93863b94154/src/admin/widgets/Box.php#L148-L162 |
19,588 | jfusion/org.jfusion.framework | src/User/User.php | User.search | public static function search(Userinfo $userinfo, $lookup = false)
{
$exsistingUser = null;
if ($lookup && $userinfo->getJname() !== null) {
$userPlugin = Factory::getUser($userinfo->getJname());
$exsistingUser = $userPlugin->lookupUser($userinfo);
}
if (!$exsistingUser instanceof Userinfo) {
$plugi... | php | public static function search(Userinfo $userinfo, $lookup = false)
{
$exsistingUser = null;
if ($lookup && $userinfo->getJname() !== null) {
$userPlugin = Factory::getUser($userinfo->getJname());
$exsistingUser = $userPlugin->lookupUser($userinfo);
}
if (!$exsistingUser instanceof Userinfo) {
$plugi... | [
"public",
"static",
"function",
"search",
"(",
"Userinfo",
"$",
"userinfo",
",",
"$",
"lookup",
"=",
"false",
")",
"{",
"$",
"exsistingUser",
"=",
"null",
";",
"if",
"(",
"$",
"lookup",
"&&",
"$",
"userinfo",
"->",
"getJname",
"(",
")",
"!==",
"null",
... | Finds the first user that match starting with master
@param Userinfo $userinfo
@param bool $lookup
@return null|Userinfo returns first used founed | [
"Finds",
"the",
"first",
"user",
"that",
"match",
"starting",
"with",
"master"
] | 65771963f23ccabcf1f867eb17c9452299cfe683 | https://github.com/jfusion/org.jfusion.framework/blob/65771963f23ccabcf1f867eb17c9452299cfe683/src/User/User.php#L494-L518 |
19,589 | jfusion/org.jfusion.framework | src/User/User.php | User.remove | public static function remove(Userinfo $userinfo)
{
$db = Factory::getDBO();
$query = $db->getQuery(true)
->delete('#__jfusion_users')
->where('userid = ' . $db->quote($userinfo->userid));
$db->setQuery($query);
$db->execute();
} | php | public static function remove(Userinfo $userinfo)
{
$db = Factory::getDBO();
$query = $db->getQuery(true)
->delete('#__jfusion_users')
->where('userid = ' . $db->quote($userinfo->userid));
$db->setQuery($query);
$db->execute();
} | [
"public",
"static",
"function",
"remove",
"(",
"Userinfo",
"$",
"userinfo",
")",
"{",
"$",
"db",
"=",
"Factory",
"::",
"getDBO",
"(",
")",
";",
"$",
"query",
"=",
"$",
"db",
"->",
"getQuery",
"(",
"true",
")",
"->",
"delete",
"(",
"'#__jfusion_users'",... | Delete old user data in the lookup table
@param Userinfo $userinfo userinfo of the user to be deleted | [
"Delete",
"old",
"user",
"data",
"in",
"the",
"lookup",
"table"
] | 65771963f23ccabcf1f867eb17c9452299cfe683 | https://github.com/jfusion/org.jfusion.framework/blob/65771963f23ccabcf1f867eb17c9452299cfe683/src/User/User.php#L525-L535 |
19,590 | RobinMalfait/l4-laracasts-feed | src/Malfaitrobin/Laracasts/Laracasts.php | Laracasts.meta | public function meta()
{
$xml = (array) $this->xml;
unset($xml['entry']);
$xml['link'] = (object) $xml['link']->{"@attributes"};
return (object) $xml;
} | php | public function meta()
{
$xml = (array) $this->xml;
unset($xml['entry']);
$xml['link'] = (object) $xml['link']->{"@attributes"};
return (object) $xml;
} | [
"public",
"function",
"meta",
"(",
")",
"{",
"$",
"xml",
"=",
"(",
"array",
")",
"$",
"this",
"->",
"xml",
";",
"unset",
"(",
"$",
"xml",
"[",
"'entry'",
"]",
")",
";",
"$",
"xml",
"[",
"'link'",
"]",
"=",
"(",
"object",
")",
"$",
"xml",
"[",... | Get the meta information of the xml feed
@return object | [
"Get",
"the",
"meta",
"information",
"of",
"the",
"xml",
"feed"
] | 26033545dc42dd15fa5c2ed64c28868cdd43f933 | https://github.com/RobinMalfait/l4-laracasts-feed/blob/26033545dc42dd15fa5c2ed64c28868cdd43f933/src/Malfaitrobin/Laracasts/Laracasts.php#L59-L67 |
19,591 | RobinMalfait/l4-laracasts-feed | src/Malfaitrobin/Laracasts/Laracasts.php | Laracasts.getXML | protected function getXML()
{
$key = 'xml_' . md5($this->url); // Everybody loves md5!
if ($this->cache->has($key)) {
$this->xml = $this->cache->get($key);
} else {
$this->xml = $this->fetchXML();
$this->xml = $this->changeLinkElements($this->xml);
... | php | protected function getXML()
{
$key = 'xml_' . md5($this->url); // Everybody loves md5!
if ($this->cache->has($key)) {
$this->xml = $this->cache->get($key);
} else {
$this->xml = $this->fetchXML();
$this->xml = $this->changeLinkElements($this->xml);
... | [
"protected",
"function",
"getXML",
"(",
")",
"{",
"$",
"key",
"=",
"'xml_'",
".",
"md5",
"(",
"$",
"this",
"->",
"url",
")",
";",
"// Everybody loves md5!",
"if",
"(",
"$",
"this",
"->",
"cache",
"->",
"has",
"(",
"$",
"key",
")",
")",
"{",
"$",
... | Get the xml from the server, and cache the result
@return void | [
"Get",
"the",
"xml",
"from",
"the",
"server",
"and",
"cache",
"the",
"result"
] | 26033545dc42dd15fa5c2ed64c28868cdd43f933 | https://github.com/RobinMalfait/l4-laracasts-feed/blob/26033545dc42dd15fa5c2ed64c28868cdd43f933/src/Malfaitrobin/Laracasts/Laracasts.php#L84-L97 |
19,592 | askupasoftware/amarkal | Autoloader.php | Autoloader.register_assets | static function register_assets()
{
\wp_enqueue_script( 'jquery' );
\wp_enqueue_script( 'jquery-ui' );
\wp_enqueue_script( 'jquery-ui-datepicker' );
\wp_enqueue_script( 'jquery-ui-spinner' );
\wp_enqueue_script( 'jquery-ui-slider' );
\wp_enqueue_script( 'jquery-u... | php | static function register_assets()
{
\wp_enqueue_script( 'jquery' );
\wp_enqueue_script( 'jquery-ui' );
\wp_enqueue_script( 'jquery-ui-datepicker' );
\wp_enqueue_script( 'jquery-ui-spinner' );
\wp_enqueue_script( 'jquery-ui-slider' );
\wp_enqueue_script( 'jquery-u... | [
"static",
"function",
"register_assets",
"(",
")",
"{",
"\\",
"wp_enqueue_script",
"(",
"'jquery'",
")",
";",
"\\",
"wp_enqueue_script",
"(",
"'jquery-ui'",
")",
";",
"\\",
"wp_enqueue_script",
"(",
"'jquery-ui-datepicker'",
")",
";",
"\\",
"wp_enqueue_script",
"(... | Register Amarkal Scripts and Stylesheets | [
"Register",
"Amarkal",
"Scripts",
"and",
"Stylesheets"
] | fe8283e2d6847ef697abec832da7ee741a85058c | https://github.com/askupasoftware/amarkal/blob/fe8283e2d6847ef697abec832da7ee741a85058c/Autoloader.php#L70-L87 |
19,593 | jfusion/org.jfusion.framework | src/Plugin/Admin.php | Admin.getDefaultUsergroup | function getDefaultUsergroup()
{
$usergroups = Groups::get($this->getJname(), true);
$groups = array();
if ($usergroups !== null) {
$list = $this->getUsergroupList();
foreach ($list as $group) {
if(in_array($group->id, $usergroups)){
$groups[] = $group... | php | function getDefaultUsergroup()
{
$usergroups = Groups::get($this->getJname(), true);
$groups = array();
if ($usergroups !== null) {
$list = $this->getUsergroupList();
foreach ($list as $group) {
if(in_array($group->id, $usergroups)){
$groups[] = $group... | [
"function",
"getDefaultUsergroup",
"(",
")",
"{",
"$",
"usergroups",
"=",
"Groups",
"::",
"get",
"(",
"$",
"this",
"->",
"getJname",
"(",
")",
",",
"true",
")",
";",
"$",
"groups",
"=",
"array",
"(",
")",
";",
"if",
"(",
"$",
"usergroups",
"!==",
"... | Function used to display the default usergroup in the JFusion plugin overview
@return array Default usergroup name | [
"Function",
"used",
"to",
"display",
"the",
"default",
"usergroup",
"in",
"the",
"JFusion",
"plugin",
"overview"
] | 65771963f23ccabcf1f867eb17c9452299cfe683 | https://github.com/jfusion/org.jfusion.framework/blob/65771963f23ccabcf1f867eb17c9452299cfe683/src/Plugin/Admin.php#L89-L103 |
19,594 | jfusion/org.jfusion.framework | src/Plugin/Admin.php | Admin.debugConfig | function debugConfig()
{
$jname = $this->getJname();
//get registration status
$new_registration = $this->allowRegistration();
if ($new_registration) {
$plugins = Framework::getSlaves();
foreach ($plugins as $plugin) {
if ($plugin->name == $jname) {
Framework::raise(L... | php | function debugConfig()
{
$jname = $this->getJname();
//get registration status
$new_registration = $this->allowRegistration();
if ($new_registration) {
$plugins = Framework::getSlaves();
foreach ($plugins as $plugin) {
if ($plugin->name == $jname) {
Framework::raise(L... | [
"function",
"debugConfig",
"(",
")",
"{",
"$",
"jname",
"=",
"$",
"this",
"->",
"getJname",
"(",
")",
";",
"//get registration status",
"$",
"new_registration",
"=",
"$",
"this",
"->",
"allowRegistration",
"(",
")",
";",
"if",
"(",
"$",
"new_registration",
... | Function that checks if the plugin has a valid config
jerror is used for output
@return void | [
"Function",
"that",
"checks",
"if",
"the",
"plugin",
"has",
"a",
"valid",
"config",
"jerror",
"is",
"used",
"for",
"output"
] | 65771963f23ccabcf1f867eb17c9452299cfe683 | https://github.com/jfusion/org.jfusion.framework/blob/65771963f23ccabcf1f867eb17c9452299cfe683/src/Plugin/Admin.php#L234-L287 |
19,595 | jfusion/org.jfusion.framework | src/Plugin/Admin.php | Admin.saveParameters | final public function saveParameters($post, $wizard = false)
{
$jname = $this->getJname();
$result = false;
try {
if (!empty($jname)) {
$db = Factory::getDBO();
if (isset($post['source_url'])) {
//check for trailing slash in URL, in order for us not to worry about it later
$post['source_pat... | php | final public function saveParameters($post, $wizard = false)
{
$jname = $this->getJname();
$result = false;
try {
if (!empty($jname)) {
$db = Factory::getDBO();
if (isset($post['source_url'])) {
//check for trailing slash in URL, in order for us not to worry about it later
$post['source_pat... | [
"final",
"public",
"function",
"saveParameters",
"(",
"$",
"post",
",",
"$",
"wizard",
"=",
"false",
")",
"{",
"$",
"jname",
"=",
"$",
"this",
"->",
"getJname",
"(",
")",
";",
"$",
"result",
"=",
"false",
";",
"try",
"{",
"if",
"(",
"!",
"empty",
... | Saves the posted JFusion component variables
@param array $post Array of JFusion plugin parameters posted to the JFusion component
@param boolean $wizard Notes if function was called by wizardresult();
@return boolean returns true if successful and false if an error occurred | [
"Saves",
"the",
"posted",
"JFusion",
"component",
"variables"
] | 65771963f23ccabcf1f867eb17c9452299cfe683 | https://github.com/jfusion/org.jfusion.framework/blob/65771963f23ccabcf1f867eb17c9452299cfe683/src/Plugin/Admin.php#L402-L472 |
19,596 | austinkregel/Warden | src/Warden/Warden.php | Warden.clearInput | public static function clearInput($input)
{
if (is_array($input)) {
foreach ($input as $key => $value) {
if (!isset($value) || $value === '') {
unset($input[$key]);
}
}
return $input;
}
return $input;
... | php | public static function clearInput($input)
{
if (is_array($input)) {
foreach ($input as $key => $value) {
if (!isset($value) || $value === '') {
unset($input[$key]);
}
}
return $input;
}
return $input;
... | [
"public",
"static",
"function",
"clearInput",
"(",
"$",
"input",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"input",
")",
")",
"{",
"foreach",
"(",
"$",
"input",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
... | This will look through the input and remove any unset values.
@param $input
@return mixed | [
"This",
"will",
"look",
"through",
"the",
"input",
"and",
"remove",
"any",
"unset",
"values",
"."
] | 6f5a98bd79a488f0f300f4851061ac6f7d19f8a3 | https://github.com/austinkregel/Warden/blob/6f5a98bd79a488f0f300f4851061ac6f7d19f8a3/src/Warden/Warden.php#L16-L29 |
19,597 | austinkregel/Warden | src/Warden/Warden.php | Warden.apiRoutes | public static function apiRoutes()
{
Route::group([
'namespace' => 'Kregel\\Warden\\Http\\Controllers',
'prefix' => config('kregel.warden.route').'/api/v1.0',
'as' => 'warden::api.',
'middleware' => config('kregel.warden.auth.middleware_api'),
... | php | public static function apiRoutes()
{
Route::group([
'namespace' => 'Kregel\\Warden\\Http\\Controllers',
'prefix' => config('kregel.warden.route').'/api/v1.0',
'as' => 'warden::api.',
'middleware' => config('kregel.warden.auth.middleware_api'),
... | [
"public",
"static",
"function",
"apiRoutes",
"(",
")",
"{",
"Route",
"::",
"group",
"(",
"[",
"'namespace'",
"=>",
"'Kregel\\\\Warden\\\\Http\\\\Controllers'",
",",
"'prefix'",
"=>",
"config",
"(",
"'kregel.warden.route'",
")",
".",
"'/api/v1.0'",
",",
"'as'",
"=>... | Define the api routes more dynamically. | [
"Define",
"the",
"api",
"routes",
"more",
"dynamically",
"."
] | 6f5a98bd79a488f0f300f4851061ac6f7d19f8a3 | https://github.com/austinkregel/Warden/blob/6f5a98bd79a488f0f300f4851061ac6f7d19f8a3/src/Warden/Warden.php#L45-L71 |
19,598 | austinkregel/Warden | src/Warden/Warden.php | Warden.webRoutes | public static function webRoutes()
{
Route::group([
'namespace' => 'Kregel\\Warden\\Http\\Controllers',
'prefix' => config('kregel.warden.route'),
'as' => 'warden::',
'middleware' => config('kregel.warden.auth.middleware'),
], function ($r... | php | public static function webRoutes()
{
Route::group([
'namespace' => 'Kregel\\Warden\\Http\\Controllers',
'prefix' => config('kregel.warden.route'),
'as' => 'warden::',
'middleware' => config('kregel.warden.auth.middleware'),
], function ($r... | [
"public",
"static",
"function",
"webRoutes",
"(",
")",
"{",
"Route",
"::",
"group",
"(",
"[",
"'namespace'",
"=>",
"'Kregel\\\\Warden\\\\Http\\\\Controllers'",
",",
"'prefix'",
"=>",
"config",
"(",
"'kregel.warden.route'",
")",
",",
"'as'",
"=>",
"'warden::'",
","... | Define the web routes more dynamically. | [
"Define",
"the",
"web",
"routes",
"more",
"dynamically",
"."
] | 6f5a98bd79a488f0f300f4851061ac6f7d19f8a3 | https://github.com/austinkregel/Warden/blob/6f5a98bd79a488f0f300f4851061ac6f7d19f8a3/src/Warden/Warden.php#L76-L92 |
19,599 | 2amigos/yiifoundation | helpers/Foundation.php | Foundation.register | public static function register($useZepto = false, $ie8Support = false)
{
static::registerCoreCss();
static::registerCoreScripts($useZepto);
if ($ie8Support)
static::registerBlockGridIeSupport();
} | php | public static function register($useZepto = false, $ie8Support = false)
{
static::registerCoreCss();
static::registerCoreScripts($useZepto);
if ($ie8Support)
static::registerBlockGridIeSupport();
} | [
"public",
"static",
"function",
"register",
"(",
"$",
"useZepto",
"=",
"false",
",",
"$",
"ie8Support",
"=",
"false",
")",
"{",
"static",
"::",
"registerCoreCss",
"(",
")",
";",
"static",
"::",
"registerCoreScripts",
"(",
"$",
"useZepto",
")",
";",
"if",
... | Registers all core css and js scripts for foundation | [
"Registers",
"all",
"core",
"css",
"and",
"js",
"scripts",
"for",
"foundation"
] | 49bed0d3ca1a9bac9299000e48a2661bdc8f9a29 | https://github.com/2amigos/yiifoundation/blob/49bed0d3ca1a9bac9299000e48a2661bdc8f9a29/helpers/Foundation.php#L27-L34 |
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.