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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
222,700 | basarevych/dynamic-table | php/DynamicTable/Table.php | Table.fetch | public function fetch()
{
$adapter = $this->getAdapter();
if (!$adapter)
throw new \Exception("Adapter property is not set");
$adapter->check($this);
$adapter->filter($this);
$adapter->sort($this);
$result = $adapter->paginate($this);
$filters = ... | php | public function fetch()
{
$adapter = $this->getAdapter();
if (!$adapter)
throw new \Exception("Adapter property is not set");
$adapter->check($this);
$adapter->filter($this);
$adapter->sort($this);
$result = $adapter->paginate($this);
$filters = ... | [
"public",
"function",
"fetch",
"(",
")",
"{",
"$",
"adapter",
"=",
"$",
"this",
"->",
"getAdapter",
"(",
")",
";",
"if",
"(",
"!",
"$",
"adapter",
")",
"throw",
"new",
"\\",
"Exception",
"(",
"\"Adapter property is not set\"",
")",
";",
"$",
"adapter",
... | Fetch data and feed it to front-end
@return array | [
"Fetch",
"data",
"and",
"feed",
"it",
"to",
"front",
"-",
"end"
] | 227eafab0d4dafabe0d2ceaa881ab3befe994d9c | https://github.com/basarevych/dynamic-table/blob/227eafab0d4dafabe0d2ceaa881ab3befe994d9c/php/DynamicTable/Table.php#L472-L493 |
222,701 | basarevych/dynamic-table | php/DynamicTable/Table.php | Table.getAvailableTypes | public static function getAvailableTypes()
{
return [
self::TYPE_STRING,
self::TYPE_INTEGER,
self::TYPE_FLOAT,
self::TYPE_BOOLEAN,
self::TYPE_DATETIME,
];
} | php | public static function getAvailableTypes()
{
return [
self::TYPE_STRING,
self::TYPE_INTEGER,
self::TYPE_FLOAT,
self::TYPE_BOOLEAN,
self::TYPE_DATETIME,
];
} | [
"public",
"static",
"function",
"getAvailableTypes",
"(",
")",
"{",
"return",
"[",
"self",
"::",
"TYPE_STRING",
",",
"self",
"::",
"TYPE_INTEGER",
",",
"self",
"::",
"TYPE_FLOAT",
",",
"self",
"::",
"TYPE_BOOLEAN",
",",
"self",
"::",
"TYPE_DATETIME",
",",
"]... | List column types
@return array | [
"List",
"column",
"types"
] | 227eafab0d4dafabe0d2ceaa881ab3befe994d9c | https://github.com/basarevych/dynamic-table/blob/227eafab0d4dafabe0d2ceaa881ab3befe994d9c/php/DynamicTable/Table.php#L500-L509 |
222,702 | EcomDev/EcomDev_Varnish | src/app/code/community/EcomDev/Varnish/Helper/Data.php | EcomDev_Varnish_Helper_Data.getAjaxReloadUrl | public function getAjaxReloadUrl()
{
if ($this->_ajaxReloadUrl === null) {
$this->_ajaxReloadUrl = $this->_getUrl('varnish/ajax/reload', array(
'_secure' => Mage::app()->getStore()->isCurrentlySecure()
));
}
return $this->_ajaxReloadUrl;
} | php | public function getAjaxReloadUrl()
{
if ($this->_ajaxReloadUrl === null) {
$this->_ajaxReloadUrl = $this->_getUrl('varnish/ajax/reload', array(
'_secure' => Mage::app()->getStore()->isCurrentlySecure()
));
}
return $this->_ajaxReloadUrl;
} | [
"public",
"function",
"getAjaxReloadUrl",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_ajaxReloadUrl",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"_ajaxReloadUrl",
"=",
"$",
"this",
"->",
"_getUrl",
"(",
"'varnish/ajax/reload'",
",",
"array",
"(",
"'_se... | Returns a url for reloading
@return string | [
"Returns",
"a",
"url",
"for",
"reloading"
] | 228b7b1bdaae15c1895f2533667fffa515447915 | https://github.com/EcomDev/EcomDev_Varnish/blob/228b7b1bdaae15c1895f2533667fffa515447915/src/app/code/community/EcomDev/Varnish/Helper/Data.php#L137-L146 |
222,703 | EcomDev/EcomDev_Varnish | src/app/code/community/EcomDev/Varnish/Helper/Data.php | EcomDev_Varnish_Helper_Data._initDefaultVarnishHeaders | protected function _initDefaultVarnishHeaders($withoutTags)
{
// Add TTL header if any of them have been specified
if (!$withoutTags && $this->_ttlList) {
$this->setVarnishHeader(self::HEADER_TTL, min($this->_ttlList) . 's');
}
// Add object tags header only if it is not... | php | protected function _initDefaultVarnishHeaders($withoutTags)
{
// Add TTL header if any of them have been specified
if (!$withoutTags && $this->_ttlList) {
$this->setVarnishHeader(self::HEADER_TTL, min($this->_ttlList) . 's');
}
// Add object tags header only if it is not... | [
"protected",
"function",
"_initDefaultVarnishHeaders",
"(",
"$",
"withoutTags",
")",
"{",
"// Add TTL header if any of them have been specified",
"if",
"(",
"!",
"$",
"withoutTags",
"&&",
"$",
"this",
"->",
"_ttlList",
")",
"{",
"$",
"this",
"->",
"setVarnishHeader",
... | Init default varnish headers
@return $this | [
"Init",
"default",
"varnish",
"headers"
] | 228b7b1bdaae15c1895f2533667fffa515447915 | https://github.com/EcomDev/EcomDev_Varnish/blob/228b7b1bdaae15c1895f2533667fffa515447915/src/app/code/community/EcomDev/Varnish/Helper/Data.php#L163-L209 |
222,704 | EcomDev/EcomDev_Varnish | src/app/code/community/EcomDev/Varnish/Helper/Data.php | EcomDev_Varnish_Helper_Data.getCurrentPageInfo | public function getCurrentPageInfo()
{
$result = array(
'handle' => $this->getCurrentPage()
);
if (Mage::registry('current_category') instanceof Mage_Catalog_Model_Category) {
$result['category'] = Mage::registry('current_category')->getId();
}
... | php | public function getCurrentPageInfo()
{
$result = array(
'handle' => $this->getCurrentPage()
);
if (Mage::registry('current_category') instanceof Mage_Catalog_Model_Category) {
$result['category'] = Mage::registry('current_category')->getId();
}
... | [
"public",
"function",
"getCurrentPageInfo",
"(",
")",
"{",
"$",
"result",
"=",
"array",
"(",
"'handle'",
"=>",
"$",
"this",
"->",
"getCurrentPage",
"(",
")",
")",
";",
"if",
"(",
"Mage",
"::",
"registry",
"(",
"'current_category'",
")",
"instanceof",
"Mage... | Returns current page info | [
"Returns",
"current",
"page",
"info"
] | 228b7b1bdaae15c1895f2533667fffa515447915 | https://github.com/EcomDev/EcomDev_Varnish/blob/228b7b1bdaae15c1895f2533667fffa515447915/src/app/code/community/EcomDev/Varnish/Helper/Data.php#L216-L231 |
222,705 | EcomDev/EcomDev_Varnish | src/app/code/community/EcomDev/Varnish/Helper/Data.php | EcomDev_Varnish_Helper_Data.addVarnishHeader | public function addVarnishHeader($name, $value)
{
$header = $value;
if ($this->hasVarnishHeader($name)) {
$header = $this->getVarnishHeader($name);
if (!is_array($header)) {
$header = array($header);
}
... | php | public function addVarnishHeader($name, $value)
{
$header = $value;
if ($this->hasVarnishHeader($name)) {
$header = $this->getVarnishHeader($name);
if (!is_array($header)) {
$header = array($header);
}
... | [
"public",
"function",
"addVarnishHeader",
"(",
"$",
"name",
",",
"$",
"value",
")",
"{",
"$",
"header",
"=",
"$",
"value",
";",
"if",
"(",
"$",
"this",
"->",
"hasVarnishHeader",
"(",
"$",
"name",
")",
")",
"{",
"$",
"header",
"=",
"$",
"this",
"->"... | Adds varnish header
@param string $name
@param string $value
@return $this | [
"Adds",
"varnish",
"header"
] | 228b7b1bdaae15c1895f2533667fffa515447915 | https://github.com/EcomDev/EcomDev_Varnish/blob/228b7b1bdaae15c1895f2533667fffa515447915/src/app/code/community/EcomDev/Varnish/Helper/Data.php#L307-L324 |
222,706 | EcomDev/EcomDev_Varnish | src/app/code/community/EcomDev/Varnish/Helper/Data.php | EcomDev_Varnish_Helper_Data._initAllowedPages | protected function _initAllowedPages()
{
if ($this->_allowedPages === null) {
$this->_allowedPages = array();
foreach (Mage::getConfig()->getNode(self::XML_PATH_ALLOWED_PAGES)->children() as $page => $info) {
$module = ($info->getAttribute('module') ? $in... | php | protected function _initAllowedPages()
{
if ($this->_allowedPages === null) {
$this->_allowedPages = array();
foreach (Mage::getConfig()->getNode(self::XML_PATH_ALLOWED_PAGES)->children() as $page => $info) {
$module = ($info->getAttribute('module') ? $in... | [
"protected",
"function",
"_initAllowedPages",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_allowedPages",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"_allowedPages",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"Mage",
"::",
"getConfig",
"(",
")",
"... | Init allowed pages from configuration
@return $this | [
"Init",
"allowed",
"pages",
"from",
"configuration"
] | 228b7b1bdaae15c1895f2533667fffa515447915 | https://github.com/EcomDev/EcomDev_Varnish/blob/228b7b1bdaae15c1895f2533667fffa515447915/src/app/code/community/EcomDev/Varnish/Helper/Data.php#L473-L485 |
222,707 | EcomDev/EcomDev_Varnish | src/app/code/community/EcomDev/Varnish/Helper/Data.php | EcomDev_Varnish_Helper_Data.isAllowedCurrentPage | public function isAllowedCurrentPage()
{
if (!$this->isActive()) {
return false;
}
$this->_initAllowedPages();
if (!$this->getCurrentPage()) {
return false;
}
return isset($this->_allowedPages[$this->getCurrentPage()]);
} | php | public function isAllowedCurrentPage()
{
if (!$this->isActive()) {
return false;
}
$this->_initAllowedPages();
if (!$this->getCurrentPage()) {
return false;
}
return isset($this->_allowedPages[$this->getCurrentPage()]);
} | [
"public",
"function",
"isAllowedCurrentPage",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"isActive",
"(",
")",
")",
"{",
"return",
"false",
";",
"}",
"$",
"this",
"->",
"_initAllowedPages",
"(",
")",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"... | Checks if current page is not allowed for varnish cache
@return bool | [
"Checks",
"if",
"current",
"page",
"is",
"not",
"allowed",
"for",
"varnish",
"cache"
] | 228b7b1bdaae15c1895f2533667fffa515447915 | https://github.com/EcomDev/EcomDev_Varnish/blob/228b7b1bdaae15c1895f2533667fffa515447915/src/app/code/community/EcomDev/Varnish/Helper/Data.php#L503-L516 |
222,708 | EcomDev/EcomDev_Varnish | src/app/code/community/EcomDev/Varnish/Helper/Data.php | EcomDev_Varnish_Helper_Data.getCurrentPageTtl | public function getCurrentPageTtl()
{
if ($this->getCurrentPage()) {
$cacheTtl = (int)Mage::getStoreConfig(sprintf(self::XML_PATH_PAGE_TTL, $this->getCurrentPage()));
if ($cacheTtl) {
return $cacheTtl*60;
}
}
return false;
} | php | public function getCurrentPageTtl()
{
if ($this->getCurrentPage()) {
$cacheTtl = (int)Mage::getStoreConfig(sprintf(self::XML_PATH_PAGE_TTL, $this->getCurrentPage()));
if ($cacheTtl) {
return $cacheTtl*60;
}
}
return false;
} | [
"public",
"function",
"getCurrentPageTtl",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"getCurrentPage",
"(",
")",
")",
"{",
"$",
"cacheTtl",
"=",
"(",
"int",
")",
"Mage",
"::",
"getStoreConfig",
"(",
"sprintf",
"(",
"self",
"::",
"XML_PATH_PAGE_TTL",
"... | Returns current page TTL in seconds
@return bool|int | [
"Returns",
"current",
"page",
"TTL",
"in",
"seconds"
] | 228b7b1bdaae15c1895f2533667fffa515447915 | https://github.com/EcomDev/EcomDev_Varnish/blob/228b7b1bdaae15c1895f2533667fffa515447915/src/app/code/community/EcomDev/Varnish/Helper/Data.php#L545-L555 |
222,709 | EcomDev/EcomDev_Varnish | src/app/code/community/EcomDev/Varnish/Helper/Data.php | EcomDev_Varnish_Helper_Data.getCustomerSegment | public function getCustomerSegment()
{
$segment = new Varien_Object();
$segmentValues = $this->_getSegmentValues();
foreach ($segmentValues as $field => $configCallbackPair) {
if (is_array($configCallbackPair) && Mage::getStoreConfigFlag($configCallbackPair[0])) {
... | php | public function getCustomerSegment()
{
$segment = new Varien_Object();
$segmentValues = $this->_getSegmentValues();
foreach ($segmentValues as $field => $configCallbackPair) {
if (is_array($configCallbackPair) && Mage::getStoreConfigFlag($configCallbackPair[0])) {
... | [
"public",
"function",
"getCustomerSegment",
"(",
")",
"{",
"$",
"segment",
"=",
"new",
"Varien_Object",
"(",
")",
";",
"$",
"segmentValues",
"=",
"$",
"this",
"->",
"_getSegmentValues",
"(",
")",
";",
"foreach",
"(",
"$",
"segmentValues",
"as",
"$",
"field... | Returns customer segment data, used as cache segment
@return string[] | [
"Returns",
"customer",
"segment",
"data",
"used",
"as",
"cache",
"segment"
] | 228b7b1bdaae15c1895f2533667fffa515447915 | https://github.com/EcomDev/EcomDev_Varnish/blob/228b7b1bdaae15c1895f2533667fffa515447915/src/app/code/community/EcomDev/Varnish/Helper/Data.php#L605-L622 |
222,710 | EcomDev/EcomDev_Varnish | src/app/code/community/EcomDev/Varnish/Helper/Data.php | EcomDev_Varnish_Helper_Data._getSegmentValues | protected function _getSegmentValues()
{
return array(
'customer_group_id' => array(self::XML_PATH_SEGMENT_CUSTOMER_GROUP, function () {
return $this->_noSessionCall ? 0 : Mage::getSingleton('customer/session')->getCustomerGroupId();
}),
'store_id' => arra... | php | protected function _getSegmentValues()
{
return array(
'customer_group_id' => array(self::XML_PATH_SEGMENT_CUSTOMER_GROUP, function () {
return $this->_noSessionCall ? 0 : Mage::getSingleton('customer/session')->getCustomerGroupId();
}),
'store_id' => arra... | [
"protected",
"function",
"_getSegmentValues",
"(",
")",
"{",
"return",
"array",
"(",
"'customer_group_id'",
"=>",
"array",
"(",
"self",
"::",
"XML_PATH_SEGMENT_CUSTOMER_GROUP",
",",
"function",
"(",
")",
"{",
"return",
"$",
"this",
"->",
"_noSessionCall",
"?",
"... | Returns list of segment values callbacks
If array key is a string, than value added directly
@return array | [
"Returns",
"list",
"of",
"segment",
"values",
"callbacks"
] | 228b7b1bdaae15c1895f2533667fffa515447915 | https://github.com/EcomDev/EcomDev_Varnish/blob/228b7b1bdaae15c1895f2533667fffa515447915/src/app/code/community/EcomDev/Varnish/Helper/Data.php#L631-L644 |
222,711 | EcomDev/EcomDev_Varnish | src/app/code/community/EcomDev/Varnish/Helper/Data.php | EcomDev_Varnish_Helper_Data.hashData | public function hashData($hashData, $addDeviceType = true)
{
if (is_array($hashData)) {
$hashData = json_encode($hashData);
}
if ($addDeviceType) {
// Add device type
$hashData .= $this->_getRequest()->getServer('HTTP_X_UA_DEVICE');
}
ret... | php | public function hashData($hashData, $addDeviceType = true)
{
if (is_array($hashData)) {
$hashData = json_encode($hashData);
}
if ($addDeviceType) {
// Add device type
$hashData .= $this->_getRequest()->getServer('HTTP_X_UA_DEVICE');
}
ret... | [
"public",
"function",
"hashData",
"(",
"$",
"hashData",
",",
"$",
"addDeviceType",
"=",
"true",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"hashData",
")",
")",
"{",
"$",
"hashData",
"=",
"json_encode",
"(",
"$",
"hashData",
")",
";",
"}",
"if",
"(",... | Hashes data for varnish
@param string $hashData
@param bool $addDeviceType
@return string | [
"Hashes",
"data",
"for",
"varnish"
] | 228b7b1bdaae15c1895f2533667fffa515447915 | https://github.com/EcomDev/EcomDev_Varnish/blob/228b7b1bdaae15c1895f2533667fffa515447915/src/app/code/community/EcomDev/Varnish/Helper/Data.php#L653-L665 |
222,712 | EcomDev/EcomDev_Varnish | src/app/code/community/EcomDev/Varnish/Helper/Data.php | EcomDev_Varnish_Helper_Data.cachedHelperCall | public function cachedHelperCall($helper, $method, $cachedValue, $args = array())
{
if ($this->isActive() && !$this->getIsInternal()) {
return $cachedValue;
}
$helper = Mage::helper($helper);
if (!empty($args)) {
return call_user_func_array(a... | php | public function cachedHelperCall($helper, $method, $cachedValue, $args = array())
{
if ($this->isActive() && !$this->getIsInternal()) {
return $cachedValue;
}
$helper = Mage::helper($helper);
if (!empty($args)) {
return call_user_func_array(a... | [
"public",
"function",
"cachedHelperCall",
"(",
"$",
"helper",
",",
"$",
"method",
",",
"$",
"cachedValue",
",",
"$",
"args",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isActive",
"(",
")",
"&&",
"!",
"$",
"this",
"->",
"getIsI... | Calls a helper depending on internal level of cache of the page
@param string $helper
@param string $method
@param mixed $cachedValue
@param array $args
@return mixed | [
"Calls",
"a",
"helper",
"depending",
"on",
"internal",
"level",
"of",
"cache",
"of",
"the",
"page"
] | 228b7b1bdaae15c1895f2533667fffa515447915 | https://github.com/EcomDev/EcomDev_Varnish/blob/228b7b1bdaae15c1895f2533667fffa515447915/src/app/code/community/EcomDev/Varnish/Helper/Data.php#L676-L689 |
222,713 | EcomDev/EcomDev_Varnish | src/app/code/community/EcomDev/Varnish/Helper/Data.php | EcomDev_Varnish_Helper_Data.getChecksum | public function getChecksum($data)
{
$data['salt'] = $this->getEsiKey();
ksort($data);
return md5(json_encode($data));
} | php | public function getChecksum($data)
{
$data['salt'] = $this->getEsiKey();
ksort($data);
return md5(json_encode($data));
} | [
"public",
"function",
"getChecksum",
"(",
"$",
"data",
")",
"{",
"$",
"data",
"[",
"'salt'",
"]",
"=",
"$",
"this",
"->",
"getEsiKey",
"(",
")",
";",
"ksort",
"(",
"$",
"data",
")",
";",
"return",
"md5",
"(",
"json_encode",
"(",
"$",
"data",
")",
... | Returns checksum for supplied data array
@param array $data
@return string | [
"Returns",
"checksum",
"for",
"supplied",
"data",
"array"
] | 228b7b1bdaae15c1895f2533667fffa515447915 | https://github.com/EcomDev/EcomDev_Varnish/blob/228b7b1bdaae15c1895f2533667fffa515447915/src/app/code/community/EcomDev/Varnish/Helper/Data.php#L697-L702 |
222,714 | EcomDev/EcomDev_Varnish | src/app/code/community/EcomDev/Varnish/Helper/Data.php | EcomDev_Varnish_Helper_Data.validateChecksum | public function validateChecksum($data)
{
if (!isset($data['checksum']) || !$this->getEsiKey()) {
return false;
}
$suppliedChecksum = $data['checksum'];
unset($data['checksum']);
return $suppliedChecksum === $this->getChecksum($data);
} | php | public function validateChecksum($data)
{
if (!isset($data['checksum']) || !$this->getEsiKey()) {
return false;
}
$suppliedChecksum = $data['checksum'];
unset($data['checksum']);
return $suppliedChecksum === $this->getChecksum($data);
} | [
"public",
"function",
"validateChecksum",
"(",
"$",
"data",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"data",
"[",
"'checksum'",
"]",
")",
"||",
"!",
"$",
"this",
"->",
"getEsiKey",
"(",
")",
")",
"{",
"return",
"false",
";",
"}",
"$",
"supplied... | Validates checksum of esi request
@param array $data
@return bool | [
"Validates",
"checksum",
"of",
"esi",
"request"
] | 228b7b1bdaae15c1895f2533667fffa515447915 | https://github.com/EcomDev/EcomDev_Varnish/blob/228b7b1bdaae15c1895f2533667fffa515447915/src/app/code/community/EcomDev/Varnish/Helper/Data.php#L710-L719 |
222,715 | EcomDev/EcomDev_Varnish | src/app/code/community/EcomDev/Varnish/Helper/Data.php | EcomDev_Varnish_Helper_Data.generateToken | public function generateToken()
{
$token = Mage::helper('core')->getRandomString(16);
$this->addCookie(self::COOKIE_TOKEN, $token);
$this->addCookie(self::COOKIE_TOKEN_CHECKSUM, $this->getChecksum(array('token' => $token)));
return $this;
} | php | public function generateToken()
{
$token = Mage::helper('core')->getRandomString(16);
$this->addCookie(self::COOKIE_TOKEN, $token);
$this->addCookie(self::COOKIE_TOKEN_CHECKSUM, $this->getChecksum(array('token' => $token)));
return $this;
} | [
"public",
"function",
"generateToken",
"(",
")",
"{",
"$",
"token",
"=",
"Mage",
"::",
"helper",
"(",
"'core'",
")",
"->",
"getRandomString",
"(",
"16",
")",
";",
"$",
"this",
"->",
"addCookie",
"(",
"self",
"::",
"COOKIE_TOKEN",
",",
"$",
"token",
")"... | Generates CSRF token for a user
@return $this | [
"Generates",
"CSRF",
"token",
"for",
"a",
"user"
] | 228b7b1bdaae15c1895f2533667fffa515447915 | https://github.com/EcomDev/EcomDev_Varnish/blob/228b7b1bdaae15c1895f2533667fffa515447915/src/app/code/community/EcomDev/Varnish/Helper/Data.php#L726-L732 |
222,716 | EcomDev/EcomDev_Varnish | src/app/code/community/EcomDev/Varnish/Helper/Data.php | EcomDev_Varnish_Helper_Data.validateToken | public function validateToken($token)
{
$tokenChecksum = Mage::getSingleton('ecomdev_varnish/cookie')->get(self::COOKIE_TOKEN_CHECKSUM);
if ($tokenChecksum === $this->getChecksum(array('token' => $token))) {
return true;
}
return false;
} | php | public function validateToken($token)
{
$tokenChecksum = Mage::getSingleton('ecomdev_varnish/cookie')->get(self::COOKIE_TOKEN_CHECKSUM);
if ($tokenChecksum === $this->getChecksum(array('token' => $token))) {
return true;
}
return false;
} | [
"public",
"function",
"validateToken",
"(",
"$",
"token",
")",
"{",
"$",
"tokenChecksum",
"=",
"Mage",
"::",
"getSingleton",
"(",
"'ecomdev_varnish/cookie'",
")",
"->",
"get",
"(",
"self",
"::",
"COOKIE_TOKEN_CHECKSUM",
")",
";",
"if",
"(",
"$",
"tokenChecksum... | Validates a token value
@param string $token
@return bool | [
"Validates",
"a",
"token",
"value"
] | 228b7b1bdaae15c1895f2533667fffa515447915 | https://github.com/EcomDev/EcomDev_Varnish/blob/228b7b1bdaae15c1895f2533667fffa515447915/src/app/code/community/EcomDev/Varnish/Helper/Data.php#L740-L748 |
222,717 | EcomDev/EcomDev_Varnish | src/app/code/community/EcomDev/Varnish/Model/Cookie.php | EcomDev_Varnish_Model_Cookie.set | public function set($cookie, $value, $httpOnly = false)
{
$this->_cookies[$cookie] = array('value' => $value, 'http_only' => $httpOnly);
return $this;
} | php | public function set($cookie, $value, $httpOnly = false)
{
$this->_cookies[$cookie] = array('value' => $value, 'http_only' => $httpOnly);
return $this;
} | [
"public",
"function",
"set",
"(",
"$",
"cookie",
",",
"$",
"value",
",",
"$",
"httpOnly",
"=",
"false",
")",
"{",
"$",
"this",
"->",
"_cookies",
"[",
"$",
"cookie",
"]",
"=",
"array",
"(",
"'value'",
"=>",
"$",
"value",
",",
"'http_only'",
"=>",
"$... | Stores a cookie for scheduled set cookie calls
@param string $cookie
@param string $value
@param bool $httpOnly
@return $this | [
"Stores",
"a",
"cookie",
"for",
"scheduled",
"set",
"cookie",
"calls"
] | 228b7b1bdaae15c1895f2533667fffa515447915 | https://github.com/EcomDev/EcomDev_Varnish/blob/228b7b1bdaae15c1895f2533667fffa515447915/src/app/code/community/EcomDev/Varnish/Model/Cookie.php#L24-L28 |
222,718 | EcomDev/EcomDev_Varnish | src/app/code/community/EcomDev/Varnish/Model/Cookie.php | EcomDev_Varnish_Model_Cookie.get | public function get($cookie)
{
if (!$this->has($cookie)) {
if ($this->getRequest()) {
return $this->getRequest()->getCookie($cookie);
}
return null;
}
return $this->_cookies[$cookie]['value'];
} | php | public function get($cookie)
{
if (!$this->has($cookie)) {
if ($this->getRequest()) {
return $this->getRequest()->getCookie($cookie);
}
return null;
}
return $this->_cookies[$cookie]['value'];
} | [
"public",
"function",
"get",
"(",
"$",
"cookie",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"has",
"(",
"$",
"cookie",
")",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"getRequest",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"getRequest",
"... | Retrieves a cookie value from scheduled list or request cookie
@param string $cookie
@return mixed|null | [
"Retrieves",
"a",
"cookie",
"value",
"from",
"scheduled",
"list",
"or",
"request",
"cookie"
] | 228b7b1bdaae15c1895f2533667fffa515447915 | https://github.com/EcomDev/EcomDev_Varnish/blob/228b7b1bdaae15c1895f2533667fffa515447915/src/app/code/community/EcomDev/Varnish/Model/Cookie.php#L47-L58 |
222,719 | EcomDev/EcomDev_Varnish | src/app/code/community/EcomDev/Varnish/Model/Cookie.php | EcomDev_Varnish_Model_Cookie.apply | public function apply()
{
Mage::dispatchEvent('ecomdev_varnish_cookie_apply_before', array('cookie' => $this));
foreach ($this->getAll() as $cookieName => $data) {
Mage::getSingleton('core/cookie')->set(
$cookieName,
$data['value'],
... | php | public function apply()
{
Mage::dispatchEvent('ecomdev_varnish_cookie_apply_before', array('cookie' => $this));
foreach ($this->getAll() as $cookieName => $data) {
Mage::getSingleton('core/cookie')->set(
$cookieName,
$data['value'],
... | [
"public",
"function",
"apply",
"(",
")",
"{",
"Mage",
"::",
"dispatchEvent",
"(",
"'ecomdev_varnish_cookie_apply_before'",
",",
"array",
"(",
"'cookie'",
"=>",
"$",
"this",
")",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"getAll",
"(",
")",
"as",
"$",
... | Applies cookies to be set | [
"Applies",
"cookies",
"to",
"be",
"set"
] | 228b7b1bdaae15c1895f2533667fffa515447915 | https://github.com/EcomDev/EcomDev_Varnish/blob/228b7b1bdaae15c1895f2533667fffa515447915/src/app/code/community/EcomDev/Varnish/Model/Cookie.php#L90-L107 |
222,720 | basarevych/dynamic-table | php/DynamicTable/Adapter/ArrayAdapter.php | ArrayAdapter.checkFilter | protected function checkFilter($filter, $type, $test, $real)
{
if ($type == Table::TYPE_DATETIME) {
if ($filter == Table::FILTER_BETWEEN
&& is_array($test) && count($test) == 2) {
$test = [
$test[0] ? new \DateTime('@' . $test[0]) : null,
... | php | protected function checkFilter($filter, $type, $test, $real)
{
if ($type == Table::TYPE_DATETIME) {
if ($filter == Table::FILTER_BETWEEN
&& is_array($test) && count($test) == 2) {
$test = [
$test[0] ? new \DateTime('@' . $test[0]) : null,
... | [
"protected",
"function",
"checkFilter",
"(",
"$",
"filter",
",",
"$",
"type",
",",
"$",
"test",
",",
"$",
"real",
")",
"{",
"if",
"(",
"$",
"type",
"==",
"Table",
"::",
"TYPE_DATETIME",
")",
"{",
"if",
"(",
"$",
"filter",
"==",
"Table",
"::",
"FILT... | Check and apply filter
@param string $filter
@param string $type
@param mixed $test
@param mixed $real | [
"Check",
"and",
"apply",
"filter"
] | 227eafab0d4dafabe0d2ceaa881ab3befe994d9c | https://github.com/basarevych/dynamic-table/blob/227eafab0d4dafabe0d2ceaa881ab3befe994d9c/php/DynamicTable/Adapter/ArrayAdapter.php#L229-L279 |
222,721 | FriendsOfOuro/geteventstore-php-core | src/ValueObjects/Enum/Enum.php | Enum.sameValueAs | public function sameValueAs(ValueObjectInterface $enum)
{
if (false === Util::classEquals($this, $enum)) {
return false;
}
return $this->toNative() === $enum->toNative();
} | php | public function sameValueAs(ValueObjectInterface $enum)
{
if (false === Util::classEquals($this, $enum)) {
return false;
}
return $this->toNative() === $enum->toNative();
} | [
"public",
"function",
"sameValueAs",
"(",
"ValueObjectInterface",
"$",
"enum",
")",
"{",
"if",
"(",
"false",
"===",
"Util",
"::",
"classEquals",
"(",
"$",
"this",
",",
"$",
"enum",
")",
")",
"{",
"return",
"false",
";",
"}",
"return",
"$",
"this",
"->"... | Tells whether two Enum objects are sameValueAs by comparing their values.
@param Enum $enum
@return bool | [
"Tells",
"whether",
"two",
"Enum",
"objects",
"are",
"sameValueAs",
"by",
"comparing",
"their",
"values",
"."
] | 76aac24ce7a688f8232f76ba24b3549222f20332 | https://github.com/FriendsOfOuro/geteventstore-php-core/blob/76aac24ce7a688f8232f76ba24b3549222f20332/src/ValueObjects/Enum/Enum.php#L39-L46 |
222,722 | eosnewmedia/JSON-API-Server | src/JsonApiServer.php | JsonApiServer.addHandler | public function addHandler(string $type, RequestHandlerInterface $handler): void
{
$this->handlers[$type] = $handler;
} | php | public function addHandler(string $type, RequestHandlerInterface $handler): void
{
$this->handlers[$type] = $handler;
} | [
"public",
"function",
"addHandler",
"(",
"string",
"$",
"type",
",",
"RequestHandlerInterface",
"$",
"handler",
")",
":",
"void",
"{",
"$",
"this",
"->",
"handlers",
"[",
"$",
"type",
"]",
"=",
"$",
"handler",
";",
"}"
] | Adds a request handler
@param string $type
@param RequestHandlerInterface $handler | [
"Adds",
"a",
"request",
"handler"
] | 6fe8a6b605faebdda5597ee5069357a5ed1f23d9 | https://github.com/eosnewmedia/JSON-API-Server/blob/6fe8a6b605faebdda5597ee5069357a5ed1f23d9/src/JsonApiServer.php#L70-L73 |
222,723 | EcomDev/EcomDev_Varnish | src/app/code/community/EcomDev/Varnish/Model/Vcl/Config/Array.php | EcomDev_Varnish_Model_Vcl_Config_Array.getConfigArrayOption | protected function getConfigArrayOption($optionName, $defaultValue = null)
{
if (!isset($this->config[$optionName])) {
return $defaultValue;
}
return $this->config[$optionName];
} | php | protected function getConfigArrayOption($optionName, $defaultValue = null)
{
if (!isset($this->config[$optionName])) {
return $defaultValue;
}
return $this->config[$optionName];
} | [
"protected",
"function",
"getConfigArrayOption",
"(",
"$",
"optionName",
",",
"$",
"defaultValue",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"config",
"[",
"$",
"optionName",
"]",
")",
")",
"{",
"return",
"$",
"defaultValue"... | Returns configuration array option
@param $optionName
@param mixed $defaultValue
@return mixed | [
"Returns",
"configuration",
"array",
"option"
] | 228b7b1bdaae15c1895f2533667fffa515447915 | https://github.com/EcomDev/EcomDev_Varnish/blob/228b7b1bdaae15c1895f2533667fffa515447915/src/app/code/community/EcomDev/Varnish/Model/Vcl/Config/Array.php#L76-L83 |
222,724 | EcomDev/EcomDev_Varnish | src/app/code/community/EcomDev/Varnish/Model/Vcl/Config/Array.php | EcomDev_Varnish_Model_Vcl_Config_Array.initBackend | protected function initBackend()
{
$this->backendList = array();
$this->balancedBackendList = array();
foreach ($this->getConfigArrayOption('backend', array()) as $backendName => $option) {
if (!isset($option['ip']) || !isset($option['port'])) {
continue;
... | php | protected function initBackend()
{
$this->backendList = array();
$this->balancedBackendList = array();
foreach ($this->getConfigArrayOption('backend', array()) as $backendName => $option) {
if (!isset($option['ip']) || !isset($option['port'])) {
continue;
... | [
"protected",
"function",
"initBackend",
"(",
")",
"{",
"$",
"this",
"->",
"backendList",
"=",
"array",
"(",
")",
";",
"$",
"this",
"->",
"balancedBackendList",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"getConfigArrayOption",
"(",
"... | Initializes backend options
@return $this | [
"Initializes",
"backend",
"options"
] | 228b7b1bdaae15c1895f2533667fffa515447915 | https://github.com/EcomDev/EcomDev_Varnish/blob/228b7b1bdaae15c1895f2533667fffa515447915/src/app/code/community/EcomDev/Varnish/Model/Vcl/Config/Array.php#L90-L115 |
222,725 | EcomDev/EcomDev_Varnish | src/app/code/community/EcomDev/Varnish/Model/Vcl/Config/Array.php | EcomDev_Varnish_Model_Vcl_Config_Array.getBackendOption | public function getBackendOption($backendName, $option, $defaultOption = null)
{
$backendConfig = $this->getConfigArrayOption('backend', array());
if (isset($backendConfig[$backendName][$option])) {
return $backendConfig[$backendName][$option];
}
$optionConfig = $this->g... | php | public function getBackendOption($backendName, $option, $defaultOption = null)
{
$backendConfig = $this->getConfigArrayOption('backend', array());
if (isset($backendConfig[$backendName][$option])) {
return $backendConfig[$backendName][$option];
}
$optionConfig = $this->g... | [
"public",
"function",
"getBackendOption",
"(",
"$",
"backendName",
",",
"$",
"option",
",",
"$",
"defaultOption",
"=",
"null",
")",
"{",
"$",
"backendConfig",
"=",
"$",
"this",
"->",
"getConfigArrayOption",
"(",
"'backend'",
",",
"array",
"(",
")",
")",
";... | Returns backend option from configuration
@param string $backendName a identifier from array keys of backend list
@param string $option
@return string | [
"Returns",
"backend",
"option",
"from",
"configuration"
] | 228b7b1bdaae15c1895f2533667fffa515447915 | https://github.com/EcomDev/EcomDev_Varnish/blob/228b7b1bdaae15c1895f2533667fffa515447915/src/app/code/community/EcomDev/Varnish/Model/Vcl/Config/Array.php#L140-L154 |
222,726 | EcomDev/EcomDev_Varnish | src/app/code/community/EcomDev/Varnish/Model/Vcl/Config/Array.php | EcomDev_Varnish_Model_Vcl_Config_Array.getCookieName | public function getCookieName($type)
{
$defaultCookieNames = $this->getConfigArrayOption(
'default_cookie_names',
[
'segment' => EcomDev_Varnish_Model_Customer_Observer::COOKIE_SEGMENT
]
);
$cookieNames = $this->getConfigArrayOption(
... | php | public function getCookieName($type)
{
$defaultCookieNames = $this->getConfigArrayOption(
'default_cookie_names',
[
'segment' => EcomDev_Varnish_Model_Customer_Observer::COOKIE_SEGMENT
]
);
$cookieNames = $this->getConfigArrayOption(
... | [
"public",
"function",
"getCookieName",
"(",
"$",
"type",
")",
"{",
"$",
"defaultCookieNames",
"=",
"$",
"this",
"->",
"getConfigArrayOption",
"(",
"'default_cookie_names'",
",",
"[",
"'segment'",
"=>",
"EcomDev_Varnish_Model_Customer_Observer",
"::",
"COOKIE_SEGMENT",
... | Returns cookie name for VCL configuration
@param string $type
@return string | [
"Returns",
"cookie",
"name",
"for",
"VCL",
"configuration"
] | 228b7b1bdaae15c1895f2533667fffa515447915 | https://github.com/EcomDev/EcomDev_Varnish/blob/228b7b1bdaae15c1895f2533667fffa515447915/src/app/code/community/EcomDev/Varnish/Model/Vcl/Config/Array.php#L306-L328 |
222,727 | TerbiumLibs/dbConfig | src/Terbium/DbConfig/DbProvider.php | DbProvider.load | public function load($collection = null)
{
$items = array();
$list = DB::table($this->table);
if ($collection !== null) {
$list = $list->where('key', 'LIKE', $collection . '%');
}
$list = $list->pluck('value', 'key');
// convert dotted list back to m... | php | public function load($collection = null)
{
$items = array();
$list = DB::table($this->table);
if ($collection !== null) {
$list = $list->where('key', 'LIKE', $collection . '%');
}
$list = $list->pluck('value', 'key');
// convert dotted list back to m... | [
"public",
"function",
"load",
"(",
"$",
"collection",
"=",
"null",
")",
"{",
"$",
"items",
"=",
"array",
"(",
")",
";",
"$",
"list",
"=",
"DB",
"::",
"table",
"(",
"$",
"this",
"->",
"table",
")",
";",
"if",
"(",
"$",
"collection",
"!==",
"null",... | Load the given configuration collection.
@param string $collection
@return array | [
"Load",
"the",
"given",
"configuration",
"collection",
"."
] | c418de91cf13af8bce107e9da6226abc9a0167c6 | https://github.com/TerbiumLibs/dbConfig/blob/c418de91cf13af8bce107e9da6226abc9a0167c6/src/Terbium/DbConfig/DbProvider.php#L33-L54 |
222,728 | TerbiumLibs/dbConfig | src/Terbium/DbConfig/DbProvider.php | DbProvider.store | public function store($key, $value)
{
if (!is_array($value)) {
$value = array($key => $value);
} else {
$value = array_dot($value);
foreach ($value as $k => $v) {
$value[$key . '.' . $k] = $v;
unset($value[$k]);
}
... | php | public function store($key, $value)
{
if (!is_array($value)) {
$value = array($key => $value);
} else {
$value = array_dot($value);
foreach ($value as $k => $v) {
$value[$key . '.' . $k] = $v;
unset($value[$k]);
}
... | [
"public",
"function",
"store",
"(",
"$",
"key",
",",
"$",
"value",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"value",
")",
")",
"{",
"$",
"value",
"=",
"array",
"(",
"$",
"key",
"=>",
"$",
"value",
")",
";",
"}",
"else",
"{",
"$",
"valu... | Save item to the database or update the existing one
@param string $key
@param mixed $value
@return void
@throws Exceptions\SaveException | [
"Save",
"item",
"to",
"the",
"database",
"or",
"update",
"the",
"existing",
"one"
] | c418de91cf13af8bce107e9da6226abc9a0167c6 | https://github.com/TerbiumLibs/dbConfig/blob/c418de91cf13af8bce107e9da6226abc9a0167c6/src/Terbium/DbConfig/DbProvider.php#L66-L84 |
222,729 | TerbiumLibs/dbConfig | src/Terbium/DbConfig/DbProvider.php | DbProvider.clear | public function clear()
{
try {
DB::table($this->table)->truncate();
} catch (\Exception $e) {
throw new SaveException("Cannot clear database: " . $e->getMessage());
}
} | php | public function clear()
{
try {
DB::table($this->table)->truncate();
} catch (\Exception $e) {
throw new SaveException("Cannot clear database: " . $e->getMessage());
}
} | [
"public",
"function",
"clear",
"(",
")",
"{",
"try",
"{",
"DB",
"::",
"table",
"(",
"$",
"this",
"->",
"table",
")",
"->",
"truncate",
"(",
")",
";",
"}",
"catch",
"(",
"\\",
"Exception",
"$",
"e",
")",
"{",
"throw",
"new",
"SaveException",
"(",
... | Clear the table with settings
@return void
@throws Exceptions\SaveException | [
"Clear",
"the",
"table",
"with",
"settings"
] | c418de91cf13af8bce107e9da6226abc9a0167c6 | https://github.com/TerbiumLibs/dbConfig/blob/c418de91cf13af8bce107e9da6226abc9a0167c6/src/Terbium/DbConfig/DbProvider.php#L170-L183 |
222,730 | TerbiumLibs/dbConfig | src/Terbium/DbConfig/DbProvider.php | DbProvider.listDb | public function listDb($wildcard = null)
{
$query = DB::table($this->table);
if (!empty($wildcard)) {
$query = $query->where('key', 'LIKE', $wildcard . '%');
}
return $query;
} | php | public function listDb($wildcard = null)
{
$query = DB::table($this->table);
if (!empty($wildcard)) {
$query = $query->where('key', 'LIKE', $wildcard . '%');
}
return $query;
} | [
"public",
"function",
"listDb",
"(",
"$",
"wildcard",
"=",
"null",
")",
"{",
"$",
"query",
"=",
"DB",
"::",
"table",
"(",
"$",
"this",
"->",
"table",
")",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"wildcard",
")",
")",
"{",
"$",
"query",
"=",
"$"... | Return query builder with list of settings from database
@param string $wildcard
@return Illuminate\Database\Query\Builder | [
"Return",
"query",
"builder",
"with",
"list",
"of",
"settings",
"from",
"database"
] | c418de91cf13af8bce107e9da6226abc9a0167c6 | https://github.com/TerbiumLibs/dbConfig/blob/c418de91cf13af8bce107e9da6226abc9a0167c6/src/Terbium/DbConfig/DbProvider.php#L193-L203 |
222,731 | FriendsOfOuro/geteventstore-php-core | src/ValueObjects/Identity/UUID.php | UUID.sameValueAs | public function sameValueAs(ValueObjectInterface $uuid)
{
if (false === Util::classEquals($this, $uuid)) {
return false;
}
return $this->toNative() === $uuid->toNative();
} | php | public function sameValueAs(ValueObjectInterface $uuid)
{
if (false === Util::classEquals($this, $uuid)) {
return false;
}
return $this->toNative() === $uuid->toNative();
} | [
"public",
"function",
"sameValueAs",
"(",
"ValueObjectInterface",
"$",
"uuid",
")",
"{",
"if",
"(",
"false",
"===",
"Util",
"::",
"classEquals",
"(",
"$",
"this",
",",
"$",
"uuid",
")",
")",
"{",
"return",
"false",
";",
"}",
"return",
"$",
"this",
"->"... | Tells whether two UUID are equal by comparing their values.
@param UUID $uuid
@return bool | [
"Tells",
"whether",
"two",
"UUID",
"are",
"equal",
"by",
"comparing",
"their",
"values",
"."
] | 76aac24ce7a688f8232f76ba24b3549222f20332 | https://github.com/FriendsOfOuro/geteventstore-php-core/blob/76aac24ce7a688f8232f76ba24b3549222f20332/src/ValueObjects/Identity/UUID.php#L68-L75 |
222,732 | iMi-digital/laravel-transsid | src/StartSessionMiddleware.php | StartSessionMiddleware.validate | protected function validate($session, $request)
{
$locked = $session->get(self::LOCKED_FIELD);
return !($locked['ip'] != $request->getClientIp()
|| $locked['agent'] != md5($request->server('HTTP_USER_AGENT')));
} | php | protected function validate($session, $request)
{
$locked = $session->get(self::LOCKED_FIELD);
return !($locked['ip'] != $request->getClientIp()
|| $locked['agent'] != md5($request->server('HTTP_USER_AGENT')));
} | [
"protected",
"function",
"validate",
"(",
"$",
"session",
",",
"$",
"request",
")",
"{",
"$",
"locked",
"=",
"$",
"session",
"->",
"get",
"(",
"self",
"::",
"LOCKED_FIELD",
")",
";",
"return",
"!",
"(",
"$",
"locked",
"[",
"'ip'",
"]",
"!=",
"$",
"... | Check if IP or Agent changed
@param $session
@param $request
@return bool | [
"Check",
"if",
"IP",
"or",
"Agent",
"changed"
] | d1898a3d620ddd5eab17c26fca879b32df2c6810 | https://github.com/iMi-digital/laravel-transsid/blob/d1898a3d620ddd5eab17c26fca879b32df2c6810/src/StartSessionMiddleware.php#L32-L37 |
222,733 | compropago/compropago-php | src/Resources/Webhook.php | Webhook.getAll | public function getAll()
{
$endpoint = "{$this->apiUrl}/webhooks/stores";
$res = Requests::get(
$endpoint,
array(),
$this->options
);
$this->validateResponse($res);
return json_decode($res->body, true);
} | php | public function getAll()
{
$endpoint = "{$this->apiUrl}/webhooks/stores";
$res = Requests::get(
$endpoint,
array(),
$this->options
);
$this->validateResponse($res);
return json_decode($res->body, true);
} | [
"public",
"function",
"getAll",
"(",
")",
"{",
"$",
"endpoint",
"=",
"\"{$this->apiUrl}/webhooks/stores\"",
";",
"$",
"res",
"=",
"Requests",
"::",
"get",
"(",
"$",
"endpoint",
",",
"array",
"(",
")",
",",
"$",
"this",
"->",
"options",
")",
";",
"$",
"... | Returns a list of all registed webhooks
@return array Webhook structure
@throws \Exception Request error or exception | [
"Returns",
"a",
"list",
"of",
"all",
"registed",
"webhooks"
] | dc11d7cba778123bbf84860b4bb5d8dbfb78598f | https://github.com/compropago/compropago-php/blob/dc11d7cba778123bbf84860b4bb5d8dbfb78598f/src/Resources/Webhook.php#L26-L38 |
222,734 | xcaliber-tech/omnipay-skrill | src/Omnipay/Skrill/Message/Request.php | Request.sendData | public function sendData($data)
{
$url = $this->getEndpoint() . '?' . http_build_query($data);
$httpResponse = $this->httpClient->get($url)->send();
$xml = $httpResponse->xml();
return $this->createResponse($xml);
} | php | public function sendData($data)
{
$url = $this->getEndpoint() . '?' . http_build_query($data);
$httpResponse = $this->httpClient->get($url)->send();
$xml = $httpResponse->xml();
return $this->createResponse($xml);
} | [
"public",
"function",
"sendData",
"(",
"$",
"data",
")",
"{",
"$",
"url",
"=",
"$",
"this",
"->",
"getEndpoint",
"(",
")",
".",
"'?'",
".",
"http_build_query",
"(",
"$",
"data",
")",
";",
"$",
"httpResponse",
"=",
"$",
"this",
"->",
"httpClient",
"->... | Send the skrill request.
@return Response | [
"Send",
"the",
"skrill",
"request",
"."
] | f90a185b5e26fb5b4150d664f01ad8048b460bcf | https://github.com/xcaliber-tech/omnipay-skrill/blob/f90a185b5e26fb5b4150d664f01ad8048b460bcf/src/Omnipay/Skrill/Message/Request.php#L56-L63 |
222,735 | xcaliber-tech/omnipay-skrill | src/Omnipay/Skrill/Message/Request.php | Request.createResponse | protected function createResponse($xml)
{
$requestClass = get_class($this);
$responseClass = substr($requestClass, 0, -7) . 'Response';
return $this->response = new $responseClass($this, $xml);
} | php | protected function createResponse($xml)
{
$requestClass = get_class($this);
$responseClass = substr($requestClass, 0, -7) . 'Response';
return $this->response = new $responseClass($this, $xml);
} | [
"protected",
"function",
"createResponse",
"(",
"$",
"xml",
")",
"{",
"$",
"requestClass",
"=",
"get_class",
"(",
"$",
"this",
")",
";",
"$",
"responseClass",
"=",
"substr",
"(",
"$",
"requestClass",
",",
"0",
",",
"-",
"7",
")",
".",
"'Response'",
";"... | Create a proper response based on the request.
@param \SimpleXMLElement $xml raw response
@return Response response for this request | [
"Create",
"a",
"proper",
"response",
"based",
"on",
"the",
"request",
"."
] | f90a185b5e26fb5b4150d664f01ad8048b460bcf | https://github.com/xcaliber-tech/omnipay-skrill/blob/f90a185b5e26fb5b4150d664f01ad8048b460bcf/src/Omnipay/Skrill/Message/Request.php#L71-L76 |
222,736 | stanislav-web/phalcon-uploader | src/Uploader/Helpers/Format.php | Format.bytes | public static function bytes($bytes, $precision = 2)
{
$size = array('bytes', 'kb', 'mb', 'gb', 'tb', 'pb', 'eb', 'zb', 'yb');
$factor = floor((strlen($bytes) - 1) / 3);
return sprintf("%.{$precision}f", $bytes / pow(1024, $factor)) . ' ' . @$size[$factor];
} | php | public static function bytes($bytes, $precision = 2)
{
$size = array('bytes', 'kb', 'mb', 'gb', 'tb', 'pb', 'eb', 'zb', 'yb');
$factor = floor((strlen($bytes) - 1) / 3);
return sprintf("%.{$precision}f", $bytes / pow(1024, $factor)) . ' ' . @$size[$factor];
} | [
"public",
"static",
"function",
"bytes",
"(",
"$",
"bytes",
",",
"$",
"precision",
"=",
"2",
")",
"{",
"$",
"size",
"=",
"array",
"(",
"'bytes'",
",",
"'kb'",
",",
"'mb'",
",",
"'gb'",
",",
"'tb'",
",",
"'pb'",
",",
"'eb'",
",",
"'zb'",
",",
"'yb... | Format byte code to human understand
@param int $bytes number of bytes
@param int $precision after comma numbers
@return string | [
"Format",
"byte",
"code",
"to",
"human",
"understand"
] | 3e46aba5d6f51b52b7830eae21c0d3fe1e524c90 | https://github.com/stanislav-web/phalcon-uploader/blob/3e46aba5d6f51b52b7830eae21c0d3fe1e524c90/src/Uploader/Helpers/Format.php#L45-L50 |
222,737 | stanislav-web/phalcon-uploader | src/Uploader/Helpers/Format.php | Format.toLatin | public static function toLatin($string, $separator = '', $clean = false)
{
$cyrillicCount = count(self::$cyr);
for ($i = 0; $i < $cyrillicCount; $i++) {
$string = str_replace(self::$cyr[$i], self::$lat[$i], $string);
}
$string = preg_replace("/([qwrtpsdfghklzxcvbnmQWRTP... | php | public static function toLatin($string, $separator = '', $clean = false)
{
$cyrillicCount = count(self::$cyr);
for ($i = 0; $i < $cyrillicCount; $i++) {
$string = str_replace(self::$cyr[$i], self::$lat[$i], $string);
}
$string = preg_replace("/([qwrtpsdfghklzxcvbnmQWRTP... | [
"public",
"static",
"function",
"toLatin",
"(",
"$",
"string",
",",
"$",
"separator",
"=",
"''",
",",
"$",
"clean",
"=",
"false",
")",
"{",
"$",
"cyrillicCount",
"=",
"count",
"(",
"self",
"::",
"$",
"cyr",
")",
";",
"for",
"(",
"$",
"i",
"=",
"0... | Transliterate cyrillic to latin
@param string $string original string
@param string $separator word separator
@param boolean $clean to lower & all non understand symbols remove
@return string | [
"Transliterate",
"cyrillic",
"to",
"latin"
] | 3e46aba5d6f51b52b7830eae21c0d3fe1e524c90 | https://github.com/stanislav-web/phalcon-uploader/blob/3e46aba5d6f51b52b7830eae21c0d3fe1e524c90/src/Uploader/Helpers/Format.php#L60-L89 |
222,738 | EcomDev/EcomDev_Varnish | src/app/code/community/EcomDev/Varnish/Model/AbstractProcessor.php | EcomDev_Varnish_Model_AbstractProcessor.getTags | public function getTags($object)
{
$tags = $this->_collectTags($object);
if (is_string($tags)) {
$tags = array(
$tags => $tags
);
} elseif (!is_array($tags)) {
return array();
}
return $tags;
} | php | public function getTags($object)
{
$tags = $this->_collectTags($object);
if (is_string($tags)) {
$tags = array(
$tags => $tags
);
} elseif (!is_array($tags)) {
return array();
}
return $tags;
} | [
"public",
"function",
"getTags",
"(",
"$",
"object",
")",
"{",
"$",
"tags",
"=",
"$",
"this",
"->",
"_collectTags",
"(",
"$",
"object",
")",
";",
"if",
"(",
"is_string",
"(",
"$",
"tags",
")",
")",
"{",
"$",
"tags",
"=",
"array",
"(",
"$",
"tags"... | Collects list of objects that can be used by object retrievers
@param Mage_Core_Model_Abstract $object
@return string[] | [
"Collects",
"list",
"of",
"objects",
"that",
"can",
"be",
"used",
"by",
"object",
"retrievers"
] | 228b7b1bdaae15c1895f2533667fffa515447915 | https://github.com/EcomDev/EcomDev_Varnish/blob/228b7b1bdaae15c1895f2533667fffa515447915/src/app/code/community/EcomDev/Varnish/Model/AbstractProcessor.php#L42-L55 |
222,739 | commerceguys/pricing | src/Price.php | Price.assertSameCurrency | protected function assertSameCurrency(Price $a, Price $b)
{
if ($a->getCurrency() != $b->getCurrency()) {
throw new CurrencyMismatchException;
}
} | php | protected function assertSameCurrency(Price $a, Price $b)
{
if ($a->getCurrency() != $b->getCurrency()) {
throw new CurrencyMismatchException;
}
} | [
"protected",
"function",
"assertSameCurrency",
"(",
"Price",
"$",
"a",
",",
"Price",
"$",
"b",
")",
"{",
"if",
"(",
"$",
"a",
"->",
"getCurrency",
"(",
")",
"!=",
"$",
"b",
"->",
"getCurrency",
"(",
")",
")",
"{",
"throw",
"new",
"CurrencyMismatchExcep... | Ensures that the two Price instances have the same currency.
@param \CommerceGuys\Pricing\Price $a
@param \CommerceGuys\Pricing\Price $b
@throws \CommerceGuys\Pricing\CurrencyMismatchException | [
"Ensures",
"that",
"the",
"two",
"Price",
"instances",
"have",
"the",
"same",
"currency",
"."
] | 55269e9603d28cf1de644f49d7af7c1d36b5864d | https://github.com/commerceguys/pricing/blob/55269e9603d28cf1de644f49d7af7c1d36b5864d/src/Price.php#L176-L181 |
222,740 | commerceguys/pricing | src/Price.php | Price.assertAmountFormat | protected function assertAmountFormat($amount)
{
if (is_float($amount)) {
throw new InvalidArgumentException(sprintf('The provided amount "%s" must be a string, not a float.', $amount));
}
if (!is_numeric($amount)) {
throw new InvalidArgumentException(sprintf('The pro... | php | protected function assertAmountFormat($amount)
{
if (is_float($amount)) {
throw new InvalidArgumentException(sprintf('The provided amount "%s" must be a string, not a float.', $amount));
}
if (!is_numeric($amount)) {
throw new InvalidArgumentException(sprintf('The pro... | [
"protected",
"function",
"assertAmountFormat",
"(",
"$",
"amount",
")",
"{",
"if",
"(",
"is_float",
"(",
"$",
"amount",
")",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"sprintf",
"(",
"'The provided amount \"%s\" must be a string, not a float.'",
",",
... | Ensures that the provided amount is a numeric string.
Prevents the passing of floats and strings that can't be
understood by bcmath (due to spaces or commas).
@param string $amount
@throws \CommerceGuys\Pricing\InvalidArgumentException | [
"Ensures",
"that",
"the",
"provided",
"amount",
"is",
"a",
"numeric",
"string",
"."
] | 55269e9603d28cf1de644f49d7af7c1d36b5864d | https://github.com/commerceguys/pricing/blob/55269e9603d28cf1de644f49d7af7c1d36b5864d/src/Price.php#L193-L201 |
222,741 | commerceguys/pricing | src/Price.php | Price.newPrice | protected function newPrice($amount, $currency = null)
{
if (strpos($amount, '.') != FALSE) {
// The number is decimal, strip trailing zeroes.
// If no digits remain after the decimal point, strip it as well.
$amount = rtrim($amount, '0');
$amount = rtrim($amo... | php | protected function newPrice($amount, $currency = null)
{
if (strpos($amount, '.') != FALSE) {
// The number is decimal, strip trailing zeroes.
// If no digits remain after the decimal point, strip it as well.
$amount = rtrim($amount, '0');
$amount = rtrim($amo... | [
"protected",
"function",
"newPrice",
"(",
"$",
"amount",
",",
"$",
"currency",
"=",
"null",
")",
"{",
"if",
"(",
"strpos",
"(",
"$",
"amount",
",",
"'.'",
")",
"!=",
"FALSE",
")",
"{",
"// The number is decimal, strip trailing zeroes.",
"// If no digits remain a... | Creates a new Price instance using the provided amount.
Used in calculation methods to store the result in a new instance.
@param string $amount
@param \CommerceGuys\Intl\Currency\CurrencyInterface $currency
@return \CommerceGuys\Pricing\Price The new Price instance. | [
"Creates",
"a",
"new",
"Price",
"instance",
"using",
"the",
"provided",
"amount",
"."
] | 55269e9603d28cf1de644f49d7af7c1d36b5864d | https://github.com/commerceguys/pricing/blob/55269e9603d28cf1de644f49d7af7c1d36b5864d/src/Price.php#L213-L224 |
222,742 | rtlopez/decimal | src/RtLopez/Decimal.php | Decimal.same | public function same($value = 0, $prec = null)
{
if($value instanceof $this && $value->prec == $this->prec && ($prec === null || $value->prec == $prec))
{
return $value;
}
$class = get_class($this);
return new $class($value, $prec);
} | php | public function same($value = 0, $prec = null)
{
if($value instanceof $this && $value->prec == $this->prec && ($prec === null || $value->prec == $prec))
{
return $value;
}
$class = get_class($this);
return new $class($value, $prec);
} | [
"public",
"function",
"same",
"(",
"$",
"value",
"=",
"0",
",",
"$",
"prec",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"value",
"instanceof",
"$",
"this",
"&&",
"$",
"value",
"->",
"prec",
"==",
"$",
"this",
"->",
"prec",
"&&",
"(",
"$",
"prec",
"... | Make the same type object
@param number $value
@param string $prec
@return \RtLopez\Decimal | [
"Make",
"the",
"same",
"type",
"object"
] | 854e182c6023fb2ac6c7893a7ba4cade967f0c4c | https://github.com/rtlopez/decimal/blob/854e182c6023fb2ac6c7893a7ba4cade967f0c4c/src/RtLopez/Decimal.php#L61-L69 |
222,743 | rtlopez/decimal | src/RtLopez/Decimal.php | Decimal.add | public function add($op)
{
$dst = clone $this;
$dst->value = $this->_fix($this->_add($this->same($op, $this->prec)));
return $dst;
} | php | public function add($op)
{
$dst = clone $this;
$dst->value = $this->_fix($this->_add($this->same($op, $this->prec)));
return $dst;
} | [
"public",
"function",
"add",
"(",
"$",
"op",
")",
"{",
"$",
"dst",
"=",
"clone",
"$",
"this",
";",
"$",
"dst",
"->",
"value",
"=",
"$",
"this",
"->",
"_fix",
"(",
"$",
"this",
"->",
"_add",
"(",
"$",
"this",
"->",
"same",
"(",
"$",
"op",
",",... | Add two numbers
@param int|float|string|Decimal $op operand
@return Decimal | [
"Add",
"two",
"numbers"
] | 854e182c6023fb2ac6c7893a7ba4cade967f0c4c | https://github.com/rtlopez/decimal/blob/854e182c6023fb2ac6c7893a7ba4cade967f0c4c/src/RtLopez/Decimal.php#L159-L164 |
222,744 | rtlopez/decimal | src/RtLopez/Decimal.php | Decimal.sub | public function sub($op)
{
$dst = clone $this;
$dst->value = $this->_fix($this->_sub($this->same($op, $this->prec)));
return $dst;
} | php | public function sub($op)
{
$dst = clone $this;
$dst->value = $this->_fix($this->_sub($this->same($op, $this->prec)));
return $dst;
} | [
"public",
"function",
"sub",
"(",
"$",
"op",
")",
"{",
"$",
"dst",
"=",
"clone",
"$",
"this",
";",
"$",
"dst",
"->",
"value",
"=",
"$",
"this",
"->",
"_fix",
"(",
"$",
"this",
"->",
"_sub",
"(",
"$",
"this",
"->",
"same",
"(",
"$",
"op",
",",... | Substract two numbers
@param int|float|string|Decimal $op operand
@return Decimal | [
"Substract",
"two",
"numbers"
] | 854e182c6023fb2ac6c7893a7ba4cade967f0c4c | https://github.com/rtlopez/decimal/blob/854e182c6023fb2ac6c7893a7ba4cade967f0c4c/src/RtLopez/Decimal.php#L171-L176 |
222,745 | rtlopez/decimal | src/RtLopez/Decimal.php | Decimal.mul | public function mul($op)
{
$dst = clone $this;
$dst->value = $this->_fix($this->_mul($this->same($op, $this->prec)));
return $dst;
} | php | public function mul($op)
{
$dst = clone $this;
$dst->value = $this->_fix($this->_mul($this->same($op, $this->prec)));
return $dst;
} | [
"public",
"function",
"mul",
"(",
"$",
"op",
")",
"{",
"$",
"dst",
"=",
"clone",
"$",
"this",
";",
"$",
"dst",
"->",
"value",
"=",
"$",
"this",
"->",
"_fix",
"(",
"$",
"this",
"->",
"_mul",
"(",
"$",
"this",
"->",
"same",
"(",
"$",
"op",
",",... | Multiply two numbers
@param int|float|string|Decimal $op operand
@return Decimal | [
"Multiply",
"two",
"numbers"
] | 854e182c6023fb2ac6c7893a7ba4cade967f0c4c | https://github.com/rtlopez/decimal/blob/854e182c6023fb2ac6c7893a7ba4cade967f0c4c/src/RtLopez/Decimal.php#L183-L188 |
222,746 | rtlopez/decimal | src/RtLopez/Decimal.php | Decimal.div | public function div($op)
{
$dst = clone $this;
$op = $this->same($op, $this->prec);
if($op->eq(0)) throw new ArithmeticException(sprintf('Division by zero (%s)', json_encode($op)));
$dst->value = $this->_fix($this->_div($op));
return $dst;
} | php | public function div($op)
{
$dst = clone $this;
$op = $this->same($op, $this->prec);
if($op->eq(0)) throw new ArithmeticException(sprintf('Division by zero (%s)', json_encode($op)));
$dst->value = $this->_fix($this->_div($op));
return $dst;
} | [
"public",
"function",
"div",
"(",
"$",
"op",
")",
"{",
"$",
"dst",
"=",
"clone",
"$",
"this",
";",
"$",
"op",
"=",
"$",
"this",
"->",
"same",
"(",
"$",
"op",
",",
"$",
"this",
"->",
"prec",
")",
";",
"if",
"(",
"$",
"op",
"->",
"eq",
"(",
... | Divide number by operand
@param int|float|string|Decimal $op operand
@return Decimal | [
"Divide",
"number",
"by",
"operand"
] | 854e182c6023fb2ac6c7893a7ba4cade967f0c4c | https://github.com/rtlopez/decimal/blob/854e182c6023fb2ac6c7893a7ba4cade967f0c4c/src/RtLopez/Decimal.php#L195-L202 |
222,747 | rtlopez/decimal | src/RtLopez/Decimal.php | Decimal.mod | public function mod($op)
{
$dst = clone $this;
$op = $this->same($op, $this->prec)->truncate();
if($op->eq(0)) throw new ArithmeticException(sprintf('Division by zero (%s)', json_encode($op)));
$dst->value = $this->_fix($this->_mod($op));
return $dst;
} | php | public function mod($op)
{
$dst = clone $this;
$op = $this->same($op, $this->prec)->truncate();
if($op->eq(0)) throw new ArithmeticException(sprintf('Division by zero (%s)', json_encode($op)));
$dst->value = $this->_fix($this->_mod($op));
return $dst;
} | [
"public",
"function",
"mod",
"(",
"$",
"op",
")",
"{",
"$",
"dst",
"=",
"clone",
"$",
"this",
";",
"$",
"op",
"=",
"$",
"this",
"->",
"same",
"(",
"$",
"op",
",",
"$",
"this",
"->",
"prec",
")",
"->",
"truncate",
"(",
")",
";",
"if",
"(",
"... | Module of division
@param int|float|string|Decimal $op operand
@return Decimal | [
"Module",
"of",
"division"
] | 854e182c6023fb2ac6c7893a7ba4cade967f0c4c | https://github.com/rtlopez/decimal/blob/854e182c6023fb2ac6c7893a7ba4cade967f0c4c/src/RtLopez/Decimal.php#L209-L216 |
222,748 | rtlopez/decimal | src/RtLopez/Decimal.php | Decimal.pow | public function pow($op)
{
$dst = clone $this;
$op = $this->same($op, $this->prec)->truncate();
$dst->value = $this->_fix($this->_pow($op));
return $dst;
} | php | public function pow($op)
{
$dst = clone $this;
$op = $this->same($op, $this->prec)->truncate();
$dst->value = $this->_fix($this->_pow($op));
return $dst;
} | [
"public",
"function",
"pow",
"(",
"$",
"op",
")",
"{",
"$",
"dst",
"=",
"clone",
"$",
"this",
";",
"$",
"op",
"=",
"$",
"this",
"->",
"same",
"(",
"$",
"op",
",",
"$",
"this",
"->",
"prec",
")",
"->",
"truncate",
"(",
")",
";",
"$",
"dst",
... | Power of number
@note operand will be truncated first (cutted to integer)
@param int|float|string|Decimal $op operand
@return Decimal | [
"Power",
"of",
"number"
] | 854e182c6023fb2ac6c7893a7ba4cade967f0c4c | https://github.com/rtlopez/decimal/blob/854e182c6023fb2ac6c7893a7ba4cade967f0c4c/src/RtLopez/Decimal.php#L224-L230 |
222,749 | rtlopez/decimal | src/RtLopez/Decimal.php | Decimal.sqrt | public function sqrt()
{
$dst = clone $this;
$dst->value = $this->_fix($this->_sqrt());
return $dst;
} | php | public function sqrt()
{
$dst = clone $this;
$dst->value = $this->_fix($this->_sqrt());
return $dst;
} | [
"public",
"function",
"sqrt",
"(",
")",
"{",
"$",
"dst",
"=",
"clone",
"$",
"this",
";",
"$",
"dst",
"->",
"value",
"=",
"$",
"this",
"->",
"_fix",
"(",
"$",
"this",
"->",
"_sqrt",
"(",
")",
")",
";",
"return",
"$",
"dst",
";",
"}"
] | Square root of number
@param int|float|string|Decimal $op operand
@return Decimal | [
"Square",
"root",
"of",
"number"
] | 854e182c6023fb2ac6c7893a7ba4cade967f0c4c | https://github.com/rtlopez/decimal/blob/854e182c6023fb2ac6c7893a7ba4cade967f0c4c/src/RtLopez/Decimal.php#L237-L242 |
222,750 | rtlopez/decimal | src/RtLopez/Decimal.php | Decimal.round | public function round($prec = 0)
{
$dst = clone $this;
$dst->value = $this->_round($this->value, $prec);
return $dst;
} | php | public function round($prec = 0)
{
$dst = clone $this;
$dst->value = $this->_round($this->value, $prec);
return $dst;
} | [
"public",
"function",
"round",
"(",
"$",
"prec",
"=",
"0",
")",
"{",
"$",
"dst",
"=",
"clone",
"$",
"this",
";",
"$",
"dst",
"->",
"value",
"=",
"$",
"this",
"->",
"_round",
"(",
"$",
"this",
"->",
"value",
",",
"$",
"prec",
")",
";",
"return",... | Round number with specific precision
@param int|float|string|Decimal $op operand
@return Decimal | [
"Round",
"number",
"with",
"specific",
"precision"
] | 854e182c6023fb2ac6c7893a7ba4cade967f0c4c | https://github.com/rtlopez/decimal/blob/854e182c6023fb2ac6c7893a7ba4cade967f0c4c/src/RtLopez/Decimal.php#L249-L254 |
222,751 | rtlopez/decimal | src/RtLopez/Decimal.php | Decimal.ceil | public function ceil($prec = 0)
{
$dst = clone $this;
$dst->value = $this->_ceil($this->value, $prec);
return $dst;
} | php | public function ceil($prec = 0)
{
$dst = clone $this;
$dst->value = $this->_ceil($this->value, $prec);
return $dst;
} | [
"public",
"function",
"ceil",
"(",
"$",
"prec",
"=",
"0",
")",
"{",
"$",
"dst",
"=",
"clone",
"$",
"this",
";",
"$",
"dst",
"->",
"value",
"=",
"$",
"this",
"->",
"_ceil",
"(",
"$",
"this",
"->",
"value",
",",
"$",
"prec",
")",
";",
"return",
... | Ceil number with specific precision
@param int|float|string|Decimal $op operand
@return Decimal | [
"Ceil",
"number",
"with",
"specific",
"precision"
] | 854e182c6023fb2ac6c7893a7ba4cade967f0c4c | https://github.com/rtlopez/decimal/blob/854e182c6023fb2ac6c7893a7ba4cade967f0c4c/src/RtLopez/Decimal.php#L261-L266 |
222,752 | rtlopez/decimal | src/RtLopez/Decimal.php | Decimal.floor | public function floor($prec = 0)
{
$dst = clone $this;
$dst->value = $this->_floor($this->value, $prec);
return $dst;
} | php | public function floor($prec = 0)
{
$dst = clone $this;
$dst->value = $this->_floor($this->value, $prec);
return $dst;
} | [
"public",
"function",
"floor",
"(",
"$",
"prec",
"=",
"0",
")",
"{",
"$",
"dst",
"=",
"clone",
"$",
"this",
";",
"$",
"dst",
"->",
"value",
"=",
"$",
"this",
"->",
"_floor",
"(",
"$",
"this",
"->",
"value",
",",
"$",
"prec",
")",
";",
"return",... | Floor number with specific precision
@param int|float|string|Decimal $op operand
@return Decimal | [
"Floor",
"number",
"with",
"specific",
"precision"
] | 854e182c6023fb2ac6c7893a7ba4cade967f0c4c | https://github.com/rtlopez/decimal/blob/854e182c6023fb2ac6c7893a7ba4cade967f0c4c/src/RtLopez/Decimal.php#L273-L278 |
222,753 | rtlopez/decimal | src/RtLopez/Decimal.php | Decimal.min | public function min($op)
{
$op = $this->same($op, $this->prec);
return $this->lt($op) ? clone $this : $op;
} | php | public function min($op)
{
$op = $this->same($op, $this->prec);
return $this->lt($op) ? clone $this : $op;
} | [
"public",
"function",
"min",
"(",
"$",
"op",
")",
"{",
"$",
"op",
"=",
"$",
"this",
"->",
"same",
"(",
"$",
"op",
",",
"$",
"this",
"->",
"prec",
")",
";",
"return",
"$",
"this",
"->",
"lt",
"(",
"$",
"op",
")",
"?",
"clone",
"$",
"this",
"... | Find the minimum of two numbers
@param int|float|string|Decimal $op operand
@return Decimal | [
"Find",
"the",
"minimum",
"of",
"two",
"numbers"
] | 854e182c6023fb2ac6c7893a7ba4cade967f0c4c | https://github.com/rtlopez/decimal/blob/854e182c6023fb2ac6c7893a7ba4cade967f0c4c/src/RtLopez/Decimal.php#L315-L319 |
222,754 | rtlopez/decimal | src/RtLopez/Decimal.php | Decimal.max | public function max($op)
{
$op = $this->same($op, $this->prec);
return $this->gt($op) ? clone $this : $op;
} | php | public function max($op)
{
$op = $this->same($op, $this->prec);
return $this->gt($op) ? clone $this : $op;
} | [
"public",
"function",
"max",
"(",
"$",
"op",
")",
"{",
"$",
"op",
"=",
"$",
"this",
"->",
"same",
"(",
"$",
"op",
",",
"$",
"this",
"->",
"prec",
")",
";",
"return",
"$",
"this",
"->",
"gt",
"(",
"$",
"op",
")",
"?",
"clone",
"$",
"this",
"... | Find the maximum of two numbers
@param int|float|string|Decimal $op operand
@return Decimal | [
"Find",
"the",
"maximum",
"of",
"two",
"numbers"
] | 854e182c6023fb2ac6c7893a7ba4cade967f0c4c | https://github.com/rtlopez/decimal/blob/854e182c6023fb2ac6c7893a7ba4cade967f0c4c/src/RtLopez/Decimal.php#L326-L330 |
222,755 | rtlopez/decimal | src/RtLopez/Decimal.php | Decimal.epsilon | public function epsilon()
{
$half = $this->same('0.5', $this->prec + 1);
$factor = $this->same('10', 0)->pow($this->prec);
return $half->div($factor);
} | php | public function epsilon()
{
$half = $this->same('0.5', $this->prec + 1);
$factor = $this->same('10', 0)->pow($this->prec);
return $half->div($factor);
} | [
"public",
"function",
"epsilon",
"(",
")",
"{",
"$",
"half",
"=",
"$",
"this",
"->",
"same",
"(",
"'0.5'",
",",
"$",
"this",
"->",
"prec",
"+",
"1",
")",
";",
"$",
"factor",
"=",
"$",
"this",
"->",
"same",
"(",
"'10'",
",",
"0",
")",
"->",
"p... | Calcualate epsilon for float comparision
@note returned precision is greater by one than original
@param int|float|string|Decimal $op operand
@return Decimal | [
"Calcualate",
"epsilon",
"for",
"float",
"comparision"
] | 854e182c6023fb2ac6c7893a7ba4cade967f0c4c | https://github.com/rtlopez/decimal/blob/854e182c6023fb2ac6c7893a7ba4cade967f0c4c/src/RtLopez/Decimal.php#L368-L373 |
222,756 | xcaliber-tech/omnipay-skrill | src/Omnipay/Skrill/Message/PaymentRequest.php | PaymentRequest.setReturnUrlTarget | public function setReturnUrlTarget($value)
{
switch ($value) {
case '_top':
$value = 1;
break;
case '_parent':
$value = 2;
break;
case '_self':
$value = 3;
break;
... | php | public function setReturnUrlTarget($value)
{
switch ($value) {
case '_top':
$value = 1;
break;
case '_parent':
$value = 2;
break;
case '_self':
$value = 3;
break;
... | [
"public",
"function",
"setReturnUrlTarget",
"(",
"$",
"value",
")",
"{",
"switch",
"(",
"$",
"value",
")",
"{",
"case",
"'_top'",
":",
"$",
"value",
"=",
"1",
";",
"break",
";",
"case",
"'_parent'",
":",
"$",
"value",
"=",
"2",
";",
"break",
";",
"... | Set the target in which the return url value is displayed upon successful payment
from the customer.
Default value is 1.
* 1 = _top
* 2 = _parent
* 3 = _self
* 4 = _blank
@param int $value return url target
@return $this | [
"Set",
"the",
"target",
"in",
"which",
"the",
"return",
"url",
"value",
"is",
"displayed",
"upon",
"successful",
"payment",
"from",
"the",
"customer",
"."
] | f90a185b5e26fb5b4150d664f01ad8048b460bcf | https://github.com/xcaliber-tech/omnipay-skrill/blob/f90a185b5e26fb5b4150d664f01ad8048b460bcf/src/Omnipay/Skrill/Message/PaymentRequest.php#L155-L179 |
222,757 | xcaliber-tech/omnipay-skrill | src/Omnipay/Skrill/Message/PaymentRequest.php | PaymentRequest.setCancelUrlTarget | public function setCancelUrlTarget($value)
{
switch ($value) {
case '_top':
$value = 1;
break;
case '_parent':
$value = 2;
break;
case '_self':
$value = 3;
break;
... | php | public function setCancelUrlTarget($value)
{
switch ($value) {
case '_top':
$value = 1;
break;
case '_parent':
$value = 2;
break;
case '_self':
$value = 3;
break;
... | [
"public",
"function",
"setCancelUrlTarget",
"(",
"$",
"value",
")",
"{",
"switch",
"(",
"$",
"value",
")",
"{",
"case",
"'_top'",
":",
"$",
"value",
"=",
"1",
";",
"break",
";",
"case",
"'_parent'",
":",
"$",
"value",
"=",
"2",
";",
"break",
";",
"... | Set the target in which the cancel url value is displayed upon cancellation of
payment by the customer.
Default value is 1.
* 1 = _top
* 2 = _parent
* 3 = _self
* 4 = _blank
@param int $value cancel url target
@return $this | [
"Set",
"the",
"target",
"in",
"which",
"the",
"cancel",
"url",
"value",
"is",
"displayed",
"upon",
"cancellation",
"of",
"payment",
"by",
"the",
"customer",
"."
] | f90a185b5e26fb5b4150d664f01ad8048b460bcf | https://github.com/xcaliber-tech/omnipay-skrill/blob/f90a185b5e26fb5b4150d664f01ad8048b460bcf/src/Omnipay/Skrill/Message/PaymentRequest.php#L233-L257 |
222,758 | FriendsOfOuro/geteventstore-php-core | src/EventStore.php | EventStore.navigateStreamFeed | public function navigateStreamFeed(StreamFeed $streamFeed, LinkRelation $relation): ?StreamFeed
{
$url = $streamFeed->getLinkUrl($relation);
if (empty($url)) {
return null;
}
return $this->readStreamFeed($url, $streamFeed->getEntryEmbedMode());
} | php | public function navigateStreamFeed(StreamFeed $streamFeed, LinkRelation $relation): ?StreamFeed
{
$url = $streamFeed->getLinkUrl($relation);
if (empty($url)) {
return null;
}
return $this->readStreamFeed($url, $streamFeed->getEntryEmbedMode());
} | [
"public",
"function",
"navigateStreamFeed",
"(",
"StreamFeed",
"$",
"streamFeed",
",",
"LinkRelation",
"$",
"relation",
")",
":",
"?",
"StreamFeed",
"{",
"$",
"url",
"=",
"$",
"streamFeed",
"->",
"getLinkUrl",
"(",
"$",
"relation",
")",
";",
"if",
"(",
"em... | Navigates a stream feed through link relations.
@param StreamFeed $streamFeed
@param LinkRelation $relation
@return StreamFeed|null
@throws StreamDeletedException
@throws StreamNotFoundException | [
"Navigates",
"a",
"stream",
"feed",
"through",
"link",
"relations",
"."
] | 76aac24ce7a688f8232f76ba24b3549222f20332 | https://github.com/FriendsOfOuro/geteventstore-php-core/blob/76aac24ce7a688f8232f76ba24b3549222f20332/src/EventStore.php#L104-L113 |
222,759 | FriendsOfOuro/geteventstore-php-core | src/EventStore.php | EventStore.openStreamFeed | public function openStreamFeed($streamName, EntryEmbedMode $embedMode = null): StreamFeed
{
$url = $this->getStreamUrl($streamName);
return $this->readStreamFeed($url, $embedMode);
} | php | public function openStreamFeed($streamName, EntryEmbedMode $embedMode = null): StreamFeed
{
$url = $this->getStreamUrl($streamName);
return $this->readStreamFeed($url, $embedMode);
} | [
"public",
"function",
"openStreamFeed",
"(",
"$",
"streamName",
",",
"EntryEmbedMode",
"$",
"embedMode",
"=",
"null",
")",
":",
"StreamFeed",
"{",
"$",
"url",
"=",
"$",
"this",
"->",
"getStreamUrl",
"(",
"$",
"streamName",
")",
";",
"return",
"$",
"this",
... | Opens a stream feed for read and navigation.
@param string $streamName
@param EntryEmbedMode|null $embedMode
@return StreamFeed
@throws StreamDeletedException
@throws StreamNotFoundException | [
"Opens",
"a",
"stream",
"feed",
"for",
"read",
"and",
"navigation",
"."
] | 76aac24ce7a688f8232f76ba24b3549222f20332 | https://github.com/FriendsOfOuro/geteventstore-php-core/blob/76aac24ce7a688f8232f76ba24b3549222f20332/src/EventStore.php#L126-L131 |
222,760 | FriendsOfOuro/geteventstore-php-core | src/EventStore.php | EventStore.readEvent | public function readEvent($eventUrl): Event
{
$request = $this->getJsonRequest($eventUrl);
$this->sendRequest($request);
$this->ensureStatusCodeIsGood($eventUrl);
$jsonResponse = $this->lastResponseAsJson();
return $this->createEventFromResponseContent($jsonResponse['conte... | php | public function readEvent($eventUrl): Event
{
$request = $this->getJsonRequest($eventUrl);
$this->sendRequest($request);
$this->ensureStatusCodeIsGood($eventUrl);
$jsonResponse = $this->lastResponseAsJson();
return $this->createEventFromResponseContent($jsonResponse['conte... | [
"public",
"function",
"readEvent",
"(",
"$",
"eventUrl",
")",
":",
"Event",
"{",
"$",
"request",
"=",
"$",
"this",
"->",
"getJsonRequest",
"(",
"$",
"eventUrl",
")",
";",
"$",
"this",
"->",
"sendRequest",
"(",
"$",
"request",
")",
";",
"$",
"this",
"... | Read a single event.
@param string $eventUrl
@return Event
@throws StreamDeletedException
@throws StreamNotFoundException
@throws UnauthorizedException | [
"Read",
"a",
"single",
"event",
"."
] | 76aac24ce7a688f8232f76ba24b3549222f20332 | https://github.com/FriendsOfOuro/geteventstore-php-core/blob/76aac24ce7a688f8232f76ba24b3549222f20332/src/EventStore.php#L144-L154 |
222,761 | FriendsOfOuro/geteventstore-php-core | src/EventStore.php | EventStore.readEventBatch | public function readEventBatch(array $eventUrls): array
{
$requests = array_map(
function ($eventUrl) {
return $this->getJsonRequest($eventUrl);
},
$eventUrls
);
$responses = $this->httpClient->sendRequestBatch($requests);
return ... | php | public function readEventBatch(array $eventUrls): array
{
$requests = array_map(
function ($eventUrl) {
return $this->getJsonRequest($eventUrl);
},
$eventUrls
);
$responses = $this->httpClient->sendRequestBatch($requests);
return ... | [
"public",
"function",
"readEventBatch",
"(",
"array",
"$",
"eventUrls",
")",
":",
"array",
"{",
"$",
"requests",
"=",
"array_map",
"(",
"function",
"(",
"$",
"eventUrl",
")",
"{",
"return",
"$",
"this",
"->",
"getJsonRequest",
"(",
"$",
"eventUrl",
")",
... | Reads a batch of events.
@param array $eventUrls
@return array | [
"Reads",
"a",
"batch",
"of",
"events",
"."
] | 76aac24ce7a688f8232f76ba24b3549222f20332 | https://github.com/FriendsOfOuro/geteventstore-php-core/blob/76aac24ce7a688f8232f76ba24b3549222f20332/src/EventStore.php#L163-L187 |
222,762 | FriendsOfOuro/geteventstore-php-core | src/EventStore.php | EventStore.extractStreamVersionFromLastResponse | private function extractStreamVersionFromLastResponse(string $streamUrl)
{
$locationHeaders = $this->getLastResponse()->getHeader('Location');
if (
!empty($locationHeaders[0])
&& 0 === strpos($locationHeaders[0], $streamUrl)
) {
$version = substr($locatio... | php | private function extractStreamVersionFromLastResponse(string $streamUrl)
{
$locationHeaders = $this->getLastResponse()->getHeader('Location');
if (
!empty($locationHeaders[0])
&& 0 === strpos($locationHeaders[0], $streamUrl)
) {
$version = substr($locatio... | [
"private",
"function",
"extractStreamVersionFromLastResponse",
"(",
"string",
"$",
"streamUrl",
")",
"{",
"$",
"locationHeaders",
"=",
"$",
"this",
"->",
"getLastResponse",
"(",
")",
"->",
"getHeader",
"(",
"'Location'",
")",
";",
"if",
"(",
"!",
"empty",
"(",... | Extracts created version after writing to a stream.
The Event Store responds with a HTTP message containing a Location
header pointing to the newly created stream. This method extracts
the last part of that URI an returns the value.
http://127.0.0.1:2113/streams/newstream/13 -> 13
@param string $streamUrl
@return b... | [
"Extracts",
"created",
"version",
"after",
"writing",
"to",
"a",
"stream",
"."
] | 76aac24ce7a688f8232f76ba24b3549222f20332 | https://github.com/FriendsOfOuro/geteventstore-php-core/blob/76aac24ce7a688f8232f76ba24b3549222f20332/src/EventStore.php#L398-L412 |
222,763 | EcomDev/EcomDev_Varnish | src/app/code/community/EcomDev/Varnish/Model/Observer.php | EcomDev_Varnish_Model_Observer.controllerActionPredispatch | public function controllerActionPredispatch(Varien_Event_Observer $observer)
{
if (!$this->_getHelper()->isActive()) {
return $this;
}
/* @var $controllerAction Mage_Core_Controller_Front_Action */
$controllerAction = $observer->getControllerAction();
$this->_ge... | php | public function controllerActionPredispatch(Varien_Event_Observer $observer)
{
if (!$this->_getHelper()->isActive()) {
return $this;
}
/* @var $controllerAction Mage_Core_Controller_Front_Action */
$controllerAction = $observer->getControllerAction();
$this->_ge... | [
"public",
"function",
"controllerActionPredispatch",
"(",
"Varien_Event_Observer",
"$",
"observer",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"_getHelper",
"(",
")",
"->",
"isActive",
"(",
")",
")",
"{",
"return",
"$",
"this",
";",
"}",
"/* @var $controll... | Sets the current page on pre dispatch
@param Varien_Event_Observer $observer
@return $this | [
"Sets",
"the",
"current",
"page",
"on",
"pre",
"dispatch"
] | 228b7b1bdaae15c1895f2533667fffa515447915 | https://github.com/EcomDev/EcomDev_Varnish/blob/228b7b1bdaae15c1895f2533667fffa515447915/src/app/code/community/EcomDev/Varnish/Model/Observer.php#L78-L115 |
222,764 | EcomDev/EcomDev_Varnish | src/app/code/community/EcomDev/Varnish/Model/Observer.php | EcomDev_Varnish_Model_Observer.controllerActionLayoutLoadBefore | public function controllerActionLayoutLoadBefore(Varien_Event_Observer $observer)
{
if (!$this->_getHelper()->isActive()) {
return;
}
$updateModel = $observer->getLayout()->getUpdate();
$handles = $updateModel->getHandles();
$allowedEsi = $this->_getHelpe... | php | public function controllerActionLayoutLoadBefore(Varien_Event_Observer $observer)
{
if (!$this->_getHelper()->isActive()) {
return;
}
$updateModel = $observer->getLayout()->getUpdate();
$handles = $updateModel->getHandles();
$allowedEsi = $this->_getHelpe... | [
"public",
"function",
"controllerActionLayoutLoadBefore",
"(",
"Varien_Event_Observer",
"$",
"observer",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"_getHelper",
"(",
")",
"->",
"isActive",
"(",
")",
")",
"{",
"return",
";",
"}",
"$",
"updateModel",
"=",
... | Adds ESI to the layout cache | [
"Adds",
"ESI",
"to",
"the",
"layout",
"cache"
] | 228b7b1bdaae15c1895f2533667fffa515447915 | https://github.com/EcomDev/EcomDev_Varnish/blob/228b7b1bdaae15c1895f2533667fffa515447915/src/app/code/community/EcomDev/Varnish/Model/Observer.php#L121-L147 |
222,765 | EcomDev/EcomDev_Varnish | src/app/code/community/EcomDev/Varnish/Model/Observer.php | EcomDev_Varnish_Model_Observer._addResponseHeaders | protected function _addResponseHeaders($controllerAction)
{
if ($this->_getHelper()->isDebug()) {
$controllerAction->getResponse()->setHeader('X-Debug', '1');
}
if ($this->_getHelper()->getIsEsiUsed()) {
$controllerAction->getResponse()->setHeader(
'S... | php | protected function _addResponseHeaders($controllerAction)
{
if ($this->_getHelper()->isDebug()) {
$controllerAction->getResponse()->setHeader('X-Debug', '1');
}
if ($this->_getHelper()->getIsEsiUsed()) {
$controllerAction->getResponse()->setHeader(
'S... | [
"protected",
"function",
"_addResponseHeaders",
"(",
"$",
"controllerAction",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_getHelper",
"(",
")",
"->",
"isDebug",
"(",
")",
")",
"{",
"$",
"controllerAction",
"->",
"getResponse",
"(",
")",
"->",
"setHeader",
"(... | Adds varnish response headers
@param Mage_Core_Controller_Front_Action $controllerAction
@return $this | [
"Adds",
"varnish",
"response",
"headers"
] | 228b7b1bdaae15c1895f2533667fffa515447915 | https://github.com/EcomDev/EcomDev_Varnish/blob/228b7b1bdaae15c1895f2533667fffa515447915/src/app/code/community/EcomDev/Varnish/Model/Observer.php#L167-L213 |
222,766 | EcomDev/EcomDev_Varnish | src/app/code/community/EcomDev/Varnish/Model/Observer.php | EcomDev_Varnish_Model_Observer.controllerActionPostdispatch | public function controllerActionPostdispatch(Varien_Event_Observer $observer)
{
if (!$this->_getHelper()->isActive()) {
return;
}
/* @var $controllerAction Mage_Core_Controller_Front_Action */
$controllerAction = $observer->getControllerAction();
if (!M... | php | public function controllerActionPostdispatch(Varien_Event_Observer $observer)
{
if (!$this->_getHelper()->isActive()) {
return;
}
/* @var $controllerAction Mage_Core_Controller_Front_Action */
$controllerAction = $observer->getControllerAction();
if (!M... | [
"public",
"function",
"controllerActionPostdispatch",
"(",
"Varien_Event_Observer",
"$",
"observer",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"_getHelper",
"(",
")",
"->",
"isActive",
"(",
")",
")",
"{",
"return",
";",
"}",
"/* @var $controllerAction Mage_Co... | Observes all controller post dispatches
@param Varien_Event_Observer $observer
@return $this | [
"Observes",
"all",
"controller",
"post",
"dispatches"
] | 228b7b1bdaae15c1895f2533667fffa515447915 | https://github.com/EcomDev/EcomDev_Varnish/blob/228b7b1bdaae15c1895f2533667fffa515447915/src/app/code/community/EcomDev/Varnish/Model/Observer.php#L221-L241 |
222,767 | EcomDev/EcomDev_Varnish | src/app/code/community/EcomDev/Varnish/Model/Observer.php | EcomDev_Varnish_Model_Observer.performBan | public function performBan()
{
if (!$this->_getHelper()->isActive()) {
return $this;
}
$tagsToBan = array_unique($this->_getProcessor()->getTagsToBan());
if ($tagsToBan) {
try {
$tagsToBan = array_map(
array(Mage::h... | php | public function performBan()
{
if (!$this->_getHelper()->isActive()) {
return $this;
}
$tagsToBan = array_unique($this->_getProcessor()->getTagsToBan());
if ($tagsToBan) {
try {
$tagsToBan = array_map(
array(Mage::h... | [
"public",
"function",
"performBan",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"_getHelper",
"(",
")",
"->",
"isActive",
"(",
")",
")",
"{",
"return",
"$",
"this",
";",
"}",
"$",
"tagsToBan",
"=",
"array_unique",
"(",
"$",
"this",
"->",
"_ge... | Performs Varnish BAN of object tags, if they exists | [
"Performs",
"Varnish",
"BAN",
"of",
"object",
"tags",
"if",
"they",
"exists"
] | 228b7b1bdaae15c1895f2533667fffa515447915 | https://github.com/EcomDev/EcomDev_Varnish/blob/228b7b1bdaae15c1895f2533667fffa515447915/src/app/code/community/EcomDev/Varnish/Model/Observer.php#L246-L280 |
222,768 | EcomDev/EcomDev_Varnish | src/app/code/community/EcomDev/Varnish/Model/Observer.php | EcomDev_Varnish_Model_Observer.backgroundBan | public function backgroundBan()
{
$queue = Mage::app()->getCache()->load(self::VARNISH_CACHE_QUEUE, true);
if ($queue) {
$queue = unserialize($queue);
// Run cleaning process separately if amount of stored tags too large
$chunks = array_chunk(
$qu... | php | public function backgroundBan()
{
$queue = Mage::app()->getCache()->load(self::VARNISH_CACHE_QUEUE, true);
if ($queue) {
$queue = unserialize($queue);
// Run cleaning process separately if amount of stored tags too large
$chunks = array_chunk(
$qu... | [
"public",
"function",
"backgroundBan",
"(",
")",
"{",
"$",
"queue",
"=",
"Mage",
"::",
"app",
"(",
")",
"->",
"getCache",
"(",
")",
"->",
"load",
"(",
"self",
"::",
"VARNISH_CACHE_QUEUE",
",",
"true",
")",
";",
"if",
"(",
"$",
"queue",
")",
"{",
"$... | Background clean up of the cache tags | [
"Background",
"clean",
"up",
"of",
"the",
"cache",
"tags"
] | 228b7b1bdaae15c1895f2533667fffa515447915 | https://github.com/EcomDev/EcomDev_Varnish/blob/228b7b1bdaae15c1895f2533667fffa515447915/src/app/code/community/EcomDev/Varnish/Model/Observer.php#L286-L304 |
222,769 | EcomDev/EcomDev_Varnish | src/app/code/community/EcomDev/Varnish/Model/Observer.php | EcomDev_Varnish_Model_Observer.coreBlockAbstractToHtmlAfter | public function coreBlockAbstractToHtmlAfter(Varien_Event_Observer $observer)
{
if (!$this->_getHelper()->isAllowedCurrentPage()) {
return $this;
}
$block = $observer->getBlock();
$objects = $this->_getCollector()->collect($block);
array_splice($this->_co... | php | public function coreBlockAbstractToHtmlAfter(Varien_Event_Observer $observer)
{
if (!$this->_getHelper()->isAllowedCurrentPage()) {
return $this;
}
$block = $observer->getBlock();
$objects = $this->_getCollector()->collect($block);
array_splice($this->_co... | [
"public",
"function",
"coreBlockAbstractToHtmlAfter",
"(",
"Varien_Event_Observer",
"$",
"observer",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"_getHelper",
"(",
")",
"->",
"isAllowedCurrentPage",
"(",
")",
")",
"{",
"return",
"$",
"this",
";",
"}",
"$",
... | Checks what have been rendered via collectors for passing data later on to processors
@param Varien_Event_Observer $observer
@return $this | [
"Checks",
"what",
"have",
"been",
"rendered",
"via",
"collectors",
"for",
"passing",
"data",
"later",
"on",
"to",
"processors"
] | 228b7b1bdaae15c1895f2533667fffa515447915 | https://github.com/EcomDev/EcomDev_Varnish/blob/228b7b1bdaae15c1895f2533667fffa515447915/src/app/code/community/EcomDev/Varnish/Model/Observer.php#L312-L322 |
222,770 | EcomDev/EcomDev_Varnish | src/app/code/community/EcomDev/Varnish/Model/Observer.php | EcomDev_Varnish_Model_Observer.updateMessageBlock | public function updateMessageBlock(Varien_Event_Observer $observer)
{
$block = $observer->getBlock();
if ($block instanceof Mage_Core_Block_Messages
&& !($block instanceof EcomDev_Varnish_Block_MessagesInterface)) {
if (!$this->_getHelper()->isAllowedCurrentPage()) {
... | php | public function updateMessageBlock(Varien_Event_Observer $observer)
{
$block = $observer->getBlock();
if ($block instanceof Mage_Core_Block_Messages
&& !($block instanceof EcomDev_Varnish_Block_MessagesInterface)) {
if (!$this->_getHelper()->isAllowedCurrentPage()) {
... | [
"public",
"function",
"updateMessageBlock",
"(",
"Varien_Event_Observer",
"$",
"observer",
")",
"{",
"$",
"block",
"=",
"$",
"observer",
"->",
"getBlock",
"(",
")",
";",
"if",
"(",
"$",
"block",
"instanceof",
"Mage_Core_Block_Messages",
"&&",
"!",
"(",
"$",
... | Updates message block
@param Varien_Event_Observer $observer
@return $this | [
"Updates",
"message",
"block"
] | 228b7b1bdaae15c1895f2533667fffa515447915 | https://github.com/EcomDev/EcomDev_Varnish/blob/228b7b1bdaae15c1895f2533667fffa515447915/src/app/code/community/EcomDev/Varnish/Model/Observer.php#L366-L382 |
222,771 | EcomDev/EcomDev_Varnish | src/app/code/community/EcomDev/Varnish/Model/Customer/Observer.php | EcomDev_Varnish_Model_Customer_Observer.setCardCookie | public function setCardCookie($observer)
{
$quoteData = $observer->getQuote()->debug();
unset($quoteData['updated_at']);
$this->setCookies(array(
self::COOKIE_CART => $this->_hashData($quoteData),
self::COOKIE_SEGMENT => $this->_hashData($this->_getHelper()->getCustom... | php | public function setCardCookie($observer)
{
$quoteData = $observer->getQuote()->debug();
unset($quoteData['updated_at']);
$this->setCookies(array(
self::COOKIE_CART => $this->_hashData($quoteData),
self::COOKIE_SEGMENT => $this->_hashData($this->_getHelper()->getCustom... | [
"public",
"function",
"setCardCookie",
"(",
"$",
"observer",
")",
"{",
"$",
"quoteData",
"=",
"$",
"observer",
"->",
"getQuote",
"(",
")",
"->",
"debug",
"(",
")",
";",
"unset",
"(",
"$",
"quoteData",
"[",
"'updated_at'",
"]",
")",
";",
"$",
"this",
... | Sets card cookie
@param Varien_Event_Observer $observer | [
"Sets",
"card",
"cookie"
] | 228b7b1bdaae15c1895f2533667fffa515447915 | https://github.com/EcomDev/EcomDev_Varnish/blob/228b7b1bdaae15c1895f2533667fffa515447915/src/app/code/community/EcomDev/Varnish/Model/Customer/Observer.php#L56-L64 |
222,772 | EcomDev/EcomDev_Varnish | src/app/code/community/EcomDev/Varnish/Model/Customer/Observer.php | EcomDev_Varnish_Model_Customer_Observer.setLoginCookie | public function setLoginCookie()
{
$this->setCookies(array(
self::COOKIE_CART => $this->_hashData(Varien_Date::now()),
self::COOKIE_SEGMENT => $this->_hashData($this->_getHelper()->getCustomerSegment()),
self::COOKIE_CUSTOMER => $this->_hashData(Varien_Date::now()),
... | php | public function setLoginCookie()
{
$this->setCookies(array(
self::COOKIE_CART => $this->_hashData(Varien_Date::now()),
self::COOKIE_SEGMENT => $this->_hashData($this->_getHelper()->getCustomerSegment()),
self::COOKIE_CUSTOMER => $this->_hashData(Varien_Date::now()),
... | [
"public",
"function",
"setLoginCookie",
"(",
")",
"{",
"$",
"this",
"->",
"setCookies",
"(",
"array",
"(",
"self",
"::",
"COOKIE_CART",
"=>",
"$",
"this",
"->",
"_hashData",
"(",
"Varien_Date",
"::",
"now",
"(",
")",
")",
",",
"self",
"::",
"COOKIE_SEGME... | Sets login cookie | [
"Sets",
"login",
"cookie"
] | 228b7b1bdaae15c1895f2533667fffa515447915 | https://github.com/EcomDev/EcomDev_Varnish/blob/228b7b1bdaae15c1895f2533667fffa515447915/src/app/code/community/EcomDev/Varnish/Model/Customer/Observer.php#L77-L85 |
222,773 | EcomDev/EcomDev_Varnish | src/app/code/community/EcomDev/Varnish/Block/Js/Wrapper.php | EcomDev_Varnish_Block_Js_Wrapper.setBlockName | public function setBlockName($blockName)
{
$this->setData('block_name', $blockName);
$this->append($this->getLayout()->getBlock($blockName));
return $this;
} | php | public function setBlockName($blockName)
{
$this->setData('block_name', $blockName);
$this->append($this->getLayout()->getBlock($blockName));
return $this;
} | [
"public",
"function",
"setBlockName",
"(",
"$",
"blockName",
")",
"{",
"$",
"this",
"->",
"setData",
"(",
"'block_name'",
",",
"$",
"blockName",
")",
";",
"$",
"this",
"->",
"append",
"(",
"$",
"this",
"->",
"getLayout",
"(",
")",
"->",
"getBlock",
"("... | Sets block name
@param string $blockName
@return $this | [
"Sets",
"block",
"name"
] | 228b7b1bdaae15c1895f2533667fffa515447915 | https://github.com/EcomDev/EcomDev_Varnish/blob/228b7b1bdaae15c1895f2533667fffa515447915/src/app/code/community/EcomDev/Varnish/Block/Js/Wrapper.php#L34-L39 |
222,774 | EcomDev/EcomDev_Varnish | src/app/code/community/EcomDev/Varnish/Block/Js/Wrapper.php | EcomDev_Varnish_Block_Js_Wrapper.setAdditionalCookie | public function setAdditionalCookie($cookie, $expectedValue = false)
{
$additionalCookie = $this->_getData('_additional_cookie');
if (!$additionalCookie || !is_array($additionalCookie)) {
$additionalCookie = array();
}
$additionalCookie[$cookie] = $expectedValue;
... | php | public function setAdditionalCookie($cookie, $expectedValue = false)
{
$additionalCookie = $this->_getData('_additional_cookie');
if (!$additionalCookie || !is_array($additionalCookie)) {
$additionalCookie = array();
}
$additionalCookie[$cookie] = $expectedValue;
... | [
"public",
"function",
"setAdditionalCookie",
"(",
"$",
"cookie",
",",
"$",
"expectedValue",
"=",
"false",
")",
"{",
"$",
"additionalCookie",
"=",
"$",
"this",
"->",
"_getData",
"(",
"'_additional_cookie'",
")",
";",
"if",
"(",
"!",
"$",
"additionalCookie",
"... | Sets additional cookie for block
@param $cookie
@param bool|false $expectedValue
@return $this | [
"Sets",
"additional",
"cookie",
"for",
"block"
] | 228b7b1bdaae15c1895f2533667fffa515447915 | https://github.com/EcomDev/EcomDev_Varnish/blob/228b7b1bdaae15c1895f2533667fffa515447915/src/app/code/community/EcomDev/Varnish/Block/Js/Wrapper.php#L74-L84 |
222,775 | EcomDev/EcomDev_Varnish | src/app/code/community/EcomDev/Varnish/Block/Js/Wrapper.php | EcomDev_Varnish_Block_Js_Wrapper.removeAdditionalCookie | public function removeAdditionalCookie($cookie)
{
$additionalCookie = $this->_getData('_additional_cookie');
if (!$additionalCookie || !is_array($additionalCookie)) {
return $this;
}
if (isset($additionalCookie[$cookie])) {
unset($additionalCookie[$cookie]);
... | php | public function removeAdditionalCookie($cookie)
{
$additionalCookie = $this->_getData('_additional_cookie');
if (!$additionalCookie || !is_array($additionalCookie)) {
return $this;
}
if (isset($additionalCookie[$cookie])) {
unset($additionalCookie[$cookie]);
... | [
"public",
"function",
"removeAdditionalCookie",
"(",
"$",
"cookie",
")",
"{",
"$",
"additionalCookie",
"=",
"$",
"this",
"->",
"_getData",
"(",
"'_additional_cookie'",
")",
";",
"if",
"(",
"!",
"$",
"additionalCookie",
"||",
"!",
"is_array",
"(",
"$",
"addit... | Removes additional cookie from block
@param string $cookie
@return $this | [
"Removes",
"additional",
"cookie",
"from",
"block"
] | 228b7b1bdaae15c1895f2533667fffa515447915 | https://github.com/EcomDev/EcomDev_Varnish/blob/228b7b1bdaae15c1895f2533667fffa515447915/src/app/code/community/EcomDev/Varnish/Block/Js/Wrapper.php#L92-L105 |
222,776 | EcomDev/EcomDev_Varnish | src/app/code/community/EcomDev/Varnish/Block/Js/Token.php | EcomDev_Varnish_Block_Js_Token.setTokenInputName | public function setTokenInputName($tokenInputName = null)
{
if ($tokenInputName === null) {
$tokenInputName = 'form_key';
}
$this->setData('token_input_name', $tokenInputName);
return $this;
} | php | public function setTokenInputName($tokenInputName = null)
{
if ($tokenInputName === null) {
$tokenInputName = 'form_key';
}
$this->setData('token_input_name', $tokenInputName);
return $this;
} | [
"public",
"function",
"setTokenInputName",
"(",
"$",
"tokenInputName",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"tokenInputName",
"===",
"null",
")",
"{",
"$",
"tokenInputName",
"=",
"'form_key'",
";",
"}",
"$",
"this",
"->",
"setData",
"(",
"'token_input_name... | Sets token input name
@param string|null $tokenInputName
@return $this | [
"Sets",
"token",
"input",
"name"
] | 228b7b1bdaae15c1895f2533667fffa515447915 | https://github.com/EcomDev/EcomDev_Varnish/blob/228b7b1bdaae15c1895f2533667fffa515447915/src/app/code/community/EcomDev/Varnish/Block/Js/Token.php#L36-L44 |
222,777 | EcomDev/EcomDev_Varnish | src/app/code/community/EcomDev/Varnish/Block/Js/Token.php | EcomDev_Varnish_Block_Js_Token.removeObservedCssRule | public function removeObservedCssRule($rule)
{
if (isset($this->observedCssRules[$rule])) {
unset($this->observedCssRules[$rule]);
}
return $this;
} | php | public function removeObservedCssRule($rule)
{
if (isset($this->observedCssRules[$rule])) {
unset($this->observedCssRules[$rule]);
}
return $this;
} | [
"public",
"function",
"removeObservedCssRule",
"(",
"$",
"rule",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"observedCssRules",
"[",
"$",
"rule",
"]",
")",
")",
"{",
"unset",
"(",
"$",
"this",
"->",
"observedCssRules",
"[",
"$",
"rule",
"]",... | Removes observed css rule
@param string $rule
@return $this | [
"Removes",
"observed",
"css",
"rule"
] | 228b7b1bdaae15c1895f2533667fffa515447915 | https://github.com/EcomDev/EcomDev_Varnish/blob/228b7b1bdaae15c1895f2533667fffa515447915/src/app/code/community/EcomDev/Varnish/Block/Js/Token.php#L77-L84 |
222,778 | EcomDev/EcomDev_Varnish | src/app/code/community/EcomDev/Varnish/Block/Js/Token.php | EcomDev_Varnish_Block_Js_Token.setUrlKeyParam | public function setUrlKeyParam($urlKeyParam = null)
{
if ($urlKeyParam === null) {
$urlKeyParam = $this->getTokenInputName();
}
$this->setData('url_key_param', $urlKeyParam);
return $this;
} | php | public function setUrlKeyParam($urlKeyParam = null)
{
if ($urlKeyParam === null) {
$urlKeyParam = $this->getTokenInputName();
}
$this->setData('url_key_param', $urlKeyParam);
return $this;
} | [
"public",
"function",
"setUrlKeyParam",
"(",
"$",
"urlKeyParam",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"urlKeyParam",
"===",
"null",
")",
"{",
"$",
"urlKeyParam",
"=",
"$",
"this",
"->",
"getTokenInputName",
"(",
")",
";",
"}",
"$",
"this",
"->",
"set... | Sets url key param name
@param string|null $urlKeyParam
@return $this | [
"Sets",
"url",
"key",
"param",
"name"
] | 228b7b1bdaae15c1895f2533667fffa515447915 | https://github.com/EcomDev/EcomDev_Varnish/blob/228b7b1bdaae15c1895f2533667fffa515447915/src/app/code/community/EcomDev/Varnish/Block/Js/Token.php#L116-L124 |
222,779 | EcomDev/EcomDev_Varnish | src/app/code/community/EcomDev/Varnish/Block/Js/Token.php | EcomDev_Varnish_Block_Js_Token.setCookieName | public function setCookieName($cookieName = null)
{
if ($cookieName === null) {
$cookieName = EcomDev_Varnish_Helper_Data::COOKIE_TOKEN;
}
$this->setData('cookie_name', $cookieName);
return $this;
} | php | public function setCookieName($cookieName = null)
{
if ($cookieName === null) {
$cookieName = EcomDev_Varnish_Helper_Data::COOKIE_TOKEN;
}
$this->setData('cookie_name', $cookieName);
return $this;
} | [
"public",
"function",
"setCookieName",
"(",
"$",
"cookieName",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"cookieName",
"===",
"null",
")",
"{",
"$",
"cookieName",
"=",
"EcomDev_Varnish_Helper_Data",
"::",
"COOKIE_TOKEN",
";",
"}",
"$",
"this",
"->",
"setData",
... | Sets cookie name for token retrieval
@param string|null $cookieName
@return $this | [
"Sets",
"cookie",
"name",
"for",
"token",
"retrieval"
] | 228b7b1bdaae15c1895f2533667fffa515447915 | https://github.com/EcomDev/EcomDev_Varnish/blob/228b7b1bdaae15c1895f2533667fffa515447915/src/app/code/community/EcomDev/Varnish/Block/Js/Token.php#L146-L154 |
222,780 | EcomDev/EcomDev_Varnish | src/app/code/community/EcomDev/Varnish/Block/Js/Token.php | EcomDev_Varnish_Block_Js_Token.getJson | public function getJson()
{
$json = array(
'urlKeyParam' => $this->getUrlKeyParam(),
'inputFieldName' => $this->getTokenInputName(),
'observedCssRules' => $this->getObservedCssRules(),
'requestUrl' => $this->getTokenUrl(),
'cookieName' => $this->ge... | php | public function getJson()
{
$json = array(
'urlKeyParam' => $this->getUrlKeyParam(),
'inputFieldName' => $this->getTokenInputName(),
'observedCssRules' => $this->getObservedCssRules(),
'requestUrl' => $this->getTokenUrl(),
'cookieName' => $this->ge... | [
"public",
"function",
"getJson",
"(",
")",
"{",
"$",
"json",
"=",
"array",
"(",
"'urlKeyParam'",
"=>",
"$",
"this",
"->",
"getUrlKeyParam",
"(",
")",
",",
"'inputFieldName'",
"=>",
"$",
"this",
"->",
"getTokenInputName",
"(",
")",
",",
"'observedCssRules'",
... | Returns json for JavaScript class
@return string | [
"Returns",
"json",
"for",
"JavaScript",
"class"
] | 228b7b1bdaae15c1895f2533667fffa515447915 | https://github.com/EcomDev/EcomDev_Varnish/blob/228b7b1bdaae15c1895f2533667fffa515447915/src/app/code/community/EcomDev/Varnish/Block/Js/Token.php#L161-L172 |
222,781 | EcomDev/EcomDev_Varnish | src/app/code/community/EcomDev/Varnish/Model/AbstractApplicable.php | EcomDev_Varnish_Model_AbstractApplicable.isApplicable | public function isApplicable($object)
{
foreach ($this->_applicableClasses as $className) {
if ($object instanceof $className) {
return true;
}
}
return false;
} | php | public function isApplicable($object)
{
foreach ($this->_applicableClasses as $className) {
if ($object instanceof $className) {
return true;
}
}
return false;
} | [
"public",
"function",
"isApplicable",
"(",
"$",
"object",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"_applicableClasses",
"as",
"$",
"className",
")",
"{",
"if",
"(",
"$",
"object",
"instanceof",
"$",
"className",
")",
"{",
"return",
"true",
";",
"}",... | Returns true if one of the object is an instance of applicable class
@param object $object
@return bool | [
"Returns",
"true",
"if",
"one",
"of",
"the",
"object",
"is",
"an",
"instance",
"of",
"applicable",
"class"
] | 228b7b1bdaae15c1895f2533667fffa515447915 | https://github.com/EcomDev/EcomDev_Varnish/blob/228b7b1bdaae15c1895f2533667fffa515447915/src/app/code/community/EcomDev/Varnish/Model/AbstractApplicable.php#L38-L47 |
222,782 | gordalina/easypay-php | src/Gordalina/Easypay/Payment/Payment.php | Payment.setMaxDate | public function setMaxDate($maxDate)
{
$date = \DateTime::createFromFormat(self::MAX_DATE_FORMAT, $maxDate);
$isValid = $date && $date->format(self::MAX_DATE_FORMAT) == $maxDate;
if (!$isValid) {
throw new \InvalidArgumentException('Maximum payment date must be in that format: '... | php | public function setMaxDate($maxDate)
{
$date = \DateTime::createFromFormat(self::MAX_DATE_FORMAT, $maxDate);
$isValid = $date && $date->format(self::MAX_DATE_FORMAT) == $maxDate;
if (!$isValid) {
throw new \InvalidArgumentException('Maximum payment date must be in that format: '... | [
"public",
"function",
"setMaxDate",
"(",
"$",
"maxDate",
")",
"{",
"$",
"date",
"=",
"\\",
"DateTime",
"::",
"createFromFormat",
"(",
"self",
"::",
"MAX_DATE_FORMAT",
",",
"$",
"maxDate",
")",
";",
"$",
"isValid",
"=",
"$",
"date",
"&&",
"$",
"date",
"... | This method will define a due date for the payment
@param $maxDate
@throws \InvalidArgumentException If maxDate is not in the format defined in Payment::MAX_DATE_FORMAT | [
"This",
"method",
"will",
"define",
"a",
"due",
"date",
"for",
"the",
"payment"
] | 23e8d462f33834233cad4e9fbe9fc57267c1e573 | https://github.com/gordalina/easypay-php/blob/23e8d462f33834233cad4e9fbe9fc57267c1e573/src/Gordalina/Easypay/Payment/Payment.php#L104-L114 |
222,783 | FriendsOfOuro/geteventstore-php-core | src/ValueObjects/StringLiteral/StringLiteral.php | StringLiteral.sameValueAs | public function sameValueAs(ValueObjectInterface $stringLiteral)
{
if (false === Util::classEquals($this, $stringLiteral)) {
return false;
}
return $this->toNative() === $stringLiteral->toNative();
} | php | public function sameValueAs(ValueObjectInterface $stringLiteral)
{
if (false === Util::classEquals($this, $stringLiteral)) {
return false;
}
return $this->toNative() === $stringLiteral->toNative();
} | [
"public",
"function",
"sameValueAs",
"(",
"ValueObjectInterface",
"$",
"stringLiteral",
")",
"{",
"if",
"(",
"false",
"===",
"Util",
"::",
"classEquals",
"(",
"$",
"this",
",",
"$",
"stringLiteral",
")",
")",
"{",
"return",
"false",
";",
"}",
"return",
"$"... | Tells whether two string literals are equal by comparing their values.
@param ValueObjectInterface $stringLiteral
@return bool | [
"Tells",
"whether",
"two",
"string",
"literals",
"are",
"equal",
"by",
"comparing",
"their",
"values",
"."
] | 76aac24ce7a688f8232f76ba24b3549222f20332 | https://github.com/FriendsOfOuro/geteventstore-php-core/blob/76aac24ce7a688f8232f76ba24b3549222f20332/src/ValueObjects/StringLiteral/StringLiteral.php#L57-L64 |
222,784 | compropago/compropago-php | src/Resources/Payments/Cash.php | Cash.getDefaultProviders | public function getDefaultProviders()
{
$endpoint = "{$this->apiUrl}/providers/true";
$res = Requests::get($endpoint);
$this->validateResponse($res);
return json_decode($res->body, true);
} | php | public function getDefaultProviders()
{
$endpoint = "{$this->apiUrl}/providers/true";
$res = Requests::get($endpoint);
$this->validateResponse($res);
return json_decode($res->body, true);
} | [
"public",
"function",
"getDefaultProviders",
"(",
")",
"{",
"$",
"endpoint",
"=",
"\"{$this->apiUrl}/providers/true\"",
";",
"$",
"res",
"=",
"Requests",
"::",
"get",
"(",
"$",
"endpoint",
")",
";",
"$",
"this",
"->",
"validateResponse",
"(",
"$",
"res",
")"... | Return a list of the default Cash Providers of ComproPago
@return array List of all posible providers
@throws \Exception Request error or exception | [
"Return",
"a",
"list",
"of",
"the",
"default",
"Cash",
"Providers",
"of",
"ComproPago"
] | dc11d7cba778123bbf84860b4bb5d8dbfb78598f | https://github.com/compropago/compropago-php/blob/dc11d7cba778123bbf84860b4bb5d8dbfb78598f/src/Resources/Payments/Cash.php#L26-L34 |
222,785 | compropago/compropago-php | src/Resources/Payments/Cash.php | Cash.getProviders | public function getProviders($limit = 0, $currency = 'MXN')
{
$endpoint = "{$this->apiUrl}/providers";
if ($limit > 0) {
$endpoint .= '?order_total='.$limit;
}
if ($limit > 0 && !empty($currency) && $currency != 'MXN') {
$endpoint .= '¤cy='.$currency;
... | php | public function getProviders($limit = 0, $currency = 'MXN')
{
$endpoint = "{$this->apiUrl}/providers";
if ($limit > 0) {
$endpoint .= '?order_total='.$limit;
}
if ($limit > 0 && !empty($currency) && $currency != 'MXN') {
$endpoint .= '¤cy='.$currency;
... | [
"public",
"function",
"getProviders",
"(",
"$",
"limit",
"=",
"0",
",",
"$",
"currency",
"=",
"'MXN'",
")",
"{",
"$",
"endpoint",
"=",
"\"{$this->apiUrl}/providers\"",
";",
"if",
"(",
"$",
"limit",
">",
"0",
")",
"{",
"$",
"endpoint",
".=",
"'?order_tota... | Return a specific providers filtered by CP keys and order amounr
@param float $limit Minimum limit amount that the provider has to support
@param string $currency Currency of the limit amount
@return array List of filtered providers
@throws \Exception Request error or exception | [
"Return",
"a",
"specific",
"providers",
"filtered",
"by",
"CP",
"keys",
"and",
"order",
"amounr"
] | dc11d7cba778123bbf84860b4bb5d8dbfb78598f | https://github.com/compropago/compropago-php/blob/dc11d7cba778123bbf84860b4bb5d8dbfb78598f/src/Resources/Payments/Cash.php#L46-L62 |
222,786 | compropago/compropago-php | src/Resources/Payments/Cash.php | Cash.createOrder | public function createOrder($data)
{
$endpoint = "{$this->apiUrl}/charges";
$res = Requests::post(
$endpoint,
$this->headers,
json_encode($data),
$this->options
);
$this->validateResponse($res);
return json_decode($res->body, ... | php | public function createOrder($data)
{
$endpoint = "{$this->apiUrl}/charges";
$res = Requests::post(
$endpoint,
$this->headers,
json_encode($data),
$this->options
);
$this->validateResponse($res);
return json_decode($res->body, ... | [
"public",
"function",
"createOrder",
"(",
"$",
"data",
")",
"{",
"$",
"endpoint",
"=",
"\"{$this->apiUrl}/charges\"",
";",
"$",
"res",
"=",
"Requests",
"::",
"post",
"(",
"$",
"endpoint",
",",
"$",
"this",
"->",
"headers",
",",
"json_encode",
"(",
"$",
"... | Create a cash order in ComproPago
@param array $data Order information like customer data, price currency an product
@return array Structure with order details
@throws \Exception Request error or exception | [
"Create",
"a",
"cash",
"order",
"in",
"ComproPago"
] | dc11d7cba778123bbf84860b4bb5d8dbfb78598f | https://github.com/compropago/compropago-php/blob/dc11d7cba778123bbf84860b4bb5d8dbfb78598f/src/Resources/Payments/Cash.php#L73-L86 |
222,787 | compropago/compropago-php | src/Resources/Payments/Cash.php | Cash.verifyOrder | public function verifyOrder($orderId)
{
$endpoint = "{$this->apiUrl}/charges/{$orderId}";
$res = Requests::get(
$endpoint,
array(),
$this->options
);
$this->validateResponse($res);
return json_decode($res->body, true);
} | php | public function verifyOrder($orderId)
{
$endpoint = "{$this->apiUrl}/charges/{$orderId}";
$res = Requests::get(
$endpoint,
array(),
$this->options
);
$this->validateResponse($res);
return json_decode($res->body, true);
} | [
"public",
"function",
"verifyOrder",
"(",
"$",
"orderId",
")",
"{",
"$",
"endpoint",
"=",
"\"{$this->apiUrl}/charges/{$orderId}\"",
";",
"$",
"res",
"=",
"Requests",
"::",
"get",
"(",
"$",
"endpoint",
",",
"array",
"(",
")",
",",
"$",
"this",
"->",
"option... | Verify order status by id
@param string $orderId Order id
@return array Structure with order details
@throws \Exception Request error or exception | [
"Verify",
"order",
"status",
"by",
"id"
] | dc11d7cba778123bbf84860b4bb5d8dbfb78598f | https://github.com/compropago/compropago-php/blob/dc11d7cba778123bbf84860b4bb5d8dbfb78598f/src/Resources/Payments/Cash.php#L97-L109 |
222,788 | gordalina/easypay-php | src/Gordalina/Easypay/Client.php | Client.normalizeArray | protected static function normalizeArray(array $content)
{
foreach ($content as $key => $value) {
if ($value instanceof \SimpleXMLElement) {
if ($value->count()) {
$content[$key] = static::normalizeArray((array) $value);
} else {
... | php | protected static function normalizeArray(array $content)
{
foreach ($content as $key => $value) {
if ($value instanceof \SimpleXMLElement) {
if ($value->count()) {
$content[$key] = static::normalizeArray((array) $value);
} else {
... | [
"protected",
"static",
"function",
"normalizeArray",
"(",
"array",
"$",
"content",
")",
"{",
"foreach",
"(",
"$",
"content",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"value",
"instanceof",
"\\",
"SimpleXMLElement",
")",
"{",
"if",
... | Server returns everything in XML within the automb tag so a simple
implementation to translate it to an array is enough
Current implementation does not work with nested xml tags
@static
@param $content string
@return array | [
"Server",
"returns",
"everything",
"in",
"XML",
"within",
"the",
"automb",
"tag",
"so",
"a",
"simple",
"implementation",
"to",
"translate",
"it",
"to",
"an",
"array",
"is",
"enough"
] | 23e8d462f33834233cad4e9fbe9fc57267c1e573 | https://github.com/gordalina/easypay-php/blob/23e8d462f33834233cad4e9fbe9fc57267c1e573/src/Gordalina/Easypay/Client.php#L118-L133 |
222,789 | compropago/compropago-php | src/Resources/Sms.php | Sms.sendToOrder | public function sendToOrder($orderId, $phone)
{
$endpoint = "{$this->apiUrl}/charges/{$orderId}/sms";
$data = [
"customer_phone" => $phone
];
$res = Requests::post(
$endpoint,
$this->headers,
json_encode($data),
$this->opti... | php | public function sendToOrder($orderId, $phone)
{
$endpoint = "{$this->apiUrl}/charges/{$orderId}/sms";
$data = [
"customer_phone" => $phone
];
$res = Requests::post(
$endpoint,
$this->headers,
json_encode($data),
$this->opti... | [
"public",
"function",
"sendToOrder",
"(",
"$",
"orderId",
",",
"$",
"phone",
")",
"{",
"$",
"endpoint",
"=",
"\"{$this->apiUrl}/charges/{$orderId}/sms\"",
";",
"$",
"data",
"=",
"[",
"\"customer_phone\"",
"=>",
"$",
"phone",
"]",
";",
"$",
"res",
"=",
"Reque... | Send SMS instructions for a specific order
@param string $orderId ComproPago Order ID (ch_xxxxx-xxx-xx-xxxx-xxxx)
@param string $phone Phone number to send the message
@return array Structure with SMS information
@throws \Exception Request error or exception | [
"Send",
"SMS",
"instructions",
"for",
"a",
"specific",
"order"
] | dc11d7cba778123bbf84860b4bb5d8dbfb78598f | https://github.com/compropago/compropago-php/blob/dc11d7cba778123bbf84860b4bb5d8dbfb78598f/src/Resources/Sms.php#L29-L45 |
222,790 | stanislav-web/phalcon-uploader | src/Uploader/Validator.php | Validator.checkMinsize | public function checkMinsize(\Phalcon\Http\Request\File $file, $value)
{
// conversion to the desired format
if (is_array($value) === true) {
$value = $value[key($value)];
}
// check
if ($file->getSize() < (int) $value) {
$this->errors[] = sprintf(... | php | public function checkMinsize(\Phalcon\Http\Request\File $file, $value)
{
// conversion to the desired format
if (is_array($value) === true) {
$value = $value[key($value)];
}
// check
if ($file->getSize() < (int) $value) {
$this->errors[] = sprintf(... | [
"public",
"function",
"checkMinsize",
"(",
"\\",
"Phalcon",
"\\",
"Http",
"\\",
"Request",
"\\",
"File",
"$",
"file",
",",
"$",
"value",
")",
"{",
"// conversion to the desired format",
"if",
"(",
"is_array",
"(",
"$",
"value",
")",
"===",
"true",
")",
"{"... | Check minimum file size
@param \Phalcon\Http\Request\File $file
@param $value
@return bool | [
"Check",
"minimum",
"file",
"size"
] | 3e46aba5d6f51b52b7830eae21c0d3fe1e524c90 | https://github.com/stanislav-web/phalcon-uploader/blob/3e46aba5d6f51b52b7830eae21c0d3fe1e524c90/src/Uploader/Validator.php#L32-L49 |
222,791 | stanislav-web/phalcon-uploader | src/Uploader/Validator.php | Validator.checkDirectory | public function checkDirectory(\Phalcon\Http\Request\File $file = null, $value)
{
// conversion to the desired format
if (is_array($value) === true) {
$value = $value[key($value)];
}
if (file_exists($value) === false) {
$this->errors[] = sprintf(Message::ge... | php | public function checkDirectory(\Phalcon\Http\Request\File $file = null, $value)
{
// conversion to the desired format
if (is_array($value) === true) {
$value = $value[key($value)];
}
if (file_exists($value) === false) {
$this->errors[] = sprintf(Message::ge... | [
"public",
"function",
"checkDirectory",
"(",
"\\",
"Phalcon",
"\\",
"Http",
"\\",
"Request",
"\\",
"File",
"$",
"file",
"=",
"null",
",",
"$",
"value",
")",
"{",
"// conversion to the desired format",
"if",
"(",
"is_array",
"(",
"$",
"value",
")",
"===",
"... | Check upload directory
@param null|\Phalcon\Http\Request\File $file
@param mixed $value
@param $value
@return bool | [
"Check",
"upload",
"directory"
] | 3e46aba5d6f51b52b7830eae21c0d3fe1e524c90 | https://github.com/stanislav-web/phalcon-uploader/blob/3e46aba5d6f51b52b7830eae21c0d3fe1e524c90/src/Uploader/Validator.php#L137-L158 |
222,792 | stanislav-web/phalcon-uploader | src/Uploader/Validator.php | Validator.checkDynamic | public function checkDynamic(\Phalcon\Http\Request\File $file = null, $directory, $permission = 0777)
{
if (is_dir($directory) === false && file_exists($directory) === false) {
mkdir(rtrim($directory,'/') . DIRECTORY_SEPARATOR, $permission, true);
}
return true;
} | php | public function checkDynamic(\Phalcon\Http\Request\File $file = null, $directory, $permission = 0777)
{
if (is_dir($directory) === false && file_exists($directory) === false) {
mkdir(rtrim($directory,'/') . DIRECTORY_SEPARATOR, $permission, true);
}
return true;
} | [
"public",
"function",
"checkDynamic",
"(",
"\\",
"Phalcon",
"\\",
"Http",
"\\",
"Request",
"\\",
"File",
"$",
"file",
"=",
"null",
",",
"$",
"directory",
",",
"$",
"permission",
"=",
"0777",
")",
"{",
"if",
"(",
"is_dir",
"(",
"$",
"directory",
")",
... | Create Directory if not exist
@param null|\Phalcon\Http\Request\File $file
@param string $directory
@param int $permission
@version v1.4
@author Mahdi-Mohammadi
@return bool | [
"Create",
"Directory",
"if",
"not",
"exist"
] | 3e46aba5d6f51b52b7830eae21c0d3fe1e524c90 | https://github.com/stanislav-web/phalcon-uploader/blob/3e46aba5d6f51b52b7830eae21c0d3fe1e524c90/src/Uploader/Validator.php#L170-L177 |
222,793 | compropago/compropago-php | src/Helpers/ValidationHelper.php | ValidationHelper.validateResponse | public function validateResponse(Requests_Response $res)
{
$body = json_decode($res->body, true);
if ($res->status_code != 200 || (isset($body['code']) && $body['code'] != 200)) {
$message = sprintf('Request Error [%d]: %s', $res->status_code, $res->body);
throw new \Excepti... | php | public function validateResponse(Requests_Response $res)
{
$body = json_decode($res->body, true);
if ($res->status_code != 200 || (isset($body['code']) && $body['code'] != 200)) {
$message = sprintf('Request Error [%d]: %s', $res->status_code, $res->body);
throw new \Excepti... | [
"public",
"function",
"validateResponse",
"(",
"Requests_Response",
"$",
"res",
")",
"{",
"$",
"body",
"=",
"json_decode",
"(",
"$",
"res",
"->",
"body",
",",
"true",
")",
";",
"if",
"(",
"$",
"res",
"->",
"status_code",
"!=",
"200",
"||",
"(",
"isset"... | Validate if the response of the ComproPago API is a success response or an error response
@param Requests_Response $res Response object from Requests library
@return void
@throws \Exception Request error or exception | [
"Validate",
"if",
"the",
"response",
"of",
"the",
"ComproPago",
"API",
"is",
"a",
"success",
"response",
"or",
"an",
"error",
"response"
] | dc11d7cba778123bbf84860b4bb5d8dbfb78598f | https://github.com/compropago/compropago-php/blob/dc11d7cba778123bbf84860b4bb5d8dbfb78598f/src/Helpers/ValidationHelper.php#L18-L26 |
222,794 | xcaliber-tech/omnipay-skrill | src/Omnipay/Skrill/Message/AuthorizeResponse.php | AuthorizeResponse.getSessionId | public function getSessionId()
{
return isset($this->data->sid)
? (string) $this->data->sid
: null;
} | php | public function getSessionId()
{
return isset($this->data->sid)
? (string) $this->data->sid
: null;
} | [
"public",
"function",
"getSessionId",
"(",
")",
"{",
"return",
"isset",
"(",
"$",
"this",
"->",
"data",
"->",
"sid",
")",
"?",
"(",
"string",
")",
"$",
"this",
"->",
"data",
"->",
"sid",
":",
"null",
";",
"}"
] | Get the session identifier to be submitted at the next step.
@return string session id | [
"Get",
"the",
"session",
"identifier",
"to",
"be",
"submitted",
"at",
"the",
"next",
"step",
"."
] | f90a185b5e26fb5b4150d664f01ad8048b460bcf | https://github.com/xcaliber-tech/omnipay-skrill/blob/f90a185b5e26fb5b4150d664f01ad8048b460bcf/src/Omnipay/Skrill/Message/AuthorizeResponse.php#L19-L24 |
222,795 | EcomDev/EcomDev_Varnish | src/app/code/community/EcomDev/Varnish/Model/Connector.php | EcomDev_Varnish_Model_Connector._initVarnishPool | protected function _initVarnishPool()
{
$this->pool = new VarnishPool();
$addresses = Mage::getStoreConfig(self::XML_PATH_VARNISH_SERVER);
$secret = Mage::getStoreConfig(self::XML_PATH_VARNISH_SECRET);
if (Mage::getStoreConfigFlag(self::XML_PATH_VARNISH_SECRET_NEWLINE)) {
... | php | protected function _initVarnishPool()
{
$this->pool = new VarnishPool();
$addresses = Mage::getStoreConfig(self::XML_PATH_VARNISH_SERVER);
$secret = Mage::getStoreConfig(self::XML_PATH_VARNISH_SECRET);
if (Mage::getStoreConfigFlag(self::XML_PATH_VARNISH_SECRET_NEWLINE)) {
... | [
"protected",
"function",
"_initVarnishPool",
"(",
")",
"{",
"$",
"this",
"->",
"pool",
"=",
"new",
"VarnishPool",
"(",
")",
";",
"$",
"addresses",
"=",
"Mage",
"::",
"getStoreConfig",
"(",
"self",
"::",
"XML_PATH_VARNISH_SERVER",
")",
";",
"$",
"secret",
"... | Initializes varnish pool
@return $this
@throws VarnishException | [
"Initializes",
"varnish",
"pool"
] | 228b7b1bdaae15c1895f2533667fffa515447915 | https://github.com/EcomDev/EcomDev_Varnish/blob/228b7b1bdaae15c1895f2533667fffa515447915/src/app/code/community/EcomDev/Varnish/Model/Connector.php#L74-L109 |
222,796 | EcomDev/EcomDev_Varnish | src/app/code/community/EcomDev/Varnish/Model/Connector.php | EcomDev_Varnish_Model_Connector.banTags | public function banTags($tags)
{
try {
$this->getVarnishPool()->ban('obj.http.' . self::HEADER_OBJECTS . ' ~ ' . implode('|', $tags));
} catch (VarnishException $e) {
Mage::logException($e);
}
return $this;
} | php | public function banTags($tags)
{
try {
$this->getVarnishPool()->ban('obj.http.' . self::HEADER_OBJECTS . ' ~ ' . implode('|', $tags));
} catch (VarnishException $e) {
Mage::logException($e);
}
return $this;
} | [
"public",
"function",
"banTags",
"(",
"$",
"tags",
")",
"{",
"try",
"{",
"$",
"this",
"->",
"getVarnishPool",
"(",
")",
"->",
"ban",
"(",
"'obj.http.'",
".",
"self",
"::",
"HEADER_OBJECTS",
".",
"' ~ '",
".",
"implode",
"(",
"'|'",
",",
"$",
"tags",
... | Ban list of tags
@param array $tags
@return $this | [
"Ban",
"list",
"of",
"tags"
] | 228b7b1bdaae15c1895f2533667fffa515447915 | https://github.com/EcomDev/EcomDev_Varnish/blob/228b7b1bdaae15c1895f2533667fffa515447915/src/app/code/community/EcomDev/Varnish/Model/Connector.php#L117-L126 |
222,797 | EcomDev/EcomDev_Varnish | src/app/code/community/EcomDev/Varnish/Model/Connector.php | EcomDev_Varnish_Model_Connector.walk | public function walk($method, $firstArg = null, $secondArg = null)
{
if ($method === 'purge') {
$method = 'ban';
}
if ($firstArg === null && $secondArg === null) {
$this->getVarnishPool()->$method();
} elseif ($secondArg === null) {
$this->getVarn... | php | public function walk($method, $firstArg = null, $secondArg = null)
{
if ($method === 'purge') {
$method = 'ban';
}
if ($firstArg === null && $secondArg === null) {
$this->getVarnishPool()->$method();
} elseif ($secondArg === null) {
$this->getVarn... | [
"public",
"function",
"walk",
"(",
"$",
"method",
",",
"$",
"firstArg",
"=",
"null",
",",
"$",
"secondArg",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"method",
"===",
"'purge'",
")",
"{",
"$",
"method",
"=",
"'ban'",
";",
"}",
"if",
"(",
"$",
"first... | Invokes method on each adapter.
@param string $method
@param null|string|int $firstArg
@param null|string|int $secondArg
@return $this
@deprecated since 2.0.0 | [
"Invokes",
"method",
"on",
"each",
"adapter",
"."
] | 228b7b1bdaae15c1895f2533667fffa515447915 | https://github.com/EcomDev/EcomDev_Varnish/blob/228b7b1bdaae15c1895f2533667fffa515447915/src/app/code/community/EcomDev/Varnish/Model/Connector.php#L137-L152 |
222,798 | gordalina/easypay-php | src/Gordalina/Easypay/Payment/PaymentResult.php | PaymentResult.toArray | public function toArray()
{
return array(
'e' => $this->entity,
'r' => $this->reference,
'v' => $this->value,
'k' => $this->authorizationKey,
's' => $this->status,
't_key' => $this->key,
);
} | php | public function toArray()
{
return array(
'e' => $this->entity,
'r' => $this->reference,
'v' => $this->value,
'k' => $this->authorizationKey,
's' => $this->status,
't_key' => $this->key,
);
} | [
"public",
"function",
"toArray",
"(",
")",
"{",
"return",
"array",
"(",
"'e'",
"=>",
"$",
"this",
"->",
"entity",
",",
"'r'",
"=>",
"$",
"this",
"->",
"reference",
",",
"'v'",
"=>",
"$",
"this",
"->",
"value",
",",
"'k'",
"=>",
"$",
"this",
"->",
... | Return array representation
@return array | [
"Return",
"array",
"representation"
] | 23e8d462f33834233cad4e9fbe9fc57267c1e573 | https://github.com/gordalina/easypay-php/blob/23e8d462f33834233cad4e9fbe9fc57267c1e573/src/Gordalina/Easypay/Payment/PaymentResult.php#L152-L162 |
222,799 | EcomDev/EcomDev_Varnish | src/shell/ecomdev-varnish.php | EcomDev_Varnish_Shell._parseArgs | protected function _parseArgs()
{
foreach ($_SERVER['argv'] as $index => $argument) {
if (isset($this->_actionArgsMap[$argument])) {
$this->_action = $argument;
unset($_SERVER['argv'][$index]);
break;
}
unset($_SERVER['argv'... | php | protected function _parseArgs()
{
foreach ($_SERVER['argv'] as $index => $argument) {
if (isset($this->_actionArgsMap[$argument])) {
$this->_action = $argument;
unset($_SERVER['argv'][$index]);
break;
}
unset($_SERVER['argv'... | [
"protected",
"function",
"_parseArgs",
"(",
")",
"{",
"foreach",
"(",
"$",
"_SERVER",
"[",
"'argv'",
"]",
"as",
"$",
"index",
"=>",
"$",
"argument",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"_actionArgsMap",
"[",
"$",
"argument",
"]",
")... | Parses actions for shell script | [
"Parses",
"actions",
"for",
"shell",
"script"
] | 228b7b1bdaae15c1895f2533667fffa515447915 | https://github.com/EcomDev/EcomDev_Varnish/blob/228b7b1bdaae15c1895f2533667fffa515447915/src/shell/ecomdev-varnish.php#L83-L95 |
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.