repository_name stringlengths 5 67 | func_path_in_repository stringlengths 4 234 | func_name stringlengths 0 314 | whole_func_string stringlengths 52 3.87M | language stringclasses 6
values | func_code_string stringlengths 52 3.87M | func_code_tokens listlengths 15 672k | func_documentation_string stringlengths 1 47.2k | func_documentation_tokens listlengths 1 3.92k | split_name stringclasses 1
value | func_code_url stringlengths 85 339 |
|---|---|---|---|---|---|---|---|---|---|---|
aedart/laravel-helpers | src/Traits/Broadcasting/BroadcastFactoryTrait.php | BroadcastFactoryTrait.getBroadcastFactory | public function getBroadcastFactory(): ?Factory
{
if (!$this->hasBroadcastFactory()) {
$this->setBroadcastFactory($this->getDefaultBroadcastFactory());
}
return $this->broadcastFactory;
} | php | public function getBroadcastFactory(): ?Factory
{
if (!$this->hasBroadcastFactory()) {
$this->setBroadcastFactory($this->getDefaultBroadcastFactory());
}
return $this->broadcastFactory;
} | [
"public",
"function",
"getBroadcastFactory",
"(",
")",
":",
"?",
"Factory",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"hasBroadcastFactory",
"(",
")",
")",
"{",
"$",
"this",
"->",
"setBroadcastFactory",
"(",
"$",
"this",
"->",
"getDefaultBroadcastFactory",
"("... | Get broadcast factory
If no broadcast factory has been set, this method will
set and return a default broadcast factory, if any such
value is available
@see getDefaultBroadcastFactory()
@return Factory|null broadcast factory or null if none broadcast factory has been set | [
"Get",
"broadcast",
"factory"
] | train | https://github.com/aedart/laravel-helpers/blob/8b81a2d6658f3f8cb62b6be2c34773aaa2df219a/src/Traits/Broadcasting/BroadcastFactoryTrait.php#L54-L60 |
webforge-labs/psc-cms | lib/Psc/CMS/Item/Adapter.php | Adapter.getTabButton | public function getTabButton() {
if (!isset($this->tabButton)) {
if ($this->context === self::CONTEXT_DELETE) {
$this->tabButton = new DeleteTabButton($this);
} else {
$this->tabButton = new TabButton($this);
}
}
return $this->tabButton;
} | php | public function getTabButton() {
if (!isset($this->tabButton)) {
if ($this->context === self::CONTEXT_DELETE) {
$this->tabButton = new DeleteTabButton($this);
} else {
$this->tabButton = new TabButton($this);
}
}
return $this->tabButton;
} | [
"public",
"function",
"getTabButton",
"(",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"tabButton",
")",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"context",
"===",
"self",
"::",
"CONTEXT_DELETE",
")",
"{",
"$",
"this",
"->",
"tabButton"... | Gibt einen Button zurück der einen Tab des Entities aufmachen kann (defaults nicht zu default ;))
@return Psc\UI\ButtonInterface | [
"Gibt",
"einen",
"Button",
"zurück",
"der",
"einen",
"Tab",
"des",
"Entities",
"aufmachen",
"kann",
"(",
"defaults",
"nicht",
"zu",
"default",
";",
"))"
] | train | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/CMS/Item/Adapter.php#L57-L66 |
webforge-labs/psc-cms | lib/Psc/CMS/Item/Adapter.php | Adapter.getTabRequestMeta | public function getTabRequestMeta() {
if (!isset($this->tabRequestMeta)) {
if ($this->context === self::CONTEXT_ACTION) {
$this->tabRequestMeta = $this->entityMeta->getActionRequestMeta($this->requestMetaAction, $this->entity);
} else {
$this->tabRequestMeta = $this->entityMeta->getDefau... | php | public function getTabRequestMeta() {
if (!isset($this->tabRequestMeta)) {
if ($this->context === self::CONTEXT_ACTION) {
$this->tabRequestMeta = $this->entityMeta->getActionRequestMeta($this->requestMetaAction, $this->entity);
} else {
$this->tabRequestMeta = $this->entityMeta->getDefau... | [
"public",
"function",
"getTabRequestMeta",
"(",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"tabRequestMeta",
")",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"context",
"===",
"self",
"::",
"CONTEXT_ACTION",
")",
"{",
"$",
"this",
"->",
"... | Gibt die RequestMeta für den aktuellen Kontext für ein Entity zurück
bei context: action muss requestMetaAction gesetzt sein
@return Psc\CMS\RequestMeta | [
"Gibt",
"die",
"RequestMeta",
"für",
"den",
"aktuellen",
"Kontext",
"für",
"ein",
"Entity",
"zurück"
] | train | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/CMS/Item/Adapter.php#L136-L145 |
webforge-labs/psc-cms | lib/Psc/CMS/Item/Adapter.php | Adapter.getTabLabel | public function getTabLabel() {
if (isset($this->tabLabel)) {
return $this->tabLabel;
} else {
return $this->entity->getContextLabel(EntityMeta::CONTEXT_TAB);
}
} | php | public function getTabLabel() {
if (isset($this->tabLabel)) {
return $this->tabLabel;
} else {
return $this->entity->getContextLabel(EntityMeta::CONTEXT_TAB);
}
} | [
"public",
"function",
"getTabLabel",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"tabLabel",
")",
")",
"{",
"return",
"$",
"this",
"->",
"tabLabel",
";",
"}",
"else",
"{",
"return",
"$",
"this",
"->",
"entity",
"->",
"getContextLabel",
... | Befragt das Entity mit getTabLabel() nach diesem label
@return string | [
"Befragt",
"das",
"Entity",
"mit",
"getTabLabel",
"()",
"nach",
"diesem",
"label"
] | train | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/CMS/Item/Adapter.php#L207-L213 |
steeffeen/FancyManiaLinks | FML/Script/Features/MenuElement.php | MenuElement.setItem | public function setItem(Control $item)
{
$item->checkId();
if ($item instanceof Scriptable) {
$item->setScriptEvents(true);
}
$this->item = $item;
return $this;
} | php | public function setItem(Control $item)
{
$item->checkId();
if ($item instanceof Scriptable) {
$item->setScriptEvents(true);
}
$this->item = $item;
return $this;
} | [
"public",
"function",
"setItem",
"(",
"Control",
"$",
"item",
")",
"{",
"$",
"item",
"->",
"checkId",
"(",
")",
";",
"if",
"(",
"$",
"item",
"instanceof",
"Scriptable",
")",
"{",
"$",
"item",
"->",
"setScriptEvents",
"(",
"true",
")",
";",
"}",
"$",
... | Set the Item Control
@api
@param Control $item Item Control
@return static | [
"Set",
"the",
"Item",
"Control"
] | train | https://github.com/steeffeen/FancyManiaLinks/blob/227b0759306f0a3c75873ba50276e4163a93bfa6/FML/Script/Features/MenuElement.php#L63-L71 |
dunkelfrosch/phpcoverfish | src/PHPCoverFish/Validator/Base/BaseCoverFishValidator.php | BaseCoverFishValidator.setMapping | public function setMapping(array $mappingOptions)
{
$coverMapping = new CoverFishMapping();
$coverMapping->setAnnotation($mappingOptions['coverToken']);
$coverMapping->setMethod($mappingOptions['coverMethod']);
$coverMapping->setAccessor($mappingOptions['coverAccessor']);
$co... | php | public function setMapping(array $mappingOptions)
{
$coverMapping = new CoverFishMapping();
$coverMapping->setAnnotation($mappingOptions['coverToken']);
$coverMapping->setMethod($mappingOptions['coverMethod']);
$coverMapping->setAccessor($mappingOptions['coverAccessor']);
$co... | [
"public",
"function",
"setMapping",
"(",
"array",
"$",
"mappingOptions",
")",
"{",
"$",
"coverMapping",
"=",
"new",
"CoverFishMapping",
"(",
")",
";",
"$",
"coverMapping",
"->",
"setAnnotation",
"(",
"$",
"mappingOptions",
"[",
"'coverToken'",
"]",
")",
";",
... | @param array $mappingOptions
@return CoverFishMapping | [
"@param",
"array",
"$mappingOptions"
] | train | https://github.com/dunkelfrosch/phpcoverfish/blob/779bd399ec8f4cadb3b7854200695c5eb3f5a8ad/src/PHPCoverFish/Validator/Base/BaseCoverFishValidator.php#L95-L108 |
dunkelfrosch/phpcoverfish | src/PHPCoverFish/Validator/Base/BaseCoverFishValidator.php | BaseCoverFishValidator.validateDefaultCoverClassMapping | public function validateDefaultCoverClassMapping(CoverFishMapping $coverMapping, CoverFishResult $coverFishResult)
{
if (empty($coverMapping->getClassFQN())) {
$coverFishResult = $this->setValidationError(
$coverFishResult,
empty($coverMapping->getClass())
... | php | public function validateDefaultCoverClassMapping(CoverFishMapping $coverMapping, CoverFishResult $coverFishResult)
{
if (empty($coverMapping->getClassFQN())) {
$coverFishResult = $this->setValidationError(
$coverFishResult,
empty($coverMapping->getClass())
... | [
"public",
"function",
"validateDefaultCoverClassMapping",
"(",
"CoverFishMapping",
"$",
"coverMapping",
",",
"CoverFishResult",
"$",
"coverFishResult",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"coverMapping",
"->",
"getClassFQN",
"(",
")",
")",
")",
"{",
"$",
"co... | @param CoverFishMapping $coverMapping
@param CoverFishResult $coverFishResult
@return CoverFishResult | [
"@param",
"CoverFishMapping",
"$coverMapping",
"@param",
"CoverFishResult",
"$coverFishResult"
] | train | https://github.com/dunkelfrosch/phpcoverfish/blob/779bd399ec8f4cadb3b7854200695c5eb3f5a8ad/src/PHPCoverFish/Validator/Base/BaseCoverFishValidator.php#L124-L136 |
dunkelfrosch/phpcoverfish | src/PHPCoverFish/Validator/Base/BaseCoverFishValidator.php | BaseCoverFishValidator.validateClassFQNMapping | public function validateClassFQNMapping(CoverFishMapping $coverMapping, CoverFishResult $coverFishResult)
{
$classReflectionResult = $this->validateReflectionClass($coverMapping->getClassFQN());
if ($classReflectionResult instanceof CoverFishMessageError) {
$coverFishResult = $this->setV... | php | public function validateClassFQNMapping(CoverFishMapping $coverMapping, CoverFishResult $coverFishResult)
{
$classReflectionResult = $this->validateReflectionClass($coverMapping->getClassFQN());
if ($classReflectionResult instanceof CoverFishMessageError) {
$coverFishResult = $this->setV... | [
"public",
"function",
"validateClassFQNMapping",
"(",
"CoverFishMapping",
"$",
"coverMapping",
",",
"CoverFishResult",
"$",
"coverFishResult",
")",
"{",
"$",
"classReflectionResult",
"=",
"$",
"this",
"->",
"validateReflectionClass",
"(",
"$",
"coverMapping",
"->",
"g... | @todo: mappingResult could be false, set a specific/real coverFishError here ...
@param CoverFishMapping $coverMapping
@param CoverFishResult $coverFishResult
@return CoverFishResult | [
"@todo",
":",
"mappingResult",
"could",
"be",
"false",
"set",
"a",
"specific",
"/",
"real",
"coverFishError",
"here",
"..."
] | train | https://github.com/dunkelfrosch/phpcoverfish/blob/779bd399ec8f4cadb3b7854200695c5eb3f5a8ad/src/PHPCoverFish/Validator/Base/BaseCoverFishValidator.php#L146-L157 |
dunkelfrosch/phpcoverfish | src/PHPCoverFish/Validator/Base/BaseCoverFishValidator.php | BaseCoverFishValidator.validateClassAccessorVisibility | public function validateClassAccessorVisibility(CoverFishMapping $coverMapping, CoverFishResult $coverFishResult)
{
$methodReflectionResult = $this->validateReflectionClassForAccessorVisibility($coverMapping->getClassFQN(), $coverMapping->getAccessor());
if ($methodReflectionResult instanceof CoverF... | php | public function validateClassAccessorVisibility(CoverFishMapping $coverMapping, CoverFishResult $coverFishResult)
{
$methodReflectionResult = $this->validateReflectionClassForAccessorVisibility($coverMapping->getClassFQN(), $coverMapping->getAccessor());
if ($methodReflectionResult instanceof CoverF... | [
"public",
"function",
"validateClassAccessorVisibility",
"(",
"CoverFishMapping",
"$",
"coverMapping",
",",
"CoverFishResult",
"$",
"coverFishResult",
")",
"{",
"$",
"methodReflectionResult",
"=",
"$",
"this",
"->",
"validateReflectionClassForAccessorVisibility",
"(",
"$",
... | @param CoverFishMapping $coverMapping
@param CoverFishResult $coverFishResult
@return CoverFishResult | [
"@param",
"CoverFishMapping",
"$coverMapping",
"@param",
"CoverFishResult",
"$coverFishResult"
] | train | https://github.com/dunkelfrosch/phpcoverfish/blob/779bd399ec8f4cadb3b7854200695c5eb3f5a8ad/src/PHPCoverFish/Validator/Base/BaseCoverFishValidator.php#L165-L176 |
dunkelfrosch/phpcoverfish | src/PHPCoverFish/Validator/Base/BaseCoverFishValidator.php | BaseCoverFishValidator.validateClassMethod | public function validateClassMethod(CoverFishMapping $coverMapping, CoverFishResult $coverFishResult)
{
$methodReflectionResult = $this->validateReflectionMethod($coverMapping->getClassFQN(), $coverMapping->getMethod());
if ($methodReflectionResult instanceof CoverFishMessageError) {
$co... | php | public function validateClassMethod(CoverFishMapping $coverMapping, CoverFishResult $coverFishResult)
{
$methodReflectionResult = $this->validateReflectionMethod($coverMapping->getClassFQN(), $coverMapping->getMethod());
if ($methodReflectionResult instanceof CoverFishMessageError) {
$co... | [
"public",
"function",
"validateClassMethod",
"(",
"CoverFishMapping",
"$",
"coverMapping",
",",
"CoverFishResult",
"$",
"coverFishResult",
")",
"{",
"$",
"methodReflectionResult",
"=",
"$",
"this",
"->",
"validateReflectionMethod",
"(",
"$",
"coverMapping",
"->",
"get... | @param CoverFishMapping $coverMapping
@param CoverFishResult $coverFishResult
@return CoverFishResult | [
"@param",
"CoverFishMapping",
"$coverMapping",
"@param",
"CoverFishResult",
"$coverFishResult"
] | train | https://github.com/dunkelfrosch/phpcoverfish/blob/779bd399ec8f4cadb3b7854200695c5eb3f5a8ad/src/PHPCoverFish/Validator/Base/BaseCoverFishValidator.php#L184-L195 |
dunkelfrosch/phpcoverfish | src/PHPCoverFish/Validator/Base/BaseCoverFishValidator.php | BaseCoverFishValidator.validateEmptyDocBlock | public function validateEmptyDocBlock(CoverFishMapping $coverMapping, CoverFishResult $coverFishResult)
{
if (null === ($coverMapping->getAnnotation())) {
$coverFishResult = $this->setValidationWarning(
$coverFishResult,
CoverFishMessageWarning::PHPUNIT_NO_DOCBLOC... | php | public function validateEmptyDocBlock(CoverFishMapping $coverMapping, CoverFishResult $coverFishResult)
{
if (null === ($coverMapping->getAnnotation())) {
$coverFishResult = $this->setValidationWarning(
$coverFishResult,
CoverFishMessageWarning::PHPUNIT_NO_DOCBLOC... | [
"public",
"function",
"validateEmptyDocBlock",
"(",
"CoverFishMapping",
"$",
"coverMapping",
",",
"CoverFishResult",
"$",
"coverFishResult",
")",
"{",
"if",
"(",
"null",
"===",
"(",
"$",
"coverMapping",
"->",
"getAnnotation",
"(",
")",
")",
")",
"{",
"$",
"cov... | @param CoverFishMapping $coverMapping
@param CoverFishResult $coverFishResult
@return CoverFishResult | [
"@param",
"CoverFishMapping",
"$coverMapping",
"@param",
"CoverFishResult",
"$coverFishResult"
] | train | https://github.com/dunkelfrosch/phpcoverfish/blob/779bd399ec8f4cadb3b7854200695c5eb3f5a8ad/src/PHPCoverFish/Validator/Base/BaseCoverFishValidator.php#L203-L213 |
dunkelfrosch/phpcoverfish | src/PHPCoverFish/Validator/Base/BaseCoverFishValidator.php | BaseCoverFishValidator.validateMapping | public function validateMapping(CoverFishMapping $coverMapping)
{
/** @var CoverFishResult $coverFishResult */
$coverFishResult = new CoverFishResult();
// prepare base results, clear all validation errors and warnings
$coverFishResult = $this->prepareCoverFishResult($coverFishResult... | php | public function validateMapping(CoverFishMapping $coverMapping)
{
/** @var CoverFishResult $coverFishResult */
$coverFishResult = new CoverFishResult();
// prepare base results, clear all validation errors and warnings
$coverFishResult = $this->prepareCoverFishResult($coverFishResult... | [
"public",
"function",
"validateMapping",
"(",
"CoverFishMapping",
"$",
"coverMapping",
")",
"{",
"/** @var CoverFishResult $coverFishResult */",
"$",
"coverFishResult",
"=",
"new",
"CoverFishResult",
"(",
")",
";",
"// prepare base results, clear all validation errors and warning... | main validator mapping "engine", if any of our cover validator checks will fail,
return corresponding result immediately ...
@param CoverFishMapping $coverMapping
@return CoverFishResult | [
"main",
"validator",
"mapping",
"engine",
"if",
"any",
"of",
"our",
"cover",
"validator",
"checks",
"will",
"fail",
"return",
"corresponding",
"result",
"immediately",
"..."
] | train | https://github.com/dunkelfrosch/phpcoverfish/blob/779bd399ec8f4cadb3b7854200695c5eb3f5a8ad/src/PHPCoverFish/Validator/Base/BaseCoverFishValidator.php#L223-L239 |
dunkelfrosch/phpcoverfish | src/PHPCoverFish/Validator/Base/BaseCoverFishValidator.php | BaseCoverFishValidator.prepareCoverFishResult | public function prepareCoverFishResult(CoverFishResult $coverFishResult)
{
$this->clearValidationErrors($coverFishResult);
$this->clearValidationWarnings($coverFishResult);
return $coverFishResult;
} | php | public function prepareCoverFishResult(CoverFishResult $coverFishResult)
{
$this->clearValidationErrors($coverFishResult);
$this->clearValidationWarnings($coverFishResult);
return $coverFishResult;
} | [
"public",
"function",
"prepareCoverFishResult",
"(",
"CoverFishResult",
"$",
"coverFishResult",
")",
"{",
"$",
"this",
"->",
"clearValidationErrors",
"(",
"$",
"coverFishResult",
")",
";",
"$",
"this",
"->",
"clearValidationWarnings",
"(",
"$",
"coverFishResult",
")... | @param CoverFishResult $coverFishResult
@return CoverFishResult | [
"@param",
"CoverFishResult",
"$coverFishResult"
] | train | https://github.com/dunkelfrosch/phpcoverfish/blob/779bd399ec8f4cadb3b7854200695c5eb3f5a8ad/src/PHPCoverFish/Validator/Base/BaseCoverFishValidator.php#L246-L252 |
dunkelfrosch/phpcoverfish | src/PHPCoverFish/Validator/Base/BaseCoverFishValidator.php | BaseCoverFishValidator.validateReflectionMethod | public function validateReflectionMethod($classFQN, $method)
{
if (null === $classFQN || null === $method) {
return false;
}
try {
$reflectionMethod = new \ReflectionMethod($classFQN, $method);
} catch (\ReflectionException $re) {
return new Cover... | php | public function validateReflectionMethod($classFQN, $method)
{
if (null === $classFQN || null === $method) {
return false;
}
try {
$reflectionMethod = new \ReflectionMethod($classFQN, $method);
} catch (\ReflectionException $re) {
return new Cover... | [
"public",
"function",
"validateReflectionMethod",
"(",
"$",
"classFQN",
",",
"$",
"method",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"classFQN",
"||",
"null",
"===",
"$",
"method",
")",
"{",
"return",
"false",
";",
"}",
"try",
"{",
"$",
"reflectionMethod... | @param string $classFQN
@param string $method
@return CoverFishMessageError|\ReflectionMethod|false | [
"@param",
"string",
"$classFQN",
"@param",
"string",
"$method"
] | train | https://github.com/dunkelfrosch/phpcoverfish/blob/779bd399ec8f4cadb3b7854200695c5eb3f5a8ad/src/PHPCoverFish/Validator/Base/BaseCoverFishValidator.php#L270-L283 |
dunkelfrosch/phpcoverfish | src/PHPCoverFish/Validator/Base/BaseCoverFishValidator.php | BaseCoverFishValidator.validateReflectionClassForAccessorPublic | public function validateReflectionClassForAccessorPublic(\ReflectionClass $reflectionClass)
{
if (empty($methods = $reflectionClass->getMethods(\ReflectionMethod::IS_PUBLIC))) {
return new CoverFishMessageError(
CoverFishMessageError::PHPUNIT_REFLECTION_NO_PUBLIC_METHODS_FOUND, n... | php | public function validateReflectionClassForAccessorPublic(\ReflectionClass $reflectionClass)
{
if (empty($methods = $reflectionClass->getMethods(\ReflectionMethod::IS_PUBLIC))) {
return new CoverFishMessageError(
CoverFishMessageError::PHPUNIT_REFLECTION_NO_PUBLIC_METHODS_FOUND, n... | [
"public",
"function",
"validateReflectionClassForAccessorPublic",
"(",
"\\",
"ReflectionClass",
"$",
"reflectionClass",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"methods",
"=",
"$",
"reflectionClass",
"->",
"getMethods",
"(",
"\\",
"ReflectionMethod",
"::",
"IS_PUBLI... | @param \ReflectionClass $reflectionClass
@return bool|CoverFishMessageError | [
"@param",
"\\",
"ReflectionClass",
"$reflectionClass"
] | train | https://github.com/dunkelfrosch/phpcoverfish/blob/779bd399ec8f4cadb3b7854200695c5eb3f5a8ad/src/PHPCoverFish/Validator/Base/BaseCoverFishValidator.php#L290-L299 |
dunkelfrosch/phpcoverfish | src/PHPCoverFish/Validator/Base/BaseCoverFishValidator.php | BaseCoverFishValidator.validateReflectionClassForAccessorNotPublic | public function validateReflectionClassForAccessorNotPublic(\ReflectionClass $reflectionClass)
{
$methods = array_merge(
$reflectionClass->getMethods(\ReflectionMethod::IS_PRIVATE),
$reflectionClass->getMethods(\ReflectionMethod::IS_PROTECTED)
);
if (empty($methods))... | php | public function validateReflectionClassForAccessorNotPublic(\ReflectionClass $reflectionClass)
{
$methods = array_merge(
$reflectionClass->getMethods(\ReflectionMethod::IS_PRIVATE),
$reflectionClass->getMethods(\ReflectionMethod::IS_PROTECTED)
);
if (empty($methods))... | [
"public",
"function",
"validateReflectionClassForAccessorNotPublic",
"(",
"\\",
"ReflectionClass",
"$",
"reflectionClass",
")",
"{",
"$",
"methods",
"=",
"array_merge",
"(",
"$",
"reflectionClass",
"->",
"getMethods",
"(",
"\\",
"ReflectionMethod",
"::",
"IS_PRIVATE",
... | @param \ReflectionClass $reflectionClass
@return bool|CoverFishMessageError | [
"@param",
"\\",
"ReflectionClass",
"$reflectionClass"
] | train | https://github.com/dunkelfrosch/phpcoverfish/blob/779bd399ec8f4cadb3b7854200695c5eb3f5a8ad/src/PHPCoverFish/Validator/Base/BaseCoverFishValidator.php#L306-L320 |
dunkelfrosch/phpcoverfish | src/PHPCoverFish/Validator/Base/BaseCoverFishValidator.php | BaseCoverFishValidator.validateReflectionClassForAccessorProtected | public function validateReflectionClassForAccessorProtected(\ReflectionClass $reflectionClass)
{
if (empty($methods = $reflectionClass->getMethods(\ReflectionMethod::IS_PROTECTED))) {
return new CoverFishMessageError(
CoverFishMessageError::PHPUNIT_REFLECTION_NO_PROTECTED_METHODS... | php | public function validateReflectionClassForAccessorProtected(\ReflectionClass $reflectionClass)
{
if (empty($methods = $reflectionClass->getMethods(\ReflectionMethod::IS_PROTECTED))) {
return new CoverFishMessageError(
CoverFishMessageError::PHPUNIT_REFLECTION_NO_PROTECTED_METHODS... | [
"public",
"function",
"validateReflectionClassForAccessorProtected",
"(",
"\\",
"ReflectionClass",
"$",
"reflectionClass",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"methods",
"=",
"$",
"reflectionClass",
"->",
"getMethods",
"(",
"\\",
"ReflectionMethod",
"::",
"IS_PR... | @param \ReflectionClass $reflectionClass
@return bool|CoverFishMessageError | [
"@param",
"\\",
"ReflectionClass",
"$reflectionClass"
] | train | https://github.com/dunkelfrosch/phpcoverfish/blob/779bd399ec8f4cadb3b7854200695c5eb3f5a8ad/src/PHPCoverFish/Validator/Base/BaseCoverFishValidator.php#L327-L336 |
dunkelfrosch/phpcoverfish | src/PHPCoverFish/Validator/Base/BaseCoverFishValidator.php | BaseCoverFishValidator.validateReflectionClassForAccessorNotProtected | public function validateReflectionClassForAccessorNotProtected(\ReflectionClass $reflectionClass)
{
$methods = array_merge(
$reflectionClass->getMethods(\ReflectionMethod::IS_PRIVATE),
$reflectionClass->getMethods(\ReflectionMethod::IS_PUBLIC)
);
if (empty($methods))... | php | public function validateReflectionClassForAccessorNotProtected(\ReflectionClass $reflectionClass)
{
$methods = array_merge(
$reflectionClass->getMethods(\ReflectionMethod::IS_PRIVATE),
$reflectionClass->getMethods(\ReflectionMethod::IS_PUBLIC)
);
if (empty($methods))... | [
"public",
"function",
"validateReflectionClassForAccessorNotProtected",
"(",
"\\",
"ReflectionClass",
"$",
"reflectionClass",
")",
"{",
"$",
"methods",
"=",
"array_merge",
"(",
"$",
"reflectionClass",
"->",
"getMethods",
"(",
"\\",
"ReflectionMethod",
"::",
"IS_PRIVATE"... | @param \ReflectionClass $reflectionClass
@return bool|CoverFishMessageError | [
"@param",
"\\",
"ReflectionClass",
"$reflectionClass"
] | train | https://github.com/dunkelfrosch/phpcoverfish/blob/779bd399ec8f4cadb3b7854200695c5eb3f5a8ad/src/PHPCoverFish/Validator/Base/BaseCoverFishValidator.php#L343-L357 |
dunkelfrosch/phpcoverfish | src/PHPCoverFish/Validator/Base/BaseCoverFishValidator.php | BaseCoverFishValidator.validateReflectionClassForAccessorPrivate | public function validateReflectionClassForAccessorPrivate(\ReflectionClass $reflectionClass)
{
if (empty($methods = $reflectionClass->getMethods(\ReflectionMethod::IS_PRIVATE))) {
return new CoverFishMessageError(
CoverFishMessageError::PHPUNIT_REFLECTION_NO_PRIVATE_METHODS_FOUND... | php | public function validateReflectionClassForAccessorPrivate(\ReflectionClass $reflectionClass)
{
if (empty($methods = $reflectionClass->getMethods(\ReflectionMethod::IS_PRIVATE))) {
return new CoverFishMessageError(
CoverFishMessageError::PHPUNIT_REFLECTION_NO_PRIVATE_METHODS_FOUND... | [
"public",
"function",
"validateReflectionClassForAccessorPrivate",
"(",
"\\",
"ReflectionClass",
"$",
"reflectionClass",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"methods",
"=",
"$",
"reflectionClass",
"->",
"getMethods",
"(",
"\\",
"ReflectionMethod",
"::",
"IS_PRIV... | @param \ReflectionClass $reflectionClass
@return bool|CoverFishMessageError | [
"@param",
"\\",
"ReflectionClass",
"$reflectionClass"
] | train | https://github.com/dunkelfrosch/phpcoverfish/blob/779bd399ec8f4cadb3b7854200695c5eb3f5a8ad/src/PHPCoverFish/Validator/Base/BaseCoverFishValidator.php#L364-L373 |
dunkelfrosch/phpcoverfish | src/PHPCoverFish/Validator/Base/BaseCoverFishValidator.php | BaseCoverFishValidator.validateReflectionClassForAccessorNotPrivate | public function validateReflectionClassForAccessorNotPrivate(\ReflectionClass $reflectionClass)
{
$methods = array_merge(
$reflectionClass->getMethods(\ReflectionMethod::IS_PROTECTED),
$reflectionClass->getMethods(\ReflectionMethod::IS_PUBLIC)
);
if (empty($methods))... | php | public function validateReflectionClassForAccessorNotPrivate(\ReflectionClass $reflectionClass)
{
$methods = array_merge(
$reflectionClass->getMethods(\ReflectionMethod::IS_PROTECTED),
$reflectionClass->getMethods(\ReflectionMethod::IS_PUBLIC)
);
if (empty($methods))... | [
"public",
"function",
"validateReflectionClassForAccessorNotPrivate",
"(",
"\\",
"ReflectionClass",
"$",
"reflectionClass",
")",
"{",
"$",
"methods",
"=",
"array_merge",
"(",
"$",
"reflectionClass",
"->",
"getMethods",
"(",
"\\",
"ReflectionMethod",
"::",
"IS_PROTECTED"... | @param \ReflectionClass $reflectionClass
@return bool|CoverFishMessageError | [
"@param",
"\\",
"ReflectionClass",
"$reflectionClass"
] | train | https://github.com/dunkelfrosch/phpcoverfish/blob/779bd399ec8f4cadb3b7854200695c5eb3f5a8ad/src/PHPCoverFish/Validator/Base/BaseCoverFishValidator.php#L380-L394 |
dunkelfrosch/phpcoverfish | src/PHPCoverFish/Validator/Base/BaseCoverFishValidator.php | BaseCoverFishValidator.validateReflectionClassForAccessorVisibility | public function validateReflectionClassForAccessorVisibility($classFQN, $accessor)
{
$reflectionClass = $this->getReflectionClass($classFQN);
if ($reflectionClass instanceof CoverFishMessageError) {
return $reflectionClass;
}
$accessorResult = null;
switch ($acc... | php | public function validateReflectionClassForAccessorVisibility($classFQN, $accessor)
{
$reflectionClass = $this->getReflectionClass($classFQN);
if ($reflectionClass instanceof CoverFishMessageError) {
return $reflectionClass;
}
$accessorResult = null;
switch ($acc... | [
"public",
"function",
"validateReflectionClassForAccessorVisibility",
"(",
"$",
"classFQN",
",",
"$",
"accessor",
")",
"{",
"$",
"reflectionClass",
"=",
"$",
"this",
"->",
"getReflectionClass",
"(",
"$",
"classFQN",
")",
";",
"if",
"(",
"$",
"reflectionClass",
"... | @param string $classFQN
@param string $accessor
@return bool|CoverFishMessageError | [
"@param",
"string",
"$classFQN",
"@param",
"string",
"$accessor"
] | train | https://github.com/dunkelfrosch/phpcoverfish/blob/779bd399ec8f4cadb3b7854200695c5eb3f5a8ad/src/PHPCoverFish/Validator/Base/BaseCoverFishValidator.php#L402-L445 |
dunkelfrosch/phpcoverfish | src/PHPCoverFish/Validator/Base/BaseCoverFishValidator.php | BaseCoverFishValidator.setValidationError | public function setValidationError(CoverFishResult $coverFishResult, $errorCode, $errorMessage = null)
{
// skip validation if incoming mapping result is already invalid!
if (false === $coverFishResult->isPass()) {
return $coverFishResult;
}
$coverFishResult->setPass(fal... | php | public function setValidationError(CoverFishResult $coverFishResult, $errorCode, $errorMessage = null)
{
// skip validation if incoming mapping result is already invalid!
if (false === $coverFishResult->isPass()) {
return $coverFishResult;
}
$coverFishResult->setPass(fal... | [
"public",
"function",
"setValidationError",
"(",
"CoverFishResult",
"$",
"coverFishResult",
",",
"$",
"errorCode",
",",
"$",
"errorMessage",
"=",
"null",
")",
"{",
"// skip validation if incoming mapping result is already invalid!",
"if",
"(",
"false",
"===",
"$",
"cove... | @param CoverFishResult $coverFishResult
@param int $errorCode
@param string|null $errorMessage
@return CoverFishResult | [
"@param",
"CoverFishResult",
"$coverFishResult",
"@param",
"int",
"$errorCode",
"@param",
"string|null",
"$errorMessage"
] | train | https://github.com/dunkelfrosch/phpcoverfish/blob/779bd399ec8f4cadb3b7854200695c5eb3f5a8ad/src/PHPCoverFish/Validator/Base/BaseCoverFishValidator.php#L480-L491 |
dunkelfrosch/phpcoverfish | src/PHPCoverFish/Validator/Base/BaseCoverFishValidator.php | BaseCoverFishValidator.setValidationWarning | public function setValidationWarning(CoverFishResult $coverFishResult, $warningCode, $warningMessage = null)
{
$coverFishResult->addWarning(new CoverFishMessageWarning($warningCode, $warningMessage));
return $coverFishResult;
} | php | public function setValidationWarning(CoverFishResult $coverFishResult, $warningCode, $warningMessage = null)
{
$coverFishResult->addWarning(new CoverFishMessageWarning($warningCode, $warningMessage));
return $coverFishResult;
} | [
"public",
"function",
"setValidationWarning",
"(",
"CoverFishResult",
"$",
"coverFishResult",
",",
"$",
"warningCode",
",",
"$",
"warningMessage",
"=",
"null",
")",
"{",
"$",
"coverFishResult",
"->",
"addWarning",
"(",
"new",
"CoverFishMessageWarning",
"(",
"$",
"... | @param CoverFishResult $coverFishResult
@param int $warningCode
@param string|null $warningMessage
@return CoverFishResult | [
"@param",
"CoverFishResult",
"$coverFishResult",
"@param",
"int",
"$warningCode",
"@param",
"string|null",
"$warningMessage"
] | train | https://github.com/dunkelfrosch/phpcoverfish/blob/779bd399ec8f4cadb3b7854200695c5eb3f5a8ad/src/PHPCoverFish/Validator/Base/BaseCoverFishValidator.php#L500-L505 |
dunkelfrosch/phpcoverfish | src/PHPCoverFish/Validator/Base/BaseCoverFishValidator.php | BaseCoverFishValidator.getReflectionClass | public function getReflectionClass($classFQN)
{
try {
$reflectionClass = new \ReflectionClass($classFQN);
} catch (\ReflectionException $re) {
return new CoverFishMessageError(CoverFishMessageError::PHPUNIT_REFLECTION_CLASS_NOT_FOUND, $classFQN);
}
return $re... | php | public function getReflectionClass($classFQN)
{
try {
$reflectionClass = new \ReflectionClass($classFQN);
} catch (\ReflectionException $re) {
return new CoverFishMessageError(CoverFishMessageError::PHPUNIT_REFLECTION_CLASS_NOT_FOUND, $classFQN);
}
return $re... | [
"public",
"function",
"getReflectionClass",
"(",
"$",
"classFQN",
")",
"{",
"try",
"{",
"$",
"reflectionClass",
"=",
"new",
"\\",
"ReflectionClass",
"(",
"$",
"classFQN",
")",
";",
"}",
"catch",
"(",
"\\",
"ReflectionException",
"$",
"re",
")",
"{",
"retur... | @param string $classFQN
@return CoverFishMessageError|\ReflectionClass | [
"@param",
"string",
"$classFQN"
] | train | https://github.com/dunkelfrosch/phpcoverfish/blob/779bd399ec8f4cadb3b7854200695c5eb3f5a8ad/src/PHPCoverFish/Validator/Base/BaseCoverFishValidator.php#L512-L521 |
yuncms/framework | src/notifications/channels/DatabaseChannel.php | DatabaseChannel.send | public function send(NotifiableInterface $notifiable, Notification $notification)
{
/** @var ActiveRecord $modelClass */
$notifiable = $notifiable->routeNotificationFor('database');
return DatabaseNotification::create([
'id' => $notification->id,
'verb' => $notificat... | php | public function send(NotifiableInterface $notifiable, Notification $notification)
{
/** @var ActiveRecord $modelClass */
$notifiable = $notifiable->routeNotificationFor('database');
return DatabaseNotification::create([
'id' => $notification->id,
'verb' => $notificat... | [
"public",
"function",
"send",
"(",
"NotifiableInterface",
"$",
"notifiable",
",",
"Notification",
"$",
"notification",
")",
"{",
"/** @var ActiveRecord $modelClass */",
"$",
"notifiable",
"=",
"$",
"notifiable",
"->",
"routeNotificationFor",
"(",
"'database'",
")",
";... | Send the given notification.
@param NotifiableInterface $notifiable
@param Notification $notification
@return mixed | [
"Send",
"the",
"given",
"notification",
"."
] | train | https://github.com/yuncms/framework/blob/af42e28ea4ae15ab8eead3f6d119f93863b94154/src/notifications/channels/DatabaseChannel.php#L31-L44 |
maniaplanet/matchmaking-lobby | MatchMakingLobby/GUI/AbstractGUI.php | AbstractGUI.createLabel | final function createLabel($message, $login = null, $countdown = null, $isAnimated = false, $hideOnF6 = true, $showBackgroud = false)
{
$this->removeLabel($login);
$ui = Windows\Label::Create($login);
$ui->setPosition(0, 40);
$ui->setMessage($message, $countdown);
$ui->animated = $isAnimated;
$ui->h... | php | final function createLabel($message, $login = null, $countdown = null, $isAnimated = false, $hideOnF6 = true, $showBackgroud = false)
{
$this->removeLabel($login);
$ui = Windows\Label::Create($login);
$ui->setPosition(0, 40);
$ui->setMessage($message, $countdown);
$ui->animated = $isAnimated;
$ui->h... | [
"final",
"function",
"createLabel",
"(",
"$",
"message",
",",
"$",
"login",
"=",
"null",
",",
"$",
"countdown",
"=",
"null",
",",
"$",
"isAnimated",
"=",
"false",
",",
"$",
"hideOnF6",
"=",
"true",
",",
"$",
"showBackgroud",
"=",
"false",
")",
"{",
"... | Display a text message in the center of the player's screen
If countdown is set, the message will be refresh every second the end of the countdown
@param string $login
@param string $message
@param int $countdown
@param bool $isAnimated If true the text will be animated | [
"Display",
"a",
"text",
"message",
"in",
"the",
"center",
"of",
"the",
"player",
"s",
"screen",
"If",
"countdown",
"is",
"set",
"the",
"message",
"will",
"be",
"refresh",
"every",
"second",
"the",
"end",
"of",
"the",
"countdown"
] | train | https://github.com/maniaplanet/matchmaking-lobby/blob/384f22cdd2cfb0204a071810549eaf1eb01d8b7f/MatchMakingLobby/GUI/AbstractGUI.php#L190-L200 |
maniaplanet/matchmaking-lobby | MatchMakingLobby/GUI/AbstractGUI.php | AbstractGUI.updateLobbyWindow | final function updateLobbyWindow($serverName, $playersCount, $playingPlayersCount, $averageTime)
{
$lobbyWindow = Windows\LobbyWindow::Create();
Windows\LobbyWindow::setServerName($serverName);
Windows\LobbyWindow::setAverageWaitingTime($averageTime == -1 ? -1 : ceil($averageTime/60));
Windows\LobbyWindo... | php | final function updateLobbyWindow($serverName, $playersCount, $playingPlayersCount, $averageTime)
{
$lobbyWindow = Windows\LobbyWindow::Create();
Windows\LobbyWindow::setServerName($serverName);
Windows\LobbyWindow::setAverageWaitingTime($averageTime == -1 ? -1 : ceil($averageTime/60));
Windows\LobbyWindo... | [
"final",
"function",
"updateLobbyWindow",
"(",
"$",
"serverName",
",",
"$",
"playersCount",
",",
"$",
"playingPlayersCount",
",",
"$",
"averageTime",
")",
"{",
"$",
"lobbyWindow",
"=",
"Windows",
"\\",
"LobbyWindow",
"::",
"Create",
"(",
")",
";",
"Windows",
... | Display the lobby Window on the right of the screen
@param string $serverName
@param int $playersCount Number of players ready on the lobby
@param int $totalPlayerCount Total number of player on the matchmaking system
@param int $playingPlayersCount Number of player in match | [
"Display",
"the",
"lobby",
"Window",
"on",
"the",
"right",
"of",
"the",
"screen"
] | train | https://github.com/maniaplanet/matchmaking-lobby/blob/384f22cdd2cfb0204a071810549eaf1eb01d8b7f/MatchMakingLobby/GUI/AbstractGUI.php#L269-L277 |
maniaplanet/matchmaking-lobby | MatchMakingLobby/GUI/AbstractGUI.php | AbstractGUI.updatePlayerList | final function updatePlayerList(array $blockedPlayerList, $setLocalAllyAction, $unsetLocalAllyAction, $maxAllyCount, $player = '')
{
if($player)
{
$playerLists = Windows\PlayerList::Get($player);
}
else
{
$playerLists = Windows\PlayerList::GetAll();
}
foreach($playerLists as $playerList)
... | php | final function updatePlayerList(array $blockedPlayerList, $setLocalAllyAction, $unsetLocalAllyAction, $maxAllyCount, $player = '')
{
if($player)
{
$playerLists = Windows\PlayerList::Get($player);
}
else
{
$playerLists = Windows\PlayerList::GetAll();
}
foreach($playerLists as $playerList)
... | [
"final",
"function",
"updatePlayerList",
"(",
"array",
"$",
"blockedPlayerList",
",",
"$",
"setLocalAllyAction",
",",
"$",
"unsetLocalAllyAction",
",",
"$",
"maxAllyCount",
",",
"$",
"player",
"=",
"''",
")",
"{",
"if",
"(",
"$",
"player",
")",
"{",
"$",
"... | update the Player list
@param string $login
@param string[] $blockedPlayerList | [
"update",
"the",
"Player",
"list"
] | train | https://github.com/maniaplanet/matchmaking-lobby/blob/384f22cdd2cfb0204a071810549eaf1eb01d8b7f/MatchMakingLobby/GUI/AbstractGUI.php#L377-L454 |
maniaplanet/matchmaking-lobby | MatchMakingLobby/GUI/AbstractGUI.php | AbstractGUI.removePlayerFromPlayerList | final function removePlayerFromPlayerList($login)
{
Windows\PlayerList::Erase($login);
$playerLists = Windows\PlayerList::GetAll();
foreach($playerLists as $playerList)
{
$playerList->removePlayer($login);
}
Windows\PlayerList::RedrawAll();
} | php | final function removePlayerFromPlayerList($login)
{
Windows\PlayerList::Erase($login);
$playerLists = Windows\PlayerList::GetAll();
foreach($playerLists as $playerList)
{
$playerList->removePlayer($login);
}
Windows\PlayerList::RedrawAll();
} | [
"final",
"function",
"removePlayerFromPlayerList",
"(",
"$",
"login",
")",
"{",
"Windows",
"\\",
"PlayerList",
"::",
"Erase",
"(",
"$",
"login",
")",
";",
"$",
"playerLists",
"=",
"Windows",
"\\",
"PlayerList",
"::",
"GetAll",
"(",
")",
";",
"foreach",
"("... | Remove a player from the playerlist and destroy his list
@param string $login | [
"Remove",
"a",
"player",
"from",
"the",
"playerlist",
"and",
"destroy",
"his",
"list"
] | train | https://github.com/maniaplanet/matchmaking-lobby/blob/384f22cdd2cfb0204a071810549eaf1eb01d8b7f/MatchMakingLobby/GUI/AbstractGUI.php#L460-L469 |
qcubed/orm | src/Database/DatabaseBase.php | DatabaseBase.transactionCommit | public final function transactionCommit()
{
if (1 == $this->intTransactionDepth) {
$this->executeTransactionCommit();
}
if ($this->intTransactionDepth <= 0) {
throw new Caller("The transaction commit call is called before the transaction begin was called.");
}... | php | public final function transactionCommit()
{
if (1 == $this->intTransactionDepth) {
$this->executeTransactionCommit();
}
if ($this->intTransactionDepth <= 0) {
throw new Caller("The transaction commit call is called before the transaction begin was called.");
}... | [
"public",
"final",
"function",
"transactionCommit",
"(",
")",
"{",
"if",
"(",
"1",
"==",
"$",
"this",
"->",
"intTransactionDepth",
")",
"{",
"$",
"this",
"->",
"executeTransactionCommit",
"(",
")",
";",
"}",
"if",
"(",
"$",
"this",
"->",
"intTransactionDep... | This function commits the database transaction.
@throws Caller
@return void Nothing | [
"This",
"function",
"commits",
"the",
"database",
"transaction",
"."
] | train | https://github.com/qcubed/orm/blob/f320eba671f20874b1f3809c5293f8c02d5b1204/src/Database/DatabaseBase.php#L217-L226 |
qcubed/orm | src/Database/DatabaseBase.php | DatabaseBase.escapeIdentifiers | public function escapeIdentifiers($mixIdentifiers)
{
if (is_array($mixIdentifiers)) {
return array_map(array($this, 'EscapeIdentifier'), $mixIdentifiers);
} else {
return $this->escapeIdentifier($mixIdentifiers);
}
} | php | public function escapeIdentifiers($mixIdentifiers)
{
if (is_array($mixIdentifiers)) {
return array_map(array($this, 'EscapeIdentifier'), $mixIdentifiers);
} else {
return $this->escapeIdentifier($mixIdentifiers);
}
} | [
"public",
"function",
"escapeIdentifiers",
"(",
"$",
"mixIdentifiers",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"mixIdentifiers",
")",
")",
"{",
"return",
"array_map",
"(",
"array",
"(",
"$",
"this",
",",
"'EscapeIdentifier'",
")",
",",
"$",
"mixIdentifier... | Given an array of identifiers, this method returns array of escaped identifiers
For corner case handling, if a single identifier is supplied, a single escaped identifier is returned
@param array|string $mixIdentifiers Array of escaped identifiers (array) or one unescaped identifier (string)
@return array|string Array... | [
"Given",
"an",
"array",
"of",
"identifiers",
"this",
"method",
"returns",
"array",
"of",
"escaped",
"identifiers",
"For",
"corner",
"case",
"handling",
"if",
"a",
"single",
"identifier",
"is",
"supplied",
"a",
"single",
"escaped",
"identifier",
"is",
"returned"
... | train | https://github.com/qcubed/orm/blob/f320eba671f20874b1f3809c5293f8c02d5b1204/src/Database/DatabaseBase.php#L272-L279 |
qcubed/orm | src/Database/DatabaseBase.php | DatabaseBase.escapeValues | public function escapeValues($mixValues)
{
if (is_array($mixValues)) {
return array_map(array($this, 'SqlVariable'), $mixValues);
} else {
return $this->sqlVariable($mixValues);
}
} | php | public function escapeValues($mixValues)
{
if (is_array($mixValues)) {
return array_map(array($this, 'SqlVariable'), $mixValues);
} else {
return $this->sqlVariable($mixValues);
}
} | [
"public",
"function",
"escapeValues",
"(",
"$",
"mixValues",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"mixValues",
")",
")",
"{",
"return",
"array_map",
"(",
"array",
"(",
"$",
"this",
",",
"'SqlVariable'",
")",
",",
"$",
"mixValues",
")",
";",
"}",
... | Escapes values (or single value) which we can then send to the database
@param array|mixed $mixValues Array of values (or a single value) to be escaped
@return array|string Array of (or a single) escaped value(s) | [
"Escapes",
"values",
"(",
"or",
"single",
"value",
")",
"which",
"we",
"can",
"then",
"send",
"to",
"the",
"database"
] | train | https://github.com/qcubed/orm/blob/f320eba671f20874b1f3809c5293f8c02d5b1204/src/Database/DatabaseBase.php#L288-L295 |
qcubed/orm | src/Database/DatabaseBase.php | DatabaseBase.escapeIdentifiersAndValues | public function escapeIdentifiersAndValues($mixColumnsAndValuesArray)
{
$result = array();
foreach ($mixColumnsAndValuesArray as $strColumn => $mixValue) {
$result[$this->escapeIdentifier($strColumn)] = $this->sqlVariable($mixValue);
}
return $result;
} | php | public function escapeIdentifiersAndValues($mixColumnsAndValuesArray)
{
$result = array();
foreach ($mixColumnsAndValuesArray as $strColumn => $mixValue) {
$result[$this->escapeIdentifier($strColumn)] = $this->sqlVariable($mixValue);
}
return $result;
} | [
"public",
"function",
"escapeIdentifiersAndValues",
"(",
"$",
"mixColumnsAndValuesArray",
")",
"{",
"$",
"result",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"mixColumnsAndValuesArray",
"as",
"$",
"strColumn",
"=>",
"$",
"mixValue",
")",
"{",
"$",
"resu... | Escapes both column and values when supplied as an array
@param array $mixColumnsAndValuesArray Array with column=>value format with both (column and value) sides unescaped
@return array Array with column=>value format data with both column and value escaped | [
"Escapes",
"both",
"column",
"and",
"values",
"when",
"supplied",
"as",
"an",
"array"
] | train | https://github.com/qcubed/orm/blob/f320eba671f20874b1f3809c5293f8c02d5b1204/src/Database/DatabaseBase.php#L304-L311 |
qcubed/orm | src/Database/DatabaseBase.php | DatabaseBase.insertOrUpdate | public function insertOrUpdate($strTable, $mixColumnsAndValuesArray, $strPKNames = null)
{
$strEscapedArray = $this->escapeIdentifiersAndValues($mixColumnsAndValuesArray);
$strColumns = array_keys($strEscapedArray);
$strUpdateStatement = '';
foreach ($strEscapedArray as $strColumn =>... | php | public function insertOrUpdate($strTable, $mixColumnsAndValuesArray, $strPKNames = null)
{
$strEscapedArray = $this->escapeIdentifiersAndValues($mixColumnsAndValuesArray);
$strColumns = array_keys($strEscapedArray);
$strUpdateStatement = '';
foreach ($strEscapedArray as $strColumn =>... | [
"public",
"function",
"insertOrUpdate",
"(",
"$",
"strTable",
",",
"$",
"mixColumnsAndValuesArray",
",",
"$",
"strPKNames",
"=",
"null",
")",
"{",
"$",
"strEscapedArray",
"=",
"$",
"this",
"->",
"escapeIdentifiersAndValues",
"(",
"$",
"mixColumnsAndValuesArray",
"... | INSERTs or UPDATEs a table
@param string $strTable Table name
@param array $mixColumnsAndValuesArray column=>value array
(they are given to 'EscapeIdentifiersAndValues' method)
@param null|string|array $strPKNames Name(s) of primary key column(s) (expressed as string or array) | [
"INSERTs",
"or",
"UPDATEs",
"a",
"table"
] | train | https://github.com/qcubed/orm/blob/f320eba671f20874b1f3809c5293f8c02d5b1204/src/Database/DatabaseBase.php#L321-L355 |
qcubed/orm | src/Database/DatabaseBase.php | DatabaseBase.query | public final function query($strQuery)
{
$timerName = null;
if (!$this->blnConnectedFlag) {
$this->connect();
}
if ($this->blnEnableProfiling) {
$timerName = 'queryExec' . mt_rand();
Timer::start($timerName);
}
$result = $this->e... | php | public final function query($strQuery)
{
$timerName = null;
if (!$this->blnConnectedFlag) {
$this->connect();
}
if ($this->blnEnableProfiling) {
$timerName = 'queryExec' . mt_rand();
Timer::start($timerName);
}
$result = $this->e... | [
"public",
"final",
"function",
"query",
"(",
"$",
"strQuery",
")",
"{",
"$",
"timerName",
"=",
"null",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"blnConnectedFlag",
")",
"{",
"$",
"this",
"->",
"connect",
"(",
")",
";",
"}",
"if",
"(",
"$",
"this",
... | Sends the 'SELECT' query to the database and returns the result
@param string $strQuery query string
@return ResultBase | [
"Sends",
"the",
"SELECT",
"query",
"to",
"the",
"database",
"and",
"returns",
"the",
"result"
] | train | https://github.com/qcubed/orm/blob/f320eba671f20874b1f3809c5293f8c02d5b1204/src/Database/DatabaseBase.php#L364-L388 |
qcubed/orm | src/Database/DatabaseBase.php | DatabaseBase.nonQuery | public final function nonQuery($strNonQuery)
{
if (!$this->blnConnectedFlag) {
$this->connect();
}
$timerName = '';
if ($this->blnEnableProfiling) {
$timerName = 'queryExec' . mt_rand();
Timer::start($timerName);
}
$result = $this-... | php | public final function nonQuery($strNonQuery)
{
if (!$this->blnConnectedFlag) {
$this->connect();
}
$timerName = '';
if ($this->blnEnableProfiling) {
$timerName = 'queryExec' . mt_rand();
Timer::start($timerName);
}
$result = $this-... | [
"public",
"final",
"function",
"nonQuery",
"(",
"$",
"strNonQuery",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"blnConnectedFlag",
")",
"{",
"$",
"this",
"->",
"connect",
"(",
")",
";",
"}",
"$",
"timerName",
"=",
"''",
";",
"if",
"(",
"$",
"this... | This is basically the same as 'Query' but is used when SQL statements other than 'SELECT'
@param string $strNonQuery The SQL to be sent
@return mixed
@throws Caller | [
"This",
"is",
"basically",
"the",
"same",
"as",
"Query",
"but",
"is",
"used",
"when",
"SQL",
"statements",
"other",
"than",
"SELECT",
"@param",
"string",
"$strNonQuery",
"The",
"SQL",
"to",
"be",
"sent"
] | train | https://github.com/qcubed/orm/blob/f320eba671f20874b1f3809c5293f8c02d5b1204/src/Database/DatabaseBase.php#L397-L419 |
qcubed/orm | src/Database/DatabaseBase.php | DatabaseBase.logQuery | private function logQuery($strQuery, $dblQueryTime)
{
if ($this->blnEnableProfiling) {
// Dereference-ize Backtrace Information
$objDebugBacktrace = debug_backtrace();
// get rid of unnecessary backtrace info in case of:
// query
if ((count($objDe... | php | private function logQuery($strQuery, $dblQueryTime)
{
if ($this->blnEnableProfiling) {
// Dereference-ize Backtrace Information
$objDebugBacktrace = debug_backtrace();
// get rid of unnecessary backtrace info in case of:
// query
if ((count($objDe... | [
"private",
"function",
"logQuery",
"(",
"$",
"strQuery",
",",
"$",
"dblQueryTime",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"blnEnableProfiling",
")",
"{",
"// Dereference-ize Backtrace Information",
"$",
"objDebugBacktrace",
"=",
"debug_backtrace",
"(",
")",
";",
... | If EnableProfiling is on, then log the query to the profile array
@param string $strQuery
@param double $dblQueryTime query execution time in milliseconds
@return void | [
"If",
"EnableProfiling",
"is",
"on",
"then",
"log",
"the",
"query",
"to",
"the",
"profile",
"array"
] | train | https://github.com/qcubed/orm/blob/f320eba671f20874b1f3809c5293f8c02d5b1204/src/Database/DatabaseBase.php#L545-L609 |
qcubed/orm | src/Database/DatabaseBase.php | DatabaseBase.sqlVariable | public function sqlVariable($mixData, $blnIncludeEquality = false, $blnReverseEquality = false)
{
// Are we SqlVariabling a BOOLEAN value?
if (is_bool($mixData)) {
// Yes
if ($blnIncludeEquality) {
// We must include the inequality
if ($blnRev... | php | public function sqlVariable($mixData, $blnIncludeEquality = false, $blnReverseEquality = false)
{
// Are we SqlVariabling a BOOLEAN value?
if (is_bool($mixData)) {
// Yes
if ($blnIncludeEquality) {
// We must include the inequality
if ($blnRev... | [
"public",
"function",
"sqlVariable",
"(",
"$",
"mixData",
",",
"$",
"blnIncludeEquality",
"=",
"false",
",",
"$",
"blnReverseEquality",
"=",
"false",
")",
"{",
"// Are we SqlVariabling a BOOLEAN value?",
"if",
"(",
"is_bool",
"(",
"$",
"mixData",
")",
")",
"{",
... | Properly escapes $mixData to be used as a SQL query parameter.
If IncludeEquality is set (usually not), then include an equality operator.
So for most data, it would just be "=". But, for example,
if $mixData is NULL, then most RDBMS's require the use of "IS".
@param mixed $mixData
@param boolean $blnIncludeEquality ... | [
"Properly",
"escapes",
"$mixData",
"to",
"be",
"used",
"as",
"a",
"SQL",
"query",
"parameter",
".",
"If",
"IncludeEquality",
"is",
"set",
"(",
"usually",
"not",
")",
"then",
"include",
"an",
"equality",
"operator",
".",
"So",
"for",
"most",
"data",
"it",
... | train | https://github.com/qcubed/orm/blob/f320eba671f20874b1f3809c5293f8c02d5b1204/src/Database/DatabaseBase.php#L622-L723 |
qcubed/orm | src/Database/DatabaseBase.php | DatabaseBase.outputProfiling | public function outputProfiling($blnPrintOutput = true)
{
$strPath = isset($_SERVER['REQUEST_URI']) ?
$_SERVER['REQUEST_URI'] :
$_SERVER['PHP_SELF'];
$strOut = '<div class="qDbProfile">';
if ($this->blnEnableProfiling) {
$strOut .= sprintf('<form method="... | php | public function outputProfiling($blnPrintOutput = true)
{
$strPath = isset($_SERVER['REQUEST_URI']) ?
$_SERVER['REQUEST_URI'] :
$_SERVER['PHP_SELF'];
$strOut = '<div class="qDbProfile">';
if ($this->blnEnableProfiling) {
$strOut .= sprintf('<form method="... | [
"public",
"function",
"outputProfiling",
"(",
"$",
"blnPrintOutput",
"=",
"true",
")",
"{",
"$",
"strPath",
"=",
"isset",
"(",
"$",
"_SERVER",
"[",
"'REQUEST_URI'",
"]",
")",
"?",
"$",
"_SERVER",
"[",
"'REQUEST_URI'",
"]",
":",
"$",
"_SERVER",
"[",
"'PHP... | Displays the OutputProfiling results, plus a link which will popup the details of the profiling.
@param bool $blnPrintOutput
@return null|string | [
"Displays",
"the",
"OutputProfiling",
"results",
"plus",
"a",
"link",
"which",
"will",
"popup",
"the",
"details",
"of",
"the",
"profiling",
"."
] | train | https://github.com/qcubed/orm/blob/f320eba671f20874b1f3809c5293f8c02d5b1204/src/Database/DatabaseBase.php#L754-L796 |
qcubed/orm | src/Database/DatabaseBase.php | DatabaseBase.extractCommentOptions | public static function extractCommentOptions($strComment)
{
$ret[0] = null; // comment string without options
$ret[1] = null; // the options array
if (($strComment) &&
($pos1 = strpos($strComment, '{')) !== false &&
($pos2 = strrpos($strComment, '}', $pos1))
)... | php | public static function extractCommentOptions($strComment)
{
$ret[0] = null; // comment string without options
$ret[1] = null; // the options array
if (($strComment) &&
($pos1 = strpos($strComment, '{')) !== false &&
($pos2 = strrpos($strComment, '}', $pos1))
)... | [
"public",
"static",
"function",
"extractCommentOptions",
"(",
"$",
"strComment",
")",
"{",
"$",
"ret",
"[",
"0",
"]",
"=",
"null",
";",
"// comment string without options",
"$",
"ret",
"[",
"1",
"]",
"=",
"null",
";",
"// the options array",
"if",
"(",
"(",
... | Utility function to extract the json embedded options structure from the comments.
Usage:
<code>
list($strComment, $options) = Base::extractCommentOptions($strComment);
</code>
@param string $strComment The comment to analyze
@return array A two item array, with first item the comment with the options removed, and 2n... | [
"Utility",
"function",
"to",
"extract",
"the",
"json",
"embedded",
"options",
"structure",
"from",
"the",
"comments",
"."
] | train | https://github.com/qcubed/orm/blob/f320eba671f20874b1f3809c5293f8c02d5b1204/src/Database/DatabaseBase.php#L824-L846 |
lode/fem | example-project/application/routing.php | routing.get_custom_routes | protected function get_custom_routes() {
$routes = [];
// map to a file
$routes['GET']['foo'] = 'bar';
// map to a method
$accept = fem\request::get_primary_accept(); // html, json, etc.
$routes['GET']['foo'] = 'bar->'.$accept;
$routes['GET']['foo'] = 'bar::'.$accept;
// map to an inline function
$routes... | php | protected function get_custom_routes() {
$routes = [];
// map to a file
$routes['GET']['foo'] = 'bar';
// map to a method
$accept = fem\request::get_primary_accept(); // html, json, etc.
$routes['GET']['foo'] = 'bar->'.$accept;
$routes['GET']['foo'] = 'bar::'.$accept;
// map to an inline function
$routes... | [
"protected",
"function",
"get_custom_routes",
"(",
")",
"{",
"$",
"routes",
"=",
"[",
"]",
";",
"// map to a file",
"$",
"routes",
"[",
"'GET'",
"]",
"[",
"'foo'",
"]",
"=",
"'bar'",
";",
"// map to a method",
"$",
"accept",
"=",
"fem",
"\\",
"request",
... | user defined mapping url to handler
@return array with keys for each supported http method ..
.. and inside, key-value pairs of url-regex => handler
for example `$routes['GET']['foo'] = 'bar';` ..
.. maps the GET url 'foo' to the file 'bar'
the url-regex doesn't need regex boundaries like '/foo/'
@see \alsvanzelf\fe... | [
"user",
"defined",
"mapping",
"url",
"to",
"handler"
] | train | https://github.com/lode/fem/blob/c1c466c1a904d99452b341c5ae7cbc3e22b106e1/example-project/application/routing.php#L23-L39 |
ruvents/ruwork-polyfill-form-dti-bundle | DependencyInjection/Compiler/RemoveDoctrineOrmDTIGuesserPass.php | RemoveDoctrineOrmDTIGuesserPass.process | public function process(ContainerBuilder $container)
{
$id = 'ruwork_polyfill_form_dti.guesser.doctrine_orm';
if (!$container->has($id)) {
return;
}
if (!defined(Type::class.'::DATETIME_IMMUTABLE')) {
$container->removeDefinition($id);
}
if ... | php | public function process(ContainerBuilder $container)
{
$id = 'ruwork_polyfill_form_dti.guesser.doctrine_orm';
if (!$container->has($id)) {
return;
}
if (!defined(Type::class.'::DATETIME_IMMUTABLE')) {
$container->removeDefinition($id);
}
if ... | [
"public",
"function",
"process",
"(",
"ContainerBuilder",
"$",
"container",
")",
"{",
"$",
"id",
"=",
"'ruwork_polyfill_form_dti.guesser.doctrine_orm'",
";",
"if",
"(",
"!",
"$",
"container",
"->",
"has",
"(",
"$",
"id",
")",
")",
"{",
"return",
";",
"}",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/ruvents/ruwork-polyfill-form-dti-bundle/blob/3d5517d628a9982d17cb79b5991b88c6b79f5384/DependencyInjection/Compiler/RemoveDoctrineOrmDTIGuesserPass.php#L14-L29 |
nooku/nooku-installer | src/Nooku/Composer/Installer.php | Installer.getDelegate | public function getDelegate($packageType)
{
if (!isset($this->_instances[$packageType]))
{
if (isset($this->_delegates[$packageType]))
{
$classname = $this->_delegates[$packageType];
$instance = new $classname($this->io, $this->composer, 'nook... | php | public function getDelegate($packageType)
{
if (!isset($this->_instances[$packageType]))
{
if (isset($this->_delegates[$packageType]))
{
$classname = $this->_delegates[$packageType];
$instance = new $classname($this->io, $this->composer, 'nook... | [
"public",
"function",
"getDelegate",
"(",
"$",
"packageType",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"_instances",
"[",
"$",
"packageType",
"]",
")",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"_delegates",
"[",
"$",
... | Returns a specialized LibraryInstaller subclass to deal with the given package type.
@return Composer\Installer\LibraryInstaller
@throws \InvalidArgumentException | [
"Returns",
"a",
"specialized",
"LibraryInstaller",
"subclass",
"to",
"deal",
"with",
"the",
"given",
"package",
"type",
"."
] | train | https://github.com/nooku/nooku-installer/blob/2aa82ed08983bccd51905426cfff4980ba960d89/src/Nooku/Composer/Installer.php#L50-L65 |
nooku/nooku-installer | src/Nooku/Composer/Installer.php | Installer.install | public function install(InstalledRepositoryInterface $repo, PackageInterface $package)
{
$this->getDelegate($package->getType())->install($repo, $package);
} | php | public function install(InstalledRepositoryInterface $repo, PackageInterface $package)
{
$this->getDelegate($package->getType())->install($repo, $package);
} | [
"public",
"function",
"install",
"(",
"InstalledRepositoryInterface",
"$",
"repo",
",",
"PackageInterface",
"$",
"package",
")",
"{",
"$",
"this",
"->",
"getDelegate",
"(",
"$",
"package",
"->",
"getType",
"(",
")",
")",
"->",
"install",
"(",
"$",
"repo",
... | {@inheritDoc} | [
"{"
] | train | https://github.com/nooku/nooku-installer/blob/2aa82ed08983bccd51905426cfff4980ba960d89/src/Nooku/Composer/Installer.php#L78-L81 |
nooku/nooku-installer | src/Nooku/Composer/Installer.php | Installer.update | public function update(InstalledRepositoryInterface $repo, PackageInterface $initial, PackageInterface $target)
{
$this->getDelegate($initial->getType())->update($repo, $initial, $target);
} | php | public function update(InstalledRepositoryInterface $repo, PackageInterface $initial, PackageInterface $target)
{
$this->getDelegate($initial->getType())->update($repo, $initial, $target);
} | [
"public",
"function",
"update",
"(",
"InstalledRepositoryInterface",
"$",
"repo",
",",
"PackageInterface",
"$",
"initial",
",",
"PackageInterface",
"$",
"target",
")",
"{",
"$",
"this",
"->",
"getDelegate",
"(",
"$",
"initial",
"->",
"getType",
"(",
")",
")",
... | {@inheritDoc} | [
"{"
] | train | https://github.com/nooku/nooku-installer/blob/2aa82ed08983bccd51905426cfff4980ba960d89/src/Nooku/Composer/Installer.php#L86-L89 |
nooku/nooku-installer | src/Nooku/Composer/Installer.php | Installer.isInstalled | public function isInstalled(InstalledRepositoryInterface $repo, PackageInterface $package)
{
return $this->getDelegate($package->getType())->isInstalled($repo, $package);
} | php | public function isInstalled(InstalledRepositoryInterface $repo, PackageInterface $package)
{
return $this->getDelegate($package->getType())->isInstalled($repo, $package);
} | [
"public",
"function",
"isInstalled",
"(",
"InstalledRepositoryInterface",
"$",
"repo",
",",
"PackageInterface",
"$",
"package",
")",
"{",
"return",
"$",
"this",
"->",
"getDelegate",
"(",
"$",
"package",
"->",
"getType",
"(",
")",
")",
"->",
"isInstalled",
"(",... | {@inheritDoc} | [
"{"
] | train | https://github.com/nooku/nooku-installer/blob/2aa82ed08983bccd51905426cfff4980ba960d89/src/Nooku/Composer/Installer.php#L102-L105 |
gajus/brick | src/System.php | System.setDirectory | public function setDirectory ($directory) {
if (strpos($directory, '/') !== 0) {
throw new Exception\InvalidArgumentException('Directory name must be an absolute path.');
}
if (!is_dir($directory)) {
throw new Exception\LogicException('Template directory does not exist.'... | php | public function setDirectory ($directory) {
if (strpos($directory, '/') !== 0) {
throw new Exception\InvalidArgumentException('Directory name must be an absolute path.');
}
if (!is_dir($directory)) {
throw new Exception\LogicException('Template directory does not exist.'... | [
"public",
"function",
"setDirectory",
"(",
"$",
"directory",
")",
"{",
"if",
"(",
"strpos",
"(",
"$",
"directory",
",",
"'/'",
")",
"!==",
"0",
")",
"{",
"throw",
"new",
"Exception",
"\\",
"InvalidArgumentException",
"(",
"'Directory name must be an absolute pat... | Template resolution is restricted to the paths under the template directory.
@param string $directory Absolute path to the template directory. | [
"Template",
"resolution",
"is",
"restricted",
"to",
"the",
"paths",
"under",
"the",
"template",
"directory",
"."
] | train | https://github.com/gajus/brick/blob/8e1890b2993fb1e2049a3fd73ec048c95fb0a7df/src/System.php#L39-L49 |
krzysztofmazur/php-object-mapper | src/KrzysztofMazur/ObjectMapper/Mapping/MappingRepository.php | MappingRepository.getMapping | public function getMapping($sourceClass, $targetClass, $mapId = null)
{
if (!isset($this->mappings[$mapId])) {
throw MappingException::createNotSupportedMapping($sourceClass, $targetClass);
}
foreach ($this->mappings[$mapId] as $mapping) {
/** @var Mapping $mapping */... | php | public function getMapping($sourceClass, $targetClass, $mapId = null)
{
if (!isset($this->mappings[$mapId])) {
throw MappingException::createNotSupportedMapping($sourceClass, $targetClass);
}
foreach ($this->mappings[$mapId] as $mapping) {
/** @var Mapping $mapping */... | [
"public",
"function",
"getMapping",
"(",
"$",
"sourceClass",
",",
"$",
"targetClass",
",",
"$",
"mapId",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"mappings",
"[",
"$",
"mapId",
"]",
")",
")",
"{",
"throw",
"MappingExcep... | {@inheritdoc} | [
"{"
] | train | https://github.com/krzysztofmazur/php-object-mapper/blob/2c22acad9634cfe8e9a75d72e665d450ada8d4e3/src/KrzysztofMazur/ObjectMapper/Mapping/MappingRepository.php#L55-L68 |
yuncms/framework | src/helpers/RBACHelper.php | RBACHelper.getDefaultRoutes | protected static function getDefaultRoutes()
{
if (self::$_defaultRoutes === null) {
$manager = self::getAuthManager();
$roles = $manager->defaultRoles;
if ($manager->cache && ($routes = $manager->cache->get($roles)) !== false) {
self::$_defaultRoutes = $r... | php | protected static function getDefaultRoutes()
{
if (self::$_defaultRoutes === null) {
$manager = self::getAuthManager();
$roles = $manager->defaultRoles;
if ($manager->cache && ($routes = $manager->cache->get($roles)) !== false) {
self::$_defaultRoutes = $r... | [
"protected",
"static",
"function",
"getDefaultRoutes",
"(",
")",
"{",
"if",
"(",
"self",
"::",
"$",
"_defaultRoutes",
"===",
"null",
")",
"{",
"$",
"manager",
"=",
"self",
"::",
"getAuthManager",
"(",
")",
";",
"$",
"roles",
"=",
"$",
"manager",
"->",
... | Get assigned routes by default roles
@return array | [
"Get",
"assigned",
"routes",
"by",
"default",
"roles"
] | train | https://github.com/yuncms/framework/blob/af42e28ea4ae15ab8eead3f6d119f93863b94154/src/helpers/RBACHelper.php#L51-L76 |
yuncms/framework | src/helpers/RBACHelper.php | RBACHelper.getRoutesByUser | public static function getRoutesByUser($userId)
{
if (!isset(self::$_userRoutes[$userId])) {
$manager = self::getAuthManager();
if ($manager->cache && ($routes = $manager->cache->get([__METHOD__, $userId])) !== false) {
self::$_userRoutes[$userId] = $routes;
... | php | public static function getRoutesByUser($userId)
{
if (!isset(self::$_userRoutes[$userId])) {
$manager = self::getAuthManager();
if ($manager->cache && ($routes = $manager->cache->get([__METHOD__, $userId])) !== false) {
self::$_userRoutes[$userId] = $routes;
... | [
"public",
"static",
"function",
"getRoutesByUser",
"(",
"$",
"userId",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"self",
"::",
"$",
"_userRoutes",
"[",
"$",
"userId",
"]",
")",
")",
"{",
"$",
"manager",
"=",
"self",
"::",
"getAuthManager",
"(",
")",
";... | Get assigned routes of user.
@param integer $userId
@return array | [
"Get",
"assigned",
"routes",
"of",
"user",
"."
] | train | https://github.com/yuncms/framework/blob/af42e28ea4ae15ab8eead3f6d119f93863b94154/src/helpers/RBACHelper.php#L83-L105 |
yuncms/framework | src/helpers/RBACHelper.php | RBACHelper.invalidate | public static function invalidate()
{
$manager = self::getAuthManager();
if ($manager->cache !== null) {
TagDependency::invalidate($manager->cache, $manager->cacheTag);
}
} | php | public static function invalidate()
{
$manager = self::getAuthManager();
if ($manager->cache !== null) {
TagDependency::invalidate($manager->cache, $manager->cacheTag);
}
} | [
"public",
"static",
"function",
"invalidate",
"(",
")",
"{",
"$",
"manager",
"=",
"self",
"::",
"getAuthManager",
"(",
")",
";",
"if",
"(",
"$",
"manager",
"->",
"cache",
"!==",
"null",
")",
"{",
"TagDependency",
"::",
"invalidate",
"(",
"$",
"manager",
... | Use to invalidate cache. | [
"Use",
"to",
"invalidate",
"cache",
"."
] | train | https://github.com/yuncms/framework/blob/af42e28ea4ae15ab8eead3f6d119f93863b94154/src/helpers/RBACHelper.php#L241-L247 |
parsnick/steak | src/Console/Command.php | Command.setIo | protected function setIo(InputInterface $input, OutputInterface $output)
{
$this->input = $input;
$this->output = $output;
return $this;
} | php | protected function setIo(InputInterface $input, OutputInterface $output)
{
$this->input = $input;
$this->output = $output;
return $this;
} | [
"protected",
"function",
"setIo",
"(",
"InputInterface",
"$",
"input",
",",
"OutputInterface",
"$",
"output",
")",
"{",
"$",
"this",
"->",
"input",
"=",
"$",
"input",
";",
"$",
"this",
"->",
"output",
"=",
"$",
"output",
";",
"return",
"$",
"this",
";"... | Attach IO to command for easier access between methods.
@param InputInterface $input
@param OutputInterface $output
@return $this | [
"Attach",
"IO",
"to",
"command",
"for",
"easier",
"access",
"between",
"methods",
"."
] | train | https://github.com/parsnick/steak/blob/461869189a640938438187330f6c50aca97c5ccc/src/Console/Command.php#L55-L61 |
parsnick/steak | src/Console/Command.php | Command.createGulpProcess | protected function createGulpProcess($task, array $options = [])
{
$config = $this->container['config'];
return ProcessBuilder::create(array_flatten([
$config['gulp.bin'],
$task,
$options,
'--source', $config['source.directory'],
'--dest',... | php | protected function createGulpProcess($task, array $options = [])
{
$config = $this->container['config'];
return ProcessBuilder::create(array_flatten([
$config['gulp.bin'],
$task,
$options,
'--source', $config['source.directory'],
'--dest',... | [
"protected",
"function",
"createGulpProcess",
"(",
"$",
"task",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"config",
"=",
"$",
"this",
"->",
"container",
"[",
"'config'",
"]",
";",
"return",
"ProcessBuilder",
"::",
"create",
"(",
"array_... | Create a process builder for the given gulp task.
@param string $task
@param array $options
@return Process | [
"Create",
"a",
"process",
"builder",
"for",
"the",
"given",
"gulp",
"task",
"."
] | train | https://github.com/parsnick/steak/blob/461869189a640938438187330f6c50aca97c5ccc/src/Console/Command.php#L70-L85 |
parsnick/steak | src/Console/Command.php | Command.runTimedTask | protected function runTimedTask(Closure $task)
{
$timer = new Stopwatch();
$timer->start('subtask');
$task();
return $timer->stop('subtask')->getDuration();
} | php | protected function runTimedTask(Closure $task)
{
$timer = new Stopwatch();
$timer->start('subtask');
$task();
return $timer->stop('subtask')->getDuration();
} | [
"protected",
"function",
"runTimedTask",
"(",
"Closure",
"$",
"task",
")",
"{",
"$",
"timer",
"=",
"new",
"Stopwatch",
"(",
")",
";",
"$",
"timer",
"->",
"start",
"(",
"'subtask'",
")",
";",
"$",
"task",
"(",
")",
";",
"return",
"$",
"timer",
"->",
... | Get the ms duration of the time taken for $task to execute.
@param Closure $task
@return int | [
"Get",
"the",
"ms",
"duration",
"of",
"the",
"time",
"taken",
"for",
"$task",
"to",
"execute",
"."
] | train | https://github.com/parsnick/steak/blob/461869189a640938438187330f6c50aca97c5ccc/src/Console/Command.php#L109-L117 |
steeffeen/FancyManiaLinks | FML/Script/Features/ScriptFeature.php | ScriptFeature.collect | public static function collect()
{
$params = func_get_args();
$scriptFeatures = array();
foreach ($params as $object) {
if ($object instanceof ScriptFeature) {
$scriptFeatures = static::addScriptFeature($scriptFeatures, $object);
} else if ($ob... | php | public static function collect()
{
$params = func_get_args();
$scriptFeatures = array();
foreach ($params as $object) {
if ($object instanceof ScriptFeature) {
$scriptFeatures = static::addScriptFeature($scriptFeatures, $object);
} else if ($ob... | [
"public",
"static",
"function",
"collect",
"(",
")",
"{",
"$",
"params",
"=",
"func_get_args",
"(",
")",
";",
"$",
"scriptFeatures",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"params",
"as",
"$",
"object",
")",
"{",
"if",
"(",
"$",
"object",
... | Collect the Script Features of the given objects
@return ScriptFeature[] | [
"Collect",
"the",
"Script",
"Features",
"of",
"the",
"given",
"objects"
] | train | https://github.com/steeffeen/FancyManiaLinks/blob/227b0759306f0a3c75873ba50276e4163a93bfa6/FML/Script/Features/ScriptFeature.php#L23-L39 |
steeffeen/FancyManiaLinks | FML/Script/Features/ScriptFeature.php | ScriptFeature.addScriptFeature | public static function addScriptFeature(array $scriptFeatures, $newScriptFeatures)
{
if (!$newScriptFeatures) {
return $scriptFeatures;
}
if ($newScriptFeatures instanceof ScriptFeature) {
if (!in_array($newScriptFeatures, $scriptFeatures, true)) {
arr... | php | public static function addScriptFeature(array $scriptFeatures, $newScriptFeatures)
{
if (!$newScriptFeatures) {
return $scriptFeatures;
}
if ($newScriptFeatures instanceof ScriptFeature) {
if (!in_array($newScriptFeatures, $scriptFeatures, true)) {
arr... | [
"public",
"static",
"function",
"addScriptFeature",
"(",
"array",
"$",
"scriptFeatures",
",",
"$",
"newScriptFeatures",
")",
"{",
"if",
"(",
"!",
"$",
"newScriptFeatures",
")",
"{",
"return",
"$",
"scriptFeatures",
";",
"}",
"if",
"(",
"$",
"newScriptFeatures"... | Add one or more Script Features to an Array of Features if they are not already contained
@param array $scriptFeatures
@param ScriptFeature||ScriptFeature[] $newScriptFeatures
@return array | [
"Add",
"one",
"or",
"more",
"Script",
"Features",
"to",
"an",
"Array",
"of",
"Features",
"if",
"they",
"are",
"not",
"already",
"contained"
] | train | https://github.com/steeffeen/FancyManiaLinks/blob/227b0759306f0a3c75873ba50276e4163a93bfa6/FML/Script/Features/ScriptFeature.php#L48-L63 |
nyeholt/silverstripe-external-content | thirdparty/Zend/Validate/File/Size.php | Zend_Validate_File_Size.isValid | public function isValid($value, $file = null)
{
// Is file readable ?
require_once 'Zend/Loader.php';
if (!Zend_Loader::isReadable($value)) {
return $this->_throw($file, self::NOT_FOUND);
}
// limited to 4GB files
$size = sprintf("%u", @filesize($value));... | php | public function isValid($value, $file = null)
{
// Is file readable ?
require_once 'Zend/Loader.php';
if (!Zend_Loader::isReadable($value)) {
return $this->_throw($file, self::NOT_FOUND);
}
// limited to 4GB files
$size = sprintf("%u", @filesize($value));... | [
"public",
"function",
"isValid",
"(",
"$",
"value",
",",
"$",
"file",
"=",
"null",
")",
"{",
"// Is file readable ?",
"require_once",
"'Zend/Loader.php'",
";",
"if",
"(",
"!",
"Zend_Loader",
"::",
"isReadable",
"(",
"$",
"value",
")",
")",
"{",
"return",
"... | Defined by Zend_Validate_Interface
Returns true if and only if the filesize of $value is at least min and
not bigger than max (when max is not null).
@param string $value Real file to check for size
@param array $file File data from Zend_File_Transfer
@return boolean | [
"Defined",
"by",
"Zend_Validate_Interface"
] | train | https://github.com/nyeholt/silverstripe-external-content/blob/1c6da8c56ef717225ff904e1522aff94ed051601/thirdparty/Zend/Validate/File/Size.php#L275-L319 |
chubbyphp/chubbyphp-api-http | src/Manager/RequestManager.php | RequestManager.getDataFromRequestQuery | public function getDataFromRequestQuery(
ServerRequestInterface $request,
$object,
DenormalizerContextInterface $context = null
) {
return $this->deserializer->denormalize($object, $request->getQueryParams(), $context);
} | php | public function getDataFromRequestQuery(
ServerRequestInterface $request,
$object,
DenormalizerContextInterface $context = null
) {
return $this->deserializer->denormalize($object, $request->getQueryParams(), $context);
} | [
"public",
"function",
"getDataFromRequestQuery",
"(",
"ServerRequestInterface",
"$",
"request",
",",
"$",
"object",
",",
"DenormalizerContextInterface",
"$",
"context",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"deserializer",
"->",
"denormalize",
"(",
"... | @param ServerRequestInterface $request
@param object|string $object
@param DenormalizerContextInterface|null $context
@return object | [
"@param",
"ServerRequestInterface",
"$request",
"@param",
"object|string",
"$object",
"@param",
"DenormalizerContextInterface|null",
"$context"
] | train | https://github.com/chubbyphp/chubbyphp-api-http/blob/675d657b686e96aa16be56d0e9e07aaa844266ed/src/Manager/RequestManager.php#L33-L39 |
chubbyphp/chubbyphp-api-http | src/Manager/RequestManager.php | RequestManager.getDataFromRequestBody | public function getDataFromRequestBody(
ServerRequestInterface $request,
$object,
string $contentType,
DenormalizerContextInterface $context = null
) {
return $this->deserializer->deserialize($object, (string) $request->getBody(), $contentType, $context);
} | php | public function getDataFromRequestBody(
ServerRequestInterface $request,
$object,
string $contentType,
DenormalizerContextInterface $context = null
) {
return $this->deserializer->deserialize($object, (string) $request->getBody(), $contentType, $context);
} | [
"public",
"function",
"getDataFromRequestBody",
"(",
"ServerRequestInterface",
"$",
"request",
",",
"$",
"object",
",",
"string",
"$",
"contentType",
",",
"DenormalizerContextInterface",
"$",
"context",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"deserial... | @param ServerRequestInterface $request
@param object|string $object
@param string $contentType
@param DenormalizerContextInterface|null $context
@return object | [
"@param",
"ServerRequestInterface",
"$request",
"@param",
"object|string",
"$object",
"@param",
"string",
"$contentType",
"@param",
"DenormalizerContextInterface|null",
"$context"
] | train | https://github.com/chubbyphp/chubbyphp-api-http/blob/675d657b686e96aa16be56d0e9e07aaa844266ed/src/Manager/RequestManager.php#L49-L56 |
nyeholt/silverstripe-external-content | code/ECUtils.php | ECUtils.dbQuote | function dbQuote($filter = array(), $join = " AND ") {
$QUOTE_CHAR = defined('DB::USE_ANSI_SQL') ? '"' : '';
$string = '';
$sep = '';
foreach ($filter as $field => $value) {
// first break the field up into its two components
$operator = '';
if (is_string($field)) {
list($field, $operator) = expl... | php | function dbQuote($filter = array(), $join = " AND ") {
$QUOTE_CHAR = defined('DB::USE_ANSI_SQL') ? '"' : '';
$string = '';
$sep = '';
foreach ($filter as $field => $value) {
// first break the field up into its two components
$operator = '';
if (is_string($field)) {
list($field, $operator) = expl... | [
"function",
"dbQuote",
"(",
"$",
"filter",
"=",
"array",
"(",
")",
",",
"$",
"join",
"=",
"\" AND \"",
")",
"{",
"$",
"QUOTE_CHAR",
"=",
"defined",
"(",
"'DB::USE_ANSI_SQL'",
")",
"?",
"'\"'",
":",
"''",
";",
"$",
"string",
"=",
"''",
";",
"$",
"se... | Quote up a filter of the form
array ("ParentID =" => 1)
@param unknown_type $filter
@return unknown_type | [
"Quote",
"up",
"a",
"filter",
"of",
"the",
"form"
] | train | https://github.com/nyeholt/silverstripe-external-content/blob/1c6da8c56ef717225ff904e1522aff94ed051601/code/ECUtils.php#L21-L51 |
phossa2/config | src/Config/Config.php | Config.get | public function get(/*# string */ $id, $default = null)
{
if ($this->has($id)) {
// cached from has()
$val = $this->cached_value;
// dereference
$this->deReferenceArray($val);
return null === $val ? $default : $val;
}
return $defa... | php | public function get(/*# string */ $id, $default = null)
{
if ($this->has($id)) {
// cached from has()
$val = $this->cached_value;
// dereference
$this->deReferenceArray($val);
return null === $val ? $default : $val;
}
return $defa... | [
"public",
"function",
"get",
"(",
"/*# string */",
"$",
"id",
",",
"$",
"default",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"has",
"(",
"$",
"id",
")",
")",
"{",
"// cached from has()",
"$",
"val",
"=",
"$",
"this",
"->",
"cached_value",
... | {@inheritDoc} | [
"{"
] | train | https://github.com/phossa2/config/blob/7c046fd2c97633b69545b4745d8bffe28e19b1df/src/Config/Config.php#L128-L140 |
phossa2/config | src/Config/Config.php | Config.has | public function has(/*# string */ $id)/*# : bool */
{
// checked already
if ($id === $this->cached_id) {
return null !== $this->cached_value;
}
// default result
$this->cached_id = $id;
$this->cached_value = null;
// try get config
try {
... | php | public function has(/*# string */ $id)/*# : bool */
{
// checked already
if ($id === $this->cached_id) {
return null !== $this->cached_value;
}
// default result
$this->cached_id = $id;
$this->cached_value = null;
// try get config
try {
... | [
"public",
"function",
"has",
"(",
"/*# string */",
"$",
"id",
")",
"/*# : bool */",
"{",
"// checked already",
"if",
"(",
"$",
"id",
"===",
"$",
"this",
"->",
"cached_id",
")",
"{",
"return",
"null",
"!==",
"$",
"this",
"->",
"cached_value",
";",
"}",
"/... | {@inheritDoc} | [
"{"
] | train | https://github.com/phossa2/config/blob/7c046fd2c97633b69545b4745d8bffe28e19b1df/src/Config/Config.php#L145-L165 |
phossa2/config | src/Config/Config.php | Config.set | public function set(/*# string */ $id, $value)/*# : bool */
{
if ($this->isWritable()) {
// lazy load, no dereference
$this->loadConfig((string) $id);
// replace the node
$this->cached_id = null;
$this->config->addNode($id, $value);
r... | php | public function set(/*# string */ $id, $value)/*# : bool */
{
if ($this->isWritable()) {
// lazy load, no dereference
$this->loadConfig((string) $id);
// replace the node
$this->cached_id = null;
$this->config->addNode($id, $value);
r... | [
"public",
"function",
"set",
"(",
"/*# string */",
"$",
"id",
",",
"$",
"value",
")",
"/*# : bool */",
"{",
"if",
"(",
"$",
"this",
"->",
"isWritable",
"(",
")",
")",
"{",
"// lazy load, no dereference",
"$",
"this",
"->",
"loadConfig",
"(",
"(",
"string",... | {@inheritDoc} | [
"{"
] | train | https://github.com/phossa2/config/blob/7c046fd2c97633b69545b4745d8bffe28e19b1df/src/Config/Config.php#L170-L187 |
phossa2/config | src/Config/Config.php | Config.loadConfig | protected function loadConfig(/*# string */ $id)
{
// get group name
$group = $this->getGroupName($id);
// $group loaded ?
if (isset($this->loaded[$group])) {
return $this;
}
// mark as loaded
$this->loaded[$group] = true;
// loading the... | php | protected function loadConfig(/*# string */ $id)
{
// get group name
$group = $this->getGroupName($id);
// $group loaded ?
if (isset($this->loaded[$group])) {
return $this;
}
// mark as loaded
$this->loaded[$group] = true;
// loading the... | [
"protected",
"function",
"loadConfig",
"(",
"/*# string */",
"$",
"id",
")",
"{",
"// get group name",
"$",
"group",
"=",
"$",
"this",
"->",
"getGroupName",
"(",
"$",
"id",
")",
";",
"// $group loaded ?",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"loaded... | Load config
@param string $id
@return $this
@throws LogicException if current $error_type is to throw exception
@access protected | [
"Load",
"config"
] | train | https://github.com/phossa2/config/blob/7c046fd2c97633b69545b4745d8bffe28e19b1df/src/Config/Config.php#L211-L226 |
phossa2/config | src/Config/Config.php | Config.loadByGroup | protected function loadByGroup(/*# string */ $group)
{
// load super global
if ('' !== $group && '_' === $group[0]) {
return $this->loadGlobal($group);
}
// load from config
$conf = $this->loader->load($group);
foreach ($conf as $grp => $data) {
... | php | protected function loadByGroup(/*# string */ $group)
{
// load super global
if ('' !== $group && '_' === $group[0]) {
return $this->loadGlobal($group);
}
// load from config
$conf = $this->loader->load($group);
foreach ($conf as $grp => $data) {
... | [
"protected",
"function",
"loadByGroup",
"(",
"/*# string */",
"$",
"group",
")",
"{",
"// load super global",
"if",
"(",
"''",
"!==",
"$",
"group",
"&&",
"'_'",
"===",
"$",
"group",
"[",
"0",
"]",
")",
"{",
"return",
"$",
"this",
"->",
"loadGlobal",
"(",... | Load one group config, force loading all groups if $group == ''
@param string $group
@return $this
@throws \Exception group loading issues
@access protected | [
"Load",
"one",
"group",
"config",
"force",
"loading",
"all",
"groups",
"if",
"$group",
"=="
] | train | https://github.com/phossa2/config/blob/7c046fd2c97633b69545b4745d8bffe28e19b1df/src/Config/Config.php#L236-L251 |
phossa2/config | src/Config/Config.php | Config.loadGlobal | protected function loadGlobal(/*# string */ $group)
{
if (!isset($GLOBALS[$group])) {
$this->throwError(
Message::get(Message::CONFIG_GLOBAL_UNKNOWN, $group),
Message::CONFIG_GLOBAL_UNKNOWN
);
}
// load super global
$this->conf... | php | protected function loadGlobal(/*# string */ $group)
{
if (!isset($GLOBALS[$group])) {
$this->throwError(
Message::get(Message::CONFIG_GLOBAL_UNKNOWN, $group),
Message::CONFIG_GLOBAL_UNKNOWN
);
}
// load super global
$this->conf... | [
"protected",
"function",
"loadGlobal",
"(",
"/*# string */",
"$",
"group",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"GLOBALS",
"[",
"$",
"group",
"]",
")",
")",
"{",
"$",
"this",
"->",
"throwError",
"(",
"Message",
"::",
"get",
"(",
"Message",
":... | Load super globals
@param string $group
@return $this
@throws LogicException if super global unknown
@access protected | [
"Load",
"super",
"globals"
] | train | https://github.com/phossa2/config/blob/7c046fd2c97633b69545b4745d8bffe28e19b1df/src/Config/Config.php#L261-L274 |
phossa2/config | src/Config/Config.php | Config.getGroupName | protected function getGroupName(/*# string */ $id)/*# : string */
{
return explode(
$this->config->getDelimiter(),
ltrim($id, $this->config->getDelimiter())
)[0];
} | php | protected function getGroupName(/*# string */ $id)/*# : string */
{
return explode(
$this->config->getDelimiter(),
ltrim($id, $this->config->getDelimiter())
)[0];
} | [
"protected",
"function",
"getGroupName",
"(",
"/*# string */",
"$",
"id",
")",
"/*# : string */",
"{",
"return",
"explode",
"(",
"$",
"this",
"->",
"config",
"->",
"getDelimiter",
"(",
")",
",",
"ltrim",
"(",
"$",
"id",
",",
"$",
"this",
"->",
"config",
... | Get group name
- returns 'system' from $id 'system.dir.tmp'
- '.system.tmpdir' is invalid
@param string $id
@return string
@access protected | [
"Get",
"group",
"name"
] | train | https://github.com/phossa2/config/blob/7c046fd2c97633b69545b4745d8bffe28e19b1df/src/Config/Config.php#L286-L292 |
phossa2/config | src/Config/Config.php | Config.referenceLookup | protected function referenceLookup(/*# string */ $name)
{
if ($this->hasDelegator()) {
// get delegator recursively
$delegator = $this->getDelegator(true);
$val = $delegator->get($name);
} else {
$val = $this->getReference($name);
}
ret... | php | protected function referenceLookup(/*# string */ $name)
{
if ($this->hasDelegator()) {
// get delegator recursively
$delegator = $this->getDelegator(true);
$val = $delegator->get($name);
} else {
$val = $this->getReference($name);
}
ret... | [
"protected",
"function",
"referenceLookup",
"(",
"/*# string */",
"$",
"name",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"hasDelegator",
"(",
")",
")",
"{",
"// get delegator recursively",
"$",
"delegator",
"=",
"$",
"this",
"->",
"getDelegator",
"(",
"true",
... | Override 'referenceLookup()' in ReferenceTrait.
Delegator support goes here
@since 2.0.10 using recursive getDelegator
{@inheritDoc} | [
"Override",
"referenceLookup",
"()",
"in",
"ReferenceTrait",
"."
] | train | https://github.com/phossa2/config/blob/7c046fd2c97633b69545b4745d8bffe28e19b1df/src/Config/Config.php#L302-L312 |
phossa2/config | src/Config/Config.php | Config.resolveUnknown | protected function resolveUnknown(/*# string */ $name)
{
// warn if reference unknown
$this->throwError(
Message::get(Message::CONFIG_REFERENCE_UNKNOWN, $name),
Message::CONFIG_REFERENCE_UNKNOWN
);
return null;
} | php | protected function resolveUnknown(/*# string */ $name)
{
// warn if reference unknown
$this->throwError(
Message::get(Message::CONFIG_REFERENCE_UNKNOWN, $name),
Message::CONFIG_REFERENCE_UNKNOWN
);
return null;
} | [
"protected",
"function",
"resolveUnknown",
"(",
"/*# string */",
"$",
"name",
")",
"{",
"// warn if reference unknown",
"$",
"this",
"->",
"throwError",
"(",
"Message",
"::",
"get",
"(",
"Message",
"::",
"CONFIG_REFERENCE_UNKNOWN",
",",
"$",
"name",
")",
",",
"M... | throw exception if current $error_type is to throw exception
{@inheritDoc} | [
"throw",
"exception",
"if",
"current",
"$error_type",
"is",
"to",
"throw",
"exception"
] | train | https://github.com/phossa2/config/blob/7c046fd2c97633b69545b4745d8bffe28e19b1df/src/Config/Config.php#L319-L328 |
phossa2/config | src/Config/Config.php | Config.throwError | protected function throwError(/*# string */ $message, /*# int */ $code)
{
switch ($this->error_type) {
case self::ERROR_WARNING:
trigger_error($message, \E_USER_WARNING);
break;
case self::ERROR_EXCEPTION:
throw new LogicException($mess... | php | protected function throwError(/*# string */ $message, /*# int */ $code)
{
switch ($this->error_type) {
case self::ERROR_WARNING:
trigger_error($message, \E_USER_WARNING);
break;
case self::ERROR_EXCEPTION:
throw new LogicException($mess... | [
"protected",
"function",
"throwError",
"(",
"/*# string */",
"$",
"message",
",",
"/*# int */",
"$",
"code",
")",
"{",
"switch",
"(",
"$",
"this",
"->",
"error_type",
")",
"{",
"case",
"self",
"::",
"ERROR_WARNING",
":",
"trigger_error",
"(",
"$",
"message",... | Dealing errors
@param string $message
@param int $code
@return $this
@throws LogicException if current $error_type is to throw exception
@access protected | [
"Dealing",
"errors"
] | train | https://github.com/phossa2/config/blob/7c046fd2c97633b69545b4745d8bffe28e19b1df/src/Config/Config.php#L347-L359 |
fond-of/spryker-brand | src/FondOfSpryker/Zed/Brand/Business/Brand/BrandReader.php | BrandReader.getBrandCollection | public function getBrandCollection(BrandCollectionTransfer $brandCollectionTransfer): BrandCollectionTransfer
{
$brandCollectionTransfer = $this->brandRepository->getBrandCollection($brandCollectionTransfer);
if (!empty($brandCollectionTransfer->getBrands())) {
foreach ($brandCollection... | php | public function getBrandCollection(BrandCollectionTransfer $brandCollectionTransfer): BrandCollectionTransfer
{
$brandCollectionTransfer = $this->brandRepository->getBrandCollection($brandCollectionTransfer);
if (!empty($brandCollectionTransfer->getBrands())) {
foreach ($brandCollection... | [
"public",
"function",
"getBrandCollection",
"(",
"BrandCollectionTransfer",
"$",
"brandCollectionTransfer",
")",
":",
"BrandCollectionTransfer",
"{",
"$",
"brandCollectionTransfer",
"=",
"$",
"this",
"->",
"brandRepository",
"->",
"getBrandCollection",
"(",
"$",
"brandCol... | @param \Generated\Shared\Transfer\BrandCollectionTransfer $brandCollectionTransfer
@return \Generated\Shared\Transfer\BrandCollectionTransfer | [
"@param",
"\\",
"Generated",
"\\",
"Shared",
"\\",
"Transfer",
"\\",
"BrandCollectionTransfer",
"$brandCollectionTransfer"
] | train | https://github.com/fond-of/spryker-brand/blob/0ae25c381649b70845016606de9cf4e7dfdccffa/src/FondOfSpryker/Zed/Brand/Business/Brand/BrandReader.php#L47-L58 |
ARCANEDEV/Sanitizer | src/Factory.php | Factory.extend | public function extend($name, $filter)
{
$this->checkName($name);
if ( ! $filter instanceof Closure) {
$this->isFilterable($filter);
}
$this->filters[$name] = $filter;
} | php | public function extend($name, $filter)
{
$this->checkName($name);
if ( ! $filter instanceof Closure) {
$this->isFilterable($filter);
}
$this->filters[$name] = $filter;
} | [
"public",
"function",
"extend",
"(",
"$",
"name",
",",
"$",
"filter",
")",
"{",
"$",
"this",
"->",
"checkName",
"(",
"$",
"name",
")",
";",
"if",
"(",
"!",
"$",
"filter",
"instanceof",
"Closure",
")",
"{",
"$",
"this",
"->",
"isFilterable",
"(",
"$... | Add a custom filters to all Sanitizers created with this Factory.
@param string $name
@param \Closure|Filterable|string $filter
@throws \Arcanedev\Sanitizer\Exceptions\InvalidFilterException | [
"Add",
"a",
"custom",
"filters",
"to",
"all",
"Sanitizers",
"created",
"with",
"this",
"Factory",
"."
] | train | https://github.com/ARCANEDEV/Sanitizer/blob/e21990ce6d881366d52a7f4e5040b07cc3ecca96/src/Factory.php#L64-L73 |
ARCANEDEV/Sanitizer | src/Factory.php | Factory.isFilterable | private function isFilterable($filter)
{
if (is_string($filter) && ! class_exists($filter)) {
throw new Exceptions\InvalidFilterException(
"The [$filter] class does not exits."
);
}
if ( ! in_array(Filterable::class, class_implements($filter))) {
... | php | private function isFilterable($filter)
{
if (is_string($filter) && ! class_exists($filter)) {
throw new Exceptions\InvalidFilterException(
"The [$filter] class does not exits."
);
}
if ( ! in_array(Filterable::class, class_implements($filter))) {
... | [
"private",
"function",
"isFilterable",
"(",
"$",
"filter",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"filter",
")",
"&&",
"!",
"class_exists",
"(",
"$",
"filter",
")",
")",
"{",
"throw",
"new",
"Exceptions",
"\\",
"InvalidFilterException",
"(",
"\"The [$... | Check if filter is filterable.
@param mixed $filter
@throws \Arcanedev\Sanitizer\Exceptions\InvalidFilterException | [
"Check",
"if",
"filter",
"is",
"filterable",
"."
] | train | https://github.com/ARCANEDEV/Sanitizer/blob/e21990ce6d881366d52a7f4e5040b07cc3ecca96/src/Factory.php#L102-L115 |
aryelgois/yasql-php | src/Builder.php | Builder.build | public function build(string $config, array $vendors = null)
{
$config_path = realpath($config);
if ($config !== '' && $config_path !== false) {
$config_path = realpath($config);
if (in_array($config_path, $this->track)) {
$this->log .= "Skiping repeated confi... | php | public function build(string $config, array $vendors = null)
{
$config_path = realpath($config);
if ($config !== '' && $config_path !== false) {
$config_path = realpath($config);
if (in_array($config_path, $this->track)) {
$this->log .= "Skiping repeated confi... | [
"public",
"function",
"build",
"(",
"string",
"$",
"config",
",",
"array",
"$",
"vendors",
"=",
"null",
")",
"{",
"$",
"config_path",
"=",
"realpath",
"(",
"$",
"config",
")",
";",
"if",
"(",
"$",
"config",
"!==",
"''",
"&&",
"$",
"config_path",
"!==... | Builds databases in a config file
@param string $config Path to YAML with build configurations
@param array $vendors List of additional vendors to include
(using the default config file location) | [
"Builds",
"databases",
"in",
"a",
"config",
"file"
] | train | https://github.com/aryelgois/yasql-php/blob/f428b180d35bfc1ddf1f9b3323f9b085fbc09ac7/src/Builder.php#L86-L184 |
fubhy/graphql-php | src/Language/Parser.php | Parser.parse | public function parse(Source $source)
{
$this->source = $source;
$this->lexer = new Lexer($source);
$this->token = $this->lexer->readToken(0);
$this->cursor = 0;
return $this->parseDocument();
} | php | public function parse(Source $source)
{
$this->source = $source;
$this->lexer = new Lexer($source);
$this->token = $this->lexer->readToken(0);
$this->cursor = 0;
return $this->parseDocument();
} | [
"public",
"function",
"parse",
"(",
"Source",
"$",
"source",
")",
"{",
"$",
"this",
"->",
"source",
"=",
"$",
"source",
";",
"$",
"this",
"->",
"lexer",
"=",
"new",
"Lexer",
"(",
"$",
"source",
")",
";",
"$",
"this",
"->",
"token",
"=",
"$",
"thi... | @param \Fubhy\GraphQL\Language\Source $source
@return \Fubhy\GraphQL\Language\Node\Document | [
"@param",
"\\",
"Fubhy",
"\\",
"GraphQL",
"\\",
"Language",
"\\",
"Source",
"$source"
] | train | https://github.com/fubhy/graphql-php/blob/c1de2233c731ca29e5c5db4c43f3b9db36478c83/src/Language/Parser.php#L74-L82 |
fubhy/graphql-php | src/Language/Parser.php | Parser.location | protected function location($start)
{
if (!empty($this->options['noLocation'])) {
return NULL;
}
if (!empty($this->options['noSource'])) {
return new Location($start, $this->cursor);
}
return new Location($start, $this->cursor, $this->source);
} | php | protected function location($start)
{
if (!empty($this->options['noLocation'])) {
return NULL;
}
if (!empty($this->options['noSource'])) {
return new Location($start, $this->cursor);
}
return new Location($start, $this->cursor, $this->source);
} | [
"protected",
"function",
"location",
"(",
"$",
"start",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"options",
"[",
"'noLocation'",
"]",
")",
")",
"{",
"return",
"NULL",
";",
"}",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"o... | Returns a location object, used to identify the place in the source that
created a given parsed object.
@param int $start
@return \Fubhy\GraphQL\Language\Location|null | [
"Returns",
"a",
"location",
"object",
"used",
"to",
"identify",
"the",
"place",
"in",
"the",
"source",
"that",
"created",
"a",
"given",
"parsed",
"object",
"."
] | train | https://github.com/fubhy/graphql-php/blob/c1de2233c731ca29e5c5db4c43f3b9db36478c83/src/Language/Parser.php#L92-L103 |
fubhy/graphql-php | src/Language/Parser.php | Parser.advance | protected function advance()
{
$this->cursor = $this->token->getEnd();
return $this->token = $this->lexer->readToken($this->cursor);
} | php | protected function advance()
{
$this->cursor = $this->token->getEnd();
return $this->token = $this->lexer->readToken($this->cursor);
} | [
"protected",
"function",
"advance",
"(",
")",
"{",
"$",
"this",
"->",
"cursor",
"=",
"$",
"this",
"->",
"token",
"->",
"getEnd",
"(",
")",
";",
"return",
"$",
"this",
"->",
"token",
"=",
"$",
"this",
"->",
"lexer",
"->",
"readToken",
"(",
"$",
"thi... | Moves the internal parser object to the next lexed token. | [
"Moves",
"the",
"internal",
"parser",
"object",
"to",
"the",
"next",
"lexed",
"token",
"."
] | train | https://github.com/fubhy/graphql-php/blob/c1de2233c731ca29e5c5db4c43f3b9db36478c83/src/Language/Parser.php#L109-L113 |
fubhy/graphql-php | src/Language/Parser.php | Parser.skip | protected function skip($type)
{
if ($match = ($this->token->getType() === $type)) {
$this->advance();
}
return $match;
} | php | protected function skip($type)
{
if ($match = ($this->token->getType() === $type)) {
$this->advance();
}
return $match;
} | [
"protected",
"function",
"skip",
"(",
"$",
"type",
")",
"{",
"if",
"(",
"$",
"match",
"=",
"(",
"$",
"this",
"->",
"token",
"->",
"getType",
"(",
")",
"===",
"$",
"type",
")",
")",
"{",
"$",
"this",
"->",
"advance",
"(",
")",
";",
"}",
"return"... | If the next token is of the given kind, return true after advancing the
parser. Otherwise, do not change the parser state and return false.
@param int $type
@return bool | [
"If",
"the",
"next",
"token",
"is",
"of",
"the",
"given",
"kind",
"return",
"true",
"after",
"advancing",
"the",
"parser",
".",
"Otherwise",
"do",
"not",
"change",
"the",
"parser",
"state",
"and",
"return",
"false",
"."
] | train | https://github.com/fubhy/graphql-php/blob/c1de2233c731ca29e5c5db4c43f3b9db36478c83/src/Language/Parser.php#L135-L142 |
fubhy/graphql-php | src/Language/Parser.php | Parser.expect | protected function expect($type)
{
if ($this->token->getType() !== $type) {
throw new \Exception(sprintf('Expected %s, found %s', Token::typeToString($type), (string) $this->token));
}
$token = $this->token;
$this->advance();
return $token;
} | php | protected function expect($type)
{
if ($this->token->getType() !== $type) {
throw new \Exception(sprintf('Expected %s, found %s', Token::typeToString($type), (string) $this->token));
}
$token = $this->token;
$this->advance();
return $token;
} | [
"protected",
"function",
"expect",
"(",
"$",
"type",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"token",
"->",
"getType",
"(",
")",
"!==",
"$",
"type",
")",
"{",
"throw",
"new",
"\\",
"Exception",
"(",
"sprintf",
"(",
"'Expected %s, found %s'",
",",
"Toke... | If the next token is of the given kind, return that token after advancing
the parser. Otherwise, do not change the parser state and return false.
@param int $type
@return \Fubhy\GraphQL\Language\Token
@throws \Exception | [
"If",
"the",
"next",
"token",
"is",
"of",
"the",
"given",
"kind",
"return",
"that",
"token",
"after",
"advancing",
"the",
"parser",
".",
"Otherwise",
"do",
"not",
"change",
"the",
"parser",
"state",
"and",
"return",
"false",
"."
] | train | https://github.com/fubhy/graphql-php/blob/c1de2233c731ca29e5c5db4c43f3b9db36478c83/src/Language/Parser.php#L154-L163 |
fubhy/graphql-php | src/Language/Parser.php | Parser.expectKeyword | protected function expectKeyword($value)
{
if ($this->token->getType() !== Token::NAME_TYPE || $this->token->getValue() !== $value) {
throw new \Exception(sprintf('Expected %s, found %s', $value, $this->token->getDescription()));
}
return $this->advance();
} | php | protected function expectKeyword($value)
{
if ($this->token->getType() !== Token::NAME_TYPE || $this->token->getValue() !== $value) {
throw new \Exception(sprintf('Expected %s, found %s', $value, $this->token->getDescription()));
}
return $this->advance();
} | [
"protected",
"function",
"expectKeyword",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"token",
"->",
"getType",
"(",
")",
"!==",
"Token",
"::",
"NAME_TYPE",
"||",
"$",
"this",
"->",
"token",
"->",
"getValue",
"(",
")",
"!==",
"$",
"val... | If the next token is a keyword with the given value, return that token
after advancing the parser. Otherwise, do not change the parser state and
return false.
@param string $value
@return \Fubhy\GraphQL\Language\Token
@throws \Exception | [
"If",
"the",
"next",
"token",
"is",
"a",
"keyword",
"with",
"the",
"given",
"value",
"return",
"that",
"token",
"after",
"advancing",
"the",
"parser",
".",
"Otherwise",
"do",
"not",
"change",
"the",
"parser",
"state",
"and",
"return",
"false",
"."
] | train | https://github.com/fubhy/graphql-php/blob/c1de2233c731ca29e5c5db4c43f3b9db36478c83/src/Language/Parser.php#L176-L183 |
fubhy/graphql-php | src/Language/Parser.php | Parser.unexpected | protected function unexpected(Token $atToken = NULL)
{
$token = $atToken ?: $this->token;
return new \Exception(sprintf('Unexpected %s', $token->getDescription()));
} | php | protected function unexpected(Token $atToken = NULL)
{
$token = $atToken ?: $this->token;
return new \Exception(sprintf('Unexpected %s', $token->getDescription()));
} | [
"protected",
"function",
"unexpected",
"(",
"Token",
"$",
"atToken",
"=",
"NULL",
")",
"{",
"$",
"token",
"=",
"$",
"atToken",
"?",
":",
"$",
"this",
"->",
"token",
";",
"return",
"new",
"\\",
"Exception",
"(",
"sprintf",
"(",
"'Unexpected %s'",
",",
"... | Helper protected function for creating an error when an unexpected lexed token is
encountered.
@param \Fubhy\GraphQL\Language\Token|null $atToken
@return \Exception | [
"Helper",
"protected",
"function",
"for",
"creating",
"an",
"error",
"when",
"an",
"unexpected",
"lexed",
"token",
"is",
"encountered",
"."
] | train | https://github.com/fubhy/graphql-php/blob/c1de2233c731ca29e5c5db4c43f3b9db36478c83/src/Language/Parser.php#L193-L198 |
fubhy/graphql-php | src/Language/Parser.php | Parser.many | protected function many($openKind, $parseFn, $closeKind)
{
$this->expect($openKind);
$nodes = [$parseFn($this)];
while (!$this->skip($closeKind)) {
array_push($nodes, $parseFn($this));
}
return $nodes;
} | php | protected function many($openKind, $parseFn, $closeKind)
{
$this->expect($openKind);
$nodes = [$parseFn($this)];
while (!$this->skip($closeKind)) {
array_push($nodes, $parseFn($this));
}
return $nodes;
} | [
"protected",
"function",
"many",
"(",
"$",
"openKind",
",",
"$",
"parseFn",
",",
"$",
"closeKind",
")",
"{",
"$",
"this",
"->",
"expect",
"(",
"$",
"openKind",
")",
";",
"$",
"nodes",
"=",
"[",
"$",
"parseFn",
"(",
"$",
"this",
")",
"]",
";",
"wh... | Returns a non-empty list of parse nodes, determined by the parseFn.
This list begins with a lex token of openKind and ends with a lex token
of closeKind. Advances the parser to the next lex token after the closing
token.
@param int $openKind
@param callable $parseFn
@param int $closeKind
@return array | [
"Returns",
"a",
"non",
"-",
"empty",
"list",
"of",
"parse",
"nodes",
"determined",
"by",
"the",
"parseFn",
"."
] | train | https://github.com/fubhy/graphql-php/blob/c1de2233c731ca29e5c5db4c43f3b9db36478c83/src/Language/Parser.php#L238-L248 |
fubhy/graphql-php | src/Language/Parser.php | Parser.parseName | protected function parseName()
{
$start = $this->token->getStart();
$token = $this->expect(Token::NAME_TYPE);
return new Name($token->getValue(), $this->location($start));
} | php | protected function parseName()
{
$start = $this->token->getStart();
$token = $this->expect(Token::NAME_TYPE);
return new Name($token->getValue(), $this->location($start));
} | [
"protected",
"function",
"parseName",
"(",
")",
"{",
"$",
"start",
"=",
"$",
"this",
"->",
"token",
"->",
"getStart",
"(",
")",
";",
"$",
"token",
"=",
"$",
"this",
"->",
"expect",
"(",
"Token",
"::",
"NAME_TYPE",
")",
";",
"return",
"new",
"Name",
... | Converts a name lex token into a name parse node.
@return \Fubhy\GraphQL\Language\Node\Name | [
"Converts",
"a",
"name",
"lex",
"token",
"into",
"a",
"name",
"parse",
"node",
"."
] | train | https://github.com/fubhy/graphql-php/blob/c1de2233c731ca29e5c5db4c43f3b9db36478c83/src/Language/Parser.php#L255-L261 |
fubhy/graphql-php | src/Language/Parser.php | Parser.parseDocument | protected function parseDocument()
{
$start = $this->token->getStart();
$definitions = [];
do {
if ($this->peek(Token::BRACE_L_TYPE)) {
$definitions[] = $this->parseOperationDefinition();
} else if ($this->peek(Token::NAME_TYPE)) {
$va... | php | protected function parseDocument()
{
$start = $this->token->getStart();
$definitions = [];
do {
if ($this->peek(Token::BRACE_L_TYPE)) {
$definitions[] = $this->parseOperationDefinition();
} else if ($this->peek(Token::NAME_TYPE)) {
$va... | [
"protected",
"function",
"parseDocument",
"(",
")",
"{",
"$",
"start",
"=",
"$",
"this",
"->",
"token",
"->",
"getStart",
"(",
")",
";",
"$",
"definitions",
"=",
"[",
"]",
";",
"do",
"{",
"if",
"(",
"$",
"this",
"->",
"peek",
"(",
"Token",
"::",
... | @return \Fubhy\GraphQL\Language\Node\Document
@throws \Exception | [
"@return",
"\\",
"Fubhy",
"\\",
"GraphQL",
"\\",
"Language",
"\\",
"Node",
"\\",
"Document"
] | train | https://github.com/fubhy/graphql-php/blob/c1de2233c731ca29e5c5db4c43f3b9db36478c83/src/Language/Parser.php#L283-L306 |
fubhy/graphql-php | src/Language/Parser.php | Parser.parseFragment | protected function parseFragment()
{
$start = $this->token->getStart();
$this->expect(Token::SPREAD_TYPE);
if ($this->token->getValue() === 'on') {
$this->advance();
return new InlineFragment(
$this->parseNamedType(),
$this->parseDire... | php | protected function parseFragment()
{
$start = $this->token->getStart();
$this->expect(Token::SPREAD_TYPE);
if ($this->token->getValue() === 'on') {
$this->advance();
return new InlineFragment(
$this->parseNamedType(),
$this->parseDire... | [
"protected",
"function",
"parseFragment",
"(",
")",
"{",
"$",
"start",
"=",
"$",
"this",
"->",
"token",
"->",
"getStart",
"(",
")",
";",
"$",
"this",
"->",
"expect",
"(",
"Token",
"::",
"SPREAD_TYPE",
")",
";",
"if",
"(",
"$",
"this",
"->",
"token",
... | Corresponds to both FragmentSpread and InlineFragment in the spec.
@return \Fubhy\GraphQL\Language\Node\FragmentSpread|\Fubhy\GraphQL\Language\Node\InlineFragment | [
"Corresponds",
"to",
"both",
"FragmentSpread",
"and",
"InlineFragment",
"in",
"the",
"spec",
"."
] | train | https://github.com/fubhy/graphql-php/blob/c1de2233c731ca29e5c5db4c43f3b9db36478c83/src/Language/Parser.php#L439-L460 |
fubhy/graphql-php | src/Language/Parser.php | Parser.parseValue | protected function parseValue($isConst)
{
$start = $this->token->getStart();
$token = $this->token;
switch ($this->token->getType()) {
case Token::BRACKET_L_TYPE:
return $this->parseArray($isConst);
case Token::BRACE_L_TYPE:
return $th... | php | protected function parseValue($isConst)
{
$start = $this->token->getStart();
$token = $this->token;
switch ($this->token->getType()) {
case Token::BRACKET_L_TYPE:
return $this->parseArray($isConst);
case Token::BRACE_L_TYPE:
return $th... | [
"protected",
"function",
"parseValue",
"(",
"$",
"isConst",
")",
"{",
"$",
"start",
"=",
"$",
"this",
"->",
"token",
"->",
"getStart",
"(",
")",
";",
"$",
"token",
"=",
"$",
"this",
"->",
"token",
";",
"switch",
"(",
"$",
"this",
"->",
"token",
"->... | @param bool $isConst
@return \Fubhy\GraphQL\Language\Node\ValueInterface
@throws \Exception | [
"@param",
"bool",
"$isConst"
] | train | https://github.com/fubhy/graphql-php/blob/c1de2233c731ca29e5c5db4c43f3b9db36478c83/src/Language/Parser.php#L505-L540 |
fubhy/graphql-php | src/Language/Parser.php | Parser.parseArray | protected function parseArray($isConst)
{
$start = $this->token->getStart();
$item = $isConst ? 'parseConstValue' : 'parseVariableValue';
return new ArrayValue(
$this->any(Token::BRACKET_L_TYPE, [$this, $item], Token::BRACKET_R_TYPE),
$this->location($start)
... | php | protected function parseArray($isConst)
{
$start = $this->token->getStart();
$item = $isConst ? 'parseConstValue' : 'parseVariableValue';
return new ArrayValue(
$this->any(Token::BRACKET_L_TYPE, [$this, $item], Token::BRACKET_R_TYPE),
$this->location($start)
... | [
"protected",
"function",
"parseArray",
"(",
"$",
"isConst",
")",
"{",
"$",
"start",
"=",
"$",
"this",
"->",
"token",
"->",
"getStart",
"(",
")",
";",
"$",
"item",
"=",
"$",
"isConst",
"?",
"'parseConstValue'",
":",
"'parseVariableValue'",
";",
"return",
... | @param bool $isConst
@return \Fubhy\GraphQL\Language\Node\ArrayValue | [
"@param",
"bool",
"$isConst"
] | train | https://github.com/fubhy/graphql-php/blob/c1de2233c731ca29e5c5db4c43f3b9db36478c83/src/Language/Parser.php#L547-L556 |
fubhy/graphql-php | src/Language/Parser.php | Parser.parseObject | protected function parseObject($isConst)
{
$start = $this->token->getStart();
$this->expect(Token::BRACE_L_TYPE);
$fieldNames = [];
$fields = [];
while (!$this->skip(Token::BRACE_R_TYPE)) {
array_push($fields, $this->parseObjectField($isConst, $fieldNames));
... | php | protected function parseObject($isConst)
{
$start = $this->token->getStart();
$this->expect(Token::BRACE_L_TYPE);
$fieldNames = [];
$fields = [];
while (!$this->skip(Token::BRACE_R_TYPE)) {
array_push($fields, $this->parseObjectField($isConst, $fieldNames));
... | [
"protected",
"function",
"parseObject",
"(",
"$",
"isConst",
")",
"{",
"$",
"start",
"=",
"$",
"this",
"->",
"token",
"->",
"getStart",
"(",
")",
";",
"$",
"this",
"->",
"expect",
"(",
"Token",
"::",
"BRACE_L_TYPE",
")",
";",
"$",
"fieldNames",
"=",
... | @param bool $isConst
@return \Fubhy\GraphQL\Language\Node\ObjectValue | [
"@param",
"bool",
"$isConst"
] | train | https://github.com/fubhy/graphql-php/blob/c1de2233c731ca29e5c5db4c43f3b9db36478c83/src/Language/Parser.php#L563-L575 |
fubhy/graphql-php | src/Language/Parser.php | Parser.parseObjectField | protected function parseObjectField($isConst, &$fieldNames)
{
$start = $this->token->getStart();
$name = $this->parseName();
$value = $name->get('value');
if (array_key_exists($value, $fieldNames)) {
throw new \Exception(sprintf('Duplicate input object field %s.', $value... | php | protected function parseObjectField($isConst, &$fieldNames)
{
$start = $this->token->getStart();
$name = $this->parseName();
$value = $name->get('value');
if (array_key_exists($value, $fieldNames)) {
throw new \Exception(sprintf('Duplicate input object field %s.', $value... | [
"protected",
"function",
"parseObjectField",
"(",
"$",
"isConst",
",",
"&",
"$",
"fieldNames",
")",
"{",
"$",
"start",
"=",
"$",
"this",
"->",
"token",
"->",
"getStart",
"(",
")",
";",
"$",
"name",
"=",
"$",
"this",
"->",
"parseName",
"(",
")",
";",
... | @param bool $isConst
@param array $fieldNames
@return \Fubhy\GraphQL\Language\Node\ObjectField
@throws \Exception | [
"@param",
"bool",
"$isConst",
"@param",
"array",
"$fieldNames"
] | train | https://github.com/fubhy/graphql-php/blob/c1de2233c731ca29e5c5db4c43f3b9db36478c83/src/Language/Parser.php#L585-L599 |
fubhy/graphql-php | src/Language/Parser.php | Parser.parseDirective | protected function parseDirective()
{
$start = $this->token->getStart();
$this->expect(Token::AT_TYPE);
return new Directive(
$this->parseName(),
$this->parseArguments(),
$this->location($start)
);
} | php | protected function parseDirective()
{
$start = $this->token->getStart();
$this->expect(Token::AT_TYPE);
return new Directive(
$this->parseName(),
$this->parseArguments(),
$this->location($start)
);
} | [
"protected",
"function",
"parseDirective",
"(",
")",
"{",
"$",
"start",
"=",
"$",
"this",
"->",
"token",
"->",
"getStart",
"(",
")",
";",
"$",
"this",
"->",
"expect",
"(",
"Token",
"::",
"AT_TYPE",
")",
";",
"return",
"new",
"Directive",
"(",
"$",
"t... | @return \Fubhy\GraphQL\Language\Node\Directive
@throws \Exception | [
"@return",
"\\",
"Fubhy",
"\\",
"GraphQL",
"\\",
"Language",
"\\",
"Node",
"\\",
"Directive"
] | train | https://github.com/fubhy/graphql-php/blob/c1de2233c731ca29e5c5db4c43f3b9db36478c83/src/Language/Parser.php#L619-L629 |
fubhy/graphql-php | src/Language/Parser.php | Parser.parseType | protected function parseType()
{
$start = $this->token->getStart();
if ($this->skip(Token::BRACKET_L_TYPE)) {
$type = $this->parseType();
$this->expect(Token::BRACKET_R_TYPE);
$type = new ListType($type, $this->location($start));
} else {
$typ... | php | protected function parseType()
{
$start = $this->token->getStart();
if ($this->skip(Token::BRACKET_L_TYPE)) {
$type = $this->parseType();
$this->expect(Token::BRACKET_R_TYPE);
$type = new ListType($type, $this->location($start));
} else {
$typ... | [
"protected",
"function",
"parseType",
"(",
")",
"{",
"$",
"start",
"=",
"$",
"this",
"->",
"token",
"->",
"getStart",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"skip",
"(",
"Token",
"::",
"BRACKET_L_TYPE",
")",
")",
"{",
"$",
"type",
"=",
"$",
... | Handles the type: TypeName, ListType, and NonNullType parsing rules.
@return \Fubhy\GraphQL\Language\Node\TypeInterface
@throws \Exception | [
"Handles",
"the",
"type",
":",
"TypeName",
"ListType",
"and",
"NonNullType",
"parsing",
"rules",
"."
] | train | https://github.com/fubhy/graphql-php/blob/c1de2233c731ca29e5c5db4c43f3b9db36478c83/src/Language/Parser.php#L638-L655 |
phpmob/changmin | src/PhpMob/CmsBundle/Doctrine/ORM/TemplateRepository.php | TemplateRepository.findNoneAbstractTemplates | public function findNoneAbstractTemplates()
{
$queryBuilder = $this->createQueryBuilder('o');
return $queryBuilder
->where($queryBuilder->expr()->neq('o.type', ':type'))
->orderBy('o.name', 'ASC')
->setParameter(':type', TemplateInterface::TYPE_ABSTRACT)
... | php | public function findNoneAbstractTemplates()
{
$queryBuilder = $this->createQueryBuilder('o');
return $queryBuilder
->where($queryBuilder->expr()->neq('o.type', ':type'))
->orderBy('o.name', 'ASC')
->setParameter(':type', TemplateInterface::TYPE_ABSTRACT)
... | [
"public",
"function",
"findNoneAbstractTemplates",
"(",
")",
"{",
"$",
"queryBuilder",
"=",
"$",
"this",
"->",
"createQueryBuilder",
"(",
"'o'",
")",
";",
"return",
"$",
"queryBuilder",
"->",
"where",
"(",
"$",
"queryBuilder",
"->",
"expr",
"(",
")",
"->",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/phpmob/changmin/blob/bfebb1561229094d1c138574abab75f2f1d17d66/src/PhpMob/CmsBundle/Doctrine/ORM/TemplateRepository.php#L34-L43 |
ARCANEDEV/Sanitizer | src/Sanitizer.php | Sanitizer.setFilters | public function setFilters(array $filters)
{
if (empty($this->filters)) {
$this->filters = $this->getDefaultFilters();
}
$this->filters = array_merge(
$this->filters, $filters
);
return $this;
} | php | public function setFilters(array $filters)
{
if (empty($this->filters)) {
$this->filters = $this->getDefaultFilters();
}
$this->filters = array_merge(
$this->filters, $filters
);
return $this;
} | [
"public",
"function",
"setFilters",
"(",
"array",
"$",
"filters",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"filters",
")",
")",
"{",
"$",
"this",
"->",
"filters",
"=",
"$",
"this",
"->",
"getDefaultFilters",
"(",
")",
";",
"}",
"$",
"t... | Set filters.
@param array $filters
@return self | [
"Set",
"filters",
"."
] | train | https://github.com/ARCANEDEV/Sanitizer/blob/e21990ce6d881366d52a7f4e5040b07cc3ecca96/src/Sanitizer.php#L59-L70 |
ARCANEDEV/Sanitizer | src/Sanitizer.php | Sanitizer.sanitize | public function sanitize(array $data, array $rules = [], array $filters = [])
{
$this->setRules($rules);
$this->setFilters($filters);
foreach ($data as $name => $value) {
$data[$name] = $this->sanitizeAttribute($name, $value);
}
return $data;
} | php | public function sanitize(array $data, array $rules = [], array $filters = [])
{
$this->setRules($rules);
$this->setFilters($filters);
foreach ($data as $name => $value) {
$data[$name] = $this->sanitizeAttribute($name, $value);
}
return $data;
} | [
"public",
"function",
"sanitize",
"(",
"array",
"$",
"data",
",",
"array",
"$",
"rules",
"=",
"[",
"]",
",",
"array",
"$",
"filters",
"=",
"[",
"]",
")",
"{",
"$",
"this",
"->",
"setRules",
"(",
"$",
"rules",
")",
";",
"$",
"this",
"->",
"setFilt... | Sanitize the given data.
@param array $data
@param array $rules
@param array $filters
@return array | [
"Sanitize",
"the",
"given",
"data",
"."
] | train | https://github.com/ARCANEDEV/Sanitizer/blob/e21990ce6d881366d52a7f4e5040b07cc3ecca96/src/Sanitizer.php#L99-L109 |
ARCANEDEV/Sanitizer | src/Sanitizer.php | Sanitizer.sanitizeAttribute | protected function sanitizeAttribute($attribute, $value)
{
foreach ($this->rules->get($attribute) as $rule) {
$value = $this->applyFilter($rule['name'], $value, $rule['options']);
}
return $value;
} | php | protected function sanitizeAttribute($attribute, $value)
{
foreach ($this->rules->get($attribute) as $rule) {
$value = $this->applyFilter($rule['name'], $value, $rule['options']);
}
return $value;
} | [
"protected",
"function",
"sanitizeAttribute",
"(",
"$",
"attribute",
",",
"$",
"value",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"rules",
"->",
"get",
"(",
"$",
"attribute",
")",
"as",
"$",
"rule",
")",
"{",
"$",
"value",
"=",
"$",
"this",
"->",
... | Sanitize the given attribute
@param string $attribute
@param mixed $value
@return mixed | [
"Sanitize",
"the",
"given",
"attribute"
] | train | https://github.com/ARCANEDEV/Sanitizer/blob/e21990ce6d881366d52a7f4e5040b07cc3ecca96/src/Sanitizer.php#L119-L126 |
ARCANEDEV/Sanitizer | src/Sanitizer.php | Sanitizer.applyFilter | protected function applyFilter($name, $value, $options = [])
{
$this->hasFilter($name);
if (empty($value)) return $value;
$filter = $this->filters[$name];
if ($filter instanceof Closure) {
return call_user_func_array($filter, compact('value', 'options'));
}
... | php | protected function applyFilter($name, $value, $options = [])
{
$this->hasFilter($name);
if (empty($value)) return $value;
$filter = $this->filters[$name];
if ($filter instanceof Closure) {
return call_user_func_array($filter, compact('value', 'options'));
}
... | [
"protected",
"function",
"applyFilter",
"(",
"$",
"name",
",",
"$",
"value",
",",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"this",
"->",
"hasFilter",
"(",
"$",
"name",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"value",
")",
")",
"return",
"$",... | Apply the given filter by its name.
@param string $name
@param mixed $value
@param array $options
@return mixed | [
"Apply",
"the",
"given",
"filter",
"by",
"its",
"name",
"."
] | train | https://github.com/ARCANEDEV/Sanitizer/blob/e21990ce6d881366d52a7f4e5040b07cc3ecca96/src/Sanitizer.php#L137-L153 |
ARCANEDEV/Sanitizer | src/Sanitizer.php | Sanitizer.getDefaultFilters | private function getDefaultFilters()
{
return [
'capitalize' => Filters\CapitalizeFilter::class,
'email' => Filters\EmailFilter::class,
'escape' => Filters\EscapeFilter::class,
'format_date' => Filters\FormatDateFilter::class,
'lowercas... | php | private function getDefaultFilters()
{
return [
'capitalize' => Filters\CapitalizeFilter::class,
'email' => Filters\EmailFilter::class,
'escape' => Filters\EscapeFilter::class,
'format_date' => Filters\FormatDateFilter::class,
'lowercas... | [
"private",
"function",
"getDefaultFilters",
"(",
")",
"{",
"return",
"[",
"'capitalize'",
"=>",
"Filters",
"\\",
"CapitalizeFilter",
"::",
"class",
",",
"'email'",
"=>",
"Filters",
"\\",
"EmailFilter",
"::",
"class",
",",
"'escape'",
"=>",
"Filters",
"\\",
"Es... | Get default filters.
@return array | [
"Get",
"default",
"filters",
"."
] | train | https://github.com/ARCANEDEV/Sanitizer/blob/e21990ce6d881366d52a7f4e5040b07cc3ecca96/src/Sanitizer.php#L184-L197 |
webforge-labs/psc-cms | lib/Psc/URL/Helper.php | Helper.absolute | protected static function absolute($relativeURL) {
$protocol = 'http';
$url = $protocol.'://'.rtrim($_SERVER['HTTP_HOST'],'/');
$url .= $relativeURL;
return $url;
} | php | protected static function absolute($relativeURL) {
$protocol = 'http';
$url = $protocol.'://'.rtrim($_SERVER['HTTP_HOST'],'/');
$url .= $relativeURL;
return $url;
} | [
"protected",
"static",
"function",
"absolute",
"(",
"$",
"relativeURL",
")",
"{",
"$",
"protocol",
"=",
"'http'",
";",
"$",
"url",
"=",
"$",
"protocol",
".",
"'://'",
".",
"rtrim",
"(",
"$",
"_SERVER",
"[",
"'HTTP_HOST'",
"]",
",",
"'/'",
")",
";",
"... | Wandelt eine Relative in eine absolute URL um (hängt den Host davor)
@param string $section sollte immer mit / anfangen | [
"Wandelt",
"eine",
"Relative",
"in",
"eine",
"absolute",
"URL",
"um",
"(",
"hängt",
"den",
"Host",
"davor",
")"
] | train | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/URL/Helper.php#L18-L25 |
webforge-labs/psc-cms | lib/Psc/URL/Helper.php | Helper.getRelative | public static function getRelative($flags = 0x000000, Array $queryVars = array()) {
$flags |= self::RELATIVE;
return self::getURL(NULL,$flags, $queryVars);
} | php | public static function getRelative($flags = 0x000000, Array $queryVars = array()) {
$flags |= self::RELATIVE;
return self::getURL(NULL,$flags, $queryVars);
} | [
"public",
"static",
"function",
"getRelative",
"(",
"$",
"flags",
"=",
"0x000000",
",",
"Array",
"$",
"queryVars",
"=",
"array",
"(",
")",
")",
"{",
"$",
"flags",
"|=",
"self",
"::",
"RELATIVE",
";",
"return",
"self",
"::",
"getURL",
"(",
"NULL",
",",
... | Gibt die aktuelle relative URL zurück
@param bitmap $flags
@param Array $queryVars | [
"Gibt",
"die",
"aktuelle",
"relative",
"URL",
"zurück"
] | train | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/URL/Helper.php#L33-L36 |
webforge-labs/psc-cms | lib/Psc/URL/Helper.php | Helper.getAbsolute | public static function getAbsolute($flags = 0x000000, Array $queryVars = array()) {
$flags |= self::ABSOLUTE;
return self::getURL(NULL,$flags,$queryVars);
} | php | public static function getAbsolute($flags = 0x000000, Array $queryVars = array()) {
$flags |= self::ABSOLUTE;
return self::getURL(NULL,$flags,$queryVars);
} | [
"public",
"static",
"function",
"getAbsolute",
"(",
"$",
"flags",
"=",
"0x000000",
",",
"Array",
"$",
"queryVars",
"=",
"array",
"(",
")",
")",
"{",
"$",
"flags",
"|=",
"self",
"::",
"ABSOLUTE",
";",
"return",
"self",
"::",
"getURL",
"(",
"NULL",
",",
... | /*
Gibt die aktuelle absolute URL zurück
Die Parameter verhalten sich so wie bei getRelative und getURL() außer, dass die zurückgegebene URL
eine Absolute ist | [
"/",
"*",
"Gibt",
"die",
"aktuelle",
"absolute",
"URL",
"zurück"
] | train | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/URL/Helper.php#L44-L47 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.