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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
13,900 | LightboxDigital/wp-dynamic-image-resizer | public/class-dynamic-image-resizer-public.php | Dynamic_Image_Resizer_Public.get_sizes | public function get_sizes( $size = '' ) {
global $_wp_additional_image_sizes;
$sizes = array();
$get_intermediate_image_sizes = get_intermediate_image_sizes();
// Create the full array with sizes and crop info.
foreach ( $get_intermediate_image_sizes as $_size ) {
if ( in_array( $_size, array( 'thumbnail'... | php | public function get_sizes( $size = '' ) {
global $_wp_additional_image_sizes;
$sizes = array();
$get_intermediate_image_sizes = get_intermediate_image_sizes();
// Create the full array with sizes and crop info.
foreach ( $get_intermediate_image_sizes as $_size ) {
if ( in_array( $_size, array( 'thumbnail'... | [
"public",
"function",
"get_sizes",
"(",
"$",
"size",
"=",
"''",
")",
"{",
"global",
"$",
"_wp_additional_image_sizes",
";",
"$",
"sizes",
"=",
"array",
"(",
")",
";",
"$",
"get_intermediate_image_sizes",
"=",
"get_intermediate_image_sizes",
"(",
")",
";",
"// ... | Get all the currently defined named image sizes
@since 1.0.0
@param string $size If supplied, only return this size.
@return array Image sizes | [
"Get",
"all",
"the",
"currently",
"defined",
"named",
"image",
"sizes"
] | cc1d67192c8463eba4c0920130abec933ed2296b | https://github.com/LightboxDigital/wp-dynamic-image-resizer/blob/cc1d67192c8463eba4c0920130abec933ed2296b/public/class-dynamic-image-resizer-public.php#L164-L194 |
13,901 | flagrow/flarum-ext-latex | src/Listeners/AddClientAssets.php | AddClientAssets.addForumAssets | public function addForumAssets(ConfigureClientView $event)
{
if ($event->isForum()) {
$event->addAssets([
__DIR__.'/../../js/forum/dist/extension.js',
]);
//Include css and java for KaTeX
$event->view->addHeadString('<link rel="stylesheet" href... | php | public function addForumAssets(ConfigureClientView $event)
{
if ($event->isForum()) {
$event->addAssets([
__DIR__.'/../../js/forum/dist/extension.js',
]);
//Include css and java for KaTeX
$event->view->addHeadString('<link rel="stylesheet" href... | [
"public",
"function",
"addForumAssets",
"(",
"ConfigureClientView",
"$",
"event",
")",
"{",
"if",
"(",
"$",
"event",
"->",
"isForum",
"(",
")",
")",
"{",
"$",
"event",
"->",
"addAssets",
"(",
"[",
"__DIR__",
".",
"'/../../js/forum/dist/extension.js'",
",",
"... | Modifies the client view for the Forum.
@param ConfigureClientView $event | [
"Modifies",
"the",
"client",
"view",
"for",
"the",
"Forum",
"."
] | 4db38817d26cb5e3a7e8a0b53f042c61d14af606 | https://github.com/flagrow/flarum-ext-latex/blob/4db38817d26cb5e3a7e8a0b53f042c61d14af606/src/Listeners/AddClientAssets.php#L35-L48 |
13,902 | mimmi20/Wurfl | src/Manager.php | Manager.getDeviceForRequest | private function getDeviceForRequest(Request\GenericRequest $request)
{
Handlers\Utils::reset();
$deviceId = $this->deviceIdForRequest($request);
return $this->getWrappedDevice($deviceId, $request);
} | php | private function getDeviceForRequest(Request\GenericRequest $request)
{
Handlers\Utils::reset();
$deviceId = $this->deviceIdForRequest($request);
return $this->getWrappedDevice($deviceId, $request);
} | [
"private",
"function",
"getDeviceForRequest",
"(",
"Request",
"\\",
"GenericRequest",
"$",
"request",
")",
"{",
"Handlers",
"\\",
"Utils",
"::",
"reset",
"(",
")",
";",
"$",
"deviceId",
"=",
"$",
"this",
"->",
"deviceIdForRequest",
"(",
"$",
"request",
")",
... | Returns the Device for the given \Wurfl\Request_GenericRequest
@param Request\GenericRequest $request
@return \Wurfl\CustomDevice | [
"Returns",
"the",
"Device",
"for",
"the",
"given",
"\\",
"Wurfl",
"\\",
"Request_GenericRequest"
] | 443ed0d73a0b9a21ebd0d6ddf1e32669b9de44ec | https://github.com/mimmi20/Wurfl/blob/443ed0d73a0b9a21ebd0d6ddf1e32669b9de44ec/src/Manager.php#L383-L390 |
13,903 | mimmi20/Wurfl | src/Manager.php | Manager.getDevice | public function getDevice($deviceId, Request\GenericRequest $request = null)
{
if ($request !== null) {
if (!($request instanceof GenericRequest)) {
throw new \InvalidArgumentException(
'Error: Request parameter must be null or instance of WURFL_Request_Generi... | php | public function getDevice($deviceId, Request\GenericRequest $request = null)
{
if ($request !== null) {
if (!($request instanceof GenericRequest)) {
throw new \InvalidArgumentException(
'Error: Request parameter must be null or instance of WURFL_Request_Generi... | [
"public",
"function",
"getDevice",
"(",
"$",
"deviceId",
",",
"Request",
"\\",
"GenericRequest",
"$",
"request",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"request",
"!==",
"null",
")",
"{",
"if",
"(",
"!",
"(",
"$",
"request",
"instanceof",
"GenericRequest... | Return a device for the given device id
@param string $deviceId
@param Request\GenericRequest $request
@throws \InvalidArgumentException
@return \Wurfl\Device\ModelDeviceInterface | [
"Return",
"a",
"device",
"for",
"the",
"given",
"device",
"id"
] | 443ed0d73a0b9a21ebd0d6ddf1e32669b9de44ec | https://github.com/mimmi20/Wurfl/blob/443ed0d73a0b9a21ebd0d6ddf1e32669b9de44ec/src/Manager.php#L424-L440 |
13,904 | mimmi20/Wurfl | src/Manager.php | Manager.getFallBackDevices | public function getFallBackDevices($deviceId)
{
$fallBackDevices = $this->getDeviceRepository()->getDeviceHierarchy($deviceId);
array_shift($fallBackDevices);
return array_map(array($this, 'deviceId'), $fallBackDevices);
} | php | public function getFallBackDevices($deviceId)
{
$fallBackDevices = $this->getDeviceRepository()->getDeviceHierarchy($deviceId);
array_shift($fallBackDevices);
return array_map(array($this, 'deviceId'), $fallBackDevices);
} | [
"public",
"function",
"getFallBackDevices",
"(",
"$",
"deviceId",
")",
"{",
"$",
"fallBackDevices",
"=",
"$",
"this",
"->",
"getDeviceRepository",
"(",
")",
"->",
"getDeviceHierarchy",
"(",
"$",
"deviceId",
")",
";",
"array_shift",
"(",
"$",
"fallBackDevices",
... | Returns an array of all the fall back devices starting from
the given device
@param string $deviceId
@return array | [
"Returns",
"an",
"array",
"of",
"all",
"the",
"fall",
"back",
"devices",
"starting",
"from",
"the",
"given",
"device"
] | 443ed0d73a0b9a21ebd0d6ddf1e32669b9de44ec | https://github.com/mimmi20/Wurfl/blob/443ed0d73a0b9a21ebd0d6ddf1e32669b9de44ec/src/Manager.php#L472-L479 |
13,905 | mimmi20/Wurfl | src/Manager.php | Manager.getWrappedDevice | private function getWrappedDevice($deviceId, Request\GenericRequest $request = null)
{
$modelDevices = $this->getCacheStorage()->load('DEVS_' . $deviceId);
if (empty($modelDevices)) {
$modelDevices = $this->getDeviceRepository()->getDeviceHierarchy($deviceId);
}
$this->... | php | private function getWrappedDevice($deviceId, Request\GenericRequest $request = null)
{
$modelDevices = $this->getCacheStorage()->load('DEVS_' . $deviceId);
if (empty($modelDevices)) {
$modelDevices = $this->getDeviceRepository()->getDeviceHierarchy($deviceId);
}
$this->... | [
"private",
"function",
"getWrappedDevice",
"(",
"$",
"deviceId",
",",
"Request",
"\\",
"GenericRequest",
"$",
"request",
"=",
"null",
")",
"{",
"$",
"modelDevices",
"=",
"$",
"this",
"->",
"getCacheStorage",
"(",
")",
"->",
"load",
"(",
"'DEVS_'",
".",
"$"... | Wraps the model device with \Wurfl\Xml\ModelDeviceInterface. This function takes the
Device ID and returns the \Wurfl\CustomDevice with all capabilities.
@param string $deviceId
@param Request\GenericRequest $request
@return \Wurfl\CustomDevice | [
"Wraps",
"the",
"model",
"device",
"with",
"\\",
"Wurfl",
"\\",
"Xml",
"\\",
"ModelDeviceInterface",
".",
"This",
"function",
"takes",
"the",
"Device",
"ID",
"and",
"returns",
"the",
"\\",
"Wurfl",
"\\",
"CustomDevice",
"with",
"all",
"capabilities",
"."
] | 443ed0d73a0b9a21ebd0d6ddf1e32669b9de44ec | https://github.com/mimmi20/Wurfl/blob/443ed0d73a0b9a21ebd0d6ddf1e32669b9de44ec/src/Manager.php#L558-L581 |
13,906 | codezero-be/flash | src/Flash.php | Flash.info | public function info($message, array $placeholders = [], $dismissible = true)
{
$this->message($message, null, $placeholders, 'info', $dismissible);
return $this;
} | php | public function info($message, array $placeholders = [], $dismissible = true)
{
$this->message($message, null, $placeholders, 'info', $dismissible);
return $this;
} | [
"public",
"function",
"info",
"(",
"$",
"message",
",",
"array",
"$",
"placeholders",
"=",
"[",
"]",
",",
"$",
"dismissible",
"=",
"true",
")",
"{",
"$",
"this",
"->",
"message",
"(",
"$",
"message",
",",
"null",
",",
"$",
"placeholders",
",",
"'info... | Flash an info message.
@param string $message
@param array $placeholders
@param bool $dismissible
@return $this | [
"Flash",
"an",
"info",
"message",
"."
] | ad65fd730ab5a594f9cf9e8c62b2c16c1eae3ce0 | https://github.com/codezero-be/flash/blob/ad65fd730ab5a594f9cf9e8c62b2c16c1eae3ce0/src/Flash.php#L64-L69 |
13,907 | codezero-be/flash | src/Flash.php | Flash.success | public function success($message, array $placeholders = [], $dismissible = true)
{
$this->message($message, null, $placeholders, 'success', $dismissible);
return $this;
} | php | public function success($message, array $placeholders = [], $dismissible = true)
{
$this->message($message, null, $placeholders, 'success', $dismissible);
return $this;
} | [
"public",
"function",
"success",
"(",
"$",
"message",
",",
"array",
"$",
"placeholders",
"=",
"[",
"]",
",",
"$",
"dismissible",
"=",
"true",
")",
"{",
"$",
"this",
"->",
"message",
"(",
"$",
"message",
",",
"null",
",",
"$",
"placeholders",
",",
"'s... | Flash a success message.
@param string $message
@param array $placeholders
@param bool $dismissible
@return $this | [
"Flash",
"a",
"success",
"message",
"."
] | ad65fd730ab5a594f9cf9e8c62b2c16c1eae3ce0 | https://github.com/codezero-be/flash/blob/ad65fd730ab5a594f9cf9e8c62b2c16c1eae3ce0/src/Flash.php#L80-L85 |
13,908 | codezero-be/flash | src/Flash.php | Flash.warning | public function warning($message, array $placeholders = [], $dismissible = true)
{
$this->message($message, null, $placeholders, 'warning', $dismissible);
return $this;
} | php | public function warning($message, array $placeholders = [], $dismissible = true)
{
$this->message($message, null, $placeholders, 'warning', $dismissible);
return $this;
} | [
"public",
"function",
"warning",
"(",
"$",
"message",
",",
"array",
"$",
"placeholders",
"=",
"[",
"]",
",",
"$",
"dismissible",
"=",
"true",
")",
"{",
"$",
"this",
"->",
"message",
"(",
"$",
"message",
",",
"null",
",",
"$",
"placeholders",
",",
"'w... | Flash a warning message.
@param string $message
@param array $placeholders
@param bool $dismissible
@return $this | [
"Flash",
"a",
"warning",
"message",
"."
] | ad65fd730ab5a594f9cf9e8c62b2c16c1eae3ce0 | https://github.com/codezero-be/flash/blob/ad65fd730ab5a594f9cf9e8c62b2c16c1eae3ce0/src/Flash.php#L96-L101 |
13,909 | codezero-be/flash | src/Flash.php | Flash.error | public function error($message, array $placeholders = [], $dismissible = true)
{
$this->message($message, null, $placeholders, 'error', $dismissible);
return $this;
} | php | public function error($message, array $placeholders = [], $dismissible = true)
{
$this->message($message, null, $placeholders, 'error', $dismissible);
return $this;
} | [
"public",
"function",
"error",
"(",
"$",
"message",
",",
"array",
"$",
"placeholders",
"=",
"[",
"]",
",",
"$",
"dismissible",
"=",
"true",
")",
"{",
"$",
"this",
"->",
"message",
"(",
"$",
"message",
",",
"null",
",",
"$",
"placeholders",
",",
"'err... | Flash an error message.
@param string $message
@param array $placeholders
@param bool $dismissible
@return $this | [
"Flash",
"an",
"error",
"message",
"."
] | ad65fd730ab5a594f9cf9e8c62b2c16c1eae3ce0 | https://github.com/codezero-be/flash/blob/ad65fd730ab5a594f9cf9e8c62b2c16c1eae3ce0/src/Flash.php#L112-L117 |
13,910 | codezero-be/flash | src/Flash.php | Flash.getExistingFlashMessages | private function getExistingFlashMessages()
{
return $this->session->has($this->sessionKey)
? $this->session->get($this->sessionKey)
: [];
} | php | private function getExistingFlashMessages()
{
return $this->session->has($this->sessionKey)
? $this->session->get($this->sessionKey)
: [];
} | [
"private",
"function",
"getExistingFlashMessages",
"(",
")",
"{",
"return",
"$",
"this",
"->",
"session",
"->",
"has",
"(",
"$",
"this",
"->",
"sessionKey",
")",
"?",
"$",
"this",
"->",
"session",
"->",
"get",
"(",
"$",
"this",
"->",
"sessionKey",
")",
... | Get messages that have already been flashed.
@return array | [
"Get",
"messages",
"that",
"have",
"already",
"been",
"flashed",
"."
] | ad65fd730ab5a594f9cf9e8c62b2c16c1eae3ce0 | https://github.com/codezero-be/flash/blob/ad65fd730ab5a594f9cf9e8c62b2c16c1eae3ce0/src/Flash.php#L183-L188 |
13,911 | codezero-be/flash | src/Flash.php | Flash.getTranslation | private function getTranslation($message, array $placeholders)
{
if ($this->translator->has($message)) {
$message = $this->translator->get($message, $placeholders);
}
return $message;
} | php | private function getTranslation($message, array $placeholders)
{
if ($this->translator->has($message)) {
$message = $this->translator->get($message, $placeholders);
}
return $message;
} | [
"private",
"function",
"getTranslation",
"(",
"$",
"message",
",",
"array",
"$",
"placeholders",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"translator",
"->",
"has",
"(",
"$",
"message",
")",
")",
"{",
"$",
"message",
"=",
"$",
"this",
"->",
"translator"... | Get a translation for the message key
or return the original message.
@param string $message
@param array $placeholders
@return string | [
"Get",
"a",
"translation",
"for",
"the",
"message",
"key",
"or",
"return",
"the",
"original",
"message",
"."
] | ad65fd730ab5a594f9cf9e8c62b2c16c1eae3ce0 | https://github.com/codezero-be/flash/blob/ad65fd730ab5a594f9cf9e8c62b2c16c1eae3ce0/src/Flash.php#L199-L206 |
13,912 | delatbabel/site-config | src/Models/Website.php | Website.currentServerName | public static function currentServerName()
{
if (! empty(env('SERVER_NAME'))) {
$BASE_URL = env('SERVER_NAME');
} elseif (! empty($_SERVER['SERVER_NAME'])) {
$BASE_URL = $_SERVER['SERVER_NAME'];
} elseif (! empty($_SERVER['HTTP_HOST'])) {
$BASE_URL = $_SER... | php | public static function currentServerName()
{
if (! empty(env('SERVER_NAME'))) {
$BASE_URL = env('SERVER_NAME');
} elseif (! empty($_SERVER['SERVER_NAME'])) {
$BASE_URL = $_SERVER['SERVER_NAME'];
} elseif (! empty($_SERVER['HTTP_HOST'])) {
$BASE_URL = $_SER... | [
"public",
"static",
"function",
"currentServerName",
"(",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"env",
"(",
"'SERVER_NAME'",
")",
")",
")",
"{",
"$",
"BASE_URL",
"=",
"env",
"(",
"'SERVER_NAME'",
")",
";",
"}",
"elseif",
"(",
"!",
"empty",
"(",
"$"... | Determine the current website server name.
This doesn't contain any URL identifiers such as 'http://', just
the host name (e.g. www.myserver.com).
@return string | [
"Determine",
"the",
"current",
"website",
"server",
"name",
"."
] | e547e63f5ea7140036bb3fe46ff47143b4f93d0f | https://github.com/delatbabel/site-config/blob/e547e63f5ea7140036bb3fe46ff47143b4f93d0f/src/Models/Website.php#L49-L61 |
13,913 | delatbabel/site-config | src/Models/Website.php | Website.currentWebsiteData | public static function currentWebsiteData()
{
static $current_data;
$BASE_URL = static::currentServerName();
$cache_key = 'website-data.' . $BASE_URL;
// Get the current ID from the cache if it is present.
if (empty($current_data)) {
if (Cache::has($cache_key)) ... | php | public static function currentWebsiteData()
{
static $current_data;
$BASE_URL = static::currentServerName();
$cache_key = 'website-data.' . $BASE_URL;
// Get the current ID from the cache if it is present.
if (empty($current_data)) {
if (Cache::has($cache_key)) ... | [
"public",
"static",
"function",
"currentWebsiteData",
"(",
")",
"{",
"static",
"$",
"current_data",
";",
"$",
"BASE_URL",
"=",
"static",
"::",
"currentServerName",
"(",
")",
";",
"$",
"cache_key",
"=",
"'website-data.'",
".",
"$",
"BASE_URL",
";",
"// Get the ... | Determine the current website data.
Returns null if the web site is not found in the websites table.
@return array | [
"Determine",
"the",
"current",
"website",
"data",
"."
] | e547e63f5ea7140036bb3fe46ff47143b4f93d0f | https://github.com/delatbabel/site-config/blob/e547e63f5ea7140036bb3fe46ff47143b4f93d0f/src/Models/Website.php#L70-L105 |
13,914 | activecollab/bootstrap | src/Controller/TypeController.php | TypeController.__before | protected function __before(ServerRequestInterface $request, array $arguments)
{
$type_id_variable = $this->getTypeIdVariable();
if (array_key_exists($type_id_variable, $arguments)) {
$this->active_object = empty($arguments[$type_id_variable]) ? null : $this->pool->getById($this->getTyp... | php | protected function __before(ServerRequestInterface $request, array $arguments)
{
$type_id_variable = $this->getTypeIdVariable();
if (array_key_exists($type_id_variable, $arguments)) {
$this->active_object = empty($arguments[$type_id_variable]) ? null : $this->pool->getById($this->getTyp... | [
"protected",
"function",
"__before",
"(",
"ServerRequestInterface",
"$",
"request",
",",
"array",
"$",
"arguments",
")",
"{",
"$",
"type_id_variable",
"=",
"$",
"this",
"->",
"getTypeIdVariable",
"(",
")",
";",
"if",
"(",
"array_key_exists",
"(",
"$",
"type_id... | Run before every action.
@param ServerRequestInterface $request
@param array $arguments
@return void|StatusResponse | [
"Run",
"before",
"every",
"action",
"."
] | 92eea19b2b2b329035f20e855a78f36e74084ccf | https://github.com/activecollab/bootstrap/blob/92eea19b2b2b329035f20e855a78f36e74084ccf/src/Controller/TypeController.php#L50-L63 |
13,915 | activecollab/bootstrap | src/Controller/TypeController.php | TypeController.index | public function index(ServerRequestInterface $request)
{
if ($this->shouldCheckPermissions()) {
$authenticated_user = $this->getAuthenticatedUser($request);
if (!$this->canList($authenticated_user)) {
return new ForbiddenStatusResponse();
}
}
... | php | public function index(ServerRequestInterface $request)
{
if ($this->shouldCheckPermissions()) {
$authenticated_user = $this->getAuthenticatedUser($request);
if (!$this->canList($authenticated_user)) {
return new ForbiddenStatusResponse();
}
}
... | [
"public",
"function",
"index",
"(",
"ServerRequestInterface",
"$",
"request",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"shouldCheckPermissions",
"(",
")",
")",
"{",
"$",
"authenticated_user",
"=",
"$",
"this",
"->",
"getAuthenticatedUser",
"(",
"$",
"request",
... | Return a collection of type instances.
@param ServerRequestInterface $request
@return CollectionInterface | [
"Return",
"a",
"collection",
"of",
"type",
"instances",
"."
] | 92eea19b2b2b329035f20e855a78f36e74084ccf | https://github.com/activecollab/bootstrap/blob/92eea19b2b2b329035f20e855a78f36e74084ccf/src/Controller/TypeController.php#L71-L95 |
13,916 | activecollab/bootstrap | src/Controller/TypeController.php | TypeController.edit | public function edit(ServerRequestInterface $request)
{
if ($this->isReadOnly()) {
return new NotFoundStatusResponse();
}
if ($this->active_object && $this->active_object->isLoaded()) {
$authenticated_user = $this->getAuthenticatedUser($request);
if ($th... | php | public function edit(ServerRequestInterface $request)
{
if ($this->isReadOnly()) {
return new NotFoundStatusResponse();
}
if ($this->active_object && $this->active_object->isLoaded()) {
$authenticated_user = $this->getAuthenticatedUser($request);
if ($th... | [
"public",
"function",
"edit",
"(",
"ServerRequestInterface",
"$",
"request",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isReadOnly",
"(",
")",
")",
"{",
"return",
"new",
"NotFoundStatusResponse",
"(",
")",
";",
"}",
"if",
"(",
"$",
"this",
"->",
"active_ob... | Update an existing type instance.
@param ServerRequestInterface $request
@return EntityInterface | [
"Update",
"an",
"existing",
"type",
"instance",
"."
] | 92eea19b2b2b329035f20e855a78f36e74084ccf | https://github.com/activecollab/bootstrap/blob/92eea19b2b2b329035f20e855a78f36e74084ccf/src/Controller/TypeController.php#L170-L203 |
13,917 | activecollab/bootstrap | src/Controller/TypeController.php | TypeController.delete | public function delete(ServerRequestInterface $request)
{
if ($this->isReadOnly()) {
return new NotFoundStatusResponse();
}
if ($this->active_object && $this->active_object->isLoaded()) {
$authenticated_user = $this->getAuthenticatedUser($request);
if ($... | php | public function delete(ServerRequestInterface $request)
{
if ($this->isReadOnly()) {
return new NotFoundStatusResponse();
}
if ($this->active_object && $this->active_object->isLoaded()) {
$authenticated_user = $this->getAuthenticatedUser($request);
if ($... | [
"public",
"function",
"delete",
"(",
"ServerRequestInterface",
"$",
"request",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isReadOnly",
"(",
")",
")",
"{",
"return",
"new",
"NotFoundStatusResponse",
"(",
")",
";",
"}",
"if",
"(",
"$",
"this",
"->",
"active_... | Drop an existing type instance.
@param ServerRequestInterface $request
@return EntityInterface|StatusResponse | [
"Drop",
"an",
"existing",
"type",
"instance",
"."
] | 92eea19b2b2b329035f20e855a78f36e74084ccf | https://github.com/activecollab/bootstrap/blob/92eea19b2b2b329035f20e855a78f36e74084ccf/src/Controller/TypeController.php#L211-L236 |
13,918 | activecollab/bootstrap | src/Controller/TypeController.php | TypeController.getPageFromQueryParams | protected function getPageFromQueryParams(array $query_params)
{
$page = 1;
if (isset($query_params['page'])) {
$page = (integer) $query_params['page'];
}
return $page < 1 ? 1 : $page;
} | php | protected function getPageFromQueryParams(array $query_params)
{
$page = 1;
if (isset($query_params['page'])) {
$page = (integer) $query_params['page'];
}
return $page < 1 ? 1 : $page;
} | [
"protected",
"function",
"getPageFromQueryParams",
"(",
"array",
"$",
"query_params",
")",
"{",
"$",
"page",
"=",
"1",
";",
"if",
"(",
"isset",
"(",
"$",
"query_params",
"[",
"'page'",
"]",
")",
")",
"{",
"$",
"page",
"=",
"(",
"integer",
")",
"$",
"... | Return page from request query params.
@param array $query_params
@return int | [
"Return",
"page",
"from",
"request",
"query",
"params",
"."
] | 92eea19b2b2b329035f20e855a78f36e74084ccf | https://github.com/activecollab/bootstrap/blob/92eea19b2b2b329035f20e855a78f36e74084ccf/src/Controller/TypeController.php#L248-L257 |
13,919 | activecollab/bootstrap | src/Controller/TypeController.php | TypeController.getTypeFromRequestBody | protected function getTypeFromRequestBody(array &$request_body)
{
$type_class = $this->getTypeClassName();
if (isset($request_body['type'])) {
$type_class = $request_body['type'];
unset($request_body['type']);
}
if (class_exists($type_class)) {
$... | php | protected function getTypeFromRequestBody(array &$request_body)
{
$type_class = $this->getTypeClassName();
if (isset($request_body['type'])) {
$type_class = $request_body['type'];
unset($request_body['type']);
}
if (class_exists($type_class)) {
$... | [
"protected",
"function",
"getTypeFromRequestBody",
"(",
"array",
"&",
"$",
"request_body",
")",
"{",
"$",
"type_class",
"=",
"$",
"this",
"->",
"getTypeClassName",
"(",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"request_body",
"[",
"'type'",
"]",
")",
")",
... | Get a valid type class from request body.
@param array $request_body
@return string | [
"Get",
"a",
"valid",
"type",
"class",
"from",
"request",
"body",
"."
] | 92eea19b2b2b329035f20e855a78f36e74084ccf | https://github.com/activecollab/bootstrap/blob/92eea19b2b2b329035f20e855a78f36e74084ccf/src/Controller/TypeController.php#L265-L283 |
13,920 | activecollab/bootstrap | src/Controller/TypeController.php | TypeController.cleanUpRequestBodyForEdit | protected function cleanUpRequestBodyForEdit(array &$request_body, UserInterface $user = null)
{
$this->cleanUpRequestBody($request_body, $user);
if ($this->pool->isTypePolymorph($this->getTypeClassName()) && array_key_exists('type', $request_body)) {
unset($request_body['type']);
... | php | protected function cleanUpRequestBodyForEdit(array &$request_body, UserInterface $user = null)
{
$this->cleanUpRequestBody($request_body, $user);
if ($this->pool->isTypePolymorph($this->getTypeClassName()) && array_key_exists('type', $request_body)) {
unset($request_body['type']);
... | [
"protected",
"function",
"cleanUpRequestBodyForEdit",
"(",
"array",
"&",
"$",
"request_body",
",",
"UserInterface",
"$",
"user",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"cleanUpRequestBody",
"(",
"$",
"request_body",
",",
"$",
"user",
")",
";",
"if",
"(",
... | Perform request data clean-up before reqeust data is being used for edit action.
@param array $request_body
@param UserInterface|null $user | [
"Perform",
"request",
"data",
"clean",
"-",
"up",
"before",
"reqeust",
"data",
"is",
"being",
"used",
"for",
"edit",
"action",
"."
] | 92eea19b2b2b329035f20e855a78f36e74084ccf | https://github.com/activecollab/bootstrap/blob/92eea19b2b2b329035f20e855a78f36e74084ccf/src/Controller/TypeController.php#L330-L337 |
13,921 | ignasbernotas/console | src/Question/Question.php | Question.ask | public function ask()
{
$this->drawer->open();
$phkey = new Detector();
$listener = $phkey->getListenerInstance();
$event = $listener->getEventDispatcher();
$event->addListener(
'key:up',
function () {
$this->cursor->moveUp(count($thi... | php | public function ask()
{
$this->drawer->open();
$phkey = new Detector();
$listener = $phkey->getListenerInstance();
$event = $listener->getEventDispatcher();
$event->addListener(
'key:up',
function () {
$this->cursor->moveUp(count($thi... | [
"public",
"function",
"ask",
"(",
")",
"{",
"$",
"this",
"->",
"drawer",
"->",
"open",
"(",
")",
";",
"$",
"phkey",
"=",
"new",
"Detector",
"(",
")",
";",
"$",
"listener",
"=",
"$",
"phkey",
"->",
"getListenerInstance",
"(",
")",
";",
"$",
"event",... | Asks the question
@return array | [
"Asks",
"the",
"question"
] | 909e613b140413062424d6a465da08aac355be55 | https://github.com/ignasbernotas/console/blob/909e613b140413062424d6a465da08aac355be55/src/Question/Question.php#L113-L157 |
13,922 | ignasbernotas/console | src/Question/Question.php | Question.draw | protected function draw()
{
$this->drawer->drawWindow(
$this->title,
$this->choices,
$this->cursor->getPosition(),
$this->answers
);
} | php | protected function draw()
{
$this->drawer->drawWindow(
$this->title,
$this->choices,
$this->cursor->getPosition(),
$this->answers
);
} | [
"protected",
"function",
"draw",
"(",
")",
"{",
"$",
"this",
"->",
"drawer",
"->",
"drawWindow",
"(",
"$",
"this",
"->",
"title",
",",
"$",
"this",
"->",
"choices",
",",
"$",
"this",
"->",
"cursor",
"->",
"getPosition",
"(",
")",
",",
"$",
"this",
... | Draws the window | [
"Draws",
"the",
"window"
] | 909e613b140413062424d6a465da08aac355be55 | https://github.com/ignasbernotas/console/blob/909e613b140413062424d6a465da08aac355be55/src/Question/Question.php#L162-L170 |
13,923 | nyeholt/silverstripe-simplewiki | thirdparty/htmlpurifier-4.0.0-lite/library/HTMLPurifier/URIScheme.php | HTMLPurifier_URIScheme.validate | public function validate(&$uri, $config, $context) {
if ($this->default_port == $uri->port) $uri->port = null;
return true;
} | php | public function validate(&$uri, $config, $context) {
if ($this->default_port == $uri->port) $uri->port = null;
return true;
} | [
"public",
"function",
"validate",
"(",
"&",
"$",
"uri",
",",
"$",
"config",
",",
"$",
"context",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"default_port",
"==",
"$",
"uri",
"->",
"port",
")",
"$",
"uri",
"->",
"port",
"=",
"null",
";",
"return",
"t... | Validates the components of a URI
@note This implementation should be called by children if they define
a default port, as it does port processing.
@param $uri Instance of HTMLPurifier_URI
@param $config HTMLPurifier_Config object
@param $context HTMLPurifier_Context object
@return Bool success or failure | [
"Validates",
"the",
"components",
"of",
"a",
"URI"
] | ecffed0d75be1454901e1cb24633472b8f67c967 | https://github.com/nyeholt/silverstripe-simplewiki/blob/ecffed0d75be1454901e1cb24633472b8f67c967/thirdparty/htmlpurifier-4.0.0-lite/library/HTMLPurifier/URIScheme.php#L35-L38 |
13,924 | ahmad-sa3d/saad-image | src/Captcha/Captcha.php | Captcha.exportImage | public function exportImage( $keep_resorce = false )
{
// prepare Capatcha
$this->getCaptchaImage();
# Sending Header Info
header( 'content-type: image/png' );
# Exporting the final image
imagepng( $this->_final_image );
# Clearing final image from the memory
imagedestroy( $this->_final_image );... | php | public function exportImage( $keep_resorce = false )
{
// prepare Capatcha
$this->getCaptchaImage();
# Sending Header Info
header( 'content-type: image/png' );
# Exporting the final image
imagepng( $this->_final_image );
# Clearing final image from the memory
imagedestroy( $this->_final_image );... | [
"public",
"function",
"exportImage",
"(",
"$",
"keep_resorce",
"=",
"false",
")",
"{",
"// prepare Capatcha",
"$",
"this",
"->",
"getCaptchaImage",
"(",
")",
";",
"# Sending Header Info",
"header",
"(",
"'content-type: image/png'",
")",
";",
"# Exporting the final ima... | send image to browser | [
"send",
"image",
"to",
"browser"
] | 2485e585e0c2ae2b8f0afeb3d513f2df3e369939 | https://github.com/ahmad-sa3d/saad-image/blob/2485e585e0c2ae2b8f0afeb3d513f2df3e369939/src/Captcha/Captcha.php#L78-L93 |
13,925 | ahmad-sa3d/saad-image | src/Captcha/Captcha.php | Captcha.init | public static function init( $blocks = 2, $block_min_length = 4, $block_max_length = 7 )
{
if( !is_numeric( $blocks ) || !is_numeric( $block_min_length ) || !is_numeric( $block_max_length ) )
throw new CaptchaException( __METHOD__ . ' arguments must be numeric values' );
if( $blocks < 1 || $blocks > 5 )
thr... | php | public static function init( $blocks = 2, $block_min_length = 4, $block_max_length = 7 )
{
if( !is_numeric( $blocks ) || !is_numeric( $block_min_length ) || !is_numeric( $block_max_length ) )
throw new CaptchaException( __METHOD__ . ' arguments must be numeric values' );
if( $blocks < 1 || $blocks > 5 )
thr... | [
"public",
"static",
"function",
"init",
"(",
"$",
"blocks",
"=",
"2",
",",
"$",
"block_min_length",
"=",
"4",
",",
"$",
"block_max_length",
"=",
"7",
")",
"{",
"if",
"(",
"!",
"is_numeric",
"(",
"$",
"blocks",
")",
"||",
"!",
"is_numeric",
"(",
"$",
... | This Method Will Generate a Capatcha Code and Store it in Session | [
"This",
"Method",
"Will",
"Generate",
"a",
"Capatcha",
"Code",
"and",
"Store",
"it",
"in",
"Session"
] | 2485e585e0c2ae2b8f0afeb3d513f2df3e369939 | https://github.com/ahmad-sa3d/saad-image/blob/2485e585e0c2ae2b8f0afeb3d513f2df3e369939/src/Captcha/Captcha.php#L109-L146 |
13,926 | ahmad-sa3d/saad-image | src/Captcha/Captcha.php | Captcha.calculateDimensions | private function calculateDimensions()
{
# calculate capatcha text box dimensions
# which are the minimum image resource dimensions
$this->_calculated_text_box['dimensions'] = $this->getTextBoxDimensions(
$this->_background_text['size'],
0,
$this->_background_text['fon... | php | private function calculateDimensions()
{
# calculate capatcha text box dimensions
# which are the minimum image resource dimensions
$this->_calculated_text_box['dimensions'] = $this->getTextBoxDimensions(
$this->_background_text['size'],
0,
$this->_background_text['fon... | [
"private",
"function",
"calculateDimensions",
"(",
")",
"{",
"# calculate capatcha text box dimensions",
"# which are the minimum image resource dimensions",
"$",
"this",
"->",
"_calculated_text_box",
"[",
"'dimensions'",
"]",
"=",
"$",
"this",
"->",
"getTextBoxDimensions",
"... | calculate required size of capatcha image | [
"calculate",
"required",
"size",
"of",
"capatcha",
"image"
] | 2485e585e0c2ae2b8f0afeb3d513f2df3e369939 | https://github.com/ahmad-sa3d/saad-image/blob/2485e585e0c2ae2b8f0afeb3d513f2df3e369939/src/Captcha/Captcha.php#L191-L219 |
13,927 | ahmad-sa3d/saad-image | src/Captcha/Captcha.php | Captcha.createCaptchaImage | private function createCaptchaImage()
{
$this->_image_resource = imagecreatetruecolor( $this->_image_info['width'], $this->_image_info['height'] );
if( function_exists( 'imageantialias' ) )
imageantialias( $this->_image_resource, true );
# Get Colors Values
$rgb = $this->getRGBFromRange(
$this-... | php | private function createCaptchaImage()
{
$this->_image_resource = imagecreatetruecolor( $this->_image_info['width'], $this->_image_info['height'] );
if( function_exists( 'imageantialias' ) )
imageantialias( $this->_image_resource, true );
# Get Colors Values
$rgb = $this->getRGBFromRange(
$this-... | [
"private",
"function",
"createCaptchaImage",
"(",
")",
"{",
"$",
"this",
"->",
"_image_resource",
"=",
"imagecreatetruecolor",
"(",
"$",
"this",
"->",
"_image_info",
"[",
"'width'",
"]",
",",
"$",
"this",
"->",
"_image_info",
"[",
"'height'",
"]",
")",
";",
... | create capatcha image resource | [
"create",
"capatcha",
"image",
"resource"
] | 2485e585e0c2ae2b8f0afeb3d513f2df3e369939 | https://github.com/ahmad-sa3d/saad-image/blob/2485e585e0c2ae2b8f0afeb3d513f2df3e369939/src/Captcha/Captcha.php#L225-L259 |
13,928 | ahmad-sa3d/saad-image | src/Captcha/Captcha.php | Captcha.fixCaptchaImage | private function fixCaptchaImage(){
# Final equired image width must be
# Last _front_text x position + initial_x
$final_width = $this->_front_text['x'] + $this->_front_text['initial_x'];
# check if to set final width
if( $this->_image_info['width'] > $final_width )
$this->_image_info['width'] = $... | php | private function fixCaptchaImage(){
# Final equired image width must be
# Last _front_text x position + initial_x
$final_width = $this->_front_text['x'] + $this->_front_text['initial_x'];
# check if to set final width
if( $this->_image_info['width'] > $final_width )
$this->_image_info['width'] = $... | [
"private",
"function",
"fixCaptchaImage",
"(",
")",
"{",
"# Final equired image width must be",
"# Last _front_text x position + initial_x",
"$",
"final_width",
"=",
"$",
"this",
"->",
"_front_text",
"[",
"'x'",
"]",
"+",
"$",
"this",
"->",
"_front_text",
"[",
"'initi... | Fix Final Capatcha image Size if needed | [
"Fix",
"Final",
"Capatcha",
"image",
"Size",
"if",
"needed"
] | 2485e585e0c2ae2b8f0afeb3d513f2df3e369939 | https://github.com/ahmad-sa3d/saad-image/blob/2485e585e0c2ae2b8f0afeb3d513f2df3e369939/src/Captcha/Captcha.php#L423-L456 |
13,929 | ahmad-sa3d/saad-image | src/Captcha/Captcha.php | Captcha.setTextSize | public function setTextSize( $front, $background = null )
{
# comment
if( !is_numeric( $front ) )
throw new CaptchaException( __METHOD__ . '($arg) must be numeric' );
if( !$background )
{
$this->_front_text['size'] = $front;
$this->_background_text['size'] = $front + 10;
}
else
{
i... | php | public function setTextSize( $front, $background = null )
{
# comment
if( !is_numeric( $front ) )
throw new CaptchaException( __METHOD__ . '($arg) must be numeric' );
if( !$background )
{
$this->_front_text['size'] = $front;
$this->_background_text['size'] = $front + 10;
}
else
{
i... | [
"public",
"function",
"setTextSize",
"(",
"$",
"front",
",",
"$",
"background",
"=",
"null",
")",
"{",
"#\tcomment",
"if",
"(",
"!",
"is_numeric",
"(",
"$",
"front",
")",
")",
"throw",
"new",
"CaptchaException",
"(",
"__METHOD__",
".",
"'($arg) must be numer... | Set Text Size
@param integer $front front text size
@param integer $background text size | [
"Set",
"Text",
"Size"
] | 2485e585e0c2ae2b8f0afeb3d513f2df3e369939 | https://github.com/ahmad-sa3d/saad-image/blob/2485e585e0c2ae2b8f0afeb3d513f2df3e369939/src/Captcha/Captcha.php#L470-L498 |
13,930 | ahmad-sa3d/saad-image | src/Captcha/Captcha.php | Captcha.setColor | public function setColor( $key, $r, $g, $b, $alpha = 0, $range = 0 )
{
# Set color
if( !in_array( $key, array( 'background', 'background_text', 'front_text' ) ) )
throw new CaptchaException( __METHOD__ . '($key, ) must be one of( background, background_text, front_text ).' );
if( !is_numeric( $r ) || !is... | php | public function setColor( $key, $r, $g, $b, $alpha = 0, $range = 0 )
{
# Set color
if( !in_array( $key, array( 'background', 'background_text', 'front_text' ) ) )
throw new CaptchaException( __METHOD__ . '($key, ) must be one of( background, background_text, front_text ).' );
if( !is_numeric( $r ) || !is... | [
"public",
"function",
"setColor",
"(",
"$",
"key",
",",
"$",
"r",
",",
"$",
"g",
",",
"$",
"b",
",",
"$",
"alpha",
"=",
"0",
",",
"$",
"range",
"=",
"0",
")",
"{",
"#\tSet color",
"if",
"(",
"!",
"in_array",
"(",
"$",
"key",
",",
"array",
"("... | Set Text Color
@param string $key define which property to set it's color
@param integer $r red value
@param integer $g green value
@param integer $b blue value
@param integer $alpha alpha value
@param integer $range range | [
"Set",
"Text",
"Color"
] | 2485e585e0c2ae2b8f0afeb3d513f2df3e369939 | https://github.com/ahmad-sa3d/saad-image/blob/2485e585e0c2ae2b8f0afeb3d513f2df3e369939/src/Captcha/Captcha.php#L510-L529 |
13,931 | ahmad-sa3d/saad-image | src/Captcha/Captcha.php | Captcha.setFont | public function setFont( $key, $font )
{
# Set Fonts
if( $key != 'background_text' && $key != 'front_text' )
throw new CaptchaException( __METHOD__ . '($key, ) $key must be background_text or front_text.' );
# check font file existence
$font_file = Config::get( 'images.captcha.font_dir' ) . DIRECTORY_S... | php | public function setFont( $key, $font )
{
# Set Fonts
if( $key != 'background_text' && $key != 'front_text' )
throw new CaptchaException( __METHOD__ . '($key, ) $key must be background_text or front_text.' );
# check font file existence
$font_file = Config::get( 'images.captcha.font_dir' ) . DIRECTORY_S... | [
"public",
"function",
"setFont",
"(",
"$",
"key",
",",
"$",
"font",
")",
"{",
"#\tSet Fonts",
"if",
"(",
"$",
"key",
"!=",
"'background_text'",
"&&",
"$",
"key",
"!=",
"'front_text'",
")",
"throw",
"new",
"CaptchaException",
"(",
"__METHOD__",
".",
"'($key... | Set Captcha Font
@param string $key define which text we want to set it's font
@param string $font font file name | [
"Set",
"Captcha",
"Font"
] | 2485e585e0c2ae2b8f0afeb3d513f2df3e369939 | https://github.com/ahmad-sa3d/saad-image/blob/2485e585e0c2ae2b8f0afeb3d513f2df3e369939/src/Captcha/Captcha.php#L537-L556 |
13,932 | chippyash/Strong-Type | src/Chippyash/Type/Number/Rational/AbstractRationalType.php | AbstractRationalType.asComplex | public function asComplex()
{
return new ComplexType(
new RationalType(clone $this->numerator(), clone $this->denominator()),
new RationalType(new IntType(0), new IntType(1))
);
} | php | public function asComplex()
{
return new ComplexType(
new RationalType(clone $this->numerator(), clone $this->denominator()),
new RationalType(new IntType(0), new IntType(1))
);
} | [
"public",
"function",
"asComplex",
"(",
")",
"{",
"return",
"new",
"ComplexType",
"(",
"new",
"RationalType",
"(",
"clone",
"$",
"this",
"->",
"numerator",
"(",
")",
",",
"clone",
"$",
"this",
"->",
"denominator",
"(",
")",
")",
",",
"new",
"RationalType... | Return the number as a Complex number i.e. n+0i
@return \Chippyash\Type\Number\Complex\ComplexType | [
"Return",
"the",
"number",
"as",
"a",
"Complex",
"number",
"i",
".",
"e",
".",
"n",
"+",
"0i"
] | 9d364c10c68c10f768254fb25b0b1db3dbef6fa9 | https://github.com/chippyash/Strong-Type/blob/9d364c10c68c10f768254fb25b0b1db3dbef6fa9/src/Chippyash/Type/Number/Rational/AbstractRationalType.php#L48-L54 |
13,933 | chippyash/Strong-Type | src/Chippyash/Type/Number/Rational/AbstractRationalType.php | AbstractRationalType.getAsNativeType | public function getAsNativeType()
{
if ($this->isInteger()) {
return intval($this->value['num']->get());
}
return floatval($this->value['num']->get() / $this->value['den']->get());
} | php | public function getAsNativeType()
{
if ($this->isInteger()) {
return intval($this->value['num']->get());
}
return floatval($this->value['num']->get() / $this->value['den']->get());
} | [
"public",
"function",
"getAsNativeType",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isInteger",
"(",
")",
")",
"{",
"return",
"intval",
"(",
"$",
"this",
"->",
"value",
"[",
"'num'",
"]",
"->",
"get",
"(",
")",
")",
";",
"}",
"return",
"floatval... | Get the basic PHP value of the object type properly
In this case, the type is an int or float
@return int|float | [
"Get",
"the",
"basic",
"PHP",
"value",
"of",
"the",
"object",
"type",
"properly",
"In",
"this",
"case",
"the",
"type",
"is",
"an",
"int",
"or",
"float"
] | 9d364c10c68c10f768254fb25b0b1db3dbef6fa9 | https://github.com/chippyash/Strong-Type/blob/9d364c10c68c10f768254fb25b0b1db3dbef6fa9/src/Chippyash/Type/Number/Rational/AbstractRationalType.php#L155-L162 |
13,934 | mimmi20/Wurfl | src/Handlers/Normalizer/Generic/IISLogging.php | IISLogging.normalize | public function normalize($userAgent)
{
//If there are no spaces in a UA and more than 2 plus symbols, the UA is likely affected by IIS style logging issues
if (substr_count($userAgent, ' ') === 0 and substr_count($userAgent, '+') > 2) {
$userAgent = str_replace('+', ' ', $userAgent);
... | php | public function normalize($userAgent)
{
//If there are no spaces in a UA and more than 2 plus symbols, the UA is likely affected by IIS style logging issues
if (substr_count($userAgent, ' ') === 0 and substr_count($userAgent, '+') > 2) {
$userAgent = str_replace('+', ' ', $userAgent);
... | [
"public",
"function",
"normalize",
"(",
"$",
"userAgent",
")",
"{",
"//If there are no spaces in a UA and more than 2 plus symbols, the UA is likely affected by IIS style logging issues",
"if",
"(",
"substr_count",
"(",
"$",
"userAgent",
",",
"' '",
")",
"===",
"0",
"and",
... | This method clean the IIS logging from user agent string.
@param string $userAgent
@return string Normalized user agent | [
"This",
"method",
"clean",
"the",
"IIS",
"logging",
"from",
"user",
"agent",
"string",
"."
] | 443ed0d73a0b9a21ebd0d6ddf1e32669b9de44ec | https://github.com/mimmi20/Wurfl/blob/443ed0d73a0b9a21ebd0d6ddf1e32669b9de44ec/src/Handlers/Normalizer/Generic/IISLogging.php#L34-L42 |
13,935 | geniv/nette-thumbnail | src/MacroThumb.php | MacroThumb.macroThumb | public function macroThumb(MacroNode $node, PhpWriter $writer)
{
if ($node->modifiers) {
// accept dataStream modifier for base64
if (Helpers::removeFilter($node->modifiers, 'dataStream')) {
return $writer->write('$_fi=Thumbnail\\Thumbnail::getSrcPath(%node.word, %nod... | php | public function macroThumb(MacroNode $node, PhpWriter $writer)
{
if ($node->modifiers) {
// accept dataStream modifier for base64
if (Helpers::removeFilter($node->modifiers, 'dataStream')) {
return $writer->write('$_fi=Thumbnail\\Thumbnail::getSrcPath(%node.word, %nod... | [
"public",
"function",
"macroThumb",
"(",
"MacroNode",
"$",
"node",
",",
"PhpWriter",
"$",
"writer",
")",
"{",
"if",
"(",
"$",
"node",
"->",
"modifiers",
")",
"{",
"// accept dataStream modifier for base64",
"if",
"(",
"Helpers",
"::",
"removeFilter",
"(",
"$",... | Macro thumb.
@param MacroNode $node
@param PhpWriter $writer
@return string
@throws CompileException | [
"Macro",
"thumb",
"."
] | 408fc61e0df99113a873ca1ec463e4fc85016eed | https://github.com/geniv/nette-thumbnail/blob/408fc61e0df99113a873ca1ec463e4fc85016eed/src/MacroThumb.php#L42-L52 |
13,936 | itrnka/ha-framework | src/ha/Access/HTTP/Router/Route/HTTPRouteExample.php | HTTPRouteExample.prepareResponse | public function prepareResponse(): void
{
// change default HTTP status code
$this->response->setStatusCode(200);
// clear default response headers
$this->response->resetHeaders();
// add your response headers
$this->response->setCharset('UTF-8');
$this->res... | php | public function prepareResponse(): void
{
// change default HTTP status code
$this->response->setStatusCode(200);
// clear default response headers
$this->response->resetHeaders();
// add your response headers
$this->response->setCharset('UTF-8');
$this->res... | [
"public",
"function",
"prepareResponse",
"(",
")",
":",
"void",
"{",
"// change default HTTP status code",
"$",
"this",
"->",
"response",
"->",
"setStatusCode",
"(",
"200",
")",
";",
"// clear default response headers",
"$",
"this",
"->",
"response",
"->",
"resetHea... | Setup response headers and body by your controller or other logic. | [
"Setup",
"response",
"headers",
"and",
"body",
"by",
"your",
"controller",
"or",
"other",
"logic",
"."
] | a72b09c28f8e966c37f98a0004e4fbbce80df42c | https://github.com/itrnka/ha-framework/blob/a72b09c28f8e966c37f98a0004e4fbbce80df42c/src/ha/Access/HTTP/Router/Route/HTTPRouteExample.php#L28-L48 |
13,937 | todstoychev/icr | src/Manipulator/AbstractManipulator.php | AbstractManipulator.calculateResize | protected function calculateResize(AbstractImage $abstractImage, $width, $height)
{
if (!is_numeric($width) || !is_numeric($height)) {
throw new \LogicException('Non numeric value provide for calculating resize!');
}
$imageWidth = $abstractImage->getSize()->getWidth();
$... | php | protected function calculateResize(AbstractImage $abstractImage, $width, $height)
{
if (!is_numeric($width) || !is_numeric($height)) {
throw new \LogicException('Non numeric value provide for calculating resize!');
}
$imageWidth = $abstractImage->getSize()->getWidth();
$... | [
"protected",
"function",
"calculateResize",
"(",
"AbstractImage",
"$",
"abstractImage",
",",
"$",
"width",
",",
"$",
"height",
")",
"{",
"if",
"(",
"!",
"is_numeric",
"(",
"$",
"width",
")",
"||",
"!",
"is_numeric",
"(",
"$",
"height",
")",
")",
"{",
"... | Calculates image resize
@param AbstractImage $abstractImage
@param int $width
@param int $height
@return Box | [
"Calculates",
"image",
"resize"
] | 0214c7bc76e44488e98758d55deb707b72e24000 | https://github.com/todstoychev/icr/blob/0214c7bc76e44488e98758d55deb707b72e24000/src/Manipulator/AbstractManipulator.php#L56-L82 |
13,938 | todstoychev/icr | src/Manipulator/AbstractManipulator.php | AbstractManipulator.createCropPoint | protected function createCropPoint(AbstractImage $abstractImage, $width, $height)
{
if (!is_numeric($width) || !is_numeric($height)) {
throw new \LogicException('Provided values for width and height are not numeric!');
}
$width = (int) $width;
$height = (int) $height;
... | php | protected function createCropPoint(AbstractImage $abstractImage, $width, $height)
{
if (!is_numeric($width) || !is_numeric($height)) {
throw new \LogicException('Provided values for width and height are not numeric!');
}
$width = (int) $width;
$height = (int) $height;
... | [
"protected",
"function",
"createCropPoint",
"(",
"AbstractImage",
"$",
"abstractImage",
",",
"$",
"width",
",",
"$",
"height",
")",
"{",
"if",
"(",
"!",
"is_numeric",
"(",
"$",
"width",
")",
"||",
"!",
"is_numeric",
"(",
"$",
"height",
")",
")",
"{",
"... | Creates crop point
@param AbstractImage $abstractImage
@param int $width
@param int $height
@return Point | [
"Creates",
"crop",
"point"
] | 0214c7bc76e44488e98758d55deb707b72e24000 | https://github.com/todstoychev/icr/blob/0214c7bc76e44488e98758d55deb707b72e24000/src/Manipulator/AbstractManipulator.php#L93-L120 |
13,939 | dphn/ScContent | src/ScContent/Entity/Widget.php | Widget.isApplicable | public function isApplicable($role)
{
if (isset($this->options['roles'][$role])) {
return (bool) (int) $this->options['roles'][$role];
}
return true;
} | php | public function isApplicable($role)
{
if (isset($this->options['roles'][$role])) {
return (bool) (int) $this->options['roles'][$role];
}
return true;
} | [
"public",
"function",
"isApplicable",
"(",
"$",
"role",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"options",
"[",
"'roles'",
"]",
"[",
"$",
"role",
"]",
")",
")",
"{",
"return",
"(",
"bool",
")",
"(",
"int",
")",
"$",
"this",
"->",
... | Checks whether the widget is applicable to the role.
This behavior differs from the ACL. Returns FALSE if and only if the
widget is explicitly disabled for a given role.
This is true because the widgets do not have to perform any
function other than displaying information. To change the information
are frontend and ba... | [
"Checks",
"whether",
"the",
"widget",
"is",
"applicable",
"to",
"the",
"role",
".",
"This",
"behavior",
"differs",
"from",
"the",
"ACL",
".",
"Returns",
"FALSE",
"if",
"and",
"only",
"if",
"the",
"widget",
"is",
"explicitly",
"disabled",
"for",
"a",
"given... | 9dd5732490c45fd788b96cedf7b3c7adfacb30d2 | https://github.com/dphn/ScContent/blob/9dd5732490c45fd788b96cedf7b3c7adfacb30d2/src/ScContent/Entity/Widget.php#L237-L243 |
13,940 | chippyash/Strong-Type | src/Chippyash/Type/Number/GMPIntType.php | GMPIntType.gmpTypeCheck | protected function gmpTypeCheck($value)
{
if (version_compare(PHP_VERSION, '5.6.0') < 0) {
return is_resource($value) && get_resource_type($value) == 'GMP integer';
}
return ($value instanceof \GMP);
} | php | protected function gmpTypeCheck($value)
{
if (version_compare(PHP_VERSION, '5.6.0') < 0) {
return is_resource($value) && get_resource_type($value) == 'GMP integer';
}
return ($value instanceof \GMP);
} | [
"protected",
"function",
"gmpTypeCheck",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"version_compare",
"(",
"PHP_VERSION",
",",
"'5.6.0'",
")",
"<",
"0",
")",
"{",
"return",
"is_resource",
"(",
"$",
"value",
")",
"&&",
"get_resource_type",
"(",
"$",
"value",
... | Check gmp type depending on PHP version
@param mixed $value value to check type of
@return boolean true if gmp number else false | [
"Check",
"gmp",
"type",
"depending",
"on",
"PHP",
"version"
] | 9d364c10c68c10f768254fb25b0b1db3dbef6fa9 | https://github.com/chippyash/Strong-Type/blob/9d364c10c68c10f768254fb25b0b1db3dbef6fa9/src/Chippyash/Type/Number/GMPIntType.php#L292-L299 |
13,941 | demisang/yii2-recaptcha | ReCaptcha.php | ReCaptcha.registerClientScript | public function registerClientScript($gCaptchaParams = [])
{
$id = $this->id;
$view = $this->view;
ReCaptchaAsset::register($view);
$options = Json::encode($gCaptchaParams);
// Directly creating captcha widgets.
// This code placed only one time irrespective of coun... | php | public function registerClientScript($gCaptchaParams = [])
{
$id = $this->id;
$view = $this->view;
ReCaptchaAsset::register($view);
$options = Json::encode($gCaptchaParams);
// Directly creating captcha widgets.
// This code placed only one time irrespective of coun... | [
"public",
"function",
"registerClientScript",
"(",
"$",
"gCaptchaParams",
"=",
"[",
"]",
")",
"{",
"$",
"id",
"=",
"$",
"this",
"->",
"id",
";",
"$",
"view",
"=",
"$",
"this",
"->",
"view",
";",
"ReCaptchaAsset",
"::",
"register",
"(",
"$",
"view",
"... | Register google reCAPTCHA js api and custom render scripts
@param array $gCaptchaParams | [
"Register",
"google",
"reCAPTCHA",
"js",
"api",
"and",
"custom",
"render",
"scripts"
] | ecedd26b7e252c6d307365fbd9ab012a9ee33294 | https://github.com/demisang/yii2-recaptcha/blob/ecedd26b7e252c6d307365fbd9ab012a9ee33294/ReCaptcha.php#L94-L123 |
13,942 | venta/framework | src/Container/src/AbstractContainer.php | AbstractContainer.instantiateService | protected function instantiateService(string $id, array $arguments)
{
if (isset($this->instances[$id])) {
return $this->instances[$id];
}
if (isset($this->factories[$id])) {
return ($this->factories[$id])($arguments);
}
if (isset($this->callableDefin... | php | protected function instantiateService(string $id, array $arguments)
{
if (isset($this->instances[$id])) {
return $this->instances[$id];
}
if (isset($this->factories[$id])) {
return ($this->factories[$id])($arguments);
}
if (isset($this->callableDefin... | [
"protected",
"function",
"instantiateService",
"(",
"string",
"$",
"id",
",",
"array",
"$",
"arguments",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"instances",
"[",
"$",
"id",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"instances",
... | Create callable factory for the subject service.
@param string $id
@param array $arguments
@return mixed
@throws NotFoundException | [
"Create",
"callable",
"factory",
"for",
"the",
"subject",
"service",
"."
] | 514a7854cc69f84f47e62a58cc55efd68b7c9f83 | https://github.com/venta/framework/blob/514a7854cc69f84f47e62a58cc55efd68b7c9f83/src/Container/src/AbstractContainer.php#L123-L150 |
13,943 | venta/framework | src/Container/src/AbstractContainer.php | AbstractContainer.isResolvableService | protected function isResolvableService(string $id): bool
{
return isset($this->keys[$id]) || class_exists($id);
} | php | protected function isResolvableService(string $id): bool
{
return isset($this->keys[$id]) || class_exists($id);
} | [
"protected",
"function",
"isResolvableService",
"(",
"string",
"$",
"id",
")",
":",
"bool",
"{",
"return",
"isset",
"(",
"$",
"this",
"->",
"keys",
"[",
"$",
"id",
"]",
")",
"||",
"class_exists",
"(",
"$",
"id",
")",
";",
"}"
] | Check if container can resolve the service with subject identifier.
@param string $id
@return bool | [
"Check",
"if",
"container",
"can",
"resolve",
"the",
"service",
"with",
"subject",
"identifier",
"."
] | 514a7854cc69f84f47e62a58cc55efd68b7c9f83 | https://github.com/venta/framework/blob/514a7854cc69f84f47e62a58cc55efd68b7c9f83/src/Container/src/AbstractContainer.php#L166-L169 |
13,944 | venta/framework | src/Container/src/AbstractContainer.php | AbstractContainer.resolving | protected function resolving(string $id)
{
if (isset($this->resolving[$id])) {
throw new CircularReferenceException($id, $this->resolving);
}
// We mark service as being resolved to detect circular references through out the resolution chain.
$this->resolving[$id] = $id;... | php | protected function resolving(string $id)
{
if (isset($this->resolving[$id])) {
throw new CircularReferenceException($id, $this->resolving);
}
// We mark service as being resolved to detect circular references through out the resolution chain.
$this->resolving[$id] = $id;... | [
"protected",
"function",
"resolving",
"(",
"string",
"$",
"id",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"resolving",
"[",
"$",
"id",
"]",
")",
")",
"{",
"throw",
"new",
"CircularReferenceException",
"(",
"$",
"id",
",",
"$",
"this",
"->... | Detects circular references.
@param string $id
@return void
@throws CircularReferenceException | [
"Detects",
"circular",
"references",
"."
] | 514a7854cc69f84f47e62a58cc55efd68b7c9f83 | https://github.com/venta/framework/blob/514a7854cc69f84f47e62a58cc55efd68b7c9f83/src/Container/src/AbstractContainer.php#L207-L215 |
13,945 | venta/framework | src/Container/src/AbstractContainer.php | AbstractContainer.createServiceFactoryFromCallable | private function createServiceFactoryFromCallable(Invokable $invokable): Closure
{
return function (array $arguments = []) use ($invokable) {
return $this->invoker->invoke($invokable, $arguments);
};
} | php | private function createServiceFactoryFromCallable(Invokable $invokable): Closure
{
return function (array $arguments = []) use ($invokable) {
return $this->invoker->invoke($invokable, $arguments);
};
} | [
"private",
"function",
"createServiceFactoryFromCallable",
"(",
"Invokable",
"$",
"invokable",
")",
":",
"Closure",
"{",
"return",
"function",
"(",
"array",
"$",
"arguments",
"=",
"[",
"]",
")",
"use",
"(",
"$",
"invokable",
")",
"{",
"return",
"$",
"this",
... | Create callable factory with resolved arguments from callable.
@param Invokable $invokable
@return Closure | [
"Create",
"callable",
"factory",
"with",
"resolved",
"arguments",
"from",
"callable",
"."
] | 514a7854cc69f84f47e62a58cc55efd68b7c9f83 | https://github.com/venta/framework/blob/514a7854cc69f84f47e62a58cc55efd68b7c9f83/src/Container/src/AbstractContainer.php#L241-L246 |
13,946 | venta/framework | src/Container/src/AbstractContainer.php | AbstractContainer.createServiceFactoryFromClass | private function createServiceFactoryFromClass(string $class): Closure
{
$reflection = new ReflectionClass($class);
if (!$reflection->isInstantiable()) {
throw new UninstantiableServiceException($class, $this->resolving);
}
$constructor = $reflection->getConstructor();
... | php | private function createServiceFactoryFromClass(string $class): Closure
{
$reflection = new ReflectionClass($class);
if (!$reflection->isInstantiable()) {
throw new UninstantiableServiceException($class, $this->resolving);
}
$constructor = $reflection->getConstructor();
... | [
"private",
"function",
"createServiceFactoryFromClass",
"(",
"string",
"$",
"class",
")",
":",
"Closure",
"{",
"$",
"reflection",
"=",
"new",
"ReflectionClass",
"(",
"$",
"class",
")",
";",
"if",
"(",
"!",
"$",
"reflection",
"->",
"isInstantiable",
"(",
")",... | Create callable factory with resolved arguments from class name.
@param string $class
@return Closure
@throws UninstantiableServiceException | [
"Create",
"callable",
"factory",
"with",
"resolved",
"arguments",
"from",
"class",
"name",
"."
] | 514a7854cc69f84f47e62a58cc55efd68b7c9f83 | https://github.com/venta/framework/blob/514a7854cc69f84f47e62a58cc55efd68b7c9f83/src/Container/src/AbstractContainer.php#L255-L278 |
13,947 | thienhungho/yii2-customer-management | src/modules/CustomerManage/controllers/CustomerController.php | CustomerController.actionIndex | public function actionIndex()
{
$searchModel = new CustomerSearch();
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
return $this->render('index', [
'searchModel' => $searchModel,
'dataProvider' => $dataProvider,
]);
} | php | public function actionIndex()
{
$searchModel = new CustomerSearch();
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
return $this->render('index', [
'searchModel' => $searchModel,
'dataProvider' => $dataProvider,
]);
} | [
"public",
"function",
"actionIndex",
"(",
")",
"{",
"$",
"searchModel",
"=",
"new",
"CustomerSearch",
"(",
")",
";",
"$",
"dataProvider",
"=",
"$",
"searchModel",
"->",
"search",
"(",
"Yii",
"::",
"$",
"app",
"->",
"request",
"->",
"queryParams",
")",
";... | Lists all Customer models.
@return mixed | [
"Lists",
"all",
"Customer",
"models",
"."
] | 9283027541b34a86be85df592248909014968688 | https://github.com/thienhungho/yii2-customer-management/blob/9283027541b34a86be85df592248909014968688/src/modules/CustomerManage/controllers/CustomerController.php#L34-L43 |
13,948 | cauditor/php-analyzer | src/Config.php | Config.normalizePath | protected function normalizePath($value)
{
// array of paths = recursive
if (is_array($value)) {
foreach ($value as $i => $val) {
$value[$i] = $this->normalizePath($val);
}
return $value;
}
$converter = new PathConverter(dirname($... | php | protected function normalizePath($value)
{
// array of paths = recursive
if (is_array($value)) {
foreach ($value as $i => $val) {
$value[$i] = $this->normalizePath($val);
}
return $value;
}
$converter = new PathConverter(dirname($... | [
"protected",
"function",
"normalizePath",
"(",
"$",
"value",
")",
"{",
"// array of paths = recursive",
"if",
"(",
"is_array",
"(",
"$",
"value",
")",
")",
"{",
"foreach",
"(",
"$",
"value",
"as",
"$",
"i",
"=>",
"$",
"val",
")",
"{",
"$",
"value",
"["... | Normalize all relative paths by prefixing them with the project path.
@param string|string[] $value
@return string|string[] | [
"Normalize",
"all",
"relative",
"paths",
"by",
"prefixing",
"them",
"with",
"the",
"project",
"path",
"."
] | 0d86686d64d01e6aaed433898841894fa3ce1101 | https://github.com/cauditor/php-analyzer/blob/0d86686d64d01e6aaed433898841894fa3ce1101/src/Config.php#L127-L141 |
13,949 | Im0rtality/Underscore | src/Mutator.php | Mutator.copyCollectionWith | protected function copyCollectionWith(Collection $collection, array $values)
{
$collection = clone $collection;
$collection->exchangeArray($values);
return $collection;
} | php | protected function copyCollectionWith(Collection $collection, array $values)
{
$collection = clone $collection;
$collection->exchangeArray($values);
return $collection;
} | [
"protected",
"function",
"copyCollectionWith",
"(",
"Collection",
"$",
"collection",
",",
"array",
"$",
"values",
")",
"{",
"$",
"collection",
"=",
"clone",
"$",
"collection",
";",
"$",
"collection",
"->",
"exchangeArray",
"(",
"$",
"values",
")",
";",
"retu... | Get a copy of a collection with new values.
@param Collection $collection
@param array $values
@return Collection | [
"Get",
"a",
"copy",
"of",
"a",
"collection",
"with",
"new",
"values",
"."
] | 2deb95cfd340761d00ecd0f033e67ce600f2b535 | https://github.com/Im0rtality/Underscore/blob/2deb95cfd340761d00ecd0f033e67ce600f2b535/src/Mutator.php#L14-L21 |
13,950 | bantenprov/tanara | app/Http/Controllers/Settings/ProfileController.php | ProfileController.update | public function update(Request $request)
{
$user = $request->user();
$this->validate($request, [
'name' => 'required',
'email' => 'required|email|unique:users,email,'.$user->id,
]);
return tap($user)->update($request->only('name', 'email'));
} | php | public function update(Request $request)
{
$user = $request->user();
$this->validate($request, [
'name' => 'required',
'email' => 'required|email|unique:users,email,'.$user->id,
]);
return tap($user)->update($request->only('name', 'email'));
} | [
"public",
"function",
"update",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"user",
"=",
"$",
"request",
"->",
"user",
"(",
")",
";",
"$",
"this",
"->",
"validate",
"(",
"$",
"request",
",",
"[",
"'name'",
"=>",
"'required'",
",",
"'email'",
"=>",... | Update the user's profile information.
@param \Illuminate\Http\Request $request
@return \Illuminate\Http\Response | [
"Update",
"the",
"user",
"s",
"profile",
"information",
"."
] | e70b027cbbc59bb57a31fa3c7347e7eae87671c3 | https://github.com/bantenprov/tanara/blob/e70b027cbbc59bb57a31fa3c7347e7eae87671c3/app/Http/Controllers/Settings/ProfileController.php#L16-L26 |
13,951 | DevGroup-ru/yii2-data-structure-tools | src/helpers/PropertyStorageHelper.php | PropertyStorageHelper.storageById | public static function storageById($id)
{
$handlers = self::storageHandlers();
if (isset($handlers[$id])) {
return $handlers[$id];
} else {
throw new ServerErrorHttpException("Storage handler with id $id not found.");
}
} | php | public static function storageById($id)
{
$handlers = self::storageHandlers();
if (isset($handlers[$id])) {
return $handlers[$id];
} else {
throw new ServerErrorHttpException("Storage handler with id $id not found.");
}
} | [
"public",
"static",
"function",
"storageById",
"(",
"$",
"id",
")",
"{",
"$",
"handlers",
"=",
"self",
"::",
"storageHandlers",
"(",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"handlers",
"[",
"$",
"id",
"]",
")",
")",
"{",
"return",
"$",
"handlers",
... | Returns AbstractPropertyStorage instance by PropertyStorage.id
@param integer $id
@return \DevGroup\DataStructure\propertyStorage\AbstractPropertyStorage
@throws ServerErrorHttpException | [
"Returns",
"AbstractPropertyStorage",
"instance",
"by",
"PropertyStorage",
".",
"id"
] | a5b24d7c0b24d4b0d58cacd91ec7fd876e979097 | https://github.com/DevGroup-ru/yii2-data-structure-tools/blob/a5b24d7c0b24d4b0d58cacd91ec7fd876e979097/src/helpers/PropertyStorageHelper.php#L110-L118 |
13,952 | DevGroup-ru/yii2-data-structure-tools | src/helpers/PropertyStorageHelper.php | PropertyStorageHelper.storageIdByClass | public static function storageIdByClass($className)
{
foreach (self::storageHandlers() as $id => $handler) {
if ($handler instanceof $className) {
return $id;
}
}
return null;
} | php | public static function storageIdByClass($className)
{
foreach (self::storageHandlers() as $id => $handler) {
if ($handler instanceof $className) {
return $id;
}
}
return null;
} | [
"public",
"static",
"function",
"storageIdByClass",
"(",
"$",
"className",
")",
"{",
"foreach",
"(",
"self",
"::",
"storageHandlers",
"(",
")",
"as",
"$",
"id",
"=>",
"$",
"handler",
")",
"{",
"if",
"(",
"$",
"handler",
"instanceof",
"$",
"className",
")... | Return a property storage id by storage class name.
@param string $className
@return int|null|string | [
"Return",
"a",
"property",
"storage",
"id",
"by",
"storage",
"class",
"name",
"."
] | a5b24d7c0b24d4b0d58cacd91ec7fd876e979097 | https://github.com/DevGroup-ru/yii2-data-structure-tools/blob/a5b24d7c0b24d4b0d58cacd91ec7fd876e979097/src/helpers/PropertyStorageHelper.php#L125-L133 |
13,953 | dphn/ScContent | src/ScContent/Controller/Back/GarbageController.php | GarbageController.collectAction | public function collectAction()
{
// @todo json
$service = $this->getGarbageCollector();
if ($service->collect()) {
return $this->redirect()->toRoute('sc-admin/content-manager');
}
return $this->redirect()
->toRoute(
'sc-admin/file/dele... | php | public function collectAction()
{
// @todo json
$service = $this->getGarbageCollector();
if ($service->collect()) {
return $this->redirect()->toRoute('sc-admin/content-manager');
}
return $this->redirect()
->toRoute(
'sc-admin/file/dele... | [
"public",
"function",
"collectAction",
"(",
")",
"{",
"// @todo json",
"$",
"service",
"=",
"$",
"this",
"->",
"getGarbageCollector",
"(",
")",
";",
"if",
"(",
"$",
"service",
"->",
"collect",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"redirect",
... | Collects garbage - removes files from the file system.
@return \Zend\Stdlib\ResponseInterface | [
"Collects",
"garbage",
"-",
"removes",
"files",
"from",
"the",
"file",
"system",
"."
] | 9dd5732490c45fd788b96cedf7b3c7adfacb30d2 | https://github.com/dphn/ScContent/blob/9dd5732490c45fd788b96cedf7b3c7adfacb30d2/src/ScContent/Controller/Back/GarbageController.php#L32-L45 |
13,954 | ipunkt/social-auth | src/controllers/SocialRegisterController.php | SocialRegisterController.auth | public function auth($provider_name, &$profile = null) {
$identifier = null;
try {
$provider = $this->hybrid_auth->authenticate($provider_name);
$userProfile = $provider->getUserProfile();
$identifier = $userProfile->identifier;
$profile = $userProfile;
... | php | public function auth($provider_name, &$profile = null) {
$identifier = null;
try {
$provider = $this->hybrid_auth->authenticate($provider_name);
$userProfile = $provider->getUserProfile();
$identifier = $userProfile->identifier;
$profile = $userProfile;
... | [
"public",
"function",
"auth",
"(",
"$",
"provider_name",
",",
"&",
"$",
"profile",
"=",
"null",
")",
"{",
"$",
"identifier",
"=",
"null",
";",
"try",
"{",
"$",
"provider",
"=",
"$",
"this",
"->",
"hybrid_auth",
"->",
"authenticate",
"(",
"$",
"provider... | Prompt the User to authenticate with a social-auth provider
@param $provider_name
@param null $profile
@return null | [
"Prompt",
"the",
"User",
"to",
"authenticate",
"with",
"a",
"social",
"-",
"auth",
"provider"
] | 28723a8e449612789a2cd7d21137996c48b62229 | https://github.com/ipunkt/social-auth/blob/28723a8e449612789a2cd7d21137996c48b62229/src/controllers/SocialRegisterController.php#L56-L68 |
13,955 | ipunkt/social-auth | src/controllers/SocialRegisterController.php | SocialRegisterController.attach | public function attach($provider_name) {
$response = null;
$profile = null;
$identifier = $this->auth($provider_name, $profile);
if(!$this->checkRegistered($provider_name, $identifier)) {
$id = Auth::user()->getAuthIdentifier();
$login = $this->login_repositor... | php | public function attach($provider_name) {
$response = null;
$profile = null;
$identifier = $this->auth($provider_name, $profile);
if(!$this->checkRegistered($provider_name, $identifier)) {
$id = Auth::user()->getAuthIdentifier();
$login = $this->login_repositor... | [
"public",
"function",
"attach",
"(",
"$",
"provider_name",
")",
"{",
"$",
"response",
"=",
"null",
";",
"$",
"profile",
"=",
"null",
";",
"$",
"identifier",
"=",
"$",
"this",
"->",
"auth",
"(",
"$",
"provider_name",
",",
"$",
"profile",
")",
";",
"if... | Attempt to login to a social-auth provider
If successful, attach the social-auth user to the currently logged in user on this system
@param $provider_name
@return \Illuminate\Http\RedirectResponse|null | [
"Attempt",
"to",
"login",
"to",
"a",
"social",
"-",
"auth",
"provider",
"If",
"successful",
"attach",
"the",
"social",
"-",
"auth",
"user",
"to",
"the",
"currently",
"logged",
"in",
"user",
"on",
"this",
"system"
] | 28723a8e449612789a2cd7d21137996c48b62229 | https://github.com/ipunkt/social-auth/blob/28723a8e449612789a2cd7d21137996c48b62229/src/controllers/SocialRegisterController.php#L90-L120 |
13,956 | ipunkt/social-auth | src/controllers/SocialRegisterController.php | SocialRegisterController.register | public function register($provider_name) {
$response = null;
$profile = null;
$route = Config::get('social-auth::register_route');
$identifier = $this->auth($provider_name, $profile);
if(!$this->checkRegistered($provider_name, $identifier)) {
$register_info = App::ma... | php | public function register($provider_name) {
$response = null;
$profile = null;
$route = Config::get('social-auth::register_route');
$identifier = $this->auth($provider_name, $profile);
if(!$this->checkRegistered($provider_name, $identifier)) {
$register_info = App::ma... | [
"public",
"function",
"register",
"(",
"$",
"provider_name",
")",
"{",
"$",
"response",
"=",
"null",
";",
"$",
"profile",
"=",
"null",
";",
"$",
"route",
"=",
"Config",
"::",
"get",
"(",
"'social-auth::register_route'",
")",
";",
"$",
"identifier",
"=",
... | Login into a social-auth account intending to register a new user with it
It is considered successful if the user logs into the social-auth account and the account is not yet attached to
a different Account on this system.
If Successful it will redirect back to the register page as set in the config and flash a new
re... | [
"Login",
"into",
"a",
"social",
"-",
"auth",
"account",
"intending",
"to",
"register",
"a",
"new",
"user",
"with",
"it",
"It",
"is",
"considered",
"successful",
"if",
"the",
"user",
"logs",
"into",
"the",
"social",
"-",
"auth",
"account",
"and",
"the",
"... | 28723a8e449612789a2cd7d21137996c48b62229 | https://github.com/ipunkt/social-auth/blob/28723a8e449612789a2cd7d21137996c48b62229/src/controllers/SocialRegisterController.php#L136-L158 |
13,957 | guillaumemonet/Rad | src/Rad/Http/Uri.php | Uri.isURL | public static function isURL(string $url): bool {
return (boolean) !(filter_var($url, FILTER_SANITIZE_URL | FILTER_VALIDATE_URL) === false);
} | php | public static function isURL(string $url): bool {
return (boolean) !(filter_var($url, FILTER_SANITIZE_URL | FILTER_VALIDATE_URL) === false);
} | [
"public",
"static",
"function",
"isURL",
"(",
"string",
"$",
"url",
")",
":",
"bool",
"{",
"return",
"(",
"boolean",
")",
"!",
"(",
"filter_var",
"(",
"$",
"url",
",",
"FILTER_SANITIZE_URL",
"|",
"FILTER_VALIDATE_URL",
")",
"===",
"false",
")",
";",
"}"
... | Valid if current provided string is an URL
@param string $url
@return bool | [
"Valid",
"if",
"current",
"provided",
"string",
"is",
"an",
"URL"
] | cb9932f570cf3c2a7197f81e1d959c2729989e59 | https://github.com/guillaumemonet/Rad/blob/cb9932f570cf3c2a7197f81e1d959c2729989e59/src/Rad/Http/Uri.php#L51-L53 |
13,958 | andylolz/everypolitician-popolo-php | src/Collections/PopoloCollection.php | PopoloCollection.filter | public function filter($filters)
{
$filtered = [];
foreach ($this->objectArr as $obj) {
$success = true;
foreach ($filters as $prop => $value) {
if ($obj->$prop !== $value) {
$success = false;
break;
}
... | php | public function filter($filters)
{
$filtered = [];
foreach ($this->objectArr as $obj) {
$success = true;
foreach ($filters as $prop => $value) {
if ($obj->$prop !== $value) {
$success = false;
break;
}
... | [
"public",
"function",
"filter",
"(",
"$",
"filters",
")",
"{",
"$",
"filtered",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"objectArr",
"as",
"$",
"obj",
")",
"{",
"$",
"success",
"=",
"true",
";",
"foreach",
"(",
"$",
"filters",
"as",
... | Gets an array of matching items, according to the
array of filters provided. Filters are key-value pairs
that are ANDed together, i.e. returned items match all
the criteria
@param string[] $filters key-value set of criteria
@return object[] | [
"Gets",
"an",
"array",
"of",
"matching",
"items",
"according",
"to",
"the",
"array",
"of",
"filters",
"provided",
".",
"Filters",
"are",
"key",
"-",
"value",
"pairs",
"that",
"are",
"ANDed",
"together",
"i",
".",
"e",
".",
"returned",
"items",
"match",
"... | 701fca91b782871d463cfb56f3c1c7afb121eb9f | https://github.com/andylolz/everypolitician-popolo-php/blob/701fca91b782871d463cfb56f3c1c7afb121eb9f/src/Collections/PopoloCollection.php#L83-L99 |
13,959 | andylolz/everypolitician-popolo-php | src/Collections/PopoloCollection.php | PopoloCollection.get | public function get($filters)
{
$matches = $this->filter($filters);
$n = count($matches);
if ($n == 0) {
$msg = "No ".$this->objectClass." found matching ".json_encode($filters);
throw new Exceptions\ObjectDoesNotExistException($msg);
} elseif ($n > 1) {
... | php | public function get($filters)
{
$matches = $this->filter($filters);
$n = count($matches);
if ($n == 0) {
$msg = "No ".$this->objectClass." found matching ".json_encode($filters);
throw new Exceptions\ObjectDoesNotExistException($msg);
} elseif ($n > 1) {
... | [
"public",
"function",
"get",
"(",
"$",
"filters",
")",
"{",
"$",
"matches",
"=",
"$",
"this",
"->",
"filter",
"(",
"$",
"filters",
")",
";",
"$",
"n",
"=",
"count",
"(",
"$",
"matches",
")",
";",
"if",
"(",
"$",
"n",
"==",
"0",
")",
"{",
"$",... | Gets a single matching item, according to the
array of filters provided. Filters are key-value pairs
that are ANDed together, i.e. returned items match all
the criteria. If more or less than one item matches,
an exception is thrown
@param string[] $filters key-value set of criteria
@return object | [
"Gets",
"a",
"single",
"matching",
"item",
"according",
"to",
"the",
"array",
"of",
"filters",
"provided",
".",
"Filters",
"are",
"key",
"-",
"value",
"pairs",
"that",
"are",
"ANDed",
"together",
"i",
".",
"e",
".",
"returned",
"items",
"match",
"all",
"... | 701fca91b782871d463cfb56f3c1c7afb121eb9f | https://github.com/andylolz/everypolitician-popolo-php/blob/701fca91b782871d463cfb56f3c1c7afb121eb9f/src/Collections/PopoloCollection.php#L112-L124 |
13,960 | attm2x/m2x-php | src/StreamCollection.php | StreamCollection.setResource | protected function setResource($i, $data) {
$this->resources[$i] = new static::$resourceClass($this->client, $this->parent, $data);
} | php | protected function setResource($i, $data) {
$this->resources[$i] = new static::$resourceClass($this->client, $this->parent, $data);
} | [
"protected",
"function",
"setResource",
"(",
"$",
"i",
",",
"$",
"data",
")",
"{",
"$",
"this",
"->",
"resources",
"[",
"$",
"i",
"]",
"=",
"new",
"static",
"::",
"$",
"resourceClass",
"(",
"$",
"this",
"->",
"client",
",",
"$",
"this",
"->",
"pare... | Initialize and add a resource to the collection
@param integer $i
@param array $data | [
"Initialize",
"and",
"add",
"a",
"resource",
"to",
"the",
"collection"
] | 4c2ff6d70af50538818855e648af24bf5cf16ead | https://github.com/attm2x/m2x-php/blob/4c2ff6d70af50538818855e648af24bf5cf16ead/src/StreamCollection.php#L68-L70 |
13,961 | cpliakas/search-framework | src/Search/Framework/SearchEngineAbstract.php | SearchEngineAbstract.getNormalizer | public function getNormalizer($data_type)
{
if (!isset($this->_normalizers[$data_type])) {
$message = 'Normalizer not attached for data type: ' . $data_type;
throw new \InvalidArgumentException($message);
}
return $this->_normalizers[$data_type];
} | php | public function getNormalizer($data_type)
{
if (!isset($this->_normalizers[$data_type])) {
$message = 'Normalizer not attached for data type: ' . $data_type;
throw new \InvalidArgumentException($message);
}
return $this->_normalizers[$data_type];
} | [
"public",
"function",
"getNormalizer",
"(",
"$",
"data_type",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"_normalizers",
"[",
"$",
"data_type",
"]",
")",
")",
"{",
"$",
"message",
"=",
"'Normalizer not attached for data type: '",
".",
"$",
... | Returns a mormalizer that is applied to fields of the given data type.
@param string $data_type
The data type the normalizer is applied to.
@return NormalizerInterface | [
"Returns",
"a",
"mormalizer",
"that",
"is",
"applied",
"to",
"fields",
"of",
"the",
"given",
"data",
"type",
"."
] | 7c5832d38ed998e04837c26e0daef59115563b98 | https://github.com/cpliakas/search-framework/blob/7c5832d38ed998e04837c26e0daef59115563b98/src/Search/Framework/SearchEngineAbstract.php#L149-L156 |
13,962 | gorkalaucirica/HipchatAPIv2Client | Client.php | Client.get | public function get($resource, $query = array())
{
$url = $this->baseUrl . $resource;
if (count($query) > 0) {
$url .= "?";
}
foreach ($query as $key => $value) {
$url .= "$key=$value&";
}
$headers = array("Authorization" => $this->auth->getC... | php | public function get($resource, $query = array())
{
$url = $this->baseUrl . $resource;
if (count($query) > 0) {
$url .= "?";
}
foreach ($query as $key => $value) {
$url .= "$key=$value&";
}
$headers = array("Authorization" => $this->auth->getC... | [
"public",
"function",
"get",
"(",
"$",
"resource",
",",
"$",
"query",
"=",
"array",
"(",
")",
")",
"{",
"$",
"url",
"=",
"$",
"this",
"->",
"baseUrl",
".",
"$",
"resource",
";",
"if",
"(",
"count",
"(",
"$",
"query",
")",
">",
"0",
")",
"{",
... | Common get request for all API calls
@param string $resource The path to the resource wanted. For example v2/room
@param array $query Parameters to filter the response for example array('max-results' => 50)
@return array Decoded array containing response
@throws Exception\RequestException | [
"Common",
"get",
"request",
"for",
"all",
"API",
"calls"
] | eef9c91d5efe5ae9cad27c503601ffff089c9547 | https://github.com/gorkalaucirica/HipchatAPIv2Client/blob/eef9c91d5efe5ae9cad27c503601ffff089c9547/Client.php#L64-L88 |
13,963 | gorkalaucirica/HipchatAPIv2Client | Client.php | Client.post | public function post($resource, $content)
{
$url = $this->baseUrl . $resource;
$headers = array(
'Content-Type' => 'application/json',
'Authorization' => $this->auth->getCredential()
);
try {
$response = $this->browser->post($url, $headers, json_... | php | public function post($resource, $content)
{
$url = $this->baseUrl . $resource;
$headers = array(
'Content-Type' => 'application/json',
'Authorization' => $this->auth->getCredential()
);
try {
$response = $this->browser->post($url, $headers, json_... | [
"public",
"function",
"post",
"(",
"$",
"resource",
",",
"$",
"content",
")",
"{",
"$",
"url",
"=",
"$",
"this",
"->",
"baseUrl",
".",
"$",
"resource",
";",
"$",
"headers",
"=",
"array",
"(",
"'Content-Type'",
"=>",
"'application/json'",
",",
"'Authoriza... | Common post request for all API calls
@param string $resource The path to the resource wanted. For example v2/room
@param array $content Parameters be posted for example:
array(
'name' => 'Example name',
'privacy' => 'private',
'is_archived' => 'false',
'is_guest_accessible' => 'fals... | [
"Common",
"post",
"request",
"for",
"all",
"API",
"calls"
] | eef9c91d5efe5ae9cad27c503601ffff089c9547 | https://github.com/gorkalaucirica/HipchatAPIv2Client/blob/eef9c91d5efe5ae9cad27c503601ffff089c9547/Client.php#L106-L126 |
13,964 | chippyash/Strong-Type | src/Chippyash/Type/String/DigitType.php | DigitType.filter | protected function filter($value)
{
if (!is_scalar($value)) {
return $value;
}
$value = (string) $value;
if (!$this->hasPcreUnicodeSupport()) {
// POSIX named classes are not supported, use alternative 0-9 match
return preg_replace('/[^0-9]/', '',... | php | protected function filter($value)
{
if (!is_scalar($value)) {
return $value;
}
$value = (string) $value;
if (!$this->hasPcreUnicodeSupport()) {
// POSIX named classes are not supported, use alternative 0-9 match
return preg_replace('/[^0-9]/', '',... | [
"protected",
"function",
"filter",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"!",
"is_scalar",
"(",
"$",
"value",
")",
")",
"{",
"return",
"$",
"value",
";",
"}",
"$",
"value",
"=",
"(",
"string",
")",
"$",
"value",
";",
"if",
"(",
"!",
"$",
"thi... | Lifted entirely from the Zend framework so that we don't have to include
the Zend\Filter package and all its dependencies.
@param string $value
@return string|mixed
zendframework/zend-filter/Zend/Filter/Digits.php
Zend Framework (http://framework.zend.com/)
@link http://github.com/zendframework/zf2 for the can... | [
"Lifted",
"entirely",
"from",
"the",
"Zend",
"framework",
"so",
"that",
"we",
"don",
"t",
"have",
"to",
"include",
"the",
"Zend",
"\\",
"Filter",
"package",
"and",
"all",
"its",
"dependencies",
"."
] | 9d364c10c68c10f768254fb25b0b1db3dbef6fa9 | https://github.com/chippyash/Strong-Type/blob/9d364c10c68c10f768254fb25b0b1db3dbef6fa9/src/Chippyash/Type/String/DigitType.php#L62-L81 |
13,965 | f3ath/appnexusclient | src/AppNexusClient.php | AppNexusClient.getNewToken | public function getNewToken()
{
$post = array(
'auth' => array(
'username' => $this->username,
'password' => $this->password,
),
);
return $this->http->call(HttpMethod::POST, $this->host.'/auth', $post)->token;
} | php | public function getNewToken()
{
$post = array(
'auth' => array(
'username' => $this->username,
'password' => $this->password,
),
);
return $this->http->call(HttpMethod::POST, $this->host.'/auth', $post)->token;
} | [
"public",
"function",
"getNewToken",
"(",
")",
"{",
"$",
"post",
"=",
"array",
"(",
"'auth'",
"=>",
"array",
"(",
"'username'",
"=>",
"$",
"this",
"->",
"username",
",",
"'password'",
"=>",
"$",
"this",
"->",
"password",
",",
")",
",",
")",
";",
"ret... | Get a new auth token from server
@return string | [
"Get",
"a",
"new",
"auth",
"token",
"from",
"server"
] | cfe3f3a98a9c2883484154c8997c7459b1504742 | https://github.com/f3ath/appnexusclient/blob/cfe3f3a98a9c2883484154c8997c7459b1504742/src/AppNexusClient.php#L35-L44 |
13,966 | ahmad-sa3d/saad-image | src/Image.php | Image.setSaveOptions | public function setSaveOptions($file_name = null, $directory = null, $suffix = null) {
# Set Directory, or use Old if setted before from instance, or use img src directory
if ($directory) {
$this->_save_dir = rtrim($directory, DIRECTORY_SEPARATOR);
} else if (!$this->_save_dir) {
$this->_save_dir = $this->_... | php | public function setSaveOptions($file_name = null, $directory = null, $suffix = null) {
# Set Directory, or use Old if setted before from instance, or use img src directory
if ($directory) {
$this->_save_dir = rtrim($directory, DIRECTORY_SEPARATOR);
} else if (!$this->_save_dir) {
$this->_save_dir = $this->_... | [
"public",
"function",
"setSaveOptions",
"(",
"$",
"file_name",
"=",
"null",
",",
"$",
"directory",
"=",
"null",
",",
"$",
"suffix",
"=",
"null",
")",
"{",
"# Set Directory, or use Old if setted before from instance, or use img src directory",
"if",
"(",
"$",
"director... | Set Saving Options
@param String $file_name saving file name
@param String $directory directory to save into | [
"Set",
"Saving",
"Options"
] | 2485e585e0c2ae2b8f0afeb3d513f2df3e369939 | https://github.com/ahmad-sa3d/saad-image/blob/2485e585e0c2ae2b8f0afeb3d513f2df3e369939/src/Image.php#L288-L315 |
13,967 | ahmad-sa3d/saad-image | src/Image.php | Image.setOutputFormat | public function setOutputFormat($format = null, $quality = null, $filters = null) {
if ($format) {
$format = strtolower($format);
if (in_array($format, static::$_allowed_formates)) {
$this->_output_format = $format;
# fix file extension if this method was called after calling setSaveOptions Method
... | php | public function setOutputFormat($format = null, $quality = null, $filters = null) {
if ($format) {
$format = strtolower($format);
if (in_array($format, static::$_allowed_formates)) {
$this->_output_format = $format;
# fix file extension if this method was called after calling setSaveOptions Method
... | [
"public",
"function",
"setOutputFormat",
"(",
"$",
"format",
"=",
"null",
",",
"$",
"quality",
"=",
"null",
",",
"$",
"filters",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"format",
")",
"{",
"$",
"format",
"=",
"strtolower",
"(",
"$",
"format",
")",
"... | Setting Output Format
@param String $format png, jpeg, jpg OR gif | [
"Setting",
"Output",
"Format"
] | 2485e585e0c2ae2b8f0afeb3d513f2df3e369939 | https://github.com/ahmad-sa3d/saad-image/blob/2485e585e0c2ae2b8f0afeb3d513f2df3e369939/src/Image.php#L322-L377 |
13,968 | ahmad-sa3d/saad-image | src/Image.php | Image.exportImage | public function exportImage($keep_resource = false) {
# export current resource image
array_unshift($this->_output_options, $this->_image_resource, $this->_save_path);
switch($this->_output_format) {
case 'jpeg' :
case 'jpg' :
if (!$this->_save_path) {
header('content-type: image/jpeg');
}
... | php | public function exportImage($keep_resource = false) {
# export current resource image
array_unshift($this->_output_options, $this->_image_resource, $this->_save_path);
switch($this->_output_format) {
case 'jpeg' :
case 'jpg' :
if (!$this->_save_path) {
header('content-type: image/jpeg');
}
... | [
"public",
"function",
"exportImage",
"(",
"$",
"keep_resource",
"=",
"false",
")",
"{",
"# export current resource image",
"array_unshift",
"(",
"$",
"this",
"->",
"_output_options",
",",
"$",
"this",
"->",
"_image_resource",
",",
"$",
"this",
"->",
"_save_path",
... | Save Or Output Current Image Resource
@return Boolean indicates to success or fail
@param $keep_resource Boolean If To Not Destroy Resource After Exporting, Useful If Weneed to continue on image resource | [
"Save",
"Or",
"Output",
"Current",
"Image",
"Resource"
] | 2485e585e0c2ae2b8f0afeb3d513f2df3e369939 | https://github.com/ahmad-sa3d/saad-image/blob/2485e585e0c2ae2b8f0afeb3d513f2df3e369939/src/Image.php#L392-L440 |
13,969 | ahmad-sa3d/saad-image | src/Image.php | Image.embed | public function embed($keep_resource = false) {
ob_start();
switch ($this->_output_format) {
case 'jpeg' :
case 'jpg' :
imagejpeg($this->_image_resource);
break;
case 'png':
imagepng($this->_image_resource);
break;
case 'gif':
imagegif($this->_image_resource);
break;
}
$st... | php | public function embed($keep_resource = false) {
ob_start();
switch ($this->_output_format) {
case 'jpeg' :
case 'jpg' :
imagejpeg($this->_image_resource);
break;
case 'png':
imagepng($this->_image_resource);
break;
case 'gif':
imagegif($this->_image_resource);
break;
}
$st... | [
"public",
"function",
"embed",
"(",
"$",
"keep_resource",
"=",
"false",
")",
"{",
"ob_start",
"(",
")",
";",
"switch",
"(",
"$",
"this",
"->",
"_output_format",
")",
"{",
"case",
"'jpeg'",
":",
"case",
"'jpg'",
":",
"imagejpeg",
"(",
"$",
"this",
"->",... | Get Image as embeded code
@param bool $keep_resource
@return string | [
"Get",
"Image",
"as",
"embeded",
"code"
] | 2485e585e0c2ae2b8f0afeb3d513f2df3e369939 | https://github.com/ahmad-sa3d/saad-image/blob/2485e585e0c2ae2b8f0afeb3d513f2df3e369939/src/Image.php#L448-L473 |
13,970 | ahmad-sa3d/saad-image | src/Image.php | Image.reset | public function reset() {
if (!$this->_image_resource_backup) {
throw new ImageException('Cannot restore, no backup has been taken for image resource');
}
$cloned = $this->cloneResource($this->_image_resource_backup);
$this->_image_resource = $cloned['resource'];
$this->updateImageInfo($cloned['width'], ... | php | public function reset() {
if (!$this->_image_resource_backup) {
throw new ImageException('Cannot restore, no backup has been taken for image resource');
}
$cloned = $this->cloneResource($this->_image_resource_backup);
$this->_image_resource = $cloned['resource'];
$this->updateImageInfo($cloned['width'], ... | [
"public",
"function",
"reset",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"_image_resource_backup",
")",
"{",
"throw",
"new",
"ImageException",
"(",
"'Cannot restore, no backup has been taken for image resource'",
")",
";",
"}",
"$",
"cloned",
"=",
"$",
"... | Restore Image resource from backup | [
"Restore",
"Image",
"resource",
"from",
"backup"
] | 2485e585e0c2ae2b8f0afeb3d513f2df3e369939 | https://github.com/ahmad-sa3d/saad-image/blob/2485e585e0c2ae2b8f0afeb3d513f2df3e369939/src/Image.php#L524-L534 |
13,971 | ahmad-sa3d/saad-image | src/Image.php | Image.updateImageInfo | private function updateImageInfo($width, $height) {
$this->_image_info[0] = $width;
$this->_image_info[1] = $height;
$this->_image_info[3] = 'width="' . $width . '" height="' . $height . '"';
$this->_image_info['aspect'] = $width / $height;
} | php | private function updateImageInfo($width, $height) {
$this->_image_info[0] = $width;
$this->_image_info[1] = $height;
$this->_image_info[3] = 'width="' . $width . '" height="' . $height . '"';
$this->_image_info['aspect'] = $width / $height;
} | [
"private",
"function",
"updateImageInfo",
"(",
"$",
"width",
",",
"$",
"height",
")",
"{",
"$",
"this",
"->",
"_image_info",
"[",
"0",
"]",
"=",
"$",
"width",
";",
"$",
"this",
"->",
"_image_info",
"[",
"1",
"]",
"=",
"$",
"height",
";",
"$",
"this... | Update Image Resource Info
@param $width
@param $height | [
"Update",
"Image",
"Resource",
"Info"
] | 2485e585e0c2ae2b8f0afeb3d513f2df3e369939 | https://github.com/ahmad-sa3d/saad-image/blob/2485e585e0c2ae2b8f0afeb3d513f2df3e369939/src/Image.php#L558-L563 |
13,972 | ahmad-sa3d/saad-image | src/Image.php | Image.getRGBFromRange | protected function getRGBFromRange($r, $g, $b, $range) {
# get randomized rgb values on a specific range from a agiven value
if (!$range) {
return array($r, $g, $b);
}
$range = round($range / 2);
$color = array();
# red
$min = $r - $range;
$max = $r + $range;
if ($min < 0) {
$min = 0;
}
... | php | protected function getRGBFromRange($r, $g, $b, $range) {
# get randomized rgb values on a specific range from a agiven value
if (!$range) {
return array($r, $g, $b);
}
$range = round($range / 2);
$color = array();
# red
$min = $r - $range;
$max = $r + $range;
if ($min < 0) {
$min = 0;
}
... | [
"protected",
"function",
"getRGBFromRange",
"(",
"$",
"r",
",",
"$",
"g",
",",
"$",
"b",
",",
"$",
"range",
")",
"{",
"#\tget randomized rgb values on a specific range from a agiven value",
"if",
"(",
"!",
"$",
"range",
")",
"{",
"return",
"array",
"(",
"$",
... | Get Random RGB Values on a specific range
@param integer $r Red
@param integer $g Green
@param integer $b Blue
@param integer $range Range to randomize given values
@return array array of randomized rgb | [
"Get",
"Random",
"RGB",
"Values",
"on",
"a",
"specific",
"range"
] | 2485e585e0c2ae2b8f0afeb3d513f2df3e369939 | https://github.com/ahmad-sa3d/saad-image/blob/2485e585e0c2ae2b8f0afeb3d513f2df3e369939/src/Image.php#L574-L627 |
13,973 | ahmad-sa3d/saad-image | src/Image.php | Image.cloneResource | private function cloneResource($resource) {
// Get width from image.
$w = imagesx($resource);
// Get height from image.
$h = imagesy($resource);
// Get the transparent color from a 256 palette image.
$trans = imagecolortransparent($resource);
if (imageistruecolor($resource)) {
// this is a true color ... | php | private function cloneResource($resource) {
// Get width from image.
$w = imagesx($resource);
// Get height from image.
$h = imagesy($resource);
// Get the transparent color from a 256 palette image.
$trans = imagecolortransparent($resource);
if (imageistruecolor($resource)) {
// this is a true color ... | [
"private",
"function",
"cloneResource",
"(",
"$",
"resource",
")",
"{",
"// Get width from image.",
"$",
"w",
"=",
"imagesx",
"(",
"$",
"resource",
")",
";",
"// Get height from image.",
"$",
"h",
"=",
"imagesy",
"(",
"$",
"resource",
")",
";",
"// Get the tra... | Clone Image Resource
@param $resource
@return array | [
"Clone",
"Image",
"Resource"
] | 2485e585e0c2ae2b8f0afeb3d513f2df3e369939 | https://github.com/ahmad-sa3d/saad-image/blob/2485e585e0c2ae2b8f0afeb3d513f2df3e369939/src/Image.php#L781-L815 |
13,974 | wpup/digster | src/class-factory.php | Factory.composer | public function composer( $views, $callback ) {
foreach ( (array) $views as $view ) {
if ( $callback instanceof Closure === false ) {
$callback = function () use ( $callback ) {
return $callback;
};
}
if ( $view === '*' ) {
$this->composers['*'][] = $callback;
continue;
}
$view =... | php | public function composer( $views, $callback ) {
foreach ( (array) $views as $view ) {
if ( $callback instanceof Closure === false ) {
$callback = function () use ( $callback ) {
return $callback;
};
}
if ( $view === '*' ) {
$this->composers['*'][] = $callback;
continue;
}
$view =... | [
"public",
"function",
"composer",
"(",
"$",
"views",
",",
"$",
"callback",
")",
"{",
"foreach",
"(",
"(",
"array",
")",
"$",
"views",
"as",
"$",
"view",
")",
"{",
"if",
"(",
"$",
"callback",
"instanceof",
"Closure",
"===",
"false",
")",
"{",
"$",
"... | Register preprocess with views.
@param array|string $views
@param \Closure $callback
@return $this | [
"Register",
"preprocess",
"with",
"views",
"."
] | 9ef9626ce82673af698bc0976d6c38a532e4a6d9 | https://github.com/wpup/digster/blob/9ef9626ce82673af698bc0976d6c38a532e4a6d9/src/class-factory.php#L81-L104 |
13,975 | wpup/digster | src/class-factory.php | Factory.extension | protected function extension( $view ) {
$extensions = $this->extensions();
// Return if a valid extension exists in the template string.
$ext_reg = '/(' . implode( '|', $extensions ) . ')+$/';
if ( preg_match( $ext_reg, $view ) ) {
return $template;
}
// Add extension to template string if it don't exi... | php | protected function extension( $view ) {
$extensions = $this->extensions();
// Return if a valid extension exists in the template string.
$ext_reg = '/(' . implode( '|', $extensions ) . ')+$/';
if ( preg_match( $ext_reg, $view ) ) {
return $template;
}
// Add extension to template string if it don't exi... | [
"protected",
"function",
"extension",
"(",
"$",
"view",
")",
"{",
"$",
"extensions",
"=",
"$",
"this",
"->",
"extensions",
"(",
")",
";",
"// Return if a valid extension exists in the template string.",
"$",
"ext_reg",
"=",
"'/('",
".",
"implode",
"(",
"'|'",
",... | Add extension to the view string if it don't exists.
@param string $view
@return string | [
"Add",
"extension",
"to",
"the",
"view",
"string",
"if",
"it",
"don",
"t",
"exists",
"."
] | 9ef9626ce82673af698bc0976d6c38a532e4a6d9 | https://github.com/wpup/digster/blob/9ef9626ce82673af698bc0976d6c38a532e4a6d9/src/class-factory.php#L133-L145 |
13,976 | wpup/digster | src/class-factory.php | Factory.create_data | public function create_data( $data = [] ) {
if ( is_object( $data ) && method_exists( $data, 'to_array' ) ) {
return $data->to_array();
}
return is_array( $data ) ? $data : [];
} | php | public function create_data( $data = [] ) {
if ( is_object( $data ) && method_exists( $data, 'to_array' ) ) {
return $data->to_array();
}
return is_array( $data ) ? $data : [];
} | [
"public",
"function",
"create_data",
"(",
"$",
"data",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"is_object",
"(",
"$",
"data",
")",
"&&",
"method_exists",
"(",
"$",
"data",
",",
"'to_array'",
")",
")",
"{",
"return",
"$",
"data",
"->",
"to_array",
"(",
... | Create view data.
@param mixed $data
@return array | [
"Create",
"view",
"data",
"."
] | 9ef9626ce82673af698bc0976d6c38a532e4a6d9 | https://github.com/wpup/digster/blob/9ef9626ce82673af698bc0976d6c38a532e4a6d9/src/class-factory.php#L163-L169 |
13,977 | wpup/digster | src/class-factory.php | Factory.get_composer | public function get_composer( View $view ) {
$view_name = $view->get_name();
if ( isset( $this->composers[$view_name] ) ) {
return $this->composers[$view_name];
}
return [];
} | php | public function get_composer( View $view ) {
$view_name = $view->get_name();
if ( isset( $this->composers[$view_name] ) ) {
return $this->composers[$view_name];
}
return [];
} | [
"public",
"function",
"get_composer",
"(",
"View",
"$",
"view",
")",
"{",
"$",
"view_name",
"=",
"$",
"view",
"->",
"get_name",
"(",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"composers",
"[",
"$",
"view_name",
"]",
")",
")",
"{",
"retu... | Call composer.
@param \Frozzare\Digster\View $view
@return string | [
"Call",
"composer",
"."
] | 9ef9626ce82673af698bc0976d6c38a532e4a6d9 | https://github.com/wpup/digster/blob/9ef9626ce82673af698bc0976d6c38a532e4a6d9/src/class-factory.php#L209-L217 |
13,978 | wpup/digster | src/class-factory.php | Factory.view | protected function view( $view ) {
if ( preg_match( '/\.\w+$/', $view, $matches ) && in_array( $matches[0], $this->extensions() ) ) {
return str_replace( '.', '/', preg_replace( '/' . $matches[0] . '$/', '', $view ) ) . $matches[0];
}
return $this->extension( str_replace( '.', '/', $view ) );
} | php | protected function view( $view ) {
if ( preg_match( '/\.\w+$/', $view, $matches ) && in_array( $matches[0], $this->extensions() ) ) {
return str_replace( '.', '/', preg_replace( '/' . $matches[0] . '$/', '', $view ) ) . $matches[0];
}
return $this->extension( str_replace( '.', '/', $view ) );
} | [
"protected",
"function",
"view",
"(",
"$",
"view",
")",
"{",
"if",
"(",
"preg_match",
"(",
"'/\\.\\w+$/'",
",",
"$",
"view",
",",
"$",
"matches",
")",
"&&",
"in_array",
"(",
"$",
"matches",
"[",
"0",
"]",
",",
"$",
"this",
"->",
"extensions",
"(",
... | Get the right view string from dot view or view that missing extension.
@param string $view
@return string | [
"Get",
"the",
"right",
"view",
"string",
"from",
"dot",
"view",
"or",
"view",
"that",
"missing",
"extension",
"."
] | 9ef9626ce82673af698bc0976d6c38a532e4a6d9 | https://github.com/wpup/digster/blob/9ef9626ce82673af698bc0976d6c38a532e4a6d9/src/class-factory.php#L256-L262 |
13,979 | wpup/digster | src/class-factory.php | Factory.reset_composer | protected function reset_composer( View $view ) {
$view_name = $view->get_name();
if ( isset( $this->composers[$view_name] ) ) {
unset( $this->composers[$view_name] );
}
} | php | protected function reset_composer( View $view ) {
$view_name = $view->get_name();
if ( isset( $this->composers[$view_name] ) ) {
unset( $this->composers[$view_name] );
}
} | [
"protected",
"function",
"reset_composer",
"(",
"View",
"$",
"view",
")",
"{",
"$",
"view_name",
"=",
"$",
"view",
"->",
"get_name",
"(",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"composers",
"[",
"$",
"view_name",
"]",
")",
")",
"{",
... | Reset view composer.
@param \Frozzare\Digster\View $view | [
"Reset",
"view",
"composer",
"."
] | 9ef9626ce82673af698bc0976d6c38a532e4a6d9 | https://github.com/wpup/digster/blob/9ef9626ce82673af698bc0976d6c38a532e4a6d9/src/class-factory.php#L269-L275 |
13,980 | mimmi20/Wurfl | src/VirtualCapability/VirtualCapabilityProvider.php | VirtualCapabilityProvider.getControlCapabilities | public static function getControlCapabilities()
{
$caps = array();
foreach (array_keys(self::$virtualCapabilities) as $capabilityName) {
$caps[] = self::PREFIX_CONTROL . $capabilityName;
}
return $caps;
} | php | public static function getControlCapabilities()
{
$caps = array();
foreach (array_keys(self::$virtualCapabilities) as $capabilityName) {
$caps[] = self::PREFIX_CONTROL . $capabilityName;
}
return $caps;
} | [
"public",
"static",
"function",
"getControlCapabilities",
"(",
")",
"{",
"$",
"caps",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"array_keys",
"(",
"self",
"::",
"$",
"virtualCapabilities",
")",
"as",
"$",
"capabilityName",
")",
"{",
"$",
"caps",
"[",
... | Returns an array of all the control capabilities
@return array | [
"Returns",
"an",
"array",
"of",
"all",
"the",
"control",
"capabilities"
] | 443ed0d73a0b9a21ebd0d6ddf1e32669b9de44ec | https://github.com/mimmi20/Wurfl/blob/443ed0d73a0b9a21ebd0d6ddf1e32669b9de44ec/src/VirtualCapability/VirtualCapabilityProvider.php#L157-L165 |
13,981 | liupdhc/yii2-liuxy-themes | admin/plugins/datatables/examples/server_side/scripts/ssp.class.php | SSP.sql_exec | static function sql_exec ( $db, $bindings, $sql=null )
{
// Argument shifting
if ( $sql === null ) {
$sql = $bindings;
}
$stmt = $db->prepare( $sql );
//echo $sql;
// Bind parameters
if ( is_array( $bindings ) ) {
for ( $i=0, $ien=count($bindings) ; $i<$ien ; $i++ ) {
$binding = $bindings[$i]... | php | static function sql_exec ( $db, $bindings, $sql=null )
{
// Argument shifting
if ( $sql === null ) {
$sql = $bindings;
}
$stmt = $db->prepare( $sql );
//echo $sql;
// Bind parameters
if ( is_array( $bindings ) ) {
for ( $i=0, $ien=count($bindings) ; $i<$ien ; $i++ ) {
$binding = $bindings[$i]... | [
"static",
"function",
"sql_exec",
"(",
"$",
"db",
",",
"$",
"bindings",
",",
"$",
"sql",
"=",
"null",
")",
"{",
"// Argument shifting",
"if",
"(",
"$",
"sql",
"===",
"null",
")",
"{",
"$",
"sql",
"=",
"$",
"bindings",
";",
"}",
"$",
"stmt",
"=",
... | Execute an SQL query on the database
@param resource $db Database handler
@param array $bindings Array of PDO binding values from bind() to be
used for safely escaping strings. Note that this can be given as the
SQL query string if no bindings are required.
@param string $sql SQL query to execute.
@return arr... | [
"Execute",
"an",
"SQL",
"query",
"on",
"the",
"database"
] | 0f804715092718776ecab9748d1dc0562b6ebcac | https://github.com/liupdhc/yii2-liuxy-themes/blob/0f804715092718776ecab9748d1dc0562b6ebcac/admin/plugins/datatables/examples/server_side/scripts/ssp.class.php#L295-L323 |
13,982 | liupdhc/yii2-liuxy-themes | admin/plugins/datatables/examples/server_side/scripts/ssp.class.php | SSP.pluck | static function pluck ( $a, $prop )
{
$out = array();
for ( $i=0, $len=count($a) ; $i<$len ; $i++ ) {
$out[] = $a[$i][$prop];
}
return $out;
} | php | static function pluck ( $a, $prop )
{
$out = array();
for ( $i=0, $len=count($a) ; $i<$len ; $i++ ) {
$out[] = $a[$i][$prop];
}
return $out;
} | [
"static",
"function",
"pluck",
"(",
"$",
"a",
",",
"$",
"prop",
")",
"{",
"$",
"out",
"=",
"array",
"(",
")",
";",
"for",
"(",
"$",
"i",
"=",
"0",
",",
"$",
"len",
"=",
"count",
"(",
"$",
"a",
")",
";",
"$",
"i",
"<",
"$",
"len",
";",
"... | Pull a particular property from each assoc. array in a numeric array,
returning and array of the property values from each item.
@param array $a Array to get data from
@param string $prop Property to read
@return array Array of property values | [
"Pull",
"a",
"particular",
"property",
"from",
"each",
"assoc",
".",
"array",
"in",
"a",
"numeric",
"array",
"returning",
"and",
"array",
"of",
"the",
"property",
"values",
"from",
"each",
"item",
"."
] | 0f804715092718776ecab9748d1dc0562b6ebcac | https://github.com/liupdhc/yii2-liuxy-themes/blob/0f804715092718776ecab9748d1dc0562b6ebcac/admin/plugins/datatables/examples/server_side/scripts/ssp.class.php#L379-L388 |
13,983 | PandaPlatform/framework | src/Panda/Support/Configuration/Parsers/PhpParser.php | PhpParser.parse | public function parse($configFile = '')
{
// Load default configuration
$defaultConfigFile = $this->getConfigFile($configFile, 'default');
$defaultConfigArray = parent::parse($defaultConfigFile) ?: [];
// Load environment configuration
$envConfigFile = $this->getConfigFile($... | php | public function parse($configFile = '')
{
// Load default configuration
$defaultConfigFile = $this->getConfigFile($configFile, 'default');
$defaultConfigArray = parent::parse($defaultConfigFile) ?: [];
// Load environment configuration
$envConfigFile = $this->getConfigFile($... | [
"public",
"function",
"parse",
"(",
"$",
"configFile",
"=",
"''",
")",
"{",
"// Load default configuration",
"$",
"defaultConfigFile",
"=",
"$",
"this",
"->",
"getConfigFile",
"(",
"$",
"configFile",
",",
"'default'",
")",
";",
"$",
"defaultConfigArray",
"=",
... | Parse the configuration file and get the configuration array.
@param string $configFile
@return array | [
"Parse",
"the",
"configuration",
"file",
"and",
"get",
"the",
"configuration",
"array",
"."
] | a78cf051b379896b5a4d5df620988e37a0e632f5 | https://github.com/PandaPlatform/framework/blob/a78cf051b379896b5a4d5df620988e37a0e632f5/src/Panda/Support/Configuration/Parsers/PhpParser.php#L46-L58 |
13,984 | PandaPlatform/framework | src/Panda/Support/Configuration/Parsers/PhpParser.php | PhpParser.getConfigFile | private function getConfigFile($configFile, $environment = 'default')
{
// Normalize config file
$configFile = $configFile ?: 'config';
// Check if there is an environment-specific config file
$envConfigFile = $this->app->getConfigPath() . DIRECTORY_SEPARATOR . $configFile . '-' . $... | php | private function getConfigFile($configFile, $environment = 'default')
{
// Normalize config file
$configFile = $configFile ?: 'config';
// Check if there is an environment-specific config file
$envConfigFile = $this->app->getConfigPath() . DIRECTORY_SEPARATOR . $configFile . '-' . $... | [
"private",
"function",
"getConfigFile",
"(",
"$",
"configFile",
",",
"$",
"environment",
"=",
"'default'",
")",
"{",
"// Normalize config file",
"$",
"configFile",
"=",
"$",
"configFile",
"?",
":",
"'config'",
";",
"// Check if there is an environment-specific config fi... | Get the configuration file according to the given environment, if any.
@param string $configFile
@param string $environment
@return string | [
"Get",
"the",
"configuration",
"file",
"according",
"to",
"the",
"given",
"environment",
"if",
"any",
"."
] | a78cf051b379896b5a4d5df620988e37a0e632f5 | https://github.com/PandaPlatform/framework/blob/a78cf051b379896b5a4d5df620988e37a0e632f5/src/Panda/Support/Configuration/Parsers/PhpParser.php#L68-L80 |
13,985 | vi-kon/laravel-parser | src/ViKon/Parser/rule/AbstractRuleSet.php | AbstractRuleSet.init | public function init(Parser $parser, Lexer $lexer) {
$parser->setStartRule($this->startRule);
foreach ($this->rules as $rule) {
$parser->addRule($rule);
}
$parser->setLexer($lexer);
$lexer->setParser($parser);
return $this;
} | php | public function init(Parser $parser, Lexer $lexer) {
$parser->setStartRule($this->startRule);
foreach ($this->rules as $rule) {
$parser->addRule($rule);
}
$parser->setLexer($lexer);
$lexer->setParser($parser);
return $this;
} | [
"public",
"function",
"init",
"(",
"Parser",
"$",
"parser",
",",
"Lexer",
"$",
"lexer",
")",
"{",
"$",
"parser",
"->",
"setStartRule",
"(",
"$",
"this",
"->",
"startRule",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"rules",
"as",
"$",
"rule",
")",
... | Set start rule and add set's rules to parser
@param \ViKon\Parser\Parser $parser
@param \ViKon\Parser\Lexer\Lexer $lexer
@return $this
@throws \ViKon\Parser\ParserException | [
"Set",
"start",
"rule",
"and",
"add",
"set",
"s",
"rules",
"to",
"parser"
] | 070f0bb9120cb9ca6ff836d4f418e78ee33ee182 | https://github.com/vi-kon/laravel-parser/blob/070f0bb9120cb9ca6ff836d4f418e78ee33ee182/src/ViKon/Parser/rule/AbstractRuleSet.php#L125-L136 |
13,986 | vi-kon/laravel-parser | src/ViKon/Parser/rule/AbstractRuleSet.php | AbstractRuleSet.addRule | protected function addRule(AbstractRule $rule, $category = self::CATEGORY_NONE) {
$rule->setRuleSet($this);
$this->rules[] = $rule;
$this->categories[$category][] = $rule;
return $this;
} | php | protected function addRule(AbstractRule $rule, $category = self::CATEGORY_NONE) {
$rule->setRuleSet($this);
$this->rules[] = $rule;
$this->categories[$category][] = $rule;
return $this;
} | [
"protected",
"function",
"addRule",
"(",
"AbstractRule",
"$",
"rule",
",",
"$",
"category",
"=",
"self",
"::",
"CATEGORY_NONE",
")",
"{",
"$",
"rule",
"->",
"setRuleSet",
"(",
"$",
"this",
")",
";",
"$",
"this",
"->",
"rules",
"[",
"]",
"=",
"$",
"ru... | Add new rule to set
@param \ViKon\Parser\Rule\AbstractRule $rule
@param string $category
@return $this | [
"Add",
"new",
"rule",
"to",
"set"
] | 070f0bb9120cb9ca6ff836d4f418e78ee33ee182 | https://github.com/vi-kon/laravel-parser/blob/070f0bb9120cb9ca6ff836d4f418e78ee33ee182/src/ViKon/Parser/rule/AbstractRuleSet.php#L146-L153 |
13,987 | venta/framework | src/Event/src/EventDispatcher.php | EventDispatcher.getListeners | protected function getListeners(string $eventName): array
{
if (!isset($this->listeners[$eventName])) {
return [];
}
if (!isset($this->sortedListeners[$eventName])) {
$this->sortedListeners[$eventName] = $this->sortEventListeners($eventName);
}
retur... | php | protected function getListeners(string $eventName): array
{
if (!isset($this->listeners[$eventName])) {
return [];
}
if (!isset($this->sortedListeners[$eventName])) {
$this->sortedListeners[$eventName] = $this->sortEventListeners($eventName);
}
retur... | [
"protected",
"function",
"getListeners",
"(",
"string",
"$",
"eventName",
")",
":",
"array",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"listeners",
"[",
"$",
"eventName",
"]",
")",
")",
"{",
"return",
"[",
"]",
";",
"}",
"if",
"(",
"!",... | Returns array of event listeners.
@param string $eventName
@return array | [
"Returns",
"array",
"of",
"event",
"listeners",
"."
] | 514a7854cc69f84f47e62a58cc55efd68b7c9f83 | https://github.com/venta/framework/blob/514a7854cc69f84f47e62a58cc55efd68b7c9f83/src/Event/src/EventDispatcher.php#L102-L113 |
13,988 | venta/framework | src/Event/src/EventDispatcher.php | EventDispatcher.sortEventListeners | protected function sortEventListeners(string $eventName): array
{
$listeners = $this->listeners[$eventName];
$normalised = [];
ksort($listeners);
foreach ($listeners as $priorityListeners) {
foreach ($priorityListeners as $listener) {
$normalised[] = $li... | php | protected function sortEventListeners(string $eventName): array
{
$listeners = $this->listeners[$eventName];
$normalised = [];
ksort($listeners);
foreach ($listeners as $priorityListeners) {
foreach ($priorityListeners as $listener) {
$normalised[] = $li... | [
"protected",
"function",
"sortEventListeners",
"(",
"string",
"$",
"eventName",
")",
":",
"array",
"{",
"$",
"listeners",
"=",
"$",
"this",
"->",
"listeners",
"[",
"$",
"eventName",
"]",
";",
"$",
"normalised",
"=",
"[",
"]",
";",
"ksort",
"(",
"$",
"l... | Merges all event listeners for particular event.
@param string $eventName
@return array | [
"Merges",
"all",
"event",
"listeners",
"for",
"particular",
"event",
"."
] | 514a7854cc69f84f47e62a58cc55efd68b7c9f83 | https://github.com/venta/framework/blob/514a7854cc69f84f47e62a58cc55efd68b7c9f83/src/Event/src/EventDispatcher.php#L121-L135 |
13,989 | taskforcedev/laravel-support | src/Helpers/UI.php | UI.cssClass | public function cssClass($type)
{
$framework = $this->getFramework();
$classes = $this->getClasses($framework);
if (property_exists($classes, $type)) {
return $classes->$type;
}
return '';
} | php | public function cssClass($type)
{
$framework = $this->getFramework();
$classes = $this->getClasses($framework);
if (property_exists($classes, $type)) {
return $classes->$type;
}
return '';
} | [
"public",
"function",
"cssClass",
"(",
"$",
"type",
")",
"{",
"$",
"framework",
"=",
"$",
"this",
"->",
"getFramework",
"(",
")",
";",
"$",
"classes",
"=",
"$",
"this",
"->",
"getClasses",
"(",
"$",
"framework",
")",
";",
"if",
"(",
"property_exists",
... | Get the css class for a given object type.
@param string $type Object type.
@return string | [
"Get",
"the",
"css",
"class",
"for",
"a",
"given",
"object",
"type",
"."
] | fdfa90ca10ffd57bc6f7aca20d2f3db7dc259221 | https://github.com/taskforcedev/laravel-support/blob/fdfa90ca10ffd57bc6f7aca20d2f3db7dc259221/src/Helpers/UI.php#L25-L35 |
13,990 | taskforcedev/laravel-support | src/Helpers/UI.php | UI.columns | public function columns($xs, $sm, $md, $lg)
{
$framework = $this->getFramework();
switch ($framework)
{
case 'bs3':
case 'bs4':
$xsC = $this->cssClass('column_extra_small') . $xs;
$smC = $this->cssClass('column_small') . $sm;
... | php | public function columns($xs, $sm, $md, $lg)
{
$framework = $this->getFramework();
switch ($framework)
{
case 'bs3':
case 'bs4':
$xsC = $this->cssClass('column_extra_small') . $xs;
$smC = $this->cssClass('column_small') . $sm;
... | [
"public",
"function",
"columns",
"(",
"$",
"xs",
",",
"$",
"sm",
",",
"$",
"md",
",",
"$",
"lg",
")",
"{",
"$",
"framework",
"=",
"$",
"this",
"->",
"getFramework",
"(",
")",
";",
"switch",
"(",
"$",
"framework",
")",
"{",
"case",
"'bs3'",
":",
... | Create framework column class.
@param integer $xs Extra Small (Ignored on Foundation
@param integer $sm Small.
@param integer $md Medium.
@param integer $lg Large.
@return string | [
"Create",
"framework",
"column",
"class",
"."
] | fdfa90ca10ffd57bc6f7aca20d2f3db7dc259221 | https://github.com/taskforcedev/laravel-support/blob/fdfa90ca10ffd57bc6f7aca20d2f3db7dc259221/src/Helpers/UI.php#L47-L71 |
13,991 | taskforcedev/laravel-support | src/Helpers/UI.php | UI.getClasses | public function getClasses($framework)
{
switch ($framework)
{
case 'bs3':
$classes = $this->json->bs3;
break;
case 'bs4':
$classes = $this->json->bs4;
break;
case 'f6':
$classes = $th... | php | public function getClasses($framework)
{
switch ($framework)
{
case 'bs3':
$classes = $this->json->bs3;
break;
case 'bs4':
$classes = $this->json->bs4;
break;
case 'f6':
$classes = $th... | [
"public",
"function",
"getClasses",
"(",
"$",
"framework",
")",
"{",
"switch",
"(",
"$",
"framework",
")",
"{",
"case",
"'bs3'",
":",
"$",
"classes",
"=",
"$",
"this",
"->",
"json",
"->",
"bs3",
";",
"break",
";",
"case",
"'bs4'",
":",
"$",
"classes"... | Get the css class matrix for the given framework.
@param string $framework Framework.
@return string | [
"Get",
"the",
"css",
"class",
"matrix",
"for",
"the",
"given",
"framework",
"."
] | fdfa90ca10ffd57bc6f7aca20d2f3db7dc259221 | https://github.com/taskforcedev/laravel-support/blob/fdfa90ca10ffd57bc6f7aca20d2f3db7dc259221/src/Helpers/UI.php#L96-L114 |
13,992 | sifophp/sifo-common-instance | classes/MailExt.php | MailExt.send | public function send( $to, $subject, $body )
{
// Debug advice:
if ( \Sifo\Domains::getInstance()->getDebugMode() )
{
$this->_dispatchMailController( $to, $subject, $body );
}
return parent::send( $to, $subject, $body );
} | php | public function send( $to, $subject, $body )
{
// Debug advice:
if ( \Sifo\Domains::getInstance()->getDebugMode() )
{
$this->_dispatchMailController( $to, $subject, $body );
}
return parent::send( $to, $subject, $body );
} | [
"public",
"function",
"send",
"(",
"$",
"to",
",",
"$",
"subject",
",",
"$",
"body",
")",
"{",
"// Debug advice:",
"if",
"(",
"\\",
"Sifo",
"\\",
"Domains",
"::",
"getInstance",
"(",
")",
"->",
"getDebugMode",
"(",
")",
")",
"{",
"$",
"this",
"->",
... | Send an email whith debug interruption.
@param string $to
@param string $subject
@param string $body
@return boolean | [
"Send",
"an",
"email",
"whith",
"debug",
"interruption",
"."
] | 52d54ea3e565bd2bccd77e0b0a6a99b5cae3aff5 | https://github.com/sifophp/sifo-common-instance/blob/52d54ea3e565bd2bccd77e0b0a6a99b5cae3aff5/classes/MailExt.php#L15-L23 |
13,993 | ignasbernotas/console | src/Question/MultipleChoiceQuestion.php | MultipleChoiceQuestion.selectChoice | protected function selectChoice()
{
$index = array_search(
$this->choices[$this->cursor->getPosition()],
$this->answers
);
if (false !== $index) {
unset($this->answers[$index]);
} else {
$this->answers[] = $this->choices[$this->cursor-... | php | protected function selectChoice()
{
$index = array_search(
$this->choices[$this->cursor->getPosition()],
$this->answers
);
if (false !== $index) {
unset($this->answers[$index]);
} else {
$this->answers[] = $this->choices[$this->cursor-... | [
"protected",
"function",
"selectChoice",
"(",
")",
"{",
"$",
"index",
"=",
"array_search",
"(",
"$",
"this",
"->",
"choices",
"[",
"$",
"this",
"->",
"cursor",
"->",
"getPosition",
"(",
")",
"]",
",",
"$",
"this",
"->",
"answers",
")",
";",
"if",
"("... | Allows selecting multiple choices
@return $this | [
"Allows",
"selecting",
"multiple",
"choices"
] | 909e613b140413062424d6a465da08aac355be55 | https://github.com/ignasbernotas/console/blob/909e613b140413062424d6a465da08aac355be55/src/Question/MultipleChoiceQuestion.php#L27-L43 |
13,994 | MissAllSunday/Ohara | src/Suki/Data.php | Data.sanitize | public function sanitize($var)
{
global $smcFunc;
if (is_array($var))
{
foreach ($var as $k => $v)
$var[$k] = $this->sanitize($v);
return $var;
}
else
{
$var = (string) $smcFunc['htmltrim']($smcFunc['htmlspecialchars']($var), ENT_QUOTES);
if (ctype_digit($var))
$var = (int) $var;
... | php | public function sanitize($var)
{
global $smcFunc;
if (is_array($var))
{
foreach ($var as $k => $v)
$var[$k] = $this->sanitize($v);
return $var;
}
else
{
$var = (string) $smcFunc['htmltrim']($smcFunc['htmlspecialchars']($var), ENT_QUOTES);
if (ctype_digit($var))
$var = (int) $var;
... | [
"public",
"function",
"sanitize",
"(",
"$",
"var",
")",
"{",
"global",
"$",
"smcFunc",
";",
"if",
"(",
"is_array",
"(",
"$",
"var",
")",
")",
"{",
"foreach",
"(",
"$",
"var",
"as",
"$",
"k",
"=>",
"$",
"v",
")",
"$",
"var",
"[",
"$",
"k",
"]"... | Sanitizes a var. Recursive.
Treats any var as a string and cast it as an integer if necessary.
@param mixed $var The var you want to sanitize
@access public
@return mixed | [
"Sanitizes",
"a",
"var",
".",
"Recursive",
".",
"Treats",
"any",
"var",
"as",
"a",
"string",
"and",
"cast",
"it",
"as",
"an",
"integer",
"if",
"necessary",
"."
] | 7753500cde1d51a0d7b37593aeaf2fc05fefd903 | https://github.com/MissAllSunday/Ohara/blob/7753500cde1d51a0d7b37593aeaf2fc05fefd903/src/Suki/Data.php#L130-L154 |
13,995 | kriskbx/mikado | spec/DummyData.php | DummyData.getStdClass | public function getStdClass($formatAble = false)
{
$object = new stdClass();
$object->testProperty = 'test';
$object->nullProperty = null;
$object->arrayProperty = [
'level1' => [
'level2a' => null,
'level2' => [
'level3... | php | public function getStdClass($formatAble = false)
{
$object = new stdClass();
$object->testProperty = 'test';
$object->nullProperty = null;
$object->arrayProperty = [
'level1' => [
'level2a' => null,
'level2' => [
'level3... | [
"public",
"function",
"getStdClass",
"(",
"$",
"formatAble",
"=",
"false",
")",
"{",
"$",
"object",
"=",
"new",
"stdClass",
"(",
")",
";",
"$",
"object",
"->",
"testProperty",
"=",
"'test'",
";",
"$",
"object",
"->",
"nullProperty",
"=",
"null",
";",
"... | Get stdClass dummy data.
@param bool $formatAble
@return stdClass | [
"Get",
"stdClass",
"dummy",
"data",
"."
] | f00e566d682a66796f3f8a68b348920fadd9ee87 | https://github.com/kriskbx/mikado/blob/f00e566d682a66796f3f8a68b348920fadd9ee87/spec/DummyData.php#L20-L40 |
13,996 | kriskbx/mikado | spec/DummyData.php | DummyData.getStdClassWithArray | public function getStdClassWithArray($formatAble = false)
{
$object = new stdClass();
$object->array = [
[
'key' => 'value',
'key2' => 'value2',
],
];
if ($formatAble) {
$object = Manager::formatAble($object);
... | php | public function getStdClassWithArray($formatAble = false)
{
$object = new stdClass();
$object->array = [
[
'key' => 'value',
'key2' => 'value2',
],
];
if ($formatAble) {
$object = Manager::formatAble($object);
... | [
"public",
"function",
"getStdClassWithArray",
"(",
"$",
"formatAble",
"=",
"false",
")",
"{",
"$",
"object",
"=",
"new",
"stdClass",
"(",
")",
";",
"$",
"object",
"->",
"array",
"=",
"[",
"[",
"'key'",
"=>",
"'value'",
",",
"'key2'",
"=>",
"'value2'",
... | Get stdClass dummy data with array.
@param bool|false $formatAble
@return stdClass | [
"Get",
"stdClass",
"dummy",
"data",
"with",
"array",
"."
] | f00e566d682a66796f3f8a68b348920fadd9ee87 | https://github.com/kriskbx/mikado/blob/f00e566d682a66796f3f8a68b348920fadd9ee87/spec/DummyData.php#L49-L64 |
13,997 | kriskbx/mikado | spec/DummyData.php | DummyData.getPost | public function getPost($formatAble = false)
{
$post = Post::published()->first();
$post = self::fix($post);
if ($formatAble) {
$post = Manager::formatAble($post);
}
return $post;
} | php | public function getPost($formatAble = false)
{
$post = Post::published()->first();
$post = self::fix($post);
if ($formatAble) {
$post = Manager::formatAble($post);
}
return $post;
} | [
"public",
"function",
"getPost",
"(",
"$",
"formatAble",
"=",
"false",
")",
"{",
"$",
"post",
"=",
"Post",
"::",
"published",
"(",
")",
"->",
"first",
"(",
")",
";",
"$",
"post",
"=",
"self",
"::",
"fix",
"(",
"$",
"post",
")",
";",
"if",
"(",
... | Get WordPress dummy data.
@param bool $formatAble
@return object | [
"Get",
"WordPress",
"dummy",
"data",
"."
] | f00e566d682a66796f3f8a68b348920fadd9ee87 | https://github.com/kriskbx/mikado/blob/f00e566d682a66796f3f8a68b348920fadd9ee87/spec/DummyData.php#L73-L83 |
13,998 | kriskbx/mikado | spec/DummyData.php | DummyData.getMultiplePosts | public function getMultiplePosts($formatAble = false)
{
$posts = Post::published()->get();
foreach ($posts as $key => $post) {
$posts[$key] = self::fix($post);
if ($formatAble) {
$posts[$key] = Manager::formatAble($posts[$key]);
}
}
... | php | public function getMultiplePosts($formatAble = false)
{
$posts = Post::published()->get();
foreach ($posts as $key => $post) {
$posts[$key] = self::fix($post);
if ($formatAble) {
$posts[$key] = Manager::formatAble($posts[$key]);
}
}
... | [
"public",
"function",
"getMultiplePosts",
"(",
"$",
"formatAble",
"=",
"false",
")",
"{",
"$",
"posts",
"=",
"Post",
"::",
"published",
"(",
")",
"->",
"get",
"(",
")",
";",
"foreach",
"(",
"$",
"posts",
"as",
"$",
"key",
"=>",
"$",
"post",
")",
"{... | Get multiple WordPress data.
@param bool|false $formatAble
@return mixed | [
"Get",
"multiple",
"WordPress",
"data",
"."
] | f00e566d682a66796f3f8a68b348920fadd9ee87 | https://github.com/kriskbx/mikado/blob/f00e566d682a66796f3f8a68b348920fadd9ee87/spec/DummyData.php#L92-L105 |
13,999 | Stratadox/ImmutableCollection | src/ImmutableCollection.php | ImmutableCollection.offsetSet | final public function offsetSet($index, $value): void
{
if (is_null($index)) {
throw CannotAlterCollection::byAddingTo($this);
}
throw CannotAlterCollection::byOverWriting($this, $index);
} | php | final public function offsetSet($index, $value): void
{
if (is_null($index)) {
throw CannotAlterCollection::byAddingTo($this);
}
throw CannotAlterCollection::byOverWriting($this, $index);
} | [
"final",
"public",
"function",
"offsetSet",
"(",
"$",
"index",
",",
"$",
"value",
")",
":",
"void",
"{",
"if",
"(",
"is_null",
"(",
"$",
"index",
")",
")",
"{",
"throw",
"CannotAlterCollection",
"::",
"byAddingTo",
"(",
"$",
"this",
")",
";",
"}",
"t... | Disallows use of the offsetSet method.
@param int|mixed $index The index that may not be mutated.
@param mixed $value The value that will not be written.
@throws NotAllowed Whenever called upon. | [
"Disallows",
"use",
"of",
"the",
"offsetSet",
"method",
"."
] | eac441bc1762eefda6da25354b4e8f91f48bd733 | https://github.com/Stratadox/ImmutableCollection/blob/eac441bc1762eefda6da25354b4e8f91f48bd733/src/ImmutableCollection.php#L60-L66 |
Subsets and Splits
Yii Code Samples
Gathers all records from test, train, and validation sets that contain the word 'yii', providing a basic filtered view of the dataset relevant to Yii-related content.