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 |
|---|---|---|---|---|---|---|---|---|---|---|
freyo/flysystem-qcloud-cos-v3 | src/Client/Auth.php | Auth.appSign | public static function appSign($expired, $bucketName)
{
$appId = Conf::getAppId();
$secretId = Conf::getSecretId();
$secretKey = Conf::getSecretKey();
if (empty($secretId) || empty($secretKey) || empty($appId)) {
return self::AUTH_SECRET_ID_KEY_ERROR;
}
... | php | public static function appSign($expired, $bucketName)
{
$appId = Conf::getAppId();
$secretId = Conf::getSecretId();
$secretKey = Conf::getSecretKey();
if (empty($secretId) || empty($secretKey) || empty($appId)) {
return self::AUTH_SECRET_ID_KEY_ERROR;
}
... | [
"public",
"static",
"function",
"appSign",
"(",
"$",
"expired",
",",
"$",
"bucketName",
")",
"{",
"$",
"appId",
"=",
"Conf",
"::",
"getAppId",
"(",
")",
";",
"$",
"secretId",
"=",
"Conf",
"::",
"getSecretId",
"(",
")",
";",
"$",
"secretKey",
"=",
"Co... | 生成多次有效签名函数(用于上传和下载资源,有效期内可重复对不同资源使用).
@param int $expired 过期时间,unix时间戳
@param string $bucketName 文件所在bucket
@return string 签名 | [
"生成多次有效签名函数(用于上传和下载资源,有效期内可重复对不同资源使用)",
"."
] | train | https://github.com/freyo/flysystem-qcloud-cos-v3/blob/6bddbc22396aa1228942ec4c0ce46935d415f3b4/src/Client/Auth.php#L18-L29 |
freyo/flysystem-qcloud-cos-v3 | src/Client/Auth.php | Auth.appSign_once | public static function appSign_once($path, $bucketName)
{
$appId = Conf::getAppId();
$secretId = Conf::getSecretId();
$secretKey = Conf::getSecretKey();
if (preg_match('/^\//', $path) == 0) {
$path = '/'.$path;
}
$fileId = '/'.$appId.'/'.$bucketName.$path... | php | public static function appSign_once($path, $bucketName)
{
$appId = Conf::getAppId();
$secretId = Conf::getSecretId();
$secretKey = Conf::getSecretKey();
if (preg_match('/^\//', $path) == 0) {
$path = '/'.$path;
}
$fileId = '/'.$appId.'/'.$bucketName.$path... | [
"public",
"static",
"function",
"appSign_once",
"(",
"$",
"path",
",",
"$",
"bucketName",
")",
"{",
"$",
"appId",
"=",
"Conf",
"::",
"getAppId",
"(",
")",
";",
"$",
"secretId",
"=",
"Conf",
"::",
"getSecretId",
"(",
")",
";",
"$",
"secretKey",
"=",
"... | 生成单次有效签名函数(用于删除和更新指定fileId资源,使用一次即失效).
@param string $bucketName 文件所在bucket
@param string $path
@return string 签名 | [
"生成单次有效签名函数(用于删除和更新指定fileId资源,使用一次即失效)",
"."
] | train | https://github.com/freyo/flysystem-qcloud-cos-v3/blob/6bddbc22396aa1228942ec4c0ce46935d415f3b4/src/Client/Auth.php#L39-L55 |
yuncms/framework | src/base/Collection.php | Collection.only | public function only(array $keys): array
{
$return = [];
foreach ($keys as $key) {
$value = $this->get($key);
if (!is_null($value)) {
$return[$key] = $value;
}
}
return $return;
} | php | public function only(array $keys): array
{
$return = [];
foreach ($keys as $key) {
$value = $this->get($key);
if (!is_null($value)) {
$return[$key] = $value;
}
}
return $return;
} | [
"public",
"function",
"only",
"(",
"array",
"$",
"keys",
")",
":",
"array",
"{",
"$",
"return",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"keys",
"as",
"$",
"key",
")",
"{",
"$",
"value",
"=",
"$",
"this",
"->",
"get",
"(",
"$",
"key",
")",
";... | Return specific items.
@param array $keys
@return array | [
"Return",
"specific",
"items",
"."
] | train | https://github.com/yuncms/framework/blob/af42e28ea4ae15ab8eead3f6d119f93863b94154/src/base/Collection.php#L86-L96 |
yuncms/framework | src/base/Collection.php | Collection.except | public function except($keys): Collection
{
$keys = is_array($keys) ? $keys : func_get_args();
return new static(ArrayHelper::except($this->items, $keys));
} | php | public function except($keys): Collection
{
$keys = is_array($keys) ? $keys : func_get_args();
return new static(ArrayHelper::except($this->items, $keys));
} | [
"public",
"function",
"except",
"(",
"$",
"keys",
")",
":",
"Collection",
"{",
"$",
"keys",
"=",
"is_array",
"(",
"$",
"keys",
")",
"?",
"$",
"keys",
":",
"func_get_args",
"(",
")",
";",
"return",
"new",
"static",
"(",
"ArrayHelper",
"::",
"except",
... | Get all items except for those with the specified keys.
@param mixed $keys
@return Collection | [
"Get",
"all",
"items",
"except",
"for",
"those",
"with",
"the",
"specified",
"keys",
"."
] | train | https://github.com/yuncms/framework/blob/af42e28ea4ae15ab8eead3f6d119f93863b94154/src/base/Collection.php#L104-L108 |
VincentChalnot/SidusAdminBundle | Routing/RoutingHelper.php | RoutingHelper.redirectToEntity | public function redirectToEntity(
Action $action,
$entity,
array $parameters = [],
$referenceType = UrlGeneratorInterface::ABSOLUTE_PATH,
$status = 302
): RedirectResponse {
$url = $this->adminRouter->generateAdminEntityPath(
$action->getAdmin(),
... | php | public function redirectToEntity(
Action $action,
$entity,
array $parameters = [],
$referenceType = UrlGeneratorInterface::ABSOLUTE_PATH,
$status = 302
): RedirectResponse {
$url = $this->adminRouter->generateAdminEntityPath(
$action->getAdmin(),
... | [
"public",
"function",
"redirectToEntity",
"(",
"Action",
"$",
"action",
",",
"$",
"entity",
",",
"array",
"$",
"parameters",
"=",
"[",
"]",
",",
"$",
"referenceType",
"=",
"UrlGeneratorInterface",
"::",
"ABSOLUTE_PATH",
",",
"$",
"status",
"=",
"302",
")",
... | @param Action $action
@param mixed $entity
@param array $parameters
@param int $referenceType
@param int $status
@return RedirectResponse | [
"@param",
"Action",
"$action",
"@param",
"mixed",
"$entity",
"@param",
"array",
"$parameters",
"@param",
"int",
"$referenceType",
"@param",
"int",
"$status"
] | train | https://github.com/VincentChalnot/SidusAdminBundle/blob/3366f3f1525435860cf275ed2f1f0b58cf6eea18/Routing/RoutingHelper.php#L44-L60 |
VincentChalnot/SidusAdminBundle | Routing/RoutingHelper.php | RoutingHelper.redirectToAction | public function redirectToAction(
Action $action,
array $parameters = [],
$referenceType = UrlGeneratorInterface::ABSOLUTE_PATH,
$status = 302
): RedirectResponse {
$url = $this->adminRouter->generateAdminPath(
$action->getAdmin(),
$action->getCode(),
... | php | public function redirectToAction(
Action $action,
array $parameters = [],
$referenceType = UrlGeneratorInterface::ABSOLUTE_PATH,
$status = 302
): RedirectResponse {
$url = $this->adminRouter->generateAdminPath(
$action->getAdmin(),
$action->getCode(),
... | [
"public",
"function",
"redirectToAction",
"(",
"Action",
"$",
"action",
",",
"array",
"$",
"parameters",
"=",
"[",
"]",
",",
"$",
"referenceType",
"=",
"UrlGeneratorInterface",
"::",
"ABSOLUTE_PATH",
",",
"$",
"status",
"=",
"302",
")",
":",
"RedirectResponse"... | @param Action $action
@param array $parameters
@param int $referenceType
@param int $status
@return RedirectResponse | [
"@param",
"Action",
"$action",
"@param",
"array",
"$parameters",
"@param",
"int",
"$referenceType",
"@param",
"int",
"$status"
] | train | https://github.com/VincentChalnot/SidusAdminBundle/blob/3366f3f1525435860cf275ed2f1f0b58cf6eea18/Routing/RoutingHelper.php#L70-L84 |
VincentChalnot/SidusAdminBundle | Routing/RoutingHelper.php | RoutingHelper.getAdminListPath | public function getAdminListPath(Admin $admin, array $parameters = []): ?string
{
if (!$admin->hasAction('list')) {
return null;
}
return $this->adminRouter->generateAdminPath($admin, 'list', $parameters);
} | php | public function getAdminListPath(Admin $admin, array $parameters = []): ?string
{
if (!$admin->hasAction('list')) {
return null;
}
return $this->adminRouter->generateAdminPath($admin, 'list', $parameters);
} | [
"public",
"function",
"getAdminListPath",
"(",
"Admin",
"$",
"admin",
",",
"array",
"$",
"parameters",
"=",
"[",
"]",
")",
":",
"?",
"string",
"{",
"if",
"(",
"!",
"$",
"admin",
"->",
"hasAction",
"(",
"'list'",
")",
")",
"{",
"return",
"null",
";",
... | @param Admin $admin
@param array $parameters
@return string|null | [
"@param",
"Admin",
"$admin",
"@param",
"array",
"$parameters"
] | train | https://github.com/VincentChalnot/SidusAdminBundle/blob/3366f3f1525435860cf275ed2f1f0b58cf6eea18/Routing/RoutingHelper.php#L92-L99 |
VincentChalnot/SidusAdminBundle | Routing/RoutingHelper.php | RoutingHelper.getCurrentUri | public function getCurrentUri(Action $action, Request $request, array $parameters = []): string
{
if ($request->attributes->get('_route') === $action->getRouteName()) {
$parameters = array_merge(
$request->attributes->get('_route_params'),
$parameters
... | php | public function getCurrentUri(Action $action, Request $request, array $parameters = []): string
{
if ($request->attributes->get('_route') === $action->getRouteName()) {
$parameters = array_merge(
$request->attributes->get('_route_params'),
$parameters
... | [
"public",
"function",
"getCurrentUri",
"(",
"Action",
"$",
"action",
",",
"Request",
"$",
"request",
",",
"array",
"$",
"parameters",
"=",
"[",
"]",
")",
":",
"string",
"{",
"if",
"(",
"$",
"request",
"->",
"attributes",
"->",
"get",
"(",
"'_route'",
"... | @param Action $action
@param Request $request
@param array $parameters
@return string | [
"@param",
"Action",
"$action",
"@param",
"Request",
"$request",
"@param",
"array",
"$parameters"
] | train | https://github.com/VincentChalnot/SidusAdminBundle/blob/3366f3f1525435860cf275ed2f1f0b58cf6eea18/Routing/RoutingHelper.php#L108-L118 |
webforge-labs/psc-cms | lib/PHPWord/PHPWord/Style/Paragraph.php | PHPWord_Style_Paragraph.setAlign | public function setAlign($pValue = null) {
if(strtolower($pValue) == 'justify') {
// justify becames both
$pValue = 'both';
}
$this->_align = $pValue;
return $this;
} | php | public function setAlign($pValue = null) {
if(strtolower($pValue) == 'justify') {
// justify becames both
$pValue = 'both';
}
$this->_align = $pValue;
return $this;
} | [
"public",
"function",
"setAlign",
"(",
"$",
"pValue",
"=",
"null",
")",
"{",
"if",
"(",
"strtolower",
"(",
"$",
"pValue",
")",
"==",
"'justify'",
")",
"{",
"// justify becames both\r",
"$",
"pValue",
"=",
"'both'",
";",
"}",
"$",
"this",
"->",
"_align",
... | Set Paragraph Alignment
@param string $pValue
@return PHPWord_Style_Paragraph | [
"Set",
"Paragraph",
"Alignment"
] | train | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/PHPWord/PHPWord/Style/Paragraph.php#L105-L112 |
krzysztofmazur/ntp-client | src/Impl/TcpNtpClient.php | TcpNtpClient.getUnixTime | public function getUnixTime(): int
{
$socket = $this->connect();
$response = $this->readResponse($socket, 4);
$this->close($socket);
return $this->bin2dec($response) - self::SINCE_1900_TO_UNIX;
} | php | public function getUnixTime(): int
{
$socket = $this->connect();
$response = $this->readResponse($socket, 4);
$this->close($socket);
return $this->bin2dec($response) - self::SINCE_1900_TO_UNIX;
} | [
"public",
"function",
"getUnixTime",
"(",
")",
":",
"int",
"{",
"$",
"socket",
"=",
"$",
"this",
"->",
"connect",
"(",
")",
";",
"$",
"response",
"=",
"$",
"this",
"->",
"readResponse",
"(",
"$",
"socket",
",",
"4",
")",
";",
"$",
"this",
"->",
"... | {@inheritdoc} | [
"{"
] | train | https://github.com/krzysztofmazur/ntp-client/blob/3e15ce8ee26d6e2e57a8bdbdf67273762e3fbfd2/src/Impl/TcpNtpClient.php#L29-L36 |
redaigbaria/oauth2 | src/AuthorizationServer.php | AuthorizationServer.addGrantType | public function addGrantType(GrantTypeInterface $grantType, $identifier = null)
{
if (is_null($identifier)) {
$identifier = $grantType->getIdentifier();
}
// Inject server into grant
$grantType->setAuthorizationServer($this);
$this->grantTypes[$identifier] = $gr... | php | public function addGrantType(GrantTypeInterface $grantType, $identifier = null)
{
if (is_null($identifier)) {
$identifier = $grantType->getIdentifier();
}
// Inject server into grant
$grantType->setAuthorizationServer($this);
$this->grantTypes[$identifier] = $gr... | [
"public",
"function",
"addGrantType",
"(",
"GrantTypeInterface",
"$",
"grantType",
",",
"$",
"identifier",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"identifier",
")",
")",
"{",
"$",
"identifier",
"=",
"$",
"grantType",
"->",
"getIdentifier",
... | Enable support for a grant
@param GrantTypeInterface $grantType A grant class which conforms to Interface/GrantTypeInterface
@param null|string $identifier An identifier for the grant (autodetected if not passed)
@return self | [
"Enable",
"support",
"for",
"a",
"grant"
] | train | https://github.com/redaigbaria/oauth2/blob/54cca4aaaff6a095cbf1c8010f2fe2cc7de4e45a/src/AuthorizationServer.php#L95-L111 |
redaigbaria/oauth2 | src/AuthorizationServer.php | AuthorizationServer.issueAccessToken | public function issueAccessToken()
{
$grantType = $this->getRequest()->request->get('grant_type');
if (is_null($grantType)) {
throw new Exception\InvalidRequestException('grant_type');
}
// Ensure grant type is one that is recognised and is enabled
if (!in_array(... | php | public function issueAccessToken()
{
$grantType = $this->getRequest()->request->get('grant_type');
if (is_null($grantType)) {
throw new Exception\InvalidRequestException('grant_type');
}
// Ensure grant type is one that is recognised and is enabled
if (!in_array(... | [
"public",
"function",
"issueAccessToken",
"(",
")",
"{",
"$",
"grantType",
"=",
"$",
"this",
"->",
"getRequest",
"(",
")",
"->",
"request",
"->",
"get",
"(",
"'grant_type'",
")",
";",
"if",
"(",
"is_null",
"(",
"$",
"grantType",
")",
")",
"{",
"throw",... | Issue an access token
@return array Authorise request parameters
@throws | [
"Issue",
"an",
"access",
"token"
] | train | https://github.com/redaigbaria/oauth2/blob/54cca4aaaff6a095cbf1c8010f2fe2cc7de4e45a/src/AuthorizationServer.php#L262-L276 |
redaigbaria/oauth2 | src/AuthorizationServer.php | AuthorizationServer.getGrantType | public function getGrantType($grantType)
{
if (isset($this->grantTypes[$grantType])) {
return $this->grantTypes[$grantType];
}
throw new Exception\InvalidGrantException($grantType);
} | php | public function getGrantType($grantType)
{
if (isset($this->grantTypes[$grantType])) {
return $this->grantTypes[$grantType];
}
throw new Exception\InvalidGrantException($grantType);
} | [
"public",
"function",
"getGrantType",
"(",
"$",
"grantType",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"grantTypes",
"[",
"$",
"grantType",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"grantTypes",
"[",
"$",
"grantType",
"]",
";",
"}... | Return a grant type class
@param string $grantType The grant type identifier
@return Grant\GrantTypeInterface
@throws | [
"Return",
"a",
"grant",
"type",
"class"
] | train | https://github.com/redaigbaria/oauth2/blob/54cca4aaaff6a095cbf1c8010f2fe2cc7de4e45a/src/AuthorizationServer.php#L287-L294 |
alanpich/slender | src/Core/ModuleResolver/DirectoryResolver.php | DirectoryResolver.getPath | public function getPath($module)
{
$dir = $this->dir . DIRECTORY_SEPARATOR . $module;
if (!is_dir($dir)) {
return false;
}
$find = new Finder();
$files = $find->files()
->in($dir)
->name('slender.*');
if ($files->count() < 1) {
... | php | public function getPath($module)
{
$dir = $this->dir . DIRECTORY_SEPARATOR . $module;
if (!is_dir($dir)) {
return false;
}
$find = new Finder();
$files = $find->files()
->in($dir)
->name('slender.*');
if ($files->count() < 1) {
... | [
"public",
"function",
"getPath",
"(",
"$",
"module",
")",
"{",
"$",
"dir",
"=",
"$",
"this",
"->",
"dir",
".",
"DIRECTORY_SEPARATOR",
".",
"$",
"module",
";",
"if",
"(",
"!",
"is_dir",
"(",
"$",
"dir",
")",
")",
"{",
"return",
"false",
";",
"}",
... | Return the path to Module $module, or false
if not found
@param string $module Module name or Namespace
@return string|false | [
"Return",
"the",
"path",
"to",
"Module",
"$module",
"or",
"false",
"if",
"not",
"found"
] | train | https://github.com/alanpich/slender/blob/247f5c08af20cda95b116eb5d9f6f623d61e8a8a/src/Core/ModuleResolver/DirectoryResolver.php#L63-L84 |
matks/MarkdownBlogBundle | Blog/Library.php | Library.addPost | public function addPost(Post $post)
{
$postName = $post->getName();
if ($this->isPostRegistered($postName)) {
throw new \InvalidArgumentException("Duplicate post $postName");
}
$this->registerPost($post);
} | php | public function addPost(Post $post)
{
$postName = $post->getName();
if ($this->isPostRegistered($postName)) {
throw new \InvalidArgumentException("Duplicate post $postName");
}
$this->registerPost($post);
} | [
"public",
"function",
"addPost",
"(",
"Post",
"$",
"post",
")",
"{",
"$",
"postName",
"=",
"$",
"post",
"->",
"getName",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"isPostRegistered",
"(",
"$",
"postName",
")",
")",
"{",
"throw",
"new",
"\\",
"In... | @param Post $post
@throws \InvalidArgumentException if post is already registerd in Library | [
"@param",
"Post",
"$post"
] | train | https://github.com/matks/MarkdownBlogBundle/blob/b3438f143ece5e926b891d8f481dba35948b05fb/Blog/Library.php#L62-L71 |
matks/MarkdownBlogBundle | Blog/Library.php | Library.getPostsByName | public function getPostsByName(array $postNames)
{
$posts = [];
foreach ($postNames as $postName) {
if (false === $this->isPostRegistered($postName)) {
continue;
}
$posts[$postName] = $this->posts[$postName];
}
return $posts;
} | php | public function getPostsByName(array $postNames)
{
$posts = [];
foreach ($postNames as $postName) {
if (false === $this->isPostRegistered($postName)) {
continue;
}
$posts[$postName] = $this->posts[$postName];
}
return $posts;
} | [
"public",
"function",
"getPostsByName",
"(",
"array",
"$",
"postNames",
")",
"{",
"$",
"posts",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"postNames",
"as",
"$",
"postName",
")",
"{",
"if",
"(",
"false",
"===",
"$",
"this",
"->",
"isPostRegistered",
"("... | @param string[] $postNames
@return Post[] | [
"@param",
"string",
"[]",
"$postNames"
] | train | https://github.com/matks/MarkdownBlogBundle/blob/b3438f143ece5e926b891d8f481dba35948b05fb/Blog/Library.php#L92-L103 |
matks/MarkdownBlogBundle | Blog/Library.php | Library.getPostsByDate | public function getPostsByDate($date)
{
if (false === array_key_exists($date, $this->dateIndex)) {
return [];
}
$postNames = $this->dateIndex[$date];
return $this->getPostsByName($postNames);
} | php | public function getPostsByDate($date)
{
if (false === array_key_exists($date, $this->dateIndex)) {
return [];
}
$postNames = $this->dateIndex[$date];
return $this->getPostsByName($postNames);
} | [
"public",
"function",
"getPostsByDate",
"(",
"$",
"date",
")",
"{",
"if",
"(",
"false",
"===",
"array_key_exists",
"(",
"$",
"date",
",",
"$",
"this",
"->",
"dateIndex",
")",
")",
"{",
"return",
"[",
"]",
";",
"}",
"$",
"postNames",
"=",
"$",
"this",... | @param string $date expected format: YYYY-MM-DD
@return Post[] | [
"@param",
"string",
"$date",
"expected",
"format",
":",
"YYYY",
"-",
"MM",
"-",
"DD"
] | train | https://github.com/matks/MarkdownBlogBundle/blob/b3438f143ece5e926b891d8f481dba35948b05fb/Blog/Library.php#L110-L119 |
matks/MarkdownBlogBundle | Blog/Library.php | Library.getPostsByCategory | public function getPostsByCategory($category)
{
if (false === array_key_exists($category, $this->categoryIndex)) {
return [];
}
$postNames = $this->categoryIndex[$category];
return $this->getPostsByName($postNames);
} | php | public function getPostsByCategory($category)
{
if (false === array_key_exists($category, $this->categoryIndex)) {
return [];
}
$postNames = $this->categoryIndex[$category];
return $this->getPostsByName($postNames);
} | [
"public",
"function",
"getPostsByCategory",
"(",
"$",
"category",
")",
"{",
"if",
"(",
"false",
"===",
"array_key_exists",
"(",
"$",
"category",
",",
"$",
"this",
"->",
"categoryIndex",
")",
")",
"{",
"return",
"[",
"]",
";",
"}",
"$",
"postNames",
"=",
... | @param string $category
@return Post[] | [
"@param",
"string",
"$category"
] | train | https://github.com/matks/MarkdownBlogBundle/blob/b3438f143ece5e926b891d8f481dba35948b05fb/Blog/Library.php#L126-L135 |
matks/MarkdownBlogBundle | Blog/Library.php | Library.getPostsByTag | public function getPostsByTag($tag)
{
if (false === array_key_exists($tag, $this->tagsIndex)) {
return [];
}
$postNames = $this->tagsIndex[$tag];
return $this->getPostsByName($postNames);
} | php | public function getPostsByTag($tag)
{
if (false === array_key_exists($tag, $this->tagsIndex)) {
return [];
}
$postNames = $this->tagsIndex[$tag];
return $this->getPostsByName($postNames);
} | [
"public",
"function",
"getPostsByTag",
"(",
"$",
"tag",
")",
"{",
"if",
"(",
"false",
"===",
"array_key_exists",
"(",
"$",
"tag",
",",
"$",
"this",
"->",
"tagsIndex",
")",
")",
"{",
"return",
"[",
"]",
";",
"}",
"$",
"postNames",
"=",
"$",
"this",
... | @param string $tag
@return Post[] | [
"@param",
"string",
"$tag"
] | train | https://github.com/matks/MarkdownBlogBundle/blob/b3438f143ece5e926b891d8f481dba35948b05fb/Blog/Library.php#L142-L151 |
2amigos/yiifoundation | widgets/SwitchButton.php | SwitchButton.init | public function init()
{
Html::addCssClass($this->htmlOptions, Enum::SWITCH_BUTTON);
if ($this->size) {
Html::addCssClass($this->htmlOptions, $this->size);
}
if ($this->radius) {
Html::addCssClass($this->htmlOptions, $this->radius);
}
parent::i... | php | public function init()
{
Html::addCssClass($this->htmlOptions, Enum::SWITCH_BUTTON);
if ($this->size) {
Html::addCssClass($this->htmlOptions, $this->size);
}
if ($this->radius) {
Html::addCssClass($this->htmlOptions, $this->radius);
}
parent::i... | [
"public",
"function",
"init",
"(",
")",
"{",
"Html",
"::",
"addCssClass",
"(",
"$",
"this",
"->",
"htmlOptions",
",",
"Enum",
"::",
"SWITCH_BUTTON",
")",
";",
"if",
"(",
"$",
"this",
"->",
"size",
")",
"{",
"Html",
"::",
"addCssClass",
"(",
"$",
"thi... | Widget's initialization | [
"Widget",
"s",
"initialization"
] | train | https://github.com/2amigos/yiifoundation/blob/49bed0d3ca1a9bac9299000e48a2661bdc8f9a29/widgets/SwitchButton.php#L44-L54 |
2amigos/yiifoundation | widgets/SwitchButton.php | SwitchButton.renderButtons | public function renderButtons()
{
list($name, $id) = $this->resolveNameID();
$buttons = array();
$checked = $this->hasModel() ? (!$this->model->{$this->attribute}) : true;
$buttons[] = \CHtml::radioButton($name, $checked, array('id' => $id . '_on', 'value' => 1));
$button... | php | public function renderButtons()
{
list($name, $id) = $this->resolveNameID();
$buttons = array();
$checked = $this->hasModel() ? (!$this->model->{$this->attribute}) : true;
$buttons[] = \CHtml::radioButton($name, $checked, array('id' => $id . '_on', 'value' => 1));
$button... | [
"public",
"function",
"renderButtons",
"(",
")",
"{",
"list",
"(",
"$",
"name",
",",
"$",
"id",
")",
"=",
"$",
"this",
"->",
"resolveNameID",
"(",
")",
";",
"$",
"buttons",
"=",
"array",
"(",
")",
";",
"$",
"checked",
"=",
"$",
"this",
"->",
"has... | Returns the formatted button
@return string the resulting HTML | [
"Returns",
"the",
"formatted",
"button"
] | train | https://github.com/2amigos/yiifoundation/blob/49bed0d3ca1a9bac9299000e48a2661bdc8f9a29/widgets/SwitchButton.php#L68-L81 |
activecollab/templateengine | src/TemplateEngine/PhpTemplateEngine.php | PhpTemplateEngine.& | public function &display($template, array $data = [])
{
$this->protectedIncludeScope($this->getTemplatePath($template), array_merge($this->getAttributes(), $data));
return $this;
} | php | public function &display($template, array $data = [])
{
$this->protectedIncludeScope($this->getTemplatePath($template), array_merge($this->getAttributes(), $data));
return $this;
} | [
"public",
"function",
"&",
"display",
"(",
"$",
"template",
",",
"array",
"$",
"data",
"=",
"[",
"]",
")",
"{",
"$",
"this",
"->",
"protectedIncludeScope",
"(",
"$",
"this",
"->",
"getTemplatePath",
"(",
"$",
"template",
")",
",",
"array_merge",
"(",
"... | {@inheritdoc} | [
"{"
] | train | https://github.com/activecollab/templateengine/blob/eff2de29428b9d649c6f6d8ba5eb52b46c6f27e8/src/TemplateEngine/PhpTemplateEngine.php#L21-L26 |
qcubed/orm | src/Query/Node/Association.php | Association.join | public function join(
Builder $objBuilder,
$blnExpandSelection = false,
iCondition $objJoinCondition = null,
Clause\Select $objSelect = null
) {
$objParentNode = $this->objParentNode;
$objParentNode->join($objBuilder, $blnExpandSelection, null, $objSelect);
if... | php | public function join(
Builder $objBuilder,
$blnExpandSelection = false,
iCondition $objJoinCondition = null,
Clause\Select $objSelect = null
) {
$objParentNode = $this->objParentNode;
$objParentNode->join($objBuilder, $blnExpandSelection, null, $objSelect);
if... | [
"public",
"function",
"join",
"(",
"Builder",
"$",
"objBuilder",
",",
"$",
"blnExpandSelection",
"=",
"false",
",",
"iCondition",
"$",
"objJoinCondition",
"=",
"null",
",",
"Clause",
"\\",
"Select",
"$",
"objSelect",
"=",
"null",
")",
"{",
"$",
"objParentNod... | Join the node to the query. Join condition here gets applied to parent item.
@param Builder $objBuilder
@param bool $blnExpandSelection
@param iCondition|null $objJoinCondition
@param Clause\Select|null $objSelect
@throws Caller | [
"Join",
"the",
"node",
"to",
"the",
"query",
".",
"Join",
"condition",
"here",
"gets",
"applied",
"to",
"parent",
"item",
"."
] | train | https://github.com/qcubed/orm/blob/f320eba671f20874b1f3809c5293f8c02d5b1204/src/Query/Node/Association.php#L50-L76 |
CakeCMS/Core | src/Event/EventManager.php | EventManager.loadListeners | public static function loadListeners()
{
$manager = self::instance();
$plugins = Plugin::loaded();
foreach ($plugins as $plugin) {
$events = Plugin::getData($plugin, 'events')->getArrayCopy();
foreach ($events as $name => $config) {
if (is_numeric($na... | php | public static function loadListeners()
{
$manager = self::instance();
$plugins = Plugin::loaded();
foreach ($plugins as $plugin) {
$events = Plugin::getData($plugin, 'events')->getArrayCopy();
foreach ($events as $name => $config) {
if (is_numeric($na... | [
"public",
"static",
"function",
"loadListeners",
"(",
")",
"{",
"$",
"manager",
"=",
"self",
"::",
"instance",
"(",
")",
";",
"$",
"plugins",
"=",
"Plugin",
"::",
"loaded",
"(",
")",
";",
"foreach",
"(",
"$",
"plugins",
"as",
"$",
"plugin",
")",
"{",... | Load Event Handlers during bootstrap.
Plugins can add their own custom EventHandler in Config/events.php
with the following format:
'events' => [
'Core.CoreEventHandler' => [
'options' = [
'callable' => '',
'priority' => '',
]
]
]
@return void | [
"Load",
"Event",
"Handlers",
"during",
"bootstrap",
"."
] | train | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/Event/EventManager.php#L48-L70 |
CakeCMS/Core | src/Event/EventManager.php | EventManager.trigger | public static function trigger($name, $subject = null, $data = null)
{
$event = new Event($name, $subject, $data);
if (is_object($subject)) {
return $subject->getEventManager()->dispatch($event);
}
return EventManager::instance()->dispatch($event);
} | php | public static function trigger($name, $subject = null, $data = null)
{
$event = new Event($name, $subject, $data);
if (is_object($subject)) {
return $subject->getEventManager()->dispatch($event);
}
return EventManager::instance()->dispatch($event);
} | [
"public",
"static",
"function",
"trigger",
"(",
"$",
"name",
",",
"$",
"subject",
"=",
"null",
",",
"$",
"data",
"=",
"null",
")",
"{",
"$",
"event",
"=",
"new",
"Event",
"(",
"$",
"name",
",",
"$",
"subject",
",",
"$",
"data",
")",
";",
"if",
... | Emits an event.
@param string $name
@param object|null $subject
@param array|null $data
@return Event | [
"Emits",
"an",
"event",
"."
] | train | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/Event/EventManager.php#L80-L88 |
GrahamDeprecated/CMS-Core | src/Seeds/PagesTableSeeder.php | PagesTableSeeder.run | public function run()
{
DB::table('pages')->delete();
$home = array(
'title' => 'Home',
'slug' => 'home',
'body' => Markdown::render(File::get(dirname(__FILE__).'/page-home.md')),
'show_title' => false,
'icon' => 'home',
... | php | public function run()
{
DB::table('pages')->delete();
$home = array(
'title' => 'Home',
'slug' => 'home',
'body' => Markdown::render(File::get(dirname(__FILE__).'/page-home.md')),
'show_title' => false,
'icon' => 'home',
... | [
"public",
"function",
"run",
"(",
")",
"{",
"DB",
"::",
"table",
"(",
"'pages'",
")",
"->",
"delete",
"(",
")",
";",
"$",
"home",
"=",
"array",
"(",
"'title'",
"=>",
"'Home'",
",",
"'slug'",
"=>",
"'home'",
",",
"'body'",
"=>",
"Markdown",
"::",
"r... | Run the database seeding.
@return void | [
"Run",
"the",
"database",
"seeding",
"."
] | train | https://github.com/GrahamDeprecated/CMS-Core/blob/5603e2bfa2fac6cf46ca3ed62d21518f2f653675/src/Seeds/PagesTableSeeder.php#L41-L69 |
simplisti/jasper-starter | src/OptionDbTrait.php | OptionDbTrait.getDatabase | public function getDatabase ($key)
{
if (array_key_exists($key, $this->database)) {
return $this->database[$key];
}
return false;
} | php | public function getDatabase ($key)
{
if (array_key_exists($key, $this->database)) {
return $this->database[$key];
}
return false;
} | [
"public",
"function",
"getDatabase",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"array_key_exists",
"(",
"$",
"key",
",",
"$",
"this",
"->",
"database",
")",
")",
"{",
"return",
"$",
"this",
"->",
"database",
"[",
"$",
"key",
"]",
";",
"}",
"return",
"f... | Get the database details or false on failure
@return string | [
"Get",
"the",
"database",
"details",
"or",
"false",
"on",
"failure"
] | train | https://github.com/simplisti/jasper-starter/blob/e03e24663e983710fb4f1afad6c85bde8553de65/src/OptionDbTrait.php#L18-L25 |
simplisti/jasper-starter | src/OptionDbTrait.php | OptionDbTrait.setDatabase | public function setDatabase ($name, $user, $pass, $host = 'localhost', $port = 3306)
{
$this->database['name'] = $name;
$this->database['user'] = $user;
$this->database['pass'] = $pass;
$this->database['host'] = $host;
$this->database['port'] = $port;
return ... | php | public function setDatabase ($name, $user, $pass, $host = 'localhost', $port = 3306)
{
$this->database['name'] = $name;
$this->database['user'] = $user;
$this->database['pass'] = $pass;
$this->database['host'] = $host;
$this->database['port'] = $port;
return ... | [
"public",
"function",
"setDatabase",
"(",
"$",
"name",
",",
"$",
"user",
",",
"$",
"pass",
",",
"$",
"host",
"=",
"'localhost'",
",",
"$",
"port",
"=",
"3306",
")",
"{",
"$",
"this",
"->",
"database",
"[",
"'name'",
"]",
"=",
"$",
"name",
";",
"$... | Set the database details
@return $this | [
"Set",
"the",
"database",
"details"
] | train | https://github.com/simplisti/jasper-starter/blob/e03e24663e983710fb4f1afad6c85bde8553de65/src/OptionDbTrait.php#L32-L41 |
simplisti/jasper-starter | src/OptionDbTrait.php | OptionDbTrait.setDatabaseUrl | public function setDatabaseUrl ($url)
{
$parts = parse_url($url);
$this->database['name'] = trim($parts['path'], '/');
$this->database['user'] = $parts['user'];
$this->database['pass'] = $parts['pass'];
$this->database['host'] = $parts['host'];
$this->databas... | php | public function setDatabaseUrl ($url)
{
$parts = parse_url($url);
$this->database['name'] = trim($parts['path'], '/');
$this->database['user'] = $parts['user'];
$this->database['pass'] = $parts['pass'];
$this->database['host'] = $parts['host'];
$this->databas... | [
"public",
"function",
"setDatabaseUrl",
"(",
"$",
"url",
")",
"{",
"$",
"parts",
"=",
"parse_url",
"(",
"$",
"url",
")",
";",
"$",
"this",
"->",
"database",
"[",
"'name'",
"]",
"=",
"trim",
"(",
"$",
"parts",
"[",
"'path'",
"]",
",",
"'/'",
")",
... | Set the database details via URL
@return $this | [
"Set",
"the",
"database",
"details",
"via",
"URL"
] | train | https://github.com/simplisti/jasper-starter/blob/e03e24663e983710fb4f1afad6c85bde8553de65/src/OptionDbTrait.php#L48-L59 |
simplisti/jasper-starter | src/OptionDbTrait.php | OptionDbTrait.setDatabaseJdbc | public function setDatabaseJdbc ($url, $dir, $class)
{
$this->database['url'] = $url;
$this->database['dir'] = $dir;
$this->database['class'] = $class;
return $this;
} | php | public function setDatabaseJdbc ($url, $dir, $class)
{
$this->database['url'] = $url;
$this->database['dir'] = $dir;
$this->database['class'] = $class;
return $this;
} | [
"public",
"function",
"setDatabaseJdbc",
"(",
"$",
"url",
",",
"$",
"dir",
",",
"$",
"class",
")",
"{",
"$",
"this",
"->",
"database",
"[",
"'url'",
"]",
"=",
"$",
"url",
";",
"$",
"this",
"->",
"database",
"[",
"'dir'",
"]",
"=",
"$",
"dir",
";"... | Set the database JDBC details
@return $this | [
"Set",
"the",
"database",
"JDBC",
"details"
] | train | https://github.com/simplisti/jasper-starter/blob/e03e24663e983710fb4f1afad6c85bde8553de65/src/OptionDbTrait.php#L66-L73 |
PeekAndPoke/psi | src/Psi.php | Psi.filterBy | public function filterBy($mapper, $condition)
{
$this->operationChain->append(new FilterByPredicate($mapper, $condition));
return $this;
} | php | public function filterBy($mapper, $condition)
{
$this->operationChain->append(new FilterByPredicate($mapper, $condition));
return $this;
} | [
"public",
"function",
"filterBy",
"(",
"$",
"mapper",
",",
"$",
"condition",
")",
"{",
"$",
"this",
"->",
"operationChain",
"->",
"append",
"(",
"new",
"FilterByPredicate",
"(",
"$",
"mapper",
",",
"$",
"condition",
")",
")",
";",
"return",
"$",
"this",
... | Filters the input stream by passing each element first through the mapper and the to the condition
This is useful of one for example want to filter all items, that have a certain property starting with a certain string:
<code>
$result = Psi::it($input)
->filterBy(
function (Person $p) { return $p->getName(); },
new ... | [
"Filters",
"the",
"input",
"stream",
"by",
"passing",
"each",
"element",
"first",
"through",
"the",
"mapper",
"and",
"the",
"to",
"the",
"condition"
] | train | https://github.com/PeekAndPoke/psi/blob/cfd45d995d3a2c2ea6ba5b1ce7b5fcc71179456f/src/Psi.php#L203-L208 |
PeekAndPoke/psi | src/Psi.php | Psi.uniqueBy | public function uniqueBy($mapper, $compareStrict = true)
{
$this->operationChain->append(new UniqueByOperation($mapper, $compareStrict));
return $this;
} | php | public function uniqueBy($mapper, $compareStrict = true)
{
$this->operationChain->append(new UniqueByOperation($mapper, $compareStrict));
return $this;
} | [
"public",
"function",
"uniqueBy",
"(",
"$",
"mapper",
",",
"$",
"compareStrict",
"=",
"true",
")",
"{",
"$",
"this",
"->",
"operationChain",
"->",
"append",
"(",
"new",
"UniqueByOperation",
"(",
"$",
"mapper",
",",
"$",
"compareStrict",
")",
")",
";",
"r... | @param callable|UnaryFunction|BinaryFunction $mapper Input mapper function
@param bool $compareStrict Whether to do strict comparison
@return $this | [
"@param",
"callable|UnaryFunction|BinaryFunction",
"$mapper",
"Input",
"mapper",
"function",
"@param",
"bool",
"$compareStrict",
"Whether",
"to",
"do",
"strict",
"comparison"
] | train | https://github.com/PeekAndPoke/psi/blob/cfd45d995d3a2c2ea6ba5b1ce7b5fcc71179456f/src/Psi.php#L438-L443 |
PeekAndPoke/psi | src/Psi.php | Psi.any | public function any($condition)
{
$this->filter($condition);
$tmp = new \stdClass();
return $this->getFirst($tmp) !== $tmp;
} | php | public function any($condition)
{
$this->filter($condition);
$tmp = new \stdClass();
return $this->getFirst($tmp) !== $tmp;
} | [
"public",
"function",
"any",
"(",
"$",
"condition",
")",
"{",
"$",
"this",
"->",
"filter",
"(",
"$",
"condition",
")",
";",
"$",
"tmp",
"=",
"new",
"\\",
"stdClass",
"(",
")",
";",
"return",
"$",
"this",
"->",
"getFirst",
"(",
"$",
"tmp",
")",
"!... | Returns true if at least one element matches the condition
@param callable|UnaryFunction|BinaryFunction $condition
@return bool | [
"Returns",
"true",
"if",
"at",
"least",
"one",
"element",
"matches",
"the",
"condition"
] | train | https://github.com/PeekAndPoke/psi/blob/cfd45d995d3a2c2ea6ba5b1ce7b5fcc71179456f/src/Psi.php#L613-L620 |
PeekAndPoke/psi | src/Psi.php | Psi.all | public function all($condition)
{
return ! $this->any(
// TODO: create Not predicate class
function ($elem, $idx) use ($condition) {
return ! $condition($elem, $idx);
}
);
} | php | public function all($condition)
{
return ! $this->any(
// TODO: create Not predicate class
function ($elem, $idx) use ($condition) {
return ! $condition($elem, $idx);
}
);
} | [
"public",
"function",
"all",
"(",
"$",
"condition",
")",
"{",
"return",
"!",
"$",
"this",
"->",
"any",
"(",
"// TODO: create Not predicate class",
"function",
"(",
"$",
"elem",
",",
"$",
"idx",
")",
"use",
"(",
"$",
"condition",
")",
"{",
"return",
"!",
... | Returns true if all elements match the condition
@param callable|UnaryFunction|BinaryFunction $condition
@return bool | [
"Returns",
"true",
"if",
"all",
"elements",
"match",
"the",
"condition"
] | train | https://github.com/PeekAndPoke/psi/blob/cfd45d995d3a2c2ea6ba5b1ce7b5fcc71179456f/src/Psi.php#L629-L637 |
PeekAndPoke/psi | src/Psi.php | Psi.solveOperationsAndApplyTerminal | private function solveOperationsAndApplyTerminal(TerminalOperation $terminal)
{
// When we have not a single operation in the chain we add a dummy one, in order to map down multiple input
// living inside the \AppendIterator (in case we have multiple inputs)
if (count($this->operationChain) ... | php | private function solveOperationsAndApplyTerminal(TerminalOperation $terminal)
{
// When we have not a single operation in the chain we add a dummy one, in order to map down multiple input
// living inside the \AppendIterator (in case we have multiple inputs)
if (count($this->operationChain) ... | [
"private",
"function",
"solveOperationsAndApplyTerminal",
"(",
"TerminalOperation",
"$",
"terminal",
")",
"{",
"// When we have not a single operation in the chain we add a dummy one, in order to map down multiple input",
"// living inside the \\AppendIterator (in case we have multiple inputs)",... | @param TerminalOperation $terminal
@return mixed | [
"@param",
"TerminalOperation",
"$terminal"
] | train | https://github.com/PeekAndPoke/psi/blob/cfd45d995d3a2c2ea6ba5b1ce7b5fcc71179456f/src/Psi.php#L646-L661 |
webforge-labs/psc-cms | lib/Psc/Code/Generate/GMethod.php | GMethod.php | public function php($baseIndent = 0) {
$cr = "\n";
$php = $this->phpDocBlock($baseIndent);
// vor die modifier muss das indent
$php .= str_repeat(' ',$baseIndent);
$ms = array(self::MODIFIER_ABSTRACT => 'abstract',
self::MODIFIER_PUBLIC => 'public',
sel... | php | public function php($baseIndent = 0) {
$cr = "\n";
$php = $this->phpDocBlock($baseIndent);
// vor die modifier muss das indent
$php .= str_repeat(' ',$baseIndent);
$ms = array(self::MODIFIER_ABSTRACT => 'abstract',
self::MODIFIER_PUBLIC => 'public',
sel... | [
"public",
"function",
"php",
"(",
"$",
"baseIndent",
"=",
"0",
")",
"{",
"$",
"cr",
"=",
"\"\\n\"",
";",
"$",
"php",
"=",
"$",
"this",
"->",
"phpDocBlock",
"(",
"$",
"baseIndent",
")",
";",
"// vor die modifier muss das indent",
"$",
"php",
".=",
"str_re... | Gibt den PHP Code für die Methode zurück
Nach der } ist kein LF | [
"Gibt",
"den",
"PHP",
"Code",
"für",
"die",
"Methode",
"zurück"
] | train | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/Code/Generate/GMethod.php#L49-L73 |
PortaText/php-sdk | src/PortaText/Command/Api/MyPassword.php | MyPassword.getEndpoint | protected function getEndpoint($method)
{
$endpoint = 'me/password';
$reset = $this->getArgument('reset');
$nonce = $this->getArgument('nonce');
if (!is_null($reset)) {
$endpoint .= '/reset';
$this->delArgument('reset');
}
if (!is_null($nonce))... | php | protected function getEndpoint($method)
{
$endpoint = 'me/password';
$reset = $this->getArgument('reset');
$nonce = $this->getArgument('nonce');
if (!is_null($reset)) {
$endpoint .= '/reset';
$this->delArgument('reset');
}
if (!is_null($nonce))... | [
"protected",
"function",
"getEndpoint",
"(",
"$",
"method",
")",
"{",
"$",
"endpoint",
"=",
"'me/password'",
";",
"$",
"reset",
"=",
"$",
"this",
"->",
"getArgument",
"(",
"'reset'",
")",
";",
"$",
"nonce",
"=",
"$",
"this",
"->",
"getArgument",
"(",
"... | Returns a string with the endpoint for the given command.
@param string $method Method for this command.
@return string | [
"Returns",
"a",
"string",
"with",
"the",
"endpoint",
"for",
"the",
"given",
"command",
"."
] | train | https://github.com/PortaText/php-sdk/blob/dbe04ef043db5b251953f9de57aa4d0f1785dfcc/src/PortaText/Command/Api/MyPassword.php#L77-L91 |
fubhy/graphql-php | src/Type/Definition/Types/Scalars/FloatType.php | FloatType.coerceLiteral | public function coerceLiteral(Node $node)
{
if ($node instanceof IntValue || $node instanceof FloatValue) {
$num = (float) $node->get('value');
if ($num <= PHP_INT_MAX && $num >= -PHP_INT_MAX) {
return $num;
}
}
return NULL;
} | php | public function coerceLiteral(Node $node)
{
if ($node instanceof IntValue || $node instanceof FloatValue) {
$num = (float) $node->get('value');
if ($num <= PHP_INT_MAX && $num >= -PHP_INT_MAX) {
return $num;
}
}
return NULL;
} | [
"public",
"function",
"coerceLiteral",
"(",
"Node",
"$",
"node",
")",
"{",
"if",
"(",
"$",
"node",
"instanceof",
"IntValue",
"||",
"$",
"node",
"instanceof",
"FloatValue",
")",
"{",
"$",
"num",
"=",
"(",
"float",
")",
"$",
"node",
"->",
"get",
"(",
"... | {@inheritdoc} | [
"{"
] | train | https://github.com/fubhy/graphql-php/blob/c1de2233c731ca29e5c5db4c43f3b9db36478c83/src/Type/Definition/Types/Scalars/FloatType.php#L28-L39 |
limen/php-jobs | src/Helper.php | Helper.compareDatetime | public static function compareDatetime($a, $b)
{
$timea = strtotime($a);
$timeb = strtotime($b);
if ($timea === false || $timeb === false) {
return false;
}
if ($timea > $timeb) {
return 1;
} elseif ($timea < $timeb) {
return -1;
... | php | public static function compareDatetime($a, $b)
{
$timea = strtotime($a);
$timeb = strtotime($b);
if ($timea === false || $timeb === false) {
return false;
}
if ($timea > $timeb) {
return 1;
} elseif ($timea < $timeb) {
return -1;
... | [
"public",
"static",
"function",
"compareDatetime",
"(",
"$",
"a",
",",
"$",
"b",
")",
"{",
"$",
"timea",
"=",
"strtotime",
"(",
"$",
"a",
")",
";",
"$",
"timeb",
"=",
"strtotime",
"(",
"$",
"b",
")",
";",
"if",
"(",
"$",
"timea",
"===",
"false",
... | compare two datetime
@param string $a yyyy-mm-dd hh:ii:ss e.g.
@param string $b yyyy-mm-dd hh:ii:ss e.g.
@return int|bool return false if $a or $b is not valid | [
"compare",
"two",
"datetime"
] | train | https://github.com/limen/php-jobs/blob/525f4082b49a7a3e69acb4cea3a622244f1616b9/src/Helper.php#L17-L33 |
joomla-framework/crypt | src/Cipher/Sodium.php | Sodium.decrypt | public function decrypt($data, Key $key)
{
// Validate key.
if ($key->getType() !== 'sodium')
{
throw new InvalidKeyTypeException('sodium', $key->getType());
}
if (!$this->nonce)
{
throw new \RuntimeException('Missing nonce to decrypt data');
}
$decrypted = Compat::crypto_box_open(
$data,
... | php | public function decrypt($data, Key $key)
{
// Validate key.
if ($key->getType() !== 'sodium')
{
throw new InvalidKeyTypeException('sodium', $key->getType());
}
if (!$this->nonce)
{
throw new \RuntimeException('Missing nonce to decrypt data');
}
$decrypted = Compat::crypto_box_open(
$data,
... | [
"public",
"function",
"decrypt",
"(",
"$",
"data",
",",
"Key",
"$",
"key",
")",
"{",
"// Validate key.",
"if",
"(",
"$",
"key",
"->",
"getType",
"(",
")",
"!==",
"'sodium'",
")",
"{",
"throw",
"new",
"InvalidKeyTypeException",
"(",
"'sodium'",
",",
"$",
... | Method to decrypt a data string.
@param string $data The encrypted string to decrypt.
@param Key $key The key object to use for decryption.
@return string The decrypted data string.
@since 1.4.0
@throws \RuntimeException | [
"Method",
"to",
"decrypt",
"a",
"data",
"string",
"."
] | train | https://github.com/joomla-framework/crypt/blob/5b24370bd5f07d2b305f66e62294c6d10a3f619d/src/Cipher/Sodium.php#L42-L67 |
joomla-framework/crypt | src/Cipher/Sodium.php | Sodium.encrypt | public function encrypt($data, Key $key)
{
// Validate key.
if ($key->getType() !== 'sodium')
{
throw new InvalidKeyTypeException('sodium', $key->getType());
}
if (!$this->nonce)
{
throw new \RuntimeException('Missing nonce to decrypt data');
}
return Compat::crypto_box(
$data,
$this->non... | php | public function encrypt($data, Key $key)
{
// Validate key.
if ($key->getType() !== 'sodium')
{
throw new InvalidKeyTypeException('sodium', $key->getType());
}
if (!$this->nonce)
{
throw new \RuntimeException('Missing nonce to decrypt data');
}
return Compat::crypto_box(
$data,
$this->non... | [
"public",
"function",
"encrypt",
"(",
"$",
"data",
",",
"Key",
"$",
"key",
")",
"{",
"// Validate key.",
"if",
"(",
"$",
"key",
"->",
"getType",
"(",
")",
"!==",
"'sodium'",
")",
"{",
"throw",
"new",
"InvalidKeyTypeException",
"(",
"'sodium'",
",",
"$",
... | Method to encrypt a data string.
@param string $data The data string to encrypt.
@param Key $key The key object to use for encryption.
@return string The encrypted data string.
@since 1.4.0
@throws \RuntimeException | [
"Method",
"to",
"encrypt",
"a",
"data",
"string",
"."
] | train | https://github.com/joomla-framework/crypt/blob/5b24370bd5f07d2b305f66e62294c6d10a3f619d/src/Cipher/Sodium.php#L80-L98 |
joomla-framework/crypt | src/Cipher/Sodium.php | Sodium.generateKey | public function generateKey(array $options = [])
{
// Generate the encryption key.
$pair = Compat::crypto_box_keypair();
return new Key('sodium', Compat::crypto_box_secretkey($pair), Compat::crypto_box_publickey($pair));
} | php | public function generateKey(array $options = [])
{
// Generate the encryption key.
$pair = Compat::crypto_box_keypair();
return new Key('sodium', Compat::crypto_box_secretkey($pair), Compat::crypto_box_publickey($pair));
} | [
"public",
"function",
"generateKey",
"(",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"// Generate the encryption key.",
"$",
"pair",
"=",
"Compat",
"::",
"crypto_box_keypair",
"(",
")",
";",
"return",
"new",
"Key",
"(",
"'sodium'",
",",
"Compat",
"::"... | Method to generate a new encryption key object.
@param array $options Key generation options.
@return Key
@since 1.4.0
@throws RuntimeException | [
"Method",
"to",
"generate",
"a",
"new",
"encryption",
"key",
"object",
"."
] | train | https://github.com/joomla-framework/crypt/blob/5b24370bd5f07d2b305f66e62294c6d10a3f619d/src/Cipher/Sodium.php#L110-L116 |
aedart/laravel-helpers | src/Traits/Hashing/HashTrait.php | HashTrait.getHash | public function getHash(): ?Hasher
{
if (!$this->hasHash()) {
$this->setHash($this->getDefaultHash());
}
return $this->hash;
} | php | public function getHash(): ?Hasher
{
if (!$this->hasHash()) {
$this->setHash($this->getDefaultHash());
}
return $this->hash;
} | [
"public",
"function",
"getHash",
"(",
")",
":",
"?",
"Hasher",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"hasHash",
"(",
")",
")",
"{",
"$",
"this",
"->",
"setHash",
"(",
"$",
"this",
"->",
"getDefaultHash",
"(",
")",
")",
";",
"}",
"return",
"$",
... | Get hash
If no hash has been set, this method will
set and return a default hash, if any such
value is available
@see getDefaultHash()
@return Hasher|null hash or null if none hash has been set | [
"Get",
"hash"
] | train | https://github.com/aedart/laravel-helpers/blob/8b81a2d6658f3f8cb62b6be2c34773aaa2df219a/src/Traits/Hashing/HashTrait.php#L53-L59 |
restruct/silverstripe-namedlinkfield | src/NamedLinkFormField.php | NamedLinkFormField.setForm | public function setForm($form)
{
foreach ($this->namedLinkCompositeField->compositeDatabaseFields() as $field => $spec) {
$fieldHandle = 'field' . $field;
$this->{$fieldHandle}->setForm($form);
}
// $this->fieldPageID->setForm($form);
// $this->fieldPageAnchor->setForm($for... | php | public function setForm($form)
{
foreach ($this->namedLinkCompositeField->compositeDatabaseFields() as $field => $spec) {
$fieldHandle = 'field' . $field;
$this->{$fieldHandle}->setForm($form);
}
// $this->fieldPageID->setForm($form);
// $this->fieldPageAnchor->setForm($for... | [
"public",
"function",
"setForm",
"(",
"$",
"form",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"namedLinkCompositeField",
"->",
"compositeDatabaseFields",
"(",
")",
"as",
"$",
"field",
"=>",
"$",
"spec",
")",
"{",
"$",
"fieldHandle",
"=",
"'field'",
".",
... | Set the container form.
This is called automatically when fields are added to forms.
@param Form $form
@return $this | [
"Set",
"the",
"container",
"form",
"."
] | train | https://github.com/restruct/silverstripe-namedlinkfield/blob/567c49fdc1b24c219dec2e989fc2013b1c7951af/src/NamedLinkFormField.php#L150-L167 |
arsengoian/viper-framework | src/Viper/Core/Model/Model.php | Model.all | public static function all(string $key = NULL, ?string $value = NULL): Collection {
return static::attempt(function () use ($key, $value): Collection {
$db = DB::instance();
if ($key === NULL)
$dat = $db -> selectall(static::table());
else $dat = $db -> find(s... | php | public static function all(string $key = NULL, ?string $value = NULL): Collection {
return static::attempt(function () use ($key, $value): Collection {
$db = DB::instance();
if ($key === NULL)
$dat = $db -> selectall(static::table());
else $dat = $db -> find(s... | [
"public",
"static",
"function",
"all",
"(",
"string",
"$",
"key",
"=",
"NULL",
",",
"?",
"string",
"$",
"value",
"=",
"NULL",
")",
":",
"Collection",
"{",
"return",
"static",
"::",
"attempt",
"(",
"function",
"(",
")",
"use",
"(",
"$",
"key",
",",
... | TODO TODO add more of these: search | [
"TODO",
"TODO",
"add",
"more",
"of",
"these",
":",
"search"
] | train | https://github.com/arsengoian/viper-framework/blob/22796c5cc219cae3ca0b4af370a347ba2acab0f2/src/Viper/Core/Model/Model.php#L41-L54 |
arsengoian/viper-framework | src/Viper/Core/Model/Model.php | Model.get | public function get(string $fld) {
return static::attempt(function() use ($fld) {
return self::modelConfig() -> typeControl($fld, parent::get($fld));
});
} | php | public function get(string $fld) {
return static::attempt(function() use ($fld) {
return self::modelConfig() -> typeControl($fld, parent::get($fld));
});
} | [
"public",
"function",
"get",
"(",
"string",
"$",
"fld",
")",
"{",
"return",
"static",
"::",
"attempt",
"(",
"function",
"(",
")",
"use",
"(",
"$",
"fld",
")",
"{",
"return",
"self",
"::",
"modelConfig",
"(",
")",
"->",
"typeControl",
"(",
"$",
"fld",... | TODO find | [
"TODO",
"find"
] | train | https://github.com/arsengoian/viper-framework/blob/22796c5cc219cae3ca0b4af370a347ba2acab0f2/src/Viper/Core/Model/Model.php#L60-L64 |
flipboxstudio/orm-manager | src/Flipbox/OrmManager/Relations/MorphedByMany.php | MorphedByMany.setDefaultOptions | protected function setDefaultOptions(array $options=[])
{
$this->text['relation_name_text'] = $this->command->paintString('relation name', 'brown');
if (! isset($options['name'])) {
$refModel = new ReflectionClass($this->model);
$name = $this->getRelationName(strtolower($ref... | php | protected function setDefaultOptions(array $options=[])
{
$this->text['relation_name_text'] = $this->command->paintString('relation name', 'brown');
if (! isset($options['name'])) {
$refModel = new ReflectionClass($this->model);
$name = $this->getRelationName(strtolower($ref... | [
"protected",
"function",
"setDefaultOptions",
"(",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"this",
"->",
"text",
"[",
"'relation_name_text'",
"]",
"=",
"$",
"this",
"->",
"command",
"->",
"paintString",
"(",
"'relation name'",
",",
"'brown'",
... | set default options
@param array $options
@return void | [
"set",
"default",
"options"
] | train | https://github.com/flipboxstudio/orm-manager/blob/4288426517f53d05177b8729c4ba94c5beca9a98/src/Flipbox/OrmManager/Relations/MorphedByMany.php#L30-L48 |
flipboxstudio/orm-manager | src/Flipbox/OrmManager/Relations/MorphedByMany.php | MorphedByMany.setConnectedRelationOptions | protected function setConnectedRelationOptions()
{
$foreignKey = $this->defaultOptions['foreign_key'];
if (! $this->db->isTableExists($table = $this->defaultOptions['pivot_table'])) {
$table = $this->options['pivot_table'] = $this->command->choice(
"Can't find table {$th... | php | protected function setConnectedRelationOptions()
{
$foreignKey = $this->defaultOptions['foreign_key'];
if (! $this->db->isTableExists($table = $this->defaultOptions['pivot_table'])) {
$table = $this->options['pivot_table'] = $this->command->choice(
"Can't find table {$th... | [
"protected",
"function",
"setConnectedRelationOptions",
"(",
")",
"{",
"$",
"foreignKey",
"=",
"$",
"this",
"->",
"defaultOptions",
"[",
"'foreign_key'",
"]",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"db",
"->",
"isTableExists",
"(",
"$",
"table",
"=",
"$",... | set connected db relation options
@return void | [
"set",
"connected",
"db",
"relation",
"options"
] | train | https://github.com/flipboxstudio/orm-manager/blob/4288426517f53d05177b8729c4ba94c5beca9a98/src/Flipbox/OrmManager/Relations/MorphedByMany.php#L88-L116 |
flipboxstudio/orm-manager | src/Flipbox/OrmManager/Relations/MorphedByMany.php | MorphedByMany.askToUseCustomeOptions | protected function askToUseCustomeOptions()
{
$this->options['pivot_table'] = $this->command->ask(
"The {$this->text['pivot_text']} of both relation will be?",
$this->defaultOptions['pivot_table']
... | php | protected function askToUseCustomeOptions()
{
$this->options['pivot_table'] = $this->command->ask(
"The {$this->text['pivot_text']} of both relation will be?",
$this->defaultOptions['pivot_table']
... | [
"protected",
"function",
"askToUseCustomeOptions",
"(",
")",
"{",
"$",
"this",
"->",
"options",
"[",
"'pivot_table'",
"]",
"=",
"$",
"this",
"->",
"command",
"->",
"ask",
"(",
"\"The {$this->text['pivot_text']} of both relation will be?\"",
",",
"$",
"this",
"->",
... | ask to use custome options
@return void | [
"ask",
"to",
"use",
"custome",
"options"
] | train | https://github.com/flipboxstudio/orm-manager/blob/4288426517f53d05177b8729c4ba94c5beca9a98/src/Flipbox/OrmManager/Relations/MorphedByMany.php#L137-L156 |
spiral-modules/auth | source/Auth/Traits/OperatorTrait.php | OperatorTrait.withOperator | public function withOperator(TokenOperatorInterface $operator): TokenInterface
{
$token = clone $this;
$token->operator = $operator;
/** @var TokenInterface $token */
return $token;
} | php | public function withOperator(TokenOperatorInterface $operator): TokenInterface
{
$token = clone $this;
$token->operator = $operator;
/** @var TokenInterface $token */
return $token;
} | [
"public",
"function",
"withOperator",
"(",
"TokenOperatorInterface",
"$",
"operator",
")",
":",
"TokenInterface",
"{",
"$",
"token",
"=",
"clone",
"$",
"this",
";",
"$",
"token",
"->",
"operator",
"=",
"$",
"operator",
";",
"/** @var TokenInterface $token */",
"... | {@inheritdoc} | [
"{"
] | train | https://github.com/spiral-modules/auth/blob/24e2070028f7257e8192914556963a4794428a99/source/Auth/Traits/OperatorTrait.php#L36-L43 |
phpmob/changmin | src/PhpMob/ChangMinBundle/Fixture/TaxonFactory.php | TaxonFactory.create | public function create(array $options = [])
{
$options = $this->optionsResolver->resolve($options);
/** @var TaxonInterface $taxon */
$taxon = $this->taxonRepository->findOneBy(['code' => $options['code']]);
if (null === $taxon) {
$taxon = $this->taxonFactory->createNew... | php | public function create(array $options = [])
{
$options = $this->optionsResolver->resolve($options);
/** @var TaxonInterface $taxon */
$taxon = $this->taxonRepository->findOneBy(['code' => $options['code']]);
if (null === $taxon) {
$taxon = $this->taxonFactory->createNew... | [
"public",
"function",
"create",
"(",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"options",
"=",
"$",
"this",
"->",
"optionsResolver",
"->",
"resolve",
"(",
"$",
"options",
")",
";",
"/** @var TaxonInterface $taxon */",
"$",
"taxon",
"=",
"$",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/phpmob/changmin/blob/bfebb1561229094d1c138574abab75f2f1d17d66/src/PhpMob/ChangMinBundle/Fixture/TaxonFactory.php#L70-L90 |
phpmob/changmin | src/PhpMob/ChangMinBundle/Fixture/TaxonFactory.php | TaxonFactory.configureOptions | protected function configureOptions(OptionsResolver $resolver)
{
$resolver
->setDefault('name', function (Options $options) {
return $this->faker->words(3, true);
})
->setDefault('slug', function (Options $options) {
return $options['name']... | php | protected function configureOptions(OptionsResolver $resolver)
{
$resolver
->setDefault('name', function (Options $options) {
return $this->faker->words(3, true);
})
->setDefault('slug', function (Options $options) {
return $options['name']... | [
"protected",
"function",
"configureOptions",
"(",
"OptionsResolver",
"$",
"resolver",
")",
"{",
"$",
"resolver",
"->",
"setDefault",
"(",
"'name'",
",",
"function",
"(",
"Options",
"$",
"options",
")",
"{",
"return",
"$",
"this",
"->",
"faker",
"->",
"words"... | {@inheritdoc} | [
"{"
] | train | https://github.com/phpmob/changmin/blob/bfebb1561229094d1c138574abab75f2f1d17d66/src/PhpMob/ChangMinBundle/Fixture/TaxonFactory.php#L95-L113 |
Sedona-Solutions/sedona-sbo | src/Sedona/SBORuntimeBundle/Form/Type/ColorPickerType.php | ColorPickerType.buildView | public function buildView(FormView $view, FormInterface $form, array $options)
{
$optionsColorPicker = [];
if (array_key_exists('color-format', $options) && empty($options['color-format']) == false) {
$optionsColorPicker['format'] = $options['color-format'];
}
if (array_k... | php | public function buildView(FormView $view, FormInterface $form, array $options)
{
$optionsColorPicker = [];
if (array_key_exists('color-format', $options) && empty($options['color-format']) == false) {
$optionsColorPicker['format'] = $options['color-format'];
}
if (array_k... | [
"public",
"function",
"buildView",
"(",
"FormView",
"$",
"view",
",",
"FormInterface",
"$",
"form",
",",
"array",
"$",
"options",
")",
"{",
"$",
"optionsColorPicker",
"=",
"[",
"]",
";",
"if",
"(",
"array_key_exists",
"(",
"'color-format'",
",",
"$",
"opti... | {@inheritdoc} | [
"{"
] | train | https://github.com/Sedona-Solutions/sedona-sbo/blob/8548be4170d191cb1a3e263577aaaab49f04d5ce/src/Sedona/SBORuntimeBundle/Form/Type/ColorPickerType.php#L53-L69 |
PortaText/php-sdk | src/PortaText/Command/Result.php | Result.errors | public function errors()
{
if (isset($this->data) && isset($this->data["error_description"])) {
return $this->data["error_description"];
}
return null;
} | php | public function errors()
{
if (isset($this->data) && isset($this->data["error_description"])) {
return $this->data["error_description"];
}
return null;
} | [
"public",
"function",
"errors",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"data",
")",
"&&",
"isset",
"(",
"$",
"this",
"->",
"data",
"[",
"\"error_description\"",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"data",
"[",
"\"er... | When the request was not successful, this will return all the errors.
@return array|null | [
"When",
"the",
"request",
"was",
"not",
"successful",
"this",
"will",
"return",
"all",
"the",
"errors",
"."
] | train | https://github.com/PortaText/php-sdk/blob/dbe04ef043db5b251953f9de57aa4d0f1785dfcc/src/PortaText/Command/Result.php#L49-L55 |
slashworks/control-bundle | src/Slashworks/BackendBundle/Model/SystemSettings.php | SystemSettings.set | public static function set($key, $value){
$oSystemSetting = SystemSettingsQuery::create()->findOneBy("key",$key);
$oSystemSetting->setKey($key);
$oSystemSetting->setValue($value);
$oSystemSetting->save();
return $value;
} | php | public static function set($key, $value){
$oSystemSetting = SystemSettingsQuery::create()->findOneBy("key",$key);
$oSystemSetting->setKey($key);
$oSystemSetting->setValue($value);
$oSystemSetting->save();
return $value;
} | [
"public",
"static",
"function",
"set",
"(",
"$",
"key",
",",
"$",
"value",
")",
"{",
"$",
"oSystemSetting",
"=",
"SystemSettingsQuery",
"::",
"create",
"(",
")",
"->",
"findOneBy",
"(",
"\"key\"",
",",
"$",
"key",
")",
";",
"$",
"oSystemSetting",
"->",
... | @param $key
@param $value
@return mixed
@throws \Exception
@throws \PropelException | [
"@param",
"$key",
"@param",
"$value"
] | train | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/BackendBundle/Model/SystemSettings.php#L33-L39 |
photogabble/laravel-remember-uploads | src/Middleware/RememberFileUploads.php | RememberFileUploads.handle | public function handle($request, Closure $next, $fields = ['*'])
{
$this->session->flash('_remembered_files', new RememberedFileBag(array_merge($this->checkRequestForRemembered($request, $fields), $this->remember($request, $fields))));
return $next($request);
} | php | public function handle($request, Closure $next, $fields = ['*'])
{
$this->session->flash('_remembered_files', new RememberedFileBag(array_merge($this->checkRequestForRemembered($request, $fields), $this->remember($request, $fields))));
return $next($request);
} | [
"public",
"function",
"handle",
"(",
"$",
"request",
",",
"Closure",
"$",
"next",
",",
"$",
"fields",
"=",
"[",
"'*'",
"]",
")",
"{",
"$",
"this",
"->",
"session",
"->",
"flash",
"(",
"'_remembered_files'",
",",
"new",
"RememberedFileBag",
"(",
"array_me... | Handle an incoming request.
@todo write a test to check that adding additional uploaded files to the same session doesn't break things
@param \Illuminate\Http\Request $request
@param \Closure $next
@param array $fields
@return mixed
@throws \Exception | [
"Handle",
"an",
"incoming",
"request",
"."
] | train | https://github.com/photogabble/laravel-remember-uploads/blob/28d0667d2de74e5cd4f1980920df828cc5f99514/src/Middleware/RememberFileUploads.php#L88-L92 |
photogabble/laravel-remember-uploads | src/Middleware/RememberFileUploads.php | RememberFileUploads.checkRequestForRemembered | private function checkRequestForRemembered($request, array $fields)
{
$remembered = $request->get('_rememberedFiles', []);
$files = ($fields[0] === '*') ? $remembered : array_filter($remembered, function($k) use ($fields) { return in_array($k, $fields); }, ARRAY_FILTER_USE_KEY);
return $this... | php | private function checkRequestForRemembered($request, array $fields)
{
$remembered = $request->get('_rememberedFiles', []);
$files = ($fields[0] === '*') ? $remembered : array_filter($remembered, function($k) use ($fields) { return in_array($k, $fields); }, ARRAY_FILTER_USE_KEY);
return $this... | [
"private",
"function",
"checkRequestForRemembered",
"(",
"$",
"request",
",",
"array",
"$",
"fields",
")",
"{",
"$",
"remembered",
"=",
"$",
"request",
"->",
"get",
"(",
"'_rememberedFiles'",
",",
"[",
"]",
")",
";",
"$",
"files",
"=",
"(",
"$",
"fields"... | Remember all files found in request.
@param \Illuminate\Http\Request $request
@param array $fields
@return array|RememberedFile[] | [
"Remember",
"all",
"files",
"found",
"in",
"request",
"."
] | train | https://github.com/photogabble/laravel-remember-uploads/blob/28d0667d2de74e5cd4f1980920df828cc5f99514/src/Middleware/RememberFileUploads.php#L101-L106 |
photogabble/laravel-remember-uploads | src/Middleware/RememberFileUploads.php | RememberFileUploads.remember | private function remember($request, array $fields)
{
$files = ($fields[0] === '*') ? $request->files : $request->only($fields);
return $this->rememberFilesFactory($files);
} | php | private function remember($request, array $fields)
{
$files = ($fields[0] === '*') ? $request->files : $request->only($fields);
return $this->rememberFilesFactory($files);
} | [
"private",
"function",
"remember",
"(",
"$",
"request",
",",
"array",
"$",
"fields",
")",
"{",
"$",
"files",
"=",
"(",
"$",
"fields",
"[",
"0",
"]",
"===",
"'*'",
")",
"?",
"$",
"request",
"->",
"files",
":",
"$",
"request",
"->",
"only",
"(",
"$... | Remember all files found in request.
@param \Illuminate\Http\Request $request
@param array $fields
@return array|RememberedFile[] | [
"Remember",
"all",
"files",
"found",
"in",
"request",
"."
] | train | https://github.com/photogabble/laravel-remember-uploads/blob/28d0667d2de74e5cd4f1980920df828cc5f99514/src/Middleware/RememberFileUploads.php#L115-L119 |
photogabble/laravel-remember-uploads | src/Middleware/RememberFileUploads.php | RememberFileUploads.rememberFilesFactory | private function rememberFilesFactory($files, $prefix = '')
{
$result = [];
foreach ($files as $key => $file) {
$cacheKey = $prefix . (empty($prefix) ? '' : '.') . $key;
if (is_string($file)){
if (! $this->cache->has('_remembered_files.'.$cacheKey)){
... | php | private function rememberFilesFactory($files, $prefix = '')
{
$result = [];
foreach ($files as $key => $file) {
$cacheKey = $prefix . (empty($prefix) ? '' : '.') . $key;
if (is_string($file)){
if (! $this->cache->has('_remembered_files.'.$cacheKey)){
... | [
"private",
"function",
"rememberFilesFactory",
"(",
"$",
"files",
",",
"$",
"prefix",
"=",
"''",
")",
"{",
"$",
"result",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"files",
"as",
"$",
"key",
"=>",
"$",
"file",
")",
"{",
"$",
"cacheKey",
"=",
"$",
... | Recursive factory method to create RememberedFile from UploadedFile.
@param array|UploadedFile[] $files
@param string $prefix
@return array|RememberedFile[] | [
"Recursive",
"factory",
"method",
"to",
"create",
"RememberedFile",
"from",
"UploadedFile",
"."
] | train | https://github.com/photogabble/laravel-remember-uploads/blob/28d0667d2de74e5cd4f1980920df828cc5f99514/src/Middleware/RememberFileUploads.php#L128-L158 |
parsnick/steak | src/Console/PullCommand.php | PullCommand.execute | protected function execute(InputInterface $input, OutputInterface $output)
{
$this->setIo($input, $output);
/** @var Repository $config */
$config = $this->container['config'];
$sourceRepoPath = $config['source.directory'];
$sourceRepoUrl = $config['source.git.url'];
... | php | protected function execute(InputInterface $input, OutputInterface $output)
{
$this->setIo($input, $output);
/** @var Repository $config */
$config = $this->container['config'];
$sourceRepoPath = $config['source.directory'];
$sourceRepoUrl = $config['source.git.url'];
... | [
"protected",
"function",
"execute",
"(",
"InputInterface",
"$",
"input",
",",
"OutputInterface",
"$",
"output",
")",
"{",
"$",
"this",
"->",
"setIo",
"(",
"$",
"input",
",",
"$",
"output",
")",
";",
"/** @var Repository $config */",
"$",
"config",
"=",
"$",
... | Execute the command.
@param InputInterface $input
@param OutputInterface $output
@return void | [
"Execute",
"the",
"command",
"."
] | train | https://github.com/parsnick/steak/blob/461869189a640938438187330f6c50aca97c5ccc/src/Console/PullCommand.php#L64-L115 |
xinix-technology/norm | src/Norm/Cursor/BonoCursor.php | BonoCursor.count | public function count($foundOnly = false)
{
// TODO revisit me
if ($foundOnly) {
$this->rewind();
return $this->count;
} else {
$this->rewind();
return count($this->buffer);
}
} | php | public function count($foundOnly = false)
{
// TODO revisit me
if ($foundOnly) {
$this->rewind();
return $this->count;
} else {
$this->rewind();
return count($this->buffer);
}
} | [
"public",
"function",
"count",
"(",
"$",
"foundOnly",
"=",
"false",
")",
"{",
"// TODO revisit me",
"if",
"(",
"$",
"foundOnly",
")",
"{",
"$",
"this",
"->",
"rewind",
"(",
")",
";",
"return",
"$",
"this",
"->",
"count",
";",
"}",
"else",
"{",
"$",
... | {@inheritDoc} | [
"{"
] | train | https://github.com/xinix-technology/norm/blob/c357f7d3a75d05324dd84b8f6a968a094c53d603/src/Norm/Cursor/BonoCursor.php#L46-L58 |
xinix-technology/norm | src/Norm/Cursor/BonoCursor.php | BonoCursor.current | public function current()
{
$current = $this->next[1];
return isset($current) ? $this->collection->attach($current) : null;
} | php | public function current()
{
$current = $this->next[1];
return isset($current) ? $this->collection->attach($current) : null;
} | [
"public",
"function",
"current",
"(",
")",
"{",
"$",
"current",
"=",
"$",
"this",
"->",
"next",
"[",
"1",
"]",
";",
"return",
"isset",
"(",
"$",
"current",
")",
"?",
"$",
"this",
"->",
"collection",
"->",
"attach",
"(",
"$",
"current",
")",
":",
... | {@inheritDoc} | [
"{"
] | train | https://github.com/xinix-technology/norm/blob/c357f7d3a75d05324dd84b8f6a968a094c53d603/src/Norm/Cursor/BonoCursor.php#L71-L75 |
xinix-technology/norm | src/Norm/Cursor/BonoCursor.php | BonoCursor.next | public function next()
{
// Try to get the next element in our data buffer.
$this->next = each($this->buffer);
// Past the end of the data buffer
if (false === $this->next && !$this->isQueried) {
$this->isQueried = true;
$connection = $this->collection->getC... | php | public function next()
{
// Try to get the next element in our data buffer.
$this->next = each($this->buffer);
// Past the end of the data buffer
if (false === $this->next && !$this->isQueried) {
$this->isQueried = true;
$connection = $this->collection->getC... | [
"public",
"function",
"next",
"(",
")",
"{",
"// Try to get the next element in our data buffer.",
"$",
"this",
"->",
"next",
"=",
"each",
"(",
"$",
"this",
"->",
"buffer",
")",
";",
"// Past the end of the data buffer",
"if",
"(",
"false",
"===",
"$",
"this",
"... | {@inheritDoc} | [
"{"
] | train | https://github.com/xinix-technology/norm/blob/c357f7d3a75d05324dd84b8f6a968a094c53d603/src/Norm/Cursor/BonoCursor.php#L80-L101 |
rayrutjes/domain-foundation | src/Audit/AuditInterceptor.php | AuditInterceptor.handle | public function handle(Command $command, UnitOfWork $unitOfWork, InterceptorChain $interceptorChain)
{
$auditListener = new AuditUnitOfWorkListener($command, $this->auditDataProvider, $this->auditLogger);
$unitOfWork->registerListener($auditListener);
$result = $interceptorChain->proceed();... | php | public function handle(Command $command, UnitOfWork $unitOfWork, InterceptorChain $interceptorChain)
{
$auditListener = new AuditUnitOfWorkListener($command, $this->auditDataProvider, $this->auditLogger);
$unitOfWork->registerListener($auditListener);
$result = $interceptorChain->proceed();... | [
"public",
"function",
"handle",
"(",
"Command",
"$",
"command",
",",
"UnitOfWork",
"$",
"unitOfWork",
",",
"InterceptorChain",
"$",
"interceptorChain",
")",
"{",
"$",
"auditListener",
"=",
"new",
"AuditUnitOfWorkListener",
"(",
"$",
"command",
",",
"$",
"this",
... | @param Command $command
@param UnitOfWork $unitOfWork
@param InterceptorChain $interceptorChain
@return mixed The result of the command handler, if any. | [
"@param",
"Command",
"$command",
"@param",
"UnitOfWork",
"$unitOfWork",
"@param",
"InterceptorChain",
"$interceptorChain"
] | train | https://github.com/rayrutjes/domain-foundation/blob/2bce7cd6a6612f718e70e3176589c1abf39d1a3e/src/Audit/AuditInterceptor.php#L41-L50 |
OwlyCode/StreamingBird | src/Monitor.php | Monitor.get | public function get($name)
{
if (!$this->has($name)) {
throw new \RuntimeException(sprintf('Cannot get non existing dimension "%s"', $name));
}
return $this->stats[$name]['value'];
} | php | public function get($name)
{
if (!$this->has($name)) {
throw new \RuntimeException(sprintf('Cannot get non existing dimension "%s"', $name));
}
return $this->stats[$name]['value'];
} | [
"public",
"function",
"get",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"has",
"(",
"$",
"name",
")",
")",
"{",
"throw",
"new",
"\\",
"RuntimeException",
"(",
"sprintf",
"(",
"'Cannot get non existing dimension \"%s\"'",
",",
"$",
"na... | @param string $name
@return float|int | [
"@param",
"string",
"$name"
] | train | https://github.com/OwlyCode/StreamingBird/blob/177fc8a9dc8f911865a5abd9ac8d4ef85cef4003/src/Monitor.php#L54-L61 |
dreamfactorysoftware/df-file | src/Components/BaseFlysystem.php | BaseFlysystem.normalizeFolderInfo | protected function normalizeFolderInfo(array & $folder, $localizer)
{
if (strtolower(array_get($folder, 'type')) !== 'dir') {
throw new InternalServerErrorException('Fatal error. Invalid folder info provided for normalization.');
}
$path = array_get($folder, 'path');
$fo... | php | protected function normalizeFolderInfo(array & $folder, $localizer)
{
if (strtolower(array_get($folder, 'type')) !== 'dir') {
throw new InternalServerErrorException('Fatal error. Invalid folder info provided for normalization.');
}
$path = array_get($folder, 'path');
$fo... | [
"protected",
"function",
"normalizeFolderInfo",
"(",
"array",
"&",
"$",
"folder",
",",
"$",
"localizer",
")",
"{",
"if",
"(",
"strtolower",
"(",
"array_get",
"(",
"$",
"folder",
",",
"'type'",
")",
")",
"!==",
"'dir'",
")",
"{",
"throw",
"new",
"Internal... | @param array $folder
@param string $localizer
@throws \DreamFactory\Core\Exceptions\InternalServerErrorException | [
"@param",
"array",
"$folder",
"@param",
"string",
"$localizer"
] | train | https://github.com/dreamfactorysoftware/df-file/blob/e78aaec3e1d6585b5e7fe9b7646af4b1180ecd66/src/Components/BaseFlysystem.php#L152-L165 |
dreamfactorysoftware/df-file | src/Components/BaseFlysystem.php | BaseFlysystem.normalizeFileInfo | protected function normalizeFileInfo(array &$file, $localizer)
{
if (strtolower(array_get($file, 'type')) !== 'file') {
throw new InternalServerErrorException('Fatal error. Invalid file info provided for normalization.');
}
unset($file['visibility']);
$path = array_get($... | php | protected function normalizeFileInfo(array &$file, $localizer)
{
if (strtolower(array_get($file, 'type')) !== 'file') {
throw new InternalServerErrorException('Fatal error. Invalid file info provided for normalization.');
}
unset($file['visibility']);
$path = array_get($... | [
"protected",
"function",
"normalizeFileInfo",
"(",
"array",
"&",
"$",
"file",
",",
"$",
"localizer",
")",
"{",
"if",
"(",
"strtolower",
"(",
"array_get",
"(",
"$",
"file",
",",
"'type'",
")",
")",
"!==",
"'file'",
")",
"{",
"throw",
"new",
"InternalServe... | @param array $file
@param string $localizer
@throws \DreamFactory\Core\Exceptions\InternalServerErrorException | [
"@param",
"array",
"$file",
"@param",
"string",
"$localizer"
] | train | https://github.com/dreamfactorysoftware/df-file/blob/e78aaec3e1d6585b5e7fe9b7646af4b1180ecd66/src/Components/BaseFlysystem.php#L173-L190 |
dreamfactorysoftware/df-file | src/Components/BaseFlysystem.php | BaseFlysystem.getFolderProperties | public function getFolderProperties($container, $path)
{
$path = rtrim($path, '/');
$meta = $this->adapter->getMetadata($path);
if ($meta === false) {
throw new NotFoundException("Specified folder '" . $path . "' not found.");
}
if (array_get($meta, 'type') === 'd... | php | public function getFolderProperties($container, $path)
{
$path = rtrim($path, '/');
$meta = $this->adapter->getMetadata($path);
if ($meta === false) {
throw new NotFoundException("Specified folder '" . $path . "' not found.");
}
if (array_get($meta, 'type') === 'd... | [
"public",
"function",
"getFolderProperties",
"(",
"$",
"container",
",",
"$",
"path",
")",
"{",
"$",
"path",
"=",
"rtrim",
"(",
"$",
"path",
",",
"'/'",
")",
";",
"$",
"meta",
"=",
"$",
"this",
"->",
"adapter",
"->",
"getMetadata",
"(",
"$",
"path",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/dreamfactorysoftware/df-file/blob/e78aaec3e1d6585b5e7fe9b7646af4b1180ecd66/src/Components/BaseFlysystem.php#L195-L210 |
dreamfactorysoftware/df-file | src/Components/BaseFlysystem.php | BaseFlysystem.createFolder | public function createFolder($container, $path, $properties = [])
{
if (empty($path)) {
throw new BadRequestException("Invalid empty path.");
}
if ($this->folderExists($container, $path)) {
throw new BadRequestException("Folder '" . $path . "' already exists.");
... | php | public function createFolder($container, $path, $properties = [])
{
if (empty($path)) {
throw new BadRequestException("Invalid empty path.");
}
if ($this->folderExists($container, $path)) {
throw new BadRequestException("Folder '" . $path . "' already exists.");
... | [
"public",
"function",
"createFolder",
"(",
"$",
"container",
",",
"$",
"path",
",",
"$",
"properties",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"path",
")",
")",
"{",
"throw",
"new",
"BadRequestException",
"(",
"\"Invalid empty path.\"",
")... | {@inheritdoc} | [
"{"
] | train | https://github.com/dreamfactorysoftware/df-file/blob/e78aaec3e1d6585b5e7fe9b7646af4b1180ecd66/src/Components/BaseFlysystem.php#L215-L233 |
dreamfactorysoftware/df-file | src/Components/BaseFlysystem.php | BaseFlysystem.copyFolder | public function copyFolder($container, $dest_path, $src_container, $src_path, $check_exist = false)
{
$dest_path = rtrim($dest_path, '/');
$src_path = rtrim($src_path, '/');
// does this folder already exist?
if (!$this->folderExists($src_container, $src_path)) {
throw ne... | php | public function copyFolder($container, $dest_path, $src_container, $src_path, $check_exist = false)
{
$dest_path = rtrim($dest_path, '/');
$src_path = rtrim($src_path, '/');
// does this folder already exist?
if (!$this->folderExists($src_container, $src_path)) {
throw ne... | [
"public",
"function",
"copyFolder",
"(",
"$",
"container",
",",
"$",
"dest_path",
",",
"$",
"src_container",
",",
"$",
"src_path",
",",
"$",
"check_exist",
"=",
"false",
")",
"{",
"$",
"dest_path",
"=",
"rtrim",
"(",
"$",
"dest_path",
",",
"'/'",
")",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/dreamfactorysoftware/df-file/blob/e78aaec3e1d6585b5e7fe9b7646af4b1180ecd66/src/Components/BaseFlysystem.php#L246-L266 |
dreamfactorysoftware/df-file | src/Components/BaseFlysystem.php | BaseFlysystem.deleteFolder | public function deleteFolder($container, $path, $force = false, $content_only = false)
{
if (!$this->folderExists($container, $path)) {
throw new NotFoundException("Folder '" . $path . "' does not exist.");
}
$path = rtrim($path, '/');
if ($force) {
$this->de... | php | public function deleteFolder($container, $path, $force = false, $content_only = false)
{
if (!$this->folderExists($container, $path)) {
throw new NotFoundException("Folder '" . $path . "' does not exist.");
}
$path = rtrim($path, '/');
if ($force) {
$this->de... | [
"public",
"function",
"deleteFolder",
"(",
"$",
"container",
",",
"$",
"path",
",",
"$",
"force",
"=",
"false",
",",
"$",
"content_only",
"=",
"false",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"folderExists",
"(",
"$",
"container",
",",
"$",
"pat... | {@inheritdoc} | [
"{"
] | train | https://github.com/dreamfactorysoftware/df-file/blob/e78aaec3e1d6585b5e7fe9b7646af4b1180ecd66/src/Components/BaseFlysystem.php#L292-L310 |
dreamfactorysoftware/df-file | src/Components/BaseFlysystem.php | BaseFlysystem.getFileProperties | public function getFileProperties($container, $path, $include_content = false, $content_as_base = true)
{
$path = rtrim($path, '/');
$meta = $this->adapter->getMetadata($path);
if ($meta === false) {
throw new NotFoundException("Specified file '" . $path . "' does not exist.");
... | php | public function getFileProperties($container, $path, $include_content = false, $content_as_base = true)
{
$path = rtrim($path, '/');
$meta = $this->adapter->getMetadata($path);
if ($meta === false) {
throw new NotFoundException("Specified file '" . $path . "' does not exist.");
... | [
"public",
"function",
"getFileProperties",
"(",
"$",
"container",
",",
"$",
"path",
",",
"$",
"include_content",
"=",
"false",
",",
"$",
"content_as_base",
"=",
"true",
")",
"{",
"$",
"path",
"=",
"rtrim",
"(",
"$",
"path",
",",
"'/'",
")",
";",
"$",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/dreamfactorysoftware/df-file/blob/e78aaec3e1d6585b5e7fe9b7646af4b1180ecd66/src/Components/BaseFlysystem.php#L361-L389 |
dreamfactorysoftware/df-file | src/Components/BaseFlysystem.php | BaseFlysystem.streamFile | public function streamFile($container, $path, $download = false)
{
try {
$result = $this->adapter->readStream($path);
$chunk = \Config::get('df.file_chunk_size');
if (!empty($path) && isset($result['stream'])) {
$file = basename($path);
$m... | php | public function streamFile($container, $path, $download = false)
{
try {
$result = $this->adapter->readStream($path);
$chunk = \Config::get('df.file_chunk_size');
if (!empty($path) && isset($result['stream'])) {
$file = basename($path);
$m... | [
"public",
"function",
"streamFile",
"(",
"$",
"container",
",",
"$",
"path",
",",
"$",
"download",
"=",
"false",
")",
"{",
"try",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"adapter",
"->",
"readStream",
"(",
"$",
"path",
")",
";",
"$",
"chunk",
"... | {@inheritdoc} | [
"{"
] | train | https://github.com/dreamfactorysoftware/df-file/blob/e78aaec3e1d6585b5e7fe9b7646af4b1180ecd66/src/Components/BaseFlysystem.php#L394-L441 |
dreamfactorysoftware/df-file | src/Components/BaseFlysystem.php | BaseFlysystem.writeFile | public function writeFile($container, $path, $content, $content_is_base = false, $check_exist = false)
{
// does this file already exist?
if ($this->fileExists($container, $path)) {
if (($check_exist)) {
throw new InternalServerErrorException("File '$path' already exists.... | php | public function writeFile($container, $path, $content, $content_is_base = false, $check_exist = false)
{
// does this file already exist?
if ($this->fileExists($container, $path)) {
if (($check_exist)) {
throw new InternalServerErrorException("File '$path' already exists.... | [
"public",
"function",
"writeFile",
"(",
"$",
"container",
",",
"$",
"path",
",",
"$",
"content",
",",
"$",
"content_is_base",
"=",
"false",
",",
"$",
"check_exist",
"=",
"false",
")",
"{",
"// does this file already exist?",
"if",
"(",
"$",
"this",
"->",
"... | {@inheritdoc} | [
"{"
] | train | https://github.com/dreamfactorysoftware/df-file/blob/e78aaec3e1d6585b5e7fe9b7646af4b1180ecd66/src/Components/BaseFlysystem.php#L454-L476 |
dreamfactorysoftware/df-file | src/Components/BaseFlysystem.php | BaseFlysystem.moveFile | public function moveFile($container, $path, $local_path, $check_exist = false)
{
// does local file exist?
if (!file_exists($local_path)) {
throw new NotFoundException("File '$local_path' does not exist.");
}
// does this file already exist?
if ($this->fileExists(... | php | public function moveFile($container, $path, $local_path, $check_exist = false)
{
// does local file exist?
if (!file_exists($local_path)) {
throw new NotFoundException("File '$local_path' does not exist.");
}
// does this file already exist?
if ($this->fileExists(... | [
"public",
"function",
"moveFile",
"(",
"$",
"container",
",",
"$",
"path",
",",
"$",
"local_path",
",",
"$",
"check_exist",
"=",
"false",
")",
"{",
"// does local file exist?",
"if",
"(",
"!",
"file_exists",
"(",
"$",
"local_path",
")",
")",
"{",
"throw",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/dreamfactorysoftware/df-file/blob/e78aaec3e1d6585b5e7fe9b7646af4b1180ecd66/src/Components/BaseFlysystem.php#L481-L502 |
dreamfactorysoftware/df-file | src/Components/BaseFlysystem.php | BaseFlysystem.copyFile | public function copyFile($container, $dest_path, $src_container, $src_path, $check_exist = false)
{
// does this file already exist?
if (!$this->fileExists($src_container, $src_path)) {
throw new NotFoundException("File '$src_path' does not exist.");
}
if ($this->fileExis... | php | public function copyFile($container, $dest_path, $src_container, $src_path, $check_exist = false)
{
// does this file already exist?
if (!$this->fileExists($src_container, $src_path)) {
throw new NotFoundException("File '$src_path' does not exist.");
}
if ($this->fileExis... | [
"public",
"function",
"copyFile",
"(",
"$",
"container",
",",
"$",
"dest_path",
",",
"$",
"src_container",
",",
"$",
"src_path",
",",
"$",
"check_exist",
"=",
"false",
")",
"{",
"// does this file already exist?",
"if",
"(",
"!",
"$",
"this",
"->",
"fileExis... | {@inheritdoc} | [
"{"
] | train | https://github.com/dreamfactorysoftware/df-file/blob/e78aaec3e1d6585b5e7fe9b7646af4b1180ecd66/src/Components/BaseFlysystem.php#L507-L521 |
dreamfactorysoftware/df-file | src/Components/BaseFlysystem.php | BaseFlysystem.deleteFile | public function deleteFile($container, $path, $noCheck = false)
{
if (!$noCheck && !$this->fileExists($container, $path)) {
throw new NotFoundException("File '$path' was not found.");
}
if (!$this->adapter->delete($path)) {
throw new InternalServerErrorException('Fail... | php | public function deleteFile($container, $path, $noCheck = false)
{
if (!$noCheck && !$this->fileExists($container, $path)) {
throw new NotFoundException("File '$path' was not found.");
}
if (!$this->adapter->delete($path)) {
throw new InternalServerErrorException('Fail... | [
"public",
"function",
"deleteFile",
"(",
"$",
"container",
",",
"$",
"path",
",",
"$",
"noCheck",
"=",
"false",
")",
"{",
"if",
"(",
"!",
"$",
"noCheck",
"&&",
"!",
"$",
"this",
"->",
"fileExists",
"(",
"$",
"container",
",",
"$",
"path",
")",
")",... | {@inheritdoc} | [
"{"
] | train | https://github.com/dreamfactorysoftware/df-file/blob/e78aaec3e1d6585b5e7fe9b7646af4b1180ecd66/src/Components/BaseFlysystem.php#L526-L534 |
dreamfactorysoftware/df-file | src/Components/BaseFlysystem.php | BaseFlysystem.getFolderAsZip | public function getFolderAsZip($container, $path, $zip = null, $zipFileName = null, $overwrite = false)
{
$path = rtrim($path, '/');
if (empty($zipFileName)) {
$temp = basename($path);
if (empty($temp)) {
$temp = $container;
}
$tempDir ... | php | public function getFolderAsZip($container, $path, $zip = null, $zipFileName = null, $overwrite = false)
{
$path = rtrim($path, '/');
if (empty($zipFileName)) {
$temp = basename($path);
if (empty($temp)) {
$temp = $container;
}
$tempDir ... | [
"public",
"function",
"getFolderAsZip",
"(",
"$",
"container",
",",
"$",
"path",
",",
"$",
"zip",
"=",
"null",
",",
"$",
"zipFileName",
"=",
"null",
",",
"$",
"overwrite",
"=",
"false",
")",
"{",
"$",
"path",
"=",
"rtrim",
"(",
"$",
"path",
",",
"'... | {@inheritdoc} | [
"{"
] | train | https://github.com/dreamfactorysoftware/df-file/blob/e78aaec3e1d6585b5e7fe9b7646af4b1180ecd66/src/Components/BaseFlysystem.php#L588-L613 |
dreamfactorysoftware/df-file | src/Components/BaseFlysystem.php | BaseFlysystem.addTreeToZip | public function addTreeToZip($zip, $path)
{
$path = rtrim($path, '/');
if ($this->folderExists('', $path)) {
$files = $this->adapter->listContents($path);
if (empty($files)) {
$newPath = str_replace(DIRECTORY_SEPARATOR, '/', $path);
if (!$zip->... | php | public function addTreeToZip($zip, $path)
{
$path = rtrim($path, '/');
if ($this->folderExists('', $path)) {
$files = $this->adapter->listContents($path);
if (empty($files)) {
$newPath = str_replace(DIRECTORY_SEPARATOR, '/', $path);
if (!$zip->... | [
"public",
"function",
"addTreeToZip",
"(",
"$",
"zip",
",",
"$",
"path",
")",
"{",
"$",
"path",
"=",
"rtrim",
"(",
"$",
"path",
",",
"'/'",
")",
";",
"if",
"(",
"$",
"this",
"->",
"folderExists",
"(",
"''",
",",
"$",
"path",
")",
")",
"{",
"$",... | @param \ZipArchive $zip
@param string $path
@throws \DreamFactory\Core\Exceptions\InternalServerErrorException
@throws \Exception | [
"@param",
"\\",
"ZipArchive",
"$zip",
"@param",
"string",
"$path"
] | train | https://github.com/dreamfactorysoftware/df-file/blob/e78aaec3e1d6585b5e7fe9b7646af4b1180ecd66/src/Components/BaseFlysystem.php#L622-L651 |
periaptio/empress-generator | src/Syntax/RemoveForeignKeysFromTable.php | RemoveForeignKeysFromTable.getItem | protected function getItem($foreignKey)
{
$name = empty($foreignKey['name']) ? $this->createIndexName($foreignKey['field']) : $foreignKey['name'];
return sprintf("\$table->dropForeign('%s');", $name);
} | php | protected function getItem($foreignKey)
{
$name = empty($foreignKey['name']) ? $this->createIndexName($foreignKey['field']) : $foreignKey['name'];
return sprintf("\$table->dropForeign('%s');", $name);
} | [
"protected",
"function",
"getItem",
"(",
"$",
"foreignKey",
")",
"{",
"$",
"name",
"=",
"empty",
"(",
"$",
"foreignKey",
"[",
"'name'",
"]",
")",
"?",
"$",
"this",
"->",
"createIndexName",
"(",
"$",
"foreignKey",
"[",
"'field'",
"]",
")",
":",
"$",
"... | Return string for dropping a foreign key
@param array $foreignKey
@return string | [
"Return",
"string",
"for",
"dropping",
"a",
"foreign",
"key"
] | train | https://github.com/periaptio/empress-generator/blob/749fb4b12755819e9c97377ebfb446ee0822168a/src/Syntax/RemoveForeignKeysFromTable.php#L16-L20 |
localhook/localhook | src/Command/SelfUpdateCommand.php | SelfUpdateCommand.execute | protected function execute(InputInterface $input, OutputInterface $output)
{
$io = new SymfonyStyle($input, $output);
$updater = new Updater();
$strategy = $updater->getStrategy();
if ($strategy instanceof ShaStrategy) {
$strategy->setPharUrl('http://localhook.github.io... | php | protected function execute(InputInterface $input, OutputInterface $output)
{
$io = new SymfonyStyle($input, $output);
$updater = new Updater();
$strategy = $updater->getStrategy();
if ($strategy instanceof ShaStrategy) {
$strategy->setPharUrl('http://localhook.github.io... | [
"protected",
"function",
"execute",
"(",
"InputInterface",
"$",
"input",
",",
"OutputInterface",
"$",
"output",
")",
"{",
"$",
"io",
"=",
"new",
"SymfonyStyle",
"(",
"$",
"input",
",",
"$",
"output",
")",
";",
"$",
"updater",
"=",
"new",
"Updater",
"(",
... | @param InputInterface $input
@param OutputInterface $output
@return void
@throws Exception | [
"@param",
"InputInterface",
"$input",
"@param",
"OutputInterface",
"$output"
] | train | https://github.com/localhook/localhook/blob/f8010a7f06ddd514b224ad70dc62e425125d4feb/src/Command/SelfUpdateCommand.php#L32-L56 |
phpmob/changmin | src/PhpMob/WidgetBundle/Asset/WidgetAssets.php | WidgetAssets.getContent | private function getContent(array $paths, $type)
{
$cacheKey = $this->getHashKey($paths);
if ($this->cacheItemPool->hasItem($cacheKey)) {
return $this->cacheItemPool->getItem($cacheKey)->get();
}
$minifier = 'js' === $type ? new JS() : new CSS();
$content = '';
... | php | private function getContent(array $paths, $type)
{
$cacheKey = $this->getHashKey($paths);
if ($this->cacheItemPool->hasItem($cacheKey)) {
return $this->cacheItemPool->getItem($cacheKey)->get();
}
$minifier = 'js' === $type ? new JS() : new CSS();
$content = '';
... | [
"private",
"function",
"getContent",
"(",
"array",
"$",
"paths",
",",
"$",
"type",
")",
"{",
"$",
"cacheKey",
"=",
"$",
"this",
"->",
"getHashKey",
"(",
"$",
"paths",
")",
";",
"if",
"(",
"$",
"this",
"->",
"cacheItemPool",
"->",
"hasItem",
"(",
"$",... | @param array $paths
@param string $type
@return string | [
"@param",
"array",
"$paths",
"@param",
"string",
"$type"
] | train | https://github.com/phpmob/changmin/blob/bfebb1561229094d1c138574abab75f2f1d17d66/src/PhpMob/WidgetBundle/Asset/WidgetAssets.php#L102-L130 |
phpmob/changmin | src/PhpMob/WidgetBundle/Asset/WidgetAssets.php | WidgetAssets.getFiles | private function getFiles($path)
{
$files = [];
if (false !== $pos = strpos($path, '*')) {
list($before, $after) = explode('*', $path, 2);
$input = $this->fileLocator->locate($before).'*'.$after;
if (false !== $paths = glob($input)) {
foreach ($p... | php | private function getFiles($path)
{
$files = [];
if (false !== $pos = strpos($path, '*')) {
list($before, $after) = explode('*', $path, 2);
$input = $this->fileLocator->locate($before).'*'.$after;
if (false !== $paths = glob($input)) {
foreach ($p... | [
"private",
"function",
"getFiles",
"(",
"$",
"path",
")",
"{",
"$",
"files",
"=",
"[",
"]",
";",
"if",
"(",
"false",
"!==",
"$",
"pos",
"=",
"strpos",
"(",
"$",
"path",
",",
"'*'",
")",
")",
"{",
"list",
"(",
"$",
"before",
",",
"$",
"after",
... | @param string $path
@return array | [
"@param",
"string",
"$path"
] | train | https://github.com/phpmob/changmin/blob/bfebb1561229094d1c138574abab75f2f1d17d66/src/PhpMob/WidgetBundle/Asset/WidgetAssets.php#L137-L155 |
ChadSikorra/php-simple-enum | src/Enums/FlagEnumTrait.php | FlagEnumTrait.add | public function add(...$flags)
{
foreach ($flags as $flag) {
if ($this->has($flag)) {
continue;
}
foreach ($this->getValuesFromFlagOrEnum($flag) as $value) {
$this->value = $this->value | (int) $value;
}
}
retur... | php | public function add(...$flags)
{
foreach ($flags as $flag) {
if ($this->has($flag)) {
continue;
}
foreach ($this->getValuesFromFlagOrEnum($flag) as $value) {
$this->value = $this->value | (int) $value;
}
}
retur... | [
"public",
"function",
"add",
"(",
"...",
"$",
"flags",
")",
"{",
"foreach",
"(",
"$",
"flags",
"as",
"$",
"flag",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"has",
"(",
"$",
"flag",
")",
")",
"{",
"continue",
";",
"}",
"foreach",
"(",
"$",
"this",... | Add a flag to the value.
@param int[]|string[]|FlagEnumTrait[] ...$flags
@return $this | [
"Add",
"a",
"flag",
"to",
"the",
"value",
"."
] | train | https://github.com/ChadSikorra/php-simple-enum/blob/781f87ae9f4cc75fb2edab6517c6471c0181e93b/src/Enums/FlagEnumTrait.php#L42-L54 |
ChadSikorra/php-simple-enum | src/Enums/FlagEnumTrait.php | FlagEnumTrait.has | public function has($flag)
{
$values = $this->getValuesFromFlagOrEnum($flag);
if (empty($values)) {
return false;
}
foreach ($values as $value) {
if (!(bool) ($this->value & $value)) {
return false;
}
}
return tru... | php | public function has($flag)
{
$values = $this->getValuesFromFlagOrEnum($flag);
if (empty($values)) {
return false;
}
foreach ($values as $value) {
if (!(bool) ($this->value & $value)) {
return false;
}
}
return tru... | [
"public",
"function",
"has",
"(",
"$",
"flag",
")",
"{",
"$",
"values",
"=",
"$",
"this",
"->",
"getValuesFromFlagOrEnum",
"(",
"$",
"flag",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"values",
")",
")",
"{",
"return",
"false",
";",
"}",
"foreach",
"(... | Given an enum name, value, or another FlagEnumTrait instance, check if this instance has the same value(s).
@param string|int|FlagEnumTrait $flag
@return bool | [
"Given",
"an",
"enum",
"name",
"value",
"or",
"another",
"FlagEnumTrait",
"instance",
"check",
"if",
"this",
"instance",
"has",
"the",
"same",
"value",
"(",
"s",
")",
"."
] | train | https://github.com/ChadSikorra/php-simple-enum/blob/781f87ae9f4cc75fb2edab6517c6471c0181e93b/src/Enums/FlagEnumTrait.php#L82-L97 |
ChadSikorra/php-simple-enum | src/Enums/FlagEnumTrait.php | FlagEnumTrait.getNames | public function getNames()
{
$enums = [];
foreach (static::toArray() as $name => $value) {
if ($this->has($value)) {
$enums[] = $name;
}
}
return $enums;
} | php | public function getNames()
{
$enums = [];
foreach (static::toArray() as $name => $value) {
if ($this->has($value)) {
$enums[] = $name;
}
}
return $enums;
} | [
"public",
"function",
"getNames",
"(",
")",
"{",
"$",
"enums",
"=",
"[",
"]",
";",
"foreach",
"(",
"static",
"::",
"toArray",
"(",
")",
"as",
"$",
"name",
"=>",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"has",
"(",
"$",
"value",
")"... | Get an array of all the enum names this flag instance represents.
@return array | [
"Get",
"an",
"array",
"of",
"all",
"the",
"enum",
"names",
"this",
"flag",
"instance",
"represents",
"."
] | train | https://github.com/ChadSikorra/php-simple-enum/blob/781f87ae9f4cc75fb2edab6517c6471c0181e93b/src/Enums/FlagEnumTrait.php#L104-L115 |
ChadSikorra/php-simple-enum | src/Enums/FlagEnumTrait.php | FlagEnumTrait.getValuesFromFlagOrEnum | protected function getValuesFromFlagOrEnum($flag)
{
$values = [];
if ($flag instanceof static) {
foreach ($flag->getNames() as $enum) {
$values[] = static::getNameValue($enum);
}
} elseif (static::isValidName((string) $flag)) {
$values[] =... | php | protected function getValuesFromFlagOrEnum($flag)
{
$values = [];
if ($flag instanceof static) {
foreach ($flag->getNames() as $enum) {
$values[] = static::getNameValue($enum);
}
} elseif (static::isValidName((string) $flag)) {
$values[] =... | [
"protected",
"function",
"getValuesFromFlagOrEnum",
"(",
"$",
"flag",
")",
"{",
"$",
"values",
"=",
"[",
"]",
";",
"if",
"(",
"$",
"flag",
"instanceof",
"static",
")",
"{",
"foreach",
"(",
"$",
"flag",
"->",
"getNames",
"(",
")",
"as",
"$",
"enum",
"... | Given an enum name, enum value, or flag enum instance, get the array of values it represents.
@param int|string|FlagEnumTrait $flag
@return array | [
"Given",
"an",
"enum",
"name",
"enum",
"value",
"or",
"flag",
"enum",
"instance",
"get",
"the",
"array",
"of",
"values",
"it",
"represents",
"."
] | train | https://github.com/ChadSikorra/php-simple-enum/blob/781f87ae9f4cc75fb2edab6517c6471c0181e93b/src/Enums/FlagEnumTrait.php#L133-L148 |
dms-org/package.blog | src/Cms/BlogAuthorModule.php | BlogAuthorModule.defineCrudModule | protected function defineCrudModule(CrudModuleDefinition $module)
{
$module->name('authors');
$module->metadata([
'icon' => 'user',
]);
$module->labelObjects()->fromProperty(BlogAuthor::NAME);
$module->crudForm(function (CrudFormDefinition $form) {
... | php | protected function defineCrudModule(CrudModuleDefinition $module)
{
$module->name('authors');
$module->metadata([
'icon' => 'user',
]);
$module->labelObjects()->fromProperty(BlogAuthor::NAME);
$module->crudForm(function (CrudFormDefinition $form) {
... | [
"protected",
"function",
"defineCrudModule",
"(",
"CrudModuleDefinition",
"$",
"module",
")",
"{",
"$",
"module",
"->",
"name",
"(",
"'authors'",
")",
";",
"$",
"module",
"->",
"metadata",
"(",
"[",
"'icon'",
"=>",
"'user'",
",",
"]",
")",
";",
"$",
"mod... | Defines the structure of this module.
@param CrudModuleDefinition $module | [
"Defines",
"the",
"structure",
"of",
"this",
"module",
"."
] | train | https://github.com/dms-org/package.blog/blob/1500f6fad20d81289a0dfa617fc1c54699f01e16/src/Cms/BlogAuthorModule.php#L42-L89 |
datasift/php_webdriver | src/php/DataSift/WebDriver/WebDriverConfiguration.php | WebDriverConfiguration.getVersion | public function getVersion()
{
$composer = $this->loadJsonFileFromRoot("composer.json");
if (!isset($composer->version)){
throw new \Exception("composer.json does not contain a version");
}
return $composer->version;
} | php | public function getVersion()
{
$composer = $this->loadJsonFileFromRoot("composer.json");
if (!isset($composer->version)){
throw new \Exception("composer.json does not contain a version");
}
return $composer->version;
} | [
"public",
"function",
"getVersion",
"(",
")",
"{",
"$",
"composer",
"=",
"$",
"this",
"->",
"loadJsonFileFromRoot",
"(",
"\"composer.json\"",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"composer",
"->",
"version",
")",
")",
"{",
"throw",
"new",
"\\",
... | Returns the project's version
@return string The version of the project | [
"Returns",
"the",
"project",
"s",
"version"
] | train | https://github.com/datasift/php_webdriver/blob/efca991198616b53c8f40b59ad05306e2b10e7f0/src/php/DataSift/WebDriver/WebDriverConfiguration.php#L44-L53 |
iocaste/microservice-foundation | src/Feature/Auth/MicroserviceUserProvider.php | MicroserviceUserProvider.retrieveById | public function retrieveById($identifier)
{
$userService = app()->make(UserService::class);
$user = $userService->byId($identifier)->get();
if (! $user) {
return null;
}
return $user;
} | php | public function retrieveById($identifier)
{
$userService = app()->make(UserService::class);
$user = $userService->byId($identifier)->get();
if (! $user) {
return null;
}
return $user;
} | [
"public",
"function",
"retrieveById",
"(",
"$",
"identifier",
")",
"{",
"$",
"userService",
"=",
"app",
"(",
")",
"->",
"make",
"(",
"UserService",
"::",
"class",
")",
";",
"$",
"user",
"=",
"$",
"userService",
"->",
"byId",
"(",
"$",
"identifier",
")"... | Retrieve a user by their unique identifier.
@param mixed $identifier
@return \Illuminate\Contracts\Auth\Authenticatable|null | [
"Retrieve",
"a",
"user",
"by",
"their",
"unique",
"identifier",
"."
] | train | https://github.com/iocaste/microservice-foundation/blob/274a154de4299e8a57314bab972e09f6d8cdae9e/src/Feature/Auth/MicroserviceUserProvider.php#L20-L30 |
iocaste/microservice-foundation | src/Feature/Auth/MicroserviceUserProvider.php | MicroserviceUserProvider.retrieveByCredentials | public function retrieveByCredentials(array $credentials)
{
$userService = app()->make(UserService::class);
$user = $userService->byCredentials($credentials)->get();
if (! $user) {
return null;
}
return $user;
} | php | public function retrieveByCredentials(array $credentials)
{
$userService = app()->make(UserService::class);
$user = $userService->byCredentials($credentials)->get();
if (! $user) {
return null;
}
return $user;
} | [
"public",
"function",
"retrieveByCredentials",
"(",
"array",
"$",
"credentials",
")",
"{",
"$",
"userService",
"=",
"app",
"(",
")",
"->",
"make",
"(",
"UserService",
"::",
"class",
")",
";",
"$",
"user",
"=",
"$",
"userService",
"->",
"byCredentials",
"("... | Retrieve a user by the given credentials.
@param array $credentials
@return \Illuminate\Contracts\Auth\Authenticatable|null | [
"Retrieve",
"a",
"user",
"by",
"the",
"given",
"credentials",
"."
] | train | https://github.com/iocaste/microservice-foundation/blob/274a154de4299e8a57314bab972e09f6d8cdae9e/src/Feature/Auth/MicroserviceUserProvider.php#L62-L72 |
iocaste/microservice-foundation | src/Feature/Auth/MicroserviceUserProvider.php | MicroserviceUserProvider.validateCredentials | public function validateCredentials(Authenticatable $user, array $credentials)
{
if (! app('hash')->check($credentials['password'], $user->password)) {
return false;
}
return true;
} | php | public function validateCredentials(Authenticatable $user, array $credentials)
{
if (! app('hash')->check($credentials['password'], $user->password)) {
return false;
}
return true;
} | [
"public",
"function",
"validateCredentials",
"(",
"Authenticatable",
"$",
"user",
",",
"array",
"$",
"credentials",
")",
"{",
"if",
"(",
"!",
"app",
"(",
"'hash'",
")",
"->",
"check",
"(",
"$",
"credentials",
"[",
"'password'",
"]",
",",
"$",
"user",
"->... | Validate a user against the given credentials.
@param \Illuminate\Contracts\Auth\Authenticatable $user
@param array $credentials
@return bool | [
"Validate",
"a",
"user",
"against",
"the",
"given",
"credentials",
"."
] | train | https://github.com/iocaste/microservice-foundation/blob/274a154de4299e8a57314bab972e09f6d8cdae9e/src/Feature/Auth/MicroserviceUserProvider.php#L81-L88 |
phpmob/changmin | src/PhpMob/ChangMinBundle/Form/Type/TaxonType.php | TaxonType.buildForm | public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('translations', ResourceTranslationsType::class, [
'entry_type' => TaxonTranslationType::class,
'label' => 'sylius.form.taxon.name',
])
->addEventList... | php | public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('translations', ResourceTranslationsType::class, [
'entry_type' => TaxonTranslationType::class,
'label' => 'sylius.form.taxon.name',
])
->addEventList... | [
"public",
"function",
"buildForm",
"(",
"FormBuilderInterface",
"$",
"builder",
",",
"array",
"$",
"options",
")",
"{",
"$",
"builder",
"->",
"add",
"(",
"'translations'",
",",
"ResourceTranslationsType",
"::",
"class",
",",
"[",
"'entry_type'",
"=>",
"TaxonTran... | {@inheritdoc} | [
"{"
] | train | https://github.com/phpmob/changmin/blob/bfebb1561229094d1c138574abab75f2f1d17d66/src/PhpMob/ChangMinBundle/Form/Type/TaxonType.php#L30-L64 |
datasift/php_webdriver | src/php/DataSift/BrowserMobProxy/BrowserMobProxyBase.php | BrowserMobProxyBase.curl | protected function curl(
$http_verb,
$path,
$payload = null,
$curl_opts = array()
)
{
// determine the URL we are posting to
if (substr($this->url, -1, 1) !== '/' && substr($path, 0, 1) !== '/')
{
$url = $this->url . '/' . $path;
}
... | php | protected function curl(
$http_verb,
$path,
$payload = null,
$curl_opts = array()
)
{
// determine the URL we are posting to
if (substr($this->url, -1, 1) !== '/' && substr($path, 0, 1) !== '/')
{
$url = $this->url . '/' . $path;
}
... | [
"protected",
"function",
"curl",
"(",
"$",
"http_verb",
",",
"$",
"path",
",",
"$",
"payload",
"=",
"null",
",",
"$",
"curl_opts",
"=",
"array",
"(",
")",
")",
"{",
"// determine the URL we are posting to",
"if",
"(",
"substr",
"(",
"$",
"this",
"->",
"u... | Curl request to browsermob-proxy server.
@var string $http_verb 'GET', 'POST', 'DELETE', or 'PUT'
@var string $path the URL to connect to (appended to $this->getUrl())
@var mixed $payload the parameters to send; an array is sent as POSTFIELDS,
anything else is sent as raw body
@var array $curl_opts any ad... | [
"Curl",
"request",
"to",
"browsermob",
"-",
"proxy",
"server",
"."
] | train | https://github.com/datasift/php_webdriver/blob/efca991198616b53c8f40b59ad05306e2b10e7f0/src/php/DataSift/BrowserMobProxy/BrowserMobProxyBase.php#L96-L238 |
nyeholt/silverstripe-external-content | thirdparty/Zend/Validate/Db/Abstract.php | Zend_Validate_Db_Abstract._query | protected function _query($value)
{
/**
* Check for an adapter being defined. if not, fetch the default adapter.
*/
if($this->_adapter === null) {
$this->_adapter = Zend_Db_Table_Abstract::getDefaultAdapter();
}
/**
* Build select object
... | php | protected function _query($value)
{
/**
* Check for an adapter being defined. if not, fetch the default adapter.
*/
if($this->_adapter === null) {
$this->_adapter = Zend_Db_Table_Abstract::getDefaultAdapter();
}
/**
* Build select object
... | [
"protected",
"function",
"_query",
"(",
"$",
"value",
")",
"{",
"/**\n * Check for an adapter being defined. if not, fetch the default adapter.\n */",
"if",
"(",
"$",
"this",
"->",
"_adapter",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"_adapter",
"=",
... | Run query and returns matches, or null if no matches are found.
@param String $value
@return Array when matches are found. | [
"Run",
"query",
"and",
"returns",
"matches",
"or",
"null",
"if",
"no",
"matches",
"are",
"found",
"."
] | train | https://github.com/nyeholt/silverstripe-external-content/blob/1c6da8c56ef717225ff904e1522aff94ed051601/thirdparty/Zend/Validate/Db/Abstract.php#L101-L132 |
askupasoftware/amarkal | Extensions/WordPress/Widget/UI/Textarea/controller.php | Textarea.set_error_message | public function set_error_message( $message ) {
$this->template->error = true;
$this->template->error_message = $message;
} | php | public function set_error_message( $message ) {
$this->template->error = true;
$this->template->error_message = $message;
} | [
"public",
"function",
"set_error_message",
"(",
"$",
"message",
")",
"{",
"$",
"this",
"->",
"template",
"->",
"error",
"=",
"true",
";",
"$",
"this",
"->",
"template",
"->",
"error_message",
"=",
"$",
"message",
";",
"}"
] | {@inheritdoc} | [
"{"
] | train | https://github.com/askupasoftware/amarkal/blob/fe8283e2d6847ef697abec832da7ee741a85058c/Extensions/WordPress/Widget/UI/Textarea/controller.php#L97-L100 |
qcubed/orm | src/Query/Node/NoParentBase.php | NoParentBase.setAlias | public function setAlias($strAlias)
{
if ($this->strFullAlias) {
throw new \Exception ("You cannot set an alias on a node after you have used it in a query. See the examples doc. You must set the alias while creating the node.");
}
try {
// Changing the alias of the n... | php | public function setAlias($strAlias)
{
if ($this->strFullAlias) {
throw new \Exception ("You cannot set an alias on a node after you have used it in a query. See the examples doc. You must set the alias while creating the node.");
}
try {
// Changing the alias of the n... | [
"public",
"function",
"setAlias",
"(",
"$",
"strAlias",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"strFullAlias",
")",
"{",
"throw",
"new",
"\\",
"Exception",
"(",
"\"You cannot set an alias on a node after you have used it in a query. See the examples doc. You must set the a... | Change the alias of the node, primarily for joining the same table more than once.
@param $strAlias
@throws Caller
@throws \Exception | [
"Change",
"the",
"alias",
"of",
"the",
"node",
"primarily",
"for",
"joining",
"the",
"same",
"table",
"more",
"than",
"once",
"."
] | train | https://github.com/qcubed/orm/blob/f320eba671f20874b1f3809c5293f8c02d5b1204/src/Query/Node/NoParentBase.php#L38-L51 |
qcubed/orm | src/Query/Node/NoParentBase.php | NoParentBase.fullAlias | public function fullAlias()
{
if ($this->strFullAlias) {
return $this->strFullAlias;
} else {
assert(!empty($this->strAlias)); // Alias should always be set by default
return $this->strAlias;
}
} | php | public function fullAlias()
{
if ($this->strFullAlias) {
return $this->strFullAlias;
} else {
assert(!empty($this->strAlias)); // Alias should always be set by default
return $this->strAlias;
}
} | [
"public",
"function",
"fullAlias",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"strFullAlias",
")",
"{",
"return",
"$",
"this",
"->",
"strFullAlias",
";",
"}",
"else",
"{",
"assert",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"strAlias",
")",
")",
... | Aid to generating full aliases. Recursively gets and sets the parent alias, eventually creating, caching and returning
an alias for itself.
@return string | [
"Aid",
"to",
"generating",
"full",
"aliases",
".",
"Recursively",
"gets",
"and",
"sets",
"the",
"parent",
"alias",
"eventually",
"creating",
"caching",
"and",
"returning",
"an",
"alias",
"for",
"itself",
"."
] | train | https://github.com/qcubed/orm/blob/f320eba671f20874b1f3809c5293f8c02d5b1204/src/Query/Node/NoParentBase.php#L58-L66 |
datasift/php_webdriver | src/php/DataSift/BrowserMobProxy/BrowserMobProxySession.php | BrowserMobProxySession.getWebDriverProxyConfig | public function getWebDriverProxyConfig()
{
$this->requireOpenConnection();
$address = new HttpAddress($this->getUrl());
return array (
'proxyType' => 'manual',
'httpProxy' => $address->hostname . ':' . $this->getPort(),
'sslProxy' => $address->hostname... | php | public function getWebDriverProxyConfig()
{
$this->requireOpenConnection();
$address = new HttpAddress($this->getUrl());
return array (
'proxyType' => 'manual',
'httpProxy' => $address->hostname . ':' . $this->getPort(),
'sslProxy' => $address->hostname... | [
"public",
"function",
"getWebDriverProxyConfig",
"(",
")",
"{",
"$",
"this",
"->",
"requireOpenConnection",
"(",
")",
";",
"$",
"address",
"=",
"new",
"HttpAddress",
"(",
"$",
"this",
"->",
"getUrl",
"(",
")",
")",
";",
"return",
"array",
"(",
"'proxyType'... | Returns the config information that needs to be given to webdriver
to make it use browsermob-proxy
@return array | [
"Returns",
"the",
"config",
"information",
"that",
"needs",
"to",
"be",
"given",
"to",
"webdriver",
"to",
"make",
"it",
"use",
"browsermob",
"-",
"proxy"
] | train | https://github.com/datasift/php_webdriver/blob/efca991198616b53c8f40b59ad05306e2b10e7f0/src/php/DataSift/BrowserMobProxy/BrowserMobProxySession.php#L86-L97 |
datasift/php_webdriver | src/php/DataSift/BrowserMobProxy/BrowserMobProxySession.php | BrowserMobProxySession.startHAR | public function startHAR($logName = 'default')
{
$this->requireOpenConnection();
$response = $this->curl(
'PUT',
'/proxy/' . $this->port . '/har',
array('initialPageRef' => $logName)
);
} | php | public function startHAR($logName = 'default')
{
$this->requireOpenConnection();
$response = $this->curl(
'PUT',
'/proxy/' . $this->port . '/har',
array('initialPageRef' => $logName)
);
} | [
"public",
"function",
"startHAR",
"(",
"$",
"logName",
"=",
"'default'",
")",
"{",
"$",
"this",
"->",
"requireOpenConnection",
"(",
")",
";",
"$",
"response",
"=",
"$",
"this",
"->",
"curl",
"(",
"'PUT'",
",",
"'/proxy/'",
".",
"$",
"this",
"->",
"port... | Start logging into a HTTP Archive (HAR)
@param string $logName the name of the archive to use
@return void | [
"Start",
"logging",
"into",
"a",
"HTTP",
"Archive",
"(",
"HAR",
")"
] | train | https://github.com/datasift/php_webdriver/blob/efca991198616b53c8f40b59ad05306e2b10e7f0/src/php/DataSift/BrowserMobProxy/BrowserMobProxySession.php#L105-L114 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.