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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
202,300 | Kris-Kuiper/sFire-Framework | src/DB/Driver/MySQLi/TableGateway.php | TableGateway.rows | public function rows($column = '*', $where = null, $params = []) {
if(null === $this -> getAdapter()) {
return trigger_error(sprintf('No database adapter was set in "%s"', __METHOD__), E_USER_ERROR);
}
if(false === is_string($column)) {
return trigger_error(sprintf('Argument 1 passed to %s() must b... | php | public function rows($column = '*', $where = null, $params = []) {
if(null === $this -> getAdapter()) {
return trigger_error(sprintf('No database adapter was set in "%s"', __METHOD__), E_USER_ERROR);
}
if(false === is_string($column)) {
return trigger_error(sprintf('Argument 1 passed to %s() must b... | [
"public",
"function",
"rows",
"(",
"$",
"column",
"=",
"'*'",
",",
"$",
"where",
"=",
"null",
",",
"$",
"params",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"getAdapter",
"(",
")",
")",
"{",
"return",
"trigger_error",
"... | Retrieve the number of rows
@param string $column
@param string $where
@param array $params
@return int|boolean | [
"Retrieve",
"the",
"number",
"of",
"rows"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/DB/Driver/MySQLi/TableGateway.php#L82-L122 |
202,301 | Kris-Kuiper/sFire-Framework | src/DB/Driver/MySQLi/TableGateway.php | TableGateway.call | public function call($function, $params) {
if(null === $this -> getAdapter()) {
return trigger_error(sprintf('No database adapter was set in "%s"', __METHOD__), E_USER_ERROR);
}
if(null !== $function && false === is_string($function)) {
return trigger_error(sprintf('Argument 1 passed to %s() must b... | php | public function call($function, $params) {
if(null === $this -> getAdapter()) {
return trigger_error(sprintf('No database adapter was set in "%s"', __METHOD__), E_USER_ERROR);
}
if(null !== $function && false === is_string($function)) {
return trigger_error(sprintf('Argument 1 passed to %s() must b... | [
"public",
"function",
"call",
"(",
"$",
"function",
",",
"$",
"params",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"getAdapter",
"(",
")",
")",
"{",
"return",
"trigger_error",
"(",
"sprintf",
"(",
"'No database adapter was set in \"%s\"'",
",",
... | Call stored procedure
@param string $function
@param array $params
@return boolean | [
"Call",
"stored",
"procedure"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/DB/Driver/MySQLi/TableGateway.php#L319-L337 |
202,302 | Kris-Kuiper/sFire-Framework | src/DB/Driver/MySQLi/TableGateway.php | TableGateway.select | public function select($query, $params = [], $type = null) {
$type = $type === null ? $this -> getEntityNamespace($this -> getTable()) : $type;
if(null === $this -> getAdapter()) {
return trigger_error(sprintf('No database adapter was set in "%s"', __METHOD__), E_USER_ERROR);
}
return new Result... | php | public function select($query, $params = [], $type = null) {
$type = $type === null ? $this -> getEntityNamespace($this -> getTable()) : $type;
if(null === $this -> getAdapter()) {
return trigger_error(sprintf('No database adapter was set in "%s"', __METHOD__), E_USER_ERROR);
}
return new Result... | [
"public",
"function",
"select",
"(",
"$",
"query",
",",
"$",
"params",
"=",
"[",
"]",
",",
"$",
"type",
"=",
"null",
")",
"{",
"$",
"type",
"=",
"$",
"type",
"===",
"null",
"?",
"$",
"this",
"->",
"getEntityNamespace",
"(",
"$",
"this",
"->",
"ge... | Execute select statement and returns a ResultSet
@param string $query
@param array $params
@param boolean $toEntity
@return sFire\Adapter\MySQL\ResultSet | [
"Execute",
"select",
"statement",
"and",
"returns",
"a",
"ResultSet"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/DB/Driver/MySQLi/TableGateway.php#L347-L356 |
202,303 | Kris-Kuiper/sFire-Framework | src/DB/Driver/MySQLi/TableGateway.php | TableGateway.getEntityNamespace | private function getEntityNamespace($table) {
if(false === is_string($table)) {
return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($table)), E_USER_ERROR);
}
$path = $this -> getNamespace($this, ['directory', 'dbtable'], ['directory', '... | php | private function getEntityNamespace($table) {
if(false === is_string($table)) {
return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($table)), E_USER_ERROR);
}
$path = $this -> getNamespace($this, ['directory', 'dbtable'], ['directory', '... | [
"private",
"function",
"getEntityNamespace",
"(",
"$",
"table",
")",
"{",
"if",
"(",
"false",
"===",
"is_string",
"(",
"$",
"table",
")",
")",
"{",
"return",
"trigger_error",
"(",
"sprintf",
"(",
"'Argument 1 passed to %s() must be of the type string, \"%s\" given'",
... | Loads entity table name
@param string $table
@return string | [
"Loads",
"entity",
"table",
"name"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/DB/Driver/MySQLi/TableGateway.php#L399-L409 |
202,304 | Kris-Kuiper/sFire-Framework | src/Form/Types/Selectrange.php | Selectrange.range | public function range($min, $max, $steps = 1, $round = 0) {
if(false === is_numeric($min)) {
return trigger_error(sprintf('Argument 1 passed to %s() must be of the type float or integer, "%s" given', __METHOD__, gettype($min)), E_USER_ERROR);
}
if(false === is_numeric($max)) ... | php | public function range($min, $max, $steps = 1, $round = 0) {
if(false === is_numeric($min)) {
return trigger_error(sprintf('Argument 1 passed to %s() must be of the type float or integer, "%s" given', __METHOD__, gettype($min)), E_USER_ERROR);
}
if(false === is_numeric($max)) ... | [
"public",
"function",
"range",
"(",
"$",
"min",
",",
"$",
"max",
",",
"$",
"steps",
"=",
"1",
",",
"$",
"round",
"=",
"0",
")",
"{",
"if",
"(",
"false",
"===",
"is_numeric",
"(",
"$",
"min",
")",
")",
"{",
"return",
"trigger_error",
"(",
"sprintf... | Set the min. and max. number to iterate. The min will increase by the steps and can be formatted with the round parameter
@param float $min
@param float $max
@param float $steps
@param int $round
@return sFire\Form\Types\Selectrange | [
"Set",
"the",
"min",
".",
"and",
"max",
".",
"number",
"to",
"iterate",
".",
"The",
"min",
"will",
"increase",
"by",
"the",
"steps",
"and",
"can",
"be",
"formatted",
"with",
"the",
"round",
"parameter"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/Form/Types/Selectrange.php#L54-L78 |
202,305 | sergeymakinen/tests | src/Util/ExtensionTrait.php | ExtensionTrait.getProperty | protected function getProperty($object, $name)
{
$class = new \ReflectionClass($object);
while (!$class->hasProperty($name)) {
$class = $class->getParentClass();
}
return $class->getProperty($name);
} | php | protected function getProperty($object, $name)
{
$class = new \ReflectionClass($object);
while (!$class->hasProperty($name)) {
$class = $class->getParentClass();
}
return $class->getProperty($name);
} | [
"protected",
"function",
"getProperty",
"(",
"$",
"object",
",",
"$",
"name",
")",
"{",
"$",
"class",
"=",
"new",
"\\",
"ReflectionClass",
"(",
"$",
"object",
")",
";",
"while",
"(",
"!",
"$",
"class",
"->",
"hasProperty",
"(",
"$",
"name",
")",
")",... | Returns the reflected property.
@param object|string $object
@param string $name
@return \ReflectionProperty | [
"Returns",
"the",
"reflected",
"property",
"."
] | 6ad901d0caaa76cd1d891e10c1218654c0178bed | https://github.com/sergeymakinen/tests/blob/6ad901d0caaa76cd1d891e10c1218654c0178bed/src/Util/ExtensionTrait.php#L21-L28 |
202,306 | hiqsol-attic/composer-extension-plugin | src/Plugin.php | Plugin.onPostAutoloadDump | public function onPostAutoloadDump(Event $event)
{
$this->io->writeError('<info>Generating extensions files</info>');
foreach ($this->getPackages() as $package) {
if ($package instanceof \Composer\Package\CompletePackageInterface) {
$this->processPackage($package);
... | php | public function onPostAutoloadDump(Event $event)
{
$this->io->writeError('<info>Generating extensions files</info>');
foreach ($this->getPackages() as $package) {
if ($package instanceof \Composer\Package\CompletePackageInterface) {
$this->processPackage($package);
... | [
"public",
"function",
"onPostAutoloadDump",
"(",
"Event",
"$",
"event",
")",
"{",
"$",
"this",
"->",
"io",
"->",
"writeError",
"(",
"'<info>Generating extensions files</info>'",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"getPackages",
"(",
")",
"as",
"$",
... | Simply rewrites extensions file from scratch.
@param Event $event | [
"Simply",
"rewrites",
"extensions",
"file",
"from",
"scratch",
"."
] | 3e4a5384ca368f43debe277c606846e4299d2bf4 | https://github.com/hiqsol-attic/composer-extension-plugin/blob/3e4a5384ca368f43debe277c606846e4299d2bf4/src/Plugin.php#L103-L116 |
202,307 | hiqsol-attic/composer-extension-plugin | src/Plugin.php | Plugin.processPackage | public function processPackage(PackageInterface $package)
{
$extra = $package->getExtra();
$files = isset($extra[self::EXTRA_OPTION_NAME]) ? $extra[self::EXTRA_OPTION_NAME] : null;
if ($package->getType() !== self::PACKAGE_TYPE && is_null($files)) {
return;
}
$ex... | php | public function processPackage(PackageInterface $package)
{
$extra = $package->getExtra();
$files = isset($extra[self::EXTRA_OPTION_NAME]) ? $extra[self::EXTRA_OPTION_NAME] : null;
if ($package->getType() !== self::PACKAGE_TYPE && is_null($files)) {
return;
}
$ex... | [
"public",
"function",
"processPackage",
"(",
"PackageInterface",
"$",
"package",
")",
"{",
"$",
"extra",
"=",
"$",
"package",
"->",
"getExtra",
"(",
")",
";",
"$",
"files",
"=",
"isset",
"(",
"$",
"extra",
"[",
"self",
"::",
"EXTRA_OPTION_NAME",
"]",
")"... | Scans the given package and collects extensions data.
@param PackageInterface $package | [
"Scans",
"the",
"given",
"package",
"and",
"collects",
"extensions",
"data",
"."
] | 3e4a5384ca368f43debe277c606846e4299d2bf4 | https://github.com/hiqsol-attic/composer-extension-plugin/blob/3e4a5384ca368f43debe277c606846e4299d2bf4/src/Plugin.php#L142-L176 |
202,308 | hiqsol-attic/composer-extension-plugin | src/Plugin.php | Plugin.readExtensionConfig | protected function readExtensionConfig(PackageInterface $package, $file)
{
$path = $this->preparePath($package, $file);
if (!file_exists($path)) {
$this->io->writeError('<error>Non existent extension config file</error> ' . $file . ' in ' . $package->getName());
exit(1);
... | php | protected function readExtensionConfig(PackageInterface $package, $file)
{
$path = $this->preparePath($package, $file);
if (!file_exists($path)) {
$this->io->writeError('<error>Non existent extension config file</error> ' . $file . ' in ' . $package->getName());
exit(1);
... | [
"protected",
"function",
"readExtensionConfig",
"(",
"PackageInterface",
"$",
"package",
",",
"$",
"file",
")",
"{",
"$",
"path",
"=",
"$",
"this",
"->",
"preparePath",
"(",
"$",
"package",
",",
"$",
"file",
")",
";",
"if",
"(",
"!",
"file_exists",
"(",
... | Read extra config.
@param string $file
@return array | [
"Read",
"extra",
"config",
"."
] | 3e4a5384ca368f43debe277c606846e4299d2bf4 | https://github.com/hiqsol-attic/composer-extension-plugin/blob/3e4a5384ca368f43debe277c606846e4299d2bf4/src/Plugin.php#L183-L191 |
202,309 | cmsgears/module-community | common/models/resources/GroupMessage.php | GroupMessage.getGroup | public function getGroup() {
$groupTable = CmnTables::getTableName( CmnTables::TABLE_GROUP );
return $this->hasOne( Group::class, [ 'id' => 'groupId' ] )->from( "$groupTable group" );
} | php | public function getGroup() {
$groupTable = CmnTables::getTableName( CmnTables::TABLE_GROUP );
return $this->hasOne( Group::class, [ 'id' => 'groupId' ] )->from( "$groupTable group" );
} | [
"public",
"function",
"getGroup",
"(",
")",
"{",
"$",
"groupTable",
"=",
"CmnTables",
"::",
"getTableName",
"(",
"CmnTables",
"::",
"TABLE_GROUP",
")",
";",
"return",
"$",
"this",
"->",
"hasOne",
"(",
"Group",
"::",
"class",
",",
"[",
"'id'",
"=>",
"'gro... | Returns the corresponding group.
@return \cmsgears\community\common\models\entities\Group | [
"Returns",
"the",
"corresponding",
"group",
"."
] | 0ca9cf0aa0cee395a4788bd6085f291e10728555 | https://github.com/cmsgears/module-community/blob/0ca9cf0aa0cee395a4788bd6085f291e10728555/common/models/resources/GroupMessage.php#L194-L199 |
202,310 | jenskooij/cloudcontrol | src/storage/storage/ValuelistsStorage.php | ValuelistsStorage.saveValuelist | public function saveValuelist($slug, $postValues)
{
$valuelistObject = ValuelistFactory::createValuelistFromPostValues($postValues);
$valuelists = $this->repository->valuelists;
foreach ($valuelists as $key => $valuelist) {
if ($valuelist->slug == $slug) {
$value... | php | public function saveValuelist($slug, $postValues)
{
$valuelistObject = ValuelistFactory::createValuelistFromPostValues($postValues);
$valuelists = $this->repository->valuelists;
foreach ($valuelists as $key => $valuelist) {
if ($valuelist->slug == $slug) {
$value... | [
"public",
"function",
"saveValuelist",
"(",
"$",
"slug",
",",
"$",
"postValues",
")",
"{",
"$",
"valuelistObject",
"=",
"ValuelistFactory",
"::",
"createValuelistFromPostValues",
"(",
"$",
"postValues",
")",
";",
"$",
"valuelists",
"=",
"$",
"this",
"->",
"rep... | Save changes to a valuelist
@param $slug
@param $postValues
@throws \Exception | [
"Save",
"changes",
"to",
"a",
"valuelist"
] | 76e5d9ac8f9c50d06d39a995d13cc03742536548 | https://github.com/jenskooij/cloudcontrol/blob/76e5d9ac8f9c50d06d39a995d13cc03742536548/src/storage/storage/ValuelistsStorage.php#L47-L59 |
202,311 | jenskooij/cloudcontrol | src/storage/storage/ValuelistsStorage.php | ValuelistsStorage.getValuelistBySlug | public function getValuelistBySlug($slug)
{
$valuelists = $this->repository->valuelists;
foreach ($valuelists as $valuelist) {
if ($valuelist->slug == $slug) {
return $valuelist;
}
}
return null;
} | php | public function getValuelistBySlug($slug)
{
$valuelists = $this->repository->valuelists;
foreach ($valuelists as $valuelist) {
if ($valuelist->slug == $slug) {
return $valuelist;
}
}
return null;
} | [
"public",
"function",
"getValuelistBySlug",
"(",
"$",
"slug",
")",
"{",
"$",
"valuelists",
"=",
"$",
"this",
"->",
"repository",
"->",
"valuelists",
";",
"foreach",
"(",
"$",
"valuelists",
"as",
"$",
"valuelist",
")",
"{",
"if",
"(",
"$",
"valuelist",
"-... | Get a valuelist by its slug
@param $slug
@return \stdClass | [
"Get",
"a",
"valuelist",
"by",
"its",
"slug"
] | 76e5d9ac8f9c50d06d39a995d13cc03742536548 | https://github.com/jenskooij/cloudcontrol/blob/76e5d9ac8f9c50d06d39a995d13cc03742536548/src/storage/storage/ValuelistsStorage.php#L68-L78 |
202,312 | devlabmtl/haven-security | Controller/LoginController.php | LoginController.resetConfirmationAction | public function resetConfirmationAction($uuid) {
$em = $this->container->get("doctrine")->getEntityManager();
$request = $this->container->get("request");
$confirm_data = $request->get("haven_bundle_securitybundle_confirmtype");
$user_reset = $em->getRepository("HavenSecurityBundle:UserR... | php | public function resetConfirmationAction($uuid) {
$em = $this->container->get("doctrine")->getEntityManager();
$request = $this->container->get("request");
$confirm_data = $request->get("haven_bundle_securitybundle_confirmtype");
$user_reset = $em->getRepository("HavenSecurityBundle:UserR... | [
"public",
"function",
"resetConfirmationAction",
"(",
"$",
"uuid",
")",
"{",
"$",
"em",
"=",
"$",
"this",
"->",
"container",
"->",
"get",
"(",
"\"doctrine\"",
")",
"->",
"getEntityManager",
"(",
")",
";",
"$",
"request",
"=",
"$",
"this",
"->",
"containe... | reset confirmation by the user
@Route("/{_locale}/auth/confirmation/{uuid}")
@Template() | [
"reset",
"confirmation",
"by",
"the",
"user"
] | 8e53d57e3d5680e97ad8c0b9f37d34e8e478ce10 | https://github.com/devlabmtl/haven-security/blob/8e53d57e3d5680e97ad8c0b9f37d34e8e478ce10/Controller/LoginController.php#L212-L246 |
202,313 | boo1ean/shared | src/Shared/Storage.php | Storage.get | public function get($key, $default = null) {
$this->check();
$value = $this->readValue($key);
return is_null($value) ? $default : $value;
} | php | public function get($key, $default = null) {
$this->check();
$value = $this->readValue($key);
return is_null($value) ? $default : $value;
} | [
"public",
"function",
"get",
"(",
"$",
"key",
",",
"$",
"default",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"check",
"(",
")",
";",
"$",
"value",
"=",
"$",
"this",
"->",
"readValue",
"(",
"$",
"key",
")",
";",
"return",
"is_null",
"(",
"$",
"v... | Get value from storage
@param string $key
@return mixed | [
"Get",
"value",
"from",
"storage"
] | 92c6309a9af21e280179b4de161dbe74bc764f22 | https://github.com/boo1ean/shared/blob/92c6309a9af21e280179b4de161dbe74bc764f22/src/Shared/Storage.php#L89-L93 |
202,314 | boo1ean/shared | src/Shared/Storage.php | Storage.has | public function has($key) {
$this->check();
$data = $this->readData();
return isset($data[$key]);
} | php | public function has($key) {
$this->check();
$data = $this->readData();
return isset($data[$key]);
} | [
"public",
"function",
"has",
"(",
"$",
"key",
")",
"{",
"$",
"this",
"->",
"check",
"(",
")",
";",
"$",
"data",
"=",
"$",
"this",
"->",
"readData",
"(",
")",
";",
"return",
"isset",
"(",
"$",
"data",
"[",
"$",
"key",
"]",
")",
";",
"}"
] | Check if storage has given key
@return bool | [
"Check",
"if",
"storage",
"has",
"given",
"key"
] | 92c6309a9af21e280179b4de161dbe74bc764f22 | https://github.com/boo1ean/shared/blob/92c6309a9af21e280179b4de161dbe74bc764f22/src/Shared/Storage.php#L118-L122 |
202,315 | boo1ean/shared | src/Shared/Storage.php | Storage.destroy | public function destroy() {
if (false === shmop_delete($this->shm)) {
throw new RuntimeException(sprintf('Unable to destroy shared memory segment id: %s', $this->shm));
}
$this->destroyed = true;
} | php | public function destroy() {
if (false === shmop_delete($this->shm)) {
throw new RuntimeException(sprintf('Unable to destroy shared memory segment id: %s', $this->shm));
}
$this->destroyed = true;
} | [
"public",
"function",
"destroy",
"(",
")",
"{",
"if",
"(",
"false",
"===",
"shmop_delete",
"(",
"$",
"this",
"->",
"shm",
")",
")",
"{",
"throw",
"new",
"RuntimeException",
"(",
"sprintf",
"(",
"'Unable to destroy shared memory segment id: %s'",
",",
"$",
"thi... | Destroy shared memory segment
@throws RuntimeException | [
"Destroy",
"shared",
"memory",
"segment"
] | 92c6309a9af21e280179b4de161dbe74bc764f22 | https://github.com/boo1ean/shared/blob/92c6309a9af21e280179b4de161dbe74bc764f22/src/Shared/Storage.php#L136-L142 |
202,316 | boo1ean/shared | src/Shared/Storage.php | Storage.setupSegment | protected function setupSegment() {
// Attempt to open shm segment
$this->shm = @shmop_open($this->getIdentifier(), self::SHM_OPEN_MODE, 0, 0);
// If segment doesn't exist init new segment
if (false === $this->shm) {
$this->createSegment();
}
} | php | protected function setupSegment() {
// Attempt to open shm segment
$this->shm = @shmop_open($this->getIdentifier(), self::SHM_OPEN_MODE, 0, 0);
// If segment doesn't exist init new segment
if (false === $this->shm) {
$this->createSegment();
}
} | [
"protected",
"function",
"setupSegment",
"(",
")",
"{",
"// Attempt to open shm segment",
"$",
"this",
"->",
"shm",
"=",
"@",
"shmop_open",
"(",
"$",
"this",
"->",
"getIdentifier",
"(",
")",
",",
"self",
"::",
"SHM_OPEN_MODE",
",",
"0",
",",
"0",
")",
";",... | Create or open shared memory segment using current key | [
"Create",
"or",
"open",
"shared",
"memory",
"segment",
"using",
"current",
"key"
] | 92c6309a9af21e280179b4de161dbe74bc764f22 | https://github.com/boo1ean/shared/blob/92c6309a9af21e280179b4de161dbe74bc764f22/src/Shared/Storage.php#L157-L165 |
202,317 | boo1ean/shared | src/Shared/Storage.php | Storage.createSegment | protected function createSegment() {
$this->shm = shmop_open(
$this->getIdentifier(),
self::SHM_CREATE_MODE,
self::SHM_CREATE_PERMISSIONS,
$this->size
);
if (false === $this->shm) {
throw new RuntimeException(sprintf('Unable to create shared memory segment with key: %s', $this->getIdentifier()));
... | php | protected function createSegment() {
$this->shm = shmop_open(
$this->getIdentifier(),
self::SHM_CREATE_MODE,
self::SHM_CREATE_PERMISSIONS,
$this->size
);
if (false === $this->shm) {
throw new RuntimeException(sprintf('Unable to create shared memory segment with key: %s', $this->getIdentifier()));
... | [
"protected",
"function",
"createSegment",
"(",
")",
"{",
"$",
"this",
"->",
"shm",
"=",
"shmop_open",
"(",
"$",
"this",
"->",
"getIdentifier",
"(",
")",
",",
"self",
"::",
"SHM_CREATE_MODE",
",",
"self",
"::",
"SHM_CREATE_PERMISSIONS",
",",
"$",
"this",
"-... | Create new shm segment and write base meta data | [
"Create",
"new",
"shm",
"segment",
"and",
"write",
"base",
"meta",
"data"
] | 92c6309a9af21e280179b4de161dbe74bc764f22 | https://github.com/boo1ean/shared/blob/92c6309a9af21e280179b4de161dbe74bc764f22/src/Shared/Storage.php#L170-L183 |
202,318 | boo1ean/shared | src/Shared/Storage.php | Storage.updateSize | protected function updateSize($size) {
$size = sprintf('%' . self::SHM_DATA_OFFSET . 'd', intval($size));
return !!$this->write(0, $size);
} | php | protected function updateSize($size) {
$size = sprintf('%' . self::SHM_DATA_OFFSET . 'd', intval($size));
return !!$this->write(0, $size);
} | [
"protected",
"function",
"updateSize",
"(",
"$",
"size",
")",
"{",
"$",
"size",
"=",
"sprintf",
"(",
"'%'",
".",
"self",
"::",
"SHM_DATA_OFFSET",
".",
"'d'",
",",
"intval",
"(",
"$",
"size",
")",
")",
";",
"return",
"!",
"!",
"$",
"this",
"->",
"wr... | Update size field
@param int size | [
"Update",
"size",
"field"
] | 92c6309a9af21e280179b4de161dbe74bc764f22 | https://github.com/boo1ean/shared/blob/92c6309a9af21e280179b4de161dbe74bc764f22/src/Shared/Storage.php#L189-L192 |
202,319 | boo1ean/shared | src/Shared/Storage.php | Storage.writeValue | protected function writeValue($key, $value) {
$data = $this->readData();
$data[$key] = $this->encode($value);
if ($this->writeData($data)) {
return $value;
}
return false;
} | php | protected function writeValue($key, $value) {
$data = $this->readData();
$data[$key] = $this->encode($value);
if ($this->writeData($data)) {
return $value;
}
return false;
} | [
"protected",
"function",
"writeValue",
"(",
"$",
"key",
",",
"$",
"value",
")",
"{",
"$",
"data",
"=",
"$",
"this",
"->",
"readData",
"(",
")",
";",
"$",
"data",
"[",
"$",
"key",
"]",
"=",
"$",
"this",
"->",
"encode",
"(",
"$",
"value",
")",
";... | Write value to shm segment
@param string $key
@param string $value | [
"Write",
"value",
"to",
"shm",
"segment"
] | 92c6309a9af21e280179b4de161dbe74bc764f22 | https://github.com/boo1ean/shared/blob/92c6309a9af21e280179b4de161dbe74bc764f22/src/Shared/Storage.php#L207-L216 |
202,320 | boo1ean/shared | src/Shared/Storage.php | Storage.unsetValue | protected function unsetValue($key) {
$data = $this->readData();
unset($data[$key]);
return $this->writeData($data);
} | php | protected function unsetValue($key) {
$data = $this->readData();
unset($data[$key]);
return $this->writeData($data);
} | [
"protected",
"function",
"unsetValue",
"(",
"$",
"key",
")",
"{",
"$",
"data",
"=",
"$",
"this",
"->",
"readData",
"(",
")",
";",
"unset",
"(",
"$",
"data",
"[",
"$",
"key",
"]",
")",
";",
"return",
"$",
"this",
"->",
"writeData",
"(",
"$",
"data... | Removes item from storage
@param string $key | [
"Removes",
"item",
"from",
"storage"
] | 92c6309a9af21e280179b4de161dbe74bc764f22 | https://github.com/boo1ean/shared/blob/92c6309a9af21e280179b4de161dbe74bc764f22/src/Shared/Storage.php#L222-L226 |
202,321 | boo1ean/shared | src/Shared/Storage.php | Storage.readValue | protected function readValue($key) {
$data = $this->readData();
return isset($data[$key]) ? $this->decode($data[$key]) : null;
} | php | protected function readValue($key) {
$data = $this->readData();
return isset($data[$key]) ? $this->decode($data[$key]) : null;
} | [
"protected",
"function",
"readValue",
"(",
"$",
"key",
")",
"{",
"$",
"data",
"=",
"$",
"this",
"->",
"readData",
"(",
")",
";",
"return",
"isset",
"(",
"$",
"data",
"[",
"$",
"key",
"]",
")",
"?",
"$",
"this",
"->",
"decode",
"(",
"$",
"data",
... | Read value from shm segment
@param string key
@return string | null if field doesn't exist | [
"Read",
"value",
"from",
"shm",
"segment"
] | 92c6309a9af21e280179b4de161dbe74bc764f22 | https://github.com/boo1ean/shared/blob/92c6309a9af21e280179b4de161dbe74bc764f22/src/Shared/Storage.php#L233-L236 |
202,322 | boo1ean/shared | src/Shared/Storage.php | Storage.writeData | protected function writeData(array $data) {
$size = $this->write(self::SHM_DATA_OFFSET, json_encode($data));
return $this->updateSize($size);
} | php | protected function writeData(array $data) {
$size = $this->write(self::SHM_DATA_OFFSET, json_encode($data));
return $this->updateSize($size);
} | [
"protected",
"function",
"writeData",
"(",
"array",
"$",
"data",
")",
"{",
"$",
"size",
"=",
"$",
"this",
"->",
"write",
"(",
"self",
"::",
"SHM_DATA_OFFSET",
",",
"json_encode",
"(",
"$",
"data",
")",
")",
";",
"return",
"$",
"this",
"->",
"updateSize... | Write data to shm segment
@param array $data | [
"Write",
"data",
"to",
"shm",
"segment"
] | 92c6309a9af21e280179b4de161dbe74bc764f22 | https://github.com/boo1ean/shared/blob/92c6309a9af21e280179b4de161dbe74bc764f22/src/Shared/Storage.php#L242-L245 |
202,323 | boo1ean/shared | src/Shared/Storage.php | Storage.readData | protected function readData() {
$used = $this->readSize();
return 0 === $used ? array() : json_decode($this->read(self::SHM_DATA_OFFSET, $used), true);
} | php | protected function readData() {
$used = $this->readSize();
return 0 === $used ? array() : json_decode($this->read(self::SHM_DATA_OFFSET, $used), true);
} | [
"protected",
"function",
"readData",
"(",
")",
"{",
"$",
"used",
"=",
"$",
"this",
"->",
"readSize",
"(",
")",
";",
"return",
"0",
"===",
"$",
"used",
"?",
"array",
"(",
")",
":",
"json_decode",
"(",
"$",
"this",
"->",
"read",
"(",
"self",
"::",
... | Read data from shm segment
@param string $key
@return string | [
"Read",
"data",
"from",
"shm",
"segment"
] | 92c6309a9af21e280179b4de161dbe74bc764f22 | https://github.com/boo1ean/shared/blob/92c6309a9af21e280179b4de161dbe74bc764f22/src/Shared/Storage.php#L252-L255 |
202,324 | boo1ean/shared | src/Shared/Storage.php | Storage.encode | protected function encode($val) {
switch (true) {
case is_array($val):
return self::T_ARRAY . json_encode($val);
case is_int($val):
return self::T_INT . $val;
case is_bool($val):
return self::T_BOOLEAN . $val;
case is_float($val):
return self::T_DOUBLE . $val;
case is_object($val):
... | php | protected function encode($val) {
switch (true) {
case is_array($val):
return self::T_ARRAY . json_encode($val);
case is_int($val):
return self::T_INT . $val;
case is_bool($val):
return self::T_BOOLEAN . $val;
case is_float($val):
return self::T_DOUBLE . $val;
case is_object($val):
... | [
"protected",
"function",
"encode",
"(",
"$",
"val",
")",
"{",
"switch",
"(",
"true",
")",
"{",
"case",
"is_array",
"(",
"$",
"val",
")",
":",
"return",
"self",
"::",
"T_ARRAY",
".",
"json_encode",
"(",
"$",
"val",
")",
";",
"case",
"is_int",
"(",
"... | Serialize value with type prefix
@param mixed $value
@return string encoded value | [
"Serialize",
"value",
"with",
"type",
"prefix"
] | 92c6309a9af21e280179b4de161dbe74bc764f22 | https://github.com/boo1ean/shared/blob/92c6309a9af21e280179b4de161dbe74bc764f22/src/Shared/Storage.php#L282-L297 |
202,325 | boo1ean/shared | src/Shared/Storage.php | Storage.decode | protected function decode($encoded) {
$val = substr($encoded, 1);
switch ($encoded[0]) {
case self::T_ARRAY:
return json_decode($val, true);
case self::T_INT:
return intval($val);
case self::T_BOOLEAN:
return !!$val;
case self::T_DOUBLE:
return floatval($val);
case self::T_OBJECT:
... | php | protected function decode($encoded) {
$val = substr($encoded, 1);
switch ($encoded[0]) {
case self::T_ARRAY:
return json_decode($val, true);
case self::T_INT:
return intval($val);
case self::T_BOOLEAN:
return !!$val;
case self::T_DOUBLE:
return floatval($val);
case self::T_OBJECT:
... | [
"protected",
"function",
"decode",
"(",
"$",
"encoded",
")",
"{",
"$",
"val",
"=",
"substr",
"(",
"$",
"encoded",
",",
"1",
")",
";",
"switch",
"(",
"$",
"encoded",
"[",
"0",
"]",
")",
"{",
"case",
"self",
"::",
"T_ARRAY",
":",
"return",
"json_deco... | Unserialize value from storage
@param string $encoded
@return mixed | [
"Unserialize",
"value",
"from",
"storage"
] | 92c6309a9af21e280179b4de161dbe74bc764f22 | https://github.com/boo1ean/shared/blob/92c6309a9af21e280179b4de161dbe74bc764f22/src/Shared/Storage.php#L304-L320 |
202,326 | lasallecms/lasallecms-l5-shortmessageservice-pkg | src/Twilio/UseTwilio.php | UseTwilio.getTwilioConfig | public function getTwilioConfig($connection='twilio')
{
$twilioconfig = config('twilio.twilio');
$configSettings = [];
$configSettings['sid'] = $twilioconfig['connections'][$connection]['sid'];
$configSettings['token'] = $twilioconfig['conne... | php | public function getTwilioConfig($connection='twilio')
{
$twilioconfig = config('twilio.twilio');
$configSettings = [];
$configSettings['sid'] = $twilioconfig['connections'][$connection]['sid'];
$configSettings['token'] = $twilioconfig['conne... | [
"public",
"function",
"getTwilioConfig",
"(",
"$",
"connection",
"=",
"'twilio'",
")",
"{",
"$",
"twilioconfig",
"=",
"config",
"(",
"'twilio.twilio'",
")",
";",
"$",
"configSettings",
"=",
"[",
"]",
";",
"$",
"configSettings",
"[",
"'sid'",
"]",
"=",
"$",... | Get the Twilio config settings from the laravel-twilio package
@param string $conection The connection to fetch. Can have multiple Twilio connections in the config.
@return array | [
"Get",
"the",
"Twilio",
"config",
"settings",
"from",
"the",
"laravel",
"-",
"twilio",
"package"
] | 0562046af8f60a80947bada451fde2f0859b3812 | https://github.com/lasallecms/lasallecms-l5-shortmessageservice-pkg/blob/0562046af8f60a80947bada451fde2f0859b3812/src/Twilio/UseTwilio.php#L100-L110 |
202,327 | kaiohken1982/Watermarker | src/Watermarker/Watermarker/Watermarker.php | Watermarker.watermarkDimensionCoords | public function watermarkDimensionCoords()
{
$watermarkInfo = $this->getWatermarkInfo();
$imageInfo = $this->getImageInfo();
switch ($this->getType()) :
case self::WATERMARK_TYPE_FULLWIDTH:
default:
$resizedWatermarkWidth = number_format($imageInfo['width'], 0, ',', '');
... | php | public function watermarkDimensionCoords()
{
$watermarkInfo = $this->getWatermarkInfo();
$imageInfo = $this->getImageInfo();
switch ($this->getType()) :
case self::WATERMARK_TYPE_FULLWIDTH:
default:
$resizedWatermarkWidth = number_format($imageInfo['width'], 0, ',', '');
... | [
"public",
"function",
"watermarkDimensionCoords",
"(",
")",
"{",
"$",
"watermarkInfo",
"=",
"$",
"this",
"->",
"getWatermarkInfo",
"(",
")",
";",
"$",
"imageInfo",
"=",
"$",
"this",
"->",
"getImageInfo",
"(",
")",
";",
"switch",
"(",
"$",
"this",
"->",
"... | Get watermark type dimension from a type
@param array
@param array
@param int
@return array | [
"Get",
"watermark",
"type",
"dimension",
"from",
"a",
"type"
] | 95b14bbcd0d7b070070b3c1730360445bc52788c | https://github.com/kaiohken1982/Watermarker/blob/95b14bbcd0d7b070070b3c1730360445bc52788c/src/Watermarker/Watermarker/Watermarker.php#L297-L315 |
202,328 | kaiohken1982/Watermarker | src/Watermarker/Watermarker/Watermarker.php | Watermarker.setWatermarkTmpDir | public function setWatermarkTmpDir($watermarkTmpDir)
{
$watermarkTmpDirCopy = $watermarkTmpDir;
$watermarkTmpDir = realpath($watermarkTmpDir);
// If the provided tmpDir is empty throw exception
if (empty($watermarkTmpDir)) {
throw new \RuntimeException("Watermar... | php | public function setWatermarkTmpDir($watermarkTmpDir)
{
$watermarkTmpDirCopy = $watermarkTmpDir;
$watermarkTmpDir = realpath($watermarkTmpDir);
// If the provided tmpDir is empty throw exception
if (empty($watermarkTmpDir)) {
throw new \RuntimeException("Watermar... | [
"public",
"function",
"setWatermarkTmpDir",
"(",
"$",
"watermarkTmpDir",
")",
"{",
"$",
"watermarkTmpDirCopy",
"=",
"$",
"watermarkTmpDir",
";",
"$",
"watermarkTmpDir",
"=",
"realpath",
"(",
"$",
"watermarkTmpDir",
")",
";",
"// If the provided tmpDir is empty throw exc... | Set the watermark directory
@param string
@throws \RuntimeException
@return \Watermarker\Watermarker\Watermarker | [
"Set",
"the",
"watermark",
"directory"
] | 95b14bbcd0d7b070070b3c1730360445bc52788c | https://github.com/kaiohken1982/Watermarker/blob/95b14bbcd0d7b070070b3c1730360445bc52788c/src/Watermarker/Watermarker/Watermarker.php#L324-L341 |
202,329 | linguisticteam/json-ld | src/Generators/schema_org.php | Thing.check_type | private function check_type(){
$this_class = new \ReflectionClass( $this );
$type = $this_class->getShortName();
if ($type == 'Thing') {
$type = $this->get_type();
unset($this->type);
}
if(!is_null($this->realType)){
$type = $this->realType;
... | php | private function check_type(){
$this_class = new \ReflectionClass( $this );
$type = $this_class->getShortName();
if ($type == 'Thing') {
$type = $this->get_type();
unset($this->type);
}
if(!is_null($this->realType)){
$type = $this->realType;
... | [
"private",
"function",
"check_type",
"(",
")",
"{",
"$",
"this_class",
"=",
"new",
"\\",
"ReflectionClass",
"(",
"$",
"this",
")",
";",
"$",
"type",
"=",
"$",
"this_class",
"->",
"getShortName",
"(",
")",
";",
"if",
"(",
"$",
"type",
"==",
"'Thing'",
... | In most cases, the name of the object withing json-ld markup will be the class name.
Sometimes though we create a custom object on the fly with an array of properties, but we can't have
the object appear as a "Thing" so we have to set the type manually.
When classes are extended by implementing code, the namespace mi... | [
"In",
"most",
"cases",
"the",
"name",
"of",
"the",
"object",
"withing",
"json",
"-",
"ld",
"markup",
"will",
"be",
"the",
"class",
"name",
"."
] | 354fd518aff5fa52635f435888056fe0bd926566 | https://github.com/linguisticteam/json-ld/blob/354fd518aff5fa52635f435888056fe0bd926566/src/Generators/schema_org.php#L87-L101 |
202,330 | linguisticteam/json-ld | src/Generators/schema_org.php | Thing.format | public function format()
{
$result = array();
$result["@type"] = $this->check_type();
$values = array_filter( get_object_vars( $this ) );
foreach ($values as $key => $value) {
if ($value instanceof ICanBecomeJSONLD) {
$formatted = $value->fo... | php | public function format()
{
$result = array();
$result["@type"] = $this->check_type();
$values = array_filter( get_object_vars( $this ) );
foreach ($values as $key => $value) {
if ($value instanceof ICanBecomeJSONLD) {
$formatted = $value->fo... | [
"public",
"function",
"format",
"(",
")",
"{",
"$",
"result",
"=",
"array",
"(",
")",
";",
"$",
"result",
"[",
"\"@type\"",
"]",
"=",
"$",
"this",
"->",
"check_type",
"(",
")",
";",
"$",
"values",
"=",
"array_filter",
"(",
"get_object_vars",
"(",
"$"... | Creates an array of schema.org attribute ready to be json encoded.
Grabs all properties from the class and uses those that aren't empty.
@return array | [
"Creates",
"an",
"array",
"of",
"schema",
".",
"org",
"attribute",
"ready",
"to",
"be",
"json",
"encoded",
"."
] | 354fd518aff5fa52635f435888056fe0bd926566 | https://github.com/linguisticteam/json-ld/blob/354fd518aff5fa52635f435888056fe0bd926566/src/Generators/schema_org.php#L111-L130 |
202,331 | linguisticteam/json-ld | src/Generators/schema_org.php | Thing.addPotentialAction | protected function addPotentialAction()
{
$class = static::$helper->get_search_action_type();
if (class_exists( $class )) {
$class_test = new \ReflectionClass( $class );
if ($class_test->implementsInterface( 'Lti\Seo\Generators\ICanSearch' )) {
$this->potentia... | php | protected function addPotentialAction()
{
$class = static::$helper->get_search_action_type();
if (class_exists( $class )) {
$class_test = new \ReflectionClass( $class );
if ($class_test->implementsInterface( 'Lti\Seo\Generators\ICanSearch' )) {
$this->potentia... | [
"protected",
"function",
"addPotentialAction",
"(",
")",
"{",
"$",
"class",
"=",
"static",
"::",
"$",
"helper",
"->",
"get_search_action_type",
"(",
")",
";",
"if",
"(",
"class_exists",
"(",
"$",
"class",
")",
")",
"{",
"$",
"class_test",
"=",
"new",
"\\... | Adds a search potential action if the website supports it. | [
"Adds",
"a",
"search",
"potential",
"action",
"if",
"the",
"website",
"supports",
"it",
"."
] | 354fd518aff5fa52635f435888056fe0bd926566 | https://github.com/linguisticteam/json-ld/blob/354fd518aff5fa52635f435888056fe0bd926566/src/Generators/schema_org.php#L135-L144 |
202,332 | Xsaven/laravel-intelect-admin | src/Addons/GoogleTranslate/Tokens/GoogleTokenGenerator.php | GoogleTokenGenerator.charCodeAt | private function charCodeAt($str, $index)
{
$char = mb_substr($str, $index, 1, 'UTF-8');
if (mb_check_encoding($char, 'UTF-8')) {
$ret = mb_convert_encoding($char, 'UTF-32BE', 'UTF-8');
$result = hexdec(bin2hex($ret));
return $result;
}
return;
... | php | private function charCodeAt($str, $index)
{
$char = mb_substr($str, $index, 1, 'UTF-8');
if (mb_check_encoding($char, 'UTF-8')) {
$ret = mb_convert_encoding($char, 'UTF-32BE', 'UTF-8');
$result = hexdec(bin2hex($ret));
return $result;
}
return;
... | [
"private",
"function",
"charCodeAt",
"(",
"$",
"str",
",",
"$",
"index",
")",
"{",
"$",
"char",
"=",
"mb_substr",
"(",
"$",
"str",
",",
"$",
"index",
",",
"1",
",",
"'UTF-8'",
")",
";",
"if",
"(",
"mb_check_encoding",
"(",
"$",
"char",
",",
"'UTF-8... | Get the Unicode of the character at the specified index in a string.
@param string $str
@param int $index
@return null|number | [
"Get",
"the",
"Unicode",
"of",
"the",
"character",
"at",
"the",
"specified",
"index",
"in",
"a",
"string",
"."
] | 592574633d12c74cf25b43dd6694fee496abefcb | https://github.com/Xsaven/laravel-intelect-admin/blob/592574633d12c74cf25b43dd6694fee496abefcb/src/Addons/GoogleTranslate/Tokens/GoogleTokenGenerator.php#L148-L159 |
202,333 | koolkode/context | src/Bind/Binding.php | Binding.getTarget | public function getTarget()
{
if($this->to === NULL && $this->options | self::TYPE_IMPLEMENTATION)
{
return $this->typeName;
}
return $this->to;
} | php | public function getTarget()
{
if($this->to === NULL && $this->options | self::TYPE_IMPLEMENTATION)
{
return $this->typeName;
}
return $this->to;
} | [
"public",
"function",
"getTarget",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"to",
"===",
"NULL",
"&&",
"$",
"this",
"->",
"options",
"|",
"self",
"::",
"TYPE_IMPLEMENTATION",
")",
"{",
"return",
"$",
"this",
"->",
"typeName",
";",
"}",
"return",
... | Get the target of this binding, eighter a string or a closure.
@return mixed | [
"Get",
"the",
"target",
"of",
"this",
"binding",
"eighter",
"a",
"string",
"or",
"a",
"closure",
"."
] | f4aa614eb4ca1080bd89c7a2a54c9467c5b17a36 | https://github.com/koolkode/context/blob/f4aa614eb4ca1080bd89c7a2a54c9467c5b17a36/src/Bind/Binding.php#L108-L116 |
202,334 | koolkode/context | src/Bind/Binding.php | Binding.getMarkers | public function getMarkers($marker = NULL)
{
if($marker !== NULL && $this->markers !== NULL)
{
$result = [];
foreach($this->markers as $check)
{
if($check instanceof $marker)
{
$result[] = $check;
}
}
return $result;
}
return (array)$this->markers;
} | php | public function getMarkers($marker = NULL)
{
if($marker !== NULL && $this->markers !== NULL)
{
$result = [];
foreach($this->markers as $check)
{
if($check instanceof $marker)
{
$result[] = $check;
}
}
return $result;
}
return (array)$this->markers;
} | [
"public",
"function",
"getMarkers",
"(",
"$",
"marker",
"=",
"NULL",
")",
"{",
"if",
"(",
"$",
"marker",
"!==",
"NULL",
"&&",
"$",
"this",
"->",
"markers",
"!==",
"NULL",
")",
"{",
"$",
"result",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"... | Get all markers being set for this binding.
@param string $marker The type of marker to be considerd.
@return array<Marker> | [
"Get",
"all",
"markers",
"being",
"set",
"for",
"this",
"binding",
"."
] | f4aa614eb4ca1080bd89c7a2a54c9467c5b17a36 | https://github.com/koolkode/context/blob/f4aa614eb4ca1080bd89c7a2a54c9467c5b17a36/src/Bind/Binding.php#L124-L142 |
202,335 | koolkode/context | src/Bind/Binding.php | Binding.toAlias | public function toAlias($typeName)
{
$this->options = self::TYPE_ALIAS;
$this->to = (string)$typeName;
return $this;
} | php | public function toAlias($typeName)
{
$this->options = self::TYPE_ALIAS;
$this->to = (string)$typeName;
return $this;
} | [
"public",
"function",
"toAlias",
"(",
"$",
"typeName",
")",
"{",
"$",
"this",
"->",
"options",
"=",
"self",
"::",
"TYPE_ALIAS",
";",
"$",
"this",
"->",
"to",
"=",
"(",
"string",
")",
"$",
"typeName",
";",
"return",
"$",
"this",
";",
"}"
] | Bind to another binding specified by name.
@param string $typeName
@return Binding | [
"Bind",
"to",
"another",
"binding",
"specified",
"by",
"name",
"."
] | f4aa614eb4ca1080bd89c7a2a54c9467c5b17a36 | https://github.com/koolkode/context/blob/f4aa614eb4ca1080bd89c7a2a54c9467c5b17a36/src/Bind/Binding.php#L195-L201 |
202,336 | koolkode/context | src/Bind/Binding.php | Binding.scoped | public function scoped(Scope $scope)
{
if($scope instanceof Dependent)
{
$this->scope = NULL;
}
else
{
$this->scope = get_class($scope);
}
return $this;
} | php | public function scoped(Scope $scope)
{
if($scope instanceof Dependent)
{
$this->scope = NULL;
}
else
{
$this->scope = get_class($scope);
}
return $this;
} | [
"public",
"function",
"scoped",
"(",
"Scope",
"$",
"scope",
")",
"{",
"if",
"(",
"$",
"scope",
"instanceof",
"Dependent",
")",
"{",
"$",
"this",
"->",
"scope",
"=",
"NULL",
";",
"}",
"else",
"{",
"$",
"this",
"->",
"scope",
"=",
"get_class",
"(",
"... | Set the scope of the binding according to the binary value of the scope.
@param Scope $scope
@return Binding | [
"Set",
"the",
"scope",
"of",
"the",
"binding",
"according",
"to",
"the",
"binary",
"value",
"of",
"the",
"scope",
"."
] | f4aa614eb4ca1080bd89c7a2a54c9467c5b17a36 | https://github.com/koolkode/context/blob/f4aa614eb4ca1080bd89c7a2a54c9467c5b17a36/src/Bind/Binding.php#L209-L221 |
202,337 | koolkode/context | src/Bind/Binding.php | Binding.isMarked | public function isMarked($marker)
{
if(empty($this->markers))
{
return false;
}
if($marker instanceof \ReflectionClass)
{
foreach($this->markers as $check)
{
if($marker->isInstance($check))
{
return true;
}
}
}
elseif($marker instanceof Marker)
{
foreach($this->marker... | php | public function isMarked($marker)
{
if(empty($this->markers))
{
return false;
}
if($marker instanceof \ReflectionClass)
{
foreach($this->markers as $check)
{
if($marker->isInstance($check))
{
return true;
}
}
}
elseif($marker instanceof Marker)
{
foreach($this->marker... | [
"public",
"function",
"isMarked",
"(",
"$",
"marker",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"markers",
")",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"$",
"marker",
"instanceof",
"\\",
"ReflectionClass",
")",
"{",
"foreach",
"... | Check if the binding has a marker of the given type.
@param mixed $marker Marker instance, reflection class or fully-qualified name of the marker.
@return boolean | [
"Check",
"if",
"the",
"binding",
"has",
"a",
"marker",
"of",
"the",
"given",
"type",
"."
] | f4aa614eb4ca1080bd89c7a2a54c9467c5b17a36 | https://github.com/koolkode/context/blob/f4aa614eb4ca1080bd89c7a2a54c9467c5b17a36/src/Bind/Binding.php#L242-L281 |
202,338 | koolkode/context | src/Bind/Binding.php | Binding.decorate | public function decorate(\Closure $decorator, $priority = 0)
{
$this->decorators->insert($decorator, $priority);
return $this;
} | php | public function decorate(\Closure $decorator, $priority = 0)
{
$this->decorators->insert($decorator, $priority);
return $this;
} | [
"public",
"function",
"decorate",
"(",
"\\",
"Closure",
"$",
"decorator",
",",
"$",
"priority",
"=",
"0",
")",
"{",
"$",
"this",
"->",
"decorators",
"->",
"insert",
"(",
"$",
"decorator",
",",
"$",
"priority",
")",
";",
"return",
"$",
"this",
";",
"}... | Register a decorator with this binding.
Decorators are custom initializers (created object instance as first argument + any number of additional
params reslved by DI are supported) that must return the decorator object instance.
@param \Closure $decorator
@param integer $priority
@return Binding | [
"Register",
"a",
"decorator",
"with",
"this",
"binding",
"."
] | f4aa614eb4ca1080bd89c7a2a54c9467c5b17a36 | https://github.com/koolkode/context/blob/f4aa614eb4ca1080bd89c7a2a54c9467c5b17a36/src/Bind/Binding.php#L360-L365 |
202,339 | koolkode/context | src/Bind/Binding.php | Binding.getInitializers | public function getInitializers()
{
$initializers = $this->initializers;
foreach(clone $this->decorators as $decorator)
{
$initializers[] = $decorator;
}
return $initializers;
} | php | public function getInitializers()
{
$initializers = $this->initializers;
foreach(clone $this->decorators as $decorator)
{
$initializers[] = $decorator;
}
return $initializers;
} | [
"public",
"function",
"getInitializers",
"(",
")",
"{",
"$",
"initializers",
"=",
"$",
"this",
"->",
"initializers",
";",
"foreach",
"(",
"clone",
"$",
"this",
"->",
"decorators",
"as",
"$",
"decorator",
")",
"{",
"$",
"initializers",
"[",
"]",
"=",
"$",... | Get all custom initializers of this binding.
@return array<\Closure> | [
"Get",
"all",
"custom",
"initializers",
"of",
"this",
"binding",
"."
] | f4aa614eb4ca1080bd89c7a2a54c9467c5b17a36 | https://github.com/koolkode/context/blob/f4aa614eb4ca1080bd89c7a2a54c9467c5b17a36/src/Bind/Binding.php#L372-L382 |
202,340 | phpffcms/ffcms-core | src/Helper/Environment.php | Environment.loadAverage | public static function loadAverage()
{
$load = 0;
if (stristr(PHP_OS, 'win')) {
// its not a better solution, but no other way to do this
$cmd = "wmic cpu get loadpercentage /all";
@exec($cmd, $output);
// if output is exist
if ($output) {... | php | public static function loadAverage()
{
$load = 0;
if (stristr(PHP_OS, 'win')) {
// its not a better solution, but no other way to do this
$cmd = "wmic cpu get loadpercentage /all";
@exec($cmd, $output);
// if output is exist
if ($output) {... | [
"public",
"static",
"function",
"loadAverage",
"(",
")",
"{",
"$",
"load",
"=",
"0",
";",
"if",
"(",
"stristr",
"(",
"PHP_OS",
",",
"'win'",
")",
")",
"{",
"// its not a better solution, but no other way to do this",
"$",
"cmd",
"=",
"\"wmic cpu get loadpercentage... | Get load average in percents.
@return string | [
"Get",
"load",
"average",
"in",
"percents",
"."
] | 44a309553ef9f115ccfcfd71f2ac6e381c612082 | https://github.com/phpffcms/ffcms-core/blob/44a309553ef9f115ccfcfd71f2ac6e381c612082/src/Helper/Environment.php#L42-L70 |
202,341 | t3v/t3v_core | Classes/Domain/Model/Traits/FileReferenceTrait.php | FileReferenceTrait.getLocalizedFileReference | protected function getLocalizedFileReference(string $table, string $field) {
if ($this->getSysLanguageUid() > 0) {
$localizedFileReferences = $this->getLocalizedFileReferences($table, $field);
if (!empty($localizedFileReferences)) {
$localizedFileObject = $localizedFileReferences[0]->toArray();... | php | protected function getLocalizedFileReference(string $table, string $field) {
if ($this->getSysLanguageUid() > 0) {
$localizedFileReferences = $this->getLocalizedFileReferences($table, $field);
if (!empty($localizedFileReferences)) {
$localizedFileObject = $localizedFileReferences[0]->toArray();... | [
"protected",
"function",
"getLocalizedFileReference",
"(",
"string",
"$",
"table",
",",
"string",
"$",
"field",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"getSysLanguageUid",
"(",
")",
">",
"0",
")",
"{",
"$",
"localizedFileReferences",
"=",
"$",
"this",
"->... | Gets a localized file reference.
@param string $table The table
@param string $field The field
@return array|null The localized file reference or null if no localized file reference was found | [
"Gets",
"a",
"localized",
"file",
"reference",
"."
] | 8c04b7688cc2773f11fcc87fda3f7cd53d80a980 | https://github.com/t3v/t3v_core/blob/8c04b7688cc2773f11fcc87fda3f7cd53d80a980/Classes/Domain/Model/Traits/FileReferenceTrait.php#L19-L43 |
202,342 | t3v/t3v_core | Classes/Domain/Model/Traits/FileReferenceTrait.php | FileReferenceTrait.getLocalizedFileReferences | protected function getLocalizedFileReferences(string $table, string $field) {
if ($this->getSysLanguageUid() > 0) {
return $this->fileRepository->findByRelation($table, $field, $this->getLocalizedUid());
}
return null;
} | php | protected function getLocalizedFileReferences(string $table, string $field) {
if ($this->getSysLanguageUid() > 0) {
return $this->fileRepository->findByRelation($table, $field, $this->getLocalizedUid());
}
return null;
} | [
"protected",
"function",
"getLocalizedFileReferences",
"(",
"string",
"$",
"table",
",",
"string",
"$",
"field",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"getSysLanguageUid",
"(",
")",
">",
"0",
")",
"{",
"return",
"$",
"this",
"->",
"fileRepository",
"->",... | Gets localized file references.
@param string $table The table
@param string $field The field
@return array|null The localized file references or null if no localized file references were found | [
"Gets",
"localized",
"file",
"references",
"."
] | 8c04b7688cc2773f11fcc87fda3f7cd53d80a980 | https://github.com/t3v/t3v_core/blob/8c04b7688cc2773f11fcc87fda3f7cd53d80a980/Classes/Domain/Model/Traits/FileReferenceTrait.php#L52-L58 |
202,343 | freialib/hlin.tools | src/Command/Cmdhelp.php | CmdhelpCommand.printp | protected function printp($input, $indent = 0) {
$input = trim($input, "\n\t\r ");
$indentation = str_repeat(' ', $indent);
$this->cli->printf($indentation.wordwrap(str_replace("\n", "\n$indentation", $input), 75 - $indent, "\n$indentation")."\n");
} | php | protected function printp($input, $indent = 0) {
$input = trim($input, "\n\t\r ");
$indentation = str_repeat(' ', $indent);
$this->cli->printf($indentation.wordwrap(str_replace("\n", "\n$indentation", $input), 75 - $indent, "\n$indentation")."\n");
} | [
"protected",
"function",
"printp",
"(",
"$",
"input",
",",
"$",
"indent",
"=",
"0",
")",
"{",
"$",
"input",
"=",
"trim",
"(",
"$",
"input",
",",
"\"\\n\\t\\r \"",
")",
";",
"$",
"indentation",
"=",
"str_repeat",
"(",
"' '",
",",
"$",
"indent",
")",
... | Print paragraph. Anything passed will be trimmed and printed so as to fit
in the limit of 75 characters per line. | [
"Print",
"paragraph",
".",
"Anything",
"passed",
"will",
"be",
"trimmed",
"and",
"printed",
"so",
"as",
"to",
"fit",
"in",
"the",
"limit",
"of",
"75",
"characters",
"per",
"line",
"."
] | 42ad9e9fe081918d2ee5d52b72d174ccdcf7cbe7 | https://github.com/freialib/hlin.tools/blob/42ad9e9fe081918d2ee5d52b72d174ccdcf7cbe7/src/Command/Cmdhelp.php#L85-L89 |
202,344 | ciims/ciims-modules-api | controllers/ContentController.php | ContentController.createNewPost | private function createNewPost()
{
if (!$this->user->role->hasPermission('create'))
throw new CHttpException(403, Yii::t('Api.content', 'You do not have permission to create new entries.'));
$model = new Content;
$model->populate($_POST);
// Return a model instance to work with
if ($model->savePrototyp... | php | private function createNewPost()
{
if (!$this->user->role->hasPermission('create'))
throw new CHttpException(403, Yii::t('Api.content', 'You do not have permission to create new entries.'));
$model = new Content;
$model->populate($_POST);
// Return a model instance to work with
if ($model->savePrototyp... | [
"private",
"function",
"createNewPost",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"user",
"->",
"role",
"->",
"hasPermission",
"(",
"'create'",
")",
")",
"throw",
"new",
"CHttpException",
"(",
"403",
",",
"Yii",
"::",
"t",
"(",
"'Api.content'",
... | Creates a new entry | [
"Creates",
"a",
"new",
"entry"
] | 4351855328da0b112ac27bde7e7e07e212be8689 | https://github.com/ciims/ciims-modules-api/blob/4351855328da0b112ac27bde7e7e07e212be8689/controllers/ContentController.php#L330-L368 |
202,345 | ciims/ciims-modules-api | controllers/ContentController.php | ContentController.updatePost | private function updatePost($id)
{
$model = $this->loadModel($id);
if (!$this->user->role->hasPermission('modify'))
throw new CHttpException(403, Yii::t('Api.content', 'You do not have permission to create new entries.'));
if ($this->user->role->isA('author') || $this->user->role->isA('collaborator'))
$m... | php | private function updatePost($id)
{
$model = $this->loadModel($id);
if (!$this->user->role->hasPermission('modify'))
throw new CHttpException(403, Yii::t('Api.content', 'You do not have permission to create new entries.'));
if ($this->user->role->isA('author') || $this->user->role->isA('collaborator'))
$m... | [
"private",
"function",
"updatePost",
"(",
"$",
"id",
")",
"{",
"$",
"model",
"=",
"$",
"this",
"->",
"loadModel",
"(",
"$",
"id",
")",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"user",
"->",
"role",
"->",
"hasPermission",
"(",
"'modify'",
")",
")",
... | Updates an existing entry
@param int $id The Content id | [
"Updates",
"an",
"existing",
"entry"
] | 4351855328da0b112ac27bde7e7e07e212be8689 | https://github.com/ciims/ciims-modules-api/blob/4351855328da0b112ac27bde7e7e07e212be8689/controllers/ContentController.php#L374-L416 |
202,346 | ciims/ciims-modules-api | controllers/ContentController.php | ContentController.loadModel | private function loadModel($id=NULL)
{
if ($id === NULL)
throw new CHttpException(400, Yii::t('Api.content', 'Missing id'));
$model = Content::model()->findByPk($id);
if ($model === NULL)
throw new CHttpException(404, Yii::t('Api.content', 'An entry with the id of {{id}} was not found', array('{{id}}' => ... | php | private function loadModel($id=NULL)
{
if ($id === NULL)
throw new CHttpException(400, Yii::t('Api.content', 'Missing id'));
$model = Content::model()->findByPk($id);
if ($model === NULL)
throw new CHttpException(404, Yii::t('Api.content', 'An entry with the id of {{id}} was not found', array('{{id}}' => ... | [
"private",
"function",
"loadModel",
"(",
"$",
"id",
"=",
"NULL",
")",
"{",
"if",
"(",
"$",
"id",
"===",
"NULL",
")",
"throw",
"new",
"CHttpException",
"(",
"400",
",",
"Yii",
"::",
"t",
"(",
"'Api.content'",
",",
"'Missing id'",
")",
")",
";",
"$",
... | Retrieves the model
@param int $id The content ID
@return Content | [
"Retrieves",
"the",
"model"
] | 4351855328da0b112ac27bde7e7e07e212be8689 | https://github.com/ciims/ciims-modules-api/blob/4351855328da0b112ac27bde7e7e07e212be8689/controllers/ContentController.php#L423-L433 |
202,347 | ciims/ciims-modules-api | controllers/ContentController.php | ContentController.actionUploadImagePost | public function actionUploadImagePost($id=NULL, $promote = 0)
{
$result = new CiiFileUpload($id, $promote);
return $result->uploadFile();
} | php | public function actionUploadImagePost($id=NULL, $promote = 0)
{
$result = new CiiFileUpload($id, $promote);
return $result->uploadFile();
} | [
"public",
"function",
"actionUploadImagePost",
"(",
"$",
"id",
"=",
"NULL",
",",
"$",
"promote",
"=",
"0",
")",
"{",
"$",
"result",
"=",
"new",
"CiiFileUpload",
"(",
"$",
"id",
",",
"$",
"promote",
")",
";",
"return",
"$",
"result",
"->",
"uploadFile",... | Uploads a video to the site.
@param integer $id The content_id
@param integer $promote Whether or not this image should be a promoted image or not
@return array | [
"Uploads",
"a",
"video",
"to",
"the",
"site",
"."
] | 4351855328da0b112ac27bde7e7e07e212be8689 | https://github.com/ciims/ciims-modules-api/blob/4351855328da0b112ac27bde7e7e07e212be8689/controllers/ContentController.php#L441-L445 |
202,348 | black-project/common | src/Common/Application/Form/Transformer/ArrayToDelimitedStringTransformer.php | ArrayToDelimitedStringTransformer.transform | public function transform($array)
{
if (null === $array) {
return '';
}
if (!is_array($array)) {
throw new TransformationFailedException('Expected an array.');
}
foreach ($array as &$value) {
$value = sprintf('%s%s%s',
str... | php | public function transform($array)
{
if (null === $array) {
return '';
}
if (!is_array($array)) {
throw new TransformationFailedException('Expected an array.');
}
foreach ($array as &$value) {
$value = sprintf('%s%s%s',
str... | [
"public",
"function",
"transform",
"(",
"$",
"array",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"array",
")",
"{",
"return",
"''",
";",
"}",
"if",
"(",
"!",
"is_array",
"(",
"$",
"array",
")",
")",
"{",
"throw",
"new",
"TransformationFailedException",
... | Transforms an array into a delimited string
@param array $array Array to transform
@return string
@throws TransformationFailedException If the given value is not an array | [
"Transforms",
"an",
"array",
"into",
"a",
"delimited",
"string"
] | d1de2aaae75a7ca7997dbe402897c651d9c7412a | https://github.com/black-project/common/blob/d1de2aaae75a7ca7997dbe402897c651d9c7412a/src/Common/Application/Form/Transformer/ArrayToDelimitedStringTransformer.php#L44-L65 |
202,349 | black-project/common | src/Common/Application/Form/Transformer/ArrayToDelimitedStringTransformer.php | ArrayToDelimitedStringTransformer.reverseTransform | public function reverseTransform($string)
{
if (null !== $string && !is_string($string)) {
throw new TransformationFailedException('Expected a string.');
}
$string = trim($string);
if (empty($string)) {
return array();
}
$values = explode($th... | php | public function reverseTransform($string)
{
if (null !== $string && !is_string($string)) {
throw new TransformationFailedException('Expected a string.');
}
$string = trim($string);
if (empty($string)) {
return array();
}
$values = explode($th... | [
"public",
"function",
"reverseTransform",
"(",
"$",
"string",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"string",
"&&",
"!",
"is_string",
"(",
"$",
"string",
")",
")",
"{",
"throw",
"new",
"TransformationFailedException",
"(",
"'Expected a string.'",
")",
";"... | Transforms a delimited string into an array
@param string $string String to transform
@return array
@throws TransformationFailedException If the given value is not a string | [
"Transforms",
"a",
"delimited",
"string",
"into",
"an",
"array"
] | d1de2aaae75a7ca7997dbe402897c651d9c7412a | https://github.com/black-project/common/blob/d1de2aaae75a7ca7997dbe402897c651d9c7412a/src/Common/Application/Form/Transformer/ArrayToDelimitedStringTransformer.php#L76-L98 |
202,350 | railken/lem | src/Concerns/HasPermissions.php | HasPermissions.getPermission | public function getPermission($code)
{
if (!isset($this->permissions[$code])) {
throw new Exceptions\PermissionNotDefinedException($this, $code);
}
return $this->permissions[$code];
} | php | public function getPermission($code)
{
if (!isset($this->permissions[$code])) {
throw new Exceptions\PermissionNotDefinedException($this, $code);
}
return $this->permissions[$code];
} | [
"public",
"function",
"getPermission",
"(",
"$",
"code",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"permissions",
"[",
"$",
"code",
"]",
")",
")",
"{",
"throw",
"new",
"Exceptions",
"\\",
"PermissionNotDefinedException",
"(",
"$",
"this"... | Retrieve a permission name given code.
@param string $code
@return string | [
"Retrieve",
"a",
"permission",
"name",
"given",
"code",
"."
] | cff1efcd090a9504b2faf5594121885786dea67a | https://github.com/railken/lem/blob/cff1efcd090a9504b2faf5594121885786dea67a/src/Concerns/HasPermissions.php#L16-L23 |
202,351 | romm/configuration_object | Classes/Traits/ConfigurationObject/ArrayConversionTrait.php | ArrayConversionTrait.getObjectPropertiesValues | private function getObjectPropertiesValues($object)
{
$properties = Core::get()->getGettablePropertiesOfObject($object);
$finalProperties = [];
foreach ($properties as $property) {
$finalProperties[$property] = Core::get()->getObjectService()->getObjectProperty($object, $propert... | php | private function getObjectPropertiesValues($object)
{
$properties = Core::get()->getGettablePropertiesOfObject($object);
$finalProperties = [];
foreach ($properties as $property) {
$finalProperties[$property] = Core::get()->getObjectService()->getObjectProperty($object, $propert... | [
"private",
"function",
"getObjectPropertiesValues",
"(",
"$",
"object",
")",
"{",
"$",
"properties",
"=",
"Core",
"::",
"get",
"(",
")",
"->",
"getGettablePropertiesOfObject",
"(",
"$",
"object",
")",
";",
"$",
"finalProperties",
"=",
"[",
"]",
";",
"foreach... | Will return all the accessible properties of the given object instance.
@param object $object
@return array | [
"Will",
"return",
"all",
"the",
"accessible",
"properties",
"of",
"the",
"given",
"object",
"instance",
"."
] | d3a40903386c2e0766bd8279337fe6da45cf5ce3 | https://github.com/romm/configuration_object/blob/d3a40903386c2e0766bd8279337fe6da45cf5ce3/Classes/Traits/ConfigurationObject/ArrayConversionTrait.php#L76-L86 |
202,352 | bheisig/cli | src/App.php | App.invokeStandardCommands | protected function invokeStandardCommands() {
return $this
->addCommand(
'help',
__NAMESPACE__ . '\\Command\\Help',
'Show this help'
)
->addCommand(
'list',
__NAMESPACE__ . '\\Command\\ListCommand... | php | protected function invokeStandardCommands() {
return $this
->addCommand(
'help',
__NAMESPACE__ . '\\Command\\Help',
'Show this help'
)
->addCommand(
'list',
__NAMESPACE__ . '\\Command\\ListCommand... | [
"protected",
"function",
"invokeStandardCommands",
"(",
")",
"{",
"return",
"$",
"this",
"->",
"addCommand",
"(",
"'help'",
",",
"__NAMESPACE__",
".",
"'\\\\Command\\\\Help'",
",",
"'Show this help'",
")",
"->",
"addCommand",
"(",
"'list'",
",",
"__NAMESPACE__",
"... | Invoke standard commands
@return self Returns itself | [
"Invoke",
"standard",
"commands"
] | ee77266e173335950357899cdfe86b43c00a6776 | https://github.com/bheisig/cli/blob/ee77266e173335950357899cdfe86b43c00a6776/src/App.php#L113-L145 |
202,353 | bheisig/cli | src/App.php | App.invokeStandardOptions | protected function invokeStandardOptions() {
return $this
->addOption('c', 'config', self::OPTION_NOT_REQUIRED)
->addOption('h', 'help', self::NO_VALUE)
->addOption(null, 'no-colors', self::NO_VALUE)
->addOption('q', 'quiet', self::NO_VALUE)
->addOptio... | php | protected function invokeStandardOptions() {
return $this
->addOption('c', 'config', self::OPTION_NOT_REQUIRED)
->addOption('h', 'help', self::NO_VALUE)
->addOption(null, 'no-colors', self::NO_VALUE)
->addOption('q', 'quiet', self::NO_VALUE)
->addOptio... | [
"protected",
"function",
"invokeStandardOptions",
"(",
")",
"{",
"return",
"$",
"this",
"->",
"addOption",
"(",
"'c'",
",",
"'config'",
",",
"self",
"::",
"OPTION_NOT_REQUIRED",
")",
"->",
"addOption",
"(",
"'h'",
",",
"'help'",
",",
"self",
"::",
"NO_VALUE"... | Invoke standard options
@return self Returns itself
@throws Exception on error | [
"Invoke",
"standard",
"options"
] | ee77266e173335950357899cdfe86b43c00a6776 | https://github.com/bheisig/cli/blob/ee77266e173335950357899cdfe86b43c00a6776/src/App.php#L154-L163 |
202,354 | bheisig/cli | src/App.php | App.invokeLogging | protected function invokeLogging() {
$this->config['log'] = [
'colorize' => true,
'verbosity' => Log::ALL | ~Log::DEBUG
];
$this->log = new Log();
return $this;
} | php | protected function invokeLogging() {
$this->config['log'] = [
'colorize' => true,
'verbosity' => Log::ALL | ~Log::DEBUG
];
$this->log = new Log();
return $this;
} | [
"protected",
"function",
"invokeLogging",
"(",
")",
"{",
"$",
"this",
"->",
"config",
"[",
"'log'",
"]",
"=",
"[",
"'colorize'",
"=>",
"true",
",",
"'verbosity'",
"=>",
"Log",
"::",
"ALL",
"|",
"~",
"Log",
"::",
"DEBUG",
"]",
";",
"$",
"this",
"->",
... | Initialize logger with default values
@return self Returns itself | [
"Initialize",
"logger",
"with",
"default",
"values"
] | ee77266e173335950357899cdfe86b43c00a6776 | https://github.com/bheisig/cli/blob/ee77266e173335950357899cdfe86b43c00a6776/src/App.php#L170-L179 |
202,355 | bheisig/cli | src/App.php | App.addConfigFile | public function addConfigFile($file, $force = false) {
$settings = JSONFile::read($file, $force);
$this->addConfigSettings($settings);
return $this;
} | php | public function addConfigFile($file, $force = false) {
$settings = JSONFile::read($file, $force);
$this->addConfigSettings($settings);
return $this;
} | [
"public",
"function",
"addConfigFile",
"(",
"$",
"file",
",",
"$",
"force",
"=",
"false",
")",
"{",
"$",
"settings",
"=",
"JSONFile",
"::",
"read",
"(",
"$",
"file",
",",
"$",
"force",
")",
";",
"$",
"this",
"->",
"addConfigSettings",
"(",
"$",
"sett... | Parse a JSON file and add its content to the configuration settings
@param string $file File path
@param bool $force If "true" and file is not readable ignore it, otherwise throw an exception. Defaults to
"false".
@return self Returns itself
@throws Exception on error | [
"Parse",
"a",
"JSON",
"file",
"and",
"add",
"its",
"content",
"to",
"the",
"configuration",
"settings"
] | ee77266e173335950357899cdfe86b43c00a6776 | https://github.com/bheisig/cli/blob/ee77266e173335950357899cdfe86b43c00a6776/src/App.php#L192-L198 |
202,356 | bheisig/cli | src/App.php | App.addConfigSettings | public function addConfigSettings(array $settings) {
$this->config = $this->arrayMergeRecursiveOverwrite(
$this->config,
$settings
);
return $this;
} | php | public function addConfigSettings(array $settings) {
$this->config = $this->arrayMergeRecursiveOverwrite(
$this->config,
$settings
);
return $this;
} | [
"public",
"function",
"addConfigSettings",
"(",
"array",
"$",
"settings",
")",
"{",
"$",
"this",
"->",
"config",
"=",
"$",
"this",
"->",
"arrayMergeRecursiveOverwrite",
"(",
"$",
"this",
"->",
"config",
",",
"$",
"settings",
")",
";",
"return",
"$",
"this"... | Add configuration settings
@param array $settings Configuration settings
@return self Returns itself | [
"Add",
"configuration",
"settings"
] | ee77266e173335950357899cdfe86b43c00a6776 | https://github.com/bheisig/cli/blob/ee77266e173335950357899cdfe86b43c00a6776/src/App.php#L207-L214 |
202,357 | bheisig/cli | src/App.php | App.satisfyUserChoice | protected function satisfyUserChoice() {
// <APP NAME> --version:
if (array_key_exists('version', $this->config['options'])) {
$this->executeCommand('version');
$this->close();
}
// <APP NAME> -v:
if (count($this->config['args']) === 2 &&
arra... | php | protected function satisfyUserChoice() {
// <APP NAME> --version:
if (array_key_exists('version', $this->config['options'])) {
$this->executeCommand('version');
$this->close();
}
// <APP NAME> -v:
if (count($this->config['args']) === 2 &&
arra... | [
"protected",
"function",
"satisfyUserChoice",
"(",
")",
"{",
"// <APP NAME> --version:",
"if",
"(",
"array_key_exists",
"(",
"'version'",
",",
"$",
"this",
"->",
"config",
"[",
"'options'",
"]",
")",
")",
"{",
"$",
"this",
"->",
"executeCommand",
"(",
"'versio... | Try to find out what the user wants
@throws Exception on error | [
"Try",
"to",
"find",
"out",
"what",
"the",
"user",
"wants"
] | ee77266e173335950357899cdfe86b43c00a6776 | https://github.com/bheisig/cli/blob/ee77266e173335950357899cdfe86b43c00a6776/src/App.php#L366-L403 |
202,358 | bheisig/cli | src/App.php | App.parseArguments | protected function parseArguments() {
$this->config['arguments'] = [];
$commandFound =false;
for ($index = 0; $index < count($this->config['args']); $index++) {
// Ignore binary name:
if ($index === 0) {
continue;
}
$arg = $this-... | php | protected function parseArguments() {
$this->config['arguments'] = [];
$commandFound =false;
for ($index = 0; $index < count($this->config['args']); $index++) {
// Ignore binary name:
if ($index === 0) {
continue;
}
$arg = $this-... | [
"protected",
"function",
"parseArguments",
"(",
")",
"{",
"$",
"this",
"->",
"config",
"[",
"'arguments'",
"]",
"=",
"[",
"]",
";",
"$",
"commandFound",
"=",
"false",
";",
"for",
"(",
"$",
"index",
"=",
"0",
";",
"$",
"index",
"<",
"count",
"(",
"$... | Parse given arguments
@return self Returns itself | [
"Parse",
"given",
"arguments"
] | ee77266e173335950357899cdfe86b43c00a6776 | https://github.com/bheisig/cli/blob/ee77266e173335950357899cdfe86b43c00a6776/src/App.php#L509-L575 |
202,359 | bheisig/cli | src/App.php | App.loadAdditionalConfigFiles | protected function loadAdditionalConfigFiles() {
$additionalConfigFiles = [];
foreach ($this->config['options'] as $option => $value) {
if (in_array($option, ['c', 'config'])) {
switch (gettype($value)) {
case 'string':
$additional... | php | protected function loadAdditionalConfigFiles() {
$additionalConfigFiles = [];
foreach ($this->config['options'] as $option => $value) {
if (in_array($option, ['c', 'config'])) {
switch (gettype($value)) {
case 'string':
$additional... | [
"protected",
"function",
"loadAdditionalConfigFiles",
"(",
")",
"{",
"$",
"additionalConfigFiles",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"config",
"[",
"'options'",
"]",
"as",
"$",
"option",
"=>",
"$",
"value",
")",
"{",
"if",
"(",
"in_a... | Parse additional configuration files given as options
@return self Returns itself
@throws Exception on error | [
"Parse",
"additional",
"configuration",
"files",
"given",
"as",
"options"
] | ee77266e173335950357899cdfe86b43c00a6776 | https://github.com/bheisig/cli/blob/ee77266e173335950357899cdfe86b43c00a6776/src/App.php#L652-L689 |
202,360 | bheisig/cli | src/App.php | App.addRuntimeSettings | protected function addRuntimeSettings() {
$newSettings = [];
foreach ($this->config['options'] as $option => $value) {
if (in_array($option, ['s', 'setting'])) {
switch (gettype($value)) {
case 'string':
$newSettings[] = $value;
... | php | protected function addRuntimeSettings() {
$newSettings = [];
foreach ($this->config['options'] as $option => $value) {
if (in_array($option, ['s', 'setting'])) {
switch (gettype($value)) {
case 'string':
$newSettings[] = $value;
... | [
"protected",
"function",
"addRuntimeSettings",
"(",
")",
"{",
"$",
"newSettings",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"config",
"[",
"'options'",
"]",
"as",
"$",
"option",
"=>",
"$",
"value",
")",
"{",
"if",
"(",
"in_array",
"(",
"... | Look for additional configuration settings given as options
@return self Returns itself
@throws Exception on error | [
"Look",
"for",
"additional",
"configuration",
"settings",
"given",
"as",
"options"
] | ee77266e173335950357899cdfe86b43c00a6776 | https://github.com/bheisig/cli/blob/ee77266e173335950357899cdfe86b43c00a6776/src/App.php#L698-L761 |
202,361 | bheisig/cli | src/App.php | App.buildSettings | protected function buildSettings($keys, $value) {
$result = [];
$index = array_shift($keys);
if (!isset($keys[0])) {
$result[$index] = $value;
} else {
$result[$index] = $this->buildSettings($keys, $value);
}
return $result;
} | php | protected function buildSettings($keys, $value) {
$result = [];
$index = array_shift($keys);
if (!isset($keys[0])) {
$result[$index] = $value;
} else {
$result[$index] = $this->buildSettings($keys, $value);
}
return $result;
} | [
"protected",
"function",
"buildSettings",
"(",
"$",
"keys",
",",
"$",
"value",
")",
"{",
"$",
"result",
"=",
"[",
"]",
";",
"$",
"index",
"=",
"array_shift",
"(",
"$",
"keys",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"keys",
"[",
"0",
"]",
... | Create associative array for settings
@param string[] $keys Setting path
@param mixed $value Value
@return array | [
"Create",
"associative",
"array",
"for",
"settings"
] | ee77266e173335950357899cdfe86b43c00a6776 | https://github.com/bheisig/cli/blob/ee77266e173335950357899cdfe86b43c00a6776/src/App.php#L771-L783 |
202,362 | bheisig/cli | src/App.php | App.configureLogger | protected function configureLogger() {
$appNoColor = strtoupper($this->config['composer']['extra']['name']) . '_NOCOLOR';
if (array_key_exists('no-colors', $this->config['options']) ||
getenv('NO_COLOR') !== false ||
getenv($appNoColor) !== false ||
(function_exists(... | php | protected function configureLogger() {
$appNoColor = strtoupper($this->config['composer']['extra']['name']) . '_NOCOLOR';
if (array_key_exists('no-colors', $this->config['options']) ||
getenv('NO_COLOR') !== false ||
getenv($appNoColor) !== false ||
(function_exists(... | [
"protected",
"function",
"configureLogger",
"(",
")",
"{",
"$",
"appNoColor",
"=",
"strtoupper",
"(",
"$",
"this",
"->",
"config",
"[",
"'composer'",
"]",
"[",
"'extra'",
"]",
"[",
"'name'",
"]",
")",
".",
"'_NOCOLOR'",
";",
"if",
"(",
"array_key_exists",
... | Set color handling and verbosity for used logger
Respect environment variables
- "NO_COLOR" (@see https://no-color.org/) and
- "<App name in upper case>_NOCOLOR"
regardless of their values
Also, disable colors if there is no TTY available
(for example, then output is piped to another app)
@return self Returns itself | [
"Set",
"color",
"handling",
"and",
"verbosity",
"for",
"used",
"logger"
] | ee77266e173335950357899cdfe86b43c00a6776 | https://github.com/bheisig/cli/blob/ee77266e173335950357899cdfe86b43c00a6776/src/App.php#L798-L821 |
202,363 | bheisig/cli | src/App.php | App.loadComposerFile | protected function loadComposerFile() {
$composerFile = $this->config['appDir'] . '/composer.json';
if (!is_readable($composerFile)) {
throw new Exception(sprintf(
'Composer file "%s" is missing or not readable',
$composerFile
), ExitApp::RUNTIME_... | php | protected function loadComposerFile() {
$composerFile = $this->config['appDir'] . '/composer.json';
if (!is_readable($composerFile)) {
throw new Exception(sprintf(
'Composer file "%s" is missing or not readable',
$composerFile
), ExitApp::RUNTIME_... | [
"protected",
"function",
"loadComposerFile",
"(",
")",
"{",
"$",
"composerFile",
"=",
"$",
"this",
"->",
"config",
"[",
"'appDir'",
"]",
".",
"'/composer.json'",
";",
"if",
"(",
"!",
"is_readable",
"(",
"$",
"composerFile",
")",
")",
"{",
"throw",
"new",
... | Parse composer.json
@return self Returns itself
@throws Exception on error | [
"Parse",
"composer",
".",
"json"
] | ee77266e173335950357899cdfe86b43c00a6776 | https://github.com/bheisig/cli/blob/ee77266e173335950357899cdfe86b43c00a6776/src/App.php#L830-L866 |
202,364 | chalasr/RCHCapistranoBundle | Util/OutputWritableTrait.php | OutputWritableTrait.sayWelcome | public function sayWelcome(OutputInterface $output)
{
$breakline = '';
$output = $this->createBlockTitle($output);
$title = $this->formatAsTitle('RCHCapistranoBundle - Continuous Deployment');
$welcome = array(
$breakline,
$title,
$breakline,
... | php | public function sayWelcome(OutputInterface $output)
{
$breakline = '';
$output = $this->createBlockTitle($output);
$title = $this->formatAsTitle('RCHCapistranoBundle - Continuous Deployment');
$welcome = array(
$breakline,
$title,
$breakline,
... | [
"public",
"function",
"sayWelcome",
"(",
"OutputInterface",
"$",
"output",
")",
"{",
"$",
"breakline",
"=",
"''",
";",
"$",
"output",
"=",
"$",
"this",
"->",
"createBlockTitle",
"(",
"$",
"output",
")",
";",
"$",
"title",
"=",
"$",
"this",
"->",
"forma... | Writes stylized welcome message in Output.
@param InputInterface $input
@param OutputInterface $output | [
"Writes",
"stylized",
"welcome",
"message",
"in",
"Output",
"."
] | c4a4cbaa2bc05f33bf431fd3afe6cac39947640e | https://github.com/chalasr/RCHCapistranoBundle/blob/c4a4cbaa2bc05f33bf431fd3afe6cac39947640e/Util/OutputWritableTrait.php#L30-L46 |
202,365 | chalasr/RCHCapistranoBundle | Util/OutputWritableTrait.php | OutputWritableTrait.formatAsTitle | protected function formatAsTitle($content)
{
$formatter = $this->getHelper('formatter');
$title = $formatter->formatBlock($content, 'title', true);
return $title;
} | php | protected function formatAsTitle($content)
{
$formatter = $this->getHelper('formatter');
$title = $formatter->formatBlock($content, 'title', true);
return $title;
} | [
"protected",
"function",
"formatAsTitle",
"(",
"$",
"content",
")",
"{",
"$",
"formatter",
"=",
"$",
"this",
"->",
"getHelper",
"(",
"'formatter'",
")",
";",
"$",
"title",
"=",
"$",
"formatter",
"->",
"formatBlock",
"(",
"$",
"content",
",",
"'title'",
"... | Formats string as output block title.
@param string $content
@return string | [
"Formats",
"string",
"as",
"output",
"block",
"title",
"."
] | c4a4cbaa2bc05f33bf431fd3afe6cac39947640e | https://github.com/chalasr/RCHCapistranoBundle/blob/c4a4cbaa2bc05f33bf431fd3afe6cac39947640e/Util/OutputWritableTrait.php#L63-L69 |
202,366 | TypiCMS/Menulinks | src/Http/Controllers/AdminController.php | AdminController.show | public function show($menu = null, $model = null)
{
return Redirect::route('admin.menus.menulinks.edit', [$menu->id, $model->id]);
} | php | public function show($menu = null, $model = null)
{
return Redirect::route('admin.menus.menulinks.edit', [$menu->id, $model->id]);
} | [
"public",
"function",
"show",
"(",
"$",
"menu",
"=",
"null",
",",
"$",
"model",
"=",
"null",
")",
"{",
"return",
"Redirect",
"::",
"route",
"(",
"'admin.menus.menulinks.edit'",
",",
"[",
"$",
"menu",
"->",
"id",
",",
"$",
"model",
"->",
"id",
"]",
")... | Show resource.
@param $menu
@param $model
@return Redirect | [
"Show",
"resource",
"."
] | 68e0a4067b6d04c8d9933cefacb09637e0d67ce1 | https://github.com/TypiCMS/Menulinks/blob/68e0a4067b6d04c8d9933cefacb09637e0d67ce1/src/Http/Controllers/AdminController.php#L56-L59 |
202,367 | kreta/SimpleApiDocBundle | src/Kreta/SimpleApiDocBundle/Controller/ApiDocController.php | ApiDocController.indexAction | public function indexAction()
{
$extractedDoc = $this->get('kreta_simple_api_doc.extractor.api_doc_extractor')->all();
$htmlContent = $this->get('nelmio_api_doc.formatter.html_formatter')->format($extractedDoc);
return new Response($htmlContent, 200, ['Content-Type' => 'text/html']);
} | php | public function indexAction()
{
$extractedDoc = $this->get('kreta_simple_api_doc.extractor.api_doc_extractor')->all();
$htmlContent = $this->get('nelmio_api_doc.formatter.html_formatter')->format($extractedDoc);
return new Response($htmlContent, 200, ['Content-Type' => 'text/html']);
} | [
"public",
"function",
"indexAction",
"(",
")",
"{",
"$",
"extractedDoc",
"=",
"$",
"this",
"->",
"get",
"(",
"'kreta_simple_api_doc.extractor.api_doc_extractor'",
")",
"->",
"all",
"(",
")",
";",
"$",
"htmlContent",
"=",
"$",
"this",
"->",
"get",
"(",
"'nelm... | The index action.
@return Response | [
"The",
"index",
"action",
"."
] | 786aa9310cdf087253f65f68165a0a0c8ad5c816 | https://github.com/kreta/SimpleApiDocBundle/blob/786aa9310cdf087253f65f68165a0a0c8ad5c816/src/Kreta/SimpleApiDocBundle/Controller/ApiDocController.php#L31-L37 |
202,368 | nicodevs/laito | src/Laito/Router.php | Router.register | public function register($method, $path, $action, $filter = null)
{
// Add leading slash if not present
if (strncmp($path, '/', 1) !== 0) {
$path = '/' . $path;
}
// Add API base url to the path
$path = $this->app->config('url.root') . $path;
// Create a... | php | public function register($method, $path, $action, $filter = null)
{
// Add leading slash if not present
if (strncmp($path, '/', 1) !== 0) {
$path = '/' . $path;
}
// Add API base url to the path
$path = $this->app->config('url.root') . $path;
// Create a... | [
"public",
"function",
"register",
"(",
"$",
"method",
",",
"$",
"path",
",",
"$",
"action",
",",
"$",
"filter",
"=",
"null",
")",
"{",
"// Add leading slash if not present",
"if",
"(",
"strncmp",
"(",
"$",
"path",
",",
"'/'",
",",
"1",
")",
"!==",
"0",... | Register a url
@param string $method Method
@param string $path Route to match
@param array $action Controller and method to execute
@param array $filter Optional filter to execute
@return boolean Success or fail of registration | [
"Register",
"a",
"url"
] | d2d28abfcbf981c4decfec28ce94f8849600e9fe | https://github.com/nicodevs/laito/blob/d2d28abfcbf981c4decfec28ce94f8849600e9fe/src/Laito/Router.php#L37-L71 |
202,369 | nicodevs/laito | src/Laito/Router.php | Router.routes | public function routes($method = null)
{
if ($method && isset($this->methods[$method])) {
return $this->routes[$method];
}
return $this->routes;
} | php | public function routes($method = null)
{
if ($method && isset($this->methods[$method])) {
return $this->routes[$method];
}
return $this->routes;
} | [
"public",
"function",
"routes",
"(",
"$",
"method",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"method",
"&&",
"isset",
"(",
"$",
"this",
"->",
"methods",
"[",
"$",
"method",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"routes",
"[",
"$",
"metho... | Retrieve registered routes
@param string $method (Optional) Method specific routes.
@return array Array of routes | [
"Retrieve",
"registered",
"routes"
] | d2d28abfcbf981c4decfec28ce94f8849600e9fe | https://github.com/nicodevs/laito/blob/d2d28abfcbf981c4decfec28ce94f8849600e9fe/src/Laito/Router.php#L79-L85 |
202,370 | nicodevs/laito | src/Laito/Router.php | Router.getAction | public function getAction($url)
{
// Current route holder
$current = false;
// Get requested method
$method = $this->app->request->method() ? : 'GET';
$method = strtolower($method);
// Check all routes until one matches
foreach ($this->routes[$method] as $r... | php | public function getAction($url)
{
// Current route holder
$current = false;
// Get requested method
$method = $this->app->request->method() ? : 'GET';
$method = strtolower($method);
// Check all routes until one matches
foreach ($this->routes[$method] as $r... | [
"public",
"function",
"getAction",
"(",
"$",
"url",
")",
"{",
"// Current route holder",
"$",
"current",
"=",
"false",
";",
"// Get requested method",
"$",
"method",
"=",
"$",
"this",
"->",
"app",
"->",
"request",
"->",
"method",
"(",
")",
"?",
":",
"'GET'... | Retrieve model and method to execute
@param string $route Route to match
@return array Action and parameters | [
"Retrieve",
"model",
"and",
"method",
"to",
"execute"
] | d2d28abfcbf981c4decfec28ce94f8849600e9fe | https://github.com/nicodevs/laito/blob/d2d28abfcbf981c4decfec28ce94f8849600e9fe/src/Laito/Router.php#L93-L125 |
202,371 | nicodevs/laito | src/Laito/Router.php | Router.resource | public function resource($route, $controller, $filter = null)
{
$this->register('get', $route, [$controller, 'index'], $filter);
$this->register('get', $route . '/{id}', [$controller, 'show'], $filter);
$this->register('post', $route, [$controller, 'store'], $filter);
$this->register... | php | public function resource($route, $controller, $filter = null)
{
$this->register('get', $route, [$controller, 'index'], $filter);
$this->register('get', $route . '/{id}', [$controller, 'show'], $filter);
$this->register('post', $route, [$controller, 'store'], $filter);
$this->register... | [
"public",
"function",
"resource",
"(",
"$",
"route",
",",
"$",
"controller",
",",
"$",
"filter",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"register",
"(",
"'get'",
",",
"$",
"route",
",",
"[",
"$",
"controller",
",",
"'index'",
"]",
",",
"$",
"fil... | Register a resource
@param string $route Route for the resource
@param string $controller Controller name
@param string $filter Optional filter to execute
@return boolean Success or fail of registration | [
"Register",
"a",
"resource"
] | d2d28abfcbf981c4decfec28ce94f8849600e9fe | https://github.com/nicodevs/laito/blob/d2d28abfcbf981c4decfec28ce94f8849600e9fe/src/Laito/Router.php#L135-L143 |
202,372 | nicodevs/laito | src/Laito/Router.php | Router.getFilter | public function getFilter($filterName = null)
{
return isset($this->filters[$filterName])? $this->filters[$filterName] : false;
} | php | public function getFilter($filterName = null)
{
return isset($this->filters[$filterName])? $this->filters[$filterName] : false;
} | [
"public",
"function",
"getFilter",
"(",
"$",
"filterName",
"=",
"null",
")",
"{",
"return",
"isset",
"(",
"$",
"this",
"->",
"filters",
"[",
"$",
"filterName",
"]",
")",
"?",
"$",
"this",
"->",
"filters",
"[",
"$",
"filterName",
"]",
":",
"false",
";... | Returns a route filter
@param string $filterName Filter name
@return mixed Registered filter | [
"Returns",
"a",
"route",
"filter"
] | d2d28abfcbf981c4decfec28ce94f8849600e9fe | https://github.com/nicodevs/laito/blob/d2d28abfcbf981c4decfec28ce94f8849600e9fe/src/Laito/Router.php#L163-L166 |
202,373 | nicodevs/laito | src/Laito/Router.php | Router.performFilter | public function performFilter($filter)
{
$filter = $this->getFilter($filter);
if (!$filter) {
throw new \Exception('Filter not found', 500);
}
if ($filter instanceof \Closure) {
call_user_func($filter);
return $this->setAppliedFilter($filter);
... | php | public function performFilter($filter)
{
$filter = $this->getFilter($filter);
if (!$filter) {
throw new \Exception('Filter not found', 500);
}
if ($filter instanceof \Closure) {
call_user_func($filter);
return $this->setAppliedFilter($filter);
... | [
"public",
"function",
"performFilter",
"(",
"$",
"filter",
")",
"{",
"$",
"filter",
"=",
"$",
"this",
"->",
"getFilter",
"(",
"$",
"filter",
")",
";",
"if",
"(",
"!",
"$",
"filter",
")",
"{",
"throw",
"new",
"\\",
"Exception",
"(",
"'Filter not found'"... | Performs a filter
@param string $filter Filter name | [
"Performs",
"a",
"filter"
] | d2d28abfcbf981c4decfec28ce94f8849600e9fe | https://github.com/nicodevs/laito/blob/d2d28abfcbf981c4decfec28ce94f8849600e9fe/src/Laito/Router.php#L195-L220 |
202,374 | nicodevs/laito | src/Laito/Router.php | Router.group | public function group()
{
// Get arguments
if (func_num_args() === 2) {
list($prefix, $routes) = func_get_args();
$filter = null;
} elseif (func_num_args() === 3) {
list($filter, $prefix, $routes) = func_get_args();
}
// Add leading slash ... | php | public function group()
{
// Get arguments
if (func_num_args() === 2) {
list($prefix, $routes) = func_get_args();
$filter = null;
} elseif (func_num_args() === 3) {
list($filter, $prefix, $routes) = func_get_args();
}
// Add leading slash ... | [
"public",
"function",
"group",
"(",
")",
"{",
"// Get arguments",
"if",
"(",
"func_num_args",
"(",
")",
"===",
"2",
")",
"{",
"list",
"(",
"$",
"prefix",
",",
"$",
"routes",
")",
"=",
"func_get_args",
"(",
")",
";",
"$",
"filter",
"=",
"null",
";",
... | Register a group of routers with a common filter
@param string $filter Filter name
@param string $prefix Prefix for all routes
@param array $routers Routes | [
"Register",
"a",
"group",
"of",
"routers",
"with",
"a",
"common",
"filter"
] | d2d28abfcbf981c4decfec28ce94f8849600e9fe | https://github.com/nicodevs/laito/blob/d2d28abfcbf981c4decfec28ce94f8849600e9fe/src/Laito/Router.php#L229-L258 |
202,375 | judus/minimal-database | src/DB.php | DB.get | public static function get($name = 'default')
{
if (!isset(self::$connections[$name])) {
return null;
}
$connector = self::$connections[$name];
return $connector->connection();
} | php | public static function get($name = 'default')
{
if (!isset(self::$connections[$name])) {
return null;
}
$connector = self::$connections[$name];
return $connector->connection();
} | [
"public",
"static",
"function",
"get",
"(",
"$",
"name",
"=",
"'default'",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"self",
"::",
"$",
"connections",
"[",
"$",
"name",
"]",
")",
")",
"{",
"return",
"null",
";",
"}",
"$",
"connector",
"=",
"self",
... | Get a PDO-Connection
@param string $name
@return null | [
"Get",
"a",
"PDO",
"-",
"Connection"
] | e6f8cb46eab41c3f1b6cabe0da5ccd0926727279 | https://github.com/judus/minimal-database/blob/e6f8cb46eab41c3f1b6cabe0da5ccd0926727279/src/DB.php#L55-L64 |
202,376 | WellCommerce/CategoryBundle | Twig/Extension/CategoryExtension.php | CategoryExtension.getCategoriesTree | public function getCategoriesTree($limit = 1000, $orderBy = 'hierarchy', $orderDir = 'asc')
{
return $this->dataset->getResult('tree', [
'limit' => $limit,
'order_by' => $orderBy,
'order_dir' => $orderDir
]);
} | php | public function getCategoriesTree($limit = 1000, $orderBy = 'hierarchy', $orderDir = 'asc')
{
return $this->dataset->getResult('tree', [
'limit' => $limit,
'order_by' => $orderBy,
'order_dir' => $orderDir
]);
} | [
"public",
"function",
"getCategoriesTree",
"(",
"$",
"limit",
"=",
"1000",
",",
"$",
"orderBy",
"=",
"'hierarchy'",
",",
"$",
"orderDir",
"=",
"'asc'",
")",
"{",
"return",
"$",
"this",
"->",
"dataset",
"->",
"getResult",
"(",
"'tree'",
",",
"[",
"'limit'... | Returns categories tree
@param int $limit
@param string $orderBy
@param string $orderDir
@return array | [
"Returns",
"categories",
"tree"
] | 7a23ac678f91d15e86bdff624c4799be7b076e1a | https://github.com/WellCommerce/CategoryBundle/blob/7a23ac678f91d15e86bdff624c4799be7b076e1a/Twig/Extension/CategoryExtension.php#L62-L69 |
202,377 | rzajac/phptools | src/Cli/Colors.php | Colors.getColoredString | public static function getColoredString($string, $foreground_color = '', $background_color = '')
{
$colored_string = '';
// Check if given foreground color exists
if (isset(static::$foreground_colors[$foreground_color])) {
$colored_string .= "\033[".static::$foreground_colors[$f... | php | public static function getColoredString($string, $foreground_color = '', $background_color = '')
{
$colored_string = '';
// Check if given foreground color exists
if (isset(static::$foreground_colors[$foreground_color])) {
$colored_string .= "\033[".static::$foreground_colors[$f... | [
"public",
"static",
"function",
"getColoredString",
"(",
"$",
"string",
",",
"$",
"foreground_color",
"=",
"''",
",",
"$",
"background_color",
"=",
"''",
")",
"{",
"$",
"colored_string",
"=",
"''",
";",
"// Check if given foreground color exists",
"if",
"(",
"is... | Returns colored string.
@param string $string The string to applu color to
@param string $foreground_color The foreground color
@param string $background_color The background color
@return string | [
"Returns",
"colored",
"string",
"."
] | 3cbece7645942d244603c14ba897d8a676ee3088 | https://github.com/rzajac/phptools/blob/3cbece7645942d244603c14ba897d8a676ee3088/src/Cli/Colors.php#L76-L98 |
202,378 | gplcart/device | Main.php | Main.getDeviceType | public function getDeviceType()
{
$device = $this->session->get('device');
if (empty($device)) {
$detector = $this->getLibrary();
if ($detector->isMobile()) {
$device = 'mobile';
} else if ($detector->isTablet()) {
$device = 'tab... | php | public function getDeviceType()
{
$device = $this->session->get('device');
if (empty($device)) {
$detector = $this->getLibrary();
if ($detector->isMobile()) {
$device = 'mobile';
} else if ($detector->isTablet()) {
$device = 'tab... | [
"public",
"function",
"getDeviceType",
"(",
")",
"{",
"$",
"device",
"=",
"$",
"this",
"->",
"session",
"->",
"get",
"(",
"'device'",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"device",
")",
")",
"{",
"$",
"detector",
"=",
"$",
"this",
"->",
"getLibr... | Returns a device type
@return string | [
"Returns",
"a",
"device",
"type"
] | 288fcbd50cc3a2c7aa74cc0c3410135dcc9b2881 | https://github.com/gplcart/device/blob/288fcbd50cc3a2c7aa74cc0c3410135dcc9b2881/Main.php#L100-L120 |
202,379 | gplcart/device | Main.php | Main.switchTheme | protected function switchTheme(Controller $controller)
{
if (!$controller->isInternalRoute()) {
try {
$device = $this->getDeviceType();
$store_id = $controller->getStoreId();
$settings = $this->module->getSettings('device');
if (... | php | protected function switchTheme(Controller $controller)
{
if (!$controller->isInternalRoute()) {
try {
$device = $this->getDeviceType();
$store_id = $controller->getStoreId();
$settings = $this->module->getSettings('device');
if (... | [
"protected",
"function",
"switchTheme",
"(",
"Controller",
"$",
"controller",
")",
"{",
"if",
"(",
"!",
"$",
"controller",
"->",
"isInternalRoute",
"(",
")",
")",
"{",
"try",
"{",
"$",
"device",
"=",
"$",
"this",
"->",
"getDeviceType",
"(",
")",
";",
"... | Switch the current theme
@param Controller $controller | [
"Switch",
"the",
"current",
"theme"
] | 288fcbd50cc3a2c7aa74cc0c3410135dcc9b2881 | https://github.com/gplcart/device/blob/288fcbd50cc3a2c7aa74cc0c3410135dcc9b2881/Main.php#L142-L163 |
202,380 | lasallecms/lasallecms-l5-usermanagement-pkg | src/Helpers/NotifySuperAdministrators/EmailSuperAdministrators.php | EmailSuperAdministrators.sendEmailToSuperAdmins | public function sendEmailToSuperAdmins($subject, $event, $emailBladeFile) {
// Grab the super administrators who need to be notified from the config settting
$superAdminEmails = config('auth_frontend_registration_successful_admins_who_receive_notification_email');
// If there are no super admi... | php | public function sendEmailToSuperAdmins($subject, $event, $emailBladeFile) {
// Grab the super administrators who need to be notified from the config settting
$superAdminEmails = config('auth_frontend_registration_successful_admins_who_receive_notification_email');
// If there are no super admi... | [
"public",
"function",
"sendEmailToSuperAdmins",
"(",
"$",
"subject",
",",
"$",
"event",
",",
"$",
"emailBladeFile",
")",
"{",
"// Grab the super administrators who need to be notified from the config settting",
"$",
"superAdminEmails",
"=",
"config",
"(",
"'auth_frontend_regi... | Send email notifications to the super admins
@param text $subject Email subject
@param object $event Data object from event DTO
@param text $emailBladeFile Full package::path..blade.file
@return void | [
"Send",
"email",
"notifications",
"to",
"the",
"super",
"admins"
] | b5203d596e18e2566e7fdcd3f13868bb44a94c1d | https://github.com/lasallecms/lasallecms-l5-usermanagement-pkg/blob/b5203d596e18e2566e7fdcd3f13868bb44a94c1d/src/Helpers/NotifySuperAdministrators/EmailSuperAdministrators.php#L54-L92 |
202,381 | lasallecms/lasallecms-l5-usermanagement-pkg | src/Helpers/NotifySuperAdministrators/EmailSuperAdministrators.php | EmailSuperAdministrators.isSuperAdministrator | public function isSuperAdministrator($email) {
// get the user id
$userId = $this->findUserIdByEmail($email);
// if there is no user ID for that email, then zero is returned
if ($userId == 0) {
return;
}
// does this user id belong to the usergroup "super ... | php | public function isSuperAdministrator($email) {
// get the user id
$userId = $this->findUserIdByEmail($email);
// if there is no user ID for that email, then zero is returned
if ($userId == 0) {
return;
}
// does this user id belong to the usergroup "super ... | [
"public",
"function",
"isSuperAdministrator",
"(",
"$",
"email",
")",
"{",
"// get the user id",
"$",
"userId",
"=",
"$",
"this",
"->",
"findUserIdByEmail",
"(",
"$",
"email",
")",
";",
"// if there is no user ID for that email, then zero is returned",
"if",
"(",
"$",... | Does this email belong to a super administrator?
@param text $email
@return bool | [
"Does",
"this",
"email",
"belong",
"to",
"a",
"super",
"administrator?"
] | b5203d596e18e2566e7fdcd3f13868bb44a94c1d | https://github.com/lasallecms/lasallecms-l5-usermanagement-pkg/blob/b5203d596e18e2566e7fdcd3f13868bb44a94c1d/src/Helpers/NotifySuperAdministrators/EmailSuperAdministrators.php#L101-L118 |
202,382 | lasallecms/lasallecms-l5-usermanagement-pkg | src/Helpers/NotifySuperAdministrators/EmailSuperAdministrators.php | EmailSuperAdministrators.findUserIdByEmail | public function findUserIdByEmail($email) {
$userId = DB::table('users')
->where('email', $email)
->value('id')
;
if (!$userId) {
return 0;
}
return $userId;
} | php | public function findUserIdByEmail($email) {
$userId = DB::table('users')
->where('email', $email)
->value('id')
;
if (!$userId) {
return 0;
}
return $userId;
} | [
"public",
"function",
"findUserIdByEmail",
"(",
"$",
"email",
")",
"{",
"$",
"userId",
"=",
"DB",
"::",
"table",
"(",
"'users'",
")",
"->",
"where",
"(",
"'email'",
",",
"$",
"email",
")",
"->",
"value",
"(",
"'id'",
")",
";",
"if",
"(",
"!",
"$",
... | Find the user's ID from their email address.
Return 0 if no ID is found.
@param string $email
@return int | [
"Find",
"the",
"user",
"s",
"ID",
"from",
"their",
"email",
"address",
"."
] | b5203d596e18e2566e7fdcd3f13868bb44a94c1d | https://github.com/lasallecms/lasallecms-l5-usermanagement-pkg/blob/b5203d596e18e2566e7fdcd3f13868bb44a94c1d/src/Helpers/NotifySuperAdministrators/EmailSuperAdministrators.php#L133-L144 |
202,383 | lasallecms/lasallecms-l5-usermanagement-pkg | src/Helpers/NotifySuperAdministrators/EmailSuperAdministrators.php | EmailSuperAdministrators.isUserSuperAdministrator | public function isUserSuperAdministrator($userId) {
$result = DB::table('user_group')
->where('user_id', $userId)
->where('group_id', 3)
->first()
;
if (!$result) {
return false;
}
return true;
} | php | public function isUserSuperAdministrator($userId) {
$result = DB::table('user_group')
->where('user_id', $userId)
->where('group_id', 3)
->first()
;
if (!$result) {
return false;
}
return true;
} | [
"public",
"function",
"isUserSuperAdministrator",
"(",
"$",
"userId",
")",
"{",
"$",
"result",
"=",
"DB",
"::",
"table",
"(",
"'user_group'",
")",
"->",
"where",
"(",
"'user_id'",
",",
"$",
"userId",
")",
"->",
"where",
"(",
"'group_id'",
",",
"3",
")",
... | Does the user belong to the Super Administrator user group?
It is assumed that Super Administrator is ID=3 in the groups database table.
@param int $userId
@return bool | [
"Does",
"the",
"user",
"belong",
"to",
"the",
"Super",
"Administrator",
"user",
"group?"
] | b5203d596e18e2566e7fdcd3f13868bb44a94c1d | https://github.com/lasallecms/lasallecms-l5-usermanagement-pkg/blob/b5203d596e18e2566e7fdcd3f13868bb44a94c1d/src/Helpers/NotifySuperAdministrators/EmailSuperAdministrators.php#L154-L166 |
202,384 | martinlindhe/php-debughelper | src/Logger.php | Logger.dbgTime | public static function dbgTime($s)
{
if (getenv('DEBUG') == '1') {
self::printMessage('<' . Carbon::now()->toTimeString() . '> ' . self::withCallsite($s), 'comment');
}
} | php | public static function dbgTime($s)
{
if (getenv('DEBUG') == '1') {
self::printMessage('<' . Carbon::now()->toTimeString() . '> ' . self::withCallsite($s), 'comment');
}
} | [
"public",
"static",
"function",
"dbgTime",
"(",
"$",
"s",
")",
"{",
"if",
"(",
"getenv",
"(",
"'DEBUG'",
")",
"==",
"'1'",
")",
"{",
"self",
"::",
"printMessage",
"(",
"'<'",
".",
"Carbon",
"::",
"now",
"(",
")",
"->",
"toTimeString",
"(",
")",
"."... | Yellow text with current time
@param string $s | [
"Yellow",
"text",
"with",
"current",
"time"
] | 8fde5bbfd77d71f3f0990829f235242232094734 | https://github.com/martinlindhe/php-debughelper/blob/8fde5bbfd77d71f3f0990829f235242232094734/src/Logger.php#L46-L51 |
202,385 | martinlindhe/php-debughelper | src/Logger.php | Logger.nfoTime | public static function nfoTime($s)
{
self::printMessage('<' . Carbon::now()->toTimeString() . '> ' . self::withCallsite($s), 'info');
} | php | public static function nfoTime($s)
{
self::printMessage('<' . Carbon::now()->toTimeString() . '> ' . self::withCallsite($s), 'info');
} | [
"public",
"static",
"function",
"nfoTime",
"(",
"$",
"s",
")",
"{",
"self",
"::",
"printMessage",
"(",
"'<'",
".",
"Carbon",
"::",
"now",
"(",
")",
"->",
"toTimeString",
"(",
")",
".",
"'> '",
".",
"self",
"::",
"withCallsite",
"(",
"$",
"s",
")",
... | Green text with current time
@param string $s | [
"Green",
"text",
"with",
"current",
"time"
] | 8fde5bbfd77d71f3f0990829f235242232094734 | https://github.com/martinlindhe/php-debughelper/blob/8fde5bbfd77d71f3f0990829f235242232094734/src/Logger.php#L57-L60 |
202,386 | martinlindhe/php-debughelper | src/Logger.php | Logger.errTime | public static function errTime($s)
{
self::printMessage('<' . Carbon::now()->toTimeString() . '> ' . self::withCallsite($s), 'error');
} | php | public static function errTime($s)
{
self::printMessage('<' . Carbon::now()->toTimeString() . '> ' . self::withCallsite($s), 'error');
} | [
"public",
"static",
"function",
"errTime",
"(",
"$",
"s",
")",
"{",
"self",
"::",
"printMessage",
"(",
"'<'",
".",
"Carbon",
"::",
"now",
"(",
")",
"->",
"toTimeString",
"(",
")",
".",
"'> '",
".",
"self",
"::",
"withCallsite",
"(",
"$",
"s",
")",
... | White text on red background with current time
@param string $s | [
"White",
"text",
"on",
"red",
"background",
"with",
"current",
"time"
] | 8fde5bbfd77d71f3f0990829f235242232094734 | https://github.com/martinlindhe/php-debughelper/blob/8fde5bbfd77d71f3f0990829f235242232094734/src/Logger.php#L66-L69 |
202,387 | dmitrya2e/filtration-bundle | Filter/Executor/FilterExecutor.php | FilterExecutor.registerHandler | public function registerHandler($handler, $type = false)
{
if (!is_object($handler)) {
throw new FilterExecutorException('Handler must be an object.');
}
if ($type === false) {
// Try to guess handler type by class FQN.
$type = $this->guessHandlerType($ha... | php | public function registerHandler($handler, $type = false)
{
if (!is_object($handler)) {
throw new FilterExecutorException('Handler must be an object.');
}
if ($type === false) {
// Try to guess handler type by class FQN.
$type = $this->guessHandlerType($ha... | [
"public",
"function",
"registerHandler",
"(",
"$",
"handler",
",",
"$",
"type",
"=",
"false",
")",
"{",
"if",
"(",
"!",
"is_object",
"(",
"$",
"handler",
")",
")",
"{",
"throw",
"new",
"FilterExecutorException",
"(",
"'Handler must be an object.'",
")",
";",... | Registers specific filtration handler.
@param object|mixed $handler Any supported resource, which can handle filtration (QueryBuilder, ...)
@param string|bool $type The type of the handler
@return static
@throws FilterExecutorException on handler errors | [
"Registers",
"specific",
"filtration",
"handler",
"."
] | fed5764af4e43871835744fb84957b2a76e9a215 | https://github.com/dmitrya2e/filtration-bundle/blob/fed5764af4e43871835744fb84957b2a76e9a215/Filter/Executor/FilterExecutor.php#L83-L110 |
202,388 | dmitrya2e/filtration-bundle | Filter/Executor/FilterExecutor.php | FilterExecutor.registerHandlers | public function registerHandlers(array $handlers)
{
foreach ($handlers as $type => $handler) {
if (!is_string($type)) {
// Probably, non-string $type is a numeric index, which means,
// that the handler array was defined as [ $handler1, $handler2, ... ] without ha... | php | public function registerHandlers(array $handlers)
{
foreach ($handlers as $type => $handler) {
if (!is_string($type)) {
// Probably, non-string $type is a numeric index, which means,
// that the handler array was defined as [ $handler1, $handler2, ... ] without ha... | [
"public",
"function",
"registerHandlers",
"(",
"array",
"$",
"handlers",
")",
"{",
"foreach",
"(",
"$",
"handlers",
"as",
"$",
"type",
"=>",
"$",
"handler",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"type",
")",
")",
"{",
"// Probably, non-string ... | Registers different filtration handlers.
@param array|object[]|mixed[] $handlers
@return static | [
"Registers",
"different",
"filtration",
"handlers",
"."
] | fed5764af4e43871835744fb84957b2a76e9a215 | https://github.com/dmitrya2e/filtration-bundle/blob/fed5764af4e43871835744fb84957b2a76e9a215/Filter/Executor/FilterExecutor.php#L119-L133 |
202,389 | dmitrya2e/filtration-bundle | Filter/Executor/FilterExecutor.php | FilterExecutor.applyFilter | protected function applyFilter(FilterInterface $filter, $handler)
{
if (!($filter instanceof CustomApplyFilterInterface) || !is_callable($filter->getApplyFilterFunction())) {
return $filter->applyFilter($handler);
}
return call_user_func($filter->getApplyFilterFunction(), $filte... | php | protected function applyFilter(FilterInterface $filter, $handler)
{
if (!($filter instanceof CustomApplyFilterInterface) || !is_callable($filter->getApplyFilterFunction())) {
return $filter->applyFilter($handler);
}
return call_user_func($filter->getApplyFilterFunction(), $filte... | [
"protected",
"function",
"applyFilter",
"(",
"FilterInterface",
"$",
"filter",
",",
"$",
"handler",
")",
"{",
"if",
"(",
"!",
"(",
"$",
"filter",
"instanceof",
"CustomApplyFilterInterface",
")",
"||",
"!",
"is_callable",
"(",
"$",
"filter",
"->",
"getApplyFilt... | Applies filtration.
If the filter has custom function for filtration applying, than it will be used.
@param FilterInterface|CustomApplyFilterInterface $filter
@param object|mixed $handler Any supported resource, which can handle filtration
@return static | [
"Applies",
"filtration",
".",
"If",
"the",
"filter",
"has",
"custom",
"function",
"for",
"filtration",
"applying",
"than",
"it",
"will",
"be",
"used",
"."
] | fed5764af4e43871835744fb84957b2a76e9a215 | https://github.com/dmitrya2e/filtration-bundle/blob/fed5764af4e43871835744fb84957b2a76e9a215/Filter/Executor/FilterExecutor.php#L144-L151 |
202,390 | dmitrya2e/filtration-bundle | Filter/Executor/FilterExecutor.php | FilterExecutor.guessHandlerType | protected function guessHandlerType($handler)
{
if (!is_object($handler)) {
return false;
}
foreach ($this->availableHandlerTypes as $type => $classFQN) {
if ($handler instanceof $classFQN) {
return $type;
}
}
return false... | php | protected function guessHandlerType($handler)
{
if (!is_object($handler)) {
return false;
}
foreach ($this->availableHandlerTypes as $type => $classFQN) {
if ($handler instanceof $classFQN) {
return $type;
}
}
return false... | [
"protected",
"function",
"guessHandlerType",
"(",
"$",
"handler",
")",
"{",
"if",
"(",
"!",
"is_object",
"(",
"$",
"handler",
")",
")",
"{",
"return",
"false",
";",
"}",
"foreach",
"(",
"$",
"this",
"->",
"availableHandlerTypes",
"as",
"$",
"type",
"=>",... | Guesses handler type by handler object class FQN.
Basically, it checks if the handler class name exists in the available handler types.
@param object|mixed $handler Any supported resource, which can handle filtration
@return false|string False if the type can not be guessed | [
"Guesses",
"handler",
"type",
"by",
"handler",
"object",
"class",
"FQN",
".",
"Basically",
"it",
"checks",
"if",
"the",
"handler",
"class",
"name",
"exists",
"in",
"the",
"available",
"handler",
"types",
"."
] | fed5764af4e43871835744fb84957b2a76e9a215 | https://github.com/dmitrya2e/filtration-bundle/blob/fed5764af4e43871835744fb84957b2a76e9a215/Filter/Executor/FilterExecutor.php#L161-L174 |
202,391 | Aviogram/Common | src/Plugin/PluginTrait.php | PluginTrait.getPluginClassByName | protected function getPluginClassByName($name)
{
if (array_key_exists($name, $this->plugins) === false) {
return false;
}
return $this->plugins[$name];
} | php | protected function getPluginClassByName($name)
{
if (array_key_exists($name, $this->plugins) === false) {
return false;
}
return $this->plugins[$name];
} | [
"protected",
"function",
"getPluginClassByName",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"array_key_exists",
"(",
"$",
"name",
",",
"$",
"this",
"->",
"plugins",
")",
"===",
"false",
")",
"{",
"return",
"false",
";",
"}",
"return",
"$",
"this",
"->",
"p... | Returns the class name for the given name
@param string $name
@return string | boolean FALSE when the name could not be found | [
"Returns",
"the",
"class",
"name",
"for",
"the",
"given",
"name"
] | bcff2e409cccd4791a3f9bca0b2cdd70c25ddec5 | https://github.com/Aviogram/Common/blob/bcff2e409cccd4791a3f9bca0b2cdd70c25ddec5/src/Plugin/PluginTrait.php#L29-L36 |
202,392 | Aviogram/Common | src/Plugin/PluginTrait.php | PluginTrait.getPlugin | protected function getPlugin($name, callable $constructClosure = null)
{
static $cache = array();
// Check if the plugin is already constructed
if (array_key_exists($name, $cache) === true) {
return $cache[$name];
}
// Fetch the full className
... | php | protected function getPlugin($name, callable $constructClosure = null)
{
static $cache = array();
// Check if the plugin is already constructed
if (array_key_exists($name, $cache) === true) {
return $cache[$name];
}
// Fetch the full className
... | [
"protected",
"function",
"getPlugin",
"(",
"$",
"name",
",",
"callable",
"$",
"constructClosure",
"=",
"null",
")",
"{",
"static",
"$",
"cache",
"=",
"array",
"(",
")",
";",
"// Check if the plugin is already constructed\r",
"if",
"(",
"array_key_exists",
"(",
"... | Method for fetching a singleton instance of a plugin
@param string $name
@param callable $constructClosure
@return object | [
"Method",
"for",
"fetching",
"a",
"singleton",
"instance",
"of",
"a",
"plugin"
] | bcff2e409cccd4791a3f9bca0b2cdd70c25ddec5 | https://github.com/Aviogram/Common/blob/bcff2e409cccd4791a3f9bca0b2cdd70c25ddec5/src/Plugin/PluginTrait.php#L46-L80 |
202,393 | danielgp/bank-holidays | source/Romanian.php | Romanian.readTypeFromJsonFileUniversal | protected function readTypeFromJsonFileUniversal($filePath, $fileBaseName)
{
$fName = $filePath . DIRECTORY_SEPARATOR . $fileBaseName . '.min.json';
$fJson = fopen($fName, 'r');
$jSonContent = fread($fJson, filesize($fName));
fclose($fJson);
return json_decode($jS... | php | protected function readTypeFromJsonFileUniversal($filePath, $fileBaseName)
{
$fName = $filePath . DIRECTORY_SEPARATOR . $fileBaseName . '.min.json';
$fJson = fopen($fName, 'r');
$jSonContent = fread($fJson, filesize($fName));
fclose($fJson);
return json_decode($jS... | [
"protected",
"function",
"readTypeFromJsonFileUniversal",
"(",
"$",
"filePath",
",",
"$",
"fileBaseName",
")",
"{",
"$",
"fName",
"=",
"$",
"filePath",
".",
"DIRECTORY_SEPARATOR",
".",
"$",
"fileBaseName",
".",
"'.min.json'",
";",
"$",
"fJson",
"=",
"fopen",
"... | returns an array with non-standard holidays from a JSON file
@param string $fileBaseName
@return mixed | [
"returns",
"an",
"array",
"with",
"non",
"-",
"standard",
"holidays",
"from",
"a",
"JSON",
"file"
] | edebfd9d99b836aaff80887442f9a28ee988850b | https://github.com/danielgp/bank-holidays/blob/edebfd9d99b836aaff80887442f9a28ee988850b/source/Romanian.php#L57-L64 |
202,394 | danielgp/bank-holidays | source/Romanian.php | Romanian.setHolidays | public function setHolidays(\DateTime $lngDate, $inclCatholicEaster = false, $inclWorkingHolidays = false)
{
$givenYear = $lngDate->format('Y');
$daying = array_merge($this->setHolidaysOrthodoxEaster($lngDate), $this->setHolidaysFixed($lngDate));
if ($inclWorkingHolidays) {
$d... | php | public function setHolidays(\DateTime $lngDate, $inclCatholicEaster = false, $inclWorkingHolidays = false)
{
$givenYear = $lngDate->format('Y');
$daying = array_merge($this->setHolidaysOrthodoxEaster($lngDate), $this->setHolidaysFixed($lngDate));
if ($inclWorkingHolidays) {
$d... | [
"public",
"function",
"setHolidays",
"(",
"\\",
"DateTime",
"$",
"lngDate",
",",
"$",
"inclCatholicEaster",
"=",
"false",
",",
"$",
"inclWorkingHolidays",
"=",
"false",
")",
"{",
"$",
"givenYear",
"=",
"$",
"lngDate",
"->",
"format",
"(",
"'Y'",
")",
";",
... | List of legal holidays
@param \DateTime $lngDate
@param boolean $inclCatholicEaster
@return array | [
"List",
"of",
"legal",
"holidays"
] | edebfd9d99b836aaff80887442f9a28ee988850b | https://github.com/danielgp/bank-holidays/blob/edebfd9d99b836aaff80887442f9a28ee988850b/source/Romanian.php#L73-L90 |
202,395 | danielgp/bank-holidays | source/Romanian.php | Romanian.setHolidaysOrthodoxEaster | private function setHolidaysOrthodoxEaster(\DateTime $lngDate)
{
$givenYear = $lngDate->format('Y');
$daying = [];
$configPath = __DIR__ . DIRECTORY_SEPARATOR . 'json';
$statmentsArray = $this->readTypeFromJsonFileUniversal($configPath, 'RomanianBankHolidays');
... | php | private function setHolidaysOrthodoxEaster(\DateTime $lngDate)
{
$givenYear = $lngDate->format('Y');
$daying = [];
$configPath = __DIR__ . DIRECTORY_SEPARATOR . 'json';
$statmentsArray = $this->readTypeFromJsonFileUniversal($configPath, 'RomanianBankHolidays');
... | [
"private",
"function",
"setHolidaysOrthodoxEaster",
"(",
"\\",
"DateTime",
"$",
"lngDate",
")",
"{",
"$",
"givenYear",
"=",
"$",
"lngDate",
"->",
"format",
"(",
"'Y'",
")",
";",
"$",
"daying",
"=",
"[",
"]",
";",
"$",
"configPath",
"=",
"__DIR__",
".",
... | List of all Orthodox holidays and Pentecost
@param \DateTime $lngDate
@return array | [
"List",
"of",
"all",
"Orthodox",
"holidays",
"and",
"Pentecost"
] | edebfd9d99b836aaff80887442f9a28ee988850b | https://github.com/danielgp/bank-holidays/blob/edebfd9d99b836aaff80887442f9a28ee988850b/source/Romanian.php#L166-L178 |
202,396 | danielgp/bank-holidays | source/Romanian.php | Romanian.setHolidaysInMonth | public function setHolidaysInMonth(\DateTime $lngDate, $inclCatholicEaster = false)
{
$holidaysInGivenYear = $this->setHolidays($lngDate, $inclCatholicEaster);
$thisMonthDayArray = $this->setMonthAllDaysIntoArray($lngDate);
$holidays = 0;
foreach ($thisMonthDayArray as $... | php | public function setHolidaysInMonth(\DateTime $lngDate, $inclCatholicEaster = false)
{
$holidaysInGivenYear = $this->setHolidays($lngDate, $inclCatholicEaster);
$thisMonthDayArray = $this->setMonthAllDaysIntoArray($lngDate);
$holidays = 0;
foreach ($thisMonthDayArray as $... | [
"public",
"function",
"setHolidaysInMonth",
"(",
"\\",
"DateTime",
"$",
"lngDate",
",",
"$",
"inclCatholicEaster",
"=",
"false",
")",
"{",
"$",
"holidaysInGivenYear",
"=",
"$",
"this",
"->",
"setHolidays",
"(",
"$",
"lngDate",
",",
"$",
"inclCatholicEaster",
"... | returns bank holidays in a given month
@param \DateTime $lngDate
@param boolean $inclCatholicEaster
@return int | [
"returns",
"bank",
"holidays",
"in",
"a",
"given",
"month"
] | edebfd9d99b836aaff80887442f9a28ee988850b | https://github.com/danielgp/bank-holidays/blob/edebfd9d99b836aaff80887442f9a28ee988850b/source/Romanian.php#L187-L198 |
202,397 | danielgp/bank-holidays | source/Romanian.php | Romanian.setMonthAllDaysIntoArray | protected function setMonthAllDaysIntoArray(\DateTime $lngDate)
{
$firstDayGivenMonth = strtotime($lngDate->modify('first day of this month')->format('Y-m-d'));
$lastDayInGivenMonth = strtotime($lngDate->modify('last day of this month')->format('Y-m-d'));
$secondsInOneDay = 24 * 60 * 60... | php | protected function setMonthAllDaysIntoArray(\DateTime $lngDate)
{
$firstDayGivenMonth = strtotime($lngDate->modify('first day of this month')->format('Y-m-d'));
$lastDayInGivenMonth = strtotime($lngDate->modify('last day of this month')->format('Y-m-d'));
$secondsInOneDay = 24 * 60 * 60... | [
"protected",
"function",
"setMonthAllDaysIntoArray",
"(",
"\\",
"DateTime",
"$",
"lngDate",
")",
"{",
"$",
"firstDayGivenMonth",
"=",
"strtotime",
"(",
"$",
"lngDate",
"->",
"modify",
"(",
"'first day of this month'",
")",
"->",
"format",
"(",
"'Y-m-d'",
")",
")... | return an array with all days within a month from a given date
@param \DateTime $lngDate
@return array | [
"return",
"an",
"array",
"with",
"all",
"days",
"within",
"a",
"month",
"from",
"a",
"given",
"date"
] | edebfd9d99b836aaff80887442f9a28ee988850b | https://github.com/danielgp/bank-holidays/blob/edebfd9d99b836aaff80887442f9a28ee988850b/source/Romanian.php#L206-L212 |
202,398 | danielgp/bank-holidays | source/Romanian.php | Romanian.setWorkingDaysInMonth | public function setWorkingDaysInMonth(\DateTime $lngDate, $inclCatholicEaster = false)
{
$holidaysInGivenYear = $this->setHolidays($lngDate, $inclCatholicEaster);
$thisMonthDayArray = $this->setMonthAllDaysIntoArray($lngDate);
$workingDays = 0;
foreach ($thisMonthDayArray a... | php | public function setWorkingDaysInMonth(\DateTime $lngDate, $inclCatholicEaster = false)
{
$holidaysInGivenYear = $this->setHolidays($lngDate, $inclCatholicEaster);
$thisMonthDayArray = $this->setMonthAllDaysIntoArray($lngDate);
$workingDays = 0;
foreach ($thisMonthDayArray a... | [
"public",
"function",
"setWorkingDaysInMonth",
"(",
"\\",
"DateTime",
"$",
"lngDate",
",",
"$",
"inclCatholicEaster",
"=",
"false",
")",
"{",
"$",
"holidaysInGivenYear",
"=",
"$",
"this",
"->",
"setHolidays",
"(",
"$",
"lngDate",
",",
"$",
"inclCatholicEaster",
... | returns working days in a given month
@param \DateTime $lngDate
@param boolean $inclCatholicEaster
@return int | [
"returns",
"working",
"days",
"in",
"a",
"given",
"month"
] | edebfd9d99b836aaff80887442f9a28ee988850b | https://github.com/danielgp/bank-holidays/blob/edebfd9d99b836aaff80887442f9a28ee988850b/source/Romanian.php#L221-L232 |
202,399 | romm/configuration_object | Classes/Legacy/Reflection/ReflectionService.php | ReflectionService.setDataCache | public function setDataCache(\TYPO3\CMS\Core\Cache\Frontend\VariableFrontend $dataCache)
{
$this->dataCache = $dataCache;
} | php | public function setDataCache(\TYPO3\CMS\Core\Cache\Frontend\VariableFrontend $dataCache)
{
$this->dataCache = $dataCache;
} | [
"public",
"function",
"setDataCache",
"(",
"\\",
"TYPO3",
"\\",
"CMS",
"\\",
"Core",
"\\",
"Cache",
"\\",
"Frontend",
"\\",
"VariableFrontend",
"$",
"dataCache",
")",
"{",
"$",
"this",
"->",
"dataCache",
"=",
"$",
"dataCache",
";",
"}"
] | Sets the data cache.
The cache must be set before initializing the Reflection Service.
@param \TYPO3\CMS\Core\Cache\Frontend\VariableFrontend $dataCache Cache for the Reflection service | [
"Sets",
"the",
"data",
"cache",
"."
] | d3a40903386c2e0766bd8279337fe6da45cf5ce3 | https://github.com/romm/configuration_object/blob/d3a40903386c2e0766bd8279337fe6da45cf5ce3/Classes/Legacy/Reflection/ReflectionService.php#L177-L180 |
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.