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,900
acdh-oeaw/repo-php-util
src/acdhOeaw/fedora/Fedora.php
Fedora.getResourceByIds
public function getResourceByIds(array $ids, bool $checkIfExist = true): FedoraResource { echo self::$debug ? "[Fedora] searching for " . implode(', ', $ids) . "\n" : ''; $matches = array(); foreach ($ids as $id) { try { $res = $this->getResou...
php
public function getResourceByIds(array $ids, bool $checkIfExist = true): FedoraResource { echo self::$debug ? "[Fedora] searching for " . implode(', ', $ids) . "\n" : ''; $matches = array(); foreach ($ids as $id) { try { $res = $this->getResou...
[ "public", "function", "getResourceByIds", "(", "array", "$", "ids", ",", "bool", "$", "checkIfExist", "=", "true", ")", ":", "FedoraResource", "{", "echo", "self", "::", "$", "debug", "?", "\"[Fedora] searching for \"", ".", "implode", "(", "', '", ",", "$",...
Finds Fedora resources matching any of provided ids. @param array $ids @param bool $checkIfExist should we make sure resource was not deleted during the current transaction @return \acdhOeaw\fedora\FedoraResource @throws NotFound @throws AmbiguousMatch
[ "Finds", "Fedora", "resources", "matching", "any", "of", "provided", "ids", "." ]
e22c7cd2613f3c8daf0deee879896d9cd7f61b41
https://github.com/acdh-oeaw/repo-php-util/blob/e22c7cd2613f3c8daf0deee879896d9cd7f61b41/src/acdhOeaw/fedora/Fedora.php#L428-L452
29,901
acdh-oeaw/repo-php-util
src/acdhOeaw/fedora/Fedora.php
Fedora.getResourcesByProperty
public function getResourcesByProperty(string $property, string $value = '', bool $checkIfExist = true): array { $query = new Query(); if ($value != '') { $param = new HasValue($property, $value); } else { $param = new HasPropert...
php
public function getResourcesByProperty(string $property, string $value = '', bool $checkIfExist = true): array { $query = new Query(); if ($value != '') { $param = new HasValue($property, $value); } else { $param = new HasPropert...
[ "public", "function", "getResourcesByProperty", "(", "string", "$", "property", ",", "string", "$", "value", "=", "''", ",", "bool", "$", "checkIfExist", "=", "true", ")", ":", "array", "{", "$", "query", "=", "new", "Query", "(", ")", ";", "if", "(", ...
Finds all Fedora resources having a given RDF property value. If the value is not provided, all resources with a given property set (to any value) are returned. Be aware that all property values introduced during the transaction are not taken into account (see documentation of the begin() method) @param string $prop...
[ "Finds", "all", "Fedora", "resources", "having", "a", "given", "RDF", "property", "value", "." ]
e22c7cd2613f3c8daf0deee879896d9cd7f61b41
https://github.com/acdh-oeaw/repo-php-util/blob/e22c7cd2613f3c8daf0deee879896d9cd7f61b41/src/acdhOeaw/fedora/Fedora.php#L470-L480
29,902
acdh-oeaw/repo-php-util
src/acdhOeaw/fedora/Fedora.php
Fedora.getResourcesByPropertyRegEx
public function getResourcesByPropertyRegEx(string $property, string $regEx, string $flags = 'i', bool $checkIfExist = true): array { $query = new Query(); $query->addParameter(new MatchesRegEx($property, $re...
php
public function getResourcesByPropertyRegEx(string $property, string $regEx, string $flags = 'i', bool $checkIfExist = true): array { $query = new Query(); $query->addParameter(new MatchesRegEx($property, $re...
[ "public", "function", "getResourcesByPropertyRegEx", "(", "string", "$", "property", ",", "string", "$", "regEx", ",", "string", "$", "flags", "=", "'i'", ",", "bool", "$", "checkIfExist", "=", "true", ")", ":", "array", "{", "$", "query", "=", "new", "Q...
Finds all Fedora resources with a given RDF property matching given regular expression. Be aware that all property values introduced during the transaction are not taken into account (see documentation of the begin() method) @param string $property fully qualified property URI @param string $regEx regular expression ...
[ "Finds", "all", "Fedora", "resources", "with", "a", "given", "RDF", "property", "matching", "given", "regular", "expression", "." ]
e22c7cd2613f3c8daf0deee879896d9cd7f61b41
https://github.com/acdh-oeaw/repo-php-util/blob/e22c7cd2613f3c8daf0deee879896d9cd7f61b41/src/acdhOeaw/fedora/Fedora.php#L496-L502
29,903
acdh-oeaw/repo-php-util
src/acdhOeaw/fedora/Fedora.php
Fedora.getResourcesByQuery
public function getResourcesByQuery(Query $query, string $resVar = '?res', bool $checkIfExist = true): array { $resVar = preg_replace('|^[?]|', '', $resVar); $results = $this->runQuery($query); $resources = array(); foreach ($results as $i) { ...
php
public function getResourcesByQuery(Query $query, string $resVar = '?res', bool $checkIfExist = true): array { $resVar = preg_replace('|^[?]|', '', $resVar); $results = $this->runQuery($query); $resources = array(); foreach ($results as $i) { ...
[ "public", "function", "getResourcesByQuery", "(", "Query", "$", "query", ",", "string", "$", "resVar", "=", "'?res'", ",", "bool", "$", "checkIfExist", "=", "true", ")", ":", "array", "{", "$", "resVar", "=", "preg_replace", "(", "'|^[?]|'", ",", "''", "...
Finds all Fedora resources satisfying a given SPARQL query. Be aware that the triplestore state is not affected by all actions performed during the active transaction. @param Query $query SPARQL query fetching resources from the triplestore @param string $resVar name of the SPARQL variable containing resource URIs @p...
[ "Finds", "all", "Fedora", "resources", "satisfying", "a", "given", "SPARQL", "query", "." ]
e22c7cd2613f3c8daf0deee879896d9cd7f61b41
https://github.com/acdh-oeaw/repo-php-util/blob/e22c7cd2613f3c8daf0deee879896d9cd7f61b41/src/acdhOeaw/fedora/Fedora.php#L518-L534
29,904
acdh-oeaw/repo-php-util
src/acdhOeaw/fedora/Fedora.php
Fedora.verifyResources
private function verifyResources(array $resources, bool $force = false): array { $passed = array(); foreach ($resources as $key => $res) { try { $res->getMetadata($force); $passed[$key] = $res; } catch (ClientException $e) { // "410...
php
private function verifyResources(array $resources, bool $force = false): array { $passed = array(); foreach ($resources as $key => $res) { try { $res->getMetadata($force); $passed[$key] = $res; } catch (ClientException $e) { // "410...
[ "private", "function", "verifyResources", "(", "array", "$", "resources", ",", "bool", "$", "force", "=", "false", ")", ":", "array", "{", "$", "passed", "=", "array", "(", ")", ";", "foreach", "(", "$", "resources", "as", "$", "key", "=>", "$", "res...
Removes from an array resources which do not exist anymore. @param array $resources @param bool $force should resource be always checked (true) or maybe it is enough if metadata were already fetched during this session (false) @return array @throws \acdhOeaw\fedora\ClientException
[ "Removes", "from", "an", "array", "resources", "which", "do", "not", "exist", "anymore", "." ]
e22c7cd2613f3c8daf0deee879896d9cd7f61b41
https://github.com/acdh-oeaw/repo-php-util/blob/e22c7cd2613f3c8daf0deee879896d9cd7f61b41/src/acdhOeaw/fedora/Fedora.php#L544-L560
29,905
acdh-oeaw/repo-php-util
src/acdhOeaw/fedora/Fedora.php
Fedora.runQuery
public function runQuery(Query $query): Result { $query = $query->getQuery(); echo self::$debugSparql ? $query . "\n" : ''; return $this->runSparql($query); }
php
public function runQuery(Query $query): Result { $query = $query->getQuery(); echo self::$debugSparql ? $query . "\n" : ''; return $this->runSparql($query); }
[ "public", "function", "runQuery", "(", "Query", "$", "query", ")", ":", "Result", "{", "$", "query", "=", "$", "query", "->", "getQuery", "(", ")", ";", "echo", "self", "::", "$", "debugSparql", "?", "$", "query", ".", "\"\\n\"", ":", "''", ";", "r...
Runs a SPARQL query defined by a Query object against repository triplestore. @param Query $query query to run @return \EasyRdf\Sparql\Result
[ "Runs", "a", "SPARQL", "query", "defined", "by", "a", "Query", "object", "against", "repository", "triplestore", "." ]
e22c7cd2613f3c8daf0deee879896d9cd7f61b41
https://github.com/acdh-oeaw/repo-php-util/blob/e22c7cd2613f3c8daf0deee879896d9cd7f61b41/src/acdhOeaw/fedora/Fedora.php#L569-L575
29,906
acdh-oeaw/repo-php-util
src/acdhOeaw/fedora/Fedora.php
Fedora.runSparql
public function runSparql(string $query, int $nTries = null): Result { return $this->sparqlClient->query($query, $nTries ?? $this->sparqlNTries); }
php
public function runSparql(string $query, int $nTries = null): Result { return $this->sparqlClient->query($query, $nTries ?? $this->sparqlNTries); }
[ "public", "function", "runSparql", "(", "string", "$", "query", ",", "int", "$", "nTries", "=", "null", ")", ":", "Result", "{", "return", "$", "this", "->", "sparqlClient", "->", "query", "(", "$", "query", ",", "$", "nTries", "??", "$", "this", "->...
Runs a SPARQL against repository triplestore. @param string $query SPARQL query to run @param int $nTries how many times request should be repeated in case of error before giving up @return \EasyRdf\Sparql\Result
[ "Runs", "a", "SPARQL", "against", "repository", "triplestore", "." ]
e22c7cd2613f3c8daf0deee879896d9cd7f61b41
https://github.com/acdh-oeaw/repo-php-util/blob/e22c7cd2613f3c8daf0deee879896d9cd7f61b41/src/acdhOeaw/fedora/Fedora.php#L585-L587
29,907
acdh-oeaw/repo-php-util
src/acdhOeaw/fedora/Fedora.php
Fedora.sanitizeUri
public function sanitizeUri(string $uri): string { if ($uri == '') { throw new BadMethodCallException('URI is empty'); } $baseUrl = !$this->txUrl ? $this->apiUrl : $this->txUrl; $uri = preg_replace('|^/|', '', $uri); $uri = preg_replace('|^https?://[^/]+/rest/...
php
public function sanitizeUri(string $uri): string { if ($uri == '') { throw new BadMethodCallException('URI is empty'); } $baseUrl = !$this->txUrl ? $this->apiUrl : $this->txUrl; $uri = preg_replace('|^/|', '', $uri); $uri = preg_replace('|^https?://[^/]+/rest/...
[ "public", "function", "sanitizeUri", "(", "string", "$", "uri", ")", ":", "string", "{", "if", "(", "$", "uri", "==", "''", ")", "{", "throw", "new", "BadMethodCallException", "(", "'URI is empty'", ")", ";", "}", "$", "baseUrl", "=", "!", "$", "this",...
Adjusts URI to the current object state by setting up the proper base URL and the transaction id. @param string $uri resource URI @return string
[ "Adjusts", "URI", "to", "the", "current", "object", "state", "by", "setting", "up", "the", "proper", "base", "URL", "and", "the", "transaction", "id", "." ]
e22c7cd2613f3c8daf0deee879896d9cd7f61b41
https://github.com/acdh-oeaw/repo-php-util/blob/e22c7cd2613f3c8daf0deee879896d9cd7f61b41/src/acdhOeaw/fedora/Fedora.php#L596-L605
29,908
acdh-oeaw/repo-php-util
src/acdhOeaw/fedora/Fedora.php
Fedora.standardizeUri
public function standardizeUri(string $uri): string { if ($uri == '') { throw new BadMethodCallException('URI is empty'); } if (substr($uri, 0, 1) === '/') { $uri = substr($uri, 1); } $uri = preg_replace('|^https?://[^/]+/rest/(tx:[-0-9a-zA-Z]+/)?|', '', $...
php
public function standardizeUri(string $uri): string { if ($uri == '') { throw new BadMethodCallException('URI is empty'); } if (substr($uri, 0, 1) === '/') { $uri = substr($uri, 1); } $uri = preg_replace('|^https?://[^/]+/rest/(tx:[-0-9a-zA-Z]+/)?|', '', $...
[ "public", "function", "standardizeUri", "(", "string", "$", "uri", ")", ":", "string", "{", "if", "(", "$", "uri", "==", "''", ")", "{", "throw", "new", "BadMethodCallException", "(", "'URI is empty'", ")", ";", "}", "if", "(", "substr", "(", "$", "uri...
Transforms an URI into "a canonical form" used in the triplestore to denote triples subject. @param string $uri URI to transform @return string
[ "Transforms", "an", "URI", "into", "a", "canonical", "form", "used", "in", "the", "triplestore", "to", "denote", "triples", "subject", "." ]
e22c7cd2613f3c8daf0deee879896d9cd7f61b41
https://github.com/acdh-oeaw/repo-php-util/blob/e22c7cd2613f3c8daf0deee879896d9cd7f61b41/src/acdhOeaw/fedora/Fedora.php#L614-L624
29,909
acdh-oeaw/repo-php-util
src/acdhOeaw/fedora/Fedora.php
Fedora.begin
public function begin(int $keepAliveTimeout = 90) { $this->txKeepAlive = $keepAliveTimeout; $this->txTimestamp = time(); $resp = $this->client->post($this->apiUrl . '/fcr:tx'); $loc = $resp->getHeader('Location'); if (count($loc) == 0) { throw new RuntimeException('...
php
public function begin(int $keepAliveTimeout = 90) { $this->txKeepAlive = $keepAliveTimeout; $this->txTimestamp = time(); $resp = $this->client->post($this->apiUrl . '/fcr:tx'); $loc = $resp->getHeader('Location'); if (count($loc) == 0) { throw new RuntimeException('...
[ "public", "function", "begin", "(", "int", "$", "keepAliveTimeout", "=", "90", ")", "{", "$", "this", "->", "txKeepAlive", "=", "$", "keepAliveTimeout", ";", "$", "this", "->", "txTimestamp", "=", "time", "(", ")", ";", "$", "resp", "=", "$", "this", ...
Starts new Fedora transaction. Only one transaction can be opened at the same time, so make sure you committed previous transactions before starting a new one. Be aware that all metadata modified during the transaction will be not visible in the triplestore coupled with the Fedora until the transaction is committed. ...
[ "Starts", "new", "Fedora", "transaction", "." ]
e22c7cd2613f3c8daf0deee879896d9cd7f61b41
https://github.com/acdh-oeaw/repo-php-util/blob/e22c7cd2613f3c8daf0deee879896d9cd7f61b41/src/acdhOeaw/fedora/Fedora.php#L644-L666
29,910
acdh-oeaw/repo-php-util
src/acdhOeaw/fedora/Fedora.php
Fedora.rollback
public function rollback() { if ($this->txUrl) { $this->client->post($this->txUrl . '/fcr:tx/fcr:rollback'); $this->txUrl = null; $this->killKeepTransactionAlive(); } }
php
public function rollback() { if ($this->txUrl) { $this->client->post($this->txUrl . '/fcr:tx/fcr:rollback'); $this->txUrl = null; $this->killKeepTransactionAlive(); } }
[ "public", "function", "rollback", "(", ")", "{", "if", "(", "$", "this", "->", "txUrl", ")", "{", "$", "this", "->", "client", "->", "post", "(", "$", "this", "->", "txUrl", ".", "'/fcr:tx/fcr:rollback'", ")", ";", "$", "this", "->", "txUrl", "=", ...
Rolls back the current Fedora transaction. @see begin() @see commit()
[ "Rolls", "back", "the", "current", "Fedora", "transaction", "." ]
e22c7cd2613f3c8daf0deee879896d9cd7f61b41
https://github.com/acdh-oeaw/repo-php-util/blob/e22c7cd2613f3c8daf0deee879896d9cd7f61b41/src/acdhOeaw/fedora/Fedora.php#L674-L680
29,911
acdh-oeaw/repo-php-util
src/acdhOeaw/fedora/Fedora.php
Fedora.prolong
public function prolong(string $txUrl = null) { $url = $txUrl ?? $this->txUrl; if ($url) { if ($url === $this->txUrl) { $this->txTimestamp = time(); } $this->client->post($url . '/fcr:tx'); } }
php
public function prolong(string $txUrl = null) { $url = $txUrl ?? $this->txUrl; if ($url) { if ($url === $this->txUrl) { $this->txTimestamp = time(); } $this->client->post($url . '/fcr:tx'); } }
[ "public", "function", "prolong", "(", "string", "$", "txUrl", "=", "null", ")", "{", "$", "url", "=", "$", "txUrl", "??", "$", "this", "->", "txUrl", ";", "if", "(", "$", "url", ")", "{", "if", "(", "$", "url", "===", "$", "this", "->", "txUrl"...
Fedora transactions automatically expire after 3 minutes. If you want a transaction to be kept longer it must be manually prolonged. This method does it for you. @param string $txUrl optional transaction URL. If not provided, current transaction URL is used. @see begin()
[ "Fedora", "transactions", "automatically", "expire", "after", "3", "minutes", ".", "If", "you", "want", "a", "transaction", "to", "be", "kept", "longer", "it", "must", "be", "manually", "prolonged", ".", "This", "method", "does", "it", "for", "you", "." ]
e22c7cd2613f3c8daf0deee879896d9cd7f61b41
https://github.com/acdh-oeaw/repo-php-util/blob/e22c7cd2613f3c8daf0deee879896d9cd7f61b41/src/acdhOeaw/fedora/Fedora.php#L690-L698
29,912
acdh-oeaw/repo-php-util
src/acdhOeaw/fedora/Fedora.php
Fedora.commit
public function commit() { if ($this->txUrl) { $this->client->post($this->txUrl . '/fcr:tx/fcr:commit'); $this->txUrl = null; $this->killKeepTransactionAlive(); $this->reindexResources(); } }
php
public function commit() { if ($this->txUrl) { $this->client->post($this->txUrl . '/fcr:tx/fcr:commit'); $this->txUrl = null; $this->killKeepTransactionAlive(); $this->reindexResources(); } }
[ "public", "function", "commit", "(", ")", "{", "if", "(", "$", "this", "->", "txUrl", ")", "{", "$", "this", "->", "client", "->", "post", "(", "$", "this", "->", "txUrl", ".", "'/fcr:tx/fcr:commit'", ")", ";", "$", "this", "->", "txUrl", "=", "nul...
Commits the current Fedora transaction. After the commit all the metadata modified during the transaction will be finally available in the triplestore associated with the Fedora. @see begin() @see rollback()
[ "Commits", "the", "current", "Fedora", "transaction", "." ]
e22c7cd2613f3c8daf0deee879896d9cd7f61b41
https://github.com/acdh-oeaw/repo-php-util/blob/e22c7cd2613f3c8daf0deee879896d9cd7f61b41/src/acdhOeaw/fedora/Fedora.php#L720-L728
29,913
acdh-oeaw/repo-php-util
src/acdhOeaw/fedora/Fedora.php
Fedora.reindexResources
private function reindexResources() { if (count($this->resToReindex) == 0) { return; } $this->begin(); foreach (array_unique($this->resToReindex) as $i) { try { $res = $this->getResourceByUri($i); $res->setMetadata($res->getMetadat...
php
private function reindexResources() { if (count($this->resToReindex) == 0) { return; } $this->begin(); foreach (array_unique($this->resToReindex) as $i) { try { $res = $this->getResourceByUri($i); $res->setMetadata($res->getMetadat...
[ "private", "function", "reindexResources", "(", ")", "{", "if", "(", "count", "(", "$", "this", "->", "resToReindex", ")", "==", "0", ")", "{", "return", ";", "}", "$", "this", "->", "begin", "(", ")", ";", "foreach", "(", "array_unique", "(", "$", ...
Reindexes resources scheduled for reindexing by issuing a dummy metadata update.
[ "Reindexes", "resources", "scheduled", "for", "reindexing", "by", "issuing", "a", "dummy", "metadata", "update", "." ]
e22c7cd2613f3c8daf0deee879896d9cd7f61b41
https://github.com/acdh-oeaw/repo-php-util/blob/e22c7cd2613f3c8daf0deee879896d9cd7f61b41/src/acdhOeaw/fedora/Fedora.php#L734-L753
29,914
acdh-oeaw/repo-php-util
src/acdhOeaw/fedora/Fedora.php
Fedora.killKeepTransactionAlive
private function killKeepTransactionAlive() { if ($this->txProcPid > 0) { posix_kill($this->txProcPid, \SIGKILL); $status = null; pcntl_wait($status); $this->txProcPid = null; } if ($this->txProc) { $this->txProc = null; ...
php
private function killKeepTransactionAlive() { if ($this->txProcPid > 0) { posix_kill($this->txProcPid, \SIGKILL); $status = null; pcntl_wait($status); $this->txProcPid = null; } if ($this->txProc) { $this->txProc = null; ...
[ "private", "function", "killKeepTransactionAlive", "(", ")", "{", "if", "(", "$", "this", "->", "txProcPid", ">", "0", ")", "{", "posix_kill", "(", "$", "this", "->", "txProcPid", ",", "\\", "SIGKILL", ")", ";", "$", "status", "=", "null", ";", "pcntl_...
Ends process keeping transaction alive
[ "Ends", "process", "keeping", "transaction", "alive" ]
e22c7cd2613f3c8daf0deee879896d9cd7f61b41
https://github.com/acdh-oeaw/repo-php-util/blob/e22c7cd2613f3c8daf0deee879896d9cd7f61b41/src/acdhOeaw/fedora/Fedora.php#L772-L782
29,915
acdh-oeaw/repo-php-util
src/acdhOeaw/fedora/Fedora.php
Fedora.fixMetadataReferences
public function fixMetadataReferences(Resource $meta): Resource { $properties = array_diff($meta->propertyUris(), array(RC::idProp())); foreach ($properties as $p) { foreach ($meta->allResources($p) as $obj) { $id = null; $uri = $obj->getUri(); ...
php
public function fixMetadataReferences(Resource $meta): Resource { $properties = array_diff($meta->propertyUris(), array(RC::idProp())); foreach ($properties as $p) { foreach ($meta->allResources($p) as $obj) { $id = null; $uri = $obj->getUri(); ...
[ "public", "function", "fixMetadataReferences", "(", "Resource", "$", "meta", ")", ":", "Resource", "{", "$", "properties", "=", "array_diff", "(", "$", "meta", "->", "propertyUris", "(", ")", ",", "array", "(", "RC", "::", "idProp", "(", ")", ")", ")", ...
Tries to switch references to all repository resources into their UUIDs. Changes are done in-place! @param Resource $meta metadata to apply changes to @return Resource
[ "Tries", "to", "switch", "references", "to", "all", "repository", "resources", "into", "their", "UUIDs", "." ]
e22c7cd2613f3c8daf0deee879896d9cd7f61b41
https://github.com/acdh-oeaw/repo-php-util/blob/e22c7cd2613f3c8daf0deee879896d9cd7f61b41/src/acdhOeaw/fedora/Fedora.php#L800-L833
29,916
acdh-oeaw/repo-php-util
src/acdhOeaw/fedora/dissemination/Service.php
Service.getFormats
public function getFormats(): array { $meta = $this->getMetadata(); $formats = array(); foreach ($meta->all(RC::get('fedoraServiceRetFormatProp')) as $i) { $formats[] = new Format((string) $i); } return $formats; }
php
public function getFormats(): array { $meta = $this->getMetadata(); $formats = array(); foreach ($meta->all(RC::get('fedoraServiceRetFormatProp')) as $i) { $formats[] = new Format((string) $i); } return $formats; }
[ "public", "function", "getFormats", "(", ")", ":", "array", "{", "$", "meta", "=", "$", "this", "->", "getMetadata", "(", ")", ";", "$", "formats", "=", "array", "(", ")", ";", "foreach", "(", "$", "meta", "->", "all", "(", "RC", "::", "get", "("...
Returns all return formats provided by the dissemination service. Technically return formats are nothing more then strings. There is no requirement forcing them to be mime types, etc. @return array
[ "Returns", "all", "return", "formats", "provided", "by", "the", "dissemination", "service", "." ]
e22c7cd2613f3c8daf0deee879896d9cd7f61b41
https://github.com/acdh-oeaw/repo-php-util/blob/e22c7cd2613f3c8daf0deee879896d9cd7f61b41/src/acdhOeaw/fedora/dissemination/Service.php#L78-L85
29,917
acdh-oeaw/repo-php-util
src/acdhOeaw/fedora/dissemination/Service.php
Service.getRequest
public function getRequest(FedoraResource $res): Request { $uri = $this->getLocation(); $param = $this->getUrlParameters(); $values = $this->getParameterValues($param, $res); foreach ($values as $k => $v) { $uri = str_replace($k, $v, $uri); } return new ...
php
public function getRequest(FedoraResource $res): Request { $uri = $this->getLocation(); $param = $this->getUrlParameters(); $values = $this->getParameterValues($param, $res); foreach ($values as $k => $v) { $uri = str_replace($k, $v, $uri); } return new ...
[ "public", "function", "getRequest", "(", "FedoraResource", "$", "res", ")", ":", "Request", "{", "$", "uri", "=", "$", "this", "->", "getLocation", "(", ")", ";", "$", "param", "=", "$", "this", "->", "getUrlParameters", "(", ")", ";", "$", "values", ...
Returns PSR-7 HTTP request disseminating a given resource. @param FedoraResource $res repository resource to be disseminated @return Request @throws RuntimeException
[ "Returns", "PSR", "-", "7", "HTTP", "request", "disseminating", "a", "given", "resource", "." ]
e22c7cd2613f3c8daf0deee879896d9cd7f61b41
https://github.com/acdh-oeaw/repo-php-util/blob/e22c7cd2613f3c8daf0deee879896d9cd7f61b41/src/acdhOeaw/fedora/dissemination/Service.php#L93-L103
29,918
acdh-oeaw/repo-php-util
src/acdhOeaw/fedora/dissemination/Service.php
Service.getRevProxy
public function getRevProxy(): bool { $meta = $this->getMetadata(); $value = $meta->getLiteral(RC::get('fedoraServiceRevProxyProp'))->getValue(); return $value ?? false; }
php
public function getRevProxy(): bool { $meta = $this->getMetadata(); $value = $meta->getLiteral(RC::get('fedoraServiceRevProxyProp'))->getValue(); return $value ?? false; }
[ "public", "function", "getRevProxy", "(", ")", ":", "bool", "{", "$", "meta", "=", "$", "this", "->", "getMetadata", "(", ")", ";", "$", "value", "=", "$", "meta", "->", "getLiteral", "(", "RC", "::", "get", "(", "'fedoraServiceRevProxyProp'", ")", ")"...
Should the dissemination service request be reverse-proxied? If it's not set in the metadata, false is assumed. @return bool
[ "Should", "the", "dissemination", "service", "request", "be", "reverse", "-", "proxied?" ]
e22c7cd2613f3c8daf0deee879896d9cd7f61b41
https://github.com/acdh-oeaw/repo-php-util/blob/e22c7cd2613f3c8daf0deee879896d9cd7f61b41/src/acdhOeaw/fedora/dissemination/Service.php#L120-L124
29,919
acdh-oeaw/repo-php-util
src/acdhOeaw/fedora/dissemination/Service.php
Service.getParameterValues
private function getParameterValues(array $param, FedoraResource $res): array { $this->getParameters(); $values = []; foreach ($param as $i) { $ii = explode('|', substr($i, 1, -1)); $name = array_shift($ii); if ($name === 'RES_URI') { $valu...
php
private function getParameterValues(array $param, FedoraResource $res): array { $this->getParameters(); $values = []; foreach ($param as $i) { $ii = explode('|', substr($i, 1, -1)); $name = array_shift($ii); if ($name === 'RES_URI') { $valu...
[ "private", "function", "getParameterValues", "(", "array", "$", "param", ",", "FedoraResource", "$", "res", ")", ":", "array", "{", "$", "this", "->", "getParameters", "(", ")", ";", "$", "values", "=", "[", "]", ";", "foreach", "(", "$", "param", "as"...
Evaluates parameter values for a given resource. @param array $param list of parameters @param FedoraResource $res repository resource to be disseminated @return array associative array with parameter values @throws RuntimeException
[ "Evaluates", "parameter", "values", "for", "a", "given", "resource", "." ]
e22c7cd2613f3c8daf0deee879896d9cd7f61b41
https://github.com/acdh-oeaw/repo-php-util/blob/e22c7cd2613f3c8daf0deee879896d9cd7f61b41/src/acdhOeaw/fedora/dissemination/Service.php#L144-L165
29,920
diff-sniffer/core
src/Application.php
Application.printVersion
private function printVersion(Command $command) { $version = PrettyVersions::getVersion($command->getPackageName()); printf( '%s version %s' . PHP_EOL, $command->getName(), $version->getPrettyVersion() ); }
php
private function printVersion(Command $command) { $version = PrettyVersions::getVersion($command->getPackageName()); printf( '%s version %s' . PHP_EOL, $command->getName(), $version->getPrettyVersion() ); }
[ "private", "function", "printVersion", "(", "Command", "$", "command", ")", "{", "$", "version", "=", "PrettyVersions", "::", "getVersion", "(", "$", "command", "->", "getPackageName", "(", ")", ")", ";", "printf", "(", "'%s version %s'", ".", "PHP_EOL", ","...
Prints command version @param Command $command
[ "Prints", "command", "version" ]
583369a5f5c91496862f6bdf60b69565da4bc05d
https://github.com/diff-sniffer/core/blob/583369a5f5c91496862f6bdf60b69565da4bc05d/src/Application.php#L99-L108
29,921
ventoviro/windwalker-core
src/Core/Cache/RuntimeCacheTrait.php
RuntimeCacheTrait.once
protected function once($id, $closure, $refresh = false) { $key = $this->getCacheId($id); $cache = $this->getCacheInstance(); if ($refresh) { $cache->remove($key); } return $cache->call($key, $closure); }
php
protected function once($id, $closure, $refresh = false) { $key = $this->getCacheId($id); $cache = $this->getCacheInstance(); if ($refresh) { $cache->remove($key); } return $cache->call($key, $closure); }
[ "protected", "function", "once", "(", "$", "id", ",", "$", "closure", ",", "$", "refresh", "=", "false", ")", "{", "$", "key", "=", "$", "this", "->", "getCacheId", "(", "$", "id", ")", ";", "$", "cache", "=", "$", "this", "->", "getCacheInstance",...
Only get once if ID is same. @param string $id @param callable $closure @param bool $refresh @return mixed @throws \Psr\Cache\InvalidArgumentException
[ "Only", "get", "once", "if", "ID", "is", "same", "." ]
0ed53059fc2d5d2d9b72f0e4aeef2fdf6aac0074
https://github.com/ventoviro/windwalker-core/blob/0ed53059fc2d5d2d9b72f0e4aeef2fdf6aac0074/src/Core/Cache/RuntimeCacheTrait.php#L121-L131
29,922
polyfony-inc/polyfony
Private/Polyfony/HttpRequest.php
HttpRequest.file
public function file($key, $path=null) :self { // if we have an array of data if(is_array($key)) { // for each of those foreach($key as $index => $path) { // set them $this->file($index, $path); } } else { // add to the list of files $this->data[$key] = '@'.$path; } // return self r...
php
public function file($key, $path=null) :self { // if we have an array of data if(is_array($key)) { // for each of those foreach($key as $index => $path) { // set them $this->file($index, $path); } } else { // add to the list of files $this->data[$key] = '@'.$path; } // return self r...
[ "public", "function", "file", "(", "$", "key", ",", "$", "path", "=", "null", ")", ":", "self", "{", "// if we have an array of data", "if", "(", "is_array", "(", "$", "key", ")", ")", "{", "// for each of those", "foreach", "(", "$", "key", "as", "$", ...
set a file to be posted
[ "set", "a", "file", "to", "be", "posted" ]
76dac2f4141c8f480370236295c07dfa52e5c589
https://github.com/polyfony-inc/polyfony/blob/76dac2f4141c8f480370236295c07dfa52e5c589/Private/Polyfony/HttpRequest.php#L96-L111
29,923
polyfony-inc/polyfony
Private/Polyfony/HttpRequest.php
HttpRequest.cookie
public function cookie($key, $value) :self { // if we have an array of data if(is_array($key)) { // for each of those foreach($key as $index => $value) { // set them $this->cookie($index, $value); } } else { // add to the list of files $this->cookie[$key] = '@'.$value; } // return sel...
php
public function cookie($key, $value) :self { // if we have an array of data if(is_array($key)) { // for each of those foreach($key as $index => $value) { // set them $this->cookie($index, $value); } } else { // add to the list of files $this->cookie[$key] = '@'.$value; } // return sel...
[ "public", "function", "cookie", "(", "$", "key", ",", "$", "value", ")", ":", "self", "{", "// if we have an array of data", "if", "(", "is_array", "(", "$", "key", ")", ")", "{", "// for each of those", "foreach", "(", "$", "key", "as", "$", "index", "=...
set a cookie
[ "set", "a", "cookie" ]
76dac2f4141c8f480370236295c07dfa52e5c589
https://github.com/polyfony-inc/polyfony/blob/76dac2f4141c8f480370236295c07dfa52e5c589/Private/Polyfony/HttpRequest.php#L114-L129
29,924
polyfony-inc/polyfony
Private/Polyfony/HttpRequest.php
HttpRequest.send
public function send() :bool { // initialize $this->initializeCurl(); $this->configureCurl(); // run & parse return $this->parseCurl($this->executeCurl()); }
php
public function send() :bool { // initialize $this->initializeCurl(); $this->configureCurl(); // run & parse return $this->parseCurl($this->executeCurl()); }
[ "public", "function", "send", "(", ")", ":", "bool", "{", "// initialize", "$", "this", "->", "initializeCurl", "(", ")", ";", "$", "this", "->", "configureCurl", "(", ")", ";", "// run & parse", "return", "$", "this", "->", "parseCurl", "(", "$", "this"...
build and send the request
[ "build", "and", "send", "the", "request" ]
76dac2f4141c8f480370236295c07dfa52e5c589
https://github.com/polyfony-inc/polyfony/blob/76dac2f4141c8f480370236295c07dfa52e5c589/Private/Polyfony/HttpRequest.php#L298-L307
29,925
polyfony-inc/polyfony
Private/Polyfony/HttpRequest.php
HttpRequest.getHeader
public function getHeader(string $key) { // return the header of null if missing return isset($this->response['headers'][$key]) ? $this->response['headers'][$key] : null; }
php
public function getHeader(string $key) { // return the header of null if missing return isset($this->response['headers'][$key]) ? $this->response['headers'][$key] : null; }
[ "public", "function", "getHeader", "(", "string", "$", "key", ")", "{", "// return the header of null if missing", "return", "isset", "(", "$", "this", "->", "response", "[", "'headers'", "]", "[", "$", "key", "]", ")", "?", "$", "this", "->", "response", ...
get a specific response header
[ "get", "a", "specific", "response", "header" ]
76dac2f4141c8f480370236295c07dfa52e5c589
https://github.com/polyfony-inc/polyfony/blob/76dac2f4141c8f480370236295c07dfa52e5c589/Private/Polyfony/HttpRequest.php#L328-L332
29,926
Blobfolio/blob-common
lib/blobfolio/common/ref/file.php
file.leadingslash
public static function leadingslash(&$path) { if (\is_array($path)) { foreach ($path as $k=>$v) { static::leadingslash($path[$k]); } } else { cast::string($path, true); static::unleadingslash($path); $path = "/$path"; } }
php
public static function leadingslash(&$path) { if (\is_array($path)) { foreach ($path as $k=>$v) { static::leadingslash($path[$k]); } } else { cast::string($path, true); static::unleadingslash($path); $path = "/$path"; } }
[ "public", "static", "function", "leadingslash", "(", "&", "$", "path", ")", "{", "if", "(", "\\", "is_array", "(", "$", "path", ")", ")", "{", "foreach", "(", "$", "path", "as", "$", "k", "=>", "$", "v", ")", "{", "static", "::", "leadingslash", ...
Add Leading Slash @param string $path Path. @return void Nothing.
[ "Add", "Leading", "Slash" ]
7b43d5526cc9d09853771d950b2956e98e680db1
https://github.com/Blobfolio/blob-common/blob/7b43d5526cc9d09853771d950b2956e98e680db1/lib/blobfolio/common/ref/file.php#L89-L101
29,927
Blobfolio/blob-common
lib/blobfolio/common/ref/file.php
file.trailingslash
public static function trailingslash(&$path) { if (\is_array($path)) { foreach ($path as $k=>$v) { static::trailingslash($path[$k]); } } else { cast::string($path, true); static::untrailingslash($path); $path .= '/'; } }
php
public static function trailingslash(&$path) { if (\is_array($path)) { foreach ($path as $k=>$v) { static::trailingslash($path[$k]); } } else { cast::string($path, true); static::untrailingslash($path); $path .= '/'; } }
[ "public", "static", "function", "trailingslash", "(", "&", "$", "path", ")", "{", "if", "(", "\\", "is_array", "(", "$", "path", ")", ")", "{", "foreach", "(", "$", "path", "as", "$", "k", "=>", "$", "v", ")", "{", "static", "::", "trailingslash", ...
Add Trailing Slash @param string $path Path. @return void Nothing.
[ "Add", "Trailing", "Slash" ]
7b43d5526cc9d09853771d950b2956e98e680db1
https://github.com/Blobfolio/blob-common/blob/7b43d5526cc9d09853771d950b2956e98e680db1/lib/blobfolio/common/ref/file.php#L179-L191
29,928
Blobfolio/blob-common
lib/blobfolio/common/ref/file.php
file.unixslash
public static function unixslash(&$path) { if (\is_array($path)) { foreach ($path as $k=>$v) { static::unixslash($path[$k]); } } else { cast::string($path, true); $path = \str_replace('\\', '/', $path); $path = \str_replace('/./', '//', $path); $path = \preg_replace('/\/{2,}/u', '/', $path)...
php
public static function unixslash(&$path) { if (\is_array($path)) { foreach ($path as $k=>$v) { static::unixslash($path[$k]); } } else { cast::string($path, true); $path = \str_replace('\\', '/', $path); $path = \str_replace('/./', '//', $path); $path = \preg_replace('/\/{2,}/u', '/', $path)...
[ "public", "static", "function", "unixslash", "(", "&", "$", "path", ")", "{", "if", "(", "\\", "is_array", "(", "$", "path", ")", ")", "{", "foreach", "(", "$", "path", "as", "$", "k", "=>", "$", "v", ")", "{", "static", "::", "unixslash", "(", ...
Fix Path Slashes @param string $path Path. @return void Nothing.
[ "Fix", "Path", "Slashes" ]
7b43d5526cc9d09853771d950b2956e98e680db1
https://github.com/Blobfolio/blob-common/blob/7b43d5526cc9d09853771d950b2956e98e680db1/lib/blobfolio/common/ref/file.php#L199-L212
29,929
Blobfolio/blob-common
lib/blobfolio/common/ref/file.php
file.unleadingslash
public static function unleadingslash(&$path) { if (\is_array($path)) { foreach ($path as $k=>$v) { static::unleadingslash($path[$k]); } } else { cast::string($path, true); static::unixslash($path); $path = \ltrim($path, '/'); } }
php
public static function unleadingslash(&$path) { if (\is_array($path)) { foreach ($path as $k=>$v) { static::unleadingslash($path[$k]); } } else { cast::string($path, true); static::unixslash($path); $path = \ltrim($path, '/'); } }
[ "public", "static", "function", "unleadingslash", "(", "&", "$", "path", ")", "{", "if", "(", "\\", "is_array", "(", "$", "path", ")", ")", "{", "foreach", "(", "$", "path", "as", "$", "k", "=>", "$", "v", ")", "{", "static", "::", "unleadingslash"...
Strip Leading Slash @param string $path Path. @return void Nothing.
[ "Strip", "Leading", "Slash" ]
7b43d5526cc9d09853771d950b2956e98e680db1
https://github.com/Blobfolio/blob-common/blob/7b43d5526cc9d09853771d950b2956e98e680db1/lib/blobfolio/common/ref/file.php#L220-L232
29,930
Blobfolio/blob-common
lib/blobfolio/common/ref/file.php
file.untrailingslash
public static function untrailingslash(&$path) { if (\is_array($path)) { foreach ($path as $k=>$v) { static::untrailingslash($path[$k]); } } else { cast::string($path, true); static::unixslash($path); $path = \rtrim($path, '/'); } }
php
public static function untrailingslash(&$path) { if (\is_array($path)) { foreach ($path as $k=>$v) { static::untrailingslash($path[$k]); } } else { cast::string($path, true); static::unixslash($path); $path = \rtrim($path, '/'); } }
[ "public", "static", "function", "untrailingslash", "(", "&", "$", "path", ")", "{", "if", "(", "\\", "is_array", "(", "$", "path", ")", ")", "{", "foreach", "(", "$", "path", "as", "$", "k", "=>", "$", "v", ")", "{", "static", "::", "untrailingslas...
Strip Trailing Slash @param string $path Path. @return void Nothing.
[ "Strip", "Trailing", "Slash" ]
7b43d5526cc9d09853771d950b2956e98e680db1
https://github.com/Blobfolio/blob-common/blob/7b43d5526cc9d09853771d950b2956e98e680db1/lib/blobfolio/common/ref/file.php#L240-L252
29,931
acdh-oeaw/repo-php-util
src/acdhOeaw/fedora/metadataQuery/SimpleQuery.php
SimpleQuery.getQuery
public function getQuery(): string { $query = $this->query; $values = $this->values; $matches = null; preg_match_all('/[?][#@][a-zA-Z]?[a-zA-Z0-9_]*/', $query, $matches); $matches = count($matches) > 0 ? $matches[0] : array(); foreach ($matches as $i) { $va...
php
public function getQuery(): string { $query = $this->query; $values = $this->values; $matches = null; preg_match_all('/[?][#@][a-zA-Z]?[a-zA-Z0-9_]*/', $query, $matches); $matches = count($matches) > 0 ? $matches[0] : array(); foreach ($matches as $i) { $va...
[ "public", "function", "getQuery", "(", ")", ":", "string", "{", "$", "query", "=", "$", "this", "->", "query", ";", "$", "values", "=", "$", "this", "->", "values", ";", "$", "matches", "=", "null", ";", "preg_match_all", "(", "'/[?][#@][a-zA-Z]?[a-zA-Z0...
Returns query string ready to send to the SPRAQL endpoint @return string @throws RuntimeException
[ "Returns", "query", "string", "ready", "to", "send", "to", "the", "SPRAQL", "endpoint" ]
e22c7cd2613f3c8daf0deee879896d9cd7f61b41
https://github.com/acdh-oeaw/repo-php-util/blob/e22c7cd2613f3c8daf0deee879896d9cd7f61b41/src/acdhOeaw/fedora/metadataQuery/SimpleQuery.php#L94-L125
29,932
ventoviro/windwalker-core
src/Core/Mvc/AbstractClassResolver.php
AbstractClassResolver.resolve
public function resolve($name) { if (class_exists($name)) { return $name; } $name = static::normalise($name); $namespaces = clone $this->namespaces; $this->registerDefaultNamespace($namespaces); foreach (clone $namespaces as $ns) { $class =...
php
public function resolve($name) { if (class_exists($name)) { return $name; } $name = static::normalise($name); $namespaces = clone $this->namespaces; $this->registerDefaultNamespace($namespaces); foreach (clone $namespaces as $ns) { $class =...
[ "public", "function", "resolve", "(", "$", "name", ")", "{", "if", "(", "class_exists", "(", "$", "name", ")", ")", "{", "return", "$", "name", ";", "}", "$", "name", "=", "static", "::", "normalise", "(", "$", "name", ")", ";", "$", "namespaces", ...
Resolve class path. @param string $name @return string @throws \DomainException
[ "Resolve", "class", "path", "." ]
0ed53059fc2d5d2d9b72f0e4aeef2fdf6aac0074
https://github.com/ventoviro/windwalker-core/blob/0ed53059fc2d5d2d9b72f0e4aeef2fdf6aac0074/src/Core/Mvc/AbstractClassResolver.php#L73-L107
29,933
Blobfolio/blob-common
lib/blobfolio/common/image.php
image.has_webp
public static function has_webp($cwebp=null, $gif2webp=null) { // Gotta set it first? if (null === static::$_webp_gd) { $image_types = \imagetypes(); static::$_webp_gd = ( (0 !== ($image_types & \IMG_WEBP)) && \function_exists('imagewebp') && \function_exists('imagecreatefromwebp') ); } //...
php
public static function has_webp($cwebp=null, $gif2webp=null) { // Gotta set it first? if (null === static::$_webp_gd) { $image_types = \imagetypes(); static::$_webp_gd = ( (0 !== ($image_types & \IMG_WEBP)) && \function_exists('imagewebp') && \function_exists('imagecreatefromwebp') ); } //...
[ "public", "static", "function", "has_webp", "(", "$", "cwebp", "=", "null", ",", "$", "gif2webp", "=", "null", ")", "{", "// Gotta set it first?", "if", "(", "null", "===", "static", "::", "$", "_webp_gd", ")", "{", "$", "image_types", "=", "\\", "imaget...
Check Probable WebP Support This attempts to check whether PHP natively supports WebP, or if maybe third-party binaries are installed on the system. @param string $cwebp Path to cwebp. @param string $gif2webp Path to gif2webp. @return bool True/false.
[ "Check", "Probable", "WebP", "Support" ]
7b43d5526cc9d09853771d950b2956e98e680db1
https://github.com/Blobfolio/blob-common/blob/7b43d5526cc9d09853771d950b2956e98e680db1/lib/blobfolio/common/image.php#L590-L651
29,934
Blobfolio/blob-common
lib/blobfolio/common/image.php
image.svg_dimensions
public static function svg_dimensions($svg) { ref\cast::string($svg, true); // Make sure this is SVG-looking. if (false === ($start = \strpos(\strtolower($svg), '<svg'))) { if (@\is_file($svg)) { $svg = \file_get_contents($svg); if (false === ($start = \strpos(\strtolower($svg), '<svg'))) { retur...
php
public static function svg_dimensions($svg) { ref\cast::string($svg, true); // Make sure this is SVG-looking. if (false === ($start = \strpos(\strtolower($svg), '<svg'))) { if (@\is_file($svg)) { $svg = \file_get_contents($svg); if (false === ($start = \strpos(\strtolower($svg), '<svg'))) { retur...
[ "public", "static", "function", "svg_dimensions", "(", "$", "svg", ")", "{", "ref", "\\", "cast", "::", "string", "(", "$", "svg", ",", "true", ")", ";", "// Make sure this is SVG-looking.", "if", "(", "false", "===", "(", "$", "start", "=", "\\", "strpo...
Determine SVG Dimensions @param string $svg SVG content or file path. @return array|bool Dimensions or false.
[ "Determine", "SVG", "Dimensions" ]
7b43d5526cc9d09853771d950b2956e98e680db1
https://github.com/Blobfolio/blob-common/blob/7b43d5526cc9d09853771d950b2956e98e680db1/lib/blobfolio/common/image.php#L659-L739
29,935
Blobfolio/blob-common
lib/blobfolio/common/image.php
image.to_webp
public static function to_webp(string $from, $to=null, $cwebp=null, $gif2webp=null, bool $refresh=false) { // Try binaries first, fallback to GD. return ( static::to_webp_binary($from, $to, $cwebp, $gif2webp, $refresh) || static::to_webp_gd($from, $to, $refresh) ); }
php
public static function to_webp(string $from, $to=null, $cwebp=null, $gif2webp=null, bool $refresh=false) { // Try binaries first, fallback to GD. return ( static::to_webp_binary($from, $to, $cwebp, $gif2webp, $refresh) || static::to_webp_gd($from, $to, $refresh) ); }
[ "public", "static", "function", "to_webp", "(", "string", "$", "from", ",", "$", "to", "=", "null", ",", "$", "cwebp", "=", "null", ",", "$", "gif2webp", "=", "null", ",", "bool", "$", "refresh", "=", "false", ")", "{", "// Try binaries first, fallback t...
Generate WebP From Source This is a wrapper for the more specific GD and Binary methods to generate a WebP sister file. PHP isn't known for its performance, so the binaries are preferred when available. @param string $from Source file. @param string $to Output file. @param string $cwebp Path to cwebp. @param string ...
[ "Generate", "WebP", "From", "Source" ]
7b43d5526cc9d09853771d950b2956e98e680db1
https://github.com/Blobfolio/blob-common/blob/7b43d5526cc9d09853771d950b2956e98e680db1/lib/blobfolio/common/image.php#L805-L811
29,936
ventoviro/windwalker-core
src/Core/DateTime/DateTimeTrait.php
DateTimeTrait.convert
public static function convert($date, $from = 'UTC', $to = 'UTC', $format = null) { $format = $format ?: self::$format; $from = new \DateTimeZone($from); $to = new \DateTimeZone($to); $date = new static($date, $from); $date = $date->setTimezone($to); return $date...
php
public static function convert($date, $from = 'UTC', $to = 'UTC', $format = null) { $format = $format ?: self::$format; $from = new \DateTimeZone($from); $to = new \DateTimeZone($to); $date = new static($date, $from); $date = $date->setTimezone($to); return $date...
[ "public", "static", "function", "convert", "(", "$", "date", ",", "$", "from", "=", "'UTC'", ",", "$", "to", "=", "'UTC'", ",", "$", "format", "=", "null", ")", "{", "$", "format", "=", "$", "format", "?", ":", "self", "::", "$", "format", ";", ...
Convert a date string to another timezone. @param string $date @param string $from @param string $to @param string $format @return string @throws \Exception
[ "Convert", "a", "date", "string", "to", "another", "timezone", "." ]
0ed53059fc2d5d2d9b72f0e4aeef2fdf6aac0074
https://github.com/ventoviro/windwalker-core/blob/0ed53059fc2d5d2d9b72f0e4aeef2fdf6aac0074/src/Core/DateTime/DateTimeTrait.php#L150-L161
29,937
ventoviro/windwalker-core
src/Core/DateTime/DateTimeTrait.php
DateTimeTrait.useServerDefaultTimezone
public static function useServerDefaultTimezone($boolean = null) { if ($boolean !== null) { self::$useStz = (bool) $boolean; return self::$useStz; } return self::$useStz; }
php
public static function useServerDefaultTimezone($boolean = null) { if ($boolean !== null) { self::$useStz = (bool) $boolean; return self::$useStz; } return self::$useStz; }
[ "public", "static", "function", "useServerDefaultTimezone", "(", "$", "boolean", "=", "null", ")", "{", "if", "(", "$", "boolean", "!==", "null", ")", "{", "self", "::", "$", "useStz", "=", "(", "bool", ")", "$", "boolean", ";", "return", "self", "::",...
Method to set property useServerDefaultTimezone @param boolean $boolean @return boolean
[ "Method", "to", "set", "property", "useServerDefaultTimezone" ]
0ed53059fc2d5d2d9b72f0e4aeef2fdf6aac0074
https://github.com/ventoviro/windwalker-core/blob/0ed53059fc2d5d2d9b72f0e4aeef2fdf6aac0074/src/Core/DateTime/DateTimeTrait.php#L325-L334
29,938
ventoviro/windwalker-core
src/Core/DateTime/DateTimeTrait.php
DateTimeTrait.getNullDate
public static function getNullDate(AbstractDatabaseDriver $db = null) { $db = $db ?: Ioc::getDatabase(); return $db->getQuery(true)->getNullDate(); }
php
public static function getNullDate(AbstractDatabaseDriver $db = null) { $db = $db ?: Ioc::getDatabase(); return $db->getQuery(true)->getNullDate(); }
[ "public", "static", "function", "getNullDate", "(", "AbstractDatabaseDriver", "$", "db", "=", "null", ")", "{", "$", "db", "=", "$", "db", "?", ":", "Ioc", "::", "getDatabase", "(", ")", ";", "return", "$", "db", "->", "getQuery", "(", "true", ")", "...
Get NULL date. @param AbstractDatabaseDriver $db @return string @since 3.2.6.1
[ "Get", "NULL", "date", "." ]
0ed53059fc2d5d2d9b72f0e4aeef2fdf6aac0074
https://github.com/ventoviro/windwalker-core/blob/0ed53059fc2d5d2d9b72f0e4aeef2fdf6aac0074/src/Core/DateTime/DateTimeTrait.php#L546-L551
29,939
ventoviro/windwalker-core
src/Core/Console/ConsoleHelper.php
ConsoleHelper.executePackage
public static function executePackage( $package, $task, Request $request, $config = [], $appClass = 'Windwalker\Web\Application' ) { $profile = Ioc::getProfile(); Ioc::setProfile('web'); if (!class_exists($appClass)) { throw new \LogicExc...
php
public static function executePackage( $package, $task, Request $request, $config = [], $appClass = 'Windwalker\Web\Application' ) { $profile = Ioc::getProfile(); Ioc::setProfile('web'); if (!class_exists($appClass)) { throw new \LogicExc...
[ "public", "static", "function", "executePackage", "(", "$", "package", ",", "$", "task", ",", "Request", "$", "request", ",", "$", "config", "=", "[", "]", ",", "$", "appClass", "=", "'Windwalker\\Web\\Application'", ")", "{", "$", "profile", "=", "Ioc", ...
Execute a package in CLI environment. @param string $package @param string $task @param Request $request @param array $config @param string $appClass @return Response @throws \ReflectionException @throws \Windwalker\DI\Exception\DependencyResolutionException
[ "Execute", "a", "package", "in", "CLI", "environment", "." ]
0ed53059fc2d5d2d9b72f0e4aeef2fdf6aac0074
https://github.com/ventoviro/windwalker-core/blob/0ed53059fc2d5d2d9b72f0e4aeef2fdf6aac0074/src/Core/Console/ConsoleHelper.php#L134-L170
29,940
polyfony-inc/polyfony
Private/Polyfony/Format.php
Format.wrap
public static function wrap($text, $phrase, $wrapper = '<strong class="highlight">\\1</strong>') { if(empty($text)) { return ''; } if(empty($phrase)) { return $text; } if(is_array($phrase)) { foreach ($phrase as $word) { $pattern[] = '/(' . preg_quote($word, '/') . ')/i'; $replacement[] = $wr...
php
public static function wrap($text, $phrase, $wrapper = '<strong class="highlight">\\1</strong>') { if(empty($text)) { return ''; } if(empty($phrase)) { return $text; } if(is_array($phrase)) { foreach ($phrase as $word) { $pattern[] = '/(' . preg_quote($word, '/') . ')/i'; $replacement[] = $wr...
[ "public", "static", "function", "wrap", "(", "$", "text", ",", "$", "phrase", ",", "$", "wrapper", "=", "'<strong class=\"highlight\">\\\\1</strong>'", ")", "{", "if", "(", "empty", "(", "$", "text", ")", ")", "{", "return", "''", ";", "}", "if", "(", ...
will wrap a portion of text in another
[ "will", "wrap", "a", "portion", "of", "text", "in", "another" ]
76dac2f4141c8f480370236295c07dfa52e5c589
https://github.com/polyfony-inc/polyfony/blob/76dac2f4141c8f480370236295c07dfa52e5c589/Private/Polyfony/Format.php#L165-L183
29,941
polyfony-inc/polyfony
Private/Polyfony/Format.php
Format.integer
public static function integer($value) :int { if(strrpos($value, '.')) { $value = str_replace(',', '' , $value); } elseif(strrpos($value, ',')) { $value = str_replace('.', '' , $value); } return(intval(preg_replace('/[^0-9.\-]/', '', str_replace(',', '.' , $value)))); }
php
public static function integer($value) :int { if(strrpos($value, '.')) { $value = str_replace(',', '' , $value); } elseif(strrpos($value, ',')) { $value = str_replace('.', '' , $value); } return(intval(preg_replace('/[^0-9.\-]/', '', str_replace(',', '.' , $value)))); }
[ "public", "static", "function", "integer", "(", "$", "value", ")", ":", "int", "{", "if", "(", "strrpos", "(", "$", "value", ",", "'.'", ")", ")", "{", "$", "value", "=", "str_replace", "(", "','", ",", "''", ",", "$", "value", ")", ";", "}", "...
will clean the value of anything but 0-9 and minus preserve sign return integer
[ "will", "clean", "the", "value", "of", "anything", "but", "0", "-", "9", "and", "minus", "preserve", "sign", "return", "integer" ]
76dac2f4141c8f480370236295c07dfa52e5c589
https://github.com/polyfony-inc/polyfony/blob/76dac2f4141c8f480370236295c07dfa52e5c589/Private/Polyfony/Format.php#L192-L200
29,942
polyfony-inc/polyfony
Private/Polyfony/Format.php
Format.float
public static function float($value, int $precision = 2) :float { if(strrpos($value, '.')) { $value = str_replace(',', '' , $value); } elseif(strrpos($value, ',')) { $value = str_replace('.', '' , $value); } return(floatval( round(preg_replace('/[^0-9.\-]/', '', str_replace(',', '.' , $value)), $pre...
php
public static function float($value, int $precision = 2) :float { if(strrpos($value, '.')) { $value = str_replace(',', '' , $value); } elseif(strrpos($value, ',')) { $value = str_replace('.', '' , $value); } return(floatval( round(preg_replace('/[^0-9.\-]/', '', str_replace(',', '.' , $value)), $pre...
[ "public", "static", "function", "float", "(", "$", "value", ",", "int", "$", "precision", "=", "2", ")", ":", "float", "{", "if", "(", "strrpos", "(", "$", "value", ",", "'.'", ")", ")", "{", "$", "value", "=", "str_replace", "(", "','", ",", "''...
will clean the value of anything but 0-9\.- preserve sign return float
[ "will", "clean", "the", "value", "of", "anything", "but", "0", "-", "9", "\\", ".", "-", "preserve", "sign", "return", "float" ]
76dac2f4141c8f480370236295c07dfa52e5c589
https://github.com/polyfony-inc/polyfony/blob/76dac2f4141c8f480370236295c07dfa52e5c589/Private/Polyfony/Format.php#L203-L213
29,943
polyfony-inc/polyfony
Private/Polyfony/Format.php
Format.csv
public static function csv(array $array, string $separator = "\t", string $encapsulate_cells = '"') :string { // declare our csv $csv = ''; // for each line of the array foreach($array as $cells) { // for each cell of that line foreach($cells as $cell) { // protect the cell's value, encapsulate it, a...
php
public static function csv(array $array, string $separator = "\t", string $encapsulate_cells = '"') :string { // declare our csv $csv = ''; // for each line of the array foreach($array as $cells) { // for each cell of that line foreach($cells as $cell) { // protect the cell's value, encapsulate it, a...
[ "public", "static", "function", "csv", "(", "array", "$", "array", ",", "string", "$", "separator", "=", "\"\\t\"", ",", "string", "$", "encapsulate_cells", "=", "'\"'", ")", ":", "string", "{", "// declare our csv", "$", "csv", "=", "''", ";", "// for eac...
convert an array to a csv
[ "convert", "an", "array", "to", "a", "csv" ]
76dac2f4141c8f480370236295c07dfa52e5c589
https://github.com/polyfony-inc/polyfony/blob/76dac2f4141c8f480370236295c07dfa52e5c589/Private/Polyfony/Format.php#L216-L233
29,944
secucard/secucard-connect-php-sdk
src/SecucardConnect/Util/MapperUtil.php
MapperUtil.map
public static function map($json, $class, LoggerInterface $logger = null) { $mapper = new JsonMapper(); // FIX optional parameters can be null (no phpdoc NULL tag needed) $mapper->bStrictNullTypes = false; if (!is_object($json)) { // must set when json is assoc array ...
php
public static function map($json, $class, LoggerInterface $logger = null) { $mapper = new JsonMapper(); // FIX optional parameters can be null (no phpdoc NULL tag needed) $mapper->bStrictNullTypes = false; if (!is_object($json)) { // must set when json is assoc array ...
[ "public", "static", "function", "map", "(", "$", "json", ",", "$", "class", ",", "LoggerInterface", "$", "logger", "=", "null", ")", "{", "$", "mapper", "=", "new", "JsonMapper", "(", ")", ";", "// FIX optional parameters can be null (no phpdoc NULL tag needed)", ...
Mapping JSON string to a instance of a given class. @param array | object $json The JSON to map, either an assoc. array or object (stdClass), never a string. @param string $class The full qualified name of the class to map to. @param LoggerInterface|null $logger @return mixed The created instance, never null- @throws \...
[ "Mapping", "JSON", "string", "to", "a", "instance", "of", "a", "given", "class", "." ]
d990686095e4e02d0924fc12b9bf60140fe8efab
https://github.com/secucard/secucard-connect-php-sdk/blob/d990686095e4e02d0924fc12b9bf60140fe8efab/src/SecucardConnect/Util/MapperUtil.php#L31-L46
29,945
secucard/secucard-connect-php-sdk
src/SecucardConnect/Util/MapperUtil.php
MapperUtil.jsonEncode
public static function jsonEncode($object, $filter = null, $nullFilter = null) { if (!empty($filter) || !empty($nullFilter)) { $object = clone $object; $vars = get_object_vars($object); if (!empty ($filter)) { foreach ($filter as $prop) { ...
php
public static function jsonEncode($object, $filter = null, $nullFilter = null) { if (!empty($filter) || !empty($nullFilter)) { $object = clone $object; $vars = get_object_vars($object); if (!empty ($filter)) { foreach ($filter as $prop) { ...
[ "public", "static", "function", "jsonEncode", "(", "$", "object", ",", "$", "filter", "=", "null", ",", "$", "nullFilter", "=", "null", ")", "{", "if", "(", "!", "empty", "(", "$", "filter", ")", "||", "!", "empty", "(", "$", "nullFilter", ")", ")"...
Encodes the given instance to a JSON string. @param mixed $object The instance to encode. @param array|null $filter Array with properties of the given instance to filter. @param array|null $nullFilter Array with properties of the given instance to filter when null. @return string The encoded string or false on failure.
[ "Encodes", "the", "given", "instance", "to", "a", "JSON", "string", "." ]
d990686095e4e02d0924fc12b9bf60140fe8efab
https://github.com/secucard/secucard-connect-php-sdk/blob/d990686095e4e02d0924fc12b9bf60140fe8efab/src/SecucardConnect/Util/MapperUtil.php#L55-L79
29,946
secucard/secucard-connect-php-sdk
src/SecucardConnect/Util/MapperUtil.php
MapperUtil.mapResponse
public static function mapResponse(ResponseInterface $response, $class = null, LoggerInterface $logger = null) { $dec = self::jsonDecode((string)$response->getBody()); if ($class != null) { return self::map($dec, $class, $logger); } return $dec; }
php
public static function mapResponse(ResponseInterface $response, $class = null, LoggerInterface $logger = null) { $dec = self::jsonDecode((string)$response->getBody()); if ($class != null) { return self::map($dec, $class, $logger); } return $dec; }
[ "public", "static", "function", "mapResponse", "(", "ResponseInterface", "$", "response", ",", "$", "class", "=", "null", ",", "LoggerInterface", "$", "logger", "=", "null", ")", "{", "$", "dec", "=", "self", "::", "jsonDecode", "(", "(", "string", ")", ...
Maps a response body which contains JSON to an object of a given class or to default PHP types. @param ResponseInterface $response The response @param string $class The full qualified name of the class to map to or null to map to default types. @param LoggerInterface|null $logger @return mixed The created instance, nev...
[ "Maps", "a", "response", "body", "which", "contains", "JSON", "to", "an", "object", "of", "a", "given", "class", "or", "to", "default", "PHP", "types", "." ]
d990686095e4e02d0924fc12b9bf60140fe8efab
https://github.com/secucard/secucard-connect-php-sdk/blob/d990686095e4e02d0924fc12b9bf60140fe8efab/src/SecucardConnect/Util/MapperUtil.php#L89-L96
29,947
secucard/secucard-connect-php-sdk
src/SecucardConnect/Util/MapperUtil.php
MapperUtil.jsonDecode
public static function jsonDecode($json, $assoc = false) { $data = \json_decode($json, $assoc); if (JSON_ERROR_NONE !== json_last_error()) { $last = json_last_error(); throw new \InvalidArgumentException( 'Unable to parse JSON data: ' . (isset(...
php
public static function jsonDecode($json, $assoc = false) { $data = \json_decode($json, $assoc); if (JSON_ERROR_NONE !== json_last_error()) { $last = json_last_error(); throw new \InvalidArgumentException( 'Unable to parse JSON data: ' . (isset(...
[ "public", "static", "function", "jsonDecode", "(", "$", "json", ",", "$", "assoc", "=", "false", ")", "{", "$", "data", "=", "\\", "json_decode", "(", "$", "json", ",", "$", "assoc", ")", ";", "if", "(", "JSON_ERROR_NONE", "!==", "json_last_error", "("...
Decodes an JSON string into a object with properties of standard PHP types, including stdClass or assoc array. @param string $json The string to decode. @param boolean $assoc If true a assoc array is returned. @return mixed The created object, never null or other.
[ "Decodes", "an", "JSON", "string", "into", "a", "object", "with", "properties", "of", "standard", "PHP", "types", "including", "stdClass", "or", "assoc", "array", "." ]
d990686095e4e02d0924fc12b9bf60140fe8efab
https://github.com/secucard/secucard-connect-php-sdk/blob/d990686095e4e02d0924fc12b9bf60140fe8efab/src/SecucardConnect/Util/MapperUtil.php#L104-L117
29,948
diff-sniffer/core
src/ProjectLoader.php
ProjectLoader.registerClassLoader
public function registerClassLoader() : void { if ($this->root === null) { return; } $path = sprintf('%s/%s/autoload.php', $this->root, $this->getVendorDirectory()); if (!is_file($path)) { return; } require $path; }
php
public function registerClassLoader() : void { if ($this->root === null) { return; } $path = sprintf('%s/%s/autoload.php', $this->root, $this->getVendorDirectory()); if (!is_file($path)) { return; } require $path; }
[ "public", "function", "registerClassLoader", "(", ")", ":", "void", "{", "if", "(", "$", "this", "->", "root", "===", "null", ")", "{", "return", ";", "}", "$", "path", "=", "sprintf", "(", "'%s/%s/autoload.php'", ",", "$", "this", "->", "root", ",", ...
Registers class loader if it's defined in the project
[ "Registers", "class", "loader", "if", "it", "s", "defined", "in", "the", "project" ]
583369a5f5c91496862f6bdf60b69565da4bc05d
https://github.com/diff-sniffer/core/blob/583369a5f5c91496862f6bdf60b69565da4bc05d/src/ProjectLoader.php#L64-L77
29,949
diff-sniffer/core
src/ProjectLoader.php
ProjectLoader.findProjectRoot
private function findProjectRoot(string $dir) : ?string { do { $path = $dir . '/composer.json'; if (file_exists($path)) { return $dir; } $prev = $dir; $dir = dirname($dir); } while ($dir !== $prev); return null; ...
php
private function findProjectRoot(string $dir) : ?string { do { $path = $dir . '/composer.json'; if (file_exists($path)) { return $dir; } $prev = $dir; $dir = dirname($dir); } while ($dir !== $prev); return null; ...
[ "private", "function", "findProjectRoot", "(", "string", "$", "dir", ")", ":", "?", "string", "{", "do", "{", "$", "path", "=", "$", "dir", ".", "'/composer.json'", ";", "if", "(", "file_exists", "(", "$", "path", ")", ")", "{", "return", "$", "dir",...
Finds project root by locating composer.json located in the current working directory or its closest parent @param string $dir Current working directory @return string|null
[ "Finds", "project", "root", "by", "locating", "composer", ".", "json", "located", "in", "the", "current", "working", "directory", "or", "its", "closest", "parent" ]
583369a5f5c91496862f6bdf60b69565da4bc05d
https://github.com/diff-sniffer/core/blob/583369a5f5c91496862f6bdf60b69565da4bc05d/src/ProjectLoader.php#L85-L99
29,950
diff-sniffer/core
src/ProjectLoader.php
ProjectLoader.loadComposerConfiguration
private function loadComposerConfiguration() : array { $contents = file_get_contents($this->root . '/composer.json'); $config = json_decode($contents, true); if (json_last_error() !== JSON_ERROR_NONE) { throw new RuntimeException(json_last_error_msg()); } return...
php
private function loadComposerConfiguration() : array { $contents = file_get_contents($this->root . '/composer.json'); $config = json_decode($contents, true); if (json_last_error() !== JSON_ERROR_NONE) { throw new RuntimeException(json_last_error_msg()); } return...
[ "private", "function", "loadComposerConfiguration", "(", ")", ":", "array", "{", "$", "contents", "=", "file_get_contents", "(", "$", "this", "->", "root", ".", "'/composer.json'", ")", ";", "$", "config", "=", "json_decode", "(", "$", "contents", ",", "true...
Loads composer configuration from the given file @return array Configuration parameters
[ "Loads", "composer", "configuration", "from", "the", "given", "file" ]
583369a5f5c91496862f6bdf60b69565da4bc05d
https://github.com/diff-sniffer/core/blob/583369a5f5c91496862f6bdf60b69565da4bc05d/src/ProjectLoader.php#L121-L131
29,951
diff-sniffer/core
src/ProjectLoader.php
ProjectLoader.massageConfig
private function massageConfig(array $config, string $configPath) : array { if (!isset($config['installed_paths'])) { return $config; } $config['installed_paths'] = implode(',', array_map(function ($path) use ($configPath) { return dirname($configPath) . '/' . $path;...
php
private function massageConfig(array $config, string $configPath) : array { if (!isset($config['installed_paths'])) { return $config; } $config['installed_paths'] = implode(',', array_map(function ($path) use ($configPath) { return dirname($configPath) . '/' . $path;...
[ "private", "function", "massageConfig", "(", "array", "$", "config", ",", "string", "$", "configPath", ")", ":", "array", "{", "if", "(", "!", "isset", "(", "$", "config", "[", "'installed_paths'", "]", ")", ")", "{", "return", "$", "config", ";", "}",...
Resolves relative installed paths against the configuration file path @param array $config Configuration parameters @param string $configPath Configuration file paths @return array Configuration parameters
[ "Resolves", "relative", "installed", "paths", "against", "the", "configuration", "file", "path" ]
583369a5f5c91496862f6bdf60b69565da4bc05d
https://github.com/diff-sniffer/core/blob/583369a5f5c91496862f6bdf60b69565da4bc05d/src/ProjectLoader.php#L155-L166
29,952
ventoviro/windwalker-core
src/Core/Form/AbstractFieldDefinition.php
AbstractFieldDefinition.define
public function define(Form $form) { $this->namespaces = new PriorityQueue(); $this->namespaces->insert('Windwalker\Form\Field', PriorityQueue::NORMAL); $this->bootTraits($this); $this->form = $form; $this->doDefine($form); }
php
public function define(Form $form) { $this->namespaces = new PriorityQueue(); $this->namespaces->insert('Windwalker\Form\Field', PriorityQueue::NORMAL); $this->bootTraits($this); $this->form = $form; $this->doDefine($form); }
[ "public", "function", "define", "(", "Form", "$", "form", ")", "{", "$", "this", "->", "namespaces", "=", "new", "PriorityQueue", "(", ")", ";", "$", "this", "->", "namespaces", "->", "insert", "(", "'Windwalker\\Form\\Field'", ",", "PriorityQueue", "::", ...
Define the form fields. @param Form $form The Windwalker form object. @return void
[ "Define", "the", "form", "fields", "." ]
0ed53059fc2d5d2d9b72f0e4aeef2fdf6aac0074
https://github.com/ventoviro/windwalker-core/blob/0ed53059fc2d5d2d9b72f0e4aeef2fdf6aac0074/src/Core/Form/AbstractFieldDefinition.php#L99-L109
29,953
elvetemedve/behat-screenshot
src/Bex/Behat/ScreenshotExtension/Service/ScreenshotTaker.php
ScreenshotTaker.takeScreenshot
public function takeScreenshot() { try { $this->screenshots[] = $this->mink->getSession()->getScreenshot(); } catch (UnsupportedDriverActionException $e) { return; } catch (\Exception $e) { $this->output->writeln($e->getMessage()); } }
php
public function takeScreenshot() { try { $this->screenshots[] = $this->mink->getSession()->getScreenshot(); } catch (UnsupportedDriverActionException $e) { return; } catch (\Exception $e) { $this->output->writeln($e->getMessage()); } }
[ "public", "function", "takeScreenshot", "(", ")", "{", "try", "{", "$", "this", "->", "screenshots", "[", "]", "=", "$", "this", "->", "mink", "->", "getSession", "(", ")", "->", "getScreenshot", "(", ")", ";", "}", "catch", "(", "UnsupportedDriverAction...
Save the screenshot into a local buffer
[ "Save", "the", "screenshot", "into", "a", "local", "buffer" ]
9860b8d825dab027d0fc975914131fc758561674
https://github.com/elvetemedve/behat-screenshot/blob/9860b8d825dab027d0fc975914131fc758561674/src/Bex/Behat/ScreenshotExtension/Service/ScreenshotTaker.php#L50-L59
29,954
elvetemedve/behat-screenshot
src/Bex/Behat/ScreenshotExtension/Listener/ScreenshotListener.php
ScreenshotListener.saveScreenshot
public function saveScreenshot(AfterScenarioTested $event) { if ($this->shouldSaveScreenshot($event)) { $fileName = $this->filenameGenerator->generateFileName($event->getFeature(), $event->getScenario()); $image = $this->screenshotTaker->getImage(); $this->screenshotUploa...
php
public function saveScreenshot(AfterScenarioTested $event) { if ($this->shouldSaveScreenshot($event)) { $fileName = $this->filenameGenerator->generateFileName($event->getFeature(), $event->getScenario()); $image = $this->screenshotTaker->getImage(); $this->screenshotUploa...
[ "public", "function", "saveScreenshot", "(", "AfterScenarioTested", "$", "event", ")", "{", "if", "(", "$", "this", "->", "shouldSaveScreenshot", "(", "$", "event", ")", ")", "{", "$", "fileName", "=", "$", "this", "->", "filenameGenerator", "->", "generateF...
Save screenshot after scanerio if required @param AfterScenarioTested $event
[ "Save", "screenshot", "after", "scanerio", "if", "required" ]
9860b8d825dab027d0fc975914131fc758561674
https://github.com/elvetemedve/behat-screenshot/blob/9860b8d825dab027d0fc975914131fc758561674/src/Bex/Behat/ScreenshotExtension/Listener/ScreenshotListener.php#L92-L101
29,955
elvetemedve/behat-screenshot
src/Bex/Behat/ScreenshotExtension/Output/IndentedOutput.php
IndentedOutput.setFormatter
public function setFormatter(\Symfony\Component\Console\Formatter\OutputFormatterInterface $formatter) { $this->decoratedOutput->setFormatter($formatter); }
php
public function setFormatter(\Symfony\Component\Console\Formatter\OutputFormatterInterface $formatter) { $this->decoratedOutput->setFormatter($formatter); }
[ "public", "function", "setFormatter", "(", "\\", "Symfony", "\\", "Component", "\\", "Console", "\\", "Formatter", "\\", "OutputFormatterInterface", "$", "formatter", ")", "{", "$", "this", "->", "decoratedOutput", "->", "setFormatter", "(", "$", "formatter", ")...
Sets output formatter. @param \Symfony\Component\Console\Formatter\OutputFormatterInterface $formatter
[ "Sets", "output", "formatter", "." ]
9860b8d825dab027d0fc975914131fc758561674
https://github.com/elvetemedve/behat-screenshot/blob/9860b8d825dab027d0fc975914131fc758561674/src/Bex/Behat/ScreenshotExtension/Output/IndentedOutput.php#L160-L163
29,956
elvetemedve/behat-screenshot
src/Bex/Behat/ScreenshotExtension/Output/IndentedOutput.php
IndentedOutput.addIndentationToMessages
private function addIndentationToMessages($messages) { if (is_array($messages)) { array_walk( $messages, function ($message) { return $this->indentation . $message; } ); return $messages; } else {...
php
private function addIndentationToMessages($messages) { if (is_array($messages)) { array_walk( $messages, function ($message) { return $this->indentation . $message; } ); return $messages; } else {...
[ "private", "function", "addIndentationToMessages", "(", "$", "messages", ")", "{", "if", "(", "is_array", "(", "$", "messages", ")", ")", "{", "array_walk", "(", "$", "messages", ",", "function", "(", "$", "message", ")", "{", "return", "$", "this", "->"...
Prepend message with padding @param $messages @return array|string
[ "Prepend", "message", "with", "padding" ]
9860b8d825dab027d0fc975914131fc758561674
https://github.com/elvetemedve/behat-screenshot/blob/9860b8d825dab027d0fc975914131fc758561674/src/Bex/Behat/ScreenshotExtension/Output/IndentedOutput.php#L182-L196
29,957
elvetemedve/behat-screenshot
src/Bex/Behat/ScreenshotExtension/ServiceContainer/Config.php
Config.loadServices
public function loadServices(ContainerBuilder $container) { $loader = new XmlFileLoader($container, new FileLocator(__DIR__ . '/config')); $loader->load('services.xml'); $this->imageDrivers = $this->driverLocator->findDrivers( $container, $this->imageDriverKeys, ...
php
public function loadServices(ContainerBuilder $container) { $loader = new XmlFileLoader($container, new FileLocator(__DIR__ . '/config')); $loader->load('services.xml'); $this->imageDrivers = $this->driverLocator->findDrivers( $container, $this->imageDriverKeys, ...
[ "public", "function", "loadServices", "(", "ContainerBuilder", "$", "container", ")", "{", "$", "loader", "=", "new", "XmlFileLoader", "(", "$", "container", ",", "new", "FileLocator", "(", "__DIR__", ".", "'/config'", ")", ")", ";", "$", "loader", "->", "...
Init service container and load image drivers @param ContainerBuilder $container
[ "Init", "service", "container", "and", "load", "image", "drivers" ]
9860b8d825dab027d0fc975914131fc758561674
https://github.com/elvetemedve/behat-screenshot/blob/9860b8d825dab027d0fc975914131fc758561674/src/Bex/Behat/ScreenshotExtension/ServiceContainer/Config.php#L120-L129
29,958
flash-global/connect-client
src/MetadataProvider.php
MetadataProvider.getSPEntityConfiguration
public function getSPEntityConfiguration($entityID) { $url = $this->buildUrl(self::API_IDP . '?entityID=' . $entityID); $request = (new RequestDescriptor()) ->setMethod('GET') ->setUrl($url); $response = $this->send($request); $extractor = (new MessageExtra...
php
public function getSPEntityConfiguration($entityID) { $url = $this->buildUrl(self::API_IDP . '?entityID=' . $entityID); $request = (new RequestDescriptor()) ->setMethod('GET') ->setUrl($url); $response = $this->send($request); $extractor = (new MessageExtra...
[ "public", "function", "getSPEntityConfiguration", "(", "$", "entityID", ")", "{", "$", "url", "=", "$", "this", "->", "buildUrl", "(", "self", "::", "API_IDP", ".", "'?entityID='", ".", "$", "entityID", ")", ";", "$", "request", "=", "(", "new", "Request...
Get the SP entity configuration from Connect IdP @param string $entityID @return SpEntityConfigurationMessage
[ "Get", "the", "SP", "entity", "configuration", "from", "Connect", "IdP" ]
003db4187fbba0c0b7bd7a1c53d8487da06748bd
https://github.com/flash-global/connect-client/blob/003db4187fbba0c0b7bd7a1c53d8487da06748bd/src/MetadataProvider.php#L86-L102
29,959
flash-global/connect-client
src/Config/ConfigConsistency.php
ConfigConsistency.createRSAPrivateKey
public function createRSAPrivateKey() { $path = $this->getConfig()->getPrivateKeyFilePath(); $this->createDir($path); $this->getConfig()->setPrivateKey((new RsaKeyGen())->createPrivateKey()); if (@file_put_contents($path, $this->getConfig()->getPrivateKey()) === false) { ...
php
public function createRSAPrivateKey() { $path = $this->getConfig()->getPrivateKeyFilePath(); $this->createDir($path); $this->getConfig()->setPrivateKey((new RsaKeyGen())->createPrivateKey()); if (@file_put_contents($path, $this->getConfig()->getPrivateKey()) === false) { ...
[ "public", "function", "createRSAPrivateKey", "(", ")", "{", "$", "path", "=", "$", "this", "->", "getConfig", "(", ")", "->", "getPrivateKeyFilePath", "(", ")", ";", "$", "this", "->", "createDir", "(", "$", "path", ")", ";", "$", "this", "->", "getCon...
Create and write the RSA private file @throws \Exception
[ "Create", "and", "write", "the", "RSA", "private", "file" ]
003db4187fbba0c0b7bd7a1c53d8487da06748bd
https://github.com/flash-global/connect-client/blob/003db4187fbba0c0b7bd7a1c53d8487da06748bd/src/Config/ConfigConsistency.php#L107-L116
29,960
flash-global/connect-client
src/Config/ConfigConsistency.php
ConfigConsistency.createIdpMetadataFile
protected function createIdpMetadataFile() { $url = $this->getConfig()->getIdpEntityID() . $this->getConfig()->getIdpMetadataFileTarget(); try { $idp = file_get_contents($url); $path = $this->getConfig()->getSamlMetadataBaseDir() . '/' . $this->getConfig()->getIdpMetadataFil...
php
protected function createIdpMetadataFile() { $url = $this->getConfig()->getIdpEntityID() . $this->getConfig()->getIdpMetadataFileTarget(); try { $idp = file_get_contents($url); $path = $this->getConfig()->getSamlMetadataBaseDir() . '/' . $this->getConfig()->getIdpMetadataFil...
[ "protected", "function", "createIdpMetadataFile", "(", ")", "{", "$", "url", "=", "$", "this", "->", "getConfig", "(", ")", "->", "getIdpEntityID", "(", ")", ".", "$", "this", "->", "getConfig", "(", ")", "->", "getIdpMetadataFileTarget", "(", ")", ";", ...
Create and write the IdP metadata XML file @throws \Exception
[ "Create", "and", "write", "the", "IdP", "metadata", "XML", "file" ]
003db4187fbba0c0b7bd7a1c53d8487da06748bd
https://github.com/flash-global/connect-client/blob/003db4187fbba0c0b7bd7a1c53d8487da06748bd/src/Config/ConfigConsistency.php#L123-L138
29,961
flash-global/connect-client
src/Config/ConfigConsistency.php
ConfigConsistency.createSpMetadataFile
protected function createSpMetadataFile() { $url = $this->getConfig()->getIdpEntityID(); $entityID = $this->getConfig()->getEntityID(); $metadataProvider = new MetadataProvider([MetadataProvider::OPTION_BASEURL => $url]); try { $message = $metadataProvider->getSPEntityC...
php
protected function createSpMetadataFile() { $url = $this->getConfig()->getIdpEntityID(); $entityID = $this->getConfig()->getEntityID(); $metadataProvider = new MetadataProvider([MetadataProvider::OPTION_BASEURL => $url]); try { $message = $metadataProvider->getSPEntityC...
[ "protected", "function", "createSpMetadataFile", "(", ")", "{", "$", "url", "=", "$", "this", "->", "getConfig", "(", ")", "->", "getIdpEntityID", "(", ")", ";", "$", "entityID", "=", "$", "this", "->", "getConfig", "(", ")", "->", "getEntityID", "(", ...
Create and write the SP metadata XML file @throws \Exception
[ "Create", "and", "write", "the", "SP", "metadata", "XML", "file" ]
003db4187fbba0c0b7bd7a1c53d8487da06748bd
https://github.com/flash-global/connect-client/blob/003db4187fbba0c0b7bd7a1c53d8487da06748bd/src/Config/ConfigConsistency.php#L145-L184
29,962
flash-global/connect-client
src/Exception/PingException.php
PingException.getResponse
public function getResponse() { $response = new Response(); $message = new Message(); $message->setData(['message' => $this->getMessage()]); if (!empty($this->getPrivateKey())) { $message->setCertificate($this->getCertificate()); $message->sign($this->getPri...
php
public function getResponse() { $response = new Response(); $message = new Message(); $message->setData(['message' => $this->getMessage()]); if (!empty($this->getPrivateKey())) { $message->setCertificate($this->getCertificate()); $message->sign($this->getPri...
[ "public", "function", "getResponse", "(", ")", "{", "$", "response", "=", "new", "Response", "(", ")", ";", "$", "message", "=", "new", "Message", "(", ")", ";", "$", "message", "->", "setData", "(", "[", "'message'", "=>", "$", "this", "->", "getMes...
Returns a ResponseInterface method @return \Psr\Http\Message\ResponseInterface
[ "Returns", "a", "ResponseInterface", "method" ]
003db4187fbba0c0b7bd7a1c53d8487da06748bd
https://github.com/flash-global/connect-client/blob/003db4187fbba0c0b7bd7a1c53d8487da06748bd/src/Exception/PingException.php#L79-L96
29,963
flash-global/connect-client
src/Config/Config.php
Config.registerProfileAssociation
public function registerProfileAssociation( callable $callback, $profileAssociationPath = '/connect/profile-association' ) { $this->profileAssociationCallback = $callback; $this->profileAssociationPath = $profileAssociationPath; return $this; }
php
public function registerProfileAssociation( callable $callback, $profileAssociationPath = '/connect/profile-association' ) { $this->profileAssociationCallback = $callback; $this->profileAssociationPath = $profileAssociationPath; return $this; }
[ "public", "function", "registerProfileAssociation", "(", "callable", "$", "callback", ",", "$", "profileAssociationPath", "=", "'/connect/profile-association'", ")", "{", "$", "this", "->", "profileAssociationCallback", "=", "$", "callback", ";", "$", "this", "->", ...
Register a profile association callback @param callable $callback @param string $profileAssociationPath @return $this
[ "Register", "a", "profile", "association", "callback" ]
003db4187fbba0c0b7bd7a1c53d8487da06748bd
https://github.com/flash-global/connect-client/blob/003db4187fbba0c0b7bd7a1c53d8487da06748bd/src/Config/Config.php#L345-L353
29,964
flash-global/connect-client
src/Metadata.php
Metadata.load
public static function load($idpMetadataFilePath, $spMetadataFilePath) { $metadata = (new static()); return $metadata ->setIdentityProvider($metadata->createEntityDescriptor(file_get_contents($idpMetadataFilePath))) ->setServiceProvider($metadata->createEntityDescriptor(file...
php
public static function load($idpMetadataFilePath, $spMetadataFilePath) { $metadata = (new static()); return $metadata ->setIdentityProvider($metadata->createEntityDescriptor(file_get_contents($idpMetadataFilePath))) ->setServiceProvider($metadata->createEntityDescriptor(file...
[ "public", "static", "function", "load", "(", "$", "idpMetadataFilePath", ",", "$", "spMetadataFilePath", ")", "{", "$", "metadata", "=", "(", "new", "static", "(", ")", ")", ";", "return", "$", "metadata", "->", "setIdentityProvider", "(", "$", "metadata", ...
Create an instance of Metadata @param string $idpMetadataFilePath @param string $spMetadataFilePath @return Metadata
[ "Create", "an", "instance", "of", "Metadata" ]
003db4187fbba0c0b7bd7a1c53d8487da06748bd
https://github.com/flash-global/connect-client/blob/003db4187fbba0c0b7bd7a1c53d8487da06748bd/src/Metadata.php#L33-L40
29,965
flash-global/connect-client
src/Metadata.php
Metadata.createEntityDescriptor
public function createEntityDescriptor($xml) { $deserializationContext = new DeserializationContext(); $deserializationContext->getDocument()->loadXML($xml); $ed = new EntityDescriptor(); $ed->deserialize($deserializationContext->getDocument(), $deserializationContext); ret...
php
public function createEntityDescriptor($xml) { $deserializationContext = new DeserializationContext(); $deserializationContext->getDocument()->loadXML($xml); $ed = new EntityDescriptor(); $ed->deserialize($deserializationContext->getDocument(), $deserializationContext); ret...
[ "public", "function", "createEntityDescriptor", "(", "$", "xml", ")", "{", "$", "deserializationContext", "=", "new", "DeserializationContext", "(", ")", ";", "$", "deserializationContext", "->", "getDocument", "(", ")", "->", "loadXML", "(", "$", "xml", ")", ...
Create an EntityDescriptor instance with its XML metadata contents @param string $xml @return EntityDescriptor
[ "Create", "an", "EntityDescriptor", "instance", "with", "its", "XML", "metadata", "contents" ]
003db4187fbba0c0b7bd7a1c53d8487da06748bd
https://github.com/flash-global/connect-client/blob/003db4187fbba0c0b7bd7a1c53d8487da06748bd/src/Metadata.php#L175-L184
29,966
flash-global/connect-client
src/Connect.php
Connect.handleRequest
public function handleRequest($requestUri = null, $requestMethod = null) { if (!$this->isConfigConsistent() && false) { throw new \LogicException('The client configuration is not consistent'); } $pathInfo = $requestUri; if (false !== $pos = strpos($pathInfo, '?')) { ...
php
public function handleRequest($requestUri = null, $requestMethod = null) { if (!$this->isConfigConsistent() && false) { throw new \LogicException('The client configuration is not consistent'); } $pathInfo = $requestUri; if (false !== $pos = strpos($pathInfo, '?')) { ...
[ "public", "function", "handleRequest", "(", "$", "requestUri", "=", "null", ",", "$", "requestMethod", "=", "null", ")", "{", "if", "(", "!", "$", "this", "->", "isConfigConsistent", "(", ")", "&&", "false", ")", "{", "throw", "new", "\\", "LogicExceptio...
Handle connect request @param string $requestUri @param string $requestMethod @return $this @throws \Exception
[ "Handle", "connect", "request" ]
003db4187fbba0c0b7bd7a1c53d8487da06748bd
https://github.com/flash-global/connect-client/blob/003db4187fbba0c0b7bd7a1c53d8487da06748bd/src/Connect.php#L373-L411
29,967
flash-global/connect-client
src/Connect.php
Connect.emit
public function emit() { if (headers_sent($file, $line)) { throw new \LogicException('Headers already sent in %s on line %d', $file, $line); } if ($this->getResponse()) { (new Response\SapiEmitter())->emit($this->getResponse()); exit(); } }
php
public function emit() { if (headers_sent($file, $line)) { throw new \LogicException('Headers already sent in %s on line %d', $file, $line); } if ($this->getResponse()) { (new Response\SapiEmitter())->emit($this->getResponse()); exit(); } }
[ "public", "function", "emit", "(", ")", "{", "if", "(", "headers_sent", "(", "$", "file", ",", "$", "line", ")", ")", "{", "throw", "new", "\\", "LogicException", "(", "'Headers already sent in %s on line %d'", ",", "$", "file", ",", "$", "line", ")", ";...
Emit the client response if exists and die...
[ "Emit", "the", "client", "response", "if", "exists", "and", "die", "..." ]
003db4187fbba0c0b7bd7a1c53d8487da06748bd
https://github.com/flash-global/connect-client/blob/003db4187fbba0c0b7bd7a1c53d8487da06748bd/src/Connect.php#L416-L426
29,968
flash-global/connect-client
src/Connect.php
Connect.switchRole
public function switchRole($role) { if ($this->isAuthenticated()) { $entityId = $this->getConfig()->getEntityID(); try { $isRole = false; /** @var Attribution $attribution **/ foreach ($this->getUser()->getAttributions() as $attributi...
php
public function switchRole($role) { if ($this->isAuthenticated()) { $entityId = $this->getConfig()->getEntityID(); try { $isRole = false; /** @var Attribution $attribution **/ foreach ($this->getUser()->getAttributions() as $attributi...
[ "public", "function", "switchRole", "(", "$", "role", ")", "{", "if", "(", "$", "this", "->", "isAuthenticated", "(", ")", ")", "{", "$", "entityId", "=", "$", "this", "->", "getConfig", "(", ")", "->", "getEntityID", "(", ")", ";", "try", "{", "$"...
Switch the User role @param string $role
[ "Switch", "the", "User", "role" ]
003db4187fbba0c0b7bd7a1c53d8487da06748bd
https://github.com/flash-global/connect-client/blob/003db4187fbba0c0b7bd7a1c53d8487da06748bd/src/Connect.php#L481-L509
29,969
flash-global/connect-client
src/Connect.php
Connect.switchLocalUsername
public function switchLocalUsername($localUsername, $role, $application = null) { if ($this->isAuthenticated()) { // If no Application, get current Application if (!$application) { $application = $this->getConfig()->getEntityID(); } try { ...
php
public function switchLocalUsername($localUsername, $role, $application = null) { if ($this->isAuthenticated()) { // If no Application, get current Application if (!$application) { $application = $this->getConfig()->getEntityID(); } try { ...
[ "public", "function", "switchLocalUsername", "(", "$", "localUsername", ",", "$", "role", ",", "$", "application", "=", "null", ")", "{", "if", "(", "$", "this", "->", "isAuthenticated", "(", ")", ")", "{", "// If no Application, get current Application", "if", ...
Switch the User role by localUsername @param string $localUsername @param string $role @param null $application
[ "Switch", "the", "User", "role", "by", "localUsername" ]
003db4187fbba0c0b7bd7a1c53d8487da06748bd
https://github.com/flash-global/connect-client/blob/003db4187fbba0c0b7bd7a1c53d8487da06748bd/src/Connect.php#L518-L559
29,970
flash-global/connect-client
src/Exception/SamlException.php
SamlException.getContent
protected function getContent() { $response = new SamlResponse(); $response->setStatus(new Status(new StatusCode($this->status))); $context = new SerializationContext(); $response->serialize($context->getDocument(), $context); return $context->getDocument()->saveXML(); ...
php
protected function getContent() { $response = new SamlResponse(); $response->setStatus(new Status(new StatusCode($this->status))); $context = new SerializationContext(); $response->serialize($context->getDocument(), $context); return $context->getDocument()->saveXML(); ...
[ "protected", "function", "getContent", "(", ")", "{", "$", "response", "=", "new", "SamlResponse", "(", ")", ";", "$", "response", "->", "setStatus", "(", "new", "Status", "(", "new", "StatusCode", "(", "$", "this", "->", "status", ")", ")", ")", ";", ...
Returns the Saml error reporting @return string
[ "Returns", "the", "Saml", "error", "reporting" ]
003db4187fbba0c0b7bd7a1c53d8487da06748bd
https://github.com/flash-global/connect-client/blob/003db4187fbba0c0b7bd7a1c53d8487da06748bd/src/Exception/SamlException.php#L53-L62
29,971
flash-global/connect-client
src/UserAttribution.php
UserAttribution.add
public function add($sourceId, $targetId, $roleId) { $request = (new RequestDescriptor()) ->setUrl($this->buildUrl(self::IDP_ATTRIBUTIONS_API)) ->setMethod('POST'); $request->setBodyParams([ 'data' => json_encode([ 'source_id' => $sourceId, ...
php
public function add($sourceId, $targetId, $roleId) { $request = (new RequestDescriptor()) ->setUrl($this->buildUrl(self::IDP_ATTRIBUTIONS_API)) ->setMethod('POST'); $request->setBodyParams([ 'data' => json_encode([ 'source_id' => $sourceId, ...
[ "public", "function", "add", "(", "$", "sourceId", ",", "$", "targetId", ",", "$", "roleId", ")", "{", "$", "request", "=", "(", "new", "RequestDescriptor", "(", ")", ")", "->", "setUrl", "(", "$", "this", "->", "buildUrl", "(", "self", "::", "IDP_AT...
Add an Attribution @param int $sourceId @param int $targetId @param int $roleId @return Attribution|null
[ "Add", "an", "Attribution" ]
003db4187fbba0c0b7bd7a1c53d8487da06748bd
https://github.com/flash-global/connect-client/blob/003db4187fbba0c0b7bd7a1c53d8487da06748bd/src/UserAttribution.php#L47-L75
29,972
flash-global/connect-client
src/UserAttribution.php
UserAttribution.get
public function get($sourceId, $targetId = null) { $url = self::IDP_ATTRIBUTIONS_API . '/' . $sourceId; if ($targetId) { $url .= '?target=' . urlencode($targetId); } $request = (new RequestDescriptor()) ->setUrl($this->buildUrl($url)) ->setMethod(...
php
public function get($sourceId, $targetId = null) { $url = self::IDP_ATTRIBUTIONS_API . '/' . $sourceId; if ($targetId) { $url .= '?target=' . urlencode($targetId); } $request = (new RequestDescriptor()) ->setUrl($this->buildUrl($url)) ->setMethod(...
[ "public", "function", "get", "(", "$", "sourceId", ",", "$", "targetId", "=", "null", ")", "{", "$", "url", "=", "self", "::", "IDP_ATTRIBUTIONS_API", ".", "'/'", ".", "$", "sourceId", ";", "if", "(", "$", "targetId", ")", "{", "$", "url", ".=", "'...
Get an User Attributions @param int $sourceId @param int|null $targetId @return Attribution[]
[ "Get", "an", "User", "Attributions" ]
003db4187fbba0c0b7bd7a1c53d8487da06748bd
https://github.com/flash-global/connect-client/blob/003db4187fbba0c0b7bd7a1c53d8487da06748bd/src/UserAttribution.php#L85-L109
29,973
flash-global/connect-client
src/UserAttribution.php
UserAttribution.remove
public function remove($sourceId, $targetId = null, $roleId = null) { $request = (new RequestDescriptor()) ->setUrl($this->buildUrl(self::IDP_ATTRIBUTIONS_API)) ->setMethod('DELETE') ->setRawData(json_encode([ 'source_id' => $sourceId, 'tar...
php
public function remove($sourceId, $targetId = null, $roleId = null) { $request = (new RequestDescriptor()) ->setUrl($this->buildUrl(self::IDP_ATTRIBUTIONS_API)) ->setMethod('DELETE') ->setRawData(json_encode([ 'source_id' => $sourceId, 'tar...
[ "public", "function", "remove", "(", "$", "sourceId", ",", "$", "targetId", "=", "null", ",", "$", "roleId", "=", "null", ")", "{", "$", "request", "=", "(", "new", "RequestDescriptor", "(", ")", ")", "->", "setUrl", "(", "$", "this", "->", "buildUrl...
Remove attributions for a user. An application and a role can be defined to target more attributions more precisely. @param int $sourceId @param int $targetId @param int $roleId If omitted, all attributions link to this source / target will be deleted.
[ "Remove", "attributions", "for", "a", "user", ".", "An", "application", "and", "a", "role", "can", "be", "defined", "to", "target", "more", "attributions", "more", "precisely", "." ]
003db4187fbba0c0b7bd7a1c53d8487da06748bd
https://github.com/flash-global/connect-client/blob/003db4187fbba0c0b7bd7a1c53d8487da06748bd/src/UserAttribution.php#L120-L144
29,974
flash-global/connect-client
src/Handler/RegisterAdminHandler.php
RegisterAdminHandler.generateXml
protected function generateXml(Connect $connect, $privateKey, $data) { $certificateGen = (new X509CertificateGen())->createX509Certificate($privateKey); $certificate = new X509Certificate(); $certificate->loadPem($certificateGen); $builder = new MetadataBuilder(); $xml = $b...
php
protected function generateXml(Connect $connect, $privateKey, $data) { $certificateGen = (new X509CertificateGen())->createX509Certificate($privateKey); $certificate = new X509Certificate(); $certificate->loadPem($certificateGen); $builder = new MetadataBuilder(); $xml = $b...
[ "protected", "function", "generateXml", "(", "Connect", "$", "connect", ",", "$", "privateKey", ",", "$", "data", ")", "{", "$", "certificateGen", "=", "(", "new", "X509CertificateGen", "(", ")", ")", "->", "createX509Certificate", "(", "$", "privateKey", ")...
Generate the SP metadata XML file @param Connect $connect @param string $privateKey @param array $data @return MessageResponse
[ "Generate", "the", "SP", "metadata", "XML", "file" ]
003db4187fbba0c0b7bd7a1c53d8487da06748bd
https://github.com/flash-global/connect-client/blob/003db4187fbba0c0b7bd7a1c53d8487da06748bd/src/Handler/RegisterAdminHandler.php#L84-L112
29,975
flash-global/connect-client
src/UserAdmin.php
UserAdmin.fetchCertificate
protected function fetchCertificate() { $metadata = file_get_contents($this->getBaseUrl() . $this->getAdminSpMetadataFile()); $deserializationContext = new DeserializationContext(); $deserializationContext->getDocument()->loadXML($metadata); $ed = new EntityDescriptor(); $e...
php
protected function fetchCertificate() { $metadata = file_get_contents($this->getBaseUrl() . $this->getAdminSpMetadataFile()); $deserializationContext = new DeserializationContext(); $deserializationContext->getDocument()->loadXML($metadata); $ed = new EntityDescriptor(); $e...
[ "protected", "function", "fetchCertificate", "(", ")", "{", "$", "metadata", "=", "file_get_contents", "(", "$", "this", "->", "getBaseUrl", "(", ")", ".", "$", "this", "->", "getAdminSpMetadataFile", "(", ")", ")", ";", "$", "deserializationContext", "=", "...
Fetch Connect Admin SP metadata an return encryption certificate @return string
[ "Fetch", "Connect", "Admin", "SP", "metadata", "an", "return", "encryption", "certificate" ]
003db4187fbba0c0b7bd7a1c53d8487da06748bd
https://github.com/flash-global/connect-client/blob/003db4187fbba0c0b7bd7a1c53d8487da06748bd/src/UserAdmin.php#L316-L335
29,976
flash-global/connect-client
src/UserAdmin.php
UserAdmin.createToken
protected function createToken() { $token = $this->getToken()->createApplicationToken( $this->connect->getSaml()->getMetadata()->getServiceProvider()->getEntityID(), $this->connect->getSaml()->getPrivateKey() ); return $token['token']; }
php
protected function createToken() { $token = $this->getToken()->createApplicationToken( $this->connect->getSaml()->getMetadata()->getServiceProvider()->getEntityID(), $this->connect->getSaml()->getPrivateKey() ); return $token['token']; }
[ "protected", "function", "createToken", "(", ")", "{", "$", "token", "=", "$", "this", "->", "getToken", "(", ")", "->", "createApplicationToken", "(", "$", "this", "->", "connect", "->", "getSaml", "(", ")", "->", "getMetadata", "(", ")", "->", "getServ...
Get a token @return string
[ "Get", "a", "token" ]
003db4187fbba0c0b7bd7a1c53d8487da06748bd
https://github.com/flash-global/connect-client/blob/003db4187fbba0c0b7bd7a1c53d8487da06748bd/src/UserAdmin.php#L342-L349
29,977
flash-global/connect-client
src/MetadataBuilder.php
MetadataBuilder.build
public function build($entityID, $acs, $logout, $certificate) { $entityDescriptor = (new EntityDescriptor()) ->setEntityID($entityID) ->setID(Helper::generateID()); $spSsoDescriptor = (new SpSsoDescriptor()) ->addKeyDescriptor( (new KeyDescriptor(...
php
public function build($entityID, $acs, $logout, $certificate) { $entityDescriptor = (new EntityDescriptor()) ->setEntityID($entityID) ->setID(Helper::generateID()); $spSsoDescriptor = (new SpSsoDescriptor()) ->addKeyDescriptor( (new KeyDescriptor(...
[ "public", "function", "build", "(", "$", "entityID", ",", "$", "acs", ",", "$", "logout", ",", "$", "certificate", ")", "{", "$", "entityDescriptor", "=", "(", "new", "EntityDescriptor", "(", ")", ")", "->", "setEntityID", "(", "$", "entityID", ")", "-...
Build the SP SAML metadata @param $entityID @param $acs @param $logout @param $certificate @return string
[ "Build", "the", "SP", "SAML", "metadata" ]
003db4187fbba0c0b7bd7a1c53d8487da06748bd
https://github.com/flash-global/connect-client/blob/003db4187fbba0c0b7bd7a1c53d8487da06748bd/src/MetadataBuilder.php#L57-L96
29,978
flash-global/connect-client
src/Token.php
Token.create
public function create(Connect $connect) { $tokenRequest = $this->getTokenizer()->signTokenRequest( $this->getTokenizer()->createTokenRequest( $connect->getUser(), $connect->getSaml()->getMetadata()->getServiceProvider()->getEntityID() ), $...
php
public function create(Connect $connect) { $tokenRequest = $this->getTokenizer()->signTokenRequest( $this->getTokenizer()->createTokenRequest( $connect->getUser(), $connect->getSaml()->getMetadata()->getServiceProvider()->getEntityID() ), $...
[ "public", "function", "create", "(", "Connect", "$", "connect", ")", "{", "$", "tokenRequest", "=", "$", "this", "->", "getTokenizer", "(", ")", "->", "signTokenRequest", "(", "$", "this", "->", "getTokenizer", "(", ")", "->", "createTokenRequest", "(", "$...
Create a Token @param Connect $connect @return string
[ "Create", "a", "Token" ]
003db4187fbba0c0b7bd7a1c53d8487da06748bd
https://github.com/flash-global/connect-client/blob/003db4187fbba0c0b7bd7a1c53d8487da06748bd/src/Token.php#L101-L129
29,979
flash-global/connect-client
src/Token.php
Token.createApplicationToken
public function createApplicationToken($application, $privateKey) { $tokenRequest = $this->getTokenizer()->signTokenRequest( $this->getTokenizer()->createApplicationTokenRequest( $application ), $privateKey ); $request = (new RequestDescri...
php
public function createApplicationToken($application, $privateKey) { $tokenRequest = $this->getTokenizer()->signTokenRequest( $this->getTokenizer()->createApplicationTokenRequest( $application ), $privateKey ); $request = (new RequestDescri...
[ "public", "function", "createApplicationToken", "(", "$", "application", ",", "$", "privateKey", ")", "{", "$", "tokenRequest", "=", "$", "this", "->", "getTokenizer", "(", ")", "->", "signTokenRequest", "(", "$", "this", "->", "getTokenizer", "(", ")", "->"...
Create an application token @param string $application @param resource|string $privateKey @return string
[ "Create", "an", "application", "token" ]
003db4187fbba0c0b7bd7a1c53d8487da06748bd
https://github.com/flash-global/connect-client/blob/003db4187fbba0c0b7bd7a1c53d8487da06748bd/src/Token.php#L139-L168
29,980
flash-global/connect-client
src/Token.php
Token.validate
public function validate($token) { if ($this->hasCache()) { $body = $this->getCache()->get($token); // Check if token is expired if (!is_null($body)) { $body = json_decode($body, true); if (new \DateTime($body['expire_at']) >= new \DateTim...
php
public function validate($token) { if ($this->hasCache()) { $body = $this->getCache()->get($token); // Check if token is expired if (!is_null($body)) { $body = json_decode($body, true); if (new \DateTime($body['expire_at']) >= new \DateTim...
[ "public", "function", "validate", "(", "$", "token", ")", "{", "if", "(", "$", "this", "->", "hasCache", "(", ")", ")", "{", "$", "body", "=", "$", "this", "->", "getCache", "(", ")", "->", "get", "(", "$", "token", ")", ";", "// Check if token is ...
Validate a Token @param string $token @return array @throws ApiClientException
[ "Validate", "a", "Token" ]
003db4187fbba0c0b7bd7a1c53d8487da06748bd
https://github.com/flash-global/connect-client/blob/003db4187fbba0c0b7bd7a1c53d8487da06748bd/src/Token.php#L179-L223
29,981
flash-global/connect-client
src/Token.php
Token.buildValidationReturn
protected function buildValidationReturn(array $body) { if (isset($body['user'])) { $body['user'] = new User($body['user']); } $body['application'] = new Application($body['application']); $body['expire_at'] = new \DateTime($body['expire_at']); return $body; ...
php
protected function buildValidationReturn(array $body) { if (isset($body['user'])) { $body['user'] = new User($body['user']); } $body['application'] = new Application($body['application']); $body['expire_at'] = new \DateTime($body['expire_at']); return $body; ...
[ "protected", "function", "buildValidationReturn", "(", "array", "$", "body", ")", "{", "if", "(", "isset", "(", "$", "body", "[", "'user'", "]", ")", ")", "{", "$", "body", "[", "'user'", "]", "=", "new", "User", "(", "$", "body", "[", "'user'", "]...
Build the validation return @param array $body @return array
[ "Build", "the", "validation", "return" ]
003db4187fbba0c0b7bd7a1c53d8487da06748bd
https://github.com/flash-global/connect-client/blob/003db4187fbba0c0b7bd7a1c53d8487da06748bd/src/Token.php#L232-L242
29,982
flash-global/connect-client
src/Saml.php
Saml.buildAuthnRequest
public function buildAuthnRequest() { $authnRequest = (new AuthnRequest()) ->setAssertionConsumerServiceURL($this->getMetadata()->getFirstAcs()->getLocation()) ->setProtocolBinding($this->getMetadata()->getFirstAcs()->getBinding()) ->setID(Helper::generateID()) ...
php
public function buildAuthnRequest() { $authnRequest = (new AuthnRequest()) ->setAssertionConsumerServiceURL($this->getMetadata()->getFirstAcs()->getLocation()) ->setProtocolBinding($this->getMetadata()->getFirstAcs()->getBinding()) ->setID(Helper::generateID()) ...
[ "public", "function", "buildAuthnRequest", "(", ")", "{", "$", "authnRequest", "=", "(", "new", "AuthnRequest", "(", ")", ")", "->", "setAssertionConsumerServiceURL", "(", "$", "this", "->", "getMetadata", "(", ")", "->", "getFirstAcs", "(", ")", "->", "getL...
Returns a AuthnRequest @return \LightSaml\Model\Protocol\SamlMessage
[ "Returns", "a", "AuthnRequest" ]
003db4187fbba0c0b7bd7a1c53d8487da06748bd
https://github.com/flash-global/connect-client/blob/003db4187fbba0c0b7bd7a1c53d8487da06748bd/src/Saml.php#L173-L197
29,983
flash-global/connect-client
src/Saml.php
Saml.createLogoutResponse
public function createLogoutResponse() { return (new LogoutResponse()) ->setStatus(new Status(new StatusCode(SamlConstants::STATUS_SUCCESS))) ->setID(Helper::generateID()) ->setVersion(SamlConstants::VERSION_20) ->setIssuer(new Issuer($this->getMetadata()->get...
php
public function createLogoutResponse() { return (new LogoutResponse()) ->setStatus(new Status(new StatusCode(SamlConstants::STATUS_SUCCESS))) ->setID(Helper::generateID()) ->setVersion(SamlConstants::VERSION_20) ->setIssuer(new Issuer($this->getMetadata()->get...
[ "public", "function", "createLogoutResponse", "(", ")", "{", "return", "(", "new", "LogoutResponse", "(", ")", ")", "->", "setStatus", "(", "new", "Status", "(", "new", "StatusCode", "(", "SamlConstants", "::", "STATUS_SUCCESS", ")", ")", ")", "->", "setID",...
Create a Saml Logout Response @return LogoutResponse|SamlMessage
[ "Create", "a", "Saml", "Logout", "Response" ]
003db4187fbba0c0b7bd7a1c53d8487da06748bd
https://github.com/flash-global/connect-client/blob/003db4187fbba0c0b7bd7a1c53d8487da06748bd/src/Saml.php#L204-L212
29,984
flash-global/connect-client
src/Saml.php
Saml.prepareLogoutResponse
public function prepareLogoutResponse(LogoutRequest $request) { $response = $this->createLogoutResponse(); $idp = $this->getMetadata()->getFirstIdpSsoDescriptor(); $location = $idp->getFirstSingleLogoutService()->getResponseLocation() ? $idp->getFirstSingleLogoutService()->getR...
php
public function prepareLogoutResponse(LogoutRequest $request) { $response = $this->createLogoutResponse(); $idp = $this->getMetadata()->getFirstIdpSsoDescriptor(); $location = $idp->getFirstSingleLogoutService()->getResponseLocation() ? $idp->getFirstSingleLogoutService()->getR...
[ "public", "function", "prepareLogoutResponse", "(", "LogoutRequest", "$", "request", ")", "{", "$", "response", "=", "$", "this", "->", "createLogoutResponse", "(", ")", ";", "$", "idp", "=", "$", "this", "->", "getMetadata", "(", ")", "->", "getFirstIdpSsoD...
Prepare a LogoutResponse to be send @param LogoutRequest $request @return LogoutResponse
[ "Prepare", "a", "LogoutResponse", "to", "be", "send" ]
003db4187fbba0c0b7bd7a1c53d8487da06748bd
https://github.com/flash-global/connect-client/blob/003db4187fbba0c0b7bd7a1c53d8487da06748bd/src/Saml.php#L221-L237
29,985
flash-global/connect-client
src/Saml.php
Saml.createLogoutRequest
public function createLogoutRequest() { return (new LogoutRequest()) ->setID(Helper::generateID()) ->setVersion(SamlConstants::VERSION_20) ->setIssueInstant(new \DateTime()) ->setIssuer(new Issuer($this->getMetadata()->getServiceProvider()->getEntityID())); ...
php
public function createLogoutRequest() { return (new LogoutRequest()) ->setID(Helper::generateID()) ->setVersion(SamlConstants::VERSION_20) ->setIssueInstant(new \DateTime()) ->setIssuer(new Issuer($this->getMetadata()->getServiceProvider()->getEntityID())); ...
[ "public", "function", "createLogoutRequest", "(", ")", "{", "return", "(", "new", "LogoutRequest", "(", ")", ")", "->", "setID", "(", "Helper", "::", "generateID", "(", ")", ")", "->", "setVersion", "(", "SamlConstants", "::", "VERSION_20", ")", "->", "set...
Create a Saml Logout Request @return LogoutRequest|SamlMessage
[ "Create", "a", "Saml", "Logout", "Request" ]
003db4187fbba0c0b7bd7a1c53d8487da06748bd
https://github.com/flash-global/connect-client/blob/003db4187fbba0c0b7bd7a1c53d8487da06748bd/src/Saml.php#L244-L251
29,986
flash-global/connect-client
src/Saml.php
Saml.prepareLogoutRequest
public function prepareLogoutRequest(User $user, $sessionIndex = null) { $request = $this->createLogoutRequest(); $request->setNameID( new NameID( $user->getUserName(), SamlConstants::NAME_ID_FORMAT_UNSPECIFIED ) ); if (!is_nu...
php
public function prepareLogoutRequest(User $user, $sessionIndex = null) { $request = $this->createLogoutRequest(); $request->setNameID( new NameID( $user->getUserName(), SamlConstants::NAME_ID_FORMAT_UNSPECIFIED ) ); if (!is_nu...
[ "public", "function", "prepareLogoutRequest", "(", "User", "$", "user", ",", "$", "sessionIndex", "=", "null", ")", "{", "$", "request", "=", "$", "this", "->", "createLogoutRequest", "(", ")", ";", "$", "request", "->", "setNameID", "(", "new", "NameID", ...
Prepare LogoutRequest before sending @param User $user @param null $sessionIndex @return LogoutRequest|SamlMessage
[ "Prepare", "LogoutRequest", "before", "sending" ]
003db4187fbba0c0b7bd7a1c53d8487da06748bd
https://github.com/flash-global/connect-client/blob/003db4187fbba0c0b7bd7a1c53d8487da06748bd/src/Saml.php#L261-L285
29,987
flash-global/connect-client
src/Saml.php
Saml.getHttpRedirectBindingResponse
public function getHttpRedirectBindingResponse(AuthnRequest $request = null) { if (is_null($request)) { $request = $this->buildAuthnRequest(); } $context = new MessageContext(); $context->setMessage($request); $binding = (new BindingFactory())->create(SamlConsta...
php
public function getHttpRedirectBindingResponse(AuthnRequest $request = null) { if (is_null($request)) { $request = $this->buildAuthnRequest(); } $context = new MessageContext(); $context->setMessage($request); $binding = (new BindingFactory())->create(SamlConsta...
[ "public", "function", "getHttpRedirectBindingResponse", "(", "AuthnRequest", "$", "request", "=", "null", ")", "{", "if", "(", "is_null", "(", "$", "request", ")", ")", "{", "$", "request", "=", "$", "this", "->", "buildAuthnRequest", "(", ")", ";", "}", ...
Returns the AuthnRequest using HTTP Redirect Binding to Identity Provider SSO location @param AuthnRequest $request @return RedirectResponse
[ "Returns", "the", "AuthnRequest", "using", "HTTP", "Redirect", "Binding", "to", "Identity", "Provider", "SSO", "location" ]
003db4187fbba0c0b7bd7a1c53d8487da06748bd
https://github.com/flash-global/connect-client/blob/003db4187fbba0c0b7bd7a1c53d8487da06748bd/src/Saml.php#L294-L306
29,988
flash-global/connect-client
src/Saml.php
Saml.getHttpPostBindingResponse
public function getHttpPostBindingResponse(SamlMessage $message) { $bindingFactory = new BindingFactory(); $postBinding = $bindingFactory->create(SamlConstants::BINDING_SAML2_HTTP_POST); $messageContext = new MessageContext(); $messageContext->setMessage($message); $httpRes...
php
public function getHttpPostBindingResponse(SamlMessage $message) { $bindingFactory = new BindingFactory(); $postBinding = $bindingFactory->create(SamlConstants::BINDING_SAML2_HTTP_POST); $messageContext = new MessageContext(); $messageContext->setMessage($message); $httpRes...
[ "public", "function", "getHttpPostBindingResponse", "(", "SamlMessage", "$", "message", ")", "{", "$", "bindingFactory", "=", "new", "BindingFactory", "(", ")", ";", "$", "postBinding", "=", "$", "bindingFactory", "->", "create", "(", "SamlConstants", "::", "BIN...
Returns the HtmlResponse with the form of PostBinding as content @param SamlMessage $message @return HtmlResponse
[ "Returns", "the", "HtmlResponse", "with", "the", "form", "of", "PostBinding", "as", "content" ]
003db4187fbba0c0b7bd7a1c53d8487da06748bd
https://github.com/flash-global/connect-client/blob/003db4187fbba0c0b7bd7a1c53d8487da06748bd/src/Saml.php#L315-L326
29,989
flash-global/connect-client
src/Saml.php
Saml.signMessage
public function signMessage(SamlMessage $message) { return $message->setSignature( new SignatureWriter( $this->getMetadata() ->getFirstSpSsoDescriptor() ->getFirstKeyDescriptor(KeyDescriptor::USE_SIGNING) ->getCertificat...
php
public function signMessage(SamlMessage $message) { return $message->setSignature( new SignatureWriter( $this->getMetadata() ->getFirstSpSsoDescriptor() ->getFirstKeyDescriptor(KeyDescriptor::USE_SIGNING) ->getCertificat...
[ "public", "function", "signMessage", "(", "SamlMessage", "$", "message", ")", "{", "return", "$", "message", "->", "setSignature", "(", "new", "SignatureWriter", "(", "$", "this", "->", "getMetadata", "(", ")", "->", "getFirstSpSsoDescriptor", "(", ")", "->", ...
Sign a Saml Message @param SamlMessage $message @return SamlMessage
[ "Sign", "a", "Saml", "Message" ]
003db4187fbba0c0b7bd7a1c53d8487da06748bd
https://github.com/flash-global/connect-client/blob/003db4187fbba0c0b7bd7a1c53d8487da06748bd/src/Saml.php#L335-L346
29,990
flash-global/connect-client
src/Saml.php
Saml.validateSignature
public function validateSignature($message, XMLSecurityKey $key) { $reader = $message->getSignature(); if ($reader instanceof AbstractSignatureReader) { try { return $reader->validate($key); } catch (\Exception $e) { throw new SamlException('ur...
php
public function validateSignature($message, XMLSecurityKey $key) { $reader = $message->getSignature(); if ($reader instanceof AbstractSignatureReader) { try { return $reader->validate($key); } catch (\Exception $e) { throw new SamlException('ur...
[ "public", "function", "validateSignature", "(", "$", "message", ",", "XMLSecurityKey", "$", "key", ")", "{", "$", "reader", "=", "$", "message", "->", "getSignature", "(", ")", ";", "if", "(", "$", "reader", "instanceof", "AbstractSignatureReader", ")", "{",...
Validate a signed message @param SamlMessage|Assertion $message @param XMLSecurityKey $key @return bool @throws SamlException|SecurityException
[ "Validate", "a", "signed", "message" ]
003db4187fbba0c0b7bd7a1c53d8487da06748bd
https://github.com/flash-global/connect-client/blob/003db4187fbba0c0b7bd7a1c53d8487da06748bd/src/Saml.php#L358-L370
29,991
flash-global/connect-client
src/Saml.php
Saml.validateIssuer
public function validateIssuer(SamlMessage $message) { if ($this->getMetadata()->getIdentityProvider()->getEntityID() != $message->getIssuer()->getValue()) { throw new SamlException('urn:oasis:names:tc:SAML:2.0:status:RequestDenied'); } }
php
public function validateIssuer(SamlMessage $message) { if ($this->getMetadata()->getIdentityProvider()->getEntityID() != $message->getIssuer()->getValue()) { throw new SamlException('urn:oasis:names:tc:SAML:2.0:status:RequestDenied'); } }
[ "public", "function", "validateIssuer", "(", "SamlMessage", "$", "message", ")", "{", "if", "(", "$", "this", "->", "getMetadata", "(", ")", "->", "getIdentityProvider", "(", ")", "->", "getEntityID", "(", ")", "!=", "$", "message", "->", "getIssuer", "(",...
Validate IdP Response issuer @param SamlMessage $message @throws SamlException
[ "Validate", "IdP", "Response", "issuer" ]
003db4187fbba0c0b7bd7a1c53d8487da06748bd
https://github.com/flash-global/connect-client/blob/003db4187fbba0c0b7bd7a1c53d8487da06748bd/src/Saml.php#L391-L396
29,992
flash-global/connect-client
src/Saml.php
Saml.validateDestination
public function validateDestination(Response $response) { if ($this->getMetadata()->getFirstSpSsoDescriptor()->getFirstAssertionConsumerService()->getLocation() != $response->getDestination() ) { throw new SamlException('urn:oasis:names:tc:SAML:2.0:status:RequestDenied'); ...
php
public function validateDestination(Response $response) { if ($this->getMetadata()->getFirstSpSsoDescriptor()->getFirstAssertionConsumerService()->getLocation() != $response->getDestination() ) { throw new SamlException('urn:oasis:names:tc:SAML:2.0:status:RequestDenied'); ...
[ "public", "function", "validateDestination", "(", "Response", "$", "response", ")", "{", "if", "(", "$", "this", "->", "getMetadata", "(", ")", "->", "getFirstSpSsoDescriptor", "(", ")", "->", "getFirstAssertionConsumerService", "(", ")", "->", "getLocation", "(...
Validate IdP Response destination @param Response $response @throws SamlException
[ "Validate", "IdP", "Response", "destination" ]
003db4187fbba0c0b7bd7a1c53d8487da06748bd
https://github.com/flash-global/connect-client/blob/003db4187fbba0c0b7bd7a1c53d8487da06748bd/src/Saml.php#L405-L412
29,993
flash-global/connect-client
src/Saml.php
Saml.validateRelayState
public function validateRelayState(Response $response, $relayState) { if ($response->getRelayState() != null && $response->getRelayState() != $relayState) { throw new SamlException('urn:oasis:names:tc:SAML:2.0:status:RequestDenied'); } }
php
public function validateRelayState(Response $response, $relayState) { if ($response->getRelayState() != null && $response->getRelayState() != $relayState) { throw new SamlException('urn:oasis:names:tc:SAML:2.0:status:RequestDenied'); } }
[ "public", "function", "validateRelayState", "(", "Response", "$", "response", ",", "$", "relayState", ")", "{", "if", "(", "$", "response", "->", "getRelayState", "(", ")", "!=", "null", "&&", "$", "response", "->", "getRelayState", "(", ")", "!=", "$", ...
Validate IdP Response RelayState @param Response $response @param string $relayState @throws SamlException
[ "Validate", "IdP", "Response", "RelayState" ]
003db4187fbba0c0b7bd7a1c53d8487da06748bd
https://github.com/flash-global/connect-client/blob/003db4187fbba0c0b7bd7a1c53d8487da06748bd/src/Saml.php#L422-L427
29,994
flash-global/connect-client
src/Saml.php
Saml.validateNameId
public function validateNameId(LogoutRequest $request, User $user) { if ($request->getNameID()->getValue() != $user->getUserName()) { throw new SamlException('urn:oasis:names:tc:SAML:2.0:status:RequestDenied'); } }
php
public function validateNameId(LogoutRequest $request, User $user) { if ($request->getNameID()->getValue() != $user->getUserName()) { throw new SamlException('urn:oasis:names:tc:SAML:2.0:status:RequestDenied'); } }
[ "public", "function", "validateNameId", "(", "LogoutRequest", "$", "request", ",", "User", "$", "user", ")", "{", "if", "(", "$", "request", "->", "getNameID", "(", ")", "->", "getValue", "(", ")", "!=", "$", "user", "->", "getUserName", "(", ")", ")",...
Validate a LogoutRequest NameId @param LogoutRequest $request @param User $user @throws SamlException
[ "Validate", "a", "LogoutRequest", "NameId" ]
003db4187fbba0c0b7bd7a1c53d8487da06748bd
https://github.com/flash-global/connect-client/blob/003db4187fbba0c0b7bd7a1c53d8487da06748bd/src/Saml.php#L437-L442
29,995
flash-global/connect-client
src/Saml.php
Saml.validateResponse
public function validateResponse(Response $response, $relayState) { $this->validateIssuer($response); $this->validateDestination($response); if ($relayState) { $this->validateRelayState($response, $relayState); } $public = KeyHelper::createPublicKey( ...
php
public function validateResponse(Response $response, $relayState) { $this->validateIssuer($response); $this->validateDestination($response); if ($relayState) { $this->validateRelayState($response, $relayState); } $public = KeyHelper::createPublicKey( ...
[ "public", "function", "validateResponse", "(", "Response", "$", "response", ",", "$", "relayState", ")", "{", "$", "this", "->", "validateIssuer", "(", "$", "response", ")", ";", "$", "this", "->", "validateDestination", "(", "$", "response", ")", ";", "if...
Validate a IdP Response @param Response $response @param $relayState
[ "Validate", "a", "IdP", "Response" ]
003db4187fbba0c0b7bd7a1c53d8487da06748bd
https://github.com/flash-global/connect-client/blob/003db4187fbba0c0b7bd7a1c53d8487da06748bd/src/Saml.php#L450-L482
29,996
flash-global/connect-client
src/Saml.php
Saml.validateLogoutRequest
public function validateLogoutRequest(LogoutRequest $request, User $user) { $this->validateIssuer($request); $this->validateNameId($request, $user); if ($this->hasSignature($request)) { $this->validateSignature( $request, KeyHelper::createPublicKe...
php
public function validateLogoutRequest(LogoutRequest $request, User $user) { $this->validateIssuer($request); $this->validateNameId($request, $user); if ($this->hasSignature($request)) { $this->validateSignature( $request, KeyHelper::createPublicKe...
[ "public", "function", "validateLogoutRequest", "(", "LogoutRequest", "$", "request", ",", "User", "$", "user", ")", "{", "$", "this", "->", "validateIssuer", "(", "$", "request", ")", ";", "$", "this", "->", "validateNameId", "(", "$", "request", ",", "$",...
Validate a LogoutRequest @param LogoutRequest $request @param User $user
[ "Validate", "a", "LogoutRequest" ]
003db4187fbba0c0b7bd7a1c53d8487da06748bd
https://github.com/flash-global/connect-client/blob/003db4187fbba0c0b7bd7a1c53d8487da06748bd/src/Saml.php#L490-L505
29,997
flash-global/connect-client
src/Saml.php
Saml.validateLogoutResponse
public function validateLogoutResponse(LogoutResponse $response) { $this->validateIssuer($response); if ($this->hasSignature($response)) { $this->validateSignature( $response, KeyHelper::createPublicKey( $this->getMetadata()->getFirstI...
php
public function validateLogoutResponse(LogoutResponse $response) { $this->validateIssuer($response); if ($this->hasSignature($response)) { $this->validateSignature( $response, KeyHelper::createPublicKey( $this->getMetadata()->getFirstI...
[ "public", "function", "validateLogoutResponse", "(", "LogoutResponse", "$", "response", ")", "{", "$", "this", "->", "validateIssuer", "(", "$", "response", ")", ";", "if", "(", "$", "this", "->", "hasSignature", "(", "$", "response", ")", ")", "{", "$", ...
Validate a LogoutResponse @param LogoutResponse $response
[ "Validate", "a", "LogoutResponse" ]
003db4187fbba0c0b7bd7a1c53d8487da06748bd
https://github.com/flash-global/connect-client/blob/003db4187fbba0c0b7bd7a1c53d8487da06748bd/src/Saml.php#L512-L526
29,998
flash-global/connect-client
src/Saml.php
Saml.retrieveUserFromAssertion
public function retrieveUserFromAssertion(Assertion $assertion) { $user = null; $role = null; foreach ($assertion->getAllAttributeStatements() as $attributeStatement) { foreach ($attributeStatement->getAllAttributes() as $attribute) { switch ($attribute->getName(...
php
public function retrieveUserFromAssertion(Assertion $assertion) { $user = null; $role = null; foreach ($assertion->getAllAttributeStatements() as $attributeStatement) { foreach ($attributeStatement->getAllAttributes() as $attribute) { switch ($attribute->getName(...
[ "public", "function", "retrieveUserFromAssertion", "(", "Assertion", "$", "assertion", ")", "{", "$", "user", "=", "null", ";", "$", "role", "=", "null", ";", "foreach", "(", "$", "assertion", "->", "getAllAttributeStatements", "(", ")", "as", "$", "attribut...
Retrieves a User instance from Response Assertion send by IdP @param Assertion $assertion @return User
[ "Retrieves", "a", "User", "instance", "from", "Response", "Assertion", "send", "by", "IdP" ]
003db4187fbba0c0b7bd7a1c53d8487da06748bd
https://github.com/flash-global/connect-client/blob/003db4187fbba0c0b7bd7a1c53d8487da06748bd/src/Saml.php#L535-L557
29,999
flash-global/connect-client
src/Saml.php
Saml.receiveMessage
protected function receiveMessage() { if (empty($_POST)) { $_POST = $this->retrievePostWithInputStream(); } $request = Request::createFromGlobals(); try { $binding = (new BindingFactory())->getBindingByRequest($request); } catch (\Exception $e) { ...
php
protected function receiveMessage() { if (empty($_POST)) { $_POST = $this->retrievePostWithInputStream(); } $request = Request::createFromGlobals(); try { $binding = (new BindingFactory())->getBindingByRequest($request); } catch (\Exception $e) { ...
[ "protected", "function", "receiveMessage", "(", ")", "{", "if", "(", "empty", "(", "$", "_POST", ")", ")", "{", "$", "_POST", "=", "$", "this", "->", "retrievePostWithInputStream", "(", ")", ";", "}", "$", "request", "=", "Request", "::", "createFromGlob...
Receive Saml message from globals variables @return MessageContext
[ "Receive", "Saml", "message", "from", "globals", "variables" ]
003db4187fbba0c0b7bd7a1c53d8487da06748bd
https://github.com/flash-global/connect-client/blob/003db4187fbba0c0b7bd7a1c53d8487da06748bd/src/Saml.php#L564-L582