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 | partition stringclasses 1 value |
|---|---|---|---|---|---|---|---|---|---|---|---|
aimeos/ai-typo3 | lib/custom/src/MShop/Common/Helper/Password/Typo3.php | Typo3.encode | public function encode( $password, $salt = null )
{
return ( isset( $this->hasher ) ? $this->hasher->getHashedPassword( $password, $salt ) : $password );
} | php | public function encode( $password, $salt = null )
{
return ( isset( $this->hasher ) ? $this->hasher->getHashedPassword( $password, $salt ) : $password );
} | [
"public",
"function",
"encode",
"(",
"$",
"password",
",",
"$",
"salt",
"=",
"null",
")",
"{",
"return",
"(",
"isset",
"(",
"$",
"this",
"->",
"hasher",
")",
"?",
"$",
"this",
"->",
"hasher",
"->",
"getHashedPassword",
"(",
"$",
"password",
",",
"$",... | Returns the hashed password.
@param string $password Clear text password string
@param string|null $salt Password salt
@return string Hashed password | [
"Returns",
"the",
"hashed",
"password",
"."
] | 74902c312900c8c5659acd4e85fea61ed1cd7c9a | https://github.com/aimeos/ai-typo3/blob/74902c312900c8c5659acd4e85fea61ed1cd7c9a/lib/custom/src/MShop/Common/Helper/Password/Typo3.php#L47-L50 | train |
maximebf/ConsoleKit | src/ConsoleKit/Help.php | Help.fromFQDN | public static function fromFQDN($fqdn, $subCommand = null)
{
if (function_exists($fqdn)) {
return self::fromFunction($fqdn);
}
if (class_exists($fqdn) && is_subclass_of($fqdn, 'ConsoleKit\Command')) {
return self::fromCommandClass($fqdn, $subCommand);
}
throw new ConsoleException("'$fqdn' is not a valid ConsoleKit FQDN");
} | php | public static function fromFQDN($fqdn, $subCommand = null)
{
if (function_exists($fqdn)) {
return self::fromFunction($fqdn);
}
if (class_exists($fqdn) && is_subclass_of($fqdn, 'ConsoleKit\Command')) {
return self::fromCommandClass($fqdn, $subCommand);
}
throw new ConsoleException("'$fqdn' is not a valid ConsoleKit FQDN");
} | [
"public",
"static",
"function",
"fromFQDN",
"(",
"$",
"fqdn",
",",
"$",
"subCommand",
"=",
"null",
")",
"{",
"if",
"(",
"function_exists",
"(",
"$",
"fqdn",
")",
")",
"{",
"return",
"self",
"::",
"fromFunction",
"(",
"$",
"fqdn",
")",
";",
"}",
"if",... | Creates an Help object from a FQDN
@param string $fqdn
@param string $subCommand
@return Help | [
"Creates",
"an",
"Help",
"object",
"from",
"a",
"FQDN"
] | a05c0c5a4c48882599d59323314ac963a836d58f | https://github.com/maximebf/ConsoleKit/blob/a05c0c5a4c48882599d59323314ac963a836d58f/src/ConsoleKit/Help.php#L46-L55 | train |
maximebf/ConsoleKit | src/ConsoleKit/Help.php | Help.fromCommandClass | public static function fromCommandClass($name, $subCommand = null)
{
$prefix = 'execute';
$class = new ReflectionClass($name);
if ($subCommand) {
$method = $prefix . ucfirst(Utils::camelize($subCommand));
if (!$class->hasMethod($method)) {
throw new ConsoleException("Sub command '$subCommand' of '$name' does not exist");
}
return new Help($class->getMethod($method)->getDocComment());
}
$help = new Help($class->getDocComment());
foreach ($class->getMethods() as $method) {
if (strlen($method->getName()) > strlen($prefix) &&
substr($method->getName(), 0, strlen($prefix)) === $prefix) {
$help->subCommands[] = Utils::dashized(substr($method->getName(), strlen($prefix)));
}
}
return $help;
} | php | public static function fromCommandClass($name, $subCommand = null)
{
$prefix = 'execute';
$class = new ReflectionClass($name);
if ($subCommand) {
$method = $prefix . ucfirst(Utils::camelize($subCommand));
if (!$class->hasMethod($method)) {
throw new ConsoleException("Sub command '$subCommand' of '$name' does not exist");
}
return new Help($class->getMethod($method)->getDocComment());
}
$help = new Help($class->getDocComment());
foreach ($class->getMethods() as $method) {
if (strlen($method->getName()) > strlen($prefix) &&
substr($method->getName(), 0, strlen($prefix)) === $prefix) {
$help->subCommands[] = Utils::dashized(substr($method->getName(), strlen($prefix)));
}
}
return $help;
} | [
"public",
"static",
"function",
"fromCommandClass",
"(",
"$",
"name",
",",
"$",
"subCommand",
"=",
"null",
")",
"{",
"$",
"prefix",
"=",
"'execute'",
";",
"$",
"class",
"=",
"new",
"ReflectionClass",
"(",
"$",
"name",
")",
";",
"if",
"(",
"$",
"subComm... | Creates an Help object from a class subclassing Command
@param string $name
@param string $subCommand
@return Help | [
"Creates",
"an",
"Help",
"object",
"from",
"a",
"class",
"subclassing",
"Command"
] | a05c0c5a4c48882599d59323314ac963a836d58f | https://github.com/maximebf/ConsoleKit/blob/a05c0c5a4c48882599d59323314ac963a836d58f/src/ConsoleKit/Help.php#L76-L97 | train |
mikemirten/JsonApi | src/Document/Behaviour/LinksContainer.php | LinksContainer.linksToArray | protected function linksToArray(): array
{
$links = [];
foreach ($this->links as $name => $link)
{
if (! $link->hasMetadata()) {
$links[$name] = $link->getReference();
continue;
}
$links[$name] = [
'href' => $link->getReference(),
'meta' => $link->getMetadata()
];
}
return $links;
} | php | protected function linksToArray(): array
{
$links = [];
foreach ($this->links as $name => $link)
{
if (! $link->hasMetadata()) {
$links[$name] = $link->getReference();
continue;
}
$links[$name] = [
'href' => $link->getReference(),
'meta' => $link->getMetadata()
];
}
return $links;
} | [
"protected",
"function",
"linksToArray",
"(",
")",
":",
"array",
"{",
"$",
"links",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"links",
"as",
"$",
"name",
"=>",
"$",
"link",
")",
"{",
"if",
"(",
"!",
"$",
"link",
"->",
"hasMetadata",
... | Cast links to an array
@return array | [
"Cast",
"links",
"to",
"an",
"array"
] | a3c1baf8f753c040f24e4522495b7d34565e6560 | https://github.com/mikemirten/JsonApi/blob/a3c1baf8f753c040f24e4522495b7d34565e6560/src/Document/Behaviour/LinksContainer.php#L94-L112 | train |
payneteasy/php-library-payneteasy-api | source/PaynetEasy/PaynetEasyApi/PaymentData/PaymentTransaction.php | PaymentTransaction.setProcessorType | public function setProcessorType($processorType)
{
if (!in_array($processorType, static::$allowedProcessorTypes))
{
throw new RuntimeException("Unknown transaction processor type given: {$processorType}");
}
if (!empty($this->processorType))
{
throw new RuntimeException('You can set payment transaction processor type only once');
}
$this->processorType = $processorType;
return $this;
} | php | public function setProcessorType($processorType)
{
if (!in_array($processorType, static::$allowedProcessorTypes))
{
throw new RuntimeException("Unknown transaction processor type given: {$processorType}");
}
if (!empty($this->processorType))
{
throw new RuntimeException('You can set payment transaction processor type only once');
}
$this->processorType = $processorType;
return $this;
} | [
"public",
"function",
"setProcessorType",
"(",
"$",
"processorType",
")",
"{",
"if",
"(",
"!",
"in_array",
"(",
"$",
"processorType",
",",
"static",
"::",
"$",
"allowedProcessorTypes",
")",
")",
"{",
"throw",
"new",
"RuntimeException",
"(",
"\"Unknown transactio... | Set payment transaction processor type
@param string $processorType Processor type
@return self
@throws RuntimeException Unknown processor type given
@throws RuntimeException Processor type already specified | [
"Set",
"payment",
"transaction",
"processor",
"type"
] | e3484aa37b6594231f59b1f43523603aa704f093 | https://github.com/payneteasy/php-library-payneteasy-api/blob/e3484aa37b6594231f59b1f43523603aa704f093/source/PaynetEasy/PaynetEasyApi/PaymentData/PaymentTransaction.php#L127-L142 | train |
payneteasy/php-library-payneteasy-api | source/PaynetEasy/PaynetEasyApi/PaymentData/PaymentTransaction.php | PaymentTransaction.setProcessorName | public function setProcessorName($processorName)
{
if (!empty($this->processorName))
{
throw new RuntimeException('You can set payment transaction processor name only once');
}
$this->processorName = $processorName;
return $this;
} | php | public function setProcessorName($processorName)
{
if (!empty($this->processorName))
{
throw new RuntimeException('You can set payment transaction processor name only once');
}
$this->processorName = $processorName;
return $this;
} | [
"public",
"function",
"setProcessorName",
"(",
"$",
"processorName",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"processorName",
")",
")",
"{",
"throw",
"new",
"RuntimeException",
"(",
"'You can set payment transaction processor name only once'",
")"... | Set payment transaction processor name
@param string $processorName Processor name
@return self
@throws RuntimeException Processor name already specified | [
"Set",
"payment",
"transaction",
"processor",
"name"
] | e3484aa37b6594231f59b1f43523603aa704f093 | https://github.com/payneteasy/php-library-payneteasy-api/blob/e3484aa37b6594231f59b1f43523603aa704f093/source/PaynetEasy/PaynetEasyApi/PaymentData/PaymentTransaction.php#L163-L173 | train |
payneteasy/php-library-payneteasy-api | source/PaynetEasy/PaynetEasyApi/PaymentData/PaymentTransaction.php | PaymentTransaction.setStatus | public function setStatus($status)
{
if (!in_array($status, static::$allowedStatuses))
{
throw new RuntimeException("Unknown transaction status given: {$status}");
}
$this->status = $status;
return $this;
} | php | public function setStatus($status)
{
if (!in_array($status, static::$allowedStatuses))
{
throw new RuntimeException("Unknown transaction status given: {$status}");
}
$this->status = $status;
return $this;
} | [
"public",
"function",
"setStatus",
"(",
"$",
"status",
")",
"{",
"if",
"(",
"!",
"in_array",
"(",
"$",
"status",
",",
"static",
"::",
"$",
"allowedStatuses",
")",
")",
"{",
"throw",
"new",
"RuntimeException",
"(",
"\"Unknown transaction status given: {$status}\"... | Set payment transaction status
@param string $status Payment transaction status
@return self | [
"Set",
"payment",
"transaction",
"status"
] | e3484aa37b6594231f59b1f43523603aa704f093 | https://github.com/payneteasy/php-library-payneteasy-api/blob/e3484aa37b6594231f59b1f43523603aa704f093/source/PaynetEasy/PaynetEasyApi/PaymentData/PaymentTransaction.php#L192-L202 | train |
payneteasy/php-library-payneteasy-api | source/PaynetEasy/PaynetEasyApi/PaymentData/PaymentTransaction.php | PaymentTransaction.setPayment | public function setPayment(Payment $payment)
{
$this->payment = $payment;
if (!$payment->hasPaymentTransaction($this))
{
$payment->addPaymentTransaction($this);
}
return $this;
} | php | public function setPayment(Payment $payment)
{
$this->payment = $payment;
if (!$payment->hasPaymentTransaction($this))
{
$payment->addPaymentTransaction($this);
}
return $this;
} | [
"public",
"function",
"setPayment",
"(",
"Payment",
"$",
"payment",
")",
"{",
"$",
"this",
"->",
"payment",
"=",
"$",
"payment",
";",
"if",
"(",
"!",
"$",
"payment",
"->",
"hasPaymentTransaction",
"(",
"$",
"this",
")",
")",
"{",
"$",
"payment",
"->",
... | Set payment transaction payment
@param Payment $payment Payment
@return self | [
"Set",
"payment",
"transaction",
"payment"
] | e3484aa37b6594231f59b1f43523603aa704f093 | https://github.com/payneteasy/php-library-payneteasy-api/blob/e3484aa37b6594231f59b1f43523603aa704f093/source/PaynetEasy/PaynetEasyApi/PaymentData/PaymentTransaction.php#L281-L291 | train |
mapbender/data-source | Component/Drivers/DoctrineBaseDriver.php | DoctrineBaseDriver.get | public function get($args)
{
$dataItem = $this->create($args);
if ($dataItem->hasId()) {
$dataItem = $this->getById($dataItem->getId());
}
return $dataItem;
} | php | public function get($args)
{
$dataItem = $this->create($args);
if ($dataItem->hasId()) {
$dataItem = $this->getById($dataItem->getId());
}
return $dataItem;
} | [
"public",
"function",
"get",
"(",
"$",
"args",
")",
"{",
"$",
"dataItem",
"=",
"$",
"this",
"->",
"create",
"(",
"$",
"args",
")",
";",
"if",
"(",
"$",
"dataItem",
"->",
"hasId",
"(",
")",
")",
"{",
"$",
"dataItem",
"=",
"$",
"this",
"->",
"get... | Get by ID, array or object
@param $args
@return DataItem | [
"Get",
"by",
"ID",
"array",
"or",
"object"
] | b805e7ab487584fcf41475bb32cf6dbbe3f7c5ed | https://github.com/mapbender/data-source/blob/b805e7ab487584fcf41475bb32cf6dbbe3f7c5ed/Component/Drivers/DoctrineBaseDriver.php#L51-L58 | train |
mapbender/data-source | Component/Drivers/DoctrineBaseDriver.php | DoctrineBaseDriver.fetchList | public function fetchList($statement)
{
$result = array();
foreach ($this->getConnection()->fetchAll($statement) as $row) {
$result[] = current($row);
}
return $result;
} | php | public function fetchList($statement)
{
$result = array();
foreach ($this->getConnection()->fetchAll($statement) as $row) {
$result[] = current($row);
}
return $result;
} | [
"public",
"function",
"fetchList",
"(",
"$",
"statement",
")",
"{",
"$",
"result",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"getConnection",
"(",
")",
"->",
"fetchAll",
"(",
"$",
"statement",
")",
"as",
"$",
"row",
")",
"{",
... | Executes statement and fetch list as array
@param $statement
@return array | [
"Executes",
"statement",
"and",
"fetch",
"list",
"as",
"array"
] | b805e7ab487584fcf41475bb32cf6dbbe3f7c5ed | https://github.com/mapbender/data-source/blob/b805e7ab487584fcf41475bb32cf6dbbe3f7c5ed/Component/Drivers/DoctrineBaseDriver.php#L151-L158 | train |
mapbender/data-source | Component/Drivers/DoctrineBaseDriver.php | DoctrineBaseDriver.getPlatformName | public function getPlatformName()
{
static $name = null;
if (!$name) {
$name = $this->connection->getDatabasePlatform()->getName();
}
return $name;
} | php | public function getPlatformName()
{
static $name = null;
if (!$name) {
$name = $this->connection->getDatabasePlatform()->getName();
}
return $name;
} | [
"public",
"function",
"getPlatformName",
"(",
")",
"{",
"static",
"$",
"name",
"=",
"null",
";",
"if",
"(",
"!",
"$",
"name",
")",
"{",
"$",
"name",
"=",
"$",
"this",
"->",
"connection",
"->",
"getDatabasePlatform",
"(",
")",
"->",
"getName",
"(",
")... | Get platform name
@return string | [
"Get",
"platform",
"name"
] | b805e7ab487584fcf41475bb32cf6dbbe3f7c5ed | https://github.com/mapbender/data-source/blob/b805e7ab487584fcf41475bb32cf6dbbe3f7c5ed/Component/Drivers/DoctrineBaseDriver.php#L204-L211 | train |
mapbender/data-source | Component/Drivers/DoctrineBaseDriver.php | DoctrineBaseDriver.prepareResults | public function prepareResults(&$rows)
{
foreach ($rows as $key => &$row) {
$row = $this->create($row);
}
return $rows;
} | php | public function prepareResults(&$rows)
{
foreach ($rows as $key => &$row) {
$row = $this->create($row);
}
return $rows;
} | [
"public",
"function",
"prepareResults",
"(",
"&",
"$",
"rows",
")",
"{",
"foreach",
"(",
"$",
"rows",
"as",
"$",
"key",
"=>",
"&",
"$",
"row",
")",
"{",
"$",
"row",
"=",
"$",
"this",
"->",
"create",
"(",
"$",
"row",
")",
";",
"}",
"return",
"$"... | Convert results to DataItem objects
@param array $rows - Data items to be casted
@return DataItem[] | [
"Convert",
"results",
"to",
"DataItem",
"objects"
] | b805e7ab487584fcf41475bb32cf6dbbe3f7c5ed | https://github.com/mapbender/data-source/blob/b805e7ab487584fcf41475bb32cf6dbbe3f7c5ed/Component/Drivers/DoctrineBaseDriver.php#L284-L290 | train |
mapbender/data-source | Component/Drivers/DoctrineBaseDriver.php | DoctrineBaseDriver.getById | public function getById($id)
{
$list = $this->getByCriteria($id, $this->getUniqueId());
return reset($list);
} | php | public function getById($id)
{
$list = $this->getByCriteria($id, $this->getUniqueId());
return reset($list);
} | [
"public",
"function",
"getById",
"(",
"$",
"id",
")",
"{",
"$",
"list",
"=",
"$",
"this",
"->",
"getByCriteria",
"(",
"$",
"id",
",",
"$",
"this",
"->",
"getUniqueId",
"(",
")",
")",
";",
"return",
"reset",
"(",
"$",
"list",
")",
";",
"}"
] | Get data item by id
@param $id
@return mixed | [
"Get",
"data",
"item",
"by",
"id"
] | b805e7ab487584fcf41475bb32cf6dbbe3f7c5ed | https://github.com/mapbender/data-source/blob/b805e7ab487584fcf41475bb32cf6dbbe3f7c5ed/Component/Drivers/DoctrineBaseDriver.php#L319-L323 | train |
mapbender/data-source | Component/Drivers/DoctrineBaseDriver.php | DoctrineBaseDriver.getByCriteria | public function getByCriteria($criteria, $fieldName)
{
/** @var Statement $statement */
$queryBuilder = $this->getSelectQueryBuilder();
$queryBuilder->where($fieldName . " = :criteria");
$queryBuilder->setParameter('criteria', $criteria);
$statement = $queryBuilder->execute();
$rows = $statement->fetchAll();
$this->prepareResults($rows);
return $rows;
} | php | public function getByCriteria($criteria, $fieldName)
{
/** @var Statement $statement */
$queryBuilder = $this->getSelectQueryBuilder();
$queryBuilder->where($fieldName . " = :criteria");
$queryBuilder->setParameter('criteria', $criteria);
$statement = $queryBuilder->execute();
$rows = $statement->fetchAll();
$this->prepareResults($rows);
return $rows;
} | [
"public",
"function",
"getByCriteria",
"(",
"$",
"criteria",
",",
"$",
"fieldName",
")",
"{",
"/** @var Statement $statement */",
"$",
"queryBuilder",
"=",
"$",
"this",
"->",
"getSelectQueryBuilder",
"(",
")",
";",
"$",
"queryBuilder",
"->",
"where",
"(",
"$",
... | List objects by criteria
@param $criteria
@param $fieldName
@return \Mapbender\DataSourceBundle\Entity\DataItem[] | [
"List",
"objects",
"by",
"criteria"
] | b805e7ab487584fcf41475bb32cf6dbbe3f7c5ed | https://github.com/mapbender/data-source/blob/b805e7ab487584fcf41475bb32cf6dbbe3f7c5ed/Component/Drivers/DoctrineBaseDriver.php#L419-L430 | train |
mapbender/data-source | Component/Drivers/DoctrineBaseDriver.php | DoctrineBaseDriver.extractTypeValues | protected function extractTypeValues(array $data, array $types)
{
$typeValues = array();
foreach ($data as $k => $_) {
$typeValues[] = isset($types[$k])
? $types[$k]
: \PDO::PARAM_STR;
}
return $typeValues;
} | php | protected function extractTypeValues(array $data, array $types)
{
$typeValues = array();
foreach ($data as $k => $_) {
$typeValues[] = isset($types[$k])
? $types[$k]
: \PDO::PARAM_STR;
}
return $typeValues;
} | [
"protected",
"function",
"extractTypeValues",
"(",
"array",
"$",
"data",
",",
"array",
"$",
"types",
")",
"{",
"$",
"typeValues",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"data",
"as",
"$",
"k",
"=>",
"$",
"_",
")",
"{",
"$",
"typeValues",
... | Extract ordered type list from two associate key lists of data and types.
@param array $data
@param array $types
@return array | [
"Extract",
"ordered",
"type",
"list",
"from",
"two",
"associate",
"key",
"lists",
"of",
"data",
"and",
"types",
"."
] | b805e7ab487584fcf41475bb32cf6dbbe3f7c5ed | https://github.com/mapbender/data-source/blob/b805e7ab487584fcf41475bb32cf6dbbe3f7c5ed/Component/Drivers/DoctrineBaseDriver.php#L450-L461 | train |
samuelwilliams/eWay-PHP-API | lib/Badcow/eWay/eWay.php | eWay.setCustomerID | public function setCustomerID($id)
{
if(preg_match('/[^A-Za-z0-9]/', $id))
{
throw new ErrorException('Customer ID has invalid characters');
}
elseif(strlen($id) > 8)
{
throw new ErrorException('Customer ID cannot be longer than eight (8) characters');
}
$this->customerID = $id;
return $this;
} | php | public function setCustomerID($id)
{
if(preg_match('/[^A-Za-z0-9]/', $id))
{
throw new ErrorException('Customer ID has invalid characters');
}
elseif(strlen($id) > 8)
{
throw new ErrorException('Customer ID cannot be longer than eight (8) characters');
}
$this->customerID = $id;
return $this;
} | [
"public",
"function",
"setCustomerID",
"(",
"$",
"id",
")",
"{",
"if",
"(",
"preg_match",
"(",
"'/[^A-Za-z0-9]/'",
",",
"$",
"id",
")",
")",
"{",
"throw",
"new",
"ErrorException",
"(",
"'Customer ID has invalid characters'",
")",
";",
"}",
"elseif",
"(",
"st... | Sets the unique eWay customer ID.
@param $id string
@return eway
@throws ErrorException | [
"Sets",
"the",
"unique",
"eWay",
"customer",
"ID",
"."
] | a30aa405ae2459a714ae70d231ac1e995b7f83cb | https://github.com/samuelwilliams/eWay-PHP-API/blob/a30aa405ae2459a714ae70d231ac1e995b7f83cb/lib/Badcow/eWay/eWay.php#L651-L665 | train |
samuelwilliams/eWay-PHP-API | lib/Badcow/eWay/eWay.php | eWay.setCardHoldersName | public function setCardHoldersName($name)
{
if(preg_match('/[^A-Za-z\s\'-\.]/', $name))
{
throw new ErrorException('Card holder name has invalid chracters.');
}
elseif(strlen($name) > 50)
{
throw new ErrorException('Card holder name longer than fifty (50) characters');
}
$this->cardHoldersName = $name;
return $this;
} | php | public function setCardHoldersName($name)
{
if(preg_match('/[^A-Za-z\s\'-\.]/', $name))
{
throw new ErrorException('Card holder name has invalid chracters.');
}
elseif(strlen($name) > 50)
{
throw new ErrorException('Card holder name longer than fifty (50) characters');
}
$this->cardHoldersName = $name;
return $this;
} | [
"public",
"function",
"setCardHoldersName",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"preg_match",
"(",
"'/[^A-Za-z\\s\\'-\\.]/'",
",",
"$",
"name",
")",
")",
"{",
"throw",
"new",
"ErrorException",
"(",
"'Card holder name has invalid chracters.'",
")",
";",
"}",
"... | Sets the card holder's name.
@param $name string
@return eway
@throws ErrorException | [
"Sets",
"the",
"card",
"holder",
"s",
"name",
"."
] | a30aa405ae2459a714ae70d231ac1e995b7f83cb | https://github.com/samuelwilliams/eWay-PHP-API/blob/a30aa405ae2459a714ae70d231ac1e995b7f83cb/lib/Badcow/eWay/eWay.php#L707-L721 | train |
samuelwilliams/eWay-PHP-API | lib/Badcow/eWay/eWay.php | eWay.setCardNumber | public function setCardNumber($number)
{
$number = preg_replace('/[^\d]/', '', $number);
if(strlen($number) > 20)
{
throw new ErrorException('Card number longer than twenty (20) digits');
}
$this->cardNumber = $number;
return $this;
} | php | public function setCardNumber($number)
{
$number = preg_replace('/[^\d]/', '', $number);
if(strlen($number) > 20)
{
throw new ErrorException('Card number longer than twenty (20) digits');
}
$this->cardNumber = $number;
return $this;
} | [
"public",
"function",
"setCardNumber",
"(",
"$",
"number",
")",
"{",
"$",
"number",
"=",
"preg_replace",
"(",
"'/[^\\d]/'",
",",
"''",
",",
"$",
"number",
")",
";",
"if",
"(",
"strlen",
"(",
"$",
"number",
")",
">",
"20",
")",
"{",
"throw",
"new",
... | Sets the card number.
@param $number string The card number
@return eway
@throws ErrorException | [
"Sets",
"the",
"card",
"number",
"."
] | a30aa405ae2459a714ae70d231ac1e995b7f83cb | https://github.com/samuelwilliams/eWay-PHP-API/blob/a30aa405ae2459a714ae70d231ac1e995b7f83cb/lib/Badcow/eWay/eWay.php#L740-L752 | train |
soosyze/framework | src/Components/Validator/Rules/Max.php | Max.sizeMax | protected function sizeMax($key, $lengthValue, $max, $not = true)
{
if (($lengthValue > $max) && $not) {
$this->addReturn($key, 'must', [ ':max' => $max ]);
} elseif (!($lengthValue > $max) && !$not) {
$this->addReturn($key, 'not', [ ':max' => $max ]);
}
} | php | protected function sizeMax($key, $lengthValue, $max, $not = true)
{
if (($lengthValue > $max) && $not) {
$this->addReturn($key, 'must', [ ':max' => $max ]);
} elseif (!($lengthValue > $max) && !$not) {
$this->addReturn($key, 'not', [ ':max' => $max ]);
}
} | [
"protected",
"function",
"sizeMax",
"(",
"$",
"key",
",",
"$",
"lengthValue",
",",
"$",
"max",
",",
"$",
"not",
"=",
"true",
")",
"{",
"if",
"(",
"(",
"$",
"lengthValue",
">",
"$",
"max",
")",
"&&",
"$",
"not",
")",
"{",
"$",
"this",
"->",
"add... | Test si une valeur est plus grande que la valeur de comparaison.
@param string $key Clé du test.
@param string $lengthValue Taille de la valeur.
@param string $max Valeur de comparraison.
@param bool $not Inverse le test. | [
"Test",
"si",
"une",
"valeur",
"est",
"plus",
"grande",
"que",
"la",
"valeur",
"de",
"comparaison",
"."
] | d8dec2155bf9bc1d8ded176b4b65c183e2082049 | https://github.com/soosyze/framework/blob/d8dec2155bf9bc1d8ded176b4b65c183e2082049/src/Components/Validator/Rules/Max.php#L61-L68 | train |
mikemirten/JsonApi | src/Mapper/Handler/LinkRepository/RepositoryProvider.php | RepositoryProvider.registerRepository | public function registerRepository(string $name, RepositoryInterface $repository)
{
if (isset($this->repositories[$name])) {
throw new \LogicException(sprintf('Links\' Repository "%s" is already registered.', $name));
}
$this->repositories[$name] = $repository;
} | php | public function registerRepository(string $name, RepositoryInterface $repository)
{
if (isset($this->repositories[$name])) {
throw new \LogicException(sprintf('Links\' Repository "%s" is already registered.', $name));
}
$this->repositories[$name] = $repository;
} | [
"public",
"function",
"registerRepository",
"(",
"string",
"$",
"name",
",",
"RepositoryInterface",
"$",
"repository",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"repositories",
"[",
"$",
"name",
"]",
")",
")",
"{",
"throw",
"new",
"\\",
"Logi... | Register links' repository
@param string $name
@param RepositoryInterface $repository | [
"Register",
"links",
"repository"
] | a3c1baf8f753c040f24e4522495b7d34565e6560 | https://github.com/mikemirten/JsonApi/blob/a3c1baf8f753c040f24e4522495b7d34565e6560/src/Mapper/Handler/LinkRepository/RepositoryProvider.php#L26-L33 | train |
mikemirten/JsonApi | src/Mapper/Handler/LinkRepository/RepositoryProvider.php | RepositoryProvider.getRepository | public function getRepository(string $name): RepositoryInterface
{
if (isset($this->repositories[$name])) {
return $this->repositories[$name];
}
throw new \LogicException(sprintf('Unknown repository "%s"', $name));
} | php | public function getRepository(string $name): RepositoryInterface
{
if (isset($this->repositories[$name])) {
return $this->repositories[$name];
}
throw new \LogicException(sprintf('Unknown repository "%s"', $name));
} | [
"public",
"function",
"getRepository",
"(",
"string",
"$",
"name",
")",
":",
"RepositoryInterface",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"repositories",
"[",
"$",
"name",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"repositories",
"[",
... | Get links' repository by name
@param string $name
@return RepositoryInterface | [
"Get",
"links",
"repository",
"by",
"name"
] | a3c1baf8f753c040f24e4522495b7d34565e6560 | https://github.com/mikemirten/JsonApi/blob/a3c1baf8f753c040f24e4522495b7d34565e6560/src/Mapper/Handler/LinkRepository/RepositoryProvider.php#L41-L48 | train |
eviweb/composer-wrapper | src/evidev/composer/Wrapper.php | Wrapper.checkMemoryLimit | private function checkMemoryLimit()
{
if (function_exists('ini_get')) {
/**
* Note that this calculation is incorrect for memory limits that
* exceed the value range of the underlying platform's native
* integer.
* In practice, we will get away with it, because it doesn't make
* sense to configure PHP's memory limit to half the addressable
* RAM (2 GB on a typical 32-bit system).
*/
$memoryInBytes = function ($value) {
$unit = strtolower(substr($value, -1, 1));
$value = (int) $value;
switch ($unit) {
case 'g':
$value *= 1024 * 1024 * 1024;
break;
case 'm':
$value *= 1024 * 1024;
break;
case 'k':
$value *= 1024;
break;
}
return $value;
};
$memoryLimit = trim(ini_get('memory_limit'));
// Increase memory_limit if it is lower than 512M
if ($memoryLimit != -1 && $memoryInBytes($memoryLimit) < 512 * 1024 * 1024) {
trigger_error("Configured memory limit ($memoryLimit) is lower " .
"than 512M; composer-wrapper may not work " .
"correctly. Consider increasing PHP's " .
"memory_limit to at least 512M.",
E_USER_NOTICE);
}
}
} | php | private function checkMemoryLimit()
{
if (function_exists('ini_get')) {
/**
* Note that this calculation is incorrect for memory limits that
* exceed the value range of the underlying platform's native
* integer.
* In practice, we will get away with it, because it doesn't make
* sense to configure PHP's memory limit to half the addressable
* RAM (2 GB on a typical 32-bit system).
*/
$memoryInBytes = function ($value) {
$unit = strtolower(substr($value, -1, 1));
$value = (int) $value;
switch ($unit) {
case 'g':
$value *= 1024 * 1024 * 1024;
break;
case 'm':
$value *= 1024 * 1024;
break;
case 'k':
$value *= 1024;
break;
}
return $value;
};
$memoryLimit = trim(ini_get('memory_limit'));
// Increase memory_limit if it is lower than 512M
if ($memoryLimit != -1 && $memoryInBytes($memoryLimit) < 512 * 1024 * 1024) {
trigger_error("Configured memory limit ($memoryLimit) is lower " .
"than 512M; composer-wrapper may not work " .
"correctly. Consider increasing PHP's " .
"memory_limit to at least 512M.",
E_USER_NOTICE);
}
}
} | [
"private",
"function",
"checkMemoryLimit",
"(",
")",
"{",
"if",
"(",
"function_exists",
"(",
"'ini_get'",
")",
")",
"{",
"/**\n * Note that this calculation is incorrect for memory limits that\n * exceed the value range of the underlying platform's native\n ... | Check whether the current setup meets the minimum memory requirements
for composer; raise a notice if not. | [
"Check",
"whether",
"the",
"current",
"setup",
"meets",
"the",
"minimum",
"memory",
"requirements",
"for",
"composer",
";",
"raise",
"a",
"notice",
"if",
"not",
"."
] | 963d5f9c5e07ecbedf468086d59778e6b9fcc984 | https://github.com/eviweb/composer-wrapper/blob/963d5f9c5e07ecbedf468086d59778e6b9fcc984/src/evidev/composer/Wrapper.php#L127-L167 | train |
eviweb/composer-wrapper | src/evidev/composer/Wrapper.php | Wrapper.run | public function run($input = '', $output = null)
{
$this->loadComposerPhar(false);
if (!$this->application) {
$this->application = new \Composer\Console\Application();
$this->application->setAutoExit(false);
}
$cli_args = is_string($input) && !empty($input) ?
new \Symfony\Component\Console\Input\StringInput($input) :
null;
$argv0 = $_SERVER['argv'][0];
$this->fixSelfupdate($cli_args);
$exitcode = $this->application->run(
$cli_args,
$output
);
$_SERVER['argv'][0] = $argv0;
return $exitcode;
} | php | public function run($input = '', $output = null)
{
$this->loadComposerPhar(false);
if (!$this->application) {
$this->application = new \Composer\Console\Application();
$this->application->setAutoExit(false);
}
$cli_args = is_string($input) && !empty($input) ?
new \Symfony\Component\Console\Input\StringInput($input) :
null;
$argv0 = $_SERVER['argv'][0];
$this->fixSelfupdate($cli_args);
$exitcode = $this->application->run(
$cli_args,
$output
);
$_SERVER['argv'][0] = $argv0;
return $exitcode;
} | [
"public",
"function",
"run",
"(",
"$",
"input",
"=",
"''",
",",
"$",
"output",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"loadComposerPhar",
"(",
"false",
")",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"application",
")",
"{",
"$",
"this",
"->",
"a... | Run this composer wrapper as a command-line application.
@param string $input command line arguments
@param object $output output object
@return integer 0 if everything went fine, or an error code
@see http://api.symfony.com/2.2/Symfony/Component/Console/Application.html#method_run | [
"Run",
"this",
"composer",
"wrapper",
"as",
"a",
"command",
"-",
"line",
"application",
"."
] | 963d5f9c5e07ecbedf468086d59778e6b9fcc984 | https://github.com/eviweb/composer-wrapper/blob/963d5f9c5e07ecbedf468086d59778e6b9fcc984/src/evidev/composer/Wrapper.php#L223-L245 | train |
scherersoftware/cake-attachments | src/Model/Behavior/AttachmentsBehavior.php | AttachmentsBehavior.getAttachmentsTags | public function getAttachmentsTags($list = true)
{
$tags = $this->config('tags');
if (!$list) {
return $tags;
}
$tagsList = [];
foreach ($tags as $key => $tag) {
$tagsList[$key] = $tag['caption'];
}
return $tagsList;
} | php | public function getAttachmentsTags($list = true)
{
$tags = $this->config('tags');
if (!$list) {
return $tags;
}
$tagsList = [];
foreach ($tags as $key => $tag) {
$tagsList[$key] = $tag['caption'];
}
return $tagsList;
} | [
"public",
"function",
"getAttachmentsTags",
"(",
"$",
"list",
"=",
"true",
")",
"{",
"$",
"tags",
"=",
"$",
"this",
"->",
"config",
"(",
"'tags'",
")",
";",
"if",
"(",
"!",
"$",
"list",
")",
"{",
"return",
"$",
"tags",
";",
"}",
"$",
"tagsList",
... | get the configured tags
@param bool $list if it should return a list for selects or the whole array
@return array | [
"get",
"the",
"configured",
"tags"
] | 3571005fac399639d609e06a4b3cd445ee16d104 | https://github.com/scherersoftware/cake-attachments/blob/3571005fac399639d609e06a4b3cd445ee16d104/src/Model/Behavior/AttachmentsBehavior.php#L100-L114 | train |
scherersoftware/cake-attachments | src/Model/Behavior/AttachmentsBehavior.php | AttachmentsBehavior.saveTags | public function saveTags($attachment, $tags)
{
$newTags = [];
foreach ($tags as $tag) {
if (isset($this->config('tags')[$tag])) {
$newTags[] = $tag;
if ($this->config('tags')[$tag]['exclusive'] === true) {
$this->_clearTag($attachment, $tag);
}
}
}
$this->Attachments->patchEntity($attachment, ['tags' => $newTags]);
return (bool)$this->Attachments->save($attachment);
} | php | public function saveTags($attachment, $tags)
{
$newTags = [];
foreach ($tags as $tag) {
if (isset($this->config('tags')[$tag])) {
$newTags[] = $tag;
if ($this->config('tags')[$tag]['exclusive'] === true) {
$this->_clearTag($attachment, $tag);
}
}
}
$this->Attachments->patchEntity($attachment, ['tags' => $newTags]);
return (bool)$this->Attachments->save($attachment);
} | [
"public",
"function",
"saveTags",
"(",
"$",
"attachment",
",",
"$",
"tags",
")",
"{",
"$",
"newTags",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"tags",
"as",
"$",
"tag",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"config",
"(",
"'tags'"... | method to save the tags of an attachment
@param Attachments\Model\Entity\Attachment $attachment the attachment entity
@param array $tags array of tags
@return bool | [
"method",
"to",
"save",
"the",
"tags",
"of",
"an",
"attachment"
] | 3571005fac399639d609e06a4b3cd445ee16d104 | https://github.com/scherersoftware/cake-attachments/blob/3571005fac399639d609e06a4b3cd445ee16d104/src/Model/Behavior/AttachmentsBehavior.php#L137-L151 | train |
katsana/katsana-sdk-php | src/One/Vehicles/Checkpoint.php | Checkpoint.month | public function month(int $vehicleId, int $year, int $month = 1, ?Query $query = null): Response
{
$this->requiresAccessToken();
return $this->send(
'GET',
"vehicles/{$vehicleId}/checkpoints/{$year}/{$month}",
$this->getApiHeaders(),
$this->buildHttpQuery($query)
);
} | php | public function month(int $vehicleId, int $year, int $month = 1, ?Query $query = null): Response
{
$this->requiresAccessToken();
return $this->send(
'GET',
"vehicles/{$vehicleId}/checkpoints/{$year}/{$month}",
$this->getApiHeaders(),
$this->buildHttpQuery($query)
);
} | [
"public",
"function",
"month",
"(",
"int",
"$",
"vehicleId",
",",
"int",
"$",
"year",
",",
"int",
"$",
"month",
"=",
"1",
",",
"?",
"Query",
"$",
"query",
"=",
"null",
")",
":",
"Response",
"{",
"$",
"this",
"->",
"requiresAccessToken",
"(",
")",
"... | Get checkpoints for the month.
@param int $vehicleId
@param int $year
@param int $month
@param \Katsana\Sdk\Query|null $query
@return \Laravie\Codex\Contracts\Response | [
"Get",
"checkpoints",
"for",
"the",
"month",
"."
] | 3266401639acd31c8f8cc0dea348085e3c59cb4d | https://github.com/katsana/katsana-sdk-php/blob/3266401639acd31c8f8cc0dea348085e3c59cb4d/src/One/Vehicles/Checkpoint.php#L61-L71 | train |
katsana/katsana-sdk-php | src/One/Vehicles/Travel/Summary.php | Summary.yesterday | public function yesterday(int $vehicleId): Response
{
$this->requiresAccessToken();
return $this->send(
'GET',
"vehicles/{$vehicleId}/travels/summaries/yesterday",
$this->getApiHeaders()
);
} | php | public function yesterday(int $vehicleId): Response
{
$this->requiresAccessToken();
return $this->send(
'GET',
"vehicles/{$vehicleId}/travels/summaries/yesterday",
$this->getApiHeaders()
);
} | [
"public",
"function",
"yesterday",
"(",
"int",
"$",
"vehicleId",
")",
":",
"Response",
"{",
"$",
"this",
"->",
"requiresAccessToken",
"(",
")",
";",
"return",
"$",
"this",
"->",
"send",
"(",
"'GET'",
",",
"\"vehicles/{$vehicleId}/travels/summaries/yesterday\"",
... | Get travel for yesterday.
@param int $vehicleId
@param \Katsana\Sdk\Query $query
@return \Laravie\Codex\Contracts\Response | [
"Get",
"travel",
"for",
"yesterday",
"."
] | 3266401639acd31c8f8cc0dea348085e3c59cb4d | https://github.com/katsana/katsana-sdk-php/blob/3266401639acd31c8f8cc0dea348085e3c59cb4d/src/One/Vehicles/Travel/Summary.php#L39-L48 | train |
katsana/katsana-sdk-php | src/One/Vehicles/Travel/Summary.php | Summary.date | public function date(int $vehicleId, int $year, int $month = 1, int $day = 1): Response
{
$this->requiresAccessToken();
return $this->send(
'GET',
"vehicles/{$vehicleId}/travels/summaries/{$year}/{$month}/{$day}",
$this->getApiHeaders()
);
} | php | public function date(int $vehicleId, int $year, int $month = 1, int $day = 1): Response
{
$this->requiresAccessToken();
return $this->send(
'GET',
"vehicles/{$vehicleId}/travels/summaries/{$year}/{$month}/{$day}",
$this->getApiHeaders()
);
} | [
"public",
"function",
"date",
"(",
"int",
"$",
"vehicleId",
",",
"int",
"$",
"year",
",",
"int",
"$",
"month",
"=",
"1",
",",
"int",
"$",
"day",
"=",
"1",
")",
":",
"Response",
"{",
"$",
"this",
"->",
"requiresAccessToken",
"(",
")",
";",
"return",... | Get travel for the date.
@param int $vehicleId
@param int $year
@param int $month
@param int $day
@param \Katsana\Sdk\Query $query
@return \Laravie\Codex\Contracts\Response | [
"Get",
"travel",
"for",
"the",
"date",
"."
] | 3266401639acd31c8f8cc0dea348085e3c59cb4d | https://github.com/katsana/katsana-sdk-php/blob/3266401639acd31c8f8cc0dea348085e3c59cb4d/src/One/Vehicles/Travel/Summary.php#L82-L91 | train |
hiqdev/yii2-pnotify | src/PNotify.php | PNotify.registerNotification | protected function registerNotification(array $notification)
{
$view = $this->getView();
$options = Json::encode(ArrayHelper::merge($this->getClientOptions(), $notification));
$view->registerJs("new PNotify({$options});");
} | php | protected function registerNotification(array $notification)
{
$view = $this->getView();
$options = Json::encode(ArrayHelper::merge($this->getClientOptions(), $notification));
$view->registerJs("new PNotify({$options});");
} | [
"protected",
"function",
"registerNotification",
"(",
"array",
"$",
"notification",
")",
"{",
"$",
"view",
"=",
"$",
"this",
"->",
"getView",
"(",
")",
";",
"$",
"options",
"=",
"Json",
"::",
"encode",
"(",
"ArrayHelper",
"::",
"merge",
"(",
"$",
"this",... | Registers JS for PNotify plugin.
@param array $notification configuration array | [
"Registers",
"JS",
"for",
"PNotify",
"plugin",
"."
] | 592a5003ce8c6275b86370bceced69808aa7a3fc | https://github.com/hiqdev/yii2-pnotify/blob/592a5003ce8c6275b86370bceced69808aa7a3fc/src/PNotify.php#L74-L80 | train |
scherersoftware/cake-attachments | src/View/Helper/AttachmentsHelper.php | AttachmentsHelper.addDependencies | public function addDependencies()
{
$this->Html->script('/attachments/js/vendor/jquery.ui.widget.js', ['block' => true]);
$this->Html->script('/attachments/js/vendor/jquery.iframe-transport.js', ['block' => true]);
$this->Html->script('/attachments/js/vendor/jquery.fileupload.js', ['block' => true]);
$this->Html->script('/attachments/js/app/lib/AttachmentsWidget.js', ['block' => true]);
$this->Html->css('/attachments/css/attachments.css', ['block' => true]);
} | php | public function addDependencies()
{
$this->Html->script('/attachments/js/vendor/jquery.ui.widget.js', ['block' => true]);
$this->Html->script('/attachments/js/vendor/jquery.iframe-transport.js', ['block' => true]);
$this->Html->script('/attachments/js/vendor/jquery.fileupload.js', ['block' => true]);
$this->Html->script('/attachments/js/app/lib/AttachmentsWidget.js', ['block' => true]);
$this->Html->css('/attachments/css/attachments.css', ['block' => true]);
} | [
"public",
"function",
"addDependencies",
"(",
")",
"{",
"$",
"this",
"->",
"Html",
"->",
"script",
"(",
"'/attachments/js/vendor/jquery.ui.widget.js'",
",",
"[",
"'block'",
"=>",
"true",
"]",
")",
";",
"$",
"this",
"->",
"Html",
"->",
"script",
"(",
"'/attac... | Inject JS dependencies to the HTML helper
@return void | [
"Inject",
"JS",
"dependencies",
"to",
"the",
"HTML",
"helper"
] | 3571005fac399639d609e06a4b3cd445ee16d104 | https://github.com/scherersoftware/cake-attachments/blob/3571005fac399639d609e06a4b3cd445ee16d104/src/View/Helper/AttachmentsHelper.php#L35-L42 | train |
scherersoftware/cake-attachments | src/View/Helper/AttachmentsHelper.php | AttachmentsHelper.attachmentsArea | public function attachmentsArea(EntityInterface $entity, array $options = [])
{
if ($this->config('includeDependencies')) {
$this->addDependencies();
}
$options = Hash::merge([
'label' => false,
'id' => 'fileupload-' . uniqid(),
'formFieldName' => false,
'mode' => 'full',
'style' => '',
'taggable' => false,
'isAjax' => false,
'panelHeading' => __d('attachments', 'attachments'),
'showIconColumn' => true,
'additionalButtons' => null
], $options);
return $this->_View->element('Attachments.attachments_area', compact('options', 'entity'));
} | php | public function attachmentsArea(EntityInterface $entity, array $options = [])
{
if ($this->config('includeDependencies')) {
$this->addDependencies();
}
$options = Hash::merge([
'label' => false,
'id' => 'fileupload-' . uniqid(),
'formFieldName' => false,
'mode' => 'full',
'style' => '',
'taggable' => false,
'isAjax' => false,
'panelHeading' => __d('attachments', 'attachments'),
'showIconColumn' => true,
'additionalButtons' => null
], $options);
return $this->_View->element('Attachments.attachments_area', compact('options', 'entity'));
} | [
"public",
"function",
"attachmentsArea",
"(",
"EntityInterface",
"$",
"entity",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"config",
"(",
"'includeDependencies'",
")",
")",
"{",
"$",
"this",
"->",
"addDependencies"... | Render an attachments area for the given entity
@param EntityInterface $entity Entity to attach files to
@param array $options Override default options
@return string | [
"Render",
"an",
"attachments",
"area",
"for",
"the",
"given",
"entity"
] | 3571005fac399639d609e06a4b3cd445ee16d104 | https://github.com/scherersoftware/cake-attachments/blob/3571005fac399639d609e06a4b3cd445ee16d104/src/View/Helper/AttachmentsHelper.php#L51-L69 | train |
scherersoftware/cake-attachments | src/View/Helper/AttachmentsHelper.php | AttachmentsHelper.tagsList | public function tagsList($attachment)
{
$tagsString = '';
if (empty($attachment->tags)) {
return $tagsString;
}
$Table = TableRegistry::get($attachment->model);
foreach ($attachment->tags as $tag) {
$tagsString .= '<label class="label label-default">' . $Table->getTagCaption($tag) . '</label> ';
}
return $tagsString;
} | php | public function tagsList($attachment)
{
$tagsString = '';
if (empty($attachment->tags)) {
return $tagsString;
}
$Table = TableRegistry::get($attachment->model);
foreach ($attachment->tags as $tag) {
$tagsString .= '<label class="label label-default">' . $Table->getTagCaption($tag) . '</label> ';
}
return $tagsString;
} | [
"public",
"function",
"tagsList",
"(",
"$",
"attachment",
")",
"{",
"$",
"tagsString",
"=",
"''",
";",
"if",
"(",
"empty",
"(",
"$",
"attachment",
"->",
"tags",
")",
")",
"{",
"return",
"$",
"tagsString",
";",
"}",
"$",
"Table",
"=",
"TableRegistry",
... | Render a list of tags of given attachment
@param Attachment\Model\Entity\Attachment $attachment the attachment entity to read the tags from
@return string | [
"Render",
"a",
"list",
"of",
"tags",
"of",
"given",
"attachment"
] | 3571005fac399639d609e06a4b3cd445ee16d104 | https://github.com/scherersoftware/cake-attachments/blob/3571005fac399639d609e06a4b3cd445ee16d104/src/View/Helper/AttachmentsHelper.php#L77-L89 | train |
scherersoftware/cake-attachments | src/View/Helper/AttachmentsHelper.php | AttachmentsHelper.tagsChooser | public function tagsChooser(EntityInterface $entity, $attachment)
{
if (!TableRegistry::exists($entity->source())) {
throw new Cake\Network\Exception\MissingTableException('Could not find Table ' . $entity->source());
}
$Table = TableRegistry::get($entity->source());
return $this->Form->select('tags', $Table->getAttachmentsTags(), [
'type' => 'select',
'class' => 'tag-chooser',
'style' => 'display: block; width: 100%',
'label' => false,
'multiple' => true,
'value' => $attachment->tags
]);
} | php | public function tagsChooser(EntityInterface $entity, $attachment)
{
if (!TableRegistry::exists($entity->source())) {
throw new Cake\Network\Exception\MissingTableException('Could not find Table ' . $entity->source());
}
$Table = TableRegistry::get($entity->source());
return $this->Form->select('tags', $Table->getAttachmentsTags(), [
'type' => 'select',
'class' => 'tag-chooser',
'style' => 'display: block; width: 100%',
'label' => false,
'multiple' => true,
'value' => $attachment->tags
]);
} | [
"public",
"function",
"tagsChooser",
"(",
"EntityInterface",
"$",
"entity",
",",
"$",
"attachment",
")",
"{",
"if",
"(",
"!",
"TableRegistry",
"::",
"exists",
"(",
"$",
"entity",
"->",
"source",
"(",
")",
")",
")",
"{",
"throw",
"new",
"Cake",
"\\",
"N... | Render a multi select with all available tags of entity and the tags of attachment preselected
@param EntityInterface $entity the entity to get all allowed tags from
@param Attachment\Model\Entity\Attachment $attachment the attachment entity to add the tag to
@return string | [
"Render",
"a",
"multi",
"select",
"with",
"all",
"available",
"tags",
"of",
"entity",
"and",
"the",
"tags",
"of",
"attachment",
"preselected"
] | 3571005fac399639d609e06a4b3cd445ee16d104 | https://github.com/scherersoftware/cake-attachments/blob/3571005fac399639d609e06a4b3cd445ee16d104/src/View/Helper/AttachmentsHelper.php#L98-L113 | train |
mikemirten/JsonApi | src/Mapper/ObjectMapper.php | ObjectMapper.toResource | public function toResource($object): ResourceObject
{
$context = $this->createContext(get_class($object));
$id = $this->identifierHandler->getIdentifier($object, $context);
$type = $this->resolveType($object, $context);
$resource = new ResourceObject($id, $type);
foreach ($this->handlers as $handler)
{
$handler->toResource($object, $resource, $context);
}
return $resource;
} | php | public function toResource($object): ResourceObject
{
$context = $this->createContext(get_class($object));
$id = $this->identifierHandler->getIdentifier($object, $context);
$type = $this->resolveType($object, $context);
$resource = new ResourceObject($id, $type);
foreach ($this->handlers as $handler)
{
$handler->toResource($object, $resource, $context);
}
return $resource;
} | [
"public",
"function",
"toResource",
"(",
"$",
"object",
")",
":",
"ResourceObject",
"{",
"$",
"context",
"=",
"$",
"this",
"->",
"createContext",
"(",
"get_class",
"(",
"$",
"object",
")",
")",
";",
"$",
"id",
"=",
"$",
"this",
"->",
"identifierHandler",... | Map object's data to resource
@param mixed $object
@return ResourceObject | [
"Map",
"object",
"s",
"data",
"to",
"resource"
] | a3c1baf8f753c040f24e4522495b7d34565e6560 | https://github.com/mikemirten/JsonApi/blob/a3c1baf8f753c040f24e4522495b7d34565e6560/src/Mapper/ObjectMapper.php#L90-L105 | train |
mikemirten/JsonApi | src/Mapper/ObjectMapper.php | ObjectMapper.toResourceIdentifier | public function toResourceIdentifier($object): ResourceIdentifierObject
{
$context = $this->createContext(get_class($object));
$id = $this->identifierHandler->getIdentifier($object, $context);
$type = $this->resolveType($object, $context);
return new ResourceIdentifierObject($id, $type);
} | php | public function toResourceIdentifier($object): ResourceIdentifierObject
{
$context = $this->createContext(get_class($object));
$id = $this->identifierHandler->getIdentifier($object, $context);
$type = $this->resolveType($object, $context);
return new ResourceIdentifierObject($id, $type);
} | [
"public",
"function",
"toResourceIdentifier",
"(",
"$",
"object",
")",
":",
"ResourceIdentifierObject",
"{",
"$",
"context",
"=",
"$",
"this",
"->",
"createContext",
"(",
"get_class",
"(",
"$",
"object",
")",
")",
";",
"$",
"id",
"=",
"$",
"this",
"->",
... | Map object's identification to resource-identifier
@param $object
@return ResourceIdentifierObject | [
"Map",
"object",
"s",
"identification",
"to",
"resource",
"-",
"identifier"
] | a3c1baf8f753c040f24e4522495b7d34565e6560 | https://github.com/mikemirten/JsonApi/blob/a3c1baf8f753c040f24e4522495b7d34565e6560/src/Mapper/ObjectMapper.php#L113-L121 | train |
mikemirten/JsonApi | src/Mapper/ObjectMapper.php | ObjectMapper.fromResource | public function fromResource($object, ResourceObject $resource)
{
$context = $this->createContext(get_class($object));
$this->identifierHandler->setIdentifier($object, $resource->getId(), $context);
foreach ($this->handlers as $handler)
{
$handler->fromResource($object, $resource, $context);
}
} | php | public function fromResource($object, ResourceObject $resource)
{
$context = $this->createContext(get_class($object));
$this->identifierHandler->setIdentifier($object, $resource->getId(), $context);
foreach ($this->handlers as $handler)
{
$handler->fromResource($object, $resource, $context);
}
} | [
"public",
"function",
"fromResource",
"(",
"$",
"object",
",",
"ResourceObject",
"$",
"resource",
")",
"{",
"$",
"context",
"=",
"$",
"this",
"->",
"createContext",
"(",
"get_class",
"(",
"$",
"object",
")",
")",
";",
"$",
"this",
"->",
"identifierHandler"... | Map resource's data to provided object
@param mixed $object
@param ResourceObject $resource | [
"Map",
"resource",
"s",
"data",
"to",
"provided",
"object"
] | a3c1baf8f753c040f24e4522495b7d34565e6560 | https://github.com/mikemirten/JsonApi/blob/a3c1baf8f753c040f24e4522495b7d34565e6560/src/Mapper/ObjectMapper.php#L129-L139 | train |
mikemirten/JsonApi | src/Mapper/ObjectMapper.php | ObjectMapper.resolveType | protected function resolveType($object, MappingContext $context): string
{
$definition = $context->getDefinition();
if ($definition->hasType()) {
return $definition->getType();
}
return $this->typeHandler->getType($object, $context);
} | php | protected function resolveType($object, MappingContext $context): string
{
$definition = $context->getDefinition();
if ($definition->hasType()) {
return $definition->getType();
}
return $this->typeHandler->getType($object, $context);
} | [
"protected",
"function",
"resolveType",
"(",
"$",
"object",
",",
"MappingContext",
"$",
"context",
")",
":",
"string",
"{",
"$",
"definition",
"=",
"$",
"context",
"->",
"getDefinition",
"(",
")",
";",
"if",
"(",
"$",
"definition",
"->",
"hasType",
"(",
... | Resolve type of resource
@param $object
@param MappingContext $context
@return string | [
"Resolve",
"type",
"of",
"resource"
] | a3c1baf8f753c040f24e4522495b7d34565e6560 | https://github.com/mikemirten/JsonApi/blob/a3c1baf8f753c040f24e4522495b7d34565e6560/src/Mapper/ObjectMapper.php#L148-L157 | train |
mikemirten/JsonApi | src/Mapper/ObjectMapper.php | ObjectMapper.createContext | protected function createContext(string $class): MappingContext
{
$definition = $this->definitionProvider->getDefinition($class);
return new MappingContext($this, $definition);
} | php | protected function createContext(string $class): MappingContext
{
$definition = $this->definitionProvider->getDefinition($class);
return new MappingContext($this, $definition);
} | [
"protected",
"function",
"createContext",
"(",
"string",
"$",
"class",
")",
":",
"MappingContext",
"{",
"$",
"definition",
"=",
"$",
"this",
"->",
"definitionProvider",
"->",
"getDefinition",
"(",
"$",
"class",
")",
";",
"return",
"new",
"MappingContext",
"(",... | Create mapping context for given class
@param string $class
@return MappingContext | [
"Create",
"mapping",
"context",
"for",
"given",
"class"
] | a3c1baf8f753c040f24e4522495b7d34565e6560 | https://github.com/mikemirten/JsonApi/blob/a3c1baf8f753c040f24e4522495b7d34565e6560/src/Mapper/ObjectMapper.php#L165-L170 | train |
mikemirten/JsonApi | src/Mapper/Handler/Exception/NotIterableAttribute.php | NotIterableAttribute.resolveTypeDescription | protected function resolveTypeDescription($value): string
{
$type = gettype($value);
if ($type === 'object') {
return 'an instance of ' . get_class($value);
}
if ($type === 'integer') {
return 'an integer';
}
return 'a ' . $type;
} | php | protected function resolveTypeDescription($value): string
{
$type = gettype($value);
if ($type === 'object') {
return 'an instance of ' . get_class($value);
}
if ($type === 'integer') {
return 'an integer';
}
return 'a ' . $type;
} | [
"protected",
"function",
"resolveTypeDescription",
"(",
"$",
"value",
")",
":",
"string",
"{",
"$",
"type",
"=",
"gettype",
"(",
"$",
"value",
")",
";",
"if",
"(",
"$",
"type",
"===",
"'object'",
")",
"{",
"return",
"'an instance of '",
".",
"get_class",
... | Resolve description of value's type
@param $value
@return string | [
"Resolve",
"description",
"of",
"value",
"s",
"type"
] | a3c1baf8f753c040f24e4522495b7d34565e6560 | https://github.com/mikemirten/JsonApi/blob/a3c1baf8f753c040f24e4522495b7d34565e6560/src/Mapper/Handler/Exception/NotIterableAttribute.php#L55-L68 | train |
aimeos/ai-typo3 | lib/custom/src/MShop/Context/Item/Typo3.php | Typo3.setHasherTypo3 | public function setHasherTypo3( \TYPO3\CMS\Saltedpasswords\Salt\SaltInterface $object )
{
$this->hasher = $object;
return $this;
} | php | public function setHasherTypo3( \TYPO3\CMS\Saltedpasswords\Salt\SaltInterface $object )
{
$this->hasher = $object;
return $this;
} | [
"public",
"function",
"setHasherTypo3",
"(",
"\\",
"TYPO3",
"\\",
"CMS",
"\\",
"Saltedpasswords",
"\\",
"Salt",
"\\",
"SaltInterface",
"$",
"object",
")",
"{",
"$",
"this",
"->",
"hasher",
"=",
"$",
"object",
";",
"return",
"$",
"this",
";",
"}"
] | Sets the TYPO3 password hasher object
@param \TYPO3\CMS\Saltedpasswords\Salt\SaltInterface $object
@return \Aimeos\MShop\Context\Item\Iface Context item for chaining method calls | [
"Sets",
"the",
"TYPO3",
"password",
"hasher",
"object"
] | 74902c312900c8c5659acd4e85fea61ed1cd7c9a | https://github.com/aimeos/ai-typo3/blob/74902c312900c8c5659acd4e85fea61ed1cd7c9a/lib/custom/src/MShop/Context/Item/Typo3.php#L43-L47 | train |
mapbender/data-source | Component/Drivers/Oracle.php | Oracle.transformColumnNames | public static function transformColumnNames(&$rows)
{
$columnNames = array_keys(current($rows));
foreach ($rows as &$row) {
foreach ($columnNames as $name) {
$row[ strtolower($name) ] = &$row[ $name ];
unset($row[ $name ]);
}
}
} | php | public static function transformColumnNames(&$rows)
{
$columnNames = array_keys(current($rows));
foreach ($rows as &$row) {
foreach ($columnNames as $name) {
$row[ strtolower($name) ] = &$row[ $name ];
unset($row[ $name ]);
}
}
} | [
"public",
"static",
"function",
"transformColumnNames",
"(",
"&",
"$",
"rows",
")",
"{",
"$",
"columnNames",
"=",
"array_keys",
"(",
"current",
"(",
"$",
"rows",
")",
")",
";",
"foreach",
"(",
"$",
"rows",
"as",
"&",
"$",
"row",
")",
"{",
"foreach",
... | Transform result column names from lower case to upper
@param $rows array Two dimensional array link | [
"Transform",
"result",
"column",
"names",
"from",
"lower",
"case",
"to",
"upper"
] | b805e7ab487584fcf41475bb32cf6dbbe3f7c5ed | https://github.com/mapbender/data-source/blob/b805e7ab487584fcf41475bb32cf6dbbe3f7c5ed/Component/Drivers/Oracle.php#L20-L29 | train |
SplashSync/Php-Core | Models/Objects/UnitsHelperTrait.php | UnitsHelperTrait.units | public static function units()
{
// Helper Class Exists
if (isset(self::$unitConverter)) {
return self::$unitConverter;
}
// Initialize Class
self::$unitConverter = new UnitConverter();
// Return Helper Class
return self::$unitConverter;
} | php | public static function units()
{
// Helper Class Exists
if (isset(self::$unitConverter)) {
return self::$unitConverter;
}
// Initialize Class
self::$unitConverter = new UnitConverter();
// Return Helper Class
return self::$unitConverter;
} | [
"public",
"static",
"function",
"units",
"(",
")",
"{",
"// Helper Class Exists",
"if",
"(",
"isset",
"(",
"self",
"::",
"$",
"unitConverter",
")",
")",
"{",
"return",
"self",
"::",
"$",
"unitConverter",
";",
"}",
"// Initialize Class",
"self",
"::",
"$",
... | Get a singleton Unit Converter Class
@return UnitConverter | [
"Get",
"a",
"singleton",
"Unit",
"Converter",
"Class"
] | f69724117b979e10eb38e72f7fe38611b5c3f830 | https://github.com/SplashSync/Php-Core/blob/f69724117b979e10eb38e72f7fe38611b5c3f830/Models/Objects/UnitsHelperTrait.php#L35-L45 | train |
soosyze/framework | src/Components/Http/Message.php | Message.filterProtocolVersion | protected function filterProtocolVersion($version)
{
if (!is_string($version) || !in_array($version, $this->protocols)) {
throw new \InvalidArgumentException('The specified protocol is invalid.');
}
return $version;
} | php | protected function filterProtocolVersion($version)
{
if (!is_string($version) || !in_array($version, $this->protocols)) {
throw new \InvalidArgumentException('The specified protocol is invalid.');
}
return $version;
} | [
"protected",
"function",
"filterProtocolVersion",
"(",
"$",
"version",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"version",
")",
"||",
"!",
"in_array",
"(",
"$",
"version",
",",
"$",
"this",
"->",
"protocols",
")",
")",
"{",
"throw",
"new",
"\\"... | Filtre la version du protocole.
@param string $version
@throws \InvalidArgumentException Le protocole spécifié n'est pas valide.
@return string Le protocole si celui-ci est conforme. | [
"Filtre",
"la",
"version",
"du",
"protocole",
"."
] | d8dec2155bf9bc1d8ded176b4b65c183e2082049 | https://github.com/soosyze/framework/blob/d8dec2155bf9bc1d8ded176b4b65c183e2082049/src/Components/Http/Message.php#L223-L230 | train |
Velliz/pukoframework | src/Request.php | Request.getAuthorizationHeader | public static function getAuthorizationHeader()
{
$headers = null;
if (isset($_SERVER['Authorization'])) {
$headers = trim($_SERVER["Authorization"]);
} else if (isset($_SERVER['HTTP_AUTHORIZATION'])) {
$headers = trim($_SERVER["HTTP_AUTHORIZATION"]);
} elseif (function_exists('apache_request_headers')) {
$requestHeaders = apache_request_headers();
$requestHeaders = array_combine(array_map(
'ucwords',
array_keys($requestHeaders)),
array_values($requestHeaders)
);
if (isset($requestHeaders['Authorization'])) {
$headers = trim($requestHeaders['Authorization']);
}
}
return $headers;
} | php | public static function getAuthorizationHeader()
{
$headers = null;
if (isset($_SERVER['Authorization'])) {
$headers = trim($_SERVER["Authorization"]);
} else if (isset($_SERVER['HTTP_AUTHORIZATION'])) {
$headers = trim($_SERVER["HTTP_AUTHORIZATION"]);
} elseif (function_exists('apache_request_headers')) {
$requestHeaders = apache_request_headers();
$requestHeaders = array_combine(array_map(
'ucwords',
array_keys($requestHeaders)),
array_values($requestHeaders)
);
if (isset($requestHeaders['Authorization'])) {
$headers = trim($requestHeaders['Authorization']);
}
}
return $headers;
} | [
"public",
"static",
"function",
"getAuthorizationHeader",
"(",
")",
"{",
"$",
"headers",
"=",
"null",
";",
"if",
"(",
"isset",
"(",
"$",
"_SERVER",
"[",
"'Authorization'",
"]",
")",
")",
"{",
"$",
"headers",
"=",
"trim",
"(",
"$",
"_SERVER",
"[",
"\"Au... | Get hearder Authorization | [
"Get",
"hearder",
"Authorization"
] | 0fa25634b4dc849d6ca440e85cd8b7b616a980b5 | https://github.com/Velliz/pukoframework/blob/0fa25634b4dc849d6ca440e85cd8b7b616a980b5/src/Request.php#L202-L221 | train |
SplashSync/Php-Core | Models/Objects/SimpleFieldsTrait.php | SimpleFieldsTrait.getSimple | protected function getSimple($fieldName, $objectName = "object", $default = null)
{
if (isset($this->{$objectName}->{$fieldName})) {
$this->out[$fieldName] = trim($this->{$objectName}->{$fieldName});
} else {
$this->out[$fieldName] = $default;
}
return $this;
} | php | protected function getSimple($fieldName, $objectName = "object", $default = null)
{
if (isset($this->{$objectName}->{$fieldName})) {
$this->out[$fieldName] = trim($this->{$objectName}->{$fieldName});
} else {
$this->out[$fieldName] = $default;
}
return $this;
} | [
"protected",
"function",
"getSimple",
"(",
"$",
"fieldName",
",",
"$",
"objectName",
"=",
"\"object\"",
",",
"$",
"default",
"=",
"null",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"{",
"$",
"objectName",
"}",
"->",
"{",
"$",
"fieldName",
... | Common Reading of a Single Field
@param string $fieldName Field Identifier / Name
@param string $objectName Name of private object to read (Default : "object")
@param mixed $default Default Value if unset
@return self | [
"Common",
"Reading",
"of",
"a",
"Single",
"Field"
] | f69724117b979e10eb38e72f7fe38611b5c3f830 | https://github.com/SplashSync/Php-Core/blob/f69724117b979e10eb38e72f7fe38611b5c3f830/Models/Objects/SimpleFieldsTrait.php#L32-L41 | train |
SplashSync/Php-Core | Models/Objects/SimpleFieldsTrait.php | SimpleFieldsTrait.getSimpleBool | protected function getSimpleBool($fieldName, $objectName = "object", $default = false)
{
if (isset($this->{$objectName}->{$fieldName})) {
$this->out[$fieldName] = (bool) trim($this->{$objectName}->{$fieldName});
} else {
$this->out[$fieldName] = (bool) $default;
}
return $this;
} | php | protected function getSimpleBool($fieldName, $objectName = "object", $default = false)
{
if (isset($this->{$objectName}->{$fieldName})) {
$this->out[$fieldName] = (bool) trim($this->{$objectName}->{$fieldName});
} else {
$this->out[$fieldName] = (bool) $default;
}
return $this;
} | [
"protected",
"function",
"getSimpleBool",
"(",
"$",
"fieldName",
",",
"$",
"objectName",
"=",
"\"object\"",
",",
"$",
"default",
"=",
"false",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"{",
"$",
"objectName",
"}",
"->",
"{",
"$",
"fieldName... | Common Reading of a Single Bool Field
@param string $fieldName Field Identifier / Name
@param string $objectName Name of private object to read (Default : "object")
@param mixed $default Default Value if unset
@return self | [
"Common",
"Reading",
"of",
"a",
"Single",
"Bool",
"Field"
] | f69724117b979e10eb38e72f7fe38611b5c3f830 | https://github.com/SplashSync/Php-Core/blob/f69724117b979e10eb38e72f7fe38611b5c3f830/Models/Objects/SimpleFieldsTrait.php#L52-L61 | train |
SplashSync/Php-Core | Models/Objects/SimpleFieldsTrait.php | SimpleFieldsTrait.getSimpleDouble | protected function getSimpleDouble($fieldName, $objectName = "object", $default = 0)
{
if (isset($this->{$objectName}->{$fieldName})) {
$this->out[$fieldName] = (double) trim($this->{$objectName}->{$fieldName});
} else {
$this->out[$fieldName] = (double) $default;
}
return $this;
} | php | protected function getSimpleDouble($fieldName, $objectName = "object", $default = 0)
{
if (isset($this->{$objectName}->{$fieldName})) {
$this->out[$fieldName] = (double) trim($this->{$objectName}->{$fieldName});
} else {
$this->out[$fieldName] = (double) $default;
}
return $this;
} | [
"protected",
"function",
"getSimpleDouble",
"(",
"$",
"fieldName",
",",
"$",
"objectName",
"=",
"\"object\"",
",",
"$",
"default",
"=",
"0",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"{",
"$",
"objectName",
"}",
"->",
"{",
"$",
"fieldName",... | Common Reading of a Single Double Field
@param string $fieldName Field Identifier / Name
@param string $objectName Name of private object to read (Default : "object")
@param mixed $default Default Value if unset
@return self | [
"Common",
"Reading",
"of",
"a",
"Single",
"Double",
"Field"
] | f69724117b979e10eb38e72f7fe38611b5c3f830 | https://github.com/SplashSync/Php-Core/blob/f69724117b979e10eb38e72f7fe38611b5c3f830/Models/Objects/SimpleFieldsTrait.php#L72-L81 | train |
SplashSync/Php-Core | Models/Objects/SimpleFieldsTrait.php | SimpleFieldsTrait.getSimpleBit | protected function getSimpleBit($fieldName, $position, $objectName = "object", $default = false)
{
if (isset($this->{$objectName}->{$fieldName})) {
$this->out[$fieldName] = (bool) (($this->{$objectName}->{$fieldName} >> $position) & 1);
} else {
$this->out[$fieldName] = (bool) $default;
}
return $this;
} | php | protected function getSimpleBit($fieldName, $position, $objectName = "object", $default = false)
{
if (isset($this->{$objectName}->{$fieldName})) {
$this->out[$fieldName] = (bool) (($this->{$objectName}->{$fieldName} >> $position) & 1);
} else {
$this->out[$fieldName] = (bool) $default;
}
return $this;
} | [
"protected",
"function",
"getSimpleBit",
"(",
"$",
"fieldName",
",",
"$",
"position",
",",
"$",
"objectName",
"=",
"\"object\"",
",",
"$",
"default",
"=",
"false",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"{",
"$",
"objectName",
"}",
"->",... | Common Reading of a Single Bit Field
@param string $fieldName Field Identifier / Name
@param int $position Bit position (Starting form 0)
@param string $objectName Name of private object to read (Default : "object")
@param mixed $default Default Value if unset
@return self | [
"Common",
"Reading",
"of",
"a",
"Single",
"Bit",
"Field"
] | f69724117b979e10eb38e72f7fe38611b5c3f830 | https://github.com/SplashSync/Php-Core/blob/f69724117b979e10eb38e72f7fe38611b5c3f830/Models/Objects/SimpleFieldsTrait.php#L93-L102 | train |
SplashSync/Php-Core | Models/Objects/SimpleFieldsTrait.php | SimpleFieldsTrait.setSimpleFloat | protected function setSimpleFloat($fieldName, $fieldData, $objectName = "object")
{
//====================================================================//
// Compare Field Data
if (!isset($this->{$objectName}->{$fieldName})
|| (abs($this->{$objectName}->{$fieldName} - $fieldData) > 1E-6)) {
//====================================================================//
// Update Field Data
$this->{$objectName}->{$fieldName} = $fieldData;
$this->needUpdate($objectName);
}
return $this;
} | php | protected function setSimpleFloat($fieldName, $fieldData, $objectName = "object")
{
//====================================================================//
// Compare Field Data
if (!isset($this->{$objectName}->{$fieldName})
|| (abs($this->{$objectName}->{$fieldName} - $fieldData) > 1E-6)) {
//====================================================================//
// Update Field Data
$this->{$objectName}->{$fieldName} = $fieldData;
$this->needUpdate($objectName);
}
return $this;
} | [
"protected",
"function",
"setSimpleFloat",
"(",
"$",
"fieldName",
",",
"$",
"fieldData",
",",
"$",
"objectName",
"=",
"\"object\"",
")",
"{",
"//====================================================================//",
"// Compare Field Data",
"if",
"(",
"!",
"isset",
"("... | Common Writing of a Single Field
@param string $fieldName Field Identifier / Name
@param mixed $fieldData Field Data
@param string $objectName Name of private object to read (Default : "object")
@return self | [
"Common",
"Writing",
"of",
"a",
"Single",
"Field"
] | f69724117b979e10eb38e72f7fe38611b5c3f830 | https://github.com/SplashSync/Php-Core/blob/f69724117b979e10eb38e72f7fe38611b5c3f830/Models/Objects/SimpleFieldsTrait.php#L137-L150 | train |
SplashSync/Php-Core | Models/Objects/SimpleFieldsTrait.php | SimpleFieldsTrait.setSimpleBit | protected function setSimpleBit($fieldName, $position, $fieldData, $objectName = "object")
{
//====================================================================//
// Compare Field Data
if ($this->getSimpleBit($fieldName, $position, $objectName) !== $fieldData) {
//====================================================================//
// Update Field Data
if ($fieldData) {
$this->{$objectName}->{$fieldName} = $this->{$objectName}->{$fieldName} | (1 << $position);
} else {
$this->{$objectName}->{$fieldName} = $this->{$objectName}->{$fieldName} & ~ (1 << $position);
}
$this->needUpdate($objectName);
}
return $this;
} | php | protected function setSimpleBit($fieldName, $position, $fieldData, $objectName = "object")
{
//====================================================================//
// Compare Field Data
if ($this->getSimpleBit($fieldName, $position, $objectName) !== $fieldData) {
//====================================================================//
// Update Field Data
if ($fieldData) {
$this->{$objectName}->{$fieldName} = $this->{$objectName}->{$fieldName} | (1 << $position);
} else {
$this->{$objectName}->{$fieldName} = $this->{$objectName}->{$fieldName} & ~ (1 << $position);
}
$this->needUpdate($objectName);
}
return $this;
} | [
"protected",
"function",
"setSimpleBit",
"(",
"$",
"fieldName",
",",
"$",
"position",
",",
"$",
"fieldData",
",",
"$",
"objectName",
"=",
"\"object\"",
")",
"{",
"//====================================================================//",
"// Compare Field Data",
"if",
"(... | Common Writing of a Single Bit Field
@param string $fieldName Field Identifier / Name
@param int $position Bit position (Starting form 0)
@param mixed $fieldData Field Data
@param string $objectName Name of private object to read (Default : "object")
@return self | [
"Common",
"Writing",
"of",
"a",
"Single",
"Bit",
"Field"
] | f69724117b979e10eb38e72f7fe38611b5c3f830 | https://github.com/SplashSync/Php-Core/blob/f69724117b979e10eb38e72f7fe38611b5c3f830/Models/Objects/SimpleFieldsTrait.php#L162-L178 | train |
payneteasy/php-library-payneteasy-api | source/PaynetEasy/PaynetEasyApi/PaymentData/Payment.php | Payment.addPaymentTransaction | public function addPaymentTransaction(PaymentTransaction $paymentTransaction)
{
if (!$this->hasPaymentTransaction($paymentTransaction))
{
$this->paymentTransactions[] = $paymentTransaction;
}
if ($paymentTransaction->getPayment() !== $this)
{
$paymentTransaction->setPayment($this);
}
return $this;
} | php | public function addPaymentTransaction(PaymentTransaction $paymentTransaction)
{
if (!$this->hasPaymentTransaction($paymentTransaction))
{
$this->paymentTransactions[] = $paymentTransaction;
}
if ($paymentTransaction->getPayment() !== $this)
{
$paymentTransaction->setPayment($this);
}
return $this;
} | [
"public",
"function",
"addPaymentTransaction",
"(",
"PaymentTransaction",
"$",
"paymentTransaction",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"hasPaymentTransaction",
"(",
"$",
"paymentTransaction",
")",
")",
"{",
"$",
"this",
"->",
"paymentTransactions",
"[",... | Add payment transaction
@param PaymentTransaction $paymentTransaction Payment transaction
@return self | [
"Add",
"payment",
"transaction"
] | e3484aa37b6594231f59b1f43523603aa704f093 | https://github.com/payneteasy/php-library-payneteasy-api/blob/e3484aa37b6594231f59b1f43523603aa704f093/source/PaynetEasy/PaynetEasyApi/PaymentData/Payment.php#L446-L459 | train |
soosyze/framework | src/Components/Validator/Rules/ImageDimensionsWidth.php | ImageDimensionsWidth.sizeBetween | protected function sizeBetween($lengthValue, $min, $max, $not = true)
{
if (!($lengthValue <= $max && $lengthValue >= $min) && $not) {
$this->addReturn('image_dimensions_width', 'width', [
':min' => $min,
':max' => $max
]);
} elseif ($lengthValue <= $max && $lengthValue >= $min && !$not) {
$this->addReturn('image_dimensions_width', 'not_width', [
':min' => $min,
':max' => $max
]);
}
} | php | protected function sizeBetween($lengthValue, $min, $max, $not = true)
{
if (!($lengthValue <= $max && $lengthValue >= $min) && $not) {
$this->addReturn('image_dimensions_width', 'width', [
':min' => $min,
':max' => $max
]);
} elseif ($lengthValue <= $max && $lengthValue >= $min && !$not) {
$this->addReturn('image_dimensions_width', 'not_width', [
':min' => $min,
':max' => $max
]);
}
} | [
"protected",
"function",
"sizeBetween",
"(",
"$",
"lengthValue",
",",
"$",
"min",
",",
"$",
"max",
",",
"$",
"not",
"=",
"true",
")",
"{",
"if",
"(",
"!",
"(",
"$",
"lengthValue",
"<=",
"$",
"max",
"&&",
"$",
"lengthValue",
">=",
"$",
"min",
")",
... | Test la largeur d'une image.
@param int $lengthValue Largeur de l'image en pixel.
@param numeric $min Largeur minimum autorisée.
@param numeric $max Largeur maximum autorisée.
@param bool $not Inverse le test. | [
"Test",
"la",
"largeur",
"d",
"une",
"image",
"."
] | d8dec2155bf9bc1d8ded176b4b65c183e2082049 | https://github.com/soosyze/framework/blob/d8dec2155bf9bc1d8ded176b4b65c183e2082049/src/Components/Validator/Rules/ImageDimensionsWidth.php#L52-L65 | train |
SplashSync/Php-Core | Models/Helpers/ImagesHelper.php | ImagesHelper.touchRemoteFile | public static function touchRemoteFile($imageUrl)
{
// Get cURL resource
$curl = curl_init($imageUrl);
if (!$curl) {
return false;
}
// Set some options - we are passing in a useragent too here
curl_setopt_array($curl, array(
CURLOPT_RETURNTRANSFER => 1,
CURLOPT_URL => $imageUrl,
CURLOPT_USERAGENT => 'Splash cURL Agent'
));
// Send the request & save response to $resp
$resp = curl_exec($curl);
// Close request to clear up some resources
curl_close($curl);
return (false != $resp);
} | php | public static function touchRemoteFile($imageUrl)
{
// Get cURL resource
$curl = curl_init($imageUrl);
if (!$curl) {
return false;
}
// Set some options - we are passing in a useragent too here
curl_setopt_array($curl, array(
CURLOPT_RETURNTRANSFER => 1,
CURLOPT_URL => $imageUrl,
CURLOPT_USERAGENT => 'Splash cURL Agent'
));
// Send the request & save response to $resp
$resp = curl_exec($curl);
// Close request to clear up some resources
curl_close($curl);
return (false != $resp);
} | [
"public",
"static",
"function",
"touchRemoteFile",
"(",
"$",
"imageUrl",
")",
"{",
"// Get cURL resource",
"$",
"curl",
"=",
"curl_init",
"(",
"$",
"imageUrl",
")",
";",
"if",
"(",
"!",
"$",
"curl",
")",
"{",
"return",
"false",
";",
"}",
"// Set some optio... | Uses CURL to GET Remote Image Once
@param string $imageUrl
@return bool | [
"Uses",
"CURL",
"to",
"GET",
"Remote",
"Image",
"Once"
] | f69724117b979e10eb38e72f7fe38611b5c3f830 | https://github.com/SplashSync/Php-Core/blob/f69724117b979e10eb38e72f7fe38611b5c3f830/Models/Helpers/ImagesHelper.php#L154-L173 | train |
SplashSync/Php-Core | Models/Helpers/ImagesHelper.php | ImagesHelper.getRemoteFileSize | private static function getRemoteFileSize($imageUrl)
{
$result = curl_init($imageUrl);
if (!$result) {
return 0;
}
curl_setopt($result, CURLOPT_RETURNTRANSFER, true);
curl_setopt($result, CURLOPT_HEADER, true);
curl_setopt($result, CURLOPT_NOBODY, true);
curl_exec($result);
$imageSize = curl_getinfo($result, CURLINFO_CONTENT_LENGTH_DOWNLOAD);
curl_close($result);
return (int) $imageSize;
} | php | private static function getRemoteFileSize($imageUrl)
{
$result = curl_init($imageUrl);
if (!$result) {
return 0;
}
curl_setopt($result, CURLOPT_RETURNTRANSFER, true);
curl_setopt($result, CURLOPT_HEADER, true);
curl_setopt($result, CURLOPT_NOBODY, true);
curl_exec($result);
$imageSize = curl_getinfo($result, CURLINFO_CONTENT_LENGTH_DOWNLOAD);
curl_close($result);
return (int) $imageSize;
} | [
"private",
"static",
"function",
"getRemoteFileSize",
"(",
"$",
"imageUrl",
")",
"{",
"$",
"result",
"=",
"curl_init",
"(",
"$",
"imageUrl",
")",
";",
"if",
"(",
"!",
"$",
"result",
")",
"{",
"return",
"0",
";",
"}",
"curl_setopt",
"(",
"$",
"result",
... | Ues CURL to detect Remote Image Size
@param string $imageUrl
@return int | [
"Ues",
"CURL",
"to",
"detect",
"Remote",
"Image",
"Size"
] | f69724117b979e10eb38e72f7fe38611b5c3f830 | https://github.com/SplashSync/Php-Core/blob/f69724117b979e10eb38e72f7fe38611b5c3f830/Models/Helpers/ImagesHelper.php#L182-L198 | train |
SplashSync/Php-Core | Core/SplashCore.php | SplashCore.configuration | public static function configuration()
{
//====================================================================//
// Configuration Array Already Exists
//====================================================================//
if (isset(self::core()->conf)) {
return self::core()->conf;
}
//====================================================================//
// Load Module Core Configuration
//====================================================================//
//====================================================================//
// Initialize Empty Configuration
self::core()->conf = new ArrayObject(array(), ArrayObject::ARRAY_AS_PROPS);
$config = &self::core()->conf;
//====================================================================//
// Load Module Core Configuration from Definition File
//====================================================================//
// Translations Parameters
$config->DefaultLanguage = SPLASH_DF_LANG;
//====================================================================//
// WebService Core Parameters
$config->WsMethod = SPLASH_WS_METHOD;
$config->WsTimout = SPLASH_TIMEOUT;
$config->WsCrypt = SPLASH_CRYPT_METHOD;
$config->WsEncode = SPLASH_ENCODE;
$config->WsHost = 'www.splashsync.com/ws/soap';
//====================================================================//
// Activity Logging Parameters
$config->Logging = SPLASH_LOGGING;
$config->TraceIn = SPLASH_TRACE_IN;
$config->TraceOut = SPLASH_TRACE_OUT;
$config->TraceTasks = SPLASH_TRACE_TASKS;
//====================================================================//
// Custom Parameters Configurator
$config->Configurator = JsonConfigurator::class;
//====================================================================//
// Server Requests Configuration
$config->server = array();
//====================================================================//
// Load Module Local Configuration (In Safe Mode)
//====================================================================//
$localConf = self::local()->Parameters();
//====================================================================//
// Validate Local Parameters
if (self::validate()->isValidLocalParameterArray($localConf)) {
//====================================================================//
// Import Local Parameters
foreach ($localConf as $key => $value) {
$config->{$key} = trim($value);
}
}
//====================================================================//
// Load Module Local Custom Configuration (from Configurator)
//====================================================================//
$customConf = self::configurator()->getParameters();
//====================================================================//
// Import Local Parameters
foreach ($customConf as $key => $value) {
$config->{$key} = trim($value);
}
return self::core()->conf;
} | php | public static function configuration()
{
//====================================================================//
// Configuration Array Already Exists
//====================================================================//
if (isset(self::core()->conf)) {
return self::core()->conf;
}
//====================================================================//
// Load Module Core Configuration
//====================================================================//
//====================================================================//
// Initialize Empty Configuration
self::core()->conf = new ArrayObject(array(), ArrayObject::ARRAY_AS_PROPS);
$config = &self::core()->conf;
//====================================================================//
// Load Module Core Configuration from Definition File
//====================================================================//
// Translations Parameters
$config->DefaultLanguage = SPLASH_DF_LANG;
//====================================================================//
// WebService Core Parameters
$config->WsMethod = SPLASH_WS_METHOD;
$config->WsTimout = SPLASH_TIMEOUT;
$config->WsCrypt = SPLASH_CRYPT_METHOD;
$config->WsEncode = SPLASH_ENCODE;
$config->WsHost = 'www.splashsync.com/ws/soap';
//====================================================================//
// Activity Logging Parameters
$config->Logging = SPLASH_LOGGING;
$config->TraceIn = SPLASH_TRACE_IN;
$config->TraceOut = SPLASH_TRACE_OUT;
$config->TraceTasks = SPLASH_TRACE_TASKS;
//====================================================================//
// Custom Parameters Configurator
$config->Configurator = JsonConfigurator::class;
//====================================================================//
// Server Requests Configuration
$config->server = array();
//====================================================================//
// Load Module Local Configuration (In Safe Mode)
//====================================================================//
$localConf = self::local()->Parameters();
//====================================================================//
// Validate Local Parameters
if (self::validate()->isValidLocalParameterArray($localConf)) {
//====================================================================//
// Import Local Parameters
foreach ($localConf as $key => $value) {
$config->{$key} = trim($value);
}
}
//====================================================================//
// Load Module Local Custom Configuration (from Configurator)
//====================================================================//
$customConf = self::configurator()->getParameters();
//====================================================================//
// Import Local Parameters
foreach ($customConf as $key => $value) {
$config->{$key} = trim($value);
}
return self::core()->conf;
} | [
"public",
"static",
"function",
"configuration",
"(",
")",
"{",
"//====================================================================//",
"// Configuration Array Already Exists",
"//====================================================================//",
"if",
"(",
"isset",
"(",
"self"... | Get Configuration Array
@return ArrayObject | [
"Get",
"Configuration",
"Array"
] | f69724117b979e10eb38e72f7fe38611b5c3f830 | https://github.com/SplashSync/Php-Core/blob/f69724117b979e10eb38e72f7fe38611b5c3f830/Core/SplashCore.php#L214-L286 | train |
SplashSync/Php-Core | Core/SplashCore.php | SplashCore.log | public static function log()
{
if (!isset(self::core()->log)) {
//====================================================================//
// Initialize Log & Debug
self::core()->log = new Logger();
//====================================================================//
// Define Standard Messages Prefix if Not Overiden
if (isset(self::configuration()->localname)) {
self::core()->log->setPrefix(self::configuration()->localname);
}
}
return self::core()->log;
} | php | public static function log()
{
if (!isset(self::core()->log)) {
//====================================================================//
// Initialize Log & Debug
self::core()->log = new Logger();
//====================================================================//
// Define Standard Messages Prefix if Not Overiden
if (isset(self::configuration()->localname)) {
self::core()->log->setPrefix(self::configuration()->localname);
}
}
return self::core()->log;
} | [
"public",
"static",
"function",
"log",
"(",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"self",
"::",
"core",
"(",
")",
"->",
"log",
")",
")",
"{",
"//====================================================================//",
"// Initialize Log & Debug",
"self",
"::",
"... | Get a singleton Log Class
Acces to Module Logging Functions
@return Logger | [
"Get",
"a",
"singleton",
"Log",
"Class",
"Acces",
"to",
"Module",
"Logging",
"Functions"
] | f69724117b979e10eb38e72f7fe38611b5c3f830 | https://github.com/SplashSync/Php-Core/blob/f69724117b979e10eb38e72f7fe38611b5c3f830/Core/SplashCore.php#L294-L309 | train |
SplashSync/Php-Core | Core/SplashCore.php | SplashCore.com | public static function com()
{
if (isset(self::core()->com)) {
return self::core()->com;
}
switch (self::configuration()->WsMethod) {
case 'SOAP':
self::log()->deb('Selected SOAP PHP Protocol for Communication');
self::core()->com = new \Splash\Components\SOAP\SOAPInterface();
break;
case 'NuSOAP':
default:
self::log()->deb('Selected NuSOAP PHP Librarie for Communication');
self::core()->com = new \Splash\Components\NuSOAP\NuSOAPInterface();
break;
}
return self::core()->com;
} | php | public static function com()
{
if (isset(self::core()->com)) {
return self::core()->com;
}
switch (self::configuration()->WsMethod) {
case 'SOAP':
self::log()->deb('Selected SOAP PHP Protocol for Communication');
self::core()->com = new \Splash\Components\SOAP\SOAPInterface();
break;
case 'NuSOAP':
default:
self::log()->deb('Selected NuSOAP PHP Librarie for Communication');
self::core()->com = new \Splash\Components\NuSOAP\NuSOAPInterface();
break;
}
return self::core()->com;
} | [
"public",
"static",
"function",
"com",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"self",
"::",
"core",
"(",
")",
"->",
"com",
")",
")",
"{",
"return",
"self",
"::",
"core",
"(",
")",
"->",
"com",
";",
"}",
"switch",
"(",
"self",
"::",
"configuratio... | Get a singleton Communication Class
@return CommunicationInterface | [
"Get",
"a",
"singleton",
"Communication",
"Class"
] | f69724117b979e10eb38e72f7fe38611b5c3f830 | https://github.com/SplashSync/Php-Core/blob/f69724117b979e10eb38e72f7fe38611b5c3f830/Core/SplashCore.php#L316-L337 | train |
SplashSync/Php-Core | Core/SplashCore.php | SplashCore.ws | public static function ws()
{
if (!isset(self::core()->soap)) {
//====================================================================//
// WEBSERVICE INITIALISATION
//====================================================================//
// Initialize SOAP WebServices Class
self::core()->soap = new Webservice();
//====================================================================//
// Initialize WebService Configuration Array
self::core()->soap->setup();
//====================================================================//
// Load Translation File
self::translator()->load('ws');
}
return self::core()->soap;
} | php | public static function ws()
{
if (!isset(self::core()->soap)) {
//====================================================================//
// WEBSERVICE INITIALISATION
//====================================================================//
// Initialize SOAP WebServices Class
self::core()->soap = new Webservice();
//====================================================================//
// Initialize WebService Configuration Array
self::core()->soap->setup();
//====================================================================//
// Load Translation File
self::translator()->load('ws');
}
return self::core()->soap;
} | [
"public",
"static",
"function",
"ws",
"(",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"self",
"::",
"core",
"(",
")",
"->",
"soap",
")",
")",
"{",
"//====================================================================//",
"// WEBSERVICE INITIALISATION",
"//=============... | Get a singleton WebService Class
Acces to NuSOAP WebService Communication Functions
@return Webservice
@SuppressWarnings(PHPMD.ShortMethodName) | [
"Get",
"a",
"singleton",
"WebService",
"Class",
"Acces",
"to",
"NuSOAP",
"WebService",
"Communication",
"Functions"
] | f69724117b979e10eb38e72f7fe38611b5c3f830 | https://github.com/SplashSync/Php-Core/blob/f69724117b979e10eb38e72f7fe38611b5c3f830/Core/SplashCore.php#L346-L365 | train |
SplashSync/Php-Core | Core/SplashCore.php | SplashCore.router | public static function router()
{
if (isset(self::core()->router)) {
return self::core()->router;
}
//====================================================================//
// Initialize Tasks List
self::core()->router = new Router();
return self::core()->router;
} | php | public static function router()
{
if (isset(self::core()->router)) {
return self::core()->router;
}
//====================================================================//
// Initialize Tasks List
self::core()->router = new Router();
return self::core()->router;
} | [
"public",
"static",
"function",
"router",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"self",
"::",
"core",
"(",
")",
"->",
"router",
")",
")",
"{",
"return",
"self",
"::",
"core",
"(",
")",
"->",
"router",
";",
"}",
"//======================================... | Get a singleton Router Class
Acces to Server Tasking Management Functions
@return Router | [
"Get",
"a",
"singleton",
"Router",
"Class",
"Acces",
"to",
"Server",
"Tasking",
"Management",
"Functions"
] | f69724117b979e10eb38e72f7fe38611b5c3f830 | https://github.com/SplashSync/Php-Core/blob/f69724117b979e10eb38e72f7fe38611b5c3f830/Core/SplashCore.php#L373-L384 | train |
SplashSync/Php-Core | Core/SplashCore.php | SplashCore.file | public static function file()
{
if (!isset(self::core()->file)) {
//====================================================================//
// Initialize Tasks List
self::core()->file = new FileManager();
//====================================================================//
// Load Translation File
self::translator()->load('file');
}
return self::core()->file;
} | php | public static function file()
{
if (!isset(self::core()->file)) {
//====================================================================//
// Initialize Tasks List
self::core()->file = new FileManager();
//====================================================================//
// Load Translation File
self::translator()->load('file');
}
return self::core()->file;
} | [
"public",
"static",
"function",
"file",
"(",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"self",
"::",
"core",
"(",
")",
"->",
"file",
")",
")",
"{",
"//====================================================================//",
"// Initialize Tasks List",
"self",
"::",
... | Get a singleton File Class
Acces to File Management Functions
@return FileManager | [
"Get",
"a",
"singleton",
"File",
"Class",
"Acces",
"to",
"File",
"Management",
"Functions"
] | f69724117b979e10eb38e72f7fe38611b5c3f830 | https://github.com/SplashSync/Php-Core/blob/f69724117b979e10eb38e72f7fe38611b5c3f830/Core/SplashCore.php#L392-L405 | train |
SplashSync/Php-Core | Core/SplashCore.php | SplashCore.validate | public static function validate()
{
if (isset(self::core()->valid)) {
return self::core()->valid;
}
//====================================================================//
// Initialize Tasks List
self::core()->valid = new Validator();
//====================================================================//
// Load Translation File
self::translator()->load('ws');
self::translator()->load('validate');
return self::core()->valid;
} | php | public static function validate()
{
if (isset(self::core()->valid)) {
return self::core()->valid;
}
//====================================================================//
// Initialize Tasks List
self::core()->valid = new Validator();
//====================================================================//
// Load Translation File
self::translator()->load('ws');
self::translator()->load('validate');
return self::core()->valid;
} | [
"public",
"static",
"function",
"validate",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"self",
"::",
"core",
"(",
")",
"->",
"valid",
")",
")",
"{",
"return",
"self",
"::",
"core",
"(",
")",
"->",
"valid",
";",
"}",
"//======================================... | Get a singleton Validate Class
Acces to Module Validation Functions
@return Validator | [
"Get",
"a",
"singleton",
"Validate",
"Class",
"Acces",
"to",
"Module",
"Validation",
"Functions"
] | f69724117b979e10eb38e72f7fe38611b5c3f830 | https://github.com/SplashSync/Php-Core/blob/f69724117b979e10eb38e72f7fe38611b5c3f830/Core/SplashCore.php#L413-L429 | train |
SplashSync/Php-Core | Core/SplashCore.php | SplashCore.xml | public static function xml()
{
if (isset(self::core()->xml)) {
return self::core()->xml;
}
//====================================================================//
// Initialize Tasks List
self::core()->xml = new XmlManager();
return self::core()->xml;
} | php | public static function xml()
{
if (isset(self::core()->xml)) {
return self::core()->xml;
}
//====================================================================//
// Initialize Tasks List
self::core()->xml = new XmlManager();
return self::core()->xml;
} | [
"public",
"static",
"function",
"xml",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"self",
"::",
"core",
"(",
")",
"->",
"xml",
")",
")",
"{",
"return",
"self",
"::",
"core",
"(",
")",
"->",
"xml",
";",
"}",
"//===============================================... | Get a singleton Xml Parser Class
Acces to Module Xml Parser Functions
@return XmlManager | [
"Get",
"a",
"singleton",
"Xml",
"Parser",
"Class",
"Acces",
"to",
"Module",
"Xml",
"Parser",
"Functions"
] | f69724117b979e10eb38e72f7fe38611b5c3f830 | https://github.com/SplashSync/Php-Core/blob/f69724117b979e10eb38e72f7fe38611b5c3f830/Core/SplashCore.php#L437-L448 | train |
SplashSync/Php-Core | Core/SplashCore.php | SplashCore.translator | public static function translator()
{
if (!isset(self::core()->translator)) {
//====================================================================//
// Initialize Tasks List
self::core()->translator = new Translator();
}
return self::core()->translator;
} | php | public static function translator()
{
if (!isset(self::core()->translator)) {
//====================================================================//
// Initialize Tasks List
self::core()->translator = new Translator();
}
return self::core()->translator;
} | [
"public",
"static",
"function",
"translator",
"(",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"self",
"::",
"core",
"(",
")",
"->",
"translator",
")",
")",
"{",
"//====================================================================//",
"// Initialize Tasks List",
"self"... | Get a singleton Translator Class
Acces to Translation Functions
@return Translator | [
"Get",
"a",
"singleton",
"Translator",
"Class",
"Acces",
"to",
"Translation",
"Functions"
] | f69724117b979e10eb38e72f7fe38611b5c3f830 | https://github.com/SplashSync/Php-Core/blob/f69724117b979e10eb38e72f7fe38611b5c3f830/Core/SplashCore.php#L456-L465 | train |
SplashSync/Php-Core | Core/SplashCore.php | SplashCore.local | public static function local()
{
//====================================================================//
// Initialize Local Core Management Class
if (isset(self::core()->localcore)) {
return self::core()->localcore;
}
//====================================================================//
// Verify Local Core Class Exist & is Valid
if (!self::validate()->isValidLocalClass()) {
throw new Exception('You requested access to Local Class, but it is Invalid...');
}
//====================================================================//
// Initialize Class
self::core()->localcore = new Local();
//====================================================================//
// Load Translation File
self::translator()->load('local');
//====================================================================//
// Load Local Includes
self::core()->localcore->Includes();
//====================================================================//
// Return Local Class
return self::core()->localcore;
} | php | public static function local()
{
//====================================================================//
// Initialize Local Core Management Class
if (isset(self::core()->localcore)) {
return self::core()->localcore;
}
//====================================================================//
// Verify Local Core Class Exist & is Valid
if (!self::validate()->isValidLocalClass()) {
throw new Exception('You requested access to Local Class, but it is Invalid...');
}
//====================================================================//
// Initialize Class
self::core()->localcore = new Local();
//====================================================================//
// Load Translation File
self::translator()->load('local');
//====================================================================//
// Load Local Includes
self::core()->localcore->Includes();
//====================================================================//
// Return Local Class
return self::core()->localcore;
} | [
"public",
"static",
"function",
"local",
"(",
")",
"{",
"//====================================================================//",
"// Initialize Local Core Management Class",
"if",
"(",
"isset",
"(",
"self",
"::",
"core",
"(",
")",
"->",
"localcore",
")",
")",
"{",
"r... | Acces Server Local Class
@return LocalClassInterface | [
"Acces",
"Server",
"Local",
"Class"
] | f69724117b979e10eb38e72f7fe38611b5c3f830 | https://github.com/SplashSync/Php-Core/blob/f69724117b979e10eb38e72f7fe38611b5c3f830/Core/SplashCore.php#L472-L496 | train |
SplashSync/Php-Core | Core/SplashCore.php | SplashCore.object | public static function object($objectType)
{
//====================================================================//
// First Access to Local Objects
if (!isset(self::core()->objects)) {
//====================================================================//
// Initialize Local Objects Class Array
self::core()->objects = array();
}
//====================================================================//
// Check in Cache
if (array_key_exists($objectType, self::core()->objects)) {
return self::core()->objects[$objectType];
}
//====================================================================//
// Verify if Object Class is Valid
if (!self::validate()->isValidObject($objectType)) {
throw new Exception('You requested access to an Invalid Object Type : '.$objectType);
}
//====================================================================//
// Check if Object Manager is Overriden
if (self::local() instanceof ObjectsProviderInterface) {
//====================================================================//
// Initialize Local Object Manager
self::core()->objects[$objectType] = self::local()->object($objectType);
} else {
//====================================================================//
// Initialize Standard Class
$className = SPLASH_CLASS_PREFIX.'\\Objects\\'.$objectType;
self::core()->objects[$objectType] = new $className();
}
//====================================================================//
// Load Translation File
self::translator()->load('objects');
return self::core()->objects[$objectType];
} | php | public static function object($objectType)
{
//====================================================================//
// First Access to Local Objects
if (!isset(self::core()->objects)) {
//====================================================================//
// Initialize Local Objects Class Array
self::core()->objects = array();
}
//====================================================================//
// Check in Cache
if (array_key_exists($objectType, self::core()->objects)) {
return self::core()->objects[$objectType];
}
//====================================================================//
// Verify if Object Class is Valid
if (!self::validate()->isValidObject($objectType)) {
throw new Exception('You requested access to an Invalid Object Type : '.$objectType);
}
//====================================================================//
// Check if Object Manager is Overriden
if (self::local() instanceof ObjectsProviderInterface) {
//====================================================================//
// Initialize Local Object Manager
self::core()->objects[$objectType] = self::local()->object($objectType);
} else {
//====================================================================//
// Initialize Standard Class
$className = SPLASH_CLASS_PREFIX.'\\Objects\\'.$objectType;
self::core()->objects[$objectType] = new $className();
}
//====================================================================//
// Load Translation File
self::translator()->load('objects');
return self::core()->objects[$objectType];
} | [
"public",
"static",
"function",
"object",
"(",
"$",
"objectType",
")",
"{",
"//====================================================================//",
"// First Access to Local Objects",
"if",
"(",
"!",
"isset",
"(",
"self",
"::",
"core",
"(",
")",
"->",
"objects",
")"... | Get Specific Object Class
This function is a router for all local object classes & functions
@param string $objectType Local Object Class Name
@throws Exception
@return ObjectInterface | [
"Get",
"Specific",
"Object",
"Class",
"This",
"function",
"is",
"a",
"router",
"for",
"all",
"local",
"object",
"classes",
"&",
"functions"
] | f69724117b979e10eb38e72f7fe38611b5c3f830 | https://github.com/SplashSync/Php-Core/blob/f69724117b979e10eb38e72f7fe38611b5c3f830/Core/SplashCore.php#L520-L560 | train |
SplashSync/Php-Core | Core/SplashCore.php | SplashCore.widget | public static function widget($widgetType)
{
//====================================================================//
// First Access to Local Objects
if (!isset(self::core()->widgets)) {
//====================================================================//
// Initialize Local Widget Class Array
self::core()->widgets = array();
}
//====================================================================//
// Check in Cache
if (array_key_exists($widgetType, self::core()->widgets)) {
return self::core()->widgets[$widgetType];
}
//====================================================================//
// Verify if Widget Class is Valid
if (!self::validate()->isValidWidget($widgetType)) {
throw new Exception('You requested access to an Invalid Widget Type : '.$widgetType);
}
//====================================================================//
// Check if Widget Manager is Overriden
if (self::local() instanceof WidgetsProviderInterface) {
//====================================================================//
// Initialize Local Widget Manager
self::core()->widgets[$widgetType] = self::local()->widget($widgetType);
} else {
//====================================================================//
// Initialize Class
$className = SPLASH_CLASS_PREFIX.'\\Widgets\\'.$widgetType;
self::core()->widgets[$widgetType] = new $className();
}
//====================================================================//
// Load Translation File
self::translator()->load('widgets');
return self::core()->widgets[$widgetType];
} | php | public static function widget($widgetType)
{
//====================================================================//
// First Access to Local Objects
if (!isset(self::core()->widgets)) {
//====================================================================//
// Initialize Local Widget Class Array
self::core()->widgets = array();
}
//====================================================================//
// Check in Cache
if (array_key_exists($widgetType, self::core()->widgets)) {
return self::core()->widgets[$widgetType];
}
//====================================================================//
// Verify if Widget Class is Valid
if (!self::validate()->isValidWidget($widgetType)) {
throw new Exception('You requested access to an Invalid Widget Type : '.$widgetType);
}
//====================================================================//
// Check if Widget Manager is Overriden
if (self::local() instanceof WidgetsProviderInterface) {
//====================================================================//
// Initialize Local Widget Manager
self::core()->widgets[$widgetType] = self::local()->widget($widgetType);
} else {
//====================================================================//
// Initialize Class
$className = SPLASH_CLASS_PREFIX.'\\Widgets\\'.$widgetType;
self::core()->widgets[$widgetType] = new $className();
}
//====================================================================//
// Load Translation File
self::translator()->load('widgets');
return self::core()->widgets[$widgetType];
} | [
"public",
"static",
"function",
"widget",
"(",
"$",
"widgetType",
")",
"{",
"//====================================================================//",
"// First Access to Local Objects",
"if",
"(",
"!",
"isset",
"(",
"self",
"::",
"core",
"(",
")",
"->",
"widgets",
")"... | Get Specific Widget Class
This function is a router for all local widgets classes & functions
@param string $widgetType Local Widget Class Name
@throws Exception
@return WidgetInterface | [
"Get",
"Specific",
"Widget",
"Class",
"This",
"function",
"is",
"a",
"router",
"for",
"all",
"local",
"widgets",
"classes",
"&",
"functions"
] | f69724117b979e10eb38e72f7fe38611b5c3f830 | https://github.com/SplashSync/Php-Core/blob/f69724117b979e10eb38e72f7fe38611b5c3f830/Core/SplashCore.php#L572-L612 | train |
SplashSync/Php-Core | Core/SplashCore.php | SplashCore.configurator | public static function configurator()
{
//====================================================================//
// Configuration Array Already Exists
//====================================================================//
if (isset(self::core()->configurator)) {
return self::core()->configurator;
}
//====================================================================//
// Load Configurator Class Name from Configuration
$className = self::configuration()->Configurator;
//====================================================================//
// No Configurator Defined
if (!is_string($className) || empty($className)) {
return new NullConfigurator();
}
//====================================================================//
// Validate Configurator Class Name
if (false == self::validate()->isValidConfigurator($className)) {
return new NullConfigurator();
}
//====================================================================//
// Initialize Configurator
self::core()->configurator = new $className();
return self::core()->configurator;
} | php | public static function configurator()
{
//====================================================================//
// Configuration Array Already Exists
//====================================================================//
if (isset(self::core()->configurator)) {
return self::core()->configurator;
}
//====================================================================//
// Load Configurator Class Name from Configuration
$className = self::configuration()->Configurator;
//====================================================================//
// No Configurator Defined
if (!is_string($className) || empty($className)) {
return new NullConfigurator();
}
//====================================================================//
// Validate Configurator Class Name
if (false == self::validate()->isValidConfigurator($className)) {
return new NullConfigurator();
}
//====================================================================//
// Initialize Configurator
self::core()->configurator = new $className();
return self::core()->configurator;
} | [
"public",
"static",
"function",
"configurator",
"(",
")",
"{",
"//====================================================================//",
"// Configuration Array Already Exists",
"//====================================================================//",
"if",
"(",
"isset",
"(",
"self",... | Get Configurator Parser Instance
@return ConfiguratorInterface | [
"Get",
"Configurator",
"Parser",
"Instance"
] | f69724117b979e10eb38e72f7fe38611b5c3f830 | https://github.com/SplashSync/Php-Core/blob/f69724117b979e10eb38e72f7fe38611b5c3f830/Core/SplashCore.php#L619-L647 | train |
SplashSync/Php-Core | Core/SplashCore.php | SplashCore.reboot | public static function reboot()
{
//====================================================================//
// Clear Module Configuration Array
if (isset(self::core()->conf)) {
self::core()->conf = null;
}
//====================================================================//
// Clear Webservice Configuration
if (isset(self::core()->soap)) {
self::core()->soap = null;
}
//====================================================================//
// Clear Module Local Objects Classes
if (isset(self::core()->objects)) {
self::core()->objects = null;
}
//====================================================================//
// Clear Module Log
self::log()->cleanLog();
self::log()->deb('Splash Module Rebooted');
} | php | public static function reboot()
{
//====================================================================//
// Clear Module Configuration Array
if (isset(self::core()->conf)) {
self::core()->conf = null;
}
//====================================================================//
// Clear Webservice Configuration
if (isset(self::core()->soap)) {
self::core()->soap = null;
}
//====================================================================//
// Clear Module Local Objects Classes
if (isset(self::core()->objects)) {
self::core()->objects = null;
}
//====================================================================//
// Clear Module Log
self::log()->cleanLog();
self::log()->deb('Splash Module Rebooted');
} | [
"public",
"static",
"function",
"reboot",
"(",
")",
"{",
"//====================================================================//",
"// Clear Module Configuration Array",
"if",
"(",
"isset",
"(",
"self",
"::",
"core",
"(",
")",
"->",
"conf",
")",
")",
"{",
"self",
":... | Fully Restart Splash Module | [
"Fully",
"Restart",
"Splash",
"Module"
] | f69724117b979e10eb38e72f7fe38611b5c3f830 | https://github.com/SplashSync/Php-Core/blob/f69724117b979e10eb38e72f7fe38611b5c3f830/Core/SplashCore.php#L652-L673 | train |
SplashSync/Php-Core | Core/SplashCore.php | SplashCore.getLocalPath | public static function getLocalPath()
{
//====================================================================//
// Safety Check => Verify Local Class is Valid
if (null == self::local()) {
return null;
}
//====================================================================//
// Create A Reflection Class of Local Class
$reflector = new \ReflectionClass(get_class(self::local()));
//====================================================================//
// Return Class Local Path
return dirname((string) $reflector->getFileName());
} | php | public static function getLocalPath()
{
//====================================================================//
// Safety Check => Verify Local Class is Valid
if (null == self::local()) {
return null;
}
//====================================================================//
// Create A Reflection Class of Local Class
$reflector = new \ReflectionClass(get_class(self::local()));
//====================================================================//
// Return Class Local Path
return dirname((string) $reflector->getFileName());
} | [
"public",
"static",
"function",
"getLocalPath",
"(",
")",
"{",
"//====================================================================//",
"// Safety Check => Verify Local Class is Valid",
"if",
"(",
"null",
"==",
"self",
"::",
"local",
"(",
")",
")",
"{",
"return",
"null",... | Detect Real Path of Current Module Local Class
@return null|string | [
"Detect",
"Real",
"Path",
"of",
"Current",
"Module",
"Local",
"Class"
] | f69724117b979e10eb38e72f7fe38611b5c3f830 | https://github.com/SplashSync/Php-Core/blob/f69724117b979e10eb38e72f7fe38611b5c3f830/Core/SplashCore.php#L714-L727 | train |
SplashSync/Php-Core | Core/SplashCore.php | SplashCore.input | public static function input($name, $type = INPUT_SERVER)
{
//====================================================================//
// Standard Safe Reading
$result = filter_input($type, $name);
if (null !== $result) {
return $result;
}
//====================================================================//
// Fallback Reading
if ((INPUT_SERVER === $type) && isset($_SERVER[$name])) {
return $_SERVER[$name];
}
if ((INPUT_GET === $type) && isset($_GET[$name])) {
return $_GET[$name];
}
return null;
} | php | public static function input($name, $type = INPUT_SERVER)
{
//====================================================================//
// Standard Safe Reading
$result = filter_input($type, $name);
if (null !== $result) {
return $result;
}
//====================================================================//
// Fallback Reading
if ((INPUT_SERVER === $type) && isset($_SERVER[$name])) {
return $_SERVER[$name];
}
if ((INPUT_GET === $type) && isset($_GET[$name])) {
return $_GET[$name];
}
return null;
} | [
"public",
"static",
"function",
"input",
"(",
"$",
"name",
",",
"$",
"type",
"=",
"INPUT_SERVER",
")",
"{",
"//====================================================================//",
"// Standard Safe Reading",
"$",
"result",
"=",
"filter_input",
"(",
"$",
"type",
",",... | Secured reading of Server SuperGlobals
@param string $name
@param int $type
@return null|string
@SuppressWarnings(PHPMD.Superglobals) | [
"Secured",
"reading",
"of",
"Server",
"SuperGlobals"
] | f69724117b979e10eb38e72f7fe38611b5c3f830 | https://github.com/SplashSync/Php-Core/blob/f69724117b979e10eb38e72f7fe38611b5c3f830/Core/SplashCore.php#L738-L756 | train |
SplashSync/Php-Core | Core/SplashCore.php | SplashCore.informations | public static function informations()
{
//====================================================================//
// Init Response Object
$response = new ArrayObject(array(), ArrayObject::ARRAY_AS_PROPS);
//====================================================================//
// Server General Description
$response->shortdesc = SPLASH_NAME.' '.SPLASH_VERSION;
$response->longdesc = SPLASH_DESC;
//====================================================================//
// Company Informations
$response->company = null;
$response->address = null;
$response->zip = null;
$response->town = null;
$response->country = null;
$response->www = null;
$response->email = null;
$response->phone = null;
//====================================================================//
// Server Logo & Ico
$response->icoraw = self::file()->readFileContents(
dirname(dirname(__FILE__)).'/img/Splash-ico.png'
);
$response->logourl = null;
$response->logoraw = self::file()->readFileContents(
dirname(dirname(__FILE__)).'/img/Splash-ico.jpg'
);
//====================================================================//
// Server Informations
$response->servertype = SPLASH_NAME;
$response->serverurl = filter_input(INPUT_SERVER, 'SERVER_NAME');
//====================================================================//
// Module Informations
$response->moduleauthor = SPLASH_AUTHOR;
$response->moduleversion = SPLASH_VERSION;
//====================================================================//
// Verify Local Module Class Is Valid
if (!self::validate()->isValidLocalClass()) {
return $response;
}
//====================================================================//
// Merge Informations with Local Module Informations
$localArray = self::local()->informations($response);
if (!($localArray instanceof ArrayObject)) {
$response = $localArray;
}
return $response;
} | php | public static function informations()
{
//====================================================================//
// Init Response Object
$response = new ArrayObject(array(), ArrayObject::ARRAY_AS_PROPS);
//====================================================================//
// Server General Description
$response->shortdesc = SPLASH_NAME.' '.SPLASH_VERSION;
$response->longdesc = SPLASH_DESC;
//====================================================================//
// Company Informations
$response->company = null;
$response->address = null;
$response->zip = null;
$response->town = null;
$response->country = null;
$response->www = null;
$response->email = null;
$response->phone = null;
//====================================================================//
// Server Logo & Ico
$response->icoraw = self::file()->readFileContents(
dirname(dirname(__FILE__)).'/img/Splash-ico.png'
);
$response->logourl = null;
$response->logoraw = self::file()->readFileContents(
dirname(dirname(__FILE__)).'/img/Splash-ico.jpg'
);
//====================================================================//
// Server Informations
$response->servertype = SPLASH_NAME;
$response->serverurl = filter_input(INPUT_SERVER, 'SERVER_NAME');
//====================================================================//
// Module Informations
$response->moduleauthor = SPLASH_AUTHOR;
$response->moduleversion = SPLASH_VERSION;
//====================================================================//
// Verify Local Module Class Is Valid
if (!self::validate()->isValidLocalClass()) {
return $response;
}
//====================================================================//
// Merge Informations with Local Module Informations
$localArray = self::local()->informations($response);
if (!($localArray instanceof ArrayObject)) {
$response = $localArray;
}
return $response;
} | [
"public",
"static",
"function",
"informations",
"(",
")",
"{",
"//====================================================================//",
"// Init Response Object",
"$",
"response",
"=",
"new",
"ArrayObject",
"(",
"array",
"(",
")",
",",
"ArrayObject",
"::",
"ARRAY_AS_PROP... | Ask for Server System Informations
Informations may be overwritten by Local Module Class
@return ArrayObject Array including all server informations
**************************************************************************
****** General Parameters
**************************************************************************
$r->Name = $this->name;
$r->Id = $this->id;
**************************************************************************
****** Server Infos
**************************************************************************
$r->php = phpversion();
$r->Self = $_SERVER["PHP_SELF"];
$r->Server = $_SERVER["SERVER_NAME"];
$r->ServerAddress = $_SERVER["SERVER_ADDR"];
$r->Port = $_SERVER["SERVER_PORT"];
$r->UserAgent = $_SERVER["HTTP_USER_AGENT"]; | [
"Ask",
"for",
"Server",
"System",
"Informations",
"Informations",
"may",
"be",
"overwritten",
"by",
"Local",
"Module",
"Class"
] | f69724117b979e10eb38e72f7fe38611b5c3f830 | https://github.com/SplashSync/Php-Core/blob/f69724117b979e10eb38e72f7fe38611b5c3f830/Core/SplashCore.php#L834-L890 | train |
SplashSync/Php-Core | Core/SplashCore.php | SplashCore.objects | public static function objects()
{
//====================================================================//
// Check if Object Manager is Overriden
if (self::local() instanceof ObjectsProviderInterface) {
return self::local()->objects();
}
$objectsList = array();
//====================================================================//
// Safety Check => Verify Objects Folder Exists
$path = self::getLocalPath().'/Objects';
if (!is_dir($path)) {
return $objectsList;
}
//====================================================================//
// Scan Local Objects Folder
$scan = scandir($path, 1);
if (false == $scan) {
return $objectsList;
}
//====================================================================//
// Scan Each File in Folder
$files = array_diff($scan, array('..', '.', 'index.php', 'index.html'));
foreach ($files as $filename) {
//====================================================================//
// Verify Filename is a File (Not a Directory)
if (!is_file($path.'/'.$filename)) {
continue;
}
//====================================================================//
// Extract Class Name
$className = pathinfo($path.'/'.$filename, PATHINFO_FILENAME);
//====================================================================//
// Verify ClassName is a Valid Object File
if (false == self::validate()->isValidObject($className)) {
continue;
}
$objectsList[] = $className;
}
return $objectsList;
} | php | public static function objects()
{
//====================================================================//
// Check if Object Manager is Overriden
if (self::local() instanceof ObjectsProviderInterface) {
return self::local()->objects();
}
$objectsList = array();
//====================================================================//
// Safety Check => Verify Objects Folder Exists
$path = self::getLocalPath().'/Objects';
if (!is_dir($path)) {
return $objectsList;
}
//====================================================================//
// Scan Local Objects Folder
$scan = scandir($path, 1);
if (false == $scan) {
return $objectsList;
}
//====================================================================//
// Scan Each File in Folder
$files = array_diff($scan, array('..', '.', 'index.php', 'index.html'));
foreach ($files as $filename) {
//====================================================================//
// Verify Filename is a File (Not a Directory)
if (!is_file($path.'/'.$filename)) {
continue;
}
//====================================================================//
// Extract Class Name
$className = pathinfo($path.'/'.$filename, PATHINFO_FILENAME);
//====================================================================//
// Verify ClassName is a Valid Object File
if (false == self::validate()->isValidObject($className)) {
continue;
}
$objectsList[] = $className;
}
return $objectsList;
} | [
"public",
"static",
"function",
"objects",
"(",
")",
"{",
"//====================================================================//",
"// Check if Object Manager is Overriden",
"if",
"(",
"self",
"::",
"local",
"(",
")",
"instanceof",
"ObjectsProviderInterface",
")",
"{",
"re... | Build list of Available Objects
@return array | [
"Build",
"list",
"of",
"Available",
"Objects"
] | f69724117b979e10eb38e72f7fe38611b5c3f830 | https://github.com/SplashSync/Php-Core/blob/f69724117b979e10eb38e72f7fe38611b5c3f830/Core/SplashCore.php#L897-L938 | train |
SplashSync/Php-Core | Core/SplashCore.php | SplashCore.widgets | public static function widgets()
{
//====================================================================//
// Check if Widget Manager is Overriden
if (self::local() instanceof WidgetsProviderInterface) {
return self::local()->widgets();
}
$widgetTypes = array();
//====================================================================//
// Safety Check => Verify Objects Folder Exists
$path = self::getLocalPath().'/Widgets';
if (!is_dir($path)) {
return $widgetTypes;
}
//====================================================================//
// Scan Local Objects Folder
$scan = scandir($path, 1);
if (false == $scan) {
return $widgetTypes;
}
//====================================================================//
// Scan Each File in Folder
$files = array_diff($scan, array('..', '.', 'index.php', 'index.html'));
foreach ($files as $filename) {
$className = pathinfo($path.'/'.$filename, PATHINFO_FILENAME);
//====================================================================//
// Verify ClassName is a Valid Object File
if (false == self::validate()->isValidWidget($className)) {
continue;
}
$widgetTypes[] = $className;
}
return $widgetTypes;
} | php | public static function widgets()
{
//====================================================================//
// Check if Widget Manager is Overriden
if (self::local() instanceof WidgetsProviderInterface) {
return self::local()->widgets();
}
$widgetTypes = array();
//====================================================================//
// Safety Check => Verify Objects Folder Exists
$path = self::getLocalPath().'/Widgets';
if (!is_dir($path)) {
return $widgetTypes;
}
//====================================================================//
// Scan Local Objects Folder
$scan = scandir($path, 1);
if (false == $scan) {
return $widgetTypes;
}
//====================================================================//
// Scan Each File in Folder
$files = array_diff($scan, array('..', '.', 'index.php', 'index.html'));
foreach ($files as $filename) {
$className = pathinfo($path.'/'.$filename, PATHINFO_FILENAME);
//====================================================================//
// Verify ClassName is a Valid Object File
if (false == self::validate()->isValidWidget($className)) {
continue;
}
$widgetTypes[] = $className;
}
return $widgetTypes;
} | [
"public",
"static",
"function",
"widgets",
"(",
")",
"{",
"//====================================================================//",
"// Check if Widget Manager is Overriden",
"if",
"(",
"self",
"::",
"local",
"(",
")",
"instanceof",
"WidgetsProviderInterface",
")",
"{",
"re... | Build list of Available Widgets
@return array | [
"Build",
"list",
"of",
"Available",
"Widgets"
] | f69724117b979e10eb38e72f7fe38611b5c3f830 | https://github.com/SplashSync/Php-Core/blob/f69724117b979e10eb38e72f7fe38611b5c3f830/Core/SplashCore.php#L994-L1028 | train |
SplashSync/Php-Core | Components/NuSOAP/nusoap.php | nusoap_base.serializeEnvelope | public function serializeEnvelope($body, $headers = false, $namespaces = array(), $style = 'rpc', $use = 'encoded', $encodingStyle = 'http://schemas.xmlsoap.org/soap/encoding/')
{
// TODO: add an option to automatically run utf8_encode on $body and $headers
// if $this->soap_defencoding is UTF-8. Not doing this automatically allows
// one to send arbitrary UTF-8 characters, not just characters that map to ISO-8859-1
$this->debug("In serializeEnvelope length=" . strlen($body) . " body (max 1000 characters)=" . substr($body, 0, 1000) . " style=$style use=$use encodingStyle=$encodingStyle");
$this->debug("headers:");
$this->appendDebug($this->varDump($headers));
$this->debug("namespaces:");
$this->appendDebug($this->varDump($namespaces));
// serialize namespaces
$ns_string = '';
foreach (array_merge($this->namespaces, $namespaces) as $k => $v) {
$ns_string .= " xmlns:$k=\"$v\"";
}
if ($encodingStyle) {
$ns_string = " SOAP-ENV:encodingStyle=\"$encodingStyle\"$ns_string";
}
// serialize headers
if ($headers) {
if (is_array($headers)) {
$xml = '';
foreach ($headers as $k => $v) {
if (is_object($v) && get_class($v) == 'soapval') {
$xml .= $this->serialize_val($v, false, false, false, false, false, $use);
} else {
$xml .= $this->serialize_val($v, $k, false, false, false, false, $use);
}
}
$headers = $xml;
$this->debug("In serializeEnvelope, serialized array of headers to $headers");
}
$headers = "<SOAP-ENV:Header>" . $headers . "</SOAP-ENV:Header>";
}
// serialize envelope
return
'<?xml version="1.0" encoding="' . $this->soap_defencoding . '"?' . ">" .
'<SOAP-ENV:Envelope' . $ns_string . ">" .
$headers .
"<SOAP-ENV:Body>" .
$body .
"</SOAP-ENV:Body>" .
"</SOAP-ENV:Envelope>";
} | php | public function serializeEnvelope($body, $headers = false, $namespaces = array(), $style = 'rpc', $use = 'encoded', $encodingStyle = 'http://schemas.xmlsoap.org/soap/encoding/')
{
// TODO: add an option to automatically run utf8_encode on $body and $headers
// if $this->soap_defencoding is UTF-8. Not doing this automatically allows
// one to send arbitrary UTF-8 characters, not just characters that map to ISO-8859-1
$this->debug("In serializeEnvelope length=" . strlen($body) . " body (max 1000 characters)=" . substr($body, 0, 1000) . " style=$style use=$use encodingStyle=$encodingStyle");
$this->debug("headers:");
$this->appendDebug($this->varDump($headers));
$this->debug("namespaces:");
$this->appendDebug($this->varDump($namespaces));
// serialize namespaces
$ns_string = '';
foreach (array_merge($this->namespaces, $namespaces) as $k => $v) {
$ns_string .= " xmlns:$k=\"$v\"";
}
if ($encodingStyle) {
$ns_string = " SOAP-ENV:encodingStyle=\"$encodingStyle\"$ns_string";
}
// serialize headers
if ($headers) {
if (is_array($headers)) {
$xml = '';
foreach ($headers as $k => $v) {
if (is_object($v) && get_class($v) == 'soapval') {
$xml .= $this->serialize_val($v, false, false, false, false, false, $use);
} else {
$xml .= $this->serialize_val($v, $k, false, false, false, false, $use);
}
}
$headers = $xml;
$this->debug("In serializeEnvelope, serialized array of headers to $headers");
}
$headers = "<SOAP-ENV:Header>" . $headers . "</SOAP-ENV:Header>";
}
// serialize envelope
return
'<?xml version="1.0" encoding="' . $this->soap_defencoding . '"?' . ">" .
'<SOAP-ENV:Envelope' . $ns_string . ">" .
$headers .
"<SOAP-ENV:Body>" .
$body .
"</SOAP-ENV:Body>" .
"</SOAP-ENV:Envelope>";
} | [
"public",
"function",
"serializeEnvelope",
"(",
"$",
"body",
",",
"$",
"headers",
"=",
"false",
",",
"$",
"namespaces",
"=",
"array",
"(",
")",
",",
"$",
"style",
"=",
"'rpc'",
",",
"$",
"use",
"=",
"'encoded'",
",",
"$",
"encodingStyle",
"=",
"'http:/... | serializes a message
@param string $body the XML of the SOAP body
@param mixed $headers optional string of XML with SOAP header content, or array of soapval objects for SOAP headers, or associative array
@param array $namespaces optional the namespaces used in generating the body and headers
@param string $style optional (rpc|document)
@param string $use optional (encoded|literal)
@param string $encodingStyle optional (usually 'http://schemas.xmlsoap.org/soap/encoding/' for encoded)
@return string the message
@access public | [
"serializes",
"a",
"message"
] | f69724117b979e10eb38e72f7fe38611b5c3f830 | https://github.com/SplashSync/Php-Core/blob/f69724117b979e10eb38e72f7fe38611b5c3f830/Components/NuSOAP/nusoap.php#L691-L737 | train |
SplashSync/Php-Core | Components/NuSOAP/nusoap.php | nusoap_fault.serialize | public function serialize()
{
$ns_string = '';
foreach ($this->namespaces as $k => $v) {
$ns_string .= "\n xmlns:$k=\"$v\"";
}
$return_msg =
'<?xml version="1.0" encoding="' . $this->soap_defencoding . '"?>' .
'<SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"' . $ns_string . ">\n" .
'<SOAP-ENV:Body>' .
'<SOAP-ENV:Fault>' .
$this->serialize_val($this->faultcode, 'faultcode') .
$this->serialize_val($this->faultactor, 'faultactor') .
$this->serialize_val($this->faultstring, 'faultstring') .
$this->serialize_val($this->faultdetail, 'detail') .
'</SOAP-ENV:Fault>' .
'</SOAP-ENV:Body>' .
'</SOAP-ENV:Envelope>';
return $return_msg;
} | php | public function serialize()
{
$ns_string = '';
foreach ($this->namespaces as $k => $v) {
$ns_string .= "\n xmlns:$k=\"$v\"";
}
$return_msg =
'<?xml version="1.0" encoding="' . $this->soap_defencoding . '"?>' .
'<SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"' . $ns_string . ">\n" .
'<SOAP-ENV:Body>' .
'<SOAP-ENV:Fault>' .
$this->serialize_val($this->faultcode, 'faultcode') .
$this->serialize_val($this->faultactor, 'faultactor') .
$this->serialize_val($this->faultstring, 'faultstring') .
$this->serialize_val($this->faultdetail, 'detail') .
'</SOAP-ENV:Fault>' .
'</SOAP-ENV:Body>' .
'</SOAP-ENV:Envelope>';
return $return_msg;
} | [
"public",
"function",
"serialize",
"(",
")",
"{",
"$",
"ns_string",
"=",
"''",
";",
"foreach",
"(",
"$",
"this",
"->",
"namespaces",
"as",
"$",
"k",
"=>",
"$",
"v",
")",
"{",
"$",
"ns_string",
".=",
"\"\\n xmlns:$k=\\\"$v\\\"\"",
";",
"}",
"$",
"retur... | serialize a fault
@return string The serialization of the fault instance.
@access public | [
"serialize",
"a",
"fault"
] | f69724117b979e10eb38e72f7fe38611b5c3f830 | https://github.com/SplashSync/Php-Core/blob/f69724117b979e10eb38e72f7fe38611b5c3f830/Components/NuSOAP/nusoap.php#L1088-L1107 | train |
SplashSync/Php-Core | Components/NuSOAP/nusoap.php | nusoap_xmlschema.parseString | public function parseString($xml, $type)
{
// parse xml string
if ($xml != "") {
// Create an XML parser.
$this->parser = xml_parser_create();
// Set the options for parsing the XML data.
xml_parser_set_option($this->parser, XML_OPTION_CASE_FOLDING, 0);
// Set the object for the parser.
xml_set_object($this->parser, $this);
// Set the element handlers for the parser.
if ($type == "schema") {
xml_set_element_handler($this->parser, 'schemaStartElement', 'schemaEndElement');
xml_set_character_data_handler($this->parser, 'schemaCharacterData');
} elseif ($type == "xml") {
xml_set_element_handler($this->parser, 'xmlStartElement', 'xmlEndElement');
xml_set_character_data_handler($this->parser, 'xmlCharacterData');
}
// Parse the XML file.
if (!xml_parse($this->parser, $xml, true)) {
// Display an error message.
$errstr = sprintf(
'XML error parsing XML schema on line %d: %s',
xml_get_current_line_number($this->parser),
xml_error_string(xml_get_error_code($this->parser))
);
$this->debug($errstr);
$this->debug("XML payload:\n" . $xml);
$this->setError($errstr);
}
xml_parser_free($this->parser);
} else {
$this->debug('no xml passed to parseString()!!');
$this->setError('no xml passed to parseString()!!');
}
} | php | public function parseString($xml, $type)
{
// parse xml string
if ($xml != "") {
// Create an XML parser.
$this->parser = xml_parser_create();
// Set the options for parsing the XML data.
xml_parser_set_option($this->parser, XML_OPTION_CASE_FOLDING, 0);
// Set the object for the parser.
xml_set_object($this->parser, $this);
// Set the element handlers for the parser.
if ($type == "schema") {
xml_set_element_handler($this->parser, 'schemaStartElement', 'schemaEndElement');
xml_set_character_data_handler($this->parser, 'schemaCharacterData');
} elseif ($type == "xml") {
xml_set_element_handler($this->parser, 'xmlStartElement', 'xmlEndElement');
xml_set_character_data_handler($this->parser, 'xmlCharacterData');
}
// Parse the XML file.
if (!xml_parse($this->parser, $xml, true)) {
// Display an error message.
$errstr = sprintf(
'XML error parsing XML schema on line %d: %s',
xml_get_current_line_number($this->parser),
xml_error_string(xml_get_error_code($this->parser))
);
$this->debug($errstr);
$this->debug("XML payload:\n" . $xml);
$this->setError($errstr);
}
xml_parser_free($this->parser);
} else {
$this->debug('no xml passed to parseString()!!');
$this->setError('no xml passed to parseString()!!');
}
} | [
"public",
"function",
"parseString",
"(",
"$",
"xml",
",",
"$",
"type",
")",
"{",
"// parse xml string",
"if",
"(",
"$",
"xml",
"!=",
"\"\"",
")",
"{",
"// Create an XML parser.",
"$",
"this",
"->",
"parser",
"=",
"xml_parser_create",
"(",
")",
";",
"// Se... | parse an XML string
@param string $xml path or URL
@param string $type (schema|xml)
@access private | [
"parse",
"an",
"XML",
"string"
] | f69724117b979e10eb38e72f7fe38611b5c3f830 | https://github.com/SplashSync/Php-Core/blob/f69724117b979e10eb38e72f7fe38611b5c3f830/Components/NuSOAP/nusoap.php#L1228-L1268 | train |
SplashSync/Php-Core | Components/NuSOAP/nusoap.php | nusoap_xmlschema.CreateTypeName | public function CreateTypeName($ename)
{
$scope = '';
for ($i = 0; $i < count($this->complexTypeStack); $i++) {
$scope .= $this->complexTypeStack[$i] . '_';
}
return $scope . $ename . '_ContainedType';
} | php | public function CreateTypeName($ename)
{
$scope = '';
for ($i = 0; $i < count($this->complexTypeStack); $i++) {
$scope .= $this->complexTypeStack[$i] . '_';
}
return $scope . $ename . '_ContainedType';
} | [
"public",
"function",
"CreateTypeName",
"(",
"$",
"ename",
")",
"{",
"$",
"scope",
"=",
"''",
";",
"for",
"(",
"$",
"i",
"=",
"0",
";",
"$",
"i",
"<",
"count",
"(",
"$",
"this",
"->",
"complexTypeStack",
")",
";",
"$",
"i",
"++",
")",
"{",
"$",... | gets a type name for an unnamed type
@param string Element name
@return string A type name for an unnamed type
@access private | [
"gets",
"a",
"type",
"name",
"for",
"an",
"unnamed",
"type"
] | f69724117b979e10eb38e72f7fe38611b5c3f830 | https://github.com/SplashSync/Php-Core/blob/f69724117b979e10eb38e72f7fe38611b5c3f830/Components/NuSOAP/nusoap.php#L1277-L1284 | train |
SplashSync/Php-Core | Components/NuSOAP/nusoap.php | nusoap_xmlschema.addElement | public function addElement($attrs)
{
if (!$this->getPrefix($attrs['type'])) {
$attrs['type'] = $this->schemaTargetNamespace . ':' . $attrs['type'];
}
$this->elements[$attrs['name']] = $attrs;
$this->elements[$attrs['name']]['typeClass'] = 'element';
$this->xdebug("addElement " . $attrs['name']);
$this->appendDebug($this->varDump($this->elements[$attrs['name']]));
} | php | public function addElement($attrs)
{
if (!$this->getPrefix($attrs['type'])) {
$attrs['type'] = $this->schemaTargetNamespace . ':' . $attrs['type'];
}
$this->elements[$attrs['name']] = $attrs;
$this->elements[$attrs['name']]['typeClass'] = 'element';
$this->xdebug("addElement " . $attrs['name']);
$this->appendDebug($this->varDump($this->elements[$attrs['name']]));
} | [
"public",
"function",
"addElement",
"(",
"$",
"attrs",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"getPrefix",
"(",
"$",
"attrs",
"[",
"'type'",
"]",
")",
")",
"{",
"$",
"attrs",
"[",
"'type'",
"]",
"=",
"$",
"this",
"->",
"schemaTargetNamespace",
... | adds an element to the schema
@param array $attrs attributes that must include name and type
@see nusoap_xmlschema
@access public | [
"adds",
"an",
"element",
"to",
"the",
"schema"
] | f69724117b979e10eb38e72f7fe38611b5c3f830 | https://github.com/SplashSync/Php-Core/blob/f69724117b979e10eb38e72f7fe38611b5c3f830/Components/NuSOAP/nusoap.php#L2082-L2092 | train |
SplashSync/Php-Core | Components/NuSOAP/nusoap.php | soapval.serialize | public function serialize($use = 'encoded')
{
return $this->serialize_val($this->value, $this->name, $this->type, $this->element_ns, $this->type_ns, $this->attributes, $use, true);
} | php | public function serialize($use = 'encoded')
{
return $this->serialize_val($this->value, $this->name, $this->type, $this->element_ns, $this->type_ns, $this->attributes, $use, true);
} | [
"public",
"function",
"serialize",
"(",
"$",
"use",
"=",
"'encoded'",
")",
"{",
"return",
"$",
"this",
"->",
"serialize_val",
"(",
"$",
"this",
"->",
"value",
",",
"$",
"this",
"->",
"name",
",",
"$",
"this",
"->",
"type",
",",
"$",
"this",
"->",
"... | return serialized value
@param string $use The WSDL use value (encoded|literal)
@return string XML data
@access public | [
"return",
"serialized",
"value"
] | f69724117b979e10eb38e72f7fe38611b5c3f830 | https://github.com/SplashSync/Php-Core/blob/f69724117b979e10eb38e72f7fe38611b5c3f830/Components/NuSOAP/nusoap.php#L2188-L2191 | train |
SplashSync/Php-Core | Components/NuSOAP/nusoap.php | soap_transport_http.setCurlOption | public function setCurlOption($option, $value)
{
$this->debug("setCurlOption option=$option, value=");
$this->appendDebug($this->varDump($value));
curl_setopt($this->ch, $option, $value);
} | php | public function setCurlOption($option, $value)
{
$this->debug("setCurlOption option=$option, value=");
$this->appendDebug($this->varDump($value));
curl_setopt($this->ch, $option, $value);
} | [
"public",
"function",
"setCurlOption",
"(",
"$",
"option",
",",
"$",
"value",
")",
"{",
"$",
"this",
"->",
"debug",
"(",
"\"setCurlOption option=$option, value=\"",
")",
";",
"$",
"this",
"->",
"appendDebug",
"(",
"$",
"this",
"->",
"varDump",
"(",
"$",
"v... | sets a cURL option
@param mixed $option The cURL option (always integer?)
@param mixed $value The cURL option value
@access private | [
"sets",
"a",
"cURL",
"option"
] | f69724117b979e10eb38e72f7fe38611b5c3f830 | https://github.com/SplashSync/Php-Core/blob/f69724117b979e10eb38e72f7fe38611b5c3f830/Components/NuSOAP/nusoap.php#L2281-L2286 | train |
SplashSync/Php-Core | Components/NuSOAP/nusoap.php | soap_transport_http.unsetHeader | public function unsetHeader($name)
{
if (isset($this->outgoing_headers[$name])) {
$this->debug("unset header $name");
unset($this->outgoing_headers[$name]);
}
} | php | public function unsetHeader($name)
{
if (isset($this->outgoing_headers[$name])) {
$this->debug("unset header $name");
unset($this->outgoing_headers[$name]);
}
} | [
"public",
"function",
"unsetHeader",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"outgoing_headers",
"[",
"$",
"name",
"]",
")",
")",
"{",
"$",
"this",
"->",
"debug",
"(",
"\"unset header $name\"",
")",
";",
"unset",
"(",
... | unsets an HTTP header
@param string $name The name of the header
@access private | [
"unsets",
"an",
"HTTP",
"header"
] | f69724117b979e10eb38e72f7fe38611b5c3f830 | https://github.com/SplashSync/Php-Core/blob/f69724117b979e10eb38e72f7fe38611b5c3f830/Components/NuSOAP/nusoap.php#L2307-L2313 | train |
SplashSync/Php-Core | Components/NuSOAP/nusoap.php | wsdl.addComplexType | public function addComplexType($name, $typeClass = 'complexType', $phpType = 'array', $compositor = '', $restrictionBase = '', $elements = array(), $attrs = array(), $arrayType = '')
{
if (count($elements) > 0) {
$eElements = array();
foreach ($elements as $n => $e) {
// expand each element
$ee = array();
foreach ($e as $k => $v) {
$k = strpos($k, ':') ? $this->expandQname($k) : $k;
$v = strpos($v, ':') ? $this->expandQname($v) : $v;
$ee[$k] = $v;
}
$eElements[$n] = $ee;
}
$elements = $eElements;
}
if (count($attrs) > 0) {
foreach ($attrs as $n => $a) {
// expand each attribute
foreach ($a as $k => $v) {
$k = strpos($k, ':') ? $this->expandQname($k) : $k;
$v = strpos($v, ':') ? $this->expandQname($v) : $v;
$aa[$k] = $v;
}
$eAttrs[$n] = $aa;
}
$attrs = $eAttrs;
}
$restrictionBase = strpos($restrictionBase, ':') ? $this->expandQname($restrictionBase) : $restrictionBase;
$arrayType = strpos($arrayType, ':') ? $this->expandQname($arrayType) : $arrayType;
$typens = isset($this->namespaces['types']) ? $this->namespaces['types'] : $this->namespaces['tns'];
$this->schemas[$typens][0]->addComplexType($name, $typeClass, $phpType, $compositor, $restrictionBase, $elements, $attrs, $arrayType);
} | php | public function addComplexType($name, $typeClass = 'complexType', $phpType = 'array', $compositor = '', $restrictionBase = '', $elements = array(), $attrs = array(), $arrayType = '')
{
if (count($elements) > 0) {
$eElements = array();
foreach ($elements as $n => $e) {
// expand each element
$ee = array();
foreach ($e as $k => $v) {
$k = strpos($k, ':') ? $this->expandQname($k) : $k;
$v = strpos($v, ':') ? $this->expandQname($v) : $v;
$ee[$k] = $v;
}
$eElements[$n] = $ee;
}
$elements = $eElements;
}
if (count($attrs) > 0) {
foreach ($attrs as $n => $a) {
// expand each attribute
foreach ($a as $k => $v) {
$k = strpos($k, ':') ? $this->expandQname($k) : $k;
$v = strpos($v, ':') ? $this->expandQname($v) : $v;
$aa[$k] = $v;
}
$eAttrs[$n] = $aa;
}
$attrs = $eAttrs;
}
$restrictionBase = strpos($restrictionBase, ':') ? $this->expandQname($restrictionBase) : $restrictionBase;
$arrayType = strpos($arrayType, ':') ? $this->expandQname($arrayType) : $arrayType;
$typens = isset($this->namespaces['types']) ? $this->namespaces['types'] : $this->namespaces['tns'];
$this->schemas[$typens][0]->addComplexType($name, $typeClass, $phpType, $compositor, $restrictionBase, $elements, $attrs, $arrayType);
} | [
"public",
"function",
"addComplexType",
"(",
"$",
"name",
",",
"$",
"typeClass",
"=",
"'complexType'",
",",
"$",
"phpType",
"=",
"'array'",
",",
"$",
"compositor",
"=",
"''",
",",
"$",
"restrictionBase",
"=",
"''",
",",
"$",
"elements",
"=",
"array",
"("... | adds an XML Schema complex type to the WSDL types
@param string $name
@param string $typeClass (complexType|simpleType|attribute)
@param string $phpType currently supported are array and struct (php assoc array)
@param string $compositor (all|sequence|choice)
@param string $restrictionBase namespace:name (http://schemas.xmlsoap.org/soap/encoding/:Array)
@param array $elements e.g. array ( name => array(name=>'',type=>'') )
@param array $attrs e.g. array(array('ref'=>'SOAP-ENC:arrayType','wsdl:arrayType'=>'xsd:string[]'))
@param string $arrayType as namespace:name (xsd:string)
@see nusoap_xmlschema
@access public | [
"adds",
"an",
"XML",
"Schema",
"complex",
"type",
"to",
"the",
"WSDL",
"types"
] | f69724117b979e10eb38e72f7fe38611b5c3f830 | https://github.com/SplashSync/Php-Core/blob/f69724117b979e10eb38e72f7fe38611b5c3f830/Components/NuSOAP/nusoap.php#L6498-L6533 | train |
SplashSync/Php-Core | Components/NuSOAP/nusoap.php | nusoap_client.checkWSDL | public function checkWSDL()
{
$this->appendDebug($this->wsdl->getDebug());
$this->wsdl->clearDebug();
$this->debug('checkWSDL');
// catch errors
if ($errstr = $this->wsdl->getError()) {
$this->appendDebug($this->wsdl->getDebug());
$this->wsdl->clearDebug();
$this->debug('got wsdl error: ' . $errstr);
$this->setError('wsdl error: ' . $errstr);
} elseif ($this->operations = $this->wsdl->getOperations($this->portName, 'soap')) {
$this->appendDebug($this->wsdl->getDebug());
$this->wsdl->clearDebug();
$this->bindingType = 'soap';
$this->debug('got ' . count($this->operations) . ' operations from wsdl ' . $this->wsdlFile . ' for binding type ' . $this->bindingType);
} elseif ($this->operations = $this->wsdl->getOperations($this->portName, 'soap12')) {
$this->appendDebug($this->wsdl->getDebug());
$this->wsdl->clearDebug();
$this->bindingType = 'soap12';
$this->debug('got ' . count($this->operations) . ' operations from wsdl ' . $this->wsdlFile . ' for binding type ' . $this->bindingType);
$this->debug('**************** WARNING: SOAP 1.2 BINDING *****************');
} else {
$this->appendDebug($this->wsdl->getDebug());
$this->wsdl->clearDebug();
$this->debug('getOperations returned false');
$this->setError('no operations defined in the WSDL document!');
}
} | php | public function checkWSDL()
{
$this->appendDebug($this->wsdl->getDebug());
$this->wsdl->clearDebug();
$this->debug('checkWSDL');
// catch errors
if ($errstr = $this->wsdl->getError()) {
$this->appendDebug($this->wsdl->getDebug());
$this->wsdl->clearDebug();
$this->debug('got wsdl error: ' . $errstr);
$this->setError('wsdl error: ' . $errstr);
} elseif ($this->operations = $this->wsdl->getOperations($this->portName, 'soap')) {
$this->appendDebug($this->wsdl->getDebug());
$this->wsdl->clearDebug();
$this->bindingType = 'soap';
$this->debug('got ' . count($this->operations) . ' operations from wsdl ' . $this->wsdlFile . ' for binding type ' . $this->bindingType);
} elseif ($this->operations = $this->wsdl->getOperations($this->portName, 'soap12')) {
$this->appendDebug($this->wsdl->getDebug());
$this->wsdl->clearDebug();
$this->bindingType = 'soap12';
$this->debug('got ' . count($this->operations) . ' operations from wsdl ' . $this->wsdlFile . ' for binding type ' . $this->bindingType);
$this->debug('**************** WARNING: SOAP 1.2 BINDING *****************');
} else {
$this->appendDebug($this->wsdl->getDebug());
$this->wsdl->clearDebug();
$this->debug('getOperations returned false');
$this->setError('no operations defined in the WSDL document!');
}
} | [
"public",
"function",
"checkWSDL",
"(",
")",
"{",
"$",
"this",
"->",
"appendDebug",
"(",
"$",
"this",
"->",
"wsdl",
"->",
"getDebug",
"(",
")",
")",
";",
"$",
"this",
"->",
"wsdl",
"->",
"clearDebug",
"(",
")",
";",
"$",
"this",
"->",
"debug",
"(",... | check WSDL passed as an instance or pulled from an endpoint
@access private | [
"check",
"WSDL",
"passed",
"as",
"an",
"instance",
"or",
"pulled",
"from",
"an",
"endpoint"
] | f69724117b979e10eb38e72f7fe38611b5c3f830 | https://github.com/SplashSync/Php-Core/blob/f69724117b979e10eb38e72f7fe38611b5c3f830/Components/NuSOAP/nusoap.php#L7643-L7671 | train |
SplashSync/Php-Core | Components/NuSOAP/nusoap.php | nusoap_client.loadWSDL | public function loadWSDL()
{
$this->debug('instantiating wsdl class with doc: ' . $this->wsdlFile);
$this->wsdl = new wsdl('', $this->proxyhost, $this->proxyport, $this->proxyusername, $this->proxypassword, $this->timeout, $this->response_timeout, $this->curl_options, $this->use_curl);
$this->wsdl->setCredentials($this->username, $this->password, $this->authtype, $this->certRequest);
$this->wsdl->fetchWSDL($this->wsdlFile);
$this->checkWSDL();
} | php | public function loadWSDL()
{
$this->debug('instantiating wsdl class with doc: ' . $this->wsdlFile);
$this->wsdl = new wsdl('', $this->proxyhost, $this->proxyport, $this->proxyusername, $this->proxypassword, $this->timeout, $this->response_timeout, $this->curl_options, $this->use_curl);
$this->wsdl->setCredentials($this->username, $this->password, $this->authtype, $this->certRequest);
$this->wsdl->fetchWSDL($this->wsdlFile);
$this->checkWSDL();
} | [
"public",
"function",
"loadWSDL",
"(",
")",
"{",
"$",
"this",
"->",
"debug",
"(",
"'instantiating wsdl class with doc: '",
".",
"$",
"this",
"->",
"wsdlFile",
")",
";",
"$",
"this",
"->",
"wsdl",
"=",
"new",
"wsdl",
"(",
"''",
",",
"$",
"this",
"->",
"... | instantiate wsdl object and parse wsdl file
@access public | [
"instantiate",
"wsdl",
"object",
"and",
"parse",
"wsdl",
"file"
] | f69724117b979e10eb38e72f7fe38611b5c3f830 | https://github.com/SplashSync/Php-Core/blob/f69724117b979e10eb38e72f7fe38611b5c3f830/Components/NuSOAP/nusoap.php#L7678-L7685 | train |
SplashSync/Php-Core | Components/NuSOAP/nusoap.php | nusoap_client.checkCookies | public function checkCookies()
{
if (sizeof($this->cookies) == 0) {
return true;
}
$this->debug('checkCookie: check ' . sizeof($this->cookies) . ' cookies');
$curr_cookies = $this->cookies;
$this->cookies = array();
foreach ($curr_cookies as $cookie) {
if (!is_array($cookie)) {
$this->debug('Remove cookie that is not an array');
continue;
}
if ((isset($cookie['expires'])) && (!empty($cookie['expires']))) {
if (strtotime($cookie['expires']) > time()) {
$this->cookies[] = $cookie;
} else {
$this->debug('Remove expired cookie ' . $cookie['name']);
}
} else {
$this->cookies[] = $cookie;
}
}
$this->debug('checkCookie: ' . sizeof($this->cookies) . ' cookies left in array');
return true;
} | php | public function checkCookies()
{
if (sizeof($this->cookies) == 0) {
return true;
}
$this->debug('checkCookie: check ' . sizeof($this->cookies) . ' cookies');
$curr_cookies = $this->cookies;
$this->cookies = array();
foreach ($curr_cookies as $cookie) {
if (!is_array($cookie)) {
$this->debug('Remove cookie that is not an array');
continue;
}
if ((isset($cookie['expires'])) && (!empty($cookie['expires']))) {
if (strtotime($cookie['expires']) > time()) {
$this->cookies[] = $cookie;
} else {
$this->debug('Remove expired cookie ' . $cookie['name']);
}
} else {
$this->cookies[] = $cookie;
}
}
$this->debug('checkCookie: ' . sizeof($this->cookies) . ' cookies left in array');
return true;
} | [
"public",
"function",
"checkCookies",
"(",
")",
"{",
"if",
"(",
"sizeof",
"(",
"$",
"this",
"->",
"cookies",
")",
"==",
"0",
")",
"{",
"return",
"true",
";",
"}",
"$",
"this",
"->",
"debug",
"(",
"'checkCookie: check '",
".",
"sizeof",
"(",
"$",
"thi... | checks all Cookies and delete those which are expired
@return boolean always return true
@access private | [
"checks",
"all",
"Cookies",
"and",
"delete",
"those",
"which",
"are",
"expired"
] | f69724117b979e10eb38e72f7fe38611b5c3f830 | https://github.com/SplashSync/Php-Core/blob/f69724117b979e10eb38e72f7fe38611b5c3f830/Components/NuSOAP/nusoap.php#L8223-L8248 | train |
wangxian/ephp | src/Core/Route.php | Route.addRoute | private function addRoute($method, $uri, $controller, $action)
{
// Prefix route uri, concat it and clear
if (strlen($this->prefixUri) > 0) {
$uri = $this->prefixUri . $uri;
$this->prefixUri = '';
}
// Compatible: has no namespace
if (strrpos($controller, '\\', 1) === false) {
$controller = 'App\\Controllers\\' . $controller;
}
$items = $uri ? explode('/', ltrim($uri, '/')) : [];
$this->routes[] = [
'method' => $method,
'count' => count($items),
'controller' => $controller,
'action' => $action,
'params' => $items,
];
} | php | private function addRoute($method, $uri, $controller, $action)
{
// Prefix route uri, concat it and clear
if (strlen($this->prefixUri) > 0) {
$uri = $this->prefixUri . $uri;
$this->prefixUri = '';
}
// Compatible: has no namespace
if (strrpos($controller, '\\', 1) === false) {
$controller = 'App\\Controllers\\' . $controller;
}
$items = $uri ? explode('/', ltrim($uri, '/')) : [];
$this->routes[] = [
'method' => $method,
'count' => count($items),
'controller' => $controller,
'action' => $action,
'params' => $items,
];
} | [
"private",
"function",
"addRoute",
"(",
"$",
"method",
",",
"$",
"uri",
",",
"$",
"controller",
",",
"$",
"action",
")",
"{",
"// Prefix route uri, concat it and clear",
"if",
"(",
"strlen",
"(",
"$",
"this",
"->",
"prefixUri",
")",
">",
"0",
")",
"{",
"... | Base function, register routes
@param string $method
@param string $uri
@param string $controller
@param string $action
@return null | [
"Base",
"function",
"register",
"routes"
] | 697248ab098d8dc352de31ab0c64ea0fee1d7132 | https://github.com/wangxian/ephp/blob/697248ab098d8dc352de31ab0c64ea0fee1d7132/src/Core/Route.php#L54-L76 | train |
wangxian/ephp | src/Core/Route.php | Route.findWebSocketRoute | public function findWebSocketRoute()
{
$pathinfo = !empty($_SERVER['PATH_INFO']) && $_SERVER['PATH_INFO'] != '/' ? $_SERVER['PATH_INFO'] : '/index';
foreach ($this->routes as $value) {
if ($value['method'] == 'WEBSOCKET') {
$route_uri = '/' . implode('/', $value['params']);
if ($pathinfo === $route_uri) {
return $value['controller'];
}
}
}
return '';
} | php | public function findWebSocketRoute()
{
$pathinfo = !empty($_SERVER['PATH_INFO']) && $_SERVER['PATH_INFO'] != '/' ? $_SERVER['PATH_INFO'] : '/index';
foreach ($this->routes as $value) {
if ($value['method'] == 'WEBSOCKET') {
$route_uri = '/' . implode('/', $value['params']);
if ($pathinfo === $route_uri) {
return $value['controller'];
}
}
}
return '';
} | [
"public",
"function",
"findWebSocketRoute",
"(",
")",
"{",
"$",
"pathinfo",
"=",
"!",
"empty",
"(",
"$",
"_SERVER",
"[",
"'PATH_INFO'",
"]",
")",
"&&",
"$",
"_SERVER",
"[",
"'PATH_INFO'",
"]",
"!=",
"'/'",
"?",
"$",
"_SERVER",
"[",
"'PATH_INFO'",
"]",
... | Find One websocket by controller handler name
@return string $controller_class | [
"Find",
"One",
"websocket",
"by",
"controller",
"handler",
"name"
] | 697248ab098d8dc352de31ab0c64ea0fee1d7132 | https://github.com/wangxian/ephp/blob/697248ab098d8dc352de31ab0c64ea0fee1d7132/src/Core/Route.php#L161-L176 | train |
wangxian/ephp | src/Core/Route.php | Route.head | public function head(string $uri, string $controller, string $action)
{
$this->addRoute('HEAD', $uri, $controller, $action);
} | php | public function head(string $uri, string $controller, string $action)
{
$this->addRoute('HEAD', $uri, $controller, $action);
} | [
"public",
"function",
"head",
"(",
"string",
"$",
"uri",
",",
"string",
"$",
"controller",
",",
"string",
"$",
"action",
")",
"{",
"$",
"this",
"->",
"addRoute",
"(",
"'HEAD'",
",",
"$",
"uri",
",",
"$",
"controller",
",",
"$",
"action",
")",
";",
... | Register a new HEAD route with the router.
@param string $uri
@param string $controller
@param string $action
@return null | [
"Register",
"a",
"new",
"HEAD",
"route",
"with",
"the",
"router",
"."
] | 697248ab098d8dc352de31ab0c64ea0fee1d7132 | https://github.com/wangxian/ephp/blob/697248ab098d8dc352de31ab0c64ea0fee1d7132/src/Core/Route.php#L238-L241 | train |
wangxian/ephp | src/Core/Route.php | Route.websocket | public function websocket(string $uri, string $controller)
{
$this->addRoute('WEBSOCKET', $uri, $controller, null);
} | php | public function websocket(string $uri, string $controller)
{
$this->addRoute('WEBSOCKET', $uri, $controller, null);
} | [
"public",
"function",
"websocket",
"(",
"string",
"$",
"uri",
",",
"string",
"$",
"controller",
")",
"{",
"$",
"this",
"->",
"addRoute",
"(",
"'WEBSOCKET'",
",",
"$",
"uri",
",",
"$",
"controller",
",",
"null",
")",
";",
"}"
] | Register a new `WebSocket` route with the router.
@param string $uri
@param string $controller
@param string $action
@return null | [
"Register",
"a",
"new",
"WebSocket",
"route",
"with",
"the",
"router",
"."
] | 697248ab098d8dc352de31ab0c64ea0fee1d7132 | https://github.com/wangxian/ephp/blob/697248ab098d8dc352de31ab0c64ea0fee1d7132/src/Core/Route.php#L277-L280 | train |
wangxian/ephp | src/Core/Route.php | Route.all | public function all(string $uri, string $controller, string $action)
{
$this->addRoute('ALL', $uri, $controller, $action);
} | php | public function all(string $uri, string $controller, string $action)
{
$this->addRoute('ALL', $uri, $controller, $action);
} | [
"public",
"function",
"all",
"(",
"string",
"$",
"uri",
",",
"string",
"$",
"controller",
",",
"string",
"$",
"action",
")",
"{",
"$",
"this",
"->",
"addRoute",
"(",
"'ALL'",
",",
"$",
"uri",
",",
"$",
"controller",
",",
"$",
"action",
")",
";",
"}... | Register a new router with any http METHOD
@param string $uri
@param string $controller
@param string $action
@return null | [
"Register",
"a",
"new",
"router",
"with",
"any",
"http",
"METHOD"
] | 697248ab098d8dc352de31ab0c64ea0fee1d7132 | https://github.com/wangxian/ephp/blob/697248ab098d8dc352de31ab0c64ea0fee1d7132/src/Core/Route.php#L290-L293 | train |
soosyze/framework | src/Components/Email/Email.php | Email.from | public function from($email, $name = '')
{
$value = $this->parseMail($this->filtreEmail($email), $this->filtreName($name));
return $this->withHeader('from', $value);
} | php | public function from($email, $name = '')
{
$value = $this->parseMail($this->filtreEmail($email), $this->filtreName($name));
return $this->withHeader('from', $value);
} | [
"public",
"function",
"from",
"(",
"$",
"email",
",",
"$",
"name",
"=",
"''",
")",
"{",
"$",
"value",
"=",
"$",
"this",
"->",
"parseMail",
"(",
"$",
"this",
"->",
"filtreEmail",
"(",
"$",
"email",
")",
",",
"$",
"this",
"->",
"filtreName",
"(",
"... | Ajoute une adresse de provenance.
@param string $email Email de provenance.
@param string $name Nom du destinataire.
@return $this | [
"Ajoute",
"une",
"adresse",
"de",
"provenance",
"."
] | d8dec2155bf9bc1d8ded176b4b65c183e2082049 | https://github.com/soosyze/framework/blob/d8dec2155bf9bc1d8ded176b4b65c183e2082049/src/Components/Email/Email.php#L100-L105 | train |
soosyze/framework | src/Components/Email/Email.php | Email.send | public function send()
{
$to = $this->getHeaderLine('to');
$subject = $this->subject;
$message = $this->message;
return mail($to, $subject, $message, $this->parseHeaders());
} | php | public function send()
{
$to = $this->getHeaderLine('to');
$subject = $this->subject;
$message = $this->message;
return mail($to, $subject, $message, $this->parseHeaders());
} | [
"public",
"function",
"send",
"(",
")",
"{",
"$",
"to",
"=",
"$",
"this",
"->",
"getHeaderLine",
"(",
"'to'",
")",
";",
"$",
"subject",
"=",
"$",
"this",
"->",
"subject",
";",
"$",
"message",
"=",
"$",
"this",
"->",
"message",
";",
"return",
"mail"... | Envoie l'email.
@return bool Si l'email est bien envoyé. | [
"Envoie",
"l",
"email",
"."
] | d8dec2155bf9bc1d8ded176b4b65c183e2082049 | https://github.com/soosyze/framework/blob/d8dec2155bf9bc1d8ded176b4b65c183e2082049/src/Components/Email/Email.php#L171-L178 | train |
payneteasy/php-library-payneteasy-api | source/PaynetEasy/PaynetEasyApi/Callback/AbstractCallback.php | AbstractCallback.updatePaymentTransaction | protected function updatePaymentTransaction(PaymentTransaction $paymentTransaction, CallbackResponse $callbackResponse)
{
$paymentTransaction->setStatus($callbackResponse->getStatus());
$paymentTransaction->getPayment()->setPaynetId($callbackResponse->getPaymentPaynetId());
if ($callbackResponse->isError() || $callbackResponse->isDeclined())
{
$paymentTransaction->addError($callbackResponse->getError());
}
} | php | protected function updatePaymentTransaction(PaymentTransaction $paymentTransaction, CallbackResponse $callbackResponse)
{
$paymentTransaction->setStatus($callbackResponse->getStatus());
$paymentTransaction->getPayment()->setPaynetId($callbackResponse->getPaymentPaynetId());
if ($callbackResponse->isError() || $callbackResponse->isDeclined())
{
$paymentTransaction->addError($callbackResponse->getError());
}
} | [
"protected",
"function",
"updatePaymentTransaction",
"(",
"PaymentTransaction",
"$",
"paymentTransaction",
",",
"CallbackResponse",
"$",
"callbackResponse",
")",
"{",
"$",
"paymentTransaction",
"->",
"setStatus",
"(",
"$",
"callbackResponse",
"->",
"getStatus",
"(",
")"... | Updates Payment transaction by Callback data
@param PaymentTransaction $paymentTransaction Payment transaction for updating
@param CallbackResponse $response Callback for payment transaction updating | [
"Updates",
"Payment",
"transaction",
"by",
"Callback",
"data"
] | e3484aa37b6594231f59b1f43523603aa704f093 | https://github.com/payneteasy/php-library-payneteasy-api/blob/e3484aa37b6594231f59b1f43523603aa704f093/source/PaynetEasy/PaynetEasyApi/Callback/AbstractCallback.php#L191-L200 | train |
payneteasy/php-library-payneteasy-api | source/PaynetEasy/PaynetEasyApi/Callback/AbstractCallback.php | AbstractCallback.validateSignature | protected function validateSignature(PaymentTransaction $paymentTransaction, CallbackResponse $callbackResponse)
{
// This is SHA-1 checksum of the concatenation
// status + orderid + client_orderid + merchant-control.
$expectedControlCode = sha1
(
$callbackResponse->getStatus() .
$callbackResponse->getPaymentPaynetId() .
$callbackResponse->getPaymentClientId() .
$paymentTransaction->getQueryConfig()->getSigningKey()
);
if($expectedControlCode !== $callbackResponse->getControlCode())
{
throw new ValidationException("Actual control code '{$callbackResponse->getControlCode()}' does " .
"not equal expected '{$expectedControlCode}'");
}
} | php | protected function validateSignature(PaymentTransaction $paymentTransaction, CallbackResponse $callbackResponse)
{
// This is SHA-1 checksum of the concatenation
// status + orderid + client_orderid + merchant-control.
$expectedControlCode = sha1
(
$callbackResponse->getStatus() .
$callbackResponse->getPaymentPaynetId() .
$callbackResponse->getPaymentClientId() .
$paymentTransaction->getQueryConfig()->getSigningKey()
);
if($expectedControlCode !== $callbackResponse->getControlCode())
{
throw new ValidationException("Actual control code '{$callbackResponse->getControlCode()}' does " .
"not equal expected '{$expectedControlCode}'");
}
} | [
"protected",
"function",
"validateSignature",
"(",
"PaymentTransaction",
"$",
"paymentTransaction",
",",
"CallbackResponse",
"$",
"callbackResponse",
")",
"{",
"// This is SHA-1 checksum of the concatenation",
"// status + orderid + client_orderid + merchant-control.",
"$",
"expected... | Validate callback response control code
@param PaymentTransaction $paymentTransaction Payment transaction for control code checking
@param CallbackResponse $callbackResponse Callback for control code checking
@throws ValidationException Invalid control code | [
"Validate",
"callback",
"response",
"control",
"code"
] | e3484aa37b6594231f59b1f43523603aa704f093 | https://github.com/payneteasy/php-library-payneteasy-api/blob/e3484aa37b6594231f59b1f43523603aa704f093/source/PaynetEasy/PaynetEasyApi/Callback/AbstractCallback.php#L210-L227 | train |
SplashSync/Php-Core | Models/AbstractWidget.php | AbstractWidget.fieldsFactory | public static function fieldsFactory()
{
//====================================================================//
// Initialize Field Factory Class
if (isset(self::$fields)) {
return self::$fields;
}
//====================================================================//
// Initialize Class
self::$fields = new FieldsFactory();
//====================================================================//
// Load Translation File
Splash::translator()->load("objects");
return self::$fields;
} | php | public static function fieldsFactory()
{
//====================================================================//
// Initialize Field Factory Class
if (isset(self::$fields)) {
return self::$fields;
}
//====================================================================//
// Initialize Class
self::$fields = new FieldsFactory();
//====================================================================//
// Load Translation File
Splash::translator()->load("objects");
return self::$fields;
} | [
"public",
"static",
"function",
"fieldsFactory",
"(",
")",
"{",
"//====================================================================//",
"// Initialize Field Factory Class",
"if",
"(",
"isset",
"(",
"self",
"::",
"$",
"fields",
")",
")",
"{",
"return",
"self",
"::",
... | Get a singleton FieldsFactory Class
Acces to Object Fields Creation Functions
@return FieldsFactory | [
"Get",
"a",
"singleton",
"FieldsFactory",
"Class",
"Acces",
"to",
"Object",
"Fields",
"Creation",
"Functions"
] | f69724117b979e10eb38e72f7fe38611b5c3f830 | https://github.com/SplashSync/Php-Core/blob/f69724117b979e10eb38e72f7fe38611b5c3f830/Models/AbstractWidget.php#L115-L132 | train |
SplashSync/Php-Core | Models/AbstractWidget.php | AbstractWidget.blocksFactory | public static function blocksFactory()
{
//====================================================================//
// Initialize Field Factory Class
if (isset(self::$blocks)) {
return self::$blocks;
}
//====================================================================//
// Initialize Class
self::$blocks = new BlocksFactory();
return self::$blocks;
} | php | public static function blocksFactory()
{
//====================================================================//
// Initialize Field Factory Class
if (isset(self::$blocks)) {
return self::$blocks;
}
//====================================================================//
// Initialize Class
self::$blocks = new BlocksFactory();
return self::$blocks;
} | [
"public",
"static",
"function",
"blocksFactory",
"(",
")",
"{",
"//====================================================================//",
"// Initialize Field Factory Class",
"if",
"(",
"isset",
"(",
"self",
"::",
"$",
"blocks",
")",
")",
"{",
"return",
"self",
"::",
... | Get a singleton BlocksFactory Class
Acces to Widgets Contents Blocks Functions
@return BlocksFactory | [
"Get",
"a",
"singleton",
"BlocksFactory",
"Class",
"Acces",
"to",
"Widgets",
"Contents",
"Blocks",
"Functions"
] | f69724117b979e10eb38e72f7fe38611b5c3f830 | https://github.com/SplashSync/Php-Core/blob/f69724117b979e10eb38e72f7fe38611b5c3f830/Models/AbstractWidget.php#L140-L153 | train |
SplashSync/Php-Core | Models/AbstractWidget.php | AbstractWidget.description | public function description()
{
//====================================================================//
// Stack Trace
Splash::log()->trace();
//====================================================================//
// Build & Return Widget Description Array
return array(
//====================================================================//
// General Object definition
"type" => $this->getType(), // Widget Type Name
"name" => $this->getName(), // Widget Display Neme
"description" => $this->getDesc(), // Widget Descritioon
"icon" => $this->getIcon(), // Widget Icon
"disabled" => $this->getIsDisabled(), // Is This Widget Enabled or Not?
//====================================================================//
// Widget Default Options
"options" => $this->getOptions(), // Widget Default Options Array
//====================================================================//
// Widget Parameters
"parameters" => $this->getParameters(), // Widget Default Options Array
);
} | php | public function description()
{
//====================================================================//
// Stack Trace
Splash::log()->trace();
//====================================================================//
// Build & Return Widget Description Array
return array(
//====================================================================//
// General Object definition
"type" => $this->getType(), // Widget Type Name
"name" => $this->getName(), // Widget Display Neme
"description" => $this->getDesc(), // Widget Descritioon
"icon" => $this->getIcon(), // Widget Icon
"disabled" => $this->getIsDisabled(), // Is This Widget Enabled or Not?
//====================================================================//
// Widget Default Options
"options" => $this->getOptions(), // Widget Default Options Array
//====================================================================//
// Widget Parameters
"parameters" => $this->getParameters(), // Widget Default Options Array
);
} | [
"public",
"function",
"description",
"(",
")",
"{",
"//====================================================================//",
"// Stack Trace",
"Splash",
"::",
"log",
"(",
")",
"->",
"trace",
"(",
")",
";",
"//====================================================================... | Get Definition Array for requested Widget Type
@return array | [
"Get",
"Definition",
"Array",
"for",
"requested",
"Widget",
"Type"
] | f69724117b979e10eb38e72f7fe38611b5c3f830 | https://github.com/SplashSync/Php-Core/blob/f69724117b979e10eb38e72f7fe38611b5c3f830/Models/AbstractWidget.php#L369-L392 | train |
mikemirten/JsonApi | src/Mapper/Definition/DefinitionConfiguration.php | DefinitionConfiguration.defineAttributes | protected function defineAttributes(NodeBuilder $builder)
{
$builder->arrayNode('attributes')
->useAttributeAsKey('')
->prototype('array')
->children()
->scalarNode('type')
->cannotBeEmpty()
->end()
->scalarNode('getter')
->cannotBeEmpty()
->end()
->scalarNode('setter')
->cannotBeEmpty()
->end()
->booleanNode('processNull')
->defaultFalse()
->end();
} | php | protected function defineAttributes(NodeBuilder $builder)
{
$builder->arrayNode('attributes')
->useAttributeAsKey('')
->prototype('array')
->children()
->scalarNode('type')
->cannotBeEmpty()
->end()
->scalarNode('getter')
->cannotBeEmpty()
->end()
->scalarNode('setter')
->cannotBeEmpty()
->end()
->booleanNode('processNull')
->defaultFalse()
->end();
} | [
"protected",
"function",
"defineAttributes",
"(",
"NodeBuilder",
"$",
"builder",
")",
"{",
"$",
"builder",
"->",
"arrayNode",
"(",
"'attributes'",
")",
"->",
"useAttributeAsKey",
"(",
"''",
")",
"->",
"prototype",
"(",
"'array'",
")",
"->",
"children",
"(",
... | Define "attributes" section of configuration
@param NodeBuilder $builder | [
"Define",
"attributes",
"section",
"of",
"configuration"
] | a3c1baf8f753c040f24e4522495b7d34565e6560 | https://github.com/mikemirten/JsonApi/blob/a3c1baf8f753c040f24e4522495b7d34565e6560/src/Mapper/Definition/DefinitionConfiguration.php#L40-L62 | train |
mikemirten/JsonApi | src/Mapper/Definition/DefinitionConfiguration.php | DefinitionConfiguration.defineRelationships | protected function defineRelationships(NodeBuilder $builder)
{
$relationships = $builder->arrayNode('relationships')
->useAttributeAsKey('')
->prototype('array')
->children()
->enumNode('type')
->values(['one', 'many'])
->cannotBeEmpty()
->defaultValue('one')
->end()
->scalarNode('getter')
->cannotBeEmpty()
->end()
->booleanNode('dataAllowed')
->defaultFalse()
->end()
->integerNode('dataLimit')
->defaultValue(0)
->end();
$this->defineLinks($relationships);
} | php | protected function defineRelationships(NodeBuilder $builder)
{
$relationships = $builder->arrayNode('relationships')
->useAttributeAsKey('')
->prototype('array')
->children()
->enumNode('type')
->values(['one', 'many'])
->cannotBeEmpty()
->defaultValue('one')
->end()
->scalarNode('getter')
->cannotBeEmpty()
->end()
->booleanNode('dataAllowed')
->defaultFalse()
->end()
->integerNode('dataLimit')
->defaultValue(0)
->end();
$this->defineLinks($relationships);
} | [
"protected",
"function",
"defineRelationships",
"(",
"NodeBuilder",
"$",
"builder",
")",
"{",
"$",
"relationships",
"=",
"$",
"builder",
"->",
"arrayNode",
"(",
"'relationships'",
")",
"->",
"useAttributeAsKey",
"(",
"''",
")",
"->",
"prototype",
"(",
"'array'",... | Define "relationships" section of configuration
@param NodeBuilder $builder | [
"Define",
"relationships",
"section",
"of",
"configuration"
] | a3c1baf8f753c040f24e4522495b7d34565e6560 | https://github.com/mikemirten/JsonApi/blob/a3c1baf8f753c040f24e4522495b7d34565e6560/src/Mapper/Definition/DefinitionConfiguration.php#L69-L95 | train |
mikemirten/JsonApi | src/Mapper/Definition/DefinitionConfiguration.php | DefinitionConfiguration.defineLinks | protected function defineLinks(NodeBuilder $builder)
{
$builder->arrayNode('links')
->useAttributeAsKey('')
->prototype('array')
->children()
->scalarNode('resource')
->isRequired()
->cannotBeEmpty()
->end()
->arrayNode('parameters')
->prototype('scalar')->end()
->end()
->arrayNode('metadata')
->prototype('scalar')->end()
->end();
} | php | protected function defineLinks(NodeBuilder $builder)
{
$builder->arrayNode('links')
->useAttributeAsKey('')
->prototype('array')
->children()
->scalarNode('resource')
->isRequired()
->cannotBeEmpty()
->end()
->arrayNode('parameters')
->prototype('scalar')->end()
->end()
->arrayNode('metadata')
->prototype('scalar')->end()
->end();
} | [
"protected",
"function",
"defineLinks",
"(",
"NodeBuilder",
"$",
"builder",
")",
"{",
"$",
"builder",
"->",
"arrayNode",
"(",
"'links'",
")",
"->",
"useAttributeAsKey",
"(",
"''",
")",
"->",
"prototype",
"(",
"'array'",
")",
"->",
"children",
"(",
")",
"->... | Define "links" section of configuration
@param NodeBuilder $builder | [
"Define",
"links",
"section",
"of",
"configuration"
] | a3c1baf8f753c040f24e4522495b7d34565e6560 | https://github.com/mikemirten/JsonApi/blob/a3c1baf8f753c040f24e4522495b7d34565e6560/src/Mapper/Definition/DefinitionConfiguration.php#L102-L121 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.