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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
10,600 | jaztec/jaztec-admin | src/JaztecAdmin/Direct/Framework.php | Framework.getViews | public function getViews(array $values)
{
$config = $this->getServiceLocator()->get('Config');
if (!isset($values['controller'])) {
throw new Exception('No controller data received.');
}
$controller = $values['controller'];
if (!isset($config['jaztec_admin']['modu... | php | public function getViews(array $values)
{
$config = $this->getServiceLocator()->get('Config');
if (!isset($values['controller'])) {
throw new Exception('No controller data received.');
}
$controller = $values['controller'];
if (!isset($config['jaztec_admin']['modu... | [
"public",
"function",
"getViews",
"(",
"array",
"$",
"values",
")",
"{",
"$",
"config",
"=",
"$",
"this",
"->",
"getServiceLocator",
"(",
")",
"->",
"get",
"(",
"'Config'",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"values",
"[",
"'controller'",
"... | Returns all views connected to a controller.
@param array $values
@return array An array with the allowed views. | [
"Returns",
"all",
"views",
"connected",
"to",
"a",
"controller",
"."
] | c05b84077f05ed26529e2795f6adfe7b4ebd0edf | https://github.com/jaztec/jaztec-admin/blob/c05b84077f05ed26529e2795f6adfe7b4ebd0edf/src/JaztecAdmin/Direct/Framework.php#L53-L66 |
10,601 | jaztec/jaztec-admin | src/JaztecAdmin/Direct/Framework.php | Framework.getFiles | protected function getFiles(array $paths, $aclNamespace)
{
$result = array();
$object = '';
foreach ($paths as $namespace => $path) {
foreach ($this->rglob('*.js', 0, "$path/") as $entry) {
$entry = pathinfo($entry);
$extraNs = str_replace('/', '.'... | php | protected function getFiles(array $paths, $aclNamespace)
{
$result = array();
$object = '';
foreach ($paths as $namespace => $path) {
foreach ($this->rglob('*.js', 0, "$path/") as $entry) {
$entry = pathinfo($entry);
$extraNs = str_replace('/', '.'... | [
"protected",
"function",
"getFiles",
"(",
"array",
"$",
"paths",
",",
"$",
"aclNamespace",
")",
"{",
"$",
"result",
"=",
"array",
"(",
")",
";",
"$",
"object",
"=",
"''",
";",
"foreach",
"(",
"$",
"paths",
"as",
"$",
"namespace",
"=>",
"$",
"path",
... | Returns all the ExtJS objects in a given path and checks it against the
ACL settings.
@param array $paths
@param string $aclNamespace
@return array | [
"Returns",
"all",
"the",
"ExtJS",
"objects",
"in",
"a",
"given",
"path",
"and",
"checks",
"it",
"against",
"the",
"ACL",
"settings",
"."
] | c05b84077f05ed26529e2795f6adfe7b4ebd0edf | https://github.com/jaztec/jaztec-admin/blob/c05b84077f05ed26529e2795f6adfe7b4ebd0edf/src/JaztecAdmin/Direct/Framework.php#L97-L114 |
10,602 | jaztec/jaztec-admin | src/JaztecAdmin/Direct/Framework.php | Framework.rglob | protected function rglob($pattern = '*', $flags = 0, $path = '')
{
$paths = glob($path . '*', GLOB_MARK | GLOB_ONLYDIR | GLOB_NOSORT);
$files = glob($path . $pattern, $flags);
foreach ($paths as $path) {
$files = array_merge(
$files,
$this->rglob($... | php | protected function rglob($pattern = '*', $flags = 0, $path = '')
{
$paths = glob($path . '*', GLOB_MARK | GLOB_ONLYDIR | GLOB_NOSORT);
$files = glob($path . $pattern, $flags);
foreach ($paths as $path) {
$files = array_merge(
$files,
$this->rglob($... | [
"protected",
"function",
"rglob",
"(",
"$",
"pattern",
"=",
"'*'",
",",
"$",
"flags",
"=",
"0",
",",
"$",
"path",
"=",
"''",
")",
"{",
"$",
"paths",
"=",
"glob",
"(",
"$",
"path",
".",
"'*'",
",",
"GLOB_MARK",
"|",
"GLOB_ONLYDIR",
"|",
"GLOB_NOSORT... | Recursive glob function.
@param int $pattern the pattern passed to glob()
@param int $flags the flags passed to glob()
@param string $path the path to scan
@return mixed an array of files in the given path matching the pattern. | [
"Recursive",
"glob",
"function",
"."
] | c05b84077f05ed26529e2795f6adfe7b4ebd0edf | https://github.com/jaztec/jaztec-admin/blob/c05b84077f05ed26529e2795f6adfe7b4ebd0edf/src/JaztecAdmin/Direct/Framework.php#L124-L136 |
10,603 | graze/xml-utils | src/XmlFormatter.php | XmlFormatter.format | public function format($xml)
{
$dom = new DOMDocument('1.0');
$dom->preserveWhiteSpace = false;
$dom->formatOutput = true;
$dom->loadXML($xml);
$formatted = $dom->saveXML();
if (!$formatted) {
throw new Exception("An error occurred while formatting the XM... | php | public function format($xml)
{
$dom = new DOMDocument('1.0');
$dom->preserveWhiteSpace = false;
$dom->formatOutput = true;
$dom->loadXML($xml);
$formatted = $dom->saveXML();
if (!$formatted) {
throw new Exception("An error occurred while formatting the XM... | [
"public",
"function",
"format",
"(",
"$",
"xml",
")",
"{",
"$",
"dom",
"=",
"new",
"DOMDocument",
"(",
"'1.0'",
")",
";",
"$",
"dom",
"->",
"preserveWhiteSpace",
"=",
"false",
";",
"$",
"dom",
"->",
"formatOutput",
"=",
"true",
";",
"$",
"dom",
"->",... | Return the XML with correct indentation.
@param string $xml
@return string
@throws Exception | [
"Return",
"the",
"XML",
"with",
"correct",
"indentation",
"."
] | 0527e312518bc41e44018c29ea394bc4c6a2e7d7 | https://github.com/graze/xml-utils/blob/0527e312518bc41e44018c29ea394bc4c6a2e7d7/src/XmlFormatter.php#L28-L41 |
10,604 | synapsestudios/synapse-base | src/Synapse/Resque/ResqueCommand.php | ResqueCommand.shutdownWorkers | protected function shutdownWorkers()
{
$workers = Resque_Worker::all();
foreach ($workers as $worker) {
list($name, $pid, $queues) = explode(':', (string) $worker);
posix_kill((int) $pid, SIGQUIT);
}
$this->output->writeln('<info>SIGQUIT sent to '.count($wor... | php | protected function shutdownWorkers()
{
$workers = Resque_Worker::all();
foreach ($workers as $worker) {
list($name, $pid, $queues) = explode(':', (string) $worker);
posix_kill((int) $pid, SIGQUIT);
}
$this->output->writeln('<info>SIGQUIT sent to '.count($wor... | [
"protected",
"function",
"shutdownWorkers",
"(",
")",
"{",
"$",
"workers",
"=",
"Resque_Worker",
"::",
"all",
"(",
")",
";",
"foreach",
"(",
"$",
"workers",
"as",
"$",
"worker",
")",
"{",
"list",
"(",
"$",
"name",
",",
"$",
"pid",
",",
"$",
"queues",... | Shutdown all workers | [
"Shutdown",
"all",
"workers"
] | 60c830550491742a077ab063f924e2f0b63825da | https://github.com/synapsestudios/synapse-base/blob/60c830550491742a077ab063f924e2f0b63825da/src/Synapse/Resque/ResqueCommand.php#L91-L101 |
10,605 | Puzzlout/FrameworkMvcLegacy | src/Core/User.php | User.getAttribute | public function getAttribute($sessionKey) {
return
isset($_SESSION[$this->GetKey($sessionKey)]) ?
$_SESSION[$this->GetKey($sessionKey)] :
false;
} | php | public function getAttribute($sessionKey) {
return
isset($_SESSION[$this->GetKey($sessionKey)]) ?
$_SESSION[$this->GetKey($sessionKey)] :
false;
} | [
"public",
"function",
"getAttribute",
"(",
"$",
"sessionKey",
")",
"{",
"return",
"isset",
"(",
"$",
"_SESSION",
"[",
"$",
"this",
"->",
"GetKey",
"(",
"$",
"sessionKey",
")",
"]",
")",
"?",
"$",
"_SESSION",
"[",
"$",
"this",
"->",
"GetKey",
"(",
"$"... | Get a value in current session from a given key.
@param sring $sessionKey
The key to use to find the associated value. The set of values is found in
the class(es) \Puzzlout\Framework\Enums\SessionKeys (Framework) or
\Application\YourApp\Resources\Enums\SessionKeys (Application)
@return mixed
The value can any type: int... | [
"Get",
"a",
"value",
"in",
"current",
"session",
"from",
"a",
"given",
"key",
"."
] | 14e0fc5b16978cbd209f552ee9c649f66a0dfc6e | https://github.com/Puzzlout/FrameworkMvcLegacy/blob/14e0fc5b16978cbd209f552ee9c649f66a0dfc6e/src/Core/User.php#L53-L58 |
10,606 | sebardo/ecommerce | EcommerceBundle/Entity/CheckoutAddressable.php | CheckoutAddressable.setDeliveryAddressInfo | public function setDeliveryAddressInfo(Address $address)
{
$this->setDeliveryAddress($address->getAddress());
$this->setDeliveryPostalCode($address->getPostalCode());
$this->setDeliveryCity($address->getCity());
$this->setDeliveryState($address->getState());
$this->setDeliver... | php | public function setDeliveryAddressInfo(Address $address)
{
$this->setDeliveryAddress($address->getAddress());
$this->setDeliveryPostalCode($address->getPostalCode());
$this->setDeliveryCity($address->getCity());
$this->setDeliveryState($address->getState());
$this->setDeliver... | [
"public",
"function",
"setDeliveryAddressInfo",
"(",
"Address",
"$",
"address",
")",
"{",
"$",
"this",
"->",
"setDeliveryAddress",
"(",
"$",
"address",
"->",
"getAddress",
"(",
")",
")",
";",
"$",
"this",
"->",
"setDeliveryPostalCode",
"(",
"$",
"address",
"... | Set delivery address information
@param Address $address | [
"Set",
"delivery",
"address",
"information"
] | 3e17545e69993f10a1df17f9887810c7378fc7f9 | https://github.com/sebardo/ecommerce/blob/3e17545e69993f10a1df17f9887810c7378fc7f9/EcommerceBundle/Entity/CheckoutAddressable.php#L92-L99 |
10,607 | sebardo/ecommerce | EcommerceBundle/Entity/CheckoutAddressable.php | CheckoutAddressable.getDeliveryAddressInfo | public function getDeliveryAddressInfo()
{
$address = new Address();
$address->setAddress($this->getDeliveryAddress());
$address->setPostalCode($this->getDeliveryPostalCode());
$address->setCity($this->getDeliveryCity());
$address->setState($this->getDeliveryState());
... | php | public function getDeliveryAddressInfo()
{
$address = new Address();
$address->setAddress($this->getDeliveryAddress());
$address->setPostalCode($this->getDeliveryPostalCode());
$address->setCity($this->getDeliveryCity());
$address->setState($this->getDeliveryState());
... | [
"public",
"function",
"getDeliveryAddressInfo",
"(",
")",
"{",
"$",
"address",
"=",
"new",
"Address",
"(",
")",
";",
"$",
"address",
"->",
"setAddress",
"(",
"$",
"this",
"->",
"getDeliveryAddress",
"(",
")",
")",
";",
"$",
"address",
"->",
"setPostalCode"... | Get delivery address information
@return Address | [
"Get",
"delivery",
"address",
"information"
] | 3e17545e69993f10a1df17f9887810c7378fc7f9 | https://github.com/sebardo/ecommerce/blob/3e17545e69993f10a1df17f9887810c7378fc7f9/EcommerceBundle/Entity/CheckoutAddressable.php#L106-L117 |
10,608 | sebardo/ecommerce | EcommerceBundle/Entity/CheckoutAddressable.php | CheckoutAddressable.validateDeliveryDni | public function validateDeliveryDni(ExecutionContextInterface $context)
{
$dni = $this->getDeliveryDni();
if (is_null($dni)) {
return;
}
// check format
if (0 === preg_match("/\d{1,8}[a-z]/i", $dni)) {
$context->addViolationAt('dni', 'Invalid DNI num... | php | public function validateDeliveryDni(ExecutionContextInterface $context)
{
$dni = $this->getDeliveryDni();
if (is_null($dni)) {
return;
}
// check format
if (0 === preg_match("/\d{1,8}[a-z]/i", $dni)) {
$context->addViolationAt('dni', 'Invalid DNI num... | [
"public",
"function",
"validateDeliveryDni",
"(",
"ExecutionContextInterface",
"$",
"context",
")",
"{",
"$",
"dni",
"=",
"$",
"this",
"->",
"getDeliveryDni",
"(",
")",
";",
"if",
"(",
"is_null",
"(",
"$",
"dni",
")",
")",
"{",
"return",
";",
"}",
"// ch... | Custom validator to check delivery Dni
@param ExecutionContextInterface $context | [
"Custom",
"validator",
"to",
"check",
"delivery",
"Dni"
] | 3e17545e69993f10a1df17f9887810c7378fc7f9 | https://github.com/sebardo/ecommerce/blob/3e17545e69993f10a1df17f9887810c7378fc7f9/EcommerceBundle/Entity/CheckoutAddressable.php#L244-L265 |
10,609 | tweedegolf/generator | src/TweedeGolf/Generator/Util/PregErrorToString.php | PregErrorToString.getString | public static function getString($error)
{
if (!is_int($error)) {
throw new \BadMethodCallException("Invalid type, expected integer, got {$error}.");
}
switch ($error) {
case PREG_NO_ERROR: return 'PREG_NO_ERROR';
case PREG_INTERNAL_ERROR: return 'PREG_IN... | php | public static function getString($error)
{
if (!is_int($error)) {
throw new \BadMethodCallException("Invalid type, expected integer, got {$error}.");
}
switch ($error) {
case PREG_NO_ERROR: return 'PREG_NO_ERROR';
case PREG_INTERNAL_ERROR: return 'PREG_IN... | [
"public",
"static",
"function",
"getString",
"(",
"$",
"error",
")",
"{",
"if",
"(",
"!",
"is_int",
"(",
"$",
"error",
")",
")",
"{",
"throw",
"new",
"\\",
"BadMethodCallException",
"(",
"\"Invalid type, expected integer, got {$error}.\"",
")",
";",
"}",
"swit... | Convert a PREG error message id to its string equivalent.
@param int $error
@return string
@throws \BadMethodCallException | [
"Convert",
"a",
"PREG",
"error",
"message",
"id",
"to",
"its",
"string",
"equivalent",
"."
] | f931d659ddf6a531ebf00bbfc11d417c527cd21b | https://github.com/tweedegolf/generator/blob/f931d659ddf6a531ebf00bbfc11d417c527cd21b/src/TweedeGolf/Generator/Util/PregErrorToString.php#L13-L29 |
10,610 | shov/wpci-core | Flow/ServiceRegistrator.php | ServiceRegistrator.prepareArguments | public function prepareArguments(string $id, array $resolvingReferences)
{
if(!isset($this->serviceArguments[$id])) $this->serviceArguments[$id] = [];
$this->serviceArguments[$id] = array_merge($this->serviceArguments[$id], $resolvingReferences);
} | php | public function prepareArguments(string $id, array $resolvingReferences)
{
if(!isset($this->serviceArguments[$id])) $this->serviceArguments[$id] = [];
$this->serviceArguments[$id] = array_merge($this->serviceArguments[$id], $resolvingReferences);
} | [
"public",
"function",
"prepareArguments",
"(",
"string",
"$",
"id",
",",
"array",
"$",
"resolvingReferences",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"serviceArguments",
"[",
"$",
"id",
"]",
")",
")",
"$",
"this",
"->",
"serviceArgumen... | Add arguments to entity before register it
@param string $id
@param array $resolvingReferences | [
"Add",
"arguments",
"to",
"entity",
"before",
"register",
"it"
] | e31084cbc2f310882df2b9b0548330ea5fdb4f26 | https://github.com/shov/wpci-core/blob/e31084cbc2f310882df2b9b0548330ea5fdb4f26/Flow/ServiceRegistrator.php#L49-L53 |
10,611 | wakerscz/cms-category-module | src/Component/Frontend/Modal/Modal.php | Modal.handleEdit | public function handleEdit(int $id)
{
if ($this->presenter->isAjax())
{
$this->categoryId = $id;
$this->onOpen();
}
} | php | public function handleEdit(int $id)
{
if ($this->presenter->isAjax())
{
$this->categoryId = $id;
$this->onOpen();
}
} | [
"public",
"function",
"handleEdit",
"(",
"int",
"$",
"id",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"presenter",
"->",
"isAjax",
"(",
")",
")",
"{",
"$",
"this",
"->",
"categoryId",
"=",
"$",
"id",
";",
"$",
"this",
"->",
"onOpen",
"(",
")",
";",
... | Handler pro editaci
@param int $id | [
"Handler",
"pro",
"editaci"
] | 6f5f8c366af0157e333e19abf18b6a3e346b127e | https://github.com/wakerscz/cms-category-module/blob/6f5f8c366af0157e333e19abf18b6a3e346b127e/src/Component/Frontend/Modal/Modal.php#L288-L295 |
10,612 | canis-io/yii2-key-provider | lib/providers/BaseProvider.php | BaseProvider.init | public function init()
{
foreach (static::defaultConfig() as $key => $value) {
if (!isset($this->{$key})) {
$this->{$key} = $value;
}
}
foreach (static::requiredConfig() as $key) {
if (!isset($this->{$key})) {
throw new Inva... | php | public function init()
{
foreach (static::defaultConfig() as $key => $value) {
if (!isset($this->{$key})) {
$this->{$key} = $value;
}
}
foreach (static::requiredConfig() as $key) {
if (!isset($this->{$key})) {
throw new Inva... | [
"public",
"function",
"init",
"(",
")",
"{",
"foreach",
"(",
"static",
"::",
"defaultConfig",
"(",
")",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"{",
"$",
"key",
"}",
")",
")",
"{",
"$",
... | Initializes the object and registers the provider
@throws InvalidConfigException When a required configuration prarameter is not set
@see \yii\base\Object | [
"Initializes",
"the",
"object",
"and",
"registers",
"the",
"provider"
] | c54f1c8af812bddf48872a05bc1d1e02112decc9 | https://github.com/canis-io/yii2-key-provider/blob/c54f1c8af812bddf48872a05bc1d1e02112decc9/lib/providers/BaseProvider.php#L42-L55 |
10,613 | canis-io/yii2-key-provider | lib/providers/BaseProvider.php | BaseProvider.setMasterKeyPairProvider | public function setMasterKeyPairProvider($provider)
{
if (isset($this->masterKeyPairProvider)) {
throw new InvalidCallException('Setting read-only property: ' . get_class($this) . '::masterKeyPairProvider');
}
if (is_array($provider)) {
$provider = Yii::createObject($... | php | public function setMasterKeyPairProvider($provider)
{
if (isset($this->masterKeyPairProvider)) {
throw new InvalidCallException('Setting read-only property: ' . get_class($this) . '::masterKeyPairProvider');
}
if (is_array($provider)) {
$provider = Yii::createObject($... | [
"public",
"function",
"setMasterKeyPairProvider",
"(",
"$",
"provider",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"masterKeyPairProvider",
")",
")",
"{",
"throw",
"new",
"InvalidCallException",
"(",
"'Setting read-only property: '",
".",
"get_class",
"... | Sets the master key pair provider for use in secure key pairs
@param ProviderInterface|array $provider The key pair provider for the master key | [
"Sets",
"the",
"master",
"key",
"pair",
"provider",
"for",
"use",
"in",
"secure",
"key",
"pairs"
] | c54f1c8af812bddf48872a05bc1d1e02112decc9 | https://github.com/canis-io/yii2-key-provider/blob/c54f1c8af812bddf48872a05bc1d1e02112decc9/lib/providers/BaseProvider.php#L62-L72 |
10,614 | canis-io/yii2-key-provider | lib/providers/BaseProvider.php | BaseProvider.afterRetrieveKeyPair | protected function afterRetrieveKeyPair(KeyPairInterface $keyPair)
{
if ($keyPair instanceof SecureKeyPairInterface) {
$masterKeyPairProvider = $this->getMasterKeyPairProvider();
$masterKeyName = $this->getMasterKeyName();
if ($masterKeyPairProvider === null || !$masterKe... | php | protected function afterRetrieveKeyPair(KeyPairInterface $keyPair)
{
if ($keyPair instanceof SecureKeyPairInterface) {
$masterKeyPairProvider = $this->getMasterKeyPairProvider();
$masterKeyName = $this->getMasterKeyName();
if ($masterKeyPairProvider === null || !$masterKe... | [
"protected",
"function",
"afterRetrieveKeyPair",
"(",
"KeyPairInterface",
"$",
"keyPair",
")",
"{",
"if",
"(",
"$",
"keyPair",
"instanceof",
"SecureKeyPairInterface",
")",
"{",
"$",
"masterKeyPairProvider",
"=",
"$",
"this",
"->",
"getMasterKeyPairProvider",
"(",
")... | Process a key pair object after it was retrieved from the provider. Purpose
is to unlock secure key pairs.
@param KeyPairInterface $keyPair Key pair object that was just retrieved
@return KeyPairInterface Original instance of the key pair | [
"Process",
"a",
"key",
"pair",
"object",
"after",
"it",
"was",
"retrieved",
"from",
"the",
"provider",
".",
"Purpose",
"is",
"to",
"unlock",
"secure",
"key",
"pairs",
"."
] | c54f1c8af812bddf48872a05bc1d1e02112decc9 | https://github.com/canis-io/yii2-key-provider/blob/c54f1c8af812bddf48872a05bc1d1e02112decc9/lib/providers/BaseProvider.php#L126-L138 |
10,615 | canis-io/yii2-key-provider | lib/providers/BaseProvider.php | BaseProvider.afterGenerateKeyPair | protected function afterGenerateKeyPair(KeyPairInterface $keyPair)
{
if ($keyPair instanceof SecureKeyPairInterface) {
$masterKeyPairProvider = $this->getMasterKeyPairProvider();
$masterKeyName = $this->getMasterKeyName();
if ($masterKeyPairProvider === null) {
... | php | protected function afterGenerateKeyPair(KeyPairInterface $keyPair)
{
if ($keyPair instanceof SecureKeyPairInterface) {
$masterKeyPairProvider = $this->getMasterKeyPairProvider();
$masterKeyName = $this->getMasterKeyName();
if ($masterKeyPairProvider === null) {
... | [
"protected",
"function",
"afterGenerateKeyPair",
"(",
"KeyPairInterface",
"$",
"keyPair",
")",
"{",
"if",
"(",
"$",
"keyPair",
"instanceof",
"SecureKeyPairInterface",
")",
"{",
"$",
"masterKeyPairProvider",
"=",
"$",
"this",
"->",
"getMasterKeyPairProvider",
"(",
")... | Process a key pair object after it was generated
@param KeyPairInterface $keyPair Key pair object that was just generated
@return KeyPairInterface Original instance of the key pair | [
"Process",
"a",
"key",
"pair",
"object",
"after",
"it",
"was",
"generated"
] | c54f1c8af812bddf48872a05bc1d1e02112decc9 | https://github.com/canis-io/yii2-key-provider/blob/c54f1c8af812bddf48872a05bc1d1e02112decc9/lib/providers/BaseProvider.php#L146-L162 |
10,616 | canis-io/yii2-key-provider | lib/providers/BaseProvider.php | BaseProvider.setId | public function setId($id)
{
if (isset($this->id)) {
throw new InvalidCallException('Setting read-only property: ' . get_class($this) . '::id');
}
$this->id = $id;
} | php | public function setId($id)
{
if (isset($this->id)) {
throw new InvalidCallException('Setting read-only property: ' . get_class($this) . '::id');
}
$this->id = $id;
} | [
"public",
"function",
"setId",
"(",
"$",
"id",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"id",
")",
")",
"{",
"throw",
"new",
"InvalidCallException",
"(",
"'Setting read-only property: '",
".",
"get_class",
"(",
"$",
"this",
")",
".",
"'::id'... | Sets the provider ID
@param string $id the ID of the provider
@throws InvalidCallException when the ID is already set | [
"Sets",
"the",
"provider",
"ID"
] | c54f1c8af812bddf48872a05bc1d1e02112decc9 | https://github.com/canis-io/yii2-key-provider/blob/c54f1c8af812bddf48872a05bc1d1e02112decc9/lib/providers/BaseProvider.php#L178-L184 |
10,617 | rawphp/RawApplication | src/RawPHP/RawApplication/Application.php | Application.init | public function init( $config = [ ] )
{
$this->initDefaults();
$this->initMail( $config );
$this->initLog( $config );
$this->initDatabase( $config );
$this->initRequest( $config );
$this->initRouter( $config );
$this->initSession( $config );
$th... | php | public function init( $config = [ ] )
{
$this->initDefaults();
$this->initMail( $config );
$this->initLog( $config );
$this->initDatabase( $config );
$this->initRequest( $config );
$this->initRouter( $config );
$this->initSession( $config );
$th... | [
"public",
"function",
"init",
"(",
"$",
"config",
"=",
"[",
"]",
")",
"{",
"$",
"this",
"->",
"initDefaults",
"(",
")",
";",
"$",
"this",
"->",
"initMail",
"(",
"$",
"config",
")",
";",
"$",
"this",
"->",
"initLog",
"(",
"$",
"config",
")",
";",
... | Initialises the application.
@param array $config configuration array | [
"Initialises",
"the",
"application",
"."
] | 66e1afc693c4512354cc74087989b81d1b600d00 | https://github.com/rawphp/RawApplication/blob/66e1afc693c4512354cc74087989b81d1b600d00/src/RawPHP/RawApplication/Application.php#L100-L121 |
10,618 | rawphp/RawApplication | src/RawPHP/RawApplication/Application.php | Application.initDefaults | protected function initDefaults()
{
$this->bindShared( 'RawPHP\RawDispatcher\Contract\IDispatcher', function ()
{
return new Dispatcher();
}
);
$this->bindShared( 'RawPHP\RawFileSystem\Contract\IFileSystem', function ()
{
return new FileSystem... | php | protected function initDefaults()
{
$this->bindShared( 'RawPHP\RawDispatcher\Contract\IDispatcher', function ()
{
return new Dispatcher();
}
);
$this->bindShared( 'RawPHP\RawFileSystem\Contract\IFileSystem', function ()
{
return new FileSystem... | [
"protected",
"function",
"initDefaults",
"(",
")",
"{",
"$",
"this",
"->",
"bindShared",
"(",
"'RawPHP\\RawDispatcher\\Contract\\IDispatcher'",
",",
"function",
"(",
")",
"{",
"return",
"new",
"Dispatcher",
"(",
")",
";",
"}",
")",
";",
"$",
"this",
"->",
"b... | Initialise default services. | [
"Initialise",
"default",
"services",
"."
] | 66e1afc693c4512354cc74087989b81d1b600d00 | https://github.com/rawphp/RawApplication/blob/66e1afc693c4512354cc74087989b81d1b600d00/src/RawPHP/RawApplication/Application.php#L136-L152 |
10,619 | rawphp/RawApplication | src/RawPHP/RawApplication/Application.php | Application.initMail | protected function initMail( array $config )
{
if ( isset( $config[ 'mail' ] ) )
{
if ( isset( $config[ 'mail' ][ 'class' ] ) )
{
$this->bindShared( 'RawPHP\RawMail\Contract\IMail', function () use ( $config )
{
$class = $co... | php | protected function initMail( array $config )
{
if ( isset( $config[ 'mail' ] ) )
{
if ( isset( $config[ 'mail' ][ 'class' ] ) )
{
$this->bindShared( 'RawPHP\RawMail\Contract\IMail', function () use ( $config )
{
$class = $co... | [
"protected",
"function",
"initMail",
"(",
"array",
"$",
"config",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"config",
"[",
"'mail'",
"]",
")",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"config",
"[",
"'mail'",
"]",
"[",
"'class'",
"]",
")",
")",
"{",... | Initialise the mail service.
@param array $config | [
"Initialise",
"the",
"mail",
"service",
"."
] | 66e1afc693c4512354cc74087989b81d1b600d00 | https://github.com/rawphp/RawApplication/blob/66e1afc693c4512354cc74087989b81d1b600d00/src/RawPHP/RawApplication/Application.php#L159-L192 |
10,620 | rawphp/RawApplication | src/RawPHP/RawApplication/Application.php | Application.initLog | protected function initLog( array $config )
{
if ( isset( $config[ 'log' ] ) )
{
if ( isset( $config[ 'log' ][ 'class' ] ) )
{
$this->bindShared( 'RawPHP\RawLog\Contract\ILog', function () use ( $config )
{
$class = $config[... | php | protected function initLog( array $config )
{
if ( isset( $config[ 'log' ] ) )
{
if ( isset( $config[ 'log' ][ 'class' ] ) )
{
$this->bindShared( 'RawPHP\RawLog\Contract\ILog', function () use ( $config )
{
$class = $config[... | [
"protected",
"function",
"initLog",
"(",
"array",
"$",
"config",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"config",
"[",
"'log'",
"]",
")",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"config",
"[",
"'log'",
"]",
"[",
"'class'",
"]",
")",
")",
"{",
... | Initialise the logger.
@param array $config | [
"Initialise",
"the",
"logger",
"."
] | 66e1afc693c4512354cc74087989b81d1b600d00 | https://github.com/rawphp/RawApplication/blob/66e1afc693c4512354cc74087989b81d1b600d00/src/RawPHP/RawApplication/Application.php#L199-L232 |
10,621 | rawphp/RawApplication | src/RawPHP/RawApplication/Application.php | Application.initDatabase | protected function initDatabase( array $config )
{
if ( isset( $config[ 'db' ] ) )
{
if ( isset( $config[ 'db' ][ 'class' ] ) )
{
$this->bindShared( 'RawPHP\RawDatabase\Contract\IDatabase', function () use ( $config )
{
$cla... | php | protected function initDatabase( array $config )
{
if ( isset( $config[ 'db' ] ) )
{
if ( isset( $config[ 'db' ][ 'class' ] ) )
{
$this->bindShared( 'RawPHP\RawDatabase\Contract\IDatabase', function () use ( $config )
{
$cla... | [
"protected",
"function",
"initDatabase",
"(",
"array",
"$",
"config",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"config",
"[",
"'db'",
"]",
")",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"config",
"[",
"'db'",
"]",
"[",
"'class'",
"]",
")",
")",
"{",... | Initialise the database.
@param array $config | [
"Initialise",
"the",
"database",
"."
] | 66e1afc693c4512354cc74087989b81d1b600d00 | https://github.com/rawphp/RawApplication/blob/66e1afc693c4512354cc74087989b81d1b600d00/src/RawPHP/RawApplication/Application.php#L239-L264 |
10,622 | rawphp/RawApplication | src/RawPHP/RawApplication/Application.php | Application.initRequest | protected function initRequest( array $config )
{
if ( isset( $config[ 'request' ] ) )
{
if ( isset( $config[ 'request' ][ 'class' ] ) )
{
$this->bindShared( 'RawPHP\RawRequest\Contract\IRequest', function () use ( $config )
{
... | php | protected function initRequest( array $config )
{
if ( isset( $config[ 'request' ] ) )
{
if ( isset( $config[ 'request' ][ 'class' ] ) )
{
$this->bindShared( 'RawPHP\RawRequest\Contract\IRequest', function () use ( $config )
{
... | [
"protected",
"function",
"initRequest",
"(",
"array",
"$",
"config",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"config",
"[",
"'request'",
"]",
")",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"config",
"[",
"'request'",
"]",
"[",
"'class'",
"]",
")",
")... | Initialises the request instance.
@param array $config configuration array | [
"Initialises",
"the",
"request",
"instance",
"."
] | 66e1afc693c4512354cc74087989b81d1b600d00 | https://github.com/rawphp/RawApplication/blob/66e1afc693c4512354cc74087989b81d1b600d00/src/RawPHP/RawApplication/Application.php#L271-L307 |
10,623 | rawphp/RawApplication | src/RawPHP/RawApplication/Application.php | Application.initRouter | protected function initRouter( array $config )
{
if ( isset( $config[ 'router' ] ) )
{
if ( isset( $config[ 'router' ][ 'class' ] ) )
{
$this->bindShared( 'RawPHP\RawRouter\Contract\IRouter', function () use ( $config )
{
$c... | php | protected function initRouter( array $config )
{
if ( isset( $config[ 'router' ] ) )
{
if ( isset( $config[ 'router' ][ 'class' ] ) )
{
$this->bindShared( 'RawPHP\RawRouter\Contract\IRouter', function () use ( $config )
{
$c... | [
"protected",
"function",
"initRouter",
"(",
"array",
"$",
"config",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"config",
"[",
"'router'",
"]",
")",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"config",
"[",
"'router'",
"]",
"[",
"'class'",
"]",
")",
")",
... | Initialises the router.
@param array $config configuration array | [
"Initialises",
"the",
"router",
"."
] | 66e1afc693c4512354cc74087989b81d1b600d00 | https://github.com/rawphp/RawApplication/blob/66e1afc693c4512354cc74087989b81d1b600d00/src/RawPHP/RawApplication/Application.php#L314-L353 |
10,624 | rawphp/RawApplication | src/RawPHP/RawApplication/Application.php | Application.initAppName | protected function initAppName( array $config )
{
$appName = 'Application';
if ( isset( $config[ 'app' ][ 'name' ] ) )
{
$appName = $config[ 'app' ][ 'name' ];
}
$this->appName = $appName;
} | php | protected function initAppName( array $config )
{
$appName = 'Application';
if ( isset( $config[ 'app' ][ 'name' ] ) )
{
$appName = $config[ 'app' ][ 'name' ];
}
$this->appName = $appName;
} | [
"protected",
"function",
"initAppName",
"(",
"array",
"$",
"config",
")",
"{",
"$",
"appName",
"=",
"'Application'",
";",
"if",
"(",
"isset",
"(",
"$",
"config",
"[",
"'app'",
"]",
"[",
"'name'",
"]",
")",
")",
"{",
"$",
"appName",
"=",
"$",
"config"... | Initialises the application name.
@param array $config configuration array | [
"Initialises",
"the",
"application",
"name",
"."
] | 66e1afc693c4512354cc74087989b81d1b600d00 | https://github.com/rawphp/RawApplication/blob/66e1afc693c4512354cc74087989b81d1b600d00/src/RawPHP/RawApplication/Application.php#L410-L420 |
10,625 | rawphp/RawApplication | src/RawPHP/RawApplication/Application.php | Application.initDefaultLanguage | protected function initDefaultLanguage( array $config )
{
$language = 'en_US';
if ( isset( $config[ 'default_language' ] ) )
{
$language = $config[ 'default_language' ];
}
$this->defaultLanguage = $language;
} | php | protected function initDefaultLanguage( array $config )
{
$language = 'en_US';
if ( isset( $config[ 'default_language' ] ) )
{
$language = $config[ 'default_language' ];
}
$this->defaultLanguage = $language;
} | [
"protected",
"function",
"initDefaultLanguage",
"(",
"array",
"$",
"config",
")",
"{",
"$",
"language",
"=",
"'en_US'",
";",
"if",
"(",
"isset",
"(",
"$",
"config",
"[",
"'default_language'",
"]",
")",
")",
"{",
"$",
"language",
"=",
"$",
"config",
"[",
... | Initialises the default language used in the app.
@param array $config configuration array | [
"Initialises",
"the",
"default",
"language",
"used",
"in",
"the",
"app",
"."
] | 66e1afc693c4512354cc74087989b81d1b600d00 | https://github.com/rawphp/RawApplication/blob/66e1afc693c4512354cc74087989b81d1b600d00/src/RawPHP/RawApplication/Application.php#L427-L437 |
10,626 | rawphp/RawApplication | src/RawPHP/RawApplication/Application.php | Application.processRequest | protected function processRequest()
{
$route = $this[ 'request' ]->getRoute();
$params = $this[ 'request' ]->getParams();
$controller = $this[ 'router' ]->createController( $route, $params );
if ( NULL === $controller )
{
throw new RawException( 'Failed to Init... | php | protected function processRequest()
{
$route = $this[ 'request' ]->getRoute();
$params = $this[ 'request' ]->getParams();
$controller = $this[ 'router' ]->createController( $route, $params );
if ( NULL === $controller )
{
throw new RawException( 'Failed to Init... | [
"protected",
"function",
"processRequest",
"(",
")",
"{",
"$",
"route",
"=",
"$",
"this",
"[",
"'request'",
"]",
"->",
"getRoute",
"(",
")",
";",
"$",
"params",
"=",
"$",
"this",
"[",
"'request'",
"]",
"->",
"getParams",
"(",
")",
";",
"$",
"controll... | Processes the HTTP request.
@throws RawException | [
"Processes",
"the",
"HTTP",
"request",
"."
] | 66e1afc693c4512354cc74087989b81d1b600d00 | https://github.com/rawphp/RawApplication/blob/66e1afc693c4512354cc74087989b81d1b600d00/src/RawPHP/RawApplication/Application.php#L496-L512 |
10,627 | rawphp/RawApplication | src/RawPHP/RawApplication/Application.php | Application.createUrl | public function createUrl( $route, $params = [ ], $absolute = FALSE )
{
return $this[ 'request' ]->createUrl( $route, $params, $absolute );
} | php | public function createUrl( $route, $params = [ ], $absolute = FALSE )
{
return $this[ 'request' ]->createUrl( $route, $params, $absolute );
} | [
"public",
"function",
"createUrl",
"(",
"$",
"route",
",",
"$",
"params",
"=",
"[",
"]",
",",
"$",
"absolute",
"=",
"FALSE",
")",
"{",
"return",
"$",
"this",
"[",
"'request'",
"]",
"->",
"createUrl",
"(",
"$",
"route",
",",
"$",
"params",
",",
"$",... | Creates a new url.
@param string $route controller/method route
@param array $params list of parameters
@param bool $absolute whether it should be an absolute url
@return string the url | [
"Creates",
"a",
"new",
"url",
"."
] | 66e1afc693c4512354cc74087989b81d1b600d00 | https://github.com/rawphp/RawApplication/blob/66e1afc693c4512354cc74087989b81d1b600d00/src/RawPHP/RawApplication/Application.php#L523-L526 |
10,628 | rawphp/RawApplication | src/RawPHP/RawApplication/Application.php | Application.addFlash | public function addFlash( $message, $type = 'error' )
{
if ( 'error' === $type )
{
$this->flash[ 'errors' ][ ] = $message;
}
else
{
$this->flash[ 'success' ][ ] = $message;
}
//$this[ 'session' ]->add( 'messages', $this->flash );
} | php | public function addFlash( $message, $type = 'error' )
{
if ( 'error' === $type )
{
$this->flash[ 'errors' ][ ] = $message;
}
else
{
$this->flash[ 'success' ][ ] = $message;
}
//$this[ 'session' ]->add( 'messages', $this->flash );
} | [
"public",
"function",
"addFlash",
"(",
"$",
"message",
",",
"$",
"type",
"=",
"'error'",
")",
"{",
"if",
"(",
"'error'",
"===",
"$",
"type",
")",
"{",
"$",
"this",
"->",
"flash",
"[",
"'errors'",
"]",
"[",
"]",
"=",
"$",
"message",
";",
"}",
"els... | Adds a flash message to appear on the next page.
Error => 'error' ( default )
Success => 'success'
@param string $message success or error message
@param string $type the type of message | [
"Adds",
"a",
"flash",
"message",
"to",
"appear",
"on",
"the",
"next",
"page",
"."
] | 66e1afc693c4512354cc74087989b81d1b600d00 | https://github.com/rawphp/RawApplication/blob/66e1afc693c4512354cc74087989b81d1b600d00/src/RawPHP/RawApplication/Application.php#L537-L549 |
10,629 | cyberspectrum/i18n-xliff | src/Xml/XliffFile.php | XliffFile.setDate | public function setDate(\DateTime $date): void
{
$this->getFileElement()->setAttributeNS(static::XLIFF_NS, 'date', $date->format(\DateTime::ATOM));
} | php | public function setDate(\DateTime $date): void
{
$this->getFileElement()->setAttributeNS(static::XLIFF_NS, 'date', $date->format(\DateTime::ATOM));
} | [
"public",
"function",
"setDate",
"(",
"\\",
"DateTime",
"$",
"date",
")",
":",
"void",
"{",
"$",
"this",
"->",
"getFileElement",
"(",
")",
"->",
"setAttributeNS",
"(",
"static",
"::",
"XLIFF_NS",
",",
"'date'",
",",
"$",
"date",
"->",
"format",
"(",
"\... | Sets the last modification time in this file.
@param \DateTime $date The date.
@return void | [
"Sets",
"the",
"last",
"modification",
"time",
"in",
"this",
"file",
"."
] | 9d03f85a33c8f6fc9acd99770f23800679f130b3 | https://github.com/cyberspectrum/i18n-xliff/blob/9d03f85a33c8f6fc9acd99770f23800679f130b3/src/Xml/XliffFile.php#L114-L117 |
10,630 | cyberspectrum/i18n-xliff | src/Xml/XliffFile.php | XliffFile.setSourceLanguage | public function setSourceLanguage($sourceLanguage): void
{
if (!preg_match('#[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*#', $sourceLanguage)) {
throw new \InvalidArgumentException('Invalid language string: "' . $sourceLanguage . '"');
}
$this->getFileElement()->setAttributeNS(static::XLIFF... | php | public function setSourceLanguage($sourceLanguage): void
{
if (!preg_match('#[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*#', $sourceLanguage)) {
throw new \InvalidArgumentException('Invalid language string: "' . $sourceLanguage . '"');
}
$this->getFileElement()->setAttributeNS(static::XLIFF... | [
"public",
"function",
"setSourceLanguage",
"(",
"$",
"sourceLanguage",
")",
":",
"void",
"{",
"if",
"(",
"!",
"preg_match",
"(",
"'#[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*#'",
",",
"$",
"sourceLanguage",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"... | Set the source language for this file.
@param string $sourceLanguage The language code from ISO 639-1.
@return void
@throws \InvalidArgumentException When the language string is invalid. | [
"Set",
"the",
"source",
"language",
"for",
"this",
"file",
"."
] | 9d03f85a33c8f6fc9acd99770f23800679f130b3 | https://github.com/cyberspectrum/i18n-xliff/blob/9d03f85a33c8f6fc9acd99770f23800679f130b3/src/Xml/XliffFile.php#L162-L168 |
10,631 | cyberspectrum/i18n-xliff | src/Xml/XliffFile.php | XliffFile.setTargetLanguage | public function setTargetLanguage($targetLanguage): void
{
if (!preg_match('#[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*#', $targetLanguage)) {
throw new \InvalidArgumentException('Invalid language string: "' . $targetLanguage . '"');
}
$this->getFileElement()->setAttributeNS(static::XLIFF... | php | public function setTargetLanguage($targetLanguage): void
{
if (!preg_match('#[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*#', $targetLanguage)) {
throw new \InvalidArgumentException('Invalid language string: "' . $targetLanguage . '"');
}
$this->getFileElement()->setAttributeNS(static::XLIFF... | [
"public",
"function",
"setTargetLanguage",
"(",
"$",
"targetLanguage",
")",
":",
"void",
"{",
"if",
"(",
"!",
"preg_match",
"(",
"'#[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*#'",
",",
"$",
"targetLanguage",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"... | Set the target language for this file.
@param string $targetLanguage The language code from ISO 639-1.
@return void
@throws \InvalidArgumentException When the language string is invalid. | [
"Set",
"the",
"target",
"language",
"for",
"this",
"file",
"."
] | 9d03f85a33c8f6fc9acd99770f23800679f130b3 | https://github.com/cyberspectrum/i18n-xliff/blob/9d03f85a33c8f6fc9acd99770f23800679f130b3/src/Xml/XliffFile.php#L189-L195 |
10,632 | cyberspectrum/i18n-xliff | src/Xml/XliffFile.php | XliffFile.createTranslationUnit | public function createTranslationUnit(string $identifier, string $sourceValue = null): XmlElement
{
if (null === $body = $this->getXPathFirstItem('/xlf:xliff/xlf:file/xlf:body')) {
throw new \InvalidArgumentException('Could not find the xliff body element');
}
/** @var XmlElemen... | php | public function createTranslationUnit(string $identifier, string $sourceValue = null): XmlElement
{
if (null === $body = $this->getXPathFirstItem('/xlf:xliff/xlf:file/xlf:body')) {
throw new \InvalidArgumentException('Could not find the xliff body element');
}
/** @var XmlElemen... | [
"public",
"function",
"createTranslationUnit",
"(",
"string",
"$",
"identifier",
",",
"string",
"$",
"sourceValue",
"=",
"null",
")",
":",
"XmlElement",
"{",
"if",
"(",
"null",
"===",
"$",
"body",
"=",
"$",
"this",
"->",
"getXPathFirstItem",
"(",
"'/xlf:xlif... | Append a translation unit.
@param string $identifier The identifier to set.
@param string $sourceValue The content for the source value to set.
@return XmlElement
@throws \InvalidArgumentException When the body element can not be found. | [
"Append",
"a",
"translation",
"unit",
"."
] | 9d03f85a33c8f6fc9acd99770f23800679f130b3 | https://github.com/cyberspectrum/i18n-xliff/blob/9d03f85a33c8f6fc9acd99770f23800679f130b3/src/Xml/XliffFile.php#L253-L271 |
10,633 | cyberspectrum/i18n-xliff | src/Xml/XliffFile.php | XliffFile.extractTranslationKeys | public function extractTranslationKeys(): \Generator
{
/** @var \DOMNodeList $tmp */
$transUnits = $this->getXPath()->query('/xlf:xliff/xlf:file/xlf:body/xlf:trans-unit');
if ($transUnits->length > 0) {
/** @var \DOMElement $element */
foreach ($transUnits as $elemen... | php | public function extractTranslationKeys(): \Generator
{
/** @var \DOMNodeList $tmp */
$transUnits = $this->getXPath()->query('/xlf:xliff/xlf:file/xlf:body/xlf:trans-unit');
if ($transUnits->length > 0) {
/** @var \DOMElement $element */
foreach ($transUnits as $elemen... | [
"public",
"function",
"extractTranslationKeys",
"(",
")",
":",
"\\",
"Generator",
"{",
"/** @var \\DOMNodeList $tmp */",
"$",
"transUnits",
"=",
"$",
"this",
"->",
"getXPath",
"(",
")",
"->",
"query",
"(",
"'/xlf:xliff/xlf:file/xlf:body/xlf:trans-unit'",
")",
";",
"... | Obtain all keys within the dictionary.
@return \Generator
@throws \RuntimeException When the id is empty. | [
"Obtain",
"all",
"keys",
"within",
"the",
"dictionary",
"."
] | 9d03f85a33c8f6fc9acd99770f23800679f130b3 | https://github.com/cyberspectrum/i18n-xliff/blob/9d03f85a33c8f6fc9acd99770f23800679f130b3/src/Xml/XliffFile.php#L280-L294 |
10,634 | cyberspectrum/i18n-xliff | src/Xml/XliffFile.php | XliffFile.getXPathFirstItem | private function getXPathFirstItem($query, $contextNode = null)
{
/** @var \DOMNodeList $tmp */
$tmp = $this->getXPath()->query($query, $contextNode);
return $tmp->length ? $tmp->item(0) : null;
} | php | private function getXPathFirstItem($query, $contextNode = null)
{
/** @var \DOMNodeList $tmp */
$tmp = $this->getXPath()->query($query, $contextNode);
return $tmp->length ? $tmp->item(0) : null;
} | [
"private",
"function",
"getXPathFirstItem",
"(",
"$",
"query",
",",
"$",
"contextNode",
"=",
"null",
")",
"{",
"/** @var \\DOMNodeList $tmp */",
"$",
"tmp",
"=",
"$",
"this",
"->",
"getXPath",
"(",
")",
"->",
"query",
"(",
"$",
"query",
",",
"$",
"contextN... | Perform a Xpath search with the given query and return the first match if found.
@param string $query The query to use.
@param null $contextNode The context node to apply.
@return \DOMElement|\DOMNode|null | [
"Perform",
"a",
"Xpath",
"search",
"with",
"the",
"given",
"query",
"and",
"return",
"the",
"first",
"match",
"if",
"found",
"."
] | 9d03f85a33c8f6fc9acd99770f23800679f130b3 | https://github.com/cyberspectrum/i18n-xliff/blob/9d03f85a33c8f6fc9acd99770f23800679f130b3/src/Xml/XliffFile.php#L317-L323 |
10,635 | MinyFramework/Miny-Templating | src/Module.php | Module.setupEnvironment | public function setupEnvironment(Container $container)
{
$env = new Environment(
$container->get('Minty\\AbstractTemplateLoader'),
$this->getConfiguration('options')
);
/** @var $request \Miny\HTTP\Request */
$request = $container->get('Miny\\HTTP\\Request');... | php | public function setupEnvironment(Container $container)
{
$env = new Environment(
$container->get('Minty\\AbstractTemplateLoader'),
$this->getConfiguration('options')
);
/** @var $request \Miny\HTTP\Request */
$request = $container->get('Miny\\HTTP\\Request');... | [
"public",
"function",
"setupEnvironment",
"(",
"Container",
"$",
"container",
")",
"{",
"$",
"env",
"=",
"new",
"Environment",
"(",
"$",
"container",
"->",
"get",
"(",
"'Minty\\\\AbstractTemplateLoader'",
")",
",",
"$",
"this",
"->",
"getConfiguration",
"(",
"... | This method is responsible for initializing the Environment. Called by Container.
@param Container $container
@return Environment | [
"This",
"method",
"is",
"responsible",
"for",
"initializing",
"the",
"Environment",
".",
"Called",
"by",
"Container",
"."
] | bdd5dc2956a8e009cedc18745f5c4f498941a591 | https://github.com/MinyFramework/Miny-Templating/blob/bdd5dc2956a8e009cedc18745f5c4f498941a591/src/Module.php#L68-L94 |
10,636 | atelierspierrot/validators | src/Validator/EmailValidator.php | EmailValidator.validateLocalPart | public function validateLocalPart($value, $send_errors=false)
{
// check for local part length compliance (max 64 chars.)
$lengthValidator = new StringLengthValidator(0, 64);
try {
if (false===$local_length_valid = $lengthValidator->validate($value, false)) {
if (... | php | public function validateLocalPart($value, $send_errors=false)
{
// check for local part length compliance (max 64 chars.)
$lengthValidator = new StringLengthValidator(0, 64);
try {
if (false===$local_length_valid = $lengthValidator->validate($value, false)) {
if (... | [
"public",
"function",
"validateLocalPart",
"(",
"$",
"value",
",",
"$",
"send_errors",
"=",
"false",
")",
"{",
"// check for local part length compliance (max 64 chars.)",
"$",
"lengthValidator",
"=",
"new",
"StringLengthValidator",
"(",
"0",
",",
"64",
")",
";",
"t... | Process local part validation
@param string $value The local part of an email address to validate
@param bool $send_errors Does the function must throw exceptions on validation failures ?
@return bool TRUE if `$value` pass the Email validation
@throws \Exception for each invalid part if `$send... | [
"Process",
"local",
"part",
"validation"
] | 6c97b10bfe8324b33771f24cee8c722d7bc3bb15 | https://github.com/atelierspierrot/validators/blob/6c97b10bfe8324b33771f24cee8c722d7bc3bb15/src/Validator/EmailValidator.php#L129-L190 |
10,637 | atelierspierrot/validators | src/Validator/EmailValidator.php | EmailValidator.validateDomainPart | public function validateDomainPart($value, $send_errors = false)
{
// the domain name must be an IP address between brackets ...
if (
substr($value, 0, 1)=='[' &&
substr($value, -1, 1)==']'
) {
$ip_domain_part = substr($value, 1, strlen($value)-2);
... | php | public function validateDomainPart($value, $send_errors = false)
{
// the domain name must be an IP address between brackets ...
if (
substr($value, 0, 1)=='[' &&
substr($value, -1, 1)==']'
) {
$ip_domain_part = substr($value, 1, strlen($value)-2);
... | [
"public",
"function",
"validateDomainPart",
"(",
"$",
"value",
",",
"$",
"send_errors",
"=",
"false",
")",
"{",
"// the domain name must be an IP address between brackets ...",
"if",
"(",
"substr",
"(",
"$",
"value",
",",
"0",
",",
"1",
")",
"==",
"'['",
"&&",
... | Process domain part validation
@param string $value The domain part of an email address to validate
@param bool $send_errors Does the function must throw exceptions on validation failures ?
@return bool TRUE if $value pass the Email validation
@throws \Exception for each invalid part if `$send_errors` is ... | [
"Process",
"domain",
"part",
"validation"
] | 6c97b10bfe8324b33771f24cee8c722d7bc3bb15 | https://github.com/atelierspierrot/validators/blob/6c97b10bfe8324b33771f24cee8c722d7bc3bb15/src/Validator/EmailValidator.php#L200-L245 |
10,638 | chipaau/support | src/Support/Illuminate/Database/SeederTrait.php | SeederTrait.getForeignKeyCheck | protected function getForeignKeyCheck($enable = true)
{
$default = Config::get('database.default');
switch ($default) {
case 'sqlite':
$string = 'PRAGMA foreign_keys = ' . ($enable ? 'ON' : 'OFF');
break;
default:
$string = 'SET... | php | protected function getForeignKeyCheck($enable = true)
{
$default = Config::get('database.default');
switch ($default) {
case 'sqlite':
$string = 'PRAGMA foreign_keys = ' . ($enable ? 'ON' : 'OFF');
break;
default:
$string = 'SET... | [
"protected",
"function",
"getForeignKeyCheck",
"(",
"$",
"enable",
"=",
"true",
")",
"{",
"$",
"default",
"=",
"Config",
"::",
"get",
"(",
"'database.default'",
")",
";",
"switch",
"(",
"$",
"default",
")",
"{",
"case",
"'sqlite'",
":",
"$",
"string",
"=... | enable and disable foreign key constraints
@param boolean $enable [description]
@return string db statement | [
"enable",
"and",
"disable",
"foreign",
"key",
"constraints"
] | 2fe3673ed2330bd064d37b2f0bac3e02ca110bef | https://github.com/chipaau/support/blob/2fe3673ed2330bd064d37b2f0bac3e02ca110bef/src/Support/Illuminate/Database/SeederTrait.php#L19-L31 |
10,639 | chipaau/support | src/Support/Illuminate/Database/SeederTrait.php | SeederTrait.cleanDatabase | protected function cleanDatabase(array $tables)
{
DB::statement($this->getForeignKeyCheck(false));
foreach ($tables as $table) {
if (Schema::hasTable($table)) {
DB::table($table)->truncate();
}
}
DB::statement($this->getForeignKeyCheck(true));
... | php | protected function cleanDatabase(array $tables)
{
DB::statement($this->getForeignKeyCheck(false));
foreach ($tables as $table) {
if (Schema::hasTable($table)) {
DB::table($table)->truncate();
}
}
DB::statement($this->getForeignKeyCheck(true));
... | [
"protected",
"function",
"cleanDatabase",
"(",
"array",
"$",
"tables",
")",
"{",
"DB",
"::",
"statement",
"(",
"$",
"this",
"->",
"getForeignKeyCheck",
"(",
"false",
")",
")",
";",
"foreach",
"(",
"$",
"tables",
"as",
"$",
"table",
")",
"{",
"if",
"(",... | cleaning process of tables
@return [type] [description] | [
"cleaning",
"process",
"of",
"tables"
] | 2fe3673ed2330bd064d37b2f0bac3e02ca110bef | https://github.com/chipaau/support/blob/2fe3673ed2330bd064d37b2f0bac3e02ca110bef/src/Support/Illuminate/Database/SeederTrait.php#L37-L46 |
10,640 | Dhii/expression-renderer-abstract | src/DelegateRenderTermCapableTrait.php | DelegateRenderTermCapableTrait._delegateRenderTerm | protected function _delegateRenderTerm(TermInterface $term, $context = null)
{
try {
$childCtx = $context;
$childCtx[ExprCtx::K_EXPRESSION] = $term;
return $this->_getTermDelegateRenderer($term, $context)
->render($childCtx);
} catch (OutO... | php | protected function _delegateRenderTerm(TermInterface $term, $context = null)
{
try {
$childCtx = $context;
$childCtx[ExprCtx::K_EXPRESSION] = $term;
return $this->_getTermDelegateRenderer($term, $context)
->render($childCtx);
} catch (OutO... | [
"protected",
"function",
"_delegateRenderTerm",
"(",
"TermInterface",
"$",
"term",
",",
"$",
"context",
"=",
"null",
")",
"{",
"try",
"{",
"$",
"childCtx",
"=",
"$",
"context",
";",
"$",
"childCtx",
"[",
"ExprCtx",
"::",
"K_EXPRESSION",
"]",
"=",
"$",
"t... | Delegates the rendering for the given term to another renderer.
@since [*next-version*]
@param TermInterface $term The term to render.
@param array|ArrayAccess|stdClass|ContainerInterface|null $context The context.
@throws RendererExceptionInterface If the renderer enco... | [
"Delegates",
"the",
"rendering",
"for",
"the",
"given",
"term",
"to",
"another",
"renderer",
"."
] | 8c315e1d034b4198a89e0157f045e4a0d6cc8de8 | https://github.com/Dhii/expression-renderer-abstract/blob/8c315e1d034b4198a89e0157f045e4a0d6cc8de8/src/DelegateRenderTermCapableTrait.php#L37-L52 |
10,641 | c0dehulk/package-tools | src/Package/Finder.php | Finder.scanNamespaceForPackages | private function scanNamespaceForPackages(NamespaceInterface $root, PackageInterface $parent = null): Generator
{
foreach ($root->iterateNamespaces() as $namespace) {
yield from $this->loadPackage($namespace, $parent);
}
} | php | private function scanNamespaceForPackages(NamespaceInterface $root, PackageInterface $parent = null): Generator
{
foreach ($root->iterateNamespaces() as $namespace) {
yield from $this->loadPackage($namespace, $parent);
}
} | [
"private",
"function",
"scanNamespaceForPackages",
"(",
"NamespaceInterface",
"$",
"root",
",",
"PackageInterface",
"$",
"parent",
"=",
"null",
")",
":",
"Generator",
"{",
"foreach",
"(",
"$",
"root",
"->",
"iterateNamespaces",
"(",
")",
"as",
"$",
"namespace",
... | Finds all packages in a namespace.
@param NamespaceInterface $root The namespace to search.
@param PackageInterface|null $parent The parent package currently being searched, or null if none.
@return Generator|PackageInterface[] | [
"Finds",
"all",
"packages",
"in",
"a",
"namespace",
"."
] | 786af97eb05179beb468c5575ecfea9f5a139e0b | https://github.com/c0dehulk/package-tools/blob/786af97eb05179beb468c5575ecfea9f5a139e0b/src/Package/Finder.php#L119-L124 |
10,642 | c0dehulk/package-tools | src/Package/Finder.php | Finder.loadPackage | private function loadPackage(NamespaceInterface $namespace, PackageInterface $parent = null): Generator
{
$package = new Package($namespace, $parent);
yield $package;
// Packages can have a single tier of sub-packages. If we don't have a parent, search our namespace for any
// chil... | php | private function loadPackage(NamespaceInterface $namespace, PackageInterface $parent = null): Generator
{
$package = new Package($namespace, $parent);
yield $package;
// Packages can have a single tier of sub-packages. If we don't have a parent, search our namespace for any
// chil... | [
"private",
"function",
"loadPackage",
"(",
"NamespaceInterface",
"$",
"namespace",
",",
"PackageInterface",
"$",
"parent",
"=",
"null",
")",
":",
"Generator",
"{",
"$",
"package",
"=",
"new",
"Package",
"(",
"$",
"namespace",
",",
"$",
"parent",
")",
";",
... | Loads a package from a namespace.
@param NamespaceInterface $namespace The namespace to load the package with.
@param PackageInterface|null $parent This package's parent, implying it is a sub-package. Null if none.
@return Generator|PackageInterface[] | [
"Loads",
"a",
"package",
"from",
"a",
"namespace",
"."
] | 786af97eb05179beb468c5575ecfea9f5a139e0b | https://github.com/c0dehulk/package-tools/blob/786af97eb05179beb468c5575ecfea9f5a139e0b/src/Package/Finder.php#L134-L144 |
10,643 | c0dehulk/package-tools | src/Package/Finder.php | Finder.findSubPackages | private function findSubPackages(PackageInterface $package): Generator
{
$readMes = new \Symfony\Component\Finder\Finder();
$readMes->files()
->in($package->getPaths())
->depth(1)
->name('readme.md');
// If no sub-folders have a readme, there ... | php | private function findSubPackages(PackageInterface $package): Generator
{
$readMes = new \Symfony\Component\Finder\Finder();
$readMes->files()
->in($package->getPaths())
->depth(1)
->name('readme.md');
// If no sub-folders have a readme, there ... | [
"private",
"function",
"findSubPackages",
"(",
"PackageInterface",
"$",
"package",
")",
":",
"Generator",
"{",
"$",
"readMes",
"=",
"new",
"\\",
"Symfony",
"\\",
"Component",
"\\",
"Finder",
"\\",
"Finder",
"(",
")",
";",
"$",
"readMes",
"->",
"files",
"("... | Finds all sub-packages in a package.
@param PackageInterface $package The package to search.
@return Generator|PackageInterface[] | [
"Finds",
"all",
"sub",
"-",
"packages",
"in",
"a",
"package",
"."
] | 786af97eb05179beb468c5575ecfea9f5a139e0b | https://github.com/c0dehulk/package-tools/blob/786af97eb05179beb468c5575ecfea9f5a139e0b/src/Package/Finder.php#L153-L166 |
10,644 | unclecheese/silverstripe-green | code/GreenExtension.php | GreenExtension.DesignModule | public function DesignModule()
{
$module = $this->getModule();
if (!$module) {
return;
}
$module->loadRequirements();
$viewer = SSViewer::fromString($module->getTemplateContents());
return $viewer->process($this->toViewableData());
} | php | public function DesignModule()
{
$module = $this->getModule();
if (!$module) {
return;
}
$module->loadRequirements();
$viewer = SSViewer::fromString($module->getTemplateContents());
return $viewer->process($this->toViewableData());
} | [
"public",
"function",
"DesignModule",
"(",
")",
"{",
"$",
"module",
"=",
"$",
"this",
"->",
"getModule",
"(",
")",
";",
"if",
"(",
"!",
"$",
"module",
")",
"{",
"return",
";",
"}",
"$",
"module",
"->",
"loadRequirements",
"(",
")",
";",
"$",
"viewe... | Renders the design module
@return HTMLText | [
"Renders",
"the",
"design",
"module"
] | 4395dcef5f4efd5a2c67e0bba3ab5cc583e3fdd4 | https://github.com/unclecheese/silverstripe-green/blob/4395dcef5f4efd5a2c67e0bba3ab5cc583e3fdd4/code/GreenExtension.php#L111-L124 |
10,645 | unclecheese/silverstripe-green | code/GreenExtension.php | GreenExtension.getModule | public function getModule()
{
if ($this->owner->DesignModule) {
return Green::inst()->getDesignModule($this->owner->DesignModule);
}
return null;
} | php | public function getModule()
{
if ($this->owner->DesignModule) {
return Green::inst()->getDesignModule($this->owner->DesignModule);
}
return null;
} | [
"public",
"function",
"getModule",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"owner",
"->",
"DesignModule",
")",
"{",
"return",
"Green",
"::",
"inst",
"(",
")",
"->",
"getDesignModule",
"(",
"$",
"this",
"->",
"owner",
"->",
"DesignModule",
")",
";"... | Gets the design module that the DataObject is mapped to
@return DesignModule|null | [
"Gets",
"the",
"design",
"module",
"that",
"the",
"DataObject",
"is",
"mapped",
"to"
] | 4395dcef5f4efd5a2c67e0bba3ab5cc583e3fdd4 | https://github.com/unclecheese/silverstripe-green/blob/4395dcef5f4efd5a2c67e0bba3ab5cc583e3fdd4/code/GreenExtension.php#L148-L155 |
10,646 | webforge-labs/webforge-utils | src/php/Webforge/Common/System/Dir.php | Dir.createTemporary | public static function createTemporary() {
$file = File::createTemporary();
$tempname = $file->getName();
$file->delete();
$dir = $file->getDirectory()->sub($tempname.'/');
$dir->make();
return $dir;
} | php | public static function createTemporary() {
$file = File::createTemporary();
$tempname = $file->getName();
$file->delete();
$dir = $file->getDirectory()->sub($tempname.'/');
$dir->make();
return $dir;
} | [
"public",
"static",
"function",
"createTemporary",
"(",
")",
"{",
"$",
"file",
"=",
"File",
"::",
"createTemporary",
"(",
")",
";",
"$",
"tempname",
"=",
"$",
"file",
"->",
"getName",
"(",
")",
";",
"$",
"file",
"->",
"delete",
"(",
")",
";",
"$",
... | Creates a temporary Directory | [
"Creates",
"a",
"temporary",
"Directory"
] | a476eeec046c22ad91794b0ab9fe15a1d3f92bfc | https://github.com/webforge-labs/webforge-utils/blob/a476eeec046c22ad91794b0ab9fe15a1d3f92bfc/src/php/Webforge/Common/System/Dir.php#L147-L155 |
10,647 | webforge-labs/webforge-utils | src/php/Webforge/Common/System/Dir.php | Dir.wrapWith | public function wrapWith($wrapperName, $driveStyle = NULL) {
$this->wrapper = $wrapperName;
$this->prefix = $this->wrapper.'://'.$this->getOSPrefix(self::UNIX, $driveStyle ?: self::WINDOWS_DRIVE_WINDOWS_STYLE);
return $this;
} | php | public function wrapWith($wrapperName, $driveStyle = NULL) {
$this->wrapper = $wrapperName;
$this->prefix = $this->wrapper.'://'.$this->getOSPrefix(self::UNIX, $driveStyle ?: self::WINDOWS_DRIVE_WINDOWS_STYLE);
return $this;
} | [
"public",
"function",
"wrapWith",
"(",
"$",
"wrapperName",
",",
"$",
"driveStyle",
"=",
"NULL",
")",
"{",
"$",
"this",
"->",
"wrapper",
"=",
"$",
"wrapperName",
";",
"$",
"this",
"->",
"prefix",
"=",
"$",
"this",
"->",
"wrapper",
".",
"'://'",
".",
"... | Wraps the dir with the wrapper and converts windows paths
@param string only the name of the wrapper like file or vfs or phar | [
"Wraps",
"the",
"dir",
"with",
"the",
"wrapper",
"and",
"converts",
"windows",
"paths"
] | a476eeec046c22ad91794b0ab9fe15a1d3f92bfc | https://github.com/webforge-labs/webforge-utils/blob/a476eeec046c22ad91794b0ab9fe15a1d3f92bfc/src/php/Webforge/Common/System/Dir.php#L324-L330 |
10,648 | webforge-labs/webforge-utils | src/php/Webforge/Common/System/Dir.php | Dir.resolvePath | public function resolvePath() {
if (count($this->path) == 0) {
return $this;
}
if ($this->isRelative()) {
/* wir ermitteln das aktuelle working directory und fügen dieses vor unserem bisherigen Pfad hinzu
* den . am anfang brauchen wir nicht wegmachen, das wird nachher normalisiert
... | php | public function resolvePath() {
if (count($this->path) == 0) {
return $this;
}
if ($this->isRelative()) {
/* wir ermitteln das aktuelle working directory und fügen dieses vor unserem bisherigen Pfad hinzu
* den . am anfang brauchen wir nicht wegmachen, das wird nachher normalisiert
... | [
"public",
"function",
"resolvePath",
"(",
")",
"{",
"if",
"(",
"count",
"(",
"$",
"this",
"->",
"path",
")",
"==",
"0",
")",
"{",
"return",
"$",
"this",
";",
"}",
"if",
"(",
"$",
"this",
"->",
"isRelative",
"(",
")",
")",
"{",
"/* wir ermitteln das... | Resolves relative parts of the path an normalizes
if path is relative its resolved to the current working directory
the type of the path of getcwd will be used. So this might change the prefix-type of directory!
if dir is not relative this works like realpath with directories that do not exist
@uses PHP::getcwd()
@ch... | [
"Resolves",
"relative",
"parts",
"of",
"the",
"path",
"an",
"normalizes"
] | a476eeec046c22ad91794b0ab9fe15a1d3f92bfc | https://github.com/webforge-labs/webforge-utils/blob/a476eeec046c22ad91794b0ab9fe15a1d3f92bfc/src/php/Webforge/Common/System/Dir.php#L349-L382 |
10,649 | webforge-labs/webforge-utils | src/php/Webforge/Common/System/Dir.php | Dir.move | public function move(Dir $destination) {
$ret = @rename((string) $this,(string) $destination);
$errInfo = 'Kann Verzeichnis '.$this.' nicht nach '.$destination.' verschieben / umbenennen.';
if (!$ret) {
if ($destination->exists())
throw new Exception($errInfo.' Das Zielverzeichnis existi... | php | public function move(Dir $destination) {
$ret = @rename((string) $this,(string) $destination);
$errInfo = 'Kann Verzeichnis '.$this.' nicht nach '.$destination.' verschieben / umbenennen.';
if (!$ret) {
if ($destination->exists())
throw new Exception($errInfo.' Das Zielverzeichnis existi... | [
"public",
"function",
"move",
"(",
"Dir",
"$",
"destination",
")",
"{",
"$",
"ret",
"=",
"@",
"rename",
"(",
"(",
"string",
")",
"$",
"this",
",",
"(",
"string",
")",
"$",
"destination",
")",
";",
"$",
"errInfo",
"=",
"'Kann Verzeichnis '",
".",
"$",... | Moves the directory and changes its internal state
@param Dir $destination
@chainable | [
"Moves",
"the",
"directory",
"and",
"changes",
"its",
"internal",
"state"
] | a476eeec046c22ad91794b0ab9fe15a1d3f92bfc | https://github.com/webforge-labs/webforge-utils/blob/a476eeec046c22ad91794b0ab9fe15a1d3f92bfc/src/php/Webforge/Common/System/Dir.php#L838-L857 |
10,650 | webforge-labs/webforge-utils | src/php/Webforge/Common/System/Dir.php | Dir.make | public function make($options=NULL) {
if (is_int($options)) {
$parent = ($options & self::PARENT) == self::PARENT;
$assert = ($options & self::ASSERT_EXISTS) == self::ASSERT_EXISTS;
} else {
// legacy option
$parent = (mb_strpos($options,'-p') !== FALSE);
$assert = FALSE;
}
... | php | public function make($options=NULL) {
if (is_int($options)) {
$parent = ($options & self::PARENT) == self::PARENT;
$assert = ($options & self::ASSERT_EXISTS) == self::ASSERT_EXISTS;
} else {
// legacy option
$parent = (mb_strpos($options,'-p') !== FALSE);
$assert = FALSE;
}
... | [
"public",
"function",
"make",
"(",
"$",
"options",
"=",
"NULL",
")",
"{",
"if",
"(",
"is_int",
"(",
"$",
"options",
")",
")",
"{",
"$",
"parent",
"=",
"(",
"$",
"options",
"&",
"self",
"::",
"PARENT",
")",
"==",
"self",
"::",
"PARENT",
";",
"$",
... | Creates the Directory
@param bitmap $options self::PARENT to create the full path of the directory
@chainable | [
"Creates",
"the",
"Directory"
] | a476eeec046c22ad91794b0ab9fe15a1d3f92bfc | https://github.com/webforge-labs/webforge-utils/blob/a476eeec046c22ad91794b0ab9fe15a1d3f92bfc/src/php/Webforge/Common/System/Dir.php#L875-L897 |
10,651 | webforge-labs/webforge-utils | src/php/Webforge/Common/System/Dir.php | Dir.getPath | public function getPath($flags = 0x000000) {
$ds = $this->getDS();
$trail = $flags & self::WITHOUT_TRAILINGSLASH ? '' : $ds;
return $this->prefix.(empty($this->path) ? '' : implode($ds, $this->path).$trail);
} | php | public function getPath($flags = 0x000000) {
$ds = $this->getDS();
$trail = $flags & self::WITHOUT_TRAILINGSLASH ? '' : $ds;
return $this->prefix.(empty($this->path) ? '' : implode($ds, $this->path).$trail);
} | [
"public",
"function",
"getPath",
"(",
"$",
"flags",
"=",
"0x000000",
")",
"{",
"$",
"ds",
"=",
"$",
"this",
"->",
"getDS",
"(",
")",
";",
"$",
"trail",
"=",
"$",
"flags",
"&",
"self",
"::",
"WITHOUT_TRAILINGSLASH",
"?",
"''",
":",
"$",
"ds",
";",
... | Returns the Path as string
the path is returned for the current Operating System
@return string | [
"Returns",
"the",
"Path",
"as",
"string"
] | a476eeec046c22ad91794b0ab9fe15a1d3f92bfc | https://github.com/webforge-labs/webforge-utils/blob/a476eeec046c22ad91794b0ab9fe15a1d3f92bfc/src/php/Webforge/Common/System/Dir.php#L1027-L1033 |
10,652 | webforge-labs/webforge-utils | src/php/Webforge/Common/System/Dir.php | Dir.getOSPath | public function getOSPath($os, $flags = 0x000000) {
$osDS = $this->getOSDS($os, $flags);
return $this->getOSPrefix($os,$flags).(empty($this->path) ? '' : implode($osDS, $this->path).$osDS);
} | php | public function getOSPath($os, $flags = 0x000000) {
$osDS = $this->getOSDS($os, $flags);
return $this->getOSPrefix($os,$flags).(empty($this->path) ? '' : implode($osDS, $this->path).$osDS);
} | [
"public",
"function",
"getOSPath",
"(",
"$",
"os",
",",
"$",
"flags",
"=",
"0x000000",
")",
"{",
"$",
"osDS",
"=",
"$",
"this",
"->",
"getOSDS",
"(",
"$",
"os",
",",
"$",
"flags",
")",
";",
"return",
"$",
"this",
"->",
"getOSPrefix",
"(",
"$",
"o... | Returns the path of the directory converted to specific OS
some edge cases will throw an LogicException because they cannot be converted:
D:\\windows is on unix: /D:/windows/ (like mozilla does it with file://)
/var/local/www/ is on windows??
@return string
@param const $os self::WINDOWS|self::UNIX | [
"Returns",
"the",
"path",
"of",
"the",
"directory",
"converted",
"to",
"specific",
"OS"
] | a476eeec046c22ad91794b0ab9fe15a1d3f92bfc | https://github.com/webforge-labs/webforge-utils/blob/a476eeec046c22ad91794b0ab9fe15a1d3f92bfc/src/php/Webforge/Common/System/Dir.php#L1053-L1057 |
10,653 | webforge-labs/webforge-utils | src/php/Webforge/Common/System/Dir.php | Dir.getOSPrefix | protected function getOSPrefix($os, $flags = 0x000000) {
$letter = NULL;
if ($this->isWindowsDrivePrefix($letter)) {
$osPrefix = '';
if (($flags & self::WINDOWS_WITH_CYGWIN) && $os === self::WINDOWS) {
$osPrefix .= '/cygdrive/'.mb_strtolower($letter).'/';
} else {
if (!($fla... | php | protected function getOSPrefix($os, $flags = 0x000000) {
$letter = NULL;
if ($this->isWindowsDrivePrefix($letter)) {
$osPrefix = '';
if (($flags & self::WINDOWS_WITH_CYGWIN) && $os === self::WINDOWS) {
$osPrefix .= '/cygdrive/'.mb_strtolower($letter).'/';
} else {
if (!($fla... | [
"protected",
"function",
"getOSPrefix",
"(",
"$",
"os",
",",
"$",
"flags",
"=",
"0x000000",
")",
"{",
"$",
"letter",
"=",
"NULL",
";",
"if",
"(",
"$",
"this",
"->",
"isWindowsDrivePrefix",
"(",
"$",
"letter",
")",
")",
"{",
"$",
"osPrefix",
"=",
"''"... | Returns a prefix which is converted to the specific os
if prefix is absolute this ends with a slash or backslash
@return string | [
"Returns",
"a",
"prefix",
"which",
"is",
"converted",
"to",
"the",
"specific",
"os"
] | a476eeec046c22ad91794b0ab9fe15a1d3f92bfc | https://github.com/webforge-labs/webforge-utils/blob/a476eeec046c22ad91794b0ab9fe15a1d3f92bfc/src/php/Webforge/Common/System/Dir.php#L1065-L1087 |
10,654 | webforge-labs/webforge-utils | src/php/Webforge/Common/System/Dir.php | Dir.getOSDS | public function getOSDS($os, $flags = 0x000000) {
return ($this->isWrapped() || $this->isCygwin() || ($flags & self::WINDOWS_WITH_CYGWIN) || $os === self::UNIX) ? '/' : '\\';
} | php | public function getOSDS($os, $flags = 0x000000) {
return ($this->isWrapped() || $this->isCygwin() || ($flags & self::WINDOWS_WITH_CYGWIN) || $os === self::UNIX) ? '/' : '\\';
} | [
"public",
"function",
"getOSDS",
"(",
"$",
"os",
",",
"$",
"flags",
"=",
"0x000000",
")",
"{",
"return",
"(",
"$",
"this",
"->",
"isWrapped",
"(",
")",
"||",
"$",
"this",
"->",
"isCygwin",
"(",
")",
"||",
"(",
"$",
"flags",
"&",
"self",
"::",
"WI... | Returns the DirectorySeperator for a specific operating system
@return \ or / | [
"Returns",
"the",
"DirectorySeperator",
"for",
"a",
"specific",
"operating",
"system"
] | a476eeec046c22ad91794b0ab9fe15a1d3f92bfc | https://github.com/webforge-labs/webforge-utils/blob/a476eeec046c22ad91794b0ab9fe15a1d3f92bfc/src/php/Webforge/Common/System/Dir.php#L1103-L1105 |
10,655 | webforge-labs/webforge-utils | src/php/Webforge/Common/System/Dir.php | Dir.extract | public static function extract($string) {
if (mb_strlen($string) == 0) {
throw new Exception('String ist leer, kann kein Verzeichnis extrahieren');
}
$path = dirname($string).DIRECTORY_SEPARATOR;
try {
$dir = new Dir($path);
} catch (Exception $e) {
throw new Exception('kann k... | php | public static function extract($string) {
if (mb_strlen($string) == 0) {
throw new Exception('String ist leer, kann kein Verzeichnis extrahieren');
}
$path = dirname($string).DIRECTORY_SEPARATOR;
try {
$dir = new Dir($path);
} catch (Exception $e) {
throw new Exception('kann k... | [
"public",
"static",
"function",
"extract",
"(",
"$",
"string",
")",
"{",
"if",
"(",
"mb_strlen",
"(",
"$",
"string",
")",
"==",
"0",
")",
"{",
"throw",
"new",
"Exception",
"(",
"'String ist leer, kann kein Verzeichnis extrahieren'",
")",
";",
"}",
"$",
"path... | Extrahiert das Verzeichnis aus einer Angabe zu einer Datei
@param string $string der zu untersuchende string
@return Dir | [
"Extrahiert",
"das",
"Verzeichnis",
"aus",
"einer",
"Angabe",
"zu",
"einer",
"Datei"
] | a476eeec046c22ad91794b0ab9fe15a1d3f92bfc | https://github.com/webforge-labs/webforge-utils/blob/a476eeec046c22ad91794b0ab9fe15a1d3f92bfc/src/php/Webforge/Common/System/Dir.php#L1214-L1227 |
10,656 | fastdlabs/annotation | src/Parser/ClassParser.php | ClassParser.extendsParents | protected function extendsParents(ReflectionClass $reflectionClass)
{
$annotation = $this->parse($reflectionClass->getDocComment());
$annotation['class'] = $reflectionClass->getName();
array_unshift($this->parentAnnotations, $annotation);
if (false !== $reflectionClass->getParentC... | php | protected function extendsParents(ReflectionClass $reflectionClass)
{
$annotation = $this->parse($reflectionClass->getDocComment());
$annotation['class'] = $reflectionClass->getName();
array_unshift($this->parentAnnotations, $annotation);
if (false !== $reflectionClass->getParentC... | [
"protected",
"function",
"extendsParents",
"(",
"ReflectionClass",
"$",
"reflectionClass",
")",
"{",
"$",
"annotation",
"=",
"$",
"this",
"->",
"parse",
"(",
"$",
"reflectionClass",
"->",
"getDocComment",
"(",
")",
")",
";",
"$",
"annotation",
"[",
"'class'",
... | Recursive reflection.
@param ReflectionClass $reflectionClass
@return void | [
"Recursive",
"reflection",
"."
] | 72f359bd741e935b4afd0a3b94d80bc30500a052 | https://github.com/fastdlabs/annotation/blob/72f359bd741e935b4afd0a3b94d80bc30500a052/src/Parser/ClassParser.php#L87-L98 |
10,657 | fazland/elastica-odm | src/Search/Search.php | Search.count | public function count(): int
{
$collection = $this->documentManager->getCollection($this->documentClass);
return $collection->count($this->query);
} | php | public function count(): int
{
$collection = $this->documentManager->getCollection($this->documentClass);
return $collection->count($this->query);
} | [
"public",
"function",
"count",
"(",
")",
":",
"int",
"{",
"$",
"collection",
"=",
"$",
"this",
"->",
"documentManager",
"->",
"getCollection",
"(",
"$",
"this",
"->",
"documentClass",
")",
";",
"return",
"$",
"collection",
"->",
"count",
"(",
"$",
"this"... | Get the total hits of the current query.
@return int | [
"Get",
"the",
"total",
"hits",
"of",
"the",
"current",
"query",
"."
] | 9d7276ea9ea9103c670f13f889bf59568ff35274 | https://github.com/fazland/elastica-odm/blob/9d7276ea9ea9103c670f13f889bf59568ff35274/src/Search/Search.php#L121-L126 |
10,658 | fazland/elastica-odm | src/Search/Search.php | Search.getIterator | public function getIterator(): \Iterator
{
$hydrator = $this->documentManager->newHydrator($this->hydrationMode);
$query = clone $this->query;
if (! $query->hasParam('_source')) {
/** @var DocumentMetadata $class */
$class = $this->documentManager->getClassMetadata($... | php | public function getIterator(): \Iterator
{
$hydrator = $this->documentManager->newHydrator($this->hydrationMode);
$query = clone $this->query;
if (! $query->hasParam('_source')) {
/** @var DocumentMetadata $class */
$class = $this->documentManager->getClassMetadata($... | [
"public",
"function",
"getIterator",
"(",
")",
":",
"\\",
"Iterator",
"{",
"$",
"hydrator",
"=",
"$",
"this",
"->",
"documentManager",
"->",
"newHydrator",
"(",
"$",
"this",
"->",
"hydrationMode",
")",
";",
"$",
"query",
"=",
"clone",
"$",
"this",
"->",
... | Iterate over the query results.
@return \Iterator | [
"Iterate",
"over",
"the",
"query",
"results",
"."
] | 9d7276ea9ea9103c670f13f889bf59568ff35274 | https://github.com/fazland/elastica-odm/blob/9d7276ea9ea9103c670f13f889bf59568ff35274/src/Search/Search.php#L133-L160 |
10,659 | fazland/elastica-odm | src/Search/Search.php | Search.setSort | public function setSort($fieldName, $order = 'asc'): self
{
if (null !== $fieldName) {
$sort = [];
$fields = is_array($fieldName) ? $fieldName : [$fieldName => $order];
foreach ($fields as $fieldName => $order) {
$sort[] = [$fieldName => $order];
... | php | public function setSort($fieldName, $order = 'asc'): self
{
if (null !== $fieldName) {
$sort = [];
$fields = is_array($fieldName) ? $fieldName : [$fieldName => $order];
foreach ($fields as $fieldName => $order) {
$sort[] = [$fieldName => $order];
... | [
"public",
"function",
"setSort",
"(",
"$",
"fieldName",
",",
"$",
"order",
"=",
"'asc'",
")",
":",
"self",
"{",
"if",
"(",
"null",
"!==",
"$",
"fieldName",
")",
"{",
"$",
"sort",
"=",
"[",
"]",
";",
"$",
"fields",
"=",
"is_array",
"(",
"$",
"fiel... | Sets the sort fields and directions.
@param array|string $fieldName
@param string $order
@return Search | [
"Sets",
"the",
"sort",
"fields",
"and",
"directions",
"."
] | 9d7276ea9ea9103c670f13f889bf59568ff35274 | https://github.com/fazland/elastica-odm/blob/9d7276ea9ea9103c670f13f889bf59568ff35274/src/Search/Search.php#L194-L210 |
10,660 | fazland/elastica-odm | src/Search/Search.php | Search.useResultCache | public function useResultCache(string $cacheKey = null, int $ttl = 0): self
{
if (null === $cacheKey) {
$this->cacheProfile = null;
} else {
$this->cacheProfile = new SearchCacheProfile($cacheKey, $ttl);
}
return $this;
} | php | public function useResultCache(string $cacheKey = null, int $ttl = 0): self
{
if (null === $cacheKey) {
$this->cacheProfile = null;
} else {
$this->cacheProfile = new SearchCacheProfile($cacheKey, $ttl);
}
return $this;
} | [
"public",
"function",
"useResultCache",
"(",
"string",
"$",
"cacheKey",
"=",
"null",
",",
"int",
"$",
"ttl",
"=",
"0",
")",
":",
"self",
"{",
"if",
"(",
"null",
"===",
"$",
"cacheKey",
")",
"{",
"$",
"this",
"->",
"cacheProfile",
"=",
"null",
";",
... | Instructs the executor to use a result cache.
@param string $cacheKey
@param int $ttl
@return $this|self | [
"Instructs",
"the",
"executor",
"to",
"use",
"a",
"result",
"cache",
"."
] | 9d7276ea9ea9103c670f13f889bf59568ff35274 | https://github.com/fazland/elastica-odm/blob/9d7276ea9ea9103c670f13f889bf59568ff35274/src/Search/Search.php#L298-L307 |
10,661 | fazland/elastica-odm | src/Search/Search.php | Search._doExecute | private function _doExecute(Query $query)
{
$collection = $this->documentManager->getCollection($this->documentClass);
if ($this->isScroll()) {
$scroll = $collection->scroll($query);
foreach ($scroll as $resultSet) {
yield $resultSet;
}
}... | php | private function _doExecute(Query $query)
{
$collection = $this->documentManager->getCollection($this->documentClass);
if ($this->isScroll()) {
$scroll = $collection->scroll($query);
foreach ($scroll as $resultSet) {
yield $resultSet;
}
}... | [
"private",
"function",
"_doExecute",
"(",
"Query",
"$",
"query",
")",
"{",
"$",
"collection",
"=",
"$",
"this",
"->",
"documentManager",
"->",
"getCollection",
"(",
"$",
"this",
"->",
"documentClass",
")",
";",
"if",
"(",
"$",
"this",
"->",
"isScroll",
"... | Executes the search action, yield all the result sets.
@param Query $query
@return \Generator|ResultSet[] | [
"Executes",
"the",
"search",
"action",
"yield",
"all",
"the",
"result",
"sets",
"."
] | 9d7276ea9ea9103c670f13f889bf59568ff35274 | https://github.com/fazland/elastica-odm/blob/9d7276ea9ea9103c670f13f889bf59568ff35274/src/Search/Search.php#L326-L339 |
10,662 | fazland/elastica-odm | src/Search/Search.php | Search._doExecuteCached | private function _doExecuteCached(Query $query)
{
if (null !== $resultCache = $this->documentManager->getResultCache()) {
$item = $resultCache->getItem($this->cacheProfile->getCacheKey());
if ($item->isHit()) {
yield from $item->get();
return;
... | php | private function _doExecuteCached(Query $query)
{
if (null !== $resultCache = $this->documentManager->getResultCache()) {
$item = $resultCache->getItem($this->cacheProfile->getCacheKey());
if ($item->isHit()) {
yield from $item->get();
return;
... | [
"private",
"function",
"_doExecuteCached",
"(",
"Query",
"$",
"query",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"resultCache",
"=",
"$",
"this",
"->",
"documentManager",
"->",
"getResultCache",
"(",
")",
")",
"{",
"$",
"item",
"=",
"$",
"resultCache",
"-... | Executes a cached query.
@param Query $query
@return \Generator|ResultSet[] | [
"Executes",
"a",
"cached",
"query",
"."
] | 9d7276ea9ea9103c670f13f889bf59568ff35274 | https://github.com/fazland/elastica-odm/blob/9d7276ea9ea9103c670f13f889bf59568ff35274/src/Search/Search.php#L348-L369 |
10,663 | uthando-cms/uthando-common | src/UthandoCommon/Form/Element/LibPhoneNumberCountryList.php | LibPhoneNumberCountryList.init | public function init()
{
$libPhoneNumber = PhoneNumberUtil::getInstance();
$optionsList = [];
foreach ($libPhoneNumber->getSupportedRegions() as $code) {
$fullTextCountry = \Locale::getDisplayRegion('en_' . $code, 'en');
$optionsList[$code] = $fullTextCountry;
... | php | public function init()
{
$libPhoneNumber = PhoneNumberUtil::getInstance();
$optionsList = [];
foreach ($libPhoneNumber->getSupportedRegions() as $code) {
$fullTextCountry = \Locale::getDisplayRegion('en_' . $code, 'en');
$optionsList[$code] = $fullTextCountry;
... | [
"public",
"function",
"init",
"(",
")",
"{",
"$",
"libPhoneNumber",
"=",
"PhoneNumberUtil",
"::",
"getInstance",
"(",
")",
";",
"$",
"optionsList",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"libPhoneNumber",
"->",
"getSupportedRegions",
"(",
")",
"as",
"$",... | set up option list | [
"set",
"up",
"option",
"list"
] | feb915da5d26b60f536282e1bc3ad5c22e53f485 | https://github.com/uthando-cms/uthando-common/blob/feb915da5d26b60f536282e1bc3ad5c22e53f485/src/UthandoCommon/Form/Element/LibPhoneNumberCountryList.php#L31-L44 |
10,664 | walmsles/event-dispatch | src/EventDispatch/Dispatcher.php | Dispatcher.subscribe | public function subscribe($eventName, $callable, $priority = 0)
{
if (!is_callable($callable)) {
throw new SubscriberNotCallable();
}
$this->eventList[$eventName][$priority][] = $callable;
/*
* Clear cached sorted array
*/
unset($this->sorted[$... | php | public function subscribe($eventName, $callable, $priority = 0)
{
if (!is_callable($callable)) {
throw new SubscriberNotCallable();
}
$this->eventList[$eventName][$priority][] = $callable;
/*
* Clear cached sorted array
*/
unset($this->sorted[$... | [
"public",
"function",
"subscribe",
"(",
"$",
"eventName",
",",
"$",
"callable",
",",
"$",
"priority",
"=",
"0",
")",
"{",
"if",
"(",
"!",
"is_callable",
"(",
"$",
"callable",
")",
")",
"{",
"throw",
"new",
"SubscriberNotCallable",
"(",
")",
";",
"}",
... | Subscribe to an Event with either a closure or callable structure
@param $eventName
@param $callable
@param int $priority - highest number highest priority
@return $this
@throws \EventDispatch\Exception\SubscriberNotCallable | [
"Subscribe",
"to",
"an",
"Event",
"with",
"either",
"a",
"closure",
"or",
"callable",
"structure"
] | 00f1ee2c1b6dc802639eb3e776d6590a23ad93d6 | https://github.com/walmsles/event-dispatch/blob/00f1ee2c1b6dc802639eb3e776d6590a23ad93d6/src/EventDispatch/Dispatcher.php#L43-L57 |
10,665 | walmsles/event-dispatch | src/EventDispatch/Dispatcher.php | Dispatcher.sortSubscribers | public function sortSubscribers($eventName)
{
$this->sorted[$eventName] = array();
if (isset($this->eventList[$eventName])) {
krsort($this->eventList[$eventName]);
$this->sorted[$eventName] = call_user_func_array('array_merge', $this->eventList[$eventName]);
}
... | php | public function sortSubscribers($eventName)
{
$this->sorted[$eventName] = array();
if (isset($this->eventList[$eventName])) {
krsort($this->eventList[$eventName]);
$this->sorted[$eventName] = call_user_func_array('array_merge', $this->eventList[$eventName]);
}
... | [
"public",
"function",
"sortSubscribers",
"(",
"$",
"eventName",
")",
"{",
"$",
"this",
"->",
"sorted",
"[",
"$",
"eventName",
"]",
"=",
"array",
"(",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"eventList",
"[",
"$",
"eventName",
"]",
")",
... | Sort Subscribers in reverse priority order - higher priority first
@param $eventName
@return mixed | [
"Sort",
"Subscribers",
"in",
"reverse",
"priority",
"order",
"-",
"higher",
"priority",
"first"
] | 00f1ee2c1b6dc802639eb3e776d6590a23ad93d6 | https://github.com/walmsles/event-dispatch/blob/00f1ee2c1b6dc802639eb3e776d6590a23ad93d6/src/EventDispatch/Dispatcher.php#L81-L90 |
10,666 | walmsles/event-dispatch | src/EventDispatch/Dispatcher.php | Dispatcher.queue | public function queue($eventName, $payload = array())
{
$me = $this;
$this->subscribe($eventName . self::QUEUE_NAME, function () use ($me, $eventName, $payload) {
return $me->dispatch($eventName, $payload);
});
} | php | public function queue($eventName, $payload = array())
{
$me = $this;
$this->subscribe($eventName . self::QUEUE_NAME, function () use ($me, $eventName, $payload) {
return $me->dispatch($eventName, $payload);
});
} | [
"public",
"function",
"queue",
"(",
"$",
"eventName",
",",
"$",
"payload",
"=",
"array",
"(",
")",
")",
"{",
"$",
"me",
"=",
"$",
"this",
";",
"$",
"this",
"->",
"subscribe",
"(",
"$",
"eventName",
".",
"self",
"::",
"QUEUE_NAME",
",",
"function",
... | Defer dispatching of an event or events until flush is called.
@param $eventName
@param array $payload
@throws \EventDispatch\Exception\SubscriberNotCallable | [
"Defer",
"dispatching",
"of",
"an",
"event",
"or",
"events",
"until",
"flush",
"is",
"called",
"."
] | 00f1ee2c1b6dc802639eb3e776d6590a23ad93d6 | https://github.com/walmsles/event-dispatch/blob/00f1ee2c1b6dc802639eb3e776d6590a23ad93d6/src/EventDispatch/Dispatcher.php#L164-L171 |
10,667 | walmsles/event-dispatch | src/EventDispatch/Dispatcher.php | Dispatcher.flush | public function flush($eventName)
{
$result = $this->dispatch($eventName . self::QUEUE_NAME);
// If result is an array then need to merge or will end up with array of arrays.
if (is_array($result)) {
$result = call_user_func_array('array_merge', $result);
}
retur... | php | public function flush($eventName)
{
$result = $this->dispatch($eventName . self::QUEUE_NAME);
// If result is an array then need to merge or will end up with array of arrays.
if (is_array($result)) {
$result = call_user_func_array('array_merge', $result);
}
retur... | [
"public",
"function",
"flush",
"(",
"$",
"eventName",
")",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"dispatch",
"(",
"$",
"eventName",
".",
"self",
"::",
"QUEUE_NAME",
")",
";",
"// If result is an array then need to merge or will end up with array of arrays.",
"... | Flush Event Queue
@param $eventName | [
"Flush",
"Event",
"Queue"
] | 00f1ee2c1b6dc802639eb3e776d6590a23ad93d6 | https://github.com/walmsles/event-dispatch/blob/00f1ee2c1b6dc802639eb3e776d6590a23ad93d6/src/EventDispatch/Dispatcher.php#L178-L187 |
10,668 | silverorange/Net_Notifier | Net/Notifier/Client.php | Net_Notifier_Client.parseAddress | public function parseAddress($address)
{
$exp = '!^wss?://([\w-.]+?)(?::(\d+))?(/.*)?$!';
$matches = array();
if (!preg_match($exp, $address, $matches)) {
throw new Net_Notifier_ClientException(
sprintf(
'Invalid WebSocket address: %s. Should b... | php | public function parseAddress($address)
{
$exp = '!^wss?://([\w-.]+?)(?::(\d+))?(/.*)?$!';
$matches = array();
if (!preg_match($exp, $address, $matches)) {
throw new Net_Notifier_ClientException(
sprintf(
'Invalid WebSocket address: %s. Should b... | [
"public",
"function",
"parseAddress",
"(",
"$",
"address",
")",
"{",
"$",
"exp",
"=",
"'!^wss?://([\\w-.]+?)(?::(\\d+))?(/.*)?$!'",
";",
"$",
"matches",
"=",
"array",
"(",
")",
";",
"if",
"(",
"!",
"preg_match",
"(",
"$",
"exp",
",",
"$",
"address",
",",
... | Parses a WebSocket address and sets the constituent parts for this
client
A WebSocket address looks like 'ws://hostname:port/resource-name'. If
present, the host, port and resource of this client are set from the
parsed values.
@param string $address the address to parse.
@return Net_Notifier_Client the current obje... | [
"Parses",
"a",
"WebSocket",
"address",
"and",
"sets",
"the",
"constituent",
"parts",
"for",
"this",
"client"
] | b446e27cd1bebd58ba89243cde1272c5d281d3fb | https://github.com/silverorange/Net_Notifier/blob/b446e27cd1bebd58ba89243cde1272c5d281d3fb/Net/Notifier/Client.php#L166-L193 |
10,669 | silverorange/Net_Notifier | Net/Notifier/Client.php | Net_Notifier_Client.connect | protected function connect()
{
$this->socket = new Net_Notifier_Socket_Client(
sprintf(
'tcp://%s:%s',
$this->host,
$this->port
),
$this->timeout / 1000
);
$this->connection = new Net_Notifier_WebSocket_Conn... | php | protected function connect()
{
$this->socket = new Net_Notifier_Socket_Client(
sprintf(
'tcp://%s:%s',
$this->host,
$this->port
),
$this->timeout / 1000
);
$this->connection = new Net_Notifier_WebSocket_Conn... | [
"protected",
"function",
"connect",
"(",
")",
"{",
"$",
"this",
"->",
"socket",
"=",
"new",
"Net_Notifier_Socket_Client",
"(",
"sprintf",
"(",
"'tcp://%s:%s'",
",",
"$",
"this",
"->",
"host",
",",
"$",
"this",
"->",
"port",
")",
",",
"$",
"this",
"->",
... | Connects this client to the cha-ching server
A socket connection is opened and the WebSocket handshake is initiated.
@return void
@throws Net_Notifier_ClientException if there is an error connecting to
the notification server. | [
"Connects",
"this",
"client",
"to",
"the",
"cha",
"-",
"ching",
"server"
] | b446e27cd1bebd58ba89243cde1272c5d281d3fb | https://github.com/silverorange/Net_Notifier/blob/b446e27cd1bebd58ba89243cde1272c5d281d3fb/Net/Notifier/Client.php#L272-L313 |
10,670 | silverorange/Net_Notifier | Net/Notifier/Client.php | Net_Notifier_Client.disconnect | protected function disconnect()
{
// Initiate connection close. The WebSockets RFC recomends against
// clients initiating the close handshake but we want to ensure the
// connection is closed as soon as possible.
$this->connection->startClose(
Net_Notifier_WebSocket_Conn... | php | protected function disconnect()
{
// Initiate connection close. The WebSockets RFC recomends against
// clients initiating the close handshake but we want to ensure the
// connection is closed as soon as possible.
$this->connection->startClose(
Net_Notifier_WebSocket_Conn... | [
"protected",
"function",
"disconnect",
"(",
")",
"{",
"// Initiate connection close. The WebSockets RFC recomends against",
"// clients initiating the close handshake but we want to ensure the",
"// connection is closed as soon as possible.",
"$",
"this",
"->",
"connection",
"->",
"start... | Disconnects this client from the server
@return void | [
"Disconnects",
"this",
"client",
"from",
"the",
"server"
] | b446e27cd1bebd58ba89243cde1272c5d281d3fb | https://github.com/silverorange/Net_Notifier/blob/b446e27cd1bebd58ba89243cde1272c5d281d3fb/Net/Notifier/Client.php#L323-L361 |
10,671 | Erebot/Styling | src/Styling.php | Styling.getClass | public function getClass($type)
{
if (!isset($this->cls[$type])) {
throw new \InvalidArgumentException('Invalid type');
}
return $this->cls[$type];
} | php | public function getClass($type)
{
if (!isset($this->cls[$type])) {
throw new \InvalidArgumentException('Invalid type');
}
return $this->cls[$type];
} | [
"public",
"function",
"getClass",
"(",
"$",
"type",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"cls",
"[",
"$",
"type",
"]",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"'Invalid type'",
")",
";",
"}",
"retur... | Returns the class used to wrap scalar types.
\param string $type
Name of a scalar type that can be wrapped
by this class automatically. Must be one
of "int", "string" or "float".
\retval string
Name of the class that can be used to wrap
variables of the given type. | [
"Returns",
"the",
"class",
"used",
"to",
"wrap",
"scalar",
"types",
"."
] | e7340a98e89b15f2596a08683ad17fe2e6a85d30 | https://github.com/Erebot/Styling/blob/e7340a98e89b15f2596a08683ad17fe2e6a85d30/src/Styling.php#L150-L156 |
10,672 | Erebot/Styling | src/Styling.php | Styling.setClass | public function setClass($type, $cls)
{
if (!isset($this->cls[$type])) {
throw new \InvalidArgumentException('Invalid type');
}
if (!is_string($cls)) {
throw new \InvalidArgumentException(
'Expected a string for the class'
);
}
... | php | public function setClass($type, $cls)
{
if (!isset($this->cls[$type])) {
throw new \InvalidArgumentException('Invalid type');
}
if (!is_string($cls)) {
throw new \InvalidArgumentException(
'Expected a string for the class'
);
}
... | [
"public",
"function",
"setClass",
"(",
"$",
"type",
",",
"$",
"cls",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"cls",
"[",
"$",
"type",
"]",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"'Invalid type'",
")",... | Sets the class to use to wrap a certain scalar type.
\param string $type
Name of a scalar type that can be wrapped
by this class automatically. Must be one
of "int", "string" or "float".
\param string $cls
Name of the class that can be used to wrap
variables of the given type. | [
"Sets",
"the",
"class",
"to",
"use",
"to",
"wrap",
"a",
"certain",
"scalar",
"type",
"."
] | e7340a98e89b15f2596a08683ad17fe2e6a85d30 | https://github.com/Erebot/Styling/blob/e7340a98e89b15f2596a08683ad17fe2e6a85d30/src/Styling.php#L170-L189 |
10,673 | Erebot/Styling | src/Styling.php | Styling.wrapScalar | protected function wrapScalar($var, $name)
{
self::checkVariableName($name);
if (is_object($var)) {
if ($var instanceof \Erebot\Styling\VariableInterface) {
return $var;
}
if (!is_callable(array($var, '__toString'), false)) {
thro... | php | protected function wrapScalar($var, $name)
{
self::checkVariableName($name);
if (is_object($var)) {
if ($var instanceof \Erebot\Styling\VariableInterface) {
return $var;
}
if (!is_callable(array($var, '__toString'), false)) {
thro... | [
"protected",
"function",
"wrapScalar",
"(",
"$",
"var",
",",
"$",
"name",
")",
"{",
"self",
"::",
"checkVariableName",
"(",
"$",
"name",
")",
";",
"if",
"(",
"is_object",
"(",
"$",
"var",
")",
")",
"{",
"if",
"(",
"$",
"var",
"instanceof",
"\\",
"E... | Wraps a scalar into the appropriate
styling object.
\param mixed $var
Either a scalar, an array or an object implementing
the ::Erebot::Styling::VariableInterface interface.
Scalar values will be wrapped with the appropriate
object while arrays and objects are returned untouched.
\param string $name
Name of given var... | [
"Wraps",
"a",
"scalar",
"into",
"the",
"appropriate",
"styling",
"object",
"."
] | e7340a98e89b15f2596a08683ad17fe2e6a85d30 | https://github.com/Erebot/Styling/blob/e7340a98e89b15f2596a08683ad17fe2e6a85d30/src/Styling.php#L304-L337 |
10,674 | Erebot/Styling | src/Styling.php | Styling.parseTemplate | protected static function parseTemplate($source)
{
$source =
'<msg xmlns="http://www.erebot.net/xmlns/erebot/styling">'.
$source.
'</msg>';
$schema = dirname(__DIR__) .
DIRECTORY_SEPARATOR . 'data' .
DIRECTORY_SEPARATOR . 's... | php | protected static function parseTemplate($source)
{
$source =
'<msg xmlns="http://www.erebot.net/xmlns/erebot/styling">'.
$source.
'</msg>';
$schema = dirname(__DIR__) .
DIRECTORY_SEPARATOR . 'data' .
DIRECTORY_SEPARATOR . 's... | [
"protected",
"static",
"function",
"parseTemplate",
"(",
"$",
"source",
")",
"{",
"$",
"source",
"=",
"'<msg xmlns=\"http://www.erebot.net/xmlns/erebot/styling\">'",
".",
"$",
"source",
".",
"'</msg>'",
";",
"$",
"schema",
"=",
"dirname",
"(",
"__DIR__",
")",
".",... | Parses a template into a DOM.
\param string $source
Template to parse.
\retval Erebot::DOM
DOM object constructed
from the template.
\throw ::InvalidArgumentException
The template was malformed
or invalid. | [
"Parses",
"a",
"template",
"into",
"a",
"DOM",
"."
] | e7340a98e89b15f2596a08683ad17fe2e6a85d30 | https://github.com/Erebot/Styling/blob/e7340a98e89b15f2596a08683ad17fe2e6a85d30/src/Styling.php#L353-L384 |
10,675 | Erebot/Styling | src/Styling.php | Styling.parseChildren | private function parseChildren($node, &$attributes, $vars)
{
$result = '';
for ($child = $node->firstChild; $child != null; $child = $child->nextSibling) {
$result .= $this->parseNode($child, $attributes, $vars);
}
return $result;
} | php | private function parseChildren($node, &$attributes, $vars)
{
$result = '';
for ($child = $node->firstChild; $child != null; $child = $child->nextSibling) {
$result .= $this->parseNode($child, $attributes, $vars);
}
return $result;
} | [
"private",
"function",
"parseChildren",
"(",
"$",
"node",
",",
"&",
"$",
"attributes",
",",
"$",
"vars",
")",
"{",
"$",
"result",
"=",
"''",
";",
"for",
"(",
"$",
"child",
"=",
"$",
"node",
"->",
"firstChild",
";",
"$",
"child",
"!=",
"null",
";",
... | This method is used to apply the parsing method
to children of an XML node.
\param DOMNode $node
The node being parsed.
\param array $attributes
Array of styling attributes.
\param array $vars
Template variables that can be injected in the result.
\retval string
Parsing result, with styles applied as appropriate. | [
"This",
"method",
"is",
"used",
"to",
"apply",
"the",
"parsing",
"method",
"to",
"children",
"of",
"an",
"XML",
"node",
"."
] | e7340a98e89b15f2596a08683ad17fe2e6a85d30 | https://github.com/Erebot/Styling/blob/e7340a98e89b15f2596a08683ad17fe2e6a85d30/src/Styling.php#L650-L657 |
10,676 | bishopb/vanilla | library/core/class.statistics.php | Gdn_Statistics.BasicParameters | public function BasicParameters(&$Request) {
$Request = array_merge($Request, array(
'ServerHostname' => Url('/', TRUE),
'ServerType' => Gdn::Request()->GetValue('SERVER_SOFTWARE'),
'PHPVersion' => phpversion(),
'VanillaVersion' => APPLICATION_VERSION
));
} | php | public function BasicParameters(&$Request) {
$Request = array_merge($Request, array(
'ServerHostname' => Url('/', TRUE),
'ServerType' => Gdn::Request()->GetValue('SERVER_SOFTWARE'),
'PHPVersion' => phpversion(),
'VanillaVersion' => APPLICATION_VERSION
));
} | [
"public",
"function",
"BasicParameters",
"(",
"&",
"$",
"Request",
")",
"{",
"$",
"Request",
"=",
"array_merge",
"(",
"$",
"Request",
",",
"array",
"(",
"'ServerHostname'",
"=>",
"Url",
"(",
"'/'",
",",
"TRUE",
")",
",",
"'ServerType'",
"=>",
"Gdn",
"::"... | Automatically configures a ProxyRequest array with basic parameters
such as IP, VanillaVersion, RequestTime, Hostname, PHPVersion, ServerType.
@param array $Request Reference to the existing request array
@return void | [
"Automatically",
"configures",
"a",
"ProxyRequest",
"array",
"with",
"basic",
"parameters",
"such",
"as",
"IP",
"VanillaVersion",
"RequestTime",
"Hostname",
"PHPVersion",
"ServerType",
"."
] | 8494eb4a4ad61603479015a8054d23ff488364e8 | https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/library/core/class.statistics.php#L121-L128 |
10,677 | bishopb/vanilla | library/core/class.statistics.php | Gdn_Statistics.Check | public function Check() {
// If we're hitting an exception app, short circuit here
if (!self::CheckIsAllowed()) {
return;
}
Gdn::Controller()->AddDefinition('AnalyticsTask', 'tick');
if (self::CheckIsEnabled()) {
// At this point there is nothing preventing stats f... | php | public function Check() {
// If we're hitting an exception app, short circuit here
if (!self::CheckIsAllowed()) {
return;
}
Gdn::Controller()->AddDefinition('AnalyticsTask', 'tick');
if (self::CheckIsEnabled()) {
// At this point there is nothing preventing stats f... | [
"public",
"function",
"Check",
"(",
")",
"{",
"// If we're hitting an exception app, short circuit here",
"if",
"(",
"!",
"self",
"::",
"CheckIsAllowed",
"(",
")",
")",
"{",
"return",
";",
"}",
"Gdn",
"::",
"Controller",
"(",
")",
"->",
"AddDefinition",
"(",
"... | This method is called each page request and checks the environment. If
a stats send is warranted, tells the browser to ping us back.
If the site is not registered at the analytics server (does not contain
a guid), have the browser request a register instead and defer stats until
next request.
@return void | [
"This",
"method",
"is",
"called",
"each",
"page",
"request",
"and",
"checks",
"the",
"environment",
".",
"If",
"a",
"stats",
"send",
"is",
"warranted",
"tells",
"the",
"browser",
"to",
"ping",
"us",
"back",
"."
] | 8494eb4a4ad61603479015a8054d23ff488364e8 | https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/library/core/class.statistics.php#L140-L151 |
10,678 | bishopb/vanilla | library/core/class.statistics.php | Gdn_Statistics.Sign | public function Sign(&$Request, $Modify = FALSE) {
// Fail if no ID is present
$VanillaID = GetValue('VanillaID', $Request, FALSE);
if (empty($VanillaID))
return FALSE;
if ($VanillaID != Gdn::InstallationID()) return FALSE;
// We're going to work on a copy for now
$... | php | public function Sign(&$Request, $Modify = FALSE) {
// Fail if no ID is present
$VanillaID = GetValue('VanillaID', $Request, FALSE);
if (empty($VanillaID))
return FALSE;
if ($VanillaID != Gdn::InstallationID()) return FALSE;
// We're going to work on a copy for now
$... | [
"public",
"function",
"Sign",
"(",
"&",
"$",
"Request",
",",
"$",
"Modify",
"=",
"FALSE",
")",
"{",
"// Fail if no ID is present",
"$",
"VanillaID",
"=",
"GetValue",
"(",
"'VanillaID'",
",",
"$",
"Request",
",",
"FALSE",
")",
";",
"if",
"(",
"empty",
"("... | Sign a request or response
Uses the known site secret to sign the given request or response. The
request/response is passed in by reference so that it can be augmented
with the signature.
@param array $Request The request array to be signed
@param boolean $Modify Optional whether or not to modify the request in place... | [
"Sign",
"a",
"request",
"or",
"response"
] | 8494eb4a4ad61603479015a8054d23ff488364e8 | https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/library/core/class.statistics.php#L407-L452 |
10,679 | bishopb/vanilla | library/core/class.statistics.php | Gdn_Statistics.Tick | public function Tick() {
// Fire an event for plugins to track their own stats.
// TODO: Make this analyze the path and throw a specific event (this event will change in future versions).
$this->EventArguments['Path'] = Gdn::Request()->Post('Path');
$this->FireEvent('Tick');
// Stor... | php | public function Tick() {
// Fire an event for plugins to track their own stats.
// TODO: Make this analyze the path and throw a specific event (this event will change in future versions).
$this->EventArguments['Path'] = Gdn::Request()->Post('Path');
$this->FireEvent('Tick');
// Stor... | [
"public",
"function",
"Tick",
"(",
")",
"{",
"// Fire an event for plugins to track their own stats.",
"// TODO: Make this analyze the path and throw a specific event (this event will change in future versions).",
"$",
"this",
"->",
"EventArguments",
"[",
"'Path'",
"]",
"=",
"Gdn",
... | This is the asynchronous callback
This method is triggerd on every page request via a callback AJAX request
so that it may execute asychronously and reduce lag for users. It tracks
views, handles registration for new installations, and sends stats every
day as needed.
@return void; | [
"This",
"is",
"the",
"asynchronous",
"callback"
] | 8494eb4a4ad61603479015a8054d23ff488364e8 | https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/library/core/class.statistics.php#L591-L644 |
10,680 | bishopb/vanilla | library/core/class.statistics.php | Gdn_Statistics.AddView | public function AddView($ViewType = 'normal') {
// Add a pageview entry.
$TimeSlot = date('Ymd');
$Px = Gdn::Database()->DatabasePrefix;
$Views = 1;
$EmbedViews = 0;
try {
if (C('Garden.Analytics.Views.Denormalize', FALSE) && Gdn::Cache()->ActiveEnabled()) {
... | php | public function AddView($ViewType = 'normal') {
// Add a pageview entry.
$TimeSlot = date('Ymd');
$Px = Gdn::Database()->DatabasePrefix;
$Views = 1;
$EmbedViews = 0;
try {
if (C('Garden.Analytics.Views.Denormalize', FALSE) && Gdn::Cache()->ActiveEnabled()) {
... | [
"public",
"function",
"AddView",
"(",
"$",
"ViewType",
"=",
"'normal'",
")",
"{",
"// Add a pageview entry.",
"$",
"TimeSlot",
"=",
"date",
"(",
"'Ymd'",
")",
";",
"$",
"Px",
"=",
"Gdn",
"::",
"Database",
"(",
")",
"->",
"DatabasePrefix",
";",
"$",
"View... | Increments overall pageview view count
@since 2.1a
@access public | [
"Increments",
"overall",
"pageview",
"view",
"count"
] | 8494eb4a4ad61603479015a8054d23ff488364e8 | https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/library/core/class.statistics.php#L652-L722 |
10,681 | adrenth/tvrage | lib/Adrenth/Tvrage/Response/Traits/DenormalizesDetailedShow.php | DenormalizesDetailedShow.denormalizeDetailedShow | final protected function denormalizeDetailedShow(array $data)
{
$detailedShow = new DetailedShow();
$referenceMap = [
'showid' => 'setShowId',
'name' => 'setName',
'showname' => 'setName',
'link' => 'setLink',
'image' => 'setImage',
... | php | final protected function denormalizeDetailedShow(array $data)
{
$detailedShow = new DetailedShow();
$referenceMap = [
'showid' => 'setShowId',
'name' => 'setName',
'showname' => 'setName',
'link' => 'setLink',
'image' => 'setImage',
... | [
"final",
"protected",
"function",
"denormalizeDetailedShow",
"(",
"array",
"$",
"data",
")",
"{",
"$",
"detailedShow",
"=",
"new",
"DetailedShow",
"(",
")",
";",
"$",
"referenceMap",
"=",
"[",
"'showid'",
"=>",
"'setShowId'",
",",
"'name'",
"=>",
"'setName'",
... | Denormalize Detailed Show
@param array $data
@return DetailedShow
@throws UnimplementedAttributeException | [
"Denormalize",
"Detailed",
"Show"
] | 291043219e95689f609323f476a25293a53453b0 | https://github.com/adrenth/tvrage/blob/291043219e95689f609323f476a25293a53453b0/lib/Adrenth/Tvrage/Response/Traits/DenormalizesDetailedShow.php#L35-L85 |
10,682 | adrenth/tvrage | lib/Adrenth/Tvrage/Response/Traits/DenormalizesDetailedShow.php | DenormalizesDetailedShow.handleAkas | protected function handleAkas(DetailedShow $show, array $akas)
{
if (!array_key_exists('aka', $akas)) {
return;
}
if (is_string($akas['aka'])) {
$akas['aka'] = [['#' => $akas['aka']]];
}
foreach ($akas['aka'] as $attributes) {
$aka = new ... | php | protected function handleAkas(DetailedShow $show, array $akas)
{
if (!array_key_exists('aka', $akas)) {
return;
}
if (is_string($akas['aka'])) {
$akas['aka'] = [['#' => $akas['aka']]];
}
foreach ($akas['aka'] as $attributes) {
$aka = new ... | [
"protected",
"function",
"handleAkas",
"(",
"DetailedShow",
"$",
"show",
",",
"array",
"$",
"akas",
")",
"{",
"if",
"(",
"!",
"array_key_exists",
"(",
"'aka'",
",",
"$",
"akas",
")",
")",
"{",
"return",
";",
"}",
"if",
"(",
"is_string",
"(",
"$",
"ak... | Handle A.K.A's
@param DetailedShow $show
@param array $akas
@return void | [
"Handle",
"A",
".",
"K",
".",
"A",
"s"
] | 291043219e95689f609323f476a25293a53453b0 | https://github.com/adrenth/tvrage/blob/291043219e95689f609323f476a25293a53453b0/lib/Adrenth/Tvrage/Response/Traits/DenormalizesDetailedShow.php#L94-L125 |
10,683 | phlexible/phlexible | src/Phlexible/Component/MediaType/Model/IconResolver.php | IconResolver.resolve | public function resolve(MediaType $mediaType, $requestedSize = null)
{
$icons = $mediaType->getIcons();
if (!count($icons)) {
return null;
}
ksort($icons);
if (isset($icons[$requestedSize])) {
$icon = $icons[$requestedSize];
} else {
... | php | public function resolve(MediaType $mediaType, $requestedSize = null)
{
$icons = $mediaType->getIcons();
if (!count($icons)) {
return null;
}
ksort($icons);
if (isset($icons[$requestedSize])) {
$icon = $icons[$requestedSize];
} else {
... | [
"public",
"function",
"resolve",
"(",
"MediaType",
"$",
"mediaType",
",",
"$",
"requestedSize",
"=",
"null",
")",
"{",
"$",
"icons",
"=",
"$",
"mediaType",
"->",
"getIcons",
"(",
")",
";",
"if",
"(",
"!",
"count",
"(",
"$",
"icons",
")",
")",
"{",
... | Resolve icon.
@param MediaType $mediaType
@param int $requestedSize
@return string | [
"Resolve",
"icon",
"."
] | 132f24924c9bb0dbb6c1ea84db0a463f97fa3893 | https://github.com/phlexible/phlexible/blob/132f24924c9bb0dbb6c1ea84db0a463f97fa3893/src/Phlexible/Component/MediaType/Model/IconResolver.php#L44-L69 |
10,684 | indigophp/robo-doctrine | src/Task/Doctrine/loadOrmTasks.php | loadOrmTasks.ormClearCacheMetadata | public function ormClearCacheMetadata($opt = ['flush' => false])
{
$validOpts = ['flush'];
$command = new Command\ClearCache\MetadataCommand;
$this->runDoctrineCommand($command, $opt, $validOpts);
} | php | public function ormClearCacheMetadata($opt = ['flush' => false])
{
$validOpts = ['flush'];
$command = new Command\ClearCache\MetadataCommand;
$this->runDoctrineCommand($command, $opt, $validOpts);
} | [
"public",
"function",
"ormClearCacheMetadata",
"(",
"$",
"opt",
"=",
"[",
"'flush'",
"=>",
"false",
"]",
")",
"{",
"$",
"validOpts",
"=",
"[",
"'flush'",
"]",
";",
"$",
"command",
"=",
"new",
"Command",
"\\",
"ClearCache",
"\\",
"MetadataCommand",
";",
"... | Clear all metadata cache of the various cache drivers
@param array $opt
@option $flush If defined, cache entries will be flushed instead of deleted/invalidated | [
"Clear",
"all",
"metadata",
"cache",
"of",
"the",
"various",
"cache",
"drivers"
] | dc7660aba5fd1bf3c3ef945bb4603da91c85bd05 | https://github.com/indigophp/robo-doctrine/blob/dc7660aba5fd1bf3c3ef945bb4603da91c85bd05/src/Task/Doctrine/loadOrmTasks.php#L31-L37 |
10,685 | indigophp/robo-doctrine | src/Task/Doctrine/loadOrmTasks.php | loadOrmTasks.ormClearCacheResult | public function ormClearCacheResult($opt = ['flush' => false])
{
$validOpts = ['flush'];
$command = new Command\ClearCache\ResultCommand;
$this->runDoctrineCommand($command, $opt, $validOpts);
} | php | public function ormClearCacheResult($opt = ['flush' => false])
{
$validOpts = ['flush'];
$command = new Command\ClearCache\ResultCommand;
$this->runDoctrineCommand($command, $opt, $validOpts);
} | [
"public",
"function",
"ormClearCacheResult",
"(",
"$",
"opt",
"=",
"[",
"'flush'",
"=>",
"false",
"]",
")",
"{",
"$",
"validOpts",
"=",
"[",
"'flush'",
"]",
";",
"$",
"command",
"=",
"new",
"Command",
"\\",
"ClearCache",
"\\",
"ResultCommand",
";",
"$",
... | Clear all result cache of the various cache drivers
@param array $opt
@option $flush If defined, cache entries will be flushed instead of deleted/invalidated | [
"Clear",
"all",
"result",
"cache",
"of",
"the",
"various",
"cache",
"drivers"
] | dc7660aba5fd1bf3c3ef945bb4603da91c85bd05 | https://github.com/indigophp/robo-doctrine/blob/dc7660aba5fd1bf3c3ef945bb4603da91c85bd05/src/Task/Doctrine/loadOrmTasks.php#L46-L52 |
10,686 | indigophp/robo-doctrine | src/Task/Doctrine/loadOrmTasks.php | loadOrmTasks.ormClearCacheQuery | public function ormClearCacheQuery($opt = ['flush' => false])
{
$validOpts = ['flush'];
$command = new Command\ClearCache\QueryCommand;
$this->runDoctrineCommand($command, $opt, $validOpts);
} | php | public function ormClearCacheQuery($opt = ['flush' => false])
{
$validOpts = ['flush'];
$command = new Command\ClearCache\QueryCommand;
$this->runDoctrineCommand($command, $opt, $validOpts);
} | [
"public",
"function",
"ormClearCacheQuery",
"(",
"$",
"opt",
"=",
"[",
"'flush'",
"=>",
"false",
"]",
")",
"{",
"$",
"validOpts",
"=",
"[",
"'flush'",
"]",
";",
"$",
"command",
"=",
"new",
"Command",
"\\",
"ClearCache",
"\\",
"QueryCommand",
";",
"$",
... | Clear all query cache of the various cache drivers
@param array $opt
@option $flush If defined, cache entries will be flushed instead of deleted/invalidated | [
"Clear",
"all",
"query",
"cache",
"of",
"the",
"various",
"cache",
"drivers"
] | dc7660aba5fd1bf3c3ef945bb4603da91c85bd05 | https://github.com/indigophp/robo-doctrine/blob/dc7660aba5fd1bf3c3ef945bb4603da91c85bd05/src/Task/Doctrine/loadOrmTasks.php#L61-L67 |
10,687 | indigophp/robo-doctrine | src/Task/Doctrine/loadOrmTasks.php | loadOrmTasks.ormSchemaCreate | public function ormSchemaCreate($opt = ['dump-sql' => false])
{
$validOpts = ['dump-sql'];
$command = new Command\SchemaTool\CreateCommand;
$this->runDoctrineCommand($command, $opt, $validOpts);
} | php | public function ormSchemaCreate($opt = ['dump-sql' => false])
{
$validOpts = ['dump-sql'];
$command = new Command\SchemaTool\CreateCommand;
$this->runDoctrineCommand($command, $opt, $validOpts);
} | [
"public",
"function",
"ormSchemaCreate",
"(",
"$",
"opt",
"=",
"[",
"'dump-sql'",
"=>",
"false",
"]",
")",
"{",
"$",
"validOpts",
"=",
"[",
"'dump-sql'",
"]",
";",
"$",
"command",
"=",
"new",
"Command",
"\\",
"SchemaTool",
"\\",
"CreateCommand",
";",
"$"... | Processes the schema and either create it directly on EntityManager Storage Connection or generate the SQL output
@param array $opt
@option $dump-sql Instead of try to apply generated SQLs into EntityManager Storage Connection, output them | [
"Processes",
"the",
"schema",
"and",
"either",
"create",
"it",
"directly",
"on",
"EntityManager",
"Storage",
"Connection",
"or",
"generate",
"the",
"SQL",
"output"
] | dc7660aba5fd1bf3c3ef945bb4603da91c85bd05 | https://github.com/indigophp/robo-doctrine/blob/dc7660aba5fd1bf3c3ef945bb4603da91c85bd05/src/Task/Doctrine/loadOrmTasks.php#L76-L82 |
10,688 | indigophp/robo-doctrine | src/Task/Doctrine/loadOrmTasks.php | loadOrmTasks.ormSchemaDrop | public function ormSchemaDrop($opt = ['dump-sql' => false, 'force' => false, 'full-database' => false])
{
$validOpts = ['dump-sql', 'force', 'full-database'];
$command = new Command\SchemaTool\DropCommand;
$this->runDoctrineCommand($command, $opt, $validOpts);
} | php | public function ormSchemaDrop($opt = ['dump-sql' => false, 'force' => false, 'full-database' => false])
{
$validOpts = ['dump-sql', 'force', 'full-database'];
$command = new Command\SchemaTool\DropCommand;
$this->runDoctrineCommand($command, $opt, $validOpts);
} | [
"public",
"function",
"ormSchemaDrop",
"(",
"$",
"opt",
"=",
"[",
"'dump-sql'",
"=>",
"false",
",",
"'force'",
"=>",
"false",
",",
"'full-database'",
"=>",
"false",
"]",
")",
"{",
"$",
"validOpts",
"=",
"[",
"'dump-sql'",
",",
"'force'",
",",
"'full-databa... | Drop the complete database schema of EntityManager Storage Connection or generate the corresponding SQL output
@param array $opt
@option $dump-sql Instead of try to apply generated SQLs into EntityManager Storage Connection, output them
@option $force Don't ask for the deletion of the database, but force the opera... | [
"Drop",
"the",
"complete",
"database",
"schema",
"of",
"EntityManager",
"Storage",
"Connection",
"or",
"generate",
"the",
"corresponding",
"SQL",
"output"
] | dc7660aba5fd1bf3c3ef945bb4603da91c85bd05 | https://github.com/indigophp/robo-doctrine/blob/dc7660aba5fd1bf3c3ef945bb4603da91c85bd05/src/Task/Doctrine/loadOrmTasks.php#L110-L116 |
10,689 | indigophp/robo-doctrine | src/Task/Doctrine/loadOrmTasks.php | loadOrmTasks.ormEnsureProductionSettings | public function ormEnsureProductionSettings($opt = ['complete' => false])
{
$validOpts = ['complete'];
$command = new Command\EnsureProductionSettingsCommand;
$this->runDoctrineCommand($command, $opt, $validOpts);
} | php | public function ormEnsureProductionSettings($opt = ['complete' => false])
{
$validOpts = ['complete'];
$command = new Command\EnsureProductionSettingsCommand;
$this->runDoctrineCommand($command, $opt, $validOpts);
} | [
"public",
"function",
"ormEnsureProductionSettings",
"(",
"$",
"opt",
"=",
"[",
"'complete'",
"=>",
"false",
"]",
")",
"{",
"$",
"validOpts",
"=",
"[",
"'complete'",
"]",
";",
"$",
"command",
"=",
"new",
"Command",
"\\",
"EnsureProductionSettingsCommand",
";",... | Verify that Doctrine is properly configured for a production environment
@param array $opt
@option $complete Flag to also inspect database connection existence | [
"Verify",
"that",
"Doctrine",
"is",
"properly",
"configured",
"for",
"a",
"production",
"environment"
] | dc7660aba5fd1bf3c3ef945bb4603da91c85bd05 | https://github.com/indigophp/robo-doctrine/blob/dc7660aba5fd1bf3c3ef945bb4603da91c85bd05/src/Task/Doctrine/loadOrmTasks.php#L125-L131 |
10,690 | indigophp/robo-doctrine | src/Task/Doctrine/loadOrmTasks.php | loadOrmTasks.ormConvertD1Schema | public function ormConvertD1Schema(
$fromPath,
$toType,
$destPath,
$from,
$to,
$opt = ['extend' => null, 'num-spaces' => 4]
) {
$validOpts = ['extend', 'num-spaces'];
$command = new Command\ConvertDoctrine1SchemaCommand;
$arg = [
'... | php | public function ormConvertD1Schema(
$fromPath,
$toType,
$destPath,
$from,
$to,
$opt = ['extend' => null, 'num-spaces' => 4]
) {
$validOpts = ['extend', 'num-spaces'];
$command = new Command\ConvertDoctrine1SchemaCommand;
$arg = [
'... | [
"public",
"function",
"ormConvertD1Schema",
"(",
"$",
"fromPath",
",",
"$",
"toType",
",",
"$",
"destPath",
",",
"$",
"from",
",",
"$",
"to",
",",
"$",
"opt",
"=",
"[",
"'extend'",
"=>",
"null",
",",
"'num-spaces'",
"=>",
"4",
"]",
")",
"{",
"$",
"... | Converts Doctrine 1.X schema into a Doctrine 2.X schema
@param string $fromPath The path of Doctrine 1.X schema information
@param string $toType The destination Doctrine 2.X mapping type
@param string $destPath The path to generate your Doctrine 2.X mapping information
@param array $from Optional paths of Doct... | [
"Converts",
"Doctrine",
"1",
".",
"X",
"schema",
"into",
"a",
"Doctrine",
"2",
".",
"X",
"schema"
] | dc7660aba5fd1bf3c3ef945bb4603da91c85bd05 | https://github.com/indigophp/robo-doctrine/blob/dc7660aba5fd1bf3c3ef945bb4603da91c85bd05/src/Task/Doctrine/loadOrmTasks.php#L145-L165 |
10,691 | indigophp/robo-doctrine | src/Task/Doctrine/loadOrmTasks.php | loadOrmTasks.ormGenerateRepositories | public function ormGenerateRepositories($destPath, $opt = ['filter' => null])
{
$validOpts = ['filter'];
$command = new Command\GenerateRepositoriesCommand;
$arg = [
'dest-path' => $destPath,
];
$this->runDoctrineCommand($command, $opt, $validOpts, $arg);
} | php | public function ormGenerateRepositories($destPath, $opt = ['filter' => null])
{
$validOpts = ['filter'];
$command = new Command\GenerateRepositoriesCommand;
$arg = [
'dest-path' => $destPath,
];
$this->runDoctrineCommand($command, $opt, $validOpts, $arg);
} | [
"public",
"function",
"ormGenerateRepositories",
"(",
"$",
"destPath",
",",
"$",
"opt",
"=",
"[",
"'filter'",
"=>",
"null",
"]",
")",
"{",
"$",
"validOpts",
"=",
"[",
"'filter'",
"]",
";",
"$",
"command",
"=",
"new",
"Command",
"\\",
"GenerateRepositoriesC... | Generate repository classes from your mapping information
@param string $destPath The path to generate your repository classes
@param array $opt
@option $filter A string pattern used to match entities that should be processed | [
"Generate",
"repository",
"classes",
"from",
"your",
"mapping",
"information"
] | dc7660aba5fd1bf3c3ef945bb4603da91c85bd05 | https://github.com/indigophp/robo-doctrine/blob/dc7660aba5fd1bf3c3ef945bb4603da91c85bd05/src/Task/Doctrine/loadOrmTasks.php#L175-L185 |
10,692 | indigophp/robo-doctrine | src/Task/Doctrine/loadOrmTasks.php | loadOrmTasks.ormGenerateEntities | public function ormGenerateEntities(
$destPath,
$opt = [
'filter' => null,
'generate-annotations' => false,
'generate-methods' => true,
'regenerate-entities' => false,
'update-entities' => true,
'extend' ... | php | public function ormGenerateEntities(
$destPath,
$opt = [
'filter' => null,
'generate-annotations' => false,
'generate-methods' => true,
'regenerate-entities' => false,
'update-entities' => true,
'extend' ... | [
"public",
"function",
"ormGenerateEntities",
"(",
"$",
"destPath",
",",
"$",
"opt",
"=",
"[",
"'filter'",
"=>",
"null",
",",
"'generate-annotations'",
"=>",
"false",
",",
"'generate-methods'",
"=>",
"true",
",",
"'regenerate-entities'",
"=>",
"false",
",",
"'upd... | Generate entity classes and method stubs from your mapping information
@param string $destPath The path to generate your repository classes
@param array $opt
@option $filter A string pattern used to match entities that should be processed
@option $generate-annotations Flag to define if generator should... | [
"Generate",
"entity",
"classes",
"and",
"method",
"stubs",
"from",
"your",
"mapping",
"information"
] | dc7660aba5fd1bf3c3ef945bb4603da91c85bd05 | https://github.com/indigophp/robo-doctrine/blob/dc7660aba5fd1bf3c3ef945bb4603da91c85bd05/src/Task/Doctrine/loadOrmTasks.php#L201-L229 |
10,693 | indigophp/robo-doctrine | src/Task/Doctrine/loadOrmTasks.php | loadOrmTasks.ormGenerateProxies | public function ormGenerateProxies($destPath = null, $opt = ['filter' => null])
{
$validOpts = ['filter'];
$command = new Command\GenerateProxiesCommand;
$arg = [
'dest-path' => $destPath,
];
$this->runDoctrineCommand($command, $opt, $validOpts, $arg);
} | php | public function ormGenerateProxies($destPath = null, $opt = ['filter' => null])
{
$validOpts = ['filter'];
$command = new Command\GenerateProxiesCommand;
$arg = [
'dest-path' => $destPath,
];
$this->runDoctrineCommand($command, $opt, $validOpts, $arg);
} | [
"public",
"function",
"ormGenerateProxies",
"(",
"$",
"destPath",
"=",
"null",
",",
"$",
"opt",
"=",
"[",
"'filter'",
"=>",
"null",
"]",
")",
"{",
"$",
"validOpts",
"=",
"[",
"'filter'",
"]",
";",
"$",
"command",
"=",
"new",
"Command",
"\\",
"GenerateP... | Generates proxy classes for entity classes
@param string $destPath The path to generate your proxy classes. If none is provided, it will attempt to grab from configuration
@param array $opt
@option $filter A string pattern used to match entities that should be processed | [
"Generates",
"proxy",
"classes",
"for",
"entity",
"classes"
] | dc7660aba5fd1bf3c3ef945bb4603da91c85bd05 | https://github.com/indigophp/robo-doctrine/blob/dc7660aba5fd1bf3c3ef945bb4603da91c85bd05/src/Task/Doctrine/loadOrmTasks.php#L239-L249 |
10,694 | indigophp/robo-doctrine | src/Task/Doctrine/loadOrmTasks.php | loadOrmTasks.ormConvertMapping | public function ormConvertMapping(
$toType,
$destPath,
$opt = [
'filter' => null,
'force' => null,
'from-database' => null,
'extend' => null,
'num-spaces' => 4,
'namespace' => null,
]
... | php | public function ormConvertMapping(
$toType,
$destPath,
$opt = [
'filter' => null,
'force' => null,
'from-database' => null,
'extend' => null,
'num-spaces' => 4,
'namespace' => null,
]
... | [
"public",
"function",
"ormConvertMapping",
"(",
"$",
"toType",
",",
"$",
"destPath",
",",
"$",
"opt",
"=",
"[",
"'filter'",
"=>",
"null",
",",
"'force'",
"=>",
"null",
",",
"'from-database'",
"=>",
"null",
",",
"'extend'",
"=>",
"null",
",",
"'num-spaces'"... | Convert mapping information between supported formats
@param string $toType The mapping type to be converted
@param string $destPath The path to generate your entities classes
@param array $opt
@option $filter A string pattern used to match entities that should be processed
@option $force Force to o... | [
"Convert",
"mapping",
"information",
"between",
"supported",
"formats"
] | dc7660aba5fd1bf3c3ef945bb4603da91c85bd05 | https://github.com/indigophp/robo-doctrine/blob/dc7660aba5fd1bf3c3ef945bb4603da91c85bd05/src/Task/Doctrine/loadOrmTasks.php#L265-L293 |
10,695 | indigophp/robo-doctrine | src/Task/Doctrine/loadOrmTasks.php | loadOrmTasks.ormRunDql | public function ormRunDql(
$dql,
$opt = [
'hydrate' => 'object',
'first-result' => null,
'max-result' => null,
'depth' => 7,
]
) {
$validOpts = [
'hydrate',
'first-result',
'max-result',... | php | public function ormRunDql(
$dql,
$opt = [
'hydrate' => 'object',
'first-result' => null,
'max-result' => null,
'depth' => 7,
]
) {
$validOpts = [
'hydrate',
'first-result',
'max-result',... | [
"public",
"function",
"ormRunDql",
"(",
"$",
"dql",
",",
"$",
"opt",
"=",
"[",
"'hydrate'",
"=>",
"'object'",
",",
"'first-result'",
"=>",
"null",
",",
"'max-result'",
"=>",
"null",
",",
"'depth'",
"=>",
"7",
",",
"]",
")",
"{",
"$",
"validOpts",
"=",
... | Executes arbitrary DQL directly from the command line
@param string $dql The DQL to execute
@param array $opt
@option $hydrate Hydration mode of result set. Should be either: object, array, scalar or single-scalar
@option $first-result The first result in the result set
@option $max-result The maximum number ... | [
"Executes",
"arbitrary",
"DQL",
"directly",
"from",
"the",
"command",
"line"
] | dc7660aba5fd1bf3c3ef945bb4603da91c85bd05 | https://github.com/indigophp/robo-doctrine/blob/dc7660aba5fd1bf3c3ef945bb4603da91c85bd05/src/Task/Doctrine/loadOrmTasks.php#L306-L328 |
10,696 | indigophp/robo-doctrine | src/Task/Doctrine/loadOrmTasks.php | loadOrmTasks.runDoctrineCommand | protected function runDoctrineCommand(SymfonyCommand $command, array $opt = [], array $validOpts = [], array $arg = [])
{
$helperSet = $this->getEntityManagerHelperSet();
$command->setHelperSet($helperSet);
$command = $this->taskSymfonyCommand($command);
foreach ($opt as $key => $v... | php | protected function runDoctrineCommand(SymfonyCommand $command, array $opt = [], array $validOpts = [], array $arg = [])
{
$helperSet = $this->getEntityManagerHelperSet();
$command->setHelperSet($helperSet);
$command = $this->taskSymfonyCommand($command);
foreach ($opt as $key => $v... | [
"protected",
"function",
"runDoctrineCommand",
"(",
"SymfonyCommand",
"$",
"command",
",",
"array",
"$",
"opt",
"=",
"[",
"]",
",",
"array",
"$",
"validOpts",
"=",
"[",
"]",
",",
"array",
"$",
"arg",
"=",
"[",
"]",
")",
"{",
"$",
"helperSet",
"=",
"$... | Adds options to a symfony command
@param SymfonyCommand $command
@param array $opt
@param array $validOpts
@param array $arg | [
"Adds",
"options",
"to",
"a",
"symfony",
"command"
] | dc7660aba5fd1bf3c3ef945bb4603da91c85bd05 | https://github.com/indigophp/robo-doctrine/blob/dc7660aba5fd1bf3c3ef945bb4603da91c85bd05/src/Task/Doctrine/loadOrmTasks.php#L358-L378 |
10,697 | prastowoagungwidodo/mvc | src/Transformatika/MVC/RouteDispatcher.php | RouteDispatcher.setRedirectUrl | public function setRedirectUrl($options)
{
$this->redirectUrl = array(
404 => !isset($options[404]) ? '' : $options[404],
405 => !isset($options[405]) ? '' : $options[405]
);
} | php | public function setRedirectUrl($options)
{
$this->redirectUrl = array(
404 => !isset($options[404]) ? '' : $options[404],
405 => !isset($options[405]) ? '' : $options[405]
);
} | [
"public",
"function",
"setRedirectUrl",
"(",
"$",
"options",
")",
"{",
"$",
"this",
"->",
"redirectUrl",
"=",
"array",
"(",
"404",
"=>",
"!",
"isset",
"(",
"$",
"options",
"[",
"404",
"]",
")",
"?",
"''",
":",
"$",
"options",
"[",
"404",
"]",
",",
... | Ganti error page
@param [type] $options [description] | [
"Ganti",
"error",
"page"
] | 56ce9d4589e5951690388e0a115466750c148adb | https://github.com/prastowoagungwidodo/mvc/blob/56ce9d4589e5951690388e0a115466750c148adb/src/Transformatika/MVC/RouteDispatcher.php#L185-L191 |
10,698 | AfterBug/afterbug-php | src/Config.php | Config.setUser | public function setUser(array $user)
{
$this->user = array_intersect_key(
$user,
array_flip($this->getUserAttributes())
);
return $this;
} | php | public function setUser(array $user)
{
$this->user = array_intersect_key(
$user,
array_flip($this->getUserAttributes())
);
return $this;
} | [
"public",
"function",
"setUser",
"(",
"array",
"$",
"user",
")",
"{",
"$",
"this",
"->",
"user",
"=",
"array_intersect_key",
"(",
"$",
"user",
",",
"array_flip",
"(",
"$",
"this",
"->",
"getUserAttributes",
"(",
")",
")",
")",
";",
"return",
"$",
"this... | Set user data.
@param array $user
@return $this | [
"Set",
"user",
"data",
"."
] | 3eba5ed782a5922b09170c0ae29679afea6839d8 | https://github.com/AfterBug/afterbug-php/blob/3eba5ed782a5922b09170c0ae29679afea6839d8/src/Config.php#L133-L141 |
10,699 | samsonos/cms_app_materialtable | src/App.php | App.getMaxPriority | public function getMaxPriority($materialId, $structureId)
{
// Get all table materials identifiers from current form material
$tableMaterialIds = dbQuery('material')
->cond('parent_id', $materialId)
->cond('type', 3)
->cond('Active', 1)
->cond('Draft',... | php | public function getMaxPriority($materialId, $structureId)
{
// Get all table materials identifiers from current form material
$tableMaterialIds = dbQuery('material')
->cond('parent_id', $materialId)
->cond('type', 3)
->cond('Active', 1)
->cond('Draft',... | [
"public",
"function",
"getMaxPriority",
"(",
"$",
"materialId",
",",
"$",
"structureId",
")",
"{",
"// Get all table materials identifiers from current form material",
"$",
"tableMaterialIds",
"=",
"dbQuery",
"(",
"'material'",
")",
"->",
"cond",
"(",
"'parent_id'",
","... | Get max priority by current structure
@param $materialId
@param $structureId
@return int | [
"Get",
"max",
"priority",
"by",
"current",
"structure"
] | 550fb1916070b6cf8cbd4fa7d61a19ca9a2d090e | https://github.com/samsonos/cms_app_materialtable/blob/550fb1916070b6cf8cbd4fa7d61a19ca9a2d090e/src/App.php#L69-L94 |
Subsets and Splits
Yii Code Samples
Gathers all records from test, train, and validation sets that contain the word 'yii', providing a basic filtered view of the dataset relevant to Yii-related content.