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,400 | interserver/myadmin-plugin-installer | src/Plugin.php | Plugin.setPermissions | public static function setPermissions(Event $event)
{
if ('WIN' === strtoupper(substr(PHP_OS, 0, 3))) {
$event->getIO()->write('<info>No permissions setup is required on Windows.</info>');
return;
}
$event->getIO()->write('Setting up permissions.');
/* try {
self::setPermissionsSetfacl($event);
... | php | public static function setPermissions(Event $event)
{
if ('WIN' === strtoupper(substr(PHP_OS, 0, 3))) {
$event->getIO()->write('<info>No permissions setup is required on Windows.</info>');
return;
}
$event->getIO()->write('Setting up permissions.');
/* try {
self::setPermissionsSetfacl($event);
... | [
"public",
"static",
"function",
"setPermissions",
"(",
"Event",
"$",
"event",
")",
"{",
"if",
"(",
"'WIN'",
"===",
"strtoupper",
"(",
"substr",
"(",
"PHP_OS",
",",
"0",
",",
"3",
")",
")",
")",
"{",
"$",
"event",
"->",
"getIO",
"(",
")",
"->",
"wri... | An event that triggers setting writable permissions on any directories specified in the writable-dirs composer extra options
@param Event $event
@return void | [
"An",
"event",
"that",
"triggers",
"setting",
"writable",
"permissions",
"on",
"any",
"directories",
"specified",
"in",
"the",
"writable",
"-",
"dirs",
"composer",
"extra",
"options"
] | 128efde0b61f5623b094cbb399e66ab4aa0dba3f | https://github.com/interserver/myadmin-plugin-installer/blob/128efde0b61f5623b094cbb399e66ab4aa0dba3f/src/Plugin.php#L125-L145 |
225,401 | interserver/myadmin-plugin-installer | src/Plugin.php | Plugin.getWritableDirs | public static function getWritableDirs(Event $event)
{
$configuration = $event->getComposer()->getPackage()->getExtra();
if (!isset($configuration['writable-dirs'])) {
throw new \Exception('The writable-dirs must be specified in composer arbitrary extra data.');
}
if (!is_array($configuration['writable-dirs... | php | public static function getWritableDirs(Event $event)
{
$configuration = $event->getComposer()->getPackage()->getExtra();
if (!isset($configuration['writable-dirs'])) {
throw new \Exception('The writable-dirs must be specified in composer arbitrary extra data.');
}
if (!is_array($configuration['writable-dirs... | [
"public",
"static",
"function",
"getWritableDirs",
"(",
"Event",
"$",
"event",
")",
"{",
"$",
"configuration",
"=",
"$",
"event",
"->",
"getComposer",
"(",
")",
"->",
"getPackage",
"(",
")",
"->",
"getExtra",
"(",
")",
";",
"if",
"(",
"!",
"isset",
"("... | returns a list of writeable directories specified in the writeable-dirs composer extra options
@param Event $event
@return array an array of directory paths | [
"returns",
"a",
"list",
"of",
"writeable",
"directories",
"specified",
"in",
"the",
"writeable",
"-",
"dirs",
"composer",
"extra",
"options"
] | 128efde0b61f5623b094cbb399e66ab4aa0dba3f | https://github.com/interserver/myadmin-plugin-installer/blob/128efde0b61f5623b094cbb399e66ab4aa0dba3f/src/Plugin.php#L153-L163 |
225,402 | interserver/myadmin-plugin-installer | src/Plugin.php | Plugin.setPermissionsSetfacl | public static function setPermissionsSetfacl(Event $event)
{
$http_user = self::getHttpdUser($event);
foreach (self::getWritableDirs($event) as $path) {
self::SetfaclPermissionsSetter($event, $http_user, $path);
}
foreach (self::getWritableFiles($event) as $path) {
self::ChmodPermissionsSetter($event, $h... | php | public static function setPermissionsSetfacl(Event $event)
{
$http_user = self::getHttpdUser($event);
foreach (self::getWritableDirs($event) as $path) {
self::SetfaclPermissionsSetter($event, $http_user, $path);
}
foreach (self::getWritableFiles($event) as $path) {
self::ChmodPermissionsSetter($event, $h... | [
"public",
"static",
"function",
"setPermissionsSetfacl",
"(",
"Event",
"$",
"event",
")",
"{",
"$",
"http_user",
"=",
"self",
"::",
"getHttpdUser",
"(",
"$",
"event",
")",
";",
"foreach",
"(",
"self",
"::",
"getWritableDirs",
"(",
"$",
"event",
")",
"as",
... | Sets Writrable Directory permissions for any directories listed in the writeable-dirs option using setfacl
@param Event $event | [
"Sets",
"Writrable",
"Directory",
"permissions",
"for",
"any",
"directories",
"listed",
"in",
"the",
"writeable",
"-",
"dirs",
"option",
"using",
"setfacl"
] | 128efde0b61f5623b094cbb399e66ab4aa0dba3f | https://github.com/interserver/myadmin-plugin-installer/blob/128efde0b61f5623b094cbb399e66ab4aa0dba3f/src/Plugin.php#L188-L197 |
225,403 | interserver/myadmin-plugin-installer | src/Plugin.php | Plugin.setPermissionsChmod | public static function setPermissionsChmod(Event $event)
{
$http_user = self::getHttpdUser($event);
foreach (self::getWritableDirs($event) as $path) {
self::ChmodPermissionsSetter($event, $http_user, $path, 'dir');
}
foreach (self::getWritableFiles($event) as $path) {
self::ChmodPermissionsSetter($event,... | php | public static function setPermissionsChmod(Event $event)
{
$http_user = self::getHttpdUser($event);
foreach (self::getWritableDirs($event) as $path) {
self::ChmodPermissionsSetter($event, $http_user, $path, 'dir');
}
foreach (self::getWritableFiles($event) as $path) {
self::ChmodPermissionsSetter($event,... | [
"public",
"static",
"function",
"setPermissionsChmod",
"(",
"Event",
"$",
"event",
")",
"{",
"$",
"http_user",
"=",
"self",
"::",
"getHttpdUser",
"(",
"$",
"event",
")",
";",
"foreach",
"(",
"self",
"::",
"getWritableDirs",
"(",
"$",
"event",
")",
"as",
... | Sets Writrable Directory permissions for any directories listed in the writeable-dirs option using chmod
@param Event $event | [
"Sets",
"Writrable",
"Directory",
"permissions",
"for",
"any",
"directories",
"listed",
"in",
"the",
"writeable",
"-",
"dirs",
"option",
"using",
"chmod"
] | 128efde0b61f5623b094cbb399e66ab4aa0dba3f | https://github.com/interserver/myadmin-plugin-installer/blob/128efde0b61f5623b094cbb399e66ab4aa0dba3f/src/Plugin.php#L204-L213 |
225,404 | interserver/myadmin-plugin-installer | src/Plugin.php | Plugin.getHttpdUser | public static function getHttpdUser(Event $event)
{
$ps = self::runProcess($event, 'ps aux');
preg_match_all('/^.*([a]pache|[h]ttpd|[_]www|[w]ww-data|[n]ginx)$/m', $ps, $matches);
foreach ($matches[0] as $match) {
$user = substr($match, 0, strpos($match, ' '));
if ($user != 'root') {
return $user;
}... | php | public static function getHttpdUser(Event $event)
{
$ps = self::runProcess($event, 'ps aux');
preg_match_all('/^.*([a]pache|[h]ttpd|[_]www|[w]ww-data|[n]ginx)$/m', $ps, $matches);
foreach ($matches[0] as $match) {
$user = substr($match, 0, strpos($match, ' '));
if ($user != 'root') {
return $user;
}... | [
"public",
"static",
"function",
"getHttpdUser",
"(",
"Event",
"$",
"event",
")",
"{",
"$",
"ps",
"=",
"self",
"::",
"runProcess",
"(",
"$",
"event",
",",
"'ps aux'",
")",
";",
"preg_match_all",
"(",
"'/^.*([a]pache|[h]ttpd|[_]www|[w]ww-data|[n]ginx)$/m'",
",",
"... | returns the user the webserver is running as
@param Event $event
@return string the webserver username | [
"returns",
"the",
"user",
"the",
"webserver",
"is",
"running",
"as"
] | 128efde0b61f5623b094cbb399e66ab4aa0dba3f | https://github.com/interserver/myadmin-plugin-installer/blob/128efde0b61f5623b094cbb399e66ab4aa0dba3f/src/Plugin.php#L221-L231 |
225,405 | interserver/myadmin-plugin-installer | src/Plugin.php | Plugin.EnsureDirExists | public static function EnsureDirExists(Event $event, $path)
{
if (!is_dir($path)) {
mkdir($path, 0777, true);
if (!is_dir($path)) {
throw new \Exception('Path Not Found: '.$path);
}
if ($event->getIO()->isVerbose() === true) {
$event->getIO()->write(sprintf('Created Directory <info>%s</info>', $p... | php | public static function EnsureDirExists(Event $event, $path)
{
if (!is_dir($path)) {
mkdir($path, 0777, true);
if (!is_dir($path)) {
throw new \Exception('Path Not Found: '.$path);
}
if ($event->getIO()->isVerbose() === true) {
$event->getIO()->write(sprintf('Created Directory <info>%s</info>', $p... | [
"public",
"static",
"function",
"EnsureDirExists",
"(",
"Event",
"$",
"event",
",",
"$",
"path",
")",
"{",
"if",
"(",
"!",
"is_dir",
"(",
"$",
"path",
")",
")",
"{",
"mkdir",
"(",
"$",
"path",
",",
"0777",
",",
"true",
")",
";",
"if",
"(",
"!",
... | checks if the given directory exists and if not tries to create it.
@param Event $event
@param string $path the directory
@throws \Exception | [
"checks",
"if",
"the",
"given",
"directory",
"exists",
"and",
"if",
"not",
"tries",
"to",
"create",
"it",
"."
] | 128efde0b61f5623b094cbb399e66ab4aa0dba3f | https://github.com/interserver/myadmin-plugin-installer/blob/128efde0b61f5623b094cbb399e66ab4aa0dba3f/src/Plugin.php#L275-L286 |
225,406 | interserver/myadmin-plugin-installer | src/Plugin.php | Plugin.EnsureFileExists | public static function EnsureFileExists(Event $event, $path)
{
if (!is_dir(dirname($path))) {
mkdir(dirname($path), 0777, true);
touch($path);
if (!file_exists($path)) {
throw new \Exception('File Not Found: '.$path);
}
if ($event->getIO()->isVerbose() === true) {
$event->getIO()->write(sprint... | php | public static function EnsureFileExists(Event $event, $path)
{
if (!is_dir(dirname($path))) {
mkdir(dirname($path), 0777, true);
touch($path);
if (!file_exists($path)) {
throw new \Exception('File Not Found: '.$path);
}
if ($event->getIO()->isVerbose() === true) {
$event->getIO()->write(sprint... | [
"public",
"static",
"function",
"EnsureFileExists",
"(",
"Event",
"$",
"event",
",",
"$",
"path",
")",
"{",
"if",
"(",
"!",
"is_dir",
"(",
"dirname",
"(",
"$",
"path",
")",
")",
")",
"{",
"mkdir",
"(",
"dirname",
"(",
"$",
"path",
")",
",",
"0777",... | checks if the given file exists and if not tries to create it.
@param Event $event
@param string $path the directory
@throws \Exception | [
"checks",
"if",
"the",
"given",
"file",
"exists",
"and",
"if",
"not",
"tries",
"to",
"create",
"it",
"."
] | 128efde0b61f5623b094cbb399e66ab4aa0dba3f | https://github.com/interserver/myadmin-plugin-installer/blob/128efde0b61f5623b094cbb399e66ab4aa0dba3f/src/Plugin.php#L295-L307 |
225,407 | interserver/myadmin-plugin-installer | src/Plugin.php | Plugin.runProcess | public static function runProcess(Event $event, $commandline)
{
if ($event->getIO()->isVerbose() === true) {
$event->getIO()->write(sprintf('Running <info>%s</info>', $commandline));
}
exec($commandline, $output, $return);
if ($return != 0) {
throw new \Exception('Returned Error Code '.$return);
}
re... | php | public static function runProcess(Event $event, $commandline)
{
if ($event->getIO()->isVerbose() === true) {
$event->getIO()->write(sprintf('Running <info>%s</info>', $commandline));
}
exec($commandline, $output, $return);
if ($return != 0) {
throw new \Exception('Returned Error Code '.$return);
}
re... | [
"public",
"static",
"function",
"runProcess",
"(",
"Event",
"$",
"event",
",",
"$",
"commandline",
")",
"{",
"if",
"(",
"$",
"event",
"->",
"getIO",
"(",
")",
"->",
"isVerbose",
"(",
")",
"===",
"true",
")",
"{",
"$",
"event",
"->",
"getIO",
"(",
"... | runs a command process returning the output and checking return code
@param Event $event
@param string $commandline the command line to run
@return string the output
@throws \Exception | [
"runs",
"a",
"command",
"process",
"returning",
"the",
"output",
"and",
"checking",
"return",
"code"
] | 128efde0b61f5623b094cbb399e66ab4aa0dba3f | https://github.com/interserver/myadmin-plugin-installer/blob/128efde0b61f5623b094cbb399e66ab4aa0dba3f/src/Plugin.php#L317-L327 |
225,408 | cmsgears/module-forms | common/models/resources/FormSubmitField.php | FormSubmitField.findByFormSubmitId | public static function findByFormSubmitId( $formSubmitId ) {
$frmSubmitTable = FormTables::getTableName( FormTables::TABLE_FORM_SUBMIT );
$query = static::find()->joinWith( 'formSubmit' )->where( "$frmSubmitTable.id=:id", [ ':id' => $formSubmitId ] );
return $query->all();
} | php | public static function findByFormSubmitId( $formSubmitId ) {
$frmSubmitTable = FormTables::getTableName( FormTables::TABLE_FORM_SUBMIT );
$query = static::find()->joinWith( 'formSubmit' )->where( "$frmSubmitTable.id=:id", [ ':id' => $formSubmitId ] );
return $query->all();
} | [
"public",
"static",
"function",
"findByFormSubmitId",
"(",
"$",
"formSubmitId",
")",
"{",
"$",
"frmSubmitTable",
"=",
"FormTables",
"::",
"getTableName",
"(",
"FormTables",
"::",
"TABLE_FORM_SUBMIT",
")",
";",
"$",
"query",
"=",
"static",
"::",
"find",
"(",
")... | Find and return the form submit fields associated with given form submit id.
@param integer $formSubmitId
@return FormSubmitField[] | [
"Find",
"and",
"return",
"the",
"form",
"submit",
"fields",
"associated",
"with",
"given",
"form",
"submit",
"id",
"."
] | 84cbb26e8ecb945410bb2604b84440d5ed841308 | https://github.com/cmsgears/module-forms/blob/84cbb26e8ecb945410bb2604b84440d5ed841308/common/models/resources/FormSubmitField.php#L165-L172 |
225,409 | cmsgears/module-forms | common/models/resources/FormSubmitField.php | FormSubmitField.findByName | public static function findByName( $formSubmitId, $name ) {
$frmSubmitTable = FormTables::getTableName( FormTables::TABLE_FORM_SUBMIT );
$frmSubmitFieldTable = FormTables::getTableName( FormTables::TABLE_FORM_SUBMIT_FIELD );
$query = static::find()->joinWith( 'formSubmit' )->where( "$frmSubmitTable.id=:id AND... | php | public static function findByName( $formSubmitId, $name ) {
$frmSubmitTable = FormTables::getTableName( FormTables::TABLE_FORM_SUBMIT );
$frmSubmitFieldTable = FormTables::getTableName( FormTables::TABLE_FORM_SUBMIT_FIELD );
$query = static::find()->joinWith( 'formSubmit' )->where( "$frmSubmitTable.id=:id AND... | [
"public",
"static",
"function",
"findByName",
"(",
"$",
"formSubmitId",
",",
"$",
"name",
")",
"{",
"$",
"frmSubmitTable",
"=",
"FormTables",
"::",
"getTableName",
"(",
"FormTables",
"::",
"TABLE_FORM_SUBMIT",
")",
";",
"$",
"frmSubmitFieldTable",
"=",
"FormTabl... | Find and return the form submit field associated with given form submit id and name.
@param integer $formSubmitId
@param string $name
@return FormSubmitField | [
"Find",
"and",
"return",
"the",
"form",
"submit",
"field",
"associated",
"with",
"given",
"form",
"submit",
"id",
"and",
"name",
"."
] | 84cbb26e8ecb945410bb2604b84440d5ed841308 | https://github.com/cmsgears/module-forms/blob/84cbb26e8ecb945410bb2604b84440d5ed841308/common/models/resources/FormSubmitField.php#L181-L189 |
225,410 | Finesse/MiniDB | src/Parts/RawHelpersTrait.php | RawHelpersTrait.addTablePrefix | public function addTablePrefix(string $table): string
{
return ($this->tablePrefixer ?? $this->database->getTablePrefixer())->addTablePrefix($table);
} | php | public function addTablePrefix(string $table): string
{
return ($this->tablePrefixer ?? $this->database->getTablePrefixer())->addTablePrefix($table);
} | [
"public",
"function",
"addTablePrefix",
"(",
"string",
"$",
"table",
")",
":",
"string",
"{",
"return",
"(",
"$",
"this",
"->",
"tablePrefixer",
"??",
"$",
"this",
"->",
"database",
"->",
"getTablePrefixer",
"(",
")",
")",
"->",
"addTablePrefix",
"(",
"$",... | Adds the table prefix to a table name.
@param string $table Table name without quotes
@return string Table name with prefix | [
"Adds",
"the",
"table",
"prefix",
"to",
"a",
"table",
"name",
"."
] | d70e27cae91f975e9f5bfd506a6e5d6fee0ada65 | https://github.com/Finesse/MiniDB/blob/d70e27cae91f975e9f5bfd506a6e5d6fee0ada65/src/Parts/RawHelpersTrait.php#L37-L40 |
225,411 | Finesse/MiniDB | src/Parts/RawHelpersTrait.php | RawHelpersTrait.addTablePrefixToColumn | public function addTablePrefixToColumn(string $column): string
{
return ($this->tablePrefixer ?? $this->database->getTablePrefixer())->addTablePrefixToColumn($column);
} | php | public function addTablePrefixToColumn(string $column): string
{
return ($this->tablePrefixer ?? $this->database->getTablePrefixer())->addTablePrefixToColumn($column);
} | [
"public",
"function",
"addTablePrefixToColumn",
"(",
"string",
"$",
"column",
")",
":",
"string",
"{",
"return",
"(",
"$",
"this",
"->",
"tablePrefixer",
"??",
"$",
"this",
"->",
"database",
"->",
"getTablePrefixer",
"(",
")",
")",
"->",
"addTablePrefixToColum... | Adds the table prefix to a column name which may contain table name or alias.
@param string $column Column name without quotes
@return string Column name with prefixed table name | [
"Adds",
"the",
"table",
"prefix",
"to",
"a",
"column",
"name",
"which",
"may",
"contain",
"table",
"name",
"or",
"alias",
"."
] | d70e27cae91f975e9f5bfd506a6e5d6fee0ada65 | https://github.com/Finesse/MiniDB/blob/d70e27cae91f975e9f5bfd506a6e5d6fee0ada65/src/Parts/RawHelpersTrait.php#L48-L51 |
225,412 | Finesse/MiniDB | src/Parts/RawHelpersTrait.php | RawHelpersTrait.escapeLikeWildcards | public function escapeLikeWildcards(string $string): string
{
return ($this->grammar ?? $this->database->getGrammar())->escapeLikeWildcards($string);
} | php | public function escapeLikeWildcards(string $string): string
{
return ($this->grammar ?? $this->database->getGrammar())->escapeLikeWildcards($string);
} | [
"public",
"function",
"escapeLikeWildcards",
"(",
"string",
"$",
"string",
")",
":",
"string",
"{",
"return",
"(",
"$",
"this",
"->",
"grammar",
"??",
"$",
"this",
"->",
"database",
"->",
"getGrammar",
"(",
")",
")",
"->",
"escapeLikeWildcards",
"(",
"$",
... | Escapes the LIKE operator special characters. Doesn't escape general string wildcard characters because it is
another job.
@param string $string
@return string | [
"Escapes",
"the",
"LIKE",
"operator",
"special",
"characters",
".",
"Doesn",
"t",
"escape",
"general",
"string",
"wildcard",
"characters",
"because",
"it",
"is",
"another",
"job",
"."
] | d70e27cae91f975e9f5bfd506a6e5d6fee0ada65 | https://github.com/Finesse/MiniDB/blob/d70e27cae91f975e9f5bfd506a6e5d6fee0ada65/src/Parts/RawHelpersTrait.php#L84-L87 |
225,413 | bytic/Common | src/Records/Traits/PersistentCurrent.php | PersistentCurrent.getCurrent | public function getCurrent()
{
if ($this->current === null) {
$this->current = false;
$item = $this->getFromSession();
if (!$item) {
$item = $this->getFromCookie();
}
if ($item && $this->checkAccessCurrent($item)) {
... | php | public function getCurrent()
{
if ($this->current === null) {
$this->current = false;
$item = $this->getFromSession();
if (!$item) {
$item = $this->getFromCookie();
}
if ($item && $this->checkAccessCurrent($item)) {
... | [
"public",
"function",
"getCurrent",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"current",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"current",
"=",
"false",
";",
"$",
"item",
"=",
"$",
"this",
"->",
"getFromSession",
"(",
")",
";",
"if",
"(",
... | Get current Persisted record
@return Record | [
"Get",
"current",
"Persisted",
"record"
] | 5d17043e03a2274a758fba1f6dedb7d85195bcfb | https://github.com/bytic/Common/blob/5d17043e03a2274a758fba1f6dedb7d85195bcfb/src/Records/Traits/PersistentCurrent.php#L30-L49 |
225,414 | bytic/Common | src/Records/Traits/PersistentCurrent.php | PersistentCurrent.getFromSession | public function getFromSession()
{
$sessionInfo = $this->getCurrentSessionData();
if (is_array($sessionInfo)) {
if (isset($sessionInfo['id']) && !empty($sessionInfo['id'])) {
$recordId = intval($sessionInfo['id']);
return $this->findOne($recordId);
... | php | public function getFromSession()
{
$sessionInfo = $this->getCurrentSessionData();
if (is_array($sessionInfo)) {
if (isset($sessionInfo['id']) && !empty($sessionInfo['id'])) {
$recordId = intval($sessionInfo['id']);
return $this->findOne($recordId);
... | [
"public",
"function",
"getFromSession",
"(",
")",
"{",
"$",
"sessionInfo",
"=",
"$",
"this",
"->",
"getCurrentSessionData",
"(",
")",
";",
"if",
"(",
"is_array",
"(",
"$",
"sessionInfo",
")",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"sessionInfo",
"[",
... | Get persisted Record from Session
@return bool|Record | [
"Get",
"persisted",
"Record",
"from",
"Session"
] | 5d17043e03a2274a758fba1f6dedb7d85195bcfb | https://github.com/bytic/Common/blob/5d17043e03a2274a758fba1f6dedb7d85195bcfb/src/Records/Traits/PersistentCurrent.php#L70-L83 |
225,415 | bytic/Common | src/Records/Traits/PersistentCurrent.php | PersistentCurrent.getCurrentSessionData | public function getCurrentSessionData()
{
$varName = $this->getCurrentVarName();
return isset($_SESSION[$varName]) ? $_SESSION[$varName] : null;
} | php | public function getCurrentSessionData()
{
$varName = $this->getCurrentVarName();
return isset($_SESSION[$varName]) ? $_SESSION[$varName] : null;
} | [
"public",
"function",
"getCurrentSessionData",
"(",
")",
"{",
"$",
"varName",
"=",
"$",
"this",
"->",
"getCurrentVarName",
"(",
")",
";",
"return",
"isset",
"(",
"$",
"_SESSION",
"[",
"$",
"varName",
"]",
")",
"?",
"$",
"_SESSION",
"[",
"$",
"varName",
... | Get session data for persistent record from session
@return []|null | [
"Get",
"session",
"data",
"for",
"persistent",
"record",
"from",
"session"
] | 5d17043e03a2274a758fba1f6dedb7d85195bcfb | https://github.com/bytic/Common/blob/5d17043e03a2274a758fba1f6dedb7d85195bcfb/src/Records/Traits/PersistentCurrent.php#L90-L95 |
225,416 | bytic/Common | src/Records/Traits/PersistentCurrent.php | PersistentCurrent.setAndSaveCurrent | public function setAndSaveCurrent($item = false)
{
$this->setCurrent($item);
$this->savePersistCurrent($item);
return $this;
} | php | public function setAndSaveCurrent($item = false)
{
$this->setCurrent($item);
$this->savePersistCurrent($item);
return $this;
} | [
"public",
"function",
"setAndSaveCurrent",
"(",
"$",
"item",
"=",
"false",
")",
"{",
"$",
"this",
"->",
"setCurrent",
"(",
"$",
"item",
")",
";",
"$",
"this",
"->",
"savePersistCurrent",
"(",
"$",
"item",
")",
";",
"return",
"$",
"this",
";",
"}"
] | Set and save persisted model
@param Record|boolean $item
@return $this | [
"Set",
"and",
"save",
"persisted",
"model"
] | 5d17043e03a2274a758fba1f6dedb7d85195bcfb | https://github.com/bytic/Common/blob/5d17043e03a2274a758fba1f6dedb7d85195bcfb/src/Records/Traits/PersistentCurrent.php#L126-L132 |
225,417 | bytic/Common | src/Records/Traits/PersistentCurrent.php | PersistentCurrent.savePersistCurrentCookie | public function savePersistCurrentCookie($item)
{
$varName = $this->getCurrentVarName();
CookieJar::instance()->newCookie()
->setName($varName)
->setValue($item->id)
->save();
} | php | public function savePersistCurrentCookie($item)
{
$varName = $this->getCurrentVarName();
CookieJar::instance()->newCookie()
->setName($varName)
->setValue($item->id)
->save();
} | [
"public",
"function",
"savePersistCurrentCookie",
"(",
"$",
"item",
")",
"{",
"$",
"varName",
"=",
"$",
"this",
"->",
"getCurrentVarName",
"(",
")",
";",
"CookieJar",
"::",
"instance",
"(",
")",
"->",
"newCookie",
"(",
")",
"->",
"setName",
"(",
"$",
"va... | Save record in Cookie
@param Record|boolean $item Record to save in cookie
@return void | [
"Save",
"record",
"in",
"Cookie"
] | 5d17043e03a2274a758fba1f6dedb7d85195bcfb | https://github.com/bytic/Common/blob/5d17043e03a2274a758fba1f6dedb7d85195bcfb/src/Records/Traits/PersistentCurrent.php#L221-L228 |
225,418 | bytic/Common | src/Records/Traits/PersistentCurrent.php | PersistentCurrent.getFromCookie | public function getFromCookie()
{
$varName = $this->getCurrentVarName();
if (isset($_COOKIE[$varName])) {
$recordId = $_COOKIE[$varName];
$item = $this->findOne(intval($recordId));
if ($item) {
return $item;
}
}
return... | php | public function getFromCookie()
{
$varName = $this->getCurrentVarName();
if (isset($_COOKIE[$varName])) {
$recordId = $_COOKIE[$varName];
$item = $this->findOne(intval($recordId));
if ($item) {
return $item;
}
}
return... | [
"public",
"function",
"getFromCookie",
"(",
")",
"{",
"$",
"varName",
"=",
"$",
"this",
"->",
"getCurrentVarName",
"(",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"_COOKIE",
"[",
"$",
"varName",
"]",
")",
")",
"{",
"$",
"recordId",
"=",
"$",
"_COOKIE",
... | Get persistent record from Cookie
@return bool|Record | [
"Get",
"persistent",
"record",
"from",
"Cookie"
] | 5d17043e03a2274a758fba1f6dedb7d85195bcfb | https://github.com/bytic/Common/blob/5d17043e03a2274a758fba1f6dedb7d85195bcfb/src/Records/Traits/PersistentCurrent.php#L235-L248 |
225,419 | SetBased/php-abc-form | src/Validator/ProxyValidator.php | ProxyValidator.validate | public function validate(Control $control): bool
{
return ($this->data===null) ? ($this->callable)($control) : ($this->callable)($control, $this->data);
} | php | public function validate(Control $control): bool
{
return ($this->data===null) ? ($this->callable)($control) : ($this->callable)($control, $this->data);
} | [
"public",
"function",
"validate",
"(",
"Control",
"$",
"control",
")",
":",
"bool",
"{",
"return",
"(",
"$",
"this",
"->",
"data",
"===",
"null",
")",
"?",
"(",
"$",
"this",
"->",
"callable",
")",
"(",
"$",
"control",
")",
":",
"(",
"$",
"this",
... | Returns true if the value of the form control meets the conditions of this validator. Returns false otherwise.
@param Control $control The form control.
@return bool
@since 1.0.0
@api | [
"Returns",
"true",
"if",
"the",
"value",
"of",
"the",
"form",
"control",
"meets",
"the",
"conditions",
"of",
"this",
"validator",
".",
"Returns",
"false",
"otherwise",
"."
] | a7343e2b7dda411f5f0fc7d64324bc9d021aa73e | https://github.com/SetBased/php-abc-form/blob/a7343e2b7dda411f5f0fc7d64324bc9d021aa73e/src/Validator/ProxyValidator.php#L55-L58 |
225,420 | cmsgears/module-notify | common/components/EventManager.php | EventManager.triggerActivity | public function triggerActivity( $slug, $data, $config = [] ) {
// Return in case activity logging is disabled at system level.
if( !Yii::$app->core->isActivities() ) {
return false;
}
// Generate Message
$template = $this->templateService->getBySlugType( $slug, NotifyGlobal::TYPE_ACTIVITY );
// Do ... | php | public function triggerActivity( $slug, $data, $config = [] ) {
// Return in case activity logging is disabled at system level.
if( !Yii::$app->core->isActivities() ) {
return false;
}
// Generate Message
$template = $this->templateService->getBySlugType( $slug, NotifyGlobal::TYPE_ACTIVITY );
// Do ... | [
"public",
"function",
"triggerActivity",
"(",
"$",
"slug",
",",
"$",
"data",
",",
"$",
"config",
"=",
"[",
"]",
")",
"{",
"// Return in case activity logging is disabled at system level.",
"if",
"(",
"!",
"Yii",
"::",
"$",
"app",
"->",
"core",
"->",
"isActivit... | Trigger Activity using given template, message and config
@param string $slug
@param array $data
@param array $config
@return boolean | [
"Trigger",
"Activity",
"using",
"given",
"template",
"message",
"and",
"config"
] | 2cca001d47dc4615c49cc704f0a3f8b0baf03cf6 | https://github.com/cmsgears/module-notify/blob/2cca001d47dc4615c49cc704f0a3f8b0baf03cf6/common/components/EventManager.php#L414-L479 |
225,421 | hiqdev/hipanel-hiart | src/Connection.php | Connection.getResponseError | public function getResponseError(ResponseInterface $response)
{
if ($this->isError($response)) {
$error = $this->getError($response);
if (in_array($error, ['invalid_token', 'not_allowed_ip'], true)) {
$this->app->user->logout();
$this->app->response->r... | php | public function getResponseError(ResponseInterface $response)
{
if ($this->isError($response)) {
$error = $this->getError($response);
if (in_array($error, ['invalid_token', 'not_allowed_ip'], true)) {
$this->app->user->logout();
$this->app->response->r... | [
"public",
"function",
"getResponseError",
"(",
"ResponseInterface",
"$",
"response",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isError",
"(",
"$",
"response",
")",
")",
"{",
"$",
"error",
"=",
"$",
"this",
"->",
"getError",
"(",
"$",
"response",
")",
";... | Calls fixResponse.
@param ResponseInterface $response
@return string|false error text or false | [
"Calls",
"fixResponse",
"."
] | 68e9cbc5a36813ca1127e5148735d416582c9d59 | https://github.com/hiqdev/hipanel-hiart/blob/68e9cbc5a36813ca1127e5148735d416582c9d59/src/Connection.php#L65-L83 |
225,422 | MatyCZ/LemoTracy | src/Options/TracyOptions.php | TracyOptions.setLogDirectory | public function setLogDirectory(?string $path): self
{
if (null !== $path) {
if (!is_dir($path)) {
throw new InvalidArgumentException(sprintf(
"Tracy log path '%s' does`t exists",
$path
));
}
$path =... | php | public function setLogDirectory(?string $path): self
{
if (null !== $path) {
if (!is_dir($path)) {
throw new InvalidArgumentException(sprintf(
"Tracy log path '%s' does`t exists",
$path
));
}
$path =... | [
"public",
"function",
"setLogDirectory",
"(",
"?",
"string",
"$",
"path",
")",
":",
"self",
"{",
"if",
"(",
"null",
"!==",
"$",
"path",
")",
"{",
"if",
"(",
"!",
"is_dir",
"(",
"$",
"path",
")",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"... | Path to log directory
@param string $path
@throws InvalidArgumentException
@return self | [
"Path",
"to",
"log",
"directory"
] | 873a3690886cfb5727edea6ef2371504b825d479 | https://github.com/MatyCZ/LemoTracy/blob/873a3690886cfb5727edea6ef2371504b825d479/src/Options/TracyOptions.php#L99-L114 |
225,423 | bytic/Common | src/Payments/Gateways/Providers/Payu/Api/LiveUpdate.php | LiveUpdate.setLiveUpdateURL | public function setLiveUpdateURL($liveUpdateURL = 'https://secure.epayment.ro/order/lu.php')
{
if (!is_string($liveUpdateURL)) { //invalid data type
return false;
}
if (empty($liveUpdateURL)) { //empty string
return false;
}
$this->liveUpdateURL =... | php | public function setLiveUpdateURL($liveUpdateURL = 'https://secure.epayment.ro/order/lu.php')
{
if (!is_string($liveUpdateURL)) { //invalid data type
return false;
}
if (empty($liveUpdateURL)) { //empty string
return false;
}
$this->liveUpdateURL =... | [
"public",
"function",
"setLiveUpdateURL",
"(",
"$",
"liveUpdateURL",
"=",
"'https://secure.epayment.ro/order/lu.php'",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"liveUpdateURL",
")",
")",
"{",
"//invalid data type",
"return",
"false",
";",
"}",
"if",
"(",
... | setLiveUpdateURL class method
Set up live update URL address
@access public
@param $liveUpdateURL - live update url address
@return boolean | [
"setLiveUpdateURL",
"class",
"method"
] | 5d17043e03a2274a758fba1f6dedb7d85195bcfb | https://github.com/bytic/Common/blob/5d17043e03a2274a758fba1f6dedb7d85195bcfb/src/Payments/Gateways/Providers/Payu/Api/LiveUpdate.php#L268-L280 |
225,424 | bytic/Common | src/Payments/Gateways/Providers/Payu/Api/LiveUpdate.php | LiveUpdate.setLanguage | public function setLanguage($language = 'ro')
{
$language = trim(strtolower($language));
switch ($language) {
case 'ro':
$this->language = 'ro';
break;
case 'en':
default:
$this->language = 'en';
}
r... | php | public function setLanguage($language = 'ro')
{
$language = trim(strtolower($language));
switch ($language) {
case 'ro':
$this->language = 'ro';
break;
case 'en':
default:
$this->language = 'en';
}
r... | [
"public",
"function",
"setLanguage",
"(",
"$",
"language",
"=",
"'ro'",
")",
"{",
"$",
"language",
"=",
"trim",
"(",
"strtolower",
"(",
"$",
"language",
")",
")",
";",
"switch",
"(",
"$",
"language",
")",
"{",
"case",
"'ro'",
":",
"$",
"this",
"->",
... | setLanguage class method
Sets the order language
@access public
@param $language - string
@return boolean | [
"setLanguage",
"class",
"method"
] | 5d17043e03a2274a758fba1f6dedb7d85195bcfb | https://github.com/bytic/Common/blob/5d17043e03a2274a758fba1f6dedb7d85195bcfb/src/Payments/Gateways/Providers/Payu/Api/LiveUpdate.php#L320-L333 |
225,425 | bytic/Common | src/Payments/Gateways/Providers/Payu/Api/LiveUpdate.php | LiveUpdate.setSecretKey | public function setSecretKey($secretKey)
{
if (!is_string($secretKey)) {
$this->secretKeyError = 'invalid type';
return false;
}
if (empty($secretKey)) {
$this->secretKeyError = 'empty string';
return false;
}
if (strlen($se... | php | public function setSecretKey($secretKey)
{
if (!is_string($secretKey)) {
$this->secretKeyError = 'invalid type';
return false;
}
if (empty($secretKey)) {
$this->secretKeyError = 'empty string';
return false;
}
if (strlen($se... | [
"public",
"function",
"setSecretKey",
"(",
"$",
"secretKey",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"secretKey",
")",
")",
"{",
"$",
"this",
"->",
"secretKeyError",
"=",
"'invalid type'",
";",
"return",
"false",
";",
"}",
"if",
"(",
"empty",
... | setSecretKey class method
Sets the secret key used for HASH signature
@access public
@param $secretKey - string
@return boolean | [
"setSecretKey",
"class",
"method"
] | 5d17043e03a2274a758fba1f6dedb7d85195bcfb | https://github.com/bytic/Common/blob/5d17043e03a2274a758fba1f6dedb7d85195bcfb/src/Payments/Gateways/Providers/Payu/Api/LiveUpdate.php#L344-L373 |
225,426 | bytic/Common | src/Payments/Gateways/Providers/Payu/Api/LiveUpdate.php | LiveUpdate.setOrderDate | public function setOrderDate($orderDate = '')
{
if (strtotime($orderDate) === -1) {
$this->orderDate = null;
return false;
}
$dateFormatPattern = "^((((19|20)(([02468][048])|([13579][26]))-02-29))|((20[0-9][0-9])|(19[0-9][0-9]))-((((0[1-9])|(1[0-2]))-((0[1-9])|(1\d)... | php | public function setOrderDate($orderDate = '')
{
if (strtotime($orderDate) === -1) {
$this->orderDate = null;
return false;
}
$dateFormatPattern = "^((((19|20)(([02468][048])|([13579][26]))-02-29))|((20[0-9][0-9])|(19[0-9][0-9]))-((((0[1-9])|(1[0-2]))-((0[1-9])|(1\d)... | [
"public",
"function",
"setOrderDate",
"(",
"$",
"orderDate",
"=",
"''",
")",
"{",
"if",
"(",
"strtotime",
"(",
"$",
"orderDate",
")",
"===",
"-",
"1",
")",
"{",
"$",
"this",
"->",
"orderDate",
"=",
"null",
";",
"return",
"false",
";",
"}",
"$",
"da... | setOrderDate class method
@access public
@param $orderDate string
@return boolean | [
"setOrderDate",
"class",
"method"
] | 5d17043e03a2274a758fba1f6dedb7d85195bcfb | https://github.com/bytic/Common/blob/5d17043e03a2274a758fba1f6dedb7d85195bcfb/src/Payments/Gateways/Providers/Payu/Api/LiveUpdate.php#L430-L455 |
225,427 | bytic/Common | src/Payments/Gateways/Providers/Payu/Api/LiveUpdate.php | LiveUpdate.setOrderPName | public function setOrderPName($orderPName)
{
if (!is_array($orderPName)) {
$this->orderPName = null;
return false;
}
$isValid = true;
$index = 0;
while ($isValid && $index < count($orderPName)) {
if (strlen($orderPName[$index]) > 155) {
... | php | public function setOrderPName($orderPName)
{
if (!is_array($orderPName)) {
$this->orderPName = null;
return false;
}
$isValid = true;
$index = 0;
while ($isValid && $index < count($orderPName)) {
if (strlen($orderPName[$index]) > 155) {
... | [
"public",
"function",
"setOrderPName",
"(",
"$",
"orderPName",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"orderPName",
")",
")",
"{",
"$",
"this",
"->",
"orderPName",
"=",
"null",
";",
"return",
"false",
";",
"}",
"$",
"isValid",
"=",
"true",
"... | setOrderPName class method
Sets shopping cart product names
@access public
@param $orderPName array
@return boolean | [
"setOrderPName",
"class",
"method"
] | 5d17043e03a2274a758fba1f6dedb7d85195bcfb | https://github.com/bytic/Common/blob/5d17043e03a2274a758fba1f6dedb7d85195bcfb/src/Payments/Gateways/Providers/Payu/Api/LiveUpdate.php#L466-L491 |
225,428 | bytic/Common | src/Payments/Gateways/Providers/Payu/Api/LiveUpdate.php | LiveUpdate.setOrderPGroup | public function setOrderPGroup($orderPGroup)
{
if (!is_array($orderPGroup)) {
$this->orderPGroup = null;
return false;
}
$isValid = true;
$index = 0;
while ($isValid && $index < count($orderPGroup)) {
if (strlen($orderPGroup[$index]) > 155... | php | public function setOrderPGroup($orderPGroup)
{
if (!is_array($orderPGroup)) {
$this->orderPGroup = null;
return false;
}
$isValid = true;
$index = 0;
while ($isValid && $index < count($orderPGroup)) {
if (strlen($orderPGroup[$index]) > 155... | [
"public",
"function",
"setOrderPGroup",
"(",
"$",
"orderPGroup",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"orderPGroup",
")",
")",
"{",
"$",
"this",
"->",
"orderPGroup",
"=",
"null",
";",
"return",
"false",
";",
"}",
"$",
"isValid",
"=",
"true",... | setOrderPGroup class method
Sets products groups
@access public
@param $orderPGroup array
@return boolean | [
"setOrderPGroup",
"class",
"method"
] | 5d17043e03a2274a758fba1f6dedb7d85195bcfb | https://github.com/bytic/Common/blob/5d17043e03a2274a758fba1f6dedb7d85195bcfb/src/Payments/Gateways/Providers/Payu/Api/LiveUpdate.php#L502-L527 |
225,429 | bytic/Common | src/Payments/Gateways/Providers/Payu/Api/LiveUpdate.php | LiveUpdate.setOrderPType | public function setOrderPType($orderPType)
{
if (!is_array($orderPType)) {
$this->orderPType = null;
return false;
}
$isValid = true;
$index = 0;
while ($isValid && $index < count($orderPType)) {
if (!in_array($orderPType[$index], array('G... | php | public function setOrderPType($orderPType)
{
if (!is_array($orderPType)) {
$this->orderPType = null;
return false;
}
$isValid = true;
$index = 0;
while ($isValid && $index < count($orderPType)) {
if (!in_array($orderPType[$index], array('G... | [
"public",
"function",
"setOrderPType",
"(",
"$",
"orderPType",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"orderPType",
")",
")",
"{",
"$",
"this",
"->",
"orderPType",
"=",
"null",
";",
"return",
"false",
";",
"}",
"$",
"isValid",
"=",
"true",
"... | setOrderPType class method
Sets products price types
@access public
@param $orderPType array
@return boolean | [
"setOrderPType",
"class",
"method"
] | 5d17043e03a2274a758fba1f6dedb7d85195bcfb | https://github.com/bytic/Common/blob/5d17043e03a2274a758fba1f6dedb7d85195bcfb/src/Payments/Gateways/Providers/Payu/Api/LiveUpdate.php#L538-L563 |
225,430 | bytic/Common | src/Payments/Gateways/Providers/Payu/Api/LiveUpdate.php | LiveUpdate.setOrderPCode | public function setOrderPCode($orderPCode)
{
if (!is_array($orderPCode)) {
$this->orderPCode = null;
return false;
}
$isValid = true;
$index = 0;
while ($isValid && $index < count($orderPCode)) {
if (strlen($orderPCode[$index]) > 20) {
... | php | public function setOrderPCode($orderPCode)
{
if (!is_array($orderPCode)) {
$this->orderPCode = null;
return false;
}
$isValid = true;
$index = 0;
while ($isValid && $index < count($orderPCode)) {
if (strlen($orderPCode[$index]) > 20) {
... | [
"public",
"function",
"setOrderPCode",
"(",
"$",
"orderPCode",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"orderPCode",
")",
")",
"{",
"$",
"this",
"->",
"orderPCode",
"=",
"null",
";",
"return",
"false",
";",
"}",
"$",
"isValid",
"=",
"true",
"... | setOrderPCode class method
Sets shopping cart product codes
@access public
@param $orderPCode array
@return boolean | [
"setOrderPCode",
"class",
"method"
] | 5d17043e03a2274a758fba1f6dedb7d85195bcfb | https://github.com/bytic/Common/blob/5d17043e03a2274a758fba1f6dedb7d85195bcfb/src/Payments/Gateways/Providers/Payu/Api/LiveUpdate.php#L574-L599 |
225,431 | bytic/Common | src/Payments/Gateways/Providers/Payu/Api/LiveUpdate.php | LiveUpdate.setOrderPInfo | public function setOrderPInfo($orderPInfo)
{
if (!is_array($orderPInfo)) {
$this->orderPInfo = null;
return false;
}
$this->orderPInfo = $orderPInfo;
return true;
} | php | public function setOrderPInfo($orderPInfo)
{
if (!is_array($orderPInfo)) {
$this->orderPInfo = null;
return false;
}
$this->orderPInfo = $orderPInfo;
return true;
} | [
"public",
"function",
"setOrderPInfo",
"(",
"$",
"orderPInfo",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"orderPInfo",
")",
")",
"{",
"$",
"this",
"->",
"orderPInfo",
"=",
"null",
";",
"return",
"false",
";",
"}",
"$",
"this",
"->",
"orderPInfo",... | setOrderPInfo class method
Sets additional information for the products in the shopping cart
@access public
@param $orderPInfo array
@return boolean | [
"setOrderPInfo",
"class",
"method"
] | 5d17043e03a2274a758fba1f6dedb7d85195bcfb | https://github.com/bytic/Common/blob/5d17043e03a2274a758fba1f6dedb7d85195bcfb/src/Payments/Gateways/Providers/Payu/Api/LiveUpdate.php#L610-L620 |
225,432 | bytic/Common | src/Payments/Gateways/Providers/Payu/Api/LiveUpdate.php | LiveUpdate.setOrderPrice | public function setOrderPrice($orderPrice)
{
if (!is_array($orderPrice)) {
$this->orderPrice = null;
return false;
}
$isValid = true;
$index = 0;
while ($isValid && $index < count($orderPrice)) {
if (is_numeric($orderPrice[$index]) && $ord... | php | public function setOrderPrice($orderPrice)
{
if (!is_array($orderPrice)) {
$this->orderPrice = null;
return false;
}
$isValid = true;
$index = 0;
while ($isValid && $index < count($orderPrice)) {
if (is_numeric($orderPrice[$index]) && $ord... | [
"public",
"function",
"setOrderPrice",
"(",
"$",
"orderPrice",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"orderPrice",
")",
")",
"{",
"$",
"this",
"->",
"orderPrice",
"=",
"null",
";",
"return",
"false",
";",
"}",
"$",
"isValid",
"=",
"true",
"... | setOrderPrice class method
Sets product prices
@access public
@param $orderPrice array
@return boolean | [
"setOrderPrice",
"class",
"method"
] | 5d17043e03a2274a758fba1f6dedb7d85195bcfb | https://github.com/bytic/Common/blob/5d17043e03a2274a758fba1f6dedb7d85195bcfb/src/Payments/Gateways/Providers/Payu/Api/LiveUpdate.php#L631-L656 |
225,433 | bytic/Common | src/Payments/Gateways/Providers/Payu/Api/LiveUpdate.php | LiveUpdate.setOrderQTY | public function setOrderQTY($orderQty)
{
if (!is_array($orderQty)) {
$this->orderQty = null;
return false;
}
$isValid = true;
$index = 0;
while ($isValid && $index < count($orderQty)) {
if (is_numeric($orderQty[$index]) && $orderQty[$index... | php | public function setOrderQTY($orderQty)
{
if (!is_array($orderQty)) {
$this->orderQty = null;
return false;
}
$isValid = true;
$index = 0;
while ($isValid && $index < count($orderQty)) {
if (is_numeric($orderQty[$index]) && $orderQty[$index... | [
"public",
"function",
"setOrderQTY",
"(",
"$",
"orderQty",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"orderQty",
")",
")",
"{",
"$",
"this",
"->",
"orderQty",
"=",
"null",
";",
"return",
"false",
";",
"}",
"$",
"isValid",
"=",
"true",
";",
"$... | setOrderQTY class method
Sets quantities for each product in the shopping cart
@access public
@param $orderQty array
@return boolean | [
"setOrderQTY",
"class",
"method"
] | 5d17043e03a2274a758fba1f6dedb7d85195bcfb | https://github.com/bytic/Common/blob/5d17043e03a2274a758fba1f6dedb7d85195bcfb/src/Payments/Gateways/Providers/Payu/Api/LiveUpdate.php#L666-L691 |
225,434 | bytic/Common | src/Payments/Gateways/Providers/Payu/Api/LiveUpdate.php | LiveUpdate.setOrderVAT | public function setOrderVAT($orderVAT)
{
if (!is_array($orderVAT)) {
$this->orderVAT = null;
return false;
}
$isValid = true;
$index = 0;
while ($isValid && $index < count($orderVAT)) {
if (is_numeric($orderVAT[$index]) && $orderVAT[$index... | php | public function setOrderVAT($orderVAT)
{
if (!is_array($orderVAT)) {
$this->orderVAT = null;
return false;
}
$isValid = true;
$index = 0;
while ($isValid && $index < count($orderVAT)) {
if (is_numeric($orderVAT[$index]) && $orderVAT[$index... | [
"public",
"function",
"setOrderVAT",
"(",
"$",
"orderVAT",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"orderVAT",
")",
")",
"{",
"$",
"this",
"->",
"orderVAT",
"=",
"null",
";",
"return",
"false",
";",
"}",
"$",
"isValid",
"=",
"true",
";",
"$... | setOrderVAT class method
Sets VAT for each product in the shopping cart
@access public
@param $orderVAT array
@return boolean | [
"setOrderVAT",
"class",
"method"
] | 5d17043e03a2274a758fba1f6dedb7d85195bcfb | https://github.com/bytic/Common/blob/5d17043e03a2274a758fba1f6dedb7d85195bcfb/src/Payments/Gateways/Providers/Payu/Api/LiveUpdate.php#L701-L726 |
225,435 | bytic/Common | src/Payments/Gateways/Providers/Payu/Api/LiveUpdate.php | LiveUpdate.setOrderVer | public function setOrderVer($orderVer)
{
if (!is_array($orderVer)) {
$this->orderVer = null;
return false;
}
$isValid = true;
$index = 0;
while ($isValid && $index < count($orderVer)) {
if (settype($orderVer[$index], "string")) {
... | php | public function setOrderVer($orderVer)
{
if (!is_array($orderVer)) {
$this->orderVer = null;
return false;
}
$isValid = true;
$index = 0;
while ($isValid && $index < count($orderVer)) {
if (settype($orderVer[$index], "string")) {
... | [
"public",
"function",
"setOrderVer",
"(",
"$",
"orderVer",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"orderVer",
")",
")",
"{",
"$",
"this",
"->",
"orderVer",
"=",
"null",
";",
"return",
"false",
";",
"}",
"$",
"isValid",
"=",
"true",
";",
"$... | setOrderVer class method
Sets products versions
@access public
@param $orderVer array
@return boolean | [
"setOrderVer",
"class",
"method"
] | 5d17043e03a2274a758fba1f6dedb7d85195bcfb | https://github.com/bytic/Common/blob/5d17043e03a2274a758fba1f6dedb7d85195bcfb/src/Payments/Gateways/Providers/Payu/Api/LiveUpdate.php#L737-L766 |
225,436 | froq/froq-event | src/Events.php | Events.setStack | public function setStack(array $stack): void
{
// reset
$this->stack = [];
foreach ($stack as $event) {
if (!$event instanceof Event) {
throw new EventException('Stack elements must be instanceof froq\event\Event object');
}
$this->stack[... | php | public function setStack(array $stack): void
{
// reset
$this->stack = [];
foreach ($stack as $event) {
if (!$event instanceof Event) {
throw new EventException('Stack elements must be instanceof froq\event\Event object');
}
$this->stack[... | [
"public",
"function",
"setStack",
"(",
"array",
"$",
"stack",
")",
":",
"void",
"{",
"// reset",
"$",
"this",
"->",
"stack",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"stack",
"as",
"$",
"event",
")",
"{",
"if",
"(",
"!",
"$",
"event",
"instanceof",... | Set stack.
@param array $stack
@return void
@throws froq\eventException | [
"Set",
"stack",
"."
] | f7a9afd3bbafd55a5974702fe455375e60daeefe | https://github.com/froq/froq-event/blob/f7a9afd3bbafd55a5974702fe455375e60daeefe/src/Events.php#L59-L71 |
225,437 | SetBased/php-abc-form | src/Validator/EmailValidator.php | EmailValidator.validate | public function validate(Control $control): bool
{
$value = $control->getSubmittedValue();
// An empty value is valid.
if ($value==='' || $value===null || $value===false)
{
return true;
}
// Objects and arrays are not valid email addresses.
if (!is_scalar($value))
{
retur... | php | public function validate(Control $control): bool
{
$value = $control->getSubmittedValue();
// An empty value is valid.
if ($value==='' || $value===null || $value===false)
{
return true;
}
// Objects and arrays are not valid email addresses.
if (!is_scalar($value))
{
retur... | [
"public",
"function",
"validate",
"(",
"Control",
"$",
"control",
")",
":",
"bool",
"{",
"$",
"value",
"=",
"$",
"control",
"->",
"getSubmittedValue",
"(",
")",
";",
"// An empty value is valid.",
"if",
"(",
"$",
"value",
"===",
"''",
"||",
"$",
"value",
... | Returns true if the value of the form control is a valid email address. Otherwise returns false.
Note:
* Empty values are considered valid.
* This validator will test if the domain exists.
@param Control $control The form control.
@return bool
@since 1.0.0
@api | [
"Returns",
"true",
"if",
"the",
"value",
"of",
"the",
"form",
"control",
"is",
"a",
"valid",
"email",
"address",
".",
"Otherwise",
"returns",
"false",
"."
] | a7343e2b7dda411f5f0fc7d64324bc9d021aa73e | https://github.com/SetBased/php-abc-form/blob/a7343e2b7dda411f5f0fc7d64324bc9d021aa73e/src/Validator/EmailValidator.php#L28-L67 |
225,438 | stubbles/stubbles-input | src/main/php/Param.php | Param.isEmpty | public function isEmpty()
{
return $this->isNull()
|| (is_array($this->value) && count($this->value) === 0)
|| $this->length() === 0;
} | php | public function isEmpty()
{
return $this->isNull()
|| (is_array($this->value) && count($this->value) === 0)
|| $this->length() === 0;
} | [
"public",
"function",
"isEmpty",
"(",
")",
"{",
"return",
"$",
"this",
"->",
"isNull",
"(",
")",
"||",
"(",
"is_array",
"(",
"$",
"this",
"->",
"value",
")",
"&&",
"count",
"(",
"$",
"this",
"->",
"value",
")",
"===",
"0",
")",
"||",
"$",
"this",... | checks if parameter is empty
Parameter is empty if its value is null or an empty string.
@return bool | [
"checks",
"if",
"parameter",
"is",
"empty"
] | 1ce0ebe5ba392faf3cc369a95e3fe0fa38912b1e | https://github.com/stubbles/stubbles-input/blob/1ce0ebe5ba392faf3cc369a95e3fe0fa38912b1e/src/main/php/Param.php#L90-L95 |
225,439 | stubbles/stubbles-input | src/main/php/Param.php | Param.length | public function length()
{
if ($this->isNull() || (is_string($this->value) && strlen($this->value) === 0)) {
return 0;
}
if (is_string($this->value)) {
return strlen($this->value);
}
return strlen(current($this->value));
} | php | public function length()
{
if ($this->isNull() || (is_string($this->value) && strlen($this->value) === 0)) {
return 0;
}
if (is_string($this->value)) {
return strlen($this->value);
}
return strlen(current($this->value));
} | [
"public",
"function",
"length",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isNull",
"(",
")",
"||",
"(",
"is_string",
"(",
"$",
"this",
"->",
"value",
")",
"&&",
"strlen",
"(",
"$",
"this",
"->",
"value",
")",
"===",
"0",
")",
")",
"{",
"ret... | returns length of value
@return int | [
"returns",
"length",
"of",
"value"
] | 1ce0ebe5ba392faf3cc369a95e3fe0fa38912b1e | https://github.com/stubbles/stubbles-input/blob/1ce0ebe5ba392faf3cc369a95e3fe0fa38912b1e/src/main/php/Param.php#L102-L113 |
225,440 | stubbles/stubbles-input | src/main/php/Param.php | Param.addError | public function addError($error, array $details = [])
{
$error = ParamError::fromData($error, $details);
$this->errors[$error->id()] = $error;
return $error;
} | php | public function addError($error, array $details = [])
{
$error = ParamError::fromData($error, $details);
$this->errors[$error->id()] = $error;
return $error;
} | [
"public",
"function",
"addError",
"(",
"$",
"error",
",",
"array",
"$",
"details",
"=",
"[",
"]",
")",
"{",
"$",
"error",
"=",
"ParamError",
"::",
"fromData",
"(",
"$",
"error",
",",
"$",
"details",
")",
";",
"$",
"this",
"->",
"errors",
"[",
"$",
... | adds error with given id
@param \stubbles\input\errors\ParamError|string $error id of error or an instance of ParamError
@param array $details details of what caused the error
@return \stubbles\input\errors\ParamError | [
"adds",
"error",
"with",
"given",
"id"
] | 1ce0ebe5ba392faf3cc369a95e3fe0fa38912b1e | https://github.com/stubbles/stubbles-input/blob/1ce0ebe5ba392faf3cc369a95e3fe0fa38912b1e/src/main/php/Param.php#L122-L127 |
225,441 | stubbles/stubbles-input | src/main/php/ParamRequest.php | ParamRequest.readParam | public function readParam(string $paramName): ValueReader
{
return new ValueReader(
$this->params->errors(),
$paramName,
$this->params->value($paramName)
);
} | php | public function readParam(string $paramName): ValueReader
{
return new ValueReader(
$this->params->errors(),
$paramName,
$this->params->value($paramName)
);
} | [
"public",
"function",
"readParam",
"(",
"string",
"$",
"paramName",
")",
":",
"ValueReader",
"{",
"return",
"new",
"ValueReader",
"(",
"$",
"this",
"->",
"params",
"->",
"errors",
"(",
")",
",",
"$",
"paramName",
",",
"$",
"this",
"->",
"params",
"->",
... | returns request value from params for filtering or validation
@param string $paramName name of parameter
@return \stubbles\input\ValueReader
@since 1.3.0 | [
"returns",
"request",
"value",
"from",
"params",
"for",
"filtering",
"or",
"validation"
] | 1ce0ebe5ba392faf3cc369a95e3fe0fa38912b1e | https://github.com/stubbles/stubbles-input/blob/1ce0ebe5ba392faf3cc369a95e3fe0fa38912b1e/src/main/php/ParamRequest.php#L87-L94 |
225,442 | n2n/n2n-log4php | src/app/n2n/log4php/appender/rolling/RollingFile.php | RollingFile.rollOver | private function rollOver() {
// If maxBackups <= 0, then there is no file renaming to be done.
if($this->maxBackupIndex > 0) {
// Delete the oldest file, to keep Windows happy.
$file = $this->file . '.' . $this->maxBackupIndex;
if (file_exists($file) && !unlink($file)) {
throw new \n2n\log4... | php | private function rollOver() {
// If maxBackups <= 0, then there is no file renaming to be done.
if($this->maxBackupIndex > 0) {
// Delete the oldest file, to keep Windows happy.
$file = $this->file . '.' . $this->maxBackupIndex;
if (file_exists($file) && !unlink($file)) {
throw new \n2n\log4... | [
"private",
"function",
"rollOver",
"(",
")",
"{",
"// If maxBackups <= 0, then there is no file renaming to be done.\r",
"if",
"(",
"$",
"this",
"->",
"maxBackupIndex",
">",
"0",
")",
"{",
"// Delete the oldest file, to keep Windows happy.\r",
"$",
"file",
"=",
"$",
"this... | Implements the usual roll over behaviour.
If MaxBackupIndex is positive, then files File.1, ..., File.MaxBackupIndex -1 are renamed to File.2, ..., File.MaxBackupIndex.
Moreover, File is renamed File.1 and closed. A new File is created to receive further log output.
If MaxBackupIndex is equal to zero, then the File i... | [
"Implements",
"the",
"usual",
"roll",
"over",
"behaviour",
"."
] | 1e6fff4c2785acdb8c2e0c3d5451cbb7e1b51fc2 | https://github.com/n2n/n2n-log4php/blob/1e6fff4c2785acdb8c2e0c3d5451cbb7e1b51fc2/src/app/n2n/log4php/appender/rolling/RollingFile.php#L119-L139 |
225,443 | n2n/n2n-log4php | src/app/n2n/log4php/appender/rolling/RollingFile.php | RollingFile.write | protected function write($string) {
// Lazy file open
if(!isset($this->fp)) {
if ($this->openFile() === false) {
return; // Do not write if file open failed.
}
}
// Lock the file while writing and possible rolling over
if(\n2n\io\IoUtils::flock($this->fp, LOCK_EX)) {
// Write to... | php | protected function write($string) {
// Lazy file open
if(!isset($this->fp)) {
if ($this->openFile() === false) {
return; // Do not write if file open failed.
}
}
// Lock the file while writing and possible rolling over
if(\n2n\io\IoUtils::flock($this->fp, LOCK_EX)) {
// Write to... | [
"protected",
"function",
"write",
"(",
"$",
"string",
")",
"{",
"// Lazy file open\r",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"fp",
")",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"openFile",
"(",
")",
"===",
"false",
")",
"{",
"return",
";"... | Writes a string to the target file. Opens file if not already open.
@param string $string Data to write. | [
"Writes",
"a",
"string",
"to",
"the",
"target",
"file",
".",
"Opens",
"file",
"if",
"not",
"already",
"open",
"."
] | 1e6fff4c2785acdb8c2e0c3d5451cbb7e1b51fc2 | https://github.com/n2n/n2n-log4php/blob/1e6fff4c2785acdb8c2e0c3d5451cbb7e1b51fc2/src/app/n2n/log4php/appender/rolling/RollingFile.php#L198-L238 |
225,444 | ricardopedias/report-collection | src/Libs/Writer.php | Writer.createFromStyler | public static function createFromStyler(Styler $styler) : Writer
{
$classname = \get_called_class(); // para permitir abstração
$instance = new $classname;
$instance->styler = $styler;
$instance->reader = $styler->getReader();
return $instance;
} | php | public static function createFromStyler(Styler $styler) : Writer
{
$classname = \get_called_class(); // para permitir abstração
$instance = new $classname;
$instance->styler = $styler;
$instance->reader = $styler->getReader();
return $instance;
} | [
"public",
"static",
"function",
"createFromStyler",
"(",
"Styler",
"$",
"styler",
")",
":",
"Writer",
"{",
"$",
"classname",
"=",
"\\",
"get_called_class",
"(",
")",
";",
"// para permitir abstração",
"$",
"instance",
"=",
"new",
"$",
"classname",
";",
"$",
... | Importa os dados a partir do Styler
@param ReportCollection\Libs\Styler $styler
@return ReportCollection\Libs\Writer | [
"Importa",
"os",
"dados",
"a",
"partir",
"do",
"Styler"
] | 8536e2c48f83fa12b5cea20737d50da20945b71d | https://github.com/ricardopedias/report-collection/blob/8536e2c48f83fa12b5cea20737d50da20945b71d/src/Libs/Writer.php#L81-L89 |
225,445 | ricardopedias/report-collection | src/Libs/Writer.php | Writer.getStyler | public function getStyler() : Styler
{
if ($this->styler == null) {
$this->styler = Styler::createFromReader($this->getReader());
}
return $this->styler;
} | php | public function getStyler() : Styler
{
if ($this->styler == null) {
$this->styler = Styler::createFromReader($this->getReader());
}
return $this->styler;
} | [
"public",
"function",
"getStyler",
"(",
")",
":",
"Styler",
"{",
"if",
"(",
"$",
"this",
"->",
"styler",
"==",
"null",
")",
"{",
"$",
"this",
"->",
"styler",
"=",
"Styler",
"::",
"createFromReader",
"(",
"$",
"this",
"->",
"getReader",
"(",
")",
")",... | Devolve a instancia do Styler.
@return ReportCollection\Libs\Styler | [
"Devolve",
"a",
"instancia",
"do",
"Styler",
"."
] | 8536e2c48f83fa12b5cea20737d50da20945b71d | https://github.com/ricardopedias/report-collection/blob/8536e2c48f83fa12b5cea20737d50da20945b71d/src/Libs/Writer.php#L104-L111 |
225,446 | cmsgears/plugin-social-meta | components/SocialMeta.php | SocialMeta.getMetaTags | public static function getMetaTags( $params, $config = [] ) {
if( empty( $params[ 'model' ] ) ) {
return;
}
$config[ 'model' ] = $params[ 'model' ];
$config[ 'summary' ] = $params[ 'summary' ];
$config[ 'homePage' ] = isset( $params[ 'homePage' ] ) ? $params[ 'homePage' ] : 'home';
$meta = new Socia... | php | public static function getMetaTags( $params, $config = [] ) {
if( empty( $params[ 'model' ] ) ) {
return;
}
$config[ 'model' ] = $params[ 'model' ];
$config[ 'summary' ] = $params[ 'summary' ];
$config[ 'homePage' ] = isset( $params[ 'homePage' ] ) ? $params[ 'homePage' ] : 'home';
$meta = new Socia... | [
"public",
"static",
"function",
"getMetaTags",
"(",
"$",
"params",
",",
"$",
"config",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"params",
"[",
"'model'",
"]",
")",
")",
"{",
"return",
";",
"}",
"$",
"config",
"[",
"'model'",
"]",
"=... | Helper to generate tags | [
"Helper",
"to",
"generate",
"tags"
] | b4adae379ce9f1537d2678b241c1d2639ef022ba | https://github.com/cmsgears/plugin-social-meta/blob/b4adae379ce9f1537d2678b241c1d2639ef022ba/components/SocialMeta.php#L50-L64 |
225,447 | cmsgears/plugin-social-meta | components/SocialMeta.php | SocialMeta.generateTwitterCard | private function generateTwitterCard( $banner, $metaContent ) {
$properties = TwitterMetaProperties::getInstance();
if( $properties->isActive() ) {
$card = $properties->getCard();
$site = $properties->getSite();
$creator = $properties->getCreator();
$model = $this->model;
$summary = filter_var... | php | private function generateTwitterCard( $banner, $metaContent ) {
$properties = TwitterMetaProperties::getInstance();
if( $properties->isActive() ) {
$card = $properties->getCard();
$site = $properties->getSite();
$creator = $properties->getCreator();
$model = $this->model;
$summary = filter_var... | [
"private",
"function",
"generateTwitterCard",
"(",
"$",
"banner",
",",
"$",
"metaContent",
")",
"{",
"$",
"properties",
"=",
"TwitterMetaProperties",
"::",
"getInstance",
"(",
")",
";",
"if",
"(",
"$",
"properties",
"->",
"isActive",
"(",
")",
")",
"{",
"$... | Generate and return appropriate Twitter Card.
@param string $banner
@param array $metaContent
@return array | [
"Generate",
"and",
"return",
"appropriate",
"Twitter",
"Card",
"."
] | b4adae379ce9f1537d2678b241c1d2639ef022ba | https://github.com/cmsgears/plugin-social-meta/blob/b4adae379ce9f1537d2678b241c1d2639ef022ba/components/SocialMeta.php#L185-L283 |
225,448 | sopinetchat/SopinetChatBundle | Service/Consumer/SendMessagePackageConsumer.php | SendMessagePackageConsumer.execute | public function execute(AMQPMessage $msg)
{
$logger = $this->container->get("logger");
$jsonBody = json_decode($msg->body);
if ($jsonBody == null){
$logger->error("JSON NULL");
return false;
}
$messagePackageId = json_decode($msg->body)->messagePacka... | php | public function execute(AMQPMessage $msg)
{
$logger = $this->container->get("logger");
$jsonBody = json_decode($msg->body);
if ($jsonBody == null){
$logger->error("JSON NULL");
return false;
}
$messagePackageId = json_decode($msg->body)->messagePacka... | [
"public",
"function",
"execute",
"(",
"AMQPMessage",
"$",
"msg",
")",
"{",
"$",
"logger",
"=",
"$",
"this",
"->",
"container",
"->",
"get",
"(",
"\"logger\"",
")",
";",
"$",
"jsonBody",
"=",
"json_decode",
"(",
"$",
"msg",
"->",
"body",
")",
";",
"if... | Process the message
@param AMQPMessage $msg | [
"Process",
"the",
"message"
] | 92c306963d8e9c74ecaa06422cea65bcf1bb3ba2 | https://github.com/sopinetchat/SopinetChatBundle/blob/92c306963d8e9c74ecaa06422cea65bcf1bb3ba2/Service/Consumer/SendMessagePackageConsumer.php#L36-L90 |
225,449 | n2n/n2n-log4php | src/app/n2n/log4php/configuration/adapter/AdapterINI.php | AdapterINI.load | private function load($url) {
if (!file_exists($url)) {
throw new \n2n\log4php\LoggerException("File [$url] does not exist.");
}
$properties = \n2n\io\IoUtils::parseIniFile($url, true);
if ($properties === false) {
$error = error_get_last();
throw new \n2n\log4php\LoggerException("Error pars... | php | private function load($url) {
if (!file_exists($url)) {
throw new \n2n\log4php\LoggerException("File [$url] does not exist.");
}
$properties = \n2n\io\IoUtils::parseIniFile($url, true);
if ($properties === false) {
$error = error_get_last();
throw new \n2n\log4php\LoggerException("Error pars... | [
"private",
"function",
"load",
"(",
"$",
"url",
")",
"{",
"if",
"(",
"!",
"file_exists",
"(",
"$",
"url",
")",
")",
"{",
"throw",
"new",
"\\",
"n2n",
"\\",
"log4php",
"\\",
"LoggerException",
"(",
"\"File [$url] does not exist.\"",
")",
";",
"}",
"$",
... | Loads and parses the INI configuration file.
@param string $url Path to the config file.
@throws \n2n\log4php\LoggerException | [
"Loads",
"and",
"parses",
"the",
"INI",
"configuration",
"file",
"."
] | 1e6fff4c2785acdb8c2e0c3d5451cbb7e1b51fc2 | https://github.com/n2n/n2n-log4php/blob/1e6fff4c2785acdb8c2e0c3d5451cbb7e1b51fc2/src/app/n2n/log4php/configuration/adapter/AdapterINI.php#L66-L78 |
225,450 | n2n/n2n-log4php | src/app/n2n/log4php/configuration/adapter/AdapterINI.php | AdapterINI.parseAppender | private function parseAppender($key, $value) {
// Remove the appender prefix from key
$subKey = substr($key, strlen(self::APPENDER_PREFIX));
// Divide the string by dots
$parts = explode('.', $subKey);
$count = count($parts);
// The first part is always the appender name
$name = trim($par... | php | private function parseAppender($key, $value) {
// Remove the appender prefix from key
$subKey = substr($key, strlen(self::APPENDER_PREFIX));
// Divide the string by dots
$parts = explode('.', $subKey);
$count = count($parts);
// The first part is always the appender name
$name = trim($par... | [
"private",
"function",
"parseAppender",
"(",
"$",
"key",
",",
"$",
"value",
")",
"{",
"// Remove the appender prefix from key\r",
"$",
"subKey",
"=",
"substr",
"(",
"$",
"key",
",",
"strlen",
"(",
"self",
"::",
"APPENDER_PREFIX",
")",
")",
";",
"// Divide the ... | Parses an configuration line pertaining to an appender.
Parses the following patterns:
Appender class:
<pre>
log4php.appender.<name> = <class>
</pre>
Appender parameter:
<pre>
log4php.appender.<name>.<param> = <value>
</pre>
Appender threshold:
<pre>
log4php.appender.<name>.threshold = <level>
</pre>
Appender layo... | [
"Parses",
"an",
"configuration",
"line",
"pertaining",
"to",
"an",
"appender",
"."
] | 1e6fff4c2785acdb8c2e0c3d5451cbb7e1b51fc2 | https://github.com/n2n/n2n-log4php/blob/1e6fff4c2785acdb8c2e0c3d5451cbb7e1b51fc2/src/app/n2n/log4php/configuration/adapter/AdapterINI.php#L230-L272 |
225,451 | DrNixx/yii2-onix | src/system/DateTimeHelper.php | DateTimeHelper.nowSql | final public static function nowSql()
{
try {
$date = new \DateTimeImmutable(null, self::tzUtc());
return $date->format('Y-m-d H:i:s');
} catch (\Exception $e) {
return null;
}
} | php | final public static function nowSql()
{
try {
$date = new \DateTimeImmutable(null, self::tzUtc());
return $date->format('Y-m-d H:i:s');
} catch (\Exception $e) {
return null;
}
} | [
"final",
"public",
"static",
"function",
"nowSql",
"(",
")",
"{",
"try",
"{",
"$",
"date",
"=",
"new",
"\\",
"DateTimeImmutable",
"(",
"null",
",",
"self",
"::",
"tzUtc",
"(",
")",
")",
";",
"return",
"$",
"date",
"->",
"format",
"(",
"'Y-m-d H:i:s'",
... | Current date in SQL format
@return string | [
"Current",
"date",
"in",
"SQL",
"format"
] | 0a621ed301dc94971ff71af062b24d6bc0858dd7 | https://github.com/DrNixx/yii2-onix/blob/0a621ed301dc94971ff71af062b24d6bc0858dd7/src/system/DateTimeHelper.php#L80-L90 |
225,452 | DrNixx/yii2-onix | src/system/DateTimeHelper.php | DateTimeHelper.asSql | final public static function asSql($date)
{
if (!empty($date)) {
if ($date instanceof \DateTimeInterface) {
return $date->format('Y-m-d H:i:sO');
} else {
return self::asDateTime($date)->format('Y-m-d H:i:sO');
}
} else {
... | php | final public static function asSql($date)
{
if (!empty($date)) {
if ($date instanceof \DateTimeInterface) {
return $date->format('Y-m-d H:i:sO');
} else {
return self::asDateTime($date)->format('Y-m-d H:i:sO');
}
} else {
... | [
"final",
"public",
"static",
"function",
"asSql",
"(",
"$",
"date",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"date",
")",
")",
"{",
"if",
"(",
"$",
"date",
"instanceof",
"\\",
"DateTimeInterface",
")",
"{",
"return",
"$",
"date",
"->",
"format",
... | Date in SQL format
@param \DateTimeInterface|string $date
@return string|null
@throws \Exception | [
"Date",
"in",
"SQL",
"format"
] | 0a621ed301dc94971ff71af062b24d6bc0858dd7 | https://github.com/DrNixx/yii2-onix/blob/0a621ed301dc94971ff71af062b24d6bc0858dd7/src/system/DateTimeHelper.php#L136-L147 |
225,453 | DrNixx/yii2-onix | src/system/DateTimeHelper.php | DateTimeHelper.dateSqlUtcToIsoOffset | final public static function dateSqlUtcToIsoOffset($date, $default = null)
{
if (!empty($date)) {
$date = self::asDateTime($date);
$date->setTimezone(self::tzUtc());
return $date->format("Y-m-d\TH:i:sP");
} else {
return $default;
}
} | php | final public static function dateSqlUtcToIsoOffset($date, $default = null)
{
if (!empty($date)) {
$date = self::asDateTime($date);
$date->setTimezone(self::tzUtc());
return $date->format("Y-m-d\TH:i:sP");
} else {
return $default;
}
} | [
"final",
"public",
"static",
"function",
"dateSqlUtcToIsoOffset",
"(",
"$",
"date",
",",
"$",
"default",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"date",
")",
")",
"{",
"$",
"date",
"=",
"self",
"::",
"asDateTime",
"(",
"$",
"date",
... | Convert ISO offset datetime to SQL string
@param string $date Datetime i.e. 2011-12-03 10:15:30
@param null $default
@return null|string
@throws \Exception | [
"Convert",
"ISO",
"offset",
"datetime",
"to",
"SQL",
"string"
] | 0a621ed301dc94971ff71af062b24d6bc0858dd7 | https://github.com/DrNixx/yii2-onix/blob/0a621ed301dc94971ff71af062b24d6bc0858dd7/src/system/DateTimeHelper.php#L562-L571 |
225,454 | stubbles/stubbles-input | src/main/php/filter/range/AbstractRange.php | AbstractRange.contains | public function contains($value): bool
{
if (null === $value) {
return false;
}
if ($this->belowMinBorder($value)) {
return false;
}
return !$this->aboveMaxBorder($value);
} | php | public function contains($value): bool
{
if (null === $value) {
return false;
}
if ($this->belowMinBorder($value)) {
return false;
}
return !$this->aboveMaxBorder($value);
} | [
"public",
"function",
"contains",
"(",
"$",
"value",
")",
":",
"bool",
"{",
"if",
"(",
"null",
"===",
"$",
"value",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"$",
"this",
"->",
"belowMinBorder",
"(",
"$",
"value",
")",
")",
"{",
"return",
... | checks if range contains given value
@param mixed $value
@return bool | [
"checks",
"if",
"range",
"contains",
"given",
"value"
] | 1ce0ebe5ba392faf3cc369a95e3fe0fa38912b1e | https://github.com/stubbles/stubbles-input/blob/1ce0ebe5ba392faf3cc369a95e3fe0fa38912b1e/src/main/php/filter/range/AbstractRange.php#L25-L36 |
225,455 | stubbles/stubbles-input | src/main/php/filter/range/AbstractRange.php | AbstractRange.errorsOf | public function errorsOf($value): array
{
if ($this->belowMinBorder($value)) {
return $this->minBorderViolation();
}
if ($this->aboveMaxBorder($value)) {
return $this->maxBorderViolation();
}
return [];
} | php | public function errorsOf($value): array
{
if ($this->belowMinBorder($value)) {
return $this->minBorderViolation();
}
if ($this->aboveMaxBorder($value)) {
return $this->maxBorderViolation();
}
return [];
} | [
"public",
"function",
"errorsOf",
"(",
"$",
"value",
")",
":",
"array",
"{",
"if",
"(",
"$",
"this",
"->",
"belowMinBorder",
"(",
"$",
"value",
")",
")",
"{",
"return",
"$",
"this",
"->",
"minBorderViolation",
"(",
")",
";",
"}",
"if",
"(",
"$",
"t... | returns list of errors when range does not contain given value
@param mixed $value
@return array | [
"returns",
"list",
"of",
"errors",
"when",
"range",
"does",
"not",
"contain",
"given",
"value"
] | 1ce0ebe5ba392faf3cc369a95e3fe0fa38912b1e | https://github.com/stubbles/stubbles-input/blob/1ce0ebe5ba392faf3cc369a95e3fe0fa38912b1e/src/main/php/filter/range/AbstractRange.php#L44-L55 |
225,456 | czogori/Dami | src/Dami/Migration/MigrationFiles.php | MigrationFiles.get | public function get($version = null, $up = true)
{
$currentVersion = $this->schemaTable->getCurrentVersion();
if (null !== $version && false === $up && (int) $version > (int) $currentVersion) {
return null;
}
$files = $this->getFiles($up);
if (!$this->fileVersio... | php | public function get($version = null, $up = true)
{
$currentVersion = $this->schemaTable->getCurrentVersion();
if (null !== $version && false === $up && (int) $version > (int) $currentVersion) {
return null;
}
$files = $this->getFiles($up);
if (!$this->fileVersio... | [
"public",
"function",
"get",
"(",
"$",
"version",
"=",
"null",
",",
"$",
"up",
"=",
"true",
")",
"{",
"$",
"currentVersion",
"=",
"$",
"this",
"->",
"schemaTable",
"->",
"getCurrentVersion",
"(",
")",
";",
"if",
"(",
"null",
"!==",
"$",
"version",
"&... | Gets migration files.
@param string $version Version of migration.
@return MigrationFile[] | [
"Gets",
"migration",
"files",
"."
] | 19612e643f8bea76706cc667c3f2c12a42d4cd19 | https://github.com/czogori/Dami/blob/19612e643f8bea76706cc667c3f2c12a42d4cd19/src/Dami/Migration/MigrationFiles.php#L30-L63 |
225,457 | DrNixx/yii2-onix | src/widgets/WidgetTrait.php | WidgetTrait.initDestroyJs | protected function initDestroyJs()
{
if (isset($this->pluginDestroyJs)) {
return;
}
if (empty($this->pluginName)) {
$this->pluginDestroyJs = '';
return;
}
$id = "jQuery('#" . $this->options['id'] . "')";
$plugin = $this->pluginNam... | php | protected function initDestroyJs()
{
if (isset($this->pluginDestroyJs)) {
return;
}
if (empty($this->pluginName)) {
$this->pluginDestroyJs = '';
return;
}
$id = "jQuery('#" . $this->options['id'] . "')";
$plugin = $this->pluginNam... | [
"protected",
"function",
"initDestroyJs",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"pluginDestroyJs",
")",
")",
"{",
"return",
";",
"}",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"pluginName",
")",
")",
"{",
"$",
"this",
"->",
"... | Generates the `pluginDestroyJs` script if it is not set. | [
"Generates",
"the",
"pluginDestroyJs",
"script",
"if",
"it",
"is",
"not",
"set",
"."
] | 0a621ed301dc94971ff71af062b24d6bc0858dd7 | https://github.com/DrNixx/yii2-onix/blob/0a621ed301dc94971ff71af062b24d6bc0858dd7/src/widgets/WidgetTrait.php#L38-L52 |
225,458 | DrNixx/yii2-onix | src/widgets/WidgetTrait.php | WidgetTrait.addAsset | protected function addAsset($view, $file, $type, $class)
{
if ($type == 'css' || $type == 'js') {
$asset = $view->getAssetManager();
$bundle = $asset->bundles[$class];
if ($type == 'css') {
$bundle->css[] = $file;
} else {
$bund... | php | protected function addAsset($view, $file, $type, $class)
{
if ($type == 'css' || $type == 'js') {
$asset = $view->getAssetManager();
$bundle = $asset->bundles[$class];
if ($type == 'css') {
$bundle->css[] = $file;
} else {
$bund... | [
"protected",
"function",
"addAsset",
"(",
"$",
"view",
",",
"$",
"file",
",",
"$",
"type",
",",
"$",
"class",
")",
"{",
"if",
"(",
"$",
"type",
"==",
"'css'",
"||",
"$",
"type",
"==",
"'js'",
")",
"{",
"$",
"asset",
"=",
"$",
"view",
"->",
"get... | Adds an asset to the view.
@param View $view the View object
@param string $file the asset file name
@param string $type the asset file type (css or js)
@param string $class the class name of the AssetBundle | [
"Adds",
"an",
"asset",
"to",
"the",
"view",
"."
] | 0a621ed301dc94971ff71af062b24d6bc0858dd7 | https://github.com/DrNixx/yii2-onix/blob/0a621ed301dc94971ff71af062b24d6bc0858dd7/src/widgets/WidgetTrait.php#L61-L75 |
225,459 | DrNixx/yii2-onix | src/widgets/WidgetTrait.php | WidgetTrait.registerPluginOptions | protected function registerPluginOptions($name)
{
$this->hashPluginOptions($name);
$encOptions = empty($this->_encOptions) ? '{}' : $this->_encOptions;
$this->registerWidgetJs("window.{$this->_hashVar} = {$encOptions};\n", $this->hashVarLoadPosition);
} | php | protected function registerPluginOptions($name)
{
$this->hashPluginOptions($name);
$encOptions = empty($this->_encOptions) ? '{}' : $this->_encOptions;
$this->registerWidgetJs("window.{$this->_hashVar} = {$encOptions};\n", $this->hashVarLoadPosition);
} | [
"protected",
"function",
"registerPluginOptions",
"(",
"$",
"name",
")",
"{",
"$",
"this",
"->",
"hashPluginOptions",
"(",
"$",
"name",
")",
";",
"$",
"encOptions",
"=",
"empty",
"(",
"$",
"this",
"->",
"_encOptions",
")",
"?",
"'{}'",
":",
"$",
"this",
... | Registers plugin options by storing within a uniquely generated javascript variable.
@param string $name the plugin name | [
"Registers",
"plugin",
"options",
"by",
"storing",
"within",
"a",
"uniquely",
"generated",
"javascript",
"variable",
"."
] | 0a621ed301dc94971ff71af062b24d6bc0858dd7 | https://github.com/DrNixx/yii2-onix/blob/0a621ed301dc94971ff71af062b24d6bc0858dd7/src/widgets/WidgetTrait.php#L96-L101 |
225,460 | DrNixx/yii2-onix | src/widgets/WidgetTrait.php | WidgetTrait.getPluginScript | protected function getPluginScript($name, $element = null, $callback = null, $callbackCon = null)
{
$id = $element ? $element : "jQuery('#" . $this->options['id'] . "')";
$script = '';
if ($this->pluginOptions !== false) {
$this->registerPluginOptions($name);
$script ... | php | protected function getPluginScript($name, $element = null, $callback = null, $callbackCon = null)
{
$id = $element ? $element : "jQuery('#" . $this->options['id'] . "')";
$script = '';
if ($this->pluginOptions !== false) {
$this->registerPluginOptions($name);
$script ... | [
"protected",
"function",
"getPluginScript",
"(",
"$",
"name",
",",
"$",
"element",
"=",
"null",
",",
"$",
"callback",
"=",
"null",
",",
"$",
"callbackCon",
"=",
"null",
")",
"{",
"$",
"id",
"=",
"$",
"element",
"?",
"$",
"element",
":",
"\"jQuery('#\""... | Returns the plugin registration script.
@param string $name the name of the plugin
@param string $element the plugin target element
@param string $callback the javascript callback function to be called after plugin loads
@param string $callbackCon the javascript callback function to be passed to the plugin constructor... | [
"Returns",
"the",
"plugin",
"registration",
"script",
"."
] | 0a621ed301dc94971ff71af062b24d6bc0858dd7 | https://github.com/DrNixx/yii2-onix/blob/0a621ed301dc94971ff71af062b24d6bc0858dd7/src/widgets/WidgetTrait.php#L112-L139 |
225,461 | DrNixx/yii2-onix | src/widgets/WidgetTrait.php | WidgetTrait.registerWidgetJs | public function registerWidgetJs($js, $pos = View::POS_READY, $key = null)
{
if (empty($js)) {
return;
}
$view = $this->getView();
// WidgetAsset::register($view);
$view->registerJs($js, $pos, $key);
if (!empty($this->pjaxContainerId) && ($pos === View::... | php | public function registerWidgetJs($js, $pos = View::POS_READY, $key = null)
{
if (empty($js)) {
return;
}
$view = $this->getView();
// WidgetAsset::register($view);
$view->registerJs($js, $pos, $key);
if (!empty($this->pjaxContainerId) && ($pos === View::... | [
"public",
"function",
"registerWidgetJs",
"(",
"$",
"js",
",",
"$",
"pos",
"=",
"View",
"::",
"POS_READY",
",",
"$",
"key",
"=",
"null",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"js",
")",
")",
"{",
"return",
";",
"}",
"$",
"view",
"=",
"$",
"th... | Registers a JS code block for the widget.
@param string $js the JS code block to be registered
@param integer $pos the position at which the JS script tag should be inserted in a page. The possible values
are:
- [[View::POS_HEAD]]: in the head section
- [[View::POS_BEGIN]]: at the beginning of the body section
- [[Vi... | [
"Registers",
"a",
"JS",
"code",
"block",
"for",
"the",
"widget",
"."
] | 0a621ed301dc94971ff71af062b24d6bc0858dd7 | https://github.com/DrNixx/yii2-onix/blob/0a621ed301dc94971ff71af062b24d6bc0858dd7/src/widgets/WidgetTrait.php#L170-L191 |
225,462 | UCSLabs/Referenceable | ReferenceGeneratorProvider.php | ReferenceGeneratorProvider.find | public function find(ReferenceableInterface $referenceable) {
foreach( $this->generators->all() as $generator ) {
if( $generator->canHandle($referenceable) ) {
return $generator;
}
}
return null;
} | php | public function find(ReferenceableInterface $referenceable) {
foreach( $this->generators->all() as $generator ) {
if( $generator->canHandle($referenceable) ) {
return $generator;
}
}
return null;
} | [
"public",
"function",
"find",
"(",
"ReferenceableInterface",
"$",
"referenceable",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"generators",
"->",
"all",
"(",
")",
"as",
"$",
"generator",
")",
"{",
"if",
"(",
"$",
"generator",
"->",
"canHandle",
"(",
"$... | Get the generator with the highest priority that can be applied to the
given entity
@param mixed $referenceable the object on which the generator should be
applied
@return null|ReferenceGeneratorInterface | [
"Get",
"the",
"generator",
"with",
"the",
"highest",
"priority",
"that",
"can",
"be",
"applied",
"to",
"the",
"given",
"entity"
] | 72cef440197898605237805293109be1e4a79d67 | https://github.com/UCSLabs/Referenceable/blob/72cef440197898605237805293109be1e4a79d67/ReferenceGeneratorProvider.php#L64-L72 |
225,463 | UCSLabs/Referenceable | ReferenceGeneratorProvider.php | ReferenceGeneratorProvider.findAll | public function findAll(ReferenceableInterface $referenceable) {
$generators = new ReferenceGeneratorCollection();
foreach( $this->generators->all() as $generator ) {
if( $generator->canHandle($referenceable) ) {
$generators->add($generator);
}
}
... | php | public function findAll(ReferenceableInterface $referenceable) {
$generators = new ReferenceGeneratorCollection();
foreach( $this->generators->all() as $generator ) {
if( $generator->canHandle($referenceable) ) {
$generators->add($generator);
}
}
... | [
"public",
"function",
"findAll",
"(",
"ReferenceableInterface",
"$",
"referenceable",
")",
"{",
"$",
"generators",
"=",
"new",
"ReferenceGeneratorCollection",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"generators",
"->",
"all",
"(",
")",
"as",
"$",
"... | Get all generators for the given entity
@param mixed $referenceable the object on which the generator should be
applied
@return null|ReferenceGeneratorInterface | [
"Get",
"all",
"generators",
"for",
"the",
"given",
"entity"
] | 72cef440197898605237805293109be1e4a79d67 | https://github.com/UCSLabs/Referenceable/blob/72cef440197898605237805293109be1e4a79d67/ReferenceGeneratorProvider.php#L100-L110 |
225,464 | sopinetchat/SopinetChatBundle | Service/MessageHelper.php | MessageHelper.sendMessage | public function sendMessage(Message $message) {
if ($this->isDisabled()) {
return false;
}
$users = $message->getMyDestionationUsers($this->container);
$sentCount = 0;
foreach($users as $user) {
//if($user->getId() != $message->getFromUser()->getId()){
... | php | public function sendMessage(Message $message) {
if ($this->isDisabled()) {
return false;
}
$users = $message->getMyDestionationUsers($this->container);
$sentCount = 0;
foreach($users as $user) {
//if($user->getId() != $message->getFromUser()->getId()){
... | [
"public",
"function",
"sendMessage",
"(",
"Message",
"$",
"message",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isDisabled",
"(",
")",
")",
"{",
"return",
"false",
";",
"}",
"$",
"users",
"=",
"$",
"message",
"->",
"getMyDestionationUsers",
"(",
"$",
"th... | Manda un mensaje a los usuarios que el tipo de Mensaje indique
@param Message $message
@return integer: -1 si hay error, 0 si no hay dispositivos a los que mandar, y más de 0 indicando el número de mensajes enviados | [
"Manda",
"un",
"mensaje",
"a",
"los",
"usuarios",
"que",
"el",
"tipo",
"de",
"Mensaje",
"indique"
] | 92c306963d8e9c74ecaa06422cea65bcf1bb3ba2 | https://github.com/sopinetchat/SopinetChatBundle/blob/92c306963d8e9c74ecaa06422cea65bcf1bb3ba2/Service/MessageHelper.php#L100-L113 |
225,465 | sopinetchat/SopinetChatBundle | Service/MessageHelper.php | MessageHelper.sendRealMessageToDevice | public function sendRealMessageToDevice(Message $message, Device $device, $user = null, Request $request = null)
{
if ($this->isDisabled()) {
return false;
}
$em = $this->container->get('doctrine')->getManager();
$config = $this->container->getParameter('sopinet_chat.co... | php | public function sendRealMessageToDevice(Message $message, Device $device, $user = null, Request $request = null)
{
if ($this->isDisabled()) {
return false;
}
$em = $this->container->get('doctrine')->getManager();
$config = $this->container->getParameter('sopinet_chat.co... | [
"public",
"function",
"sendRealMessageToDevice",
"(",
"Message",
"$",
"message",
",",
"Device",
"$",
"device",
",",
"$",
"user",
"=",
"null",
",",
"Request",
"$",
"request",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isDisabled",
"(",
")",
"... | Send message to User and device
It functions transform to Real message data array
@param Object $msg
@param String $to | [
"Send",
"message",
"to",
"User",
"and",
"device",
"It",
"functions",
"transform",
"to",
"Real",
"message",
"data",
"array"
] | 92c306963d8e9c74ecaa06422cea65bcf1bb3ba2 | https://github.com/sopinetchat/SopinetChatBundle/blob/92c306963d8e9c74ecaa06422cea65bcf1bb3ba2/Service/MessageHelper.php#L208-L273 |
225,466 | sopinetchat/SopinetChatBundle | Service/MessageHelper.php | MessageHelper.sendGCMessage | private function sendGCMessage($mes, $text, $to)
{
$message=new AndroidMessage();
$message->setMessage($text);
$message->setData($mes);
$message->setDeviceIdentifier($to);
$message->setGCM(true);
// $logger = $this->container->get('logger');
// $logger->emerg(im... | php | private function sendGCMessage($mes, $text, $to)
{
$message=new AndroidMessage();
$message->setMessage($text);
$message->setData($mes);
$message->setDeviceIdentifier($to);
$message->setGCM(true);
// $logger = $this->container->get('logger');
// $logger->emerg(im... | [
"private",
"function",
"sendGCMessage",
"(",
"$",
"mes",
",",
"$",
"text",
",",
"$",
"to",
")",
"{",
"$",
"message",
"=",
"new",
"AndroidMessage",
"(",
")",
";",
"$",
"message",
"->",
"setMessage",
"(",
"$",
"text",
")",
";",
"$",
"message",
"->",
... | Funcion que envia un mensaje con el servicio GCM de Google
@param Array $mes
@param DeviceId $to | [
"Funcion",
"que",
"envia",
"un",
"mensaje",
"con",
"el",
"servicio",
"GCM",
"de",
"Google"
] | 92c306963d8e9c74ecaa06422cea65bcf1bb3ba2 | https://github.com/sopinetchat/SopinetChatBundle/blob/92c306963d8e9c74ecaa06422cea65bcf1bb3ba2/Service/MessageHelper.php#L304-L320 |
225,467 | sopinetchat/SopinetChatBundle | Service/MessageHelper.php | MessageHelper.sendMessageToEmail | public function sendMessageToEmail(Message $message, $user) {
if (is_object($user)) {
$toEmail = $user->getEmail();
} else {
$toEmail = $user;
}
if ($this->container->hasParameter('mailer_email')) {
$mailer_email = $this->container->getParameter('mail... | php | public function sendMessageToEmail(Message $message, $user) {
if (is_object($user)) {
$toEmail = $user->getEmail();
} else {
$toEmail = $user;
}
if ($this->container->hasParameter('mailer_email')) {
$mailer_email = $this->container->getParameter('mail... | [
"public",
"function",
"sendMessageToEmail",
"(",
"Message",
"$",
"message",
",",
"$",
"user",
")",
"{",
"if",
"(",
"is_object",
"(",
"$",
"user",
")",
")",
"{",
"$",
"toEmail",
"=",
"$",
"user",
"->",
"getEmail",
"(",
")",
";",
"}",
"else",
"{",
"$... | Send a message to Email
@return bool | [
"Send",
"a",
"message",
"to",
"Email"
] | 92c306963d8e9c74ecaa06422cea65bcf1bb3ba2 | https://github.com/sopinetchat/SopinetChatBundle/blob/92c306963d8e9c74ecaa06422cea65bcf1bb3ba2/Service/MessageHelper.php#L388-L426 |
225,468 | yawik/behat | src/CoreContext.php | CoreContext.iSubmitTheFormWithId | public function iSubmitTheFormWithId($arg)
{
$node = $this->minkContext->getSession()->getPage()->find('css', $arg);
if ($node) {
$this->minkContext->getSession()->executeScript("jQuery('$arg').submit();");
} else {
throw new \Exception('Element not found');
}... | php | public function iSubmitTheFormWithId($arg)
{
$node = $this->minkContext->getSession()->getPage()->find('css', $arg);
if ($node) {
$this->minkContext->getSession()->executeScript("jQuery('$arg').submit();");
} else {
throw new \Exception('Element not found');
}... | [
"public",
"function",
"iSubmitTheFormWithId",
"(",
"$",
"arg",
")",
"{",
"$",
"node",
"=",
"$",
"this",
"->",
"minkContext",
"->",
"getSession",
"(",
")",
"->",
"getPage",
"(",
")",
"->",
"find",
"(",
"'css'",
",",
"$",
"arg",
")",
";",
"if",
"(",
... | Some forms do not have a Submit button just pass the ID
@Given /^I submit the form with id "([^"]*)"$/ | [
"Some",
"forms",
"do",
"not",
"have",
"a",
"Submit",
"button",
"just",
"pass",
"the",
"ID"
] | 9e776b8aa8a069da13e35d717f7bb35c2f96b277 | https://github.com/yawik/behat/blob/9e776b8aa8a069da13e35d717f7bb35c2f96b277/src/CoreContext.php#L143-L151 |
225,469 | yawik/behat | src/CoreContext.php | CoreContext.iClickOnTheText | public function iClickOnTheText($text)
{
$session = $this->getSession();
$element = $session->getPage()->find(
'xpath',
$session->getSelectorsHandler()->selectorToXpath('xpath', '*//*[text()="'. $text .'"]')
);
if (null === $element) {
$element = $... | php | public function iClickOnTheText($text)
{
$session = $this->getSession();
$element = $session->getPage()->find(
'xpath',
$session->getSelectorsHandler()->selectorToXpath('xpath', '*//*[text()="'. $text .'"]')
);
if (null === $element) {
$element = $... | [
"public",
"function",
"iClickOnTheText",
"(",
"$",
"text",
")",
"{",
"$",
"session",
"=",
"$",
"this",
"->",
"getSession",
"(",
")",
";",
"$",
"element",
"=",
"$",
"session",
"->",
"getPage",
"(",
")",
"->",
"find",
"(",
"'xpath'",
",",
"$",
"session... | Click some text
@When /^I click on the text "([^"]*)"$/ | [
"Click",
"some",
"text"
] | 9e776b8aa8a069da13e35d717f7bb35c2f96b277 | https://github.com/yawik/behat/blob/9e776b8aa8a069da13e35d717f7bb35c2f96b277/src/CoreContext.php#L285-L303 |
225,470 | railken/amethyst-listener | src/Managers/ListenerManager.php | ListenerManager.getAvailableEventClasses | public function getAvailableEventClasses()
{
/** @var \Railken\Amethyst\Repositories\ListenerRepository */
$repository = $this->getRepository();
return $repository->newQuery()->get()->map(function ($v) {
return $v->event_class;
})->toArray();
} | php | public function getAvailableEventClasses()
{
/** @var \Railken\Amethyst\Repositories\ListenerRepository */
$repository = $this->getRepository();
return $repository->newQuery()->get()->map(function ($v) {
return $v->event_class;
})->toArray();
} | [
"public",
"function",
"getAvailableEventClasses",
"(",
")",
"{",
"/** @var \\Railken\\Amethyst\\Repositories\\ListenerRepository */",
"$",
"repository",
"=",
"$",
"this",
"->",
"getRepository",
"(",
")",
";",
"return",
"$",
"repository",
"->",
"newQuery",
"(",
")",
"-... | Retrieve all events_class available.
@return array | [
"Retrieve",
"all",
"events_class",
"available",
"."
] | e815710b199ee445c7cea9f4a8af03593cb1e878 | https://github.com/railken/amethyst-listener/blob/e815710b199ee445c7cea9f4a8af03593cb1e878/src/Managers/ListenerManager.php#L22-L30 |
225,471 | bytic/Common | src/Controllers/Traits/HasRecordPaginator.php | HasRecordPaginator.prepareRecordPaginator | public function prepareRecordPaginator()
{
$page = $this->getRequest()->get('page', 1);
$this->getRecordPaginator()->setPage(intval($page));
$this->getRecordPaginator()->setItemsPerPage(50);
} | php | public function prepareRecordPaginator()
{
$page = $this->getRequest()->get('page', 1);
$this->getRecordPaginator()->setPage(intval($page));
$this->getRecordPaginator()->setItemsPerPage(50);
} | [
"public",
"function",
"prepareRecordPaginator",
"(",
")",
"{",
"$",
"page",
"=",
"$",
"this",
"->",
"getRequest",
"(",
")",
"->",
"get",
"(",
"'page'",
",",
"1",
")",
";",
"$",
"this",
"->",
"getRecordPaginator",
"(",
")",
"->",
"setPage",
"(",
"intval... | Prepare Record Paginator Object
@return void | [
"Prepare",
"Record",
"Paginator",
"Object"
] | 5d17043e03a2274a758fba1f6dedb7d85195bcfb | https://github.com/bytic/Common/blob/5d17043e03a2274a758fba1f6dedb7d85195bcfb/src/Controllers/Traits/HasRecordPaginator.php#L79-L84 |
225,472 | n2n/n2n-log4php | src/app/n2n/log4php/layout/LayoutPattern.php | LayoutPattern.activateOptions | public function activateOptions() {
if (!isset($this->pattern)) {
throw new \n2n\log4php\LoggerException("Mandatory parameter 'conversionPattern' is not set.");
}
$parser = new \n2n\log4php\pattern\PatternParser($this->pattern, $this->converterMap);
$this->head = $parser->parse();
} | php | public function activateOptions() {
if (!isset($this->pattern)) {
throw new \n2n\log4php\LoggerException("Mandatory parameter 'conversionPattern' is not set.");
}
$parser = new \n2n\log4php\pattern\PatternParser($this->pattern, $this->converterMap);
$this->head = $parser->parse();
} | [
"public",
"function",
"activateOptions",
"(",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"pattern",
")",
")",
"{",
"throw",
"new",
"\\",
"n2n",
"\\",
"log4php",
"\\",
"LoggerException",
"(",
"\"Mandatory parameter 'conversionPattern' is not set.\... | Processes the conversion pattern and creates a corresponding chain of
pattern converters which will be used to format logging events. | [
"Processes",
"the",
"conversion",
"pattern",
"and",
"creates",
"a",
"corresponding",
"chain",
"of",
"pattern",
"converters",
"which",
"will",
"be",
"used",
"to",
"format",
"logging",
"events",
"."
] | 1e6fff4c2785acdb8c2e0c3d5451cbb7e1b51fc2 | https://github.com/n2n/n2n-log4php/blob/1e6fff4c2785acdb8c2e0c3d5451cbb7e1b51fc2/src/app/n2n/log4php/layout/LayoutPattern.php#L148-L155 |
225,473 | n2n/n2n-log4php | src/app/n2n/log4php/layout/LayoutPattern.php | LayoutPattern.format | public function format(\n2n\log4php\logging\LoggingEvent $event) {
$sbuf = '';
$converter = $this->head;
while ($converter !== null) {
$converter->format($sbuf, $event);
$converter = $converter->next;
}
return $sbuf;
} | php | public function format(\n2n\log4php\logging\LoggingEvent $event) {
$sbuf = '';
$converter = $this->head;
while ($converter !== null) {
$converter->format($sbuf, $event);
$converter = $converter->next;
}
return $sbuf;
} | [
"public",
"function",
"format",
"(",
"\\",
"n2n",
"\\",
"log4php",
"\\",
"logging",
"\\",
"LoggingEvent",
"$",
"event",
")",
"{",
"$",
"sbuf",
"=",
"''",
";",
"$",
"converter",
"=",
"$",
"this",
"->",
"head",
";",
"while",
"(",
"$",
"converter",
"!==... | Produces a formatted string as specified by the conversion pattern.
@param \n2n\log4php\logging\LoggingEvent $event
@return string | [
"Produces",
"a",
"formatted",
"string",
"as",
"specified",
"by",
"the",
"conversion",
"pattern",
"."
] | 1e6fff4c2785acdb8c2e0c3d5451cbb7e1b51fc2 | https://github.com/n2n/n2n-log4php/blob/1e6fff4c2785acdb8c2e0c3d5451cbb7e1b51fc2/src/app/n2n/log4php/layout/LayoutPattern.php#L163-L171 |
225,474 | SetBased/php-helper-code-store | src/CodeStore.php | CodeStore.append | public function append($line, bool $trim = true): void
{
switch (true)
{
case is_string($line):
$this->appendLine($line, $trim);
break;
case is_array($line):
$this->appendLines($line, $trim);
break;
case is_null($line):
// Nothing to do.
brea... | php | public function append($line, bool $trim = true): void
{
switch (true)
{
case is_string($line):
$this->appendLine($line, $trim);
break;
case is_array($line):
$this->appendLines($line, $trim);
break;
case is_null($line):
// Nothing to do.
brea... | [
"public",
"function",
"append",
"(",
"$",
"line",
",",
"bool",
"$",
"trim",
"=",
"true",
")",
":",
"void",
"{",
"switch",
"(",
"true",
")",
"{",
"case",
"is_string",
"(",
"$",
"line",
")",
":",
"$",
"this",
"->",
"appendLine",
"(",
"$",
"line",
"... | Appends a line or lines of code.
@param null|string|string[] $line The line or lines of code to be appended. Null values will be ignored.
@param bool $trim If true the line or lines of code will be trimmed before appending.
@throws \InvalidArgumentException
@since 1.0.0
@api | [
"Appends",
"a",
"line",
"or",
"lines",
"of",
"code",
"."
] | 42d248b757ffdf7f3d660cadf5b27040f5785b4a | https://github.com/SetBased/php-helper-code-store/blob/42d248b757ffdf7f3d660cadf5b27040f5785b4a/src/CodeStore.php#L112-L131 |
225,475 | SetBased/php-helper-code-store | src/CodeStore.php | CodeStore.appendToLastLine | public function appendToLastLine(string $part): void
{
$this->lines[count($this->lines) - 1] .= $part;
} | php | public function appendToLastLine(string $part): void
{
$this->lines[count($this->lines) - 1] .= $part;
} | [
"public",
"function",
"appendToLastLine",
"(",
"string",
"$",
"part",
")",
":",
"void",
"{",
"$",
"this",
"->",
"lines",
"[",
"count",
"(",
"$",
"this",
"->",
"lines",
")",
"-",
"1",
"]",
".=",
"$",
"part",
";",
"}"
] | Appends a part of code to the last line of code.
@param string $part The part of code to be to the last line.
@since 1.0.0
@api | [
"Appends",
"a",
"part",
"of",
"code",
"to",
"the",
"last",
"line",
"of",
"code",
"."
] | 42d248b757ffdf7f3d660cadf5b27040f5785b4a | https://github.com/SetBased/php-helper-code-store/blob/42d248b757ffdf7f3d660cadf5b27040f5785b4a/src/CodeStore.php#L154-L157 |
225,476 | SetBased/php-helper-code-store | src/CodeStore.php | CodeStore.getCode | public function getCode(): string
{
$lines = [];
$indentLevel = 0;
foreach ($this->lines as $line)
{
$mode = $this->indentationMode($line);
// Increment or decrement indentation level.
if ($mode & self::C_INDENT_INCREMENT_BEFORE)
{
$indentLevel++;
}
... | php | public function getCode(): string
{
$lines = [];
$indentLevel = 0;
foreach ($this->lines as $line)
{
$mode = $this->indentationMode($line);
// Increment or decrement indentation level.
if ($mode & self::C_INDENT_INCREMENT_BEFORE)
{
$indentLevel++;
}
... | [
"public",
"function",
"getCode",
"(",
")",
":",
"string",
"{",
"$",
"lines",
"=",
"[",
"]",
";",
"$",
"indentLevel",
"=",
"0",
";",
"foreach",
"(",
"$",
"this",
"->",
"lines",
"as",
"$",
"line",
")",
"{",
"$",
"mode",
"=",
"$",
"this",
"->",
"i... | Returns the generated code properly indented as a single string.
@return string
@since 1.0.0
@api | [
"Returns",
"the",
"generated",
"code",
"properly",
"indented",
"as",
"a",
"single",
"string",
"."
] | 42d248b757ffdf7f3d660cadf5b27040f5785b4a | https://github.com/SetBased/php-helper-code-store/blob/42d248b757ffdf7f3d660cadf5b27040f5785b4a/src/CodeStore.php#L180-L229 |
225,477 | SetBased/php-helper-code-store | src/CodeStore.php | CodeStore.addIndentation | private function addIndentation(string $line, int $indentLevel): string
{
return ($line==='') ? '' : str_repeat(' ', $this->indentation * $indentLevel).$line;
} | php | private function addIndentation(string $line, int $indentLevel): string
{
return ($line==='') ? '' : str_repeat(' ', $this->indentation * $indentLevel).$line;
} | [
"private",
"function",
"addIndentation",
"(",
"string",
"$",
"line",
",",
"int",
"$",
"indentLevel",
")",
":",
"string",
"{",
"return",
"(",
"$",
"line",
"===",
"''",
")",
"?",
"''",
":",
"str_repeat",
"(",
"' '",
",",
"$",
"this",
"->",
"indentation",... | Returns a line of code with the proper amount of indentationMode.
@param string $line The line of code.
@param int $indentLevel The indentation level.
@return string The indented line of code. | [
"Returns",
"a",
"line",
"of",
"code",
"with",
"the",
"proper",
"amount",
"of",
"indentationMode",
"."
] | 42d248b757ffdf7f3d660cadf5b27040f5785b4a | https://github.com/SetBased/php-helper-code-store/blob/42d248b757ffdf7f3d660cadf5b27040f5785b4a/src/CodeStore.php#L307-L310 |
225,478 | SetBased/php-helper-code-store | src/CodeStore.php | CodeStore.appendLine | private function appendLine(?string $line, bool $trim): void
{
if ($line===null) return;
if ($trim) $line = trim($line);
$this->lines[] = $line;
} | php | private function appendLine(?string $line, bool $trim): void
{
if ($line===null) return;
if ($trim) $line = trim($line);
$this->lines[] = $line;
} | [
"private",
"function",
"appendLine",
"(",
"?",
"string",
"$",
"line",
",",
"bool",
"$",
"trim",
")",
":",
"void",
"{",
"if",
"(",
"$",
"line",
"===",
"null",
")",
"return",
";",
"if",
"(",
"$",
"trim",
")",
"$",
"line",
"=",
"trim",
"(",
"$",
"... | Appends a line of code this this code.
@param null|string $line The line of code to append. If null the line will be ignored.
@param bool $trim If true the line of code will be trimmed before appending. | [
"Appends",
"a",
"line",
"of",
"code",
"this",
"this",
"code",
"."
] | 42d248b757ffdf7f3d660cadf5b27040f5785b4a | https://github.com/SetBased/php-helper-code-store/blob/42d248b757ffdf7f3d660cadf5b27040f5785b4a/src/CodeStore.php#L319-L326 |
225,479 | SetBased/php-helper-code-store | src/CodeStore.php | CodeStore.appendLines | private function appendLines(array $lines, bool $trim): void
{
foreach ($lines as $line)
{
$this->appendLine($line, $trim);
}
} | php | private function appendLines(array $lines, bool $trim): void
{
foreach ($lines as $line)
{
$this->appendLine($line, $trim);
}
} | [
"private",
"function",
"appendLines",
"(",
"array",
"$",
"lines",
",",
"bool",
"$",
"trim",
")",
":",
"void",
"{",
"foreach",
"(",
"$",
"lines",
"as",
"$",
"line",
")",
"{",
"$",
"this",
"->",
"appendLine",
"(",
"$",
"line",
",",
"$",
"trim",
")",
... | Appends an array with lines of code this this code.
@param string[] $lines The lines of code to append.
@param bool $trim If true the lines of code will be trimmed before appending. | [
"Appends",
"an",
"array",
"with",
"lines",
"of",
"code",
"this",
"this",
"code",
"."
] | 42d248b757ffdf7f3d660cadf5b27040f5785b4a | https://github.com/SetBased/php-helper-code-store/blob/42d248b757ffdf7f3d660cadf5b27040f5785b4a/src/CodeStore.php#L335-L341 |
225,480 | SetBased/php-abc-table-overview | src/OverviewTable.php | OverviewTable.addColumn | public function addColumn(TableColumn $column): void
{
// Add the column to our array of columns.
$this->columns[$this->columnIndex] = $column;
$column->onAddColumn($this, $this->columnIndex);
// Increase the index for the next added column.
$this->columnIndex += $column->getColSpan();
} | php | public function addColumn(TableColumn $column): void
{
// Add the column to our array of columns.
$this->columns[$this->columnIndex] = $column;
$column->onAddColumn($this, $this->columnIndex);
// Increase the index for the next added column.
$this->columnIndex += $column->getColSpan();
} | [
"public",
"function",
"addColumn",
"(",
"TableColumn",
"$",
"column",
")",
":",
"void",
"{",
"// Add the column to our array of columns.",
"$",
"this",
"->",
"columns",
"[",
"$",
"this",
"->",
"columnIndex",
"]",
"=",
"$",
"column",
";",
"$",
"column",
"->",
... | Adds a column to this table.
@param TableColumn $column The column to be added to this table. | [
"Adds",
"a",
"column",
"to",
"this",
"table",
"."
] | 1cdbd1c9e9ff972af3b2f7b622f9f2da8f301d9a | https://github.com/SetBased/php-abc-table-overview/blob/1cdbd1c9e9ff972af3b2f7b622f9f2da8f301d9a/src/OverviewTable.php#L73-L82 |
225,481 | SetBased/php-abc-table-overview | src/OverviewTable.php | OverviewTable.getHtmlTable | public function getHtmlTable(array $rows): string
{
$this->prepare();
$ret = $this->getHtmlPrefix();
$ret .= Html::generateTag('table', $this->attributes);
// Generate HTML code for the column classes.
$ret .= '<colgroup>';
foreach ($this->columns as $column)
{
// If required disa... | php | public function getHtmlTable(array $rows): string
{
$this->prepare();
$ret = $this->getHtmlPrefix();
$ret .= Html::generateTag('table', $this->attributes);
// Generate HTML code for the column classes.
$ret .= '<colgroup>';
foreach ($this->columns as $column)
{
// If required disa... | [
"public",
"function",
"getHtmlTable",
"(",
"array",
"$",
"rows",
")",
":",
"string",
"{",
"$",
"this",
"->",
"prepare",
"(",
")",
";",
"$",
"ret",
"=",
"$",
"this",
"->",
"getHtmlPrefix",
"(",
")",
";",
"$",
"ret",
".=",
"Html",
"::",
"generateTag",
... | Returns the HTML code of this table
@param array[] $rows The data shown in the table.
@return string | [
"Returns",
"the",
"HTML",
"code",
"of",
"this",
"table"
] | 1cdbd1c9e9ff972af3b2f7b622f9f2da8f301d9a | https://github.com/SetBased/php-abc-table-overview/blob/1cdbd1c9e9ff972af3b2f7b622f9f2da8f301d9a/src/OverviewTable.php#L119-L156 |
225,482 | SetBased/php-abc-table-overview | src/OverviewTable.php | OverviewTable.getHtmlBody | protected function getHtmlBody(array $rows): string
{
$ret = '';
$i = 0;
foreach ($rows as $row)
{
$class = static::$class;
if ($class!==null) $class .= ' ';
$class .= ($i % 2==0) ? 'even' : 'odd';
$ret .= Html::generateTag('tr', ['class' => $class]);
foreach ($this->c... | php | protected function getHtmlBody(array $rows): string
{
$ret = '';
$i = 0;
foreach ($rows as $row)
{
$class = static::$class;
if ($class!==null) $class .= ' ';
$class .= ($i % 2==0) ? 'even' : 'odd';
$ret .= Html::generateTag('tr', ['class' => $class]);
foreach ($this->c... | [
"protected",
"function",
"getHtmlBody",
"(",
"array",
"$",
"rows",
")",
":",
"string",
"{",
"$",
"ret",
"=",
"''",
";",
"$",
"i",
"=",
"0",
";",
"foreach",
"(",
"$",
"rows",
"as",
"$",
"row",
")",
"{",
"$",
"class",
"=",
"static",
"::",
"$",
"c... | Returns the inner HTML code of the body for this table holding the rows as data.
@param array[] $rows The data of the rows.
@return string | [
"Returns",
"the",
"inner",
"HTML",
"code",
"of",
"the",
"body",
"for",
"this",
"table",
"holding",
"the",
"rows",
"as",
"data",
"."
] | 1cdbd1c9e9ff972af3b2f7b622f9f2da8f301d9a | https://github.com/SetBased/php-abc-table-overview/blob/1cdbd1c9e9ff972af3b2f7b622f9f2da8f301d9a/src/OverviewTable.php#L201-L221 |
225,483 | SetBased/php-abc-table-overview | src/OverviewTable.php | OverviewTable.getHtmlHeader | protected function getHtmlHeader(): string
{
$ret = '';
if ($this->title)
{
$mode = 1;
$colspan = 0;
$ret .= '<tr class="title">';
foreach ($this->columns as $column)
{
$empty = $column->hasEmptyHeader();
if ($mode==1)
{
if ($empty)
... | php | protected function getHtmlHeader(): string
{
$ret = '';
if ($this->title)
{
$mode = 1;
$colspan = 0;
$ret .= '<tr class="title">';
foreach ($this->columns as $column)
{
$empty = $column->hasEmptyHeader();
if ($mode==1)
{
if ($empty)
... | [
"protected",
"function",
"getHtmlHeader",
"(",
")",
":",
"string",
"{",
"$",
"ret",
"=",
"''",
";",
"if",
"(",
"$",
"this",
"->",
"title",
")",
"{",
"$",
"mode",
"=",
"1",
";",
"$",
"colspan",
"=",
"0",
";",
"$",
"ret",
".=",
"'<tr class=\"title\">... | Returns the inner HTML code of the header for this table.
@return string | [
"Returns",
"the",
"inner",
"HTML",
"code",
"of",
"the",
"header",
"for",
"this",
"table",
"."
] | 1cdbd1c9e9ff972af3b2f7b622f9f2da8f301d9a | https://github.com/SetBased/php-abc-table-overview/blob/1cdbd1c9e9ff972af3b2f7b622f9f2da8f301d9a/src/OverviewTable.php#L229-L307 |
225,484 | SetBased/php-abc-table-overview | src/OverviewTable.php | OverviewTable.prepare | private function prepare(): void
{
$this->addClass(static::$class);
if (static::$responsiveMediaQuery!==null && $this->getAttribute('id')===null)
{
$this->setAttrId(Html::getAutoId());
}
} | php | private function prepare(): void
{
$this->addClass(static::$class);
if (static::$responsiveMediaQuery!==null && $this->getAttribute('id')===null)
{
$this->setAttrId(Html::getAutoId());
}
} | [
"private",
"function",
"prepare",
"(",
")",
":",
"void",
"{",
"$",
"this",
"->",
"addClass",
"(",
"static",
"::",
"$",
"class",
")",
";",
"if",
"(",
"static",
"::",
"$",
"responsiveMediaQuery",
"!==",
"null",
"&&",
"$",
"this",
"->",
"getAttribute",
"(... | Prepares this table for generation HTML code. | [
"Prepares",
"this",
"table",
"for",
"generation",
"HTML",
"code",
"."
] | 1cdbd1c9e9ff972af3b2f7b622f9f2da8f301d9a | https://github.com/SetBased/php-abc-table-overview/blob/1cdbd1c9e9ff972af3b2f7b622f9f2da8f301d9a/src/OverviewTable.php#L358-L366 |
225,485 | stubbles/stubbles-input | src/main/php/broker/param/CustomDatespanParamBroker.php | CustomDatespanParamBroker.getDate | private function getDate(Request $request, Annotation $annotation, $type)
{
$nameMethod = 'get' . $type . 'Name';
return $this->readValue(
$request,
$annotation->$nameMethod(),
$annotation->isRequired(),
... | php | private function getDate(Request $request, Annotation $annotation, $type)
{
$nameMethod = 'get' . $type . 'Name';
return $this->readValue(
$request,
$annotation->$nameMethod(),
$annotation->isRequired(),
... | [
"private",
"function",
"getDate",
"(",
"Request",
"$",
"request",
",",
"Annotation",
"$",
"annotation",
",",
"$",
"type",
")",
"{",
"$",
"nameMethod",
"=",
"'get'",
".",
"$",
"type",
".",
"'Name'",
";",
"return",
"$",
"this",
"->",
"readValue",
"(",
"$... | retrieves start date
@param \stubbles\input\Request $request
@param \stubbles\reflect\annotation\Annotation $annotation
@param string $type
@return \stubbles\date\Date | [
"retrieves",
"start",
"date"
] | 1ce0ebe5ba392faf3cc369a95e3fe0fa38912b1e | https://github.com/stubbles/stubbles-input/blob/1ce0ebe5ba392faf3cc369a95e3fe0fa38912b1e/src/main/php/broker/param/CustomDatespanParamBroker.php#L62-L76 |
225,486 | stubbles/stubbles-input | src/main/php/broker/param/CustomDatespanParamBroker.php | CustomDatespanParamBroker.parseDate | private function parseDate(Annotation $annotation, string $field)
{
if ($annotation->hasValueByName($field)) {
return new Date($annotation->getValueByName($field));
}
return null;
} | php | private function parseDate(Annotation $annotation, string $field)
{
if ($annotation->hasValueByName($field)) {
return new Date($annotation->getValueByName($field));
}
return null;
} | [
"private",
"function",
"parseDate",
"(",
"Annotation",
"$",
"annotation",
",",
"string",
"$",
"field",
")",
"{",
"if",
"(",
"$",
"annotation",
"->",
"hasValueByName",
"(",
"$",
"field",
")",
")",
"{",
"return",
"new",
"Date",
"(",
"$",
"annotation",
"->"... | reads default value from annotation
@param \stubbles\reflect\annotation\Annotation $annotation
@param string $field
@return \stubbles\date\Date | [
"reads",
"default",
"value",
"from",
"annotation"
] | 1ce0ebe5ba392faf3cc369a95e3fe0fa38912b1e | https://github.com/stubbles/stubbles-input/blob/1ce0ebe5ba392faf3cc369a95e3fe0fa38912b1e/src/main/php/broker/param/CustomDatespanParamBroker.php#L109-L116 |
225,487 | SetBased/php-abc-table-detail | src/DetailTable.php | DetailTable.getHtmlRowHeader | protected static function getHtmlRowHeader($header): string
{
$html = '<th>';
$html .= (is_int($header)) ? Abc::$babel->getWord($header) : $header;
$html .= '</th>';
return $html;
} | php | protected static function getHtmlRowHeader($header): string
{
$html = '<th>';
$html .= (is_int($header)) ? Abc::$babel->getWord($header) : $header;
$html .= '</th>';
return $html;
} | [
"protected",
"static",
"function",
"getHtmlRowHeader",
"(",
"$",
"header",
")",
":",
"string",
"{",
"$",
"html",
"=",
"'<th>'",
";",
"$",
"html",
".=",
"(",
"is_int",
"(",
"$",
"header",
")",
")",
"?",
"Abc",
"::",
"$",
"babel",
"->",
"getWord",
"(",... | Returns the HTML code for the header of the row.
@param string|int|null $header The header text of this table row. We distinguish 3 cases:
<ul>
<li>string: the value is the header text of this table row,
<li>int: the value is a word ID to be resolved to a text using Babel,
<li>null: this table row has an empty header.... | [
"Returns",
"the",
"HTML",
"code",
"for",
"the",
"header",
"of",
"the",
"row",
"."
] | 1f786174ccb10800f9c07bfd497b0ab35940a8ea | https://github.com/SetBased/php-abc-table-detail/blob/1f786174ccb10800f9c07bfd497b0ab35940a8ea/src/DetailTable.php#L44-L51 |
225,488 | SetBased/php-abc-table-detail | src/DetailTable.php | DetailTable.getHtmlTable | public function getHtmlTable(): string
{
$this->addClass(static::$class);
$ret = $this->getHtmlPrefix();
$ret .= Html::generateTag('table', $this->attributes);
$childAttributes = ['class' => static::$class];
// Generate HTML code for the table header.
$ret .= Html::generateTag('thead', $ch... | php | public function getHtmlTable(): string
{
$this->addClass(static::$class);
$ret = $this->getHtmlPrefix();
$ret .= Html::generateTag('table', $this->attributes);
$childAttributes = ['class' => static::$class];
// Generate HTML code for the table header.
$ret .= Html::generateTag('thead', $ch... | [
"public",
"function",
"getHtmlTable",
"(",
")",
":",
"string",
"{",
"$",
"this",
"->",
"addClass",
"(",
"static",
"::",
"$",
"class",
")",
";",
"$",
"ret",
"=",
"$",
"this",
"->",
"getHtmlPrefix",
"(",
")",
";",
"$",
"ret",
".=",
"Html",
"::",
"gen... | Returns the HTML code of this table.
@return string | [
"Returns",
"the",
"HTML",
"code",
"of",
"this",
"table",
"."
] | 1f786174ccb10800f9c07bfd497b0ab35940a8ea | https://github.com/SetBased/php-abc-table-detail/blob/1f786174ccb10800f9c07bfd497b0ab35940a8ea/src/DetailTable.php#L94-L124 |
225,489 | railken/amethyst-data-builder | src/Models/DataBuilder.php | DataBuilder.newInstanceQuery | public function newInstanceQuery(array $data, array $selectable = ['*']): Builder
{
$tm = new TextGenerator();
$r = $this->newInstanceData();
$query = $r->newQuery();
if (!empty($this->filter)) {
$filter = new Filter($r->getTableName(), $selectable);
$filter... | php | public function newInstanceQuery(array $data, array $selectable = ['*']): Builder
{
$tm = new TextGenerator();
$r = $this->newInstanceData();
$query = $r->newQuery();
if (!empty($this->filter)) {
$filter = new Filter($r->getTableName(), $selectable);
$filter... | [
"public",
"function",
"newInstanceQuery",
"(",
"array",
"$",
"data",
",",
"array",
"$",
"selectable",
"=",
"[",
"'*'",
"]",
")",
":",
"Builder",
"{",
"$",
"tm",
"=",
"new",
"TextGenerator",
"(",
")",
";",
"$",
"r",
"=",
"$",
"this",
"->",
"newInstanc... | New query instance.
@param array $data
@param array $selectable
@return \Illuminate\Database\Eloquent\Builder | [
"New",
"query",
"instance",
"."
] | 55334227b6b7f14cf755b02e7cd36a11db00f454 | https://github.com/railken/amethyst-data-builder/blob/55334227b6b7f14cf755b02e7cd36a11db00f454/src/Models/DataBuilder.php#L49-L64 |
225,490 | railken/amethyst-data-builder | src/Models/DataBuilder.php | DataBuilder.newInstanceData | public function newInstanceData()
{
$className = $this->class_name;
$arguments = (array) Yaml::parse(strval($this->class_arguments));
return new $className(...$arguments);
} | php | public function newInstanceData()
{
$className = $this->class_name;
$arguments = (array) Yaml::parse(strval($this->class_arguments));
return new $className(...$arguments);
} | [
"public",
"function",
"newInstanceData",
"(",
")",
"{",
"$",
"className",
"=",
"$",
"this",
"->",
"class_name",
";",
"$",
"arguments",
"=",
"(",
"array",
")",
"Yaml",
"::",
"parse",
"(",
"strval",
"(",
"$",
"this",
"->",
"class_arguments",
")",
")",
";... | New instance data builder custom.
@return \Railken\Amethyst\Contracts\DataBuilderContract | [
"New",
"instance",
"data",
"builder",
"custom",
"."
] | 55334227b6b7f14cf755b02e7cd36a11db00f454 | https://github.com/railken/amethyst-data-builder/blob/55334227b6b7f14cf755b02e7cd36a11db00f454/src/Models/DataBuilder.php#L122-L129 |
225,491 | aircury/collection | CollectionDiff.php | CollectionDiff.apply | public function apply(
ComparableCollectionInterface $sourceCollection,
bool $keepOriginalOrder = false
): ComparableCollectionInterface {
$collectionClass = get_class($sourceCollection);
$source = $sourceCollection->toArray();
$array = [];
foreach ($this->changes as... | php | public function apply(
ComparableCollectionInterface $sourceCollection,
bool $keepOriginalOrder = false
): ComparableCollectionInterface {
$collectionClass = get_class($sourceCollection);
$source = $sourceCollection->toArray();
$array = [];
foreach ($this->changes as... | [
"public",
"function",
"apply",
"(",
"ComparableCollectionInterface",
"$",
"sourceCollection",
",",
"bool",
"$",
"keepOriginalOrder",
"=",
"false",
")",
":",
"ComparableCollectionInterface",
"{",
"$",
"collectionClass",
"=",
"get_class",
"(",
"$",
"sourceCollection",
"... | Applies this Diff over the collection provided and returns a new one with it applied | [
"Applies",
"this",
"Diff",
"over",
"the",
"collection",
"provided",
"and",
"returns",
"a",
"new",
"one",
"with",
"it",
"applied"
] | 8b7ec30a5939733c435653724e3ba02c5eed730c | https://github.com/aircury/collection/blob/8b7ec30a5939733c435653724e3ba02c5eed730c/CollectionDiff.php#L135-L162 |
225,492 | froq/froq-service | src/ServiceFactory.php | ServiceFactory.toServiceMethod | public static final function toServiceMethod(string $serviceMethod): string
{
// foo-bar => FooBar
$serviceMethod = ucfirst($serviceMethod);
if (strpos($serviceMethod, '-')) {
$serviceMethod = preg_replace_callback('~-([a-z])~i', function($match) {
return ucfirst(... | php | public static final function toServiceMethod(string $serviceMethod): string
{
// foo-bar => FooBar
$serviceMethod = ucfirst($serviceMethod);
if (strpos($serviceMethod, '-')) {
$serviceMethod = preg_replace_callback('~-([a-z])~i', function($match) {
return ucfirst(... | [
"public",
"static",
"final",
"function",
"toServiceMethod",
"(",
"string",
"$",
"serviceMethod",
")",
":",
"string",
"{",
"// foo-bar => FooBar",
"$",
"serviceMethod",
"=",
"ucfirst",
"(",
"$",
"serviceMethod",
")",
";",
"if",
"(",
"strpos",
"(",
"$",
"service... | To service method.
@param string $serviceMethod
@return string | [
"To",
"service",
"method",
"."
] | c8fb2009100b27b6a0bd1ff8f8d81e102faadebc | https://github.com/froq/froq-service/blob/c8fb2009100b27b6a0bd1ff8f8d81e102faadebc/src/ServiceFactory.php#L252-L264 |
225,493 | froq/froq-service | src/ServiceFactory.php | ServiceFactory.isServiceExists | private static final function isServiceExists(string $serviceFile, string $serviceClass): bool
{
if (!file_exists($serviceFile)) {
return false;
}
return class_exists($serviceClass, true);
} | php | private static final function isServiceExists(string $serviceFile, string $serviceClass): bool
{
if (!file_exists($serviceFile)) {
return false;
}
return class_exists($serviceClass, true);
} | [
"private",
"static",
"final",
"function",
"isServiceExists",
"(",
"string",
"$",
"serviceFile",
",",
"string",
"$",
"serviceClass",
")",
":",
"bool",
"{",
"if",
"(",
"!",
"file_exists",
"(",
"$",
"serviceFile",
")",
")",
"{",
"return",
"false",
";",
"}",
... | Is service exists.
@param string $serviceFile
@param string $serviceClass
@return bool | [
"Is",
"service",
"exists",
"."
] | c8fb2009100b27b6a0bd1ff8f8d81e102faadebc | https://github.com/froq/froq-service/blob/c8fb2009100b27b6a0bd1ff8f8d81e102faadebc/src/ServiceFactory.php#L272-L279 |
225,494 | froq/froq-service | src/ServiceFactory.php | ServiceFactory.isServiceMethodExists | private static final function isServiceMethodExists(?Service $service, string $serviceMethod): bool
{
return $service && method_exists($service, $serviceMethod);
} | php | private static final function isServiceMethodExists(?Service $service, string $serviceMethod): bool
{
return $service && method_exists($service, $serviceMethod);
} | [
"private",
"static",
"final",
"function",
"isServiceMethodExists",
"(",
"?",
"Service",
"$",
"service",
",",
"string",
"$",
"serviceMethod",
")",
":",
"bool",
"{",
"return",
"$",
"service",
"&&",
"method_exists",
"(",
"$",
"service",
",",
"$",
"serviceMethod",... | Is service method exists.
@param froq\service\Service $service
@param string $serviceMethod
@return bool | [
"Is",
"service",
"method",
"exists",
"."
] | c8fb2009100b27b6a0bd1ff8f8d81e102faadebc | https://github.com/froq/froq-service/blob/c8fb2009100b27b6a0bd1ff8f8d81e102faadebc/src/ServiceFactory.php#L287-L290 |
225,495 | SetBased/php-abc-table-detail | src/TableRow/EmailTableRow.php | EmailTableRow.addRow | public static function addRow(DetailTable $table, $header, ?string $value): void
{
if ($value!==null && $value!=='')
{
$a = Html::generateElement('a', ['href' => 'mailto:'.$value], $value);
$table->addRow($header, ['class' => 'email'], $a, true);
}
else
{
$table->addRow($header)... | php | public static function addRow(DetailTable $table, $header, ?string $value): void
{
if ($value!==null && $value!=='')
{
$a = Html::generateElement('a', ['href' => 'mailto:'.$value], $value);
$table->addRow($header, ['class' => 'email'], $a, true);
}
else
{
$table->addRow($header)... | [
"public",
"static",
"function",
"addRow",
"(",
"DetailTable",
"$",
"table",
",",
"$",
"header",
",",
"?",
"string",
"$",
"value",
")",
":",
"void",
"{",
"if",
"(",
"$",
"value",
"!==",
"null",
"&&",
"$",
"value",
"!==",
"''",
")",
"{",
"$",
"a",
... | Adds a row with a email address 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 $value The email address. | [
"Adds",
"a",
"row",
"with",
"a",
"email",
"address",
"to",
"a",
"detail",
"table",
"."
] | 1f786174ccb10800f9c07bfd497b0ab35940a8ea | https://github.com/SetBased/php-abc-table-detail/blob/1f786174ccb10800f9c07bfd497b0ab35940a8ea/src/TableRow/EmailTableRow.php#L21-L33 |
225,496 | cmsgears/module-cms | common/components/Cms.php | Cms.registerPageMap | public function registerPageMap() {
$this->pageMap[ CmsGlobal::TYPE_PAGE ] = Page::class;
$this->pageMap[ CmsGlobal::TYPE_ARTICLE ] = Article::class;
$this->pageMap[ CmsGlobal::TYPE_POST ] = Post::class;
} | php | public function registerPageMap() {
$this->pageMap[ CmsGlobal::TYPE_PAGE ] = Page::class;
$this->pageMap[ CmsGlobal::TYPE_ARTICLE ] = Article::class;
$this->pageMap[ CmsGlobal::TYPE_POST ] = Post::class;
} | [
"public",
"function",
"registerPageMap",
"(",
")",
"{",
"$",
"this",
"->",
"pageMap",
"[",
"CmsGlobal",
"::",
"TYPE_PAGE",
"]",
"=",
"Page",
"::",
"class",
";",
"$",
"this",
"->",
"pageMap",
"[",
"CmsGlobal",
"::",
"TYPE_ARTICLE",
"]",
"=",
"Article",
":... | Register page map | [
"Register",
"page",
"map"
] | ee35eac3eb8dc9001b2e5dd7dade7f69d9546de8 | https://github.com/cmsgears/module-cms/blob/ee35eac3eb8dc9001b2e5dd7dade7f69d9546de8/common/components/Cms.php#L57-L62 |
225,497 | FlxPeters/sfDependencyInjectionPlugin | config/sfDependencyInjectionPluginConfiguration.class.php | sfDependencyInjectionPluginConfiguration.initializeServiceContainer | private function initializeServiceContainer()
{
$this->containerManager = new ServiceContainerManager($this->dispatcher, $this->getLogger());
$class = $this->getContainerClass();
$container = $this->containerManager->initializeServiceContainer($class);
$this->dispatcher->notify(new s... | php | private function initializeServiceContainer()
{
$this->containerManager = new ServiceContainerManager($this->dispatcher, $this->getLogger());
$class = $this->getContainerClass();
$container = $this->containerManager->initializeServiceContainer($class);
$this->dispatcher->notify(new s... | [
"private",
"function",
"initializeServiceContainer",
"(",
")",
"{",
"$",
"this",
"->",
"containerManager",
"=",
"new",
"ServiceContainerManager",
"(",
"$",
"this",
"->",
"dispatcher",
",",
"$",
"this",
"->",
"getLogger",
"(",
")",
")",
";",
"$",
"class",
"="... | Build a new Container or return a existing from cache | [
"Build",
"a",
"new",
"Container",
"or",
"return",
"a",
"existing",
"from",
"cache"
] | d8aced7015011b5d18d297460ccd82f39df6f709 | https://github.com/FlxPeters/sfDependencyInjectionPlugin/blob/d8aced7015011b5d18d297460ccd82f39df6f709/config/sfDependencyInjectionPluginConfiguration.class.php#L41-L48 |
225,498 | FlxPeters/sfDependencyInjectionPlugin | config/sfDependencyInjectionPluginConfiguration.class.php | sfDependencyInjectionPluginConfiguration.listenToMethodNotFound | public function listenToMethodNotFound($event)
{
if ('getServiceContainer' == $event['method']) {
$event->setReturnValue($this->containerManager->getServiceContainer());
return true;
}
if ('getContainerBuilder' == $event['method']) {
$event->setReturnValu... | php | public function listenToMethodNotFound($event)
{
if ('getServiceContainer' == $event['method']) {
$event->setReturnValue($this->containerManager->getServiceContainer());
return true;
}
if ('getContainerBuilder' == $event['method']) {
$event->setReturnValu... | [
"public",
"function",
"listenToMethodNotFound",
"(",
"$",
"event",
")",
"{",
"if",
"(",
"'getServiceContainer'",
"==",
"$",
"event",
"[",
"'method'",
"]",
")",
"{",
"$",
"event",
"->",
"setReturnValue",
"(",
"$",
"this",
"->",
"containerManager",
"->",
"getS... | Return the Container or a Service when calling a matching method
@param $event sfEvent
@return bool | [
"Return",
"the",
"Container",
"or",
"a",
"Service",
"when",
"calling",
"a",
"matching",
"method"
] | d8aced7015011b5d18d297460ccd82f39df6f709 | https://github.com/FlxPeters/sfDependencyInjectionPlugin/blob/d8aced7015011b5d18d297460ccd82f39df6f709/config/sfDependencyInjectionPluginConfiguration.class.php#L75-L93 |
225,499 | jeffreyguo/SS-Behat-quicksetup | src/SilverStripe/BehatExtension/Context/BasicContext.php | BasicContext.closeModalDialog | public function closeModalDialog(ScenarioEvent $event) {
try{
// Only for failed tests on CMS page
if (4 === $event->getResult()) {
$cmsElement = $this->getSession()->getPage()->find('css', '.cms');
if($cmsElement) {
try {
// Navigate away triggered by reloading the page
$this->getSessi... | php | public function closeModalDialog(ScenarioEvent $event) {
try{
// Only for failed tests on CMS page
if (4 === $event->getResult()) {
$cmsElement = $this->getSession()->getPage()->find('css', '.cms');
if($cmsElement) {
try {
// Navigate away triggered by reloading the page
$this->getSessi... | [
"public",
"function",
"closeModalDialog",
"(",
"ScenarioEvent",
"$",
"event",
")",
"{",
"try",
"{",
"// Only for failed tests on CMS page",
"if",
"(",
"4",
"===",
"$",
"event",
"->",
"getResult",
"(",
")",
")",
"{",
"$",
"cmsElement",
"=",
"$",
"this",
"->",... | Close modal dialog if test scenario fails on CMS page
@AfterScenario | [
"Close",
"modal",
"dialog",
"if",
"test",
"scenario",
"fails",
"on",
"CMS",
"page"
] | a5172f3a94dc2b364df5c2758a8a1df4f026168e | https://github.com/jeffreyguo/SS-Behat-quicksetup/blob/a5172f3a94dc2b364df5c2758a8a1df4f026168e/src/SilverStripe/BehatExtension/Context/BasicContext.php#L244-L262 |
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.