id int32 0 241k | repo stringlengths 6 63 | path stringlengths 5 140 | func_name stringlengths 3 151 | original_string stringlengths 84 13k | language stringclasses 1
value | code stringlengths 84 13k | code_tokens list | docstring stringlengths 3 47.2k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 91 247 |
|---|---|---|---|---|---|---|---|---|---|---|---|
187,600 | yawik/applications | src/Controller/IndexController.php | IndexController.dashboardAction | public function dashboardAction()
{
/* @var Request $request */
$request = $this->getRequest();
$params = $request->getQuery();
$isRecruiter = $this->Acl()->isRole('recruiter');
if ($isRecruiter) {
$params->set('by', 'me');
}
//default sorting
... | php | public function dashboardAction()
{
/* @var Request $request */
$request = $this->getRequest();
$params = $request->getQuery();
$isRecruiter = $this->Acl()->isRole('recruiter');
if ($isRecruiter) {
$params->set('by', 'me');
}
//default sorting
... | [
"public",
"function",
"dashboardAction",
"(",
")",
"{",
"/* @var Request $request */",
"$",
"request",
"=",
"$",
"this",
"->",
"getRequest",
"(",
")",
";",
"$",
"params",
"=",
"$",
"request",
"->",
"getQuery",
"(",
")",
";",
"$",
"isRecruiter",
"=",
"$",
... | Handles dashboard listings of applications
@return array | [
"Handles",
"dashboard",
"listings",
"of",
"applications"
] | c3876ae91dc35f03aa71fa0e79877d15a78a2d0f | https://github.com/yawik/applications/blob/c3876ae91dc35f03aa71fa0e79877d15a78a2d0f/src/Controller/IndexController.php#L31-L56 |
187,601 | zicht/util | src/Zicht/Util/Url.php | Url.setUrl | public function setUrl($url)
{
$this->reset();
foreach (parse_url($url) as $part => $value) {
$this[$part] = $value;
}
} | php | public function setUrl($url)
{
$this->reset();
foreach (parse_url($url) as $part => $value) {
$this[$part] = $value;
}
} | [
"public",
"function",
"setUrl",
"(",
"$",
"url",
")",
"{",
"$",
"this",
"->",
"reset",
"(",
")",
";",
"foreach",
"(",
"parse_url",
"(",
"$",
"url",
")",
"as",
"$",
"part",
"=>",
"$",
"value",
")",
"{",
"$",
"this",
"[",
"$",
"part",
"]",
"=",
... | Set and parse the url.
@param string $url
@return void | [
"Set",
"and",
"parse",
"the",
"url",
"."
] | c98521aa2524a5224d9c1e81145c5b0434892a5a | https://github.com/zicht/util/blob/c98521aa2524a5224d9c1e81145c5b0434892a5a/src/Zicht/Util/Url.php#L80-L87 |
187,602 | zicht/util | src/Zicht/Util/Url.php | Url.offsetGet | public function offsetGet($offset)
{
if (!in_array($offset, self::$parts)) {
throw new \OutOfBoundsException("$offset is not a valid url part");
}
if (isset($this->components[$offset])) {
$ret = $this->components[$offset];
} else {
$ret = '';
... | php | public function offsetGet($offset)
{
if (!in_array($offset, self::$parts)) {
throw new \OutOfBoundsException("$offset is not a valid url part");
}
if (isset($this->components[$offset])) {
$ret = $this->components[$offset];
} else {
$ret = '';
... | [
"public",
"function",
"offsetGet",
"(",
"$",
"offset",
")",
"{",
"if",
"(",
"!",
"in_array",
"(",
"$",
"offset",
",",
"self",
"::",
"$",
"parts",
")",
")",
"{",
"throw",
"new",
"\\",
"OutOfBoundsException",
"(",
"\"$offset is not a valid url part\"",
")",
... | Returns the string value of the specified url part.
Does not allow getting properties other than the specified class constants.
@param string $offset
@return string
@throws \OutOfBoundsException | [
"Returns",
"the",
"string",
"value",
"of",
"the",
"specified",
"url",
"part",
".",
"Does",
"not",
"allow",
"getting",
"properties",
"other",
"than",
"the",
"specified",
"class",
"constants",
"."
] | c98521aa2524a5224d9c1e81145c5b0434892a5a | https://github.com/zicht/util/blob/c98521aa2524a5224d9c1e81145c5b0434892a5a/src/Zicht/Util/Url.php#L153-L167 |
187,603 | zicht/util | src/Zicht/Util/Url.php | Url.offsetSet | public function offsetSet($offset, $value)
{
if ($offset == self::QUERY) {
$parameters = [];
parse_str($value, $parameters);
$value = $parameters;
}
$this->set($offset, $value);
} | php | public function offsetSet($offset, $value)
{
if ($offset == self::QUERY) {
$parameters = [];
parse_str($value, $parameters);
$value = $parameters;
}
$this->set($offset, $value);
} | [
"public",
"function",
"offsetSet",
"(",
"$",
"offset",
",",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"offset",
"==",
"self",
"::",
"QUERY",
")",
"{",
"$",
"parameters",
"=",
"[",
"]",
";",
"parse_str",
"(",
"$",
"value",
",",
"$",
"parameters",
")",... | Set the specified URL part.
@param string $offset
@param mixed $value
@return void
@throws \OutOfBoundsException If the specified part is not a valid URL part. | [
"Set",
"the",
"specified",
"URL",
"part",
"."
] | c98521aa2524a5224d9c1e81145c5b0434892a5a | https://github.com/zicht/util/blob/c98521aa2524a5224d9c1e81145c5b0434892a5a/src/Zicht/Util/Url.php#L179-L187 |
187,604 | zicht/util | src/Zicht/Util/Url.php | Url.set | public function set($part, $value)
{
if (!in_array($part, self::$parts)) {
throw new \OutOfBoundsException("$part is not a valid url part");
}
$this->components[$part] = $value;
return $this;
} | php | public function set($part, $value)
{
if (!in_array($part, self::$parts)) {
throw new \OutOfBoundsException("$part is not a valid url part");
}
$this->components[$part] = $value;
return $this;
} | [
"public",
"function",
"set",
"(",
"$",
"part",
",",
"$",
"value",
")",
"{",
"if",
"(",
"!",
"in_array",
"(",
"$",
"part",
",",
"self",
"::",
"$",
"parts",
")",
")",
"{",
"throw",
"new",
"\\",
"OutOfBoundsException",
"(",
"\"$part is not a valid url part\... | Set a URL part.
@param string $part
@param mixed $value
@return self
@throws \OutOfBoundsException | [
"Set",
"a",
"URL",
"part",
"."
] | c98521aa2524a5224d9c1e81145c5b0434892a5a | https://github.com/zicht/util/blob/c98521aa2524a5224d9c1e81145c5b0434892a5a/src/Zicht/Util/Url.php#L198-L206 |
187,605 | zicht/util | src/Zicht/Util/Url.php | Url.getParam | public function getParam($name, $default = null)
{
if (is_array($name)) {
return TreeTools::getByPath($this->components[self::QUERY], $name, $default);
}
if (isset($this->components[self::QUERY][$name])) {
return $this->components[self::QUERY][$name];
}
... | php | public function getParam($name, $default = null)
{
if (is_array($name)) {
return TreeTools::getByPath($this->components[self::QUERY], $name, $default);
}
if (isset($this->components[self::QUERY][$name])) {
return $this->components[self::QUERY][$name];
}
... | [
"public",
"function",
"getParam",
"(",
"$",
"name",
",",
"$",
"default",
"=",
"null",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"name",
")",
")",
"{",
"return",
"TreeTools",
"::",
"getByPath",
"(",
"$",
"this",
"->",
"components",
"[",
"self",
"::",... | Returns a parameter from the query string. Allows an array to traverse a tree of key names.
@param string|array $name
@param mixed $default
@return mixed | [
"Returns",
"a",
"parameter",
"from",
"the",
"query",
"string",
".",
"Allows",
"an",
"array",
"to",
"traverse",
"a",
"tree",
"of",
"key",
"names",
"."
] | c98521aa2524a5224d9c1e81145c5b0434892a5a | https://github.com/zicht/util/blob/c98521aa2524a5224d9c1e81145c5b0434892a5a/src/Zicht/Util/Url.php#L216-L226 |
187,606 | zicht/util | src/Zicht/Util/Url.php | Url.setParam | public function setParam($name, $value, $replace = true)
{
if (is_array($name)) {
if (!isset($this->components[self::QUERY])) {
$this->components[self::QUERY] = [];
}
TreeTools::setByPath($this->components[self::QUERY], $name, $value);
} else {
... | php | public function setParam($name, $value, $replace = true)
{
if (is_array($name)) {
if (!isset($this->components[self::QUERY])) {
$this->components[self::QUERY] = [];
}
TreeTools::setByPath($this->components[self::QUERY], $name, $value);
} else {
... | [
"public",
"function",
"setParam",
"(",
"$",
"name",
",",
"$",
"value",
",",
"$",
"replace",
"=",
"true",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"name",
")",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"components",
"[",
"self",... | Sets a parameter in the query string. Allows an array to traverse a tree of key names.
@param string|array $name
@param mixed $value
@param bool $replace
@return Url | [
"Sets",
"a",
"parameter",
"in",
"the",
"query",
"string",
".",
"Allows",
"an",
"array",
"to",
"traverse",
"a",
"tree",
"of",
"key",
"names",
"."
] | c98521aa2524a5224d9c1e81145c5b0434892a5a | https://github.com/zicht/util/blob/c98521aa2524a5224d9c1e81145c5b0434892a5a/src/Zicht/Util/Url.php#L237-L251 |
187,607 | zicht/util | src/Zicht/Util/Url.php | Url.addParam | public function addParam($name, $value, $convertToArrayIfExists = false)
{
if (isset($this->components[self::QUERY][$name])) {
if (!is_array($this->components[self::QUERY][$name])) {
if ($convertToArrayIfExists) {
$this->components[self::QUERY][$name] = [$this... | php | public function addParam($name, $value, $convertToArrayIfExists = false)
{
if (isset($this->components[self::QUERY][$name])) {
if (!is_array($this->components[self::QUERY][$name])) {
if ($convertToArrayIfExists) {
$this->components[self::QUERY][$name] = [$this... | [
"public",
"function",
"addParam",
"(",
"$",
"name",
",",
"$",
"value",
",",
"$",
"convertToArrayIfExists",
"=",
"false",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"components",
"[",
"self",
"::",
"QUERY",
"]",
"[",
"$",
"name",
"]",
")",
... | Adds a parameter at the specified path.
@param string|array $name
@param mixed $value
@param bool $convertToArrayIfExists
@return Url
@throws \InvalidArgumentException | [
"Adds",
"a",
"parameter",
"at",
"the",
"specified",
"path",
"."
] | c98521aa2524a5224d9c1e81145c5b0434892a5a | https://github.com/zicht/util/blob/c98521aa2524a5224d9c1e81145c5b0434892a5a/src/Zicht/Util/Url.php#L263-L278 |
187,608 | zicht/util | src/Zicht/Util/Url.php | Url.queryString | public static function queryString($params, $parent = null, $callback = 'rawurlencode', $ignoreNonValues = true)
{
$params = self::flattenRequestVars($params, $parent);
$ret = [];
foreach ($params as $pair) {
list($name, $value) = $pair;
if (!$value && $ignoreNonValue... | php | public static function queryString($params, $parent = null, $callback = 'rawurlencode', $ignoreNonValues = true)
{
$params = self::flattenRequestVars($params, $parent);
$ret = [];
foreach ($params as $pair) {
list($name, $value) = $pair;
if (!$value && $ignoreNonValue... | [
"public",
"static",
"function",
"queryString",
"(",
"$",
"params",
",",
"$",
"parent",
"=",
"null",
",",
"$",
"callback",
"=",
"'rawurlencode'",
",",
"$",
"ignoreNonValues",
"=",
"true",
")",
"{",
"$",
"params",
"=",
"self",
"::",
"flattenRequestVars",
"("... | Construct a query string from the parameters
@param array $params
@param null $parent
@param string $callback
@param bool $ignoreNonValues
@return string | [
"Construct",
"a",
"query",
"string",
"from",
"the",
"parameters"
] | c98521aa2524a5224d9c1e81145c5b0434892a5a | https://github.com/zicht/util/blob/c98521aa2524a5224d9c1e81145c5b0434892a5a/src/Zicht/Util/Url.php#L352-L367 |
187,609 | yawik/applications | src/Repository/Application.php | Application.getPaginationQueryBuilder | protected function getPaginationQueryBuilder($params)
{
$filter = $this->getService('FilterManager')->get('PaginationQuery/Applications');
$qb = $filter->filter($params, $this->createQueryBuilder());
return $qb;
} | php | protected function getPaginationQueryBuilder($params)
{
$filter = $this->getService('FilterManager')->get('PaginationQuery/Applications');
$qb = $filter->filter($params, $this->createQueryBuilder());
return $qb;
} | [
"protected",
"function",
"getPaginationQueryBuilder",
"(",
"$",
"params",
")",
"{",
"$",
"filter",
"=",
"$",
"this",
"->",
"getService",
"(",
"'FilterManager'",
")",
"->",
"get",
"(",
"'PaginationQuery/Applications'",
")",
";",
"$",
"qb",
"=",
"$",
"filter",
... | Gets a query builder to search for applications
@param array $params
@return unknown | [
"Gets",
"a",
"query",
"builder",
"to",
"search",
"for",
"applications"
] | c3876ae91dc35f03aa71fa0e79877d15a78a2d0f | https://github.com/yawik/applications/blob/c3876ae91dc35f03aa71fa0e79877d15a78a2d0f/src/Repository/Application.php#L89-L95 |
187,610 | yawik/applications | src/Repository/Application.php | Application.getPaginationList | public function getPaginationList($params)
{
$qb = $this->getPaginationQueryBuilder($params);
$cursor = $qb->hydrate(false)
->select('_id')
->getQuery()
->execute();
$list = new PaginationList(array_keys(ArrayUtils::iter... | php | public function getPaginationList($params)
{
$qb = $this->getPaginationQueryBuilder($params);
$cursor = $qb->hydrate(false)
->select('_id')
->getQuery()
->execute();
$list = new PaginationList(array_keys(ArrayUtils::iter... | [
"public",
"function",
"getPaginationList",
"(",
"$",
"params",
")",
"{",
"$",
"qb",
"=",
"$",
"this",
"->",
"getPaginationQueryBuilder",
"(",
"$",
"params",
")",
";",
"$",
"cursor",
"=",
"$",
"qb",
"->",
"hydrate",
"(",
"false",
")",
"->",
"select",
"(... | Gets a result list of applications
@param array $params
@return \Applications\Repository\PaginationList | [
"Gets",
"a",
"result",
"list",
"of",
"applications"
] | c3876ae91dc35f03aa71fa0e79877d15a78a2d0f | https://github.com/yawik/applications/blob/c3876ae91dc35f03aa71fa0e79877d15a78a2d0f/src/Repository/Application.php#L103-L113 |
187,611 | yawik/applications | src/Repository/Application.php | Application.loadUnreadApplicationsForJob | public function loadUnreadApplicationsForJob($job)
{
$auth=$this->getService('AuthenticationService');
$qb=$this->createQueryBuilder()
->field("readBy")->notIn(array($auth->getUser()->getId()))
->field("job")->equals(new \MongoId($job->getId()));
return $q... | php | public function loadUnreadApplicationsForJob($job)
{
$auth=$this->getService('AuthenticationService');
$qb=$this->createQueryBuilder()
->field("readBy")->notIn(array($auth->getUser()->getId()))
->field("job")->equals(new \MongoId($job->getId()));
return $q... | [
"public",
"function",
"loadUnreadApplicationsForJob",
"(",
"$",
"job",
")",
"{",
"$",
"auth",
"=",
"$",
"this",
"->",
"getService",
"(",
"'AuthenticationService'",
")",
";",
"$",
"qb",
"=",
"$",
"this",
"->",
"createQueryBuilder",
"(",
")",
"->",
"field",
... | Get unread applications
@param \Jobs\Entity\JobInterface $job
@return array|bool|\Doctrine\MongoDB\ArrayIterator|\Doctrine\MongoDB\Cursor|\Doctrine\MongoDB\EagerCursor|mixed|null | [
"Get",
"unread",
"applications"
] | c3876ae91dc35f03aa71fa0e79877d15a78a2d0f | https://github.com/yawik/applications/blob/c3876ae91dc35f03aa71fa0e79877d15a78a2d0f/src/Repository/Application.php#L134-L141 |
187,612 | yawik/applications | src/Repository/Application.php | Application.findComment | public function findComment($commentOrId)
{
if ($commentOrId instanceof CommentInterface) {
$commentOrId = $commentOrId->getId();
}
$application = $this->findOneBy(array('comments.id' => $commentOrId));
/* @var \Applications\Entity\Comment $comment */
for... | php | public function findComment($commentOrId)
{
if ($commentOrId instanceof CommentInterface) {
$commentOrId = $commentOrId->getId();
}
$application = $this->findOneBy(array('comments.id' => $commentOrId));
/* @var \Applications\Entity\Comment $comment */
for... | [
"public",
"function",
"findComment",
"(",
"$",
"commentOrId",
")",
"{",
"if",
"(",
"$",
"commentOrId",
"instanceof",
"CommentInterface",
")",
"{",
"$",
"commentOrId",
"=",
"$",
"commentOrId",
"->",
"getId",
"(",
")",
";",
"}",
"$",
"application",
"=",
"$",... | Get comments of an applications
@param $commentOrId
@internal param \Application\Entity\Comment $comment | Id
@return \Applications\Entity\Comment|NULL | [
"Get",
"comments",
"of",
"an",
"applications"
] | c3876ae91dc35f03aa71fa0e79877d15a78a2d0f | https://github.com/yawik/applications/blob/c3876ae91dc35f03aa71fa0e79877d15a78a2d0f/src/Repository/Application.php#L150-L164 |
187,613 | yawik/applications | src/Repository/Application.php | Application.findProfile | public function findProfile($profileId)
{
$application = $this->findOneBy(array('isDraft' => null, 'profiles._id' => new \MongoId($profileId)));
foreach ($application->getProfiles() as $profile) {
if ($profile->getId() == $profileId) {
return $profile;
}
... | php | public function findProfile($profileId)
{
$application = $this->findOneBy(array('isDraft' => null, 'profiles._id' => new \MongoId($profileId)));
foreach ($application->getProfiles() as $profile) {
if ($profile->getId() == $profileId) {
return $profile;
}
... | [
"public",
"function",
"findProfile",
"(",
"$",
"profileId",
")",
"{",
"$",
"application",
"=",
"$",
"this",
"->",
"findOneBy",
"(",
"array",
"(",
"'isDraft'",
"=>",
"null",
",",
"'profiles._id'",
"=>",
"new",
"\\",
"MongoId",
"(",
"$",
"profileId",
")",
... | Gets social profiles of an application
@param String $profileId
@return $profile|NULL | [
"Gets",
"social",
"profiles",
"of",
"an",
"application"
] | c3876ae91dc35f03aa71fa0e79877d15a78a2d0f | https://github.com/yawik/applications/blob/c3876ae91dc35f03aa71fa0e79877d15a78a2d0f/src/Repository/Application.php#L172-L181 |
187,614 | yawik/applications | src/Repository/Application.php | Application.getUserApplications | public function getUserApplications($userId, $limit = null)
{
$qb = $this->createQueryBuilder(null)
->field('user')->equals($userId)
->sort(['date' => -1]);
if (isset($limit)) {
$qb->limit($limit);
}
return $qb->getQuery()->execute();
... | php | public function getUserApplications($userId, $limit = null)
{
$qb = $this->createQueryBuilder(null)
->field('user')->equals($userId)
->sort(['date' => -1]);
if (isset($limit)) {
$qb->limit($limit);
}
return $qb->getQuery()->execute();
... | [
"public",
"function",
"getUserApplications",
"(",
"$",
"userId",
",",
"$",
"limit",
"=",
"null",
")",
"{",
"$",
"qb",
"=",
"$",
"this",
"->",
"createQueryBuilder",
"(",
"null",
")",
"->",
"field",
"(",
"'user'",
")",
"->",
"equals",
"(",
"$",
"userId",... | Get applications for given user ID
@param string $userId
@param int $limit
@return Cursor
@since 0.27 | [
"Get",
"applications",
"for",
"given",
"user",
"ID"
] | c3876ae91dc35f03aa71fa0e79877d15a78a2d0f | https://github.com/yawik/applications/blob/c3876ae91dc35f03aa71fa0e79877d15a78a2d0f/src/Repository/Application.php#L234-L245 |
187,615 | zicht/util | src/Zicht/Util/File.php | File.sanitize | public static function sanitize($fileName, $stripPath = true, $maxLength = 120, $defaultExtension = 'bin')
{
list($dirname, $name, $ext) = self::split($fileName);
if (!$stripPath) {
$unslashedFilename = str_replace('/', '-', ltrim($dirname, '/')) . '-' . $name . '.' . $ext;
... | php | public static function sanitize($fileName, $stripPath = true, $maxLength = 120, $defaultExtension = 'bin')
{
list($dirname, $name, $ext) = self::split($fileName);
if (!$stripPath) {
$unslashedFilename = str_replace('/', '-', ltrim($dirname, '/')) . '-' . $name . '.' . $ext;
... | [
"public",
"static",
"function",
"sanitize",
"(",
"$",
"fileName",
",",
"$",
"stripPath",
"=",
"true",
",",
"$",
"maxLength",
"=",
"120",
",",
"$",
"defaultExtension",
"=",
"'bin'",
")",
"{",
"list",
"(",
"$",
"dirname",
",",
"$",
"name",
",",
"$",
"e... | Sanitize a file name, excluding unwanted characters and replacing them with a dash.
@param string $fileName
@param bool $stripPath
@param int $maxLength
@param string $defaultExtension
@return string
@throws \InvalidArgumentException | [
"Sanitize",
"a",
"file",
"name",
"excluding",
"unwanted",
"characters",
"and",
"replacing",
"them",
"with",
"a",
"dash",
"."
] | c98521aa2524a5224d9c1e81145c5b0434892a5a | https://github.com/zicht/util/blob/c98521aa2524a5224d9c1e81145c5b0434892a5a/src/Zicht/Util/File.php#L24-L42 |
187,616 | yawik/applications | src/Repository/PaginationList.php | PaginationList.setList | public function setList(array $ids)
{
$this->ids = $ids;
$this->count = count($ids);
return $this;
} | php | public function setList(array $ids)
{
$this->ids = $ids;
$this->count = count($ids);
return $this;
} | [
"public",
"function",
"setList",
"(",
"array",
"$",
"ids",
")",
"{",
"$",
"this",
"->",
"ids",
"=",
"$",
"ids",
";",
"$",
"this",
"->",
"count",
"=",
"count",
"(",
"$",
"ids",
")",
";",
"return",
"$",
"this",
";",
"}"
] | Sets the list entries
@param array $ids
@return \Applications\Repository\PaginationList | [
"Sets",
"the",
"list",
"entries"
] | c3876ae91dc35f03aa71fa0e79877d15a78a2d0f | https://github.com/yawik/applications/blob/c3876ae91dc35f03aa71fa0e79877d15a78a2d0f/src/Repository/PaginationList.php#L52-L57 |
187,617 | yawik/applications | src/Repository/PaginationList.php | PaginationList.getCurrent | public function getCurrent()
{
if (false === $this->pointer || empty($this->ids)) {
return null;
}
return $this->ids[$this->pointer];
} | php | public function getCurrent()
{
if (false === $this->pointer || empty($this->ids)) {
return null;
}
return $this->ids[$this->pointer];
} | [
"public",
"function",
"getCurrent",
"(",
")",
"{",
"if",
"(",
"false",
"===",
"$",
"this",
"->",
"pointer",
"||",
"empty",
"(",
"$",
"this",
"->",
"ids",
")",
")",
"{",
"return",
"null",
";",
"}",
"return",
"$",
"this",
"->",
"ids",
"[",
"$",
"th... | Gets current list entry.
@return NULL|array | [
"Gets",
"current",
"list",
"entry",
"."
] | c3876ae91dc35f03aa71fa0e79877d15a78a2d0f | https://github.com/yawik/applications/blob/c3876ae91dc35f03aa71fa0e79877d15a78a2d0f/src/Repository/PaginationList.php#L76-L82 |
187,618 | yawik/applications | src/Repository/PaginationList.php | PaginationList.getPrevious | public function getPrevious()
{
if (false === $this->pointer || !$this->count || 0 == $this->pointer) {
return null;
}
return $this->ids[$this->pointer - 1];
} | php | public function getPrevious()
{
if (false === $this->pointer || !$this->count || 0 == $this->pointer) {
return null;
}
return $this->ids[$this->pointer - 1];
} | [
"public",
"function",
"getPrevious",
"(",
")",
"{",
"if",
"(",
"false",
"===",
"$",
"this",
"->",
"pointer",
"||",
"!",
"$",
"this",
"->",
"count",
"||",
"0",
"==",
"$",
"this",
"->",
"pointer",
")",
"{",
"return",
"null",
";",
"}",
"return",
"$",
... | gets the id BEFORE the current entry.
@return null|string | [
"gets",
"the",
"id",
"BEFORE",
"the",
"current",
"entry",
"."
] | c3876ae91dc35f03aa71fa0e79877d15a78a2d0f | https://github.com/yawik/applications/blob/c3876ae91dc35f03aa71fa0e79877d15a78a2d0f/src/Repository/PaginationList.php#L109-L115 |
187,619 | yawik/applications | src/Repository/PaginationList.php | PaginationList.getNext | public function getNext()
{
if (false === $this->pointer || !$this->count || $this->count == $this->pointer) {
return null;
}
$pointer = $this->pointer + 1;
return isset($this->ids[$pointer]) ? $this->ids[$pointer] : null;
} | php | public function getNext()
{
if (false === $this->pointer || !$this->count || $this->count == $this->pointer) {
return null;
}
$pointer = $this->pointer + 1;
return isset($this->ids[$pointer]) ? $this->ids[$pointer] : null;
} | [
"public",
"function",
"getNext",
"(",
")",
"{",
"if",
"(",
"false",
"===",
"$",
"this",
"->",
"pointer",
"||",
"!",
"$",
"this",
"->",
"count",
"||",
"$",
"this",
"->",
"count",
"==",
"$",
"this",
"->",
"pointer",
")",
"{",
"return",
"null",
";",
... | Gets the id BEHIND the current entry.
@return string
@return NULL|multitype: | [
"Gets",
"the",
"id",
"BEHIND",
"the",
"current",
"entry",
"."
] | c3876ae91dc35f03aa71fa0e79877d15a78a2d0f | https://github.com/yawik/applications/blob/c3876ae91dc35f03aa71fa0e79877d15a78a2d0f/src/Repository/PaginationList.php#L123-L132 |
187,620 | yawik/applications | src/Controller/ConsoleController.php | ConsoleController.generateKeywordsAction | public function generateKeywordsAction()
{
$applications = $this->fetchApplications();
$count = count($applications);
$repositories = $this->repositories; //->get('Applications/Application');
if (0 === $count) {
return 'No applications found.';
}
... | php | public function generateKeywordsAction()
{
$applications = $this->fetchApplications();
$count = count($applications);
$repositories = $this->repositories; //->get('Applications/Application');
if (0 === $count) {
return 'No applications found.';
}
... | [
"public",
"function",
"generateKeywordsAction",
"(",
")",
"{",
"$",
"applications",
"=",
"$",
"this",
"->",
"fetchApplications",
"(",
")",
";",
"$",
"count",
"=",
"count",
"(",
"$",
"applications",
")",
";",
"$",
"repositories",
"=",
"$",
"this",
"->",
"... | regenerate keywords for applications
@return string | [
"regenerate",
"keywords",
"for",
"applications"
] | c3876ae91dc35f03aa71fa0e79877d15a78a2d0f | https://github.com/yawik/applications/blob/c3876ae91dc35f03aa71fa0e79877d15a78a2d0f/src/Controller/ConsoleController.php#L83-L123 |
187,621 | yawik/applications | src/Controller/ConsoleController.php | ConsoleController.calculateRatingAction | public function calculateRatingAction()
{
$applications = $this->fetchApplications();
$count = count($applications);
$i=0;
echo "Calculate rating for " . $count . " applications ...\n";
$progress = new ProgressBar($count);
/** @var \Applications\Entity\Appli... | php | public function calculateRatingAction()
{
$applications = $this->fetchApplications();
$count = count($applications);
$i=0;
echo "Calculate rating for " . $count . " applications ...\n";
$progress = new ProgressBar($count);
/** @var \Applications\Entity\Appli... | [
"public",
"function",
"calculateRatingAction",
"(",
")",
"{",
"$",
"applications",
"=",
"$",
"this",
"->",
"fetchApplications",
"(",
")",
";",
"$",
"count",
"=",
"count",
"(",
"$",
"applications",
")",
";",
"$",
"i",
"=",
"0",
";",
"echo",
"\"Calculate r... | Recalculates ratings for applications
@return string | [
"Recalculates",
"ratings",
"for",
"applications"
] | c3876ae91dc35f03aa71fa0e79877d15a78a2d0f | https://github.com/yawik/applications/blob/c3876ae91dc35f03aa71fa0e79877d15a78a2d0f/src/Controller/ConsoleController.php#L130-L148 |
187,622 | yawik/applications | src/Controller/ConsoleController.php | ConsoleController.cleanupAction | protected function cleanupAction()
{
$days = 2;
$date = new \DateTime();
$date->modify("-$days day");
$filter = array("before" => $date->format("Y-m-d"),
"isDraft" => 1);
$applications = $this->fetchApplications($filter);
$document... | php | protected function cleanupAction()
{
$days = 2;
$date = new \DateTime();
$date->modify("-$days day");
$filter = array("before" => $date->format("Y-m-d"),
"isDraft" => 1);
$applications = $this->fetchApplications($filter);
$document... | [
"protected",
"function",
"cleanupAction",
"(",
")",
"{",
"$",
"days",
"=",
"2",
";",
"$",
"date",
"=",
"new",
"\\",
"DateTime",
"(",
")",
";",
"$",
"date",
"->",
"modify",
"(",
"\"-$days day\"",
")",
";",
"$",
"filter",
"=",
"array",
"(",
"\"before\"... | removes unfinished applications. Applications, which are in Draft Mode for
more than 24 hours. | [
"removes",
"unfinished",
"applications",
".",
"Applications",
"which",
"are",
"in",
"Draft",
"Mode",
"for",
"more",
"than",
"24",
"hours",
"."
] | c3876ae91dc35f03aa71fa0e79877d15a78a2d0f | https://github.com/yawik/applications/blob/c3876ae91dc35f03aa71fa0e79877d15a78a2d0f/src/Controller/ConsoleController.php#L154-L185 |
187,623 | yawik/applications | src/Controller/ConsoleController.php | ConsoleController.listviewscriptsAction | public function listviewscriptsAction()
{
$config = $this->config;
$table = new Table(
array('columnWidths' => array(40, 40, 40),
'decorator' => 'ascii')
);
$table->appendRow(array('Module', 'Name', 'Description'));
$offset=strl... | php | public function listviewscriptsAction()
{
$config = $this->config;
$table = new Table(
array('columnWidths' => array(40, 40, 40),
'decorator' => 'ascii')
);
$table->appendRow(array('Module', 'Name', 'Description'));
$offset=strl... | [
"public",
"function",
"listviewscriptsAction",
"(",
")",
"{",
"$",
"config",
"=",
"$",
"this",
"->",
"config",
";",
"$",
"table",
"=",
"new",
"Table",
"(",
"array",
"(",
"'columnWidths'",
"=>",
"array",
"(",
"40",
",",
"40",
",",
"40",
")",
",",
"'de... | list available view scripts | [
"list",
"available",
"view",
"scripts"
] | c3876ae91dc35f03aa71fa0e79877d15a78a2d0f | https://github.com/yawik/applications/blob/c3876ae91dc35f03aa71fa0e79877d15a78a2d0f/src/Controller/ConsoleController.php#L190-L241 |
187,624 | yawik/applications | src/Paginator/JobSelectPaginator.php | JobSelectPaginator.search | public function search($q)
{
/* @var \Doctrine\ODM\MongoDB\Query\Builder $qb */
$qb = $this->repository->createQueryBuilder();
$qb->field('title')->equals(new \MongoRegex('/' . addslashes($q) . '/i'));
$cursor = $qb->getQuery()->execute();
$adapter = new DoctrineMongoCursor(... | php | public function search($q)
{
/* @var \Doctrine\ODM\MongoDB\Query\Builder $qb */
$qb = $this->repository->createQueryBuilder();
$qb->field('title')->equals(new \MongoRegex('/' . addslashes($q) . '/i'));
$cursor = $qb->getQuery()->execute();
$adapter = new DoctrineMongoCursor(... | [
"public",
"function",
"search",
"(",
"$",
"q",
")",
"{",
"/* @var \\Doctrine\\ODM\\MongoDB\\Query\\Builder $qb */",
"$",
"qb",
"=",
"$",
"this",
"->",
"repository",
"->",
"createQueryBuilder",
"(",
")",
";",
"$",
"qb",
"->",
"field",
"(",
"'title'",
")",
"->",... | Set the search criteria.
@param string $q
@return self | [
"Set",
"the",
"search",
"criteria",
"."
] | c3876ae91dc35f03aa71fa0e79877d15a78a2d0f | https://github.com/yawik/applications/blob/c3876ae91dc35f03aa71fa0e79877d15a78a2d0f/src/Paginator/JobSelectPaginator.php#L41-L52 |
187,625 | yawik/applications | src/Listener/StatusChange.php | StatusChange.prepareFormData | public function prepareFormData(ApplicationEvent $e)
{
$target = $e->getTarget();
if ($target->isPostRequest()) {
return;
}
$this->application = $target->getApplicationEntity();
$status = $target->getStatus();
$user = $target->getUser();
$... | php | public function prepareFormData(ApplicationEvent $e)
{
$target = $e->getTarget();
if ($target->isPostRequest()) {
return;
}
$this->application = $target->getApplicationEntity();
$status = $target->getStatus();
$user = $target->getUser();
$... | [
"public",
"function",
"prepareFormData",
"(",
"ApplicationEvent",
"$",
"e",
")",
"{",
"$",
"target",
"=",
"$",
"e",
"->",
"getTarget",
"(",
")",
";",
"if",
"(",
"$",
"target",
"->",
"isPostRequest",
"(",
")",
")",
"{",
"return",
";",
"}",
"$",
"this"... | Prepares the Notification Mail
@param ApplicationEvent $e | [
"Prepares",
"the",
"Notification",
"Mail"
] | c3876ae91dc35f03aa71fa0e79877d15a78a2d0f | https://github.com/yawik/applications/blob/c3876ae91dc35f03aa71fa0e79877d15a78a2d0f/src/Listener/StatusChange.php#L71-L119 |
187,626 | yawik/applications | src/Listener/StatusChange.php | StatusChange.sendMail | public function sendMail(ApplicationEvent $event)
{
$event = $event->getTarget();
if (!$event->isPostRequest()) {
return;
}
$this->application = $event->getApplicationEntity();
$status = $event->getStatus();
$user = $event->getUser();
$post = $eve... | php | public function sendMail(ApplicationEvent $event)
{
$event = $event->getTarget();
if (!$event->isPostRequest()) {
return;
}
$this->application = $event->getApplicationEntity();
$status = $event->getStatus();
$user = $event->getUser();
$post = $eve... | [
"public",
"function",
"sendMail",
"(",
"ApplicationEvent",
"$",
"event",
")",
"{",
"$",
"event",
"=",
"$",
"event",
"->",
"getTarget",
"(",
")",
";",
"if",
"(",
"!",
"$",
"event",
"->",
"isPostRequest",
"(",
")",
")",
"{",
"return",
";",
"}",
"$",
... | Sends the Notification Mail.
@param ApplicationEvent $event | [
"Sends",
"the",
"Notification",
"Mail",
"."
] | c3876ae91dc35f03aa71fa0e79877d15a78a2d0f | https://github.com/yawik/applications/blob/c3876ae91dc35f03aa71fa0e79877d15a78a2d0f/src/Listener/StatusChange.php#L126-L177 |
187,627 | yawik/applications | src/Listener/EventApplicationCreated.php | EventApplicationCreated.sendCarbonCopyToCandidate | protected function sendCarbonCopyToCandidate()
{
if ($this->application->getAttributes()->getSendCarbonCopy()) {
$this->mailService->send(
'Applications/CarbonCopy',
[
'application' => $this->application
]
);
... | php | protected function sendCarbonCopyToCandidate()
{
if ($this->application->getAttributes()->getSendCarbonCopy()) {
$this->mailService->send(
'Applications/CarbonCopy',
[
'application' => $this->application
]
);
... | [
"protected",
"function",
"sendCarbonCopyToCandidate",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"application",
"->",
"getAttributes",
"(",
")",
"->",
"getSendCarbonCopy",
"(",
")",
")",
"{",
"$",
"this",
"->",
"mailService",
"->",
"send",
"(",
"'Applicati... | Send Carbon Copy to the User | [
"Send",
"Carbon",
"Copy",
"to",
"the",
"User"
] | c3876ae91dc35f03aa71fa0e79877d15a78a2d0f | https://github.com/yawik/applications/blob/c3876ae91dc35f03aa71fa0e79877d15a78a2d0f/src/Listener/EventApplicationCreated.php#L147-L157 |
187,628 | yawik/applications | src/Mail/Forward.php | Forward.generateBody | protected function generateBody()
{
$message = new Mime\Message();
$text = $this->generateHtml();
$textPart = new Mime\Part($text);
$textPart->type = 'text/html';
$textPart->charset = 'UTF-8';
$textPart->disposition = Mime\Mime::DISPOSITION_INLINE;
$message->... | php | protected function generateBody()
{
$message = new Mime\Message();
$text = $this->generateHtml();
$textPart = new Mime\Part($text);
$textPart->type = 'text/html';
$textPart->charset = 'UTF-8';
$textPart->disposition = Mime\Mime::DISPOSITION_INLINE;
$message->... | [
"protected",
"function",
"generateBody",
"(",
")",
"{",
"$",
"message",
"=",
"new",
"Mime",
"\\",
"Message",
"(",
")",
";",
"$",
"text",
"=",
"$",
"this",
"->",
"generateHtml",
"(",
")",
";",
"$",
"textPart",
"=",
"new",
"Mime",
"\\",
"Part",
"(",
... | Generates the Mail Body | [
"Generates",
"the",
"Mail",
"Body"
] | c3876ae91dc35f03aa71fa0e79877d15a78a2d0f | https://github.com/yawik/applications/blob/c3876ae91dc35f03aa71fa0e79877d15a78a2d0f/src/Mail/Forward.php#L75-L109 |
187,629 | yawik/applications | src/Form/Element/JobSelect.php | JobSelect.setSelectedJob | public function setSelectedJob(JobInterface $job)
{
$this->setValueOptions([
'0' => '',
$job->getId() => $job->getTitle(),
]);
$this->setValue($job->getId());
return $this;
} | php | public function setSelectedJob(JobInterface $job)
{
$this->setValueOptions([
'0' => '',
$job->getId() => $job->getTitle(),
]);
$this->setValue($job->getId());
return $this;
} | [
"public",
"function",
"setSelectedJob",
"(",
"JobInterface",
"$",
"job",
")",
"{",
"$",
"this",
"->",
"setValueOptions",
"(",
"[",
"'0'",
"=>",
"''",
",",
"$",
"job",
"->",
"getId",
"(",
")",
"=>",
"$",
"job",
"->",
"getTitle",
"(",
")",
",",
"]",
... | Set the pre selected job.
@param JobInterface $job
@return self | [
"Set",
"the",
"pre",
"selected",
"job",
"."
] | c3876ae91dc35f03aa71fa0e79877d15a78a2d0f | https://github.com/yawik/applications/blob/c3876ae91dc35f03aa71fa0e79877d15a78a2d0f/src/Form/Element/JobSelect.php#L58-L68 |
187,630 | yawik/applications | src/Controller/ManageController.php | ManageController.refreshRatingAction | public function refreshRatingAction()
{
$model = new ViewModel();
$model->setTemplate('applications/manage/_rating');
$application = $this->repositories->get('Applications/Application')
->find($this->params('id', 0));
if (!$application) {
... | php | public function refreshRatingAction()
{
$model = new ViewModel();
$model->setTemplate('applications/manage/_rating');
$application = $this->repositories->get('Applications/Application')
->find($this->params('id', 0));
if (!$application) {
... | [
"public",
"function",
"refreshRatingAction",
"(",
")",
"{",
"$",
"model",
"=",
"new",
"ViewModel",
"(",
")",
";",
"$",
"model",
"->",
"setTemplate",
"(",
"'applications/manage/_rating'",
")",
";",
"$",
"application",
"=",
"$",
"this",
"->",
"repositories",
"... | Refreshes the rating of an application
@throws \DomainException
@return \Zend\View\Model\ViewModel | [
"Refreshes",
"the",
"rating",
"of",
"an",
"application"
] | c3876ae91dc35f03aa71fa0e79877d15a78a2d0f | https://github.com/yawik/applications/blob/c3876ae91dc35f03aa71fa0e79877d15a78a2d0f/src/Controller/ManageController.php#L266-L280 |
187,631 | yawik/applications | src/Controller/ManageController.php | ManageController.statusAction | public function statusAction()
{
$applicationId = $this->params('id');
/* @var \Applications\Repository\Application $repository */
$repository = $this->repositories->get('Applications/Application');
/* @var Application $application */
$application = $repository->find($ap... | php | public function statusAction()
{
$applicationId = $this->params('id');
/* @var \Applications\Repository\Application $repository */
$repository = $this->repositories->get('Applications/Application');
/* @var Application $application */
$application = $repository->find($ap... | [
"public",
"function",
"statusAction",
"(",
")",
"{",
"$",
"applicationId",
"=",
"$",
"this",
"->",
"params",
"(",
"'id'",
")",
";",
"/* @var \\Applications\\Repository\\Application $repository */",
"$",
"repository",
"=",
"$",
"this",
"->",
"repositories",
"->",
"... | Changes the status of an application
@return array | [
"Changes",
"the",
"status",
"of",
"an",
"application"
] | c3876ae91dc35f03aa71fa0e79877d15a78a2d0f | https://github.com/yawik/applications/blob/c3876ae91dc35f03aa71fa0e79877d15a78a2d0f/src/Controller/ManageController.php#L320-L402 |
187,632 | yawik/applications | src/Controller/ManageController.php | ManageController.forwardAction | public function forwardAction()
{
$emailAddress = $this->params()->fromQuery('email');
/* @var \Applications\Entity\Application $application */
$application = $this->repositories->get('Applications/Application')
->find($this->params('id'));
... | php | public function forwardAction()
{
$emailAddress = $this->params()->fromQuery('email');
/* @var \Applications\Entity\Application $application */
$application = $this->repositories->get('Applications/Application')
->find($this->params('id'));
... | [
"public",
"function",
"forwardAction",
"(",
")",
"{",
"$",
"emailAddress",
"=",
"$",
"this",
"->",
"params",
"(",
")",
"->",
"fromQuery",
"(",
"'email'",
")",
";",
"/* @var \\Applications\\Entity\\Application $application */",
"$",
"application",
"=",
"$",
"this",... | Forwards an application via Email
@throws \InvalidArgumentException
@return \Zend\View\Model\JsonModel | [
"Forwards",
"an",
"application",
"via",
"Email"
] | c3876ae91dc35f03aa71fa0e79877d15a78a2d0f | https://github.com/yawik/applications/blob/c3876ae91dc35f03aa71fa0e79877d15a78a2d0f/src/Controller/ManageController.php#L410-L449 |
187,633 | yawik/applications | src/Controller/ManageController.php | ManageController.deleteAction | public function deleteAction()
{
$id = $this->params('id');
$repositories= $this->repositories;
$repository = $repositories->get('Applications/Application');
$application = $repository->find($id);
if (!$application) {
throw new \DomainException(... | php | public function deleteAction()
{
$id = $this->params('id');
$repositories= $this->repositories;
$repository = $repositories->get('Applications/Application');
$application = $repository->find($id);
if (!$application) {
throw new \DomainException(... | [
"public",
"function",
"deleteAction",
"(",
")",
"{",
"$",
"id",
"=",
"$",
"this",
"->",
"params",
"(",
"'id'",
")",
";",
"$",
"repositories",
"=",
"$",
"this",
"->",
"repositories",
";",
"$",
"repository",
"=",
"$",
"repositories",
"->",
"get",
"(",
... | Deletes an application
@return array|\Zend\Http\Response | [
"Deletes",
"an",
"application"
] | c3876ae91dc35f03aa71fa0e79877d15a78a2d0f | https://github.com/yawik/applications/blob/c3876ae91dc35f03aa71fa0e79877d15a78a2d0f/src/Controller/ManageController.php#L456-L479 |
187,634 | yawik/applications | src/Controller/ManageController.php | ManageController.moveAction | public function moveAction()
{
$id = $this->params('id');
$repositories = $this->repositories;
$application = $repositories->get('Applications/Application')->find($id);
if (!$application) {
throw new \DomainException('Application not found.');
}
... | php | public function moveAction()
{
$id = $this->params('id');
$repositories = $this->repositories;
$application = $repositories->get('Applications/Application')->find($id);
if (!$application) {
throw new \DomainException('Application not found.');
}
... | [
"public",
"function",
"moveAction",
"(",
")",
"{",
"$",
"id",
"=",
"$",
"this",
"->",
"params",
"(",
"'id'",
")",
";",
"$",
"repositories",
"=",
"$",
"this",
"->",
"repositories",
";",
"$",
"application",
"=",
"$",
"repositories",
"->",
"get",
"(",
"... | Move an application to talent pool
@return \Zend\Http\Response
@since 0.26 | [
"Move",
"an",
"application",
"to",
"talent",
"pool"
] | c3876ae91dc35f03aa71fa0e79877d15a78a2d0f | https://github.com/yawik/applications/blob/c3876ae91dc35f03aa71fa0e79877d15a78a2d0f/src/Controller/ManageController.php#L487-L510 |
187,635 | yawik/applications | src/Form/SettingsFieldset.php | SettingsFieldset.init | public function init()
{
$this->setName('emails')
->setLabel(/* @translate */ 'E-Mail Notifications');
$this->add(
array('type' => Checkbox::class,
'name' => 'mailAccess',
'label' => 'foo',
'options' => array('label' =... | php | public function init()
{
$this->setName('emails')
->setLabel(/* @translate */ 'E-Mail Notifications');
$this->add(
array('type' => Checkbox::class,
'name' => 'mailAccess',
'label' => 'foo',
'options' => array('label' =... | [
"public",
"function",
"init",
"(",
")",
"{",
"$",
"this",
"->",
"setName",
"(",
"'emails'",
")",
"->",
"setLabel",
"(",
"/* @translate */",
"'E-Mail Notifications'",
")",
";",
"$",
"this",
"->",
"add",
"(",
"array",
"(",
"'type'",
"=>",
"Checkbox",
"::",
... | initialize settings form | [
"initialize",
"settings",
"form"
] | c3876ae91dc35f03aa71fa0e79877d15a78a2d0f | https://github.com/yawik/applications/blob/c3876ae91dc35f03aa71fa0e79877d15a78a2d0f/src/Form/SettingsFieldset.php#L41-L126 |
187,636 | yawik/applications | src/Mail/StatusChange.php | StatusChange.getFormalSalutation | protected function getFormalSalutation()
{
$contact = $this->application->getContact();
$name = $contact->getLastName();
$gender = $contact->getGender();
$translator = $this->getTranslator();
$salutation = 'male' == $gender
? $translator->tran... | php | protected function getFormalSalutation()
{
$contact = $this->application->getContact();
$name = $contact->getLastName();
$gender = $contact->getGender();
$translator = $this->getTranslator();
$salutation = 'male' == $gender
? $translator->tran... | [
"protected",
"function",
"getFormalSalutation",
"(",
")",
"{",
"$",
"contact",
"=",
"$",
"this",
"->",
"application",
"->",
"getContact",
"(",
")",
";",
"$",
"name",
"=",
"$",
"contact",
"->",
"getLastName",
"(",
")",
";",
"$",
"gender",
"=",
"$",
"con... | Gets the formal salutation of the applicant
@return string | [
"Gets",
"the",
"formal",
"salutation",
"of",
"the",
"applicant"
] | c3876ae91dc35f03aa71fa0e79877d15a78a2d0f | https://github.com/yawik/applications/blob/c3876ae91dc35f03aa71fa0e79877d15a78a2d0f/src/Mail/StatusChange.php#L72-L84 |
187,637 | n2n/n2n-mail | src/app/n2n/mail/smtp/SmtpConnection.php | SmtpConnection.sendMessage | public function sendMessage($message, $getResponse = true, $eol = "\r\n") {
fputs($this->conn, $message . $eol);
if (!$getResponse) return null;
// read answer from server
return $this->getResponse();
} | php | public function sendMessage($message, $getResponse = true, $eol = "\r\n") {
fputs($this->conn, $message . $eol);
if (!$getResponse) return null;
// read answer from server
return $this->getResponse();
} | [
"public",
"function",
"sendMessage",
"(",
"$",
"message",
",",
"$",
"getResponse",
"=",
"true",
",",
"$",
"eol",
"=",
"\"\\r\\n\"",
")",
"{",
"fputs",
"(",
"$",
"this",
"->",
"conn",
",",
"$",
"message",
".",
"$",
"eol",
")",
";",
"if",
"(",
"!",
... | sends a message to the smtp server
@param string $message
@param bool $getResponse
@param string $eol
@return SmtpResponse | [
"sends",
"a",
"message",
"to",
"the",
"smtp",
"server"
] | 00fcceab594a2dc2e6923be950a71edacb44b276 | https://github.com/n2n/n2n-mail/blob/00fcceab594a2dc2e6923be950a71edacb44b276/src/app/n2n/mail/smtp/SmtpConnection.php#L83-L90 |
187,638 | n2n/n2n-mail | src/app/n2n/mail/smtp/SmtpConnection.php | SmtpConnection.getResponse | private function getResponse() {
$data = '';
$start = microtime(true);
// read until end or timeout reached
while (!feof($this->conn) && (microtime(true) - $start) < ($this->timeout + 1)) {
$line = fgets($this->conn, 515);
if ($line === false) break;
$data .= $line;
// smtp ha... | php | private function getResponse() {
$data = '';
$start = microtime(true);
// read until end or timeout reached
while (!feof($this->conn) && (microtime(true) - $start) < ($this->timeout + 1)) {
$line = fgets($this->conn, 515);
if ($line === false) break;
$data .= $line;
// smtp ha... | [
"private",
"function",
"getResponse",
"(",
")",
"{",
"$",
"data",
"=",
"''",
";",
"$",
"start",
"=",
"microtime",
"(",
"true",
")",
";",
"// read until end or timeout reached\r",
"while",
"(",
"!",
"feof",
"(",
"$",
"this",
"->",
"conn",
")",
"&&",
"(",
... | reads all the lines of the command
@return SmtpResponse | [
"reads",
"all",
"the",
"lines",
"of",
"the",
"command"
] | 00fcceab594a2dc2e6923be950a71edacb44b276 | https://github.com/n2n/n2n-mail/blob/00fcceab594a2dc2e6923be950a71edacb44b276/src/app/n2n/mail/smtp/SmtpConnection.php#L114-L129 |
187,639 | zicht/util | src/Zicht/Util/Str.php | Str.camel | public static function camel($str, $split = '-_')
{
return preg_replace_callback(
'/[' . preg_quote($split) . '](.?)/',
function ($m) {
return ucfirst($m[1]);
},
$str
);
} | php | public static function camel($str, $split = '-_')
{
return preg_replace_callback(
'/[' . preg_quote($split) . '](.?)/',
function ($m) {
return ucfirst($m[1]);
},
$str
);
} | [
"public",
"static",
"function",
"camel",
"(",
"$",
"str",
",",
"$",
"split",
"=",
"'-_'",
")",
"{",
"return",
"preg_replace_callback",
"(",
"'/['",
".",
"preg_quote",
"(",
"$",
"split",
")",
".",
"'](.?)/'",
",",
"function",
"(",
"$",
"m",
")",
"{",
... | Camelcases an underscored or dashed string
@param string $str
@param string $split
@return string | [
"Camelcases",
"an",
"underscored",
"or",
"dashed",
"string"
] | c98521aa2524a5224d9c1e81145c5b0434892a5a | https://github.com/zicht/util/blob/c98521aa2524a5224d9c1e81145c5b0434892a5a/src/Zicht/Util/Str.php#L45-L54 |
187,640 | zicht/util | src/Zicht/Util/Str.php | Str.infix | public static function infix($str, $infix)
{
return lcfirst(
preg_replace_callback(
'/(?<=.)[A-Z]/',
function ($m) use ($infix) {
return $infix . strtolower($m[0]);
},
$str
)
);
} | php | public static function infix($str, $infix)
{
return lcfirst(
preg_replace_callback(
'/(?<=.)[A-Z]/',
function ($m) use ($infix) {
return $infix . strtolower($m[0]);
},
$str
)
);
} | [
"public",
"static",
"function",
"infix",
"(",
"$",
"str",
",",
"$",
"infix",
")",
"{",
"return",
"lcfirst",
"(",
"preg_replace_callback",
"(",
"'/(?<=.)[A-Z]/'",
",",
"function",
"(",
"$",
"m",
")",
"use",
"(",
"$",
"infix",
")",
"{",
"return",
"$",
"i... | Converts a camelcased string to another separator, using 'infix' as the separator.
@param string $str
@param string $infix
@return string | [
"Converts",
"a",
"camelcased",
"string",
"to",
"another",
"separator",
"using",
"infix",
"as",
"the",
"separator",
"."
] | c98521aa2524a5224d9c1e81145c5b0434892a5a | https://github.com/zicht/util/blob/c98521aa2524a5224d9c1e81145c5b0434892a5a/src/Zicht/Util/Str.php#L94-L105 |
187,641 | zicht/util | src/Zicht/Util/Str.php | Str.rstrip | public static function rstrip($str, $suffix)
{
if (substr($str, -strlen($suffix)) == $suffix) {
return substr($str, 0, -strlen($suffix));
}
return $str;
} | php | public static function rstrip($str, $suffix)
{
if (substr($str, -strlen($suffix)) == $suffix) {
return substr($str, 0, -strlen($suffix));
}
return $str;
} | [
"public",
"static",
"function",
"rstrip",
"(",
"$",
"str",
",",
"$",
"suffix",
")",
"{",
"if",
"(",
"substr",
"(",
"$",
"str",
",",
"-",
"strlen",
"(",
"$",
"suffix",
")",
")",
"==",
"$",
"suffix",
")",
"{",
"return",
"substr",
"(",
"$",
"str",
... | Strips a suffix of a string
@param string $str
@param string $suffix
@return string | [
"Strips",
"a",
"suffix",
"of",
"a",
"string"
] | c98521aa2524a5224d9c1e81145c5b0434892a5a | https://github.com/zicht/util/blob/c98521aa2524a5224d9c1e81145c5b0434892a5a/src/Zicht/Util/Str.php#L115-L121 |
187,642 | zicht/util | src/Zicht/Util/Str.php | Str.lstrip | public static function lstrip($str, $prefix)
{
if (substr($str, 0, strlen($prefix)) == $prefix) {
return substr($str, strlen($prefix));
}
return $str;
} | php | public static function lstrip($str, $prefix)
{
if (substr($str, 0, strlen($prefix)) == $prefix) {
return substr($str, strlen($prefix));
}
return $str;
} | [
"public",
"static",
"function",
"lstrip",
"(",
"$",
"str",
",",
"$",
"prefix",
")",
"{",
"if",
"(",
"substr",
"(",
"$",
"str",
",",
"0",
",",
"strlen",
"(",
"$",
"prefix",
")",
")",
"==",
"$",
"prefix",
")",
"{",
"return",
"substr",
"(",
"$",
"... | Strips a prefix of a string
@param string $str
@param string $prefix
@return string | [
"Strips",
"a",
"prefix",
"of",
"a",
"string"
] | c98521aa2524a5224d9c1e81145c5b0434892a5a | https://github.com/zicht/util/blob/c98521aa2524a5224d9c1e81145c5b0434892a5a/src/Zicht/Util/Str.php#L131-L137 |
187,643 | zicht/util | src/Zicht/Util/Str.php | Str.strip | public static function strip($str, $prefix, $suffix)
{
return self::rstrip(self::lstrip($str, $prefix), $suffix);
} | php | public static function strip($str, $prefix, $suffix)
{
return self::rstrip(self::lstrip($str, $prefix), $suffix);
} | [
"public",
"static",
"function",
"strip",
"(",
"$",
"str",
",",
"$",
"prefix",
",",
"$",
"suffix",
")",
"{",
"return",
"self",
"::",
"rstrip",
"(",
"self",
"::",
"lstrip",
"(",
"$",
"str",
",",
"$",
"prefix",
")",
",",
"$",
"suffix",
")",
";",
"}"... | Strips a prefix and suffix of a string
@param string $str
@param string $prefix
@param string $suffix
@return string | [
"Strips",
"a",
"prefix",
"and",
"suffix",
"of",
"a",
"string"
] | c98521aa2524a5224d9c1e81145c5b0434892a5a | https://github.com/zicht/util/blob/c98521aa2524a5224d9c1e81145c5b0434892a5a/src/Zicht/Util/Str.php#L148-L151 |
187,644 | zicht/util | src/Zicht/Util/Str.php | Str.systemize | public static function systemize($str, $infix = '-')
{
$str = self::ascii($str);
return trim(
preg_replace(
'/' . preg_quote($infix, '/') . '+/',
$infix,
preg_replace('/[^\w-]+/', $infix, strtolower($str))
),
$infix
... | php | public static function systemize($str, $infix = '-')
{
$str = self::ascii($str);
return trim(
preg_replace(
'/' . preg_quote($infix, '/') . '+/',
$infix,
preg_replace('/[^\w-]+/', $infix, strtolower($str))
),
$infix
... | [
"public",
"static",
"function",
"systemize",
"(",
"$",
"str",
",",
"$",
"infix",
"=",
"'-'",
")",
"{",
"$",
"str",
"=",
"self",
"::",
"ascii",
"(",
"$",
"str",
")",
";",
"return",
"trim",
"(",
"preg_replace",
"(",
"'/'",
".",
"preg_quote",
"(",
"$"... | Returns a systemized version of the string.
@param string $str
@param string $infix
@return string | [
"Returns",
"a",
"systemized",
"version",
"of",
"the",
"string",
"."
] | c98521aa2524a5224d9c1e81145c5b0434892a5a | https://github.com/zicht/util/blob/c98521aa2524a5224d9c1e81145c5b0434892a5a/src/Zicht/Util/Str.php#L204-L215 |
187,645 | zicht/util | src/Zicht/Util/Str.php | Str.ascii | public static function ascii($str, $srcEncoding = 'UTF-8')
{
// collapse soft hyphens.
$str = str_replace(html_entity_decode('­', null, 'UTF-8'), '', $str);
return transliterator_transliterate('Any-Latin;Latin-ASCII', $str);
} | php | public static function ascii($str, $srcEncoding = 'UTF-8')
{
// collapse soft hyphens.
$str = str_replace(html_entity_decode('­', null, 'UTF-8'), '', $str);
return transliterator_transliterate('Any-Latin;Latin-ASCII', $str);
} | [
"public",
"static",
"function",
"ascii",
"(",
"$",
"str",
",",
"$",
"srcEncoding",
"=",
"'UTF-8'",
")",
"{",
"// collapse soft hyphens.",
"$",
"str",
"=",
"str_replace",
"(",
"html_entity_decode",
"(",
"'­'",
",",
"null",
",",
"'UTF-8'",
")",
",",
"''",
... | Converts a text string to ASCII
@param string $str
@param string $srcEncoding
@return string | [
"Converts",
"a",
"text",
"string",
"to",
"ASCII"
] | c98521aa2524a5224d9c1e81145c5b0434892a5a | https://github.com/zicht/util/blob/c98521aa2524a5224d9c1e81145c5b0434892a5a/src/Zicht/Util/Str.php#L225-L230 |
187,646 | zicht/util | src/Zicht/Util/Str.php | Str.random | public static function random($length = 64, $characters = self::ALNUM)
{
static $random_generator = null;
if (null === $random_generator) {
$random_generator = is_callable('mt_rand') ? 'mt_rand' : 'rand';
}
$len = strlen($characters);
return join(
''... | php | public static function random($length = 64, $characters = self::ALNUM)
{
static $random_generator = null;
if (null === $random_generator) {
$random_generator = is_callable('mt_rand') ? 'mt_rand' : 'rand';
}
$len = strlen($characters);
return join(
''... | [
"public",
"static",
"function",
"random",
"(",
"$",
"length",
"=",
"64",
",",
"$",
"characters",
"=",
"self",
"::",
"ALNUM",
")",
"{",
"static",
"$",
"random_generator",
"=",
"null",
";",
"if",
"(",
"null",
"===",
"$",
"random_generator",
")",
"{",
"$"... | Generate a random string with specified length from the specified characters
@param int $length
@param string $characters
@return string | [
"Generate",
"a",
"random",
"string",
"with",
"specified",
"length",
"from",
"the",
"specified",
"characters"
] | c98521aa2524a5224d9c1e81145c5b0434892a5a | https://github.com/zicht/util/blob/c98521aa2524a5224d9c1e81145c5b0434892a5a/src/Zicht/Util/Str.php#L240-L258 |
187,647 | railken/amethyst-file-generator | src/Managers/FileGeneratorManager.php | FileGeneratorManager.generate | public function generate(FileGenerator $generator, array $data = [])
{
$result = (new DataBuilderManager())->validateRaw($generator->data_builder, $data);
if (!$result->ok()) {
return $result;
}
dispatch(new GenerateFile($generator, $data, $this->getAgent()));
... | php | public function generate(FileGenerator $generator, array $data = [])
{
$result = (new DataBuilderManager())->validateRaw($generator->data_builder, $data);
if (!$result->ok()) {
return $result;
}
dispatch(new GenerateFile($generator, $data, $this->getAgent()));
... | [
"public",
"function",
"generate",
"(",
"FileGenerator",
"$",
"generator",
",",
"array",
"$",
"data",
"=",
"[",
"]",
")",
"{",
"$",
"result",
"=",
"(",
"new",
"DataBuilderManager",
"(",
")",
")",
"->",
"validateRaw",
"(",
"$",
"generator",
"->",
"data_bui... | Request a file-generator.
@param FileGenerator $generator
@param array $data
@return \Railken\Lem\Contracts\ResultContract | [
"Request",
"a",
"file",
"-",
"generator",
"."
] | 444f7e7762e826c36573591d12f46a67b911c0d6 | https://github.com/railken/amethyst-file-generator/blob/444f7e7762e826c36573591d12f46a67b911c0d6/src/Managers/FileGeneratorManager.php#L32-L43 |
187,648 | OpenLdapObject/OpenLdapObject | lib/OpenLdapObject/LdapClient/Connection.php | Connection.connect | public function connect()
{
$this->connect = ldap_connect($this->hostname, $this->port);
if (!$this->connect) {
throw new ConnectionException($this);
}
// Set Ldap Version to 3
ldap_set_option($this->connect, LDAP_OPT_PROTOCOL_VERSION, 3);
if (!is_null(... | php | public function connect()
{
$this->connect = ldap_connect($this->hostname, $this->port);
if (!$this->connect) {
throw new ConnectionException($this);
}
// Set Ldap Version to 3
ldap_set_option($this->connect, LDAP_OPT_PROTOCOL_VERSION, 3);
if (!is_null(... | [
"public",
"function",
"connect",
"(",
")",
"{",
"$",
"this",
"->",
"connect",
"=",
"ldap_connect",
"(",
"$",
"this",
"->",
"hostname",
",",
"$",
"this",
"->",
"port",
")",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"connect",
")",
"{",
"throw",
"new",... | Connect to the Ldap Server and get a client to execute Query
@return Client
@throws \OpenLdapObject\Exception\ConnectionException
@throws \OpenLdapObject\Exception\BadIdentificationException | [
"Connect",
"to",
"the",
"Ldap",
"Server",
"and",
"get",
"a",
"client",
"to",
"execute",
"Query"
] | 6aa5f699a6c35c17b016655c84e9debb026df125 | https://github.com/OpenLdapObject/OpenLdapObject/blob/6aa5f699a6c35c17b016655c84e9debb026df125/lib/OpenLdapObject/LdapClient/Connection.php#L71-L89 |
187,649 | n2n/n2n-mail | src/app/n2n/mail/MailAddress.php | MailAddress.getName | public function getName($quoted = false) {
if (!$quoted) return $this->name;
$quotedName = addcslashes($this->name, "\0..\37\177\\\"");
// check if name needs to be quoted
if ($this->name == $quotedName && !preg_match('/[^A-Za-z0-9!#$%&\'*+\/=?^_`{|}~ -]/', $this->name)) {
return $this->name;
} e... | php | public function getName($quoted = false) {
if (!$quoted) return $this->name;
$quotedName = addcslashes($this->name, "\0..\37\177\\\"");
// check if name needs to be quoted
if ($this->name == $quotedName && !preg_match('/[^A-Za-z0-9!#$%&\'*+\/=?^_`{|}~ -]/', $this->name)) {
return $this->name;
} e... | [
"public",
"function",
"getName",
"(",
"$",
"quoted",
"=",
"false",
")",
"{",
"if",
"(",
"!",
"$",
"quoted",
")",
"return",
"$",
"this",
"->",
"name",
";",
"$",
"quotedName",
"=",
"addcslashes",
"(",
"$",
"this",
"->",
"name",
",",
"\"\\0..\\37\\177\\\\... | returns the name, if desired in quoted style for e-mail header output
@param bool $quoted | [
"returns",
"the",
"name",
"if",
"desired",
"in",
"quoted",
"style",
"for",
"e",
"-",
"mail",
"header",
"output"
] | 00fcceab594a2dc2e6923be950a71edacb44b276 | https://github.com/n2n/n2n-mail/blob/00fcceab594a2dc2e6923be950a71edacb44b276/src/app/n2n/mail/MailAddress.php#L50-L61 |
187,650 | n2n/n2n-mail | src/app/n2n/mail/MailAddress.php | MailAddress.validateAddress | private function validateAddress($address) {
ArgUtils::valType($address, 'scalar');
$email = self::stripEmail($address);
if (!filter_var($email, FILTER_VALIDATE_EMAIL)) throw new MailFormatException('invalid e-mail address: ' . $address);
} | php | private function validateAddress($address) {
ArgUtils::valType($address, 'scalar');
$email = self::stripEmail($address);
if (!filter_var($email, FILTER_VALIDATE_EMAIL)) throw new MailFormatException('invalid e-mail address: ' . $address);
} | [
"private",
"function",
"validateAddress",
"(",
"$",
"address",
")",
"{",
"ArgUtils",
"::",
"valType",
"(",
"$",
"address",
",",
"'scalar'",
")",
";",
"$",
"email",
"=",
"self",
"::",
"stripEmail",
"(",
"$",
"address",
")",
";",
"if",
"(",
"!",
"filter_... | checks if an address contains a valid e-mail address
@param string $address
@throws MailFormatException | [
"checks",
"if",
"an",
"address",
"contains",
"a",
"valid",
"e",
"-",
"mail",
"address"
] | 00fcceab594a2dc2e6923be950a71edacb44b276 | https://github.com/n2n/n2n-mail/blob/00fcceab594a2dc2e6923be950a71edacb44b276/src/app/n2n/mail/MailAddress.php#L69-L75 |
187,651 | n2n/n2n-mail | src/app/n2n/mail/MailAddress.php | MailAddress.stripName | public static function stripName($address) {
// strip line breaks and trim
$address = trim(preg_replace('/[\r\n]+/', '', $address));
$email = self::stripEmail($address);
$name = trim(str_replace('<' . $email . '>', '', $address));
// check if quotes need to be removed
if (substr($name, 0, 1) == "\... | php | public static function stripName($address) {
// strip line breaks and trim
$address = trim(preg_replace('/[\r\n]+/', '', $address));
$email = self::stripEmail($address);
$name = trim(str_replace('<' . $email . '>', '', $address));
// check if quotes need to be removed
if (substr($name, 0, 1) == "\... | [
"public",
"static",
"function",
"stripName",
"(",
"$",
"address",
")",
"{",
"// strip line breaks and trim\r",
"$",
"address",
"=",
"trim",
"(",
"preg_replace",
"(",
"'/[\\r\\n]+/'",
",",
"''",
",",
"$",
"address",
")",
")",
";",
"$",
"email",
"=",
"self",
... | returns the name of an expression like 'John Doe <john@doe.com>' -> John Doe
@param string $address
@return string | [
"returns",
"the",
"name",
"of",
"an",
"expression",
"like",
"John",
"Doe",
"<john"
] | 00fcceab594a2dc2e6923be950a71edacb44b276 | https://github.com/n2n/n2n-mail/blob/00fcceab594a2dc2e6923be950a71edacb44b276/src/app/n2n/mail/MailAddress.php#L95-L106 |
187,652 | yawik/applications | src/Form/BaseFieldset.php | BaseFieldset.init | public function init()
{
$this->setHydrator(new \Core\Entity\Hydrator\EntityHydrator())
->setName('base');
$this->add(
array(
'type' => 'textarea',
'name' => 'summary',
'options' => array(
'description' => /*@... | php | public function init()
{
$this->setHydrator(new \Core\Entity\Hydrator\EntityHydrator())
->setName('base');
$this->add(
array(
'type' => 'textarea',
'name' => 'summary',
'options' => array(
'description' => /*@... | [
"public",
"function",
"init",
"(",
")",
"{",
"$",
"this",
"->",
"setHydrator",
"(",
"new",
"\\",
"Core",
"\\",
"Entity",
"\\",
"Hydrator",
"\\",
"EntityHydrator",
"(",
")",
")",
"->",
"setName",
"(",
"'base'",
")",
";",
"$",
"this",
"->",
"add",
"(",... | initialize base fieldset | [
"initialize",
"base",
"fieldset"
] | c3876ae91dc35f03aa71fa0e79877d15a78a2d0f | https://github.com/yawik/applications/blob/c3876ae91dc35f03aa71fa0e79877d15a78a2d0f/src/Form/BaseFieldset.php#L40-L55 |
187,653 | yawik/applications | src/Controller/ApplyController.php | ApplyController.configureContainer | protected function configureContainer(Container $container)
{
/* @var $application Application */
$application = $container->getEntity();
$job = $application->getJob();
/** @var $settings \Applications\Entity\Settings */
$settings = ($user = $job->getUser()) ? $user-... | php | protected function configureContainer(Container $container)
{
/* @var $application Application */
$application = $container->getEntity();
$job = $application->getJob();
/** @var $settings \Applications\Entity\Settings */
$settings = ($user = $job->getUser()) ? $user-... | [
"protected",
"function",
"configureContainer",
"(",
"Container",
"$",
"container",
")",
"{",
"/* @var $application Application */",
"$",
"application",
"=",
"$",
"container",
"->",
"getEntity",
"(",
")",
";",
"$",
"job",
"=",
"$",
"application",
"->",
"getJob",
... | Configures the apply form container.
Currently only disables elements.
@param Container $container | [
"Configures",
"the",
"apply",
"form",
"container",
"."
] | c3876ae91dc35f03aa71fa0e79877d15a78a2d0f | https://github.com/yawik/applications/blob/c3876ae91dc35f03aa71fa0e79877d15a78a2d0f/src/Controller/ApplyController.php#L465-L487 |
187,654 | lepiaf/serialport | src/lepiaf/SerialPort/Configure/TTYConfigure.php | TTYConfigure.getOptions | protected function getOptions()
{
if (!$this->options) {
$this->options = $this->default;
}
$options = [];
foreach ($this->options as $value => $active) {
$options[] = $this->getActiveString($active).$value;
}
return join(" ", $options);
... | php | protected function getOptions()
{
if (!$this->options) {
$this->options = $this->default;
}
$options = [];
foreach ($this->options as $value => $active) {
$options[] = $this->getActiveString($active).$value;
}
return join(" ", $options);
... | [
"protected",
"function",
"getOptions",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"options",
")",
"{",
"$",
"this",
"->",
"options",
"=",
"$",
"this",
"->",
"default",
";",
"}",
"$",
"options",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"thi... | If not options has been defined, get default.
@return string | [
"If",
"not",
"options",
"has",
"been",
"defined",
"get",
"default",
"."
] | 8d7041c7caf1ad222a6090eaccb6ab738e5419ed | https://github.com/lepiaf/serialport/blob/8d7041c7caf1ad222a6090eaccb6ab738e5419ed/src/lepiaf/SerialPort/Configure/TTYConfigure.php#L74-L86 |
187,655 | lepiaf/serialport | src/lepiaf/SerialPort/SerialPort.php | SerialPort.open | public function open($device, $mode = "w+b")
{
if (false === file_exists($device)) {
throw new DeviceNotFound();
}
$this->getConfigure()->configure($device);
$this->fd = fopen($device, $mode);
if (false !== $this->fd) {
stream_set_blocking($this->fd,... | php | public function open($device, $mode = "w+b")
{
if (false === file_exists($device)) {
throw new DeviceNotFound();
}
$this->getConfigure()->configure($device);
$this->fd = fopen($device, $mode);
if (false !== $this->fd) {
stream_set_blocking($this->fd,... | [
"public",
"function",
"open",
"(",
"$",
"device",
",",
"$",
"mode",
"=",
"\"w+b\"",
")",
"{",
"if",
"(",
"false",
"===",
"file_exists",
"(",
"$",
"device",
")",
")",
"{",
"throw",
"new",
"DeviceNotFound",
"(",
")",
";",
"}",
"$",
"this",
"->",
"get... | Open serial connection
@param string $device path to device
@param string $mode fopen mode
@return bool
@throws DeviceNotAvailable|DeviceNotFound | [
"Open",
"serial",
"connection"
] | 8d7041c7caf1ad222a6090eaccb6ab738e5419ed | https://github.com/lepiaf/serialport/blob/8d7041c7caf1ad222a6090eaccb6ab738e5419ed/src/lepiaf/SerialPort/SerialPort.php#L60-L77 |
187,656 | lepiaf/serialport | src/lepiaf/SerialPort/SerialPort.php | SerialPort.write | public function write($data)
{
$this->ensureDeviceOpen();
if (false !== ($dataWritten = fwrite($this->fd, $data))) {
return $dataWritten;
}
throw new WriteNotAllowed();
} | php | public function write($data)
{
$this->ensureDeviceOpen();
if (false !== ($dataWritten = fwrite($this->fd, $data))) {
return $dataWritten;
}
throw new WriteNotAllowed();
} | [
"public",
"function",
"write",
"(",
"$",
"data",
")",
"{",
"$",
"this",
"->",
"ensureDeviceOpen",
"(",
")",
";",
"if",
"(",
"false",
"!==",
"(",
"$",
"dataWritten",
"=",
"fwrite",
"(",
"$",
"this",
"->",
"fd",
",",
"$",
"data",
")",
")",
")",
"{"... | Write data into serial port line
@param string $data
@return int length of byte written
@throws WriteNotAllowed|DeviceNotOpened | [
"Write",
"data",
"into",
"serial",
"port",
"line"
] | 8d7041c7caf1ad222a6090eaccb6ab738e5419ed | https://github.com/lepiaf/serialport/blob/8d7041c7caf1ad222a6090eaccb6ab738e5419ed/src/lepiaf/SerialPort/SerialPort.php#L88-L97 |
187,657 | lepiaf/serialport | src/lepiaf/SerialPort/SerialPort.php | SerialPort.read | public function read()
{
$this->ensureDeviceOpen();
$chars = [];
do {
$char = fread($this->fd, 1);
$chars[] = $char;
} while ($char != $this->getParser()->getSeparator());
return $this->getParser()->parse($chars);
} | php | public function read()
{
$this->ensureDeviceOpen();
$chars = [];
do {
$char = fread($this->fd, 1);
$chars[] = $char;
} while ($char != $this->getParser()->getSeparator());
return $this->getParser()->parse($chars);
} | [
"public",
"function",
"read",
"(",
")",
"{",
"$",
"this",
"->",
"ensureDeviceOpen",
"(",
")",
";",
"$",
"chars",
"=",
"[",
"]",
";",
"do",
"{",
"$",
"char",
"=",
"fread",
"(",
"$",
"this",
"->",
"fd",
",",
"1",
")",
";",
"$",
"chars",
"[",
"]... | Read data byte per byte until separator found
@return string | [
"Read",
"data",
"byte",
"per",
"byte",
"until",
"separator",
"found"
] | 8d7041c7caf1ad222a6090eaccb6ab738e5419ed | https://github.com/lepiaf/serialport/blob/8d7041c7caf1ad222a6090eaccb6ab738e5419ed/src/lepiaf/SerialPort/SerialPort.php#L104-L116 |
187,658 | loveorigami/yii2-modal-ajax | src/ModalAjax.php | ModalAjax.defaultSubmitEvent | protected function defaultSubmitEvent()
{
$expression = [];
if ($this->autoClose) {
$expression[] = "$(this).modal('toggle');";
}
if ($this->pjaxContainer) {
$expression[] = "$.pjax.reload({container : '$this->pjaxContainer', timeout : $this->pjaxTimeout });... | php | protected function defaultSubmitEvent()
{
$expression = [];
if ($this->autoClose) {
$expression[] = "$(this).modal('toggle');";
}
if ($this->pjaxContainer) {
$expression[] = "$.pjax.reload({container : '$this->pjaxContainer', timeout : $this->pjaxTimeout });... | [
"protected",
"function",
"defaultSubmitEvent",
"(",
")",
"{",
"$",
"expression",
"=",
"[",
"]",
";",
"if",
"(",
"$",
"this",
"->",
"autoClose",
")",
"{",
"$",
"expression",
"[",
"]",
"=",
"\"$(this).modal('toggle');\"",
";",
"}",
"if",
"(",
"$",
"this",
... | register pjax event | [
"register",
"pjax",
"event"
] | 27903f249e35e8db12f87fc263e9e9038f3561d2 | https://github.com/loveorigami/yii2-modal-ajax/blob/27903f249e35e8db12f87fc263e9e9038f3561d2/src/ModalAjax.php#L199-L220 |
187,659 | wepay/PHP-SDK | wepay.php | WePay.getAuthorizationUri | public static function getAuthorizationUri(array $scope, $redirect_uri, array $options = array())
{
// This does not use WePay::getDomain() because the user authentication
// domain is different than the API call domain
if (self::$production === null) {
throw new RuntimeException... | php | public static function getAuthorizationUri(array $scope, $redirect_uri, array $options = array())
{
// This does not use WePay::getDomain() because the user authentication
// domain is different than the API call domain
if (self::$production === null) {
throw new RuntimeException... | [
"public",
"static",
"function",
"getAuthorizationUri",
"(",
"array",
"$",
"scope",
",",
"$",
"redirect_uri",
",",
"array",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"// This does not use WePay::getDomain() because the user authentication",
"// domain is different ... | Generate URI used during oAuth authorization
Redirect your user to this URI where they can grant your application
permission to make API calls
@link https://www.wepay.com/developer/reference/oauth2
@param array $scope List of scope fields for which your application wants access.
@param string $redirect_uri ... | [
"Generate",
"URI",
"used",
"during",
"oAuth",
"authorization",
"Redirect",
"your",
"user",
"to",
"this",
"URI",
"where",
"they",
"can",
"grant",
"your",
"application",
"permission",
"to",
"make",
"API",
"calls"
] | 34810657b5fe8f3de95b0999a3f3e3202bd52e3f | https://github.com/wepay/PHP-SDK/blob/34810657b5fe8f3de95b0999a3f3e3202bd52e3f/wepay.php#L114-L135 |
187,660 | wepay/PHP-SDK | wepay.php | WePay.useProduction | public static function useProduction($client_id, $client_secret, $api_version = null)
{
if (self::$production !== null) {
throw new RuntimeException('API mode has already been set.');
}
self::$production = true;
self::$client_id = $client_id;
self::$client_... | php | public static function useProduction($client_id, $client_secret, $api_version = null)
{
if (self::$production !== null) {
throw new RuntimeException('API mode has already been set.');
}
self::$production = true;
self::$client_id = $client_id;
self::$client_... | [
"public",
"static",
"function",
"useProduction",
"(",
"$",
"client_id",
",",
"$",
"client_secret",
",",
"$",
"api_version",
"=",
"null",
")",
"{",
"if",
"(",
"self",
"::",
"$",
"production",
"!==",
"null",
")",
"{",
"throw",
"new",
"RuntimeException",
"(",... | Configure SDK to run against WePay's production servers
@param string $client_id Your application's client id
@param string $client_secret Your application's client secret
@return void
@throws RuntimeException | [
"Configure",
"SDK",
"to",
"run",
"against",
"WePay",
"s",
"production",
"servers"
] | 34810657b5fe8f3de95b0999a3f3e3202bd52e3f | https://github.com/wepay/PHP-SDK/blob/34810657b5fe8f3de95b0999a3f3e3202bd52e3f/wepay.php#L177-L186 |
187,661 | wepay/PHP-SDK | wepay.php | WePay.useStaging | public static function useStaging($client_id, $client_secret, $api_version = null)
{
if (self::$production !== null) {
throw new RuntimeException('API mode has already been set.');
}
self::$production = false;
self::$client_id = $client_id;
self::$client_se... | php | public static function useStaging($client_id, $client_secret, $api_version = null)
{
if (self::$production !== null) {
throw new RuntimeException('API mode has already been set.');
}
self::$production = false;
self::$client_id = $client_id;
self::$client_se... | [
"public",
"static",
"function",
"useStaging",
"(",
"$",
"client_id",
",",
"$",
"client_secret",
",",
"$",
"api_version",
"=",
"null",
")",
"{",
"if",
"(",
"self",
"::",
"$",
"production",
"!==",
"null",
")",
"{",
"throw",
"new",
"RuntimeException",
"(",
... | Configure SDK to run against WePay's staging servers
@param string $client_id Your application's client id
@param string $client_secret Your application's client secret
@return void
@throws RuntimeException | [
"Configure",
"SDK",
"to",
"run",
"against",
"WePay",
"s",
"staging",
"servers"
] | 34810657b5fe8f3de95b0999a3f3e3202bd52e3f | https://github.com/wepay/PHP-SDK/blob/34810657b5fe8f3de95b0999a3f3e3202bd52e3f/wepay.php#L195-L204 |
187,662 | wepay/PHP-SDK | wepay.php | WePay.make_request | private static function make_request($endpoint, $values, $headers = array())
{
self::$ch = curl_init();
$headers = array_merge(array("Content-Type: application/json"), $headers); // always pass the correct Content-Type header
// send Api Version header
if (!empty(self::$api_version)... | php | private static function make_request($endpoint, $values, $headers = array())
{
self::$ch = curl_init();
$headers = array_merge(array("Content-Type: application/json"), $headers); // always pass the correct Content-Type header
// send Api Version header
if (!empty(self::$api_version)... | [
"private",
"static",
"function",
"make_request",
"(",
"$",
"endpoint",
",",
"$",
"values",
",",
"$",
"headers",
"=",
"array",
"(",
")",
")",
"{",
"self",
"::",
"$",
"ch",
"=",
"curl_init",
"(",
")",
";",
"$",
"headers",
"=",
"array_merge",
"(",
"arra... | create the cURL request and execute it | [
"create",
"the",
"cURL",
"request",
"and",
"execute",
"it"
] | 34810657b5fe8f3de95b0999a3f3e3202bd52e3f | https://github.com/wepay/PHP-SDK/blob/34810657b5fe8f3de95b0999a3f3e3202bd52e3f/wepay.php#L258-L315 |
187,663 | wepay/PHP-SDK | wepay.php | WePay.request | public function request($endpoint, array $values = array(), $risk_token = null, $client_ip = null)
{
$headers = array();
if ($this->token) { // if we have an access_token, add it to the Authorization header
$headers[] = "Authorization: Bearer $this->token";
}
if ($risk_... | php | public function request($endpoint, array $values = array(), $risk_token = null, $client_ip = null)
{
$headers = array();
if ($this->token) { // if we have an access_token, add it to the Authorization header
$headers[] = "Authorization: Bearer $this->token";
}
if ($risk_... | [
"public",
"function",
"request",
"(",
"$",
"endpoint",
",",
"array",
"$",
"values",
"=",
"array",
"(",
")",
",",
"$",
"risk_token",
"=",
"null",
",",
"$",
"client_ip",
"=",
"null",
")",
"{",
"$",
"headers",
"=",
"array",
"(",
")",
";",
"if",
"(",
... | Make API calls against authenticated user
@param string $endpoint - API call to make (ex. 'user', 'account/find')
@param array $values - Associative array of values to send in API call
@param string $risk_token - WePay-supplied risk token associated with this API call
@param str... | [
"Make",
"API",
"calls",
"against",
"authenticated",
"user"
] | 34810657b5fe8f3de95b0999a3f3e3202bd52e3f | https://github.com/wepay/PHP-SDK/blob/34810657b5fe8f3de95b0999a3f3e3202bd52e3f/wepay.php#L327-L346 |
187,664 | yidas/yii2-bower-asset | installer.php | Installer.clone | public static function clone()
{
$bowerDir = 'vendor' . DIRECTORY_SEPARATOR . self::$sourceBower;
$bowerYiiDir = 'vendor' . DIRECTORY_SEPARATOR . self::$bowerVendor;
try {
self::deleteDir($bowerYiiDir);
self::copyDir($bowerDir, $bowerYiiDir);
echo "Cl... | php | public static function clone()
{
$bowerDir = 'vendor' . DIRECTORY_SEPARATOR . self::$sourceBower;
$bowerYiiDir = 'vendor' . DIRECTORY_SEPARATOR . self::$bowerVendor;
try {
self::deleteDir($bowerYiiDir);
self::copyDir($bowerDir, $bowerYiiDir);
echo "Cl... | [
"public",
"static",
"function",
"clone",
"(",
")",
"{",
"$",
"bowerDir",
"=",
"'vendor'",
".",
"DIRECTORY_SEPARATOR",
".",
"self",
"::",
"$",
"sourceBower",
";",
"$",
"bowerYiiDir",
"=",
"'vendor'",
".",
"DIRECTORY_SEPARATOR",
".",
"self",
"::",
"$",
"bowerV... | Install via cloning package to Bower vendor | [
"Install",
"via",
"cloning",
"package",
"to",
"Bower",
"vendor"
] | 32cb7946426a479826b3bf251f8187fb25e7ae8a | https://github.com/yidas/yii2-bower-asset/blob/32cb7946426a479826b3bf251f8187fb25e7ae8a/installer.php#L52-L70 |
187,665 | yidas/yii2-bower-asset | installer.php | Installer.setAlias | public static function setAlias()
{
$file = file_get_contents(self::$aliasFilePath);
$newAliasString = str_replace(
"'".self::$bowerVendor."'",
"'".self::$sourceBower."'",
self::$aliasBowerString
);
$file = str_replace(
... | php | public static function setAlias()
{
$file = file_get_contents(self::$aliasFilePath);
$newAliasString = str_replace(
"'".self::$bowerVendor."'",
"'".self::$sourceBower."'",
self::$aliasBowerString
);
$file = str_replace(
... | [
"public",
"static",
"function",
"setAlias",
"(",
")",
"{",
"$",
"file",
"=",
"file_get_contents",
"(",
"self",
"::",
"$",
"aliasFilePath",
")",
";",
"$",
"newAliasString",
"=",
"str_replace",
"(",
"\"'\"",
".",
"self",
"::",
"$",
"bowerVendor",
".",
"\"'\"... | Install via setting alias of Bower | [
"Install",
"via",
"setting",
"alias",
"of",
"Bower"
] | 32cb7946426a479826b3bf251f8187fb25e7ae8a | https://github.com/yidas/yii2-bower-asset/blob/32cb7946426a479826b3bf251f8187fb25e7ae8a/installer.php#L75-L97 |
187,666 | yidas/yii2-bower-asset | installer.php | Installer.unsetAlias | public static function unsetAlias()
{
$file = file_get_contents(self::$aliasFilePath);
$aliasString = str_replace(
"'".self::$bowerVendor."'",
"'".self::$sourceBower."'",
self::$aliasBowerString
);
$file = str_replace(
... | php | public static function unsetAlias()
{
$file = file_get_contents(self::$aliasFilePath);
$aliasString = str_replace(
"'".self::$bowerVendor."'",
"'".self::$sourceBower."'",
self::$aliasBowerString
);
$file = str_replace(
... | [
"public",
"static",
"function",
"unsetAlias",
"(",
")",
"{",
"$",
"file",
"=",
"file_get_contents",
"(",
"self",
"::",
"$",
"aliasFilePath",
")",
";",
"$",
"aliasString",
"=",
"str_replace",
"(",
"\"'\"",
".",
"self",
"::",
"$",
"bowerVendor",
".",
"\"'\""... | Uninstall via re-setting alias of Bower | [
"Uninstall",
"via",
"re",
"-",
"setting",
"alias",
"of",
"Bower"
] | 32cb7946426a479826b3bf251f8187fb25e7ae8a | https://github.com/yidas/yii2-bower-asset/blob/32cb7946426a479826b3bf251f8187fb25e7ae8a/installer.php#L102-L124 |
187,667 | Askedio/laravel-ratchet | src/RatchetWsServer.php | RatchetWsServer.onOpen | public function onOpen(ConnectionInterface $conn)
{
$this->conn = $conn;
$this->attach()->throttle()->limit();
} | php | public function onOpen(ConnectionInterface $conn)
{
$this->conn = $conn;
$this->attach()->throttle()->limit();
} | [
"public",
"function",
"onOpen",
"(",
"ConnectionInterface",
"$",
"conn",
")",
"{",
"$",
"this",
"->",
"conn",
"=",
"$",
"conn",
";",
"$",
"this",
"->",
"attach",
"(",
")",
"->",
"throttle",
"(",
")",
"->",
"limit",
"(",
")",
";",
"}"
] | Perform action on open.
@param ConnectionInterface $conn [description]
@return [type] [description] | [
"Perform",
"action",
"on",
"open",
"."
] | da94a1498b98fead79e78658af6218afef406fd8 | https://github.com/Askedio/laravel-ratchet/blob/da94a1498b98fead79e78658af6218afef406fd8/src/RatchetWsServer.php#L64-L69 |
187,668 | Askedio/laravel-ratchet | src/RatchetWsServer.php | RatchetWsServer.throttle | protected function throttle()
{
if ($this->isThrottled($this->conn, 'onOpen')) {
$this->console->info(sprintf('Connection throttled: %d', $this->conn->resourceId));
$this->conn->send(trans('ratchet::messages.tooManyConnectionAttempts'));
$this->throttled = true;
... | php | protected function throttle()
{
if ($this->isThrottled($this->conn, 'onOpen')) {
$this->console->info(sprintf('Connection throttled: %d', $this->conn->resourceId));
$this->conn->send(trans('ratchet::messages.tooManyConnectionAttempts'));
$this->throttled = true;
... | [
"protected",
"function",
"throttle",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isThrottled",
"(",
"$",
"this",
"->",
"conn",
",",
"'onOpen'",
")",
")",
"{",
"$",
"this",
"->",
"console",
"->",
"info",
"(",
"sprintf",
"(",
"'Connection throttled: %d'"... | Throttle connections.
@return [type] [description] | [
"Throttle",
"connections",
"."
] | da94a1498b98fead79e78658af6218afef406fd8 | https://github.com/Askedio/laravel-ratchet/blob/da94a1498b98fead79e78658af6218afef406fd8/src/RatchetWsServer.php#L87-L97 |
187,669 | Askedio/laravel-ratchet | src/RatchetWsServer.php | RatchetWsServer.limit | protected function limit()
{
if (($connectionLimit = config('ratchet.connectionLimit')) && $this->connections - 1 >= $connectionLimit) {
$this->console->info(sprintf('To many connections: %d of %d', $this->connections - 1, $connectionLimit));
$this->conn->send(trans('ratchet::message... | php | protected function limit()
{
if (($connectionLimit = config('ratchet.connectionLimit')) && $this->connections - 1 >= $connectionLimit) {
$this->console->info(sprintf('To many connections: %d of %d', $this->connections - 1, $connectionLimit));
$this->conn->send(trans('ratchet::message... | [
"protected",
"function",
"limit",
"(",
")",
"{",
"if",
"(",
"(",
"$",
"connectionLimit",
"=",
"config",
"(",
"'ratchet.connectionLimit'",
")",
")",
"&&",
"$",
"this",
"->",
"connections",
"-",
"1",
">=",
"$",
"connectionLimit",
")",
"{",
"$",
"this",
"->... | Limit connections.
@return [type] [description] | [
"Limit",
"connections",
"."
] | da94a1498b98fead79e78658af6218afef406fd8 | https://github.com/Askedio/laravel-ratchet/blob/da94a1498b98fead79e78658af6218afef406fd8/src/RatchetWsServer.php#L104-L113 |
187,670 | Askedio/laravel-ratchet | src/RatchetWsServer.php | RatchetWsServer.isThrottled | protected function isThrottled($conn, $setting)
{
$connectionThrottle = explode(':', config(sprintf('ratchet.throttle.%s', $setting)));
return !Throttle::attempt(
[
'ip' => $conn->remoteAddress,
'route' => $setting,
],
(int) $co... | php | protected function isThrottled($conn, $setting)
{
$connectionThrottle = explode(':', config(sprintf('ratchet.throttle.%s', $setting)));
return !Throttle::attempt(
[
'ip' => $conn->remoteAddress,
'route' => $setting,
],
(int) $co... | [
"protected",
"function",
"isThrottled",
"(",
"$",
"conn",
",",
"$",
"setting",
")",
"{",
"$",
"connectionThrottle",
"=",
"explode",
"(",
"':'",
",",
"config",
"(",
"sprintf",
"(",
"'ratchet.throttle.%s'",
",",
"$",
"setting",
")",
")",
")",
";",
"return",
... | Check if the called function is throttled.
@param [type] $conn [description]
@param [type] $setting [description]
@return bool [description] | [
"Check",
"if",
"the",
"called",
"function",
"is",
"throttled",
"."
] | da94a1498b98fead79e78658af6218afef406fd8 | https://github.com/Askedio/laravel-ratchet/blob/da94a1498b98fead79e78658af6218afef406fd8/src/RatchetWsServer.php#L123-L135 |
187,671 | Askedio/laravel-ratchet | src/RatchetWsServer.php | RatchetWsServer.onMessage | public function onMessage(ConnectionInterface $conn, $input)
{
$this->console->comment(sprintf('Message from %d: %s', $conn->resourceId, $input));
if ($this->isThrottled($conn, 'onMessage')) {
$this->console->info(sprintf('Message throttled: %d', $conn->resourceId));
$this->... | php | public function onMessage(ConnectionInterface $conn, $input)
{
$this->console->comment(sprintf('Message from %d: %s', $conn->resourceId, $input));
if ($this->isThrottled($conn, 'onMessage')) {
$this->console->info(sprintf('Message throttled: %d', $conn->resourceId));
$this->... | [
"public",
"function",
"onMessage",
"(",
"ConnectionInterface",
"$",
"conn",
",",
"$",
"input",
")",
"{",
"$",
"this",
"->",
"console",
"->",
"comment",
"(",
"sprintf",
"(",
"'Message from %d: %s'",
",",
"$",
"conn",
"->",
"resourceId",
",",
"$",
"input",
"... | Perform action on message.
@param ConnectionInterface $conn [description]
@param [type] $input [description]
@return [type] [description] | [
"Perform",
"action",
"on",
"message",
"."
] | da94a1498b98fead79e78658af6218afef406fd8 | https://github.com/Askedio/laravel-ratchet/blob/da94a1498b98fead79e78658af6218afef406fd8/src/RatchetWsServer.php#L145-L158 |
187,672 | Askedio/laravel-ratchet | src/RatchetWsServer.php | RatchetWsServer.onClose | public function onClose(ConnectionInterface $conn)
{
$this->clients->detach($conn);
$this->console->error(sprintf('Disconnected: %d', $conn->resourceId));
} | php | public function onClose(ConnectionInterface $conn)
{
$this->clients->detach($conn);
$this->console->error(sprintf('Disconnected: %d', $conn->resourceId));
} | [
"public",
"function",
"onClose",
"(",
"ConnectionInterface",
"$",
"conn",
")",
"{",
"$",
"this",
"->",
"clients",
"->",
"detach",
"(",
"$",
"conn",
")",
";",
"$",
"this",
"->",
"console",
"->",
"error",
"(",
"sprintf",
"(",
"'Disconnected: %d'",
",",
"$"... | Perform action on close.
@param ConnectionInterface $conn [description]
@return [type] [description] | [
"Perform",
"action",
"on",
"close",
"."
] | da94a1498b98fead79e78658af6218afef406fd8 | https://github.com/Askedio/laravel-ratchet/blob/da94a1498b98fead79e78658af6218afef406fd8/src/RatchetWsServer.php#L167-L171 |
187,673 | Askedio/laravel-ratchet | src/RatchetWsServer.php | RatchetWsServer.onError | public function onError(ConnectionInterface $conn, \Exception $exception)
{
$message = $exception->getMessage();
$conn->close();
$this->console->error(sprintf('Error: %s', $message));
} | php | public function onError(ConnectionInterface $conn, \Exception $exception)
{
$message = $exception->getMessage();
$conn->close();
$this->console->error(sprintf('Error: %s', $message));
} | [
"public",
"function",
"onError",
"(",
"ConnectionInterface",
"$",
"conn",
",",
"\\",
"Exception",
"$",
"exception",
")",
"{",
"$",
"message",
"=",
"$",
"exception",
"->",
"getMessage",
"(",
")",
";",
"$",
"conn",
"->",
"close",
"(",
")",
";",
"$",
"thi... | Perform action on error.
@param ConnectionInterface $conn [description]
@param Exception $exception [description]
@return [type] [description] | [
"Perform",
"action",
"on",
"error",
"."
] | da94a1498b98fead79e78658af6218afef406fd8 | https://github.com/Askedio/laravel-ratchet/blob/da94a1498b98fead79e78658af6218afef406fd8/src/RatchetWsServer.php#L181-L186 |
187,674 | Askedio/laravel-ratchet | src/Console/Commands/RatchetServerCommand.php | RatchetServerCommand.startServer | private function startServer($driver = null)
{
if (! $driver) {
$driver = $this->driver;
}
$this->info(sprintf('Starting %s server on: %s:%d', $this->option('driver'), $this->host, $this->port));
$this->createServerInstance();
$this->{'start'.$driver}()->run();... | php | private function startServer($driver = null)
{
if (! $driver) {
$driver = $this->driver;
}
$this->info(sprintf('Starting %s server on: %s:%d', $this->option('driver'), $this->host, $this->port));
$this->createServerInstance();
$this->{'start'.$driver}()->run();... | [
"private",
"function",
"startServer",
"(",
"$",
"driver",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"driver",
")",
"{",
"$",
"driver",
"=",
"$",
"this",
"->",
"driver",
";",
"}",
"$",
"this",
"->",
"info",
"(",
"sprintf",
"(",
"'Starting %s server ... | Start the appropriate server.
@param string $driver | [
"Start",
"the",
"appropriate",
"server",
"."
] | da94a1498b98fead79e78658af6218afef406fd8 | https://github.com/Askedio/laravel-ratchet/blob/da94a1498b98fead79e78658af6218afef406fd8/src/Console/Commands/RatchetServerCommand.php#L152-L163 |
187,675 | Askedio/laravel-ratchet | src/Console/Commands/RatchetServerCommand.php | RatchetServerCommand.bootWithBlacklist | private function bootWithBlacklist()
{
$this->serverInstance = new IpBlackList($this->serverInstance);
foreach (config('ratchet.blackList') as $host) {
$this->serverInstance->blockAddress($host);
}
} | php | private function bootWithBlacklist()
{
$this->serverInstance = new IpBlackList($this->serverInstance);
foreach (config('ratchet.blackList') as $host) {
$this->serverInstance->blockAddress($host);
}
} | [
"private",
"function",
"bootWithBlacklist",
"(",
")",
"{",
"$",
"this",
"->",
"serverInstance",
"=",
"new",
"IpBlackList",
"(",
"$",
"this",
"->",
"serverInstance",
")",
";",
"foreach",
"(",
"config",
"(",
"'ratchet.blackList'",
")",
"as",
"$",
"host",
")",
... | Decorate a server instance with a blacklist instance and block any blacklisted addresses. | [
"Decorate",
"a",
"server",
"instance",
"with",
"a",
"blacklist",
"instance",
"and",
"block",
"any",
"blacklisted",
"addresses",
"."
] | da94a1498b98fead79e78658af6218afef406fd8 | https://github.com/Askedio/laravel-ratchet/blob/da94a1498b98fead79e78658af6218afef406fd8/src/Console/Commands/RatchetServerCommand.php#L179-L186 |
187,676 | Askedio/laravel-ratchet | src/Console/Commands/RatchetServerCommand.php | RatchetServerCommand.bootWebSocketServer | private function bootWebSocketServer($withZmq = false)
{
if ($withZmq || $this->option('zmq')) {
$this->bootZmqConnection();
}
$this->wsServerInstance = new WsServer($this->serverInstance);
$this->serverInstance = new HttpServer(
$this->wsServerInstance
... | php | private function bootWebSocketServer($withZmq = false)
{
if ($withZmq || $this->option('zmq')) {
$this->bootZmqConnection();
}
$this->wsServerInstance = new WsServer($this->serverInstance);
$this->serverInstance = new HttpServer(
$this->wsServerInstance
... | [
"private",
"function",
"bootWebSocketServer",
"(",
"$",
"withZmq",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"withZmq",
"||",
"$",
"this",
"->",
"option",
"(",
"'zmq'",
")",
")",
"{",
"$",
"this",
"->",
"bootZmqConnection",
"(",
")",
";",
"}",
"$",
"th... | Decorate the server instance with a WebSocket server.
@param bool $withZmq
@return IoServer | [
"Decorate",
"the",
"server",
"instance",
"with",
"a",
"WebSocket",
"server",
"."
] | da94a1498b98fead79e78658af6218afef406fd8 | https://github.com/Askedio/laravel-ratchet/blob/da94a1498b98fead79e78658af6218afef406fd8/src/Console/Commands/RatchetServerCommand.php#L194-L211 |
187,677 | Askedio/laravel-ratchet | src/Console/Commands/RatchetServerCommand.php | RatchetServerCommand.startWampServer | private function startWampServer()
{
if (! $this->serverInstance instanceof RatchetWampServer) {
throw new \Exception("{$this->class} must be an instance of ".RatchetWampServer::class." to create a Wamp server");
}
// Decorate the server instance with a WampServer
$this-... | php | private function startWampServer()
{
if (! $this->serverInstance instanceof RatchetWampServer) {
throw new \Exception("{$this->class} must be an instance of ".RatchetWampServer::class." to create a Wamp server");
}
// Decorate the server instance with a WampServer
$this-... | [
"private",
"function",
"startWampServer",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"serverInstance",
"instanceof",
"RatchetWampServer",
")",
"{",
"throw",
"new",
"\\",
"Exception",
"(",
"\"{$this->class} must be an instance of \"",
".",
"RatchetWampServer",
... | Deploy a WampServer
@return IoServer | [
"Deploy",
"a",
"WampServer"
] | da94a1498b98fead79e78658af6218afef406fd8 | https://github.com/Askedio/laravel-ratchet/blob/da94a1498b98fead79e78658af6218afef406fd8/src/Console/Commands/RatchetServerCommand.php#L218-L228 |
187,678 | Askedio/laravel-ratchet | src/Console/Commands/RatchetServerCommand.php | RatchetServerCommand.startWsServer | private function startWsServer()
{
if (! $this->serverInstance instanceof RatchetWsServer) {
throw new \Exception("{$this->class} must be an instance of ".RatchetWsServer::class." to create a WebSocket server");
}
$this->bootWithBlacklist();
return $this->bootWebSocketS... | php | private function startWsServer()
{
if (! $this->serverInstance instanceof RatchetWsServer) {
throw new \Exception("{$this->class} must be an instance of ".RatchetWsServer::class." to create a WebSocket server");
}
$this->bootWithBlacklist();
return $this->bootWebSocketS... | [
"private",
"function",
"startWsServer",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"serverInstance",
"instanceof",
"RatchetWsServer",
")",
"{",
"throw",
"new",
"\\",
"Exception",
"(",
"\"{$this->class} must be an instance of \"",
".",
"RatchetWsServer",
"::",... | Deploy a WsServer.
@return IoServer | [
"Deploy",
"a",
"WsServer",
"."
] | da94a1498b98fead79e78658af6218afef406fd8 | https://github.com/Askedio/laravel-ratchet/blob/da94a1498b98fead79e78658af6218afef406fd8/src/Console/Commands/RatchetServerCommand.php#L235-L244 |
187,679 | Askedio/laravel-ratchet | src/Console/Commands/RatchetServerCommand.php | RatchetServerCommand.bootIoServer | private function bootIoServer()
{
$context = [
'tls' => $this->tls,
];
$socket = new SocketServer($this->host.':'.$this->port, $this->getEventLoop(), $context);
return new IoServer(
$this->serverInstance,
$socket,
$this->getEventLoop()... | php | private function bootIoServer()
{
$context = [
'tls' => $this->tls,
];
$socket = new SocketServer($this->host.':'.$this->port, $this->getEventLoop(), $context);
return new IoServer(
$this->serverInstance,
$socket,
$this->getEventLoop()... | [
"private",
"function",
"bootIoServer",
"(",
")",
"{",
"$",
"context",
"=",
"[",
"'tls'",
"=>",
"$",
"this",
"->",
"tls",
",",
"]",
";",
"$",
"socket",
"=",
"new",
"SocketServer",
"(",
"$",
"this",
"->",
"host",
".",
"':'",
".",
"$",
"this",
"->",
... | Create the IoServer instance to encapsulate our server in.
@return IoServer | [
"Create",
"the",
"IoServer",
"instance",
"to",
"encapsulate",
"our",
"server",
"in",
"."
] | da94a1498b98fead79e78658af6218afef406fd8 | https://github.com/Askedio/laravel-ratchet/blob/da94a1498b98fead79e78658af6218afef406fd8/src/Console/Commands/RatchetServerCommand.php#L263-L275 |
187,680 | Askedio/laravel-ratchet | src/Console/Commands/RatchetServerCommand.php | RatchetServerCommand.bootZmqConnection | private function bootZmqConnection()
{
$this->info(sprintf('Starting ZMQ listener on: %s:%s', config('ratchet.zmq.host'), config('ratchet.zmq.port')));
$context = new ZMQContext($this->getEventLoop());
$socket = $context->getSocket(config('ratchet.zmq.method', \ZMQ::SOCKET_PULL));
$... | php | private function bootZmqConnection()
{
$this->info(sprintf('Starting ZMQ listener on: %s:%s', config('ratchet.zmq.host'), config('ratchet.zmq.port')));
$context = new ZMQContext($this->getEventLoop());
$socket = $context->getSocket(config('ratchet.zmq.method', \ZMQ::SOCKET_PULL));
$... | [
"private",
"function",
"bootZmqConnection",
"(",
")",
"{",
"$",
"this",
"->",
"info",
"(",
"sprintf",
"(",
"'Starting ZMQ listener on: %s:%s'",
",",
"config",
"(",
"'ratchet.zmq.host'",
")",
",",
"config",
"(",
"'ratchet.zmq.port'",
")",
")",
")",
";",
"$",
"c... | Boot a ZMQ listener and let the Ratchet server handle its events. | [
"Boot",
"a",
"ZMQ",
"listener",
"and",
"let",
"the",
"Ratchet",
"server",
"handle",
"its",
"events",
"."
] | da94a1498b98fead79e78658af6218afef406fd8 | https://github.com/Askedio/laravel-ratchet/blob/da94a1498b98fead79e78658af6218afef406fd8/src/Console/Commands/RatchetServerCommand.php#L280-L295 |
187,681 | Askedio/laravel-ratchet | src/Console/Commands/RatchetServerCommand.php | RatchetServerCommand.getEventLoop | private function getEventLoop()
{
if (! $this->eventLoop instanceof LoopInterface) {
$this->eventLoop = EventLoop::create();
}
return $this->eventLoop;
} | php | private function getEventLoop()
{
if (! $this->eventLoop instanceof LoopInterface) {
$this->eventLoop = EventLoop::create();
}
return $this->eventLoop;
} | [
"private",
"function",
"getEventLoop",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"eventLoop",
"instanceof",
"LoopInterface",
")",
"{",
"$",
"this",
"->",
"eventLoop",
"=",
"EventLoop",
"::",
"create",
"(",
")",
";",
"}",
"return",
"$",
"this",
... | Generate and return a React EventLoop object.
@return LoopInterface | [
"Generate",
"and",
"return",
"a",
"React",
"EventLoop",
"object",
"."
] | da94a1498b98fead79e78658af6218afef406fd8 | https://github.com/Askedio/laravel-ratchet/blob/da94a1498b98fead79e78658af6218afef406fd8/src/Console/Commands/RatchetServerCommand.php#L302-L309 |
187,682 | Askedio/laravel-ratchet | src/RatchetWampServer.php | RatchetWampServer.onSubscribe | public function onSubscribe(ConnectionInterface $conn, $topic)
{
$this->console->info("onSubscribe: {$conn->WAMP->sessionId} topic: $topic {$topic->count()}");
if (!array_key_exists($topic->getId(), $this->subscribedTopics)) {
$this->subscribedTopics[$topic->getId()] = $topic;
... | php | public function onSubscribe(ConnectionInterface $conn, $topic)
{
$this->console->info("onSubscribe: {$conn->WAMP->sessionId} topic: $topic {$topic->count()}");
if (!array_key_exists($topic->getId(), $this->subscribedTopics)) {
$this->subscribedTopics[$topic->getId()] = $topic;
... | [
"public",
"function",
"onSubscribe",
"(",
"ConnectionInterface",
"$",
"conn",
",",
"$",
"topic",
")",
"{",
"$",
"this",
"->",
"console",
"->",
"info",
"(",
"\"onSubscribe: {$conn->WAMP->sessionId} topic: $topic {$topic->count()}\"",
")",
";",
"if",
"(",
"!",
"array_... | A request to subscribe to a topic has been made.
@param \Ratchet\ConnectionInterface $conn
@param string|Topic $topic The topic to subscribe to | [
"A",
"request",
"to",
"subscribe",
"to",
"a",
"topic",
"has",
"been",
"made",
"."
] | da94a1498b98fead79e78658af6218afef406fd8 | https://github.com/Askedio/laravel-ratchet/blob/da94a1498b98fead79e78658af6218afef406fd8/src/RatchetWampServer.php#L41-L49 |
187,683 | Askedio/laravel-ratchet | src/RatchetWampServer.php | RatchetWampServer.onCall | public function onCall(ConnectionInterface $conn, $id, $topic, array $params)
{
$this->console->info('onCall');
$conn->callError($id, $topic, 'You are not allowed to make calls')->close();
} | php | public function onCall(ConnectionInterface $conn, $id, $topic, array $params)
{
$this->console->info('onCall');
$conn->callError($id, $topic, 'You are not allowed to make calls')->close();
} | [
"public",
"function",
"onCall",
"(",
"ConnectionInterface",
"$",
"conn",
",",
"$",
"id",
",",
"$",
"topic",
",",
"array",
"$",
"params",
")",
"{",
"$",
"this",
"->",
"console",
"->",
"info",
"(",
"'onCall'",
")",
";",
"$",
"conn",
"->",
"callError",
... | An RPC call has been received.
@param \Ratchet\ConnectionInterface $conn
@param string $id The unique ID of the RPC, required to respond to
@param string|Topic $topic The topic to execute the call against
@param array $params Call parameters received fr... | [
"An",
"RPC",
"call",
"has",
"been",
"received",
"."
] | da94a1498b98fead79e78658af6218afef406fd8 | https://github.com/Askedio/laravel-ratchet/blob/da94a1498b98fead79e78658af6218afef406fd8/src/RatchetWampServer.php#L94-L98 |
187,684 | Askedio/laravel-ratchet | src/RatchetWampServer.php | RatchetWampServer.onPublish | public function onPublish(ConnectionInterface $conn, $topic, $event, array $exclude, array $eligible)
{
$this->console->info('onPublish');
} | php | public function onPublish(ConnectionInterface $conn, $topic, $event, array $exclude, array $eligible)
{
$this->console->info('onPublish');
} | [
"public",
"function",
"onPublish",
"(",
"ConnectionInterface",
"$",
"conn",
",",
"$",
"topic",
",",
"$",
"event",
",",
"array",
"$",
"exclude",
",",
"array",
"$",
"eligible",
")",
"{",
"$",
"this",
"->",
"console",
"->",
"info",
"(",
"'onPublish'",
")",
... | A client is attempting to publish content to a subscribed connections on a URI.
@param \Ratchet\ConnectionInterface $conn
@param string|Topic $topic The topic the user has attempted to publish to
@param string $event Payload of the publish
@param array ... | [
"A",
"client",
"is",
"attempting",
"to",
"publish",
"content",
"to",
"a",
"subscribed",
"connections",
"on",
"a",
"URI",
"."
] | da94a1498b98fead79e78658af6218afef406fd8 | https://github.com/Askedio/laravel-ratchet/blob/da94a1498b98fead79e78658af6218afef406fd8/src/RatchetWampServer.php#L109-L112 |
187,685 | Askedio/laravel-ratchet | src/RatchetWampServer.php | RatchetWampServer.onError | public function onError(ConnectionInterface $conn, \Exception $e)
{
$this->console->info('onError'.$e->getMessage());
} | php | public function onError(ConnectionInterface $conn, \Exception $e)
{
$this->console->info('onError'.$e->getMessage());
} | [
"public",
"function",
"onError",
"(",
"ConnectionInterface",
"$",
"conn",
",",
"\\",
"Exception",
"$",
"e",
")",
"{",
"$",
"this",
"->",
"console",
"->",
"info",
"(",
"'onError'",
".",
"$",
"e",
"->",
"getMessage",
"(",
")",
")",
";",
"}"
] | If there is an error with one of the sockets, or somewhere in the application where an Exception is thrown,
the Exception is sent back down the stack, handled by the Server and bubbled back up the application through this method.
@param ConnectionInterface $conn
@param \Exception $e
@throws \Exception | [
"If",
"there",
"is",
"an",
"error",
"with",
"one",
"of",
"the",
"sockets",
"or",
"somewhere",
"in",
"the",
"application",
"where",
"an",
"Exception",
"is",
"thrown",
"the",
"Exception",
"is",
"sent",
"back",
"down",
"the",
"stack",
"handled",
"by",
"the",
... | da94a1498b98fead79e78658af6218afef406fd8 | https://github.com/Askedio/laravel-ratchet/blob/da94a1498b98fead79e78658af6218afef406fd8/src/RatchetWampServer.php#L123-L126 |
187,686 | Stolz/Assets | src/Laravel/ServiceProvider.php | ServiceProvider.registerAssetsManagerInstance | protected function registerAssetsManagerInstance($name, array $config)
{
$this->app->singleton("stolz.assets.group.$name", function ($app) use ($config) {
if( ! isset($config['public_dir']))
$config['public_dir'] = public_path();
return new Assets($config);
});
} | php | protected function registerAssetsManagerInstance($name, array $config)
{
$this->app->singleton("stolz.assets.group.$name", function ($app) use ($config) {
if( ! isset($config['public_dir']))
$config['public_dir'] = public_path();
return new Assets($config);
});
} | [
"protected",
"function",
"registerAssetsManagerInstance",
"(",
"$",
"name",
",",
"array",
"$",
"config",
")",
"{",
"$",
"this",
"->",
"app",
"->",
"singleton",
"(",
"\"stolz.assets.group.$name\"",
",",
"function",
"(",
"$",
"app",
")",
"use",
"(",
"$",
"conf... | Register an instance of the assets manager library in the IoC container.
@param string $name Name of the group
@param array $config Config of the group
@return void | [
"Register",
"an",
"instance",
"of",
"the",
"assets",
"manager",
"library",
"in",
"the",
"IoC",
"container",
"."
] | dd97a3e6d8287e6d674532d24ae8900f7fa23537 | https://github.com/Stolz/Assets/blob/dd97a3e6d8287e6d674532d24ae8900f7fa23537/src/Laravel/ServiceProvider.php#L63-L72 |
187,687 | Stolz/Assets | src/Laravel/FlushPipelineCommand.php | FlushPipelineCommand.getPipelineDirectories | protected function getPipelineDirectories()
{
// Parse configured groups
$config = $this->config->get('assets', []);
$groups = (isset($config['default'])) ? $config : ['default' => $config];
if( ! is_null($group = $this->option('group')))
$groups = array_only($groups, $group);
// Parse pipeline directori... | php | protected function getPipelineDirectories()
{
// Parse configured groups
$config = $this->config->get('assets', []);
$groups = (isset($config['default'])) ? $config : ['default' => $config];
if( ! is_null($group = $this->option('group')))
$groups = array_only($groups, $group);
// Parse pipeline directori... | [
"protected",
"function",
"getPipelineDirectories",
"(",
")",
"{",
"// Parse configured groups",
"$",
"config",
"=",
"$",
"this",
"->",
"config",
"->",
"get",
"(",
"'assets'",
",",
"[",
"]",
")",
";",
"$",
"groups",
"=",
"(",
"isset",
"(",
"$",
"config",
... | Get the pipeline directories of the groups.
@return array | [
"Get",
"the",
"pipeline",
"directories",
"of",
"the",
"groups",
"."
] | dd97a3e6d8287e6d674532d24ae8900f7fa23537 | https://github.com/Stolz/Assets/blob/dd97a3e6d8287e6d674532d24ae8900f7fa23537/src/Laravel/FlushPipelineCommand.php#L88-L116 |
187,688 | Stolz/Assets | src/Laravel/FlushPipelineCommand.php | FlushPipelineCommand.purgeDir | protected function purgeDir($directory)
{
if( ! $this->filesystem->isDirectory($directory))
return true;
if($this->filesystem->isWritable($directory))
return $this->filesystem->cleanDirectory($directory);
$this->error($directory . ' is not writable');
return false;
} | php | protected function purgeDir($directory)
{
if( ! $this->filesystem->isDirectory($directory))
return true;
if($this->filesystem->isWritable($directory))
return $this->filesystem->cleanDirectory($directory);
$this->error($directory . ' is not writable');
return false;
} | [
"protected",
"function",
"purgeDir",
"(",
"$",
"directory",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"filesystem",
"->",
"isDirectory",
"(",
"$",
"directory",
")",
")",
"return",
"true",
";",
"if",
"(",
"$",
"this",
"->",
"filesystem",
"->",
"isWri... | Remove the contents of a given directory.
@param string $directory
@return boolean | [
"Remove",
"the",
"contents",
"of",
"a",
"given",
"directory",
"."
] | dd97a3e6d8287e6d674532d24ae8900f7fa23537 | https://github.com/Stolz/Assets/blob/dd97a3e6d8287e6d674532d24ae8900f7fa23537/src/Laravel/FlushPipelineCommand.php#L125-L136 |
187,689 | Stolz/Assets | src/Manager.php | Manager.prepend | public function prepend($asset)
{
// More than one asset
if(is_array($asset))
{
foreach(array_reverse($asset) as $a)
$this->prepend($a);
}
// Collection
elseif(isset($this->collections[$asset]))
$this->prepend($this->collections[$asset]);
// JavaScript asset
elseif(preg_match($this->js_rege... | php | public function prepend($asset)
{
// More than one asset
if(is_array($asset))
{
foreach(array_reverse($asset) as $a)
$this->prepend($a);
}
// Collection
elseif(isset($this->collections[$asset]))
$this->prepend($this->collections[$asset]);
// JavaScript asset
elseif(preg_match($this->js_rege... | [
"public",
"function",
"prepend",
"(",
"$",
"asset",
")",
"{",
"// More than one asset",
"if",
"(",
"is_array",
"(",
"$",
"asset",
")",
")",
"{",
"foreach",
"(",
"array_reverse",
"(",
"$",
"asset",
")",
"as",
"$",
"a",
")",
"$",
"this",
"->",
"prepend",... | Add an asset or a collection of assets to the beginning of the queue.
It automatically detects the asset type (JavaScript, CSS or collection).
You may prepend more than one asset passing an array as argument.
@param mixed $asset
@return Manager | [
"Add",
"an",
"asset",
"or",
"a",
"collection",
"of",
"assets",
"to",
"the",
"beginning",
"of",
"the",
"queue",
"."
] | dd97a3e6d8287e6d674532d24ae8900f7fa23537 | https://github.com/Stolz/Assets/blob/dd97a3e6d8287e6d674532d24ae8900f7fa23537/src/Manager.php#L267-L289 |
187,690 | Stolz/Assets | src/Manager.php | Manager.addCss | public function addCss($asset)
{
if(is_array($asset))
{
foreach($asset as $a)
$this->addCss($a);
return $this;
}
if( ! $this->isRemoteLink($asset))
$asset = $this->buildLocalLink($asset, $this->css_dir);
if( ! in_array($asset, $this->css))
$this->css[] = $asset;
return $this;
} | php | public function addCss($asset)
{
if(is_array($asset))
{
foreach($asset as $a)
$this->addCss($a);
return $this;
}
if( ! $this->isRemoteLink($asset))
$asset = $this->buildLocalLink($asset, $this->css_dir);
if( ! in_array($asset, $this->css))
$this->css[] = $asset;
return $this;
} | [
"public",
"function",
"addCss",
"(",
"$",
"asset",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"asset",
")",
")",
"{",
"foreach",
"(",
"$",
"asset",
"as",
"$",
"a",
")",
"$",
"this",
"->",
"addCss",
"(",
"$",
"a",
")",
";",
"return",
"$",
"this"... | Add a CSS asset.
It checks for duplicates.
You may add more than one asset passing an array as argument.
@param mixed $asset
@return Manager | [
"Add",
"a",
"CSS",
"asset",
"."
] | dd97a3e6d8287e6d674532d24ae8900f7fa23537 | https://github.com/Stolz/Assets/blob/dd97a3e6d8287e6d674532d24ae8900f7fa23537/src/Manager.php#L300-L317 |
187,691 | Stolz/Assets | src/Manager.php | Manager.prependCss | public function prependCss($asset)
{
if(is_array($asset))
{
foreach(array_reverse($asset) as $a)
$this->prependCss($a);
return $this;
}
if( ! $this->isRemoteLink($asset))
$asset = $this->buildLocalLink($asset, $this->css_dir);
if( ! in_array($asset, $this->css))
array_unshift($this->css, $... | php | public function prependCss($asset)
{
if(is_array($asset))
{
foreach(array_reverse($asset) as $a)
$this->prependCss($a);
return $this;
}
if( ! $this->isRemoteLink($asset))
$asset = $this->buildLocalLink($asset, $this->css_dir);
if( ! in_array($asset, $this->css))
array_unshift($this->css, $... | [
"public",
"function",
"prependCss",
"(",
"$",
"asset",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"asset",
")",
")",
"{",
"foreach",
"(",
"array_reverse",
"(",
"$",
"asset",
")",
"as",
"$",
"a",
")",
"$",
"this",
"->",
"prependCss",
"(",
"$",
"a",
... | Add a CSS asset to the beginning of the queue.
It checks for duplicates.
You may prepend more than one asset passing an array as argument.
@param mixed $asset
@return Manager | [
"Add",
"a",
"CSS",
"asset",
"to",
"the",
"beginning",
"of",
"the",
"queue",
"."
] | dd97a3e6d8287e6d674532d24ae8900f7fa23537 | https://github.com/Stolz/Assets/blob/dd97a3e6d8287e6d674532d24ae8900f7fa23537/src/Manager.php#L328-L345 |
187,692 | Stolz/Assets | src/Manager.php | Manager.addJs | public function addJs($asset)
{
if(is_array($asset))
{
foreach($asset as $a)
$this->addJs($a);
return $this;
}
if( ! $this->isRemoteLink($asset))
$asset = $this->buildLocalLink($asset, $this->js_dir);
if( ! in_array($asset, $this->js))
$this->js[] = $asset;
return $this;
} | php | public function addJs($asset)
{
if(is_array($asset))
{
foreach($asset as $a)
$this->addJs($a);
return $this;
}
if( ! $this->isRemoteLink($asset))
$asset = $this->buildLocalLink($asset, $this->js_dir);
if( ! in_array($asset, $this->js))
$this->js[] = $asset;
return $this;
} | [
"public",
"function",
"addJs",
"(",
"$",
"asset",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"asset",
")",
")",
"{",
"foreach",
"(",
"$",
"asset",
"as",
"$",
"a",
")",
"$",
"this",
"->",
"addJs",
"(",
"$",
"a",
")",
";",
"return",
"$",
"this",
... | Add a JavaScript asset.
It checks for duplicates.
You may add more than one asset passing an array as argument.
@param mixed $asset
@return Manager | [
"Add",
"a",
"JavaScript",
"asset",
"."
] | dd97a3e6d8287e6d674532d24ae8900f7fa23537 | https://github.com/Stolz/Assets/blob/dd97a3e6d8287e6d674532d24ae8900f7fa23537/src/Manager.php#L356-L373 |
187,693 | Stolz/Assets | src/Manager.php | Manager.prependJs | public function prependJs($asset)
{
if(is_array($asset))
{
foreach(array_reverse($asset) as $a)
$this->prependJs($a);
return $this;
}
if( ! $this->isRemoteLink($asset))
$asset = $this->buildLocalLink($asset, $this->js_dir);
if( ! in_array($asset, $this->js))
array_unshift($this->js, $asset... | php | public function prependJs($asset)
{
if(is_array($asset))
{
foreach(array_reverse($asset) as $a)
$this->prependJs($a);
return $this;
}
if( ! $this->isRemoteLink($asset))
$asset = $this->buildLocalLink($asset, $this->js_dir);
if( ! in_array($asset, $this->js))
array_unshift($this->js, $asset... | [
"public",
"function",
"prependJs",
"(",
"$",
"asset",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"asset",
")",
")",
"{",
"foreach",
"(",
"array_reverse",
"(",
"$",
"asset",
")",
"as",
"$",
"a",
")",
"$",
"this",
"->",
"prependJs",
"(",
"$",
"a",
... | Add a JavaScript asset to the beginning of the queue.
It checks for duplicates.
You may prepend more than one asset passing an array as argument.
@param mixed $asset
@return Manager | [
"Add",
"a",
"JavaScript",
"asset",
"to",
"the",
"beginning",
"of",
"the",
"queue",
"."
] | dd97a3e6d8287e6d674532d24ae8900f7fa23537 | https://github.com/Stolz/Assets/blob/dd97a3e6d8287e6d674532d24ae8900f7fa23537/src/Manager.php#L384-L401 |
187,694 | Stolz/Assets | src/Manager.php | Manager.cssPipeline | protected function cssPipeline()
{
// If a custom minifier has been set use it, otherwise fallback to default
$minifier = (isset($this->css_minifier)) ? $this->css_minifier : function ($buffer) {
$min = new \CSSmin();
return $min->run($buffer);
};
return $this->pipeline($this->css, '.css', $this->css_di... | php | protected function cssPipeline()
{
// If a custom minifier has been set use it, otherwise fallback to default
$minifier = (isset($this->css_minifier)) ? $this->css_minifier : function ($buffer) {
$min = new \CSSmin();
return $min->run($buffer);
};
return $this->pipeline($this->css, '.css', $this->css_di... | [
"protected",
"function",
"cssPipeline",
"(",
")",
"{",
"// If a custom minifier has been set use it, otherwise fallback to default",
"$",
"minifier",
"=",
"(",
"isset",
"(",
"$",
"this",
"->",
"css_minifier",
")",
")",
"?",
"$",
"this",
"->",
"css_minifier",
":",
"f... | Minifiy and concatenate CSS files.
@return string | [
"Minifiy",
"and",
"concatenate",
"CSS",
"files",
"."
] | dd97a3e6d8287e6d674532d24ae8900f7fa23537 | https://github.com/Stolz/Assets/blob/dd97a3e6d8287e6d674532d24ae8900f7fa23537/src/Manager.php#L533-L542 |
187,695 | Stolz/Assets | src/Manager.php | Manager.jsPipeline | protected function jsPipeline()
{
// If a custom minifier has been set use it, otherwise fallback to default
$minifier = (isset($this->js_minifier)) ? $this->js_minifier : function ($buffer) {
return \JSMin::minify($buffer);
};
return $this->pipeline($this->js, '.js', $this->js_dir, $minifier);
} | php | protected function jsPipeline()
{
// If a custom minifier has been set use it, otherwise fallback to default
$minifier = (isset($this->js_minifier)) ? $this->js_minifier : function ($buffer) {
return \JSMin::minify($buffer);
};
return $this->pipeline($this->js, '.js', $this->js_dir, $minifier);
} | [
"protected",
"function",
"jsPipeline",
"(",
")",
"{",
"// If a custom minifier has been set use it, otherwise fallback to default",
"$",
"minifier",
"=",
"(",
"isset",
"(",
"$",
"this",
"->",
"js_minifier",
")",
")",
"?",
"$",
"this",
"->",
"js_minifier",
":",
"func... | Minifiy and concatenate JavaScript files.
@return string | [
"Minifiy",
"and",
"concatenate",
"JavaScript",
"files",
"."
] | dd97a3e6d8287e6d674532d24ae8900f7fa23537 | https://github.com/Stolz/Assets/blob/dd97a3e6d8287e6d674532d24ae8900f7fa23537/src/Manager.php#L549-L557 |
187,696 | Stolz/Assets | src/Manager.php | Manager.pipeline | protected function pipeline(array $assets, $extension, $subdirectory, Closure $minifier)
{
// Create destination dir if it doesn't exist.
$pipeline_dir = $this->public_dir . DIRECTORY_SEPARATOR . $subdirectory . DIRECTORY_SEPARATOR . $this->pipeline_dir;
if( ! is_dir($pipeline_dir))
mkdir($pipeline_dir, 0777,... | php | protected function pipeline(array $assets, $extension, $subdirectory, Closure $minifier)
{
// Create destination dir if it doesn't exist.
$pipeline_dir = $this->public_dir . DIRECTORY_SEPARATOR . $subdirectory . DIRECTORY_SEPARATOR . $this->pipeline_dir;
if( ! is_dir($pipeline_dir))
mkdir($pipeline_dir, 0777,... | [
"protected",
"function",
"pipeline",
"(",
"array",
"$",
"assets",
",",
"$",
"extension",
",",
"$",
"subdirectory",
",",
"Closure",
"$",
"minifier",
")",
"{",
"// Create destination dir if it doesn't exist.",
"$",
"pipeline_dir",
"=",
"$",
"this",
"->",
"public_dir... | Minifiy and concatenate files.
@param array $assets
@param string $extension
@param string $subdirectory
@param Closure $minifier
@return string | [
"Minifiy",
"and",
"concatenate",
"files",
"."
] | dd97a3e6d8287e6d674532d24ae8900f7fa23537 | https://github.com/Stolz/Assets/blob/dd97a3e6d8287e6d674532d24ae8900f7fa23537/src/Manager.php#L568-L602 |
187,697 | Stolz/Assets | src/Manager.php | Manager.calculatePipelineHash | protected function calculatePipelineHash(array $assets)
{
$salt = $this->pipeline;
// Pipeline disabled. Do not salt hash
if( ! $salt)
return md5(implode($assets));
// Custom salt
if($salt !== 'auto')
return md5(implode($assets) . $salt);
// Automatic salt based on the last modification time of th... | php | protected function calculatePipelineHash(array $assets)
{
$salt = $this->pipeline;
// Pipeline disabled. Do not salt hash
if( ! $salt)
return md5(implode($assets));
// Custom salt
if($salt !== 'auto')
return md5(implode($assets) . $salt);
// Automatic salt based on the last modification time of th... | [
"protected",
"function",
"calculatePipelineHash",
"(",
"array",
"$",
"assets",
")",
"{",
"$",
"salt",
"=",
"$",
"this",
"->",
"pipeline",
";",
"// Pipeline disabled. Do not salt hash",
"if",
"(",
"!",
"$",
"salt",
")",
"return",
"md5",
"(",
"implode",
"(",
"... | Calculate the pipeline hash.
@param array $assets
@return string | [
"Calculate",
"the",
"pipeline",
"hash",
"."
] | dd97a3e6d8287e6d674532d24ae8900f7fa23537 | https://github.com/Stolz/Assets/blob/dd97a3e6d8287e6d674532d24ae8900f7fa23537/src/Manager.php#L610-L637 |
187,698 | Stolz/Assets | src/Manager.php | Manager.packLinks | protected function packLinks(array $links, Closure $minifier)
{
$buffer = '';
foreach($links as $link)
{
$originalLink = $link;
// Get real link path
if($this->isRemoteLink($link))
{
// Add current protocol to agnostic links
if('//' === substr($link, 0, 2))
{
$protocol = (isset($_SE... | php | protected function packLinks(array $links, Closure $minifier)
{
$buffer = '';
foreach($links as $link)
{
$originalLink = $link;
// Get real link path
if($this->isRemoteLink($link))
{
// Add current protocol to agnostic links
if('//' === substr($link, 0, 2))
{
$protocol = (isset($_SE... | [
"protected",
"function",
"packLinks",
"(",
"array",
"$",
"links",
",",
"Closure",
"$",
"minifier",
")",
"{",
"$",
"buffer",
"=",
"''",
";",
"foreach",
"(",
"$",
"links",
"as",
"$",
"link",
")",
"{",
"$",
"originalLink",
"=",
"$",
"link",
";",
"// Get... | Download, concatenate and minifiy the content of several links.
@param array $links
@param Closure $minifier
@return string | [
"Download",
"concatenate",
"and",
"minifiy",
"the",
"content",
"of",
"several",
"links",
"."
] | dd97a3e6d8287e6d674532d24ae8900f7fa23537 | https://github.com/Stolz/Assets/blob/dd97a3e6d8287e6d674532d24ae8900f7fa23537/src/Manager.php#L646-L681 |
187,699 | Stolz/Assets | src/Laravel/LegacyFlushPipelineCommand.php | LegacyFlushPipelineCommand.purgeDir | protected function purgeDir($directory)
{
if( ! File::isDirectory($directory))
return true;
if(File::isWritable($directory))
return File::cleanDirectory($directory);
$this->error($directory . ' is not writable');
return false;
} | php | protected function purgeDir($directory)
{
if( ! File::isDirectory($directory))
return true;
if(File::isWritable($directory))
return File::cleanDirectory($directory);
$this->error($directory . ' is not writable');
return false;
} | [
"protected",
"function",
"purgeDir",
"(",
"$",
"directory",
")",
"{",
"if",
"(",
"!",
"File",
"::",
"isDirectory",
"(",
"$",
"directory",
")",
")",
"return",
"true",
";",
"if",
"(",
"File",
"::",
"isWritable",
"(",
"$",
"directory",
")",
")",
"return",... | Purge directory.
@param string $directory
@return boolean | [
"Purge",
"directory",
"."
] | dd97a3e6d8287e6d674532d24ae8900f7fa23537 | https://github.com/Stolz/Assets/blob/dd97a3e6d8287e6d674532d24ae8900f7fa23537/src/Laravel/LegacyFlushPipelineCommand.php#L60-L71 |
Subsets and Splits
Yii Code Samples
Gathers all records from test, train, and validation sets that contain the word 'yii', providing a basic filtered view of the dataset relevant to Yii-related content.