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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
16,100 | markdegrootnl/omnipay-ideal | src/Message/AbstractRequest.php | AbstractRequest.generateDigest | public function generateDigest(DOMDocument $xml)
{
$xml = $xml->cloneNode(true);
// strip Signature
foreach ($this->getXPath($xml)->query('ds:Signature') as $node) {
$node->parentNode->removeChild($node);
}
$message = $this->c14n($xml);
return base64_en... | php | public function generateDigest(DOMDocument $xml)
{
$xml = $xml->cloneNode(true);
// strip Signature
foreach ($this->getXPath($xml)->query('ds:Signature') as $node) {
$node->parentNode->removeChild($node);
}
$message = $this->c14n($xml);
return base64_en... | [
"public",
"function",
"generateDigest",
"(",
"DOMDocument",
"$",
"xml",
")",
"{",
"$",
"xml",
"=",
"$",
"xml",
"->",
"cloneNode",
"(",
"true",
")",
";",
"// strip Signature",
"foreach",
"(",
"$",
"this",
"->",
"getXPath",
"(",
"$",
"xml",
")",
"->",
"q... | Generate sha256 digest of xml
@param DOMNode
@return string | [
"Generate",
"sha256",
"digest",
"of",
"xml"
] | 565e942c2d22dd160ce6101cc5743f131af54660 | https://github.com/markdegrootnl/omnipay-ideal/blob/565e942c2d22dd160ce6101cc5743f131af54660/src/Message/AbstractRequest.php#L186-L198 |
16,101 | markdegrootnl/omnipay-ideal | src/Message/AbstractRequest.php | AbstractRequest.generateSignature | public function generateSignature(DOMNode $xml)
{
$message = $this->c14n($xml);
$key = openssl_get_privatekey('file://'.$this->getPrivateKeyPath(), $this->getPrivateKeyPassphrase());
if ($key && openssl_sign($message, $signature, $key, OPENSSL_ALGO_SHA256)) {
openssl_free_key($k... | php | public function generateSignature(DOMNode $xml)
{
$message = $this->c14n($xml);
$key = openssl_get_privatekey('file://'.$this->getPrivateKeyPath(), $this->getPrivateKeyPassphrase());
if ($key && openssl_sign($message, $signature, $key, OPENSSL_ALGO_SHA256)) {
openssl_free_key($k... | [
"public",
"function",
"generateSignature",
"(",
"DOMNode",
"$",
"xml",
")",
"{",
"$",
"message",
"=",
"$",
"this",
"->",
"c14n",
"(",
"$",
"xml",
")",
";",
"$",
"key",
"=",
"openssl_get_privatekey",
"(",
"'file://'",
".",
"$",
"this",
"->",
"getPrivateKe... | Generate RSA signature of SignedInfo element
@param DOMNode
@return string | [
"Generate",
"RSA",
"signature",
"of",
"SignedInfo",
"element"
] | 565e942c2d22dd160ce6101cc5743f131af54660 | https://github.com/markdegrootnl/omnipay-ideal/blob/565e942c2d22dd160ce6101cc5743f131af54660/src/Message/AbstractRequest.php#L206-L223 |
16,102 | prooph/link-app-core | src/Service/AbstractQueryController.php | AbstractQueryController.getProcessingTypesForClient | protected function getProcessingTypesForClient(array $processingTypes = null)
{
if (is_null($processingTypes)) {
$processingTypes = $this->systemConfig->getAllAvailableProcessingTypes();
}
return array_map(function($processingTypeClass) { return $this->prepareProcessingType($pro... | php | protected function getProcessingTypesForClient(array $processingTypes = null)
{
if (is_null($processingTypes)) {
$processingTypes = $this->systemConfig->getAllAvailableProcessingTypes();
}
return array_map(function($processingTypeClass) { return $this->prepareProcessingType($pro... | [
"protected",
"function",
"getProcessingTypesForClient",
"(",
"array",
"$",
"processingTypes",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"processingTypes",
")",
")",
"{",
"$",
"processingTypes",
"=",
"$",
"this",
"->",
"systemConfig",
"->",
"getAll... | Loads available DataTypes from system config and converts some to cient format
If optional data type array is passed as argument, this is used instead of all available types
@param array|null $processingTypes
@return array | [
"Loads",
"available",
"DataTypes",
"from",
"system",
"config",
"and",
"converts",
"some",
"to",
"cient",
"format"
] | 835a5945dfa7be7b2cebfa6e84e757ecfd783357 | https://github.com/prooph/link-app-core/blob/835a5945dfa7be7b2cebfa6e84e757ecfd783357/src/Service/AbstractQueryController.php#L49-L56 |
16,103 | crossjoin/Css | src/Crossjoin/Css/Reader/ReaderAbstract.php | ReaderAbstract.getPreparedCssContent | protected function getPreparedCssContent()
{
if ($this->preparedContent === null) {
$this->preparedContent = Placeholder::replaceStringsAndComments($this->getCssContent());
// Move comments from the end of the line to the beginning to make it easier to
// detect, to whic... | php | protected function getPreparedCssContent()
{
if ($this->preparedContent === null) {
$this->preparedContent = Placeholder::replaceStringsAndComments($this->getCssContent());
// Move comments from the end of the line to the beginning to make it easier to
// detect, to whic... | [
"protected",
"function",
"getPreparedCssContent",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"preparedContent",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"preparedContent",
"=",
"Placeholder",
"::",
"replaceStringsAndComments",
"(",
"$",
"this",
"->",
"get... | Gets a prepared version of the CSS content for parsing.
@return string | [
"Gets",
"a",
"prepared",
"version",
"of",
"the",
"CSS",
"content",
"for",
"parsing",
"."
] | 7b50ca94c4bdad60d01cfa327f00b7a600d6f9f3 | https://github.com/crossjoin/Css/blob/7b50ca94c4bdad60d01cfa327f00b7a600d6f9f3/src/Crossjoin/Css/Reader/ReaderAbstract.php#L72-L98 |
16,104 | crossjoin/Css | src/Crossjoin/Css/Reader/ReaderAbstract.php | ReaderAbstract.getCssResource | protected function getCssResource()
{
$handle = fopen("php://memory", "rw");
fputs($handle, $this->getPreparedCssContent());
rewind($handle);
return $handle;
} | php | protected function getCssResource()
{
$handle = fopen("php://memory", "rw");
fputs($handle, $this->getPreparedCssContent());
rewind($handle);
return $handle;
} | [
"protected",
"function",
"getCssResource",
"(",
")",
"{",
"$",
"handle",
"=",
"fopen",
"(",
"\"php://memory\"",
",",
"\"rw\"",
")",
";",
"fputs",
"(",
"$",
"handle",
",",
"$",
"this",
"->",
"getPreparedCssContent",
"(",
")",
")",
";",
"rewind",
"(",
"$",... | Gets the CSS content as resource.
@return resource | [
"Gets",
"the",
"CSS",
"content",
"as",
"resource",
"."
] | 7b50ca94c4bdad60d01cfa327f00b7a600d6f9f3 | https://github.com/crossjoin/Css/blob/7b50ca94c4bdad60d01cfa327f00b7a600d6f9f3/src/Crossjoin/Css/Reader/ReaderAbstract.php#L105-L112 |
16,105 | comodojo/dispatcher.framework | src/Comodojo/Dispatcher/Router/Route.php | Route.serialize | public function serialize() {
return serialize( (object) [
'classname' => $this->classname,
'type' => $this->type,
'service' => $this->service,
'parameters' => $this->parameters,
'request' => $this->request,
'query' => $this->query
... | php | public function serialize() {
return serialize( (object) [
'classname' => $this->classname,
'type' => $this->type,
'service' => $this->service,
'parameters' => $this->parameters,
'request' => $this->request,
'query' => $this->query
... | [
"public",
"function",
"serialize",
"(",
")",
"{",
"return",
"serialize",
"(",
"(",
"object",
")",
"[",
"'classname'",
"=>",
"$",
"this",
"->",
"classname",
",",
"'type'",
"=>",
"$",
"this",
"->",
"type",
",",
"'service'",
"=>",
"$",
"this",
"->",
"serv... | Return the serialized data
@return string | [
"Return",
"the",
"serialized",
"data"
] | 5093297dcb7441a8d8f79cbb2429c93232e16d1c | https://github.com/comodojo/dispatcher.framework/blob/5093297dcb7441a8d8f79cbb2429c93232e16d1c/src/Comodojo/Dispatcher/Router/Route.php#L387-L398 |
16,106 | comodojo/dispatcher.framework | src/Comodojo/Dispatcher/Router/Route.php | Route.unserialize | public function unserialize($data) {
$parts = unserialize($data);
$this->classname = $parts->classname;
$this->type = $parts->type;
$this->service = $parts->service;
$this->parameters = $parts->parameters;
$this->request = $parts->request;
$this->query = $parts-... | php | public function unserialize($data) {
$parts = unserialize($data);
$this->classname = $parts->classname;
$this->type = $parts->type;
$this->service = $parts->service;
$this->parameters = $parts->parameters;
$this->request = $parts->request;
$this->query = $parts-... | [
"public",
"function",
"unserialize",
"(",
"$",
"data",
")",
"{",
"$",
"parts",
"=",
"unserialize",
"(",
"$",
"data",
")",
";",
"$",
"this",
"->",
"classname",
"=",
"$",
"parts",
"->",
"classname",
";",
"$",
"this",
"->",
"type",
"=",
"$",
"parts",
... | Return the unserialized object
@param string $data Serialized data | [
"Return",
"the",
"unserialized",
"object"
] | 5093297dcb7441a8d8f79cbb2429c93232e16d1c | https://github.com/comodojo/dispatcher.framework/blob/5093297dcb7441a8d8f79cbb2429c93232e16d1c/src/Comodojo/Dispatcher/Router/Route.php#L406-L417 |
16,107 | jpuck/color-mixer | src/CanonicalNames.php | CanonicalNames.hex | public static function hex(string $name = null)
{
if ( empty($name) ) {
return static::$hexmap;
}
return static::$hexmap[$name] ?? false;
} | php | public static function hex(string $name = null)
{
if ( empty($name) ) {
return static::$hexmap;
}
return static::$hexmap[$name] ?? false;
} | [
"public",
"static",
"function",
"hex",
"(",
"string",
"$",
"name",
"=",
"null",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"name",
")",
")",
"{",
"return",
"static",
"::",
"$",
"hexmap",
";",
"}",
"return",
"static",
"::",
"$",
"hexmap",
"[",
"$",
"... | Returns the hexadecimal CSS color given the canonical name.
@param string Optional canonical color name.
@return mixed Default returns array of all canonical keys and hex values.
Given a name, returns string hexadecimal color or false if color
does not exist. | [
"Returns",
"the",
"hexadecimal",
"CSS",
"color",
"given",
"the",
"canonical",
"name",
"."
] | cea01c3082a921a35e00ae0a287c795d9fd73ada | https://github.com/jpuck/color-mixer/blob/cea01c3082a921a35e00ae0a287c795d9fd73ada/src/CanonicalNames.php#L165-L172 |
16,108 | constant-null/backstubber | src/FileGenerator.php | FileGenerator.generate | public function generate($outputPath)
{
// do content replacement
$this->process();
// check if directory exist, if not create it
$baseDir = dirname($outputPath);
if (!is_dir($baseDir)) {
mkdir($baseDir, 700, true);
}
return (bool)file_put_conten... | php | public function generate($outputPath)
{
// do content replacement
$this->process();
// check if directory exist, if not create it
$baseDir = dirname($outputPath);
if (!is_dir($baseDir)) {
mkdir($baseDir, 700, true);
}
return (bool)file_put_conten... | [
"public",
"function",
"generate",
"(",
"$",
"outputPath",
")",
"{",
"// do content replacement",
"$",
"this",
"->",
"process",
"(",
")",
";",
"// check if directory exist, if not create it",
"$",
"baseDir",
"=",
"dirname",
"(",
"$",
"outputPath",
")",
";",
"if",
... | save generated file to path
returns true if file was successfully created false otherwise
@param $outputPath string
@return bool | [
"save",
"generated",
"file",
"to",
"path",
"returns",
"true",
"if",
"file",
"was",
"successfully",
"created",
"false",
"otherwise"
] | 1e7ee66091bae4e6b709642467609a8566dae479 | https://github.com/constant-null/backstubber/blob/1e7ee66091bae4e6b709642467609a8566dae479/src/FileGenerator.php#L100-L112 |
16,109 | constant-null/backstubber | src/FileGenerator.php | FileGenerator.formatValue | protected function formatValue($value)
{
if (is_array($value)) {
return Formatter::formatArray($value);
}
return Formatter::formatScalar($value);
} | php | protected function formatValue($value)
{
if (is_array($value)) {
return Formatter::formatArray($value);
}
return Formatter::formatScalar($value);
} | [
"protected",
"function",
"formatValue",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"value",
")",
")",
"{",
"return",
"Formatter",
"::",
"formatArray",
"(",
"$",
"value",
")",
";",
"}",
"return",
"Formatter",
"::",
"formatScalar",
"(",
... | Format a value before processing.
@param array|string $value
@return array|string | [
"Format",
"a",
"value",
"before",
"processing",
"."
] | 1e7ee66091bae4e6b709642467609a8566dae479 | https://github.com/constant-null/backstubber/blob/1e7ee66091bae4e6b709642467609a8566dae479/src/FileGenerator.php#L120-L127 |
16,110 | stubbles/stubbles-webapp-core | src/main/php/UriPath.php | UriPath.hasArgument | public function hasArgument(string $name): bool
{
$this->parsePathArguments();
return isset($this->arguments[$name]);
} | php | public function hasArgument(string $name): bool
{
$this->parsePathArguments();
return isset($this->arguments[$name]);
} | [
"public",
"function",
"hasArgument",
"(",
"string",
"$",
"name",
")",
":",
"bool",
"{",
"$",
"this",
"->",
"parsePathArguments",
"(",
")",
";",
"return",
"isset",
"(",
"$",
"this",
"->",
"arguments",
"[",
"$",
"name",
"]",
")",
";",
"}"
] | checks if path contains argument with given name
@param string $name
@return bool | [
"checks",
"if",
"path",
"contains",
"argument",
"with",
"given",
"name"
] | 7705f129011a81d5cc3c76b4b150fab3dadac6a3 | https://github.com/stubbles/stubbles-webapp-core/blob/7705f129011a81d5cc3c76b4b150fab3dadac6a3/src/main/php/UriPath.php#L99-L103 |
16,111 | stubbles/stubbles-webapp-core | src/main/php/UriPath.php | UriPath.readArgument | public function readArgument(string $name): ValueReader
{
$this->parsePathArguments();
if (isset($this->arguments[$name])) {
return ValueReader::forValue($this->arguments[$name]);
}
return ValueReader::forValue(null);
} | php | public function readArgument(string $name): ValueReader
{
$this->parsePathArguments();
if (isset($this->arguments[$name])) {
return ValueReader::forValue($this->arguments[$name]);
}
return ValueReader::forValue(null);
} | [
"public",
"function",
"readArgument",
"(",
"string",
"$",
"name",
")",
":",
"ValueReader",
"{",
"$",
"this",
"->",
"parsePathArguments",
"(",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"arguments",
"[",
"$",
"name",
"]",
")",
")",
"{",
"re... | returns argument with given name or default if not set
@param string $name
@return \stubbles\input\ValueReader
@since 3.3.0 | [
"returns",
"argument",
"with",
"given",
"name",
"or",
"default",
"if",
"not",
"set"
] | 7705f129011a81d5cc3c76b4b150fab3dadac6a3 | https://github.com/stubbles/stubbles-webapp-core/blob/7705f129011a81d5cc3c76b4b150fab3dadac6a3/src/main/php/UriPath.php#L112-L120 |
16,112 | stubbles/stubbles-webapp-core | src/main/php/UriPath.php | UriPath.parsePathArguments | private function parsePathArguments()
{
if (null !== $this->arguments) {
return;
}
$arguments = [];
preg_match('/^' . self::pattern($this->configuredPath) . '/', $this->calledPath, $arguments);
array_shift($arguments);
$names = [];
$thi... | php | private function parsePathArguments()
{
if (null !== $this->arguments) {
return;
}
$arguments = [];
preg_match('/^' . self::pattern($this->configuredPath) . '/', $this->calledPath, $arguments);
array_shift($arguments);
$names = [];
$thi... | [
"private",
"function",
"parsePathArguments",
"(",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"this",
"->",
"arguments",
")",
"{",
"return",
";",
"}",
"$",
"arguments",
"=",
"[",
"]",
";",
"preg_match",
"(",
"'/^'",
".",
"self",
"::",
"pattern",
"(",
"$... | parses path arguments from called path | [
"parses",
"path",
"arguments",
"from",
"called",
"path"
] | 7705f129011a81d5cc3c76b4b150fab3dadac6a3 | https://github.com/stubbles/stubbles-webapp-core/blob/7705f129011a81d5cc3c76b4b150fab3dadac6a3/src/main/php/UriPath.php#L125-L142 |
16,113 | stubbles/stubbles-webapp-core | src/main/php/UriPath.php | UriPath.remaining | public function remaining(string $default = null)
{
$matches = [];
preg_match('/(' . self::pattern($this->configuredPath) . ')([^?]*)?/', $this->calledPath, $matches);
$last = count($matches) - 1;
if (2 > $last) {
return $default;
}
if (isset($ma... | php | public function remaining(string $default = null)
{
$matches = [];
preg_match('/(' . self::pattern($this->configuredPath) . ')([^?]*)?/', $this->calledPath, $matches);
$last = count($matches) - 1;
if (2 > $last) {
return $default;
}
if (isset($ma... | [
"public",
"function",
"remaining",
"(",
"string",
"$",
"default",
"=",
"null",
")",
"{",
"$",
"matches",
"=",
"[",
"]",
";",
"preg_match",
"(",
"'/('",
".",
"self",
"::",
"pattern",
"(",
"$",
"this",
"->",
"configuredPath",
")",
".",
"')([^?]*)?/'",
",... | returns remaining path that was not matched by original path
@param string $default
@return string | [
"returns",
"remaining",
"path",
"that",
"was",
"not",
"matched",
"by",
"original",
"path"
] | 7705f129011a81d5cc3c76b4b150fab3dadac6a3 | https://github.com/stubbles/stubbles-webapp-core/blob/7705f129011a81d5cc3c76b4b150fab3dadac6a3/src/main/php/UriPath.php#L150-L164 |
16,114 | kingsquare/communibase-connector-php | src/Communibase/Connector.php | Connector.getTemplate | public function getTemplate($entityType)
{
$params = [
'fields' => 'attributes.title',
'limit' => 1,
];
$definition = $this->search('EntityType', ['title' => $entityType], $params);
return array_fill_keys(array_merge(['_id'], array_column($definition[0]['attr... | php | public function getTemplate($entityType)
{
$params = [
'fields' => 'attributes.title',
'limit' => 1,
];
$definition = $this->search('EntityType', ['title' => $entityType], $params);
return array_fill_keys(array_merge(['_id'], array_column($definition[0]['attr... | [
"public",
"function",
"getTemplate",
"(",
"$",
"entityType",
")",
"{",
"$",
"params",
"=",
"[",
"'fields'",
"=>",
"'attributes.title'",
",",
"'limit'",
"=>",
"1",
",",
"]",
";",
"$",
"definition",
"=",
"$",
"this",
"->",
"search",
"(",
"'EntityType'",
",... | Returns an array that has all the fields according to the definition in Communibase.
@param string $entityType
@return array
@throws Exception | [
"Returns",
"an",
"array",
"that",
"has",
"all",
"the",
"fields",
"according",
"to",
"the",
"definition",
"in",
"Communibase",
"."
] | f1f9699e1a8acf066fab308f1e86cb8b5548e2db | https://github.com/kingsquare/communibase-connector-php/blob/f1f9699e1a8acf066fab308f1e86cb8b5548e2db/src/Communibase/Connector.php#L88-L97 |
16,115 | kingsquare/communibase-connector-php | src/Communibase/Connector.php | Connector.getById | public function getById($entityType, $id, array $params = [], $version = null)
{
if (empty($id)) {
throw new Exception('Id is empty');
}
if (!static::isIdValid($id)) {
throw new Exception('Id is invalid, please use a correctly formatted id');
}
retur... | php | public function getById($entityType, $id, array $params = [], $version = null)
{
if (empty($id)) {
throw new Exception('Id is empty');
}
if (!static::isIdValid($id)) {
throw new Exception('Id is invalid, please use a correctly formatted id');
}
retur... | [
"public",
"function",
"getById",
"(",
"$",
"entityType",
",",
"$",
"id",
",",
"array",
"$",
"params",
"=",
"[",
"]",
",",
"$",
"version",
"=",
"null",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"id",
")",
")",
"{",
"throw",
"new",
"Exception",
"(",
... | Get a single Entity by its id
@param string $entityType
@param string $id
@param array $params (optional)
@param string|null $version
@return array entity
@throws Exception | [
"Get",
"a",
"single",
"Entity",
"by",
"its",
"id"
] | f1f9699e1a8acf066fab308f1e86cb8b5548e2db | https://github.com/kingsquare/communibase-connector-php/blob/f1f9699e1a8acf066fab308f1e86cb8b5548e2db/src/Communibase/Connector.php#L111-L124 |
16,116 | kingsquare/communibase-connector-php | src/Communibase/Connector.php | Connector.getByRef | public function getByRef(array $ref, array $parentEntity = [])
{
$document = $parentEntity;
if (strpos($ref['rootDocumentEntityType'], 'parent') === false) {
if (empty($document['_id']) || $document['_id'] !== $ref['rootDocumentId']) {
$document = $this->getById($ref['roo... | php | public function getByRef(array $ref, array $parentEntity = [])
{
$document = $parentEntity;
if (strpos($ref['rootDocumentEntityType'], 'parent') === false) {
if (empty($document['_id']) || $document['_id'] !== $ref['rootDocumentId']) {
$document = $this->getById($ref['roo... | [
"public",
"function",
"getByRef",
"(",
"array",
"$",
"ref",
",",
"array",
"$",
"parentEntity",
"=",
"[",
"]",
")",
"{",
"$",
"document",
"=",
"$",
"parentEntity",
";",
"if",
"(",
"strpos",
"(",
"$",
"ref",
"[",
"'rootDocumentEntityType'",
"]",
",",
"'p... | Get a single Entity by a ref-string
@todo if the ref is a parent.parent.parent the code would need further improvement.
@param array $ref
@param array $parentEntity (optional)
@return array the referred Entity data
@throws Exception | [
"Get",
"a",
"single",
"Entity",
"by",
"a",
"ref",
"-",
"string"
] | f1f9699e1a8acf066fab308f1e86cb8b5548e2db | https://github.com/kingsquare/communibase-connector-php/blob/f1f9699e1a8acf066fab308f1e86cb8b5548e2db/src/Communibase/Connector.php#L138-L173 |
16,117 | kingsquare/communibase-connector-php | src/Communibase/Connector.php | Connector.getByIds | public function getByIds($entityType, array $ids, array $params = [])
{
$validIds = array_values(array_unique(array_filter($ids, [__CLASS__, 'isIdValid'])));
if (count($validIds) === 0) {
return [];
}
$doSortByIds = empty($params['sort']);
$results = $this->sear... | php | public function getByIds($entityType, array $ids, array $params = [])
{
$validIds = array_values(array_unique(array_filter($ids, [__CLASS__, 'isIdValid'])));
if (count($validIds) === 0) {
return [];
}
$doSortByIds = empty($params['sort']);
$results = $this->sear... | [
"public",
"function",
"getByIds",
"(",
"$",
"entityType",
",",
"array",
"$",
"ids",
",",
"array",
"$",
"params",
"=",
"[",
"]",
")",
"{",
"$",
"validIds",
"=",
"array_values",
"(",
"array_unique",
"(",
"array_filter",
"(",
"$",
"ids",
",",
"[",
"__CLAS... | Get an array of entities by their ids
@param string $entityType
@param array $ids
@param array $params (optional)
@return array entities
@throws Exception | [
"Get",
"an",
"array",
"of",
"entities",
"by",
"their",
"ids"
] | f1f9699e1a8acf066fab308f1e86cb8b5548e2db | https://github.com/kingsquare/communibase-connector-php/blob/f1f9699e1a8acf066fab308f1e86cb8b5548e2db/src/Communibase/Connector.php#L186-L208 |
16,118 | kingsquare/communibase-connector-php | src/Communibase/Connector.php | Connector.getIds | public function getIds($entityType, array $selector = [], array $params = [])
{
$params['fields'] = '_id';
return array_column($this->search($entityType, $selector, $params), '_id');
} | php | public function getIds($entityType, array $selector = [], array $params = [])
{
$params['fields'] = '_id';
return array_column($this->search($entityType, $selector, $params), '_id');
} | [
"public",
"function",
"getIds",
"(",
"$",
"entityType",
",",
"array",
"$",
"selector",
"=",
"[",
"]",
",",
"array",
"$",
"params",
"=",
"[",
"]",
")",
"{",
"$",
"params",
"[",
"'fields'",
"]",
"=",
"'_id'",
";",
"return",
"array_column",
"(",
"$",
... | Get result entityIds of a certain search
@param string $entityType
@param array $selector (optional)
@param array $params (optional)
@return array
@throws Exception | [
"Get",
"result",
"entityIds",
"of",
"a",
"certain",
"search"
] | f1f9699e1a8acf066fab308f1e86cb8b5548e2db | https://github.com/kingsquare/communibase-connector-php/blob/f1f9699e1a8acf066fab308f1e86cb8b5548e2db/src/Communibase/Connector.php#L236-L241 |
16,119 | kingsquare/communibase-connector-php | src/Communibase/Connector.php | Connector.getId | public function getId($entityType, array $selector = [])
{
$params = ['limit' => 1];
$ids = (array)$this->getIds($entityType, $selector, $params);
return array_shift($ids);
} | php | public function getId($entityType, array $selector = [])
{
$params = ['limit' => 1];
$ids = (array)$this->getIds($entityType, $selector, $params);
return array_shift($ids);
} | [
"public",
"function",
"getId",
"(",
"$",
"entityType",
",",
"array",
"$",
"selector",
"=",
"[",
"]",
")",
"{",
"$",
"params",
"=",
"[",
"'limit'",
"=>",
"1",
"]",
";",
"$",
"ids",
"=",
"(",
"array",
")",
"$",
"this",
"->",
"getIds",
"(",
"$",
"... | Get the id of an entity based on a search
@param string $entityType i.e. Person
@param array $selector (optional) i.e. ['firstName' => 'Henk']
@return array resultData
@throws Exception | [
"Get",
"the",
"id",
"of",
"an",
"entity",
"based",
"on",
"a",
"search"
] | f1f9699e1a8acf066fab308f1e86cb8b5548e2db | https://github.com/kingsquare/communibase-connector-php/blob/f1f9699e1a8acf066fab308f1e86cb8b5548e2db/src/Communibase/Connector.php#L253-L259 |
16,120 | kingsquare/communibase-connector-php | src/Communibase/Connector.php | Connector.update | public function update($entityType, array $properties)
{
if (empty($properties['_id'])) {
return $this->doPost($entityType . '.json/crud/', [], $properties);
}
return $this->doPut($entityType . '.json/crud/' . $properties['_id'], [], $properties);
} | php | public function update($entityType, array $properties)
{
if (empty($properties['_id'])) {
return $this->doPost($entityType . '.json/crud/', [], $properties);
}
return $this->doPut($entityType . '.json/crud/' . $properties['_id'], [], $properties);
} | [
"public",
"function",
"update",
"(",
"$",
"entityType",
",",
"array",
"$",
"properties",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"properties",
"[",
"'_id'",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"doPost",
"(",
"$",
"entityType",
".",
"'.js... | This will save an entity in Communibase. When a _id-field is found, this entity will be updated
NOTE: When updating, depending on the Entity, you may need to include all fields.
@param string $entityType
@param array $properties - the to-be-saved entity data
@return array resultData
@throws Exception | [
"This",
"will",
"save",
"an",
"entity",
"in",
"Communibase",
".",
"When",
"a",
"_id",
"-",
"field",
"is",
"found",
"this",
"entity",
"will",
"be",
"updated"
] | f1f9699e1a8acf066fab308f1e86cb8b5548e2db | https://github.com/kingsquare/communibase-connector-php/blob/f1f9699e1a8acf066fab308f1e86cb8b5548e2db/src/Communibase/Connector.php#L336-L342 |
16,121 | kingsquare/communibase-connector-php | src/Communibase/Connector.php | Connector.finalize | public function finalize($entityType, $id)
{
if ($entityType !== 'Invoice') {
throw new Exception('Cannot call finalize on ' . $entityType);
}
return $this->doPost($entityType . '.json/finalize/' . $id);
} | php | public function finalize($entityType, $id)
{
if ($entityType !== 'Invoice') {
throw new Exception('Cannot call finalize on ' . $entityType);
}
return $this->doPost($entityType . '.json/finalize/' . $id);
} | [
"public",
"function",
"finalize",
"(",
"$",
"entityType",
",",
"$",
"id",
")",
"{",
"if",
"(",
"$",
"entityType",
"!==",
"'Invoice'",
")",
"{",
"throw",
"new",
"Exception",
"(",
"'Cannot call finalize on '",
".",
"$",
"entityType",
")",
";",
"}",
"return",... | Finalize an invoice by adding an invoiceNumber to it.
Besides, invoice items will receive a 'generalLedgerAccountNumber'.
This number will be unique and sequential within the 'daybook' of the invoice.
NOTE: this is Invoice specific
@param string $entityType
@param string $id
@return array
@throws Exception | [
"Finalize",
"an",
"invoice",
"by",
"adding",
"an",
"invoiceNumber",
"to",
"it",
".",
"Besides",
"invoice",
"items",
"will",
"receive",
"a",
"generalLedgerAccountNumber",
".",
"This",
"number",
"will",
"be",
"unique",
"and",
"sequential",
"within",
"the",
"dayboo... | f1f9699e1a8acf066fab308f1e86cb8b5548e2db | https://github.com/kingsquare/communibase-connector-php/blob/f1f9699e1a8acf066fab308f1e86cb8b5548e2db/src/Communibase/Connector.php#L358-L365 |
16,122 | kingsquare/communibase-connector-php | src/Communibase/Connector.php | Connector.doGet | protected function doGet($path, array $params = null, array $data = null)
{
return $this->getResult('GET', $path, $params, $data);
} | php | protected function doGet($path, array $params = null, array $data = null)
{
return $this->getResult('GET', $path, $params, $data);
} | [
"protected",
"function",
"doGet",
"(",
"$",
"path",
",",
"array",
"$",
"params",
"=",
"null",
",",
"array",
"$",
"data",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"getResult",
"(",
"'GET'",
",",
"$",
"path",
",",
"$",
"params",
",",
"$",
... | Perform the actual GET
@param string $path
@param array $params
@param array $data
@return array
@throws Exception | [
"Perform",
"the",
"actual",
"GET"
] | f1f9699e1a8acf066fab308f1e86cb8b5548e2db | https://github.com/kingsquare/communibase-connector-php/blob/f1f9699e1a8acf066fab308f1e86cb8b5548e2db/src/Communibase/Connector.php#L462-L465 |
16,123 | kingsquare/communibase-connector-php | src/Communibase/Connector.php | Connector.doPost | protected function doPost($path, array $params = null, array $data = null)
{
return $this->getResult('POST', $path, $params, $data);
} | php | protected function doPost($path, array $params = null, array $data = null)
{
return $this->getResult('POST', $path, $params, $data);
} | [
"protected",
"function",
"doPost",
"(",
"$",
"path",
",",
"array",
"$",
"params",
"=",
"null",
",",
"array",
"$",
"data",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"getResult",
"(",
"'POST'",
",",
"$",
"path",
",",
"$",
"params",
",",
"$"... | Perform the actual POST
@param string $path
@param array $params
@param array $data
@return array
@throws Exception | [
"Perform",
"the",
"actual",
"POST"
] | f1f9699e1a8acf066fab308f1e86cb8b5548e2db | https://github.com/kingsquare/communibase-connector-php/blob/f1f9699e1a8acf066fab308f1e86cb8b5548e2db/src/Communibase/Connector.php#L478-L481 |
16,124 | kingsquare/communibase-connector-php | src/Communibase/Connector.php | Connector.doPut | protected function doPut($path, array $params = null, array $data = null)
{
return $this->getResult('PUT', $path, $params, $data);
} | php | protected function doPut($path, array $params = null, array $data = null)
{
return $this->getResult('PUT', $path, $params, $data);
} | [
"protected",
"function",
"doPut",
"(",
"$",
"path",
",",
"array",
"$",
"params",
"=",
"null",
",",
"array",
"$",
"data",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"getResult",
"(",
"'PUT'",
",",
"$",
"path",
",",
"$",
"params",
",",
"$",
... | Perform the actual PUT
@param string $path
@param array $params
@param array $data
@return array
@throws Exception | [
"Perform",
"the",
"actual",
"PUT"
] | f1f9699e1a8acf066fab308f1e86cb8b5548e2db | https://github.com/kingsquare/communibase-connector-php/blob/f1f9699e1a8acf066fab308f1e86cb8b5548e2db/src/Communibase/Connector.php#L494-L497 |
16,125 | kingsquare/communibase-connector-php | src/Communibase/Connector.php | Connector.doDelete | protected function doDelete($path, array $params = null, array $data = null)
{
return $this->getResult('DELETE', $path, $params, $data);
} | php | protected function doDelete($path, array $params = null, array $data = null)
{
return $this->getResult('DELETE', $path, $params, $data);
} | [
"protected",
"function",
"doDelete",
"(",
"$",
"path",
",",
"array",
"$",
"params",
"=",
"null",
",",
"array",
"$",
"data",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"getResult",
"(",
"'DELETE'",
",",
"$",
"path",
",",
"$",
"params",
",",
... | Perform the actual DELETE
@param string $path
@param array $params
@param array $data
@return array
@throws Exception | [
"Perform",
"the",
"actual",
"DELETE"
] | f1f9699e1a8acf066fab308f1e86cb8b5548e2db | https://github.com/kingsquare/communibase-connector-php/blob/f1f9699e1a8acf066fab308f1e86cb8b5548e2db/src/Communibase/Connector.php#L510-L513 |
16,126 | kingsquare/communibase-connector-php | src/Communibase/Connector.php | Connector.parseResult | private function parseResult($response, $httpCode)
{
$result = json_decode($response, true);
if (is_array($result)) {
return $result;
}
throw new Exception('"' . $this->getLastJsonError() . '" in ' . $response, $httpCode);
} | php | private function parseResult($response, $httpCode)
{
$result = json_decode($response, true);
if (is_array($result)) {
return $result;
}
throw new Exception('"' . $this->getLastJsonError() . '" in ' . $response, $httpCode);
} | [
"private",
"function",
"parseResult",
"(",
"$",
"response",
",",
"$",
"httpCode",
")",
"{",
"$",
"result",
"=",
"json_decode",
"(",
"$",
"response",
",",
"true",
")",
";",
"if",
"(",
"is_array",
"(",
"$",
"result",
")",
")",
"{",
"return",
"$",
"resu... | Parse the Communibase result and if necessary throw an exception
@param string $response
@param int $httpCode
@return array
@throws Exception | [
"Parse",
"the",
"Communibase",
"result",
"and",
"if",
"necessary",
"throw",
"an",
"exception"
] | f1f9699e1a8acf066fab308f1e86cb8b5548e2db | https://github.com/kingsquare/communibase-connector-php/blob/f1f9699e1a8acf066fab308f1e86cb8b5548e2db/src/Communibase/Connector.php#L597-L606 |
16,127 | kingsquare/communibase-connector-php | src/Communibase/Connector.php | Connector.getLastJsonError | private function getLastJsonError()
{
static $messages = [
JSON_ERROR_DEPTH => 'Maximum stack depth exceeded',
JSON_ERROR_STATE_MISMATCH => 'Underflow or the modes mismatch',
JSON_ERROR_CTRL_CHAR => 'Unexpected control character found',
JSON_ERROR_SYNTAX => 'S... | php | private function getLastJsonError()
{
static $messages = [
JSON_ERROR_DEPTH => 'Maximum stack depth exceeded',
JSON_ERROR_STATE_MISMATCH => 'Underflow or the modes mismatch',
JSON_ERROR_CTRL_CHAR => 'Unexpected control character found',
JSON_ERROR_SYNTAX => 'S... | [
"private",
"function",
"getLastJsonError",
"(",
")",
"{",
"static",
"$",
"messages",
"=",
"[",
"JSON_ERROR_DEPTH",
"=>",
"'Maximum stack depth exceeded'",
",",
"JSON_ERROR_STATE_MISMATCH",
"=>",
"'Underflow or the modes mismatch'",
",",
"JSON_ERROR_CTRL_CHAR",
"=>",
"'Unexp... | Error message based on the most recent JSON error.
@see http://nl1.php.net/manual/en/function.json-last-error.php
@return string | [
"Error",
"message",
"based",
"on",
"the",
"most",
"recent",
"JSON",
"error",
"."
] | f1f9699e1a8acf066fab308f1e86cb8b5548e2db | https://github.com/kingsquare/communibase-connector-php/blob/f1f9699e1a8acf066fab308f1e86cb8b5548e2db/src/Communibase/Connector.php#L615-L627 |
16,128 | kingsquare/communibase-connector-php | src/Communibase/Connector.php | Connector.call | private function call($method, array $arguments)
{
try {
/**
* Due to GuzzleHttp not passing a default host header given to the client to _every_ request made by the
* client we manually check to see if we need to add a hostheader to requests.
* When the i... | php | private function call($method, array $arguments)
{
try {
/**
* Due to GuzzleHttp not passing a default host header given to the client to _every_ request made by the
* client we manually check to see if we need to add a hostheader to requests.
* When the i... | [
"private",
"function",
"call",
"(",
"$",
"method",
",",
"array",
"$",
"arguments",
")",
"{",
"try",
"{",
"/**\n * Due to GuzzleHttp not passing a default host header given to the client to _every_ request made by the\n * client we manually check to see if we need ... | Perform the actual call to Communibase
@param string $method
@param array $arguments
@return \Psr\Http\Message\ResponseInterface
@throws Exception | [
"Perform",
"the",
"actual",
"call",
"to",
"Communibase"
] | f1f9699e1a8acf066fab308f1e86cb8b5548e2db | https://github.com/kingsquare/communibase-connector-php/blob/f1f9699e1a8acf066fab308f1e86cb8b5548e2db/src/Communibase/Connector.php#L743-L788 |
16,129 | weavephp/weave | src/Middleware/Dispatch.php | Dispatch.run | protected function run(Request $request)
{
// If there's nothing to dispatch, continue along the middleware pipeline
$handler = $request->getAttribute('dispatch.handler', false);
if ($handler === false) {
return $this->chain($request);
}
// Setup any remaining chained parts of the dispatch for future dis... | php | protected function run(Request $request)
{
// If there's nothing to dispatch, continue along the middleware pipeline
$handler = $request->getAttribute('dispatch.handler', false);
if ($handler === false) {
return $this->chain($request);
}
// Setup any remaining chained parts of the dispatch for future dis... | [
"protected",
"function",
"run",
"(",
"Request",
"$",
"request",
")",
"{",
"// If there's nothing to dispatch, continue along the middleware pipeline",
"$",
"handler",
"=",
"$",
"request",
"->",
"getAttribute",
"(",
"'dispatch.handler'",
",",
"false",
")",
";",
"if",
"... | Handle a dispatch.
@param Request $request The request.
@return Response | [
"Handle",
"a",
"dispatch",
"."
] | 44183a5bcb9e3ed3754cc76aa9e0724d718caeec | https://github.com/weavephp/weave/blob/44183a5bcb9e3ed3754cc76aa9e0724d718caeec/src/Middleware/Dispatch.php#L56-L82 |
16,130 | rinvex/obsolete-module | src/ModuleManager.php | ModuleManager.sort | public function sort()
{
if ($this->modules) {
$modules = [];
$sorter = new StringSort();
foreach ($this->modules as $slug => $module) {
$sorter->add($slug, array_intersect(array_keys($module->getAttribute('require')), array_keys($this->modules)));
... | php | public function sort()
{
if ($this->modules) {
$modules = [];
$sorter = new StringSort();
foreach ($this->modules as $slug => $module) {
$sorter->add($slug, array_intersect(array_keys($module->getAttribute('require')), array_keys($this->modules)));
... | [
"public",
"function",
"sort",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"modules",
")",
"{",
"$",
"modules",
"=",
"[",
"]",
";",
"$",
"sorter",
"=",
"new",
"StringSort",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"modules",
"as",
"$",
... | Sort modules by their dependencies.
@return $this | [
"Sort",
"modules",
"by",
"their",
"dependencies",
"."
] | 95e372ae97ecbe7071c3da397b0afd57f327361f | https://github.com/rinvex/obsolete-module/blob/95e372ae97ecbe7071c3da397b0afd57f327361f/src/ModuleManager.php#L81-L100 |
16,131 | rinvex/obsolete-module | src/ModuleManager.php | ModuleManager.register | public function register()
{
foreach ($this->modules as $module) {
if ($aggregator = $module->getAttribute('aggregator')) {
$this->container->register($aggregator);
}
}
return $this;
} | php | public function register()
{
foreach ($this->modules as $module) {
if ($aggregator = $module->getAttribute('aggregator')) {
$this->container->register($aggregator);
}
}
return $this;
} | [
"public",
"function",
"register",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"modules",
"as",
"$",
"module",
")",
"{",
"if",
"(",
"$",
"aggregator",
"=",
"$",
"module",
"->",
"getAttribute",
"(",
"'aggregator'",
")",
")",
"{",
"$",
"this",
"->... | Register modules with service container.
@return $this | [
"Register",
"modules",
"with",
"service",
"container",
"."
] | 95e372ae97ecbe7071c3da397b0afd57f327361f | https://github.com/rinvex/obsolete-module/blob/95e372ae97ecbe7071c3da397b0afd57f327361f/src/ModuleManager.php#L107-L116 |
16,132 | WellCommerce/OrderBundle | Form/DataTransformer/ShippingCostCollectionToArrayTransformer.php | ShippingCostCollectionToArrayTransformer.getRangeData | private function getRangeData(ShippingMethodCost $cost)
{
return [
'min' => $cost->getRangeFrom(),
'max' => $cost->getRangeTo(),
'price' => $cost->getCost()->getGrossAmount(),
];
} | php | private function getRangeData(ShippingMethodCost $cost)
{
return [
'min' => $cost->getRangeFrom(),
'max' => $cost->getRangeTo(),
'price' => $cost->getCost()->getGrossAmount(),
];
} | [
"private",
"function",
"getRangeData",
"(",
"ShippingMethodCost",
"$",
"cost",
")",
"{",
"return",
"[",
"'min'",
"=>",
"$",
"cost",
"->",
"getRangeFrom",
"(",
")",
",",
"'max'",
"=>",
"$",
"cost",
"->",
"getRangeTo",
"(",
")",
",",
"'price'",
"=>",
"$",
... | Returns costs data as an array
@param ShippingMethodCost $cost
@return array | [
"Returns",
"costs",
"data",
"as",
"an",
"array"
] | d72cfb51eab7a1f66f186900d1e2d533a822c424 | https://github.com/WellCommerce/OrderBundle/blob/d72cfb51eab7a1f66f186900d1e2d533a822c424/Form/DataTransformer/ShippingCostCollectionToArrayTransformer.php#L54-L61 |
16,133 | EcomDev/phpspec-magento-di-adapter | src/Extension.php | Extension.load | public function load(ServiceContainer $container, array $params)
{
$container->define(
'ecomdev.phpspec.magento_di_adapter.vfs',
$this->vfsFactory()
);
$container->define(
'ecomdev.phpspec.magento_di_adapter.code_generator.io',
$this->ioFactor... | php | public function load(ServiceContainer $container, array $params)
{
$container->define(
'ecomdev.phpspec.magento_di_adapter.vfs',
$this->vfsFactory()
);
$container->define(
'ecomdev.phpspec.magento_di_adapter.code_generator.io',
$this->ioFactor... | [
"public",
"function",
"load",
"(",
"ServiceContainer",
"$",
"container",
",",
"array",
"$",
"params",
")",
"{",
"$",
"container",
"->",
"define",
"(",
"'ecomdev.phpspec.magento_di_adapter.vfs'",
",",
"$",
"this",
"->",
"vfsFactory",
"(",
")",
")",
";",
"$",
... | Load collaborator into PHPSpec ServiceContainer
@param ServiceContainer $container | [
"Load",
"collaborator",
"into",
"PHPSpec",
"ServiceContainer"
] | b39f6f0afbb837dbf0eb4c71e6cdb318b8c9de37 | https://github.com/EcomDev/phpspec-magento-di-adapter/blob/b39f6f0afbb837dbf0eb4c71e6cdb318b8c9de37/src/Extension.php#L33-L60 |
16,134 | EcomDev/phpspec-magento-di-adapter | src/Extension.php | Extension.parameterValidatorFactory | public function parameterValidatorFactory()
{
return function (ServiceContainer $container) {
$parameterValidator = new ParameterValidator(
$container->get('ecomdev.phpspec.magento_di_adapter.code_generator.io'),
$container->get('ecomdev.phpspec.magento_di_adapter... | php | public function parameterValidatorFactory()
{
return function (ServiceContainer $container) {
$parameterValidator = new ParameterValidator(
$container->get('ecomdev.phpspec.magento_di_adapter.code_generator.io'),
$container->get('ecomdev.phpspec.magento_di_adapter... | [
"public",
"function",
"parameterValidatorFactory",
"(",
")",
"{",
"return",
"function",
"(",
"ServiceContainer",
"$",
"container",
")",
"{",
"$",
"parameterValidator",
"=",
"new",
"ParameterValidator",
"(",
"$",
"container",
"->",
"get",
"(",
"'ecomdev.phpspec.magen... | Factory for instantiation of parameter validator
@return \Closure | [
"Factory",
"for",
"instantiation",
"of",
"parameter",
"validator"
] | b39f6f0afbb837dbf0eb4c71e6cdb318b8c9de37 | https://github.com/EcomDev/phpspec-magento-di-adapter/blob/b39f6f0afbb837dbf0eb4c71e6cdb318b8c9de37/src/Extension.php#L67-L87 |
16,135 | datasift/datasift-php | lib/DataSift/HistoricPreview.php | DataSift_HistoricPreview.fromResponse | public function fromResponse(array $data)
{
$map = array(
'id' => 'setId',
'start' => 'setStart',
'end' => 'setEnd',
'hash' => 'setHash',
'parameters' => 'setParameters',
'created_at' => 'setCreatedAt',
//only present in res... | php | public function fromResponse(array $data)
{
$map = array(
'id' => 'setId',
'start' => 'setStart',
'end' => 'setEnd',
'hash' => 'setHash',
'parameters' => 'setParameters',
'created_at' => 'setCreatedAt',
//only present in res... | [
"public",
"function",
"fromResponse",
"(",
"array",
"$",
"data",
")",
"{",
"$",
"map",
"=",
"array",
"(",
"'id'",
"=>",
"'setId'",
",",
"'start'",
"=>",
"'setStart'",
",",
"'end'",
"=>",
"'setEnd'",
",",
"'hash'",
"=>",
"'setHash'",
",",
"'parameters'",
... | Hydrates this preview from an array of API responses
@param array $data
@return DataSift_HistoricPreview | [
"Hydrates",
"this",
"preview",
"from",
"an",
"array",
"of",
"API",
"responses"
] | 35282461ad3e54880e5940bb5afce26c75dc4bb9 | https://github.com/datasift/datasift-php/blob/35282461ad3e54880e5940bb5afce26c75dc4bb9/lib/DataSift/HistoricPreview.php#L265-L289 |
16,136 | datasift/datasift-php | lib/DataSift/HistoricPreview.php | DataSift_HistoricPreview.create | public function create()
{
$params = array(
'start' => $this->getStart(),
'hash' => $this->getHash(),
'parameters' => implode(',', $this->getParameters())
);
if (is_int($this->end)) {
$params['end'] = $this->getEnd();
}
$this->f... | php | public function create()
{
$params = array(
'start' => $this->getStart(),
'hash' => $this->getHash(),
'parameters' => implode(',', $this->getParameters())
);
if (is_int($this->end)) {
$params['end'] = $this->getEnd();
}
$this->f... | [
"public",
"function",
"create",
"(",
")",
"{",
"$",
"params",
"=",
"array",
"(",
"'start'",
"=>",
"$",
"this",
"->",
"getStart",
"(",
")",
",",
"'hash'",
"=>",
"$",
"this",
"->",
"getHash",
"(",
")",
",",
"'parameters'",
"=>",
"implode",
"(",
"','",
... | Create the preview represented by the parameters in this object
@return DataSift_HistoricPreview
@throws DataSift_Exception_APIError
@throws DataSift_Exception_AccessDenied | [
"Create",
"the",
"preview",
"represented",
"by",
"the",
"parameters",
"in",
"this",
"object"
] | 35282461ad3e54880e5940bb5afce26c75dc4bb9 | https://github.com/datasift/datasift-php/blob/35282461ad3e54880e5940bb5afce26c75dc4bb9/lib/DataSift/HistoricPreview.php#L322-L333 |
16,137 | datasift/datasift-php | lib/DataSift/Historic.php | DataSift_Historic.listHistorics | public static function listHistorics($user, $page = 1, $per_page = 20)
{
try {
$res = $user->post(
'historics/get',
array(
'page' => $page,
'max' => $page,
)
);
$retval = array('count... | php | public static function listHistorics($user, $page = 1, $per_page = 20)
{
try {
$res = $user->post(
'historics/get',
array(
'page' => $page,
'max' => $page,
)
);
$retval = array('count... | [
"public",
"static",
"function",
"listHistorics",
"(",
"$",
"user",
",",
"$",
"page",
"=",
"1",
",",
"$",
"per_page",
"=",
"20",
")",
"{",
"try",
"{",
"$",
"res",
"=",
"$",
"user",
"->",
"post",
"(",
"'historics/get'",
",",
"array",
"(",
"'page'",
"... | List Historics queries.
@param DataSift_User $user The user object.
@param int $page The start page.
@param int $per_page The start page.
@throws DataSift_Exception_InvalidData
@throws DataSift_Exception_APIError | [
"List",
"Historics",
"queries",
"."
] | 35282461ad3e54880e5940bb5afce26c75dc4bb9 | https://github.com/datasift/datasift-php/blob/35282461ad3e54880e5940bb5afce26c75dc4bb9/lib/DataSift/Historic.php#L36-L66 |
16,138 | datasift/datasift-php | lib/DataSift/Historic.php | DataSift_Historic.reloadData | public function reloadData()
{
if ($this->_deleted) {
throw new DataSift_Exception_InvalidData('Cannot reload the data for a deleted Historic.');
}
if ($this->_playback_id === false) {
throw new DataSift_Exception_InvalidData('Cannot reload the data for a Historic wi... | php | public function reloadData()
{
if ($this->_deleted) {
throw new DataSift_Exception_InvalidData('Cannot reload the data for a deleted Historic.');
}
if ($this->_playback_id === false) {
throw new DataSift_Exception_InvalidData('Cannot reload the data for a Historic wi... | [
"public",
"function",
"reloadData",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_deleted",
")",
"{",
"throw",
"new",
"DataSift_Exception_InvalidData",
"(",
"'Cannot reload the data for a deleted Historic.'",
")",
";",
"}",
"if",
"(",
"$",
"this",
"->",
"_playb... | Reload the data for this object from the API.
@throws DataSift_Exception_InvalidData
@throws DataSift_Exception_APIError
@throws DataSift_Exception_AccessDenied | [
"Reload",
"the",
"data",
"for",
"this",
"object",
"from",
"the",
"API",
"."
] | 35282461ad3e54880e5940bb5afce26c75dc4bb9 | https://github.com/datasift/datasift-php/blob/35282461ad3e54880e5940bb5afce26c75dc4bb9/lib/DataSift/Historic.php#L243-L267 |
16,139 | datasift/datasift-php | lib/DataSift/Historic.php | DataSift_Historic.initFromArray | protected function initFromArray($data)
{
if (! isset($data['id'])) {
throw new DataSift_Exception_APIError('No playback ID in the response');
}
if ($data['id'] != $this->_playback_id) {
throw new DataSift_Exception_APIError('Incorrect playback ID in the response');
... | php | protected function initFromArray($data)
{
if (! isset($data['id'])) {
throw new DataSift_Exception_APIError('No playback ID in the response');
}
if ($data['id'] != $this->_playback_id) {
throw new DataSift_Exception_APIError('Incorrect playback ID in the response');
... | [
"protected",
"function",
"initFromArray",
"(",
"$",
"data",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"data",
"[",
"'id'",
"]",
")",
")",
"{",
"throw",
"new",
"DataSift_Exception_APIError",
"(",
"'No playback ID in the response'",
")",
";",
"}",
"if",
"... | Initialise this object from the data in the given array.
@param array $data The array of data.
@throws DataSift_Exception_InvalidData | [
"Initialise",
"this",
"object",
"from",
"the",
"data",
"in",
"the",
"given",
"array",
"."
] | 35282461ad3e54880e5940bb5afce26c75dc4bb9 | https://github.com/datasift/datasift-php/blob/35282461ad3e54880e5940bb5afce26c75dc4bb9/lib/DataSift/Historic.php#L276-L337 |
16,140 | datasift/datasift-php | lib/DataSift/Historic.php | DataSift_Historic.prepare | public function prepare()
{
if ($this->_deleted) {
throw new DataSift_Exception_InvalidData('Cannot prepare a deleted Historic.');
}
if ($this->_playback_id !== false) {
throw new DataSift_Exception_InvalidData('This historic query has already been prepared.');
... | php | public function prepare()
{
if ($this->_deleted) {
throw new DataSift_Exception_InvalidData('Cannot prepare a deleted Historic.');
}
if ($this->_playback_id !== false) {
throw new DataSift_Exception_InvalidData('This historic query has already been prepared.');
... | [
"public",
"function",
"prepare",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_deleted",
")",
"{",
"throw",
"new",
"DataSift_Exception_InvalidData",
"(",
"'Cannot prepare a deleted Historic.'",
")",
";",
"}",
"if",
"(",
"$",
"this",
"->",
"_playback_id",
"!==... | Call the DataSift API to prepare this historic query.
@return void
@throws DataSift_Exception_APIError
@throws DataSift_Exception_InvalidData | [
"Call",
"the",
"DataSift",
"API",
"to",
"prepare",
"this",
"historic",
"query",
"."
] | 35282461ad3e54880e5940bb5afce26c75dc4bb9 | https://github.com/datasift/datasift-php/blob/35282461ad3e54880e5940bb5afce26c75dc4bb9/lib/DataSift/Historic.php#L530-L582 |
16,141 | datasift/datasift-php | lib/DataSift/Historic.php | DataSift_Historic.stop | public function stop()
{
if ($this->_deleted) {
throw new DataSift_Exception_InvalidData('Cannot stop a deleted Historic.');
}
if ($this->_playback_id === false || strlen($this->_playback_id) == 0) {
throw new DataSift_Exception_InvalidData('Cannot stop a historic qu... | php | public function stop()
{
if ($this->_deleted) {
throw new DataSift_Exception_InvalidData('Cannot stop a deleted Historic.');
}
if ($this->_playback_id === false || strlen($this->_playback_id) == 0) {
throw new DataSift_Exception_InvalidData('Cannot stop a historic qu... | [
"public",
"function",
"stop",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_deleted",
")",
"{",
"throw",
"new",
"DataSift_Exception_InvalidData",
"(",
"'Cannot stop a deleted Historic.'",
")",
";",
"}",
"if",
"(",
"$",
"this",
"->",
"_playback_id",
"===",
"... | Stop this historic query.
@return void
@throws DataSift_Exception_APIError
@throws DataSift_Exception_InvalidData | [
"Stop",
"this",
"historic",
"query",
"."
] | 35282461ad3e54880e5940bb5afce26c75dc4bb9 | https://github.com/datasift/datasift-php/blob/35282461ad3e54880e5940bb5afce26c75dc4bb9/lib/DataSift/Historic.php#L633-L666 |
16,142 | datasift/datasift-php | lib/DataSift/Historic.php | DataSift_Historic.pause | public function pause($reason = false)
{
if ($this->_deleted) {
throw new DataSift_Exception_InvalidData('Cannot pause a deleted Historic.');
}
if ($this->_playback_id === false || strlen($this->_playback_id) == 0) {
throw new DataSift_Exception_InvalidData('Cannot p... | php | public function pause($reason = false)
{
if ($this->_deleted) {
throw new DataSift_Exception_InvalidData('Cannot pause a deleted Historic.');
}
if ($this->_playback_id === false || strlen($this->_playback_id) == 0) {
throw new DataSift_Exception_InvalidData('Cannot p... | [
"public",
"function",
"pause",
"(",
"$",
"reason",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_deleted",
")",
"{",
"throw",
"new",
"DataSift_Exception_InvalidData",
"(",
"'Cannot pause a deleted Historic.'",
")",
";",
"}",
"if",
"(",
"$",
"this",... | Pause this historic query.
@param string $reason Your reason for pausing the Historics query.
@return void
@throws DataSift_Exception_APIError
@throws DataSift_Exception_InvalidData | [
"Pause",
"this",
"historic",
"query",
"."
] | 35282461ad3e54880e5940bb5afce26c75dc4bb9 | https://github.com/datasift/datasift-php/blob/35282461ad3e54880e5940bb5afce26c75dc4bb9/lib/DataSift/Historic.php#L677-L707 |
16,143 | Nayjest/Tree | src/ChildNodeTrait.php | ChildNodeTrait.internalSetParent | final public function internalSetParent(ParentNodeInterface $parent)
{
$this->emit('parent.change', [$parent, $this]);
$this->parentNode = $parent;
} | php | final public function internalSetParent(ParentNodeInterface $parent)
{
$this->emit('parent.change', [$parent, $this]);
$this->parentNode = $parent;
} | [
"final",
"public",
"function",
"internalSetParent",
"(",
"ParentNodeInterface",
"$",
"parent",
")",
"{",
"$",
"this",
"->",
"emit",
"(",
"'parent.change'",
",",
"[",
"$",
"parent",
",",
"$",
"this",
"]",
")",
";",
"$",
"this",
"->",
"parentNode",
"=",
"$... | Attaches component to registry.
@param ParentNodeInterface $parent
@return null | [
"Attaches",
"component",
"to",
"registry",
"."
] | e73da75f939e207b1c25065e9466c28300e7113c | https://github.com/Nayjest/Tree/blob/e73da75f939e207b1c25065e9466c28300e7113c/src/ChildNodeTrait.php#L37-L41 |
16,144 | discophp/framework | core/classes/PDO.class.php | PDO.create | public function create($table, $data){
$keys = array_keys($data);
$values = ':' . implode(',:', $keys);
$keys = implode(',', $keys);
return $this->query($this->set("INSERT INTO {$table} ({$keys}) VALUES({$values})", $data));
} | php | public function create($table, $data){
$keys = array_keys($data);
$values = ':' . implode(',:', $keys);
$keys = implode(',', $keys);
return $this->query($this->set("INSERT INTO {$table} ({$keys}) VALUES({$values})", $data));
} | [
"public",
"function",
"create",
"(",
"$",
"table",
",",
"$",
"data",
")",
"{",
"$",
"keys",
"=",
"array_keys",
"(",
"$",
"data",
")",
";",
"$",
"values",
"=",
"':'",
".",
"implode",
"(",
"',:'",
",",
"$",
"keys",
")",
";",
"$",
"keys",
"=",
"im... | Perform an INSERT statement.
@param string $table The name of the table to insert into.
@param array $data The data to insert into the table, must be an associative array.
@return mixed
@throws \Disco\exceptions\DBQuery | [
"Perform",
"an",
"INSERT",
"statement",
"."
] | 40ff3ea5225810534195494dc6c21083da4d1356 | https://github.com/discophp/framework/blob/40ff3ea5225810534195494dc6c21083da4d1356/core/classes/PDO.class.php#L239-L244 |
16,145 | discophp/framework | core/classes/PDO.class.php | PDO.delete | public function delete($table, $data, $conjunction = 'AND'){
$keys = array_keys($data);
$pairs = Array();
foreach($keys as $key){
$pairs[] = "{$key}=:{$key}";
}//foreach
$pairs = implode(" {$conjunction} ", $pairs);
return $this->query($this->set("DELETE FROM ... | php | public function delete($table, $data, $conjunction = 'AND'){
$keys = array_keys($data);
$pairs = Array();
foreach($keys as $key){
$pairs[] = "{$key}=:{$key}";
}//foreach
$pairs = implode(" {$conjunction} ", $pairs);
return $this->query($this->set("DELETE FROM ... | [
"public",
"function",
"delete",
"(",
"$",
"table",
",",
"$",
"data",
",",
"$",
"conjunction",
"=",
"'AND'",
")",
"{",
"$",
"keys",
"=",
"array_keys",
"(",
"$",
"data",
")",
";",
"$",
"pairs",
"=",
"Array",
"(",
")",
";",
"foreach",
"(",
"$",
"key... | Perform a DELETE statement.
@param string $table The name of the table to delete from.
@param array $data The conditions specifying what rows to delete from the table, must be an associative array.
@param string $conjunction The conjunction used to form the where condition of the delete statement. Default
is `AND`.
@... | [
"Perform",
"a",
"DELETE",
"statement",
"."
] | 40ff3ea5225810534195494dc6c21083da4d1356 | https://github.com/discophp/framework/blob/40ff3ea5225810534195494dc6c21083da4d1356/core/classes/PDO.class.php#L259-L267 |
16,146 | discophp/framework | core/classes/PDO.class.php | PDO.update | public function update($table, $data, $where, $conjunction = 'AND'){
$values = array_merge(array_values($data),array_values($where));
$keys = array_keys($data);
$pairs = Array();
foreach($keys as $key){
$pairs[] = "{$key}=?";
}//foreach
$pairs = implode(',',$p... | php | public function update($table, $data, $where, $conjunction = 'AND'){
$values = array_merge(array_values($data),array_values($where));
$keys = array_keys($data);
$pairs = Array();
foreach($keys as $key){
$pairs[] = "{$key}=?";
}//foreach
$pairs = implode(',',$p... | [
"public",
"function",
"update",
"(",
"$",
"table",
",",
"$",
"data",
",",
"$",
"where",
",",
"$",
"conjunction",
"=",
"'AND'",
")",
"{",
"$",
"values",
"=",
"array_merge",
"(",
"array_values",
"(",
"$",
"data",
")",
",",
"array_values",
"(",
"$",
"wh... | Perform an UPDATE statement .
@param string $table The name of the table to update.
@param array $data The data to update the table with, must be an associative array.
@param array $where The conditions specifying what rows should be updated in the table, must be an associative array.
@param string $conjunction The co... | [
"Perform",
"an",
"UPDATE",
"statement",
"."
] | 40ff3ea5225810534195494dc6c21083da4d1356 | https://github.com/discophp/framework/blob/40ff3ea5225810534195494dc6c21083da4d1356/core/classes/PDO.class.php#L283-L301 |
16,147 | discophp/framework | core/classes/PDO.class.php | PDO.select | public function select($table, $select, $where, $conjunction = 'AND'){
$keys = array_keys($where);
$pairs = Array();
foreach($keys as $key){
$pairs[] = "{$key}=:{$key}";
}//foreach
$pairs = implode(" {$conjunction} ",$pairs);
if(is_array($select)){
... | php | public function select($table, $select, $where, $conjunction = 'AND'){
$keys = array_keys($where);
$pairs = Array();
foreach($keys as $key){
$pairs[] = "{$key}=:{$key}";
}//foreach
$pairs = implode(" {$conjunction} ",$pairs);
if(is_array($select)){
... | [
"public",
"function",
"select",
"(",
"$",
"table",
",",
"$",
"select",
",",
"$",
"where",
",",
"$",
"conjunction",
"=",
"'AND'",
")",
"{",
"$",
"keys",
"=",
"array_keys",
"(",
"$",
"where",
")",
";",
"$",
"pairs",
"=",
"Array",
"(",
")",
";",
"fo... | Perform a SELECT statement .
@param string $table The name of the table to select from.
@param string|array $select The fields to select from the table, can be a string of field or an array of
fields.
@param array $where The conditions specifying what rows should be selected from the table, must be an associative arra... | [
"Perform",
"a",
"SELECT",
"statement",
"."
] | 40ff3ea5225810534195494dc6c21083da4d1356 | https://github.com/discophp/framework/blob/40ff3ea5225810534195494dc6c21083da4d1356/core/classes/PDO.class.php#L318-L333 |
16,148 | discophp/framework | core/classes/PDO.class.php | PDO.set | public function set($q, $args){
if(is_array($args) && isset($args['raw'])){
$q = implode($args['raw'],explode('?',$q,2));;
}//if
else if(is_array($args)){
$first = array_keys($args);
$first = array_shift($first);
if(!is_numeric($first)){
... | php | public function set($q, $args){
if(is_array($args) && isset($args['raw'])){
$q = implode($args['raw'],explode('?',$q,2));;
}//if
else if(is_array($args)){
$first = array_keys($args);
$first = array_shift($first);
if(!is_numeric($first)){
... | [
"public",
"function",
"set",
"(",
"$",
"q",
",",
"$",
"args",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"args",
")",
"&&",
"isset",
"(",
"$",
"args",
"[",
"'raw'",
"]",
")",
")",
"{",
"$",
"q",
"=",
"implode",
"(",
"$",
"args",
"[",
"'raw'",... | Bind passed variables into a query string and do proper type checking
and escaping before binding.
@param string $q The query string.
@param string|array $args The variables to bind to the $q.
@return string The $q with $args bound into it.
@throws \Disco\exceptions\DBQuery When the num... | [
"Bind",
"passed",
"variables",
"into",
"a",
"query",
"string",
"and",
"do",
"proper",
"type",
"checking",
"and",
"escaping",
"before",
"binding",
"."
] | 40ff3ea5225810534195494dc6c21083da4d1356 | https://github.com/discophp/framework/blob/40ff3ea5225810534195494dc6c21083da4d1356/core/classes/PDO.class.php#L362-L385 |
16,149 | discophp/framework | core/classes/PDO.class.php | PDO.setQuestionMarkPlaceHolders | private function setQuestionMarkPlaceHolders($q, $args){
foreach($args as $k=>$a){
if(is_array($a) && isset($a['raw'])){
$args[$k] = $a['raw'];
}//if
else {
$args[$k] = $this->prepareType($a);
}//el
}//foreach
$po... | php | private function setQuestionMarkPlaceHolders($q, $args){
foreach($args as $k=>$a){
if(is_array($a) && isset($a['raw'])){
$args[$k] = $a['raw'];
}//if
else {
$args[$k] = $this->prepareType($a);
}//el
}//foreach
$po... | [
"private",
"function",
"setQuestionMarkPlaceHolders",
"(",
"$",
"q",
",",
"$",
"args",
")",
"{",
"foreach",
"(",
"$",
"args",
"as",
"$",
"k",
"=>",
"$",
"a",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"a",
")",
"&&",
"isset",
"(",
"$",
"a",
"[",
... | Set `?` mark value placeholders with the values passed in args in the order they are set in the query and
the args.
@param string $q The query string.
@param string|array $args The variables to bind to the $q.
@return string The $q with $args bound into it.
@throws \Disco\exceptions\DBQu... | [
"Set",
"?",
"mark",
"value",
"placeholders",
"with",
"the",
"values",
"passed",
"in",
"args",
"in",
"the",
"order",
"they",
"are",
"set",
"in",
"the",
"query",
"and",
"the",
"args",
"."
] | 40ff3ea5225810534195494dc6c21083da4d1356 | https://github.com/discophp/framework/blob/40ff3ea5225810534195494dc6c21083da4d1356/core/classes/PDO.class.php#L448-L482 |
16,150 | discophp/framework | core/classes/PDO.class.php | PDO.prepareType | private function prepareType($arg){
if(($arg===null || $arg=='null') && $arg !== 0){
return 'NULL';
}//if
if(!is_numeric($arg)){
return $this->quote($arg);
}//if
return $arg;
} | php | private function prepareType($arg){
if(($arg===null || $arg=='null') && $arg !== 0){
return 'NULL';
}//if
if(!is_numeric($arg)){
return $this->quote($arg);
}//if
return $arg;
} | [
"private",
"function",
"prepareType",
"(",
"$",
"arg",
")",
"{",
"if",
"(",
"(",
"$",
"arg",
"===",
"null",
"||",
"$",
"arg",
"==",
"'null'",
")",
"&&",
"$",
"arg",
"!==",
"0",
")",
"{",
"return",
"'NULL'",
";",
"}",
"//if",
"if",
"(",
"!",
"is... | Determine the type of variable being bound into the query, either a String or Numeric.
@param string|int|float $arg The variable to prepare.
@return string|int|float The $arg prepared. | [
"Determine",
"the",
"type",
"of",
"variable",
"being",
"bound",
"into",
"the",
"query",
"either",
"a",
"String",
"or",
"Numeric",
"."
] | 40ff3ea5225810534195494dc6c21083da4d1356 | https://github.com/discophp/framework/blob/40ff3ea5225810534195494dc6c21083da4d1356/core/classes/PDO.class.php#L493-L501 |
16,151 | pipelinersales/pipeliner-php-sdk | src/PipelinerSales/ApiClient/PipelinerClient.php | PipelinerClient.create | public static function create($url, $pipelineId, $apiToken, $password)
{
$baseUrl = $url . '/rest_services/v1/' . $pipelineId;
$httpClient = new CurlHttpClient();
$httpClient->setUserCredentials($apiToken, $password);
$dateTimeFormat = Defaults::DATE_FORMAT;
$repoFactory = ... | php | public static function create($url, $pipelineId, $apiToken, $password)
{
$baseUrl = $url . '/rest_services/v1/' . $pipelineId;
$httpClient = new CurlHttpClient();
$httpClient->setUserCredentials($apiToken, $password);
$dateTimeFormat = Defaults::DATE_FORMAT;
$repoFactory = ... | [
"public",
"static",
"function",
"create",
"(",
"$",
"url",
",",
"$",
"pipelineId",
",",
"$",
"apiToken",
",",
"$",
"password",
")",
"{",
"$",
"baseUrl",
"=",
"$",
"url",
".",
"'/rest_services/v1/'",
".",
"$",
"pipelineId",
";",
"$",
"httpClient",
"=",
... | Creates a PipelinerClient object with sensible default configuration.
Will perform a HTTP request to fetch the existing entity types for the pipeline.
@param string $url base url of the REST server, without the trailing slash
@param string $pipelineId the unique team pipeline id
@param string $apiToken API token
@para... | [
"Creates",
"a",
"PipelinerClient",
"object",
"with",
"sensible",
"default",
"configuration",
".",
"Will",
"perform",
"a",
"HTTP",
"request",
"to",
"fetch",
"the",
"existing",
"entity",
"types",
"for",
"the",
"pipeline",
"."
] | a020149ffde815be17634542010814cf854c3d5f | https://github.com/pipelinersales/pipeliner-php-sdk/blob/a020149ffde815be17634542010814cf854c3d5f/src/PipelinerSales/ApiClient/PipelinerClient.php#L97-L112 |
16,152 | pipelinersales/pipeliner-php-sdk | src/PipelinerSales/ApiClient/PipelinerClient.php | PipelinerClient.getRepository | public function getRepository($entityName)
{
if ($entityName instanceof Entity) {
$entityName = $entityName->getType();
}
if (!isset($this->repositories[$entityName])) {
$plural = $this->getCollectionName($entityName);
$this->repositories[$entityName] = $... | php | public function getRepository($entityName)
{
if ($entityName instanceof Entity) {
$entityName = $entityName->getType();
}
if (!isset($this->repositories[$entityName])) {
$plural = $this->getCollectionName($entityName);
$this->repositories[$entityName] = $... | [
"public",
"function",
"getRepository",
"(",
"$",
"entityName",
")",
"{",
"if",
"(",
"$",
"entityName",
"instanceof",
"Entity",
")",
"{",
"$",
"entityName",
"=",
"$",
"entityName",
"->",
"getType",
"(",
")",
";",
"}",
"if",
"(",
"!",
"isset",
"(",
"$",
... | Returns a repository for the specified entity.
@param mixed $entityName an {@see Entity} object or entity name,
can be both singular (Account) and plural (Accounts)
@return RepositoryInterface | [
"Returns",
"a",
"repository",
"for",
"the",
"specified",
"entity",
"."
] | a020149ffde815be17634542010814cf854c3d5f | https://github.com/pipelinersales/pipeliner-php-sdk/blob/a020149ffde815be17634542010814cf854c3d5f/src/PipelinerSales/ApiClient/PipelinerClient.php#L152-L167 |
16,153 | discophp/framework | core/twig/tag/PageTokenParser.php | PageTokenParser.parse | public function parse(\Twig_Token $token) {
$lineno = $token->getLine();
$nodes['criteria'] = $this->parser->getExpressionParser()->parseExpression();
$this->parser->getStream()->expect('as');
$targets = $this->parser->getExpressionParser()->parseAssignmentExpression();
$this->... | php | public function parse(\Twig_Token $token) {
$lineno = $token->getLine();
$nodes['criteria'] = $this->parser->getExpressionParser()->parseExpression();
$this->parser->getStream()->expect('as');
$targets = $this->parser->getExpressionParser()->parseAssignmentExpression();
$this->... | [
"public",
"function",
"parse",
"(",
"\\",
"Twig_Token",
"$",
"token",
")",
"{",
"$",
"lineno",
"=",
"$",
"token",
"->",
"getLine",
"(",
")",
";",
"$",
"nodes",
"[",
"'criteria'",
"]",
"=",
"$",
"this",
"->",
"parser",
"->",
"getExpressionParser",
"(",
... | Define how our page tag should be parsed.
@param \Twig_Token $token An instance of a \Twig_Token.
@return \Disco\twig\PageNode | [
"Define",
"how",
"our",
"page",
"tag",
"should",
"be",
"parsed",
"."
] | 40ff3ea5225810534195494dc6c21083da4d1356 | https://github.com/discophp/framework/blob/40ff3ea5225810534195494dc6c21083da4d1356/core/twig/tag/PageTokenParser.php#L20-L37 |
16,154 | datasift/datasift-php | lib/DataSift/ApiClient.php | DataSift_ApiClient.initialize | private static function initialize($method, $ssl, $url, $headers, $params, $userAgent, $qs, $raw = false)
{
$ch = curl_init();
switch (strtolower($method)) {
case 'post':
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, ($raw ? $... | php | private static function initialize($method, $ssl, $url, $headers, $params, $userAgent, $qs, $raw = false)
{
$ch = curl_init();
switch (strtolower($method)) {
case 'post':
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, ($raw ? $... | [
"private",
"static",
"function",
"initialize",
"(",
"$",
"method",
",",
"$",
"ssl",
",",
"$",
"url",
",",
"$",
"headers",
",",
"$",
"params",
",",
"$",
"userAgent",
",",
"$",
"qs",
",",
"$",
"raw",
"=",
"false",
")",
"{",
"$",
"ch",
"=",
"curl_in... | Initalize the cURL connection.
@param string $method The HTTP method to use.
@param boolean $ssl Is SSL Enabled.
@param string $url The URL of the call.
@param array $headers The headers to be sent.
@param array $params The parameters to be passed along with the request.
@param string $userA... | [
"Initalize",
"the",
"cURL",
"connection",
"."
] | 35282461ad3e54880e5940bb5afce26c75dc4bb9 | https://github.com/datasift/datasift-php/blob/35282461ad3e54880e5940bb5afce26c75dc4bb9/lib/DataSift/ApiClient.php#L117-L155 |
16,155 | datasift/datasift-php | lib/DataSift/ApiClient.php | DataSift_ApiClient.decodeBody | protected static function decodeBody(array $res)
{
$format = isset($res['headers']['x-datasift-format'])
? $res['headers']['x-datasift-format']
: $res['headers']['content-type'];
$retval = array();
if (strtolower($format) == 'json_new_line') {
foreach (ex... | php | protected static function decodeBody(array $res)
{
$format = isset($res['headers']['x-datasift-format'])
? $res['headers']['x-datasift-format']
: $res['headers']['content-type'];
$retval = array();
if (strtolower($format) == 'json_new_line') {
foreach (ex... | [
"protected",
"static",
"function",
"decodeBody",
"(",
"array",
"$",
"res",
")",
"{",
"$",
"format",
"=",
"isset",
"(",
"$",
"res",
"[",
"'headers'",
"]",
"[",
"'x-datasift-format'",
"]",
")",
"?",
"$",
"res",
"[",
"'headers'",
"]",
"[",
"'x-datasift-form... | Decode the JSON response depending on the format.
@param array $res The parsed HTTP response.
@return array An array of the decoded JSON response | [
"Decode",
"the",
"JSON",
"response",
"depending",
"on",
"the",
"format",
"."
] | 35282461ad3e54880e5940bb5afce26c75dc4bb9 | https://github.com/datasift/datasift-php/blob/35282461ad3e54880e5940bb5afce26c75dc4bb9/lib/DataSift/ApiClient.php#L173-L189 |
16,156 | datasift/datasift-php | lib/DataSift/ApiClient.php | DataSift_ApiClient.parseHTTPResponse | private static function parseHTTPResponse($str)
{
$retval = array(
'headers' => array(),
'body' => '',
);
$lastfield = false;
$fields = explode("\n", preg_replace('/\x0D\x0A[\x09\x20]+/', ' ', $str));
foreach ($fields as $field) {
if (strle... | php | private static function parseHTTPResponse($str)
{
$retval = array(
'headers' => array(),
'body' => '',
);
$lastfield = false;
$fields = explode("\n", preg_replace('/\x0D\x0A[\x09\x20]+/', ' ', $str));
foreach ($fields as $field) {
if (strle... | [
"private",
"static",
"function",
"parseHTTPResponse",
"(",
"$",
"str",
")",
"{",
"$",
"retval",
"=",
"array",
"(",
"'headers'",
"=>",
"array",
"(",
")",
",",
"'body'",
"=>",
"''",
",",
")",
";",
"$",
"lastfield",
"=",
"false",
";",
"$",
"fields",
"="... | Parse an HTTP response. Separates the headers from the body and puts
the headers into an associative array.
@param string $str The HTTP response to be parsed.
@return array An array containing headers => array(header => value), and body. | [
"Parse",
"an",
"HTTP",
"response",
".",
"Separates",
"the",
"headers",
"from",
"the",
"body",
"and",
"puts",
"the",
"headers",
"into",
"an",
"associative",
"array",
"."
] | 35282461ad3e54880e5940bb5afce26c75dc4bb9 | https://github.com/datasift/datasift-php/blob/35282461ad3e54880e5940bb5afce26c75dc4bb9/lib/DataSift/ApiClient.php#L199-L231 |
16,157 | ftrrtf/FtrrtfRollbarBundle | EventListener/RollbarListener.php | RollbarListener.onKernelRequest | public function onKernelRequest(GetResponseEvent $event)
{
$this->errorHandler->registerErrorHandler($this->notifier);
$this->errorHandler->registerShutdownHandler($this->notifier);
} | php | public function onKernelRequest(GetResponseEvent $event)
{
$this->errorHandler->registerErrorHandler($this->notifier);
$this->errorHandler->registerShutdownHandler($this->notifier);
} | [
"public",
"function",
"onKernelRequest",
"(",
"GetResponseEvent",
"$",
"event",
")",
"{",
"$",
"this",
"->",
"errorHandler",
"->",
"registerErrorHandler",
"(",
"$",
"this",
"->",
"notifier",
")",
";",
"$",
"this",
"->",
"errorHandler",
"->",
"registerShutdownHan... | Register error handler.
@param GetResponseEvent $event | [
"Register",
"error",
"handler",
"."
] | 64c75862b80a4a1ed9e98c0d217003e84df40dd7 | https://github.com/ftrrtf/FtrrtfRollbarBundle/blob/64c75862b80a4a1ed9e98c0d217003e84df40dd7/EventListener/RollbarListener.php#L88-L92 |
16,158 | ftrrtf/FtrrtfRollbarBundle | EventListener/RollbarListener.php | RollbarListener.onKernelException | public function onKernelException(GetResponseForExceptionEvent $event)
{
// Skip HTTP exception
if ($event->getException() instanceof HttpException) {
return;
}
$this->setException($event->getException());
} | php | public function onKernelException(GetResponseForExceptionEvent $event)
{
// Skip HTTP exception
if ($event->getException() instanceof HttpException) {
return;
}
$this->setException($event->getException());
} | [
"public",
"function",
"onKernelException",
"(",
"GetResponseForExceptionEvent",
"$",
"event",
")",
"{",
"// Skip HTTP exception",
"if",
"(",
"$",
"event",
"->",
"getException",
"(",
")",
"instanceof",
"HttpException",
")",
"{",
"return",
";",
"}",
"$",
"this",
"... | Save exception.
@param GetResponseForExceptionEvent $event | [
"Save",
"exception",
"."
] | 64c75862b80a4a1ed9e98c0d217003e84df40dd7 | https://github.com/ftrrtf/FtrrtfRollbarBundle/blob/64c75862b80a4a1ed9e98c0d217003e84df40dd7/EventListener/RollbarListener.php#L99-L107 |
16,159 | ftrrtf/FtrrtfRollbarBundle | EventListener/RollbarListener.php | RollbarListener.onKernelResponse | public function onKernelResponse(FilterResponseEvent $event)
{
if ($this->getException()) {
$this->notifier->reportException($this->getException());
$this->setException(null);
}
} | php | public function onKernelResponse(FilterResponseEvent $event)
{
if ($this->getException()) {
$this->notifier->reportException($this->getException());
$this->setException(null);
}
} | [
"public",
"function",
"onKernelResponse",
"(",
"FilterResponseEvent",
"$",
"event",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"getException",
"(",
")",
")",
"{",
"$",
"this",
"->",
"notifier",
"->",
"reportException",
"(",
"$",
"this",
"->",
"getException",
... | Wrap exception with additional info.
@param FilterResponseEvent $event | [
"Wrap",
"exception",
"with",
"additional",
"info",
"."
] | 64c75862b80a4a1ed9e98c0d217003e84df40dd7 | https://github.com/ftrrtf/FtrrtfRollbarBundle/blob/64c75862b80a4a1ed9e98c0d217003e84df40dd7/EventListener/RollbarListener.php#L130-L136 |
16,160 | fsi-open/datasource-bundle | Twig/Extension/DataSourceExtension.php | DataSourceExtension.setTheme | public function setTheme(DataSourceViewInterface $dataSource, $theme, array $vars = [])
{
$this->themes[$dataSource->getName()] = ($theme instanceof Twig_Template)
? $theme
: $this->environment->loadTemplate($theme);
$this->themesVars[$dataSource->getName()] = $vars;
} | php | public function setTheme(DataSourceViewInterface $dataSource, $theme, array $vars = [])
{
$this->themes[$dataSource->getName()] = ($theme instanceof Twig_Template)
? $theme
: $this->environment->loadTemplate($theme);
$this->themesVars[$dataSource->getName()] = $vars;
} | [
"public",
"function",
"setTheme",
"(",
"DataSourceViewInterface",
"$",
"dataSource",
",",
"$",
"theme",
",",
"array",
"$",
"vars",
"=",
"[",
"]",
")",
"{",
"$",
"this",
"->",
"themes",
"[",
"$",
"dataSource",
"->",
"getName",
"(",
")",
"]",
"=",
"(",
... | Set theme for specific DataSource.
Theme is nothing more than twig template that contains some or all of blocks required to render DataSource.
@param DataSourceViewInterface $dataSource
@param $theme
@param array $vars | [
"Set",
"theme",
"for",
"specific",
"DataSource",
".",
"Theme",
"is",
"nothing",
"more",
"than",
"twig",
"template",
"that",
"contains",
"some",
"or",
"all",
"of",
"blocks",
"required",
"to",
"render",
"DataSource",
"."
] | 06964672c838af9f4125065e3a90b2df4e8aa077 | https://github.com/fsi-open/datasource-bundle/blob/06964672c838af9f4125065e3a90b2df4e8aa077/Twig/Extension/DataSourceExtension.php#L118-L124 |
16,161 | fsi-open/datasource-bundle | Twig/Extension/DataSourceExtension.php | DataSourceExtension.setRoute | public function setRoute(DataSourceViewInterface $dataSource, $route, array $additional_parameters = [])
{
$this->routes[$dataSource->getName()] = $route;
$this->additional_parameters[$dataSource->getName()] = $additional_parameters;
} | php | public function setRoute(DataSourceViewInterface $dataSource, $route, array $additional_parameters = [])
{
$this->routes[$dataSource->getName()] = $route;
$this->additional_parameters[$dataSource->getName()] = $additional_parameters;
} | [
"public",
"function",
"setRoute",
"(",
"DataSourceViewInterface",
"$",
"dataSource",
",",
"$",
"route",
",",
"array",
"$",
"additional_parameters",
"=",
"[",
"]",
")",
"{",
"$",
"this",
"->",
"routes",
"[",
"$",
"dataSource",
"->",
"getName",
"(",
")",
"]"... | Set route and optionally additional parameters for specific DataSource.
@param DataSourceViewInterface $dataSource
@param $route
@param array $additional_parameters | [
"Set",
"route",
"and",
"optionally",
"additional",
"parameters",
"for",
"specific",
"DataSource",
"."
] | 06964672c838af9f4125065e3a90b2df4e8aa077 | https://github.com/fsi-open/datasource-bundle/blob/06964672c838af9f4125065e3a90b2df4e8aa077/Twig/Extension/DataSourceExtension.php#L133-L137 |
16,162 | fsi-open/datasource-bundle | Twig/Extension/DataSourceExtension.php | DataSourceExtension.resolveMaxResultsOptions | private function resolveMaxResultsOptions(array $options, DataSourceViewInterface $dataSource)
{
$optionsResolver = new OptionsResolver();
$optionsResolver
->setDefaults([
'route' => $this->getCurrentRoute($dataSource),
'active_class' => 'active',
... | php | private function resolveMaxResultsOptions(array $options, DataSourceViewInterface $dataSource)
{
$optionsResolver = new OptionsResolver();
$optionsResolver
->setDefaults([
'route' => $this->getCurrentRoute($dataSource),
'active_class' => 'active',
... | [
"private",
"function",
"resolveMaxResultsOptions",
"(",
"array",
"$",
"options",
",",
"DataSourceViewInterface",
"$",
"dataSource",
")",
"{",
"$",
"optionsResolver",
"=",
"new",
"OptionsResolver",
"(",
")",
";",
"$",
"optionsResolver",
"->",
"setDefaults",
"(",
"[... | Validate and resolve options passed in Twig to datasource_results_per_page_widget
@param array $options
@return array | [
"Validate",
"and",
"resolve",
"options",
"passed",
"in",
"Twig",
"to",
"datasource_results_per_page_widget"
] | 06964672c838af9f4125065e3a90b2df4e8aa077 | https://github.com/fsi-open/datasource-bundle/blob/06964672c838af9f4125065e3a90b2df4e8aa077/Twig/Extension/DataSourceExtension.php#L333-L349 |
16,163 | fsi-open/datasource-bundle | Twig/Extension/DataSourceExtension.php | DataSourceExtension.getTemplates | private function getTemplates(DataSourceViewInterface $dataSource)
{
$templates = [];
if (isset($this->themes[$dataSource->getName()])) {
$templates[] = $this->themes[$dataSource->getName()];
}
$templates[] = $this->themes[self::DEFAULT_THEME];
return $template... | php | private function getTemplates(DataSourceViewInterface $dataSource)
{
$templates = [];
if (isset($this->themes[$dataSource->getName()])) {
$templates[] = $this->themes[$dataSource->getName()];
}
$templates[] = $this->themes[self::DEFAULT_THEME];
return $template... | [
"private",
"function",
"getTemplates",
"(",
"DataSourceViewInterface",
"$",
"dataSource",
")",
"{",
"$",
"templates",
"=",
"[",
"]",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"themes",
"[",
"$",
"dataSource",
"->",
"getName",
"(",
")",
"]",
")",
... | Return list of templates that might be useful to render DataSourceView.
Always the last template will be default one.
@param DataSourceViewInterface $dataSource
@return array | [
"Return",
"list",
"of",
"templates",
"that",
"might",
"be",
"useful",
"to",
"render",
"DataSourceView",
".",
"Always",
"the",
"last",
"template",
"will",
"be",
"default",
"one",
"."
] | 06964672c838af9f4125065e3a90b2df4e8aa077 | https://github.com/fsi-open/datasource-bundle/blob/06964672c838af9f4125065e3a90b2df4e8aa077/Twig/Extension/DataSourceExtension.php#L409-L420 |
16,164 | fsi-open/datasource-bundle | Twig/Extension/DataSourceExtension.php | DataSourceExtension.getVars | private function getVars(DataSourceViewInterface $dataSource)
{
return isset($this->themesVars[$dataSource->getName()])
? $this->themesVars[$dataSource->getName()]
: []
;
} | php | private function getVars(DataSourceViewInterface $dataSource)
{
return isset($this->themesVars[$dataSource->getName()])
? $this->themesVars[$dataSource->getName()]
: []
;
} | [
"private",
"function",
"getVars",
"(",
"DataSourceViewInterface",
"$",
"dataSource",
")",
"{",
"return",
"isset",
"(",
"$",
"this",
"->",
"themesVars",
"[",
"$",
"dataSource",
"->",
"getName",
"(",
")",
"]",
")",
"?",
"$",
"this",
"->",
"themesVars",
"[",
... | Return vars passed to theme. Those vars will be added to block context.
@param DataSourceViewInterface $dataSource
@return array | [
"Return",
"vars",
"passed",
"to",
"theme",
".",
"Those",
"vars",
"will",
"be",
"added",
"to",
"block",
"context",
"."
] | 06964672c838af9f4125065e3a90b2df4e8aa077 | https://github.com/fsi-open/datasource-bundle/blob/06964672c838af9f4125065e3a90b2df4e8aa077/Twig/Extension/DataSourceExtension.php#L428-L434 |
16,165 | fsi-open/datasource-bundle | Twig/Extension/DataSourceExtension.php | DataSourceExtension.getUrl | private function getUrl(DataSourceViewInterface $dataSource, array $options = [], array $parameters = [])
{
$router = $this->container->get('router');
return $router->generate(
$options['route'],
array_merge(
isset($this->additional_parameters[$dataSource->ge... | php | private function getUrl(DataSourceViewInterface $dataSource, array $options = [], array $parameters = [])
{
$router = $this->container->get('router');
return $router->generate(
$options['route'],
array_merge(
isset($this->additional_parameters[$dataSource->ge... | [
"private",
"function",
"getUrl",
"(",
"DataSourceViewInterface",
"$",
"dataSource",
",",
"array",
"$",
"options",
"=",
"[",
"]",
",",
"array",
"$",
"parameters",
"=",
"[",
"]",
")",
"{",
"$",
"router",
"=",
"$",
"this",
"->",
"container",
"->",
"get",
... | Return additional parameters that should be passed to the URL generation for specified datasource.
@param DataSourceViewInterface $dataSource
@return array | [
"Return",
"additional",
"parameters",
"that",
"should",
"be",
"passed",
"to",
"the",
"URL",
"generation",
"for",
"specified",
"datasource",
"."
] | 06964672c838af9f4125065e3a90b2df4e8aa077 | https://github.com/fsi-open/datasource-bundle/blob/06964672c838af9f4125065e3a90b2df4e8aa077/Twig/Extension/DataSourceExtension.php#L442-L458 |
16,166 | drpdigital/json-api-parser | src/Str.php | Str.snakeCase | public static function snakeCase($value)
{
if (! ctype_lower($value)) {
$value = preg_replace('/\s+/u', '', ucwords($value));
$value = preg_replace('/-/u', '_', $value);
$value = mb_strtolower(preg_replace('/(.)(?=[A-Z])/u', '$1_', $value), 'UTF-8');
}
r... | php | public static function snakeCase($value)
{
if (! ctype_lower($value)) {
$value = preg_replace('/\s+/u', '', ucwords($value));
$value = preg_replace('/-/u', '_', $value);
$value = mb_strtolower(preg_replace('/(.)(?=[A-Z])/u', '$1_', $value), 'UTF-8');
}
r... | [
"public",
"static",
"function",
"snakeCase",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"!",
"ctype_lower",
"(",
"$",
"value",
")",
")",
"{",
"$",
"value",
"=",
"preg_replace",
"(",
"'/\\s+/u'",
",",
"''",
",",
"ucwords",
"(",
"$",
"value",
")",
")",
... | Convert given input into snake case.
@param string $value
@return string | [
"Convert",
"given",
"input",
"into",
"snake",
"case",
"."
] | b1ceefc0c19ec326129126253114c121e97ca943 | https://github.com/drpdigital/json-api-parser/blob/b1ceefc0c19ec326129126253114c121e97ca943/src/Str.php#L13-L23 |
16,167 | jasny/router | src/Router/Helper/NotFound.php | NotFound.notFound | protected function notFound(ServerRequestInterface $request, ResponseInterface $response)
{
$finalResponse = $response
->withProtocolVersion($request->getProtocolVersion())
->withStatus(404)
->withHeader('Content-Type', 'text/plain');
$finalResponse->getB... | php | protected function notFound(ServerRequestInterface $request, ResponseInterface $response)
{
$finalResponse = $response
->withProtocolVersion($request->getProtocolVersion())
->withStatus(404)
->withHeader('Content-Type', 'text/plain');
$finalResponse->getB... | [
"protected",
"function",
"notFound",
"(",
"ServerRequestInterface",
"$",
"request",
",",
"ResponseInterface",
"$",
"response",
")",
"{",
"$",
"finalResponse",
"=",
"$",
"response",
"->",
"withProtocolVersion",
"(",
"$",
"request",
"->",
"getProtocolVersion",
"(",
... | Return with a 404 not found response
@param ServerRequestInterface $request
@param ResponseInterface $response
@return ResponseInterface | [
"Return",
"with",
"a",
"404",
"not",
"found",
"response"
] | 4c776665ba343150b442c21893946e3d54190896 | https://github.com/jasny/router/blob/4c776665ba343150b442c21893946e3d54190896/src/Router/Helper/NotFound.php#L20-L30 |
16,168 | chriswoodford/foursquare-php | lib/TheTwelve/Foursquare/AuthenticationGateway.php | AuthenticationGateway.initiateLogin | public function initiateLogin()
{
if (!$this->canInitiateLogin()) {
throw new \RuntimeException(
'Unable to initiate login'
);
}
$uri = $this->getAuthenticationUri();
return $this->redirector->redirect($uri);
} | php | public function initiateLogin()
{
if (!$this->canInitiateLogin()) {
throw new \RuntimeException(
'Unable to initiate login'
);
}
$uri = $this->getAuthenticationUri();
return $this->redirector->redirect($uri);
} | [
"public",
"function",
"initiateLogin",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"canInitiateLogin",
"(",
")",
")",
"{",
"throw",
"new",
"\\",
"RuntimeException",
"(",
"'Unable to initiate login'",
")",
";",
"}",
"$",
"uri",
"=",
"$",
"this",
"->... | initiate the login process
@see https://developer.foursquare.com/overview/auth.html
@throws \RuntimeException
@return mixed | [
"initiate",
"the",
"login",
"process"
] | edbfcba2993a101ead8f381394742a4689aec398 | https://github.com/chriswoodford/foursquare-php/blob/edbfcba2993a101ead8f381394742a4689aec398/lib/TheTwelve/Foursquare/AuthenticationGateway.php#L78-L90 |
16,169 | chriswoodford/foursquare-php | lib/TheTwelve/Foursquare/AuthenticationGateway.php | AuthenticationGateway.getAuthenticationUri | public function getAuthenticationUri()
{
if (!$this->canBuildAuthenticationUri()) {
throw new \RuntimeException(
'Cannot build authentication uri, dependencies are missing'
);
}
$uriParams = array(
'client_id' => $this->clientId,
... | php | public function getAuthenticationUri()
{
if (!$this->canBuildAuthenticationUri()) {
throw new \RuntimeException(
'Cannot build authentication uri, dependencies are missing'
);
}
$uriParams = array(
'client_id' => $this->clientId,
... | [
"public",
"function",
"getAuthenticationUri",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"canBuildAuthenticationUri",
"(",
")",
")",
"{",
"throw",
"new",
"\\",
"RuntimeException",
"(",
"'Cannot build authentication uri, dependencies are missing'",
")",
";",
"... | build the foursquare authentication uri that users are
forwarded to for authentication
@see https://developer.foursquare.com/overview/auth.html
@return string | [
"build",
"the",
"foursquare",
"authentication",
"uri",
"that",
"users",
"are",
"forwarded",
"to",
"for",
"authentication"
] | edbfcba2993a101ead8f381394742a4689aec398 | https://github.com/chriswoodford/foursquare-php/blob/edbfcba2993a101ead8f381394742a4689aec398/lib/TheTwelve/Foursquare/AuthenticationGateway.php#L98-L115 |
16,170 | chriswoodford/foursquare-php | lib/TheTwelve/Foursquare/AuthenticationGateway.php | AuthenticationGateway.authenticateUser | public function authenticateUser($code)
{
if (!$this->canAuthenticateUser()) {
throw new \RuntimeException(
'Cannot authenticate user, dependencies are missing'
);
}
if (!$this->codeIsValid($code)) {
throw new \InvalidArgumentException('Four... | php | public function authenticateUser($code)
{
if (!$this->canAuthenticateUser()) {
throw new \RuntimeException(
'Cannot authenticate user, dependencies are missing'
);
}
if (!$this->codeIsValid($code)) {
throw new \InvalidArgumentException('Four... | [
"public",
"function",
"authenticateUser",
"(",
"$",
"code",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"canAuthenticateUser",
"(",
")",
")",
"{",
"throw",
"new",
"\\",
"RuntimeException",
"(",
"'Cannot authenticate user, dependencies are missing'",
")",
";",
"... | authenticate the user with the response code
@see https://developer.foursquare.com/overview/auth.html
@param string $code
@throws \RuntimeException
@throws \InvalidArgumentException
@return string | [
"authenticate",
"the",
"user",
"with",
"the",
"response",
"code"
] | edbfcba2993a101ead8f381394742a4689aec398 | https://github.com/chriswoodford/foursquare-php/blob/edbfcba2993a101ead8f381394742a4689aec398/lib/TheTwelve/Foursquare/AuthenticationGateway.php#L125-L151 |
16,171 | cronario/cronario | src/Producer.php | Producer.cleanManagerSet | protected function cleanManagerSet()
{
foreach ($this->managerSet as $managerKey => $manager) {
/** @var $manager \Thread */
if (!$manager->isRunning()) {
$this->getLogger()->debug("Daemon clean old manager : {$managerKey}", [__NAMESPACE__]);
unset($t... | php | protected function cleanManagerSet()
{
foreach ($this->managerSet as $managerKey => $manager) {
/** @var $manager \Thread */
if (!$manager->isRunning()) {
$this->getLogger()->debug("Daemon clean old manager : {$managerKey}", [__NAMESPACE__]);
unset($t... | [
"protected",
"function",
"cleanManagerSet",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"managerSet",
"as",
"$",
"managerKey",
"=>",
"$",
"manager",
")",
"{",
"/** @var $manager \\Thread */",
"if",
"(",
"!",
"$",
"manager",
"->",
"isRunning",
"(",
")",... | Clean Manager SET
Checking each manager in ManagerSet and delete manager that done theirs work
@return $this | [
"Clean",
"Manager",
"SET"
] | 954df60e95efd3085269331d435e8ce6f4980441 | https://github.com/cronario/cronario/blob/954df60e95efd3085269331d435e8ce6f4980441/src/Producer.php#L428-L440 |
16,172 | cronario/cronario | src/Producer.php | Producer.updateManagerSet | protected function updateManagerSet()
{
$queueStatsServer = $this->getQueue()->getStats();
if (!isset($queueStatsServer[Queue::STATS_QUEUES]) || count($queueStatsServer[Queue::STATS_QUEUES]) == 0) {
return $this;
}
/**
* filter if queue not stopped
* f... | php | protected function updateManagerSet()
{
$queueStatsServer = $this->getQueue()->getStats();
if (!isset($queueStatsServer[Queue::STATS_QUEUES]) || count($queueStatsServer[Queue::STATS_QUEUES]) == 0) {
return $this;
}
/**
* filter if queue not stopped
* f... | [
"protected",
"function",
"updateManagerSet",
"(",
")",
"{",
"$",
"queueStatsServer",
"=",
"$",
"this",
"->",
"getQueue",
"(",
")",
"->",
"getStats",
"(",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"queueStatsServer",
"[",
"Queue",
"::",
"STATS_QUEUES",
... | Update Manager SET
REMEMBER queueName === workerClass (cause we have relation one queue name for one type of worker)
1) get Queue stats for all queues on server
2) filter queues (stopping flag / existing ready job in it)
3) get worker configuration (to know what manager balance should do later)
- if worker have probl... | [
"Update",
"Manager",
"SET"
] | 954df60e95efd3085269331d435e8ce6f4980441 | https://github.com/cronario/cronario/blob/954df60e95efd3085269331d435e8ce6f4980441/src/Producer.php#L456-L538 |
16,173 | WellCommerce/CoreBundle | Form/DataTransformer/AbstractDataTransformer.php | AbstractDataTransformer.getClassMetadata | protected function getClassMetadata(string $class): ClassMetadata
{
$factory = $this->getDoctrineHelper()->getMetadataFactory();
if (!$factory->hasMetadataFor($class)) {
throw new \InvalidArgumentException(sprintf('No metadata found for class "%s"', $class));
}
r... | php | protected function getClassMetadata(string $class): ClassMetadata
{
$factory = $this->getDoctrineHelper()->getMetadataFactory();
if (!$factory->hasMetadataFor($class)) {
throw new \InvalidArgumentException(sprintf('No metadata found for class "%s"', $class));
}
r... | [
"protected",
"function",
"getClassMetadata",
"(",
"string",
"$",
"class",
")",
":",
"ClassMetadata",
"{",
"$",
"factory",
"=",
"$",
"this",
"->",
"getDoctrineHelper",
"(",
")",
"->",
"getMetadataFactory",
"(",
")",
";",
"if",
"(",
"!",
"$",
"factory",
"->"... | Returns mapping information for class
@param string $class
@return ClassMetadata | [
"Returns",
"mapping",
"information",
"for",
"class"
] | 984fbd544d4b10cf11e54e0f3c304d100deb6842 | https://github.com/WellCommerce/CoreBundle/blob/984fbd544d4b10cf11e54e0f3c304d100deb6842/Form/DataTransformer/AbstractDataTransformer.php#L96-L104 |
16,174 | verschoof/bunq-api | src/Token/TokenType.php | TokenType.protect | private function protect()
{
if (!in_array($this->type, self::allAsString(), true)) {
throw new \InvalidArgumentException(sprintf('Invalid token type "%s"', $this->type));
}
} | php | private function protect()
{
if (!in_array($this->type, self::allAsString(), true)) {
throw new \InvalidArgumentException(sprintf('Invalid token type "%s"', $this->type));
}
} | [
"private",
"function",
"protect",
"(",
")",
"{",
"if",
"(",
"!",
"in_array",
"(",
"$",
"this",
"->",
"type",
",",
"self",
"::",
"allAsString",
"(",
")",
",",
"true",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"sprintf",
"(",
... | Check if the tokenType exists in our list | [
"Check",
"if",
"the",
"tokenType",
"exists",
"in",
"our",
"list"
] | df9aa19f384275f4f0deb26de0cb5e5f8b45ffcd | https://github.com/verschoof/bunq-api/blob/df9aa19f384275f4f0deb26de0cb5e5f8b45ffcd/src/Token/TokenType.php#L102-L107 |
16,175 | tonicospinelli/class-generation | src/ClassGeneration/ConstantCollection.php | ConstantCollection.add | public function add($constant)
{
if (!$constant instanceof ConstantInterface) {
throw new \InvalidArgumentException(
'This Constant must be a instance of \ClassGeneration\ConstantInterface'
);
}
if ($constant->getName() === null) {
$consta... | php | public function add($constant)
{
if (!$constant instanceof ConstantInterface) {
throw new \InvalidArgumentException(
'This Constant must be a instance of \ClassGeneration\ConstantInterface'
);
}
if ($constant->getName() === null) {
$consta... | [
"public",
"function",
"add",
"(",
"$",
"constant",
")",
"{",
"if",
"(",
"!",
"$",
"constant",
"instanceof",
"ConstantInterface",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"'This Constant must be a instance of \\ClassGeneration\\ConstantInterface'",
... | Adds a new Constant at ConstantCollection.
@param ConstantInterface $constant
@throws \InvalidArgumentException
@return bool | [
"Adds",
"a",
"new",
"Constant",
"at",
"ConstantCollection",
"."
] | eee63bdb68c066b25b885b57b23656e809381a76 | https://github.com/tonicospinelli/class-generation/blob/eee63bdb68c066b25b885b57b23656e809381a76/src/ClassGeneration/ConstantCollection.php#L31-L44 |
16,176 | tonicospinelli/class-generation | src/ClassGeneration/ConstantCollection.php | ConstantCollection.toString | public function toString()
{
$string = '';
$constants = $this->getIterator();
foreach ($constants as $constant) {
$string .= $constant->toString();
}
return $string;
} | php | public function toString()
{
$string = '';
$constants = $this->getIterator();
foreach ($constants as $constant) {
$string .= $constant->toString();
}
return $string;
} | [
"public",
"function",
"toString",
"(",
")",
"{",
"$",
"string",
"=",
"''",
";",
"$",
"constants",
"=",
"$",
"this",
"->",
"getIterator",
"(",
")",
";",
"foreach",
"(",
"$",
"constants",
"as",
"$",
"constant",
")",
"{",
"$",
"string",
".=",
"$",
"co... | Parse the Constant Collection to string.
@return string | [
"Parse",
"the",
"Constant",
"Collection",
"to",
"string",
"."
] | eee63bdb68c066b25b885b57b23656e809381a76 | https://github.com/tonicospinelli/class-generation/blob/eee63bdb68c066b25b885b57b23656e809381a76/src/ClassGeneration/ConstantCollection.php#L68-L77 |
16,177 | jan-dolata/crude-crud | src/Engine/CrudeSetupTrait/SelectOptions.php | SelectOptions.setSelectOptions | public function setSelectOptions($attr, $options = null)
{
$optionsList = is_array($attr)
? $attr
: [$attr => $options];
foreach ($optionsList as $key => $value)
$this->selectOptions[$key] = $value;
return $this;
} | php | public function setSelectOptions($attr, $options = null)
{
$optionsList = is_array($attr)
? $attr
: [$attr => $options];
foreach ($optionsList as $key => $value)
$this->selectOptions[$key] = $value;
return $this;
} | [
"public",
"function",
"setSelectOptions",
"(",
"$",
"attr",
",",
"$",
"options",
"=",
"null",
")",
"{",
"$",
"optionsList",
"=",
"is_array",
"(",
"$",
"attr",
")",
"?",
"$",
"attr",
":",
"[",
"$",
"attr",
"=>",
"$",
"options",
"]",
";",
"foreach",
... | Sets the Select options.
@param string|array $attr
@param array $options = null
@return self | [
"Sets",
"the",
"Select",
"options",
"."
] | 9129ea08278835cf5cecfd46a90369226ae6bdd7 | https://github.com/jan-dolata/crude-crud/blob/9129ea08278835cf5cecfd46a90369226ae6bdd7/src/Engine/CrudeSetupTrait/SelectOptions.php#L32-L42 |
16,178 | datasift/datasift-php | lib/DataSift/ODP.php | DataSift_ODP.ingest | public function ingest($data_set)
{
if (strlen($this->_source_id) == 0) {
throw new DataSift_Exception_InvalidData('Cannot make request without a source ID');
}
if (empty($data_set)) {
throw new DataSift_Exception_InvalidData('Cannot make request without a valid data... | php | public function ingest($data_set)
{
if (strlen($this->_source_id) == 0) {
throw new DataSift_Exception_InvalidData('Cannot make request without a source ID');
}
if (empty($data_set)) {
throw new DataSift_Exception_InvalidData('Cannot make request without a valid data... | [
"public",
"function",
"ingest",
"(",
"$",
"data_set",
")",
"{",
"if",
"(",
"strlen",
"(",
"$",
"this",
"->",
"_source_id",
")",
"==",
"0",
")",
"{",
"throw",
"new",
"DataSift_Exception_InvalidData",
"(",
"'Cannot make request without a source ID'",
")",
";",
"... | Generates a curl request to the Ingestion Endpoint | [
"Generates",
"a",
"curl",
"request",
"to",
"the",
"Ingestion",
"Endpoint"
] | 35282461ad3e54880e5940bb5afce26c75dc4bb9 | https://github.com/datasift/datasift-php/blob/35282461ad3e54880e5940bb5afce26c75dc4bb9/lib/DataSift/ODP.php#L67-L78 |
16,179 | JoffreyPoreeCoding/MongoDB-ODM | src/ObjectManager.php | ObjectManager.addObject | public function addObject($object, $state, $repository)
{
$data = $repository->getHydrator()->unhydrate($object);
$oid = spl_object_hash($object);
$id = isset($data['_id']) ? serialize($data['_id']) . $repository->getCollection() : $oid;
if (!isset($this->objectStates[$id])) {
... | php | public function addObject($object, $state, $repository)
{
$data = $repository->getHydrator()->unhydrate($object);
$oid = spl_object_hash($object);
$id = isset($data['_id']) ? serialize($data['_id']) . $repository->getCollection() : $oid;
if (!isset($this->objectStates[$id])) {
... | [
"public",
"function",
"addObject",
"(",
"$",
"object",
",",
"$",
"state",
",",
"$",
"repository",
")",
"{",
"$",
"data",
"=",
"$",
"repository",
"->",
"getHydrator",
"(",
")",
"->",
"unhydrate",
"(",
"$",
"object",
")",
";",
"$",
"oid",
"=",
"spl_obj... | Add an object
@param mixed $object Object to add
@param int $state State of this object
@return void | [
"Add",
"an",
"object"
] | 56fd7ab28c22f276573a89d56bb93c8d74ad7f74 | https://github.com/JoffreyPoreeCoding/MongoDB-ODM/blob/56fd7ab28c22f276573a89d56bb93c8d74ad7f74/src/ObjectManager.php#L43-L54 |
16,180 | JoffreyPoreeCoding/MongoDB-ODM | src/ObjectManager.php | ObjectManager.setObjectState | public function setObjectState($object, $state)
{
if (is_object($object)) {
$oid = spl_object_hash($object);
$repository = $this->objectsRepository[$oid];
$data = $repository->getHydrator()->unhydrate($object);
$id = isset($data['_id']) ? serialize($data['_id'... | php | public function setObjectState($object, $state)
{
if (is_object($object)) {
$oid = spl_object_hash($object);
$repository = $this->objectsRepository[$oid];
$data = $repository->getHydrator()->unhydrate($object);
$id = isset($data['_id']) ? serialize($data['_id'... | [
"public",
"function",
"setObjectState",
"(",
"$",
"object",
",",
"$",
"state",
")",
"{",
"if",
"(",
"is_object",
"(",
"$",
"object",
")",
")",
"{",
"$",
"oid",
"=",
"spl_object_hash",
"(",
"$",
"object",
")",
";",
"$",
"repository",
"=",
"$",
"this",... | Update object state
@param mixed $object Object to change state
@param int $state New state
@return void | [
"Update",
"object",
"state"
] | 56fd7ab28c22f276573a89d56bb93c8d74ad7f74 | https://github.com/JoffreyPoreeCoding/MongoDB-ODM/blob/56fd7ab28c22f276573a89d56bb93c8d74ad7f74/src/ObjectManager.php#L91-L123 |
16,181 | JoffreyPoreeCoding/MongoDB-ODM | src/ObjectManager.php | ObjectManager.getObjectState | public function getObjectState($object)
{
$oid = spl_object_hash($object);
if (isset($this->objectsRepository[$oid])) {
$repository = $this->objectsRepository[$oid];
$data = $repository->getHydrator()->unhydrate($object);
$id = isset($data['_id']) ? serialize($dat... | php | public function getObjectState($object)
{
$oid = spl_object_hash($object);
if (isset($this->objectsRepository[$oid])) {
$repository = $this->objectsRepository[$oid];
$data = $repository->getHydrator()->unhydrate($object);
$id = isset($data['_id']) ? serialize($dat... | [
"public",
"function",
"getObjectState",
"(",
"$",
"object",
")",
"{",
"$",
"oid",
"=",
"spl_object_hash",
"(",
"$",
"object",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"objectsRepository",
"[",
"$",
"oid",
"]",
")",
")",
"{",
"$",
"reposi... | Get object state
@param mixed $object
@return void | [
"Get",
"object",
"state"
] | 56fd7ab28c22f276573a89d56bb93c8d74ad7f74 | https://github.com/JoffreyPoreeCoding/MongoDB-ODM/blob/56fd7ab28c22f276573a89d56bb93c8d74ad7f74/src/ObjectManager.php#L131-L145 |
16,182 | JoffreyPoreeCoding/MongoDB-ODM | src/ObjectManager.php | ObjectManager.getObjects | public function getObjects($state = null)
{
if (!isset($state)) {
return $this->objects;
}
$objectList = [];
foreach ($this->objects as $id => $object) {
if ($this->objectStates[$id] == $state) {
$objectList[$id] = $object;
}
... | php | public function getObjects($state = null)
{
if (!isset($state)) {
return $this->objects;
}
$objectList = [];
foreach ($this->objects as $id => $object) {
if ($this->objectStates[$id] == $state) {
$objectList[$id] = $object;
}
... | [
"public",
"function",
"getObjects",
"(",
"$",
"state",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"state",
")",
")",
"{",
"return",
"$",
"this",
"->",
"objects",
";",
"}",
"$",
"objectList",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",... | Get object with specified state
@param int $state State to search
@return array | [
"Get",
"object",
"with",
"specified",
"state"
] | 56fd7ab28c22f276573a89d56bb93c8d74ad7f74 | https://github.com/JoffreyPoreeCoding/MongoDB-ODM/blob/56fd7ab28c22f276573a89d56bb93c8d74ad7f74/src/ObjectManager.php#L153-L167 |
16,183 | JoffreyPoreeCoding/MongoDB-ODM | src/ObjectManager.php | ObjectManager.hasObject | public function hasObject($object)
{
$oid = spl_object_hash($object);
if (!isset($this->objectsRepository[$oid])) {
return false;
}
$repository = $this->objectsRepository[$oid];
$data = $repository->getHydrator()->unhydrate($object);
$id = isset($data['_id... | php | public function hasObject($object)
{
$oid = spl_object_hash($object);
if (!isset($this->objectsRepository[$oid])) {
return false;
}
$repository = $this->objectsRepository[$oid];
$data = $repository->getHydrator()->unhydrate($object);
$id = isset($data['_id... | [
"public",
"function",
"hasObject",
"(",
"$",
"object",
")",
"{",
"$",
"oid",
"=",
"spl_object_hash",
"(",
"$",
"object",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"objectsRepository",
"[",
"$",
"oid",
"]",
")",
")",
"{",
"return",
... | Check if object is managed
@param mixed $object Object to search
@return boolean | [
"Check",
"if",
"object",
"is",
"managed"
] | 56fd7ab28c22f276573a89d56bb93c8d74ad7f74 | https://github.com/JoffreyPoreeCoding/MongoDB-ODM/blob/56fd7ab28c22f276573a89d56bb93c8d74ad7f74/src/ObjectManager.php#L188-L199 |
16,184 | phpalchemy/cerberus | src/Alchemy/Component/Cerberus/Model/Base/UserQuery.php | UserQuery.filterByRole | public function filterByRole($role, $comparison = Criteria::EQUAL)
{
return $this
->useUserRoleQuery()
->filterByRole($role, $comparison)
->endUse();
} | php | public function filterByRole($role, $comparison = Criteria::EQUAL)
{
return $this
->useUserRoleQuery()
->filterByRole($role, $comparison)
->endUse();
} | [
"public",
"function",
"filterByRole",
"(",
"$",
"role",
",",
"$",
"comparison",
"=",
"Criteria",
"::",
"EQUAL",
")",
"{",
"return",
"$",
"this",
"->",
"useUserRoleQuery",
"(",
")",
"->",
"filterByRole",
"(",
"$",
"role",
",",
"$",
"comparison",
")",
"->"... | Filter the query by a related Role object
using the user_role table as cross reference
@param Role $role the related object to use as filter
@param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
@return ChildUserQuery The current query, for fluid interface | [
"Filter",
"the",
"query",
"by",
"a",
"related",
"Role",
"object",
"using",
"the",
"user_role",
"table",
"as",
"cross",
"reference"
] | 3424a360c9bded71eb5b570bc114a7759cb23ec6 | https://github.com/phpalchemy/cerberus/blob/3424a360c9bded71eb5b570bc114a7759cb23ec6/src/Alchemy/Component/Cerberus/Model/Base/UserQuery.php#L605-L611 |
16,185 | sulu/SuluSalesShippingBundle | src/Sulu/Bundle/Sales/OrderBundle/Widgets/FlowOfDocuments.php | FlowOfDocuments.fetchDocumentData | protected function fetchDocumentData($options)
{
$documents = $this->dependencyManager->getDocuments($options['orderId'], $options['locale']);
if (!empty($documents)) {
/* @var SalesDocument $document */
foreach ($documents as $document) {
$data = $document->g... | php | protected function fetchDocumentData($options)
{
$documents = $this->dependencyManager->getDocuments($options['orderId'], $options['locale']);
if (!empty($documents)) {
/* @var SalesDocument $document */
foreach ($documents as $document) {
$data = $document->g... | [
"protected",
"function",
"fetchDocumentData",
"(",
"$",
"options",
")",
"{",
"$",
"documents",
"=",
"$",
"this",
"->",
"dependencyManager",
"->",
"getDocuments",
"(",
"$",
"options",
"[",
"'orderId'",
"]",
",",
"$",
"options",
"[",
"'locale'",
"]",
")",
";... | Retrieves document data for a specific order and adds it to the entries
@param $options
@throws \Sulu\Bundle\AdminBundle\Widgets\WidgetParameterException | [
"Retrieves",
"document",
"data",
"for",
"a",
"specific",
"order",
"and",
"adds",
"it",
"to",
"the",
"entries"
] | 0d39de262d58579e5679db99a77dbf717d600b5e | https://github.com/sulu/SuluSalesShippingBundle/blob/0d39de262d58579e5679db99a77dbf717d600b5e/src/Sulu/Bundle/Sales/OrderBundle/Widgets/FlowOfDocuments.php#L93-L110 |
16,186 | withfatpanda/illuminate-wordpress | src/WordPress/Plugin.php | Plugin.getInstance | static function getInstance($name = null)
{
if (empty($name)) {
$name = get_called_class();
}
if (!empty(static::$plugins[$name])) {
return static::$plugins[$name];
}
return false;
} | php | static function getInstance($name = null)
{
if (empty($name)) {
$name = get_called_class();
}
if (!empty(static::$plugins[$name])) {
return static::$plugins[$name];
}
return false;
} | [
"static",
"function",
"getInstance",
"(",
"$",
"name",
"=",
"null",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"name",
")",
")",
"{",
"$",
"name",
"=",
"get_called_class",
"(",
")",
";",
"}",
"if",
"(",
"!",
"empty",
"(",
"static",
"::",
"$",
"plugi... | Get the existing instance of this Plugin.
@param string Optionally, the name or classname of the Plugin to retrieve
@return Plugin instance if bootstrapped, otherwise false | [
"Get",
"the",
"existing",
"instance",
"of",
"this",
"Plugin",
"."
] | b426ca81a55367459430c974932ee5a941d759d8 | https://github.com/withfatpanda/illuminate-wordpress/blob/b426ca81a55367459430c974932ee5a941d759d8/src/WordPress/Plugin.php#L157-L166 |
16,187 | withfatpanda/illuminate-wordpress | src/WordPress/Plugin.php | Plugin.registerRequestBindings | protected function registerRequestBindings()
{
$this->singleton('Illuminate\Http\Request', function () {
// create a new request object
$request = Request::capture();
// create an arbitrary response object
$this->response = new Response;
// get a SessionManager from the container
... | php | protected function registerRequestBindings()
{
$this->singleton('Illuminate\Http\Request', function () {
// create a new request object
$request = Request::capture();
// create an arbitrary response object
$this->response = new Response;
// get a SessionManager from the container
... | [
"protected",
"function",
"registerRequestBindings",
"(",
")",
"{",
"$",
"this",
"->",
"singleton",
"(",
"'Illuminate\\Http\\Request'",
",",
"function",
"(",
")",
"{",
"// create a new request object",
"$",
"request",
"=",
"Request",
"::",
"capture",
"(",
")",
";",... | Register container bindings for the plugin.
@return void | [
"Register",
"container",
"bindings",
"for",
"the",
"plugin",
"."
] | b426ca81a55367459430c974932ee5a941d759d8 | https://github.com/withfatpanda/illuminate-wordpress/blob/b426ca81a55367459430c974932ee5a941d759d8/src/WordPress/Plugin.php#L244-L264 |
16,188 | withfatpanda/illuminate-wordpress | src/WordPress/Plugin.php | Plugin.bootstrap | static function bootstrap($bootstrap)
{
$basepath = realpath(dirname($bootstrap));
$fs = new Filesystem;
$pluginSrcFile = $basepath.'/src/plugin.php';
require_once $pluginSrcFile;
$source = $fs->get($pluginSrcFile);
$pluginClass = static::getFirstPluginClassName($source);
... | php | static function bootstrap($bootstrap)
{
$basepath = realpath(dirname($bootstrap));
$fs = new Filesystem;
$pluginSrcFile = $basepath.'/src/plugin.php';
require_once $pluginSrcFile;
$source = $fs->get($pluginSrcFile);
$pluginClass = static::getFirstPluginClassName($source);
... | [
"static",
"function",
"bootstrap",
"(",
"$",
"bootstrap",
")",
"{",
"$",
"basepath",
"=",
"realpath",
"(",
"dirname",
"(",
"$",
"bootstrap",
")",
")",
";",
"$",
"fs",
"=",
"new",
"Filesystem",
";",
"$",
"pluginSrcFile",
"=",
"$",
"basepath",
".",
"'/sr... | Bootstrap a plugin found in the given bootstrap file.
@param string The full path to a Plugin's bootstrap file
@return Plugin | [
"Bootstrap",
"a",
"plugin",
"found",
"in",
"the",
"given",
"bootstrap",
"file",
"."
] | b426ca81a55367459430c974932ee5a941d759d8 | https://github.com/withfatpanda/illuminate-wordpress/blob/b426ca81a55367459430c974932ee5a941d759d8/src/WordPress/Plugin.php#L538-L600 |
16,189 | withfatpanda/illuminate-wordpress | src/WordPress/Plugin.php | Plugin.getDefaultDatabaseConnectionConfig | protected function getDefaultDatabaseConnectionConfig()
{
global $table_prefix;
$default = [
'driver' => 'mysql',
'host' => getenv('DB_HOST'),
'port' => getenv('DB_PORT'),
'database' => getenv('DB_NAME'),
'username' => getenv('DB_USER'),
'password' => geten... | php | protected function getDefaultDatabaseConnectionConfig()
{
global $table_prefix;
$default = [
'driver' => 'mysql',
'host' => getenv('DB_HOST'),
'port' => getenv('DB_PORT'),
'database' => getenv('DB_NAME'),
'username' => getenv('DB_USER'),
'password' => geten... | [
"protected",
"function",
"getDefaultDatabaseConnectionConfig",
"(",
")",
"{",
"global",
"$",
"table_prefix",
";",
"$",
"default",
"=",
"[",
"'driver'",
"=>",
"'mysql'",
",",
"'host'",
"=>",
"getenv",
"(",
"'DB_HOST'",
")",
",",
"'port'",
"=>",
"getenv",
"(",
... | Try to load the database configuration from the environment first
using getenv; finding none, look to the traditional constants typically
defined in wp-config.php
@return array | [
"Try",
"to",
"load",
"the",
"database",
"configuration",
"from",
"the",
"environment",
"first",
"using",
"getenv",
";",
"finding",
"none",
"look",
"to",
"the",
"traditional",
"constants",
"typically",
"defined",
"in",
"wp",
"-",
"config",
".",
"php"
] | b426ca81a55367459430c974932ee5a941d759d8 | https://github.com/withfatpanda/illuminate-wordpress/blob/b426ca81a55367459430c974932ee5a941d759d8/src/WordPress/Plugin.php#L608-L655 |
16,190 | withfatpanda/illuminate-wordpress | src/WordPress/Plugin.php | Plugin.bootstrapContainer | protected function bootstrapContainer()
{
$this->instance('app', $this);
$this->instance('Illuminate\Container\Container', $this);
$this->instance('path', $this->path());
$this->configure('app');
$this->configure('scout');
$this->configure('services');
$this->configure('session');
$t... | php | protected function bootstrapContainer()
{
$this->instance('app', $this);
$this->instance('Illuminate\Container\Container', $this);
$this->instance('path', $this->path());
$this->configure('app');
$this->configure('scout');
$this->configure('services');
$this->configure('session');
$t... | [
"protected",
"function",
"bootstrapContainer",
"(",
")",
"{",
"$",
"this",
"->",
"instance",
"(",
"'app'",
",",
"$",
"this",
")",
";",
"$",
"this",
"->",
"instance",
"(",
"'Illuminate\\Container\\Container'",
",",
"$",
"this",
")",
";",
"$",
"this",
"->",
... | Bootstrap the plugin container.
@return void | [
"Bootstrap",
"the",
"plugin",
"container",
"."
] | b426ca81a55367459430c974932ee5a941d759d8 | https://github.com/withfatpanda/illuminate-wordpress/blob/b426ca81a55367459430c974932ee5a941d759d8/src/WordPress/Plugin.php#L662-L686 |
16,191 | withfatpanda/illuminate-wordpress | src/WordPress/Plugin.php | Plugin.storagePath | public function storagePath($path = null)
{
return WP_CONTENT_DIR . DIRECTORY_SEPARATOR . 'storage' . DIRECTORY_SEPARATOR . Str::slug($this->getNamespaceName()) . DIRECTORY_SEPARATOR . ( $path ? DIRECTORY_SEPARATOR . $path : $path );
} | php | public function storagePath($path = null)
{
return WP_CONTENT_DIR . DIRECTORY_SEPARATOR . 'storage' . DIRECTORY_SEPARATOR . Str::slug($this->getNamespaceName()) . DIRECTORY_SEPARATOR . ( $path ? DIRECTORY_SEPARATOR . $path : $path );
} | [
"public",
"function",
"storagePath",
"(",
"$",
"path",
"=",
"null",
")",
"{",
"return",
"WP_CONTENT_DIR",
".",
"DIRECTORY_SEPARATOR",
".",
"'storage'",
".",
"DIRECTORY_SEPARATOR",
".",
"Str",
"::",
"slug",
"(",
"$",
"this",
"->",
"getNamespaceName",
"(",
")",
... | Get the storage path for the plugin
@param string|null $path
@return string | [
"Get",
"the",
"storage",
"path",
"for",
"the",
"plugin"
] | b426ca81a55367459430c974932ee5a941d759d8 | https://github.com/withfatpanda/illuminate-wordpress/blob/b426ca81a55367459430c974932ee5a941d759d8/src/WordPress/Plugin.php#L747-L750 |
16,192 | withfatpanda/illuminate-wordpress | src/WordPress/Plugin.php | Plugin.register | public function register($provider, $options = [], $force = false)
{
if (is_string($provider) || is_class($provider)) {
$implements = class_implements($provider);
if (isset($implements['FatPanda\Illuminate\WordPress\Concerns\CustomSchema'])) {
$this->customSchema[] = $provider;
... | php | public function register($provider, $options = [], $force = false)
{
if (is_string($provider) || is_class($provider)) {
$implements = class_implements($provider);
if (isset($implements['FatPanda\Illuminate\WordPress\Concerns\CustomSchema'])) {
$this->customSchema[] = $provider;
... | [
"public",
"function",
"register",
"(",
"$",
"provider",
",",
"$",
"options",
"=",
"[",
"]",
",",
"$",
"force",
"=",
"false",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"provider",
")",
"||",
"is_class",
"(",
"$",
"provider",
")",
")",
"{",
"$",
... | Register a service provider or a CustomSchema with the plugin.
@param mixed $provider
@param array $options
@param bool $force
@return Plugin | [
"Register",
"a",
"service",
"provider",
"or",
"a",
"CustomSchema",
"with",
"the",
"plugin",
"."
] | b426ca81a55367459430c974932ee5a941d759d8 | https://github.com/withfatpanda/illuminate-wordpress/blob/b426ca81a55367459430c974932ee5a941d759d8/src/WordPress/Plugin.php#L998-L1034 |
16,193 | withfatpanda/illuminate-wordpress | src/WordPress/Plugin.php | Plugin.registerArtisanCommand | protected function registerArtisanCommand()
{
if (!class_exists('WP_CLI')) {
return false;
}
/**
* Run Laravel Artisan for this plugin
*/
\WP_CLI::add_command($this->getCLICommandName(), function() {
$args = [];
// rebuild args, because WP_CLI does stuff to it...
... | php | protected function registerArtisanCommand()
{
if (!class_exists('WP_CLI')) {
return false;
}
/**
* Run Laravel Artisan for this plugin
*/
\WP_CLI::add_command($this->getCLICommandName(), function() {
$args = [];
// rebuild args, because WP_CLI does stuff to it...
... | [
"protected",
"function",
"registerArtisanCommand",
"(",
")",
"{",
"if",
"(",
"!",
"class_exists",
"(",
"'WP_CLI'",
")",
")",
"{",
"return",
"false",
";",
"}",
"/**\n * Run Laravel Artisan for this plugin\n */",
"\\",
"WP_CLI",
"::",
"add_command",
"(",
"$",
... | Create a WP-CLI command for running Artisan. | [
"Create",
"a",
"WP",
"-",
"CLI",
"command",
"for",
"running",
"Artisan",
"."
] | b426ca81a55367459430c974932ee5a941d759d8 | https://github.com/withfatpanda/illuminate-wordpress/blob/b426ca81a55367459430c974932ee5a941d759d8/src/WordPress/Plugin.php#L1083-L1106 |
16,194 | withfatpanda/illuminate-wordpress | src/WordPress/Plugin.php | Plugin.registerRestRouter | protected function registerRestRouter()
{
$this->singleton('FatPanda\Illuminate\WordPress\Http\Router', function() {
// create the router
$router = new Router($this);
$router->setNamespace($this->getRestNamespace());
$router->setVersion($this->getRestVersion());
$router->setControlle... | php | protected function registerRestRouter()
{
$this->singleton('FatPanda\Illuminate\WordPress\Http\Router', function() {
// create the router
$router = new Router($this);
$router->setNamespace($this->getRestNamespace());
$router->setVersion($this->getRestVersion());
$router->setControlle... | [
"protected",
"function",
"registerRestRouter",
"(",
")",
"{",
"$",
"this",
"->",
"singleton",
"(",
"'FatPanda\\Illuminate\\WordPress\\Http\\Router'",
",",
"function",
"(",
")",
"{",
"// create the router",
"$",
"router",
"=",
"new",
"Router",
"(",
"$",
"this",
")"... | Create router instance and load routes | [
"Create",
"router",
"instance",
"and",
"load",
"routes"
] | b426ca81a55367459430c974932ee5a941d759d8 | https://github.com/withfatpanda/illuminate-wordpress/blob/b426ca81a55367459430c974932ee5a941d759d8/src/WordPress/Plugin.php#L1156-L1170 |
16,195 | FrenchFrogs/framework | src/Table/Table/Export.php | Export.toCsv | public function toCsv($filename = null)
{
// on set le nom du fichier
if (!is_null($filename)) {
$this->setFilename($filename);
}
// si pas de nom de fichier setté, on met celui par default
if (!$this->hasFilename()) {
$this->setFilename($this->filen... | php | public function toCsv($filename = null)
{
// on set le nom du fichier
if (!is_null($filename)) {
$this->setFilename($filename);
}
// si pas de nom de fichier setté, on met celui par default
if (!$this->hasFilename()) {
$this->setFilename($this->filen... | [
"public",
"function",
"toCsv",
"(",
"$",
"filename",
"=",
"null",
")",
"{",
"// on set le nom du fichier",
"if",
"(",
"!",
"is_null",
"(",
"$",
"filename",
")",
")",
"{",
"$",
"this",
"->",
"setFilename",
"(",
"$",
"filename",
")",
";",
"}",
"// si pas d... | Export dans un fichier CSV
@param $filename
@param bool $download
@return $this | [
"Export",
"dans",
"un",
"fichier",
"CSV"
] | a4838c698a5600437e87dac6d35ba8ebe32c4395 | https://github.com/FrenchFrogs/framework/blob/a4838c698a5600437e87dac6d35ba8ebe32c4395/src/Table/Table/Export.php#L119-L150 |
16,196 | Graphiques-Digitale/silverstripe-seo-metadata | code/SEO_Metadata_SiteTree_DataExtension.php | SEO_Metadata_SiteTree_DataExtension.getSEOFields | public function getSEOFields()
{
// Variables
$config = SiteConfig::current_site_config();
$SEO = [];
// Canonical
if ($config->CanonicalEnabled()) {
$SEO[] = ReadonlyField::create('ReadonlyMetaCanonical', 'link rel="canonical"', $this->owner->AbsoluteLink());
... | php | public function getSEOFields()
{
// Variables
$config = SiteConfig::current_site_config();
$SEO = [];
// Canonical
if ($config->CanonicalEnabled()) {
$SEO[] = ReadonlyField::create('ReadonlyMetaCanonical', 'link rel="canonical"', $this->owner->AbsoluteLink());
... | [
"public",
"function",
"getSEOFields",
"(",
")",
"{",
"// Variables",
"$",
"config",
"=",
"SiteConfig",
"::",
"current_site_config",
"(",
")",
";",
"$",
"SEO",
"=",
"[",
"]",
";",
"// Canonical",
"if",
"(",
"$",
"config",
"->",
"CanonicalEnabled",
"(",
")",... | Gets SEO fields.
@return array | [
"Gets",
"SEO",
"fields",
"."
] | f92128688a60b6c6b514b6efb1486ac60f4a8e03 | https://github.com/Graphiques-Digitale/silverstripe-seo-metadata/blob/f92128688a60b6c6b514b6efb1486ac60f4a8e03/code/SEO_Metadata_SiteTree_DataExtension.php#L51-L73 |
16,197 | Graphiques-Digitale/silverstripe-seo-metadata | code/SEO_Metadata_SiteTree_DataExtension.php | SEO_Metadata_SiteTree_DataExtension.getFullOutput | public function getFullOutput()
{
return array(
LiteralField::create('HeaderMetadata', '<pre class="bold">$Metadata()</pre>'),
LiteralField::create('LiteralMetadata', '<pre>' . nl2br(htmlentities(trim($this->owner->Metadata()), ENT_QUOTES)) . '</pre>')
);
} | php | public function getFullOutput()
{
return array(
LiteralField::create('HeaderMetadata', '<pre class="bold">$Metadata()</pre>'),
LiteralField::create('LiteralMetadata', '<pre>' . nl2br(htmlentities(trim($this->owner->Metadata()), ENT_QUOTES)) . '</pre>')
);
} | [
"public",
"function",
"getFullOutput",
"(",
")",
"{",
"return",
"array",
"(",
"LiteralField",
"::",
"create",
"(",
"'HeaderMetadata'",
",",
"'<pre class=\"bold\">$Metadata()</pre>'",
")",
",",
"LiteralField",
"::",
"create",
"(",
"'LiteralMetadata'",
",",
"'<pre>'",
... | Gets the full output.
@return array | [
"Gets",
"the",
"full",
"output",
"."
] | f92128688a60b6c6b514b6efb1486ac60f4a8e03 | https://github.com/Graphiques-Digitale/silverstripe-seo-metadata/blob/f92128688a60b6c6b514b6efb1486ac60f4a8e03/code/SEO_Metadata_SiteTree_DataExtension.php#L80-L86 |
16,198 | Graphiques-Digitale/silverstripe-seo-metadata | code/SEO_Metadata_SiteTree_DataExtension.php | SEO_Metadata_SiteTree_DataExtension.Metadata | public function Metadata()
{
// variables
$config = SiteConfig::current_site_config();
// begin SEO
$metadata = PHP_EOL . $this->owner->MarkupComment('SEO');
// register extension update hook
$this->owner->extend('updateMetadata', $config, $this->owner, $metadata);
... | php | public function Metadata()
{
// variables
$config = SiteConfig::current_site_config();
// begin SEO
$metadata = PHP_EOL . $this->owner->MarkupComment('SEO');
// register extension update hook
$this->owner->extend('updateMetadata', $config, $this->owner, $metadata);
... | [
"public",
"function",
"Metadata",
"(",
")",
"{",
"// variables",
"$",
"config",
"=",
"SiteConfig",
"::",
"current_site_config",
"(",
")",
";",
"// begin SEO",
"$",
"metadata",
"=",
"PHP_EOL",
".",
"$",
"this",
"->",
"owner",
"->",
"MarkupComment",
"(",
"'SEO... | Main function to format & output metadata as an HTML string.
Use the `updateMetadata($config, $owner, $metadata)` update hook when extending `DataExtension`s.
@return string | [
"Main",
"function",
"to",
"format",
"&",
"output",
"metadata",
"as",
"an",
"HTML",
"string",
"."
] | f92128688a60b6c6b514b6efb1486ac60f4a8e03 | https://github.com/Graphiques-Digitale/silverstripe-seo-metadata/blob/f92128688a60b6c6b514b6efb1486ac60f4a8e03/code/SEO_Metadata_SiteTree_DataExtension.php#L95-L107 |
16,199 | Graphiques-Digitale/silverstripe-seo-metadata | code/SEO_Metadata_SiteTree_DataExtension.php | SEO_Metadata_SiteTree_DataExtension.updateMetadata | public function updateMetadata(SiteConfig $config, SiteTree $owner, &$metadata)
{
// metadata
$metadata .= $owner->MarkupComment('Metadata');
// charset
if ($config->CharsetEnabled()) {
$metadata .= '<meta charset="' . $config->Charset() . '" />' . PHP_EOL;
}
... | php | public function updateMetadata(SiteConfig $config, SiteTree $owner, &$metadata)
{
// metadata
$metadata .= $owner->MarkupComment('Metadata');
// charset
if ($config->CharsetEnabled()) {
$metadata .= '<meta charset="' . $config->Charset() . '" />' . PHP_EOL;
}
... | [
"public",
"function",
"updateMetadata",
"(",
"SiteConfig",
"$",
"config",
",",
"SiteTree",
"$",
"owner",
",",
"&",
"$",
"metadata",
")",
"{",
"// metadata",
"$",
"metadata",
".=",
"$",
"owner",
"->",
"MarkupComment",
"(",
"'Metadata'",
")",
";",
"// charset"... | Updates metadata fields.
@param SiteConfig $config
@param SiteTree $owner
@param string $metadata
@return void | [
"Updates",
"metadata",
"fields",
"."
] | f92128688a60b6c6b514b6efb1486ac60f4a8e03 | https://github.com/Graphiques-Digitale/silverstripe-seo-metadata/blob/f92128688a60b6c6b514b6efb1486ac60f4a8e03/code/SEO_Metadata_SiteTree_DataExtension.php#L122-L147 |
Subsets and Splits
Yii Code Samples
Gathers all records from test, train, and validation sets that contain the word 'yii', providing a basic filtered view of the dataset relevant to Yii-related content.