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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
6,100 | indigophp-archive/codeception-fuel-module | fuel/fuel/core/classes/upload.php | Upload.get_errors | public static function get_errors($index = null)
{
// convert element name formats
is_string($index) and $index = str_replace(':', '.', $index);
$files = static::$upload->getInvalidFiles($index);
// convert the file object to 1.x compatible data
$result = array();
foreach ($files as $file)
{
$data ... | php | public static function get_errors($index = null)
{
// convert element name formats
is_string($index) and $index = str_replace(':', '.', $index);
$files = static::$upload->getInvalidFiles($index);
// convert the file object to 1.x compatible data
$result = array();
foreach ($files as $file)
{
$data ... | [
"public",
"static",
"function",
"get_errors",
"(",
"$",
"index",
"=",
"null",
")",
"{",
"// convert element name formats",
"is_string",
"(",
"$",
"index",
")",
"and",
"$",
"index",
"=",
"str_replace",
"(",
"':'",
",",
"'.'",
",",
"$",
"index",
")",
";",
... | Get the list of non-validated files
@return array list of uploaded files that failed to validate | [
"Get",
"the",
"list",
"of",
"non",
"-",
"validated",
"files"
] | 0973b7cbd540a0e89cc5bb7af94627f77f09bf49 | https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/core/classes/upload.php#L224-L265 |
6,101 | indigophp-archive/codeception-fuel-module | fuel/fuel/core/classes/upload.php | Upload.process | public static function process($config = array())
{
foreach (static::$upload->getAllFiles() as $file)
{
$file->setConfig($config);
$file->validate();
}
} | php | public static function process($config = array())
{
foreach (static::$upload->getAllFiles() as $file)
{
$file->setConfig($config);
$file->validate();
}
} | [
"public",
"static",
"function",
"process",
"(",
"$",
"config",
"=",
"array",
"(",
")",
")",
"{",
"foreach",
"(",
"static",
"::",
"$",
"upload",
"->",
"getAllFiles",
"(",
")",
"as",
"$",
"file",
")",
"{",
"$",
"file",
"->",
"setConfig",
"(",
"$",
"c... | Process the uploaded files, and run the validation
@return void | [
"Process",
"the",
"uploaded",
"files",
"and",
"run",
"the",
"validation"
] | 0973b7cbd540a0e89cc5bb7af94627f77f09bf49 | https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/core/classes/upload.php#L294-L301 |
6,102 | indigophp-archive/codeception-fuel-module | fuel/fuel/core/classes/upload.php | Upload.with_ftp | public static function with_ftp($config = 'default', $connect = true)
{
if (static::$with_ftp = \Ftp::forge($config, $connect))
{
// if we have an ftp object, activate the move callback
static::$upload->setConfig('moveCallback', '\\Upload\\move_callback');
}
else
{
// creating the ftp object failed,... | php | public static function with_ftp($config = 'default', $connect = true)
{
if (static::$with_ftp = \Ftp::forge($config, $connect))
{
// if we have an ftp object, activate the move callback
static::$upload->setConfig('moveCallback', '\\Upload\\move_callback');
}
else
{
// creating the ftp object failed,... | [
"public",
"static",
"function",
"with_ftp",
"(",
"$",
"config",
"=",
"'default'",
",",
"$",
"connect",
"=",
"true",
")",
"{",
"if",
"(",
"static",
"::",
"$",
"with_ftp",
"=",
"\\",
"Ftp",
"::",
"forge",
"(",
"$",
"config",
",",
"$",
"connect",
")",
... | Upload files with FTP
@param string|array The name of the config group to use, or a configuration array.
@param bool Automatically connect to this server. | [
"Upload",
"files",
"with",
"FTP"
] | 0973b7cbd540a0e89cc5bb7af94627f77f09bf49 | https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/core/classes/upload.php#L311-L323 |
6,103 | simplecomplex/inspect | src/Inspect.php | Inspect.loadDependencies | protected function loadDependencies() /*: void*/
{
if (!$this->validate) {
$this->validate = Validate::getInstance();
if (!$this->config) {
// Use enviroment variable wrapper config class if exists;
// fall back on empty sectioned map.
... | php | protected function loadDependencies() /*: void*/
{
if (!$this->validate) {
$this->validate = Validate::getInstance();
if (!$this->config) {
// Use enviroment variable wrapper config class if exists;
// fall back on empty sectioned map.
... | [
"protected",
"function",
"loadDependencies",
"(",
")",
"/*: void*/",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"validate",
")",
"{",
"$",
"this",
"->",
"validate",
"=",
"Validate",
"::",
"getInstance",
"(",
")",
";",
"if",
"(",
"!",
"$",
"this",
"->",
... | Load dependencies on demand.
@see \SimpleComplex\Config\EnvSectionedConfig
@return void | [
"Load",
"dependencies",
"on",
"demand",
"."
] | ced7655460d1ae006d5c282be3d93311c75e67a4 | https://github.com/simplecomplex/inspect/blob/ced7655460d1ae006d5c282be3d93311c75e67a4/src/Inspect.php#L195-L220 |
6,104 | simplecomplex/inspect | src/Inspect.php | Inspect.variable | public function variable($subject, $options = []) : Inspector
{
// Init.----------------------------------------------------------------
$this->loadDependencies();
// Business.------------------------------------------------------------
$options['kind'] = 'variable';
$class... | php | public function variable($subject, $options = []) : Inspector
{
// Init.----------------------------------------------------------------
$this->loadDependencies();
// Business.------------------------------------------------------------
$options['kind'] = 'variable';
$class... | [
"public",
"function",
"variable",
"(",
"$",
"subject",
",",
"$",
"options",
"=",
"[",
"]",
")",
":",
"Inspector",
"{",
"// Init.----------------------------------------------------------------",
"$",
"this",
"->",
"loadDependencies",
"(",
")",
";",
"// Business.------... | Force variable inspection, even if subject is a throwable.
@see Inspector::$options
@param mixed $subject
@param array|int|string $options
@return Inspector
Stringable. | [
"Force",
"variable",
"inspection",
"even",
"if",
"subject",
"is",
"a",
"throwable",
"."
] | ced7655460d1ae006d5c282be3d93311c75e67a4 | https://github.com/simplecomplex/inspect/blob/ced7655460d1ae006d5c282be3d93311c75e67a4/src/Inspect.php#L268-L283 |
6,105 | dashifen/response | src/AbstractResponse.php | AbstractResponse.setContent | public function setContent(string $content): void {
// there's two options here: that the concatenation of $this->root_path
// and $content is a file and we pass that to our view or that it isn't
// and we pass the $content argument to the view directly assuming that
// it's a string of content.
$temp ... | php | public function setContent(string $content): void {
// there's two options here: that the concatenation of $this->root_path
// and $content is a file and we pass that to our view or that it isn't
// and we pass the $content argument to the view directly assuming that
// it's a string of content.
$temp ... | [
"public",
"function",
"setContent",
"(",
"string",
"$",
"content",
")",
":",
"void",
"{",
"// there's two options here: that the concatenation of $this->root_path",
"// and $content is a file and we pass that to our view or that it isn't",
"// and we pass the $content argument to the view... | passes content to our view
@param string $content
@return void | [
"passes",
"content",
"to",
"our",
"view"
] | 1ddf55cda480fd22130e4a8ff7000b445b21ee11 | https://github.com/dashifen/response/blob/1ddf55cda480fd22130e4a8ff7000b445b21ee11/src/AbstractResponse.php#L322-L331 |
6,106 | dashifen/response | src/AbstractResponse.php | AbstractResponse.redirect | public function redirect(string $url): void {
if (!filter_var($url, FILTER_VALIDATE_URL)) {
throw new ResponseException("Invalid URL: $url", ResponseException::INVALID_URL);
}
$this->setType("redirect");
$this->data["url"] = $url;
} | php | public function redirect(string $url): void {
if (!filter_var($url, FILTER_VALIDATE_URL)) {
throw new ResponseException("Invalid URL: $url", ResponseException::INVALID_URL);
}
$this->setType("redirect");
$this->data["url"] = $url;
} | [
"public",
"function",
"redirect",
"(",
"string",
"$",
"url",
")",
":",
"void",
"{",
"if",
"(",
"!",
"filter_var",
"(",
"$",
"url",
",",
"FILTER_VALIDATE_URL",
")",
")",
"{",
"throw",
"new",
"ResponseException",
"(",
"\"Invalid URL: $url\"",
",",
"ResponseExc... | sets the appropriate type and data for a redirection
@param string $url
@throws ResponseException | [
"sets",
"the",
"appropriate",
"type",
"and",
"data",
"for",
"a",
"redirection"
] | 1ddf55cda480fd22130e4a8ff7000b445b21ee11 | https://github.com/dashifen/response/blob/1ddf55cda480fd22130e4a8ff7000b445b21ee11/src/AbstractResponse.php#L340-L347 |
6,107 | oal/babble | src/Path.php | Path.bindRoute | public function bindRoute(string $templateDir)
{
$this->routeBindings = [];
if (strlen($templateDir) === 0) return;
// $dirsOrVars contains directories or variables like this: ['blog', '$year', '$month', '$day'].
$dirsOrVars = explode('/', trim($templateDir, '/'));
// $varV... | php | public function bindRoute(string $templateDir)
{
$this->routeBindings = [];
if (strlen($templateDir) === 0) return;
// $dirsOrVars contains directories or variables like this: ['blog', '$year', '$month', '$day'].
$dirsOrVars = explode('/', trim($templateDir, '/'));
// $varV... | [
"public",
"function",
"bindRoute",
"(",
"string",
"$",
"templateDir",
")",
"{",
"$",
"this",
"->",
"routeBindings",
"=",
"[",
"]",
";",
"if",
"(",
"strlen",
"(",
"$",
"templateDir",
")",
"===",
"0",
")",
"return",
";",
"// $dirsOrVars contains directories or... | Takes in a template directory and matches variables with values in the path.
Should not be called outside Babble core!
@param string $templateDir | [
"Takes",
"in",
"a",
"template",
"directory",
"and",
"matches",
"variables",
"with",
"values",
"in",
"the",
"path",
".",
"Should",
"not",
"be",
"called",
"outside",
"Babble",
"core!"
] | 5a352d12ead6341294747831b0dfce097a0215e7 | https://github.com/oal/babble/blob/5a352d12ead6341294747831b0dfce097a0215e7/src/Path.php#L83-L109 |
6,108 | dpeuscher/DpZFExtensions | src/DpZFExtensions/ServiceManager/ServiceLocatorDecorator.php | ServiceLocatorDecorator.get | public function get($name, $usePeeringServiceManagers = true) {
try {
return parent::get($name,$usePeeringServiceManagers);
} catch (ServiceNotFoundException $e) {
if (isset($this->_decoree))
return $this->getDecoree()->get($name,$usePeeringServiceManagers);
else
throw $e;
}
} | php | public function get($name, $usePeeringServiceManagers = true) {
try {
return parent::get($name,$usePeeringServiceManagers);
} catch (ServiceNotFoundException $e) {
if (isset($this->_decoree))
return $this->getDecoree()->get($name,$usePeeringServiceManagers);
else
throw $e;
}
} | [
"public",
"function",
"get",
"(",
"$",
"name",
",",
"$",
"usePeeringServiceManagers",
"=",
"true",
")",
"{",
"try",
"{",
"return",
"parent",
"::",
"get",
"(",
"$",
"name",
",",
"$",
"usePeeringServiceManagers",
")",
";",
"}",
"catch",
"(",
"ServiceNotFound... | Retrieve a registered instance
@param string $name
@param bool $usePeeringServiceManagers
@throws \Exception|\Zend\ServiceManager\Exception\ServiceNotFoundException
@return object|array | [
"Retrieve",
"a",
"registered",
"instance"
] | e0194daca449601a58f5b2fc019dbdbd1a1b1b89 | https://github.com/dpeuscher/DpZFExtensions/blob/e0194daca449601a58f5b2fc019dbdbd1a1b1b89/src/DpZFExtensions/ServiceManager/ServiceLocatorDecorator.php#L38-L47 |
6,109 | webriq/core | module/Core/src/Grid/Core/Controller/RpcController.php | RpcController.rawData | protected static function rawData( $object )
{
if ( is_object( $object ) )
{
$hash = spl_object_hash( $object );
if ( isset( self::$rawCheck[$hash] ) )
{
return array( '#recursion#' => $hash );
}
self::$rawCheck[$hash] = t... | php | protected static function rawData( $object )
{
if ( is_object( $object ) )
{
$hash = spl_object_hash( $object );
if ( isset( self::$rawCheck[$hash] ) )
{
return array( '#recursion#' => $hash );
}
self::$rawCheck[$hash] = t... | [
"protected",
"static",
"function",
"rawData",
"(",
"$",
"object",
")",
"{",
"if",
"(",
"is_object",
"(",
"$",
"object",
")",
")",
"{",
"$",
"hash",
"=",
"spl_object_hash",
"(",
"$",
"object",
")",
";",
"if",
"(",
"isset",
"(",
"self",
"::",
"$",
"r... | Convert data to raw object
@param array|object $object
@return object | [
"Convert",
"data",
"to",
"raw",
"object"
] | cfeb6e8a4732561c2215ec94e736c07f9b8bc990 | https://github.com/webriq/core/blob/cfeb6e8a4732561c2215ec94e736c07f9b8bc990/module/Core/src/Grid/Core/Controller/RpcController.php#L37-L62 |
6,110 | webriq/core | module/Core/src/Grid/Core/Controller/RpcController.php | RpcController.logException | public function logException( Exception $exception,
$priority = Logger::CRIT )
{
/* @var $logger \Zork\Log\LoggerManager */
$logger = $this->getServiceLocator()
->get( 'Zork\Log\LoggerManager' );
if ( $logger->hasLogger( 'exception' )... | php | public function logException( Exception $exception,
$priority = Logger::CRIT )
{
/* @var $logger \Zork\Log\LoggerManager */
$logger = $this->getServiceLocator()
->get( 'Zork\Log\LoggerManager' );
if ( $logger->hasLogger( 'exception' )... | [
"public",
"function",
"logException",
"(",
"Exception",
"$",
"exception",
",",
"$",
"priority",
"=",
"Logger",
"::",
"CRIT",
")",
"{",
"/* @var $logger \\Zork\\Log\\LoggerManager */",
"$",
"logger",
"=",
"$",
"this",
"->",
"getServiceLocator",
"(",
")",
"->",
"g... | Log a single exception
@param \Exception $exception
@param int $priority | [
"Log",
"a",
"single",
"exception"
] | cfeb6e8a4732561c2215ec94e736c07f9b8bc990 | https://github.com/webriq/core/blob/cfeb6e8a4732561c2215ec94e736c07f9b8bc990/module/Core/src/Grid/Core/Controller/RpcController.php#L86-L99 |
6,111 | dcsg/MailchimpApiConnector | lib/MailchimpApiConnector/MailchimpApi.php | MailchimpApi.getUrlToOldApi | private function getUrlToOldApi($method, array $params, $format)
{
$queryString = sprintf(
'?apikey=%s&format=%s&method=%s%s',
$this->getApiKey(),
$format,
$method,
$this->paramsQueryStringBuilder($params)
);
return sprintf(
... | php | private function getUrlToOldApi($method, array $params, $format)
{
$queryString = sprintf(
'?apikey=%s&format=%s&method=%s%s',
$this->getApiKey(),
$format,
$method,
$this->paramsQueryStringBuilder($params)
);
return sprintf(
... | [
"private",
"function",
"getUrlToOldApi",
"(",
"$",
"method",
",",
"array",
"$",
"params",
",",
"$",
"format",
")",
"{",
"$",
"queryString",
"=",
"sprintf",
"(",
"'?apikey=%s&format=%s&method=%s%s'",
",",
"$",
"this",
"->",
"getApiKey",
"(",
")",
",",
"$",
... | Gets the url for Mailchimp API version < 2.0
@param string $method
@param array $params
@param string $format
@return string | [
"Gets",
"the",
"url",
"for",
"Mailchimp",
"API",
"version",
"<",
"2",
".",
"0"
] | 417fe30899ae71d5cedbb401c34ede6012c13979 | https://github.com/dcsg/MailchimpApiConnector/blob/417fe30899ae71d5cedbb401c34ede6012c13979/lib/MailchimpApiConnector/MailchimpApi.php#L64-L80 |
6,112 | dcsg/MailchimpApiConnector | lib/MailchimpApiConnector/MailchimpApi.php | MailchimpApi.getUrl | private function getUrl($method)
{
return sprintf(
$this::API_URL,
$this->getDc(),
$this->getApiVersion(),
$method
);
} | php | private function getUrl($method)
{
return sprintf(
$this::API_URL,
$this->getDc(),
$this->getApiVersion(),
$method
);
} | [
"private",
"function",
"getUrl",
"(",
"$",
"method",
")",
"{",
"return",
"sprintf",
"(",
"$",
"this",
"::",
"API_URL",
",",
"$",
"this",
"->",
"getDc",
"(",
")",
",",
"$",
"this",
"->",
"getApiVersion",
"(",
")",
",",
"$",
"method",
")",
";",
"}"
] | Gets the url for Mailchimp API version >= 2.0
@param string $method
@return string | [
"Gets",
"the",
"url",
"for",
"Mailchimp",
"API",
"version",
">",
"=",
"2",
".",
"0"
] | 417fe30899ae71d5cedbb401c34ede6012c13979 | https://github.com/dcsg/MailchimpApiConnector/blob/417fe30899ae71d5cedbb401c34ede6012c13979/lib/MailchimpApiConnector/MailchimpApi.php#L97-L105 |
6,113 | setrun/setrun-component-user | src/commands/UserAbstractController.php | UserAbstractController.readValue | protected function readValue(User $user, string $attribute) : void
{
$user->$attribute = $this->prompt(mb_convert_case($attribute, MB_CASE_TITLE, 'utf-8') . ':', [
'validator' => function ($input, &$error) use ($user, $attribute) {
$user->$attribute = $input;
if (... | php | protected function readValue(User $user, string $attribute) : void
{
$user->$attribute = $this->prompt(mb_convert_case($attribute, MB_CASE_TITLE, 'utf-8') . ':', [
'validator' => function ($input, &$error) use ($user, $attribute) {
$user->$attribute = $input;
if (... | [
"protected",
"function",
"readValue",
"(",
"User",
"$",
"user",
",",
"string",
"$",
"attribute",
")",
":",
"void",
"{",
"$",
"user",
"->",
"$",
"attribute",
"=",
"$",
"this",
"->",
"prompt",
"(",
"mb_convert_case",
"(",
"$",
"attribute",
",",
"MB_CASE_TI... | Get the value of the console.
@param User $user
@param string $attribute
@return void | [
"Get",
"the",
"value",
"of",
"the",
"console",
"."
] | 6aca4c62f099918032b66da1f94d7565694a0735 | https://github.com/setrun/setrun-component-user/blob/6aca4c62f099918032b66da1f94d7565694a0735/src/commands/UserAbstractController.php#L56-L69 |
6,114 | setrun/setrun-component-user | src/commands/UserAbstractController.php | UserAbstractController.log | protected function log(bool $success) : void
{
if ($success) {
$this->stdout('Success!', Console::FG_GREEN, Console::BOLD);
} else {
$this->stderr('Error!', Console::FG_RED, Console::BOLD);
}
$this->stdout(PHP_EOL);
} | php | protected function log(bool $success) : void
{
if ($success) {
$this->stdout('Success!', Console::FG_GREEN, Console::BOLD);
} else {
$this->stderr('Error!', Console::FG_RED, Console::BOLD);
}
$this->stdout(PHP_EOL);
} | [
"protected",
"function",
"log",
"(",
"bool",
"$",
"success",
")",
":",
"void",
"{",
"if",
"(",
"$",
"success",
")",
"{",
"$",
"this",
"->",
"stdout",
"(",
"'Success!'",
",",
"Console",
"::",
"FG_GREEN",
",",
"Console",
"::",
"BOLD",
")",
";",
"}",
... | Console log.
@param bool $success
@return void | [
"Console",
"log",
"."
] | 6aca4c62f099918032b66da1f94d7565694a0735 | https://github.com/setrun/setrun-component-user/blob/6aca4c62f099918032b66da1f94d7565694a0735/src/commands/UserAbstractController.php#L76-L84 |
6,115 | yujin1st/yii2-user | controllers/RecoveryController.php | RecoveryController.actionRequest | public function actionRequest() {
if (!$this->module->enablePasswordRecovery) {
throw new NotFoundHttpException();
}
/** @var RecoveryForm $model */
$model = Yii::createObject([
'class' => RecoveryForm::className(),
'scenario' => 'request',
]);
$event = $this->getFormEvent($mo... | php | public function actionRequest() {
if (!$this->module->enablePasswordRecovery) {
throw new NotFoundHttpException();
}
/** @var RecoveryForm $model */
$model = Yii::createObject([
'class' => RecoveryForm::className(),
'scenario' => 'request',
]);
$event = $this->getFormEvent($mo... | [
"public",
"function",
"actionRequest",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"module",
"->",
"enablePasswordRecovery",
")",
"{",
"throw",
"new",
"NotFoundHttpException",
"(",
")",
";",
"}",
"/** @var RecoveryForm $model */",
"$",
"model",
"=",
"Yii... | Shows page where user can request password recovery.
@return string
@throws \yii\web\NotFoundHttpException | [
"Shows",
"page",
"where",
"user",
"can",
"request",
"password",
"recovery",
"."
] | b404c77acf4a96f0cdf9bb0af5c8d62bcae3946f | https://github.com/yujin1st/yii2-user/blob/b404c77acf4a96f0cdf9bb0af5c8d62bcae3946f/controllers/RecoveryController.php#L90-L116 |
6,116 | yujin1st/yii2-user | controllers/RecoveryController.php | RecoveryController.actionReset | public function actionReset($id, $code) {
if (!$this->module->enablePasswordRecovery) {
throw new NotFoundHttpException();
}
/** @var Token $token */
$token = Token::find()->where(['userId' => $id, 'code' => $code, 'type' => Token::TYPE_RECOVERY])->one();
$event = $this->getResetPasswordEvent... | php | public function actionReset($id, $code) {
if (!$this->module->enablePasswordRecovery) {
throw new NotFoundHttpException();
}
/** @var Token $token */
$token = Token::find()->where(['userId' => $id, 'code' => $code, 'type' => Token::TYPE_RECOVERY])->one();
$event = $this->getResetPasswordEvent... | [
"public",
"function",
"actionReset",
"(",
"$",
"id",
",",
"$",
"code",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"module",
"->",
"enablePasswordRecovery",
")",
"{",
"throw",
"new",
"NotFoundHttpException",
"(",
")",
";",
"}",
"/** @var Token $token */",
... | Displays page where user can reset password.
@param int $id
@param string $code
@return string
@throws \yii\web\NotFoundHttpException | [
"Displays",
"page",
"where",
"user",
"can",
"reset",
"password",
"."
] | b404c77acf4a96f0cdf9bb0af5c8d62bcae3946f | https://github.com/yujin1st/yii2-user/blob/b404c77acf4a96f0cdf9bb0af5c8d62bcae3946f/controllers/RecoveryController.php#L127-L168 |
6,117 | ongr-archive/ContentBundle | Document/AbstractCategoryDocument.php | AbstractCategoryDocument.hasVisibleChildren | public function hasVisibleChildren()
{
if (is_array($this->children) && count($this->children)) {
foreach ($this->children as $child) {
if (!$child->isHidden()) {
return true;
}
}
}
return false;
} | php | public function hasVisibleChildren()
{
if (is_array($this->children) && count($this->children)) {
foreach ($this->children as $child) {
if (!$child->isHidden()) {
return true;
}
}
}
return false;
} | [
"public",
"function",
"hasVisibleChildren",
"(",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"this",
"->",
"children",
")",
"&&",
"count",
"(",
"$",
"this",
"->",
"children",
")",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"children",
"as",
"$",
"ch... | Tests if category has any visible children.
@return bool | [
"Tests",
"if",
"category",
"has",
"any",
"visible",
"children",
"."
] | 453a02c0c89c16f66dc9caed000243534dbeffa5 | https://github.com/ongr-archive/ContentBundle/blob/453a02c0c89c16f66dc9caed000243534dbeffa5/Document/AbstractCategoryDocument.php#L118-L129 |
6,118 | Eresus/EForms | src/eforms/classes/Form.php | EForms_Form.processActions | public function processActions()
{
$Eresus = Eresus_CMS::getLegacyKernel();
$this->parse();
$actionsElement = $this->xml->getElementsByTagNameNS(self::NS, 'actions');
if ($actionsElement)
{
$actions = $actionsElement->item(0)->childNodes;
for ($i = 0... | php | public function processActions()
{
$Eresus = Eresus_CMS::getLegacyKernel();
$this->parse();
$actionsElement = $this->xml->getElementsByTagNameNS(self::NS, 'actions');
if ($actionsElement)
{
$actions = $actionsElement->item(0)->childNodes;
for ($i = 0... | [
"public",
"function",
"processActions",
"(",
")",
"{",
"$",
"Eresus",
"=",
"Eresus_CMS",
"::",
"getLegacyKernel",
"(",
")",
";",
"$",
"this",
"->",
"parse",
"(",
")",
";",
"$",
"actionsElement",
"=",
"$",
"this",
"->",
"xml",
"->",
"getElementsByTagNameNS"... | Process form actions | [
"Process",
"form",
"actions"
] | cdbea1c4215864b739ff8c988b5de1672079389b | https://github.com/Eresus/EForms/blob/cdbea1c4215864b739ff8c988b5de1672079389b/src/eforms/classes/Form.php#L194-L228 |
6,119 | Eresus/EForms | src/eforms/classes/Form.php | EForms_Form.setActionAttribute | protected function setActionAttribute()
{
$Eresus = Eresus_CMS::getLegacyKernel();
/** @var DOMElement $form */
$form = $this->xml->getElementsByTagName('form')->item(0);
$url = $Eresus->request['path'];
/*
* Если есть тег marker и нет тега redirect, то маркер надо... | php | protected function setActionAttribute()
{
$Eresus = Eresus_CMS::getLegacyKernel();
/** @var DOMElement $form */
$form = $this->xml->getElementsByTagName('form')->item(0);
$url = $Eresus->request['path'];
/*
* Если есть тег marker и нет тега redirect, то маркер надо... | [
"protected",
"function",
"setActionAttribute",
"(",
")",
"{",
"$",
"Eresus",
"=",
"Eresus_CMS",
"::",
"getLegacyKernel",
"(",
")",
";",
"/** @var DOMElement $form */",
"$",
"form",
"=",
"$",
"this",
"->",
"xml",
"->",
"getElementsByTagName",
"(",
"'form'",
")",
... | Set form's action attribute | [
"Set",
"form",
"s",
"action",
"attribute"
] | cdbea1c4215864b739ff8c988b5de1672079389b | https://github.com/Eresus/EForms/blob/cdbea1c4215864b739ff8c988b5de1672079389b/src/eforms/classes/Form.php#L266-L289 |
6,120 | Eresus/EForms | src/eforms/classes/Form.php | EForms_Form.setActionTags | protected function setActionTags()
{
$form = $this->xml->getElementsByTagName('form')->item(0);
$div = $this->xml->createElement('div');
$input = $this->xml->createElement('input');
$input->setAttribute('type', 'hidden');
$input->setAttribute('name', 'ext');
$input->... | php | protected function setActionTags()
{
$form = $this->xml->getElementsByTagName('form')->item(0);
$div = $this->xml->createElement('div');
$input = $this->xml->createElement('input');
$input->setAttribute('type', 'hidden');
$input->setAttribute('name', 'ext');
$input->... | [
"protected",
"function",
"setActionTags",
"(",
")",
"{",
"$",
"form",
"=",
"$",
"this",
"->",
"xml",
"->",
"getElementsByTagName",
"(",
"'form'",
")",
"->",
"item",
"(",
"0",
")",
";",
"$",
"div",
"=",
"$",
"this",
"->",
"xml",
"->",
"createElement",
... | Adds hidden inputs to form | [
"Adds",
"hidden",
"inputs",
"to",
"form"
] | cdbea1c4215864b739ff8c988b5de1672079389b | https://github.com/Eresus/EForms/blob/cdbea1c4215864b739ff8c988b5de1672079389b/src/eforms/classes/Form.php#L295-L313 |
6,121 | Eresus/EForms | src/eforms/classes/Form.php | EForms_Form.getFormData | protected function getFormData()
{
$data = array();
$inputTagNames = array('input', 'textarea', 'select');
$skipNames = array('ext', 'form');
/** @var DOMElement $element */
$element = $this->xml->getElementsByTagName('form')->item(0);
$elements = $element->getElemen... | php | protected function getFormData()
{
$data = array();
$inputTagNames = array('input', 'textarea', 'select');
$skipNames = array('ext', 'form');
/** @var DOMElement $element */
$element = $this->xml->getElementsByTagName('form')->item(0);
$elements = $element->getElemen... | [
"protected",
"function",
"getFormData",
"(",
")",
"{",
"$",
"data",
"=",
"array",
"(",
")",
";",
"$",
"inputTagNames",
"=",
"array",
"(",
"'input'",
",",
"'textarea'",
",",
"'select'",
")",
";",
"$",
"skipNames",
"=",
"array",
"(",
"'ext'",
",",
"'form... | Return posted form data
@return array | [
"Return",
"posted",
"form",
"data"
] | cdbea1c4215864b739ff8c988b5de1672079389b | https://github.com/Eresus/EForms/blob/cdbea1c4215864b739ff8c988b5de1672079389b/src/eforms/classes/Form.php#L332-L388 |
6,122 | Eresus/EForms | src/eforms/classes/Form.php | EForms_Form.processAction | protected function processAction(DOMNode $action)
{
$actionName = substr($action->nodeName, strlen($action->lookupPrefix(self::NS)) + 1);
$methodName = 'action' . $actionName;
if (method_exists($this, $methodName))
{
$this->$methodName($action);
}
} | php | protected function processAction(DOMNode $action)
{
$actionName = substr($action->nodeName, strlen($action->lookupPrefix(self::NS)) + 1);
$methodName = 'action' . $actionName;
if (method_exists($this, $methodName))
{
$this->$methodName($action);
}
} | [
"protected",
"function",
"processAction",
"(",
"DOMNode",
"$",
"action",
")",
"{",
"$",
"actionName",
"=",
"substr",
"(",
"$",
"action",
"->",
"nodeName",
",",
"strlen",
"(",
"$",
"action",
"->",
"lookupPrefix",
"(",
"self",
"::",
"NS",
")",
")",
"+",
... | Process action directive
@param DOMNode $action | [
"Process",
"action",
"directive"
] | cdbea1c4215864b739ff8c988b5de1672079389b | https://github.com/Eresus/EForms/blob/cdbea1c4215864b739ff8c988b5de1672079389b/src/eforms/classes/Form.php#L395-L403 |
6,123 | Eresus/EForms | src/eforms/classes/Form.php | EForms_Form.actionRedirect | protected function actionRedirect($action)
{
if ($this->redirect)
{
return;
}
$this->redirect = $action->getAttribute('uri');
/** @var TAdminUI $page */
$page = Eresus_Kernel::app()->getPage();
$this->redirect = $page->replaceMacros($this->redirec... | php | protected function actionRedirect($action)
{
if ($this->redirect)
{
return;
}
$this->redirect = $action->getAttribute('uri');
/** @var TAdminUI $page */
$page = Eresus_Kernel::app()->getPage();
$this->redirect = $page->replaceMacros($this->redirec... | [
"protected",
"function",
"actionRedirect",
"(",
"$",
"action",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"redirect",
")",
"{",
"return",
";",
"}",
"$",
"this",
"->",
"redirect",
"=",
"$",
"action",
"->",
"getAttribute",
"(",
"'uri'",
")",
";",
"/** @var ... | Process 'redirect' action
@param DOMElement $action | [
"Process",
"redirect",
"action"
] | cdbea1c4215864b739ff8c988b5de1672079389b | https://github.com/Eresus/EForms/blob/cdbea1c4215864b739ff8c988b5de1672079389b/src/eforms/classes/Form.php#L463-L474 |
6,124 | Eresus/EForms | src/eforms/classes/Form.php | EForms_Form.actionHtml | protected function actionHtml($action)
{
$elements = $action->childNodes;
if ($elements->length)
{
$html = '';
for ($i = 0; $i < $elements->length; $i++)
{
$html .= $this->xml->saveXML($elements->item($i));
}
$this-... | php | protected function actionHtml($action)
{
$elements = $action->childNodes;
if ($elements->length)
{
$html = '';
for ($i = 0; $i < $elements->length; $i++)
{
$html .= $this->xml->saveXML($elements->item($i));
}
$this-... | [
"protected",
"function",
"actionHtml",
"(",
"$",
"action",
")",
"{",
"$",
"elements",
"=",
"$",
"action",
"->",
"childNodes",
";",
"if",
"(",
"$",
"elements",
"->",
"length",
")",
"{",
"$",
"html",
"=",
"''",
";",
"for",
"(",
"$",
"i",
"=",
"0",
... | Process 'html' action
@param DOMElement $action | [
"Process",
"html",
"action"
] | cdbea1c4215864b739ff8c988b5de1672079389b | https://github.com/Eresus/EForms/blob/cdbea1c4215864b739ff8c988b5de1672079389b/src/eforms/classes/Form.php#L481-L494 |
6,125 | wisquimas/valleysofsorcery | admin/mf_posttype.php | mf_posttype.edit_post_type | public function edit_post_type() {
if(!isset($_GET['post_type']) ){
$this->mf_flash( 'Oops! something was wrong, you will be redirected a safe place in a few seconds' );
}
$post_type = $this->get_post_type($_GET['post_type']);
if( !$post_type ){
$this->mf_flash('error');
}else{
... | php | public function edit_post_type() {
if(!isset($_GET['post_type']) ){
$this->mf_flash( 'Oops! something was wrong, you will be redirected a safe place in a few seconds' );
}
$post_type = $this->get_post_type($_GET['post_type']);
if( !$post_type ){
$this->mf_flash('error');
}else{
... | [
"public",
"function",
"edit_post_type",
"(",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"_GET",
"[",
"'post_type'",
"]",
")",
")",
"{",
"$",
"this",
"->",
"mf_flash",
"(",
"'Oops! something was wrong, you will be redirected a safe place in a few seconds'",
")",
... | Edit post type | [
"Edit",
"post",
"type"
] | 78a8d8f1d1102c5043e2cf7c98762e63464d2d7a | https://github.com/wisquimas/valleysofsorcery/blob/78a8d8f1d1102c5043e2cf7c98762e63464d2d7a/admin/mf_posttype.php#L372-L413 |
6,126 | wisquimas/valleysofsorcery | admin/mf_posttype.php | mf_posttype.save_post_type | public function save_post_type () {
global $mf_domain;
//checking the nonce
check_admin_referer('form_post_type_posttype');
//saving the posttype
if(isset($_POST['mf_posttype'])){
//check posttype_id
$mf = $_POST['mf_posttype'];
if($mf['core']['id']){
$this->update_post_t... | php | public function save_post_type () {
global $mf_domain;
//checking the nonce
check_admin_referer('form_post_type_posttype');
//saving the posttype
if(isset($_POST['mf_posttype'])){
//check posttype_id
$mf = $_POST['mf_posttype'];
if($mf['core']['id']){
$this->update_post_t... | [
"public",
"function",
"save_post_type",
"(",
")",
"{",
"global",
"$",
"mf_domain",
";",
"//checking the nonce",
"check_admin_referer",
"(",
"'form_post_type_posttype'",
")",
";",
"//saving the posttype",
"if",
"(",
"isset",
"(",
"$",
"_POST",
"[",
"'mf_posttype'",
"... | Save a Post Type | [
"Save",
"a",
"Post",
"Type"
] | 78a8d8f1d1102c5043e2cf7c98762e63464d2d7a | https://github.com/wisquimas/valleysofsorcery/blob/78a8d8f1d1102c5043e2cf7c98762e63464d2d7a/admin/mf_posttype.php#L647-L674 |
6,127 | wisquimas/valleysofsorcery | admin/mf_posttype.php | mf_posttype._add_cap | public function _add_cap($name){
$caps = array(
'publish_posts' => sprintf('publish_%ss',$name),
'edit_posts' => sprintf('edit_%ss',$name),
'edit_others_posts' => sprintf('edit_others_%ss',$name),
'read_private_posts' => sprintf('read_private_%ss',$name),
'edit_post' ... | php | public function _add_cap($name){
$caps = array(
'publish_posts' => sprintf('publish_%ss',$name),
'edit_posts' => sprintf('edit_%ss',$name),
'edit_others_posts' => sprintf('edit_others_%ss',$name),
'read_private_posts' => sprintf('read_private_%ss',$name),
'edit_post' ... | [
"public",
"function",
"_add_cap",
"(",
"$",
"name",
")",
"{",
"$",
"caps",
"=",
"array",
"(",
"'publish_posts'",
"=>",
"sprintf",
"(",
"'publish_%ss'",
",",
"$",
"name",
")",
",",
"'edit_posts'",
"=>",
"sprintf",
"(",
"'edit_%ss'",
",",
"$",
"name",
")",... | Add a news Capabilities for Administrator | [
"Add",
"a",
"news",
"Capabilities",
"for",
"Administrator"
] | 78a8d8f1d1102c5043e2cf7c98762e63464d2d7a | https://github.com/wisquimas/valleysofsorcery/blob/78a8d8f1d1102c5043e2cf7c98762e63464d2d7a/admin/mf_posttype.php#L687-L706 |
6,128 | wisquimas/valleysofsorcery | admin/mf_posttype.php | mf_posttype.get_post_type | public function get_post_type($post_type){
global $wpdb;
$query = $wpdb->prepare( "SELECT * FROM ".MF_TABLE_POSTTYPES." WHERE type = %s", array( $post_type ) );
$post_type = $wpdb->get_row( $query, ARRAY_A );
if($post_type){
$post_type_id = $post_type['id'];
$post_type = unserialize($post_... | php | public function get_post_type($post_type){
global $wpdb;
$query = $wpdb->prepare( "SELECT * FROM ".MF_TABLE_POSTTYPES." WHERE type = %s", array( $post_type ) );
$post_type = $wpdb->get_row( $query, ARRAY_A );
if($post_type){
$post_type_id = $post_type['id'];
$post_type = unserialize($post_... | [
"public",
"function",
"get_post_type",
"(",
"$",
"post_type",
")",
"{",
"global",
"$",
"wpdb",
";",
"$",
"query",
"=",
"$",
"wpdb",
"->",
"prepare",
"(",
"\"SELECT * FROM \"",
".",
"MF_TABLE_POSTTYPES",
".",
"\" WHERE type = %s\"",
",",
"array",
"(",
"$",
"p... | get a specific post type using the post_type_id or the post_type_name
@param mixed post_type, can be a integer or a string
@return array | [
"get",
"a",
"specific",
"post",
"type",
"using",
"the",
"post_type_id",
"or",
"the",
"post_type_name"
] | 78a8d8f1d1102c5043e2cf7c98762e63464d2d7a | https://github.com/wisquimas/valleysofsorcery/blob/78a8d8f1d1102c5043e2cf7c98762e63464d2d7a/admin/mf_posttype.php#L714-L727 |
6,129 | wisquimas/valleysofsorcery | admin/mf_posttype.php | mf_posttype.delete_post_type | public function delete_post_type(){
global $wpdb;
//checking the nonce
check_admin_referer('delete_post_type_mf_posttype');
if( isset($_GET['post_type']) ){
$post_type = $_GET['post_type'];
if( $post_type ){
$sql = $wpdb->prepare( "DELETE FROM ".MF_TABLE_POSTTYPES." WHERE type = ... | php | public function delete_post_type(){
global $wpdb;
//checking the nonce
check_admin_referer('delete_post_type_mf_posttype');
if( isset($_GET['post_type']) ){
$post_type = $_GET['post_type'];
if( $post_type ){
$sql = $wpdb->prepare( "DELETE FROM ".MF_TABLE_POSTTYPES." WHERE type = ... | [
"public",
"function",
"delete_post_type",
"(",
")",
"{",
"global",
"$",
"wpdb",
";",
"//checking the nonce",
"check_admin_referer",
"(",
"'delete_post_type_mf_posttype'",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"_GET",
"[",
"'post_type'",
"]",
")",
")",
"{",
"... | delete a post type | [
"delete",
"a",
"post",
"type"
] | 78a8d8f1d1102c5043e2cf7c98762e63464d2d7a | https://github.com/wisquimas/valleysofsorcery/blob/78a8d8f1d1102c5043e2cf7c98762e63464d2d7a/admin/mf_posttype.php#L732-L757 |
6,130 | encorephp/config | src/FileLoader.php | FileLoader.findInPaths | protected function findInPaths(array $paths, $group, $mode = null, $exists = false)
{
$items = [];
foreach ($paths as $path) {
if ($this->fs->exists($file = "{$path}/{$group}.php")) {
if ($exists) return true;
$items = array_merge_recursive($this->fs->ge... | php | protected function findInPaths(array $paths, $group, $mode = null, $exists = false)
{
$items = [];
foreach ($paths as $path) {
if ($this->fs->exists($file = "{$path}/{$group}.php")) {
if ($exists) return true;
$items = array_merge_recursive($this->fs->ge... | [
"protected",
"function",
"findInPaths",
"(",
"array",
"$",
"paths",
",",
"$",
"group",
",",
"$",
"mode",
"=",
"null",
",",
"$",
"exists",
"=",
"false",
")",
"{",
"$",
"items",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"paths",
"as",
"$",
"path",
"... | Get the path for the specified namespace
@param array $paths
@param string $group
@param string $mode
@param bool $exists
@return string | [
"Get",
"the",
"path",
"for",
"the",
"specified",
"namespace"
] | aa13e8f21068a1df5c21cec52b203c194d9fba59 | https://github.com/encorephp/config/blob/aa13e8f21068a1df5c21cec52b203c194d9fba59/src/FileLoader.php#L152-L171 |
6,131 | rodchyn/elephant-lang | lib/ParserGenerator/PHP/ParserGenerator/Data.php | PHP_ParserGenerator_Data.FindFirstSets | function FindFirstSets()
{
for ($i = 0; $i < $this->nsymbol; $i++) {
$this->symbols[$i]->lambda = false;
}
for($i = $this->nterminal; $i < $this->nsymbol; $i++) {
$this->symbols[$i]->firstset = array();
}
/* First compute all lambdas */
do{
... | php | function FindFirstSets()
{
for ($i = 0; $i < $this->nsymbol; $i++) {
$this->symbols[$i]->lambda = false;
}
for($i = $this->nterminal; $i < $this->nsymbol; $i++) {
$this->symbols[$i]->firstset = array();
}
/* First compute all lambdas */
do{
... | [
"function",
"FindFirstSets",
"(",
")",
"{",
"for",
"(",
"$",
"i",
"=",
"0",
";",
"$",
"i",
"<",
"$",
"this",
"->",
"nsymbol",
";",
"$",
"i",
"++",
")",
"{",
"$",
"this",
"->",
"symbols",
"[",
"$",
"i",
"]",
"->",
"lambda",
"=",
"false",
";",
... | Find all nonterminals which will generate the empty string.
Then go back and compute the first sets of every nonterminal.
The first set is the set of all terminal symbols which can begin
a string generated by that nonterminal. | [
"Find",
"all",
"nonterminals",
"which",
"will",
"generate",
"the",
"empty",
"string",
".",
"Then",
"go",
"back",
"and",
"compute",
"the",
"first",
"sets",
"of",
"every",
"nonterminal",
".",
"The",
"first",
"set",
"is",
"the",
"set",
"of",
"all",
"terminal"... | e0acc26eec1ab4dbfcc90ad79efc23318eaba5cf | https://github.com/rodchyn/elephant-lang/blob/e0acc26eec1ab4dbfcc90ad79efc23318eaba5cf/lib/ParserGenerator/PHP/ParserGenerator/Data.php#L354-L420 |
6,132 | rodchyn/elephant-lang | lib/ParserGenerator/PHP/ParserGenerator/Data.php | PHP_ParserGenerator_Data.buildshifts | private function buildshifts(PHP_ParserGenerator_State $stp)
{
// struct config *cfp; /* For looping thru the config closure of "stp" */
// struct config *bcfp; /* For the inner loop on config closure of "stp" */
// struct config *new; /* */
// struct symbol *sp; /* Symbol following the dot in confi... | php | private function buildshifts(PHP_ParserGenerator_State $stp)
{
// struct config *cfp; /* For looping thru the config closure of "stp" */
// struct config *bcfp; /* For the inner loop on config closure of "stp" */
// struct config *new; /* */
// struct symbol *sp; /* Symbol following the dot in confi... | [
"private",
"function",
"buildshifts",
"(",
"PHP_ParserGenerator_State",
"$",
"stp",
")",
"{",
"// struct config *cfp; /* For looping thru the config closure of \"stp\" */",
"// struct config *bcfp; /* For the inner loop on config closure of \"stp\" */",
"// struct config *new; /* */... | Construct all successor states to the given state. A "successor"
state is any state which can be reached by a shift action.
@param PHP_ParserGenerator_Data
@param PHP_ParserGenerator_State The state from which successors are computed | [
"Construct",
"all",
"successor",
"states",
"to",
"the",
"given",
"state",
".",
"A",
"successor",
"state",
"is",
"any",
"state",
"which",
"can",
"be",
"reached",
"by",
"a",
"shift",
"action",
"."
] | e0acc26eec1ab4dbfcc90ad79efc23318eaba5cf | https://github.com/rodchyn/elephant-lang/blob/e0acc26eec1ab4dbfcc90ad79efc23318eaba5cf/lib/ParserGenerator/PHP/ParserGenerator/Data.php#L536-L602 |
6,133 | rodchyn/elephant-lang | lib/ParserGenerator/PHP/ParserGenerator/Data.php | PHP_ParserGenerator_Data.FindLinks | function FindLinks()
{
/* Housekeeping detail:
** Add to every propagate link a pointer back to the state to
** which the link is attached. */
foreach ($this->sorted as $info) {
$info->key->stp = $info->data;
}
/* Convert all backlinks into forwar... | php | function FindLinks()
{
/* Housekeeping detail:
** Add to every propagate link a pointer back to the state to
** which the link is attached. */
foreach ($this->sorted as $info) {
$info->key->stp = $info->data;
}
/* Convert all backlinks into forwar... | [
"function",
"FindLinks",
"(",
")",
"{",
"/* Housekeeping detail:\n ** Add to every propagate link a pointer back to the state to\n ** which the link is attached. */",
"foreach",
"(",
"$",
"this",
"->",
"sorted",
"as",
"$",
"info",
")",
"{",
"$",
"info",
"->",
"k... | Construct the propagation links | [
"Construct",
"the",
"propagation",
"links"
] | e0acc26eec1ab4dbfcc90ad79efc23318eaba5cf | https://github.com/rodchyn/elephant-lang/blob/e0acc26eec1ab4dbfcc90ad79efc23318eaba5cf/lib/ParserGenerator/PHP/ParserGenerator/Data.php#L607-L627 |
6,134 | rodchyn/elephant-lang | lib/ParserGenerator/PHP/ParserGenerator/Data.php | PHP_ParserGenerator_Data.resolve_conflict | function resolve_conflict($apx, $apy, $errsym)
{
$errcnt = 0;
if ($apx->sp !== $apy->sp) {
throw new Exception('no conflict but resolve_conflict called');
}
if ($apx->type == PHP_ParserGenerator_Action::SHIFT && $apy->type == PHP_ParserGenerator_Action::REDUCE) {
... | php | function resolve_conflict($apx, $apy, $errsym)
{
$errcnt = 0;
if ($apx->sp !== $apy->sp) {
throw new Exception('no conflict but resolve_conflict called');
}
if ($apx->type == PHP_ParserGenerator_Action::SHIFT && $apy->type == PHP_ParserGenerator_Action::REDUCE) {
... | [
"function",
"resolve_conflict",
"(",
"$",
"apx",
",",
"$",
"apy",
",",
"$",
"errsym",
")",
"{",
"$",
"errcnt",
"=",
"0",
";",
"if",
"(",
"$",
"apx",
"->",
"sp",
"!==",
"$",
"apy",
"->",
"sp",
")",
"{",
"throw",
"new",
"Exception",
"(",
"'no confl... | Resolve a conflict between the two given actions. If the
conflict can't be resolve, return non-zero.
NO LONGER TRUE:
To resolve a conflict, first look to see if either action
is on an error rule. In that case, take the action which
is not associated with the error rule. If neither or both
actions are associated wit... | [
"Resolve",
"a",
"conflict",
"between",
"the",
"two",
"given",
"actions",
".",
"If",
"the",
"conflict",
"can",
"t",
"be",
"resolve",
"return",
"non",
"-",
"zero",
"."
] | e0acc26eec1ab4dbfcc90ad79efc23318eaba5cf | https://github.com/rodchyn/elephant-lang/blob/e0acc26eec1ab4dbfcc90ad79efc23318eaba5cf/lib/ParserGenerator/PHP/ParserGenerator/Data.php#L728-L789 |
6,135 | rodchyn/elephant-lang | lib/ParserGenerator/PHP/ParserGenerator/Data.php | PHP_ParserGenerator_Data.CompressTables | function CompressTables()
{
for ($i = 0; $i < $this->nstate; $i++) {
$stp = $this->sorted[$i]->data;
$nbest = 0;
$rbest = 0;
for ($ap = $stp->ap; $ap; $ap = $ap->next) {
if ($ap->type != PHP_ParserGenerator_Action::REDUCE) {
... | php | function CompressTables()
{
for ($i = 0; $i < $this->nstate; $i++) {
$stp = $this->sorted[$i]->data;
$nbest = 0;
$rbest = 0;
for ($ap = $stp->ap; $ap; $ap = $ap->next) {
if ($ap->type != PHP_ParserGenerator_Action::REDUCE) {
... | [
"function",
"CompressTables",
"(",
")",
"{",
"for",
"(",
"$",
"i",
"=",
"0",
";",
"$",
"i",
"<",
"$",
"this",
"->",
"nstate",
";",
"$",
"i",
"++",
")",
"{",
"$",
"stp",
"=",
"$",
"this",
"->",
"sorted",
"[",
"$",
"i",
"]",
"->",
"data",
";"... | Reduce the size of the action tables, if possible, by making use
of defaults.
In this version, we take the most frequent REDUCE action and make
it the default. | [
"Reduce",
"the",
"size",
"of",
"the",
"action",
"tables",
"if",
"possible",
"by",
"making",
"use",
"of",
"defaults",
"."
] | e0acc26eec1ab4dbfcc90ad79efc23318eaba5cf | https://github.com/rodchyn/elephant-lang/blob/e0acc26eec1ab4dbfcc90ad79efc23318eaba5cf/lib/ParserGenerator/PHP/ParserGenerator/Data.php#L798-L856 |
6,136 | rodchyn/elephant-lang | lib/ParserGenerator/PHP/ParserGenerator/Data.php | PHP_ParserGenerator_Data.ResortStates | function ResortStates()
{
for ($i = 0; $i < $this->nstate; $i++) {
$stp = $this->sorted[$i]->data;
$stp->nTknAct = $stp->nNtAct = 0;
$stp->iDflt = $this->nstate + $this->nrule;
$stp->iTknOfst = PHP_ParserGenerator_Data::NO_OFFSET;
$stp->iNtOfst = P... | php | function ResortStates()
{
for ($i = 0; $i < $this->nstate; $i++) {
$stp = $this->sorted[$i]->data;
$stp->nTknAct = $stp->nNtAct = 0;
$stp->iDflt = $this->nstate + $this->nrule;
$stp->iTknOfst = PHP_ParserGenerator_Data::NO_OFFSET;
$stp->iNtOfst = P... | [
"function",
"ResortStates",
"(",
")",
"{",
"for",
"(",
"$",
"i",
"=",
"0",
";",
"$",
"i",
"<",
"$",
"this",
"->",
"nstate",
";",
"$",
"i",
"++",
")",
"{",
"$",
"stp",
"=",
"$",
"this",
"->",
"sorted",
"[",
"$",
"i",
"]",
"->",
"data",
";",
... | Renumber and resort states so that states with fewer choices
occur at the end. Except, keep state 0 as the first state. | [
"Renumber",
"and",
"resort",
"states",
"so",
"that",
"states",
"with",
"fewer",
"choices",
"occur",
"at",
"the",
"end",
".",
"Except",
"keep",
"state",
"0",
"as",
"the",
"first",
"state",
"."
] | e0acc26eec1ab4dbfcc90ad79efc23318eaba5cf | https://github.com/rodchyn/elephant-lang/blob/e0acc26eec1ab4dbfcc90ad79efc23318eaba5cf/lib/ParserGenerator/PHP/ParserGenerator/Data.php#L862-L890 |
6,137 | rodchyn/elephant-lang | lib/ParserGenerator/PHP/ParserGenerator/Data.php | PHP_ParserGenerator_Data.compute_action | function compute_action($ap)
{
switch ($ap->type) {
case PHP_ParserGenerator_Action::SHIFT:
$act = $ap->x->statenum;
break;
case PHP_ParserGenerator_Action::REDUCE:
$act = $ap->x->index + $this->nstate;
break;
... | php | function compute_action($ap)
{
switch ($ap->type) {
case PHP_ParserGenerator_Action::SHIFT:
$act = $ap->x->statenum;
break;
case PHP_ParserGenerator_Action::REDUCE:
$act = $ap->x->index + $this->nstate;
break;
... | [
"function",
"compute_action",
"(",
"$",
"ap",
")",
"{",
"switch",
"(",
"$",
"ap",
"->",
"type",
")",
"{",
"case",
"PHP_ParserGenerator_Action",
"::",
"SHIFT",
":",
"$",
"act",
"=",
"$",
"ap",
"->",
"x",
"->",
"statenum",
";",
"break",
";",
"case",
"P... | Given an action, compute the integer value for that action
which is to be put in the action table of the generated machine.
Return negative if no action should be generated.
@param PHP_ParserGenerator_Action | [
"Given",
"an",
"action",
"compute",
"the",
"integer",
"value",
"for",
"that",
"action",
"which",
"is",
"to",
"be",
"put",
"in",
"the",
"action",
"table",
"of",
"the",
"generated",
"machine",
".",
"Return",
"negative",
"if",
"no",
"action",
"should",
"be",
... | e0acc26eec1ab4dbfcc90ad79efc23318eaba5cf | https://github.com/rodchyn/elephant-lang/blob/e0acc26eec1ab4dbfcc90ad79efc23318eaba5cf/lib/ParserGenerator/PHP/ParserGenerator/Data.php#L898-L918 |
6,138 | rodchyn/elephant-lang | lib/ParserGenerator/PHP/ParserGenerator/Data.php | PHP_ParserGenerator_Data.ReportOutput | function ReportOutput()
{
$fp = fopen($this->filenosuffix . ".out", "wb");
if (!$fp) {
return;
}
for ($i = 0; $i < $this->nstate; $i++) {
$stp = $this->sorted[$i];
fprintf($fp, "State %d:\n", $stp->statenum);
if ($this->basisflag) {
... | php | function ReportOutput()
{
$fp = fopen($this->filenosuffix . ".out", "wb");
if (!$fp) {
return;
}
for ($i = 0; $i < $this->nstate; $i++) {
$stp = $this->sorted[$i];
fprintf($fp, "State %d:\n", $stp->statenum);
if ($this->basisflag) {
... | [
"function",
"ReportOutput",
"(",
")",
"{",
"$",
"fp",
"=",
"fopen",
"(",
"$",
"this",
"->",
"filenosuffix",
".",
"\".out\"",
",",
"\"wb\"",
")",
";",
"if",
"(",
"!",
"$",
"fp",
")",
"{",
"return",
";",
"}",
"for",
"(",
"$",
"i",
"=",
"0",
";",
... | Generate the "Parse.out" log file | [
"Generate",
"the",
"Parse",
".",
"out",
"log",
"file"
] | e0acc26eec1ab4dbfcc90ad79efc23318eaba5cf | https://github.com/rodchyn/elephant-lang/blob/e0acc26eec1ab4dbfcc90ad79efc23318eaba5cf/lib/ParserGenerator/PHP/ParserGenerator/Data.php#L923-L966 |
6,139 | rodchyn/elephant-lang | lib/ParserGenerator/PHP/ParserGenerator/Data.php | PHP_ParserGenerator_Data.tplt_open | private function tplt_open()
{
$templatename = $this->parser_template ? $this->parser_template : dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . "Lempar.php";
$buf = $this->filenosuffix . '.lt';
if (file_exists($buf) && is_readable($buf)) {
$tpltname = $buf;
} elseif ... | php | private function tplt_open()
{
$templatename = $this->parser_template ? $this->parser_template : dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . "Lempar.php";
$buf = $this->filenosuffix . '.lt';
if (file_exists($buf) && is_readable($buf)) {
$tpltname = $buf;
} elseif ... | [
"private",
"function",
"tplt_open",
"(",
")",
"{",
"$",
"templatename",
"=",
"$",
"this",
"->",
"parser_template",
"?",
"$",
"this",
"->",
"parser_template",
":",
"dirname",
"(",
"dirname",
"(",
"__FILE__",
")",
")",
".",
"DIRECTORY_SEPARATOR",
".",
"\"Lempa... | The next function finds the template file and opens it, returning
a pointer to the opened file.
@return resource | [
"The",
"next",
"function",
"finds",
"the",
"template",
"file",
"and",
"opens",
"it",
"returning",
"a",
"pointer",
"to",
"the",
"opened",
"file",
"."
] | e0acc26eec1ab4dbfcc90ad79efc23318eaba5cf | https://github.com/rodchyn/elephant-lang/blob/e0acc26eec1ab4dbfcc90ad79efc23318eaba5cf/lib/ParserGenerator/PHP/ParserGenerator/Data.php#L973-L998 |
6,140 | rodchyn/elephant-lang | lib/ParserGenerator/PHP/ParserGenerator/Data.php | PHP_ParserGenerator_Data.tplt_xfer | private function tplt_xfer($name, $in, $out, &$lineno)
{
while (($line = fgets($in, 1024)) && ($line[0] != '%' || $line[1] != '%')) {
$lineno++;
$iStart = 0;
if ($name) {
for ($i = 0; $i < strlen($line); $i++) {
if ($line[$i] == 'P' && ... | php | private function tplt_xfer($name, $in, $out, &$lineno)
{
while (($line = fgets($in, 1024)) && ($line[0] != '%' || $line[1] != '%')) {
$lineno++;
$iStart = 0;
if ($name) {
for ($i = 0; $i < strlen($line); $i++) {
if ($line[$i] == 'P' && ... | [
"private",
"function",
"tplt_xfer",
"(",
"$",
"name",
",",
"$",
"in",
",",
"$",
"out",
",",
"&",
"$",
"lineno",
")",
"{",
"while",
"(",
"(",
"$",
"line",
"=",
"fgets",
"(",
"$",
"in",
",",
"1024",
")",
")",
"&&",
"(",
"$",
"line",
"[",
"0",
... | The first function transfers data from "in" to "out" until
a line is seen which begins with "%%". The line number is
tracked.
if name!=0, then any word that begin with "Parse" is changed to
begin with *name instead. | [
"The",
"first",
"function",
"transfers",
"data",
"from",
"in",
"to",
"out",
"until",
"a",
"line",
"is",
"seen",
"which",
"begins",
"with",
"%%",
".",
"The",
"line",
"number",
"is",
"tracked",
"."
] | e0acc26eec1ab4dbfcc90ad79efc23318eaba5cf | https://github.com/rodchyn/elephant-lang/blob/e0acc26eec1ab4dbfcc90ad79efc23318eaba5cf/lib/ParserGenerator/PHP/ParserGenerator/Data.php#L1013-L1033 |
6,141 | rodchyn/elephant-lang | lib/ParserGenerator/PHP/ParserGenerator/Data.php | PHP_ParserGenerator_Data.tplt_print | private function tplt_print($out, $str, $strln, &$lineno)
{
if ($str == '') {
return;
}
$this->tplt_linedir($out, $strln, $this->filename);
$lineno++;
fwrite($out, $str);
$lineno += count(explode("\n", $str)) - 1;
$this->tplt_linedir($out, $lineno ... | php | private function tplt_print($out, $str, $strln, &$lineno)
{
if ($str == '') {
return;
}
$this->tplt_linedir($out, $strln, $this->filename);
$lineno++;
fwrite($out, $str);
$lineno += count(explode("\n", $str)) - 1;
$this->tplt_linedir($out, $lineno ... | [
"private",
"function",
"tplt_print",
"(",
"$",
"out",
",",
"$",
"str",
",",
"$",
"strln",
",",
"&",
"$",
"lineno",
")",
"{",
"if",
"(",
"$",
"str",
"==",
"''",
")",
"{",
"return",
";",
"}",
"$",
"this",
"->",
"tplt_linedir",
"(",
"$",
"out",
",... | Print a string to the file and keep the linenumber up to date | [
"Print",
"a",
"string",
"to",
"the",
"file",
"and",
"keep",
"the",
"linenumber",
"up",
"to",
"date"
] | e0acc26eec1ab4dbfcc90ad79efc23318eaba5cf | https://github.com/rodchyn/elephant-lang/blob/e0acc26eec1ab4dbfcc90ad79efc23318eaba5cf/lib/ParserGenerator/PHP/ParserGenerator/Data.php#L1046-L1057 |
6,142 | rodchyn/elephant-lang | lib/ParserGenerator/PHP/ParserGenerator/Data.php | PHP_ParserGenerator_Data.FindFollowSets | function FindFollowSets()
{
for ($i = 0; $i < $this->nstate; $i++) {
for ($cfp = $this->sorted[$i]->data->cfp; $cfp; $cfp = $cfp->next) {
$cfp->status = PHP_ParserGenerator_Config::INCOMPLETE;
}
}
do {
$progress = 0;
fo... | php | function FindFollowSets()
{
for ($i = 0; $i < $this->nstate; $i++) {
for ($cfp = $this->sorted[$i]->data->cfp; $cfp; $cfp = $cfp->next) {
$cfp->status = PHP_ParserGenerator_Config::INCOMPLETE;
}
}
do {
$progress = 0;
fo... | [
"function",
"FindFollowSets",
"(",
")",
"{",
"for",
"(",
"$",
"i",
"=",
"0",
";",
"$",
"i",
"<",
"$",
"this",
"->",
"nstate",
";",
"$",
"i",
"++",
")",
"{",
"for",
"(",
"$",
"cfp",
"=",
"$",
"this",
"->",
"sorted",
"[",
"$",
"i",
"]",
"->",... | Compute all followsets.
A followset is the set of all symbols which can come immediately
after a configuration. | [
"Compute",
"all",
"followsets",
"."
] | e0acc26eec1ab4dbfcc90ad79efc23318eaba5cf | https://github.com/rodchyn/elephant-lang/blob/e0acc26eec1ab4dbfcc90ad79efc23318eaba5cf/lib/ParserGenerator/PHP/ParserGenerator/Data.php#L1066-L1093 |
6,143 | rodchyn/elephant-lang | lib/ParserGenerator/PHP/ParserGenerator/Data.php | PHP_ParserGenerator_Data.emit_code | function emit_code($out, PHP_ParserGenerator_Rule $rp, &$lineno)
{
$linecnt = 0;
/* Generate code to do the reduce action */
if ($rp->code) {
$this->tplt_linedir($out, $rp->line, $this->filename);
fwrite($out, " function yy_r$rp->index(){" . $rp->code);
... | php | function emit_code($out, PHP_ParserGenerator_Rule $rp, &$lineno)
{
$linecnt = 0;
/* Generate code to do the reduce action */
if ($rp->code) {
$this->tplt_linedir($out, $rp->line, $this->filename);
fwrite($out, " function yy_r$rp->index(){" . $rp->code);
... | [
"function",
"emit_code",
"(",
"$",
"out",
",",
"PHP_ParserGenerator_Rule",
"$",
"rp",
",",
"&",
"$",
"lineno",
")",
"{",
"$",
"linecnt",
"=",
"0",
";",
"/* Generate code to do the reduce action */",
"if",
"(",
"$",
"rp",
"->",
"code",
")",
"{",
"$",
"this"... | Generate code which executes when the rule "rp" is reduced. Write
the code to "out". Make sure lineno stays up-to-date. | [
"Generate",
"code",
"which",
"executes",
"when",
"the",
"rule",
"rp",
"is",
"reduced",
".",
"Write",
"the",
"code",
"to",
"out",
".",
"Make",
"sure",
"lineno",
"stays",
"up",
"-",
"to",
"-",
"date",
"."
] | e0acc26eec1ab4dbfcc90ad79efc23318eaba5cf | https://github.com/rodchyn/elephant-lang/blob/e0acc26eec1ab4dbfcc90ad79efc23318eaba5cf/lib/ParserGenerator/PHP/ParserGenerator/Data.php#L1656-L1669 |
6,144 | rodchyn/elephant-lang | lib/ParserGenerator/PHP/ParserGenerator/Data.php | PHP_ParserGenerator_Data.emit_destructor_code | function emit_destructor_code($out, PHP_ParserGenerator_Symbol $sp, &$lineno)
// FILE *out;
// struct symbol *sp;
// struct lemon *lemp;
// int *lineno;
{
$cp = 0;
$linecnt = 0;
if ($sp->type == PHP_ParserGenerator_Symbol::TERMINAL) {
$cp = $this->tokendest;
... | php | function emit_destructor_code($out, PHP_ParserGenerator_Symbol $sp, &$lineno)
// FILE *out;
// struct symbol *sp;
// struct lemon *lemp;
// int *lineno;
{
$cp = 0;
$linecnt = 0;
if ($sp->type == PHP_ParserGenerator_Symbol::TERMINAL) {
$cp = $this->tokendest;
... | [
"function",
"emit_destructor_code",
"(",
"$",
"out",
",",
"PHP_ParserGenerator_Symbol",
"$",
"sp",
",",
"&",
"$",
"lineno",
")",
"// FILE *out;",
"// struct symbol *sp;",
"// struct lemon *lemp;",
"// int *lineno;",
"{",
"$",
"cp",
"=",
"0",
";",
"$",
"l... | The following routine emits code for the destructor for the
symbol sp | [
"The",
"following",
"routine",
"emits",
"code",
"for",
"the",
"destructor",
"for",
"the",
"symbol",
"sp"
] | e0acc26eec1ab4dbfcc90ad79efc23318eaba5cf | https://github.com/rodchyn/elephant-lang/blob/e0acc26eec1ab4dbfcc90ad79efc23318eaba5cf/lib/ParserGenerator/PHP/ParserGenerator/Data.php#L1804-L1848 |
6,145 | ekyna/Characteristics | Twig/CharacteristicsExtension.php | CharacteristicsExtension.renderCharacteristics | public function renderCharacteristics(CharacteristicsInterface $characteristics, array $options = array())
{
$options = array_merge(array(
'table_class' => 'table table-striped table-bordered table-condensed ekyna-characteristics',
'highlight_inherited' => false,
'display... | php | public function renderCharacteristics(CharacteristicsInterface $characteristics, array $options = array())
{
$options = array_merge(array(
'table_class' => 'table table-striped table-bordered table-condensed ekyna-characteristics',
'highlight_inherited' => false,
'display... | [
"public",
"function",
"renderCharacteristics",
"(",
"CharacteristicsInterface",
"$",
"characteristics",
",",
"array",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"$",
"options",
"=",
"array_merge",
"(",
"array",
"(",
"'table_class'",
"=>",
"'table table-stri... | Renders a characteristics view table.
@param CharacteristicsInterface $characteristics
@param array $options
@return string | [
"Renders",
"a",
"characteristics",
"view",
"table",
"."
] | 118a349fd98a7c28721d3cbaba67ce79d1cffada | https://github.com/ekyna/Characteristics/blob/118a349fd98a7c28721d3cbaba67ce79d1cffada/Twig/CharacteristicsExtension.php#L70-L82 |
6,146 | Puzzlout/FrameworkMvcLegacy | src/GeneratorEngine/Core/ControllerNameConstantsEngine.php | ControllerNameConstantsEngine.Run | public function Run($data = null) {
$this->ProcessFrameworkData();
$ApplicationList = \Puzzlout\Framework\GeneratorEngine\Constants\ApplicationList::Init()->GetList();
foreach ($ApplicationList as $Appname) {
$this->ProcessApplicationData($Appname);
}
} | php | public function Run($data = null) {
$this->ProcessFrameworkData();
$ApplicationList = \Puzzlout\Framework\GeneratorEngine\Constants\ApplicationList::Init()->GetList();
foreach ($ApplicationList as $Appname) {
$this->ProcessApplicationData($Appname);
}
} | [
"public",
"function",
"Run",
"(",
"$",
"data",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"ProcessFrameworkData",
"(",
")",
";",
"$",
"ApplicationList",
"=",
"\\",
"Puzzlout",
"\\",
"Framework",
"\\",
"GeneratorEngine",
"\\",
"Constants",
"\\",
"ApplicationLi... | Retrieve the lists of controller filenames.
Generate the Classes that list the Controller names available in the
solution.
@param assoc array $data depending on the situation, some data can be passed
on to generate the files desired. | [
"Retrieve",
"the",
"lists",
"of",
"controller",
"filenames",
".",
"Generate",
"the",
"Classes",
"that",
"list",
"the",
"Controller",
"names",
"available",
"in",
"the",
"solution",
"."
] | 14e0fc5b16978cbd209f552ee9c649f66a0dfc6e | https://github.com/Puzzlout/FrameworkMvcLegacy/blob/14e0fc5b16978cbd209f552ee9c649f66a0dfc6e/src/GeneratorEngine/Core/ControllerNameConstantsEngine.php#L29-L36 |
6,147 | Puzzlout/FrameworkMvcLegacy | src/GeneratorEngine/Core/ControllerNameConstantsEngine.php | ControllerNameConstantsEngine.ProcessApplicationData | function ProcessApplicationData($Appname) {
$ApplicationControllers = DirectoryManager::GetFileNames(
"APP_ROOT_DIR" .
\Puzzlout\Framework\Enums\ApplicationFolderName::AppsFolderName .
$Appname .
\Puzzlout\Framework\... | php | function ProcessApplicationData($Appname) {
$ApplicationControllers = DirectoryManager::GetFileNames(
"APP_ROOT_DIR" .
\Puzzlout\Framework\Enums\ApplicationFolderName::AppsFolderName .
$Appname .
\Puzzlout\Framework\... | [
"function",
"ProcessApplicationData",
"(",
"$",
"Appname",
")",
"{",
"$",
"ApplicationControllers",
"=",
"DirectoryManager",
"::",
"GetFileNames",
"(",
"\"APP_ROOT_DIR\"",
".",
"\\",
"Puzzlout",
"\\",
"Framework",
"\\",
"Enums",
"\\",
"ApplicationFolderName",
"::",
... | Generate the files for an app.
@param string $Appname | [
"Generate",
"the",
"files",
"for",
"an",
"app",
"."
] | 14e0fc5b16978cbd209f552ee9c649f66a0dfc6e | https://github.com/Puzzlout/FrameworkMvcLegacy/blob/14e0fc5b16978cbd209f552ee9c649f66a0dfc6e/src/GeneratorEngine/Core/ControllerNameConstantsEngine.php#L58-L75 |
6,148 | uthando-cms/uthando-common | src/UthandoCommon/Model/AbstractCollection.php | AbstractCollection.add | public function add($entity)
{
$class = $this->entityClass;
if (!$entity instanceof $class) {
throw new CollectionException('class must an instance of ' . $class);
}
$this->entities[] = $entity;
return $this;
} | php | public function add($entity)
{
$class = $this->entityClass;
if (!$entity instanceof $class) {
throw new CollectionException('class must an instance of ' . $class);
}
$this->entities[] = $entity;
return $this;
} | [
"public",
"function",
"add",
"(",
"$",
"entity",
")",
"{",
"$",
"class",
"=",
"$",
"this",
"->",
"entityClass",
";",
"if",
"(",
"!",
"$",
"entity",
"instanceof",
"$",
"class",
")",
"{",
"throw",
"new",
"CollectionException",
"(",
"'class must an instance o... | adds an entity to the collection
@param object $entity
@return $this
@throws CollectionException | [
"adds",
"an",
"entity",
"to",
"the",
"collection"
] | feb915da5d26b60f536282e1bc3ad5c22e53f485 | https://github.com/uthando-cms/uthando-common/blob/feb915da5d26b60f536282e1bc3ad5c22e53f485/src/UthandoCommon/Model/AbstractCollection.php#L59-L70 |
6,149 | uthando-cms/uthando-common | src/UthandoCommon/Model/AbstractCollection.php | AbstractCollection.checkEntities | public function checkEntities($entities)
{
return array_filter($entities, function ($val) {
$entityClass = $this->entityClass;
return ($val instanceof $entityClass);
});
} | php | public function checkEntities($entities)
{
return array_filter($entities, function ($val) {
$entityClass = $this->entityClass;
return ($val instanceof $entityClass);
});
} | [
"public",
"function",
"checkEntities",
"(",
"$",
"entities",
")",
"{",
"return",
"array_filter",
"(",
"$",
"entities",
",",
"function",
"(",
"$",
"val",
")",
"{",
"$",
"entityClass",
"=",
"$",
"this",
"->",
"entityClass",
";",
"return",
"(",
"$",
"val",
... | filter out all entities that don't belong to the entity class
@param $entities
@return array | [
"filter",
"out",
"all",
"entities",
"that",
"don",
"t",
"belong",
"to",
"the",
"entity",
"class"
] | feb915da5d26b60f536282e1bc3ad5c22e53f485 | https://github.com/uthando-cms/uthando-common/blob/feb915da5d26b60f536282e1bc3ad5c22e53f485/src/UthandoCommon/Model/AbstractCollection.php#L78-L84 |
6,150 | uthando-cms/uthando-common | src/UthandoCommon/Model/AbstractCollection.php | AbstractCollection.offsetSet | public function offsetSet($key, $entity)
{
$class = $this->entityClass;
if ($entity instanceof $class) {
if (!isset($key)) {
$this->entities[] = $entity;
} else {
$this->entities[$key] = $entity;
}
return true;
... | php | public function offsetSet($key, $entity)
{
$class = $this->entityClass;
if ($entity instanceof $class) {
if (!isset($key)) {
$this->entities[] = $entity;
} else {
$this->entities[$key] = $entity;
}
return true;
... | [
"public",
"function",
"offsetSet",
"(",
"$",
"key",
",",
"$",
"entity",
")",
"{",
"$",
"class",
"=",
"$",
"this",
"->",
"entityClass",
";",
"if",
"(",
"$",
"entity",
"instanceof",
"$",
"class",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"key",
... | Add an entity to the collection
@param mixed $key
@param mixed $entity
@return bool|void
@throws CollectionException | [
"Add",
"an",
"entity",
"to",
"the",
"collection"
] | feb915da5d26b60f536282e1bc3ad5c22e53f485 | https://github.com/uthando-cms/uthando-common/blob/feb915da5d26b60f536282e1bc3ad5c22e53f485/src/UthandoCommon/Model/AbstractCollection.php#L180-L196 |
6,151 | uthando-cms/uthando-common | src/UthandoCommon/Model/AbstractCollection.php | AbstractCollection.offsetUnset | public function offsetUnset($key)
{
$entityClass = $this->entityClass;
if ($key instanceof $entityClass) {
$this->entities = array_filter($this->entities, function ($v) use ($key) {
return $v !== $key;
});
return true;
}
if (isset... | php | public function offsetUnset($key)
{
$entityClass = $this->entityClass;
if ($key instanceof $entityClass) {
$this->entities = array_filter($this->entities, function ($v) use ($key) {
return $v !== $key;
});
return true;
}
if (isset... | [
"public",
"function",
"offsetUnset",
"(",
"$",
"key",
")",
"{",
"$",
"entityClass",
"=",
"$",
"this",
"->",
"entityClass",
";",
"if",
"(",
"$",
"key",
"instanceof",
"$",
"entityClass",
")",
"{",
"$",
"this",
"->",
"entities",
"=",
"array_filter",
"(",
... | Remove an entity from the collection
@param mixed $key
@return bool|void | [
"Remove",
"an",
"entity",
"from",
"the",
"collection"
] | feb915da5d26b60f536282e1bc3ad5c22e53f485 | https://github.com/uthando-cms/uthando-common/blob/feb915da5d26b60f536282e1bc3ad5c22e53f485/src/UthandoCommon/Model/AbstractCollection.php#L204-L221 |
6,152 | uthando-cms/uthando-common | src/UthandoCommon/Model/AbstractCollection.php | AbstractCollection.offsetGet | public function offsetGet($key)
{
return isset($this->entities[$key]) ?
$this->entities[$key] :
null;
} | php | public function offsetGet($key)
{
return isset($this->entities[$key]) ?
$this->entities[$key] :
null;
} | [
"public",
"function",
"offsetGet",
"(",
"$",
"key",
")",
"{",
"return",
"isset",
"(",
"$",
"this",
"->",
"entities",
"[",
"$",
"key",
"]",
")",
"?",
"$",
"this",
"->",
"entities",
"[",
"$",
"key",
"]",
":",
"null",
";",
"}"
] | Get the specified entity in the collection
@param mixed $key
@return mixed|null | [
"Get",
"the",
"specified",
"entity",
"in",
"the",
"collection"
] | feb915da5d26b60f536282e1bc3ad5c22e53f485 | https://github.com/uthando-cms/uthando-common/blob/feb915da5d26b60f536282e1bc3ad5c22e53f485/src/UthandoCommon/Model/AbstractCollection.php#L229-L234 |
6,153 | uthando-cms/uthando-common | src/UthandoCommon/Model/AbstractCollection.php | AbstractCollection.seek | public function seek($index)
{
$this->rewind();
$position = 0;
while ($position < $index && $this->valid()) {
$this->next();
$position++;
}
if (!$this->valid()) {
throw new CollectionException('Invalid seek position');
}
} | php | public function seek($index)
{
$this->rewind();
$position = 0;
while ($position < $index && $this->valid()) {
$this->next();
$position++;
}
if (!$this->valid()) {
throw new CollectionException('Invalid seek position');
}
} | [
"public",
"function",
"seek",
"(",
"$",
"index",
")",
"{",
"$",
"this",
"->",
"rewind",
"(",
")",
";",
"$",
"position",
"=",
"0",
";",
"while",
"(",
"$",
"position",
"<",
"$",
"index",
"&&",
"$",
"this",
"->",
"valid",
"(",
")",
")",
"{",
"$",
... | Seek to the given index.
@param int $index
@throws CollectionException | [
"Seek",
"to",
"the",
"given",
"index",
"."
] | feb915da5d26b60f536282e1bc3ad5c22e53f485 | https://github.com/uthando-cms/uthando-common/blob/feb915da5d26b60f536282e1bc3ad5c22e53f485/src/UthandoCommon/Model/AbstractCollection.php#L253-L266 |
6,154 | bishopb/vanilla | applications/dashboard/controllers/class.utilitycontroller.php | UtilityController.Sort | public function Sort() {
$this->Permission('Garden.Settings.Manage');
$Session = Gdn::Session();
$TransientKey = GetPostValue('TransientKey', '');
$Target = GetPostValue('Target', '');
if ($Session->ValidateTransientKey($TransientKey)) {
$TableID = GetPostValue('TableID', F... | php | public function Sort() {
$this->Permission('Garden.Settings.Manage');
$Session = Gdn::Session();
$TransientKey = GetPostValue('TransientKey', '');
$Target = GetPostValue('Target', '');
if ($Session->ValidateTransientKey($TransientKey)) {
$TableID = GetPostValue('TableID', F... | [
"public",
"function",
"Sort",
"(",
")",
"{",
"$",
"this",
"->",
"Permission",
"(",
"'Garden.Settings.Manage'",
")",
";",
"$",
"Session",
"=",
"Gdn",
"::",
"Session",
"(",
")",
";",
"$",
"TransientKey",
"=",
"GetPostValue",
"(",
"'TransientKey'",
",",
"''",... | Set the sort order for data on an arbitrary database table.
Expect post values TransientKey, Target (redirect URL), Table (database table name),
and TableID (an array of sort order => unique ID).
@since 2.0.0
@access public | [
"Set",
"the",
"sort",
"order",
"for",
"data",
"on",
"an",
"arbitrary",
"database",
"table",
"."
] | 8494eb4a4ad61603479015a8054d23ff488364e8 | https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/applications/dashboard/controllers/class.utilitycontroller.php#L182-L209 |
6,155 | bishopb/vanilla | applications/dashboard/controllers/class.utilitycontroller.php | UtilityController.Update | public function Update() {
try {
// Check for permission or flood control.
// These settings are loaded/saved to the database because we don't want the config file storing non/config information.
$Now = time();
$LastTime = Gdn::Get('Garden.Update.LastTimestamp', 0);
... | php | public function Update() {
try {
// Check for permission or flood control.
// These settings are loaded/saved to the database because we don't want the config file storing non/config information.
$Now = time();
$LastTime = Gdn::Get('Garden.Update.LastTimestamp', 0);
... | [
"public",
"function",
"Update",
"(",
")",
"{",
"try",
"{",
"// Check for permission or flood control.",
"// These settings are loaded/saved to the database because we don't want the config file storing non/config information.",
"$",
"Now",
"=",
"time",
"(",
")",
";",
"$",
"LastTi... | Run a structure update on the database.
@since 2.0.?
@access public | [
"Run",
"a",
"structure",
"update",
"on",
"the",
"database",
"."
] | 8494eb4a4ad61603479015a8054d23ff488364e8 | https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/applications/dashboard/controllers/class.utilitycontroller.php#L346-L394 |
6,156 | bishopb/vanilla | applications/dashboard/controllers/class.utilitycontroller.php | UtilityController.Alive | public function Alive() {
$this->SetData('Success', TRUE);
$this->MasterView = 'empty';
$this->CssClass = 'Home';
$this->FireEvent('Alive');
$this->Render();
} | php | public function Alive() {
$this->SetData('Success', TRUE);
$this->MasterView = 'empty';
$this->CssClass = 'Home';
$this->FireEvent('Alive');
$this->Render();
} | [
"public",
"function",
"Alive",
"(",
")",
"{",
"$",
"this",
"->",
"SetData",
"(",
"'Success'",
",",
"TRUE",
")",
";",
"$",
"this",
"->",
"MasterView",
"=",
"'empty'",
";",
"$",
"this",
"->",
"CssClass",
"=",
"'Home'",
";",
"$",
"this",
"->",
"FireEven... | Signs of life.
@since 2.0.?
@access public | [
"Signs",
"of",
"life",
"."
] | 8494eb4a4ad61603479015a8054d23ff488364e8 | https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/applications/dashboard/controllers/class.utilitycontroller.php#L412-L420 |
6,157 | bishopb/vanilla | applications/dashboard/controllers/class.utilitycontroller.php | UtilityController.GetFeed | public function GetFeed($Type = 'news', $Length = 5, $FeedFormat = 'normal') {
echo file_get_contents('http://vanillaforums.org/vforg/home/getfeed/'.$Type.'/'.$Length.'/'.$FeedFormat.'/?DeliveryType=VIEW');
$this->DeliveryType(DELIVERY_TYPE_NONE);
$this->Render();
} | php | public function GetFeed($Type = 'news', $Length = 5, $FeedFormat = 'normal') {
echo file_get_contents('http://vanillaforums.org/vforg/home/getfeed/'.$Type.'/'.$Length.'/'.$FeedFormat.'/?DeliveryType=VIEW');
$this->DeliveryType(DELIVERY_TYPE_NONE);
$this->Render();
} | [
"public",
"function",
"GetFeed",
"(",
"$",
"Type",
"=",
"'news'",
",",
"$",
"Length",
"=",
"5",
",",
"$",
"FeedFormat",
"=",
"'normal'",
")",
"{",
"echo",
"file_get_contents",
"(",
"'http://vanillaforums.org/vforg/home/getfeed/'",
".",
"$",
"Type",
".",
"'/'",... | Grab a feed from the mothership.
@since 2.0.?
@access public
@param string $Type Type of feed.
@param int $Length Number of items to get.
@param string $FeedFormat How we want it (valid formats are 'normal' or 'sexy'. OK, not really). | [
"Grab",
"a",
"feed",
"from",
"the",
"mothership",
"."
] | 8494eb4a4ad61603479015a8054d23ff488364e8 | https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/applications/dashboard/controllers/class.utilitycontroller.php#L479-L483 |
6,158 | bishopb/vanilla | applications/dashboard/controllers/class.utilitycontroller.php | UtilityController.FetchPageInfo | public function FetchPageInfo($Url = '') {
$PageInfo = FetchPageInfo($Url);
$this->SetData('PageInfo', $PageInfo);
$this->MasterView = 'default';
$this->RemoveCssFile('admin.css');
$this->AddCssFile('style.css');
$this->SetData('_NoPanel', TRUE);
$this->Render();
} | php | public function FetchPageInfo($Url = '') {
$PageInfo = FetchPageInfo($Url);
$this->SetData('PageInfo', $PageInfo);
$this->MasterView = 'default';
$this->RemoveCssFile('admin.css');
$this->AddCssFile('style.css');
$this->SetData('_NoPanel', TRUE);
$this->Render();
} | [
"public",
"function",
"FetchPageInfo",
"(",
"$",
"Url",
"=",
"''",
")",
"{",
"$",
"PageInfo",
"=",
"FetchPageInfo",
"(",
"$",
"Url",
")",
";",
"$",
"this",
"->",
"SetData",
"(",
"'PageInfo'",
",",
"$",
"PageInfo",
")",
";",
"$",
"this",
"->",
"Master... | Return some meta information about any page on the internet in JSON format. | [
"Return",
"some",
"meta",
"information",
"about",
"any",
"page",
"on",
"the",
"internet",
"in",
"JSON",
"format",
"."
] | 8494eb4a4ad61603479015a8054d23ff488364e8 | https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/applications/dashboard/controllers/class.utilitycontroller.php#L488-L496 |
6,159 | ForceLabsDev/framework | src/Traits/Singleton.php | Singleton.getInstance | final public static function getInstance(...$params)
{
$called = static::class;
if (self::$instance instanceof $called) {
return self::$instance;
} else {
return self::$instance = new $called(...$params);
}
} | php | final public static function getInstance(...$params)
{
$called = static::class;
if (self::$instance instanceof $called) {
return self::$instance;
} else {
return self::$instance = new $called(...$params);
}
} | [
"final",
"public",
"static",
"function",
"getInstance",
"(",
"...",
"$",
"params",
")",
"{",
"$",
"called",
"=",
"static",
"::",
"class",
";",
"if",
"(",
"self",
"::",
"$",
"instance",
"instanceof",
"$",
"called",
")",
"{",
"return",
"self",
"::",
"$",... | Dynamic singleton can call a class with parameters.
@param ...$params
@return $this
@throws \ForceLabs\Framework\Debug\BasicException | [
"Dynamic",
"singleton",
"can",
"call",
"a",
"class",
"with",
"parameters",
"."
] | e2288582432857771e85c9859acd6d32e5f2f9b7 | https://github.com/ForceLabsDev/framework/blob/e2288582432857771e85c9859acd6d32e5f2f9b7/src/Traits/Singleton.php#L34-L42 |
6,160 | Sparhandy/CodingStandard | src/phpcs/Production/Sniffs/Commenting/MethodDocBlockSpacingSniff.php | MethodDocBlockSpacingSniff.numberOfLineFeedsBetweenDocBlockAndDeclaration | protected function numberOfLineFeedsBetweenDocBlockAndDeclaration(File $sniffedFile, $indexOfFunctionToken)
{
$indexOfClosingDocBlock = $sniffedFile->findPrevious([T_DOC_COMMENT_CLOSE_TAG], $indexOfFunctionToken);
if ($indexOfClosingDocBlock === false)
{
return false;
}
... | php | protected function numberOfLineFeedsBetweenDocBlockAndDeclaration(File $sniffedFile, $indexOfFunctionToken)
{
$indexOfClosingDocBlock = $sniffedFile->findPrevious([T_DOC_COMMENT_CLOSE_TAG], $indexOfFunctionToken);
if ($indexOfClosingDocBlock === false)
{
return false;
}
... | [
"protected",
"function",
"numberOfLineFeedsBetweenDocBlockAndDeclaration",
"(",
"File",
"$",
"sniffedFile",
",",
"$",
"indexOfFunctionToken",
")",
"{",
"$",
"indexOfClosingDocBlock",
"=",
"$",
"sniffedFile",
"->",
"findPrevious",
"(",
"[",
"T_DOC_COMMENT_CLOSE_TAG",
"]",
... | Counts the linefeeds between a method declaration and its docblock.
@param File $sniffedFile file to be checked
@param int $indexOfFunctionToken position of current token in token list
@return int | [
"Counts",
"the",
"linefeeds",
"between",
"a",
"method",
"declaration",
"and",
"its",
"docblock",
"."
] | 519a0b0a4dc172b118bac1f22a25badfbf993b87 | https://github.com/Sparhandy/CodingStandard/blob/519a0b0a4dc172b118bac1f22a25badfbf993b87/src/phpcs/Production/Sniffs/Commenting/MethodDocBlockSpacingSniff.php#L50-L68 |
6,161 | mintyphp/tools | conventionist.php | Conventionist.pluralize | private static function pluralize($string)
{$plural = array(
array('/(quiz)$/i', "$1zes"),
array('/^(ox)$/i', "$1en"),
array('/([m|l])ouse$/i', "$1ice"),
array('/(matr|vert|ind)ix|ex$/i', "$1ices"),
array('/(x|ch|ss|sh)$/i', "$1es"),
array('/([^aeiouy]|qu)y$/i', "$1ie... | php | private static function pluralize($string)
{$plural = array(
array('/(quiz)$/i', "$1zes"),
array('/^(ox)$/i', "$1en"),
array('/([m|l])ouse$/i', "$1ice"),
array('/(matr|vert|ind)ix|ex$/i', "$1ices"),
array('/(x|ch|ss|sh)$/i', "$1es"),
array('/([^aeiouy]|qu)y$/i', "$1ie... | [
"private",
"static",
"function",
"pluralize",
"(",
"$",
"string",
")",
"{",
"$",
"plural",
"=",
"array",
"(",
"array",
"(",
"'/(quiz)$/i'",
",",
"\"$1zes\"",
")",
",",
"array",
"(",
"'/^(ox)$/i'",
",",
"\"$1en\"",
")",
",",
"array",
"(",
"'/([m|l])ouse$/i'... | who translated it from Ruby from the Rails Inflector class | [
"who",
"translated",
"it",
"from",
"Ruby",
"from",
"the",
"Rails",
"Inflector",
"class"
] | e2ecbc9d5b7aaabf46b8d2473445535defc47696 | https://github.com/mintyphp/tools/blob/e2ecbc9d5b7aaabf46b8d2473445535defc47696/conventionist.php#L99-L155 |
6,162 | narrowspark/automatic-common | Generator/AbstractGenerator.php | AbstractGenerator.generate | public function generate(): void
{
$this->filesystem->mkdir($this->getDirectories());
foreach ($this->getFiles() as $filePath => $fileContent) {
$this->filesystem->dumpFile($filePath, $fileContent);
}
$this->filesystem->remove($this->clean());
} | php | public function generate(): void
{
$this->filesystem->mkdir($this->getDirectories());
foreach ($this->getFiles() as $filePath => $fileContent) {
$this->filesystem->dumpFile($filePath, $fileContent);
}
$this->filesystem->remove($this->clean());
} | [
"public",
"function",
"generate",
"(",
")",
":",
"void",
"{",
"$",
"this",
"->",
"filesystem",
"->",
"mkdir",
"(",
"$",
"this",
"->",
"getDirectories",
"(",
")",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"getFiles",
"(",
")",
"as",
"$",
"filePath"... | Generate the project.
@return void | [
"Generate",
"the",
"project",
"."
] | 415f0d566932847c3ca799e06f27e588bd244881 | https://github.com/narrowspark/automatic-common/blob/415f0d566932847c3ca799e06f27e588bd244881/Generator/AbstractGenerator.php#L56-L65 |
6,163 | lucifurious/kisma | src/Kisma/Core/Tools/DataReader.php | DataReader.nextRowset | public function nextRowset()
{
if ( false !== ( $result = $this->_statement->nextRowset() ) )
{
$this->_index = null;
}
return $result;
} | php | public function nextRowset()
{
if ( false !== ( $result = $this->_statement->nextRowset() ) )
{
$this->_index = null;
}
return $result;
} | [
"public",
"function",
"nextRowset",
"(",
")",
"{",
"if",
"(",
"false",
"!==",
"(",
"$",
"result",
"=",
"$",
"this",
"->",
"_statement",
"->",
"nextRowset",
"(",
")",
")",
")",
"{",
"$",
"this",
"->",
"_index",
"=",
"null",
";",
"}",
"return",
"$",
... | Advances the reader to the next rowset
Not supported by mssql
@return boolean | [
"Advances",
"the",
"reader",
"to",
"the",
"next",
"rowset",
"Not",
"supported",
"by",
"mssql"
] | 4cc9954249da4e535b52f154e728935f07e648ae | https://github.com/lucifurious/kisma/blob/4cc9954249da4e535b52f154e728935f07e648ae/src/Kisma/Core/Tools/DataReader.php#L192-L200 |
6,164 | lucifurious/kisma | src/Kisma/Core/Tools/DataReader.php | DataReader.next | public function next()
{
$this->_row = $this->fetch();
if ( !empty( $this->_row ) )
{
$this->_index++;
}
} | php | public function next()
{
$this->_row = $this->fetch();
if ( !empty( $this->_row ) )
{
$this->_index++;
}
} | [
"public",
"function",
"next",
"(",
")",
"{",
"$",
"this",
"->",
"_row",
"=",
"$",
"this",
"->",
"fetch",
"(",
")",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"_row",
")",
")",
"{",
"$",
"this",
"->",
"_index",
"++",
";",
"}",
"}"
] | Moves the internal pointer to the next row. | [
"Moves",
"the",
"internal",
"pointer",
"to",
"the",
"next",
"row",
"."
] | 4cc9954249da4e535b52f154e728935f07e648ae | https://github.com/lucifurious/kisma/blob/4cc9954249da4e535b52f154e728935f07e648ae/src/Kisma/Core/Tools/DataReader.php#L259-L267 |
6,165 | headzoo/core | src/Headzoo/Core/Objects.php | Objects.getFullName | public static function getFullName($obj)
{
$name = null;
if (is_object($obj)) {
$name = get_class($obj);
} else if (is_string($obj)) {
$name = trim($obj, '\\');
} else {
self::toss(
"InvalidArgument",
"Argument must ... | php | public static function getFullName($obj)
{
$name = null;
if (is_object($obj)) {
$name = get_class($obj);
} else if (is_string($obj)) {
$name = trim($obj, '\\');
} else {
self::toss(
"InvalidArgument",
"Argument must ... | [
"public",
"static",
"function",
"getFullName",
"(",
"$",
"obj",
")",
"{",
"$",
"name",
"=",
"null",
";",
"if",
"(",
"is_object",
"(",
"$",
"obj",
")",
")",
"{",
"$",
"name",
"=",
"get_class",
"(",
"$",
"obj",
")",
";",
"}",
"else",
"if",
"(",
"... | Returns a fully qualified class name
Returns a string containing the fully qualified name of the class. The name is normalized by
removing leading and trailing namespace separators.
The $obj argument may be either an object, or a string. When given a string the value *shout*
be the name of a class, but this method do... | [
"Returns",
"a",
"fully",
"qualified",
"class",
"name"
] | 1e574813e197aa827b3e952f8caa81be31a8b5b5 | https://github.com/headzoo/core/blob/1e574813e197aa827b3e952f8caa81be31a8b5b5/src/Headzoo/Core/Objects.php#L31-L47 |
6,166 | headzoo/core | src/Headzoo/Core/Objects.php | Objects.isObject | public static function isObject($obj)
{
if (is_object($obj)) {
$is_object = true;
} else if (is_array($obj)) {
$reduced = array_filter($obj, function($o) {
return is_object($o);
});
$is_object = count($reduced) == count($obj);
... | php | public static function isObject($obj)
{
if (is_object($obj)) {
$is_object = true;
} else if (is_array($obj)) {
$reduced = array_filter($obj, function($o) {
return is_object($o);
});
$is_object = count($reduced) == count($obj);
... | [
"public",
"static",
"function",
"isObject",
"(",
"$",
"obj",
")",
"{",
"if",
"(",
"is_object",
"(",
"$",
"obj",
")",
")",
"{",
"$",
"is_object",
"=",
"true",
";",
"}",
"else",
"if",
"(",
"is_array",
"(",
"$",
"obj",
")",
")",
"{",
"$",
"reduced",... | Returns whether a value is an object, or array of objects
Returns a boolean value indicating whether the $obj argument is an object, or an array of nothing
but objects. Returns false when $obj is neither an object nor array.
Examples:
```php
$obj = new stdClass();
$is = Objects::isObject($obj);
var_dump($is);
// Out... | [
"Returns",
"whether",
"a",
"value",
"is",
"an",
"object",
"or",
"array",
"of",
"objects"
] | 1e574813e197aa827b3e952f8caa81be31a8b5b5 | https://github.com/headzoo/core/blob/1e574813e197aa827b3e952f8caa81be31a8b5b5/src/Headzoo/Core/Objects.php#L90-L104 |
6,167 | headzoo/core | src/Headzoo/Core/Objects.php | Objects.isInstance | public static function isInstance($obj, $class)
{
if (is_array($obj)) {
$reduced = array_filter($obj, function($o) use($class) {
return self::isInstance($o, $class);
});
$is_instance = count($obj) == count($reduced);
} else {
if... | php | public static function isInstance($obj, $class)
{
if (is_array($obj)) {
$reduced = array_filter($obj, function($o) use($class) {
return self::isInstance($o, $class);
});
$is_instance = count($obj) == count($reduced);
} else {
if... | [
"public",
"static",
"function",
"isInstance",
"(",
"$",
"obj",
",",
"$",
"class",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"obj",
")",
")",
"{",
"$",
"reduced",
"=",
"array_filter",
"(",
"$",
"obj",
",",
"function",
"(",
"$",
"o",
")",
"use",
"... | Returns whether the object, or array of objects, is an instance of a class
Similar to PHP's own instanceof comparison operator, this method differs in two ways:
- The first argument may be an array of objects to test.
- The second argument may be a string with the name of a class.
Throws an exception when $obj is not... | [
"Returns",
"whether",
"the",
"object",
"or",
"array",
"of",
"objects",
"is",
"an",
"instance",
"of",
"a",
"class"
] | 1e574813e197aa827b3e952f8caa81be31a8b5b5 | https://github.com/headzoo/core/blob/1e574813e197aa827b3e952f8caa81be31a8b5b5/src/Headzoo/Core/Objects.php#L169-L187 |
6,168 | headzoo/core | src/Headzoo/Core/Objects.php | Objects.equals | public static function equals($obj_a, $obj_b, $deep = false)
{
$is_equal = false;
if ($obj_a instanceof $obj_b) {
if ($deep) {
$obj_a = ((array)$obj_a);
$obj_b = ((array)$obj_b);
} else {
$obj_a = get_object_vars($obj_a);
... | php | public static function equals($obj_a, $obj_b, $deep = false)
{
$is_equal = false;
if ($obj_a instanceof $obj_b) {
if ($deep) {
$obj_a = ((array)$obj_a);
$obj_b = ((array)$obj_b);
} else {
$obj_a = get_object_vars($obj_a);
... | [
"public",
"static",
"function",
"equals",
"(",
"$",
"obj_a",
",",
"$",
"obj_b",
",",
"$",
"deep",
"=",
"false",
")",
"{",
"$",
"is_equal",
"=",
"false",
";",
"if",
"(",
"$",
"obj_a",
"instanceof",
"$",
"obj_b",
")",
"{",
"if",
"(",
"$",
"deep",
"... | Returns whether two objects are equal to each other
For two objects to be equal they must be of the same class type, and public properties from each
must have the same value. When $deep is true, the protected and private property values must
also be equal. A strict === comparison is done between property values.
Exam... | [
"Returns",
"whether",
"two",
"objects",
"are",
"equal",
"to",
"each",
"other"
] | 1e574813e197aa827b3e952f8caa81be31a8b5b5 | https://github.com/headzoo/core/blob/1e574813e197aa827b3e952f8caa81be31a8b5b5/src/Headzoo/Core/Objects.php#L222-L237 |
6,169 | headzoo/core | src/Headzoo/Core/Objects.php | Objects.merge | public static function merge($obj, $obj2)
{
if (!is_object($obj) || !is_object($obj2)) {
self::toss(
"InvalidArgument",
"Merged values must be objects. Got type {0}.",
gettype($obj)
);
}
if (func_num_args() > 2)... | php | public static function merge($obj, $obj2)
{
if (!is_object($obj) || !is_object($obj2)) {
self::toss(
"InvalidArgument",
"Merged values must be objects. Got type {0}.",
gettype($obj)
);
}
if (func_num_args() > 2)... | [
"public",
"static",
"function",
"merge",
"(",
"$",
"obj",
",",
"$",
"obj2",
")",
"{",
"if",
"(",
"!",
"is_object",
"(",
"$",
"obj",
")",
"||",
"!",
"is_object",
"(",
"$",
"obj2",
")",
")",
"{",
"self",
"::",
"toss",
"(",
"\"InvalidArgument\"",
",",... | Merges two or more objects
Copies the public property values from $obj2 to $obj1, and returns $obj1. Properties from $obj2
are either added to $obj1, or overwrite existing properties with the same name. Null values
do not overwrite non-null values. More than two objects may be merged.
Protected and private properties... | [
"Merges",
"two",
"or",
"more",
"objects"
] | 1e574813e197aa827b3e952f8caa81be31a8b5b5 | https://github.com/headzoo/core/blob/1e574813e197aa827b3e952f8caa81be31a8b5b5/src/Headzoo/Core/Objects.php#L316-L341 |
6,170 | gliverphp/helpers | src/ArrayHelper/ArrayHelperClass.php | ArrayHelperClass.getMethodArgs | public function getMethodArgs($argName){
//check if the argument is already set
if( array_key_exists($argName, $this->methodArgs)){
//return the value of this argument
return $this->methodArgs[$argName];
}
//this argument is not yet set, so return null
else{
//return a null
return null;
}
... | php | public function getMethodArgs($argName){
//check if the argument is already set
if( array_key_exists($argName, $this->methodArgs)){
//return the value of this argument
return $this->methodArgs[$argName];
}
//this argument is not yet set, so return null
else{
//return a null
return null;
}
... | [
"public",
"function",
"getMethodArgs",
"(",
"$",
"argName",
")",
"{",
"//check if the argument is already set",
"if",
"(",
"array_key_exists",
"(",
"$",
"argName",
",",
"$",
"this",
"->",
"methodArgs",
")",
")",
"{",
"//return the value of this argument",
"return",
... | This method gets and returns the value of the arguments requested
@param string $argName The name of the argument to look up
@return mixed The value of the argument or a Boolean False on failure | [
"This",
"method",
"gets",
"and",
"returns",
"the",
"value",
"of",
"the",
"arguments",
"requested"
] | c5204df8169fad55f5b273422e45f56164373ab8 | https://github.com/gliverphp/helpers/blob/c5204df8169fad55f5b273422e45f56164373ab8/src/ArrayHelper/ArrayHelperClass.php#L63-L81 |
6,171 | gliverphp/helpers | src/ArrayHelper/ArrayHelperClass.php | ArrayHelperClass.trim | public function trim($array)
{
//set the $inputElement
$this->inputElement = $array;
//loop the through the array elements removing the whitespaces
$this->outputElement = array_map(function($item){
return trim($item);
}, $array);
//return this self same class
return $this;
} | php | public function trim($array)
{
//set the $inputElement
$this->inputElement = $array;
//loop the through the array elements removing the whitespaces
$this->outputElement = array_map(function($item){
return trim($item);
}, $array);
//return this self same class
return $this;
} | [
"public",
"function",
"trim",
"(",
"$",
"array",
")",
"{",
"//set the $inputElement",
"$",
"this",
"->",
"inputElement",
"=",
"$",
"array",
";",
"//loop the through the array elements removing the whitespaces",
"$",
"this",
"->",
"outputElement",
"=",
"array_map",
"("... | This method loops through array elements removing whitespaces from begining and ending of string element values
@param array $array The input array to be trimmed of whitespace
@return Object \ArrayHelper | [
"This",
"method",
"loops",
"through",
"array",
"elements",
"removing",
"whitespaces",
"from",
"begining",
"and",
"ending",
"of",
"string",
"element",
"values"
] | c5204df8169fad55f5b273422e45f56164373ab8 | https://github.com/gliverphp/helpers/blob/c5204df8169fad55f5b273422e45f56164373ab8/src/ArrayHelper/ArrayHelperClass.php#L209-L224 |
6,172 | gliverphp/helpers | src/ArrayHelper/ArrayHelperClass.php | ArrayHelperClass.flatten | public function flatten($array, $return = array())
{
//loop through the multi-dimensional array flattening the array value
foreach ($array as $key => $value)
{
//flatten is array element is a value or element
if( is_array($value) || is_object($value))
{
//return
$return = self::flatten($value,... | php | public function flatten($array, $return = array())
{
//loop through the multi-dimensional array flattening the array value
foreach ($array as $key => $value)
{
//flatten is array element is a value or element
if( is_array($value) || is_object($value))
{
//return
$return = self::flatten($value,... | [
"public",
"function",
"flatten",
"(",
"$",
"array",
",",
"$",
"return",
"=",
"array",
"(",
")",
")",
"{",
"//loop through the multi-dimensional array flattening the array value",
"foreach",
"(",
"$",
"array",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"//... | This method converts a multi-dimensional array into a uni-dimensional array
@param array $array The array to flatten
@param array $return The return array
@return Object \ArrayHelper | [
"This",
"method",
"converts",
"a",
"multi",
"-",
"dimensional",
"array",
"into",
"a",
"uni",
"-",
"dimensional",
"array"
] | c5204df8169fad55f5b273422e45f56164373ab8 | https://github.com/gliverphp/helpers/blob/c5204df8169fad55f5b273422e45f56164373ab8/src/ArrayHelper/ArrayHelperClass.php#L233-L259 |
6,173 | noccy80/php-virtfs | lib/VirtFs.php | VirtFs.addAutoloader | public function addAutoloader($namespace, $path=null, $psr4=false)
{
$loader = new VirtFsLoader($this);
$loader->register($namespace, $path, $psr4);
$this->pushLoader($loader);
} | php | public function addAutoloader($namespace, $path=null, $psr4=false)
{
$loader = new VirtFsLoader($this);
$loader->register($namespace, $path, $psr4);
$this->pushLoader($loader);
} | [
"public",
"function",
"addAutoloader",
"(",
"$",
"namespace",
",",
"$",
"path",
"=",
"null",
",",
"$",
"psr4",
"=",
"false",
")",
"{",
"$",
"loader",
"=",
"new",
"VirtFsLoader",
"(",
"$",
"this",
")",
";",
"$",
"loader",
"->",
"register",
"(",
"$",
... | Register an autoloader for the virtual filesystem
@param string The namespace to register
@param string The root of the autoloader
@param bool If true, use a psr-4 autoloader, otherwise a psr-0. | [
"Register",
"an",
"autoloader",
"for",
"the",
"virtual",
"filesystem"
] | 480a5e33421b1c81fddf9a4820d5742ebcbfbd7c | https://github.com/noccy80/php-virtfs/blob/480a5e33421b1c81fddf9a4820d5742ebcbfbd7c/lib/VirtFs.php#L71-L76 |
6,174 | noccy80/php-virtfs | lib/VirtFs.php | VirtFs.pushLoader | public function pushLoader(VirtFsLoader $loader)
{
if (!in_array($loader,$this->loaders)) {
$this->loaders[] = $loader;
}
return $this;
} | php | public function pushLoader(VirtFsLoader $loader)
{
if (!in_array($loader,$this->loaders)) {
$this->loaders[] = $loader;
}
return $this;
} | [
"public",
"function",
"pushLoader",
"(",
"VirtFsLoader",
"$",
"loader",
")",
"{",
"if",
"(",
"!",
"in_array",
"(",
"$",
"loader",
",",
"$",
"this",
"->",
"loaders",
")",
")",
"{",
"$",
"this",
"->",
"loaders",
"[",
"]",
"=",
"$",
"loader",
";",
"}"... | Push a VirtFsLoader onto the stack of autoloaders for the virtual filesystem.
@param \NoccyLabs\VirtFs\VirtFsLoader The loader to register
@return \NoccyLabs\VirtFs\VirtFs | [
"Push",
"a",
"VirtFsLoader",
"onto",
"the",
"stack",
"of",
"autoloaders",
"for",
"the",
"virtual",
"filesystem",
"."
] | 480a5e33421b1c81fddf9a4820d5742ebcbfbd7c | https://github.com/noccy80/php-virtfs/blob/480a5e33421b1c81fddf9a4820d5742ebcbfbd7c/lib/VirtFs.php#L84-L90 |
6,175 | noccy80/php-virtfs | lib/VirtFs.php | VirtFs.registerStreamWrapper | public function registerStreamWrapper($protocol=null)
{
if ($this->registered_wrapper) {
throw new \RuntimeException("Unregister the wrapper before registering it again!");
}
if ($protocol && !$this->protocol) {
$this->protocol = $protocol;
}
$this->r... | php | public function registerStreamWrapper($protocol=null)
{
if ($this->registered_wrapper) {
throw new \RuntimeException("Unregister the wrapper before registering it again!");
}
if ($protocol && !$this->protocol) {
$this->protocol = $protocol;
}
$this->r... | [
"public",
"function",
"registerStreamWrapper",
"(",
"$",
"protocol",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"registered_wrapper",
")",
"{",
"throw",
"new",
"\\",
"RuntimeException",
"(",
"\"Unregister the wrapper before registering it again!\"",
")",
"... | Register a protocol as a stream wrapper.
This makes access possible with the regular file i/o functions using
a path such as "protocol://file.txt".
@param string The protocol to register
@return bool
@throws \RuntimeException | [
"Register",
"a",
"protocol",
"as",
"a",
"stream",
"wrapper",
"."
] | 480a5e33421b1c81fddf9a4820d5742ebcbfbd7c | https://github.com/noccy80/php-virtfs/blob/480a5e33421b1c81fddf9a4820d5742ebcbfbd7c/lib/VirtFs.php#L102-L113 |
6,176 | noccy80/php-virtfs | lib/VirtFs.php | VirtFs.addDirectory | public function addDirectory($path, $mountpoint='/', $writable=false, $priority=0) {
$mounter = new Mounter\DirectoryMounter($path, $mountpoint);
$mounter->setPriority($priority);
$mounter->setIsWritable($writable);
$this->nodes[] = $mounter;
return $this;
} | php | public function addDirectory($path, $mountpoint='/', $writable=false, $priority=0) {
$mounter = new Mounter\DirectoryMounter($path, $mountpoint);
$mounter->setPriority($priority);
$mounter->setIsWritable($writable);
$this->nodes[] = $mounter;
return $this;
} | [
"public",
"function",
"addDirectory",
"(",
"$",
"path",
",",
"$",
"mountpoint",
"=",
"'/'",
",",
"$",
"writable",
"=",
"false",
",",
"$",
"priority",
"=",
"0",
")",
"{",
"$",
"mounter",
"=",
"new",
"Mounter",
"\\",
"DirectoryMounter",
"(",
"$",
"path",... | Add a directory to the virtual filesystem.
@param string The directory to mount
@param string The mountpoint in the virtual filesystem
@param bool If true, the directory will be considered a candidate for writing operations.
@param int Priority of this location when matching paths
@return \NoccyLabs\VirtFs\VirtFs | [
"Add",
"a",
"directory",
"to",
"the",
"virtual",
"filesystem",
"."
] | 480a5e33421b1c81fddf9a4820d5742ebcbfbd7c | https://github.com/noccy80/php-virtfs/blob/480a5e33421b1c81fddf9a4820d5742ebcbfbd7c/lib/VirtFs.php#L137-L143 |
6,177 | noccy80/php-virtfs | lib/VirtFs.php | VirtFs.addArchive | public function addArchive($path, $mountpoint='/', $priority=0) {
$mounter = new Mounter\ArchiveMounter($path, $mountpoint);
$mounter->setPriority($priority);
$this->nodes[] = $mounter;
return $this;
} | php | public function addArchive($path, $mountpoint='/', $priority=0) {
$mounter = new Mounter\ArchiveMounter($path, $mountpoint);
$mounter->setPriority($priority);
$this->nodes[] = $mounter;
return $this;
} | [
"public",
"function",
"addArchive",
"(",
"$",
"path",
",",
"$",
"mountpoint",
"=",
"'/'",
",",
"$",
"priority",
"=",
"0",
")",
"{",
"$",
"mounter",
"=",
"new",
"Mounter",
"\\",
"ArchiveMounter",
"(",
"$",
"path",
",",
"$",
"mountpoint",
")",
";",
"$"... | Add an archive to the virtual filesystem
@param string The path to the archive to mount
@param string The mountpoint in the virtual filesystem
@param int Priority of this location when matching paths
@return \NoccyLabs\VirtFs\VirtFs | [
"Add",
"an",
"archive",
"to",
"the",
"virtual",
"filesystem"
] | 480a5e33421b1c81fddf9a4820d5742ebcbfbd7c | https://github.com/noccy80/php-virtfs/blob/480a5e33421b1c81fddf9a4820d5742ebcbfbd7c/lib/VirtFs.php#L153-L158 |
6,178 | noccy80/php-virtfs | lib/VirtFs.php | VirtFs.getDirectoryListing | public function getDirectoryListing($path='/')
{
// 1. find out what is mounted on this path
$listing = array();
foreach($this->nodes as $node) {
$mp = $node->getMountPoint();
if ((dirname($mp) == $path) && ($path != '/')) {
$listing[] = basename($mp).... | php | public function getDirectoryListing($path='/')
{
// 1. find out what is mounted on this path
$listing = array();
foreach($this->nodes as $node) {
$mp = $node->getMountPoint();
if ((dirname($mp) == $path) && ($path != '/')) {
$listing[] = basename($mp).... | [
"public",
"function",
"getDirectoryListing",
"(",
"$",
"path",
"=",
"'/'",
")",
"{",
"// 1. find out what is mounted on this path",
"$",
"listing",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"nodes",
"as",
"$",
"node",
")",
"{",
"$",
"... | Get a directory listing from the virtual filesystem.
@param string The path to get the listing of
@return type | [
"Get",
"a",
"directory",
"listing",
"from",
"the",
"virtual",
"filesystem",
"."
] | 480a5e33421b1c81fddf9a4820d5742ebcbfbd7c | https://github.com/noccy80/php-virtfs/blob/480a5e33421b1c81fddf9a4820d5742ebcbfbd7c/lib/VirtFs.php#L166-L181 |
6,179 | noccy80/php-virtfs | lib/VirtFs.php | VirtFs.getPath | public function getPath($file)
{
$file = "/".ltrim($file,"/");
$best = null;
foreach($this->nodes as $node) {
$mount = $node->getMountPoint();
if (strncmp($mount, $file, strlen($mount)) === 0) {
$nodefile = substr($file, strlen($mount));
... | php | public function getPath($file)
{
$file = "/".ltrim($file,"/");
$best = null;
foreach($this->nodes as $node) {
$mount = $node->getMountPoint();
if (strncmp($mount, $file, strlen($mount)) === 0) {
$nodefile = substr($file, strlen($mount));
... | [
"public",
"function",
"getPath",
"(",
"$",
"file",
")",
"{",
"$",
"file",
"=",
"\"/\"",
".",
"ltrim",
"(",
"$",
"file",
",",
"\"/\"",
")",
";",
"$",
"best",
"=",
"null",
";",
"foreach",
"(",
"$",
"this",
"->",
"nodes",
"as",
"$",
"node",
")",
"... | Get the canonical path to a file in the virtual filesystem.
@param string The file to get the path of
@return string The full path or URI to the file | [
"Get",
"the",
"canonical",
"path",
"to",
"a",
"file",
"in",
"the",
"virtual",
"filesystem",
"."
] | 480a5e33421b1c81fddf9a4820d5742ebcbfbd7c | https://github.com/noccy80/php-virtfs/blob/480a5e33421b1c81fddf9a4820d5742ebcbfbd7c/lib/VirtFs.php#L211-L234 |
6,180 | cblanquera/cradle-captcha | src/Action/Captcha.php | Captcha.render | public function render(Request $request, Response $response) {
$key = $response->getResults('captcha');
$content = $response->getContent();
$content .= '<script src="https://www.google.com/recaptcha/api.js"></script>';
$content .= '<div class="form-group"><div class="g-recaptcha" '
... | php | public function render(Request $request, Response $response) {
$key = $response->getResults('captcha');
$content = $response->getContent();
$content .= '<script src="https://www.google.com/recaptcha/api.js"></script>';
$content .= '<div class="form-group"><div class="g-recaptcha" '
... | [
"public",
"function",
"render",
"(",
"Request",
"$",
"request",
",",
"Response",
"$",
"response",
")",
"{",
"$",
"key",
"=",
"$",
"response",
"->",
"getResults",
"(",
"'captcha'",
")",
";",
"$",
"content",
"=",
"$",
"response",
"->",
"getContent",
"(",
... | Renders a csrf field
@param *Request $request
@param *Response $response
@return Csrf | [
"Renders",
"a",
"csrf",
"field"
] | c0f2c25b0b1d3f55640278ae367bd80abd677219 | https://github.com/cblanquera/cradle-captcha/blob/c0f2c25b0b1d3f55640278ae367bd80abd677219/src/Action/Captcha.php#L143-L153 |
6,181 | vinala/kernel | src/Mailing/Mailable.php | Mailable.view | public function view($name)
{
$this->_view = View::make($name);
$vars = get_object_vars($this);
foreach ($vars as $key => $value) {
if (!in_array($key, ['_view', '_text', '_type', '_subject', '_sender_name', '_sender_mail'])) {
$this->_view->with($key, $value);
... | php | public function view($name)
{
$this->_view = View::make($name);
$vars = get_object_vars($this);
foreach ($vars as $key => $value) {
if (!in_array($key, ['_view', '_text', '_type', '_subject', '_sender_name', '_sender_mail'])) {
$this->_view->with($key, $value);
... | [
"public",
"function",
"view",
"(",
"$",
"name",
")",
"{",
"$",
"this",
"->",
"_view",
"=",
"View",
"::",
"make",
"(",
"$",
"name",
")",
";",
"$",
"vars",
"=",
"get_object_vars",
"(",
"$",
"this",
")",
";",
"foreach",
"(",
"$",
"vars",
"as",
"$",
... | Set the view.
@param string $name
@return $this | [
"Set",
"the",
"view",
"."
] | 346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a | https://github.com/vinala/kernel/blob/346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a/src/Mailing/Mailable.php#L146-L161 |
6,182 | vinala/kernel | src/Mailing/Mailable.php | Mailable.from | public function from($mail, $name)
{
$this->_sender_name = $name;
$this->_sender_mail = $mail;
return $this;
} | php | public function from($mail, $name)
{
$this->_sender_name = $name;
$this->_sender_mail = $mail;
return $this;
} | [
"public",
"function",
"from",
"(",
"$",
"mail",
",",
"$",
"name",
")",
"{",
"$",
"this",
"->",
"_sender_name",
"=",
"$",
"name",
";",
"$",
"this",
"->",
"_sender_mail",
"=",
"$",
"mail",
";",
"return",
"$",
"this",
";",
"}"
] | Set the sender email and name.
@param string $mail
@param string $name
@return $this | [
"Set",
"the",
"sender",
"email",
"and",
"name",
"."
] | 346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a | https://github.com/vinala/kernel/blob/346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a/src/Mailing/Mailable.php#L187-L193 |
6,183 | vinala/kernel | src/Mailing/Mailable.php | Mailable.attachments | public function attachments()
{
$files = func_get_args();
foreach ($files as $file) {
if (is_string($file)) {
$this->_attachments[] = ['file' => $file];
} elseif (is_array($file)) {
foreach ($file as $key => $value) {
$this... | php | public function attachments()
{
$files = func_get_args();
foreach ($files as $file) {
if (is_string($file)) {
$this->_attachments[] = ['file' => $file];
} elseif (is_array($file)) {
foreach ($file as $key => $value) {
$this... | [
"public",
"function",
"attachments",
"(",
")",
"{",
"$",
"files",
"=",
"func_get_args",
"(",
")",
";",
"foreach",
"(",
"$",
"files",
"as",
"$",
"file",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"file",
")",
")",
"{",
"$",
"this",
"->",
"_attachme... | add attachments to the mail.
@return $this | [
"add",
"attachments",
"to",
"the",
"mail",
"."
] | 346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a | https://github.com/vinala/kernel/blob/346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a/src/Mailing/Mailable.php#L214-L229 |
6,184 | vinala/kernel | src/Mailing/Mailable.php | Mailable.attachment | public function attachment($file, $name = null)
{
if (!is_null($name)) {
$this->_attachments[] = ['name' => $key, 'file' => $value];
} else {
$this->_attachments[] = ['file' => $value];
}
return $this;
} | php | public function attachment($file, $name = null)
{
if (!is_null($name)) {
$this->_attachments[] = ['name' => $key, 'file' => $value];
} else {
$this->_attachments[] = ['file' => $value];
}
return $this;
} | [
"public",
"function",
"attachment",
"(",
"$",
"file",
",",
"$",
"name",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"is_null",
"(",
"$",
"name",
")",
")",
"{",
"$",
"this",
"->",
"_attachments",
"[",
"]",
"=",
"[",
"'name'",
"=>",
"$",
"key",
",",
"... | Add attachment to the mail.
@param string $file
@param string $name
@return $this | [
"Add",
"attachment",
"to",
"the",
"mail",
"."
] | 346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a | https://github.com/vinala/kernel/blob/346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a/src/Mailing/Mailable.php#L239-L248 |
6,185 | vinala/kernel | src/Mailing/Mailable.php | Mailable.cc | public function cc()
{
$mails = func_get_args();
foreach ($mails as $mail) {
if (is_string($mail)) {
$this->_cc[] = $mail;
} elseif (is_array($mail)) {
foreach ($mail as $submail) {
$this->_cc[] = $submail;
... | php | public function cc()
{
$mails = func_get_args();
foreach ($mails as $mail) {
if (is_string($mail)) {
$this->_cc[] = $mail;
} elseif (is_array($mail)) {
foreach ($mail as $submail) {
$this->_cc[] = $submail;
... | [
"public",
"function",
"cc",
"(",
")",
"{",
"$",
"mails",
"=",
"func_get_args",
"(",
")",
";",
"foreach",
"(",
"$",
"mails",
"as",
"$",
"mail",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"mail",
")",
")",
"{",
"$",
"this",
"->",
"_cc",
"[",
"]"... | Add Carbon Copy to mailable.
@return $this | [
"Add",
"Carbon",
"Copy",
"to",
"mailable",
"."
] | 346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a | https://github.com/vinala/kernel/blob/346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a/src/Mailing/Mailable.php#L255-L270 |
6,186 | vinala/kernel | src/Mailing/Mailable.php | Mailable.cci | public function cci()
{
$mails = func_get_args();
foreach ($mails as $mail) {
if (is_string($mail)) {
$this->_cci[] = $mail;
} elseif (is_array($mail)) {
foreach ($mail as $submail) {
$this->_cci[] = $submail;
... | php | public function cci()
{
$mails = func_get_args();
foreach ($mails as $mail) {
if (is_string($mail)) {
$this->_cci[] = $mail;
} elseif (is_array($mail)) {
foreach ($mail as $submail) {
$this->_cci[] = $submail;
... | [
"public",
"function",
"cci",
"(",
")",
"{",
"$",
"mails",
"=",
"func_get_args",
"(",
")",
";",
"foreach",
"(",
"$",
"mails",
"as",
"$",
"mail",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"mail",
")",
")",
"{",
"$",
"this",
"->",
"_cci",
"[",
"... | Add Invisble Carbon Copy to mailable.
@return $this | [
"Add",
"Invisble",
"Carbon",
"Copy",
"to",
"mailable",
"."
] | 346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a | https://github.com/vinala/kernel/blob/346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a/src/Mailing/Mailable.php#L277-L292 |
6,187 | samurai-fw/samurai | src/Samurai/Filter/ViewFilter.php | ViewFilter._renderTemplate | private function _renderTemplate($template = null)
{
// when no template, auto generate template path.
// View/Content/[controller]/[action].html.twig
$def = $this->actionChain->getCurrentAction();
if (! $template) {
$controller = join(DS, array_map('ucfirst', explode('_'... | php | private function _renderTemplate($template = null)
{
// when no template, auto generate template path.
// View/Content/[controller]/[action].html.twig
$def = $this->actionChain->getCurrentAction();
if (! $template) {
$controller = join(DS, array_map('ucfirst', explode('_'... | [
"private",
"function",
"_renderTemplate",
"(",
"$",
"template",
"=",
"null",
")",
"{",
"// when no template, auto generate template path.",
"// View/Content/[controller]/[action].html.twig",
"$",
"def",
"=",
"$",
"this",
"->",
"actionChain",
"->",
"getCurrentAction",
"(",
... | rendering template.
@param string $template | [
"rendering",
"template",
"."
] | 7ca3847b13f86e2847a17ab5e8e4e20893021d5a | https://github.com/samurai-fw/samurai/blob/7ca3847b13f86e2847a17ab5e8e4e20893021d5a/src/Samurai/Filter/ViewFilter.php#L130-L148 |
6,188 | samurai-fw/samurai | src/Samurai/Filter/ViewFilter.php | ViewFilter._getResult | private function _getResult()
{
$def = $this->actionChain->getCurrentAction();
$result = $def['result'];
if (! $result) {
return null;
} elseif (is_string($result)) {
return $result;
} elseif (is_array($result)) {
return array_shift($result... | php | private function _getResult()
{
$def = $this->actionChain->getCurrentAction();
$result = $def['result'];
if (! $result) {
return null;
} elseif (is_string($result)) {
return $result;
} elseif (is_array($result)) {
return array_shift($result... | [
"private",
"function",
"_getResult",
"(",
")",
"{",
"$",
"def",
"=",
"$",
"this",
"->",
"actionChain",
"->",
"getCurrentAction",
"(",
")",
";",
"$",
"result",
"=",
"$",
"def",
"[",
"'result'",
"]",
";",
"if",
"(",
"!",
"$",
"result",
")",
"{",
"ret... | Get action result.
@return string
@throw Samurai\Samurai\Exception\Exception | [
"Get",
"action",
"result",
"."
] | 7ca3847b13f86e2847a17ab5e8e4e20893021d5a | https://github.com/samurai-fw/samurai/blob/7ca3847b13f86e2847a17ab5e8e4e20893021d5a/src/Samurai/Filter/ViewFilter.php#L194-L207 |
6,189 | samurai-fw/samurai | src/Samurai/Filter/ViewFilter.php | ViewFilter._getResultData | private function _getResultData()
{
$def = $this->actionChain->getCurrentAction();
$result = $def['result'];
if (is_string($result)) {
return $this->getAttribute($result);
} elseif (is_array($result)) {
return array_pop($result);
} else {
r... | php | private function _getResultData()
{
$def = $this->actionChain->getCurrentAction();
$result = $def['result'];
if (is_string($result)) {
return $this->getAttribute($result);
} elseif (is_array($result)) {
return array_pop($result);
} else {
r... | [
"private",
"function",
"_getResultData",
"(",
")",
"{",
"$",
"def",
"=",
"$",
"this",
"->",
"actionChain",
"->",
"getCurrentAction",
"(",
")",
";",
"$",
"result",
"=",
"$",
"def",
"[",
"'result'",
"]",
";",
"if",
"(",
"is_string",
"(",
"$",
"result",
... | Get action result data.
@access private
@return mixed | [
"Get",
"action",
"result",
"data",
"."
] | 7ca3847b13f86e2847a17ab5e8e4e20893021d5a | https://github.com/samurai-fw/samurai/blob/7ca3847b13f86e2847a17ab5e8e4e20893021d5a/src/Samurai/Filter/ViewFilter.php#L215-L226 |
6,190 | BuildrPHP/Utils | src/Factories/StringFactory.php | StringFactory.create | public static function create($string) {
if(is_array($string)) {
throw new InvalidArgumentException('Arrays cannot be casted to string!');
}
if(is_object($string) &&
!(($string instanceof StringConvertibleInterface) || (method_exists($string, '__toString')))) {
... | php | public static function create($string) {
if(is_array($string)) {
throw new InvalidArgumentException('Arrays cannot be casted to string!');
}
if(is_object($string) &&
!(($string instanceof StringConvertibleInterface) || (method_exists($string, '__toString')))) {
... | [
"public",
"static",
"function",
"create",
"(",
"$",
"string",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"string",
")",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"'Arrays cannot be casted to string!'",
")",
";",
"}",
"if",
"(",
"is_object",
... | Creates a new stringObject class from the given value.
If the given value is an object and is string convertible the object
will be converted to string, before consumed.
@param string $string
@return \BuildR\Utils\StringObject
@throws \BuildR\Foundation\Exception\InvalidArgumentException | [
"Creates",
"a",
"new",
"stringObject",
"class",
"from",
"the",
"given",
"value",
".",
"If",
"the",
"given",
"value",
"is",
"an",
"object",
"and",
"is",
"string",
"convertible",
"the",
"object",
"will",
"be",
"converted",
"to",
"string",
"before",
"consumed",... | e3b1b9e58f3ebc644e1b9f3838c69936812fc53c | https://github.com/BuildrPHP/Utils/blob/e3b1b9e58f3ebc644e1b9f3838c69936812fc53c/src/Factories/StringFactory.php#L33-L45 |
6,191 | praxisnetau/silverware-google | src/Buttons/GoogleSharingButton.php | GoogleSharingButton.getButtonAnnotationOptions | public function getButtonAnnotationOptions()
{
return [
self::ANNOTATION_NONE => _t(__CLASS__ . '.NONE', 'None'),
self::ANNOTATION_BUBBLE => _t(__CLASS__ . '.BUBBLE', 'Bubble'),
self::ANNOTATION_INLINE => _t(__CLASS__ . '.INLINE', 'Inline'),
self::ANNO... | php | public function getButtonAnnotationOptions()
{
return [
self::ANNOTATION_NONE => _t(__CLASS__ . '.NONE', 'None'),
self::ANNOTATION_BUBBLE => _t(__CLASS__ . '.BUBBLE', 'Bubble'),
self::ANNOTATION_INLINE => _t(__CLASS__ . '.INLINE', 'Inline'),
self::ANNO... | [
"public",
"function",
"getButtonAnnotationOptions",
"(",
")",
"{",
"return",
"[",
"self",
"::",
"ANNOTATION_NONE",
"=>",
"_t",
"(",
"__CLASS__",
".",
"'.NONE'",
",",
"'None'",
")",
",",
"self",
"::",
"ANNOTATION_BUBBLE",
"=>",
"_t",
"(",
"__CLASS__",
".",
"'... | Answers an array of options for the button annotation field.
@return array | [
"Answers",
"an",
"array",
"of",
"options",
"for",
"the",
"button",
"annotation",
"field",
"."
] | 573632d33fe99c9d943fec8733fa5bbce57586f5 | https://github.com/praxisnetau/silverware-google/blob/573632d33fe99c9d943fec8733fa5bbce57586f5/src/Buttons/GoogleSharingButton.php#L266-L274 |
6,192 | ekyna/UserBundle | Model/Genders.php | Genders.getChoices | public static function getChoices($long = false)
{
$offset = $long ? 1 : 0;
$choices = [];
foreach (static::getConfig() as $constant => $config) {
$choices[$constant] = $config[$offset];
}
return $choices;
} | php | public static function getChoices($long = false)
{
$offset = $long ? 1 : 0;
$choices = [];
foreach (static::getConfig() as $constant => $config) {
$choices[$constant] = $config[$offset];
}
return $choices;
} | [
"public",
"static",
"function",
"getChoices",
"(",
"$",
"long",
"=",
"false",
")",
"{",
"$",
"offset",
"=",
"$",
"long",
"?",
"1",
":",
"0",
";",
"$",
"choices",
"=",
"[",
"]",
";",
"foreach",
"(",
"static",
"::",
"getConfig",
"(",
")",
"as",
"$"... | Returns the constant choices.
@param bool $long
@return array | [
"Returns",
"the",
"constant",
"choices",
"."
] | e38d56aee978148a312a923b9e70bdaad1a381bf | https://github.com/ekyna/UserBundle/blob/e38d56aee978148a312a923b9e70bdaad1a381bf/Model/Genders.php#L39-L47 |
6,193 | ekyna/UserBundle | Model/Genders.php | Genders.getLabel | public static function getLabel($constant, $long = false)
{
static::isValid($constant, true);
return static::getConfig()[$constant][$long ? 1 : 0];
} | php | public static function getLabel($constant, $long = false)
{
static::isValid($constant, true);
return static::getConfig()[$constant][$long ? 1 : 0];
} | [
"public",
"static",
"function",
"getLabel",
"(",
"$",
"constant",
",",
"$",
"long",
"=",
"false",
")",
"{",
"static",
"::",
"isValid",
"(",
"$",
"constant",
",",
"true",
")",
";",
"return",
"static",
"::",
"getConfig",
"(",
")",
"[",
"$",
"constant",
... | Returns the label for the given constant.
@param mixed $constant
@param bool $long
@return string | [
"Returns",
"the",
"label",
"for",
"the",
"given",
"constant",
"."
] | e38d56aee978148a312a923b9e70bdaad1a381bf | https://github.com/ekyna/UserBundle/blob/e38d56aee978148a312a923b9e70bdaad1a381bf/Model/Genders.php#L56-L61 |
6,194 | newscoop/newscoop-api-php-sdk | src/Newscoop/API/Client.php | Client.makeRequest | public function makeRequest($path, $params)
{
$this->dispatcher->dispatch('api.createUri',
new GenericEvent($this, array(
'path' => $path,
'params' => $params
))
);
$this->response = $this->browser->get($this->getUri());
... | php | public function makeRequest($path, $params)
{
$this->dispatcher->dispatch('api.createUri',
new GenericEvent($this, array(
'path' => $path,
'params' => $params
))
);
$this->response = $this->browser->get($this->getUri());
... | [
"public",
"function",
"makeRequest",
"(",
"$",
"path",
",",
"$",
"params",
")",
"{",
"$",
"this",
"->",
"dispatcher",
"->",
"dispatch",
"(",
"'api.createUri'",
",",
"new",
"GenericEvent",
"(",
"$",
"this",
",",
"array",
"(",
"'path'",
"=>",
"$",
"path",
... | Make request to resource
@return object Client | [
"Make",
"request",
"to",
"resource"
] | 841c3d2bdcef32cf26b87bd5fdade2ec9243111a | https://github.com/newscoop/newscoop-api-php-sdk/blob/841c3d2bdcef32cf26b87bd5fdade2ec9243111a/src/Newscoop/API/Client.php#L143-L160 |
6,195 | Flowpack/Flowpack.SingleSignOn.Client | Classes/Flowpack/SingleSignOn/Client/Service/SimpleGlobalAccountMapper.php | SimpleGlobalAccountMapper.mapParty | protected function mapParty(array $source) {
if (!isset($source['__type'])) {
throw new Exception('Cannot map party without explicit type (server should return "__type" in party account data):' . json_encode($source), 1354111717);
}
$partyType = $source['__type'];
unset($source['__type']);
if (isset($this-... | php | protected function mapParty(array $source) {
if (!isset($source['__type'])) {
throw new Exception('Cannot map party without explicit type (server should return "__type" in party account data):' . json_encode($source), 1354111717);
}
$partyType = $source['__type'];
unset($source['__type']);
if (isset($this-... | [
"protected",
"function",
"mapParty",
"(",
"array",
"$",
"source",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"source",
"[",
"'__type'",
"]",
")",
")",
"{",
"throw",
"new",
"Exception",
"(",
"'Cannot map party without explicit type (server should return \"__type\... | Map the party from the given source data
@param array $source
@return \TYPO3\Party\Domain\Model\AbstractParty | [
"Map",
"the",
"party",
"from",
"the",
"given",
"source",
"data"
] | 0512b66bba7cf31fd03c9608a1e4c67a7c1c0e00 | https://github.com/Flowpack/Flowpack.SingleSignOn.Client/blob/0512b66bba7cf31fd03c9608a1e4c67a7c1c0e00/Classes/Flowpack/SingleSignOn/Client/Service/SimpleGlobalAccountMapper.php#L71-L85 |
6,196 | jakecleary/ultrapress-library | src/Ultra/Mutator/Mutator.php | Mutator.with | public function with(array $data)
{
foreach($data as $method)
{
if(method_exists($this, $method))
{
$this->$method();
}
elseif(taxonomy_exists($method))
{
$this->taxonomy($method);
}
e... | php | public function with(array $data)
{
foreach($data as $method)
{
if(method_exists($this, $method))
{
$this->$method();
}
elseif(taxonomy_exists($method))
{
$this->taxonomy($method);
}
e... | [
"public",
"function",
"with",
"(",
"array",
"$",
"data",
")",
"{",
"foreach",
"(",
"$",
"data",
"as",
"$",
"method",
")",
"{",
"if",
"(",
"method_exists",
"(",
"$",
"this",
",",
"$",
"method",
")",
")",
"{",
"$",
"this",
"->",
"$",
"method",
"(",... | Set which data to include in the data object, additionally
search for an available ACF field if a method can't be
found directly.
@param array $data An array of meta-data slugs
@return Ultra\Mutator\Mutator The mutated data object | [
"Set",
"which",
"data",
"to",
"include",
"in",
"the",
"data",
"object",
"additionally",
"search",
"for",
"an",
"available",
"ACF",
"field",
"if",
"a",
"method",
"can",
"t",
"be",
"found",
"directly",
"."
] | 84ca5d1dae8eb16de8c886787575ea41f9332ae2 | https://github.com/jakecleary/ultrapress-library/blob/84ca5d1dae8eb16de8c886787575ea41f9332ae2/src/Ultra/Mutator/Mutator.php#L38-L57 |
6,197 | jakecleary/ultrapress-library | src/Ultra/Mutator/Mutator.php | Mutator.trim | public function trim(array $namespaces)
{
foreach($this->data as $post)
{
$this->removeNamespace($post, $namespaces);
}
return $this;
} | php | public function trim(array $namespaces)
{
foreach($this->data as $post)
{
$this->removeNamespace($post, $namespaces);
}
return $this;
} | [
"public",
"function",
"trim",
"(",
"array",
"$",
"namespaces",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"data",
"as",
"$",
"post",
")",
"{",
"$",
"this",
"->",
"removeNamespace",
"(",
"$",
"post",
",",
"$",
"namespaces",
")",
";",
"}",
"return",
... | Trim surplus namespaces from array keys.
@param array $namespaces The namespaces to remove
@return Ultra\Mutator\Mutator | [
"Trim",
"surplus",
"namespaces",
"from",
"array",
"keys",
"."
] | 84ca5d1dae8eb16de8c886787575ea41f9332ae2 | https://github.com/jakecleary/ultrapress-library/blob/84ca5d1dae8eb16de8c886787575ea41f9332ae2/src/Ultra/Mutator/Mutator.php#L65-L73 |
6,198 | jakecleary/ultrapress-library | src/Ultra/Mutator/Mutator.php | Mutator.author | public function author()
{
foreach($this->data as $post)
{
$id = $post->author;
$author = get_userdata($id);
$avatar = get_field('author_avatar', 'user_' . $id);
$banner = get_field('author_banner', 'user_' . $id);
$author = (object) [
... | php | public function author()
{
foreach($this->data as $post)
{
$id = $post->author;
$author = get_userdata($id);
$avatar = get_field('author_avatar', 'user_' . $id);
$banner = get_field('author_banner', 'user_' . $id);
$author = (object) [
... | [
"public",
"function",
"author",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"data",
"as",
"$",
"post",
")",
"{",
"$",
"id",
"=",
"$",
"post",
"->",
"author",
";",
"$",
"author",
"=",
"get_userdata",
"(",
"$",
"id",
")",
";",
"$",
"avatar",
... | Include the author display name in the post object.
@return Ultra\Mutator\Mutator The mutated data object | [
"Include",
"the",
"author",
"display",
"name",
"in",
"the",
"post",
"object",
"."
] | 84ca5d1dae8eb16de8c886787575ea41f9332ae2 | https://github.com/jakecleary/ultrapress-library/blob/84ca5d1dae8eb16de8c886787575ea41f9332ae2/src/Ultra/Mutator/Mutator.php#L80-L103 |
6,199 | jakecleary/ultrapress-library | src/Ultra/Mutator/Mutator.php | Mutator.taxonomy | public function taxonomy($name)
{
foreach($this->data as $post)
{
$terms = get_the_terms($post->ID, $name);
if(!empty($terms))
{
$term = array_values($terms)[0];
$post->$name = (object) [
'name' => $term->name,... | php | public function taxonomy($name)
{
foreach($this->data as $post)
{
$terms = get_the_terms($post->ID, $name);
if(!empty($terms))
{
$term = array_values($terms)[0];
$post->$name = (object) [
'name' => $term->name,... | [
"public",
"function",
"taxonomy",
"(",
"$",
"name",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"data",
"as",
"$",
"post",
")",
"{",
"$",
"terms",
"=",
"get_the_terms",
"(",
"$",
"post",
"->",
"ID",
",",
"$",
"name",
")",
";",
"if",
"(",
"!",
... | Include the first taxonomy term name in the post object.
@param string $name The taxonomy name
@return Ultra\Mutator\Mutator The mutated data object | [
"Include",
"the",
"first",
"taxonomy",
"term",
"name",
"in",
"the",
"post",
"object",
"."
] | 84ca5d1dae8eb16de8c886787575ea41f9332ae2 | https://github.com/jakecleary/ultrapress-library/blob/84ca5d1dae8eb16de8c886787575ea41f9332ae2/src/Ultra/Mutator/Mutator.php#L111-L129 |
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.