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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
197,000 | raframework/rapkg | src/Rapkg/Cli/App.php | App.run | public function run(array $args)
{
$command = (string)$args[1];
$this->router->match($command);
$args = array_slice($args, 2);
return $this->router->executeCommand($args);
} | php | public function run(array $args)
{
$command = (string)$args[1];
$this->router->match($command);
$args = array_slice($args, 2);
return $this->router->executeCommand($args);
} | [
"public",
"function",
"run",
"(",
"array",
"$",
"args",
")",
"{",
"$",
"command",
"=",
"(",
"string",
")",
"$",
"args",
"[",
"1",
"]",
";",
"$",
"this",
"->",
"router",
"->",
"match",
"(",
"$",
"command",
")",
";",
"$",
"args",
"=",
"array_slice"... | run run the command and return exit code.
@param array $args
@return int | [
"run",
"run",
"the",
"command",
"and",
"return",
"exit",
"code",
"."
] | 7c4371911369d7c9d4463127bcd285144d7347ee | https://github.com/raframework/rapkg/blob/7c4371911369d7c9d4463127bcd285144d7347ee/src/Rapkg/Cli/App.php#L60-L67 |
197,001 | Kris-Kuiper/sFire-Framework | src/MVC/Service.php | Service.config | protected function config($data = []) {
if(null === $data) {
$data = [];
}
if(false === is_array($data)) {
return trigger_error(sprintf('Argument 1 passed to %s() must be of the type array, "%s" given', __METHOD__, gettype($data)), E_USER_ERROR);
}
$module = Router :: getRoute() -> getModul... | php | protected function config($data = []) {
if(null === $data) {
$data = [];
}
if(false === is_array($data)) {
return trigger_error(sprintf('Argument 1 passed to %s() must be of the type array, "%s" given', __METHOD__, gettype($data)), E_USER_ERROR);
}
$module = Router :: getRoute() -> getModul... | [
"protected",
"function",
"config",
"(",
"$",
"data",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"data",
")",
"{",
"$",
"data",
"=",
"[",
"]",
";",
"}",
"if",
"(",
"false",
"===",
"is_array",
"(",
"$",
"data",
")",
")",
"{",
"retu... | Returns the config for the current module
@param array $data
@return mixed | [
"Returns",
"the",
"config",
"for",
"the",
"current",
"module"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/MVC/Service.php#L59-L72 |
197,002 | praxigento/mobi_mod_pv | Plugin/Magento/Catalog/Block/Product/ListProduct.php | ListProduct.aroundGetProductPrice | public function aroundGetProductPrice(
\Magento\Catalog\Block\Product\ListProduct $subject,
\Closure $proceed,
\Magento\Catalog\Model\Product $product
) {
$result = $proceed($product);
$canSeePv = $this->hlpCust->canSeePv();
if ($canSeePv) {
$domId = "prxg... | php | public function aroundGetProductPrice(
\Magento\Catalog\Block\Product\ListProduct $subject,
\Closure $proceed,
\Magento\Catalog\Model\Product $product
) {
$result = $proceed($product);
$canSeePv = $this->hlpCust->canSeePv();
if ($canSeePv) {
$domId = "prxg... | [
"public",
"function",
"aroundGetProductPrice",
"(",
"\\",
"Magento",
"\\",
"Catalog",
"\\",
"Block",
"\\",
"Product",
"\\",
"ListProduct",
"$",
"subject",
",",
"\\",
"Closure",
"$",
"proceed",
",",
"\\",
"Magento",
"\\",
"Catalog",
"\\",
"Model",
"\\",
"Prod... | Insert PV HTML before product price HTML.
@param \Magento\Catalog\Block\Product\ListProduct $subject
@param \Closure $proceed
@param \Magento\Catalog\Model\Product $product
@return mixed|string | [
"Insert",
"PV",
"HTML",
"before",
"product",
"price",
"HTML",
"."
] | d1540b7e94264527006e8b9fa68904a72a63928e | https://github.com/praxigento/mobi_mod_pv/blob/d1540b7e94264527006e8b9fa68904a72a63928e/Plugin/Magento/Catalog/Block/Product/ListProduct.php#L33-L48 |
197,003 | stellaqua/Waltz.Stagehand | src/Waltz/Stagehand/CuiUtility.php | CuiUtility.drawByBlock | public function drawByBlock ( array $text ) {
$maxWidth = 0;
foreach ( $text as $line ) {
$this->drawByLine($line, true);
$lineWidth = $this->_getActualLength($line);
if ( $lineWidth > $maxWidth ) {
$maxWidth = $lineWidth;
}
}
... | php | public function drawByBlock ( array $text ) {
$maxWidth = 0;
foreach ( $text as $line ) {
$this->drawByLine($line, true);
$lineWidth = $this->_getActualLength($line);
if ( $lineWidth > $maxWidth ) {
$maxWidth = $lineWidth;
}
}
... | [
"public",
"function",
"drawByBlock",
"(",
"array",
"$",
"text",
")",
"{",
"$",
"maxWidth",
"=",
"0",
";",
"foreach",
"(",
"$",
"text",
"as",
"$",
"line",
")",
"{",
"$",
"this",
"->",
"drawByLine",
"(",
"$",
"line",
",",
"true",
")",
";",
"$",
"li... | Draw by block
@param array $text Drawing text with decoration tags
@return CuiUtility Self instance | [
"Draw",
"by",
"block"
] | 01df286751f5b9a5c90c47138dca3709e5bc383b | https://github.com/stellaqua/Waltz.Stagehand/blob/01df286751f5b9a5c90c47138dca3709e5bc383b/src/Waltz/Stagehand/CuiUtility.php#L94-L109 |
197,004 | stellaqua/Waltz.Stagehand | src/Waltz/Stagehand/CuiUtility.php | CuiUtility.drawByLine | public function drawByLine ( $text, $insertLineFeeds = true ) {
$convertedText = $this->_convertTagsToEscapeSequences($text);
echo $convertedText;
if ( $insertLineFeeds === true ) {
$width = $this->_getActualLength($text);
echo $this->_cursor
->insertLineF... | php | public function drawByLine ( $text, $insertLineFeeds = true ) {
$convertedText = $this->_convertTagsToEscapeSequences($text);
echo $convertedText;
if ( $insertLineFeeds === true ) {
$width = $this->_getActualLength($text);
echo $this->_cursor
->insertLineF... | [
"public",
"function",
"drawByLine",
"(",
"$",
"text",
",",
"$",
"insertLineFeeds",
"=",
"true",
")",
"{",
"$",
"convertedText",
"=",
"$",
"this",
"->",
"_convertTagsToEscapeSequences",
"(",
"$",
"text",
")",
";",
"echo",
"$",
"convertedText",
";",
"if",
"(... | Draw by line
@param string $text Drawing text with decoration tags
@param bool $insertLineFeeds Which insert line feeds
@return CuiUtility Self instance | [
"Draw",
"by",
"line"
] | 01df286751f5b9a5c90c47138dca3709e5bc383b | https://github.com/stellaqua/Waltz.Stagehand/blob/01df286751f5b9a5c90c47138dca3709e5bc383b/src/Waltz/Stagehand/CuiUtility.php#L118-L128 |
197,005 | stellaqua/Waltz.Stagehand | src/Waltz/Stagehand/CuiUtility.php | CuiUtility.finishDrawingByBlock | public function finishDrawingByBlock ( ) {
$canvasHeight = $this->_canvasSize[1];
echo str_repeat("\n", $canvasHeight);
$this->_cursor->moveHome()
->move(0, $canvasHeight);
return $this;
} | php | public function finishDrawingByBlock ( ) {
$canvasHeight = $this->_canvasSize[1];
echo str_repeat("\n", $canvasHeight);
$this->_cursor->moveHome()
->move(0, $canvasHeight);
return $this;
} | [
"public",
"function",
"finishDrawingByBlock",
"(",
")",
"{",
"$",
"canvasHeight",
"=",
"$",
"this",
"->",
"_canvasSize",
"[",
"1",
"]",
";",
"echo",
"str_repeat",
"(",
"\"\\n\"",
",",
"$",
"canvasHeight",
")",
";",
"$",
"this",
"->",
"_cursor",
"->",
"mo... | Finish drawing by block
@return CuiUtility Self instance | [
"Finish",
"drawing",
"by",
"block"
] | 01df286751f5b9a5c90c47138dca3709e5bc383b | https://github.com/stellaqua/Waltz.Stagehand/blob/01df286751f5b9a5c90c47138dca3709e5bc383b/src/Waltz/Stagehand/CuiUtility.php#L135-L141 |
197,006 | stellaqua/Waltz.Stagehand | src/Waltz/Stagehand/CuiUtility.php | CuiUtility.getWindowSize | public static function getWindowSize ( ) {
$terminal = exec('echo $TERM_PROGRAM');
if ( $terminal === 'Apple_Terminal' ) {
$windowWidth = exec('tput cols');
$windowHeight = exec('tput lines');
}
$windowWidth = ( $windowWidth > 0 ) ? $windowWidth : self::DEFAULT_WI... | php | public static function getWindowSize ( ) {
$terminal = exec('echo $TERM_PROGRAM');
if ( $terminal === 'Apple_Terminal' ) {
$windowWidth = exec('tput cols');
$windowHeight = exec('tput lines');
}
$windowWidth = ( $windowWidth > 0 ) ? $windowWidth : self::DEFAULT_WI... | [
"public",
"static",
"function",
"getWindowSize",
"(",
")",
"{",
"$",
"terminal",
"=",
"exec",
"(",
"'echo $TERM_PROGRAM'",
")",
";",
"if",
"(",
"$",
"terminal",
"===",
"'Apple_Terminal'",
")",
"{",
"$",
"windowWidth",
"=",
"exec",
"(",
"'tput cols'",
")",
... | Get terminal window size
@return array (width, height) | [
"Get",
"terminal",
"window",
"size"
] | 01df286751f5b9a5c90c47138dca3709e5bc383b | https://github.com/stellaqua/Waltz.Stagehand/blob/01df286751f5b9a5c90c47138dca3709e5bc383b/src/Waltz/Stagehand/CuiUtility.php#L148-L157 |
197,007 | stellaqua/Waltz.Stagehand | src/Waltz/Stagehand/CuiUtility.php | CuiUtility._convertTagsToEscapeSequences | private function _convertTagsToEscapeSequences ( $text ) {
list($patterns, $replacements) = $this->_getConvertingDictionary();
$convertedText = preg_replace($patterns, $replacements, $text);
return $convertedText;
} | php | private function _convertTagsToEscapeSequences ( $text ) {
list($patterns, $replacements) = $this->_getConvertingDictionary();
$convertedText = preg_replace($patterns, $replacements, $text);
return $convertedText;
} | [
"private",
"function",
"_convertTagsToEscapeSequences",
"(",
"$",
"text",
")",
"{",
"list",
"(",
"$",
"patterns",
",",
"$",
"replacements",
")",
"=",
"$",
"this",
"->",
"_getConvertingDictionary",
"(",
")",
";",
"$",
"convertedText",
"=",
"preg_replace",
"(",
... | Convert tags to escape sequences
@param string $text Text with decoration tags
@return string Converted text | [
"Convert",
"tags",
"to",
"escape",
"sequences"
] | 01df286751f5b9a5c90c47138dca3709e5bc383b | https://github.com/stellaqua/Waltz.Stagehand/blob/01df286751f5b9a5c90c47138dca3709e5bc383b/src/Waltz/Stagehand/CuiUtility.php#L165-L169 |
197,008 | stellaqua/Waltz.Stagehand | src/Waltz/Stagehand/CuiUtility.php | CuiUtility._getActualLength | private function _getActualLength ( $text ) {
$convertedText = $this->_convertTagsToEscapeSequences($text);
$strippedText = $this->_stripEscapeSequences($convertedText);
$length = mb_strlen($strippedText, 'utf-8');
return $length;
} | php | private function _getActualLength ( $text ) {
$convertedText = $this->_convertTagsToEscapeSequences($text);
$strippedText = $this->_stripEscapeSequences($convertedText);
$length = mb_strlen($strippedText, 'utf-8');
return $length;
} | [
"private",
"function",
"_getActualLength",
"(",
"$",
"text",
")",
"{",
"$",
"convertedText",
"=",
"$",
"this",
"->",
"_convertTagsToEscapeSequences",
"(",
"$",
"text",
")",
";",
"$",
"strippedText",
"=",
"$",
"this",
"->",
"_stripEscapeSequences",
"(",
"$",
... | Get actual length
@param string $text Original text
@return int Actual length | [
"Get",
"actual",
"length"
] | 01df286751f5b9a5c90c47138dca3709e5bc383b | https://github.com/stellaqua/Waltz.Stagehand/blob/01df286751f5b9a5c90c47138dca3709e5bc383b/src/Waltz/Stagehand/CuiUtility.php#L189-L194 |
197,009 | stellaqua/Waltz.Stagehand | src/Waltz/Stagehand/CuiUtility.php | CuiUtility._getConvertingDictionary | private function _getConvertingDictionary ( ) {
$definedColors = DecorationsObject::getDefinedColors();
foreach ( $definedColors as $colorName => $escapeSequences ) {
list($textColorEscapeSequence, $backgroundColorEscapeSequence) = $escapeSequences;
$patterns[] = "|<tc:$colorName... | php | private function _getConvertingDictionary ( ) {
$definedColors = DecorationsObject::getDefinedColors();
foreach ( $definedColors as $colorName => $escapeSequences ) {
list($textColorEscapeSequence, $backgroundColorEscapeSequence) = $escapeSequences;
$patterns[] = "|<tc:$colorName... | [
"private",
"function",
"_getConvertingDictionary",
"(",
")",
"{",
"$",
"definedColors",
"=",
"DecorationsObject",
"::",
"getDefinedColors",
"(",
")",
";",
"foreach",
"(",
"$",
"definedColors",
"as",
"$",
"colorName",
"=>",
"$",
"escapeSequences",
")",
"{",
"list... | Get converting dictionary
@return array Converting dictionary | [
"Get",
"converting",
"dictionary"
] | 01df286751f5b9a5c90c47138dca3709e5bc383b | https://github.com/stellaqua/Waltz.Stagehand/blob/01df286751f5b9a5c90c47138dca3709e5bc383b/src/Waltz/Stagehand/CuiUtility.php#L201-L228 |
197,010 | Sectorr/Core | Sectorr/Core/Http/Redirect.php | Redirect.back | public static function back()
{
$referer = $_SERVER['HTTP_REFERER'];
if (! empty($referer)) {
return self::redirect($referer);
}
return self::redirect('/');
} | php | public static function back()
{
$referer = $_SERVER['HTTP_REFERER'];
if (! empty($referer)) {
return self::redirect($referer);
}
return self::redirect('/');
} | [
"public",
"static",
"function",
"back",
"(",
")",
"{",
"$",
"referer",
"=",
"$",
"_SERVER",
"[",
"'HTTP_REFERER'",
"]",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"referer",
")",
")",
"{",
"return",
"self",
"::",
"redirect",
"(",
"$",
"referer",
")",
... | Redirect to HTTP referer.
@return mixed | [
"Redirect",
"to",
"HTTP",
"referer",
"."
] | 31df852dc6cc61642b0b87d9f0ae56c8e7da5a27 | https://github.com/Sectorr/Core/blob/31df852dc6cc61642b0b87d9f0ae56c8e7da5a27/Sectorr/Core/Http/Redirect.php#L52-L61 |
197,011 | ARCANESOFT/Blog | src/Http/Controllers/Admin/PostsController.php | PostsController.index | public function index($trashed = false)
{
$this->authorize(PostsPolicy::PERMISSION_LIST);
$posts = $this->post->with(['author', 'category'])->when($trashed, function ($query) {
return $query->onlyTrashed();
})->paginate(30);
$title = trans('blog::posts.titles.posts-list... | php | public function index($trashed = false)
{
$this->authorize(PostsPolicy::PERMISSION_LIST);
$posts = $this->post->with(['author', 'category'])->when($trashed, function ($query) {
return $query->onlyTrashed();
})->paginate(30);
$title = trans('blog::posts.titles.posts-list... | [
"public",
"function",
"index",
"(",
"$",
"trashed",
"=",
"false",
")",
"{",
"$",
"this",
"->",
"authorize",
"(",
"PostsPolicy",
"::",
"PERMISSION_LIST",
")",
";",
"$",
"posts",
"=",
"$",
"this",
"->",
"post",
"->",
"with",
"(",
"[",
"'author'",
",",
... | List the posts.
@param bool $trashed
@return \Illuminate\View\View | [
"List",
"the",
"posts",
"."
] | 2078fdfdcbccda161c02899b9e1f344f011b2859 | https://github.com/ARCANESOFT/Blog/blob/2078fdfdcbccda161c02899b9e1f344f011b2859/src/Http/Controllers/Admin/PostsController.php#L63-L76 |
197,012 | ARCANESOFT/Blog | src/Http/Controllers/Admin/PostsController.php | PostsController.store | public function store(CreatePostRequest $request)
{
$this->authorize(PostsPolicy::PERMISSION_CREATE);
$post = Post::createOne($request->getValidatedData());
$this->transNotification('created', ['title' => $post->title], $post->toArray());
return redirect()->route('admin::blog.post... | php | public function store(CreatePostRequest $request)
{
$this->authorize(PostsPolicy::PERMISSION_CREATE);
$post = Post::createOne($request->getValidatedData());
$this->transNotification('created', ['title' => $post->title], $post->toArray());
return redirect()->route('admin::blog.post... | [
"public",
"function",
"store",
"(",
"CreatePostRequest",
"$",
"request",
")",
"{",
"$",
"this",
"->",
"authorize",
"(",
"PostsPolicy",
"::",
"PERMISSION_CREATE",
")",
";",
"$",
"post",
"=",
"Post",
"::",
"createOne",
"(",
"$",
"request",
"->",
"getValidatedD... | Store the post.
@param \Arcanesoft\Blog\Http\Requests\Admin\Posts\CreatePostRequest $request
@return \Illuminate\Http\RedirectResponse | [
"Store",
"the",
"post",
"."
] | 2078fdfdcbccda161c02899b9e1f344f011b2859 | https://github.com/ARCANESOFT/Blog/blob/2078fdfdcbccda161c02899b9e1f344f011b2859/src/Http/Controllers/Admin/PostsController.php#L114-L123 |
197,013 | ARCANESOFT/Blog | src/Http/Controllers/Admin/PostsController.php | PostsController.show | public function show(Post $post)
{
$this->authorize(PostsPolicy::PERMISSION_SHOW);
$post = $post->load(['author', 'category', 'tags', 'seo']);
$this->setTitle(trans('blog::posts.titles.post-details'));
$this->addBreadcrumb($post->title);
return $this->view('admin.posts.sho... | php | public function show(Post $post)
{
$this->authorize(PostsPolicy::PERMISSION_SHOW);
$post = $post->load(['author', 'category', 'tags', 'seo']);
$this->setTitle(trans('blog::posts.titles.post-details'));
$this->addBreadcrumb($post->title);
return $this->view('admin.posts.sho... | [
"public",
"function",
"show",
"(",
"Post",
"$",
"post",
")",
"{",
"$",
"this",
"->",
"authorize",
"(",
"PostsPolicy",
"::",
"PERMISSION_SHOW",
")",
";",
"$",
"post",
"=",
"$",
"post",
"->",
"load",
"(",
"[",
"'author'",
",",
"'category'",
",",
"'tags'"... | Show a post.
@param \Arcanesoft\Blog\Models\Post $post
@return \Illuminate\View\View | [
"Show",
"a",
"post",
"."
] | 2078fdfdcbccda161c02899b9e1f344f011b2859 | https://github.com/ARCANESOFT/Blog/blob/2078fdfdcbccda161c02899b9e1f344f011b2859/src/Http/Controllers/Admin/PostsController.php#L132-L142 |
197,014 | ARCANESOFT/Blog | src/Http/Controllers/Admin/PostsController.php | PostsController.edit | public function edit(Post $post)
{
$this->authorize(PostsPolicy::PERMISSION_UPDATE);
$this->setTitle($title = trans('blog::posts.titles.edit-post'));
$this->addBreadcrumb($title);
$categories = Category::getSelectData();
$tags = Tag::getSelectData();
$statuses... | php | public function edit(Post $post)
{
$this->authorize(PostsPolicy::PERMISSION_UPDATE);
$this->setTitle($title = trans('blog::posts.titles.edit-post'));
$this->addBreadcrumb($title);
$categories = Category::getSelectData();
$tags = Tag::getSelectData();
$statuses... | [
"public",
"function",
"edit",
"(",
"Post",
"$",
"post",
")",
"{",
"$",
"this",
"->",
"authorize",
"(",
"PostsPolicy",
"::",
"PERMISSION_UPDATE",
")",
";",
"$",
"this",
"->",
"setTitle",
"(",
"$",
"title",
"=",
"trans",
"(",
"'blog::posts.titles.edit-post'",
... | Edit a post.
@param \Arcanesoft\Blog\Models\Post $post
@return \Illuminate\View\View | [
"Edit",
"a",
"post",
"."
] | 2078fdfdcbccda161c02899b9e1f344f011b2859 | https://github.com/ARCANESOFT/Blog/blob/2078fdfdcbccda161c02899b9e1f344f011b2859/src/Http/Controllers/Admin/PostsController.php#L151-L163 |
197,015 | ARCANESOFT/Blog | src/Http/Controllers/Admin/PostsController.php | PostsController.update | public function update(Post $post, UpdatePostRequest $request)
{
$this->authorize(PostsPolicy::PERMISSION_UPDATE);
$post->updateOne($request->getValidatedData());
$this->transNotification('updated', ['title' => $post->title], $post->toArray());
return redirect()->route('admin::blo... | php | public function update(Post $post, UpdatePostRequest $request)
{
$this->authorize(PostsPolicy::PERMISSION_UPDATE);
$post->updateOne($request->getValidatedData());
$this->transNotification('updated', ['title' => $post->title], $post->toArray());
return redirect()->route('admin::blo... | [
"public",
"function",
"update",
"(",
"Post",
"$",
"post",
",",
"UpdatePostRequest",
"$",
"request",
")",
"{",
"$",
"this",
"->",
"authorize",
"(",
"PostsPolicy",
"::",
"PERMISSION_UPDATE",
")",
";",
"$",
"post",
"->",
"updateOne",
"(",
"$",
"request",
"->"... | Update the post.
@param \Arcanesoft\Blog\Models\Post $post
@param \Arcanesoft\Blog\Http\Requests\Admin\Posts\UpdatePostRequest $request
@return \Illuminate\Http\RedirectResponse | [
"Update",
"the",
"post",
"."
] | 2078fdfdcbccda161c02899b9e1f344f011b2859 | https://github.com/ARCANESOFT/Blog/blob/2078fdfdcbccda161c02899b9e1f344f011b2859/src/Http/Controllers/Admin/PostsController.php#L173-L182 |
197,016 | ARCANESOFT/Blog | src/Http/Controllers/Admin/PostsController.php | PostsController.restore | public function restore(Post $post)
{
$this->authorize(PostsPolicy::PERMISSION_UPDATE);
try {
$post->restore();
return $this->jsonResponseSuccess([
'message' => $this->transNotification('restored', ['title' => $post->title], $post->toArray())
]);... | php | public function restore(Post $post)
{
$this->authorize(PostsPolicy::PERMISSION_UPDATE);
try {
$post->restore();
return $this->jsonResponseSuccess([
'message' => $this->transNotification('restored', ['title' => $post->title], $post->toArray())
]);... | [
"public",
"function",
"restore",
"(",
"Post",
"$",
"post",
")",
"{",
"$",
"this",
"->",
"authorize",
"(",
"PostsPolicy",
"::",
"PERMISSION_UPDATE",
")",
";",
"try",
"{",
"$",
"post",
"->",
"restore",
"(",
")",
";",
"return",
"$",
"this",
"->",
"jsonRes... | Restore a trashed post.
@param \Arcanesoft\Blog\Models\Post $post
@return \Illuminate\Http\JsonResponse | [
"Restore",
"a",
"trashed",
"post",
"."
] | 2078fdfdcbccda161c02899b9e1f344f011b2859 | https://github.com/ARCANESOFT/Blog/blob/2078fdfdcbccda161c02899b9e1f344f011b2859/src/Http/Controllers/Admin/PostsController.php#L205-L219 |
197,017 | miaoxing/plugin | src/Model/SoftDeleteTrait.php | SoftDeleteTrait.executeDestroy | protected function executeDestroy()
{
if ($this->reallyDestroy) {
parent::executeDestroy();
} else {
$this->saveData([
$this->deletedAtColumn => date('Y-m-d H:i:s'),
$this->deletedByColumn => $this->curUser['id'],
]);
}
... | php | protected function executeDestroy()
{
if ($this->reallyDestroy) {
parent::executeDestroy();
} else {
$this->saveData([
$this->deletedAtColumn => date('Y-m-d H:i:s'),
$this->deletedByColumn => $this->curUser['id'],
]);
}
... | [
"protected",
"function",
"executeDestroy",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"reallyDestroy",
")",
"{",
"parent",
"::",
"executeDestroy",
"(",
")",
";",
"}",
"else",
"{",
"$",
"this",
"->",
"saveData",
"(",
"[",
"$",
"this",
"->",
"deletedAt... | Overwrite original destroy logic. | [
"Overwrite",
"original",
"destroy",
"logic",
"."
] | f287a1e6c97abba6f06906255b8c26e8ab0afe61 | https://github.com/miaoxing/plugin/blob/f287a1e6c97abba6f06906255b8c26e8ab0afe61/src/Model/SoftDeleteTrait.php#L91-L101 |
197,018 | chee-commerce/CheeVersion | src/Version.php | Version.getFloatMajor | public function getFloatMajor()
{
if ($this->startsWith($this->major, '0'))
return (float) ('0.'.substr($this->major, 1));
return (float) $this->major;
} | php | public function getFloatMajor()
{
if ($this->startsWith($this->major, '0'))
return (float) ('0.'.substr($this->major, 1));
return (float) $this->major;
} | [
"public",
"function",
"getFloatMajor",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"startsWith",
"(",
"$",
"this",
"->",
"major",
",",
"'0'",
")",
")",
"return",
"(",
"float",
")",
"(",
"'0.'",
".",
"substr",
"(",
"$",
"this",
"->",
"major",
",",
... | Get floated major
@return float | [
"Get",
"floated",
"major"
] | b4d7801f05784e5e4e89fc424dd66ae0f2d35d3c | https://github.com/chee-commerce/CheeVersion/blob/b4d7801f05784e5e4e89fc424dd66ae0f2d35d3c/src/Version.php#L117-L122 |
197,019 | chee-commerce/CheeVersion | src/Version.php | Version.getFloatMinor | public function getFloatMinor()
{
if ($this->startsWith($this->minor, '0'))
return (float) ('0.'.substr($this->minor, 1));
return (float) $this->minor;
} | php | public function getFloatMinor()
{
if ($this->startsWith($this->minor, '0'))
return (float) ('0.'.substr($this->minor, 1));
return (float) $this->minor;
} | [
"public",
"function",
"getFloatMinor",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"startsWith",
"(",
"$",
"this",
"->",
"minor",
",",
"'0'",
")",
")",
"return",
"(",
"float",
")",
"(",
"'0.'",
".",
"substr",
"(",
"$",
"this",
"->",
"minor",
",",
... | Get floated minor
@return float | [
"Get",
"floated",
"minor"
] | b4d7801f05784e5e4e89fc424dd66ae0f2d35d3c | https://github.com/chee-commerce/CheeVersion/blob/b4d7801f05784e5e4e89fc424dd66ae0f2d35d3c/src/Version.php#L139-L144 |
197,020 | chee-commerce/CheeVersion | src/Version.php | Version.getFloatPath | public function getFloatPath()
{
if ($this->startsWith($this->path, '0'))
return (float) ('0.'.substr($this->path, 1));
return (float) $this->path;
} | php | public function getFloatPath()
{
if ($this->startsWith($this->path, '0'))
return (float) ('0.'.substr($this->path, 1));
return (float) $this->path;
} | [
"public",
"function",
"getFloatPath",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"startsWith",
"(",
"$",
"this",
"->",
"path",
",",
"'0'",
")",
")",
"return",
"(",
"float",
")",
"(",
"'0.'",
".",
"substr",
"(",
"$",
"this",
"->",
"path",
",",
"... | Get floated path
@return float | [
"Get",
"floated",
"path"
] | b4d7801f05784e5e4e89fc424dd66ae0f2d35d3c | https://github.com/chee-commerce/CheeVersion/blob/b4d7801f05784e5e4e89fc424dd66ae0f2d35d3c/src/Version.php#L161-L166 |
197,021 | chee-commerce/CheeVersion | src/Version.php | Version.isPartOf | public function isPartOf(Version $version)
{
if (is_null($version->getOperator()))
{
if ($this->major == $version->getMajor() && $this->minor == $version->getMinor() && $this->path == $version->getPath())
return true;
return false;
}
switch (... | php | public function isPartOf(Version $version)
{
if (is_null($version->getOperator()))
{
if ($this->major == $version->getMajor() && $this->minor == $version->getMinor() && $this->path == $version->getPath())
return true;
return false;
}
switch (... | [
"public",
"function",
"isPartOf",
"(",
"Version",
"$",
"version",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"version",
"->",
"getOperator",
"(",
")",
")",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"major",
"==",
"$",
"version",
"->",
"getMajor",
"(",
... | Is this version part of another version?
@param Chee\Version\Version $version
@return bool | [
"Is",
"this",
"version",
"part",
"of",
"another",
"version?"
] | b4d7801f05784e5e4e89fc424dd66ae0f2d35d3c | https://github.com/chee-commerce/CheeVersion/blob/b4d7801f05784e5e4e89fc424dd66ae0f2d35d3c/src/Version.php#L195-L217 |
197,022 | chee-commerce/CheeVersion | src/Version.php | Version.detectOperator | protected function detectOperator()
{
if ($this->startsWith($this->version, self::GREATER_EQUAL))
{
$this->operator = self::GREATER_EQUAL;
$this->version = substr($this->version, 2);
}
else if ($this->startsWith($this->version, self::GREATER))
{
... | php | protected function detectOperator()
{
if ($this->startsWith($this->version, self::GREATER_EQUAL))
{
$this->operator = self::GREATER_EQUAL;
$this->version = substr($this->version, 2);
}
else if ($this->startsWith($this->version, self::GREATER))
{
... | [
"protected",
"function",
"detectOperator",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"startsWith",
"(",
"$",
"this",
"->",
"version",
",",
"self",
"::",
"GREATER_EQUAL",
")",
")",
"{",
"$",
"this",
"->",
"operator",
"=",
"self",
"::",
"GREATER_EQUAL",... | Detect operator of version
@return void | [
"Detect",
"operator",
"of",
"version"
] | b4d7801f05784e5e4e89fc424dd66ae0f2d35d3c | https://github.com/chee-commerce/CheeVersion/blob/b4d7801f05784e5e4e89fc424dd66ae0f2d35d3c/src/Version.php#L224-L241 |
197,023 | xelax90/xelax-site-config | src/XelaxSiteConfig/Options/Service/SiteConfigService.php | SiteConfigService.getConfig | public function getConfig($prefix){
/* @var $siteConfigService EyeService */
$siteConfigService = $this->getServiceLocator()->get(EyeService::class);
$config = $siteConfigService->getAll();
// get config selected by prefix
$prefixParts = explode('.', $prefix);
$conf = $config;
foreach ($prefixParts as ... | php | public function getConfig($prefix){
/* @var $siteConfigService EyeService */
$siteConfigService = $this->getServiceLocator()->get(EyeService::class);
$config = $siteConfigService->getAll();
// get config selected by prefix
$prefixParts = explode('.', $prefix);
$conf = $config;
foreach ($prefixParts as ... | [
"public",
"function",
"getConfig",
"(",
"$",
"prefix",
")",
"{",
"/* @var $siteConfigService EyeService */",
"$",
"siteConfigService",
"=",
"$",
"this",
"->",
"getServiceLocator",
"(",
")",
"->",
"get",
"(",
"EyeService",
"::",
"class",
")",
";",
"$",
"config",
... | Get config for specified prefix
@param string $prefix
@return array | [
"Get",
"config",
"for",
"specified",
"prefix"
] | 76c86e2f716fc2c66b59124a69e35c4cadfeb3db | https://github.com/xelax90/xelax-site-config/blob/76c86e2f716fc2c66b59124a69e35c4cadfeb3db/src/XelaxSiteConfig/Options/Service/SiteConfigService.php#L20-L36 |
197,024 | g4code/cron | src/CronExpression.php | CronExpression.setExpression | public function setExpression($value)
{
$this->cronParts = preg_split('/\s/', $value, -1, PREG_SPLIT_NO_EMPTY);
if (count($this->cronParts) < 6) {
throw new InvalidArgumentException(
$value . ' is not a valid CRON expression'
);
}
foreach ($th... | php | public function setExpression($value)
{
$this->cronParts = preg_split('/\s/', $value, -1, PREG_SPLIT_NO_EMPTY);
if (count($this->cronParts) < 6) {
throw new InvalidArgumentException(
$value . ' is not a valid CRON expression'
);
}
foreach ($th... | [
"public",
"function",
"setExpression",
"(",
"$",
"value",
")",
"{",
"$",
"this",
"->",
"cronParts",
"=",
"preg_split",
"(",
"'/\\s/'",
",",
"$",
"value",
",",
"-",
"1",
",",
"PREG_SPLIT_NO_EMPTY",
")",
";",
"if",
"(",
"count",
"(",
"$",
"this",
"->",
... | Set or change the CRON expression
@param string $schedule CRON expression (e.g. 8 * * * *)
@return CronExpression
@throws InvalidArgumentException if not a valid CRON expression | [
"Set",
"or",
"change",
"the",
"CRON",
"expression"
] | aae994c45e85b994ce5c581e9bd69f21ac28b8cb | https://github.com/g4code/cron/blob/aae994c45e85b994ce5c581e9bd69f21ac28b8cb/src/CronExpression.php#L99-L113 |
197,025 | g4code/cron | src/CronExpression.php | CronExpression.setPart | public function setPart($position, $value)
{
if (!$this->fieldFactory->getField($position)->validate($value)) {
throw new InvalidArgumentException(
'Invalid CRON field value ' . $value . ' as position ' . $position
);
}
$this->cronParts[$position] = $... | php | public function setPart($position, $value)
{
if (!$this->fieldFactory->getField($position)->validate($value)) {
throw new InvalidArgumentException(
'Invalid CRON field value ' . $value . ' as position ' . $position
);
}
$this->cronParts[$position] = $... | [
"public",
"function",
"setPart",
"(",
"$",
"position",
",",
"$",
"value",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"fieldFactory",
"->",
"getField",
"(",
"$",
"position",
")",
"->",
"validate",
"(",
"$",
"value",
")",
")",
"{",
"throw",
"new",
... | Set part of the CRON expression
@param int $position The position of the CRON expression to set
@param string $value The value to set
@return CronExpression
@throws InvalidArgumentException if the value is not valid for the part | [
"Set",
"part",
"of",
"the",
"CRON",
"expression"
] | aae994c45e85b994ce5c581e9bd69f21ac28b8cb | https://github.com/g4code/cron/blob/aae994c45e85b994ce5c581e9bd69f21ac28b8cb/src/CronExpression.php#L124-L135 |
197,026 | g4code/cron | src/CronExpression.php | CronExpression.isDue | public function isDue($currentTime = null)
{
if (null === $currentTime || 'now' === $currentTime) {
$currentDate = date('Y-m-d H:i:s');
$currentTime = strtotime($currentDate);
} elseif ($currentTime instanceof DateTime) {
$currentDate = $currentTime->format('Y-m-d... | php | public function isDue($currentTime = null)
{
if (null === $currentTime || 'now' === $currentTime) {
$currentDate = date('Y-m-d H:i:s');
$currentTime = strtotime($currentDate);
} elseif ($currentTime instanceof DateTime) {
$currentDate = $currentTime->format('Y-m-d... | [
"public",
"function",
"isDue",
"(",
"$",
"currentTime",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"currentTime",
"||",
"'now'",
"===",
"$",
"currentTime",
")",
"{",
"$",
"currentDate",
"=",
"date",
"(",
"'Y-m-d H:i:s'",
")",
";",
"$",
"curr... | Deterime if the cron is due to run based on the current date or a
specific date. This method assumes that the current number of
seconds are irrelevant, and should be called once per minute.
@param string|DateTime $currentTime (optional) Relative calculation date
@return bool Returns TRUE if the cron is due to run or... | [
"Deterime",
"if",
"the",
"cron",
"is",
"due",
"to",
"run",
"based",
"on",
"the",
"current",
"date",
"or",
"a",
"specific",
"date",
".",
"This",
"method",
"assumes",
"that",
"the",
"current",
"number",
"of",
"seconds",
"are",
"irrelevant",
"and",
"should",
... | aae994c45e85b994ce5c581e9bd69f21ac28b8cb | https://github.com/g4code/cron/blob/aae994c45e85b994ce5c581e9bd69f21ac28b8cb/src/CronExpression.php#L166-L182 |
197,027 | koolkode/http | src/HttpMessage.php | HttpMessage.setProtocol | public function setProtocol($protocol)
{
switch(strtoupper($protocol))
{
case 'HTTP/1.0':
case 'HTTP/1.1':
$this->protocol = strtoupper($protocol);
break;
default:
throw new \OutOfRangeException(sprintf('Unsupported protocol: "%s"', $protocol));
}
return $this;
} | php | public function setProtocol($protocol)
{
switch(strtoupper($protocol))
{
case 'HTTP/1.0':
case 'HTTP/1.1':
$this->protocol = strtoupper($protocol);
break;
default:
throw new \OutOfRangeException(sprintf('Unsupported protocol: "%s"', $protocol));
}
return $this;
} | [
"public",
"function",
"setProtocol",
"(",
"$",
"protocol",
")",
"{",
"switch",
"(",
"strtoupper",
"(",
"$",
"protocol",
")",
")",
"{",
"case",
"'HTTP/1.0'",
":",
"case",
"'HTTP/1.1'",
":",
"$",
"this",
"->",
"protocol",
"=",
"strtoupper",
"(",
"$",
"prot... | Set the HTTP protocol being used.
@param string $protocol
@return HttpMessage | [
"Set",
"the",
"HTTP",
"protocol",
"being",
"used",
"."
] | 3c1626d409d5ce5d71d26f0e8f31ae3683a2a966 | https://github.com/koolkode/http/blob/3c1626d409d5ce5d71d26f0e8f31ae3683a2a966/src/HttpMessage.php#L83-L96 |
197,028 | koolkode/http | src/HttpMessage.php | HttpMessage.hasHeader | public function hasHeader($header)
{
if($header instanceof HttpHeaderInterface)
{
return !empty($this->headers[strtolower($header->getFieldName())]);
}
return !empty($this->headers[strtolower($header)]);
} | php | public function hasHeader($header)
{
if($header instanceof HttpHeaderInterface)
{
return !empty($this->headers[strtolower($header->getFieldName())]);
}
return !empty($this->headers[strtolower($header)]);
} | [
"public",
"function",
"hasHeader",
"(",
"$",
"header",
")",
"{",
"if",
"(",
"$",
"header",
"instanceof",
"HttpHeaderInterface",
")",
"{",
"return",
"!",
"empty",
"(",
"$",
"this",
"->",
"headers",
"[",
"strtolower",
"(",
"$",
"header",
"->",
"getFieldName"... | Check if an HTTP header with the given name is set.
@param string $header
@return boolean | [
"Check",
"if",
"an",
"HTTP",
"header",
"with",
"the",
"given",
"name",
"is",
"set",
"."
] | 3c1626d409d5ce5d71d26f0e8f31ae3683a2a966 | https://github.com/koolkode/http/blob/3c1626d409d5ce5d71d26f0e8f31ae3683a2a966/src/HttpMessage.php#L104-L112 |
197,029 | koolkode/http | src/HttpMessage.php | HttpMessage.getHeader | public function getHeader($header)
{
$n = ($header instanceof HttpHeaderInterface) ? strtolower($header->getFieldName()) : strtolower($header);
if(!empty($this->headers[$n]))
{
return $this->headers[$n][0][1];
}
if(func_num_args() > 1)
{
return func_get_arg(1);
}
$name = ($header instanc... | php | public function getHeader($header)
{
$n = ($header instanceof HttpHeaderInterface) ? strtolower($header->getFieldName()) : strtolower($header);
if(!empty($this->headers[$n]))
{
return $this->headers[$n][0][1];
}
if(func_num_args() > 1)
{
return func_get_arg(1);
}
$name = ($header instanc... | [
"public",
"function",
"getHeader",
"(",
"$",
"header",
")",
"{",
"$",
"n",
"=",
"(",
"$",
"header",
"instanceof",
"HttpHeaderInterface",
")",
"?",
"strtolower",
"(",
"$",
"header",
"->",
"getFieldName",
"(",
")",
")",
":",
"strtolower",
"(",
"$",
"header... | Get the first HTTP header of the given type.
@param mixed $header A header name or an instance of HttpHeaderInterface.
@param mixed $default
@return string
@throws \OutOfBoundsException When no such header is set. | [
"Get",
"the",
"first",
"HTTP",
"header",
"of",
"the",
"given",
"type",
"."
] | 3c1626d409d5ce5d71d26f0e8f31ae3683a2a966 | https://github.com/koolkode/http/blob/3c1626d409d5ce5d71d26f0e8f31ae3683a2a966/src/HttpMessage.php#L123-L140 |
197,030 | koolkode/http | src/HttpMessage.php | HttpMessage.addHeader | public function addHeader($header, $value = NULL)
{
if($header instanceof HttpHeaderInterface)
{
$n = strtolower($header->getFieldName());
if(empty($this->headers[$n]))
{
$this->headers[$n] = [[(string)$header->getFieldName(), trim($header->getFieldValue())]];
}
else
{
$this->headers[... | php | public function addHeader($header, $value = NULL)
{
if($header instanceof HttpHeaderInterface)
{
$n = strtolower($header->getFieldName());
if(empty($this->headers[$n]))
{
$this->headers[$n] = [[(string)$header->getFieldName(), trim($header->getFieldValue())]];
}
else
{
$this->headers[... | [
"public",
"function",
"addHeader",
"(",
"$",
"header",
",",
"$",
"value",
"=",
"NULL",
")",
"{",
"if",
"(",
"$",
"header",
"instanceof",
"HttpHeaderInterface",
")",
"{",
"$",
"n",
"=",
"strtolower",
"(",
"$",
"header",
"->",
"getFieldName",
"(",
")",
"... | Add an HTTP header to the message.
@param mixed $header A header name or an instance of HttpHeaderInterface.
@param string $value
@return HttpMessage | [
"Add",
"an",
"HTTP",
"header",
"to",
"the",
"message",
"."
] | 3c1626d409d5ce5d71d26f0e8f31ae3683a2a966 | https://github.com/koolkode/http/blob/3c1626d409d5ce5d71d26f0e8f31ae3683a2a966/src/HttpMessage.php#L170-L200 |
197,031 | koolkode/http | src/HttpMessage.php | HttpMessage.removeHeader | public function removeHeader($header)
{
if($header instanceof HttpHeaderInterface)
{
unset($this->headers[strtolower($header->getFieldName())]);
}
else
{
unset($this->headers[strtolower($header)]);
}
return $this;
} | php | public function removeHeader($header)
{
if($header instanceof HttpHeaderInterface)
{
unset($this->headers[strtolower($header->getFieldName())]);
}
else
{
unset($this->headers[strtolower($header)]);
}
return $this;
} | [
"public",
"function",
"removeHeader",
"(",
"$",
"header",
")",
"{",
"if",
"(",
"$",
"header",
"instanceof",
"HttpHeaderInterface",
")",
"{",
"unset",
"(",
"$",
"this",
"->",
"headers",
"[",
"strtolower",
"(",
"$",
"header",
"->",
"getFieldName",
"(",
")",
... | Remove all HTTP headers of the given type from the message.
@param mixed $header A header name or an instance of HttpHeaderInterface.
@return HttpMessage | [
"Remove",
"all",
"HTTP",
"headers",
"of",
"the",
"given",
"type",
"from",
"the",
"message",
"."
] | 3c1626d409d5ce5d71d26f0e8f31ae3683a2a966 | https://github.com/koolkode/http/blob/3c1626d409d5ce5d71d26f0e8f31ae3683a2a966/src/HttpMessage.php#L208-L220 |
197,032 | koolkode/http | src/HttpMessage.php | HttpMessage.getHeaders | public function getHeaders($name = NULL)
{
if($name === NULL)
{
return $this->headers;
}
$n = strtolower($name);
if(empty($this->headers[$n]))
{
return [];
}
$headers = [];
foreach($this->headers[$n] as $data)
{
$headers[] = $data;
}
return $headers;
} | php | public function getHeaders($name = NULL)
{
if($name === NULL)
{
return $this->headers;
}
$n = strtolower($name);
if(empty($this->headers[$n]))
{
return [];
}
$headers = [];
foreach($this->headers[$n] as $data)
{
$headers[] = $data;
}
return $headers;
} | [
"public",
"function",
"getHeaders",
"(",
"$",
"name",
"=",
"NULL",
")",
"{",
"if",
"(",
"$",
"name",
"===",
"NULL",
")",
"{",
"return",
"$",
"this",
"->",
"headers",
";",
"}",
"$",
"n",
"=",
"strtolower",
"(",
"$",
"name",
")",
";",
"if",
"(",
... | Get all HTTP headers of this message.
@param string $name
@return array | [
"Get",
"all",
"HTTP",
"headers",
"of",
"this",
"message",
"."
] | 3c1626d409d5ce5d71d26f0e8f31ae3683a2a966 | https://github.com/koolkode/http/blob/3c1626d409d5ce5d71d26f0e8f31ae3683a2a966/src/HttpMessage.php#L228-L250 |
197,033 | koolkode/http | src/HttpMessage.php | HttpMessage.determineHeaderTypeName | protected function determineHeaderTypeName(callable $callback)
{
if(is_array($callback))
{
$ref = new \ReflectionMethod(is_object($callback[0]) ? get_class($callback[0]) : $callback[0], $callback[1]);
}
elseif(is_object($callback) && !$callback instanceof \Closure)
{
$ref = new \ReflectionMethod(get_cl... | php | protected function determineHeaderTypeName(callable $callback)
{
if(is_array($callback))
{
$ref = new \ReflectionMethod(is_object($callback[0]) ? get_class($callback[0]) : $callback[0], $callback[1]);
}
elseif(is_object($callback) && !$callback instanceof \Closure)
{
$ref = new \ReflectionMethod(get_cl... | [
"protected",
"function",
"determineHeaderTypeName",
"(",
"callable",
"$",
"callback",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"callback",
")",
")",
"{",
"$",
"ref",
"=",
"new",
"\\",
"ReflectionMethod",
"(",
"is_object",
"(",
"$",
"callback",
"[",
"0",
... | Extract meta info of the first argument to the given callback and determine an HTTP header
implementation to be used.
@param callable $callback
@return string
@throws \InvalidArgumentException when the given callback does not specify a valid HTTP header argument. | [
"Extract",
"meta",
"info",
"of",
"the",
"first",
"argument",
"to",
"the",
"given",
"callback",
"and",
"determine",
"an",
"HTTP",
"header",
"implementation",
"to",
"be",
"used",
"."
] | 3c1626d409d5ce5d71d26f0e8f31ae3683a2a966 | https://github.com/koolkode/http/blob/3c1626d409d5ce5d71d26f0e8f31ae3683a2a966/src/HttpMessage.php#L307-L342 |
197,034 | koolkode/http | src/HttpMessage.php | HttpMessage.setEntity | public function setEntity($entity, $prepare = true)
{
if($entity instanceof EntityInterface)
{
$this->entity = $entity;
}
elseif(is_resource($entity) || $entity instanceof StreamInterface)
{
$this->entity = new StreamEntity($entity);
}
elseif((is_array($entity) || is_object($entity)) && is_calla... | php | public function setEntity($entity, $prepare = true)
{
if($entity instanceof EntityInterface)
{
$this->entity = $entity;
}
elseif(is_resource($entity) || $entity instanceof StreamInterface)
{
$this->entity = new StreamEntity($entity);
}
elseif((is_array($entity) || is_object($entity)) && is_calla... | [
"public",
"function",
"setEntity",
"(",
"$",
"entity",
",",
"$",
"prepare",
"=",
"true",
")",
"{",
"if",
"(",
"$",
"entity",
"instanceof",
"EntityInterface",
")",
"{",
"$",
"this",
"->",
"entity",
"=",
"$",
"entity",
";",
"}",
"elseif",
"(",
"is_resour... | Convert the given argument into an HTTP entity and put it in the nessage.
@param mixed $entity
@param boolean $prepare Have the entity inject Content-Type etc. into the HTTP message?
@return HttpMessage | [
"Convert",
"the",
"given",
"argument",
"into",
"an",
"HTTP",
"entity",
"and",
"put",
"it",
"in",
"the",
"nessage",
"."
] | 3c1626d409d5ce5d71d26f0e8f31ae3683a2a966 | https://github.com/koolkode/http/blob/3c1626d409d5ce5d71d26f0e8f31ae3683a2a966/src/HttpMessage.php#L411-L436 |
197,035 | bkstg/schedule-bundle | Timeline/Spread/InvitedSpread.php | InvitedSpread.resolveClass | private function resolveClass($object)
{
if (!$object instanceof Proxy) {
return get_class($object);
}
// If this is a proxy resolve using class metadata.
return $this
->em
->getClassMetadata(get_class($object))
->getReflectionClass()
... | php | private function resolveClass($object)
{
if (!$object instanceof Proxy) {
return get_class($object);
}
// If this is a proxy resolve using class metadata.
return $this
->em
->getClassMetadata(get_class($object))
->getReflectionClass()
... | [
"private",
"function",
"resolveClass",
"(",
"$",
"object",
")",
"{",
"if",
"(",
"!",
"$",
"object",
"instanceof",
"Proxy",
")",
"{",
"return",
"get_class",
"(",
"$",
"object",
")",
";",
"}",
"// If this is a proxy resolve using class metadata.",
"return",
"$",
... | Figure out the real class for this object.
@param mixed $object The object.
@return string | [
"Figure",
"out",
"the",
"real",
"class",
"for",
"this",
"object",
"."
] | e64ac897aa7b28bc48319470d65de13cd4788afe | https://github.com/bkstg/schedule-bundle/blob/e64ac897aa7b28bc48319470d65de13cd4788afe/Timeline/Spread/InvitedSpread.php#L73-L85 |
197,036 | gplcart/cli | controllers/commands/Module.php | Module.cmdUninstallModule | public function cmdUninstallModule()
{
$result = $this->module_model->uninstall($this->getParam(0));
if ($result !== true) {
$this->errorAndExit($result);
}
$this->output();
} | php | public function cmdUninstallModule()
{
$result = $this->module_model->uninstall($this->getParam(0));
if ($result !== true) {
$this->errorAndExit($result);
}
$this->output();
} | [
"public",
"function",
"cmdUninstallModule",
"(",
")",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"module_model",
"->",
"uninstall",
"(",
"$",
"this",
"->",
"getParam",
"(",
"0",
")",
")",
";",
"if",
"(",
"$",
"result",
"!==",
"true",
")",
"{",
"$",
... | Callback for "module-uninstall" command | [
"Callback",
"for",
"module",
"-",
"uninstall",
"command"
] | e57dba53e291a225b4bff0c0d9b23d685dd1c125 | https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/Module.php#L49-L58 |
197,037 | gplcart/cli | controllers/commands/Module.php | Module.cmdInstallModule | public function cmdInstallModule()
{
$result = $this->module_model->install($this->getParam(0));
if ($result !== true) {
$this->errorAndExit($result);
}
$this->output();
} | php | public function cmdInstallModule()
{
$result = $this->module_model->install($this->getParam(0));
if ($result !== true) {
$this->errorAndExit($result);
}
$this->output();
} | [
"public",
"function",
"cmdInstallModule",
"(",
")",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"module_model",
"->",
"install",
"(",
"$",
"this",
"->",
"getParam",
"(",
"0",
")",
")",
";",
"if",
"(",
"$",
"result",
"!==",
"true",
")",
"{",
"$",
"t... | Callback for "module-install" command | [
"Callback",
"for",
"module",
"-",
"install",
"command"
] | e57dba53e291a225b4bff0c0d9b23d685dd1c125 | https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/Module.php#L63-L72 |
197,038 | gplcart/cli | controllers/commands/Module.php | Module.cmdOffModule | public function cmdOffModule()
{
$id = $this->getParam(0);
if (empty($id)) {
$this->errorAndExit($this->text('Invalid argument'));
}
$result = $this->module_model->disable($id);
if ($result !== true) {
$this->errorAndExit($result);
}
... | php | public function cmdOffModule()
{
$id = $this->getParam(0);
if (empty($id)) {
$this->errorAndExit($this->text('Invalid argument'));
}
$result = $this->module_model->disable($id);
if ($result !== true) {
$this->errorAndExit($result);
}
... | [
"public",
"function",
"cmdOffModule",
"(",
")",
"{",
"$",
"id",
"=",
"$",
"this",
"->",
"getParam",
"(",
"0",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"id",
")",
")",
"{",
"$",
"this",
"->",
"errorAndExit",
"(",
"$",
"this",
"->",
"text",
"(",
"... | Callback for "module-off" command | [
"Callback",
"for",
"module",
"-",
"off",
"command"
] | e57dba53e291a225b4bff0c0d9b23d685dd1c125 | https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/Module.php#L77-L92 |
197,039 | gplcart/cli | controllers/commands/Module.php | Module.cmdOnModule | public function cmdOnModule()
{
$id = $this->getParam(0);
if (empty($id)) {
$this->errorAndExit($this->text('Invalid argument'));
}
$result = $this->module_model->enable($id);
if ($result !== true) {
$this->errorAndExit($result);
}
... | php | public function cmdOnModule()
{
$id = $this->getParam(0);
if (empty($id)) {
$this->errorAndExit($this->text('Invalid argument'));
}
$result = $this->module_model->enable($id);
if ($result !== true) {
$this->errorAndExit($result);
}
... | [
"public",
"function",
"cmdOnModule",
"(",
")",
"{",
"$",
"id",
"=",
"$",
"this",
"->",
"getParam",
"(",
"0",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"id",
")",
")",
"{",
"$",
"this",
"->",
"errorAndExit",
"(",
"$",
"this",
"->",
"text",
"(",
"'... | Callback for "module-on" command | [
"Callback",
"for",
"module",
"-",
"on",
"command"
] | e57dba53e291a225b4bff0c0d9b23d685dd1c125 | https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/Module.php#L97-L112 |
197,040 | gplcart/cli | controllers/commands/Module.php | Module.cmdGetModule | public function cmdGetModule()
{
$result = $this->getListModule();
$this->outputFormat($result);
$this->outputFormatTableModule($result);
$this->output();
} | php | public function cmdGetModule()
{
$result = $this->getListModule();
$this->outputFormat($result);
$this->outputFormatTableModule($result);
$this->output();
} | [
"public",
"function",
"cmdGetModule",
"(",
")",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"getListModule",
"(",
")",
";",
"$",
"this",
"->",
"outputFormat",
"(",
"$",
"result",
")",
";",
"$",
"this",
"->",
"outputFormatTableModule",
"(",
"$",
"result",... | Callback for "module-get" command | [
"Callback",
"for",
"module",
"-",
"get",
"command"
] | e57dba53e291a225b4bff0c0d9b23d685dd1c125 | https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/Module.php#L117-L123 |
197,041 | OxfordInfoLabs/kinikit-core | src/Util/HTTP/HttpRemoteRequest.php | HttpRemoteRequest.dispatch | public function dispatch($ignoreErrors = true, $timeout = null) {
if (!isset($this->headers)) {
$this->headers = array();
}
if (!isset($this->headers["Content-Type"]))
$this->headers["Content-Type"] = "application/json";
// If we have an auth username and pass... | php | public function dispatch($ignoreErrors = true, $timeout = null) {
if (!isset($this->headers)) {
$this->headers = array();
}
if (!isset($this->headers["Content-Type"]))
$this->headers["Content-Type"] = "application/json";
// If we have an auth username and pass... | [
"public",
"function",
"dispatch",
"(",
"$",
"ignoreErrors",
"=",
"true",
",",
"$",
"timeout",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"headers",
")",
")",
"{",
"$",
"this",
"->",
"headers",
"=",
"array",
"(",
")",
... | Dispatch the request and collect the result.
@return string | [
"Dispatch",
"the",
"request",
"and",
"collect",
"the",
"result",
"."
] | edc1b2e6ffabd595c4c7d322279b3dd1e59ef359 | https://github.com/OxfordInfoLabs/kinikit-core/blob/edc1b2e6ffabd595c4c7d322279b3dd1e59ef359/src/Util/HTTP/HttpRemoteRequest.php#L50-L106 |
197,042 | koolkode/xml | src/XmlStreamReader.php | XmlStreamReader.getNamespaceMappings | public function getNamespaceMappings()
{
$dom = (new XmlDocumentBuilder())->buildDocument($this);
$xpath = new \DOMXPath($dom);
$namespaces = [];
foreach($xpath->query('namespace::*', $dom->documentElement) as $result)
{
$namespaces[(string)$result->prefix] = (string)$result->nodeValue;
}
ret... | php | public function getNamespaceMappings()
{
$dom = (new XmlDocumentBuilder())->buildDocument($this);
$xpath = new \DOMXPath($dom);
$namespaces = [];
foreach($xpath->query('namespace::*', $dom->documentElement) as $result)
{
$namespaces[(string)$result->prefix] = (string)$result->nodeValue;
}
ret... | [
"public",
"function",
"getNamespaceMappings",
"(",
")",
"{",
"$",
"dom",
"=",
"(",
"new",
"XmlDocumentBuilder",
"(",
")",
")",
"->",
"buildDocument",
"(",
"$",
"this",
")",
";",
"$",
"xpath",
"=",
"new",
"\\",
"DOMXPath",
"(",
"$",
"dom",
")",
";",
"... | Get a map of namespaces prefix - URI mappings of the current node, prefixes are keys.
@return array<string, string> | [
"Get",
"a",
"map",
"of",
"namespaces",
"prefix",
"-",
"URI",
"mappings",
"of",
"the",
"current",
"node",
"prefixes",
"are",
"keys",
"."
] | 0ce43b8f56c692dee9f05bb740c2b5f4f419176a | https://github.com/koolkode/xml/blob/0ce43b8f56c692dee9f05bb740c2b5f4f419176a/src/XmlStreamReader.php#L162-L175 |
197,043 | Dhii/placeholder-template | src/AbstractBasePlaceholderTemplateFactory.php | AbstractBasePlaceholderTemplateFactory._make | protected function _make($config = null)
{
$productClassname = $this->_normalizeString($this->_getProductClassname());
if (!$this->_classExists($productClassname)) {
throw $this->_createOutOfRangeException($this->__('Class "%1$s" does not exist', [$productClassname]), null, null, $produc... | php | protected function _make($config = null)
{
$productClassname = $this->_normalizeString($this->_getProductClassname());
if (!$this->_classExists($productClassname)) {
throw $this->_createOutOfRangeException($this->__('Class "%1$s" does not exist', [$productClassname]), null, null, $produc... | [
"protected",
"function",
"_make",
"(",
"$",
"config",
"=",
"null",
")",
"{",
"$",
"productClassname",
"=",
"$",
"this",
"->",
"_normalizeString",
"(",
"$",
"this",
"->",
"_getProductClassname",
"(",
")",
")",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"_c... | Creates a new instance of a placeholder template.
@since [*next-version*]
@param array|ArrayAccess|BaseContainerInterface|stdClass|null $config The make config.
@throws InvalidArgumentException If product classname is not a valid type.
@throws OutOfRangeException If class that the factory is trying to mak... | [
"Creates",
"a",
"new",
"instance",
"of",
"a",
"placeholder",
"template",
"."
] | ab6eb2f98b085dfdf22cf86fd243cd7e6ee68525 | https://github.com/Dhii/placeholder-template/blob/ab6eb2f98b085dfdf22cf86fd243cd7e6ee68525/src/AbstractBasePlaceholderTemplateFactory.php#L68-L78 |
197,044 | wasinger/adaptimage | src/ImagineFilter/FixOrientation.php | FixOrientation.apply | public function apply(ImageInterface $image)
{
// 1 2 3 4 5 6 7 8
//
// 888888 888888 88 88 8888888888 88 88 8888888888
// 88 88 88 88 88 88 88 88 ... | php | public function apply(ImageInterface $image)
{
// 1 2 3 4 5 6 7 8
//
// 888888 888888 88 88 8888888888 88 88 8888888888
// 88 88 88 88 88 88 88 88 ... | [
"public",
"function",
"apply",
"(",
"ImageInterface",
"$",
"image",
")",
"{",
"// 1 2 3 4 5 6 7 8",
"//",
"// 888888 888888 88 88 8888888888 88 88 8888888888",
"// 88 88 ... | Applies scheduled transformation to ImageInterface instance
Returns processed ImageInterface instance
@param ImageInterface $image
@return ImageInterface | [
"Applies",
"scheduled",
"transformation",
"to",
"ImageInterface",
"instance",
"Returns",
"processed",
"ImageInterface",
"instance"
] | 7b529b25081b399451c8bbd56d0cef7daaa83ec4 | https://github.com/wasinger/adaptimage/blob/7b529b25081b399451c8bbd56d0cef7daaa83ec4/src/ImagineFilter/FixOrientation.php#L26-L73 |
197,045 | danielgp/common-lib | source/MySQLiByDanielGPtables.php | MySQLiByDanielGPtables.getFieldOutputNumeric | private function getFieldOutputNumeric($tblSrc, $value, $iar = [])
{
if ($value['EXTRA'] == 'auto_increment') {
return $this->getFieldOutputNumericAI($value, $iar);
}
$fkArray = $this->getForeignKeysToArray($this->advCache['workingDatabase'], $tblSrc, $value['COLUMN_NAME']);
... | php | private function getFieldOutputNumeric($tblSrc, $value, $iar = [])
{
if ($value['EXTRA'] == 'auto_increment') {
return $this->getFieldOutputNumericAI($value, $iar);
}
$fkArray = $this->getForeignKeysToArray($this->advCache['workingDatabase'], $tblSrc, $value['COLUMN_NAME']);
... | [
"private",
"function",
"getFieldOutputNumeric",
"(",
"$",
"tblSrc",
",",
"$",
"value",
",",
"$",
"iar",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"$",
"value",
"[",
"'EXTRA'",
"]",
"==",
"'auto_increment'",
")",
"{",
"return",
"$",
"this",
"->",
"getFieldOut... | Returns a Numeric field 2 use in a form
@param string $tblSrc
@param array $value
@param array $iar
@return string | [
"Returns",
"a",
"Numeric",
"field",
"2",
"use",
"in",
"a",
"form"
] | 627b99b4408414c7cd21a6c8016f6468dc9216b2 | https://github.com/danielgp/common-lib/blob/627b99b4408414c7cd21a6c8016f6468dc9216b2/source/MySQLiByDanielGPtables.php#L49-L60 |
197,046 | danielgp/common-lib | source/MySQLiByDanielGPtables.php | MySQLiByDanielGPtables.getFieldOutputNumericAI | private function getFieldOutputNumericAI($value, $iar = [])
{
if ($this->getFieldValue($value) == '') {
$spF = ['id' => $value['COLUMN_NAME'], 'style' => 'font-style:italic;'];
return $this->setStringIntoTag('auto-numar', 'span', $spF);
}
$inAdtnl = [
'typ... | php | private function getFieldOutputNumericAI($value, $iar = [])
{
if ($this->getFieldValue($value) == '') {
$spF = ['id' => $value['COLUMN_NAME'], 'style' => 'font-style:italic;'];
return $this->setStringIntoTag('auto-numar', 'span', $spF);
}
$inAdtnl = [
'typ... | [
"private",
"function",
"getFieldOutputNumericAI",
"(",
"$",
"value",
",",
"$",
"iar",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"getFieldValue",
"(",
"$",
"value",
")",
"==",
"''",
")",
"{",
"$",
"spF",
"=",
"[",
"'id'",
"=>",
"$",
"... | Handles creation of Auto Increment numeric field type output
@param array $value
@param array $iar
@return string | [
"Handles",
"creation",
"of",
"Auto",
"Increment",
"numeric",
"field",
"type",
"output"
] | 627b99b4408414c7cd21a6c8016f6468dc9216b2 | https://github.com/danielgp/common-lib/blob/627b99b4408414c7cd21a6c8016f6468dc9216b2/source/MySQLiByDanielGPtables.php#L69-L85 |
197,047 | danielgp/common-lib | source/MySQLiByDanielGPtables.php | MySQLiByDanielGPtables.getFieldOutputNumericNonFK | private function getFieldOutputNumericNonFK($fkArray, $value, $iar = [])
{
$query = $this->sQueryGenericSelectKeyValue([
'`' . $value['COLUMN_NAME'] . '`',
$fkArray[$value['COLUMN_NAME']][2],
$fkArray[$value['COLUMN_NAME']][0],
]);
$selectOptions =... | php | private function getFieldOutputNumericNonFK($fkArray, $value, $iar = [])
{
$query = $this->sQueryGenericSelectKeyValue([
'`' . $value['COLUMN_NAME'] . '`',
$fkArray[$value['COLUMN_NAME']][2],
$fkArray[$value['COLUMN_NAME']][0],
]);
$selectOptions =... | [
"private",
"function",
"getFieldOutputNumericNonFK",
"(",
"$",
"fkArray",
",",
"$",
"value",
",",
"$",
"iar",
"=",
"[",
"]",
")",
"{",
"$",
"query",
"=",
"$",
"this",
"->",
"sQueryGenericSelectKeyValue",
"(",
"[",
"'`'",
".",
"$",
"value",
"[",
"'COLUMN_... | Builds field output type for numeric types if not FK
@param array $fkArray
@param array $value
@param array $iar
@return string | [
"Builds",
"field",
"output",
"type",
"for",
"numeric",
"types",
"if",
"not",
"FK"
] | 627b99b4408414c7cd21a6c8016f6468dc9216b2 | https://github.com/danielgp/common-lib/blob/627b99b4408414c7cd21a6c8016f6468dc9216b2/source/MySQLiByDanielGPtables.php#L95-L112 |
197,048 | danielgp/common-lib | source/MySQLiByDanielGPtables.php | MySQLiByDanielGPtables.getFieldOutputTextPrerequisites | private function getFieldOutputTextPrerequisites($tbl, $value)
{
$foreignKeysArray = [];
if (($tbl != 'user_rights') && ($value['COLUMN_NAME'] != 'eid')) {
$database = $this->advCache['workingDatabase'];
if (strpos($tbl, '`.`')) {
$database = substr($tbl, 0, s... | php | private function getFieldOutputTextPrerequisites($tbl, $value)
{
$foreignKeysArray = [];
if (($tbl != 'user_rights') && ($value['COLUMN_NAME'] != 'eid')) {
$database = $this->advCache['workingDatabase'];
if (strpos($tbl, '`.`')) {
$database = substr($tbl, 0, s... | [
"private",
"function",
"getFieldOutputTextPrerequisites",
"(",
"$",
"tbl",
",",
"$",
"value",
")",
"{",
"$",
"foreignKeysArray",
"=",
"[",
"]",
";",
"if",
"(",
"(",
"$",
"tbl",
"!=",
"'user_rights'",
")",
"&&",
"(",
"$",
"value",
"[",
"'COLUMN_NAME'",
"]... | Prepares the text output fields
@param string $tbl
@param array $value
@return array | [
"Prepares",
"the",
"text",
"output",
"fields"
] | 627b99b4408414c7cd21a6c8016f6468dc9216b2 | https://github.com/danielgp/common-lib/blob/627b99b4408414c7cd21a6c8016f6468dc9216b2/source/MySQLiByDanielGPtables.php#L121-L132 |
197,049 | danielgp/common-lib | source/MySQLiByDanielGPtables.php | MySQLiByDanielGPtables.getForeignKeysToArray | private function getForeignKeysToArray($database, $tblName, $oCol = '')
{
if (!isset($this->advCache['tableFKs'][$database][$tblName])) {
$this->setTableForeignKeyCache($database, $this->fixTableSource($tblName));
}
$aRt = [];
if (isset($this->advCache['tableFKs'][$databa... | php | private function getForeignKeysToArray($database, $tblName, $oCol = '')
{
if (!isset($this->advCache['tableFKs'][$database][$tblName])) {
$this->setTableForeignKeyCache($database, $this->fixTableSource($tblName));
}
$aRt = [];
if (isset($this->advCache['tableFKs'][$databa... | [
"private",
"function",
"getForeignKeysToArray",
"(",
"$",
"database",
",",
"$",
"tblName",
",",
"$",
"oCol",
"=",
"''",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"advCache",
"[",
"'tableFKs'",
"]",
"[",
"$",
"database",
"]",
"[",
"$"... | Returns an array with fields referenced by a Foreign key
@param string $database
@param string $tblName
@param string|array $oCol Only column(s) considered
@return array | [
"Returns",
"an",
"array",
"with",
"fields",
"referenced",
"by",
"a",
"Foreign",
"key"
] | 627b99b4408414c7cd21a6c8016f6468dc9216b2 | https://github.com/danielgp/common-lib/blob/627b99b4408414c7cd21a6c8016f6468dc9216b2/source/MySQLiByDanielGPtables.php#L142-L160 |
197,050 | danielgp/common-lib | source/MySQLiByDanielGPtables.php | MySQLiByDanielGPtables.setTableCache | protected function setTableCache($tblSrc)
{
$dat = $this->establishDatabaseAndTable($tblSrc);
if (!isset($this->advCache['tableStructureCache'][$dat[0]][$dat[1]])) {
$this->advCache['workingDatabase'] = $dat[0];
$this->advCache['tableStructureCache'][$da... | php | protected function setTableCache($tblSrc)
{
$dat = $this->establishDatabaseAndTable($tblSrc);
if (!isset($this->advCache['tableStructureCache'][$dat[0]][$dat[1]])) {
$this->advCache['workingDatabase'] = $dat[0];
$this->advCache['tableStructureCache'][$da... | [
"protected",
"function",
"setTableCache",
"(",
"$",
"tblSrc",
")",
"{",
"$",
"dat",
"=",
"$",
"this",
"->",
"establishDatabaseAndTable",
"(",
"$",
"tblSrc",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"advCache",
"[",
"'tableStructureCache'"... | create a Cache for given table to use it in many places
@param string $tblSrc | [
"create",
"a",
"Cache",
"for",
"given",
"table",
"to",
"use",
"it",
"in",
"many",
"places"
] | 627b99b4408414c7cd21a6c8016f6468dc9216b2 | https://github.com/danielgp/common-lib/blob/627b99b4408414c7cd21a6c8016f6468dc9216b2/source/MySQLiByDanielGPtables.php#L167-L178 |
197,051 | ScaraMVC/Framework | src/Scara/Session/File.php | File.content | private function content()
{
$handle = fopen($this->_config, 'r');
$content = @json_decode(stream_get_contents($handle));
return $content;
} | php | private function content()
{
$handle = fopen($this->_config, 'r');
$content = @json_decode(stream_get_contents($handle));
return $content;
} | [
"private",
"function",
"content",
"(",
")",
"{",
"$",
"handle",
"=",
"fopen",
"(",
"$",
"this",
"->",
"_config",
",",
"'r'",
")",
";",
"$",
"content",
"=",
"@",
"json_decode",
"(",
"stream_get_contents",
"(",
"$",
"handle",
")",
")",
";",
"return",
"... | Gets the file session's content.
@return mixed | [
"Gets",
"the",
"file",
"session",
"s",
"content",
"."
] | 199b08b45fadf5dae14ac4732af03b36e15bbef2 | https://github.com/ScaraMVC/Framework/blob/199b08b45fadf5dae14ac4732af03b36e15bbef2/src/Scara/Session/File.php#L121-L127 |
197,052 | ScaraMVC/Framework | src/Scara/Session/File.php | File.write | private function write($content)
{
$handle = fopen($this->_config, 'w+');
fwrite($handle, @json_encode($content));
fclose($handle);
} | php | private function write($content)
{
$handle = fopen($this->_config, 'w+');
fwrite($handle, @json_encode($content));
fclose($handle);
} | [
"private",
"function",
"write",
"(",
"$",
"content",
")",
"{",
"$",
"handle",
"=",
"fopen",
"(",
"$",
"this",
"->",
"_config",
",",
"'w+'",
")",
";",
"fwrite",
"(",
"$",
"handle",
",",
"@",
"json_encode",
"(",
"$",
"content",
")",
")",
";",
"fclose... | Writes session info to file session.
@param mixed $content
@return void | [
"Writes",
"session",
"info",
"to",
"file",
"session",
"."
] | 199b08b45fadf5dae14ac4732af03b36e15bbef2 | https://github.com/ScaraMVC/Framework/blob/199b08b45fadf5dae14ac4732af03b36e15bbef2/src/Scara/Session/File.php#L136-L141 |
197,053 | dmj/PicaRecord | src/HAB/Pica/Record/Subfield.php | Subfield.factory | public static function factory (array $subfield)
{
if (!array_key_exists('code', $subfield)) {
throw new InvalidArgumentException("Missing 'code' index in subfield array");
}
if (!array_key_exists('value', $subfield)) {
throw new InvalidArgumentException("Missing 'val... | php | public static function factory (array $subfield)
{
if (!array_key_exists('code', $subfield)) {
throw new InvalidArgumentException("Missing 'code' index in subfield array");
}
if (!array_key_exists('value', $subfield)) {
throw new InvalidArgumentException("Missing 'val... | [
"public",
"static",
"function",
"factory",
"(",
"array",
"$",
"subfield",
")",
"{",
"if",
"(",
"!",
"array_key_exists",
"(",
"'code'",
",",
"$",
"subfield",
")",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"\"Missing 'code' index in subfield array\"... | Return a new subfield based on its array representation.
The array representation of a subfield is an associative array with the
keys `code' and `value', holding the subfield code and value.
@throws InvalidArgumentException Missing code or value index
@param array $subfield Array representation of a subfield
@retur... | [
"Return",
"a",
"new",
"subfield",
"based",
"on",
"its",
"array",
"representation",
"."
] | bd5577b9a4333aa6156398b94cc870a9377061b8 | https://github.com/dmj/PicaRecord/blob/bd5577b9a4333aa6156398b94cc870a9377061b8/src/HAB/Pica/Record/Subfield.php#L65-L74 |
197,054 | Talesoft/tale-framework | src/Tale/Factory.php | Factory.registerAlias | public function registerAlias($alias, $className)
{
$this->_aliases[$alias] = $this->resolveClassName($className);
return $this;
} | php | public function registerAlias($alias, $className)
{
$this->_aliases[$alias] = $this->resolveClassName($className);
return $this;
} | [
"public",
"function",
"registerAlias",
"(",
"$",
"alias",
",",
"$",
"className",
")",
"{",
"$",
"this",
"->",
"_aliases",
"[",
"$",
"alias",
"]",
"=",
"$",
"this",
"->",
"resolveClassName",
"(",
"$",
"className",
")",
";",
"return",
"$",
"this",
";",
... | Registers a new alias with a specific FQCN
@param string $alias The alias the FQDN can be found under
@param string $className The FQCN the given alias should map to
@return $this | [
"Registers",
"a",
"new",
"alias",
"with",
"a",
"specific",
"FQCN"
] | 739a7011c6dad409a51c4bcfbcf4b4ffbc8cba49 | https://github.com/Talesoft/tale-framework/blob/739a7011c6dad409a51c4bcfbcf4b4ffbc8cba49/src/Tale/Factory.php#L78-L84 |
197,055 | Talesoft/tale-framework | src/Tale/Factory.php | Factory.registerAliases | public function registerAliases(array $aliases)
{
foreach ($aliases as $alias => $className)
$this->registerAlias($alias, $className);
return $this;
} | php | public function registerAliases(array $aliases)
{
foreach ($aliases as $alias => $className)
$this->registerAlias($alias, $className);
return $this;
} | [
"public",
"function",
"registerAliases",
"(",
"array",
"$",
"aliases",
")",
"{",
"foreach",
"(",
"$",
"aliases",
"as",
"$",
"alias",
"=>",
"$",
"className",
")",
"$",
"this",
"->",
"registerAlias",
"(",
"$",
"alias",
",",
"$",
"className",
")",
";",
"r... | Registers an array of aliases.
The aliases should be the keys, the FQCNs the values of the associative array
@param array $aliases Associative array of aliases => FQCNs
@return $this | [
"Registers",
"an",
"array",
"of",
"aliases",
".",
"The",
"aliases",
"should",
"be",
"the",
"keys",
"the",
"FQCNs",
"the",
"values",
"of",
"the",
"associative",
"array"
] | 739a7011c6dad409a51c4bcfbcf4b4ffbc8cba49 | https://github.com/Talesoft/tale-framework/blob/739a7011c6dad409a51c4bcfbcf4b4ffbc8cba49/src/Tale/Factory.php#L94-L101 |
197,056 | Talesoft/tale-framework | src/Tale/Factory.php | Factory.resolveClassName | public function resolveClassName($className)
{
if (isset($this->_aliases[$className]))
$className = $this->_aliases[$className];
return $className;
} | php | public function resolveClassName($className)
{
if (isset($this->_aliases[$className]))
$className = $this->_aliases[$className];
return $className;
} | [
"public",
"function",
"resolveClassName",
"(",
"$",
"className",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"_aliases",
"[",
"$",
"className",
"]",
")",
")",
"$",
"className",
"=",
"$",
"this",
"->",
"_aliases",
"[",
"$",
"className",
"]",
... | Resolves a a class-name or an alias to a FQCN
If no alias is found, it returns the class name given
@param string $className The class-name to be converted
@return string The usable FQCN of the class | [
"Resolves",
"a",
"a",
"class",
"-",
"name",
"or",
"an",
"alias",
"to",
"a",
"FQCN"
] | 739a7011c6dad409a51c4bcfbcf4b4ffbc8cba49 | https://github.com/Talesoft/tale-framework/blob/739a7011c6dad409a51c4bcfbcf4b4ffbc8cba49/src/Tale/Factory.php#L113-L120 |
197,057 | Talesoft/tale-framework | src/Tale/Factory.php | Factory.createInstance | public function createInstance($className, array $args = null)
{
$args = $args ? $args : [];
$className = $this->resolveClassName($className);
if (!class_exists($className) || ($this->_baseClassName && !is_subclass_of($className, $this->_baseClassName)))
throw new FactoryExcept... | php | public function createInstance($className, array $args = null)
{
$args = $args ? $args : [];
$className = $this->resolveClassName($className);
if (!class_exists($className) || ($this->_baseClassName && !is_subclass_of($className, $this->_baseClassName)))
throw new FactoryExcept... | [
"public",
"function",
"createInstance",
"(",
"$",
"className",
",",
"array",
"$",
"args",
"=",
"null",
")",
"{",
"$",
"args",
"=",
"$",
"args",
"?",
"$",
"args",
":",
"[",
"]",
";",
"$",
"className",
"=",
"$",
"this",
"->",
"resolveClassName",
"(",
... | Creates a new instance of a class based on a class name or alias given.
If the class doesnt exist or doesnt extend the base-class of this factory,
a RuntimeException is thrown
Uses Reflection internally
@see ReflectionClass->newInstanceArgs
@param string $className The alias or FQCN to instanciate
@param array|... | [
"Creates",
"a",
"new",
"instance",
"of",
"a",
"class",
"based",
"on",
"a",
"class",
"name",
"or",
"alias",
"given",
"."
] | 739a7011c6dad409a51c4bcfbcf4b4ffbc8cba49 | https://github.com/Talesoft/tale-framework/blob/739a7011c6dad409a51c4bcfbcf4b4ffbc8cba49/src/Tale/Factory.php#L139-L154 |
197,058 | eloquent/blox | src/Element/DocumentationBlock.php | DocumentationBlock.tagsByName | public function tagsByName($name)
{
$tags = array();
foreach ($this->tags() as $tag) {
if ($name === $tag->name()) {
$tags[] = $tag;
}
}
return $tags;
} | php | public function tagsByName($name)
{
$tags = array();
foreach ($this->tags() as $tag) {
if ($name === $tag->name()) {
$tags[] = $tag;
}
}
return $tags;
} | [
"public",
"function",
"tagsByName",
"(",
"$",
"name",
")",
"{",
"$",
"tags",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"tags",
"(",
")",
"as",
"$",
"tag",
")",
"{",
"if",
"(",
"$",
"name",
"===",
"$",
"tag",
"->",
"name",
... | Get all the tags of this block with a specific tag name.
@param string $name The tag name to search for.
@return array<DocumentationTag> The tags with a matching tag name. | [
"Get",
"all",
"the",
"tags",
"of",
"this",
"block",
"with",
"a",
"specific",
"tag",
"name",
"."
] | dcfe82a0a703124ab5807d894979530d6fdb536b | https://github.com/eloquent/blox/blob/dcfe82a0a703124ab5807d894979530d6fdb536b/src/Element/DocumentationBlock.php#L57-L67 |
197,059 | vpg/titon.utility | src/Titon/Utility/Number.php | Number.bytesTo | public static function bytesTo($size, $precision = 0) {
$sizes = array('YB', 'ZB', 'EB', 'PB', 'TB', 'GB', 'MB', 'KB', 'B');
$total = count($sizes);
while ($total-- && $size >= 1024) {
$size /= 1024;
}
return static::precision($size, $precision) . $sizes[$total];
... | php | public static function bytesTo($size, $precision = 0) {
$sizes = array('YB', 'ZB', 'EB', 'PB', 'TB', 'GB', 'MB', 'KB', 'B');
$total = count($sizes);
while ($total-- && $size >= 1024) {
$size /= 1024;
}
return static::precision($size, $precision) . $sizes[$total];
... | [
"public",
"static",
"function",
"bytesTo",
"(",
"$",
"size",
",",
"$",
"precision",
"=",
"0",
")",
"{",
"$",
"sizes",
"=",
"array",
"(",
"'YB'",
",",
"'ZB'",
",",
"'EB'",
",",
"'PB'",
",",
"'TB'",
",",
"'GB'",
",",
"'MB'",
",",
"'KB'",
",",
"'B'"... | Convert a numerical value to the readable string notated equivalent.
@param int $size
@param int $precision
@return string | [
"Convert",
"a",
"numerical",
"value",
"to",
"the",
"readable",
"string",
"notated",
"equivalent",
"."
] | 8a77eb9e7b8baacf41cc25487289779d8319cd3a | https://github.com/vpg/titon.utility/blob/8a77eb9e7b8baacf41cc25487289779d8319cd3a/src/Titon/Utility/Number.php#L70-L79 |
197,060 | vpg/titon.utility | src/Titon/Utility/Number.php | Number.convert | public static function convert($no, $fromBase, $toBase) {
if ($fromBase == $toBase) {
return $no;
}
return base_convert($no, $fromBase, $toBase);
} | php | public static function convert($no, $fromBase, $toBase) {
if ($fromBase == $toBase) {
return $no;
}
return base_convert($no, $fromBase, $toBase);
} | [
"public",
"static",
"function",
"convert",
"(",
"$",
"no",
",",
"$",
"fromBase",
",",
"$",
"toBase",
")",
"{",
"if",
"(",
"$",
"fromBase",
"==",
"$",
"toBase",
")",
"{",
"return",
"$",
"no",
";",
"}",
"return",
"base_convert",
"(",
"$",
"no",
",",
... | Convert a number from one base to another.
@param int $no
@param int $fromBase
@param int $toBase
@return int | [
"Convert",
"a",
"number",
"from",
"one",
"base",
"to",
"another",
"."
] | 8a77eb9e7b8baacf41cc25487289779d8319cd3a | https://github.com/vpg/titon.utility/blob/8a77eb9e7b8baacf41cc25487289779d8319cd3a/src/Titon/Utility/Number.php#L89-L95 |
197,061 | vpg/titon.utility | src/Titon/Utility/Number.php | Number.currency | public static function currency($number, array $options = array()) {
$defaults = array(
'thousands' => ',',
'decimals' => '.',
'places' => 2,
'code' => 'USD #',
'dollar' => '$#',
'cents' => '#¢',
'use' => 'dollar',
... | php | public static function currency($number, array $options = array()) {
$defaults = array(
'thousands' => ',',
'decimals' => '.',
'places' => 2,
'code' => 'USD #',
'dollar' => '$#',
'cents' => '#¢',
'use' => 'dollar',
... | [
"public",
"static",
"function",
"currency",
"(",
"$",
"number",
",",
"array",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"$",
"defaults",
"=",
"array",
"(",
"'thousands'",
"=>",
"','",
",",
"'decimals'",
"=>",
"'.'",
",",
"'places'",
"=>",
"2",
... | Convert a number to it's currency equivalent, respecting locale.
Allow for overrides through an options array.
@param int $number
@param array $options {
@type string $thousands Character used for thousands place
@type string $decimals Character used for decimal
@type int $places Decimal (cent) limit
@type stri... | [
"Convert",
"a",
"number",
"to",
"it",
"s",
"currency",
"equivalent",
"respecting",
"locale",
".",
"Allow",
"for",
"overrides",
"through",
"an",
"options",
"array",
"."
] | 8a77eb9e7b8baacf41cc25487289779d8319cd3a | https://github.com/vpg/titon.utility/blob/8a77eb9e7b8baacf41cc25487289779d8319cd3a/src/Titon/Utility/Number.php#L114-L148 |
197,062 | vpg/titon.utility | src/Titon/Utility/Number.php | Number.percentage | public static function percentage($number, $options = array()) {
if (!is_array($options)) {
$options = array('places' => $options);
}
$options = $options + array(
'thousands' => ',',
'decimals' => '.',
'places' => 2
);
return numb... | php | public static function percentage($number, $options = array()) {
if (!is_array($options)) {
$options = array('places' => $options);
}
$options = $options + array(
'thousands' => ',',
'decimals' => '.',
'places' => 2
);
return numb... | [
"public",
"static",
"function",
"percentage",
"(",
"$",
"number",
",",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"options",
")",
")",
"{",
"$",
"options",
"=",
"array",
"(",
"'places'",
"=>",
"$",
"opti... | Convert a number to a percentage string with decimal and comma separations.
@param int $number
@param int|array $options {
@type string $thousands Character used for thousands place
@type string $decimals Character used for decimal
@type int $places Decimal (cent) limit
}
@return string | [
"Convert",
"a",
"number",
"to",
"a",
"percentage",
"string",
"with",
"decimal",
"and",
"comma",
"separations",
"."
] | 8a77eb9e7b8baacf41cc25487289779d8319cd3a | https://github.com/vpg/titon.utility/blob/8a77eb9e7b8baacf41cc25487289779d8319cd3a/src/Titon/Utility/Number.php#L268-L280 |
197,063 | WellCommerce/CurrencyBundle | EventListener/CurrencySubscriber.php | CurrencySubscriber.getLocaleCurrency | protected function getLocaleCurrency(Request $request)
{
$currentLocale = $request->getLocale();
$locale = $this->container->get('locale.repository')->findOneBy(['code' => $currentLocale]);
if (null !== $locale && $locale->getCurrency() instanceof Currency) {
return $loca... | php | protected function getLocaleCurrency(Request $request)
{
$currentLocale = $request->getLocale();
$locale = $this->container->get('locale.repository')->findOneBy(['code' => $currentLocale]);
if (null !== $locale && $locale->getCurrency() instanceof Currency) {
return $loca... | [
"protected",
"function",
"getLocaleCurrency",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"currentLocale",
"=",
"$",
"request",
"->",
"getLocale",
"(",
")",
";",
"$",
"locale",
"=",
"$",
"this",
"->",
"container",
"->",
"get",
"(",
"'locale.repository'",
... | Returns the currency code for active locale
@param Request $request
@return string | [
"Returns",
"the",
"currency",
"code",
"for",
"active",
"locale"
] | 48a6995eedb9c1f93d10751a6d1070e4cbca307e | https://github.com/WellCommerce/CurrencyBundle/blob/48a6995eedb9c1f93d10751a6d1070e4cbca307e/EventListener/CurrencySubscriber.php#L54-L64 |
197,064 | lanfisis/deflection | src/Deflection/Generator.php | Generator.asString | public function asString()
{
$display = function ($lines, $length, $loop = 0) use (&$display) {
$output = '';
foreach ($lines as $line) {
$line = is_a($line, 'Deflection\Element\AbstractElement') ? $line->getElement() : $line;
if (is_array($line)) {
... | php | public function asString()
{
$display = function ($lines, $length, $loop = 0) use (&$display) {
$output = '';
foreach ($lines as $line) {
$line = is_a($line, 'Deflection\Element\AbstractElement') ? $line->getElement() : $line;
if (is_array($line)) {
... | [
"public",
"function",
"asString",
"(",
")",
"{",
"$",
"display",
"=",
"function",
"(",
"$",
"lines",
",",
"$",
"length",
",",
"$",
"loop",
"=",
"0",
")",
"use",
"(",
"&",
"$",
"display",
")",
"{",
"$",
"output",
"=",
"''",
";",
"foreach",
"(",
... | Returns class definition as a string
@return string | [
"Returns",
"class",
"definition",
"as",
"a",
"string"
] | 31deaf7f085d6456d8a323e7ac3cc9914fbe49a9 | https://github.com/lanfisis/deflection/blob/31deaf7f085d6456d8a323e7ac3cc9914fbe49a9/src/Deflection/Generator.php#L46-L62 |
197,065 | TuumPHP/Web | src/Stack/ViewStack.php | ViewStack.streamView | private function streamView($response)
{
if (Response::isError($response) &&
!$response->getBody() instanceof ViewStream
) {
$response = $this->setErrorView($response);
return $response;
}
return $response;
} | php | private function streamView($response)
{
if (Response::isError($response) &&
!$response->getBody() instanceof ViewStream
) {
$response = $this->setErrorView($response);
return $response;
}
return $response;
} | [
"private",
"function",
"streamView",
"(",
"$",
"response",
")",
"{",
"if",
"(",
"Response",
"::",
"isError",
"(",
"$",
"response",
")",
"&&",
"!",
"$",
"response",
"->",
"getBody",
"(",
")",
"instanceof",
"ViewStream",
")",
"{",
"$",
"response",
"=",
"... | fill up contents for VIEW and ERROR responses.
@param Response $response
@return Response | [
"fill",
"up",
"contents",
"for",
"VIEW",
"and",
"ERROR",
"responses",
"."
] | 8f296b6358aa93226ce08d6cc54a309f5b0a9820 | https://github.com/TuumPHP/Web/blob/8f296b6358aa93226ce08d6cc54a309f5b0a9820/src/Stack/ViewStack.php#L89-L98 |
197,066 | TuumPHP/Web | src/Stack/ViewStack.php | ViewStack.setErrorView | private function setErrorView($response)
{
if (Response::isServerError($response) && $this->logger) {
$this->logger->error('received a server error response: ' . $response->getStatusCode());
}
$stream = $this->error->getStream($response->getStatusCode(), $response->getData());
... | php | private function setErrorView($response)
{
if (Response::isServerError($response) && $this->logger) {
$this->logger->error('received a server error response: ' . $response->getStatusCode());
}
$stream = $this->error->getStream($response->getStatusCode(), $response->getData());
... | [
"private",
"function",
"setErrorView",
"(",
"$",
"response",
")",
"{",
"if",
"(",
"Response",
"::",
"isServerError",
"(",
"$",
"response",
")",
"&&",
"$",
"this",
"->",
"logger",
")",
"{",
"$",
"this",
"->",
"logger",
"->",
"error",
"(",
"'received a ser... | render error pages.
@param Response $response
@return Response | [
"render",
"error",
"pages",
"."
] | 8f296b6358aa93226ce08d6cc54a309f5b0a9820 | https://github.com/TuumPHP/Web/blob/8f296b6358aa93226ce08d6cc54a309f5b0a9820/src/Stack/ViewStack.php#L106-L114 |
197,067 | DoSomething/mobilecommons-php | lib/MobileCommons/Request.php | Request.call | public function call($resource, $params = array(), $method = 'GET')
{
if (!empty($params) && is_array($params)) {
$queryString = http_build_query($params);
}
else {
$queryString = '';
}
$requestUrl = self::API_URL . $resource . ((strtolower($method) == 'g... | php | public function call($resource, $params = array(), $method = 'GET')
{
if (!empty($params) && is_array($params)) {
$queryString = http_build_query($params);
}
else {
$queryString = '';
}
$requestUrl = self::API_URL . $resource . ((strtolower($method) == 'g... | [
"public",
"function",
"call",
"(",
"$",
"resource",
",",
"$",
"params",
"=",
"array",
"(",
")",
",",
"$",
"method",
"=",
"'GET'",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"params",
")",
"&&",
"is_array",
"(",
"$",
"params",
")",
")",
"{",
"... | Make an api request
@param string $resource
@param array $params
@param string $method | [
"Make",
"an",
"api",
"request"
] | a820ee196d3166f827c30af69902ffb417674890 | https://github.com/DoSomething/mobilecommons-php/blob/a820ee196d3166f827c30af69902ffb417674890/lib/MobileCommons/Request.php#L103-L153 |
197,068 | DoSomething/mobilecommons-php | lib/MobileCommons/Request.php | Request.webform | public function webform($action, $params, $friends = array()) {
$url = self::WEBFORM_URL . $action;
$header = sprintf("Authorization: Basic %s\r\n", base64_encode($this->getAuthenticationString()));
$header .= "Content-type: application/x-www-form-urlencoded\r\n";
$params = http_build_... | php | public function webform($action, $params, $friends = array()) {
$url = self::WEBFORM_URL . $action;
$header = sprintf("Authorization: Basic %s\r\n", base64_encode($this->getAuthenticationString()));
$header .= "Content-type: application/x-www-form-urlencoded\r\n";
$params = http_build_... | [
"public",
"function",
"webform",
"(",
"$",
"action",
",",
"$",
"params",
",",
"$",
"friends",
"=",
"array",
"(",
")",
")",
"{",
"$",
"url",
"=",
"self",
"::",
"WEBFORM_URL",
".",
"$",
"action",
";",
"$",
"header",
"=",
"sprintf",
"(",
"\"Authorizatio... | Make a request to the Web Form API.
@param string $action
@param array $params
@param array $friends
@return string | [
"Make",
"a",
"request",
"to",
"the",
"Web",
"Form",
"API",
"."
] | a820ee196d3166f827c30af69902ffb417674890 | https://github.com/DoSomething/mobilecommons-php/blob/a820ee196d3166f827c30af69902ffb417674890/lib/MobileCommons/Request.php#L163-L189 |
197,069 | yivi/VerySimpleHtmlWriter | src/VerySimpleHtmlWriter/Tag.php | Tag.addClass | public function addClass( string $class ): Tag
{
if ( ! isset( $this->attributes['class'] ) ) {
$this->attributes['class'] = $class;
} else {
$this->attributes['class'] .= " $class";
}
return $this;
} | php | public function addClass( string $class ): Tag
{
if ( ! isset( $this->attributes['class'] ) ) {
$this->attributes['class'] = $class;
} else {
$this->attributes['class'] .= " $class";
}
return $this;
} | [
"public",
"function",
"addClass",
"(",
"string",
"$",
"class",
")",
":",
"Tag",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"attributes",
"[",
"'class'",
"]",
")",
")",
"{",
"$",
"this",
"->",
"attributes",
"[",
"'class'",
"]",
"=",
"$",
... | Convenience method to add a "class" to a tag.
@param string $class
@return Tag | [
"Convenience",
"method",
"to",
"add",
"a",
"class",
"to",
"a",
"tag",
"."
] | d777e3f046e3fba25790cd10ee42ee226cba0710 | https://github.com/yivi/VerySimpleHtmlWriter/blob/d777e3f046e3fba25790cd10ee42ee226cba0710/src/VerySimpleHtmlWriter/Tag.php#L148-L158 |
197,070 | crazy-cats/framework | src/Utility/Profile.php | Profile.start | static public function start( $name )
{
if ( !ObjectManager::getInstance()->get( Config::class )->getValue( 'profile' ) ) {
return;
}
if ( !isset( self::$profileNames[$name] ) ) {
self::$profileNames[$name] = 0;
}
$realName = $name . '_' . self::$prof... | php | static public function start( $name )
{
if ( !ObjectManager::getInstance()->get( Config::class )->getValue( 'profile' ) ) {
return;
}
if ( !isset( self::$profileNames[$name] ) ) {
self::$profileNames[$name] = 0;
}
$realName = $name . '_' . self::$prof... | [
"static",
"public",
"function",
"start",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"!",
"ObjectManager",
"::",
"getInstance",
"(",
")",
"->",
"get",
"(",
"Config",
"::",
"class",
")",
"->",
"getValue",
"(",
"'profile'",
")",
")",
"{",
"return",
";",
"}"... | Set start point for a new profile
@param string $name | [
"Set",
"start",
"point",
"for",
"a",
"new",
"profile"
] | 5ea53d3f97689a301782c0d3d7b924d763420c66 | https://github.com/crazy-cats/framework/blob/5ea53d3f97689a301782c0d3d7b924d763420c66/src/Utility/Profile.php#L108-L124 |
197,071 | crazy-cats/framework | src/Utility/Profile.php | Profile.end | static public function end( $name )
{
if ( !ObjectManager::getInstance()->get( Config::class )->getValue( 'profile' ) ) {
return;
}
if ( $name != self::getName( self::$currentProfileNames[count( self::$currentProfileNames ) - 1] ) ) {
throw new \Exception( sprintf( '... | php | static public function end( $name )
{
if ( !ObjectManager::getInstance()->get( Config::class )->getValue( 'profile' ) ) {
return;
}
if ( $name != self::getName( self::$currentProfileNames[count( self::$currentProfileNames ) - 1] ) ) {
throw new \Exception( sprintf( '... | [
"static",
"public",
"function",
"end",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"!",
"ObjectManager",
"::",
"getInstance",
"(",
")",
"->",
"get",
"(",
"Config",
"::",
"class",
")",
"->",
"getValue",
"(",
"'profile'",
")",
")",
"{",
"return",
";",
"}",
... | Set end point for an exist profile
@param string $name | [
"Set",
"end",
"point",
"for",
"an",
"exist",
"profile"
] | 5ea53d3f97689a301782c0d3d7b924d763420c66 | https://github.com/crazy-cats/framework/blob/5ea53d3f97689a301782c0d3d7b924d763420c66/src/Utility/Profile.php#L130-L145 |
197,072 | anime-db/item-folder-filler-bundle | src/Service/FillerFolder.php | FillerFolder.buildMenu | public function buildMenu(ItemInterface $node, ItemEntity $item)
{
if ($item->getPath() && $this->fs->exists($item->getPath())) {
$node->addChild('Fill folder', [
'route' => 'item_folder_filler_fill',
'routeParameters' => [
'id' => $item->getId... | php | public function buildMenu(ItemInterface $node, ItemEntity $item)
{
if ($item->getPath() && $this->fs->exists($item->getPath())) {
$node->addChild('Fill folder', [
'route' => 'item_folder_filler_fill',
'routeParameters' => [
'id' => $item->getId... | [
"public",
"function",
"buildMenu",
"(",
"ItemInterface",
"$",
"node",
",",
"ItemEntity",
"$",
"item",
")",
"{",
"if",
"(",
"$",
"item",
"->",
"getPath",
"(",
")",
"&&",
"$",
"this",
"->",
"fs",
"->",
"exists",
"(",
"$",
"item",
"->",
"getPath",
"(",
... | Build menu for plugin
@param \Knp\Menu\ItemInterface $node
@param \AnimeDb\Bundle\CatalogBundle\Entity\Item $item
@return \Knp\Menu\ItemInterface | [
"Build",
"menu",
"for",
"plugin"
] | 9b5d02628fa235171a42123aaa9b54ddab5d94d1 | https://github.com/anime-db/item-folder-filler-bundle/blob/9b5d02628fa235171a42123aaa9b54ddab5d94d1/src/Service/FillerFolder.php#L104-L116 |
197,073 | anime-db/item-folder-filler-bundle | src/Service/FillerFolder.php | FillerFolder.getCover | protected function getCover(ItemEntity $item)
{
$from = $this->root.$item->getDownloadPath().'/'.$item->getCover();
if (!$this->fs->exists($from)) {
return '';
}
// copy cover
$target = $item->getPath().'/';
$filename = self::COVER_FILENAME.'.'.pathinfo($... | php | protected function getCover(ItemEntity $item)
{
$from = $this->root.$item->getDownloadPath().'/'.$item->getCover();
if (!$this->fs->exists($from)) {
return '';
}
// copy cover
$target = $item->getPath().'/';
$filename = self::COVER_FILENAME.'.'.pathinfo($... | [
"protected",
"function",
"getCover",
"(",
"ItemEntity",
"$",
"item",
")",
"{",
"$",
"from",
"=",
"$",
"this",
"->",
"root",
".",
"$",
"item",
"->",
"getDownloadPath",
"(",
")",
".",
"'/'",
".",
"$",
"item",
"->",
"getCover",
"(",
")",
";",
"if",
"(... | Get cover filename
@param \AnimeDb\Bundle\CatalogBundle\Entity\Item $item
@return string | [
"Get",
"cover",
"filename"
] | 9b5d02628fa235171a42123aaa9b54ddab5d94d1 | https://github.com/anime-db/item-folder-filler-bundle/blob/9b5d02628fa235171a42123aaa9b54ddab5d94d1/src/Service/FillerFolder.php#L144-L160 |
197,074 | anime-db/item-folder-filler-bundle | src/Service/FillerFolder.php | FillerFolder.getInfo | protected function getInfo(ItemEntity $item)
{
$filename = self::INFO_FILENAME.'.html';
if (is_file($item->getPath())) {
return dirname($item->getPath()).pathinfo($item->getPath(), PATHINFO_FILENAME).'-'.$filename;
} else {
return $item->getPath().'/'.$filename;
... | php | protected function getInfo(ItemEntity $item)
{
$filename = self::INFO_FILENAME.'.html';
if (is_file($item->getPath())) {
return dirname($item->getPath()).pathinfo($item->getPath(), PATHINFO_FILENAME).'-'.$filename;
} else {
return $item->getPath().'/'.$filename;
... | [
"protected",
"function",
"getInfo",
"(",
"ItemEntity",
"$",
"item",
")",
"{",
"$",
"filename",
"=",
"self",
"::",
"INFO_FILENAME",
".",
"'.html'",
";",
"if",
"(",
"is_file",
"(",
"$",
"item",
"->",
"getPath",
"(",
")",
")",
")",
"{",
"return",
"dirname... | Get info filename
@param \AnimeDb\Bundle\CatalogBundle\Entity\Item $item
@return string | [
"Get",
"info",
"filename"
] | 9b5d02628fa235171a42123aaa9b54ddab5d94d1 | https://github.com/anime-db/item-folder-filler-bundle/blob/9b5d02628fa235171a42123aaa9b54ddab5d94d1/src/Service/FillerFolder.php#L169-L177 |
197,075 | phpgears/event | src/AbstractEventHandler.php | AbstractEventHandler.isEventSupported | private function isEventSupported(Event $event): bool
{
$supported = false;
foreach ($this->getSupportedEventTypes() as $supportedEventType) {
if (\is_a($event, $supportedEventType)) {
$supported = true;
break;
}
}
return $su... | php | private function isEventSupported(Event $event): bool
{
$supported = false;
foreach ($this->getSupportedEventTypes() as $supportedEventType) {
if (\is_a($event, $supportedEventType)) {
$supported = true;
break;
}
}
return $su... | [
"private",
"function",
"isEventSupported",
"(",
"Event",
"$",
"event",
")",
":",
"bool",
"{",
"$",
"supported",
"=",
"false",
";",
"foreach",
"(",
"$",
"this",
"->",
"getSupportedEventTypes",
"(",
")",
"as",
"$",
"supportedEventType",
")",
"{",
"if",
"(",
... | Is event supported.
@param Event $event
@return bool | [
"Is",
"event",
"supported",
"."
] | 9b25301837748a67b3b48cc46ad837c859c4522d | https://github.com/phpgears/event/blob/9b25301837748a67b3b48cc46ad837c859c4522d/src/AbstractEventHandler.php#L45-L58 |
197,076 | ibonly/Potato-ORM | src/Helper/Schema.php | Schema.dateTime | public function dateTime($value, $type = NULL)
{
$apend = "";
switch ($type) {
case 'time':
$apend = 'time';
break;
case 'timestamp':
$apend = 'timestamp';
break;
case 'date':
... | php | public function dateTime($value, $type = NULL)
{
$apend = "";
switch ($type) {
case 'time':
$apend = 'time';
break;
case 'timestamp':
$apend = 'timestamp';
break;
case 'date':
... | [
"public",
"function",
"dateTime",
"(",
"$",
"value",
",",
"$",
"type",
"=",
"NULL",
")",
"{",
"$",
"apend",
"=",
"\"\"",
";",
"switch",
"(",
"$",
"type",
")",
"{",
"case",
"'time'",
":",
"$",
"apend",
"=",
"'time'",
";",
"break",
";",
"case",
"'t... | dateTime description]
@param [type] $value [description]
@param [type] $type [description]
@return [type] [description] | [
"dateTime",
"description",
"]"
] | 644962a99e1c0191b732d7729cd466d52c5d8652 | https://github.com/ibonly/Potato-ORM/blob/644962a99e1c0191b732d7729cd466d52c5d8652/src/Helper/Schema.php#L182-L206 |
197,077 | Kris-Kuiper/sFire-Framework | src/Form/Traits/FormTrait.php | FormTrait.value | public function value($value = null) {
if(null !== $value && false === is_string($value) && false === is_numeric($value)) {
return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string or number, "%s" given', __METHOD__, gettype($value)), E_USER_ERROR);
}
... | php | public function value($value = null) {
if(null !== $value && false === is_string($value) && false === is_numeric($value)) {
return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string or number, "%s" given', __METHOD__, gettype($value)), E_USER_ERROR);
}
... | [
"public",
"function",
"value",
"(",
"$",
"value",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"value",
"&&",
"false",
"===",
"is_string",
"(",
"$",
"value",
")",
"&&",
"false",
"===",
"is_numeric",
"(",
"$",
"value",
")",
")",
"{",
"retur... | Set a new value for input
@param string $value
@return sFire\Form\Traits\FormTrait | [
"Set",
"a",
"new",
"value",
"for",
"input"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/Form/Traits/FormTrait.php#L85-L95 |
197,078 | Kris-Kuiper/sFire-Framework | src/Form/Traits/FormTrait.php | FormTrait.name | public function name($name = null) {
if(null !== $name && false === is_string($name) && false === is_numeric($name)) {
return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string or number, "%s" given', __METHOD__, gettype($name)), E_USER_ERROR);
}
$thi... | php | public function name($name = null) {
if(null !== $name && false === is_string($name) && false === is_numeric($name)) {
return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string or number, "%s" given', __METHOD__, gettype($name)), E_USER_ERROR);
}
$thi... | [
"public",
"function",
"name",
"(",
"$",
"name",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"name",
"&&",
"false",
"===",
"is_string",
"(",
"$",
"name",
")",
"&&",
"false",
"===",
"is_numeric",
"(",
"$",
"name",
")",
")",
"{",
"return",
... | Set a new name for input
@param string $name
@return sFire\Form\Traits\FormTrait | [
"Set",
"a",
"new",
"name",
"for",
"input"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/Form/Traits/FormTrait.php#L103-L113 |
197,079 | Kris-Kuiper/sFire-Framework | src/Form/Traits/FormTrait.php | FormTrait.attributes | public function attributes($attributes) {
if(false === is_array($attributes)) {
return trigger_error(sprintf('Argument 1 passed to %s() must be of the type array, "%s" given', __METHOD__, gettype($attributes)), E_USER_ERROR);
}
$this -> attributes = array_merge($this ... | php | public function attributes($attributes) {
if(false === is_array($attributes)) {
return trigger_error(sprintf('Argument 1 passed to %s() must be of the type array, "%s" given', __METHOD__, gettype($attributes)), E_USER_ERROR);
}
$this -> attributes = array_merge($this ... | [
"public",
"function",
"attributes",
"(",
"$",
"attributes",
")",
"{",
"if",
"(",
"false",
"===",
"is_array",
"(",
"$",
"attributes",
")",
")",
"{",
"return",
"trigger_error",
"(",
"sprintf",
"(",
"'Argument 1 passed to %s() must be of the type array, \"%s\" given'",
... | Set new attributes for input
@param array $attributes
@return sFire\Form\Traits\FormTrait | [
"Set",
"new",
"attributes",
"for",
"input"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/Form/Traits/FormTrait.php#L121-L130 |
197,080 | Kris-Kuiper/sFire-Framework | src/Form/Traits/FormTrait.php | FormTrait.filled | public function filled($filled) {
if(false === is_bool($filled)) {
return trigger_error(sprintf('Argument 1 passed to %s() must be of the type boolean, "%s" given', __METHOD__, gettype($filled)), E_USER_ERROR);
}
$this -> filled = $filled;
return $this;
... | php | public function filled($filled) {
if(false === is_bool($filled)) {
return trigger_error(sprintf('Argument 1 passed to %s() must be of the type boolean, "%s" given', __METHOD__, gettype($filled)), E_USER_ERROR);
}
$this -> filled = $filled;
return $this;
... | [
"public",
"function",
"filled",
"(",
"$",
"filled",
")",
"{",
"if",
"(",
"false",
"===",
"is_bool",
"(",
"$",
"filled",
")",
")",
"{",
"return",
"trigger_error",
"(",
"sprintf",
"(",
"'Argument 1 passed to %s() must be of the type boolean, \"%s\" given'",
",",
"__... | Set if input should be automaticly filled or not
@param boolean $filled
@return sFire\Form\Traits\FormTrait | [
"Set",
"if",
"input",
"should",
"be",
"automaticly",
"filled",
"or",
"not"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/Form/Traits/FormTrait.php#L138-L147 |
197,081 | Kris-Kuiper/sFire-Framework | src/Form/Traits/FormTrait.php | FormTrait.onerror | public function onerror($attributes) {
if(false === is_array($attributes)) {
return trigger_error(sprintf('Argument 1 passed to %s() must be of the type array, "%s" given', __METHOD__, gettype($attributes)), E_USER_ERROR);
}
if(true === isset($this -> attributes['name'])) {
... | php | public function onerror($attributes) {
if(false === is_array($attributes)) {
return trigger_error(sprintf('Argument 1 passed to %s() must be of the type array, "%s" given', __METHOD__, gettype($attributes)), E_USER_ERROR);
}
if(true === isset($this -> attributes['name'])) {
... | [
"public",
"function",
"onerror",
"(",
"$",
"attributes",
")",
"{",
"if",
"(",
"false",
"===",
"is_array",
"(",
"$",
"attributes",
")",
")",
"{",
"return",
"trigger_error",
"(",
"sprintf",
"(",
"'Argument 1 passed to %s() must be of the type array, \"%s\" given'",
",... | Merges the given attributes with the already existing attributes on error
@param array $attributes
@return sFire\Form\Traits\FormTrait | [
"Merges",
"the",
"given",
"attributes",
"with",
"the",
"already",
"existing",
"attributes",
"on",
"error"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/Form/Traits/FormTrait.php#L155-L173 |
197,082 | Kris-Kuiper/sFire-Framework | src/Form/Traits/FormTrait.php | FormTrait.fill | private function fill() {
//Prefill value
if(true === $this -> filled) {
if(true === isset($this -> attributes['name'])) {
if(true === Request :: isPost()) {
$this -> attributes['value'] = Request :: fromPost($this -> attributes['name']);
... | php | private function fill() {
//Prefill value
if(true === $this -> filled) {
if(true === isset($this -> attributes['name'])) {
if(true === Request :: isPost()) {
$this -> attributes['value'] = Request :: fromPost($this -> attributes['name']);
... | [
"private",
"function",
"fill",
"(",
")",
"{",
"//Prefill value\r",
"if",
"(",
"true",
"===",
"$",
"this",
"->",
"filled",
")",
"{",
"if",
"(",
"true",
"===",
"isset",
"(",
"$",
"this",
"->",
"attributes",
"[",
"'name'",
"]",
")",
")",
"{",
"if",
"(... | Sets the value if allowed | [
"Sets",
"the",
"value",
"if",
"allowed"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/Form/Traits/FormTrait.php#L179-L191 |
197,083 | bandama-framework/bandama-framework | src/foundation/session/Cookie.php | Cookie.set | public function set($key, $value, $params = array()) {
$expire = 0;
$path = null;
$domain = null;
$secure = false;
$httponly = false;
if (isset($params['expire'])) {
$expire = $params['expire'];
}
if (isset($params['path'])) {
$pat... | php | public function set($key, $value, $params = array()) {
$expire = 0;
$path = null;
$domain = null;
$secure = false;
$httponly = false;
if (isset($params['expire'])) {
$expire = $params['expire'];
}
if (isset($params['path'])) {
$pat... | [
"public",
"function",
"set",
"(",
"$",
"key",
",",
"$",
"value",
",",
"$",
"params",
"=",
"array",
"(",
")",
")",
"{",
"$",
"expire",
"=",
"0",
";",
"$",
"path",
"=",
"null",
";",
"$",
"domain",
"=",
"null",
";",
"$",
"secure",
"=",
"false",
... | Set variable to storage
@var string $key Key
@var mixed $value Value
@var array $params Parameters (expire, path, domain, secure, httponly)
@see SessionInterface::set | [
"Set",
"variable",
"to",
"storage"
] | 234ed703baf9e31268941c9d5f6d5e004cc53066 | https://github.com/bandama-framework/bandama-framework/blob/234ed703baf9e31268941c9d5f6d5e004cc53066/src/foundation/session/Cookie.php#L36-L60 |
197,084 | bandama-framework/bandama-framework | src/foundation/session/Cookie.php | Cookie.delete | public function delete($key) {
if (isset($_COOKIE[$key])) {
unset($_COOKIE[$key]);
setcookie($key, '', time() - 3600);
}
} | php | public function delete($key) {
if (isset($_COOKIE[$key])) {
unset($_COOKIE[$key]);
setcookie($key, '', time() - 3600);
}
} | [
"public",
"function",
"delete",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"_COOKIE",
"[",
"$",
"key",
"]",
")",
")",
"{",
"unset",
"(",
"$",
"_COOKIE",
"[",
"$",
"key",
"]",
")",
";",
"setcookie",
"(",
"$",
"key",
",",
"''",
",... | Remove variable from storage
@see SessionInterface::delete | [
"Remove",
"variable",
"from",
"storage"
] | 234ed703baf9e31268941c9d5f6d5e004cc53066 | https://github.com/bandama-framework/bandama-framework/blob/234ed703baf9e31268941c9d5f6d5e004cc53066/src/foundation/session/Cookie.php#L67-L72 |
197,085 | CalderaWP/caldera-interop | src/Traits/ProvidesFormsDataSource.php | ProvidesFormsDataSource.getDataSource | public function getDataSource(string $source) : Source
{
switch ($source) {
case 'form':
case 'forms':
return $this
->getDataSources()
->getFormsDataSource();
break;
case 'entry':
case 'entries':
return $this
->getDataSources()
->getEntryDataSource();
break;
case '... | php | public function getDataSource(string $source) : Source
{
switch ($source) {
case 'form':
case 'forms':
return $this
->getDataSources()
->getFormsDataSource();
break;
case 'entry':
case 'entries':
return $this
->getDataSources()
->getEntryDataSource();
break;
case '... | [
"public",
"function",
"getDataSource",
"(",
"string",
"$",
"source",
")",
":",
"Source",
"{",
"switch",
"(",
"$",
"source",
")",
"{",
"case",
"'form'",
":",
"case",
"'forms'",
":",
"return",
"$",
"this",
"->",
"getDataSources",
"(",
")",
"->",
"getFormsD... | Get a form, form entry or form entry value data source.
@param string $source
@return Source | [
"Get",
"a",
"form",
"form",
"entry",
"or",
"form",
"entry",
"value",
"data",
"source",
"."
] | d25c4bc930200b314fbd42d084080b5d85261c94 | https://github.com/CalderaWP/caldera-interop/blob/d25c4bc930200b314fbd42d084080b5d85261c94/src/Traits/ProvidesFormsDataSource.php#L24-L45 |
197,086 | OpenConext-Attic/OpenConext-engineblock-metadata | src/Utils.php | Utils.instantiate | public static function instantiate($className, array $namedArguments)
{
$reflectionClass = new ReflectionClass($className);
$parameters = $reflectionClass->getConstructor()->getParameters();
$positionalDefaultFilledArguments = array();
foreach ($parameters as $parameter) {
... | php | public static function instantiate($className, array $namedArguments)
{
$reflectionClass = new ReflectionClass($className);
$parameters = $reflectionClass->getConstructor()->getParameters();
$positionalDefaultFilledArguments = array();
foreach ($parameters as $parameter) {
... | [
"public",
"static",
"function",
"instantiate",
"(",
"$",
"className",
",",
"array",
"$",
"namedArguments",
")",
"{",
"$",
"reflectionClass",
"=",
"new",
"ReflectionClass",
"(",
"$",
"className",
")",
";",
"$",
"parameters",
"=",
"$",
"reflectionClass",
"->",
... | Instantiate a class with named arguments.
An answer to a problem that should not exist (legacy large Entities).
@param string $className
@param array $namedArguments
@return object | [
"Instantiate",
"a",
"class",
"with",
"named",
"arguments",
"."
] | 236e2f52ef9cf28e71404544a1c4388f63ee535d | https://github.com/OpenConext-Attic/OpenConext-engineblock-metadata/blob/236e2f52ef9cf28e71404544a1c4388f63ee535d/src/Utils.php#L37-L55 |
197,087 | ScaraMVC/Framework | src/Scara/Support/ServiceProvider.php | ServiceProvider.create | public function create($name, $callback)
{
$this->_name = $name;
$this->_class = $callback();
$GLOBALS['providers'][$this->_name] = $this->_class;
} | php | public function create($name, $callback)
{
$this->_name = $name;
$this->_class = $callback();
$GLOBALS['providers'][$this->_name] = $this->_class;
} | [
"public",
"function",
"create",
"(",
"$",
"name",
",",
"$",
"callback",
")",
"{",
"$",
"this",
"->",
"_name",
"=",
"$",
"name",
";",
"$",
"this",
"->",
"_class",
"=",
"$",
"callback",
"(",
")",
";",
"$",
"GLOBALS",
"[",
"'providers'",
"]",
"[",
"... | Creates the provider and registers the provider to the global area.
@param string $name - The name of the service provider
@param \Closure $callback - The callback for calling the provider's given class
@return void | [
"Creates",
"the",
"provider",
"and",
"registers",
"the",
"provider",
"to",
"the",
"global",
"area",
"."
] | 199b08b45fadf5dae14ac4732af03b36e15bbef2 | https://github.com/ScaraMVC/Framework/blob/199b08b45fadf5dae14ac4732af03b36e15bbef2/src/Scara/Support/ServiceProvider.php#L39-L45 |
197,088 | faizalpribadi/Cache | Driver/OpCache/Apc.php | Apc.set | public function set($id, $data, $lifeTime = 0)
{
if (!function_exists('apc_store')) {
throw new ApcCacheException('function [apc_store] not found !');
}
return apc_store($id, $data, $lifeTime);
} | php | public function set($id, $data, $lifeTime = 0)
{
if (!function_exists('apc_store')) {
throw new ApcCacheException('function [apc_store] not found !');
}
return apc_store($id, $data, $lifeTime);
} | [
"public",
"function",
"set",
"(",
"$",
"id",
",",
"$",
"data",
",",
"$",
"lifeTime",
"=",
"0",
")",
"{",
"if",
"(",
"!",
"function_exists",
"(",
"'apc_store'",
")",
")",
"{",
"throw",
"new",
"ApcCacheException",
"(",
"'function [apc_store] not found !'",
"... | Set and store cache key with data content in cache key
@param string $id
@param string $data
@param int $lifeTime
@return array|bool
@throws \Mozart\Library\Cache\Exception\ApcCacheException | [
"Set",
"and",
"store",
"cache",
"key",
"with",
"data",
"content",
"in",
"cache",
"key"
] | e62a4d71739e542ca6e7bac77f5cc522accef8cb | https://github.com/faizalpribadi/Cache/blob/e62a4d71739e542ca6e7bac77f5cc522accef8cb/Driver/OpCache/Apc.php#L47-L54 |
197,089 | jenskooij/cloudcontrol | src/storage/storage/AbstractStorage.php | AbstractStorage.validateFilename | protected function validateFilename($filename, $path)
{
$fileParts = explode('.', $filename);
if (count($fileParts) > 1) {
$extension = end($fileParts);
array_pop($fileParts);
$fileNameWithoutExtension = implode('-', $fileParts);
$fileNameWithoutExtens... | php | protected function validateFilename($filename, $path)
{
$fileParts = explode('.', $filename);
if (count($fileParts) > 1) {
$extension = end($fileParts);
array_pop($fileParts);
$fileNameWithoutExtension = implode('-', $fileParts);
$fileNameWithoutExtens... | [
"protected",
"function",
"validateFilename",
"(",
"$",
"filename",
",",
"$",
"path",
")",
"{",
"$",
"fileParts",
"=",
"explode",
"(",
"'.'",
",",
"$",
"filename",
")",
";",
"if",
"(",
"count",
"(",
"$",
"fileParts",
")",
">",
"1",
")",
"{",
"$",
"e... | Converts filename to lowercase, remove non-ascii chars
And adds "-copy" if the file already exists
@param $filename
@param $path
@return string | [
"Converts",
"filename",
"to",
"lowercase",
"remove",
"non",
"-",
"ascii",
"chars",
"And",
"adds",
"-",
"copy",
"if",
"the",
"file",
"already",
"exists"
] | 76e5d9ac8f9c50d06d39a995d13cc03742536548 | https://github.com/jenskooij/cloudcontrol/blob/76e5d9ac8f9c50d06d39a995d13cc03742536548/src/storage/storage/AbstractStorage.php#L33-L62 |
197,090 | zarathustra323/modlr-data | src/Zarathustra/ModlrData/Resource/Relationship.php | Relationship.pushData | public function pushData(EntityInterface $entity)
{
if ($this->isMany()) {
$this->data[] = $entity;
return $this;
}
$this->data = $entity;
return $this;
} | php | public function pushData(EntityInterface $entity)
{
if ($this->isMany()) {
$this->data[] = $entity;
return $this;
}
$this->data = $entity;
return $this;
} | [
"public",
"function",
"pushData",
"(",
"EntityInterface",
"$",
"entity",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isMany",
"(",
")",
")",
"{",
"$",
"this",
"->",
"data",
"[",
"]",
"=",
"$",
"entity",
";",
"return",
"$",
"this",
";",
"}",
"$",
"th... | Applys the relationship data.
@param EntityInterface $entity
@return self | [
"Applys",
"the",
"relationship",
"data",
"."
] | 7c2c767216055f75abf8cf22e2200f11998ed24e | https://github.com/zarathustra323/modlr-data/blob/7c2c767216055f75abf8cf22e2200f11998ed24e/src/Zarathustra/ModlrData/Resource/Relationship.php#L94-L102 |
197,091 | Kris-Kuiper/sFire-Framework | src/Template/Template.php | Template.render | public function render() {
$parse = true;
if($this -> getFile() -> exists()) {
if($this -> getFile() -> entity() -> getModificationTime() >= @filemtime($this -> viewmodel -> getFile())) {
$parse = false;
}
}
if(true === $parse) {
$this -> parse();
$this -> write();
}
r... | php | public function render() {
$parse = true;
if($this -> getFile() -> exists()) {
if($this -> getFile() -> entity() -> getModificationTime() >= @filemtime($this -> viewmodel -> getFile())) {
$parse = false;
}
}
if(true === $parse) {
$this -> parse();
$this -> write();
}
r... | [
"public",
"function",
"render",
"(",
")",
"{",
"$",
"parse",
"=",
"true",
";",
"if",
"(",
"$",
"this",
"->",
"getFile",
"(",
")",
"->",
"exists",
"(",
")",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"getFile",
"(",
")",
"->",
"entity",
"(",
")",
... | Renders the view model
@return sFire\Template\Template | [
"Renders",
"the",
"view",
"model"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/Template/Template.php#L91-L109 |
197,092 | Kris-Kuiper/sFire-Framework | src/Template/Template.php | Template.getFileName | public function getFileName() {
if(null === $this -> filename && null !== $this -> viewmodel) {
$this -> filename = md5($this -> viewmodel -> getFile());
}
return $this -> filename;
} | php | public function getFileName() {
if(null === $this -> filename && null !== $this -> viewmodel) {
$this -> filename = md5($this -> viewmodel -> getFile());
}
return $this -> filename;
} | [
"public",
"function",
"getFileName",
"(",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"filename",
"&&",
"null",
"!==",
"$",
"this",
"->",
"viewmodel",
")",
"{",
"$",
"this",
"->",
"filename",
"=",
"md5",
"(",
"$",
"this",
"->",
"viewmodel"... | Generates filename and returns it
@return string | [
"Generates",
"filename",
"and",
"returns",
"it"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/Template/Template.php#L116-L123 |
197,093 | Kris-Kuiper/sFire-Framework | src/Template/Template.php | Template.getFile | public function getFile() {
if(null === $this -> file) {
$file = $this -> getFileName();
$this -> file = new File($this -> directory . $file);
}
return $this -> file;
} | php | public function getFile() {
if(null === $this -> file) {
$file = $this -> getFileName();
$this -> file = new File($this -> directory . $file);
}
return $this -> file;
} | [
"public",
"function",
"getFile",
"(",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"file",
")",
"{",
"$",
"file",
"=",
"$",
"this",
"->",
"getFileName",
"(",
")",
";",
"$",
"this",
"->",
"file",
"=",
"new",
"File",
"(",
"$",
"this",
"... | Create file object from current directory and file and returns it
@return sFire\System\File | [
"Create",
"file",
"object",
"from",
"current",
"directory",
"and",
"file",
"and",
"returns",
"it"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/Template/Template.php#L130-L139 |
197,094 | Kris-Kuiper/sFire-Framework | src/Template/Template.php | Template.parse | private function parse() {
$lines = file($this -> viewmodel -> getFile());
$this -> code = '';
$classes = [
'MatchEcho',
'MatchForeach',
'MatchEndForeach',
'MatchFor',
'MatchEndFor',
'MatchIf',
'MatchIsset',
'MatchNotIsset',
'MatchEmpty',
'MatchNotEmpty',
'Ma... | php | private function parse() {
$lines = file($this -> viewmodel -> getFile());
$this -> code = '';
$classes = [
'MatchEcho',
'MatchForeach',
'MatchEndForeach',
'MatchFor',
'MatchEndFor',
'MatchIf',
'MatchIsset',
'MatchNotIsset',
'MatchEmpty',
'MatchNotEmpty',
'Ma... | [
"private",
"function",
"parse",
"(",
")",
"{",
"$",
"lines",
"=",
"file",
"(",
"$",
"this",
"->",
"viewmodel",
"->",
"getFile",
"(",
")",
")",
";",
"$",
"this",
"->",
"code",
"=",
"''",
";",
"$",
"classes",
"=",
"[",
"'MatchEcho'",
",",
"'MatchFore... | Convert template file to string
@return string | [
"Convert",
"template",
"file",
"to",
"string"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/Template/Template.php#L146-L205 |
197,095 | eureka-framework/component-template | src/Template/Template.php | Template.partial | public static function partial($template, array $vars = array())
{
$template = new Template($template, null, $vars);
return trim($template->render());
} | php | public static function partial($template, array $vars = array())
{
$template = new Template($template, null, $vars);
return trim($template->render());
} | [
"public",
"static",
"function",
"partial",
"(",
"$",
"template",
",",
"array",
"$",
"vars",
"=",
"array",
"(",
")",
")",
"{",
"$",
"template",
"=",
"new",
"Template",
"(",
"$",
"template",
",",
"null",
",",
"$",
"vars",
")",
";",
"return",
"trim",
... | Include partial.
@param string $template
@param array $vars
@return string Content
@throws \Exception | [
"Include",
"partial",
"."
] | 42e9b3954b79892ba340ba7ca909f03ee99c36fe | https://github.com/eureka-framework/component-template/blob/42e9b3954b79892ba340ba7ca909f03ee99c36fe/src/Template/Template.php#L179-L184 |
197,096 | eureka-framework/component-template | src/Template/Template.php | Template.setPathCompiled | public static function setPathCompiled($pathCompiled = '/tmp/Eureka/tpl')
{
$pathCompiled = rtrim($pathCompiled, '/') . '/';
if (!file_exists($pathCompiled) || !is_dir($pathCompiled)) {
if (!mkdir($pathCompiled, 0755, true)) {
throw new \Exception('Cannot create directo... | php | public static function setPathCompiled($pathCompiled = '/tmp/Eureka/tpl')
{
$pathCompiled = rtrim($pathCompiled, '/') . '/';
if (!file_exists($pathCompiled) || !is_dir($pathCompiled)) {
if (!mkdir($pathCompiled, 0755, true)) {
throw new \Exception('Cannot create directo... | [
"public",
"static",
"function",
"setPathCompiled",
"(",
"$",
"pathCompiled",
"=",
"'/tmp/Eureka/tpl'",
")",
"{",
"$",
"pathCompiled",
"=",
"rtrim",
"(",
"$",
"pathCompiled",
",",
"'/'",
")",
".",
"'/'",
";",
"if",
"(",
"!",
"file_exists",
"(",
"$",
"pathCo... | Set path for compiled templates.
@param string $pathCompiled
@return void
@throws \Exception | [
"Set",
"path",
"for",
"compiled",
"templates",
"."
] | 42e9b3954b79892ba340ba7ca909f03ee99c36fe | https://github.com/eureka-framework/component-template/blob/42e9b3954b79892ba340ba7ca909f03ee99c36fe/src/Template/Template.php#L193-L204 |
197,097 | mcaskill/tokenlist | src/TokenList/DOMTokenList.php | DOMTokenList.__update | protected function __update()
{
/** Rebase array indices */
parent::__update();
if ( $this->count() && $this->attribute instanceof DOMAttr ) {
$this->attribute->value = (string) $this;
}
} | php | protected function __update()
{
/** Rebase array indices */
parent::__update();
if ( $this->count() && $this->attribute instanceof DOMAttr ) {
$this->attribute->value = (string) $this;
}
} | [
"protected",
"function",
"__update",
"(",
")",
"{",
"/** Rebase array indices */",
"parent",
"::",
"__update",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"count",
"(",
")",
"&&",
"$",
"this",
"->",
"attribute",
"instanceof",
"DOMAttr",
")",
"{",
"$",
"... | Updates the HTML attribute that DOMTokenList represents
Will only update the value if self::$attribute is a DOMAttr. | [
"Updates",
"the",
"HTML",
"attribute",
"that",
"DOMTokenList",
"represents"
] | 5266dc37157179c86f475a7a9301887d470b3664 | https://github.com/mcaskill/tokenlist/blob/5266dc37157179c86f475a7a9301887d470b3664/src/TokenList/DOMTokenList.php#L186-L194 |
197,098 | mcaskill/tokenlist | src/TokenList/DOMTokenList.php | DOMTokenList.__toAttribute | public function __toAttribute()
{
if ( $this->count() ) {
$attr = null;
if ( is_string( $this->attribute ) ) {
$attr = $this->attribute;
}
elseif ( $this->attribute instanceof DOMAttr ) {
$attr = $this->attribute->name;
}
if ( $attr ) {
$values = htmlspecialchars((string) $this, ENT_Q... | php | public function __toAttribute()
{
if ( $this->count() ) {
$attr = null;
if ( is_string( $this->attribute ) ) {
$attr = $this->attribute;
}
elseif ( $this->attribute instanceof DOMAttr ) {
$attr = $this->attribute->name;
}
if ( $attr ) {
$values = htmlspecialchars((string) $this, ENT_Q... | [
"public",
"function",
"__toAttribute",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"count",
"(",
")",
")",
"{",
"$",
"attr",
"=",
"null",
";",
"if",
"(",
"is_string",
"(",
"$",
"this",
"->",
"attribute",
")",
")",
"{",
"$",
"attr",
"=",
"$",
"... | Retrieves the HTML attribute and concatenated list of the tokens.
@return string Stringified token list, wrapped in an HTML attribute. | [
"Retrieves",
"the",
"HTML",
"attribute",
"and",
"concatenated",
"list",
"of",
"the",
"tokens",
"."
] | 5266dc37157179c86f475a7a9301887d470b3664 | https://github.com/mcaskill/tokenlist/blob/5266dc37157179c86f475a7a9301887d470b3664/src/TokenList/DOMTokenList.php#L201-L220 |
197,099 | Wedeto/DB | src/Query/Select.php | Select.toSQL | public function toSQL(Parameters $params, bool $inner_clause)
{
$drv = $params->getDriver();
// First get the source tables: FROM and JOIN clauses
$source = array();
if ($table = $this->getTable())
$source[] = "FROM " . $drv->toSQL($params, $table);
foreach ($th... | php | public function toSQL(Parameters $params, bool $inner_clause)
{
$drv = $params->getDriver();
// First get the source tables: FROM and JOIN clauses
$source = array();
if ($table = $this->getTable())
$source[] = "FROM " . $drv->toSQL($params, $table);
foreach ($th... | [
"public",
"function",
"toSQL",
"(",
"Parameters",
"$",
"params",
",",
"bool",
"$",
"inner_clause",
")",
"{",
"$",
"drv",
"=",
"$",
"params",
"->",
"getDriver",
"(",
")",
";",
"// First get the source tables: FROM and JOIN clauses",
"$",
"source",
"=",
"array",
... | Write a select query as SQL query syntax
@param Parameters $params The query parameters: tables and placeholder values
@param bool $inner_clause Unused
@return string The generated SQL | [
"Write",
"a",
"select",
"query",
"as",
"SQL",
"query",
"syntax"
] | 715f8f2e3ae6b53c511c40b620921cb9c87e6f62 | https://github.com/Wedeto/DB/blob/715f8f2e3ae6b53c511c40b620921cb9c87e6f62/src/Query/Select.php#L206-L253 |
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.