id int32 0 241k | repo stringlengths 6 63 | path stringlengths 5 140 | func_name stringlengths 3 151 | original_string stringlengths 84 13k | language stringclasses 1
value | code stringlengths 84 13k | code_tokens list | docstring stringlengths 3 47.2k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 91 247 |
|---|---|---|---|---|---|---|---|---|---|---|---|
193,700 | ezra-obiwale/dSCore | src/Form/AValidator.php | AValidator.validate | private function validate() {
$filterer = new Filterer();
$valid = true;
foreach ($this->elements as $element) {
if (!$element->validate($filterer, $this->data))
$valid = false;
$this->data[$element->name] = ($element->type === 'fieldset') ?
... | php | private function validate() {
$filterer = new Filterer();
$valid = true;
foreach ($this->elements as $element) {
if (!$element->validate($filterer, $this->data))
$valid = false;
$this->data[$element->name] = ($element->type === 'fieldset') ?
... | [
"private",
"function",
"validate",
"(",
")",
"{",
"$",
"filterer",
"=",
"new",
"Filterer",
"(",
")",
";",
"$",
"valid",
"=",
"true",
";",
"foreach",
"(",
"$",
"this",
"->",
"elements",
"as",
"$",
"element",
")",
"{",
"if",
"(",
"!",
"$",
"element",... | Validates the data
@return boolean | [
"Validates",
"the",
"data"
] | dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d | https://github.com/ezra-obiwale/dSCore/blob/dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d/src/Form/AValidator.php#L59-L70 |
193,701 | rollerworks/search-core | SearchConditionBuilder.php | SearchConditionBuilder.group | public function group(string $logical = ValuesGroup::GROUP_LOGICAL_AND): self
{
$builder = new self($logical, $this->fieldSet, $this);
$this->valuesGroup->addGroup($builder->getGroup());
return $builder;
} | php | public function group(string $logical = ValuesGroup::GROUP_LOGICAL_AND): self
{
$builder = new self($logical, $this->fieldSet, $this);
$this->valuesGroup->addGroup($builder->getGroup());
return $builder;
} | [
"public",
"function",
"group",
"(",
"string",
"$",
"logical",
"=",
"ValuesGroup",
"::",
"GROUP_LOGICAL_AND",
")",
":",
"self",
"{",
"$",
"builder",
"=",
"new",
"self",
"(",
"$",
"logical",
",",
"$",
"this",
"->",
"fieldSet",
",",
"$",
"this",
")",
";",... | Create a new ValuesGroup and returns the object instance.
Afterwards the group can be expended with fields or subgroups:
```
->group()
->field('name')
->...
->end() // return back to the ValuesGroup.
->end() // return back to the parent ValuesGroup
```
@param string $logical eg. one of the following ValuesGroup clas... | [
"Create",
"a",
"new",
"ValuesGroup",
"and",
"returns",
"the",
"object",
"instance",
"."
] | 6b5671b8c4d6298906ded768261b0a59845140fb | https://github.com/rollerworks/search-core/blob/6b5671b8c4d6298906ded768261b0a59845140fb/SearchConditionBuilder.php#L59-L65 |
193,702 | rollerworks/search-core | SearchConditionBuilder.php | SearchConditionBuilder.getSearchCondition | public function getSearchCondition(): SearchCondition
{
if ($this->parent) {
return $this->parent->getSearchCondition();
}
// This the root of the condition so now traverse back up the hierarchy.
// We need to re-create the condition using actual objects.
$rootVa... | php | public function getSearchCondition(): SearchCondition
{
if ($this->parent) {
return $this->parent->getSearchCondition();
}
// This the root of the condition so now traverse back up the hierarchy.
// We need to re-create the condition using actual objects.
$rootVa... | [
"public",
"function",
"getSearchCondition",
"(",
")",
":",
"SearchCondition",
"{",
"if",
"(",
"$",
"this",
"->",
"parent",
")",
"{",
"return",
"$",
"this",
"->",
"parent",
"->",
"getSearchCondition",
"(",
")",
";",
"}",
"// This the root of the condition so now ... | Build the SearchCondition object using the groups and fields. | [
"Build",
"the",
"SearchCondition",
"object",
"using",
"the",
"groups",
"and",
"fields",
"."
] | 6b5671b8c4d6298906ded768261b0a59845140fb | https://github.com/rollerworks/search-core/blob/6b5671b8c4d6298906ded768261b0a59845140fb/SearchConditionBuilder.php#L113-L125 |
193,703 | SCLInternet/SclZfGenericMapper | src/SclZfGenericMapper/CommonMapperMethodsTrait.php | CommonMapperMethodsTrait.create | public function create()
{
$entityClass = $this->getEntityName();
$reflection = new \ReflectionClass($entityClass);
if ($reflection->isAbstract()) {
throw RuntimeException::createAbstract($entityClass);
}
return new $entityClass();
} | php | public function create()
{
$entityClass = $this->getEntityName();
$reflection = new \ReflectionClass($entityClass);
if ($reflection->isAbstract()) {
throw RuntimeException::createAbstract($entityClass);
}
return new $entityClass();
} | [
"public",
"function",
"create",
"(",
")",
"{",
"$",
"entityClass",
"=",
"$",
"this",
"->",
"getEntityName",
"(",
")",
";",
"$",
"reflection",
"=",
"new",
"\\",
"ReflectionClass",
"(",
"$",
"entityClass",
")",
";",
"if",
"(",
"$",
"reflection",
"->",
"i... | Creates an instance of the entity.
@return object
@throws RuntimeException If prototype has not yet been set. | [
"Creates",
"an",
"instance",
"of",
"the",
"entity",
"."
] | c61c61546bfbc07e9c9a4b425e8e02fd7182d80b | https://github.com/SCLInternet/SclZfGenericMapper/blob/c61c61546bfbc07e9c9a4b425e8e02fd7182d80b/src/SclZfGenericMapper/CommonMapperMethodsTrait.php#L35-L46 |
193,704 | SCLInternet/SclZfGenericMapper | src/SclZfGenericMapper/CommonMapperMethodsTrait.php | CommonMapperMethodsTrait.singleEntity | protected function singleEntity($entity)
{
if (empty($entity)) {
return null;
}
$singleEntity = $entity;
if (is_array($entity)) {
if (count($entity) > 1) {
throw RuntimeException::multipleResultsFound();
}
$singleEnti... | php | protected function singleEntity($entity)
{
if (empty($entity)) {
return null;
}
$singleEntity = $entity;
if (is_array($entity)) {
if (count($entity) > 1) {
throw RuntimeException::multipleResultsFound();
}
$singleEnti... | [
"protected",
"function",
"singleEntity",
"(",
"$",
"entity",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"entity",
")",
")",
"{",
"return",
"null",
";",
"}",
"$",
"singleEntity",
"=",
"$",
"entity",
";",
"if",
"(",
"is_array",
"(",
"$",
"entity",
")",
... | Makes sure a result contains a single result.
@param array|null|object entity
@return object|null
@throws RuntimeException If mulitple entities are found in the array.
@throws InvalidArgumentException If the object is not an entity. | [
"Makes",
"sure",
"a",
"result",
"contains",
"a",
"single",
"result",
"."
] | c61c61546bfbc07e9c9a4b425e8e02fd7182d80b | https://github.com/SCLInternet/SclZfGenericMapper/blob/c61c61546bfbc07e9c9a4b425e8e02fd7182d80b/src/SclZfGenericMapper/CommonMapperMethodsTrait.php#L74-L100 |
193,705 | SCLInternet/SclZfGenericMapper | src/SclZfGenericMapper/CommonMapperMethodsTrait.php | CommonMapperMethodsTrait.checkIsEntity | public function checkIsEntity($object)
{
if (!$object instanceof $this->entityName) {
throw InvalidArgumentException::invalidEntityType(
$this->getEntityName(),
$object
);
}
} | php | public function checkIsEntity($object)
{
if (!$object instanceof $this->entityName) {
throw InvalidArgumentException::invalidEntityType(
$this->getEntityName(),
$object
);
}
} | [
"public",
"function",
"checkIsEntity",
"(",
"$",
"object",
")",
"{",
"if",
"(",
"!",
"$",
"object",
"instanceof",
"$",
"this",
"->",
"entityName",
")",
"{",
"throw",
"InvalidArgumentException",
"::",
"invalidEntityType",
"(",
"$",
"this",
"->",
"getEntityName"... | Checks the given entity is an instance of the entity this mapper works with.
@param mixed $object
@return void
@throws InvalidArgumentException If $object is not an entity. | [
"Checks",
"the",
"given",
"entity",
"is",
"an",
"instance",
"of",
"the",
"entity",
"this",
"mapper",
"works",
"with",
"."
] | c61c61546bfbc07e9c9a4b425e8e02fd7182d80b | https://github.com/SCLInternet/SclZfGenericMapper/blob/c61c61546bfbc07e9c9a4b425e8e02fd7182d80b/src/SclZfGenericMapper/CommonMapperMethodsTrait.php#L111-L119 |
193,706 | SCLInternet/SclZfGenericMapper | src/SclZfGenericMapper/CommonMapperMethodsTrait.php | CommonMapperMethodsTrait.setPrototype | protected function setPrototype($prototype)
{
if ($this->entityName) {
throw RuntimeException::setPrototypeCalledAgain();
}
$this->entityName = is_object($prototype)
? get_class($prototype)
: $prototype;
} | php | protected function setPrototype($prototype)
{
if ($this->entityName) {
throw RuntimeException::setPrototypeCalledAgain();
}
$this->entityName = is_object($prototype)
? get_class($prototype)
: $prototype;
} | [
"protected",
"function",
"setPrototype",
"(",
"$",
"prototype",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"entityName",
")",
"{",
"throw",
"RuntimeException",
"::",
"setPrototypeCalledAgain",
"(",
")",
";",
"}",
"$",
"this",
"->",
"entityName",
"=",
"is_object... | Setup the prototype of the entity this mapper works with.
@param object $prototype | [
"Setup",
"the",
"prototype",
"of",
"the",
"entity",
"this",
"mapper",
"works",
"with",
"."
] | c61c61546bfbc07e9c9a4b425e8e02fd7182d80b | https://github.com/SCLInternet/SclZfGenericMapper/blob/c61c61546bfbc07e9c9a4b425e8e02fd7182d80b/src/SclZfGenericMapper/CommonMapperMethodsTrait.php#L126-L135 |
193,707 | maikealame/auto-where | src/Where.php | Where.havingComplete | public static function havingComplete($array){
$c = 0;
$r = "";
if( is_array( $array ) )
foreach($array as $k => $v){
if($c) $r .= " AND ";
if (strpos($v, ":") !== false){ // number range [0] e [1]
$vArray = explode(":",$v);
... | php | public static function havingComplete($array){
$c = 0;
$r = "";
if( is_array( $array ) )
foreach($array as $k => $v){
if($c) $r .= " AND ";
if (strpos($v, ":") !== false){ // number range [0] e [1]
$vArray = explode(":",$v);
... | [
"public",
"static",
"function",
"havingComplete",
"(",
"$",
"array",
")",
"{",
"$",
"c",
"=",
"0",
";",
"$",
"r",
"=",
"\"\"",
";",
"if",
"(",
"is_array",
"(",
"$",
"array",
")",
")",
"foreach",
"(",
"$",
"array",
"as",
"$",
"k",
"=>",
"$",
"v"... | not in use, needs improves and tests | [
"not",
"in",
"use",
"needs",
"improves",
"and",
"tests"
] | 663542a11b1ee6222b8868ea91639f01ee69ff80 | https://github.com/maikealame/auto-where/blob/663542a11b1ee6222b8868ea91639f01ee69ff80/src/Where.php#L461-L487 |
193,708 | maikealame/auto-where | src/Where.php | Where.parseDate | public static function parseDate($date, $format){
if( $format == "d/m/Y" ) return self::parseDate1($date, $format);
if( $format == "Y-m-d" ) return self::parseDate2($date, $format);
return null;
} | php | public static function parseDate($date, $format){
if( $format == "d/m/Y" ) return self::parseDate1($date, $format);
if( $format == "Y-m-d" ) return self::parseDate2($date, $format);
return null;
} | [
"public",
"static",
"function",
"parseDate",
"(",
"$",
"date",
",",
"$",
"format",
")",
"{",
"if",
"(",
"$",
"format",
"==",
"\"d/m/Y\"",
")",
"return",
"self",
"::",
"parseDate1",
"(",
"$",
"date",
",",
"$",
"format",
")",
";",
"if",
"(",
"$",
"fo... | Helps for data manipulation | [
"Helps",
"for",
"data",
"manipulation"
] | 663542a11b1ee6222b8868ea91639f01ee69ff80 | https://github.com/maikealame/auto-where/blob/663542a11b1ee6222b8868ea91639f01ee69ff80/src/Where.php#L495-L499 |
193,709 | agentmedia/phine-core | src/Core/Modules/Backend/ModuleLockForm.php | ModuleLockForm.Bundles | protected function Bundles()
{
$bundles = PathUtil::Bundles();
$result = array();
foreach ($bundles as $bundle)
{
if (count($this->Modules($bundle)) > 0)
{
$result[] = $bundle;
}
}
return $result;
} | php | protected function Bundles()
{
$bundles = PathUtil::Bundles();
$result = array();
foreach ($bundles as $bundle)
{
if (count($this->Modules($bundle)) > 0)
{
$result[] = $bundle;
}
}
return $result;
} | [
"protected",
"function",
"Bundles",
"(",
")",
"{",
"$",
"bundles",
"=",
"PathUtil",
"::",
"Bundles",
"(",
")",
";",
"$",
"result",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"bundles",
"as",
"$",
"bundle",
")",
"{",
"if",
"(",
"count",
"(",
... | Gets all bundles containing backend modules
@return string[] Returns all bundle names | [
"Gets",
"all",
"bundles",
"containing",
"backend",
"modules"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Modules/Backend/ModuleLockForm.php#L92-L104 |
193,710 | agentmedia/phine-core | src/Core/Modules/Backend/ModuleLockForm.php | ModuleLockForm.Modules | protected function Modules($bundle)
{
$modules = PathUtil::BackendModules($bundle);
$result = array();
foreach ($modules as $module)
{
$instance = ClassFinder::CreateBackendModule(ClassFinder::CalcModuleType($bundle, $module));
if ($instance instanceof Backend... | php | protected function Modules($bundle)
{
$modules = PathUtil::BackendModules($bundle);
$result = array();
foreach ($modules as $module)
{
$instance = ClassFinder::CreateBackendModule(ClassFinder::CalcModuleType($bundle, $module));
if ($instance instanceof Backend... | [
"protected",
"function",
"Modules",
"(",
"$",
"bundle",
")",
"{",
"$",
"modules",
"=",
"PathUtil",
"::",
"BackendModules",
"(",
"$",
"bundle",
")",
";",
"$",
"result",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"modules",
"as",
"$",
"module",
... | Gets all backend module names for a bundle
@param string $bundle The bundle name
@return string Returns the module names | [
"Gets",
"all",
"backend",
"module",
"names",
"for",
"a",
"bundle"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Modules/Backend/ModuleLockForm.php#L111-L124 |
193,711 | agentmedia/phine-core | src/Core/Modules/Backend/ModuleLockForm.php | ModuleLockForm.HasLock | private function HasLock($bundle, $module = '')
{
$sql = Access::SqlBuilder();
$tblModLock = ModuleLock::Schema()->Table();
$where = $sql->Equals($tblModLock->Field('Bundle'), $sql->Value($bundle))
->And_($sql->Equals($tblModLock->Field('Module'), $sql->Value($mo... | php | private function HasLock($bundle, $module = '')
{
$sql = Access::SqlBuilder();
$tblModLock = ModuleLock::Schema()->Table();
$where = $sql->Equals($tblModLock->Field('Bundle'), $sql->Value($bundle))
->And_($sql->Equals($tblModLock->Field('Module'), $sql->Value($mo... | [
"private",
"function",
"HasLock",
"(",
"$",
"bundle",
",",
"$",
"module",
"=",
"''",
")",
"{",
"$",
"sql",
"=",
"Access",
"::",
"SqlBuilder",
"(",
")",
";",
"$",
"tblModLock",
"=",
"ModuleLock",
"::",
"Schema",
"(",
")",
"->",
"Table",
"(",
")",
";... | True if a lock with given bundle and module are set
@param string $bundle The bundle name
@param string $module The module name
@return boolean Returns true if the lock is set | [
"True",
"if",
"a",
"lock",
"with",
"given",
"bundle",
"and",
"module",
"are",
"set"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Modules/Backend/ModuleLockForm.php#L186-L196 |
193,712 | prolic/HumusMvc | src/HumusMvc/Controller/Action/Helper/ViewRenderer.php | ViewRenderer.initView | public function initView($path = null, $prefix = null, array $options = array())
{
$this->setView($this->getServiceLocator()->get('View'));
parent::initView($path, $prefix, $options);
} | php | public function initView($path = null, $prefix = null, array $options = array())
{
$this->setView($this->getServiceLocator()->get('View'));
parent::initView($path, $prefix, $options);
} | [
"public",
"function",
"initView",
"(",
"$",
"path",
"=",
"null",
",",
"$",
"prefix",
"=",
"null",
",",
"array",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"$",
"this",
"->",
"setView",
"(",
"$",
"this",
"->",
"getServiceLocator",
"(",
")",
"... | Initialize the view object
$options may contain the following keys:
- neverRender - flag dis/enabling postDispatch() autorender (affects all subsequent calls)
- noController - flag indicating whether or not to look for view scripts in subdirectories named after the controller
- noRender - flag indicating whether or no... | [
"Initialize",
"the",
"view",
"object"
] | 09e8c6422d84b57745cc643047e10761be2a21a7 | https://github.com/prolic/HumusMvc/blob/09e8c6422d84b57745cc643047e10761be2a21a7/src/HumusMvc/Controller/Action/Helper/ViewRenderer.php#L74-L78 |
193,713 | nochso/ORM2 | src/QueryBuilder.php | QueryBuilder.getSQL | private function getSQL()
{
$sql = $this->getTypeSQL()
. $this->getWhereSQL()
. $this->getOrderSQL()
. $this->getLimitSQL()
. $this->getOffsetSQL();
return $sql;
} | php | private function getSQL()
{
$sql = $this->getTypeSQL()
. $this->getWhereSQL()
. $this->getOrderSQL()
. $this->getLimitSQL()
. $this->getOffsetSQL();
return $sql;
} | [
"private",
"function",
"getSQL",
"(",
")",
"{",
"$",
"sql",
"=",
"$",
"this",
"->",
"getTypeSQL",
"(",
")",
".",
"$",
"this",
"->",
"getWhereSQL",
"(",
")",
".",
"$",
"this",
"->",
"getOrderSQL",
"(",
")",
".",
"$",
"this",
"->",
"getLimitSQL",
"("... | Private functions to help build the SQL statement named parameter bindings | [
"Private",
"functions",
"to",
"help",
"build",
"the",
"SQL",
"statement",
"named",
"parameter",
"bindings"
] | 89f9a5c61ad5f575fbdd52990171b52d54f8bfbc | https://github.com/nochso/ORM2/blob/89f9a5c61ad5f575fbdd52990171b52d54f8bfbc/src/QueryBuilder.php#L121-L129 |
193,714 | covex-nn/JooS_Stream | src/JooS/Stream/Wrapper/FS/Partition.php | Wrapper_FS_Partition.commit | public function commit()
{
if (!is_null($this->_changes)) {
$this->_commit($this->_changes);
$this->_changes = null;
}
} | php | public function commit()
{
if (!is_null($this->_changes)) {
$this->_commit($this->_changes);
$this->_changes = null;
}
} | [
"public",
"function",
"commit",
"(",
")",
"{",
"if",
"(",
"!",
"is_null",
"(",
"$",
"this",
"->",
"_changes",
")",
")",
"{",
"$",
"this",
"->",
"_commit",
"(",
"$",
"this",
"->",
"_changes",
")",
";",
"$",
"this",
"->",
"_changes",
"=",
"null",
"... | Commit changes to real FS
@return null | [
"Commit",
"changes",
"to",
"real",
"FS"
] | e9841b804190a9f624b9e44caa0af7a18f3816d1 | https://github.com/covex-nn/JooS_Stream/blob/e9841b804190a9f624b9e44caa0af7a18f3816d1/src/JooS/Stream/Wrapper/FS/Partition.php#L464-L471 |
193,715 | covex-nn/JooS_Stream | src/JooS/Stream/Wrapper/FS/Partition.php | Wrapper_FS_Partition._commit | private function _commit(Wrapper_FS_Changes $changes, $path = "")
{
$root = $this->getRoot();
$rootpath = $root->path();
if ($path) {
$path .= "/";
}
$own = $changes->own();
foreach ($own as $filename => $vEntity) {
$filepath = $path . $filename;
$rPath = $rootpath . "/" . ... | php | private function _commit(Wrapper_FS_Changes $changes, $path = "")
{
$root = $this->getRoot();
$rootpath = $root->path();
if ($path) {
$path .= "/";
}
$own = $changes->own();
foreach ($own as $filename => $vEntity) {
$filepath = $path . $filename;
$rPath = $rootpath . "/" . ... | [
"private",
"function",
"_commit",
"(",
"Wrapper_FS_Changes",
"$",
"changes",
",",
"$",
"path",
"=",
"\"\"",
")",
"{",
"$",
"root",
"=",
"$",
"this",
"->",
"getRoot",
"(",
")",
";",
"$",
"rootpath",
"=",
"$",
"root",
"->",
"path",
"(",
")",
";",
"if... | Commit changes into real FS
Если удалено и не существовало с самого начала
- ничего не делаем
Иначе если когда-то не существовало
- удаляем всё RДерево
- Если сейчас существует, то
- переносим всё VДерево
Иначе если это файл, то
- удаляем RФайл
- копируем VФайл на место RФайла
По всем subtree
- сделать тоже самое, ес... | [
"Commit",
"changes",
"into",
"real",
"FS"
] | e9841b804190a9f624b9e44caa0af7a18f3816d1 | https://github.com/covex-nn/JooS_Stream/blob/e9841b804190a9f624b9e44caa0af7a18f3816d1/src/JooS/Stream/Wrapper/FS/Partition.php#L494-L549 |
193,716 | covex-nn/JooS_Stream | src/JooS/Stream/Wrapper/FS/Partition.php | Wrapper_FS_Partition._copyChanges | private function _copyChanges($path)
{
$entity = $this->getEntity($path);
$source = $entity->path();
$root = $this->getRoot()->path();
$destination = $root . "/" . $path;
if ($entity->is_file()) {
copy($source, $destination);
} else {
$mode = fileperms($source);
mkdir($dest... | php | private function _copyChanges($path)
{
$entity = $this->getEntity($path);
$source = $entity->path();
$root = $this->getRoot()->path();
$destination = $root . "/" . $path;
if ($entity->is_file()) {
copy($source, $destination);
} else {
$mode = fileperms($source);
mkdir($dest... | [
"private",
"function",
"_copyChanges",
"(",
"$",
"path",
")",
"{",
"$",
"entity",
"=",
"$",
"this",
"->",
"getEntity",
"(",
"$",
"path",
")",
";",
"$",
"source",
"=",
"$",
"entity",
"->",
"path",
"(",
")",
";",
"$",
"root",
"=",
"$",
"this",
"->"... | Copy new virtual files to real fs
@param string $path Path
@return null | [
"Copy",
"new",
"virtual",
"files",
"to",
"real",
"fs"
] | e9841b804190a9f624b9e44caa0af7a18f3816d1 | https://github.com/covex-nn/JooS_Stream/blob/e9841b804190a9f624b9e44caa0af7a18f3816d1/src/JooS/Stream/Wrapper/FS/Partition.php#L558-L578 |
193,717 | locomotivemtl/charcoal-config | src/Charcoal/Config/SeparatorAwareTrait.php | SeparatorAwareTrait.setSeparator | final public function setSeparator($separator)
{
if (!is_string($separator)) {
throw new InvalidArgumentException(
'Separator must be a string'
);
}
if (strlen($separator) > 1) {
throw new InvalidArgumentException(
'Separat... | php | final public function setSeparator($separator)
{
if (!is_string($separator)) {
throw new InvalidArgumentException(
'Separator must be a string'
);
}
if (strlen($separator) > 1) {
throw new InvalidArgumentException(
'Separat... | [
"final",
"public",
"function",
"setSeparator",
"(",
"$",
"separator",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"separator",
")",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"'Separator must be a string'",
")",
";",
"}",
"if",
"(",
"str... | Sets the token for traversing a data-tree.
@param string $separator The single-character token to delimit nested data.
If the token is an empty string, data-tree traversal is disabled.
@throws InvalidArgumentException If the $separator is invalid.
@return self | [
"Sets",
"the",
"token",
"for",
"traversing",
"a",
"data",
"-",
"tree",
"."
] | 722b34955360c287dea8fffb3b5491866ce5f6cb | https://github.com/locomotivemtl/charcoal-config/blob/722b34955360c287dea8fffb3b5491866ce5f6cb/src/Charcoal/Config/SeparatorAwareTrait.php#L31-L47 |
193,718 | locomotivemtl/charcoal-config | src/Charcoal/Config/SeparatorAwareTrait.php | SeparatorAwareTrait.hasWithSeparator | final protected function hasWithSeparator($key)
{
$structure = $this;
$splitKeys = explode($this->separator, $key);
foreach ($splitKeys as $key) {
if (!isset($structure[$key])) {
return false;
}
if (!is_array($structure[$key])) {
... | php | final protected function hasWithSeparator($key)
{
$structure = $this;
$splitKeys = explode($this->separator, $key);
foreach ($splitKeys as $key) {
if (!isset($structure[$key])) {
return false;
}
if (!is_array($structure[$key])) {
... | [
"final",
"protected",
"function",
"hasWithSeparator",
"(",
"$",
"key",
")",
"{",
"$",
"structure",
"=",
"$",
"this",
";",
"$",
"splitKeys",
"=",
"explode",
"(",
"$",
"this",
"->",
"separator",
",",
"$",
"key",
")",
";",
"foreach",
"(",
"$",
"splitKeys"... | Determines if this store contains the key-path and if its value is not NULL.
Traverses each node in the key-path until the endpoint is located.
@param string $key The key-path to check.
@return boolean TRUE if $key exists and has a value other than NULL, FALSE otherwise. | [
"Determines",
"if",
"this",
"store",
"contains",
"the",
"key",
"-",
"path",
"and",
"if",
"its",
"value",
"is",
"not",
"NULL",
"."
] | 722b34955360c287dea8fffb3b5491866ce5f6cb | https://github.com/locomotivemtl/charcoal-config/blob/722b34955360c287dea8fffb3b5491866ce5f6cb/src/Charcoal/Config/SeparatorAwareTrait.php#L67-L81 |
193,719 | locomotivemtl/charcoal-config | src/Charcoal/Config/SeparatorAwareTrait.php | SeparatorAwareTrait.getWithSeparator | final protected function getWithSeparator($key)
{
$structure = $this;
$splitKeys = explode($this->separator, $key);
foreach ($splitKeys as $key) {
if (!isset($structure[$key])) {
return null;
}
if (!is_array($structure[$key])) {
... | php | final protected function getWithSeparator($key)
{
$structure = $this;
$splitKeys = explode($this->separator, $key);
foreach ($splitKeys as $key) {
if (!isset($structure[$key])) {
return null;
}
if (!is_array($structure[$key])) {
... | [
"final",
"protected",
"function",
"getWithSeparator",
"(",
"$",
"key",
")",
"{",
"$",
"structure",
"=",
"$",
"this",
";",
"$",
"splitKeys",
"=",
"explode",
"(",
"$",
"this",
"->",
"separator",
",",
"$",
"key",
")",
";",
"foreach",
"(",
"$",
"splitKeys"... | Returns the value from the key-path found on this object.
Traverses each node in the key-path until the endpoint is located.
@param string $key The key-path to retrieve.
@return mixed Value of the requested $key on success, NULL if the $key is not set. | [
"Returns",
"the",
"value",
"from",
"the",
"key",
"-",
"path",
"found",
"on",
"this",
"object",
"."
] | 722b34955360c287dea8fffb3b5491866ce5f6cb | https://github.com/locomotivemtl/charcoal-config/blob/722b34955360c287dea8fffb3b5491866ce5f6cb/src/Charcoal/Config/SeparatorAwareTrait.php#L91-L105 |
193,720 | jenskooij/cloudcontrol | src/cc/Application.php | Application.config | private function config()
{
if (realpath($this->configPath) !== false) {
$json = file_get_contents($this->configPath);
$this->config = json_decode($json);
$this->config->rootDir = $this->rootDir;
} else {
throw new \RuntimeException('Framework not init... | php | private function config()
{
if (realpath($this->configPath) !== false) {
$json = file_get_contents($this->configPath);
$this->config = json_decode($json);
$this->config->rootDir = $this->rootDir;
} else {
throw new \RuntimeException('Framework not init... | [
"private",
"function",
"config",
"(",
")",
"{",
"if",
"(",
"realpath",
"(",
"$",
"this",
"->",
"configPath",
")",
"!==",
"false",
")",
"{",
"$",
"json",
"=",
"file_get_contents",
"(",
"$",
"this",
"->",
"configPath",
")",
";",
"$",
"this",
"->",
"con... | Initialize the config
@throws \Exception | [
"Initialize",
"the",
"config"
] | 76e5d9ac8f9c50d06d39a995d13cc03742536548 | https://github.com/jenskooij/cloudcontrol/blob/76e5d9ac8f9c50d06d39a995d13cc03742536548/src/cc/Application.php#L86-L95 |
193,721 | jenskooij/cloudcontrol | src/cc/Application.php | Application.storage | private function storage()
{
$this->storage = new Storage($this->config->rootDir . DIRECTORY_SEPARATOR . $this->config->storageDir,
$this->config->rootDir . DIRECTORY_SEPARATOR . $this->config->imagesDir,
$this->config->rootDir . DIRECTORY_SEPARATOR . $this->config->filesDir);
} | php | private function storage()
{
$this->storage = new Storage($this->config->rootDir . DIRECTORY_SEPARATOR . $this->config->storageDir,
$this->config->rootDir . DIRECTORY_SEPARATOR . $this->config->imagesDir,
$this->config->rootDir . DIRECTORY_SEPARATOR . $this->config->filesDir);
} | [
"private",
"function",
"storage",
"(",
")",
"{",
"$",
"this",
"->",
"storage",
"=",
"new",
"Storage",
"(",
"$",
"this",
"->",
"config",
"->",
"rootDir",
".",
"DIRECTORY_SEPARATOR",
".",
"$",
"this",
"->",
"config",
"->",
"storageDir",
",",
"$",
"this",
... | Initialize the storage
@throws \Exception | [
"Initialize",
"the",
"storage"
] | 76e5d9ac8f9c50d06d39a995d13cc03742536548 | https://github.com/jenskooij/cloudcontrol/blob/76e5d9ac8f9c50d06d39a995d13cc03742536548/src/cc/Application.php#L101-L106 |
193,722 | digipolisgent/robo-digipolis-helpers | src/AbstractRoboFile.php | AbstractRoboFile.digipolisSwitchPrevious | public function digipolisSwitchPrevious($releasesDir, $currentSymlink)
{
$finder = new Finder();
// Get all releases.
$releases = iterator_to_array(
$finder
->directories()
->in($releasesDir)
->sortByName()
->depth(0... | php | public function digipolisSwitchPrevious($releasesDir, $currentSymlink)
{
$finder = new Finder();
// Get all releases.
$releases = iterator_to_array(
$finder
->directories()
->in($releasesDir)
->sortByName()
->depth(0... | [
"public",
"function",
"digipolisSwitchPrevious",
"(",
"$",
"releasesDir",
",",
"$",
"currentSymlink",
")",
"{",
"$",
"finder",
"=",
"new",
"Finder",
"(",
")",
";",
"// Get all releases.",
"$",
"releases",
"=",
"iterator_to_array",
"(",
"$",
"finder",
"->",
"di... | Switch the current release symlink to the previous release.
@param string $releasesDir
Path to the folder containing all releases.
@param string $currentSymlink
Path to the current release symlink. | [
"Switch",
"the",
"current",
"release",
"symlink",
"to",
"the",
"previous",
"release",
"."
] | f51099e27b2eb7ad13b78444e3139c431d848b3c | https://github.com/digipolisgent/robo-digipolis-helpers/blob/f51099e27b2eb7ad13b78444e3139c431d848b3c/src/AbstractRoboFile.php#L222-L249 |
193,723 | digipolisgent/robo-digipolis-helpers | src/AbstractRoboFile.php | AbstractRoboFile.digipolisMirrorDir | public function digipolisMirrorDir($dir, $destination)
{
if (!is_dir($dir)) {
return;
}
$task = $this->taskFilesystemStack();
$task->mkdir($destination);
$directoryIterator = new \RecursiveDirectoryIterator($dir, \RecursiveDirectoryIterator::SKIP_DOTS);
$... | php | public function digipolisMirrorDir($dir, $destination)
{
if (!is_dir($dir)) {
return;
}
$task = $this->taskFilesystemStack();
$task->mkdir($destination);
$directoryIterator = new \RecursiveDirectoryIterator($dir, \RecursiveDirectoryIterator::SKIP_DOTS);
$... | [
"public",
"function",
"digipolisMirrorDir",
"(",
"$",
"dir",
",",
"$",
"destination",
")",
"{",
"if",
"(",
"!",
"is_dir",
"(",
"$",
"dir",
")",
")",
"{",
"return",
";",
"}",
"$",
"task",
"=",
"$",
"this",
"->",
"taskFilesystemStack",
"(",
")",
";",
... | Mirror a directory.
@param string $dir
Path of the directory to mirror.
@param string $destination
Path of the directory where $dir should be mirrored.
@return \Robo\Contract\TaskInterface
The mirror dir task. | [
"Mirror",
"a",
"directory",
"."
] | f51099e27b2eb7ad13b78444e3139c431d848b3c | https://github.com/digipolisgent/robo-digipolis-helpers/blob/f51099e27b2eb7ad13b78444e3139c431d848b3c/src/AbstractRoboFile.php#L270-L298 |
193,724 | digipolisgent/robo-digipolis-helpers | src/AbstractRoboFile.php | AbstractRoboFile.buildTask | protected function buildTask($archivename = null)
{
$this->readProperties();
$archive = is_null($archivename) ? $this->time . '.tar.gz' : $archivename;
$collection = $this->collectionBuilder();
$collection
->taskPackageProject($archive);
return $collection;
} | php | protected function buildTask($archivename = null)
{
$this->readProperties();
$archive = is_null($archivename) ? $this->time . '.tar.gz' : $archivename;
$collection = $this->collectionBuilder();
$collection
->taskPackageProject($archive);
return $collection;
} | [
"protected",
"function",
"buildTask",
"(",
"$",
"archivename",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"readProperties",
"(",
")",
";",
"$",
"archive",
"=",
"is_null",
"(",
"$",
"archivename",
")",
"?",
"$",
"this",
"->",
"time",
".",
"'.tar.gz'",
":... | Build a site and package it.
@param string $archivename
Name of the archive to create.
@return \Robo\Contract\TaskInterface
The deploy task. | [
"Build",
"a",
"site",
"and",
"package",
"it",
"."
] | f51099e27b2eb7ad13b78444e3139c431d848b3c | https://github.com/digipolisgent/robo-digipolis-helpers/blob/f51099e27b2eb7ad13b78444e3139c431d848b3c/src/AbstractRoboFile.php#L309-L317 |
193,725 | digipolisgent/robo-digipolis-helpers | src/AbstractRoboFile.php | AbstractRoboFile.postSymlinkTask | protected function postSymlinkTask($worker, AbstractAuth $auth, $remote)
{
if (isset($remote['postsymlink_filechecks']) && $remote['postsymlink_filechecks']) {
$projectRoot = $remote['rootdir'];
$collection = $this->collectionBuilder();
$collection->taskSsh($worker, $auth... | php | protected function postSymlinkTask($worker, AbstractAuth $auth, $remote)
{
if (isset($remote['postsymlink_filechecks']) && $remote['postsymlink_filechecks']) {
$projectRoot = $remote['rootdir'];
$collection = $this->collectionBuilder();
$collection->taskSsh($worker, $auth... | [
"protected",
"function",
"postSymlinkTask",
"(",
"$",
"worker",
",",
"AbstractAuth",
"$",
"auth",
",",
"$",
"remote",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"remote",
"[",
"'postsymlink_filechecks'",
"]",
")",
"&&",
"$",
"remote",
"[",
"'postsymlink_fileche... | Tasks to execute after creating the symlinks.
@param string $worker
The server to install the site on.
@param \DigipolisGent\Robo\Task\Deploy\Ssh\Auth\AbstractAuth $auth
The ssh authentication to connect to the server.
@param array $remote
The remote settings for this server.
@return bool|\Robo\Contract\TaskInterface... | [
"Tasks",
"to",
"execute",
"after",
"creating",
"the",
"symlinks",
"."
] | f51099e27b2eb7ad13b78444e3139c431d848b3c | https://github.com/digipolisgent/robo-digipolis-helpers/blob/f51099e27b2eb7ad13b78444e3139c431d848b3c/src/AbstractRoboFile.php#L332-L358 |
193,726 | digipolisgent/robo-digipolis-helpers | src/AbstractRoboFile.php | AbstractRoboFile.preSymlinkTask | protected function preSymlinkTask($worker, AbstractAuth $auth, $remote)
{
$projectRoot = $remote['rootdir'];
$collection = $this->collectionBuilder();
$collection->taskSsh($worker, $auth)
->remoteDirectory($projectRoot, true)
->timeout($this->getTimeoutSetting('presym... | php | protected function preSymlinkTask($worker, AbstractAuth $auth, $remote)
{
$projectRoot = $remote['rootdir'];
$collection = $this->collectionBuilder();
$collection->taskSsh($worker, $auth)
->remoteDirectory($projectRoot, true)
->timeout($this->getTimeoutSetting('presym... | [
"protected",
"function",
"preSymlinkTask",
"(",
"$",
"worker",
",",
"AbstractAuth",
"$",
"auth",
",",
"$",
"remote",
")",
"{",
"$",
"projectRoot",
"=",
"$",
"remote",
"[",
"'rootdir'",
"]",
";",
"$",
"collection",
"=",
"$",
"this",
"->",
"collectionBuilder... | Tasks to execute before creating the symlinks.
@param string $worker
The server to install the site on.
@param \DigipolisGent\Robo\Task\Deploy\Ssh\Auth\AbstractAuth $auth
The ssh authentication to connect to the server.
@param array $remote
The remote settings for this server.
@return bool|\Robo\Contract\TaskInterfac... | [
"Tasks",
"to",
"execute",
"before",
"creating",
"the",
"symlinks",
"."
] | f51099e27b2eb7ad13b78444e3139c431d848b3c | https://github.com/digipolisgent/robo-digipolis-helpers/blob/f51099e27b2eb7ad13b78444e3139c431d848b3c/src/AbstractRoboFile.php#L373-L392 |
193,727 | digipolisgent/robo-digipolis-helpers | src/AbstractRoboFile.php | AbstractRoboFile.initRemoteTask | protected function initRemoteTask($worker, AbstractAuth $auth, $remote, $extra = [], $force = false)
{
$collection = $this->collectionBuilder();
if (!$this->isSiteInstalled($worker, $auth, $remote) || $force) {
$this->say($force ? 'Forcing site install.' : 'Site status failed.');
... | php | protected function initRemoteTask($worker, AbstractAuth $auth, $remote, $extra = [], $force = false)
{
$collection = $this->collectionBuilder();
if (!$this->isSiteInstalled($worker, $auth, $remote) || $force) {
$this->say($force ? 'Forcing site install.' : 'Site status failed.');
... | [
"protected",
"function",
"initRemoteTask",
"(",
"$",
"worker",
",",
"AbstractAuth",
"$",
"auth",
",",
"$",
"remote",
",",
"$",
"extra",
"=",
"[",
"]",
",",
"$",
"force",
"=",
"false",
")",
"{",
"$",
"collection",
"=",
"$",
"this",
"->",
"collectionBuil... | Install or update a remote site.
@param string $worker
The server to install the site on.
@param \DigipolisGent\Robo\Task\Deploy\Ssh\Auth\AbstractAuth $auth
The ssh authentication to connect to the server.
@param array $remote
The remote settings for this server.
@param array $extra
Extra parameters to pass to site in... | [
"Install",
"or",
"update",
"a",
"remote",
"site",
"."
] | f51099e27b2eb7ad13b78444e3139c431d848b3c | https://github.com/digipolisgent/robo-digipolis-helpers/blob/f51099e27b2eb7ad13b78444e3139c431d848b3c/src/AbstractRoboFile.php#L411-L423 |
193,728 | digipolisgent/robo-digipolis-helpers | src/AbstractRoboFile.php | AbstractRoboFile.removeBackupTask | protected function removeBackupTask(
$worker,
AbstractAuth $auth,
$remote,
$opts = ['files' => false, 'data' => false]
) {
$backupDir = $remote['backupsdir'] . '/' . $remote['time'];
$collection = $this->collectionBuilder();
$collection->taskSsh($worker, $aut... | php | protected function removeBackupTask(
$worker,
AbstractAuth $auth,
$remote,
$opts = ['files' => false, 'data' => false]
) {
$backupDir = $remote['backupsdir'] . '/' . $remote['time'];
$collection = $this->collectionBuilder();
$collection->taskSsh($worker, $aut... | [
"protected",
"function",
"removeBackupTask",
"(",
"$",
"worker",
",",
"AbstractAuth",
"$",
"auth",
",",
"$",
"remote",
",",
"$",
"opts",
"=",
"[",
"'files'",
"=>",
"false",
",",
"'data'",
"=>",
"false",
"]",
")",
"{",
"$",
"backupDir",
"=",
"$",
"remot... | Remove a backup.
@param string $worker
The server to install the site on.
@param \DigipolisGent\Robo\Task\Deploy\Ssh\Auth\AbstractAuth $auth
The ssh authentication to connect to the server.
@param array $remote
The remote settings for this server.
@return \Robo\Contract\TaskInterface
The backup task. | [
"Remove",
"a",
"backup",
"."
] | f51099e27b2eb7ad13b78444e3139c431d848b3c | https://github.com/digipolisgent/robo-digipolis-helpers/blob/f51099e27b2eb7ad13b78444e3139c431d848b3c/src/AbstractRoboFile.php#L735-L749 |
193,729 | digipolisgent/robo-digipolis-helpers | src/AbstractRoboFile.php | AbstractRoboFile.preRestoreBackupTask | protected function preRestoreBackupTask(
$worker,
AbstractAuth $auth,
$remote,
$opts = ['files' => false, 'data' => false]
) {
if (!$opts['files'] && !$opts['data']) {
$opts['files'] = true;
$opts['data'] = true;
}
if ($opts['files']) {... | php | protected function preRestoreBackupTask(
$worker,
AbstractAuth $auth,
$remote,
$opts = ['files' => false, 'data' => false]
) {
if (!$opts['files'] && !$opts['data']) {
$opts['files'] = true;
$opts['data'] = true;
}
if ($opts['files']) {... | [
"protected",
"function",
"preRestoreBackupTask",
"(",
"$",
"worker",
",",
"AbstractAuth",
"$",
"auth",
",",
"$",
"remote",
",",
"$",
"opts",
"=",
"[",
"'files'",
"=>",
"false",
",",
"'data'",
"=>",
"false",
"]",
")",
"{",
"if",
"(",
"!",
"$",
"opts",
... | Pre restore backup task.
@param string $worker
The server to install the site on.
@param \DigipolisGent\Robo\Task\Deploy\Ssh\Auth\AbstractAuth $auth
The ssh authentication to connect to the server.
@param array $remote
The remote settings for this server.
@return bool|\Robo\Contract\TaskInterface
The pre restore back... | [
"Pre",
"restore",
"backup",
"task",
"."
] | f51099e27b2eb7ad13b78444e3139c431d848b3c | https://github.com/digipolisgent/robo-digipolis-helpers/blob/f51099e27b2eb7ad13b78444e3139c431d848b3c/src/AbstractRoboFile.php#L823-L850 |
193,730 | digipolisgent/robo-digipolis-helpers | src/AbstractRoboFile.php | AbstractRoboFile.pushPackageTask | protected function pushPackageTask($worker, AbstractAuth $auth, $remote, $archivename = null)
{
$archive = is_null($archivename)
? $remote['time'] . '.tar.gz'
: $archivename;
$releaseDir = $remote['releasesdir'] . '/' . $remote['time'];
$collection = $this->collection... | php | protected function pushPackageTask($worker, AbstractAuth $auth, $remote, $archivename = null)
{
$archive = is_null($archivename)
? $remote['time'] . '.tar.gz'
: $archivename;
$releaseDir = $remote['releasesdir'] . '/' . $remote['time'];
$collection = $this->collection... | [
"protected",
"function",
"pushPackageTask",
"(",
"$",
"worker",
",",
"AbstractAuth",
"$",
"auth",
",",
"$",
"remote",
",",
"$",
"archivename",
"=",
"null",
")",
"{",
"$",
"archive",
"=",
"is_null",
"(",
"$",
"archivename",
")",
"?",
"$",
"remote",
"[",
... | Push a package to the server.
@param string $worker
The server to install the site on.
@param \DigipolisGent\Robo\Task\Deploy\Ssh\Auth\AbstractAuth $auth
The ssh authentication to connect to the server.
@param array $remote
The remote settings for this server.
@param string|null $archivename
The path to the package to... | [
"Push",
"a",
"package",
"to",
"the",
"server",
"."
] | f51099e27b2eb7ad13b78444e3139c431d848b3c | https://github.com/digipolisgent/robo-digipolis-helpers/blob/f51099e27b2eb7ad13b78444e3139c431d848b3c/src/AbstractRoboFile.php#L951-L967 |
193,731 | digipolisgent/robo-digipolis-helpers | src/AbstractRoboFile.php | AbstractRoboFile.switchPreviousTask | protected function switchPreviousTask($worker, AbstractAuth $auth, $remote)
{
return $this->taskSsh($worker, $auth)
->remoteDirectory($this->getCurrentProjectRoot($worker, $auth, $remote), true)
->exec(
'vendor/bin/robo digipolis:switch-previous '
. $r... | php | protected function switchPreviousTask($worker, AbstractAuth $auth, $remote)
{
return $this->taskSsh($worker, $auth)
->remoteDirectory($this->getCurrentProjectRoot($worker, $auth, $remote), true)
->exec(
'vendor/bin/robo digipolis:switch-previous '
. $r... | [
"protected",
"function",
"switchPreviousTask",
"(",
"$",
"worker",
",",
"AbstractAuth",
"$",
"auth",
",",
"$",
"remote",
")",
"{",
"return",
"$",
"this",
"->",
"taskSsh",
"(",
"$",
"worker",
",",
"$",
"auth",
")",
"->",
"remoteDirectory",
"(",
"$",
"this... | Switch the current symlink to the previous release on the server.
@param string $worker
The server to install the site on.
@param \DigipolisGent\Robo\Task\Deploy\Ssh\Auth\AbstractAuth $auth
The ssh authentication to connect to the server.
@param array $remote
The remote settings for this server.
@return \Robo\Contrac... | [
"Switch",
"the",
"current",
"symlink",
"to",
"the",
"previous",
"release",
"on",
"the",
"server",
"."
] | f51099e27b2eb7ad13b78444e3139c431d848b3c | https://github.com/digipolisgent/robo-digipolis-helpers/blob/f51099e27b2eb7ad13b78444e3139c431d848b3c/src/AbstractRoboFile.php#L982-L991 |
193,732 | digipolisgent/robo-digipolis-helpers | src/AbstractRoboFile.php | AbstractRoboFile.removeFailedRelease | protected function removeFailedRelease($worker, AbstractAuth $auth, $remote, $releaseDirname = null)
{
$releaseDir = is_null($releaseDirname)
? $remote['releasesdir'] . '/' . $remote['time']
: $releaseDirname;
return $this->taskSsh($worker, $auth)
->remoteDirector... | php | protected function removeFailedRelease($worker, AbstractAuth $auth, $remote, $releaseDirname = null)
{
$releaseDir = is_null($releaseDirname)
? $remote['releasesdir'] . '/' . $remote['time']
: $releaseDirname;
return $this->taskSsh($worker, $auth)
->remoteDirector... | [
"protected",
"function",
"removeFailedRelease",
"(",
"$",
"worker",
",",
"AbstractAuth",
"$",
"auth",
",",
"$",
"remote",
",",
"$",
"releaseDirname",
"=",
"null",
")",
"{",
"$",
"releaseDir",
"=",
"is_null",
"(",
"$",
"releaseDirname",
")",
"?",
"$",
"remo... | Remove a failed release from the server.
@param string $worker
The server to install the site on.
@param \DigipolisGent\Robo\Task\Deploy\Ssh\Auth\AbstractAuth $auth
The ssh authentication to connect to the server.
@param array $remote
The remote settings for this server.
@param string|null $releaseDirname
The path of ... | [
"Remove",
"a",
"failed",
"release",
"from",
"the",
"server",
"."
] | f51099e27b2eb7ad13b78444e3139c431d848b3c | https://github.com/digipolisgent/robo-digipolis-helpers/blob/f51099e27b2eb7ad13b78444e3139c431d848b3c/src/AbstractRoboFile.php#L1008-L1018 |
193,733 | digipolisgent/robo-digipolis-helpers | src/AbstractRoboFile.php | AbstractRoboFile.symlinksTask | protected function symlinksTask($worker, AbstractAuth $auth, $remote)
{
$collection = $this->collectionBuilder();
foreach ($remote['symlinks'] as $link) {
$collection->taskSsh($worker, $auth)
->exec('ln -s -T -f ' . str_replace(':', ' ', $link));
}
return ... | php | protected function symlinksTask($worker, AbstractAuth $auth, $remote)
{
$collection = $this->collectionBuilder();
foreach ($remote['symlinks'] as $link) {
$collection->taskSsh($worker, $auth)
->exec('ln -s -T -f ' . str_replace(':', ' ', $link));
}
return ... | [
"protected",
"function",
"symlinksTask",
"(",
"$",
"worker",
",",
"AbstractAuth",
"$",
"auth",
",",
"$",
"remote",
")",
"{",
"$",
"collection",
"=",
"$",
"this",
"->",
"collectionBuilder",
"(",
")",
";",
"foreach",
"(",
"$",
"remote",
"[",
"'symlinks'",
... | Create all required symlinks on the server.
@param string $worker
The server to install the site on.
@param \DigipolisGent\Robo\Task\Deploy\Ssh\Auth\AbstractAuth $auth
The ssh authentication to connect to the server.
@param array $remote
The remote settings for this server.
@return \Robo\Contract\TaskInterface
The sy... | [
"Create",
"all",
"required",
"symlinks",
"on",
"the",
"server",
"."
] | f51099e27b2eb7ad13b78444e3139c431d848b3c | https://github.com/digipolisgent/robo-digipolis-helpers/blob/f51099e27b2eb7ad13b78444e3139c431d848b3c/src/AbstractRoboFile.php#L1033-L1041 |
193,734 | digipolisgent/robo-digipolis-helpers | src/AbstractRoboFile.php | AbstractRoboFile.clearOpCacheTask | protected function clearOpCacheTask($worker, AbstractAuth $auth, $remote)
{
$clearOpcache = 'vendor/bin/robo digipolis:clear-op-cache ' . $remote['opcache']['env'];
if (isset($remote['opcache']['host'])) {
$clearOpcache .= ' --host=' . $remote['opcache']['host'];
}
return... | php | protected function clearOpCacheTask($worker, AbstractAuth $auth, $remote)
{
$clearOpcache = 'vendor/bin/robo digipolis:clear-op-cache ' . $remote['opcache']['env'];
if (isset($remote['opcache']['host'])) {
$clearOpcache .= ' --host=' . $remote['opcache']['host'];
}
return... | [
"protected",
"function",
"clearOpCacheTask",
"(",
"$",
"worker",
",",
"AbstractAuth",
"$",
"auth",
",",
"$",
"remote",
")",
"{",
"$",
"clearOpcache",
"=",
"'vendor/bin/robo digipolis:clear-op-cache '",
".",
"$",
"remote",
"[",
"'opcache'",
"]",
"[",
"'env'",
"]"... | Clear OPcache on the server.
@param string $worker
The server to install the site on.
@param \DigipolisGent\Robo\Task\Deploy\Ssh\Auth\AbstractAuth $auth
The ssh authentication to connect to the server.
@param array $remote
The remote settings for this server.
@return \Robo\Contract\TaskInterface
The clear OPcache tas... | [
"Clear",
"OPcache",
"on",
"the",
"server",
"."
] | f51099e27b2eb7ad13b78444e3139c431d848b3c | https://github.com/digipolisgent/robo-digipolis-helpers/blob/f51099e27b2eb7ad13b78444e3139c431d848b3c/src/AbstractRoboFile.php#L1056-L1065 |
193,735 | digipolisgent/robo-digipolis-helpers | src/AbstractRoboFile.php | AbstractRoboFile.cleanDirsTask | protected function cleanDirsTask($worker, AbstractAuth $auth, $remote)
{
$cleandirLimit = isset($remote['cleandir_limit']) ? max(1, $remote['cleandir_limit']) : '';
$task = $this->taskSsh($worker, $auth)
->remoteDirectory($remote['rootdir'], true)
->timeout($this->getTimeout... | php | protected function cleanDirsTask($worker, AbstractAuth $auth, $remote)
{
$cleandirLimit = isset($remote['cleandir_limit']) ? max(1, $remote['cleandir_limit']) : '';
$task = $this->taskSsh($worker, $auth)
->remoteDirectory($remote['rootdir'], true)
->timeout($this->getTimeout... | [
"protected",
"function",
"cleanDirsTask",
"(",
"$",
"worker",
",",
"AbstractAuth",
"$",
"auth",
",",
"$",
"remote",
")",
"{",
"$",
"cleandirLimit",
"=",
"isset",
"(",
"$",
"remote",
"[",
"'cleandir_limit'",
"]",
")",
"?",
"max",
"(",
"1",
",",
"$",
"re... | Clean the release and backup directories on the server.
@param string $worker
The server to install the site on.
@param \DigipolisGent\Robo\Task\Deploy\Ssh\Auth\AbstractAuth $auth
The ssh authentication to connect to the server.
@param array $remote
The remote settings for this server.
@return \Robo\Contract\TaskInte... | [
"Clean",
"the",
"release",
"and",
"backup",
"directories",
"on",
"the",
"server",
"."
] | f51099e27b2eb7ad13b78444e3139c431d848b3c | https://github.com/digipolisgent/robo-digipolis-helpers/blob/f51099e27b2eb7ad13b78444e3139c431d848b3c/src/AbstractRoboFile.php#L1080-L1094 |
193,736 | digipolisgent/robo-digipolis-helpers | src/AbstractRoboFile.php | AbstractRoboFile.tokenReplace | protected function tokenReplace($input, $replacements)
{
if (is_string($input)) {
return strtr($input, $replacements);
}
if (is_scalar($input) || empty($input)) {
return $input;
}
foreach ($input as &$i) {
$i = $this->tokenReplace($i, $repl... | php | protected function tokenReplace($input, $replacements)
{
if (is_string($input)) {
return strtr($input, $replacements);
}
if (is_scalar($input) || empty($input)) {
return $input;
}
foreach ($input as &$i) {
$i = $this->tokenReplace($i, $repl... | [
"protected",
"function",
"tokenReplace",
"(",
"$",
"input",
",",
"$",
"replacements",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"input",
")",
")",
"{",
"return",
"strtr",
"(",
"$",
"input",
",",
"$",
"replacements",
")",
";",
"}",
"if",
"(",
"is_sc... | Helper functions to replace tokens in an array.
@param string|array $input
The array or string containing the tokens to replace.
@param array $replacements
The token replacements.
@return string|array
The input with the tokens replaced with their values. | [
"Helper",
"functions",
"to",
"replace",
"tokens",
"in",
"an",
"array",
"."
] | f51099e27b2eb7ad13b78444e3139c431d848b3c | https://github.com/digipolisgent/robo-digipolis-helpers/blob/f51099e27b2eb7ad13b78444e3139c431d848b3c/src/AbstractRoboFile.php#L1231-L1243 |
193,737 | digipolisgent/robo-digipolis-helpers | src/AbstractRoboFile.php | AbstractRoboFile.backupFileName | protected function backupFileName($extension, $timestamp = null)
{
if (is_null($timestamp)) {
$timestamp = $this->time;
}
return $timestamp . '_' . date('Y_m_d_H_i_s', $timestamp) . $extension;
} | php | protected function backupFileName($extension, $timestamp = null)
{
if (is_null($timestamp)) {
$timestamp = $this->time;
}
return $timestamp . '_' . date('Y_m_d_H_i_s', $timestamp) . $extension;
} | [
"protected",
"function",
"backupFileName",
"(",
"$",
"extension",
",",
"$",
"timestamp",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"timestamp",
")",
")",
"{",
"$",
"timestamp",
"=",
"$",
"this",
"->",
"time",
";",
"}",
"return",
"$",
"ti... | Generate a backup filename based on the given time.
@param string $extension
The extension to append to the filename. Must include leading dot.
@param int|null $timestamp
The timestamp to generate the backup name from. Defaults to the request
time.
@return string
The generated filename. | [
"Generate",
"a",
"backup",
"filename",
"based",
"on",
"the",
"given",
"time",
"."
] | f51099e27b2eb7ad13b78444e3139c431d848b3c | https://github.com/digipolisgent/robo-digipolis-helpers/blob/f51099e27b2eb7ad13b78444e3139c431d848b3c/src/AbstractRoboFile.php#L1257-L1263 |
193,738 | digipolisgent/robo-digipolis-helpers | src/AbstractRoboFile.php | AbstractRoboFile.getRemoteSettings | protected function getRemoteSettings($host, $user, $keyFile, $app, $timestamp = null)
{
$this->readProperties();
$defaults = [
'user' => $user,
'private-key' => $keyFile,
'app' => $app,
'createbackup' => true,
'time' => is_null($timestamp) ... | php | protected function getRemoteSettings($host, $user, $keyFile, $app, $timestamp = null)
{
$this->readProperties();
$defaults = [
'user' => $user,
'private-key' => $keyFile,
'app' => $app,
'createbackup' => true,
'time' => is_null($timestamp) ... | [
"protected",
"function",
"getRemoteSettings",
"(",
"$",
"host",
",",
"$",
"user",
",",
"$",
"keyFile",
",",
"$",
"app",
",",
"$",
"timestamp",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"readProperties",
"(",
")",
";",
"$",
"defaults",
"=",
"[",
"'use... | Get the settings from the 'remote' config key, with the tokens replaced.
@param string $host
The IP address of the server to get the settings for.
@param string $user
The SSH user used to connect to the server.
@param string $keyFile
The path to the private key file used to connect to the server.
@param string $app
Th... | [
"Get",
"the",
"settings",
"from",
"the",
"remote",
"config",
"key",
"with",
"the",
"tokens",
"replaced",
"."
] | f51099e27b2eb7ad13b78444e3139c431d848b3c | https://github.com/digipolisgent/robo-digipolis-helpers/blob/f51099e27b2eb7ad13b78444e3139c431d848b3c/src/AbstractRoboFile.php#L1282-L1311 |
193,739 | digipolisgent/robo-digipolis-helpers | src/AbstractRoboFile.php | AbstractRoboFile.getLocalSettings | protected function getLocalSettings($app = null, $timestamp = null)
{
$this->readProperties();
$defaults = [
'app' => $app,
'time' => is_null($timestamp) ? $this->time : $timestamp,
'project_root' => $this->getConfig()->get('digipolis.root.project'),
'... | php | protected function getLocalSettings($app = null, $timestamp = null)
{
$this->readProperties();
$defaults = [
'app' => $app,
'time' => is_null($timestamp) ? $this->time : $timestamp,
'project_root' => $this->getConfig()->get('digipolis.root.project'),
'... | [
"protected",
"function",
"getLocalSettings",
"(",
"$",
"app",
"=",
"null",
",",
"$",
"timestamp",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"readProperties",
"(",
")",
";",
"$",
"defaults",
"=",
"[",
"'app'",
"=>",
"$",
"app",
",",
"'time'",
"=>",
"i... | Get the settings from the 'local' config key, with the tokens replaced.
@param string $app
The name of the app these settings apply to.
@param string|null $timestamp
The timestamp to use. Defaults to the request time.
@return array
The settings for the local environment and app. | [
"Get",
"the",
"settings",
"from",
"the",
"local",
"config",
"key",
"with",
"the",
"tokens",
"replaced",
"."
] | f51099e27b2eb7ad13b78444e3139c431d848b3c | https://github.com/digipolisgent/robo-digipolis-helpers/blob/f51099e27b2eb7ad13b78444e3139c431d848b3c/src/AbstractRoboFile.php#L1324-L1342 |
193,740 | digipolisgent/robo-digipolis-helpers | src/AbstractRoboFile.php | AbstractRoboFile.getTimeoutSetting | protected function getTimeoutSetting($setting)
{
$timeoutSettings = $this->getTimeoutSettings();
return isset($timeoutSettings[$setting]) ? $timeoutSettings[$setting] : static::DEFAULT_TIMEOUT;
} | php | protected function getTimeoutSetting($setting)
{
$timeoutSettings = $this->getTimeoutSettings();
return isset($timeoutSettings[$setting]) ? $timeoutSettings[$setting] : static::DEFAULT_TIMEOUT;
} | [
"protected",
"function",
"getTimeoutSetting",
"(",
"$",
"setting",
")",
"{",
"$",
"timeoutSettings",
"=",
"$",
"this",
"->",
"getTimeoutSettings",
"(",
")",
";",
"return",
"isset",
"(",
"$",
"timeoutSettings",
"[",
"$",
"setting",
"]",
")",
"?",
"$",
"time... | Timeouts can be overwritten in properties.yml under the `timeout` key.
@param string $setting
@return int | [
"Timeouts",
"can",
"be",
"overwritten",
"in",
"properties",
".",
"yml",
"under",
"the",
"timeout",
"key",
"."
] | f51099e27b2eb7ad13b78444e3139c431d848b3c | https://github.com/digipolisgent/robo-digipolis-helpers/blob/f51099e27b2eb7ad13b78444e3139c431d848b3c/src/AbstractRoboFile.php#L1351-L1355 |
193,741 | digipolisgent/robo-digipolis-helpers | src/AbstractRoboFile.php | AbstractRoboFile.getUserHomeDir | protected function getUserHomeDir()
{
// getenv('HOME') isn't set on Windows.
$home = getenv('HOME');
if (!empty($home)) {
// home should never end with a trailing slash.
return rtrim($home, '/');
}
if (!empty($_SERVER['HOMEDRIVE']) && !empty($_SERVER[... | php | protected function getUserHomeDir()
{
// getenv('HOME') isn't set on Windows.
$home = getenv('HOME');
if (!empty($home)) {
// home should never end with a trailing slash.
return rtrim($home, '/');
}
if (!empty($_SERVER['HOMEDRIVE']) && !empty($_SERVER[... | [
"protected",
"function",
"getUserHomeDir",
"(",
")",
"{",
"// getenv('HOME') isn't set on Windows.",
"$",
"home",
"=",
"getenv",
"(",
"'HOME'",
")",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"home",
")",
")",
"{",
"// home should never end with a trailing slash.",
"... | Get the home directory for the current user. | [
"Get",
"the",
"home",
"directory",
"for",
"the",
"current",
"user",
"."
] | f51099e27b2eb7ad13b78444e3139c431d848b3c | https://github.com/digipolisgent/robo-digipolis-helpers/blob/f51099e27b2eb7ad13b78444e3139c431d848b3c/src/AbstractRoboFile.php#L1404-L1421 |
193,742 | miaoxing/plugin | src/Model/GetSetTrait.php | GetSetTrait.setRawData | public function setRawData(array $data)
{
$this->data = $data + $this->data;
if ($data) {
$this->loaded = true;
$this->setDataSource('*', 'db');
}
return $this;
} | php | public function setRawData(array $data)
{
$this->data = $data + $this->data;
if ($data) {
$this->loaded = true;
$this->setDataSource('*', 'db');
}
return $this;
} | [
"public",
"function",
"setRawData",
"(",
"array",
"$",
"data",
")",
"{",
"$",
"this",
"->",
"data",
"=",
"$",
"data",
"+",
"$",
"this",
"->",
"data",
";",
"if",
"(",
"$",
"data",
")",
"{",
"$",
"this",
"->",
"loaded",
"=",
"true",
";",
"$",
"th... | Set raw data to model
@param array $data
@return $this | [
"Set",
"raw",
"data",
"to",
"model"
] | f287a1e6c97abba6f06906255b8c26e8ab0afe61 | https://github.com/miaoxing/plugin/blob/f287a1e6c97abba6f06906255b8c26e8ab0afe61/src/Model/GetSetTrait.php#L53-L63 |
193,743 | miaoxing/plugin | src/Model/GetSetTrait.php | GetSetTrait.getDataSource | protected function getDataSource($name)
{
return isset($this->dataSources[$name]) ? $this->dataSources[$name] : $this->dataSources['*'];
} | php | protected function getDataSource($name)
{
return isset($this->dataSources[$name]) ? $this->dataSources[$name] : $this->dataSources['*'];
} | [
"protected",
"function",
"getDataSource",
"(",
"$",
"name",
")",
"{",
"return",
"isset",
"(",
"$",
"this",
"->",
"dataSources",
"[",
"$",
"name",
"]",
")",
"?",
"$",
"this",
"->",
"dataSources",
"[",
"$",
"name",
"]",
":",
"$",
"this",
"->",
"dataSou... | Returns the data source of specified column name
@param string $name
@return string | [
"Returns",
"the",
"data",
"source",
"of",
"specified",
"column",
"name"
] | f287a1e6c97abba6f06906255b8c26e8ab0afe61 | https://github.com/miaoxing/plugin/blob/f287a1e6c97abba6f06906255b8c26e8ab0afe61/src/Model/GetSetTrait.php#L281-L284 |
193,744 | miaoxing/plugin | src/Model/GetSetTrait.php | GetSetTrait.generateDbData | protected function generateDbData()
{
$dbData = [];
foreach ($this->data as $name => $value) {
if ($this->getDataSource($name) !== 'db') {
$dbData[$name] = $this->getSetValue($name, $value);
} else {
$dbData[$name] = $value;
}
... | php | protected function generateDbData()
{
$dbData = [];
foreach ($this->data as $name => $value) {
if ($this->getDataSource($name) !== 'db') {
$dbData[$name] = $this->getSetValue($name, $value);
} else {
$dbData[$name] = $value;
}
... | [
"protected",
"function",
"generateDbData",
"(",
")",
"{",
"$",
"dbData",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"data",
"as",
"$",
"name",
"=>",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"getDataSource",
"(",
"$",
"name"... | Generates data for saving to database
@return array | [
"Generates",
"data",
"for",
"saving",
"to",
"database"
] | f287a1e6c97abba6f06906255b8c26e8ab0afe61 | https://github.com/miaoxing/plugin/blob/f287a1e6c97abba6f06906255b8c26e8ab0afe61/src/Model/GetSetTrait.php#L323-L335 |
193,745 | miaoxing/plugin | src/Model/GetSetTrait.php | GetSetTrait.& | protected function &getVirtualValue($name)
{
$result = $this->callGetter($name, $this->virtualData[$name]);
if ($result) {
return $this->virtualData[$name];
}
throw new InvalidArgumentException('Invalid virtual column: ' . $name);
} | php | protected function &getVirtualValue($name)
{
$result = $this->callGetter($name, $this->virtualData[$name]);
if ($result) {
return $this->virtualData[$name];
}
throw new InvalidArgumentException('Invalid virtual column: ' . $name);
} | [
"protected",
"function",
"&",
"getVirtualValue",
"(",
"$",
"name",
")",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"callGetter",
"(",
"$",
"name",
",",
"$",
"this",
"->",
"virtualData",
"[",
"$",
"name",
"]",
")",
";",
"if",
"(",
"$",
"result",
")... | Returns the virtual column value
@param string $name
@return mixed | [
"Returns",
"the",
"virtual",
"column",
"value"
] | f287a1e6c97abba6f06906255b8c26e8ab0afe61 | https://github.com/miaoxing/plugin/blob/f287a1e6c97abba6f06906255b8c26e8ab0afe61/src/Model/GetSetTrait.php#L357-L365 |
193,746 | miaoxing/plugin | src/Model/GetSetTrait.php | GetSetTrait.setVirtualValue | protected function setVirtualValue($name, $value)
{
$result = $this->callSetter($name, $value);
if (!$result) {
throw new InvalidArgumentException('Invalid virtual column: ' . $name);
}
return $this;
} | php | protected function setVirtualValue($name, $value)
{
$result = $this->callSetter($name, $value);
if (!$result) {
throw new InvalidArgumentException('Invalid virtual column: ' . $name);
}
return $this;
} | [
"protected",
"function",
"setVirtualValue",
"(",
"$",
"name",
",",
"$",
"value",
")",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"callSetter",
"(",
"$",
"name",
",",
"$",
"value",
")",
";",
"if",
"(",
"!",
"$",
"result",
")",
"{",
"throw",
"new",
... | Sets the virtual column value
@param string $name
@param mixed $value
@return $this | [
"Sets",
"the",
"virtual",
"column",
"value"
] | f287a1e6c97abba6f06906255b8c26e8ab0afe61 | https://github.com/miaoxing/plugin/blob/f287a1e6c97abba6f06906255b8c26e8ab0afe61/src/Model/GetSetTrait.php#L374-L382 |
193,747 | miaoxing/plugin | src/Model/GetSetTrait.php | GetSetTrait.hasVirtual | protected function hasVirtual($name)
{
$name = $this->filterInputColumn($name);
return in_array($name, $this->virtual);
} | php | protected function hasVirtual($name)
{
$name = $this->filterInputColumn($name);
return in_array($name, $this->virtual);
} | [
"protected",
"function",
"hasVirtual",
"(",
"$",
"name",
")",
"{",
"$",
"name",
"=",
"$",
"this",
"->",
"filterInputColumn",
"(",
"$",
"name",
")",
";",
"return",
"in_array",
"(",
"$",
"name",
",",
"$",
"this",
"->",
"virtual",
")",
";",
"}"
] | Check if the name is virtual column
@param string $name
@return bool | [
"Check",
"if",
"the",
"name",
"is",
"virtual",
"column"
] | f287a1e6c97abba6f06906255b8c26e8ab0afe61 | https://github.com/miaoxing/plugin/blob/f287a1e6c97abba6f06906255b8c26e8ab0afe61/src/Model/GetSetTrait.php#L390-L395 |
193,748 | sndsgd/form | src/form/rule/ClosureRule.php | ClosureRule.verifyHandler | private function verifyHandler(callable $func): bool
{
$reflection = Func::getReflection($func);
$params = $reflection->getParameters();
if (count($params) !== 2) {
return false;
}
list($value, $validator) = $params;
# `$value` must
# - have no t... | php | private function verifyHandler(callable $func): bool
{
$reflection = Func::getReflection($func);
$params = $reflection->getParameters();
if (count($params) !== 2) {
return false;
}
list($value, $validator) = $params;
# `$value` must
# - have no t... | [
"private",
"function",
"verifyHandler",
"(",
"callable",
"$",
"func",
")",
":",
"bool",
"{",
"$",
"reflection",
"=",
"Func",
"::",
"getReflection",
"(",
"$",
"func",
")",
";",
"$",
"params",
"=",
"$",
"reflection",
"->",
"getParameters",
"(",
")",
";",
... | Verify the validate function has the correct signature
@param callable $func
@return bool | [
"Verify",
"the",
"validate",
"function",
"has",
"the",
"correct",
"signature"
] | 56b5b9572a8942aea34c97c7c838b871e198e34f | https://github.com/sndsgd/form/blob/56b5b9572a8942aea34c97c7c838b871e198e34f/src/form/rule/ClosureRule.php#L52-L95 |
193,749 | WellCommerce/ClientBundle | Visitor/OrderClientGroupDiscountVisitor.php | OrderClientGroupDiscountVisitor.getDiscountForClientGroup | protected function getDiscountForClientGroup(ClientGroupInterface $clientGroup = null) : float
{
if (null !== $clientGroup) {
return round((float)$clientGroup->getDiscount() / 100, 2);
}
return 0;
} | php | protected function getDiscountForClientGroup(ClientGroupInterface $clientGroup = null) : float
{
if (null !== $clientGroup) {
return round((float)$clientGroup->getDiscount() / 100, 2);
}
return 0;
} | [
"protected",
"function",
"getDiscountForClientGroup",
"(",
"ClientGroupInterface",
"$",
"clientGroup",
"=",
"null",
")",
":",
"float",
"{",
"if",
"(",
"null",
"!==",
"$",
"clientGroup",
")",
"{",
"return",
"round",
"(",
"(",
"float",
")",
"$",
"clientGroup",
... | Returns the discount for client's group
@param ClientGroupInterface $clientGroup
@return float | [
"Returns",
"the",
"discount",
"for",
"client",
"s",
"group"
] | b19aa5c962e67972f79338d2f341b30fa1ee879e | https://github.com/WellCommerce/ClientBundle/blob/b19aa5c962e67972f79338d2f341b30fa1ee879e/Visitor/OrderClientGroupDiscountVisitor.php#L82-L89 |
193,750 | frodosghost/AtomLoggerBundle | Data/AtomLoggerXmlData.php | AtomLoggerXmlData.validate | public function validate()
{
if ($this->count() > 1) {
throw new DataException('There should be only one root node to configure for Atom Logger data.');
}
foreach ($this->getNodes() as $field => $value) {
// Check for field name exists in the provided data.
... | php | public function validate()
{
if ($this->count() > 1) {
throw new DataException('There should be only one root node to configure for Atom Logger data.');
}
foreach ($this->getNodes() as $field => $value) {
// Check for field name exists in the provided data.
... | [
"public",
"function",
"validate",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"count",
"(",
")",
">",
"1",
")",
"{",
"throw",
"new",
"DataException",
"(",
"'There should be only one root node to configure for Atom Logger data.'",
")",
";",
"}",
"foreach",
"(",
... | Validate the data to be correct for a request | [
"Validate",
"the",
"data",
"to",
"be",
"correct",
"for",
"a",
"request"
] | c48823e4b3772e498b366867f27e6581f613f733 | https://github.com/frodosghost/AtomLoggerBundle/blob/c48823e4b3772e498b366867f27e6581f613f733/Data/AtomLoggerXmlData.php#L28-L42 |
193,751 | gplcart/cli | controllers/commands/Cron.php | Cron.cmdCronCron | public function cmdCronCron()
{
if (!$this->cron->run()) {
$this->errorAndExit($this->text('Unexpected result'));
}
$this->output();
} | php | public function cmdCronCron()
{
if (!$this->cron->run()) {
$this->errorAndExit($this->text('Unexpected result'));
}
$this->output();
} | [
"public",
"function",
"cmdCronCron",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"cron",
"->",
"run",
"(",
")",
")",
"{",
"$",
"this",
"->",
"errorAndExit",
"(",
"$",
"this",
"->",
"text",
"(",
"'Unexpected result'",
")",
")",
";",
"}",
"$",
... | Callback for "cron" command
Run CRON | [
"Callback",
"for",
"cron",
"command",
"Run",
"CRON"
] | e57dba53e291a225b4bff0c0d9b23d685dd1c125 | https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/Cron.php#L41-L48 |
193,752 | netbull/CoreBundle | Form/DataTransformer/EntityToPropertyTransformer.php | EntityToPropertyTransformer.reverseTransform | public function reverseTransform($value)
{
if (null === $value) {
return null;
}
$repo = $this->em->getRepository($this->className);
$entity = $repo->find($value);
if (!$entity) {
return null;
}
return $entity;
} | php | public function reverseTransform($value)
{
if (null === $value) {
return null;
}
$repo = $this->em->getRepository($this->className);
$entity = $repo->find($value);
if (!$entity) {
return null;
}
return $entity;
} | [
"public",
"function",
"reverseTransform",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"value",
")",
"{",
"return",
"null",
";",
"}",
"$",
"repo",
"=",
"$",
"this",
"->",
"em",
"->",
"getRepository",
"(",
"$",
"this",
"->",
"className"... | Transform to single id value to an entity
@param string $value
@return mixed|null|object | [
"Transform",
"to",
"single",
"id",
"value",
"to",
"an",
"entity"
] | 0bacc1d9e4733b6da613027400c48421e5a14645 | https://github.com/netbull/CoreBundle/blob/0bacc1d9e4733b6da613027400c48421e5a14645/Form/DataTransformer/EntityToPropertyTransformer.php#L100-L114 |
193,753 | rollerworks/search-core | Input/OrderStructureBuilder.php | OrderStructureBuilder.inputToNorm | private function inputToNorm($value, string $path)
{
if (null === $this->inputTransformer) {
$this->inputTransformer = $this->fieldConfig->getNormTransformer() ?? false;
}
if (false === $this->inputTransformer) {
if (null !== $value && !is_scalar($value)) {
... | php | private function inputToNorm($value, string $path)
{
if (null === $this->inputTransformer) {
$this->inputTransformer = $this->fieldConfig->getNormTransformer() ?? false;
}
if (false === $this->inputTransformer) {
if (null !== $value && !is_scalar($value)) {
... | [
"private",
"function",
"inputToNorm",
"(",
"$",
"value",
",",
"string",
"$",
"path",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"inputTransformer",
")",
"{",
"$",
"this",
"->",
"inputTransformer",
"=",
"$",
"this",
"->",
"fieldConfig",
"->",
... | Reverse transforms a value if a value transformer is set.
@param mixed $value
@return mixed returns null when the value is empty or invalid.
Note: When the value is invalid an error is registered | [
"Reverse",
"transforms",
"a",
"value",
"if",
"a",
"value",
"transformer",
"is",
"set",
"."
] | 6b5671b8c4d6298906ded768261b0a59845140fb | https://github.com/rollerworks/search-core/blob/6b5671b8c4d6298906ded768261b0a59845140fb/Input/OrderStructureBuilder.php#L190-L241 |
193,754 | wasinger/adaptimage | src/ImagineFilter/FilterChain.php | FilterChain.applyFilter | public function applyFilter(ImageInterface $image, FilterInterface $filter)
{
if ($filter instanceof ImagineAware) {
if ($this->imagine === null) {
throw new InvalidArgumentException(sprintf('In order to use %s pass an Imagine\Image\ImagineInterface instance to Transformation con... | php | public function applyFilter(ImageInterface $image, FilterInterface $filter)
{
if ($filter instanceof ImagineAware) {
if ($this->imagine === null) {
throw new InvalidArgumentException(sprintf('In order to use %s pass an Imagine\Image\ImagineInterface instance to Transformation con... | [
"public",
"function",
"applyFilter",
"(",
"ImageInterface",
"$",
"image",
",",
"FilterInterface",
"$",
"filter",
")",
"{",
"if",
"(",
"$",
"filter",
"instanceof",
"ImagineAware",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"imagine",
"===",
"null",
")",
"{",
... | Applies a given FilterInterface onto given ImageInterface and returns
modified ImageInterface
@param ImageInterface $image
@param FilterInterface $filter
@return ImageInterface
@throws InvalidArgumentException | [
"Applies",
"a",
"given",
"FilterInterface",
"onto",
"given",
"ImageInterface",
"and",
"returns",
"modified",
"ImageInterface"
] | 7b529b25081b399451c8bbd56d0cef7daaa83ec4 | https://github.com/wasinger/adaptimage/blob/7b529b25081b399451c8bbd56d0cef7daaa83ec4/src/ImagineFilter/FilterChain.php#L69-L79 |
193,755 | wasinger/adaptimage | src/ImagineFilter/FilterChain.php | FilterChain.getFilters | public function getFilters()
{
if (null === $this->sorted) {
if (!count($this->filters)) {
$this->sorted = array();
} else {
ksort($this->filters);
$this->sorted = call_user_func_array('array_merge', $this->filters);
}
... | php | public function getFilters()
{
if (null === $this->sorted) {
if (!count($this->filters)) {
$this->sorted = array();
} else {
ksort($this->filters);
$this->sorted = call_user_func_array('array_merge', $this->filters);
}
... | [
"public",
"function",
"getFilters",
"(",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"sorted",
")",
"{",
"if",
"(",
"!",
"count",
"(",
"$",
"this",
"->",
"filters",
")",
")",
"{",
"$",
"this",
"->",
"sorted",
"=",
"array",
"(",
")",
... | Returns a list of filters sorted by their priority. Filters with same priority will be returned in the order they were added.
@return array | [
"Returns",
"a",
"list",
"of",
"filters",
"sorted",
"by",
"their",
"priority",
".",
"Filters",
"with",
"same",
"priority",
"will",
"be",
"returned",
"in",
"the",
"order",
"they",
"were",
"added",
"."
] | 7b529b25081b399451c8bbd56d0cef7daaa83ec4 | https://github.com/wasinger/adaptimage/blob/7b529b25081b399451c8bbd56d0cef7daaa83ec4/src/ImagineFilter/FilterChain.php#L86-L97 |
193,756 | wasinger/adaptimage | src/ImagineFilter/FilterChain.php | FilterChain.add | public function add(FilterInterface $filter, $priority = 0)
{
$this->filters[$priority][] = $filter;
$this->sorted = null;
return $this;
} | php | public function add(FilterInterface $filter, $priority = 0)
{
$this->filters[$priority][] = $filter;
$this->sorted = null;
return $this;
} | [
"public",
"function",
"add",
"(",
"FilterInterface",
"$",
"filter",
",",
"$",
"priority",
"=",
"0",
")",
"{",
"$",
"this",
"->",
"filters",
"[",
"$",
"priority",
"]",
"[",
"]",
"=",
"$",
"filter",
";",
"$",
"this",
"->",
"sorted",
"=",
"null",
";",... | Registers a given FilterInterface in an internal array of filters for
later application to an instance of ImageInterface
@param FilterInterface $filter
@param int $priority
@return FilterChain | [
"Registers",
"a",
"given",
"FilterInterface",
"in",
"an",
"internal",
"array",
"of",
"filters",
"for",
"later",
"application",
"to",
"an",
"instance",
"of",
"ImageInterface"
] | 7b529b25081b399451c8bbd56d0cef7daaa83ec4 | https://github.com/wasinger/adaptimage/blob/7b529b25081b399451c8bbd56d0cef7daaa83ec4/src/ImagineFilter/FilterChain.php#L119-L125 |
193,757 | wasinger/adaptimage | src/ImagineFilter/FilterChain.php | FilterChain.prepend | public function prepend(FilterChain $chain)
{
$priorities = array_keys($this->filters);
if (count($priorities)) {
$priority = min(array_keys($this->filters)) - 1;
} else {
$priority = 0;
}
$filters = $chain->getFilters();
foreach ($filters as $... | php | public function prepend(FilterChain $chain)
{
$priorities = array_keys($this->filters);
if (count($priorities)) {
$priority = min(array_keys($this->filters)) - 1;
} else {
$priority = 0;
}
$filters = $chain->getFilters();
foreach ($filters as $... | [
"public",
"function",
"prepend",
"(",
"FilterChain",
"$",
"chain",
")",
"{",
"$",
"priorities",
"=",
"array_keys",
"(",
"$",
"this",
"->",
"filters",
")",
";",
"if",
"(",
"count",
"(",
"$",
"priorities",
")",
")",
"{",
"$",
"priority",
"=",
"min",
"(... | Prepend filters from another filter chain
@param FilterChain $chain
@return FilterChain | [
"Prepend",
"filters",
"from",
"another",
"filter",
"chain"
] | 7b529b25081b399451c8bbd56d0cef7daaa83ec4 | https://github.com/wasinger/adaptimage/blob/7b529b25081b399451c8bbd56d0cef7daaa83ec4/src/ImagineFilter/FilterChain.php#L133-L146 |
193,758 | wasinger/adaptimage | src/ImagineFilter/FilterChain.php | FilterChain.append | public function append(FilterChain $chain)
{
$priorities = array_keys($this->filters);
if (count($priorities)) {
$priority = max(array_keys($this->filters)) + 1;
} else {
$priority = 0;
}
$filters = $chain->getFilters();
foreach ($filters as $f... | php | public function append(FilterChain $chain)
{
$priorities = array_keys($this->filters);
if (count($priorities)) {
$priority = max(array_keys($this->filters)) + 1;
} else {
$priority = 0;
}
$filters = $chain->getFilters();
foreach ($filters as $f... | [
"public",
"function",
"append",
"(",
"FilterChain",
"$",
"chain",
")",
"{",
"$",
"priorities",
"=",
"array_keys",
"(",
"$",
"this",
"->",
"filters",
")",
";",
"if",
"(",
"count",
"(",
"$",
"priorities",
")",
")",
"{",
"$",
"priority",
"=",
"max",
"("... | Append filters from another filter chain
@param FilterChain $chain
@return FilterChain | [
"Append",
"filters",
"from",
"another",
"filter",
"chain"
] | 7b529b25081b399451c8bbd56d0cef7daaa83ec4 | https://github.com/wasinger/adaptimage/blob/7b529b25081b399451c8bbd56d0cef7daaa83ec4/src/ImagineFilter/FilterChain.php#L154-L167 |
193,759 | phpffcms/ffcms-core | src/Helper/Date.php | Date.convertToDatetime | public static function convertToDatetime($rawDate, $format = 'd.m.Y')
{
// convert timestamp to date format
if (Any::isInt($rawDate)) {
$rawDate = date(\DateTime::ATOM, $rawDate);
}
try {
$object = new \DateTime($rawDate);
return $object->format($... | php | public static function convertToDatetime($rawDate, $format = 'd.m.Y')
{
// convert timestamp to date format
if (Any::isInt($rawDate)) {
$rawDate = date(\DateTime::ATOM, $rawDate);
}
try {
$object = new \DateTime($rawDate);
return $object->format($... | [
"public",
"static",
"function",
"convertToDatetime",
"(",
"$",
"rawDate",
",",
"$",
"format",
"=",
"'d.m.Y'",
")",
"{",
"// convert timestamp to date format",
"if",
"(",
"Any",
"::",
"isInt",
"(",
"$",
"rawDate",
")",
")",
"{",
"$",
"rawDate",
"=",
"date",
... | Try to convert string to date time format
@param string|int $rawDate
@param string $format
@return string|bool | [
"Try",
"to",
"convert",
"string",
"to",
"date",
"time",
"format"
] | 44a309553ef9f115ccfcfd71f2ac6e381c612082 | https://github.com/phpffcms/ffcms-core/blob/44a309553ef9f115ccfcfd71f2ac6e381c612082/src/Helper/Date.php#L28-L41 |
193,760 | phpffcms/ffcms-core | src/Helper/Date.php | Date.humanize | public static function humanize($raw)
{
// convert to timestamp
$timestamp = $raw;
// raw can be instance of eloquent active record object, convert to str
if (!Any::isInt($raw)) {
$timestamp = self::convertToTimestamp((string)$timestamp);
}
// calculate d... | php | public static function humanize($raw)
{
// convert to timestamp
$timestamp = $raw;
// raw can be instance of eloquent active record object, convert to str
if (!Any::isInt($raw)) {
$timestamp = self::convertToTimestamp((string)$timestamp);
}
// calculate d... | [
"public",
"static",
"function",
"humanize",
"(",
"$",
"raw",
")",
"{",
"// convert to timestamp",
"$",
"timestamp",
"=",
"$",
"raw",
";",
"// raw can be instance of eloquent active record object, convert to str",
"if",
"(",
"!",
"Any",
"::",
"isInt",
"(",
"$",
"raw"... | Humanize date format
@param string|int $raw
@return bool|string | [
"Humanize",
"date",
"format"
] | 44a309553ef9f115ccfcfd71f2ac6e381c612082 | https://github.com/phpffcms/ffcms-core/blob/44a309553ef9f115ccfcfd71f2ac6e381c612082/src/Helper/Date.php#L60-L116 |
193,761 | mrofi/video-info | src/Youtube.php | Youtube.getYoutubeId | public static function getYoutubeId($url)
{
$videoId = false;
if (preg_match('%(?:youtube(?:-nocookie)?\.com/(?:[^/]+/.+/|(?:v|e(?:mbed)?)/|.*[?&]v=)|youtu\.be/)([^"&?/ ]{11})%i', $url, $match)) {
$videoId = $match[1];
}
return $videoId;
} | php | public static function getYoutubeId($url)
{
$videoId = false;
if (preg_match('%(?:youtube(?:-nocookie)?\.com/(?:[^/]+/.+/|(?:v|e(?:mbed)?)/|.*[?&]v=)|youtu\.be/)([^"&?/ ]{11})%i', $url, $match)) {
$videoId = $match[1];
}
return $videoId;
} | [
"public",
"static",
"function",
"getYoutubeId",
"(",
"$",
"url",
")",
"{",
"$",
"videoId",
"=",
"false",
";",
"if",
"(",
"preg_match",
"(",
"'%(?:youtube(?:-nocookie)?\\.com/(?:[^/]+/.+/|(?:v|e(?:mbed)?)/|.*[?&]v=)|youtu\\.be/)([^\"&?/ ]{11})%i'",
",",
"$",
"url",
",",
... | Extracts the vimeo id from a vimeo url.
Returns false if the url is not recognized as a vimeo url. | [
"Extracts",
"the",
"vimeo",
"id",
"from",
"a",
"vimeo",
"url",
".",
"Returns",
"false",
"if",
"the",
"url",
"is",
"not",
"recognized",
"as",
"a",
"vimeo",
"url",
"."
] | fa5b84212d04c284bb289a18c33c660881c92863 | https://github.com/mrofi/video-info/blob/fa5b84212d04c284bb289a18c33c660881c92863/src/Youtube.php#L49-L57 |
193,762 | joalcapa/Fundamentary | src/App/Models/UserModel.php | UserModel.getTuples | public function getTuples($data) {
foreach($this->tuples as $tuple)
$tuples[$tuple] = $data[$tuple];
foreach($this->hidden_tuples as $hidden_tuple)
unset($tuples[$hidden_tuple]);
return $tuples;
} | php | public function getTuples($data) {
foreach($this->tuples as $tuple)
$tuples[$tuple] = $data[$tuple];
foreach($this->hidden_tuples as $hidden_tuple)
unset($tuples[$hidden_tuple]);
return $tuples;
} | [
"public",
"function",
"getTuples",
"(",
"$",
"data",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"tuples",
"as",
"$",
"tuple",
")",
"$",
"tuples",
"[",
"$",
"tuple",
"]",
"=",
"$",
"data",
"[",
"$",
"tuple",
"]",
";",
"foreach",
"(",
"$",
"this"... | Proceso de llenado de las relaciones permitidas y filtrado de las relaciones ocultas, otorgadas
al modelo Rest.
@param array $data
@return array | [
"Proceso",
"de",
"llenado",
"de",
"las",
"relaciones",
"permitidas",
"y",
"filtrado",
"de",
"las",
"relaciones",
"ocultas",
"otorgadas",
"al",
"modelo",
"Rest",
"."
] | fd83dea5f90a92a38b42e3f5516f31137349601f | https://github.com/joalcapa/Fundamentary/blob/fd83dea5f90a92a38b42e3f5516f31137349601f/src/App/Models/UserModel.php#L16-L22 |
193,763 | OxfordInfoLabs/kinikit-core | src/Util/Serialisation/JSON/ObjectToJSONConverter.php | ObjectToJSONConverter.convert | public function convert($object, $ignoreNonSerialisables = false, $prettyPrint = false) {
// Normalise the input to array form.
$object = $this->normaliseToArrayForm($object, $ignoreNonSerialisables);
// Then simply encode using PHP JSON libraries.
return json_encode($object, $prettyPr... | php | public function convert($object, $ignoreNonSerialisables = false, $prettyPrint = false) {
// Normalise the input to array form.
$object = $this->normaliseToArrayForm($object, $ignoreNonSerialisables);
// Then simply encode using PHP JSON libraries.
return json_encode($object, $prettyPr... | [
"public",
"function",
"convert",
"(",
"$",
"object",
",",
"$",
"ignoreNonSerialisables",
"=",
"false",
",",
"$",
"prettyPrint",
"=",
"false",
")",
"{",
"// Normalise the input to array form.",
"$",
"object",
"=",
"$",
"this",
"->",
"normaliseToArrayForm",
"(",
"... | Convert a passed object to JSON notation | [
"Convert",
"a",
"passed",
"object",
"to",
"JSON",
"notation"
] | edc1b2e6ffabd595c4c7d322279b3dd1e59ef359 | https://github.com/OxfordInfoLabs/kinikit-core/blob/edc1b2e6ffabd595c4c7d322279b3dd1e59ef359/src/Util/Serialisation/JSON/ObjectToJSONConverter.php#L22-L29 |
193,764 | agentmedia/phine-core | src/Core/Modules/Backend/SiteList.php | SiteList.Init | protected function Init()
{
$sql = Access::SqlBuilder();
$tbl = Site::Schema()->Table();
$order = $sql->OrderList($sql->OrderAsc($tbl->Field('Name')));
$sites = Site::Schema()->Fetch(false, null, $order);
$this->sites = array();
foreach ($sites as $site)
{
... | php | protected function Init()
{
$sql = Access::SqlBuilder();
$tbl = Site::Schema()->Table();
$order = $sql->OrderList($sql->OrderAsc($tbl->Field('Name')));
$sites = Site::Schema()->Fetch(false, null, $order);
$this->sites = array();
foreach ($sites as $site)
{
... | [
"protected",
"function",
"Init",
"(",
")",
"{",
"$",
"sql",
"=",
"Access",
"::",
"SqlBuilder",
"(",
")",
";",
"$",
"tbl",
"=",
"Site",
"::",
"Schema",
"(",
")",
"->",
"Table",
"(",
")",
";",
"$",
"order",
"=",
"$",
"sql",
"->",
"OrderList",
"(",
... | Initiaizes the set of sites | [
"Initiaizes",
"the",
"set",
"of",
"sites"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Modules/Backend/SiteList.php#L31-L46 |
193,765 | agentmedia/phine-core | src/Core/Modules/Backend/SiteList.php | SiteList.PageTreeUrl | protected function PageTreeUrl(Site $site)
{
$args = array('site' => $site->GetID());
return BackendRouter::ModuleUrl(new PageTree(), $args);
} | php | protected function PageTreeUrl(Site $site)
{
$args = array('site' => $site->GetID());
return BackendRouter::ModuleUrl(new PageTree(), $args);
} | [
"protected",
"function",
"PageTreeUrl",
"(",
"Site",
"$",
"site",
")",
"{",
"$",
"args",
"=",
"array",
"(",
"'site'",
"=>",
"$",
"site",
"->",
"GetID",
"(",
")",
")",
";",
"return",
"BackendRouter",
"::",
"ModuleUrl",
"(",
"new",
"PageTree",
"(",
")",
... | Returns the page tree url of a site
@param Site $site The site
@return string The url of the page tree | [
"Returns",
"the",
"page",
"tree",
"url",
"of",
"a",
"site"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Modules/Backend/SiteList.php#L68-L72 |
193,766 | agentmedia/phine-core | src/Core/Modules/Backend/SiteList.php | SiteList.CanEdit | protected function CanEdit(Site $site)
{
return self::Guard()->Allow(BackendAction::Edit(), $site) &&
self::Guard()->Allow(BackendAction::UseIt(), new SiteForm());
} | php | protected function CanEdit(Site $site)
{
return self::Guard()->Allow(BackendAction::Edit(), $site) &&
self::Guard()->Allow(BackendAction::UseIt(), new SiteForm());
} | [
"protected",
"function",
"CanEdit",
"(",
"Site",
"$",
"site",
")",
"{",
"return",
"self",
"::",
"Guard",
"(",
")",
"->",
"Allow",
"(",
"BackendAction",
"::",
"Edit",
"(",
")",
",",
"$",
"site",
")",
"&&",
"self",
"::",
"Guard",
"(",
")",
"->",
"All... | True if site can be edited
@param Site $site
@return bool | [
"True",
"if",
"site",
"can",
"be",
"edited"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Modules/Backend/SiteList.php#L97-L101 |
193,767 | nhlm/pipechain | src/PipeChain.php | PipeChain.pipe | final public function pipe(callable $stage, callable $fallback = null): PipeChainInterface
{
$this->stack->attach($stage, $fallback);
return $this;
} | php | final public function pipe(callable $stage, callable $fallback = null): PipeChainInterface
{
$this->stack->attach($stage, $fallback);
return $this;
} | [
"final",
"public",
"function",
"pipe",
"(",
"callable",
"$",
"stage",
",",
"callable",
"$",
"fallback",
"=",
"null",
")",
":",
"PipeChainInterface",
"{",
"$",
"this",
"->",
"stack",
"->",
"attach",
"(",
"$",
"stage",
",",
"$",
"fallback",
")",
";",
"re... | pipes a stage with an optional associated fallback.
@param callable $stage
@param callable $fallback
@return PipeChainInterface | [
"pipes",
"a",
"stage",
"with",
"an",
"optional",
"associated",
"fallback",
"."
] | 7f67b54372415a66c42ce074bc359c55fda218a5 | https://github.com/nhlm/pipechain/blob/7f67b54372415a66c42ce074bc359c55fda218a5/src/PipeChain.php#L55-L60 |
193,768 | nhlm/pipechain | src/PipeChain.php | PipeChain.process | final public function process($payload)
{
$payload = $this->processor->processStack($payload, $this->stack);
if ( $this->next instanceof PipeChainInterface ) {
$payload = $this->next->process($payload);
}
return $payload;
} | php | final public function process($payload)
{
$payload = $this->processor->processStack($payload, $this->stack);
if ( $this->next instanceof PipeChainInterface ) {
$payload = $this->next->process($payload);
}
return $payload;
} | [
"final",
"public",
"function",
"process",
"(",
"$",
"payload",
")",
"{",
"$",
"payload",
"=",
"$",
"this",
"->",
"processor",
"->",
"processStack",
"(",
"$",
"payload",
",",
"$",
"this",
"->",
"stack",
")",
";",
"if",
"(",
"$",
"this",
"->",
"next",
... | processes a payload.
@param $payload
@return mixed the payload | [
"processes",
"a",
"payload",
"."
] | 7f67b54372415a66c42ce074bc359c55fda218a5 | https://github.com/nhlm/pipechain/blob/7f67b54372415a66c42ce074bc359c55fda218a5/src/PipeChain.php#L68-L77 |
193,769 | nhlm/pipechain | src/PipeChain.php | PipeChain.chain | final public function chain(PipeChainInterface $chain): PipeChainInterface
{
if ( $this->next instanceof PipeChainInterface ) {
$this->next->chain($chain);
}
else {
$this->next = $chain;
}
return $this;
} | php | final public function chain(PipeChainInterface $chain): PipeChainInterface
{
if ( $this->next instanceof PipeChainInterface ) {
$this->next->chain($chain);
}
else {
$this->next = $chain;
}
return $this;
} | [
"final",
"public",
"function",
"chain",
"(",
"PipeChainInterface",
"$",
"chain",
")",
":",
"PipeChainInterface",
"{",
"if",
"(",
"$",
"this",
"->",
"next",
"instanceof",
"PipeChainInterface",
")",
"{",
"$",
"this",
"->",
"next",
"->",
"chain",
"(",
"$",
"c... | appends the provided pipe to the end of the chain.
@param PipeChainInterface $chain
@return PipeChainInterface | [
"appends",
"the",
"provided",
"pipe",
"to",
"the",
"end",
"of",
"the",
"chain",
"."
] | 7f67b54372415a66c42ce074bc359c55fda218a5 | https://github.com/nhlm/pipechain/blob/7f67b54372415a66c42ce074bc359c55fda218a5/src/PipeChain.php#L85-L95 |
193,770 | MARCspec/File_MARC_Reference | src/File_MARC_Reference_Cache.php | File_MARC_Reference_Cache.spec | public function spec($spec, $value = null)
{
$key = "$spec";
if (array_key_exists($key, $this->spec)) {
return $this->spec[$key]; // return since spec is already cached
}
// cache a spec
if (!is_null($value)) {
return $this->spec[$key] = $value;
... | php | public function spec($spec, $value = null)
{
$key = "$spec";
if (array_key_exists($key, $this->spec)) {
return $this->spec[$key]; // return since spec is already cached
}
// cache a spec
if (!is_null($value)) {
return $this->spec[$key] = $value;
... | [
"public",
"function",
"spec",
"(",
"$",
"spec",
",",
"$",
"value",
"=",
"null",
")",
"{",
"$",
"key",
"=",
"\"$spec\"",
";",
"if",
"(",
"array_key_exists",
"(",
"$",
"key",
",",
"$",
"this",
"->",
"spec",
")",
")",
"{",
"return",
"$",
"this",
"->... | Cache a spec.
This is a cache control method for specs
@param string|MARCspecInterface|SubSpecInterface $spec The spec to cache
@param bool|null $value Validation result for a subspec
@return mixed Returns either a spec or a validation result | [
"Cache",
"a",
"spec",
"."
] | 29abbff5bec5e3bcfeeb07ba7bee94cc0a0a7f5e | https://github.com/MARCspec/File_MARC_Reference/blob/29abbff5bec5e3bcfeeb07ba7bee94cc0a0a7f5e/src/File_MARC_Reference_Cache.php#L28-L50 |
193,771 | MARCspec/File_MARC_Reference | src/File_MARC_Reference_Cache.php | File_MARC_Reference_Cache.validation | public function validation($subSpec, $value = null)
{
$key = "$subSpec";
if (is_null($value)) {
if (array_key_exists($key, $this->valid)) {
return $this->valid[$key];
} else {
return;
}
}
$this->valid[$key] = $value;... | php | public function validation($subSpec, $value = null)
{
$key = "$subSpec";
if (is_null($value)) {
if (array_key_exists($key, $this->valid)) {
return $this->valid[$key];
} else {
return;
}
}
$this->valid[$key] = $value;... | [
"public",
"function",
"validation",
"(",
"$",
"subSpec",
",",
"$",
"value",
"=",
"null",
")",
"{",
"$",
"key",
"=",
"\"$subSpec\"",
";",
"if",
"(",
"is_null",
"(",
"$",
"value",
")",
")",
"{",
"if",
"(",
"array_key_exists",
"(",
"$",
"key",
",",
"$... | Set or get subspec validation.
@param SubSpecInterface|string $subSpec The validated subspec
@param bool|null $value Validation result true or false
@return bool|null If subspec was already validated return true or false.
Returns null, if subspec was not already validated. | [
"Set",
"or",
"get",
"subspec",
"validation",
"."
] | 29abbff5bec5e3bcfeeb07ba7bee94cc0a0a7f5e | https://github.com/MARCspec/File_MARC_Reference/blob/29abbff5bec5e3bcfeeb07ba7bee94cc0a0a7f5e/src/File_MARC_Reference_Cache.php#L61-L72 |
193,772 | MARCspec/File_MARC_Reference | src/File_MARC_Reference_Cache.php | File_MARC_Reference_Cache.sliceData | private function sliceData($key, $spec)
{
$start = $spec->getIndexStart();
if ('#' === $start) { // reverse index order
$end = count($this->data[$key]) - 1;
$start = $spec->getIndexEnd();
if ('#' === $start) {
return [$this->data[$key][$end]];
... | php | private function sliceData($key, $spec)
{
$start = $spec->getIndexStart();
if ('#' === $start) { // reverse index order
$end = count($this->data[$key]) - 1;
$start = $spec->getIndexEnd();
if ('#' === $start) {
return [$this->data[$key][$end]];
... | [
"private",
"function",
"sliceData",
"(",
"$",
"key",
",",
"$",
"spec",
")",
"{",
"$",
"start",
"=",
"$",
"spec",
"->",
"getIndexStart",
"(",
")",
";",
"if",
"(",
"'#'",
"===",
"$",
"start",
")",
"{",
"// reverse index order",
"$",
"end",
"=",
"count"... | Get a slice from data.
@param string $key The datas key
@param FieldInterface|SubfieldInterface $spec Spec with slice information
@return array[File_MARC_Field|File_MARC_Subfield] | [
"Get",
"a",
"slice",
"from",
"data",
"."
] | 29abbff5bec5e3bcfeeb07ba7bee94cc0a0a7f5e | https://github.com/MARCspec/File_MARC_Reference/blob/29abbff5bec5e3bcfeeb07ba7bee94cc0a0a7f5e/src/File_MARC_Reference_Cache.php#L135-L155 |
193,773 | MARCspec/File_MARC_Reference | src/File_MARC_Reference_Cache.php | File_MARC_Reference_Cache.getContents | public function getContents($spec, array $value = [])
{
if (!$value) {
$value = $this->getData("$spec");
}
$substring = false;
$charStart = null;
$length = null;
if ($spec->offsetExists('charStart')) {
$substring = true;
$charStart ... | php | public function getContents($spec, array $value = [])
{
if (!$value) {
$value = $this->getData("$spec");
}
$substring = false;
$charStart = null;
$length = null;
if ($spec->offsetExists('charStart')) {
$substring = true;
$charStart ... | [
"public",
"function",
"getContents",
"(",
"$",
"spec",
",",
"array",
"$",
"value",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"!",
"$",
"value",
")",
"{",
"$",
"value",
"=",
"$",
"this",
"->",
"getData",
"(",
"\"$spec\"",
")",
";",
"}",
"$",
"substring"... | Get referenced data content.
@param FieldInterface|SubfieldInterface $spec The corresponding spec
@param array[File_MARC_Field|File_MARC_Subfield] $value The value to reference
@return array[string] Array of referenced data content | [
"Get",
"referenced",
"data",
"content",
"."
] | 29abbff5bec5e3bcfeeb07ba7bee94cc0a0a7f5e | https://github.com/MARCspec/File_MARC_Reference/blob/29abbff5bec5e3bcfeeb07ba7bee94cc0a0a7f5e/src/File_MARC_Reference_Cache.php#L165-L206 |
193,774 | jfadich/json-property | src/JsonProperty.php | JsonProperty.push | public function push($key, $value)
{
$array = $this->get($key, []);
if(!is_array($array))
throw new JsonPropertyException('Cannot push value to non array');
array_push($array, $value);
return $this->set($key, $array);
} | php | public function push($key, $value)
{
$array = $this->get($key, []);
if(!is_array($array))
throw new JsonPropertyException('Cannot push value to non array');
array_push($array, $value);
return $this->set($key, $array);
} | [
"public",
"function",
"push",
"(",
"$",
"key",
",",
"$",
"value",
")",
"{",
"$",
"array",
"=",
"$",
"this",
"->",
"get",
"(",
"$",
"key",
",",
"[",
"]",
")",
";",
"if",
"(",
"!",
"is_array",
"(",
"$",
"array",
")",
")",
"throw",
"new",
"JsonP... | Push a value into an array assigned to the provided key.
@param $key
@param $value
@return mixed
@throws JsonPropertyException | [
"Push",
"a",
"value",
"into",
"an",
"array",
"assigned",
"to",
"the",
"provided",
"key",
"."
] | 3c11ac731a7bc206529058a94047eeafa5827b15 | https://github.com/jfadich/json-property/blob/3c11ac731a7bc206529058a94047eeafa5827b15/src/JsonProperty.php#L47-L57 |
193,775 | jfadich/json-property | src/JsonProperty.php | JsonProperty.merge | public function merge( array $values, array $allowedKeys = [] )
{
$this->data = array_merge(
$this->data,
array_only( $values, array_merge(array_keys( $this->data ), $allowedKeys) )
);
$this->persist();
return $this;
} | php | public function merge( array $values, array $allowedKeys = [] )
{
$this->data = array_merge(
$this->data,
array_only( $values, array_merge(array_keys( $this->data ), $allowedKeys) )
);
$this->persist();
return $this;
} | [
"public",
"function",
"merge",
"(",
"array",
"$",
"values",
",",
"array",
"$",
"allowedKeys",
"=",
"[",
"]",
")",
"{",
"$",
"this",
"->",
"data",
"=",
"array_merge",
"(",
"$",
"this",
"->",
"data",
",",
"array_only",
"(",
"$",
"values",
",",
"array_m... | Merge the given array into existing values. Require whitelist to add keys
@param array $values
@param array $allowedKeys
@return array | [
"Merge",
"the",
"given",
"array",
"into",
"existing",
"values",
".",
"Require",
"whitelist",
"to",
"add",
"keys"
] | 3c11ac731a7bc206529058a94047eeafa5827b15 | https://github.com/jfadich/json-property/blob/3c11ac731a7bc206529058a94047eeafa5827b15/src/JsonProperty.php#L66-L76 |
193,776 | jfadich/json-property | src/JsonProperty.php | JsonProperty.forget | public function forget($key)
{
if($this->has($key)) {
array_forget($this->data, $key);
}
$this->persist();
} | php | public function forget($key)
{
if($this->has($key)) {
array_forget($this->data, $key);
}
$this->persist();
} | [
"public",
"function",
"forget",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"has",
"(",
"$",
"key",
")",
")",
"{",
"array_forget",
"(",
"$",
"this",
"->",
"data",
",",
"$",
"key",
")",
";",
"}",
"$",
"this",
"->",
"persist",
"(",
... | Remove element from settings array
@param $key | [
"Remove",
"element",
"from",
"settings",
"array"
] | 3c11ac731a7bc206529058a94047eeafa5827b15 | https://github.com/jfadich/json-property/blob/3c11ac731a7bc206529058a94047eeafa5827b15/src/JsonProperty.php#L118-L125 |
193,777 | jfadich/json-property | src/JsonProperty.php | JsonProperty.isEmpty | public function isEmpty($key)
{
return !array_has($this->data, $key) || filled(array_get($this->data, $key));
} | php | public function isEmpty($key)
{
return !array_has($this->data, $key) || filled(array_get($this->data, $key));
} | [
"public",
"function",
"isEmpty",
"(",
"$",
"key",
")",
"{",
"return",
"!",
"array_has",
"(",
"$",
"this",
"->",
"data",
",",
"$",
"key",
")",
"||",
"filled",
"(",
"array_get",
"(",
"$",
"this",
"->",
"data",
",",
"$",
"key",
")",
")",
";",
"}"
] | Check if there is a value for the given key
@param $key
@return bool | [
"Check",
"if",
"there",
"is",
"a",
"value",
"for",
"the",
"given",
"key"
] | 3c11ac731a7bc206529058a94047eeafa5827b15 | https://github.com/jfadich/json-property/blob/3c11ac731a7bc206529058a94047eeafa5827b15/src/JsonProperty.php#L153-L156 |
193,778 | rzajac/phptools | src/Api/JResp.php | JResp.retError | public static function retError($value, $http_code = HttpCodes::HTTP_BAD_REQUEST, $prettyPrint = false)
{
$response = self::buildResponse($value, false, $http_code);
return self::retJSON($response, $prettyPrint);
} | php | public static function retError($value, $http_code = HttpCodes::HTTP_BAD_REQUEST, $prettyPrint = false)
{
$response = self::buildResponse($value, false, $http_code);
return self::retJSON($response, $prettyPrint);
} | [
"public",
"static",
"function",
"retError",
"(",
"$",
"value",
",",
"$",
"http_code",
"=",
"HttpCodes",
"::",
"HTTP_BAD_REQUEST",
",",
"$",
"prettyPrint",
"=",
"false",
")",
"{",
"$",
"response",
"=",
"self",
"::",
"buildResponse",
"(",
"$",
"value",
",",
... | Return error.
@param mixed $value The error response
@param int $http_code The HTTP response code
@param bool $prettyPrint If true the JSON will be pretty printed
@return string JSON encoded $value. | [
"Return",
"error",
"."
] | 3cbece7645942d244603c14ba897d8a676ee3088 | https://github.com/rzajac/phptools/blob/3cbece7645942d244603c14ba897d8a676ee3088/src/Api/JResp.php#L39-L44 |
193,779 | rzajac/phptools | src/Api/JResp.php | JResp.buildResponse | public static function buildResponse($value, $success, $httpCode, Paginer $pagingInfo = null)
{
$response = new stdClass();
$response->success = $success;
$response->http_code = $httpCode;
if ($pagingInfo) {
$response->pageNumber = $pagingInfo->getPageNumber();
... | php | public static function buildResponse($value, $success, $httpCode, Paginer $pagingInfo = null)
{
$response = new stdClass();
$response->success = $success;
$response->http_code = $httpCode;
if ($pagingInfo) {
$response->pageNumber = $pagingInfo->getPageNumber();
... | [
"public",
"static",
"function",
"buildResponse",
"(",
"$",
"value",
",",
"$",
"success",
",",
"$",
"httpCode",
",",
"Paginer",
"$",
"pagingInfo",
"=",
"null",
")",
"{",
"$",
"response",
"=",
"new",
"stdClass",
"(",
")",
";",
"$",
"response",
"->",
"suc... | Builds API response.
@param mixed $value The response
@param bool $success Set to true for success, false for failure
@param int $httpCode The HTTP response code
@param Paginer $pagingInfo The pagination information coming from Paginer interface
@return stdClass | [
"Builds",
"API",
"response",
"."
] | 3cbece7645942d244603c14ba897d8a676ee3088 | https://github.com/rzajac/phptools/blob/3cbece7645942d244603c14ba897d8a676ee3088/src/Api/JResp.php#L56-L75 |
193,780 | rzajac/phptools | src/Api/JResp.php | JResp.retSuccess | public static function retSuccess($value = null, $http_code = HttpCodes::HTTP_OK, Paginer $pagingInfo = null, $prettyPrint = false)
{
$response = self::buildResponse($value, true, $http_code, $pagingInfo);
return self::retJSON($response, $prettyPrint);
} | php | public static function retSuccess($value = null, $http_code = HttpCodes::HTTP_OK, Paginer $pagingInfo = null, $prettyPrint = false)
{
$response = self::buildResponse($value, true, $http_code, $pagingInfo);
return self::retJSON($response, $prettyPrint);
} | [
"public",
"static",
"function",
"retSuccess",
"(",
"$",
"value",
"=",
"null",
",",
"$",
"http_code",
"=",
"HttpCodes",
"::",
"HTTP_OK",
",",
"Paginer",
"$",
"pagingInfo",
"=",
"null",
",",
"$",
"prettyPrint",
"=",
"false",
")",
"{",
"$",
"response",
"=",... | Return success.
@param mixed $value The success response
@param int $http_code The HTTP response code
@param Paginer $pagingInfo The pagination information coming from Paginer interface
@param bool $prettyPrint If true the JSON will be pretty printed
@return string JSON encoded $value | [
"Return",
"success",
"."
] | 3cbece7645942d244603c14ba897d8a676ee3088 | https://github.com/rzajac/phptools/blob/3cbece7645942d244603c14ba897d8a676ee3088/src/Api/JResp.php#L102-L107 |
193,781 | rzajac/phptools | src/Api/JResp.php | JResp.isSuccess | public static function isSuccess(stdClass $response)
{
if (is_object($response) && $response->success == true) {
return HttpCodes::isOk($response->http_code);
} else {
return false;
}
} | php | public static function isSuccess(stdClass $response)
{
if (is_object($response) && $response->success == true) {
return HttpCodes::isOk($response->http_code);
} else {
return false;
}
} | [
"public",
"static",
"function",
"isSuccess",
"(",
"stdClass",
"$",
"response",
")",
"{",
"if",
"(",
"is_object",
"(",
"$",
"response",
")",
"&&",
"$",
"response",
"->",
"success",
"==",
"true",
")",
"{",
"return",
"HttpCodes",
"::",
"isOk",
"(",
"$",
"... | Check if a response is a success.
@param stdClass $response The AJAX response in a format returned by buildResponse method
@return bool | [
"Check",
"if",
"a",
"response",
"is",
"a",
"success",
"."
] | 3cbece7645942d244603c14ba897d8a676ee3088 | https://github.com/rzajac/phptools/blob/3cbece7645942d244603c14ba897d8a676ee3088/src/Api/JResp.php#L116-L123 |
193,782 | picturae/php-composition-utils | src/WithFullReflection.php | WithFullReflection.set | private function set($operand, $value)
{
$reflector = $this->getReflector();
if (!$reflector->hasProperty($operand)) {
throw new RuntimeException('Trying to access undefined property in reflection context: ' . $operand);
}
$reflectionProperty = $reflector->getProperty($... | php | private function set($operand, $value)
{
$reflector = $this->getReflector();
if (!$reflector->hasProperty($operand)) {
throw new RuntimeException('Trying to access undefined property in reflection context: ' . $operand);
}
$reflectionProperty = $reflector->getProperty($... | [
"private",
"function",
"set",
"(",
"$",
"operand",
",",
"$",
"value",
")",
"{",
"$",
"reflector",
"=",
"$",
"this",
"->",
"getReflector",
"(",
")",
";",
"if",
"(",
"!",
"$",
"reflector",
"->",
"hasProperty",
"(",
"$",
"operand",
")",
")",
"{",
"thr... | Reflection property setter.
@param string property subject.
@param mixed property value.
@return $this | [
"Reflection",
"property",
"setter",
"."
] | 59a8191066c27687daabc8c5b33addb3599826ab | https://github.com/picturae/php-composition-utils/blob/59a8191066c27687daabc8c5b33addb3599826ab/src/WithFullReflection.php#L109-L131 |
193,783 | picturae/php-composition-utils | src/WithFullReflection.php | WithFullReflection.get | private function get($operand)
{
$reflector = $this->getReflector();
if (!$reflector->hasProperty($operand)) {
throw new RuntimeException('Trying to access undefined property from reflection context: ' . $operand);
}
$reflectionProperty = $reflector->getProperty($operan... | php | private function get($operand)
{
$reflector = $this->getReflector();
if (!$reflector->hasProperty($operand)) {
throw new RuntimeException('Trying to access undefined property from reflection context: ' . $operand);
}
$reflectionProperty = $reflector->getProperty($operan... | [
"private",
"function",
"get",
"(",
"$",
"operand",
")",
"{",
"$",
"reflector",
"=",
"$",
"this",
"->",
"getReflector",
"(",
")",
";",
"if",
"(",
"!",
"$",
"reflector",
"->",
"hasProperty",
"(",
"$",
"operand",
")",
")",
"{",
"throw",
"new",
"RuntimeE... | Reflected p[roperties defauilt getter.
@param string property subject | [
"Reflected",
"p",
"[",
"roperties",
"defauilt",
"getter",
"."
] | 59a8191066c27687daabc8c5b33addb3599826ab | https://github.com/picturae/php-composition-utils/blob/59a8191066c27687daabc8c5b33addb3599826ab/src/WithFullReflection.php#L137-L155 |
193,784 | OliverMonneke/pennePHP | src/Datatype/String.php | String.substring | public static function substring($string, $start = 0, $length = null)
{
if (!self::isValid($string)) {
return false;
}
return mb_substr($string, $start, $length);
} | php | public static function substring($string, $start = 0, $length = null)
{
if (!self::isValid($string)) {
return false;
}
return mb_substr($string, $start, $length);
} | [
"public",
"static",
"function",
"substring",
"(",
"$",
"string",
",",
"$",
"start",
"=",
"0",
",",
"$",
"length",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"self",
"::",
"isValid",
"(",
"$",
"string",
")",
")",
"{",
"return",
"false",
";",
"}",
"ret... | Get a part of a string
@param string $string The string
@param int $start Starting point
@param int $length Length
@return string | [
"Get",
"a",
"part",
"of",
"a",
"string"
] | dd0de7944685a3f1947157e1254fc54b55ff9942 | https://github.com/OliverMonneke/pennePHP/blob/dd0de7944685a3f1947157e1254fc54b55ff9942/src/Datatype/String.php#L70-L77 |
193,785 | OliverMonneke/pennePHP | src/Datatype/String.php | String.startsWith | public static function startsWith($needle, $haystack, $caseSensitive = true)
{
if (!self::isValid($needle)) {
return false;
}
list($needle, $haystack) = self::transformCase($needle, $haystack, $caseSensitive);
if ($needle === false) {
return false;
}... | php | public static function startsWith($needle, $haystack, $caseSensitive = true)
{
if (!self::isValid($needle)) {
return false;
}
list($needle, $haystack) = self::transformCase($needle, $haystack, $caseSensitive);
if ($needle === false) {
return false;
}... | [
"public",
"static",
"function",
"startsWith",
"(",
"$",
"needle",
",",
"$",
"haystack",
",",
"$",
"caseSensitive",
"=",
"true",
")",
"{",
"if",
"(",
"!",
"self",
"::",
"isValid",
"(",
"$",
"needle",
")",
")",
"{",
"return",
"false",
";",
"}",
"list",... | Check if string starts with another string
@param string $needle String to look for
@param string $haystack String to check
@param bool $caseSensitive Case sensitive check
@return bool | [
"Check",
"if",
"string",
"starts",
"with",
"another",
"string"
] | dd0de7944685a3f1947157e1254fc54b55ff9942 | https://github.com/OliverMonneke/pennePHP/blob/dd0de7944685a3f1947157e1254fc54b55ff9942/src/Datatype/String.php#L104-L117 |
193,786 | OliverMonneke/pennePHP | src/Datatype/String.php | String.endsWith | public static function endsWith($needle, $haystack, $caseSensitive = true)
{
list($needle, $haystack) = self::transformCase($needle, $haystack, $caseSensitive);
return (self::substring($haystack, -(self::length($needle))) === $needle);
} | php | public static function endsWith($needle, $haystack, $caseSensitive = true)
{
list($needle, $haystack) = self::transformCase($needle, $haystack, $caseSensitive);
return (self::substring($haystack, -(self::length($needle))) === $needle);
} | [
"public",
"static",
"function",
"endsWith",
"(",
"$",
"needle",
",",
"$",
"haystack",
",",
"$",
"caseSensitive",
"=",
"true",
")",
"{",
"list",
"(",
"$",
"needle",
",",
"$",
"haystack",
")",
"=",
"self",
"::",
"transformCase",
"(",
"$",
"needle",
",",
... | Check if string ends with another string
@param string $needle String to look for
@param string $haystack String to check
@param bool $caseSensitive Case sensitive check
@return bool | [
"Check",
"if",
"string",
"ends",
"with",
"another",
"string"
] | dd0de7944685a3f1947157e1254fc54b55ff9942 | https://github.com/OliverMonneke/pennePHP/blob/dd0de7944685a3f1947157e1254fc54b55ff9942/src/Datatype/String.php#L128-L133 |
193,787 | OliverMonneke/pennePHP | src/Datatype/String.php | String.contains | public static function contains($needle, $haystack, $caseSensitive = true)
{
if (!self::isValid($haystack)) {
return false;
}
list($needle, $haystack) = self::transformCase($needle, $haystack, $caseSensitive);
return (mb_strpos($haystack, $needle) !== false);
} | php | public static function contains($needle, $haystack, $caseSensitive = true)
{
if (!self::isValid($haystack)) {
return false;
}
list($needle, $haystack) = self::transformCase($needle, $haystack, $caseSensitive);
return (mb_strpos($haystack, $needle) !== false);
} | [
"public",
"static",
"function",
"contains",
"(",
"$",
"needle",
",",
"$",
"haystack",
",",
"$",
"caseSensitive",
"=",
"true",
")",
"{",
"if",
"(",
"!",
"self",
"::",
"isValid",
"(",
"$",
"haystack",
")",
")",
"{",
"return",
"false",
";",
"}",
"list",... | Check if string contains another string
@param string $needle String to look for
@param string $haystack String to check
@param bool $caseSensitive Case sensitive check
@return bool | [
"Check",
"if",
"string",
"contains",
"another",
"string"
] | dd0de7944685a3f1947157e1254fc54b55ff9942 | https://github.com/OliverMonneke/pennePHP/blob/dd0de7944685a3f1947157e1254fc54b55ff9942/src/Datatype/String.php#L144-L153 |
193,788 | OliverMonneke/pennePHP | src/Datatype/String.php | String.replace | public static function replace($search, $replace, $string, $caseSensitive = true)
{
if (!self::isValid($replace)) {
return false;
}
if (!$caseSensitive) {
return str_ireplace($search, $replace, $string);
} else {
return str_replace($search, $repla... | php | public static function replace($search, $replace, $string, $caseSensitive = true)
{
if (!self::isValid($replace)) {
return false;
}
if (!$caseSensitive) {
return str_ireplace($search, $replace, $string);
} else {
return str_replace($search, $repla... | [
"public",
"static",
"function",
"replace",
"(",
"$",
"search",
",",
"$",
"replace",
",",
"$",
"string",
",",
"$",
"caseSensitive",
"=",
"true",
")",
"{",
"if",
"(",
"!",
"self",
"::",
"isValid",
"(",
"$",
"replace",
")",
")",
"{",
"return",
"false",
... | Replace a string with another string
@param string $search The string to look for
@param string $replace The replacement string
@param string $string The string to check
@param bool $caseSensitive Case sensitive replacement
@return string|bool | [
"Replace",
"a",
"string",
"with",
"another",
"string"
] | dd0de7944685a3f1947157e1254fc54b55ff9942 | https://github.com/OliverMonneke/pennePHP/blob/dd0de7944685a3f1947157e1254fc54b55ff9942/src/Datatype/String.php#L165-L176 |
193,789 | OliverMonneke/pennePHP | src/Datatype/String.php | String.isEmpty | public static function isEmpty($string)
{
if (!self::isValid($string) &&
null !== $string
) {
return false;
}
return ($string === null || $string === '');
} | php | public static function isEmpty($string)
{
if (!self::isValid($string) &&
null !== $string
) {
return false;
}
return ($string === null || $string === '');
} | [
"public",
"static",
"function",
"isEmpty",
"(",
"$",
"string",
")",
"{",
"if",
"(",
"!",
"self",
"::",
"isValid",
"(",
"$",
"string",
")",
"&&",
"null",
"!==",
"$",
"string",
")",
"{",
"return",
"false",
";",
"}",
"return",
"(",
"$",
"string",
"===... | Check if string is empty
@param mixed $string The string
@return bool | [
"Check",
"if",
"string",
"is",
"empty"
] | dd0de7944685a3f1947157e1254fc54b55ff9942 | https://github.com/OliverMonneke/pennePHP/blob/dd0de7944685a3f1947157e1254fc54b55ff9942/src/Datatype/String.php#L185-L194 |
193,790 | OliverMonneke/pennePHP | src/Datatype/String.php | String.isNotEmpty | public static function isNotEmpty($string)
{
if (!self::isValid($string) &&
null !== $string
) {
return false;
}
return (!self::isEmpty($string));
} | php | public static function isNotEmpty($string)
{
if (!self::isValid($string) &&
null !== $string
) {
return false;
}
return (!self::isEmpty($string));
} | [
"public",
"static",
"function",
"isNotEmpty",
"(",
"$",
"string",
")",
"{",
"if",
"(",
"!",
"self",
"::",
"isValid",
"(",
"$",
"string",
")",
"&&",
"null",
"!==",
"$",
"string",
")",
"{",
"return",
"false",
";",
"}",
"return",
"(",
"!",
"self",
"::... | Check if string is not empty
@param string $string The string
@return bool | [
"Check",
"if",
"string",
"is",
"not",
"empty"
] | dd0de7944685a3f1947157e1254fc54b55ff9942 | https://github.com/OliverMonneke/pennePHP/blob/dd0de7944685a3f1947157e1254fc54b55ff9942/src/Datatype/String.php#L203-L212 |
193,791 | atk14/Translate | src/translate.php | Translate.Trans | static function Trans($text,$from_charset,$to_charset,$options = array()){
$from_charset = self::_GetCharsetByName($from_charset);
$to_charset = self::_GetCharsetByName($to_charset);
if($from_charset==$to_charset){
return $text;
}
return self::_Trans($text,$from_charset,$to_charset,$options);
} | php | static function Trans($text,$from_charset,$to_charset,$options = array()){
$from_charset = self::_GetCharsetByName($from_charset);
$to_charset = self::_GetCharsetByName($to_charset);
if($from_charset==$to_charset){
return $text;
}
return self::_Trans($text,$from_charset,$to_charset,$options);
} | [
"static",
"function",
"Trans",
"(",
"$",
"text",
",",
"$",
"from_charset",
",",
"$",
"to_charset",
",",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"$",
"from_charset",
"=",
"self",
"::",
"_GetCharsetByName",
"(",
"$",
"from_charset",
")",
";",
"... | Converts string from source charset to target charset.
Parameter can be an array of string and the method also returns array with all converted strings.
$options description
- "recode_array_keys" - when $text is of type array, also its keys will be converted
@param string|array $text
@param string $from_charset inpu... | [
"Converts",
"string",
"from",
"source",
"charset",
"to",
"target",
"charset",
"."
] | 9aeddfe5a6120666eb167a5634dcd0606d856584 | https://github.com/atk14/Translate/blob/9aeddfe5a6120666eb167a5634dcd0606d856584/src/translate.php#L89-L96 |
193,792 | atk14/Translate | src/translate.php | Translate.Lower | static function Lower($text,$charset = null){
static $TR_TABLES = array();
$charset = self::_GetCharsetByName($charset);
switch($charset){
case "windows-1250":
case "iso-8859-2":
if(!isset($TR_TABLES[$charset])){
require(dirname(__FILE__)."/tr_tables/lower_upper/$charset.php");
}
... | php | static function Lower($text,$charset = null){
static $TR_TABLES = array();
$charset = self::_GetCharsetByName($charset);
switch($charset){
case "windows-1250":
case "iso-8859-2":
if(!isset($TR_TABLES[$charset])){
require(dirname(__FILE__)."/tr_tables/lower_upper/$charset.php");
}
... | [
"static",
"function",
"Lower",
"(",
"$",
"text",
",",
"$",
"charset",
"=",
"null",
")",
"{",
"static",
"$",
"TR_TABLES",
"=",
"array",
"(",
")",
";",
"$",
"charset",
"=",
"self",
"::",
"_GetCharsetByName",
"(",
"$",
"charset",
")",
";",
"switch",
"("... | Converts string to lowercase.
@param string $text
@param string $charset
@return string | [
"Converts",
"string",
"to",
"lowercase",
"."
] | 9aeddfe5a6120666eb167a5634dcd0606d856584 | https://github.com/atk14/Translate/blob/9aeddfe5a6120666eb167a5634dcd0606d856584/src/translate.php#L312-L332 |
193,793 | atk14/Translate | src/translate.php | Translate.Upper | static function Upper($text,$charset = null){
static $TR_TABLES = array();
$charset = self::_GetCharsetByName($charset);
switch($charset){
case "windows-1250":
case "iso-8859-2":
if(!isset($TR_TABLES[$charset])){
require(dirname(__FILE__)."/tr_tables/lower_upper/$charset.php");
}
... | php | static function Upper($text,$charset = null){
static $TR_TABLES = array();
$charset = self::_GetCharsetByName($charset);
switch($charset){
case "windows-1250":
case "iso-8859-2":
if(!isset($TR_TABLES[$charset])){
require(dirname(__FILE__)."/tr_tables/lower_upper/$charset.php");
}
... | [
"static",
"function",
"Upper",
"(",
"$",
"text",
",",
"$",
"charset",
"=",
"null",
")",
"{",
"static",
"$",
"TR_TABLES",
"=",
"array",
"(",
")",
";",
"$",
"charset",
"=",
"self",
"::",
"_GetCharsetByName",
"(",
"$",
"charset",
")",
";",
"switch",
"("... | Converts string to uppercase.
@param string $text
@param string $charset
@return string | [
"Converts",
"string",
"to",
"uppercase",
"."
] | 9aeddfe5a6120666eb167a5634dcd0606d856584 | https://github.com/atk14/Translate/blob/9aeddfe5a6120666eb167a5634dcd0606d856584/src/translate.php#L341-L362 |
193,794 | atk14/Translate | src/translate.php | Translate.CheckEncoding | static function CheckEncoding($text,$charset,$disallowed_char_sequencies = array()){
if(is_array($text)){
foreach($text as $_key => $_value){
$_stat_key = self::CheckEncoding($_key,$charset,$disallowed_char_sequencies);
$_stat_value = self::CheckEncoding($_value,$charset,$disallowed_char_sequencies);
... | php | static function CheckEncoding($text,$charset,$disallowed_char_sequencies = array()){
if(is_array($text)){
foreach($text as $_key => $_value){
$_stat_key = self::CheckEncoding($_key,$charset,$disallowed_char_sequencies);
$_stat_value = self::CheckEncoding($_value,$charset,$disallowed_char_sequencies);
... | [
"static",
"function",
"CheckEncoding",
"(",
"$",
"text",
",",
"$",
"charset",
",",
"$",
"disallowed_char_sequencies",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"text",
")",
")",
"{",
"foreach",
"(",
"$",
"text",
"as",
"$",
"_... | Checks if input string is in given charset.
Method can distinguish some characters (or even whole sequencies) that can not appear in the string.
When they appear method returns false
```
self::CheckEncoding($text, "utf-8", array(".",";","{","}","HUSAK"));
```
@param string|array $text string or array of strings
@par... | [
"Checks",
"if",
"input",
"string",
"is",
"in",
"given",
"charset",
"."
] | 9aeddfe5a6120666eb167a5634dcd0606d856584 | https://github.com/atk14/Translate/blob/9aeddfe5a6120666eb167a5634dcd0606d856584/src/translate.php#L620-L655 |
193,795 | atk14/Translate | src/translate.php | Translate.Length | static function Length(&$text,$charset){
$charset = self::_GetCharsetByName($charset);
switch($charset){
case "utf8":
return self::_LengthUtf8($text);
default:
return strlen($text);
}
} | php | static function Length(&$text,$charset){
$charset = self::_GetCharsetByName($charset);
switch($charset){
case "utf8":
return self::_LengthUtf8($text);
default:
return strlen($text);
}
} | [
"static",
"function",
"Length",
"(",
"&",
"$",
"text",
",",
"$",
"charset",
")",
"{",
"$",
"charset",
"=",
"self",
"::",
"_GetCharsetByName",
"(",
"$",
"charset",
")",
";",
"switch",
"(",
"$",
"charset",
")",
"{",
"case",
"\"utf8\"",
":",
"return",
"... | Counts length of a string.
@param string $text
@param string $charset
@return integer | [
"Counts",
"length",
"of",
"a",
"string",
"."
] | 9aeddfe5a6120666eb167a5634dcd0606d856584 | https://github.com/atk14/Translate/blob/9aeddfe5a6120666eb167a5634dcd0606d856584/src/translate.php#L742-L750 |
193,796 | Stillat/Common | src/Stillat/Common/Collections/Sorting/Drivers/QuickSorter.php | QuickSorter.asc | public function asc(array $collection)
{
$count = count($collection);
if ($count < 2) {
return $collection;
}
$leftCollection = array();
$rightCollection = array();
reset($collection);
$sortPivot = key($collection);
$pivot = array_shift... | php | public function asc(array $collection)
{
$count = count($collection);
if ($count < 2) {
return $collection;
}
$leftCollection = array();
$rightCollection = array();
reset($collection);
$sortPivot = key($collection);
$pivot = array_shift... | [
"public",
"function",
"asc",
"(",
"array",
"$",
"collection",
")",
"{",
"$",
"count",
"=",
"count",
"(",
"$",
"collection",
")",
";",
"if",
"(",
"$",
"count",
"<",
"2",
")",
"{",
"return",
"$",
"collection",
";",
"}",
"$",
"leftCollection",
"=",
"a... | Sorts the given array using a quick sort algorithm.
@param array $collection
@return array | [
"Sorts",
"the",
"given",
"array",
"using",
"a",
"quick",
"sort",
"algorithm",
"."
] | 9f69105292740c307aece588cf58a85892bad350 | https://github.com/Stillat/Common/blob/9f69105292740c307aece588cf58a85892bad350/src/Stillat/Common/Collections/Sorting/Drivers/QuickSorter.php#L15-L42 |
193,797 | Stillat/Common | src/Stillat/Common/Collections/Sorting/Drivers/QuickSorter.php | QuickSorter.desc | public function desc(array $collection)
{
$this->changeDirection(false);
$collection = $this->asc($collection);
$this->changeDirection(true);
return $collection;
} | php | public function desc(array $collection)
{
$this->changeDirection(false);
$collection = $this->asc($collection);
$this->changeDirection(true);
return $collection;
} | [
"public",
"function",
"desc",
"(",
"array",
"$",
"collection",
")",
"{",
"$",
"this",
"->",
"changeDirection",
"(",
"false",
")",
";",
"$",
"collection",
"=",
"$",
"this",
"->",
"asc",
"(",
"$",
"collection",
")",
";",
"$",
"this",
"->",
"changeDirecti... | Inversely sorts the given array using a quick sort algorithm
@param array $collection
@return array | [
"Inversely",
"sorts",
"the",
"given",
"array",
"using",
"a",
"quick",
"sort",
"algorithm"
] | 9f69105292740c307aece588cf58a85892bad350 | https://github.com/Stillat/Common/blob/9f69105292740c307aece588cf58a85892bad350/src/Stillat/Common/Collections/Sorting/Drivers/QuickSorter.php#L51-L57 |
193,798 | Kris-Kuiper/sFire-Framework | src/MVC/NamespaceTrait.php | NamespaceTrait.getNamespace | private function getNamespace($class, $source, $destination) {
if(false === is_object($class)) {
return trigger_error(sprintf('Argument 1 passed to %s() must be of the type object, "%s" given', __METHOD__, gettype($class)), E_USER_ERROR);
}
if(false === is_array($source)) {
return trigger_error(spr... | php | private function getNamespace($class, $source, $destination) {
if(false === is_object($class)) {
return trigger_error(sprintf('Argument 1 passed to %s() must be of the type object, "%s" given', __METHOD__, gettype($class)), E_USER_ERROR);
}
if(false === is_array($source)) {
return trigger_error(spr... | [
"private",
"function",
"getNamespace",
"(",
"$",
"class",
",",
"$",
"source",
",",
"$",
"destination",
")",
"{",
"if",
"(",
"false",
"===",
"is_object",
"(",
"$",
"class",
")",
")",
"{",
"return",
"trigger_error",
"(",
"sprintf",
"(",
"'Argument 1 passed t... | Returns the path of a giving namespace
@param object $class
@param array $source
@param array $destination
@return string | [
"Returns",
"the",
"path",
"of",
"a",
"giving",
"namespace"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/MVC/NamespaceTrait.php#L24-L45 |
193,799 | schnittstabil/get | src/Get.php | Get.normalizePath | public static function normalizePath($path)
{
if (is_string($path)) {
return explode('.', $path);
}
if (!is_array($path)) {
return [$path];
}
return $path;
} | php | public static function normalizePath($path)
{
if (is_string($path)) {
return explode('.', $path);
}
if (!is_array($path)) {
return [$path];
}
return $path;
} | [
"public",
"static",
"function",
"normalizePath",
"(",
"$",
"path",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"path",
")",
")",
"{",
"return",
"explode",
"(",
"'.'",
",",
"$",
"path",
")",
";",
"}",
"if",
"(",
"!",
"is_array",
"(",
"$",
"path",
... | Normalize property paths.
@param string|int|mixed[] $path the path
@return mixed[] the normalized path | [
"Normalize",
"property",
"paths",
"."
] | 3922411df8085412defa1e721d6b416b6c2b047c | https://github.com/schnittstabil/get/blob/3922411df8085412defa1e721d6b416b6c2b047c/src/Get.php#L17-L28 |
Subsets and Splits
Yii Code Samples
Gathers all records from test, train, and validation sets that contain the word 'yii', providing a basic filtered view of the dataset relevant to Yii-related content.