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
193,000
linguisticteam/xml-sitemap
src/sitemap.php
XMLSitemap.addExtraNamespaces
protected function addExtraNamespaces( $nodeset ) { $this->addNamespace( 'hasImages', $nodeset, 'xmlns:image', "http://www.google.com/schemas/sitemap-image/1.1" ); $this->addNamespace( 'hasVideos', $nodeset, 'xmlns:video', "http://www.google.com/schemas/sitemap-video/1.1" ); $this->addNamesp...
php
protected function addExtraNamespaces( $nodeset ) { $this->addNamespace( 'hasImages', $nodeset, 'xmlns:image', "http://www.google.com/schemas/sitemap-image/1.1" ); $this->addNamespace( 'hasVideos', $nodeset, 'xmlns:video', "http://www.google.com/schemas/sitemap-video/1.1" ); $this->addNamesp...
[ "protected", "function", "addExtraNamespaces", "(", "$", "nodeset", ")", "{", "$", "this", "->", "addNamespace", "(", "'hasImages'", ",", "$", "nodeset", ",", "'xmlns:image'", ",", "\"http://www.google.com/schemas/sitemap-image/1.1\"", ")", ";", "$", "this", "->", ...
If we add nodes with special namespaces, we setup a boolean in our iterator classes that switch to true so we can add the appropriate namespaces to our document. Ex: an image is added to the document, we set "hasImages" to true so that it's evaluated to true here and the image namespace is added. @param \DOMElement $...
[ "If", "we", "add", "nodes", "with", "special", "namespaces", "we", "setup", "a", "boolean", "in", "our", "iterator", "classes", "that", "switch", "to", "true", "so", "we", "can", "add", "the", "appropriate", "namespaces", "to", "our", "document", "." ]
b600a31ad9c1c136fa6f3d3b6a394002121d42f0
https://github.com/linguisticteam/xml-sitemap/blob/b600a31ad9c1c136fa6f3d3b6a394002121d42f0/src/sitemap.php#L125-L132
193,001
bytic/debugbar
src/DebugBarServiceProvider.php
DebugBarServiceProvider.registerMiddleware
protected function registerMiddleware($middleware) { /** @var Kernel $kernel */ $kernel = $this->getContainer()->get(KernelInterface::class); $kernel->prependMiddleware($middleware); }
php
protected function registerMiddleware($middleware) { /** @var Kernel $kernel */ $kernel = $this->getContainer()->get(KernelInterface::class); $kernel->prependMiddleware($middleware); }
[ "protected", "function", "registerMiddleware", "(", "$", "middleware", ")", "{", "/** @var Kernel $kernel */", "$", "kernel", "=", "$", "this", "->", "getContainer", "(", ")", "->", "get", "(", "KernelInterface", "::", "class", ")", ";", "$", "kernel", "->", ...
Register the Debugbar Middleware @param string $middleware
[ "Register", "the", "Debugbar", "Middleware" ]
3199ade9a8fff866bffc39712bdf78d2dd214e4b
https://github.com/bytic/debugbar/blob/3199ade9a8fff866bffc39712bdf78d2dd214e4b/src/DebugBarServiceProvider.php#L81-L86
193,002
anime-db/catalog-bundle
src/Controller/UpdateController.php
UpdateController.getPlugin
protected function getPlugin($plugin) { try { list($vendor, $package) = explode('/', $plugin); return $this->get('anime_db.api.client')->getPlugin($vendor, $package); } catch (\RuntimeException $e) { return; } }
php
protected function getPlugin($plugin) { try { list($vendor, $package) = explode('/', $plugin); return $this->get('anime_db.api.client')->getPlugin($vendor, $package); } catch (\RuntimeException $e) { return; } }
[ "protected", "function", "getPlugin", "(", "$", "plugin", ")", "{", "try", "{", "list", "(", "$", "vendor", ",", "$", "package", ")", "=", "explode", "(", "'/'", ",", "$", "plugin", ")", ";", "return", "$", "this", "->", "get", "(", "'anime_db.api.cl...
Get plugin. @param string $plugin @return array|null
[ "Get", "plugin", "." ]
631b6f92a654e91bee84f46218c52cf42bdb8606
https://github.com/anime-db/catalog-bundle/blob/631b6f92a654e91bee84f46218c52cf42bdb8606/src/Controller/UpdateController.php#L106-L115
193,003
anime-db/catalog-bundle
src/Controller/UpdateController.php
UpdateController.executeAction
public function executeAction() { // update for Windows XP does not work if (strpos(php_uname('v'), 'Windows XP') !== false) { $this->redirect($this->generateUrl('update')); } // execute update file_put_contents($this->container->getParameter('kernel.root_dir').'...
php
public function executeAction() { // update for Windows XP does not work if (strpos(php_uname('v'), 'Windows XP') !== false) { $this->redirect($this->generateUrl('update')); } // execute update file_put_contents($this->container->getParameter('kernel.root_dir').'...
[ "public", "function", "executeAction", "(", ")", "{", "// update for Windows XP does not work", "if", "(", "strpos", "(", "php_uname", "(", "'v'", ")", ",", "'Windows XP'", ")", "!==", "false", ")", "{", "$", "this", "->", "redirect", "(", "$", "this", "->",...
Execute update application. @return Response
[ "Execute", "update", "application", "." ]
631b6f92a654e91bee84f46218c52cf42bdb8606
https://github.com/anime-db/catalog-bundle/blob/631b6f92a654e91bee84f46218c52cf42bdb8606/src/Controller/UpdateController.php#L122-L138
193,004
modulusphp/support
Obj.php
Obj.old
public static function old($value, $fallback = '') { return Variable::has('form.old') ? (isset(Variable::get('form.old')[$value]) ? Variable::get('form.old')[$value] : $fallback) : $fallback; }
php
public static function old($value, $fallback = '') { return Variable::has('form.old') ? (isset(Variable::get('form.old')[$value]) ? Variable::get('form.old')[$value] : $fallback) : $fallback; }
[ "public", "static", "function", "old", "(", "$", "value", ",", "$", "fallback", "=", "''", ")", "{", "return", "Variable", "::", "has", "(", "'form.old'", ")", "?", "(", "isset", "(", "Variable", "::", "get", "(", "'form.old'", ")", "[", "$", "value"...
Get old value or fallback @param mixed $value @param mixed $fallback @return void
[ "Get", "old", "value", "or", "fallback" ]
b5c5b48dcbeb379e6cd1f29159dc8cdacef3adab
https://github.com/modulusphp/support/blob/b5c5b48dcbeb379e6cd1f29159dc8cdacef3adab/Obj.php#L34-L37
193,005
modulusphp/support
Obj.php
Obj.is_base64
public static function is_base64(string $string) : bool { if (base64_encode(base64_decode($string, true)) === $string) return true; return false; }
php
public static function is_base64(string $string) : bool { if (base64_encode(base64_decode($string, true)) === $string) return true; return false; }
[ "public", "static", "function", "is_base64", "(", "string", "$", "string", ")", ":", "bool", "{", "if", "(", "base64_encode", "(", "base64_decode", "(", "$", "string", ",", "true", ")", ")", "===", "$", "string", ")", "return", "true", ";", "return", "...
Check if string is base64 or not @param string $string @return bool
[ "Check", "if", "string", "is", "base64", "or", "not" ]
b5c5b48dcbeb379e6cd1f29159dc8cdacef3adab
https://github.com/modulusphp/support/blob/b5c5b48dcbeb379e6cd1f29159dc8cdacef3adab/Obj.php#L101-L105
193,006
railken/amethyst-authentication
src/Http/Controllers/App/AuthController.php
AuthController.getProvider
public function getProvider($name, $request) { $class = isset($this->providers[$name]) ? $this->providers[$name] : null; if (!$class) { return null; } return new $class($request, $request->input('client_id'), $request->input('client_secret'), $request->input('redirect_u...
php
public function getProvider($name, $request) { $class = isset($this->providers[$name]) ? $this->providers[$name] : null; if (!$class) { return null; } return new $class($request, $request->input('client_id'), $request->input('client_secret'), $request->input('redirect_u...
[ "public", "function", "getProvider", "(", "$", "name", ",", "$", "request", ")", "{", "$", "class", "=", "isset", "(", "$", "this", "->", "providers", "[", "$", "name", "]", ")", "?", "$", "this", "->", "providers", "[", "$", "name", "]", ":", "n...
Get provider. @param string $name @param Request $request @return \Laravel\Socialite\Two\AbstractProvider|null
[ "Get", "provider", "." ]
59f28ddffa41a5f7fae4d5504eacf7c664e54b46
https://github.com/railken/amethyst-authentication/blob/59f28ddffa41a5f7fae4d5504eacf7c664e54b46/src/Http/Controllers/App/AuthController.php#L56-L65
193,007
railken/amethyst-authentication
src/Http/Controllers/App/AuthController.php
AuthController.signIn
public function signIn(Request $request) { $oauth_client = DB::table('oauth_clients')->where('password_client', 1)->first(); if (!$oauth_client) { return $this->response([ 'code' => 'CLIENT_NOT_FOUND', ], Response::HTTP_BAD_REQUEST); } $reque...
php
public function signIn(Request $request) { $oauth_client = DB::table('oauth_clients')->where('password_client', 1)->first(); if (!$oauth_client) { return $this->response([ 'code' => 'CLIENT_NOT_FOUND', ], Response::HTTP_BAD_REQUEST); } $reque...
[ "public", "function", "signIn", "(", "Request", "$", "request", ")", "{", "$", "oauth_client", "=", "DB", "::", "table", "(", "'oauth_clients'", ")", "->", "where", "(", "'password_client'", ",", "1", ")", "->", "first", "(", ")", ";", "if", "(", "!", ...
Sign in a user. @param \Illuminate\Http\Request $request @return \Symfony\Component\HttpFoundation\Response
[ "Sign", "in", "a", "user", "." ]
59f28ddffa41a5f7fae4d5504eacf7c664e54b46
https://github.com/railken/amethyst-authentication/blob/59f28ddffa41a5f7fae4d5504eacf7c664e54b46/src/Http/Controllers/App/AuthController.php#L74-L109
193,008
railken/amethyst-authentication
src/Http/Controllers/App/AuthController.php
AuthController.signInWithProvider
public function signInWithProvider($provider_name, Request $request) { $provider = $this->getProvider($provider_name, $request); if (!$provider) { return $this->response(['errors' => [ 'code' => 'PROVIDER_NOT_FOUND', 'message' => 'No provider found', ...
php
public function signInWithProvider($provider_name, Request $request) { $provider = $this->getProvider($provider_name, $request); if (!$provider) { return $this->response(['errors' => [ 'code' => 'PROVIDER_NOT_FOUND', 'message' => 'No provider found', ...
[ "public", "function", "signInWithProvider", "(", "$", "provider_name", ",", "Request", "$", "request", ")", "{", "$", "provider", "=", "$", "this", "->", "getProvider", "(", "$", "provider_name", ",", "$", "request", ")", ";", "if", "(", "!", "$", "provi...
Request token and generate a new one. @param string $provider_name @param Request $request @return \Symfony\Component\HttpFoundation\Response
[ "Request", "token", "and", "generate", "a", "new", "one", "." ]
59f28ddffa41a5f7fae4d5504eacf7c664e54b46
https://github.com/railken/amethyst-authentication/blob/59f28ddffa41a5f7fae4d5504eacf7c664e54b46/src/Http/Controllers/App/AuthController.php#L119-L142
193,009
railken/amethyst-authentication
src/Http/Controllers/App/AuthController.php
AuthController.authenticateByCode
public function authenticateByCode($provider, string $code) { $provider_user = $provider->user(); /** @var \Railken\Amethyst\Repositories\UserRepository */ $repository = $this->manager->getRepository(); $user = $repository->findOneByEmail($provider_user->getEmail()); if (!...
php
public function authenticateByCode($provider, string $code) { $provider_user = $provider->user(); /** @var \Railken\Amethyst\Repositories\UserRepository */ $repository = $this->manager->getRepository(); $user = $repository->findOneByEmail($provider_user->getEmail()); if (!...
[ "public", "function", "authenticateByCode", "(", "$", "provider", ",", "string", "$", "code", ")", "{", "$", "provider_user", "=", "$", "provider", "->", "user", "(", ")", ";", "/** @var \\Railken\\Amethyst\\Repositories\\UserRepository */", "$", "repository", "=", ...
Authenticate a user by the "code" of oauth2. @param \Laravel\Socialite\Two\AbstractProvider $provider @param string $code @return \Symfony\Component\HttpFoundation\Response
[ "Authenticate", "a", "user", "by", "the", "code", "of", "oauth2", "." ]
59f28ddffa41a5f7fae4d5504eacf7c664e54b46
https://github.com/railken/amethyst-authentication/blob/59f28ddffa41a5f7fae4d5504eacf7c664e54b46/src/Http/Controllers/App/AuthController.php#L152-L187
193,010
smtech/obsolete__oauth-negotiator
OAuthNegotiator.php
OAuthNegotiator.constructIdentityToken
private function constructIdentityToken() { if (isset($_REQUEST[self::CODE])) { $this->requestToken($_REQUEST[self::CODE], self::IDENTITY_TOKEN); $_SESSION[self::SESSION][self::IS_API_TOKEN] = false; $_SESSION[self::SESSION][self::STATE] = self::NEGOTIATION_COMPLETE; header("Location: {$_SESSION[self::SES...
php
private function constructIdentityToken() { if (isset($_REQUEST[self::CODE])) { $this->requestToken($_REQUEST[self::CODE], self::IDENTITY_TOKEN); $_SESSION[self::SESSION][self::IS_API_TOKEN] = false; $_SESSION[self::SESSION][self::STATE] = self::NEGOTIATION_COMPLETE; header("Location: {$_SESSION[self::SES...
[ "private", "function", "constructIdentityToken", "(", ")", "{", "if", "(", "isset", "(", "$", "_REQUEST", "[", "self", "::", "CODE", "]", ")", ")", "{", "$", "this", "->", "requestToken", "(", "$", "_REQUEST", "[", "self", "::", "CODE", "]", ",", "se...
Construct an OAuthNegotiator to use an access code to request an identity token @return void @throws OAuthNegotiator_Exception CODE_RESPONSE if the prior request for an authorization token resulted in neither an authorization code or an erro (weird!)
[ "Construct", "an", "OAuthNegotiator", "to", "use", "an", "access", "code", "to", "request", "an", "identity", "token" ]
f29099100cb931582058139cbedc5d1e65a8255a
https://github.com/smtech/obsolete__oauth-negotiator/blob/f29099100cb931582058139cbedc5d1e65a8255a/OAuthNegotiator.php#L243-L261
193,011
smtech/obsolete__oauth-negotiator
OAuthNegotiator.php
OAuthNegotiator.constructAPIToken
private function constructAPIToken() { if (isset($_REQUEST[self::CODE])) { $this->requestToken($_REQUEST[self::CODE], self::API_TOKEN); $_SESSION[self::SESSION][self::IS_API_TOKEN] = true; $_SESSION[self::SESSION][self::STATE] = self::NEGOTIATION_COMPLETE; header ("Location: {$_SESSION[self::SESSION][self...
php
private function constructAPIToken() { if (isset($_REQUEST[self::CODE])) { $this->requestToken($_REQUEST[self::CODE], self::API_TOKEN); $_SESSION[self::SESSION][self::IS_API_TOKEN] = true; $_SESSION[self::SESSION][self::STATE] = self::NEGOTIATION_COMPLETE; header ("Location: {$_SESSION[self::SESSION][self...
[ "private", "function", "constructAPIToken", "(", ")", "{", "if", "(", "isset", "(", "$", "_REQUEST", "[", "self", "::", "CODE", "]", ")", ")", "{", "$", "this", "->", "requestToken", "(", "$", "_REQUEST", "[", "self", "::", "CODE", "]", ",", "self", ...
Construct an OAuthNegotiator to use an access code to request an API Token with matching user profile @return void @throws OAuthNegotiator_Exception CODE_RESPONSE if the prior request for an authorization token resulted in neither an authorization code or an error (weird!) @throws OAuthNegotatior_Exception USER_RESPO...
[ "Construct", "an", "OAuthNegotiator", "to", "use", "an", "access", "code", "to", "request", "an", "API", "Token", "with", "matching", "user", "profile" ]
f29099100cb931582058139cbedc5d1e65a8255a
https://github.com/smtech/obsolete__oauth-negotiator/blob/f29099100cb931582058139cbedc5d1e65a8255a/OAuthNegotiator.php#L271-L290
193,012
smtech/obsolete__oauth-negotiator
OAuthNegotiator.php
OAuthNegotiator.constructNegotiationReporter
private function constructNegotiationReporter() { switch ($_SESSION[self::SESSION][self::STATE]) { case self::NEGOTIATION_COMPLETE: case self::NEGOTIATION_FAILED: { $this->ready = true; $this->apiUrl = (isset($_SESSION[self::SESSION][self::API_URL]) ? $_SESSION[self::SESSION][self::API_URL] : null); ...
php
private function constructNegotiationReporter() { switch ($_SESSION[self::SESSION][self::STATE]) { case self::NEGOTIATION_COMPLETE: case self::NEGOTIATION_FAILED: { $this->ready = true; $this->apiUrl = (isset($_SESSION[self::SESSION][self::API_URL]) ? $_SESSION[self::SESSION][self::API_URL] : null); ...
[ "private", "function", "constructNegotiationReporter", "(", ")", "{", "switch", "(", "$", "_SESSION", "[", "self", "::", "SESSION", "]", "[", "self", "::", "STATE", "]", ")", "{", "case", "self", "::", "NEGOTIATION_COMPLETE", ":", "case", "self", "::", "NE...
Prepare to report on the results of the OAuth negotiation @return void
[ "Prepare", "to", "report", "on", "the", "results", "of", "the", "OAuth", "negotiation" ]
f29099100cb931582058139cbedc5d1e65a8255a
https://github.com/smtech/obsolete__oauth-negotiator/blob/f29099100cb931582058139cbedc5d1e65a8255a/OAuthNegotiator.php#L297-L315
193,013
smtech/obsolete__oauth-negotiator
OAuthNegotiator.php
OAuthNegotiator.requestAuthorizationCode
private function requestAuthorizationCode($responseType, $scopes, $purpose) { $_SESSION[self::SESSION][self::STATE] = self::$SCOPES[$scopes][self::CODE_REQUESTED]; if ($scopes === self::IDENTITY_TOKEN) { header( "Location: {$_SESSION[self::SESSION][self::OAUTH_ENDPOINT]}/auth?" . http_build_query( array...
php
private function requestAuthorizationCode($responseType, $scopes, $purpose) { $_SESSION[self::SESSION][self::STATE] = self::$SCOPES[$scopes][self::CODE_REQUESTED]; if ($scopes === self::IDENTITY_TOKEN) { header( "Location: {$_SESSION[self::SESSION][self::OAUTH_ENDPOINT]}/auth?" . http_build_query( array...
[ "private", "function", "requestAuthorizationCode", "(", "$", "responseType", ",", "$", "scopes", ",", "$", "purpose", ")", "{", "$", "_SESSION", "[", "self", "::", "SESSION", "]", "[", "self", "::", "STATE", "]", "=", "self", "::", "$", "SCOPES", "[", ...
Request an authorization code from the OAuth server @param string $responseType Always 'code' @param string $scopes The type of token for which we need an authorization code (IDENTITY_TOKEN|API_TOKEN) @param string $purpose User-readable description of the purpose for which this token will be used @return void
[ "Request", "an", "authorization", "code", "from", "the", "OAuth", "server" ]
f29099100cb931582058139cbedc5d1e65a8255a
https://github.com/smtech/obsolete__oauth-negotiator/blob/f29099100cb931582058139cbedc5d1e65a8255a/OAuthNegotiator.php#L390-L419
193,014
smtech/obsolete__oauth-negotiator
OAuthNegotiator.php
OAuthNegotiator.requestToken
private function requestToken($code, $tokenType) { $authApi = new PestJSON("{$_SESSION[self::SESSION][self::OAUTH_ENDPOINT]}"); try { $response = $authApi->post('token', array( self::CLIENT_ID => $_SESSION[self::SESSION][self::CLIENT_ID], self::REDIRECT_URI => $_SESSION[self::SESSION][self::REDIREC...
php
private function requestToken($code, $tokenType) { $authApi = new PestJSON("{$_SESSION[self::SESSION][self::OAUTH_ENDPOINT]}"); try { $response = $authApi->post('token', array( self::CLIENT_ID => $_SESSION[self::SESSION][self::CLIENT_ID], self::REDIRECT_URI => $_SESSION[self::SESSION][self::REDIREC...
[ "private", "function", "requestToken", "(", "$", "code", ",", "$", "tokenType", ")", "{", "$", "authApi", "=", "new", "PestJSON", "(", "\"{$_SESSION[self::SESSION][self::OAUTH_ENDPOINT]}\"", ")", ";", "try", "{", "$", "response", "=", "$", "authApi", "->", "po...
Request a token from the OAuth server @param string $code An authorization code provided by the OAuth server @param string $tokenType Type of token being requested (IDENTITY_TOKEN|API_TOKEN) @return void Updates session variables @throws OAuthNegotiator_Exception TOKEN_RESPONSE if a token no token is received or on ...
[ "Request", "a", "token", "from", "the", "OAuth", "server" ]
f29099100cb931582058139cbedc5d1e65a8255a
https://github.com/smtech/obsolete__oauth-negotiator/blob/f29099100cb931582058139cbedc5d1e65a8255a/OAuthNegotiator.php#L431-L463
193,015
FuzeWorks/Core
src/FuzeWorks/Router.php
Router.addRoute
public function addRoute($route, $callable, $prepend = true) { if ($prepend) { $this->routes = array($route => $callable) + $this->routes; } else { $this->routes[$route] = $callable; } $this->logger->log('Route added at '.($prepend ? 'top' : 'bottom').': "'.$...
php
public function addRoute($route, $callable, $prepend = true) { if ($prepend) { $this->routes = array($route => $callable) + $this->routes; } else { $this->routes[$route] = $callable; } $this->logger->log('Route added at '.($prepend ? 'top' : 'bottom').': "'.$...
[ "public", "function", "addRoute", "(", "$", "route", ",", "$", "callable", ",", "$", "prepend", "=", "true", ")", "{", "if", "(", "$", "prepend", ")", "{", "$", "this", "->", "routes", "=", "array", "(", "$", "route", "=>", "$", "callable", ")", ...
Add a route to the Router's routing table The route consists of 2 parts: the route and data. The route is a regex string which will later be matched upon Router::route(). The data can be multiple things. First it can be a string, which will later be processed and turned into a callable. If the string is like 'contro...
[ "Add", "a", "route", "to", "the", "Router", "s", "routing", "table" ]
051c64fdaa3a648174cbd54557d05ad553dd826b
https://github.com/FuzeWorks/Core/blob/051c64fdaa3a648174cbd54557d05ad553dd826b/src/FuzeWorks/Router.php#L282-L291
193,016
FuzeWorks/Core
src/FuzeWorks/Router.php
Router.route
public function route($performLoading = true): bool { // Turn the segment array into a URI string $uri = implode('/', $this->uri->segments); // Fire the event to notify our modules $event = Events::fireEvent('routerRouteEvent', $this->routes, $performLoading, $uri); // The ...
php
public function route($performLoading = true): bool { // Turn the segment array into a URI string $uri = implode('/', $this->uri->segments); // Fire the event to notify our modules $event = Events::fireEvent('routerRouteEvent', $this->routes, $performLoading, $uri); // The ...
[ "public", "function", "route", "(", "$", "performLoading", "=", "true", ")", ":", "bool", "{", "// Turn the segment array into a URI string", "$", "uri", "=", "implode", "(", "'/'", ",", "$", "this", "->", "uri", "->", "segments", ")", ";", "// Fire the event ...
Extracts the routing path from the URL using the routing table. Determines what should be loaded and what data matches the route regex. @param bool $performLoading Immediate process the route after it has been determined
[ "Extracts", "the", "routing", "path", "from", "the", "URL", "using", "the", "routing", "table", "." ]
051c64fdaa3a648174cbd54557d05ad553dd826b
https://github.com/FuzeWorks/Core/blob/051c64fdaa3a648174cbd54557d05ad553dd826b/src/FuzeWorks/Router.php#L312-L398
193,017
FuzeWorks/Core
src/FuzeWorks/Router.php
Router.routeDefault
protected function routeDefault($segments = array(), $route) { // If we don't have any segments left - try the default controller; // WARNING: Directories get shifted out of the segments array! if (empty($segments)) { $segments[0] = $this->config->routing->default_control...
php
protected function routeDefault($segments = array(), $route) { // If we don't have any segments left - try the default controller; // WARNING: Directories get shifted out of the segments array! if (empty($segments)) { $segments[0] = $this->config->routing->default_control...
[ "protected", "function", "routeDefault", "(", "$", "segments", "=", "array", "(", ")", ",", "$", "route", ")", "{", "// If we don't have any segments left - try the default controller;", "// WARNING: Directories get shifted out of the segments array!", "if", "(", "empty", "("...
Converts a routing string into parameters for the defaultCallable. @param array $segments Segments of the controller,method,parameters to open @param string @route The route which was matched @return void
[ "Converts", "a", "routing", "string", "into", "parameters", "for", "the", "defaultCallable", "." ]
051c64fdaa3a648174cbd54557d05ad553dd826b
https://github.com/FuzeWorks/Core/blob/051c64fdaa3a648174cbd54557d05ad553dd826b/src/FuzeWorks/Router.php#L407-L444
193,018
FuzeWorks/Core
src/FuzeWorks/Router.php
Router.loadCallable
public function loadCallable($matches = array(), $route): bool { $this->logger->newLevel('Loading callable'); // Fire the event to notify our modules $event = Events::fireEvent('routerLoadCallableEvent', $this->callable, $matches, $route); // The event has been cancelled if...
php
public function loadCallable($matches = array(), $route): bool { $this->logger->newLevel('Loading callable'); // Fire the event to notify our modules $event = Events::fireEvent('routerLoadCallableEvent', $this->callable, $matches, $route); // The event has been cancelled if...
[ "public", "function", "loadCallable", "(", "$", "matches", "=", "array", "(", ")", ",", "$", "route", ")", ":", "bool", "{", "$", "this", "->", "logger", "->", "newLevel", "(", "'Loading callable'", ")", ";", "// Fire the event to notify our modules", "$", "...
Load the callable to which the route matched. First it checks if it is possible to call the callable. If not, the default callable gets selected and a controller, function and parameters get selected. Then the arguments get prepared and finally the callable is called. @param array Preg matches with the routing pat...
[ "Load", "the", "callable", "to", "which", "the", "route", "matched", "." ]
051c64fdaa3a648174cbd54557d05ad553dd826b
https://github.com/FuzeWorks/Core/blob/051c64fdaa3a648174cbd54557d05ad553dd826b/src/FuzeWorks/Router.php#L458-L510
193,019
FuzeWorks/Core
src/FuzeWorks/Router.php
Router.defaultCallable
public function defaultCallable($arguments = array()): bool { $this->logger->log('Default callable called!'); $controller = $arguments['controller']; $function = $arguments['function']; $parameters = empty($arguments['parameters']) ? null : $arguments['parameters']; // Cons...
php
public function defaultCallable($arguments = array()): bool { $this->logger->log('Default callable called!'); $controller = $arguments['controller']; $function = $arguments['function']; $parameters = empty($arguments['parameters']) ? null : $arguments['parameters']; // Cons...
[ "public", "function", "defaultCallable", "(", "$", "arguments", "=", "array", "(", ")", ")", ":", "bool", "{", "$", "this", "->", "logger", "->", "log", "(", "'Default callable called!'", ")", ";", "$", "controller", "=", "$", "arguments", "[", "'controlle...
The default callable. This callable will do the 'old skool' routing. It will load the controllers from the controller-directory in the application-directory.
[ "The", "default", "callable", "." ]
051c64fdaa3a648174cbd54557d05ad553dd826b
https://github.com/FuzeWorks/Core/blob/051c64fdaa3a648174cbd54557d05ad553dd826b/src/FuzeWorks/Router.php#L518-L587
193,020
codeup-berlin/interop-mvc
src/Middleware/Stack/Server/ArraySelfDelegate.php
ArraySelfDelegate.withMiddleware
public function withMiddleware(MiddlewareInterface $middleware) { if (!($middleware instanceof ServerMiddlewareInterface)) { throw new \InvalidArgumentException('ServerMiddlewareInterface request expected.'); } foreach ($this->middlewares as $m) { if ($m === $middlew...
php
public function withMiddleware(MiddlewareInterface $middleware) { if (!($middleware instanceof ServerMiddlewareInterface)) { throw new \InvalidArgumentException('ServerMiddlewareInterface request expected.'); } foreach ($this->middlewares as $m) { if ($m === $middlew...
[ "public", "function", "withMiddleware", "(", "MiddlewareInterface", "$", "middleware", ")", "{", "if", "(", "!", "(", "$", "middleware", "instanceof", "ServerMiddlewareInterface", ")", ")", "{", "throw", "new", "\\", "InvalidArgumentException", "(", "'ServerMiddlewa...
Return an instance with the specified middleware added to the stack. This method MUST be implemented in such a way as to retain the immutability of the stack, and MUST return an instance that contains the specified middleware. @param MiddlewareInterface $middleware @return self
[ "Return", "an", "instance", "with", "the", "specified", "middleware", "added", "to", "the", "stack", ".", "This", "method", "MUST", "be", "implemented", "in", "such", "a", "way", "as", "to", "retain", "the", "immutability", "of", "the", "stack", "and", "MU...
b21818b7d060f3934d1225fb0d9fbefdf21a9894
https://github.com/codeup-berlin/interop-mvc/blob/b21818b7d060f3934d1225fb0d9fbefdf21a9894/src/Middleware/Stack/Server/ArraySelfDelegate.php#L47-L61
193,021
codeup-berlin/interop-mvc
src/Middleware/Stack/Server/ArraySelfDelegate.php
ArraySelfDelegate.withoutMiddleware
public function withoutMiddleware(MiddlewareInterface $middleware) { if (!($middleware instanceof ServerMiddlewareInterface)) { throw new \InvalidArgumentException('ServerMiddlewareInterface request expected.'); } foreach ($this->middlewares as $k => $m) { if ($m ===...
php
public function withoutMiddleware(MiddlewareInterface $middleware) { if (!($middleware instanceof ServerMiddlewareInterface)) { throw new \InvalidArgumentException('ServerMiddlewareInterface request expected.'); } foreach ($this->middlewares as $k => $m) { if ($m ===...
[ "public", "function", "withoutMiddleware", "(", "MiddlewareInterface", "$", "middleware", ")", "{", "if", "(", "!", "(", "$", "middleware", "instanceof", "ServerMiddlewareInterface", ")", ")", "{", "throw", "new", "\\", "InvalidArgumentException", "(", "'ServerMiddl...
Return an instance without the specified middleware. This method MUST be implemented in such a way as to retain the immutability of the stack, and MUST return an instance that does not contain the specified middleware. @param MiddlewareInterface $middleware @return self
[ "Return", "an", "instance", "without", "the", "specified", "middleware", ".", "This", "method", "MUST", "be", "implemented", "in", "such", "a", "way", "as", "to", "retain", "the", "immutability", "of", "the", "stack", "and", "MUST", "return", "an", "instance...
b21818b7d060f3934d1225fb0d9fbefdf21a9894
https://github.com/codeup-berlin/interop-mvc/blob/b21818b7d060f3934d1225fb0d9fbefdf21a9894/src/Middleware/Stack/Server/ArraySelfDelegate.php#L72-L86
193,022
codeup-berlin/interop-mvc
src/Middleware/Stack/Server/ArraySelfDelegate.php
ArraySelfDelegate.process
public function process(RequestInterface $request) { if ($this->processingStack !== null) { throw new \RuntimeException('Middleware stack is already processing.'); } if (!count($this->middlewares)) { throw new \RuntimeException('Middleware stack is empty.'); }...
php
public function process(RequestInterface $request) { if ($this->processingStack !== null) { throw new \RuntimeException('Middleware stack is already processing.'); } if (!count($this->middlewares)) { throw new \RuntimeException('Middleware stack is empty.'); }...
[ "public", "function", "process", "(", "RequestInterface", "$", "request", ")", "{", "if", "(", "$", "this", "->", "processingStack", "!==", "null", ")", "{", "throw", "new", "\\", "RuntimeException", "(", "'Middleware stack is already processing.'", ")", ";", "}...
Process the request through middleware and return the response. This method MUST be implemented in such a way as to allow the same stack to be reused for processing multiple requests in sequence. @param RequestInterface $request @return ResponseInterface
[ "Process", "the", "request", "through", "middleware", "and", "return", "the", "response", ".", "This", "method", "MUST", "be", "implemented", "in", "such", "a", "way", "as", "to", "allow", "the", "same", "stack", "to", "be", "reused", "for", "processing", ...
b21818b7d060f3934d1225fb0d9fbefdf21a9894
https://github.com/codeup-berlin/interop-mvc/blob/b21818b7d060f3934d1225fb0d9fbefdf21a9894/src/Middleware/Stack/Server/ArraySelfDelegate.php#L96-L111
193,023
climphp/Clim
Clim/Container.php
Container.registerDefaultServices
public static function registerDefaultServices(ContainerInterface $container) { if (!$container->has('argv')) { $container['argv'] = $_SERVER['argv']; } if (!$container->has('Debug')) { $container['Debug'] = function (ContainerInterface $c) { return n...
php
public static function registerDefaultServices(ContainerInterface $container) { if (!$container->has('argv')) { $container['argv'] = $_SERVER['argv']; } if (!$container->has('Debug')) { $container['Debug'] = function (ContainerInterface $c) { return n...
[ "public", "static", "function", "registerDefaultServices", "(", "ContainerInterface", "$", "container", ")", "{", "if", "(", "!", "$", "container", "->", "has", "(", "'argv'", ")", ")", "{", "$", "container", "[", "'argv'", "]", "=", "$", "_SERVER", "[", ...
This function registers the default services that Clim needs to work. All services are shared - that is, they are registered such that the same instance is returned on subsequent calls. @return void
[ "This", "function", "registers", "the", "default", "services", "that", "Clim", "needs", "to", "work", "." ]
d2d09a82e1b7a0b8d454e585e6db421ff02ec8e4
https://github.com/climphp/Clim/blob/d2d09a82e1b7a0b8d454e585e6db421ff02ec8e4/Clim/Container.php#L54-L90
193,024
eliasis-framework/complement
src/Traits/ComplementState.php
ComplementState.setState
public function setState($state) { $this->complement['state'] = $state; $this->states['state'] = $state; $this->setStates(); return $state; }
php
public function setState($state) { $this->complement['state'] = $state; $this->states['state'] = $state; $this->setStates(); return $state; }
[ "public", "function", "setState", "(", "$", "state", ")", "{", "$", "this", "->", "complement", "[", "'state'", "]", "=", "$", "state", ";", "$", "this", "->", "states", "[", "'state'", "]", "=", "$", "state", ";", "$", "this", "->", "setStates", "...
Set complement state. @param string $state → complement state @return string → state
[ "Set", "complement", "state", "." ]
d50e92cf01600ff4573bf1761c312069044748c3
https://github.com/eliasis-framework/complement/blob/d50e92cf01600ff4573bf1761c312069044748c3/src/Traits/ComplementState.php#L84-L91
193,025
eliasis-framework/complement
src/Traits/ComplementState.php
ComplementState.changeState
public function changeState() { $this->getStates(); $actualState = $this->getState(); $newState = self::$statesHandler[$actualState]['state']; $action = self::$statesHandler[$actualState]['action']; $this->setState($newState); $this->doAction($action); retu...
php
public function changeState() { $this->getStates(); $actualState = $this->getState(); $newState = self::$statesHandler[$actualState]['state']; $action = self::$statesHandler[$actualState]['action']; $this->setState($newState); $this->doAction($action); retu...
[ "public", "function", "changeState", "(", ")", "{", "$", "this", "->", "getStates", "(", ")", ";", "$", "actualState", "=", "$", "this", "->", "getState", "(", ")", ";", "$", "newState", "=", "self", "::", "$", "statesHandler", "[", "$", "actualState",...
Change complement state. @uses \Eliasis\Complement\Traits\ComplementAction::doAction() @return string → new state
[ "Change", "complement", "state", "." ]
d50e92cf01600ff4573bf1761c312069044748c3
https://github.com/eliasis-framework/complement/blob/d50e92cf01600ff4573bf1761c312069044748c3/src/Traits/ComplementState.php#L100-L112
193,026
eliasis-framework/complement
src/Traits/ComplementState.php
ComplementState.getState
public function getState() { if (isset($this->states['state'])) { return $this->states['state']; } elseif (isset($this->complement['state'])) { return $this->complement['state']; } $type = self::getType(); return self::$defaultStates[$type]; }
php
public function getState() { if (isset($this->states['state'])) { return $this->states['state']; } elseif (isset($this->complement['state'])) { return $this->complement['state']; } $type = self::getType(); return self::$defaultStates[$type]; }
[ "public", "function", "getState", "(", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "states", "[", "'state'", "]", ")", ")", "{", "return", "$", "this", "->", "states", "[", "'state'", "]", ";", "}", "elseif", "(", "isset", "(", "$", "th...
Get complement state. @uses \Eliasis\Framework\App::complements() @uses \Eliasis\Complement\Traits\ComplementHandler::getType() @return string → complement state
[ "Get", "complement", "state", "." ]
d50e92cf01600ff4573bf1761c312069044748c3
https://github.com/eliasis-framework/complement/blob/d50e92cf01600ff4573bf1761c312069044748c3/src/Traits/ComplementState.php#L122-L133
193,027
eliasis-framework/complement
src/Traits/ComplementState.php
ComplementState.getStates
public function getStates() { $appID = App::getCurrentID(); $complementID = self::getCurrentID(); $states = $this->getStatesFromFile(); if (isset($states[$appID][$complementID])) { return $this->states = $states[$appID][$complementID]; } return $this->st...
php
public function getStates() { $appID = App::getCurrentID(); $complementID = self::getCurrentID(); $states = $this->getStatesFromFile(); if (isset($states[$appID][$complementID])) { return $this->states = $states[$appID][$complementID]; } return $this->st...
[ "public", "function", "getStates", "(", ")", "{", "$", "appID", "=", "App", "::", "getCurrentID", "(", ")", ";", "$", "complementID", "=", "self", "::", "getCurrentID", "(", ")", ";", "$", "states", "=", "$", "this", "->", "getStatesFromFile", "(", ")"...
Get complements states. @uses \Eliasis\Framework\App::getCurrentID() @uses \Eliasis\Complement\Complement::getCurrentID() @return array → complements states
[ "Get", "complements", "states", "." ]
d50e92cf01600ff4573bf1761c312069044748c3
https://github.com/eliasis-framework/complement/blob/d50e92cf01600ff4573bf1761c312069044748c3/src/Traits/ComplementState.php#L143-L154
193,028
eliasis-framework/complement
src/Traits/ComplementState.php
ComplementState.setStates
private function setStates() { $appID = App::getCurrentID(); $complementID = self::getCurrentID(); if (! is_null($this->states)) { $states = $this->getStatesFromFile(); if ($this->stateChanged($states)) { $file = $this->getStatesFilePath(); ...
php
private function setStates() { $appID = App::getCurrentID(); $complementID = self::getCurrentID(); if (! is_null($this->states)) { $states = $this->getStatesFromFile(); if ($this->stateChanged($states)) { $file = $this->getStatesFilePath(); ...
[ "private", "function", "setStates", "(", ")", "{", "$", "appID", "=", "App", "::", "getCurrentID", "(", ")", ";", "$", "complementID", "=", "self", "::", "getCurrentID", "(", ")", ";", "if", "(", "!", "is_null", "(", "$", "this", "->", "states", ")",...
Set complements states. @uses \Eliasis\Framework\App::getCurrentID() @uses \Eliasis\Complement\Complement::getCurrentID() @uses \Josantonius\Json\Json::arrayToFile() @uses \Josantonius\Hook\Hook::doAction()
[ "Set", "complements", "states", "." ]
d50e92cf01600ff4573bf1761c312069044748c3
https://github.com/eliasis-framework/complement/blob/d50e92cf01600ff4573bf1761c312069044748c3/src/Traits/ComplementState.php#L164-L179
193,029
eliasis-framework/complement
src/Traits/ComplementState.php
ComplementState.stateChanged
private function stateChanged($states) { $appID = App::getCurrentID(); $complementID = self::getCurrentID(); if (isset($states[$appID][$complementID])) { $actualStates = $states[$appID][$complementID]; if (! count(array_diff_assoc($actualStates, $this->states))) { ...
php
private function stateChanged($states) { $appID = App::getCurrentID(); $complementID = self::getCurrentID(); if (isset($states[$appID][$complementID])) { $actualStates = $states[$appID][$complementID]; if (! count(array_diff_assoc($actualStates, $this->states))) { ...
[ "private", "function", "stateChanged", "(", "$", "states", ")", "{", "$", "appID", "=", "App", "::", "getCurrentID", "(", ")", ";", "$", "complementID", "=", "self", "::", "getCurrentID", "(", ")", ";", "if", "(", "isset", "(", "$", "states", "[", "$...
Check if complement state has changed. @param string $states → complement states @uses \Eliasis\Framework\App::getCurrentID() @uses \Eliasis\Complement\Complement::getCurrentID() @return bool
[ "Check", "if", "complement", "state", "has", "changed", "." ]
d50e92cf01600ff4573bf1761c312069044748c3
https://github.com/eliasis-framework/complement/blob/d50e92cf01600ff4573bf1761c312069044748c3/src/Traits/ComplementState.php#L191-L205
193,030
eliasis-framework/complement
src/Traits/ComplementState.php
ComplementState.getStatesFilePath
private function getStatesFilePath() { $type = self::getType(); $complementType = self::getType('strtoupper'); return App::$complementType() . '.' . $type . '-states.json'; }
php
private function getStatesFilePath() { $type = self::getType(); $complementType = self::getType('strtoupper'); return App::$complementType() . '.' . $type . '-states.json'; }
[ "private", "function", "getStatesFilePath", "(", ")", "{", "$", "type", "=", "self", "::", "getType", "(", ")", ";", "$", "complementType", "=", "self", "::", "getType", "(", "'strtoupper'", ")", ";", "return", "App", "::", "$", "complementType", "(", ")...
Get complements file path. @uses \Eliasis\Framework\App::COMPLEMENT() @uses \Eliasis\Complement\Traits\ComplementHandler::getType() @return string → complements file path
[ "Get", "complements", "file", "path", "." ]
d50e92cf01600ff4573bf1761c312069044748c3
https://github.com/eliasis-framework/complement/blob/d50e92cf01600ff4573bf1761c312069044748c3/src/Traits/ComplementState.php#L227-L233
193,031
squareproton/Bond
src/Bond/RecordManager/Response.php
Response.rollback
public function rollback( $transaction ) { $status = $this->getStatus( $transaction); if( count($status) !== 1 ) { throw new \LogicException("You can't rollback more than 1 transaction"); } list( $transaction, $transactionStatus ) = each( $status ); // rollback ...
php
public function rollback( $transaction ) { $status = $this->getStatus( $transaction); if( count($status) !== 1 ) { throw new \LogicException("You can't rollback more than 1 transaction"); } list( $transaction, $transactionStatus ) = each( $status ); // rollback ...
[ "public", "function", "rollback", "(", "$", "transaction", ")", "{", "$", "status", "=", "$", "this", "->", "getStatus", "(", "$", "transaction", ")", ";", "if", "(", "count", "(", "$", "status", ")", "!==", "1", ")", "{", "throw", "new", "\\", "Lo...
Rollback a named transaction @param <type> $transaction
[ "Rollback", "a", "named", "transaction" ]
a04ad9dd1a35adeaec98237716c2a41ce02b4f1a
https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/RecordManager/Response.php#L83-L99
193,032
squareproton/Bond
src/Bond/RecordManager/Response.php
Response.isSuccess
public function isSuccess( $transaction = RecordManager::TRANSACTIONS_ALL ) { $output = true; foreach( $this->getStatus($transaction) as $transaction => $transactionStatus ) { foreach( $transactionStatus as $status ) { $output = ( $output && $status === self::SUCCESS ); ...
php
public function isSuccess( $transaction = RecordManager::TRANSACTIONS_ALL ) { $output = true; foreach( $this->getStatus($transaction) as $transaction => $transactionStatus ) { foreach( $transactionStatus as $status ) { $output = ( $output && $status === self::SUCCESS ); ...
[ "public", "function", "isSuccess", "(", "$", "transaction", "=", "RecordManager", "::", "TRANSACTIONS_ALL", ")", "{", "$", "output", "=", "true", ";", "foreach", "(", "$", "this", "->", "getStatus", "(", "$", "transaction", ")", "as", "$", "transaction", "...
Has a named transaction been executed successfully @param scalar $transaction @return bool
[ "Has", "a", "named", "transaction", "been", "executed", "successfully" ]
a04ad9dd1a35adeaec98237716c2a41ce02b4f1a
https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/RecordManager/Response.php#L106-L115
193,033
squareproton/Bond
src/Bond/RecordManager/Response.php
Response.isRolledback
public function isRolledback( $transaction = RecordManager::TRANSACTIONS_ALL ) { $output = false; foreach( $this->getStatus($transaction) as $transaction => $transactionStatus ) { foreach( $transactionStatus as $status ) { $output = ( $output || $status === self::ROLLEDBA...
php
public function isRolledback( $transaction = RecordManager::TRANSACTIONS_ALL ) { $output = false; foreach( $this->getStatus($transaction) as $transaction => $transactionStatus ) { foreach( $transactionStatus as $status ) { $output = ( $output || $status === self::ROLLEDBA...
[ "public", "function", "isRolledback", "(", "$", "transaction", "=", "RecordManager", "::", "TRANSACTIONS_ALL", ")", "{", "$", "output", "=", "false", ";", "foreach", "(", "$", "this", "->", "getStatus", "(", "$", "transaction", ")", "as", "$", "transaction",...
Has a named transaction been rolledback @param scalar $transaction @return bool
[ "Has", "a", "named", "transaction", "been", "rolledback" ]
a04ad9dd1a35adeaec98237716c2a41ce02b4f1a
https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/RecordManager/Response.php#L122-L131
193,034
squareproton/Bond
src/Bond/RecordManager/Response.php
Response.doneAnything
public function doneAnything() { $output = false; foreach( $this->status as $transaction => $transactionStatus ) { foreach( $transactionStatus as $status ) { $output = ( $output || $status === self::SUCCESS ); } } return $output; }
php
public function doneAnything() { $output = false; foreach( $this->status as $transaction => $transactionStatus ) { foreach( $transactionStatus as $status ) { $output = ( $output || $status === self::SUCCESS ); } } return $output; }
[ "public", "function", "doneAnything", "(", ")", "{", "$", "output", "=", "false", ";", "foreach", "(", "$", "this", "->", "status", "as", "$", "transaction", "=>", "$", "transactionStatus", ")", "{", "foreach", "(", "$", "transactionStatus", "as", "$", "...
Have we actually done anything? @return bool
[ "Have", "we", "actually", "done", "anything?" ]
a04ad9dd1a35adeaec98237716c2a41ce02b4f1a
https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/RecordManager/Response.php#L137-L146
193,035
squareproton/Bond
src/Bond/RecordManager/Response.php
Response.filterByObject
public function filterByObject( $objectOrArray ) { $response = new Response(); if( !is_array($objectOrArray) ) { $objectOrArray = array( $objectOrArray ); } foreach( $objectOrArray as $object ) { if( !is_object($object) ) { throw new \Inval...
php
public function filterByObject( $objectOrArray ) { $response = new Response(); if( !is_array($objectOrArray) ) { $objectOrArray = array( $objectOrArray ); } foreach( $objectOrArray as $object ) { if( !is_object($object) ) { throw new \Inval...
[ "public", "function", "filterByObject", "(", "$", "objectOrArray", ")", "{", "$", "response", "=", "new", "Response", "(", ")", ";", "if", "(", "!", "is_array", "(", "$", "objectOrArray", ")", ")", "{", "$", "objectOrArray", "=", "array", "(", "$", "ob...
Get transaction response by object @param object|array $object @return $response
[ "Get", "transaction", "response", "by", "object" ]
a04ad9dd1a35adeaec98237716c2a41ce02b4f1a
https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/RecordManager/Response.php#L215-L249
193,036
codeblanche/Web
src/Web/Response/Status.php
Status.getStatusText
public function getStatusText() { $statusCode = $this->getStatusCode(); if (!isset($this->defaultStatusTextList[$statusCode])) { return ''; } return $this->defaultStatusTextList[$statusCode]; }
php
public function getStatusText() { $statusCode = $this->getStatusCode(); if (!isset($this->defaultStatusTextList[$statusCode])) { return ''; } return $this->defaultStatusTextList[$statusCode]; }
[ "public", "function", "getStatusText", "(", ")", "{", "$", "statusCode", "=", "$", "this", "->", "getStatusCode", "(", ")", ";", "if", "(", "!", "isset", "(", "$", "this", "->", "defaultStatusTextList", "[", "$", "statusCode", "]", ")", ")", "{", "retu...
Retrieve the status text or empty string if one cannot be found @return string
[ "Retrieve", "the", "status", "text", "or", "empty", "string", "if", "one", "cannot", "be", "found" ]
3e9ebf1943d3ea468f619ba99f7cc10714cb16e9
https://github.com/codeblanche/Web/blob/3e9ebf1943d3ea468f619ba99f7cc10714cb16e9/src/Web/Response/Status.php#L170-L179
193,037
crazedsanity/AuthToken
src/authtoken/AuthToken.class.php
AuthToken.lookup_token_type
public function lookup_token_type($findThis) { $retval = 0; $sql = "SELECT * FROM cswal_token_type_table WHERE token_type=:type"; try { $numrows = $this->db->run_query($sql, array('type'=> $findThis)); if($numrows == 1) { $data = $this->db->get_single_record(); $retval = $data['token_type_id'...
php
public function lookup_token_type($findThis) { $retval = 0; $sql = "SELECT * FROM cswal_token_type_table WHERE token_type=:type"; try { $numrows = $this->db->run_query($sql, array('type'=> $findThis)); if($numrows == 1) { $data = $this->db->get_single_record(); $retval = $data['token_type_id'...
[ "public", "function", "lookup_token_type", "(", "$", "findThis", ")", "{", "$", "retval", "=", "0", ";", "$", "sql", "=", "\"SELECT * FROM cswal_token_type_table WHERE token_type=:type\"", ";", "try", "{", "$", "numrows", "=", "$", "this", "->", "db", "->", "r...
Lookup a token type. @param type $findThis (str) searches the "token_type" column for this. @return int token_type_id that was found; default 0 (unknown) @throws exception
[ "Lookup", "a", "token", "type", "." ]
f6ac0d5575b01ba001b62f2467f27615d58f911c
https://github.com/crazedsanity/AuthToken/blob/f6ac0d5575b01ba001b62f2467f27615d58f911c/src/authtoken/AuthToken.class.php#L131-L147
193,038
crazedsanity/AuthToken
src/authtoken/AuthToken.class.php
AuthToken.update_type
public function update_type($id, $type, $desc) { $sql = "UPDATE cswal_token_type_table SET token_type=:type, token_desc=:desc WHERE token_type_id=:id"; $params = array( 'id' => $id, 'type' => $type, 'desc' => $desc, ); try { $retval = $this->db->run_update($sql, $params); } catch (Exception...
php
public function update_type($id, $type, $desc) { $sql = "UPDATE cswal_token_type_table SET token_type=:type, token_desc=:desc WHERE token_type_id=:id"; $params = array( 'id' => $id, 'type' => $type, 'desc' => $desc, ); try { $retval = $this->db->run_update($sql, $params); } catch (Exception...
[ "public", "function", "update_type", "(", "$", "id", ",", "$", "type", ",", "$", "desc", ")", "{", "$", "sql", "=", "\"UPDATE cswal_token_type_table SET token_type=:type, \n\t\t\ttoken_desc=:desc WHERE token_type_id=:id\"", ";", "$", "params", "=", "array", "(", "'id'...
Updates the given ID in the token_type table. @param $id (int) ID to update @param $type (str) value for token_type @param $desc (str) value for token_desc @return int Number of records updated (1) @throws Exception
[ "Updates", "the", "given", "ID", "in", "the", "token_type", "table", "." ]
f6ac0d5575b01ba001b62f2467f27615d58f911c
https://github.com/crazedsanity/AuthToken/blob/f6ac0d5575b01ba001b62f2467f27615d58f911c/src/authtoken/AuthToken.class.php#L183-L199
193,039
crazedsanity/AuthToken
src/authtoken/AuthToken.class.php
AuthToken.create_token
public function create_token($password, $valueToStore=null, $tokenId=null, $lifetime=null, $maxUses=null, $tokenType=0, $uid=0) { if(is_null($tokenId) || strlen($tokenId) < 1) { $tokenId = $this->generate_token_string(); } $finalHash = password_hash($password, $this->passAlgorithm); if(!is_numeri...
php
public function create_token($password, $valueToStore=null, $tokenId=null, $lifetime=null, $maxUses=null, $tokenType=0, $uid=0) { if(is_null($tokenId) || strlen($tokenId) < 1) { $tokenId = $this->generate_token_string(); } $finalHash = password_hash($password, $this->passAlgorithm); if(!is_numeri...
[ "public", "function", "create_token", "(", "$", "password", ",", "$", "valueToStore", "=", "null", ",", "$", "tokenId", "=", "null", ",", "$", "lifetime", "=", "null", ",", "$", "maxUses", "=", "null", ",", "$", "tokenType", "=", "0", ",", "$", "uid"...
Build a token record in the database that can be authenticated against later. @param $password (str) matches checksum column... @param $valueToStore (mixed, optional) item to be stored, will be serialized @param $tokenId (str, optional) key to match against @param $lifetime (str,optional) string (interval) represen...
[ "Build", "a", "token", "record", "in", "the", "database", "that", "can", "be", "authenticated", "against", "later", "." ]
f6ac0d5575b01ba001b62f2467f27615d58f911c
https://github.com/crazedsanity/AuthToken/blob/f6ac0d5575b01ba001b62f2467f27615d58f911c/src/authtoken/AuthToken.class.php#L224-L280
193,040
crazedsanity/AuthToken
src/authtoken/AuthToken.class.php
AuthToken.destroy_token
public function destroy_token($tokenId) { try { $sql = "DELETE FROM ". $this->table ." WHERE auth_token_id=:tokenId"; $deleteRes = $this->db->run_update($sql, array('tokenId'=>$tokenId)); } catch(exception $e) { throw new exception(__METHOD__ .": failed to destroy token::: ". $e->getMessage()); } ...
php
public function destroy_token($tokenId) { try { $sql = "DELETE FROM ". $this->table ." WHERE auth_token_id=:tokenId"; $deleteRes = $this->db->run_update($sql, array('tokenId'=>$tokenId)); } catch(exception $e) { throw new exception(__METHOD__ .": failed to destroy token::: ". $e->getMessage()); } ...
[ "public", "function", "destroy_token", "(", "$", "tokenId", ")", "{", "try", "{", "$", "sql", "=", "\"DELETE FROM \"", ".", "$", "this", "->", "table", ".", "\" WHERE auth_token_id=:tokenId\"", ";", "$", "deleteRes", "=", "$", "this", "->", "db", "->", "ru...
Deletes the given token ID from the database. @param $tokenId (int) auth_token_id to delete @return (int) PASS: this many were deleted (should always be 1) @return (exception) FAIL: exception contains error details
[ "Deletes", "the", "given", "token", "ID", "from", "the", "database", "." ]
f6ac0d5575b01ba001b62f2467f27615d58f911c
https://github.com/crazedsanity/AuthToken/blob/f6ac0d5575b01ba001b62f2467f27615d58f911c/src/authtoken/AuthToken.class.php#L319-L329
193,041
crazedsanity/AuthToken
src/authtoken/AuthToken.class.php
AuthToken.get_token_data
public function get_token_data($tokenId) { try { $sql = "SELECT *, (max_uses - total_uses) as remaining_uses, " . "(NOW() - expiration) as time_remaining " . "FROM ". $this->table ." AS t1 INNER JOIN cswal_token_type_table AS t2 ON (t1.token_type_id=t2.token_type_id) WHERE auth_token_id=:tok...
php
public function get_token_data($tokenId) { try { $sql = "SELECT *, (max_uses - total_uses) as remaining_uses, " . "(NOW() - expiration) as time_remaining " . "FROM ". $this->table ." AS t1 INNER JOIN cswal_token_type_table AS t2 ON (t1.token_type_id=t2.token_type_id) WHERE auth_token_id=:tok...
[ "public", "function", "get_token_data", "(", "$", "tokenId", ")", "{", "try", "{", "$", "sql", "=", "\"SELECT *, (max_uses - total_uses) as remaining_uses, \"", ".", "\"(NOW() - expiration) as time_remaining \"", ".", "\"FROM \"", ".", "$", "this", "->", "table", ".", ...
Retrieve data for the given ID. @param $tokenId (int) auth_token_id to look up. @return (array) PASS: contains data about the given ID @return (exception) FAIL: exception contains error details.
[ "Retrieve", "data", "for", "the", "given", "ID", "." ]
f6ac0d5575b01ba001b62f2467f27615d58f911c
https://github.com/crazedsanity/AuthToken/blob/f6ac0d5575b01ba001b62f2467f27615d58f911c/src/authtoken/AuthToken.class.php#L396-L423
193,042
lasallecms/lasallecms-l5-lasallecmsemail-pkg
src/Validation/Validation.php
Validation.attachmentsHaveApprovedFileExtensions
public function attachmentsHaveApprovedFileExtensions($mappedVars) { if ($mappedVars['number_of_attachments'] == 0) { return true; } $approvedFileExtensions = config('lasallecmsemail.inbound_attachments_approved_file_extensions'); if (empty($approvedFileExtensions)) { ...
php
public function attachmentsHaveApprovedFileExtensions($mappedVars) { if ($mappedVars['number_of_attachments'] == 0) { return true; } $approvedFileExtensions = config('lasallecmsemail.inbound_attachments_approved_file_extensions'); if (empty($approvedFileExtensions)) { ...
[ "public", "function", "attachmentsHaveApprovedFileExtensions", "(", "$", "mappedVars", ")", "{", "if", "(", "$", "mappedVars", "[", "'number_of_attachments'", "]", "==", "0", ")", "{", "return", "true", ";", "}", "$", "approvedFileExtensions", "=", "config", "("...
All attachments have approved file extensions? @param array $mappedVars Inbound POST vars mapped to database fields @return bool
[ "All", "attachments", "have", "approved", "file", "extensions?" ]
95db5a59ab322105b9d3681cf9ab1f829c9fdb9f
https://github.com/lasallecms/lasallecms-l5-lasallecmsemail-pkg/blob/95db5a59ab322105b9d3681cf9ab1f829c9fdb9f/src/Validation/Validation.php#L45-L66
193,043
lasallecms/lasallecms-l5-lasallecmsemail-pkg
src/Validation/Validation.php
Validation.emailsComeFromListOfApprovedSenders
public function emailsComeFromListOfApprovedSenders($emailAddress) { // are we checking that inbound emails come from a pre-approved list of senders? if (!$this->isInboundEmailsFromAllowedSendersOnly()) { // we are *not* checking that emails come from a pre-approved list of senders ...
php
public function emailsComeFromListOfApprovedSenders($emailAddress) { // are we checking that inbound emails come from a pre-approved list of senders? if (!$this->isInboundEmailsFromAllowedSendersOnly()) { // we are *not* checking that emails come from a pre-approved list of senders ...
[ "public", "function", "emailsComeFromListOfApprovedSenders", "(", "$", "emailAddress", ")", "{", "// are we checking that inbound emails come from a pre-approved list of senders?", "if", "(", "!", "$", "this", "->", "isInboundEmailsFromAllowedSendersOnly", "(", ")", ")", "{", ...
Check if emails must come from a list of approved senders. That is, the person sending the email is allowed to send us inbound emails. @param string $emailAddress Email address of the person sending the email @return bool
[ "Check", "if", "emails", "must", "come", "from", "a", "list", "of", "approved", "senders", ".", "That", "is", "the", "person", "sending", "the", "email", "is", "allowed", "to", "send", "us", "inbound", "emails", "." ]
95db5a59ab322105b9d3681cf9ab1f829c9fdb9f
https://github.com/lasallecms/lasallecms-l5-lasallecmsemail-pkg/blob/95db5a59ab322105b9d3681cf9ab1f829c9fdb9f/src/Validation/Validation.php#L75-L93
193,044
Torann/skosh-generator
src/Twig/Extensions/SocialShare.php
SocialShare.generate
public static function generate($network, Content $page) { // Get text $text = self::truncate($page->description, 137); // Replace template with values return str_replace([ '{url}', '{title}', '{text}', '{image}' ], [ ...
php
public static function generate($network, Content $page) { // Get text $text = self::truncate($page->description, 137); // Replace template with values return str_replace([ '{url}', '{title}', '{text}', '{image}' ], [ ...
[ "public", "static", "function", "generate", "(", "$", "network", ",", "Content", "$", "page", ")", "{", "// Get text", "$", "text", "=", "self", "::", "truncate", "(", "$", "page", "->", "description", ",", "137", ")", ";", "// Replace template with values",...
Generate social network link. @param string $network @param Content $page @return string
[ "Generate", "social", "network", "link", "." ]
ea60e037d92398d7c146eb2349735d5692e3c48c
https://github.com/Torann/skosh-generator/blob/ea60e037d92398d7c146eb2349735d5692e3c48c/src/Twig/Extensions/SocialShare.php#L35-L52
193,045
KDF5000/EasyThink
src/ThinkPHP/Library/Vendor/Smarty/sysplugins/smarty_internal_template.php
Smarty_Internal_Template.decodeProperties
public function decodeProperties($properties, $cache = false) { $this->has_nocache_code = $properties['has_nocache_code']; $this->properties['nocache_hash'] = $properties['nocache_hash']; if (isset($properties['cache_lifetime'])) { $this->properties['cache_lifetime'] = $propertie...
php
public function decodeProperties($properties, $cache = false) { $this->has_nocache_code = $properties['has_nocache_code']; $this->properties['nocache_hash'] = $properties['nocache_hash']; if (isset($properties['cache_lifetime'])) { $this->properties['cache_lifetime'] = $propertie...
[ "public", "function", "decodeProperties", "(", "$", "properties", ",", "$", "cache", "=", "false", ")", "{", "$", "this", "->", "has_nocache_code", "=", "$", "properties", "[", "'has_nocache_code'", "]", ";", "$", "this", "->", "properties", "[", "'nocache_h...
This function is executed automatically when a compiled or cached template file is included - Decode saved properties from compiled template and cache files - Check if compiled or cache file is valid @param array $properties special template properties @param bool $cache flag if called from cache file @...
[ "This", "function", "is", "executed", "automatically", "when", "a", "compiled", "or", "cached", "template", "file", "is", "included" ]
86efc9c8a0d504e01e2fea55868227fdc8928841
https://github.com/KDF5000/EasyThink/blob/86efc9c8a0d504e01e2fea55868227fdc8928841/src/ThinkPHP/Library/Vendor/Smarty/sysplugins/smarty_internal_template.php#L419-L471
193,046
gplcart/cli
controllers/commands/Store.php
Store.cmdGetStore
public function cmdGetStore() { $result = $this->getListStore(); $this->outputFormat($result); $this->outputFormatTableStore($result); $this->output(); }
php
public function cmdGetStore() { $result = $this->getListStore(); $this->outputFormat($result); $this->outputFormatTableStore($result); $this->output(); }
[ "public", "function", "cmdGetStore", "(", ")", "{", "$", "result", "=", "$", "this", "->", "getListStore", "(", ")", ";", "$", "this", "->", "outputFormat", "(", "$", "result", ")", ";", "$", "this", "->", "outputFormatTableStore", "(", "$", "result", ...
Callback for "store-get" command
[ "Callback", "for", "store", "-", "get", "command" ]
e57dba53e291a225b4bff0c0d9b23d685dd1c125
https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/Store.php#L58-L64
193,047
gplcart/cli
controllers/commands/Store.php
Store.cmdDeleteStore
public function cmdDeleteStore() { $id = $this->getParam(0); if (empty($id) || !is_numeric($id)) { $this->errorAndExit($this->text('Invalid argument')); } if (!$this->store->delete($id)) { $this->errorAndExit($this->text('Unexpected result')); } ...
php
public function cmdDeleteStore() { $id = $this->getParam(0); if (empty($id) || !is_numeric($id)) { $this->errorAndExit($this->text('Invalid argument')); } if (!$this->store->delete($id)) { $this->errorAndExit($this->text('Unexpected result')); } ...
[ "public", "function", "cmdDeleteStore", "(", ")", "{", "$", "id", "=", "$", "this", "->", "getParam", "(", "0", ")", ";", "if", "(", "empty", "(", "$", "id", ")", "||", "!", "is_numeric", "(", "$", "id", ")", ")", "{", "$", "this", "->", "error...
Callback for "store-delete" command
[ "Callback", "for", "store", "-", "delete", "command" ]
e57dba53e291a225b4bff0c0d9b23d685dd1c125
https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/Store.php#L69-L82
193,048
gplcart/cli
controllers/commands/Store.php
Store.cmdUpdateStore
public function cmdUpdateStore() { $params = $this->getParam(); if (empty($params[0]) || count($params) < 2) { $this->errorAndExit($this->text('Invalid command')); } if (!is_numeric($params[0])) { $this->errorAndExit($this->text('Invalid argument')); ...
php
public function cmdUpdateStore() { $params = $this->getParam(); if (empty($params[0]) || count($params) < 2) { $this->errorAndExit($this->text('Invalid command')); } if (!is_numeric($params[0])) { $this->errorAndExit($this->text('Invalid argument')); ...
[ "public", "function", "cmdUpdateStore", "(", ")", "{", "$", "params", "=", "$", "this", "->", "getParam", "(", ")", ";", "if", "(", "empty", "(", "$", "params", "[", "0", "]", ")", "||", "count", "(", "$", "params", ")", "<", "2", ")", "{", "$"...
Callback for "store-update" command
[ "Callback", "for", "store", "-", "update", "command" ]
e57dba53e291a225b4bff0c0d9b23d685dd1c125
https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/Store.php#L101-L121
193,049
gplcart/cli
controllers/commands/Store.php
Store.setStatusStore
protected function setStatusStore($status) { $id = $this->getParam(0); $all = $this->getParam('all'); if (!isset($id) && empty($all)) { $this->errorAndExit($this->text('Invalid command')); } $result = false; if (isset($id)) { if (!is_numeri...
php
protected function setStatusStore($status) { $id = $this->getParam(0); $all = $this->getParam('all'); if (!isset($id) && empty($all)) { $this->errorAndExit($this->text('Invalid command')); } $result = false; if (isset($id)) { if (!is_numeri...
[ "protected", "function", "setStatusStore", "(", "$", "status", ")", "{", "$", "id", "=", "$", "this", "->", "getParam", "(", "0", ")", ";", "$", "all", "=", "$", "this", "->", "getParam", "(", "'all'", ")", ";", "if", "(", "!", "isset", "(", "$",...
Sets status for one or several stores @param bool $status
[ "Sets", "status", "for", "one", "or", "several", "stores" ]
e57dba53e291a225b4bff0c0d9b23d685dd1c125
https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/Store.php#L127-L160
193,050
gplcart/cli
controllers/commands/Store.php
Store.submitAddStore
protected function submitAddStore() { $this->setSubmitted(null, $this->getParam()); $this->setSubmittedJson('data'); $this->validateComponent('store'); $this->addStore(); }
php
protected function submitAddStore() { $this->setSubmitted(null, $this->getParam()); $this->setSubmittedJson('data'); $this->validateComponent('store'); $this->addStore(); }
[ "protected", "function", "submitAddStore", "(", ")", "{", "$", "this", "->", "setSubmitted", "(", "null", ",", "$", "this", "->", "getParam", "(", ")", ")", ";", "$", "this", "->", "setSubmittedJson", "(", "'data'", ")", ";", "$", "this", "->", "valida...
Add a new store at once
[ "Add", "a", "new", "store", "at", "once" ]
e57dba53e291a225b4bff0c0d9b23d685dd1c125
https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/Store.php#L230-L237
193,051
gplcart/cli
controllers/commands/Store.php
Store.addStore
protected function addStore() { if (!$this->isError()) { $id = $this->store->add($this->getSubmitted()); if (empty($id)) { $this->errorAndExit($this->text('Unexpected result')); } $this->line($id); } }
php
protected function addStore() { if (!$this->isError()) { $id = $this->store->add($this->getSubmitted()); if (empty($id)) { $this->errorAndExit($this->text('Unexpected result')); } $this->line($id); } }
[ "protected", "function", "addStore", "(", ")", "{", "if", "(", "!", "$", "this", "->", "isError", "(", ")", ")", "{", "$", "id", "=", "$", "this", "->", "store", "->", "add", "(", "$", "this", "->", "getSubmitted", "(", ")", ")", ";", "if", "("...
Add a store
[ "Add", "a", "store" ]
e57dba53e291a225b4bff0c0d9b23d685dd1c125
https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/Store.php#L242-L251
193,052
gplcart/cli
controllers/commands/Store.php
Store.wizardAddStore
protected function wizardAddStore() { $this->validatePrompt('name', $this->text('Name'), 'store'); $this->validatePrompt('domain', $this->text('Domain or IP'), 'store'); $this->validatePrompt('basepath', $this->text('Path'), 'store', ''); $this->validatePrompt('status', $this->text('...
php
protected function wizardAddStore() { $this->validatePrompt('name', $this->text('Name'), 'store'); $this->validatePrompt('domain', $this->text('Domain or IP'), 'store'); $this->validatePrompt('basepath', $this->text('Path'), 'store', ''); $this->validatePrompt('status', $this->text('...
[ "protected", "function", "wizardAddStore", "(", ")", "{", "$", "this", "->", "validatePrompt", "(", "'name'", ",", "$", "this", "->", "text", "(", "'Name'", ")", ",", "'store'", ")", ";", "$", "this", "->", "validatePrompt", "(", "'domain'", ",", "$", ...
Add a new store step by step
[ "Add", "a", "new", "store", "step", "by", "step" ]
e57dba53e291a225b4bff0c0d9b23d685dd1c125
https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/Store.php#L256-L266
193,053
wb-crowdfusion/crowdfusion
system/core/classes/libraries/utils/ClassUtils.php
ClassUtils.getQualifiedType
public static function getQualifiedType($value) { if (is_null($value)) return 'NULL'; if (is_string($value)) return 'string'; else if (is_array($value)) { if (!empty ($value)) { foreach ($value as $val) { $array_type = ...
php
public static function getQualifiedType($value) { if (is_null($value)) return 'NULL'; if (is_string($value)) return 'string'; else if (is_array($value)) { if (!empty ($value)) { foreach ($value as $val) { $array_type = ...
[ "public", "static", "function", "getQualifiedType", "(", "$", "value", ")", "{", "if", "(", "is_null", "(", "$", "value", ")", ")", "return", "'NULL'", ";", "if", "(", "is_string", "(", "$", "value", ")", ")", "return", "'string'", ";", "else", "if", ...
Determines the type of the specified value @param mixed $value Any value @return string The type of the {@link $value} specified
[ "Determines", "the", "type", "of", "the", "specified", "value" ]
8cad7988f046a6fefbed07d026cb4ae6706c1217
https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/libraries/utils/ClassUtils.php#L57-L83
193,054
wb-crowdfusion/crowdfusion
system/core/classes/libraries/utils/ClassUtils.php
ClassUtils.compare
public static function compare($val1, $val2) { if(in_array(self::getQualifiedType($val1), array('int','boolean', 'float', 'NULL')) ) return $val1 == $val2 ? 0 : (($val1 < $val2) ? -1 : 1); // if(self::getQualifiedType($val1) == 'string' ) // return strcmp($val1, $val2); ...
php
public static function compare($val1, $val2) { if(in_array(self::getQualifiedType($val1), array('int','boolean', 'float', 'NULL')) ) return $val1 == $val2 ? 0 : (($val1 < $val2) ? -1 : 1); // if(self::getQualifiedType($val1) == 'string' ) // return strcmp($val1, $val2); ...
[ "public", "static", "function", "compare", "(", "$", "val1", ",", "$", "val2", ")", "{", "if", "(", "in_array", "(", "self", "::", "getQualifiedType", "(", "$", "val1", ")", ",", "array", "(", "'int'", ",", "'boolean'", ",", "'float'", ",", "'NULL'", ...
Compare two items for equivalence. Supports Date objects and all native types. @param mixed $val1 The first value @param mixed $val2 The second value @return boolean Will be true if the items are equivalent.
[ "Compare", "two", "items", "for", "equivalence", ".", "Supports", "Date", "objects", "and", "all", "native", "types", "." ]
8cad7988f046a6fefbed07d026cb4ae6706c1217
https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/libraries/utils/ClassUtils.php#L93-L103
193,055
CalderaWP/caldera-interop
src/Attribute.php
Attribute.fromArray
public static function fromArray(array $items = []): Attribute { $obj = new static(); $obj->setName($items[ 'name' ]) ->setDescription( isset($items[ 'description' ]) && is_string($items[ 'description' ]) ? $items[ 'description' ] : '' ) ->setSqlDescriptor(isset($items[ 'sqlDescriptor' ]) && is_strin...
php
public static function fromArray(array $items = []): Attribute { $obj = new static(); $obj->setName($items[ 'name' ]) ->setDescription( isset($items[ 'description' ]) && is_string($items[ 'description' ]) ? $items[ 'description' ] : '' ) ->setSqlDescriptor(isset($items[ 'sqlDescriptor' ]) && is_strin...
[ "public", "static", "function", "fromArray", "(", "array", "$", "items", "=", "[", "]", ")", ":", "Attribute", "{", "$", "obj", "=", "new", "static", "(", ")", ";", "$", "obj", "->", "setName", "(", "$", "items", "[", "'name'", "]", ")", "->", "s...
Create item from array @param array $items @return Attribute
[ "Create", "item", "from", "array" ]
d25c4bc930200b314fbd42d084080b5d85261c94
https://github.com/CalderaWP/caldera-interop/blob/d25c4bc930200b314fbd42d084080b5d85261c94/src/Attribute.php#L41-L72
193,056
Stillat/Common
src/Stillat/Common/Math/OperationSequenceWriter.php
OperationSequenceWriter.write
public function write(Collection $sequences) { $sequences = clone $sequences; $expression = ''; if ($sequences->count() > 0) { $sequences = $sequences->reverse(); $length = $sequences->count(); for ($i = 0; $i < $length; $i++) { $sequence ...
php
public function write(Collection $sequences) { $sequences = clone $sequences; $expression = ''; if ($sequences->count() > 0) { $sequences = $sequences->reverse(); $length = $sequences->count(); for ($i = 0; $i < $length; $i++) { $sequence ...
[ "public", "function", "write", "(", "Collection", "$", "sequences", ")", "{", "$", "sequences", "=", "clone", "$", "sequences", ";", "$", "expression", "=", "''", ";", "if", "(", "$", "sequences", "->", "count", "(", ")", ">", "0", ")", "{", "$", "...
Writes a sequence history to a string representation of the expression. @param \Collection\Collection $sequences @return string
[ "Writes", "a", "sequence", "history", "to", "a", "string", "representation", "of", "the", "expression", "." ]
9f69105292740c307aece588cf58a85892bad350
https://github.com/Stillat/Common/blob/9f69105292740c307aece588cf58a85892bad350/src/Stillat/Common/Math/OperationSequenceWriter.php#L54-L74
193,057
modulusphp/http
Middleware/MustHandleCors.php
MustHandleCors.cors
private function cors($request) { $origin = $request->server->http_origin; $allowed = Config::get('cors.allowedOrigins'); if (in_array('*', $allowed) || in_array($origin, $allowed) ) { $this->withHeaders($request); } }
php
private function cors($request) { $origin = $request->server->http_origin; $allowed = Config::get('cors.allowedOrigins'); if (in_array('*', $allowed) || in_array($origin, $allowed) ) { $this->withHeaders($request); } }
[ "private", "function", "cors", "(", "$", "request", ")", "{", "$", "origin", "=", "$", "request", "->", "server", "->", "http_origin", ";", "$", "allowed", "=", "Config", "::", "get", "(", "'cors.allowedOrigins'", ")", ";", "if", "(", "in_array", "(", ...
Handles cors. @param \Modulus\Http\Request $requests @return void
[ "Handles", "cors", "." ]
fc5c0f2b582a04de1685578d3fb790686a0a240c
https://github.com/modulusphp/http/blob/fc5c0f2b582a04de1685578d3fb790686a0a240c/Middleware/MustHandleCors.php#L33-L41
193,058
modulusphp/http
Middleware/MustHandleCors.php
MustHandleCors.withHeaders
private function withHeaders($request) { $headers = Config::get('cors.allowedHeaders'); $methods = Config::get('cors.allowedMethods'); $exposed = Config::get('cors.exposedHeaders'); $maxAge = Config::get('cors.maxAge'); $request->headers->addMany([ 'Access-Control-Allow-Credentials' => Con...
php
private function withHeaders($request) { $headers = Config::get('cors.allowedHeaders'); $methods = Config::get('cors.allowedMethods'); $exposed = Config::get('cors.exposedHeaders'); $maxAge = Config::get('cors.maxAge'); $request->headers->addMany([ 'Access-Control-Allow-Credentials' => Con...
[ "private", "function", "withHeaders", "(", "$", "request", ")", "{", "$", "headers", "=", "Config", "::", "get", "(", "'cors.allowedHeaders'", ")", ";", "$", "methods", "=", "Config", "::", "get", "(", "'cors.allowedMethods'", ")", ";", "$", "exposed", "="...
Adds cors headers. @param \Modulus\Http\Request $request @return void
[ "Adds", "cors", "headers", "." ]
fc5c0f2b582a04de1685578d3fb790686a0a240c
https://github.com/modulusphp/http/blob/fc5c0f2b582a04de1685578d3fb790686a0a240c/Middleware/MustHandleCors.php#L49-L70
193,059
squareproton/Bond
src/Bond/Entity/StaticMethods.php
StaticMethods.get_DateTime
public static function get_DateTime( &$dateTime ) { if( $dateTime instanceof DateTime ) { return $dateTime; } return !is_null($dateTime) ? new DateTime( $dateTime ) : null ; }
php
public static function get_DateTime( &$dateTime ) { if( $dateTime instanceof DateTime ) { return $dateTime; } return !is_null($dateTime) ? new DateTime( $dateTime ) : null ; }
[ "public", "static", "function", "get_DateTime", "(", "&", "$", "dateTime", ")", "{", "if", "(", "$", "dateTime", "instanceof", "DateTime", ")", "{", "return", "$", "dateTime", ";", "}", "return", "!", "is_null", "(", "$", "dateTime", ")", "?", "new", "...
Get datetime from Entity @param DateTime $dateTime @return DateTime
[ "Get", "datetime", "from", "Entity" ]
a04ad9dd1a35adeaec98237716c2a41ce02b4f1a
https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/Entity/StaticMethods.php#L44-L53
193,060
squareproton/Bond
src/Bond/Entity/StaticMethods.php
StaticMethods.get_Inet
public static function get_Inet( &$inet ) { if( $inet instanceof Inet ) { return $inet; } return !is_null($inet) ? new Inet($inet) : null ; }
php
public static function get_Inet( &$inet ) { if( $inet instanceof Inet ) { return $inet; } return !is_null($inet) ? new Inet($inet) : null ; }
[ "public", "static", "function", "get_Inet", "(", "&", "$", "inet", ")", "{", "if", "(", "$", "inet", "instanceof", "Inet", ")", "{", "return", "$", "inet", ";", "}", "return", "!", "is_null", "(", "$", "inet", ")", "?", "new", "Inet", "(", "$", "...
Get inet from Entity @param Inet $dateTime @return Inet
[ "Get", "inet", "from", "Entity" ]
a04ad9dd1a35adeaec98237716c2a41ce02b4f1a
https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/Entity/StaticMethods.php#L73-L82
193,061
squareproton/Bond
src/Bond/Entity/StaticMethods.php
StaticMethods.set_Inet
public static function set_Inet( $inet ) { if( $inet instanceof Inet ) { return $inet; } try { $inet = new Inet( $inet ); return $inet; } catch ( \InvalidArgumentException $e ) { return null; } }
php
public static function set_Inet( $inet ) { if( $inet instanceof Inet ) { return $inet; } try { $inet = new Inet( $inet ); return $inet; } catch ( \InvalidArgumentException $e ) { return null; } }
[ "public", "static", "function", "set_Inet", "(", "$", "inet", ")", "{", "if", "(", "$", "inet", "instanceof", "Inet", ")", "{", "return", "$", "inet", ";", "}", "try", "{", "$", "inet", "=", "new", "Inet", "(", "$", "inet", ")", ";", "return", "$...
Set entity datetime @param Inet $inet @return Inet
[ "Set", "entity", "datetime" ]
a04ad9dd1a35adeaec98237716c2a41ce02b4f1a
https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/Entity/StaticMethods.php#L89-L100
193,062
squareproton/Bond
src/Bond/Entity/StaticMethods.php
StaticMethods.get_Hstore
public static function get_Hstore( &$store ) { if( $store instanceof Hstore ) { return $store; } return !is_null($store) ? new Hstore($store) : null ; }
php
public static function get_Hstore( &$store ) { if( $store instanceof Hstore ) { return $store; } return !is_null($store) ? new Hstore($store) : null ; }
[ "public", "static", "function", "get_Hstore", "(", "&", "$", "store", ")", "{", "if", "(", "$", "store", "instanceof", "Hstore", ")", "{", "return", "$", "store", ";", "}", "return", "!", "is_null", "(", "$", "store", ")", "?", "new", "Hstore", "(", ...
Get hstore from Entity @param HStore $dateTime @return Hstore
[ "Get", "hstore", "from", "Entity" ]
a04ad9dd1a35adeaec98237716c2a41ce02b4f1a
https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/Entity/StaticMethods.php#L107-L116
193,063
squareproton/Bond
src/Bond/Entity/StaticMethods.php
StaticMethods.set_Hstore
public static function set_Hstore( $store ) { if( $store instanceof Hstore ) { return $store; } try { $store = new Hstore( $store ); return $store; } catch ( \InvalidArgumentException $e ) { return null; } }
php
public static function set_Hstore( $store ) { if( $store instanceof Hstore ) { return $store; } try { $store = new Hstore( $store ); return $store; } catch ( \InvalidArgumentException $e ) { return null; } }
[ "public", "static", "function", "set_Hstore", "(", "$", "store", ")", "{", "if", "(", "$", "store", "instanceof", "Hstore", ")", "{", "return", "$", "store", ";", "}", "try", "{", "$", "store", "=", "new", "Hstore", "(", "$", "store", ")", ";", "re...
Set entity Hstore @param Hstore $store @return Hstore
[ "Set", "entity", "Hstore" ]
a04ad9dd1a35adeaec98237716c2a41ce02b4f1a
https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/Entity/StaticMethods.php#L123-L134
193,064
squareproton/Bond
src/Bond/Entity/StaticMethods.php
StaticMethods.get_Json
public static function get_Json( &$json ) { if( $json instanceof Json ) { return $json; } return !is_null($json) ? new Json($json) : null ; }
php
public static function get_Json( &$json ) { if( $json instanceof Json ) { return $json; } return !is_null($json) ? new Json($json) : null ; }
[ "public", "static", "function", "get_Json", "(", "&", "$", "json", ")", "{", "if", "(", "$", "json", "instanceof", "Json", ")", "{", "return", "$", "json", ";", "}", "return", "!", "is_null", "(", "$", "json", ")", "?", "new", "Json", "(", "$", "...
Get Json from Entity @param mixed $json @return Json
[ "Get", "Json", "from", "Entity" ]
a04ad9dd1a35adeaec98237716c2a41ce02b4f1a
https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/Entity/StaticMethods.php#L141-L150
193,065
squareproton/Bond
src/Bond/Entity/StaticMethods.php
StaticMethods.set_Json
public static function set_Json( $json, $inputValidate ) { if( $json instanceof Json ) { return $json; } elseif( null === $json ) { return null; } elseif ( !is_string($json) ) { return Json::makeFromObject( $json ); } return new Json( $jso...
php
public static function set_Json( $json, $inputValidate ) { if( $json instanceof Json ) { return $json; } elseif( null === $json ) { return null; } elseif ( !is_string($json) ) { return Json::makeFromObject( $json ); } return new Json( $jso...
[ "public", "static", "function", "set_Json", "(", "$", "json", ",", "$", "inputValidate", ")", "{", "if", "(", "$", "json", "instanceof", "Json", ")", "{", "return", "$", "json", ";", "}", "elseif", "(", "null", "===", "$", "json", ")", "{", "return",...
Set entity json property @param mixed $json @return Json
[ "Set", "entity", "json", "property" ]
a04ad9dd1a35adeaec98237716c2a41ce02b4f1a
https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/Entity/StaticMethods.php#L157-L168
193,066
squareproton/Bond
src/Bond/Entity/StaticMethods.php
StaticMethods.get_StockState
public static function get_StockState( &$state ) { if( $state instanceof StockState or null === $state ) { $state = StockState::makeFromString( $state ); } return $state; }
php
public static function get_StockState( &$state ) { if( $state instanceof StockState or null === $state ) { $state = StockState::makeFromString( $state ); } return $state; }
[ "public", "static", "function", "get_StockState", "(", "&", "$", "state", ")", "{", "if", "(", "$", "state", "instanceof", "StockState", "or", "null", "===", "$", "state", ")", "{", "$", "state", "=", "StockState", "::", "makeFromString", "(", "$", "stat...
Get StockState from Entity @param StockState $state @return StockState
[ "Get", "StockState", "from", "Entity" ]
a04ad9dd1a35adeaec98237716c2a41ce02b4f1a
https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/Entity/StaticMethods.php#L175-L181
193,067
squareproton/Bond
src/Bond/Entity/StaticMethods.php
StaticMethods.set_StockState
public static function set_StockState( $state ) { if( $state instanceof StockState or null === $state ) { $state = StockState::makeFromString( $state ); } return $state; }
php
public static function set_StockState( $state ) { if( $state instanceof StockState or null === $state ) { $state = StockState::makeFromString( $state ); } return $state; }
[ "public", "static", "function", "set_StockState", "(", "$", "state", ")", "{", "if", "(", "$", "state", "instanceof", "StockState", "or", "null", "===", "$", "state", ")", "{", "$", "state", "=", "StockState", "::", "makeFromString", "(", "$", "state", "...
Set entity StockState @param StockState $state @return StockState
[ "Set", "entity", "StockState" ]
a04ad9dd1a35adeaec98237716c2a41ce02b4f1a
https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/Entity/StaticMethods.php#L188-L194
193,068
squareproton/Bond
src/Bond/Entity/StaticMethods.php
StaticMethods.get_PgLargeObject
public static function get_PgLargeObject( &$value, Base $entity ) { if( $value instanceof PgLargeObject ){ return $value->isDeleted() ? null : $value; } if( is_intish($value) ) { $value = new Oid( $value, $entity->r()->db ); } ...
php
public static function get_PgLargeObject( &$value, Base $entity ) { if( $value instanceof PgLargeObject ){ return $value->isDeleted() ? null : $value; } if( is_intish($value) ) { $value = new Oid( $value, $entity->r()->db ); } ...
[ "public", "static", "function", "get_PgLargeObject", "(", "&", "$", "value", ",", "Base", "$", "entity", ")", "{", "if", "(", "$", "value", "instanceof", "PgLargeObject", ")", "{", "return", "$", "value", "->", "isDeleted", "(", ")", "?", "null", ":", ...
Get entity PgLargeObject @param PgLargeObject $value @return mixed
[ "Get", "entity", "PgLargeObject" ]
a04ad9dd1a35adeaec98237716c2a41ce02b4f1a
https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/Entity/StaticMethods.php#L366-L379
193,069
squareproton/Bond
src/Bond/Entity/StaticMethods.php
StaticMethods.set_PgLargeObject
public static function set_PgLargeObject( $value, $inputValidate, Base $entity ) { if( $value instanceof PgLargeObject ){ return $value; } if( is_intish($value) ) { $value = new Oid( $value, $entity->r()->db ); } return is_null( $value ) ? ...
php
public static function set_PgLargeObject( $value, $inputValidate, Base $entity ) { if( $value instanceof PgLargeObject ){ return $value; } if( is_intish($value) ) { $value = new Oid( $value, $entity->r()->db ); } return is_null( $value ) ? ...
[ "public", "static", "function", "set_PgLargeObject", "(", "$", "value", ",", "$", "inputValidate", ",", "Base", "$", "entity", ")", "{", "if", "(", "$", "value", "instanceof", "PgLargeObject", ")", "{", "return", "$", "value", ";", "}", "if", "(", "is_in...
Set PgLargeObject on entity @param PgLargeObject $value @return PgLargeObject
[ "Set", "PgLargeObject", "on", "entity" ]
a04ad9dd1a35adeaec98237716c2a41ce02b4f1a
https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/Entity/StaticMethods.php#L386-L397
193,070
mrimann/CacheBreaker
Classes/Service/ResourceService.php
ResourceService.getResourceUri
public function getResourceUri($path, $package = null) { if (strpos($path, 'resource://') === 0) { $matches = array(); if (preg_match('#^resource://([^/]+)/Public/(.*)#', $path, $matches) === 1) { $package = $matches[1]; $path = $matches[2]; ...
php
public function getResourceUri($path, $package = null) { if (strpos($path, 'resource://') === 0) { $matches = array(); if (preg_match('#^resource://([^/]+)/Public/(.*)#', $path, $matches) === 1) { $package = $matches[1]; $path = $matches[2]; ...
[ "public", "function", "getResourceUri", "(", "$", "path", ",", "$", "package", "=", "null", ")", "{", "if", "(", "strpos", "(", "$", "path", ",", "'resource://'", ")", "===", "0", ")", "{", "$", "matches", "=", "array", "(", ")", ";", "if", "(", ...
Appends a shortened md5 of the file. @param string $path The location of the resource, can be either a path relative to the Public resource directory of the package or a resource://... URI @param string $package Target package key. If not set, the current package key will be used @return string @throws \Exception
[ "Appends", "a", "shortened", "md5", "of", "the", "file", "." ]
2b195f06bc2f92d1d9dc069fdc67cc28a3bee576
https://github.com/mrimann/CacheBreaker/blob/2b195f06bc2f92d1d9dc069fdc67cc28a3bee576/Classes/Service/ResourceService.php#L22-L39
193,071
DeimosProject/Helper
src/Helper/Helpers/Arr/StackTrait.php
StackTrait.odd
public function odd(array $storage) { return $this->filter($storage, function ($value) { return $this->helper->math()->isOdd($value); }); }
php
public function odd(array $storage) { return $this->filter($storage, function ($value) { return $this->helper->math()->isOdd($value); }); }
[ "public", "function", "odd", "(", "array", "$", "storage", ")", "{", "return", "$", "this", "->", "filter", "(", "$", "storage", ",", "function", "(", "$", "value", ")", "{", "return", "$", "this", "->", "helper", "->", "math", "(", ")", "->", "isO...
1, 3, 5... @param array $storage @return array
[ "1", "3", "5", "..." ]
39c67de21a87c7c6391b2f98416063f41c94e26f
https://github.com/DeimosProject/Helper/blob/39c67de21a87c7c6391b2f98416063f41c94e26f/src/Helper/Helpers/Arr/StackTrait.php#L81-L87
193,072
DeimosProject/Helper
src/Helper/Helpers/Arr/StackTrait.php
StackTrait.even
public function even(array $storage) { return $this->filter($storage, function ($value) { return $this->helper->math()->isEven($value); }); }
php
public function even(array $storage) { return $this->filter($storage, function ($value) { return $this->helper->math()->isEven($value); }); }
[ "public", "function", "even", "(", "array", "$", "storage", ")", "{", "return", "$", "this", "->", "filter", "(", "$", "storage", ",", "function", "(", "$", "value", ")", "{", "return", "$", "this", "->", "helper", "->", "math", "(", ")", "->", "is...
0, 2, 4... @param array $storage @return array
[ "0", "2", "4", "..." ]
39c67de21a87c7c6391b2f98416063f41c94e26f
https://github.com/DeimosProject/Helper/blob/39c67de21a87c7c6391b2f98416063f41c94e26f/src/Helper/Helpers/Arr/StackTrait.php#L96-L102
193,073
agentmedia/phine-core
src/Core/Logic/Bundle/BundleManifest.php
BundleManifest.LoadToBackend
final function LoadToBackend() { foreach ($this->Dependencies() as $depedency) { $bundleName = $depedency->BundleName(); if (!in_array($bundleName, self::$_loadedBundles)) { $depManifest = ClassFinder::Manifest($bundleName); $depMan...
php
final function LoadToBackend() { foreach ($this->Dependencies() as $depedency) { $bundleName = $depedency->BundleName(); if (!in_array($bundleName, self::$_loadedBundles)) { $depManifest = ClassFinder::Manifest($bundleName); $depMan...
[ "final", "function", "LoadToBackend", "(", ")", "{", "foreach", "(", "$", "this", "->", "Dependencies", "(", ")", "as", "$", "depedency", ")", "{", "$", "bundleName", "=", "$", "depedency", "->", "BundleName", "(", ")", ";", "if", "(", "!", "in_array",...
Loads the bundle with all dependencies
[ "Loads", "the", "bundle", "with", "all", "dependencies" ]
38c1be8d03ebffae950d00a96da3c612aff67832
https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Bundle/BundleManifest.php#L54-L68
193,074
agentmedia/phine-core
src/Core/Logic/Bundle/BundleManifest.php
BundleManifest.LoadToFrontend
protected function LoadToFrontend(Site $site) { foreach ($this->Dependencies() as $depedency) { $bundleName = $depedency->BundleName(); if (!in_array($bundleName, self::$_loadedBundles)) { $depManifest = ClassFinder::Manifest($bundleName); ...
php
protected function LoadToFrontend(Site $site) { foreach ($this->Dependencies() as $depedency) { $bundleName = $depedency->BundleName(); if (!in_array($bundleName, self::$_loadedBundles)) { $depManifest = ClassFinder::Manifest($bundleName); ...
[ "protected", "function", "LoadToFrontend", "(", "Site", "$", "site", ")", "{", "foreach", "(", "$", "this", "->", "Dependencies", "(", ")", "as", "$", "depedency", ")", "{", "$", "bundleName", "=", "$", "depedency", "->", "BundleName", "(", ")", ";", "...
Loads the bundle code and translations to the f @param Site $site
[ "Loads", "the", "bundle", "code", "and", "translations", "to", "the", "f" ]
38c1be8d03ebffae950d00a96da3c612aff67832
https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Bundle/BundleManifest.php#L73-L87
193,075
agentmedia/phine-core
src/Core/Logic/Bundle/BundleManifest.php
BundleManifest.LoadInstalledToBackend
static function LoadInstalledToBackend() { $bundles = InstalledBundle::Schema()->Fetch(); foreach ($bundles as $bundle) { $manifest = ClassFinder::Manifest($bundle->GetBundle()); $manifest->LoadToBackend(); } }
php
static function LoadInstalledToBackend() { $bundles = InstalledBundle::Schema()->Fetch(); foreach ($bundles as $bundle) { $manifest = ClassFinder::Manifest($bundle->GetBundle()); $manifest->LoadToBackend(); } }
[ "static", "function", "LoadInstalledToBackend", "(", ")", "{", "$", "bundles", "=", "InstalledBundle", "::", "Schema", "(", ")", "->", "Fetch", "(", ")", ";", "foreach", "(", "$", "bundles", "as", "$", "bundle", ")", "{", "$", "manifest", "=", "ClassFind...
Loads all installed bundles to the backend
[ "Loads", "all", "installed", "bundles", "to", "the", "backend" ]
38c1be8d03ebffae950d00a96da3c612aff67832
https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Bundle/BundleManifest.php#L91-L99
193,076
agentmedia/phine-core
src/Core/Logic/Bundle/BundleManifest.php
BundleManifest.LoadInstalledToFrontend
static function LoadInstalledToFrontend(Site $site) { $bundles = InstalledBundle::Schema()->Fetch(); foreach ($bundles as $bundle) { $manifest = ClassFinder::Manifest($bundle->GetBundle()); $manifest->LoadToFrontend($site); } }
php
static function LoadInstalledToFrontend(Site $site) { $bundles = InstalledBundle::Schema()->Fetch(); foreach ($bundles as $bundle) { $manifest = ClassFinder::Manifest($bundle->GetBundle()); $manifest->LoadToFrontend($site); } }
[ "static", "function", "LoadInstalledToFrontend", "(", "Site", "$", "site", ")", "{", "$", "bundles", "=", "InstalledBundle", "::", "Schema", "(", ")", "->", "Fetch", "(", ")", ";", "foreach", "(", "$", "bundles", "as", "$", "bundle", ")", "{", "$", "ma...
Loads installed bundles to the frontend @param Site $site
[ "Loads", "installed", "bundles", "to", "the", "frontend" ]
38c1be8d03ebffae950d00a96da3c612aff67832
https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Bundle/BundleManifest.php#L105-L113
193,077
Wedeto/HTTP
src/RequestBody.php
RequestBody.getRawContent
public function getRawContent(int $max_length = -1) { // Set maximum length based on parameter or provided content_length $max_length = $max_length < 0 ? $this->content_length : $max_length; // Limit to a maximum of 4MiB $max_length = min(4096 * 1024, $max_length, $this->content_leng...
php
public function getRawContent(int $max_length = -1) { // Set maximum length based on parameter or provided content_length $max_length = $max_length < 0 ? $this->content_length : $max_length; // Limit to a maximum of 4MiB $max_length = min(4096 * 1024, $max_length, $this->content_leng...
[ "public", "function", "getRawContent", "(", "int", "$", "max_length", "=", "-", "1", ")", "{", "// Set maximum length based on parameter or provided content_length", "$", "max_length", "=", "$", "max_length", "<", "0", "?", "$", "this", "->", "content_length", ":", ...
Get the raw content as a string @param int $max_length The maximum amount of bytes to read. @return string The read data
[ "Get", "the", "raw", "content", "as", "a", "string" ]
7318eff1b81a3c103c4263466d09b7f3593b70b9
https://github.com/Wedeto/HTTP/blob/7318eff1b81a3c103c4263466d09b7f3593b70b9/src/RequestBody.php#L132-L150
193,078
Wedeto/HTTP
src/RequestBody.php
RequestBody.getParsedContent
public function getParsedContent() { $filetype = FileType::getExtension($this->content_type); if (empty($filetype)) throw new ParseException("Unknown content type"); $filename = "content." . $filetype; $reader = ReaderFactory::factory($filename); $parsed = $read...
php
public function getParsedContent() { $filetype = FileType::getExtension($this->content_type); if (empty($filetype)) throw new ParseException("Unknown content type"); $filename = "content." . $filetype; $reader = ReaderFactory::factory($filename); $parsed = $read...
[ "public", "function", "getParsedContent", "(", ")", "{", "$", "filetype", "=", "FileType", "::", "getExtension", "(", "$", "this", "->", "content_type", ")", ";", "if", "(", "empty", "(", "$", "filetype", ")", ")", "throw", "new", "ParseException", "(", ...
Return the parsed content. The FileFormats readers will be used to parse the data and store it in a dictionary. @return Dictionary The parsed data
[ "Return", "the", "parsed", "content", ".", "The", "FileFormats", "readers", "will", "be", "used", "to", "parse", "the", "data", "and", "store", "it", "in", "a", "dictionary", "." ]
7318eff1b81a3c103c4263466d09b7f3593b70b9
https://github.com/Wedeto/HTTP/blob/7318eff1b81a3c103c4263466d09b7f3593b70b9/src/RequestBody.php#L158-L169
193,079
romm/configuration_object
Classes/Service/Items/Parents/ParentsService.php
ParentsService.configurationObjectAfter
public function configurationObjectAfter(GetConfigurationObjectDTO $serviceDataTransferObject) { // Will save the paths of the properties which need their parent objects. $this->delay( self::PRIORITY_SAVE_OBJECTS_WITH_PARENTS_PATHS, function (GetConfigurationObjectDTO $servic...
php
public function configurationObjectAfter(GetConfigurationObjectDTO $serviceDataTransferObject) { // Will save the paths of the properties which need their parent objects. $this->delay( self::PRIORITY_SAVE_OBJECTS_WITH_PARENTS_PATHS, function (GetConfigurationObjectDTO $servic...
[ "public", "function", "configurationObjectAfter", "(", "GetConfigurationObjectDTO", "$", "serviceDataTransferObject", ")", "{", "// Will save the paths of the properties which need their parent objects.", "$", "this", "->", "delay", "(", "self", "::", "PRIORITY_SAVE_OBJECTS_WITH_PA...
This function will first save the entire storage of properties paths set in the function `objectConversionAfter`. Then, each of the properties above will be processed to fill their parent objects. @param GetConfigurationObjectDTO $serviceDataTransferObject
[ "This", "function", "will", "first", "save", "the", "entire", "storage", "of", "properties", "paths", "set", "in", "the", "function", "objectConversionAfter", "." ]
d3a40903386c2e0766bd8279337fe6da45cf5ce3
https://github.com/romm/configuration_object/blob/d3a40903386c2e0766bd8279337fe6da45cf5ce3/Classes/Service/Items/Parents/ParentsService.php#L119-L149
193,080
romm/configuration_object
Classes/Service/Items/Parents/ParentsService.php
ParentsService.insertParents
protected function insertParents($entity, array $path, array $parents) { $propertyName = reset($path); $propertyValue = Core::get()->getObjectService()->getObjectProperty($entity, $propertyName); if (1 === count($path)) { if (is_object($propertyValue) && Core::ge...
php
protected function insertParents($entity, array $path, array $parents) { $propertyName = reset($path); $propertyValue = Core::get()->getObjectService()->getObjectProperty($entity, $propertyName); if (1 === count($path)) { if (is_object($propertyValue) && Core::ge...
[ "protected", "function", "insertParents", "(", "$", "entity", ",", "array", "$", "path", ",", "array", "$", "parents", ")", "{", "$", "propertyName", "=", "reset", "(", "$", "path", ")", ";", "$", "propertyValue", "=", "Core", "::", "get", "(", ")", ...
Internal function to fill the parents. @param mixed $entity @param array $path @param object[] $parents
[ "Internal", "function", "to", "fill", "the", "parents", "." ]
d3a40903386c2e0766bd8279337fe6da45cf5ce3
https://github.com/romm/configuration_object/blob/d3a40903386c2e0766bd8279337fe6da45cf5ce3/Classes/Service/Items/Parents/ParentsService.php#L158-L178
193,081
codeblanche/Web
src/Web/Uri.php
Uri.import
public function import($input) { if (is_array($input)) { $this->fromArray($input); } else { $this->fromString($input); } return $this; }
php
public function import($input) { if (is_array($input)) { $this->fromArray($input); } else { $this->fromString($input); } return $this; }
[ "public", "function", "import", "(", "$", "input", ")", "{", "if", "(", "is_array", "(", "$", "input", ")", ")", "{", "$", "this", "->", "fromArray", "(", "$", "input", ")", ";", "}", "else", "{", "$", "this", "->", "fromString", "(", "$", "input...
Import the given input @param string|array $input @return Uri
[ "Import", "the", "given", "input" ]
3e9ebf1943d3ea468f619ba99f7cc10714cb16e9
https://github.com/codeblanche/Web/blob/3e9ebf1943d3ea468f619ba99f7cc10714cb16e9/src/Web/Uri.php#L205-L215
193,082
codeblanche/Web
src/Web/Uri.php
Uri.toArray
public function toArray() { $qs = $this->query instanceof QueryString ? $this->query->toString() : ''; return array( 'scheme' => $this->scheme, 'host' => $this->host, 'port' => $this->port, 'user' => $this->us...
php
public function toArray() { $qs = $this->query instanceof QueryString ? $this->query->toString() : ''; return array( 'scheme' => $this->scheme, 'host' => $this->host, 'port' => $this->port, 'user' => $this->us...
[ "public", "function", "toArray", "(", ")", "{", "$", "qs", "=", "$", "this", "->", "query", "instanceof", "QueryString", "?", "$", "this", "->", "query", "->", "toString", "(", ")", ":", "''", ";", "return", "array", "(", "'scheme'", "=>", "$", "this...
Convert to an array @return array
[ "Convert", "to", "an", "array" ]
3e9ebf1943d3ea468f619ba99f7cc10714cb16e9
https://github.com/codeblanche/Web/blob/3e9ebf1943d3ea468f619ba99f7cc10714cb16e9/src/Web/Uri.php#L383-L403
193,083
codeblanche/Web
src/Web/Uri.php
Uri.toString
public function toString() { $result = ""; if (!empty($this->scheme)) { $result .= "{$this->scheme}://"; } if (!empty($this->user)) { $result .= !empty($this->pass) ? "{$this->user}:{$this->pass}@" : "{$this->user}@"; ...
php
public function toString() { $result = ""; if (!empty($this->scheme)) { $result .= "{$this->scheme}://"; } if (!empty($this->user)) { $result .= !empty($this->pass) ? "{$this->user}:{$this->pass}@" : "{$this->user}@"; ...
[ "public", "function", "toString", "(", ")", "{", "$", "result", "=", "\"\"", ";", "if", "(", "!", "empty", "(", "$", "this", "->", "scheme", ")", ")", "{", "$", "result", ".=", "\"{$this->scheme}://\"", ";", "}", "if", "(", "!", "empty", "(", "$", ...
Convert to a string. @return string
[ "Convert", "to", "a", "string", "." ]
3e9ebf1943d3ea468f619ba99f7cc10714cb16e9
https://github.com/codeblanche/Web/blob/3e9ebf1943d3ea468f619ba99f7cc10714cb16e9/src/Web/Uri.php#L410-L442
193,084
codeblanche/Web
src/Web/Uri.php
Uri.buildPath
protected function buildPath() { $this->basename = $this->filename; if (!empty($this->extension)) { $this->basename .= '.' . $this->extension; } $this->path = $this->dirname; if (!empty($this->basename)) { $this->path .= '/' . $this->basename; ...
php
protected function buildPath() { $this->basename = $this->filename; if (!empty($this->extension)) { $this->basename .= '.' . $this->extension; } $this->path = $this->dirname; if (!empty($this->basename)) { $this->path .= '/' . $this->basename; ...
[ "protected", "function", "buildPath", "(", ")", "{", "$", "this", "->", "basename", "=", "$", "this", "->", "filename", ";", "if", "(", "!", "empty", "(", "$", "this", "->", "extension", ")", ")", "{", "$", "this", "->", "basename", ".=", "'.'", "....
Rebuild the path using the path components @return Uri
[ "Rebuild", "the", "path", "using", "the", "path", "components" ]
3e9ebf1943d3ea468f619ba99f7cc10714cb16e9
https://github.com/codeblanche/Web/blob/3e9ebf1943d3ea468f619ba99f7cc10714cb16e9/src/Web/Uri.php#L449-L464
193,085
codeblanche/Web
src/Web/Uri.php
Uri.fromArray
protected function fromArray($array) { if (empty($array)) { return $this; } $this->query = new QueryString(); if (!empty($array['query'])) { $this->query->import($array['query']); } $keys = array( 'scheme', 'host', ...
php
protected function fromArray($array) { if (empty($array)) { return $this; } $this->query = new QueryString(); if (!empty($array['query'])) { $this->query->import($array['query']); } $keys = array( 'scheme', 'host', ...
[ "protected", "function", "fromArray", "(", "$", "array", ")", "{", "if", "(", "empty", "(", "$", "array", ")", ")", "{", "return", "$", "this", ";", "}", "$", "this", "->", "query", "=", "new", "QueryString", "(", ")", ";", "if", "(", "!", "empty...
Import from an array @param array $array @return Uri
[ "Import", "from", "an", "array" ]
3e9ebf1943d3ea468f619ba99f7cc10714cb16e9
https://github.com/codeblanche/Web/blob/3e9ebf1943d3ea468f619ba99f7cc10714cb16e9/src/Web/Uri.php#L473-L514
193,086
codeblanche/Web
src/Web/Uri.php
Uri.fromString
protected function fromString($uri) { if (empty($uri)) { return $this; } $this->fromArray(parse_url($uri)); return $this; }
php
protected function fromString($uri) { if (empty($uri)) { return $this; } $this->fromArray(parse_url($uri)); return $this; }
[ "protected", "function", "fromString", "(", "$", "uri", ")", "{", "if", "(", "empty", "(", "$", "uri", ")", ")", "{", "return", "$", "this", ";", "}", "$", "this", "->", "fromArray", "(", "parse_url", "(", "$", "uri", ")", ")", ";", "return", "$"...
Import from a string @param string $uri @return Uri
[ "Import", "from", "a", "string" ]
3e9ebf1943d3ea468f619ba99f7cc10714cb16e9
https://github.com/codeblanche/Web/blob/3e9ebf1943d3ea468f619ba99f7cc10714cb16e9/src/Web/Uri.php#L523-L532
193,087
codeblanche/Web
src/Web/Uri.php
Uri.parsePath
protected function parsePath($path = null) { $this->dirname = ''; $this->basename = ''; $this->extension = ''; $this->filename = ''; if (empty($path)) { return $this; } $parts = pathinfo($path); if (isset($parts['dirname'])) { ...
php
protected function parsePath($path = null) { $this->dirname = ''; $this->basename = ''; $this->extension = ''; $this->filename = ''; if (empty($path)) { return $this; } $parts = pathinfo($path); if (isset($parts['dirname'])) { ...
[ "protected", "function", "parsePath", "(", "$", "path", "=", "null", ")", "{", "$", "this", "->", "dirname", "=", "''", ";", "$", "this", "->", "basename", "=", "''", ";", "$", "this", "->", "extension", "=", "''", ";", "$", "this", "->", "filename...
Extract the path components from the current path @param string $path @return Uri
[ "Extract", "the", "path", "components", "from", "the", "current", "path" ]
3e9ebf1943d3ea468f619ba99f7cc10714cb16e9
https://github.com/codeblanche/Web/blob/3e9ebf1943d3ea468f619ba99f7cc10714cb16e9/src/Web/Uri.php#L541-L571
193,088
raframework/rapkg
src/Rapkg/Log/Logger.php
Logger.withLevel
public function withLevel($level) { if (!isset(self::$levels[$level])) { throw new InvalidArgumentException('Unsupported log level "' . $level . '"'); } $this->level = $level; }
php
public function withLevel($level) { if (!isset(self::$levels[$level])) { throw new InvalidArgumentException('Unsupported log level "' . $level . '"'); } $this->level = $level; }
[ "public", "function", "withLevel", "(", "$", "level", ")", "{", "if", "(", "!", "isset", "(", "self", "::", "$", "levels", "[", "$", "level", "]", ")", ")", "{", "throw", "new", "InvalidArgumentException", "(", "'Unsupported log level \"'", ".", "$", "le...
Set log level for logger @param $level @throws InvalidArgumentException
[ "Set", "log", "level", "for", "logger" ]
7c4371911369d7c9d4463127bcd285144d7347ee
https://github.com/raframework/rapkg/blob/7c4371911369d7c9d4463127bcd285144d7347ee/src/Rapkg/Log/Logger.php#L45-L52
193,089
AdamB7586/menu-builder
src/Helpers/Validate.php
Validate.validateURI
public static function validateURI($uri) { if(!empty(trim($uri))){ return filter_var(trim($uri), FILTER_VALIDATE_URL); } return false; }
php
public static function validateURI($uri) { if(!empty(trim($uri))){ return filter_var(trim($uri), FILTER_VALIDATE_URL); } return false; }
[ "public", "static", "function", "validateURI", "(", "$", "uri", ")", "{", "if", "(", "!", "empty", "(", "trim", "(", "$", "uri", ")", ")", ")", "{", "return", "filter_var", "(", "trim", "(", "$", "uri", ")", ",", "FILTER_VALIDATE_URL", ")", ";", "}...
Validates that a URI is valid @param string $uri This should be the URI you are checking @return boolean If the URI is valid will return true else returns false
[ "Validates", "that", "a", "URI", "is", "valid" ]
dbc192bca7d59475068c19d1a07a039e5f997ee4
https://github.com/AdamB7586/menu-builder/blob/dbc192bca7d59475068c19d1a07a039e5f997ee4/src/Helpers/Validate.php#L11-L16
193,090
alphalemon/BootstrapBundle
Core/Script/Base/BaseScript.php
BaseScript.doExecuteActions
protected function doExecuteActions($method, array $actionManagers) { $actions = array('post' => array(), 'notExecuted' => array()); $this->executeFailedActions($method); if (0 !== count($actionManagers)){ $actions = $this->execute($method, $actionManagers); if(!empty...
php
protected function doExecuteActions($method, array $actionManagers) { $actions = array('post' => array(), 'notExecuted' => array()); $this->executeFailedActions($method); if (0 !== count($actionManagers)){ $actions = $this->execute($method, $actionManagers); if(!empty...
[ "protected", "function", "doExecuteActions", "(", "$", "method", ",", "array", "$", "actionManagers", ")", "{", "$", "actions", "=", "array", "(", "'post'", "=>", "array", "(", ")", ",", "'notExecuted'", "=>", "array", "(", ")", ")", ";", "$", "this", ...
Executes the given method defined by the given ActionsManager @param string $method @param array $actionManagers @return array An array that contains the post actions and the not execution action
[ "Executes", "the", "given", "method", "defined", "by", "the", "given", "ActionsManager" ]
27ff5cbc58d58149ec72a974f2a9d765a6fd37a6
https://github.com/alphalemon/BootstrapBundle/blob/27ff5cbc58d58149ec72a974f2a9d765a6fd37a6/Core/Script/Base/BaseScript.php#L57-L67
193,091
alphalemon/BootstrapBundle
Core/Script/Base/BaseScript.php
BaseScript.executeFailedActions
protected function executeFailedActions($action) { $fileName = $this->basePath . '/.' . $action; if (file_exists($fileName)) { $actionManagers = $this->decode($fileName); $actions = $this->execute($action, $actionManagers); $this->writeFailedActions('.' . $action,...
php
protected function executeFailedActions($action) { $fileName = $this->basePath . '/.' . $action; if (file_exists($fileName)) { $actionManagers = $this->decode($fileName); $actions = $this->execute($action, $actionManagers); $this->writeFailedActions('.' . $action,...
[ "protected", "function", "executeFailedActions", "(", "$", "action", ")", "{", "$", "fileName", "=", "$", "this", "->", "basePath", ".", "'/.'", ".", "$", "action", ";", "if", "(", "file_exists", "(", "$", "fileName", ")", ")", "{", "$", "actionManagers"...
Executes the failed action @param string $action
[ "Executes", "the", "failed", "action" ]
27ff5cbc58d58149ec72a974f2a9d765a6fd37a6
https://github.com/alphalemon/BootstrapBundle/blob/27ff5cbc58d58149ec72a974f2a9d765a6fd37a6/Core/Script/Base/BaseScript.php#L74-L82
193,092
alphalemon/BootstrapBundle
Core/Script/Base/BaseScript.php
BaseScript.execute
protected function execute($method, array $actionManagers) { $actions = array('post' => array(), 'notExecuted' => array()); foreach ($actionManagers as $bundleName => $actionManager) { $this->actionManagerGenerator->generate($actionManager); $actionManagerClass = $this->actio...
php
protected function execute($method, array $actionManagers) { $actions = array('post' => array(), 'notExecuted' => array()); foreach ($actionManagers as $bundleName => $actionManager) { $this->actionManagerGenerator->generate($actionManager); $actionManagerClass = $this->actio...
[ "protected", "function", "execute", "(", "$", "method", ",", "array", "$", "actionManagers", ")", "{", "$", "actions", "=", "array", "(", "'post'", "=>", "array", "(", ")", ",", "'notExecuted'", "=>", "array", "(", ")", ")", ";", "foreach", "(", "$", ...
Executes the actions @param type $method @param array $actionManagers @return type @throws MissingDependencyException
[ "Executes", "the", "actions" ]
27ff5cbc58d58149ec72a974f2a9d765a6fd37a6
https://github.com/alphalemon/BootstrapBundle/blob/27ff5cbc58d58149ec72a974f2a9d765a6fd37a6/Core/Script/Base/BaseScript.php#L92-L104
193,093
alphalemon/BootstrapBundle
Core/Script/Base/BaseScript.php
BaseScript.writePostActions
protected function writePostActions($fileName, array $actions) { $fileName = $this->basePath . '/' . $fileName; $this->encode($fileName, $actions); }
php
protected function writePostActions($fileName, array $actions) { $fileName = $this->basePath . '/' . $fileName; $this->encode($fileName, $actions); }
[ "protected", "function", "writePostActions", "(", "$", "fileName", ",", "array", "$", "actions", ")", "{", "$", "fileName", "=", "$", "this", "->", "basePath", ".", "'/'", ".", "$", "fileName", ";", "$", "this", "->", "encode", "(", "$", "fileName", ",...
Writes the post actions file @param string $fileName @param array $actions
[ "Writes", "the", "post", "actions", "file" ]
27ff5cbc58d58149ec72a974f2a9d765a6fd37a6
https://github.com/alphalemon/BootstrapBundle/blob/27ff5cbc58d58149ec72a974f2a9d765a6fd37a6/Core/Script/Base/BaseScript.php#L112-L116
193,094
alphalemon/BootstrapBundle
Core/Script/Base/BaseScript.php
BaseScript.writeFailedActions
protected function writeFailedActions($fileName, $actions) { $fileName = $this->basePath . '/' . $fileName; $this->filesystem->remove($fileName); if (!empty($actions)) $this->encode($fileName, $actions); }
php
protected function writeFailedActions($fileName, $actions) { $fileName = $this->basePath . '/' . $fileName; $this->filesystem->remove($fileName); if (!empty($actions)) $this->encode($fileName, $actions); }
[ "protected", "function", "writeFailedActions", "(", "$", "fileName", ",", "$", "actions", ")", "{", "$", "fileName", "=", "$", "this", "->", "basePath", ".", "'/'", ".", "$", "fileName", ";", "$", "this", "->", "filesystem", "->", "remove", "(", "$", "...
Writes the failed actions file @param string $fileName @param type $actions
[ "Writes", "the", "failed", "actions", "file" ]
27ff5cbc58d58149ec72a974f2a9d765a6fd37a6
https://github.com/alphalemon/BootstrapBundle/blob/27ff5cbc58d58149ec72a974f2a9d765a6fd37a6/Core/Script/Base/BaseScript.php#L124-L129
193,095
Soneritics/Buckaroo
Soneritics/Buckaroo/Response/TransactionStatusResponse.php
TransactionStatusResponse.validateSignature
protected function validateSignature() { $check = []; foreach ($this->data as $key => $value) { if ($key !== 'brq_signature') { $check[$key] = $value; } } $signature = new Signature($check, $this->secretKey); if (empty($this->data['brq...
php
protected function validateSignature() { $check = []; foreach ($this->data as $key => $value) { if ($key !== 'brq_signature') { $check[$key] = $value; } } $signature = new Signature($check, $this->secretKey); if (empty($this->data['brq...
[ "protected", "function", "validateSignature", "(", ")", "{", "$", "check", "=", "[", "]", ";", "foreach", "(", "$", "this", "->", "data", "as", "$", "key", "=>", "$", "value", ")", "{", "if", "(", "$", "key", "!==", "'brq_signature'", ")", "{", "$"...
Validate the transaction. @throws InvalidSignatureException
[ "Validate", "the", "transaction", "." ]
cb345dce9b96c996e47121d6145a7e314943c8f1
https://github.com/Soneritics/Buckaroo/blob/cb345dce9b96c996e47121d6145a7e314943c8f1/Soneritics/Buckaroo/Response/TransactionStatusResponse.php#L109-L122
193,096
ScaraMVC/Framework
src/Scara/Input/FormInput.php
FormInput.input
public function input($key = null, $default = null) { $input = $this->getInputSource(); return $this->inputSift($input, $key, $default); }
php
public function input($key = null, $default = null) { $input = $this->getInputSource(); return $this->inputSift($input, $key, $default); }
[ "public", "function", "input", "(", "$", "key", "=", "null", ",", "$", "default", "=", "null", ")", "{", "$", "input", "=", "$", "this", "->", "getInputSource", "(", ")", ";", "return", "$", "this", "->", "inputSift", "(", "$", "input", ",", "$", ...
Retrieves an input. @param null $key - The input's key @param null $default - The input $key's default value @return mixed
[ "Retrieves", "an", "input", "." ]
199b08b45fadf5dae14ac4732af03b36e15bbef2
https://github.com/ScaraMVC/Framework/blob/199b08b45fadf5dae14ac4732af03b36e15bbef2/src/Scara/Input/FormInput.php#L60-L65
193,097
rutger-speksnijder/restphp
src/RestPHP/Response/Types/JSON.php
JSON.transform
protected function transform($data, $hypertextRoutes = []) { $links = $this->getHypertextJson($hypertextRoutes); if ($links && is_array($data)) { $data['_links'] = $links; } elseif ($links && !is_array($data)) { $data = [$data, '_links' => $links]; } r...
php
protected function transform($data, $hypertextRoutes = []) { $links = $this->getHypertextJson($hypertextRoutes); if ($links && is_array($data)) { $data['_links'] = $links; } elseif ($links && !is_array($data)) { $data = [$data, '_links' => $links]; } r...
[ "protected", "function", "transform", "(", "$", "data", ",", "$", "hypertextRoutes", "=", "[", "]", ")", "{", "$", "links", "=", "$", "this", "->", "getHypertextJson", "(", "$", "hypertextRoutes", ")", ";", "if", "(", "$", "links", "&&", "is_array", "(...
Transforms the data into a json response. @param mixed $data The data to transform. @param optional array $hypertextRoutes An array with hypertext routes. @return string The transformed response.
[ "Transforms", "the", "data", "into", "a", "json", "response", "." ]
326a7c0d79b266bbdd8a27ff1c8021caf9d28a3d
https://github.com/rutger-speksnijder/restphp/blob/326a7c0d79b266bbdd8a27ff1c8021caf9d28a3d/src/RestPHP/Response/Types/JSON.php#L35-L44
193,098
rutger-speksnijder/restphp
src/RestPHP/Response/Types/JSON.php
JSON.getHypertextJson
private function getHypertextJson($routes = []) { if (!$routes) { return false; } $links = []; foreach ($routes as $name => $route) { $links[] = ['rel' => $name, 'href' => $route]; } return $links; }
php
private function getHypertextJson($routes = []) { if (!$routes) { return false; } $links = []; foreach ($routes as $name => $route) { $links[] = ['rel' => $name, 'href' => $route]; } return $links; }
[ "private", "function", "getHypertextJson", "(", "$", "routes", "=", "[", "]", ")", "{", "if", "(", "!", "$", "routes", ")", "{", "return", "false", ";", "}", "$", "links", "=", "[", "]", ";", "foreach", "(", "$", "routes", "as", "$", "name", "=>"...
Transforms the hypertext routes into an array for the json string. @param array $routes The hypertext routes. @return array An array of links for the json string.
[ "Transforms", "the", "hypertext", "routes", "into", "an", "array", "for", "the", "json", "string", "." ]
326a7c0d79b266bbdd8a27ff1c8021caf9d28a3d
https://github.com/rutger-speksnijder/restphp/blob/326a7c0d79b266bbdd8a27ff1c8021caf9d28a3d/src/RestPHP/Response/Types/JSON.php#L53-L63
193,099
SuPa86000/ZF2Assetic
src/Assetic/Filter/SprocketsFilter.php
SprocketsFilter.filterLoad
public function filterLoad(AssetInterface $asset) { static $format = <<<'EOF' #!/usr/bin/env ruby require %s %s options = { :load_path => [], :source_files => [%s], :expand_paths => false } %ssecretary = Sprockets::Secretary.new(options) secretary.install_assets if options[:asse...
php
public function filterLoad(AssetInterface $asset) { static $format = <<<'EOF' #!/usr/bin/env ruby require %s %s options = { :load_path => [], :source_files => [%s], :expand_paths => false } %ssecretary = Sprockets::Secretary.new(options) secretary.install_assets if options[:asse...
[ "public", "function", "filterLoad", "(", "AssetInterface", "$", "asset", ")", "{", "static", "$", "format", "=", " <<<'EOF'\n#!/usr/bin/env ruby\n\nrequire %s\n%s\noptions = { :load_path => [],\n :source_files => [%s],\n :expand_paths => false }\n\n%ssecretary = Sp...
Hack around a bit, get the job done.
[ "Hack", "around", "a", "bit", "get", "the", "job", "done", "." ]
3c432f321b5acdc9649f7d2cc80ce4ed98351f93
https://github.com/SuPa86000/ZF2Assetic/blob/3c432f321b5acdc9649f7d2cc80ce4ed98351f93/src/Assetic/Filter/SprocketsFilter.php#L61-L120