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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
11,900 | phapi/log | src/Phapi/Di/Validator/Log.php | Log.validate | public function validate($logger)
{
$original = $logger;
if (is_callable($logger)) {
$logger = $logger($this->container);
}
// Check if logger is an instance of the PSR-3 logger interface
if ($logger instanceof LoggerInterface) {
return $original;
... | php | public function validate($logger)
{
$original = $logger;
if (is_callable($logger)) {
$logger = $logger($this->container);
}
// Check if logger is an instance of the PSR-3 logger interface
if ($logger instanceof LoggerInterface) {
return $original;
... | [
"public",
"function",
"validate",
"(",
"$",
"logger",
")",
"{",
"$",
"original",
"=",
"$",
"logger",
";",
"if",
"(",
"is_callable",
"(",
"$",
"logger",
")",
")",
"{",
"$",
"logger",
"=",
"$",
"logger",
"(",
"$",
"this",
"->",
"container",
")",
";",... | Validates the configured logger. If no logger is configured or if the configured
logger isn't PSR-3 compliant an instance of NullLogger will be used instead.
The PSR-3 package includes a NullLogger that does not do anything with
the input but it also prevents the application from failing.
This simplifies the developm... | [
"Validates",
"the",
"configured",
"logger",
".",
"If",
"no",
"logger",
"is",
"configured",
"or",
"if",
"the",
"configured",
"logger",
"isn",
"t",
"PSR",
"-",
"3",
"compliant",
"an",
"instance",
"of",
"NullLogger",
"will",
"be",
"used",
"instead",
"."
] | acb289b47263470aaf6f271f721e4a690bd6eb23 | https://github.com/phapi/log/blob/acb289b47263470aaf6f271f721e4a690bd6eb23/src/Phapi/Di/Validator/Log.php#L48-L66 |
11,901 | phplegends/assets | src/Assets/Manager.php | Manager.buildVersion | protected function buildVersion($asset)
{
$version = $this->getVersion();
if (is_callable($version)) {
$version = $version($this->getBasePath() . $asset, $this);
}
return $version;
} | php | protected function buildVersion($asset)
{
$version = $this->getVersion();
if (is_callable($version)) {
$version = $version($this->getBasePath() . $asset, $this);
}
return $version;
} | [
"protected",
"function",
"buildVersion",
"(",
"$",
"asset",
")",
"{",
"$",
"version",
"=",
"$",
"this",
"->",
"getVersion",
"(",
")",
";",
"if",
"(",
"is_callable",
"(",
"$",
"version",
")",
")",
"{",
"$",
"version",
"=",
"$",
"version",
"(",
"$",
... | Build the version of the asset.
If callable is given, the arguments are full filename and this instance
@param string $asset
@return string|null | [
"Build",
"the",
"version",
"of",
"the",
"asset",
".",
"If",
"callable",
"is",
"given",
"the",
"arguments",
"are",
"full",
"filename",
"and",
"this",
"instance"
] | 0f36502b4728425388a6bbcafe00663c2371039d | https://github.com/phplegends/assets/blob/0f36502b4728425388a6bbcafe00663c2371039d/src/Assets/Manager.php#L357-L367 |
11,902 | phplegends/assets | src/Assets/Manager.php | Manager.buildCompileDirectory | protected function buildCompileDirectory()
{
$directory = $this->getBasePath() . '/' . $this->getCompileDirectory();
if (! is_dir($directory)) mkdir($directory, 0777, true);
return $directory;
} | php | protected function buildCompileDirectory()
{
$directory = $this->getBasePath() . '/' . $this->getCompileDirectory();
if (! is_dir($directory)) mkdir($directory, 0777, true);
return $directory;
} | [
"protected",
"function",
"buildCompileDirectory",
"(",
")",
"{",
"$",
"directory",
"=",
"$",
"this",
"->",
"getBasePath",
"(",
")",
".",
"'/'",
".",
"$",
"this",
"->",
"getCompileDirectory",
"(",
")",
";",
"if",
"(",
"!",
"is_dir",
"(",
"$",
"directory",... | Build the directory name of the compile. If directory not exists, it's created.
@return string | [
"Build",
"the",
"directory",
"name",
"of",
"the",
"compile",
".",
"If",
"directory",
"not",
"exists",
"it",
"s",
"created",
"."
] | 0f36502b4728425388a6bbcafe00663c2371039d | https://github.com/phplegends/assets/blob/0f36502b4728425388a6bbcafe00663c2371039d/src/Assets/Manager.php#L469-L476 |
11,903 | phplegends/assets | src/Assets/Manager.php | Manager.createFromConfig | public static function createFromConfig(array $config)
{
$manager = static::createEmptyFromConfig($config);
$manager->addCollection(new CssCollection)
->addCollection(new JavascriptCollection);
return $manager;
} | php | public static function createFromConfig(array $config)
{
$manager = static::createEmptyFromConfig($config);
$manager->addCollection(new CssCollection)
->addCollection(new JavascriptCollection);
return $manager;
} | [
"public",
"static",
"function",
"createFromConfig",
"(",
"array",
"$",
"config",
")",
"{",
"$",
"manager",
"=",
"static",
"::",
"createEmptyFromConfig",
"(",
"$",
"config",
")",
";",
"$",
"manager",
"->",
"addCollection",
"(",
"new",
"CssCollection",
")",
"-... | Creates and configure a manager instance via array options
@param array $config
@return \PHPLegends\Assets\Manager | [
"Creates",
"and",
"configure",
"a",
"manager",
"instance",
"via",
"array",
"options"
] | 0f36502b4728425388a6bbcafe00663c2371039d | https://github.com/phplegends/assets/blob/0f36502b4728425388a6bbcafe00663c2371039d/src/Assets/Manager.php#L527-L536 |
11,904 | phplegends/assets | src/Assets/Manager.php | Manager.createEmptyFromConfig | public static function createEmptyFromConfig(array $config)
{
$manager = new self();
if (isset($config['base_uri'])) {
$manager->setBaseUri($config['base_uri']);
}
if (isset($config['path'])) {
$manager->setBasePath($config['path']);
}
if ... | php | public static function createEmptyFromConfig(array $config)
{
$manager = new self();
if (isset($config['base_uri'])) {
$manager->setBaseUri($config['base_uri']);
}
if (isset($config['path'])) {
$manager->setBasePath($config['path']);
}
if ... | [
"public",
"static",
"function",
"createEmptyFromConfig",
"(",
"array",
"$",
"config",
")",
"{",
"$",
"manager",
"=",
"new",
"self",
"(",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"config",
"[",
"'base_uri'",
"]",
")",
")",
"{",
"$",
"manager",
"->",
"s... | Creates and configure a empty manager instance via array options
@param array $config
@return \PHPLegends\Assets\Manager | [
"Creates",
"and",
"configure",
"a",
"empty",
"manager",
"instance",
"via",
"array",
"options"
] | 0f36502b4728425388a6bbcafe00663c2371039d | https://github.com/phplegends/assets/blob/0f36502b4728425388a6bbcafe00663c2371039d/src/Assets/Manager.php#L543-L576 |
11,905 | phplegends/assets | src/Assets/Manager.php | Manager.url | public function url($asset)
{
$url = $this->parsePathAlias($asset, false);
return $this->buildUrl($url);
} | php | public function url($asset)
{
$url = $this->parsePathAlias($asset, false);
return $this->buildUrl($url);
} | [
"public",
"function",
"url",
"(",
"$",
"asset",
")",
"{",
"$",
"url",
"=",
"$",
"this",
"->",
"parsePathAlias",
"(",
"$",
"asset",
",",
"false",
")",
";",
"return",
"$",
"this",
"->",
"buildUrl",
"(",
"$",
"url",
")",
";",
"}"
] | Create an url to a any asset. Is a way to use images with this class
@param string $asset
@return string | [
"Create",
"an",
"url",
"to",
"a",
"any",
"asset",
".",
"Is",
"a",
"way",
"to",
"use",
"images",
"with",
"this",
"class"
] | 0f36502b4728425388a6bbcafe00663c2371039d | https://github.com/phplegends/assets/blob/0f36502b4728425388a6bbcafe00663c2371039d/src/Assets/Manager.php#L593-L598 |
11,906 | railsphp/framework | src/Rails/ActiveRecord/Persistence/PersistedModel/Methods/PersistenceMethodsTrait.php | PersistenceMethodsTrait.recover | public function recover()
{
if (!$this->isRecoverable()) {
throw new Exception\BadMethodCallException(
sprintf(
"Object of class %s isn't recoverable",
get_class($this)
)
);
}
if ($this->... | php | public function recover()
{
if (!$this->isRecoverable()) {
throw new Exception\BadMethodCallException(
sprintf(
"Object of class %s isn't recoverable",
get_class($this)
)
);
}
if ($this->... | [
"public",
"function",
"recover",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"isRecoverable",
"(",
")",
")",
"{",
"throw",
"new",
"Exception",
"\\",
"BadMethodCallException",
"(",
"sprintf",
"(",
"\"Object of class %s isn't recoverable\"",
",",
"get_class"... | Recovers a deleted object by setting the DELETED_AT_ATTRIBUTE to null.
If the object is not deleted, no action is taken.
If the object isn't recoverable, however, an exception is thrown.
`recover` callbacks are ran if the record is recovered. Note that the
attribute is directly updated in the database, so no `save` or ... | [
"Recovers",
"a",
"deleted",
"object",
"by",
"setting",
"the",
"DELETED_AT_ATTRIBUTE",
"to",
"null",
".",
"If",
"the",
"object",
"is",
"not",
"deleted",
"no",
"action",
"is",
"taken",
".",
"If",
"the",
"object",
"isn",
"t",
"recoverable",
"however",
"an",
"... | 2ac9d3e493035dcc68f3c3812423327127327cd5 | https://github.com/railsphp/framework/blob/2ac9d3e493035dcc68f3c3812423327127327cd5/src/Rails/ActiveRecord/Persistence/PersistedModel/Methods/PersistenceMethodsTrait.php#L208-L227 |
11,907 | railsphp/framework | src/Rails/ActiveRecord/Persistence/PersistedModel/Methods/PersistenceMethodsTrait.php | PersistenceMethodsTrait.deleteRecord | protected function deleteRecord(array $options = [])
{
$this->runCallbacks('delete', function() {
if (!$this->deletedAt()) {
$this->directUpdate(static::deletedAtAttribute(), static::deletedAtValue());
$this->reload();
}
});
return true... | php | protected function deleteRecord(array $options = [])
{
$this->runCallbacks('delete', function() {
if (!$this->deletedAt()) {
$this->directUpdate(static::deletedAtAttribute(), static::deletedAtValue());
$this->reload();
}
});
return true... | [
"protected",
"function",
"deleteRecord",
"(",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"this",
"->",
"runCallbacks",
"(",
"'delete'",
",",
"function",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"deletedAt",
"(",
")",
")",
"{",
... | Soft-deletes the record. If the record is already deleted, no action is taken.
The `delete` callbacks are ran if the record is deleted. Like in `recover`, the
attribute is directly updated in the database, so no `save` or `update`
callbacks are ran, and any change made to the model is discarted as it is
reloaded.
@ret... | [
"Soft",
"-",
"deletes",
"the",
"record",
".",
"If",
"the",
"record",
"is",
"already",
"deleted",
"no",
"action",
"is",
"taken",
".",
"The",
"delete",
"callbacks",
"are",
"ran",
"if",
"the",
"record",
"is",
"deleted",
".",
"Like",
"in",
"recover",
"the",
... | 2ac9d3e493035dcc68f3c3812423327127327cd5 | https://github.com/railsphp/framework/blob/2ac9d3e493035dcc68f3c3812423327127327cd5/src/Rails/ActiveRecord/Persistence/PersistedModel/Methods/PersistenceMethodsTrait.php#L357-L366 |
11,908 | railsphp/framework | src/Rails/ActiveRecord/Persistence/PersistedModel/Methods/PersistenceMethodsTrait.php | PersistenceMethodsTrait.destroyRecord | protected function destroyRecord(array $options = [])
{
return $this->runCallbacks('destroy', function() {
if (static::persistence()->delete($this)) {
$this->isDestroyed = true;
return true;
}
return false;
});
} | php | protected function destroyRecord(array $options = [])
{
return $this->runCallbacks('destroy', function() {
if (static::persistence()->delete($this)) {
$this->isDestroyed = true;
return true;
}
return false;
});
} | [
"protected",
"function",
"destroyRecord",
"(",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"return",
"$",
"this",
"->",
"runCallbacks",
"(",
"'destroy'",
",",
"function",
"(",
")",
"{",
"if",
"(",
"static",
"::",
"persistence",
"(",
")",
"->",
"d... | Removes the record from the database. The `destroy` callbacks are ran.
@return bool | [
"Removes",
"the",
"record",
"from",
"the",
"database",
".",
"The",
"destroy",
"callbacks",
"are",
"ran",
"."
] | 2ac9d3e493035dcc68f3c3812423327127327cd5 | https://github.com/railsphp/framework/blob/2ac9d3e493035dcc68f3c3812423327127327cd5/src/Rails/ActiveRecord/Persistence/PersistedModel/Methods/PersistenceMethodsTrait.php#L373-L382 |
11,909 | magdev/php-assimp | src/Converter/FileConverter.php | FileConverter.convert | public function convert(string $outputFile, string $format, array $params = array()): ExportResult
{
try {
$this->getVerb()->setOutputFile($outputFile)
->setFormat($format)
->setParameters($params);
$result = self::getCommand()->execute($this->getVerb... | php | public function convert(string $outputFile, string $format, array $params = array()): ExportResult
{
try {
$this->getVerb()->setOutputFile($outputFile)
->setFormat($format)
->setParameters($params);
$result = self::getCommand()->execute($this->getVerb... | [
"public",
"function",
"convert",
"(",
"string",
"$",
"outputFile",
",",
"string",
"$",
"format",
",",
"array",
"$",
"params",
"=",
"array",
"(",
")",
")",
":",
"ExportResult",
"{",
"try",
"{",
"$",
"this",
"->",
"getVerb",
"(",
")",
"->",
"setOutputFil... | Convert a file
@param string $outputFile
@param string $format
@param array $params
@return \Assimp\Command\Result\ExportResult
@throws \Assimp\Converter\ConverterException | [
"Convert",
"a",
"file"
] | 206e9c341f8be271a80fbeea7c32ec33b0f2fc90 | https://github.com/magdev/php-assimp/blob/206e9c341f8be271a80fbeea7c32ec33b0f2fc90/src/Converter/FileConverter.php#L79-L97 |
11,910 | magdev/php-assimp | src/Converter/FileConverter.php | FileConverter.getCommand | public static function getCommand(): Command
{
if (is_null(self::$exec)) {
self::$exec = new Command();
}
return self::$exec;
} | php | public static function getCommand(): Command
{
if (is_null(self::$exec)) {
self::$exec = new Command();
}
return self::$exec;
} | [
"public",
"static",
"function",
"getCommand",
"(",
")",
":",
"Command",
"{",
"if",
"(",
"is_null",
"(",
"self",
"::",
"$",
"exec",
")",
")",
"{",
"self",
"::",
"$",
"exec",
"=",
"new",
"Command",
"(",
")",
";",
"}",
"return",
"self",
"::",
"$",
"... | Get the command singleton
@return \Assimp\Command\Command | [
"Get",
"the",
"command",
"singleton"
] | 206e9c341f8be271a80fbeea7c32ec33b0f2fc90 | https://github.com/magdev/php-assimp/blob/206e9c341f8be271a80fbeea7c32ec33b0f2fc90/src/Converter/FileConverter.php#L132-L138 |
11,911 | twister-php/twister | src/Schema/Types/ArrayType.php | ArrayType.combine | public function combine(array $keys = null, array $values = null)
{
return array_combine($keys ?: $this->members, $values ?: $this->members);
} | php | public function combine(array $keys = null, array $values = null)
{
return array_combine($keys ?: $this->members, $values ?: $this->members);
} | [
"public",
"function",
"combine",
"(",
"array",
"$",
"keys",
"=",
"null",
",",
"array",
"$",
"values",
"=",
"null",
")",
"{",
"return",
"array_combine",
"(",
"$",
"keys",
"?",
":",
"$",
"this",
"->",
"members",
",",
"$",
"values",
"?",
":",
"$",
"th... | pass null to the component for members to use | [
"pass",
"null",
"to",
"the",
"component",
"for",
"members",
"to",
"use"
] | c06ea2650331faf11590c017c850dc5f0bbc5c13 | https://github.com/twister-php/twister/blob/c06ea2650331faf11590c017c850dc5f0bbc5c13/src/Schema/Types/ArrayType.php#L28-L31 |
11,912 | opsbears/piccolo-web-processor-controller | src/ControllerProcessorWebModule.php | ControllerProcessorWebModule.registerRequestFilter | public function registerRequestFilter(array &$globalConfig, string $requestFilterClass) {
if (!isset($moduleConfig[self::CONFIG_FILTERS_REQUEST])) {
$moduleConfig[self::CONFIG_FILTERS_REQUEST] = [];
}
$globalConfig[$this->getModuleKey()][self::CONFIG_FILTERS_REQUEST][] = $requestFilterClass;
} | php | public function registerRequestFilter(array &$globalConfig, string $requestFilterClass) {
if (!isset($moduleConfig[self::CONFIG_FILTERS_REQUEST])) {
$moduleConfig[self::CONFIG_FILTERS_REQUEST] = [];
}
$globalConfig[$this->getModuleKey()][self::CONFIG_FILTERS_REQUEST][] = $requestFilterClass;
} | [
"public",
"function",
"registerRequestFilter",
"(",
"array",
"&",
"$",
"globalConfig",
",",
"string",
"$",
"requestFilterClass",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"moduleConfig",
"[",
"self",
"::",
"CONFIG_FILTERS_REQUEST",
"]",
")",
")",
"{",
"$"... | Register a filter for a PSR-7 request. The filter must implement the RequestFilter interface.
@param array $globalConfig
@param string $requestFilterClass | [
"Register",
"a",
"filter",
"for",
"a",
"PSR",
"-",
"7",
"request",
".",
"The",
"filter",
"must",
"implement",
"the",
"RequestFilter",
"interface",
"."
] | ae446658f53940aaba63b7bb0ebcebf522a85254 | https://github.com/opsbears/piccolo-web-processor-controller/blob/ae446658f53940aaba63b7bb0ebcebf522a85254/src/ControllerProcessorWebModule.php#L28-L33 |
11,913 | opsbears/piccolo-web-processor-controller | src/ControllerProcessorWebModule.php | ControllerProcessorWebModule.registerResponseFilterClass | public function registerResponseFilterClass(array &$globalConfig, string $responseFilterClass) {
if (!isset($moduleConfig[self::CONFIG_FILTERS_RESPONSE])) {
$moduleConfig[self::CONFIG_FILTERS_RESPONSE] = [];
}
$globalConfig[$this->getModuleKey()][self::CONFIG_FILTERS_RESPONSE][] = $responseFilterClass;
} | php | public function registerResponseFilterClass(array &$globalConfig, string $responseFilterClass) {
if (!isset($moduleConfig[self::CONFIG_FILTERS_RESPONSE])) {
$moduleConfig[self::CONFIG_FILTERS_RESPONSE] = [];
}
$globalConfig[$this->getModuleKey()][self::CONFIG_FILTERS_RESPONSE][] = $responseFilterClass;
} | [
"public",
"function",
"registerResponseFilterClass",
"(",
"array",
"&",
"$",
"globalConfig",
",",
"string",
"$",
"responseFilterClass",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"moduleConfig",
"[",
"self",
"::",
"CONFIG_FILTERS_RESPONSE",
"]",
")",
")",
"{... | Register a filter for a PSR-7 response. The filter must implement the ResponseFilter interface.
@param array $globalConfig
@param string $responseFilterClass | [
"Register",
"a",
"filter",
"for",
"a",
"PSR",
"-",
"7",
"response",
".",
"The",
"filter",
"must",
"implement",
"the",
"ResponseFilter",
"interface",
"."
] | ae446658f53940aaba63b7bb0ebcebf522a85254 | https://github.com/opsbears/piccolo-web-processor-controller/blob/ae446658f53940aaba63b7bb0ebcebf522a85254/src/ControllerProcessorWebModule.php#L41-L46 |
11,914 | opsbears/piccolo-web-processor-controller | src/ControllerProcessorWebModule.php | ControllerProcessorWebModule.registerRoutingResponseFilterClass | public function registerRoutingResponseFilterClass(array &$globalConfig, string $routingResponseFilterClass) {
if (!isset($moduleConfig[self::CONFIG_FILTERS_ROUTING_RESPONSE])) {
$moduleConfig[self::CONFIG_FILTERS_ROUTING_RESPONSE] = [];
}
$globalConfig[$this->getModuleKey()][self::CONFIG_FILTERS_ROUTING_RESPO... | php | public function registerRoutingResponseFilterClass(array &$globalConfig, string $routingResponseFilterClass) {
if (!isset($moduleConfig[self::CONFIG_FILTERS_ROUTING_RESPONSE])) {
$moduleConfig[self::CONFIG_FILTERS_ROUTING_RESPONSE] = [];
}
$globalConfig[$this->getModuleKey()][self::CONFIG_FILTERS_ROUTING_RESPO... | [
"public",
"function",
"registerRoutingResponseFilterClass",
"(",
"array",
"&",
"$",
"globalConfig",
",",
"string",
"$",
"routingResponseFilterClass",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"moduleConfig",
"[",
"self",
"::",
"CONFIG_FILTERS_ROUTING_RESPONSE",
"... | Register a filter for the routing response response. The filter must implement the RoutingResponseFilter
interface.
@param array $globalConfig
@param string $routingResponseFilterClass | [
"Register",
"a",
"filter",
"for",
"the",
"routing",
"response",
"response",
".",
"The",
"filter",
"must",
"implement",
"the",
"RoutingResponseFilter",
"interface",
"."
] | ae446658f53940aaba63b7bb0ebcebf522a85254 | https://github.com/opsbears/piccolo-web-processor-controller/blob/ae446658f53940aaba63b7bb0ebcebf522a85254/src/ControllerProcessorWebModule.php#L55-L60 |
11,915 | opsbears/piccolo-web-processor-controller | src/ControllerProcessorWebModule.php | ControllerProcessorWebModule.makeFilters | private function makeFilters(array $filterSpecification, DependencyInjectionContainer $dic) : array {
$filters = [];
foreach ($filterSpecification as $requestFilterClass) {
$filters[] = $dic->make($requestFilterClass);
}
return $filters;
} | php | private function makeFilters(array $filterSpecification, DependencyInjectionContainer $dic) : array {
$filters = [];
foreach ($filterSpecification as $requestFilterClass) {
$filters[] = $dic->make($requestFilterClass);
}
return $filters;
} | [
"private",
"function",
"makeFilters",
"(",
"array",
"$",
"filterSpecification",
",",
"DependencyInjectionContainer",
"$",
"dic",
")",
":",
"array",
"{",
"$",
"filters",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"filterSpecification",
"as",
"$",
"requestFilterClas... | Create an array of filter objects from an array of filter class names.
@param array $filterSpecification
@param DependencyInjectionContainer $dic
@return array | [
"Create",
"an",
"array",
"of",
"filter",
"objects",
"from",
"an",
"array",
"of",
"filter",
"class",
"names",
"."
] | ae446658f53940aaba63b7bb0ebcebf522a85254 | https://github.com/opsbears/piccolo-web-processor-controller/blob/ae446658f53940aaba63b7bb0ebcebf522a85254/src/ControllerProcessorWebModule.php#L103-L109 |
11,916 | yii2module/yii2-tool | src/console/controllers/PasswordController.php | PasswordController.actionGenerate | public function actionGenerate()
{
$passwordList = \App::$domain->tool->password->generate();
$text = implode(SPC, $passwordList);
Output::line();
Output::pipe('Generated passwords');
Output::autoWrap($text);
Output::pipe();
Output::line();
} | php | public function actionGenerate()
{
$passwordList = \App::$domain->tool->password->generate();
$text = implode(SPC, $passwordList);
Output::line();
Output::pipe('Generated passwords');
Output::autoWrap($text);
Output::pipe();
Output::line();
} | [
"public",
"function",
"actionGenerate",
"(",
")",
"{",
"$",
"passwordList",
"=",
"\\",
"App",
"::",
"$",
"domain",
"->",
"tool",
"->",
"password",
"->",
"generate",
"(",
")",
";",
"$",
"text",
"=",
"implode",
"(",
"SPC",
",",
"$",
"passwordList",
")",
... | Generate random password list | [
"Generate",
"random",
"password",
"list"
] | c2efd7bc8550590f0afbf44ae66243f462766593 | https://github.com/yii2module/yii2-tool/blob/c2efd7bc8550590f0afbf44ae66243f462766593/src/console/controllers/PasswordController.php#L18-L27 |
11,917 | osflab/stream | Text.php | Text.crop | public static function crop($txt, int $maxChars = 20, string $etc = '...'): string
{
$txt = (string) $txt;
if (mb_strlen($txt, self::ENCODING) > $maxChars) {
return mb_substr($txt, 0, $maxChars - mb_strlen($etc, self::ENCODING), self::ENCODING) . $etc;
}
return $txt;
... | php | public static function crop($txt, int $maxChars = 20, string $etc = '...'): string
{
$txt = (string) $txt;
if (mb_strlen($txt, self::ENCODING) > $maxChars) {
return mb_substr($txt, 0, $maxChars - mb_strlen($etc, self::ENCODING), self::ENCODING) . $etc;
}
return $txt;
... | [
"public",
"static",
"function",
"crop",
"(",
"$",
"txt",
",",
"int",
"$",
"maxChars",
"=",
"20",
",",
"string",
"$",
"etc",
"=",
"'...'",
")",
":",
"string",
"{",
"$",
"txt",
"=",
"(",
"string",
")",
"$",
"txt",
";",
"if",
"(",
"mb_strlen",
"(",
... | Crop a string with a '...' if too long
@param type $txt
@param int $maxChars
@param string $etc
@return string | [
"Crop",
"a",
"string",
"with",
"a",
"...",
"if",
"too",
"long"
] | 7cec5e1eb36d20d36c08504580bd163576d68fd9 | https://github.com/osflab/stream/blob/7cec5e1eb36d20d36c08504580bd163576d68fd9/Text.php#L37-L44 |
11,918 | osflab/stream | Text.php | Text.phoneFormat | public static function phoneFormat($phoneNumber): string
{
if (!$phoneNumber) {
return (string) $phoneNumber;
}
$prefix = trim($phoneNumber)[0] == '+';
$value = preg_replace('/[^0-9]/', '', (string) $phoneNumber);
$valueLen = mb_strlen($value, self::ENCODING);
... | php | public static function phoneFormat($phoneNumber): string
{
if (!$phoneNumber) {
return (string) $phoneNumber;
}
$prefix = trim($phoneNumber)[0] == '+';
$value = preg_replace('/[^0-9]/', '', (string) $phoneNumber);
$valueLen = mb_strlen($value, self::ENCODING);
... | [
"public",
"static",
"function",
"phoneFormat",
"(",
"$",
"phoneNumber",
")",
":",
"string",
"{",
"if",
"(",
"!",
"$",
"phoneNumber",
")",
"{",
"return",
"(",
"string",
")",
"$",
"phoneNumber",
";",
"}",
"$",
"prefix",
"=",
"trim",
"(",
"$",
"phoneNumbe... | Format a phone number
@param mixed $phoneNumber
@return string | [
"Format",
"a",
"phone",
"number"
] | 7cec5e1eb36d20d36c08504580bd163576d68fd9 | https://github.com/osflab/stream/blob/7cec5e1eb36d20d36c08504580bd163576d68fd9/Text.php#L71-L112 |
11,919 | osflab/stream | Text.php | Text.ucPhrase | public static function ucPhrase($str): string
{
$str = mb_strtolower(self::cleanPhrase($str), self::ENCODING);
$names = explode(' ', $str);
array_walk($names, 'self::ucFirstTouch');
$names = explode('-', implode(' ', $names));
array_walk($names, 'self::ucFirstTouch');
... | php | public static function ucPhrase($str): string
{
$str = mb_strtolower(self::cleanPhrase($str), self::ENCODING);
$names = explode(' ', $str);
array_walk($names, 'self::ucFirstTouch');
$names = explode('-', implode(' ', $names));
array_walk($names, 'self::ucFirstTouch');
... | [
"public",
"static",
"function",
"ucPhrase",
"(",
"$",
"str",
")",
":",
"string",
"{",
"$",
"str",
"=",
"mb_strtolower",
"(",
"self",
"::",
"cleanPhrase",
"(",
"$",
"str",
")",
",",
"self",
"::",
"ENCODING",
")",
";",
"$",
"names",
"=",
"explode",
"("... | jean-albert dupont -> Jean-Albert Dupont
@param mixed $str
@return string | [
"jean",
"-",
"albert",
"dupont",
"-",
">",
"Jean",
"-",
"Albert",
"Dupont"
] | 7cec5e1eb36d20d36c08504580bd163576d68fd9 | https://github.com/osflab/stream/blob/7cec5e1eb36d20d36c08504580bd163576d68fd9/Text.php#L149-L157 |
11,920 | osflab/stream | Text.php | Text.percentageFormat | public static function percentageFormat($value, bool $withSymbol = true, int $precision = 0): string
{
$percentValue = round((float) $value, $precision);
return $percentValue . ($withSymbol ? ' %' : '');
} | php | public static function percentageFormat($value, bool $withSymbol = true, int $precision = 0): string
{
$percentValue = round((float) $value, $precision);
return $percentValue . ($withSymbol ? ' %' : '');
} | [
"public",
"static",
"function",
"percentageFormat",
"(",
"$",
"value",
",",
"bool",
"$",
"withSymbol",
"=",
"true",
",",
"int",
"$",
"precision",
"=",
"0",
")",
":",
"string",
"{",
"$",
"percentValue",
"=",
"round",
"(",
"(",
"float",
")",
"$",
"value"... | Round and add the % symbol
@param mixed $value
@param bool $withSymbol
@param int $precision
@return string | [
"Round",
"and",
"add",
"the",
"%",
"symbol"
] | 7cec5e1eb36d20d36c08504580bd163576d68fd9 | https://github.com/osflab/stream/blob/7cec5e1eb36d20d36c08504580bd163576d68fd9/Text.php#L272-L276 |
11,921 | osflab/stream | Text.php | Text.formatDate | public static function formatDate(DateTime $date, $locale = null, bool $short = false)
{
$locale = $locale ?? 'fr';
$localDates = [
'fr' => $short ? 'd/m/y' : 'd/m/Y',
'en' => $short ? 'd/m/y' : 'd/m/Y',
'en_US' => $short ? 'm/d/y' : 'm/d/Y'
];
... | php | public static function formatDate(DateTime $date, $locale = null, bool $short = false)
{
$locale = $locale ?? 'fr';
$localDates = [
'fr' => $short ? 'd/m/y' : 'd/m/Y',
'en' => $short ? 'd/m/y' : 'd/m/Y',
'en_US' => $short ? 'm/d/y' : 'm/d/Y'
];
... | [
"public",
"static",
"function",
"formatDate",
"(",
"DateTime",
"$",
"date",
",",
"$",
"locale",
"=",
"null",
",",
"bool",
"$",
"short",
"=",
"false",
")",
"{",
"$",
"locale",
"=",
"$",
"locale",
"??",
"'fr'",
";",
"$",
"localDates",
"=",
"[",
"'fr'",... | Format a date with the specified locale
@param DateTime $date
@param string $locale
@param bool $short
@return string
@todo use an external library ? | [
"Format",
"a",
"date",
"with",
"the",
"specified",
"locale"
] | 7cec5e1eb36d20d36c08504580bd163576d68fd9 | https://github.com/osflab/stream/blob/7cec5e1eb36d20d36c08504580bd163576d68fd9/Text.php#L286-L295 |
11,922 | osflab/stream | Text.php | Text.formatDateTime | public static function formatDateTime(DateTime $date, $locale = null, string $mask = null, bool $short = false): string
{
$locale = $locale ?? 'fr';
if ($mask === null) {
$localDates = [
'fr' => $short ? __("d/m/y H:i") : __("d/m/Y H:i"),
'en' => $sh... | php | public static function formatDateTime(DateTime $date, $locale = null, string $mask = null, bool $short = false): string
{
$locale = $locale ?? 'fr';
if ($mask === null) {
$localDates = [
'fr' => $short ? __("d/m/y H:i") : __("d/m/Y H:i"),
'en' => $sh... | [
"public",
"static",
"function",
"formatDateTime",
"(",
"DateTime",
"$",
"date",
",",
"$",
"locale",
"=",
"null",
",",
"string",
"$",
"mask",
"=",
"null",
",",
"bool",
"$",
"short",
"=",
"false",
")",
":",
"string",
"{",
"$",
"locale",
"=",
"$",
"loca... | Format a datetime with the specified locale
@param DateTime $date
@param string $locale
@return string
@todo use an external library ? | [
"Format",
"a",
"datetime",
"with",
"the",
"specified",
"locale"
] | 7cec5e1eb36d20d36c08504580bd163576d68fd9 | https://github.com/osflab/stream/blob/7cec5e1eb36d20d36c08504580bd163576d68fd9/Text.php#L321-L333 |
11,923 | osflab/stream | Text.php | Text.camelCase | public static function camelCase($word, bool $ucFirstWord = true): string
{
static $words = [];
if (!isset($words[$word])) {
$words[$word] = str_replace(' ', '', ucwords(strtr($word, '_', ' ')));
if (!$ucFirstWord) {
substr_replace($words[$word], $wor... | php | public static function camelCase($word, bool $ucFirstWord = true): string
{
static $words = [];
if (!isset($words[$word])) {
$words[$word] = str_replace(' ', '', ucwords(strtr($word, '_', ' ')));
if (!$ucFirstWord) {
substr_replace($words[$word], $wor... | [
"public",
"static",
"function",
"camelCase",
"(",
"$",
"word",
",",
"bool",
"$",
"ucFirstWord",
"=",
"true",
")",
":",
"string",
"{",
"static",
"$",
"words",
"=",
"[",
"]",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"words",
"[",
"$",
"word",
"]",
"... | some_phrase => SomePhrase
@param mixed $word
@param bool $ucFirstWord
@return string | [
"some_phrase",
"=",
">",
"SomePhrase"
] | 7cec5e1eb36d20d36c08504580bd163576d68fd9 | https://github.com/osflab/stream/blob/7cec5e1eb36d20d36c08504580bd163576d68fd9/Text.php#L359-L370 |
11,924 | osflab/stream | Text.php | Text.fromCamelCaseToLower | public static function fromCamelCaseToLower($word, string $separator = '-'): string
{
$str = '';
$active = false;
$word = (string) $word;
for ($i = 0; $i <= mb_strlen($word); $i++) {
$char = mb_substr($word, $i, 1, self::ENCODING);
$str .= ($active && $char >=... | php | public static function fromCamelCaseToLower($word, string $separator = '-'): string
{
$str = '';
$active = false;
$word = (string) $word;
for ($i = 0; $i <= mb_strlen($word); $i++) {
$char = mb_substr($word, $i, 1, self::ENCODING);
$str .= ($active && $char >=... | [
"public",
"static",
"function",
"fromCamelCaseToLower",
"(",
"$",
"word",
",",
"string",
"$",
"separator",
"=",
"'-'",
")",
":",
"string",
"{",
"$",
"str",
"=",
"''",
";",
"$",
"active",
"=",
"false",
";",
"$",
"word",
"=",
"(",
"string",
")",
"$",
... | CamelCase -> camel-case
@param string $word
@param string $separator
@return string | [
"CamelCase",
"-",
">",
"camel",
"-",
"case"
] | 7cec5e1eb36d20d36c08504580bd163576d68fd9 | https://github.com/osflab/stream/blob/7cec5e1eb36d20d36c08504580bd163576d68fd9/Text.php#L378-L389 |
11,925 | osflab/stream | Text.php | Text.transliterate | public static function transliterate($txt)
{
if ($txt === null) {
return null;
}
return strtolower(\Patchwork\Utf8::toAscii((string) $txt));
} | php | public static function transliterate($txt)
{
if ($txt === null) {
return null;
}
return strtolower(\Patchwork\Utf8::toAscii((string) $txt));
} | [
"public",
"static",
"function",
"transliterate",
"(",
"$",
"txt",
")",
"{",
"if",
"(",
"$",
"txt",
"===",
"null",
")",
"{",
"return",
"null",
";",
"}",
"return",
"strtolower",
"(",
"\\",
"Patchwork",
"\\",
"Utf8",
"::",
"toAscii",
"(",
"(",
"string",
... | Transliteration for a search engine
@param string|null $txt
@return string|null | [
"Transliteration",
"for",
"a",
"search",
"engine"
] | 7cec5e1eb36d20d36c08504580bd163576d68fd9 | https://github.com/osflab/stream/blob/7cec5e1eb36d20d36c08504580bd163576d68fd9/Text.php#L396-L402 |
11,926 | osflab/stream | Text.php | Text.formatSiret | public static function formatSiret($value): string
{
$value = (string) (int) $value;
if (!self::isSiret($value)) {
return '';
}
return preg_replace('/^([0-9]{3})([0-9]{3})([0-9]{3})([0-9]{5})$/', '$1 $2 $3 $4', $value);
} | php | public static function formatSiret($value): string
{
$value = (string) (int) $value;
if (!self::isSiret($value)) {
return '';
}
return preg_replace('/^([0-9]{3})([0-9]{3})([0-9]{3})([0-9]{5})$/', '$1 $2 $3 $4', $value);
} | [
"public",
"static",
"function",
"formatSiret",
"(",
"$",
"value",
")",
":",
"string",
"{",
"$",
"value",
"=",
"(",
"string",
")",
"(",
"int",
")",
"$",
"value",
";",
"if",
"(",
"!",
"self",
"::",
"isSiret",
"(",
"$",
"value",
")",
")",
"{",
"retu... | Format a siret number with 14 digits
@param string $value
@return string | [
"Format",
"a",
"siret",
"number",
"with",
"14",
"digits"
] | 7cec5e1eb36d20d36c08504580bd163576d68fd9 | https://github.com/osflab/stream/blob/7cec5e1eb36d20d36c08504580bd163576d68fd9/Text.php#L431-L438 |
11,927 | osflab/stream | Text.php | Text.siretToSiren | public static function siretToSiren($siret, bool $format = false): string
{
$value = (string) (int) $siret;
if (!self::isSiret($value)) {
return '';
}
return $format
? preg_replace('/^([0-9]{3})([0-9]{3})([0-9]{3})([0-9]{5})$/', '$1 $2 $3', $value)
... | php | public static function siretToSiren($siret, bool $format = false): string
{
$value = (string) (int) $siret;
if (!self::isSiret($value)) {
return '';
}
return $format
? preg_replace('/^([0-9]{3})([0-9]{3})([0-9]{3})([0-9]{5})$/', '$1 $2 $3', $value)
... | [
"public",
"static",
"function",
"siretToSiren",
"(",
"$",
"siret",
",",
"bool",
"$",
"format",
"=",
"false",
")",
":",
"string",
"{",
"$",
"value",
"=",
"(",
"string",
")",
"(",
"int",
")",
"$",
"siret",
";",
"if",
"(",
"!",
"self",
"::",
"isSiret"... | Extract french siren from siret
@param string $siret
@param bool $format
@return string | [
"Extract",
"french",
"siren",
"from",
"siret"
] | 7cec5e1eb36d20d36c08504580bd163576d68fd9 | https://github.com/osflab/stream/blob/7cec5e1eb36d20d36c08504580bd163576d68fd9/Text.php#L446-L455 |
11,928 | osflab/stream | Text.php | Text.formatTvaIntra | public static function formatTvaIntra($value)
{
$value = self::toUpper(trim(str_replace(' ', '', $value)));
return preg_replace('/^([A-Z]{2})([0-9]{2})([0-9]{3})([0-9]{3})([0-9]{3})$/', '$1 $2 $3 $4 $5', $value);
} | php | public static function formatTvaIntra($value)
{
$value = self::toUpper(trim(str_replace(' ', '', $value)));
return preg_replace('/^([A-Z]{2})([0-9]{2})([0-9]{3})([0-9]{3})([0-9]{3})$/', '$1 $2 $3 $4 $5', $value);
} | [
"public",
"static",
"function",
"formatTvaIntra",
"(",
"$",
"value",
")",
"{",
"$",
"value",
"=",
"self",
"::",
"toUpper",
"(",
"trim",
"(",
"str_replace",
"(",
"' '",
",",
"''",
",",
"$",
"value",
")",
")",
")",
";",
"return",
"preg_replace",
"(",
"... | Intracom TVA formatting
@param string $value
@return string | [
"Intracom",
"TVA",
"formatting"
] | 7cec5e1eb36d20d36c08504580bd163576d68fd9 | https://github.com/osflab/stream/blob/7cec5e1eb36d20d36c08504580bd163576d68fd9/Text.php#L471-L475 |
11,929 | plinker-rpc/core | src/lib/Signer.php | Signer.encode | public function encode($data)
{
// loop over params, look for closure
if (
// not a server exception
!($data instanceof \Plinker\Core\Exception\Server) &&
// params should be set & array
isset($data['params']) && is_array($data['params'])) {
... | php | public function encode($data)
{
// loop over params, look for closure
if (
// not a server exception
!($data instanceof \Plinker\Core\Exception\Server) &&
// params should be set & array
isset($data['params']) && is_array($data['params'])) {
... | [
"public",
"function",
"encode",
"(",
"$",
"data",
")",
"{",
"// loop over params, look for closure",
"if",
"(",
"// not a server exception",
"!",
"(",
"$",
"data",
"instanceof",
"\\",
"Plinker",
"\\",
"Core",
"\\",
"Exception",
"\\",
"Server",
")",
"&&",
"// par... | Sign and encrypt into payload array.
@codeCoverageIgnore
@return array | [
"Sign",
"and",
"encrypt",
"into",
"payload",
"array",
"."
] | c9039cfa840cfe2d6377455e6668364d910626fd | https://github.com/plinker-rpc/core/blob/c9039cfa840cfe2d6377455e6668364d910626fd/src/lib/Signer.php#L94-L119 |
11,930 | plinker-rpc/core | src/lib/Signer.php | Signer.decode | public function decode($data)
{
$data["data"] = $this->decrypt($data["data"], $this->config["secret"]);
if (hash_hmac(
"sha256",
$data["data"],
$this->config["secret"]
) == $data["token"]) {
return unserialize($data["data"]);
} else {
... | php | public function decode($data)
{
$data["data"] = $this->decrypt($data["data"], $this->config["secret"]);
if (hash_hmac(
"sha256",
$data["data"],
$this->config["secret"]
) == $data["token"]) {
return unserialize($data["data"]);
} else {
... | [
"public",
"function",
"decode",
"(",
"$",
"data",
")",
"{",
"$",
"data",
"[",
"\"data\"",
"]",
"=",
"$",
"this",
"->",
"decrypt",
"(",
"$",
"data",
"[",
"\"data\"",
"]",
",",
"$",
"this",
"->",
"config",
"[",
"\"secret\"",
"]",
")",
";",
"if",
"(... | Decrypt, verify and unserialize payload.
@codeCoverageIgnore
@return mixed | [
"Decrypt",
"verify",
"and",
"unserialize",
"payload",
"."
] | c9039cfa840cfe2d6377455e6668364d910626fd | https://github.com/plinker-rpc/core/blob/c9039cfa840cfe2d6377455e6668364d910626fd/src/lib/Signer.php#L128-L141 |
11,931 | activecollab/payments | src/Dispatcher/Dispatcher.php | Dispatcher.listen | public function listen($event, callable $handler)
{
if (empty($this->handlers[$event])) {
$this->handlers[$event] = [];
}
$this->handlers[$event][] = $handler;
} | php | public function listen($event, callable $handler)
{
if (empty($this->handlers[$event])) {
$this->handlers[$event] = [];
}
$this->handlers[$event][] = $handler;
} | [
"public",
"function",
"listen",
"(",
"$",
"event",
",",
"callable",
"$",
"handler",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"handlers",
"[",
"$",
"event",
"]",
")",
")",
"{",
"$",
"this",
"->",
"handlers",
"[",
"$",
"event",
"]",
"=... | Specify an event listener for a project.
@param string $event
@param callable $handler | [
"Specify",
"an",
"event",
"listener",
"for",
"a",
"project",
"."
] | 9fab8060ccc496756cf6aed36e3006acfa0c1546 | https://github.com/activecollab/payments/blob/9fab8060ccc496756cf6aed36e3006acfa0c1546/src/Dispatcher/Dispatcher.php#L39-L46 |
11,932 | activecollab/payments | src/Dispatcher/Dispatcher.php | Dispatcher.trigger | protected function trigger($event, ...$arguments)
{
if (!empty($this->handlers[$event])) {
/** @var callable $handler */
foreach ($this->handlers[$event] as $handler) {
call_user_func_array($handler, $arguments);
}
}
} | php | protected function trigger($event, ...$arguments)
{
if (!empty($this->handlers[$event])) {
/** @var callable $handler */
foreach ($this->handlers[$event] as $handler) {
call_user_func_array($handler, $arguments);
}
}
} | [
"protected",
"function",
"trigger",
"(",
"$",
"event",
",",
"...",
"$",
"arguments",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"handlers",
"[",
"$",
"event",
"]",
")",
")",
"{",
"/** @var callable $handler */",
"foreach",
"(",
"$",
"th... | Trigger a particular event.
@param string $event
@param mixed ...$arguments | [
"Trigger",
"a",
"particular",
"event",
"."
] | 9fab8060ccc496756cf6aed36e3006acfa0c1546 | https://github.com/activecollab/payments/blob/9fab8060ccc496756cf6aed36e3006acfa0c1546/src/Dispatcher/Dispatcher.php#L54-L62 |
11,933 | activecollab/payments | src/Dispatcher/Dispatcher.php | Dispatcher.triggerOrderCompleted | public function triggerOrderCompleted(GatewayInterface $gateway, OrderInterface $order)
{
$this->trigger(self::ON_ORDER_COMPLETED, $gateway, $order);
} | php | public function triggerOrderCompleted(GatewayInterface $gateway, OrderInterface $order)
{
$this->trigger(self::ON_ORDER_COMPLETED, $gateway, $order);
} | [
"public",
"function",
"triggerOrderCompleted",
"(",
"GatewayInterface",
"$",
"gateway",
",",
"OrderInterface",
"$",
"order",
")",
"{",
"$",
"this",
"->",
"trigger",
"(",
"self",
"::",
"ON_ORDER_COMPLETED",
",",
"$",
"gateway",
",",
"$",
"order",
")",
";",
"}... | Trigger product order completed.
@param \ActiveCollab\Payments\Gateway\GatewayInterface $gateway
@param OrderInterface $order | [
"Trigger",
"product",
"order",
"completed",
"."
] | 9fab8060ccc496756cf6aed36e3006acfa0c1546 | https://github.com/activecollab/payments/blob/9fab8060ccc496756cf6aed36e3006acfa0c1546/src/Dispatcher/Dispatcher.php#L70-L73 |
11,934 | activecollab/payments | src/Dispatcher/Dispatcher.php | Dispatcher.triggerSubscriptionDeactivated | public function triggerSubscriptionDeactivated(GatewayInterface $gateway, SubscriptionInterface $subscription, CancelationInterface $cancelation)
{
$this->trigger(self::ON_SUBSCRIPTION_DEACTIVATED, $gateway, $subscription, $cancelation);
} | php | public function triggerSubscriptionDeactivated(GatewayInterface $gateway, SubscriptionInterface $subscription, CancelationInterface $cancelation)
{
$this->trigger(self::ON_SUBSCRIPTION_DEACTIVATED, $gateway, $subscription, $cancelation);
} | [
"public",
"function",
"triggerSubscriptionDeactivated",
"(",
"GatewayInterface",
"$",
"gateway",
",",
"SubscriptionInterface",
"$",
"subscription",
",",
"CancelationInterface",
"$",
"cancelation",
")",
"{",
"$",
"this",
"->",
"trigger",
"(",
"self",
"::",
"ON_SUBSCRIP... | Trigger an event when subscription is deactivated.
@param GatewayInterface $gateway
@param SubscriptionInterface $subscription
@param CancelationInterface $cancelation | [
"Trigger",
"an",
"event",
"when",
"subscription",
"is",
"deactivated",
"."
] | 9fab8060ccc496756cf6aed36e3006acfa0c1546 | https://github.com/activecollab/payments/blob/9fab8060ccc496756cf6aed36e3006acfa0c1546/src/Dispatcher/Dispatcher.php#L145-L148 |
11,935 | activecollab/payments | src/Dispatcher/Dispatcher.php | Dispatcher.triggerSubscriptionCustomActivated | public function triggerSubscriptionCustomActivated(SubscriptionInterface $subscription, $note)
{
$this->trigger(self::ON_SUBSCRIPTION_CUSTOM_ACTIVATED, $subscription, $note);
} | php | public function triggerSubscriptionCustomActivated(SubscriptionInterface $subscription, $note)
{
$this->trigger(self::ON_SUBSCRIPTION_CUSTOM_ACTIVATED, $subscription, $note);
} | [
"public",
"function",
"triggerSubscriptionCustomActivated",
"(",
"SubscriptionInterface",
"$",
"subscription",
",",
"$",
"note",
")",
"{",
"$",
"this",
"->",
"trigger",
"(",
"self",
"::",
"ON_SUBSCRIPTION_CUSTOM_ACTIVATED",
",",
"$",
"subscription",
",",
"$",
"note"... | Trigger an event when account is activated manually.
@param SubscriptionInterface $subscription
@param string $note | [
"Trigger",
"an",
"event",
"when",
"account",
"is",
"activated",
"manually",
"."
] | 9fab8060ccc496756cf6aed36e3006acfa0c1546 | https://github.com/activecollab/payments/blob/9fab8060ccc496756cf6aed36e3006acfa0c1546/src/Dispatcher/Dispatcher.php#L169-L172 |
11,936 | activecollab/payments | src/Dispatcher/Dispatcher.php | Dispatcher.triggerSubscriptionExpired | public function triggerSubscriptionExpired(SubscriptionInterface $subscription, $note)
{
$this->trigger(self::ON_SUBSCRIPTION_EXPIRED, $subscription, $note);
} | php | public function triggerSubscriptionExpired(SubscriptionInterface $subscription, $note)
{
$this->trigger(self::ON_SUBSCRIPTION_EXPIRED, $subscription, $note);
} | [
"public",
"function",
"triggerSubscriptionExpired",
"(",
"SubscriptionInterface",
"$",
"subscription",
",",
"$",
"note",
")",
"{",
"$",
"this",
"->",
"trigger",
"(",
"self",
"::",
"ON_SUBSCRIPTION_EXPIRED",
",",
"$",
"subscription",
",",
"$",
"note",
")",
";",
... | Trigger an event when account subscription is expired.
@param SubscriptionInterface $subscription
@param string $note | [
"Trigger",
"an",
"event",
"when",
"account",
"subscription",
"is",
"expired",
"."
] | 9fab8060ccc496756cf6aed36e3006acfa0c1546 | https://github.com/activecollab/payments/blob/9fab8060ccc496756cf6aed36e3006acfa0c1546/src/Dispatcher/Dispatcher.php#L180-L183 |
11,937 | anklimsk/cakephp-basic-functions | Vendor/langcode-conv/zendframework/zend-stdlib/src/ArrayObject.php | ArrayObject.unserialize | public function unserialize($data)
{
$ar = unserialize($data);
$this->protectedProperties = array_keys(get_object_vars($this));
$this->setFlags($ar['flag']);
$this->exchangeArray($ar['storage']);
$this->setIteratorClass($ar['iteratorClass']);
... | php | public function unserialize($data)
{
$ar = unserialize($data);
$this->protectedProperties = array_keys(get_object_vars($this));
$this->setFlags($ar['flag']);
$this->exchangeArray($ar['storage']);
$this->setIteratorClass($ar['iteratorClass']);
... | [
"public",
"function",
"unserialize",
"(",
"$",
"data",
")",
"{",
"$",
"ar",
"=",
"unserialize",
"(",
"$",
"data",
")",
";",
"$",
"this",
"->",
"protectedProperties",
"=",
"array_keys",
"(",
"get_object_vars",
"(",
"$",
"this",
")",
")",
";",
"$",
"this... | Unserialize an ArrayObject
@param string $data
@return void | [
"Unserialize",
"an",
"ArrayObject"
] | 7554e8b0b420fd3155593af7bf76b7ccbdc8701e | https://github.com/anklimsk/cakephp-basic-functions/blob/7554e8b0b420fd3155593af7bf76b7ccbdc8701e/Vendor/langcode-conv/zendframework/zend-stdlib/src/ArrayObject.php#L405-L431 |
11,938 | synapsestudios/synapse-base | src/Synapse/Mapper/UpdaterTrait.php | UpdaterTrait.update | public function update(AbstractEntity $entity)
{
if ($this->updatedTimestampColumn) {
$entity->exchangeArray([$this->updatedTimestampColumn => time()]);
}
if ($this->updatedDatetimeColumn) {
$entity->exchangeArray([$this->updatedDatetimeColumn => date('Y-m-d H:i:s')]... | php | public function update(AbstractEntity $entity)
{
if ($this->updatedTimestampColumn) {
$entity->exchangeArray([$this->updatedTimestampColumn => time()]);
}
if ($this->updatedDatetimeColumn) {
$entity->exchangeArray([$this->updatedDatetimeColumn => date('Y-m-d H:i:s')]... | [
"public",
"function",
"update",
"(",
"AbstractEntity",
"$",
"entity",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"updatedTimestampColumn",
")",
"{",
"$",
"entity",
"->",
"exchangeArray",
"(",
"[",
"$",
"this",
"->",
"updatedTimestampColumn",
"=>",
"time",
"(",
... | Update the given entity in the database.
@param AbstractEntity $entity
@return AbstractEntity | [
"Update",
"the",
"given",
"entity",
"in",
"the",
"database",
"."
] | 60c830550491742a077ab063f924e2f0b63825da | https://github.com/synapsestudios/synapse-base/blob/60c830550491742a077ab063f924e2f0b63825da/src/Synapse/Mapper/UpdaterTrait.php#L18-L31 |
11,939 | slickframework/orm | src/Mapper/Relation/HasAndBelongsToMany.php | HasAndBelongsToMany.getRelatedForeignKey | public function getRelatedForeignKey()
{
if (null == $this->relatedForeignKey) {
$name = $this->getParentTableName();
$this->relatedForeignKey = "{$this->normalizeFieldName($name)}_id";
}
return $this->relatedForeignKey;
} | php | public function getRelatedForeignKey()
{
if (null == $this->relatedForeignKey) {
$name = $this->getParentTableName();
$this->relatedForeignKey = "{$this->normalizeFieldName($name)}_id";
}
return $this->relatedForeignKey;
} | [
"public",
"function",
"getRelatedForeignKey",
"(",
")",
"{",
"if",
"(",
"null",
"==",
"$",
"this",
"->",
"relatedForeignKey",
")",
"{",
"$",
"name",
"=",
"$",
"this",
"->",
"getParentTableName",
"(",
")",
";",
"$",
"this",
"->",
"relatedForeignKey",
"=",
... | Gets the related foreign key
@return string | [
"Gets",
"the",
"related",
"foreign",
"key"
] | c5c782f5e3a46cdc6c934eda4411cb9edc48f969 | https://github.com/slickframework/orm/blob/c5c782f5e3a46cdc6c934eda4411cb9edc48f969/src/Mapper/Relation/HasAndBelongsToMany.php#L45-L52 |
11,940 | slickframework/orm | src/Mapper/Relation/HasAndBelongsToMany.php | HasAndBelongsToMany.getRelationTable | public function getRelationTable()
{
if (is_null($this->relationTable)) {
$parentTable = $this->getParentTableName();
$table = $this->getEntityDescriptor()->getTableName();
$names = [$parentTable, $table];
asort($names);
$first = array_shift($names... | php | public function getRelationTable()
{
if (is_null($this->relationTable)) {
$parentTable = $this->getParentTableName();
$table = $this->getEntityDescriptor()->getTableName();
$names = [$parentTable, $table];
asort($names);
$first = array_shift($names... | [
"public",
"function",
"getRelationTable",
"(",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"relationTable",
")",
")",
"{",
"$",
"parentTable",
"=",
"$",
"this",
"->",
"getParentTableName",
"(",
")",
";",
"$",
"table",
"=",
"$",
"this",
"->"... | Gets the related table
@return string | [
"Gets",
"the",
"related",
"table"
] | c5c782f5e3a46cdc6c934eda4411cb9edc48f969 | https://github.com/slickframework/orm/blob/c5c782f5e3a46cdc6c934eda4411cb9edc48f969/src/Mapper/Relation/HasAndBelongsToMany.php#L59-L72 |
11,941 | slickframework/orm | src/Mapper/Relation/HasAndBelongsToMany.php | HasAndBelongsToMany.add | public function add(EntityAdded $event)
{
$entity = $event->getEntity();
$collection = $event->getCollection();
$this->deleteRelation($entity, $collection);
$repository = $this->getParentRepository();
$adapter = $repository->getAdapter();
$value = $collection->parent... | php | public function add(EntityAdded $event)
{
$entity = $event->getEntity();
$collection = $event->getCollection();
$this->deleteRelation($entity, $collection);
$repository = $this->getParentRepository();
$adapter = $repository->getAdapter();
$value = $collection->parent... | [
"public",
"function",
"add",
"(",
"EntityAdded",
"$",
"event",
")",
"{",
"$",
"entity",
"=",
"$",
"event",
"->",
"getEntity",
"(",
")",
";",
"$",
"collection",
"=",
"$",
"event",
"->",
"getCollection",
"(",
")",
";",
"$",
"this",
"->",
"deleteRelation"... | Saves the relation row upon entity add
@param EntityAdded $event | [
"Saves",
"the",
"relation",
"row",
"upon",
"entity",
"add"
] | c5c782f5e3a46cdc6c934eda4411cb9edc48f969 | https://github.com/slickframework/orm/blob/c5c782f5e3a46cdc6c934eda4411cb9edc48f969/src/Mapper/Relation/HasAndBelongsToMany.php#L109-L128 |
11,942 | slickframework/orm | src/Mapper/Relation/HasAndBelongsToMany.php | HasAndBelongsToMany.remove | public function remove(EntityRemoved $event)
{
$entity = $event->getEntity();
$collection = $event->getCollection();
$this->deleteRelation($entity, $collection);
} | php | public function remove(EntityRemoved $event)
{
$entity = $event->getEntity();
$collection = $event->getCollection();
$this->deleteRelation($entity, $collection);
} | [
"public",
"function",
"remove",
"(",
"EntityRemoved",
"$",
"event",
")",
"{",
"$",
"entity",
"=",
"$",
"event",
"->",
"getEntity",
"(",
")",
";",
"$",
"collection",
"=",
"$",
"event",
"->",
"getCollection",
"(",
")",
";",
"$",
"this",
"->",
"deleteRela... | Deletes the relation row upon entity remove
@param EntityRemoved $event | [
"Deletes",
"the",
"relation",
"row",
"upon",
"entity",
"remove"
] | c5c782f5e3a46cdc6c934eda4411cb9edc48f969 | https://github.com/slickframework/orm/blob/c5c782f5e3a46cdc6c934eda4411cb9edc48f969/src/Mapper/Relation/HasAndBelongsToMany.php#L135-L140 |
11,943 | slickframework/orm | src/Mapper/Relation/HasAndBelongsToMany.php | HasAndBelongsToMany.deleteRelation | protected function deleteRelation(
EntityInterface $entity,
EntityCollectionInterface $collection
) {
$repository = $this->getParentRepository();
$adapter = $repository->getAdapter();
$parts = explode('\\', $this->getEntityDescriptor()->className());
$entityName = lcf... | php | protected function deleteRelation(
EntityInterface $entity,
EntityCollectionInterface $collection
) {
$repository = $this->getParentRepository();
$adapter = $repository->getAdapter();
$parts = explode('\\', $this->getEntityDescriptor()->className());
$entityName = lcf... | [
"protected",
"function",
"deleteRelation",
"(",
"EntityInterface",
"$",
"entity",
",",
"EntityCollectionInterface",
"$",
"collection",
")",
"{",
"$",
"repository",
"=",
"$",
"this",
"->",
"getParentRepository",
"(",
")",
";",
"$",
"adapter",
"=",
"$",
"repositor... | Removes existing relations
@param EntityInterface $entity
@param EntityCollectionInterface $collection
@return self | [
"Removes",
"existing",
"relations"
] | c5c782f5e3a46cdc6c934eda4411cb9edc48f969 | https://github.com/slickframework/orm/blob/c5c782f5e3a46cdc6c934eda4411cb9edc48f969/src/Mapper/Relation/HasAndBelongsToMany.php#L150-L174 |
11,944 | slickframework/orm | src/Mapper/Relation/HasAndBelongsToMany.php | HasAndBelongsToMany.addJoinTable | protected function addJoinTable(Select $query)
{
$relationTable = $this->getRelationTable();
$table = $this->getParentTableName();
$pmk = $this->getParentPrimaryKey();
$rfk = $this->getRelatedForeignKey();
$query->join(
$relationTable,
"rel.{$rfk} = {$... | php | protected function addJoinTable(Select $query)
{
$relationTable = $this->getRelationTable();
$table = $this->getParentTableName();
$pmk = $this->getParentPrimaryKey();
$rfk = $this->getRelatedForeignKey();
$query->join(
$relationTable,
"rel.{$rfk} = {$... | [
"protected",
"function",
"addJoinTable",
"(",
"Select",
"$",
"query",
")",
"{",
"$",
"relationTable",
"=",
"$",
"this",
"->",
"getRelationTable",
"(",
")",
";",
"$",
"table",
"=",
"$",
"this",
"->",
"getParentTableName",
"(",
")",
";",
"$",
"pmk",
"=",
... | Adds the join table to the query
@param Select $query
@return self | [
"Adds",
"the",
"join",
"table",
"to",
"the",
"query"
] | c5c782f5e3a46cdc6c934eda4411cb9edc48f969 | https://github.com/slickframework/orm/blob/c5c782f5e3a46cdc6c934eda4411cb9edc48f969/src/Mapper/Relation/HasAndBelongsToMany.php#L199-L212 |
11,945 | jaredtking/jaqb | src/Query/SelectQuery.php | SelectQuery.groupBy | public function groupBy($fields, $direction = false)
{
$this->groupBy->addFields($fields, $direction);
return $this;
} | php | public function groupBy($fields, $direction = false)
{
$this->groupBy->addFields($fields, $direction);
return $this;
} | [
"public",
"function",
"groupBy",
"(",
"$",
"fields",
",",
"$",
"direction",
"=",
"false",
")",
"{",
"$",
"this",
"->",
"groupBy",
"->",
"addFields",
"(",
"$",
"fields",
",",
"$",
"direction",
")",
";",
"return",
"$",
"this",
";",
"}"
] | Sets the group by fields for the query.
@param string|array $fields
@param string $direction
@return self | [
"Sets",
"the",
"group",
"by",
"fields",
"for",
"the",
"query",
"."
] | 04a853b530fcc12a9863349d3d0da6377d1b9995 | https://github.com/jaredtking/jaqb/blob/04a853b530fcc12a9863349d3d0da6377d1b9995/src/Query/SelectQuery.php#L177-L182 |
11,946 | jaredtking/jaqb | src/Query/SelectQuery.php | SelectQuery.having | public function having($field, $condition = false, $operator = '=')
{
if (func_num_args() >= 2) {
$this->having->addCondition($field, $condition, $operator);
} else {
$this->having->addCondition($field);
}
return $this;
} | php | public function having($field, $condition = false, $operator = '=')
{
if (func_num_args() >= 2) {
$this->having->addCondition($field, $condition, $operator);
} else {
$this->having->addCondition($field);
}
return $this;
} | [
"public",
"function",
"having",
"(",
"$",
"field",
",",
"$",
"condition",
"=",
"false",
",",
"$",
"operator",
"=",
"'='",
")",
"{",
"if",
"(",
"func_num_args",
"(",
")",
">=",
"2",
")",
"{",
"$",
"this",
"->",
"having",
"->",
"addCondition",
"(",
"... | Sets the having conditions for the query.
@param array|string $field
@param string|bool $condition condition value (optional)
@param string $operator operator (optional)
@return self | [
"Sets",
"the",
"having",
"conditions",
"for",
"the",
"query",
"."
] | 04a853b530fcc12a9863349d3d0da6377d1b9995 | https://github.com/jaredtking/jaqb/blob/04a853b530fcc12a9863349d3d0da6377d1b9995/src/Query/SelectQuery.php#L193-L202 |
11,947 | jaredtking/jaqb | src/Query/SelectQuery.php | SelectQuery.union | public function union(self $query, $type = '')
{
$this->union->addQuery($query, $type);
return $this;
} | php | public function union(self $query, $type = '')
{
$this->union->addQuery($query, $type);
return $this;
} | [
"public",
"function",
"union",
"(",
"self",
"$",
"query",
",",
"$",
"type",
"=",
"''",
")",
"{",
"$",
"this",
"->",
"union",
"->",
"addQuery",
"(",
"$",
"query",
",",
"$",
"type",
")",
";",
"return",
"$",
"this",
";",
"}"
] | Unions another select query with this query.
@param SelectQuery $query
@param string $type optional union type
@return self | [
"Unions",
"another",
"select",
"query",
"with",
"this",
"query",
"."
] | 04a853b530fcc12a9863349d3d0da6377d1b9995 | https://github.com/jaredtking/jaqb/blob/04a853b530fcc12a9863349d3d0da6377d1b9995/src/Query/SelectQuery.php#L212-L217 |
11,948 | open-orchestra/open-orchestra-media-file-bundle | MediaFileBundle/Controller/MediaController.php | MediaController.getAction | public function getAction($key)
{
$mediaStorageManager = $this->get('open_orchestra_media_file.manager.storage');
$fileContent = $mediaStorageManager->getFileContent($key);
$finfo = finfo_open(FILEINFO_MIME);
$mimetype = finfo_buffer($finfo, $fileContent);
finfo_close($finfo... | php | public function getAction($key)
{
$mediaStorageManager = $this->get('open_orchestra_media_file.manager.storage');
$fileContent = $mediaStorageManager->getFileContent($key);
$finfo = finfo_open(FILEINFO_MIME);
$mimetype = finfo_buffer($finfo, $fileContent);
finfo_close($finfo... | [
"public",
"function",
"getAction",
"(",
"$",
"key",
")",
"{",
"$",
"mediaStorageManager",
"=",
"$",
"this",
"->",
"get",
"(",
"'open_orchestra_media_file.manager.storage'",
")",
";",
"$",
"fileContent",
"=",
"$",
"mediaStorageManager",
"->",
"getFileContent",
"(",... | Send a media stored via the UploadedFileManager
@Config\Route("/{key}", name="open_orchestra_media_get")
@Config\Method({"GET"})
@return Response | [
"Send",
"a",
"media",
"stored",
"via",
"the",
"UploadedFileManager"
] | fa3d2c5332182236937e204fa74e84fefa077204 | https://github.com/open-orchestra/open-orchestra-media-file-bundle/blob/fa3d2c5332182236937e204fa74e84fefa077204/MediaFileBundle/Controller/MediaController.php#L22-L42 |
11,949 | jnjxp/html | src/Helper/Modal.php | Modal.resetProperties | protected function resetProperties()
{
$this->effect = 'fade';
$this->titleTag = 'h4';
$this->button = [];
$this->attr = [];
$this->title = null;
$this->body = null;
$this->footer = null;
$this->html = '';
} | php | protected function resetProperties()
{
$this->effect = 'fade';
$this->titleTag = 'h4';
$this->button = [];
$this->attr = [];
$this->title = null;
$this->body = null;
$this->footer = null;
$this->html = '';
} | [
"protected",
"function",
"resetProperties",
"(",
")",
"{",
"$",
"this",
"->",
"effect",
"=",
"'fade'",
";",
"$",
"this",
"->",
"titleTag",
"=",
"'h4'",
";",
"$",
"this",
"->",
"button",
"=",
"[",
"]",
";",
"$",
"this",
"->",
"attr",
"=",
"[",
"]",
... | reset properties of modal
@return void
@access protected | [
"reset",
"properties",
"of",
"modal"
] | a38f130c19ab0a60ea52bc1d2560a68d2048d292 | https://github.com/jnjxp/html/blob/a38f130c19ab0a60ea52bc1d2560a68d2048d292/src/Helper/Modal.php#L185-L195 |
11,950 | jnjxp/html | src/Helper/Modal.php | Modal.buildButton | protected function buildButton()
{
list($content, $attr) = $this->button;
$mid = $this->attr['id'];
$attr = $this->escaper->attr(
array_merge_recursive(
$attr,
[
'type' => 'button',
'data-toggle' => ... | php | protected function buildButton()
{
list($content, $attr) = $this->button;
$mid = $this->attr['id'];
$attr = $this->escaper->attr(
array_merge_recursive(
$attr,
[
'type' => 'button',
'data-toggle' => ... | [
"protected",
"function",
"buildButton",
"(",
")",
"{",
"list",
"(",
"$",
"content",
",",
"$",
"attr",
")",
"=",
"$",
"this",
"->",
"button",
";",
"$",
"mid",
"=",
"$",
"this",
"->",
"attr",
"[",
"'id'",
"]",
";",
"$",
"attr",
"=",
"$",
"this",
... | build modal launch button
@return void
@access protected | [
"build",
"modal",
"launch",
"button"
] | a38f130c19ab0a60ea52bc1d2560a68d2048d292 | https://github.com/jnjxp/html/blob/a38f130c19ab0a60ea52bc1d2560a68d2048d292/src/Helper/Modal.php#L204-L224 |
11,951 | jnjxp/html | src/Helper/Modal.php | Modal.buildHeader | protected function buildHeader()
{
$close = '<button type="button" class="close" data-dismiss="modal" '
. 'aria-label="Close"><span aria-hidden="true">×</span></button>';
$tag = $this->titleTag;
$tid = $this->attr['id'] . '-label';
$ttl = $this->title;
$t... | php | protected function buildHeader()
{
$close = '<button type="button" class="close" data-dismiss="modal" '
. 'aria-label="Close"><span aria-hidden="true">×</span></button>';
$tag = $this->titleTag;
$tid = $this->attr['id'] . '-label';
$ttl = $this->title;
$t... | [
"protected",
"function",
"buildHeader",
"(",
")",
"{",
"$",
"close",
"=",
"'<button type=\"button\" class=\"close\" data-dismiss=\"modal\" '",
".",
"'aria-label=\"Close\"><span aria-hidden=\"true\">×</span></button>'",
";",
"$",
"tag",
"=",
"$",
"this",
"->",
"titleTag",
... | build modal header
@return void
@access protected | [
"build",
"modal",
"header"
] | a38f130c19ab0a60ea52bc1d2560a68d2048d292 | https://github.com/jnjxp/html/blob/a38f130c19ab0a60ea52bc1d2560a68d2048d292/src/Helper/Modal.php#L233-L249 |
11,952 | jnjxp/html | src/Helper/Modal.php | Modal.buildBody | protected function buildBody()
{
$this->html .= $this->indent(3, '<div class="modal-body">');
$this->html .= $this->indent(4, $this->body);
$this->html .= $this->indent(3, '</div>');
} | php | protected function buildBody()
{
$this->html .= $this->indent(3, '<div class="modal-body">');
$this->html .= $this->indent(4, $this->body);
$this->html .= $this->indent(3, '</div>');
} | [
"protected",
"function",
"buildBody",
"(",
")",
"{",
"$",
"this",
"->",
"html",
".=",
"$",
"this",
"->",
"indent",
"(",
"3",
",",
"'<div class=\"modal-body\">'",
")",
";",
"$",
"this",
"->",
"html",
".=",
"$",
"this",
"->",
"indent",
"(",
"4",
",",
"... | build modal body
@return void
@access protected | [
"build",
"modal",
"body"
] | a38f130c19ab0a60ea52bc1d2560a68d2048d292 | https://github.com/jnjxp/html/blob/a38f130c19ab0a60ea52bc1d2560a68d2048d292/src/Helper/Modal.php#L258-L263 |
11,953 | jnjxp/html | src/Helper/Modal.php | Modal.buildFooter | protected function buildFooter()
{
if (! $this->footer) {
return;
}
$this->html .= $this->indent(3, '<div class="modal-footer">');
$this->html .= $this->indent(4, $this->footer);
$this->html .= $this->indent(3, '</div>');
} | php | protected function buildFooter()
{
if (! $this->footer) {
return;
}
$this->html .= $this->indent(3, '<div class="modal-footer">');
$this->html .= $this->indent(4, $this->footer);
$this->html .= $this->indent(3, '</div>');
} | [
"protected",
"function",
"buildFooter",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"footer",
")",
"{",
"return",
";",
"}",
"$",
"this",
"->",
"html",
".=",
"$",
"this",
"->",
"indent",
"(",
"3",
",",
"'<div class=\"modal-footer\">'",
")",
";",
... | build modal footer if set
@return void
@access protected | [
"build",
"modal",
"footer",
"if",
"set"
] | a38f130c19ab0a60ea52bc1d2560a68d2048d292 | https://github.com/jnjxp/html/blob/a38f130c19ab0a60ea52bc1d2560a68d2048d292/src/Helper/Modal.php#L272-L281 |
11,954 | jnjxp/html | src/Helper/Modal.php | Modal.setButton | public function setButton($content, array $attr = [])
{
if (is_array($content)) {
$attr = $content[1];
$content = $content[0];
}
$this->button = [
$content, $attr
];
return $this;
} | php | public function setButton($content, array $attr = [])
{
if (is_array($content)) {
$attr = $content[1];
$content = $content[0];
}
$this->button = [
$content, $attr
];
return $this;
} | [
"public",
"function",
"setButton",
"(",
"$",
"content",
",",
"array",
"$",
"attr",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"content",
")",
")",
"{",
"$",
"attr",
"=",
"$",
"content",
"[",
"1",
"]",
";",
"$",
"content",
"=",
"$... | set button properties
@param string $content content of button
@param array $attr button attributes
@return Modal
@access public | [
"set",
"button",
"properties"
] | a38f130c19ab0a60ea52bc1d2560a68d2048d292 | https://github.com/jnjxp/html/blob/a38f130c19ab0a60ea52bc1d2560a68d2048d292/src/Helper/Modal.php#L368-L380 |
11,955 | jnjxp/html | src/Helper/Modal.php | Modal.setSpec | public function setSpec(array $spec)
{
foreach ($spec as $key => $value) {
$method = 'set' . ucfirst($key);
if (method_exists($this, $method)) {
$this->$method($value);
}
}
return $this;
} | php | public function setSpec(array $spec)
{
foreach ($spec as $key => $value) {
$method = 'set' . ucfirst($key);
if (method_exists($this, $method)) {
$this->$method($value);
}
}
return $this;
} | [
"public",
"function",
"setSpec",
"(",
"array",
"$",
"spec",
")",
"{",
"foreach",
"(",
"$",
"spec",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"$",
"method",
"=",
"'set'",
".",
"ucfirst",
"(",
"$",
"key",
")",
";",
"if",
"(",
"method_exists",
... | set modal specs. Call setters based on array.
@param array $spec array specification
@return Modal
@access public | [
"set",
"modal",
"specs",
".",
"Call",
"setters",
"based",
"on",
"array",
"."
] | a38f130c19ab0a60ea52bc1d2560a68d2048d292 | https://github.com/jnjxp/html/blob/a38f130c19ab0a60ea52bc1d2560a68d2048d292/src/Helper/Modal.php#L409-L418 |
11,956 | phower/container | src/ContainerFactory.php | ContainerFactory.create | public static function create(array $config = [])
{
$container = new Container();
foreach (self::$booleanSetters as $key => $method) {
if (isset($config[$key])) {
$container->$method((bool) $config[$key]);
}
}
foreach (self::$arraySetters as ... | php | public static function create(array $config = [])
{
$container = new Container();
foreach (self::$booleanSetters as $key => $method) {
if (isset($config[$key])) {
$container->$method((bool) $config[$key]);
}
}
foreach (self::$arraySetters as ... | [
"public",
"static",
"function",
"create",
"(",
"array",
"$",
"config",
"=",
"[",
"]",
")",
"{",
"$",
"container",
"=",
"new",
"Container",
"(",
")",
";",
"foreach",
"(",
"self",
"::",
"$",
"booleanSetters",
"as",
"$",
"key",
"=>",
"$",
"method",
")",... | Static factory method to create a new container
@param array $config
@return \Phower\Container\Container | [
"Static",
"factory",
"method",
"to",
"create",
"a",
"new",
"container"
] | 25326726ddbac9f382e1a56b68e0f54483bbd392 | https://github.com/phower/container/blob/25326726ddbac9f382e1a56b68e0f54483bbd392/src/ContainerFactory.php#L74-L97 |
11,957 | phower/container | src/ContainerFactory.php | ContainerFactory.createEntries | protected static function createEntries(Container $container, array $entries)
{
$defaultShared = $container->isSharedByDefault();
foreach ($entries as $entry) {
foreach (self::$requiredEntryKeys as $key) {
if (!isset($entry[$key])) {
$message = sprint... | php | protected static function createEntries(Container $container, array $entries)
{
$defaultShared = $container->isSharedByDefault();
foreach ($entries as $entry) {
foreach (self::$requiredEntryKeys as $key) {
if (!isset($entry[$key])) {
$message = sprint... | [
"protected",
"static",
"function",
"createEntries",
"(",
"Container",
"$",
"container",
",",
"array",
"$",
"entries",
")",
"{",
"$",
"defaultShared",
"=",
"$",
"container",
"->",
"isSharedByDefault",
"(",
")",
";",
"foreach",
"(",
"$",
"entries",
"as",
"$",
... | Create entries.
@param \Phower\Container\Container $container
@param array $entries
@throws Exception\InvalidArgumentException | [
"Create",
"entries",
"."
] | 25326726ddbac9f382e1a56b68e0f54483bbd392 | https://github.com/phower/container/blob/25326726ddbac9f382e1a56b68e0f54483bbd392/src/ContainerFactory.php#L106-L132 |
11,958 | colorium/runtime | src/Colorium/Runtime/Annotation.php | Annotation.parser | public static function parser(ParserInterface $parser = null)
{
if($parser) {
static::$parser = $parser;
}
elseif(!static::$parser) {
static::$parser = new Annotation\KeyValuePairParser;
}
return static::$parser;
} | php | public static function parser(ParserInterface $parser = null)
{
if($parser) {
static::$parser = $parser;
}
elseif(!static::$parser) {
static::$parser = new Annotation\KeyValuePairParser;
}
return static::$parser;
} | [
"public",
"static",
"function",
"parser",
"(",
"ParserInterface",
"$",
"parser",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"parser",
")",
"{",
"static",
"::",
"$",
"parser",
"=",
"$",
"parser",
";",
"}",
"elseif",
"(",
"!",
"static",
"::",
"$",
"parser"... | Load annotation parser
@param ParserInterface $parser
@return ParserInterface | [
"Load",
"annotation",
"parser"
] | 8905bb7370aa6aa5c89494aa020a2922d8feb32d | https://github.com/colorium/runtime/blob/8905bb7370aa6aa5c89494aa020a2922d8feb32d/src/Colorium/Runtime/Annotation.php#L24-L34 |
11,959 | colorium/runtime | src/Colorium/Runtime/Annotation.php | Annotation.cache | public static function cache(CacheInterface $cache = null)
{
if($cache) {
static::$cache = $cache;
}
elseif(!static::$cache) {
static::$cache = new Annotation\EphemeralCache;
}
return static::$cache;
} | php | public static function cache(CacheInterface $cache = null)
{
if($cache) {
static::$cache = $cache;
}
elseif(!static::$cache) {
static::$cache = new Annotation\EphemeralCache;
}
return static::$cache;
} | [
"public",
"static",
"function",
"cache",
"(",
"CacheInterface",
"$",
"cache",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"cache",
")",
"{",
"static",
"::",
"$",
"cache",
"=",
"$",
"cache",
";",
"}",
"elseif",
"(",
"!",
"static",
"::",
"$",
"cache",
")"... | Load annotation cache strategy
@param CacheInterface $cache
@return CacheInterface | [
"Load",
"annotation",
"cache",
"strategy"
] | 8905bb7370aa6aa5c89494aa020a2922d8feb32d | https://github.com/colorium/runtime/blob/8905bb7370aa6aa5c89494aa020a2922d8feb32d/src/Colorium/Runtime/Annotation.php#L43-L53 |
11,960 | colorium/runtime | src/Colorium/Runtime/Annotation.php | Annotation.ofClass | public static function ofClass($class, $key = null)
{
$reflector = is_object($class) ? new \ReflectionObject($class) : new \ReflectionClass($class);
if(!static::cache()->hasClass($reflector->getName())) {
$annotations = static::parser()->parse($reflector->getDocComment());
static::cache()->storeClass($refle... | php | public static function ofClass($class, $key = null)
{
$reflector = is_object($class) ? new \ReflectionObject($class) : new \ReflectionClass($class);
if(!static::cache()->hasClass($reflector->getName())) {
$annotations = static::parser()->parse($reflector->getDocComment());
static::cache()->storeClass($refle... | [
"public",
"static",
"function",
"ofClass",
"(",
"$",
"class",
",",
"$",
"key",
"=",
"null",
")",
"{",
"$",
"reflector",
"=",
"is_object",
"(",
"$",
"class",
")",
"?",
"new",
"\\",
"ReflectionObject",
"(",
"$",
"class",
")",
":",
"new",
"\\",
"Reflect... | Parse class annotations
@param $class
@param string $key
@return array | [
"Parse",
"class",
"annotations"
] | 8905bb7370aa6aa5c89494aa020a2922d8feb32d | https://github.com/colorium/runtime/blob/8905bb7370aa6aa5c89494aa020a2922d8feb32d/src/Colorium/Runtime/Annotation.php#L63-L80 |
11,961 | osflab/view | Helper/Bootstrap/Markdown.php | Markdown.renderText | public function renderText($text, bool $escape = true): string
{
if ($escape) {
$text = $this->esc($text);
}
return (string) Container::getMarkdown()->text((string) $text);
} | php | public function renderText($text, bool $escape = true): string
{
if ($escape) {
$text = $this->esc($text);
}
return (string) Container::getMarkdown()->text((string) $text);
} | [
"public",
"function",
"renderText",
"(",
"$",
"text",
",",
"bool",
"$",
"escape",
"=",
"true",
")",
":",
"string",
"{",
"if",
"(",
"$",
"escape",
")",
"{",
"$",
"text",
"=",
"$",
"this",
"->",
"esc",
"(",
"$",
"text",
")",
";",
"}",
"return",
"... | Render text content
@param string $text
@return string | [
"Render",
"text",
"content"
] | e06601013e8ec86dc2055e000e58dffd963c78e2 | https://github.com/osflab/view/blob/e06601013e8ec86dc2055e000e58dffd963c78e2/Helper/Bootstrap/Markdown.php#L91-L97 |
11,962 | osflab/view | Helper/Bootstrap/Markdown.php | Markdown.getMetaContent | protected function getMetaContent()
{
if ($this->mdFile && !file_exists($this->mdFile)) {
throw new ArchException('Wrong markdown file [' . $this->mdFile . ']');
}
if ($this->mdFile && !$this->getContent()) {
return Container::getMarkdown()->file($this->mdFile, $this-... | php | protected function getMetaContent()
{
if ($this->mdFile && !file_exists($this->mdFile)) {
throw new ArchException('Wrong markdown file [' . $this->mdFile . ']');
}
if ($this->mdFile && !$this->getContent()) {
return Container::getMarkdown()->file($this->mdFile, $this-... | [
"protected",
"function",
"getMetaContent",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"mdFile",
"&&",
"!",
"file_exists",
"(",
"$",
"this",
"->",
"mdFile",
")",
")",
"{",
"throw",
"new",
"ArchException",
"(",
"'Wrong markdown file ['",
".",
"$",
"this",
... | If file and text, append file and text
@return type
@throws ArchException | [
"If",
"file",
"and",
"text",
"append",
"file",
"and",
"text"
] | e06601013e8ec86dc2055e000e58dffd963c78e2 | https://github.com/osflab/view/blob/e06601013e8ec86dc2055e000e58dffd963c78e2/Helper/Bootstrap/Markdown.php#L104-L121 |
11,963 | reflex-php/lockdown | src/Reflex/Lockdown/Users/Eloquent/User.php | User.has | public function has($permissions, $all = true)
{
if (! is_array($permissions)) {
$permissions = (array) $permissions;
}
$permissions= array_unique($permissions);
$filtered = [];
$usersRoles = $this->roles;
$allowed = false;
$filt... | php | public function has($permissions, $all = true)
{
if (! is_array($permissions)) {
$permissions = (array) $permissions;
}
$permissions= array_unique($permissions);
$filtered = [];
$usersRoles = $this->roles;
$allowed = false;
$filt... | [
"public",
"function",
"has",
"(",
"$",
"permissions",
",",
"$",
"all",
"=",
"true",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"permissions",
")",
")",
"{",
"$",
"permissions",
"=",
"(",
"array",
")",
"$",
"permissions",
";",
"}",
"$",
"permis... | Does the user have the permission?
@param string|array $permissions Permission to lookup
@return boolean | [
"Does",
"the",
"user",
"have",
"the",
"permission?"
] | 2798e448608eef469f2924d75013deccfd6aca44 | https://github.com/reflex-php/lockdown/blob/2798e448608eef469f2924d75013deccfd6aca44/src/Reflex/Lockdown/Users/Eloquent/User.php#L212-L232 |
11,964 | reflex-php/lockdown | src/Reflex/Lockdown/Users/Eloquent/User.php | User.give | public function give(PermissionInterface $permission, $level = 'allow')
{
$current = $this->getPermission($permission->key);
if (isset($current)) {
if ($current->level === $level) {
return true;
}
$this->remove($permission);
}
... | php | public function give(PermissionInterface $permission, $level = 'allow')
{
$current = $this->getPermission($permission->key);
if (isset($current)) {
if ($current->level === $level) {
return true;
}
$this->remove($permission);
}
... | [
"public",
"function",
"give",
"(",
"PermissionInterface",
"$",
"permission",
",",
"$",
"level",
"=",
"'allow'",
")",
"{",
"$",
"current",
"=",
"$",
"this",
"->",
"getPermission",
"(",
"$",
"permission",
"->",
"key",
")",
";",
"if",
"(",
"isset",
"(",
"... | Give a permission to the user
@param PermissionInterface $permission
@param string $level
@return boolean | [
"Give",
"a",
"permission",
"to",
"the",
"user"
] | 2798e448608eef469f2924d75013deccfd6aca44 | https://github.com/reflex-php/lockdown/blob/2798e448608eef469f2924d75013deccfd6aca44/src/Reflex/Lockdown/Users/Eloquent/User.php#L266-L281 |
11,965 | reflex-php/lockdown | src/Reflex/Lockdown/Users/Eloquent/User.php | User.remove | public function remove(PermissionInterface $permission)
{
$this->removeFromLocalCache($permission->key);
if (! is_null($this->getPermission($permission))) {
$this->permissions()
->detach($permission);
}
return true;
} | php | public function remove(PermissionInterface $permission)
{
$this->removeFromLocalCache($permission->key);
if (! is_null($this->getPermission($permission))) {
$this->permissions()
->detach($permission);
}
return true;
} | [
"public",
"function",
"remove",
"(",
"PermissionInterface",
"$",
"permission",
")",
"{",
"$",
"this",
"->",
"removeFromLocalCache",
"(",
"$",
"permission",
"->",
"key",
")",
";",
"if",
"(",
"!",
"is_null",
"(",
"$",
"this",
"->",
"getPermission",
"(",
"$",... | Remove a permission from the user
@param PermissionInterface $permission
@return boolean | [
"Remove",
"a",
"permission",
"from",
"the",
"user"
] | 2798e448608eef469f2924d75013deccfd6aca44 | https://github.com/reflex-php/lockdown/blob/2798e448608eef469f2924d75013deccfd6aca44/src/Reflex/Lockdown/Users/Eloquent/User.php#L288-L298 |
11,966 | reflex-php/lockdown | src/Reflex/Lockdown/Users/Eloquent/User.php | User.join | public function join(RoleInterface $role)
{
$this->roles()
->attach($role);
return $this->is($role);
} | php | public function join(RoleInterface $role)
{
$this->roles()
->attach($role);
return $this->is($role);
} | [
"public",
"function",
"join",
"(",
"RoleInterface",
"$",
"role",
")",
"{",
"$",
"this",
"->",
"roles",
"(",
")",
"->",
"attach",
"(",
"$",
"role",
")",
";",
"return",
"$",
"this",
"->",
"is",
"(",
"$",
"role",
")",
";",
"}"
] | Join a role
@param RoleInterface $role
@return boolean | [
"Join",
"a",
"role"
] | 2798e448608eef469f2924d75013deccfd6aca44 | https://github.com/reflex-php/lockdown/blob/2798e448608eef469f2924d75013deccfd6aca44/src/Reflex/Lockdown/Users/Eloquent/User.php#L305-L311 |
11,967 | reflex-php/lockdown | src/Reflex/Lockdown/Users/Eloquent/User.php | User.leave | public function leave(RoleInterface $role)
{
$this->roles()
->detach($role);
return $this->isnt($role);
} | php | public function leave(RoleInterface $role)
{
$this->roles()
->detach($role);
return $this->isnt($role);
} | [
"public",
"function",
"leave",
"(",
"RoleInterface",
"$",
"role",
")",
"{",
"$",
"this",
"->",
"roles",
"(",
")",
"->",
"detach",
"(",
"$",
"role",
")",
";",
"return",
"$",
"this",
"->",
"isnt",
"(",
"$",
"role",
")",
";",
"}"
] | Leave a role
@param RoleInterface $role
@return boolean | [
"Leave",
"a",
"role"
] | 2798e448608eef469f2924d75013deccfd6aca44 | https://github.com/reflex-php/lockdown/blob/2798e448608eef469f2924d75013deccfd6aca44/src/Reflex/Lockdown/Users/Eloquent/User.php#L318-L324 |
11,968 | webriq/core | module/Core/src/Grid/Core/Controller/UploadController.php | UploadController.getValidators | protected function getValidators( $types )
{
$validators = array();
if ( 'image/*' == $types )
{
$validators[] = array(
'name' => 'Zend\Validator\File\IsImage',
);
}
else if ( ! empty( $types ) && '*' !== $types && '*/*' !== $types )
... | php | protected function getValidators( $types )
{
$validators = array();
if ( 'image/*' == $types )
{
$validators[] = array(
'name' => 'Zend\Validator\File\IsImage',
);
}
else if ( ! empty( $types ) && '*' !== $types && '*/*' !== $types )
... | [
"protected",
"function",
"getValidators",
"(",
"$",
"types",
")",
"{",
"$",
"validators",
"=",
"array",
"(",
")",
";",
"if",
"(",
"'image/*'",
"==",
"$",
"types",
")",
"{",
"$",
"validators",
"[",
"]",
"=",
"array",
"(",
"'name'",
"=>",
"'Zend\\Validat... | Get mime-validators for a file
@param string $types
@return array | [
"Get",
"mime",
"-",
"validators",
"for",
"a",
"file"
] | cfeb6e8a4732561c2215ec94e736c07f9b8bc990 | https://github.com/webriq/core/blob/cfeb6e8a4732561c2215ec94e736c07f9b8bc990/module/Core/src/Grid/Core/Controller/UploadController.php#L45-L66 |
11,969 | webriq/core | module/Core/src/Grid/Core/Controller/UploadController.php | UploadController.getForm | protected function getForm( $types, $pattern )
{
$types = preg_replace( '/\s+/', '', implode( ',', (array) $types ) );
if ( '*/*' === $types )
{
$types = '*';
}
if ( empty( $types ) )
{
$label = 'mime.sets.*';
}
else if ( strs... | php | protected function getForm( $types, $pattern )
{
$types = preg_replace( '/\s+/', '', implode( ',', (array) $types ) );
if ( '*/*' === $types )
{
$types = '*';
}
if ( empty( $types ) )
{
$label = 'mime.sets.*';
}
else if ( strs... | [
"protected",
"function",
"getForm",
"(",
"$",
"types",
",",
"$",
"pattern",
")",
"{",
"$",
"types",
"=",
"preg_replace",
"(",
"'/\\s+/'",
",",
"''",
",",
"implode",
"(",
"','",
",",
"(",
"array",
")",
"$",
"types",
")",
")",
";",
"if",
"(",
"'*/*'"... | Get the upload-form
@param string|array $types
@param string $pattern
@return \Zend\Form\Form | [
"Get",
"the",
"upload",
"-",
"form"
] | cfeb6e8a4732561c2215ec94e736c07f9b8bc990 | https://github.com/webriq/core/blob/cfeb6e8a4732561c2215ec94e736c07f9b8bc990/module/Core/src/Grid/Core/Controller/UploadController.php#L75-L148 |
11,970 | jaimeeee/laravelpanel | src/LaravelPanel/controllers/PanelController.php | PanelController.formList | public function formList($entity)
{
if ($entity = Entity::fromYamlFile($entity)) {
$list = new FormList($entity);
return $list->view();
} else {
abort(404);
}
} | php | public function formList($entity)
{
if ($entity = Entity::fromYamlFile($entity)) {
$list = new FormList($entity);
return $list->view();
} else {
abort(404);
}
} | [
"public",
"function",
"formList",
"(",
"$",
"entity",
")",
"{",
"if",
"(",
"$",
"entity",
"=",
"Entity",
"::",
"fromYamlFile",
"(",
"$",
"entity",
")",
")",
"{",
"$",
"list",
"=",
"new",
"FormList",
"(",
"$",
"entity",
")",
";",
"return",
"$",
"lis... | Show an entity list.
@return \Illuminate\Http\Response | [
"Show",
"an",
"entity",
"list",
"."
] | 211599ba0be7dc5ea11af292a75d4104c41512ca | https://github.com/jaimeeee/laravelpanel/blob/211599ba0be7dc5ea11af292a75d4104c41512ca/src/LaravelPanel/controllers/PanelController.php#L41-L50 |
11,971 | jaimeeee/laravelpanel | src/LaravelPanel/controllers/PanelController.php | PanelController.create | public function create($entity, $record = null, $child = null)
{
if (!$record && !$child && ($entityObject = Entity::fromYamlFile($entity))) {
$form = new Form($entityObject, null, Session::get('errors'));
return $form->view();
} elseif (($parentEntity = Entity::fromYamlFile... | php | public function create($entity, $record = null, $child = null)
{
if (!$record && !$child && ($entityObject = Entity::fromYamlFile($entity))) {
$form = new Form($entityObject, null, Session::get('errors'));
return $form->view();
} elseif (($parentEntity = Entity::fromYamlFile... | [
"public",
"function",
"create",
"(",
"$",
"entity",
",",
"$",
"record",
"=",
"null",
",",
"$",
"child",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"record",
"&&",
"!",
"$",
"child",
"&&",
"(",
"$",
"entityObject",
"=",
"Entity",
"::",
"fromYamlFil... | Show the form to create a new record.
@return \Illuminate\Http\Response | [
"Show",
"the",
"form",
"to",
"create",
"a",
"new",
"record",
"."
] | 211599ba0be7dc5ea11af292a75d4104c41512ca | https://github.com/jaimeeee/laravelpanel/blob/211599ba0be7dc5ea11af292a75d4104c41512ca/src/LaravelPanel/controllers/PanelController.php#L70-L86 |
11,972 | jaimeeee/laravelpanel | src/LaravelPanel/controllers/PanelController.php | PanelController.publish | public function publish(Request $request, $entity, $record = null, $child = null)
{
if (!$record && !$child && ($entityObject = Entity::fromYamlFile($entity))) {
} elseif (($parentEntity = Entity::fromYamlFile($entity)) && ($entityObject = Entity::fromYamlFile($child))) {
// Get parent's... | php | public function publish(Request $request, $entity, $record = null, $child = null)
{
if (!$record && !$child && ($entityObject = Entity::fromYamlFile($entity))) {
} elseif (($parentEntity = Entity::fromYamlFile($entity)) && ($entityObject = Entity::fromYamlFile($child))) {
// Get parent's... | [
"public",
"function",
"publish",
"(",
"Request",
"$",
"request",
",",
"$",
"entity",
",",
"$",
"record",
"=",
"null",
",",
"$",
"child",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"record",
"&&",
"!",
"$",
"child",
"&&",
"(",
"$",
"entityObject",
... | Submit the new record.
@return \Illuminate\Http\Response | [
"Submit",
"the",
"new",
"record",
"."
] | 211599ba0be7dc5ea11af292a75d4104c41512ca | https://github.com/jaimeeee/laravelpanel/blob/211599ba0be7dc5ea11af292a75d4104c41512ca/src/LaravelPanel/controllers/PanelController.php#L93-L157 |
11,973 | jaimeeee/laravelpanel | src/LaravelPanel/controllers/PanelController.php | PanelController.edit | public function edit($entity, $id, $child = null, $record = null)
{
if (!$record && !$child && ($entityObject = Entity::fromYamlFile($entity))) {
// Get the record from the database, or fail if it is not found
$entityClass = $entityObject->class;
$record = $entityClass::f... | php | public function edit($entity, $id, $child = null, $record = null)
{
if (!$record && !$child && ($entityObject = Entity::fromYamlFile($entity))) {
// Get the record from the database, or fail if it is not found
$entityClass = $entityObject->class;
$record = $entityClass::f... | [
"public",
"function",
"edit",
"(",
"$",
"entity",
",",
"$",
"id",
",",
"$",
"child",
"=",
"null",
",",
"$",
"record",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"record",
"&&",
"!",
"$",
"child",
"&&",
"(",
"$",
"entityObject",
"=",
"Entity",
... | Show the form to edit a record.
@return \Illuminate\Http\Response | [
"Show",
"the",
"form",
"to",
"edit",
"a",
"record",
"."
] | 211599ba0be7dc5ea11af292a75d4104c41512ca | https://github.com/jaimeeee/laravelpanel/blob/211599ba0be7dc5ea11af292a75d4104c41512ca/src/LaravelPanel/controllers/PanelController.php#L164-L188 |
11,974 | jaimeeee/laravelpanel | src/LaravelPanel/controllers/PanelController.php | PanelController.validationRules | private function validationRules($fields, $edit = false)
{
$validationRules = [];
// Go through each field to find validation rules
foreach ($fields as $name => $options) {
if (isset($options['validate'])) {
$validationRules[$name] = $options['validate'];
... | php | private function validationRules($fields, $edit = false)
{
$validationRules = [];
// Go through each field to find validation rules
foreach ($fields as $name => $options) {
if (isset($options['validate'])) {
$validationRules[$name] = $options['validate'];
... | [
"private",
"function",
"validationRules",
"(",
"$",
"fields",
",",
"$",
"edit",
"=",
"false",
")",
"{",
"$",
"validationRules",
"=",
"[",
"]",
";",
"// Go through each field to find validation rules",
"foreach",
"(",
"$",
"fields",
"as",
"$",
"name",
"=>",
"$"... | Return the validation rules for each field.
@param array $fields Array of fields
@param bool $edit If it needs to read additional rules at edit
@return string | [
"Return",
"the",
"validation",
"rules",
"for",
"each",
"field",
"."
] | 211599ba0be7dc5ea11af292a75d4104c41512ca | https://github.com/jaimeeee/laravelpanel/blob/211599ba0be7dc5ea11af292a75d4104c41512ca/src/LaravelPanel/controllers/PanelController.php#L295-L323 |
11,975 | phPoirot/Events | Event.php | Event.setName | function setName($name)
{
if ($this->name !== null)
throw new \Exception(sprintf(
"Event with name (%s) are immutable. can`t set name (%s)."
, $this->name, \Poirot\Std\flatten($name)
));
$this->name = (string) $name;
return $this;
... | php | function setName($name)
{
if ($this->name !== null)
throw new \Exception(sprintf(
"Event with name (%s) are immutable. can`t set name (%s)."
, $this->name, \Poirot\Std\flatten($name)
));
$this->name = (string) $name;
return $this;
... | [
"function",
"setName",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"name",
"!==",
"null",
")",
"throw",
"new",
"\\",
"Exception",
"(",
"sprintf",
"(",
"\"Event with name (%s) are immutable. can`t set name (%s).\"",
",",
"$",
"this",
"->",
"name",... | Set Events Entitle Name
- Events name are immutable
@param string $name
@throws \Exception
@return $this | [
"Set",
"Events",
"Entitle",
"Name"
] | d8a6b08a11b356999286e841e04b7580a826bd5b | https://github.com/phPoirot/Events/blob/d8a6b08a11b356999286e841e04b7580a826bd5b/Event.php#L108-L118 |
11,976 | phPoirot/Events | Event.php | Event.getName | function getName()
{
if ($this->name == '' || $this->name === null) {
$name = str_replace('\\', '.', get_class($this));
$this->setName($name);
}
return $this->name;
} | php | function getName()
{
if ($this->name == '' || $this->name === null) {
$name = str_replace('\\', '.', get_class($this));
$this->setName($name);
}
return $this->name;
} | [
"function",
"getName",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"name",
"==",
"''",
"||",
"$",
"this",
"->",
"name",
"===",
"null",
")",
"{",
"$",
"name",
"=",
"str_replace",
"(",
"'\\\\'",
",",
"'.'",
",",
"get_class",
"(",
"$",
"this",
")",... | Event Entitle Name
!! default name for events that has no name yet:
\App\Event\Mvc\Dispatch -> App.Event.Mvc.Dispatch
class -> name
@return string | [
"Event",
"Entitle",
"Name"
] | d8a6b08a11b356999286e841e04b7580a826bd5b | https://github.com/phPoirot/Events/blob/d8a6b08a11b356999286e841e04b7580a826bd5b/Event.php#L129-L137 |
11,977 | phPoirot/Events | Event.php | Event.collector | function collector($options = null)
{
if (! $this->collector )
$this->collector = new DataCollector;
if (null !== $options) {
$this->collector->import($options);
return $this;
}
return $this->collector;
} | php | function collector($options = null)
{
if (! $this->collector )
$this->collector = new DataCollector;
if (null !== $options) {
$this->collector->import($options);
return $this;
}
return $this->collector;
} | [
"function",
"collector",
"(",
"$",
"options",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"collector",
")",
"$",
"this",
"->",
"collector",
"=",
"new",
"DataCollector",
";",
"if",
"(",
"null",
"!==",
"$",
"options",
")",
"{",
"$",
"th... | Events Result Collector
- collector(['key_as_option' => $value])
@param null|array|\Traversable $options
@return DataCollector|$this | [
"Events",
"Result",
"Collector"
] | d8a6b08a11b356999286e841e04b7580a826bd5b | https://github.com/phPoirot/Events/blob/d8a6b08a11b356999286e841e04b7580a826bd5b/Event.php#L161-L172 |
11,978 | phPoirot/Events | Event.php | Event.emit | function emit($dataMerge = null, $meeter = null)
{
# Prepare given arguments:
if ($dataMerge instanceof iMeeter) {
$meeter = $dataMerge;
$dataMerge = null;
}
$Event = clone $this;
$Collector = $Event->collector();
if ($dataMerge !== null)
... | php | function emit($dataMerge = null, $meeter = null)
{
# Prepare given arguments:
if ($dataMerge instanceof iMeeter) {
$meeter = $dataMerge;
$dataMerge = null;
}
$Event = clone $this;
$Collector = $Event->collector();
if ($dataMerge !== null)
... | [
"function",
"emit",
"(",
"$",
"dataMerge",
"=",
"null",
",",
"$",
"meeter",
"=",
"null",
")",
"{",
"# Prepare given arguments:",
"if",
"(",
"$",
"dataMerge",
"instanceof",
"iMeeter",
")",
"{",
"$",
"meeter",
"=",
"$",
"dataMerge",
";",
"$",
"dataMerge",
... | Trigger Listeners Within Events
- reset propagation value
- iterate over listeners priority and fire actions
- readable props of this event can resolved as listener
arguments.
- this event can be resolved to listener as $e or $event __invoke($e)
- implement to know last emitted listener
note: collecting listeners res... | [
"Trigger",
"Listeners",
"Within",
"Events"
] | d8a6b08a11b356999286e841e04b7580a826bd5b | https://github.com/phPoirot/Events/blob/d8a6b08a11b356999286e841e04b7580a826bd5b/Event.php#L196-L254 |
11,979 | phPoirot/Events | Event.php | Event.attachListener | function attachListener($listener, $name = null, $priority = 10)
{
if ($priority == null)
$priority = 10;
if ($this->_tmp__isEmiting)
throw new \RuntimeException('Can`t Attach Listener While Emit Events.');
if ( is_int($name) ) {
## listener without spec... | php | function attachListener($listener, $name = null, $priority = 10)
{
if ($priority == null)
$priority = 10;
if ($this->_tmp__isEmiting)
throw new \RuntimeException('Can`t Attach Listener While Emit Events.');
if ( is_int($name) ) {
## listener without spec... | [
"function",
"attachListener",
"(",
"$",
"listener",
",",
"$",
"name",
"=",
"null",
",",
"$",
"priority",
"=",
"10",
")",
"{",
"if",
"(",
"$",
"priority",
"==",
"null",
")",
"$",
"priority",
"=",
"10",
";",
"if",
"(",
"$",
"this",
"->",
"_tmp__isEmi... | Attach Listener To This Events
[code:]
attachListener($listener, $priority)
attachListener($listener, $nameOverride, $priority)
[code]
- store attached listener so we can list theme back
- listener with same name ({$name}) not allowed
- can`t Attach Listener While Emit Events
@param callable $listener
@param int ... | [
"Attach",
"Listener",
"To",
"This",
"Events"
] | d8a6b08a11b356999286e841e04b7580a826bd5b | https://github.com/phPoirot/Events/blob/d8a6b08a11b356999286e841e04b7580a826bd5b/Event.php#L341-L371 |
11,980 | phPoirot/Events | Event.php | Event.findListener | function findListener($listener)
{
if (is_string($listener))
return (isset($this->_c_listeners[$listener])) ? $this->_c_listeners[$listener] : false;
elseif (is_object($listener)) {
foreach (clone $this->_listenerQueue() as $l) {
if ($l === $listener)
... | php | function findListener($listener)
{
if (is_string($listener))
return (isset($this->_c_listeners[$listener])) ? $this->_c_listeners[$listener] : false;
elseif (is_object($listener)) {
foreach (clone $this->_listenerQueue() as $l) {
if ($l === $listener)
... | [
"function",
"findListener",
"(",
"$",
"listener",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"listener",
")",
")",
"return",
"(",
"isset",
"(",
"$",
"this",
"->",
"_c_listeners",
"[",
"$",
"listener",
"]",
")",
")",
"?",
"$",
"this",
"->",
"_c_liste... | Find For Listener with name or object
@param iListener|string $listener
@throws \InvalidArgumentException
@return iListener|false | [
"Find",
"For",
"Listener",
"with",
"name",
"or",
"object"
] | d8a6b08a11b356999286e841e04b7580a826bd5b | https://github.com/phPoirot/Events/blob/d8a6b08a11b356999286e841e04b7580a826bd5b/Event.php#L381-L393 |
11,981 | phPoirot/Events | Event.php | Event.detachListener | function detachListener(iListener $listener)
{
$this->_listenerQueue()->del($listener);
if (in_array($listener, $this->_c_listeners)) {
foreach ($this->_c_listeners as $k => $l) {
if ($l === $listener) {
unset($this->_c_listeners[$k]);
... | php | function detachListener(iListener $listener)
{
$this->_listenerQueue()->del($listener);
if (in_array($listener, $this->_c_listeners)) {
foreach ($this->_c_listeners as $k => $l) {
if ($l === $listener) {
unset($this->_c_listeners[$k]);
... | [
"function",
"detachListener",
"(",
"iListener",
"$",
"listener",
")",
"{",
"$",
"this",
"->",
"_listenerQueue",
"(",
")",
"->",
"del",
"(",
"$",
"listener",
")",
";",
"if",
"(",
"in_array",
"(",
"$",
"listener",
",",
"$",
"this",
"->",
"_c_listeners",
... | Detach A Listener From List
- to detach by name you have to findListener() first
@param iListener $listener
@return $this | [
"Detach",
"A",
"Listener",
"From",
"List"
] | d8a6b08a11b356999286e841e04b7580a826bd5b | https://github.com/phPoirot/Events/blob/d8a6b08a11b356999286e841e04b7580a826bd5b/Event.php#L404-L418 |
11,982 | chigix/php-io-component | src/OutputStream.php | OutputStream.write | public function write($content) {
if (is_string($content) || is_numeric($content)) {
$this->writeString($content);
} elseif (is_bool($content)) {
$this->writeString($content ? "TRUE" : "FALSE");
} elseif (is_array($content)) {
$this->writeString("Array(" . cou... | php | public function write($content) {
if (is_string($content) || is_numeric($content)) {
$this->writeString($content);
} elseif (is_bool($content)) {
$this->writeString($content ? "TRUE" : "FALSE");
} elseif (is_array($content)) {
$this->writeString("Array(" . cou... | [
"public",
"function",
"write",
"(",
"$",
"content",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"content",
")",
"||",
"is_numeric",
"(",
"$",
"content",
")",
")",
"{",
"$",
"this",
"->",
"writeString",
"(",
"$",
"content",
")",
";",
"}",
"elseif",
... | Writes The provided content to this output stream.
@param mixed $content
@throws InvalidContentException | [
"Writes",
"The",
"provided",
"content",
"to",
"this",
"output",
"stream",
"."
] | 0b24f18c62089e0a21181e34238cf45f517ca3e0 | https://github.com/chigix/php-io-component/blob/0b24f18c62089e0a21181e34238cf45f517ca3e0/src/OutputStream.php#L40-L56 |
11,983 | silinternational/ssp-utilities | src/AuthStateUtils.php | AuthStateUtils.getSpEntityIdForMultiAuth | public static function getSpEntityIdForMultiAuth($authState)
{
//
$idParam = '?spentityid';
// remove the text up to the start of the parameter key
$paramStart = strpos($authState, $idParam);
$entityId = substr($authState, $paramStart);
// remove the parameter key... | php | public static function getSpEntityIdForMultiAuth($authState)
{
//
$idParam = '?spentityid';
// remove the text up to the start of the parameter key
$paramStart = strpos($authState, $idParam);
$entityId = substr($authState, $paramStart);
// remove the parameter key... | [
"public",
"static",
"function",
"getSpEntityIdForMultiAuth",
"(",
"$",
"authState",
")",
"{",
"//",
"$",
"idParam",
"=",
"'?spentityid'",
";",
"// remove the text up to the start of the parameter key",
"$",
"paramStart",
"=",
"strpos",
"(",
"$",
"authState",
",",
"$",... | Gets the SP entityID out of the AuthState parameter
@param string $authState | [
"Gets",
"the",
"SP",
"entityID",
"out",
"of",
"the",
"AuthState",
"parameter"
] | e8c05bd8e4688aea2960bca74b7d6aa5f9f34286 | https://github.com/silinternational/ssp-utilities/blob/e8c05bd8e4688aea2960bca74b7d6aa5f9f34286/src/AuthStateUtils.php#L13-L33 |
11,984 | Renegade334/phergie-irc-plugin-react-seen | src/Plugin.php | Plugin.ago | protected function ago($time)
{
$time = time() - $time;
if ($time < 60) {
return 'a moment ago';
}
$secs = array(
'year' => 365.25 * 24 * 60 * 60,
'month' => 30 * 24 * 60 * 60,
'week' => 7 * 24 * 60 * 60,
'day' => ... | php | protected function ago($time)
{
$time = time() - $time;
if ($time < 60) {
return 'a moment ago';
}
$secs = array(
'year' => 365.25 * 24 * 60 * 60,
'month' => 30 * 24 * 60 * 60,
'week' => 7 * 24 * 60 * 60,
'day' => ... | [
"protected",
"function",
"ago",
"(",
"$",
"time",
")",
"{",
"$",
"time",
"=",
"time",
"(",
")",
"-",
"$",
"time",
";",
"if",
"(",
"$",
"time",
"<",
"60",
")",
"{",
"return",
"'a moment ago'",
";",
"}",
"$",
"secs",
"=",
"array",
"(",
"'year'",
... | Returns a crude time ago string.
@param int $time Origin timestamp
@return string | [
"Returns",
"a",
"crude",
"time",
"ago",
"string",
"."
] | 7a6ee88a1868a510bb4c6a31b290d1753b31b8ae | https://github.com/Renegade334/phergie-irc-plugin-react-seen/blob/7a6ee88a1868a510bb4c6a31b290d1753b31b8ae/src/Plugin.php#L69-L94 |
11,985 | Renegade334/phergie-irc-plugin-react-seen | src/Plugin.php | Plugin.isInChannel | protected function isInChannel($server, $channel, $user)
{
if (!isset($this->channels[$server][$channel]))
{
return false;
}
$names = array_keys($this->channels[$server][$channel], true, true);
foreach ($names as $name) {
if (!strcasecmp($name, $user)... | php | protected function isInChannel($server, $channel, $user)
{
if (!isset($this->channels[$server][$channel]))
{
return false;
}
$names = array_keys($this->channels[$server][$channel], true, true);
foreach ($names as $name) {
if (!strcasecmp($name, $user)... | [
"protected",
"function",
"isInChannel",
"(",
"$",
"server",
",",
"$",
"channel",
",",
"$",
"user",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"channels",
"[",
"$",
"server",
"]",
"[",
"$",
"channel",
"]",
")",
")",
"{",
"return",
... | Checks whether a given nickname is currently on a channel.
@param string $server
@param string $channel
@param string $user (case-insensitive)
@return bool | [
"Checks",
"whether",
"a",
"given",
"nickname",
"is",
"currently",
"on",
"a",
"channel",
"."
] | 7a6ee88a1868a510bb4c6a31b290d1753b31b8ae | https://github.com/Renegade334/phergie-irc-plugin-react-seen/blob/7a6ee88a1868a510bb4c6a31b290d1753b31b8ae/src/Plugin.php#L105-L120 |
11,986 | Renegade334/phergie-irc-plugin-react-seen | src/Plugin.php | Plugin.processKick | public function processKick(UserEvent $event, Queue $queue)
{
$logger = $this->getLogger();
$server = strtolower($event->getConnection()->getServerHostname());
$params = $event->getParams();
$channel = $params['channel'];
$nick = $params['user'];
$message = isset($pa... | php | public function processKick(UserEvent $event, Queue $queue)
{
$logger = $this->getLogger();
$server = strtolower($event->getConnection()->getServerHostname());
$params = $event->getParams();
$channel = $params['channel'];
$nick = $params['user'];
$message = isset($pa... | [
"public",
"function",
"processKick",
"(",
"UserEvent",
"$",
"event",
",",
"Queue",
"$",
"queue",
")",
"{",
"$",
"logger",
"=",
"$",
"this",
"->",
"getLogger",
"(",
")",
";",
"$",
"server",
"=",
"strtolower",
"(",
"$",
"event",
"->",
"getConnection",
"(... | Monitor channel kicks.
@param \Phergie\Irc\Event\UserEventInterface $event
@param \Phergie\Irc\Bot\React\EventQueueInterface $queue | [
"Monitor",
"channel",
"kicks",
"."
] | 7a6ee88a1868a510bb4c6a31b290d1753b31b8ae | https://github.com/Renegade334/phergie-irc-plugin-react-seen/blob/7a6ee88a1868a510bb4c6a31b290d1753b31b8ae/src/Plugin.php#L427-L464 |
11,987 | Renegade334/phergie-irc-plugin-react-seen | src/Plugin.php | Plugin.processNick | public function processNick(UserEvent $event, Queue $queue)
{
$logger = $this->getLogger();
$nick = $event->getNick();
if ($nick == $event->getConnection()->getNickname()) {
$logger->debug('Nickname of incoming NICK is ours, ignoring');
return;
}
$se... | php | public function processNick(UserEvent $event, Queue $queue)
{
$logger = $this->getLogger();
$nick = $event->getNick();
if ($nick == $event->getConnection()->getNickname()) {
$logger->debug('Nickname of incoming NICK is ours, ignoring');
return;
}
$se... | [
"public",
"function",
"processNick",
"(",
"UserEvent",
"$",
"event",
",",
"Queue",
"$",
"queue",
")",
"{",
"$",
"logger",
"=",
"$",
"this",
"->",
"getLogger",
"(",
")",
";",
"$",
"nick",
"=",
"$",
"event",
"->",
"getNick",
"(",
")",
";",
"if",
"(",... | Monitor nick changes.
@param \Phergie\Irc\Event\UserEventInterface $event
@param \Phergie\Irc\Bot\React\EventQueueInterface $queue | [
"Monitor",
"nick",
"changes",
"."
] | 7a6ee88a1868a510bb4c6a31b290d1753b31b8ae | https://github.com/Renegade334/phergie-irc-plugin-react-seen/blob/7a6ee88a1868a510bb4c6a31b290d1753b31b8ae/src/Plugin.php#L524-L570 |
11,988 | Renegade334/phergie-irc-plugin-react-seen | src/Plugin.php | Plugin.processPrivmsg | public function processPrivmsg(UserEvent $event, Queue $queue)
{
$logger = $this->getLogger();
$source = $event->getSource();
$nick = $event->getNick();
if ($source === null || $nick === null || $source == $nick) {
$logger->debug('Incoming PRIVMSG not in channel, ignorin... | php | public function processPrivmsg(UserEvent $event, Queue $queue)
{
$logger = $this->getLogger();
$source = $event->getSource();
$nick = $event->getNick();
if ($source === null || $nick === null || $source == $nick) {
$logger->debug('Incoming PRIVMSG not in channel, ignorin... | [
"public",
"function",
"processPrivmsg",
"(",
"UserEvent",
"$",
"event",
",",
"Queue",
"$",
"queue",
")",
"{",
"$",
"logger",
"=",
"$",
"this",
"->",
"getLogger",
"(",
")",
";",
"$",
"source",
"=",
"$",
"event",
"->",
"getSource",
"(",
")",
";",
"$",
... | Monitor channel messages.
@param \Phergie\Irc\Event\UserEventInterface $event
@param \Phergie\Irc\Bot\React\EventQueueInterface $queue | [
"Monitor",
"channel",
"messages",
"."
] | 7a6ee88a1868a510bb4c6a31b290d1753b31b8ae | https://github.com/Renegade334/phergie-irc-plugin-react-seen/blob/7a6ee88a1868a510bb4c6a31b290d1753b31b8ae/src/Plugin.php#L578-L613 |
11,989 | Renegade334/phergie-irc-plugin-react-seen | src/Plugin.php | Plugin.processAction | public function processAction(CtcpEvent $event, Queue $queue)
{
$logger = $this->getLogger();
$source = $event->getSource();
$nick = $event->getNick();
if ($source === null || $nick === null || $source == $nick) {
$logger->debug('Incoming CTCP ACTION not in channel, igno... | php | public function processAction(CtcpEvent $event, Queue $queue)
{
$logger = $this->getLogger();
$source = $event->getSource();
$nick = $event->getNick();
if ($source === null || $nick === null || $source == $nick) {
$logger->debug('Incoming CTCP ACTION not in channel, igno... | [
"public",
"function",
"processAction",
"(",
"CtcpEvent",
"$",
"event",
",",
"Queue",
"$",
"queue",
")",
"{",
"$",
"logger",
"=",
"$",
"this",
"->",
"getLogger",
"(",
")",
";",
"$",
"source",
"=",
"$",
"event",
"->",
"getSource",
"(",
")",
";",
"$",
... | Monitor channel actions.
@param \Phergie\Irc\Event\CtcpEventInterface $event
@param \Phergie\Irc\Bot\React\EventQueueInterface $queue | [
"Monitor",
"channel",
"actions",
"."
] | 7a6ee88a1868a510bb4c6a31b290d1753b31b8ae | https://github.com/Renegade334/phergie-irc-plugin-react-seen/blob/7a6ee88a1868a510bb4c6a31b290d1753b31b8ae/src/Plugin.php#L664-L699 |
11,990 | Renegade334/phergie-irc-plugin-react-seen | src/Plugin.php | Plugin.processNames | public function processNames(ServerEvent $event, Queue $queue)
{
$special = '\[\]\\`_\^\{\|\}';
$server = strtolower($event->getConnection()->getServerHostname());
$params = array_slice($event->getParams(), 2);
$channel = array_shift($params);
$this->getLogger()->debug('Add... | php | public function processNames(ServerEvent $event, Queue $queue)
{
$special = '\[\]\\`_\^\{\|\}';
$server = strtolower($event->getConnection()->getServerHostname());
$params = array_slice($event->getParams(), 2);
$channel = array_shift($params);
$this->getLogger()->debug('Add... | [
"public",
"function",
"processNames",
"(",
"ServerEvent",
"$",
"event",
",",
"Queue",
"$",
"queue",
")",
"{",
"$",
"special",
"=",
"'\\[\\]\\\\`_\\^\\{\\|\\}'",
";",
"$",
"server",
"=",
"strtolower",
"(",
"$",
"event",
"->",
"getConnection",
"(",
")",
"->",
... | Populate channels with names on join.
@param \Phergie\Irc\Event\ServerEventInterface $event
@param \Phergie\Irc\Bot\React\EventQueueInterface $queue | [
"Populate",
"channels",
"with",
"names",
"on",
"join",
"."
] | 7a6ee88a1868a510bb4c6a31b290d1753b31b8ae | https://github.com/Renegade334/phergie-irc-plugin-react-seen/blob/7a6ee88a1868a510bb4c6a31b290d1753b31b8ae/src/Plugin.php#L707-L725 |
11,991 | maoberlehner/cultusrego | src/cultusrego.php | cultusrego.render | public function render() {
// Initialize Markdown and Twig
$engine = new MarkdownEngine\MichelfMarkdownEngine();
$twig_loader = new Twig_Loader_Filesystem($this->template_folder);
$twig = new Twig_Environment($twig_loader, array(
'cache' => $this->twig_cache,
));
$twig->addExtension(new Ma... | php | public function render() {
// Initialize Markdown and Twig
$engine = new MarkdownEngine\MichelfMarkdownEngine();
$twig_loader = new Twig_Loader_Filesystem($this->template_folder);
$twig = new Twig_Environment($twig_loader, array(
'cache' => $this->twig_cache,
));
$twig->addExtension(new Ma... | [
"public",
"function",
"render",
"(",
")",
"{",
"// Initialize Markdown and Twig",
"$",
"engine",
"=",
"new",
"MarkdownEngine",
"\\",
"MichelfMarkdownEngine",
"(",
")",
";",
"$",
"twig_loader",
"=",
"new",
"Twig_Loader_Filesystem",
"(",
"$",
"this",
"->",
"template... | Loads Markdown and Twig engines and renders the styleguide
@return rendered HTML | [
"Loads",
"Markdown",
"and",
"Twig",
"engines",
"and",
"renders",
"the",
"styleguide"
] | 60f77a9590a1dfb605b2ca630ab0ca10e023f3ff | https://github.com/maoberlehner/cultusrego/blob/60f77a9590a1dfb605b2ca630ab0ca10e023f3ff/src/cultusrego.php#L51-L68 |
11,992 | maoberlehner/cultusrego | src/cultusrego.php | cultusrego.find_sections | private function find_sections() {
$sections = array();
$level_memory = array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
$last_section = FALSE;
// Match multiline comments
preg_match_all('#\/\*((?:(?!\*\/).)*)\*\/#s', $this->code, $matches);
foreach ($matches[1] as $match) {
$section = array();
... | php | private function find_sections() {
$sections = array();
$level_memory = array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
$last_section = FALSE;
// Match multiline comments
preg_match_all('#\/\*((?:(?!\*\/).)*)\*\/#s', $this->code, $matches);
foreach ($matches[1] as $match) {
$section = array();
... | [
"private",
"function",
"find_sections",
"(",
")",
"{",
"$",
"sections",
"=",
"array",
"(",
")",
";",
"$",
"level_memory",
"=",
"array",
"(",
"0",
",",
"0",
",",
"0",
",",
"0",
",",
"0",
",",
"0",
",",
"0",
",",
"0",
",",
"0",
",",
"0",
")",
... | Parse the provided code for valid styleguide sections | [
"Parse",
"the",
"provided",
"code",
"for",
"valid",
"styleguide",
"sections"
] | 60f77a9590a1dfb605b2ca630ab0ca10e023f3ff | https://github.com/maoberlehner/cultusrego/blob/60f77a9590a1dfb605b2ca630ab0ca10e023f3ff/src/cultusrego.php#L73-L132 |
11,993 | maoberlehner/cultusrego | src/cultusrego.php | cultusrego.build_section_tree | private function build_section_tree($sections) {
$level_tree = array();
foreach ($sections as $level => $section) {
// array_filter removes the last, empty value
// from the level array that is created by the explode function
$level_depth_arr = array_filter(explode('.', $level));
$leve... | php | private function build_section_tree($sections) {
$level_tree = array();
foreach ($sections as $level => $section) {
// array_filter removes the last, empty value
// from the level array that is created by the explode function
$level_depth_arr = array_filter(explode('.', $level));
$leve... | [
"private",
"function",
"build_section_tree",
"(",
"$",
"sections",
")",
"{",
"$",
"level_tree",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"sections",
"as",
"$",
"level",
"=>",
"$",
"section",
")",
"{",
"// array_filter removes the last, empty value",
"... | Build a nested array according to the section levels
@param array $sections | [
"Build",
"a",
"nested",
"array",
"according",
"to",
"the",
"section",
"levels"
] | 60f77a9590a1dfb605b2ca630ab0ca10e023f3ff | https://github.com/maoberlehner/cultusrego/blob/60f77a9590a1dfb605b2ca630ab0ca10e023f3ff/src/cultusrego.php#L138-L163 |
11,994 | maoberlehner/cultusrego | src/cultusrego.php | cultusrego.build_section_sub_tree | private function build_section_sub_tree($main_tree, $tree_level, $section_level) {
$sub_sections = array();
if (isset($main_tree[$tree_level]) && isset($main_tree[$tree_level][$section_level])) {
$sub_sections = $main_tree[$tree_level][$section_level];
$sub_tree_level = $tree_level + 1;
foreac... | php | private function build_section_sub_tree($main_tree, $tree_level, $section_level) {
$sub_sections = array();
if (isset($main_tree[$tree_level]) && isset($main_tree[$tree_level][$section_level])) {
$sub_sections = $main_tree[$tree_level][$section_level];
$sub_tree_level = $tree_level + 1;
foreac... | [
"private",
"function",
"build_section_sub_tree",
"(",
"$",
"main_tree",
",",
"$",
"tree_level",
",",
"$",
"section_level",
")",
"{",
"$",
"sub_sections",
"=",
"array",
"(",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"main_tree",
"[",
"$",
"tree_level",
"]",
... | Build an array of sub sections for the given section
@param array $main_tree
@param integer $tree_level
@param string $section_level
@return array Sub sections for the given section | [
"Build",
"an",
"array",
"of",
"sub",
"sections",
"for",
"the",
"given",
"section"
] | 60f77a9590a1dfb605b2ca630ab0ca10e023f3ff | https://github.com/maoberlehner/cultusrego/blob/60f77a9590a1dfb605b2ca630ab0ca10e023f3ff/src/cultusrego.php#L172-L182 |
11,995 | maoberlehner/cultusrego | src/cultusrego.php | cultusrego.parse_match | private function parse_match($match) {
$match = trim($match);
$docblock = new Docblock($match);
$tags = $docblock->getTags();
$element_values = array();
if ($title = $docblock->getShortDescription()) {
// Skip text strings that start with #
// (e.g. source map comment)
if (strpos(... | php | private function parse_match($match) {
$match = trim($match);
$docblock = new Docblock($match);
$tags = $docblock->getTags();
$element_values = array();
if ($title = $docblock->getShortDescription()) {
// Skip text strings that start with #
// (e.g. source map comment)
if (strpos(... | [
"private",
"function",
"parse_match",
"(",
"$",
"match",
")",
"{",
"$",
"match",
"=",
"trim",
"(",
"$",
"match",
")",
";",
"$",
"docblock",
"=",
"new",
"Docblock",
"(",
"$",
"match",
")",
";",
"$",
"tags",
"=",
"$",
"docblock",
"->",
"getTags",
"("... | Find styleguide elements and their values in a comment section
@param string $match The contents of a matched comment section
@return array Values of the found styleguide elements | [
"Find",
"styleguide",
"elements",
"and",
"their",
"values",
"in",
"a",
"comment",
"section"
] | 60f77a9590a1dfb605b2ca630ab0ca10e023f3ff | https://github.com/maoberlehner/cultusrego/blob/60f77a9590a1dfb605b2ca630ab0ca10e023f3ff/src/cultusrego.php#L189-L265 |
11,996 | pletfix/core | src/Services/Process.php | Process.reset | private function reset()
{
// it is important that you close any pipes before calling proc_close in order to avoid a deadlock
if ($this->pipes !== null) {
foreach ($this->pipes as $pipe) {
fclose($pipe);
}
$this->pipes = null;
}
if... | php | private function reset()
{
// it is important that you close any pipes before calling proc_close in order to avoid a deadlock
if ($this->pipes !== null) {
foreach ($this->pipes as $pipe) {
fclose($pipe);
}
$this->pipes = null;
}
if... | [
"private",
"function",
"reset",
"(",
")",
"{",
"// it is important that you close any pipes before calling proc_close in order to avoid a deadlock",
"if",
"(",
"$",
"this",
"->",
"pipes",
"!==",
"null",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"pipes",
"as",
"$",
... | Reset the data. | [
"Reset",
"the",
"data",
"."
] | 974945500f278eb6c1779832e08bbfca1007a7b3 | https://github.com/pletfix/core/blob/974945500f278eb6c1779832e08bbfca1007a7b3/src/Services/Process.php#L68-L84 |
11,997 | pletfix/core | src/Services/Process.php | Process.start | public function start()
{
if ($this->isRunning()) {
throw new LogicException('Process is already running');
}
$this->reset();
$cmd = $this->cmd;
if (substr($cmd, 0, 4) == 'php ') {
$php = PHP_BINARY ?: PHP_BINDIR . '/php';
$cmd = $php . s... | php | public function start()
{
if ($this->isRunning()) {
throw new LogicException('Process is already running');
}
$this->reset();
$cmd = $this->cmd;
if (substr($cmd, 0, 4) == 'php ') {
$php = PHP_BINARY ?: PHP_BINDIR . '/php';
$cmd = $php . s... | [
"public",
"function",
"start",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isRunning",
"(",
")",
")",
"{",
"throw",
"new",
"LogicException",
"(",
"'Process is already running'",
")",
";",
"}",
"$",
"this",
"->",
"reset",
"(",
")",
";",
"$",
"cmd",
... | Starts a background process.
@throws LogicException When process is already running
@throws RuntimeException When process can't be launched | [
"Starts",
"a",
"background",
"process",
"."
] | 974945500f278eb6c1779832e08bbfca1007a7b3 | https://github.com/pletfix/core/blob/974945500f278eb6c1779832e08bbfca1007a7b3/src/Services/Process.php#L109-L139 |
11,998 | pletfix/core | src/Services/Process.php | Process.terminate | public function terminate($signal = 15)
{
if ($this->process === null) {
return false;
}
return proc_terminate($this->process, $signal);
} | php | public function terminate($signal = 15)
{
if ($this->process === null) {
return false;
}
return proc_terminate($this->process, $signal);
} | [
"public",
"function",
"terminate",
"(",
"$",
"signal",
"=",
"15",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"process",
"===",
"null",
")",
"{",
"return",
"false",
";",
"}",
"return",
"proc_terminate",
"(",
"$",
"this",
"->",
"process",
",",
"$",
"signa... | Terminate the process.
This optional parameter is only useful on POSIX operating systems; you may specify a signal to send to the
process using the kill(2) system call. The default is SIGTERM (15).
SIGTERM (15) is the termination signal. The default behavior is to terminate the process, but it also can be
caught or i... | [
"Terminate",
"the",
"process",
"."
] | 974945500f278eb6c1779832e08bbfca1007a7b3 | https://github.com/pletfix/core/blob/974945500f278eb6c1779832e08bbfca1007a7b3/src/Services/Process.php#L175-L182 |
11,999 | pletfix/core | src/Services/Process.php | Process.write | public function write($line)
{
return $this->pipes !== null ? fwrite($this->pipes[0], $line . PHP_EOL) : false;
} | php | public function write($line)
{
return $this->pipes !== null ? fwrite($this->pipes[0], $line . PHP_EOL) : false;
} | [
"public",
"function",
"write",
"(",
"$",
"line",
")",
"{",
"return",
"$",
"this",
"->",
"pipes",
"!==",
"null",
"?",
"fwrite",
"(",
"$",
"this",
"->",
"pipes",
"[",
"0",
"]",
",",
"$",
"line",
".",
"PHP_EOL",
")",
":",
"false",
";",
"}"
] | Write a line to STDIN.
Returns the number of bytes written, or FALSE on error.
@param string $line
@return int|false | [
"Write",
"a",
"line",
"to",
"STDIN",
"."
] | 974945500f278eb6c1779832e08bbfca1007a7b3 | https://github.com/pletfix/core/blob/974945500f278eb6c1779832e08bbfca1007a7b3/src/Services/Process.php#L214-L217 |
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.