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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
225,200 | n2n/n2n-log4php | src/app/n2n/log4php/Logger.php | Logger.getHierarchy | public static function getHierarchy() {
if(!isset(self::$hierarchy)) {
self::$hierarchy = new \n2n\log4php\LoggerHierarchy(new LoggerRoot());
}
return self::$hierarchy;
} | php | public static function getHierarchy() {
if(!isset(self::$hierarchy)) {
self::$hierarchy = new \n2n\log4php\LoggerHierarchy(new LoggerRoot());
}
return self::$hierarchy;
} | [
"public",
"static",
"function",
"getHierarchy",
"(",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"self",
"::",
"$",
"hierarchy",
")",
")",
"{",
"self",
"::",
"$",
"hierarchy",
"=",
"new",
"\\",
"n2n",
"\\",
"log4php",
"\\",
"LoggerHierarchy",
"(",
"new",
... | Returns the hierarchy used by this Logger.
Caution: do not use this hierarchy unless you have called initialize().
To get Loggers, use the Logger::getLogger and Logger::getRootLogger
methods instead of operating on on the hierarchy directly.
@return \n2n\log4php\LoggerHierarchy | [
"Returns",
"the",
"hierarchy",
"used",
"by",
"this",
"Logger",
"."
] | 1e6fff4c2785acdb8c2e0c3d5451cbb7e1b51fc2 | https://github.com/n2n/n2n-log4php/blob/1e6fff4c2785acdb8c2e0c3d5451cbb7e1b51fc2/src/app/n2n/log4php/Logger.php#L450-L455 |
225,201 | n2n/n2n-log4php | src/app/n2n/log4php/Logger.php | Logger.getConfigurator | private static function getConfigurator($configurator = null) {
if ($configurator === null) {
return new \n2n\log4php\configurator\ConfiguratorDefault();
}
if (is_object($configurator)) {
if ($configurator instanceof \n2n\log4php\LoggerConfigurator) {
return $configurator;
} else {
th... | php | private static function getConfigurator($configurator = null) {
if ($configurator === null) {
return new \n2n\log4php\configurator\ConfiguratorDefault();
}
if (is_object($configurator)) {
if ($configurator instanceof \n2n\log4php\LoggerConfigurator) {
return $configurator;
} else {
th... | [
"private",
"static",
"function",
"getConfigurator",
"(",
"$",
"configurator",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"configurator",
"===",
"null",
")",
"{",
"return",
"new",
"\\",
"n2n",
"\\",
"log4php",
"\\",
"configurator",
"\\",
"ConfiguratorDefault",
"(... | Creates a logger configurator instance based on the provided
configurator class. If no class is given, returns an instance of
the default configurator.
@param string|\n2n\log4php\LoggerConfigurator $configurator The configurator class
or \n2n\log4php\LoggerConfigurator instance. | [
"Creates",
"a",
"logger",
"configurator",
"instance",
"based",
"on",
"the",
"provided",
"configurator",
"class",
".",
"If",
"no",
"class",
"is",
"given",
"returns",
"an",
"instance",
"of",
"the",
"default",
"configurator",
"."
] | 1e6fff4c2785acdb8c2e0c3d5451cbb7e1b51fc2 | https://github.com/n2n/n2n-log4php/blob/1e6fff4c2785acdb8c2e0c3d5451cbb7e1b51fc2/src/app/n2n/log4php/Logger.php#L556-L588 |
225,202 | froq/froq-database | src/model/Oppa.php | Oppa.initQueryBuilder | public final function initQueryBuilder(string $stack = null, bool $isSub = false): QueryBuilder
{
$stack = $stack ?? $this->getStack(); // use self stack if $stack is null
if ($stack == null) {
throw new DatabaseException(sprintf("Null \$stack, set it in '%s' class",
stat... | php | public final function initQueryBuilder(string $stack = null, bool $isSub = false): QueryBuilder
{
$stack = $stack ?? $this->getStack(); // use self stack if $stack is null
if ($stack == null) {
throw new DatabaseException(sprintf("Null \$stack, set it in '%s' class",
stat... | [
"public",
"final",
"function",
"initQueryBuilder",
"(",
"string",
"$",
"stack",
"=",
"null",
",",
"bool",
"$",
"isSub",
"=",
"false",
")",
":",
"QueryBuilder",
"{",
"$",
"stack",
"=",
"$",
"stack",
"??",
"$",
"this",
"->",
"getStack",
"(",
")",
";",
... | Init query builder.
@param string|null $stack
@param bool $isSub
@return Oppa\Query\Builder
@throws froq\database\DatabaseException | [
"Init",
"query",
"builder",
"."
] | 829732986f9f9db4ef83ce87f0461f190947c958 | https://github.com/froq/froq-database/blob/829732986f9f9db4ef83ce87f0461f190947c958/src/model/Oppa.php#L308-L317 |
225,203 | Aerendir/PHPArrayWriter | src/ArrayWriter.php | ArrayWriter.getValue | public function getValue(array $array, string $path)
{
// If the $path value is empty, return the entire array graph
if ($this->isRoot($path)) {
return $array;
}
// If $path doesn't exist returns null. It is not possible to distinghuish between a path that exists and has... | php | public function getValue(array $array, string $path)
{
// If the $path value is empty, return the entire array graph
if ($this->isRoot($path)) {
return $array;
}
// If $path doesn't exist returns null. It is not possible to distinghuish between a path that exists and has... | [
"public",
"function",
"getValue",
"(",
"array",
"$",
"array",
",",
"string",
"$",
"path",
")",
"{",
"// If the $path value is empty, return the entire array graph",
"if",
"(",
"$",
"this",
"->",
"isRoot",
"(",
"$",
"path",
")",
")",
"{",
"return",
"$",
"array"... | Get the value of the given path from the array graph.
@param array $array
@param string $path
@return array|string | [
"Get",
"the",
"value",
"of",
"the",
"given",
"path",
"from",
"the",
"array",
"graph",
"."
] | de3015f8cefe9ceaf4fc704e8cbf5153dc613ebf | https://github.com/Aerendir/PHPArrayWriter/blob/de3015f8cefe9ceaf4fc704e8cbf5153dc613ebf/src/ArrayWriter.php#L56-L66 |
225,204 | Aerendir/PHPArrayWriter | src/ArrayWriter.php | ArrayWriter.getValueByPartialKey | public function getValueByPartialKey(array $array, string $searchingKey): ?string
{
foreach ($array as $key => $value) {
if (false !== stripos($key, $searchingKey)) {
return $value;
}
}
return null;
} | php | public function getValueByPartialKey(array $array, string $searchingKey): ?string
{
foreach ($array as $key => $value) {
if (false !== stripos($key, $searchingKey)) {
return $value;
}
}
return null;
} | [
"public",
"function",
"getValueByPartialKey",
"(",
"array",
"$",
"array",
",",
"string",
"$",
"searchingKey",
")",
":",
"?",
"string",
"{",
"foreach",
"(",
"$",
"array",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"if",
"(",
"false",
"!==",
"stripo... | This just searches in the first level, not in deeper ones.
@param array $array
@param string $searchingKey
@return string|null | [
"This",
"just",
"searches",
"in",
"the",
"first",
"level",
"not",
"in",
"deeper",
"ones",
"."
] | de3015f8cefe9ceaf4fc704e8cbf5153dc613ebf | https://github.com/Aerendir/PHPArrayWriter/blob/de3015f8cefe9ceaf4fc704e8cbf5153dc613ebf/src/ArrayWriter.php#L76-L85 |
225,205 | Aerendir/PHPArrayWriter | src/ArrayWriter.php | ArrayWriter.isReadable | public function isReadable(array $array, string $path): bool
{
try {
return $this->pa->isReadable($array, $path);
} catch (\Exception $e) {
return false;
}
} | php | public function isReadable(array $array, string $path): bool
{
try {
return $this->pa->isReadable($array, $path);
} catch (\Exception $e) {
return false;
}
} | [
"public",
"function",
"isReadable",
"(",
"array",
"$",
"array",
",",
"string",
"$",
"path",
")",
":",
"bool",
"{",
"try",
"{",
"return",
"$",
"this",
"->",
"pa",
"->",
"isReadable",
"(",
"$",
"array",
",",
"$",
"path",
")",
";",
"}",
"catch",
"(",
... | Checks if a path exists in the given array.
@param array $array
@param string $path
@return bool | [
"Checks",
"if",
"a",
"path",
"exists",
"in",
"the",
"given",
"array",
"."
] | de3015f8cefe9ceaf4fc704e8cbf5153dc613ebf | https://github.com/Aerendir/PHPArrayWriter/blob/de3015f8cefe9ceaf4fc704e8cbf5153dc613ebf/src/ArrayWriter.php#L108-L115 |
225,206 | Aerendir/PHPArrayWriter | src/ArrayWriter.php | ArrayWriter.add | public function add(array &$array, string $toPath, $value, string $propertyForNewValue = '', string $propertyForOldValue = ''): void
{
// Get the value at destination path (to preserve it if isn't an array)
$currentValue = $this->getValue($array, $toPath);
// If the current value isn't yet ... | php | public function add(array &$array, string $toPath, $value, string $propertyForNewValue = '', string $propertyForOldValue = ''): void
{
// Get the value at destination path (to preserve it if isn't an array)
$currentValue = $this->getValue($array, $toPath);
// If the current value isn't yet ... | [
"public",
"function",
"add",
"(",
"array",
"&",
"$",
"array",
",",
"string",
"$",
"toPath",
",",
"$",
"value",
",",
"string",
"$",
"propertyForNewValue",
"=",
"''",
",",
"string",
"$",
"propertyForOldValue",
"=",
"''",
")",
":",
"void",
"{",
"// Get the ... | Adds a value to a node.
The method can recognize if the current value at $toPath is a string: if it is, the method first transforms the
current value into an array and then adds the new value to this new array, so preserving the already present
value.
Passing $propertyForNewValue and $propertyForOldValue it is possib... | [
"Adds",
"a",
"value",
"to",
"a",
"node",
"."
] | de3015f8cefe9ceaf4fc704e8cbf5153dc613ebf | https://github.com/Aerendir/PHPArrayWriter/blob/de3015f8cefe9ceaf4fc704e8cbf5153dc613ebf/src/ArrayWriter.php#L202-L230 |
225,207 | Aerendir/PHPArrayWriter | src/ArrayWriter.php | ArrayWriter.edit | public function edit(array &$array, string $path, $value): void
{
// If $path is not writable
if (false === $this->isRoot($path) && false === $this->pa->isReadable($array, $path)) {
throw new AccessException(sprintf('The path "%s" you are trying to edit isn\'t readable and so cannot be e... | php | public function edit(array &$array, string $path, $value): void
{
// If $path is not writable
if (false === $this->isRoot($path) && false === $this->pa->isReadable($array, $path)) {
throw new AccessException(sprintf('The path "%s" you are trying to edit isn\'t readable and so cannot be e... | [
"public",
"function",
"edit",
"(",
"array",
"&",
"$",
"array",
",",
"string",
"$",
"path",
",",
"$",
"value",
")",
":",
"void",
"{",
"// If $path is not writable",
"if",
"(",
"false",
"===",
"$",
"this",
"->",
"isRoot",
"(",
"$",
"path",
")",
"&&",
"... | Edits the value at the given path.
@param array $array
@param string $path
@param $value
@throws AccessException If the path to edit is not readable | [
"Edits",
"the",
"value",
"at",
"the",
"given",
"path",
"."
] | de3015f8cefe9ceaf4fc704e8cbf5153dc613ebf | https://github.com/Aerendir/PHPArrayWriter/blob/de3015f8cefe9ceaf4fc704e8cbf5153dc613ebf/src/ArrayWriter.php#L295-L307 |
225,208 | Aerendir/PHPArrayWriter | src/ArrayWriter.php | ArrayWriter.mvUp | public function mvUp(array &$array, string $path): void
{
// Build the path object
$pathObject = new PropertyPath($path);
// get the values to move one level up
$values = $this->pa->getValue($array, $path);
// Remove the key to move one level up
$this->rm($array, $p... | php | public function mvUp(array &$array, string $path): void
{
// Build the path object
$pathObject = new PropertyPath($path);
// get the values to move one level up
$values = $this->pa->getValue($array, $path);
// Remove the key to move one level up
$this->rm($array, $p... | [
"public",
"function",
"mvUp",
"(",
"array",
"&",
"$",
"array",
",",
"string",
"$",
"path",
")",
":",
"void",
"{",
"// Build the path object",
"$",
"pathObject",
"=",
"new",
"PropertyPath",
"(",
"$",
"path",
")",
";",
"// get the values to move one level up",
"... | Moves a value one level up in the array.
Example:
$array = [
'level1' => ['value 1.1', 'value 1.2', 'value 1.3'],
'level2' => ['key1' => 'value 2.1', 'value 2.2', 'value 2.3']
];
is transformed into the array:
$array = [
'level1' => ['value 1.1', 'value 1.2', 'value 1.3'],
'key' => 'value 2.1',
1 => 'value 2.2',
2 ... | [
"Moves",
"a",
"value",
"one",
"level",
"up",
"in",
"the",
"array",
"."
] | de3015f8cefe9ceaf4fc704e8cbf5153dc613ebf | https://github.com/Aerendir/PHPArrayWriter/blob/de3015f8cefe9ceaf4fc704e8cbf5153dc613ebf/src/ArrayWriter.php#L390-L409 |
225,209 | Aerendir/PHPArrayWriter | src/ArrayWriter.php | ArrayWriter.rm | public function rm(array &$array, string $path): void
{
// This way it will trigger an error if the calculated value is not correct
$node = null;
$path = new PropertyPathBuilder($path);
$nodes = $path->getPropertyPath()->getElements();
$parentLevel = null;
$c... | php | public function rm(array &$array, string $path): void
{
// This way it will trigger an error if the calculated value is not correct
$node = null;
$path = new PropertyPathBuilder($path);
$nodes = $path->getPropertyPath()->getElements();
$parentLevel = null;
$c... | [
"public",
"function",
"rm",
"(",
"array",
"&",
"$",
"array",
",",
"string",
"$",
"path",
")",
":",
"void",
"{",
"// This way it will trigger an error if the calculated value is not correct",
"$",
"node",
"=",
"null",
";",
"$",
"path",
"=",
"new",
"PropertyPathBuil... | Removes an element from the array.
@see http://stackoverflow.com/a/16698855/1399706
@param array $array
@param string $path | [
"Removes",
"an",
"element",
"from",
"the",
"array",
"."
] | de3015f8cefe9ceaf4fc704e8cbf5153dc613ebf | https://github.com/Aerendir/PHPArrayWriter/blob/de3015f8cefe9ceaf4fc704e8cbf5153dc613ebf/src/ArrayWriter.php#L419-L436 |
225,210 | Aerendir/PHPArrayWriter | src/ArrayWriter.php | ArrayWriter.wrap | public function wrap(array &$array, string $path, string $wrapperName): void
{
// Get the value to move: if path is empty, get the full array graph
$value = (empty($path) || '[]' === $path) ? $array : $this->pa->getValue($array, $path);
// Remove eventual [ or ] from the $wrapperName
... | php | public function wrap(array &$array, string $path, string $wrapperName): void
{
// Get the value to move: if path is empty, get the full array graph
$value = (empty($path) || '[]' === $path) ? $array : $this->pa->getValue($array, $path);
// Remove eventual [ or ] from the $wrapperName
... | [
"public",
"function",
"wrap",
"(",
"array",
"&",
"$",
"array",
",",
"string",
"$",
"path",
",",
"string",
"$",
"wrapperName",
")",
":",
"void",
"{",
"// Get the value to move: if path is empty, get the full array graph",
"$",
"value",
"=",
"(",
"empty",
"(",
"$"... | Adds a parent key to the current array.
For example, given this array:
$array = [
0 => 'element 0', 1 => 'element 1', 2 => 'element 2', ...
];
calling ArrayWriter('', 'root') will rearrange the array in this way:
$array = [
'root' => [
0 => 'element 0', 1 => 'element 1', 2 => 'element 2', ...
]
];
@param array $a... | [
"Adds",
"a",
"parent",
"key",
"to",
"the",
"current",
"array",
"."
] | de3015f8cefe9ceaf4fc704e8cbf5153dc613ebf | https://github.com/Aerendir/PHPArrayWriter/blob/de3015f8cefe9ceaf4fc704e8cbf5153dc613ebf/src/ArrayWriter.php#L459-L475 |
225,211 | egulias/ListenersDebug | Listener/ListenerFetcher.php | ListenerFetcher.getEventSubscriberInformation | public function getEventSubscriberInformation($class)
{
$events = array();
$reflectionClass = new \ReflectionClass($class);
$interfaces = $reflectionClass->getInterfaceNames();
foreach ($interfaces as $interface) {
if ($interface == 'Symfony\\Component\\EventDispatcher\\E... | php | public function getEventSubscriberInformation($class)
{
$events = array();
$reflectionClass = new \ReflectionClass($class);
$interfaces = $reflectionClass->getInterfaceNames();
foreach ($interfaces as $interface) {
if ($interface == 'Symfony\\Component\\EventDispatcher\\E... | [
"public",
"function",
"getEventSubscriberInformation",
"(",
"$",
"class",
")",
"{",
"$",
"events",
"=",
"array",
"(",
")",
";",
"$",
"reflectionClass",
"=",
"new",
"\\",
"ReflectionClass",
"(",
"$",
"class",
")",
";",
"$",
"interfaces",
"=",
"$",
"reflecti... | Obtains the information available from class if it is defined as an EventSubscriber
@param string $class Fully qualified class name
@return array array('event.name' => array(array('method','priority'))) | [
"Obtains",
"the",
"information",
"available",
"from",
"class",
"if",
"it",
"is",
"defined",
"as",
"an",
"EventSubscriber"
] | 7f9d5aaed942be69e058dc7b99d4e802304482c0 | https://github.com/egulias/ListenersDebug/blob/7f9d5aaed942be69e058dc7b99d4e802304482c0/Listener/ListenerFetcher.php#L131-L143 |
225,212 | bytic/Common | src/Controllers/Traits/Models/HasModelManagerTrait.php | HasModelManagerTrait.initModelManager | protected function initModelManager()
{
$managerClass = $this->getModel();
$modelManager = $this->newModelManagerInstance($this->getModel());
if ($modelManager instanceof RecordManager) {
$this->modelManager = $this->newModelManagerInstance($this->getModel());
} else {
... | php | protected function initModelManager()
{
$managerClass = $this->getModel();
$modelManager = $this->newModelManagerInstance($this->getModel());
if ($modelManager instanceof RecordManager) {
$this->modelManager = $this->newModelManagerInstance($this->getModel());
} else {
... | [
"protected",
"function",
"initModelManager",
"(",
")",
"{",
"$",
"managerClass",
"=",
"$",
"this",
"->",
"getModel",
"(",
")",
";",
"$",
"modelManager",
"=",
"$",
"this",
"->",
"newModelManagerInstance",
"(",
"$",
"this",
"->",
"getModel",
"(",
")",
")",
... | Init the Model Manager
@throws Exception
@return void | [
"Init",
"the",
"Model",
"Manager"
] | 5d17043e03a2274a758fba1f6dedb7d85195bcfb | https://github.com/bytic/Common/blob/5d17043e03a2274a758fba1f6dedb7d85195bcfb/src/Controllers/Traits/Models/HasModelManagerTrait.php#L53-L65 |
225,213 | bytic/Common | src/Controllers/Traits/Models/HasModelManagerTrait.php | HasModelManagerTrait.generateModelName | protected function generateModelName()
{
$name = str_replace(["async-", "modal-"], '', $this->getName());
$manager = ModelLocator::get($name);
return get_class($manager);
} | php | protected function generateModelName()
{
$name = str_replace(["async-", "modal-"], '', $this->getName());
$manager = ModelLocator::get($name);
return get_class($manager);
} | [
"protected",
"function",
"generateModelName",
"(",
")",
"{",
"$",
"name",
"=",
"str_replace",
"(",
"[",
"\"async-\"",
",",
"\"modal-\"",
"]",
",",
"''",
",",
"$",
"this",
"->",
"getName",
"(",
")",
")",
";",
"$",
"manager",
"=",
"ModelLocator",
"::",
"... | Generate the model name from controller name
@return string | [
"Generate",
"the",
"model",
"name",
"from",
"controller",
"name"
] | 5d17043e03a2274a758fba1f6dedb7d85195bcfb | https://github.com/bytic/Common/blob/5d17043e03a2274a758fba1f6dedb7d85195bcfb/src/Controllers/Traits/Models/HasModelManagerTrait.php#L108-L113 |
225,214 | stubbles/stubbles-input | src/main/php/errors/ParamError.php | ParamError.fromData | public static function fromData($error, array $details = []): self
{
if ($error instanceof self) {
return $error;
}
if (!is_string($error)) {
throw new \InvalidArgumentException('Given error must either be an error id or an instance of ' . __CLASS__);
}
... | php | public static function fromData($error, array $details = []): self
{
if ($error instanceof self) {
return $error;
}
if (!is_string($error)) {
throw new \InvalidArgumentException('Given error must either be an error id or an instance of ' . __CLASS__);
}
... | [
"public",
"static",
"function",
"fromData",
"(",
"$",
"error",
",",
"array",
"$",
"details",
"=",
"[",
"]",
")",
":",
"self",
"{",
"if",
"(",
"$",
"error",
"instanceof",
"self",
")",
"{",
"return",
"$",
"error",
";",
"}",
"if",
"(",
"!",
"is_string... | creates an instance from given error id and details
In case given error is already an instance of ParamError it is simply
returned.
@param \stubbles\input\errors\ParamError|string $error id of error or an instance of ParamError
@param array $details details of what caused ... | [
"creates",
"an",
"instance",
"from",
"given",
"error",
"id",
"and",
"details"
] | 1ce0ebe5ba392faf3cc369a95e3fe0fa38912b1e | https://github.com/stubbles/stubbles-input/blob/1ce0ebe5ba392faf3cc369a95e3fe0fa38912b1e/src/main/php/errors/ParamError.php#L56-L67 |
225,215 | stubbles/stubbles-input | src/main/php/errors/ParamError.php | ParamError.fillMessages | public function fillMessages(array $templates): array
{
$messages = [];
foreach ($templates as $locale => $message) {
$messages[] = $this->fillMessage($message, $locale);
}
return $messages;
} | php | public function fillMessages(array $templates): array
{
$messages = [];
foreach ($templates as $locale => $message) {
$messages[] = $this->fillMessage($message, $locale);
}
return $messages;
} | [
"public",
"function",
"fillMessages",
"(",
"array",
"$",
"templates",
")",
":",
"array",
"{",
"$",
"messages",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"templates",
"as",
"$",
"locale",
"=>",
"$",
"message",
")",
"{",
"$",
"messages",
"[",
"]",
"=",
... | fills given list of messages with details
@param array $templates map of locales and message templates
@return \stubbles\input\errors\messages\LocalizedMessage[] | [
"fills",
"given",
"list",
"of",
"messages",
"with",
"details"
] | 1ce0ebe5ba392faf3cc369a95e3fe0fa38912b1e | https://github.com/stubbles/stubbles-input/blob/1ce0ebe5ba392faf3cc369a95e3fe0fa38912b1e/src/main/php/errors/ParamError.php#L98-L106 |
225,216 | stubbles/stubbles-input | src/main/php/errors/ParamError.php | ParamError.fillMessage | public function fillMessage(string $message, string $locale): LocalizedMessage
{
foreach ($this->details as $key => $detail) {
$message = str_replace('{' . $key . '}', $this->flattenDetail($detail), $message);
}
return new LocalizedMessage($locale, $message);
} | php | public function fillMessage(string $message, string $locale): LocalizedMessage
{
foreach ($this->details as $key => $detail) {
$message = str_replace('{' . $key . '}', $this->flattenDetail($detail), $message);
}
return new LocalizedMessage($locale, $message);
} | [
"public",
"function",
"fillMessage",
"(",
"string",
"$",
"message",
",",
"string",
"$",
"locale",
")",
":",
"LocalizedMessage",
"{",
"foreach",
"(",
"$",
"this",
"->",
"details",
"as",
"$",
"key",
"=>",
"$",
"detail",
")",
"{",
"$",
"message",
"=",
"st... | fills given message with details
@param string $message message template to fill up
@param string $locale locale of the message
@return \stubbles\input\errors\messages\LocalizedMessage | [
"fills",
"given",
"message",
"with",
"details"
] | 1ce0ebe5ba392faf3cc369a95e3fe0fa38912b1e | https://github.com/stubbles/stubbles-input/blob/1ce0ebe5ba392faf3cc369a95e3fe0fa38912b1e/src/main/php/errors/ParamError.php#L115-L122 |
225,217 | stubbles/stubbles-input | src/main/php/errors/ParamError.php | ParamError.flattenDetail | private function flattenDetail($detail): string
{
if (is_array($detail)) {
return join(', ', $detail);
} elseif (is_object($detail) && !method_exists($detail, '__toString')) {
return get_class($detail);
}
return (string) $detail;
} | php | private function flattenDetail($detail): string
{
if (is_array($detail)) {
return join(', ', $detail);
} elseif (is_object($detail) && !method_exists($detail, '__toString')) {
return get_class($detail);
}
return (string) $detail;
} | [
"private",
"function",
"flattenDetail",
"(",
"$",
"detail",
")",
":",
"string",
"{",
"if",
"(",
"is_array",
"(",
"$",
"detail",
")",
")",
"{",
"return",
"join",
"(",
"', '",
",",
"$",
"detail",
")",
";",
"}",
"elseif",
"(",
"is_object",
"(",
"$",
"... | flattens the given detail to be used within a message
@param mixed $detail
@return string | [
"flattens",
"the",
"given",
"detail",
"to",
"be",
"used",
"within",
"a",
"message"
] | 1ce0ebe5ba392faf3cc369a95e3fe0fa38912b1e | https://github.com/stubbles/stubbles-input/blob/1ce0ebe5ba392faf3cc369a95e3fe0fa38912b1e/src/main/php/errors/ParamError.php#L130-L139 |
225,218 | froq/froq-database | src/model/Model.php | Model.setStackPrimaryValue | public final function setStackPrimaryValue($value): void
{
if ($this->stackPrimary != null) {
$this->set($this->stackPrimary, $value);
}
} | php | public final function setStackPrimaryValue($value): void
{
if ($this->stackPrimary != null) {
$this->set($this->stackPrimary, $value);
}
} | [
"public",
"final",
"function",
"setStackPrimaryValue",
"(",
"$",
"value",
")",
":",
"void",
"{",
"if",
"(",
"$",
"this",
"->",
"stackPrimary",
"!=",
"null",
")",
"{",
"$",
"this",
"->",
"set",
"(",
"$",
"this",
"->",
"stackPrimary",
",",
"$",
"value",
... | Set stack primary value.
@param any $value
@return void | [
"Set",
"stack",
"primary",
"value",
"."
] | 829732986f9f9db4ef83ce87f0461f190947c958 | https://github.com/froq/froq-database/blob/829732986f9f9db4ef83ce87f0461f190947c958/src/model/Model.php#L216-L221 |
225,219 | froq/froq-database | src/model/Model.php | Model.getPager | public final function getPager(int $totalRecords = null, string $startKey = null,
string $stopKey = null): Pager
{
if ($totalRecords !== null) {
$this->pager->run($totalRecords, $startKey, $stopKey);
}
return $this->pager;
} | php | public final function getPager(int $totalRecords = null, string $startKey = null,
string $stopKey = null): Pager
{
if ($totalRecords !== null) {
$this->pager->run($totalRecords, $startKey, $stopKey);
}
return $this->pager;
} | [
"public",
"final",
"function",
"getPager",
"(",
"int",
"$",
"totalRecords",
"=",
"null",
",",
"string",
"$",
"startKey",
"=",
"null",
",",
"string",
"$",
"stopKey",
"=",
"null",
")",
":",
"Pager",
"{",
"if",
"(",
"$",
"totalRecords",
"!==",
"null",
")"... | Get pager.
@param int|null $totalRecords
@param string|null $startKey
@param string|null $stopKey
@return froq\pager\Pager | [
"Get",
"pager",
"."
] | 829732986f9f9db4ef83ce87f0461f190947c958 | https://github.com/froq/froq-database/blob/829732986f9f9db4ef83ce87f0461f190947c958/src/model/Model.php#L241-L249 |
225,220 | froq/froq-database | src/model/Model.php | Model.getPagerResults | public final function getPagerResults(int $totalRecords, string $startKey = null,
string $stopKey = null): array
{
return $this->pager->run($totalRecords, $startKey, $stopKey);
} | php | public final function getPagerResults(int $totalRecords, string $startKey = null,
string $stopKey = null): array
{
return $this->pager->run($totalRecords, $startKey, $stopKey);
} | [
"public",
"final",
"function",
"getPagerResults",
"(",
"int",
"$",
"totalRecords",
",",
"string",
"$",
"startKey",
"=",
"null",
",",
"string",
"$",
"stopKey",
"=",
"null",
")",
":",
"array",
"{",
"return",
"$",
"this",
"->",
"pager",
"->",
"run",
"(",
... | Get pager results.
@param int $totalRecords
@param string|null $startKey
@param string|null $stopKey
@return array | [
"Get",
"pager",
"results",
"."
] | 829732986f9f9db4ef83ce87f0461f190947c958 | https://github.com/froq/froq-database/blob/829732986f9f9db4ef83ce87f0461f190947c958/src/model/Model.php#L258-L262 |
225,221 | froq/froq-database | src/model/Model.php | Model.setFail | public final function setFail(\Throwable $fail): void
{
if ($this->failOption) {
if ($this->failOption == 'log') {
$logger = clone $this->service->getApp()->getLogger();
$logger->setDirectory($this->failLogDirectory);
$logger->logFail($fail);
... | php | public final function setFail(\Throwable $fail): void
{
if ($this->failOption) {
if ($this->failOption == 'log') {
$logger = clone $this->service->getApp()->getLogger();
$logger->setDirectory($this->failLogDirectory);
$logger->logFail($fail);
... | [
"public",
"final",
"function",
"setFail",
"(",
"\\",
"Throwable",
"$",
"fail",
")",
":",
"void",
"{",
"if",
"(",
"$",
"this",
"->",
"failOption",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"failOption",
"==",
"'log'",
")",
"{",
"$",
"logger",
"=",
"cl... | Set fail.
@param \Throwable $fail
@return void
@throws \Throwable | [
"Set",
"fail",
"."
] | 829732986f9f9db4ef83ce87f0461f190947c958 | https://github.com/froq/froq-database/blob/829732986f9f9db4ef83ce87f0461f190947c958/src/model/Model.php#L288-L300 |
225,222 | nails/driver-cdn-local | src/Local.php | Local.urlServe | public function urlServe($sObject, $sBucket, $bForceDownload = false)
{
$sUrl = $this->urlServeScheme($bForceDownload);
$sFilename = strtolower(substr($sObject, 0, strrpos($sObject, '.')));
$sExtension = strtolower(substr($sObject, strrpos($sObject, '.')));
// Sub in the val... | php | public function urlServe($sObject, $sBucket, $bForceDownload = false)
{
$sUrl = $this->urlServeScheme($bForceDownload);
$sFilename = strtolower(substr($sObject, 0, strrpos($sObject, '.')));
$sExtension = strtolower(substr($sObject, strrpos($sObject, '.')));
// Sub in the val... | [
"public",
"function",
"urlServe",
"(",
"$",
"sObject",
",",
"$",
"sBucket",
",",
"$",
"bForceDownload",
"=",
"false",
")",
"{",
"$",
"sUrl",
"=",
"$",
"this",
"->",
"urlServeScheme",
"(",
"$",
"bForceDownload",
")",
";",
"$",
"sFilename",
"=",
"strtolowe... | Generates the correct URL for serving a file
@param string $sObject The object to serve
@param string $sBucket The bucket to serve from
@param boolean $bForceDownload Whether to force a download
@return string | [
"Generates",
"the",
"correct",
"URL",
"for",
"serving",
"a",
"file"
] | 60f6cd80a331734a853b2e1e4721641494c0ce6e | https://github.com/nails/driver-cdn-local/blob/60f6cd80a331734a853b2e1e4721641494c0ce6e/src/Local.php#L257-L269 |
225,223 | nails/driver-cdn-local | src/Local.php | Local.urlServeRaw | public function urlServeRaw($sObject, $sBucket)
{
$sUrl = 'assets/uploads/' . $sBucket . '/' . $sObject;
return $this->urlMakeSecure($sUrl, false);
} | php | public function urlServeRaw($sObject, $sBucket)
{
$sUrl = 'assets/uploads/' . $sBucket . '/' . $sObject;
return $this->urlMakeSecure($sUrl, false);
} | [
"public",
"function",
"urlServeRaw",
"(",
"$",
"sObject",
",",
"$",
"sBucket",
")",
"{",
"$",
"sUrl",
"=",
"'assets/uploads/'",
".",
"$",
"sBucket",
".",
"'/'",
".",
"$",
"sObject",
";",
"return",
"$",
"this",
"->",
"urlMakeSecure",
"(",
"$",
"sUrl",
"... | Generate the correct URL for serving a file direct from the file system
@param $sObject
@param $sBucket
@return string | [
"Generate",
"the",
"correct",
"URL",
"for",
"serving",
"a",
"file",
"direct",
"from",
"the",
"file",
"system"
] | 60f6cd80a331734a853b2e1e4721641494c0ce6e | https://github.com/nails/driver-cdn-local/blob/60f6cd80a331734a853b2e1e4721641494c0ce6e/src/Local.php#L281-L285 |
225,224 | nails/driver-cdn-local | src/Local.php | Local.urlServeScheme | public function urlServeScheme($bForceDownload = false)
{
$sUrl = $this->getUri('serve') . '/serve/{{bucket}}/{{filename}}{{extension}}';
if ($bForceDownload) {
$sUrl .= '?dl=1';
}
return $this->urlMakeSecure($sUrl, false);
} | php | public function urlServeScheme($bForceDownload = false)
{
$sUrl = $this->getUri('serve') . '/serve/{{bucket}}/{{filename}}{{extension}}';
if ($bForceDownload) {
$sUrl .= '?dl=1';
}
return $this->urlMakeSecure($sUrl, false);
} | [
"public",
"function",
"urlServeScheme",
"(",
"$",
"bForceDownload",
"=",
"false",
")",
"{",
"$",
"sUrl",
"=",
"$",
"this",
"->",
"getUri",
"(",
"'serve'",
")",
".",
"'/serve/{{bucket}}/{{filename}}{{extension}}'",
";",
"if",
"(",
"$",
"bForceDownload",
")",
"{... | Returns the scheme of 'serve' URLs
@param boolean $bForceDownload Whether or not to force download
@return string | [
"Returns",
"the",
"scheme",
"of",
"serve",
"URLs"
] | 60f6cd80a331734a853b2e1e4721641494c0ce6e | https://github.com/nails/driver-cdn-local/blob/60f6cd80a331734a853b2e1e4721641494c0ce6e/src/Local.php#L296-L305 |
225,225 | nails/driver-cdn-local | src/Local.php | Local.urlServeZipped | public function urlServeZipped($sObjectIds, $sHash, $sFilename)
{
$sUrl = $this->urlServeZippedScheme();
// Sub in the values
$sUrl = str_replace('{{ids}}', $sObjectIds, $sUrl);
$sUrl = str_replace('{{hash}}', $sHash, $sUrl);
$sUrl = str_replace('{{filename}}', urlencode($s... | php | public function urlServeZipped($sObjectIds, $sHash, $sFilename)
{
$sUrl = $this->urlServeZippedScheme();
// Sub in the values
$sUrl = str_replace('{{ids}}', $sObjectIds, $sUrl);
$sUrl = str_replace('{{hash}}', $sHash, $sUrl);
$sUrl = str_replace('{{filename}}', urlencode($s... | [
"public",
"function",
"urlServeZipped",
"(",
"$",
"sObjectIds",
",",
"$",
"sHash",
",",
"$",
"sFilename",
")",
"{",
"$",
"sUrl",
"=",
"$",
"this",
"->",
"urlServeZippedScheme",
"(",
")",
";",
"// Sub in the values",
"$",
"sUrl",
"=",
"str_replace",
"(",
"... | Generates a URL for serving zipped objects
@param string $sObjectIds A comma separated list of object IDs
@param string $sHash The security hash
@param string $sFilename The filename to give the zip file
@return string | [
"Generates",
"a",
"URL",
"for",
"serving",
"zipped",
"objects"
] | 60f6cd80a331734a853b2e1e4721641494c0ce6e | https://github.com/nails/driver-cdn-local/blob/60f6cd80a331734a853b2e1e4721641494c0ce6e/src/Local.php#L318-L328 |
225,226 | nails/driver-cdn-local | src/Local.php | Local.urlCrop | public function urlCrop($sObject, $sBucket, $iWidth, $iHeight)
{
$sUrl = $this->urlCropScheme();
$sFilename = strtolower(substr($sObject, 0, strrpos($sObject, '.')));
$sExtension = strtolower(substr($sObject, strrpos($sObject, '.')));
// Sub in the values
$sUrl = str... | php | public function urlCrop($sObject, $sBucket, $iWidth, $iHeight)
{
$sUrl = $this->urlCropScheme();
$sFilename = strtolower(substr($sObject, 0, strrpos($sObject, '.')));
$sExtension = strtolower(substr($sObject, strrpos($sObject, '.')));
// Sub in the values
$sUrl = str... | [
"public",
"function",
"urlCrop",
"(",
"$",
"sObject",
",",
"$",
"sBucket",
",",
"$",
"iWidth",
",",
"$",
"iHeight",
")",
"{",
"$",
"sUrl",
"=",
"$",
"this",
"->",
"urlCropScheme",
"(",
")",
";",
"$",
"sFilename",
"=",
"strtolower",
"(",
"substr",
"("... | Generates the correct URL for using the crop utility
@param string $sBucket The bucket which the image resides in
@param string $sObject The filename of the image we're cropping
@param integer $iWidth The width of the cropped image
@param integer $iHeight The height of the cropped image
@return string | [
"Generates",
"the",
"correct",
"URL",
"for",
"using",
"the",
"crop",
"utility"
] | 60f6cd80a331734a853b2e1e4721641494c0ce6e | https://github.com/nails/driver-cdn-local/blob/60f6cd80a331734a853b2e1e4721641494c0ce6e/src/Local.php#L355-L369 |
225,227 | nails/driver-cdn-local | src/Local.php | Local.urlScale | public function urlScale($sObject, $sBucket, $iWidth, $iHeight)
{
$sUrl = $this->urlScaleScheme();
$sFilename = strtolower(substr($sObject, 0, strrpos($sObject, '.')));
$sExtension = strtolower(substr($sObject, strrpos($sObject, '.')));
// Sub in the values
$sUrl = s... | php | public function urlScale($sObject, $sBucket, $iWidth, $iHeight)
{
$sUrl = $this->urlScaleScheme();
$sFilename = strtolower(substr($sObject, 0, strrpos($sObject, '.')));
$sExtension = strtolower(substr($sObject, strrpos($sObject, '.')));
// Sub in the values
$sUrl = s... | [
"public",
"function",
"urlScale",
"(",
"$",
"sObject",
",",
"$",
"sBucket",
",",
"$",
"iWidth",
",",
"$",
"iHeight",
")",
"{",
"$",
"sUrl",
"=",
"$",
"this",
"->",
"urlScaleScheme",
"(",
")",
";",
"$",
"sFilename",
"=",
"strtolower",
"(",
"substr",
"... | Generates the correct URL for using the scale utility
@param string $sBucket The bucket which the image resides in
@param string $sObject The filename of the image we're 'scaling'
@param integer $iWidth The width of the scaled image
@param integer $iHeight The height of the scaled image
@return string | [
"Generates",
"the",
"correct",
"URL",
"for",
"using",
"the",
"scale",
"utility"
] | 60f6cd80a331734a853b2e1e4721641494c0ce6e | https://github.com/nails/driver-cdn-local/blob/60f6cd80a331734a853b2e1e4721641494c0ce6e/src/Local.php#L396-L410 |
225,228 | nails/driver-cdn-local | src/Local.php | Local.urlPlaceholder | public function urlPlaceholder($iWidth, $iHeight, $iBorder = 0)
{
$sUrl = $this->urlPlaceholderScheme();
// Sub in the values
$sUrl = str_replace('{{width}}', $iWidth, $sUrl);
$sUrl = str_replace('{{height}}', $iHeight, $sUrl);
$sUrl = str_replace('{{border}}', $iBorder, $s... | php | public function urlPlaceholder($iWidth, $iHeight, $iBorder = 0)
{
$sUrl = $this->urlPlaceholderScheme();
// Sub in the values
$sUrl = str_replace('{{width}}', $iWidth, $sUrl);
$sUrl = str_replace('{{height}}', $iHeight, $sUrl);
$sUrl = str_replace('{{border}}', $iBorder, $s... | [
"public",
"function",
"urlPlaceholder",
"(",
"$",
"iWidth",
",",
"$",
"iHeight",
",",
"$",
"iBorder",
"=",
"0",
")",
"{",
"$",
"sUrl",
"=",
"$",
"this",
"->",
"urlPlaceholderScheme",
"(",
")",
";",
"// Sub in the values",
"$",
"sUrl",
"=",
"str_replace",
... | Generates the correct URL for using the placeholder utility
@param integer $iWidth The width of the placeholder
@param integer $iHeight The height of the placeholder
@param integer $iBorder The width of the border round the placeholder
@return string | [
"Generates",
"the",
"correct",
"URL",
"for",
"using",
"the",
"placeholder",
"utility"
] | 60f6cd80a331734a853b2e1e4721641494c0ce6e | https://github.com/nails/driver-cdn-local/blob/60f6cd80a331734a853b2e1e4721641494c0ce6e/src/Local.php#L436-L446 |
225,229 | nails/driver-cdn-local | src/Local.php | Local.urlBlankAvatar | public function urlBlankAvatar($iWidth, $iHeight, $mSex = '')
{
$sUrl = $this->urlBlankAvatarScheme();
// Sub in the values
$sUrl = str_replace('{{width}}', $iWidth, $sUrl);
$sUrl = str_replace('{{height}}', $iHeight, $sUrl);
$sUrl = str_replace('{{sex}}', $mSex, $sUrl);
... | php | public function urlBlankAvatar($iWidth, $iHeight, $mSex = '')
{
$sUrl = $this->urlBlankAvatarScheme();
// Sub in the values
$sUrl = str_replace('{{width}}', $iWidth, $sUrl);
$sUrl = str_replace('{{height}}', $iHeight, $sUrl);
$sUrl = str_replace('{{sex}}', $mSex, $sUrl);
... | [
"public",
"function",
"urlBlankAvatar",
"(",
"$",
"iWidth",
",",
"$",
"iHeight",
",",
"$",
"mSex",
"=",
"''",
")",
"{",
"$",
"sUrl",
"=",
"$",
"this",
"->",
"urlBlankAvatarScheme",
"(",
")",
";",
"// Sub in the values",
"$",
"sUrl",
"=",
"str_replace",
... | Generates the correct URL for a blank avatar
@param integer $iWidth The width fo the avatar
@param integer $iHeight The height of the avatar§
@param string|integer $mSex What gender the avatar should represent
@return string | [
"Generates",
"the",
"correct",
"URL",
"for",
"a",
"blank",
"avatar"
] | 60f6cd80a331734a853b2e1e4721641494c0ce6e | https://github.com/nails/driver-cdn-local/blob/60f6cd80a331734a853b2e1e4721641494c0ce6e/src/Local.php#L472-L482 |
225,230 | nails/driver-cdn-local | src/Local.php | Local.urlMakeSecure | protected function urlMakeSecure($sUrl, $bIsProcessing = true)
{
if (Functions::isPageSecure()) {
if ($bIsProcessing) {
$sSearch = $this->getUri('process');
$sReplace = $this->getUri('process_secure');
} else {
$sSearch = $this->getUr... | php | protected function urlMakeSecure($sUrl, $bIsProcessing = true)
{
if (Functions::isPageSecure()) {
if ($bIsProcessing) {
$sSearch = $this->getUri('process');
$sReplace = $this->getUri('process_secure');
} else {
$sSearch = $this->getUr... | [
"protected",
"function",
"urlMakeSecure",
"(",
"$",
"sUrl",
",",
"$",
"bIsProcessing",
"=",
"true",
")",
"{",
"if",
"(",
"Functions",
"::",
"isPageSecure",
"(",
")",
")",
"{",
"if",
"(",
"$",
"bIsProcessing",
")",
"{",
"$",
"sSearch",
"=",
"$",
"this",... | Formats a URL and makes it secure if needed
@param string $sUrl The URL to secure
@param boolean $bIsProcessing Whether it's a processing type URL
@return string | [
"Formats",
"a",
"URL",
"and",
"makes",
"it",
"secure",
"if",
"needed"
] | 60f6cd80a331734a853b2e1e4721641494c0ce6e | https://github.com/nails/driver-cdn-local/blob/60f6cd80a331734a853b2e1e4721641494c0ce6e/src/Local.php#L550-L564 |
225,231 | SetBased/php-abc-table-detail | src/TableRow/HtmlTableRow.php | HtmlTableRow.addRow | public static function addRow(DetailTable $table, $header, ?string $htmlSnippet): void
{
if ($htmlSnippet!==null && $htmlSnippet!=='')
{
$table->addRow($header, ['class' => 'html'], $htmlSnippet, true);
}
else
{
$table->addRow($header);
}
} | php | public static function addRow(DetailTable $table, $header, ?string $htmlSnippet): void
{
if ($htmlSnippet!==null && $htmlSnippet!=='')
{
$table->addRow($header, ['class' => 'html'], $htmlSnippet, true);
}
else
{
$table->addRow($header);
}
} | [
"public",
"static",
"function",
"addRow",
"(",
"DetailTable",
"$",
"table",
",",
"$",
"header",
",",
"?",
"string",
"$",
"htmlSnippet",
")",
":",
"void",
"{",
"if",
"(",
"$",
"htmlSnippet",
"!==",
"null",
"&&",
"$",
"htmlSnippet",
"!==",
"''",
")",
"{"... | Adds a row with a HTML snippet to a detail table.
@param DetailTable $table The detail table.
@param string|int|null $header The header text of this table row.
@param string|null $htmlSnippet The HTML snippet. | [
"Adds",
"a",
"row",
"with",
"a",
"HTML",
"snippet",
"to",
"a",
"detail",
"table",
"."
] | 1f786174ccb10800f9c07bfd497b0ab35940a8ea | https://github.com/SetBased/php-abc-table-detail/blob/1f786174ccb10800f9c07bfd497b0ab35940a8ea/src/TableRow/HtmlTableRow.php#L20-L30 |
225,232 | SetBased/php-abc-form | src/Control/Control.php | Control.setSubmitName | protected function setSubmitName(string $parentSubmitName): void
{
$submitKey = $this->submitKey();
if ($parentSubmitName!=='')
{
if ($submitKey!=='') $this->submitName = $parentSubmitName.'['.$submitKey.']';
else $this->submitName = $parentSubmitName;
}
else
{
... | php | protected function setSubmitName(string $parentSubmitName): void
{
$submitKey = $this->submitKey();
if ($parentSubmitName!=='')
{
if ($submitKey!=='') $this->submitName = $parentSubmitName.'['.$submitKey.']';
else $this->submitName = $parentSubmitName;
}
else
{
... | [
"protected",
"function",
"setSubmitName",
"(",
"string",
"$",
"parentSubmitName",
")",
":",
"void",
"{",
"$",
"submitKey",
"=",
"$",
"this",
"->",
"submitKey",
"(",
")",
";",
"if",
"(",
"$",
"parentSubmitName",
"!==",
"''",
")",
"{",
"if",
"(",
"$",
"s... | Sets the name this will be used for this form control when the form is submitted.
@param string $parentSubmitName The submit name of the parent form control of this form control. | [
"Sets",
"the",
"name",
"this",
"will",
"be",
"used",
"for",
"this",
"form",
"control",
"when",
"the",
"form",
"is",
"submitted",
"."
] | a7343e2b7dda411f5f0fc7d64324bc9d021aa73e | https://github.com/SetBased/php-abc-form/blob/a7343e2b7dda411f5f0fc7d64324bc9d021aa73e/src/Control/Control.php#L360-L373 |
225,233 | SetBased/php-abc-form | src/Control/Control.php | Control.submitKey | protected function submitKey(): string
{
return ($this->obfuscator) ? $this->obfuscator->encode(Cast::toOptInt($this->name)) : $this->name;
} | php | protected function submitKey(): string
{
return ($this->obfuscator) ? $this->obfuscator->encode(Cast::toOptInt($this->name)) : $this->name;
} | [
"protected",
"function",
"submitKey",
"(",
")",
":",
"string",
"{",
"return",
"(",
"$",
"this",
"->",
"obfuscator",
")",
"?",
"$",
"this",
"->",
"obfuscator",
"->",
"encode",
"(",
"Cast",
"::",
"toOptInt",
"(",
"$",
"this",
"->",
"name",
")",
")",
":... | Returns the key under which the control is submitted in the submitted values.
@return string
@since 1.0.0
@api | [
"Returns",
"the",
"key",
"under",
"which",
"the",
"control",
"is",
"submitted",
"in",
"the",
"submitted",
"values",
"."
] | a7343e2b7dda411f5f0fc7d64324bc9d021aa73e | https://github.com/SetBased/php-abc-form/blob/a7343e2b7dda411f5f0fc7d64324bc9d021aa73e/src/Control/Control.php#L384-L387 |
225,234 | stubbles/stubbles-input | src/main/php/filter/SimplePasswordChecker.php | SimplePasswordChecker.check | public function check(Secret $proposedPassword): array
{
$errors = [];
if ($proposedPassword->length() < $this->minLength) {
$errors['PASSWORD_TOO_SHORT'] = ['minLength' => $this->minLength];
}
if (in_array($proposedPassword->unveil(), $this->disallowedValues)) {
... | php | public function check(Secret $proposedPassword): array
{
$errors = [];
if ($proposedPassword->length() < $this->minLength) {
$errors['PASSWORD_TOO_SHORT'] = ['minLength' => $this->minLength];
}
if (in_array($proposedPassword->unveil(), $this->disallowedValues)) {
... | [
"public",
"function",
"check",
"(",
"Secret",
"$",
"proposedPassword",
")",
":",
"array",
"{",
"$",
"errors",
"=",
"[",
"]",
";",
"if",
"(",
"$",
"proposedPassword",
"->",
"length",
"(",
")",
"<",
"$",
"this",
"->",
"minLength",
")",
"{",
"$",
"error... | checks given password
In case the password does not satisfy the return value is a list of
error ids.
@param \stubbles\values\Secret $proposedPassword
@return array | [
"checks",
"given",
"password"
] | 1ce0ebe5ba392faf3cc369a95e3fe0fa38912b1e | https://github.com/stubbles/stubbles-input/blob/1ce0ebe5ba392faf3cc369a95e3fe0fa38912b1e/src/main/php/filter/SimplePasswordChecker.php#L109-L125 |
225,235 | Eve-PHP/Framework | src/Cli/Install.php | Install.run | public function run($args)
{
$this->setup($args);
Index::info('Downloading files..');
$this('curl')
->setUrl('https://github.com/Eve-PHP/Shade/archive/master.zip')
->setFile($this->file)
->setFollowLocation(true)
->setSslVerifyPeer(false)
... | php | public function run($args)
{
$this->setup($args);
Index::info('Downloading files..');
$this('curl')
->setUrl('https://github.com/Eve-PHP/Shade/archive/master.zip')
->setFile($this->file)
->setFollowLocation(true)
->setSslVerifyPeer(false)
... | [
"public",
"function",
"run",
"(",
"$",
"args",
")",
"{",
"$",
"this",
"->",
"setup",
"(",
"$",
"args",
")",
";",
"Index",
"::",
"info",
"(",
"'Downloading files..'",
")",
";",
"$",
"this",
"(",
"'curl'",
")",
"->",
"setUrl",
"(",
"'https://github.com/E... | Runs the CLI Install process
@param array $args CLI arguments
@return void | [
"Runs",
"the",
"CLI",
"Install",
"process"
] | cd4ca9472c6c46034bde402bf20bf2f86657c608 | https://github.com/Eve-PHP/Framework/blob/cd4ca9472c6c46034bde402bf20bf2f86657c608/src/Cli/Install.php#L93-L174 |
225,236 | Eve-PHP/Framework | src/Cli/Install.php | Install.install | public function install()
{
$build = $this('mysql',
$this->databases['default']['host'],
'',
$this->databases['default']['user'],
$this->databases['default']['pass']);
$main = $this('mysql',
$this->databases['default']['host'],
... | php | public function install()
{
$build = $this('mysql',
$this->databases['default']['host'],
'',
$this->databases['default']['user'],
$this->databases['default']['pass']);
$main = $this('mysql',
$this->databases['default']['host'],
... | [
"public",
"function",
"install",
"(",
")",
"{",
"$",
"build",
"=",
"$",
"this",
"(",
"'mysql'",
",",
"$",
"this",
"->",
"databases",
"[",
"'default'",
"]",
"[",
"'host'",
"]",
",",
"''",
",",
"$",
"this",
"->",
"databases",
"[",
"'default'",
"]",
"... | Installs the database
@return Eve\Framework\Cli\Install | [
"Installs",
"the",
"database"
] | cd4ca9472c6c46034bde402bf20bf2f86657c608 | https://github.com/Eve-PHP/Framework/blob/cd4ca9472c6c46034bde402bf20bf2f86657c608/src/Cli/Install.php#L181-L320 |
225,237 | RevisionTen/cqrs | Services/SnapshotStore.php | SnapshotStore.find | public function find($uuid, $max_version = null): ?Snapshot
{
$criteria = new Criteria();
$criteria->where(Criteria::expr()->eq('uuid', $uuid));
if (null !== $max_version) {
$criteria->andWhere(Criteria::expr()->lte('version', $max_version));
}
$criteria->orderB... | php | public function find($uuid, $max_version = null): ?Snapshot
{
$criteria = new Criteria();
$criteria->where(Criteria::expr()->eq('uuid', $uuid));
if (null !== $max_version) {
$criteria->andWhere(Criteria::expr()->lte('version', $max_version));
}
$criteria->orderB... | [
"public",
"function",
"find",
"(",
"$",
"uuid",
",",
"$",
"max_version",
"=",
"null",
")",
":",
"?",
"Snapshot",
"{",
"$",
"criteria",
"=",
"new",
"Criteria",
"(",
")",
";",
"$",
"criteria",
"->",
"where",
"(",
"Criteria",
"::",
"expr",
"(",
")",
"... | Finds the latest Snapshot of an Aggregate.
@param $uuid
@param null $max_version the maximum version for the provided uuid
@return Snapshot|null | [
"Finds",
"the",
"latest",
"Snapshot",
"of",
"an",
"Aggregate",
"."
] | d94fdd86855a994c4662e24a6c3c08ef586e64f9 | https://github.com/RevisionTen/cqrs/blob/d94fdd86855a994c4662e24a6c3c08ef586e64f9/Services/SnapshotStore.php#L47-L60 |
225,238 | RevisionTen/cqrs | Services/SnapshotStore.php | SnapshotStore.save | public function save(AggregateInterface $aggregate): void
{
$snapshot = new Snapshot();
$snapshot->setUuid($aggregate->getUuid());
$snapshot->setVersion($aggregate->getVersion());
$snapshot->setAggregateCreated($aggregate->getCreated());
$snapshot->setAggregateModified($aggre... | php | public function save(AggregateInterface $aggregate): void
{
$snapshot = new Snapshot();
$snapshot->setUuid($aggregate->getUuid());
$snapshot->setVersion($aggregate->getVersion());
$snapshot->setAggregateCreated($aggregate->getCreated());
$snapshot->setAggregateModified($aggre... | [
"public",
"function",
"save",
"(",
"AggregateInterface",
"$",
"aggregate",
")",
":",
"void",
"{",
"$",
"snapshot",
"=",
"new",
"Snapshot",
"(",
")",
";",
"$",
"snapshot",
"->",
"setUuid",
"(",
"$",
"aggregate",
"->",
"getUuid",
"(",
")",
")",
";",
"$",... | Saves a Snapshot.
@param AggregateInterface $aggregate | [
"Saves",
"a",
"Snapshot",
"."
] | d94fdd86855a994c4662e24a6c3c08ef586e64f9 | https://github.com/RevisionTen/cqrs/blob/d94fdd86855a994c4662e24a6c3c08ef586e64f9/Services/SnapshotStore.php#L67-L99 |
225,239 | czogori/Dami | src/Dami/Migration/FileNameBuilder.php | FileNameBuilder.build | public function build($timestamp = null)
{
if (null === $timestamp) {
$timestamp = new \DateTime();
$timestamp = $timestamp->format('YmdHis');
}
$fileName = sprintf('%s_%s.php', $timestamp, S::underscored($this->migrationName));
return $fileName;
} | php | public function build($timestamp = null)
{
if (null === $timestamp) {
$timestamp = new \DateTime();
$timestamp = $timestamp->format('YmdHis');
}
$fileName = sprintf('%s_%s.php', $timestamp, S::underscored($this->migrationName));
return $fileName;
} | [
"public",
"function",
"build",
"(",
"$",
"timestamp",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"timestamp",
")",
"{",
"$",
"timestamp",
"=",
"new",
"\\",
"DateTime",
"(",
")",
";",
"$",
"timestamp",
"=",
"$",
"timestamp",
"->",
"format",... | Build migration file name.
@param datatype $timestamp Timestamp of migration.
@return string | [
"Build",
"migration",
"file",
"name",
"."
] | 19612e643f8bea76706cc667c3f2c12a42d4cd19 | https://github.com/czogori/Dami/blob/19612e643f8bea76706cc667c3f2c12a42d4cd19/src/Dami/Migration/FileNameBuilder.php#L33-L42 |
225,240 | charlesportwoodii/rpq-client | src/Queue/Stats.php | Stats.get | public function get(string $date = null) : array
{
if ($date === null) {
$date = \date('Y-m-d');
}
return [
'queued' => $this->queue->count(),
'pass' => $this->queue->getStatsByType($date, 'pass'),
'fail' => $this->queue->getStatsByType($date,... | php | public function get(string $date = null) : array
{
if ($date === null) {
$date = \date('Y-m-d');
}
return [
'queued' => $this->queue->count(),
'pass' => $this->queue->getStatsByType($date, 'pass'),
'fail' => $this->queue->getStatsByType($date,... | [
"public",
"function",
"get",
"(",
"string",
"$",
"date",
"=",
"null",
")",
":",
"array",
"{",
"if",
"(",
"$",
"date",
"===",
"null",
")",
"{",
"$",
"date",
"=",
"\\",
"date",
"(",
"'Y-m-d'",
")",
";",
"}",
"return",
"[",
"'queued'",
"=>",
"$",
... | Retrieves stats for a given date
@param string $date
@return void | [
"Retrieves",
"stats",
"for",
"a",
"given",
"date"
] | 9419cfe5c30d35ea54ce8faba7545daea2312e0f | https://github.com/charlesportwoodii/rpq-client/blob/9419cfe5c30d35ea54ce8faba7545daea2312e0f/src/Queue/Stats.php#L32-L45 |
225,241 | edineibauer/entity | public/src/Entity/Dicionario.php | Dicionario.getDataOnlyEntity | private function getDataOnlyEntity(): array
{
$data = [];
foreach ($this->dicionario as $meta) {
if (!in_array($meta->getFormat(), ["extend_mult", "list_mult", "selecao_mult", "information", "checkbox_mult"]) && ($meta->getFormat() !== "password" || strlen($meta->getValue()) > 3))
... | php | private function getDataOnlyEntity(): array
{
$data = [];
foreach ($this->dicionario as $meta) {
if (!in_array($meta->getFormat(), ["extend_mult", "list_mult", "selecao_mult", "information", "checkbox_mult"]) && ($meta->getFormat() !== "password" || strlen($meta->getValue()) > 3))
... | [
"private",
"function",
"getDataOnlyEntity",
"(",
")",
":",
"array",
"{",
"$",
"data",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"dicionario",
"as",
"$",
"meta",
")",
"{",
"if",
"(",
"!",
"in_array",
"(",
"$",
"meta",
"->",
"getFormat",
... | Retorna valores de uma entidade correspondente ao seu armazenamento em sql na sua tabela
@return array | [
"Retorna",
"valores",
"de",
"uma",
"entidade",
"correspondente",
"ao",
"seu",
"armazenamento",
"em",
"sql",
"na",
"sua",
"tabela"
] | 8437f5531ed9cd5f75c4c69c7db27b31e31e02c2 | https://github.com/edineibauer/entity/blob/8437f5531ed9cd5f75c4c69c7db27b31e31e02c2/public/src/Entity/Dicionario.php#L158-L166 |
225,242 | czogori/Dami | src/Dami/Migration/Api/TableApi.php | TableApi.dropColumn | public function dropColumn($name)
{
$column = new TextColumn($name);
$column->setTable($this);
$this->actions[] = function () use ($column) {
return $this->manipulation->drop($column);
};
return $this;
} | php | public function dropColumn($name)
{
$column = new TextColumn($name);
$column->setTable($this);
$this->actions[] = function () use ($column) {
return $this->manipulation->drop($column);
};
return $this;
} | [
"public",
"function",
"dropColumn",
"(",
"$",
"name",
")",
"{",
"$",
"column",
"=",
"new",
"TextColumn",
"(",
"$",
"name",
")",
";",
"$",
"column",
"->",
"setTable",
"(",
"$",
"this",
")",
";",
"$",
"this",
"->",
"actions",
"[",
"]",
"=",
"function... | Drop a column.
@param string $name Column name.
@return TableApi Self. | [
"Drop",
"a",
"column",
"."
] | 19612e643f8bea76706cc667c3f2c12a42d4cd19 | https://github.com/czogori/Dami/blob/19612e643f8bea76706cc667c3f2c12a42d4cd19/src/Dami/Migration/Api/TableApi.php#L79-L89 |
225,243 | czogori/Dami | src/Dami/Migration/Api/TableApi.php | TableApi.addForeignKey | public function addForeignKey($referenceTable, $referenceColumns, array $options = [])
{
$schema = isset($options['schema']) ? new Schema($options['schema']) : null;
$foreignKey = new ForeignKey($this, new Table($referenceTable, $schema));
$foreignKey->setReferencedColumns($referenceColumns... | php | public function addForeignKey($referenceTable, $referenceColumns, array $options = [])
{
$schema = isset($options['schema']) ? new Schema($options['schema']) : null;
$foreignKey = new ForeignKey($this, new Table($referenceTable, $schema));
$foreignKey->setReferencedColumns($referenceColumns... | [
"public",
"function",
"addForeignKey",
"(",
"$",
"referenceTable",
",",
"$",
"referenceColumns",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"schema",
"=",
"isset",
"(",
"$",
"options",
"[",
"'schema'",
"]",
")",
"?",
"new",
"Schema",
"... | Add a foreign key.
@param string $referenceTable Referenced table name.
@param string $referenceColumns Columns of referenced table.
@param array $options Optional options.
@return TableApi Self. | [
"Add",
"a",
"foreign",
"key",
"."
] | 19612e643f8bea76706cc667c3f2c12a42d4cd19 | https://github.com/czogori/Dami/blob/19612e643f8bea76706cc667c3f2c12a42d4cd19/src/Dami/Migration/Api/TableApi.php#L100-L123 |
225,244 | czogori/Dami | src/Dami/Migration/Api/TableApi.php | TableApi.dropForeignKey | public function dropForeignKey($referenceTable, $referenceColumns, array $options = [])
{
$schema = isset($options['schema']) ? new Schema($options['schema']) : null;
$foreignKey = new ForeignKey($this, new Table($referenceTable, $schema));
$foreignKey->setColumns($referenceColumns);
... | php | public function dropForeignKey($referenceTable, $referenceColumns, array $options = [])
{
$schema = isset($options['schema']) ? new Schema($options['schema']) : null;
$foreignKey = new ForeignKey($this, new Table($referenceTable, $schema));
$foreignKey->setColumns($referenceColumns);
... | [
"public",
"function",
"dropForeignKey",
"(",
"$",
"referenceTable",
",",
"$",
"referenceColumns",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"schema",
"=",
"isset",
"(",
"$",
"options",
"[",
"'schema'",
"]",
")",
"?",
"new",
"Schema",
... | Drop a foreign key.
@param string $referenceTable Referenced table name.
@param string $referenceColumns Columns of referenced table.
@param array $options Optional options.
@return TableApi Self. | [
"Drop",
"a",
"foreign",
"key",
"."
] | 19612e643f8bea76706cc667c3f2c12a42d4cd19 | https://github.com/czogori/Dami/blob/19612e643f8bea76706cc667c3f2c12a42d4cd19/src/Dami/Migration/Api/TableApi.php#L134-L147 |
225,245 | czogori/Dami | src/Dami/Migration/Api/TableApi.php | TableApi.addUnique | public function addUnique($columns)
{
$unique = new Unique($columns, $this);
$this->actions[] = function () use ($unique) {
return $this->manipulation->create($unique);
};
return $this;
} | php | public function addUnique($columns)
{
$unique = new Unique($columns, $this);
$this->actions[] = function () use ($unique) {
return $this->manipulation->create($unique);
};
return $this;
} | [
"public",
"function",
"addUnique",
"(",
"$",
"columns",
")",
"{",
"$",
"unique",
"=",
"new",
"Unique",
"(",
"$",
"columns",
",",
"$",
"this",
")",
";",
"$",
"this",
"->",
"actions",
"[",
"]",
"=",
"function",
"(",
")",
"use",
"(",
"$",
"unique",
... | Add a unique constraint.
@param array $columns Unique columns.
@return TableApi Self. | [
"Add",
"a",
"unique",
"constraint",
"."
] | 19612e643f8bea76706cc667c3f2c12a42d4cd19 | https://github.com/czogori/Dami/blob/19612e643f8bea76706cc667c3f2c12a42d4cd19/src/Dami/Migration/Api/TableApi.php#L156-L165 |
225,246 | czogori/Dami | src/Dami/Migration/Api/TableApi.php | TableApi.dropUnique | public function dropUnique($columns)
{
$unique = new Unique($columns, $this);
$this->actions[] = function () use ($unique) {
return $this->manipulation->drop($unique);
};
return $this;
} | php | public function dropUnique($columns)
{
$unique = new Unique($columns, $this);
$this->actions[] = function () use ($unique) {
return $this->manipulation->drop($unique);
};
return $this;
} | [
"public",
"function",
"dropUnique",
"(",
"$",
"columns",
")",
"{",
"$",
"unique",
"=",
"new",
"Unique",
"(",
"$",
"columns",
",",
"$",
"this",
")",
";",
"$",
"this",
"->",
"actions",
"[",
"]",
"=",
"function",
"(",
")",
"use",
"(",
"$",
"unique",
... | Drop a unique constraint.
@param array $columns Unique columns.
@return TableApi Self. | [
"Drop",
"a",
"unique",
"constraint",
"."
] | 19612e643f8bea76706cc667c3f2c12a42d4cd19 | https://github.com/czogori/Dami/blob/19612e643f8bea76706cc667c3f2c12a42d4cd19/src/Dami/Migration/Api/TableApi.php#L174-L183 |
225,247 | czogori/Dami | src/Dami/Migration/Api/TableApi.php | TableApi.addIndex | public function addIndex($columns)
{
$index = new Index($columns, $this);
$this->actions[] = function () use ($index) {
return $this->manipulation->create($index);
};
return $this;
} | php | public function addIndex($columns)
{
$index = new Index($columns, $this);
$this->actions[] = function () use ($index) {
return $this->manipulation->create($index);
};
return $this;
} | [
"public",
"function",
"addIndex",
"(",
"$",
"columns",
")",
"{",
"$",
"index",
"=",
"new",
"Index",
"(",
"$",
"columns",
",",
"$",
"this",
")",
";",
"$",
"this",
"->",
"actions",
"[",
"]",
"=",
"function",
"(",
")",
"use",
"(",
"$",
"index",
")",... | Add a index on columns.
@param array $columns Index columns.
@return TableApi Self. | [
"Add",
"a",
"index",
"on",
"columns",
"."
] | 19612e643f8bea76706cc667c3f2c12a42d4cd19 | https://github.com/czogori/Dami/blob/19612e643f8bea76706cc667c3f2c12a42d4cd19/src/Dami/Migration/Api/TableApi.php#L192-L201 |
225,248 | czogori/Dami | src/Dami/Migration/Api/TableApi.php | TableApi.dropIndex | public function dropIndex($columns)
{
$index = new Index($columns, $this);
$this->actions[] = function () use ($index) {
return $this->manipulation->drop($index);
};
return $this;
} | php | public function dropIndex($columns)
{
$index = new Index($columns, $this);
$this->actions[] = function () use ($index) {
return $this->manipulation->drop($index);
};
return $this;
} | [
"public",
"function",
"dropIndex",
"(",
"$",
"columns",
")",
"{",
"$",
"index",
"=",
"new",
"Index",
"(",
"$",
"columns",
",",
"$",
"this",
")",
";",
"$",
"this",
"->",
"actions",
"[",
"]",
"=",
"function",
"(",
")",
"use",
"(",
"$",
"index",
")"... | Drop a index on columns.
@param array $columns Index columns.
@return TableApi Self. | [
"Drop",
"a",
"index",
"on",
"columns",
"."
] | 19612e643f8bea76706cc667c3f2c12a42d4cd19 | https://github.com/czogori/Dami/blob/19612e643f8bea76706cc667c3f2c12a42d4cd19/src/Dami/Migration/Api/TableApi.php#L210-L219 |
225,249 | SetBased/php-abc-html | src/Helper/Html.php | Html.generateAttribute | public static function generateAttribute(string $name, $value): string
{
$html = '';
switch ($name)
{
// Boolean attributes.
case 'autofocus':
case 'checked':
case 'disabled':
case 'hidden':
case 'ismap':
case 'multiple':
case 'novalidate':
case 'read... | php | public static function generateAttribute(string $name, $value): string
{
$html = '';
switch ($name)
{
// Boolean attributes.
case 'autofocus':
case 'checked':
case 'disabled':
case 'hidden':
case 'ismap':
case 'multiple':
case 'novalidate':
case 'read... | [
"public",
"static",
"function",
"generateAttribute",
"(",
"string",
"$",
"name",
",",
"$",
"value",
")",
":",
"string",
"{",
"$",
"html",
"=",
"''",
";",
"switch",
"(",
"$",
"name",
")",
"{",
"// Boolean attributes.",
"case",
"'autofocus'",
":",
"case",
... | Returns a string with proper conversion of special characters to HTML entities of an attribute of a HTML tag.
Boolean attributes (e.g. checked, disabled and draggable, autocomplete also) are set when the value is none empty.
@param string $name The name of the attribute.
@param mixed $value The value of the attribu... | [
"Returns",
"a",
"string",
"with",
"proper",
"conversion",
"of",
"special",
"characters",
"to",
"HTML",
"entities",
"of",
"an",
"attribute",
"of",
"a",
"HTML",
"tag",
"."
] | 4e123c3b477bcd76ed82239711653b85ad5f4b26 | https://github.com/SetBased/php-abc-html/blob/4e123c3b477bcd76ed82239711653b85ad5f4b26/src/Helper/Html.php#L120-L200 |
225,250 | SetBased/php-abc-html | src/Helper/Html.php | Html.generateElement | public static function generateElement(string $tagName,
array $attributes = [],
?string $innerText = '',
bool $isHtml = false): string
{
$html = self::generateTag($tagName, $attributes);
... | php | public static function generateElement(string $tagName,
array $attributes = [],
?string $innerText = '',
bool $isHtml = false): string
{
$html = self::generateTag($tagName, $attributes);
... | [
"public",
"static",
"function",
"generateElement",
"(",
"string",
"$",
"tagName",
",",
"array",
"$",
"attributes",
"=",
"[",
"]",
",",
"?",
"string",
"$",
"innerText",
"=",
"''",
",",
"bool",
"$",
"isHtml",
"=",
"false",
")",
":",
"string",
"{",
"$",
... | Generates HTML code for an element.
Note: tags for void elements such as '<br/>' are not supported.
@param string $tagName The name of the tag, e.g. a, form.
@param array $attributes The attributes of the tag. Special characters in the attributes will be replaced
with HTML entities.
@param string|null $... | [
"Generates",
"HTML",
"code",
"for",
"an",
"element",
"."
] | 4e123c3b477bcd76ed82239711653b85ad5f4b26 | https://github.com/SetBased/php-abc-html/blob/4e123c3b477bcd76ed82239711653b85ad5f4b26/src/Helper/Html.php#L220-L232 |
225,251 | SetBased/php-abc-html | src/Helper/Html.php | Html.generateTag | public static function generateTag(string $tagName, array $attributes = []): string
{
$html = '<';
$html .= $tagName;
foreach ($attributes as $name => $value)
{
// Ignore attributes with leading underscore.
if (strpos($name, '_')!==0) $html .= self::generateAttribute($name, $value);
}
... | php | public static function generateTag(string $tagName, array $attributes = []): string
{
$html = '<';
$html .= $tagName;
foreach ($attributes as $name => $value)
{
// Ignore attributes with leading underscore.
if (strpos($name, '_')!==0) $html .= self::generateAttribute($name, $value);
}
... | [
"public",
"static",
"function",
"generateTag",
"(",
"string",
"$",
"tagName",
",",
"array",
"$",
"attributes",
"=",
"[",
"]",
")",
":",
"string",
"{",
"$",
"html",
"=",
"'<'",
";",
"$",
"html",
".=",
"$",
"tagName",
";",
"foreach",
"(",
"$",
"attribu... | Generates HTML code for a start tag of an element.
@param string $tagName The name of the tag, e.g. a, form.
@param array $attributes The attributes of the tag. Special characters in the attributes will be replaced with
HTML entities.
@return string
@since 1.0.0
@api | [
"Generates",
"HTML",
"code",
"for",
"a",
"start",
"tag",
"of",
"an",
"element",
"."
] | 4e123c3b477bcd76ed82239711653b85ad5f4b26 | https://github.com/SetBased/php-abc-html/blob/4e123c3b477bcd76ed82239711653b85ad5f4b26/src/Helper/Html.php#L247-L259 |
225,252 | SetBased/php-abc-html | src/Helper/Html.php | Html.txt2Slug | public static function txt2Slug(?string $string): string
{
if ($string===null) return '';
return trim(preg_replace('/[^0-9a-z]+/', '-', strtr(mb_strtolower($string), self::$trans)), '-');
} | php | public static function txt2Slug(?string $string): string
{
if ($string===null) return '';
return trim(preg_replace('/[^0-9a-z]+/', '-', strtr(mb_strtolower($string), self::$trans)), '-');
} | [
"public",
"static",
"function",
"txt2Slug",
"(",
"?",
"string",
"$",
"string",
")",
":",
"string",
"{",
"if",
"(",
"$",
"string",
"===",
"null",
")",
"return",
"''",
";",
"return",
"trim",
"(",
"preg_replace",
"(",
"'/[^0-9a-z]+/'",
",",
"'-'",
",",
"s... | Returns the slug of a string that can be safely used in an URL.
@param string|null $string The string.
@return string
@since 1.1.0
@api | [
"Returns",
"the",
"slug",
"of",
"a",
"string",
"that",
"can",
"be",
"safely",
"used",
"in",
"an",
"URL",
"."
] | 4e123c3b477bcd76ed82239711653b85ad5f4b26 | https://github.com/SetBased/php-abc-html/blob/4e123c3b477bcd76ed82239711653b85ad5f4b26/src/Helper/Html.php#L338-L343 |
225,253 | SetBased/php-abc-html | src/Helper/Html.php | Html.cleanClasses | private static function cleanClasses(array $classes): array
{
$ret = [];
foreach ($classes as $class)
{
$tmp = Cast::toManString($class, '');
if ($tmp!=='') $ret[] = $tmp;
}
return array_unique($ret);
} | php | private static function cleanClasses(array $classes): array
{
$ret = [];
foreach ($classes as $class)
{
$tmp = Cast::toManString($class, '');
if ($tmp!=='') $ret[] = $tmp;
}
return array_unique($ret);
} | [
"private",
"static",
"function",
"cleanClasses",
"(",
"array",
"$",
"classes",
")",
":",
"array",
"{",
"$",
"ret",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"classes",
"as",
"$",
"class",
")",
"{",
"$",
"tmp",
"=",
"Cast",
"::",
"toManString",
"(",
... | Removes empty and duplicate classes from an array with classes.
@param array $classes The classes.
@return array | [
"Removes",
"empty",
"and",
"duplicate",
"classes",
"from",
"an",
"array",
"with",
"classes",
"."
] | 4e123c3b477bcd76ed82239711653b85ad5f4b26 | https://github.com/SetBased/php-abc-html/blob/4e123c3b477bcd76ed82239711653b85ad5f4b26/src/Helper/Html.php#L353-L364 |
225,254 | GFG/dto-context | src/DTOContext/DataWrapper/Base.php | Base.toArray | public function toArray()
{
$ref = new \ReflectionObject($this);
$export = array();
foreach ($ref->getProperties() as $property) {
$property->setAccessible(true);
$name = strtolower(
preg_replace('@([A-Z])@', '_\1', $property->getName())
)... | php | public function toArray()
{
$ref = new \ReflectionObject($this);
$export = array();
foreach ($ref->getProperties() as $property) {
$property->setAccessible(true);
$name = strtolower(
preg_replace('@([A-Z])@', '_\1', $property->getName())
)... | [
"public",
"function",
"toArray",
"(",
")",
"{",
"$",
"ref",
"=",
"new",
"\\",
"ReflectionObject",
"(",
"$",
"this",
")",
";",
"$",
"export",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"ref",
"->",
"getProperties",
"(",
")",
"as",
"$",
"prope... | Export dataWrapper values as an array
@return array | [
"Export",
"dataWrapper",
"values",
"as",
"an",
"array"
] | c1a47273d3dc2704bfd3f90c2560726688d54558 | https://github.com/GFG/dto-context/blob/c1a47273d3dc2704bfd3f90c2560726688d54558/src/DTOContext/DataWrapper/Base.php#L79-L99 |
225,255 | GFG/dto-context | src/DTOContext/DataWrapper/Base.php | Base.toCleanArray | public function toCleanArray()
{
$export = $this->toArray();
$cleanExport = array();
foreach ($export as $key => $value) {
if ($value) {
$cleanExport[$key] = $value;
}
}
return $cleanExport;
} | php | public function toCleanArray()
{
$export = $this->toArray();
$cleanExport = array();
foreach ($export as $key => $value) {
if ($value) {
$cleanExport[$key] = $value;
}
}
return $cleanExport;
} | [
"public",
"function",
"toCleanArray",
"(",
")",
"{",
"$",
"export",
"=",
"$",
"this",
"->",
"toArray",
"(",
")",
";",
"$",
"cleanExport",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"export",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
... | ToArray with unset null fields
@return array | [
"ToArray",
"with",
"unset",
"null",
"fields"
] | c1a47273d3dc2704bfd3f90c2560726688d54558 | https://github.com/GFG/dto-context/blob/c1a47273d3dc2704bfd3f90c2560726688d54558/src/DTOContext/DataWrapper/Base.php#L106-L118 |
225,256 | Eve-PHP/Framework | src/Action/Html.php | Html.getEngine | public function getEngine()
{
if($this->engine) {
return $this->engine;
}
//get the template path
$path = eve()->path('template');
//create engine
$this->engine = eve('handlebars');
//add helpers
$helpers = include(__DIR__.'/helpers.php'... | php | public function getEngine()
{
if($this->engine) {
return $this->engine;
}
//get the template path
$path = eve()->path('template');
//create engine
$this->engine = eve('handlebars');
//add helpers
$helpers = include(__DIR__.'/helpers.php'... | [
"public",
"function",
"getEngine",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"engine",
")",
"{",
"return",
"$",
"this",
"->",
"engine",
";",
"}",
"//get the template path",
"$",
"path",
"=",
"eve",
"(",
")",
"->",
"path",
"(",
"'template'",
")",
"... | Returns the default template engine
@return Eden\Handlebars\Index | [
"Returns",
"the",
"default",
"template",
"engine"
] | cd4ca9472c6c46034bde402bf20bf2f86657c608 | https://github.com/Eve-PHP/Framework/blob/cd4ca9472c6c46034bde402bf20bf2f86657c608/src/Action/Html.php#L177-L197 |
225,257 | Eve-PHP/Framework | src/Action/Html.php | Html.getTemplate | protected function getTemplate()
{
//if no template
if(!$this->template) {
//Action folder and template folder
//are in the same directoryby default
// Sample\Namespace\Action\Can\Be\Anywhere
$index = 'Action\\';
$root = strpos(get_class($... | php | protected function getTemplate()
{
//if no template
if(!$this->template) {
//Action folder and template folder
//are in the same directoryby default
// Sample\Namespace\Action\Can\Be\Anywhere
$index = 'Action\\';
$root = strpos(get_class($... | [
"protected",
"function",
"getTemplate",
"(",
")",
"{",
"//if no template",
"if",
"(",
"!",
"$",
"this",
"->",
"template",
")",
"{",
"//Action folder and template folder",
"//are in the same directoryby default",
"// Sample\\Namespace\\Action\\Can\\Be\\Anywhere",
"$",
"index",... | Returns file path used for templating
@return array | [
"Returns",
"file",
"path",
"used",
"for",
"templating"
] | cd4ca9472c6c46034bde402bf20bf2f86657c608 | https://github.com/Eve-PHP/Framework/blob/cd4ca9472c6c46034bde402bf20bf2f86657c608/src/Action/Html.php#L204-L230 |
225,258 | Eve-PHP/Framework | src/Action/Html.php | Html.parse | private function parse($file, $data = array(), $trigger = null)
{
if(is_null($data)) {
$data = array();
} else if(is_string($data)) {
$trigger = $data;
$data = array();
}
if($trigger) {
eve()->trigger('template-'.$trigger, $file, $data... | php | private function parse($file, $data = array(), $trigger = null)
{
if(is_null($data)) {
$data = array();
} else if(is_string($data)) {
$trigger = $data;
$data = array();
}
if($trigger) {
eve()->trigger('template-'.$trigger, $file, $data... | [
"private",
"function",
"parse",
"(",
"$",
"file",
",",
"$",
"data",
"=",
"array",
"(",
")",
",",
"$",
"trigger",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"data",
")",
")",
"{",
"$",
"data",
"=",
"array",
"(",
")",
";",
"}",
"els... | Returns the template loaded with specified data
@param string $file The relative template file
@param array $data Data to bind to the template
@param string|null $trigger Event trigger to fire
@return string | [
"Returns",
"the",
"template",
"loaded",
"with",
"specified",
"data"
] | cd4ca9472c6c46034bde402bf20bf2f86657c608 | https://github.com/Eve-PHP/Framework/blob/cd4ca9472c6c46034bde402bf20bf2f86657c608/src/Action/Html.php#L241-L270 |
225,259 | froq/froq-session | src/Session.php | Session.isValidId | public function isValidId(?string $id): bool
{
if ($id == '') {
return false;
}
if ($this->saveHandler != null && method_exists($this->saveHandler, 'isValidId')) {
return $this->saveHandler->isValidId($id);
}
static $idPattern;
if ($idPattern... | php | public function isValidId(?string $id): bool
{
if ($id == '') {
return false;
}
if ($this->saveHandler != null && method_exists($this->saveHandler, 'isValidId')) {
return $this->saveHandler->isValidId($id);
}
static $idPattern;
if ($idPattern... | [
"public",
"function",
"isValidId",
"(",
"?",
"string",
"$",
"id",
")",
":",
"bool",
"{",
"if",
"(",
"$",
"id",
"==",
"''",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"$",
"this",
"->",
"saveHandler",
"!=",
"null",
"&&",
"method_exists",
"(",... | Is valid id.
@param ?string $id
@return bool | [
"Is",
"valid",
"id",
"."
] | 16b1ac72fa784aa0f5b7ee25f2b3d2bfb3193494 | https://github.com/froq/froq-session/blob/16b1ac72fa784aa0f5b7ee25f2b3d2bfb3193494/src/Session.php#L387-L424 |
225,260 | froq/froq-session | src/Session.php | Session.isValidSource | public function isValidSource(?string $id): bool
{
if ($id == '') {
return false;
}
if ($this->saveHandler != null && method_exists($this->saveHandler, 'isValidSource')) {
return $this->saveHandler->isValidSource($id);
}
// for 'sess_' @see https://g... | php | public function isValidSource(?string $id): bool
{
if ($id == '') {
return false;
}
if ($this->saveHandler != null && method_exists($this->saveHandler, 'isValidSource')) {
return $this->saveHandler->isValidSource($id);
}
// for 'sess_' @see https://g... | [
"public",
"function",
"isValidSource",
"(",
"?",
"string",
"$",
"id",
")",
":",
"bool",
"{",
"if",
"(",
"$",
"id",
"==",
"''",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"$",
"this",
"->",
"saveHandler",
"!=",
"null",
"&&",
"method_exists",
... | Is valid source.
@param ?string $id
@return bool | [
"Is",
"valid",
"source",
"."
] | 16b1ac72fa784aa0f5b7ee25f2b3d2bfb3193494 | https://github.com/froq/froq-session/blob/16b1ac72fa784aa0f5b7ee25f2b3d2bfb3193494/src/Session.php#L431-L443 |
225,261 | froq/froq-session | src/Session.php | Session.generateId | public function generateId(): string
{
if ($this->saveHandler != null && method_exists($this->saveHandler, 'generateId')) {
return $this->saveHandler->generateId($id);
}
$id = session_create_id();
// hash by length
if ($this->options['hash']) {
switc... | php | public function generateId(): string
{
if ($this->saveHandler != null && method_exists($this->saveHandler, 'generateId')) {
return $this->saveHandler->generateId($id);
}
$id = session_create_id();
// hash by length
if ($this->options['hash']) {
switc... | [
"public",
"function",
"generateId",
"(",
")",
":",
"string",
"{",
"if",
"(",
"$",
"this",
"->",
"saveHandler",
"!=",
"null",
"&&",
"method_exists",
"(",
"$",
"this",
"->",
"saveHandler",
",",
"'generateId'",
")",
")",
"{",
"return",
"$",
"this",
"->",
... | Generate id.
@return string
@throws froq\session\SessionException | [
"Generate",
"id",
"."
] | 16b1ac72fa784aa0f5b7ee25f2b3d2bfb3193494 | https://github.com/froq/froq-session/blob/16b1ac72fa784aa0f5b7ee25f2b3d2bfb3193494/src/Session.php#L450-L473 |
225,262 | bytic/Common | src/Records/Traits/Media/Logos/RecordTrait.php | RecordTrait.initLogoTypes | public function initLogoTypes()
{
if (isset($this->logoTypes)) {
$this->_logoTypes = $this->logoTypes;
} else {
$this->_logoTypes = [];
}
} | php | public function initLogoTypes()
{
if (isset($this->logoTypes)) {
$this->_logoTypes = $this->logoTypes;
} else {
$this->_logoTypes = [];
}
} | [
"public",
"function",
"initLogoTypes",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"logoTypes",
")",
")",
"{",
"$",
"this",
"->",
"_logoTypes",
"=",
"$",
"this",
"->",
"logoTypes",
";",
"}",
"else",
"{",
"$",
"this",
"->",
"_logoTypes"... | Init Logo Types | [
"Init",
"Logo",
"Types"
] | 5d17043e03a2274a758fba1f6dedb7d85195bcfb | https://github.com/bytic/Common/blob/5d17043e03a2274a758fba1f6dedb7d85195bcfb/src/Records/Traits/Media/Logos/RecordTrait.php#L94-L101 |
225,263 | spiral/translator | src/Translator.php | Translator.get | protected function get(string &$locale, string $domain, string $string): string
{
if ($this->catalogueManager->get($locale)->has($domain, $string)) {
return $this->catalogueManager->get($locale)->get($domain, $string);
}
$locale = $this->config->getFallbackLocale();
if ... | php | protected function get(string &$locale, string $domain, string $string): string
{
if ($this->catalogueManager->get($locale)->has($domain, $string)) {
return $this->catalogueManager->get($locale)->get($domain, $string);
}
$locale = $this->config->getFallbackLocale();
if ... | [
"protected",
"function",
"get",
"(",
"string",
"&",
"$",
"locale",
",",
"string",
"$",
"domain",
",",
"string",
"$",
"string",
")",
":",
"string",
"{",
"if",
"(",
"$",
"this",
"->",
"catalogueManager",
"->",
"get",
"(",
"$",
"locale",
")",
"->",
"has... | Get translation message from the locale bundle or fallback to default locale.
@param string $locale
@param string $domain
@param string $string
@return string | [
"Get",
"translation",
"message",
"from",
"the",
"locale",
"bundle",
"or",
"fallback",
"to",
"default",
"locale",
"."
] | dde0f3d3db7960c22a36b9e781fe30ab51656424 | https://github.com/spiral/translator/blob/dde0f3d3db7960c22a36b9e781fe30ab51656424/src/Translator.php#L163-L183 |
225,264 | spiral/translator | src/Translator.php | Translator.interpolate | public static function interpolate(
string $string,
array $values,
string $prefix = '{',
string $postfix = '}'
): string {
$replaces = [];
foreach ($values as $key => $value) {
$value = (is_array($value) || $value instanceof \Closure) ? '' : $value;
... | php | public static function interpolate(
string $string,
array $values,
string $prefix = '{',
string $postfix = '}'
): string {
$replaces = [];
foreach ($values as $key => $value) {
$value = (is_array($value) || $value instanceof \Closure) ? '' : $value;
... | [
"public",
"static",
"function",
"interpolate",
"(",
"string",
"$",
"string",
",",
"array",
"$",
"values",
",",
"string",
"$",
"prefix",
"=",
"'{'",
",",
"string",
"$",
"postfix",
"=",
"'}'",
")",
":",
"string",
"{",
"$",
"replaces",
"=",
"[",
"]",
";... | Interpolate string with given parameters, used by many spiral components.
Input: Hello {name}! Good {time}! + ['name' => 'Member', 'time' => 'day']
Output: Hello Member! Good Day!
@param string $string
@param array $values Arguments (key => value). Will skip unknown names.
@param string $prefix Placeholder prefix,... | [
"Interpolate",
"string",
"with",
"given",
"parameters",
"used",
"by",
"many",
"spiral",
"components",
"."
] | dde0f3d3db7960c22a36b9e781fe30ab51656424 | https://github.com/spiral/translator/blob/dde0f3d3db7960c22a36b9e781fe30ab51656424/src/Translator.php#L197-L216 |
225,265 | kapitchi/KapitchiContact | src/KapitchiContact/Service/Storage/StorageTypeListener.php | StorageTypeListener.attachShared | public function attachShared(SharedEventManagerInterface $sharedEm)
{
$this->listeners[] = $sharedEm->attach($this->entityFormClass, 'init', array($this, 'onEntityFormInit'));
$this->listeners[] = $sharedEm->attach($this->entityFormClass, 'setData', array($this, 'onEntityFormSetData'));
$thi... | php | public function attachShared(SharedEventManagerInterface $sharedEm)
{
$this->listeners[] = $sharedEm->attach($this->entityFormClass, 'init', array($this, 'onEntityFormInit'));
$this->listeners[] = $sharedEm->attach($this->entityFormClass, 'setData', array($this, 'onEntityFormSetData'));
$thi... | [
"public",
"function",
"attachShared",
"(",
"SharedEventManagerInterface",
"$",
"sharedEm",
")",
"{",
"$",
"this",
"->",
"listeners",
"[",
"]",
"=",
"$",
"sharedEm",
"->",
"attach",
"(",
"$",
"this",
"->",
"entityFormClass",
",",
"'init'",
",",
"array",
"(",
... | Attach listeners to an event manager
@param EventManagerInterface $events
@return void | [
"Attach",
"listeners",
"to",
"an",
"event",
"manager"
] | 318fe7fb62151736dc83b8a96267a1a308e9fd57 | https://github.com/kapitchi/KapitchiContact/blob/318fe7fb62151736dc83b8a96267a1a308e9fd57/src/KapitchiContact/Service/Storage/StorageTypeListener.php#L62-L68 |
225,266 | kapitchi/KapitchiContact | src/KapitchiContact/Service/Storage/StorageTypeListener.php | StorageTypeListener.detachShared | public function detachShared(SharedEventManagerInterface $events)
{
foreach ($this->listeners as $index => $listener) {
if ($events->detach($listener)) {
unset($this->listeners[$index]);
}
}
} | php | public function detachShared(SharedEventManagerInterface $events)
{
foreach ($this->listeners as $index => $listener) {
if ($events->detach($listener)) {
unset($this->listeners[$index]);
}
}
} | [
"public",
"function",
"detachShared",
"(",
"SharedEventManagerInterface",
"$",
"events",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"listeners",
"as",
"$",
"index",
"=>",
"$",
"listener",
")",
"{",
"if",
"(",
"$",
"events",
"->",
"detach",
"(",
"$",
"l... | Detach listeners from an event manager
@param EventManagerInterface $events
@return void | [
"Detach",
"listeners",
"from",
"an",
"event",
"manager"
] | 318fe7fb62151736dc83b8a96267a1a308e9fd57 | https://github.com/kapitchi/KapitchiContact/blob/318fe7fb62151736dc83b8a96267a1a308e9fd57/src/KapitchiContact/Service/Storage/StorageTypeListener.php#L76-L83 |
225,267 | stubbles/stubbles-input | src/main/php/broker/param/MultipleSourceParamBroker.php | MultipleSourceParamBroker.procure | public function procure(Request $request, Annotation $annotation)
{
$read = $this->readSourceMethod($request, $annotation);
$valueReader = $request->$read($annotation->getParamName());
/* @var $valueReader \stubbles\input\ValueReader */
if ($annotation->isRequired()) {
... | php | public function procure(Request $request, Annotation $annotation)
{
$read = $this->readSourceMethod($request, $annotation);
$valueReader = $request->$read($annotation->getParamName());
/* @var $valueReader \stubbles\input\ValueReader */
if ($annotation->isRequired()) {
... | [
"public",
"function",
"procure",
"(",
"Request",
"$",
"request",
",",
"Annotation",
"$",
"annotation",
")",
"{",
"$",
"read",
"=",
"$",
"this",
"->",
"readSourceMethod",
"(",
"$",
"request",
",",
"$",
"annotation",
")",
";",
"$",
"valueReader",
"=",
"$",... | extracts parameter from request and handles it
@param \stubbles\input\Request $request instance to handle value with
@param \stubbles\reflect\annotation\Annotation $annotation annotation which contains request param metadata
@return mixed | [
"extracts",
"parameter",
"from",
"request",
"and",
"handles",
"it"
] | 1ce0ebe5ba392faf3cc369a95e3fe0fa38912b1e | https://github.com/stubbles/stubbles-input/blob/1ce0ebe5ba392faf3cc369a95e3fe0fa38912b1e/src/main/php/broker/param/MultipleSourceParamBroker.php#L30-L50 |
225,268 | stubbles/stubbles-input | src/main/php/broker/param/MultipleSourceParamBroker.php | MultipleSourceParamBroker.procureParam | public function procureParam(Param $param, Annotation $annotation)
{
return $this->filter(ValueReader::forValue($param->value()), $annotation);
} | php | public function procureParam(Param $param, Annotation $annotation)
{
return $this->filter(ValueReader::forValue($param->value()), $annotation);
} | [
"public",
"function",
"procureParam",
"(",
"Param",
"$",
"param",
",",
"Annotation",
"$",
"annotation",
")",
"{",
"return",
"$",
"this",
"->",
"filter",
"(",
"ValueReader",
"::",
"forValue",
"(",
"$",
"param",
"->",
"value",
"(",
")",
")",
",",
"$",
"a... | handles a single param
@param \stubbles\values\Value $param
@param \stubbles\reflect\annotation\Annotation $annotation
@return mixed | [
"handles",
"a",
"single",
"param"
] | 1ce0ebe5ba392faf3cc369a95e3fe0fa38912b1e | https://github.com/stubbles/stubbles-input/blob/1ce0ebe5ba392faf3cc369a95e3fe0fa38912b1e/src/main/php/broker/param/MultipleSourceParamBroker.php#L80-L83 |
225,269 | stubbles/stubbles-input | src/main/php/broker/param/MultipleSourceParamBroker.php | MultipleSourceParamBroker.readSourceMethod | private function readSourceMethod(Request $request, Annotation $annotation): string
{
$method = 'read' . $this->source($annotation);
if (!method_exists($request, $method)) {
throw new \RuntimeException(
'Unknown source ' . $annotation->getSource() . ' for '
... | php | private function readSourceMethod(Request $request, Annotation $annotation): string
{
$method = 'read' . $this->source($annotation);
if (!method_exists($request, $method)) {
throw new \RuntimeException(
'Unknown source ' . $annotation->getSource() . ' for '
... | [
"private",
"function",
"readSourceMethod",
"(",
"Request",
"$",
"request",
",",
"Annotation",
"$",
"annotation",
")",
":",
"string",
"{",
"$",
"method",
"=",
"'read'",
".",
"$",
"this",
"->",
"source",
"(",
"$",
"annotation",
")",
";",
"if",
"(",
"!",
... | retrieves method to call on request instance
@param \stubbles\input\Request $request
@param \stubbles\reflect\annotation\Annotation $annotation
@return string
@throws \RuntimeException | [
"retrieves",
"method",
"to",
"call",
"on",
"request",
"instance"
] | 1ce0ebe5ba392faf3cc369a95e3fe0fa38912b1e | https://github.com/stubbles/stubbles-input/blob/1ce0ebe5ba392faf3cc369a95e3fe0fa38912b1e/src/main/php/broker/param/MultipleSourceParamBroker.php#L93-L104 |
225,270 | stubbles/stubbles-input | src/main/php/broker/param/MultipleSourceParamBroker.php | MultipleSourceParamBroker.source | private function source(Annotation $annotation): string
{
if ($annotation->hasValueByName('source')) {
return ucfirst(strtolower($annotation->getSource()));
}
return 'Param';
} | php | private function source(Annotation $annotation): string
{
if ($annotation->hasValueByName('source')) {
return ucfirst(strtolower($annotation->getSource()));
}
return 'Param';
} | [
"private",
"function",
"source",
"(",
"Annotation",
"$",
"annotation",
")",
":",
"string",
"{",
"if",
"(",
"$",
"annotation",
"->",
"hasValueByName",
"(",
"'source'",
")",
")",
"{",
"return",
"ucfirst",
"(",
"strtolower",
"(",
"$",
"annotation",
"->",
"get... | returns source from where to read value
@param \stubbles\reflect\annotation\Annotation $annotation
@return string | [
"returns",
"source",
"from",
"where",
"to",
"read",
"value"
] | 1ce0ebe5ba392faf3cc369a95e3fe0fa38912b1e | https://github.com/stubbles/stubbles-input/blob/1ce0ebe5ba392faf3cc369a95e3fe0fa38912b1e/src/main/php/broker/param/MultipleSourceParamBroker.php#L112-L119 |
225,271 | DrNixx/yii2-onix | src/collections/Iterator.php | Iterator.key | public function key()
{
if ($this->type == self::PAIRS) {
return $this->current->key;
} else {
return $this->index;
}
} | php | public function key()
{
if ($this->type == self::PAIRS) {
return $this->current->key;
} else {
return $this->index;
}
} | [
"public",
"function",
"key",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"type",
"==",
"self",
"::",
"PAIRS",
")",
"{",
"return",
"$",
"this",
"->",
"current",
"->",
"key",
";",
"}",
"else",
"{",
"return",
"$",
"this",
"->",
"index",
";",
"}",
... | Return the current key
@return mixed The current key | [
"Return",
"the",
"current",
"key"
] | 0a621ed301dc94971ff71af062b24d6bc0858dd7 | https://github.com/DrNixx/yii2-onix/blob/0a621ed301dc94971ff71af062b24d6bc0858dd7/src/collections/Iterator.php#L103-L110 |
225,272 | DrNixx/yii2-onix | src/collections/Iterator.php | Iterator.current | public function current()
{
if ($this->type == self::KEYS) {
return $this->current->key;
} else {
return $this->current->value;
}
} | php | public function current()
{
if ($this->type == self::KEYS) {
return $this->current->key;
} else {
return $this->current->value;
}
} | [
"public",
"function",
"current",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"type",
"==",
"self",
"::",
"KEYS",
")",
"{",
"return",
"$",
"this",
"->",
"current",
"->",
"key",
";",
"}",
"else",
"{",
"return",
"$",
"this",
"->",
"current",
"->",
... | Return the current value
@return mixed The current value | [
"Return",
"the",
"current",
"value"
] | 0a621ed301dc94971ff71af062b24d6bc0858dd7 | https://github.com/DrNixx/yii2-onix/blob/0a621ed301dc94971ff71af062b24d6bc0858dd7/src/collections/Iterator.php#L116-L123 |
225,273 | DrNixx/yii2-onix | src/collections/Iterator.php | Iterator.next | public function next()
{
try {
$this->current = $this->map->successor($this->current);
} catch (\OutOfBoundsException $e) {
$this->current = null;
}
$this->index++;
} | php | public function next()
{
try {
$this->current = $this->map->successor($this->current);
} catch (\OutOfBoundsException $e) {
$this->current = null;
}
$this->index++;
} | [
"public",
"function",
"next",
"(",
")",
"{",
"try",
"{",
"$",
"this",
"->",
"current",
"=",
"$",
"this",
"->",
"map",
"->",
"successor",
"(",
"$",
"this",
"->",
"current",
")",
";",
"}",
"catch",
"(",
"\\",
"OutOfBoundsException",
"$",
"e",
")",
"{... | Move forward to the next element
@return void | [
"Move",
"forward",
"to",
"the",
"next",
"element"
] | 0a621ed301dc94971ff71af062b24d6bc0858dd7 | https://github.com/DrNixx/yii2-onix/blob/0a621ed301dc94971ff71af062b24d6bc0858dd7/src/collections/Iterator.php#L129-L138 |
225,274 | bytic/form | src/Traits/HasDisplayGroupsTrait.php | HasDisplayGroupsTrait.addDisplayGroup | public function addDisplayGroup(array $elements, $name)
{
$group = $this->newDisplayGroup();
foreach ($elements as $element) {
if (isset($this->_elements[$element])) {
$add = $this->getElement($element);
if (null !== $add) {
$group->add... | php | public function addDisplayGroup(array $elements, $name)
{
$group = $this->newDisplayGroup();
foreach ($elements as $element) {
if (isset($this->_elements[$element])) {
$add = $this->getElement($element);
if (null !== $add) {
$group->add... | [
"public",
"function",
"addDisplayGroup",
"(",
"array",
"$",
"elements",
",",
"$",
"name",
")",
"{",
"$",
"group",
"=",
"$",
"this",
"->",
"newDisplayGroup",
"(",
")",
";",
"foreach",
"(",
"$",
"elements",
"as",
"$",
"element",
")",
"{",
"if",
"(",
"i... | Add a display group
Groups named elements for display purposes.
@param array $elements
@param $name
@return $this | [
"Add",
"a",
"display",
"group",
"Groups",
"named",
"elements",
"for",
"display",
"purposes",
"."
] | eb0fcb950b912c15f6fde6974e75d61eaaa06248 | https://github.com/bytic/form/blob/eb0fcb950b912c15f6fde6974e75d61eaaa06248/src/Traits/HasDisplayGroupsTrait.php#L22-L43 |
225,275 | railken/amethyst-consume-rule | src/ConsumeRules/FrequencyConsumeRule.php | FrequencyConsumeRule.getDateIntervalPropertyByUnit | public function getDateIntervalPropertyByUnit(DateInterval $diff, $unit)
{
if ($unit === 'seconds') {
return $diff->s + $diff->i * 60 + $diff->h * 60 * 60 + $diff->days * 60 * 60 * 24;
}
if ($unit === 'minutes') {
return $diff->i + $diff->h * 60 + $diff->days * 60 * ... | php | public function getDateIntervalPropertyByUnit(DateInterval $diff, $unit)
{
if ($unit === 'seconds') {
return $diff->s + $diff->i * 60 + $diff->h * 60 * 60 + $diff->days * 60 * 60 * 24;
}
if ($unit === 'minutes') {
return $diff->i + $diff->h * 60 + $diff->days * 60 * ... | [
"public",
"function",
"getDateIntervalPropertyByUnit",
"(",
"DateInterval",
"$",
"diff",
",",
"$",
"unit",
")",
"{",
"if",
"(",
"$",
"unit",
"===",
"'seconds'",
")",
"{",
"return",
"$",
"diff",
"->",
"s",
"+",
"$",
"diff",
"->",
"i",
"*",
"60",
"+",
... | Retrieve date interval property by unit.
@param DateInterval $diff
@param string $unit
@return float|int | [
"Retrieve",
"date",
"interval",
"property",
"by",
"unit",
"."
] | c07ca1ec37ab9266c1782a1068739f225ebbd397 | https://github.com/railken/amethyst-consume-rule/blob/c07ca1ec37ab9266c1782a1068739f225ebbd397/src/ConsumeRules/FrequencyConsumeRule.php#L66-L91 |
225,276 | railken/amethyst-consume-rule | src/ConsumeRules/FrequencyConsumeRule.php | FrequencyConsumeRule.convertTime | public function convertTime(string $unit, float $value)
{
if ($unit === 'seconds') {
return $value;
}
if ($unit === 'minutes') {
return $value * (60);
}
if ($unit === 'hours') {
return $value * (3600);
}
if ($unit === 'da... | php | public function convertTime(string $unit, float $value)
{
if ($unit === 'seconds') {
return $value;
}
if ($unit === 'minutes') {
return $value * (60);
}
if ($unit === 'hours') {
return $value * (3600);
}
if ($unit === 'da... | [
"public",
"function",
"convertTime",
"(",
"string",
"$",
"unit",
",",
"float",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"unit",
"===",
"'seconds'",
")",
"{",
"return",
"$",
"value",
";",
"}",
"if",
"(",
"$",
"unit",
"===",
"'minutes'",
")",
"{",
"re... | Converts to seconds.
@param string $unit
@param float $value
@return float | [
"Converts",
"to",
"seconds",
"."
] | c07ca1ec37ab9266c1782a1068739f225ebbd397 | https://github.com/railken/amethyst-consume-rule/blob/c07ca1ec37ab9266c1782a1068739f225ebbd397/src/ConsumeRules/FrequencyConsumeRule.php#L101-L132 |
225,277 | bytic/Common | src/Records/Traits/Media/Covers/RecordTrait.php | RecordTrait.cropCovers | public function cropCovers($request)
{
$path = $request['path'];
$coords = $this->getCropCoordinates($request);
$covers = $this->getNewCovers();
$full = reset($this->_coverTypes);
$cropperCover = $this->getTempCover();
$cropperCover->setResourceFromFile(UPLOADS_PATH... | php | public function cropCovers($request)
{
$path = $request['path'];
$coords = $this->getCropCoordinates($request);
$covers = $this->getNewCovers();
$full = reset($this->_coverTypes);
$cropperCover = $this->getTempCover();
$cropperCover->setResourceFromFile(UPLOADS_PATH... | [
"public",
"function",
"cropCovers",
"(",
"$",
"request",
")",
"{",
"$",
"path",
"=",
"$",
"request",
"[",
"'path'",
"]",
";",
"$",
"coords",
"=",
"$",
"this",
"->",
"getCropCoordinates",
"(",
"$",
"request",
")",
";",
"$",
"covers",
"=",
"$",
"this",... | Saves cropped covers
@param array $request | [
"Saves",
"cropped",
"covers"
] | 5d17043e03a2274a758fba1f6dedb7d85195bcfb | https://github.com/bytic/Common/blob/5d17043e03a2274a758fba1f6dedb7d85195bcfb/src/Records/Traits/Media/Covers/RecordTrait.php#L246-L288 |
225,278 | mvccore/ext-debug-tracy-session | src/MvcCore/Ext/Debugs/Tracys/SessionPanel.php | SessionPanel.prepareSessionData | protected function prepareSessionData () {
if ($_SESSION === NULL) return;
// read `\MvcCore\Session` storage
$sessionClass = \MvcCore\Application::GetInstance()->GetSessionClass();
$sessionRawMetaStore = $sessionClass::GetSessionMetadata();
$sessionMetaStore = $sessionRawMetaStore instanceof \stdClass
? ... | php | protected function prepareSessionData () {
if ($_SESSION === NULL) return;
// read `\MvcCore\Session` storage
$sessionClass = \MvcCore\Application::GetInstance()->GetSessionClass();
$sessionRawMetaStore = $sessionClass::GetSessionMetadata();
$sessionMetaStore = $sessionRawMetaStore instanceof \stdClass
? ... | [
"protected",
"function",
"prepareSessionData",
"(",
")",
"{",
"if",
"(",
"$",
"_SESSION",
"===",
"NULL",
")",
"return",
";",
"// read `\\MvcCore\\Session` storage",
"$",
"sessionClass",
"=",
"\\",
"MvcCore",
"\\",
"Application",
"::",
"GetInstance",
"(",
")",
"-... | Read and parse session data except MvcCore metadata session record.
@return void | [
"Read",
"and",
"parse",
"session",
"data",
"except",
"MvcCore",
"metadata",
"session",
"record",
"."
] | fddbf5bec01d5f0e31f14e94beac7f5480e8630f | https://github.com/mvccore/ext-debug-tracy-session/blob/fddbf5bec01d5f0e31f14e94beac7f5480e8630f/src/MvcCore/Ext/Debugs/Tracys/SessionPanel.php#L103-L172 |
225,279 | mvccore/ext-debug-tracy-session | src/MvcCore/Ext/Debugs/Tracys/SessionPanel.php | SessionPanel._formateMaxLifeTimestamp | private function _formateMaxLifeTimestamp ($timestamp = 0) {
$result = [];
if ($timestamp >= 31557600) {
$localVal = floor($timestamp / 31557600);
$result[] = $localVal . ' year' . (($localVal > 1) ? 's' : '');
if ($localVal > 1) return 'more than ' . $result[0];
$timestamp = $timestamp - (floor($timest... | php | private function _formateMaxLifeTimestamp ($timestamp = 0) {
$result = [];
if ($timestamp >= 31557600) {
$localVal = floor($timestamp / 31557600);
$result[] = $localVal . ' year' . (($localVal > 1) ? 's' : '');
if ($localVal > 1) return 'more than ' . $result[0];
$timestamp = $timestamp - (floor($timest... | [
"private",
"function",
"_formateMaxLifeTimestamp",
"(",
"$",
"timestamp",
"=",
"0",
")",
"{",
"$",
"result",
"=",
"[",
"]",
";",
"if",
"(",
"$",
"timestamp",
">=",
"31557600",
")",
"{",
"$",
"localVal",
"=",
"floor",
"(",
"$",
"timestamp",
"/",
"315576... | Return expiration time in human readable format from seconds count.
@param int $timestamp
@return string | [
"Return",
"expiration",
"time",
"in",
"human",
"readable",
"format",
"from",
"seconds",
"count",
"."
] | fddbf5bec01d5f0e31f14e94beac7f5480e8630f | https://github.com/mvccore/ext-debug-tracy-session/blob/fddbf5bec01d5f0e31f14e94beac7f5480e8630f/src/MvcCore/Ext/Debugs/Tracys/SessionPanel.php#L179-L214 |
225,280 | sopinetchat/SopinetChatBundle | Service/FileHelper.php | FileHelper.uploadFileByFile | public function uploadFileByFile(UploadedFile $file_request, $fieldName, $classFileString) {
$file_content = file_get_contents($file_request->getPathname());
$file_extension = $file_request->getClientOriginalExtension();
$file_app_object = $this->writeFileBytes($file_content, $file_extension, $... | php | public function uploadFileByFile(UploadedFile $file_request, $fieldName, $classFileString) {
$file_content = file_get_contents($file_request->getPathname());
$file_extension = $file_request->getClientOriginalExtension();
$file_app_object = $this->writeFileBytes($file_content, $file_extension, $... | [
"public",
"function",
"uploadFileByFile",
"(",
"UploadedFile",
"$",
"file_request",
",",
"$",
"fieldName",
",",
"$",
"classFileString",
")",
"{",
"$",
"file_content",
"=",
"file_get_contents",
"(",
"$",
"file_request",
"->",
"getPathname",
"(",
")",
")",
";",
... | Guarda un fichero y devuelve su objeto File
@param UploadedFile $file_request
@param String $fieldName / Nombre del campo para el fichero en base de datos
@return File | [
"Guarda",
"un",
"fichero",
"y",
"devuelve",
"su",
"objeto",
"File"
] | 92c306963d8e9c74ecaa06422cea65bcf1bb3ba2 | https://github.com/sopinetchat/SopinetChatBundle/blob/92c306963d8e9c74ecaa06422cea65bcf1bb3ba2/Service/FileHelper.php#L32-L41 |
225,281 | sopinetchat/SopinetChatBundle | Service/FileHelper.php | FileHelper.createDir | private function createDir($path) {
$dir = $path;
if (!is_dir($dir)) {
$old = umask(0);
mkdir($dir,0777,true);
umask($old);
chmod($dir, 0777);
}
return $dir;
} | php | private function createDir($path) {
$dir = $path;
if (!is_dir($dir)) {
$old = umask(0);
mkdir($dir,0777,true);
umask($old);
chmod($dir, 0777);
}
return $dir;
} | [
"private",
"function",
"createDir",
"(",
"$",
"path",
")",
"{",
"$",
"dir",
"=",
"$",
"path",
";",
"if",
"(",
"!",
"is_dir",
"(",
"$",
"dir",
")",
")",
"{",
"$",
"old",
"=",
"umask",
"(",
"0",
")",
";",
"mkdir",
"(",
"$",
"dir",
",",
"0777",
... | Funcion para crear un directorio
@param unknown $path - Directorio a crear
@return unknown | [
"Funcion",
"para",
"crear",
"un",
"directorio"
] | 92c306963d8e9c74ecaa06422cea65bcf1bb3ba2 | https://github.com/sopinetchat/SopinetChatBundle/blob/92c306963d8e9c74ecaa06422cea65bcf1bb3ba2/Service/FileHelper.php#L48-L57 |
225,282 | sopinetchat/SopinetChatBundle | Service/FileHelper.php | FileHelper.bytes_to_file | private function bytes_to_file($bytes, $output_file) {
$ifp = fopen($output_file, "wb");
fwrite($ifp, $bytes);
fclose($ifp);
} | php | private function bytes_to_file($bytes, $output_file) {
$ifp = fopen($output_file, "wb");
fwrite($ifp, $bytes);
fclose($ifp);
} | [
"private",
"function",
"bytes_to_file",
"(",
"$",
"bytes",
",",
"$",
"output_file",
")",
"{",
"$",
"ifp",
"=",
"fopen",
"(",
"$",
"output_file",
",",
"\"wb\"",
")",
";",
"fwrite",
"(",
"$",
"ifp",
",",
"$",
"bytes",
")",
";",
"fclose",
"(",
"$",
"i... | Pasa bytes a Fichero
@param $bytes
@param $output_file | [
"Pasa",
"bytes",
"a",
"Fichero"
] | 92c306963d8e9c74ecaa06422cea65bcf1bb3ba2 | https://github.com/sopinetchat/SopinetChatBundle/blob/92c306963d8e9c74ecaa06422cea65bcf1bb3ba2/Service/FileHelper.php#L65-L69 |
225,283 | sopinetchat/SopinetChatBundle | Service/FileHelper.php | FileHelper.writeFileBytes | private function writeFileBytes($data_bytes, $extension, $field, $classFileString) {
$dir_rel = "uploads" . DIRECTORY_SEPARATOR . "gallery" . DIRECTORY_SEPARATOR;
$dir = $this->createDir($this->getRoot(). DIRECTORY_SEPARATOR ."web" . DIRECTORY_SEPARATOR . $dir_rel);
$file = new $classFileString;... | php | private function writeFileBytes($data_bytes, $extension, $field, $classFileString) {
$dir_rel = "uploads" . DIRECTORY_SEPARATOR . "gallery" . DIRECTORY_SEPARATOR;
$dir = $this->createDir($this->getRoot(). DIRECTORY_SEPARATOR ."web" . DIRECTORY_SEPARATOR . $dir_rel);
$file = new $classFileString;... | [
"private",
"function",
"writeFileBytes",
"(",
"$",
"data_bytes",
",",
"$",
"extension",
",",
"$",
"field",
",",
"$",
"classFileString",
")",
"{",
"$",
"dir_rel",
"=",
"\"uploads\"",
".",
"DIRECTORY_SEPARATOR",
".",
"\"gallery\"",
".",
"DIRECTORY_SEPARATOR",
";",... | Escribe en un fichero sus Bytes, crea el objeto File
@param $data_bytes
@param $extension
@return File | [
"Escribe",
"en",
"un",
"fichero",
"sus",
"Bytes",
"crea",
"el",
"objeto",
"File"
] | 92c306963d8e9c74ecaa06422cea65bcf1bb3ba2 | https://github.com/sopinetchat/SopinetChatBundle/blob/92c306963d8e9c74ecaa06422cea65bcf1bb3ba2/Service/FileHelper.php#L78-L97 |
225,284 | czogori/Dami | src/Dami/DependencyInjection/DamiExtension.php | DamiExtension.defineParameters | private function defineParameters(ContainerBuilder $container)
{
$container->setParameter('dami.api.class', 'Dami\Migration\Api\ApiMigration');
$container->setParameter('dami.template_renderer.class', 'Dami\Migration\TemplateRenderer');
$container->setParameter('dami.template_initialization.... | php | private function defineParameters(ContainerBuilder $container)
{
$container->setParameter('dami.api.class', 'Dami\Migration\Api\ApiMigration');
$container->setParameter('dami.template_renderer.class', 'Dami\Migration\TemplateRenderer');
$container->setParameter('dami.template_initialization.... | [
"private",
"function",
"defineParameters",
"(",
"ContainerBuilder",
"$",
"container",
")",
"{",
"$",
"container",
"->",
"setParameter",
"(",
"'dami.api.class'",
",",
"'Dami\\Migration\\Api\\ApiMigration'",
")",
";",
"$",
"container",
"->",
"setParameter",
"(",
"'dami.... | Define parameters.
@param ContainerBuilder $container
@return void | [
"Define",
"parameters",
"."
] | 19612e643f8bea76706cc667c3f2c12a42d4cd19 | https://github.com/czogori/Dami/blob/19612e643f8bea76706cc667c3f2c12a42d4cd19/src/Dami/DependencyInjection/DamiExtension.php#L102-L108 |
225,285 | czogori/Dami | src/Dami/DependencyInjection/DamiExtension.php | DamiExtension.defineConnectionConfigParameter | private function defineConnectionConfigParameter(ContainerBuilder $container, $config)
{
$definition = new Definition('Rentgen\Database\Connection\ConnectionConfig');
$definition->setArguments(array($config['environments']));
$container->setDefinition('connection_config', $definition);
} | php | private function defineConnectionConfigParameter(ContainerBuilder $container, $config)
{
$definition = new Definition('Rentgen\Database\Connection\ConnectionConfig');
$definition->setArguments(array($config['environments']));
$container->setDefinition('connection_config', $definition);
} | [
"private",
"function",
"defineConnectionConfigParameter",
"(",
"ContainerBuilder",
"$",
"container",
",",
"$",
"config",
")",
"{",
"$",
"definition",
"=",
"new",
"Definition",
"(",
"'Rentgen\\Database\\Connection\\ConnectionConfig'",
")",
";",
"$",
"definition",
"->",
... | Define connection config parameters.
@param ContainerBuilder $container
@param array $config
@return void | [
"Define",
"connection",
"config",
"parameters",
"."
] | 19612e643f8bea76706cc667c3f2c12a42d4cd19 | https://github.com/czogori/Dami/blob/19612e643f8bea76706cc667c3f2c12a42d4cd19/src/Dami/DependencyInjection/DamiExtension.php#L118-L123 |
225,286 | SetBased/php-abc-form | src/Control/ComplexControl.php | ComplexControl.getErrorMessages | public function getErrorMessages($recursive = false): ?array
{
$ret = [];
if ($recursive)
{
foreach ($this->controls as $control)
{
$tmp = $control->getErrorMessages(true);
if (is_array($tmp))
{
$ret = array_merge($ret, $tmp);
}
}
}
if (... | php | public function getErrorMessages($recursive = false): ?array
{
$ret = [];
if ($recursive)
{
foreach ($this->controls as $control)
{
$tmp = $control->getErrorMessages(true);
if (is_array($tmp))
{
$ret = array_merge($ret, $tmp);
}
}
}
if (... | [
"public",
"function",
"getErrorMessages",
"(",
"$",
"recursive",
"=",
"false",
")",
":",
"?",
"array",
"{",
"$",
"ret",
"=",
"[",
"]",
";",
"if",
"(",
"$",
"recursive",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"controls",
"as",
"$",
"control",
... | Returns an array of all error messages of the child form controls of this complex form controls.
@param bool $recursive If set error messages of complex child controls of this complex form controls are fetched
also.
@return array|null
@since 1.0.0
@api | [
"Returns",
"an",
"array",
"of",
"all",
"error",
"messages",
"of",
"the",
"child",
"form",
"controls",
"of",
"this",
"complex",
"form",
"controls",
"."
] | a7343e2b7dda411f5f0fc7d64324bc9d021aa73e | https://github.com/SetBased/php-abc-form/blob/a7343e2b7dda411f5f0fc7d64324bc9d021aa73e/src/Control/ComplexControl.php#L159-L182 |
225,287 | SetBased/php-abc-form | src/Control/ComplexControl.php | ComplexControl.prepare | public function prepare(string $parentSubmitName): void
{
parent::prepare($parentSubmitName);
foreach ($this->controls as $control)
{
$control->prepare($this->submitName);
}
} | php | public function prepare(string $parentSubmitName): void
{
parent::prepare($parentSubmitName);
foreach ($this->controls as $control)
{
$control->prepare($this->submitName);
}
} | [
"public",
"function",
"prepare",
"(",
"string",
"$",
"parentSubmitName",
")",
":",
"void",
"{",
"parent",
"::",
"prepare",
"(",
"$",
"parentSubmitName",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"controls",
"as",
"$",
"control",
")",
"{",
"$",
"contro... | Prepares this form complex control for HTML code generation or loading submitted values.
@param string $parentSubmitName The submit name of the parent control.
@since 1.0.0
@api | [
"Prepares",
"this",
"form",
"complex",
"control",
"for",
"HTML",
"code",
"generation",
"or",
"loading",
"submitted",
"values",
"."
] | a7343e2b7dda411f5f0fc7d64324bc9d021aa73e | https://github.com/SetBased/php-abc-form/blob/a7343e2b7dda411f5f0fc7d64324bc9d021aa73e/src/Control/ComplexControl.php#L362-L370 |
225,288 | SetBased/php-abc-form | src/Control/ComplexControl.php | ComplexControl.setValue | public function setValue($values): void
{
foreach ($this->controls as $control)
{
$control->setValuesBase($values);
}
} | php | public function setValue($values): void
{
foreach ($this->controls as $control)
{
$control->setValuesBase($values);
}
} | [
"public",
"function",
"setValue",
"(",
"$",
"values",
")",
":",
"void",
"{",
"foreach",
"(",
"$",
"this",
"->",
"controls",
"as",
"$",
"control",
")",
"{",
"$",
"control",
"->",
"setValuesBase",
"(",
"$",
"values",
")",
";",
"}",
"}"
] | Sets the values of the form controls of this complex control. The values of form controls for which no explicit
value is set are set to null.
@param mixed $values The values as a nested array.
@since 1.0.0
@api | [
"Sets",
"the",
"values",
"of",
"the",
"form",
"controls",
"of",
"this",
"complex",
"control",
".",
"The",
"values",
"of",
"form",
"controls",
"for",
"which",
"no",
"explicit",
"value",
"is",
"set",
"are",
"set",
"to",
"null",
"."
] | a7343e2b7dda411f5f0fc7d64324bc9d021aa73e | https://github.com/SetBased/php-abc-form/blob/a7343e2b7dda411f5f0fc7d64324bc9d021aa73e/src/Control/ComplexControl.php#L425-L431 |
225,289 | SetBased/php-abc-form | src/Control/ComplexControl.php | ComplexControl.validateBase | public function validateBase(array &$invalidFormControls): bool
{
$valid = true;
// First, validate all child form controls.
foreach ($this->controls as $control)
{
if (!$control->validateBase($invalidFormControls))
{
$this->invalidControls[] = $control;
$valid ... | php | public function validateBase(array &$invalidFormControls): bool
{
$valid = true;
// First, validate all child form controls.
foreach ($this->controls as $control)
{
if (!$control->validateBase($invalidFormControls))
{
$this->invalidControls[] = $control;
$valid ... | [
"public",
"function",
"validateBase",
"(",
"array",
"&",
"$",
"invalidFormControls",
")",
":",
"bool",
"{",
"$",
"valid",
"=",
"true",
";",
"// First, validate all child form controls.",
"foreach",
"(",
"$",
"this",
"->",
"controls",
"as",
"$",
"control",
")",
... | Executes a validators on the child form controls of this form complex control. If and only if all child form
controls are valid the validators of this complex control are executed.
@param array $invalidFormControls A nested array of invalid form controls.
@return bool True if and only if all form controls are valid. | [
"Executes",
"a",
"validators",
"on",
"the",
"child",
"form",
"controls",
"of",
"this",
"form",
"complex",
"control",
".",
"If",
"and",
"only",
"if",
"all",
"child",
"form",
"controls",
"are",
"valid",
"the",
"validators",
"of",
"this",
"complex",
"control",
... | a7343e2b7dda411f5f0fc7d64324bc9d021aa73e | https://github.com/SetBased/php-abc-form/blob/a7343e2b7dda411f5f0fc7d64324bc9d021aa73e/src/Control/ComplexControl.php#L459-L488 |
225,290 | railken/amethyst-api | src/Api/Transformers/BaseTransformer.php | BaseTransformer.resolveInclude | public function resolveInclude(string $relationName, array $args)
{
$entity = $args[0];
$relation = $entity->{$relationName};
if (!$relation) {
return null;
}
if ($relation instanceof Collection) {
if ($relation->count() === 0) {
ret... | php | public function resolveInclude(string $relationName, array $args)
{
$entity = $args[0];
$relation = $entity->{$relationName};
if (!$relation) {
return null;
}
if ($relation instanceof Collection) {
if ($relation->count() === 0) {
ret... | [
"public",
"function",
"resolveInclude",
"(",
"string",
"$",
"relationName",
",",
"array",
"$",
"args",
")",
"{",
"$",
"entity",
"=",
"$",
"args",
"[",
"0",
"]",
";",
"$",
"relation",
"=",
"$",
"entity",
"->",
"{",
"$",
"relationName",
"}",
";",
"if",... | Resolve an include using the manager.
@param string $relationName
@param array $args
@return \League\Fractal\Resource\Item | [
"Resolve",
"an",
"include",
"using",
"the",
"manager",
"."
] | 00b78540b05dac59e6ef9367f1c37623a5754b89 | https://github.com/railken/amethyst-api/blob/00b78540b05dac59e6ef9367f1c37623a5754b89/src/Api/Transformers/BaseTransformer.php#L111-L144 |
225,291 | railken/amethyst-api | src/Api/Support/Sorter.php | Sorter.add | public function add($name, $direction)
{
if (!in_array($name, $this->keys, true)) {
throw new Exceptions\InvalidSorterFieldException($name);
}
if (!in_array($direction, ['asc', 'desc'], true)) {
throw new Exceptions\InvalidSorterDirectionException($direction);
... | php | public function add($name, $direction)
{
if (!in_array($name, $this->keys, true)) {
throw new Exceptions\InvalidSorterFieldException($name);
}
if (!in_array($direction, ['asc', 'desc'], true)) {
throw new Exceptions\InvalidSorterDirectionException($direction);
... | [
"public",
"function",
"add",
"(",
"$",
"name",
",",
"$",
"direction",
")",
"{",
"if",
"(",
"!",
"in_array",
"(",
"$",
"name",
",",
"$",
"this",
"->",
"keys",
",",
"true",
")",
")",
"{",
"throw",
"new",
"Exceptions",
"\\",
"InvalidSorterFieldException",... | Perform the query and retrieve the information about pagination.
@param string $name
@param string $direction
@return $this | [
"Perform",
"the",
"query",
"and",
"retrieve",
"the",
"information",
"about",
"pagination",
"."
] | 00b78540b05dac59e6ef9367f1c37623a5754b89 | https://github.com/railken/amethyst-api/blob/00b78540b05dac59e6ef9367f1c37623a5754b89/src/Api/Support/Sorter.php#L43-L56 |
225,292 | stubbles/stubbles-input | src/main/php/filter/JsonFilter.php | JsonFilter.isValidJsonStructure | private function isValidJsonStructure(string $json): bool
{
if ('{' === $json[0] && $json[strlen($json) - 1] !== '}') {
return false;
} elseif ('[' === $json[0] && $json[strlen($json) - 1] !== ']') {
return false;
} elseif ('{' !== $json[0] && '[' !== $json[0]) {
... | php | private function isValidJsonStructure(string $json): bool
{
if ('{' === $json[0] && $json[strlen($json) - 1] !== '}') {
return false;
} elseif ('[' === $json[0] && $json[strlen($json) - 1] !== ']') {
return false;
} elseif ('{' !== $json[0] && '[' !== $json[0]) {
... | [
"private",
"function",
"isValidJsonStructure",
"(",
"string",
"$",
"json",
")",
":",
"bool",
"{",
"if",
"(",
"'{'",
"===",
"$",
"json",
"[",
"0",
"]",
"&&",
"$",
"json",
"[",
"strlen",
"(",
"$",
"json",
")",
"-",
"1",
"]",
"!==",
"'}'",
")",
"{",... | checks if given json is valid a valid structure
JSON can only be an object or an array structure (see JSON spec & RFC),
but json_decode() lacks this restriction.
@param string $json
@return bool | [
"checks",
"if",
"given",
"json",
"is",
"valid",
"a",
"valid",
"structure"
] | 1ce0ebe5ba392faf3cc369a95e3fe0fa38912b1e | https://github.com/stubbles/stubbles-input/blob/1ce0ebe5ba392faf3cc369a95e3fe0fa38912b1e/src/main/php/filter/JsonFilter.php#L85-L96 |
225,293 | DemonTPx/util-bundle | src/Controller/BaseController.php | BaseController.addReferrerToForm | public function addReferrerToForm(FormInterface $form): void
{
$request = $this->get('request_stack')->getCurrentRequest();
$form->add('http-referrer', HiddenType::class, [
'mapped' => false,
'data' => $request->headers->get('referer'),
]);
} | php | public function addReferrerToForm(FormInterface $form): void
{
$request = $this->get('request_stack')->getCurrentRequest();
$form->add('http-referrer', HiddenType::class, [
'mapped' => false,
'data' => $request->headers->get('referer'),
]);
} | [
"public",
"function",
"addReferrerToForm",
"(",
"FormInterface",
"$",
"form",
")",
":",
"void",
"{",
"$",
"request",
"=",
"$",
"this",
"->",
"get",
"(",
"'request_stack'",
")",
"->",
"getCurrentRequest",
"(",
")",
";",
"$",
"form",
"->",
"add",
"(",
"'ht... | Add the current HTTP referrer header to the form
@see redirectToFormReferrer | [
"Add",
"the",
"current",
"HTTP",
"referrer",
"header",
"to",
"the",
"form"
] | 5f58a0e4a383549e996a00d1d63fcb7a337ffaba | https://github.com/DemonTPx/util-bundle/blob/5f58a0e4a383549e996a00d1d63fcb7a337ffaba/src/Controller/BaseController.php#L20-L27 |
225,294 | DemonTPx/util-bundle | src/Controller/BaseController.php | BaseController.redirectToReferrer | public function redirectToReferrer(string $defaultRoute = null): RedirectResponse
{
$request = $this->get('request_stack')->getCurrentRequest();
return $this->redirectToFirstValidRoute([
$request->headers->get('referer'),
$defaultRoute,
]);
} | php | public function redirectToReferrer(string $defaultRoute = null): RedirectResponse
{
$request = $this->get('request_stack')->getCurrentRequest();
return $this->redirectToFirstValidRoute([
$request->headers->get('referer'),
$defaultRoute,
]);
} | [
"public",
"function",
"redirectToReferrer",
"(",
"string",
"$",
"defaultRoute",
"=",
"null",
")",
":",
"RedirectResponse",
"{",
"$",
"request",
"=",
"$",
"this",
"->",
"get",
"(",
"'request_stack'",
")",
"->",
"getCurrentRequest",
"(",
")",
";",
"return",
"$... | Redirect to the referrer
Falls back to the default route when no referrer is defined | [
"Redirect",
"to",
"the",
"referrer",
"Falls",
"back",
"to",
"the",
"default",
"route",
"when",
"no",
"referrer",
"is",
"defined"
] | 5f58a0e4a383549e996a00d1d63fcb7a337ffaba | https://github.com/DemonTPx/util-bundle/blob/5f58a0e4a383549e996a00d1d63fcb7a337ffaba/src/Controller/BaseController.php#L46-L54 |
225,295 | DemonTPx/util-bundle | src/Controller/BaseController.php | BaseController.redirectToFirstValidRoute | public function redirectToFirstValidRoute(array $routeList): RedirectResponse
{
foreach ($routeList as $route) {
if ($route) {
return $this->redirect($route);
}
}
throw new \InvalidArgumentException('No valid route given');
} | php | public function redirectToFirstValidRoute(array $routeList): RedirectResponse
{
foreach ($routeList as $route) {
if ($route) {
return $this->redirect($route);
}
}
throw new \InvalidArgumentException('No valid route given');
} | [
"public",
"function",
"redirectToFirstValidRoute",
"(",
"array",
"$",
"routeList",
")",
":",
"RedirectResponse",
"{",
"foreach",
"(",
"$",
"routeList",
"as",
"$",
"route",
")",
"{",
"if",
"(",
"$",
"route",
")",
"{",
"return",
"$",
"this",
"->",
"redirect"... | Redirect to the first valid route in the given list
@param string[] $routeList | [
"Redirect",
"to",
"the",
"first",
"valid",
"route",
"in",
"the",
"given",
"list"
] | 5f58a0e4a383549e996a00d1d63fcb7a337ffaba | https://github.com/DemonTPx/util-bundle/blob/5f58a0e4a383549e996a00d1d63fcb7a337ffaba/src/Controller/BaseController.php#L61-L70 |
225,296 | stubbles/stubbles-input | src/main/php/ValueReader.php | ValueReader.required | public function required(string $errorId = 'FIELD_EMPTY'): valuereader\CommonValueReader
{
if ($this->value->isNull()) {
return new valuereader\MissingValueReader(
function($actualErrorId)
{
$this->paramErrors->append($this->p... | php | public function required(string $errorId = 'FIELD_EMPTY'): valuereader\CommonValueReader
{
if ($this->value->isNull()) {
return new valuereader\MissingValueReader(
function($actualErrorId)
{
$this->paramErrors->append($this->p... | [
"public",
"function",
"required",
"(",
"string",
"$",
"errorId",
"=",
"'FIELD_EMPTY'",
")",
":",
"valuereader",
"\\",
"CommonValueReader",
"{",
"if",
"(",
"$",
"this",
"->",
"value",
"->",
"isNull",
"(",
")",
")",
"{",
"return",
"new",
"valuereader",
"\\",... | enforce the value to be required
@api
@param string $errorId optional error id to use when value not set
@return \stubbles\input\valuereader\CommonValueReader | [
"enforce",
"the",
"value",
"to",
"be",
"required"
] | 1ce0ebe5ba392faf3cc369a95e3fe0fa38912b1e | https://github.com/stubbles/stubbles-input/blob/1ce0ebe5ba392faf3cc369a95e3fe0fa38912b1e/src/main/php/ValueReader.php#L97-L110 |
225,297 | stubbles/stubbles-input | src/main/php/ValueReader.php | ValueReader.asBool | public function asBool()
{
if ($this->value->isNull()) {
return null;
}
return $this->value->isOneOf([1, '1', 'true', true, 'yes'], true);
} | php | public function asBool()
{
if ($this->value->isNull()) {
return null;
}
return $this->value->isOneOf([1, '1', 'true', true, 'yes'], true);
} | [
"public",
"function",
"asBool",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"value",
"->",
"isNull",
"(",
")",
")",
"{",
"return",
"null",
";",
"}",
"return",
"$",
"this",
"->",
"value",
"->",
"isOneOf",
"(",
"[",
"1",
",",
"'1'",
",",
"'true'",... | read as boolean value
@api
@return bool
@since 1.7.0 | [
"read",
"as",
"boolean",
"value"
] | 1ce0ebe5ba392faf3cc369a95e3fe0fa38912b1e | https://github.com/stubbles/stubbles-input/blob/1ce0ebe5ba392faf3cc369a95e3fe0fa38912b1e/src/main/php/ValueReader.php#L164-L171 |
225,298 | stubbles/stubbles-input | src/main/php/ValueReader.php | ValueReader.asInt | public function asInt(NumberRange $range = null)
{
return $this->handleFilter(
function() use($range)
{
return filter\RangeFilter::wrap(
filter\IntegerFilter::instance(),
$range
... | php | public function asInt(NumberRange $range = null)
{
return $this->handleFilter(
function() use($range)
{
return filter\RangeFilter::wrap(
filter\IntegerFilter::instance(),
$range
... | [
"public",
"function",
"asInt",
"(",
"NumberRange",
"$",
"range",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"handleFilter",
"(",
"function",
"(",
")",
"use",
"(",
"$",
"range",
")",
"{",
"return",
"filter",
"\\",
"RangeFilter",
"::",
"wrap",
"... | read as integer value
@api
@param \stubbles\input\filter\range\NumberRange $range optional range of allowed values
@return int | [
"read",
"as",
"integer",
"value"
] | 1ce0ebe5ba392faf3cc369a95e3fe0fa38912b1e | https://github.com/stubbles/stubbles-input/blob/1ce0ebe5ba392faf3cc369a95e3fe0fa38912b1e/src/main/php/ValueReader.php#L180-L191 |
225,299 | stubbles/stubbles-input | src/main/php/ValueReader.php | ValueReader.asSecret | public function asSecret(StringLength $length = null)
{
return $this->handleFilter(
function() use($length)
{
return filter\RangeFilter::wrap(
filter\SecretFilter::instance(),
$length
... | php | public function asSecret(StringLength $length = null)
{
return $this->handleFilter(
function() use($length)
{
return filter\RangeFilter::wrap(
filter\SecretFilter::instance(),
$length
... | [
"public",
"function",
"asSecret",
"(",
"StringLength",
"$",
"length",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"handleFilter",
"(",
"function",
"(",
")",
"use",
"(",
"$",
"length",
")",
"{",
"return",
"filter",
"\\",
"RangeFilter",
"::",
"wrap... | read as secret
@api
@param \stubbles\input\filter\range\StringLength $length optional allowed length of string
@return \stubbles\values\Secret
@since 6.0.0 | [
"read",
"as",
"secret"
] | 1ce0ebe5ba392faf3cc369a95e3fe0fa38912b1e | https://github.com/stubbles/stubbles-input/blob/1ce0ebe5ba392faf3cc369a95e3fe0fa38912b1e/src/main/php/ValueReader.php#L243-L254 |
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.