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 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
iRipVanWinkle/codeception-migration | src/Migration.php | Migration.runMigrationByPaths | protected function runMigrationByPaths($migrationPaths, $command)
{
$app = $this->mockApplication();
$this->validateMigrationPaths($migrationPaths);
/* @todo: since version 2.0.12 you may also specify an array of migration paths. */
foreach ($migrationPaths as $migrationPath) {
... | php | protected function runMigrationByPaths($migrationPaths, $command)
{
$app = $this->mockApplication();
$this->validateMigrationPaths($migrationPaths);
/* @todo: since version 2.0.12 you may also specify an array of migration paths. */
foreach ($migrationPaths as $migrationPath) {
... | [
"protected",
"function",
"runMigrationByPaths",
"(",
"$",
"migrationPaths",
",",
"$",
"command",
")",
"{",
"$",
"app",
"=",
"$",
"this",
"->",
"mockApplication",
"(",
")",
";",
"$",
"this",
"->",
"validateMigrationPaths",
"(",
"$",
"migrationPaths",
")",
";"... | Run migration by paths
@param array $migrationPaths
@param $command
@throws ExtensionException | [
"Run",
"migration",
"by",
"paths"
] | 1cc0bf4167ec9b0cf6590b1b687570b323d3f5d0 | https://github.com/iRipVanWinkle/codeception-migration/blob/1cc0bf4167ec9b0cf6590b1b687570b323d3f5d0/src/Migration.php#L100-L115 | train |
iRipVanWinkle/codeception-migration | src/Migration.php | Migration.validateMigrationPaths | protected function validateMigrationPaths($migrationPaths)
{
foreach ($migrationPaths as $migrationPath) {
$path = \Yii::getAlias($migrationPath, false);
if ($path === false) {
throw new ExtensionException(
__CLASS__,
"Invalid path ... | php | protected function validateMigrationPaths($migrationPaths)
{
foreach ($migrationPaths as $migrationPath) {
$path = \Yii::getAlias($migrationPath, false);
if ($path === false) {
throw new ExtensionException(
__CLASS__,
"Invalid path ... | [
"protected",
"function",
"validateMigrationPaths",
"(",
"$",
"migrationPaths",
")",
"{",
"foreach",
"(",
"$",
"migrationPaths",
"as",
"$",
"migrationPath",
")",
"{",
"$",
"path",
"=",
"\\",
"Yii",
"::",
"getAlias",
"(",
"$",
"migrationPath",
",",
"false",
")... | Validate Migration Path
@param string $migrationPath
@throws ExtensionException | [
"Validate",
"Migration",
"Path"
] | 1cc0bf4167ec9b0cf6590b1b687570b323d3f5d0 | https://github.com/iRipVanWinkle/codeception-migration/blob/1cc0bf4167ec9b0cf6590b1b687570b323d3f5d0/src/Migration.php#L122-L140 | train |
iRipVanWinkle/codeception-migration | src/Migration.php | Migration.runMigrationByNamespaces | protected function runMigrationByNamespaces($migrationNamespaces, $command)
{
$app = $this->mockApplication();
$migrateController = $this->buildMigration($app);
$migrateController->migrationNamespaces = $migrationNamespaces;
$this->runMigration($migrateController, $command);
... | php | protected function runMigrationByNamespaces($migrationNamespaces, $command)
{
$app = $this->mockApplication();
$migrateController = $this->buildMigration($app);
$migrateController->migrationNamespaces = $migrationNamespaces;
$this->runMigration($migrateController, $command);
... | [
"protected",
"function",
"runMigrationByNamespaces",
"(",
"$",
"migrationNamespaces",
",",
"$",
"command",
")",
"{",
"$",
"app",
"=",
"$",
"this",
"->",
"mockApplication",
"(",
")",
";",
"$",
"migrateController",
"=",
"$",
"this",
"->",
"buildMigration",
"(",
... | Run migration by namespaces
@param array $migrationNamespaces
@param string $command either `up` or `down` | [
"Run",
"migration",
"by",
"namespaces"
] | 1cc0bf4167ec9b0cf6590b1b687570b323d3f5d0 | https://github.com/iRipVanWinkle/codeception-migration/blob/1cc0bf4167ec9b0cf6590b1b687570b323d3f5d0/src/Migration.php#L147-L157 | train |
iRipVanWinkle/codeception-migration | src/Migration.php | Migration.runMigrationByApplication | protected function runMigrationByApplication($command)
{
$app = $this->mockApplication();
list($migrateController, $route) = $app->createController('migrate');
if ($migrateController === null) {
throw new ExtensionException(
__CLASS__,
"At least one ... | php | protected function runMigrationByApplication($command)
{
$app = $this->mockApplication();
list($migrateController, $route) = $app->createController('migrate');
if ($migrateController === null) {
throw new ExtensionException(
__CLASS__,
"At least one ... | [
"protected",
"function",
"runMigrationByApplication",
"(",
"$",
"command",
")",
"{",
"$",
"app",
"=",
"$",
"this",
"->",
"mockApplication",
"(",
")",
";",
"list",
"(",
"$",
"migrateController",
",",
"$",
"route",
")",
"=",
"$",
"app",
"->",
"createControll... | Run migration from app config
@param string $command either `up` or `down` | [
"Run",
"migration",
"from",
"app",
"config"
] | 1cc0bf4167ec9b0cf6590b1b687570b323d3f5d0 | https://github.com/iRipVanWinkle/codeception-migration/blob/1cc0bf4167ec9b0cf6590b1b687570b323d3f5d0/src/Migration.php#L163-L184 | train |
iRipVanWinkle/codeception-migration | src/Migration.php | Migration.mockApplication | protected function mockApplication()
{
$entryUrl = $this->config['entryUrl'];
$entryFile = $this->config['entryScript'] ?: basename($entryUrl);
$entryScript = $this->config['entryScript'] ?: parse_url($entryUrl, PHP_URL_PATH);
$this->client = new Yii2Connector();
$this->clien... | php | protected function mockApplication()
{
$entryUrl = $this->config['entryUrl'];
$entryFile = $this->config['entryScript'] ?: basename($entryUrl);
$entryScript = $this->config['entryScript'] ?: parse_url($entryUrl, PHP_URL_PATH);
$this->client = new Yii2Connector();
$this->clien... | [
"protected",
"function",
"mockApplication",
"(",
")",
"{",
"$",
"entryUrl",
"=",
"$",
"this",
"->",
"config",
"[",
"'entryUrl'",
"]",
";",
"$",
"entryFile",
"=",
"$",
"this",
"->",
"config",
"[",
"'entryScript'",
"]",
"?",
":",
"basename",
"(",
"$",
"e... | Mocks up the application instance.
@return \yii\web\Application|\yii\console\Application the application instance
@throws InvalidConfigException if the application configuration is invalid | [
"Mocks",
"up",
"the",
"application",
"instance",
"."
] | 1cc0bf4167ec9b0cf6590b1b687570b323d3f5d0 | https://github.com/iRipVanWinkle/codeception-migration/blob/1cc0bf4167ec9b0cf6590b1b687570b323d3f5d0/src/Migration.php#L222-L239 | train |
agentmedia/phine-core | src/Core/Modules/Backend/MemberForm.php | MemberForm.AddEMailField | private function AddEMailField()
{
$name = 'EMail';
$this->AddField(Input::Text($name, $this->member->GetEMail()));
$this->SetRequired($name);
$this->AddValidator($name, PhpFilter::EMail());
$this->AddValidator($name, DatabaseCount::UniqueField($this->member, $name));
} | php | private function AddEMailField()
{
$name = 'EMail';
$this->AddField(Input::Text($name, $this->member->GetEMail()));
$this->SetRequired($name);
$this->AddValidator($name, PhpFilter::EMail());
$this->AddValidator($name, DatabaseCount::UniqueField($this->member, $name));
} | [
"private",
"function",
"AddEMailField",
"(",
")",
"{",
"$",
"name",
"=",
"'EMail'",
";",
"$",
"this",
"->",
"AddField",
"(",
"Input",
"::",
"Text",
"(",
"$",
"name",
",",
"$",
"this",
"->",
"member",
"->",
"GetEMail",
"(",
")",
")",
")",
";",
"$",
... | Adds the email field to the form | [
"Adds",
"the",
"email",
"field",
"to",
"the",
"form"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Modules/Backend/MemberForm.php#L67-L74 | train |
agentmedia/phine-core | src/Core/Modules/Backend/MemberForm.php | MemberForm.AddPasswordField | private function AddPasswordField()
{
$name = 'Password';
$this->AddField(Input::Password($name));
if (!$this->member->Exists())
{
$this->SetRequired($name);
}
$this->AddValidator($name, StringLength::MinLength(6));
$this->SetTransAttribut... | php | private function AddPasswordField()
{
$name = 'Password';
$this->AddField(Input::Password($name));
if (!$this->member->Exists())
{
$this->SetRequired($name);
}
$this->AddValidator($name, StringLength::MinLength(6));
$this->SetTransAttribut... | [
"private",
"function",
"AddPasswordField",
"(",
")",
"{",
"$",
"name",
"=",
"'Password'",
";",
"$",
"this",
"->",
"AddField",
"(",
"Input",
"::",
"Password",
"(",
"$",
"name",
")",
")",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"member",
"->",
"Exists"... | Adds the password field to the form | [
"Adds",
"the",
"password",
"field",
"to",
"the",
"form"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Modules/Backend/MemberForm.php#L79-L90 | train |
agentmedia/phine-core | src/Core/Modules/Backend/MemberForm.php | MemberForm.OnSuccess | protected function OnSuccess()
{
$action = $this->member->Exists() ? Action::Update() : Action::Create();
$this->member->SetName($this->Value('Name'));
$this->member->SetEMail($this->Value('EMail'));
$this->SetPassword();
$this->member->Save();
$logger = new Logger(se... | php | protected function OnSuccess()
{
$action = $this->member->Exists() ? Action::Update() : Action::Create();
$this->member->SetName($this->Value('Name'));
$this->member->SetEMail($this->Value('EMail'));
$this->SetPassword();
$this->member->Save();
$logger = new Logger(se... | [
"protected",
"function",
"OnSuccess",
"(",
")",
"{",
"$",
"action",
"=",
"$",
"this",
"->",
"member",
"->",
"Exists",
"(",
")",
"?",
"Action",
"::",
"Update",
"(",
")",
":",
"Action",
"::",
"Create",
"(",
")",
";",
"$",
"this",
"->",
"member",
"->"... | Saves the user | [
"Saves",
"the",
"user"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Modules/Backend/MemberForm.php#L106-L120 | train |
agentmedia/phine-core | src/Core/Modules/Backend/MemberForm.php | MemberForm.DeleteOldGroups | private function DeleteOldGroups(array $selGroupIDs)
{
$tblMmg = MemberMembergroup::Schema()->Table();
$sql = Access::SqlBuilder();
$where = $sql->Equals($tblMmg->Field('Member'), $sql->Value($this->member->GetID()));
if (count($selGroupIDs) > 0)
{
$selectedList =... | php | private function DeleteOldGroups(array $selGroupIDs)
{
$tblMmg = MemberMembergroup::Schema()->Table();
$sql = Access::SqlBuilder();
$where = $sql->Equals($tblMmg->Field('Member'), $sql->Value($this->member->GetID()));
if (count($selGroupIDs) > 0)
{
$selectedList =... | [
"private",
"function",
"DeleteOldGroups",
"(",
"array",
"$",
"selGroupIDs",
")",
"{",
"$",
"tblMmg",
"=",
"MemberMembergroup",
"::",
"Schema",
"(",
")",
"->",
"Table",
"(",
")",
";",
"$",
"sql",
"=",
"Access",
"::",
"SqlBuilder",
"(",
")",
";",
"$",
"w... | Deletes the unselected group ids
@param array $exGroupIDs Currently assigned group ids
@param array $selGroupIDs Selected group ids | [
"Deletes",
"the",
"unselected",
"group",
"ids"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Modules/Backend/MemberForm.php#L159-L170 | train |
agentmedia/phine-core | src/Core/Modules/Backend/MemberForm.php | MemberForm.SaveNewGroups | private function SaveNewGroups(array $exGroupIDs, array $selGroupIDs)
{
foreach ($selGroupIDs as $selGroupID)
{
if (!in_array($selGroupID, $exGroupIDs))
{
$mmg = new MemberMembergroup();
$mmg->SetMember($this->member);
$mmg->Set... | php | private function SaveNewGroups(array $exGroupIDs, array $selGroupIDs)
{
foreach ($selGroupIDs as $selGroupID)
{
if (!in_array($selGroupID, $exGroupIDs))
{
$mmg = new MemberMembergroup();
$mmg->SetMember($this->member);
$mmg->Set... | [
"private",
"function",
"SaveNewGroups",
"(",
"array",
"$",
"exGroupIDs",
",",
"array",
"$",
"selGroupIDs",
")",
"{",
"foreach",
"(",
"$",
"selGroupIDs",
"as",
"$",
"selGroupID",
")",
"{",
"if",
"(",
"!",
"in_array",
"(",
"$",
"selGroupID",
",",
"$",
"exG... | Saves the new groups
@param array $exGroupIDs
@param array $selGroupIDs | [
"Saves",
"the",
"new",
"groups"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Modules/Backend/MemberForm.php#L176-L188 | train |
indigoram89/laravel-fields | src/Field.php | Field.setDefaultValue | public function setDefaultValue($value = null)
{
if (! $this->value) {
if ($value = $value ?: config("fields.values.{$this->key}")) {
foreach ((array) $value as $locale => $translation) {
$locale = is_string($locale) ? $locale : $this->getDefaultLocale();
... | php | public function setDefaultValue($value = null)
{
if (! $this->value) {
if ($value = $value ?: config("fields.values.{$this->key}")) {
foreach ((array) $value as $locale => $translation) {
$locale = is_string($locale) ? $locale : $this->getDefaultLocale();
... | [
"public",
"function",
"setDefaultValue",
"(",
"$",
"value",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"value",
")",
"{",
"if",
"(",
"$",
"value",
"=",
"$",
"value",
"?",
":",
"config",
"(",
"\"fields.values.{$this->key}\"",
")",
")",
... | Check if value is not set and set it.
@param string|array|null $value
@return void | [
"Check",
"if",
"value",
"is",
"not",
"set",
"and",
"set",
"it",
"."
] | 1cb34eb4e653b82577531951ed94bd73a1009112 | https://github.com/indigoram89/laravel-fields/blob/1cb34eb4e653b82577531951ed94bd73a1009112/src/Field.php#L39-L50 | train |
indigoram89/laravel-fields | src/Field.php | Field.setDefaultDescription | public function setDefaultDescription($description = null)
{
if (! $this->description) {
$description = $description ?: config("fields.descriptions.{$this->key}", ucfirst($this->key));
foreach ((array) $description as $locale => $translation) {
$locale = is_string($lo... | php | public function setDefaultDescription($description = null)
{
if (! $this->description) {
$description = $description ?: config("fields.descriptions.{$this->key}", ucfirst($this->key));
foreach ((array) $description as $locale => $translation) {
$locale = is_string($lo... | [
"public",
"function",
"setDefaultDescription",
"(",
"$",
"description",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"description",
")",
"{",
"$",
"description",
"=",
"$",
"description",
"?",
":",
"config",
"(",
"\"fields.descriptions.{$this->key}... | Check if description is not set and set it.
@param string|array|null $description
@return void | [
"Check",
"if",
"description",
"is",
"not",
"set",
"and",
"set",
"it",
"."
] | 1cb34eb4e653b82577531951ed94bd73a1009112 | https://github.com/indigoram89/laravel-fields/blob/1cb34eb4e653b82577531951ed94bd73a1009112/src/Field.php#L58-L67 | train |
indigoram89/laravel-fields | src/Field.php | Field.addTranslated | public function addTranslated(string $locale)
{
if ($this->isDefaultLocale($locale)) {
$this->translated = [$locale];
} else {
$translated = $this->getTranslated();
$translated[] = $locale;
$this->translated = array_unique($translated);
}
} | php | public function addTranslated(string $locale)
{
if ($this->isDefaultLocale($locale)) {
$this->translated = [$locale];
} else {
$translated = $this->getTranslated();
$translated[] = $locale;
$this->translated = array_unique($translated);
}
} | [
"public",
"function",
"addTranslated",
"(",
"string",
"$",
"locale",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isDefaultLocale",
"(",
"$",
"locale",
")",
")",
"{",
"$",
"this",
"->",
"translated",
"=",
"[",
"$",
"locale",
"]",
";",
"}",
"else",
"{",
... | Set translated locale.
@param string $locale
@return void | [
"Set",
"translated",
"locale",
"."
] | 1cb34eb4e653b82577531951ed94bd73a1009112 | https://github.com/indigoram89/laravel-fields/blob/1cb34eb4e653b82577531951ed94bd73a1009112/src/Field.php#L85-L94 | train |
koolkode/http | src/Http.php | Http.normalizeHeaderName | public static function normalizeHeaderName($name)
{
return preg_replace_callback("'-[a-z]'", function($m) {
return strtoupper($m[0]);
}, ucfirst(strtolower(trim($name))));
} | php | public static function normalizeHeaderName($name)
{
return preg_replace_callback("'-[a-z]'", function($m) {
return strtoupper($m[0]);
}, ucfirst(strtolower(trim($name))));
} | [
"public",
"static",
"function",
"normalizeHeaderName",
"(",
"$",
"name",
")",
"{",
"return",
"preg_replace_callback",
"(",
"\"'-[a-z]'\"",
",",
"function",
"(",
"$",
"m",
")",
"{",
"return",
"strtoupper",
"(",
"$",
"m",
"[",
"0",
"]",
")",
";",
"}",
",",... | Normalize an HTTP header name by capitalizing the first letter and all letters
preceeded by a dash.
@param string $name
@return string | [
"Normalize",
"an",
"HTTP",
"header",
"name",
"by",
"capitalizing",
"the",
"first",
"letter",
"and",
"all",
"letters",
"preceeded",
"by",
"a",
"dash",
"."
] | 3c1626d409d5ce5d71d26f0e8f31ae3683a2a966 | https://github.com/koolkode/http/blob/3c1626d409d5ce5d71d26f0e8f31ae3683a2a966/src/Http.php#L834-L839 | train |
p2made/yii2-p2y2-base | assets/P2AssetBase.php | P2AssetBase.useStatic | protected static function useStatic()
{
if(isset(self::$_useStatic)) {
return self::$_useStatic;
}
self::$_useStatic = AssetsSettings::assetsUseStatic();
return self::$_useStatic;
} | php | protected static function useStatic()
{
if(isset(self::$_useStatic)) {
return self::$_useStatic;
}
self::$_useStatic = AssetsSettings::assetsUseStatic();
return self::$_useStatic;
} | [
"protected",
"static",
"function",
"useStatic",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"self",
"::",
"$",
"_useStatic",
")",
")",
"{",
"return",
"self",
"::",
"$",
"_useStatic",
";",
"}",
"self",
"::",
"$",
"_useStatic",
"=",
"AssetsSettings",
"::",
"... | Get useStatic setting - use static resources
@return boolean
@default false | [
"Get",
"useStatic",
"setting",
"-",
"use",
"static",
"resources"
] | face3df8794407cdc8178ed64c06cc760c449de2 | https://github.com/p2made/yii2-p2y2-base/blob/face3df8794407cdc8178ed64c06cc760c449de2/assets/P2AssetBase.php#L215-L224 | train |
ezra-obiwale/dSCore | src/Core/AController.php | AController.setView | final public function setView(View $view) {
$this->view = $view;
if (!$this->initializedView) {
$this->initializedView = true;
$this->init();
}
return $this;
} | php | final public function setView(View $view) {
$this->view = $view;
if (!$this->initializedView) {
$this->initializedView = true;
$this->init();
}
return $this;
} | [
"final",
"public",
"function",
"setView",
"(",
"View",
"$",
"view",
")",
"{",
"$",
"this",
"->",
"view",
"=",
"$",
"view",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"initializedView",
")",
"{",
"$",
"this",
"->",
"initializedView",
"=",
"true",
";",
... | Sets the view instance to use
@param View $view
@return AController | [
"Sets",
"the",
"view",
"instance",
"to",
"use"
] | dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d | https://github.com/ezra-obiwale/dSCore/blob/dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d/src/Core/AController.php#L44-L51 | train |
ezra-obiwale/dSCore | src/Core/AController.php | AController.resetUserIdentity | final protected function resetUserIdentity(AUser $user = null, $duration = null) {
engine('resetUserIdentity', $user, $duration);
return $this;
} | php | final protected function resetUserIdentity(AUser $user = null, $duration = null) {
engine('resetUserIdentity', $user, $duration);
return $this;
} | [
"final",
"protected",
"function",
"resetUserIdentity",
"(",
"AUser",
"$",
"user",
"=",
"null",
",",
"$",
"duration",
"=",
"null",
")",
"{",
"engine",
"(",
"'resetUserIdentity'",
",",
"$",
"user",
",",
"$",
"duration",
")",
";",
"return",
"$",
"this",
";"... | Resets the user identity to guest
@param AUser $user
@param int $duration Duration for which the identity should be valid
@return AController | [
"Resets",
"the",
"user",
"identity",
"to",
"guest"
] | dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d | https://github.com/ezra-obiwale/dSCore/blob/dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d/src/Core/AController.php#L88-L91 | train |
ezra-obiwale/dSCore | src/Core/AController.php | AController.prepareInject | final protected function prepareInject() {
$service = $this->getModule() . '\Services\\' . $this->getClassName() . 'Service';
if (class_exists($service)) {
return array_merge(parent::prepareInject(), $this->getConfigInject('controllers'), array(
'service' => array(
... | php | final protected function prepareInject() {
$service = $this->getModule() . '\Services\\' . $this->getClassName() . 'Service';
if (class_exists($service)) {
return array_merge(parent::prepareInject(), $this->getConfigInject('controllers'), array(
'service' => array(
... | [
"final",
"protected",
"function",
"prepareInject",
"(",
")",
"{",
"$",
"service",
"=",
"$",
"this",
"->",
"getModule",
"(",
")",
".",
"'\\Services\\\\'",
".",
"$",
"this",
"->",
"getClassName",
"(",
")",
".",
"'Service'",
";",
"if",
"(",
"class_exists",
... | Prepares the injection
@return array | [
"Prepares",
"the",
"injection"
] | dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d | https://github.com/ezra-obiwale/dSCore/blob/dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d/src/Core/AController.php#L97-L108 | train |
ezra-obiwale/dSCore | src/Core/AController.php | AController.getActions | final public function getActions() {
$return = array();
foreach (get_class_methods($this) as $method) {
if (substr($method, strlen($method) - 6) === 'Action')
$return[] = substr($method, 0, strlen($method) - 6);
}
return $return;
} | php | final public function getActions() {
$return = array();
foreach (get_class_methods($this) as $method) {
if (substr($method, strlen($method) - 6) === 'Action')
$return[] = substr($method, 0, strlen($method) - 6);
}
return $return;
} | [
"final",
"public",
"function",
"getActions",
"(",
")",
"{",
"$",
"return",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"get_class_methods",
"(",
"$",
"this",
")",
"as",
"$",
"method",
")",
"{",
"if",
"(",
"substr",
"(",
"$",
"method",
",",
"strlen",... | Fetches all actions in the controller
@return array | [
"Fetches",
"all",
"actions",
"in",
"the",
"controller"
] | dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d | https://github.com/ezra-obiwale/dSCore/blob/dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d/src/Core/AController.php#L122-L129 | train |
ezra-obiwale/dSCore | src/Core/AController.php | AController.redirect | final protected function redirect($module, $controller = null, $action = null, array $params = array(), $hash = null) {
header('Location: ' . $this->view->url($module, $controller, $action, $params, $hash));
exit;
} | php | final protected function redirect($module, $controller = null, $action = null, array $params = array(), $hash = null) {
header('Location: ' . $this->view->url($module, $controller, $action, $params, $hash));
exit;
} | [
"final",
"protected",
"function",
"redirect",
"(",
"$",
"module",
",",
"$",
"controller",
"=",
"null",
",",
"$",
"action",
"=",
"null",
",",
"array",
"$",
"params",
"=",
"array",
"(",
")",
",",
"$",
"hash",
"=",
"null",
")",
"{",
"header",
"(",
"'L... | Redirects to another resource
@param string $module
@param string|null $controller
@param string|null $action
@param array $params
@param string $hash | [
"Redirects",
"to",
"another",
"resource"
] | dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d | https://github.com/ezra-obiwale/dSCore/blob/dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d/src/Core/AController.php#L147-L150 | train |
OliverMonneke/pennePHP | src/Datatype/Resource.php | Resource.isEmpty | public static function isEmpty($resource)
{
if (!self::isValid($resource) &&
null !== $resource) {
return false;
}
return String::isEmpty($resource);
} | php | public static function isEmpty($resource)
{
if (!self::isValid($resource) &&
null !== $resource) {
return false;
}
return String::isEmpty($resource);
} | [
"public",
"static",
"function",
"isEmpty",
"(",
"$",
"resource",
")",
"{",
"if",
"(",
"!",
"self",
"::",
"isValid",
"(",
"$",
"resource",
")",
"&&",
"null",
"!==",
"$",
"resource",
")",
"{",
"return",
"false",
";",
"}",
"return",
"String",
"::",
"isE... | Check if resource is empty
@param resource $resource The resource
@return bool | [
"Check",
"if",
"resource",
"is",
"empty"
] | dd0de7944685a3f1947157e1254fc54b55ff9942 | https://github.com/OliverMonneke/pennePHP/blob/dd0de7944685a3f1947157e1254fc54b55ff9942/src/Datatype/Resource.php#L36-L44 | train |
OliverMonneke/pennePHP | src/Datatype/Resource.php | Resource.isNotEmpty | public static function isNotEmpty($resource)
{
if (!self::isValid($resource) &&
null !== $resource) {
return false;
}
return ($resource !== null && $resource !== '');
} | php | public static function isNotEmpty($resource)
{
if (!self::isValid($resource) &&
null !== $resource) {
return false;
}
return ($resource !== null && $resource !== '');
} | [
"public",
"static",
"function",
"isNotEmpty",
"(",
"$",
"resource",
")",
"{",
"if",
"(",
"!",
"self",
"::",
"isValid",
"(",
"$",
"resource",
")",
"&&",
"null",
"!==",
"$",
"resource",
")",
"{",
"return",
"false",
";",
"}",
"return",
"(",
"$",
"resour... | Check if resource is note empty
@param resource $resource The resource
@return bool | [
"Check",
"if",
"resource",
"is",
"note",
"empty"
] | dd0de7944685a3f1947157e1254fc54b55ff9942 | https://github.com/OliverMonneke/pennePHP/blob/dd0de7944685a3f1947157e1254fc54b55ff9942/src/Datatype/Resource.php#L53-L61 | train |
ARCANESOFT/SEO | src/Seeds/PermissionsTableSeeder.php | PermissionsTableSeeder.getPagesSeeds | private function getPagesSeeds()
{
return [
[
'name' => 'Pages - List all pages',
'description' => 'Allow to list all pages.',
'slug' => PagesPolicy::PERMISSION_LIST,
],
[
'name' => 'Page... | php | private function getPagesSeeds()
{
return [
[
'name' => 'Pages - List all pages',
'description' => 'Allow to list all pages.',
'slug' => PagesPolicy::PERMISSION_LIST,
],
[
'name' => 'Page... | [
"private",
"function",
"getPagesSeeds",
"(",
")",
"{",
"return",
"[",
"[",
"'name'",
"=>",
"'Pages - List all pages'",
",",
"'description'",
"=>",
"'Allow to list all pages.'",
",",
"'slug'",
"=>",
"PagesPolicy",
"::",
"PERMISSION_LIST",
",",
"]",
",",
"[",
"'name... | Get the Pages permissions.
@return array | [
"Get",
"the",
"Pages",
"permissions",
"."
] | ce6d6135d55e8b2fd43cf7923839b4791b7c7ad2 | https://github.com/ARCANESOFT/SEO/blob/ce6d6135d55e8b2fd43cf7923839b4791b7c7ad2/src/Seeds/PermissionsTableSeeder.php#L72-L101 | train |
ARCANESOFT/SEO | src/Seeds/PermissionsTableSeeder.php | PermissionsTableSeeder.getFootersSeeds | private function getFootersSeeds()
{
return [
[
'name' => 'Footers - List all footers',
'description' => 'Allow to list all footers.',
'slug' => FootersPolicy::PERMISSION_LIST,
],
[
'name' ... | php | private function getFootersSeeds()
{
return [
[
'name' => 'Footers - List all footers',
'description' => 'Allow to list all footers.',
'slug' => FootersPolicy::PERMISSION_LIST,
],
[
'name' ... | [
"private",
"function",
"getFootersSeeds",
"(",
")",
"{",
"return",
"[",
"[",
"'name'",
"=>",
"'Footers - List all footers'",
",",
"'description'",
"=>",
"'Allow to list all footers.'",
",",
"'slug'",
"=>",
"FootersPolicy",
"::",
"PERMISSION_LIST",
",",
"]",
",",
"["... | Get the Footers permissions.
@return array | [
"Get",
"the",
"Footers",
"permissions",
"."
] | ce6d6135d55e8b2fd43cf7923839b4791b7c7ad2 | https://github.com/ARCANESOFT/SEO/blob/ce6d6135d55e8b2fd43cf7923839b4791b7c7ad2/src/Seeds/PermissionsTableSeeder.php#L108-L137 | train |
ARCANESOFT/SEO | src/Seeds/PermissionsTableSeeder.php | PermissionsTableSeeder.getRedirectsSeeds | private function getRedirectsSeeds()
{
return [
[
'name' => 'Redirects - List all redirections',
'description' => 'Allow to list all redirections.',
'slug' => RedirectsPolicy::PERMISSION_LIST,
],
[
... | php | private function getRedirectsSeeds()
{
return [
[
'name' => 'Redirects - List all redirections',
'description' => 'Allow to list all redirections.',
'slug' => RedirectsPolicy::PERMISSION_LIST,
],
[
... | [
"private",
"function",
"getRedirectsSeeds",
"(",
")",
"{",
"return",
"[",
"[",
"'name'",
"=>",
"'Redirects - List all redirections'",
",",
"'description'",
"=>",
"'Allow to list all redirections.'",
",",
"'slug'",
"=>",
"RedirectsPolicy",
"::",
"PERMISSION_LIST",
",",
"... | Get the Redirects permissions.
@return array | [
"Get",
"the",
"Redirects",
"permissions",
"."
] | ce6d6135d55e8b2fd43cf7923839b4791b7c7ad2 | https://github.com/ARCANESOFT/SEO/blob/ce6d6135d55e8b2fd43cf7923839b4791b7c7ad2/src/Seeds/PermissionsTableSeeder.php#L160-L189 | train |
syntaxseed/templateseed | src/TemplateSeed.php | TemplateSeed.render | public function render($tpl, $params = [])
{
$this->setTemplate($tpl);
$this->params = (object) $params;
return $this->retrieve();
} | php | public function render($tpl, $params = [])
{
$this->setTemplate($tpl);
$this->params = (object) $params;
return $this->retrieve();
} | [
"public",
"function",
"render",
"(",
"$",
"tpl",
",",
"$",
"params",
"=",
"[",
"]",
")",
"{",
"$",
"this",
"->",
"setTemplate",
"(",
"$",
"tpl",
")",
";",
"$",
"this",
"->",
"params",
"=",
"(",
"object",
")",
"$",
"params",
";",
"return",
"$",
... | Set the template name, assign params array and return rendered output in one method.
Call this function in routes and controllers.
@param string $tpl
@param array $params
@return string | [
"Set",
"the",
"template",
"name",
"assign",
"params",
"array",
"and",
"return",
"rendered",
"output",
"in",
"one",
"method",
".",
"Call",
"this",
"function",
"in",
"routes",
"and",
"controllers",
"."
] | 70e157381fa513e92e566824be18cc4437e7cff9 | https://github.com/syntaxseed/templateseed/blob/70e157381fa513e92e566824be18cc4437e7cff9/src/TemplateSeed.php#L102-L107 | train |
syntaxseed/templateseed | src/TemplateSeed.php | TemplateSeed.setTemplate | public function setTemplate($tpl, $clearParams=true)
{
if ($clearParams) {
$this->clearParams();
}
$this->templateFile = $this->templatesPath.$tpl.'.tpl.php';
} | php | public function setTemplate($tpl, $clearParams=true)
{
if ($clearParams) {
$this->clearParams();
}
$this->templateFile = $this->templatesPath.$tpl.'.tpl.php';
} | [
"public",
"function",
"setTemplate",
"(",
"$",
"tpl",
",",
"$",
"clearParams",
"=",
"true",
")",
"{",
"if",
"(",
"$",
"clearParams",
")",
"{",
"$",
"this",
"->",
"clearParams",
"(",
")",
";",
"}",
"$",
"this",
"->",
"templateFile",
"=",
"$",
"this",
... | Set the name of the template to be used. Should not include file extension.
@param string $tpl
@param boolean $clearParams
@return void | [
"Set",
"the",
"name",
"of",
"the",
"template",
"to",
"be",
"used",
".",
"Should",
"not",
"include",
"file",
"extension",
"."
] | 70e157381fa513e92e566824be18cc4437e7cff9 | https://github.com/syntaxseed/templateseed/blob/70e157381fa513e92e566824be18cc4437e7cff9/src/TemplateSeed.php#L116-L122 | train |
syntaxseed/templateseed | src/TemplateSeed.php | TemplateSeed.setTemplatesPath | private function setTemplatesPath($templatesPath)
{
$this->templatesPath = $templatesPath;
if (!is_readable($this->templatesPath)) {
$this->error("Template Root Path ({$this->templatesPath}) does not exist or not readable.");
}
} | php | private function setTemplatesPath($templatesPath)
{
$this->templatesPath = $templatesPath;
if (!is_readable($this->templatesPath)) {
$this->error("Template Root Path ({$this->templatesPath}) does not exist or not readable.");
}
} | [
"private",
"function",
"setTemplatesPath",
"(",
"$",
"templatesPath",
")",
"{",
"$",
"this",
"->",
"templatesPath",
"=",
"$",
"templatesPath",
";",
"if",
"(",
"!",
"is_readable",
"(",
"$",
"this",
"->",
"templatesPath",
")",
")",
"{",
"$",
"this",
"->",
... | Set the path to the templates directory.
@param string $templatesPath
@return void | [
"Set",
"the",
"path",
"to",
"the",
"templates",
"directory",
"."
] | 70e157381fa513e92e566824be18cc4437e7cff9 | https://github.com/syntaxseed/templateseed/blob/70e157381fa513e92e566824be18cc4437e7cff9/src/TemplateSeed.php#L130-L136 | train |
syntaxseed/templateseed | src/TemplateSeed.php | TemplateSeed.protectedInclude | private function protectedInclude()
{
$_tpl = $this;
// View Helpers:
// * Include another view into the current view:
$_view = function ($tplName, $params = []) use ($_tpl) {
$tplCopy = clone $_tpl; // Don't want to mess with the calling template's settings.
... | php | private function protectedInclude()
{
$_tpl = $this;
// View Helpers:
// * Include another view into the current view:
$_view = function ($tplName, $params = []) use ($_tpl) {
$tplCopy = clone $_tpl; // Don't want to mess with the calling template's settings.
... | [
"private",
"function",
"protectedInclude",
"(",
")",
"{",
"$",
"_tpl",
"=",
"$",
"this",
";",
"// View Helpers:",
"// * Include another view into the current view:",
"$",
"_view",
"=",
"function",
"(",
"$",
"tplName",
",",
"$",
"params",
"=",
"[",
"]",
")",
"u... | Wrap our template include into a method scope.
This allows our template to have access only to the template params.
It also prevents collisions with the global namespace.
This function also defines some template helpers:
$_ss(string $str) - Safe String. Html encode the string.
$_view(string $tplName, array $params) - ... | [
"Wrap",
"our",
"template",
"include",
"into",
"a",
"method",
"scope",
".",
"This",
"allows",
"our",
"template",
"to",
"have",
"access",
"only",
"to",
"the",
"template",
"params",
".",
"It",
"also",
"prevents",
"collisions",
"with",
"the",
"global",
"namespac... | 70e157381fa513e92e566824be18cc4437e7cff9 | https://github.com/syntaxseed/templateseed/blob/70e157381fa513e92e566824be18cc4437e7cff9/src/TemplateSeed.php#L213-L236 | train |
syntaxseed/templateseed | src/TemplateSeed.php | TemplateSeed.useCache | protected function useCache()
{
// Should we use a cached version?
if ($this->cache && $this->cacheExists()) {
$this->templateOutput = $this->getCache();
if ($this->templateOutput !== false) {
return true;
}
}
return false;
} | php | protected function useCache()
{
// Should we use a cached version?
if ($this->cache && $this->cacheExists()) {
$this->templateOutput = $this->getCache();
if ($this->templateOutput !== false) {
return true;
}
}
return false;
} | [
"protected",
"function",
"useCache",
"(",
")",
"{",
"// Should we use a cached version?",
"if",
"(",
"$",
"this",
"->",
"cache",
"&&",
"$",
"this",
"->",
"cacheExists",
"(",
")",
")",
"{",
"$",
"this",
"->",
"templateOutput",
"=",
"$",
"this",
"->",
"getCa... | Determine if we can use a cached version of the template and if so, fetch it.
@return bool | [
"Determine",
"if",
"we",
"can",
"use",
"a",
"cached",
"version",
"of",
"the",
"template",
"and",
"if",
"so",
"fetch",
"it",
"."
] | 70e157381fa513e92e566824be18cc4437e7cff9 | https://github.com/syntaxseed/templateseed/blob/70e157381fa513e92e566824be18cc4437e7cff9/src/TemplateSeed.php#L276-L286 | train |
syntaxseed/templateseed | src/TemplateSeed.php | TemplateSeed.setCacheKey | public function setCacheKey($key)
{
$key = preg_replace('/[^\da-z]/i', '', $key);
if (!empty($key)) {
$this->cacheKey = $key;
}
} | php | public function setCacheKey($key)
{
$key = preg_replace('/[^\da-z]/i', '', $key);
if (!empty($key)) {
$this->cacheKey = $key;
}
} | [
"public",
"function",
"setCacheKey",
"(",
"$",
"key",
")",
"{",
"$",
"key",
"=",
"preg_replace",
"(",
"'/[^\\da-z]/i'",
",",
"''",
",",
"$",
"key",
")",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"key",
")",
")",
"{",
"$",
"this",
"->",
"cacheKey",
... | Manually set a name for the cached file instead of using the md5 of the template name.
@param string $key
@return void | [
"Manually",
"set",
"a",
"name",
"for",
"the",
"cached",
"file",
"instead",
"of",
"using",
"the",
"md5",
"of",
"the",
"template",
"name",
"."
] | 70e157381fa513e92e566824be18cc4437e7cff9 | https://github.com/syntaxseed/templateseed/blob/70e157381fa513e92e566824be18cc4437e7cff9/src/TemplateSeed.php#L294-L300 | train |
syntaxseed/templateseed | src/TemplateSeed.php | TemplateSeed.cacheExists | public function cacheExists()
{
$cacheFile = $this->getCacheFile();
if (file_exists($cacheFile) && filemtime($cacheFile) > (time()-$this->cachePeriod)) {
return(true);
} else {
return(false);
}
} | php | public function cacheExists()
{
$cacheFile = $this->getCacheFile();
if (file_exists($cacheFile) && filemtime($cacheFile) > (time()-$this->cachePeriod)) {
return(true);
} else {
return(false);
}
} | [
"public",
"function",
"cacheExists",
"(",
")",
"{",
"$",
"cacheFile",
"=",
"$",
"this",
"->",
"getCacheFile",
"(",
")",
";",
"if",
"(",
"file_exists",
"(",
"$",
"cacheFile",
")",
"&&",
"filemtime",
"(",
"$",
"cacheFile",
")",
">",
"(",
"time",
"(",
"... | Check whether a cache file exists and is not expired.
@return bool | [
"Check",
"whether",
"a",
"cache",
"file",
"exists",
"and",
"is",
"not",
"expired",
"."
] | 70e157381fa513e92e566824be18cc4437e7cff9 | https://github.com/syntaxseed/templateseed/blob/70e157381fa513e92e566824be18cc4437e7cff9/src/TemplateSeed.php#L341-L349 | train |
syntaxseed/templateseed | src/TemplateSeed.php | TemplateSeed.setCache | protected function setCache()
{
if ($this->cache) {
$cacheFile = $this->getCacheFile();
file_put_contents($cacheFile, $this->templateOutput);
}
} | php | protected function setCache()
{
if ($this->cache) {
$cacheFile = $this->getCacheFile();
file_put_contents($cacheFile, $this->templateOutput);
}
} | [
"protected",
"function",
"setCache",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"cache",
")",
"{",
"$",
"cacheFile",
"=",
"$",
"this",
"->",
"getCacheFile",
"(",
")",
";",
"file_put_contents",
"(",
"$",
"cacheFile",
",",
"$",
"this",
"->",
"templateO... | Cache the template if applicable.
@return void | [
"Cache",
"the",
"template",
"if",
"applicable",
"."
] | 70e157381fa513e92e566824be18cc4437e7cff9 | https://github.com/syntaxseed/templateseed/blob/70e157381fa513e92e566824be18cc4437e7cff9/src/TemplateSeed.php#L356-L362 | train |
syntaxseed/templateseed | src/TemplateSeed.php | TemplateSeed.getCacheFile | private function getCacheFile()
{
if (is_null($this->cachePath) || !file_exists($this->cachePath)) {
$this->error('Invalid Cache Path. '.$this->cachePath);
return false;
}
$cacheKey = is_null($this->cacheKey) ? md5($this->templateFile) : $this->cacheKey;
retur... | php | private function getCacheFile()
{
if (is_null($this->cachePath) || !file_exists($this->cachePath)) {
$this->error('Invalid Cache Path. '.$this->cachePath);
return false;
}
$cacheKey = is_null($this->cacheKey) ? md5($this->templateFile) : $this->cacheKey;
retur... | [
"private",
"function",
"getCacheFile",
"(",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"cachePath",
")",
"||",
"!",
"file_exists",
"(",
"$",
"this",
"->",
"cachePath",
")",
")",
"{",
"$",
"this",
"->",
"error",
"(",
"'Invalid Cache Path. '",... | Get the name of the file this template should be cached to.
Using the supplied key, or the md5 of the template name.
@return string|false | [
"Get",
"the",
"name",
"of",
"the",
"file",
"this",
"template",
"should",
"be",
"cached",
"to",
".",
"Using",
"the",
"supplied",
"key",
"or",
"the",
"md5",
"of",
"the",
"template",
"name",
"."
] | 70e157381fa513e92e566824be18cc4437e7cff9 | https://github.com/syntaxseed/templateseed/blob/70e157381fa513e92e566824be18cc4437e7cff9/src/TemplateSeed.php#L384-L392 | train |
koolkode/lexer | src/AbstractTokenCursor.php | AbstractTokenCursor.consume | public function consume($type = NULL)
{
if(!$this->valid())
{
throw new \OutOfBoundsException('No more tokens available');
}
$token = $this->current();
if($type !== NULL && !$token->is($type))
{
throw new \UnexpectedValueException(sprintf('Expected token type %s, read "%s" (%d)', $type, $token, $... | php | public function consume($type = NULL)
{
if(!$this->valid())
{
throw new \OutOfBoundsException('No more tokens available');
}
$token = $this->current();
if($type !== NULL && !$token->is($type))
{
throw new \UnexpectedValueException(sprintf('Expected token type %s, read "%s" (%d)', $type, $token, $... | [
"public",
"function",
"consume",
"(",
"$",
"type",
"=",
"NULL",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"valid",
"(",
")",
")",
"{",
"throw",
"new",
"\\",
"OutOfBoundsException",
"(",
"'No more tokens available'",
")",
";",
"}",
"$",
"token",
"=",... | Consume the next token and return it.
@param integer $type The expected token type...
@return AbstractToken
@throws \OutOfBoundsException When there are no more tokens to be consumed.
@throws \UnexpectedValueException When a token is found but does not match the given type. | [
"Consume",
"the",
"next",
"token",
"and",
"return",
"it",
"."
] | 1f33fb4e95bf3b6b21c63187e503bbe612a1646c | https://github.com/koolkode/lexer/blob/1f33fb4e95bf3b6b21c63187e503bbe612a1646c/src/AbstractTokenCursor.php#L113-L130 | train |
koolkode/lexer | src/AbstractTokenCursor.php | AbstractTokenCursor.moveTo | public function moveTo($mark)
{
if(is_array($mark) || $mark instanceof \Countable)
{
$this->index = count($mark);
}
else
{
$this->index = (int)$mark;
}
return $this;
} | php | public function moveTo($mark)
{
if(is_array($mark) || $mark instanceof \Countable)
{
$this->index = count($mark);
}
else
{
$this->index = (int)$mark;
}
return $this;
} | [
"public",
"function",
"moveTo",
"(",
"$",
"mark",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"mark",
")",
"||",
"$",
"mark",
"instanceof",
"\\",
"Countable",
")",
"{",
"$",
"this",
"->",
"index",
"=",
"count",
"(",
"$",
"mark",
")",
";",
"}",
"el... | Moves the cursor to the given mark.
@param mixed $mark
@return AbstractTokenCursor | [
"Moves",
"the",
"cursor",
"to",
"the",
"given",
"mark",
"."
] | 1f33fb4e95bf3b6b21c63187e503bbe612a1646c | https://github.com/koolkode/lexer/blob/1f33fb4e95bf3b6b21c63187e503bbe612a1646c/src/AbstractTokenCursor.php#L161-L173 | train |
koolkode/lexer | src/AbstractTokenCursor.php | AbstractTokenCursor.move | public function move($steps)
{
if(is_array($steps) || $steps instanceof \Countable)
{
$this->index += count($steps);
}
else
{
$this->index += (int)$steps;
}
return $this;
} | php | public function move($steps)
{
if(is_array($steps) || $steps instanceof \Countable)
{
$this->index += count($steps);
}
else
{
$this->index += (int)$steps;
}
return $this;
} | [
"public",
"function",
"move",
"(",
"$",
"steps",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"steps",
")",
"||",
"$",
"steps",
"instanceof",
"\\",
"Countable",
")",
"{",
"$",
"this",
"->",
"index",
"+=",
"count",
"(",
"$",
"steps",
")",
";",
"}",
... | Move the cursor by the given number of steps.
@param mixed $steps
@return AbstractTokenCursor | [
"Move",
"the",
"cursor",
"by",
"the",
"given",
"number",
"of",
"steps",
"."
] | 1f33fb4e95bf3b6b21c63187e503bbe612a1646c | https://github.com/koolkode/lexer/blob/1f33fb4e95bf3b6b21c63187e503bbe612a1646c/src/AbstractTokenCursor.php#L181-L193 | train |
koolkode/lexer | src/AbstractTokenCursor.php | AbstractTokenCursor.moveToNext | public function moveToNext($type, callable $callback = NULL)
{
$delim = (array)$type;
while($this->valid())
{
$token = $this->current();
if($token->isOneOf($delim))
{
return $token;
}
if($callback !== NULL)
{
$callback($token);
}
$this->next();
}
} | php | public function moveToNext($type, callable $callback = NULL)
{
$delim = (array)$type;
while($this->valid())
{
$token = $this->current();
if($token->isOneOf($delim))
{
return $token;
}
if($callback !== NULL)
{
$callback($token);
}
$this->next();
}
} | [
"public",
"function",
"moveToNext",
"(",
"$",
"type",
",",
"callable",
"$",
"callback",
"=",
"NULL",
")",
"{",
"$",
"delim",
"=",
"(",
"array",
")",
"$",
"type",
";",
"while",
"(",
"$",
"this",
"->",
"valid",
"(",
")",
")",
"{",
"$",
"token",
"="... | Move the cursor to the next occurance if the given token type.
@param mixed $type The target token type.
@param callable $callback Is invoked once for every skipped token.
@return AbstractToken or <code>NULL</code> if no token was found. | [
"Move",
"the",
"cursor",
"to",
"the",
"next",
"occurance",
"if",
"the",
"given",
"token",
"type",
"."
] | 1f33fb4e95bf3b6b21c63187e503bbe612a1646c | https://github.com/koolkode/lexer/blob/1f33fb4e95bf3b6b21c63187e503bbe612a1646c/src/AbstractTokenCursor.php#L228-L248 | train |
koolkode/lexer | src/AbstractTokenCursor.php | AbstractTokenCursor.readSequence | public function readSequence(array $allowedTokenTypes)
{
$tokens = [];
while($this->valid())
{
$token = $this->current();
if(!$token->isOneOf($allowedTokenTypes))
{
break;
}
$tokens[] = $token;
$this->next();
}
return $this->createTokenSequence($tokens);
} | php | public function readSequence(array $allowedTokenTypes)
{
$tokens = [];
while($this->valid())
{
$token = $this->current();
if(!$token->isOneOf($allowedTokenTypes))
{
break;
}
$tokens[] = $token;
$this->next();
}
return $this->createTokenSequence($tokens);
} | [
"public",
"function",
"readSequence",
"(",
"array",
"$",
"allowedTokenTypes",
")",
"{",
"$",
"tokens",
"=",
"[",
"]",
";",
"while",
"(",
"$",
"this",
"->",
"valid",
"(",
")",
")",
"{",
"$",
"token",
"=",
"$",
"this",
"->",
"current",
"(",
")",
";",... | Get a TokenSequence containing only the allowed token types starting from the
current position of the cursor.
@param array<integer> $allowedTokenTypes
@return AbstractTokenSequence | [
"Get",
"a",
"TokenSequence",
"containing",
"only",
"the",
"allowed",
"token",
"types",
"starting",
"from",
"the",
"current",
"position",
"of",
"the",
"cursor",
"."
] | 1f33fb4e95bf3b6b21c63187e503bbe612a1646c | https://github.com/koolkode/lexer/blob/1f33fb4e95bf3b6b21c63187e503bbe612a1646c/src/AbstractTokenCursor.php#L257-L276 | train |
koolkode/lexer | src/AbstractTokenCursor.php | AbstractTokenCursor.readSequenceToNext | public function readSequenceToNext($type, $skipDelimiter = false)
{
$tokens = [];
$delim = (array)$type;
while($this->valid())
{
$token = $this->current();
if($token->isOneOf($delim))
{
if(!$skipDelimiter)
{
$tokens[] = $token;
}
break;
}
$tokens[] = $token;
$this->n... | php | public function readSequenceToNext($type, $skipDelimiter = false)
{
$tokens = [];
$delim = (array)$type;
while($this->valid())
{
$token = $this->current();
if($token->isOneOf($delim))
{
if(!$skipDelimiter)
{
$tokens[] = $token;
}
break;
}
$tokens[] = $token;
$this->n... | [
"public",
"function",
"readSequenceToNext",
"(",
"$",
"type",
",",
"$",
"skipDelimiter",
"=",
"false",
")",
"{",
"$",
"tokens",
"=",
"[",
"]",
";",
"$",
"delim",
"=",
"(",
"array",
")",
"$",
"type",
";",
"while",
"(",
"$",
"this",
"->",
"valid",
"(... | Read tokens to the next occurance of the given token type and return a
token sequence containing all found tokens.
@param mixed $type
@param boolean $skipDelimiter
@return AbstractTokenSequence | [
"Read",
"tokens",
"to",
"the",
"next",
"occurance",
"of",
"the",
"given",
"token",
"type",
"and",
"return",
"a",
"token",
"sequence",
"containing",
"all",
"found",
"tokens",
"."
] | 1f33fb4e95bf3b6b21c63187e503bbe612a1646c | https://github.com/koolkode/lexer/blob/1f33fb4e95bf3b6b21c63187e503bbe612a1646c/src/AbstractTokenCursor.php#L286-L311 | train |
koolkode/lexer | src/AbstractTokenCursor.php | AbstractTokenCursor.readNextBlock | public function readNextBlock($openingDelimiter, $closingDelimiter, $skipDelimiters = true)
{
$od = (array)$openingDelimiter;
$cd = (array)$closingDelimiter;
$tokens = [];
$level = -1;
while($this->valid() && $level < 0)
{
$token = $this->current();
if($token->isOneOf($od))
{
$level = 0;
... | php | public function readNextBlock($openingDelimiter, $closingDelimiter, $skipDelimiters = true)
{
$od = (array)$openingDelimiter;
$cd = (array)$closingDelimiter;
$tokens = [];
$level = -1;
while($this->valid() && $level < 0)
{
$token = $this->current();
if($token->isOneOf($od))
{
$level = 0;
... | [
"public",
"function",
"readNextBlock",
"(",
"$",
"openingDelimiter",
",",
"$",
"closingDelimiter",
",",
"$",
"skipDelimiters",
"=",
"true",
")",
"{",
"$",
"od",
"=",
"(",
"array",
")",
"$",
"openingDelimiter",
";",
"$",
"cd",
"=",
"(",
"array",
")",
"$",... | Reads the next code block enclosed in the given delimiters, returns an
empty token sequence when no tokens were matched.
@param mixed $openingDelimiter
@param mixed $closingDelimiter
@param boolean $skipDelimiters Skip enclosing delimiters?
@return AbstractTokenSequence | [
"Reads",
"the",
"next",
"code",
"block",
"enclosed",
"in",
"the",
"given",
"delimiters",
"returns",
"an",
"empty",
"token",
"sequence",
"when",
"no",
"tokens",
"were",
"matched",
"."
] | 1f33fb4e95bf3b6b21c63187e503bbe612a1646c | https://github.com/koolkode/lexer/blob/1f33fb4e95bf3b6b21c63187e503bbe612a1646c/src/AbstractTokenCursor.php#L322-L378 | train |
brightnucleus/localization | src/LocalizationTrait.php | LocalizationTrait.loadLocalization | protected function loadLocalization( $domain, $path ) {
if ( is_textdomain_loaded( $domain ) ) {
return;
}
$locale = get_locale();
/**
* Filter the locale of a Bright Nucleus library.
*
* @since v0.1.0
*
* @param string $locale The plugin's current locale.
* @param string $domain Text dom... | php | protected function loadLocalization( $domain, $path ) {
if ( is_textdomain_loaded( $domain ) ) {
return;
}
$locale = get_locale();
/**
* Filter the locale of a Bright Nucleus library.
*
* @since v0.1.0
*
* @param string $locale The plugin's current locale.
* @param string $domain Text dom... | [
"protected",
"function",
"loadLocalization",
"(",
"$",
"domain",
",",
"$",
"path",
")",
"{",
"if",
"(",
"is_textdomain_loaded",
"(",
"$",
"domain",
")",
")",
"{",
"return",
";",
"}",
"$",
"locale",
"=",
"get_locale",
"(",
")",
";",
"/**\n\t\t * Filter the ... | Load localized strings.
@since 0.1.0
@param string $domain Textdomain to load.
@param string $path Path to languages files. | [
"Load",
"localized",
"strings",
"."
] | 8705bcccf54f4b19d50ed871364d6a6c2b8cffcd | https://github.com/brightnucleus/localization/blob/8705bcccf54f4b19d50ed871364d6a6c2b8cffcd/src/LocalizationTrait.php#L34-L84 | train |
andres-montanez/FragmentCacheBundle | Service/FileCacheService.php | FileCacheService.get | public function get($key)
{
$file = $this->cacheDir . $this->getDir($key) . $this->getFile($key);
if (file_exists($file) && is_readable($file)) {
if (filemtime($file) > time()) {
return file_get_contents($file);
}
}
return false;
} | php | public function get($key)
{
$file = $this->cacheDir . $this->getDir($key) . $this->getFile($key);
if (file_exists($file) && is_readable($file)) {
if (filemtime($file) > time()) {
return file_get_contents($file);
}
}
return false;
} | [
"public",
"function",
"get",
"(",
"$",
"key",
")",
"{",
"$",
"file",
"=",
"$",
"this",
"->",
"cacheDir",
".",
"$",
"this",
"->",
"getDir",
"(",
"$",
"key",
")",
".",
"$",
"this",
"->",
"getFile",
"(",
"$",
"key",
")",
";",
"if",
"(",
"file_exis... | Get a stored value by it's key
@param string $key
@return mixed | [
"Get",
"a",
"stored",
"value",
"by",
"it",
"s",
"key"
] | 90f9511e275fd78990f6b90cd52052078c53253a | https://github.com/andres-montanez/FragmentCacheBundle/blob/90f9511e275fd78990f6b90cd52052078c53253a/Service/FileCacheService.php#L47-L57 | train |
andres-montanez/FragmentCacheBundle | Service/FileCacheService.php | FileCacheService.set | public function set($key, $value, $expiration = 0)
{
$file = $this->cacheDir . $this->getDir($key) . $this->getFile($key);
if (!file_exists(dirname($file))) {
mkdir(dirname($file), 0755, true);
}
$return = file_put_contents($file, $value);
touch($file, time() + ... | php | public function set($key, $value, $expiration = 0)
{
$file = $this->cacheDir . $this->getDir($key) . $this->getFile($key);
if (!file_exists(dirname($file))) {
mkdir(dirname($file), 0755, true);
}
$return = file_put_contents($file, $value);
touch($file, time() + ... | [
"public",
"function",
"set",
"(",
"$",
"key",
",",
"$",
"value",
",",
"$",
"expiration",
"=",
"0",
")",
"{",
"$",
"file",
"=",
"$",
"this",
"->",
"cacheDir",
".",
"$",
"this",
"->",
"getDir",
"(",
"$",
"key",
")",
".",
"$",
"this",
"->",
"getFi... | Stores a value in the cache
@param string $key
@param mixed $value
@param integer $expiration
@return boolean | [
"Stores",
"a",
"value",
"in",
"the",
"cache"
] | 90f9511e275fd78990f6b90cd52052078c53253a | https://github.com/andres-montanez/FragmentCacheBundle/blob/90f9511e275fd78990f6b90cd52052078c53253a/Service/FileCacheService.php#L68-L80 | train |
andres-montanez/FragmentCacheBundle | Service/FileCacheService.php | FileCacheService.getDir | protected function getDir($key)
{
$dir = sha1($key);
$dir = substr($dir, 0, 3) . '/'
. substr($dir, 3, 3) . '/';
return $dir;
} | php | protected function getDir($key)
{
$dir = sha1($key);
$dir = substr($dir, 0, 3) . '/'
. substr($dir, 3, 3) . '/';
return $dir;
} | [
"protected",
"function",
"getDir",
"(",
"$",
"key",
")",
"{",
"$",
"dir",
"=",
"sha1",
"(",
"$",
"key",
")",
";",
"$",
"dir",
"=",
"substr",
"(",
"$",
"dir",
",",
"0",
",",
"3",
")",
".",
"'/'",
".",
"substr",
"(",
"$",
"dir",
",",
"3",
","... | Calculates the Directory based on a key
@param string $key
@return string | [
"Calculates",
"the",
"Directory",
"based",
"on",
"a",
"key"
] | 90f9511e275fd78990f6b90cd52052078c53253a | https://github.com/andres-montanez/FragmentCacheBundle/blob/90f9511e275fd78990f6b90cd52052078c53253a/Service/FileCacheService.php#L101-L108 | train |
ringoteam/RingoPhpRedmonBundle | Controller/AdminController.php | AdminController.flushAllAction | public function flushAllAction()
{
try {
$this->getWorker()->execute('flushAll');
$this->get('session')->getFlashBag()->add('success', 'Flush ALL executed successfully');
}catch(\Exception $e) {
$this->get('session')->getFlashBag()->add('error', 'We h... | php | public function flushAllAction()
{
try {
$this->getWorker()->execute('flushAll');
$this->get('session')->getFlashBag()->add('success', 'Flush ALL executed successfully');
}catch(\Exception $e) {
$this->get('session')->getFlashBag()->add('error', 'We h... | [
"public",
"function",
"flushAllAction",
"(",
")",
"{",
"try",
"{",
"$",
"this",
"->",
"getWorker",
"(",
")",
"->",
"execute",
"(",
"'flushAll'",
")",
";",
"$",
"this",
"->",
"get",
"(",
"'session'",
")",
"->",
"getFlashBag",
"(",
")",
"->",
"add",
"(... | Call flush all command for the current instance
@return \Symfony\Component\HttpFoundation\RedirectResponse | [
"Call",
"flush",
"all",
"command",
"for",
"the",
"current",
"instance"
] | 9aab989a9bee9e6152ec19f8a30bc24f3bde6012 | https://github.com/ringoteam/RingoPhpRedmonBundle/blob/9aab989a9bee9e6152ec19f8a30bc24f3bde6012/Controller/AdminController.php#L31-L42 | train |
ringoteam/RingoPhpRedmonBundle | Controller/AdminController.php | AdminController.flushDbAction | public function flushDbAction($id)
{
try {
$this->getWorker()->flushDB($id);
$this->get('session')->getFlashBag()->add('success', 'Flush DB on '.$id.' executed successfully');
}catch(\Exception $e) {
$this->get('session')->getFlashBag()->add('success'... | php | public function flushDbAction($id)
{
try {
$this->getWorker()->flushDB($id);
$this->get('session')->getFlashBag()->add('success', 'Flush DB on '.$id.' executed successfully');
}catch(\Exception $e) {
$this->get('session')->getFlashBag()->add('success'... | [
"public",
"function",
"flushDbAction",
"(",
"$",
"id",
")",
"{",
"try",
"{",
"$",
"this",
"->",
"getWorker",
"(",
")",
"->",
"flushDB",
"(",
"$",
"id",
")",
";",
"$",
"this",
"->",
"get",
"(",
"'session'",
")",
"->",
"getFlashBag",
"(",
")",
"->",
... | Call flush DB command for the current instance and the current database
@param int $id Database index
@return \Symfony\Component\HttpFoundation\RedirectResponse | [
"Call",
"flush",
"DB",
"command",
"for",
"the",
"current",
"instance",
"and",
"the",
"current",
"database"
] | 9aab989a9bee9e6152ec19f8a30bc24f3bde6012 | https://github.com/ringoteam/RingoPhpRedmonBundle/blob/9aab989a9bee9e6152ec19f8a30bc24f3bde6012/Controller/AdminController.php#L50-L61 | train |
wb-crowdfusion/crowdfusion | system/core/classes/mvc/http/Response.php | Response.setProtocol | protected function setProtocol($statuscode)
{
if ($_SERVER['SERVER_PROTOCOL'] == 'HTTP/1.1' || $statuscode == Response::SC_CONTINUE || $statuscode == Response::SC_SWITCHING_PROTOCOLS || $statuscode == Response::SC_TEMPORARY_REDIRECT) {
header('HTTP/1.1 ' . $statuscode);
} elseif (empty($_SERVE... | php | protected function setProtocol($statuscode)
{
if ($_SERVER['SERVER_PROTOCOL'] == 'HTTP/1.1' || $statuscode == Response::SC_CONTINUE || $statuscode == Response::SC_SWITCHING_PROTOCOLS || $statuscode == Response::SC_TEMPORARY_REDIRECT) {
header('HTTP/1.1 ' . $statuscode);
} elseif (empty($_SERVE... | [
"protected",
"function",
"setProtocol",
"(",
"$",
"statuscode",
")",
"{",
"if",
"(",
"$",
"_SERVER",
"[",
"'SERVER_PROTOCOL'",
"]",
"==",
"'HTTP/1.1'",
"||",
"$",
"statuscode",
"==",
"Response",
"::",
"SC_CONTINUE",
"||",
"$",
"statuscode",
"==",
"Response",
... | setProtocol
all response protocol decisions made here
handle the exceptions to rules for protocol 1.1 vs 1.0
default to 1.0 when protocol not specified
RFC @ http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10
@param statuscode $statuscode | [
"setProtocol",
"all",
"response",
"protocol",
"decisions",
"made",
"here",
"handle",
"the",
"exceptions",
"to",
"rules",
"for",
"protocol",
"1",
".",
"1",
"vs",
"1",
".",
"0",
"default",
"to",
"1",
".",
"0",
"when",
"protocol",
"not",
"specified",
"RFC"
] | 8cad7988f046a6fefbed07d026cb4ae6706c1217 | https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/mvc/http/Response.php#L143-L152 | train |
TuumPHP/Web | src/Middleware/MiddlewareTrait.php | MiddlewareTrait.push | public function push($handler)
{
if (!$handler) {
return $this;
}
if ($this->next) {
return $this->next->push($handler);
}
if (!$handler instanceof MiddlewareInterface) {
$handler = new Middleware($handler);
}
$this->next = ... | php | public function push($handler)
{
if (!$handler) {
return $this;
}
if ($this->next) {
return $this->next->push($handler);
}
if (!$handler instanceof MiddlewareInterface) {
$handler = new Middleware($handler);
}
$this->next = ... | [
"public",
"function",
"push",
"(",
"$",
"handler",
")",
"{",
"if",
"(",
"!",
"$",
"handler",
")",
"{",
"return",
"$",
"this",
";",
"}",
"if",
"(",
"$",
"this",
"->",
"next",
")",
"{",
"return",
"$",
"this",
"->",
"next",
"->",
"push",
"(",
"$",... | stack up the middleware.
converts normal Application into middleware.
@param ApplicationInterface $handler
@return $this | [
"stack",
"up",
"the",
"middleware",
".",
"converts",
"normal",
"Application",
"into",
"middleware",
"."
] | 8f296b6358aa93226ce08d6cc54a309f5b0a9820 | https://github.com/TuumPHP/Web/blob/8f296b6358aa93226ce08d6cc54a309f5b0a9820/src/Middleware/MiddlewareTrait.php#L31-L44 | train |
kaiohken1982/NeobazaarDocumentModule | src/Document/Controller/ImageController.php | ImageController.getClassifiedImageAddForm | public function getClassifiedImageAddForm()
{
if (null === $this->classifiedImageAddForm) {
$this->classifiedImageAddForm = $this->getServiceLocator()->get('document.form.classifiedimageadd');
}
return $this->classifiedImageAddForm;
} | php | public function getClassifiedImageAddForm()
{
if (null === $this->classifiedImageAddForm) {
$this->classifiedImageAddForm = $this->getServiceLocator()->get('document.form.classifiedimageadd');
}
return $this->classifiedImageAddForm;
} | [
"public",
"function",
"getClassifiedImageAddForm",
"(",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"classifiedImageAddForm",
")",
"{",
"$",
"this",
"->",
"classifiedImageAddForm",
"=",
"$",
"this",
"->",
"getServiceLocator",
"(",
")",
"->",
"get",
... | Get useradd form
@return \Document\Form\ClassifiedImageAdd | [
"Get",
"useradd",
"form"
] | edb0223878fe02e791d2a0266c5a7c0f2029e3fe | https://github.com/kaiohken1982/NeobazaarDocumentModule/blob/edb0223878fe02e791d2a0266c5a7c0f2029e3fe/src/Document/Controller/ImageController.php#L109-L115 | train |
netlogix/Netlogix.BehatCommons | Classes/Netlogix/BehatCommons/ObjectFactory.php | ObjectFactory.create | public function create(array $parameters, $className, PropertyMapper $propertyMapper)
{
list ($objectStructure, $propertyPaths) = $this->getNestedStructureForDottedNotation($parameters);
$propertyMappingConfiguration = $this->getPropertyMappingConfigurationForPropertyPaths($propertyPaths, $className);
$result =... | php | public function create(array $parameters, $className, PropertyMapper $propertyMapper)
{
list ($objectStructure, $propertyPaths) = $this->getNestedStructureForDottedNotation($parameters);
$propertyMappingConfiguration = $this->getPropertyMappingConfigurationForPropertyPaths($propertyPaths, $className);
$result =... | [
"public",
"function",
"create",
"(",
"array",
"$",
"parameters",
",",
"$",
"className",
",",
"PropertyMapper",
"$",
"propertyMapper",
")",
"{",
"list",
"(",
"$",
"objectStructure",
",",
"$",
"propertyPaths",
")",
"=",
"$",
"this",
"->",
"getNestedStructureForD... | Creates a new object based in input parameters and a class name.
This is basically a wrapper for the PropertyMapper::convert() method that
does not take a hierarchical source array but only a key=>value map of
keys being dot notation property paths.
@param array $parameters
@param string $className
@param PropertyMap... | [
"Creates",
"a",
"new",
"object",
"based",
"in",
"input",
"parameters",
"and",
"a",
"class",
"name",
"."
] | bdac586281fd3ebba4ca3a285df903f790feeee0 | https://github.com/netlogix/Netlogix.BehatCommons/blob/bdac586281fd3ebba4ca3a285df903f790feeee0/Classes/Netlogix/BehatCommons/ObjectFactory.php#L88-L98 | train |
netlogix/Netlogix.BehatCommons | Classes/Netlogix/BehatCommons/ObjectFactory.php | ObjectFactory.getPropertyMappingConfigurationForPropertyPaths | public function getPropertyMappingConfigurationForPropertyPaths(array $propertyPaths, $className = '')
{
$propertyMappingConfiguration = new PropertyMappingConfiguration();
$propertyMappingConfiguration->allowAllProperties();
$propertyMappingConfiguration->setTypeConverterOption(PersistentObjectConverter::class,... | php | public function getPropertyMappingConfigurationForPropertyPaths(array $propertyPaths, $className = '')
{
$propertyMappingConfiguration = new PropertyMappingConfiguration();
$propertyMappingConfiguration->allowAllProperties();
$propertyMappingConfiguration->setTypeConverterOption(PersistentObjectConverter::class,... | [
"public",
"function",
"getPropertyMappingConfigurationForPropertyPaths",
"(",
"array",
"$",
"propertyPaths",
",",
"$",
"className",
"=",
"''",
")",
"{",
"$",
"propertyMappingConfiguration",
"=",
"new",
"PropertyMappingConfiguration",
"(",
")",
";",
"$",
"propertyMapping... | Creates a "allow all" property mapping configuration for all properties, even recursively.
@param array <string> $propertyPaths
@param string $className
@return PropertyMappingConfiguration | [
"Creates",
"a",
"allow",
"all",
"property",
"mapping",
"configuration",
"for",
"all",
"properties",
"even",
"recursively",
"."
] | bdac586281fd3ebba4ca3a285df903f790feeee0 | https://github.com/netlogix/Netlogix.BehatCommons/blob/bdac586281fd3ebba4ca3a285df903f790feeee0/Classes/Netlogix/BehatCommons/ObjectFactory.php#L107-L118 | train |
netlogix/Netlogix.BehatCommons | Classes/Netlogix/BehatCommons/ObjectFactory.php | ObjectFactory.getNestedStructureForDottedNotation | public function getNestedStructureForDottedNotation(array $row)
{
$propertyPaths = [];
$objectStructure = [];
foreach ($row as $key => $value) {
self::applyValueProcessors($key, $value);
self::traverseObjectStructure($objectStructure, $propertyPaths, $key, $value);
}
return [$objectStructure, array_v... | php | public function getNestedStructureForDottedNotation(array $row)
{
$propertyPaths = [];
$objectStructure = [];
foreach ($row as $key => $value) {
self::applyValueProcessors($key, $value);
self::traverseObjectStructure($objectStructure, $propertyPaths, $key, $value);
}
return [$objectStructure, array_v... | [
"public",
"function",
"getNestedStructureForDottedNotation",
"(",
"array",
"$",
"row",
")",
"{",
"$",
"propertyPaths",
"=",
"[",
"]",
";",
"$",
"objectStructure",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"row",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
... | The input structure needs to be a key=>value map.
Every key should be a dot notation property path, every value the
corresponding value.
Example input in ".feature" file notation:
| foo -> json_encode() | ["bar"] |
| foo.2 | batz |
Example output in PHP code:
$result = ["foo" => [0 => "bar", 2: "bat... | [
"The",
"input",
"structure",
"needs",
"to",
"be",
"a",
"key",
"=",
">",
"value",
"map",
".",
"Every",
"key",
"should",
"be",
"a",
"dot",
"notation",
"property",
"path",
"every",
"value",
"the",
"corresponding",
"value",
"."
] | bdac586281fd3ebba4ca3a285df903f790feeee0 | https://github.com/netlogix/Netlogix.BehatCommons/blob/bdac586281fd3ebba4ca3a285df903f790feeee0/Classes/Netlogix/BehatCommons/ObjectFactory.php#L138-L149 | train |
netlogix/Netlogix.BehatCommons | Classes/Netlogix/BehatCommons/ObjectFactory.php | ObjectFactory.rememberLastObjectAs | public function rememberLastObjectAs($identifier)
{
if (array_key_exists($identifier, $this->rememberedObjects)) {
throw new \Exception(sprintf('The identifier "%s" is already taken', $identifier), 1480605866);
}
if (!$this->startObjectTracking) {
throw new \Exception('Object tracking is not started, so re... | php | public function rememberLastObjectAs($identifier)
{
if (array_key_exists($identifier, $this->rememberedObjects)) {
throw new \Exception(sprintf('The identifier "%s" is already taken', $identifier), 1480605866);
}
if (!$this->startObjectTracking) {
throw new \Exception('Object tracking is not started, so re... | [
"public",
"function",
"rememberLastObjectAs",
"(",
"$",
"identifier",
")",
"{",
"if",
"(",
"array_key_exists",
"(",
"$",
"identifier",
",",
"$",
"this",
"->",
"rememberedObjects",
")",
")",
"{",
"throw",
"new",
"\\",
"Exception",
"(",
"sprintf",
"(",
"'The i... | The most recent object created gets remembered by a specific identifier
as long as the current scenario runs.
@param string $identifier
@throws \Exception | [
"The",
"most",
"recent",
"object",
"created",
"gets",
"remembered",
"by",
"a",
"specific",
"identifier",
"as",
"long",
"as",
"the",
"current",
"scenario",
"runs",
"."
] | bdac586281fd3ebba4ca3a285df903f790feeee0 | https://github.com/netlogix/Netlogix.BehatCommons/blob/bdac586281fd3ebba4ca3a285df903f790feeee0/Classes/Netlogix/BehatCommons/ObjectFactory.php#L176-L186 | train |
KDF5000/EasyThink | src/ThinkPHP/Library/Vendor/Smarty/sysplugins/smarty_resource.php | Smarty_Resource.config | public static function config(Smarty_Internal_Config $_config)
{
static $_incompatible_resources = array('eval' => true, 'string' => true, 'extends' => true, 'php' => true);
$config_resource = $_config->config_resource;
$smarty = $_config->smarty;
// parse resource_name
... | php | public static function config(Smarty_Internal_Config $_config)
{
static $_incompatible_resources = array('eval' => true, 'string' => true, 'extends' => true, 'php' => true);
$config_resource = $_config->config_resource;
$smarty = $_config->smarty;
// parse resource_name
... | [
"public",
"static",
"function",
"config",
"(",
"Smarty_Internal_Config",
"$",
"_config",
")",
"{",
"static",
"$",
"_incompatible_resources",
"=",
"array",
"(",
"'eval'",
"=>",
"true",
",",
"'string'",
"=>",
"true",
",",
"'extends'",
"=>",
"true",
",",
"'php'",... | initialize Config Source Object for given resource
@param Smarty_Internal_Config $_config config object
@return Smarty_Config_Source Source Object | [
"initialize",
"Config",
"Source",
"Object",
"for",
"given",
"resource"
] | 86efc9c8a0d504e01e2fea55868227fdc8928841 | https://github.com/KDF5000/EasyThink/blob/86efc9c8a0d504e01e2fea55868227fdc8928841/src/ThinkPHP/Library/Vendor/Smarty/sysplugins/smarty_resource.php#L505-L536 | train |
phpffcms/ffcms-core | src/Managers/BootManager.php | BootManager.parseComposerLoader | private function parseComposerLoader(): void
{
// get composer autoload map
$map = $this->loader->getPrefixes();
if (Any::isArray($map)) {
// get all available apps root dirs by psr loader for apps
if (array_key_exists('Apps\\', $map)) {
foreach ($map[... | php | private function parseComposerLoader(): void
{
// get composer autoload map
$map = $this->loader->getPrefixes();
if (Any::isArray($map)) {
// get all available apps root dirs by psr loader for apps
if (array_key_exists('Apps\\', $map)) {
foreach ($map[... | [
"private",
"function",
"parseComposerLoader",
"(",
")",
":",
"void",
"{",
"// get composer autoload map",
"$",
"map",
"=",
"$",
"this",
"->",
"loader",
"->",
"getPrefixes",
"(",
")",
";",
"if",
"(",
"Any",
"::",
"isArray",
"(",
"$",
"map",
")",
")",
"{",... | Find app's and widgets root directories over composer psr loader | [
"Find",
"app",
"s",
"and",
"widgets",
"root",
"directories",
"over",
"composer",
"psr",
"loader"
] | 44a309553ef9f115ccfcfd71f2ac6e381c612082 | https://github.com/phpffcms/ffcms-core/blob/44a309553ef9f115ccfcfd71f2ac6e381c612082/src/Managers/BootManager.php#L63-L92 | train |
phpffcms/ffcms-core | src/Managers/BootManager.php | BootManager.compileBootableClasses | public function compileBootableClasses(): void
{
// list app root's
foreach ($this->appRoots as $app) {
$app .= '/Apps/Controller/' . env_name;
$files = File::listFiles($app, ['.php'], true);
foreach ($files as $file) {
// define full class name wi... | php | public function compileBootableClasses(): void
{
// list app root's
foreach ($this->appRoots as $app) {
$app .= '/Apps/Controller/' . env_name;
$files = File::listFiles($app, ['.php'], true);
foreach ($files as $file) {
// define full class name wi... | [
"public",
"function",
"compileBootableClasses",
"(",
")",
":",
"void",
"{",
"// list app root's",
"foreach",
"(",
"$",
"this",
"->",
"appRoots",
"as",
"$",
"app",
")",
"{",
"$",
"app",
".=",
"'/Apps/Controller/'",
".",
"env_name",
";",
"$",
"files",
"=",
"... | Find all bootatble instances and set it to object map
@return void | [
"Find",
"all",
"bootatble",
"instances",
"and",
"set",
"it",
"to",
"object",
"map"
] | 44a309553ef9f115ccfcfd71f2ac6e381c612082 | https://github.com/phpffcms/ffcms-core/blob/44a309553ef9f115ccfcfd71f2ac6e381c612082/src/Managers/BootManager.php#L98-L130 | train |
phpffcms/ffcms-core | src/Managers/BootManager.php | BootManager.run | public function run(): bool
{
$this->startMeasure(__METHOD__);
if (!Any::isArray($this->objects)) {
return false;
}
foreach ($this->objects as $class) {
forward_static_call([$class, 'boot']);
}
$this->stopMeasure(__METHOD__);
return ... | php | public function run(): bool
{
$this->startMeasure(__METHOD__);
if (!Any::isArray($this->objects)) {
return false;
}
foreach ($this->objects as $class) {
forward_static_call([$class, 'boot']);
}
$this->stopMeasure(__METHOD__);
return ... | [
"public",
"function",
"run",
"(",
")",
":",
"bool",
"{",
"$",
"this",
"->",
"startMeasure",
"(",
"__METHOD__",
")",
";",
"if",
"(",
"!",
"Any",
"::",
"isArray",
"(",
"$",
"this",
"->",
"objects",
")",
")",
"{",
"return",
"false",
";",
"}",
"foreach... | Call bootable methods in apps and widgets
@return bool | [
"Call",
"bootable",
"methods",
"in",
"apps",
"and",
"widgets"
] | 44a309553ef9f115ccfcfd71f2ac6e381c612082 | https://github.com/phpffcms/ffcms-core/blob/44a309553ef9f115ccfcfd71f2ac6e381c612082/src/Managers/BootManager.php#L136-L150 | train |
SahilDude89ss/PyntaxFramework | src/Pyntax/Html/Table/TableFactory.php | TableFactory.generateTable | public function generateTable(BeanInterface $bean, $findCondition = "", $returnString = false)
{
//Load the config
$this->loadConfig();
if((is_array($findCondition) && !isset($findCondition['limit'])) || empty($findCondition))
{
$recordLimitOnOnePage = $this->getConfigFor... | php | public function generateTable(BeanInterface $bean, $findCondition = "", $returnString = false)
{
//Load the config
$this->loadConfig();
if((is_array($findCondition) && !isset($findCondition['limit'])) || empty($findCondition))
{
$recordLimitOnOnePage = $this->getConfigFor... | [
"public",
"function",
"generateTable",
"(",
"BeanInterface",
"$",
"bean",
",",
"$",
"findCondition",
"=",
"\"\"",
",",
"$",
"returnString",
"=",
"false",
")",
"{",
"//Load the config",
"$",
"this",
"->",
"loadConfig",
"(",
")",
";",
"if",
"(",
"(",
"is_arr... | This function generates the table with the Bean and findCondition is passed.
@param BeanInterface $bean
@param string $findCondition
@param bool|false $returnString
@return string | [
"This",
"function",
"generates",
"the",
"table",
"with",
"the",
"Bean",
"and",
"findCondition",
"is",
"passed",
"."
] | 045cca87d24eb2b6405734966c64344e00224c7b | https://github.com/SahilDude89ss/PyntaxFramework/blob/045cca87d24eb2b6405734966c64344e00224c7b/src/Pyntax/Html/Table/TableFactory.php#L49-L70 | train |
agentmedia/phine-core | src/Core/Logic/Module/ContentForm.php | ContentForm.Area | protected function Area()
{
if (!$this->area) {
$this->area = new Area(Request::GetData('area'));
}
return $this->area;
} | php | protected function Area()
{
if (!$this->area) {
$this->area = new Area(Request::GetData('area'));
}
return $this->area;
} | [
"protected",
"function",
"Area",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"area",
")",
"{",
"$",
"this",
"->",
"area",
"=",
"new",
"Area",
"(",
"Request",
"::",
"GetData",
"(",
"'area'",
")",
")",
";",
"}",
"return",
"$",
"this",
"->",
... | The area from request
@return Area | [
"The",
"area",
"from",
"request"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Module/ContentForm.php#L135-L141 | train |
agentmedia/phine-core | src/Core/Logic/Module/ContentForm.php | ContentForm.Container | protected function Container()
{
if (!$this->container) {
$this->container = new Container(Request::GetData('container'));
}
return $this->container;
} | php | protected function Container()
{
if (!$this->container) {
$this->container = new Container(Request::GetData('container'));
}
return $this->container;
} | [
"protected",
"function",
"Container",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"container",
")",
"{",
"$",
"this",
"->",
"container",
"=",
"new",
"Container",
"(",
"Request",
"::",
"GetData",
"(",
"'container'",
")",
")",
";",
"}",
"return",
... | The container from request
@return Container | [
"The",
"container",
"from",
"request"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Module/ContentForm.php#L153-L159 | train |
agentmedia/phine-core | src/Core/Logic/Module/ContentForm.php | ContentForm.Page | protected function Page()
{
if (!$this->page) {
$this->page = new Page(Request::GetData('page'));
}
return $this->page;
} | php | protected function Page()
{
if (!$this->page) {
$this->page = new Page(Request::GetData('page'));
}
return $this->page;
} | [
"protected",
"function",
"Page",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"page",
")",
"{",
"$",
"this",
"->",
"page",
"=",
"new",
"Page",
"(",
"Request",
"::",
"GetData",
"(",
"'page'",
")",
")",
";",
"}",
"return",
"$",
"this",
"->",
... | The page from request
@return Page | [
"The",
"page",
"from",
"request"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Module/ContentForm.php#L171-L177 | train |
agentmedia/phine-core | src/Core/Logic/Module/ContentForm.php | ContentForm.ParentItem | private function ParentItem()
{
$this->parent = $this->GetTreeItem('parent');
return $this->parent->Exists() ? $this->parent : null;
} | php | private function ParentItem()
{
$this->parent = $this->GetTreeItem('parent');
return $this->parent->Exists() ? $this->parent : null;
} | [
"private",
"function",
"ParentItem",
"(",
")",
"{",
"$",
"this",
"->",
"parent",
"=",
"$",
"this",
"->",
"GetTreeItem",
"(",
"'parent'",
")",
";",
"return",
"$",
"this",
"->",
"parent",
"->",
"Exists",
"(",
")",
"?",
"$",
"this",
"->",
"parent",
":",... | Gets the parent tree item
@return TableObject Returns either the related page or the layout content | [
"Gets",
"the",
"parent",
"tree",
"item"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Module/ContentForm.php#L185-L189 | train |
agentmedia/phine-core | src/Core/Logic/Module/ContentForm.php | ContentForm.PreviousItem | private function PreviousItem()
{
$this->previous = $this->GetTreeItem('previous');
return $this->previous->Exists() ? $this->previous : null;
} | php | private function PreviousItem()
{
$this->previous = $this->GetTreeItem('previous');
return $this->previous->Exists() ? $this->previous : null;
} | [
"private",
"function",
"PreviousItem",
"(",
")",
"{",
"$",
"this",
"->",
"previous",
"=",
"$",
"this",
"->",
"GetTreeItem",
"(",
"'previous'",
")",
";",
"return",
"$",
"this",
"->",
"previous",
"->",
"Exists",
"(",
")",
"?",
"$",
"this",
"->",
"previou... | The previous item
@return TemplateObject | [
"The",
"previous",
"item"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Module/ContentForm.php#L219-L223 | train |
agentmedia/phine-core | src/Core/Logic/Module/ContentForm.php | ContentForm.Location | protected function Location()
{
if ($this->Container()->Exists()) {
return Enums\ContentLocation::Container();
}
else if ($this->Area()->Exists()) {
if ($this->Page()->Exists()) {
return Enums\ContentLocation::Page();
}
return E... | php | protected function Location()
{
if ($this->Container()->Exists()) {
return Enums\ContentLocation::Container();
}
else if ($this->Area()->Exists()) {
if ($this->Page()->Exists()) {
return Enums\ContentLocation::Page();
}
return E... | [
"protected",
"function",
"Location",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"Container",
"(",
")",
"->",
"Exists",
"(",
")",
")",
"{",
"return",
"Enums",
"\\",
"ContentLocation",
"::",
"Container",
"(",
")",
";",
"}",
"else",
"if",
"(",
"$",
... | Gets the content location
@return Enums\ContentLocation | [
"Gets",
"the",
"content",
"location"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Module/ContentForm.php#L229-L241 | train |
agentmedia/phine-core | src/Core/Logic/Module/ContentForm.php | ContentForm.InitContentRights | private function InitContentRights()
{
$beContentRights = null;
if ($this->Content()->Exists()) {
$beContentRights = $this->Content()->GetUserGroupRights();
}
$this->contentRights = new ContentRights($this->FindParentRights(), $beContentRights);
} | php | private function InitContentRights()
{
$beContentRights = null;
if ($this->Content()->Exists()) {
$beContentRights = $this->Content()->GetUserGroupRights();
}
$this->contentRights = new ContentRights($this->FindParentRights(), $beContentRights);
} | [
"private",
"function",
"InitContentRights",
"(",
")",
"{",
"$",
"beContentRights",
"=",
"null",
";",
"if",
"(",
"$",
"this",
"->",
"Content",
"(",
")",
"->",
"Exists",
"(",
")",
")",
"{",
"$",
"beContentRights",
"=",
"$",
"this",
"->",
"Content",
"(",
... | Initialize the content rights snippet | [
"Initialize",
"the",
"content",
"rights",
"snippet"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Module/ContentForm.php#L274-L281 | train |
agentmedia/phine-core | src/Core/Logic/Module/ContentForm.php | ContentForm.FindParentRights | private function FindParentRights()
{
$parentRights = null;
$parentContent = $this->Content()->Exists() ? ContentTreeUtil::ParentOf($this->Content()) : null;
if ($parentContent) {
$parentRights = RightsFinder::FindContentRights($parentContent);
}
if (!$parentRight... | php | private function FindParentRights()
{
$parentRights = null;
$parentContent = $this->Content()->Exists() ? ContentTreeUtil::ParentOf($this->Content()) : null;
if ($parentContent) {
$parentRights = RightsFinder::FindContentRights($parentContent);
}
if (!$parentRight... | [
"private",
"function",
"FindParentRights",
"(",
")",
"{",
"$",
"parentRights",
"=",
"null",
";",
"$",
"parentContent",
"=",
"$",
"this",
"->",
"Content",
"(",
")",
"->",
"Exists",
"(",
")",
"?",
"ContentTreeUtil",
"::",
"ParentOf",
"(",
"$",
"this",
"->"... | Finds the parent rights
@return BackendContentRights | [
"Finds",
"the",
"parent",
"rights"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Module/ContentForm.php#L316-L342 | train |
agentmedia/phine-core | src/Core/Logic/Module/ContentForm.php | ContentForm.RenderGroupRights | protected function RenderGroupRights()
{
if (!$this->CanAssignGroup()) {
return '';
}
$result = $this->RenderElement('UserGroup');
return $result . '<div id="group-rights">' . $this->contentRights->Render() . '</div>';
} | php | protected function RenderGroupRights()
{
if (!$this->CanAssignGroup()) {
return '';
}
$result = $this->RenderElement('UserGroup');
return $result . '<div id="group-rights">' . $this->contentRights->Render() . '</div>';
} | [
"protected",
"function",
"RenderGroupRights",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"CanAssignGroup",
"(",
")",
")",
"{",
"return",
"''",
";",
"}",
"$",
"result",
"=",
"$",
"this",
"->",
"RenderElement",
"(",
"'UserGroup'",
")",
";",
"retur... | Renders the group rights
@return string | [
"Renders",
"the",
"group",
"rights"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Module/ContentForm.php#L348-L355 | train |
agentmedia/phine-core | src/Core/Logic/Module/ContentForm.php | ContentForm.AddGuestsOnlyField | private function AddGuestsOnlyField()
{
$field = new Checkbox('GuestsOnly', '1', (bool) $this->Content()->GetGuestsOnly());
$this->AddField($field, false, Trans('Core.ContentForm.GuestsOnly'));
} | php | private function AddGuestsOnlyField()
{
$field = new Checkbox('GuestsOnly', '1', (bool) $this->Content()->GetGuestsOnly());
$this->AddField($field, false, Trans('Core.ContentForm.GuestsOnly'));
} | [
"private",
"function",
"AddGuestsOnlyField",
"(",
")",
"{",
"$",
"field",
"=",
"new",
"Checkbox",
"(",
"'GuestsOnly'",
",",
"'1'",
",",
"(",
"bool",
")",
"$",
"this",
"->",
"Content",
"(",
")",
"->",
"GetGuestsOnly",
"(",
")",
")",
";",
"$",
"this",
... | Adds the checkbox for "guests only" visibility of a content | [
"Adds",
"the",
"checkbox",
"for",
"guests",
"only",
"visibility",
"of",
"a",
"content"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Module/ContentForm.php#L418-L422 | train |
agentmedia/phine-core | src/Core/Logic/Module/ContentForm.php | ContentForm.LoadElement | protected function LoadElement()
{
if ($this->Content()->Exists()) {
return $this->ElementSchema()->ByContent($this->Content());
}
return $this->ElementSchema()->CreateInstance();
} | php | protected function LoadElement()
{
if ($this->Content()->Exists()) {
return $this->ElementSchema()->ByContent($this->Content());
}
return $this->ElementSchema()->CreateInstance();
} | [
"protected",
"function",
"LoadElement",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"Content",
"(",
")",
"->",
"Exists",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"ElementSchema",
"(",
")",
"->",
"ByContent",
"(",
"$",
"this",
"->",
"Content"... | Helper function to retrieve the content element from database
@return TableObject Returns the content element by content if given | [
"Helper",
"function",
"to",
"retrieve",
"the",
"content",
"element",
"from",
"database"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Module/ContentForm.php#L428-L434 | train |
agentmedia/phine-core | src/Core/Logic/Module/ContentForm.php | ContentForm.SaveContent | private function SaveContent()
{
$this->Content()->SetType($this->FrontendModule()->MyType());
$this->Content()->SetCssClass($this->Value('CssClass'));
$this->Content()->SetCssID($this->Value('CssID'));
$this->Content()->SetTemplate($this->Value('Template'));
$this->Content()... | php | private function SaveContent()
{
$this->Content()->SetType($this->FrontendModule()->MyType());
$this->Content()->SetCssClass($this->Value('CssClass'));
$this->Content()->SetCssID($this->Value('CssID'));
$this->Content()->SetTemplate($this->Value('Template'));
$this->Content()... | [
"private",
"function",
"SaveContent",
"(",
")",
"{",
"$",
"this",
"->",
"Content",
"(",
")",
"->",
"SetType",
"(",
"$",
"this",
"->",
"FrontendModule",
"(",
")",
"->",
"MyType",
"(",
")",
")",
";",
"$",
"this",
"->",
"Content",
"(",
")",
"->",
"Set... | Saves content base properties | [
"Saves",
"content",
"base",
"properties"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Module/ContentForm.php#L465-L497 | train |
agentmedia/phine-core | src/Core/Logic/Module/ContentForm.php | ContentForm.PublishDate | private function PublishDate($baseName)
{
if (!$this->Content()->GetPublish()) {
return null;
}
$strDate = $this->Value($baseName . 'Date');
if (!$strDate) {
return null;
}
$date = \DateTime::createFromFormat($this->dateFormat, $strDate);
... | php | private function PublishDate($baseName)
{
if (!$this->Content()->GetPublish()) {
return null;
}
$strDate = $this->Value($baseName . 'Date');
if (!$strDate) {
return null;
}
$date = \DateTime::createFromFormat($this->dateFormat, $strDate);
... | [
"private",
"function",
"PublishDate",
"(",
"$",
"baseName",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"Content",
"(",
")",
"->",
"GetPublish",
"(",
")",
")",
"{",
"return",
"null",
";",
"}",
"$",
"strDate",
"=",
"$",
"this",
"->",
"Value",
"(",
... | Gets a publishing date
@param string $baseName The base name; 'PublishFrom' or 'PublishTo'
@return Date Returns the date | [
"Gets",
"a",
"publishing",
"date"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Module/ContentForm.php#L515-L527 | train |
agentmedia/phine-core | src/Core/Logic/Module/ContentForm.php | ContentForm.SaveRights | private function SaveRights()
{
$userGroup = Usergroup::Schema()->ByID($this->Value('UserGroup'));
$this->Content()->SetUserGroup($userGroup);
if (!$userGroup) {
$oldRights = $this->Content()->GetUserGroupRights();
if ($oldRights) {
$oldRights->Delete(... | php | private function SaveRights()
{
$userGroup = Usergroup::Schema()->ByID($this->Value('UserGroup'));
$this->Content()->SetUserGroup($userGroup);
if (!$userGroup) {
$oldRights = $this->Content()->GetUserGroupRights();
if ($oldRights) {
$oldRights->Delete(... | [
"private",
"function",
"SaveRights",
"(",
")",
"{",
"$",
"userGroup",
"=",
"Usergroup",
"::",
"Schema",
"(",
")",
"->",
"ByID",
"(",
"$",
"this",
"->",
"Value",
"(",
"'UserGroup'",
")",
")",
";",
"$",
"this",
"->",
"Content",
"(",
")",
"->",
"SetUser... | Saves the content rights and user group | [
"Saves",
"the",
"content",
"rights",
"and",
"user",
"group"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Module/ContentForm.php#L561-L577 | train |
agentmedia/phine-core | src/Core/Logic/Module/ContentForm.php | ContentForm.AttachContent | private function AttachContent($isNew)
{
switch ($this->Location()) {
case Enums\ContentLocation::Layout():
$this->AttachLayoutContent($isNew);
break;
case Enums\ContentLocation::Page():
$this->AttachPageContent($isNew);
... | php | private function AttachContent($isNew)
{
switch ($this->Location()) {
case Enums\ContentLocation::Layout():
$this->AttachLayoutContent($isNew);
break;
case Enums\ContentLocation::Page():
$this->AttachPageContent($isNew);
... | [
"private",
"function",
"AttachContent",
"(",
"$",
"isNew",
")",
"{",
"switch",
"(",
"$",
"this",
"->",
"Location",
"(",
")",
")",
"{",
"case",
"Enums",
"\\",
"ContentLocation",
"::",
"Layout",
"(",
")",
":",
"$",
"this",
"->",
"AttachLayoutContent",
"(",... | Attaches content to tree item
@param boolean $isNew True if content is new | [
"Attaches",
"content",
"to",
"tree",
"item"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Module/ContentForm.php#L591-L607 | train |
agentmedia/phine-core | src/Core/Logic/Module/ContentForm.php | ContentForm.AttachContainerContent | private function AttachContainerContent($isNew)
{
$provider = new ContainerContentTreeProvider($this->Container());
$tree = new TreeBuilder($provider);
$containerContent = $this->Content()->GetContainerContent();
if (!$containerContent) {
$containerContent = new Container... | php | private function AttachContainerContent($isNew)
{
$provider = new ContainerContentTreeProvider($this->Container());
$tree = new TreeBuilder($provider);
$containerContent = $this->Content()->GetContainerContent();
if (!$containerContent) {
$containerContent = new Container... | [
"private",
"function",
"AttachContainerContent",
"(",
"$",
"isNew",
")",
"{",
"$",
"provider",
"=",
"new",
"ContainerContentTreeProvider",
"(",
"$",
"this",
"->",
"Container",
"(",
")",
")",
";",
"$",
"tree",
"=",
"new",
"TreeBuilder",
"(",
"$",
"provider",
... | Attaches the content to the container
@param boolean $isNew | [
"Attaches",
"the",
"content",
"to",
"the",
"container"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Module/ContentForm.php#L645-L658 | train |
agentmedia/phine-core | src/Core/Logic/Module/ContentForm.php | ContentForm.AddCssIDField | protected final function AddCssIDField()
{
$name = 'CssID';
$this->AddField(Input::Text($name, $this->Content()->GetCssID()), false, Trans("Core.ContentForm.$name"));
} | php | protected final function AddCssIDField()
{
$name = 'CssID';
$this->AddField(Input::Text($name, $this->Content()->GetCssID()), false, Trans("Core.ContentForm.$name"));
} | [
"protected",
"final",
"function",
"AddCssIDField",
"(",
")",
"{",
"$",
"name",
"=",
"'CssID'",
";",
"$",
"this",
"->",
"AddField",
"(",
"Input",
"::",
"Text",
"(",
"$",
"name",
",",
"$",
"this",
"->",
"Content",
"(",
")",
"->",
"GetCssID",
"(",
")",
... | Adds the css id form field | [
"Adds",
"the",
"css",
"id",
"form",
"field"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Module/ContentForm.php#L672-L676 | train |
agentmedia/phine-core | src/Core/Logic/Module/ContentForm.php | ContentForm.AddCacheLifetimeField | protected function AddCacheLifetimeField()
{
$name = 'CacheLifetime';
$label = "Core.ContentForm.$name";
$field = Input::Text($name, (string) (int) $this->Content()->GetCacheLifetime());
$this->AddField($field, false, Trans($label));
$this->AddValidator($name, Integer::Positi... | php | protected function AddCacheLifetimeField()
{
$name = 'CacheLifetime';
$label = "Core.ContentForm.$name";
$field = Input::Text($name, (string) (int) $this->Content()->GetCacheLifetime());
$this->AddField($field, false, Trans($label));
$this->AddValidator($name, Integer::Positi... | [
"protected",
"function",
"AddCacheLifetimeField",
"(",
")",
"{",
"$",
"name",
"=",
"'CacheLifetime'",
";",
"$",
"label",
"=",
"\"Core.ContentForm.$name\"",
";",
"$",
"field",
"=",
"Input",
"::",
"Text",
"(",
"$",
"name",
",",
"(",
"string",
")",
"(",
"int"... | Adds the lifetime field | [
"Adds",
"the",
"lifetime",
"field"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Module/ContentForm.php#L753-L760 | train |
agentmedia/phine-core | src/Core/Logic/Module/ContentForm.php | ContentForm.AddTemplateField | protected final function AddTemplateField()
{
$name = 'Template';
$field = new Select($name, (string) $this->Content()->GetTemplate());
$field->AddOption('', Trans("Core.ContentForm.$name.Default"));
$folder = PathUtil::ModuleCustomTemplatesFolder($this->FrontendModule());
i... | php | protected final function AddTemplateField()
{
$name = 'Template';
$field = new Select($name, (string) $this->Content()->GetTemplate());
$field->AddOption('', Trans("Core.ContentForm.$name.Default"));
$folder = PathUtil::ModuleCustomTemplatesFolder($this->FrontendModule());
i... | [
"protected",
"final",
"function",
"AddTemplateField",
"(",
")",
"{",
"$",
"name",
"=",
"'Template'",
";",
"$",
"field",
"=",
"new",
"Select",
"(",
"$",
"name",
",",
"(",
"string",
")",
"$",
"this",
"->",
"Content",
"(",
")",
"->",
"GetTemplate",
"(",
... | Adds the template select field
@param FrontendModule $module The module for template selection | [
"Adds",
"the",
"template",
"select",
"field"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Module/ContentForm.php#L766-L781 | train |
agentmedia/phine-core | src/Core/Logic/Module/ContentForm.php | ContentForm.BackLink | protected function BackLink()
{
$selected = $this->SelectedTreeID();
switch ($this->Location()) {
case Enums\ContentLocation::Page():
return $this->PageBackLink($selected);
case Enums\ContentLocation::Layout():
return $this->LayoutBackLink($se... | php | protected function BackLink()
{
$selected = $this->SelectedTreeID();
switch ($this->Location()) {
case Enums\ContentLocation::Page():
return $this->PageBackLink($selected);
case Enums\ContentLocation::Layout():
return $this->LayoutBackLink($se... | [
"protected",
"function",
"BackLink",
"(",
")",
"{",
"$",
"selected",
"=",
"$",
"this",
"->",
"SelectedTreeID",
"(",
")",
";",
"switch",
"(",
"$",
"this",
"->",
"Location",
"(",
")",
")",
"{",
"case",
"Enums",
"\\",
"ContentLocation",
"::",
"Page",
"(",... | The back link url
@return string | [
"The",
"back",
"link",
"url"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Module/ContentForm.php#L819-L832 | train |
agentmedia/phine-core | src/Core/Logic/Module/ContentForm.php | ContentForm.AddWordingFields | private function AddWordingFields()
{
foreach ($this->Wordings() as $name) {
$wording = $this->FindWording($name);
$fieldName = $this->WordingFieldName($name);
$field = Input::Text($fieldName, $wording ? $wording->GetText() : '');
$field->SetHtmlAttribute('pla... | php | private function AddWordingFields()
{
foreach ($this->Wordings() as $name) {
$wording = $this->FindWording($name);
$fieldName = $this->WordingFieldName($name);
$field = Input::Text($fieldName, $wording ? $wording->GetText() : '');
$field->SetHtmlAttribute('pla... | [
"private",
"function",
"AddWordingFields",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"Wordings",
"(",
")",
"as",
"$",
"name",
")",
"{",
"$",
"wording",
"=",
"$",
"this",
"->",
"FindWording",
"(",
"$",
"name",
")",
";",
"$",
"fieldName",
"=",
... | Adds the wording fields | [
"Adds",
"the",
"wording",
"fields"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Module/ContentForm.php#L868-L877 | train |
agentmedia/phine-core | src/Core/Logic/Module/ContentForm.php | ContentForm.FindWording | private function FindWording($name)
{
if (!$this->Content()->Exists()) {
return null;
}
$sql = Access::SqlBuilder();
$tblWording = ContentWording::Schema()->Table();
$where = $sql->Equals($tblWording->Field('Content'), $sql->Value($this->Content()->GetID()))
... | php | private function FindWording($name)
{
if (!$this->Content()->Exists()) {
return null;
}
$sql = Access::SqlBuilder();
$tblWording = ContentWording::Schema()->Table();
$where = $sql->Equals($tblWording->Field('Content'), $sql->Value($this->Content()->GetID()))
... | [
"private",
"function",
"FindWording",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"Content",
"(",
")",
"->",
"Exists",
"(",
")",
")",
"{",
"return",
"null",
";",
"}",
"$",
"sql",
"=",
"Access",
"::",
"SqlBuilder",
"(",
")",
";"... | Finds the wording with the given placeholder name
@param string $name The placeholder name
@return ContentWording Gets the matching content wording | [
"Finds",
"the",
"wording",
"with",
"the",
"given",
"placeholder",
"name"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Module/ContentForm.php#L935-L946 | train |
jenskooij/cloudcontrol | src/images/BitmapFactory.php | BitmapFactory.loopThroughBodyAndCalculatePixels | private static function loopThroughBodyAndCalculatePixels(BitmapBodyModel $bitmapBodyModel)
{
for ($i = 0; $i < $bitmapBodyModel->bodySize; $i += 3) {
// Calculate line-ending and padding
if ($bitmapBodyModel->x >= $bitmapBodyModel->width) {
// If padding needed... | php | private static function loopThroughBodyAndCalculatePixels(BitmapBodyModel $bitmapBodyModel)
{
for ($i = 0; $i < $bitmapBodyModel->bodySize; $i += 3) {
// Calculate line-ending and padding
if ($bitmapBodyModel->x >= $bitmapBodyModel->width) {
// If padding needed... | [
"private",
"static",
"function",
"loopThroughBodyAndCalculatePixels",
"(",
"BitmapBodyModel",
"$",
"bitmapBodyModel",
")",
"{",
"for",
"(",
"$",
"i",
"=",
"0",
";",
"$",
"i",
"<",
"$",
"bitmapBodyModel",
"->",
"bodySize",
";",
"$",
"i",
"+=",
"3",
")",
"{"... | Loop through the data in the body of the bitmap
file and calculate each individual pixel based on the
bytes
Using a for-loop with index-calculation instead of str_split to avoid large memory consumption
Calculate the next DWORD-position in the body
@param BitmapBodyModel $bitmapBodyModel | [
"Loop",
"through",
"the",
"data",
"in",
"the",
"body",
"of",
"the",
"bitmap",
"file",
"and",
"calculate",
"each",
"individual",
"pixel",
"based",
"on",
"the",
"bytes"
] | 76e5d9ac8f9c50d06d39a995d13cc03742536548 | https://github.com/jenskooij/cloudcontrol/blob/76e5d9ac8f9c50d06d39a995d13cc03742536548/src/images/BitmapFactory.php#L84-L113 | train |
jenskooij/cloudcontrol | src/images/BitmapFactory.php | BitmapFactory.imageCreateFromBmp | public static function imageCreateFromBmp($pathToBitmapFile)
{
$bitmapFileData = self::getBitmapFileData($pathToBitmapFile);
$temp = unpack('H*', $bitmapFileData);
$hex = $temp[1];
$header = substr($hex, 0, 108);
list($width, $height) = self::calculateWidthAndHeight($header)... | php | public static function imageCreateFromBmp($pathToBitmapFile)
{
$bitmapFileData = self::getBitmapFileData($pathToBitmapFile);
$temp = unpack('H*', $bitmapFileData);
$hex = $temp[1];
$header = substr($hex, 0, 108);
list($width, $height) = self::calculateWidthAndHeight($header)... | [
"public",
"static",
"function",
"imageCreateFromBmp",
"(",
"$",
"pathToBitmapFile",
")",
"{",
"$",
"bitmapFileData",
"=",
"self",
"::",
"getBitmapFileData",
"(",
"$",
"pathToBitmapFile",
")",
";",
"$",
"temp",
"=",
"unpack",
"(",
"'H*'",
",",
"$",
"bitmapFileD... | Create Image resource from Bitmap
@see http://www.php.net/manual/en/function.imagecreatefromwbmp.php#86214
@author alexander at alexauto dot nl
@param string $pathToBitmapFile
@return resource
@throws \Exception | [
"Create",
"Image",
"resource",
"from",
"Bitmap"
] | 76e5d9ac8f9c50d06d39a995d13cc03742536548 | https://github.com/jenskooij/cloudcontrol/blob/76e5d9ac8f9c50d06d39a995d13cc03742536548/src/images/BitmapFactory.php#L126-L166 | train |
rawphp/RawConsole | src/RawPHP/RawConsole/Console.php | Console.run | public function run( $args )
{
$this->command = $this->getCommand( $args );
if ( NULL == $this->command )
{
throw new CommandException( 'Command: ' . $args[ 1 ] . ' not found' );
}
$this->processArgs( $this->command, $args );
return $this->command->exec... | php | public function run( $args )
{
$this->command = $this->getCommand( $args );
if ( NULL == $this->command )
{
throw new CommandException( 'Command: ' . $args[ 1 ] . ' not found' );
}
$this->processArgs( $this->command, $args );
return $this->command->exec... | [
"public",
"function",
"run",
"(",
"$",
"args",
")",
"{",
"$",
"this",
"->",
"command",
"=",
"$",
"this",
"->",
"getCommand",
"(",
"$",
"args",
")",
";",
"if",
"(",
"NULL",
"==",
"$",
"this",
"->",
"command",
")",
"{",
"throw",
"new",
"CommandExcept... | Runs the requested command.
@param array $args command line arguments
@return int status code
@throws CommandException in exceptional circumstances | [
"Runs",
"the",
"requested",
"command",
"."
] | 602bedd10f24962305a7ac1979ed326852f4224a | https://github.com/rawphp/RawConsole/blob/602bedd10f24962305a7ac1979ed326852f4224a/src/RawPHP/RawConsole/Console.php#L90-L102 | train |
rawphp/RawConsole | src/RawPHP/RawConsole/Console.php | Console.getCommand | public function getCommand( $args )
{
$class = strtoupper( substr( $args[ 1 ], 0, 1 ) ) . substr( $args[ 1 ], 1 );
$class .= 'Command';
/** @var Command $command */
$command = NULL;
if ( class_exists( $class ) )
{
$command = new $class();
}
... | php | public function getCommand( $args )
{
$class = strtoupper( substr( $args[ 1 ], 0, 1 ) ) . substr( $args[ 1 ], 1 );
$class .= 'Command';
/** @var Command $command */
$command = NULL;
if ( class_exists( $class ) )
{
$command = new $class();
}
... | [
"public",
"function",
"getCommand",
"(",
"$",
"args",
")",
"{",
"$",
"class",
"=",
"strtoupper",
"(",
"substr",
"(",
"$",
"args",
"[",
"1",
"]",
",",
"0",
",",
"1",
")",
")",
".",
"substr",
"(",
"$",
"args",
"[",
"1",
"]",
",",
"1",
")",
";",... | Get the requested command.
@param array $args command line arguments
@global array $commandNamespaces command namespaces
@return ICommand the command | [
"Get",
"the",
"requested",
"command",
"."
] | 602bedd10f24962305a7ac1979ed326852f4224a | https://github.com/rawphp/RawConsole/blob/602bedd10f24962305a7ac1979ed326852f4224a/src/RawPHP/RawConsole/Console.php#L113-L148 | train |
rawphp/RawConsole | src/RawPHP/RawConsole/Console.php | Console.processArgs | public function processArgs( ICommand &$command, $args )
{
$i = 0;
$ops = array_slice( $args, 2 );
while ( $i < count( $ops ) )
{
$o = $ops[ $i ];
if ( Option::isShortCode( $o ) || Option::isLongCode( $o ) )
{
$option = Command::... | php | public function processArgs( ICommand &$command, $args )
{
$i = 0;
$ops = array_slice( $args, 2 );
while ( $i < count( $ops ) )
{
$o = $ops[ $i ];
if ( Option::isShortCode( $o ) || Option::isLongCode( $o ) )
{
$option = Command::... | [
"public",
"function",
"processArgs",
"(",
"ICommand",
"&",
"$",
"command",
",",
"$",
"args",
")",
"{",
"$",
"i",
"=",
"0",
";",
"$",
"ops",
"=",
"array_slice",
"(",
"$",
"args",
",",
"2",
")",
";",
"while",
"(",
"$",
"i",
"<",
"count",
"(",
"$"... | Processes the command line arguments and sets the option
values for the command.
@param ICommand $command the command reference
@param array $args command line args
@throws CommandException | [
"Processes",
"the",
"command",
"line",
"arguments",
"and",
"sets",
"the",
"option",
"values",
"for",
"the",
"command",
"."
] | 602bedd10f24962305a7ac1979ed326852f4224a | https://github.com/rawphp/RawConsole/blob/602bedd10f24962305a7ac1979ed326852f4224a/src/RawPHP/RawConsole/Console.php#L159-L213 | train |
dms-org/common.structure | src/Table/Form/Builder/TableCellValueFieldDefiner.php | TableCellValueFieldDefiner.withCellValuesAsField | public function withCellValuesAsField(IField $field) : TableFieldBuilder
{
return new TableFieldBuilder(
$this->fieldBuilder
->type(new TableType(
$this->cellClassName,
$this->columnField,
... | php | public function withCellValuesAsField(IField $field) : TableFieldBuilder
{
return new TableFieldBuilder(
$this->fieldBuilder
->type(new TableType(
$this->cellClassName,
$this->columnField,
... | [
"public",
"function",
"withCellValuesAsField",
"(",
"IField",
"$",
"field",
")",
":",
"TableFieldBuilder",
"{",
"return",
"new",
"TableFieldBuilder",
"(",
"$",
"this",
"->",
"fieldBuilder",
"->",
"type",
"(",
"new",
"TableType",
"(",
"$",
"this",
"->",
"cellCl... | Defines the cell values as the supplied field.
@param IField $field
@return TableFieldBuilder | [
"Defines",
"the",
"cell",
"values",
"as",
"the",
"supplied",
"field",
"."
] | 23f122182f60df5ec847047a81a39c8aab019ff1 | https://github.com/dms-org/common.structure/blob/23f122182f60df5ec847047a81a39c8aab019ff1/src/Table/Form/Builder/TableCellValueFieldDefiner.php#L69-L80 | train |
Retentio/Boomgo | src/Boomgo/Builder/Generator/AbstractGenerator.php | AbstractGenerator.setTwigGenerator | public function setTwigGenerator(TwigGenerator $twigGenerator)
{
$this->twigGenerator = $twigGenerator;
$this->twigGenerator->setTemplateDirs(array(__DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'Templates'));
$this->twigGenerator->setMustOverwriteIfExists(true);
} | php | public function setTwigGenerator(TwigGenerator $twigGenerator)
{
$this->twigGenerator = $twigGenerator;
$this->twigGenerator->setTemplateDirs(array(__DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'Templates'));
$this->twigGenerator->setMustOverwriteIfExists(true);
} | [
"public",
"function",
"setTwigGenerator",
"(",
"TwigGenerator",
"$",
"twigGenerator",
")",
"{",
"$",
"this",
"->",
"twigGenerator",
"=",
"$",
"twigGenerator",
";",
"$",
"this",
"->",
"twigGenerator",
"->",
"setTemplateDirs",
"(",
"array",
"(",
"__DIR__",
".",
... | Define the twig generator instance
@param TwigGenerator $twigGenerator | [
"Define",
"the",
"twig",
"generator",
"instance"
] | 95cc53777425dd76cd0034046fa4f9e72c04d73a | https://github.com/Retentio/Boomgo/blob/95cc53777425dd76cd0034046fa4f9e72c04d73a/src/Boomgo/Builder/Generator/AbstractGenerator.php#L75-L80 | train |
Retentio/Boomgo | src/Boomgo/Builder/Generator/AbstractGenerator.php | AbstractGenerator.load | public function load($resources, $extension = '')
{
$finder = new Finder();
$collection = array();
if (is_array($resources)) {
foreach ($resources as $resource) {
$subcollection = array();
$subcollection = $this->load($resource);
$... | php | public function load($resources, $extension = '')
{
$finder = new Finder();
$collection = array();
if (is_array($resources)) {
foreach ($resources as $resource) {
$subcollection = array();
$subcollection = $this->load($resource);
$... | [
"public",
"function",
"load",
"(",
"$",
"resources",
",",
"$",
"extension",
"=",
"''",
")",
"{",
"$",
"finder",
"=",
"new",
"Finder",
"(",
")",
";",
"$",
"collection",
"=",
"array",
"(",
")",
";",
"if",
"(",
"is_array",
"(",
"$",
"resources",
")",
... | Return a collection of files
@param mixed $resources Absolute file or directory path or an array of both
@param string $extension File extension to load/filter with the prefixed dot (.php, .yml)
@throws InvalidArgumentException If resources aren't absolute dir or file path
@return array | [
"Return",
"a",
"collection",
"of",
"files"
] | 95cc53777425dd76cd0034046fa4f9e72c04d73a | https://github.com/Retentio/Boomgo/blob/95cc53777425dd76cd0034046fa4f9e72c04d73a/src/Boomgo/Builder/Generator/AbstractGenerator.php#L102-L125 | train |
praxigento/mobi_mod_pv | Service/Sale/Account/Pv.php | Pv.getSaleOrderData | private function getSaleOrderData($saleId)
{
/* get referral customer ID */
$entity = $this->daoGeneric->getEntityByPk(
Cfg::ENTITY_MAGE_SALES_ORDER,
[Cfg::E_COMMON_A_ENTITY_ID => $saleId],
[Cfg::E_SALE_ORDER_A_CUSTOMER_ID, Cfg::E_SALE_ORDER_A_INCREMENT_ID]
... | php | private function getSaleOrderData($saleId)
{
/* get referral customer ID */
$entity = $this->daoGeneric->getEntityByPk(
Cfg::ENTITY_MAGE_SALES_ORDER,
[Cfg::E_COMMON_A_ENTITY_ID => $saleId],
[Cfg::E_SALE_ORDER_A_CUSTOMER_ID, Cfg::E_SALE_ORDER_A_INCREMENT_ID]
... | [
"private",
"function",
"getSaleOrderData",
"(",
"$",
"saleId",
")",
"{",
"/* get referral customer ID */",
"$",
"entity",
"=",
"$",
"this",
"->",
"daoGeneric",
"->",
"getEntityByPk",
"(",
"Cfg",
"::",
"ENTITY_MAGE_SALES_ORDER",
",",
"[",
"Cfg",
"::",
"E_COMMON_A_E... | Get significant attributes of the sale order.
@param int $saleId
@return array [$custId, $incId] | [
"Get",
"significant",
"attributes",
"of",
"the",
"sale",
"order",
"."
] | d1540b7e94264527006e8b9fa68904a72a63928e | https://github.com/praxigento/mobi_mod_pv/blob/d1540b7e94264527006e8b9fa68904a72a63928e/Service/Sale/Account/Pv.php#L124-L135 | train |
FlexModel/FlexModelBundle | Form/Type/FlexModelFormType.php | FlexModelFormType.getFieldType | private function getFieldType(array $formFieldConfiguration, array $fieldConfiguration)
{
if (isset($formFieldConfiguration['fieldtype'])) {
return $formFieldConfiguration['fieldtype'];
}
$fieldType = null;
switch ($fieldConfiguration['datatype']) {
case 'BOO... | php | private function getFieldType(array $formFieldConfiguration, array $fieldConfiguration)
{
if (isset($formFieldConfiguration['fieldtype'])) {
return $formFieldConfiguration['fieldtype'];
}
$fieldType = null;
switch ($fieldConfiguration['datatype']) {
case 'BOO... | [
"private",
"function",
"getFieldType",
"(",
"array",
"$",
"formFieldConfiguration",
",",
"array",
"$",
"fieldConfiguration",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"formFieldConfiguration",
"[",
"'fieldtype'",
"]",
")",
")",
"{",
"return",
"$",
"formFieldConfig... | Returns the field type for a field.
@param array $formFieldConfiguration
@param array $fieldConfiguration
@return array | [
"Returns",
"the",
"field",
"type",
"for",
"a",
"field",
"."
] | 7b4720d25b0dc6baf29b1da8ad7c67dfb2686460 | https://github.com/FlexModel/FlexModelBundle/blob/7b4720d25b0dc6baf29b1da8ad7c67dfb2686460/Form/Type/FlexModelFormType.php#L99-L149 | train |
FlexModel/FlexModelBundle | Form/Type/FlexModelFormType.php | FlexModelFormType.getFieldOptions | protected function getFieldOptions(array $formFieldConfiguration, array $fieldConfiguration)
{
$options = array(
'label' => '',
'required' => false,
'constraints' => array(),
);
if (empty($fieldConfiguration)) {
$options['mapped'] = false;
... | php | protected function getFieldOptions(array $formFieldConfiguration, array $fieldConfiguration)
{
$options = array(
'label' => '',
'required' => false,
'constraints' => array(),
);
if (empty($fieldConfiguration)) {
$options['mapped'] = false;
... | [
"protected",
"function",
"getFieldOptions",
"(",
"array",
"$",
"formFieldConfiguration",
",",
"array",
"$",
"fieldConfiguration",
")",
"{",
"$",
"options",
"=",
"array",
"(",
"'label'",
"=>",
"''",
",",
"'required'",
"=>",
"false",
",",
"'constraints'",
"=>",
... | Returns the field options for a field.
@param array $formFieldConfiguration
@param array $fieldConfiguration
@return array | [
"Returns",
"the",
"field",
"options",
"for",
"a",
"field",
"."
] | 7b4720d25b0dc6baf29b1da8ad7c67dfb2686460 | https://github.com/FlexModel/FlexModelBundle/blob/7b4720d25b0dc6baf29b1da8ad7c67dfb2686460/Form/Type/FlexModelFormType.php#L159-L191 | train |
FlexModel/FlexModelBundle | Form/Type/FlexModelFormType.php | FlexModelFormType.addFieldPlaceholder | public function addFieldPlaceholder(array &$options, array $formFieldConfiguration, array $fieldConfiguration)
{
$fieldType = $this->getFieldType($formFieldConfiguration, $fieldConfiguration);
if (isset($formFieldConfiguration['notices']['placeholder'])) {
if (in_array($fieldType, array... | php | public function addFieldPlaceholder(array &$options, array $formFieldConfiguration, array $fieldConfiguration)
{
$fieldType = $this->getFieldType($formFieldConfiguration, $fieldConfiguration);
if (isset($formFieldConfiguration['notices']['placeholder'])) {
if (in_array($fieldType, array... | [
"public",
"function",
"addFieldPlaceholder",
"(",
"array",
"&",
"$",
"options",
",",
"array",
"$",
"formFieldConfiguration",
",",
"array",
"$",
"fieldConfiguration",
")",
"{",
"$",
"fieldType",
"=",
"$",
"this",
"->",
"getFieldType",
"(",
"$",
"formFieldConfigur... | Adds the placeholder for a field based on the type.
@param array $options
@param array $formFieldConfiguration
@param array $fieldConfiguration | [
"Adds",
"the",
"placeholder",
"for",
"a",
"field",
"based",
"on",
"the",
"type",
"."
] | 7b4720d25b0dc6baf29b1da8ad7c67dfb2686460 | https://github.com/FlexModel/FlexModelBundle/blob/7b4720d25b0dc6baf29b1da8ad7c67dfb2686460/Form/Type/FlexModelFormType.php#L200-L211 | train |
FlexModel/FlexModelBundle | Form/Type/FlexModelFormType.php | FlexModelFormType.addFieldChoiceOptions | private function addFieldChoiceOptions(array &$options, array $formFieldConfiguration, array $fieldConfiguration)
{
if (isset($formFieldConfiguration['options'])) {
$fieldConfiguration['options'] = $formFieldConfiguration['options'];
}
if (isset($fieldConfiguration['options'])) ... | php | private function addFieldChoiceOptions(array &$options, array $formFieldConfiguration, array $fieldConfiguration)
{
if (isset($formFieldConfiguration['options'])) {
$fieldConfiguration['options'] = $formFieldConfiguration['options'];
}
if (isset($fieldConfiguration['options'])) ... | [
"private",
"function",
"addFieldChoiceOptions",
"(",
"array",
"&",
"$",
"options",
",",
"array",
"$",
"formFieldConfiguration",
",",
"array",
"$",
"fieldConfiguration",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"formFieldConfiguration",
"[",
"'options'",
"]",
")",... | Adds the choices option to the field options.
@param array $options
@param array $formFieldConfiguration
@param array $fieldConfiguration | [
"Adds",
"the",
"choices",
"option",
"to",
"the",
"field",
"options",
"."
] | 7b4720d25b0dc6baf29b1da8ad7c67dfb2686460 | https://github.com/FlexModel/FlexModelBundle/blob/7b4720d25b0dc6baf29b1da8ad7c67dfb2686460/Form/Type/FlexModelFormType.php#L239-L251 | train |
FlexModel/FlexModelBundle | Form/Type/FlexModelFormType.php | FlexModelFormType.addFieldConstraintOptions | private function addFieldConstraintOptions(array &$options, array $formFieldConfiguration)
{
if ($options['required'] === true) {
$options['constraints'][] = new NotBlank();
}
if (isset($formFieldConfiguration['validators'])) {
$options['constraints'] = array();
... | php | private function addFieldConstraintOptions(array &$options, array $formFieldConfiguration)
{
if ($options['required'] === true) {
$options['constraints'][] = new NotBlank();
}
if (isset($formFieldConfiguration['validators'])) {
$options['constraints'] = array();
... | [
"private",
"function",
"addFieldConstraintOptions",
"(",
"array",
"&",
"$",
"options",
",",
"array",
"$",
"formFieldConfiguration",
")",
"{",
"if",
"(",
"$",
"options",
"[",
"'required'",
"]",
"===",
"true",
")",
"{",
"$",
"options",
"[",
"'constraints'",
"]... | Adds the constraints option to the field options.
@param array $options
@param array $formFieldConfiguration | [
"Adds",
"the",
"constraints",
"option",
"to",
"the",
"field",
"options",
"."
] | 7b4720d25b0dc6baf29b1da8ad7c67dfb2686460 | https://github.com/FlexModel/FlexModelBundle/blob/7b4720d25b0dc6baf29b1da8ad7c67dfb2686460/Form/Type/FlexModelFormType.php#L259-L271 | train |
kabachello/phpTextTable | TextTable.php | TextTable.setRows | public function setRows(array $rows)
{
$this->rows = $rows;
$this->setKeys(array_keys($this->rows[0]));
return $this;
} | php | public function setRows(array $rows)
{
$this->rows = $rows;
$this->setKeys(array_keys($this->rows[0]));
return $this;
} | [
"public",
"function",
"setRows",
"(",
"array",
"$",
"rows",
")",
"{",
"$",
"this",
"->",
"rows",
"=",
"$",
"rows",
";",
"$",
"this",
"->",
"setKeys",
"(",
"array_keys",
"(",
"$",
"this",
"->",
"rows",
"[",
"0",
"]",
")",
")",
";",
"return",
"$",
... | Sets the array to be printed
@param array $rows
@return \kabachello\phpTextTable\TextTable | [
"Sets",
"the",
"array",
"to",
"be",
"printed"
] | 19cf95002dba3e1c2d183522ba2515f788efece9 | https://github.com/kabachello/phpTextTable/blob/19cf95002dba3e1c2d183522ba2515f788efece9/TextTable.php#L151-L156 | train |
kabachello/phpTextTable | TextTable.php | TextTable.calculateDimensions | protected function calculateDimensions()
{
foreach ($this->getRows() as $x => $row) {
foreach ($row as $y => $value) {
$this->calculateDimensionsForCell($x, $y, $value);
}
}
return $this;
} | php | protected function calculateDimensions()
{
foreach ($this->getRows() as $x => $row) {
foreach ($row as $y => $value) {
$this->calculateDimensionsForCell($x, $y, $value);
}
}
return $this;
} | [
"protected",
"function",
"calculateDimensions",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"getRows",
"(",
")",
"as",
"$",
"x",
"=>",
"$",
"row",
")",
"{",
"foreach",
"(",
"$",
"row",
"as",
"$",
"y",
"=>",
"$",
"value",
")",
"{",
"$",
"thi... | Calculates the dimensions of the table
@return TextTable | [
"Calculates",
"the",
"dimensions",
"of",
"the",
"table"
] | 19cf95002dba3e1c2d183522ba2515f788efece9 | https://github.com/kabachello/phpTextTable/blob/19cf95002dba3e1c2d183522ba2515f788efece9/TextTable.php#L163-L171 | train |
kabachello/phpTextTable | TextTable.php | TextTable.print | public function print($row_key)
{
$this->calculateDimensions();
$result = '';
if ($this->getPrintHeader()) {
$result .= $this->printHeader();
} else {
$result .= $this->printRowLine();
}
if (! is_null($row_key)) {
... | php | public function print($row_key)
{
$this->calculateDimensions();
$result = '';
if ($this->getPrintHeader()) {
$result .= $this->printHeader();
} else {
$result .= $this->printRowLine();
}
if (! is_null($row_key)) {
... | [
"public",
"function",
"print",
"(",
"$",
"row_key",
")",
"{",
"$",
"this",
"->",
"calculateDimensions",
"(",
")",
";",
"$",
"result",
"=",
"''",
";",
"if",
"(",
"$",
"this",
"->",
"getPrintHeader",
"(",
")",
")",
"{",
"$",
"result",
".=",
"$",
"thi... | Prints the data to a text table
@return string | [
"Prints",
"the",
"data",
"to",
"a",
"text",
"table"
] | 19cf95002dba3e1c2d183522ba2515f788efece9 | https://github.com/kabachello/phpTextTable/blob/19cf95002dba3e1c2d183522ba2515f788efece9/TextTable.php#L198-L220 | train |
amarkal/amarkal-core | Utility.php | Utility.path_to_url | static function path_to_url( $path )
{
// We are replacing DIRECTORY_SEPARATOR with forward slash here
// to avoid issues in Windows systems
$path = str_replace( DIRECTORY_SEPARATOR, '/', $path);
$abspath = str_replace( DIRECTORY_SEPARATOR, '/', ABSPATH);
$url = str_r... | php | static function path_to_url( $path )
{
// We are replacing DIRECTORY_SEPARATOR with forward slash here
// to avoid issues in Windows systems
$path = str_replace( DIRECTORY_SEPARATOR, '/', $path);
$abspath = str_replace( DIRECTORY_SEPARATOR, '/', ABSPATH);
$url = str_r... | [
"static",
"function",
"path_to_url",
"(",
"$",
"path",
")",
"{",
"// We are replacing DIRECTORY_SEPARATOR with forward slash here ",
"// to avoid issues in Windows systems",
"$",
"path",
"=",
"str_replace",
"(",
"DIRECTORY_SEPARATOR",
",",
"'/'",
",",
"$",
"path",
")",
";... | Convert the given path to a URL.
@param string $path
@return string | [
"Convert",
"the",
"given",
"path",
"to",
"a",
"URL",
"."
] | 92062bc95fd9fef20a43a0bc3d35f50a4ac558d3 | https://github.com/amarkal/amarkal-core/blob/92062bc95fd9fef20a43a0bc3d35f50a4ac558d3/Utility.php#L16-L25 | train |
nicmart/DomainSpecificQuery | src/Lucene/Compiler/LuceneQueryCompiler.php | LuceneQueryCompiler.queryToAndExpression | private function queryToAndExpression(LuceneQuery $query)
{
$span = new SpanExpression('AND');
if (!$query->hasTrivialMainQuery())
$span->addExpression($query->getMainQuery());
$span->addExpressions($query->getFilterQueries());
return $span;
} | php | private function queryToAndExpression(LuceneQuery $query)
{
$span = new SpanExpression('AND');
if (!$query->hasTrivialMainQuery())
$span->addExpression($query->getMainQuery());
$span->addExpressions($query->getFilterQueries());
return $span;
} | [
"private",
"function",
"queryToAndExpression",
"(",
"LuceneQuery",
"$",
"query",
")",
"{",
"$",
"span",
"=",
"new",
"SpanExpression",
"(",
"'AND'",
")",
";",
"if",
"(",
"!",
"$",
"query",
"->",
"hasTrivialMainQuery",
"(",
")",
")",
"$",
"span",
"->",
"ad... | Convert a query to an AND expression
@param LuceneQuery $query
@return SpanExpression | [
"Convert",
"a",
"query",
"to",
"an",
"AND",
"expression"
] | 7c01fe94337afdfae5884809e8b5487127a63ac3 | https://github.com/nicmart/DomainSpecificQuery/blob/7c01fe94337afdfae5884809e8b5487127a63ac3/src/Lucene/Compiler/LuceneQueryCompiler.php#L132-L142 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.