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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
22,400 | kecik-framework/kecik | Kecik/Assets.php | Assets.images | public function images( $file, $version = '' ) {
if ( empty( $version ) ) {
$version = '?ver=' . Kecik::$version;
}
return $this->BaseUrl . Config::get( 'path.assets' ) . '/images/' . $file . $version;
} | php | public function images( $file, $version = '' ) {
if ( empty( $version ) ) {
$version = '?ver=' . Kecik::$version;
}
return $this->BaseUrl . Config::get( 'path.assets' ) . '/images/' . $file . $version;
} | [
"public",
"function",
"images",
"(",
"$",
"file",
",",
"$",
"version",
"=",
"''",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"version",
")",
")",
"{",
"$",
"version",
"=",
"'?ver='",
".",
"Kecik",
"::",
"$",
"version",
";",
"}",
"return",
"$",
"this... | Create of images Url from Assets
@param $file
@param string $version
@return string | [
"Create",
"of",
"images",
"Url",
"from",
"Assets"
] | fa87e593affe1c9c51a2acd264b85ec06df31d7c | https://github.com/kecik-framework/kecik/blob/fa87e593affe1c9c51a2acd264b85ec06df31d7c/Kecik/Assets.php#L49-L56 |
22,401 | kecik-framework/kecik | Kecik/Assets.php | Assets.url | public function url( $file = '', $version = '' ) {
if ( empty( $version ) ) {
$version = '?ver=' . Kecik::$version;
}
if ( ! empty( $file ) ) {
return $this->BaseUrl . Config::get( 'path.assets' ) . '/' . $file . $version;
} else {
return $this->BaseUrl . Config::get( 'path.assets' ) . '/';
}
} | php | public function url( $file = '', $version = '' ) {
if ( empty( $version ) ) {
$version = '?ver=' . Kecik::$version;
}
if ( ! empty( $file ) ) {
return $this->BaseUrl . Config::get( 'path.assets' ) . '/' . $file . $version;
} else {
return $this->BaseUrl . Config::get( 'path.assets' ) . '/';
}
} | [
"public",
"function",
"url",
"(",
"$",
"file",
"=",
"''",
",",
"$",
"version",
"=",
"''",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"version",
")",
")",
"{",
"$",
"version",
"=",
"'?ver='",
".",
"Kecik",
"::",
"$",
"version",
";",
"}",
"if",
"(",... | Create url from assets
@param string $file
@param string $version
@return string | [
"Create",
"url",
"from",
"assets"
] | fa87e593affe1c9c51a2acd264b85ec06df31d7c | https://github.com/kecik-framework/kecik/blob/fa87e593affe1c9c51a2acd264b85ec06df31d7c/Kecik/Assets.php#L66-L78 |
22,402 | kecik-framework/kecik | Kecik/Assets.php | AssetsBase.delete | public function delete( $file ) {
$key = array_search( $file, $this->assets[ $this->type ] );
unset( $this->assets[ $this->type ][ $key ] );
unset( $this->attr[ $this->type ][ $key ] );
} | php | public function delete( $file ) {
$key = array_search( $file, $this->assets[ $this->type ] );
unset( $this->assets[ $this->type ][ $key ] );
unset( $this->attr[ $this->type ][ $key ] );
} | [
"public",
"function",
"delete",
"(",
"$",
"file",
")",
"{",
"$",
"key",
"=",
"array_search",
"(",
"$",
"file",
",",
"$",
"this",
"->",
"assets",
"[",
"$",
"this",
"->",
"type",
"]",
")",
";",
"unset",
"(",
"$",
"this",
"->",
"assets",
"[",
"$",
... | Delete Assets from register
delete
@param $file | [
"Delete",
"Assets",
"from",
"register",
"delete"
] | fa87e593affe1c9c51a2acd264b85ec06df31d7c | https://github.com/kecik-framework/kecik/blob/fa87e593affe1c9c51a2acd264b85ec06df31d7c/Kecik/Assets.php#L147-L151 |
22,403 | hametuha/wpametu | src/WPametu/UI/Field/Input.php | Input.build_input | protected function build_input($data, array $fields = [] ){
$fields = implode(' ', $fields);
return sprintf('<input id="%1$s" name="%1$s" type="%2$s" %3$s value="%4$s" />',
$this->name, $this->type, $fields, esc_attr($data));
} | php | protected function build_input($data, array $fields = [] ){
$fields = implode(' ', $fields);
return sprintf('<input id="%1$s" name="%1$s" type="%2$s" %3$s value="%4$s" />',
$this->name, $this->type, $fields, esc_attr($data));
} | [
"protected",
"function",
"build_input",
"(",
"$",
"data",
",",
"array",
"$",
"fields",
"=",
"[",
"]",
")",
"{",
"$",
"fields",
"=",
"implode",
"(",
"' '",
",",
"$",
"fields",
")",
";",
"return",
"sprintf",
"(",
"'<input id=\"%1$s\" name=\"%1$s\" type=\"%2$s\... | build input field
@param mixed $data
@param array $fields
@return string | [
"build",
"input",
"field"
] | 0939373800815a8396291143d2a57967340da5aa | https://github.com/hametuha/wpametu/blob/0939373800815a8396291143d2a57967340da5aa/src/WPametu/UI/Field/Input.php#L44-L49 |
22,404 | mvccore/ext-router-module | src/MvcCore/Ext/Routers/Modules/Route/Instancing.php | Instancing.constructDataModuleNamespace | protected function constructDataModuleNamespace (& $data) {
if (isset($data->module))
$this->SetModule($data->module);
if (isset($data->namespace))
$this->SetNamespace($data->namespace);
} | php | protected function constructDataModuleNamespace (& $data) {
if (isset($data->module))
$this->SetModule($data->module);
if (isset($data->namespace))
$this->SetNamespace($data->namespace);
} | [
"protected",
"function",
"constructDataModuleNamespace",
"(",
"&",
"$",
"data",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"data",
"->",
"module",
")",
")",
"$",
"this",
"->",
"SetModule",
"(",
"$",
"data",
"->",
"module",
")",
";",
"if",
"(",
"isset",
... | If route is initialized by single array argument with all data,
initialize route application module name and optional target controllers
namespace - used only if routed controller is not defined absolutely.
Initialize both properties by setter methods.
@param \stdClass $data Object containing properties `module` and `n... | [
"If",
"route",
"is",
"initialized",
"by",
"single",
"array",
"argument",
"with",
"all",
"data",
"initialize",
"route",
"application",
"module",
"name",
"and",
"optional",
"target",
"controllers",
"namespace",
"-",
"used",
"only",
"if",
"routed",
"controller",
"i... | 7695784a451db86cca6a43c98d076803cd0a50a7 | https://github.com/mvccore/ext-router-module/blob/7695784a451db86cca6a43c98d076803cd0a50a7/src/MvcCore/Ext/Routers/Modules/Route/Instancing.php#L111-L116 |
22,405 | GrupaZero/api | src/Gzero/Api/Transformer/RouteTransformer.php | RouteTransformer.transform | public function transform($route)
{
$route = $this->entityToArray(Route::class, $route);
return [
'id' => (int) $route['id'],
'createdAt' => $route['created_at'],
'updatedAt' => $route['updated_at']
];
} | php | public function transform($route)
{
$route = $this->entityToArray(Route::class, $route);
return [
'id' => (int) $route['id'],
'createdAt' => $route['created_at'],
'updatedAt' => $route['updated_at']
];
} | [
"public",
"function",
"transform",
"(",
"$",
"route",
")",
"{",
"$",
"route",
"=",
"$",
"this",
"->",
"entityToArray",
"(",
"Route",
"::",
"class",
",",
"$",
"route",
")",
";",
"return",
"[",
"'id'",
"=>",
"(",
"int",
")",
"$",
"route",
"[",
"'id'"... | Transforms route entity
@param Route|array $route route entity
@return array | [
"Transforms",
"route",
"entity"
] | fc544bb6057274e9d5e7b617346c3f854ea5effd | https://github.com/GrupaZero/api/blob/fc544bb6057274e9d5e7b617346c3f854ea5effd/src/Gzero/Api/Transformer/RouteTransformer.php#L35-L43 |
22,406 | wenbinye/PhalconX | src/Di/ServiceProvider.php | ServiceProvider.provide | public function provide($name, $args)
{
$services = $this->getServices();
if (isset($services[$name])) {
return (new Service($name, $services[$name]))
->resolve($args, $this->getDi());
} else {
$method = self::METHOD_PREFIX . $name;
if (met... | php | public function provide($name, $args)
{
$services = $this->getServices();
if (isset($services[$name])) {
return (new Service($name, $services[$name]))
->resolve($args, $this->getDi());
} else {
$method = self::METHOD_PREFIX . $name;
if (met... | [
"public",
"function",
"provide",
"(",
"$",
"name",
",",
"$",
"args",
")",
"{",
"$",
"services",
"=",
"$",
"this",
"->",
"getServices",
"(",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"services",
"[",
"$",
"name",
"]",
")",
")",
"{",
"return",
"(",
... | Creates service instance
@param string $name service name
@param array $args arguments to create instance | [
"Creates",
"service",
"instance"
] | 0d2e1480e722dde56ccd23b2e8a5c8ac6ac2f8e1 | https://github.com/wenbinye/PhalconX/blob/0d2e1480e722dde56ccd23b2e8a5c8ac6ac2f8e1/src/Di/ServiceProvider.php#L26-L44 |
22,407 | wenbinye/PhalconX | src/Di/ServiceProvider.php | ServiceProvider.getNames | public function getNames()
{
$names = array_keys($this->getServices());
$len = strlen(self::METHOD_PREFIX);
foreach (get_class_methods($this) as $method) {
if (Text::startsWith($method, self::METHOD_PREFIX)) {
$name = lcfirst(substr($method, $len));
... | php | public function getNames()
{
$names = array_keys($this->getServices());
$len = strlen(self::METHOD_PREFIX);
foreach (get_class_methods($this) as $method) {
if (Text::startsWith($method, self::METHOD_PREFIX)) {
$name = lcfirst(substr($method, $len));
... | [
"public",
"function",
"getNames",
"(",
")",
"{",
"$",
"names",
"=",
"array_keys",
"(",
"$",
"this",
"->",
"getServices",
"(",
")",
")",
";",
"$",
"len",
"=",
"strlen",
"(",
"self",
"::",
"METHOD_PREFIX",
")",
";",
"foreach",
"(",
"get_class_methods",
"... | Gets all service names | [
"Gets",
"all",
"service",
"names"
] | 0d2e1480e722dde56ccd23b2e8a5c8ac6ac2f8e1 | https://github.com/wenbinye/PhalconX/blob/0d2e1480e722dde56ccd23b2e8a5c8ac6ac2f8e1/src/Di/ServiceProvider.php#L49-L62 |
22,408 | ienaga/SimpleApiClient | src/api/Client.php | Client.append | public function append()
{
if (!$this->hasMultiHandle()) {
$this->setMultiHandle(curl_multi_init());
}
// init
$this
->initOption()
->buildBody();
$curl = curl_init();
curl_setopt_array($curl, $this->getOptions());
curl_mu... | php | public function append()
{
if (!$this->hasMultiHandle()) {
$this->setMultiHandle(curl_multi_init());
}
// init
$this
->initOption()
->buildBody();
$curl = curl_init();
curl_setopt_array($curl, $this->getOptions());
curl_mu... | [
"public",
"function",
"append",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"hasMultiHandle",
"(",
")",
")",
"{",
"$",
"this",
"->",
"setMultiHandle",
"(",
"curl_multi_init",
"(",
")",
")",
";",
"}",
"// init",
"$",
"this",
"->",
"initOption",
... | add multi handle | [
"add",
"multi",
"handle"
] | 834a5e5eb043ed901000bf769a4cf16b9dc28d15 | https://github.com/ienaga/SimpleApiClient/blob/834a5e5eb043ed901000bf769a4cf16b9dc28d15/src/api/Client.php#L640-L656 |
22,409 | FrenzelGmbH/cm-address | models/Address.php | Address.validateModelId | public function validateModelId($attribute, $params)
{
/** @var ActiveRecord $class */
$class = Model::findIdentity($this->model_class);
if ($class === null) {
$this->addError($attribute, \Yii::t('net_frenzel_communication', 'ERROR_MSG_INVALID_MODEL_ID'));
} else {
... | php | public function validateModelId($attribute, $params)
{
/** @var ActiveRecord $class */
$class = Model::findIdentity($this->model_class);
if ($class === null) {
$this->addError($attribute, \Yii::t('net_frenzel_communication', 'ERROR_MSG_INVALID_MODEL_ID'));
} else {
... | [
"public",
"function",
"validateModelId",
"(",
"$",
"attribute",
",",
"$",
"params",
")",
"{",
"/** @var ActiveRecord $class */",
"$",
"class",
"=",
"Model",
"::",
"findIdentity",
"(",
"$",
"this",
"->",
"model_class",
")",
";",
"if",
"(",
"$",
"class",
"==="... | Model ID validation.
@param string $attribute Attribute name
@param array $params Attribute params
@return mixed | [
"Model",
"ID",
"validation",
"."
] | 4295671dc603beed4bea6c5a7f77dac9846127f3 | https://github.com/FrenzelGmbH/cm-address/blob/4295671dc603beed4bea6c5a7f77dac9846127f3/models/Address.php#L209-L221 |
22,410 | FrenzelGmbH/cm-address | models/Address.php | Address.getIPLocation | public static function getIPLocation(){
//initialize the browser
$adapter = new GuzzleHttpAdapter();
//create geocoder
$geocoder = new \Geocoder\Provider\FreeGeoIp($adapter);
if (!isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
$client_ip = $_SERVER['REMOTE_ADDR'];... | php | public static function getIPLocation(){
//initialize the browser
$adapter = new GuzzleHttpAdapter();
//create geocoder
$geocoder = new \Geocoder\Provider\FreeGeoIp($adapter);
if (!isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
$client_ip = $_SERVER['REMOTE_ADDR'];... | [
"public",
"static",
"function",
"getIPLocation",
"(",
")",
"{",
"//initialize the browser",
"$",
"adapter",
"=",
"new",
"GuzzleHttpAdapter",
"(",
")",
";",
"//create geocoder",
"$",
"geocoder",
"=",
"new",
"\\",
"Geocoder",
"\\",
"Provider",
"\\",
"FreeGeoIp",
"... | find the use location based upon his current IP address
@return mixed [description] | [
"find",
"the",
"use",
"location",
"based",
"upon",
"his",
"current",
"IP",
"address"
] | 4295671dc603beed4bea6c5a7f77dac9846127f3 | https://github.com/FrenzelGmbH/cm-address/blob/4295671dc603beed4bea6c5a7f77dac9846127f3/models/Address.php#L251-L266 |
22,411 | RhubarbPHP/Module.RestApi | src/UrlHandlers/RestHandler.php | RestHandler.handleInvalidMethod | protected function handleInvalidMethod($method)
{
$emptyResponse = new Response();
$emptyResponse->setHeader("HTTP/1.1 405 Method $method Not Allowed", false);
$emptyResponse->setHeader("Allow", implode(", ", $this->getSupportedHttpMethods()));
throw new ForceResponseException($empt... | php | protected function handleInvalidMethod($method)
{
$emptyResponse = new Response();
$emptyResponse->setHeader("HTTP/1.1 405 Method $method Not Allowed", false);
$emptyResponse->setHeader("Allow", implode(", ", $this->getSupportedHttpMethods()));
throw new ForceResponseException($empt... | [
"protected",
"function",
"handleInvalidMethod",
"(",
"$",
"method",
")",
"{",
"$",
"emptyResponse",
"=",
"new",
"Response",
"(",
")",
";",
"$",
"emptyResponse",
"->",
"setHeader",
"(",
"\"HTTP/1.1 405 Method $method Not Allowed\"",
",",
"false",
")",
";",
"$",
"... | Override to handle the case where an HTTP method is unsupported.
This should throw a ForceResponseException
@param $method
@throws \Rhubarb\Crown\Exceptions\ForceResponseException | [
"Override",
"to",
"handle",
"the",
"case",
"where",
"an",
"HTTP",
"method",
"is",
"unsupported",
"."
] | 825d2b920caed13811971c5eb2784a94417787bd | https://github.com/RhubarbPHP/Module.RestApi/blob/825d2b920caed13811971c5eb2784a94417787bd/src/UrlHandlers/RestHandler.php#L210-L217 |
22,412 | magium/mcm-redis-factory | lib/Factory.php | Factory.factory | public function factory()
{
$redis = new \Redis();
$host = $this->getConfig()->getValue(self::CONFIG_HOST);
$port = $this->getConfig()->getValue(self::CONFIG_PORT);
$timeout = $this->getConfig()->getValue(self::CONFIG_TIMEOUT);
if ($this->getConfig()->getValueFlag(self::CONF... | php | public function factory()
{
$redis = new \Redis();
$host = $this->getConfig()->getValue(self::CONFIG_HOST);
$port = $this->getConfig()->getValue(self::CONFIG_PORT);
$timeout = $this->getConfig()->getValue(self::CONFIG_TIMEOUT);
if ($this->getConfig()->getValueFlag(self::CONF... | [
"public",
"function",
"factory",
"(",
")",
"{",
"$",
"redis",
"=",
"new",
"\\",
"Redis",
"(",
")",
";",
"$",
"host",
"=",
"$",
"this",
"->",
"getConfig",
"(",
")",
"->",
"getValue",
"(",
"self",
"::",
"CONFIG_HOST",
")",
";",
"$",
"port",
"=",
"$... | Creates a configured \Redis instance in the object context
@param ConfigInterface $config
@return \Redis | [
"Creates",
"a",
"configured",
"\\",
"Redis",
"instance",
"in",
"the",
"object",
"context"
] | d5881a7d4834cc13d1f569bb2c94c892b3b48e76 | https://github.com/magium/mcm-redis-factory/blob/d5881a7d4834cc13d1f569bb2c94c892b3b48e76/lib/Factory.php#L38-L56 |
22,413 | Eresus/EresusCMS | src/core/framework/core/3rdparty/dwoo/Dwoo/Adapters/CakePHP/dwoo.php | DwooView.setTemplateDir | public function setTemplateDir($path = VIEW) {
$old = $this->_sv_template_dir;
$this->_sv_template_dir = $path;
return $old;
} | php | public function setTemplateDir($path = VIEW) {
$old = $this->_sv_template_dir;
$this->_sv_template_dir = $path;
return $old;
} | [
"public",
"function",
"setTemplateDir",
"(",
"$",
"path",
"=",
"VIEW",
")",
"{",
"$",
"old",
"=",
"$",
"this",
"->",
"_sv_template_dir",
";",
"$",
"this",
"->",
"_sv_template_dir",
"=",
"$",
"path",
";",
"return",
"$",
"old",
";",
"}"
] | changes the template directory | [
"changes",
"the",
"template",
"directory"
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/dwoo/Dwoo/Adapters/CakePHP/dwoo.php#L75-L80 |
22,414 | stk2k/net-driver | src/Http/HttpResponse.php | HttpResponse.jsonDecode | public function jsonDecode()
{
$json = json_decode($this->body, true);
if ($json===null){
throw new JsonFormatException($this->body);
}
return $json;
} | php | public function jsonDecode()
{
$json = json_decode($this->body, true);
if ($json===null){
throw new JsonFormatException($this->body);
}
return $json;
} | [
"public",
"function",
"jsonDecode",
"(",
")",
"{",
"$",
"json",
"=",
"json_decode",
"(",
"$",
"this",
"->",
"body",
",",
"true",
")",
";",
"if",
"(",
"$",
"json",
"===",
"null",
")",
"{",
"throw",
"new",
"JsonFormatException",
"(",
"$",
"this",
"->",... | Decode as JSON
@return array|object
@throws JsonFormatException | [
"Decode",
"as",
"JSON"
] | 75e0bc1a95ba430dd9ed9e69f6a0a5dd8f2e7b1c | https://github.com/stk2k/net-driver/blob/75e0bc1a95ba430dd9ed9e69f6a0a5dd8f2e7b1c/src/Http/HttpResponse.php#L82-L89 |
22,415 | Visithor/visithor | src/Visithor/Compiler/Compiler.php | Compiler.addFile | protected function addFile(
Phar $phar,
SplFileInfo $file,
$strip = true
) {
$path = strtr(str_replace(dirname(dirname(dirname(__DIR__))) . DIRECTORY_SEPARATOR, '', $file->getRealPath()), '\\', '/');
$content = file_get_contents($file);
if ($strip) {
$cont... | php | protected function addFile(
Phar $phar,
SplFileInfo $file,
$strip = true
) {
$path = strtr(str_replace(dirname(dirname(dirname(__DIR__))) . DIRECTORY_SEPARATOR, '', $file->getRealPath()), '\\', '/');
$content = file_get_contents($file);
if ($strip) {
$cont... | [
"protected",
"function",
"addFile",
"(",
"Phar",
"$",
"phar",
",",
"SplFileInfo",
"$",
"file",
",",
"$",
"strip",
"=",
"true",
")",
"{",
"$",
"path",
"=",
"strtr",
"(",
"str_replace",
"(",
"dirname",
"(",
"dirname",
"(",
"dirname",
"(",
"__DIR__",
")",... | Add a file into the phar package
@param Phar $phar Phar object
@param SplFileInfo $file File to add
@param bool $strip strip
@return Compiler self Object | [
"Add",
"a",
"file",
"into",
"the",
"phar",
"package"
] | 201ba2cfc536a0875983c79226947aa20b9f4dca | https://github.com/Visithor/visithor/blob/201ba2cfc536a0875983c79226947aa20b9f4dca/src/Visithor/Compiler/Compiler.php#L87-L108 |
22,416 | Visithor/visithor | src/Visithor/Compiler/Compiler.php | Compiler.addBin | protected function addBin(Phar $phar)
{
$content = file_get_contents(__DIR__ . '/../../../bin/visithor');
$content = preg_replace('{^#!/usr/bin/env php\s*}', '', $content);
$phar->addFromString('bin/visithor', $content);
return $this;
} | php | protected function addBin(Phar $phar)
{
$content = file_get_contents(__DIR__ . '/../../../bin/visithor');
$content = preg_replace('{^#!/usr/bin/env php\s*}', '', $content);
$phar->addFromString('bin/visithor', $content);
return $this;
} | [
"protected",
"function",
"addBin",
"(",
"Phar",
"$",
"phar",
")",
"{",
"$",
"content",
"=",
"file_get_contents",
"(",
"__DIR__",
".",
"'/../../../bin/visithor'",
")",
";",
"$",
"content",
"=",
"preg_replace",
"(",
"'{^#!/usr/bin/env php\\s*}'",
",",
"''",
",",
... | Add bin into Phar
@param Phar $phar Phar
@return Compiler self Object | [
"Add",
"bin",
"into",
"Phar"
] | 201ba2cfc536a0875983c79226947aa20b9f4dca | https://github.com/Visithor/visithor/blob/201ba2cfc536a0875983c79226947aa20b9f4dca/src/Visithor/Compiler/Compiler.php#L117-L124 |
22,417 | Smile-SA/CronBundle | Cron/CronHandler.php | CronHandler.addCron | public function addCron(CronInterface $cron, $alias, $priority, $arguments)
{
if (!isset($this->crons[$priority])) {
$this->crons[$priority] = array();
}
$cron->setAlias($alias);
$cron->addArguments($arguments);
$cron->addPriority($priority);
$this->crons[... | php | public function addCron(CronInterface $cron, $alias, $priority, $arguments)
{
if (!isset($this->crons[$priority])) {
$this->crons[$priority] = array();
}
$cron->setAlias($alias);
$cron->addArguments($arguments);
$cron->addPriority($priority);
$this->crons[... | [
"public",
"function",
"addCron",
"(",
"CronInterface",
"$",
"cron",
",",
"$",
"alias",
",",
"$",
"priority",
",",
"$",
"arguments",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"crons",
"[",
"$",
"priority",
"]",
")",
")",
"{",
"$",
... | Add cron to crons list
@param CronInterface $cron cron
@param string $alias cron alias
@param integer $priority cron priority
@param string $arguments cron arguments | [
"Add",
"cron",
"to",
"crons",
"list"
] | 3e6d29112915fa957cc04386ba9c6d1fc134d31f | https://github.com/Smile-SA/CronBundle/blob/3e6d29112915fa957cc04386ba9c6d1fc134d31f/Cron/CronHandler.php#L44-L53 |
22,418 | 42mate/towel | src/Towel/Controller/AssetsController.php | AssetsController.index | public function index($request) {
$application = $request->get('application');
$path = $request->get('path');
if (empty($application) || empty($path)) {
return new Response(
"Not a valid asset",
404
);
}
if (strpos('..', $... | php | public function index($request) {
$application = $request->get('application');
$path = $request->get('path');
if (empty($application) || empty($path)) {
return new Response(
"Not a valid asset",
404
);
}
if (strpos('..', $... | [
"public",
"function",
"index",
"(",
"$",
"request",
")",
"{",
"$",
"application",
"=",
"$",
"request",
"->",
"get",
"(",
"'application'",
")",
";",
"$",
"path",
"=",
"$",
"request",
"->",
"get",
"(",
"'path'",
")",
";",
"if",
"(",
"empty",
"(",
"$"... | Serves assets from the Application directory.
To use this controller in your template use the function asset_url to get a valid url
for this controller.
@param $request
@return string|Response | [
"Serves",
"assets",
"from",
"the",
"Application",
"directory",
"."
] | 5316c3075fc844e8a5cbae113712b26556227dff | https://github.com/42mate/towel/blob/5316c3075fc844e8a5cbae113712b26556227dff/src/Towel/Controller/AssetsController.php#L33-L93 |
22,419 | GrupaZero/social | src/Gzero/Repository/SocialRepository.php | SocialRepository.createNewUser | public function createNewUser($serviceName, AbstractUser $response)
{
$data = $this->parseServiceResponse($response);
$existingUser = $this->userRepo->getByEmail($data['email']);
// duplicated user verification
if ($existingUser === null) {
$data['password'] = str... | php | public function createNewUser($serviceName, AbstractUser $response)
{
$data = $this->parseServiceResponse($response);
$existingUser = $this->userRepo->getByEmail($data['email']);
// duplicated user verification
if ($existingUser === null) {
$data['password'] = str... | [
"public",
"function",
"createNewUser",
"(",
"$",
"serviceName",
",",
"AbstractUser",
"$",
"response",
")",
"{",
"$",
"data",
"=",
"$",
"this",
"->",
"parseServiceResponse",
"(",
"$",
"response",
")",
";",
"$",
"existingUser",
"=",
"$",
"this",
"->",
"userR... | Function creates new user based on social service response and create relation with social integration in database.
@param $serviceName string name of social service
@param $response AbstractUser response data
@return User
@throws SocialException | [
"Function",
"creates",
"new",
"user",
"based",
"on",
"social",
"service",
"response",
"and",
"create",
"relation",
"with",
"social",
"integration",
"in",
"database",
"."
] | f7cbf50765bd228010a2c61d950f915828306cf7 | https://github.com/GrupaZero/social/blob/f7cbf50765bd228010a2c61d950f915828306cf7/src/Gzero/Repository/SocialRepository.php#L92-L109 |
22,420 | GrupaZero/social | src/Gzero/Repository/SocialRepository.php | SocialRepository.addUserSocialAccount | public function addUserSocialAccount(User $user, $serviceName, AbstractUser $response)
{
$user->has_social_integrations = true;
$user->save();
// create relation for new user and social integration
$this->addSocialRelation($user, $serviceName, $response);
return $user;
} | php | public function addUserSocialAccount(User $user, $serviceName, AbstractUser $response)
{
$user->has_social_integrations = true;
$user->save();
// create relation for new user and social integration
$this->addSocialRelation($user, $serviceName, $response);
return $user;
} | [
"public",
"function",
"addUserSocialAccount",
"(",
"User",
"$",
"user",
",",
"$",
"serviceName",
",",
"AbstractUser",
"$",
"response",
")",
"{",
"$",
"user",
"->",
"has_social_integrations",
"=",
"true",
";",
"$",
"user",
"->",
"save",
"(",
")",
";",
"// c... | Function adds new social account for existing user.
@param $user User user entity
@param $serviceName string name of social service
@param $response AbstractUser response data
@return User | [
"Function",
"adds",
"new",
"social",
"account",
"for",
"existing",
"user",
"."
] | f7cbf50765bd228010a2c61d950f915828306cf7 | https://github.com/GrupaZero/social/blob/f7cbf50765bd228010a2c61d950f915828306cf7/src/Gzero/Repository/SocialRepository.php#L120-L127 |
22,421 | GrupaZero/social | src/Gzero/Repository/SocialRepository.php | SocialRepository.addSocialRelation | public function addSocialRelation(User $user, $serviceName, AbstractUser $response)
{
// create relation for new user and social integration
return $this->newQB()->insert(
[
'user_id' => $user->id,
'social_id' => $serviceName . '_' . $response->id,
... | php | public function addSocialRelation(User $user, $serviceName, AbstractUser $response)
{
// create relation for new user and social integration
return $this->newQB()->insert(
[
'user_id' => $user->id,
'social_id' => $serviceName . '_' . $response->id,
... | [
"public",
"function",
"addSocialRelation",
"(",
"User",
"$",
"user",
",",
"$",
"serviceName",
",",
"AbstractUser",
"$",
"response",
")",
"{",
"// create relation for new user and social integration",
"return",
"$",
"this",
"->",
"newQB",
"(",
")",
"->",
"insert",
... | Function creates relation for given user and social integration.
@param $user User user entity
@param $serviceName string name of social service
@param $response AbstractUser response data
@return mixed | [
"Function",
"creates",
"relation",
"for",
"given",
"user",
"and",
"social",
"integration",
"."
] | f7cbf50765bd228010a2c61d950f915828306cf7 | https://github.com/GrupaZero/social/blob/f7cbf50765bd228010a2c61d950f915828306cf7/src/Gzero/Repository/SocialRepository.php#L138-L148 |
22,422 | GrupaZero/social | src/Gzero/Repository/SocialRepository.php | SocialRepository.parseServiceResponse | private function parseServiceResponse(AbstractUser $response)
{
$userData = [
'has_social_integrations' => true,
'nick' => $response->getNickname()
];
// set user email if exists (twitter returns as null)
if ($response->getEmail()) {
... | php | private function parseServiceResponse(AbstractUser $response)
{
$userData = [
'has_social_integrations' => true,
'nick' => $response->getNickname()
];
// set user email if exists (twitter returns as null)
if ($response->getEmail()) {
... | [
"private",
"function",
"parseServiceResponse",
"(",
"AbstractUser",
"$",
"response",
")",
"{",
"$",
"userData",
"=",
"[",
"'has_social_integrations'",
"=>",
"true",
",",
"'nick'",
"=>",
"$",
"response",
"->",
"getNickname",
"(",
")",
"]",
";",
"// set user email... | Function parses social service response and prepares user data to insert to database.
@param $response AbstractUser response data
@return array parsed user data for database insertion | [
"Function",
"parses",
"social",
"service",
"response",
"and",
"prepares",
"user",
"data",
"to",
"insert",
"to",
"database",
"."
] | f7cbf50765bd228010a2c61d950f915828306cf7 | https://github.com/GrupaZero/social/blob/f7cbf50765bd228010a2c61d950f915828306cf7/src/Gzero/Repository/SocialRepository.php#L167-L187 |
22,423 | heidelpay/PhpDoc | src/phpDocumentor/Plugin/Core/Transformer/Writer/FileIo.php | FileIo.executeQueryCopy | public function executeQueryCopy(Transformation $transformation)
{
$path = $transformation->getSourceAsPath();
if (!is_readable($path)) {
throw new Exception('Unable to read the source file: ' . $path);
}
if (!is_writable($transformation->getTransformer()->getTarget())) ... | php | public function executeQueryCopy(Transformation $transformation)
{
$path = $transformation->getSourceAsPath();
if (!is_readable($path)) {
throw new Exception('Unable to read the source file: ' . $path);
}
if (!is_writable($transformation->getTransformer()->getTarget())) ... | [
"public",
"function",
"executeQueryCopy",
"(",
"Transformation",
"$",
"transformation",
")",
"{",
"$",
"path",
"=",
"$",
"transformation",
"->",
"getSourceAsPath",
"(",
")",
";",
"if",
"(",
"!",
"is_readable",
"(",
"$",
"path",
")",
")",
"{",
"throw",
"new... | Copies files or folders to the Artifact location.
@param Transformation $transformation Transformation to use as data source.
@throws Exception
@return void | [
"Copies",
"files",
"or",
"folders",
"to",
"the",
"Artifact",
"location",
"."
] | 5ac9e842cbd4cbb70900533b240c131f3515ee02 | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Plugin/Core/Transformer/Writer/FileIo.php#L68-L85 |
22,424 | trunda/SmfMenu | src/Smf/Menu/Config/Extension.php | Extension.loadConfiguration | public function loadConfiguration()
{
$builder = $this->getContainerBuilder();
$config = $this->getConfig($this->defaults);
// Create instance of extension
$menuFactory = $builder->addDefinition($this->prefix('extension'))
->setClass('Smf\Menu\MenuExtension');
/... | php | public function loadConfiguration()
{
$builder = $this->getContainerBuilder();
$config = $this->getConfig($this->defaults);
// Create instance of extension
$menuFactory = $builder->addDefinition($this->prefix('extension'))
->setClass('Smf\Menu\MenuExtension');
/... | [
"public",
"function",
"loadConfiguration",
"(",
")",
"{",
"$",
"builder",
"=",
"$",
"this",
"->",
"getContainerBuilder",
"(",
")",
";",
"$",
"config",
"=",
"$",
"this",
"->",
"getConfig",
"(",
"$",
"this",
"->",
"defaults",
")",
";",
"// Create instance of... | Configuration - container building | [
"Configuration",
"-",
"container",
"building"
] | 739e74fb664c1f018b4a74142bd28d20c004bac6 | https://github.com/trunda/SmfMenu/blob/739e74fb664c1f018b4a74142bd28d20c004bac6/src/Smf/Menu/Config/Extension.php#L37-L83 |
22,425 | trunda/SmfMenu | src/Smf/Menu/Config/Extension.php | Extension.register | public static function register(Nette\Configurator $configurator, $name = self::DEFAULT_EXTENSION_NAME)
{
$class = get_called_class();
$configurator->onCompile[] = function (Nette\Configurator $configurator, Nette\DI\Compiler $compiler) use ($class, $name) {
$compiler->addExtension($name... | php | public static function register(Nette\Configurator $configurator, $name = self::DEFAULT_EXTENSION_NAME)
{
$class = get_called_class();
$configurator->onCompile[] = function (Nette\Configurator $configurator, Nette\DI\Compiler $compiler) use ($class, $name) {
$compiler->addExtension($name... | [
"public",
"static",
"function",
"register",
"(",
"Nette",
"\\",
"Configurator",
"$",
"configurator",
",",
"$",
"name",
"=",
"self",
"::",
"DEFAULT_EXTENSION_NAME",
")",
"{",
"$",
"class",
"=",
"get_called_class",
"(",
")",
";",
"$",
"configurator",
"->",
"on... | Register extension to compiler.
@param Configurator $configurator
@param string $name | [
"Register",
"extension",
"to",
"compiler",
"."
] | 739e74fb664c1f018b4a74142bd28d20c004bac6 | https://github.com/trunda/SmfMenu/blob/739e74fb664c1f018b4a74142bd28d20c004bac6/src/Smf/Menu/Config/Extension.php#L113-L119 |
22,426 | rhosocial/yii2-user | models/invitation/registration/UserInvitationRegistrationTrait.php | UserInvitationRegistrationTrait.hasEnabledInvitationRegistration | public function hasEnabledInvitationRegistration()
{
if ($this->invitationRegistrationClass === false || !is_string($this->invitationRegistrationClass) || !class_exists($this->invitationRegistrationClass)) {
return false;
}
return true;
} | php | public function hasEnabledInvitationRegistration()
{
if ($this->invitationRegistrationClass === false || !is_string($this->invitationRegistrationClass) || !class_exists($this->invitationRegistrationClass)) {
return false;
}
return true;
} | [
"public",
"function",
"hasEnabledInvitationRegistration",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"invitationRegistrationClass",
"===",
"false",
"||",
"!",
"is_string",
"(",
"$",
"this",
"->",
"invitationRegistrationClass",
")",
"||",
"!",
"class_exists",
"("... | Check whether this user enables the invitation from registration feature or not.
@return boolean | [
"Check",
"whether",
"this",
"user",
"enables",
"the",
"invitation",
"from",
"registration",
"feature",
"or",
"not",
"."
] | 96737a9d8ca7e9c42cd2b7736d6c0a90ede6e5bc | https://github.com/rhosocial/yii2-user/blob/96737a9d8ca7e9c42cd2b7736d6c0a90ede6e5bc/models/invitation/registration/UserInvitationRegistrationTrait.php#L86-L92 |
22,427 | glynnforrest/active-doctrine | src/ActiveDoctrine/Entity/EntityCollection.php | EntityCollection.setColumn | public function setColumn($name, $value)
{
foreach ($this->entities as $entity) {
$entity->set($name, $value);
}
return $this;
} | php | public function setColumn($name, $value)
{
foreach ($this->entities as $entity) {
$entity->set($name, $value);
}
return $this;
} | [
"public",
"function",
"setColumn",
"(",
"$",
"name",
",",
"$",
"value",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"entities",
"as",
"$",
"entity",
")",
"{",
"$",
"entity",
"->",
"set",
"(",
"$",
"name",
",",
"$",
"value",
")",
";",
"}",
"retur... | Set the value of a column for all entities in this
collection. Setter methods will be called.
@param string $name The name of the column
@param mixed $value The value
@return EntityCollection This collection | [
"Set",
"the",
"value",
"of",
"a",
"column",
"for",
"all",
"entities",
"in",
"this",
"collection",
".",
"Setter",
"methods",
"will",
"be",
"called",
"."
] | fcf8c434c7df4704966107bf9a95c005a0b37168 | https://github.com/glynnforrest/active-doctrine/blob/fcf8c434c7df4704966107bf9a95c005a0b37168/src/ActiveDoctrine/Entity/EntityCollection.php#L68-L75 |
22,428 | glynnforrest/active-doctrine | src/ActiveDoctrine/Entity/EntityCollection.php | EntityCollection.setColumnRaw | public function setColumnRaw($name, $value)
{
foreach ($this->entities as $entity) {
$entity->setRaw($name, $value);
}
return $this;
} | php | public function setColumnRaw($name, $value)
{
foreach ($this->entities as $entity) {
$entity->setRaw($name, $value);
}
return $this;
} | [
"public",
"function",
"setColumnRaw",
"(",
"$",
"name",
",",
"$",
"value",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"entities",
"as",
"$",
"entity",
")",
"{",
"$",
"entity",
"->",
"setRaw",
"(",
"$",
"name",
",",
"$",
"value",
")",
";",
"}",
... | Set the value of a column for all entities in this
collection. Setter methods will not be called.
@param string $name The name of the column
@param mixed $value The value
@return EntityCollection This collection | [
"Set",
"the",
"value",
"of",
"a",
"column",
"for",
"all",
"entities",
"in",
"this",
"collection",
".",
"Setter",
"methods",
"will",
"not",
"be",
"called",
"."
] | fcf8c434c7df4704966107bf9a95c005a0b37168 | https://github.com/glynnforrest/active-doctrine/blob/fcf8c434c7df4704966107bf9a95c005a0b37168/src/ActiveDoctrine/Entity/EntityCollection.php#L85-L92 |
22,429 | glynnforrest/active-doctrine | src/ActiveDoctrine/Entity/EntityCollection.php | EntityCollection.getColumn | public function getColumn($name)
{
$results = [];
foreach ($this->entities as $entity) {
$results[] = $entity->get($name);
}
return $results;
} | php | public function getColumn($name)
{
$results = [];
foreach ($this->entities as $entity) {
$results[] = $entity->get($name);
}
return $results;
} | [
"public",
"function",
"getColumn",
"(",
"$",
"name",
")",
"{",
"$",
"results",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"entities",
"as",
"$",
"entity",
")",
"{",
"$",
"results",
"[",
"]",
"=",
"$",
"entity",
"->",
"get",
"(",
"$",
... | Get the values of a single column from all entities in this
collection. Getter methods will be called.
@param string $name The name of the column
@return array A list of values | [
"Get",
"the",
"values",
"of",
"a",
"single",
"column",
"from",
"all",
"entities",
"in",
"this",
"collection",
".",
"Getter",
"methods",
"will",
"be",
"called",
"."
] | fcf8c434c7df4704966107bf9a95c005a0b37168 | https://github.com/glynnforrest/active-doctrine/blob/fcf8c434c7df4704966107bf9a95c005a0b37168/src/ActiveDoctrine/Entity/EntityCollection.php#L101-L109 |
22,430 | glynnforrest/active-doctrine | src/ActiveDoctrine/Entity/EntityCollection.php | EntityCollection.getColumnRaw | public function getColumnRaw($name)
{
$results = [];
foreach ($this->entities as $entity) {
$results[] = $entity->getRaw($name);
}
return $results;
} | php | public function getColumnRaw($name)
{
$results = [];
foreach ($this->entities as $entity) {
$results[] = $entity->getRaw($name);
}
return $results;
} | [
"public",
"function",
"getColumnRaw",
"(",
"$",
"name",
")",
"{",
"$",
"results",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"entities",
"as",
"$",
"entity",
")",
"{",
"$",
"results",
"[",
"]",
"=",
"$",
"entity",
"->",
"getRaw",
"(",
... | Get the values of a single column from all entities in this
collection. Getter methods will not be called.
@param string $name The name of the column
@return array A list of values | [
"Get",
"the",
"values",
"of",
"a",
"single",
"column",
"from",
"all",
"entities",
"in",
"this",
"collection",
".",
"Getter",
"methods",
"will",
"not",
"be",
"called",
"."
] | fcf8c434c7df4704966107bf9a95c005a0b37168 | https://github.com/glynnforrest/active-doctrine/blob/fcf8c434c7df4704966107bf9a95c005a0b37168/src/ActiveDoctrine/Entity/EntityCollection.php#L118-L126 |
22,431 | glynnforrest/active-doctrine | src/ActiveDoctrine/Entity/EntityCollection.php | EntityCollection.getOne | public function getOne($column, $value, $strict = true)
{
if ($strict) {
foreach ($this->entities as $entity) {
if ($entity->get($column) === $value) {
return $entity;
}
}
} else {
foreach ($this->entities as $en... | php | public function getOne($column, $value, $strict = true)
{
if ($strict) {
foreach ($this->entities as $entity) {
if ($entity->get($column) === $value) {
return $entity;
}
}
} else {
foreach ($this->entities as $en... | [
"public",
"function",
"getOne",
"(",
"$",
"column",
",",
"$",
"value",
",",
"$",
"strict",
"=",
"true",
")",
"{",
"if",
"(",
"$",
"strict",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"entities",
"as",
"$",
"entity",
")",
"{",
"if",
"(",
"$",
... | Get a single Entity from this collection where column =
value. If more than one Entity is matched, the first will be
returned. If no Entity is matched, null will be returned.
@param string $column
@param string $value
@param bool $strict use strict comparison when comparing values
@return mixed Entity or NULL | [
"Get",
"a",
"single",
"Entity",
"from",
"this",
"collection",
"where",
"column",
"=",
"value",
".",
"If",
"more",
"than",
"one",
"Entity",
"is",
"matched",
"the",
"first",
"will",
"be",
"returned",
".",
"If",
"no",
"Entity",
"is",
"matched",
"null",
"wil... | fcf8c434c7df4704966107bf9a95c005a0b37168 | https://github.com/glynnforrest/active-doctrine/blob/fcf8c434c7df4704966107bf9a95c005a0b37168/src/ActiveDoctrine/Entity/EntityCollection.php#L138-L155 |
22,432 | glynnforrest/active-doctrine | src/ActiveDoctrine/Entity/EntityCollection.php | EntityCollection.getRandom | public function getRandom()
{
return empty($this->entities) ? null : $this->entities[array_rand($this->entities)];
} | php | public function getRandom()
{
return empty($this->entities) ? null : $this->entities[array_rand($this->entities)];
} | [
"public",
"function",
"getRandom",
"(",
")",
"{",
"return",
"empty",
"(",
"$",
"this",
"->",
"entities",
")",
"?",
"null",
":",
"$",
"this",
"->",
"entities",
"[",
"array_rand",
"(",
"$",
"this",
"->",
"entities",
")",
"]",
";",
"}"
] | Get a random Entity from this collection, or null if the
collection is empty.
@return Entity|null | [
"Get",
"a",
"random",
"Entity",
"from",
"this",
"collection",
"or",
"null",
"if",
"the",
"collection",
"is",
"empty",
"."
] | fcf8c434c7df4704966107bf9a95c005a0b37168 | https://github.com/glynnforrest/active-doctrine/blob/fcf8c434c7df4704966107bf9a95c005a0b37168/src/ActiveDoctrine/Entity/EntityCollection.php#L163-L166 |
22,433 | glynnforrest/active-doctrine | src/ActiveDoctrine/Entity/EntityCollection.php | EntityCollection.remove | public function remove($column, $value)
{
foreach ($this->entities as $index => $entity) {
if ($entity->get($column) === $value) {
//remove the entity and reset the keys
unset($this->entities[$index]);
$this->entities = array_values($this->entities... | php | public function remove($column, $value)
{
foreach ($this->entities as $index => $entity) {
if ($entity->get($column) === $value) {
//remove the entity and reset the keys
unset($this->entities[$index]);
$this->entities = array_values($this->entities... | [
"public",
"function",
"remove",
"(",
"$",
"column",
",",
"$",
"value",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"entities",
"as",
"$",
"index",
"=>",
"$",
"entity",
")",
"{",
"if",
"(",
"$",
"entity",
"->",
"get",
"(",
"$",
"column",
")",
"==... | Remove a single Entity from this collection where column =
value. If more than one Entity is matched, the first will be
removed and returned. If no Entity is matched, null will be
returned.
@param string $column
@param string $value
@return mixed The removed Entity or NULL | [
"Remove",
"a",
"single",
"Entity",
"from",
"this",
"collection",
"where",
"column",
"=",
"value",
".",
"If",
"more",
"than",
"one",
"Entity",
"is",
"matched",
"the",
"first",
"will",
"be",
"removed",
"and",
"returned",
".",
"If",
"no",
"Entity",
"is",
"m... | fcf8c434c7df4704966107bf9a95c005a0b37168 | https://github.com/glynnforrest/active-doctrine/blob/fcf8c434c7df4704966107bf9a95c005a0b37168/src/ActiveDoctrine/Entity/EntityCollection.php#L178-L191 |
22,434 | glynnforrest/active-doctrine | src/ActiveDoctrine/Entity/EntityCollection.php | EntityCollection.removeRandom | public function removeRandom()
{
$index = array_rand($this->entities);
$entity = $this->entities[$index];
unset($this->entities[$index]);
return $entity;
} | php | public function removeRandom()
{
$index = array_rand($this->entities);
$entity = $this->entities[$index];
unset($this->entities[$index]);
return $entity;
} | [
"public",
"function",
"removeRandom",
"(",
")",
"{",
"$",
"index",
"=",
"array_rand",
"(",
"$",
"this",
"->",
"entities",
")",
";",
"$",
"entity",
"=",
"$",
"this",
"->",
"entities",
"[",
"$",
"index",
"]",
";",
"unset",
"(",
"$",
"this",
"->",
"en... | Remove a random Entity from this collection, or null if the
collection is empty.
@return Entity|null | [
"Remove",
"a",
"random",
"Entity",
"from",
"this",
"collection",
"or",
"null",
"if",
"the",
"collection",
"is",
"empty",
"."
] | fcf8c434c7df4704966107bf9a95c005a0b37168 | https://github.com/glynnforrest/active-doctrine/blob/fcf8c434c7df4704966107bf9a95c005a0b37168/src/ActiveDoctrine/Entity/EntityCollection.php#L199-L206 |
22,435 | comodojo/daemon | src/Comodojo/Daemon/Utils/ProcessTools.php | ProcessTools.term | public static function term($pid, $lagger_timeout = 0, $signal = SIGTERM) {
$kill_time = time() + $lagger_timeout;
// $term = posix_kill($pid, $signal);
$term = self::signal($pid, $signal);
while ( time() < $kill_time ) {
if ( !self::isRunning($pid) ) return $term;
... | php | public static function term($pid, $lagger_timeout = 0, $signal = SIGTERM) {
$kill_time = time() + $lagger_timeout;
// $term = posix_kill($pid, $signal);
$term = self::signal($pid, $signal);
while ( time() < $kill_time ) {
if ( !self::isRunning($pid) ) return $term;
... | [
"public",
"static",
"function",
"term",
"(",
"$",
"pid",
",",
"$",
"lagger_timeout",
"=",
"0",
",",
"$",
"signal",
"=",
"SIGTERM",
")",
"{",
"$",
"kill_time",
"=",
"time",
"(",
")",
"+",
"$",
"lagger_timeout",
";",
"// $term = posix_kill($pid, $signal);",
... | Terminate a process, asking PID to terminate or killing it directly.
@param int $pid
@param int $lagger_timeout Timeout to wait before killing process if it refuses to terminate
@param int $signal Signal to send (default to SIGTERM)
@return bool | [
"Terminate",
"a",
"process",
"asking",
"PID",
"to",
"terminate",
"or",
"killing",
"it",
"directly",
"."
] | 361b0a3a91dc7720dd3bec448bb4ca47d0ef0292 | https://github.com/comodojo/daemon/blob/361b0a3a91dc7720dd3bec448bb4ca47d0ef0292/src/Comodojo/Daemon/Utils/ProcessTools.php#L32-L48 |
22,436 | comodojo/daemon | src/Comodojo/Daemon/Utils/ProcessTools.php | ProcessTools.setNiceness | public static function setNiceness($niceness, $pid = null) {
return is_null($pid) ? @proc_nice($niceness) : @pcntl_setpriority($pid, $niceness);
} | php | public static function setNiceness($niceness, $pid = null) {
return is_null($pid) ? @proc_nice($niceness) : @pcntl_setpriority($pid, $niceness);
} | [
"public",
"static",
"function",
"setNiceness",
"(",
"$",
"niceness",
",",
"$",
"pid",
"=",
"null",
")",
"{",
"return",
"is_null",
"(",
"$",
"pid",
")",
"?",
"@",
"proc_nice",
"(",
"$",
"niceness",
")",
":",
"@",
"pcntl_setpriority",
"(",
"$",
"pid",
... | Set niceness of a running process
@param int|null $pid The pid to query, or current process if null
@return bool | [
"Set",
"niceness",
"of",
"a",
"running",
"process"
] | 361b0a3a91dc7720dd3bec448bb4ca47d0ef0292 | https://github.com/comodojo/daemon/blob/361b0a3a91dc7720dd3bec448bb4ca47d0ef0292/src/Comodojo/Daemon/Utils/ProcessTools.php#L99-L103 |
22,437 | titledk/silverstripe-uploaddirrules | code/rules/UploadDirRules.php | UploadDirRules.calc_base_directory_for_object | public static function calc_base_directory_for_object(DataObject $do)
{
//the 2 base options - dataobjects / pages
$str = 'dataobjects';
$ancestry = $do->getClassAncestry();
foreach ($ancestry as $c) {
if ($c == 'SiteTree') {
$str = 'pages';
}... | php | public static function calc_base_directory_for_object(DataObject $do)
{
//the 2 base options - dataobjects / pages
$str = 'dataobjects';
$ancestry = $do->getClassAncestry();
foreach ($ancestry as $c) {
if ($c == 'SiteTree') {
$str = 'pages';
}... | [
"public",
"static",
"function",
"calc_base_directory_for_object",
"(",
"DataObject",
"$",
"do",
")",
"{",
"//the 2 base options - dataobjects / pages",
"$",
"str",
"=",
"'dataobjects'",
";",
"$",
"ancestry",
"=",
"$",
"do",
"->",
"getClassAncestry",
"(",
")",
";",
... | Base rules.
@param DataObject $do
@return string | [
"Base",
"rules",
"."
] | ed8ece7b6a4ca86dcb5dc16ee10ff339f629de3c | https://github.com/titledk/silverstripe-uploaddirrules/blob/ed8ece7b6a4ca86dcb5dc16ee10ff339f629de3c/code/rules/UploadDirRules.php#L32-L59 |
22,438 | nabab/bbn | src/bbn/db/languages/sqlite.php | sqlite.delete_index | public function delete_index(string $table, string $key): bool
{
if ( ( $table = $this->table_full_name($table, 1) ) && bbn\str::check_name($key) ){
return (bool)$this->db->query("ALTER TABLE $table DROP INDEX `$key`");
}
return false;
} | php | public function delete_index(string $table, string $key): bool
{
if ( ( $table = $this->table_full_name($table, 1) ) && bbn\str::check_name($key) ){
return (bool)$this->db->query("ALTER TABLE $table DROP INDEX `$key`");
}
return false;
} | [
"public",
"function",
"delete_index",
"(",
"string",
"$",
"table",
",",
"string",
"$",
"key",
")",
":",
"bool",
"{",
"if",
"(",
"(",
"$",
"table",
"=",
"$",
"this",
"->",
"table_full_name",
"(",
"$",
"table",
",",
"1",
")",
")",
"&&",
"bbn",
"\\",
... | Deletes an index
@param null|string $table
@param string $key
@return bool | [
"Deletes",
"an",
"index"
] | 439fea2faa0de22fdaae2611833bab8061f40c37 | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/db/languages/sqlite.php#L979-L985 |
22,439 | qlake/framework | src/Qlake/Routing/Collection.php | Collection.addRoute | public function addRoute(Route $route)
{
foreach ($route->getMethods() as $method)
{
$this->routes[$method][/*$route->uri*/] = $route;
}
$this->allRoutes[] = $route;
return $this;
} | php | public function addRoute(Route $route)
{
foreach ($route->getMethods() as $method)
{
$this->routes[$method][/*$route->uri*/] = $route;
}
$this->allRoutes[] = $route;
return $this;
} | [
"public",
"function",
"addRoute",
"(",
"Route",
"$",
"route",
")",
"{",
"foreach",
"(",
"$",
"route",
"->",
"getMethods",
"(",
")",
"as",
"$",
"method",
")",
"{",
"$",
"this",
"->",
"routes",
"[",
"$",
"method",
"]",
"[",
"/*$route->uri*/",
"]",
"=",... | Add a Route instans to application routes.
@param Qlake\Routing\Route
@return Qlake\Routing\Route | [
"Add",
"a",
"Route",
"instans",
"to",
"application",
"routes",
"."
] | 0b7bad459ae0721bc5cdd141344f9dfc1acee28a | https://github.com/qlake/framework/blob/0b7bad459ae0721bc5cdd141344f9dfc1acee28a/src/Qlake/Routing/Collection.php#L33-L43 |
22,440 | mridang/magazine | src/Magazine/Magazine.php | Magazine.rglob | protected function rglob($pattern, $excludes = array()) {
$files = array();
foreach (glob($pattern, 0) as $item) {
if (!empty($excludes) && in_array(ltrim($item, '\.\/'), $excludes)) {
$this->trace("Skipping excluded item ./%s", ltrim($item, '\.\/'));
continue... | php | protected function rglob($pattern, $excludes = array()) {
$files = array();
foreach (glob($pattern, 0) as $item) {
if (!empty($excludes) && in_array(ltrim($item, '\.\/'), $excludes)) {
$this->trace("Skipping excluded item ./%s", ltrim($item, '\.\/'));
continue... | [
"protected",
"function",
"rglob",
"(",
"$",
"pattern",
",",
"$",
"excludes",
"=",
"array",
"(",
")",
")",
"{",
"$",
"files",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"glob",
"(",
"$",
"pattern",
",",
"0",
")",
"as",
"$",
"item",
")",
"{",
"... | Recursively globs all the files and directories using the given pattern.
If any file or directory exists in the list of excluded items, it is
skipped
@param $pattern string the glob pattern for selecting files and directories
@param array $excludes the array of files and directories to exclude
@return array the array ... | [
"Recursively",
"globs",
"all",
"the",
"files",
"and",
"directories",
"using",
"the",
"given",
"pattern",
".",
"If",
"any",
"file",
"or",
"directory",
"exists",
"in",
"the",
"list",
"of",
"excluded",
"items",
"it",
"is",
"skipped"
] | 5b3cfecc472c61fde6af63efe62690a30a267a04 | https://github.com/mridang/magazine/blob/5b3cfecc472c61fde6af63efe62690a30a267a04/src/Magazine/Magazine.php#L173-L188 |
22,441 | mridang/magazine | src/Magazine/Magazine.php | Magazine.amendDynamicAttributesToJson | private function amendDynamicAttributesToJson(array &$json) {
if (!is_null($this->package_version)) {
$json['version'] = array();
$json['version']['release'] = $this->package_version;
}
if (!is_null($this->package_name)) {
$json['name'] = $this->package_name;
... | php | private function amendDynamicAttributesToJson(array &$json) {
if (!is_null($this->package_version)) {
$json['version'] = array();
$json['version']['release'] = $this->package_version;
}
if (!is_null($this->package_name)) {
$json['name'] = $this->package_name;
... | [
"private",
"function",
"amendDynamicAttributesToJson",
"(",
"array",
"&",
"$",
"json",
")",
"{",
"if",
"(",
"!",
"is_null",
"(",
"$",
"this",
"->",
"package_version",
")",
")",
"{",
"$",
"json",
"[",
"'version'",
"]",
"=",
"array",
"(",
")",
";",
"$",
... | Adds attributes given from command line to the json
@param array $json array of the json in magazine.json | [
"Adds",
"attributes",
"given",
"from",
"command",
"line",
"to",
"the",
"json"
] | 5b3cfecc472c61fde6af63efe62690a30a267a04 | https://github.com/mridang/magazine/blob/5b3cfecc472c61fde6af63efe62690a30a267a04/src/Magazine/Magazine.php#L233-L241 |
22,442 | ekuiter/feature-php | FeaturePhp/Model/Configuration.php | Configuration.getValue | public function getValue($feature) {
// side effect: checks for instanceof ValueFeature
$defaultValue = $feature->getDefaultValue();
$values = $this->xmlConfiguration->getValues();
if (array_key_exists($feature->getName(), $values))
return $values[$feature->getName()];
... | php | public function getValue($feature) {
// side effect: checks for instanceof ValueFeature
$defaultValue = $feature->getDefaultValue();
$values = $this->xmlConfiguration->getValues();
if (array_key_exists($feature->getName(), $values))
return $values[$feature->getName()];
... | [
"public",
"function",
"getValue",
"(",
"$",
"feature",
")",
"{",
"// side effect: checks for instanceof ValueFeature",
"$",
"defaultValue",
"=",
"$",
"feature",
"->",
"getDefaultValue",
"(",
")",
";",
"$",
"values",
"=",
"$",
"this",
"->",
"xmlConfiguration",
"->"... | Returns the configuration's value for a value feature.
@param ValueFeature $feature
@return string | [
"Returns",
"the",
"configuration",
"s",
"value",
"for",
"a",
"value",
"feature",
"."
] | daf4a59098802fedcfd1f1a1d07847fcf2fea7bf | https://github.com/ekuiter/feature-php/blob/daf4a59098802fedcfd1f1a1d07847fcf2fea7bf/FeaturePhp/Model/Configuration.php#L96-L104 |
22,443 | ekuiter/feature-php | FeaturePhp/Model/Configuration.php | Configuration.renderAnalysis | public function renderAnalysis($productLine = null, $textOnly = false) {
return (new ConfigurationRenderer($this, $productLine))->render($textOnly);
} | php | public function renderAnalysis($productLine = null, $textOnly = false) {
return (new ConfigurationRenderer($this, $productLine))->render($textOnly);
} | [
"public",
"function",
"renderAnalysis",
"(",
"$",
"productLine",
"=",
"null",
",",
"$",
"textOnly",
"=",
"false",
")",
"{",
"return",
"(",
"new",
"ConfigurationRenderer",
"(",
"$",
"this",
",",
"$",
"productLine",
")",
")",
"->",
"render",
"(",
"$",
"tex... | Analyzes the model and configuration by returning a web page.
@param \FeaturePhp\ProductLine\ProductLine $productLine
optional product line to render more information
@param bool $textOnly whether to render text or HTML
@return string | [
"Analyzes",
"the",
"model",
"and",
"configuration",
"by",
"returning",
"a",
"web",
"page",
"."
] | daf4a59098802fedcfd1f1a1d07847fcf2fea7bf | https://github.com/ekuiter/feature-php/blob/daf4a59098802fedcfd1f1a1d07847fcf2fea7bf/FeaturePhp/Model/Configuration.php#L121-L123 |
22,444 | hametuha/wpametu | src/WPametu/UI/Field/Number.php | Number.get_field | protected function get_field( \WP_Post $post ){
$field = parent::get_field($post);
if( $this->prefix ){
$field = $this->prefix.' '.$field;
}
if( $this->suffix ){
$field .= $this->suffix;
}
return $field;
} | php | protected function get_field( \WP_Post $post ){
$field = parent::get_field($post);
if( $this->prefix ){
$field = $this->prefix.' '.$field;
}
if( $this->suffix ){
$field .= $this->suffix;
}
return $field;
} | [
"protected",
"function",
"get_field",
"(",
"\\",
"WP_Post",
"$",
"post",
")",
"{",
"$",
"field",
"=",
"parent",
"::",
"get_field",
"(",
"$",
"post",
")",
";",
"if",
"(",
"$",
"this",
"->",
"prefix",
")",
"{",
"$",
"field",
"=",
"$",
"this",
"->",
... | Add suffix or prefix to field
@param \WP_Post $post
@return array|string | [
"Add",
"suffix",
"or",
"prefix",
"to",
"field"
] | 0939373800815a8396291143d2a57967340da5aa | https://github.com/hametuha/wpametu/blob/0939373800815a8396291143d2a57967340da5aa/src/WPametu/UI/Field/Number.php#L42-L51 |
22,445 | opsbears/piccolo | src/Module/ModuleDependencyGraph.php | ModuleDependencyGraph.getSortedModuleList | public function getSortedModuleList() : array {
$moduleList = $this->modules;
foreach ($moduleList as $moduleSpec) {
$moduleClass = $moduleSpec['class'];
$module = $moduleSpec['object'];
if ($module instanceof OrderAwareModule) {
//All modules that should be loaded after this one
foreach ($m... | php | public function getSortedModuleList() : array {
$moduleList = $this->modules;
foreach ($moduleList as $moduleSpec) {
$moduleClass = $moduleSpec['class'];
$module = $moduleSpec['object'];
if ($module instanceof OrderAwareModule) {
//All modules that should be loaded after this one
foreach ($m... | [
"public",
"function",
"getSortedModuleList",
"(",
")",
":",
"array",
"{",
"$",
"moduleList",
"=",
"$",
"this",
"->",
"modules",
";",
"foreach",
"(",
"$",
"moduleList",
"as",
"$",
"moduleSpec",
")",
"{",
"$",
"moduleClass",
"=",
"$",
"moduleSpec",
"[",
"'... | Returns a list of modules, sorted by dependencies.
@return Module[]
@throws CircularModuleLoadOrderDetectedException | [
"Returns",
"a",
"list",
"of",
"modules",
"sorted",
"by",
"dependencies",
"."
] | ebba9f892ed35965140265ba1c61b2c645eab6e0 | https://github.com/opsbears/piccolo/blob/ebba9f892ed35965140265ba1c61b2c645eab6e0/src/Module/ModuleDependencyGraph.php#L80-L148 |
22,446 | ezsystems/ezcomments-ls-extension | classes/ezcomcommentcommonmanager.php | ezcomCommentCommonManager.afterAddingComment | public function afterAddingComment( $comment, $notification )
{
$contentID = $comment->attribute( 'contentobject_id' );
$languageID = $comment->attribute( 'language_id' );
$subscriptionType = 'ezcomcomment';
//add subscription
$subscription = ezcomSubscriptionManager::instan... | php | public function afterAddingComment( $comment, $notification )
{
$contentID = $comment->attribute( 'contentobject_id' );
$languageID = $comment->attribute( 'language_id' );
$subscriptionType = 'ezcomcomment';
//add subscription
$subscription = ezcomSubscriptionManager::instan... | [
"public",
"function",
"afterAddingComment",
"(",
"$",
"comment",
",",
"$",
"notification",
")",
"{",
"$",
"contentID",
"=",
"$",
"comment",
"->",
"attribute",
"(",
"'contentobject_id'",
")",
";",
"$",
"languageID",
"=",
"$",
"comment",
"->",
"attribute",
"("... | add subscription after adding comment
1) If 'notification' is true
add the user as a subscriber if subscriber with same email doesn't exist
otherwise get the subscriber
2) If 'notification' is true
if the subscription with user's email and contentid doesn't exist, add a new subscription,
3) If there is subscription, ad... | [
"add",
"subscription",
"after",
"adding",
"comment",
"1",
")",
"If",
"notification",
"is",
"true",
"add",
"the",
"user",
"as",
"a",
"subscriber",
"if",
"subscriber",
"with",
"same",
"email",
"doesn",
"t",
"exist",
"otherwise",
"get",
"the",
"subscriber",
"2"... | 2b4cd8c34d4a77813e4d6a9c5a0d317a274c63c5 | https://github.com/ezsystems/ezcomments-ls-extension/blob/2b4cd8c34d4a77813e4d6a9c5a0d317a274c63c5/classes/ezcomcommentcommonmanager.php#L40-L70 |
22,447 | ezsystems/ezcomments-ls-extension | classes/ezcomcommentcommonmanager.php | ezcomCommentCommonManager.afterUpdatingComment | public function afterUpdatingComment( $comment, $notified, $time )
{
$user = eZUser::fetch( $comment->attribute( 'user_id' ) );
// if notified is true, add subscription, else cleanup the subscription on the user and content
$contentID = $comment->attribute( 'contentobject_id' );
$la... | php | public function afterUpdatingComment( $comment, $notified, $time )
{
$user = eZUser::fetch( $comment->attribute( 'user_id' ) );
// if notified is true, add subscription, else cleanup the subscription on the user and content
$contentID = $comment->attribute( 'contentobject_id' );
$la... | [
"public",
"function",
"afterUpdatingComment",
"(",
"$",
"comment",
",",
"$",
"notified",
",",
"$",
"time",
")",
"{",
"$",
"user",
"=",
"eZUser",
"::",
"fetch",
"(",
"$",
"comment",
"->",
"attribute",
"(",
"'user_id'",
")",
")",
";",
"// if notified is true... | clean up subscription after updating comment
@see extension/ezcomments/classes/ezcomCommentManager#afterUpdatingComment($comment, $notified) | [
"clean",
"up",
"subscription",
"after",
"updating",
"comment"
] | 2b4cd8c34d4a77813e4d6a9c5a0d317a274c63c5 | https://github.com/ezsystems/ezcomments-ls-extension/blob/2b4cd8c34d4a77813e4d6a9c5a0d317a274c63c5/classes/ezcomcommentcommonmanager.php#L85-L144 |
22,448 | willhoffmann/domuserp-php | src/DomusClient.php | DomusClient.authenticate | public function authenticate()
{
$request = new Request($this->handler);
$this->token = $request->execute(
RequestMethods::HTTP_POST,
$this->makeUrl(RequestMethods::DOMUSERP_API_PEDIDOVENDA . '/auth'),
[
'json' => [
'login' =... | php | public function authenticate()
{
$request = new Request($this->handler);
$this->token = $request->execute(
RequestMethods::HTTP_POST,
$this->makeUrl(RequestMethods::DOMUSERP_API_PEDIDOVENDA . '/auth'),
[
'json' => [
'login' =... | [
"public",
"function",
"authenticate",
"(",
")",
"{",
"$",
"request",
"=",
"new",
"Request",
"(",
"$",
"this",
"->",
"handler",
")",
";",
"$",
"this",
"->",
"token",
"=",
"$",
"request",
"->",
"execute",
"(",
"RequestMethods",
"::",
"HTTP_POST",
",",
"$... | Request an access token and sets it to the client.
@return $this
@throws \GuzzleHttp\Exception\GuzzleException | [
"Request",
"an",
"access",
"token",
"and",
"sets",
"it",
"to",
"the",
"client",
"."
] | 44e77a4f02b0252bc26cae4c0e6b2b7d578f10a6 | https://github.com/willhoffmann/domuserp-php/blob/44e77a4f02b0252bc26cae4c0e6b2b7d578f10a6/src/DomusClient.php#L156-L171 |
22,449 | technote-space/wordpress-plugin-base | src/technote.php | Technote.plugins_loaded | private function plugins_loaded() {
if ( $this->_plugins_loaded ) {
return;
}
$this->_plugins_loaded = true;
spl_autoload_register( function ( $class ) {
return $this->get_main()->load_class( $class );
} );
$this->load_functions();
} | php | private function plugins_loaded() {
if ( $this->_plugins_loaded ) {
return;
}
$this->_plugins_loaded = true;
spl_autoload_register( function ( $class ) {
return $this->get_main()->load_class( $class );
} );
$this->load_functions();
} | [
"private",
"function",
"plugins_loaded",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_plugins_loaded",
")",
"{",
"return",
";",
"}",
"$",
"this",
"->",
"_plugins_loaded",
"=",
"true",
";",
"spl_autoload_register",
"(",
"function",
"(",
"$",
"class",
")",... | load basic files | [
"load",
"basic",
"files"
] | 02cfcba358432a2539af07a69d9db00ff7c14eac | https://github.com/technote-space/wordpress-plugin-base/blob/02cfcba358432a2539af07a69d9db00ff7c14eac/src/technote.php#L352-L363 |
22,450 | technote-space/wordpress-plugin-base | src/technote.php | Technote.load_functions | private function load_functions() {
if ( $this->is_theme ) {
return;
}
$functions = $this->define->plugin_dir . DS . 'functions.php';
if ( is_readable( $functions ) ) {
/** @noinspection PhpIncludeInspection */
require_once $functions;
}
} | php | private function load_functions() {
if ( $this->is_theme ) {
return;
}
$functions = $this->define->plugin_dir . DS . 'functions.php';
if ( is_readable( $functions ) ) {
/** @noinspection PhpIncludeInspection */
require_once $functions;
}
} | [
"private",
"function",
"load_functions",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"is_theme",
")",
"{",
"return",
";",
"}",
"$",
"functions",
"=",
"$",
"this",
"->",
"define",
"->",
"plugin_dir",
".",
"DS",
".",
"'functions.php'",
";",
"if",
"(",
... | load functions file
@since 2.10.1 Improved: for theme (#115) | [
"load",
"functions",
"file"
] | 02cfcba358432a2539af07a69d9db00ff7c14eac | https://github.com/technote-space/wordpress-plugin-base/blob/02cfcba358432a2539af07a69d9db00ff7c14eac/src/technote.php#L369-L378 |
22,451 | heidelpay/PhpDoc | src/phpDocumentor/Compiler/Pass/ResolveInlineLinkAndSeeTags.php | ResolveInlineLinkAndSeeTags.resolveQsen | private function resolveQsen($link)
{
if (!$this->isFqsen($link)) {
$typeCollection = new TypeCollection(array($link), $this->createDocBlockContext());
// only a single element reference is allowed!
$link = $typeCollection[0];
}
return $link;
} | php | private function resolveQsen($link)
{
if (!$this->isFqsen($link)) {
$typeCollection = new TypeCollection(array($link), $this->createDocBlockContext());
// only a single element reference is allowed!
$link = $typeCollection[0];
}
return $link;
} | [
"private",
"function",
"resolveQsen",
"(",
"$",
"link",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"isFqsen",
"(",
"$",
"link",
")",
")",
"{",
"$",
"typeCollection",
"=",
"new",
"TypeCollection",
"(",
"array",
"(",
"$",
"link",
")",
",",
"$",
"th... | Resolves a QSEN to a FQSEN.
If a relative QSEN is provided then this method will attempt to resolve it given the current namespace and
namespace aliases.
@param string $link
@return string | [
"Resolves",
"a",
"QSEN",
"to",
"a",
"FQSEN",
"."
] | 5ac9e842cbd4cbb70900533b240c131f3515ee02 | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Compiler/Pass/ResolveInlineLinkAndSeeTags.php#L178-L188 |
22,452 | heidelpay/PhpDoc | src/phpDocumentor/Compiler/Pass/ResolveInlineLinkAndSeeTags.php | ResolveInlineLinkAndSeeTags.findElement | private function findElement($fqsen)
{
return isset($this->elementCollection[$fqsen]) ? $this->elementCollection[$fqsen] : null;
} | php | private function findElement($fqsen)
{
return isset($this->elementCollection[$fqsen]) ? $this->elementCollection[$fqsen] : null;
} | [
"private",
"function",
"findElement",
"(",
"$",
"fqsen",
")",
"{",
"return",
"isset",
"(",
"$",
"this",
"->",
"elementCollection",
"[",
"$",
"fqsen",
"]",
")",
"?",
"$",
"this",
"->",
"elementCollection",
"[",
"$",
"fqsen",
"]",
":",
"null",
";",
"}"
] | Tries to find an element with the given FQSEN in the elements listing for this project.
@param string $fqsen
@return DescriptorAbstract|null | [
"Tries",
"to",
"find",
"an",
"element",
"with",
"the",
"given",
"FQSEN",
"in",
"the",
"elements",
"listing",
"for",
"this",
"project",
"."
] | 5ac9e842cbd4cbb70900533b240c131f3515ee02 | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Compiler/Pass/ResolveInlineLinkAndSeeTags.php#L234-L237 |
22,453 | i-lateral/silverstripe-users | code/control/Users_Register_Controller.php | Users_Register_Controller.getMenu | public function getMenu($level = 1)
{
if (class_exists(ContentController::class)) {
$controller = Injector::inst()->get(ContentController::class);
return $controller->getMenu($level);
}
} | php | public function getMenu($level = 1)
{
if (class_exists(ContentController::class)) {
$controller = Injector::inst()->get(ContentController::class);
return $controller->getMenu($level);
}
} | [
"public",
"function",
"getMenu",
"(",
"$",
"level",
"=",
"1",
")",
"{",
"if",
"(",
"class_exists",
"(",
"ContentController",
"::",
"class",
")",
")",
"{",
"$",
"controller",
"=",
"Injector",
"::",
"inst",
"(",
")",
"->",
"get",
"(",
"ContentController",
... | If content controller exists, return it's menu function
@param int $level Menu level to return.
@return ArrayList | [
"If",
"content",
"controller",
"exists",
"return",
"it",
"s",
"menu",
"function"
] | 27ddc38890fa2709ac419eccf854ab6b439f0d9a | https://github.com/i-lateral/silverstripe-users/blob/27ddc38890fa2709ac419eccf854ab6b439f0d9a/code/control/Users_Register_Controller.php#L104-L110 |
22,454 | i-lateral/silverstripe-users | code/control/Users_Register_Controller.php | Users_Register_Controller.index | public function index(SS_HTTPRequest $request)
{
$this->customise(
array(
'Title' => _t('Users.Register', 'Register'),
'MetaTitle' => _t('Users.Register', 'Register'),
'Form' => $this->RegisterForm(),
)
);
$this->extend("u... | php | public function index(SS_HTTPRequest $request)
{
$this->customise(
array(
'Title' => _t('Users.Register', 'Register'),
'MetaTitle' => _t('Users.Register', 'Register'),
'Form' => $this->RegisterForm(),
)
);
$this->extend("u... | [
"public",
"function",
"index",
"(",
"SS_HTTPRequest",
"$",
"request",
")",
"{",
"$",
"this",
"->",
"customise",
"(",
"array",
"(",
"'Title'",
"=>",
"_t",
"(",
"'Users.Register'",
",",
"'Register'",
")",
",",
"'MetaTitle'",
"=>",
"_t",
"(",
"'Users.Register'"... | Default action this controller will deal with
@param SS_HTTPRequest $request Current request
@return HTMLText | [
"Default",
"action",
"this",
"controller",
"will",
"deal",
"with"
] | 27ddc38890fa2709ac419eccf854ab6b439f0d9a | https://github.com/i-lateral/silverstripe-users/blob/27ddc38890fa2709ac419eccf854ab6b439f0d9a/code/control/Users_Register_Controller.php#L131-L150 |
22,455 | infinity-next/sleuth | src/FileSleuth.php | FileSleuth.check | public function check($file, $verify = null)
{
if (is_string($verify))
{
$verify = "lead" . strtoupper($verify);
}
$detectives = [];
foreach ($this->detectives as $detectiveClass)
{
if ($detectiveClass::on())
{
$detectives[] = $detectiveClass;
}
}
$case = null;
fo... | php | public function check($file, $verify = null)
{
if (is_string($verify))
{
$verify = "lead" . strtoupper($verify);
}
$detectives = [];
foreach ($this->detectives as $detectiveClass)
{
if ($detectiveClass::on())
{
$detectives[] = $detectiveClass;
}
}
$case = null;
fo... | [
"public",
"function",
"check",
"(",
"$",
"file",
",",
"$",
"verify",
"=",
"null",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"verify",
")",
")",
"{",
"$",
"verify",
"=",
"\"lead\"",
".",
"strtoupper",
"(",
"$",
"verify",
")",
";",
"}",
"$",
"det... | Runs the file against all dectives.
@param string $file Optional parameter to automatically run a check.
@param string|null $verify Extension to verify against. Checks all possible if unset.
@return null|boolean | [
"Runs",
"the",
"file",
"against",
"all",
"dectives",
"."
] | 924b82e4d60f042fddd6b093b324cfa4bb885a13 | https://github.com/infinity-next/sleuth/blob/924b82e4d60f042fddd6b093b324cfa4bb885a13/src/FileSleuth.php#L49-L79 |
22,456 | endorphin-studio/browser-detector-data | src/Storage/AbstractStorage.php | AbstractStorage.setDataDirectory | public function setDataDirectory(string $directory)
{
if (!is_dir($directory)) {
$exception = new StorageException(sprintf(StorageException::DIRECTORY_NOT_FOUND, $directory));
$exception->setDirectory($exception);
$exception->setProvider(static::class);
throw ... | php | public function setDataDirectory(string $directory)
{
if (!is_dir($directory)) {
$exception = new StorageException(sprintf(StorageException::DIRECTORY_NOT_FOUND, $directory));
$exception->setDirectory($exception);
$exception->setProvider(static::class);
throw ... | [
"public",
"function",
"setDataDirectory",
"(",
"string",
"$",
"directory",
")",
"{",
"if",
"(",
"!",
"is_dir",
"(",
"$",
"directory",
")",
")",
"{",
"$",
"exception",
"=",
"new",
"StorageException",
"(",
"sprintf",
"(",
"StorageException",
"::",
"DIRECTORY_N... | Set data directory
@param string $directory
@throws StorageException | [
"Set",
"data",
"directory"
] | cb1ace9f52f9677616c89f3b80c5148936d47b82 | https://github.com/endorphin-studio/browser-detector-data/blob/cb1ace9f52f9677616c89f3b80c5148936d47b82/src/Storage/AbstractStorage.php#L36-L46 |
22,457 | FrenzelGmbH/cm-address | models/scopes/AddressQuery.php | AddressQuery.active | public function active()
{
if(!\Yii::$app->user->isGuest && !\Yii::$app->user->identity->isAdmin)
{
$this->andWhere(['deleted_at' => NULL]);
}
return $this;
} | php | public function active()
{
if(!\Yii::$app->user->isGuest && !\Yii::$app->user->identity->isAdmin)
{
$this->andWhere(['deleted_at' => NULL]);
}
return $this;
} | [
"public",
"function",
"active",
"(",
")",
"{",
"if",
"(",
"!",
"\\",
"Yii",
"::",
"$",
"app",
"->",
"user",
"->",
"isGuest",
"&&",
"!",
"\\",
"Yii",
"::",
"$",
"app",
"->",
"user",
"->",
"identity",
"->",
"isAdmin",
")",
"{",
"$",
"this",
"->",
... | only none delted records should be returned, deleted would mean they are not null anymore within field value
@return [type] [description] | [
"only",
"none",
"delted",
"records",
"should",
"be",
"returned",
"deleted",
"would",
"mean",
"they",
"are",
"not",
"null",
"anymore",
"within",
"field",
"value"
] | 4295671dc603beed4bea6c5a7f77dac9846127f3 | https://github.com/FrenzelGmbH/cm-address/blob/4295671dc603beed4bea6c5a7f77dac9846127f3/models/scopes/AddressQuery.php#L21-L28 |
22,458 | FrenzelGmbH/cm-address | models/scopes/AddressQuery.php | AddressQuery.related | public function related($entity = NULL, $enity = NULL)
{
$this->andWhere(['entity' => $entity, 'entity_id' => $this->entity_id]);
return $this;
} | php | public function related($entity = NULL, $enity = NULL)
{
$this->andWhere(['entity' => $entity, 'entity_id' => $this->entity_id]);
return $this;
} | [
"public",
"function",
"related",
"(",
"$",
"entity",
"=",
"NULL",
",",
"$",
"enity",
"=",
"NULL",
")",
"{",
"$",
"this",
"->",
"andWhere",
"(",
"[",
"'entity'",
"=>",
"$",
"entity",
",",
"'entity_id'",
"=>",
"$",
"this",
"->",
"entity_id",
"]",
")",
... | find all records which are related to the same entity
@param [type] $entity [description]
@param [type] $enity [description]
@return [type] [description] | [
"find",
"all",
"records",
"which",
"are",
"related",
"to",
"the",
"same",
"entity"
] | 4295671dc603beed4bea6c5a7f77dac9846127f3 | https://github.com/FrenzelGmbH/cm-address/blob/4295671dc603beed4bea6c5a7f77dac9846127f3/models/scopes/AddressQuery.php#L46-L50 |
22,459 | heidelpay/PhpDoc | src/phpDocumentor/Plugin/Graphs/Writer/Graph.php | Graph.processClass | public function processClass(ProjectDescriptor $project, Transformation $transformation)
{
try {
$this->checkIfGraphVizIsInstalled();
} catch (\Exception $e) {
echo $e->getMessage();
return;
}
if ($transformation->getParameter('font') !== null &&... | php | public function processClass(ProjectDescriptor $project, Transformation $transformation)
{
try {
$this->checkIfGraphVizIsInstalled();
} catch (\Exception $e) {
echo $e->getMessage();
return;
}
if ($transformation->getParameter('font') !== null &&... | [
"public",
"function",
"processClass",
"(",
"ProjectDescriptor",
"$",
"project",
",",
"Transformation",
"$",
"transformation",
")",
"{",
"try",
"{",
"$",
"this",
"->",
"checkIfGraphVizIsInstalled",
"(",
")",
";",
"}",
"catch",
"(",
"\\",
"Exception",
"$",
"e",
... | Creates a class inheritance diagram.
@param ProjectDescriptor $project
@param Transformation $transformation
@return void | [
"Creates",
"a",
"class",
"inheritance",
"diagram",
"."
] | 5ac9e842cbd4cbb70900533b240c131f3515ee02 | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Plugin/Graphs/Writer/Graph.php#L69-L136 |
22,460 | JBZoo/Assets | src/Manager.php | Manager.add | public function add($alias, $source = null, $dependencies = [], $options = [])
{
if ($source !== null) {
$asset = $this->_factory->create($alias, $source, $dependencies, $options);
$this->_collection->add($asset);
}
$this->_queued[$alias] = true;
return $thi... | php | public function add($alias, $source = null, $dependencies = [], $options = [])
{
if ($source !== null) {
$asset = $this->_factory->create($alias, $source, $dependencies, $options);
$this->_collection->add($asset);
}
$this->_queued[$alias] = true;
return $thi... | [
"public",
"function",
"add",
"(",
"$",
"alias",
",",
"$",
"source",
"=",
"null",
",",
"$",
"dependencies",
"=",
"[",
"]",
",",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"$",
"source",
"!==",
"null",
")",
"{",
"$",
"asset",
"=",
"$",
... | Adds a registered asset or a new asset to the queue.
@param string $alias
@param string|null $source
@param string|array $dependencies
@param string|array $options
@return $this | [
"Adds",
"a",
"registered",
"asset",
"or",
"a",
"new",
"asset",
"to",
"the",
"queue",
"."
] | 134a109378f5b5e955dfb15e6ed2821581564991 | https://github.com/JBZoo/Assets/blob/134a109378f5b5e955dfb15e6ed2821581564991/src/Manager.php#L107-L117 |
22,461 | JBZoo/Assets | src/Manager.php | Manager.register | public function register($alias, $source = null, $dependencies = [], $options = [])
{
$asset = $this->_factory->create($alias, $source, $dependencies, $options);
$this->_collection->add($asset);
return $this;
} | php | public function register($alias, $source = null, $dependencies = [], $options = [])
{
$asset = $this->_factory->create($alias, $source, $dependencies, $options);
$this->_collection->add($asset);
return $this;
} | [
"public",
"function",
"register",
"(",
"$",
"alias",
",",
"$",
"source",
"=",
"null",
",",
"$",
"dependencies",
"=",
"[",
"]",
",",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"asset",
"=",
"$",
"this",
"->",
"_factory",
"->",
"create",
"(",
"$... | Registers an asset.
@param string $alias
@param null|string $source
@param array $dependencies
@param string|array $options
@return $this | [
"Registers",
"an",
"asset",
"."
] | 134a109378f5b5e955dfb15e6ed2821581564991 | https://github.com/JBZoo/Assets/blob/134a109378f5b5e955dfb15e6ed2821581564991/src/Manager.php#L140-L146 |
22,462 | JBZoo/Assets | src/Manager.php | Manager.unregister | public function unregister($alias)
{
$this->_collection->remove($alias);
$this->remove($alias);
return $this;
} | php | public function unregister($alias)
{
$this->_collection->remove($alias);
$this->remove($alias);
return $this;
} | [
"public",
"function",
"unregister",
"(",
"$",
"alias",
")",
"{",
"$",
"this",
"->",
"_collection",
"->",
"remove",
"(",
"$",
"alias",
")",
";",
"$",
"this",
"->",
"remove",
"(",
"$",
"alias",
")",
";",
"return",
"$",
"this",
";",
"}"
] | Unregisters an asset from collection.
@param string $alias
@return $this | [
"Unregisters",
"an",
"asset",
"from",
"collection",
"."
] | 134a109378f5b5e955dfb15e6ed2821581564991 | https://github.com/JBZoo/Assets/blob/134a109378f5b5e955dfb15e6ed2821581564991/src/Manager.php#L154-L159 |
22,463 | JBZoo/Assets | src/Manager.php | Manager.build | public function build(array $filters = [])
{
$assets = [];
foreach (array_keys($this->_queued) as $alias) {
$this->_resolveDependencies($this->_collection->get($alias), $assets);
}
/** @var Asset $asset */
$result = [
Asset::TYPE_JS_FILE => [],
... | php | public function build(array $filters = [])
{
$assets = [];
foreach (array_keys($this->_queued) as $alias) {
$this->_resolveDependencies($this->_collection->get($alias), $assets);
}
/** @var Asset $asset */
$result = [
Asset::TYPE_JS_FILE => [],
... | [
"public",
"function",
"build",
"(",
"array",
"$",
"filters",
"=",
"[",
"]",
")",
"{",
"$",
"assets",
"=",
"[",
"]",
";",
"foreach",
"(",
"array_keys",
"(",
"$",
"this",
"->",
"_queued",
")",
"as",
"$",
"alias",
")",
"{",
"$",
"this",
"->",
"_reso... | Build assets.
@param array $filters
@return array | [
"Build",
"assets",
"."
] | 134a109378f5b5e955dfb15e6ed2821581564991 | https://github.com/JBZoo/Assets/blob/134a109378f5b5e955dfb15e6ed2821581564991/src/Manager.php#L187-L226 |
22,464 | JBZoo/Assets | src/Manager.php | Manager._resolveDependencies | protected function _resolveDependencies(Asset $asset, &$resolved = [], &$unresolved = [])
{
$unresolved[$asset->getAlias()] = $asset;
foreach ($asset->getDependencies() as $dependency) {
if (!Arr::key($dependency, $resolved)) {
if (isset($unresolved[$dependency])) {
... | php | protected function _resolveDependencies(Asset $asset, &$resolved = [], &$unresolved = [])
{
$unresolved[$asset->getAlias()] = $asset;
foreach ($asset->getDependencies() as $dependency) {
if (!Arr::key($dependency, $resolved)) {
if (isset($unresolved[$dependency])) {
... | [
"protected",
"function",
"_resolveDependencies",
"(",
"Asset",
"$",
"asset",
",",
"&",
"$",
"resolved",
"=",
"[",
"]",
",",
"&",
"$",
"unresolved",
"=",
"[",
"]",
")",
"{",
"$",
"unresolved",
"[",
"$",
"asset",
"->",
"getAlias",
"(",
")",
"]",
"=",
... | Resolves asset dependencies.
@param Asset|null $asset
@param Asset[] $resolved
@param Asset[] $unresolved
@return Asset[]
@throws Exception | [
"Resolves",
"asset",
"dependencies",
"."
] | 134a109378f5b5e955dfb15e6ed2821581564991 | https://github.com/JBZoo/Assets/blob/134a109378f5b5e955dfb15e6ed2821581564991/src/Manager.php#L237-L264 |
22,465 | mslib/resource-proxy | Msl/ResourceProxy/Resource/Email/Message.php | Message.init | public function init($sourceId, $resourceId, $resource)
{
// Setting unique source and resource ids
$this->resourceId = $resourceId;
$this->sourceId = $sourceId;
// Setting message object
if (!$resource instanceof ZendMessage) {
throw new BadResourceConfigurati... | php | public function init($sourceId, $resourceId, $resource)
{
// Setting unique source and resource ids
$this->resourceId = $resourceId;
$this->sourceId = $sourceId;
// Setting message object
if (!$resource instanceof ZendMessage) {
throw new BadResourceConfigurati... | [
"public",
"function",
"init",
"(",
"$",
"sourceId",
",",
"$",
"resourceId",
",",
"$",
"resource",
")",
"{",
"// Setting unique source and resource ids",
"$",
"this",
"->",
"resourceId",
"=",
"$",
"resourceId",
";",
"$",
"this",
"->",
"sourceId",
"=",
"$",
"s... | Initializes a Resource object
@param string $sourceId the source id for this resource (the source being the remote server in which the resource is allocated)
@param string $resourceId the resource id for the given resource object
@param mixed $resource the remote resource handler object (e.g. \Zend\Mail\Storage\M... | [
"Initializes",
"a",
"Resource",
"object"
] | be3f8589753f738f5114443a3465f5e84aecd156 | https://github.com/mslib/resource-proxy/blob/be3f8589753f738f5114443a3465f5e84aecd156/Msl/ResourceProxy/Resource/Email/Message.php#L79-L95 |
22,466 | mslib/resource-proxy | Msl/ResourceProxy/Resource/Email/Message.php | Message.moveToOutputFolder | public function moveToOutputFolder($outputFolder)
{
try {
if ($this->message->isMultipart()) {
// Getting the resource content (subject + body of the email)
$contentPart = $this->message->getPart(1);
$content = $contentPart->getContent();
... | php | public function moveToOutputFolder($outputFolder)
{
try {
if ($this->message->isMultipart()) {
// Getting the resource content (subject + body of the email)
$contentPart = $this->message->getPart(1);
$content = $contentPart->getContent();
... | [
"public",
"function",
"moveToOutputFolder",
"(",
"$",
"outputFolder",
")",
"{",
"try",
"{",
"if",
"(",
"$",
"this",
"->",
"message",
"->",
"isMultipart",
"(",
")",
")",
"{",
"// Getting the resource content (subject + body of the email)",
"$",
"contentPart",
"=",
... | Saves the current resource to the given path. Returns true if move action was successful; false otherwise.
@param string $outputFolder the output folder path for this resource
@throws \Msl\ResourceProxy\Exception\ResourceMoveContentException
@return bool | [
"Saves",
"the",
"current",
"resource",
"to",
"the",
"given",
"path",
".",
"Returns",
"true",
"if",
"move",
"action",
"was",
"successful",
";",
"false",
"otherwise",
"."
] | be3f8589753f738f5114443a3465f5e84aecd156 | https://github.com/mslib/resource-proxy/blob/be3f8589753f738f5114443a3465f5e84aecd156/Msl/ResourceProxy/Resource/Email/Message.php#L109-L161 |
22,467 | mslib/resource-proxy | Msl/ResourceProxy/Resource/Email/Message.php | Message.getContentFileName | protected function getContentFileName($outputFolder)
{
// Returning the content file name (output folder + message sub folder + current object string representation + timestamp)
return sprintf(
"%s%s%s_%s",
$this->getContentFileFolder($outputFolder),
DIRECTORY_SEP... | php | protected function getContentFileName($outputFolder)
{
// Returning the content file name (output folder + message sub folder + current object string representation + timestamp)
return sprintf(
"%s%s%s_%s",
$this->getContentFileFolder($outputFolder),
DIRECTORY_SEP... | [
"protected",
"function",
"getContentFileName",
"(",
"$",
"outputFolder",
")",
"{",
"// Returning the content file name (output folder + message sub folder + current object string representation + timestamp)",
"return",
"sprintf",
"(",
"\"%s%s%s_%s\"",
",",
"$",
"this",
"->",
"getCo... | Returns the content file name as the concatenation of the given output folder + message sub folder + current object string representation + timestamp.
@param string $outputFolder the output folder
@return string | [
"Returns",
"the",
"content",
"file",
"name",
"as",
"the",
"concatenation",
"of",
"the",
"given",
"output",
"folder",
"+",
"message",
"sub",
"folder",
"+",
"current",
"object",
"string",
"representation",
"+",
"timestamp",
"."
] | be3f8589753f738f5114443a3465f5e84aecd156 | https://github.com/mslib/resource-proxy/blob/be3f8589753f738f5114443a3465f5e84aecd156/Msl/ResourceProxy/Resource/Email/Message.php#L229-L239 |
22,468 | mslib/resource-proxy | Msl/ResourceProxy/Resource/Email/Message.php | Message.getAttachmentFileName | protected function getAttachmentFileName($originalAttachmentFileName, $baseOutputFolder)
{
// Getting extension from original file name
$pathInfo = pathinfo($originalAttachmentFileName);
$extension = '';
if (isset($pathInfo['extension'])) {
$extension = $pathInfo['extensi... | php | protected function getAttachmentFileName($originalAttachmentFileName, $baseOutputFolder)
{
// Getting extension from original file name
$pathInfo = pathinfo($originalAttachmentFileName);
$extension = '';
if (isset($pathInfo['extension'])) {
$extension = $pathInfo['extensi... | [
"protected",
"function",
"getAttachmentFileName",
"(",
"$",
"originalAttachmentFileName",
",",
"$",
"baseOutputFolder",
")",
"{",
"// Getting extension from original file name",
"$",
"pathInfo",
"=",
"pathinfo",
"(",
"$",
"originalAttachmentFileName",
")",
";",
"$",
"exte... | Returns the attachment file name as the concatenation of the given output folder + message sub folder + current object string representation + timestamp.
@param string $originalAttachmentFileName the base attachment file name
@param string $baseOutputFolder the base output folder
@return string | [
"Returns",
"the",
"attachment",
"file",
"name",
"as",
"the",
"concatenation",
"of",
"the",
"given",
"output",
"folder",
"+",
"message",
"sub",
"folder",
"+",
"current",
"object",
"string",
"representation",
"+",
"timestamp",
"."
] | be3f8589753f738f5114443a3465f5e84aecd156 | https://github.com/mslib/resource-proxy/blob/be3f8589753f738f5114443a3465f5e84aecd156/Msl/ResourceProxy/Resource/Email/Message.php#L266-L286 |
22,469 | xiewulong/yii2-fileupload | oss/libs/symfony/class-loader/Symfony/Component/ClassLoader/WinCacheClassLoader.php | WinCacheClassLoader.findFile | public function findFile($class)
{
if (false === $file = wincache_ucache_get($this->prefix.$class)) {
wincache_ucache_set($this->prefix.$class, $file = $this->decorated->findFile($class), 0);
}
return $file;
} | php | public function findFile($class)
{
if (false === $file = wincache_ucache_get($this->prefix.$class)) {
wincache_ucache_set($this->prefix.$class, $file = $this->decorated->findFile($class), 0);
}
return $file;
} | [
"public",
"function",
"findFile",
"(",
"$",
"class",
")",
"{",
"if",
"(",
"false",
"===",
"$",
"file",
"=",
"wincache_ucache_get",
"(",
"$",
"this",
"->",
"prefix",
".",
"$",
"class",
")",
")",
"{",
"wincache_ucache_set",
"(",
"$",
"this",
"->",
"prefi... | Finds a file by class name while caching lookups to WinCache.
@param string $class A class name to resolve to file
@return string|null | [
"Finds",
"a",
"file",
"by",
"class",
"name",
"while",
"caching",
"lookups",
"to",
"WinCache",
"."
] | 3e75b17a4a18dd8466e3f57c63136de03470ca82 | https://github.com/xiewulong/yii2-fileupload/blob/3e75b17a4a18dd8466e3f57c63136de03470ca82/oss/libs/symfony/class-loader/Symfony/Component/ClassLoader/WinCacheClassLoader.php#L117-L124 |
22,470 | trunda/SmfMenu | src/Smf/Menu/Renderer/ListRenderer.php | ListRenderer.render | public function render(ItemInterface $item, array $options = array())
{
$options = array_merge($this->defaultOptions, $options);
$options['rootLevel'] = $item->getLevel();
return $this->getMenu($item, $options) ?: '';
} | php | public function render(ItemInterface $item, array $options = array())
{
$options = array_merge($this->defaultOptions, $options);
$options['rootLevel'] = $item->getLevel();
return $this->getMenu($item, $options) ?: '';
} | [
"public",
"function",
"render",
"(",
"ItemInterface",
"$",
"item",
",",
"array",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"$",
"options",
"=",
"array_merge",
"(",
"$",
"this",
"->",
"defaultOptions",
",",
"$",
"options",
")",
";",
"$",
"option... | Renders menu tree.
Common options:
- depth: The depth at which the item is rendered
null: no limit
0: no children
1: only direct children
- currentAsLink: whether the current item should be a link
- currentClass: class added to the current item
- ancestorClass: class added to the ancestors of the current item
- firstC... | [
"Renders",
"menu",
"tree",
"."
] | 739e74fb664c1f018b4a74142bd28d20c004bac6 | https://github.com/trunda/SmfMenu/blob/739e74fb664c1f018b4a74142bd28d20c004bac6/src/Smf/Menu/Renderer/ListRenderer.php#L74-L79 |
22,471 | trunda/SmfMenu | src/Smf/Menu/Renderer/ListRenderer.php | ListRenderer.setParentControl | public function setParentControl(Control $parentControl = null)
{
$this->parentControl = $parentControl;
$this->matcher->setParentControl($parentControl);
} | php | public function setParentControl(Control $parentControl = null)
{
$this->parentControl = $parentControl;
$this->matcher->setParentControl($parentControl);
} | [
"public",
"function",
"setParentControl",
"(",
"Control",
"$",
"parentControl",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"parentControl",
"=",
"$",
"parentControl",
";",
"$",
"this",
"->",
"matcher",
"->",
"setParentControl",
"(",
"$",
"parentControl",
")",
... | Sets the parent control - this is important for link generation
@param Control $parentControl | [
"Sets",
"the",
"parent",
"control",
"-",
"this",
"is",
"important",
"for",
"link",
"generation"
] | 739e74fb664c1f018b4a74142bd28d20c004bac6 | https://github.com/trunda/SmfMenu/blob/739e74fb664c1f018b4a74142bd28d20c004bac6/src/Smf/Menu/Renderer/ListRenderer.php#L266-L270 |
22,472 | Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Database/src/sqlabstraction/implementations/expression_mssql.php | ezcQueryExpressionMssql.concat | public function concat()
{
$args = func_get_args();
$cols = ezcQuerySelect::arrayFlatten( $args );
if ( count( $cols ) < 1 )
{
throw new ezcQueryVariableParameterException( 'concat', count( $args ), 1 );
}
$cols = $this->getIdentifiers( $cols );
... | php | public function concat()
{
$args = func_get_args();
$cols = ezcQuerySelect::arrayFlatten( $args );
if ( count( $cols ) < 1 )
{
throw new ezcQueryVariableParameterException( 'concat', count( $args ), 1 );
}
$cols = $this->getIdentifiers( $cols );
... | [
"public",
"function",
"concat",
"(",
")",
"{",
"$",
"args",
"=",
"func_get_args",
"(",
")",
";",
"$",
"cols",
"=",
"ezcQuerySelect",
"::",
"arrayFlatten",
"(",
"$",
"args",
")",
";",
"if",
"(",
"count",
"(",
"$",
"cols",
")",
"<",
"1",
")",
"{",
... | Returns a series of strings concatinated
concat() accepts an arbitrary number of parameters. Each parameter
must contain an expression or an array with expressions.
@param string|array(string) $... strings that will be concatinated. | [
"Returns",
"a",
"series",
"of",
"strings",
"concatinated"
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Database/src/sqlabstraction/implementations/expression_mssql.php#L132-L144 |
22,473 | inhere/php-librarys | src/Components/LiteErrorHandler.php | LiteErrorHandler.register | public function register()
{
$that = $this;
set_error_handler(function ($errno, $errstr, $errfile, $errline) use ($that) {
if (!($errno & error_reporting())) {
return;
}
$options = [
'type' => $errno,
'message' => $... | php | public function register()
{
$that = $this;
set_error_handler(function ($errno, $errstr, $errfile, $errline) use ($that) {
if (!($errno & error_reporting())) {
return;
}
$options = [
'type' => $errno,
'message' => $... | [
"public",
"function",
"register",
"(",
")",
"{",
"$",
"that",
"=",
"$",
"this",
";",
"set_error_handler",
"(",
"function",
"(",
"$",
"errno",
",",
"$",
"errstr",
",",
"$",
"errfile",
",",
"$",
"errline",
")",
"use",
"(",
"$",
"that",
")",
"{",
"if"... | Registers itself as error and exception handler. | [
"Registers",
"itself",
"as",
"error",
"and",
"exception",
"handler",
"."
] | e6ca598685469794f310e3ab0e2bc19519cd0ae6 | https://github.com/inhere/php-librarys/blob/e6ca598685469794f310e3ab0e2bc19519cd0ae6/src/Components/LiteErrorHandler.php#L23-L59 |
22,474 | inhere/php-librarys | src/Components/LiteErrorHandler.php | LiteErrorHandler.mapErrorsToLogType | public function mapErrorsToLogType($code)
{
switch ($code) {
case E_ERROR:
case E_RECOVERABLE_ERROR:
case E_CORE_ERROR:
case E_COMPILE_ERROR:
case E_USER_ERROR:
case E_PARSE:
return Logger::ERROR;
case E_WARN... | php | public function mapErrorsToLogType($code)
{
switch ($code) {
case E_ERROR:
case E_RECOVERABLE_ERROR:
case E_CORE_ERROR:
case E_COMPILE_ERROR:
case E_USER_ERROR:
case E_PARSE:
return Logger::ERROR;
case E_WARN... | [
"public",
"function",
"mapErrorsToLogType",
"(",
"$",
"code",
")",
"{",
"switch",
"(",
"$",
"code",
")",
"{",
"case",
"E_ERROR",
":",
"case",
"E_RECOVERABLE_ERROR",
":",
"case",
"E_CORE_ERROR",
":",
"case",
"E_COMPILE_ERROR",
":",
"case",
"E_USER_ERROR",
":",
... | Maps error code to a log type.
@param integer $code
@return integer | [
"Maps",
"error",
"code",
"to",
"a",
"log",
"type",
"."
] | e6ca598685469794f310e3ab0e2bc19519cd0ae6 | https://github.com/inhere/php-librarys/blob/e6ca598685469794f310e3ab0e2bc19519cd0ae6/src/Components/LiteErrorHandler.php#L146-L171 |
22,475 | antaresproject/notifications | src/Widgets/NotificationSender/Controller/NotificationController.php | NotificationController.fire | protected function fire(Model $model) : array
{
$recipient = $this->getRecipient();
if ($recipient->phone === null) {
$recipient->phone = config('antares/notifications::default.sms');
}
$params = ['variables' => ['user' => $recipient], 'recipients' => [$recipient]];
... | php | protected function fire(Model $model) : array
{
$recipient = $this->getRecipient();
if ($recipient->phone === null) {
$recipient->phone = config('antares/notifications::default.sms');
}
$params = ['variables' => ['user' => $recipient], 'recipients' => [$recipient]];
... | [
"protected",
"function",
"fire",
"(",
"Model",
"$",
"model",
")",
":",
"array",
"{",
"$",
"recipient",
"=",
"$",
"this",
"->",
"getRecipient",
"(",
")",
";",
"if",
"(",
"$",
"recipient",
"->",
"phone",
"===",
"null",
")",
"{",
"$",
"recipient",
"->",... | Fires notification events
@param Model $model
@return array | [
"Fires",
"notification",
"events"
] | 60de743477b7e9cbb51de66da5fd9461adc9dd8a | https://github.com/antaresproject/notifications/blob/60de743477b7e9cbb51de66da5fd9461adc9dd8a/src/Widgets/NotificationSender/Controller/NotificationController.php#L107-L118 |
22,476 | antaresproject/notifications | src/Widgets/NotificationSender/Controller/NotificationController.php | NotificationController.getRecipient | protected function getRecipient()
{
if (Input::get('test')) {
return user();
}
$route = app('router')->getRoutes()->match(app('request')->create(url()->previous()));
return (in_array('users', $route->parameterNames()) && $uid = $route->parameter('users')) ? user()->newQ... | php | protected function getRecipient()
{
if (Input::get('test')) {
return user();
}
$route = app('router')->getRoutes()->match(app('request')->create(url()->previous()));
return (in_array('users', $route->parameterNames()) && $uid = $route->parameter('users')) ? user()->newQ... | [
"protected",
"function",
"getRecipient",
"(",
")",
"{",
"if",
"(",
"Input",
"::",
"get",
"(",
"'test'",
")",
")",
"{",
"return",
"user",
"(",
")",
";",
"}",
"$",
"route",
"=",
"app",
"(",
"'router'",
")",
"->",
"getRoutes",
"(",
")",
"->",
"match",... | Gets recipient for notification
@return \Illuminate\Database\Eloquent\Model | [
"Gets",
"recipient",
"for",
"notification"
] | 60de743477b7e9cbb51de66da5fd9461adc9dd8a | https://github.com/antaresproject/notifications/blob/60de743477b7e9cbb51de66da5fd9461adc9dd8a/src/Widgets/NotificationSender/Controller/NotificationController.php#L125-L132 |
22,477 | surebert/surebert-framework | src/sb/Text/Bling.php | Bling.emoticonsToHtml | public static function emoticonsToHtml($str)
{
$str = str_replace (" :)", ' <img src="/media/emot/icon_biggrin.gif" alt="big_grin" />', $str);
$str = str_replace (" :(", ' <img src="/media/emot/icon_cry.gif" alt="cry" />', $str);
$str = str_replace (" ;)", ' <img src="/media/emot/icon_wink... | php | public static function emoticonsToHtml($str)
{
$str = str_replace (" :)", ' <img src="/media/emot/icon_biggrin.gif" alt="big_grin" />', $str);
$str = str_replace (" :(", ' <img src="/media/emot/icon_cry.gif" alt="cry" />', $str);
$str = str_replace (" ;)", ' <img src="/media/emot/icon_wink... | [
"public",
"static",
"function",
"emoticonsToHtml",
"(",
"$",
"str",
")",
"{",
"$",
"str",
"=",
"str_replace",
"(",
"\" :)\"",
",",
"' <img src=\"/media/emot/icon_biggrin.gif\" alt=\"big_grin\" />'",
",",
"$",
"str",
")",
";",
"$",
"str",
"=",
"str_replace",
"(",
... | Converts emoticons shortcuts to images
@param string $str
@return string | [
"Converts",
"emoticons",
"shortcuts",
"to",
"images"
] | f2f32eb693bd39385ceb93355efb5b2a429f27ce | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Text/Bling.php#L55-L64 |
22,478 | surebert/surebert-framework | src/sb/Text/Bling.php | Bling.clean | public static function clean($str, $allow_email=false)
{
$str = self::typoFix($str);
$str = \sb\String\HTML::escape($str);
$str = self::convertQuotes($str);
$str = self::listsToHtml($str);
$str = self::tablesToHtml($str);
$str = self::linksToHtml($str, $allow_em... | php | public static function clean($str, $allow_email=false)
{
$str = self::typoFix($str);
$str = \sb\String\HTML::escape($str);
$str = self::convertQuotes($str);
$str = self::listsToHtml($str);
$str = self::tablesToHtml($str);
$str = self::linksToHtml($str, $allow_em... | [
"public",
"static",
"function",
"clean",
"(",
"$",
"str",
",",
"$",
"allow_email",
"=",
"false",
")",
"{",
"$",
"str",
"=",
"self",
"::",
"typoFix",
"(",
"$",
"str",
")",
";",
"$",
"str",
"=",
"\\",
"sb",
"\\",
"String",
"\\",
"HTML",
"::",
"esca... | Clean up the text according to the textBling rules
@param string $str The text to clean
@param boolean $media Determines if media is parsed into html
@return string The cleaned text | [
"Clean",
"up",
"the",
"text",
"according",
"to",
"the",
"textBling",
"rules"
] | f2f32eb693bd39385ceb93355efb5b2a429f27ce | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Text/Bling.php#L88-L117 |
22,479 | surebert/surebert-framework | src/sb/Text/Bling.php | Bling.miscTags | public static function miscTags($str)
{
##hortizontal row
$str = str_replace('[hr]', '<hr style="clear:both;" />', $str);
##line break
$str = str_replace('[br]', '<br />', $str);
##puttext inside a scrolling box
$str = preg_replace( "~\[box\]\n?(.*?)\n?\[\/box\]\... | php | public static function miscTags($str)
{
##hortizontal row
$str = str_replace('[hr]', '<hr style="clear:both;" />', $str);
##line break
$str = str_replace('[br]', '<br />', $str);
##puttext inside a scrolling box
$str = preg_replace( "~\[box\]\n?(.*?)\n?\[\/box\]\... | [
"public",
"static",
"function",
"miscTags",
"(",
"$",
"str",
")",
"{",
"##hortizontal row",
"$",
"str",
"=",
"str_replace",
"(",
"'[hr]'",
",",
"'<hr style=\"clear:both;\" />'",
",",
"$",
"str",
")",
";",
"##line break",
"$",
"str",
"=",
"str_replace",
"(",
... | Parses out misc tags such as horizontal rule and a scrolling box
@param string $str
@return string $str; | [
"Parses",
"out",
"misc",
"tags",
"such",
"as",
"horizontal",
"rule",
"and",
"a",
"scrolling",
"box"
] | f2f32eb693bd39385ceb93355efb5b2a429f27ce | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Text/Bling.php#L125-L138 |
22,480 | surebert/surebert-framework | src/sb/Text/Bling.php | Bling.linksToHtml | public static function linksToHtml($str, $allow_email=false, $link_markup=null)
{
### Convert Email Tags ###
if(!$allow_email){
$str = preg_replace("#([\n ])([a-z0-9\-_.]+?)@([\w\-]+\.([\w\-\.]+\.)?[\w]+)#i", '<b> \\2 AT \\3 </b>', $str);
} else {
$str = preg_replace... | php | public static function linksToHtml($str, $allow_email=false, $link_markup=null)
{
### Convert Email Tags ###
if(!$allow_email){
$str = preg_replace("#([\n ])([a-z0-9\-_.]+?)@([\w\-]+\.([\w\-\.]+\.)?[\w]+)#i", '<b> \\2 AT \\3 </b>', $str);
} else {
$str = preg_replace... | [
"public",
"static",
"function",
"linksToHtml",
"(",
"$",
"str",
",",
"$",
"allow_email",
"=",
"false",
",",
"$",
"link_markup",
"=",
"null",
")",
"{",
"### Convert Email Tags ###",
"if",
"(",
"!",
"$",
"allow_email",
")",
"{",
"$",
"str",
"=",
"preg_replac... | Converts email and http links to HTML links
@param string $str
@return string | [
"Converts",
"email",
"and",
"http",
"links",
"to",
"HTML",
"links"
] | f2f32eb693bd39385ceb93355efb5b2a429f27ce | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Text/Bling.php#L254-L283 |
22,481 | surebert/surebert-framework | src/sb/Text/Bling.php | Bling.addSearches | public static function addSearches($str)
{
### make google searches ###
preg_match_all( "/\[google\](.*?)\[\/google\]/s", $str, $matches );
$match = $matches[0];
$data = $matches[1];
$count = count($match);
for($x=0;$x<$count;$x++){
$query = str_replace(... | php | public static function addSearches($str)
{
### make google searches ###
preg_match_all( "/\[google\](.*?)\[\/google\]/s", $str, $matches );
$match = $matches[0];
$data = $matches[1];
$count = count($match);
for($x=0;$x<$count;$x++){
$query = str_replace(... | [
"public",
"static",
"function",
"addSearches",
"(",
"$",
"str",
")",
"{",
"### make google searches ###",
"preg_match_all",
"(",
"\"/\\[google\\](.*?)\\[\\/google\\]/s\"",
",",
"$",
"str",
",",
"$",
"matches",
")",
";",
"$",
"match",
"=",
"$",
"matches",
"[",
"0... | Adds search tags to link text to searches both on and off site
@param string $str
@return string | [
"Adds",
"search",
"tags",
"to",
"link",
"text",
"to",
"searches",
"both",
"on",
"and",
"off",
"site"
] | f2f32eb693bd39385ceb93355efb5b2a429f27ce | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Text/Bling.php#L292-L315 |
22,482 | surebert/surebert-framework | src/sb/Text/Bling.php | Bling.convertQuotes | public static function convertQuotes($str)
{
$r = "/\[q(?:uote)?\](.*?)\[\/q(?:uote)?\]/is";
while(preg_match($r, $str)){
$str = preg_replace($r, '<blockquote class="quote"><p>\\1</p></blockquote>', $str);
}
return $str;
} | php | public static function convertQuotes($str)
{
$r = "/\[q(?:uote)?\](.*?)\[\/q(?:uote)?\]/is";
while(preg_match($r, $str)){
$str = preg_replace($r, '<blockquote class="quote"><p>\\1</p></blockquote>', $str);
}
return $str;
} | [
"public",
"static",
"function",
"convertQuotes",
"(",
"$",
"str",
")",
"{",
"$",
"r",
"=",
"\"/\\[q(?:uote)?\\](.*?)\\[\\/q(?:uote)?\\]/is\"",
";",
"while",
"(",
"preg_match",
"(",
"$",
"r",
",",
"$",
"str",
")",
")",
"{",
"$",
"str",
"=",
"preg_replace",
... | Converts quotes into quoted text blocks
@param unknown_type $str | [
"Converts",
"quotes",
"into",
"quoted",
"text",
"blocks"
] | f2f32eb693bd39385ceb93355efb5b2a429f27ce | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Text/Bling.php#L355-L364 |
22,483 | surebert/surebert-framework | src/sb/Text/Bling.php | Bling.stripAll | public static function stripAll($str)
{
$str = stripslashes($str);
$str = strip_tags($str);
$str = \sb\Strings::unicodeUrldecode($str);
$str = self::stripBling($str);
$str = \sb\Strings::stripMicrosoftChars($str);
return $str;
} | php | public static function stripAll($str)
{
$str = stripslashes($str);
$str = strip_tags($str);
$str = \sb\Strings::unicodeUrldecode($str);
$str = self::stripBling($str);
$str = \sb\Strings::stripMicrosoftChars($str);
return $str;
} | [
"public",
"static",
"function",
"stripAll",
"(",
"$",
"str",
")",
"{",
"$",
"str",
"=",
"stripslashes",
"(",
"$",
"str",
")",
";",
"$",
"str",
"=",
"strip_tags",
"(",
"$",
"str",
")",
";",
"$",
"str",
"=",
"\\",
"sb",
"\\",
"Strings",
"::",
"unic... | Strips everything including textBlng tags, this is useful for RSS feed and text summaries in search results
@param string $str
@return string | [
"Strips",
"everything",
"including",
"textBlng",
"tags",
"this",
"is",
"useful",
"for",
"RSS",
"feed",
"and",
"text",
"summaries",
"in",
"search",
"results"
] | f2f32eb693bd39385ceb93355efb5b2a429f27ce | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Text/Bling.php#L383-L391 |
22,484 | surebert/surebert-framework | src/sb/Text/Bling.php | Bling.typoFix | public static function typoFix($str)
{
//mistakes
$common_typos = array(
"adn"=>"and",
"agian"=>"again",
"ahve"=>"have",
"ahd"=>"had",
"alot"=>"a lot",
"amke"=>"make",
"arent"=>"aren't",
"beleif"=>"beli... | php | public static function typoFix($str)
{
//mistakes
$common_typos = array(
"adn"=>"and",
"agian"=>"again",
"ahve"=>"have",
"ahd"=>"had",
"alot"=>"a lot",
"amke"=>"make",
"arent"=>"aren't",
"beleif"=>"beli... | [
"public",
"static",
"function",
"typoFix",
"(",
"$",
"str",
")",
"{",
"//mistakes",
"$",
"common_typos",
"=",
"array",
"(",
"\"adn\"",
"=>",
"\"and\"",
",",
"\"agian\"",
"=>",
"\"again\"",
",",
"\"ahve\"",
"=>",
"\"have\"",
",",
"\"ahd\"",
"=>",
"\"had\"",
... | Fixed common typos, can be used directly as it is a static property
<code>
textBling::typoFix('Teh bird cant fly');
//returns 'The bird can't fly'
</code>
@param the text to be cleaned $str
@return string | [
"Fixed",
"common",
"typos",
"can",
"be",
"used",
"directly",
"as",
"it",
"is",
"a",
"static",
"property"
] | f2f32eb693bd39385ceb93355efb5b2a429f27ce | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Text/Bling.php#L405-L479 |
22,485 | surebert/surebert-framework | src/sb/Text/Bling.php | Bling.textStyles | public static function textStyles($str)
{
##bold
$str = preg_replace("~\[b\](.*?)\[/b\]~is", '<strong class="tb_b">$1</strong>', $str);
##sup
$str = preg_replace("~\[sup\](.*?)\[/sup\]~is", '<sup class="tb_sup">$1</sup>', $str);
##sub
$str = preg_replace("~\[sub\](... | php | public static function textStyles($str)
{
##bold
$str = preg_replace("~\[b\](.*?)\[/b\]~is", '<strong class="tb_b">$1</strong>', $str);
##sup
$str = preg_replace("~\[sup\](.*?)\[/sup\]~is", '<sup class="tb_sup">$1</sup>', $str);
##sub
$str = preg_replace("~\[sub\](... | [
"public",
"static",
"function",
"textStyles",
"(",
"$",
"str",
")",
"{",
"##bold",
"$",
"str",
"=",
"preg_replace",
"(",
"\"~\\[b\\](.*?)\\[/b\\]~is\"",
",",
"'<strong class=\"tb_b\">$1</strong>'",
",",
"$",
"str",
")",
";",
"##sup",
"$",
"str",
"=",
"preg_repla... | Converts text style tags
@param string $str
@return string $str; | [
"Converts",
"text",
"style",
"tags"
] | f2f32eb693bd39385ceb93355efb5b2a429f27ce | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Text/Bling.php#L487-L543 |
22,486 | Erdiko/core | src/Theme.php | Theme.getCss | public function getCss()
{
if (isset($this->_themeConfig['css'])) {
return array_merge($this->_themeConfig['css'], $this->_data['css']);
} else {
return $this->_data['css'];
}
} | php | public function getCss()
{
if (isset($this->_themeConfig['css'])) {
return array_merge($this->_themeConfig['css'], $this->_data['css']);
} else {
return $this->_data['css'];
}
} | [
"public",
"function",
"getCss",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"_themeConfig",
"[",
"'css'",
"]",
")",
")",
"{",
"return",
"array_merge",
"(",
"$",
"this",
"->",
"_themeConfig",
"[",
"'css'",
"]",
",",
"$",
"this",
"->",
... | Get array of css files to include in theme
@return array css file paths
@todo sort by the 'order' value | [
"Get",
"array",
"of",
"css",
"files",
"to",
"include",
"in",
"theme"
] | c7947ee973b0ad2fd05a6d1d8ce45696618c8fa6 | https://github.com/Erdiko/core/blob/c7947ee973b0ad2fd05a6d1d8ce45696618c8fa6/src/Theme.php#L193-L200 |
22,487 | Erdiko/core | src/Theme.php | Theme.getJs | public function getJs()
{
if (isset($this->_themeConfig['js'])) {
return array_merge($this->_themeConfig['js'], $this->_data['js']);
} else {
return $this->_data['js'];
}
} | php | public function getJs()
{
if (isset($this->_themeConfig['js'])) {
return array_merge($this->_themeConfig['js'], $this->_data['js']);
} else {
return $this->_data['js'];
}
} | [
"public",
"function",
"getJs",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"_themeConfig",
"[",
"'js'",
"]",
")",
")",
"{",
"return",
"array_merge",
"(",
"$",
"this",
"->",
"_themeConfig",
"[",
"'js'",
"]",
",",
"$",
"this",
"->",
"_... | Get array of js files to include
@return array js file paths
@todo sort by the 'order' value | [
"Get",
"array",
"of",
"js",
"files",
"to",
"include"
] | c7947ee973b0ad2fd05a6d1d8ce45696618c8fa6 | https://github.com/Erdiko/core/blob/c7947ee973b0ad2fd05a6d1d8ce45696618c8fa6/src/Theme.php#L227-L234 |
22,488 | Erdiko/core | src/Theme.php | Theme.addJs | public function addJs($name, $jsFile, $order = 10, $active = 1)
{
$this->_data['js'][$name] = array(
'file' => $jsFile,
'order' => $order,
'active' => $active
);
} | php | public function addJs($name, $jsFile, $order = 10, $active = 1)
{
$this->_data['js'][$name] = array(
'file' => $jsFile,
'order' => $order,
'active' => $active
);
} | [
"public",
"function",
"addJs",
"(",
"$",
"name",
",",
"$",
"jsFile",
",",
"$",
"order",
"=",
"10",
",",
"$",
"active",
"=",
"1",
")",
"{",
"$",
"this",
"->",
"_data",
"[",
"'js'",
"]",
"[",
"$",
"name",
"]",
"=",
"array",
"(",
"'file'",
"=>",
... | Add js file to page
@param string $name
@param string $jsFile URL of js file
@param int $order
@param boolean $active defaults to 1
@todo same issue as addCss | [
"Add",
"js",
"file",
"to",
"page"
] | c7947ee973b0ad2fd05a6d1d8ce45696618c8fa6 | https://github.com/Erdiko/core/blob/c7947ee973b0ad2fd05a6d1d8ce45696618c8fa6/src/Theme.php#L245-L252 |
22,489 | Erdiko/core | src/Theme.php | Theme.getTemplateHtml | public function getTemplateHtml($partial)
{
$config = $this->getThemeConfig();
// @todo add check here to make sure partial exists, if missing log error
$filename = $this->getTemplateFolder().$config['templates'][$partial]['file'];
$html = $this->getTemplateFile($filename, $this->ge... | php | public function getTemplateHtml($partial)
{
$config = $this->getThemeConfig();
// @todo add check here to make sure partial exists, if missing log error
$filename = $this->getTemplateFolder().$config['templates'][$partial]['file'];
$html = $this->getTemplateFile($filename, $this->ge... | [
"public",
"function",
"getTemplateHtml",
"(",
"$",
"partial",
")",
"{",
"$",
"config",
"=",
"$",
"this",
"->",
"getThemeConfig",
"(",
")",
";",
"// @todo add check here to make sure partial exists, if missing log error",
"$",
"filename",
"=",
"$",
"this",
"->",
"get... | Get template file populated by the config
@usage Partial render need to be declared in theme.json
e.g. get header/footer
@param string $partial
@return string html | [
"Get",
"template",
"file",
"populated",
"by",
"the",
"config"
] | c7947ee973b0ad2fd05a6d1d8ce45696618c8fa6 | https://github.com/Erdiko/core/blob/c7947ee973b0ad2fd05a6d1d8ce45696618c8fa6/src/Theme.php#L344-L353 |
22,490 | Erdiko/core | src/Theme.php | Theme.toHtml | public function toHtml()
{
// load the theme and context (site) configs
$this->getContextConfig();
$this->getThemeConfig();
$filename = $this->getTemplateFolder().$this->getTemplate();
$html = $this->getTemplateFile($filename, $this);
return $html;
} | php | public function toHtml()
{
// load the theme and context (site) configs
$this->getContextConfig();
$this->getThemeConfig();
$filename = $this->getTemplateFolder().$this->getTemplate();
$html = $this->getTemplateFile($filename, $this);
return $html;
} | [
"public",
"function",
"toHtml",
"(",
")",
"{",
"// load the theme and context (site) configs",
"$",
"this",
"->",
"getContextConfig",
"(",
")",
";",
"$",
"this",
"->",
"getThemeConfig",
"(",
")",
";",
"$",
"filename",
"=",
"$",
"this",
"->",
"getTemplateFolder",... | Output content to html
@return string html | [
"Output",
"content",
"to",
"html"
] | c7947ee973b0ad2fd05a6d1d8ce45696618c8fa6 | https://github.com/Erdiko/core/blob/c7947ee973b0ad2fd05a6d1d8ce45696618c8fa6/src/Theme.php#L360-L370 |
22,491 | derhasi/buddy | src/CommandShortcut.php | CommandShortcut.processDir | protected function processDir($dir) {
$dir = $this->replacePattern($dir);
// The absolute path has to be calculated relative to the configuration file
if (Path::isRelative($dir)) {
$dir = Path::makeAbsolute($dir, dirname($this->configFile));
}
return rtrim($dir, '/');
} | php | protected function processDir($dir) {
$dir = $this->replacePattern($dir);
// The absolute path has to be calculated relative to the configuration file
if (Path::isRelative($dir)) {
$dir = Path::makeAbsolute($dir, dirname($this->configFile));
}
return rtrim($dir, '/');
} | [
"protected",
"function",
"processDir",
"(",
"$",
"dir",
")",
"{",
"$",
"dir",
"=",
"$",
"this",
"->",
"replacePattern",
"(",
"$",
"dir",
")",
";",
"// The absolute path has to be calculated relative to the configuration file",
"if",
"(",
"Path",
"::",
"isRelative",
... | Process given dir with replacements and makes it absolute.
@param string $dir
@return string
Absolute path with placeholders replaced. | [
"Process",
"given",
"dir",
"with",
"replacements",
"and",
"makes",
"it",
"absolute",
"."
] | a9f033470b61a9fc09bb1ba07f2a2d1fc16b4165 | https://github.com/derhasi/buddy/blob/a9f033470b61a9fc09bb1ba07f2a2d1fc16b4165/src/CommandShortcut.php#L117-L124 |
22,492 | derhasi/buddy | src/CommandShortcut.php | CommandShortcut.replacePattern | protected function replacePattern($pattern) {
$replace = array(
'$DIR' => dirname($this->configFile),
'$CWD' => getcwd(),
);
return str_replace(array_keys($replace), array_values($replace), $pattern);
} | php | protected function replacePattern($pattern) {
$replace = array(
'$DIR' => dirname($this->configFile),
'$CWD' => getcwd(),
);
return str_replace(array_keys($replace), array_values($replace), $pattern);
} | [
"protected",
"function",
"replacePattern",
"(",
"$",
"pattern",
")",
"{",
"$",
"replace",
"=",
"array",
"(",
"'$DIR'",
"=>",
"dirname",
"(",
"$",
"this",
"->",
"configFile",
")",
",",
"'$CWD'",
"=>",
"getcwd",
"(",
")",
",",
")",
";",
"return",
"str_re... | Helper to replace certain patterns with actual values.
@param string $pattern
Pattern to be replaced
@return string | [
"Helper",
"to",
"replace",
"certain",
"patterns",
"with",
"actual",
"values",
"."
] | a9f033470b61a9fc09bb1ba07f2a2d1fc16b4165 | https://github.com/derhasi/buddy/blob/a9f033470b61a9fc09bb1ba07f2a2d1fc16b4165/src/CommandShortcut.php#L135-L141 |
22,493 | rhosocial/yii2-user | models/UserUsernameTrait.php | UserUsernameTrait.hasEnabledUsername | public function hasEnabledUsername()
{
if ($this->usernameClass === false || !is_string($this->usernameClass) || !class_exists($this->usernameClass)) {
return false;
}
return true;
} | php | public function hasEnabledUsername()
{
if ($this->usernameClass === false || !is_string($this->usernameClass) || !class_exists($this->usernameClass)) {
return false;
}
return true;
} | [
"public",
"function",
"hasEnabledUsername",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"usernameClass",
"===",
"false",
"||",
"!",
"is_string",
"(",
"$",
"this",
"->",
"usernameClass",
")",
"||",
"!",
"class_exists",
"(",
"$",
"this",
"->",
"usernameClas... | Check whether this user enables the username feature or not.
@return boolean | [
"Check",
"whether",
"this",
"user",
"enables",
"the",
"username",
"feature",
"or",
"not",
"."
] | 96737a9d8ca7e9c42cd2b7736d6c0a90ede6e5bc | https://github.com/rhosocial/yii2-user/blob/96737a9d8ca7e9c42cd2b7736d6c0a90ede6e5bc/models/UserUsernameTrait.php#L33-L39 |
22,494 | rhosocial/yii2-user | models/UserUsernameTrait.php | UserUsernameTrait.getUsername | public function getUsername()
{
if (!$this->hasEnabledUsername()) {
return null;
}
$usernameClass = $this->usernameClass;
$noInit = $usernameClass::buildNoInitModel();
/* @var $noInit Username */
return $this->hasOne($usernameClass, [$noInit->createdByAttr... | php | public function getUsername()
{
if (!$this->hasEnabledUsername()) {
return null;
}
$usernameClass = $this->usernameClass;
$noInit = $usernameClass::buildNoInitModel();
/* @var $noInit Username */
return $this->hasOne($usernameClass, [$noInit->createdByAttr... | [
"public",
"function",
"getUsername",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"hasEnabledUsername",
"(",
")",
")",
"{",
"return",
"null",
";",
"}",
"$",
"usernameClass",
"=",
"$",
"this",
"->",
"usernameClass",
";",
"$",
"noInit",
"=",
"$",
... | Get username.
This method may return null, please consider processing the abnormal conditions.
@return BaseBlameableQuery | [
"Get",
"username",
".",
"This",
"method",
"may",
"return",
"null",
"please",
"consider",
"processing",
"the",
"abnormal",
"conditions",
"."
] | 96737a9d8ca7e9c42cd2b7736d6c0a90ede6e5bc | https://github.com/rhosocial/yii2-user/blob/96737a9d8ca7e9c42cd2b7736d6c0a90ede6e5bc/models/UserUsernameTrait.php#L46-L55 |
22,495 | rhosocial/yii2-user | models/UserUsernameTrait.php | UserUsernameTrait.createUsername | public function createUsername($username)
{
if (!$this->hasEnabledUsername()) {
return null;
}
$usernameClass = $this->usernameClass;
$model = $usernameClass::findOne($this->getGUID());
if (!$model) {
$model = $this->create($usernameClass);
... | php | public function createUsername($username)
{
if (!$this->hasEnabledUsername()) {
return null;
}
$usernameClass = $this->usernameClass;
$model = $usernameClass::findOne($this->getGUID());
if (!$model) {
$model = $this->create($usernameClass);
... | [
"public",
"function",
"createUsername",
"(",
"$",
"username",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"hasEnabledUsername",
"(",
")",
")",
"{",
"return",
"null",
";",
"}",
"$",
"usernameClass",
"=",
"$",
"this",
"->",
"usernameClass",
";",
"$",
"m... | Create or get username.
@param $username
@return null|Username | [
"Create",
"or",
"get",
"username",
"."
] | 96737a9d8ca7e9c42cd2b7736d6c0a90ede6e5bc | https://github.com/rhosocial/yii2-user/blob/96737a9d8ca7e9c42cd2b7736d6c0a90ede6e5bc/models/UserUsernameTrait.php#L62-L75 |
22,496 | rhosocial/yii2-user | models/UserUsernameTrait.php | UserUsernameTrait.setUsername | public function setUsername($username = null)
{
if ($username === null && ($model = $this->getUsername()->one())) {
return $model->delete() > 0;
}
if ($username instanceof Username) {
$username = $username->content;
}
$model = $this->createUsername($us... | php | public function setUsername($username = null)
{
if ($username === null && ($model = $this->getUsername()->one())) {
return $model->delete() > 0;
}
if ($username instanceof Username) {
$username = $username->content;
}
$model = $this->createUsername($us... | [
"public",
"function",
"setUsername",
"(",
"$",
"username",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"username",
"===",
"null",
"&&",
"(",
"$",
"model",
"=",
"$",
"this",
"->",
"getUsername",
"(",
")",
"->",
"one",
"(",
")",
")",
")",
"{",
"return",
... | Set username.
@param string|Username $username
@return bool | [
"Set",
"username",
"."
] | 96737a9d8ca7e9c42cd2b7736d6c0a90ede6e5bc | https://github.com/rhosocial/yii2-user/blob/96737a9d8ca7e9c42cd2b7736d6c0a90ede6e5bc/models/UserUsernameTrait.php#L82-L92 |
22,497 | 42mate/towel | src/Towel/Controller/User.php | User.profileShow | public function profileShow()
{
if (!$this->isAuthenticated()) {
return $this->redirect('/login');
}
$userModel = $this->session()->get('user');
return $this->twig()->render('User\profile.twig', array('user' => $userModel));
} | php | public function profileShow()
{
if (!$this->isAuthenticated()) {
return $this->redirect('/login');
}
$userModel = $this->session()->get('user');
return $this->twig()->render('User\profile.twig', array('user' => $userModel));
} | [
"public",
"function",
"profileShow",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"isAuthenticated",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"redirect",
"(",
"'/login'",
")",
";",
"}",
"$",
"userModel",
"=",
"$",
"this",
"->",
"session"... | Shows the profile page.
@return string|\Symfony\Component\HttpFoundation\RedirectResponse | [
"Shows",
"the",
"profile",
"page",
"."
] | 5316c3075fc844e8a5cbae113712b26556227dff | https://github.com/42mate/towel/blob/5316c3075fc844e8a5cbae113712b26556227dff/src/Towel/Controller/User.php#L14-L22 |
22,498 | 42mate/towel | src/Towel/Controller/User.php | User.loginShow | public function loginShow()
{
if ($this->isAuthenticated()) {
$this->setMessage('warning', 'you are already logged in');
return $this->redirect('/');
}
return $this->twig()->render('user\login.twig');
} | php | public function loginShow()
{
if ($this->isAuthenticated()) {
$this->setMessage('warning', 'you are already logged in');
return $this->redirect('/');
}
return $this->twig()->render('user\login.twig');
} | [
"public",
"function",
"loginShow",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isAuthenticated",
"(",
")",
")",
"{",
"$",
"this",
"->",
"setMessage",
"(",
"'warning'",
",",
"'you are already logged in'",
")",
";",
"return",
"$",
"this",
"->",
"redirect",... | Shows the login form.
@return string|\Symfony\Component\HttpFoundation\RedirectResponse | [
"Shows",
"the",
"login",
"form",
"."
] | 5316c3075fc844e8a5cbae113712b26556227dff | https://github.com/42mate/towel/blob/5316c3075fc844e8a5cbae113712b26556227dff/src/Towel/Controller/User.php#L29-L37 |
22,499 | 42mate/towel | src/Towel/Controller/User.php | User.loginAction | public function loginAction($request)
{
$data = $request->get('data');
$userModel = new ModelUser();
$validUser = $userModel->validateLogin($data['email'], $data['password']);
if (!$validUser) {
$this->setMessage('danger', 'Not valid user / password combination');
... | php | public function loginAction($request)
{
$data = $request->get('data');
$userModel = new ModelUser();
$validUser = $userModel->validateLogin($data['email'], $data['password']);
if (!$validUser) {
$this->setMessage('danger', 'Not valid user / password combination');
... | [
"public",
"function",
"loginAction",
"(",
"$",
"request",
")",
"{",
"$",
"data",
"=",
"$",
"request",
"->",
"get",
"(",
"'data'",
")",
";",
"$",
"userModel",
"=",
"new",
"ModelUser",
"(",
")",
";",
"$",
"validUser",
"=",
"$",
"userModel",
"->",
"vali... | Handles the login action.
@param $request
@return \Symfony\Component\HttpFoundation\RedirectResponse | [
"Handles",
"the",
"login",
"action",
"."
] | 5316c3075fc844e8a5cbae113712b26556227dff | https://github.com/42mate/towel/blob/5316c3075fc844e8a5cbae113712b26556227dff/src/Towel/Controller/User.php#L46-L60 |
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.