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,300
MichaelRShelton/attribute-translator
src/AttributeTranslator.php
AttributeTranslator.offsetUnset
public function offsetUnset($offset) { unset($this->map[$offset]); $this->origin = $this->map->keys(); return $this; }
php
public function offsetUnset($offset) { unset($this->map[$offset]); $this->origin = $this->map->keys(); return $this; }
[ "public", "function", "offsetUnset", "(", "$", "offset", ")", "{", "unset", "(", "$", "this", "->", "map", "[", "$", "offset", "]", ")", ";", "$", "this", "->", "origin", "=", "$", "this", "->", "map", "->", "keys", "(", ")", ";", "return", "$", ...
ArrayAccess. Deletes the given key offset. @param $offset @return $this;
[ "ArrayAccess", ".", "Deletes", "the", "given", "key", "offset", "." ]
48a0ef01058647eeeeeeb8954f93b479bd713b82
https://github.com/MichaelRShelton/attribute-translator/blob/48a0ef01058647eeeeeeb8954f93b479bd713b82/src/AttributeTranslator.php#L234-L239
193,301
MichaelRShelton/attribute-translator
src/AttributeTranslator.php
AttributeTranslator.castToArray
protected function castToArray(&$subject) { if (is_array($subject) === false) { if (Arr::accessible($subject) === false) { $subject = new Collection($subject); } $subject = $subject instanceof Arrayable ? $subject->toArray() : (array)$subject; } ...
php
protected function castToArray(&$subject) { if (is_array($subject) === false) { if (Arr::accessible($subject) === false) { $subject = new Collection($subject); } $subject = $subject instanceof Arrayable ? $subject->toArray() : (array)$subject; } ...
[ "protected", "function", "castToArray", "(", "&", "$", "subject", ")", "{", "if", "(", "is_array", "(", "$", "subject", ")", "===", "false", ")", "{", "if", "(", "Arr", "::", "accessible", "(", "$", "subject", ")", "===", "false", ")", "{", "$", "s...
Because of the enumerable ways non-arrays can act like arrays, we create a Collection, which has useful normalizer functions, and return that as an array. @param mixed $subject @return $this
[ "Because", "of", "the", "enumerable", "ways", "non", "-", "arrays", "can", "act", "like", "arrays", "we", "create", "a", "Collection", "which", "has", "useful", "normalizer", "functions", "and", "return", "that", "as", "an", "array", "." ]
48a0ef01058647eeeeeeb8954f93b479bd713b82
https://github.com/MichaelRShelton/attribute-translator/blob/48a0ef01058647eeeeeeb8954f93b479bd713b82/src/AttributeTranslator.php#L410-L419
193,302
MichaelRShelton/attribute-translator
src/AttributeTranslator.php
AttributeTranslator.defineKeys
protected function defineKeys(&$subject, array $attributes, $value = null) { foreach ($attributes as $attribute) { $subject[$attribute] = $value; } return $this; }
php
protected function defineKeys(&$subject, array $attributes, $value = null) { foreach ($attributes as $attribute) { $subject[$attribute] = $value; } return $this; }
[ "protected", "function", "defineKeys", "(", "&", "$", "subject", ",", "array", "$", "attributes", ",", "$", "value", "=", "null", ")", "{", "foreach", "(", "$", "attributes", "as", "$", "attribute", ")", "{", "$", "subject", "[", "$", "attribute", "]",...
Define the given array of attributes as keys in the given subject. @param array $subject @param array $attributes @param mixed|null $value @return $this
[ "Define", "the", "given", "array", "of", "attributes", "as", "keys", "in", "the", "given", "subject", "." ]
48a0ef01058647eeeeeeb8954f93b479bd713b82
https://github.com/MichaelRShelton/attribute-translator/blob/48a0ef01058647eeeeeeb8954f93b479bd713b82/src/AttributeTranslator.php#L429-L435
193,303
MichaelRShelton/attribute-translator
src/AttributeTranslator.php
AttributeTranslator.pushAttributes
protected function pushAttributes(&$subject, array $attributes, bool $unique = true) { foreach ($attributes as $attribute) { if ($unique === false || in_array($attribute, $subject) === false) { $subject[] = $attribute; } } return $this; }
php
protected function pushAttributes(&$subject, array $attributes, bool $unique = true) { foreach ($attributes as $attribute) { if ($unique === false || in_array($attribute, $subject) === false) { $subject[] = $attribute; } } return $this; }
[ "protected", "function", "pushAttributes", "(", "&", "$", "subject", ",", "array", "$", "attributes", ",", "bool", "$", "unique", "=", "true", ")", "{", "foreach", "(", "$", "attributes", "as", "$", "attribute", ")", "{", "if", "(", "$", "unique", "===...
Push the given array of attributes to the given subject. @param array $subject @param array $attributes @param bool $unique @return $this
[ "Push", "the", "given", "array", "of", "attributes", "to", "the", "given", "subject", "." ]
48a0ef01058647eeeeeeb8954f93b479bd713b82
https://github.com/MichaelRShelton/attribute-translator/blob/48a0ef01058647eeeeeeb8954f93b479bd713b82/src/AttributeTranslator.php#L445-L453
193,304
phpffcms/ffcms-core
src/Helper/Crypt.php
Crypt.passwordHash
public static function passwordHash(string $text): ?string { return password_hash($text, self::PASSWORD_CRYPT_ALGO, [ 'cost' => self::PASSWORD_CRYPT_COST ]); }
php
public static function passwordHash(string $text): ?string { return password_hash($text, self::PASSWORD_CRYPT_ALGO, [ 'cost' => self::PASSWORD_CRYPT_COST ]); }
[ "public", "static", "function", "passwordHash", "(", "string", "$", "text", ")", ":", "?", "string", "{", "return", "password_hash", "(", "$", "text", ",", "self", "::", "PASSWORD_CRYPT_ALGO", ",", "[", "'cost'", "=>", "self", "::", "PASSWORD_CRYPT_COST", "]...
Generate password hash using php password_hash with predefined algo @param string $text @return null|string
[ "Generate", "password", "hash", "using", "php", "password_hash", "with", "predefined", "algo" ]
44a309553ef9f115ccfcfd71f2ac6e381c612082
https://github.com/phpffcms/ffcms-core/blob/44a309553ef9f115ccfcfd71f2ac6e381c612082/src/Helper/Crypt.php#L21-L26
193,305
phpffcms/ffcms-core
src/Helper/Crypt.php
Crypt.passwordVerify
public static function passwordVerify(string $password, string $hash): bool { return (Str::length($hash) > 0 && password_verify($password, $hash)); }
php
public static function passwordVerify(string $password, string $hash): bool { return (Str::length($hash) > 0 && password_verify($password, $hash)); }
[ "public", "static", "function", "passwordVerify", "(", "string", "$", "password", ",", "string", "$", "hash", ")", ":", "bool", "{", "return", "(", "Str", "::", "length", "(", "$", "hash", ")", ">", "0", "&&", "password_verify", "(", "$", "password", "...
Verify password to hash equality @param string $password @param string $hash @return bool
[ "Verify", "password", "to", "hash", "equality" ]
44a309553ef9f115ccfcfd71f2ac6e381c612082
https://github.com/phpffcms/ffcms-core/blob/44a309553ef9f115ccfcfd71f2ac6e381c612082/src/Helper/Crypt.php#L34-L37
193,306
phpffcms/ffcms-core
src/Helper/Crypt.php
Crypt.randomString
public static function randomString(int $length): string { try { $rand = bin2hex(random_bytes($length)); // bytes_length = length * 2 $rand = substr($rand, 0, $length); } catch (\Exception $ce) { $rand = Str::randomLatinNumeric($length); } ...
php
public static function randomString(int $length): string { try { $rand = bin2hex(random_bytes($length)); // bytes_length = length * 2 $rand = substr($rand, 0, $length); } catch (\Exception $ce) { $rand = Str::randomLatinNumeric($length); } ...
[ "public", "static", "function", "randomString", "(", "int", "$", "length", ")", ":", "string", "{", "try", "{", "$", "rand", "=", "bin2hex", "(", "random_bytes", "(", "$", "length", ")", ")", ";", "// bytes_length = length * 2", "$", "rand", "=", "substr",...
Generate random string with numbers from secure function random_bytes @param int $length @return string
[ "Generate", "random", "string", "with", "numbers", "from", "secure", "function", "random_bytes" ]
44a309553ef9f115ccfcfd71f2ac6e381c612082
https://github.com/phpffcms/ffcms-core/blob/44a309553ef9f115ccfcfd71f2ac6e381c612082/src/Helper/Crypt.php#L54-L65
193,307
prolic/HumusPHPUnitModule
src/HumusPHPUnitModule/Controller/IndexController.php
IndexController.runAction
public function runAction() { $request = $this->getRequest(); /* @var $request \Zend\Console\Request */ $serviceParameters = array(); foreach ($this->paramsToTest as $params) { foreach ($params as $param) { if ($result = $request->getParam($param)) { ...
php
public function runAction() { $request = $this->getRequest(); /* @var $request \Zend\Console\Request */ $serviceParameters = array(); foreach ($this->paramsToTest as $params) { foreach ($params as $param) { if ($result = $request->getParam($param)) { ...
[ "public", "function", "runAction", "(", ")", "{", "$", "request", "=", "$", "this", "->", "getRequest", "(", ")", ";", "/* @var $request \\Zend\\Console\\Request */", "$", "serviceParameters", "=", "array", "(", ")", ";", "foreach", "(", "$", "this", "->", "...
Runs all tests and sets the exit code @return \Zend\Console\Response|\Zend\Stdlib\ResponseInterface
[ "Runs", "all", "tests", "and", "sets", "the", "exit", "code" ]
ee7c4a01c915a53506c5395e41ec8c26ac4ed7e9
https://github.com/prolic/HumusPHPUnitModule/blob/ee7c4a01c915a53506c5395e41ec8c26ac4ed7e9/src/HumusPHPUnitModule/Controller/IndexController.php#L58-L83
193,308
netbull/CoreBundle
Form/DataTransformer/EntitiesToPropertyTransformer.php
EntitiesToPropertyTransformer.transform
public function transform($entities) { if (is_null($entities) || count($entities) === 0) { return []; } $data = []; $accessor = PropertyAccess::createPropertyAccessor(); foreach ($entities as $entity) { $text = is_null($this->textProperty) ...
php
public function transform($entities) { if (is_null($entities) || count($entities) === 0) { return []; } $data = []; $accessor = PropertyAccess::createPropertyAccessor(); foreach ($entities as $entity) { $text = is_null($this->textProperty) ...
[ "public", "function", "transform", "(", "$", "entities", ")", "{", "if", "(", "is_null", "(", "$", "entities", ")", "||", "count", "(", "$", "entities", ")", "===", "0", ")", "{", "return", "[", "]", ";", "}", "$", "data", "=", "[", "]", ";", "...
Transform initial entities to array @param mixed $entities @return array
[ "Transform", "initial", "entities", "to", "array" ]
0bacc1d9e4733b6da613027400c48421e5a14645
https://github.com/netbull/CoreBundle/blob/0bacc1d9e4733b6da613027400c48421e5a14645/Form/DataTransformer/EntitiesToPropertyTransformer.php#L57-L76
193,309
Weblab-nl/curl
src/Result.php
Result.setHeaders
private function setHeaders($headers) { // Make array of the different headers $headers = explode(PHP_EOL, $headers); foreach ($headers as $header) { // Cut the header into pieces $header = explode(': ', $header); // Skip header if it's not in the default fo...
php
private function setHeaders($headers) { // Make array of the different headers $headers = explode(PHP_EOL, $headers); foreach ($headers as $header) { // Cut the header into pieces $header = explode(': ', $header); // Skip header if it's not in the default fo...
[ "private", "function", "setHeaders", "(", "$", "headers", ")", "{", "// Make array of the different headers", "$", "headers", "=", "explode", "(", "PHP_EOL", ",", "$", "headers", ")", ";", "foreach", "(", "$", "headers", "as", "$", "header", ")", "{", "// Cu...
Parse and store the headers @param string $headers
[ "Parse", "and", "store", "the", "headers" ]
e2879ab970e0d8161d5a49b46805bc36a8ba94a9
https://github.com/Weblab-nl/curl/blob/e2879ab970e0d8161d5a49b46805bc36a8ba94a9/src/Result.php#L52-L79
193,310
agentmedia/phine-core
src/Core/Snippets/BackendRights/ContentRights.php
ContentRights.Save
function Save() { if (!$this->rights) { $this->rights = new BackendContentRights(); } $this->rights->SetCreateIn($this->Value('CreateIn')); $this->rights->SetEdit($this->Value('Edit')); $this->rights->SetMove($this->Value('Move')); $this->rights->S...
php
function Save() { if (!$this->rights) { $this->rights = new BackendContentRights(); } $this->rights->SetCreateIn($this->Value('CreateIn')); $this->rights->SetEdit($this->Value('Edit')); $this->rights->SetMove($this->Value('Move')); $this->rights->S...
[ "function", "Save", "(", ")", "{", "if", "(", "!", "$", "this", "->", "rights", ")", "{", "$", "this", "->", "rights", "=", "new", "BackendContentRights", "(", ")", ";", "}", "$", "this", "->", "rights", "->", "SetCreateIn", "(", "$", "this", "->",...
Saves the content rights
[ "Saves", "the", "content", "rights" ]
38c1be8d03ebffae950d00a96da3c612aff67832
https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Snippets/BackendRights/ContentRights.php#L39-L50
193,311
kambalabs/KmbZendDbInfrastructure
src/KmbZendDbInfrastructure/Proxy/EnvironmentProxy.php
EnvironmentProxy.getAncestorsNames
public function getAncestorsNames() { $names = []; if ($this->hasParent()) { $names = $this->getParent()->getAncestorsNames(); } $names[] = $this->getName(); return $names; }
php
public function getAncestorsNames() { $names = []; if ($this->hasParent()) { $names = $this->getParent()->getAncestorsNames(); } $names[] = $this->getName(); return $names; }
[ "public", "function", "getAncestorsNames", "(", ")", "{", "$", "names", "=", "[", "]", ";", "if", "(", "$", "this", "->", "hasParent", "(", ")", ")", "{", "$", "names", "=", "$", "this", "->", "getParent", "(", ")", "->", "getAncestorsNames", "(", ...
Get all ancestors names. It includes the name of the object itself. @return array
[ "Get", "all", "ancestors", "names", ".", "It", "includes", "the", "name", "of", "the", "object", "itself", "." ]
9bf4df4272d2064965202d0e689f944d56a4c6bb
https://github.com/kambalabs/KmbZendDbInfrastructure/blob/9bf4df4272d2064965202d0e689f944d56a4c6bb/src/KmbZendDbInfrastructure/Proxy/EnvironmentProxy.php#L196-L204
193,312
kambalabs/KmbZendDbInfrastructure
src/KmbZendDbInfrastructure/Proxy/EnvironmentProxy.php
EnvironmentProxy.getDescendants
public function getDescendants() { $descendants = []; if ($this->hasChildren()) { foreach ($this->getChildren() as $child) { $childDescendants = $child->hasChildren() ? $child->getDescendants() : []; $descendants = ArrayUtils::merge($descendants, ArrayUtil...
php
public function getDescendants() { $descendants = []; if ($this->hasChildren()) { foreach ($this->getChildren() as $child) { $childDescendants = $child->hasChildren() ? $child->getDescendants() : []; $descendants = ArrayUtils::merge($descendants, ArrayUtil...
[ "public", "function", "getDescendants", "(", ")", "{", "$", "descendants", "=", "[", "]", ";", "if", "(", "$", "this", "->", "hasChildren", "(", ")", ")", "{", "foreach", "(", "$", "this", "->", "getChildren", "(", ")", "as", "$", "child", ")", "{"...
Get all descendants. @return EnvironmentInterface[]
[ "Get", "all", "descendants", "." ]
9bf4df4272d2064965202d0e689f944d56a4c6bb
https://github.com/kambalabs/KmbZendDbInfrastructure/blob/9bf4df4272d2064965202d0e689f944d56a4c6bb/src/KmbZendDbInfrastructure/Proxy/EnvironmentProxy.php#L263-L273
193,313
kambalabs/KmbZendDbInfrastructure
src/KmbZendDbInfrastructure/Proxy/EnvironmentProxy.php
EnvironmentProxy.getUsers
public function getUsers() { if ($this->users === null) { $this->setUsers($this->userRepository->getAllByEnvironment($this)); } return $this->users; }
php
public function getUsers() { if ($this->users === null) { $this->setUsers($this->userRepository->getAllByEnvironment($this)); } return $this->users; }
[ "public", "function", "getUsers", "(", ")", "{", "if", "(", "$", "this", "->", "users", "===", "null", ")", "{", "$", "this", "->", "setUsers", "(", "$", "this", "->", "userRepository", "->", "getAllByEnvironment", "(", "$", "this", ")", ")", ";", "}...
Get Users. @return UserInterface[]
[ "Get", "Users", "." ]
9bf4df4272d2064965202d0e689f944d56a4c6bb
https://github.com/kambalabs/KmbZendDbInfrastructure/blob/9bf4df4272d2064965202d0e689f944d56a4c6bb/src/KmbZendDbInfrastructure/Proxy/EnvironmentProxy.php#L412-L418
193,314
kambalabs/KmbZendDbInfrastructure
src/KmbZendDbInfrastructure/Proxy/EnvironmentProxy.php
EnvironmentProxy.getCurrentRevision
public function getCurrentRevision() { if ($this->currentRevision === null) { $this->setCurrentRevision($this->revisionRepository->getCurrentByEnvironment($this)); } return $this->currentRevision; }
php
public function getCurrentRevision() { if ($this->currentRevision === null) { $this->setCurrentRevision($this->revisionRepository->getCurrentByEnvironment($this)); } return $this->currentRevision; }
[ "public", "function", "getCurrentRevision", "(", ")", "{", "if", "(", "$", "this", "->", "currentRevision", "===", "null", ")", "{", "$", "this", "->", "setCurrentRevision", "(", "$", "this", "->", "revisionRepository", "->", "getCurrentByEnvironment", "(", "$...
Get CurrentRevision. @return \KmbDomain\Model\RevisionInterface
[ "Get", "CurrentRevision", "." ]
9bf4df4272d2064965202d0e689f944d56a4c6bb
https://github.com/kambalabs/KmbZendDbInfrastructure/blob/9bf4df4272d2064965202d0e689f944d56a4c6bb/src/KmbZendDbInfrastructure/Proxy/EnvironmentProxy.php#L480-L486
193,315
kambalabs/KmbZendDbInfrastructure
src/KmbZendDbInfrastructure/Proxy/EnvironmentProxy.php
EnvironmentProxy.getLastReleasedRevision
public function getLastReleasedRevision() { if ($this->lastReleasedRevision === null) { $this->setLastReleasedRevision($this->revisionRepository->getLastReleasedByEnvironment($this)); } return $this->lastReleasedRevision; }
php
public function getLastReleasedRevision() { if ($this->lastReleasedRevision === null) { $this->setLastReleasedRevision($this->revisionRepository->getLastReleasedByEnvironment($this)); } return $this->lastReleasedRevision; }
[ "public", "function", "getLastReleasedRevision", "(", ")", "{", "if", "(", "$", "this", "->", "lastReleasedRevision", "===", "null", ")", "{", "$", "this", "->", "setLastReleasedRevision", "(", "$", "this", "->", "revisionRepository", "->", "getLastReleasedByEnvir...
Get LastReleasedRevision. @return \KmbDomain\Model\RevisionInterface
[ "Get", "LastReleasedRevision", "." ]
9bf4df4272d2064965202d0e689f944d56a4c6bb
https://github.com/kambalabs/KmbZendDbInfrastructure/blob/9bf4df4272d2064965202d0e689f944d56a4c6bb/src/KmbZendDbInfrastructure/Proxy/EnvironmentProxy.php#L505-L511
193,316
kambalabs/KmbZendDbInfrastructure
src/KmbZendDbInfrastructure/Proxy/EnvironmentProxy.php
EnvironmentProxy.getReleasedRevisions
public function getReleasedRevisions() { if ($this->releasedRevisions === null) { $this->setReleasedRevisions($this->revisionRepository->getAllReleasedByEnvironment($this)); } return $this->releasedRevisions; }
php
public function getReleasedRevisions() { if ($this->releasedRevisions === null) { $this->setReleasedRevisions($this->revisionRepository->getAllReleasedByEnvironment($this)); } return $this->releasedRevisions; }
[ "public", "function", "getReleasedRevisions", "(", ")", "{", "if", "(", "$", "this", "->", "releasedRevisions", "===", "null", ")", "{", "$", "this", "->", "setReleasedRevisions", "(", "$", "this", "->", "revisionRepository", "->", "getAllReleasedByEnvironment", ...
Get ReleasedRevisions. @return \KmbDomain\Model\RevisionInterface[]
[ "Get", "ReleasedRevisions", "." ]
9bf4df4272d2064965202d0e689f944d56a4c6bb
https://github.com/kambalabs/KmbZendDbInfrastructure/blob/9bf4df4272d2064965202d0e689f944d56a4c6bb/src/KmbZendDbInfrastructure/Proxy/EnvironmentProxy.php#L530-L536
193,317
libreworks/caridea-acl
src/CacheStrategy.php
CacheStrategy.load
public function load(Target $target, array $subjects, Service $service): Acl { $key = $this->buildKey($target, $subjects); if (!isset($this->cache[$key])) { $acl = $this->delegate->load($target, $subjects, $service); $this->cache[$key] = $acl; } return $this->...
php
public function load(Target $target, array $subjects, Service $service): Acl { $key = $this->buildKey($target, $subjects); if (!isset($this->cache[$key])) { $acl = $this->delegate->load($target, $subjects, $service); $this->cache[$key] = $acl; } return $this->...
[ "public", "function", "load", "(", "Target", "$", "target", ",", "array", "$", "subjects", ",", "Service", "$", "service", ")", ":", "Acl", "{", "$", "key", "=", "$", "this", "->", "buildKey", "(", "$", "target", ",", "$", "subjects", ")", ";", "if...
Loads the ACL for a Target. @param \Caridea\Acl\Target $target The `Target` whose ACL will be loaded @param \Caridea\Acl\Subject[] $subjects An array of `Subject`s @param \Caridea\Acl\Service $service The ACL service (to load parent ACLs) @return \Caridea\Acl\Acl The loaded ACL @throws \Caridea\Acl\Exception\Unloadabl...
[ "Loads", "the", "ACL", "for", "a", "Target", "." ]
64ff8f2e29926acc67b9fc4a8a9ea7bcc50e4916
https://github.com/libreworks/caridea-acl/blob/64ff8f2e29926acc67b9fc4a8a9ea7bcc50e4916/src/CacheStrategy.php#L60-L68
193,318
libreworks/caridea-acl
src/CacheStrategy.php
CacheStrategy.loadAll
public function loadAll(array $targets, array $subjects, Service $service): array { $acls = []; if ($this->delegate instanceof MultiStrategy) { $oids = array_merge($targets); foreach ($targets as $i => $target) { if (!($target instanceof Target)) { ...
php
public function loadAll(array $targets, array $subjects, Service $service): array { $acls = []; if ($this->delegate instanceof MultiStrategy) { $oids = array_merge($targets); foreach ($targets as $i => $target) { if (!($target instanceof Target)) { ...
[ "public", "function", "loadAll", "(", "array", "$", "targets", ",", "array", "$", "subjects", ",", "Service", "$", "service", ")", ":", "array", "{", "$", "acls", "=", "[", "]", ";", "if", "(", "$", "this", "->", "delegate", "instanceof", "MultiStrateg...
Loads the ACLs for several Targets. @since 2.1.0 @param \Caridea\Acl\Target[] $targets The `Target` whose ACL will be loaded @param \Caridea\Acl\Subject[] $subjects An array of `Subject`s @param \Caridea\Acl\Service $service The ACL service (to load parent ACLs) @return array<string,\Caridea\Acl\Acl> The loaded ACLs @...
[ "Loads", "the", "ACLs", "for", "several", "Targets", "." ]
64ff8f2e29926acc67b9fc4a8a9ea7bcc50e4916
https://github.com/libreworks/caridea-acl/blob/64ff8f2e29926acc67b9fc4a8a9ea7bcc50e4916/src/CacheStrategy.php#L81-L113
193,319
libreworks/caridea-acl
src/CacheStrategy.php
CacheStrategy.buildKey
protected function buildKey(Target $target, array $subjects): string { $key = (string) $target; foreach ($subjects as $subject) { if (!($subject instanceof Subject)) { throw new \InvalidArgumentException("Only instances of Subject are permitted in the subjects argument");...
php
protected function buildKey(Target $target, array $subjects): string { $key = (string) $target; foreach ($subjects as $subject) { if (!($subject instanceof Subject)) { throw new \InvalidArgumentException("Only instances of Subject are permitted in the subjects argument");...
[ "protected", "function", "buildKey", "(", "Target", "$", "target", ",", "array", "$", "subjects", ")", ":", "string", "{", "$", "key", "=", "(", "string", ")", "$", "target", ";", "foreach", "(", "$", "subjects", "as", "$", "subject", ")", "{", "if",...
Generates the key to use for caching the ACL. @param \Caridea\Acl\Target $target The `Target` whose ACL will be loaded @param array $subjects An array of `Subject`s @return string The cache key @throws \InvalidArgumentException If the `subjects` argument contains invalid values
[ "Generates", "the", "key", "to", "use", "for", "caching", "the", "ACL", "." ]
64ff8f2e29926acc67b9fc4a8a9ea7bcc50e4916
https://github.com/libreworks/caridea-acl/blob/64ff8f2e29926acc67b9fc4a8a9ea7bcc50e4916/src/CacheStrategy.php#L123-L133
193,320
nirou8/php-multiple-saml
lib/Saml2/Utils.php
OneLogin_Saml2_Utils.getSelfURL
public static function getSelfURL() { $selfURLhost = self::getSelfURLhost(); $requestURI = ''; if (!empty($_SERVER['REQUEST_URI'])) { $requestURI = $_SERVER['REQUEST_URI']; if ($requestURI[0] !== '/') { if (preg_match('#^https?://[^/]*(/.*)#i', $reque...
php
public static function getSelfURL() { $selfURLhost = self::getSelfURLhost(); $requestURI = ''; if (!empty($_SERVER['REQUEST_URI'])) { $requestURI = $_SERVER['REQUEST_URI']; if ($requestURI[0] !== '/') { if (preg_match('#^https?://[^/]*(/.*)#i', $reque...
[ "public", "static", "function", "getSelfURL", "(", ")", "{", "$", "selfURLhost", "=", "self", "::", "getSelfURLhost", "(", ")", ";", "$", "requestURI", "=", "''", ";", "if", "(", "!", "empty", "(", "$", "_SERVER", "[", "'REQUEST_URI'", "]", ")", ")", ...
Returns the URL of the current host + current view + query. @return string
[ "Returns", "the", "URL", "of", "the", "current", "host", "+", "current", "view", "+", "query", "." ]
7eb5786e678db7d45459ce3441fa187946ae9a3b
https://github.com/nirou8/php-multiple-saml/blob/7eb5786e678db7d45459ce3441fa187946ae9a3b/lib/Saml2/Utils.php#L583-L603
193,321
nirou8/php-multiple-saml
lib/Saml2/Utils.php
OneLogin_Saml2_Utils.castKey
public static function castKey(XMLSecurityKey $key, $algorithm, $type = 'public') { assert('is_string($algorithm)'); assert('$type === "public" || $type === "private"'); // do nothing if algorithm is already the type of the key if ($key->type === $algorithm) { return $key...
php
public static function castKey(XMLSecurityKey $key, $algorithm, $type = 'public') { assert('is_string($algorithm)'); assert('$type === "public" || $type === "private"'); // do nothing if algorithm is already the type of the key if ($key->type === $algorithm) { return $key...
[ "public", "static", "function", "castKey", "(", "XMLSecurityKey", "$", "key", ",", "$", "algorithm", ",", "$", "type", "=", "'public'", ")", "{", "assert", "(", "'is_string($algorithm)'", ")", ";", "assert", "(", "'$type === \"public\" || $type === \"private\"'", ...
Converts a XMLSecurityKey to the correct algorithm. @param XMLSecurityKey $key The key. @param string $algorithm The desired algorithm. @param string $type Public or private key, defaults to public. @return XMLSecurityKey The new key. @throws Exception
[ "Converts", "a", "XMLSecurityKey", "to", "the", "correct", "algorithm", "." ]
7eb5786e678db7d45459ce3441fa187946ae9a3b
https://github.com/nirou8/php-multiple-saml/blob/7eb5786e678db7d45459ce3441fa187946ae9a3b/lib/Saml2/Utils.php#L1183-L1206
193,322
cloudtek/dynamodm
lib/Cloudtek/DynamoDM/Expression/Operand/Operand.php
Operand.equality
protected function equality($comparison, $operand) { return $this->expr->addCondition(new Operator\Equality( $this, $comparison, $this->expr->value($operand) )); }
php
protected function equality($comparison, $operand) { return $this->expr->addCondition(new Operator\Equality( $this, $comparison, $this->expr->value($operand) )); }
[ "protected", "function", "equality", "(", "$", "comparison", ",", "$", "operand", ")", "{", "return", "$", "this", "->", "expr", "->", "addCondition", "(", "new", "Operator", "\\", "Equality", "(", "$", "this", ",", "$", "comparison", ",", "$", "this", ...
Add a comparison to the current expression. @param string $comparison @param Operand|mixed $operand @return QueryBuilder|Expr
[ "Add", "a", "comparison", "to", "the", "current", "expression", "." ]
119d355e2c5cbaef1f867970349b4432f5704fcd
https://github.com/cloudtek/dynamodm/blob/119d355e2c5cbaef1f867970349b4432f5704fcd/lib/Cloudtek/DynamoDM/Expression/Operand/Operand.php#L60-L67
193,323
BinPHP/BinPHP
src/BinSupport.php
BinSupport.labels
public static function labels($q) { $e = explode('.', $q); $r = ''; for ($i = 0, $s = sizeof($e); $i < $s; ++$i) { $r .= chr(strlen($e[$i])) . $e[$i]; } if (static::binarySubstr($r, -1) !== "\x00") { $r .= "\x00"; } return $r; ...
php
public static function labels($q) { $e = explode('.', $q); $r = ''; for ($i = 0, $s = sizeof($e); $i < $s; ++$i) { $r .= chr(strlen($e[$i])) . $e[$i]; } if (static::binarySubstr($r, -1) !== "\x00") { $r .= "\x00"; } return $r; ...
[ "public", "static", "function", "labels", "(", "$", "q", ")", "{", "$", "e", "=", "explode", "(", "'.'", ",", "$", "q", ")", ";", "$", "r", "=", "''", ";", "for", "(", "$", "i", "=", "0", ",", "$", "s", "=", "sizeof", "(", "$", "e", ")", ...
Build structure of labels. @param string $q dot-separated labels list. @return string
[ "Build", "structure", "of", "labels", "." ]
b517eed0c89b3bc3ca3771ae70c2f47aa41a8c8b
https://github.com/BinPHP/BinPHP/blob/b517eed0c89b3bc3ca3771ae70c2f47aa41a8c8b/src/BinSupport.php#L15-L27
193,324
BinPHP/BinPHP
src/BinSupport.php
BinSupport.parseLabels
public static function parseLabels(&$data, $orig = null) { $str = ''; while (strlen($data) > 0) { $l = ord($data[0]); if ($l >= 192) { $pos = static::bytes2int(chr($l - 192) . static::binarySubstr($data, 1, 1)); $data = static::binary...
php
public static function parseLabels(&$data, $orig = null) { $str = ''; while (strlen($data) > 0) { $l = ord($data[0]); if ($l >= 192) { $pos = static::bytes2int(chr($l - 192) . static::binarySubstr($data, 1, 1)); $data = static::binary...
[ "public", "static", "function", "parseLabels", "(", "&", "$", "data", ",", "$", "orig", "=", "null", ")", "{", "$", "str", "=", "''", ";", "while", "(", "strlen", "(", "$", "data", ")", ">", "0", ")", "{", "$", "l", "=", "ord", "(", "$", "dat...
Parse structure of labels. @param string $data @param string $orig @return string Dot-separated labels list.
[ "Parse", "structure", "of", "labels", "." ]
b517eed0c89b3bc3ca3771ae70c2f47aa41a8c8b
https://github.com/BinPHP/BinPHP/blob/b517eed0c89b3bc3ca3771ae70c2f47aa41a8c8b/src/BinSupport.php#L36-L59
193,325
BinPHP/BinPHP
src/BinSupport.php
BinSupport.LV
public static function LV($str, $len = 1, $lrev = false) { $l = static::i2b($len, strlen($str)); if ($lrev) { $l = strrev($l); } return $l . $str; }
php
public static function LV($str, $len = 1, $lrev = false) { $l = static::i2b($len, strlen($str)); if ($lrev) { $l = strrev($l); } return $l . $str; }
[ "public", "static", "function", "LV", "(", "$", "str", ",", "$", "len", "=", "1", ",", "$", "lrev", "=", "false", ")", "{", "$", "l", "=", "static", "::", "i2b", "(", "$", "len", ",", "strlen", "(", "$", "str", ")", ")", ";", "if", "(", "$"...
Build length-value binary snippet. @param string $str Data. @param int $len Number of bytes to encode length, defaults to 1. @return string
[ "Build", "length", "-", "value", "binary", "snippet", "." ]
b517eed0c89b3bc3ca3771ae70c2f47aa41a8c8b
https://github.com/BinPHP/BinPHP/blob/b517eed0c89b3bc3ca3771ae70c2f47aa41a8c8b/src/BinSupport.php#L68-L75
193,326
BinPHP/BinPHP
src/BinSupport.php
BinSupport.getByte
public static function getByte(&$p) { $r = static::bytes2int($p{0}); $p = static::binarySubstr($p, 1); return (int) $r; }
php
public static function getByte(&$p) { $r = static::bytes2int($p{0}); $p = static::binarySubstr($p, 1); return (int) $r; }
[ "public", "static", "function", "getByte", "(", "&", "$", "p", ")", "{", "$", "r", "=", "static", "::", "bytes2int", "(", "$", "p", "{", "0", "}", ")", ";", "$", "p", "=", "static", "::", "binarySubstr", "(", "$", "p", ",", "1", ")", ";", "re...
Parse byte, and remove it. @param &string $p Data @return int
[ "Parse", "byte", "and", "remove", "it", "." ]
b517eed0c89b3bc3ca3771ae70c2f47aa41a8c8b
https://github.com/BinPHP/BinPHP/blob/b517eed0c89b3bc3ca3771ae70c2f47aa41a8c8b/src/BinSupport.php#L171-L177
193,327
BinPHP/BinPHP
src/BinSupport.php
BinSupport.getString
public static function getString(&$str) { $p = strpos($str, "\x00"); if ($p === false) { return ''; } $r = static::binarySubstr($str, 0, $p); $str = static::binarySubstr($str, $p + 1); return $r; }
php
public static function getString(&$str) { $p = strpos($str, "\x00"); if ($p === false) { return ''; } $r = static::binarySubstr($str, 0, $p); $str = static::binarySubstr($str, $p + 1); return $r; }
[ "public", "static", "function", "getString", "(", "&", "$", "str", ")", "{", "$", "p", "=", "strpos", "(", "$", "str", ",", "\"\\x00\"", ")", ";", "if", "(", "$", "p", "===", "false", ")", "{", "return", "''", ";", "}", "$", "r", "=", "static",...
Parse null-terminated string. @param &string $str @return string
[ "Parse", "null", "-", "terminated", "string", "." ]
b517eed0c89b3bc3ca3771ae70c2f47aa41a8c8b
https://github.com/BinPHP/BinPHP/blob/b517eed0c89b3bc3ca3771ae70c2f47aa41a8c8b/src/BinSupport.php#L279-L289
193,328
BinPHP/BinPHP
src/BinSupport.php
BinSupport.getLV
public static function getLV(&$p, $l = 1, $nul = false, $lrev = false) { $s = static::b2i(static::binarySubstr($p, 0, $l), !!$lrev); $p = static::binarySubstr($p, $l); if ($s == 0) { return ''; } $r = ''; if (strlen($p) < $s) { echo("getLV e...
php
public static function getLV(&$p, $l = 1, $nul = false, $lrev = false) { $s = static::b2i(static::binarySubstr($p, 0, $l), !!$lrev); $p = static::binarySubstr($p, $l); if ($s == 0) { return ''; } $r = ''; if (strlen($p) < $s) { echo("getLV e...
[ "public", "static", "function", "getLV", "(", "&", "$", "p", ",", "$", "l", "=", "1", ",", "$", "nul", "=", "false", ",", "$", "lrev", "=", "false", ")", "{", "$", "s", "=", "static", "::", "b2i", "(", "static", "::", "binarySubstr", "(", "$", ...
Parse length-value structure. @param &string $p @param int $l number of length bytes. @param bool $nul Null-terminated, defaults to false. @param bool $lrev Little-endian, default to false. @return string
[ "Parse", "length", "-", "value", "structure", "." ]
b517eed0c89b3bc3ca3771ae70c2f47aa41a8c8b
https://github.com/BinPHP/BinPHP/blob/b517eed0c89b3bc3ca3771ae70c2f47aa41a8c8b/src/BinSupport.php#L300-L333
193,329
BinPHP/BinPHP
src/BinSupport.php
BinSupport.int2bytes
public static function int2bytes($len, $int = 0, $l = false) { $hexstr = dechex($int); if ($len === null) { if (strlen($hexstr) % 2) { $hexstr = "0" . $hexstr; } } else { $hexstr = str_repeat('0', $len * 2 - strlen($hexstr)) . $hexstr; ...
php
public static function int2bytes($len, $int = 0, $l = false) { $hexstr = dechex($int); if ($len === null) { if (strlen($hexstr) % 2) { $hexstr = "0" . $hexstr; } } else { $hexstr = str_repeat('0', $len * 2 - strlen($hexstr)) . $hexstr; ...
[ "public", "static", "function", "int2bytes", "(", "$", "len", ",", "$", "int", "=", "0", ",", "$", "l", "=", "false", ")", "{", "$", "hexstr", "=", "dechex", "(", "$", "int", ")", ";", "if", "(", "$", "len", "===", "null", ")", "{", "if", "("...
Converts integer to binary string. @param int $len @param int $int @param bool $l Little-endian, defaults to false. @return string
[ "Converts", "integer", "to", "binary", "string", "." ]
b517eed0c89b3bc3ca3771ae70c2f47aa41a8c8b
https://github.com/BinPHP/BinPHP/blob/b517eed0c89b3bc3ca3771ae70c2f47aa41a8c8b/src/BinSupport.php#L343-L364
193,330
BinPHP/BinPHP
src/BinSupport.php
BinSupport.bytes2int
public static function bytes2int($str, $l = false) { if ($l) { $str = strrev($str); } $dec = 0; $len = strlen($str); for ($i = 0; $i < $len; ++$i) { $dec += ord(static::binarySubstr($str, $i, 1)) * pow(0x100, $len - $i - 1); } ...
php
public static function bytes2int($str, $l = false) { if ($l) { $str = strrev($str); } $dec = 0; $len = strlen($str); for ($i = 0; $i < $len; ++$i) { $dec += ord(static::binarySubstr($str, $i, 1)) * pow(0x100, $len - $i - 1); } ...
[ "public", "static", "function", "bytes2int", "(", "$", "str", ",", "$", "l", "=", "false", ")", "{", "if", "(", "$", "l", ")", "{", "$", "str", "=", "strrev", "(", "$", "str", ")", ";", "}", "$", "dec", "=", "0", ";", "$", "len", "=", "strl...
Convert bytes into integer. @param string $str @param bool $l little-endian encoding, defaults to false @return int
[ "Convert", "bytes", "into", "integer", "." ]
b517eed0c89b3bc3ca3771ae70c2f47aa41a8c8b
https://github.com/BinPHP/BinPHP/blob/b517eed0c89b3bc3ca3771ae70c2f47aa41a8c8b/src/BinSupport.php#L398-L413
193,331
BinPHP/BinPHP
src/BinSupport.php
BinSupport.bitmap2bytes
public static function bitmap2bytes($bitmap, $checkLen = 0) { $r = ''; $bitmap = str_pad($bitmap, ceil(strlen($bitmap) / 8) * 8, '0', STR_PAD_LEFT); for ($i = 0, $n = strlen($bitmap) / 8; $i < $n; ++$i) { $r .= chr((int) bindec(static::binarySubstr($bitmap, $i * 8, 8)));...
php
public static function bitmap2bytes($bitmap, $checkLen = 0) { $r = ''; $bitmap = str_pad($bitmap, ceil(strlen($bitmap) / 8) * 8, '0', STR_PAD_LEFT); for ($i = 0, $n = strlen($bitmap) / 8; $i < $n; ++$i) { $r .= chr((int) bindec(static::binarySubstr($bitmap, $i * 8, 8)));...
[ "public", "static", "function", "bitmap2bytes", "(", "$", "bitmap", ",", "$", "checkLen", "=", "0", ")", "{", "$", "r", "=", "''", ";", "$", "bitmap", "=", "str_pad", "(", "$", "bitmap", ",", "ceil", "(", "strlen", "(", "$", "bitmap", ")", "/", "...
Convert bitmap into bytes. @param string $bitmap @param int $checkLen @return string @throws Exception
[ "Convert", "bitmap", "into", "bytes", "." ]
b517eed0c89b3bc3ca3771ae70c2f47aa41a8c8b
https://github.com/BinPHP/BinPHP/blob/b517eed0c89b3bc3ca3771ae70c2f47aa41a8c8b/src/BinSupport.php#L431-L445
193,332
BinPHP/BinPHP
src/BinSupport.php
BinSupport.binarySubstr
protected static function binarySubstr($s, $p, $len = null) { if ($len === null) { $ret = substr($s, $p); } else { $ret = substr($s, $p, $len); } if ($ret === false) { $ret = ''; } return $ret; }
php
protected static function binarySubstr($s, $p, $len = null) { if ($len === null) { $ret = substr($s, $p); } else { $ret = substr($s, $p, $len); } if ($ret === false) { $ret = ''; } return $ret; }
[ "protected", "static", "function", "binarySubstr", "(", "$", "s", ",", "$", "p", ",", "$", "len", "=", "null", ")", "{", "if", "(", "$", "len", "===", "null", ")", "{", "$", "ret", "=", "substr", "(", "$", "s", ",", "$", "p", ")", ";", "}", ...
Binary Substring. @param string $s @param string $p @param int|null $len @return string
[ "Binary", "Substring", "." ]
b517eed0c89b3bc3ca3771ae70c2f47aa41a8c8b
https://github.com/BinPHP/BinPHP/blob/b517eed0c89b3bc3ca3771ae70c2f47aa41a8c8b/src/BinSupport.php#L466-L479
193,333
Wedeto/HTTP
src/Response/RedirectRequest.php
RedirectRequest.getHeaders
public function getHeaders() { $h = array(); if (!empty($this->timeout)) $h['Refresh'] = $this->timeout . '; url=' . $this->url; else $h['Location'] = (string)$this->url; return $h; }
php
public function getHeaders() { $h = array(); if (!empty($this->timeout)) $h['Refresh'] = $this->timeout . '; url=' . $this->url; else $h['Location'] = (string)$this->url; return $h; }
[ "public", "function", "getHeaders", "(", ")", "{", "$", "h", "=", "array", "(", ")", ";", "if", "(", "!", "empty", "(", "$", "this", "->", "timeout", ")", ")", "$", "h", "[", "'Refresh'", "]", "=", "$", "this", "->", "timeout", ".", "'; url='", ...
Return the redirection headers
[ "Return", "the", "redirection", "headers" ]
7318eff1b81a3c103c4263466d09b7f3593b70b9
https://github.com/Wedeto/HTTP/blob/7318eff1b81a3c103c4263466d09b7f3593b70b9/src/Response/RedirectRequest.php#L87-L95
193,334
Erebot/Module_Wordlists
src/Wordlists.php
Wordlists.getHelp
public function getHelp( \Erebot\Interfaces\Event\Base\TextMessage $event, \Erebot\Interfaces\TextWrapper $words ) { if ($event instanceof \Erebot\Interfaces\Event\Base\PrivateMessage) { $target = $event->getSource(); $chan = null; } else { $targ...
php
public function getHelp( \Erebot\Interfaces\Event\Base\TextMessage $event, \Erebot\Interfaces\TextWrapper $words ) { if ($event instanceof \Erebot\Interfaces\Event\Base\PrivateMessage) { $target = $event->getSource(); $chan = null; } else { $targ...
[ "public", "function", "getHelp", "(", "\\", "Erebot", "\\", "Interfaces", "\\", "Event", "\\", "Base", "\\", "TextMessage", "$", "event", ",", "\\", "Erebot", "\\", "Interfaces", "\\", "TextWrapper", "$", "words", ")", "{", "if", "(", "$", "event", "inst...
Provides help about this module. \param Erebot::Interfaces::Event::Base::TextMessage $event Some help request. \param Erebot::Interfaces::TextWrapper $words Parameters passed with the request. This is the same as this module's name when help is requested on the module itself (in opposition with help on a specific com...
[ "Provides", "help", "about", "this", "module", "." ]
121d1cc72619ec0be2ddf0f3d6a66bac0a5bd1b7
https://github.com/Erebot/Module_Wordlists/blob/121d1cc72619ec0be2ddf0f3d6a66bac0a5bd1b7/src/Wordlists.php#L77-L96
193,335
Erebot/Module_Wordlists
src/Wordlists.php
Wordlists.getAvailableLists
public function getAvailableLists() { if (self::$cache !== null) { return array_keys(self::$cache); } $lists = array(); foreach (self::$paths as $path) { $files = scandir($path); foreach ($files as $file) { if (substr($file, -7) ==...
php
public function getAvailableLists() { if (self::$cache !== null) { return array_keys(self::$cache); } $lists = array(); foreach (self::$paths as $path) { $files = scandir($path); foreach ($files as $file) { if (substr($file, -7) ==...
[ "public", "function", "getAvailableLists", "(", ")", "{", "if", "(", "self", "::", "$", "cache", "!==", "null", ")", "{", "return", "array_keys", "(", "self", "::", "$", "cache", ")", ";", "}", "$", "lists", "=", "array", "(", ")", ";", "foreach", ...
Returns the names of available lists. \retval list The names of all available lists.
[ "Returns", "the", "names", "of", "available", "lists", "." ]
121d1cc72619ec0be2ddf0f3d6a66bac0a5bd1b7
https://github.com/Erebot/Module_Wordlists/blob/121d1cc72619ec0be2ddf0f3d6a66bac0a5bd1b7/src/Wordlists.php#L104-L134
193,336
Erebot/Module_Wordlists
src/Wordlists.php
Wordlists.filterLists
protected static function filterLists($lists, $policy) { $res = array(); foreach ($lists as $name => $path) { if ((bool) preg_match($policy, $name)) { $res[$name] = $path; } } return $res; }
php
protected static function filterLists($lists, $policy) { $res = array(); foreach ($lists as $name => $path) { if ((bool) preg_match($policy, $name)) { $res[$name] = $path; } } return $res; }
[ "protected", "static", "function", "filterLists", "(", "$", "lists", ",", "$", "policy", ")", "{", "$", "res", "=", "array", "(", ")", ";", "foreach", "(", "$", "lists", "as", "$", "name", "=>", "$", "path", ")", "{", "if", "(", "(", "bool", ")",...
Given a mapping of wordlists' names with their path and a policy, returns the same mapping with only those entries whose name matches the policy. \param array $lists A mapping of wordlists (indexed by their names) to their path. \param string $policy A policy (as a regular expression pattern). \retval array A mappin...
[ "Given", "a", "mapping", "of", "wordlists", "names", "with", "their", "path", "and", "a", "policy", "returns", "the", "same", "mapping", "with", "only", "those", "entries", "whose", "name", "matches", "the", "policy", "." ]
121d1cc72619ec0be2ddf0f3d6a66bac0a5bd1b7
https://github.com/Erebot/Module_Wordlists/blob/121d1cc72619ec0be2ddf0f3d6a66bac0a5bd1b7/src/Wordlists.php#L228-L237
193,337
Erebot/Module_Wordlists
src/Wordlists.php
Wordlists.registerPath
public static function registerPath($path) { $path = realpath($path); if (!in_array($path, self::$paths)) { self::$paths[] = $path; self::$cache = null; } }
php
public static function registerPath($path) { $path = realpath($path); if (!in_array($path, self::$paths)) { self::$paths[] = $path; self::$cache = null; } }
[ "public", "static", "function", "registerPath", "(", "$", "path", ")", "{", "$", "path", "=", "realpath", "(", "$", "path", ")", ";", "if", "(", "!", "in_array", "(", "$", "path", ",", "self", "::", "$", "paths", ")", ")", "{", "self", "::", "$",...
Registers a new path containing wordlists. \param string $path New path to register. \return This method does not return anything.
[ "Registers", "a", "new", "path", "containing", "wordlists", "." ]
121d1cc72619ec0be2ddf0f3d6a66bac0a5bd1b7
https://github.com/Erebot/Module_Wordlists/blob/121d1cc72619ec0be2ddf0f3d6a66bac0a5bd1b7/src/Wordlists.php#L248-L255
193,338
Erebot/Module_Wordlists
src/Wordlists.php
Wordlists.getList
public function getList($list) { if (isset(self::$refs[$list])) { self::$refs[$list]['counter']++; return \Erebot\Module\Wordlists\Proxy( self::$refs[$list]['instance'] ); } $lists = $this->getAvailableLists(); if (!in_array($list,...
php
public function getList($list) { if (isset(self::$refs[$list])) { self::$refs[$list]['counter']++; return \Erebot\Module\Wordlists\Proxy( self::$refs[$list]['instance'] ); } $lists = $this->getAvailableLists(); if (!in_array($list,...
[ "public", "function", "getList", "(", "$", "list", ")", "{", "if", "(", "isset", "(", "self", "::", "$", "refs", "[", "$", "list", "]", ")", ")", "{", "self", "::", "$", "refs", "[", "$", "list", "]", "[", "'counter'", "]", "++", ";", "return",...
Returns a list of words. \param string $list Name of the list to return. \throw Erebot::Module::Wordlists::BadListNameException The given $list is not a valid list name.
[ "Returns", "a", "list", "of", "words", "." ]
121d1cc72619ec0be2ddf0f3d6a66bac0a5bd1b7
https://github.com/Erebot/Module_Wordlists/blob/121d1cc72619ec0be2ddf0f3d6a66bac0a5bd1b7/src/Wordlists.php#L289-L314
193,339
Erebot/Module_Wordlists
src/Wordlists.php
Wordlists.releaseList
public function releaseList(\Erebot\Module\Wordlists\Wordlist $list) { $nameType = \Erebot\Module\Wordlists\Wordlist::METADATA_NAME; $name = $list->getMetadata($nameType); if (!isset(self::$refs[$name])) { throw new \Erebot\NotFoundException('No such list'); } if...
php
public function releaseList(\Erebot\Module\Wordlists\Wordlist $list) { $nameType = \Erebot\Module\Wordlists\Wordlist::METADATA_NAME; $name = $list->getMetadata($nameType); if (!isset(self::$refs[$name])) { throw new \Erebot\NotFoundException('No such list'); } if...
[ "public", "function", "releaseList", "(", "\\", "Erebot", "\\", "Module", "\\", "Wordlists", "\\", "Wordlist", "$", "list", ")", "{", "$", "nameType", "=", "\\", "Erebot", "\\", "Module", "\\", "Wordlists", "\\", "Wordlist", "::", "METADATA_NAME", ";", "$"...
Releases a wordlist. This decreases the reference counter associated with the list and removes it from the cache entirely when the counter reaches zero. \param Erebot::Module::Wordlists::Wordlist $list Wordlist to release.
[ "Releases", "a", "wordlist", "." ]
121d1cc72619ec0be2ddf0f3d6a66bac0a5bd1b7
https://github.com/Erebot/Module_Wordlists/blob/121d1cc72619ec0be2ddf0f3d6a66bac0a5bd1b7/src/Wordlists.php#L326-L337
193,340
TuumPHP/FileMap
src/Handler/Emitter.php
Emitter.handle
public function handle($file) { if (!$mime = $this->getMimeForEmit($file->getExtension())) { return $file; } if (!$file_loc = $file->getLocation()) { return $file; } $file->setMime($mime); $file->setFound(); $fp = fopen($file_loc, 'r'...
php
public function handle($file) { if (!$mime = $this->getMimeForEmit($file->getExtension())) { return $file; } if (!$file_loc = $file->getLocation()) { return $file; } $file->setMime($mime); $file->setFound(); $fp = fopen($file_loc, 'r'...
[ "public", "function", "handle", "(", "$", "file", ")", "{", "if", "(", "!", "$", "mime", "=", "$", "this", "->", "getMimeForEmit", "(", "$", "file", "->", "getExtension", "(", ")", ")", ")", "{", "return", "$", "file", ";", "}", "if", "(", "!", ...
handles a file with proper extension such as gif, js, etc. @param FileInfo $file @return FileInfo
[ "handles", "a", "file", "with", "proper", "extension", "such", "as", "gif", "js", "etc", "." ]
4371d4db6cd48bb8fe38f83ef6bd186b346e6427
https://github.com/TuumPHP/FileMap/blob/4371d4db6cd48bb8fe38f83ef6bd186b346e6427/src/Handler/Emitter.php#L77-L91
193,341
joegreen88/zf1-component-validate
src/Zend/Validate/File/MimeType.php
Zend_Validate_File_MimeType.addMimeType
public function addMimeType($mimetype) { $mimetypes = $this->getMimeType(true); if (is_string($mimetype)) { $mimetype = explode(',', $mimetype); } elseif (!is_array($mimetype)) { throw new Zend_Validate_Exception("Invalid options to validator provided"); } ...
php
public function addMimeType($mimetype) { $mimetypes = $this->getMimeType(true); if (is_string($mimetype)) { $mimetype = explode(',', $mimetype); } elseif (!is_array($mimetype)) { throw new Zend_Validate_Exception("Invalid options to validator provided"); } ...
[ "public", "function", "addMimeType", "(", "$", "mimetype", ")", "{", "$", "mimetypes", "=", "$", "this", "->", "getMimeType", "(", "true", ")", ";", "if", "(", "is_string", "(", "$", "mimetype", ")", ")", "{", "$", "mimetype", "=", "explode", "(", "'...
Adds the mimetypes @param string|array $mimetype The mimetypes to add for validation @return Zend_Validate_File_Extension Provides a fluent interface
[ "Adds", "the", "mimetypes" ]
88d9ea016f73d48ff0ba7d06ecbbf28951fd279e
https://github.com/joegreen88/zf1-component-validate/blob/88d9ea016f73d48ff0ba7d06ecbbf28951fd279e/src/Zend/Validate/File/MimeType.php#L311-L344
193,342
ManifestWebDesign/dabl-stringformat
src/StringFormat.php
StringFormat.titleCase
static function titleCase($string, $delimiter = '') { return implode($delimiter, array_map('ucfirst', self::getWords($string, true))); }
php
static function titleCase($string, $delimiter = '') { return implode($delimiter, array_map('ucfirst', self::getWords($string, true))); }
[ "static", "function", "titleCase", "(", "$", "string", ",", "$", "delimiter", "=", "''", ")", "{", "return", "implode", "(", "$", "delimiter", ",", "array_map", "(", "'ucfirst'", ",", "self", "::", "getWords", "(", "$", "string", ",", "true", ")", ")",...
Converts a given string to title case @param string $string @return string
[ "Converts", "a", "given", "string", "to", "title", "case" ]
e24535a4732abe888324b65c8b2726b211fb9bf8
https://github.com/ManifestWebDesign/dabl-stringformat/blob/e24535a4732abe888324b65c8b2726b211fb9bf8/src/StringFormat.php#L115-L117
193,343
ManifestWebDesign/dabl-stringformat
src/StringFormat.php
StringFormat.getWords
static function getWords($string, $lowercase = false) { $string = self::clean($string, ' '); // before an upper and a lower. FBar -> F Bar $string = preg_replace('/(.)([A-Z])([a-z])/', '$1 $2$3', $string); // between a lower and an upper. fooB -> foo B $string = preg_replace('/([a-z])([A-Z])/', '$1 $2', $s...
php
static function getWords($string, $lowercase = false) { $string = self::clean($string, ' '); // before an upper and a lower. FBar -> F Bar $string = preg_replace('/(.)([A-Z])([a-z])/', '$1 $2$3', $string); // between a lower and an upper. fooB -> foo B $string = preg_replace('/([a-z])([A-Z])/', '$1 $2', $s...
[ "static", "function", "getWords", "(", "$", "string", ",", "$", "lowercase", "=", "false", ")", "{", "$", "string", "=", "self", "::", "clean", "(", "$", "string", ",", "' '", ")", ";", "// before an upper and a lower. FBar -> F Bar", "$", "string", "=", "...
Returns array of the words in a string @param string $string @return array
[ "Returns", "array", "of", "the", "words", "in", "a", "string" ]
e24535a4732abe888324b65c8b2726b211fb9bf8
https://github.com/ManifestWebDesign/dabl-stringformat/blob/e24535a4732abe888324b65c8b2726b211fb9bf8/src/StringFormat.php#L124-L146
193,344
ManifestWebDesign/dabl-stringformat
src/StringFormat.php
StringFormat.plural
static function plural($string) { $plural = array( array('/(quiz)$/i', "$1zes"), array('/^(ox)$/i', "$1en"), array('/([m|l])ouse$/i', "$1ice"), array('/(matr|vert|ind)ix|ex$/i', "$1ices"), array('/(x|ch|ss|sh)$/i', "$1es"), array('/([^aeiouy]|qu)y$/i', "$1ies"), array('/([^aeiouy]|qu)ies$/i', "$1...
php
static function plural($string) { $plural = array( array('/(quiz)$/i', "$1zes"), array('/^(ox)$/i', "$1en"), array('/([m|l])ouse$/i', "$1ice"), array('/(matr|vert|ind)ix|ex$/i', "$1ices"), array('/(x|ch|ss|sh)$/i', "$1es"), array('/([^aeiouy]|qu)y$/i', "$1ies"), array('/([^aeiouy]|qu)ies$/i', "$1...
[ "static", "function", "plural", "(", "$", "string", ")", "{", "$", "plural", "=", "array", "(", "array", "(", "'/(quiz)$/i'", ",", "\"$1zes\"", ")", ",", "array", "(", "'/^(ox)$/i'", ",", "\"$1en\"", ")", ",", "array", "(", "'/([m|l])ouse$/i'", ",", "\"$...
Returns the plural version of the given word. If the plural version is the same, then this method will simply add an 's' to the end of the word. @param string $string @return string
[ "Returns", "the", "plural", "version", "of", "the", "given", "word", ".", "If", "the", "plural", "version", "is", "the", "same", "then", "this", "method", "will", "simply", "add", "an", "s", "to", "the", "end", "of", "the", "word", "." ]
e24535a4732abe888324b65c8b2726b211fb9bf8
https://github.com/ManifestWebDesign/dabl-stringformat/blob/e24535a4732abe888324b65c8b2726b211fb9bf8/src/StringFormat.php#L155-L191
193,345
TuumPHP/FileMap
src/Handler/Renderer.php
Renderer.handle
public function handle($file) { foreach ($this->view_extensions as $ext => $handler) { if ($file->exists($ext)) { $file = $file->withExtension($ext); $file->setMime($handler[1]); $file->setFound(); $handle = $handler[0]; ...
php
public function handle($file) { foreach ($this->view_extensions as $ext => $handler) { if ($file->exists($ext)) { $file = $file->withExtension($ext); $file->setMime($handler[1]); $file->setFound(); $handle = $handler[0]; ...
[ "public", "function", "handle", "(", "$", "file", ")", "{", "foreach", "(", "$", "this", "->", "view_extensions", "as", "$", "ext", "=>", "$", "handler", ")", "{", "if", "(", "$", "file", "->", "exists", "(", "$", "ext", ")", ")", "{", "$", "file...
handles text type file, such as html, php, text, and md. @param FileInfo $file @return FileInfo
[ "handles", "text", "type", "file", "such", "as", "html", "php", "text", "and", "md", "." ]
4371d4db6cd48bb8fe38f83ef6bd186b346e6427
https://github.com/TuumPHP/FileMap/blob/4371d4db6cd48bb8fe38f83ef6bd186b346e6427/src/Handler/Renderer.php#L64-L80
193,346
TuumPHP/FileMap
src/Handler/Renderer.php
Renderer.dummy
protected function dummy() { $this->evaluatePhp(null); $this->markToHtml(null); $this->textToPre(null); }
php
protected function dummy() { $this->evaluatePhp(null); $this->markToHtml(null); $this->textToPre(null); }
[ "protected", "function", "dummy", "(", ")", "{", "$", "this", "->", "evaluatePhp", "(", "null", ")", ";", "$", "this", "->", "markToHtml", "(", "null", ")", ";", "$", "this", "->", "textToPre", "(", "null", ")", ";", "}" ]
dummy method to call private methods which are judged as unused methods. @codeCoverageIgnore
[ "dummy", "method", "to", "call", "private", "methods", "which", "are", "judged", "as", "unused", "methods", "." ]
4371d4db6cd48bb8fe38f83ef6bd186b346e6427
https://github.com/TuumPHP/FileMap/blob/4371d4db6cd48bb8fe38f83ef6bd186b346e6427/src/Handler/Renderer.php#L128-L133
193,347
nathan818fr/phpuc-io-streams
src/ByteArrayOutputStream.php
ByteArrayOutputStream.size
public function size() : int { if ($this->bufSize == null) { $this->bufSize = strlen($this->buf); } return $this->bufSize; }
php
public function size() : int { if ($this->bufSize == null) { $this->bufSize = strlen($this->buf); } return $this->bufSize; }
[ "public", "function", "size", "(", ")", ":", "int", "{", "if", "(", "$", "this", "->", "bufSize", "==", "null", ")", "{", "$", "this", "->", "bufSize", "=", "strlen", "(", "$", "this", "->", "buf", ")", ";", "}", "return", "$", "this", "->", "b...
Returns the current size of the buffer. @return int the current size of the buffer
[ "Returns", "the", "current", "size", "of", "the", "buffer", "." ]
8f748c1b3338b50e7c6e25a2f2ee73699cadb0ba
https://github.com/nathan818fr/phpuc-io-streams/blob/8f748c1b3338b50e7c6e25a2f2ee73699cadb0ba/src/ByteArrayOutputStream.php#L49-L55
193,348
field-interactive/cito-bundle
Twig/InlineSvgExtension.php
InlineSvgExtension.getInlineSvg
public function getInlineSvg($filename, $params = []) { $fullPath = $this->assetDir.$filename; if (!file_exists($fullPath)) { throw new \Exception(sprintf('Cannot find svg file: "%s"', $fullPath)); } $svgString = file_get_contents($fullPath); $hasAttr = array_k...
php
public function getInlineSvg($filename, $params = []) { $fullPath = $this->assetDir.$filename; if (!file_exists($fullPath)) { throw new \Exception(sprintf('Cannot find svg file: "%s"', $fullPath)); } $svgString = file_get_contents($fullPath); $hasAttr = array_k...
[ "public", "function", "getInlineSvg", "(", "$", "filename", ",", "$", "params", "=", "[", "]", ")", "{", "$", "fullPath", "=", "$", "this", "->", "assetDir", ".", "$", "filename", ";", "if", "(", "!", "file_exists", "(", "$", "fullPath", ")", ")", ...
Get an inline svg. @param string $filename Path to the svg file @param array $params Optional parameters @return string @throws \Exception
[ "Get", "an", "inline", "svg", "." ]
41cab570f960d964916e278c616720b17de258c1
https://github.com/field-interactive/cito-bundle/blob/41cab570f960d964916e278c616720b17de258c1/Twig/InlineSvgExtension.php#L63-L105
193,349
SlabPHP/router
src/Router.php
Router.routeRequest
public function routeRequest(\Slab\Components\SystemInterface $system) { $this->determineSelectedRoute(); if (!empty($this->selectedRoute)) { return $this->selectedRoute; } if (!empty($this->routeNameMap['404'])) { return $this->routeNameMap[...
php
public function routeRequest(\Slab\Components\SystemInterface $system) { $this->determineSelectedRoute(); if (!empty($this->selectedRoute)) { return $this->selectedRoute; } if (!empty($this->routeNameMap['404'])) { return $this->routeNameMap[...
[ "public", "function", "routeRequest", "(", "\\", "Slab", "\\", "Components", "\\", "SystemInterface", "$", "system", ")", "{", "$", "this", "->", "determineSelectedRoute", "(", ")", ";", "if", "(", "!", "empty", "(", "$", "this", "->", "selectedRoute", ")"...
Route the request @param \Slab\Components\SystemInterface $system @return \Slab\Components\Router\RouteInterface
[ "Route", "the", "request" ]
3e95fa07f694c0e2288a9e9a0ca106117f501a6e
https://github.com/SlabPHP/router/blob/3e95fa07f694c0e2288a9e9a0ca106117f501a6e/src/Router.php#L143-L158
193,350
SlabPHP/router
src/Router.php
Router.validateRequestURI
private function validateRequestURI(&$requestURI) { if ($requestURI != '/' && substr($requestURI, -1) == '/') { $url = rtrim($requestURI, '/'); if (php_sapi_name() === 'cli') { exit("Please ensure the URL you typed in does not have a trailing backslash.\n"); ...
php
private function validateRequestURI(&$requestURI) { if ($requestURI != '/' && substr($requestURI, -1) == '/') { $url = rtrim($requestURI, '/'); if (php_sapi_name() === 'cli') { exit("Please ensure the URL you typed in does not have a trailing backslash.\n"); ...
[ "private", "function", "validateRequestURI", "(", "&", "$", "requestURI", ")", "{", "if", "(", "$", "requestURI", "!=", "'/'", "&&", "substr", "(", "$", "requestURI", ",", "-", "1", ")", "==", "'/'", ")", "{", "$", "url", "=", "rtrim", "(", "$", "r...
Make sure the request URI fits how we want it to @param string $requestURI
[ "Make", "sure", "the", "request", "URI", "fits", "how", "we", "want", "it", "to" ]
3e95fa07f694c0e2288a9e9a0ca106117f501a6e
https://github.com/SlabPHP/router/blob/3e95fa07f694c0e2288a9e9a0ca106117f501a6e/src/Router.php#L232-L244
193,351
SlabPHP/router
src/Router.php
Router.getPathInfo
private function getPathInfo() { $requestURI = !empty($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : ''; $this->validateRequestURI($requestURI); if (empty($requestURI)) { return; } $request = $requestURI; $this->fullRequest = $this->currentReques...
php
private function getPathInfo() { $requestURI = !empty($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : ''; $this->validateRequestURI($requestURI); if (empty($requestURI)) { return; } $request = $requestURI; $this->fullRequest = $this->currentReques...
[ "private", "function", "getPathInfo", "(", ")", "{", "$", "requestURI", "=", "!", "empty", "(", "$", "_SERVER", "[", "'REQUEST_URI'", "]", ")", "?", "$", "_SERVER", "[", "'REQUEST_URI'", "]", ":", "''", ";", "$", "this", "->", "validateRequestURI", "(", ...
Gets the path info and parses out the segment structure
[ "Gets", "the", "path", "info", "and", "parses", "out", "the", "segment", "structure" ]
3e95fa07f694c0e2288a9e9a0ca106117f501a6e
https://github.com/SlabPHP/router/blob/3e95fa07f694c0e2288a9e9a0ca106117f501a6e/src/Router.php#L249-L290
193,352
SlabPHP/router
src/Router.php
Router.checkForTrailingSlashRedirect
private function checkForTrailingSlashRedirect() { if (!empty($this->segments) && empty($this->segments[count($this->segments) - 1])) { //Trim off the empty segment array_pop($this->segments); $newUrl = $this->baseHREF . '/' . implode('/', $this->segments); ...
php
private function checkForTrailingSlashRedirect() { if (!empty($this->segments) && empty($this->segments[count($this->segments) - 1])) { //Trim off the empty segment array_pop($this->segments); $newUrl = $this->baseHREF . '/' . implode('/', $this->segments); ...
[ "private", "function", "checkForTrailingSlashRedirect", "(", ")", "{", "if", "(", "!", "empty", "(", "$", "this", "->", "segments", ")", "&&", "empty", "(", "$", "this", "->", "segments", "[", "count", "(", "$", "this", "->", "segments", ")", "-", "1",...
Checks for a trailing slash or something in the url
[ "Checks", "for", "a", "trailing", "slash", "or", "something", "in", "the", "url" ]
3e95fa07f694c0e2288a9e9a0ca106117f501a6e
https://github.com/SlabPHP/router/blob/3e95fa07f694c0e2288a9e9a0ca106117f501a6e/src/Router.php#L295-L306
193,353
SlabPHP/router
src/Router.php
Router.getRoutingTable
public function getRoutingTable() { if ($this->enableCache && !empty($this->cacheInterface)) { return $this->fetchRoutingTableFromCache(); } return $this->fetchRoutingTable(); }
php
public function getRoutingTable() { if ($this->enableCache && !empty($this->cacheInterface)) { return $this->fetchRoutingTableFromCache(); } return $this->fetchRoutingTable(); }
[ "public", "function", "getRoutingTable", "(", ")", "{", "if", "(", "$", "this", "->", "enableCache", "&&", "!", "empty", "(", "$", "this", "->", "cacheInterface", ")", ")", "{", "return", "$", "this", "->", "fetchRoutingTableFromCache", "(", ")", ";", "}...
Get the routing table from cache or otherwise
[ "Get", "the", "routing", "table", "from", "cache", "or", "otherwise" ]
3e95fa07f694c0e2288a9e9a0ca106117f501a6e
https://github.com/SlabPHP/router/blob/3e95fa07f694c0e2288a9e9a0ca106117f501a6e/src/Router.php#L311-L319
193,354
SlabPHP/router
src/Router.php
Router.fetchRoutingTable
private function fetchRoutingTable() { $this->routes = $this->loadRoutingTable(); if (!empty($this->routes)) { $this->traverseRouteListAndBuildMap(); } return $this->routes; }
php
private function fetchRoutingTable() { $this->routes = $this->loadRoutingTable(); if (!empty($this->routes)) { $this->traverseRouteListAndBuildMap(); } return $this->routes; }
[ "private", "function", "fetchRoutingTable", "(", ")", "{", "$", "this", "->", "routes", "=", "$", "this", "->", "loadRoutingTable", "(", ")", ";", "if", "(", "!", "empty", "(", "$", "this", "->", "routes", ")", ")", "{", "$", "this", "->", "traverseR...
Fetch the routing table without caching @return \Slab\Router\Route
[ "Fetch", "the", "routing", "table", "without", "caching" ]
3e95fa07f694c0e2288a9e9a0ca106117f501a6e
https://github.com/SlabPHP/router/blob/3e95fa07f694c0e2288a9e9a0ca106117f501a6e/src/Router.php#L326-L335
193,355
SlabPHP/router
src/Router.php
Router.fetchRoutingTableFromCache
private function fetchRoutingTableFromCache() { $this->routes = $this->cacheInterface->get('Routing_Table'); if (empty($this->routes)) { $this->routes = $this->loadRoutingTable(); } if (!empty($this->routes)) { $this->traverseRouteListAndBuildMap(); ...
php
private function fetchRoutingTableFromCache() { $this->routes = $this->cacheInterface->get('Routing_Table'); if (empty($this->routes)) { $this->routes = $this->loadRoutingTable(); } if (!empty($this->routes)) { $this->traverseRouteListAndBuildMap(); ...
[ "private", "function", "fetchRoutingTableFromCache", "(", ")", "{", "$", "this", "->", "routes", "=", "$", "this", "->", "cacheInterface", "->", "get", "(", "'Routing_Table'", ")", ";", "if", "(", "empty", "(", "$", "this", "->", "routes", ")", ")", "{",...
Fetch the routing table using the default cache provider @return \Slab\Router\Route
[ "Fetch", "the", "routing", "table", "using", "the", "default", "cache", "provider" ]
3e95fa07f694c0e2288a9e9a0ca106117f501a6e
https://github.com/SlabPHP/router/blob/3e95fa07f694c0e2288a9e9a0ca106117f501a6e/src/Router.php#L342-L356
193,356
SlabPHP/router
src/Router.php
Router.traverseRouteListAndBuildMap
private function traverseRouteListAndBuildMap($currentNode = null) { if (empty($currentNode)) { $this->traverseRouteListAndBuildMap($this->routes); return; } if (is_array($currentNode)) { foreach ($currentNode as $node) { $this->traverseRo...
php
private function traverseRouteListAndBuildMap($currentNode = null) { if (empty($currentNode)) { $this->traverseRouteListAndBuildMap($this->routes); return; } if (is_array($currentNode)) { foreach ($currentNode as $node) { $this->traverseRo...
[ "private", "function", "traverseRouteListAndBuildMap", "(", "$", "currentNode", "=", "null", ")", "{", "if", "(", "empty", "(", "$", "currentNode", ")", ")", "{", "$", "this", "->", "traverseRouteListAndBuildMap", "(", "$", "this", "->", "routes", ")", ";", ...
Traverses the list of routes and builds a name -> route map reference list @param Route $currentNode
[ "Traverses", "the", "list", "of", "routes", "and", "builds", "a", "name", "-", ">", "route", "map", "reference", "list" ]
3e95fa07f694c0e2288a9e9a0ca106117f501a6e
https://github.com/SlabPHP/router/blob/3e95fa07f694c0e2288a9e9a0ca106117f501a6e/src/Router.php#L363-L395
193,357
SlabPHP/router
src/Router.php
Router.loadRoutingTable
public function loadRoutingTable() { if (empty($this->routeFiles) || !is_array($this->routeFiles)) { if (!empty($this->log)) { $this->log->error("Missing configuration option routeFiles, or route file list in improper format."); } return false...
php
public function loadRoutingTable() { if (empty($this->routeFiles) || !is_array($this->routeFiles)) { if (!empty($this->log)) { $this->log->error("Missing configuration option routeFiles, or route file list in improper format."); } return false...
[ "public", "function", "loadRoutingTable", "(", ")", "{", "if", "(", "empty", "(", "$", "this", "->", "routeFiles", ")", "||", "!", "is_array", "(", "$", "this", "->", "routeFiles", ")", ")", "{", "if", "(", "!", "empty", "(", "$", "this", "->", "lo...
Load routing table from files
[ "Load", "routing", "table", "from", "files" ]
3e95fa07f694c0e2288a9e9a0ca106117f501a6e
https://github.com/SlabPHP/router/blob/3e95fa07f694c0e2288a9e9a0ca106117f501a6e/src/Router.php#L401-L426
193,358
SlabPHP/router
src/Router.php
Router.loadRouteFile
private function loadRouteFile(&$routeTable, $fileName) { libxml_use_internal_errors(true); $xml = simplexml_load_file($fileName); if (empty($xml)) { $errorMessage = "Failed to parse XML route file: " . $fileName . ""; foreach (libxml_get_errors() as $error) { ...
php
private function loadRouteFile(&$routeTable, $fileName) { libxml_use_internal_errors(true); $xml = simplexml_load_file($fileName); if (empty($xml)) { $errorMessage = "Failed to parse XML route file: " . $fileName . ""; foreach (libxml_get_errors() as $error) { ...
[ "private", "function", "loadRouteFile", "(", "&", "$", "routeTable", ",", "$", "fileName", ")", "{", "libxml_use_internal_errors", "(", "true", ")", ";", "$", "xml", "=", "simplexml_load_file", "(", "$", "fileName", ")", ";", "if", "(", "empty", "(", "$", ...
Load an XML route file from a fully qualified path name @param array $routeTable @param string $fileName
[ "Load", "an", "XML", "route", "file", "from", "a", "fully", "qualified", "path", "name" ]
3e95fa07f694c0e2288a9e9a0ca106117f501a6e
https://github.com/SlabPHP/router/blob/3e95fa07f694c0e2288a9e9a0ca106117f501a6e/src/Router.php#L434-L527
193,359
SlabPHP/router
src/Router.php
Router.determineSelectedRoute
public function determineSelectedRoute() { if (empty($this->routes)) { $this->getRoutingTable(); } if (empty($this->segments)) { $this->segments = array('/'); } $currentLevel = &$this->routes; //$parentSegment = '/'; $index = ...
php
public function determineSelectedRoute() { if (empty($this->routes)) { $this->getRoutingTable(); } if (empty($this->segments)) { $this->segments = array('/'); } $currentLevel = &$this->routes; //$parentSegment = '/'; $index = ...
[ "public", "function", "determineSelectedRoute", "(", ")", "{", "if", "(", "empty", "(", "$", "this", "->", "routes", ")", ")", "{", "$", "this", "->", "getRoutingTable", "(", ")", ";", "}", "if", "(", "empty", "(", "$", "this", "->", "segments", ")",...
Determine the actually selected route from URL params
[ "Determine", "the", "actually", "selected", "route", "from", "URL", "params" ]
3e95fa07f694c0e2288a9e9a0ca106117f501a6e
https://github.com/SlabPHP/router/blob/3e95fa07f694c0e2288a9e9a0ca106117f501a6e/src/Router.php#L532-L624
193,360
SlabPHP/router
src/Router.php
Router.getRouteByName
public function getRouteByName($routeName) { if (!empty($this->routeNameMap[$routeName])) { return $this->routeNameMap[$routeName]; } return null; }
php
public function getRouteByName($routeName) { if (!empty($this->routeNameMap[$routeName])) { return $this->routeNameMap[$routeName]; } return null; }
[ "public", "function", "getRouteByName", "(", "$", "routeName", ")", "{", "if", "(", "!", "empty", "(", "$", "this", "->", "routeNameMap", "[", "$", "routeName", "]", ")", ")", "{", "return", "$", "this", "->", "routeNameMap", "[", "$", "routeName", "]"...
Gets a route by name @param string $routeName @return null|\Slab\Router\Route
[ "Gets", "a", "route", "by", "name" ]
3e95fa07f694c0e2288a9e9a0ca106117f501a6e
https://github.com/SlabPHP/router/blob/3e95fa07f694c0e2288a9e9a0ca106117f501a6e/src/Router.php#L642-L649
193,361
the-eater/odango.php
src/NyaaMeta.php
NyaaMeta.createFromArray
public static function createFromArray($array, $unparsed = []) { $nyaaMeta = new NyaaMeta(); foreach ($array as $key => $value) { $nyaaMeta->set($key, $value); } $nyaaMeta->setUnparsed($unparsed); return $nyaaMeta; }
php
public static function createFromArray($array, $unparsed = []) { $nyaaMeta = new NyaaMeta(); foreach ($array as $key => $value) { $nyaaMeta->set($key, $value); } $nyaaMeta->setUnparsed($unparsed); return $nyaaMeta; }
[ "public", "static", "function", "createFromArray", "(", "$", "array", ",", "$", "unparsed", "=", "[", "]", ")", "{", "$", "nyaaMeta", "=", "new", "NyaaMeta", "(", ")", ";", "foreach", "(", "$", "array", "as", "$", "key", "=>", "$", "value", ")", "{...
Creates a new NyaaMeta instance from array @param array $array array of tags that could be parsed @param array $unparsed The tags that couldn't be parsed @return NyaaMeta
[ "Creates", "a", "new", "NyaaMeta", "instance", "from", "array" ]
6c78f983e7b3c49ff2f8a10ce7299747d3c82e3f
https://github.com/the-eater/odango.php/blob/6c78f983e7b3c49ff2f8a10ce7299747d3c82e3f/src/NyaaMeta.php#L37-L47
193,362
the-eater/odango.php
src/NyaaMeta.php
NyaaMeta.solveIndicator
public static function solveIndicator($data) { $normData = strtolower(trim($data)); foreach (self::$indicators as $key => $tests) { foreach ($tests as $test) { if ($test[0] == '/' && preg_match($test, $normData)) { return [$key, $normData]; } elseif ($normData === $test) { ...
php
public static function solveIndicator($data) { $normData = strtolower(trim($data)); foreach (self::$indicators as $key => $tests) { foreach ($tests as $test) { if ($test[0] == '/' && preg_match($test, $normData)) { return [$key, $normData]; } elseif ($normData === $test) { ...
[ "public", "static", "function", "solveIndicator", "(", "$", "data", ")", "{", "$", "normData", "=", "strtolower", "(", "trim", "(", "$", "data", ")", ")", ";", "foreach", "(", "self", "::", "$", "indicators", "as", "$", "key", "=>", "$", "tests", ")"...
Solves what type of data an indicator is @param string $data The indicator @return array An array with the first item containing what it represents, and second item containing the normalized version of the data, false is returned when failing to find what is indicated
[ "Solves", "what", "type", "of", "data", "an", "indicator", "is" ]
6c78f983e7b3c49ff2f8a10ce7299747d3c82e3f
https://github.com/the-eater/odango.php/blob/6c78f983e7b3c49ff2f8a10ce7299747d3c82e3f/src/NyaaMeta.php#L184-L197
193,363
the-eater/odango.php
src/NyaaMeta.php
NyaaMeta.get
public function get($meta) { return isset($this->parsed[$meta]) ? $this->parsed[$meta] : null; }
php
public function get($meta) { return isset($this->parsed[$meta]) ? $this->parsed[$meta] : null; }
[ "public", "function", "get", "(", "$", "meta", ")", "{", "return", "isset", "(", "$", "this", "->", "parsed", "[", "$", "meta", "]", ")", "?", "$", "this", "->", "parsed", "[", "$", "meta", "]", ":", "null", ";", "}" ]
Gets the meta value by name, null returned if not found @param string $meta @return mixed
[ "Gets", "the", "meta", "value", "by", "name", "null", "returned", "if", "not", "found" ]
6c78f983e7b3c49ff2f8a10ce7299747d3c82e3f
https://github.com/the-eater/odango.php/blob/6c78f983e7b3c49ff2f8a10ce7299747d3c82e3f/src/NyaaMeta.php#L205-L208
193,364
Wedeto/HTML
src/BBCode.php
BBCode.addRule
public function addRule($pattern, $replacement = null) { if (is_object($pattern) && method_exists($pattern, 'toArray')) $pattern = $pattern->toArray(); if (is_object($replacement) && method_exists($replacement, 'toArray')) $replacement = $replacement->toArray(); if (...
php
public function addRule($pattern, $replacement = null) { if (is_object($pattern) && method_exists($pattern, 'toArray')) $pattern = $pattern->toArray(); if (is_object($replacement) && method_exists($replacement, 'toArray')) $replacement = $replacement->toArray(); if (...
[ "public", "function", "addRule", "(", "$", "pattern", ",", "$", "replacement", "=", "null", ")", "{", "if", "(", "is_object", "(", "$", "pattern", ")", "&&", "method_exists", "(", "$", "pattern", ",", "'toArray'", ")", ")", "$", "pattern", "=", "$", ...
Add a rule to the set of rules in this BBCode instance @param $pattern mixed A pattern, an array of patterns or an associative array of pattern => replacement pairs. Patterns should start with /. Strings starting with something else are considered to be strings that should be replaced as-is, without any patterns. @para...
[ "Add", "a", "rule", "to", "the", "set", "of", "rules", "in", "this", "BBCode", "instance" ]
9e725288098c42d0d2953a929faebe628ff4e389
https://github.com/Wedeto/HTML/blob/9e725288098c42d0d2953a929faebe628ff4e389/src/BBCode.php#L88-L143
193,365
Wedeto/HTML
src/BBCode.php
BBCode.apply
public function apply($txt) { if (!is_string($txt)) throw new \RuntimeException("Argument should be a string"); foreach ($this->rules as $pattern => $replacement) { if (is_callable($replacement)) $txt = preg_replace_callback($pattern, $replacement, $t...
php
public function apply($txt) { if (!is_string($txt)) throw new \RuntimeException("Argument should be a string"); foreach ($this->rules as $pattern => $replacement) { if (is_callable($replacement)) $txt = preg_replace_callback($pattern, $replacement, $t...
[ "public", "function", "apply", "(", "$", "txt", ")", "{", "if", "(", "!", "is_string", "(", "$", "txt", ")", ")", "throw", "new", "\\", "RuntimeException", "(", "\"Argument should be a string\"", ")", ";", "foreach", "(", "$", "this", "->", "rules", "as"...
Apply all the configured rules to the provided text and return the result @param $txt string The text to work on @return string The text with the patterns replaced by their replacements
[ "Apply", "all", "the", "configured", "rules", "to", "the", "provided", "text", "and", "return", "the", "result" ]
9e725288098c42d0d2953a929faebe628ff4e389
https://github.com/Wedeto/HTML/blob/9e725288098c42d0d2953a929faebe628ff4e389/src/BBCode.php#L150-L164
193,366
mpf-soft/admin-widgets
datatable/Table.php
Table.renderPage
protected function renderPage($page, $options = array()) { $this->render(__DIR__ . DIRECTORY_SEPARATOR . 'views' . DIRECTORY_SEPARATOR . $page . '.php', $options); }
php
protected function renderPage($page, $options = array()) { $this->render(__DIR__ . DIRECTORY_SEPARATOR . 'views' . DIRECTORY_SEPARATOR . $page . '.php', $options); }
[ "protected", "function", "renderPage", "(", "$", "page", ",", "$", "options", "=", "array", "(", ")", ")", "{", "$", "this", "->", "render", "(", "__DIR__", ".", "DIRECTORY_SEPARATOR", ".", "'views'", ".", "DIRECTORY_SEPARATOR", ".", "$", "page", ".", "'...
Render a selected view. @param string $page @param mixed [string] $options
[ "Render", "a", "selected", "view", "." ]
92597f9a09d086664268d6b7e0111d5a5586d8c7
https://github.com/mpf-soft/admin-widgets/blob/92597f9a09d086664268d6b7e0111d5a5586d8c7/datatable/Table.php#L225-L227
193,367
phossa/phossa-cache
src/Phossa/Cache/Utility/QuickCache.php
QuickCache.flatReference
protected function flatReference(array $reference)/*# : array */ { reset($reference); foreach ($reference as $key => $value) { if (is_object($value)) { $reference[$key] = get_class($value); } elseif (is_array($value)) { $reference[$key] = $this...
php
protected function flatReference(array $reference)/*# : array */ { reset($reference); foreach ($reference as $key => $value) { if (is_object($value)) { $reference[$key] = get_class($value); } elseif (is_array($value)) { $reference[$key] = $this...
[ "protected", "function", "flatReference", "(", "array", "$", "reference", ")", "/*# : array */", "{", "reset", "(", "$", "reference", ")", ";", "foreach", "(", "$", "reference", "as", "$", "key", "=>", "$", "value", ")", "{", "if", "(", "is_object", "(",...
flat the reference array to make it easy for serialize @param array $reference reference data @return array flattered array @access protected
[ "flat", "the", "reference", "array", "to", "make", "it", "easy", "for", "serialize" ]
ad86bee9c5c646fbae09f6f58a346b379d16276e
https://github.com/phossa/phossa-cache/blob/ad86bee9c5c646fbae09f6f58a346b379d16276e/src/Phossa/Cache/Utility/QuickCache.php#L121-L133
193,368
eureka-framework/component-response
src/Response/Header/Header.php
Header.setContent
protected function setContent($content) { $this->content = (string) $content; if (empty($this->content)) { throw new \Exception('Header content is empty !'); } return $this; }
php
protected function setContent($content) { $this->content = (string) $content; if (empty($this->content)) { throw new \Exception('Header content is empty !'); } return $this; }
[ "protected", "function", "setContent", "(", "$", "content", ")", "{", "$", "this", "->", "content", "=", "(", "string", ")", "$", "content", ";", "if", "(", "empty", "(", "$", "this", "->", "content", ")", ")", "{", "throw", "new", "\\", "Exception",...
Set header content @param string $content @return self @throws \Exception
[ "Set", "header", "content" ]
f34aea3a0aa67b88c5e7f8a3b86af29c550fa99a
https://github.com/eureka-framework/component-response/blob/f34aea3a0aa67b88c5e7f8a3b86af29c550fa99a/src/Response/Header/Header.php#L70-L79
193,369
eureka-framework/component-response
src/Response/Header/Header.php
Header.setHttpCode
protected function setHttpCode($httpCode = null) { if ($httpCode !== null) { $this->httpCode = (int) $httpCode; if (!HttpCode::exists($this->httpCode)) { throw new \DomainException('Http Code does not exist! (code: ' . $this->httpCode . ')'); } } ...
php
protected function setHttpCode($httpCode = null) { if ($httpCode !== null) { $this->httpCode = (int) $httpCode; if (!HttpCode::exists($this->httpCode)) { throw new \DomainException('Http Code does not exist! (code: ' . $this->httpCode . ')'); } } ...
[ "protected", "function", "setHttpCode", "(", "$", "httpCode", "=", "null", ")", "{", "if", "(", "$", "httpCode", "!==", "null", ")", "{", "$", "this", "->", "httpCode", "=", "(", "int", ")", "$", "httpCode", ";", "if", "(", "!", "HttpCode", "::", "...
Set http code for the header @param int $httpCode @return self @throws \DomainException
[ "Set", "http", "code", "for", "the", "header" ]
f34aea3a0aa67b88c5e7f8a3b86af29c550fa99a
https://github.com/eureka-framework/component-response/blob/f34aea3a0aa67b88c5e7f8a3b86af29c550fa99a/src/Response/Header/Header.php#L101-L112
193,370
SlabPHP/controllers
src/Resources/Concatenator.php
Concatenator.determineInputFiles
protected function determineInputFiles() { if (empty($this->route->getParameters()->files)) { $this->setNotReady("No input files found.", null, 404); return; } if (is_array($this->route->getParameters()->files)) { foreach ($this->route->ge...
php
protected function determineInputFiles() { if (empty($this->route->getParameters()->files)) { $this->setNotReady("No input files found.", null, 404); return; } if (is_array($this->route->getParameters()->files)) { foreach ($this->route->ge...
[ "protected", "function", "determineInputFiles", "(", ")", "{", "if", "(", "empty", "(", "$", "this", "->", "route", "->", "getParameters", "(", ")", "->", "files", ")", ")", "{", "$", "this", "->", "setNotReady", "(", "\"No input files found.\"", ",", "nul...
Determine input files from the route parameters @throws \Exception
[ "Determine", "input", "files", "from", "the", "route", "parameters" ]
a1c4fded0265100a85904dd664b972a7f8687652
https://github.com/SlabPHP/controllers/blob/a1c4fded0265100a85904dd664b972a7f8687652/src/Resources/Concatenator.php#L50-L69
193,371
SlabPHP/controllers
src/Resources/Concatenator.php
Concatenator.addFileObject
private function addFileObject($file) { $file = $this->getActualFilename($file); try { $this->concatenator->addObject($file, []); } catch (\Exception $e) { $this->system->log()->error("Failed to add concatenator object: " . $file); } ...
php
private function addFileObject($file) { $file = $this->getActualFilename($file); try { $this->concatenator->addObject($file, []); } catch (\Exception $e) { $this->system->log()->error("Failed to add concatenator object: " . $file); } ...
[ "private", "function", "addFileObject", "(", "$", "file", ")", "{", "$", "file", "=", "$", "this", "->", "getActualFilename", "(", "$", "file", ")", ";", "try", "{", "$", "this", "->", "concatenator", "->", "addObject", "(", "$", "file", ",", "[", "]...
Add a file object @param string $file
[ "Add", "a", "file", "object" ]
a1c4fded0265100a85904dd664b972a7f8687652
https://github.com/SlabPHP/controllers/blob/a1c4fded0265100a85904dd664b972a7f8687652/src/Resources/Concatenator.php#L75-L87
193,372
gplcart/cli
controllers/commands/Address.php
Address.cmdGetAddress
public function cmdGetAddress() { $result = $this->getListAddress(); $this->outputFormat($result); $this->outputFormatTableAddress($result); $this->output(); }
php
public function cmdGetAddress() { $result = $this->getListAddress(); $this->outputFormat($result); $this->outputFormatTableAddress($result); $this->output(); }
[ "public", "function", "cmdGetAddress", "(", ")", "{", "$", "result", "=", "$", "this", "->", "getListAddress", "(", ")", ";", "$", "this", "->", "outputFormat", "(", "$", "result", ")", ";", "$", "this", "->", "outputFormatTableAddress", "(", "$", "resul...
Callback for "address-get" command
[ "Callback", "for", "address", "-", "get", "command" ]
e57dba53e291a225b4bff0c0d9b23d685dd1c125
https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/Address.php#L40-L46
193,373
gplcart/cli
controllers/commands/Address.php
Address.cmdUpdateAddress
public function cmdUpdateAddress() { $params = $this->getParam(); if (empty($params[0]) || count($params) < 2) { $this->errorAndExit($this->text('Invalid command')); } if (!is_numeric($params[0])) { $this->errorAndExit($this->text('Invalid argument')); ...
php
public function cmdUpdateAddress() { $params = $this->getParam(); if (empty($params[0]) || count($params) < 2) { $this->errorAndExit($this->text('Invalid command')); } if (!is_numeric($params[0])) { $this->errorAndExit($this->text('Invalid argument')); ...
[ "public", "function", "cmdUpdateAddress", "(", ")", "{", "$", "params", "=", "$", "this", "->", "getParam", "(", ")", ";", "if", "(", "empty", "(", "$", "params", "[", "0", "]", ")", "||", "count", "(", "$", "params", ")", "<", "2", ")", "{", "...
Callback for "address-update" command
[ "Callback", "for", "address", "-", "update", "command" ]
e57dba53e291a225b4bff0c0d9b23d685dd1c125
https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/Address.php#L102-L122
193,374
gplcart/cli
controllers/commands/Address.php
Address.addAddress
protected function addAddress() { if (!$this->isError()) { $id = $this->address->add($this->getSubmitted()); if (empty($id)) { $this->errorAndExit($this->text('Unexpected result')); } $this->line($id); } }
php
protected function addAddress() { if (!$this->isError()) { $id = $this->address->add($this->getSubmitted()); if (empty($id)) { $this->errorAndExit($this->text('Unexpected result')); } $this->line($id); } }
[ "protected", "function", "addAddress", "(", ")", "{", "if", "(", "!", "$", "this", "->", "isError", "(", ")", ")", "{", "$", "id", "=", "$", "this", "->", "address", "->", "add", "(", "$", "this", "->", "getSubmitted", "(", ")", ")", ";", "if", ...
Add a new address
[ "Add", "a", "new", "address" ]
e57dba53e291a225b4bff0c0d9b23d685dd1c125
https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/Address.php#L186-L198
193,375
gplcart/cli
controllers/commands/Address.php
Address.updateAddress
protected function updateAddress($address_id) { if (!$this->isError() && !$this->address->update($address_id, $this->getSubmitted())) { $this->errorAndExit($this->text('Unexpected result')); } }
php
protected function updateAddress($address_id) { if (!$this->isError() && !$this->address->update($address_id, $this->getSubmitted())) { $this->errorAndExit($this->text('Unexpected result')); } }
[ "protected", "function", "updateAddress", "(", "$", "address_id", ")", "{", "if", "(", "!", "$", "this", "->", "isError", "(", ")", "&&", "!", "$", "this", "->", "address", "->", "update", "(", "$", "address_id", ",", "$", "this", "->", "getSubmitted",...
Updates an address @param string $address_id
[ "Updates", "an", "address" ]
e57dba53e291a225b4bff0c0d9b23d685dd1c125
https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/Address.php#L204-L209
193,376
gplcart/cli
controllers/commands/Address.php
Address.submitAddAddress
protected function submitAddAddress() { $this->setSubmitted(null, $this->getParam()); $this->setSubmittedJson('data'); $this->validateComponent('address'); $this->addAddress(); }
php
protected function submitAddAddress() { $this->setSubmitted(null, $this->getParam()); $this->setSubmittedJson('data'); $this->validateComponent('address'); $this->addAddress(); }
[ "protected", "function", "submitAddAddress", "(", ")", "{", "$", "this", "->", "setSubmitted", "(", "null", ",", "$", "this", "->", "getParam", "(", ")", ")", ";", "$", "this", "->", "setSubmittedJson", "(", "'data'", ")", ";", "$", "this", "->", "vali...
Add a new address at once
[ "Add", "a", "new", "address", "at", "once" ]
e57dba53e291a225b4bff0c0d9b23d685dd1c125
https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/Address.php#L214-L220
193,377
gplcart/cli
controllers/commands/Address.php
Address.wizardAddAddress
protected function wizardAddAddress() { $types = $this->address->getTypes(); $this->validateMenu('type', $this->text('Address type'), 'address', array_combine($types, $types), 'shipping'); $this->validatePrompt('user_id', $this->text('User ID'), 'address'); $this->validatePrompt('co...
php
protected function wizardAddAddress() { $types = $this->address->getTypes(); $this->validateMenu('type', $this->text('Address type'), 'address', array_combine($types, $types), 'shipping'); $this->validatePrompt('user_id', $this->text('User ID'), 'address'); $this->validatePrompt('co...
[ "protected", "function", "wizardAddAddress", "(", ")", "{", "$", "types", "=", "$", "this", "->", "address", "->", "getTypes", "(", ")", ";", "$", "this", "->", "validateMenu", "(", "'type'", ",", "$", "this", "->", "text", "(", "'Address type'", ")", ...
Add a new address step by step
[ "Add", "a", "new", "address", "step", "by", "step" ]
e57dba53e291a225b4bff0c0d9b23d685dd1c125
https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/Address.php#L225-L248
193,378
gap-db/OrmCache
GapOrmCache/Drivers/MemcacheDriver.php
MemcacheDriver.remove
public function remove($key){ return ($this->memcache) ? $this->memcache->remove($this->prefix . '_' . $key) : false; }
php
public function remove($key){ return ($this->memcache) ? $this->memcache->remove($this->prefix . '_' . $key) : false; }
[ "public", "function", "remove", "(", "$", "key", ")", "{", "return", "(", "$", "this", "->", "memcache", ")", "?", "$", "this", "->", "memcache", "->", "remove", "(", "$", "this", "->", "prefix", ".", "'_'", ".", "$", "key", ")", ":", "false", ";...
Remove Memcache key @param $key @return bool
[ "Remove", "Memcache", "key" ]
52c50c643b9bb5d4d7bca5edcc78897b60833e59
https://github.com/gap-db/OrmCache/blob/52c50c643b9bb5d4d7bca5edcc78897b60833e59/GapOrmCache/Drivers/MemcacheDriver.php#L60-L62
193,379
itcreator/custom-cmf
Module/Category/src/Cmf/Category/Controller/CategoryController.php
CategoryController.checkRootNode
protected function checkRootNode() { $id = (int)Application::getRequest()->get('id'); $repository = $this->getEntityManager()->getRepository($this->entityName); /** @var $node Category */ if ($node = $repository->find($id)) { return $node->getLevel() > 1; } ...
php
protected function checkRootNode() { $id = (int)Application::getRequest()->get('id'); $repository = $this->getEntityManager()->getRepository($this->entityName); /** @var $node Category */ if ($node = $repository->find($id)) { return $node->getLevel() > 1; } ...
[ "protected", "function", "checkRootNode", "(", ")", "{", "$", "id", "=", "(", "int", ")", "Application", "::", "getRequest", "(", ")", "->", "get", "(", "'id'", ")", ";", "$", "repository", "=", "$", "this", "->", "getEntityManager", "(", ")", "->", ...
If node not root then method return true @return bool
[ "If", "node", "not", "root", "then", "method", "return", "true" ]
42fc0535dfa0f641856f06673f6ab596b2020c40
https://github.com/itcreator/custom-cmf/blob/42fc0535dfa0f641856f06673f6ab596b2020c40/Module/Category/src/Cmf/Category/Controller/CategoryController.php#L45-L56
193,380
net-tools/core
src/Helpers/DataHelper.php
DataHelper.array2Parameters
static function array2Parameters($params, $stringdelim) { $s = ""; foreach ( $params as $p ) { if ( is_int($p) ) $s .= "$p, "; else $s .= $stringdelim . $p . $stringdelim . ", "; } if ( $s ) // remove last ', ' (comma and space) $s = substr($s, 0, -2); return $s; }
php
static function array2Parameters($params, $stringdelim) { $s = ""; foreach ( $params as $p ) { if ( is_int($p) ) $s .= "$p, "; else $s .= $stringdelim . $p . $stringdelim . ", "; } if ( $s ) // remove last ', ' (comma and space) $s = substr($s, 0, -2); return $s; }
[ "static", "function", "array2Parameters", "(", "$", "params", ",", "$", "stringdelim", ")", "{", "$", "s", "=", "\"\"", ";", "foreach", "(", "$", "params", "as", "$", "p", ")", "{", "if", "(", "is_int", "(", "$", "p", ")", ")", "$", "s", ".=", ...
Convert an array to a commas separated string of parameters Srings in array are enclosed with a given delimiter, number are outputed directly @param string[] $params An associative array to convert to a string @param string $stringdelim Delimiters for strings (usually ' or ") @return string Return a string with the a...
[ "Convert", "an", "array", "to", "a", "commas", "separated", "string", "of", "parameters" ]
51446641cee22c0cf53d2b409c76cc8bd1a187e7
https://github.com/net-tools/core/blob/51446641cee22c0cf53d2b409c76cc8bd1a187e7/src/Helpers/DataHelper.php#L76-L93
193,381
net-tools/core
src/Helpers/DataHelper.php
DataHelper.is_associative_array
static function is_associative_array($a, $ifEmptyAssociativeArray = false) { if( !is_array($a) ) return false; if ( count($a) == 0 ) return $ifEmptyAssociativeArray; // firstly, verify that all keys are ints ; if not, the array is associative $keys = array_keys($a);...
php
static function is_associative_array($a, $ifEmptyAssociativeArray = false) { if( !is_array($a) ) return false; if ( count($a) == 0 ) return $ifEmptyAssociativeArray; // firstly, verify that all keys are ints ; if not, the array is associative $keys = array_keys($a);...
[ "static", "function", "is_associative_array", "(", "$", "a", ",", "$", "ifEmptyAssociativeArray", "=", "false", ")", "{", "if", "(", "!", "is_array", "(", "$", "a", ")", ")", "return", "false", ";", "if", "(", "count", "(", "$", "a", ")", "==", "0", ...
Test if a given array is associative or has only numeric keys @param mixed[] $a Array to test @param bool $ifEmptyAssociativeArray If $a is an empty array, we can return true or false, depending on this optionnal parameter @return bool True if array $a is associative, false otherwise
[ "Test", "if", "a", "given", "array", "is", "associative", "or", "has", "only", "numeric", "keys" ]
51446641cee22c0cf53d2b409c76cc8bd1a187e7
https://github.com/net-tools/core/blob/51446641cee22c0cf53d2b409c76cc8bd1a187e7/src/Helpers/DataHelper.php#L140-L155
193,382
net-tools/core
src/Helpers/DataHelper.php
DataHelper.matchAll
static function matchAll($pattern, $buffer, $vars, &$matches) { $tmp = array(); if ( preg_match_all($pattern, $buffer, $tmp, PREG_SET_ORDER) === FALSE ) return false; else { // for all matching substrings for ( $m = 0 ; $m < count($tmp) ; $m++ ) { $res = array(); // for all named captu...
php
static function matchAll($pattern, $buffer, $vars, &$matches) { $tmp = array(); if ( preg_match_all($pattern, $buffer, $tmp, PREG_SET_ORDER) === FALSE ) return false; else { // for all matching substrings for ( $m = 0 ; $m < count($tmp) ; $m++ ) { $res = array(); // for all named captu...
[ "static", "function", "matchAll", "(", "$", "pattern", ",", "$", "buffer", ",", "$", "vars", ",", "&", "$", "matches", ")", "{", "$", "tmp", "=", "array", "(", ")", ";", "if", "(", "preg_match_all", "(", "$", "pattern", ",", "$", "buffer", ",", "...
Convenient function to extract data from a string through a regular expression. We get data in an associative array (instead of numeric indexes for capturing parenthesis). The function set all matching substrings (preg_match_all) in the matches paremeters (passed by reference), so the returned array is in fact an arra...
[ "Convenient", "function", "to", "extract", "data", "from", "a", "string", "through", "a", "regular", "expression", "." ]
51446641cee22c0cf53d2b409c76cc8bd1a187e7
https://github.com/net-tools/core/blob/51446641cee22c0cf53d2b409c76cc8bd1a187e7/src/Helpers/DataHelper.php#L198-L223
193,383
net-tools/core
src/Helpers/DataHelper.php
DataHelper.string2associativeArray
static function string2associativeArray($str, $sep, $sepval, $valIfEmpty = NULL) { $str = explode($sep, $str); $ret = array(); // for each items foreach ( $str as $s ) { // get key and value $s = explode($sepval, $s); if ( count($s) == 2 ) // we should always have 2 items here : the key and the v...
php
static function string2associativeArray($str, $sep, $sepval, $valIfEmpty = NULL) { $str = explode($sep, $str); $ret = array(); // for each items foreach ( $str as $s ) { // get key and value $s = explode($sepval, $s); if ( count($s) == 2 ) // we should always have 2 items here : the key and the v...
[ "static", "function", "string2associativeArray", "(", "$", "str", ",", "$", "sep", ",", "$", "sepval", ",", "$", "valIfEmpty", "=", "NULL", ")", "{", "$", "str", "=", "explode", "(", "$", "sep", ",", "$", "str", ")", ";", "$", "ret", "=", "array", ...
Decode a string to an associative array Useful to decode url parameters to array : e.g. file=my.txt&user=me becomes the array ['file'=>'my.txt','user'=>'me'] @param string $str String to process @param string $sep Separator of values (e.g. '&' in a querystring) @param string $sepval Separator between key and value (e...
[ "Decode", "a", "string", "to", "an", "associative", "array" ]
51446641cee22c0cf53d2b409c76cc8bd1a187e7
https://github.com/net-tools/core/blob/51446641cee22c0cf53d2b409c76cc8bd1a187e7/src/Helpers/DataHelper.php#L237-L252
193,384
net-tools/core
src/Helpers/DataHelper.php
DataHelper.explodeAssociativeArray
static function explodeAssociativeArray($str, $sep = ';', $sepval = '=', $valIfEmpty = NULL) { return self::string2associativeArray($str, $sep, $sepval, $valIfEmpty); }
php
static function explodeAssociativeArray($str, $sep = ';', $sepval = '=', $valIfEmpty = NULL) { return self::string2associativeArray($str, $sep, $sepval, $valIfEmpty); }
[ "static", "function", "explodeAssociativeArray", "(", "$", "str", ",", "$", "sep", "=", "';'", ",", "$", "sepval", "=", "'='", ",", "$", "valIfEmpty", "=", "NULL", ")", "{", "return", "self", "::", "string2associativeArray", "(", "$", "str", ",", "$", ...
Synonymous for string2associativeArray, with default values for separators @param string $str String to process @param string $sep Separator of values (e.g. '&' in a querystring) @param string $sepval Separator between key and value (e.g. '=' in a querystring) @param string $valIfEmpty Default value if value is empty @...
[ "Synonymous", "for", "string2associativeArray", "with", "default", "values", "for", "separators" ]
51446641cee22c0cf53d2b409c76cc8bd1a187e7
https://github.com/net-tools/core/blob/51446641cee22c0cf53d2b409c76cc8bd1a187e7/src/Helpers/DataHelper.php#L263-L266
193,385
ekyna/SettingBundle
DependencyInjection/Configuration.php
Configuration.getPoolsSection
private function getPoolsSection() { $builder = new TreeBuilder(); $node = $builder->root('pools'); $node ->addDefaultsIfNotSet() ->children() ->arrayNode('helper') ->isRequired() ->addDefaultsIfNotSet() ->children() ->variableNode('templates')->defaultValue([ ...
php
private function getPoolsSection() { $builder = new TreeBuilder(); $node = $builder->root('pools'); $node ->addDefaultsIfNotSet() ->children() ->arrayNode('helper') ->isRequired() ->addDefaultsIfNotSet() ->children() ->variableNode('templates')->defaultValue([ ...
[ "private", "function", "getPoolsSection", "(", ")", "{", "$", "builder", "=", "new", "TreeBuilder", "(", ")", ";", "$", "node", "=", "$", "builder", "->", "root", "(", "'pools'", ")", ";", "$", "node", "->", "addDefaultsIfNotSet", "(", ")", "->", "chil...
Returns the pools configuration definition. @return \Symfony\Component\Config\Definition\Builder\NodeDefinition
[ "Returns", "the", "pools", "configuration", "definition", "." ]
df58f83eb3a01ef56cd76ea73639322c581e75c1
https://github.com/ekyna/SettingBundle/blob/df58f83eb3a01ef56cd76ea73639322c581e75c1/DependencyInjection/Configuration.php#L43-L89
193,386
wakerscz/cms-base-module
src/Util/NestedSet.php
NestedSet.getTree
public function getTree(ObjectCollection $objectCollection, int $left = 0, int $right = NULL) : array { $items = []; foreach ($objectCollection as $item) { $items[] = $item; } $tree = $this->generateTree($items, $left, $right); return $tree; }
php
public function getTree(ObjectCollection $objectCollection, int $left = 0, int $right = NULL) : array { $items = []; foreach ($objectCollection as $item) { $items[] = $item; } $tree = $this->generateTree($items, $left, $right); return $tree; }
[ "public", "function", "getTree", "(", "ObjectCollection", "$", "objectCollection", ",", "int", "$", "left", "=", "0", ",", "int", "$", "right", "=", "NULL", ")", ":", "array", "{", "$", "items", "=", "[", "]", ";", "foreach", "(", "$", "objectCollectio...
Metoda pro transformaci nested tree do multilevel pole @param ObjectCollection $objectCollection @param int $left @param int|NULL $right @return array
[ "Metoda", "pro", "transformaci", "nested", "tree", "do", "multilevel", "pole" ]
3a14ea5d6a41999eb5b92fb956b55363806ff872
https://github.com/wakerscz/cms-base-module/blob/3a14ea5d6a41999eb5b92fb956b55363806ff872/src/Util/NestedSet.php#L72-L84
193,387
wakerscz/cms-base-module
src/Util/NestedSet.php
NestedSet.getFlatCollection
public function getFlatCollection(array $tree) : ObjectCollection { $data = []; array_walk_recursive($tree, function ($item) use (&$data) { if ($item !== NULL) { $data[] = $item; } }); return new ObjectCollection($data); ...
php
public function getFlatCollection(array $tree) : ObjectCollection { $data = []; array_walk_recursive($tree, function ($item) use (&$data) { if ($item !== NULL) { $data[] = $item; } }); return new ObjectCollection($data); ...
[ "public", "function", "getFlatCollection", "(", "array", "$", "tree", ")", ":", "ObjectCollection", "{", "$", "data", "=", "[", "]", ";", "array_walk_recursive", "(", "$", "tree", ",", "function", "(", "$", "item", ")", "use", "(", "&", "$", "data", ")...
Metoda pro transformaci multilevel pole do flat ObjectCollection @param array $tree @return ObjectCollection
[ "Metoda", "pro", "transformaci", "multilevel", "pole", "do", "flat", "ObjectCollection" ]
3a14ea5d6a41999eb5b92fb956b55363806ff872
https://github.com/wakerscz/cms-base-module/blob/3a14ea5d6a41999eb5b92fb956b55363806ff872/src/Util/NestedSet.php#L92-L105
193,388
dms-org/common.structure
src/FieldBuilder.php
FieldBuilder.date
public function date(string $format = Date::DISPLAY_FORMAT) : DateFieldBuilder { return new DateFieldBuilder($this->field->type(new DateType($format))); }
php
public function date(string $format = Date::DISPLAY_FORMAT) : DateFieldBuilder { return new DateFieldBuilder($this->field->type(new DateType($format))); }
[ "public", "function", "date", "(", "string", "$", "format", "=", "Date", "::", "DISPLAY_FORMAT", ")", ":", "DateFieldBuilder", "{", "return", "new", "DateFieldBuilder", "(", "$", "this", "->", "field", "->", "type", "(", "new", "DateType", "(", "$", "forma...
Validates the input with the supplied format and converts the input to a Date instance. @see \Dms\Common\Structure\DateTime\Date @param string $format @return DateFieldBuilder
[ "Validates", "the", "input", "with", "the", "supplied", "format", "and", "converts", "the", "input", "to", "a", "Date", "instance", "." ]
23f122182f60df5ec847047a81a39c8aab019ff1
https://github.com/dms-org/common.structure/blob/23f122182f60df5ec847047a81a39c8aab019ff1/src/FieldBuilder.php#L193-L196
193,389
dms-org/common.structure
src/FieldBuilder.php
FieldBuilder.dateTime
public function dateTime(string $format = DateTime::DISPLAY_FORMAT) : DateTimeFieldBuilder { return new DateTimeFieldBuilder($this->field->type(new DateTimeType($format))); }
php
public function dateTime(string $format = DateTime::DISPLAY_FORMAT) : DateTimeFieldBuilder { return new DateTimeFieldBuilder($this->field->type(new DateTimeType($format))); }
[ "public", "function", "dateTime", "(", "string", "$", "format", "=", "DateTime", "::", "DISPLAY_FORMAT", ")", ":", "DateTimeFieldBuilder", "{", "return", "new", "DateTimeFieldBuilder", "(", "$", "this", "->", "field", "->", "type", "(", "new", "DateTimeType", ...
Validates the input with the supplied format and converts the input to a DateTime instance. @see Dms\Common\Structure\DateTime\DateTime @param string $format @return DateTimeFieldBuilder
[ "Validates", "the", "input", "with", "the", "supplied", "format", "and", "converts", "the", "input", "to", "a", "DateTime", "instance", "." ]
23f122182f60df5ec847047a81a39c8aab019ff1
https://github.com/dms-org/common.structure/blob/23f122182f60df5ec847047a81a39c8aab019ff1/src/FieldBuilder.php#L208-L211
193,390
dms-org/common.structure
src/FieldBuilder.php
FieldBuilder.time
public function time(string $format = TimeOfDay::DEFAULT_FORMAT) : TimeOfDayFieldBuilder { return new TimeOfDayFieldBuilder($this->field->type(new TimeOfDayType($format))); }
php
public function time(string $format = TimeOfDay::DEFAULT_FORMAT) : TimeOfDayFieldBuilder { return new TimeOfDayFieldBuilder($this->field->type(new TimeOfDayType($format))); }
[ "public", "function", "time", "(", "string", "$", "format", "=", "TimeOfDay", "::", "DEFAULT_FORMAT", ")", ":", "TimeOfDayFieldBuilder", "{", "return", "new", "TimeOfDayFieldBuilder", "(", "$", "this", "->", "field", "->", "type", "(", "new", "TimeOfDayType", ...
Validates the input with the supplied format and converts the input to a TimeOfDay instance. @see Dms\Common\Structure\DateTime\TimeOfDay @param string $format @return TimeOfDayFieldBuilder
[ "Validates", "the", "input", "with", "the", "supplied", "format", "and", "converts", "the", "input", "to", "a", "TimeOfDay", "instance", "." ]
23f122182f60df5ec847047a81a39c8aab019ff1
https://github.com/dms-org/common.structure/blob/23f122182f60df5ec847047a81a39c8aab019ff1/src/FieldBuilder.php#L223-L226
193,391
dms-org/common.structure
src/FieldBuilder.php
FieldBuilder.dateTimeWithTimezone
public function dateTimeWithTimezone(string $format = TimezonedDateTime::DISPLAY_FORMAT) : TimezonedDateTimeFieldBuilder { return new TimezonedDateTimeFieldBuilder($this->field->type(new TimezonedDateTimeType($format))); }
php
public function dateTimeWithTimezone(string $format = TimezonedDateTime::DISPLAY_FORMAT) : TimezonedDateTimeFieldBuilder { return new TimezonedDateTimeFieldBuilder($this->field->type(new TimezonedDateTimeType($format))); }
[ "public", "function", "dateTimeWithTimezone", "(", "string", "$", "format", "=", "TimezonedDateTime", "::", "DISPLAY_FORMAT", ")", ":", "TimezonedDateTimeFieldBuilder", "{", "return", "new", "TimezonedDateTimeFieldBuilder", "(", "$", "this", "->", "field", "->", "type...
Validates the input with the supplied format and converts the input to a TimezonedDateTime instance. @see Dms\Common\Structure\DateTime\TimezonedDateTime @param string $format @return TimezonedDateTimeFieldBuilder
[ "Validates", "the", "input", "with", "the", "supplied", "format", "and", "converts", "the", "input", "to", "a", "TimezonedDateTime", "instance", "." ]
23f122182f60df5ec847047a81a39c8aab019ff1
https://github.com/dms-org/common.structure/blob/23f122182f60df5ec847047a81a39c8aab019ff1/src/FieldBuilder.php#L238-L241
193,392
dms-org/common.structure
src/FieldBuilder.php
FieldBuilder.dateRange
public function dateRange(string $format = Date::DISPLAY_FORMAT) : FieldBuilderBase { return $this->field->type(new DateRangeType($format)); }
php
public function dateRange(string $format = Date::DISPLAY_FORMAT) : FieldBuilderBase { return $this->field->type(new DateRangeType($format)); }
[ "public", "function", "dateRange", "(", "string", "$", "format", "=", "Date", "::", "DISPLAY_FORMAT", ")", ":", "FieldBuilderBase", "{", "return", "$", "this", "->", "field", "->", "type", "(", "new", "DateRangeType", "(", "$", "format", ")", ")", ";", "...
Validates the input as a date range and converts it to an instance of DateRange. @see \Dms\Common\Structure\DateTime\DateRange @param string $format @return FieldBuilderBase
[ "Validates", "the", "input", "as", "a", "date", "range", "and", "converts", "it", "to", "an", "instance", "of", "DateRange", "." ]
23f122182f60df5ec847047a81a39c8aab019ff1
https://github.com/dms-org/common.structure/blob/23f122182f60df5ec847047a81a39c8aab019ff1/src/FieldBuilder.php#L253-L256
193,393
dms-org/common.structure
src/FieldBuilder.php
FieldBuilder.dateTimeRange
public function dateTimeRange(string $format = DateTime::DISPLAY_FORMAT) : FieldBuilderBase { return $this->field->type(new DateTimeRangeType($format)); }
php
public function dateTimeRange(string $format = DateTime::DISPLAY_FORMAT) : FieldBuilderBase { return $this->field->type(new DateTimeRangeType($format)); }
[ "public", "function", "dateTimeRange", "(", "string", "$", "format", "=", "DateTime", "::", "DISPLAY_FORMAT", ")", ":", "FieldBuilderBase", "{", "return", "$", "this", "->", "field", "->", "type", "(", "new", "DateTimeRangeType", "(", "$", "format", ")", ")"...
Validates the input with the supplied format and converts the input to a DateTimeRange instance. @see Dms\Common\Structure\DateTime\DateTimeRange @param string $format @return FieldBuilderBase
[ "Validates", "the", "input", "with", "the", "supplied", "format", "and", "converts", "the", "input", "to", "a", "DateTimeRange", "instance", "." ]
23f122182f60df5ec847047a81a39c8aab019ff1
https://github.com/dms-org/common.structure/blob/23f122182f60df5ec847047a81a39c8aab019ff1/src/FieldBuilder.php#L268-L271
193,394
dms-org/common.structure
src/FieldBuilder.php
FieldBuilder.timeRange
public function timeRange(string $format = TimeOfDay::DEFAULT_FORMAT) : FieldBuilderBase { return $this->field->type(new TimeRangeType($format)); }
php
public function timeRange(string $format = TimeOfDay::DEFAULT_FORMAT) : FieldBuilderBase { return $this->field->type(new TimeRangeType($format)); }
[ "public", "function", "timeRange", "(", "string", "$", "format", "=", "TimeOfDay", "::", "DEFAULT_FORMAT", ")", ":", "FieldBuilderBase", "{", "return", "$", "this", "->", "field", "->", "type", "(", "new", "TimeRangeType", "(", "$", "format", ")", ")", ";"...
Validates the input with the supplied format and converts the input to a TimeRange instance. @see Dms\Common\Structure\DateTime\TimeRange @param string $format @return FieldBuilderBase
[ "Validates", "the", "input", "with", "the", "supplied", "format", "and", "converts", "the", "input", "to", "a", "TimeRange", "instance", "." ]
23f122182f60df5ec847047a81a39c8aab019ff1
https://github.com/dms-org/common.structure/blob/23f122182f60df5ec847047a81a39c8aab019ff1/src/FieldBuilder.php#L283-L286
193,395
dms-org/common.structure
src/FieldBuilder.php
FieldBuilder.dateTimeWithTimezoneRange
public function dateTimeWithTimezoneRange(string $format = TimezonedDateTime::DISPLAY_FORMAT) : FieldBuilderBase { return $this->field->type(new TimezonedDateTimeRangeType($format)); }
php
public function dateTimeWithTimezoneRange(string $format = TimezonedDateTime::DISPLAY_FORMAT) : FieldBuilderBase { return $this->field->type(new TimezonedDateTimeRangeType($format)); }
[ "public", "function", "dateTimeWithTimezoneRange", "(", "string", "$", "format", "=", "TimezonedDateTime", "::", "DISPLAY_FORMAT", ")", ":", "FieldBuilderBase", "{", "return", "$", "this", "->", "field", "->", "type", "(", "new", "TimezonedDateTimeRangeType", "(", ...
Validates the input with the supplied format and converts the input to a TimezonedDateTimeRange instance. @see Dms\Common\Structure\DateTime\TimezonedDateTimeRange @param string $format @return FieldBuilderBase
[ "Validates", "the", "input", "with", "the", "supplied", "format", "and", "converts", "the", "input", "to", "a", "TimezonedDateTimeRange", "instance", "." ]
23f122182f60df5ec847047a81a39c8aab019ff1
https://github.com/dms-org/common.structure/blob/23f122182f60df5ec847047a81a39c8aab019ff1/src/FieldBuilder.php#L298-L301
193,396
dms-org/common.structure
src/FieldBuilder.php
FieldBuilder.multipleFrom
public function multipleFrom(array $valueLabelMap) : ArrayOfFieldBuilder { return $this->arrayOf( Field::element()->string()->oneOf($valueLabelMap)->required() )->containsNoDuplicates(); }
php
public function multipleFrom(array $valueLabelMap) : ArrayOfFieldBuilder { return $this->arrayOf( Field::element()->string()->oneOf($valueLabelMap)->required() )->containsNoDuplicates(); }
[ "public", "function", "multipleFrom", "(", "array", "$", "valueLabelMap", ")", ":", "ArrayOfFieldBuilder", "{", "return", "$", "this", "->", "arrayOf", "(", "Field", "::", "element", "(", ")", "->", "string", "(", ")", "->", "oneOf", "(", "$", "valueLabelM...
Validates the input as an an array only containing elements which are in the supplied value map Example <code> ->multipleFrom([ 'value' => 'Label', 'another-value' => 'Another Label', ]) </code> @param array $valueLabelMap @return ArrayOfFieldBuilder
[ "Validates", "the", "input", "as", "an", "an", "array", "only", "containing", "elements", "which", "are", "in", "the", "supplied", "value", "map" ]
23f122182f60df5ec847047a81a39c8aab019ff1
https://github.com/dms-org/common.structure/blob/23f122182f60df5ec847047a81a39c8aab019ff1/src/FieldBuilder.php#L569-L574
193,397
covex-nn/JooS
src/JooS/VarSpace.php
VarSpace.nsPush
public function nsPush() { $nsName = self::DELIMITER . (self::$_pushID++); $this->_data[$nsName] = array(); $this->_current = &$this->_data[$nsName]; $this->_names[] = &$this->_current; $this->_pushedData[] = $nsName; }
php
public function nsPush() { $nsName = self::DELIMITER . (self::$_pushID++); $this->_data[$nsName] = array(); $this->_current = &$this->_data[$nsName]; $this->_names[] = &$this->_current; $this->_pushedData[] = $nsName; }
[ "public", "function", "nsPush", "(", ")", "{", "$", "nsName", "=", "self", "::", "DELIMITER", ".", "(", "self", "::", "$", "_pushID", "++", ")", ";", "$", "this", "->", "_data", "[", "$", "nsName", "]", "=", "array", "(", ")", ";", "$", "this", ...
Pushes namespace. @return null
[ "Pushes", "namespace", "." ]
8dfb94edccecaf307787d4091ba7f20a674b7792
https://github.com/covex-nn/JooS/blob/8dfb94edccecaf307787d4091ba7f20a674b7792/src/JooS/VarSpace.php#L121-L129
193,398
covex-nn/JooS
src/JooS/VarSpace.php
VarSpace.nsPop
public function nsPop() { array_pop($this->_names); $this->_current = &$this->_names[sizeof($this->_names) - 1]; unset($this->_data[array_pop($this->_pushedData)]); }
php
public function nsPop() { array_pop($this->_names); $this->_current = &$this->_names[sizeof($this->_names) - 1]; unset($this->_data[array_pop($this->_pushedData)]); }
[ "public", "function", "nsPop", "(", ")", "{", "array_pop", "(", "$", "this", "->", "_names", ")", ";", "$", "this", "->", "_current", "=", "&", "$", "this", "->", "_names", "[", "sizeof", "(", "$", "this", "->", "_names", ")", "-", "1", "]", ";",...
Pops namespace. @return null
[ "Pops", "namespace", "." ]
8dfb94edccecaf307787d4091ba7f20a674b7792
https://github.com/covex-nn/JooS/blob/8dfb94edccecaf307787d4091ba7f20a674b7792/src/JooS/VarSpace.php#L136-L141
193,399
covex-nn/JooS
src/JooS/VarSpace.php
VarSpace._shiftTmp
private function _shiftTmp($path) { if ($path) { $names = explode(self::DELIMITER, $path); foreach ($names as $name) { if (!is_array($this->_tmp)) { $this->_tmp = array(); } if (!isset($this->_tmp[$name])) { $this->_tmp[$name] = null; } $thi...
php
private function _shiftTmp($path) { if ($path) { $names = explode(self::DELIMITER, $path); foreach ($names as $name) { if (!is_array($this->_tmp)) { $this->_tmp = array(); } if (!isset($this->_tmp[$name])) { $this->_tmp[$name] = null; } $thi...
[ "private", "function", "_shiftTmp", "(", "$", "path", ")", "{", "if", "(", "$", "path", ")", "{", "$", "names", "=", "explode", "(", "self", "::", "DELIMITER", ",", "$", "path", ")", ";", "foreach", "(", "$", "names", "as", "$", "name", ")", "{",...
It shifts. @param string $path Path @return null
[ "It", "shifts", "." ]
8dfb94edccecaf307787d4091ba7f20a674b7792
https://github.com/covex-nn/JooS/blob/8dfb94edccecaf307787d4091ba7f20a674b7792/src/JooS/VarSpace.php#L150-L165