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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
238,900 | bishopb/vanilla | library/core/class.applicationmanager.php | Gdn_ApplicationManager.AvailableApplications | public function AvailableApplications() {
if (!is_array($this->_AvailableApplications)) {
$ApplicationInfo = array();
$AppFolders = Gdn_FileSystem::Folders(PATH_APPLICATIONS); // Get an array of all application folders
$ApplicationAboutFiles = Gdn_FileSystem::FindAll(PATH_APPL... | php | public function AvailableApplications() {
if (!is_array($this->_AvailableApplications)) {
$ApplicationInfo = array();
$AppFolders = Gdn_FileSystem::Folders(PATH_APPLICATIONS); // Get an array of all application folders
$ApplicationAboutFiles = Gdn_FileSystem::FindAll(PATH_APPL... | [
"public",
"function",
"AvailableApplications",
"(",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"this",
"->",
"_AvailableApplications",
")",
")",
"{",
"$",
"ApplicationInfo",
"=",
"array",
"(",
")",
";",
"$",
"AppFolders",
"=",
"Gdn_FileSystem",
"::",
... | Looks through the root Garden directory for valid applications and
returns them as an associative array of "Application Name" =>
"Application Info Array". It also adds a "Folder" definition to the
Application Info Array for each application. | [
"Looks",
"through",
"the",
"root",
"Garden",
"directory",
"for",
"valid",
"applications",
"and",
"returns",
"them",
"as",
"an",
"associative",
"array",
"of",
"Application",
"Name",
"=",
">",
"Application",
"Info",
"Array",
".",
"It",
"also",
"adds",
"a",
"Fo... | 8494eb4a4ad61603479015a8054d23ff488364e8 | https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/library/core/class.applicationmanager.php#L47-L79 |
238,901 | bishopb/vanilla | library/core/class.applicationmanager.php | Gdn_ApplicationManager.EnabledApplications | public function EnabledApplications() {
if (!is_array($this->_EnabledApplications)) {
$EnabledApplications = Gdn::Config('EnabledApplications', array('Dashboard' => 'dashboard'));
// Add some information about the applications to the array.
foreach($EnabledApplications as $Name => $Fold... | php | public function EnabledApplications() {
if (!is_array($this->_EnabledApplications)) {
$EnabledApplications = Gdn::Config('EnabledApplications', array('Dashboard' => 'dashboard'));
// Add some information about the applications to the array.
foreach($EnabledApplications as $Name => $Fold... | [
"public",
"function",
"EnabledApplications",
"(",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"this",
"->",
"_EnabledApplications",
")",
")",
"{",
"$",
"EnabledApplications",
"=",
"Gdn",
"::",
"Config",
"(",
"'EnabledApplications'",
",",
"array",
"(",
"'... | Gets an array of all of the enabled applications.
@return array | [
"Gets",
"an",
"array",
"of",
"all",
"of",
"the",
"enabled",
"applications",
"."
] | 8494eb4a4ad61603479015a8054d23ff488364e8 | https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/library/core/class.applicationmanager.php#L85-L106 |
238,902 | laravel-commode/common | src/LaravelCommode/Common/GhostService/GhostService.php | GhostService.prepareService | private function prepareService()
{
/**
* If CommodeCommonServiceProvider is not loaded yet, load it
* and mark as registered in GhostServices
*/
if (!($bound = $this->app->bound(ServiceShortCuts::CORE_INITIALIZED))) {
$this->services(['LaravelCommode\Common\Co... | php | private function prepareService()
{
/**
* If CommodeCommonServiceProvider is not loaded yet, load it
* and mark as registered in GhostServices
*/
if (!($bound = $this->app->bound(ServiceShortCuts::CORE_INITIALIZED))) {
$this->services(['LaravelCommode\Common\Co... | [
"private",
"function",
"prepareService",
"(",
")",
"{",
"/**\n * If CommodeCommonServiceProvider is not loaded yet, load it\n * and mark as registered in GhostServices\n */",
"if",
"(",
"!",
"(",
"$",
"bound",
"=",
"$",
"this",
"->",
"app",
"->",
"bound"... | Prepares service for launching. If LaravelCommode\Common\CommodeCommonServiceProvider
is not registered in your app config, it will be forced to launch. Loads all services
used by current GhostService instance.
@return $this | [
"Prepares",
"service",
"for",
"launching",
".",
"If",
"LaravelCommode",
"\\",
"Common",
"\\",
"CommodeCommonServiceProvider",
"is",
"not",
"registered",
"in",
"your",
"app",
"config",
"it",
"will",
"be",
"forced",
"to",
"launch",
".",
"Loads",
"all",
"services",... | 5c9289c3ce5bbd934281c4ac7537657d32c5a9ec | https://github.com/laravel-commode/common/blob/5c9289c3ce5bbd934281c4ac7537657d32c5a9ec/src/LaravelCommode/Common/GhostService/GhostService.php#L58-L97 |
238,903 | amercier/rectangular-mozaic | src/Generator.php | Generator.generateGrid | protected function generateGrid($tiles, $columns)
{
[$distribution, $grid] = Distributor::distribute(
$tiles,
$columns,
$this->settings['tallRate'],
$this->settings['wideRate']
);
RandomFiller::fill($grid, $distribution, $this->settings['maxFil... | php | protected function generateGrid($tiles, $columns)
{
[$distribution, $grid] = Distributor::distribute(
$tiles,
$columns,
$this->settings['tallRate'],
$this->settings['wideRate']
);
RandomFiller::fill($grid, $distribution, $this->settings['maxFil... | [
"protected",
"function",
"generateGrid",
"(",
"$",
"tiles",
",",
"$",
"columns",
")",
"{",
"[",
"$",
"distribution",
",",
"$",
"grid",
"]",
"=",
"Distributor",
"::",
"distribute",
"(",
"$",
"tiles",
",",
"$",
"columns",
",",
"$",
"this",
"->",
"setting... | Generate a Grid that contains a given number of columns.
@param int $tiles Total number of tiles.
@param int $columns Number of columns of the grid.
@return Grid A new grid filled with Cell values. | [
"Generate",
"a",
"Grid",
"that",
"contains",
"a",
"given",
"number",
"of",
"columns",
"."
] | d026a82c1bc73979308235a7a440665e92ee8525 | https://github.com/amercier/rectangular-mozaic/blob/d026a82c1bc73979308235a7a440665e92ee8525/src/Generator.php#L49-L59 |
238,904 | EcomDev/phpspec-file-matcher | src/Extension.php | Extension.load | public function load(ServiceContainer $container, array $params)
{
$container->define(
'ecomdev.matcher.file',
function () {
return $this->createFileMatcher();
},
['matchers']
);
$container->define(
'ecomdev.matcher... | php | public function load(ServiceContainer $container, array $params)
{
$container->define(
'ecomdev.matcher.file',
function () {
return $this->createFileMatcher();
},
['matchers']
);
$container->define(
'ecomdev.matcher... | [
"public",
"function",
"load",
"(",
"ServiceContainer",
"$",
"container",
",",
"array",
"$",
"params",
")",
"{",
"$",
"container",
"->",
"define",
"(",
"'ecomdev.matcher.file'",
",",
"function",
"(",
")",
"{",
"return",
"$",
"this",
"->",
"createFileMatcher",
... | Loads matchers into PHPSpec service container
@param ServiceContainer $container
@param array $params | [
"Loads",
"matchers",
"into",
"PHPSpec",
"service",
"container"
] | 5323bf833774c3d9d763bc01cdc7354a2985b47c | https://github.com/EcomDev/phpspec-file-matcher/blob/5323bf833774c3d9d763bc01cdc7354a2985b47c/src/Extension.php#L18-L43 |
238,905 | EcomDev/phpspec-file-matcher | src/Extension.php | Extension.createCheckMatcher | private function createCheckMatcher($verbs, $nouns, ...$matcherArguments)
{
return new CheckMatcher(
$this->createLexer($verbs, $nouns),
...$matcherArguments
);
} | php | private function createCheckMatcher($verbs, $nouns, ...$matcherArguments)
{
return new CheckMatcher(
$this->createLexer($verbs, $nouns),
...$matcherArguments
);
} | [
"private",
"function",
"createCheckMatcher",
"(",
"$",
"verbs",
",",
"$",
"nouns",
",",
"...",
"$",
"matcherArguments",
")",
"{",
"return",
"new",
"CheckMatcher",
"(",
"$",
"this",
"->",
"createLexer",
"(",
"$",
"verbs",
",",
"$",
"nouns",
")",
",",
"...... | Create check matcher instance
@param string[] $verbs
@param string[] $nouns
@param array $matcherArguments
@return CheckMatcher | [
"Create",
"check",
"matcher",
"instance"
] | 5323bf833774c3d9d763bc01cdc7354a2985b47c | https://github.com/EcomDev/phpspec-file-matcher/blob/5323bf833774c3d9d763bc01cdc7354a2985b47c/src/Extension.php#L121-L127 |
238,906 | mpoiriert/draw-test-helper-bundle | Helper/BaseRequestHelper.php | BaseRequestHelper.instantiate | static public function instantiate(RequestHelper $requestHelper)
{
$objectHash = spl_object_hash($requestHelper);
if(static::isSingleInstance()) {
if(isset(static::$instances[$objectHash][static::getName()])) {
return static::$instances[$objectHash][static::getName()];
... | php | static public function instantiate(RequestHelper $requestHelper)
{
$objectHash = spl_object_hash($requestHelper);
if(static::isSingleInstance()) {
if(isset(static::$instances[$objectHash][static::getName()])) {
return static::$instances[$objectHash][static::getName()];
... | [
"static",
"public",
"function",
"instantiate",
"(",
"RequestHelper",
"$",
"requestHelper",
")",
"{",
"$",
"objectHash",
"=",
"spl_object_hash",
"(",
"$",
"requestHelper",
")",
";",
"if",
"(",
"static",
"::",
"isSingleInstance",
"(",
")",
")",
"{",
"if",
"(",... | Return a instance of himself.
Sometime only one helper of a specific type must be set for a request so the same instance can be return
if the same request helper is used. This method should always be used instead of the constructor.
@param RequestHelper $requestHelper
@return static | [
"Return",
"a",
"instance",
"of",
"himself",
"."
] | cd8bb9cb38f2ee0b333ba1a68152fb20d7d70889 | https://github.com/mpoiriert/draw-test-helper-bundle/blob/cd8bb9cb38f2ee0b333ba1a68152fb20d7d70889/Helper/BaseRequestHelper.php#L58-L82 |
238,907 | CodeLoversAt/AclBundle | Handler/AbstractAclHandler.php | AbstractAclHandler.deleteAcl | public function deleteAcl($object)
{
try {
if ($objectIdentity = $this->getObjectIdentity($object)) {
$this->aclProvider->deleteAcl($objectIdentity);
}
} catch (\Exception $e) {
// nothing to do
}
} | php | public function deleteAcl($object)
{
try {
if ($objectIdentity = $this->getObjectIdentity($object)) {
$this->aclProvider->deleteAcl($objectIdentity);
}
} catch (\Exception $e) {
// nothing to do
}
} | [
"public",
"function",
"deleteAcl",
"(",
"$",
"object",
")",
"{",
"try",
"{",
"if",
"(",
"$",
"objectIdentity",
"=",
"$",
"this",
"->",
"getObjectIdentity",
"(",
"$",
"object",
")",
")",
"{",
"$",
"this",
"->",
"aclProvider",
"->",
"deleteAcl",
"(",
"$"... | delete the ACL for the given object
@param object $object | [
"delete",
"the",
"ACL",
"for",
"the",
"given",
"object"
] | 024fe2831e81d7ddff071c695b8daec97f25b990 | https://github.com/CodeLoversAt/AclBundle/blob/024fe2831e81d7ddff071c695b8daec97f25b990/Handler/AbstractAclHandler.php#L151-L160 |
238,908 | flavorzyb/simple | src/Filesystem/Filesystem.php | Filesystem.files | public function files($directory, $recursive = false)
{
$result = [];
$recursive = boolval($recursive);
if ( ! $this->isDirectory($directory)) return [];
$items = new FilesystemIterator($directory);
foreach ($items as $item) {
if ($item->isFile()) {
... | php | public function files($directory, $recursive = false)
{
$result = [];
$recursive = boolval($recursive);
if ( ! $this->isDirectory($directory)) return [];
$items = new FilesystemIterator($directory);
foreach ($items as $item) {
if ($item->isFile()) {
... | [
"public",
"function",
"files",
"(",
"$",
"directory",
",",
"$",
"recursive",
"=",
"false",
")",
"{",
"$",
"result",
"=",
"[",
"]",
";",
"$",
"recursive",
"=",
"boolval",
"(",
"$",
"recursive",
")",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"isDirecto... | get all files in directory
@param string $directory
@param bool $recursive
@return array | [
"get",
"all",
"files",
"in",
"directory"
] | 8c4c539ae2057217b2637fc72c2a90ba266e8e6c | https://github.com/flavorzyb/simple/blob/8c4c539ae2057217b2637fc72c2a90ba266e8e6c/src/Filesystem/Filesystem.php#L340-L361 |
238,909 | petrofcz/groupie | src/Pcz/Groupie/Groupie.php | Groupie.buildGroups | public function buildGroups($entities, $level = 0) {
if(!count($this->groupDefinitions)) {
throw new \RuntimeException('There are no groups defined.');
}
// Building groups
/** @var Group[] $groups */
$groups = [];
if(!isset($this->groupDefinitions[$level])) {
return [];
}
$groupDefinition = $thi... | php | public function buildGroups($entities, $level = 0) {
if(!count($this->groupDefinitions)) {
throw new \RuntimeException('There are no groups defined.');
}
// Building groups
/** @var Group[] $groups */
$groups = [];
if(!isset($this->groupDefinitions[$level])) {
return [];
}
$groupDefinition = $thi... | [
"public",
"function",
"buildGroups",
"(",
"$",
"entities",
",",
"$",
"level",
"=",
"0",
")",
"{",
"if",
"(",
"!",
"count",
"(",
"$",
"this",
"->",
"groupDefinitions",
")",
")",
"{",
"throw",
"new",
"\\",
"RuntimeException",
"(",
"'There are no groups defin... | This method builds the whole structure.
@param $entities array Flat array of entities to be grouped.
@param int $level Group level index. Levels can be skipped by setting value > 0.
@return Group[] | [
"This",
"method",
"builds",
"the",
"whole",
"structure",
"."
] | 727773562d4559de5b6c65eb557b867f0b533ba5 | https://github.com/petrofcz/groupie/blob/727773562d4559de5b6c65eb557b867f0b533ba5/src/Pcz/Groupie/Groupie.php#L25-L95 |
238,910 | petrofcz/groupie | src/Pcz/Groupie/Groupie.php | Groupie.addGlobalColumn | public function addGlobalColumn(ColumnDefinition $columnDefinition, callable $columnDataFactory) {
$this->addColumn($columnDefinition);
foreach($this->groupDefinitions as $groupDefinition) {
$groupDefinition->addColumn($columnDefinition, $columnDataFactory);
}
return $this;
} | php | public function addGlobalColumn(ColumnDefinition $columnDefinition, callable $columnDataFactory) {
$this->addColumn($columnDefinition);
foreach($this->groupDefinitions as $groupDefinition) {
$groupDefinition->addColumn($columnDefinition, $columnDataFactory);
}
return $this;
} | [
"public",
"function",
"addGlobalColumn",
"(",
"ColumnDefinition",
"$",
"columnDefinition",
",",
"callable",
"$",
"columnDataFactory",
")",
"{",
"$",
"this",
"->",
"addColumn",
"(",
"$",
"columnDefinition",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"groupDefin... | This method adds column to groupie and to all available groups. IT SHOULD BE CALLED AFTER ALL GROUPS ARE ADDED!
@param ColumnDefinition $columnDefinition
@param $columnDataFactory callable This method should return callback that will construct the IColumnData object (it contains aggregated value to be displayed). Args:... | [
"This",
"method",
"adds",
"column",
"to",
"groupie",
"and",
"to",
"all",
"available",
"groups",
".",
"IT",
"SHOULD",
"BE",
"CALLED",
"AFTER",
"ALL",
"GROUPS",
"ARE",
"ADDED!"
] | 727773562d4559de5b6c65eb557b867f0b533ba5 | https://github.com/petrofcz/groupie/blob/727773562d4559de5b6c65eb557b867f0b533ba5/src/Pcz/Groupie/Groupie.php#L134-L140 |
238,911 | pdenis/travis-client | src/Snide/Travis/Model/Repository.php | Repository.addBuild | public function addBuild(Build $build)
{
$this->getBuilds();
$build->setRepositoryId($this->getId());
$this->builds[$build->getId()] = $build;
} | php | public function addBuild(Build $build)
{
$this->getBuilds();
$build->setRepositoryId($this->getId());
$this->builds[$build->getId()] = $build;
} | [
"public",
"function",
"addBuild",
"(",
"Build",
"$",
"build",
")",
"{",
"$",
"this",
"->",
"getBuilds",
"(",
")",
";",
"$",
"build",
"->",
"setRepositoryId",
"(",
"$",
"this",
"->",
"getId",
"(",
")",
")",
";",
"$",
"this",
"->",
"builds",
"[",
"$"... | Add build to the list
@param Build $build | [
"Add",
"build",
"to",
"the",
"list"
] | 6925427ac2650a52a03bd23e4809cc9186bb63cd | https://github.com/pdenis/travis-client/blob/6925427ac2650a52a03bd23e4809cc9186bb63cd/src/Snide/Travis/Model/Repository.php#L110-L115 |
238,912 | pdenis/travis-client | src/Snide/Travis/Model/Repository.php | Repository.removeBuild | public function removeBuild(Build $build)
{
if (isset($this->builds[$build->getId()])) {
unset($this->builds[$build->getId()]);
}
} | php | public function removeBuild(Build $build)
{
if (isset($this->builds[$build->getId()])) {
unset($this->builds[$build->getId()]);
}
} | [
"public",
"function",
"removeBuild",
"(",
"Build",
"$",
"build",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"builds",
"[",
"$",
"build",
"->",
"getId",
"(",
")",
"]",
")",
")",
"{",
"unset",
"(",
"$",
"this",
"->",
"builds",
"[",
"$",
... | Remove build from the list
@param Build $build | [
"Remove",
"build",
"from",
"the",
"list"
] | 6925427ac2650a52a03bd23e4809cc9186bb63cd | https://github.com/pdenis/travis-client/blob/6925427ac2650a52a03bd23e4809cc9186bb63cd/src/Snide/Travis/Model/Repository.php#L122-L127 |
238,913 | Thuata/FrameworkBundle | Entity/DocumentSerialization.php | DocumentSerialization.jsonDeserialize | public static function jsonDeserialize(array $json): DocumentSerializationInterface
{
$managerClass = $json['document_serialization']['manager_class'];
$data = (array) $json['document_serialization']['data'];
return new self($managerClass, $data);
} | php | public static function jsonDeserialize(array $json): DocumentSerializationInterface
{
$managerClass = $json['document_serialization']['manager_class'];
$data = (array) $json['document_serialization']['data'];
return new self($managerClass, $data);
} | [
"public",
"static",
"function",
"jsonDeserialize",
"(",
"array",
"$",
"json",
")",
":",
"DocumentSerializationInterface",
"{",
"$",
"managerClass",
"=",
"$",
"json",
"[",
"'document_serialization'",
"]",
"[",
"'manager_class'",
"]",
";",
"$",
"data",
"=",
"(",
... | Deserialize the data
@param array $json
@return DocumentSerializationInterface | [
"Deserialize",
"the",
"data"
] | 78c38a5103256d829d7f7574b4e15c9087d0cfd9 | https://github.com/Thuata/FrameworkBundle/blob/78c38a5103256d829d7f7574b4e15c9087d0cfd9/Entity/DocumentSerialization.php#L87-L93 |
238,914 | dcarbone/helpers | src/JsonToList.php | JsonToList.invoke | public static function invoke($jsonString, $returnNode = false)
{
$dom = new \DOMDocument('1.0', 'UTF-8');
$jsonString = mb_convert_encoding($jsonString, 'UTF-8', mb_detect_encoding($jsonString));
$jsonDecode = json_decode($jsonString, false);
$lastError = json_last_error();
... | php | public static function invoke($jsonString, $returnNode = false)
{
$dom = new \DOMDocument('1.0', 'UTF-8');
$jsonString = mb_convert_encoding($jsonString, 'UTF-8', mb_detect_encoding($jsonString));
$jsonDecode = json_decode($jsonString, false);
$lastError = json_last_error();
... | [
"public",
"static",
"function",
"invoke",
"(",
"$",
"jsonString",
",",
"$",
"returnNode",
"=",
"false",
")",
"{",
"$",
"dom",
"=",
"new",
"\\",
"DOMDocument",
"(",
"'1.0'",
",",
"'UTF-8'",
")",
";",
"$",
"jsonString",
"=",
"mb_convert_encoding",
"(",
"$"... | Invoke the helper
@param $jsonString
@param bool $returnNode
@return \DOMNode|string | [
"Invoke",
"the",
"helper"
] | 43dc122491e38f47f22d1c7634f9c35f987ac545 | https://github.com/dcarbone/helpers/blob/43dc122491e38f47f22d1c7634f9c35f987ac545/src/JsonToList.php#L26-L56 |
238,915 | dcarbone/helpers | src/JsonToList.php | JsonToList.objectOutput | protected static function objectOutput(\stdClass $object, \DOMDocument $dom, \DOMElement $parentUL)
{
foreach($object as $k=>$v)
{
$li = $dom->createElement('li');
$parentUL->appendChild($li);
$strong = $dom->createElement('strong', $k);
$li->appendChi... | php | protected static function objectOutput(\stdClass $object, \DOMDocument $dom, \DOMElement $parentUL)
{
foreach($object as $k=>$v)
{
$li = $dom->createElement('li');
$parentUL->appendChild($li);
$strong = $dom->createElement('strong', $k);
$li->appendChi... | [
"protected",
"static",
"function",
"objectOutput",
"(",
"\\",
"stdClass",
"$",
"object",
",",
"\\",
"DOMDocument",
"$",
"dom",
",",
"\\",
"DOMElement",
"$",
"parentUL",
")",
"{",
"foreach",
"(",
"$",
"object",
"as",
"$",
"k",
"=>",
"$",
"v",
")",
"{",
... | Parse through json object
@param \stdClass $object
@param \DOMDocument $dom
@param \DOMElement $parentUL
@return \DOMDocument | [
"Parse",
"through",
"json",
"object"
] | 43dc122491e38f47f22d1c7634f9c35f987ac545 | https://github.com/dcarbone/helpers/blob/43dc122491e38f47f22d1c7634f9c35f987ac545/src/JsonToList.php#L79-L115 |
238,916 | AlphaLabs/FilterEngine | src/Bridge/Doctrine/FilteringRepositoryTrait.php | FilteringRepositoryTrait.applyFilters | public function applyFilters(QueryBuilder $queryBuilder, $alias, FilterBagInterface $filterBag = null)
{
if (is_null($filterBag)) {
return $queryBuilder;
}
foreach ($filterBag->all() as $filter) {
if ($filter instanceof FilterNode) {
$this->applyFilte... | php | public function applyFilters(QueryBuilder $queryBuilder, $alias, FilterBagInterface $filterBag = null)
{
if (is_null($filterBag)) {
return $queryBuilder;
}
foreach ($filterBag->all() as $filter) {
if ($filter instanceof FilterNode) {
$this->applyFilte... | [
"public",
"function",
"applyFilters",
"(",
"QueryBuilder",
"$",
"queryBuilder",
",",
"$",
"alias",
",",
"FilterBagInterface",
"$",
"filterBag",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"filterBag",
")",
")",
"{",
"return",
"$",
"queryBuilder",
... | Apply filters from a filter bag on the provided query builder
@param QueryBuilder $queryBuilder QueryBuilder
@param string $alias QueryBuilder root alias
@param FilterBagInterface $filterBag Filters to apply
@return QueryBuilder | [
"Apply",
"filters",
"from",
"a",
"filter",
"bag",
"on",
"the",
"provided",
"query",
"builder"
] | 806a7c31e50839033dbf0d41aed34b8d14c347f6 | https://github.com/AlphaLabs/FilterEngine/blob/806a7c31e50839033dbf0d41aed34b8d14c347f6/src/Bridge/Doctrine/FilteringRepositoryTrait.php#L31-L44 |
238,917 | AlphaLabs/FilterEngine | src/Bridge/Doctrine/FilteringRepositoryTrait.php | FilteringRepositoryTrait.applyFilter | protected function applyFilter(QueryBuilder $queryBuilder, $alias, FilterNode $filter)
{
$queryBuilderPatcher = new QueryBuilderPatcher(new QueryExpressionBuilder());
return $queryBuilderPatcher->patch($queryBuilder, $filter, new QueryContext($alias));
} | php | protected function applyFilter(QueryBuilder $queryBuilder, $alias, FilterNode $filter)
{
$queryBuilderPatcher = new QueryBuilderPatcher(new QueryExpressionBuilder());
return $queryBuilderPatcher->patch($queryBuilder, $filter, new QueryContext($alias));
} | [
"protected",
"function",
"applyFilter",
"(",
"QueryBuilder",
"$",
"queryBuilder",
",",
"$",
"alias",
",",
"FilterNode",
"$",
"filter",
")",
"{",
"$",
"queryBuilderPatcher",
"=",
"new",
"QueryBuilderPatcher",
"(",
"new",
"QueryExpressionBuilder",
"(",
")",
")",
"... | Apply one filter to the query builder
@param QueryBuilder $queryBuilder QueryBuilder
@param string $alias QueryBuilder root alias
@param FilterNode $filter Filter to apply
@return QueryBuilder | [
"Apply",
"one",
"filter",
"to",
"the",
"query",
"builder"
] | 806a7c31e50839033dbf0d41aed34b8d14c347f6 | https://github.com/AlphaLabs/FilterEngine/blob/806a7c31e50839033dbf0d41aed34b8d14c347f6/src/Bridge/Doctrine/FilteringRepositoryTrait.php#L55-L60 |
238,918 | SymBB/symbb | src/Symbb/Core/SystemBundle/Api/AbstractApi.php | AbstractApi.addErrorMessage | public function addErrorMessage($message, $params = array())
{
$message = $this->trans($message, $params);
static::$messages[] = array(
'type' => 'error',
'bootstrapType' => 'danger',
'message' => $message
);
static::$success = false;
} | php | public function addErrorMessage($message, $params = array())
{
$message = $this->trans($message, $params);
static::$messages[] = array(
'type' => 'error',
'bootstrapType' => 'danger',
'message' => $message
);
static::$success = false;
} | [
"public",
"function",
"addErrorMessage",
"(",
"$",
"message",
",",
"$",
"params",
"=",
"array",
"(",
")",
")",
"{",
"$",
"message",
"=",
"$",
"this",
"->",
"trans",
"(",
"$",
"message",
",",
"$",
"params",
")",
";",
"static",
"::",
"$",
"messages",
... | add a error message to the api call
@param $message | [
"add",
"a",
"error",
"message",
"to",
"the",
"api",
"call"
] | be25357502e6a51016fa0b128a46c2dc87fa8fb2 | https://github.com/SymBB/symbb/blob/be25357502e6a51016fa0b128a46c2dc87fa8fb2/src/Symbb/Core/SystemBundle/Api/AbstractApi.php#L260-L269 |
238,919 | SymBB/symbb | src/Symbb/Core/SystemBundle/Api/AbstractApi.php | AbstractApi.addSuccessMessage | public function addSuccessMessage($message, $params = array())
{
$message = $this->trans($message, $params);
static::$messages[$message] = array(
'type' => 'success',
'bootstrapType' => 'success',
'message' => $message
);
} | php | public function addSuccessMessage($message, $params = array())
{
$message = $this->trans($message, $params);
static::$messages[$message] = array(
'type' => 'success',
'bootstrapType' => 'success',
'message' => $message
);
} | [
"public",
"function",
"addSuccessMessage",
"(",
"$",
"message",
",",
"$",
"params",
"=",
"array",
"(",
")",
")",
"{",
"$",
"message",
"=",
"$",
"this",
"->",
"trans",
"(",
"$",
"message",
",",
"$",
"params",
")",
";",
"static",
"::",
"$",
"messages",... | add a success message to the api call
@param $message | [
"add",
"a",
"success",
"message",
"to",
"the",
"api",
"call"
] | be25357502e6a51016fa0b128a46c2dc87fa8fb2 | https://github.com/SymBB/symbb/blob/be25357502e6a51016fa0b128a46c2dc87fa8fb2/src/Symbb/Core/SystemBundle/Api/AbstractApi.php#L275-L283 |
238,920 | SymBB/symbb | src/Symbb/Core/SystemBundle/Api/AbstractApi.php | AbstractApi.addInfoMessage | public function addInfoMessage($message, $params = array())
{
$message = $this->trans($message, $params);
static::$messages[] = array(
'type' => 'info',
'bootstrapType' => 'info',
'message' => $message
);
} | php | public function addInfoMessage($message, $params = array())
{
$message = $this->trans($message, $params);
static::$messages[] = array(
'type' => 'info',
'bootstrapType' => 'info',
'message' => $message
);
} | [
"public",
"function",
"addInfoMessage",
"(",
"$",
"message",
",",
"$",
"params",
"=",
"array",
"(",
")",
")",
"{",
"$",
"message",
"=",
"$",
"this",
"->",
"trans",
"(",
"$",
"message",
",",
"$",
"params",
")",
";",
"static",
"::",
"$",
"messages",
... | add a info message to the api call
@param $message | [
"add",
"a",
"info",
"message",
"to",
"the",
"api",
"call"
] | be25357502e6a51016fa0b128a46c2dc87fa8fb2 | https://github.com/SymBB/symbb/blob/be25357502e6a51016fa0b128a46c2dc87fa8fb2/src/Symbb/Core/SystemBundle/Api/AbstractApi.php#L289-L297 |
238,921 | SymBB/symbb | src/Symbb/Core/SystemBundle/Api/AbstractApi.php | AbstractApi.addWarningMessage | public function addWarningMessage($message, $params = array())
{
$message = $this->trans($message, $params);
static::$messages[] = array(
'type' => 'warning',
'bootstrapType' => 'warning',
'message' => $message
);
} | php | public function addWarningMessage($message, $params = array())
{
$message = $this->trans($message, $params);
static::$messages[] = array(
'type' => 'warning',
'bootstrapType' => 'warning',
'message' => $message
);
} | [
"public",
"function",
"addWarningMessage",
"(",
"$",
"message",
",",
"$",
"params",
"=",
"array",
"(",
")",
")",
"{",
"$",
"message",
"=",
"$",
"this",
"->",
"trans",
"(",
"$",
"message",
",",
"$",
"params",
")",
";",
"static",
"::",
"$",
"messages",... | add a warning message to the api
@param $message | [
"add",
"a",
"warning",
"message",
"to",
"the",
"api"
] | be25357502e6a51016fa0b128a46c2dc87fa8fb2 | https://github.com/SymBB/symbb/blob/be25357502e6a51016fa0b128a46c2dc87fa8fb2/src/Symbb/Core/SystemBundle/Api/AbstractApi.php#L303-L311 |
238,922 | zepi/turbo-base | Zepi/Web/AccessControl/src/EventHandler/DisplayNoAccessMessage.php | DisplayNoAccessMessage.execute | public function execute(Framework $framework, WebRequest $request, Response $response)
{
$renderedOutput = $this->render('\\Zepi\\Web\\AccessControl\\Templates\\NoAccessMessage');
$response->setOutput($renderedOutput);
} | php | public function execute(Framework $framework, WebRequest $request, Response $response)
{
$renderedOutput = $this->render('\\Zepi\\Web\\AccessControl\\Templates\\NoAccessMessage');
$response->setOutput($renderedOutput);
} | [
"public",
"function",
"execute",
"(",
"Framework",
"$",
"framework",
",",
"WebRequest",
"$",
"request",
",",
"Response",
"$",
"response",
")",
"{",
"$",
"renderedOutput",
"=",
"$",
"this",
"->",
"render",
"(",
"'\\\\Zepi\\\\Web\\\\AccessControl\\\\Templates\\\\NoAcc... | Displays a message if the session has no access to the requested command.
@param \Zepi\Turbo\Framework $framework
@param \Zepi\Turbo\Request\WebRequest $request
@param \Zepi\Turbo\Response\Response $response | [
"Displays",
"a",
"message",
"if",
"the",
"session",
"has",
"no",
"access",
"to",
"the",
"requested",
"command",
"."
] | 9a36d8c7649317f55f91b2adf386bd1f04ec02a3 | https://github.com/zepi/turbo-base/blob/9a36d8c7649317f55f91b2adf386bd1f04ec02a3/Zepi/Web/AccessControl/src/EventHandler/DisplayNoAccessMessage.php#L58-L63 |
238,923 | MarcusFulbright/represent | src/Represent/Handler/PropertyHandler.php | PropertyHandler.getPropertyAnnotation | public function getPropertyAnnotation(\ReflectionProperty $property)
{
$annot = $this->reader->getPropertyAnnotation($property, '\Represent\Annotations\Property');
if (!$annot) {
return false;
}
return $annot;
} | php | public function getPropertyAnnotation(\ReflectionProperty $property)
{
$annot = $this->reader->getPropertyAnnotation($property, '\Represent\Annotations\Property');
if (!$annot) {
return false;
}
return $annot;
} | [
"public",
"function",
"getPropertyAnnotation",
"(",
"\\",
"ReflectionProperty",
"$",
"property",
")",
"{",
"$",
"annot",
"=",
"$",
"this",
"->",
"reader",
"->",
"getPropertyAnnotation",
"(",
"$",
"property",
",",
"'\\Represent\\Annotations\\Property'",
")",
";",
"... | Returns the property annotation or false if one is not present;
@param \ReflectionProperty $property
@return bool|Property | [
"Returns",
"the",
"property",
"annotation",
"or",
"false",
"if",
"one",
"is",
"not",
"present",
";"
] | f7b624f473a3247a29f05c4a694d04bba4038e59 | https://github.com/MarcusFulbright/represent/blob/f7b624f473a3247a29f05c4a694d04bba4038e59/src/Represent/Handler/PropertyHandler.php#L35-L44 |
238,924 | MarcusFulbright/represent | src/Represent/Handler/PropertyHandler.php | PropertyHandler.getSerializedName | public function getSerializedName(\ReflectionProperty $property, Property $annot = null)
{
if ($annot || $annot = $this->getPropertyAnnotation($property)) {
return $annot->getName();
}
return $property->getName();
} | php | public function getSerializedName(\ReflectionProperty $property, Property $annot = null)
{
if ($annot || $annot = $this->getPropertyAnnotation($property)) {
return $annot->getName();
}
return $property->getName();
} | [
"public",
"function",
"getSerializedName",
"(",
"\\",
"ReflectionProperty",
"$",
"property",
",",
"Property",
"$",
"annot",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"annot",
"||",
"$",
"annot",
"=",
"$",
"this",
"->",
"getPropertyAnnotation",
"(",
"$",
"prop... | Returns the serialized name for this property
@param \ReflectionProperty $property
@param Property $annot
@return string | [
"Returns",
"the",
"serialized",
"name",
"for",
"this",
"property"
] | f7b624f473a3247a29f05c4a694d04bba4038e59 | https://github.com/MarcusFulbright/represent/blob/f7b624f473a3247a29f05c4a694d04bba4038e59/src/Represent/Handler/PropertyHandler.php#L53-L61 |
238,925 | MarcusFulbright/represent | src/Represent/Handler/PropertyHandler.php | PropertyHandler.propertyTypeOverride | public function propertyTypeOverride(Property $annot = null, \ReflectionProperty $property = null)
{
if ($annot || $annot = $this->getPropertyAnnotation($property)) {
return $annot->getType();
}
return null;
} | php | public function propertyTypeOverride(Property $annot = null, \ReflectionProperty $property = null)
{
if ($annot || $annot = $this->getPropertyAnnotation($property)) {
return $annot->getType();
}
return null;
} | [
"public",
"function",
"propertyTypeOverride",
"(",
"Property",
"$",
"annot",
"=",
"null",
",",
"\\",
"ReflectionProperty",
"$",
"property",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"annot",
"||",
"$",
"annot",
"=",
"$",
"this",
"->",
"getPropertyAnnotation",
... | Returns the type this property is changed to during serialization or false if no conversion occurs
@param \ReflectionProperty $property
@param Property $annot
@return null|string | [
"Returns",
"the",
"type",
"this",
"property",
"is",
"changed",
"to",
"during",
"serialization",
"or",
"false",
"if",
"no",
"conversion",
"occurs"
] | f7b624f473a3247a29f05c4a694d04bba4038e59 | https://github.com/MarcusFulbright/represent/blob/f7b624f473a3247a29f05c4a694d04bba4038e59/src/Represent/Handler/PropertyHandler.php#L70-L78 |
238,926 | MarcusFulbright/represent | src/Represent/Handler/PropertyHandler.php | PropertyHandler.getConvertedValue | public function getConvertedValue(\ReflectionProperty $property, $original, Property $annot = null)
{
return $this->handleTypeConversion($this->propertyTypeOverride($annot, $property), $property->getValue($original));
} | php | public function getConvertedValue(\ReflectionProperty $property, $original, Property $annot = null)
{
return $this->handleTypeConversion($this->propertyTypeOverride($annot, $property), $property->getValue($original));
} | [
"public",
"function",
"getConvertedValue",
"(",
"\\",
"ReflectionProperty",
"$",
"property",
",",
"$",
"original",
",",
"Property",
"$",
"annot",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"handleTypeConversion",
"(",
"$",
"this",
"->",
"propertyTypeO... | Returns the value used for serialization from a reflection property
@param \ReflectionProperty $property
@param $original
@param Property $annot
@return bool|DateTime|int|string | [
"Returns",
"the",
"value",
"used",
"for",
"serialization",
"from",
"a",
"reflection",
"property"
] | f7b624f473a3247a29f05c4a694d04bba4038e59 | https://github.com/MarcusFulbright/represent/blob/f7b624f473a3247a29f05c4a694d04bba4038e59/src/Represent/Handler/PropertyHandler.php#L88-L91 |
238,927 | WellCommerce/Form | Formatter/JavascriptFormatter.php | JavascriptFormatter.formatAttributeValue | protected function formatAttributeValue(Attribute $attribute)
{
$value = $attribute->getValue();
if ($attribute->getType() === Attribute::TYPE_FUNCTION && strlen($value)) {
return new Expr($value);
}
return $value;
} | php | protected function formatAttributeValue(Attribute $attribute)
{
$value = $attribute->getValue();
if ($attribute->getType() === Attribute::TYPE_FUNCTION && strlen($value)) {
return new Expr($value);
}
return $value;
} | [
"protected",
"function",
"formatAttributeValue",
"(",
"Attribute",
"$",
"attribute",
")",
"{",
"$",
"value",
"=",
"$",
"attribute",
"->",
"getValue",
"(",
")",
";",
"if",
"(",
"$",
"attribute",
"->",
"getType",
"(",
")",
"===",
"Attribute",
"::",
"TYPE_FUN... | Formats attributes value
@param Attribute $attribute
@return mixed|Expr | [
"Formats",
"attributes",
"value"
] | dad15dbdcf1d13f927fa86f5198bcb6abed1974a | https://github.com/WellCommerce/Form/blob/dad15dbdcf1d13f927fa86f5198bcb6abed1974a/Formatter/JavascriptFormatter.php#L121-L130 |
238,928 | iwillhappy1314/wenprise-eloquent | src/WP/User.php | User.getAvatarAttribute | public function getAvatarAttribute()
{
$hash = ! empty($this->email) ? md5(strtolower(trim($this->email))) : '';
return sprintf('//secure.gravatar.com/avatar/%s?d=mm', $hash);
} | php | public function getAvatarAttribute()
{
$hash = ! empty($this->email) ? md5(strtolower(trim($this->email))) : '';
return sprintf('//secure.gravatar.com/avatar/%s?d=mm', $hash);
} | [
"public",
"function",
"getAvatarAttribute",
"(",
")",
"{",
"$",
"hash",
"=",
"!",
"empty",
"(",
"$",
"this",
"->",
"email",
")",
"?",
"md5",
"(",
"strtolower",
"(",
"trim",
"(",
"$",
"this",
"->",
"email",
")",
")",
")",
":",
"''",
";",
"return",
... | Get the avatar url from Gravatar
@return string | [
"Get",
"the",
"avatar",
"url",
"from",
"Gravatar"
] | 7eb045c7d19aaf5e7438625558a390ce39f1a34e | https://github.com/iwillhappy1314/wenprise-eloquent/blob/7eb045c7d19aaf5e7438625558a390ce39f1a34e/src/WP/User.php#L188-L193 |
238,929 | Schibsted-Tech-Polska/travis-ci-client | src/Stp/TravisClient/Client.php | Client.prepareParametersUrl | private function prepareParametersUrl(array $params, array $allowedParams)
{
$allowedParams = array_flip($allowedParams);
$params = array_intersect_key($params, $allowedParams);
$paramsUrlItems = [];
foreach ($params as $key => $param) {
$paramsUrlItems[] = $key . '=' . ... | php | private function prepareParametersUrl(array $params, array $allowedParams)
{
$allowedParams = array_flip($allowedParams);
$params = array_intersect_key($params, $allowedParams);
$paramsUrlItems = [];
foreach ($params as $key => $param) {
$paramsUrlItems[] = $key . '=' . ... | [
"private",
"function",
"prepareParametersUrl",
"(",
"array",
"$",
"params",
",",
"array",
"$",
"allowedParams",
")",
"{",
"$",
"allowedParams",
"=",
"array_flip",
"(",
"$",
"allowedParams",
")",
";",
"$",
"params",
"=",
"array_intersect_key",
"(",
"$",
"params... | Prepares params url that can be appended to request.
@param array $params
@param array $allowedParams
@return string | [
"Prepares",
"params",
"url",
"that",
"can",
"be",
"appended",
"to",
"request",
"."
] | 6c0a67a72e970efe4a8a924eae7119d5c8ab0fac | https://github.com/Schibsted-Tech-Polska/travis-ci-client/blob/6c0a67a72e970efe4a8a924eae7119d5c8ab0fac/src/Stp/TravisClient/Client.php#L203-L219 |
238,930 | browserfs/base | src/EventEmitter.php | EventEmitter.on | public final function on( $eventName, $eventCallback ) {
if ( !is_string( $eventName ) ) {
throw new \browserfs\Exception('Invalid argument $eventName: string expected');
} else {
if ( !strlen( $eventName ) ) {
throw new \browserfs\Exception('Invalid argument $eventName: expected ... | php | public final function on( $eventName, $eventCallback ) {
if ( !is_string( $eventName ) ) {
throw new \browserfs\Exception('Invalid argument $eventName: string expected');
} else {
if ( !strlen( $eventName ) ) {
throw new \browserfs\Exception('Invalid argument $eventName: expected ... | [
"public",
"final",
"function",
"on",
"(",
"$",
"eventName",
",",
"$",
"eventCallback",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"eventName",
")",
")",
"{",
"throw",
"new",
"\\",
"browserfs",
"\\",
"Exception",
"(",
"'Invalid argument $eventName: stri... | Adds a event listener.
@param eventName: string
@param eventCallback: callable( $e: \browserfs\Event ) => void
@throws \browserfs\Exception | [
"Adds",
"a",
"event",
"listener",
"."
] | d98550b5cf6f6e9083f99f39d17fd1b79d61db55 | https://github.com/browserfs/base/blob/d98550b5cf6f6e9083f99f39d17fd1b79d61db55/src/EventEmitter.php#L16-L50 |
238,931 | browserfs/base | src/EventEmitter.php | EventEmitter.once | public final function once( $eventName, $eventCallback ) {
if ( !is_string( $eventName ) ) {
throw new \browserfs\Exception('Invalid argument $eventName: string expected');
} else {
if ( !strlen( $eventName ) ) {
throw new \browserfs\Exception('Invalid argument $eventName: expected n... | php | public final function once( $eventName, $eventCallback ) {
if ( !is_string( $eventName ) ) {
throw new \browserfs\Exception('Invalid argument $eventName: string expected');
} else {
if ( !strlen( $eventName ) ) {
throw new \browserfs\Exception('Invalid argument $eventName: expected n... | [
"public",
"final",
"function",
"once",
"(",
"$",
"eventName",
",",
"$",
"eventCallback",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"eventName",
")",
")",
"{",
"throw",
"new",
"\\",
"browserfs",
"\\",
"Exception",
"(",
"'Invalid argument $eventName: st... | Adds a event listener that will be fired only once.
@param eventName: string
@param eventCallback: callable( $e: \browserfs\Event ) => void
@throws \browserfs\Exception | [
"Adds",
"a",
"event",
"listener",
"that",
"will",
"be",
"fired",
"only",
"once",
"."
] | d98550b5cf6f6e9083f99f39d17fd1b79d61db55 | https://github.com/browserfs/base/blob/d98550b5cf6f6e9083f99f39d17fd1b79d61db55/src/EventEmitter.php#L58-L88 |
238,932 | browserfs/base | src/EventEmitter.php | EventEmitter.callbackEquals | private static function callbackEquals( $callback1, $callback2 ) {
if ( is_array( $callback1 ) && is_array( $callback2 ) ) {
if ( count( $callback1 ) == count( $callback2 ) ) {
for ( $i=0, $len = count( $callback1 ); $i<$len; $i++ ) {
if ( $callback1[$i] != $callback2[$i] ) {
return ... | php | private static function callbackEquals( $callback1, $callback2 ) {
if ( is_array( $callback1 ) && is_array( $callback2 ) ) {
if ( count( $callback1 ) == count( $callback2 ) ) {
for ( $i=0, $len = count( $callback1 ); $i<$len; $i++ ) {
if ( $callback1[$i] != $callback2[$i] ) {
return ... | [
"private",
"static",
"function",
"callbackEquals",
"(",
"$",
"callback1",
",",
"$",
"callback2",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"callback1",
")",
"&&",
"is_array",
"(",
"$",
"callback2",
")",
")",
"{",
"if",
"(",
"count",
"(",
"$",
"callbac... | Helper to compare if two callbacks are equal.
@param callback1 - callable
@param callback2 - callable | [
"Helper",
"to",
"compare",
"if",
"two",
"callbacks",
"are",
"equal",
"."
] | d98550b5cf6f6e9083f99f39d17fd1b79d61db55 | https://github.com/browserfs/base/blob/d98550b5cf6f6e9083f99f39d17fd1b79d61db55/src/EventEmitter.php#L95-L121 |
238,933 | browserfs/base | src/EventEmitter.php | EventEmitter.off | public final function off( $eventName, $eventCallback = null ) {
if ( is_string( $eventName ) ) {
if ( strlen( $eventName ) > 0 ) {
if ( isset( $this->events[ $eventName ] ) ) {
if ( $eventCallback === null ) {
unset( $this->events[ $eventName ] );
} else {
for ( $i = ... | php | public final function off( $eventName, $eventCallback = null ) {
if ( is_string( $eventName ) ) {
if ( strlen( $eventName ) > 0 ) {
if ( isset( $this->events[ $eventName ] ) ) {
if ( $eventCallback === null ) {
unset( $this->events[ $eventName ] );
} else {
for ( $i = ... | [
"public",
"final",
"function",
"off",
"(",
"$",
"eventName",
",",
"$",
"eventCallback",
"=",
"null",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"eventName",
")",
")",
"{",
"if",
"(",
"strlen",
"(",
"$",
"eventName",
")",
">",
"0",
")",
"{",
"if",
... | Removes a event listener callback binded to eventName
@param eventName - string - > the name of the event
@param eventCallback -> [ callable( $e: \browserfs\Event ): void ] -> a callable function that
was previously added with the "on" or "once" methods. If unspecified, all listeners
that were added to eventName will b... | [
"Removes",
"a",
"event",
"listener",
"callback",
"binded",
"to",
"eventName"
] | d98550b5cf6f6e9083f99f39d17fd1b79d61db55 | https://github.com/browserfs/base/blob/d98550b5cf6f6e9083f99f39d17fd1b79d61db55/src/EventEmitter.php#L130-L177 |
238,934 | browserfs/base | src/EventEmitter.php | EventEmitter.fire | public final function fire( $eventName /* ... $eventArgs: any[] */ ) {
if ( !is_string( $eventName ) ) {
throw new \browserfs\Exception('Invalid argument $eventName: string expected' );
} else
if ( !strlen( $eventName ) ) {
throw new \browserfs\Exception('Invalid argument $eventName: non-empty string ... | php | public final function fire( $eventName /* ... $eventArgs: any[] */ ) {
if ( !is_string( $eventName ) ) {
throw new \browserfs\Exception('Invalid argument $eventName: string expected' );
} else
if ( !strlen( $eventName ) ) {
throw new \browserfs\Exception('Invalid argument $eventName: non-empty string ... | [
"public",
"final",
"function",
"fire",
"(",
"$",
"eventName",
"/* ... $eventArgs: any[] */",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"eventName",
")",
")",
"{",
"throw",
"new",
"\\",
"browserfs",
"\\",
"Exception",
"(",
"'Invalid argument $eventName: st... | Fires a event, and returns it's generated event object.
@param $eventName: string -> the name of the event to be fired
@param ...$eventArgs: any[] -> event arguments
@return \browserfs\Event -> event object
@throws \Exception | [
"Fires",
"a",
"event",
"and",
"returns",
"it",
"s",
"generated",
"event",
"object",
"."
] | d98550b5cf6f6e9083f99f39d17fd1b79d61db55 | https://github.com/browserfs/base/blob/d98550b5cf6f6e9083f99f39d17fd1b79d61db55/src/EventEmitter.php#L186-L252 |
238,935 | sebardo/ecommerce | EcommerceBundle/Entity/Repository/CategoryRepository.php | CategoryRepository.findNextSubcategory | public function findNextSubcategory($subcategory)
{
$qb = $this->getQueryBuilder()
->select('c')
->where('c.id > :id')
->andWhere('c.parentCategory = :parentCategory')
->orderBy('c.id', 'asc')
->setMaxResults(1)
->setParameter('id', $su... | php | public function findNextSubcategory($subcategory)
{
$qb = $this->getQueryBuilder()
->select('c')
->where('c.id > :id')
->andWhere('c.parentCategory = :parentCategory')
->orderBy('c.id', 'asc')
->setMaxResults(1)
->setParameter('id', $su... | [
"public",
"function",
"findNextSubcategory",
"(",
"$",
"subcategory",
")",
"{",
"$",
"qb",
"=",
"$",
"this",
"->",
"getQueryBuilder",
"(",
")",
"->",
"select",
"(",
"'c'",
")",
"->",
"where",
"(",
"'c.id > :id'",
")",
"->",
"andWhere",
"(",
"'c.parentCateg... | Find the next subcategory, or the first one if none is found
@param Category $subcategory
@return Category|null | [
"Find",
"the",
"next",
"subcategory",
"or",
"the",
"first",
"one",
"if",
"none",
"is",
"found"
] | 3e17545e69993f10a1df17f9887810c7378fc7f9 | https://github.com/sebardo/ecommerce/blob/3e17545e69993f10a1df17f9887810c7378fc7f9/EcommerceBundle/Entity/Repository/CategoryRepository.php#L234-L259 |
238,936 | sebardo/ecommerce | EcommerceBundle/Entity/Repository/CategoryRepository.php | CategoryRepository.getBrands | public function getBrands($category, $limit = null)
{
$qb = $this->getQueryBuilder()
->select('DISTINCT b.id, b.name')
->innerJoin('c.products', 'p')
->innerJoin('p.brand', 'b')
->where('p.active = TRUE')
->andWhere('b.available = TRUE');
... | php | public function getBrands($category, $limit = null)
{
$qb = $this->getQueryBuilder()
->select('DISTINCT b.id, b.name')
->innerJoin('c.products', 'p')
->innerJoin('p.brand', 'b')
->where('p.active = TRUE')
->andWhere('b.available = TRUE');
... | [
"public",
"function",
"getBrands",
"(",
"$",
"category",
",",
"$",
"limit",
"=",
"null",
")",
"{",
"$",
"qb",
"=",
"$",
"this",
"->",
"getQueryBuilder",
"(",
")",
"->",
"select",
"(",
"'DISTINCT b.id, b.name'",
")",
"->",
"innerJoin",
"(",
"'c.products'",
... | Get brands from their products relationship
@param Category $category
@param integer|null $limit
@return ArrayCollection | [
"Get",
"brands",
"from",
"their",
"products",
"relationship"
] | 3e17545e69993f10a1df17f9887810c7378fc7f9 | https://github.com/sebardo/ecommerce/blob/3e17545e69993f10a1df17f9887810c7378fc7f9/EcommerceBundle/Entity/Repository/CategoryRepository.php#L269-L294 |
238,937 | samurai-fw/samurai | src/Samurai/Component/FileSystem/Finder/Finder.php | Finder.find | public function find($paths = null)
{
if ($paths === null) $paths = $this->paths;
// iterator
$iterator = $this->getIterator();
// search in target paths
foreach ((array)$paths as $path) {
$this->searchInPath($iterator, $path);
}
// clear
... | php | public function find($paths = null)
{
if ($paths === null) $paths = $this->paths;
// iterator
$iterator = $this->getIterator();
// search in target paths
foreach ((array)$paths as $path) {
$this->searchInPath($iterator, $path);
}
// clear
... | [
"public",
"function",
"find",
"(",
"$",
"paths",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"paths",
"===",
"null",
")",
"$",
"paths",
"=",
"$",
"this",
"->",
"paths",
";",
"// iterator",
"$",
"iterator",
"=",
"$",
"this",
"->",
"getIterator",
"(",
")"... | find trigger.
@param string|array $paths | [
"find",
"trigger",
"."
] | 7ca3847b13f86e2847a17ab5e8e4e20893021d5a | https://github.com/samurai-fw/samurai/blob/7ca3847b13f86e2847a17ab5e8e4e20893021d5a/src/Samurai/Component/FileSystem/Finder/Finder.php#L115-L131 |
238,938 | samurai-fw/samurai | src/Samurai/Component/FileSystem/Finder/Finder.php | Finder.searchInPath | private function searchInPath(FileSystem\Iterator\IteratorAggregate $iterator, $path, FileSystem\Directory $parent = null, $depth = 0)
{
// when exists.
if (file_exists($path)) {
if(is_dir($path)) {
$dir = new FileSystem\Directory($path);
if ($parent) $dir... | php | private function searchInPath(FileSystem\Iterator\IteratorAggregate $iterator, $path, FileSystem\Directory $parent = null, $depth = 0)
{
// when exists.
if (file_exists($path)) {
if(is_dir($path)) {
$dir = new FileSystem\Directory($path);
if ($parent) $dir... | [
"private",
"function",
"searchInPath",
"(",
"FileSystem",
"\\",
"Iterator",
"\\",
"IteratorAggregate",
"$",
"iterator",
",",
"$",
"path",
",",
"FileSystem",
"\\",
"Directory",
"$",
"parent",
"=",
"null",
",",
"$",
"depth",
"=",
"0",
")",
"{",
"// when exists... | search files in target path.
@param Samurai\Samurai\Component\FileSystem\Iterator\IteratorAggregate $iterator
@param string $path
@param Samurai\Samurai\Component\FileSystem\Directory $parent
@param int $depth
@return array | [
"search",
"files",
"in",
"target",
"path",
"."
] | 7ca3847b13f86e2847a17ab5e8e4e20893021d5a | https://github.com/samurai-fw/samurai/blob/7ca3847b13f86e2847a17ab5e8e4e20893021d5a/src/Samurai/Component/FileSystem/Finder/Finder.php#L143-L166 |
238,939 | samurai-fw/samurai | src/Samurai/Component/FileSystem/Finder/Finder.php | Finder.validate | private function validate(FileSystem\File $file)
{
$filters = $this->buildFilters();
foreach ($filters as $filter) {
if (! $filter->validate($file)) return false;
}
return true;
} | php | private function validate(FileSystem\File $file)
{
$filters = $this->buildFilters();
foreach ($filters as $filter) {
if (! $filter->validate($file)) return false;
}
return true;
} | [
"private",
"function",
"validate",
"(",
"FileSystem",
"\\",
"File",
"$",
"file",
")",
"{",
"$",
"filters",
"=",
"$",
"this",
"->",
"buildFilters",
"(",
")",
";",
"foreach",
"(",
"$",
"filters",
"as",
"$",
"filter",
")",
"{",
"if",
"(",
"!",
"$",
"f... | validate file.
@param Samurai\Samurai\Component\FileSystem\File $file
@return boolean | [
"validate",
"file",
"."
] | 7ca3847b13f86e2847a17ab5e8e4e20893021d5a | https://github.com/samurai-fw/samurai/blob/7ca3847b13f86e2847a17ab5e8e4e20893021d5a/src/Samurai/Component/FileSystem/Finder/Finder.php#L175-L183 |
238,940 | samurai-fw/samurai | src/Samurai/Component/FileSystem/Finder/Finder.php | Finder.buildFilters | private function buildFilters()
{
$filters = array();
// file only ? or direcotry only ?
if ($this->file_only) $filters[] = new Filter\FileOnlyFilter();
if ($this->directory_only) $filters[] = new Filter\DirectoryOnlyFilter();
// name match ?
foreach ($this->names a... | php | private function buildFilters()
{
$filters = array();
// file only ? or direcotry only ?
if ($this->file_only) $filters[] = new Filter\FileOnlyFilter();
if ($this->directory_only) $filters[] = new Filter\DirectoryOnlyFilter();
// name match ?
foreach ($this->names a... | [
"private",
"function",
"buildFilters",
"(",
")",
"{",
"$",
"filters",
"=",
"array",
"(",
")",
";",
"// file only ? or direcotry only ?",
"if",
"(",
"$",
"this",
"->",
"file_only",
")",
"$",
"filters",
"[",
"]",
"=",
"new",
"Filter",
"\\",
"FileOnlyFilter",
... | build filters for validate.
@return array | [
"build",
"filters",
"for",
"validate",
"."
] | 7ca3847b13f86e2847a17ab5e8e4e20893021d5a | https://github.com/samurai-fw/samurai/blob/7ca3847b13f86e2847a17ab5e8e4e20893021d5a/src/Samurai/Component/FileSystem/Finder/Finder.php#L191-L205 |
238,941 | samurai-fw/samurai | src/Samurai/Component/FileSystem/Finder/Finder.php | Finder.fileOnly | public function fileOnly($flag = true)
{
$this->file_only = $flag;
if ($this->file_only) $this->directory_only = false;
return $this;
} | php | public function fileOnly($flag = true)
{
$this->file_only = $flag;
if ($this->file_only) $this->directory_only = false;
return $this;
} | [
"public",
"function",
"fileOnly",
"(",
"$",
"flag",
"=",
"true",
")",
"{",
"$",
"this",
"->",
"file_only",
"=",
"$",
"flag",
";",
"if",
"(",
"$",
"this",
"->",
"file_only",
")",
"$",
"this",
"->",
"directory_only",
"=",
"false",
";",
"return",
"$",
... | set file only flag is true
@return Samurai\Samurai\Component\FileSystem\Finder\Finder | [
"set",
"file",
"only",
"flag",
"is",
"true"
] | 7ca3847b13f86e2847a17ab5e8e4e20893021d5a | https://github.com/samurai-fw/samurai/blob/7ca3847b13f86e2847a17ab5e8e4e20893021d5a/src/Samurai/Component/FileSystem/Finder/Finder.php#L250-L255 |
238,942 | samurai-fw/samurai | src/Samurai/Component/FileSystem/Finder/Finder.php | Finder.directoryOnly | public function directoryOnly($flag = true)
{
$this->directory_only = $flag;
if ($this->directory_only) $this->file_only = false;
return $this;
} | php | public function directoryOnly($flag = true)
{
$this->directory_only = $flag;
if ($this->directory_only) $this->file_only = false;
return $this;
} | [
"public",
"function",
"directoryOnly",
"(",
"$",
"flag",
"=",
"true",
")",
"{",
"$",
"this",
"->",
"directory_only",
"=",
"$",
"flag",
";",
"if",
"(",
"$",
"this",
"->",
"directory_only",
")",
"$",
"this",
"->",
"file_only",
"=",
"false",
";",
"return"... | set directory only is true.
@param boolean $flag
@return Samurai\Samurai\Component\FileSystem\Finder\Finder | [
"set",
"directory",
"only",
"is",
"true",
"."
] | 7ca3847b13f86e2847a17ab5e8e4e20893021d5a | https://github.com/samurai-fw/samurai/blob/7ca3847b13f86e2847a17ab5e8e4e20893021d5a/src/Samurai/Component/FileSystem/Finder/Finder.php#L263-L268 |
238,943 | DatingVIP/IRC | src/DatingVIP/IRC/Robot.php | Robot.removeListener | public function removeListener(Listener $listener) {
foreach ($this->listeners as $id => $listening) {
if ($listener == $listening) {
unset($this->listeners[$id]);
break;
}
}
} | php | public function removeListener(Listener $listener) {
foreach ($this->listeners as $id => $listening) {
if ($listener == $listening) {
unset($this->listeners[$id]);
break;
}
}
} | [
"public",
"function",
"removeListener",
"(",
"Listener",
"$",
"listener",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"listeners",
"as",
"$",
"id",
"=>",
"$",
"listening",
")",
"{",
"if",
"(",
"$",
"listener",
"==",
"$",
"listening",
")",
"{",
"unset"... | Remove a Listener Object
@param Listener listener
@note must be executed synchronously (in the context that created the Robot) | [
"Remove",
"a",
"Listener",
"Object"
] | c09add1317210cd772529146fc617130db957c16 | https://github.com/DatingVIP/IRC/blob/c09add1317210cd772529146fc617130db957c16/src/DatingVIP/IRC/Robot.php#L34-L41 |
238,944 | DatingVIP/IRC | src/DatingVIP/IRC/Robot.php | Robot.login | public function login($nick, $password = null) {
if ($password) {
if (!$this->connection->send("PASS {$password}")) {
throw new \RuntimeException(
"failed to send password to {$this->server}");
}
} else {
if (!$this->connection->send("PASS NOPASS")) {
throw new \RuntimeException(
"failed ... | php | public function login($nick, $password = null) {
if ($password) {
if (!$this->connection->send("PASS {$password}")) {
throw new \RuntimeException(
"failed to send password to {$this->server}");
}
} else {
if (!$this->connection->send("PASS NOPASS")) {
throw new \RuntimeException(
"failed ... | [
"public",
"function",
"login",
"(",
"$",
"nick",
",",
"$",
"password",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"password",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"connection",
"->",
"send",
"(",
"\"PASS {$password}\"",
")",
")",
"{",
"throw",
... | Login into server as nick with optional password
@param string nick
@param string password
@return Connection
@throws \RuntimeException | [
"Login",
"into",
"server",
"as",
"nick",
"with",
"optional",
"password"
] | c09add1317210cd772529146fc617130db957c16 | https://github.com/DatingVIP/IRC/blob/c09add1317210cd772529146fc617130db957c16/src/DatingVIP/IRC/Robot.php#L68-L96 |
238,945 | DatingVIP/IRC | src/DatingVIP/IRC/Robot.php | Robot.loop | public function loop($main = true) {
if ($main && $this->manager) {
$this->manager->onStartup($this);
}
while (($line = $this->connection->recv())) {
if (preg_match("~^ping :(.*)?~i", $line, $pong)) {
if (!$this->connection->send("PONG {$pong[1]}")) {
throw new \RuntimeException(
"failed t... | php | public function loop($main = true) {
if ($main && $this->manager) {
$this->manager->onStartup($this);
}
while (($line = $this->connection->recv())) {
if (preg_match("~^ping :(.*)?~i", $line, $pong)) {
if (!$this->connection->send("PONG {$pong[1]}")) {
throw new \RuntimeException(
"failed t... | [
"public",
"function",
"loop",
"(",
"$",
"main",
"=",
"true",
")",
"{",
"if",
"(",
"$",
"main",
"&&",
"$",
"this",
"->",
"manager",
")",
"{",
"$",
"this",
"->",
"manager",
"->",
"onStartup",
"(",
"$",
"this",
")",
";",
"}",
"while",
"(",
"(",
"$... | Enter into IO loop
@param boolean main
@return Connection
@throws \RuntimeException | [
"Enter",
"into",
"IO",
"loop"
] | c09add1317210cd772529146fc617130db957c16 | https://github.com/DatingVIP/IRC/blob/c09add1317210cd772529146fc617130db957c16/src/DatingVIP/IRC/Robot.php#L118-L178 |
238,946 | xloit/xloit-bridge-zend-servicemanager | src/ServiceFactory.php | ServiceFactory.createServiceFactory | protected function createServiceFactory(
$requestedName, ReflectionClass $reflection, ContainerInterface $container
) {
/** @var array $mappings */
$mappings = $this->getServiceMapping($container, $requestedName);
if ($reflection->implementsInterface(Factory\FactoryInterface::class)... | php | protected function createServiceFactory(
$requestedName, ReflectionClass $reflection, ContainerInterface $container
) {
/** @var array $mappings */
$mappings = $this->getServiceMapping($container, $requestedName);
if ($reflection->implementsInterface(Factory\FactoryInterface::class)... | [
"protected",
"function",
"createServiceFactory",
"(",
"$",
"requestedName",
",",
"ReflectionClass",
"$",
"reflection",
",",
"ContainerInterface",
"$",
"container",
")",
"{",
"/** @var array $mappings */",
"$",
"mappings",
"=",
"$",
"this",
"->",
"getServiceMapping",
"... | Initiate service factory from the ReflectionClass.
@param string $requestedName
@param ReflectionClass $reflection
@param ContainerInterface $container
@return mixed
@throws \ReflectionException
@throws \Psr\Container\ContainerExceptionInterface
@throws \Psr\Container\NotFoundExceptionInterface
@throws... | [
"Initiate",
"service",
"factory",
"from",
"the",
"ReflectionClass",
"."
] | f3285842a6fdcb3de0416b98f9bc20dd7a122cc4 | https://github.com/xloit/xloit-bridge-zend-servicemanager/blob/f3285842a6fdcb3de0416b98f9bc20dd7a122cc4/src/ServiceFactory.php#L201-L221 |
238,947 | leedave/filehandler | src/File.php | File.iterateFileName | protected static function iterateFileName(string $fileName)
{
//First remove Extension
$arrFileParts = explode(".", $fileName);
$extension = array_pop($arrFileParts);
$tempFileName = implode(".", $arrFileParts);
$arrFileName = explode("_", $tempFileName);
if (is_numer... | php | protected static function iterateFileName(string $fileName)
{
//First remove Extension
$arrFileParts = explode(".", $fileName);
$extension = array_pop($arrFileParts);
$tempFileName = implode(".", $arrFileParts);
$arrFileName = explode("_", $tempFileName);
if (is_numer... | [
"protected",
"static",
"function",
"iterateFileName",
"(",
"string",
"$",
"fileName",
")",
"{",
"//First remove Extension",
"$",
"arrFileParts",
"=",
"explode",
"(",
"\".\"",
",",
"$",
"fileName",
")",
";",
"$",
"extension",
"=",
"array_pop",
"(",
"$",
"arrFil... | Puts a number on the end of a file name, prevents overwriting
@param string $fileName
@return string | [
"Puts",
"a",
"number",
"on",
"the",
"end",
"of",
"a",
"file",
"name",
"prevents",
"overwriting"
] | 924e3fed15861b7d74e8e62aad6dd41b274e777a | https://github.com/leedave/filehandler/blob/924e3fed15861b7d74e8e62aad6dd41b274e777a/src/File.php#L42-L57 |
238,948 | phramework/basic-authentication | src/BasicAuthentication.php | BasicAuthentication.authenticate | public function authenticate($params, $method, $headers)
{
$email = \Phramework\Validate\EmailValidator::parseStatic($params['email']);
$password = $params['password'];
$user = call_user_func(Manager::getUserGetByEmailMethod(), $email);
if (!$user) {
return false;
... | php | public function authenticate($params, $method, $headers)
{
$email = \Phramework\Validate\EmailValidator::parseStatic($params['email']);
$password = $params['password'];
$user = call_user_func(Manager::getUserGetByEmailMethod(), $email);
if (!$user) {
return false;
... | [
"public",
"function",
"authenticate",
"(",
"$",
"params",
",",
"$",
"method",
",",
"$",
"headers",
")",
"{",
"$",
"email",
"=",
"\\",
"Phramework",
"\\",
"Validate",
"\\",
"EmailValidator",
"::",
"parseStatic",
"(",
"$",
"params",
"[",
"'email'",
"]",
")... | Authenticate a user using JWT authentication method
@param array $params Request parameters
@param string $method Request method
@param array $headers Request headers
@return false|array Returns false on failure | [
"Authenticate",
"a",
"user",
"using",
"JWT",
"authentication",
"method"
] | 9c2a5b89a589f58a8f2fb0df6c708803e5e7ada3 | https://github.com/phramework/basic-authentication/blob/9c2a5b89a589f58a8f2fb0df6c708803e5e7ada3/src/BasicAuthentication.php#L110-L155 |
238,949 | ncrypthic/lla-dci | src/LLA/Dci/ContextTrait.php | ContextTrait.set | public function set($prop, $value) {
$class = get_class($this);
if(property_exists($class, $prop)) {
// Use reflection to set private property
$reflection = new \ReflectionProperty($class, $prop);
$reflection->setAccessible(true);
$reflection->setValue($th... | php | public function set($prop, $value) {
$class = get_class($this);
if(property_exists($class, $prop)) {
// Use reflection to set private property
$reflection = new \ReflectionProperty($class, $prop);
$reflection->setAccessible(true);
$reflection->setValue($th... | [
"public",
"function",
"set",
"(",
"$",
"prop",
",",
"$",
"value",
")",
"{",
"$",
"class",
"=",
"get_class",
"(",
"$",
"this",
")",
";",
"if",
"(",
"property_exists",
"(",
"$",
"class",
",",
"$",
"prop",
")",
")",
"{",
"// Use reflection to set private ... | Set context data
@param string $prop
@param mixed $value
@return this
@throws \Ris\Dci\ContextDataException | [
"Set",
"context",
"data"
] | c27f46884747d56213f28a64f5537766dc8020c5 | https://github.com/ncrypthic/lla-dci/blob/c27f46884747d56213f28a64f5537766dc8020c5/src/LLA/Dci/ContextTrait.php#L16-L29 |
238,950 | jaredtking/jaqb | src/Statement/WhereStatement.php | WhereStatement.addCondition | public function addCondition($field, $value = false, $operator = '=')
{
if (is_array($field) && !$value) {
foreach ($field as $key => $value) {
// handles #6
if (is_array($value)) {
call_user_func_array([$this, 'addCondition'], $value);
... | php | public function addCondition($field, $value = false, $operator = '=')
{
if (is_array($field) && !$value) {
foreach ($field as $key => $value) {
// handles #6
if (is_array($value)) {
call_user_func_array([$this, 'addCondition'], $value);
... | [
"public",
"function",
"addCondition",
"(",
"$",
"field",
",",
"$",
"value",
"=",
"false",
",",
"$",
"operator",
"=",
"'='",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"field",
")",
"&&",
"!",
"$",
"value",
")",
"{",
"foreach",
"(",
"$",
"field",
... | Adds a condition to the statement.
Accepts the following forms:
1. Equality comparison:
addCondition('username', 'john')
2. Comparison with custom operator:
addCondition('balance', 100, '>')
3. IN statement:
addCondition('group', ['admin', 'owner'])
4. SQL fragment:
addCondition('name LIKE "%john%"')
5. Subquery:
addC... | [
"Adds",
"a",
"condition",
"to",
"the",
"statement",
"."
] | 04a853b530fcc12a9863349d3d0da6377d1b9995 | https://github.com/jaredtking/jaqb/blob/04a853b530fcc12a9863349d3d0da6377d1b9995/src/Statement/WhereStatement.php#L75-L106 |
238,951 | jaredtking/jaqb | src/Statement/WhereStatement.php | WhereStatement.addBetweenCondition | public function addBetweenCondition($field, $a, $b)
{
$this->conditions[] = ['BETWEEN', $field, $a, $b, true];
return $this;
} | php | public function addBetweenCondition($field, $a, $b)
{
$this->conditions[] = ['BETWEEN', $field, $a, $b, true];
return $this;
} | [
"public",
"function",
"addBetweenCondition",
"(",
"$",
"field",
",",
"$",
"a",
",",
"$",
"b",
")",
"{",
"$",
"this",
"->",
"conditions",
"[",
"]",
"=",
"[",
"'BETWEEN'",
",",
"$",
"field",
",",
"$",
"a",
",",
"$",
"b",
",",
"true",
"]",
";",
"r... | Adds a between condition to the query.
@param string $field
@param mixed $a first between value
@param mixed $b second between value
@return self | [
"Adds",
"a",
"between",
"condition",
"to",
"the",
"query",
"."
] | 04a853b530fcc12a9863349d3d0da6377d1b9995 | https://github.com/jaredtking/jaqb/blob/04a853b530fcc12a9863349d3d0da6377d1b9995/src/Statement/WhereStatement.php#L130-L135 |
238,952 | jaredtking/jaqb | src/Statement/WhereStatement.php | WhereStatement.addNotBetweenCondition | public function addNotBetweenCondition($field, $a, $b)
{
$this->conditions[] = ['BETWEEN', $field, $a, $b, false];
return $this;
} | php | public function addNotBetweenCondition($field, $a, $b)
{
$this->conditions[] = ['BETWEEN', $field, $a, $b, false];
return $this;
} | [
"public",
"function",
"addNotBetweenCondition",
"(",
"$",
"field",
",",
"$",
"a",
",",
"$",
"b",
")",
"{",
"$",
"this",
"->",
"conditions",
"[",
"]",
"=",
"[",
"'BETWEEN'",
",",
"$",
"field",
",",
"$",
"a",
",",
"$",
"b",
",",
"false",
"]",
";",
... | Adds a not between condition to the query.
@param string $field
@param mixed $a first between value
@param mixed $b second between value
@return self | [
"Adds",
"a",
"not",
"between",
"condition",
"to",
"the",
"query",
"."
] | 04a853b530fcc12a9863349d3d0da6377d1b9995 | https://github.com/jaredtking/jaqb/blob/04a853b530fcc12a9863349d3d0da6377d1b9995/src/Statement/WhereStatement.php#L146-L151 |
238,953 | jaredtking/jaqb | src/Statement/WhereStatement.php | WhereStatement.buildClause | protected function buildClause(array $cond)
{
// handle SQL fragments
if (count($cond) == 1 && (is_string($cond[0]) || !is_callable($cond[0]))) {
return $cond[0];
}
// handle EXISTS conditions
if ($cond[0] === 'EXISTS') {
return $this->buildExists($co... | php | protected function buildClause(array $cond)
{
// handle SQL fragments
if (count($cond) == 1 && (is_string($cond[0]) || !is_callable($cond[0]))) {
return $cond[0];
}
// handle EXISTS conditions
if ($cond[0] === 'EXISTS') {
return $this->buildExists($co... | [
"protected",
"function",
"buildClause",
"(",
"array",
"$",
"cond",
")",
"{",
"// handle SQL fragments",
"if",
"(",
"count",
"(",
"$",
"cond",
")",
"==",
"1",
"&&",
"(",
"is_string",
"(",
"$",
"cond",
"[",
"0",
"]",
")",
"||",
"!",
"is_callable",
"(",
... | Builds a parameterized and escaped SQL fragment
for a condition that uses our own internal
representation.
A condition is represented by an array, and can be
have one of the following forms:
1. ['SQL fragment']
2. ['identifier', '=', 'value']
3. ['BETWEEN', 'identifier', 'value', 'value', true]
4. ['EXISTS', function(... | [
"Builds",
"a",
"parameterized",
"and",
"escaped",
"SQL",
"fragment",
"for",
"a",
"condition",
"that",
"uses",
"our",
"own",
"internal",
"representation",
"."
] | 04a853b530fcc12a9863349d3d0da6377d1b9995 | https://github.com/jaredtking/jaqb/blob/04a853b530fcc12a9863349d3d0da6377d1b9995/src/Statement/WhereStatement.php#L230-L276 |
238,954 | jaredtking/jaqb | src/Statement/WhereStatement.php | WhereStatement.buildSubquery | protected function buildSubquery(callable $f)
{
$query = new SelectQuery();
$query->getSelect()->clearFields();
$f($query);
$sql = $query->build();
$this->values = array_merge($this->values, $query->getValues());
return '('.$sql.')';
} | php | protected function buildSubquery(callable $f)
{
$query = new SelectQuery();
$query->getSelect()->clearFields();
$f($query);
$sql = $query->build();
$this->values = array_merge($this->values, $query->getValues());
return '('.$sql.')';
} | [
"protected",
"function",
"buildSubquery",
"(",
"callable",
"$",
"f",
")",
"{",
"$",
"query",
"=",
"new",
"SelectQuery",
"(",
")",
";",
"$",
"query",
"->",
"getSelect",
"(",
")",
"->",
"clearFields",
"(",
")",
";",
"$",
"f",
"(",
"$",
"query",
")",
... | Builds a subquery.
@param callable $f
@return string | [
"Builds",
"a",
"subquery",
"."
] | 04a853b530fcc12a9863349d3d0da6377d1b9995 | https://github.com/jaredtking/jaqb/blob/04a853b530fcc12a9863349d3d0da6377d1b9995/src/Statement/WhereStatement.php#L285-L294 |
238,955 | jaredtking/jaqb | src/Statement/WhereStatement.php | WhereStatement.buildBetween | protected function buildBetween($field, $value1, $value2, $isBetween)
{
$operator = $isBetween ? 'BETWEEN' : 'NOT BETWEEN';
return $this->escapeIdentifier($field).' '.$operator.' '.$this->parameterize($value1).' AND '.$this->parameterize($value2);
} | php | protected function buildBetween($field, $value1, $value2, $isBetween)
{
$operator = $isBetween ? 'BETWEEN' : 'NOT BETWEEN';
return $this->escapeIdentifier($field).' '.$operator.' '.$this->parameterize($value1).' AND '.$this->parameterize($value2);
} | [
"protected",
"function",
"buildBetween",
"(",
"$",
"field",
",",
"$",
"value1",
",",
"$",
"value2",
",",
"$",
"isBetween",
")",
"{",
"$",
"operator",
"=",
"$",
"isBetween",
"?",
"'BETWEEN'",
":",
"'NOT BETWEEN'",
";",
"return",
"$",
"this",
"->",
"escape... | Builds a BETWEEN clause.
@param string $field
@param mixed $value1
@param mixed $value2
@param bool $isBetween
@return string | [
"Builds",
"a",
"BETWEEN",
"clause",
"."
] | 04a853b530fcc12a9863349d3d0da6377d1b9995 | https://github.com/jaredtking/jaqb/blob/04a853b530fcc12a9863349d3d0da6377d1b9995/src/Statement/WhereStatement.php#L321-L326 |
238,956 | jaredtking/jaqb | src/Statement/WhereStatement.php | WhereStatement.buildIn | protected function buildIn($field, array $values, $isIn)
{
$operator = $isIn ? ' IN ' : ' NOT IN ';
return $field.$operator.$this->parameterizeValues($values);
} | php | protected function buildIn($field, array $values, $isIn)
{
$operator = $isIn ? ' IN ' : ' NOT IN ';
return $field.$operator.$this->parameterizeValues($values);
} | [
"protected",
"function",
"buildIn",
"(",
"$",
"field",
",",
"array",
"$",
"values",
",",
"$",
"isIn",
")",
"{",
"$",
"operator",
"=",
"$",
"isIn",
"?",
"' IN '",
":",
"' NOT IN '",
";",
"return",
"$",
"field",
".",
"$",
"operator",
".",
"$",
"this",
... | Builds an IN clause.
@param string $field
@param array $values
@param bool $isIn
@return string | [
"Builds",
"an",
"IN",
"clause",
"."
] | 04a853b530fcc12a9863349d3d0da6377d1b9995 | https://github.com/jaredtking/jaqb/blob/04a853b530fcc12a9863349d3d0da6377d1b9995/src/Statement/WhereStatement.php#L352-L357 |
238,957 | jaredtking/jaqb | src/Statement/WhereStatement.php | WhereStatement.implodeClauses | protected function implodeClauses(array $clauses)
{
$str = '';
$op = false;
foreach ($clauses as $clause) {
// an 'OR' token will change the operator used
// when concatenating the next clause
if ($clause == 'OR') {
$op = ' OR ';
... | php | protected function implodeClauses(array $clauses)
{
$str = '';
$op = false;
foreach ($clauses as $clause) {
// an 'OR' token will change the operator used
// when concatenating the next clause
if ($clause == 'OR') {
$op = ' OR ';
... | [
"protected",
"function",
"implodeClauses",
"(",
"array",
"$",
"clauses",
")",
"{",
"$",
"str",
"=",
"''",
";",
"$",
"op",
"=",
"false",
";",
"foreach",
"(",
"$",
"clauses",
"as",
"$",
"clause",
")",
"{",
"// an 'OR' token will change the operator used",
"// ... | Implodes a list of WHERE clauses.
@param array $clauses
@return string | [
"Implodes",
"a",
"list",
"of",
"WHERE",
"clauses",
"."
] | 04a853b530fcc12a9863349d3d0da6377d1b9995 | https://github.com/jaredtking/jaqb/blob/04a853b530fcc12a9863349d3d0da6377d1b9995/src/Statement/WhereStatement.php#L366-L387 |
238,958 | nonetallt/jinitialize-core | src/JinitializeCommand.php | JinitializeCommand.export | protected function export(string $key, $value)
{
$container = JinitializeContainer::getInstance();
$container->getPlugin($this->getPluginName())->getContainer()->set($key, $value);
} | php | protected function export(string $key, $value)
{
$container = JinitializeContainer::getInstance();
$container->getPlugin($this->getPluginName())->getContainer()->set($key, $value);
} | [
"protected",
"function",
"export",
"(",
"string",
"$",
"key",
",",
"$",
"value",
")",
"{",
"$",
"container",
"=",
"JinitializeContainer",
"::",
"getInstance",
"(",
")",
";",
"$",
"container",
"->",
"getPlugin",
"(",
"$",
"this",
"->",
"getPluginName",
"(",... | Save a value to the application container | [
"Save",
"a",
"value",
"to",
"the",
"application",
"container"
] | 284fbd72b7c1d6f5f8f265dfe2589c0d99b6a88f | https://github.com/nonetallt/jinitialize-core/blob/284fbd72b7c1d6f5f8f265dfe2589c0d99b6a88f/src/JinitializeCommand.php#L64-L68 |
238,959 | nonetallt/jinitialize-core | src/JinitializeCommand.php | JinitializeCommand.import | protected function import(string $key)
{
$container = JinitializeContainer::getInstance();
return $container->getPlugin($this->getPluginName())->getContainer()->get($key);
} | php | protected function import(string $key)
{
$container = JinitializeContainer::getInstance();
return $container->getPlugin($this->getPluginName())->getContainer()->get($key);
} | [
"protected",
"function",
"import",
"(",
"string",
"$",
"key",
")",
"{",
"$",
"container",
"=",
"JinitializeContainer",
"::",
"getInstance",
"(",
")",
";",
"return",
"$",
"container",
"->",
"getPlugin",
"(",
"$",
"this",
"->",
"getPluginName",
"(",
")",
")"... | Get a value from the local plugin container | [
"Get",
"a",
"value",
"from",
"the",
"local",
"plugin",
"container"
] | 284fbd72b7c1d6f5f8f265dfe2589c0d99b6a88f | https://github.com/nonetallt/jinitialize-core/blob/284fbd72b7c1d6f5f8f265dfe2589c0d99b6a88f/src/JinitializeCommand.php#L74-L78 |
238,960 | jooorooo/embed | src/ImageInfo/Curl.php | Curl.getImageInfo | public static function getImageInfo($image, array $config = null)
{
$finfo = finfo_open(FILEINFO_MIME_TYPE);
$img = new static($image['value'], $finfo, $config);
$curl = $img->getConnection();
curl_exec($curl);
curl_close($curl);
$info = $img->getInfo();
fi... | php | public static function getImageInfo($image, array $config = null)
{
$finfo = finfo_open(FILEINFO_MIME_TYPE);
$img = new static($image['value'], $finfo, $config);
$curl = $img->getConnection();
curl_exec($curl);
curl_close($curl);
$info = $img->getInfo();
fi... | [
"public",
"static",
"function",
"getImageInfo",
"(",
"$",
"image",
",",
"array",
"$",
"config",
"=",
"null",
")",
"{",
"$",
"finfo",
"=",
"finfo_open",
"(",
"FILEINFO_MIME_TYPE",
")",
";",
"$",
"img",
"=",
"new",
"static",
"(",
"$",
"image",
"[",
"'val... | Get the info of only one image
@param string $image
@param null|array $config
@return array|null | [
"Get",
"the",
"info",
"of",
"only",
"one",
"image"
] | 078e70a093f246dc8e10b92f909f9166932c4106 | https://github.com/jooorooo/embed/blob/078e70a093f246dc8e10b92f909f9166932c4106/src/ImageInfo/Curl.php#L97-L111 |
238,961 | jooorooo/embed | src/ImageInfo/Curl.php | Curl.writeCallback | public function writeCallback($connection, $string)
{
$this->content .= $string;
if (!$this->mime) {
$this->mime = finfo_buffer($this->finfo, $this->content);
if (!in_array($this->mime, static::$mimetypes, true)) {
$this->mime = null;
return... | php | public function writeCallback($connection, $string)
{
$this->content .= $string;
if (!$this->mime) {
$this->mime = finfo_buffer($this->finfo, $this->content);
if (!in_array($this->mime, static::$mimetypes, true)) {
$this->mime = null;
return... | [
"public",
"function",
"writeCallback",
"(",
"$",
"connection",
",",
"$",
"string",
")",
"{",
"$",
"this",
"->",
"content",
".=",
"$",
"string",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"mime",
")",
"{",
"$",
"this",
"->",
"mime",
"=",
"finfo_buffer",
... | Callback used to save the first bytes of the body content
@param resource $connection
@param string $string
return integer | [
"Callback",
"used",
"to",
"save",
"the",
"first",
"bytes",
"of",
"the",
"body",
"content"
] | 078e70a093f246dc8e10b92f909f9166932c4106 | https://github.com/jooorooo/embed/blob/078e70a093f246dc8e10b92f909f9166932c4106/src/ImageInfo/Curl.php#L165-L191 |
238,962 | gperler/common | src/Civis/Common/File.php | File.delete | public function delete()
{
if (!$this->exists()) {
return false;
}
if ($this->isDir()) {
return rmdir($this->absoluteFileName);
}
return unlink($this->absoluteFileName);
} | php | public function delete()
{
if (!$this->exists()) {
return false;
}
if ($this->isDir()) {
return rmdir($this->absoluteFileName);
}
return unlink($this->absoluteFileName);
} | [
"public",
"function",
"delete",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"exists",
"(",
")",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"$",
"this",
"->",
"isDir",
"(",
")",
")",
"{",
"return",
"rmdir",
"(",
"$",
"this",
"->",
... | tries to delete a file
@return bool | [
"tries",
"to",
"delete",
"a",
"file"
] | d9e58e4f52715ef431475700a8ab85aa3c480749 | https://github.com/gperler/common/blob/d9e58e4f52715ef431475700a8ab85aa3c480749/src/Civis/Common/File.php#L94-L104 |
238,963 | gperler/common | src/Civis/Common/File.php | File.createDir | public function createDir($mode = 0777)
{
return is_dir($this->absoluteFileName) || mkdir($this->absoluteFileName, $mode, true);
} | php | public function createDir($mode = 0777)
{
return is_dir($this->absoluteFileName) || mkdir($this->absoluteFileName, $mode, true);
} | [
"public",
"function",
"createDir",
"(",
"$",
"mode",
"=",
"0777",
")",
"{",
"return",
"is_dir",
"(",
"$",
"this",
"->",
"absoluteFileName",
")",
"||",
"mkdir",
"(",
"$",
"this",
"->",
"absoluteFileName",
",",
"$",
"mode",
",",
"true",
")",
";",
"}"
] | creates needed directories recursively
@param int $mode
@return bool | [
"creates",
"needed",
"directories",
"recursively"
] | d9e58e4f52715ef431475700a8ab85aa3c480749 | https://github.com/gperler/common/blob/d9e58e4f52715ef431475700a8ab85aa3c480749/src/Civis/Common/File.php#L141-L144 |
238,964 | gperler/common | src/Civis/Common/File.php | File.scanDir | public function scanDir()
{
// only possible in directories
if (!$this->isDir() || !$this->exists()) {
return null;
}
$fileList = [];
$fileNameList = scandir($this->absoluteFileName);
foreach ($fileNameList as $fileName) {
// do not add . and ... | php | public function scanDir()
{
// only possible in directories
if (!$this->isDir() || !$this->exists()) {
return null;
}
$fileList = [];
$fileNameList = scandir($this->absoluteFileName);
foreach ($fileNameList as $fileName) {
// do not add . and ... | [
"public",
"function",
"scanDir",
"(",
")",
"{",
"// only possible in directories",
"if",
"(",
"!",
"$",
"this",
"->",
"isDir",
"(",
")",
"||",
"!",
"$",
"this",
"->",
"exists",
"(",
")",
")",
"{",
"return",
"null",
";",
"}",
"$",
"fileList",
"=",
"["... | scans a directory and returns a list of Files
@return File[] | [
"scans",
"a",
"directory",
"and",
"returns",
"a",
"list",
"of",
"Files"
] | d9e58e4f52715ef431475700a8ab85aa3c480749 | https://github.com/gperler/common/blob/d9e58e4f52715ef431475700a8ab85aa3c480749/src/Civis/Common/File.php#L150-L169 |
238,965 | gperler/common | src/Civis/Common/File.php | File.findFirstOccurenceOfFile | public function findFirstOccurenceOfFile(string $fileName)
{
if (!$this->isDir() || !$this->exists()) {
return null;
}
foreach ($this->scanDir() as $file) {
if ($file->getFileName() === $fileName) {
return $file;
}
if ($file->... | php | public function findFirstOccurenceOfFile(string $fileName)
{
if (!$this->isDir() || !$this->exists()) {
return null;
}
foreach ($this->scanDir() as $file) {
if ($file->getFileName() === $fileName) {
return $file;
}
if ($file->... | [
"public",
"function",
"findFirstOccurenceOfFile",
"(",
"string",
"$",
"fileName",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"isDir",
"(",
")",
"||",
"!",
"$",
"this",
"->",
"exists",
"(",
")",
")",
"{",
"return",
"null",
";",
"}",
"foreach",
"(",
... | Finds the first occurence of the given filename
@param string $fileName
@return null|File | [
"Finds",
"the",
"first",
"occurence",
"of",
"the",
"given",
"filename"
] | d9e58e4f52715ef431475700a8ab85aa3c480749 | https://github.com/gperler/common/blob/d9e58e4f52715ef431475700a8ab85aa3c480749/src/Civis/Common/File.php#L178-L197 |
238,966 | gperler/common | src/Civis/Common/File.php | File.loadAsXSLTProcessor | public function loadAsXSLTProcessor()
{
$this->checkFileExists();
$xsl = new \XSLTProcessor();
$xsl->importStylesheet($this->loadAsXML());
return $xsl;
} | php | public function loadAsXSLTProcessor()
{
$this->checkFileExists();
$xsl = new \XSLTProcessor();
$xsl->importStylesheet($this->loadAsXML());
return $xsl;
} | [
"public",
"function",
"loadAsXSLTProcessor",
"(",
")",
"{",
"$",
"this",
"->",
"checkFileExists",
"(",
")",
";",
"$",
"xsl",
"=",
"new",
"\\",
"XSLTProcessor",
"(",
")",
";",
"$",
"xsl",
"->",
"importStylesheet",
"(",
"$",
"this",
"->",
"loadAsXML",
"(",... | loads the file as XSLT Processor
@return \XSLTProcessor | [
"loads",
"the",
"file",
"as",
"XSLT",
"Processor"
] | d9e58e4f52715ef431475700a8ab85aa3c480749 | https://github.com/gperler/common/blob/d9e58e4f52715ef431475700a8ab85aa3c480749/src/Civis/Common/File.php#L227-L233 |
238,967 | gperler/common | src/Civis/Common/File.php | File.loadAsXML | public function loadAsXML()
{
$this->checkFileExists();
$xml = new \DomDocument ();
libxml_use_internal_errors(true);
$result = $xml->load($this->absoluteFileName);
if ($result) {
return $xml;
}
$messageObject = ArrayUtil::getFromArray(libxml_get_e... | php | public function loadAsXML()
{
$this->checkFileExists();
$xml = new \DomDocument ();
libxml_use_internal_errors(true);
$result = $xml->load($this->absoluteFileName);
if ($result) {
return $xml;
}
$messageObject = ArrayUtil::getFromArray(libxml_get_e... | [
"public",
"function",
"loadAsXML",
"(",
")",
"{",
"$",
"this",
"->",
"checkFileExists",
"(",
")",
";",
"$",
"xml",
"=",
"new",
"\\",
"DomDocument",
"(",
")",
";",
"libxml_use_internal_errors",
"(",
"true",
")",
";",
"$",
"result",
"=",
"$",
"xml",
"->"... | loads the file as XML DOMDocument
@return \DomDocument
@throws \Exception | [
"loads",
"the",
"file",
"as",
"XML",
"DOMDocument"
] | d9e58e4f52715ef431475700a8ab85aa3c480749 | https://github.com/gperler/common/blob/d9e58e4f52715ef431475700a8ab85aa3c480749/src/Civis/Common/File.php#L240-L255 |
238,968 | neemzy/patchwork-core | src/FeatureContext.php | FeatureContext.elementShouldBeVisible | public function elementShouldBeVisible($selector)
{
$session = $this->getSession();
$page = $session->getPage();
$element = $page->find('css', $selector);
if (!$element) {
throw new ElementNotFoundException($session, 'Element "'.$selector.'"');
}
\PHPUni... | php | public function elementShouldBeVisible($selector)
{
$session = $this->getSession();
$page = $session->getPage();
$element = $page->find('css', $selector);
if (!$element) {
throw new ElementNotFoundException($session, 'Element "'.$selector.'"');
}
\PHPUni... | [
"public",
"function",
"elementShouldBeVisible",
"(",
"$",
"selector",
")",
"{",
"$",
"session",
"=",
"$",
"this",
"->",
"getSession",
"(",
")",
";",
"$",
"page",
"=",
"$",
"session",
"->",
"getPage",
"(",
")",
";",
"$",
"element",
"=",
"$",
"page",
"... | Checks an element is visible
@Then /^"([^"]*)" element should be visible$/
@return void | [
"Checks",
"an",
"element",
"is",
"visible"
] | 81c31b5c0b3a82a04ed90eb17cefaf2faddee4ee | https://github.com/neemzy/patchwork-core/blob/81c31b5c0b3a82a04ed90eb17cefaf2faddee4ee/src/FeatureContext.php#L46-L57 |
238,969 | neemzy/patchwork-core | src/FeatureContext.php | FeatureContext.elementShouldBeHidden | public function elementShouldBeHidden($selector)
{
$session = $this->getSession();
$page = $session->getPage();
$element = $page->find('css', $selector);
if (!$element) {
throw new ElementNotFoundException($session, 'Element "'.$selector.'"');
}
\PHPUnit... | php | public function elementShouldBeHidden($selector)
{
$session = $this->getSession();
$page = $session->getPage();
$element = $page->find('css', $selector);
if (!$element) {
throw new ElementNotFoundException($session, 'Element "'.$selector.'"');
}
\PHPUnit... | [
"public",
"function",
"elementShouldBeHidden",
"(",
"$",
"selector",
")",
"{",
"$",
"session",
"=",
"$",
"this",
"->",
"getSession",
"(",
")",
";",
"$",
"page",
"=",
"$",
"session",
"->",
"getPage",
"(",
")",
";",
"$",
"element",
"=",
"$",
"page",
"-... | Checks an element is hidden
@Then /^"([^"]*)" element should be hidden$/
@return void | [
"Checks",
"an",
"element",
"is",
"hidden"
] | 81c31b5c0b3a82a04ed90eb17cefaf2faddee4ee | https://github.com/neemzy/patchwork-core/blob/81c31b5c0b3a82a04ed90eb17cefaf2faddee4ee/src/FeatureContext.php#L68-L79 |
238,970 | neemzy/patchwork-core | src/FeatureContext.php | FeatureContext.elementShouldHaveClass | public function elementShouldHaveClass($selector, $class)
{
$session = $this->getSession();
$page = $session->getPage();
$element = $page->find('css', $selector);
if (!$element) {
throw new ElementNotFoundException($session, 'Element "'.$selector.'"');
}
... | php | public function elementShouldHaveClass($selector, $class)
{
$session = $this->getSession();
$page = $session->getPage();
$element = $page->find('css', $selector);
if (!$element) {
throw new ElementNotFoundException($session, 'Element "'.$selector.'"');
}
... | [
"public",
"function",
"elementShouldHaveClass",
"(",
"$",
"selector",
",",
"$",
"class",
")",
"{",
"$",
"session",
"=",
"$",
"this",
"->",
"getSession",
"(",
")",
";",
"$",
"page",
"=",
"$",
"session",
"->",
"getPage",
"(",
")",
";",
"$",
"element",
... | Checks an element has a class
@Then /^"([^"]*)" element should have class "([^"]*)"$/
@return void | [
"Checks",
"an",
"element",
"has",
"a",
"class"
] | 81c31b5c0b3a82a04ed90eb17cefaf2faddee4ee | https://github.com/neemzy/patchwork-core/blob/81c31b5c0b3a82a04ed90eb17cefaf2faddee4ee/src/FeatureContext.php#L90-L101 |
238,971 | neemzy/patchwork-core | src/FeatureContext.php | FeatureContext.elementShouldNotHaveClass | public function elementShouldNotHaveClass($selector, $class)
{
$session = $this->getSession();
$page = $session->getPage();
$element = $page->find('css', $selector);
if (!$element) {
throw new ElementNotFoundException($session, 'Element "'.$selector.'"');
}
... | php | public function elementShouldNotHaveClass($selector, $class)
{
$session = $this->getSession();
$page = $session->getPage();
$element = $page->find('css', $selector);
if (!$element) {
throw new ElementNotFoundException($session, 'Element "'.$selector.'"');
}
... | [
"public",
"function",
"elementShouldNotHaveClass",
"(",
"$",
"selector",
",",
"$",
"class",
")",
"{",
"$",
"session",
"=",
"$",
"this",
"->",
"getSession",
"(",
")",
";",
"$",
"page",
"=",
"$",
"session",
"->",
"getPage",
"(",
")",
";",
"$",
"element",... | Checks an element doesn't have a class
@Then /^"([^"]*)" element should not have class "([^"]*)"$/
@return void | [
"Checks",
"an",
"element",
"doesn",
"t",
"have",
"a",
"class"
] | 81c31b5c0b3a82a04ed90eb17cefaf2faddee4ee | https://github.com/neemzy/patchwork-core/blob/81c31b5c0b3a82a04ed90eb17cefaf2faddee4ee/src/FeatureContext.php#L112-L123 |
238,972 | SocietyCMS/Core | Utilities/AssetManager/JavascriptPipeline/SocietyJavascriptPipeline.php | SocietyJavascriptPipeline.addJs | public function addJs($js)
{
if (is_array($js)) {
foreach ($js as $script) {
$this->addJs($script);
}
return $this;
}
$this->js->push($js);
return $this;
} | php | public function addJs($js)
{
if (is_array($js)) {
foreach ($js as $script) {
$this->addJs($script);
}
return $this;
}
$this->js->push($js);
return $this;
} | [
"public",
"function",
"addJs",
"(",
"$",
"js",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"js",
")",
")",
"{",
"foreach",
"(",
"$",
"js",
"as",
"$",
"script",
")",
"{",
"$",
"this",
"->",
"addJs",
"(",
"$",
"script",
")",
";",
"}",
"return",
... | Add a javascript dependency on the view.
@param string $js
@throws AssetNotFoundException
@return $this | [
"Add",
"a",
"javascript",
"dependency",
"on",
"the",
"view",
"."
] | fb6be1b1dd46c89a976c02feb998e9af01ddca54 | https://github.com/SocietyCMS/Core/blob/fb6be1b1dd46c89a976c02feb998e9af01ddca54/Utilities/AssetManager/JavascriptPipeline/SocietyJavascriptPipeline.php#L35-L48 |
238,973 | dflydev/dflydev-composer-autoload | src/Dflydev/Composer/Autoload/ClassLoaderLocator.php | ClassLoaderLocator.getClassLoaders | public function getClassLoaders()
{
if (null !== static::$classLoaders) {
return static::$classLoaders;
}
static::$classLoaders = array();
foreach (spl_autoload_functions() as $function) {
if (is_array($function) && count($function[0]) > 0 && is_object($func... | php | public function getClassLoaders()
{
if (null !== static::$classLoaders) {
return static::$classLoaders;
}
static::$classLoaders = array();
foreach (spl_autoload_functions() as $function) {
if (is_array($function) && count($function[0]) > 0 && is_object($func... | [
"public",
"function",
"getClassLoaders",
"(",
")",
"{",
"if",
"(",
"null",
"!==",
"static",
"::",
"$",
"classLoaders",
")",
"{",
"return",
"static",
"::",
"$",
"classLoaders",
";",
"}",
"static",
"::",
"$",
"classLoaders",
"=",
"array",
"(",
")",
";",
... | Locate all Composer Autoload ClassLoader instances
@return \Composer\Autoload\ClassLoader[] | [
"Locate",
"all",
"Composer",
"Autoload",
"ClassLoader",
"instances"
] | fcdc111b7f2f7301ef05c5938a5a07026481b504 | https://github.com/dflydev/dflydev-composer-autoload/blob/fcdc111b7f2f7301ef05c5938a5a07026481b504/src/Dflydev/Composer/Autoload/ClassLoaderLocator.php#L68-L83 |
238,974 | samurai-fw/samurai | src/Console/Task/DbTaskList.php | DbTaskList.migrateTask | public function migrateTask(Option $option)
{
$databases = $this->getDatabases($option);
$start = microtime(true);
foreach ($databases as $alias => $database) {
$manager = $this->getManager($alias, $database);
$manager->migrate($this->application->getEnv(), $option->... | php | public function migrateTask(Option $option)
{
$databases = $this->getDatabases($option);
$start = microtime(true);
foreach ($databases as $alias => $database) {
$manager = $this->getManager($alias, $database);
$manager->migrate($this->application->getEnv(), $option->... | [
"public",
"function",
"migrateTask",
"(",
"Option",
"$",
"option",
")",
"{",
"$",
"databases",
"=",
"$",
"this",
"->",
"getDatabases",
"(",
"$",
"option",
")",
";",
"$",
"start",
"=",
"microtime",
"(",
"true",
")",
";",
"foreach",
"(",
"$",
"databases"... | database migration task. using phinx.
usage:
$ ./app db:migrate [version]
@option database,d=all target database (default is all databases). | [
"database",
"migration",
"task",
".",
"using",
"phinx",
"."
] | 7ca3847b13f86e2847a17ab5e8e4e20893021d5a | https://github.com/samurai-fw/samurai/blob/7ca3847b13f86e2847a17ab5e8e4e20893021d5a/src/Console/Task/DbTaskList.php#L51-L66 |
238,975 | samurai-fw/samurai | src/Console/Task/DbTaskList.php | DbTaskList.seedTask | public function seedTask(Option $option)
{
$name = $option->getArg(0);
$databases = $this->getDatabases($option);
$start = microtime(true);
foreach ($databases as $alias => $database) {
foreach ($this->migrationHelper->getSeeders($alias, $name) as $seeder) {
... | php | public function seedTask(Option $option)
{
$name = $option->getArg(0);
$databases = $this->getDatabases($option);
$start = microtime(true);
foreach ($databases as $alias => $database) {
foreach ($this->migrationHelper->getSeeders($alias, $name) as $seeder) {
... | [
"public",
"function",
"seedTask",
"(",
"Option",
"$",
"option",
")",
"{",
"$",
"name",
"=",
"$",
"option",
"->",
"getArg",
"(",
"0",
")",
";",
"$",
"databases",
"=",
"$",
"this",
"->",
"getDatabases",
"(",
"$",
"option",
")",
";",
"$",
"start",
"="... | database seeding task.
usage:
# all seeding files import.
$ ./app db:seed
# target seeding file import.
$ ./app db:seed [name] --database=base
seeder file:
App/Database/Seed/[database alias]/[name]Seeder.php
@option database,d=all target database (default is all databases). | [
"database",
"seeding",
"task",
"."
] | 7ca3847b13f86e2847a17ab5e8e4e20893021d5a | https://github.com/samurai-fw/samurai/blob/7ca3847b13f86e2847a17ab5e8e4e20893021d5a/src/Console/Task/DbTaskList.php#L147-L169 |
238,976 | samurai-fw/samurai | src/Console/Task/DbTaskList.php | DbTaskList.statusTask | public function statusTask(Option $option)
{
$databases = $this->getDatabases($option);
foreach ($databases as $alias => $database) {
$manager = $this->getManager($alias, $database);
$manager->printStatus($this->application->getEnv(), $option->get('format'));
}
} | php | public function statusTask(Option $option)
{
$databases = $this->getDatabases($option);
foreach ($databases as $alias => $database) {
$manager = $this->getManager($alias, $database);
$manager->printStatus($this->application->getEnv(), $option->get('format'));
}
} | [
"public",
"function",
"statusTask",
"(",
"Option",
"$",
"option",
")",
"{",
"$",
"databases",
"=",
"$",
"this",
"->",
"getDatabases",
"(",
"$",
"option",
")",
";",
"foreach",
"(",
"$",
"databases",
"as",
"$",
"alias",
"=>",
"$",
"database",
")",
"{",
... | show database mgration status task. using phinx.
usage:
$ ./app db:status [version]
@option format,f output format. (default is text)
@option database,d=all target database (default is all databases). | [
"show",
"database",
"mgration",
"status",
"task",
".",
"using",
"phinx",
"."
] | 7ca3847b13f86e2847a17ab5e8e4e20893021d5a | https://github.com/samurai-fw/samurai/blob/7ca3847b13f86e2847a17ab5e8e4e20893021d5a/src/Console/Task/DbTaskList.php#L181-L189 |
238,977 | deasilworks/cef | src/StatementBuilder/InsertModel.php | InsertModel.setModel | public function setModel($model)
{
$model->setSerializeNull($this->isSerializeNull());
$this->setJson($model->toJson());
return $this;
} | php | public function setModel($model)
{
$model->setSerializeNull($this->isSerializeNull());
$this->setJson($model->toJson());
return $this;
} | [
"public",
"function",
"setModel",
"(",
"$",
"model",
")",
"{",
"$",
"model",
"->",
"setSerializeNull",
"(",
"$",
"this",
"->",
"isSerializeNull",
"(",
")",
")",
";",
"$",
"this",
"->",
"setJson",
"(",
"$",
"model",
"->",
"toJson",
"(",
")",
")",
";",... | Set Model.
@param EntityDataModel $model
@return InsertModel | [
"Set",
"Model",
"."
] | 18c65f2b123512bba2208975dc655354f57670be | https://github.com/deasilworks/cef/blob/18c65f2b123512bba2208975dc655354f57670be/src/StatementBuilder/InsertModel.php#L67-L73 |
238,978 | tenside/core-bundle | src/EventListener/ExceptionListener.php | ExceptionListener.onKernelException | public function onKernelException(GetResponseForExceptionEvent $event)
{
$exception = $event->getException();
$response = null;
switch (true) {
case ($exception instanceof NotFoundHttpException):
$response = $this->createNotFoundResponse($event->getRequest(), $e... | php | public function onKernelException(GetResponseForExceptionEvent $event)
{
$exception = $event->getException();
$response = null;
switch (true) {
case ($exception instanceof NotFoundHttpException):
$response = $this->createNotFoundResponse($event->getRequest(), $e... | [
"public",
"function",
"onKernelException",
"(",
"GetResponseForExceptionEvent",
"$",
"event",
")",
"{",
"$",
"exception",
"=",
"$",
"event",
"->",
"getException",
"(",
")",
";",
"$",
"response",
"=",
"null",
";",
"switch",
"(",
"true",
")",
"{",
"case",
"(... | Maps known exceptions to HTTP exceptions.
@param GetResponseForExceptionEvent $event The event object.
@return void
@SuppressWarnings(PHPMD.CyclomaticComplexity) | [
"Maps",
"known",
"exceptions",
"to",
"HTTP",
"exceptions",
"."
] | a7ffad3649cddac1e5594b4f8b65a5504363fccd | https://github.com/tenside/core-bundle/blob/a7ffad3649cddac1e5594b4f8b65a5504363fccd/src/EventListener/ExceptionListener.php#L77-L106 |
238,979 | tenside/core-bundle | src/EventListener/ExceptionListener.php | ExceptionListener.createNotFoundResponse | private function createNotFoundResponse($request, $exception)
{
$message = $exception->getMessage();
if (empty($message)) {
$message = 'Uri ' . $request->getRequestUri() . ' could not be found';
}
return new JsonResponse(
[
'status' => 'ERROR... | php | private function createNotFoundResponse($request, $exception)
{
$message = $exception->getMessage();
if (empty($message)) {
$message = 'Uri ' . $request->getRequestUri() . ' could not be found';
}
return new JsonResponse(
[
'status' => 'ERROR... | [
"private",
"function",
"createNotFoundResponse",
"(",
"$",
"request",
",",
"$",
"exception",
")",
"{",
"$",
"message",
"=",
"$",
"exception",
"->",
"getMessage",
"(",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"message",
")",
")",
"{",
"$",
"message",
"="... | Create a 404 response.
@param Request $request The http request.
@param \Exception $exception The exception.
@return JsonResponse
@SuppressWarnings(PHPMD.UnusedPrivateMethod) | [
"Create",
"a",
"404",
"response",
"."
] | a7ffad3649cddac1e5594b4f8b65a5504363fccd | https://github.com/tenside/core-bundle/blob/a7ffad3649cddac1e5594b4f8b65a5504363fccd/src/EventListener/ExceptionListener.php#L119-L133 |
238,980 | tenside/core-bundle | src/EventListener/ExceptionListener.php | ExceptionListener.createHttpExceptionResponse | private function createHttpExceptionResponse(HttpException $exception)
{
return new JsonResponse(
[
'status' => 'ERROR',
'message' => $exception->getMessage()
],
$exception->getStatusCode(),
$exception->getHeaders()
);
... | php | private function createHttpExceptionResponse(HttpException $exception)
{
return new JsonResponse(
[
'status' => 'ERROR',
'message' => $exception->getMessage()
],
$exception->getStatusCode(),
$exception->getHeaders()
);
... | [
"private",
"function",
"createHttpExceptionResponse",
"(",
"HttpException",
"$",
"exception",
")",
"{",
"return",
"new",
"JsonResponse",
"(",
"[",
"'status'",
"=>",
"'ERROR'",
",",
"'message'",
"=>",
"$",
"exception",
"->",
"getMessage",
"(",
")",
"]",
",",
"$... | Create a http response.
@param HttpException $exception The exception to create a response for.
@return JsonResponse | [
"Create",
"a",
"http",
"response",
"."
] | a7ffad3649cddac1e5594b4f8b65a5504363fccd | https://github.com/tenside/core-bundle/blob/a7ffad3649cddac1e5594b4f8b65a5504363fccd/src/EventListener/ExceptionListener.php#L142-L152 |
238,981 | tenside/core-bundle | src/EventListener/ExceptionListener.php | ExceptionListener.createInternalServerError | private function createInternalServerError(\Exception $exception)
{
$message = sprintf(
'%s: %s (uncaught exception) at %s line %s',
get_class($exception),
$exception->getMessage(),
$exception->getFile(),
$exception->getLine()
);
$... | php | private function createInternalServerError(\Exception $exception)
{
$message = sprintf(
'%s: %s (uncaught exception) at %s line %s',
get_class($exception),
$exception->getMessage(),
$exception->getFile(),
$exception->getLine()
);
$... | [
"private",
"function",
"createInternalServerError",
"(",
"\\",
"Exception",
"$",
"exception",
")",
"{",
"$",
"message",
"=",
"sprintf",
"(",
"'%s: %s (uncaught exception) at %s line %s'",
",",
"get_class",
"(",
"$",
"exception",
")",
",",
"$",
"exception",
"->",
"... | Create a 500 response.
@param \Exception $exception The exception to log.
@return JsonResponse | [
"Create",
"a",
"500",
"response",
"."
] | a7ffad3649cddac1e5594b4f8b65a5504363fccd | https://github.com/tenside/core-bundle/blob/a7ffad3649cddac1e5594b4f8b65a5504363fccd/src/EventListener/ExceptionListener.php#L179-L201 |
238,982 | tenside/core-bundle | src/EventListener/ExceptionListener.php | ExceptionListener.formatStackFrame | private function formatStackFrame($frame)
{
return [
'file' => isset($frame['file']) ? $frame['file'] : 'unknown',
'line' => isset($frame['line']) ? $frame['line'] : 'unknown',
'function' => (isset($frame['class']) ? $frame['class'] . $frame['type'] : '') . $fr... | php | private function formatStackFrame($frame)
{
return [
'file' => isset($frame['file']) ? $frame['file'] : 'unknown',
'line' => isset($frame['line']) ? $frame['line'] : 'unknown',
'function' => (isset($frame['class']) ? $frame['class'] . $frame['type'] : '') . $fr... | [
"private",
"function",
"formatStackFrame",
"(",
"$",
"frame",
")",
"{",
"return",
"[",
"'file'",
"=>",
"isset",
"(",
"$",
"frame",
"[",
"'file'",
"]",
")",
"?",
"$",
"frame",
"[",
"'file'",
"]",
":",
"'unknown'",
",",
"'line'",
"=>",
"isset",
"(",
"$... | Convert a stack frame to array.
@param array $frame The stack frame to convert.
@return array | [
"Convert",
"a",
"stack",
"frame",
"to",
"array",
"."
] | a7ffad3649cddac1e5594b4f8b65a5504363fccd | https://github.com/tenside/core-bundle/blob/a7ffad3649cddac1e5594b4f8b65a5504363fccd/src/EventListener/ExceptionListener.php#L242-L250 |
238,983 | tenside/core-bundle | src/EventListener/ExceptionListener.php | ExceptionListener.formatArguments | private function formatArguments($arguments)
{
$result = [];
foreach ($arguments as $key => $argument) {
if (is_object($argument)) {
$result[$key] = get_class($argument);
continue;
}
if (is_array($argument)) {
$resu... | php | private function formatArguments($arguments)
{
$result = [];
foreach ($arguments as $key => $argument) {
if (is_object($argument)) {
$result[$key] = get_class($argument);
continue;
}
if (is_array($argument)) {
$resu... | [
"private",
"function",
"formatArguments",
"(",
"$",
"arguments",
")",
"{",
"$",
"result",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"arguments",
"as",
"$",
"key",
"=>",
"$",
"argument",
")",
"{",
"if",
"(",
"is_object",
"(",
"$",
"argument",
")",
")",... | Reformat an argument list.
@param array $arguments The arguments to reformat.
@return mixed | [
"Reformat",
"an",
"argument",
"list",
"."
] | a7ffad3649cddac1e5594b4f8b65a5504363fccd | https://github.com/tenside/core-bundle/blob/a7ffad3649cddac1e5594b4f8b65a5504363fccd/src/EventListener/ExceptionListener.php#L259-L277 |
238,984 | wigedev/simple-mvc | src/Core.php | Core._init | public static function _init(): Core
{
static::$framework = new Core();
static::$framework->createDIContainer();
try {
static::$framework->fireEvent('initialized');
} catch (\Exception $e) {
echo('Unable to fire initialization.');
exit();
}... | php | public static function _init(): Core
{
static::$framework = new Core();
static::$framework->createDIContainer();
try {
static::$framework->fireEvent('initialized');
} catch (\Exception $e) {
echo('Unable to fire initialization.');
exit();
}... | [
"public",
"static",
"function",
"_init",
"(",
")",
":",
"Core",
"{",
"static",
"::",
"$",
"framework",
"=",
"new",
"Core",
"(",
")",
";",
"static",
"::",
"$",
"framework",
"->",
"createDIContainer",
"(",
")",
";",
"try",
"{",
"static",
"::",
"$",
"fr... | Function initializes the framework object.
@return Core | [
"Function",
"initializes",
"the",
"framework",
"object",
"."
] | b722eff02c5dcd8c6f09c8d78f72bc71cb9e1a94 | https://github.com/wigedev/simple-mvc/blob/b722eff02c5dcd8c6f09c8d78f72bc71cb9e1a94/src/Core.php#L153-L167 |
238,985 | wigedev/simple-mvc | src/Core.php | Core.registerServiceManager | public function registerServiceManager(string $name, ServiceManager $service_manager): Core
{
$this->service_managers->register($name, $service_manager);
return $this;
} | php | public function registerServiceManager(string $name, ServiceManager $service_manager): Core
{
$this->service_managers->register($name, $service_manager);
return $this;
} | [
"public",
"function",
"registerServiceManager",
"(",
"string",
"$",
"name",
",",
"ServiceManager",
"$",
"service_manager",
")",
":",
"Core",
"{",
"$",
"this",
"->",
"service_managers",
"->",
"register",
"(",
"$",
"name",
",",
"$",
"service_manager",
")",
";",
... | Register a service manager.
@param string $name The name of the service manager for use in retrieving a reference to it
@param ServiceManager $service_manager
@return Core | [
"Register",
"a",
"service",
"manager",
"."
] | b722eff02c5dcd8c6f09c8d78f72bc71cb9e1a94 | https://github.com/wigedev/simple-mvc/blob/b722eff02c5dcd8c6f09c8d78f72bc71cb9e1a94/src/Core.php#L273-L277 |
238,986 | wigedev/simple-mvc | src/Core.php | Core.on | public function on(string $event, $class_or_obj, string $method, array $arguments = []): Core
{
$this->registerEventHandler(new EventHandler($event, $class_or_obj, $method, $arguments));
return $this;
} | php | public function on(string $event, $class_or_obj, string $method, array $arguments = []): Core
{
$this->registerEventHandler(new EventHandler($event, $class_or_obj, $method, $arguments));
return $this;
} | [
"public",
"function",
"on",
"(",
"string",
"$",
"event",
",",
"$",
"class_or_obj",
",",
"string",
"$",
"method",
",",
"array",
"$",
"arguments",
"=",
"[",
"]",
")",
":",
"Core",
"{",
"$",
"this",
"->",
"registerEventHandler",
"(",
"new",
"EventHandler",
... | Create an event handler to be called when a specified event is fired by the framework or a library within the
Framework.
@param string $event The name of the event to listen for
@param mixed $class_or_obj The object or class the method belongs to
@param string $method The method to call
@param array $ar... | [
"Create",
"an",
"event",
"handler",
"to",
"be",
"called",
"when",
"a",
"specified",
"event",
"is",
"fired",
"by",
"the",
"framework",
"or",
"a",
"library",
"within",
"the",
"Framework",
"."
] | b722eff02c5dcd8c6f09c8d78f72bc71cb9e1a94 | https://github.com/wigedev/simple-mvc/blob/b722eff02c5dcd8c6f09c8d78f72bc71cb9e1a94/src/Core.php#L306-L310 |
238,987 | wigedev/simple-mvc | src/Core.php | Core.fireEvent | public function fireEvent(string $event): void
{
$this->log->debug('Event {event} has been fired.', ['event' => $event]);
foreach ($this->event_handlers as $handler) {
/** @var EventHandler $handler */
if ($event === $handler->getEvent()) {
$handler->execute()... | php | public function fireEvent(string $event): void
{
$this->log->debug('Event {event} has been fired.', ['event' => $event]);
foreach ($this->event_handlers as $handler) {
/** @var EventHandler $handler */
if ($event === $handler->getEvent()) {
$handler->execute()... | [
"public",
"function",
"fireEvent",
"(",
"string",
"$",
"event",
")",
":",
"void",
"{",
"$",
"this",
"->",
"log",
"->",
"debug",
"(",
"'Event {event} has been fired.'",
",",
"[",
"'event'",
"=>",
"$",
"event",
"]",
")",
";",
"foreach",
"(",
"$",
"this",
... | Register a callback to be run before the renderer is called
@param string $event The name of the event being fired
@throws \Exception | [
"Register",
"a",
"callback",
"to",
"be",
"run",
"before",
"the",
"renderer",
"is",
"called"
] | b722eff02c5dcd8c6f09c8d78f72bc71cb9e1a94 | https://github.com/wigedev/simple-mvc/blob/b722eff02c5dcd8c6f09c8d78f72bc71cb9e1a94/src/Core.php#L319-L328 |
238,988 | wigedev/simple-mvc | src/Core.php | Core.getRemoteIP | public function getRemoteIP(): string
{
if (null === $this->remote_ip) {
$ip = $_SERVER['REMOTE_ADDR'];
if (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
$ip = explode(',', $ip);
$ip = trim($ip[0]);... | php | public function getRemoteIP(): string
{
if (null === $this->remote_ip) {
$ip = $_SERVER['REMOTE_ADDR'];
if (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
$ip = explode(',', $ip);
$ip = trim($ip[0]);... | [
"public",
"function",
"getRemoteIP",
"(",
")",
":",
"string",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"remote_ip",
")",
"{",
"$",
"ip",
"=",
"$",
"_SERVER",
"[",
"'REMOTE_ADDR'",
"]",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"_SERVER",
"["... | Get the IP address of the user
@return string The remote IP address. If the user passes through a proxy, this will attempt to return the origin
IP address. | [
"Get",
"the",
"IP",
"address",
"of",
"the",
"user"
] | b722eff02c5dcd8c6f09c8d78f72bc71cb9e1a94 | https://github.com/wigedev/simple-mvc/blob/b722eff02c5dcd8c6f09c8d78f72bc71cb9e1a94/src/Core.php#L354-L366 |
238,989 | jails/li3_access | security/Access.php | Access.check | public static function check($name, $user, $request, $options = []) {
if (($config = static::_config($name)) === null) {
throw new ConfigException("Configuration `{$name}` has not been defined.");
}
$filter = function($self, $params) use ($name) {
$user = $params['user'];
$request = $params['request'];
... | php | public static function check($name, $user, $request, $options = []) {
if (($config = static::_config($name)) === null) {
throw new ConfigException("Configuration `{$name}` has not been defined.");
}
$filter = function($self, $params) use ($name) {
$user = $params['user'];
$request = $params['request'];
... | [
"public",
"static",
"function",
"check",
"(",
"$",
"name",
",",
"$",
"user",
",",
"$",
"request",
",",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"(",
"$",
"config",
"=",
"static",
"::",
"_config",
"(",
"$",
"name",
")",
")",
"===",
"n... | Performs an access check.
@param string $name The name of the adapter to check against.
@param mixed $user The user data array or a user instance.
@param action\Request $request A `Request` instace.
@param array $options An array of options.
@return boolean `true` if access is granted, `false otherwise`. | [
"Performs",
"an",
"access",
"check",
"."
] | aded70dca872ea9237e3eb709099730348008321 | https://github.com/jails/li3_access/blob/aded70dca872ea9237e3eb709099730348008321/security/Access.php#L39-L51 |
238,990 | firstcomputer/seeme | src/Api/Caller.php | Caller.call | protected function call(array $params)
{
$defaultParams = [
'key' => $this->apiKey,
'format' => 'json',
'apiVersion' => self::VERSION,
];
$params = array_merge($defaultParams, $params);
$url = sprintf('%s?%s', self::ENDPOINT, http_buil... | php | protected function call(array $params)
{
$defaultParams = [
'key' => $this->apiKey,
'format' => 'json',
'apiVersion' => self::VERSION,
];
$params = array_merge($defaultParams, $params);
$url = sprintf('%s?%s', self::ENDPOINT, http_buil... | [
"protected",
"function",
"call",
"(",
"array",
"$",
"params",
")",
"{",
"$",
"defaultParams",
"=",
"[",
"'key'",
"=>",
"$",
"this",
"->",
"apiKey",
",",
"'format'",
"=>",
"'json'",
",",
"'apiVersion'",
"=>",
"self",
"::",
"VERSION",
",",
"]",
";",
"$",... | Sends a call to the API
@param array $params
@return array
@throws ApiException If the API call fails | [
"Sends",
"a",
"call",
"to",
"the",
"API"
] | 09954a110e44afe34bb03c87d2a7cbf0a3be86b3 | https://github.com/firstcomputer/seeme/blob/09954a110e44afe34bb03c87d2a7cbf0a3be86b3/src/Api/Caller.php#L33-L54 |
238,991 | fabsgc/framework | Core/Config/Config.php | Config._parseLang | protected function _parseLang($src = null, $lang) {
if ($src == null) {
$file = APP_RESOURCE_LANG_PATH . $lang . '.xml';
$src = 'app';
}
else {
$file = SRC_PATH . $src . '/' . SRC_RESOURCE_LANG_PATH . $lang . '.xml';
}
$this->config['lang'][''... | php | protected function _parseLang($src = null, $lang) {
if ($src == null) {
$file = APP_RESOURCE_LANG_PATH . $lang . '.xml';
$src = 'app';
}
else {
$file = SRC_PATH . $src . '/' . SRC_RESOURCE_LANG_PATH . $lang . '.xml';
}
$this->config['lang'][''... | [
"protected",
"function",
"_parseLang",
"(",
"$",
"src",
"=",
"null",
",",
"$",
"lang",
")",
"{",
"if",
"(",
"$",
"src",
"==",
"null",
")",
"{",
"$",
"file",
"=",
"APP_RESOURCE_LANG_PATH",
".",
"$",
"lang",
".",
"'.xml'",
";",
"$",
"src",
"=",
"'app... | parse lang files and put data in an array
@access protected
@param $src string
@param $lang string
@return void
@since 3.0
@throws \Gcs\Framework\Core\Exception\MissingConfigException if lang config file doesn't exist
@package Gcs\Framework\Core\Config | [
"parse",
"lang",
"files",
"and",
"put",
"data",
"in",
"an",
"array"
] | 45e58182aba6a3c6381970a1fd3c17662cff2168 | https://github.com/fabsgc/framework/blob/45e58182aba6a3c6381970a1fd3c17662cff2168/Core/Config/Config.php#L214-L260 |
238,992 | fabsgc/framework | Core/Config/Config.php | Config._parseParent | protected function _parseParent($child, $data, $attributes) {
$parent = $child->xpath("parent::*");
if (is_object($parent[0]['name'])) {
foreach ($attributes as $attribute) {
$name = $attribute['name'];
if (is_object($parent[0][$name])) {
... | php | protected function _parseParent($child, $data, $attributes) {
$parent = $child->xpath("parent::*");
if (is_object($parent[0]['name'])) {
foreach ($attributes as $attribute) {
$name = $attribute['name'];
if (is_object($parent[0][$name])) {
... | [
"protected",
"function",
"_parseParent",
"(",
"$",
"child",
",",
"$",
"data",
",",
"$",
"attributes",
")",
"{",
"$",
"parent",
"=",
"$",
"child",
"->",
"xpath",
"(",
"\"parent::*\"",
")",
";",
"if",
"(",
"is_object",
"(",
"$",
"parent",
"[",
"0",
"]"... | parse parent node
@access protected
@param $child \SimpleXMLElement
@param $data []
@param $attributes array
@return array
@since 3.0
@package Gcs\Framework\Core\Config | [
"parse",
"parent",
"node"
] | 45e58182aba6a3c6381970a1fd3c17662cff2168 | https://github.com/fabsgc/framework/blob/45e58182aba6a3c6381970a1fd3c17662cff2168/Core/Config/Config.php#L273-L304 |
238,993 | yii2-tools/yii2-base | traits/AjaxValidationTrait.php | AjaxValidationTrait.performAjaxValidation | protected function performAjaxValidation($model)
{
$result = ($model instanceof Model)
? ActiveForm::validate($model)
: ActiveForm::validateMultiple($model);
$response = Yii::$app->getResponse();
if (!empty($result) && $ajaxRedirect = Yii::$app->getSession()->get('s... | php | protected function performAjaxValidation($model)
{
$result = ($model instanceof Model)
? ActiveForm::validate($model)
: ActiveForm::validateMultiple($model);
$response = Yii::$app->getResponse();
if (!empty($result) && $ajaxRedirect = Yii::$app->getSession()->get('s... | [
"protected",
"function",
"performAjaxValidation",
"(",
"$",
"model",
")",
"{",
"$",
"result",
"=",
"(",
"$",
"model",
"instanceof",
"Model",
")",
"?",
"ActiveForm",
"::",
"validate",
"(",
"$",
"model",
")",
":",
"ActiveForm",
"::",
"validateMultiple",
"(",
... | Performs ajax validation
@param $model
@return \yii\console\Response|\yii\web\Response | [
"Performs",
"ajax",
"validation"
] | 10f6bb6b0b9396c3d942e0f2ec06784fa9bbf72a | https://github.com/yii2-tools/yii2-base/blob/10f6bb6b0b9396c3d942e0f2ec06784fa9bbf72a/traits/AjaxValidationTrait.php#L18-L35 |
238,994 | osflab/cache | OsfCache.php | OsfCache.start | public function start(string $key)
{
$filteredKey = $this->filterKey($key);
$value = $this->get($filteredKey);
if ($value === null) {
$this->lastKey = $filteredKey;
ob_start();
} else {
$this->lastKey = null;
trigger_error('Cache start ... | php | public function start(string $key)
{
$filteredKey = $this->filterKey($key);
$value = $this->get($filteredKey);
if ($value === null) {
$this->lastKey = $filteredKey;
ob_start();
} else {
$this->lastKey = null;
trigger_error('Cache start ... | [
"public",
"function",
"start",
"(",
"string",
"$",
"key",
")",
"{",
"$",
"filteredKey",
"=",
"$",
"this",
"->",
"filterKey",
"(",
"$",
"key",
")",
";",
"$",
"value",
"=",
"$",
"this",
"->",
"get",
"(",
"$",
"filteredKey",
")",
";",
"if",
"(",
"$"... | Start cache via buffer
@param string $key
@return $this | [
"Start",
"cache",
"via",
"buffer"
] | 523fc6ff64685b390e5019dc0eaabe15b387f0a7 | https://github.com/osflab/cache/blob/523fc6ff64685b390e5019dc0eaabe15b387f0a7/OsfCache.php#L174-L186 |
238,995 | osflab/cache | OsfCache.php | OsfCache.stop | public function stop(float $timeout = 0.0): self
{
if ($this->lastKey !== null) {
$this->set($this->lastKey, ob_get_clean(), $timeout);
}
$this->lastKey = null;
return $this;
} | php | public function stop(float $timeout = 0.0): self
{
if ($this->lastKey !== null) {
$this->set($this->lastKey, ob_get_clean(), $timeout);
}
$this->lastKey = null;
return $this;
} | [
"public",
"function",
"stop",
"(",
"float",
"$",
"timeout",
"=",
"0.0",
")",
":",
"self",
"{",
"if",
"(",
"$",
"this",
"->",
"lastKey",
"!==",
"null",
")",
"{",
"$",
"this",
"->",
"set",
"(",
"$",
"this",
"->",
"lastKey",
",",
"ob_get_clean",
"(",
... | Stop buffer and put it in cache
@param float $timeout
@return $this | [
"Stop",
"buffer",
"and",
"put",
"it",
"in",
"cache"
] | 523fc6ff64685b390e5019dc0eaabe15b387f0a7 | https://github.com/osflab/cache/blob/523fc6ff64685b390e5019dc0eaabe15b387f0a7/OsfCache.php#L193-L200 |
238,996 | osflab/cache | OsfCache.php | OsfCache.cleanAll | public function cleanAll(): int
{
$cpt = 0;
$keys = $this->getRedis()->keys($this->namespace . ':*');
if ($keys) {
foreach ($keys as $key) {
$this->getRedis()->del($key);
$cpt++;
}
}
return $cpt;
} | php | public function cleanAll(): int
{
$cpt = 0;
$keys = $this->getRedis()->keys($this->namespace . ':*');
if ($keys) {
foreach ($keys as $key) {
$this->getRedis()->del($key);
$cpt++;
}
}
return $cpt;
} | [
"public",
"function",
"cleanAll",
"(",
")",
":",
"int",
"{",
"$",
"cpt",
"=",
"0",
";",
"$",
"keys",
"=",
"$",
"this",
"->",
"getRedis",
"(",
")",
"->",
"keys",
"(",
"$",
"this",
"->",
"namespace",
".",
"':*'",
")",
";",
"if",
"(",
"$",
"keys",... | Clean all values of the current namespace
@return int Number of deleted fields | [
"Clean",
"all",
"values",
"of",
"the",
"current",
"namespace"
] | 523fc6ff64685b390e5019dc0eaabe15b387f0a7 | https://github.com/osflab/cache/blob/523fc6ff64685b390e5019dc0eaabe15b387f0a7/OsfCache.php#L206-L217 |
238,997 | osflab/cache | OsfCache.php | OsfCache.getZendStorage | public function getZendStorage(string $namespace = 'default')
{
static $storages = [];
if (!isset($storages[$namespace])) {
$rrm = new RedisResourceManager();
$rrm->setResource('default', $this->getRedis());
$rrm->setLibOption('default', Redis::OPT_SERIAL... | php | public function getZendStorage(string $namespace = 'default')
{
static $storages = [];
if (!isset($storages[$namespace])) {
$rrm = new RedisResourceManager();
$rrm->setResource('default', $this->getRedis());
$rrm->setLibOption('default', Redis::OPT_SERIAL... | [
"public",
"function",
"getZendStorage",
"(",
"string",
"$",
"namespace",
"=",
"'default'",
")",
"{",
"static",
"$",
"storages",
"=",
"[",
"]",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"storages",
"[",
"$",
"namespace",
"]",
")",
")",
"{",
"$",
"rrm",
... | Build and return a zend cache storage using OSF cache configuration
@staticvar array $storages
@param string $namespace
@return \Zend\Cache\Storage\Adapter\Redis | [
"Build",
"and",
"return",
"a",
"zend",
"cache",
"storage",
"using",
"OSF",
"cache",
"configuration"
] | 523fc6ff64685b390e5019dc0eaabe15b387f0a7 | https://github.com/osflab/cache/blob/523fc6ff64685b390e5019dc0eaabe15b387f0a7/OsfCache.php#L255-L268 |
238,998 | osflab/cache | OsfCache.php | OsfCache.filterTtl | protected function filterTtl(&$ttl): void
{
if ($ttl !== null) {
if ($ttl instanceof \DateInterval) {
$ttl = (int) $ttl->format('%s');
}
$ttl = (int) $ttl;
}
} | php | protected function filterTtl(&$ttl): void
{
if ($ttl !== null) {
if ($ttl instanceof \DateInterval) {
$ttl = (int) $ttl->format('%s');
}
$ttl = (int) $ttl;
}
} | [
"protected",
"function",
"filterTtl",
"(",
"&",
"$",
"ttl",
")",
":",
"void",
"{",
"if",
"(",
"$",
"ttl",
"!==",
"null",
")",
"{",
"if",
"(",
"$",
"ttl",
"instanceof",
"\\",
"DateInterval",
")",
"{",
"$",
"ttl",
"=",
"(",
"int",
")",
"$",
"ttl",
... | Mixed ttl to seconds
@param mixed $ttl
@return void | [
"Mixed",
"ttl",
"to",
"seconds"
] | 523fc6ff64685b390e5019dc0eaabe15b387f0a7 | https://github.com/osflab/cache/blob/523fc6ff64685b390e5019dc0eaabe15b387f0a7/OsfCache.php#L310-L318 |
238,999 | BapCat/Services | src/ServiceContainer.php | ServiceContainer.register | public function register($serviceClass): void {
try {
$class = new ReflectionClass($serviceClass);
} catch(ReflectionException $e) {
throw new RuntimeException('Service class not found', 0, $e);
}
if(!$class->implementsInterface(ServiceProvider::class)) {
throw new InvalidArgumentExce... | php | public function register($serviceClass): void {
try {
$class = new ReflectionClass($serviceClass);
} catch(ReflectionException $e) {
throw new RuntimeException('Service class not found', 0, $e);
}
if(!$class->implementsInterface(ServiceProvider::class)) {
throw new InvalidArgumentExce... | [
"public",
"function",
"register",
"(",
"$",
"serviceClass",
")",
":",
"void",
"{",
"try",
"{",
"$",
"class",
"=",
"new",
"ReflectionClass",
"(",
"$",
"serviceClass",
")",
";",
"}",
"catch",
"(",
"ReflectionException",
"$",
"e",
")",
"{",
"throw",
"new",
... | Registers a Service Provider to be loaded when the framework boots
If a service provider depends on other services that have not been registered
yet, it may be queued, rather than registered. Once all services it relies on
have been registered, it will be registered.
@param string $serviceClass The Service Provid... | [
"Registers",
"a",
"Service",
"Provider",
"to",
"be",
"loaded",
"when",
"the",
"framework",
"boots"
] | 7318092a316f8f8f2ce9f09598fb5e750119dd30 | https://github.com/BapCat/Services/blob/7318092a316f8f8f2ce9f09598fb5e750119dd30/src/ServiceContainer.php#L44-L87 |
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.