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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
196,200 | realboard/DBInstance | src/Realboard/Component/Database/DBInstance/Config.php | Config.rebuildConnectionString | protected function rebuildConnectionString()
{
foreach ($this->availableDrivers as $driverName) {
if (array_key_exists($driverName, $this->connectionStrings)) {
continue;
}
$ConnStringInterface = __NAMESPACE__.'\\ConnectionString\\'.ucfirst($driverName).'C... | php | protected function rebuildConnectionString()
{
foreach ($this->availableDrivers as $driverName) {
if (array_key_exists($driverName, $this->connectionStrings)) {
continue;
}
$ConnStringInterface = __NAMESPACE__.'\\ConnectionString\\'.ucfirst($driverName).'C... | [
"protected",
"function",
"rebuildConnectionString",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"availableDrivers",
"as",
"$",
"driverName",
")",
"{",
"if",
"(",
"array_key_exists",
"(",
"$",
"driverName",
",",
"$",
"this",
"->",
"connectionStrings",
")"... | Rebuild ConnectionString. | [
"Rebuild",
"ConnectionString",
"."
] | f2cde7fdf480d5eb5a491a5cf81ff7f4b3be0a35 | https://github.com/realboard/DBInstance/blob/f2cde7fdf480d5eb5a491a5cf81ff7f4b3be0a35/src/Realboard/Component/Database/DBInstance/Config.php#L93-L105 |
196,201 | realboard/DBInstance | src/Realboard/Component/Database/DBInstance/Config.php | Config.registerConnectionString | public function registerConnectionString(ConnectionStringInterface $connString, $driverName)
{
$this->connectionStrings[$driverName] = $connString;
if (!in_array($driverName, $this->availableDrivers)) {
$this->availableDrivers[] = $driverName;
}
$this->error->setMessage(n... | php | public function registerConnectionString(ConnectionStringInterface $connString, $driverName)
{
$this->connectionStrings[$driverName] = $connString;
if (!in_array($driverName, $this->availableDrivers)) {
$this->availableDrivers[] = $driverName;
}
$this->error->setMessage(n... | [
"public",
"function",
"registerConnectionString",
"(",
"ConnectionStringInterface",
"$",
"connString",
",",
"$",
"driverName",
")",
"{",
"$",
"this",
"->",
"connectionStrings",
"[",
"$",
"driverName",
"]",
"=",
"$",
"connString",
";",
"if",
"(",
"!",
"in_array",... | Register new Connection String.
@param \Realboard\Component\Database\DBInstance\DBInterface\ConnectionStringInterface $connString Connection String Class
@param string $driverName Driver Alias eg (mysql, oci, pgsql, sqlite, firebird etc)
@return ... | [
"Register",
"new",
"Connection",
"String",
"."
] | f2cde7fdf480d5eb5a491a5cf81ff7f4b3be0a35 | https://github.com/realboard/DBInstance/blob/f2cde7fdf480d5eb5a491a5cf81ff7f4b3be0a35/src/Realboard/Component/Database/DBInstance/Config.php#L115-L124 |
196,202 | realboard/DBInstance | src/Realboard/Component/Database/DBInstance/Config.php | Config.getAttr | public function getAttr($key = null)
{
if (null !== $key) {
return isset($this->attr[$attribute]) ? $this->attr[$attribute] : null;
}
return $this->attr;
} | php | public function getAttr($key = null)
{
if (null !== $key) {
return isset($this->attr[$attribute]) ? $this->attr[$attribute] : null;
}
return $this->attr;
} | [
"public",
"function",
"getAttr",
"(",
"$",
"key",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"key",
")",
"{",
"return",
"isset",
"(",
"$",
"this",
"->",
"attr",
"[",
"$",
"attribute",
"]",
")",
"?",
"$",
"this",
"->",
"attr",
"[",
"$... | Get Current Attribute.
@param mixed $key Pdo Attribute
@return mixed Pdo Attr Value | [
"Get",
"Current",
"Attribute",
"."
] | f2cde7fdf480d5eb5a491a5cf81ff7f4b3be0a35 | https://github.com/realboard/DBInstance/blob/f2cde7fdf480d5eb5a491a5cf81ff7f4b3be0a35/src/Realboard/Component/Database/DBInstance/Config.php#L144-L151 |
196,203 | realboard/DBInstance | src/Realboard/Component/Database/DBInstance/Config.php | Config.setAttrArray | public function setAttrArray(array $attributes)
{
foreach ($attributes as $attribute => $value) {
$this->setAttr($attribute, $value);
}
} | php | public function setAttrArray(array $attributes)
{
foreach ($attributes as $attribute => $value) {
$this->setAttr($attribute, $value);
}
} | [
"public",
"function",
"setAttrArray",
"(",
"array",
"$",
"attributes",
")",
"{",
"foreach",
"(",
"$",
"attributes",
"as",
"$",
"attribute",
"=>",
"$",
"value",
")",
"{",
"$",
"this",
"->",
"setAttr",
"(",
"$",
"attribute",
",",
"$",
"value",
")",
";",
... | Batch Setup Attribute.
@param array $attributes | [
"Batch",
"Setup",
"Attribute",
"."
] | f2cde7fdf480d5eb5a491a5cf81ff7f4b3be0a35 | https://github.com/realboard/DBInstance/blob/f2cde7fdf480d5eb5a491a5cf81ff7f4b3be0a35/src/Realboard/Component/Database/DBInstance/Config.php#L158-L163 |
196,204 | realboard/DBInstance | src/Realboard/Component/Database/DBInstance/Config.php | Config.__buildConfig | private function __buildConfig(array $config)
{
foreach ($config as $key => $conf) {
if ($key == 'driver') {
$this->rawConfig['type'] = strtolower($conf);
continue;
}
if (!array_key_exists($key, $this->rawConfig)) {
$this->... | php | private function __buildConfig(array $config)
{
foreach ($config as $key => $conf) {
if ($key == 'driver') {
$this->rawConfig['type'] = strtolower($conf);
continue;
}
if (!array_key_exists($key, $this->rawConfig)) {
$this->... | [
"private",
"function",
"__buildConfig",
"(",
"array",
"$",
"config",
")",
"{",
"foreach",
"(",
"$",
"config",
"as",
"$",
"key",
"=>",
"$",
"conf",
")",
"{",
"if",
"(",
"$",
"key",
"==",
"'driver'",
")",
"{",
"$",
"this",
"->",
"rawConfig",
"[",
"'t... | Build Self Config.
@param array $config | [
"Build",
"Self",
"Config",
"."
] | f2cde7fdf480d5eb5a491a5cf81ff7f4b3be0a35 | https://github.com/realboard/DBInstance/blob/f2cde7fdf480d5eb5a491a5cf81ff7f4b3be0a35/src/Realboard/Component/Database/DBInstance/Config.php#L170-L198 |
196,205 | realboard/DBInstance | src/Realboard/Component/Database/DBInstance/Config.php | Config.getRawConfig | public function getRawConfig()
{
$raw = array();
foreach ($this->rawConfig as $key => $conf) {
$raw[$key] = call_user_func_array(array($this, 'get'.ucfirst($key)), array());
}
return $raw;
} | php | public function getRawConfig()
{
$raw = array();
foreach ($this->rawConfig as $key => $conf) {
$raw[$key] = call_user_func_array(array($this, 'get'.ucfirst($key)), array());
}
return $raw;
} | [
"public",
"function",
"getRawConfig",
"(",
")",
"{",
"$",
"raw",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"rawConfig",
"as",
"$",
"key",
"=>",
"$",
"conf",
")",
"{",
"$",
"raw",
"[",
"$",
"key",
"]",
"=",
"call_user_func_arra... | Get Raw Config.
@return array | [
"Get",
"Raw",
"Config",
"."
] | f2cde7fdf480d5eb5a491a5cf81ff7f4b3be0a35 | https://github.com/realboard/DBInstance/blob/f2cde7fdf480d5eb5a491a5cf81ff7f4b3be0a35/src/Realboard/Component/Database/DBInstance/Config.php#L205-L213 |
196,206 | realboard/DBInstance | src/Realboard/Component/Database/DBInstance/Config.php | Config.getPort | public function getPort()
{
$defaultPorts = array(
'mysql' => '3306',
'pgsql' => '5432',
'oci' => '1521',
);
if (!$this->rawConfig['port'] && isset($defaultPorts[$this->getType()])) {
$this->rawConfig['port'] = $defaultPorts[$this->getType()];
... | php | public function getPort()
{
$defaultPorts = array(
'mysql' => '3306',
'pgsql' => '5432',
'oci' => '1521',
);
if (!$this->rawConfig['port'] && isset($defaultPorts[$this->getType()])) {
$this->rawConfig['port'] = $defaultPorts[$this->getType()];
... | [
"public",
"function",
"getPort",
"(",
")",
"{",
"$",
"defaultPorts",
"=",
"array",
"(",
"'mysql'",
"=>",
"'3306'",
",",
"'pgsql'",
"=>",
"'5432'",
",",
"'oci'",
"=>",
"'1521'",
",",
")",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"rawConfig",
"[",
"'por... | Get Database Port.
@return int|null Port | [
"Get",
"Database",
"Port",
"."
] | f2cde7fdf480d5eb5a491a5cf81ff7f4b3be0a35 | https://github.com/realboard/DBInstance/blob/f2cde7fdf480d5eb5a491a5cf81ff7f4b3be0a35/src/Realboard/Component/Database/DBInstance/Config.php#L270-L282 |
196,207 | realboard/DBInstance | src/Realboard/Component/Database/DBInstance/Config.php | Config.getDsn | public function getDsn()
{
if ($this->rawConfig['dsn']) {
return $this->rawConfig['dsn'];
}
if (isset($this->connectionStrings[$this->getType()])) {
return $this->connectionStrings[$this->getType()]->getDsn();
}
} | php | public function getDsn()
{
if ($this->rawConfig['dsn']) {
return $this->rawConfig['dsn'];
}
if (isset($this->connectionStrings[$this->getType()])) {
return $this->connectionStrings[$this->getType()]->getDsn();
}
} | [
"public",
"function",
"getDsn",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"rawConfig",
"[",
"'dsn'",
"]",
")",
"{",
"return",
"$",
"this",
"->",
"rawConfig",
"[",
"'dsn'",
"]",
";",
"}",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"connectionStr... | Get Database DSN.
@return string DSN | [
"Get",
"Database",
"DSN",
"."
] | f2cde7fdf480d5eb5a491a5cf81ff7f4b3be0a35 | https://github.com/realboard/DBInstance/blob/f2cde7fdf480d5eb5a491a5cf81ff7f4b3be0a35/src/Realboard/Component/Database/DBInstance/Config.php#L329-L338 |
196,208 | realboard/DBInstance | src/Realboard/Component/Database/DBInstance/Config.php | Config.preventNoLocalDriver | public function preventNoLocalDriver($prevented = true)
{
if ($prevented && !array_key_exists($this->getType(), $this->connectionStrings)) {
$this->availableDrivers[] = $this->getType();
$this->rebuildConnectionString();
}
$this->preventNoLocalDriver = $prevented;
... | php | public function preventNoLocalDriver($prevented = true)
{
if ($prevented && !array_key_exists($this->getType(), $this->connectionStrings)) {
$this->availableDrivers[] = $this->getType();
$this->rebuildConnectionString();
}
$this->preventNoLocalDriver = $prevented;
... | [
"public",
"function",
"preventNoLocalDriver",
"(",
"$",
"prevented",
"=",
"true",
")",
"{",
"if",
"(",
"$",
"prevented",
"&&",
"!",
"array_key_exists",
"(",
"$",
"this",
"->",
"getType",
"(",
")",
",",
"$",
"this",
"->",
"connectionStrings",
")",
")",
"{... | Prevent error if driver is not available.
@param bool $prevented | [
"Prevent",
"error",
"if",
"driver",
"is",
"not",
"available",
"."
] | f2cde7fdf480d5eb5a491a5cf81ff7f4b3be0a35 | https://github.com/realboard/DBInstance/blob/f2cde7fdf480d5eb5a491a5cf81ff7f4b3be0a35/src/Realboard/Component/Database/DBInstance/Config.php#L377-L385 |
196,209 | Xsaven/laravel-intelect-admin | src/Addons/JWTAuth/Providers/JWTAuthServiceProvider.php | JWTAuthServiceProvider.bootBindings | protected function bootBindings()
{
$this->app->singleton('Lia\Addons\JWTAuth\JWTAuth', function ($app) {
return $app['lia.jwt.auth'];
});
$this->app->singleton('Lia\Addons\JWTAuth\Providers\User\UserInterface', function ($app) {
return $app['lia.jwt.provider.user'];... | php | protected function bootBindings()
{
$this->app->singleton('Lia\Addons\JWTAuth\JWTAuth', function ($app) {
return $app['lia.jwt.auth'];
});
$this->app->singleton('Lia\Addons\JWTAuth\Providers\User\UserInterface', function ($app) {
return $app['lia.jwt.provider.user'];... | [
"protected",
"function",
"bootBindings",
"(",
")",
"{",
"$",
"this",
"->",
"app",
"->",
"singleton",
"(",
"'Lia\\Addons\\JWTAuth\\JWTAuth'",
",",
"function",
"(",
"$",
"app",
")",
"{",
"return",
"$",
"app",
"[",
"'lia.jwt.auth'",
"]",
";",
"}",
")",
";",
... | Bind some Interfaces and implementations. | [
"Bind",
"some",
"Interfaces",
"and",
"implementations",
"."
] | 592574633d12c74cf25b43dd6694fee496abefcb | https://github.com/Xsaven/laravel-intelect-admin/blob/592574633d12c74cf25b43dd6694fee496abefcb/src/Addons/JWTAuth/Providers/JWTAuthServiceProvider.php#L40-L81 |
196,210 | Xsaven/laravel-intelect-admin | src/Addons/JWTAuth/Providers/JWTAuthServiceProvider.php | JWTAuthServiceProvider.registerUserProvider | protected function registerUserProvider()
{
$this->app->singleton('lia.jwt.provider.user', function ($app) {
$provider = $this->config('providers.user');
$model = $app->make($this->config('user'));
return new $provider($model);
});
} | php | protected function registerUserProvider()
{
$this->app->singleton('lia.jwt.provider.user', function ($app) {
$provider = $this->config('providers.user');
$model = $app->make($this->config('user'));
return new $provider($model);
});
} | [
"protected",
"function",
"registerUserProvider",
"(",
")",
"{",
"$",
"this",
"->",
"app",
"->",
"singleton",
"(",
"'lia.jwt.provider.user'",
",",
"function",
"(",
"$",
"app",
")",
"{",
"$",
"provider",
"=",
"$",
"this",
"->",
"config",
"(",
"'providers.user'... | Register the bindings for the User provider. | [
"Register",
"the",
"bindings",
"for",
"the",
"User",
"provider",
"."
] | 592574633d12c74cf25b43dd6694fee496abefcb | https://github.com/Xsaven/laravel-intelect-admin/blob/592574633d12c74cf25b43dd6694fee496abefcb/src/Addons/JWTAuth/Providers/JWTAuthServiceProvider.php#L111-L119 |
196,211 | Xsaven/laravel-intelect-admin | src/Addons/JWTAuth/Providers/JWTAuthServiceProvider.php | JWTAuthServiceProvider.registerJWTManager | protected function registerJWTManager()
{
$this->app->singleton('lia.jwt.manager', function ($app) {
$instance = new JWTManager(
$app['lia.jwt.provider.jwt'],
$app['lia.jwt.blacklist'],
$app['lia.jwt.payload.factory']
);
re... | php | protected function registerJWTManager()
{
$this->app->singleton('lia.jwt.manager', function ($app) {
$instance = new JWTManager(
$app['lia.jwt.provider.jwt'],
$app['lia.jwt.blacklist'],
$app['lia.jwt.payload.factory']
);
re... | [
"protected",
"function",
"registerJWTManager",
"(",
")",
"{",
"$",
"this",
"->",
"app",
"->",
"singleton",
"(",
"'lia.jwt.manager'",
",",
"function",
"(",
"$",
"app",
")",
"{",
"$",
"instance",
"=",
"new",
"JWTManager",
"(",
"$",
"app",
"[",
"'lia.jwt.prov... | Register the bindings for the JWT Manager. | [
"Register",
"the",
"bindings",
"for",
"the",
"JWT",
"Manager",
"."
] | 592574633d12c74cf25b43dd6694fee496abefcb | https://github.com/Xsaven/laravel-intelect-admin/blob/592574633d12c74cf25b43dd6694fee496abefcb/src/Addons/JWTAuth/Providers/JWTAuthServiceProvider.php#L168-L179 |
196,212 | Xsaven/laravel-intelect-admin | src/Addons/JWTAuth/Providers/JWTAuthServiceProvider.php | JWTAuthServiceProvider.registerPayloadFactory | protected function registerPayloadFactory()
{
$this->app->singleton('lia.jwt.payload.factory', function ($app) {
$factory = new PayloadFactory($app['lia.jwt.claim.factory'], $app['request'], $app['lia.jwt.validators.payload']);
return $factory->setTTL($this->config('ttl'));
... | php | protected function registerPayloadFactory()
{
$this->app->singleton('lia.jwt.payload.factory', function ($app) {
$factory = new PayloadFactory($app['lia.jwt.claim.factory'], $app['request'], $app['lia.jwt.validators.payload']);
return $factory->setTTL($this->config('ttl'));
... | [
"protected",
"function",
"registerPayloadFactory",
"(",
")",
"{",
"$",
"this",
"->",
"app",
"->",
"singleton",
"(",
"'lia.jwt.payload.factory'",
",",
"function",
"(",
"$",
"app",
")",
"{",
"$",
"factory",
"=",
"new",
"PayloadFactory",
"(",
"$",
"app",
"[",
... | Register the bindings for the Payload Factory. | [
"Register",
"the",
"bindings",
"for",
"the",
"Payload",
"Factory",
"."
] | 592574633d12c74cf25b43dd6694fee496abefcb | https://github.com/Xsaven/laravel-intelect-admin/blob/592574633d12c74cf25b43dd6694fee496abefcb/src/Addons/JWTAuth/Providers/JWTAuthServiceProvider.php#L223-L230 |
196,213 | polusphp/polus-middleware | src/ClientIp.php | ClientIp.determineClientIpAddress | protected function determineClientIpAddress($request)
{
$ipAddress = null;
$serverParams = $request->getServerParams();
if (isset($serverParams['REMOTE_ADDR']) && $this->isValidIpAddress($serverParams['REMOTE_ADDR'])) {
$ipAddress = $serverParams['REMOTE_ADDR'];
}
... | php | protected function determineClientIpAddress($request)
{
$ipAddress = null;
$serverParams = $request->getServerParams();
if (isset($serverParams['REMOTE_ADDR']) && $this->isValidIpAddress($serverParams['REMOTE_ADDR'])) {
$ipAddress = $serverParams['REMOTE_ADDR'];
}
... | [
"protected",
"function",
"determineClientIpAddress",
"(",
"$",
"request",
")",
"{",
"$",
"ipAddress",
"=",
"null",
";",
"$",
"serverParams",
"=",
"$",
"request",
"->",
"getServerParams",
"(",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"serverParams",
"[",
"'R... | Find out the client's IP address from the headers available to us
@param ServerRequestInterface $request PSR-7 Request
@return string | [
"Find",
"out",
"the",
"client",
"s",
"IP",
"address",
"from",
"the",
"headers",
"available",
"to",
"us"
] | c265c51fbdf6b2c5ed85686415b47a1fbf720c57 | https://github.com/polusphp/polus-middleware/blob/c265c51fbdf6b2c5ed85686415b47a1fbf720c57/src/ClientIp.php#L88-L117 |
196,214 | polusphp/polus-middleware | src/ClientIp.php | ClientIp.isValidIpAddress | protected function isValidIpAddress($ip)
{
$flags = FILTER_FLAG_IPV4 | FILTER_FLAG_IPV6;
if (filter_var($ip, FILTER_VALIDATE_IP, $flags) === false) {
return false;
}
return true;
} | php | protected function isValidIpAddress($ip)
{
$flags = FILTER_FLAG_IPV4 | FILTER_FLAG_IPV6;
if (filter_var($ip, FILTER_VALIDATE_IP, $flags) === false) {
return false;
}
return true;
} | [
"protected",
"function",
"isValidIpAddress",
"(",
"$",
"ip",
")",
"{",
"$",
"flags",
"=",
"FILTER_FLAG_IPV4",
"|",
"FILTER_FLAG_IPV6",
";",
"if",
"(",
"filter_var",
"(",
"$",
"ip",
",",
"FILTER_VALIDATE_IP",
",",
"$",
"flags",
")",
"===",
"false",
")",
"{"... | Check that a given string is a valid IP address
@param string $ip
@return boolean | [
"Check",
"that",
"a",
"given",
"string",
"is",
"a",
"valid",
"IP",
"address"
] | c265c51fbdf6b2c5ed85686415b47a1fbf720c57 | https://github.com/polusphp/polus-middleware/blob/c265c51fbdf6b2c5ed85686415b47a1fbf720c57/src/ClientIp.php#L125-L132 |
196,215 | stubbles/stubbles-date | src/main/php/TimeZone.php | TimeZone.offset | public function offset($date = null): string
{
$offset = $this->offsetInSeconds($date);
$hours = intval(abs($offset) / 3600);
$minutes = (abs($offset)- ($hours * 3600)) / 60;
return sprintf('%s%02d%02d', ($offset < 0 ? '-' : '+'), $hours, $minutes);
} | php | public function offset($date = null): string
{
$offset = $this->offsetInSeconds($date);
$hours = intval(abs($offset) / 3600);
$minutes = (abs($offset)- ($hours * 3600)) / 60;
return sprintf('%s%02d%02d', ($offset < 0 ? '-' : '+'), $hours, $minutes);
} | [
"public",
"function",
"offset",
"(",
"$",
"date",
"=",
"null",
")",
":",
"string",
"{",
"$",
"offset",
"=",
"$",
"this",
"->",
"offsetInSeconds",
"(",
"$",
"date",
")",
";",
"$",
"hours",
"=",
"intval",
"(",
"abs",
"(",
"$",
"offset",
")",
"/",
"... | returns offset of the time zone
@param int|string|\DateTime|\stubbles\date\Date $date defaults to current date
@return string | [
"returns",
"offset",
"of",
"the",
"time",
"zone"
] | 98553392bec03affc53a6e3eb7f88408c2720d1c | https://github.com/stubbles/stubbles-date/blob/98553392bec03affc53a6e3eb7f88408c2720d1c/src/main/php/TimeZone.php#L81-L87 |
196,216 | stubbles/stubbles-date | src/main/php/TimeZone.php | TimeZone.offsetInSeconds | public function offsetInSeconds($date = null): int
{
if (null === $date) {
return $this->timeZone->getOffset(new \DateTime('now'));
}
return $this->timeZone->getOffset(Date::castFrom($date)->handle());
} | php | public function offsetInSeconds($date = null): int
{
if (null === $date) {
return $this->timeZone->getOffset(new \DateTime('now'));
}
return $this->timeZone->getOffset(Date::castFrom($date)->handle());
} | [
"public",
"function",
"offsetInSeconds",
"(",
"$",
"date",
"=",
"null",
")",
":",
"int",
"{",
"if",
"(",
"null",
"===",
"$",
"date",
")",
"{",
"return",
"$",
"this",
"->",
"timeZone",
"->",
"getOffset",
"(",
"new",
"\\",
"DateTime",
"(",
"'now'",
")"... | returns offset to given date in seconds
Because a timezone may have different offsets when its in DST or non-DST
mode, a date object must be given which is used to determine whether DST
or non-DST offset should be returned.
@param int|string|\DateTime|\stubbles\date\Date $date defaults to current date
@return in... | [
"returns",
"offset",
"to",
"given",
"date",
"in",
"seconds"
] | 98553392bec03affc53a6e3eb7f88408c2720d1c | https://github.com/stubbles/stubbles-date/blob/98553392bec03affc53a6e3eb7f88408c2720d1c/src/main/php/TimeZone.php#L99-L106 |
196,217 | stubbles/stubbles-date | src/main/php/TimeZone.php | TimeZone.translate | public function translate($date): Date
{
$handle = Date::castFrom($date)->handle();
$handle->setTimezone($this->timeZone);
return new Date($handle);
} | php | public function translate($date): Date
{
$handle = Date::castFrom($date)->handle();
$handle->setTimezone($this->timeZone);
return new Date($handle);
} | [
"public",
"function",
"translate",
"(",
"$",
"date",
")",
":",
"Date",
"{",
"$",
"handle",
"=",
"Date",
"::",
"castFrom",
"(",
"$",
"date",
")",
"->",
"handle",
"(",
")",
";",
"$",
"handle",
"->",
"setTimezone",
"(",
"$",
"this",
"->",
"timeZone",
... | translates a date from one timezone to a date of this timezone
A new date instance will be returned while the given date is not changed.
@param int|string|\DateTime|\stubbles\date\Date $date
@return \stubbles\date\Date | [
"translates",
"a",
"date",
"from",
"one",
"timezone",
"to",
"a",
"date",
"of",
"this",
"timezone"
] | 98553392bec03affc53a6e3eb7f88408c2720d1c | https://github.com/stubbles/stubbles-date/blob/98553392bec03affc53a6e3eb7f88408c2720d1c/src/main/php/TimeZone.php#L127-L132 |
196,218 | pixelpolishers/makedocs | src/MakeDocs/Builder/Html/HtmlBuilder.php | HtmlBuilder.getElementRegister | public function getElementRegister()
{
if ($this->elementRegister === null) {
$this->elementRegister = new ElementRegister();
$this->initializeElementRegister($this->elementRegister);
}
return $this->elementRegister;
} | php | public function getElementRegister()
{
if ($this->elementRegister === null) {
$this->elementRegister = new ElementRegister();
$this->initializeElementRegister($this->elementRegister);
}
return $this->elementRegister;
} | [
"public",
"function",
"getElementRegister",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"elementRegister",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"elementRegister",
"=",
"new",
"ElementRegister",
"(",
")",
";",
"$",
"this",
"->",
"initializeElementRegi... | Gets the element register.
@return ElementRegister | [
"Gets",
"the",
"element",
"register",
"."
] | 1fa243b52565b5de417ef2dbdfbcae9896b6b483 | https://github.com/pixelpolishers/makedocs/blob/1fa243b52565b5de417ef2dbdfbcae9896b6b483/src/MakeDocs/Builder/Html/HtmlBuilder.php#L65-L72 |
196,219 | pixelpolishers/makedocs | src/MakeDocs/Builder/Html/HtmlBuilder.php | HtmlBuilder.initializeElementRegister | protected function initializeElementRegister(ElementRegister $register)
{
$register->set('a', new AnchorElement());
$register->set('admonition', new AdmonitionElement());
$register->set('br', new BreakElement());
$register->set('code', new CodeElement());
$register->set('em',... | php | protected function initializeElementRegister(ElementRegister $register)
{
$register->set('a', new AnchorElement());
$register->set('admonition', new AdmonitionElement());
$register->set('br', new BreakElement());
$register->set('code', new CodeElement());
$register->set('em',... | [
"protected",
"function",
"initializeElementRegister",
"(",
"ElementRegister",
"$",
"register",
")",
"{",
"$",
"register",
"->",
"set",
"(",
"'a'",
",",
"new",
"AnchorElement",
"(",
")",
")",
";",
"$",
"register",
"->",
"set",
"(",
"'admonition'",
",",
"new",... | Initializes athe element register.
@param ElementRegister $register The register to initialize. | [
"Initializes",
"athe",
"element",
"register",
"."
] | 1fa243b52565b5de417ef2dbdfbcae9896b6b483 | https://github.com/pixelpolishers/makedocs/blob/1fa243b52565b5de417ef2dbdfbcae9896b6b483/src/MakeDocs/Builder/Html/HtmlBuilder.php#L79-L108 |
196,220 | pixelpolishers/makedocs | src/MakeDocs/Builder/Html/HtmlBuilder.php | HtmlBuilder.getLink | public function getLink($page, $header = null)
{
$id = preg_replace('/[^a-z0-9\/]+/i', '', $page);
$link = $this->getBaseUrl() . '/' . $id;
if ($header !== null) {
$link .= '#' . $this->createId($header);
} else if ($id == 'index') {
$link = $this->getBaseUrl... | php | public function getLink($page, $header = null)
{
$id = preg_replace('/[^a-z0-9\/]+/i', '', $page);
$link = $this->getBaseUrl() . '/' . $id;
if ($header !== null) {
$link .= '#' . $this->createId($header);
} else if ($id == 'index') {
$link = $this->getBaseUrl... | [
"public",
"function",
"getLink",
"(",
"$",
"page",
",",
"$",
"header",
"=",
"null",
")",
"{",
"$",
"id",
"=",
"preg_replace",
"(",
"'/[^a-z0-9\\/]+/i'",
",",
"''",
",",
"$",
"page",
")",
";",
"$",
"link",
"=",
"$",
"this",
"->",
"getBaseUrl",
"(",
... | Gets the link for the given source file.
@param SourceFile $page The page to get the link for.
@param string $header An optional header to link to.
@return string | [
"Gets",
"the",
"link",
"for",
"the",
"given",
"source",
"file",
"."
] | 1fa243b52565b5de417ef2dbdfbcae9896b6b483 | https://github.com/pixelpolishers/makedocs/blob/1fa243b52565b5de417ef2dbdfbcae9896b6b483/src/MakeDocs/Builder/Html/HtmlBuilder.php#L188-L200 |
196,221 | pixelpolishers/makedocs | src/MakeDocs/Builder/Html/HtmlBuilder.php | HtmlBuilder.build | public function build(Generator $generator)
{
$renderer = new DOMRenderer($generator, $this);
$publisher = new Publisher($generator, $this);
$pageManager = $this->loadPageManager($generator);
while (!$pageManager->getQueue()->isEmpty()) {
$page = $pageManager->getQueue()... | php | public function build(Generator $generator)
{
$renderer = new DOMRenderer($generator, $this);
$publisher = new Publisher($generator, $this);
$pageManager = $this->loadPageManager($generator);
while (!$pageManager->getQueue()->isEmpty()) {
$page = $pageManager->getQueue()... | [
"public",
"function",
"build",
"(",
"Generator",
"$",
"generator",
")",
"{",
"$",
"renderer",
"=",
"new",
"DOMRenderer",
"(",
"$",
"generator",
",",
"$",
"this",
")",
";",
"$",
"publisher",
"=",
"new",
"Publisher",
"(",
"$",
"generator",
",",
"$",
"thi... | Builds the source files.
@param Generator $generator The generator to build for. | [
"Builds",
"the",
"source",
"files",
"."
] | 1fa243b52565b5de417ef2dbdfbcae9896b6b483 | https://github.com/pixelpolishers/makedocs/blob/1fa243b52565b5de417ef2dbdfbcae9896b6b483/src/MakeDocs/Builder/Html/HtmlBuilder.php#L207-L234 |
196,222 | AnonymPHP/Anonym-Route | Router.php | Router.run | public function run()
{
$method = strtoupper($this->getRequest()->getMethod());
$collections = $this->resolveGroupAndWhen(RouteCollector::getRoutes());
if (!$this->hasAnyRouteInRequestMethod($collections, $method)) {
$this->callRouteNotFoundCommand();
}
$colle... | php | public function run()
{
$method = strtoupper($this->getRequest()->getMethod());
$collections = $this->resolveGroupAndWhen(RouteCollector::getRoutes());
if (!$this->hasAnyRouteInRequestMethod($collections, $method)) {
$this->callRouteNotFoundCommand();
}
$colle... | [
"public",
"function",
"run",
"(",
")",
"{",
"$",
"method",
"=",
"strtoupper",
"(",
"$",
"this",
"->",
"getRequest",
"(",
")",
"->",
"getMethod",
"(",
")",
")",
";",
"$",
"collections",
"=",
"$",
"this",
"->",
"resolveGroupAndWhen",
"(",
"RouteCollector",... | Run the router and check requested uri
@throws RouteMatchException
@return bool | [
"Run",
"the",
"router",
"and",
"check",
"requested",
"uri"
] | bb7f8004fbbd2998af8b0061f404f026f11466ab | https://github.com/AnonymPHP/Anonym-Route/blob/bb7f8004fbbd2998af8b0061f404f026f11466ab/Router.php#L197-L217 |
196,223 | AnonymPHP/Anonym-Route | Router.php | Router.dispatchCollection | protected function dispatchCollection($collection)
{
// find and send group variables
$group = isset($collection['group']) ? $collection['group'] : null;
// dispatch action dispatcher
$content = $this->getActionDispatcher()->dispatch($collection['action'], $group);
if (is_str... | php | protected function dispatchCollection($collection)
{
// find and send group variables
$group = isset($collection['group']) ? $collection['group'] : null;
// dispatch action dispatcher
$content = $this->getActionDispatcher()->dispatch($collection['action'], $group);
if (is_str... | [
"protected",
"function",
"dispatchCollection",
"(",
"$",
"collection",
")",
"{",
"// find and send group variables",
"$",
"group",
"=",
"isset",
"(",
"$",
"collection",
"[",
"'group'",
"]",
")",
"?",
"$",
"collection",
"[",
"'group'",
"]",
":",
"null",
";",
... | dispatch matched collection
@param mixed $collection | [
"dispatch",
"matched",
"collection"
] | bb7f8004fbbd2998af8b0061f404f026f11466ab | https://github.com/AnonymPHP/Anonym-Route/blob/bb7f8004fbbd2998af8b0061f404f026f11466ab/Router.php#L263-L272 |
196,224 | AnonymPHP/Anonym-Route | Router.php | Router.resolveGroupAndWhen | protected function resolveGroupAndWhen($collections)
{
if (count(RouteCollector::getGroups())) {
$collections = $this->resolveGroupCollections($collections);
}
if (isset($collections['WHEN'])) {
$collections = $this->resolveWhenCollections($collections['WHEN']);
... | php | protected function resolveGroupAndWhen($collections)
{
if (count(RouteCollector::getGroups())) {
$collections = $this->resolveGroupCollections($collections);
}
if (isset($collections['WHEN'])) {
$collections = $this->resolveWhenCollections($collections['WHEN']);
... | [
"protected",
"function",
"resolveGroupAndWhen",
"(",
"$",
"collections",
")",
"{",
"if",
"(",
"count",
"(",
"RouteCollector",
"::",
"getGroups",
"(",
")",
")",
")",
"{",
"$",
"collections",
"=",
"$",
"this",
"->",
"resolveGroupCollections",
"(",
"$",
"collec... | resolve group and when collections
@param array $collections
@return array | [
"resolve",
"group",
"and",
"when",
"collections"
] | bb7f8004fbbd2998af8b0061f404f026f11466ab | https://github.com/AnonymPHP/Anonym-Route/blob/bb7f8004fbbd2998af8b0061f404f026f11466ab/Router.php#L300-L315 |
196,225 | AnonymPHP/Anonym-Route | Router.php | Router.resolveWhenCollections | protected function resolveWhenCollections(array $collections = [])
{
foreach ($collections as $index => $collection) {
if ($this->getMatcher()->matchWhen($collection['uri'])) {
// registering when tag
RouteCollector::$firing['when'] = $collection['uri'];
... | php | protected function resolveWhenCollections(array $collections = [])
{
foreach ($collections as $index => $collection) {
if ($this->getMatcher()->matchWhen($collection['uri'])) {
// registering when tag
RouteCollector::$firing['when'] = $collection['uri'];
... | [
"protected",
"function",
"resolveWhenCollections",
"(",
"array",
"$",
"collections",
"=",
"[",
"]",
")",
"{",
"foreach",
"(",
"$",
"collections",
"as",
"$",
"index",
"=>",
"$",
"collection",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"getMatcher",
"(",
")",... | resolve when collections
@param array $collections
@return array | [
"resolve",
"when",
"collections"
] | bb7f8004fbbd2998af8b0061f404f026f11466ab | https://github.com/AnonymPHP/Anonym-Route/blob/bb7f8004fbbd2998af8b0061f404f026f11466ab/Router.php#L324-L339 |
196,226 | AnonymPHP/Anonym-Route | Router.php | Router.resolveGroupCollections | private function resolveGroupCollections(array $groups = [])
{
foreach ($groups as $index => $group) {
// register group
RouteCollector::$firing['group'] = $group;
app()->call($group['callback'], [app('route')]);
// unregister the route
unset(Rou... | php | private function resolveGroupCollections(array $groups = [])
{
foreach ($groups as $index => $group) {
// register group
RouteCollector::$firing['group'] = $group;
app()->call($group['callback'], [app('route')]);
// unregister the route
unset(Rou... | [
"private",
"function",
"resolveGroupCollections",
"(",
"array",
"$",
"groups",
"=",
"[",
"]",
")",
"{",
"foreach",
"(",
"$",
"groups",
"as",
"$",
"index",
"=>",
"$",
"group",
")",
"{",
"// register group",
"RouteCollector",
"::",
"$",
"firing",
"[",
"'grou... | resolve the when collections
@param array $groups
@return array return the new collections | [
"resolve",
"the",
"when",
"collections"
] | bb7f8004fbbd2998af8b0061f404f026f11466ab | https://github.com/AnonymPHP/Anonym-Route/blob/bb7f8004fbbd2998af8b0061f404f026f11466ab/Router.php#L347-L361 |
196,227 | AnonymPHP/Anonym-Route | Router.php | Router.sendContentString | private function sendContentString($content = '', Request $request)
{
$response = $request->getResponse();
$response->setContent($content);
$response->send();
} | php | private function sendContentString($content = '', Request $request)
{
$response = $request->getResponse();
$response->setContent($content);
$response->send();
} | [
"private",
"function",
"sendContentString",
"(",
"$",
"content",
"=",
"''",
",",
"Request",
"$",
"request",
")",
"{",
"$",
"response",
"=",
"$",
"request",
"->",
"getResponse",
"(",
")",
";",
"$",
"response",
"->",
"setContent",
"(",
"$",
"content",
")",... | send the content
@param string $content
@param Request $request | [
"send",
"the",
"content"
] | bb7f8004fbbd2998af8b0061f404f026f11466ab | https://github.com/AnonymPHP/Anonym-Route/blob/bb7f8004fbbd2998af8b0061f404f026f11466ab/Router.php#L369-L374 |
196,228 | jonesiscoding/device | src/DetectByUserAgent.php | DetectByUserAgent.detect | public function detect()
{
$detected = true;
if ( empty( $this->ua ) )
{
$detected = false;
}
else
{
// If it's not any of the common browsers, perhaps it's something mobile.
if ( !$this->isMSIE() && !$this->isChrome() && !$this->isFirefox() && !$this->isSafari() && !$this->i... | php | public function detect()
{
$detected = true;
if ( empty( $this->ua ) )
{
$detected = false;
}
else
{
// If it's not any of the common browsers, perhaps it's something mobile.
if ( !$this->isMSIE() && !$this->isChrome() && !$this->isFirefox() && !$this->isSafari() && !$this->i... | [
"public",
"function",
"detect",
"(",
")",
"{",
"$",
"detected",
"=",
"true",
";",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"ua",
")",
")",
"{",
"$",
"detected",
"=",
"false",
";",
"}",
"else",
"{",
"// If it's not any of the common browsers, perhaps it'... | Detects the various items from the user agent, and returns what it can in the the array format desired by
DeviceFeatureInfo. If nothing can be detected, returns null.
@return array|null | [
"Detects",
"the",
"various",
"items",
"from",
"the",
"user",
"agent",
"and",
"returns",
"what",
"it",
"can",
"in",
"the",
"the",
"array",
"format",
"desired",
"by",
"DeviceFeatureInfo",
".",
"If",
"nothing",
"can",
"be",
"detected",
"returns",
"null",
"."
] | d3c66f934bcaa8e5e0424cf684c995b1c80cee29 | https://github.com/jonesiscoding/device/blob/d3c66f934bcaa8e5e0424cf684c995b1c80cee29/src/DetectByUserAgent.php#L84-L160 |
196,229 | jonesiscoding/device | src/DetectByUserAgent.php | DetectByUserAgent.isSafari | private function isSafari()
{
$is = false;
if ( preg_match( "/(Version)\/(\d+)\.(\d+)(?:\.(\d+))?.*Safari\//", $this->ua, $matches ) )
{
// These things sometimes surf around acting like they're Safari.
if ( !preg_match( "/(PhantomJS|Silk|rekonq|OPR|Chrome|Android|Edge|bot)/", $this->ua ) )
... | php | private function isSafari()
{
$is = false;
if ( preg_match( "/(Version)\/(\d+)\.(\d+)(?:\.(\d+))?.*Safari\//", $this->ua, $matches ) )
{
// These things sometimes surf around acting like they're Safari.
if ( !preg_match( "/(PhantomJS|Silk|rekonq|OPR|Chrome|Android|Edge|bot)/", $this->ua ) )
... | [
"private",
"function",
"isSafari",
"(",
")",
"{",
"$",
"is",
"=",
"false",
";",
"if",
"(",
"preg_match",
"(",
"\"/(Version)\\/(\\d+)\\.(\\d+)(?:\\.(\\d+))?.*Safari\\//\"",
",",
"$",
"this",
"->",
"ua",
",",
"$",
"matches",
")",
")",
"{",
"// These things sometim... | Determines if a browser is Safari by the user agent string.
@return bool | [
"Determines",
"if",
"a",
"browser",
"is",
"Safari",
"by",
"the",
"user",
"agent",
"string",
"."
] | d3c66f934bcaa8e5e0424cf684c995b1c80cee29 | https://github.com/jonesiscoding/device/blob/d3c66f934bcaa8e5e0424cf684c995b1c80cee29/src/DetectByUserAgent.php#L273-L318 |
196,230 | jonesiscoding/device | src/DetectByUserAgent.php | DetectByUserAgent.isChrome | private function isChrome()
{
$is = false;
// For our purposes, Chrome and Chromium are the same.
if ( preg_match( "/(Chrome|Chromium)\/([0-9\.]+)/", $this->ua, $matches ) )
{
// These things go around acting like they are chrome, but they aren't.
if ( !preg_match( "/(MRCHROME|FlyFlow|baid... | php | private function isChrome()
{
$is = false;
// For our purposes, Chrome and Chromium are the same.
if ( preg_match( "/(Chrome|Chromium)\/([0-9\.]+)/", $this->ua, $matches ) )
{
// These things go around acting like they are chrome, but they aren't.
if ( !preg_match( "/(MRCHROME|FlyFlow|baid... | [
"private",
"function",
"isChrome",
"(",
")",
"{",
"$",
"is",
"=",
"false",
";",
"// For our purposes, Chrome and Chromium are the same.",
"if",
"(",
"preg_match",
"(",
"\"/(Chrome|Chromium)\\/([0-9\\.]+)/\"",
",",
"$",
"this",
"->",
"ua",
",",
"$",
"matches",
")",
... | Determines if a browser is chrome by the user agent string.
@return bool | [
"Determines",
"if",
"a",
"browser",
"is",
"chrome",
"by",
"the",
"user",
"agent",
"string",
"."
] | d3c66f934bcaa8e5e0424cf684c995b1c80cee29 | https://github.com/jonesiscoding/device/blob/d3c66f934bcaa8e5e0424cf684c995b1c80cee29/src/DetectByUserAgent.php#L324-L354 |
196,231 | jonesiscoding/device | src/DetectByUserAgent.php | DetectByUserAgent.isEdge | private function isEdge()
{
if ( preg_match("/Edge (([0-9]+)\.?([0-9]*))/", $this->ua, $matches) )
{
// Nothing is known to try to look like a faux Edge, but we'll still exclude 'bots'
if( stripos( $this->ua, 'bot' ) === false )
{
$this->browser = "edge";
$this->version = $ma... | php | private function isEdge()
{
if ( preg_match("/Edge (([0-9]+)\.?([0-9]*))/", $this->ua, $matches) )
{
// Nothing is known to try to look like a faux Edge, but we'll still exclude 'bots'
if( stripos( $this->ua, 'bot' ) === false )
{
$this->browser = "edge";
$this->version = $ma... | [
"private",
"function",
"isEdge",
"(",
")",
"{",
"if",
"(",
"preg_match",
"(",
"\"/Edge (([0-9]+)\\.?([0-9]*))/\"",
",",
"$",
"this",
"->",
"ua",
",",
"$",
"matches",
")",
")",
"{",
"// Nothing is known to try to look like a faux Edge, but we'll still exclude 'bots'",
"i... | Determines if a browser is Microsoft Edge by the user agent string.
@return bool | [
"Determines",
"if",
"a",
"browser",
"is",
"Microsoft",
"Edge",
"by",
"the",
"user",
"agent",
"string",
"."
] | d3c66f934bcaa8e5e0424cf684c995b1c80cee29 | https://github.com/jonesiscoding/device/blob/d3c66f934bcaa8e5e0424cf684c995b1c80cee29/src/DetectByUserAgent.php#L361-L376 |
196,232 | jonesiscoding/device | src/DetectByUserAgent.php | DetectByUserAgent.isMSIE | private function isMSIE()
{
$is = false;
// Versions prior to IE11 follow this format
if ( preg_match("/MSIE (([0-9]+)\.?([0-9]*))/", $this->ua, $matches) )
{
$is = true;
$version = $matches[ 1 ];
$major = $matches[ 2 ];
$minor = $matches[ 3 ];
}
// This one is for IE11... | php | private function isMSIE()
{
$is = false;
// Versions prior to IE11 follow this format
if ( preg_match("/MSIE (([0-9]+)\.?([0-9]*))/", $this->ua, $matches) )
{
$is = true;
$version = $matches[ 1 ];
$major = $matches[ 2 ];
$minor = $matches[ 3 ];
}
// This one is for IE11... | [
"private",
"function",
"isMSIE",
"(",
")",
"{",
"$",
"is",
"=",
"false",
";",
"// Versions prior to IE11 follow this format",
"if",
"(",
"preg_match",
"(",
"\"/MSIE (([0-9]+)\\.?([0-9]*))/\"",
",",
"$",
"this",
"->",
"ua",
",",
"$",
"matches",
")",
")",
"{",
"... | Determines if a browser is Internet Explorer by the user agent string.
@return bool | [
"Determines",
"if",
"a",
"browser",
"is",
"Internet",
"Explorer",
"by",
"the",
"user",
"agent",
"string",
"."
] | d3c66f934bcaa8e5e0424cf684c995b1c80cee29 | https://github.com/jonesiscoding/device/blob/d3c66f934bcaa8e5e0424cf684c995b1c80cee29/src/DetectByUserAgent.php#L383-L415 |
196,233 | jonesiscoding/device | src/DetectByUserAgent.php | DetectByUserAgent.isOpera | private function isOpera()
{
$is = false;
// The 'Opera/x.xx' stopped at 9.80, then the version went into the 'Version/x.x.x' format.
if ( preg_match("/(Opera)\/9.80.*Version\/((\d+)\.(\d+)(?:\.(\d+))?)/", $this->ua, $matches) )
{
$is = true;
$version = $matches[ 2 ];
$major = $match... | php | private function isOpera()
{
$is = false;
// The 'Opera/x.xx' stopped at 9.80, then the version went into the 'Version/x.x.x' format.
if ( preg_match("/(Opera)\/9.80.*Version\/((\d+)\.(\d+)(?:\.(\d+))?)/", $this->ua, $matches) )
{
$is = true;
$version = $matches[ 2 ];
$major = $match... | [
"private",
"function",
"isOpera",
"(",
")",
"{",
"$",
"is",
"=",
"false",
";",
"// The 'Opera/x.xx' stopped at 9.80, then the version went into the 'Version/x.x.x' format.",
"if",
"(",
"preg_match",
"(",
"\"/(Opera)\\/9.80.*Version\\/((\\d+)\\.(\\d+)(?:\\.(\\d+))?)/\"",
",",
"$",... | Determines if a browser is Opera by the user agent string.
@return bool | [
"Determines",
"if",
"a",
"browser",
"is",
"Opera",
"by",
"the",
"user",
"agent",
"string",
"."
] | d3c66f934bcaa8e5e0424cf684c995b1c80cee29 | https://github.com/jonesiscoding/device/blob/d3c66f934bcaa8e5e0424cf684c995b1c80cee29/src/DetectByUserAgent.php#L422-L469 |
196,234 | jonesiscoding/device | src/DetectByUserAgent.php | DetectByUserAgent.isOperaMobile | private function isOperaMobile()
{
$is = false;
$android = false;
$ios = false;
$tablet = false;
$phone = false;
$touch = false;
if ( $this->browser == 'opera' || $this->isOpera() )
{
// This is definitely opera mobile, strangely, on Android
if ( preg_match( "/(?:Mobile Sa... | php | private function isOperaMobile()
{
$is = false;
$android = false;
$ios = false;
$tablet = false;
$phone = false;
$touch = false;
if ( $this->browser == 'opera' || $this->isOpera() )
{
// This is definitely opera mobile, strangely, on Android
if ( preg_match( "/(?:Mobile Sa... | [
"private",
"function",
"isOperaMobile",
"(",
")",
"{",
"$",
"is",
"=",
"false",
";",
"$",
"android",
"=",
"false",
";",
"$",
"ios",
"=",
"false",
";",
"$",
"tablet",
"=",
"false",
";",
"$",
"phone",
"=",
"false",
";",
"$",
"touch",
"=",
"false",
... | Determines if the browser is the mobile or mini version of opera by the user agent string.
@return bool | [
"Determines",
"if",
"the",
"browser",
"is",
"the",
"mobile",
"or",
"mini",
"version",
"of",
"opera",
"by",
"the",
"user",
"agent",
"string",
"."
] | d3c66f934bcaa8e5e0424cf684c995b1c80cee29 | https://github.com/jonesiscoding/device/blob/d3c66f934bcaa8e5e0424cf684c995b1c80cee29/src/DetectByUserAgent.php#L519-L580 |
196,235 | jonesiscoding/device | src/DetectByUserAgent.php | DetectByUserAgent.isChromeMobile | private function isChromeMobile()
{
$is = false;
$android = false;
$ios = false;
$tablet = false;
$phone = false;
if ( $this->browser == 'chrome' || $this->isChrome() )
{
// We aren't differentiating between Chrome and webview. It doesn't matter for our purposes.
if ( stripos(... | php | private function isChromeMobile()
{
$is = false;
$android = false;
$ios = false;
$tablet = false;
$phone = false;
if ( $this->browser == 'chrome' || $this->isChrome() )
{
// We aren't differentiating between Chrome and webview. It doesn't matter for our purposes.
if ( stripos(... | [
"private",
"function",
"isChromeMobile",
"(",
")",
"{",
"$",
"is",
"=",
"false",
";",
"$",
"android",
"=",
"false",
";",
"$",
"ios",
"=",
"false",
";",
"$",
"tablet",
"=",
"false",
";",
"$",
"phone",
"=",
"false",
";",
"if",
"(",
"$",
"this",
"->... | Determines if the browser is Chrome on a mobile device by the user agent string.
@return bool | [
"Determines",
"if",
"the",
"browser",
"is",
"Chrome",
"on",
"a",
"mobile",
"device",
"by",
"the",
"user",
"agent",
"string",
"."
] | d3c66f934bcaa8e5e0424cf684c995b1c80cee29 | https://github.com/jonesiscoding/device/blob/d3c66f934bcaa8e5e0424cf684c995b1c80cee29/src/DetectByUserAgent.php#L587-L625 |
196,236 | jonesiscoding/device | src/DetectByUserAgent.php | DetectByUserAgent.isSafariMobile | private function isSafariMobile()
{
$is = false;
$tablet = false;
$phone = false;
if ( $this->browser == 'safari' || $this->isSafari() )
{
// We aren't differentiating between Safari and Apps. It doesn't matter for our purposes.
// We also don't care if it's an iPod or iPhone, it's the... | php | private function isSafariMobile()
{
$is = false;
$tablet = false;
$phone = false;
if ( $this->browser == 'safari' || $this->isSafari() )
{
// We aren't differentiating between Safari and Apps. It doesn't matter for our purposes.
// We also don't care if it's an iPod or iPhone, it's the... | [
"private",
"function",
"isSafariMobile",
"(",
")",
"{",
"$",
"is",
"=",
"false",
";",
"$",
"tablet",
"=",
"false",
";",
"$",
"phone",
"=",
"false",
";",
"if",
"(",
"$",
"this",
"->",
"browser",
"==",
"'safari'",
"||",
"$",
"this",
"->",
"isSafari",
... | Determines if the browser is Safari Mobile by the User Agent String.
@return bool | [
"Determines",
"if",
"the",
"browser",
"is",
"Safari",
"Mobile",
"by",
"the",
"User",
"Agent",
"String",
"."
] | d3c66f934bcaa8e5e0424cf684c995b1c80cee29 | https://github.com/jonesiscoding/device/blob/d3c66f934bcaa8e5e0424cf684c995b1c80cee29/src/DetectByUserAgent.php#L632-L660 |
196,237 | jonesiscoding/device | src/DetectByUserAgent.php | DetectByUserAgent.isFirefoxMobile | private function isFirefoxMobile()
{
$is = false;
$tablet = false;
$phone = false;
$android = false;
$touch = true;
if ( $this->browser == 'firefox' || $this->isFirefox() )
{
if ( preg_match( "/(Mobile|Tablet|TV)/", $this->ua, $matches ) )
{
$is = true;
$tablet ... | php | private function isFirefoxMobile()
{
$is = false;
$tablet = false;
$phone = false;
$android = false;
$touch = true;
if ( $this->browser == 'firefox' || $this->isFirefox() )
{
if ( preg_match( "/(Mobile|Tablet|TV)/", $this->ua, $matches ) )
{
$is = true;
$tablet ... | [
"private",
"function",
"isFirefoxMobile",
"(",
")",
"{",
"$",
"is",
"=",
"false",
";",
"$",
"tablet",
"=",
"false",
";",
"$",
"phone",
"=",
"false",
";",
"$",
"android",
"=",
"false",
";",
"$",
"touch",
"=",
"true",
";",
"if",
"(",
"$",
"this",
"... | Determines if the browser is Firefox Mobile, by the User Agent string.
@return bool | [
"Determines",
"if",
"the",
"browser",
"is",
"Firefox",
"Mobile",
"by",
"the",
"User",
"Agent",
"string",
"."
] | d3c66f934bcaa8e5e0424cf684c995b1c80cee29 | https://github.com/jonesiscoding/device/blob/d3c66f934bcaa8e5e0424cf684c995b1c80cee29/src/DetectByUserAgent.php#L667-L717 |
196,238 | pdyn/filesystem | fileuploader/UploadedFile.php | UploadedFile.save | public function save($savepath) {
$result = move_uploaded_file($this->stored_filename, $savepath);
if ($result === true) {
$this->stored_filename = $savepath;
return true;
} else {
return false;
}
} | php | public function save($savepath) {
$result = move_uploaded_file($this->stored_filename, $savepath);
if ($result === true) {
$this->stored_filename = $savepath;
return true;
} else {
return false;
}
} | [
"public",
"function",
"save",
"(",
"$",
"savepath",
")",
"{",
"$",
"result",
"=",
"move_uploaded_file",
"(",
"$",
"this",
"->",
"stored_filename",
",",
"$",
"savepath",
")",
";",
"if",
"(",
"$",
"result",
"===",
"true",
")",
"{",
"$",
"this",
"->",
"... | Save the uploaded file to a specific path.
@param string $savepath A full path (incl. filename) to save the uploaded file as.
@return bool Success/Failure. | [
"Save",
"the",
"uploaded",
"file",
"to",
"a",
"specific",
"path",
"."
] | e2f780eac166aa60071e601d600133b860ace594 | https://github.com/pdyn/filesystem/blob/e2f780eac166aa60071e601d600133b860ace594/fileuploader/UploadedFile.php#L84-L92 |
196,239 | t3v/t3v_core | Classes/ViewHelpers/SlugViewHelper.php | SlugViewHelper.createSlug | protected static function createSlug(string $input, array $rulesets = self::SLUG_RULESETS, string $separator = '-'): string {
$slugify = new Slugify(['rulesets' => $rulesets, 'separator' => $separator]);
$slug = $slugify->slugify($input);
return $slug;
} | php | protected static function createSlug(string $input, array $rulesets = self::SLUG_RULESETS, string $separator = '-'): string {
$slugify = new Slugify(['rulesets' => $rulesets, 'separator' => $separator]);
$slug = $slugify->slugify($input);
return $slug;
} | [
"protected",
"static",
"function",
"createSlug",
"(",
"string",
"$",
"input",
",",
"array",
"$",
"rulesets",
"=",
"self",
"::",
"SLUG_RULESETS",
",",
"string",
"$",
"separator",
"=",
"'-'",
")",
":",
"string",
"{",
"$",
"slugify",
"=",
"new",
"Slugify",
... | Creates a slug from an input.
@param string $input The input to create a slug from
@param array $rulesets The optional rulesets, defaults to `SlugViewHelper::SLUG_RULESETS`
@param string $separator The optional separator, defaults to `-`
@return string The slug | [
"Creates",
"a",
"slug",
"from",
"an",
"input",
"."
] | 8c04b7688cc2773f11fcc87fda3f7cd53d80a980 | https://github.com/t3v/t3v_core/blob/8c04b7688cc2773f11fcc87fda3f7cd53d80a980/Classes/ViewHelpers/SlugViewHelper.php#L87-L92 |
196,240 | as3io/As3ModlrBundle | DependencyInjection/ServiceLoader/Rest.php | Rest.createJsonApiAdapter | private function createJsonApiAdapter($configName, ContainerBuilder $container)
{
// Serializer
$serializerName = Utility::getAliasedName('api.serializer');
$definition = new Definition(
Utility::getLibraryClass('Api\JsonApiOrg\Serializer')
);
$definition->setPubl... | php | private function createJsonApiAdapter($configName, ContainerBuilder $container)
{
// Serializer
$serializerName = Utility::getAliasedName('api.serializer');
$definition = new Definition(
Utility::getLibraryClass('Api\JsonApiOrg\Serializer')
);
$definition->setPubl... | [
"private",
"function",
"createJsonApiAdapter",
"(",
"$",
"configName",
",",
"ContainerBuilder",
"$",
"container",
")",
"{",
"// Serializer",
"$",
"serializerName",
"=",
"Utility",
"::",
"getAliasedName",
"(",
"'api.serializer'",
")",
";",
"$",
"definition",
"=",
"... | Creates the jsonapi.org Adapter service definition.
@param string $configName
@param ContainerBuilder $container
@return Definition | [
"Creates",
"the",
"jsonapi",
".",
"org",
"Adapter",
"service",
"definition",
"."
] | 7ce2abb7390c7eaf4081c5b7e00b96e7001774a4 | https://github.com/as3io/As3ModlrBundle/blob/7ce2abb7390c7eaf4081c5b7e00b96e7001774a4/DependencyInjection/ServiceLoader/Rest.php#L24-L54 |
196,241 | as3io/As3ModlrBundle | DependencyInjection/ServiceLoader/Rest.php | Rest.loadAdapter | private function loadAdapter($adapterName, $configName, array $adapterConfig, ContainerBuilder $container)
{
if (isset($adapterConfig['service'])) {
// Custom adapter service.
$container->setAlias($adapterName, Utility::cleanServiceName($adapterConfig['service']));
return... | php | private function loadAdapter($adapterName, $configName, array $adapterConfig, ContainerBuilder $container)
{
if (isset($adapterConfig['service'])) {
// Custom adapter service.
$container->setAlias($adapterName, Utility::cleanServiceName($adapterConfig['service']));
return... | [
"private",
"function",
"loadAdapter",
"(",
"$",
"adapterName",
",",
"$",
"configName",
",",
"array",
"$",
"adapterConfig",
",",
"ContainerBuilder",
"$",
"container",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"adapterConfig",
"[",
"'service'",
"]",
")",
")",
... | Loads the Adapter service based on the adapter config.
@param string $adapterName
@param string $configName
@param array $adapterConfig
@param ContainerBuilder $container
@return self | [
"Loads",
"the",
"Adapter",
"service",
"based",
"on",
"the",
"adapter",
"config",
"."
] | 7ce2abb7390c7eaf4081c5b7e00b96e7001774a4 | https://github.com/as3io/As3ModlrBundle/blob/7ce2abb7390c7eaf4081c5b7e00b96e7001774a4/DependencyInjection/ServiceLoader/Rest.php#L79-L98 |
196,242 | as3io/As3ModlrBundle | DependencyInjection/ServiceLoader/Rest.php | Rest.loadConfiguration | private function loadConfiguration($name, array $restConfig, ContainerBuilder $container)
{
$definition = new Definition(
Utility::getLibraryClass('Rest\RestConfiguration'),
[
new Reference(Utility::getAliasedName('util.validator')),
]
);
$... | php | private function loadConfiguration($name, array $restConfig, ContainerBuilder $container)
{
$definition = new Definition(
Utility::getLibraryClass('Rest\RestConfiguration'),
[
new Reference(Utility::getAliasedName('util.validator')),
]
);
$... | [
"private",
"function",
"loadConfiguration",
"(",
"$",
"name",
",",
"array",
"$",
"restConfig",
",",
"ContainerBuilder",
"$",
"container",
")",
"{",
"$",
"definition",
"=",
"new",
"Definition",
"(",
"Utility",
"::",
"getLibraryClass",
"(",
"'Rest\\RestConfiguration... | Loads the Rest config service based on the config.
@param string $name
@param array $restConfig
@param ContainerBuilder $container
@return self | [
"Loads",
"the",
"Rest",
"config",
"service",
"based",
"on",
"the",
"config",
"."
] | 7ce2abb7390c7eaf4081c5b7e00b96e7001774a4 | https://github.com/as3io/As3ModlrBundle/blob/7ce2abb7390c7eaf4081c5b7e00b96e7001774a4/DependencyInjection/ServiceLoader/Rest.php#L108-L124 |
196,243 | as3io/As3ModlrBundle | DependencyInjection/ServiceLoader/Rest.php | Rest.loadKernel | private function loadKernel($adapterName, $configName, $debug, ContainerBuilder $container)
{
$definition = new Definition(
Utility::getLibraryClass('Rest\RestKernel'),
[
new Reference($adapterName),
new Reference($configName),
]
);... | php | private function loadKernel($adapterName, $configName, $debug, ContainerBuilder $container)
{
$definition = new Definition(
Utility::getLibraryClass('Rest\RestKernel'),
[
new Reference($adapterName),
new Reference($configName),
]
);... | [
"private",
"function",
"loadKernel",
"(",
"$",
"adapterName",
",",
"$",
"configName",
",",
"$",
"debug",
",",
"ContainerBuilder",
"$",
"container",
")",
"{",
"$",
"definition",
"=",
"new",
"Definition",
"(",
"Utility",
"::",
"getLibraryClass",
"(",
"'Rest\\Res... | Loads the Rest Kernel service based on the config.
@param string $adapterName
@param string $configName
@param bool $debug
@param ContainerBuilder $container
@return self | [
"Loads",
"the",
"Rest",
"Kernel",
"service",
"based",
"on",
"the",
"config",
"."
] | 7ce2abb7390c7eaf4081c5b7e00b96e7001774a4 | https://github.com/as3io/As3ModlrBundle/blob/7ce2abb7390c7eaf4081c5b7e00b96e7001774a4/DependencyInjection/ServiceLoader/Rest.php#L135-L146 |
196,244 | cloudtek/dynamodm | lib/Cloudtek/DynamoDM/UnitOfWork.php | UnitOfWork.doRefresh | private function doRefresh($document, array &$visited)
{
$oid = spl_object_hash($document);
if (isset($visited[$oid])) {
return; // Prevent infinite recursion
}
$visited[$oid] = $document; // mark visited
$class = $this->dm->getClassMetadata(get_class($document)... | php | private function doRefresh($document, array &$visited)
{
$oid = spl_object_hash($document);
if (isset($visited[$oid])) {
return; // Prevent infinite recursion
}
$visited[$oid] = $document; // mark visited
$class = $this->dm->getClassMetadata(get_class($document)... | [
"private",
"function",
"doRefresh",
"(",
"$",
"document",
",",
"array",
"&",
"$",
"visited",
")",
"{",
"$",
"oid",
"=",
"spl_object_hash",
"(",
"$",
"document",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"visited",
"[",
"$",
"oid",
"]",
")",
")",
"{",... | Executes a refresh operation on a document.
@param object $document The document to refresh.
@param array $visited The already visited documents during cascades.
@return void
@throws \InvalidArgumentException If the document is not MANAGED. | [
"Executes",
"a",
"refresh",
"operation",
"on",
"a",
"document",
"."
] | 119d355e2c5cbaef1f867970349b4432f5704fcd | https://github.com/cloudtek/dynamodm/blob/119d355e2c5cbaef1f867970349b4432f5704fcd/lib/Cloudtek/DynamoDM/UnitOfWork.php#L1439-L1460 |
196,245 | cloudtek/dynamodm | lib/Cloudtek/DynamoDM/UnitOfWork.php | UnitOfWork.getAssociationPersister | public function getAssociationPersister()
{
if (!isset($this->associationPersister)) {
$this->associationPersister = new Persister\AssociationPersister(
$this->dm,
$this
);
}
return $this->associationPersister;
} | php | public function getAssociationPersister()
{
if (!isset($this->associationPersister)) {
$this->associationPersister = new Persister\AssociationPersister(
$this->dm,
$this
);
}
return $this->associationPersister;
} | [
"public",
"function",
"getAssociationPersister",
"(",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"associationPersister",
")",
")",
"{",
"$",
"this",
"->",
"associationPersister",
"=",
"new",
"Persister",
"\\",
"AssociationPersister",
"(",
"$",
... | Get the association persister instance.
@return Persister\AssociationPersister | [
"Get",
"the",
"association",
"persister",
"instance",
"."
] | 119d355e2c5cbaef1f867970349b4432f5704fcd | https://github.com/cloudtek/dynamodm/blob/119d355e2c5cbaef1f867970349b4432f5704fcd/lib/Cloudtek/DynamoDM/UnitOfWork.php#L1687-L1697 |
196,246 | cloudtek/dynamodm | lib/Cloudtek/DynamoDM/UnitOfWork.php | UnitOfWork.getDocumentIdentifier | public function getDocumentIdentifier($document)
{
return isset($this->documentIdentifiers[spl_object_hash($document)]) ?
$this->documentIdentifiers[spl_object_hash($document)] : null;
} | php | public function getDocumentIdentifier($document)
{
return isset($this->documentIdentifiers[spl_object_hash($document)]) ?
$this->documentIdentifiers[spl_object_hash($document)] : null;
} | [
"public",
"function",
"getDocumentIdentifier",
"(",
"$",
"document",
")",
"{",
"return",
"isset",
"(",
"$",
"this",
"->",
"documentIdentifiers",
"[",
"spl_object_hash",
"(",
"$",
"document",
")",
"]",
")",
"?",
"$",
"this",
"->",
"documentIdentifiers",
"[",
... | Gets the identifier of a document.
@param object $document
@return Identifier|null The identifier instance for the document | [
"Gets",
"the",
"identifier",
"of",
"a",
"document",
"."
] | 119d355e2c5cbaef1f867970349b4432f5704fcd | https://github.com/cloudtek/dynamodm/blob/119d355e2c5cbaef1f867970349b4432f5704fcd/lib/Cloudtek/DynamoDM/UnitOfWork.php#L1839-L1843 |
196,247 | cloudtek/dynamodm | lib/Cloudtek/DynamoDM/UnitOfWork.php | UnitOfWork.size | public function size()
{
$count = 0;
foreach ($this->identityMap as $documentSet) {
$count += count($documentSet);
}
return $count;
} | php | public function size()
{
$count = 0;
foreach ($this->identityMap as $documentSet) {
$count += count($documentSet);
}
return $count;
} | [
"public",
"function",
"size",
"(",
")",
"{",
"$",
"count",
"=",
"0",
";",
"foreach",
"(",
"$",
"this",
"->",
"identityMap",
"as",
"$",
"documentSet",
")",
"{",
"$",
"count",
"+=",
"count",
"(",
"$",
"documentSet",
")",
";",
"}",
"return",
"$",
"cou... | Calculates the size of the UnitOfWork. The size of the UnitOfWork is the
number of documents in the identity map.
@return int | [
"Calculates",
"the",
"size",
"of",
"the",
"UnitOfWork",
".",
"The",
"size",
"of",
"the",
"UnitOfWork",
"is",
"the",
"number",
"of",
"documents",
"in",
"the",
"identity",
"map",
"."
] | 119d355e2c5cbaef1f867970349b4432f5704fcd | https://github.com/cloudtek/dynamodm/blob/119d355e2c5cbaef1f867970349b4432f5704fcd/lib/Cloudtek/DynamoDM/UnitOfWork.php#L3023-L3031 |
196,248 | RocketPropelledTortoise/Core | src/Taxonomy/Repositories/TermHierarchyRepository.php | TermHierarchyRepository.supportsCommonTableExpressionQuery | protected function supportsCommonTableExpressionQuery()
{
$driver = DB::connection()->getDriverName();
if ($driver == 'mysql') {
return true;
}
if ($driver == 'sqlite' && \SQLite3::version()['versionNumber'] >= 3008003) {
return true;
}
retu... | php | protected function supportsCommonTableExpressionQuery()
{
$driver = DB::connection()->getDriverName();
if ($driver == 'mysql') {
return true;
}
if ($driver == 'sqlite' && \SQLite3::version()['versionNumber'] >= 3008003) {
return true;
}
retu... | [
"protected",
"function",
"supportsCommonTableExpressionQuery",
"(",
")",
"{",
"$",
"driver",
"=",
"DB",
"::",
"connection",
"(",
")",
"->",
"getDriverName",
"(",
")",
";",
"if",
"(",
"$",
"driver",
"==",
"'mysql'",
")",
"{",
"return",
"true",
";",
"}",
"... | Tests if the driver supports Common Table Expression.
If it doesn't we'll fall back to a manually recursive query.
@return bool | [
"Tests",
"if",
"the",
"driver",
"supports",
"Common",
"Table",
"Expression",
"."
] | 78b65663fc463e21e494257140ddbed0a9ccb3c3 | https://github.com/RocketPropelledTortoise/Core/blob/78b65663fc463e21e494257140ddbed0a9ccb3c3/src/Taxonomy/Repositories/TermHierarchyRepository.php#L72-L85 |
196,249 | RocketPropelledTortoise/Core | src/Taxonomy/Repositories/TermHierarchyRepository.php | TermHierarchyRepository.getDescent | public function getDescent($id)
{
$key = $this->getCacheKey('descent', $id);
if ($results = $this->cache->get($key)) {
return $results;
}
$this->cache->add($key, $results = $this->getRecursiveRetriever()->getDescent($id), 2);
return $results;
} | php | public function getDescent($id)
{
$key = $this->getCacheKey('descent', $id);
if ($results = $this->cache->get($key)) {
return $results;
}
$this->cache->add($key, $results = $this->getRecursiveRetriever()->getDescent($id), 2);
return $results;
} | [
"public",
"function",
"getDescent",
"(",
"$",
"id",
")",
"{",
"$",
"key",
"=",
"$",
"this",
"->",
"getCacheKey",
"(",
"'descent'",
",",
"$",
"id",
")",
";",
"if",
"(",
"$",
"results",
"=",
"$",
"this",
"->",
"cache",
"->",
"get",
"(",
"$",
"key",... | Get all childs recursively.
@param int $id The term's id
@return \Illuminate\Support\Collection | [
"Get",
"all",
"childs",
"recursively",
"."
] | 78b65663fc463e21e494257140ddbed0a9ccb3c3 | https://github.com/RocketPropelledTortoise/Core/blob/78b65663fc463e21e494257140ddbed0a9ccb3c3/src/Taxonomy/Repositories/TermHierarchyRepository.php#L137-L147 |
196,250 | RocketPropelledTortoise/Core | src/Taxonomy/Repositories/TermHierarchyRepository.php | TermHierarchyRepository.prepareVertices | protected function prepareVertices($data)
{
$vertices = [];
foreach ($data as $content) {
// identifiers must be strings or SplObjectStorage::contains fails
// seems to impact only PHP 5.6
$content->term_id = "$content->term_id";
$content->parent_id = ... | php | protected function prepareVertices($data)
{
$vertices = [];
foreach ($data as $content) {
// identifiers must be strings or SplObjectStorage::contains fails
// seems to impact only PHP 5.6
$content->term_id = "$content->term_id";
$content->parent_id = ... | [
"protected",
"function",
"prepareVertices",
"(",
"$",
"data",
")",
"{",
"$",
"vertices",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"data",
"as",
"$",
"content",
")",
"{",
"// identifiers must be strings or SplObjectStorage::contains fails",
"// seems to impact only PHP... | Prepare the vertices to create the graph.
@param \Illuminate\Support\Collection $data The list of vertices that were retrieved
@return array<Vertex> | [
"Prepare",
"the",
"vertices",
"to",
"create",
"the",
"graph",
"."
] | 78b65663fc463e21e494257140ddbed0a9ccb3c3 | https://github.com/RocketPropelledTortoise/Core/blob/78b65663fc463e21e494257140ddbed0a9ccb3c3/src/Taxonomy/Repositories/TermHierarchyRepository.php#L155-L174 |
196,251 | RocketPropelledTortoise/Core | src/Taxonomy/Repositories/TermHierarchyRepository.php | TermHierarchyRepository.getAncestryGraph | public function getAncestryGraph($id)
{
$data = $this->getAncestry($id);
if (count($data) == 0) {
return [null, null];
}
// Create Vertices
$this->vertices = $this->prepareVertices($data);
// Create Graph
$graph = new DirectedGraph();
fo... | php | public function getAncestryGraph($id)
{
$data = $this->getAncestry($id);
if (count($data) == 0) {
return [null, null];
}
// Create Vertices
$this->vertices = $this->prepareVertices($data);
// Create Graph
$graph = new DirectedGraph();
fo... | [
"public",
"function",
"getAncestryGraph",
"(",
"$",
"id",
")",
"{",
"$",
"data",
"=",
"$",
"this",
"->",
"getAncestry",
"(",
"$",
"id",
")",
";",
"if",
"(",
"count",
"(",
"$",
"data",
")",
"==",
"0",
")",
"{",
"return",
"[",
"null",
",",
"null",
... | Get all parents recursively
@param int $id The term we want the ancestry from.
@return array Vertex, DirectedGraph | [
"Get",
"all",
"parents",
"recursively"
] | 78b65663fc463e21e494257140ddbed0a9ccb3c3 | https://github.com/RocketPropelledTortoise/Core/blob/78b65663fc463e21e494257140ddbed0a9ccb3c3/src/Taxonomy/Repositories/TermHierarchyRepository.php#L182-L205 |
196,252 | sil-project/Contact | Model/Address.php | Address.setCity | public function setCity(City $city): void
{
$this->city = $city->getName();
$this->postCode = $city->getPostCode();
} | php | public function setCity(City $city): void
{
$this->city = $city->getName();
$this->postCode = $city->getPostCode();
} | [
"public",
"function",
"setCity",
"(",
"City",
"$",
"city",
")",
":",
"void",
"{",
"$",
"this",
"->",
"city",
"=",
"$",
"city",
"->",
"getName",
"(",
")",
";",
"$",
"this",
"->",
"postCode",
"=",
"$",
"city",
"->",
"getPostCode",
"(",
")",
";",
"}... | Set the value of post code and city through a City instance.
@param City $city | [
"Set",
"the",
"value",
"of",
"post",
"code",
"and",
"city",
"through",
"a",
"City",
"instance",
"."
] | ead863b5dc4ee7a6a2e3f0f181d1a0874b4969b9 | https://github.com/sil-project/Contact/blob/ead863b5dc4ee7a6a2e3f0f181d1a0874b4969b9/Model/Address.php#L134-L138 |
196,253 | mwyatt/core | src/AbstractMapper.php | AbstractMapper.getIterator | public function getIterator($models = [], $requestedClassPath = '')
{
$possiblePath = '';
if ($requestedClassPath) {
$possiblePath = $this->iteratorFactory->getDefaultNamespaceAbs($requestedClassPath);
if (!class_exists($possiblePath)) {
throw new \Exception("... | php | public function getIterator($models = [], $requestedClassPath = '')
{
$possiblePath = '';
if ($requestedClassPath) {
$possiblePath = $this->iteratorFactory->getDefaultNamespaceAbs($requestedClassPath);
if (!class_exists($possiblePath)) {
throw new \Exception("... | [
"public",
"function",
"getIterator",
"(",
"$",
"models",
"=",
"[",
"]",
",",
"$",
"requestedClassPath",
"=",
"''",
")",
"{",
"$",
"possiblePath",
"=",
"''",
";",
"if",
"(",
"$",
"requestedClassPath",
")",
"{",
"$",
"possiblePath",
"=",
"$",
"this",
"->... | get the iterator specific to this class or a custom one if required | [
"get",
"the",
"iterator",
"specific",
"to",
"this",
"class",
"or",
"a",
"custom",
"one",
"if",
"required"
] | 8ea9d67cc84fe6aff17a469c703d5492dbcd93ed | https://github.com/mwyatt/core/blob/8ea9d67cc84fe6aff17a469c703d5492dbcd93ed/src/AbstractMapper.php#L99-L120 |
196,254 | mwyatt/core | src/AbstractMapper.php | AbstractMapper.getInsertGenericSql | public function getInsertGenericSql(array $cols)
{
$sql = ['insert into', "`{$this->getTableNameLazy()}`", '('];
$sqlCols = [];
foreach ($cols as $col) {
$sqlCols[] = "`$col`";
}
$sql[] = implode(', ', $sqlCols);
$sql[] = ') values (';
$sqlCols = [... | php | public function getInsertGenericSql(array $cols)
{
$sql = ['insert into', "`{$this->getTableNameLazy()}`", '('];
$sqlCols = [];
foreach ($cols as $col) {
$sqlCols[] = "`$col`";
}
$sql[] = implode(', ', $sqlCols);
$sql[] = ') values (';
$sqlCols = [... | [
"public",
"function",
"getInsertGenericSql",
"(",
"array",
"$",
"cols",
")",
"{",
"$",
"sql",
"=",
"[",
"'insert into'",
",",
"\"`{$this->getTableNameLazy()}`\"",
",",
"'('",
"]",
";",
"$",
"sqlCols",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"cols",
"as",
... | builds insert statement using cols provided
@param array $cols 'name', 'another'
@return string built insert sql | [
"builds",
"insert",
"statement",
"using",
"cols",
"provided"
] | 8ea9d67cc84fe6aff17a469c703d5492dbcd93ed | https://github.com/mwyatt/core/blob/8ea9d67cc84fe6aff17a469c703d5492dbcd93ed/src/AbstractMapper.php#L167-L183 |
196,255 | mwyatt/core | src/AbstractMapper.php | AbstractMapper.getUpdateGenericSql | public function getUpdateGenericSql(array $cols)
{
$sql = ['update', "`{$this->getTableNameLazy()}`", 'set'];
$sqlCols = [];
foreach ($cols as $col) {
$sqlCols[] = "`$col` = :$col";
}
$sql[] = implode(', ', $sqlCols);
$sql[] = "where `id` = :id";
r... | php | public function getUpdateGenericSql(array $cols)
{
$sql = ['update', "`{$this->getTableNameLazy()}`", 'set'];
$sqlCols = [];
foreach ($cols as $col) {
$sqlCols[] = "`$col` = :$col";
}
$sql[] = implode(', ', $sqlCols);
$sql[] = "where `id` = :id";
r... | [
"public",
"function",
"getUpdateGenericSql",
"(",
"array",
"$",
"cols",
")",
"{",
"$",
"sql",
"=",
"[",
"'update'",
",",
"\"`{$this->getTableNameLazy()}`\"",
",",
"'set'",
"]",
";",
"$",
"sqlCols",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"cols",
"as",
"... | builds update statement using cols provided
@param array $cols 'name', 'another'
@return string built update sql | [
"builds",
"update",
"statement",
"using",
"cols",
"provided"
] | 8ea9d67cc84fe6aff17a469c703d5492dbcd93ed | https://github.com/mwyatt/core/blob/8ea9d67cc84fe6aff17a469c703d5492dbcd93ed/src/AbstractMapper.php#L191-L201 |
196,256 | ColonelBlimp/NsanjaIndexing | src/Nsanja/Core/Indexing/IndexAbstract.php | IndexAbstract.scanDirectory | protected function scanDirectory(string $path, string $parentDir): array
{
$files = [];
$rdi = new \RecursiveDirectoryIterator(
$path,
\FilesystemIterator::SKIP_DOTS |
\FilesystemIterator::KEY_AS_FILENAME |
\FilesystemIterator::CURRENT_AS_FILEINFO
... | php | protected function scanDirectory(string $path, string $parentDir): array
{
$files = [];
$rdi = new \RecursiveDirectoryIterator(
$path,
\FilesystemIterator::SKIP_DOTS |
\FilesystemIterator::KEY_AS_FILENAME |
\FilesystemIterator::CURRENT_AS_FILEINFO
... | [
"protected",
"function",
"scanDirectory",
"(",
"string",
"$",
"path",
",",
"string",
"$",
"parentDir",
")",
":",
"array",
"{",
"$",
"files",
"=",
"[",
"]",
";",
"$",
"rdi",
"=",
"new",
"\\",
"RecursiveDirectoryIterator",
"(",
"$",
"path",
",",
"\\",
"F... | Scans the given directory and its sub-directories returning a list of all the relative path to each
file from the given marker.
@param string $path
@param string $rootMarker
@return array | [
"Scans",
"the",
"given",
"directory",
"and",
"its",
"sub",
"-",
"directories",
"returning",
"a",
"list",
"of",
"all",
"the",
"relative",
"path",
"to",
"each",
"file",
"from",
"the",
"given",
"marker",
"."
] | aba860c702732954f41661b1da297b8b7a9c8073 | https://github.com/ColonelBlimp/NsanjaIndexing/blob/aba860c702732954f41661b1da297b8b7a9c8073/src/Nsanja/Core/Indexing/IndexAbstract.php#L124-L146 |
196,257 | ColonelBlimp/NsanjaIndexing | src/Nsanja/Core/Indexing/IndexAbstract.php | IndexAbstract.loadIndexFile | private function loadIndexFile(string $indexFilepath): array
{
$this->status = IndexInterface::STATUS_LOADED;
return \unserialize(\file_get_contents($indexFilepath));
} | php | private function loadIndexFile(string $indexFilepath): array
{
$this->status = IndexInterface::STATUS_LOADED;
return \unserialize(\file_get_contents($indexFilepath));
} | [
"private",
"function",
"loadIndexFile",
"(",
"string",
"$",
"indexFilepath",
")",
":",
"array",
"{",
"$",
"this",
"->",
"status",
"=",
"IndexInterface",
"::",
"STATUS_LOADED",
";",
"return",
"\\",
"unserialize",
"(",
"\\",
"file_get_contents",
"(",
"$",
"index... | Reads the file and unserializes it.
@param string $indexFilepath
@return array | [
"Reads",
"the",
"file",
"and",
"unserializes",
"it",
"."
] | aba860c702732954f41661b1da297b8b7a9c8073 | https://github.com/ColonelBlimp/NsanjaIndexing/blob/aba860c702732954f41661b1da297b8b7a9c8073/src/Nsanja/Core/Indexing/IndexAbstract.php#L153-L157 |
196,258 | SahilDude89ss/PyntaxFramework | src/Pyntax/Html/HtmlFactory.php | HtmlFactory.createTable | public function createTable(BeanInterface $bean, $findCondition = "") {
if($this->_table_factory instanceof TableFactoryInterface) {
return $this->_table_factory->generateTable($bean, $findCondition, true);
}
return false;
} | php | public function createTable(BeanInterface $bean, $findCondition = "") {
if($this->_table_factory instanceof TableFactoryInterface) {
return $this->_table_factory->generateTable($bean, $findCondition, true);
}
return false;
} | [
"public",
"function",
"createTable",
"(",
"BeanInterface",
"$",
"bean",
",",
"$",
"findCondition",
"=",
"\"\"",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_table_factory",
"instanceof",
"TableFactoryInterface",
")",
"{",
"return",
"$",
"this",
"->",
"_table_fact... | This function generates the Table based on the Bean and the search condition that is passed.
@param BeanInterface $bean
@param string $findCondition
@return bool|string | [
"This",
"function",
"generates",
"the",
"Table",
"based",
"on",
"the",
"Bean",
"and",
"the",
"search",
"condition",
"that",
"is",
"passed",
"."
] | 045cca87d24eb2b6405734966c64344e00224c7b | https://github.com/SahilDude89ss/PyntaxFramework/blob/045cca87d24eb2b6405734966c64344e00224c7b/src/Pyntax/Html/HtmlFactory.php#L55-L61 |
196,259 | Weissheiten/Weissheiten.Neos.NodeMigration | Classes/Weissheiten/Neos/NodeMigration/Migration/Filters/HasParentOfNodeType.php | HasParentOfNodeType.matches | public function matches(\Neos\ContentRepository\Domain\Model\NodeData $node)
{
$nodeIsMatchingNodeType = false;
for($i=0; $i<$this->searchDepth;$i++){
$parentNode = $node->getParent();
if($parentNode!==null){
// This will break atm for NodeTypes that no long... | php | public function matches(\Neos\ContentRepository\Domain\Model\NodeData $node)
{
$nodeIsMatchingNodeType = false;
for($i=0; $i<$this->searchDepth;$i++){
$parentNode = $node->getParent();
if($parentNode!==null){
// This will break atm for NodeTypes that no long... | [
"public",
"function",
"matches",
"(",
"\\",
"Neos",
"\\",
"ContentRepository",
"\\",
"Domain",
"\\",
"Model",
"\\",
"NodeData",
"$",
"node",
")",
"{",
"$",
"nodeIsMatchingNodeType",
"=",
"false",
";",
"for",
"(",
"$",
"i",
"=",
"0",
";",
"$",
"i",
"<",... | Returns TRUE if the given node has a parent of a specific nodetype
@param \Neos\ContentRepository\Domain\Model\NodeData $node
@return boolean | [
"Returns",
"TRUE",
"if",
"the",
"given",
"node",
"has",
"a",
"parent",
"of",
"a",
"specific",
"nodetype"
] | 6da82f1e3a8da85e9914f054756664010014cc66 | https://github.com/Weissheiten/Weissheiten.Neos.NodeMigration/blob/6da82f1e3a8da85e9914f054756664010014cc66/Classes/Weissheiten/Neos/NodeMigration/Migration/Filters/HasParentOfNodeType.php#L82-L110 |
196,260 | wb-crowdfusion/crowdfusion | system/core/classes/mvc/filters/AbstractFilterer.php | AbstractFilterer.handleFilter | public function handleFilter($filtererName, $method, $params, $locals, $globals)
{
$this->allowTemplateCode = false;
$this->locals = $locals;
$this->globals = $globals;
$this->params = $params;
//empty string given for method, use default method
if(strlen($method)... | php | public function handleFilter($filtererName, $method, $params, $locals, $globals)
{
$this->allowTemplateCode = false;
$this->locals = $locals;
$this->globals = $globals;
$this->params = $params;
//empty string given for method, use default method
if(strlen($method)... | [
"public",
"function",
"handleFilter",
"(",
"$",
"filtererName",
",",
"$",
"method",
",",
"$",
"params",
",",
"$",
"locals",
",",
"$",
"globals",
")",
"{",
"$",
"this",
"->",
"allowTemplateCode",
"=",
"false",
";",
"$",
"this",
"->",
"locals",
"=",
"$",... | This function is used to handle the call to the filterer method.
It fires preHandle, the specified filterer method, then postHandle.
It's this function that makes it required for all filterer classes to be a child
of this class (unless they implement their own version of course.)
@param string $filtererName Name of t... | [
"This",
"function",
"is",
"used",
"to",
"handle",
"the",
"call",
"to",
"the",
"filterer",
"method",
".",
"It",
"fires",
"preHandle",
"the",
"specified",
"filterer",
"method",
"then",
"postHandle",
"."
] | 8cad7988f046a6fefbed07d026cb4ae6706c1217 | https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/mvc/filters/AbstractFilterer.php#L206-L235 |
196,261 | brightnucleus/options-store | src/OptionRepository/WordPressOptionRepository.php | WordPressOptionRepository.readOption | protected function readOption(string $key, $fallback = null)
{
$value = get_option($this->prefix . $key, $fallback ?? false);
if (false === $value) {
return $fallback;
}
return $value;
} | php | protected function readOption(string $key, $fallback = null)
{
$value = get_option($this->prefix . $key, $fallback ?? false);
if (false === $value) {
return $fallback;
}
return $value;
} | [
"protected",
"function",
"readOption",
"(",
"string",
"$",
"key",
",",
"$",
"fallback",
"=",
"null",
")",
"{",
"$",
"value",
"=",
"get_option",
"(",
"$",
"this",
"->",
"prefix",
".",
"$",
"key",
",",
"$",
"fallback",
"??",
"false",
")",
";",
"if",
... | Read a single option from the persistence mechanism.
@since 0.1.0
@param string $key Key of the option to read.
@param mixed $fallback Optional. Fallback value to use if the option was not found.
@return mixed Value that was read. | [
"Read",
"a",
"single",
"option",
"from",
"the",
"persistence",
"mechanism",
"."
] | 9a9ef2a160bbacd69fe3e9db0be8ed89e6905ef1 | https://github.com/brightnucleus/options-store/blob/9a9ef2a160bbacd69fe3e9db0be8ed89e6905ef1/src/OptionRepository/WordPressOptionRepository.php#L62-L70 |
196,262 | TeknooSoftware/east-foundation | src/symfony/EndPoint/EastEndPointTrait.php | EastEndPointTrait.redirect | public function redirect(ClientInterface $client, string $url, int $status = 302): EndPointInterface
{
$client->acceptResponse(new Response\RedirectResponse($url, $status));
return $this;
} | php | public function redirect(ClientInterface $client, string $url, int $status = 302): EndPointInterface
{
$client->acceptResponse(new Response\RedirectResponse($url, $status));
return $this;
} | [
"public",
"function",
"redirect",
"(",
"ClientInterface",
"$",
"client",
",",
"string",
"$",
"url",
",",
"int",
"$",
"status",
"=",
"302",
")",
":",
"EndPointInterface",
"{",
"$",
"client",
"->",
"acceptResponse",
"(",
"new",
"Response",
"\\",
"RedirectRespo... | Returns a RedirectResponse to the given URL.
@param ClientInterface $client
@param string $url The URL to redirect to
@param int $status The status code to use for the Response
@return EndPointInterface | [
"Returns",
"a",
"RedirectResponse",
"to",
"the",
"given",
"URL",
"."
] | 45ca97c83ba08b973877a472c731f27ca1e82cdf | https://github.com/TeknooSoftware/east-foundation/blob/45ca97c83ba08b973877a472c731f27ca1e82cdf/src/symfony/EndPoint/EastEndPointTrait.php#L141-L146 |
196,263 | pazuzu156/Gravatar | src/Pazuzu156/Gravatar/Avatar.php | Avatar.img | public function img($email = '', $alt = '', array $attr = [])
{
if (empty($email)) {
$email = $this->_options['email'];
}
$img = '<img src="'.$this->src($email, $attr).'"';
if (!empty($alt)) {
$img .= ' alt="'.$alt.'"';
}
if (isset($attr['wi... | php | public function img($email = '', $alt = '', array $attr = [])
{
if (empty($email)) {
$email = $this->_options['email'];
}
$img = '<img src="'.$this->src($email, $attr).'"';
if (!empty($alt)) {
$img .= ' alt="'.$alt.'"';
}
if (isset($attr['wi... | [
"public",
"function",
"img",
"(",
"$",
"email",
"=",
"''",
",",
"$",
"alt",
"=",
"''",
",",
"array",
"$",
"attr",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"email",
")",
")",
"{",
"$",
"email",
"=",
"$",
"this",
"->",
"_options",... | Generates and returns the HTML image.
@param string $email - The email to use
@param string $alt - The alternative text for the image tag
@param array $attr - Extra attributes to set for the image request
@return string | [
"Generates",
"and",
"returns",
"the",
"HTML",
"image",
"."
] | 7ec5c03f8ada81ec15034c671f2750456c89b6d5 | https://github.com/pazuzu156/Gravatar/blob/7ec5c03f8ada81ec15034c671f2750456c89b6d5/src/Pazuzu156/Gravatar/Avatar.php#L128-L149 |
196,264 | thomasez/BisonLabSakonninBundle | Controller/MessageController.php | MessageController.showAction | public function showAction(Request $request, $access, $id)
{
$em = $this->getDoctrineManager();
// Hack. The contextGetAction in CommonBundle is not as smart as it
// looks.
$message = null;
if ($id instanceof Message) {
$message = $id;
} elseif (is_numeri... | php | public function showAction(Request $request, $access, $id)
{
$em = $this->getDoctrineManager();
// Hack. The contextGetAction in CommonBundle is not as smart as it
// looks.
$message = null;
if ($id instanceof Message) {
$message = $id;
} elseif (is_numeri... | [
"public",
"function",
"showAction",
"(",
"Request",
"$",
"request",
",",
"$",
"access",
",",
"$",
"id",
")",
"{",
"$",
"em",
"=",
"$",
"this",
"->",
"getDoctrineManager",
"(",
")",
";",
"// Hack. The contextGetAction in CommonBundle is not as smart as it",
"// loo... | Finds and displays a Message entity.
@Route("/{id}", name="message_show", methods={"GET"}) | [
"Finds",
"and",
"displays",
"a",
"Message",
"entity",
"."
] | 45ca7ce9874c4a2be7b503d7067b3d11d2b518cb | https://github.com/thomasez/BisonLabSakonninBundle/blob/45ca7ce9874c4a2be7b503d7067b3d11d2b518cb/Controller/MessageController.php#L135-L169 |
196,265 | thomasez/BisonLabSakonninBundle | Controller/MessageController.php | MessageController.searchContextGetAction | public function searchContextGetAction(Request $request, $access, $system, $object_name, $external_id)
{
// Search/Index - basically same same. For now at least.
/* But it has a very annoying drawback;
* It more or less does not work.
* The reason is simple: I have to be able to fi... | php | public function searchContextGetAction(Request $request, $access, $system, $object_name, $external_id)
{
// Search/Index - basically same same. For now at least.
/* But it has a very annoying drawback;
* It more or less does not work.
* The reason is simple: I have to be able to fi... | [
"public",
"function",
"searchContextGetAction",
"(",
"Request",
"$",
"request",
",",
"$",
"access",
",",
"$",
"system",
",",
"$",
"object_name",
",",
"$",
"external_id",
")",
"{",
"// Search/Index - basically same same. For now at least.",
"/* But it has a very annoying d... | Lists all Messages with that context.
@Route("/search_context/system/{system}/object_name/{object_name}/external_id/{external_id}", name="message_context_search", methods={"GET"}) | [
"Lists",
"all",
"Messages",
"with",
"that",
"context",
"."
] | 45ca7ce9874c4a2be7b503d7067b3d11d2b518cb | https://github.com/thomasez/BisonLabSakonninBundle/blob/45ca7ce9874c4a2be7b503d7067b3d11d2b518cb/Controller/MessageController.php#L241-L274 |
196,266 | thomasez/BisonLabSakonninBundle | Controller/MessageController.php | MessageController.deleteAction | public function deleteAction(Request $request, $access, Message $message)
{
$this->denyAccessUnlessGranted('edit', $message);
$form = $this->createDeleteForm($message);
$form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) {
$em = $this->getDoctri... | php | public function deleteAction(Request $request, $access, Message $message)
{
$this->denyAccessUnlessGranted('edit', $message);
$form = $this->createDeleteForm($message);
$form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) {
$em = $this->getDoctri... | [
"public",
"function",
"deleteAction",
"(",
"Request",
"$",
"request",
",",
"$",
"access",
",",
"Message",
"$",
"message",
")",
"{",
"$",
"this",
"->",
"denyAccessUnlessGranted",
"(",
"'edit'",
",",
"$",
"message",
")",
";",
"$",
"form",
"=",
"$",
"this",... | Deletes a message entity.
@Route("/{id}", name="message_delete", methods={"DELETE"}) | [
"Deletes",
"a",
"message",
"entity",
"."
] | 45ca7ce9874c4a2be7b503d7067b3d11d2b518cb | https://github.com/thomasez/BisonLabSakonninBundle/blob/45ca7ce9874c4a2be7b503d7067b3d11d2b518cb/Controller/MessageController.php#L416-L432 |
196,267 | thomasez/BisonLabSakonninBundle | Controller/MessageController.php | MessageController.checkUnreadAction | public function checkUnreadAction(Request $request, $access)
{
$em = $this->getDoctrineManager();
$sm = $this->container->get('sakonnin.messages');
$user = $this->getUser();
$repo = $em->getRepository('BisonLabSakonninBundle:Message');
$messages = $sm->getMessagesForLoggedIn... | php | public function checkUnreadAction(Request $request, $access)
{
$em = $this->getDoctrineManager();
$sm = $this->container->get('sakonnin.messages');
$user = $this->getUser();
$repo = $em->getRepository('BisonLabSakonninBundle:Message');
$messages = $sm->getMessagesForLoggedIn... | [
"public",
"function",
"checkUnreadAction",
"(",
"Request",
"$",
"request",
",",
"$",
"access",
")",
"{",
"$",
"em",
"=",
"$",
"this",
"->",
"getDoctrineManager",
"(",
")",
";",
"$",
"sm",
"=",
"$",
"this",
"->",
"container",
"->",
"get",
"(",
"'sakonni... | Check for unread messages
@Route("/check_unread/", name="check_unread", methods={"GET"}) | [
"Check",
"for",
"unread",
"messages"
] | 45ca7ce9874c4a2be7b503d7067b3d11d2b518cb | https://github.com/thomasez/BisonLabSakonninBundle/blob/45ca7ce9874c4a2be7b503d7067b3d11d2b518cb/Controller/MessageController.php#L439-L452 |
196,268 | thomasez/BisonLabSakonninBundle | Controller/MessageController.php | MessageController.newAction | public function newAction(Request $request, $access)
{
$message = new Message();
if ($message_type = $request->get('message_type')) {
$em = $this->getDoctrineManager();
$message->setMessageType(
$em->getRepository('BisonLabSakonninBundle:MessageType')
... | php | public function newAction(Request $request, $access)
{
$message = new Message();
if ($message_type = $request->get('message_type')) {
$em = $this->getDoctrineManager();
$message->setMessageType(
$em->getRepository('BisonLabSakonninBundle:MessageType')
... | [
"public",
"function",
"newAction",
"(",
"Request",
"$",
"request",
",",
"$",
"access",
")",
"{",
"$",
"message",
"=",
"new",
"Message",
"(",
")",
";",
"if",
"(",
"$",
"message_type",
"=",
"$",
"request",
"->",
"get",
"(",
"'message_type'",
")",
")",
... | Creates a new person entity.
@Route("/new/", name="message_new", methods={"GET", "POST"}) | [
"Creates",
"a",
"new",
"person",
"entity",
"."
] | 45ca7ce9874c4a2be7b503d7067b3d11d2b518cb | https://github.com/thomasez/BisonLabSakonninBundle/blob/45ca7ce9874c4a2be7b503d7067b3d11d2b518cb/Controller/MessageController.php#L459-L486 |
196,269 | thomasez/BisonLabSakonninBundle | Controller/MessageController.php | MessageController.createDeleteForm | public function createDeleteForm(Message $message, $access = "ajax")
{
$form_name = "message_delete_" . $message->getId();
return $this->get('form.factory')->createNamedBuilder($form_name,FormType::class)
->setAction($this->generateUrl('message_delete', array(
'id' => $me... | php | public function createDeleteForm(Message $message, $access = "ajax")
{
$form_name = "message_delete_" . $message->getId();
return $this->get('form.factory')->createNamedBuilder($form_name,FormType::class)
->setAction($this->generateUrl('message_delete', array(
'id' => $me... | [
"public",
"function",
"createDeleteForm",
"(",
"Message",
"$",
"message",
",",
"$",
"access",
"=",
"\"ajax\"",
")",
"{",
"$",
"form_name",
"=",
"\"message_delete_\"",
".",
"$",
"message",
"->",
"getId",
"(",
")",
";",
"return",
"$",
"this",
"->",
"get",
... | Creates a form to delete a message entity.
@param Message $message The message entity
@return \Symfony\Component\Form\Form The form | [
"Creates",
"a",
"form",
"to",
"delete",
"a",
"message",
"entity",
"."
] | 45ca7ce9874c4a2be7b503d7067b3d11d2b518cb | https://github.com/thomasez/BisonLabSakonninBundle/blob/45ca7ce9874c4a2be7b503d7067b3d11d2b518cb/Controller/MessageController.php#L529-L539 |
196,270 | joegreen88/zf1-component-validate | src/Zend/Validate/Barcode/Royalmail.php | Zend_Validate_Barcode_Royalmail.checkChars | public function checkChars($value)
{
if ($value[0] == '(') {
$value = substr($value, 1);
if ($value[strlen($value) - 1] == ')') {
$value = substr($value, 0, -1);
} else {
return false;
}
}
return parent::checkC... | php | public function checkChars($value)
{
if ($value[0] == '(') {
$value = substr($value, 1);
if ($value[strlen($value) - 1] == ')') {
$value = substr($value, 0, -1);
} else {
return false;
}
}
return parent::checkC... | [
"public",
"function",
"checkChars",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"value",
"[",
"0",
"]",
"==",
"'('",
")",
"{",
"$",
"value",
"=",
"substr",
"(",
"$",
"value",
",",
"1",
")",
";",
"if",
"(",
"$",
"value",
"[",
"strlen",
"(",
"... | Allows start and stop tag within checked chars
@param string $value The barcode to check for allowed characters
@return boolean | [
"Allows",
"start",
"and",
"stop",
"tag",
"within",
"checked",
"chars"
] | 88d9ea016f73d48ff0ba7d06ecbbf28951fd279e | https://github.com/joegreen88/zf1-component-validate/blob/88d9ea016f73d48ff0ba7d06ecbbf28951fd279e/src/Zend/Validate/Barcode/Royalmail.php#L107-L120 |
196,271 | phossa/phossa-di | src/Phossa/Di/Extension/ExtensibleTrait.php | ExtensibleTrait.getExtension | public function getExtension(
/*# string */ $extensionName
)/*# : ExtensionAbstract */ {
if (!$this->hasExtension($extensionName)) {
$this->addExtension(new $extensionName);
}
return $this->extensions[$extensionName];
} | php | public function getExtension(
/*# string */ $extensionName
)/*# : ExtensionAbstract */ {
if (!$this->hasExtension($extensionName)) {
$this->addExtension(new $extensionName);
}
return $this->extensions[$extensionName];
} | [
"public",
"function",
"getExtension",
"(",
"/*# string */",
"$",
"extensionName",
")",
"/*# : ExtensionAbstract */",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"hasExtension",
"(",
"$",
"extensionName",
")",
")",
"{",
"$",
"this",
"->",
"addExtension",
"(",
"new"... | Get the named extension, create one if not injected yet
@param string $extensionName
@return ExtensionAbstract
@access public
@internal | [
"Get",
"the",
"named",
"extension",
"create",
"one",
"if",
"not",
"injected",
"yet"
] | bbe1e95b081068e2bc49c6cd465f38aab0374be5 | https://github.com/phossa/phossa-di/blob/bbe1e95b081068e2bc49c6cd465f38aab0374be5/src/Phossa/Di/Extension/ExtensibleTrait.php#L131-L138 |
196,272 | phossa/phossa-di | src/Phossa/Di/Extension/ExtensibleTrait.php | ExtensibleTrait.decorateService | protected function decorateService($service)
{
$extName = DecorateExtension::EXTENSION_CLASS;
// decorate extension loaded
if ($this->hasExtension($extName)) {
/* @var $ext DecorateExtension */
$ext = $this->getExtension($extName);
$ext->decorateService($... | php | protected function decorateService($service)
{
$extName = DecorateExtension::EXTENSION_CLASS;
// decorate extension loaded
if ($this->hasExtension($extName)) {
/* @var $ext DecorateExtension */
$ext = $this->getExtension($extName);
$ext->decorateService($... | [
"protected",
"function",
"decorateService",
"(",
"$",
"service",
")",
"{",
"$",
"extName",
"=",
"DecorateExtension",
"::",
"EXTENSION_CLASS",
";",
"// decorate extension loaded",
"if",
"(",
"$",
"this",
"->",
"hasExtension",
"(",
"$",
"extName",
")",
")",
"{",
... | Decorate the service object if DecorateExtension loaded
@param object $service
@return self
@throws LogicException if something goes wrong
@access protected | [
"Decorate",
"the",
"service",
"object",
"if",
"DecorateExtension",
"loaded"
] | bbe1e95b081068e2bc49c6cd465f38aab0374be5 | https://github.com/phossa/phossa-di/blob/bbe1e95b081068e2bc49c6cd465f38aab0374be5/src/Phossa/Di/Extension/ExtensibleTrait.php#L182-L194 |
196,273 | stellaqua/Waltz.Stagehand | src/Waltz/Stagehand/ClassUtility.php | ClassUtility.splitClassName | public static function splitClassName ( $className )
{
$chunk = explode('\\', $className);
$className = array_pop($chunk);
$namespace = implode('\\', $chunk);
$result = array($namespace, $className);
return $result;
} | php | public static function splitClassName ( $className )
{
$chunk = explode('\\', $className);
$className = array_pop($chunk);
$namespace = implode('\\', $chunk);
$result = array($namespace, $className);
return $result;
} | [
"public",
"static",
"function",
"splitClassName",
"(",
"$",
"className",
")",
"{",
"$",
"chunk",
"=",
"explode",
"(",
"'\\\\'",
",",
"$",
"className",
")",
";",
"$",
"className",
"=",
"array_pop",
"(",
"$",
"chunk",
")",
";",
"$",
"namespace",
"=",
"im... | Split class name
@param string $className Class name with namespace
@return string Namespace | [
"Split",
"class",
"name"
] | 01df286751f5b9a5c90c47138dca3709e5bc383b | https://github.com/stellaqua/Waltz.Stagehand/blob/01df286751f5b9a5c90c47138dca3709e5bc383b/src/Waltz/Stagehand/ClassUtility.php#L25-L32 |
196,274 | shgysk8zer0/core_api | traits/pdo.php | PDO.showTables | final public function showTables()
{
$q = $this->query('SHOW TABLES');
$q->execute();
return $q->fetchAll(self::FETCH_COLUMN);
} | php | final public function showTables()
{
$q = $this->query('SHOW TABLES');
$q->execute();
return $q->fetchAll(self::FETCH_COLUMN);
} | [
"final",
"public",
"function",
"showTables",
"(",
")",
"{",
"$",
"q",
"=",
"$",
"this",
"->",
"query",
"(",
"'SHOW TABLES'",
")",
";",
"$",
"q",
"->",
"execute",
"(",
")",
";",
"return",
"$",
"q",
"->",
"fetchAll",
"(",
"self",
"::",
"FETCH_COLUMN",
... | Returns an array of available database tables
@param void
@return array | [
"Returns",
"an",
"array",
"of",
"available",
"database",
"tables"
] | 9e9b8baf761af874b95256ad2462e55fbb2b2e58 | https://github.com/shgysk8zer0/core_api/blob/9e9b8baf761af874b95256ad2462e55fbb2b2e58/traits/pdo.php#L55-L60 |
196,275 | shgysk8zer0/core_api | traits/pdo.php | PDO.describe | final public function describe($table)
{
$q = $this->query("DESCRIBE `{$table}`");
$q->execute();
return $q->fetchAll(self::FETCH_COLUMN);
} | php | final public function describe($table)
{
$q = $this->query("DESCRIBE `{$table}`");
$q->execute();
return $q->fetchAll(self::FETCH_COLUMN);
} | [
"final",
"public",
"function",
"describe",
"(",
"$",
"table",
")",
"{",
"$",
"q",
"=",
"$",
"this",
"->",
"query",
"(",
"\"DESCRIBE `{$table}`\"",
")",
";",
"$",
"q",
"->",
"execute",
"(",
")",
";",
"return",
"$",
"q",
"->",
"fetchAll",
"(",
"self",
... | Describe a table
@param string $table Name of table to describe
@return array [key => \stdClass] | [
"Describe",
"a",
"table"
] | 9e9b8baf761af874b95256ad2462e55fbb2b2e58 | https://github.com/shgysk8zer0/core_api/blob/9e9b8baf761af874b95256ad2462e55fbb2b2e58/traits/pdo.php#L68-L73 |
196,276 | hiqdev/hiam-mrdp | src/controllers/MrdpController.php | MrdpController.actionLogin | public function actionLogin(array $confirm_data, $goto)
{
$url = 'http://hiapi.ahnames.com/verifyConfirmation?' . http_build_query([
'auth_ip' => Yii::$app->request->getUserIp(),
'what' => 'redirect_hipanel',
'confirm_data' => $confirm_data,
]);
... | php | public function actionLogin(array $confirm_data, $goto)
{
$url = 'http://hiapi.ahnames.com/verifyConfirmation?' . http_build_query([
'auth_ip' => Yii::$app->request->getUserIp(),
'what' => 'redirect_hipanel',
'confirm_data' => $confirm_data,
]);
... | [
"public",
"function",
"actionLogin",
"(",
"array",
"$",
"confirm_data",
",",
"$",
"goto",
")",
"{",
"$",
"url",
"=",
"'http://hiapi.ahnames.com/verifyConfirmation?'",
".",
"http_build_query",
"(",
"[",
"'auth_ip'",
"=>",
"Yii",
"::",
"$",
"app",
"->",
"request",... | Implements login from MRDP panel.
@param $confirm_data confirmation data
@param $goto url to go to on success
@throws ForbiddenHttpException when login confirmation is broken | [
"Implements",
"login",
"from",
"MRDP",
"panel",
"."
] | 22227d86c80bd1d96370f88251e43d213ad73a3b | https://github.com/hiqdev/hiam-mrdp/blob/22227d86c80bd1d96370f88251e43d213ad73a3b/src/controllers/MrdpController.php#L29-L50 |
196,277 | AdamB7586/menu-builder | src/Builder/Breadcrumb.php | Breadcrumb.setBreadcrumbElement | public function setBreadcrumbElement($element) {
if(!empty(trim($element)) && is_string($element)) {
$this->breadcrumbElement = trim($element);
}
return $this;
} | php | public function setBreadcrumbElement($element) {
if(!empty(trim($element)) && is_string($element)) {
$this->breadcrumbElement = trim($element);
}
return $this;
} | [
"public",
"function",
"setBreadcrumbElement",
"(",
"$",
"element",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"trim",
"(",
"$",
"element",
")",
")",
"&&",
"is_string",
"(",
"$",
"element",
")",
")",
"{",
"$",
"this",
"->",
"breadcrumbElement",
"=",
"trim"... | Sets the main element to give to list style breadcrumb menus
@param string $element The main element you want to give to the breadcrumb
@return $this | [
"Sets",
"the",
"main",
"element",
"to",
"give",
"to",
"list",
"style",
"breadcrumb",
"menus"
] | dbc192bca7d59475068c19d1a07a039e5f997ee4 | https://github.com/AdamB7586/menu-builder/blob/dbc192bca7d59475068c19d1a07a039e5f997ee4/src/Builder/Breadcrumb.php#L63-L68 |
196,278 | AdamB7586/menu-builder | src/Builder/Breadcrumb.php | Breadcrumb.setBreacrumbLinks | public function setBreacrumbLinks($links) {
if(is_array($links) && !empty($links)) {
$this->links = $links;
}
return $this;
} | php | public function setBreacrumbLinks($links) {
if(is_array($links) && !empty($links)) {
$this->links = $links;
}
return $this;
} | [
"public",
"function",
"setBreacrumbLinks",
"(",
"$",
"links",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"links",
")",
"&&",
"!",
"empty",
"(",
"$",
"links",
")",
")",
"{",
"$",
"this",
"->",
"links",
"=",
"$",
"links",
";",
"}",
"return",
"$",
"... | Sets the link to include in the breadcrumb element
@param array $links This should be the breadcrumb links
@return $this | [
"Sets",
"the",
"link",
"to",
"include",
"in",
"the",
"breadcrumb",
"element"
] | dbc192bca7d59475068c19d1a07a039e5f997ee4 | https://github.com/AdamB7586/menu-builder/blob/dbc192bca7d59475068c19d1a07a039e5f997ee4/src/Builder/Breadcrumb.php#L86-L91 |
196,279 | tonis-io-legacy/doctrine-orm | src/EntityManagerFactory.php | EntityManagerFactory.createConfiguration | private static function createConfiguration(array $config, ContainerInterface $container = null)
{
$cache = $config['cache'];
if ($container && is_string($config['cache']) && $container->has($config['cache'])) {
$cache = $container->get($config['cache']);
}
return Setup... | php | private static function createConfiguration(array $config, ContainerInterface $container = null)
{
$cache = $config['cache'];
if ($container && is_string($config['cache']) && $container->has($config['cache'])) {
$cache = $container->get($config['cache']);
}
return Setup... | [
"private",
"static",
"function",
"createConfiguration",
"(",
"array",
"$",
"config",
",",
"ContainerInterface",
"$",
"container",
"=",
"null",
")",
"{",
"$",
"cache",
"=",
"$",
"config",
"[",
"'cache'",
"]",
";",
"if",
"(",
"$",
"container",
"&&",
"is_stri... | Creates the ORM configuration.
@param array $config
@param ContainerInterface $container
@return Configuration | [
"Creates",
"the",
"ORM",
"configuration",
"."
] | fed8de8a6304b8fdad88a425a16d6c2e6a9e27ed | https://github.com/tonis-io-legacy/doctrine-orm/blob/fed8de8a6304b8fdad88a425a16d6c2e6a9e27ed/src/EntityManagerFactory.php#L56-L65 |
196,280 | pdyn/base | Exception.php | Exception.get_string_from_code | public function get_string_from_code($code) {
$errors = [
self::ERR_GENERAL => 'General Error',
self::ERR_BAD_REQUEST => 'Bad Request',
self::ERR_UNAUTHORIZED => 'Unauthorized',
self::ERR_FORBIDDEN => 'Forbidden',
self::ERR_INTERNAL_ERROR => 'Internal Error',
self::ERR_PRECONDITION_FAILED => 'Precon... | php | public function get_string_from_code($code) {
$errors = [
self::ERR_GENERAL => 'General Error',
self::ERR_BAD_REQUEST => 'Bad Request',
self::ERR_UNAUTHORIZED => 'Unauthorized',
self::ERR_FORBIDDEN => 'Forbidden',
self::ERR_INTERNAL_ERROR => 'Internal Error',
self::ERR_PRECONDITION_FAILED => 'Precon... | [
"public",
"function",
"get_string_from_code",
"(",
"$",
"code",
")",
"{",
"$",
"errors",
"=",
"[",
"self",
"::",
"ERR_GENERAL",
"=>",
"'General Error'",
",",
"self",
"::",
"ERR_BAD_REQUEST",
"=>",
"'Bad Request'",
",",
"self",
"::",
"ERR_UNAUTHORIZED",
"=>",
"... | Translate an error code into a human-readable string explaining the problem.
@param int $code The error code.
@return string The human-readable description. | [
"Translate",
"an",
"error",
"code",
"into",
"a",
"human",
"-",
"readable",
"string",
"explaining",
"the",
"problem",
"."
] | 0b93961693954a6b4e1c6df7e345e5cdf07f26ff | https://github.com/pdyn/base/blob/0b93961693954a6b4e1c6df7e345e5cdf07f26ff/Exception.php#L68-L84 |
196,281 | eureka-framework/component-http | src/Http/Message/UploadedFile.php | UploadedFile.setClientFilename | private function setClientFilename($clientFilename)
{
if (preg_match('`[/\\]+`', $clientFilename) > 0) {
throw new \InvalidArgumentException('Filename contain invalid character "\" or "/" in his name.');
}
$this->clientFilename = (empty($clientFilename) ? null : (string) $client... | php | private function setClientFilename($clientFilename)
{
if (preg_match('`[/\\]+`', $clientFilename) > 0) {
throw new \InvalidArgumentException('Filename contain invalid character "\" or "/" in his name.');
}
$this->clientFilename = (empty($clientFilename) ? null : (string) $client... | [
"private",
"function",
"setClientFilename",
"(",
"$",
"clientFilename",
")",
"{",
"if",
"(",
"preg_match",
"(",
"'`[/\\\\]+`'",
",",
"$",
"clientFilename",
")",
">",
"0",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"'Filename contain invalid c... | Set client filename.
@param string $clientFilename
@return self
@throws \InvalidArgumentException | [
"Set",
"client",
"filename",
"."
] | 698c3b73581a9703a9c932890c57e50f8774607a | https://github.com/eureka-framework/component-http/blob/698c3b73581a9703a9c932890c57e50f8774607a/src/Http/Message/UploadedFile.php#L201-L210 |
196,282 | eureka-framework/component-http | src/Http/Message/UploadedFile.php | UploadedFile.setSize | private function setSize($size = null)
{
if ($size !== null) {
$size = (int) $size;
if ($size < 0) {
throw new \RuntimeException('File size cannot be a negative value ! (size: ' . $size . ')');
}
}
$this->size = $size;
return $th... | php | private function setSize($size = null)
{
if ($size !== null) {
$size = (int) $size;
if ($size < 0) {
throw new \RuntimeException('File size cannot be a negative value ! (size: ' . $size . ')');
}
}
$this->size = $size;
return $th... | [
"private",
"function",
"setSize",
"(",
"$",
"size",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"size",
"!==",
"null",
")",
"{",
"$",
"size",
"=",
"(",
"int",
")",
"$",
"size",
";",
"if",
"(",
"$",
"size",
"<",
"0",
")",
"{",
"throw",
"new",
"\\",... | Set file size
@param int $size
@return self | [
"Set",
"file",
"size"
] | 698c3b73581a9703a9c932890c57e50f8774607a | https://github.com/eureka-framework/component-http/blob/698c3b73581a9703a9c932890c57e50f8774607a/src/Http/Message/UploadedFile.php#L244-L257 |
196,283 | wb-crowdfusion/crowdfusion | system/core/classes/libraries/model/ModelObject.php | ModelObject.getDefault | public function getDefault($key)
{
$schema = $this->getModelSchema();
if (array_key_exists('default', $schema[$key]))
return $schema[$key]['default'];
return null;
} | php | public function getDefault($key)
{
$schema = $this->getModelSchema();
if (array_key_exists('default', $schema[$key]))
return $schema[$key]['default'];
return null;
} | [
"public",
"function",
"getDefault",
"(",
"$",
"key",
")",
"{",
"$",
"schema",
"=",
"$",
"this",
"->",
"getModelSchema",
"(",
")",
";",
"if",
"(",
"array_key_exists",
"(",
"'default'",
",",
"$",
"schema",
"[",
"$",
"key",
"]",
")",
")",
"return",
"$",... | Returns the default value of the field.
@param string $key The name of the field
@return mixed or null if there is no default value | [
"Returns",
"the",
"default",
"value",
"of",
"the",
"field",
"."
] | 8cad7988f046a6fefbed07d026cb4ae6706c1217 | https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/libraries/model/ModelObject.php#L146-L154 |
196,284 | wb-crowdfusion/crowdfusion | system/core/classes/libraries/model/ModelObject.php | ModelObject.getFieldTitle | public function getFieldTitle($key)
{
$schema = $this->getModelSchema();
if (array_key_exists('title', $schema[$key]))
return $schema[$key]['title'];
return $key;
} | php | public function getFieldTitle($key)
{
$schema = $this->getModelSchema();
if (array_key_exists('title', $schema[$key]))
return $schema[$key]['title'];
return $key;
} | [
"public",
"function",
"getFieldTitle",
"(",
"$",
"key",
")",
"{",
"$",
"schema",
"=",
"$",
"this",
"->",
"getModelSchema",
"(",
")",
";",
"if",
"(",
"array_key_exists",
"(",
"'title'",
",",
"$",
"schema",
"[",
"$",
"key",
"]",
")",
")",
"return",
"$"... | Returns the field title.
@param string $key The name of the field
@return string or the field name if there is no title | [
"Returns",
"the",
"field",
"title",
"."
] | 8cad7988f046a6fefbed07d026cb4ae6706c1217 | https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/libraries/model/ModelObject.php#L163-L171 |
196,285 | wb-crowdfusion/crowdfusion | system/core/classes/libraries/model/ModelObject.php | ModelObject.getValidation | public function getValidation($field = null)
{
$validation = array();
$schema = $this->getModelSchema();
if ($field != null)
$schema = array($field => $schema[$field]);
foreach ( $schema as $key => $value ) {
if (!isset($value['validation']))
... | php | public function getValidation($field = null)
{
$validation = array();
$schema = $this->getModelSchema();
if ($field != null)
$schema = array($field => $schema[$field]);
foreach ( $schema as $key => $value ) {
if (!isset($value['validation']))
... | [
"public",
"function",
"getValidation",
"(",
"$",
"field",
"=",
"null",
")",
"{",
"$",
"validation",
"=",
"array",
"(",
")",
";",
"$",
"schema",
"=",
"$",
"this",
"->",
"getModelSchema",
"(",
")",
";",
"if",
"(",
"$",
"field",
"!=",
"null",
")",
"$"... | Returns the model schema, which we'll use for validation
@param string $field The field name
@return array | [
"Returns",
"the",
"model",
"schema",
"which",
"we",
"ll",
"use",
"for",
"validation"
] | 8cad7988f046a6fefbed07d026cb4ae6706c1217 | https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/libraries/model/ModelObject.php#L180-L199 |
196,286 | goncalomb/asbestos | src/classes/Html/Element.php | Element.append | public function append()
{
$args = func_get_args();
foreach ($args as $arg) {
if ($arg instanceof Element) {
if ($arg->_used) {
continue;
}
$arg->_used = true;
}
$this->_html[] = $arg;
}
... | php | public function append()
{
$args = func_get_args();
foreach ($args as $arg) {
if ($arg instanceof Element) {
if ($arg->_used) {
continue;
}
$arg->_used = true;
}
$this->_html[] = $arg;
}
... | [
"public",
"function",
"append",
"(",
")",
"{",
"$",
"args",
"=",
"func_get_args",
"(",
")",
";",
"foreach",
"(",
"$",
"args",
"as",
"$",
"arg",
")",
"{",
"if",
"(",
"$",
"arg",
"instanceof",
"Element",
")",
"{",
"if",
"(",
"$",
"arg",
"->",
"_use... | Append content or other elements.
@param mixed Things to be appended. | [
"Append",
"content",
"or",
"other",
"elements",
"."
] | 14a875b6c125cfeefe4eb1c3c524500eb8a51d04 | https://github.com/goncalomb/asbestos/blob/14a875b6c125cfeefe4eb1c3c524500eb8a51d04/src/classes/Html/Element.php#L79-L91 |
196,287 | goncalomb/asbestos | src/classes/Html/Element.php | Element.outputOpeningTag | protected function outputOpeningTag()
{
echo '<', htmlspecialchars($this->_tag);
foreach ($this->_attributes as $name => $value) {
echo ' ', htmlspecialchars($name), '="', htmlspecialchars($value), '"';
}
echo '>';
if ($this->_tag == 'html' || $this->_tag == 'head... | php | protected function outputOpeningTag()
{
echo '<', htmlspecialchars($this->_tag);
foreach ($this->_attributes as $name => $value) {
echo ' ', htmlspecialchars($name), '="', htmlspecialchars($value), '"';
}
echo '>';
if ($this->_tag == 'html' || $this->_tag == 'head... | [
"protected",
"function",
"outputOpeningTag",
"(",
")",
"{",
"echo",
"'<'",
",",
"htmlspecialchars",
"(",
"$",
"this",
"->",
"_tag",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"_attributes",
"as",
"$",
"name",
"=>",
"$",
"value",
")",
"{",
"echo",
"' ... | Output opening HTML. | [
"Output",
"opening",
"HTML",
"."
] | 14a875b6c125cfeefe4eb1c3c524500eb8a51d04 | https://github.com/goncalomb/asbestos/blob/14a875b6c125cfeefe4eb1c3c524500eb8a51d04/src/classes/Html/Element.php#L104-L114 |
196,288 | goncalomb/asbestos | src/classes/Html/Element.php | Element.outputContent | protected function outputContent()
{
foreach ($this->_html as $part) {
if ($part instanceof Element) {
$part->output();
} else {
echo $part;
}
}
} | php | protected function outputContent()
{
foreach ($this->_html as $part) {
if ($part instanceof Element) {
$part->output();
} else {
echo $part;
}
}
} | [
"protected",
"function",
"outputContent",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"_html",
"as",
"$",
"part",
")",
"{",
"if",
"(",
"$",
"part",
"instanceof",
"Element",
")",
"{",
"$",
"part",
"->",
"output",
"(",
")",
";",
"}",
"else",
"{... | Output inner HTML. | [
"Output",
"inner",
"HTML",
"."
] | 14a875b6c125cfeefe4eb1c3c524500eb8a51d04 | https://github.com/goncalomb/asbestos/blob/14a875b6c125cfeefe4eb1c3c524500eb8a51d04/src/classes/Html/Element.php#L119-L128 |
196,289 | goncalomb/asbestos | src/classes/Html/Element.php | Element.outputClosingTag | protected function outputClosingTag()
{
echo '</', htmlspecialchars($this->_tag), '>';
if ($this->_tag == 'html' || $this->_tag == 'head' || $this->_tag == 'body') {
echo "\n";
}
} | php | protected function outputClosingTag()
{
echo '</', htmlspecialchars($this->_tag), '>';
if ($this->_tag == 'html' || $this->_tag == 'head' || $this->_tag == 'body') {
echo "\n";
}
} | [
"protected",
"function",
"outputClosingTag",
"(",
")",
"{",
"echo",
"'</'",
",",
"htmlspecialchars",
"(",
"$",
"this",
"->",
"_tag",
")",
",",
"'>'",
";",
"if",
"(",
"$",
"this",
"->",
"_tag",
"==",
"'html'",
"||",
"$",
"this",
"->",
"_tag",
"==",
"'... | Output closing HTML. | [
"Output",
"closing",
"HTML",
"."
] | 14a875b6c125cfeefe4eb1c3c524500eb8a51d04 | https://github.com/goncalomb/asbestos/blob/14a875b6c125cfeefe4eb1c3c524500eb8a51d04/src/classes/Html/Element.php#L133-L139 |
196,290 | shrink0r/php-schema | src/Property/ChoiceProperty.php | ChoiceProperty.validate | public function validate($value)
{
return in_array($value, $this->choices) ? Ok::unit() : Error::unit([ Error::INVALID_CHOICE ]);
} | php | public function validate($value)
{
return in_array($value, $this->choices) ? Ok::unit() : Error::unit([ Error::INVALID_CHOICE ]);
} | [
"public",
"function",
"validate",
"(",
"$",
"value",
")",
"{",
"return",
"in_array",
"(",
"$",
"value",
",",
"$",
"this",
"->",
"choices",
")",
"?",
"Ok",
"::",
"unit",
"(",
")",
":",
"Error",
"::",
"unit",
"(",
"[",
"Error",
"::",
"INVALID_CHOICE",
... | Tells if a given value is a valid choice according to the property's definition.
@param mixed $value
@return ResultInterface Returns Ok if the value is valid, otherwise an Error is returned. | [
"Tells",
"if",
"a",
"given",
"value",
"is",
"a",
"valid",
"choice",
"according",
"to",
"the",
"property",
"s",
"definition",
"."
] | 94293fe897af376dd9d05962e2c516079409dd29 | https://github.com/shrink0r/php-schema/blob/94293fe897af376dd9d05962e2c516079409dd29/src/Property/ChoiceProperty.php#L39-L42 |
196,291 | TodoMove/intercessor | src/TodoMove/Intercessor/Task.php | Task.tags | public function tags(Tags $tags = null)
{
if (is_null($tags)) {
return $this->tags;
}
$this->tags = $tags;
return $this;
} | php | public function tags(Tags $tags = null)
{
if (is_null($tags)) {
return $this->tags;
}
$this->tags = $tags;
return $this;
} | [
"public",
"function",
"tags",
"(",
"Tags",
"$",
"tags",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"tags",
")",
")",
"{",
"return",
"$",
"this",
"->",
"tags",
";",
"}",
"$",
"this",
"->",
"tags",
"=",
"$",
"tags",
";",
"return",
"$"... | This needs a tag collection.
@param Tags|null $tags - pass to set, don't pass to get
@return $this|Tags | [
"This",
"needs",
"a",
"tag",
"collection",
"."
] | 546f9cdaaeaa2db52f8ed33f4870db5526105e50 | https://github.com/TodoMove/intercessor/blob/546f9cdaaeaa2db52f8ed33f4870db5526105e50/src/TodoMove/Intercessor/Task.php#L163-L172 |
196,292 | ekyna/Resource | Persistence/PersistenceEventQueue.php | PersistenceEventQueue.getEventPriority | protected function getEventPriority($eventName)
{
$suffix = $this->getEventSuffix($eventName);
if ($suffix === static::UPDATE) {
return 9999;
} elseif ($suffix === static::INSERT) {
return 9998;
} elseif ($suffix === static::DELETE) {
return 9997;... | php | protected function getEventPriority($eventName)
{
$suffix = $this->getEventSuffix($eventName);
if ($suffix === static::UPDATE) {
return 9999;
} elseif ($suffix === static::INSERT) {
return 9998;
} elseif ($suffix === static::DELETE) {
return 9997;... | [
"protected",
"function",
"getEventPriority",
"(",
"$",
"eventName",
")",
"{",
"$",
"suffix",
"=",
"$",
"this",
"->",
"getEventSuffix",
"(",
"$",
"eventName",
")",
";",
"if",
"(",
"$",
"suffix",
"===",
"static",
"::",
"UPDATE",
")",
"{",
"return",
"9999",... | Returns the event priority.
@param string $eventName
@return int | [
"Returns",
"the",
"event",
"priority",
"."
] | 96ee3d28e02bd9513705408e3bb7f88a76e52f56 | https://github.com/ekyna/Resource/blob/96ee3d28e02bd9513705408e3bb7f88a76e52f56/Persistence/PersistenceEventQueue.php#L116-L129 |
196,293 | shadowfax/zf2-asset-manager | src/AssetManager/Asset/Resolver/MimeResolver.php | MimeResolver.getMimeType | public static function getMimeType($filename)
{
$mime_types = static::getMimeTypes();
$extension = pathinfo($filename, PATHINFO_EXTENSION);
$extension = strtolower($extension);
if (array_key_exists($extension, $mime_types)) {
return $mime_types[$extension];
} elseif (function_ex... | php | public static function getMimeType($filename)
{
$mime_types = static::getMimeTypes();
$extension = pathinfo($filename, PATHINFO_EXTENSION);
$extension = strtolower($extension);
if (array_key_exists($extension, $mime_types)) {
return $mime_types[$extension];
} elseif (function_ex... | [
"public",
"static",
"function",
"getMimeType",
"(",
"$",
"filename",
")",
"{",
"$",
"mime_types",
"=",
"static",
"::",
"getMimeTypes",
"(",
")",
";",
"$",
"extension",
"=",
"pathinfo",
"(",
"$",
"filename",
",",
"PATHINFO_EXTENSION",
")",
";",
"$",
"extens... | Get the mime-type of a file
@param string $filename The path to the file
@return string The mime type | [
"Get",
"the",
"mime",
"-",
"type",
"of",
"a",
"file"
] | adbdc40417c6fddbba1a8c8b675e59ce1a25ad65 | https://github.com/shadowfax/zf2-asset-manager/blob/adbdc40417c6fddbba1a8c8b675e59ce1a25ad65/src/AssetManager/Asset/Resolver/MimeResolver.php#L23-L39 |
196,294 | ekyna/Sale | Tax/TaxesAmounts.php | TaxesAmounts.addTaxAmount | public function addTaxAmount(TaxAmount $taxAmount)
{
$this->total += $taxAmount->getAmount();
foreach ($this->taxes as $tax) {
if ($tax->getTax() == $taxAmount->getTax()) {
$tax->addAmount($taxAmount->getAmount());
return;
}
}
... | php | public function addTaxAmount(TaxAmount $taxAmount)
{
$this->total += $taxAmount->getAmount();
foreach ($this->taxes as $tax) {
if ($tax->getTax() == $taxAmount->getTax()) {
$tax->addAmount($taxAmount->getAmount());
return;
}
}
... | [
"public",
"function",
"addTaxAmount",
"(",
"TaxAmount",
"$",
"taxAmount",
")",
"{",
"$",
"this",
"->",
"total",
"+=",
"$",
"taxAmount",
"->",
"getAmount",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"taxes",
"as",
"$",
"tax",
")",
"{",
"if",
"(... | Adds a tax amount
@param TaxAmount $taxAmount | [
"Adds",
"a",
"tax",
"amount"
] | 434093b658628e88b59a156e21239df0b1855e89 | https://github.com/ekyna/Sale/blob/434093b658628e88b59a156e21239df0b1855e89/Tax/TaxesAmounts.php#L36-L48 |
196,295 | koolkode/view-express | src/ExpressContext.php | ExpressContext.bind | public function bind(ViewModelInterface $model)
{
$this->scoped['@file'] = $model->getResource();
$this->scoped['@model'] = $this->model = $model;
$this->scoped['@context'] = $this;
$this->renderer->triggerContextBound($this);
} | php | public function bind(ViewModelInterface $model)
{
$this->scoped['@file'] = $model->getResource();
$this->scoped['@model'] = $this->model = $model;
$this->scoped['@context'] = $this;
$this->renderer->triggerContextBound($this);
} | [
"public",
"function",
"bind",
"(",
"ViewModelInterface",
"$",
"model",
")",
"{",
"$",
"this",
"->",
"scoped",
"[",
"'@file'",
"]",
"=",
"$",
"model",
"->",
"getResource",
"(",
")",
";",
"$",
"this",
"->",
"scoped",
"[",
"'@model'",
"]",
"=",
"$",
"th... | Bind this express context to the given view model triggering a context-bound event
in the process.
@param ViewModelInterface $model | [
"Bind",
"this",
"express",
"context",
"to",
"the",
"given",
"view",
"model",
"triggering",
"a",
"context",
"-",
"bound",
"event",
"in",
"the",
"process",
"."
] | a8ebe6f373b6bfe8b8818d6264535e8fe063a596 | https://github.com/koolkode/view-express/blob/a8ebe6f373b6bfe8b8818d6264535e8fe063a596/src/ExpressContext.php#L81-L88 |
196,296 | koolkode/view-express | src/ExpressContext.php | ExpressContext.get | public function get($key)
{
if(array_key_exists($key, $this->scoped))
{
return $this->scoped[$key];
}
return $this->model->get($key, NULL);
} | php | public function get($key)
{
if(array_key_exists($key, $this->scoped))
{
return $this->scoped[$key];
}
return $this->model->get($key, NULL);
} | [
"public",
"function",
"get",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"array_key_exists",
"(",
"$",
"key",
",",
"$",
"this",
"->",
"scoped",
")",
")",
"{",
"return",
"$",
"this",
"->",
"scoped",
"[",
"$",
"key",
"]",
";",
"}",
"return",
"$",
"this",... | Get the value of a scoped variable or fallback to the view model.
@param string $key The name of the variable to be accessed.
@return mixed The value of the requetsed variable. | [
"Get",
"the",
"value",
"of",
"a",
"scoped",
"variable",
"or",
"fallback",
"to",
"the",
"view",
"model",
"."
] | a8ebe6f373b6bfe8b8818d6264535e8fe063a596 | https://github.com/koolkode/view-express/blob/a8ebe6f373b6bfe8b8818d6264535e8fe063a596/src/ExpressContext.php#L133-L141 |
196,297 | koolkode/view-express | src/ExpressContext.php | ExpressContext.set | public function set($key, $value)
{
if(array_key_exists($key, $this->scoped))
{
$val = $this->scoped[$key];
if($value === NULL)
{
unset($this->scoped[$key]);
}
else
{
$this->scoped[$key] = $value;
}
return $val;
}
if($value !== NULL)
{
$this->scoped[$key] = $value;... | php | public function set($key, $value)
{
if(array_key_exists($key, $this->scoped))
{
$val = $this->scoped[$key];
if($value === NULL)
{
unset($this->scoped[$key]);
}
else
{
$this->scoped[$key] = $value;
}
return $val;
}
if($value !== NULL)
{
$this->scoped[$key] = $value;... | [
"public",
"function",
"set",
"(",
"$",
"key",
",",
"$",
"value",
")",
"{",
"if",
"(",
"array_key_exists",
"(",
"$",
"key",
",",
"$",
"this",
"->",
"scoped",
")",
")",
"{",
"$",
"val",
"=",
"$",
"this",
"->",
"scoped",
"[",
"$",
"key",
"]",
";",... | Set the given variable in the scope and return the previous value if present, setting a value
of NULL will remove the value from the context.
@param string $key The name of the scoped variable to be set.
@param mixed $value The new value of the scoped variable or NULL to unset the variable.
@return mixed The previous ... | [
"Set",
"the",
"given",
"variable",
"in",
"the",
"scope",
"and",
"return",
"the",
"previous",
"value",
"if",
"present",
"setting",
"a",
"value",
"of",
"NULL",
"will",
"remove",
"the",
"value",
"from",
"the",
"context",
"."
] | a8ebe6f373b6bfe8b8818d6264535e8fe063a596 | https://github.com/koolkode/view-express/blob/a8ebe6f373b6bfe8b8818d6264535e8fe063a596/src/ExpressContext.php#L151-L173 |
196,298 | kambalabs/KmbPuppetDb | src/KmbPuppetDb/Service/ReportStatistics.php | ReportStatistics.processStatistics | protected function processStatistics($query = null)
{
$this->skips = 0;
$this->success = 0;
$this->failures = 0;
$this->noops = 0;
$reports = $this->getReportService()->getAllForToday($query);
foreach ($reports as $report) {
/** @var Model\Report $report *... | php | protected function processStatistics($query = null)
{
$this->skips = 0;
$this->success = 0;
$this->failures = 0;
$this->noops = 0;
$reports = $this->getReportService()->getAllForToday($query);
foreach ($reports as $report) {
/** @var Model\Report $report *... | [
"protected",
"function",
"processStatistics",
"(",
"$",
"query",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"skips",
"=",
"0",
";",
"$",
"this",
"->",
"success",
"=",
"0",
";",
"$",
"this",
"->",
"failures",
"=",
"0",
";",
"$",
"this",
"->",
"noops"... | Browse all reports and process all the statistics
@param \KmbPuppetDb\Query\Query|array $query | [
"Browse",
"all",
"reports",
"and",
"process",
"all",
"the",
"statistics"
] | df56a275cf00f4402cf121a2e99149168f1f8b2d | https://github.com/kambalabs/KmbPuppetDb/blob/df56a275cf00f4402cf121a2e99149168f1f8b2d/src/KmbPuppetDb/Service/ReportStatistics.php#L154-L173 |
196,299 | DoSomething/mb-toolbox | src/MB_Toolbox_cURL.php | MB_Toolbox_cURL.curlGETauth | public function curlGETauth($curlUrl)
{
// Remove authentication until POST to /api/v1/auth/login is resolved
if (!isset($this->auth)) {
$this->authenticate();
}
$results = $this->curlGET($curlUrl, true);
$this->statHat->ezCount('MB_Toolbox: MB_Toolbox_cURL: curlGETauth', 1);
return $... | php | public function curlGETauth($curlUrl)
{
// Remove authentication until POST to /api/v1/auth/login is resolved
if (!isset($this->auth)) {
$this->authenticate();
}
$results = $this->curlGET($curlUrl, true);
$this->statHat->ezCount('MB_Toolbox: MB_Toolbox_cURL: curlGETauth', 1);
return $... | [
"public",
"function",
"curlGETauth",
"(",
"$",
"curlUrl",
")",
"{",
"// Remove authentication until POST to /api/v1/auth/login is resolved",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"auth",
")",
")",
"{",
"$",
"this",
"->",
"authenticate",
"(",
")",
";",... | cURL GET with authentication
@param string $curlUrl
The URL to GET to. Include domain and path.
@return object $result
The results returned from the cURL call. | [
"cURL",
"GET",
"with",
"authentication"
] | ceec5fc594bae137d1ab1f447344800343b62ac6 | https://github.com/DoSomething/mb-toolbox/blob/ceec5fc594bae137d1ab1f447344800343b62ac6/src/MB_Toolbox_cURL.php#L139-L151 |
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.