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 |
|---|---|---|---|---|---|---|---|---|---|---|
ray-di/Ray.WebFormModule | src/AuraInputInterceptor.php | AuraInputInterceptor.invoke | public function invoke(MethodInvocation $invocation)
{
$object = $invocation->getThis();
/* @var $formValidation FormValidation */
$method = $invocation->getMethod();
$formValidation = $this->reader->getMethodAnnotation($method, AbstractValidation::class);
$form = $this->getF... | php | public function invoke(MethodInvocation $invocation)
{
$object = $invocation->getThis();
/* @var $formValidation FormValidation */
$method = $invocation->getMethod();
$formValidation = $this->reader->getMethodAnnotation($method, AbstractValidation::class);
$form = $this->getF... | [
"public",
"function",
"invoke",
"(",
"MethodInvocation",
"$",
"invocation",
")",
"{",
"$",
"object",
"=",
"$",
"invocation",
"->",
"getThis",
"(",
")",
";",
"/* @var $formValidation FormValidation */",
"$",
"method",
"=",
"$",
"invocation",
"->",
"getMethod",
"(... | {@inheritdoc}
@throws InvalidArgumentException | [
"{",
"@inheritdoc",
"}"
] | train | https://github.com/ray-di/Ray.WebFormModule/blob/4b6d33adb4a5c285278a068f3e7a5afdc4e680d9/src/AuraInputInterceptor.php#L44-L59 |
ray-di/Ray.WebFormModule | src/AuraInputInterceptor.php | AuraInputInterceptor.getNamedArguments | private function getNamedArguments(MethodInvocation $invocation)
{
$submit = [];
$params = $invocation->getMethod()->getParameters();
$args = $invocation->getArguments()->getArrayCopy();
foreach ($params as $param) {
$arg = array_shift($args);
$submit[$param->... | php | private function getNamedArguments(MethodInvocation $invocation)
{
$submit = [];
$params = $invocation->getMethod()->getParameters();
$args = $invocation->getArguments()->getArrayCopy();
foreach ($params as $param) {
$arg = array_shift($args);
$submit[$param->... | [
"private",
"function",
"getNamedArguments",
"(",
"MethodInvocation",
"$",
"invocation",
")",
"{",
"$",
"submit",
"=",
"[",
"]",
";",
"$",
"params",
"=",
"$",
"invocation",
"->",
"getMethod",
"(",
")",
"->",
"getParameters",
"(",
")",
";",
"$",
"args",
"=... | Return arguments as named arguments.
@param MethodInvocation $invocation
@return array | [
"Return",
"arguments",
"as",
"named",
"arguments",
"."
] | train | https://github.com/ray-di/Ray.WebFormModule/blob/4b6d33adb4a5c285278a068f3e7a5afdc4e680d9/src/AuraInputInterceptor.php#L83-L98 |
ray-di/Ray.WebFormModule | src/AuraInputInterceptor.php | AuraInputInterceptor.getFormProperty | private function getFormProperty(AbstractValidation $formValidation, $object)
{
if (! property_exists($object, $formValidation->form)) {
throw new InvalidFormPropertyException($formValidation->form);
}
$prop = (new \ReflectionClass($object))->getProperty($formValidation->form);
... | php | private function getFormProperty(AbstractValidation $formValidation, $object)
{
if (! property_exists($object, $formValidation->form)) {
throw new InvalidFormPropertyException($formValidation->form);
}
$prop = (new \ReflectionClass($object))->getProperty($formValidation->form);
... | [
"private",
"function",
"getFormProperty",
"(",
"AbstractValidation",
"$",
"formValidation",
",",
"$",
"object",
")",
"{",
"if",
"(",
"!",
"property_exists",
"(",
"$",
"object",
",",
"$",
"formValidation",
"->",
"form",
")",
")",
"{",
"throw",
"new",
"Invalid... | Return form property
@param AbstractValidation $formValidation
@param object $object
@return mixed | [
"Return",
"form",
"property"
] | train | https://github.com/ray-di/Ray.WebFormModule/blob/4b6d33adb4a5c285278a068f3e7a5afdc4e680d9/src/AuraInputInterceptor.php#L108-L121 |
DevGroup-ru/yii2-intent-analytics | src/models/Visitor.php | Visitor.hasUserId | public function hasUserId()
{
if (Yii::$app->user->isGuest) {
return $this->user_id !== 0;
}
return $this->user_id == Yii::$app->user->identity->getId();
} | php | public function hasUserId()
{
if (Yii::$app->user->isGuest) {
return $this->user_id !== 0;
}
return $this->user_id == Yii::$app->user->identity->getId();
} | [
"public",
"function",
"hasUserId",
"(",
")",
"{",
"if",
"(",
"Yii",
"::",
"$",
"app",
"->",
"user",
"->",
"isGuest",
")",
"{",
"return",
"$",
"this",
"->",
"user_id",
"!==",
"0",
";",
"}",
"return",
"$",
"this",
"->",
"user_id",
"==",
"Yii",
"::",
... | Detect is visitor connected with User
@return bool | [
"Detect",
"is",
"visitor",
"connected",
"with",
"User"
] | train | https://github.com/DevGroup-ru/yii2-intent-analytics/blob/53937d44df8c73dca402cc7351b018e6758c3af6/src/models/Visitor.php#L165-L171 |
keiosweb/moneyright | src/Math.php | Math.bcRoundHalfUp | final private static function bcRoundHalfUp($number, $precision)
{
return self::truncate(bcadd($number, self::getHalfUpValue($number, $precision), $precision + 1), $precision);
} | php | final private static function bcRoundHalfUp($number, $precision)
{
return self::truncate(bcadd($number, self::getHalfUpValue($number, $precision), $precision + 1), $precision);
} | [
"final",
"private",
"static",
"function",
"bcRoundHalfUp",
"(",
"$",
"number",
",",
"$",
"precision",
")",
"{",
"return",
"self",
"::",
"truncate",
"(",
"bcadd",
"(",
"$",
"number",
",",
"self",
"::",
"getHalfUpValue",
"(",
"$",
"number",
",",
"$",
"prec... | Round decimals from 5 up, less than 5 down
@param $number
@param $precision
@return string | [
"Round",
"decimals",
"from",
"5",
"up",
"less",
"than",
"5",
"down"
] | train | https://github.com/keiosweb/moneyright/blob/6c6d8ce34e37e42aa1eebbf45a949bbae6b44780/src/Math.php#L216-L219 |
ARCANEDEV/SpamBlocker | src/SpamBlockerServiceProvider.php | SpamBlockerServiceProvider.registerSpamBlocker | private function registerSpamBlocker()
{
$this->singleton(Contracts\SpamBlocker::class, function ($app) {
/** @var \Illuminate\Contracts\Config\Repository $config */
$config = $app['config'];
return new SpamBlocker(
$config->get('spam-blocker')
... | php | private function registerSpamBlocker()
{
$this->singleton(Contracts\SpamBlocker::class, function ($app) {
/** @var \Illuminate\Contracts\Config\Repository $config */
$config = $app['config'];
return new SpamBlocker(
$config->get('spam-blocker')
... | [
"private",
"function",
"registerSpamBlocker",
"(",
")",
"{",
"$",
"this",
"->",
"singleton",
"(",
"Contracts",
"\\",
"SpamBlocker",
"::",
"class",
",",
"function",
"(",
"$",
"app",
")",
"{",
"/** @var \\Illuminate\\Contracts\\Config\\Repository $config */",
"$",
"... | Register the spam blocker | [
"Register",
"the",
"spam",
"blocker"
] | train | https://github.com/ARCANEDEV/SpamBlocker/blob/708c9d5363616e0b257451256c4ca9fb9a9ff55f/src/SpamBlockerServiceProvider.php#L72-L82 |
tonicospinelli/class-generation | src/ClassGeneration/DocBlock/Tag.php | Tag.getType | public function getType()
{
if ((is_null($this->type) || empty($this->type)) && $this->needsType()) {
return 'mixed';
}
return $this->type;
} | php | public function getType()
{
if ((is_null($this->type) || empty($this->type)) && $this->needsType()) {
return 'mixed';
}
return $this->type;
} | [
"public",
"function",
"getType",
"(",
")",
"{",
"if",
"(",
"(",
"is_null",
"(",
"$",
"this",
"->",
"type",
")",
"||",
"empty",
"(",
"$",
"this",
"->",
"type",
")",
")",
"&&",
"$",
"this",
"->",
"needsType",
"(",
")",
")",
"{",
"return",
"'mixed'"... | {@inheritdoc} | [
"{"
] | train | https://github.com/tonicospinelli/class-generation/blob/eee63bdb68c066b25b885b57b23656e809381a76/src/ClassGeneration/DocBlock/Tag.php#L99-L106 |
tonicospinelli/class-generation | src/ClassGeneration/DocBlock/Tag.php | Tag.toString | public function toString()
{
$name = $this->getName();
$variable = $this->getVariable();
$type = $this->getType();
$description = $this->getDescription();
$string =
'@' . $name
. ((!is_null($type) && !empty($type)) ? ' ' . $type : '')
. ((!... | php | public function toString()
{
$name = $this->getName();
$variable = $this->getVariable();
$type = $this->getType();
$description = $this->getDescription();
$string =
'@' . $name
. ((!is_null($type) && !empty($type)) ? ' ' . $type : '')
. ((!... | [
"public",
"function",
"toString",
"(",
")",
"{",
"$",
"name",
"=",
"$",
"this",
"->",
"getName",
"(",
")",
";",
"$",
"variable",
"=",
"$",
"this",
"->",
"getVariable",
"(",
")",
";",
"$",
"type",
"=",
"$",
"this",
"->",
"getType",
"(",
")",
";",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/tonicospinelli/class-generation/blob/eee63bdb68c066b25b885b57b23656e809381a76/src/ClassGeneration/DocBlock/Tag.php#L202-L220 |
tonicospinelli/class-generation | src/ClassGeneration/DocBlock/Tag.php | Tag.createFromArgument | public static function createFromArgument(ArgumentInterface $argument)
{
$tag = new self();
$tag
->setName(self::TAG_PARAM)
->setType($argument->getType())
->setVariable($argument->getName())
->setDescription($argument->getDescription())
->... | php | public static function createFromArgument(ArgumentInterface $argument)
{
$tag = new self();
$tag
->setName(self::TAG_PARAM)
->setType($argument->getType())
->setVariable($argument->getName())
->setDescription($argument->getDescription())
->... | [
"public",
"static",
"function",
"createFromArgument",
"(",
"ArgumentInterface",
"$",
"argument",
")",
"{",
"$",
"tag",
"=",
"new",
"self",
"(",
")",
";",
"$",
"tag",
"->",
"setName",
"(",
"self",
"::",
"TAG_PARAM",
")",
"->",
"setType",
"(",
"$",
"argume... | Creating a Tag from an Argument Object.
@param ArgumentInterface $argument
@return TagInterface | [
"Creating",
"a",
"Tag",
"from",
"an",
"Argument",
"Object",
"."
] | train | https://github.com/tonicospinelli/class-generation/blob/eee63bdb68c066b25b885b57b23656e809381a76/src/ClassGeneration/DocBlock/Tag.php#L229-L240 |
tonicospinelli/class-generation | src/ClassGeneration/DocBlock/Tag.php | Tag.createFromProperty | public static function createFromProperty(PropertyInterface $property)
{
$tag = new self();
$tag->setName(self::TAG_VAR);
$tag->setType($property->getType());
return $tag;
} | php | public static function createFromProperty(PropertyInterface $property)
{
$tag = new self();
$tag->setName(self::TAG_VAR);
$tag->setType($property->getType());
return $tag;
} | [
"public",
"static",
"function",
"createFromProperty",
"(",
"PropertyInterface",
"$",
"property",
")",
"{",
"$",
"tag",
"=",
"new",
"self",
"(",
")",
";",
"$",
"tag",
"->",
"setName",
"(",
"self",
"::",
"TAG_VAR",
")",
";",
"$",
"tag",
"->",
"setType",
... | Create var tag from property.
@param PropertyInterface $property
@return Tag | [
"Create",
"var",
"tag",
"from",
"property",
"."
] | train | https://github.com/tonicospinelli/class-generation/blob/eee63bdb68c066b25b885b57b23656e809381a76/src/ClassGeneration/DocBlock/Tag.php#L249-L256 |
FrenchFrogs/framework | src/Core/Configurator.php | Configurator.build | public function build($index, $default = null, $params = [])
{
$class = $this->get($index, $default);
if (!class_exists($class)) {
throw new \Exception('Class doesn\'t exist for the index : ' .$index);
}
$class = new \ReflectionClass($class);
return $class->newIn... | php | public function build($index, $default = null, $params = [])
{
$class = $this->get($index, $default);
if (!class_exists($class)) {
throw new \Exception('Class doesn\'t exist for the index : ' .$index);
}
$class = new \ReflectionClass($class);
return $class->newIn... | [
"public",
"function",
"build",
"(",
"$",
"index",
",",
"$",
"default",
"=",
"null",
",",
"$",
"params",
"=",
"[",
"]",
")",
"{",
"$",
"class",
"=",
"$",
"this",
"->",
"get",
"(",
"$",
"index",
",",
"$",
"default",
")",
";",
"if",
"(",
"!",
"c... | Return an instantiated object
@param $index
@param null $default
@param array $params
@return object
@throws \Exception | [
"Return",
"an",
"instantiated",
"object"
] | train | https://github.com/FrenchFrogs/framework/blob/a4838c698a5600437e87dac6d35ba8ebe32c4395/src/Core/Configurator.php#L134-L143 |
jenky/laravel-api-helper | src/Factory.php | Factory.parseBuilder | protected function parseBuilder($builder)
{
if ($builder instanceof EloquentBuilder) {
return $this->createHandler($builder->getQuery(), $builder);
}
if (is_subclass_of($builder, Model::class)) {
return $this->createHandler($builder->getQuery(), $builder->newQuery());... | php | protected function parseBuilder($builder)
{
if ($builder instanceof EloquentBuilder) {
return $this->createHandler($builder->getQuery(), $builder);
}
if (is_subclass_of($builder, Model::class)) {
return $this->createHandler($builder->getQuery(), $builder->newQuery());... | [
"protected",
"function",
"parseBuilder",
"(",
"$",
"builder",
")",
"{",
"if",
"(",
"$",
"builder",
"instanceof",
"EloquentBuilder",
")",
"{",
"return",
"$",
"this",
"->",
"createHandler",
"(",
"$",
"builder",
"->",
"getQuery",
"(",
")",
",",
"$",
"builder"... | Parse the builder.
@param mixed $builder | [
"Parse",
"the",
"builder",
"."
] | train | https://github.com/jenky/laravel-api-helper/blob/9af8f4d99d96ed3ea1bee7eabcdb0472f1bfa367/src/Factory.php#L47-L58 |
jenky/laravel-api-helper | src/Factory.php | Factory.createHandler | protected function createHandler($query, $builder = null)
{
$handler = new Handler($this->request, $this->config);
$handler->setQuery($query);
if (! is_null($builder)) {
$handler->setBuilder($builder);
}
return $handler;
} | php | protected function createHandler($query, $builder = null)
{
$handler = new Handler($this->request, $this->config);
$handler->setQuery($query);
if (! is_null($builder)) {
$handler->setBuilder($builder);
}
return $handler;
} | [
"protected",
"function",
"createHandler",
"(",
"$",
"query",
",",
"$",
"builder",
"=",
"null",
")",
"{",
"$",
"handler",
"=",
"new",
"Handler",
"(",
"$",
"this",
"->",
"request",
",",
"$",
"this",
"->",
"config",
")",
";",
"$",
"handler",
"->",
"setQ... | Create the handler.
@param mixed $query
@param mixed $builder
@return \Jenky\LaravelApiHelper\Handler | [
"Create",
"the",
"handler",
"."
] | train | https://github.com/jenky/laravel-api-helper/blob/9af8f4d99d96ed3ea1bee7eabcdb0472f1bfa367/src/Factory.php#L68-L79 |
heyday/heystack | src/Input/Handler.php | Handler.process | public function process($identifier, \SS_HTTPRequest $request)
{
if ($this->hasProcessor($identifier)) {
return $this->processors[$identifier]->process($request);
} else {
return false;
}
} | php | public function process($identifier, \SS_HTTPRequest $request)
{
if ($this->hasProcessor($identifier)) {
return $this->processors[$identifier]->process($request);
} else {
return false;
}
} | [
"public",
"function",
"process",
"(",
"$",
"identifier",
",",
"\\",
"SS_HTTPRequest",
"$",
"request",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"hasProcessor",
"(",
"$",
"identifier",
")",
")",
"{",
"return",
"$",
"this",
"->",
"processors",
"[",
"$",
"i... | Process an input processor by identifier if it exists
@param string $identifier The identifier of the input processor
@param \SS_HTTPRequest $request The request object to process from
@return mixed | [
"Process",
"an",
"input",
"processor",
"by",
"identifier",
"if",
"it",
"exists"
] | train | https://github.com/heyday/heystack/blob/2c051933f8c532d0a9a23be6ee1ff5c619e47dfe/src/Input/Handler.php#L41-L48 |
polidog/esa-php | src/Api.php | Api.comments | public function comments($number = null, array $params = [])
{
if (empty($number)) {
return $this->client->request('GET', $this->getCurrentTeamUrl('comments'), [
'query' => $params,
]);
}
return $this->client->request('GET', $this->getCurrentTeamUrl("... | php | public function comments($number = null, array $params = [])
{
if (empty($number)) {
return $this->client->request('GET', $this->getCurrentTeamUrl('comments'), [
'query' => $params,
]);
}
return $this->client->request('GET', $this->getCurrentTeamUrl("... | [
"public",
"function",
"comments",
"(",
"$",
"number",
"=",
"null",
",",
"array",
"$",
"params",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"number",
")",
")",
"{",
"return",
"$",
"this",
"->",
"client",
"->",
"request",
"(",
"'GET'",
... | @param int $number
@param array $params
@return array | [
"@param",
"int",
"$number",
"@param",
"array",
"$params"
] | train | https://github.com/polidog/esa-php/blob/c5badbd027d73eebcd3cd388487b7c793323bb14/src/Api.php#L146-L157 |
polidog/esa-php | src/Api.php | Api.factory | public static function factory($accessToken, $currentTeam)
{
$client = Client::factory($accessToken);
return new self($client, $currentTeam);
} | php | public static function factory($accessToken, $currentTeam)
{
$client = Client::factory($accessToken);
return new self($client, $currentTeam);
} | [
"public",
"static",
"function",
"factory",
"(",
"$",
"accessToken",
",",
"$",
"currentTeam",
")",
"{",
"$",
"client",
"=",
"Client",
"::",
"factory",
"(",
"$",
"accessToken",
")",
";",
"return",
"new",
"self",
"(",
"$",
"client",
",",
"$",
"currentTeam",... | @param $accessToken
@param $currentTeam
@return Api | [
"@param",
"$accessToken",
"@param",
"$currentTeam"
] | train | https://github.com/polidog/esa-php/blob/c5badbd027d73eebcd3cd388487b7c793323bb14/src/Api.php#L459-L464 |
ARCANEDEV/SpamBlocker | src/Http/Middleware/BlockReferralSpam.php | BlockReferralSpam.handle | public function handle(Request $request, Closure $next)
{
$referer = $request->headers->get('referer');
return $this->blocker->isBlocked($referer)
? $this->getBlockedResponse()
: $next($request);
} | php | public function handle(Request $request, Closure $next)
{
$referer = $request->headers->get('referer');
return $this->blocker->isBlocked($referer)
? $this->getBlockedResponse()
: $next($request);
} | [
"public",
"function",
"handle",
"(",
"Request",
"$",
"request",
",",
"Closure",
"$",
"next",
")",
"{",
"$",
"referer",
"=",
"$",
"request",
"->",
"headers",
"->",
"get",
"(",
"'referer'",
")",
";",
"return",
"$",
"this",
"->",
"blocker",
"->",
"isBlock... | Handle an incoming request.
@param \Illuminate\Http\Request $request
@param \Closure $next
@return mixed | [
"Handle",
"an",
"incoming",
"request",
"."
] | train | https://github.com/ARCANEDEV/SpamBlocker/blob/708c9d5363616e0b257451256c4ca9fb9a9ff55f/src/Http/Middleware/BlockReferralSpam.php#L51-L58 |
jelix/version | lib/Parser.php | Parser.parse | public static function parse($version, $options = array())
{
$options = array_merge(array(
'removeWildcard' => true
), $options);
// extract meta data
$vers = explode('+', $version, 2);
$metadata = '';
if (count($vers) > 1) {
$metadata = $vers... | php | public static function parse($version, $options = array())
{
$options = array_merge(array(
'removeWildcard' => true
), $options);
// extract meta data
$vers = explode('+', $version, 2);
$metadata = '';
if (count($vers) > 1) {
$metadata = $vers... | [
"public",
"static",
"function",
"parse",
"(",
"$",
"version",
",",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"$",
"options",
"=",
"array_merge",
"(",
"array",
"(",
"'removeWildcard'",
"=>",
"true",
")",
",",
"$",
"options",
")",
";",
"// extrac... | Is able to parse semantic version syntax or any other version syntax.
@param string $version
@param array $options list of options for the parser.
'removeWildcard' => true
@return Version | [
"Is",
"able",
"to",
"parse",
"semantic",
"version",
"syntax",
"or",
"any",
"other",
"version",
"syntax",
"."
] | train | https://github.com/jelix/version/blob/1bdcea2beb7943f347fb453e3106702a460d51c2/lib/Parser.php#L27-L115 |
dpi/ak | src/AvatarServiceFactory.php | AvatarServiceFactory.createService | public function createService(string $id, AvatarConfigurationInterface $configuration) : AvatarServiceInterface {
// @todo if plugin is remote, require a destination for avatars.
$metadata = $this->discovery->getMetadata($id);
// Protocol.
if (!empty($metadata->protocols)) {
$protocols = $metadat... | php | public function createService(string $id, AvatarConfigurationInterface $configuration) : AvatarServiceInterface {
// @todo if plugin is remote, require a destination for avatars.
$metadata = $this->discovery->getMetadata($id);
// Protocol.
if (!empty($metadata->protocols)) {
$protocols = $metadat... | [
"public",
"function",
"createService",
"(",
"string",
"$",
"id",
",",
"AvatarConfigurationInterface",
"$",
"configuration",
")",
":",
"AvatarServiceInterface",
"{",
"// @todo if plugin is remote, require a destination for avatars.",
"$",
"metadata",
"=",
"$",
"this",
"->",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/dpi/ak/blob/cc61b172a827498cf6284191d51ce04d0f7c0f97/src/AvatarServiceFactory.php#L35-L72 |
link0/profiler | src/Link0/Profiler/PersistenceHandler/ZendDbHandler.php | ZendDbHandler.getList | public function getList()
{
$sql = $this->getSql();
$select = $sql->select()
->columns(array($this->getIdentifierColumn()))
->from($this->getTableName())
->order(array('id' => 'asc'));
$statement = $sql->prepareStatementForSqlObject($select);
$res... | php | public function getList()
{
$sql = $this->getSql();
$select = $sql->select()
->columns(array($this->getIdentifierColumn()))
->from($this->getTableName())
->order(array('id' => 'asc'));
$statement = $sql->prepareStatementForSqlObject($select);
$res... | [
"public",
"function",
"getList",
"(",
")",
"{",
"$",
"sql",
"=",
"$",
"this",
"->",
"getSql",
"(",
")",
";",
"$",
"select",
"=",
"$",
"sql",
"->",
"select",
"(",
")",
"->",
"columns",
"(",
"array",
"(",
"$",
"this",
"->",
"getIdentifierColumn",
"("... | Returns a list of Identifier strings
Unfortunately the list() method is reserved
@return string[] | [
"Returns",
"a",
"list",
"of",
"Identifier",
"strings",
"Unfortunately",
"the",
"list",
"()",
"method",
"is",
"reserved"
] | train | https://github.com/link0/profiler/blob/0573073ff029743734de747619ab65ab2476052d/src/Link0/Profiler/PersistenceHandler/ZendDbHandler.php#L141-L158 |
link0/profiler | src/Link0/Profiler/PersistenceHandler/ZendDbHandler.php | ZendDbHandler.getTableStructure | private function getTableStructure()
{
return array(
'columns' => array(
// Unique auto-incrementing primary key
new BigInteger('id', false, null, array('auto_increment' => true, 'unsigned' => true)),
// Identifier column
new Varch... | php | private function getTableStructure()
{
return array(
'columns' => array(
// Unique auto-incrementing primary key
new BigInteger('id', false, null, array('auto_increment' => true, 'unsigned' => true)),
// Identifier column
new Varch... | [
"private",
"function",
"getTableStructure",
"(",
")",
"{",
"return",
"array",
"(",
"'columns'",
"=>",
"array",
"(",
"// Unique auto-incrementing primary key",
"new",
"BigInteger",
"(",
"'id'",
",",
"false",
",",
"null",
",",
"array",
"(",
"'auto_increment'",
"=>",... | Returns the table structure in Zend\Db\Column objects
@return array | [
"Returns",
"the",
"table",
"structure",
"in",
"Zend",
"\\",
"Db",
"\\",
"Column",
"objects"
] | train | https://github.com/link0/profiler/blob/0573073ff029743734de747619ab65ab2476052d/src/Link0/Profiler/PersistenceHandler/ZendDbHandler.php#L227-L246 |
link0/profiler | src/Link0/Profiler/PersistenceHandler/ZendDbHandler.php | ZendDbHandler.createTable | public function createTable()
{
$sql = $this->getSql();
$createTable = new CreateTable($this->getTableName());
$tableStructure = $this->getTableStructure();
foreach($tableStructure['columns'] as $column) {
$createTable->addColumn($column);
}
foreach($ta... | php | public function createTable()
{
$sql = $this->getSql();
$createTable = new CreateTable($this->getTableName());
$tableStructure = $this->getTableStructure();
foreach($tableStructure['columns'] as $column) {
$createTable->addColumn($column);
}
foreach($ta... | [
"public",
"function",
"createTable",
"(",
")",
"{",
"$",
"sql",
"=",
"$",
"this",
"->",
"getSql",
"(",
")",
";",
"$",
"createTable",
"=",
"new",
"CreateTable",
"(",
"$",
"this",
"->",
"getTableName",
"(",
")",
")",
";",
"$",
"tableStructure",
"=",
"$... | Creates the table structure for you
NOTE: This code should fully work when ZendFramework 2.4.0 is released, since then DDL supports auto_increment
@see https://github.com/zendframework/zf2/pull/6257
@return PersistenceHandlerInterface | [
"Creates",
"the",
"table",
"structure",
"for",
"you"
] | train | https://github.com/link0/profiler/blob/0573073ff029743734de747619ab65ab2476052d/src/Link0/Profiler/PersistenceHandler/ZendDbHandler.php#L256-L277 |
link0/profiler | src/Link0/Profiler/PersistenceHandler/ZendDbHandler.php | ZendDbHandler.dropTable | public function dropTable()
{
$sql = $this->getSql();
$dropTable = new DropTable($this->getTableName());
$sql->getAdapter()->query($sql->getSqlStringForSqlObject($dropTable),
Adapter::QUERY_MODE_EXECUTE
);
return $this;
} | php | public function dropTable()
{
$sql = $this->getSql();
$dropTable = new DropTable($this->getTableName());
$sql->getAdapter()->query($sql->getSqlStringForSqlObject($dropTable),
Adapter::QUERY_MODE_EXECUTE
);
return $this;
} | [
"public",
"function",
"dropTable",
"(",
")",
"{",
"$",
"sql",
"=",
"$",
"this",
"->",
"getSql",
"(",
")",
";",
"$",
"dropTable",
"=",
"new",
"DropTable",
"(",
"$",
"this",
"->",
"getTableName",
"(",
")",
")",
";",
"$",
"sql",
"->",
"getAdapter",
"(... | Drops the table structure for you
@return PersistenceHandlerInterface | [
"Drops",
"the",
"table",
"structure",
"for",
"you"
] | train | https://github.com/link0/profiler/blob/0573073ff029743734de747619ab65ab2476052d/src/Link0/Profiler/PersistenceHandler/ZendDbHandler.php#L284-L295 |
Teamsisu/contao-mm-frontendInput | src/Teamsisu/MetaModelsFrontendInput/Handler/Save/SaveHandler.php | SaveHandler.parseWidget | public function parseWidget($widget)
{
if(is_a($widget, 'Contao\FormTextArea') || is_a($widget, 'Contao\FormTextField')){
if($this->field->getEval('allowHtml')){
$value = strip_tags(\String::decodeEntities($widget->value), \Config::get('allowedTags'));
}else{
... | php | public function parseWidget($widget)
{
if(is_a($widget, 'Contao\FormTextArea') || is_a($widget, 'Contao\FormTextField')){
if($this->field->getEval('allowHtml')){
$value = strip_tags(\String::decodeEntities($widget->value), \Config::get('allowedTags'));
}else{
... | [
"public",
"function",
"parseWidget",
"(",
"$",
"widget",
")",
"{",
"if",
"(",
"is_a",
"(",
"$",
"widget",
",",
"'Contao\\FormTextArea'",
")",
"||",
"is_a",
"(",
"$",
"widget",
",",
"'Contao\\FormTextField'",
")",
")",
"{",
"if",
"(",
"$",
"this",
"->",
... | This function is for the manipulation of the attribute value
Must return the value in the format what is needed for MetaModels
@param $widget
@return mixed | [
"This",
"function",
"is",
"for",
"the",
"manipulation",
"of",
"the",
"attribute",
"value",
"Must",
"return",
"the",
"value",
"in",
"the",
"format",
"what",
"is",
"needed",
"for",
"MetaModels"
] | train | https://github.com/Teamsisu/contao-mm-frontendInput/blob/ab92e61c24644f1e61265304b6a35e505007d021/src/Teamsisu/MetaModelsFrontendInput/Handler/Save/SaveHandler.php#L61-L80 |
Teamsisu/contao-mm-frontendInput | src/Teamsisu/MetaModelsFrontendInput/Handler/Save/SaveHandler.php | SaveHandler.setValue | public function setValue($value)
{
$this->item->set($this->field->getColName(), $this->field->mmAttribute->widgetToValue($value, null));
} | php | public function setValue($value)
{
$this->item->set($this->field->getColName(), $this->field->mmAttribute->widgetToValue($value, null));
} | [
"public",
"function",
"setValue",
"(",
"$",
"value",
")",
"{",
"$",
"this",
"->",
"item",
"->",
"set",
"(",
"$",
"this",
"->",
"field",
"->",
"getColName",
"(",
")",
",",
"$",
"this",
"->",
"field",
"->",
"mmAttribute",
"->",
"widgetToValue",
"(",
"$... | Set the value of the Attribute from given MetaModels Item | [
"Set",
"the",
"value",
"of",
"the",
"Attribute",
"from",
"given",
"MetaModels",
"Item"
] | train | https://github.com/Teamsisu/contao-mm-frontendInput/blob/ab92e61c24644f1e61265304b6a35e505007d021/src/Teamsisu/MetaModelsFrontendInput/Handler/Save/SaveHandler.php#L85-L88 |
verschoof/bunq-api | src/HttpClientFactory.php | HttpClientFactory.createInstallationClient | public static function createInstallationClient($url, CertificateStorage $certificateStorage)
{
$handlerStack = HandlerStack::create();
$handlerStack->push(
Middleware::mapRequest(new RequestIdMiddleware())
);
$handlerStack->push(
Middleware::mapRequest(new Re... | php | public static function createInstallationClient($url, CertificateStorage $certificateStorage)
{
$handlerStack = HandlerStack::create();
$handlerStack->push(
Middleware::mapRequest(new RequestIdMiddleware())
);
$handlerStack->push(
Middleware::mapRequest(new Re... | [
"public",
"static",
"function",
"createInstallationClient",
"(",
"$",
"url",
",",
"CertificateStorage",
"$",
"certificateStorage",
")",
"{",
"$",
"handlerStack",
"=",
"HandlerStack",
"::",
"create",
"(",
")",
";",
"$",
"handlerStack",
"->",
"push",
"(",
"Middlew... | Creates an installation client
@param string $url
@param CertificateStorage $certificateStorage
@return ClientInterface | [
"Creates",
"an",
"installation",
"client"
] | train | https://github.com/verschoof/bunq-api/blob/df9aa19f384275f4f0deb26de0cb5e5f8b45ffcd/src/HttpClientFactory.php#L29-L40 |
verschoof/bunq-api | src/HttpClientFactory.php | HttpClientFactory.create | public static function create(
$url,
TokenService $tokenService,
CertificateStorage $certificateStorage,
InstallationService $installationService,
TokenStorage $tokenStorage
) {
$sessionToken = $tokenService->sessionToken();
$publicServerKey = $certificateS... | php | public static function create(
$url,
TokenService $tokenService,
CertificateStorage $certificateStorage,
InstallationService $installationService,
TokenStorage $tokenStorage
) {
$sessionToken = $tokenService->sessionToken();
$publicServerKey = $certificateS... | [
"public",
"static",
"function",
"create",
"(",
"$",
"url",
",",
"TokenService",
"$",
"tokenService",
",",
"CertificateStorage",
"$",
"certificateStorage",
",",
"InstallationService",
"$",
"installationService",
",",
"TokenStorage",
"$",
"tokenStorage",
")",
"{",
"$"... | Creates the HttpClient with all handlers
@param string $url
@param TokenService $tokenService
@param CertificateStorage $certificateStorage
@param InstallationService $installationService
@param TokenStorage $tokenStorage
@return ClientInterface | [
"Creates",
"the",
"HttpClient",
"with",
"all",
"handlers"
] | train | https://github.com/verschoof/bunq-api/blob/df9aa19f384275f4f0deb26de0cb5e5f8b45ffcd/src/HttpClientFactory.php#L53-L83 |
verschoof/bunq-api | src/HttpClientFactory.php | HttpClientFactory.createBaseClient | private static function createBaseClient($url, HandlerStack $handlerStack = null)
{
$httpClient = new \GuzzleHttp\Client(
[
'base_uri' => $url,
'handler' => $handlerStack,
'headers' => [
'Content-Type' => 'application/json',
... | php | private static function createBaseClient($url, HandlerStack $handlerStack = null)
{
$httpClient = new \GuzzleHttp\Client(
[
'base_uri' => $url,
'handler' => $handlerStack,
'headers' => [
'Content-Type' => 'application/json',
... | [
"private",
"static",
"function",
"createBaseClient",
"(",
"$",
"url",
",",
"HandlerStack",
"$",
"handlerStack",
"=",
"null",
")",
"{",
"$",
"httpClient",
"=",
"new",
"\\",
"GuzzleHttp",
"\\",
"Client",
"(",
"[",
"'base_uri'",
"=>",
"$",
"url",
",",
"'handl... | Returns the standard used headers.
@param string $url
@param HandlerStack|null $handlerStack
@return ClientInterface | [
"Returns",
"the",
"standard",
"used",
"headers",
"."
] | train | https://github.com/verschoof/bunq-api/blob/df9aa19f384275f4f0deb26de0cb5e5f8b45ffcd/src/HttpClientFactory.php#L93-L107 |
yoanm/php-jsonrpc-http-server-openapi-doc-sdk | src/App/Resolver/DefinitionRefResolver.php | DefinitionRefResolver.getMethodDefinitionId | public function getMethodDefinitionId(MethodDoc $method, $definitionType) : string
{
$base = 'UNKNONWN_METHOD-%s';
switch ($definitionType) {
case self::METHOD_RESULT_DEFINITION_TYPE:
$base = 'Method-%s-Result';
break;
case self::METHOD_PARAMS_... | php | public function getMethodDefinitionId(MethodDoc $method, $definitionType) : string
{
$base = 'UNKNONWN_METHOD-%s';
switch ($definitionType) {
case self::METHOD_RESULT_DEFINITION_TYPE:
$base = 'Method-%s-Result';
break;
case self::METHOD_PARAMS_... | [
"public",
"function",
"getMethodDefinitionId",
"(",
"MethodDoc",
"$",
"method",
",",
"$",
"definitionType",
")",
":",
"string",
"{",
"$",
"base",
"=",
"'UNKNONWN_METHOD-%s'",
";",
"switch",
"(",
"$",
"definitionType",
")",
"{",
"case",
"self",
"::",
"METHOD_RE... | @param MethodDoc $method
@param string $definitionType
@return string | [
"@param",
"MethodDoc",
"$method",
"@param",
"string",
"$definitionType"
] | train | https://github.com/yoanm/php-jsonrpc-http-server-openapi-doc-sdk/blob/52d6bb5d0671e0363bbf482c3c75fef97d7d1d5e/src/App/Resolver/DefinitionRefResolver.php#L23-L36 |
yoanm/php-jsonrpc-http-server-openapi-doc-sdk | src/App/Resolver/DefinitionRefResolver.php | DefinitionRefResolver.getErrorDefinitionId | public function getErrorDefinitionId(ErrorDoc $error, $definitionType) : string
{
$base = 'UNKNONWN_ERROR-%s';
switch ($definitionType) {
case self::CUSTOM_ERROR_DEFINITION_TYPE:
$base = 'Error-%s';
break;
case self::SERVER_ERROR_DEFINITION_TYP... | php | public function getErrorDefinitionId(ErrorDoc $error, $definitionType) : string
{
$base = 'UNKNONWN_ERROR-%s';
switch ($definitionType) {
case self::CUSTOM_ERROR_DEFINITION_TYPE:
$base = 'Error-%s';
break;
case self::SERVER_ERROR_DEFINITION_TYP... | [
"public",
"function",
"getErrorDefinitionId",
"(",
"ErrorDoc",
"$",
"error",
",",
"$",
"definitionType",
")",
":",
"string",
"{",
"$",
"base",
"=",
"'UNKNONWN_ERROR-%s'",
";",
"switch",
"(",
"$",
"definitionType",
")",
"{",
"case",
"self",
"::",
"CUSTOM_ERROR_... | @param ErrorDoc $error
@param string $definitionType
@return string | [
"@param",
"ErrorDoc",
"$error",
"@param",
"string",
"$definitionType"
] | train | https://github.com/yoanm/php-jsonrpc-http-server-openapi-doc-sdk/blob/52d6bb5d0671e0363bbf482c3c75fef97d7d1d5e/src/App/Resolver/DefinitionRefResolver.php#L44-L57 |
wolfguarder/yii2-gallery | controllers/AdminController.php | AdminController.findModel | protected function findModel($id)
{
$model = $this->module->manager->findGalleryById($id);
if ($model === null) {
throw new NotFoundHttpException('The requested page does not exist');
}
return $model;
} | php | protected function findModel($id)
{
$model = $this->module->manager->findGalleryById($id);
if ($model === null) {
throw new NotFoundHttpException('The requested page does not exist');
}
return $model;
} | [
"protected",
"function",
"findModel",
"(",
"$",
"id",
")",
"{",
"$",
"model",
"=",
"$",
"this",
"->",
"module",
"->",
"manager",
"->",
"findGalleryById",
"(",
"$",
"id",
")",
";",
"if",
"(",
"$",
"model",
"===",
"null",
")",
"{",
"throw",
"new",
"N... | Finds the Gallery model based on its primary key value.
If the model is not found, a 404 HTTP exception will be thrown.
@param integer $id
@return \wolfguard\gallery\models\Gallery the loaded model
@throws NotFoundHttpException if the model cannot be found | [
"Finds",
"the",
"Gallery",
"model",
"based",
"on",
"its",
"primary",
"key",
"value",
".",
"If",
"the",
"model",
"is",
"not",
"found",
"a",
"404",
"HTTP",
"exception",
"will",
"be",
"thrown",
"."
] | train | https://github.com/wolfguarder/yii2-gallery/blob/3e79f9e3764bd07322b5fed96e8d8ff1b2b3a48d/controllers/AdminController.php#L128-L137 |
wolfguarder/yii2-gallery | controllers/AdminController.php | AdminController.actionImages | public function actionImages($id)
{
$gallery = $this->findModel($id);
$searchModel = $this->module->manager->createGalleryImageSearch();
$dataProvider = $searchModel->search($_GET, $id);
return $this->render('image/index', [
'gallery' => $gallery,
'dataProv... | php | public function actionImages($id)
{
$gallery = $this->findModel($id);
$searchModel = $this->module->manager->createGalleryImageSearch();
$dataProvider = $searchModel->search($_GET, $id);
return $this->render('image/index', [
'gallery' => $gallery,
'dataProv... | [
"public",
"function",
"actionImages",
"(",
"$",
"id",
")",
"{",
"$",
"gallery",
"=",
"$",
"this",
"->",
"findModel",
"(",
"$",
"id",
")",
";",
"$",
"searchModel",
"=",
"$",
"this",
"->",
"module",
"->",
"manager",
"->",
"createGalleryImageSearch",
"(",
... | Lists all Gallery images models.
@param $id Gallery id
@return mixed | [
"Lists",
"all",
"Gallery",
"images",
"models",
"."
] | train | https://github.com/wolfguarder/yii2-gallery/blob/3e79f9e3764bd07322b5fed96e8d8ff1b2b3a48d/controllers/AdminController.php#L146-L158 |
wolfguarder/yii2-gallery | controllers/AdminController.php | AdminController.actionCreateImage | public function actionCreateImage($id)
{
$gallery = $this->findModel($id);
$model = $this->module->manager->createGalleryImage(['scenario' => 'create']);
$model->loadDefaultValues();
if ($model->load(\Yii::$app->request->post())) {
$model->gallery_id = $gallery->id;
... | php | public function actionCreateImage($id)
{
$gallery = $this->findModel($id);
$model = $this->module->manager->createGalleryImage(['scenario' => 'create']);
$model->loadDefaultValues();
if ($model->load(\Yii::$app->request->post())) {
$model->gallery_id = $gallery->id;
... | [
"public",
"function",
"actionCreateImage",
"(",
"$",
"id",
")",
"{",
"$",
"gallery",
"=",
"$",
"this",
"->",
"findModel",
"(",
"$",
"id",
")",
";",
"$",
"model",
"=",
"$",
"this",
"->",
"module",
"->",
"manager",
"->",
"createGalleryImage",
"(",
"[",
... | Create gallery image
@param $id Gallery id
@return string
@throws NotFoundHttpException | [
"Create",
"gallery",
"image"
] | train | https://github.com/wolfguarder/yii2-gallery/blob/3e79f9e3764bd07322b5fed96e8d8ff1b2b3a48d/controllers/AdminController.php#L166-L186 |
wolfguarder/yii2-gallery | controllers/AdminController.php | AdminController.actionUpdateImage | public function actionUpdateImage($id)
{
$model = $this->module->manager->findGalleryImageById($id);
if ($model === null) {
throw new NotFoundHttpException('The requested image does not exist');
}
$model->scenario = 'update';
$gallery = $this->findModel($model->g... | php | public function actionUpdateImage($id)
{
$model = $this->module->manager->findGalleryImageById($id);
if ($model === null) {
throw new NotFoundHttpException('The requested image does not exist');
}
$model->scenario = 'update';
$gallery = $this->findModel($model->g... | [
"public",
"function",
"actionUpdateImage",
"(",
"$",
"id",
")",
"{",
"$",
"model",
"=",
"$",
"this",
"->",
"module",
"->",
"manager",
"->",
"findGalleryImageById",
"(",
"$",
"id",
")",
";",
"if",
"(",
"$",
"model",
"===",
"null",
")",
"{",
"throw",
"... | Updates an existing GalleryImage model.
If update is successful, the browser will be redirected to the 'images' page.
@param integer $id
@return mixed
@throws NotFoundHttpException | [
"Updates",
"an",
"existing",
"GalleryImage",
"model",
".",
"If",
"update",
"is",
"successful",
"the",
"browser",
"will",
"be",
"redirected",
"to",
"the",
"images",
"page",
"."
] | train | https://github.com/wolfguarder/yii2-gallery/blob/3e79f9e3764bd07322b5fed96e8d8ff1b2b3a48d/controllers/AdminController.php#L196-L220 |
wolfguarder/yii2-gallery | controllers/AdminController.php | AdminController.actionDeleteImage | public function actionDeleteImage($id)
{
$model = $this->module->manager->findGalleryImageById($id);
if ($model === null) {
throw new NotFoundHttpException('The requested page does not exist');
}
$model->delete();
\Yii::$app->getSession()->setFlash('gallery.succ... | php | public function actionDeleteImage($id)
{
$model = $this->module->manager->findGalleryImageById($id);
if ($model === null) {
throw new NotFoundHttpException('The requested page does not exist');
}
$model->delete();
\Yii::$app->getSession()->setFlash('gallery.succ... | [
"public",
"function",
"actionDeleteImage",
"(",
"$",
"id",
")",
"{",
"$",
"model",
"=",
"$",
"this",
"->",
"module",
"->",
"manager",
"->",
"findGalleryImageById",
"(",
"$",
"id",
")",
";",
"if",
"(",
"$",
"model",
"===",
"null",
")",
"{",
"throw",
"... | Deletes an existing GalleryImage model.
If deletion is successful, the browser will be redirected to the 'images' page.
@param integer $id
@return \yii\web\Response
@throws NotFoundHttpException
@throws \Exception | [
"Deletes",
"an",
"existing",
"GalleryImage",
"model",
".",
"If",
"deletion",
"is",
"successful",
"the",
"browser",
"will",
"be",
"redirected",
"to",
"the",
"images",
"page",
"."
] | train | https://github.com/wolfguarder/yii2-gallery/blob/3e79f9e3764bd07322b5fed96e8d8ff1b2b3a48d/controllers/AdminController.php#L231-L243 |
yosmanyga/resource | src/Yosmanyga/Resource/Util/DocParser.php | DocParser.parse | public function parse($file, $annotationName = null)
{
$data = [];
$class = $this->findClass($file);
$ref = new \ReflectionClass($class);
$annotations = $this->resolveAnnotations($ref->getDocComment());
foreach ($annotations as $annotation) {
if (!$annotationName ... | php | public function parse($file, $annotationName = null)
{
$data = [];
$class = $this->findClass($file);
$ref = new \ReflectionClass($class);
$annotations = $this->resolveAnnotations($ref->getDocComment());
foreach ($annotations as $annotation) {
if (!$annotationName ... | [
"public",
"function",
"parse",
"(",
"$",
"file",
",",
"$",
"annotationName",
"=",
"null",
")",
"{",
"$",
"data",
"=",
"[",
"]",
";",
"$",
"class",
"=",
"$",
"this",
"->",
"findClass",
"(",
"$",
"file",
")",
";",
"$",
"ref",
"=",
"new",
"\\",
"R... | {@inheritdoc} | [
"{"
] | train | https://github.com/yosmanyga/resource/blob/a8b505c355920a908917a0484f764ddfa63205fa/src/Yosmanyga/Resource/Util/DocParser.php#L12-L64 |
yosmanyga/resource | src/Yosmanyga/Resource/Util/DocParser.php | DocParser.findClass | private function findClass($file)
{
$class = false;
$namespace = false;
$tokens = token_get_all(file_get_contents($file));
for ($i = 0, $count = count($tokens); $i < $count; $i++) {
$token = $tokens[$i];
if (!is_array($token)) {
continue;
... | php | private function findClass($file)
{
$class = false;
$namespace = false;
$tokens = token_get_all(file_get_contents($file));
for ($i = 0, $count = count($tokens); $i < $count; $i++) {
$token = $tokens[$i];
if (!is_array($token)) {
continue;
... | [
"private",
"function",
"findClass",
"(",
"$",
"file",
")",
"{",
"$",
"class",
"=",
"false",
";",
"$",
"namespace",
"=",
"false",
";",
"$",
"tokens",
"=",
"token_get_all",
"(",
"file_get_contents",
"(",
"$",
"file",
")",
")",
";",
"for",
"(",
"$",
"i"... | Copied from Symfony/Component/Routing/Loader/AnnotationFileLoader.php.
@author Fabien Potencier <fabien@symfony.com>
Returns the full class name for the first class in the file.
@param string $file A PHP file path
@codeCoverageIgnore
@return string|false Full class name if found, false otherwise | [
"Copied",
"from",
"Symfony",
"/",
"Component",
"/",
"Routing",
"/",
"Loader",
"/",
"AnnotationFileLoader",
".",
"php",
"."
] | train | https://github.com/yosmanyga/resource/blob/a8b505c355920a908917a0484f764ddfa63205fa/src/Yosmanyga/Resource/Util/DocParser.php#L78-L112 |
yosmanyga/resource | src/Yosmanyga/Resource/Util/DocParser.php | DocParser.resolveAnnotations | private function resolveAnnotations($comment)
{
if (!$comment) {
return [];
}
$comment = $this->cleanAnnotations($comment);
$annotations = $this->splitAnnotations($comment);
$annotations = $this->cleanContents($annotations);
$annotations = $this->parseAnn... | php | private function resolveAnnotations($comment)
{
if (!$comment) {
return [];
}
$comment = $this->cleanAnnotations($comment);
$annotations = $this->splitAnnotations($comment);
$annotations = $this->cleanContents($annotations);
$annotations = $this->parseAnn... | [
"private",
"function",
"resolveAnnotations",
"(",
"$",
"comment",
")",
"{",
"if",
"(",
"!",
"$",
"comment",
")",
"{",
"return",
"[",
"]",
";",
"}",
"$",
"comment",
"=",
"$",
"this",
"->",
"cleanAnnotations",
"(",
"$",
"comment",
")",
";",
"$",
"annot... | @param string $comment
@return array | [
"@param",
"string",
"$comment"
] | train | https://github.com/yosmanyga/resource/blob/a8b505c355920a908917a0484f764ddfa63205fa/src/Yosmanyga/Resource/Util/DocParser.php#L119-L131 |
yosmanyga/resource | src/Yosmanyga/Resource/Util/DocParser.php | DocParser.cleanAnnotations | private function cleanAnnotations($comment)
{
$comment = trim(
preg_replace(
'#[ \t]*(?:\/\*\*|\*\/|\*)?[ \t]{0,1}(.*)?#u',
'$1',
$comment
)
);
// reg ex above is not able to remove */ from a single line docblock
... | php | private function cleanAnnotations($comment)
{
$comment = trim(
preg_replace(
'#[ \t]*(?:\/\*\*|\*\/|\*)?[ \t]{0,1}(.*)?#u',
'$1',
$comment
)
);
// reg ex above is not able to remove */ from a single line docblock
... | [
"private",
"function",
"cleanAnnotations",
"(",
"$",
"comment",
")",
"{",
"$",
"comment",
"=",
"trim",
"(",
"preg_replace",
"(",
"'#[ \\t]*(?:\\/\\*\\*|\\*\\/|\\*)?[ \\t]{0,1}(.*)?#u'",
",",
"'$1'",
",",
"$",
"comment",
")",
")",
";",
"// reg ex above is not able to r... | Copied from phpDocumentor/ReflectionDocBlock/src/phpDocumentor/Reflection/DocBlock.php::cleanInput.
@codeCoverageIgnore | [
"Copied",
"from",
"phpDocumentor",
"/",
"ReflectionDocBlock",
"/",
"src",
"/",
"phpDocumentor",
"/",
"Reflection",
"/",
"DocBlock",
".",
"php",
"::",
"cleanInput",
"."
] | train | https://github.com/yosmanyga/resource/blob/a8b505c355920a908917a0484f764ddfa63205fa/src/Yosmanyga/Resource/Util/DocParser.php#L138-L157 |
gregorybesson/PlaygroundCore | src/Controller/Admin/ElfinderController.php | ElfinderController.access | public function access($attr, $path, $data, $volume)
{
return strpos(basename($path), '.') === 0
? !($attr == 'read' || $attr == 'write')
: null;
} | php | public function access($attr, $path, $data, $volume)
{
return strpos(basename($path), '.') === 0
? !($attr == 'read' || $attr == 'write')
: null;
} | [
"public",
"function",
"access",
"(",
"$",
"attr",
",",
"$",
"path",
",",
"$",
"data",
",",
"$",
"volume",
")",
"{",
"return",
"strpos",
"(",
"basename",
"(",
"$",
"path",
")",
",",
"'.'",
")",
"===",
"0",
"?",
"!",
"(",
"$",
"attr",
"==",
"'rea... | @param $attr
@param $path
@param $data
@param $volume
@return bool|null | [
"@param",
"$attr",
"@param",
"$path",
"@param",
"$data",
"@param",
"$volume"
] | train | https://github.com/gregorybesson/PlaygroundCore/blob/f8dfa4c7660b54354933b3c28c0cf35304a649df/src/Controller/Admin/ElfinderController.php#L91-L96 |
WellCommerce/OrderBundle | Controller/Front/AddressController.php | AddressController.copyShippingAddress | protected function copyShippingAddress(ParameterBag $parameters)
{
$billingAddress = $parameters->get('billingAddress');
$shippingAddress = [
'shippingAddress.copyBillingAddress' => true,
];
foreach ($billingAddress as $key => $value) {
list(... | php | protected function copyShippingAddress(ParameterBag $parameters)
{
$billingAddress = $parameters->get('billingAddress');
$shippingAddress = [
'shippingAddress.copyBillingAddress' => true,
];
foreach ($billingAddress as $key => $value) {
list(... | [
"protected",
"function",
"copyShippingAddress",
"(",
"ParameterBag",
"$",
"parameters",
")",
"{",
"$",
"billingAddress",
"=",
"$",
"parameters",
"->",
"get",
"(",
"'billingAddress'",
")",
";",
"$",
"shippingAddress",
"=",
"[",
"'shippingAddress.copyBillingAddress'",
... | Copies billing address to shipping address
@param ParameterBag $parameters | [
"Copies",
"billing",
"address",
"to",
"shipping",
"address"
] | train | https://github.com/WellCommerce/OrderBundle/blob/d72cfb51eab7a1f66f186900d1e2d533a822c424/Controller/Front/AddressController.php#L97-L111 |
prooph/link-app-core | src/Service/SystemConfigFactory.php | SystemConfigFactory.createService | public function createService(ServiceLocatorInterface $serviceLocator)
{
return \Prooph\Link\Application\Model\ProcessingConfig::asProjectionFrom($serviceLocator->get('prooph.link.app.config_location'));
} | php | public function createService(ServiceLocatorInterface $serviceLocator)
{
return \Prooph\Link\Application\Model\ProcessingConfig::asProjectionFrom($serviceLocator->get('prooph.link.app.config_location'));
} | [
"public",
"function",
"createService",
"(",
"ServiceLocatorInterface",
"$",
"serviceLocator",
")",
"{",
"return",
"\\",
"Prooph",
"\\",
"Link",
"\\",
"Application",
"\\",
"Model",
"\\",
"ProcessingConfig",
"::",
"asProjectionFrom",
"(",
"$",
"serviceLocator",
"->",
... | Create service
@param ServiceLocatorInterface $serviceLocator
@return mixed | [
"Create",
"service"
] | train | https://github.com/prooph/link-app-core/blob/835a5945dfa7be7b2cebfa6e84e757ecfd783357/src/Service/SystemConfigFactory.php#L32-L35 |
EcomDev/phpspec-magento-di-adapter | src/Runner/CollaboratorMaintainer.php | CollaboratorMaintainer.prepare | public function prepare(
ExampleNode $example,
Specification $context,
MatcherManager $matchers,
CollaboratorManager $collaborators
) {
if ($example->getSpecification()->getClassReflection()->hasMethod('let')) {
$this->parameterValidator->validate($example->getSpe... | php | public function prepare(
ExampleNode $example,
Specification $context,
MatcherManager $matchers,
CollaboratorManager $collaborators
) {
if ($example->getSpecification()->getClassReflection()->hasMethod('let')) {
$this->parameterValidator->validate($example->getSpe... | [
"public",
"function",
"prepare",
"(",
"ExampleNode",
"$",
"example",
",",
"Specification",
"$",
"context",
",",
"MatcherManager",
"$",
"matchers",
",",
"CollaboratorManager",
"$",
"collaborators",
")",
"{",
"if",
"(",
"$",
"example",
"->",
"getSpecification",
"(... | Generates DI related stuff via parameter validator
@param ExampleNode $example
@param Specification $context
@param MatcherManager $matchers
@param CollaboratorManager $collaborators
@return $this | [
"Generates",
"DI",
"related",
"stuff",
"via",
"parameter",
"validator"
] | train | https://github.com/EcomDev/phpspec-magento-di-adapter/blob/b39f6f0afbb837dbf0eb4c71e6cdb318b8c9de37/src/Runner/CollaboratorMaintainer.php#L56-L67 |
EcomDev/phpspec-magento-di-adapter | src/Runner/CollaboratorMaintainer.php | CollaboratorMaintainer.teardown | public function teardown(
ExampleNode $example,
Specification $context,
MatcherManager $matchers,
CollaboratorManager $collaborators
) {
return $this;
} | php | public function teardown(
ExampleNode $example,
Specification $context,
MatcherManager $matchers,
CollaboratorManager $collaborators
) {
return $this;
} | [
"public",
"function",
"teardown",
"(",
"ExampleNode",
"$",
"example",
",",
"Specification",
"$",
"context",
",",
"MatcherManager",
"$",
"matchers",
",",
"CollaboratorManager",
"$",
"collaborators",
")",
"{",
"return",
"$",
"this",
";",
"}"
] | It does nothing on teardown...
@param ExampleNode $example
@param Specification $context
@param MatcherManager $matchers
@param CollaboratorManager $collaborators
@return $this | [
"It",
"does",
"nothing",
"on",
"teardown",
"..."
] | train | https://github.com/EcomDev/phpspec-magento-di-adapter/blob/b39f6f0afbb837dbf0eb4c71e6cdb318b8c9de37/src/Runner/CollaboratorMaintainer.php#L79-L87 |
czim/laravel-pxlcms | src/Generator/Analyzer/AnalyzerContext.php | AnalyzerContext.normalizeCmsDatabaseString | public function normalizeCmsDatabaseString($string, $spaceSubstitute = '_')
{
$string = html_entity_decode($string);
$string = mb_convert_encoding($string, "ISO-8859-1", 'UTF-8');
$string = preg_replace('#\s+#', $spaceSubstitute, $string);
$string = $this->normalizeCmsAccents($str... | php | public function normalizeCmsDatabaseString($string, $spaceSubstitute = '_')
{
$string = html_entity_decode($string);
$string = mb_convert_encoding($string, "ISO-8859-1", 'UTF-8');
$string = preg_replace('#\s+#', $spaceSubstitute, $string);
$string = $this->normalizeCmsAccents($str... | [
"public",
"function",
"normalizeCmsDatabaseString",
"(",
"$",
"string",
",",
"$",
"spaceSubstitute",
"=",
"'_'",
")",
"{",
"$",
"string",
"=",
"html_entity_decode",
"(",
"$",
"string",
")",
";",
"$",
"string",
"=",
"mb_convert_encoding",
"(",
"$",
"string",
... | Normalizes a string (name) to a database field or table name in the
same way the PXL CMS does this.
@param string $string
@param string $spaceSubstitute what to replace spaces with
@return string | [
"Normalizes",
"a",
"string",
"(",
"name",
")",
"to",
"a",
"database",
"field",
"or",
"table",
"name",
"in",
"the",
"same",
"way",
"the",
"PXL",
"CMS",
"does",
"this",
"."
] | train | https://github.com/czim/laravel-pxlcms/blob/910297d2a3f2db86dde51b0e10fe5aad45f1aa1a/src/Generator/Analyzer/AnalyzerContext.php#L111-L129 |
czim/laravel-pxlcms | src/Generator/Analyzer/AnalyzerContext.php | AnalyzerContext.normalizeCmsAccents | public function normalizeCmsAccents($string)
{
$string = htmlentities($string, ENT_COMPAT | (defined('ENT_HTML401') ? ENT_HTML401 : 0), 'ISO-8859-1');
$string = preg_replace('#&([a-zA-Z])(uml|acute|grave|circ|tilde|slash|cedil|ring|caron);#','$1',$string);
$string = preg_replace('#&(ae|AE)... | php | public function normalizeCmsAccents($string)
{
$string = htmlentities($string, ENT_COMPAT | (defined('ENT_HTML401') ? ENT_HTML401 : 0), 'ISO-8859-1');
$string = preg_replace('#&([a-zA-Z])(uml|acute|grave|circ|tilde|slash|cedil|ring|caron);#','$1',$string);
$string = preg_replace('#&(ae|AE)... | [
"public",
"function",
"normalizeCmsAccents",
"(",
"$",
"string",
")",
"{",
"$",
"string",
"=",
"htmlentities",
"(",
"$",
"string",
",",
"ENT_COMPAT",
"|",
"(",
"defined",
"(",
"'ENT_HTML401'",
")",
"?",
"ENT_HTML401",
":",
"0",
")",
",",
"'ISO-8859-1'",
")... | Normalize accents just like the CMS does
@param string $string
@return string | [
"Normalize",
"accents",
"just",
"like",
"the",
"CMS",
"does"
] | train | https://github.com/czim/laravel-pxlcms/blob/910297d2a3f2db86dde51b0e10fe5aad45f1aa1a/src/Generator/Analyzer/AnalyzerContext.php#L137-L150 |
dragosprotung/stc-core | src/Workout/Dumper/GPX.php | GPX.dump | public function dump(Workout $workout): string
{
$xmlWriter = new \XMLWriter();
$xmlWriter->openMemory();
$xmlWriter->setIndent(true);
$xmlWriter->startDocument('1.0', 'UTF-8');
$xmlWriter->startElement('gpx');
$xmlWriter->writeAttribute('version', '1.1');
$x... | php | public function dump(Workout $workout): string
{
$xmlWriter = new \XMLWriter();
$xmlWriter->openMemory();
$xmlWriter->setIndent(true);
$xmlWriter->startDocument('1.0', 'UTF-8');
$xmlWriter->startElement('gpx');
$xmlWriter->writeAttribute('version', '1.1');
$x... | [
"public",
"function",
"dump",
"(",
"Workout",
"$",
"workout",
")",
":",
"string",
"{",
"$",
"xmlWriter",
"=",
"new",
"\\",
"XMLWriter",
"(",
")",
";",
"$",
"xmlWriter",
"->",
"openMemory",
"(",
")",
";",
"$",
"xmlWriter",
"->",
"setIndent",
"(",
"true"... | {@inheritdoc} | [
"{"
] | train | https://github.com/dragosprotung/stc-core/blob/9783e3414294f4ee555a1d538d2807269deeb9e7/src/Workout/Dumper/GPX.php#L20-L53 |
dragosprotung/stc-core | src/Workout/Dumper/GPX.php | GPX.writeTracks | private function writeTracks(\XMLWriter $xmlWriter, Workout $workout)
{
foreach ($workout->tracks() as $track) {
$xmlWriter->startElement('trk');
$xmlWriter->writeElement('type', $track->sport());
$xmlWriter->startElement('trkseg');
$this->writeTrackPoints($xm... | php | private function writeTracks(\XMLWriter $xmlWriter, Workout $workout)
{
foreach ($workout->tracks() as $track) {
$xmlWriter->startElement('trk');
$xmlWriter->writeElement('type', $track->sport());
$xmlWriter->startElement('trkseg');
$this->writeTrackPoints($xm... | [
"private",
"function",
"writeTracks",
"(",
"\\",
"XMLWriter",
"$",
"xmlWriter",
",",
"Workout",
"$",
"workout",
")",
"{",
"foreach",
"(",
"$",
"workout",
"->",
"tracks",
"(",
")",
"as",
"$",
"track",
")",
"{",
"$",
"xmlWriter",
"->",
"startElement",
"(",... | Write the tracks to the GPX.
@param \XMLWriter $xmlWriter The XML writer.
@param Workout $workout The workout. | [
"Write",
"the",
"tracks",
"to",
"the",
"GPX",
"."
] | train | https://github.com/dragosprotung/stc-core/blob/9783e3414294f4ee555a1d538d2807269deeb9e7/src/Workout/Dumper/GPX.php#L61-L71 |
dragosprotung/stc-core | src/Workout/Dumper/GPX.php | GPX.writeTrackPoints | private function writeTrackPoints(\XMLWriter $xmlWriter, array $trackPoints)
{
foreach ($trackPoints as $trackPoint) {
$xmlWriter->startElement('trkpt');
// Location.
$xmlWriter->writeAttribute('lat', (string)$trackPoint->latitude());
$xmlWriter->writeAttribu... | php | private function writeTrackPoints(\XMLWriter $xmlWriter, array $trackPoints)
{
foreach ($trackPoints as $trackPoint) {
$xmlWriter->startElement('trkpt');
// Location.
$xmlWriter->writeAttribute('lat', (string)$trackPoint->latitude());
$xmlWriter->writeAttribu... | [
"private",
"function",
"writeTrackPoints",
"(",
"\\",
"XMLWriter",
"$",
"xmlWriter",
",",
"array",
"$",
"trackPoints",
")",
"{",
"foreach",
"(",
"$",
"trackPoints",
"as",
"$",
"trackPoint",
")",
"{",
"$",
"xmlWriter",
"->",
"startElement",
"(",
"'trkpt'",
")... | Write the track points to the GPX.
@param \XMLWriter $xmlWriter The XML writer.
@param TrackPoint[] $trackPoints The track points to write. | [
"Write",
"the",
"track",
"points",
"to",
"the",
"GPX",
"."
] | train | https://github.com/dragosprotung/stc-core/blob/9783e3414294f4ee555a1d538d2807269deeb9e7/src/Workout/Dumper/GPX.php#L79-L101 |
dragosprotung/stc-core | src/Workout/Dumper/GPX.php | GPX.writeExtensions | protected function writeExtensions(\XMLWriter $xmlWriter, array $extensions)
{
$xmlWriter->startElement('extensions');
foreach ($extensions as $extension) {
switch ($extension::ID()) {
case HR::ID():
$xmlWriter->startElementNs('gpxtpx', 'TrackPointExte... | php | protected function writeExtensions(\XMLWriter $xmlWriter, array $extensions)
{
$xmlWriter->startElement('extensions');
foreach ($extensions as $extension) {
switch ($extension::ID()) {
case HR::ID():
$xmlWriter->startElementNs('gpxtpx', 'TrackPointExte... | [
"protected",
"function",
"writeExtensions",
"(",
"\\",
"XMLWriter",
"$",
"xmlWriter",
",",
"array",
"$",
"extensions",
")",
"{",
"$",
"xmlWriter",
"->",
"startElement",
"(",
"'extensions'",
")",
";",
"foreach",
"(",
"$",
"extensions",
"as",
"$",
"extension",
... | Write the extensions into the GPX.
@param \XMLWriter $xmlWriter The XMLWriter.
@param ExtensionInterface[] $extensions The extensions to write. | [
"Write",
"the",
"extensions",
"into",
"the",
"GPX",
"."
] | train | https://github.com/dragosprotung/stc-core/blob/9783e3414294f4ee555a1d538d2807269deeb9e7/src/Workout/Dumper/GPX.php#L109-L122 |
dragosprotung/stc-core | src/Workout/Dumper/GPX.php | GPX.writeMetaData | protected function writeMetaData(\XMLWriter $xmlWriter, Workout $workout)
{
$xmlWriter->startElement('metadata');
if ($workout->author() !== null) {
$xmlWriter->startElement('author');
$xmlWriter->writeElement('name', $workout->author()->name());
$xmlWriter->endEl... | php | protected function writeMetaData(\XMLWriter $xmlWriter, Workout $workout)
{
$xmlWriter->startElement('metadata');
if ($workout->author() !== null) {
$xmlWriter->startElement('author');
$xmlWriter->writeElement('name', $workout->author()->name());
$xmlWriter->endEl... | [
"protected",
"function",
"writeMetaData",
"(",
"\\",
"XMLWriter",
"$",
"xmlWriter",
",",
"Workout",
"$",
"workout",
")",
"{",
"$",
"xmlWriter",
"->",
"startElement",
"(",
"'metadata'",
")",
";",
"if",
"(",
"$",
"workout",
"->",
"author",
"(",
")",
"!==",
... | Write the metadata in the GPX.
@param \XMLWriter $xmlWriter The XML writer.
@param Workout $workout The workout. | [
"Write",
"the",
"metadata",
"in",
"the",
"GPX",
"."
] | train | https://github.com/dragosprotung/stc-core/blob/9783e3414294f4ee555a1d538d2807269deeb9e7/src/Workout/Dumper/GPX.php#L130-L139 |
phpalchemy/cerberus | src/Alchemy/Component/Cerberus/Model/Base/Log.php | Log.hydrate | public function hydrate($row, $startcol = 0, $rehydrate = false, $indexType = TableMap::TYPE_NUM)
{
try {
$col = $row[TableMap::TYPE_NUM == $indexType ? 0 + $startcol : LogTableMap::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)];
$this->id = (null !== $col) ? (int) $c... | php | public function hydrate($row, $startcol = 0, $rehydrate = false, $indexType = TableMap::TYPE_NUM)
{
try {
$col = $row[TableMap::TYPE_NUM == $indexType ? 0 + $startcol : LogTableMap::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)];
$this->id = (null !== $col) ? (int) $c... | [
"public",
"function",
"hydrate",
"(",
"$",
"row",
",",
"$",
"startcol",
"=",
"0",
",",
"$",
"rehydrate",
"=",
"false",
",",
"$",
"indexType",
"=",
"TableMap",
"::",
"TYPE_NUM",
")",
"{",
"try",
"{",
"$",
"col",
"=",
"$",
"row",
"[",
"TableMap",
"::... | Hydrates (populates) the object variables with values from the database resultset.
An offset (0-based "start column") is specified so that objects can be hydrated
with a subset of the columns in the resultset rows. This is needed, for example,
for results of JOIN queries where the resultset row includes columns from ... | [
"Hydrates",
"(",
"populates",
")",
"the",
"object",
"variables",
"with",
"values",
"from",
"the",
"database",
"resultset",
"."
] | train | https://github.com/phpalchemy/cerberus/blob/3424a360c9bded71eb5b570bc114a7759cb23ec6/src/Alchemy/Component/Cerberus/Model/Base/Log.php#L500-L552 |
phpalchemy/cerberus | src/Alchemy/Component/Cerberus/Model/Base/Log.php | Log.setType | public function setType($v)
{
if ($v !== null) {
$v = (string) $v;
}
if ($this->type !== $v) {
$this->type = $v;
$this->modifiedColumns[LogTableMap::COL_TYPE] = true;
}
return $this;
} | php | public function setType($v)
{
if ($v !== null) {
$v = (string) $v;
}
if ($this->type !== $v) {
$this->type = $v;
$this->modifiedColumns[LogTableMap::COL_TYPE] = true;
}
return $this;
} | [
"public",
"function",
"setType",
"(",
"$",
"v",
")",
"{",
"if",
"(",
"$",
"v",
"!==",
"null",
")",
"{",
"$",
"v",
"=",
"(",
"string",
")",
"$",
"v",
";",
"}",
"if",
"(",
"$",
"this",
"->",
"type",
"!==",
"$",
"v",
")",
"{",
"$",
"this",
"... | Set the value of [type] column.
@param string $v new value
@return $this|\Alchemy\Component\Cerberus\Model\Log The current object (for fluent API support) | [
"Set",
"the",
"value",
"of",
"[",
"type",
"]",
"column",
"."
] | train | https://github.com/phpalchemy/cerberus/blob/3424a360c9bded71eb5b570bc114a7759cb23ec6/src/Alchemy/Component/Cerberus/Model/Base/Log.php#L597-L609 |
phpalchemy/cerberus | src/Alchemy/Component/Cerberus/Model/Base/Log.php | Log.setLogText | public function setLogText($v)
{
if ($v !== null) {
$v = (string) $v;
}
if ($this->log_text !== $v) {
$this->log_text = $v;
$this->modifiedColumns[LogTableMap::COL_LOG_TEXT] = true;
}
return $this;
} | php | public function setLogText($v)
{
if ($v !== null) {
$v = (string) $v;
}
if ($this->log_text !== $v) {
$this->log_text = $v;
$this->modifiedColumns[LogTableMap::COL_LOG_TEXT] = true;
}
return $this;
} | [
"public",
"function",
"setLogText",
"(",
"$",
"v",
")",
"{",
"if",
"(",
"$",
"v",
"!==",
"null",
")",
"{",
"$",
"v",
"=",
"(",
"string",
")",
"$",
"v",
";",
"}",
"if",
"(",
"$",
"this",
"->",
"log_text",
"!==",
"$",
"v",
")",
"{",
"$",
"thi... | Set the value of [log_text] column.
@param string $v new value
@return $this|\Alchemy\Component\Cerberus\Model\Log The current object (for fluent API support) | [
"Set",
"the",
"value",
"of",
"[",
"log_text",
"]",
"column",
"."
] | train | https://github.com/phpalchemy/cerberus/blob/3424a360c9bded71eb5b570bc114a7759cb23ec6/src/Alchemy/Component/Cerberus/Model/Base/Log.php#L637-L649 |
phpalchemy/cerberus | src/Alchemy/Component/Cerberus/Model/Base/Log.php | Log.setClientAddress | public function setClientAddress($v)
{
if ($v !== null) {
$v = (string) $v;
}
if ($this->client_address !== $v) {
$this->client_address = $v;
$this->modifiedColumns[LogTableMap::COL_CLIENT_ADDRESS] = true;
}
return $this;
} | php | public function setClientAddress($v)
{
if ($v !== null) {
$v = (string) $v;
}
if ($this->client_address !== $v) {
$this->client_address = $v;
$this->modifiedColumns[LogTableMap::COL_CLIENT_ADDRESS] = true;
}
return $this;
} | [
"public",
"function",
"setClientAddress",
"(",
"$",
"v",
")",
"{",
"if",
"(",
"$",
"v",
"!==",
"null",
")",
"{",
"$",
"v",
"=",
"(",
"string",
")",
"$",
"v",
";",
"}",
"if",
"(",
"$",
"this",
"->",
"client_address",
"!==",
"$",
"v",
")",
"{",
... | Set the value of [client_address] column.
@param string $v new value
@return $this|\Alchemy\Component\Cerberus\Model\Log The current object (for fluent API support) | [
"Set",
"the",
"value",
"of",
"[",
"client_address",
"]",
"column",
"."
] | train | https://github.com/phpalchemy/cerberus/blob/3424a360c9bded71eb5b570bc114a7759cb23ec6/src/Alchemy/Component/Cerberus/Model/Base/Log.php#L717-L729 |
phpalchemy/cerberus | src/Alchemy/Component/Cerberus/Model/Base/Log.php | Log.buildCriteria | public function buildCriteria()
{
$criteria = new Criteria(LogTableMap::DATABASE_NAME);
if ($this->isColumnModified(LogTableMap::COL_ID)) {
$criteria->add(LogTableMap::COL_ID, $this->id);
}
if ($this->isColumnModified(LogTableMap::COL_TYPE)) {
$criteria->add(... | php | public function buildCriteria()
{
$criteria = new Criteria(LogTableMap::DATABASE_NAME);
if ($this->isColumnModified(LogTableMap::COL_ID)) {
$criteria->add(LogTableMap::COL_ID, $this->id);
}
if ($this->isColumnModified(LogTableMap::COL_TYPE)) {
$criteria->add(... | [
"public",
"function",
"buildCriteria",
"(",
")",
"{",
"$",
"criteria",
"=",
"new",
"Criteria",
"(",
"LogTableMap",
"::",
"DATABASE_NAME",
")",
";",
"if",
"(",
"$",
"this",
"->",
"isColumnModified",
"(",
"LogTableMap",
"::",
"COL_ID",
")",
")",
"{",
"$",
... | Build a Criteria object containing the values of all modified columns in this object.
@return Criteria The Criteria object containing all modified values. | [
"Build",
"a",
"Criteria",
"object",
"containing",
"the",
"values",
"of",
"all",
"modified",
"columns",
"in",
"this",
"object",
"."
] | train | https://github.com/phpalchemy/cerberus/blob/3424a360c9bded71eb5b570bc114a7759cb23ec6/src/Alchemy/Component/Cerberus/Model/Base/Log.php#L1337-L1376 |
phpalchemy/cerberus | src/Alchemy/Component/Cerberus/Model/Base/Log.php | Log.copyInto | public function copyInto($copyObj, $deepCopy = false, $makeNew = true)
{
$copyObj->setType($this->getType());
$copyObj->setDateTime($this->getDateTime());
$copyObj->setLogText($this->getLogText());
$copyObj->setUserId($this->getUserId());
$copyObj->setUsername($this->getUsern... | php | public function copyInto($copyObj, $deepCopy = false, $makeNew = true)
{
$copyObj->setType($this->getType());
$copyObj->setDateTime($this->getDateTime());
$copyObj->setLogText($this->getLogText());
$copyObj->setUserId($this->getUserId());
$copyObj->setUsername($this->getUsern... | [
"public",
"function",
"copyInto",
"(",
"$",
"copyObj",
",",
"$",
"deepCopy",
"=",
"false",
",",
"$",
"makeNew",
"=",
"true",
")",
"{",
"$",
"copyObj",
"->",
"setType",
"(",
"$",
"this",
"->",
"getType",
"(",
")",
")",
";",
"$",
"copyObj",
"->",
"se... | Sets contents of passed object to values from current object.
If desired, this method can also make copies of all associated (fkey referrers)
objects.
@param object $copyObj An object of \Alchemy\Component\Cerberus\Model\Log (or compatible) type.
@param boolean $deepCopy Whether to also copy all rows that r... | [
"Sets",
"contents",
"of",
"passed",
"object",
"to",
"values",
"from",
"current",
"object",
"."
] | train | https://github.com/phpalchemy/cerberus/blob/3424a360c9bded71eb5b570bc114a7759cb23ec6/src/Alchemy/Component/Cerberus/Model/Base/Log.php#L1458-L1474 |
larakit/lk-staticfiles | src/StaticFiles/Package.php | Package.usePackage | function usePackage($package, $scopes = []) {
foreach((array) $scopes as $scope) {
Manager::package($package)
->deferredScope($scope);
}
$this->require[$package] = $package;
return $this;
} | php | function usePackage($package, $scopes = []) {
foreach((array) $scopes as $scope) {
Manager::package($package)
->deferredScope($scope);
}
$this->require[$package] = $package;
return $this;
} | [
"function",
"usePackage",
"(",
"$",
"package",
",",
"$",
"scopes",
"=",
"[",
"]",
")",
"{",
"foreach",
"(",
"(",
"array",
")",
"$",
"scopes",
"as",
"$",
"scope",
")",
"{",
"Manager",
"::",
"package",
"(",
"$",
"package",
")",
"->",
"deferredScope",
... | Добавить пакет, от которого есть зависимость
@param $package
@return $this | [
"Добавить",
"пакет",
"от",
"которого",
"есть",
"зависимость"
] | train | https://github.com/larakit/lk-staticfiles/blob/1ee718b1f3a00c29c46b06c2f501413599b0335a/src/StaticFiles/Package.php#L37-L45 |
larakit/lk-staticfiles | src/StaticFiles/Package.php | Package.js | function js($js, $condition = null, $no_build = false) {
$this->js[$js] = compact('condition', 'no_build');
return $this;
} | php | function js($js, $condition = null, $no_build = false) {
$this->js[$js] = compact('condition', 'no_build');
return $this;
} | [
"function",
"js",
"(",
"$",
"js",
",",
"$",
"condition",
"=",
"null",
",",
"$",
"no_build",
"=",
"false",
")",
"{",
"$",
"this",
"->",
"js",
"[",
"$",
"js",
"]",
"=",
"compact",
"(",
"'condition'",
",",
"'no_build'",
")",
";",
"return",
"$",
"thi... | Добавить внешний JS
@param $js
@param null $condition
@param bool $no_build
@return $this | [
"Добавить",
"внешний",
"JS"
] | train | https://github.com/larakit/lk-staticfiles/blob/1ee718b1f3a00c29c46b06c2f501413599b0335a/src/StaticFiles/Package.php#L60-L64 |
larakit/lk-staticfiles | src/StaticFiles/Package.php | Package.css | function css($css, $media = null, $condition = null, $no_build = false) {
$this->css[$css] = compact('media', 'condition', 'no_build');
return $this;
} | php | function css($css, $media = null, $condition = null, $no_build = false) {
$this->css[$css] = compact('media', 'condition', 'no_build');
return $this;
} | [
"function",
"css",
"(",
"$",
"css",
",",
"$",
"media",
"=",
"null",
",",
"$",
"condition",
"=",
"null",
",",
"$",
"no_build",
"=",
"false",
")",
"{",
"$",
"this",
"->",
"css",
"[",
"$",
"css",
"]",
"=",
"compact",
"(",
"'media'",
",",
"'condition... | Добавить внешний CSS
@param $css
@param null $media
@param null $condition
@param bool $no_build
@return $this | [
"Добавить",
"внешний",
"CSS"
] | train | https://github.com/larakit/lk-staticfiles/blob/1ee718b1f3a00c29c46b06c2f501413599b0335a/src/StaticFiles/Package.php#L76-L80 |
larakit/lk-staticfiles | src/StaticFiles/Package.php | Package.jsPackage | function jsPackage($js, $condition = null, $no_build = false) {
return $this->js('/packages/' . $this->package . '/' . $js, $condition, $no_build);
} | php | function jsPackage($js, $condition = null, $no_build = false) {
return $this->js('/packages/' . $this->package . '/' . $js, $condition, $no_build);
} | [
"function",
"jsPackage",
"(",
"$",
"js",
",",
"$",
"condition",
"=",
"null",
",",
"$",
"no_build",
"=",
"false",
")",
"{",
"return",
"$",
"this",
"->",
"js",
"(",
"'/packages/'",
".",
"$",
"this",
"->",
"package",
".",
"'/'",
".",
"$",
"js",
",",
... | Добавить JS из пакета
@param $js
@param null $condition
@param bool $no_build
@return Package | [
"Добавить",
"JS",
"из",
"пакета"
] | train | https://github.com/larakit/lk-staticfiles/blob/1ee718b1f3a00c29c46b06c2f501413599b0335a/src/StaticFiles/Package.php#L91-L93 |
larakit/lk-staticfiles | src/StaticFiles/Package.php | Package.cssPackage | function cssPackage($css, $media = null, $condition = null, $no_build = false) {
return $this->css('/packages/' . $this->package . '/' . $css, $media, $condition, $no_build);
} | php | function cssPackage($css, $media = null, $condition = null, $no_build = false) {
return $this->css('/packages/' . $this->package . '/' . $css, $media, $condition, $no_build);
} | [
"function",
"cssPackage",
"(",
"$",
"css",
",",
"$",
"media",
"=",
"null",
",",
"$",
"condition",
"=",
"null",
",",
"$",
"no_build",
"=",
"false",
")",
"{",
"return",
"$",
"this",
"->",
"css",
"(",
"'/packages/'",
".",
"$",
"this",
"->",
"package",
... | Добавить CSS из пакета
@param $css
@param null $media
@param null $condition
@param bool $no_build
@return Package | [
"Добавить",
"CSS",
"из",
"пакета"
] | train | https://github.com/larakit/lk-staticfiles/blob/1ee718b1f3a00c29c46b06c2f501413599b0335a/src/StaticFiles/Package.php#L105-L107 |
larakit/lk-staticfiles | src/StaticFiles/Package.php | Package.scope | function scope($scope) {
$styles = (array) Arr::get($this->scopes, $scope . '.css', []);
$scripts = (array) Arr::get($this->scopes, $scope . '.js', []);
foreach($styles as $style) {
$this->css($style);
}
foreach($scripts as $script) {
$this->js($sc... | php | function scope($scope) {
$styles = (array) Arr::get($this->scopes, $scope . '.css', []);
$scripts = (array) Arr::get($this->scopes, $scope . '.js', []);
foreach($styles as $style) {
$this->css($style);
}
foreach($scripts as $script) {
$this->js($sc... | [
"function",
"scope",
"(",
"$",
"scope",
")",
"{",
"$",
"styles",
"=",
"(",
"array",
")",
"Arr",
"::",
"get",
"(",
"$",
"this",
"->",
"scopes",
",",
"$",
"scope",
".",
"'.css'",
",",
"[",
"]",
")",
";",
"$",
"scripts",
"=",
"(",
"array",
")",
... | Подключить именованный набор
Manager::package('larakit/sf-flot')
->scope('pie');
В итоге вместе с базовыми стилями и скриптами пакета "sf-flot" подключатся скрипты и стили набора pie
@param $scope
@return Package | [
"Подключить",
"именованный",
"набор"
] | train | https://github.com/larakit/lk-staticfiles/blob/1ee718b1f3a00c29c46b06c2f501413599b0335a/src/StaticFiles/Package.php#L138-L149 |
larakit/lk-staticfiles | src/StaticFiles/Package.php | Package.addExclude | function addExclude($exclude) {
$exclude = func_get_args();
foreach($exclude as $v) {
$this->exclude = array_merge($this->exclude, (array) $v);
}
return $this;
} | php | function addExclude($exclude) {
$exclude = func_get_args();
foreach($exclude as $v) {
$this->exclude = array_merge($this->exclude, (array) $v);
}
return $this;
} | [
"function",
"addExclude",
"(",
"$",
"exclude",
")",
"{",
"$",
"exclude",
"=",
"func_get_args",
"(",
")",
";",
"foreach",
"(",
"$",
"exclude",
"as",
"$",
"v",
")",
"{",
"$",
"this",
"->",
"exclude",
"=",
"array_merge",
"(",
"$",
"this",
"->",
"exclude... | Добавить список роутов, где пакет должен быть выключен
@param $exclude string|array
@return $this | [
"Добавить",
"список",
"роутов",
"где",
"пакет",
"должен",
"быть",
"выключен"
] | train | https://github.com/larakit/lk-staticfiles/blob/1ee718b1f3a00c29c46b06c2f501413599b0335a/src/StaticFiles/Package.php#L217-L224 |
larakit/lk-staticfiles | src/StaticFiles/Package.php | Package.on | function on() {
if($this->is_used) {
return true;
}
$route = \Route::currentRouteName();
$exclude = self::maxIs($this->exclude, $route);
$include = self::maxIs($this->include, $route);
if($exclude > $include || true === $exclude) {
// иск... | php | function on() {
if($this->is_used) {
return true;
}
$route = \Route::currentRouteName();
$exclude = self::maxIs($this->exclude, $route);
$include = self::maxIs($this->include, $route);
if($exclude > $include || true === $exclude) {
// иск... | [
"function",
"on",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"is_used",
")",
"{",
"return",
"true",
";",
"}",
"$",
"route",
"=",
"\\",
"Route",
"::",
"currentRouteName",
"(",
")",
";",
"$",
"exclude",
"=",
"self",
"::",
"maxIs",
"(",
"$",
"this... | Включение пакета с учетом правил использования include/exclude
@return bool | [
"Включение",
"пакета",
"с",
"учетом",
"правил",
"использования",
"include",
"/",
"exclude"
] | train | https://github.com/larakit/lk-staticfiles/blob/1ee718b1f3a00c29c46b06c2f501413599b0335a/src/StaticFiles/Package.php#L264-L304 |
larakit/lk-staticfiles | src/StaticFiles/Package.php | Package.maxIs | static protected function maxIs($input_array, $search) {
$ret = 0;
foreach((array) $input_array as $input) {
$is = self::is($input, $search);
if(true === $is) {
return true;
}
$ret = max($is, $ret);
}
retu... | php | static protected function maxIs($input_array, $search) {
$ret = 0;
foreach((array) $input_array as $input) {
$is = self::is($input, $search);
if(true === $is) {
return true;
}
$ret = max($is, $ret);
}
retu... | [
"static",
"protected",
"function",
"maxIs",
"(",
"$",
"input_array",
",",
"$",
"search",
")",
"{",
"$",
"ret",
"=",
"0",
";",
"foreach",
"(",
"(",
"array",
")",
"$",
"input_array",
"as",
"$",
"input",
")",
"{",
"$",
"is",
"=",
"self",
"::",
"is",
... | @param $input_array
@param $search
@return bool|int | [
"@param",
"$input_array",
"@param",
"$search"
] | train | https://github.com/larakit/lk-staticfiles/blob/1ee718b1f3a00c29c46b06c2f501413599b0335a/src/StaticFiles/Package.php#L312-L323 |
larakit/lk-staticfiles | src/StaticFiles/Package.php | Package.is | static protected function is($search, $current) {
if($search == $current) {
return true;
}
if('*' == $search) {
return 1;
}
$pattern = preg_quote($search, '#');
$pattern = str_replace('\*', '.*', $pattern) . '\z';
$match ... | php | static protected function is($search, $current) {
if($search == $current) {
return true;
}
if('*' == $search) {
return 1;
}
$pattern = preg_quote($search, '#');
$pattern = str_replace('\*', '.*', $pattern) . '\z';
$match ... | [
"static",
"protected",
"function",
"is",
"(",
"$",
"search",
",",
"$",
"current",
")",
"{",
"if",
"(",
"$",
"search",
"==",
"$",
"current",
")",
"{",
"return",
"true",
";",
"}",
"if",
"(",
"'*'",
"==",
"$",
"search",
")",
"{",
"return",
"1",
";",... | @param $search
@param $current
@return bool|int | [
"@param",
"$search",
"@param",
"$current"
] | train | https://github.com/larakit/lk-staticfiles/blob/1ee718b1f3a00c29c46b06c2f501413599b0335a/src/StaticFiles/Package.php#L331-L348 |
larakit/lk-staticfiles | src/StaticFiles/Package.php | Package.deploy | function deploy($output = null) {
if(is_null($this->source_dir)) {
return false;
}
if($output) {
$styled = '<comment>Package "' . $this->package . '"</comment> deployed in <error>"/packages/' . $this->package . '"</error>';
$output->writeln($styled);
... | php | function deploy($output = null) {
if(is_null($this->source_dir)) {
return false;
}
if($output) {
$styled = '<comment>Package "' . $this->package . '"</comment> deployed in <error>"/packages/' . $this->package . '"</error>';
$output->writeln($styled);
... | [
"function",
"deploy",
"(",
"$",
"output",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"source_dir",
")",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"$",
"output",
")",
"{",
"$",
"styled",
"=",
"'<comment>Package \"'",
... | Выкладка пакета
@return bool | [
"Выкладка",
"пакета"
] | train | https://github.com/larakit/lk-staticfiles/blob/1ee718b1f3a00c29c46b06c2f501413599b0335a/src/StaticFiles/Package.php#L355-L366 |
crossjoin/Css | src/Crossjoin/Css/Format/Rule/AtKeyframes/KeyframesRule.php | KeyframesRule.setIdentifier | public function setIdentifier($identifier)
{
if (is_string($identifier)) {
$this->identifier = $identifier;
} else {
throw new \InvalidArgumentException(
"Invalid type '" . gettype($identifier). "' for argument 'identifier' given."
);
}
... | php | public function setIdentifier($identifier)
{
if (is_string($identifier)) {
$this->identifier = $identifier;
} else {
throw new \InvalidArgumentException(
"Invalid type '" . gettype($identifier). "' for argument 'identifier' given."
);
}
... | [
"public",
"function",
"setIdentifier",
"(",
"$",
"identifier",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"identifier",
")",
")",
"{",
"$",
"this",
"->",
"identifier",
"=",
"$",
"identifier",
";",
"}",
"else",
"{",
"throw",
"new",
"\\",
"InvalidArgument... | Sets the keyframes identifier.
@param string $identifier | [
"Sets",
"the",
"keyframes",
"identifier",
"."
] | train | https://github.com/crossjoin/Css/blob/7b50ca94c4bdad60d01cfa327f00b7a600d6f9f3/src/Crossjoin/Css/Format/Rule/AtKeyframes/KeyframesRule.php#L43-L52 |
crossjoin/Css | src/Crossjoin/Css/Format/Rule/AtKeyframes/KeyframesRule.php | KeyframesRule.addRule | public function addRule(RuleAbstract $rule)
{
// TODO Keyframes with duplicate identifiers do NOT cascade!
// Last one overwrites previous ones.
// @see https://developer.mozilla.org/en-US/docs/Web/CSS/@keyframes#Duplicate_resolution
if ($rule instanceof KeyframesRuleSet) {
... | php | public function addRule(RuleAbstract $rule)
{
// TODO Keyframes with duplicate identifiers do NOT cascade!
// Last one overwrites previous ones.
// @see https://developer.mozilla.org/en-US/docs/Web/CSS/@keyframes#Duplicate_resolution
if ($rule instanceof KeyframesRuleSet) {
... | [
"public",
"function",
"addRule",
"(",
"RuleAbstract",
"$",
"rule",
")",
"{",
"// TODO Keyframes with duplicate identifiers do NOT cascade!",
"// Last one overwrites previous ones.",
"// @see https://developer.mozilla.org/en-US/docs/Web/CSS/@keyframes#Duplicate_resolution",
"if",
"(",
"$"... | Adds a keyframes rule set.
@param KeyframesRuleSet $rule
@return $this | [
"Adds",
"a",
"keyframes",
"rule",
"set",
"."
] | train | https://github.com/crossjoin/Css/blob/7b50ca94c4bdad60d01cfa327f00b7a600d6f9f3/src/Crossjoin/Css/Format/Rule/AtKeyframes/KeyframesRule.php#L70-L85 |
crossjoin/Css | src/Crossjoin/Css/Format/Rule/AtKeyframes/KeyframesRule.php | KeyframesRule.parseRuleString | protected function parseRuleString($ruleString)
{
if (is_string($ruleString)) {
// Check for valid rule format
// (with vendor prefix check to match e.g. "@-webkit-keyframes")
if (preg_match(
'/^[ \r\n\t\f]*@(' . self::getVendorPrefixRegExp("/") . ')?keyfr... | php | protected function parseRuleString($ruleString)
{
if (is_string($ruleString)) {
// Check for valid rule format
// (with vendor prefix check to match e.g. "@-webkit-keyframes")
if (preg_match(
'/^[ \r\n\t\f]*@(' . self::getVendorPrefixRegExp("/") . ')?keyfr... | [
"protected",
"function",
"parseRuleString",
"(",
"$",
"ruleString",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"ruleString",
")",
")",
"{",
"// Check for valid rule format",
"// (with vendor prefix check to match e.g. \"@-webkit-keyframes\")",
"if",
"(",
"preg_match",
"(... | Parses the keyframes rule.
@param string $ruleString | [
"Parses",
"the",
"keyframes",
"rule",
"."
] | train | https://github.com/crossjoin/Css/blob/7b50ca94c4bdad60d01cfa327f00b7a600d6f9f3/src/Crossjoin/Css/Format/Rule/AtKeyframes/KeyframesRule.php#L92-L116 |
harp-orm/query | src/Compiler/Union.php | Union.render | public static function render(Query\Union $query)
{
return Compiler::withDb($query->getDb(), function () use ($query) {
return Compiler::expression(array(
Arr::join(' UNION ', Arr::map(function (Query\Select $select) {
return Compiler::braced(Select::render($s... | php | public static function render(Query\Union $query)
{
return Compiler::withDb($query->getDb(), function () use ($query) {
return Compiler::expression(array(
Arr::join(' UNION ', Arr::map(function (Query\Select $select) {
return Compiler::braced(Select::render($s... | [
"public",
"static",
"function",
"render",
"(",
"Query",
"\\",
"Union",
"$",
"query",
")",
"{",
"return",
"Compiler",
"::",
"withDb",
"(",
"$",
"query",
"->",
"getDb",
"(",
")",
",",
"function",
"(",
")",
"use",
"(",
"$",
"query",
")",
"{",
"return",
... | Render a Union object
@param Query\Union $query
@return string | [
"Render",
"a",
"Union",
"object"
] | train | https://github.com/harp-orm/query/blob/98ce2468a0a31fe15ed3692bad32547bf6dbe41a/src/Compiler/Union.php#L20-L31 |
comodojo/dispatcher.framework | src/Comodojo/Dispatcher/Response/Preprocessor.php | Preprocessor.get | public function get($status) {
$preprocessor = $this->has($status) ?
$this->preprocessors[$status] :
$this->preprocessors[self::DEFAULT_STATUS];
return ($preprocessor instanceof HttpStatusPreprocessorInterface) ?
$preprocessor : new $preprocessor;
} | php | public function get($status) {
$preprocessor = $this->has($status) ?
$this->preprocessors[$status] :
$this->preprocessors[self::DEFAULT_STATUS];
return ($preprocessor instanceof HttpStatusPreprocessorInterface) ?
$preprocessor : new $preprocessor;
} | [
"public",
"function",
"get",
"(",
"$",
"status",
")",
"{",
"$",
"preprocessor",
"=",
"$",
"this",
"->",
"has",
"(",
"$",
"status",
")",
"?",
"$",
"this",
"->",
"preprocessors",
"[",
"$",
"status",
"]",
":",
"$",
"this",
"->",
"preprocessors",
"[",
... | Get an instance of the preprocessor for the current status
@param int $status
The HTTP status to use
@return HttpStatusPreprocessorInterface | [
"Get",
"an",
"instance",
"of",
"the",
"preprocessor",
"for",
"the",
"current",
"status"
] | train | https://github.com/comodojo/dispatcher.framework/blob/5093297dcb7441a8d8f79cbb2429c93232e16d1c/src/Comodojo/Dispatcher/Response/Preprocessor.php#L86-L95 |
movoin/one-swoole | src/Event/Event.php | Event.getContext | public function getContext(): Context
{
if ($this->context === null) {
$this->context = new Context;
}
return $this->context;
} | php | public function getContext(): Context
{
if ($this->context === null) {
$this->context = new Context;
}
return $this->context;
} | [
"public",
"function",
"getContext",
"(",
")",
":",
"Context",
"{",
"if",
"(",
"$",
"this",
"->",
"context",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"context",
"=",
"new",
"Context",
";",
"}",
"return",
"$",
"this",
"->",
"context",
";",
"}"
] | 获得事件上下文
@return \One\Event\Context | [
"获得事件上下文"
] | train | https://github.com/movoin/one-swoole/blob/b9b175963ead91416cc50902a04e05ff3ef571de/src/Event/Event.php#L65-L72 |
movoin/one-swoole | src/Event/Event.php | Event.setContexts | public function setContexts($contexts)
{
if ($contexts) {
foreach ((array) $contexts as $name => $value) {
$this->getContext()->set($name, $value);
}
}
} | php | public function setContexts($contexts)
{
if ($contexts) {
foreach ((array) $contexts as $name => $value) {
$this->getContext()->set($name, $value);
}
}
} | [
"public",
"function",
"setContexts",
"(",
"$",
"contexts",
")",
"{",
"if",
"(",
"$",
"contexts",
")",
"{",
"foreach",
"(",
"(",
"array",
")",
"$",
"contexts",
"as",
"$",
"name",
"=>",
"$",
"value",
")",
"{",
"$",
"this",
"->",
"getContext",
"(",
")... | 设置事件上下文
@param array $contexts | [
"设置事件上下文"
] | train | https://github.com/movoin/one-swoole/blob/b9b175963ead91416cc50902a04e05ff3ef571de/src/Event/Event.php#L79-L86 |
prooph/link-app-core | src/Service/Factory/RiotTagCollectionResolverFactory.php | RiotTagCollectionResolverFactory.createService | public function createService(ServiceLocatorInterface $serviceLocator)
{
$config = $serviceLocator->get('Config');
$collections = array();
if (isset($config['asset_manager']['resolver_configs']['riot-tags'])) {
$collections = $config['asset_manager']['resolver_configs']['ri... | php | public function createService(ServiceLocatorInterface $serviceLocator)
{
$config = $serviceLocator->get('Config');
$collections = array();
if (isset($config['asset_manager']['resolver_configs']['riot-tags'])) {
$collections = $config['asset_manager']['resolver_configs']['ri... | [
"public",
"function",
"createService",
"(",
"ServiceLocatorInterface",
"$",
"serviceLocator",
")",
"{",
"$",
"config",
"=",
"$",
"serviceLocator",
"->",
"get",
"(",
"'Config'",
")",
";",
"$",
"collections",
"=",
"array",
"(",
")",
";",
"if",
"(",
"isset",
... | Create service
@param ServiceLocatorInterface $serviceLocator
@return mixed | [
"Create",
"service"
] | train | https://github.com/prooph/link-app-core/blob/835a5945dfa7be7b2cebfa6e84e757ecfd783357/src/Service/Factory/RiotTagCollectionResolverFactory.php#L33-L43 |
seeren/http | src/Uri/AbstractUri.php | AbstractUri.getAuthority | public final function getAuthority(): string
{
return ($this->user ? $this->user . static::USER_SEPARATOR : "")
. $this->host
. ($this->port ? static::HOST_SEPARATOR . $this->port : "");
} | php | public final function getAuthority(): string
{
return ($this->user ? $this->user . static::USER_SEPARATOR : "")
. $this->host
. ($this->port ? static::HOST_SEPARATOR . $this->port : "");
} | [
"public",
"final",
"function",
"getAuthority",
"(",
")",
":",
"string",
"{",
"return",
"(",
"$",
"this",
"->",
"user",
"?",
"$",
"this",
"->",
"user",
".",
"static",
"::",
"USER_SEPARATOR",
":",
"\"\"",
")",
".",
"$",
"this",
"->",
"host",
".",
"(",
... | {@inheritDoc}
@see \Psr\Http\Message\UriInterface::getAuthority() | [
"{"
] | train | https://github.com/seeren/http/blob/b5e692e085c41fe25714d17ee90ba78eaf1923c4/src/Uri/AbstractUri.php#L169-L174 |
seeren/http | src/Uri/AbstractUri.php | AbstractUri.withScheme | public final function withScheme($scheme): UriInterface
{
if (!is_string($scheme)
|| !($parsedScheme = $this->parseScheme($scheme))
|| $parsedScheme !== strtolower($scheme)) {
throw new InvalidArgumentException(
"Can't get with scheme: not supported");
}... | php | public final function withScheme($scheme): UriInterface
{
if (!is_string($scheme)
|| !($parsedScheme = $this->parseScheme($scheme))
|| $parsedScheme !== strtolower($scheme)) {
throw new InvalidArgumentException(
"Can't get with scheme: not supported");
}... | [
"public",
"final",
"function",
"withScheme",
"(",
"$",
"scheme",
")",
":",
"UriInterface",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"scheme",
")",
"||",
"!",
"(",
"$",
"parsedScheme",
"=",
"$",
"this",
"->",
"parseScheme",
"(",
"$",
"scheme",
")",
... | {@inheritDoc}
@see \Psr\Http\Message\UriInterface::withScheme() | [
"{"
] | train | https://github.com/seeren/http/blob/b5e692e085c41fe25714d17ee90ba78eaf1923c4/src/Uri/AbstractUri.php#L234-L243 |
seeren/http | src/Uri/AbstractUri.php | AbstractUri.withUserInfo | public final function withUserInfo($user, $password = null): UriInterface
{
return $this->with(
"user",
$user . ($password ? static::HOST_SEPARATOR . $password: ""));
} | php | public final function withUserInfo($user, $password = null): UriInterface
{
return $this->with(
"user",
$user . ($password ? static::HOST_SEPARATOR . $password: ""));
} | [
"public",
"final",
"function",
"withUserInfo",
"(",
"$",
"user",
",",
"$",
"password",
"=",
"null",
")",
":",
"UriInterface",
"{",
"return",
"$",
"this",
"->",
"with",
"(",
"\"user\"",
",",
"$",
"user",
".",
"(",
"$",
"password",
"?",
"static",
"::",
... | {@inheritDoc}
@see \Psr\Http\Message\UriInterface::withUserInfo() | [
"{"
] | train | https://github.com/seeren/http/blob/b5e692e085c41fe25714d17ee90ba78eaf1923c4/src/Uri/AbstractUri.php#L249-L254 |
seeren/http | src/Uri/AbstractUri.php | AbstractUri.withHost | public final function withHost($host): UriInterface
{
if (!is_string($host) || !($parsedHost = $this->parseHost($host))) {
throw new InvalidArgumentException(
"Can't get with host: invalid host name");
}
return $this->with("host", $parsedHost);
} | php | public final function withHost($host): UriInterface
{
if (!is_string($host) || !($parsedHost = $this->parseHost($host))) {
throw new InvalidArgumentException(
"Can't get with host: invalid host name");
}
return $this->with("host", $parsedHost);
} | [
"public",
"final",
"function",
"withHost",
"(",
"$",
"host",
")",
":",
"UriInterface",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"host",
")",
"||",
"!",
"(",
"$",
"parsedHost",
"=",
"$",
"this",
"->",
"parseHost",
"(",
"$",
"host",
")",
")",
")",... | {@inheritDoc}
@see \Psr\Http\Message\UriInterface::withHost() | [
"{"
] | train | https://github.com/seeren/http/blob/b5e692e085c41fe25714d17ee90ba78eaf1923c4/src/Uri/AbstractUri.php#L260-L267 |
seeren/http | src/Uri/AbstractUri.php | AbstractUri.withPort | public final function withPort($port): UriInterface
{
if (!is_int($port)
|| !($parsedPort = $this->parsePort($port))) {
throw new InvalidArgumentException(
"Can't get with port: invalid port range");
}
return $this->with("port", $parsedPort);
} | php | public final function withPort($port): UriInterface
{
if (!is_int($port)
|| !($parsedPort = $this->parsePort($port))) {
throw new InvalidArgumentException(
"Can't get with port: invalid port range");
}
return $this->with("port", $parsedPort);
} | [
"public",
"final",
"function",
"withPort",
"(",
"$",
"port",
")",
":",
"UriInterface",
"{",
"if",
"(",
"!",
"is_int",
"(",
"$",
"port",
")",
"||",
"!",
"(",
"$",
"parsedPort",
"=",
"$",
"this",
"->",
"parsePort",
"(",
"$",
"port",
")",
")",
")",
... | {@inheritDoc}
@see \Psr\Http\Message\UriInterface::withPort() | [
"{"
] | train | https://github.com/seeren/http/blob/b5e692e085c41fe25714d17ee90ba78eaf1923c4/src/Uri/AbstractUri.php#L273-L281 |
seeren/http | src/Uri/AbstractUri.php | AbstractUri.withPath | public function withPath($path): UriInterface
{
if (!is_string($path)
|| !($parsedPath = $this->parsePath($path))) {
throw new InvalidArgumentException(
"Can't get with path: invalid expression");
}
return $this->with("path", $parsedPath);
} | php | public function withPath($path): UriInterface
{
if (!is_string($path)
|| !($parsedPath = $this->parsePath($path))) {
throw new InvalidArgumentException(
"Can't get with path: invalid expression");
}
return $this->with("path", $parsedPath);
} | [
"public",
"function",
"withPath",
"(",
"$",
"path",
")",
":",
"UriInterface",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"path",
")",
"||",
"!",
"(",
"$",
"parsedPath",
"=",
"$",
"this",
"->",
"parsePath",
"(",
"$",
"path",
")",
")",
")",
"{",
"... | {@inheritDoc}
@see \Psr\Http\Message\UriInterface::withPath() | [
"{"
] | train | https://github.com/seeren/http/blob/b5e692e085c41fe25714d17ee90ba78eaf1923c4/src/Uri/AbstractUri.php#L287-L295 |
seeren/http | src/Uri/AbstractUri.php | AbstractUri.withQuery | public final function withQuery($query): UriInterface
{
if (!is_string($query)) {
throw new InvalidArgumentException(
"Can't get with query: invalid query string");
}
return $this->with("query", $this->parseQuery($query));
} | php | public final function withQuery($query): UriInterface
{
if (!is_string($query)) {
throw new InvalidArgumentException(
"Can't get with query: invalid query string");
}
return $this->with("query", $this->parseQuery($query));
} | [
"public",
"final",
"function",
"withQuery",
"(",
"$",
"query",
")",
":",
"UriInterface",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"query",
")",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"\"Can't get with query: invalid query string\"",
")",
"... | {@inheritDoc}
@see \Psr\Http\Message\UriInterface::withQuery() | [
"{"
] | train | https://github.com/seeren/http/blob/b5e692e085c41fe25714d17ee90ba78eaf1923c4/src/Uri/AbstractUri.php#L301-L308 |
alexpts/psr15-middlewares | src/HasRequestAttributeName.php | HasRequestAttributeName.process | public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
{
$request = $this->checkAttributes($request, $this->attributes);
return $handler->handle($request);
} | php | public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
{
$request = $this->checkAttributes($request, $this->attributes);
return $handler->handle($request);
} | [
"public",
"function",
"process",
"(",
"ServerRequestInterface",
"$",
"request",
",",
"RequestHandlerInterface",
"$",
"handler",
")",
":",
"ResponseInterface",
"{",
"$",
"request",
"=",
"$",
"this",
"->",
"checkAttributes",
"(",
"$",
"request",
",",
"$",
"this",
... | @param ServerRequestInterface $request
@param RequestHandlerInterface $handler
@return ResponseInterface
@throws \InvalidArgumentException
@throws Exception | [
"@param",
"ServerRequestInterface",
"$request",
"@param",
"RequestHandlerInterface",
"$handler"
] | train | https://github.com/alexpts/psr15-middlewares/blob/bff2887d5af01c54d9288fd19c20f0f593b69358/src/HasRequestAttributeName.php#L34-L39 |
alexpts/psr15-middlewares | src/HasRequestAttributeName.php | HasRequestAttributeName.checkAttributes | protected function checkAttributes(ServerRequestInterface $request, array $attributes): ServerRequestInterface
{
foreach ($attributes as $name) {
if (!$request->getAttribute($name)) {
throw $this->exception;
}
}
return $request;
} | php | protected function checkAttributes(ServerRequestInterface $request, array $attributes): ServerRequestInterface
{
foreach ($attributes as $name) {
if (!$request->getAttribute($name)) {
throw $this->exception;
}
}
return $request;
} | [
"protected",
"function",
"checkAttributes",
"(",
"ServerRequestInterface",
"$",
"request",
",",
"array",
"$",
"attributes",
")",
":",
"ServerRequestInterface",
"{",
"foreach",
"(",
"$",
"attributes",
"as",
"$",
"name",
")",
"{",
"if",
"(",
"!",
"$",
"request",... | @param ServerRequestInterface $request
@param array $attributes
@return ServerRequestInterface
@throws Exception | [
"@param",
"ServerRequestInterface",
"$request",
"@param",
"array",
"$attributes"
] | train | https://github.com/alexpts/psr15-middlewares/blob/bff2887d5af01c54d9288fd19c20f0f593b69358/src/HasRequestAttributeName.php#L48-L57 |
wpottier/WizadSettingsBundle | DependencyInjection/Configuration.php | Configuration.getConfigTreeBuilder | public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('wizad_settings');
$rootNode
->addDefaultsIfNotSet()
->children()
->scalarNode('config_file_parser')->defaultValue('\Wizad\SettingsBundle\Parser\... | php | public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('wizad_settings');
$rootNode
->addDefaultsIfNotSet()
->children()
->scalarNode('config_file_parser')->defaultValue('\Wizad\SettingsBundle\Parser\... | [
"public",
"function",
"getConfigTreeBuilder",
"(",
")",
"{",
"$",
"treeBuilder",
"=",
"new",
"TreeBuilder",
"(",
")",
";",
"$",
"rootNode",
"=",
"$",
"treeBuilder",
"->",
"root",
"(",
"'wizad_settings'",
")",
";",
"$",
"rootNode",
"->",
"addDefaultsIfNotSet",
... | {@inheritDoc} | [
"{"
] | train | https://github.com/wpottier/WizadSettingsBundle/blob/92738c59d4da28d3a7376de854ce8505898159cb/DependencyInjection/Configuration.php#L39-L76 |
hrevert/HtUserRegistration | src/Mapper/UserRegistrationMapper.php | UserRegistrationMapper.findByUser | public function findByUser(UserInterface $user)
{
$select = $this->getSelect();
$select->where(array('user_id' => $user->getId()));
$entity = $this->select($select)->current();
if ($entity instanceof UserRegistrationInterface) {
$entity->setUser($user);
}
... | php | public function findByUser(UserInterface $user)
{
$select = $this->getSelect();
$select->where(array('user_id' => $user->getId()));
$entity = $this->select($select)->current();
if ($entity instanceof UserRegistrationInterface) {
$entity->setUser($user);
}
... | [
"public",
"function",
"findByUser",
"(",
"UserInterface",
"$",
"user",
")",
"{",
"$",
"select",
"=",
"$",
"this",
"->",
"getSelect",
"(",
")",
";",
"$",
"select",
"->",
"where",
"(",
"array",
"(",
"'user_id'",
"=>",
"$",
"user",
"->",
"getId",
"(",
"... | {@inheritDoc} | [
"{"
] | train | https://github.com/hrevert/HtUserRegistration/blob/6b4a0cc364153757290ab5eed9ffafe1228f3bd6/src/Mapper/UserRegistrationMapper.php#L19-L29 |
hrevert/HtUserRegistration | src/Mapper/UserRegistrationMapper.php | UserRegistrationMapper.insert | public function insert($entity, $tableName = null, HydratorInterface $hydrator = null)
{
$this->checkEntity($entity, __METHOD__);
return parent::insert($entity);
} | php | public function insert($entity, $tableName = null, HydratorInterface $hydrator = null)
{
$this->checkEntity($entity, __METHOD__);
return parent::insert($entity);
} | [
"public",
"function",
"insert",
"(",
"$",
"entity",
",",
"$",
"tableName",
"=",
"null",
",",
"HydratorInterface",
"$",
"hydrator",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"checkEntity",
"(",
"$",
"entity",
",",
"__METHOD__",
")",
";",
"return",
"parent... | {@inheritDoc} | [
"{"
] | train | https://github.com/hrevert/HtUserRegistration/blob/6b4a0cc364153757290ab5eed9ffafe1228f3bd6/src/Mapper/UserRegistrationMapper.php#L34-L39 |
hrevert/HtUserRegistration | src/Mapper/UserRegistrationMapper.php | UserRegistrationMapper.update | public function update($entity, $where = null, $tableName = null, HydratorInterface $hydrator = null)
{
$this->checkEntity($entity, __METHOD__);
if (!$where) {
$where = array('user_id' => $entity->getUser()->getId());
}
return parent::update($entity, $where);
} | php | public function update($entity, $where = null, $tableName = null, HydratorInterface $hydrator = null)
{
$this->checkEntity($entity, __METHOD__);
if (!$where) {
$where = array('user_id' => $entity->getUser()->getId());
}
return parent::update($entity, $where);
} | [
"public",
"function",
"update",
"(",
"$",
"entity",
",",
"$",
"where",
"=",
"null",
",",
"$",
"tableName",
"=",
"null",
",",
"HydratorInterface",
"$",
"hydrator",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"checkEntity",
"(",
"$",
"entity",
",",
"__METH... | {@inheritDoc} | [
"{"
] | train | https://github.com/hrevert/HtUserRegistration/blob/6b4a0cc364153757290ab5eed9ffafe1228f3bd6/src/Mapper/UserRegistrationMapper.php#L44-L52 |
awesomite/chariot | src/Pattern/StdPatterns/ListPattern.php | ListPattern.normalizeToUrl | private function normalizeToUrl($data)
{
if (\is_object($data)) {
if ($data instanceof \Traversable) {
return \iterator_to_array($data);
}
if (\method_exists($data, '__toString')) {
return (string) $data;
}
}
i... | php | private function normalizeToUrl($data)
{
if (\is_object($data)) {
if ($data instanceof \Traversable) {
return \iterator_to_array($data);
}
if (\method_exists($data, '__toString')) {
return (string) $data;
}
}
i... | [
"private",
"function",
"normalizeToUrl",
"(",
"$",
"data",
")",
"{",
"if",
"(",
"\\",
"is_object",
"(",
"$",
"data",
")",
")",
"{",
"if",
"(",
"$",
"data",
"instanceof",
"\\",
"Traversable",
")",
"{",
"return",
"\\",
"iterator_to_array",
"(",
"$",
"dat... | @param $data
@return array|string | [
"@param",
"$data"
] | train | https://github.com/awesomite/chariot/blob/3229e38537b857be1d352308ba340dc530b12afb/src/Pattern/StdPatterns/ListPattern.php#L51-L72 |
gdbots/pbjx-bundle-php | src/Twig/PbjxExtension.php | PbjxExtension.pbjUrl | public function pbjUrl(Message $pbj, string $template): ?string
{
return UriTemplateService::expand("{$pbj::schema()->getQName()}.{$template}", $pbj->getUriTemplateVars());
} | php | public function pbjUrl(Message $pbj, string $template): ?string
{
return UriTemplateService::expand("{$pbj::schema()->getQName()}.{$template}", $pbj->getUriTemplateVars());
} | [
"public",
"function",
"pbjUrl",
"(",
"Message",
"$",
"pbj",
",",
"string",
"$",
"template",
")",
":",
"?",
"string",
"{",
"return",
"UriTemplateService",
"::",
"expand",
"(",
"\"{$pbj::schema()->getQName()}.{$template}\"",
",",
"$",
"pbj",
"->",
"getUriTemplateVar... | Returns a named URL to a pbj instance.
Example:
{{ pbj_url(pbj, 'canonical') }}
@param Message $pbj
@param string $template
@return string | [
"Returns",
"a",
"named",
"URL",
"to",
"a",
"pbj",
"instance",
"."
] | train | https://github.com/gdbots/pbjx-bundle-php/blob/f3c0088583879fc92f13247a0752634bd8696eac/src/Twig/PbjxExtension.php#L109-L112 |
gdbots/pbjx-bundle-php | src/Twig/PbjxExtension.php | PbjxExtension.pbjxRequest | public function pbjxRequest(string $curie, array $data = []): ?Response
{
try {
/** @var Request $class */
$class = MessageResolver::resolveCurie(SchemaCurie::fromString($curie));
$request = $class::fromArray($data);
if (!$request instanceof Request) {
... | php | public function pbjxRequest(string $curie, array $data = []): ?Response
{
try {
/** @var Request $class */
$class = MessageResolver::resolveCurie(SchemaCurie::fromString($curie));
$request = $class::fromArray($data);
if (!$request instanceof Request) {
... | [
"public",
"function",
"pbjxRequest",
"(",
"string",
"$",
"curie",
",",
"array",
"$",
"data",
"=",
"[",
"]",
")",
":",
"?",
"Response",
"{",
"try",
"{",
"/** @var Request $class */",
"$",
"class",
"=",
"MessageResolver",
"::",
"resolveCurie",
"(",
"SchemaCuri... | Performs a pbjx->request and returns the response. If debugging is enabled an exception will
be thrown (generally in dev), otherwise it will be logged and null will be returned.
Example:
{% set pbjx_response = pbjx_request('acme:blog:request:get-comments-request', {'article_id':id}) %}
{% if pbjx_response %}
{% inclu... | [
"Performs",
"a",
"pbjx",
"-",
">",
"request",
"and",
"returns",
"the",
"response",
".",
"If",
"debugging",
"is",
"enabled",
"an",
"exception",
"will",
"be",
"thrown",
"(",
"generally",
"in",
"dev",
")",
"otherwise",
"it",
"will",
"be",
"logged",
"and",
"... | train | https://github.com/gdbots/pbjx-bundle-php/blob/f3c0088583879fc92f13247a0752634bd8696eac/src/Twig/PbjxExtension.php#L147-L178 |
whatthejeff/fab-phpunit-resultprinter | src/Fab/PHPUnit/ResultPrinter.php | ResultPrinter.writeProgress | protected function writeProgress($progress)
{
if ($progress == '.') {
$progress = $this->fab->paintChar('*');
}
parent::writeProgress($progress);
} | php | protected function writeProgress($progress)
{
if ($progress == '.') {
$progress = $this->fab->paintChar('*');
}
parent::writeProgress($progress);
} | [
"protected",
"function",
"writeProgress",
"(",
"$",
"progress",
")",
"{",
"if",
"(",
"$",
"progress",
"==",
"'.'",
")",
"{",
"$",
"progress",
"=",
"$",
"this",
"->",
"fab",
"->",
"paintChar",
"(",
"'*'",
")",
";",
"}",
"parent",
"::",
"writeProgress",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/whatthejeff/fab-phpunit-resultprinter/blob/0b30213e552ce2f02757e64865692faf9d5a8987/src/Fab/PHPUnit/ResultPrinter.php#L42-L49 |
huasituo/hstcms | src/Http/Controllers/Manage/MenuController.php | MenuController.role | public function role(Request $request)
{
if($request->get('_ajax')) {
$ename = $request->input('ename');
$parent = $request->input('parent');
$uri = $request->input('uri');
$query = CommonRoleUriModel::where('id', '>', 0);
if($ename) {
... | php | public function role(Request $request)
{
if($request->get('_ajax')) {
$ename = $request->input('ename');
$parent = $request->input('parent');
$uri = $request->input('uri');
$query = CommonRoleUriModel::where('id', '>', 0);
if($ename) {
... | [
"public",
"function",
"role",
"(",
"Request",
"$",
"request",
")",
"{",
"if",
"(",
"$",
"request",
"->",
"get",
"(",
"'_ajax'",
")",
")",
"{",
"$",
"ename",
"=",
"$",
"request",
"->",
"input",
"(",
"'ename'",
")",
";",
"$",
"parent",
"=",
"$",
"r... | ==================================== | [
"===================================="
] | train | https://github.com/huasituo/hstcms/blob/12819979289e58ce38e3e92540aeeb16e205e525/src/Http/Controllers/Manage/MenuController.php#L144-L176 |
FrenchFrogs/framework | src/Modal/Modal/Modal.php | Modal.appendAction | public function appendAction(FrenchFrogs\Form\Element\Button $action)
{
$this->actions[] = $action;
return $this;
} | php | public function appendAction(FrenchFrogs\Form\Element\Button $action)
{
$this->actions[] = $action;
return $this;
} | [
"public",
"function",
"appendAction",
"(",
"FrenchFrogs",
"\\",
"Form",
"\\",
"Element",
"\\",
"Button",
"$",
"action",
")",
"{",
"$",
"this",
"->",
"actions",
"[",
"]",
"=",
"$",
"action",
";",
"return",
"$",
"this",
";",
"}"
] | Push one element to the end of the $actions container
@param \FrenchFrogs\Form\Element\Button $action
@return $this | [
"Push",
"one",
"element",
"to",
"the",
"end",
"of",
"the",
"$actions",
"container"
] | train | https://github.com/FrenchFrogs/framework/blob/a4838c698a5600437e87dac6d35ba8ebe32c4395/src/Modal/Modal/Modal.php#L485-L489 |
FrenchFrogs/framework | src/Modal/Modal/Modal.php | Modal.prependAction | public function prependAction(FrenchFrogs\Form\Element\Button $action)
{
array_unshift($this->actions, $action);
return $this;
} | php | public function prependAction(FrenchFrogs\Form\Element\Button $action)
{
array_unshift($this->actions, $action);
return $this;
} | [
"public",
"function",
"prependAction",
"(",
"FrenchFrogs",
"\\",
"Form",
"\\",
"Element",
"\\",
"Button",
"$",
"action",
")",
"{",
"array_unshift",
"(",
"$",
"this",
"->",
"actions",
",",
"$",
"action",
")",
";",
"return",
"$",
"this",
";",
"}"
] | Prepend one elements to the beginning of the $actions container
@param \FrenchFrogs\Form\Element\Button $action
@return $this | [
"Prepend",
"one",
"elements",
"to",
"the",
"beginning",
"of",
"the",
"$actions",
"container"
] | train | https://github.com/FrenchFrogs/framework/blob/a4838c698a5600437e87dac6d35ba8ebe32c4395/src/Modal/Modal/Modal.php#L497-L501 |
FrenchFrogs/framework | src/Modal/Modal/Modal.php | Modal.renderRemoteEmptyModal | static function renderRemoteEmptyModal($remoteId = null)
{
$modal = modal();
if (!is_null($remoteId)) {
$modal->setRemoteId($remoteId);
}
return $modal->getRenderer()->render('modal_remote', $modal);
} | php | static function renderRemoteEmptyModal($remoteId = null)
{
$modal = modal();
if (!is_null($remoteId)) {
$modal->setRemoteId($remoteId);
}
return $modal->getRenderer()->render('modal_remote', $modal);
} | [
"static",
"function",
"renderRemoteEmptyModal",
"(",
"$",
"remoteId",
"=",
"null",
")",
"{",
"$",
"modal",
"=",
"modal",
"(",
")",
";",
"if",
"(",
"!",
"is_null",
"(",
"$",
"remoteId",
")",
")",
"{",
"$",
"modal",
"->",
"setRemoteId",
"(",
"$",
"remo... | Render an emptyl
@param null $remoteId
@return mixed
@throws \Exception | [
"Render",
"an",
"emptyl"
] | train | https://github.com/FrenchFrogs/framework/blob/a4838c698a5600437e87dac6d35ba8ebe32c4395/src/Modal/Modal/Modal.php#L540-L548 |
stubbles/stubbles-webapp-core | src/main/php/response/mimetypes/Image.php | Image.serialize | public function serialize($resource, OutputStream $out): OutputStream
{
if (null === $resource) {
return $out;
}
if ($resource instanceof Error) {
$image = $this->loadImage($this->errorImgResource);
} elseif (!($resource instanceof ImageSource)) {
... | php | public function serialize($resource, OutputStream $out): OutputStream
{
if (null === $resource) {
return $out;
}
if ($resource instanceof Error) {
$image = $this->loadImage($this->errorImgResource);
} elseif (!($resource instanceof ImageSource)) {
... | [
"public",
"function",
"serialize",
"(",
"$",
"resource",
",",
"OutputStream",
"$",
"out",
")",
":",
"OutputStream",
"{",
"if",
"(",
"null",
"===",
"$",
"resource",
")",
"{",
"return",
"$",
"out",
";",
"}",
"if",
"(",
"$",
"resource",
"instanceof",
"Err... | serializes resource to output stream
@param mixed $resource
@param \stubbles\streams\OutputStream $out
@return \stubbles\streams\OutputStream | [
"serializes",
"resource",
"to",
"output",
"stream"
] | train | https://github.com/stubbles/stubbles-webapp-core/blob/7705f129011a81d5cc3c76b4b150fab3dadac6a3/src/main/php/response/mimetypes/Image.php#L66-L93 |
stubbles/stubbles-webapp-core | src/main/php/response/mimetypes/Image.php | Image.loadImage | private function loadImage(string $resource)
{
try {
return $this->resourceLoader->load(
$resource,
function($fileName) { return ImageSource::load($fileName); }
);
} catch (\Throwable $t) {
// not allowed to throw exceptions... | php | private function loadImage(string $resource)
{
try {
return $this->resourceLoader->load(
$resource,
function($fileName) { return ImageSource::load($fileName); }
);
} catch (\Throwable $t) {
// not allowed to throw exceptions... | [
"private",
"function",
"loadImage",
"(",
"string",
"$",
"resource",
")",
"{",
"try",
"{",
"return",
"$",
"this",
"->",
"resourceLoader",
"->",
"load",
"(",
"$",
"resource",
",",
"function",
"(",
"$",
"fileName",
")",
"{",
"return",
"ImageSource",
"::",
"... | loads image from resource pathes
@param string $resource
@return \stubbles\img\Image|null | [
"loads",
"image",
"from",
"resource",
"pathes"
] | train | https://github.com/stubbles/stubbles-webapp-core/blob/7705f129011a81d5cc3c76b4b150fab3dadac6a3/src/main/php/response/mimetypes/Image.php#L101-L117 |
stubbles/stubbles-webapp-core | src/main/php/routing/api/Resource.php | Resource.addLink | public function addLink(string $rel, $uri): Link
{
return $this->links->add($rel, $uri);
} | php | public function addLink(string $rel, $uri): Link
{
return $this->links->add($rel, $uri);
} | [
"public",
"function",
"addLink",
"(",
"string",
"$",
"rel",
",",
"$",
"uri",
")",
":",
"Link",
"{",
"return",
"$",
"this",
"->",
"links",
"->",
"add",
"(",
"$",
"rel",
",",
"$",
"uri",
")",
";",
"}"
] | adds a link for this resource
@param string $rel relation of this link to the resource
@param string $uri actual uri
@return \stubbles\webapp\routing\api\Link | [
"adds",
"a",
"link",
"for",
"this",
"resource"
] | train | https://github.com/stubbles/stubbles-webapp-core/blob/7705f129011a81d5cc3c76b4b150fab3dadac6a3/src/main/php/routing/api/Resource.php#L132-L135 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.