id int32 0 241k | repo stringlengths 6 63 | path stringlengths 5 140 | func_name stringlengths 3 151 | original_string stringlengths 84 13k | language stringclasses 1
value | code stringlengths 84 13k | code_tokens list | docstring stringlengths 3 47.2k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 91 247 |
|---|---|---|---|---|---|---|---|---|---|---|---|
230,200 | Webiny/Framework | src/Webiny/Component/Cache/CacheStorage.php | CacheStorage.getDriver | public function getDriver()
{
// if driver status is false, we return the BlackHole driver
if (!$this->getStatus()) {
if (is_null(self::$nullDriver)) {
self::$nullDriver = new Storage\BlackHole();
}
return self::$nullDriver;
}
ret... | php | public function getDriver()
{
// if driver status is false, we return the BlackHole driver
if (!$this->getStatus()) {
if (is_null(self::$nullDriver)) {
self::$nullDriver = new Storage\BlackHole();
}
return self::$nullDriver;
}
ret... | [
"public",
"function",
"getDriver",
"(",
")",
"{",
"// if driver status is false, we return the BlackHole driver",
"if",
"(",
"!",
"$",
"this",
"->",
"getStatus",
"(",
")",
")",
"{",
"if",
"(",
"is_null",
"(",
"self",
"::",
"$",
"nullDriver",
")",
")",
"{",
"... | Get driver instance.
@return CacheStorageInterface | [
"Get",
"driver",
"instance",
"."
] | 2ca7fb238999387e54a1eea8c5cb4735de9022a7 | https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/Cache/CacheStorage.php#L62-L74 |
230,201 | Webiny/Framework | src/Webiny/Component/Cache/CacheStorage.php | CacheStorage.increment | public function increment($key, $byValue = 1, $limitKeysCount = 0, $ttl = 259200)
{
return $this->getDriver()->increment($key, $byValue, $limitKeysCount, $ttl);
} | php | public function increment($key, $byValue = 1, $limitKeysCount = 0, $ttl = 259200)
{
return $this->getDriver()->increment($key, $byValue, $limitKeysCount, $ttl);
} | [
"public",
"function",
"increment",
"(",
"$",
"key",
",",
"$",
"byValue",
"=",
"1",
",",
"$",
"limitKeysCount",
"=",
"0",
",",
"$",
"ttl",
"=",
"259200",
")",
"{",
"return",
"$",
"this",
"->",
"getDriver",
"(",
")",
"->",
"increment",
"(",
"$",
"key... | Increment value of the key.
@param string $key Name of the cache key.
@param mixed $byValue
If stored value is an array:
- If $by_value is a value in array, new element will be pushed to the end of array,
- If $by_value is a key=>value array, new key=>value pair will be added (or updated).
@param int ... | [
"Increment",
"value",
"of",
"the",
"key",
"."
] | 2ca7fb238999387e54a1eea8c5cb4735de9022a7 | https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/Cache/CacheStorage.php#L210-L213 |
230,202 | naneau/semver | src/Naneau/SemVer/Version.php | Version.next | public function next($base = null)
{
// Ensure that $base is a Version. Parse it if we must, use ourself if
// it is empty.
if (empty($base)) {
$base = $this;
}
else {
if (is_string($base)) {
$base = Parser::parse($base);
... | php | public function next($base = null)
{
// Ensure that $base is a Version. Parse it if we must, use ourself if
// it is empty.
if (empty($base)) {
$base = $this;
}
else {
if (is_string($base)) {
$base = Parser::parse($base);
... | [
"public",
"function",
"next",
"(",
"$",
"base",
"=",
"null",
")",
"{",
"// Ensure that $base is a Version. Parse it if we must, use ourself if",
"// it is empty.",
"if",
"(",
"empty",
"(",
"$",
"base",
")",
")",
"{",
"$",
"base",
"=",
"$",
"this",
";",
"}",
... | Get the next logical version relative to the provided base version. If
no base is supplied, base will be the same as the current version.
@param Version|string|null $base
@return Version
@throws InvalidArgumentException | [
"Get",
"the",
"next",
"logical",
"version",
"relative",
"to",
"the",
"provided",
"base",
"version",
".",
"If",
"no",
"base",
"is",
"supplied",
"base",
"will",
"be",
"the",
"same",
"as",
"the",
"current",
"version",
"."
] | c771ad1e6c89064c0a4fa714979639dc3649d6c8 | https://github.com/naneau/semver/blob/c771ad1e6c89064c0a4fa714979639dc3649d6c8/src/Naneau/SemVer/Version.php#L143-L195 |
230,203 | naneau/semver | src/Naneau/SemVer/Version.php | Version.cleanCopy | public function cleanCopy()
{
$version = new Version;
$version->setMajor($this->getMajor());
$version->setMinor($this->getMinor());
$version->setPatch($this->getPatch());
if ($this->hasPreRelease()) {
$version->preRelease = clone($this->getPreRelease());
... | php | public function cleanCopy()
{
$version = new Version;
$version->setMajor($this->getMajor());
$version->setMinor($this->getMinor());
$version->setPatch($this->getPatch());
if ($this->hasPreRelease()) {
$version->preRelease = clone($this->getPreRelease());
... | [
"public",
"function",
"cleanCopy",
"(",
")",
"{",
"$",
"version",
"=",
"new",
"Version",
";",
"$",
"version",
"->",
"setMajor",
"(",
"$",
"this",
"->",
"getMajor",
"(",
")",
")",
";",
"$",
"version",
"->",
"setMinor",
"(",
"$",
"this",
"->",
"getMino... | Create a new Version that discards the entity information of build and
originalVersionString
@return Version | [
"Create",
"a",
"new",
"Version",
"that",
"discards",
"the",
"entity",
"information",
"of",
"build",
"and",
"originalVersionString"
] | c771ad1e6c89064c0a4fa714979639dc3649d6c8 | https://github.com/naneau/semver/blob/c771ad1e6c89064c0a4fa714979639dc3649d6c8/src/Naneau/SemVer/Version.php#L203-L216 |
230,204 | Webiny/Framework | src/Webiny/Component/Cache/Storage/Memcache.php | Memcache.getInstance | public static function getInstance($host = '127.0.0.1', $port = 11211)
{
return \Webiny\Component\Cache\Bridge\Memcache::getInstance($host, $port);
} | php | public static function getInstance($host = '127.0.0.1', $port = 11211)
{
return \Webiny\Component\Cache\Bridge\Memcache::getInstance($host, $port);
} | [
"public",
"static",
"function",
"getInstance",
"(",
"$",
"host",
"=",
"'127.0.0.1'",
",",
"$",
"port",
"=",
"11211",
")",
"{",
"return",
"\\",
"Webiny",
"\\",
"Component",
"\\",
"Cache",
"\\",
"Bridge",
"\\",
"Memcache",
"::",
"getInstance",
"(",
"$",
"h... | Get an instance of Memcache cache storage.
@param string $host Host on which memcached is running.
@param int $port Port on which memcached is running.
@return CacheStorageInterface | [
"Get",
"an",
"instance",
"of",
"Memcache",
"cache",
"storage",
"."
] | 2ca7fb238999387e54a1eea8c5cb4735de9022a7 | https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/Cache/Storage/Memcache.php#L28-L31 |
230,205 | decred/decred-php-api | src/Decred/Crypto/ExtendedKey.php | ExtendedKey.generateSeed | public static function generateSeed(NetworkInterface $network, $length = self::RECOMMENDED_SEED_BYTES)
{
// Per [BIP32], the seed must be in range [16, 64].
if (($length < static::MIN_SEED_BYTES) || ($length > static::MAX_SEED_BYTES)) {
throw new \InvalidArgumentException(
... | php | public static function generateSeed(NetworkInterface $network, $length = self::RECOMMENDED_SEED_BYTES)
{
// Per [BIP32], the seed must be in range [16, 64].
if (($length < static::MIN_SEED_BYTES) || ($length > static::MAX_SEED_BYTES)) {
throw new \InvalidArgumentException(
... | [
"public",
"static",
"function",
"generateSeed",
"(",
"NetworkInterface",
"$",
"network",
",",
"$",
"length",
"=",
"self",
"::",
"RECOMMENDED_SEED_BYTES",
")",
"{",
"// Per [BIP32], the seed must be in range [16, 64].",
"if",
"(",
"(",
"$",
"length",
"<",
"static",
"... | Generate verified usable seed.
@param NetworkInterface $network
@param int $length
@return mixed | [
"Generate",
"verified",
"usable",
"seed",
"."
] | dafea9ceac918c4c3cd9bc7c436009a95dfb1643 | https://github.com/decred/decred-php-api/blob/dafea9ceac918c4c3cd9bc7c436009a95dfb1643/src/Decred/Crypto/ExtendedKey.php#L116-L134 |
230,206 | decred/decred-php-api | src/Decred/Crypto/ExtendedKey.php | ExtendedKey.verifySeed | public static function verifySeed($seed, $network)
{
try {
$master = static::newMaster($seed, $network);
$coinType = $master->deriveCoinTypeKey();
$account0 = $coinType->deriveAccountKey();
$account0->neuter();
$account0->deriveInternalBranch();
... | php | public static function verifySeed($seed, $network)
{
try {
$master = static::newMaster($seed, $network);
$coinType = $master->deriveCoinTypeKey();
$account0 = $coinType->deriveAccountKey();
$account0->neuter();
$account0->deriveInternalBranch();
... | [
"public",
"static",
"function",
"verifySeed",
"(",
"$",
"seed",
",",
"$",
"network",
")",
"{",
"try",
"{",
"$",
"master",
"=",
"static",
"::",
"newMaster",
"(",
"$",
"seed",
",",
"$",
"network",
")",
";",
"$",
"coinType",
"=",
"$",
"master",
"->",
... | Verify that we can derive external branch 0 index address to check if seed is usable.
@param string $seed
@param NetworkInterface $network
@return ExtendedKey|bool Master key or false | [
"Verify",
"that",
"we",
"can",
"derive",
"external",
"branch",
"0",
"index",
"address",
"to",
"check",
"if",
"seed",
"is",
"usable",
"."
] | dafea9ceac918c4c3cd9bc7c436009a95dfb1643 | https://github.com/decred/decred-php-api/blob/dafea9ceac918c4c3cd9bc7c436009a95dfb1643/src/Decred/Crypto/ExtendedKey.php#L144-L161 |
230,207 | decred/decred-php-api | src/Decred/Crypto/ExtendedKey.php | ExtendedKey.fromString | public static function fromString($key)
{
// version (4) || depth (1) || parent fingerprint (4) ||
// child num (4) || chain code (32) || key data (33) || checksum (4)
$payload = DecredNetwork::extendedKeyBase58Decode($key);
$network = NetworkFactory::fromExtendedKeyVersion(subst... | php | public static function fromString($key)
{
// version (4) || depth (1) || parent fingerprint (4) ||
// child num (4) || chain code (32) || key data (33) || checksum (4)
$payload = DecredNetwork::extendedKeyBase58Decode($key);
$network = NetworkFactory::fromExtendedKeyVersion(subst... | [
"public",
"static",
"function",
"fromString",
"(",
"$",
"key",
")",
"{",
"// version (4) || depth (1) || parent fingerprint (4) ||",
"// child num (4) || chain code (32) || key data (33) || checksum (4)",
"$",
"payload",
"=",
"DecredNetwork",
"::",
"extendedKeyBase58Decode",
"(... | Decode from base58 encoded string.
@param string $key
@return ExtendedKey | [
"Decode",
"from",
"base58",
"encoded",
"string",
"."
] | dafea9ceac918c4c3cd9bc7c436009a95dfb1643 | https://github.com/decred/decred-php-api/blob/dafea9ceac918c4c3cd9bc7c436009a95dfb1643/src/Decred/Crypto/ExtendedKey.php#L196-L210 |
230,208 | decred/decred-php-api | src/Decred/Crypto/ExtendedKey.php | ExtendedKey.neuter | public function neuter()
{
if ($this->isPrivate()) {
return new ExtendedKey(
$this->publicKey(),
$this->chainCode,
$this->depth,
$this->parentFP,
$this->childNum,
$this->network
);
... | php | public function neuter()
{
if ($this->isPrivate()) {
return new ExtendedKey(
$this->publicKey(),
$this->chainCode,
$this->depth,
$this->parentFP,
$this->childNum,
$this->network
);
... | [
"public",
"function",
"neuter",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isPrivate",
"(",
")",
")",
"{",
"return",
"new",
"ExtendedKey",
"(",
"$",
"this",
"->",
"publicKey",
"(",
")",
",",
"$",
"this",
"->",
"chainCode",
",",
"$",
"this",
"->"... | Get public extended key from private or verify it is public key..
@return ExtendedKey | [
"Get",
"public",
"extended",
"key",
"from",
"private",
"or",
"verify",
"it",
"is",
"public",
"key",
".."
] | dafea9ceac918c4c3cd9bc7c436009a95dfb1643 | https://github.com/decred/decred-php-api/blob/dafea9ceac918c4c3cd9bc7c436009a95dfb1643/src/Decred/Crypto/ExtendedKey.php#L432-L446 |
230,209 | decred/decred-php-api | src/Decred/Crypto/ExtendedKey.php | ExtendedKey.deriveCoinTypeKey | public function deriveCoinTypeKey($coinType = self::DECRED_COIN_TYPE)
{
if ($coinType > self::MAX_COIN_TYPE) {
throw new \InvalidArgumentException('Invalid coin type.');
}
return $this->hardenedChildKey(static::BIP44_PURPOSE)->hardenedChildKey($coinType);
} | php | public function deriveCoinTypeKey($coinType = self::DECRED_COIN_TYPE)
{
if ($coinType > self::MAX_COIN_TYPE) {
throw new \InvalidArgumentException('Invalid coin type.');
}
return $this->hardenedChildKey(static::BIP44_PURPOSE)->hardenedChildKey($coinType);
} | [
"public",
"function",
"deriveCoinTypeKey",
"(",
"$",
"coinType",
"=",
"self",
"::",
"DECRED_COIN_TYPE",
")",
"{",
"if",
"(",
"$",
"coinType",
">",
"self",
"::",
"MAX_COIN_TYPE",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"'Invalid coin type... | Derive BIP44 purpose and coin type.
@param int $coinType
@return ExtendedKey | [
"Derive",
"BIP44",
"purpose",
"and",
"coin",
"type",
"."
] | dafea9ceac918c4c3cd9bc7c436009a95dfb1643 | https://github.com/decred/decred-php-api/blob/dafea9ceac918c4c3cd9bc7c436009a95dfb1643/src/Decred/Crypto/ExtendedKey.php#L478-L485 |
230,210 | milesj/admin | Controller/LogsController.php | LogsController.index | public function index() {
$this->paginate = array_merge(array(
'limit' => 25,
'contain' => array_keys($this->Model->belongsTo)
), $this->Model->admin['paginate']);
$this->set('results', $this->paginate($this->Model));
} | php | public function index() {
$this->paginate = array_merge(array(
'limit' => 25,
'contain' => array_keys($this->Model->belongsTo)
), $this->Model->admin['paginate']);
$this->set('results', $this->paginate($this->Model));
} | [
"public",
"function",
"index",
"(",
")",
"{",
"$",
"this",
"->",
"paginate",
"=",
"array_merge",
"(",
"array",
"(",
"'limit'",
"=>",
"25",
",",
"'contain'",
"=>",
"array_keys",
"(",
"$",
"this",
"->",
"Model",
"->",
"belongsTo",
")",
")",
",",
"$",
"... | Paginate the logs. | [
"Paginate",
"the",
"logs",
"."
] | e5e93823d1eb4415f05a3191f653eb50c296d2c6 | https://github.com/milesj/admin/blob/e5e93823d1eb4415f05a3191f653eb50c296d2c6/Controller/LogsController.php#L13-L20 |
230,211 | milesj/admin | Controller/LogsController.php | LogsController.read | public function read($type = 'debug') {
$path = TMP . 'logs/' . $type . '.log';
$logs = array();
$exceptions = array();
$message = null;
if (!in_array($type, CakeLog::configured())) {
throw new NotFoundException(__d('admin', '%s Log Not Found', Inflector::humanize($t... | php | public function read($type = 'debug') {
$path = TMP . 'logs/' . $type . '.log';
$logs = array();
$exceptions = array();
$message = null;
if (!in_array($type, CakeLog::configured())) {
throw new NotFoundException(__d('admin', '%s Log Not Found', Inflector::humanize($t... | [
"public",
"function",
"read",
"(",
"$",
"type",
"=",
"'debug'",
")",
"{",
"$",
"path",
"=",
"TMP",
".",
"'logs/'",
".",
"$",
"type",
".",
"'.log'",
";",
"$",
"logs",
"=",
"array",
"(",
")",
";",
"$",
"exceptions",
"=",
"array",
"(",
")",
";",
"... | Parse and read syslogs.
@param string $type
@throws NotFoundException
@throws BadRequestException | [
"Parse",
"and",
"read",
"syslogs",
"."
] | e5e93823d1eb4415f05a3191f653eb50c296d2c6 | https://github.com/milesj/admin/blob/e5e93823d1eb4415f05a3191f653eb50c296d2c6/Controller/LogsController.php#L29-L97 |
230,212 | PHP-DI/Kernel | src/Kernel.php | Kernel.createContainer | public function createContainer() : Container
{
$containerBuilder = new ContainerBuilder();
foreach ($this->modules as $module) {
$this->loadModule($containerBuilder, $module);
}
if (!empty($this->config)) {
$containerBuilder->addDefinitions($this->config);
... | php | public function createContainer() : Container
{
$containerBuilder = new ContainerBuilder();
foreach ($this->modules as $module) {
$this->loadModule($containerBuilder, $module);
}
if (!empty($this->config)) {
$containerBuilder->addDefinitions($this->config);
... | [
"public",
"function",
"createContainer",
"(",
")",
":",
"Container",
"{",
"$",
"containerBuilder",
"=",
"new",
"ContainerBuilder",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"modules",
"as",
"$",
"module",
")",
"{",
"$",
"this",
"->",
"loadModule",
... | Configure and create a container using all configuration files found in included modules. | [
"Configure",
"and",
"create",
"a",
"container",
"using",
"all",
"configuration",
"files",
"found",
"in",
"included",
"modules",
"."
] | 1ba55842874608cd73cdeee874a0826530195ee8 | https://github.com/PHP-DI/Kernel/blob/1ba55842874608cd73cdeee874a0826530195ee8/src/Kernel.php#L62-L77 |
230,213 | ipalaus/buffer-php-sdk | src/Ipalaus/Buffer/Button.php | Button.create | public static function create($style, $tweet = null, $url = null, $username = null, $picture = null)
{
if ( ! in_array($style, static::$styles)) {
throw new InvalidArgumentException("Button style [{$style}] not supported.");
}
$anchor = '<a href="http://bufferapp.com/add" class=... | php | public static function create($style, $tweet = null, $url = null, $username = null, $picture = null)
{
if ( ! in_array($style, static::$styles)) {
throw new InvalidArgumentException("Button style [{$style}] not supported.");
}
$anchor = '<a href="http://bufferapp.com/add" class=... | [
"public",
"static",
"function",
"create",
"(",
"$",
"style",
",",
"$",
"tweet",
"=",
"null",
",",
"$",
"url",
"=",
"null",
",",
"$",
"username",
"=",
"null",
",",
"$",
"picture",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"in_array",
"(",
"$",
"style... | Generates a Buffer Button to let people share your content on Twitter and
Facebook seamlessly. They can share right away or at a better time using
Buffer.
@param string $style
@param string $tweet
@param string $url
@param string $username
@param string $picture
@return string | [
"Generates",
"a",
"Buffer",
"Button",
"to",
"let",
"people",
"share",
"your",
"content",
"on",
"Twitter",
"and",
"Facebook",
"seamlessly",
".",
"They",
"can",
"share",
"right",
"away",
"or",
"at",
"a",
"better",
"time",
"using",
"Buffer",
"."
] | f9314df3510f1dcdd6b3d5f618ce845c5f56bd5f | https://github.com/ipalaus/buffer-php-sdk/blob/f9314df3510f1dcdd6b3d5f618ce845c5f56bd5f/src/Ipalaus/Buffer/Button.php#L29-L58 |
230,214 | Webiny/Framework | src/Webiny/Component/Security/Token/Storage/Stateless.php | Stateless.getTokenString | public function getTokenString()
{
if (!$this->tokenString) {
$token = $this->httpRequest()->header('Authorization');
if (!$token) {
$token = $this->httpRequest()->post('Authorization');
}
return $token;
}
return $this->tokenS... | php | public function getTokenString()
{
if (!$this->tokenString) {
$token = $this->httpRequest()->header('Authorization');
if (!$token) {
$token = $this->httpRequest()->post('Authorization');
}
return $token;
}
return $this->tokenS... | [
"public",
"function",
"getTokenString",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"tokenString",
")",
"{",
"$",
"token",
"=",
"$",
"this",
"->",
"httpRequest",
"(",
")",
"->",
"header",
"(",
"'Authorization'",
")",
";",
"if",
"(",
"!",
"$",
... | Get token string representation
@return string | [
"Get",
"token",
"string",
"representation"
] | 2ca7fb238999387e54a1eea8c5cb4735de9022a7 | https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/Security/Token/Storage/Stateless.php#L150-L162 |
230,215 | Webiny/Framework | src/Webiny/Component/Security/Token/Storage/Stateless.php | Stateless.getTokenTtl | public function getTokenTtl()
{
$rememberMe = $this->tokenRememberMe;
$ttl = 86400; // 1 day
if ($rememberMe) {
$ttl = is_numeric($rememberMe) ? intval($rememberMe) : 2592000; // 30 days
}
return $ttl;
} | php | public function getTokenTtl()
{
$rememberMe = $this->tokenRememberMe;
$ttl = 86400; // 1 day
if ($rememberMe) {
$ttl = is_numeric($rememberMe) ? intval($rememberMe) : 2592000; // 30 days
}
return $ttl;
} | [
"public",
"function",
"getTokenTtl",
"(",
")",
"{",
"$",
"rememberMe",
"=",
"$",
"this",
"->",
"tokenRememberMe",
";",
"$",
"ttl",
"=",
"86400",
";",
"// 1 day",
"if",
"(",
"$",
"rememberMe",
")",
"{",
"$",
"ttl",
"=",
"is_numeric",
"(",
"$",
"remember... | Get token TTL in seconds
@return int | [
"Get",
"token",
"TTL",
"in",
"seconds"
] | 2ca7fb238999387e54a1eea8c5cb4735de9022a7 | https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/Security/Token/Storage/Stateless.php#L178-L187 |
230,216 | Webiny/Framework | src/Webiny/Component/Mailer/Bridge/Sendgrid/Message.php | Message.addTo | public function addTo(Email $email)
{
$this->to[] = $email;
$this->message->addTo($email->email, $email->name);
return $this;
} | php | public function addTo(Email $email)
{
$this->to[] = $email;
$this->message->addTo($email->email, $email->name);
return $this;
} | [
"public",
"function",
"addTo",
"(",
"Email",
"$",
"email",
")",
"{",
"$",
"this",
"->",
"to",
"[",
"]",
"=",
"$",
"email",
";",
"$",
"this",
"->",
"message",
"->",
"addTo",
"(",
"$",
"email",
"->",
"email",
",",
"$",
"email",
"->",
"name",
")",
... | Appends one more recipient to the list.
@param Email $email
@return $this | [
"Appends",
"one",
"more",
"recipient",
"to",
"the",
"list",
"."
] | 2ca7fb238999387e54a1eea8c5cb4735de9022a7 | https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/Mailer/Bridge/Sendgrid/Message.php#L160-L166 |
230,217 | Webiny/Framework | src/Webiny/Component/Image/ImageLoader.php | ImageLoader.getLoader | private static function getLoader()
{
if (self::isNull(self::$loader)) {
self::$loader = Loader::getImageLoader(Image::getConfig());
}
return self::$loader;
} | php | private static function getLoader()
{
if (self::isNull(self::$loader)) {
self::$loader = Loader::getImageLoader(Image::getConfig());
}
return self::$loader;
} | [
"private",
"static",
"function",
"getLoader",
"(",
")",
"{",
"if",
"(",
"self",
"::",
"isNull",
"(",
"self",
"::",
"$",
"loader",
")",
")",
"{",
"self",
"::",
"$",
"loader",
"=",
"Loader",
"::",
"getImageLoader",
"(",
"Image",
"::",
"getConfig",
"(",
... | Returns an instance of ImageLoaderInterface.
@return null|ImageLoaderInterface | [
"Returns",
"an",
"instance",
"of",
"ImageLoaderInterface",
"."
] | 2ca7fb238999387e54a1eea8c5cb4735de9022a7 | https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/Image/ImageLoader.php#L39-L46 |
230,218 | Webiny/Framework | src/Webiny/Component/Image/ImageLoader.php | ImageLoader.open | public static function open(File $image)
{
$img = self::getLoader()->open($image);
$img->setDestination($image);
// extract the format
$format = self::str($image->getKey())->explode('.')->last()->caseLower()->val();
$img->setFormat($format);
// fix image orientation... | php | public static function open(File $image)
{
$img = self::getLoader()->open($image);
$img->setDestination($image);
// extract the format
$format = self::str($image->getKey())->explode('.')->last()->caseLower()->val();
$img->setFormat($format);
// fix image orientation... | [
"public",
"static",
"function",
"open",
"(",
"File",
"$",
"image",
")",
"{",
"$",
"img",
"=",
"self",
"::",
"getLoader",
"(",
")",
"->",
"open",
"(",
"$",
"image",
")",
";",
"$",
"img",
"->",
"setDestination",
"(",
"$",
"image",
")",
";",
"// extra... | Creates a new ImageInterface instance from the given image at the provided path.
@param File $image Path to an image on the disk.
@return ImageInterface | [
"Creates",
"a",
"new",
"ImageInterface",
"instance",
"from",
"the",
"given",
"image",
"at",
"the",
"provided",
"path",
"."
] | 2ca7fb238999387e54a1eea8c5cb4735de9022a7 | https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/Image/ImageLoader.php#L96-L109 |
230,219 | Webiny/Framework | src/Webiny/Component/Image/ImageLoader.php | ImageLoader.fixImageOrientation | private static function fixImageOrientation(File $imageFile, ImageInterface $image)
{
$format = $image->getFormat();
// exif data is available only on jpeg and tiff
// tiff is ignored, because smartphones don't produce tiff images
if ($format == 'jpg' || $format == 'jpeg') {
... | php | private static function fixImageOrientation(File $imageFile, ImageInterface $image)
{
$format = $image->getFormat();
// exif data is available only on jpeg and tiff
// tiff is ignored, because smartphones don't produce tiff images
if ($format == 'jpg' || $format == 'jpeg') {
... | [
"private",
"static",
"function",
"fixImageOrientation",
"(",
"File",
"$",
"imageFile",
",",
"ImageInterface",
"$",
"image",
")",
"{",
"$",
"format",
"=",
"$",
"image",
"->",
"getFormat",
"(",
")",
";",
"// exif data is available only on jpeg and tiff",
"// tiff is i... | Android and Iphone images are sometimes rotated "incorrectly".
This method fixes that.
Method is called automatically on the `open` method.
@param File $imageFile
@param ImageInterface $image | [
"Android",
"and",
"Iphone",
"images",
"are",
"sometimes",
"rotated",
"incorrectly",
".",
"This",
"method",
"fixes",
"that",
".",
"Method",
"is",
"called",
"automatically",
"on",
"the",
"open",
"method",
"."
] | 2ca7fb238999387e54a1eea8c5cb4735de9022a7 | https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/Image/ImageLoader.php#L119-L148 |
230,220 | themsaid/katana-core | src/FileHandlers/BlogPostHandler.php | BlogPostHandler.getPostData | public function getPostData(SplFileInfo $file)
{
$this->file = $file;
if ($this->file->getExtension() == 'md') {
$postData = Markdown::parseWithYAML($this->file->getContents())[1];
} else {
$view = $this->viewFactory->make(str_replace('.blade.php', '', $this->file->g... | php | public function getPostData(SplFileInfo $file)
{
$this->file = $file;
if ($this->file->getExtension() == 'md') {
$postData = Markdown::parseWithYAML($this->file->getContents())[1];
} else {
$view = $this->viewFactory->make(str_replace('.blade.php', '', $this->file->g... | [
"public",
"function",
"getPostData",
"(",
"SplFileInfo",
"$",
"file",
")",
"{",
"$",
"this",
"->",
"file",
"=",
"$",
"file",
";",
"if",
"(",
"$",
"this",
"->",
"file",
"->",
"getExtension",
"(",
")",
"==",
"'md'",
")",
"{",
"$",
"postData",
"=",
"M... | Get the blog post data.
@param SplFileInfo $file
@return \stdClass | [
"Get",
"the",
"blog",
"post",
"data",
"."
] | 897c1adb6863d5145f1f104cbc8c9200cd98c3fb | https://github.com/themsaid/katana-core/blob/897c1adb6863d5145f1f104cbc8c9200cd98c3fb/src/FileHandlers/BlogPostHandler.php#L17-L48 |
230,221 | themsaid/katana-core | src/FileHandlers/BlogPostHandler.php | BlogPostHandler.getDirectoryPrettyName | protected function getDirectoryPrettyName()
{
$pathName = $this->normalizePath($this->file->getPathname());
// If the post is inside a child directory of the _blog directory then
// we deal with it like regular site files and generate a nested
// directories based post path ... | php | protected function getDirectoryPrettyName()
{
$pathName = $this->normalizePath($this->file->getPathname());
// If the post is inside a child directory of the _blog directory then
// we deal with it like regular site files and generate a nested
// directories based post path ... | [
"protected",
"function",
"getDirectoryPrettyName",
"(",
")",
"{",
"$",
"pathName",
"=",
"$",
"this",
"->",
"normalizePath",
"(",
"$",
"this",
"->",
"file",
"->",
"getPathname",
"(",
")",
")",
";",
"// If the post is inside a child directory of the _blog directory then... | Generate directory path to be used for pretty URLs.
@return string | [
"Generate",
"directory",
"path",
"to",
"be",
"used",
"for",
"pretty",
"URLs",
"."
] | 897c1adb6863d5145f1f104cbc8c9200cd98c3fb | https://github.com/themsaid/katana-core/blob/897c1adb6863d5145f1f104cbc8c9200cd98c3fb/src/FileHandlers/BlogPostHandler.php#L55-L71 |
230,222 | Webiny/Framework | src/Webiny/Component/TemplateEngine/TemplateEngineLoader.php | TemplateEngineLoader.getInstance | static function getInstance($driver)
{
if (isset(self::$instances[$driver])) {
return self::$instances[$driver];
}
$driverConfig = TemplateEngine::getConfig()->get('Engines.' . $driver, false);
if (!$driverConfig) {
throw new TemplateEngineException('Unable ... | php | static function getInstance($driver)
{
if (isset(self::$instances[$driver])) {
return self::$instances[$driver];
}
$driverConfig = TemplateEngine::getConfig()->get('Engines.' . $driver, false);
if (!$driverConfig) {
throw new TemplateEngineException('Unable ... | [
"static",
"function",
"getInstance",
"(",
"$",
"driver",
")",
"{",
"if",
"(",
"isset",
"(",
"self",
"::",
"$",
"instances",
"[",
"$",
"driver",
"]",
")",
")",
"{",
"return",
"self",
"::",
"$",
"instances",
"[",
"$",
"driver",
"]",
";",
"}",
"$",
... | Returns an instance of template engine driver.
If the requested driver is already created, the same instance is returned.
@param string $driver Name of the template engine driver. Must correspond to components.template_engine.engines.{$driver}.
@return \Webiny\Component\TemplateEngine\Bridge\TemplateEngineInterface
@... | [
"Returns",
"an",
"instance",
"of",
"template",
"engine",
"driver",
".",
"If",
"the",
"requested",
"driver",
"is",
"already",
"created",
"the",
"same",
"instance",
"is",
"returned",
"."
] | 2ca7fb238999387e54a1eea8c5cb4735de9022a7 | https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/TemplateEngine/TemplateEngineLoader.php#L35-L54 |
230,223 | Webiny/Framework | src/Webiny/Component/ServiceManager/Argument.php | Argument.value | public function value()
{
/**
* If 'object' key exists - it's either a class or service
**/
if ($this->isArray($this->value) && array_key_exists('Object', $this->value)) {
$this->value = $this->arr($this->value);
$objectArguments = $this->value->key('ObjectA... | php | public function value()
{
/**
* If 'object' key exists - it's either a class or service
**/
if ($this->isArray($this->value) && array_key_exists('Object', $this->value)) {
$this->value = $this->arr($this->value);
$objectArguments = $this->value->key('ObjectA... | [
"public",
"function",
"value",
"(",
")",
"{",
"/**\n * If 'object' key exists - it's either a class or service\n **/",
"if",
"(",
"$",
"this",
"->",
"isArray",
"(",
"$",
"this",
"->",
"value",
")",
"&&",
"array_key_exists",
"(",
"'Object'",
",",
"$",
... | Get real Argument value
@return mixed | [
"Get",
"real",
"Argument",
"value"
] | 2ca7fb238999387e54a1eea8c5cb4735de9022a7 | https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/ServiceManager/Argument.php#L43-L57 |
230,224 | Webiny/Framework | src/Webiny/Component/ServiceManager/Argument.php | Argument.createValue | private function createValue($object, $arguments = [])
{
if ($this->isInstanceOf($arguments, ConfigObject::class)) {
$arguments = $arguments->toArray();
}
if (!$this->isArray($arguments)) {
throw new ServiceManagerException(ServiceManagerException::INVALID_SERVICE_A... | php | private function createValue($object, $arguments = [])
{
if ($this->isInstanceOf($arguments, ConfigObject::class)) {
$arguments = $arguments->toArray();
}
if (!$this->isArray($arguments)) {
throw new ServiceManagerException(ServiceManagerException::INVALID_SERVICE_A... | [
"private",
"function",
"createValue",
"(",
"$",
"object",
",",
"$",
"arguments",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isInstanceOf",
"(",
"$",
"arguments",
",",
"ConfigObject",
"::",
"class",
")",
")",
"{",
"$",
"arguments",
"=",
"... | Create proper argument value
@param mixed $object
@param array $arguments
@throws ServiceManagerException
@return mixed|object | [
"Create",
"proper",
"argument",
"value"
] | 2ca7fb238999387e54a1eea8c5cb4735de9022a7 | https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/ServiceManager/Argument.php#L80-L109 |
230,225 | milesj/admin | Controller/ReportsController.php | ReportsController.index | public function index() {
$this->paginate = array_merge(array(
'limit' => 25,
'order' => array('ItemReport.' . $this->Model->displayField => 'ASC'),
'contain' => array_keys($this->Model->belongsTo),
'conditions' => array('ItemReport.status' => ItemReport::PENDING)... | php | public function index() {
$this->paginate = array_merge(array(
'limit' => 25,
'order' => array('ItemReport.' . $this->Model->displayField => 'ASC'),
'contain' => array_keys($this->Model->belongsTo),
'conditions' => array('ItemReport.status' => ItemReport::PENDING)... | [
"public",
"function",
"index",
"(",
")",
"{",
"$",
"this",
"->",
"paginate",
"=",
"array_merge",
"(",
"array",
"(",
"'limit'",
"=>",
"25",
",",
"'order'",
"=>",
"array",
"(",
"'ItemReport.'",
".",
"$",
"this",
"->",
"Model",
"->",
"displayField",
"=>",
... | Paginate the reports. | [
"Paginate",
"the",
"reports",
"."
] | e5e93823d1eb4415f05a3191f653eb50c296d2c6 | https://github.com/milesj/admin/blob/e5e93823d1eb4415f05a3191f653eb50c296d2c6/Controller/ReportsController.php#L16-L34 |
230,226 | Webiny/Framework | src/Webiny/Component/Rest/Response/RateControl.php | RateControl.isWithinRateLimits | public static function isWithinRateLimits(RequestBag $requestBag, CallbackResult $cr)
{
// do we have rate control in place?
if (!($rateControl = $requestBag->getApiConfig()->get('RateControl', false))) {
return true; // if rate control is not set, user is within his limits
}
... | php | public static function isWithinRateLimits(RequestBag $requestBag, CallbackResult $cr)
{
// do we have rate control in place?
if (!($rateControl = $requestBag->getApiConfig()->get('RateControl', false))) {
return true; // if rate control is not set, user is within his limits
}
... | [
"public",
"static",
"function",
"isWithinRateLimits",
"(",
"RequestBag",
"$",
"requestBag",
",",
"CallbackResult",
"$",
"cr",
")",
"{",
"// do we have rate control in place?",
"if",
"(",
"!",
"(",
"$",
"rateControl",
"=",
"$",
"requestBag",
"->",
"getApiConfig",
"... | Checks if user is within rate limits.
@param RequestBag $requestBag
@param CallbackResult $cr
@return bool
@throws \Webiny\Component\Rest\RestException | [
"Checks",
"if",
"user",
"is",
"within",
"rate",
"limits",
"."
] | 2ca7fb238999387e54a1eea8c5cb4735de9022a7 | https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/Rest/Response/RateControl.php#L36-L112 |
230,227 | decred/decred-php-api | src/Decred/Data/DataClient.php | DataClient.getAddressRaw | public function getAddressRaw($address, \DateTime $from = null)
{
$result = false;
$response = $this->request(sprintf('/api/address/%s/raw', $address));
if ($response !== false && is_array($response)) {
$result = [];
foreach ($response as $data) {
$t... | php | public function getAddressRaw($address, \DateTime $from = null)
{
$result = false;
$response = $this->request(sprintf('/api/address/%s/raw', $address));
if ($response !== false && is_array($response)) {
$result = [];
foreach ($response as $data) {
$t... | [
"public",
"function",
"getAddressRaw",
"(",
"$",
"address",
",",
"\\",
"DateTime",
"$",
"from",
"=",
"null",
")",
"{",
"$",
"result",
"=",
"false",
";",
"$",
"response",
"=",
"$",
"this",
"->",
"request",
"(",
"sprintf",
"(",
"'/api/address/%s/raw'",
","... | Get address raw presentation.
@param string $address Address
@param \DateTime|null $from Filter older transactions
@return array|bool|Transaction[] | [
"Get",
"address",
"raw",
"presentation",
"."
] | dafea9ceac918c4c3cd9bc7c436009a95dfb1643 | https://github.com/decred/decred-php-api/blob/dafea9ceac918c4c3cd9bc7c436009a95dfb1643/src/Decred/Data/DataClient.php#L46-L66 |
230,228 | Webiny/Framework | src/Webiny/Component/ClassLoader/Loaders/Pear.php | Pear.registerMap | public function registerMap($prefix, $library)
{
// check the structure of location if it contains metadata
if (is_array($library)) {
$path = $library['Path'];
$this->rules[$prefix] = $library;
} else {
$path = $library;
}
$this->maps[$pre... | php | public function registerMap($prefix, $library)
{
// check the structure of location if it contains metadata
if (is_array($library)) {
$path = $library['Path'];
$this->rules[$prefix] = $library;
} else {
$path = $library;
}
$this->maps[$pre... | [
"public",
"function",
"registerMap",
"(",
"$",
"prefix",
",",
"$",
"library",
")",
"{",
"// check the structure of location if it contains metadata",
"if",
"(",
"is_array",
"(",
"$",
"library",
")",
")",
"{",
"$",
"path",
"=",
"$",
"library",
"[",
"'Path'",
"]... | Register a map.
@param string $prefix Map prefix or namespace.
@param array|string $library Absolute path to the library or an array with path and additional options.
@return void | [
"Register",
"a",
"map",
"."
] | 2ca7fb238999387e54a1eea8c5cb4735de9022a7 | https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/ClassLoader/Loaders/Pear.php#L30-L41 |
230,229 | milesj/admin | Model/FileUpload.php | FileUpload.beforeUpload | public function beforeUpload($options) {
$data = $this->data[$this->alias];
// Remove transforms for non-image files
if (!empty($data['path']['type']) && strpos($data['path']['type'], 'image') === false) {
$options['transforms'] = array();
}
// Overwrite transforms ... | php | public function beforeUpload($options) {
$data = $this->data[$this->alias];
// Remove transforms for non-image files
if (!empty($data['path']['type']) && strpos($data['path']['type'], 'image') === false) {
$options['transforms'] = array();
}
// Overwrite transforms ... | [
"public",
"function",
"beforeUpload",
"(",
"$",
"options",
")",
"{",
"$",
"data",
"=",
"$",
"this",
"->",
"data",
"[",
"$",
"this",
"->",
"alias",
"]",
";",
"// Remove transforms for non-image files",
"if",
"(",
"!",
"empty",
"(",
"$",
"data",
"[",
"'pat... | Remove transforms if file is not an image.
@param array $options
@return array | [
"Remove",
"transforms",
"if",
"file",
"is",
"not",
"an",
"image",
"."
] | e5e93823d1eb4415f05a3191f653eb50c296d2c6 | https://github.com/milesj/admin/blob/e5e93823d1eb4415f05a3191f653eb50c296d2c6/Model/FileUpload.php#L124-L157 |
230,230 | Webiny/Framework | src/Webiny/Component/OAuth2/Bridge/OAuth2.php | OAuth2.getInstance | static function getInstance($clientId, $clientSecret, $redirectUri, $certificateFile = '')
{
$driver = static::getLibrary();
try {
$instance = new $driver($clientId, $clientSecret, $redirectUri);
} catch (\Exception $e) {
throw new Exception('Unable to create an inst... | php | static function getInstance($clientId, $clientSecret, $redirectUri, $certificateFile = '')
{
$driver = static::getLibrary();
try {
$instance = new $driver($clientId, $clientSecret, $redirectUri);
} catch (\Exception $e) {
throw new Exception('Unable to create an inst... | [
"static",
"function",
"getInstance",
"(",
"$",
"clientId",
",",
"$",
"clientSecret",
",",
"$",
"redirectUri",
",",
"$",
"certificateFile",
"=",
"''",
")",
"{",
"$",
"driver",
"=",
"static",
"::",
"getLibrary",
"(",
")",
";",
"try",
"{",
"$",
"instance",
... | Create an instance of an OAuth2 driver.
@param string $clientId Client id.
@param string $clientSecret Client secret.
@param string $redirectUri Target url where to redirect after authentication.
@param string $certificateFile
@throws Exception
@return AbstractOAuth2 | [
"Create",
"an",
"instance",
"of",
"an",
"OAuth2",
"driver",
"."
] | 2ca7fb238999387e54a1eea8c5cb4735de9022a7 | https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/OAuth2/Bridge/OAuth2.php#L61-L80 |
230,231 | markguinn/silverstripe-ajax | code/AjaxHttpResponse.php | AjaxHTTPResponse.triggerEvent | public function triggerEvent($eventName, $eventData=1)
{
if (!empty($eventName)) {
$this->events[$eventName] = $eventData;
}
return $this;
} | php | public function triggerEvent($eventName, $eventData=1)
{
if (!empty($eventName)) {
$this->events[$eventName] = $eventData;
}
return $this;
} | [
"public",
"function",
"triggerEvent",
"(",
"$",
"eventName",
",",
"$",
"eventData",
"=",
"1",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"eventName",
")",
")",
"{",
"$",
"this",
"->",
"events",
"[",
"$",
"eventName",
"]",
"=",
"$",
"eventData",
"... | Queues up an event to be triggered on the client when the response is received.
Events are not gauranteed to be triggered in order.
Events are triggered AFTER regions are replaced.
@param string $eventName
@param mixed $eventData - must be json encodable
@return $this | [
"Queues",
"up",
"an",
"event",
"to",
"be",
"triggered",
"on",
"the",
"client",
"when",
"the",
"response",
"is",
"received",
".",
"Events",
"are",
"not",
"gauranteed",
"to",
"be",
"triggered",
"in",
"order",
".",
"Events",
"are",
"triggered",
"AFTER",
"regi... | 4fcfa4a70d80ff090e4664df064fe695f82f5497 | https://github.com/markguinn/silverstripe-ajax/blob/4fcfa4a70d80ff090e4664df064fe695f82f5497/code/AjaxHttpResponse.php#L69-L76 |
230,232 | addiks/phpsql | src/Addiks/PHPSQL/Column/ColumnDataFactory.php | ColumnDataFactory.createColumnData | public function createColumnData(
$schemaId,
$tableId,
$columnId,
ColumnSchema $columnSchema
) {
assert(is_numeric($tableId));
$columnDataFilePath = sprintf(
FilePathes::FILEPATH_COLUMN_DATA_FILE,
$schemaId,
$tableId,
$... | php | public function createColumnData(
$schemaId,
$tableId,
$columnId,
ColumnSchema $columnSchema
) {
assert(is_numeric($tableId));
$columnDataFilePath = sprintf(
FilePathes::FILEPATH_COLUMN_DATA_FILE,
$schemaId,
$tableId,
$... | [
"public",
"function",
"createColumnData",
"(",
"$",
"schemaId",
",",
"$",
"tableId",
",",
"$",
"columnId",
",",
"ColumnSchema",
"$",
"columnSchema",
")",
"{",
"assert",
"(",
"is_numeric",
"(",
"$",
"tableId",
")",
")",
";",
"$",
"columnDataFilePath",
"=",
... | Creates a new column-data-object.
@param string $columnId
@return ColumnData | [
"Creates",
"a",
"new",
"column",
"-",
"data",
"-",
"object",
"."
] | 28dae64ffc2123f39f801a50ab53bfe29890cbd9 | https://github.com/addiks/phpsql/blob/28dae64ffc2123f39f801a50ab53bfe29890cbd9/src/Addiks/PHPSQL/Column/ColumnDataFactory.php#L37-L60 |
230,233 | addiks/phpsql | src/Addiks/PHPSQL/Iterators/CustomIterator.php | CustomIterator.current | public function current()
{
if (is_callable($this->currentCallback)) {
$return = call_user_func($this->currentCallback, parent::current());
return $return;
} else {
return parent::current();
}
} | php | public function current()
{
if (is_callable($this->currentCallback)) {
$return = call_user_func($this->currentCallback, parent::current());
return $return;
} else {
return parent::current();
}
} | [
"public",
"function",
"current",
"(",
")",
"{",
"if",
"(",
"is_callable",
"(",
"$",
"this",
"->",
"currentCallback",
")",
")",
"{",
"$",
"return",
"=",
"call_user_func",
"(",
"$",
"this",
"->",
"currentCallback",
",",
"parent",
"::",
"current",
"(",
")",... | gets current value
@return mixed
@see ArrayIterator::current() | [
"gets",
"current",
"value"
] | 28dae64ffc2123f39f801a50ab53bfe29890cbd9 | https://github.com/addiks/phpsql/blob/28dae64ffc2123f39f801a50ab53bfe29890cbd9/src/Addiks/PHPSQL/Iterators/CustomIterator.php#L154-L162 |
230,234 | Webiny/Framework | src/Webiny/Component/Security/Authentication/Providers/OAuth2/OAuth2.php | OAuth2.triggerExit | private function triggerExit($msg)
{
switch ($this->exitTrigger) {
case 'die':
die($msg);
break;
case 'exception':
throw new OAuth2Exception($msg);
break;
default:
die($msg);
b... | php | private function triggerExit($msg)
{
switch ($this->exitTrigger) {
case 'die':
die($msg);
break;
case 'exception':
throw new OAuth2Exception($msg);
break;
default:
die($msg);
b... | [
"private",
"function",
"triggerExit",
"(",
"$",
"msg",
")",
"{",
"switch",
"(",
"$",
"this",
"->",
"exitTrigger",
")",
"{",
"case",
"'die'",
":",
"die",
"(",
"$",
"msg",
")",
";",
"break",
";",
"case",
"'exception'",
":",
"throw",
"new",
"OAuth2Excepti... | Triggers the exit process from OAuth2 authentication process.
@throws OAuth2Exception | [
"Triggers",
"the",
"exit",
"process",
"from",
"OAuth2",
"authentication",
"process",
"."
] | 2ca7fb238999387e54a1eea8c5cb4735de9022a7 | https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/Security/Authentication/Providers/OAuth2/OAuth2.php#L211-L224 |
230,235 | Webiny/Framework | src/Webiny/Component/Rest/RestTrait.php | RestTrait.restGetPage | protected static function restGetPage($default = 1)
{
$page = Request::getInstance()->query('_page', $default);
if (!is_numeric($page) || $page < 1) {
return $default;
}
return (int)$page;
} | php | protected static function restGetPage($default = 1)
{
$page = Request::getInstance()->query('_page', $default);
if (!is_numeric($page) || $page < 1) {
return $default;
}
return (int)$page;
} | [
"protected",
"static",
"function",
"restGetPage",
"(",
"$",
"default",
"=",
"1",
")",
"{",
"$",
"page",
"=",
"Request",
"::",
"getInstance",
"(",
")",
"->",
"query",
"(",
"'_page'",
",",
"$",
"default",
")",
";",
"if",
"(",
"!",
"is_numeric",
"(",
"$... | Get the page number.
@param int $default Default value to return if page parameter is not found or if it's not valid.
@return int | [
"Get",
"the",
"page",
"number",
"."
] | 2ca7fb238999387e54a1eea8c5cb4735de9022a7 | https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/Rest/RestTrait.php#L27-L35 |
230,236 | Webiny/Framework | src/Webiny/Component/Rest/RestTrait.php | RestTrait.restGetPerPage | protected static function restGetPerPage($default = 10)
{
$perPage = Request::getInstance()->query('_perPage', $default);
if (!is_numeric($perPage) || $perPage < 1 || $perPage > 1000) {
return $default;
}
return (int)$perPage;
} | php | protected static function restGetPerPage($default = 10)
{
$perPage = Request::getInstance()->query('_perPage', $default);
if (!is_numeric($perPage) || $perPage < 1 || $perPage > 1000) {
return $default;
}
return (int)$perPage;
} | [
"protected",
"static",
"function",
"restGetPerPage",
"(",
"$",
"default",
"=",
"10",
")",
"{",
"$",
"perPage",
"=",
"Request",
"::",
"getInstance",
"(",
")",
"->",
"query",
"(",
"'_perPage'",
",",
"$",
"default",
")",
";",
"if",
"(",
"!",
"is_numeric",
... | Get the perPage value.
@param int $default Default value to return if perPage parameter is not found or if it's not valid.
@return int | [
"Get",
"the",
"perPage",
"value",
"."
] | 2ca7fb238999387e54a1eea8c5cb4735de9022a7 | https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/Rest/RestTrait.php#L44-L52 |
230,237 | Webiny/Framework | src/Webiny/Component/Rest/RestTrait.php | RestTrait.restGetSortField | protected static function restGetSortField($default = false)
{
$sort = Request::getInstance()->query('_sort', false);
if (!$sort) {
return $default;
}
$sortDirection = substr($sort, 0, 1);
if ($sortDirection == '+' || $sortDirection == '-') {
return s... | php | protected static function restGetSortField($default = false)
{
$sort = Request::getInstance()->query('_sort', false);
if (!$sort) {
return $default;
}
$sortDirection = substr($sort, 0, 1);
if ($sortDirection == '+' || $sortDirection == '-') {
return s... | [
"protected",
"static",
"function",
"restGetSortField",
"(",
"$",
"default",
"=",
"false",
")",
"{",
"$",
"sort",
"=",
"Request",
"::",
"getInstance",
"(",
")",
"->",
"query",
"(",
"'_sort'",
",",
"false",
")",
";",
"if",
"(",
"!",
"$",
"sort",
")",
"... | Get the sort value.
@param string|bool $default Default value to return if sort parameter is not found.
@return mixed|string | [
"Get",
"the",
"sort",
"value",
"."
] | 2ca7fb238999387e54a1eea8c5cb4735de9022a7 | https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/Rest/RestTrait.php#L61-L74 |
230,238 | Webiny/Framework | src/Webiny/Component/Rest/RestTrait.php | RestTrait.restGetSortFields | protected static function restGetSortFields($default = [])
{
$sort = Request::getInstance()->query('_sort', false);
if (!$sort) {
return $default;
}
$sorters = [];
$fields = explode(',', $sort);
foreach ($fields as $sort) {
$sortField = $sort;... | php | protected static function restGetSortFields($default = [])
{
$sort = Request::getInstance()->query('_sort', false);
if (!$sort) {
return $default;
}
$sorters = [];
$fields = explode(',', $sort);
foreach ($fields as $sort) {
$sortField = $sort;... | [
"protected",
"static",
"function",
"restGetSortFields",
"(",
"$",
"default",
"=",
"[",
"]",
")",
"{",
"$",
"sort",
"=",
"Request",
"::",
"getInstance",
"(",
")",
"->",
"query",
"(",
"'_sort'",
",",
"false",
")",
";",
"if",
"(",
"!",
"$",
"sort",
")",... | Get the sort fields values
@param string|bool $default Default value to return if sort parameter is not found.
@return mixed|string | [
"Get",
"the",
"sort",
"fields",
"values"
] | 2ca7fb238999387e54a1eea8c5cb4735de9022a7 | https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/Rest/RestTrait.php#L83-L106 |
230,239 | Webiny/Framework | src/Webiny/Component/Rest/RestTrait.php | RestTrait.restGetSortDirection | protected static function restGetSortDirection($default = 1)
{
$sort = Request::getInstance()->query('_sort', false);
if (!$sort) {
return $default;
}
$sortDirection = substr($sort, 0, 1);
if ($sortDirection == '+') {
return 1;
}
if (... | php | protected static function restGetSortDirection($default = 1)
{
$sort = Request::getInstance()->query('_sort', false);
if (!$sort) {
return $default;
}
$sortDirection = substr($sort, 0, 1);
if ($sortDirection == '+') {
return 1;
}
if (... | [
"protected",
"static",
"function",
"restGetSortDirection",
"(",
"$",
"default",
"=",
"1",
")",
"{",
"$",
"sort",
"=",
"Request",
"::",
"getInstance",
"(",
")",
"->",
"query",
"(",
"'_sort'",
",",
"false",
")",
";",
"if",
"(",
"!",
"$",
"sort",
")",
"... | Get the sort direction.
The result output is optimized for mongodb, meaning we return '1' for ascending and '-1' for descending.
@param int $default Default value to return if sort parameter is not found or if it's not valid.
@return int | [
"Get",
"the",
"sort",
"direction",
".",
"The",
"result",
"output",
"is",
"optimized",
"for",
"mongodb",
"meaning",
"we",
"return",
"1",
"for",
"ascending",
"and",
"-",
"1",
"for",
"descending",
"."
] | 2ca7fb238999387e54a1eea8c5cb4735de9022a7 | https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/Rest/RestTrait.php#L116-L133 |
230,240 | Webiny/Framework | src/Webiny/Component/Rest/RestTrait.php | RestTrait.restGetFieldsDepth | protected static function restGetFieldsDepth($default = 1)
{
$depth = Request::getInstance()->query('_fieldsDepth', false);
if (!$depth) {
$fields = static::restGetFields(false);
if (!$fields) {
return $default;
}
// Determine the deep... | php | protected static function restGetFieldsDepth($default = 1)
{
$depth = Request::getInstance()->query('_fieldsDepth', false);
if (!$depth) {
$fields = static::restGetFields(false);
if (!$fields) {
return $default;
}
// Determine the deep... | [
"protected",
"static",
"function",
"restGetFieldsDepth",
"(",
"$",
"default",
"=",
"1",
")",
"{",
"$",
"depth",
"=",
"Request",
"::",
"getInstance",
"(",
")",
"->",
"query",
"(",
"'_fieldsDepth'",
",",
"false",
")",
";",
"if",
"(",
"!",
"$",
"depth",
"... | Get the fields depth
@param int Default value to return if fieldsDepth parameter is not found.
@return int | [
"Get",
"the",
"fields",
"depth"
] | 2ca7fb238999387e54a1eea8c5cb4735de9022a7 | https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/Rest/RestTrait.php#L154-L176 |
230,241 | Webiny/Framework | src/Webiny/Component/StdLib/StdObject/DateTimeObject/ManipulatorTrait.php | ManipulatorTrait.add | public function add($amount)
{
try {
$interval = $this->parseDateInterval($amount);
$this->getDateObject()->add($interval);
} catch (\Exception $e) {
throw new DateTimeObjectException($e->getMessage());
}
return $this;
} | php | public function add($amount)
{
try {
$interval = $this->parseDateInterval($amount);
$this->getDateObject()->add($interval);
} catch (\Exception $e) {
throw new DateTimeObjectException($e->getMessage());
}
return $this;
} | [
"public",
"function",
"add",
"(",
"$",
"amount",
")",
"{",
"try",
"{",
"$",
"interval",
"=",
"$",
"this",
"->",
"parseDateInterval",
"(",
"$",
"amount",
")",
";",
"$",
"this",
"->",
"getDateObject",
"(",
")",
"->",
"add",
"(",
"$",
"interval",
")",
... | Adds an amount of days, months, years, hours, minutes and seconds to a DateTimeObject.
@param string $amount You can specify the amount in ISO8601 format (example: 'P14D' = 14 days; 'P1DT12H' = 1 day 12 hours),
or as a date string (example: '1 day', '2 months', '3 year', '2 days + 10 minutes').
@return $this
@throws ... | [
"Adds",
"an",
"amount",
"of",
"days",
"months",
"years",
"hours",
"minutes",
"and",
"seconds",
"to",
"a",
"DateTimeObject",
"."
] | 2ca7fb238999387e54a1eea8c5cb4735de9022a7 | https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/StdLib/StdObject/DateTimeObject/ManipulatorTrait.php#L31-L42 |
230,242 | Webiny/Framework | src/Webiny/Component/StdLib/StdObject/DateTimeObject/ManipulatorTrait.php | ManipulatorTrait.setDate | public function setDate($year, $month, $day)
{
try {
$this->getDateObject()->setDate($year, $month, $day);
} catch (\Exception $e) {
throw new DateTimeObjectException($e->getMessage());
}
return $this;
} | php | public function setDate($year, $month, $day)
{
try {
$this->getDateObject()->setDate($year, $month, $day);
} catch (\Exception $e) {
throw new DateTimeObjectException($e->getMessage());
}
return $this;
} | [
"public",
"function",
"setDate",
"(",
"$",
"year",
",",
"$",
"month",
",",
"$",
"day",
")",
"{",
"try",
"{",
"$",
"this",
"->",
"getDateObject",
"(",
")",
"->",
"setDate",
"(",
"$",
"year",
",",
"$",
"month",
",",
"$",
"day",
")",
";",
"}",
"ca... | Set the date on current object.
@param int $year
@param int $month
@param int $day
@throws DateTimeObjectException
@return $this | [
"Set",
"the",
"date",
"on",
"current",
"object",
"."
] | 2ca7fb238999387e54a1eea8c5cb4735de9022a7 | https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/StdLib/StdObject/DateTimeObject/ManipulatorTrait.php#L54-L63 |
230,243 | Webiny/Framework | src/Webiny/Component/StdLib/StdObject/DateTimeObject/ManipulatorTrait.php | ManipulatorTrait.setTime | public function setTime($hour, $minute, $second = 0)
{
try {
$this->getDateObject()->setTime($hour, $minute, $second);
} catch (\Exception $e) {
throw new DateTimeObjectException($e->getMessage());
}
return $this;
} | php | public function setTime($hour, $minute, $second = 0)
{
try {
$this->getDateObject()->setTime($hour, $minute, $second);
} catch (\Exception $e) {
throw new DateTimeObjectException($e->getMessage());
}
return $this;
} | [
"public",
"function",
"setTime",
"(",
"$",
"hour",
",",
"$",
"minute",
",",
"$",
"second",
"=",
"0",
")",
"{",
"try",
"{",
"$",
"this",
"->",
"getDateObject",
"(",
")",
"->",
"setTime",
"(",
"$",
"hour",
",",
"$",
"minute",
",",
"$",
"second",
")... | Set the time on current object.
@param int $hour
@param int $minute
@param int $second
@throws DateTimeObjectException
@return $this | [
"Set",
"the",
"time",
"on",
"current",
"object",
"."
] | 2ca7fb238999387e54a1eea8c5cb4735de9022a7 | https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/StdLib/StdObject/DateTimeObject/ManipulatorTrait.php#L75-L84 |
230,244 | Webiny/Framework | src/Webiny/Component/StdLib/StdObject/DateTimeObject/ManipulatorTrait.php | ManipulatorTrait.setTimestamp | public function setTimestamp($timestamp)
{
try {
$this->getDateObject()->setTimestamp($timestamp);
} catch (\Exception $e) {
throw new DateTimeObjectException($e->getMessage());
}
return $this;
} | php | public function setTimestamp($timestamp)
{
try {
$this->getDateObject()->setTimestamp($timestamp);
} catch (\Exception $e) {
throw new DateTimeObjectException($e->getMessage());
}
return $this;
} | [
"public",
"function",
"setTimestamp",
"(",
"$",
"timestamp",
")",
"{",
"try",
"{",
"$",
"this",
"->",
"getDateObject",
"(",
")",
"->",
"setTimestamp",
"(",
"$",
"timestamp",
")",
";",
"}",
"catch",
"(",
"\\",
"Exception",
"$",
"e",
")",
"{",
"throw",
... | Set the timestamp on current object.
@param int $timestamp UNIX timestamp.
@throws DateTimeObjectException
@return $this | [
"Set",
"the",
"timestamp",
"on",
"current",
"object",
"."
] | 2ca7fb238999387e54a1eea8c5cb4735de9022a7 | https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/StdLib/StdObject/DateTimeObject/ManipulatorTrait.php#L94-L103 |
230,245 | naneau/semver | src/Naneau/SemVer/Parser/PreRelease.php | PreRelease.parse | public static function parse($string)
{
// Type X.Y.Z, can be parsed as Versionable
if (substr_count($string, '.') === 2) {
return VersionableParser::parse($string, 'Naneau\SemVer\Version\PreRelease');
}
$preRelease = new PreReleaseVersion;
$parts = explode('.',... | php | public static function parse($string)
{
// Type X.Y.Z, can be parsed as Versionable
if (substr_count($string, '.') === 2) {
return VersionableParser::parse($string, 'Naneau\SemVer\Version\PreRelease');
}
$preRelease = new PreReleaseVersion;
$parts = explode('.',... | [
"public",
"static",
"function",
"parse",
"(",
"$",
"string",
")",
"{",
"// Type X.Y.Z, can be parsed as Versionable",
"if",
"(",
"substr_count",
"(",
"$",
"string",
",",
"'.'",
")",
"===",
"2",
")",
"{",
"return",
"VersionableParser",
"::",
"parse",
"(",
"$",
... | Parse pre release version string
@param string
@return PreReleaseVersion | [
"Parse",
"pre",
"release",
"version",
"string"
] | c771ad1e6c89064c0a4fa714979639dc3649d6c8 | https://github.com/naneau/semver/blob/c771ad1e6c89064c0a4fa714979639dc3649d6c8/src/Naneau/SemVer/Parser/PreRelease.php#L34-L63 |
230,246 | ZenMagick/ZenCart | includes/modules/payment/authorizenet_echeck.php | authorizenet_echeck.confirmation | function confirmation() {
global $order;
$confirmation = array('fields' => array(array('title' => MODULE_PAYMENT_AUTHORIZENET_ECHECK_TEXT_BANK_NAME,
'field' => $_POST['authorizenet_echeck_bank_name']),
array('title' =>... | php | function confirmation() {
global $order;
$confirmation = array('fields' => array(array('title' => MODULE_PAYMENT_AUTHORIZENET_ECHECK_TEXT_BANK_NAME,
'field' => $_POST['authorizenet_echeck_bank_name']),
array('title' =>... | [
"function",
"confirmation",
"(",
")",
"{",
"global",
"$",
"order",
";",
"$",
"confirmation",
"=",
"array",
"(",
"'fields'",
"=>",
"array",
"(",
"array",
"(",
"'title'",
"=>",
"MODULE_PAYMENT_AUTHORIZENET_ECHECK_TEXT_BANK_NAME",
",",
"'field'",
"=>",
"$",
"_POST"... | Display Account Information on the Checkout Confirmation Page
@return array | [
"Display",
"Account",
"Information",
"on",
"the",
"Checkout",
"Confirmation",
"Page"
] | 00438ebc0faee786489aab4a6d70fc0d0c1461c7 | https://github.com/ZenMagick/ZenCart/blob/00438ebc0faee786489aab4a6d70fc0d0c1461c7/includes/modules/payment/authorizenet_echeck.php#L255-L269 |
230,247 | ZenMagick/ZenCart | includes/modules/payment/authorizenet_echeck.php | authorizenet_echeck.after_process | function after_process() {
global $insert_id, $db;
$sql = "insert into " . TABLE_ORDERS_STATUS_HISTORY . " (comments, orders_id, orders_status_id, date_added) values (:orderComments, :orderID, :orderStatus, now() )";
$sql = $db->bindVars($sql, ':orderComments', 'eCheck payment. AUTH: ' . $this->auth_code .... | php | function after_process() {
global $insert_id, $db;
$sql = "insert into " . TABLE_ORDERS_STATUS_HISTORY . " (comments, orders_id, orders_status_id, date_added) values (:orderComments, :orderID, :orderStatus, now() )";
$sql = $db->bindVars($sql, ':orderComments', 'eCheck payment. AUTH: ' . $this->auth_code .... | [
"function",
"after_process",
"(",
")",
"{",
"global",
"$",
"insert_id",
",",
"$",
"db",
";",
"$",
"sql",
"=",
"\"insert into \"",
".",
"TABLE_ORDERS_STATUS_HISTORY",
".",
"\" (comments, orders_id, orders_status_id, date_added) values (:orderComments, :orderID, :orderStatus, now... | Post-process activities. Updates the order-status history data with the auth code from the transaction.
@return boolean | [
"Post",
"-",
"process",
"activities",
".",
"Updates",
"the",
"order",
"-",
"status",
"history",
"data",
"with",
"the",
"auth",
"code",
"from",
"the",
"transaction",
"."
] | 00438ebc0faee786489aab4a6d70fc0d0c1461c7 | https://github.com/ZenMagick/ZenCart/blob/00438ebc0faee786489aab4a6d70fc0d0c1461c7/includes/modules/payment/authorizenet_echeck.php#L433-L441 |
230,248 | Webiny/Framework | src/Webiny/Component/Security/Authentication/Providers/Http/Http.php | Http.getLoginObject | public function getLoginObject(ConfigObject $config)
{
if (!$this->httpSession()->get('username', false)) {
$this->triggerLogin($config);
}
$username = $this->httpSession()->get('username', '');
$password = $this->httpSession()->get('password', '');
return new L... | php | public function getLoginObject(ConfigObject $config)
{
if (!$this->httpSession()->get('username', false)) {
$this->triggerLogin($config);
}
$username = $this->httpSession()->get('username', '');
$password = $this->httpSession()->get('password', '');
return new L... | [
"public",
"function",
"getLoginObject",
"(",
"ConfigObject",
"$",
"config",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"httpSession",
"(",
")",
"->",
"get",
"(",
"'username'",
",",
"false",
")",
")",
"{",
"$",
"this",
"->",
"triggerLogin",
"(",
"$",
... | This method is triggered on the login submit page where user credentials are submitted.
On this page the provider should create a new Login object from those credentials, and return the object.
This object will be then validated my user providers.
@param ConfigObject $config Firewall config
@return Login | [
"This",
"method",
"is",
"triggered",
"on",
"the",
"login",
"submit",
"page",
"where",
"user",
"credentials",
"are",
"submitted",
".",
"On",
"this",
"page",
"the",
"provider",
"should",
"create",
"a",
"new",
"Login",
"object",
"from",
"those",
"credentials",
... | 2ca7fb238999387e54a1eea8c5cb4735de9022a7 | https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/Security/Authentication/Providers/Http/Http.php#L55-L65 |
230,249 | Webiny/Framework | src/Webiny/Component/Security/Authentication/Providers/Http/Http.php | Http.triggerLogin | public function triggerLogin($config)
{
$headers = [
'WWW-Authenticate: Basic realm="' . $config->RealmName . '"',
'HTTP/1.0 401 Unauthorized'
];
foreach ($headers as $h) {
header($h);
}
if ($this->httpSession()->get('login_retry') == 'tr... | php | public function triggerLogin($config)
{
$headers = [
'WWW-Authenticate: Basic realm="' . $config->RealmName . '"',
'HTTP/1.0 401 Unauthorized'
];
foreach ($headers as $h) {
header($h);
}
if ($this->httpSession()->get('login_retry') == 'tr... | [
"public",
"function",
"triggerLogin",
"(",
"$",
"config",
")",
"{",
"$",
"headers",
"=",
"[",
"'WWW-Authenticate: Basic realm=\"'",
".",
"$",
"config",
"->",
"RealmName",
".",
"'\"'",
",",
"'HTTP/1.0 401 Unauthorized'",
"]",
";",
"foreach",
"(",
"$",
"headers",
... | This method is triggered when the user opens the login page.
On this page you must ask the user to provide you his credentials which should then be passed to the login submit page.
@param ConfigObject $config Firewall config
@return mixed | [
"This",
"method",
"is",
"triggered",
"when",
"the",
"user",
"opens",
"the",
"login",
"page",
".",
"On",
"this",
"page",
"you",
"must",
"ask",
"the",
"user",
"to",
"provide",
"you",
"his",
"credentials",
"which",
"should",
"then",
"be",
"passed",
"to",
"t... | 2ca7fb238999387e54a1eea8c5cb4735de9022a7 | https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/Security/Authentication/Providers/Http/Http.php#L95-L127 |
230,250 | Webiny/Framework | src/Webiny/Component/Security/Authentication/Providers/Http/Http.php | Http.invalidLoginProvidedCallback | public function invalidLoginProvidedCallback()
{
$this->httpSession()->delete('username');
$this->httpSession()->delete('password');
$this->httpSession()->save('login_retry', 'true');
} | php | public function invalidLoginProvidedCallback()
{
$this->httpSession()->delete('username');
$this->httpSession()->delete('password');
$this->httpSession()->save('login_retry', 'true');
} | [
"public",
"function",
"invalidLoginProvidedCallback",
"(",
")",
"{",
"$",
"this",
"->",
"httpSession",
"(",
")",
"->",
"delete",
"(",
"'username'",
")",
";",
"$",
"this",
"->",
"httpSession",
"(",
")",
"->",
"delete",
"(",
"'password'",
")",
";",
"$",
"t... | This callback is triggered after we validate the given login data, and the data is not valid.
Use this callback to clear the submit data from the previous request so that you don't get stuck in an
infinitive loop between login and login submit page. | [
"This",
"callback",
"is",
"triggered",
"after",
"we",
"validate",
"the",
"given",
"login",
"data",
"and",
"the",
"data",
"is",
"not",
"valid",
".",
"Use",
"this",
"callback",
"to",
"clear",
"the",
"submit",
"data",
"from",
"the",
"previous",
"request",
"so... | 2ca7fb238999387e54a1eea8c5cb4735de9022a7 | https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/Security/Authentication/Providers/Http/Http.php#L134-L139 |
230,251 | Webiny/Framework | src/Webiny/Component/Security/Authentication/Providers/Http/Http.php | Http.triggerExit | private function triggerExit()
{
$msg = 'You are not authenticated';
switch ($this->exitTrigger) {
case 'die':
die($msg);
break;
case 'exception':
throw new HttpException($msg);
break;
default:
... | php | private function triggerExit()
{
$msg = 'You are not authenticated';
switch ($this->exitTrigger) {
case 'die':
die($msg);
break;
case 'exception':
throw new HttpException($msg);
break;
default:
... | [
"private",
"function",
"triggerExit",
"(",
")",
"{",
"$",
"msg",
"=",
"'You are not authenticated'",
";",
"switch",
"(",
"$",
"this",
"->",
"exitTrigger",
")",
"{",
"case",
"'die'",
":",
"die",
"(",
"$",
"msg",
")",
";",
"break",
";",
"case",
"'exception... | Triggers the exit process from Http authentication process.
This method is used so we can mock the behaviour of this provider, for unit tests.
@throws HttpException | [
"Triggers",
"the",
"exit",
"process",
"from",
"Http",
"authentication",
"process",
".",
"This",
"method",
"is",
"used",
"so",
"we",
"can",
"mock",
"the",
"behaviour",
"of",
"this",
"provider",
"for",
"unit",
"tests",
"."
] | 2ca7fb238999387e54a1eea8c5cb4735de9022a7 | https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/Security/Authentication/Providers/Http/Http.php#L181-L196 |
230,252 | Webiny/Framework | src/Webiny/Component/StdLib/StdObject/ArrayObject/ManipulatorTrait.php | ManipulatorTrait.key | public function key($key, $value = null, $setOnlyIfDoesntExist = false)
{
$key = StdObjectWrapper::toString($key);
$array = $this->val();
if ($setOnlyIfDoesntExist && !$this->keyExists($key)) {
$array[$key] = $value;
$this->val($array);
return $value;
... | php | public function key($key, $value = null, $setOnlyIfDoesntExist = false)
{
$key = StdObjectWrapper::toString($key);
$array = $this->val();
if ($setOnlyIfDoesntExist && !$this->keyExists($key)) {
$array[$key] = $value;
$this->val($array);
return $value;
... | [
"public",
"function",
"key",
"(",
"$",
"key",
",",
"$",
"value",
"=",
"null",
",",
"$",
"setOnlyIfDoesntExist",
"=",
"false",
")",
"{",
"$",
"key",
"=",
"StdObjectWrapper",
"::",
"toString",
"(",
"$",
"key",
")",
";",
"$",
"array",
"=",
"$",
"this",
... | Get or update the given key inside current array.
@param string|int|StringObject $key Array key
@param null|mixed $value If set, the value under current $key will be updated and not returned.
@param bool $setOnlyIfDoesntExist Set the $value only in case if the $key doesn't exist.
@retu... | [
"Get",
"or",
"update",
"the",
"given",
"key",
"inside",
"current",
"array",
"."
] | 2ca7fb238999387e54a1eea8c5cb4735de9022a7 | https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/StdLib/StdObject/ArrayObject/ManipulatorTrait.php#L32-L56 |
230,253 | Webiny/Framework | src/Webiny/Component/StdLib/StdObject/ArrayObject/ManipulatorTrait.php | ManipulatorTrait.append | public function append($k, $v = null)
{
$array = $this->val();
if (!$this->isNull($v)) {
$array[$k] = $v;
} else {
$array[] = $k;
}
$this->val($array);
return $this;
} | php | public function append($k, $v = null)
{
$array = $this->val();
if (!$this->isNull($v)) {
$array[$k] = $v;
} else {
$array[] = $k;
}
$this->val($array);
return $this;
} | [
"public",
"function",
"append",
"(",
"$",
"k",
",",
"$",
"v",
"=",
"null",
")",
"{",
"$",
"array",
"=",
"$",
"this",
"->",
"val",
"(",
")",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"isNull",
"(",
"$",
"v",
")",
")",
"{",
"$",
"array",
"[",
... | Inserts an element to the end of the array.
If you set both params, that first param is the key, and second is the value,
else first param is the value, and the second is ignored.
@param mixed $k
@param mixed $v
@return $this | [
"Inserts",
"an",
"element",
"to",
"the",
"end",
"of",
"the",
"array",
".",
"If",
"you",
"set",
"both",
"params",
"that",
"first",
"param",
"is",
"the",
"key",
"and",
"second",
"is",
"the",
"value",
"else",
"first",
"param",
"is",
"the",
"value",
"and",... | 2ca7fb238999387e54a1eea8c5cb4735de9022a7 | https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/StdLib/StdObject/ArrayObject/ManipulatorTrait.php#L114-L127 |
230,254 | Webiny/Framework | src/Webiny/Component/StdLib/StdObject/ArrayObject/ManipulatorTrait.php | ManipulatorTrait.prepend | public function prepend($k, $v = null)
{
$array = $this->val();
if (!$this->isNull($v)) {
$array = array_reverse($array, true);
$array[$k] = $v;
$array = array_reverse($array, true);
} else {
array_unshift($array, $k);
}
$this... | php | public function prepend($k, $v = null)
{
$array = $this->val();
if (!$this->isNull($v)) {
$array = array_reverse($array, true);
$array[$k] = $v;
$array = array_reverse($array, true);
} else {
array_unshift($array, $k);
}
$this... | [
"public",
"function",
"prepend",
"(",
"$",
"k",
",",
"$",
"v",
"=",
"null",
")",
"{",
"$",
"array",
"=",
"$",
"this",
"->",
"val",
"(",
")",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"isNull",
"(",
"$",
"v",
")",
")",
"{",
"$",
"array",
"=",
... | Inserts an element at the beginning of the array.
If you set both params, that first param is the key, and second is the value,
else first param is the value, and the second is ignored.
@param mixed $k
@param mixed $v
@return $this | [
"Inserts",
"an",
"element",
"at",
"the",
"beginning",
"of",
"the",
"array",
".",
"If",
"you",
"set",
"both",
"params",
"that",
"first",
"param",
"is",
"the",
"key",
"and",
"second",
"is",
"the",
"value",
"else",
"first",
"param",
"is",
"the",
"value",
... | 2ca7fb238999387e54a1eea8c5cb4735de9022a7 | https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/StdLib/StdObject/ArrayObject/ManipulatorTrait.php#L139-L154 |
230,255 | Webiny/Framework | src/Webiny/Component/StdLib/StdObject/ArrayObject/ManipulatorTrait.php | ManipulatorTrait.removeLast | public function removeLast(&$assign = null)
{
$array = $this->val();
if (count(func_get_args()) > 0) {
$assign = $this->last()->val();
}
array_pop($array);
$this->val($array);
return $this;
} | php | public function removeLast(&$assign = null)
{
$array = $this->val();
if (count(func_get_args()) > 0) {
$assign = $this->last()->val();
}
array_pop($array);
$this->val($array);
return $this;
} | [
"public",
"function",
"removeLast",
"(",
"&",
"$",
"assign",
"=",
"null",
")",
"{",
"$",
"array",
"=",
"$",
"this",
"->",
"val",
"(",
")",
";",
"if",
"(",
"count",
"(",
"func_get_args",
"(",
")",
")",
">",
"0",
")",
"{",
"$",
"assign",
"=",
"$"... | Removes the last element from the array.
@param null $assign Assign removed value to given parameter
@return $this | [
"Removes",
"the",
"last",
"element",
"from",
"the",
"array",
"."
] | 2ca7fb238999387e54a1eea8c5cb4735de9022a7 | https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/StdLib/StdObject/ArrayObject/ManipulatorTrait.php#L185-L197 |
230,256 | Webiny/Framework | src/Webiny/Component/StdLib/StdObject/ArrayObject/ManipulatorTrait.php | ManipulatorTrait.chunk | public function chunk($size, $preserve_keys = false)
{
try {
$chunk = array_chunk($this->val(), $size, $preserve_keys);
} catch (\ErrorException $e) {
throw new ArrayObjectException($e->getMessage());
}
return new ArrayObject($chunk);
} | php | public function chunk($size, $preserve_keys = false)
{
try {
$chunk = array_chunk($this->val(), $size, $preserve_keys);
} catch (\ErrorException $e) {
throw new ArrayObjectException($e->getMessage());
}
return new ArrayObject($chunk);
} | [
"public",
"function",
"chunk",
"(",
"$",
"size",
",",
"$",
"preserve_keys",
"=",
"false",
")",
"{",
"try",
"{",
"$",
"chunk",
"=",
"array_chunk",
"(",
"$",
"this",
"->",
"val",
"(",
")",
",",
"$",
"size",
",",
"$",
"preserve_keys",
")",
";",
"}",
... | Split an array into chunks.
@param int $size Chunk size.
@param bool $preserve_keys Do you want ot preserve keys.
@return ArrayObject A new instance of ArrayObject containing a multidimensional numerically indexed array,
starting with zero, with each dimension containing size elements.
@throws ArrayObjectException | [
"Split",
"an",
"array",
"into",
"chunks",
"."
] | 2ca7fb238999387e54a1eea8c5cb4735de9022a7 | https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/StdLib/StdObject/ArrayObject/ManipulatorTrait.php#L263-L272 |
230,257 | Webiny/Framework | src/Webiny/Component/StdLib/StdObject/ArrayObject/ManipulatorTrait.php | ManipulatorTrait.changeKeyCase | public function changeKeyCase($case)
{
// validate case
$case = new StringObject($case);
$case->caseLower();
$realCase = '';
if ($case->equals('lower')) {
$realCase = CASE_LOWER;
} else {
if ($case->equals('upper')) {
$realCase ... | php | public function changeKeyCase($case)
{
// validate case
$case = new StringObject($case);
$case->caseLower();
$realCase = '';
if ($case->equals('lower')) {
$realCase = CASE_LOWER;
} else {
if ($case->equals('upper')) {
$realCase ... | [
"public",
"function",
"changeKeyCase",
"(",
"$",
"case",
")",
"{",
"// validate case",
"$",
"case",
"=",
"new",
"StringObject",
"(",
"$",
"case",
")",
";",
"$",
"case",
"->",
"caseLower",
"(",
")",
";",
"$",
"realCase",
"=",
"''",
";",
"if",
"(",
"$"... | Change the case of all keys in current ArrayObject.
@param string $case Case to which you want to covert array keys. Can be 'lower' or 'upper'.
@return $this
@throws ArrayObjectException | [
"Change",
"the",
"case",
"of",
"all",
"keys",
"in",
"current",
"ArrayObject",
"."
] | 2ca7fb238999387e54a1eea8c5cb4735de9022a7 | https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/StdLib/StdObject/ArrayObject/ManipulatorTrait.php#L282-L304 |
230,258 | Webiny/Framework | src/Webiny/Component/StdLib/StdObject/ArrayObject/ManipulatorTrait.php | ManipulatorTrait.filter | public function filter($callable = '')
{
if ($callable != '' && !$this->isCallable($callable)) {
throw new ArrayObjectException(ArrayObjectException::MSG_INVALID_PARAM, [
'$callable',
'a callable function or method'
]);
}
if ($callable... | php | public function filter($callable = '')
{
if ($callable != '' && !$this->isCallable($callable)) {
throw new ArrayObjectException(ArrayObjectException::MSG_INVALID_PARAM, [
'$callable',
'a callable function or method'
]);
}
if ($callable... | [
"public",
"function",
"filter",
"(",
"$",
"callable",
"=",
"''",
")",
"{",
"if",
"(",
"$",
"callable",
"!=",
"''",
"&&",
"!",
"$",
"this",
"->",
"isCallable",
"(",
"$",
"callable",
")",
")",
"{",
"throw",
"new",
"ArrayObjectException",
"(",
"ArrayObjec... | Filter array values by using a callback function.
@param string $callable
@return $this
@throws ArrayObjectException | [
"Filter",
"array",
"values",
"by",
"using",
"a",
"callback",
"function",
"."
] | 2ca7fb238999387e54a1eea8c5cb4735de9022a7 | https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/StdLib/StdObject/ArrayObject/ManipulatorTrait.php#L377-L395 |
230,259 | Webiny/Framework | src/Webiny/Component/StdLib/StdObject/ArrayObject/ManipulatorTrait.php | ManipulatorTrait.sortKey | public function sortKey($direction = SORT_ASC, $sortFlag = SORT_REGULAR)
{
try {
$arr = $this->val();
if ($direction == SORT_DESC) {
krsort($arr, $sortFlag);
} else {
ksort($arr, $sortFlag);
}
} catch (\ErrorException $e... | php | public function sortKey($direction = SORT_ASC, $sortFlag = SORT_REGULAR)
{
try {
$arr = $this->val();
if ($direction == SORT_DESC) {
krsort($arr, $sortFlag);
} else {
ksort($arr, $sortFlag);
}
} catch (\ErrorException $e... | [
"public",
"function",
"sortKey",
"(",
"$",
"direction",
"=",
"SORT_ASC",
",",
"$",
"sortFlag",
"=",
"SORT_REGULAR",
")",
"{",
"try",
"{",
"$",
"arr",
"=",
"$",
"this",
"->",
"val",
"(",
")",
";",
"if",
"(",
"$",
"direction",
"==",
"SORT_DESC",
")",
... | Sort the array by its key.
This sort function take two flags. One defines the sort algorithm, and the other one, the sort direction.
Default behavior equals to the standard asort function.
@param int $direction In which direction you want to sort. You can use SORT_ASC or SORT_DESC.
@param int $sortFlag Which sort algo... | [
"Sort",
"the",
"array",
"by",
"its",
"key",
".",
"This",
"sort",
"function",
"take",
"two",
"flags",
".",
"One",
"defines",
"the",
"sort",
"algorithm",
"and",
"the",
"other",
"one",
"the",
"sort",
"direction",
".",
"Default",
"behavior",
"equals",
"to",
... | 2ca7fb238999387e54a1eea8c5cb4735de9022a7 | https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/StdLib/StdObject/ArrayObject/ManipulatorTrait.php#L691-L707 |
230,260 | Webiny/Framework | src/Webiny/Component/StdLib/StdObject/ArrayObject/ManipulatorTrait.php | ManipulatorTrait.pad | public function pad($size, $value)
{
try {
$arr = array_pad($this->val(), $size, $value);
} catch (\ErrorException $e) {
throw new ArrayObjectException($e->getMessage());
}
$this->val($arr);
return $this;
} | php | public function pad($size, $value)
{
try {
$arr = array_pad($this->val(), $size, $value);
} catch (\ErrorException $e) {
throw new ArrayObjectException($e->getMessage());
}
$this->val($arr);
return $this;
} | [
"public",
"function",
"pad",
"(",
"$",
"size",
",",
"$",
"value",
")",
"{",
"try",
"{",
"$",
"arr",
"=",
"array_pad",
"(",
"$",
"this",
"->",
"val",
"(",
")",
",",
"$",
"size",
",",
"$",
"value",
")",
";",
"}",
"catch",
"(",
"\\",
"ErrorExcepti... | Pad array to the specified length with a value.
@param int $size New size of the array
@param mixed $value Value to pad if array is smaller than pad_size.
@return $this
@throws ArrayObjectException | [
"Pad",
"array",
"to",
"the",
"specified",
"length",
"with",
"a",
"value",
"."
] | 2ca7fb238999387e54a1eea8c5cb4735de9022a7 | https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/StdLib/StdObject/ArrayObject/ManipulatorTrait.php#L771-L782 |
230,261 | Webiny/Framework | src/Webiny/Component/StdLib/StdObject/ArrayObject/ManipulatorTrait.php | ManipulatorTrait.rand | public function rand($num = 1)
{
try {
$arr = array_rand($this->val(), $num);
} catch (\ErrorException $e) {
throw new ArrayObjectException($e->getMessage());
}
if (!$this->isArray($arr)) {
$arr = [$arr];
}
return new ArrayObject(... | php | public function rand($num = 1)
{
try {
$arr = array_rand($this->val(), $num);
} catch (\ErrorException $e) {
throw new ArrayObjectException($e->getMessage());
}
if (!$this->isArray($arr)) {
$arr = [$arr];
}
return new ArrayObject(... | [
"public",
"function",
"rand",
"(",
"$",
"num",
"=",
"1",
")",
"{",
"try",
"{",
"$",
"arr",
"=",
"array_rand",
"(",
"$",
"this",
"->",
"val",
"(",
")",
",",
"$",
"num",
")",
";",
"}",
"catch",
"(",
"\\",
"ErrorException",
"$",
"e",
")",
"{",
"... | Returns random elements from current array.
@param int $num How many object you want to return.
@return ArrayObject
@throws ArrayObjectException | [
"Returns",
"random",
"elements",
"from",
"current",
"array",
"."
] | 2ca7fb238999387e54a1eea8c5cb4735de9022a7 | https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/StdLib/StdObject/ArrayObject/ManipulatorTrait.php#L792-L805 |
230,262 | Webiny/Framework | src/Webiny/Component/StdLib/StdObject/ArrayObject/ManipulatorTrait.php | ManipulatorTrait.slice | public function slice($offset, $length = null, $preserveKeys = true)
{
if (!$this->isNumber($offset)) {
throw new ArrayObjectException(ArrayObjectException::MSG_INVALID_PARAM, [
'$offset',
'integer'
]);
}
try {
$arr = array... | php | public function slice($offset, $length = null, $preserveKeys = true)
{
if (!$this->isNumber($offset)) {
throw new ArrayObjectException(ArrayObjectException::MSG_INVALID_PARAM, [
'$offset',
'integer'
]);
}
try {
$arr = array... | [
"public",
"function",
"slice",
"(",
"$",
"offset",
",",
"$",
"length",
"=",
"null",
",",
"$",
"preserveKeys",
"=",
"true",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"isNumber",
"(",
"$",
"offset",
")",
")",
"{",
"throw",
"new",
"ArrayObjectExcepti... | Slice a portion of current array and discard the remains.
@param int $offset From where to start slicing.
@param null|int $length How many elements to take.
@param bool $preserveKeys Do you want to preserve the keys from the current array. Default is true.
@return $this
@throws ArrayObjectException | [
"Slice",
"a",
"portion",
"of",
"current",
"array",
"and",
"discard",
"the",
"remains",
"."
] | 2ca7fb238999387e54a1eea8c5cb4735de9022a7 | https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/StdLib/StdObject/ArrayObject/ManipulatorTrait.php#L874-L892 |
230,263 | Webiny/Framework | src/Webiny/Component/StdLib/StdObject/ArrayObject/ManipulatorTrait.php | ManipulatorTrait.unique | public function unique($sortFlag = SORT_REGULAR)
{
$this->val(array_unique($this->val(), $sortFlag));
return $this;
} | php | public function unique($sortFlag = SORT_REGULAR)
{
$this->val(array_unique($this->val(), $sortFlag));
return $this;
} | [
"public",
"function",
"unique",
"(",
"$",
"sortFlag",
"=",
"SORT_REGULAR",
")",
"{",
"$",
"this",
"->",
"val",
"(",
"array_unique",
"(",
"$",
"this",
"->",
"val",
"(",
")",
",",
"$",
"sortFlag",
")",
")",
";",
"return",
"$",
"this",
";",
"}"
] | Remove duplicates from the array.
@param int $sortFlag The optional parameter that may be used to modify the sorting behavior.
Possible values are: SORT_STRING, SORT_NUMERIC, SORT_REGULAR and SORT_LOCALE_STRING
@return $this | [
"Remove",
"duplicates",
"from",
"the",
"array",
"."
] | 2ca7fb238999387e54a1eea8c5cb4735de9022a7 | https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/StdLib/StdObject/ArrayObject/ManipulatorTrait.php#L940-L945 |
230,264 | Webiny/Framework | src/Webiny/Component/StdLib/StdObject/ArrayObject/ManipulatorTrait.php | ManipulatorTrait.diff | public function diff($array, $compareKeys = false)
{
if ($this->isInstanceOf($array, $this)) {
$array = $array->val();
} else {
if (!$this->isArray($array)) {
throw new ArrayObjectException(ArrayObjectException::MSG_INVALID_PARAM, [
'$array... | php | public function diff($array, $compareKeys = false)
{
if ($this->isInstanceOf($array, $this)) {
$array = $array->val();
} else {
if (!$this->isArray($array)) {
throw new ArrayObjectException(ArrayObjectException::MSG_INVALID_PARAM, [
'$array... | [
"public",
"function",
"diff",
"(",
"$",
"array",
",",
"$",
"compareKeys",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isInstanceOf",
"(",
"$",
"array",
",",
"$",
"this",
")",
")",
"{",
"$",
"array",
"=",
"$",
"array",
"->",
"val",
"(",... | Compare two arrays or ArrayObjects and returns an ArrayObject containing all the values
from current ArrayObject that are not present in any of the other array.
@param $array Array to which to compare
@param bool $compareKeys Do you want to compare array keys also. Default is false.
@return ArrayObject
@th... | [
"Compare",
"two",
"arrays",
"or",
"ArrayObjects",
"and",
"returns",
"an",
"ArrayObject",
"containing",
"all",
"the",
"values",
"from",
"current",
"ArrayObject",
"that",
"are",
"not",
"present",
"in",
"any",
"of",
"the",
"other",
"array",
"."
] | 2ca7fb238999387e54a1eea8c5cb4735de9022a7 | https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/StdLib/StdObject/ArrayObject/ManipulatorTrait.php#L1005-L1027 |
230,265 | Webiny/Framework | src/Webiny/Component/StdLib/StdObject/ArrayObject/ManipulatorTrait.php | ManipulatorTrait.diffKeys | public function diffKeys($array)
{
if ($this->isInstanceOf($array, $this)) {
$array = $array->val();
} else {
if (!$this->isArray($array)) {
throw new ArrayObjectException(ArrayObjectException::MSG_INVALID_PARAM, [
'$array',
... | php | public function diffKeys($array)
{
if ($this->isInstanceOf($array, $this)) {
$array = $array->val();
} else {
if (!$this->isArray($array)) {
throw new ArrayObjectException(ArrayObjectException::MSG_INVALID_PARAM, [
'$array',
... | [
"public",
"function",
"diffKeys",
"(",
"$",
"array",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isInstanceOf",
"(",
"$",
"array",
",",
"$",
"this",
")",
")",
"{",
"$",
"array",
"=",
"$",
"array",
"->",
"val",
"(",
")",
";",
"}",
"else",
"{",
"if"... | Compare the keys from two arrays or ArrayObjects and returns an ArrayObject containing all the values
from current ArrayObject whose keys are not present in any of the other arrays.
@param $array Array to which to compare
@return ArrayObject
@throws ArrayObjectException | [
"Compare",
"the",
"keys",
"from",
"two",
"arrays",
"or",
"ArrayObjects",
"and",
"returns",
"an",
"ArrayObject",
"containing",
"all",
"the",
"values",
"from",
"current",
"ArrayObject",
"whose",
"keys",
"are",
"not",
"present",
"in",
"any",
"of",
"the",
"other",... | 2ca7fb238999387e54a1eea8c5cb4735de9022a7 | https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/StdLib/StdObject/ArrayObject/ManipulatorTrait.php#L1038-L1054 |
230,266 | Webiny/Framework | src/Webiny/Component/Bootstrap/Router.php | Router.initializeRouter | public function initializeRouter($url = null)
{
// current url
$currentUrl = is_null($url) ? $this->httpRequest()->getCurrentUrl() : $url;
// init the router
try {
// try matching a custom route
$result = $this->router()->match($currentUrl);
if (... | php | public function initializeRouter($url = null)
{
// current url
$currentUrl = is_null($url) ? $this->httpRequest()->getCurrentUrl() : $url;
// init the router
try {
// try matching a custom route
$result = $this->router()->match($currentUrl);
if (... | [
"public",
"function",
"initializeRouter",
"(",
"$",
"url",
"=",
"null",
")",
"{",
"// current url",
"$",
"currentUrl",
"=",
"is_null",
"(",
"$",
"url",
")",
"?",
"$",
"this",
"->",
"httpRequest",
"(",
")",
"->",
"getCurrentUrl",
"(",
")",
":",
"$",
"ur... | This is the request entry point, once the Bootstrap has been initialized.
The method initializes router and tries to call the callback assigned to the current url.
Method is call automatically from the Bootstrap class.
@param string $url Url to route. If not set, the current url is used.
@throws \Exception
@return D... | [
"This",
"is",
"the",
"request",
"entry",
"point",
"once",
"the",
"Bootstrap",
"has",
"been",
"initialized",
".",
"The",
"method",
"initializes",
"router",
"and",
"tries",
"to",
"call",
"the",
"callback",
"assigned",
"to",
"the",
"current",
"url",
".",
"Metho... | 2ca7fb238999387e54a1eea8c5cb4735de9022a7 | https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/Bootstrap/Router.php#L36-L71 |
230,267 | Webiny/Framework | src/Webiny/Component/Bootstrap/Router.php | Router.mvcRouter | public function mvcRouter($request)
{
// parse the request
$request = $this->str($request)->trimLeft('/')->trimRight('/')->explode('/');
if ($request->count() < 2) {
throw new BootstrapException('Unable to route this request.');
}
// extract the url parts
... | php | public function mvcRouter($request)
{
// parse the request
$request = $this->str($request)->trimLeft('/')->trimRight('/')->explode('/');
if ($request->count() < 2) {
throw new BootstrapException('Unable to route this request.');
}
// extract the url parts
... | [
"public",
"function",
"mvcRouter",
"(",
"$",
"request",
")",
"{",
"// parse the request",
"$",
"request",
"=",
"$",
"this",
"->",
"str",
"(",
"$",
"request",
")",
"->",
"trimLeft",
"(",
"'/'",
")",
"->",
"trimRight",
"(",
"'/'",
")",
"->",
"explode",
"... | This is the optional router that routes the MVC requests.
@param string $request Current url path.
@return Dispatcher
@throws BootstrapException
@throws \Webiny\Component\StdLib\StdObject\ArrayObject\ArrayObjectException
@throws \Webiny\Component\StdLib\StdObject\StringObject\StringObjectException | [
"This",
"is",
"the",
"optional",
"router",
"that",
"routes",
"the",
"MVC",
"requests",
"."
] | 2ca7fb238999387e54a1eea8c5cb4735de9022a7 | https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/Bootstrap/Router.php#L84-L118 |
230,268 | Webiny/Framework | src/Webiny/Component/Bootstrap/Router.php | Router.dispatchMvc | private function dispatchMvc($module, $controller, $action, $params)
{
return Dispatcher::mvcDispatcher($module, $controller, $action, $params);
} | php | private function dispatchMvc($module, $controller, $action, $params)
{
return Dispatcher::mvcDispatcher($module, $controller, $action, $params);
} | [
"private",
"function",
"dispatchMvc",
"(",
"$",
"module",
",",
"$",
"controller",
",",
"$",
"action",
",",
"$",
"params",
")",
"{",
"return",
"Dispatcher",
"::",
"mvcDispatcher",
"(",
"$",
"module",
",",
"$",
"controller",
",",
"$",
"action",
",",
"$",
... | Issues the callback using the MVC dispatcher.
@param string $module Module name.
@param string $controller Controller name.
@param string $action Action name.
@param array $params Parameter list.
@return Dispatcher | [
"Issues",
"the",
"callback",
"using",
"the",
"MVC",
"dispatcher",
"."
] | 2ca7fb238999387e54a1eea8c5cb4735de9022a7 | https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/Bootstrap/Router.php#L130-L133 |
230,269 | Webiny/Framework | src/Webiny/Component/StdLib/StdObject/StringObject/StringObject.php | StringObject.wordCount | public function wordCount($format = 0)
{
if ($format < 1) {
return str_word_count($this->val(), $format);
} else {
return new ArrayObject(str_word_count($this->val(), $format));
}
} | php | public function wordCount($format = 0)
{
if ($format < 1) {
return str_word_count($this->val(), $format);
} else {
return new ArrayObject(str_word_count($this->val(), $format));
}
} | [
"public",
"function",
"wordCount",
"(",
"$",
"format",
"=",
"0",
")",
"{",
"if",
"(",
"$",
"format",
"<",
"1",
")",
"{",
"return",
"str_word_count",
"(",
"$",
"this",
"->",
"val",
"(",
")",
",",
"$",
"format",
")",
";",
"}",
"else",
"{",
"return"... | Get the number of words in the string.
@param int $format Specify the return format:
0 - return number of words
1 - return an ArrayObject containing all the words found inside the string
2 - returns an ArrayObject, where the key is the numeric position of the word
inside the string and the value is the actual word its... | [
"Get",
"the",
"number",
"of",
"words",
"in",
"the",
"string",
"."
] | 2ca7fb238999387e54a1eea8c5cb4735de9022a7 | https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/StdLib/StdObject/StringObject/StringObject.php#L87-L95 |
230,270 | Webiny/Framework | src/Webiny/Component/StdLib/StdObject/StringObject/StringObject.php | StringObject.subStringCount | public function subStringCount($string, $offset = 0, $length = null)
{
if ($this->isNull($length)) {
$length = $this->length();
}
return substr_count($this->val(), $string, $offset, $length);
} | php | public function subStringCount($string, $offset = 0, $length = null)
{
if ($this->isNull($length)) {
$length = $this->length();
}
return substr_count($this->val(), $string, $offset, $length);
} | [
"public",
"function",
"subStringCount",
"(",
"$",
"string",
",",
"$",
"offset",
"=",
"0",
",",
"$",
"length",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isNull",
"(",
"$",
"length",
")",
")",
"{",
"$",
"length",
"=",
"$",
"this",
"->",... | Get number of string occurrences in current string.
@param string $string String to search for
@param null|int $offset The offset where to start counting
@param null|int $length The maximum length after the specified offset to search for the substring.
It outputs a warning if the offset plus the length is greater th... | [
"Get",
"number",
"of",
"string",
"occurrences",
"in",
"current",
"string",
"."
] | 2ca7fb238999387e54a1eea8c5cb4735de9022a7 | https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/StdLib/StdObject/StringObject/StringObject.php#L117-L124 |
230,271 | decred/decred-php-api | src/Decred/Crypto/Curve.php | Curve.ensureOnCurve | public static function ensureOnCurve($key)
{
$point = self::unserializePoint($key);
if (!static::curve()->contains($point->getX(), $point->getY())) {
throw new \InvalidArgumentException(
'Invalid key. Point is not on the curve.'
);
}
} | php | public static function ensureOnCurve($key)
{
$point = self::unserializePoint($key);
if (!static::curve()->contains($point->getX(), $point->getY())) {
throw new \InvalidArgumentException(
'Invalid key. Point is not on the curve.'
);
}
} | [
"public",
"static",
"function",
"ensureOnCurve",
"(",
"$",
"key",
")",
"{",
"$",
"point",
"=",
"self",
"::",
"unserializePoint",
"(",
"$",
"key",
")",
";",
"if",
"(",
"!",
"static",
"::",
"curve",
"(",
")",
"->",
"contains",
"(",
"$",
"point",
"->",
... | Is key on the secp256k1 curve.
@param string $key
@return bool | [
"Is",
"key",
"on",
"the",
"secp256k1",
"curve",
"."
] | dafea9ceac918c4c3cd9bc7c436009a95dfb1643 | https://github.com/decred/decred-php-api/blob/dafea9ceac918c4c3cd9bc7c436009a95dfb1643/src/Decred/Crypto/Curve.php#L101-L109 |
230,272 | milesj/admin | View/Helper/AdminHelper.php | AdminHelper.filterFields | public function filterFields(Model $model, $filter = array()) {
if (empty($filter) || $filter === '*') {
return $model->fields;
}
$fields = array();
foreach ($filter as $field) {
list($table, $field) = pluginSplit($field);
$fields[$field] = $model->... | php | public function filterFields(Model $model, $filter = array()) {
if (empty($filter) || $filter === '*') {
return $model->fields;
}
$fields = array();
foreach ($filter as $field) {
list($table, $field) = pluginSplit($field);
$fields[$field] = $model->... | [
"public",
"function",
"filterFields",
"(",
"Model",
"$",
"model",
",",
"$",
"filter",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"filter",
")",
"||",
"$",
"filter",
"===",
"'*'",
")",
"{",
"return",
"$",
"model",
"->",
"fields"... | Filter down fields if the association has a whitelist.
@param Model $model
@param array $filter
@return array|mixed | [
"Filter",
"down",
"fields",
"if",
"the",
"association",
"has",
"a",
"whitelist",
"."
] | e5e93823d1eb4415f05a3191f653eb50c296d2c6 | https://github.com/milesj/admin/blob/e5e93823d1eb4415f05a3191f653eb50c296d2c6/View/Helper/AdminHelper.php#L26-L40 |
230,273 | milesj/admin | View/Helper/AdminHelper.php | AdminHelper.getBehaviorCallbacks | public function getBehaviorCallbacks(Model $model) {
$callbacks = array();
$behaviors = Configure::read('Admin.behaviorCallbacks');
foreach ($behaviors as $behavior => $methods) {
if (!$model->Behaviors->loaded($behavior)) {
continue;
}
forea... | php | public function getBehaviorCallbacks(Model $model) {
$callbacks = array();
$behaviors = Configure::read('Admin.behaviorCallbacks');
foreach ($behaviors as $behavior => $methods) {
if (!$model->Behaviors->loaded($behavior)) {
continue;
}
forea... | [
"public",
"function",
"getBehaviorCallbacks",
"(",
"Model",
"$",
"model",
")",
"{",
"$",
"callbacks",
"=",
"array",
"(",
")",
";",
"$",
"behaviors",
"=",
"Configure",
"::",
"read",
"(",
"'Admin.behaviorCallbacks'",
")",
";",
"foreach",
"(",
"$",
"behaviors",... | Return a list of valid callbacks for the model + behaviors and logged in user.
@param Model $model
@return array | [
"Return",
"a",
"list",
"of",
"valid",
"callbacks",
"for",
"the",
"model",
"+",
"behaviors",
"and",
"logged",
"in",
"user",
"."
] | e5e93823d1eb4415f05a3191f653eb50c296d2c6 | https://github.com/milesj/admin/blob/e5e93823d1eb4415f05a3191f653eb50c296d2c6/View/Helper/AdminHelper.php#L48-L75 |
230,274 | milesj/admin | View/Helper/AdminHelper.php | AdminHelper.getDependencies | public function getDependencies(Model $model, $depth = 0) {
$dependencies = array();
if ($depth >= 5) {
return $dependencies;
}
foreach (array($model->hasOne, $model->hasMany, $model->hasAndBelongsToMany) as $assocGroup) {
foreach ($assocGroup as $alias => $asso... | php | public function getDependencies(Model $model, $depth = 0) {
$dependencies = array();
if ($depth >= 5) {
return $dependencies;
}
foreach (array($model->hasOne, $model->hasMany, $model->hasAndBelongsToMany) as $assocGroup) {
foreach ($assocGroup as $alias => $asso... | [
"public",
"function",
"getDependencies",
"(",
"Model",
"$",
"model",
",",
"$",
"depth",
"=",
"0",
")",
"{",
"$",
"dependencies",
"=",
"array",
"(",
")",
";",
"if",
"(",
"$",
"depth",
">=",
"5",
")",
"{",
"return",
"$",
"dependencies",
";",
"}",
"fo... | Generate a nested list of dependencies by looping and drilling down through all the model associations.
@param Model $model
@param int $depth
@return array | [
"Generate",
"a",
"nested",
"list",
"of",
"dependencies",
"by",
"looping",
"and",
"drilling",
"down",
"through",
"all",
"the",
"model",
"associations",
"."
] | e5e93823d1eb4415f05a3191f653eb50c296d2c6 | https://github.com/milesj/admin/blob/e5e93823d1eb4415f05a3191f653eb50c296d2c6/View/Helper/AdminHelper.php#L84-L114 |
230,275 | milesj/admin | View/Helper/AdminHelper.php | AdminHelper.getDisplayField | public function getDisplayField(Model $model, $result) {
$displayField = $result[$model->alias][$model->displayField];
if (!$displayField) {
$displayField = $this->Html->tag('span', '(' . __d('admin', 'No Title') . ')', array(
'class' => 'text-warning'
));
... | php | public function getDisplayField(Model $model, $result) {
$displayField = $result[$model->alias][$model->displayField];
if (!$displayField) {
$displayField = $this->Html->tag('span', '(' . __d('admin', 'No Title') . ')', array(
'class' => 'text-warning'
));
... | [
"public",
"function",
"getDisplayField",
"(",
"Model",
"$",
"model",
",",
"$",
"result",
")",
"{",
"$",
"displayField",
"=",
"$",
"result",
"[",
"$",
"model",
"->",
"alias",
"]",
"[",
"$",
"model",
"->",
"displayField",
"]",
";",
"if",
"(",
"!",
"$",... | Return the display field. If field does not exist, use the ID.
@param Model $model
@param array $result
@return string | [
"Return",
"the",
"display",
"field",
".",
"If",
"field",
"does",
"not",
"exist",
"use",
"the",
"ID",
"."
] | e5e93823d1eb4415f05a3191f653eb50c296d2c6 | https://github.com/milesj/admin/blob/e5e93823d1eb4415f05a3191f653eb50c296d2c6/View/Helper/AdminHelper.php#L123-L133 |
230,276 | milesj/admin | View/Helper/AdminHelper.php | AdminHelper.getModelCallbacks | public function getModelCallbacks(Model $model, $scope = '*') {
$callbacks = array();
$models = Configure::read('Admin.modelCallbacks');
if (isset($models[$model->qualifiedName])) {
foreach ($models[$model->qualifiedName] as $method => $options) {
if (is_string($opti... | php | public function getModelCallbacks(Model $model, $scope = '*') {
$callbacks = array();
$models = Configure::read('Admin.modelCallbacks');
if (isset($models[$model->qualifiedName])) {
foreach ($models[$model->qualifiedName] as $method => $options) {
if (is_string($opti... | [
"public",
"function",
"getModelCallbacks",
"(",
"Model",
"$",
"model",
",",
"$",
"scope",
"=",
"'*'",
")",
"{",
"$",
"callbacks",
"=",
"array",
"(",
")",
";",
"$",
"models",
"=",
"Configure",
"::",
"read",
"(",
"'Admin.modelCallbacks'",
")",
";",
"if",
... | Return a list of valid callbacks for the model and logged in user.
@param Model $model
@param string $scope
@return array | [
"Return",
"a",
"list",
"of",
"valid",
"callbacks",
"for",
"the",
"model",
"and",
"logged",
"in",
"user",
"."
] | e5e93823d1eb4415f05a3191f653eb50c296d2c6 | https://github.com/milesj/admin/blob/e5e93823d1eb4415f05a3191f653eb50c296d2c6/View/Helper/AdminHelper.php#L142-L165 |
230,277 | milesj/admin | View/Helper/AdminHelper.php | AdminHelper.getModelLinks | public function getModelLinks(Model $model) {
$models = Configure::read('Admin.modelLinks');
if (isset($models[$model->qualifiedName])) {
return $models[$model->qualifiedName];
}
return array();
} | php | public function getModelLinks(Model $model) {
$models = Configure::read('Admin.modelLinks');
if (isset($models[$model->qualifiedName])) {
return $models[$model->qualifiedName];
}
return array();
} | [
"public",
"function",
"getModelLinks",
"(",
"Model",
"$",
"model",
")",
"{",
"$",
"models",
"=",
"Configure",
"::",
"read",
"(",
"'Admin.modelLinks'",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"models",
"[",
"$",
"model",
"->",
"qualifiedName",
"]",
")",
... | Return a list of valid links for a record
@param Model $model
@return array | [
"Return",
"a",
"list",
"of",
"valid",
"links",
"for",
"a",
"record"
] | e5e93823d1eb4415f05a3191f653eb50c296d2c6 | https://github.com/milesj/admin/blob/e5e93823d1eb4415f05a3191f653eb50c296d2c6/View/Helper/AdminHelper.php#L173-L181 |
230,278 | milesj/admin | View/Helper/AdminHelper.php | AdminHelper.getNavigation | public function getNavigation() {
$plugins = Admin::getModels();
$navigation = array();
foreach ($plugins as $plugin) {
$models = array();
foreach ($plugin['models'] as $model) {
if ($model['installed']) {
$models[Inflector::humanize(... | php | public function getNavigation() {
$plugins = Admin::getModels();
$navigation = array();
foreach ($plugins as $plugin) {
$models = array();
foreach ($plugin['models'] as $model) {
if ($model['installed']) {
$models[Inflector::humanize(... | [
"public",
"function",
"getNavigation",
"(",
")",
"{",
"$",
"plugins",
"=",
"Admin",
"::",
"getModels",
"(",
")",
";",
"$",
"navigation",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"plugins",
"as",
"$",
"plugin",
")",
"{",
"$",
"models",
"=",
... | Return a list of models grouped by plugin, to use in the navigation menu.
@return array | [
"Return",
"a",
"list",
"of",
"models",
"grouped",
"by",
"plugin",
"to",
"use",
"in",
"the",
"navigation",
"menu",
"."
] | e5e93823d1eb4415f05a3191f653eb50c296d2c6 | https://github.com/milesj/admin/blob/e5e93823d1eb4415f05a3191f653eb50c296d2c6/View/Helper/AdminHelper.php#L188-L205 |
230,279 | milesj/admin | View/Helper/AdminHelper.php | AdminHelper.getUserRoute | public function getUserRoute($route, array $user) {
$route = Configure::read('User.routes.' . $route);
if (!$route) {
return null;
}
$route = (array) $route;
foreach ($route as &$value) {
if ($value === '{id}') {
$value = $user['id'];
... | php | public function getUserRoute($route, array $user) {
$route = Configure::read('User.routes.' . $route);
if (!$route) {
return null;
}
$route = (array) $route;
foreach ($route as &$value) {
if ($value === '{id}') {
$value = $user['id'];
... | [
"public",
"function",
"getUserRoute",
"(",
"$",
"route",
",",
"array",
"$",
"user",
")",
"{",
"$",
"route",
"=",
"Configure",
"::",
"read",
"(",
"'User.routes.'",
".",
"$",
"route",
")",
";",
"if",
"(",
"!",
"$",
"route",
")",
"{",
"return",
"null",
... | Return a parse user route.
@param string $route
@param array $user
@return string | [
"Return",
"a",
"parse",
"user",
"route",
"."
] | e5e93823d1eb4415f05a3191f653eb50c296d2c6 | https://github.com/milesj/admin/blob/e5e93823d1eb4415f05a3191f653eb50c296d2c6/View/Helper/AdminHelper.php#L214-L236 |
230,280 | milesj/admin | View/Helper/AdminHelper.php | AdminHelper.hasRole | public function hasRole($role) {
$roles = (array) $this->Session->read('Acl.roles');
if (is_numeric($role)) {
return isset($roles[$role]);
}
return in_array($role, $roles);
} | php | public function hasRole($role) {
$roles = (array) $this->Session->read('Acl.roles');
if (is_numeric($role)) {
return isset($roles[$role]);
}
return in_array($role, $roles);
} | [
"public",
"function",
"hasRole",
"(",
"$",
"role",
")",
"{",
"$",
"roles",
"=",
"(",
"array",
")",
"$",
"this",
"->",
"Session",
"->",
"read",
"(",
"'Acl.roles'",
")",
";",
"if",
"(",
"is_numeric",
"(",
"$",
"role",
")",
")",
"{",
"return",
"isset"... | Check to see if the user has a role.
@param int|string $role
@return bool | [
"Check",
"to",
"see",
"if",
"the",
"user",
"has",
"a",
"role",
"."
] | e5e93823d1eb4415f05a3191f653eb50c296d2c6 | https://github.com/milesj/admin/blob/e5e93823d1eb4415f05a3191f653eb50c296d2c6/View/Helper/AdminHelper.php#L257-L265 |
230,281 | milesj/admin | View/Helper/AdminHelper.php | AdminHelper.loopDependencies | public function loopDependencies($list, &$exclude = array()) {
if (!$list) {
return null;
}
$output = '';
foreach ($list as $dependent) {
if (in_array($dependent['model'], $exclude)) {
continue;
}
$exclude[] = $dependent[... | php | public function loopDependencies($list, &$exclude = array()) {
if (!$list) {
return null;
}
$output = '';
foreach ($list as $dependent) {
if (in_array($dependent['model'], $exclude)) {
continue;
}
$exclude[] = $dependent[... | [
"public",
"function",
"loopDependencies",
"(",
"$",
"list",
",",
"&",
"$",
"exclude",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"!",
"$",
"list",
")",
"{",
"return",
"null",
";",
"}",
"$",
"output",
"=",
"''",
";",
"foreach",
"(",
"$",
"list",... | Generate a nested list of deletion model dependencies.
@param array $list
@param array $exclude
@return string | [
"Generate",
"a",
"nested",
"list",
"of",
"deletion",
"model",
"dependencies",
"."
] | e5e93823d1eb4415f05a3191f653eb50c296d2c6 | https://github.com/milesj/admin/blob/e5e93823d1eb4415f05a3191f653eb50c296d2c6/View/Helper/AdminHelper.php#L302-L323 |
230,282 | milesj/admin | View/Helper/AdminHelper.php | AdminHelper.outputAssocName | public function outputAssocName($model, $alias, $className) {
$output = $this->outputIconTitle($model, $alias);
if ($className != $alias) {
$output .= sprintf(' (%s)',
$this->Html->tag('span', $className, array('class' => 'text-muted'))
);
}
retu... | php | public function outputAssocName($model, $alias, $className) {
$output = $this->outputIconTitle($model, $alias);
if ($className != $alias) {
$output .= sprintf(' (%s)',
$this->Html->tag('span', $className, array('class' => 'text-muted'))
);
}
retu... | [
"public",
"function",
"outputAssocName",
"(",
"$",
"model",
",",
"$",
"alias",
",",
"$",
"className",
")",
"{",
"$",
"output",
"=",
"$",
"this",
"->",
"outputIconTitle",
"(",
"$",
"model",
",",
"$",
"alias",
")",
";",
"if",
"(",
"$",
"className",
"!=... | Output an association alias and class name. If both are equal, only display the alias.
@param Model|array $model
@param string $alias
@param string $className
@return string | [
"Output",
"an",
"association",
"alias",
"and",
"class",
"name",
".",
"If",
"both",
"are",
"equal",
"only",
"display",
"the",
"alias",
"."
] | e5e93823d1eb4415f05a3191f653eb50c296d2c6 | https://github.com/milesj/admin/blob/e5e93823d1eb4415f05a3191f653eb50c296d2c6/View/Helper/AdminHelper.php#L360-L370 |
230,283 | milesj/admin | View/Helper/AdminHelper.php | AdminHelper.outputIconTitle | public function outputIconTitle($model, $title = null) {
if ($model instanceof Model) {
$model = $model->admin;
}
if (!$title && isset($model['title'])) {
$title = $model['title'];
}
if ($model['iconClass']) {
$title = $this->Html->tag('span'... | php | public function outputIconTitle($model, $title = null) {
if ($model instanceof Model) {
$model = $model->admin;
}
if (!$title && isset($model['title'])) {
$title = $model['title'];
}
if ($model['iconClass']) {
$title = $this->Html->tag('span'... | [
"public",
"function",
"outputIconTitle",
"(",
"$",
"model",
",",
"$",
"title",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"model",
"instanceof",
"Model",
")",
"{",
"$",
"model",
"=",
"$",
"model",
"->",
"admin",
";",
"}",
"if",
"(",
"!",
"$",
"title",
... | Output a model title and icon if applicable.
@param Model|array $model
@param string $title
@return string | [
"Output",
"a",
"model",
"title",
"and",
"icon",
"if",
"applicable",
"."
] | e5e93823d1eb4415f05a3191f653eb50c296d2c6 | https://github.com/milesj/admin/blob/e5e93823d1eb4415f05a3191f653eb50c296d2c6/View/Helper/AdminHelper.php#L379-L395 |
230,284 | milesj/admin | View/Helper/AdminHelper.php | AdminHelper.setBreadcrumbs | public function setBreadcrumbs(Model $model, $result, $action) {
list($plugin, $alias) = pluginSplit($model->qualifiedName);
$this->Breadcrumb->add($plugin, array('controller' => 'admin', 'action' => 'index', '#' => Inflector::underscore($plugin)));
$this->Breadcrumb->add($model->pluralName, ar... | php | public function setBreadcrumbs(Model $model, $result, $action) {
list($plugin, $alias) = pluginSplit($model->qualifiedName);
$this->Breadcrumb->add($plugin, array('controller' => 'admin', 'action' => 'index', '#' => Inflector::underscore($plugin)));
$this->Breadcrumb->add($model->pluralName, ar... | [
"public",
"function",
"setBreadcrumbs",
"(",
"Model",
"$",
"model",
",",
"$",
"result",
",",
"$",
"action",
")",
"{",
"list",
"(",
"$",
"plugin",
",",
"$",
"alias",
")",
"=",
"pluginSplit",
"(",
"$",
"model",
"->",
"qualifiedName",
")",
";",
"$",
"th... | Set the breadcrumbs for the respective model and action.
@param Model $model
@param array $result
@param string $action | [
"Set",
"the",
"breadcrumbs",
"for",
"the",
"respective",
"model",
"and",
"action",
"."
] | e5e93823d1eb4415f05a3191f653eb50c296d2c6 | https://github.com/milesj/admin/blob/e5e93823d1eb4415f05a3191f653eb50c296d2c6/View/Helper/AdminHelper.php#L404-L427 |
230,285 | Webiny/Framework | src/Webiny/Component/Image/ImageTrait.php | ImageTrait.image | public function image($image, $storage = 'local')
{
if ($image instanceof File) {
return ImageLoader::load($image->getContents());
} else {
if (!($storage instanceof Storage)) {
$storage = ServiceManager::getInstance()->getService('Storage.' . $storage);
... | php | public function image($image, $storage = 'local')
{
if ($image instanceof File) {
return ImageLoader::load($image->getContents());
} else {
if (!($storage instanceof Storage)) {
$storage = ServiceManager::getInstance()->getService('Storage.' . $storage);
... | [
"public",
"function",
"image",
"(",
"$",
"image",
",",
"$",
"storage",
"=",
"'local'",
")",
"{",
"if",
"(",
"$",
"image",
"instanceof",
"File",
")",
"{",
"return",
"ImageLoader",
"::",
"load",
"(",
"$",
"image",
"->",
"getContents",
"(",
")",
")",
";... | Loads the image and returns an instance of Image class.
@param string|File $image This can either be image file name that corresponds to File $key parameter,
or it can be an instance of Webiny\Component\Storage\File\File.
@param string|Storage $storage This can either be the name of the storag... | [
"Loads",
"the",
"image",
"and",
"returns",
"an",
"instance",
"of",
"Image",
"class",
"."
] | 2ca7fb238999387e54a1eea8c5cb4735de9022a7 | https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/Image/ImageTrait.php#L34-L47 |
230,286 | Webiny/Framework | src/Webiny/Component/StdLib/ComponentTrait.php | ComponentTrait.getConfig | public static function getConfig()
{
if (!is_object(self::$componentConfig)) {
$config = [];
// check if we have default config
if (isset(self::$defaultConfig)) {
$config = self::$defaultConfig;
}
self::$componentConfig = new Confi... | php | public static function getConfig()
{
if (!is_object(self::$componentConfig)) {
$config = [];
// check if we have default config
if (isset(self::$defaultConfig)) {
$config = self::$defaultConfig;
}
self::$componentConfig = new Confi... | [
"public",
"static",
"function",
"getConfig",
"(",
")",
"{",
"if",
"(",
"!",
"is_object",
"(",
"self",
"::",
"$",
"componentConfig",
")",
")",
"{",
"$",
"config",
"=",
"[",
"]",
";",
"// check if we have default config",
"if",
"(",
"isset",
"(",
"self",
"... | Returns the current component configuration.
@return ConfigObject | [
"Returns",
"the",
"current",
"component",
"configuration",
"."
] | 2ca7fb238999387e54a1eea8c5cb4735de9022a7 | https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/StdLib/ComponentTrait.php#L94-L107 |
230,287 | Webiny/Framework | src/Webiny/Component/Bootstrap/Bootstrap.php | Bootstrap.runApplication | public function runApplication($appPath = '')
{
if ($appPath != '') {
$rootPath = $appPath;
} else {
$rootPath = realpath(dirname(debug_backtrace()[0]['file']) . '/../');
}
// save the root path
$this->absolutePath = realpath($rootPath) . DIRECTORY_SE... | php | public function runApplication($appPath = '')
{
if ($appPath != '') {
$rootPath = $appPath;
} else {
$rootPath = realpath(dirname(debug_backtrace()[0]['file']) . '/../');
}
// save the root path
$this->absolutePath = realpath($rootPath) . DIRECTORY_SE... | [
"public",
"function",
"runApplication",
"(",
"$",
"appPath",
"=",
"''",
")",
"{",
"if",
"(",
"$",
"appPath",
"!=",
"''",
")",
"{",
"$",
"rootPath",
"=",
"$",
"appPath",
";",
"}",
"else",
"{",
"$",
"rootPath",
"=",
"realpath",
"(",
"dirname",
"(",
"... | Initializes the environment and the router.
Router takes the process from there.
@param string $appPath Path to the application root.
@throws BootstrapException
@throws \Exception | [
"Initializes",
"the",
"environment",
"and",
"the",
"router",
".",
"Router",
"takes",
"the",
"process",
"from",
"there",
"."
] | 2ca7fb238999387e54a1eea8c5cb4735de9022a7 | https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/Bootstrap/Bootstrap.php#L46-L58 |
230,288 | Webiny/Framework | src/Webiny/Component/Bootstrap/Bootstrap.php | Bootstrap.initializeEnvironment | public function initializeEnvironment($appPath)
{
try {
// initialize the environment and its configurations
$this->environment = Environment::getInstance();
$this->environment->initializeEnvironment($appPath);
} catch (BootstrapException $e) {
throw $... | php | public function initializeEnvironment($appPath)
{
try {
// initialize the environment and its configurations
$this->environment = Environment::getInstance();
$this->environment->initializeEnvironment($appPath);
} catch (BootstrapException $e) {
throw $... | [
"public",
"function",
"initializeEnvironment",
"(",
"$",
"appPath",
")",
"{",
"try",
"{",
"// initialize the environment and its configurations",
"$",
"this",
"->",
"environment",
"=",
"Environment",
"::",
"getInstance",
"(",
")",
";",
"$",
"this",
"->",
"environmen... | Initializes the application environment.
@param string $appPath Path to the application root.
@throws BootstrapException
@throws \Exception | [
"Initializes",
"the",
"application",
"environment",
"."
] | 2ca7fb238999387e54a1eea8c5cb4735de9022a7 | https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/Bootstrap/Bootstrap.php#L68-L77 |
230,289 | Webiny/Framework | src/Webiny/Component/Bootstrap/Bootstrap.php | Bootstrap.initializeRouter | public function initializeRouter()
{
try {
// initialize router
$this->router = Router::getInstance();
// if a route is matched, a dispatcher instance is returned, and the callback is issued
$this->router->initializeRouter()->issueCallback();
} catch ... | php | public function initializeRouter()
{
try {
// initialize router
$this->router = Router::getInstance();
// if a route is matched, a dispatcher instance is returned, and the callback is issued
$this->router->initializeRouter()->issueCallback();
} catch ... | [
"public",
"function",
"initializeRouter",
"(",
")",
"{",
"try",
"{",
"// initialize router",
"$",
"this",
"->",
"router",
"=",
"Router",
"::",
"getInstance",
"(",
")",
";",
"// if a route is matched, a dispatcher instance is returned, and the callback is issued",
"$",
"th... | Initializes the router.
@throws BootstrapException
@throws \Exception | [
"Initializes",
"the",
"router",
"."
] | 2ca7fb238999387e54a1eea8c5cb4735de9022a7 | https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/Bootstrap/Bootstrap.php#L85-L96 |
230,290 | Webiny/Framework | src/Webiny/Component/Mailer/Bridge/SwiftMailer/Transport.php | Transport.setDecorators | public function setDecorators(array $replacements)
{
$wrapper = $this->config->get('Decorators.Wrapper');
if ($wrapper) {
foreach ($replacements as $email => $vars) {
$decorators = [];
foreach ($vars as $key => $value) {
$key = $wrapper... | php | public function setDecorators(array $replacements)
{
$wrapper = $this->config->get('Decorators.Wrapper');
if ($wrapper) {
foreach ($replacements as $email => $vars) {
$decorators = [];
foreach ($vars as $key => $value) {
$key = $wrapper... | [
"public",
"function",
"setDecorators",
"(",
"array",
"$",
"replacements",
")",
"{",
"$",
"wrapper",
"=",
"$",
"this",
"->",
"config",
"->",
"get",
"(",
"'Decorators.Wrapper'",
")",
";",
"if",
"(",
"$",
"wrapper",
")",
"{",
"foreach",
"(",
"$",
"replaceme... | Decorators are arrays that contain keys and values. The message body and subject will be scanned for the keys,
and, where found, the key will be replaced with the value.
@param array $replacements Array [email=> [key1=>value1, key2=>value2], email2=>[...]].
@return $this | [
"Decorators",
"are",
"arrays",
"that",
"contain",
"keys",
"and",
"values",
".",
"The",
"message",
"body",
"and",
"subject",
"will",
"be",
"scanned",
"for",
"the",
"keys",
"and",
"where",
"found",
"the",
"key",
"will",
"be",
"replaced",
"with",
"the",
"valu... | 2ca7fb238999387e54a1eea8c5cb4735de9022a7 | https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/Mailer/Bridge/SwiftMailer/Transport.php#L109-L127 |
230,291 | deanblackborough/zf3-view-helpers | src/Bootstrap4Card.php | Bootstrap4Card.elementClasses | private function elementClasses(string $element) : string
{
if (in_array($element, $this->elements) === true) {
$class = '';
if (count($this->classes[$element]) > 0) {
$class = ' ' . implode(' ', $this->classes[$element]);
}
return $class;
... | php | private function elementClasses(string $element) : string
{
if (in_array($element, $this->elements) === true) {
$class = '';
if (count($this->classes[$element]) > 0) {
$class = ' ' . implode(' ', $this->classes[$element]);
}
return $class;
... | [
"private",
"function",
"elementClasses",
"(",
"string",
"$",
"element",
")",
":",
"string",
"{",
"if",
"(",
"in_array",
"(",
"$",
"element",
",",
"$",
"this",
"->",
"elements",
")",
"===",
"true",
")",
"{",
"$",
"class",
"=",
"''",
";",
"if",
"(",
... | Fetch the classes assigned to the given element
@param string $element [card|body|header|footer]
@return string | [
"Fetch",
"the",
"classes",
"assigned",
"to",
"the",
"given",
"element"
] | db8bea4ca62709b2ac8c732aedbb2a5235223f23 | https://github.com/deanblackborough/zf3-view-helpers/blob/db8bea4ca62709b2ac8c732aedbb2a5235223f23/src/Bootstrap4Card.php#L132-L145 |
230,292 | deanblackborough/zf3-view-helpers | src/Bootstrap4Card.php | Bootstrap4Card.elementBodyClasses | private function elementBodyClasses(string $element) : string
{
if (in_array($element, $this->body_elements) === true) {
$class = '';
if (count($this->body_classes[$element]) > 0) {
if (array_key_exists($element, $this->body_classes_first) === false) {
... | php | private function elementBodyClasses(string $element) : string
{
if (in_array($element, $this->body_elements) === true) {
$class = '';
if (count($this->body_classes[$element]) > 0) {
if (array_key_exists($element, $this->body_classes_first) === false) {
... | [
"private",
"function",
"elementBodyClasses",
"(",
"string",
"$",
"element",
")",
":",
"string",
"{",
"if",
"(",
"in_array",
"(",
"$",
"element",
",",
"$",
"this",
"->",
"body_elements",
")",
"===",
"true",
")",
"{",
"$",
"class",
"=",
"''",
";",
"if",
... | Fetch the classes assigned to the given body element type
@param string $element [title|subtitle|text|link]
@return string | [
"Fetch",
"the",
"classes",
"assigned",
"to",
"the",
"given",
"body",
"element",
"type"
] | db8bea4ca62709b2ac8c732aedbb2a5235223f23 | https://github.com/deanblackborough/zf3-view-helpers/blob/db8bea4ca62709b2ac8c732aedbb2a5235223f23/src/Bootstrap4Card.php#L154-L181 |
230,293 | deanblackborough/zf3-view-helpers | src/Bootstrap4Card.php | Bootstrap4Card.elementAttr | private function elementAttr(string $element) : string
{
if (in_array($element, $this->elements) === true) {
$attr = '';
if (count($this->attr[$element]) > 0) {
$attr = ' style="' . implode(' ', $this->attr[$element]) . '"';
}
return $attr;
... | php | private function elementAttr(string $element) : string
{
if (in_array($element, $this->elements) === true) {
$attr = '';
if (count($this->attr[$element]) > 0) {
$attr = ' style="' . implode(' ', $this->attr[$element]) . '"';
}
return $attr;
... | [
"private",
"function",
"elementAttr",
"(",
"string",
"$",
"element",
")",
":",
"string",
"{",
"if",
"(",
"in_array",
"(",
"$",
"element",
",",
"$",
"this",
"->",
"elements",
")",
"===",
"true",
")",
"{",
"$",
"attr",
"=",
"''",
";",
"if",
"(",
"cou... | Fetch the attributes assigned to the given element
@param string $element [card|body|header|footer]
@return string | [
"Fetch",
"the",
"attributes",
"assigned",
"to",
"the",
"given",
"element"
] | db8bea4ca62709b2ac8c732aedbb2a5235223f23 | https://github.com/deanblackborough/zf3-view-helpers/blob/db8bea4ca62709b2ac8c732aedbb2a5235223f23/src/Bootstrap4Card.php#L190-L203 |
230,294 | deanblackborough/zf3-view-helpers | src/Bootstrap4Card.php | Bootstrap4Card.elementBodyAttr | private function elementBodyAttr(string $element) : string
{
if (in_array($element, $this->body_elements) === true) {
$attr = '';
if (count($this->body_attr[$element]) > 0) {
if (array_key_exists($element, $this->body_attr_first) === false) {
$att... | php | private function elementBodyAttr(string $element) : string
{
if (in_array($element, $this->body_elements) === true) {
$attr = '';
if (count($this->body_attr[$element]) > 0) {
if (array_key_exists($element, $this->body_attr_first) === false) {
$att... | [
"private",
"function",
"elementBodyAttr",
"(",
"string",
"$",
"element",
")",
":",
"string",
"{",
"if",
"(",
"in_array",
"(",
"$",
"element",
",",
"$",
"this",
"->",
"body_elements",
")",
"===",
"true",
")",
"{",
"$",
"attr",
"=",
"''",
";",
"if",
"(... | Fetch the attributes assigned to the given body element type
@param string $element [title|subtitle|text|link]
@return string | [
"Fetch",
"the",
"attributes",
"assigned",
"to",
"the",
"given",
"body",
"element",
"type"
] | db8bea4ca62709b2ac8c732aedbb2a5235223f23 | https://github.com/deanblackborough/zf3-view-helpers/blob/db8bea4ca62709b2ac8c732aedbb2a5235223f23/src/Bootstrap4Card.php#L212-L240 |
230,295 | deanblackborough/zf3-view-helpers | src/Bootstrap4Card.php | Bootstrap4Card.cardBody | private function cardBody() : string
{
if (count($this->body_sections) === 0) {
if ($this->body !== null) {
$body = $this->body;
} else {
$body = '<p>No card body content defined, no calls to setBody() or setBodyContent().</p>';
}
}... | php | private function cardBody() : string
{
if (count($this->body_sections) === 0) {
if ($this->body !== null) {
$body = $this->body;
} else {
$body = '<p>No card body content defined, no calls to setBody() or setBodyContent().</p>';
}
}... | [
"private",
"function",
"cardBody",
"(",
")",
":",
"string",
"{",
"if",
"(",
"count",
"(",
"$",
"this",
"->",
"body_sections",
")",
"===",
"0",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"body",
"!==",
"null",
")",
"{",
"$",
"body",
"=",
"$",
"this",... | Generate the card body, checks to see if any section have been defined first, if not, check
for a complete body
@return string | [
"Generate",
"the",
"card",
"body",
"checks",
"to",
"see",
"if",
"any",
"section",
"have",
"been",
"defined",
"first",
"if",
"not",
"check",
"for",
"a",
"complete",
"body"
] | db8bea4ca62709b2ac8c732aedbb2a5235223f23 | https://github.com/deanblackborough/zf3-view-helpers/blob/db8bea4ca62709b2ac8c732aedbb2a5235223f23/src/Bootstrap4Card.php#L248-L262 |
230,296 | deanblackborough/zf3-view-helpers | src/Bootstrap4Card.php | Bootstrap4Card.cardBodyHtml | private function cardBodyHtml() : string
{
$html = '';
foreach ($this->body_sections as $section) {
switch ($section['type']) {
case 'title':
$html .= '<' . $section['tag'] . ' class="card-title' .
$this->elementBodyClasses('ti... | php | private function cardBodyHtml() : string
{
$html = '';
foreach ($this->body_sections as $section) {
switch ($section['type']) {
case 'title':
$html .= '<' . $section['tag'] . ' class="card-title' .
$this->elementBodyClasses('ti... | [
"private",
"function",
"cardBodyHtml",
"(",
")",
":",
"string",
"{",
"$",
"html",
"=",
"''",
";",
"foreach",
"(",
"$",
"this",
"->",
"body_sections",
"as",
"$",
"section",
")",
"{",
"switch",
"(",
"$",
"section",
"[",
"'type'",
"]",
")",
"{",
"case",... | Generate and return the body content HTML by looping through the set body sections
@return string | [
"Generate",
"and",
"return",
"the",
"body",
"content",
"HTML",
"by",
"looping",
"through",
"the",
"set",
"body",
"sections"
] | db8bea4ca62709b2ac8c732aedbb2a5235223f23 | https://github.com/deanblackborough/zf3-view-helpers/blob/db8bea4ca62709b2ac8c732aedbb2a5235223f23/src/Bootstrap4Card.php#L269-L307 |
230,297 | deanblackborough/zf3-view-helpers | src/Bootstrap4Card.php | Bootstrap4Card.cardHeader | private function cardHeader() : string
{
$html = '';
if ($this->header !== null) {
$html .= '<div class="card-header' . $this->elementAttr('header') .
'"' . $this->elementAttr('header') . '>' . $this->header . '</div>';
}
return $html;
} | php | private function cardHeader() : string
{
$html = '';
if ($this->header !== null) {
$html .= '<div class="card-header' . $this->elementAttr('header') .
'"' . $this->elementAttr('header') . '>' . $this->header . '</div>';
}
return $html;
} | [
"private",
"function",
"cardHeader",
"(",
")",
":",
"string",
"{",
"$",
"html",
"=",
"''",
";",
"if",
"(",
"$",
"this",
"->",
"header",
"!==",
"null",
")",
"{",
"$",
"html",
".=",
"'<div class=\"card-header'",
".",
"$",
"this",
"->",
"elementAttr",
"("... | Generate the card header
@return string | [
"Generate",
"the",
"card",
"header"
] | db8bea4ca62709b2ac8c732aedbb2a5235223f23 | https://github.com/deanblackborough/zf3-view-helpers/blob/db8bea4ca62709b2ac8c732aedbb2a5235223f23/src/Bootstrap4Card.php#L314-L324 |
230,298 | deanblackborough/zf3-view-helpers | src/Bootstrap4Card.php | Bootstrap4Card.cardFooter | private function cardFooter() : string
{
$html = '';
if ($this->footer !== null) {
$html .= '<div class="card-footer' . $this->elementAttr('footer') .
'"' . $this->elementAttr('header') . '>' . $this->footer . '</div>';
}
return $html;
} | php | private function cardFooter() : string
{
$html = '';
if ($this->footer !== null) {
$html .= '<div class="card-footer' . $this->elementAttr('footer') .
'"' . $this->elementAttr('header') . '>' . $this->footer . '</div>';
}
return $html;
} | [
"private",
"function",
"cardFooter",
"(",
")",
":",
"string",
"{",
"$",
"html",
"=",
"''",
";",
"if",
"(",
"$",
"this",
"->",
"footer",
"!==",
"null",
")",
"{",
"$",
"html",
".=",
"'<div class=\"card-footer'",
".",
"$",
"this",
"->",
"elementAttr",
"("... | Generate the card footer
@return string | [
"Generate",
"the",
"card",
"footer"
] | db8bea4ca62709b2ac8c732aedbb2a5235223f23 | https://github.com/deanblackborough/zf3-view-helpers/blob/db8bea4ca62709b2ac8c732aedbb2a5235223f23/src/Bootstrap4Card.php#L331-L341 |
230,299 | deanblackborough/zf3-view-helpers | src/Bootstrap4Card.php | Bootstrap4Card.addCustomClass | public function addCustomClass(string $class, string $element) : Bootstrap4Card
{
if (in_array($element, $this->elements) === true) {
$this->classes[$element][] = $class;
}
return $this;
} | php | public function addCustomClass(string $class, string $element) : Bootstrap4Card
{
if (in_array($element, $this->elements) === true) {
$this->classes[$element][] = $class;
}
return $this;
} | [
"public",
"function",
"addCustomClass",
"(",
"string",
"$",
"class",
",",
"string",
"$",
"element",
")",
":",
"Bootstrap4Card",
"{",
"if",
"(",
"in_array",
"(",
"$",
"element",
",",
"$",
"this",
"->",
"elements",
")",
"===",
"true",
")",
"{",
"$",
"thi... | Add a custom class to a card element
Silently errors, if the element is invalid the attribute is not assigned to the classes array
@param string $class Class to assign to element
@param string $element Element to attach the class to [card|body|header|footer]
@return Bootstrap4Card | [
"Add",
"a",
"custom",
"class",
"to",
"a",
"card",
"element"
] | db8bea4ca62709b2ac8c732aedbb2a5235223f23 | https://github.com/deanblackborough/zf3-view-helpers/blob/db8bea4ca62709b2ac8c732aedbb2a5235223f23/src/Bootstrap4Card.php#L369-L376 |
Subsets and Splits
Yii Code Samples
Gathers all records from test, train, and validation sets that contain the word 'yii', providing a basic filtered view of the dataset relevant to Yii-related content.