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
29,700
Blobfolio/blob-common
lib/blobfolio/common/dom.php
dom.get_nodes_by_class
public static function get_nodes_by_class($parent, $class=null, bool $all=false) { $nodes = array(); if (! \method_exists($parent, 'getElementsByTagName')) { return $nodes; } ref\cast::array($class); $class = \array_map('trim', $class); foreach ($class as $k=>$v) { $class[$k] = \ltrim($class[$k], '....
php
public static function get_nodes_by_class($parent, $class=null, bool $all=false) { $nodes = array(); if (! \method_exists($parent, 'getElementsByTagName')) { return $nodes; } ref\cast::array($class); $class = \array_map('trim', $class); foreach ($class as $k=>$v) { $class[$k] = \ltrim($class[$k], '....
[ "public", "static", "function", "get_nodes_by_class", "(", "$", "parent", ",", "$", "class", "=", "null", ",", "bool", "$", "all", "=", "false", ")", "{", "$", "nodes", "=", "array", "(", ")", ";", "if", "(", "!", "\\", "method_exists", "(", "$", "...
Get Nodes By Class This will return an array of DOMNode objects containing the specified class(es). This does not use DOMXPath. @param mixed $parent DOMDocument, DOMElement, etc. @param string|array $class One or more classes. @param bool $all Matches must contain *all* passed classes instead of *any*. @return array ...
[ "Get", "Nodes", "By", "Class" ]
7b43d5526cc9d09853771d950b2956e98e680db1
https://github.com/Blobfolio/blob-common/blob/7b43d5526cc9d09853771d950b2956e98e680db1/lib/blobfolio/common/dom.php#L145-L181
29,701
secucard/secucard-connect-php-sdk
src/SecucardConnect/Product/Payment/Service/PaymentService.php
PaymentService.cancel
public function cancel($paymentId, $contractId = null, $amount = null, $reduceStakeholderPayment = false) { $object = [ 'contract' => $contractId, 'amount' => $amount, 'reduce_stakeholder_payment' => $reduceStakeholderPayment ]; $res = $this->execute($paym...
php
public function cancel($paymentId, $contractId = null, $amount = null, $reduceStakeholderPayment = false) { $object = [ 'contract' => $contractId, 'amount' => $amount, 'reduce_stakeholder_payment' => $reduceStakeholderPayment ]; $res = $this->execute($paym...
[ "public", "function", "cancel", "(", "$", "paymentId", ",", "$", "contractId", "=", "null", ",", "$", "amount", "=", "null", ",", "$", "reduceStakeholderPayment", "=", "false", ")", "{", "$", "object", "=", "[", "'contract'", "=>", "$", "contractId", ","...
Cancel or Refund an existing transaction. Currently, partial refunds are are not allowed for all payment products. @param string $paymentId The payment transaction id. @param string $contractId The id of the contract that was used to create this transaction. @param int $amount The amount that you want to refund to the...
[ "Cancel", "or", "Refund", "an", "existing", "transaction", ".", "Currently", "partial", "refunds", "are", "are", "not", "allowed", "for", "all", "payment", "products", "." ]
d990686095e4e02d0924fc12b9bf60140fe8efab
https://github.com/secucard/secucard-connect-php-sdk/blob/d990686095e4e02d0924fc12b9bf60140fe8efab/src/SecucardConnect/Product/Payment/Service/PaymentService.php#L36-L50
29,702
secucard/secucard-connect-php-sdk
src/SecucardConnect/Product/Payment/Service/PaymentService.php
PaymentService.capture
public function capture($paymentId, $contractId = null) { $class = $this->resourceMetadata->resourceClass; $object = [ 'contract' => $contractId, ]; $res = $this->execute($paymentId, 'capture', null, $object, $class); if ($res) { return true; ...
php
public function capture($paymentId, $contractId = null) { $class = $this->resourceMetadata->resourceClass; $object = [ 'contract' => $contractId, ]; $res = $this->execute($paymentId, 'capture', null, $object, $class); if ($res) { return true; ...
[ "public", "function", "capture", "(", "$", "paymentId", ",", "$", "contractId", "=", "null", ")", "{", "$", "class", "=", "$", "this", "->", "resourceMetadata", "->", "resourceClass", ";", "$", "object", "=", "[", "'contract'", "=>", "$", "contractId", "...
Capture a pre-authorized payment transaction. @param string $paymentId The payment transaction id @param string $contractId The id of the contract that was used to create this transaction. @return bool TRUE if successful, FALSE otherwise. @throws GuzzleException @throws ApiError @throws AuthError @throws ClientError
[ "Capture", "a", "pre", "-", "authorized", "payment", "transaction", "." ]
d990686095e4e02d0924fc12b9bf60140fe8efab
https://github.com/secucard/secucard-connect-php-sdk/blob/d990686095e4e02d0924fc12b9bf60140fe8efab/src/SecucardConnect/Product/Payment/Service/PaymentService.php#L63-L78
29,703
secucard/secucard-connect-php-sdk
src/SecucardConnect/Product/Payment/Service/PaymentService.php
PaymentService.updateBasket
public function updateBasket($paymentId, array $basket, $contractId = null) { $class = $this->resourceMetadata->resourceClass; /** * @var $object Transaction */ $object = new $class(); $object->id = $paymentId; $object->basket = $basket; $object->con...
php
public function updateBasket($paymentId, array $basket, $contractId = null) { $class = $this->resourceMetadata->resourceClass; /** * @var $object Transaction */ $object = new $class(); $object->id = $paymentId; $object->basket = $basket; $object->con...
[ "public", "function", "updateBasket", "(", "$", "paymentId", ",", "array", "$", "basket", ",", "$", "contractId", "=", "null", ")", "{", "$", "class", "=", "$", "this", "->", "resourceMetadata", "->", "resourceClass", ";", "/**\n * @var $object Transacti...
Add additional basket items to the payment transaction. F.e. for adding stakeholder payment items. @param string $paymentId The payment transaction id @param Basket[] $basket @param string $contractId The id of the contract that was used to create this transaction. @return bool TRUE if successful, FALSE otherwise. @th...
[ "Add", "additional", "basket", "items", "to", "the", "payment", "transaction", ".", "F", ".", "e", ".", "for", "adding", "stakeholder", "payment", "items", "." ]
d990686095e4e02d0924fc12b9bf60140fe8efab
https://github.com/secucard/secucard-connect-php-sdk/blob/d990686095e4e02d0924fc12b9bf60140fe8efab/src/SecucardConnect/Product/Payment/Service/PaymentService.php#L92-L109
29,704
secucard/secucard-connect-php-sdk
src/SecucardConnect/Product/Payment/Service/PaymentService.php
PaymentService.reverseAccrual
public function reverseAccrual($paymentId) { $class = $this->resourceMetadata->resourceClass; /** * @var $object Transaction */ $object = new $class(); $object->id = $paymentId; $object->accrual = false; $res = $this->updateWithAction($paymentId, 'ac...
php
public function reverseAccrual($paymentId) { $class = $this->resourceMetadata->resourceClass; /** * @var $object Transaction */ $object = new $class(); $object->id = $paymentId; $object->accrual = false; $res = $this->updateWithAction($paymentId, 'ac...
[ "public", "function", "reverseAccrual", "(", "$", "paymentId", ")", "{", "$", "class", "=", "$", "this", "->", "resourceMetadata", "->", "resourceClass", ";", "/**\n * @var $object Transaction\n */", "$", "object", "=", "new", "$", "class", "(", ")...
Remove the accrual flag of an existing payment transaction. @param string $paymentId The payment transaction id @return bool @throws GuzzleException @throws ApiError @throws AuthError @throws ClientError
[ "Remove", "the", "accrual", "flag", "of", "an", "existing", "payment", "transaction", "." ]
d990686095e4e02d0924fc12b9bf60140fe8efab
https://github.com/secucard/secucard-connect-php-sdk/blob/d990686095e4e02d0924fc12b9bf60140fe8efab/src/SecucardConnect/Product/Payment/Service/PaymentService.php#L121-L137
29,705
secucard/secucard-connect-php-sdk
src/SecucardConnect/Product/Payment/Service/PaymentService.php
PaymentService.initSubsequent
public function initSubsequent($paymentId, $amount, array $basket) { $class = $this->resourceMetadata->resourceClass; /** * @var $object Transaction */ $object = new $class(); $object->id = $paymentId; $object->amount = $amount; $object->basket = $ba...
php
public function initSubsequent($paymentId, $amount, array $basket) { $class = $this->resourceMetadata->resourceClass; /** * @var $object Transaction */ $object = new $class(); $object->id = $paymentId; $object->amount = $amount; $object->basket = $ba...
[ "public", "function", "initSubsequent", "(", "$", "paymentId", ",", "$", "amount", ",", "array", "$", "basket", ")", "{", "$", "class", "=", "$", "this", "->", "resourceMetadata", "->", "resourceClass", ";", "/**\n * @var $object Transaction\n */", ...
Subsequent posting to a approved transaction. This can only be executed once per payment transaction. @param string $paymentId The payment transaction id @param int $amount The new total amount (max. 120% of the old amount) @param Basket[] $basket The new basket items @return bool TRUE if successful, FALSE otherwise. ...
[ "Subsequent", "posting", "to", "a", "approved", "transaction", ".", "This", "can", "only", "be", "executed", "once", "per", "payment", "transaction", "." ]
d990686095e4e02d0924fc12b9bf60140fe8efab
https://github.com/secucard/secucard-connect-php-sdk/blob/d990686095e4e02d0924fc12b9bf60140fe8efab/src/SecucardConnect/Product/Payment/Service/PaymentService.php#L151-L168
29,706
secucard/secucard-connect-php-sdk
src/SecucardConnect/Product/Payment/Service/PaymentService.php
PaymentService.updateSubscription
public function updateSubscription($paymentId, $purpose) { $class = $this->resourceMetadata->resourceClass; /** * @var $object Transaction */ $object = new $class(); $object->id = $paymentId; $object->subscription = new Subscription(); $object->subsc...
php
public function updateSubscription($paymentId, $purpose) { $class = $this->resourceMetadata->resourceClass; /** * @var $object Transaction */ $object = new $class(); $object->id = $paymentId; $object->subscription = new Subscription(); $object->subsc...
[ "public", "function", "updateSubscription", "(", "$", "paymentId", ",", "$", "purpose", ")", "{", "$", "class", "=", "$", "this", "->", "resourceMetadata", "->", "resourceClass", ";", "/**\n * @var $object Transaction\n */", "$", "object", "=", "new"...
Create or update a subscription for a existing transaction @param string $paymentId The payment transaction id @param string $purpose The purpose of the subscription @return bool TRUE if successful, FALSE otherwise. @throws GuzzleException @throws ApiError @throws AuthError @throws ClientError
[ "Create", "or", "update", "a", "subscription", "for", "a", "existing", "transaction" ]
d990686095e4e02d0924fc12b9bf60140fe8efab
https://github.com/secucard/secucard-connect-php-sdk/blob/d990686095e4e02d0924fc12b9bf60140fe8efab/src/SecucardConnect/Product/Payment/Service/PaymentService.php#L212-L229
29,707
secucard/secucard-connect-php-sdk
src/SecucardConnect/Product/Payment/Service/PaymentService.php
PaymentService.onStatusChange
public function onStatusChange($fn) { $this->registerEventHandler(static::class, $fn === null ? null : new PaymentChanged($fn, $this)); }
php
public function onStatusChange($fn) { $this->registerEventHandler(static::class, $fn === null ? null : new PaymentChanged($fn, $this)); }
[ "public", "function", "onStatusChange", "(", "$", "fn", ")", "{", "$", "this", "->", "registerEventHandler", "(", "static", "::", "class", ",", "$", "fn", "===", "null", "?", "null", ":", "new", "PaymentChanged", "(", "$", "fn", ",", "$", "this", ")", ...
Set a callback to be notified when a creditcard has changed. Pass null to remove a previous setting. @param callable|null $fn Any function which accepts a "Transaction" model class argument.
[ "Set", "a", "callback", "to", "be", "notified", "when", "a", "creditcard", "has", "changed", ".", "Pass", "null", "to", "remove", "a", "previous", "setting", "." ]
d990686095e4e02d0924fc12b9bf60140fe8efab
https://github.com/secucard/secucard-connect-php-sdk/blob/d990686095e4e02d0924fc12b9bf60140fe8efab/src/SecucardConnect/Product/Payment/Service/PaymentService.php#L236-L239
29,708
acdh-oeaw/repo-php-util
src/acdhOeaw/util/RepoConfig.php
RepoConfig.get
static public function get(string $property, bool $noException = false) { $value = @self::$config->get($property); if ($value === null && $noException === false) { throw new InvalidArgumentException('configuration property ' . $property . ' does not exist'); } return $value; ...
php
static public function get(string $property, bool $noException = false) { $value = @self::$config->get($property); if ($value === null && $noException === false) { throw new InvalidArgumentException('configuration property ' . $property . ' does not exist'); } return $value; ...
[ "static", "public", "function", "get", "(", "string", "$", "property", ",", "bool", "$", "noException", "=", "false", ")", "{", "$", "value", "=", "@", "self", "::", "$", "config", "->", "get", "(", "$", "property", ")", ";", "if", "(", "$", "value...
Returns given configuration property value. If property is not set, throws an error. Property value can be a literal as well as an composed object (e.g. array depending on the parsed ini file content). @param string $property configuration property name @param bool $noException should exception be avoided when proper...
[ "Returns", "given", "configuration", "property", "value", "." ]
e22c7cd2613f3c8daf0deee879896d9cd7f61b41
https://github.com/acdh-oeaw/repo-php-util/blob/e22c7cd2613f3c8daf0deee879896d9cd7f61b41/src/acdhOeaw/util/RepoConfig.php#L72-L78
29,709
acdh-oeaw/repo-php-util
src/acdhOeaw/util/RepoConfig.php
RepoConfig.askForUserConfirmation
static public function askForUserConfirmation(bool $throwException = false): bool { echo "\n######################################################\n\n"; echo "Are you sure that you want to import data to the following instance?! \n\n "; echo "Type 'yes' to continue! \n\n"; echo self::get('sparqlUrl') . "\n"; ...
php
static public function askForUserConfirmation(bool $throwException = false): bool { echo "\n######################################################\n\n"; echo "Are you sure that you want to import data to the following instance?! \n\n "; echo "Type 'yes' to continue! \n\n"; echo self::get('sparqlUrl') . "\n"; ...
[ "static", "public", "function", "askForUserConfirmation", "(", "bool", "$", "throwException", "=", "false", ")", ":", "bool", "{", "echo", "\"\\n######################################################\\n\\n\"", ";", "echo", "\"Are you sure that you want to import data to the follo...
Displays Fedora and SPARQL endpoint URLs to the user and asks for confirmation. @param bool $throwException should an exception be thrown on lack of confirmation? @return bool
[ "Displays", "Fedora", "and", "SPARQL", "endpoint", "URLs", "to", "the", "user", "and", "asks", "for", "confirmation", "." ]
e22c7cd2613f3c8daf0deee879896d9cd7f61b41
https://github.com/acdh-oeaw/repo-php-util/blob/e22c7cd2613f3c8daf0deee879896d9cd7f61b41/src/acdhOeaw/util/RepoConfig.php#L145-L158
29,710
locomotivemtl/charcoal-ui
src/Charcoal/Ui/Layout/LayoutBuilder.php
LayoutBuilder.build
public function build($options) { $container = $this->container; $objType = isset($options['type']) ? $options['type'] : self::DEFAULT_TYPE; $obj = $this->factory->create($objType, [ 'logger' => $container['logger'], 'view' => $container['view'] ]); ...
php
public function build($options) { $container = $this->container; $objType = isset($options['type']) ? $options['type'] : self::DEFAULT_TYPE; $obj = $this->factory->create($objType, [ 'logger' => $container['logger'], 'view' => $container['view'] ]); ...
[ "public", "function", "build", "(", "$", "options", ")", "{", "$", "container", "=", "$", "this", "->", "container", ";", "$", "objType", "=", "isset", "(", "$", "options", "[", "'type'", "]", ")", "?", "$", "options", "[", "'type'", "]", ":", "sel...
Build and return a new layout. @param array|\ArrayAccess $options The layout build options. @return LayoutInterface
[ "Build", "and", "return", "a", "new", "layout", "." ]
0070f35d89ea24ae93720734d261c02a10e218b6
https://github.com/locomotivemtl/charcoal-ui/blob/0070f35d89ea24ae93720734d261c02a10e218b6/src/Charcoal/Ui/Layout/LayoutBuilder.php#L55-L67
29,711
hiqdev/yii2-language
src/Module.php
Module.detectLanguage
public function detectLanguage() { $acceptableLanguages = Yii::$app->getRequest()->getAcceptableLanguages(); foreach ($acceptableLanguages as $language) { if ($this->isValidLanguage($language)) { return $language; } } foreach ($acceptableLangua...
php
public function detectLanguage() { $acceptableLanguages = Yii::$app->getRequest()->getAcceptableLanguages(); foreach ($acceptableLanguages as $language) { if ($this->isValidLanguage($language)) { return $language; } } foreach ($acceptableLangua...
[ "public", "function", "detectLanguage", "(", ")", "{", "$", "acceptableLanguages", "=", "Yii", "::", "$", "app", "->", "getRequest", "(", ")", "->", "getAcceptableLanguages", "(", ")", ";", "foreach", "(", "$", "acceptableLanguages", "as", "$", "language", "...
Determine language based on UserAgent.
[ "Determine", "language", "based", "on", "UserAgent", "." ]
c4aec9dafe13f4d96e0bf4a8997b74bf49663fa3
https://github.com/hiqdev/yii2-language/blob/c4aec9dafe13f4d96e0bf4a8997b74bf49663fa3/src/Module.php#L109-L127
29,712
hiqdev/yii2-language
src/Module.php
Module.saveLanguageIntoCookie
private function saveLanguageIntoCookie($language) { $cookie = new Cookie([ 'name' => $this->cookieName, 'value' => $language, 'expire' => time() + 86400 * $this->expireDays, ]); Yii::$app->response->cookies->add($cookie); }
php
private function saveLanguageIntoCookie($language) { $cookie = new Cookie([ 'name' => $this->cookieName, 'value' => $language, 'expire' => time() + 86400 * $this->expireDays, ]); Yii::$app->response->cookies->add($cookie); }
[ "private", "function", "saveLanguageIntoCookie", "(", "$", "language", ")", "{", "$", "cookie", "=", "new", "Cookie", "(", "[", "'name'", "=>", "$", "this", "->", "cookieName", ",", "'value'", "=>", "$", "language", ",", "'expire'", "=>", "time", "(", ")...
Save language into cookie. @param string $language
[ "Save", "language", "into", "cookie", "." ]
c4aec9dafe13f4d96e0bf4a8997b74bf49663fa3
https://github.com/hiqdev/yii2-language/blob/c4aec9dafe13f4d96e0bf4a8997b74bf49663fa3/src/Module.php#L133-L141
29,713
Blobfolio/blob-common
lib/blobfolio/common/format.php
format.excerpt
public static function excerpt($str='', $args=null) { ref\cast::string($str, true); ref\sanitize::whitespace($str, 0); $str = \strip_tags($str); $options = data::parse_args($args, constants::EXCERPT); if ($options['length'] < 1) { return ''; } $options['unit'] = \strtolower($options['unit']); switc...
php
public static function excerpt($str='', $args=null) { ref\cast::string($str, true); ref\sanitize::whitespace($str, 0); $str = \strip_tags($str); $options = data::parse_args($args, constants::EXCERPT); if ($options['length'] < 1) { return ''; } $options['unit'] = \strtolower($options['unit']); switc...
[ "public", "static", "function", "excerpt", "(", "$", "str", "=", "''", ",", "$", "args", "=", "null", ")", "{", "ref", "\\", "cast", "::", "string", "(", "$", "str", ",", "true", ")", ";", "ref", "\\", "sanitize", "::", "whitespace", "(", "$", "s...
Generate Text Except @param string $str String. @param mixed $args Arguments. @arg int $length Length limit. @arg string $unit Unit to examine, "character" or "word". @arg string $suffix Suffix, e.g. ... @return string Excerpt.
[ "Generate", "Text", "Except" ]
7b43d5526cc9d09853771d950b2956e98e680db1
https://github.com/Blobfolio/blob-common/blob/7b43d5526cc9d09853771d950b2956e98e680db1/lib/blobfolio/common/format.php#L214-L252
29,714
Blobfolio/blob-common
lib/blobfolio/common/format.php
format.list_to_array
public static function list_to_array($list, $args=null) { ref\format::list_to_array($list, $args); return $list; }
php
public static function list_to_array($list, $args=null) { ref\format::list_to_array($list, $args); return $list; }
[ "public", "static", "function", "list_to_array", "(", "$", "list", ",", "$", "args", "=", "null", ")", "{", "ref", "\\", "format", "::", "list_to_array", "(", "$", "list", ",", "$", "args", ")", ";", "return", "$", "list", ";", "}" ]
List to Array Convert a delimited list into a proper array. @param mixed $list List. @param mixed $args Arguments or delimiter. @args string $delimiter Delimiter. @args bool $trim Trim. @args bool $unique Unique. @args bool $sort Sort output. @args string $cast Cast to type. @args mixed $min Minimum value. @args mix...
[ "List", "to", "Array" ]
7b43d5526cc9d09853771d950b2956e98e680db1
https://github.com/Blobfolio/blob-common/blob/7b43d5526cc9d09853771d950b2956e98e680db1/lib/blobfolio/common/format.php#L419-L422
29,715
Blobfolio/blob-common
lib/blobfolio/common/format.php
format.to_csv
public static function to_csv($data=null, $headers=null, string $delimiter=',', string $eol="\n") { ref\cast::array($data); $data = \array_values(\array_filter($data, 'is_array')); ref\cast::array($headers); $out = array(); // Grab headers from data? if ( ! \count($headers) && \count($data) && (c...
php
public static function to_csv($data=null, $headers=null, string $delimiter=',', string $eol="\n") { ref\cast::array($data); $data = \array_values(\array_filter($data, 'is_array')); ref\cast::array($headers); $out = array(); // Grab headers from data? if ( ! \count($headers) && \count($data) && (c...
[ "public", "static", "function", "to_csv", "(", "$", "data", "=", "null", ",", "$", "headers", "=", "null", ",", "string", "$", "delimiter", "=", "','", ",", "string", "$", "eol", "=", "\"\\n\"", ")", "{", "ref", "\\", "cast", "::", "array", "(", "$...
Generate CSV from Data @param array $data Data (row=>cells). @param array $headers Headers. @param string $delimiter Delimiter. @param string $eol Line ending type. @return string CSV content.
[ "Generate", "CSV", "from", "Data" ]
7b43d5526cc9d09853771d950b2956e98e680db1
https://github.com/Blobfolio/blob-common/blob/7b43d5526cc9d09853771d950b2956e98e680db1/lib/blobfolio/common/format.php#L521-L562
29,716
Blobfolio/blob-common
lib/blobfolio/common/sanitize.php
sanitize.domain
public static function domain($str='', bool $unicode=false) { ref\sanitize::domain($str, $unicode); return $str; }
php
public static function domain($str='', bool $unicode=false) { ref\sanitize::domain($str, $unicode); return $str; }
[ "public", "static", "function", "domain", "(", "$", "str", "=", "''", ",", "bool", "$", "unicode", "=", "false", ")", "{", "ref", "\\", "sanitize", "::", "domain", "(", "$", "str", ",", "$", "unicode", ")", ";", "return", "$", "str", ";", "}" ]
Domain Name. This locates the domain name portion of a URL, removes leading "www." subdomains, and ignores IP addresses. @param string $str Domain. @param bool $unicode Unicode. @return string Domain.
[ "Domain", "Name", "." ]
7b43d5526cc9d09853771d950b2956e98e680db1
https://github.com/Blobfolio/blob-common/blob/7b43d5526cc9d09853771d950b2956e98e680db1/lib/blobfolio/common/sanitize.php#L131-L134
29,717
Blobfolio/blob-common
lib/blobfolio/common/sanitize.php
sanitize.to_range
public static function to_range($value, $min=null, $max=null) { ref\sanitize::to_range($value, $min, $max); return $value; }
php
public static function to_range($value, $min=null, $max=null) { ref\sanitize::to_range($value, $min, $max); return $value; }
[ "public", "static", "function", "to_range", "(", "$", "value", ",", "$", "min", "=", "null", ",", "$", "max", "=", "null", ")", "{", "ref", "\\", "sanitize", "::", "to_range", "(", "$", "value", ",", "$", "min", ",", "$", "max", ")", ";", "return...
Confine a Value to a Range @param mixed $value Value. @param mixed $min Min. @param mixed $max Max. @return mixed Value.
[ "Confine", "a", "Value", "to", "a", "Range" ]
7b43d5526cc9d09853771d950b2956e98e680db1
https://github.com/Blobfolio/blob-common/blob/7b43d5526cc9d09853771d950b2956e98e680db1/lib/blobfolio/common/sanitize.php#L385-L388
29,718
secucard/secucard-connect-php-sdk
src/SecucardConnect/Event/DefaultEventHandler.php
DefaultEventHandler.accept
protected function accept(Event $event) { return $event->target === $this->eventTarget && $event->type === $this->eventType; }
php
protected function accept(Event $event) { return $event->target === $this->eventTarget && $event->type === $this->eventType; }
[ "protected", "function", "accept", "(", "Event", "$", "event", ")", "{", "return", "$", "event", "->", "target", "===", "$", "this", "->", "eventTarget", "&&", "$", "event", "->", "type", "===", "$", "this", "->", "eventType", ";", "}" ]
Can be used by handlers to determine if a handler should process the given event. The default decision is made by comparing the given and this instances event target and event type. May be overridden to adapt. @param Event $event The event to process. @return bool True if can handle, false else.
[ "Can", "be", "used", "by", "handlers", "to", "determine", "if", "a", "handler", "should", "process", "the", "given", "event", ".", "The", "default", "decision", "is", "made", "by", "comparing", "the", "given", "and", "this", "instances", "event", "target", ...
d990686095e4e02d0924fc12b9bf60140fe8efab
https://github.com/secucard/secucard-connect-php-sdk/blob/d990686095e4e02d0924fc12b9bf60140fe8efab/src/SecucardConnect/Event/DefaultEventHandler.php#L55-L58
29,719
ventoviro/windwalker-core
src/Core/Schedule/ScheduleEvent.php
ScheduleEvent.setExpression
public function setExpression($expression) { if (is_string($expression)) { $expression = CronExpression::factory($expression); } $this->expression = $expression; return $this; }
php
public function setExpression($expression) { if (is_string($expression)) { $expression = CronExpression::factory($expression); } $this->expression = $expression; return $this; }
[ "public", "function", "setExpression", "(", "$", "expression", ")", "{", "if", "(", "is_string", "(", "$", "expression", ")", ")", "{", "$", "expression", "=", "CronExpression", "::", "factory", "(", "$", "expression", ")", ";", "}", "$", "this", "->", ...
Method to set property expression @param CronExpression|string $expression @return static Return self to support chaining. @since 3.5.3
[ "Method", "to", "set", "property", "expression" ]
0ed53059fc2d5d2d9b72f0e4aeef2fdf6aac0074
https://github.com/ventoviro/windwalker-core/blob/0ed53059fc2d5d2d9b72f0e4aeef2fdf6aac0074/src/Core/Schedule/ScheduleEvent.php#L151-L160
29,720
secucard/secucard-connect-php-sdk
src/SecucardConnect/ApiClientConfiguration.php
ApiClientConfiguration.isValid
public function isValid() { $data = $this->toArray(); $missing = array_diff(self::$REQUIRED_FIELDS, array_keys($data)); if ($missing) { throw new \InvalidArgumentException('Config is missing the following keys: ' . implode(', ', $missing)); } return true; }
php
public function isValid() { $data = $this->toArray(); $missing = array_diff(self::$REQUIRED_FIELDS, array_keys($data)); if ($missing) { throw new \InvalidArgumentException('Config is missing the following keys: ' . implode(', ', $missing)); } return true; }
[ "public", "function", "isValid", "(", ")", "{", "$", "data", "=", "$", "this", "->", "toArray", "(", ")", ";", "$", "missing", "=", "array_diff", "(", "self", "::", "$", "REQUIRED_FIELDS", ",", "array_keys", "(", "$", "data", ")", ")", ";", "if", "...
Validates the configuration for the api client @throws \InvalidArgumentException If some required param is missing @return true
[ "Validates", "the", "configuration", "for", "the", "api", "client" ]
d990686095e4e02d0924fc12b9bf60140fe8efab
https://github.com/secucard/secucard-connect-php-sdk/blob/d990686095e4e02d0924fc12b9bf60140fe8efab/src/SecucardConnect/ApiClientConfiguration.php#L120-L131
29,721
secucard/secucard-connect-php-sdk
src/SecucardConnect/ApiClientConfiguration.php
ApiClientConfiguration.setAuth
public function setAuth($auth) { $auth = strtolower($auth); if (!in_array($auth, [self::AUTHENTICATION_METHOD_OAUTH])) { throw new \InvalidArgumentException('Parameter "auth" must be filled and valid'); } $this->auth = $auth; return $this; }
php
public function setAuth($auth) { $auth = strtolower($auth); if (!in_array($auth, [self::AUTHENTICATION_METHOD_OAUTH])) { throw new \InvalidArgumentException('Parameter "auth" must be filled and valid'); } $this->auth = $auth; return $this; }
[ "public", "function", "setAuth", "(", "$", "auth", ")", "{", "$", "auth", "=", "strtolower", "(", "$", "auth", ")", ";", "if", "(", "!", "in_array", "(", "$", "auth", ",", "[", "self", "::", "AUTHENTICATION_METHOD_OAUTH", "]", ")", ")", "{", "throw",...
Define the authentication method @param string $auth @throws \InvalidArgumentException If some required param is missing or invalid @return self
[ "Define", "the", "authentication", "method" ]
d990686095e4e02d0924fc12b9bf60140fe8efab
https://github.com/secucard/secucard-connect-php-sdk/blob/d990686095e4e02d0924fc12b9bf60140fe8efab/src/SecucardConnect/ApiClientConfiguration.php#L264-L274
29,722
secucard/secucard-connect-php-sdk
src/SecucardConnect/ApiClientConfiguration.php
ApiClientConfiguration.setAcceptLanguage
public function setAcceptLanguage($accept_language) { $accept_language = strtolower($accept_language); if (!in_array($accept_language, [self::ACCEPT_LANGUAGE_EN, self::ACCEPT_LANGUAGE_DE])) { throw new \InvalidArgumentException('Parameter "accept_language" must be valid'); } ...
php
public function setAcceptLanguage($accept_language) { $accept_language = strtolower($accept_language); if (!in_array($accept_language, [self::ACCEPT_LANGUAGE_EN, self::ACCEPT_LANGUAGE_DE])) { throw new \InvalidArgumentException('Parameter "accept_language" must be valid'); } ...
[ "public", "function", "setAcceptLanguage", "(", "$", "accept_language", ")", "{", "$", "accept_language", "=", "strtolower", "(", "$", "accept_language", ")", ";", "if", "(", "!", "in_array", "(", "$", "accept_language", ",", "[", "self", "::", "ACCEPT_LANGUAG...
Define the language of the error and other api messages @param string $accept_language @throws \InvalidArgumentException If the given param is invalid @return self
[ "Define", "the", "language", "of", "the", "error", "and", "other", "api", "messages" ]
d990686095e4e02d0924fc12b9bf60140fe8efab
https://github.com/secucard/secucard-connect-php-sdk/blob/d990686095e4e02d0924fc12b9bf60140fe8efab/src/SecucardConnect/ApiClientConfiguration.php#L318-L328
29,723
diff-sniffer/core
src/Diff.php
Diff.filter
public function filter(string $path, array $report) : array { $report['messages'] = isset($this->paths[$path]) ? array_intersect_key( $report['messages'], array_flip($this->paths[$path]) ) : []; $errors = $warnings = $fixable = 0; foreach ($report['messages'...
php
public function filter(string $path, array $report) : array { $report['messages'] = isset($this->paths[$path]) ? array_intersect_key( $report['messages'], array_flip($this->paths[$path]) ) : []; $errors = $warnings = $fixable = 0; foreach ($report['messages'...
[ "public", "function", "filter", "(", "string", "$", "path", ",", "array", "$", "report", ")", ":", "array", "{", "$", "report", "[", "'messages'", "]", "=", "isset", "(", "$", "this", "->", "paths", "[", "$", "path", "]", ")", "?", "array_intersect_k...
Filters file report producing another one containing only the lines affected by diff @param string $path File path @param array $report Report data @return array
[ "Filters", "file", "report", "producing", "another", "one", "containing", "only", "the", "lines", "affected", "by", "diff" ]
583369a5f5c91496862f6bdf60b69565da4bc05d
https://github.com/diff-sniffer/core/blob/583369a5f5c91496862f6bdf60b69565da4bc05d/src/Diff.php#L56-L89
29,724
diff-sniffer/core
src/Diff.php
Diff.parse
private function parse(string $diff) : array { $diff = preg_split("/((\r?\n)|(\r\n?))/", $diff); $paths = []; $number = 0; $path = null; foreach ($diff as $line) { if (preg_match('~^\+\+\+\s(.*)~', $line, $matches)) { $path = substr($matches[1], s...
php
private function parse(string $diff) : array { $diff = preg_split("/((\r?\n)|(\r\n?))/", $diff); $paths = []; $number = 0; $path = null; foreach ($diff as $line) { if (preg_match('~^\+\+\+\s(.*)~', $line, $matches)) { $path = substr($matches[1], s...
[ "private", "function", "parse", "(", "string", "$", "diff", ")", ":", "array", "{", "$", "diff", "=", "preg_split", "(", "\"/((\\r?\\n)|(\\r\\n?))/\"", ",", "$", "diff", ")", ";", "$", "paths", "=", "[", "]", ";", "$", "number", "=", "0", ";", "$", ...
Parses diff and returns array containing affected paths and line numbers @param string $diff Diff output @return array
[ "Parses", "diff", "and", "returns", "array", "containing", "affected", "paths", "and", "line", "numbers" ]
583369a5f5c91496862f6bdf60b69565da4bc05d
https://github.com/diff-sniffer/core/blob/583369a5f5c91496862f6bdf60b69565da4bc05d/src/Diff.php#L98-L123
29,725
polyfony-inc/polyfony
Private/Polyfony/Bundles.php
Bundles.init
public static function init() :void { // marker Profiler::setMarker('Bundles.init', 'framework'); // if cache is enabled and in prod load the cache, else parse bundles Config::isProd() && Cache::has('Includes') ? self::loadCachedDependencies() : self::loadDependencies(); // now that we have the list of c...
php
public static function init() :void { // marker Profiler::setMarker('Bundles.init', 'framework'); // if cache is enabled and in prod load the cache, else parse bundles Config::isProd() && Cache::has('Includes') ? self::loadCachedDependencies() : self::loadDependencies(); // now that we have the list of c...
[ "public", "static", "function", "init", "(", ")", ":", "void", "{", "// marker", "Profiler", "::", "setMarker", "(", "'Bundles.init'", ",", "'framework'", ")", ";", "// if cache is enabled and in prod load the cache, else parse bundles", "Config", "::", "isProd", "(", ...
will get the list of bundles and get their routes and runtimes
[ "will", "get", "the", "list", "of", "bundles", "and", "get", "their", "routes", "and", "runtimes" ]
76dac2f4141c8f480370236295c07dfa52e5c589
https://github.com/polyfony-inc/polyfony/blob/76dac2f4141c8f480370236295c07dfa52e5c589/Private/Polyfony/Bundles.php#L12-L29
29,726
polyfony-inc/polyfony
Private/Polyfony/Bundles.php
Bundles.getLocales
public static function getLocales(string $bundle) :array { // declare an array to hold the list $locales = array(); // set the locales path $locales_path = "../Private/Bundles/{$bundle}/Locales/"; // if the directory exists if(file_exists($locales_path) && is_dir($locales_path)) { // for each file in th...
php
public static function getLocales(string $bundle) :array { // declare an array to hold the list $locales = array(); // set the locales path $locales_path = "../Private/Bundles/{$bundle}/Locales/"; // if the directory exists if(file_exists($locales_path) && is_dir($locales_path)) { // for each file in th...
[ "public", "static", "function", "getLocales", "(", "string", "$", "bundle", ")", ":", "array", "{", "// declare an array to hold the list", "$", "locales", "=", "array", "(", ")", ";", "// set the locales path", "$", "locales_path", "=", "\"../Private/Bundles/{$bundle...
get locales for a bundle
[ "get", "locales", "for", "a", "bundle" ]
76dac2f4141c8f480370236295c07dfa52e5c589
https://github.com/polyfony-inc/polyfony/blob/76dac2f4141c8f480370236295c07dfa52e5c589/Private/Polyfony/Bundles.php#L70-L90
29,727
secucard/secucard-connect-php-sdk
src/SecucardConnect/Product/Payment/CustomersService.php
CustomersService.process
private function process(Customer &$customer) { if (isset($customer->contact) && isset($customer->contact->picture)) { $customer->contact->pictureObject = $this->initMediaResource($customer->contact->picture); } }
php
private function process(Customer &$customer) { if (isset($customer->contact) && isset($customer->contact->picture)) { $customer->contact->pictureObject = $this->initMediaResource($customer->contact->picture); } }
[ "private", "function", "process", "(", "Customer", "&", "$", "customer", ")", "{", "if", "(", "isset", "(", "$", "customer", "->", "contact", ")", "&&", "isset", "(", "$", "customer", "->", "contact", "->", "picture", ")", ")", "{", "$", "customer", ...
Handles proper picture object initialization after retrieval of a customer. @param Customer $customer
[ "Handles", "proper", "picture", "object", "initialization", "after", "retrieval", "of", "a", "customer", "." ]
d990686095e4e02d0924fc12b9bf60140fe8efab
https://github.com/secucard/secucard-connect-php-sdk/blob/d990686095e4e02d0924fc12b9bf60140fe8efab/src/SecucardConnect/Product/Payment/CustomersService.php#L43-L48
29,728
acdh-oeaw/repo-php-util
src/acdhOeaw/fedora/acl/CheckAcess.php
CheckAcess.check
static public function check(FedoraResource $res): bool { if (self::$client === null) { self::$client = new Client([ 'verify' => false, ]); } $headers = []; if (isset($_SERVER['PHP_AUTH_USER'])) { $headers['Authorization'] = 'Basic ' ...
php
static public function check(FedoraResource $res): bool { if (self::$client === null) { self::$client = new Client([ 'verify' => false, ]); } $headers = []; if (isset($_SERVER['PHP_AUTH_USER'])) { $headers['Authorization'] = 'Basic ' ...
[ "static", "public", "function", "check", "(", "FedoraResource", "$", "res", ")", ":", "bool", "{", "if", "(", "self", "::", "$", "client", "===", "null", ")", "{", "self", "::", "$", "client", "=", "new", "Client", "(", "[", "'verify'", "=>", "false"...
Checks if a given resource is accessible with same credentials as ones provided in the current request. @param FedoraResource $res @return bool @throws RequestException
[ "Checks", "if", "a", "given", "resource", "is", "accessible", "with", "same", "credentials", "as", "ones", "provided", "in", "the", "current", "request", "." ]
e22c7cd2613f3c8daf0deee879896d9cd7f61b41
https://github.com/acdh-oeaw/repo-php-util/blob/e22c7cd2613f3c8daf0deee879896d9cd7f61b41/src/acdhOeaw/fedora/acl/CheckAcess.php#L55-L87
29,729
polyfony-inc/polyfony
Private/Polyfony/Router.php
Router.redirect
public static function redirect(string $source_url, string $redirection_url, int $status_code=301) { // create a new route $route = new Route(); // add it to the list of known routes self::$_routes[$route->name] = $route ->setUrl($source_url) ->setRedirect($redirection_url, $status_code); // return the...
php
public static function redirect(string $source_url, string $redirection_url, int $status_code=301) { // create a new route $route = new Route(); // add it to the list of known routes self::$_routes[$route->name] = $route ->setUrl($source_url) ->setRedirect($redirection_url, $status_code); // return the...
[ "public", "static", "function", "redirect", "(", "string", "$", "source_url", ",", "string", "$", "redirection_url", ",", "int", "$", "status_code", "=", "301", ")", "{", "// create a new route", "$", "route", "=", "new", "Route", "(", ")", ";", "// add it t...
new syntax for quick redirects
[ "new", "syntax", "for", "quick", "redirects" ]
76dac2f4141c8f480370236295c07dfa52e5c589
https://github.com/polyfony-inc/polyfony/blob/76dac2f4141c8f480370236295c07dfa52e5c589/Private/Polyfony/Router.php#L103-L112
29,730
polyfony-inc/polyfony
Private/Polyfony/Router.php
Router.getRoute
public static function getRoute(string $route_name) { // return the route of false return self::hasRoute($route_name) ? self::$_routes[$route_name] : false; }
php
public static function getRoute(string $route_name) { // return the route of false return self::hasRoute($route_name) ? self::$_routes[$route_name] : false; }
[ "public", "static", "function", "getRoute", "(", "string", "$", "route_name", ")", "{", "// return the route of false", "return", "self", "::", "hasRoute", "(", "$", "route_name", ")", "?", "self", "::", "$", "_routes", "[", "$", "route_name", "]", ":", "fal...
get a specific route
[ "get", "a", "specific", "route" ]
76dac2f4141c8f480370236295c07dfa52e5c589
https://github.com/polyfony-inc/polyfony/blob/76dac2f4141c8f480370236295c07dfa52e5c589/Private/Polyfony/Router.php#L121-L124
29,731
polyfony-inc/polyfony
Private/Polyfony/Router.php
Router.routeMatch
private static function routeMatch(string $request_url, string $request_method, Route $route) :bool { // if the method is set for that route, and it doesn't match if(!$route->hasMethod($request_method)) { return false; } // if the url doesn't begin with the static segment or that route if(!$route->hasStat...
php
private static function routeMatch(string $request_url, string $request_method, Route $route) :bool { // if the method is set for that route, and it doesn't match if(!$route->hasMethod($request_method)) { return false; } // if the url doesn't begin with the static segment or that route if(!$route->hasStat...
[ "private", "static", "function", "routeMatch", "(", "string", "$", "request_url", ",", "string", "$", "request_method", ",", "Route", "$", "route", ")", ":", "bool", "{", "// if the method is set for that route, and it doesn't match", "if", "(", "!", "$", "route", ...
Test to see if this route is valid against the URL. @access private @param array $requestUrl The URL to test the route against. @param Core\Route $route A Route declared by the application. @return boolean
[ "Test", "to", "see", "if", "this", "route", "is", "valid", "against", "the", "URL", "." ]
76dac2f4141c8f480370236295c07dfa52e5c589
https://github.com/polyfony-inc/polyfony/blob/76dac2f4141c8f480370236295c07dfa52e5c589/Private/Polyfony/Router.php#L178-L203
29,732
polyfony-inc/polyfony
Private/Polyfony/Router.php
Router.reverse
public static function reverse( string $route_name, array $parameters = [], bool $is_absolute = false, bool $force_tls = false ) :string { // if the specified route doesn't exist if(!self::hasRoute($route_name)) { // we cannot reverse a route that does not exist throw new Exception("Router::revers...
php
public static function reverse( string $route_name, array $parameters = [], bool $is_absolute = false, bool $force_tls = false ) :string { // if the specified route doesn't exist if(!self::hasRoute($route_name)) { // we cannot reverse a route that does not exist throw new Exception("Router::revers...
[ "public", "static", "function", "reverse", "(", "string", "$", "route_name", ",", "array", "$", "parameters", "=", "[", "]", ",", "bool", "$", "is_absolute", "=", "false", ",", "bool", "$", "force_tls", "=", "false", ")", ":", "string", "{", "// if the s...
Reverse the router. Make a URL out of a route name and parameters, rather than parsing one. Note that this function does not care about URL paths! @access public @param string $route_name The name of the route we wish to generate a URL for. @param array $parameters The parameters that the route requires. @re...
[ "Reverse", "the", "router", "." ]
76dac2f4141c8f480370236295c07dfa52e5c589
https://github.com/polyfony-inc/polyfony/blob/76dac2f4141c8f480370236295c07dfa52e5c589/Private/Polyfony/Router.php#L218-L231
29,733
ventoviro/windwalker-core
src/Core/Error/ErrorManager.php
ErrorManager.error
public function error($code, $message, $file, $line, $context = null) { if (error_reporting() === 0) { return; } $content = sprintf('%s. File: %s (line: %s)', $message, $file, $line); throw new \ErrorException($content, 500, $code, $file, $line, new \Error()); }
php
public function error($code, $message, $file, $line, $context = null) { if (error_reporting() === 0) { return; } $content = sprintf('%s. File: %s (line: %s)', $message, $file, $line); throw new \ErrorException($content, 500, $code, $file, $line, new \Error()); }
[ "public", "function", "error", "(", "$", "code", ",", "$", "message", ",", "$", "file", ",", "$", "line", ",", "$", "context", "=", "null", ")", "{", "if", "(", "error_reporting", "(", ")", "===", "0", ")", "{", "return", ";", "}", "$", "content"...
The error handler. @param integer $code The level of the error raised, as an integer. @param string $message The error message, as a string. @param string $file The filename that the error was raised in, as a string. @param integer $line The line number the error was raised at, as an integer. @param...
[ "The", "error", "handler", "." ]
0ed53059fc2d5d2d9b72f0e4aeef2fdf6aac0074
https://github.com/ventoviro/windwalker-core/blob/0ed53059fc2d5d2d9b72f0e4aeef2fdf6aac0074/src/Core/Error/ErrorManager.php#L115-L124
29,734
ventoviro/windwalker-core
src/Core/Error/ErrorManager.php
ErrorManager.exception
public function exception($exception) { try { foreach ($this->handlers as $handler) { $handler($exception); } } catch (\Throwable $e) { $msg = "Infinity loop in exception & error handler. \nMessage:\n" . $e; if ($this->app->get('system...
php
public function exception($exception) { try { foreach ($this->handlers as $handler) { $handler($exception); } } catch (\Throwable $e) { $msg = "Infinity loop in exception & error handler. \nMessage:\n" . $e; if ($this->app->get('system...
[ "public", "function", "exception", "(", "$", "exception", ")", "{", "try", "{", "foreach", "(", "$", "this", "->", "handlers", "as", "$", "handler", ")", "{", "$", "handler", "(", "$", "exception", ")", ";", "}", "}", "catch", "(", "\\", "Throwable",...
The exception handler. @param \Throwable|\Exception $exception The exception object. @return void @link http://php.net/manual/en/function.set-exception-handler.php
[ "The", "exception", "handler", "." ]
0ed53059fc2d5d2d9b72f0e4aeef2fdf6aac0074
https://github.com/ventoviro/windwalker-core/blob/0ed53059fc2d5d2d9b72f0e4aeef2fdf6aac0074/src/Core/Error/ErrorManager.php#L135-L152
29,735
ventoviro/windwalker-core
src/Core/Error/ErrorManager.php
ErrorManager.setErrorTemplate
public function setErrorTemplate($errorTemplate, $engine = null) { if (!\is_string($errorTemplate)) { throw new \InvalidArgumentException('Please use string as template name (Example: "folder.file").'); } $this->errorTemplate = $errorTemplate; if ($engine) { ...
php
public function setErrorTemplate($errorTemplate, $engine = null) { if (!\is_string($errorTemplate)) { throw new \InvalidArgumentException('Please use string as template name (Example: "folder.file").'); } $this->errorTemplate = $errorTemplate; if ($engine) { ...
[ "public", "function", "setErrorTemplate", "(", "$", "errorTemplate", ",", "$", "engine", "=", "null", ")", "{", "if", "(", "!", "\\", "is_string", "(", "$", "errorTemplate", ")", ")", "{", "throw", "new", "\\", "InvalidArgumentException", "(", "'Please use s...
Method to set property errorTemplate @param string $errorTemplate @param string $engine @return void @throws \InvalidArgumentException
[ "Method", "to", "set", "property", "errorTemplate" ]
0ed53059fc2d5d2d9b72f0e4aeef2fdf6aac0074
https://github.com/ventoviro/windwalker-core/blob/0ed53059fc2d5d2d9b72f0e4aeef2fdf6aac0074/src/Core/Error/ErrorManager.php#L201-L212
29,736
ventoviro/windwalker-core
src/Core/Error/ErrorManager.php
ErrorManager.addHandler
public function addHandler(callable $handler, $name = null) { if ($name) { $this->handlers[$name] = $handler; } else { $this->handlers[] = $handler; } return $this; }
php
public function addHandler(callable $handler, $name = null) { if ($name) { $this->handlers[$name] = $handler; } else { $this->handlers[] = $handler; } return $this; }
[ "public", "function", "addHandler", "(", "callable", "$", "handler", ",", "$", "name", "=", "null", ")", "{", "if", "(", "$", "name", ")", "{", "$", "this", "->", "handlers", "[", "$", "name", "]", "=", "$", "handler", ";", "}", "else", "{", "$",...
Method to set property handler @param callable $handler @param string $name @return static Return self to support chaining.
[ "Method", "to", "set", "property", "handler" ]
0ed53059fc2d5d2d9b72f0e4aeef2fdf6aac0074
https://github.com/ventoviro/windwalker-core/blob/0ed53059fc2d5d2d9b72f0e4aeef2fdf6aac0074/src/Core/Error/ErrorManager.php#L288-L297
29,737
acdh-oeaw/repo-php-util
src/acdhOeaw/fedora/dissemination/parameter/AddParam.php
AddParam.transform
public function transform(string $value, string $paramName = '', string $paramValue = ''): string { $value = parse_url($value); if (!isset($value['query'])) { $value['query'] = ''; } $param = []; parse_str($value['query'], $param); ...
php
public function transform(string $value, string $paramName = '', string $paramValue = ''): string { $value = parse_url($value); if (!isset($value['query'])) { $value['query'] = ''; } $param = []; parse_str($value['query'], $param); ...
[ "public", "function", "transform", "(", "string", "$", "value", ",", "string", "$", "paramName", "=", "''", ",", "string", "$", "paramValue", "=", "''", ")", ":", "string", "{", "$", "value", "=", "parse_url", "(", "$", "value", ")", ";", "if", "(", ...
Adds a given query parameter value to the URL. If the parameter already exists in the query, it's turned into an array. @param string $value URL to be transformed @param string $paramName query parameter name @param string $paramValue query parameter value @return string
[ "Adds", "a", "given", "query", "parameter", "value", "to", "the", "URL", ".", "If", "the", "parameter", "already", "exists", "in", "the", "query", "it", "s", "turned", "into", "an", "array", "." ]
e22c7cd2613f3c8daf0deee879896d9cd7f61b41
https://github.com/acdh-oeaw/repo-php-util/blob/e22c7cd2613f3c8daf0deee879896d9cd7f61b41/src/acdhOeaw/fedora/dissemination/parameter/AddParam.php#L57-L87
29,738
locomotivemtl/charcoal-ui
src/Charcoal/Ui/FormGroup/FormGroupTrait.php
FormGroupTrait.inputs
public function inputs(callable $inputCallback = null) { $groups = $this->groups; uasort($groups, [ $this, 'sortItemsByPriority' ]); $inputCallback = isset($inputCallback) ? $inputCallback : $this->inputCallback; foreach ($inputs as $input) { if (!$input->l10nMode()) { ...
php
public function inputs(callable $inputCallback = null) { $groups = $this->groups; uasort($groups, [ $this, 'sortItemsByPriority' ]); $inputCallback = isset($inputCallback) ? $inputCallback : $this->inputCallback; foreach ($inputs as $input) { if (!$input->l10nMode()) { ...
[ "public", "function", "inputs", "(", "callable", "$", "inputCallback", "=", "null", ")", "{", "$", "groups", "=", "$", "this", "->", "groups", ";", "uasort", "(", "$", "groups", ",", "[", "$", "this", ",", "'sortItemsByPriority'", "]", ")", ";", "$", ...
Form Input generator. @param callable $inputCallback Optional. Input callback. @return FormGroupInterface[]|Generator
[ "Form", "Input", "generator", "." ]
0070f35d89ea24ae93720734d261c02a10e218b6
https://github.com/locomotivemtl/charcoal-ui/blob/0070f35d89ea24ae93720734d261c02a10e218b6/src/Charcoal/Ui/FormGroup/FormGroupTrait.php#L218-L235
29,739
acdh-oeaw/repo-php-util
src/acdhOeaw/util/MetadataCollection.php
MetadataCollection.import
public function import(string $namespace, int $singleOutNmsp): array { $dict = array(self::SKIP, self::CREATE); if (!in_array($singleOutNmsp, $dict)) { throw new InvalidArgumentException('singleOutNmsp parameters must be one of MetadataCollection::SKIP, MetadataCollection::CREATE'); ...
php
public function import(string $namespace, int $singleOutNmsp): array { $dict = array(self::SKIP, self::CREATE); if (!in_array($singleOutNmsp, $dict)) { throw new InvalidArgumentException('singleOutNmsp parameters must be one of MetadataCollection::SKIP, MetadataCollection::CREATE'); ...
[ "public", "function", "import", "(", "string", "$", "namespace", ",", "int", "$", "singleOutNmsp", ")", ":", "array", "{", "$", "dict", "=", "array", "(", "self", "::", "SKIP", ",", "self", "::", "CREATE", ")", ";", "if", "(", "!", "in_array", "(", ...
Imports the whole graph by looping over all resources. A repository resource is created for every node containing at least one cfg:fedoraIdProp property and: - containg at least one other property - or being within $namespace - or when $singleOutNmsp equals to MetadataCollection::CREATE Resources without cfg:fedoraId...
[ "Imports", "the", "whole", "graph", "by", "looping", "over", "all", "resources", "." ]
e22c7cd2613f3c8daf0deee879896d9cd7f61b41
https://github.com/acdh-oeaw/repo-php-util/blob/e22c7cd2613f3c8daf0deee879896d9cd7f61b41/src/acdhOeaw/util/MetadataCollection.php#L197-L224
29,740
acdh-oeaw/repo-php-util
src/acdhOeaw/util/MetadataCollection.php
MetadataCollection.filterResources
private function filterResources(string $namespace, int $singleOutNmsp): array { $result = array(); echo self::$debug ? "Filtering resources...\n" : ''; foreach ($this->resources() as $res) { echo self::$debug ? "\t" . $res->getUri() . "\n" : ''; $nonIdProps = array_dif...
php
private function filterResources(string $namespace, int $singleOutNmsp): array { $result = array(); echo self::$debug ? "Filtering resources...\n" : ''; foreach ($this->resources() as $res) { echo self::$debug ? "\t" . $res->getUri() . "\n" : ''; $nonIdProps = array_dif...
[ "private", "function", "filterResources", "(", "string", "$", "namespace", ",", "int", "$", "singleOutNmsp", ")", ":", "array", "{", "$", "result", "=", "array", "(", ")", ";", "echo", "self", "::", "$", "debug", "?", "\"Filtering resources...\\n\"", ":", ...
Returns set of resources to be imported skipping all other. @param string $namespace repository resources will be created for all resources in this namespace @param int $singleOutNmsp should repository resources be created representing URIs outside $namespace (MetadataCollection::SKIP or MetadataCollection::CREATE) @re...
[ "Returns", "set", "of", "resources", "to", "be", "imported", "skipping", "all", "other", "." ]
e22c7cd2613f3c8daf0deee879896d9cd7f61b41
https://github.com/acdh-oeaw/repo-php-util/blob/e22c7cd2613f3c8daf0deee879896d9cd7f61b41/src/acdhOeaw/util/MetadataCollection.php#L235-L266
29,741
acdh-oeaw/repo-php-util
src/acdhOeaw/util/MetadataCollection.php
MetadataCollection.promoteUrisToIds
private function promoteUrisToIds() { echo self::$debug ? "Promoting URIs to ids...\n" : ''; foreach ($this->resources() as $i) { if (!$i->isBNode()) { echo self::$debug ? "\t" . $i->getUri() . "\n" : ''; $i->addResource(RC::idProp(), $i->getUri()); ...
php
private function promoteUrisToIds() { echo self::$debug ? "Promoting URIs to ids...\n" : ''; foreach ($this->resources() as $i) { if (!$i->isBNode()) { echo self::$debug ? "\t" . $i->getUri() . "\n" : ''; $i->addResource(RC::idProp(), $i->getUri()); ...
[ "private", "function", "promoteUrisToIds", "(", ")", "{", "echo", "self", "::", "$", "debug", "?", "\"Promoting URIs to ids...\\n\"", ":", "''", ";", "foreach", "(", "$", "this", "->", "resources", "(", ")", "as", "$", "i", ")", "{", "if", "(", "!", "$...
Promotes subjects being fully qualified URLs to ids.
[ "Promotes", "subjects", "being", "fully", "qualified", "URLs", "to", "ids", "." ]
e22c7cd2613f3c8daf0deee879896d9cd7f61b41
https://github.com/acdh-oeaw/repo-php-util/blob/e22c7cd2613f3c8daf0deee879896d9cd7f61b41/src/acdhOeaw/util/MetadataCollection.php#L383-L391
29,742
acdh-oeaw/repo-php-util
src/acdhOeaw/util/MetadataCollection.php
MetadataCollection.sanitizeResource
private function sanitizeResource(Resource $res, string $namespace): Resource { $nonIdProps = array_diff($res->propertyUris(), array(RC::idProp())); if (count($nonIdProps) == 0) { // don't do anything when it's purely-id resource return $res; } $this->fedora->fix...
php
private function sanitizeResource(Resource $res, string $namespace): Resource { $nonIdProps = array_diff($res->propertyUris(), array(RC::idProp())); if (count($nonIdProps) == 0) { // don't do anything when it's purely-id resource return $res; } $this->fedora->fix...
[ "private", "function", "sanitizeResource", "(", "Resource", "$", "res", ",", "string", "$", "namespace", ")", ":", "Resource", "{", "$", "nonIdProps", "=", "array_diff", "(", "$", "res", "->", "propertyUris", "(", ")", ",", "array", "(", "RC", "::", "idP...
Cleans up resource metadata. @param Resource $res @param string $namespace @return Resource @throws InvalidArgumentException
[ "Cleans", "up", "resource", "metadata", "." ]
e22c7cd2613f3c8daf0deee879896d9cd7f61b41
https://github.com/acdh-oeaw/repo-php-util/blob/e22c7cd2613f3c8daf0deee879896d9cd7f61b41/src/acdhOeaw/util/MetadataCollection.php#L401-L428
29,743
acdh-oeaw/repo-php-util
src/acdhOeaw/util/MetadataCollection.php
MetadataCollection.removeLiteralIds
private function removeLiteralIds() { echo self::$debug ? "Removing literal ids...\n" : ""; foreach ($this->resources() as $i) { foreach ($i->allLiterals(RC::idProp()) as $j) { $i->delete(RC::idProp(), $j); if (self::$debug) { echo "\tremo...
php
private function removeLiteralIds() { echo self::$debug ? "Removing literal ids...\n" : ""; foreach ($this->resources() as $i) { foreach ($i->allLiterals(RC::idProp()) as $j) { $i->delete(RC::idProp(), $j); if (self::$debug) { echo "\tremo...
[ "private", "function", "removeLiteralIds", "(", ")", "{", "echo", "self", "::", "$", "debug", "?", "\"Removing literal ids...\\n\"", ":", "\"\"", ";", "foreach", "(", "$", "this", "->", "resources", "(", ")", "as", "$", "i", ")", "{", "foreach", "(", "$"...
Removes literal ids from the graph.
[ "Removes", "literal", "ids", "from", "the", "graph", "." ]
e22c7cd2613f3c8daf0deee879896d9cd7f61b41
https://github.com/acdh-oeaw/repo-php-util/blob/e22c7cd2613f3c8daf0deee879896d9cd7f61b41/src/acdhOeaw/util/MetadataCollection.php#L433-L444
29,744
acdh-oeaw/repo-php-util
src/acdhOeaw/fedora/acl/WebAcl.php
WebAcl.save
public function save() { foreach ($this->resRules as $i) { $i->save($this->res->getAclUrl()); } }
php
public function save() { foreach ($this->resRules as $i) { $i->save($this->res->getAclUrl()); } }
[ "public", "function", "save", "(", ")", "{", "foreach", "(", "$", "this", "->", "resRules", "as", "$", "i", ")", "{", "$", "i", "->", "save", "(", "$", "this", "->", "res", "->", "getAclUrl", "(", ")", ")", ";", "}", "}" ]
Manually triggers synchronization of all stored `WebAclRule` objects with the Fedora. @see setAutocommit()
[ "Manually", "triggers", "synchronization", "of", "all", "stored", "WebAclRule", "objects", "with", "the", "Fedora", "." ]
e22c7cd2613f3c8daf0deee879896d9cd7f61b41
https://github.com/acdh-oeaw/repo-php-util/blob/e22c7cd2613f3c8daf0deee879896d9cd7f61b41/src/acdhOeaw/fedora/acl/WebAcl.php#L203-L207
29,745
acdh-oeaw/repo-php-util
src/acdhOeaw/fedora/acl/WebAcl.php
WebAcl.revokeAll
public function revokeAll(int $mode = WebAclRule::READ): WebAcl { WebAclRule::checkMode($mode); if ($mode == WebAclRule::WRITE) { foreach ($this->resRules as $i) { $i->setMode(WebAclRule::READ); if (self::$autosave) { $i->save($this->res->...
php
public function revokeAll(int $mode = WebAclRule::READ): WebAcl { WebAclRule::checkMode($mode); if ($mode == WebAclRule::WRITE) { foreach ($this->resRules as $i) { $i->setMode(WebAclRule::READ); if (self::$autosave) { $i->save($this->res->...
[ "public", "function", "revokeAll", "(", "int", "$", "mode", "=", "WebAclRule", "::", "READ", ")", ":", "WebAcl", "{", "WebAclRule", "::", "checkMode", "(", "$", "mode", ")", ";", "if", "(", "$", "mode", "==", "WebAclRule", "::", "WRITE", ")", "{", "f...
Revokes privileges from all users, groups and classes for a given Fedora resource. Only rules directly targeting the given resource are removed. Rules inherited from Fedora parents sharing the same ACL are not affected. If `$mode` equals to `WebAclRule::WRITE` all privileges are limited to `WebAclRule::READ`. If `$m...
[ "Revokes", "privileges", "from", "all", "users", "groups", "and", "classes", "for", "a", "given", "Fedora", "resource", "." ]
e22c7cd2613f3c8daf0deee879896d9cd7f61b41
https://github.com/acdh-oeaw/repo-php-util/blob/e22c7cd2613f3c8daf0deee879896d9cd7f61b41/src/acdhOeaw/fedora/acl/WebAcl.php#L223-L241
29,746
acdh-oeaw/repo-php-util
src/acdhOeaw/fedora/acl/WebAcl.php
WebAcl.getRules
public function getRules(bool $inherited = true): array { $ret = array(); foreach ($this->resRules as $i) { $ret[] = $i->getData(); } if ($inherited) { foreach ($this->extRules as $i) { $ret[] = $i->getData(); } } return...
php
public function getRules(bool $inherited = true): array { $ret = array(); foreach ($this->resRules as $i) { $ret[] = $i->getData(); } if ($inherited) { foreach ($this->extRules as $i) { $ret[] = $i->getData(); } } return...
[ "public", "function", "getRules", "(", "bool", "$", "inherited", "=", "true", ")", ":", "array", "{", "$", "ret", "=", "array", "(", ")", ";", "foreach", "(", "$", "this", "->", "resRules", "as", "$", "i", ")", "{", "$", "ret", "[", "]", "=", "...
Fetches an array of `WebAclRule` objects containing access rules for a corresponding Fedora resource. @param bool $inherited should rules inherited from parent (in Fedora terms) resources be taken into account? @return array
[ "Fetches", "an", "array", "of", "WebAclRule", "objects", "containing", "access", "rules", "for", "a", "corresponding", "Fedora", "resource", "." ]
e22c7cd2613f3c8daf0deee879896d9cd7f61b41
https://github.com/acdh-oeaw/repo-php-util/blob/e22c7cd2613f3c8daf0deee879896d9cd7f61b41/src/acdhOeaw/fedora/acl/WebAcl.php#L376-L387
29,747
acdh-oeaw/repo-php-util
src/acdhOeaw/fedora/acl/WebAcl.php
WebAcl.reload
public function reload(): WebAcl { $fedora = $this->res->getFedora(); $resUri = $this->res->getUri(true); $aclUri = $this->res->getAclUrl(); $this->resRules = []; $this->extRules = []; if ($aclUri) { $query = new SimpleQuery(self::QU...
php
public function reload(): WebAcl { $fedora = $this->res->getFedora(); $resUri = $this->res->getUri(true); $aclUri = $this->res->getAclUrl(); $this->resRules = []; $this->extRules = []; if ($aclUri) { $query = new SimpleQuery(self::QU...
[ "public", "function", "reload", "(", ")", ":", "WebAcl", "{", "$", "fedora", "=", "$", "this", "->", "res", "->", "getFedora", "(", ")", ";", "$", "resUri", "=", "$", "this", "->", "res", "->", "getUri", "(", "true", ")", ";", "$", "aclUri", "=",...
Reloads access rules by quering a triplestore. See class description for use cases.
[ "Reloads", "access", "rules", "by", "quering", "a", "triplestore", ".", "See", "class", "description", "for", "use", "cases", "." ]
e22c7cd2613f3c8daf0deee879896d9cd7f61b41
https://github.com/acdh-oeaw/repo-php-util/blob/e22c7cd2613f3c8daf0deee879896d9cd7f61b41/src/acdhOeaw/fedora/acl/WebAcl.php#L393-L413
29,748
acdh-oeaw/repo-php-util
src/acdhOeaw/fedora/acl/WebAcl.php
WebAcl.createAcl
public function createAcl(): WebAcl { $resMeta = $this->res->getMetadata(true); $acls = $resMeta->allResources(self::ACL_LINK_PROP); if (count($acls) > 1) { throw new RuntimeException('Resource has many ACLs'); } else if (count($acls) > 0) { return $this; ...
php
public function createAcl(): WebAcl { $resMeta = $this->res->getMetadata(true); $acls = $resMeta->allResources(self::ACL_LINK_PROP); if (count($acls) > 1) { throw new RuntimeException('Resource has many ACLs'); } else if (count($acls) > 0) { return $this; ...
[ "public", "function", "createAcl", "(", ")", ":", "WebAcl", "{", "$", "resMeta", "=", "$", "this", "->", "res", "->", "getMetadata", "(", "true", ")", ";", "$", "acls", "=", "$", "resMeta", "->", "allResources", "(", "self", "::", "ACL_LINK_PROP", ")",...
Creates an ACL attached directly to a given resource. All rules describing resource from ACL currently in effect are automatically moved to the newly created ACL. Resource has to permanently exist in the repository for operation to succeed (you can not create a resource's ACL within the same transaction a resource was...
[ "Creates", "an", "ACL", "attached", "directly", "to", "a", "given", "resource", ".", "All", "rules", "describing", "resource", "from", "ACL", "currently", "in", "effect", "are", "automatically", "moved", "to", "the", "newly", "created", "ACL", "." ]
e22c7cd2613f3c8daf0deee879896d9cd7f61b41
https://github.com/acdh-oeaw/repo-php-util/blob/e22c7cd2613f3c8daf0deee879896d9cd7f61b41/src/acdhOeaw/fedora/acl/WebAcl.php#L429-L482
29,749
acdh-oeaw/repo-php-util
src/acdhOeaw/fedora/acl/WebAcl.php
WebAcl.deleteAcl
public function deleteAcl(): WebAcl { $fedora = $this->res->getFedora(); $resMeta = $this->res->getMetadata(); $acls = $resMeta->allResources(self::ACL_LINK_PROP); if (count($acls) == 0) { throw new NotFound(); } foreach ($acls as $i) { $aclRes...
php
public function deleteAcl(): WebAcl { $fedora = $this->res->getFedora(); $resMeta = $this->res->getMetadata(); $acls = $resMeta->allResources(self::ACL_LINK_PROP); if (count($acls) == 0) { throw new NotFound(); } foreach ($acls as $i) { $aclRes...
[ "public", "function", "deleteAcl", "(", ")", ":", "WebAcl", "{", "$", "fedora", "=", "$", "this", "->", "res", "->", "getFedora", "(", ")", ";", "$", "resMeta", "=", "$", "this", "->", "res", "->", "getMetadata", "(", ")", ";", "$", "acls", "=", ...
Removes ACL directly attached to this resource. If there is no such ACL, error is thrown. @return \acdhOeaw\fedora\acl\WebAcl @throws NotFound
[ "Removes", "ACL", "directly", "attached", "to", "this", "resource", ".", "If", "there", "is", "no", "such", "ACL", "error", "is", "thrown", "." ]
e22c7cd2613f3c8daf0deee879896d9cd7f61b41
https://github.com/acdh-oeaw/repo-php-util/blob/e22c7cd2613f3c8daf0deee879896d9cd7f61b41/src/acdhOeaw/fedora/acl/WebAcl.php#L490-L514
29,750
locomotivemtl/charcoal-ui
src/Charcoal/Ui/Dashboard/DashboardTrait.php
DashboardTrait.setWidgetBuilder
protected function setWidgetBuilder($builder) { if (is_object($builder)) { $this->widgetBuilder = $builder; } else { throw new InvalidArgumentException( sprintf( 'Argument must be a widget builder, %s given', (is_object(...
php
protected function setWidgetBuilder($builder) { if (is_object($builder)) { $this->widgetBuilder = $builder; } else { throw new InvalidArgumentException( sprintf( 'Argument must be a widget builder, %s given', (is_object(...
[ "protected", "function", "setWidgetBuilder", "(", "$", "builder", ")", "{", "if", "(", "is_object", "(", "$", "builder", ")", ")", "{", "$", "this", "->", "widgetBuilder", "=", "$", "builder", ";", "}", "else", "{", "throw", "new", "InvalidArgumentExceptio...
Set a widget builder. @param object $builder The builder to create customized widget objects. @throws InvalidArgumentException If the argument is not a widget builder. @return DashboardInterface Chainable
[ "Set", "a", "widget", "builder", "." ]
0070f35d89ea24ae93720734d261c02a10e218b6
https://github.com/locomotivemtl/charcoal-ui/blob/0070f35d89ea24ae93720734d261c02a10e218b6/src/Charcoal/Ui/Dashboard/DashboardTrait.php#L59-L73
29,751
locomotivemtl/charcoal-ui
src/Charcoal/Ui/Dashboard/DashboardTrait.php
DashboardTrait.setWidgets
public function setWidgets(array $widgets) { $this->widgets = []; foreach ($widgets as $widgetIdent => $widget) { $this->addWidget($widgetIdent, $widget); } return $this; }
php
public function setWidgets(array $widgets) { $this->widgets = []; foreach ($widgets as $widgetIdent => $widget) { $this->addWidget($widgetIdent, $widget); } return $this; }
[ "public", "function", "setWidgets", "(", "array", "$", "widgets", ")", "{", "$", "this", "->", "widgets", "=", "[", "]", ";", "foreach", "(", "$", "widgets", "as", "$", "widgetIdent", "=>", "$", "widget", ")", "{", "$", "this", "->", "addWidget", "("...
Set the dashboard's widgets. @param array $widgets A collection of widgets. @return DashboardInterface Chainable
[ "Set", "the", "dashboard", "s", "widgets", "." ]
0070f35d89ea24ae93720734d261c02a10e218b6
https://github.com/locomotivemtl/charcoal-ui/blob/0070f35d89ea24ae93720734d261c02a10e218b6/src/Charcoal/Ui/Dashboard/DashboardTrait.php#L111-L120
29,752
locomotivemtl/charcoal-ui
src/Charcoal/Ui/Dashboard/DashboardTrait.php
DashboardTrait.addWidget
public function addWidget($widgetIdent, $widget) { if (!is_string($widgetIdent)) { throw new InvalidArgumentException( 'Widget identifier needs to be a string' ); } if ($widget instanceof UiItemInterface) { $this->widgets[$widgetIdent] = $...
php
public function addWidget($widgetIdent, $widget) { if (!is_string($widgetIdent)) { throw new InvalidArgumentException( 'Widget identifier needs to be a string' ); } if ($widget instanceof UiItemInterface) { $this->widgets[$widgetIdent] = $...
[ "public", "function", "addWidget", "(", "$", "widgetIdent", ",", "$", "widget", ")", "{", "if", "(", "!", "is_string", "(", "$", "widgetIdent", ")", ")", "{", "throw", "new", "InvalidArgumentException", "(", "'Widget identifier needs to be a string'", ")", ";", ...
Add a widget to the dashboard. If a widget with the same $widgetIdent already exists, it will be overridden. @param string $widgetIdent The widget identifier. @param UiItemInterface|array $widget The widget object or structure. @throws InvalidArgumentException If the widget is invalid. @return D...
[ "Add", "a", "widget", "to", "the", "dashboard", "." ]
0070f35d89ea24ae93720734d261c02a10e218b6
https://github.com/locomotivemtl/charcoal-ui/blob/0070f35d89ea24ae93720734d261c02a10e218b6/src/Charcoal/Ui/Dashboard/DashboardTrait.php#L132-L157
29,753
polyfony-inc/polyfony
Private/Polyfony/Keys.php
Keys.generate
public static function generate($mixed=null) { // create a sha1 signature of the array with a salt $hash = hash( Config::get('keys', 'algo'), json_encode(array($mixed, Config::get('keys', 'salt')), JSON_NUMERIC_CHECK) ); // get last 10 and first 10 chars together, convert to uppercase, return the key re...
php
public static function generate($mixed=null) { // create a sha1 signature of the array with a salt $hash = hash( Config::get('keys', 'algo'), json_encode(array($mixed, Config::get('keys', 'salt')), JSON_NUMERIC_CHECK) ); // get last 10 and first 10 chars together, convert to uppercase, return the key re...
[ "public", "static", "function", "generate", "(", "$", "mixed", "=", "null", ")", "{", "// create a sha1 signature of the array with a salt", "$", "hash", "=", "hash", "(", "Config", "::", "get", "(", "'keys'", ",", "'algo'", ")", ",", "json_encode", "(", "arra...
generate a key
[ "generate", "a", "key" ]
76dac2f4141c8f480370236295c07dfa52e5c589
https://github.com/polyfony-inc/polyfony/blob/76dac2f4141c8f480370236295c07dfa52e5c589/Private/Polyfony/Keys.php#L8-L16
29,754
polyfony-inc/polyfony
Private/Polyfony/Keys.php
Keys.compare
public static function compare($key=null, $mixed=null) { // if no key is provided if(!$key || strlen($key) != 20) { // return false return(false); } // if keys do match return(self::generate($mixed) == $key ?: false); }
php
public static function compare($key=null, $mixed=null) { // if no key is provided if(!$key || strlen($key) != 20) { // return false return(false); } // if keys do match return(self::generate($mixed) == $key ?: false); }
[ "public", "static", "function", "compare", "(", "$", "key", "=", "null", ",", "$", "mixed", "=", "null", ")", "{", "// if no key is provided", "if", "(", "!", "$", "key", "||", "strlen", "(", "$", "key", ")", "!=", "20", ")", "{", "// return false", ...
compare a key with a new dynamically generated one
[ "compare", "a", "key", "with", "a", "new", "dynamically", "generated", "one" ]
76dac2f4141c8f480370236295c07dfa52e5c589
https://github.com/polyfony-inc/polyfony/blob/76dac2f4141c8f480370236295c07dfa52e5c589/Private/Polyfony/Keys.php#L19-L27
29,755
secucard/secucard-connect-php-sdk
src/SecucardConnect/Product/Services/IdentRequestsService.php
IdentRequestsService.process
private function process(IdentRequest &$request) { if (isset($request->person)) { foreach ($request->person as $p) { $contact = $p->contact; if (!empty($contact) && !empty($contact->picture)) { $contact->pictureObject = $this->initMediaResource...
php
private function process(IdentRequest &$request) { if (isset($request->person)) { foreach ($request->person as $p) { $contact = $p->contact; if (!empty($contact) && !empty($contact->picture)) { $contact->pictureObject = $this->initMediaResource...
[ "private", "function", "process", "(", "IdentRequest", "&", "$", "request", ")", "{", "if", "(", "isset", "(", "$", "request", "->", "person", ")", ")", "{", "foreach", "(", "$", "request", "->", "person", "as", "$", "p", ")", "{", "$", "contact", ...
Handles proper contact picture initialization after retrieval of a ident request. @param IdentRequest $request
[ "Handles", "proper", "contact", "picture", "initialization", "after", "retrieval", "of", "a", "ident", "request", "." ]
d990686095e4e02d0924fc12b9bf60140fe8efab
https://github.com/secucard/secucard-connect-php-sdk/blob/d990686095e4e02d0924fc12b9bf60140fe8efab/src/SecucardConnect/Product/Services/IdentRequestsService.php#L42-L52
29,756
acdh-oeaw/repo-php-util
src/acdhOeaw/schema/dissemination/Service.php
Service.addParameter
public function addParameter(string $name, string $defaultValue = '', string $rdfProperty = '_') { $id = $this->getId() . '/param/' . $name; $this->params[] = new Parameter( $this->fedora, $id, $this, $name, $defaultValue, $rdfProperty ); ...
php
public function addParameter(string $name, string $defaultValue = '', string $rdfProperty = '_') { $id = $this->getId() . '/param/' . $name; $this->params[] = new Parameter( $this->fedora, $id, $this, $name, $defaultValue, $rdfProperty ); ...
[ "public", "function", "addParameter", "(", "string", "$", "name", ",", "string", "$", "defaultValue", "=", "''", ",", "string", "$", "rdfProperty", "=", "'_'", ")", "{", "$", "id", "=", "$", "this", "->", "getId", "(", ")", ".", "'/param/'", ".", "$"...
Defines a dissemination service parameter. @param string $name parameter name @param string $defaultValue default parameter value @param string $rdfProperty RDF property holding parameter value in resources' metadata
[ "Defines", "a", "dissemination", "service", "parameter", "." ]
e22c7cd2613f3c8daf0deee879896d9cd7f61b41
https://github.com/acdh-oeaw/repo-php-util/blob/e22c7cd2613f3c8daf0deee879896d9cd7f61b41/src/acdhOeaw/schema/dissemination/Service.php#L146-L152
29,757
acdh-oeaw/repo-php-util
src/acdhOeaw/schema/dissemination/Service.php
Service.addMatch
public function addMatch(string $property, string $value, bool $required) { $id = $this->getid() . '/match/' . (count($this->matches) + 1); $this->matches[] = new Match($this->fedora, $id, $this, $property, $value, $required); }
php
public function addMatch(string $property, string $value, bool $required) { $id = $this->getid() . '/match/' . (count($this->matches) + 1); $this->matches[] = new Match($this->fedora, $id, $this, $property, $value, $required); }
[ "public", "function", "addMatch", "(", "string", "$", "property", ",", "string", "$", "value", ",", "bool", "$", "required", ")", "{", "$", "id", "=", "$", "this", "->", "getid", "(", ")", ".", "'/match/'", ".", "(", "count", "(", "$", "this", "->"...
Defines a matching rule for the dissemination service @param string $property RDF property to be checked in resource's metadata @param string $value expected RDF property value in resource's metadata @param bool $required is this match rule compulsory? @see \acdhOeaw\schema\dissemination\Match
[ "Defines", "a", "matching", "rule", "for", "the", "dissemination", "service" ]
e22c7cd2613f3c8daf0deee879896d9cd7f61b41
https://github.com/acdh-oeaw/repo-php-util/blob/e22c7cd2613f3c8daf0deee879896d9cd7f61b41/src/acdhOeaw/schema/dissemination/Service.php#L161-L164
29,758
acdh-oeaw/repo-php-util
src/acdhOeaw/schema/dissemination/Service.php
Service.getMetadata
public function getMetadata(): Resource { $meta = (new Graph())->resource('.'); $meta->addType(RC::get('fedoraServiceClass')); $meta->addResource(RC::idProp(), $this->getId()); $meta->addLiteral(RC::titleProp(), $this->getId()); $meta->addLiteral(RC::get('fedoraServiceLocProp...
php
public function getMetadata(): Resource { $meta = (new Graph())->resource('.'); $meta->addType(RC::get('fedoraServiceClass')); $meta->addResource(RC::idProp(), $this->getId()); $meta->addLiteral(RC::titleProp(), $this->getId()); $meta->addLiteral(RC::get('fedoraServiceLocProp...
[ "public", "function", "getMetadata", "(", ")", ":", "Resource", "{", "$", "meta", "=", "(", "new", "Graph", "(", ")", ")", "->", "resource", "(", "'.'", ")", ";", "$", "meta", "->", "addType", "(", "RC", "::", "get", "(", "'fedoraServiceClass'", ")",...
Returns metadata describing the dissemination service. @return Resource
[ "Returns", "metadata", "describing", "the", "dissemination", "service", "." ]
e22c7cd2613f3c8daf0deee879896d9cd7f61b41
https://github.com/acdh-oeaw/repo-php-util/blob/e22c7cd2613f3c8daf0deee879896d9cd7f61b41/src/acdhOeaw/schema/dissemination/Service.php#L170-L189
29,759
acdh-oeaw/repo-php-util
src/acdhOeaw/schema/dissemination/Service.php
Service.updateRms
public function updateRms(bool $create = true, bool $uploadBinary = true, string $path = '/'): FedoraResource { parent::updateRms($create, $uploadBinary, $path); $res = $this->getResource(false, false); $chPath = $res->getUri(true) . '/'; $children = [...
php
public function updateRms(bool $create = true, bool $uploadBinary = true, string $path = '/'): FedoraResource { parent::updateRms($create, $uploadBinary, $path); $res = $this->getResource(false, false); $chPath = $res->getUri(true) . '/'; $children = [...
[ "public", "function", "updateRms", "(", "bool", "$", "create", "=", "true", ",", "bool", "$", "uploadBinary", "=", "true", ",", "string", "$", "path", "=", "'/'", ")", ":", "FedoraResource", "{", "parent", "::", "updateRms", "(", "$", "create", ",", "$...
Updates the dissemination service definition in the repository. @param bool $create should repository resource be created if it does not exist? @param bool $uploadBinary should binary data of the real-world entity be uploaded uppon repository resource creation? @param string $path where to create a resource (if it does...
[ "Updates", "the", "dissemination", "service", "definition", "in", "the", "repository", "." ]
e22c7cd2613f3c8daf0deee879896d9cd7f61b41
https://github.com/acdh-oeaw/repo-php-util/blob/e22c7cd2613f3c8daf0deee879896d9cd7f61b41/src/acdhOeaw/schema/dissemination/Service.php#L203-L231
29,760
ventoviro/windwalker-core
src/Core/Logger/LoggerManager.php
LoggerManager.setLoggers
public function setLoggers(array $loggers) { foreach ($loggers as $channel => $logger) { $this->addLogger($channel, $logger); } return $this; }
php
public function setLoggers(array $loggers) { foreach ($loggers as $channel => $logger) { $this->addLogger($channel, $logger); } return $this; }
[ "public", "function", "setLoggers", "(", "array", "$", "loggers", ")", "{", "foreach", "(", "$", "loggers", "as", "$", "channel", "=>", "$", "logger", ")", "{", "$", "this", "->", "addLogger", "(", "$", "channel", ",", "$", "logger", ")", ";", "}", ...
Method to set property loggers @param LoggerInterface[] $loggers @return static Return self to support chaining.
[ "Method", "to", "set", "property", "loggers" ]
0ed53059fc2d5d2d9b72f0e4aeef2fdf6aac0074
https://github.com/ventoviro/windwalker-core/blob/0ed53059fc2d5d2d9b72f0e4aeef2fdf6aac0074/src/Core/Logger/LoggerManager.php#L519-L526
29,761
acdh-oeaw/repo-php-util
src/acdhOeaw/fedora/SparqlClient.php
SparqlClient.query
public function query(string $query, int $nTries = 1): Result { $headers = array('Content-Type' => 'application/x-www-form-urlencoded'); $body = 'query=' . rawurlencode($query); $request = new Request('POST', $this->url, $headers, $body); while ($nTries > 0) { $nTries--; ...
php
public function query(string $query, int $nTries = 1): Result { $headers = array('Content-Type' => 'application/x-www-form-urlencoded'); $body = 'query=' . rawurlencode($query); $request = new Request('POST', $this->url, $headers, $body); while ($nTries > 0) { $nTries--; ...
[ "public", "function", "query", "(", "string", "$", "query", ",", "int", "$", "nTries", "=", "1", ")", ":", "Result", "{", "$", "headers", "=", "array", "(", "'Content-Type'", "=>", "'application/x-www-form-urlencoded'", ")", ";", "$", "body", "=", "'query=...
Runs a given query. There is no support for UPDATE queries. @param string $query SPARQL query to be run @param int $nTries how many times request should be repeated in case of error before giving up @return \EasyRdf\Sparql\Result
[ "Runs", "a", "given", "query", "." ]
e22c7cd2613f3c8daf0deee879896d9cd7f61b41
https://github.com/acdh-oeaw/repo-php-util/blob/e22c7cd2613f3c8daf0deee879896d9cd7f61b41/src/acdhOeaw/fedora/SparqlClient.php#L91-L109
29,762
secucard/secucard-connect-php-sdk
src/SecucardConnect/Product/Common/Model/BaseCollection.php
BaseCollection.get
public function get($id) { foreach ($this->items as $item) { if ($item->id === $id) { return $item; } } return null; }
php
public function get($id) { foreach ($this->items as $item) { if ($item->id === $id) { return $item; } } return null; }
[ "public", "function", "get", "(", "$", "id", ")", "{", "foreach", "(", "$", "this", "->", "items", "as", "$", "item", ")", "{", "if", "(", "$", "item", "->", "id", "===", "$", "id", ")", "{", "return", "$", "item", ";", "}", "}", "return", "n...
Get object in the collection by id @param string $id @return mixed|null
[ "Get", "object", "in", "the", "collection", "by", "id" ]
d990686095e4e02d0924fc12b9bf60140fe8efab
https://github.com/secucard/secucard-connect-php-sdk/blob/d990686095e4e02d0924fc12b9bf60140fe8efab/src/SecucardConnect/Product/Common/Model/BaseCollection.php#L64-L72
29,763
locomotivemtl/charcoal-ui
src/Charcoal/Ui/ConditionalizableTrait.php
ConditionalizableTrait.parseConditionalLogic
final protected function parseConditionalLogic($condition) { if ($condition === null) { return null; } if (is_bool($condition)) { return $condition; } $not = false; if (is_string($condition)) { $not = ($condition[0] === '!'); ...
php
final protected function parseConditionalLogic($condition) { if ($condition === null) { return null; } if (is_bool($condition)) { return $condition; } $not = false; if (is_string($condition)) { $not = ($condition[0] === '!'); ...
[ "final", "protected", "function", "parseConditionalLogic", "(", "$", "condition", ")", "{", "if", "(", "$", "condition", "===", "null", ")", "{", "return", "null", ";", "}", "if", "(", "is_bool", "(", "$", "condition", ")", ")", "{", "return", "$", "co...
Resolve the conditional logic. @param mixed $condition The condition. @return boolean|null
[ "Resolve", "the", "conditional", "logic", "." ]
0070f35d89ea24ae93720734d261c02a10e218b6
https://github.com/locomotivemtl/charcoal-ui/blob/0070f35d89ea24ae93720734d261c02a10e218b6/src/Charcoal/Ui/ConditionalizableTrait.php#L78-L99
29,764
jmikola/JmikolaWildcardEventDispatcherBundle
EventDispatcher/ContainerAwareEventDispatcher.php
ContainerAwareEventDispatcher.addListenerServicePattern
private function addListenerServicePattern($eventPattern, $callback, $priority = 0) { if (!is_array($callback) || 2 !== count($callback)) { throw new \InvalidArgumentException('Expected an array("service", "method") argument'); } $container = $this->container; $listenerP...
php
private function addListenerServicePattern($eventPattern, $callback, $priority = 0) { if (!is_array($callback) || 2 !== count($callback)) { throw new \InvalidArgumentException('Expected an array("service", "method") argument'); } $container = $this->container; $listenerP...
[ "private", "function", "addListenerServicePattern", "(", "$", "eventPattern", ",", "$", "callback", ",", "$", "priority", "=", "0", ")", "{", "if", "(", "!", "is_array", "(", "$", "callback", ")", "||", "2", "!==", "count", "(", "$", "callback", ")", "...
Adds a service as an event listener for all events matching the specified pattern. @param string $eventPattern @param callback $callback @param integer $priority @throw InvalidArgumentException if the callback is not a service/method tuple
[ "Adds", "a", "service", "as", "an", "event", "listener", "for", "all", "events", "matching", "the", "specified", "pattern", "." ]
b3295ce0eb4212f9bb0d6d0d0913cfa13d2e3884
https://github.com/jmikola/JmikolaWildcardEventDispatcherBundle/blob/b3295ce0eb4212f9bb0d6d0d0913cfa13d2e3884/EventDispatcher/ContainerAwareEventDispatcher.php#L48-L60
29,765
jmikola/JmikolaWildcardEventDispatcherBundle
EventDispatcher/ContainerAwareEventDispatcher.php
ContainerAwareEventDispatcher.addSubscriberService
public function addSubscriberService($serviceId, $class) { foreach ($class::getSubscribedEvents() as $eventName => $params) { if (is_string($params)) { $this->addListenerService($eventName, array($serviceId, $params), 0); } elseif (is_string($params[0])) { ...
php
public function addSubscriberService($serviceId, $class) { foreach ($class::getSubscribedEvents() as $eventName => $params) { if (is_string($params)) { $this->addListenerService($eventName, array($serviceId, $params), 0); } elseif (is_string($params[0])) { ...
[ "public", "function", "addSubscriberService", "(", "$", "serviceId", ",", "$", "class", ")", "{", "foreach", "(", "$", "class", "::", "getSubscribedEvents", "(", ")", "as", "$", "eventName", "=>", "$", "params", ")", "{", "if", "(", "is_string", "(", "$"...
Adds a service as an event subscriber for all events matching the specified pattern @param string $serviceId The service ID of the subscriber service @param string $class The service's class name (which must implement EventSubscriberInterface)
[ "Adds", "a", "service", "as", "an", "event", "subscriber", "for", "all", "events", "matching", "the", "specified", "pattern" ]
b3295ce0eb4212f9bb0d6d0d0913cfa13d2e3884
https://github.com/jmikola/JmikolaWildcardEventDispatcherBundle/blob/b3295ce0eb4212f9bb0d6d0d0913cfa13d2e3884/EventDispatcher/ContainerAwareEventDispatcher.php#L69-L82
29,766
crcms/microservice-framework
src/Console/Kernel.php
Kernel.commands
protected function commands() { $commands = $this->app['config']->get('mount.commands', []); if ($commands) { Artisan::starting(function ($artisan) use ($commands) { $artisan->resolveCommands($commands); }); } }
php
protected function commands() { $commands = $this->app['config']->get('mount.commands', []); if ($commands) { Artisan::starting(function ($artisan) use ($commands) { $artisan->resolveCommands($commands); }); } }
[ "protected", "function", "commands", "(", ")", "{", "$", "commands", "=", "$", "this", "->", "app", "[", "'config'", "]", "->", "get", "(", "'mount.commands'", ",", "[", "]", ")", ";", "if", "(", "$", "commands", ")", "{", "Artisan", "::", "starting"...
Register the Closure based commands for the application. @return void
[ "Register", "the", "Closure", "based", "commands", "for", "the", "application", "." ]
7ad513562e333599642d5697ee45572d7d9e713d
https://github.com/crcms/microservice-framework/blob/7ad513562e333599642d5697ee45572d7d9e713d/src/Console/Kernel.php#L46-L54
29,767
polyfony-inc/polyfony
Private/Polyfony/Route.php
Route.setDestination
public function setDestination(string $merged_destination) :self { // explode the parameters list($this->bundle, $this->controller, $this->action) = explode('/', str_replace('@', '/',$merged_destination)); // if the action is an url parameter if(Route\Helper::isThisAParameterName($this->action)) { // we ...
php
public function setDestination(string $merged_destination) :self { // explode the parameters list($this->bundle, $this->controller, $this->action) = explode('/', str_replace('@', '/',$merged_destination)); // if the action is an url parameter if(Route\Helper::isThisAParameterName($this->action)) { // we ...
[ "public", "function", "setDestination", "(", "string", "$", "merged_destination", ")", ":", "self", "{", "// explode the parameters", "list", "(", "$", "this", "->", "bundle", ",", "$", "this", "->", "controller", ",", "$", "this", "->", "action", ")", "=", ...
shortcut for destination
[ "shortcut", "for", "destination" ]
76dac2f4141c8f480370236295c07dfa52e5c589
https://github.com/polyfony-inc/polyfony/blob/76dac2f4141c8f480370236295c07dfa52e5c589/Private/Polyfony/Route.php#L74-L89
29,768
polyfony-inc/polyfony
Private/Polyfony/Response/CSV.php
CSV.buildAndGetDocument
public static function buildAndGetDocument($content) :array { // convert the array to a basic CSV string $content = is_array($content) ? self::convertArrayToString($content) : $content; // convert the content to the proper charset (if needs be) $content = mb_convert_encoding($content, self::destination_charset)...
php
public static function buildAndGetDocument($content) :array { // convert the array to a basic CSV string $content = is_array($content) ? self::convertArrayToString($content) : $content; // convert the content to the proper charset (if needs be) $content = mb_convert_encoding($content, self::destination_charset)...
[ "public", "static", "function", "buildAndGetDocument", "(", "$", "content", ")", ":", "array", "{", "// convert the array to a basic CSV string", "$", "content", "=", "is_array", "(", "$", "content", ")", "?", "self", "::", "convertArrayToString", "(", "$", "conte...
with preformatted csv will still work
[ "with", "preformatted", "csv", "will", "still", "work" ]
76dac2f4141c8f480370236295c07dfa52e5c589
https://github.com/polyfony-inc/polyfony/blob/76dac2f4141c8f480370236295c07dfa52e5c589/Private/Polyfony/Response/CSV.php#L15-L27
29,769
ventoviro/windwalker-core
src/Core/Console/CoreConsole.php
CoreConsole.prepareExecute
protected function prepareExecute() { if (class_exists(ComposerInformation::class)) { $this->version = ComposerInformation::getInstalledVersion('windwalker/core'); } if ($this->getRootCommand()->getOption('n')) { IOFactory::getIO()->setInput(new NullInput()); ...
php
protected function prepareExecute() { if (class_exists(ComposerInformation::class)) { $this->version = ComposerInformation::getInstalledVersion('windwalker/core'); } if ($this->getRootCommand()->getOption('n')) { IOFactory::getIO()->setInput(new NullInput()); ...
[ "protected", "function", "prepareExecute", "(", ")", "{", "if", "(", "class_exists", "(", "ComposerInformation", "::", "class", ")", ")", "{", "$", "this", "->", "version", "=", "ComposerInformation", "::", "getInstalledVersion", "(", "'windwalker/core'", ")", "...
Prepare execute hook. @return void
[ "Prepare", "execute", "hook", "." ]
0ed53059fc2d5d2d9b72f0e4aeef2fdf6aac0074
https://github.com/ventoviro/windwalker-core/blob/0ed53059fc2d5d2d9b72f0e4aeef2fdf6aac0074/src/Core/Console/CoreConsole.php#L226-L235
29,770
secucard/secucard-connect-php-sdk
src/SecucardConnect/Auth/PasswordCredentials.php
PasswordCredentials.addParameters
public function addParameters(&$params) { $params['grant_type'] = $this->getType(); $params['username'] = $this->username; $params['password'] = $this->password; }
php
public function addParameters(&$params) { $params['grant_type'] = $this->getType(); $params['username'] = $this->username; $params['password'] = $this->password; }
[ "public", "function", "addParameters", "(", "&", "$", "params", ")", "{", "$", "params", "[", "'grant_type'", "]", "=", "$", "this", "->", "getType", "(", ")", ";", "$", "params", "[", "'username'", "]", "=", "$", "this", "->", "username", ";", "$", ...
Function add parameters to params array @param array $params
[ "Function", "add", "parameters", "to", "params", "array" ]
d990686095e4e02d0924fc12b9bf60140fe8efab
https://github.com/secucard/secucard-connect-php-sdk/blob/d990686095e4e02d0924fc12b9bf60140fe8efab/src/SecucardConnect/Auth/PasswordCredentials.php#L36-L41
29,771
ventoviro/windwalker-core
src/Core/View/AbstractView.php
AbstractView.pipe
public function pipe($name, $handler = null) { if (is_callable($name)) { $handler = $name; $name = null; } return $handler($this->getRepository($name), $this); }
php
public function pipe($name, $handler = null) { if (is_callable($name)) { $handler = $name; $name = null; } return $handler($this->getRepository($name), $this); }
[ "public", "function", "pipe", "(", "$", "name", ",", "$", "handler", "=", "null", ")", "{", "if", "(", "is_callable", "(", "$", "name", ")", ")", "{", "$", "handler", "=", "$", "name", ";", "$", "name", "=", "null", ";", "}", "return", "$", "ha...
Pipe a callback to model and view then return value. @param string|callable $name The name alias of model, keep NULL as default model. Or just send a callable here as handler. @param callable $handler The callback handler. @return mixed
[ "Pipe", "a", "callback", "to", "model", "and", "view", "then", "return", "value", "." ]
0ed53059fc2d5d2d9b72f0e4aeef2fdf6aac0074
https://github.com/ventoviro/windwalker-core/blob/0ed53059fc2d5d2d9b72f0e4aeef2fdf6aac0074/src/Core/View/AbstractView.php#L663-L671
29,772
ventoviro/windwalker-core
src/Core/View/AbstractView.php
AbstractView.applyData
public function applyData($name, $handler = null) { if (is_callable($name)) { $handler = $name; $name = null; } $handler($this->getRepository($name), $this->getData()); return $this; }
php
public function applyData($name, $handler = null) { if (is_callable($name)) { $handler = $name; $name = null; } $handler($this->getRepository($name), $this->getData()); return $this; }
[ "public", "function", "applyData", "(", "$", "name", ",", "$", "handler", "=", "null", ")", "{", "if", "(", "is_callable", "(", "$", "name", ")", ")", "{", "$", "handler", "=", "$", "name", ";", "$", "name", "=", "null", ";", "}", "$", "handler",...
Apply a callback to model and view data. @param string|callable $name The name alias of model, keep NULL as default model. Or just send a callable here as handler. @param callable $handler The callback handler. @return $this
[ "Apply", "a", "callback", "to", "model", "and", "view", "data", "." ]
0ed53059fc2d5d2d9b72f0e4aeef2fdf6aac0074
https://github.com/ventoviro/windwalker-core/blob/0ed53059fc2d5d2d9b72f0e4aeef2fdf6aac0074/src/Core/View/AbstractView.php#L682-L692
29,773
acdh-oeaw/repo-php-util
src/acdhOeaw/schema/redmine/Issue.php
Issue.fetchAll
static public function fetchAll(Fedora $fedora, bool $progressBar, array $filters = array()): array { $param = ['key=' . urlencode(RC::get('redmineApiKey')), 'limit' => 1000000]; foreach ($filters as $k => $v) { $param[] = urlencode($k) . '=' . urlencode($...
php
static public function fetchAll(Fedora $fedora, bool $progressBar, array $filters = array()): array { $param = ['key=' . urlencode(RC::get('redmineApiKey')), 'limit' => 1000000]; foreach ($filters as $k => $v) { $param[] = urlencode($k) . '=' . urlencode($...
[ "static", "public", "function", "fetchAll", "(", "Fedora", "$", "fedora", ",", "bool", "$", "progressBar", ",", "array", "$", "filters", "=", "array", "(", ")", ")", ":", "array", "{", "$", "param", "=", "[", "'key='", ".", "urlencode", "(", "RC", ":...
Returns array of all Issue objects which can be fetched from the Redmine. See the Redmine::fetchAll() description for details; @param \acdhOeaw\fedora\Fedora $fedora Fedora connection @param bool $progressBar should progress bar be displayed (makes sense only if the standard output is a console) @param array $filters...
[ "Returns", "array", "of", "all", "Issue", "objects", "which", "can", "be", "fetched", "from", "the", "Redmine", "." ]
e22c7cd2613f3c8daf0deee879896d9cd7f61b41
https://github.com/acdh-oeaw/repo-php-util/blob/e22c7cd2613f3c8daf0deee879896d9cd7f61b41/src/acdhOeaw/schema/redmine/Issue.php#L57-L66
29,774
polyfony-inc/polyfony
Private/Polyfony/Record/Aware.php
Aware.save
public function save() :bool { // if an id already exists if($this->_['id']) { // we can update and return the number of affected rows (0 on error, 1 on success) return (bool) self::_update() ->set($this->__toArray(true, true)) ->where(['id'=>$this->_['id']]) ->execute(); } // this is a new...
php
public function save() :bool { // if an id already exists if($this->_['id']) { // we can update and return the number of affected rows (0 on error, 1 on success) return (bool) self::_update() ->set($this->__toArray(true, true)) ->where(['id'=>$this->_['id']]) ->execute(); } // this is a new...
[ "public", "function", "save", "(", ")", ":", "bool", "{", "// if an id already exists", "if", "(", "$", "this", "->", "_", "[", "'id'", "]", ")", "{", "// we can update and return the number of affected rows (0 on error, 1 on success)", "return", "(", "bool", ")", "...
update or create
[ "update", "or", "create" ]
76dac2f4141c8f480370236295c07dfa52e5c589
https://github.com/polyfony-inc/polyfony/blob/76dac2f4141c8f480370236295c07dfa52e5c589/Private/Polyfony/Record/Aware.php#L155-L183
29,775
polyfony-inc/polyfony
Private/Polyfony/Record/Aware.php
Aware.create
public static function create(array $columns_and_values=[]) { return Database::query() ->insert($columns_and_values) ->into(self::tableName()) ->execute(); }
php
public static function create(array $columns_and_values=[]) { return Database::query() ->insert($columns_and_values) ->into(self::tableName()) ->execute(); }
[ "public", "static", "function", "create", "(", "array", "$", "columns_and_values", "=", "[", "]", ")", "{", "return", "Database", "::", "query", "(", ")", "->", "insert", "(", "$", "columns_and_values", ")", "->", "into", "(", "self", "::", "tableName", ...
shortcut to insert an element
[ "shortcut", "to", "insert", "an", "element" ]
76dac2f4141c8f480370236295c07dfa52e5c589
https://github.com/polyfony-inc/polyfony/blob/76dac2f4141c8f480370236295c07dfa52e5c589/Private/Polyfony/Record/Aware.php#L205-L212
29,776
polyfony-inc/polyfony
Private/Polyfony/Record/Aware.php
Aware._select
public static function _select(array $select=[]) :Query { // returns a Query object, to execute, or to complement with some more parameters return Database::query() ->select($select) ->from(self::tableName()); }
php
public static function _select(array $select=[]) :Query { // returns a Query object, to execute, or to complement with some more parameters return Database::query() ->select($select) ->from(self::tableName()); }
[ "public", "static", "function", "_select", "(", "array", "$", "select", "=", "[", "]", ")", ":", "Query", "{", "// returns a Query object, to execute, or to complement with some more parameters", "return", "Database", "::", "query", "(", ")", "->", "select", "(", "$...
shortcut that bootstraps a select query
[ "shortcut", "that", "bootstraps", "a", "select", "query" ]
76dac2f4141c8f480370236295c07dfa52e5c589
https://github.com/polyfony-inc/polyfony/blob/76dac2f4141c8f480370236295c07dfa52e5c589/Private/Polyfony/Record/Aware.php#L215-L222
29,777
polyfony-inc/polyfony
Private/Polyfony/Store/Memcache.php
Memcache.setup
public static function setup($server, $host, $port) { // Sanity check: Make sure we have received a valid switch ($server) { case 'Memcache' : self::$_memcache = new \Memcache(); break; case 'Memcached' : self::$_memcache = new \Memcached(); break; default : throw new \Exception("Unknown server ...
php
public static function setup($server, $host, $port) { // Sanity check: Make sure we have received a valid switch ($server) { case 'Memcache' : self::$_memcache = new \Memcache(); break; case 'Memcached' : self::$_memcache = new \Memcached(); break; default : throw new \Exception("Unknown server ...
[ "public", "static", "function", "setup", "(", "$", "server", ",", "$", "host", ",", "$", "port", ")", "{", "// Sanity check: Make sure we have received a valid", "switch", "(", "$", "server", ")", "{", "case", "'Memcache'", ":", "self", "::", "$", "_memcache",...
Setup Memcache for storing data. @access public @param string $server Whether we are using Memcache or Memcached. @param string $host The location of the Memcache server. @param string $port The port the Memcache server lives on. @throws \Exception If passed an incorrect server.
[ "Setup", "Memcache", "for", "storing", "data", "." ]
76dac2f4141c8f480370236295c07dfa52e5c589
https://github.com/polyfony-inc/polyfony/blob/76dac2f4141c8f480370236295c07dfa52e5c589/Private/Polyfony/Store/Memcache.php#L28-L38
29,778
stevegrunwell/phpunit-markup-assertions
src/MarkupAssertionsTrait.php
MarkupAssertionsTrait.assertContainsSelector
public function assertContainsSelector($selector, $output = '', $message = '') { $results = $this->executeDomQuery($output, $selector); $this->assertGreaterThan(0, count($results), $message); }
php
public function assertContainsSelector($selector, $output = '', $message = '') { $results = $this->executeDomQuery($output, $selector); $this->assertGreaterThan(0, count($results), $message); }
[ "public", "function", "assertContainsSelector", "(", "$", "selector", ",", "$", "output", "=", "''", ",", "$", "message", "=", "''", ")", "{", "$", "results", "=", "$", "this", "->", "executeDomQuery", "(", "$", "output", ",", "$", "selector", ")", ";"...
Assert that the given string contains an element matching the given selector. @since 1.0.0 @param string $selector A query selector for the element to find. @param string $output The output that should contain the $selector. @param string $message A message to display if the assertion fails.
[ "Assert", "that", "the", "given", "string", "contains", "an", "element", "matching", "the", "given", "selector", "." ]
545ce29918d4d986e26961bf4d380c655583ece9
https://github.com/stevegrunwell/phpunit-markup-assertions/blob/545ce29918d4d986e26961bf4d380c655583ece9/src/MarkupAssertionsTrait.php#L27-L32
29,779
stevegrunwell/phpunit-markup-assertions
src/MarkupAssertionsTrait.php
MarkupAssertionsTrait.assertNotContainsSelector
public function assertNotContainsSelector($selector, $output = '', $message = '') { $results = $this->executeDomQuery($output, $selector); $this->assertEquals(0, count($results), $message); }
php
public function assertNotContainsSelector($selector, $output = '', $message = '') { $results = $this->executeDomQuery($output, $selector); $this->assertEquals(0, count($results), $message); }
[ "public", "function", "assertNotContainsSelector", "(", "$", "selector", ",", "$", "output", "=", "''", ",", "$", "message", "=", "''", ")", "{", "$", "results", "=", "$", "this", "->", "executeDomQuery", "(", "$", "output", ",", "$", "selector", ")", ...
Assert that the given string does not contain an element matching the given selector. @since 1.0.0 @param string $selector A query selector for the element to find. @param string $output The output that should not contain the $selector. @param string $message A message to display if the assertion fails.
[ "Assert", "that", "the", "given", "string", "does", "not", "contain", "an", "element", "matching", "the", "given", "selector", "." ]
545ce29918d4d986e26961bf4d380c655583ece9
https://github.com/stevegrunwell/phpunit-markup-assertions/blob/545ce29918d4d986e26961bf4d380c655583ece9/src/MarkupAssertionsTrait.php#L43-L48
29,780
stevegrunwell/phpunit-markup-assertions
src/MarkupAssertionsTrait.php
MarkupAssertionsTrait.assertSelectorCount
public function assertSelectorCount($count, $selector, $output = '', $message = '') { $results = $this->executeDomQuery($output, $selector); $this->assertCount($count, $results, $message); }
php
public function assertSelectorCount($count, $selector, $output = '', $message = '') { $results = $this->executeDomQuery($output, $selector); $this->assertCount($count, $results, $message); }
[ "public", "function", "assertSelectorCount", "(", "$", "count", ",", "$", "selector", ",", "$", "output", "=", "''", ",", "$", "message", "=", "''", ")", "{", "$", "results", "=", "$", "this", "->", "executeDomQuery", "(", "$", "output", ",", "$", "s...
Assert the number of times an element matching the given selector is found. @since 1.0.0 @param int $count The number of matching elements expected. @param string $selector A query selector for the element to find. @param string $output The markup to run the assertion against. @param string $message A messag...
[ "Assert", "the", "number", "of", "times", "an", "element", "matching", "the", "given", "selector", "is", "found", "." ]
545ce29918d4d986e26961bf4d380c655583ece9
https://github.com/stevegrunwell/phpunit-markup-assertions/blob/545ce29918d4d986e26961bf4d380c655583ece9/src/MarkupAssertionsTrait.php#L60-L65
29,781
stevegrunwell/phpunit-markup-assertions
src/MarkupAssertionsTrait.php
MarkupAssertionsTrait.assertHasElementWithAttributes
public function assertHasElementWithAttributes($attributes = [], $output = '', $message = '') { $this->assertContainsSelector( '*' . $this->flattenAttributeArray($attributes), $output, $message ); }
php
public function assertHasElementWithAttributes($attributes = [], $output = '', $message = '') { $this->assertContainsSelector( '*' . $this->flattenAttributeArray($attributes), $output, $message ); }
[ "public", "function", "assertHasElementWithAttributes", "(", "$", "attributes", "=", "[", "]", ",", "$", "output", "=", "''", ",", "$", "message", "=", "''", ")", "{", "$", "this", "->", "assertContainsSelector", "(", "'*'", ".", "$", "this", "->", "flat...
Assert that an element with the given attributes exists in the given markup. @since 1.0.0 @param array $attributes An array of HTML attributes that should be found on the element. @param string $output The output that should contain an element with the provided $attributes. @param string $message A message to...
[ "Assert", "that", "an", "element", "with", "the", "given", "attributes", "exists", "in", "the", "given", "markup", "." ]
545ce29918d4d986e26961bf4d380c655583ece9
https://github.com/stevegrunwell/phpunit-markup-assertions/blob/545ce29918d4d986e26961bf4d380c655583ece9/src/MarkupAssertionsTrait.php#L77-L84
29,782
stevegrunwell/phpunit-markup-assertions
src/MarkupAssertionsTrait.php
MarkupAssertionsTrait.assertNotHasElementWithAttributes
public function assertNotHasElementWithAttributes($attributes = [], $output = '', $message = '') { $this->assertNotContainsSelector( '*' . $this->flattenAttributeArray($attributes), $output, $message ); }
php
public function assertNotHasElementWithAttributes($attributes = [], $output = '', $message = '') { $this->assertNotContainsSelector( '*' . $this->flattenAttributeArray($attributes), $output, $message ); }
[ "public", "function", "assertNotHasElementWithAttributes", "(", "$", "attributes", "=", "[", "]", ",", "$", "output", "=", "''", ",", "$", "message", "=", "''", ")", "{", "$", "this", "->", "assertNotContainsSelector", "(", "'*'", ".", "$", "this", "->", ...
Assert that an element with the given attributes does not exist in the given markup. @since 1.0.0 @param array $attributes An array of HTML attributes that should be found on the element. @param string $output The output that should not contain an element with the provided $attributes. @param string $message ...
[ "Assert", "that", "an", "element", "with", "the", "given", "attributes", "does", "not", "exist", "in", "the", "given", "markup", "." ]
545ce29918d4d986e26961bf4d380c655583ece9
https://github.com/stevegrunwell/phpunit-markup-assertions/blob/545ce29918d4d986e26961bf4d380c655583ece9/src/MarkupAssertionsTrait.php#L96-L103
29,783
stevegrunwell/phpunit-markup-assertions
src/MarkupAssertionsTrait.php
MarkupAssertionsTrait.assertElementContains
public function assertElementContains($contents, $selector = '', $output = '', $message = '') { $this->assertContains( $contents, $this->getInnerHtmlOfMatchedElements($output, $selector), $message ); }
php
public function assertElementContains($contents, $selector = '', $output = '', $message = '') { $this->assertContains( $contents, $this->getInnerHtmlOfMatchedElements($output, $selector), $message ); }
[ "public", "function", "assertElementContains", "(", "$", "contents", ",", "$", "selector", "=", "''", ",", "$", "output", "=", "''", ",", "$", "message", "=", "''", ")", "{", "$", "this", "->", "assertContains", "(", "$", "contents", ",", "$", "this", ...
Assert an element's contents contain the given string. @since 1.1.0 @param string $contents The string to look for within the DOM node's contents. @param string $selector A query selector for the element to find. @param string $output The output that should contain the $selector. @param string $message A message t...
[ "Assert", "an", "element", "s", "contents", "contain", "the", "given", "string", "." ]
545ce29918d4d986e26961bf4d380c655583ece9
https://github.com/stevegrunwell/phpunit-markup-assertions/blob/545ce29918d4d986e26961bf4d380c655583ece9/src/MarkupAssertionsTrait.php#L115-L122
29,784
stevegrunwell/phpunit-markup-assertions
src/MarkupAssertionsTrait.php
MarkupAssertionsTrait.assertElementNotContains
public function assertElementNotContains($contents, $selector = '', $output = '', $message = '') { $this->assertNotContains( $contents, $this->getInnerHtmlOfMatchedElements($output, $selector), $message ); }
php
public function assertElementNotContains($contents, $selector = '', $output = '', $message = '') { $this->assertNotContains( $contents, $this->getInnerHtmlOfMatchedElements($output, $selector), $message ); }
[ "public", "function", "assertElementNotContains", "(", "$", "contents", ",", "$", "selector", "=", "''", ",", "$", "output", "=", "''", ",", "$", "message", "=", "''", ")", "{", "$", "this", "->", "assertNotContains", "(", "$", "contents", ",", "$", "t...
Assert an element's contents do not contain the given string. @since 1.1.0 @param string $contents The string to look for within the DOM node's contents. @param string $selector A query selector for the element to find. @param string $output The output that should not contain the $selector. @param string $message ...
[ "Assert", "an", "element", "s", "contents", "do", "not", "contain", "the", "given", "string", "." ]
545ce29918d4d986e26961bf4d380c655583ece9
https://github.com/stevegrunwell/phpunit-markup-assertions/blob/545ce29918d4d986e26961bf4d380c655583ece9/src/MarkupAssertionsTrait.php#L134-L141
29,785
stevegrunwell/phpunit-markup-assertions
src/MarkupAssertionsTrait.php
MarkupAssertionsTrait.assertElementRegExp
public function assertElementRegExp($regexp, $selector = '', $output = '', $message = '') { $this->assertRegExp( $regexp, $this->getInnerHtmlOfMatchedElements($output, $selector), $message ); }
php
public function assertElementRegExp($regexp, $selector = '', $output = '', $message = '') { $this->assertRegExp( $regexp, $this->getInnerHtmlOfMatchedElements($output, $selector), $message ); }
[ "public", "function", "assertElementRegExp", "(", "$", "regexp", ",", "$", "selector", "=", "''", ",", "$", "output", "=", "''", ",", "$", "message", "=", "''", ")", "{", "$", "this", "->", "assertRegExp", "(", "$", "regexp", ",", "$", "this", "->", ...
Assert an element's contents contain the given regular expression pattern. @since 1.1.0 @param string $regexp The regular expression pattern to look for within the DOM node. @param string $selector A query selector for the element to find. @param string $output The output that should contain the $selector. @param...
[ "Assert", "an", "element", "s", "contents", "contain", "the", "given", "regular", "expression", "pattern", "." ]
545ce29918d4d986e26961bf4d380c655583ece9
https://github.com/stevegrunwell/phpunit-markup-assertions/blob/545ce29918d4d986e26961bf4d380c655583ece9/src/MarkupAssertionsTrait.php#L153-L160
29,786
stevegrunwell/phpunit-markup-assertions
src/MarkupAssertionsTrait.php
MarkupAssertionsTrait.assertElementNotRegExp
public function assertElementNotRegExp($regexp, $selector = '', $output = '', $message = '') { $this->assertNotRegExp( $regexp, $this->getInnerHtmlOfMatchedElements($output, $selector), $message ); }
php
public function assertElementNotRegExp($regexp, $selector = '', $output = '', $message = '') { $this->assertNotRegExp( $regexp, $this->getInnerHtmlOfMatchedElements($output, $selector), $message ); }
[ "public", "function", "assertElementNotRegExp", "(", "$", "regexp", ",", "$", "selector", "=", "''", ",", "$", "output", "=", "''", ",", "$", "message", "=", "''", ")", "{", "$", "this", "->", "assertNotRegExp", "(", "$", "regexp", ",", "$", "this", ...
Assert an element's contents do not contain the given regular expression pattern. @since 1.1.0 @param string $regexp The regular expression pattern to look for within the DOM node. @param string $selector A query selector for the element to find. @param string $output The output that should not contain the $selec...
[ "Assert", "an", "element", "s", "contents", "do", "not", "contain", "the", "given", "regular", "expression", "pattern", "." ]
545ce29918d4d986e26961bf4d380c655583ece9
https://github.com/stevegrunwell/phpunit-markup-assertions/blob/545ce29918d4d986e26961bf4d380c655583ece9/src/MarkupAssertionsTrait.php#L172-L179
29,787
stevegrunwell/phpunit-markup-assertions
src/MarkupAssertionsTrait.php
MarkupAssertionsTrait.flattenAttributeArray
protected function flattenAttributeArray(array $attributes) { if (empty($attributes)) { throw new RiskyTestError('Attributes array is empty.'); } array_walk($attributes, function (&$value, $key) { // Boolean attributes. if (null === $value) { ...
php
protected function flattenAttributeArray(array $attributes) { if (empty($attributes)) { throw new RiskyTestError('Attributes array is empty.'); } array_walk($attributes, function (&$value, $key) { // Boolean attributes. if (null === $value) { ...
[ "protected", "function", "flattenAttributeArray", "(", "array", "$", "attributes", ")", "{", "if", "(", "empty", "(", "$", "attributes", ")", ")", "{", "throw", "new", "RiskyTestError", "(", "'Attributes array is empty.'", ")", ";", "}", "array_walk", "(", "$"...
Given an array of HTML attributes, flatten them into a XPath attribute selector. @since 1.0.0 @throws RiskyTestError When the $attributes array is empty. @param array $attributes HTML attributes and their values. @return string A XPath attribute query selector.
[ "Given", "an", "array", "of", "HTML", "attributes", "flatten", "them", "into", "a", "XPath", "attribute", "selector", "." ]
545ce29918d4d986e26961bf4d380c655583ece9
https://github.com/stevegrunwell/phpunit-markup-assertions/blob/545ce29918d4d986e26961bf4d380c655583ece9/src/MarkupAssertionsTrait.php#L209-L225
29,788
stevegrunwell/phpunit-markup-assertions
src/MarkupAssertionsTrait.php
MarkupAssertionsTrait.getInnerHtmlOfMatchedElements
protected function getInnerHtmlOfMatchedElements($markup, $query) { $results = $this->executeDomQuery($markup, $query); $contents = []; // Loop through results and collect their innerHTML values. foreach ($results as $result) { $document = new DOMDocument; $...
php
protected function getInnerHtmlOfMatchedElements($markup, $query) { $results = $this->executeDomQuery($markup, $query); $contents = []; // Loop through results and collect their innerHTML values. foreach ($results as $result) { $document = new DOMDocument; $...
[ "protected", "function", "getInnerHtmlOfMatchedElements", "(", "$", "markup", ",", "$", "query", ")", "{", "$", "results", "=", "$", "this", "->", "executeDomQuery", "(", "$", "markup", ",", "$", "query", ")", ";", "$", "contents", "=", "[", "]", ";", ...
Given HTML markup and a DOM selector query, collect the innerHTML of the matched selectors. @since 1.1.0 @param string $markup The HTML for the DOMDocument. @param string $query The DOM selector query. @return string The concatenated innerHTML of any matched selectors.
[ "Given", "HTML", "markup", "and", "a", "DOM", "selector", "query", "collect", "the", "innerHTML", "of", "the", "matched", "selectors", "." ]
545ce29918d4d986e26961bf4d380c655583ece9
https://github.com/stevegrunwell/phpunit-markup-assertions/blob/545ce29918d4d986e26961bf4d380c655583ece9/src/MarkupAssertionsTrait.php#L237-L251
29,789
polyfony-inc/polyfony
Private/Polyfony/Thumbnail.php
Thumbnail.source
public function source($path, $override_chroot = false) { // if chroot is enabled, restrict the path to the chroot $this->Source = Filesystem::chroot($path, $override_chroot); // return self return($this); }
php
public function source($path, $override_chroot = false) { // if chroot is enabled, restrict the path to the chroot $this->Source = Filesystem::chroot($path, $override_chroot); // return self return($this); }
[ "public", "function", "source", "(", "$", "path", ",", "$", "override_chroot", "=", "false", ")", "{", "// if chroot is enabled, restrict the path to the chroot", "$", "this", "->", "Source", "=", "Filesystem", "::", "chroot", "(", "$", "path", ",", "$", "overri...
set the source image path
[ "set", "the", "source", "image", "path" ]
76dac2f4141c8f480370236295c07dfa52e5c589
https://github.com/polyfony-inc/polyfony/blob/76dac2f4141c8f480370236295c07dfa52e5c589/Private/Polyfony/Thumbnail.php#L57-L62
29,790
polyfony-inc/polyfony
Private/Polyfony/Thumbnail.php
Thumbnail.type
public function type($mimetype) { // if the type is correct if(in_array($mimetype, $this->Allowed)) { // set the type $this->Output = $mimetype; } // return self return($this); }
php
public function type($mimetype) { // if the type is correct if(in_array($mimetype, $this->Allowed)) { // set the type $this->Output = $mimetype; } // return self return($this); }
[ "public", "function", "type", "(", "$", "mimetype", ")", "{", "// if the type is correct", "if", "(", "in_array", "(", "$", "mimetype", ",", "$", "this", "->", "Allowed", ")", ")", "{", "// set the type", "$", "this", "->", "Output", "=", "$", "mimetype", ...
set the output type
[ "set", "the", "output", "type" ]
76dac2f4141c8f480370236295c07dfa52e5c589
https://github.com/polyfony-inc/polyfony/blob/76dac2f4141c8f480370236295c07dfa52e5c589/Private/Polyfony/Thumbnail.php#L73-L81
29,791
polyfony-inc/polyfony
Private/Polyfony/Thumbnail.php
Thumbnail.size
public function size($pixels) { // if the value is acceptable if(is_numeric($pixels) && $pixels >= 16 && $pixels <= 4096) { // set the limit $this->Maximum = intval($pixels); } // return self return($this); }
php
public function size($pixels) { // if the value is acceptable if(is_numeric($pixels) && $pixels >= 16 && $pixels <= 4096) { // set the limit $this->Maximum = intval($pixels); } // return self return($this); }
[ "public", "function", "size", "(", "$", "pixels", ")", "{", "// if the value is acceptable", "if", "(", "is_numeric", "(", "$", "pixels", ")", "&&", "$", "pixels", ">=", "16", "&&", "$", "pixels", "<=", "4096", ")", "{", "// set the limit", "$", "this", ...
set the size
[ "set", "the", "size" ]
76dac2f4141c8f480370236295c07dfa52e5c589
https://github.com/polyfony-inc/polyfony/blob/76dac2f4141c8f480370236295c07dfa52e5c589/Private/Polyfony/Thumbnail.php#L84-L92
29,792
polyfony-inc/polyfony
Private/Polyfony/Thumbnail.php
Thumbnail.quality
public function quality($quality) { // if the value is acceptable if(is_numeric($quality) && $quality >= 10 && $quality <= 100) { // set the quality $this->Quality = intval($quality); } // return self return($this); }
php
public function quality($quality) { // if the value is acceptable if(is_numeric($quality) && $quality >= 10 && $quality <= 100) { // set the quality $this->Quality = intval($quality); } // return self return($this); }
[ "public", "function", "quality", "(", "$", "quality", ")", "{", "// if the value is acceptable", "if", "(", "is_numeric", "(", "$", "quality", ")", "&&", "$", "quality", ">=", "10", "&&", "$", "quality", "<=", "100", ")", "{", "// set the quality", "$", "t...
set the quality
[ "set", "the", "quality" ]
76dac2f4141c8f480370236295c07dfa52e5c589
https://github.com/polyfony-inc/polyfony/blob/76dac2f4141c8f480370236295c07dfa52e5c589/Private/Polyfony/Thumbnail.php#L95-L103
29,793
ventoviro/windwalker-core
src/Core/Asset/AssetManager.php
AssetManager.exists
public function exists($uri, $strict = false) { if (static::isAbsoluteUrl($uri)) { return $uri; } $assetUri = $this->path; if (static::isAbsoluteUrl($assetUri)) { return rtrim($assetUri, '/') . '/' . ltrim($uri, '/'); } $root = $this->addSys...
php
public function exists($uri, $strict = false) { if (static::isAbsoluteUrl($uri)) { return $uri; } $assetUri = $this->path; if (static::isAbsoluteUrl($assetUri)) { return rtrim($assetUri, '/') . '/' . ltrim($uri, '/'); } $root = $this->addSys...
[ "public", "function", "exists", "(", "$", "uri", ",", "$", "strict", "=", "false", ")", "{", "if", "(", "static", "::", "isAbsoluteUrl", "(", "$", "uri", ")", ")", "{", "return", "$", "uri", ";", "}", "$", "assetUri", "=", "$", "this", "->", "pat...
Check asset uri exists in system and return actual path. @param string $uri The file uri to check. @param bool $strict Check .min file or un-min file exists again if input file not exists. @return bool|string @since 3.3
[ "Check", "asset", "uri", "exists", "in", "system", "and", "return", "actual", "path", "." ]
0ed53059fc2d5d2d9b72f0e4aeef2fdf6aac0074
https://github.com/ventoviro/windwalker-core/blob/0ed53059fc2d5d2d9b72f0e4aeef2fdf6aac0074/src/Core/Asset/AssetManager.php#L269-L300
29,794
ventoviro/windwalker-core
src/Core/Asset/AssetManager.php
AssetManager.root
public function root($uri = null, $version = false) { if ($version === true) { $version = $this->getVersion(); } if ($version) { if (strpos($uri, '?') !== false) { $uri .= '&' . $version; } else { $uri .= '?' . $version; ...
php
public function root($uri = null, $version = false) { if ($version === true) { $version = $this->getVersion(); } if ($version) { if (strpos($uri, '?') !== false) { $uri .= '&' . $version; } else { $uri .= '?' . $version; ...
[ "public", "function", "root", "(", "$", "uri", "=", "null", ",", "$", "version", "=", "false", ")", "{", "if", "(", "$", "version", "===", "true", ")", "{", "$", "version", "=", "$", "this", "->", "getVersion", "(", ")", ";", "}", "if", "(", "$...
Method to get property Root @param string $uri @param bool $version @return string
[ "Method", "to", "get", "property", "Root" ]
0ed53059fc2d5d2d9b72f0e4aeef2fdf6aac0074
https://github.com/ventoviro/windwalker-core/blob/0ed53059fc2d5d2d9b72f0e4aeef2fdf6aac0074/src/Core/Asset/AssetManager.php#L1021-L1040
29,795
acdh-oeaw/repo-php-util
src/acdhOeaw/schema/redmine/User.php
User.fetchAll
static public function fetchAll(Fedora $fedora, bool $progressBar): array { $param = 'limit=100000&key=' . urlencode(RC::get('redmineApiKey')); return self::redmineFetchLoop($fedora, $progressBar, 'users', $param); }
php
static public function fetchAll(Fedora $fedora, bool $progressBar): array { $param = 'limit=100000&key=' . urlencode(RC::get('redmineApiKey')); return self::redmineFetchLoop($fedora, $progressBar, 'users', $param); }
[ "static", "public", "function", "fetchAll", "(", "Fedora", "$", "fedora", ",", "bool", "$", "progressBar", ")", ":", "array", "{", "$", "param", "=", "'limit=100000&key='", ".", "urlencode", "(", "RC", "::", "get", "(", "'redmineApiKey'", ")", ")", ";", ...
Returns array of all User objects which can be fetched from the Redmine. See the Redmine::fetchAll() description for details; @param \acdhOeaw\fedora\Fedora $fedora Fedora connection @param bool $progressBar should progress bar be displayed (makes sense only if the standard output is a console) @return array @see Red...
[ "Returns", "array", "of", "all", "User", "objects", "which", "can", "be", "fetched", "from", "the", "Redmine", "." ]
e22c7cd2613f3c8daf0deee879896d9cd7f61b41
https://github.com/acdh-oeaw/repo-php-util/blob/e22c7cd2613f3c8daf0deee879896d9cd7f61b41/src/acdhOeaw/schema/redmine/User.php#L56-L59
29,796
ventoviro/windwalker-core
src/Core/Ioc.php
Ioc.share
public function share($key, $callback, $name = null) { return static::factory($name)->share($key, $callback); }
php
public function share($key, $callback, $name = null) { return static::factory($name)->share($key, $callback); }
[ "public", "function", "share", "(", "$", "key", ",", "$", "callback", ",", "$", "name", "=", "null", ")", "{", "return", "static", "::", "factory", "(", "$", "name", ")", "->", "share", "(", "$", "key", ",", "$", "callback", ")", ";", "}" ]
Convenience method for creating shared keys. @param string $key Name of dataStore key to set. @param callable $callback Callable function to run when requesting the specified $key. @param string $name Container name. @return Container This object for chaining. @since 2.0
[ "Convenience", "method", "for", "creating", "shared", "keys", "." ]
0ed53059fc2d5d2d9b72f0e4aeef2fdf6aac0074
https://github.com/ventoviro/windwalker-core/blob/0ed53059fc2d5d2d9b72f0e4aeef2fdf6aac0074/src/Core/Ioc.php#L401-L404
29,797
crcms/microservice-framework
src/Foundation/Exceptions/ExceptionHandler.php
ExceptionHandler.convertExceptionToServiceException
protected function convertExceptionToServiceException(Exception $e): ServiceException { $exception = get_class($e); $conversion = $this->container['config']->get('exception.conversion', []); if (isset($conversion[$exception])) { return new $conversion[$exception]($e->getMessage(...
php
protected function convertExceptionToServiceException(Exception $e): ServiceException { $exception = get_class($e); $conversion = $this->container['config']->get('exception.conversion', []); if (isset($conversion[$exception])) { return new $conversion[$exception]($e->getMessage(...
[ "protected", "function", "convertExceptionToServiceException", "(", "Exception", "$", "e", ")", ":", "ServiceException", "{", "$", "exception", "=", "get_class", "(", "$", "e", ")", ";", "$", "conversion", "=", "$", "this", "->", "container", "[", "'config'", ...
Convert other exception to service exception. @param Exception $e @return ServiceException
[ "Convert", "other", "exception", "to", "service", "exception", "." ]
7ad513562e333599642d5697ee45572d7d9e713d
https://github.com/crcms/microservice-framework/blob/7ad513562e333599642d5697ee45572d7d9e713d/src/Foundation/Exceptions/ExceptionHandler.php#L159-L173
29,798
acdh-oeaw/repo-php-util
src/acdhOeaw/fedora/FedoraResource.php
FedoraResource.getUri
public function getUri(bool $standardized = false): string { if ($standardized) { return $this->fedora->standardizeUri($this->uri); } else { return $this->fedora->sanitizeUri($this->uri); } }
php
public function getUri(bool $standardized = false): string { if ($standardized) { return $this->fedora->standardizeUri($this->uri); } else { return $this->fedora->sanitizeUri($this->uri); } }
[ "public", "function", "getUri", "(", "bool", "$", "standardized", "=", "false", ")", ":", "string", "{", "if", "(", "$", "standardized", ")", "{", "return", "$", "this", "->", "fedora", "->", "standardizeUri", "(", "$", "this", "->", "uri", ")", ";", ...
Returns resource's Fedora URI @param bool $standardized should the Uri be standardized (in the form used in a triplestore) or current Fedora connection specific @return string
[ "Returns", "resource", "s", "Fedora", "URI" ]
e22c7cd2613f3c8daf0deee879896d9cd7f61b41
https://github.com/acdh-oeaw/repo-php-util/blob/e22c7cd2613f3c8daf0deee879896d9cd7f61b41/src/acdhOeaw/fedora/FedoraResource.php#L158-L164
29,799
acdh-oeaw/repo-php-util
src/acdhOeaw/fedora/FedoraResource.php
FedoraResource.getId
public function getId(): string { $ids = $this->getIds(); if (count($ids) === 0) { throw new NoAcdhId(); } $acdhId = null; foreach ($ids as $id) { $inIdNmsp = strpos($id, RC::idNmsp()) === 0; $inVocabsNmsp = strpos($id, RC::vocabsNmsp()) ==...
php
public function getId(): string { $ids = $this->getIds(); if (count($ids) === 0) { throw new NoAcdhId(); } $acdhId = null; foreach ($ids as $id) { $inIdNmsp = strpos($id, RC::idNmsp()) === 0; $inVocabsNmsp = strpos($id, RC::vocabsNmsp()) ==...
[ "public", "function", "getId", "(", ")", ":", "string", "{", "$", "ids", "=", "$", "this", "->", "getIds", "(", ")", ";", "if", "(", "count", "(", "$", "ids", ")", "===", "0", ")", "{", "throw", "new", "NoAcdhId", "(", ")", ";", "}", "$", "ac...
Returns resource's ACDH UUID. If there is no or are many ACDH UUIDs, an error is thrown. @return string @throws RuntimeException @see getIds()
[ "Returns", "resource", "s", "ACDH", "UUID", "." ]
e22c7cd2613f3c8daf0deee879896d9cd7f61b41
https://github.com/acdh-oeaw/repo-php-util/blob/e22c7cd2613f3c8daf0deee879896d9cd7f61b41/src/acdhOeaw/fedora/FedoraResource.php#L175-L195