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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
24,800 | jenskooij/cloudcontrol | src/storage/storage/BricksStorage.php | BricksStorage.deleteBrickBySlug | public function deleteBrickBySlug($slug)
{
$bricks = $this->repository->bricks;
foreach ($bricks as $key => $brickObject) {
if ($brickObject->slug == $slug) {
unset($bricks[$key]);
}
}
$bricks = array_values($bricks);
$this->repository... | php | public function deleteBrickBySlug($slug)
{
$bricks = $this->repository->bricks;
foreach ($bricks as $key => $brickObject) {
if ($brickObject->slug == $slug) {
unset($bricks[$key]);
}
}
$bricks = array_values($bricks);
$this->repository... | [
"public",
"function",
"deleteBrickBySlug",
"(",
"$",
"slug",
")",
"{",
"$",
"bricks",
"=",
"$",
"this",
"->",
"repository",
"->",
"bricks",
";",
"foreach",
"(",
"$",
"bricks",
"as",
"$",
"key",
"=>",
"$",
"brickObject",
")",
"{",
"if",
"(",
"$",
"bri... | Delete a brick by its slug
@param $slug
@throws \Exception | [
"Delete",
"a",
"brick",
"by",
"its",
"slug"
] | 76e5d9ac8f9c50d06d39a995d13cc03742536548 | https://github.com/jenskooij/cloudcontrol/blob/76e5d9ac8f9c50d06d39a995d13cc03742536548/src/storage/storage/BricksStorage.php#L87-L99 |
24,801 | LartTyler/PHP-DaybreakCommons | src/DaybreakStudios/Common/Collection/Collections.php | Collections.toMap | public static function toMap(array $array) {
$map = new SimpleMap();
foreach ($array as $k => $v)
$map->put($k, $v);
return $map;
} | php | public static function toMap(array $array) {
$map = new SimpleMap();
foreach ($array as $k => $v)
$map->put($k, $v);
return $map;
} | [
"public",
"static",
"function",
"toMap",
"(",
"array",
"$",
"array",
")",
"{",
"$",
"map",
"=",
"new",
"SimpleMap",
"(",
")",
";",
"foreach",
"(",
"$",
"array",
"as",
"$",
"k",
"=>",
"$",
"v",
")",
"$",
"map",
"->",
"put",
"(",
"$",
"k",
",",
... | Converts a PHP array into a Map.
@see SimpleMap
@param array $array the array to convert
@return Map the map built from the PHP array | [
"Converts",
"a",
"PHP",
"array",
"into",
"a",
"Map",
"."
] | db25b5d6cea9b5a1d5afc4c5548a2cbc3018bc0d | https://github.com/LartTyler/PHP-DaybreakCommons/blob/db25b5d6cea9b5a1d5afc4c5548a2cbc3018bc0d/src/DaybreakStudios/Common/Collection/Collections.php#L17-L24 |
24,802 | nathan818fr/phpuc-io-streams | src/InputStream.php | InputStream.skip | public function skip(int $n) : int
{
if ($n <= 0) {
return 0;
}
$skipped = 0;
$skipLimit = min(self::MAX_SKIP_BUFFER_SIZE, $n);
while ($skipped < $n) {
$buf = $this->read(min($skipLimit, $n - $skipped));
if ($buf === null) {
... | php | public function skip(int $n) : int
{
if ($n <= 0) {
return 0;
}
$skipped = 0;
$skipLimit = min(self::MAX_SKIP_BUFFER_SIZE, $n);
while ($skipped < $n) {
$buf = $this->read(min($skipLimit, $n - $skipped));
if ($buf === null) {
... | [
"public",
"function",
"skip",
"(",
"int",
"$",
"n",
")",
":",
"int",
"{",
"if",
"(",
"$",
"n",
"<=",
"0",
")",
"{",
"return",
"0",
";",
"}",
"$",
"skipped",
"=",
"0",
";",
"$",
"skipLimit",
"=",
"min",
"(",
"self",
"::",
"MAX_SKIP_BUFFER_SIZE",
... | Skips over and discards n bytes of data from this input stream.
@param int $n the number of bytes to be skipped
@return int the actual number of bytes skipped
@throws IOException | [
"Skips",
"over",
"and",
"discards",
"n",
"bytes",
"of",
"data",
"from",
"this",
"input",
"stream",
"."
] | 8f748c1b3338b50e7c6e25a2f2ee73699cadb0ba | https://github.com/nathan818fr/phpuc-io-streams/blob/8f748c1b3338b50e7c6e25a2f2ee73699cadb0ba/src/InputStream.php#L50-L66 |
24,803 | Topolis/FunctionLibrary | src/Token.php | Token.uuid | public static function uuid($version = self::UUID_V4){
switch($version){
case self::UUID_V4:
$data = openssl_random_pseudo_bytes(16);
$data[6] = chr(ord($data[6]) & 0x0f | 0x40); // set version to 0010
$data[8] = chr(ord($data[8]) & 0x3f | 0x80); // ... | php | public static function uuid($version = self::UUID_V4){
switch($version){
case self::UUID_V4:
$data = openssl_random_pseudo_bytes(16);
$data[6] = chr(ord($data[6]) & 0x0f | 0x40); // set version to 0010
$data[8] = chr(ord($data[8]) & 0x3f | 0x80); // ... | [
"public",
"static",
"function",
"uuid",
"(",
"$",
"version",
"=",
"self",
"::",
"UUID_V4",
")",
"{",
"switch",
"(",
"$",
"version",
")",
"{",
"case",
"self",
"::",
"UUID_V4",
":",
"$",
"data",
"=",
"openssl_random_pseudo_bytes",
"(",
"16",
")",
";",
"$... | Generate a uuid according to a specific UUID definition
@param integer $version format/version of UUID to generate
@throws \Exception
@return string | [
"Generate",
"a",
"uuid",
"according",
"to",
"a",
"specific",
"UUID",
"definition"
] | bc57f465932fbf297927c2a32765255131b907eb | https://github.com/Topolis/FunctionLibrary/blob/bc57f465932fbf297927c2a32765255131b907eb/src/Token.php#L17-L31 |
24,804 | Xsaven/laravel-intelect-admin | src/Addons/JWTAuth/JWTAuth.php | JWTAuth.toUser | public function toUser($token = false)
{
$payload = $this->getPayload($token);
if (! $user = $this->user->getBy($this->identifier, $payload['sub'])) {
return false;
}
return $user;
} | php | public function toUser($token = false)
{
$payload = $this->getPayload($token);
if (! $user = $this->user->getBy($this->identifier, $payload['sub'])) {
return false;
}
return $user;
} | [
"public",
"function",
"toUser",
"(",
"$",
"token",
"=",
"false",
")",
"{",
"$",
"payload",
"=",
"$",
"this",
"->",
"getPayload",
"(",
"$",
"token",
")",
";",
"if",
"(",
"!",
"$",
"user",
"=",
"$",
"this",
"->",
"user",
"->",
"getBy",
"(",
"$",
... | Find a user using the user identifier in the subject claim.
@param bool|string $token
@return mixed | [
"Find",
"a",
"user",
"using",
"the",
"user",
"identifier",
"in",
"the",
"subject",
"claim",
"."
] | 592574633d12c74cf25b43dd6694fee496abefcb | https://github.com/Xsaven/laravel-intelect-admin/blob/592574633d12c74cf25b43dd6694fee496abefcb/src/Addons/JWTAuth/JWTAuth.php#L63-L72 |
24,805 | Xsaven/laravel-intelect-admin | src/Addons/JWTAuth/JWTAuth.php | JWTAuth.fromUser | public function fromUser($user, array $customClaims = [])
{
$payload = $this->makePayload($user->{$this->identifier}, $customClaims);
return $this->manager->encode($payload)->get();
} | php | public function fromUser($user, array $customClaims = [])
{
$payload = $this->makePayload($user->{$this->identifier}, $customClaims);
return $this->manager->encode($payload)->get();
} | [
"public",
"function",
"fromUser",
"(",
"$",
"user",
",",
"array",
"$",
"customClaims",
"=",
"[",
"]",
")",
"{",
"$",
"payload",
"=",
"$",
"this",
"->",
"makePayload",
"(",
"$",
"user",
"->",
"{",
"$",
"this",
"->",
"identifier",
"}",
",",
"$",
"cus... | Generate a token using the user identifier as the subject claim.
@param mixed $user
@param array $customClaims
@return string | [
"Generate",
"a",
"token",
"using",
"the",
"user",
"identifier",
"as",
"the",
"subject",
"claim",
"."
] | 592574633d12c74cf25b43dd6694fee496abefcb | https://github.com/Xsaven/laravel-intelect-admin/blob/592574633d12c74cf25b43dd6694fee496abefcb/src/Addons/JWTAuth/JWTAuth.php#L82-L87 |
24,806 | Xsaven/laravel-intelect-admin | src/Addons/JWTAuth/JWTAuth.php | JWTAuth.authenticate | public function authenticate($token = false)
{
$id = $this->getPayload($token)->get('sub');
if (! $this->auth->byId($id)) {
return false;
}
return $this->auth->user();
} | php | public function authenticate($token = false)
{
$id = $this->getPayload($token)->get('sub');
if (! $this->auth->byId($id)) {
return false;
}
return $this->auth->user();
} | [
"public",
"function",
"authenticate",
"(",
"$",
"token",
"=",
"false",
")",
"{",
"$",
"id",
"=",
"$",
"this",
"->",
"getPayload",
"(",
"$",
"token",
")",
"->",
"get",
"(",
"'sub'",
")",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"auth",
"->",
"byId"... | Authenticate a user via a token.
@param mixed $token
@return mixed | [
"Authenticate",
"a",
"user",
"via",
"a",
"token",
"."
] | 592574633d12c74cf25b43dd6694fee496abefcb | https://github.com/Xsaven/laravel-intelect-admin/blob/592574633d12c74cf25b43dd6694fee496abefcb/src/Addons/JWTAuth/JWTAuth.php#L113-L121 |
24,807 | Xsaven/laravel-intelect-admin | src/Addons/JWTAuth/JWTAuth.php | JWTAuth.getPayload | public function getPayload($token = false)
{
$this->requireToken($token);
return $this->manager->decode($this->token);
} | php | public function getPayload($token = false)
{
$this->requireToken($token);
return $this->manager->decode($this->token);
} | [
"public",
"function",
"getPayload",
"(",
"$",
"token",
"=",
"false",
")",
"{",
"$",
"this",
"->",
"requireToken",
"(",
"$",
"token",
")",
";",
"return",
"$",
"this",
"->",
"manager",
"->",
"decode",
"(",
"$",
"this",
"->",
"token",
")",
";",
"}"
] | Get the raw Payload instance.
@param mixed $token
@return \Lia\Addons\JWTAuth\Payload | [
"Get",
"the",
"raw",
"Payload",
"instance",
"."
] | 592574633d12c74cf25b43dd6694fee496abefcb | https://github.com/Xsaven/laravel-intelect-admin/blob/592574633d12c74cf25b43dd6694fee496abefcb/src/Addons/JWTAuth/JWTAuth.php#L176-L181 |
24,808 | Xsaven/laravel-intelect-admin | src/Addons/JWTAuth/JWTAuth.php | JWTAuth.parseToken | public function parseToken($method = 'bearer', $header = 'authorization', $query = 'token')
{
if (! $token = $this->parseAuthHeader($header, $method)) {
if (! $token = $this->request->{$query}) {
if (! $token = $this->request->header('Token')) {
throw new JWTE... | php | public function parseToken($method = 'bearer', $header = 'authorization', $query = 'token')
{
if (! $token = $this->parseAuthHeader($header, $method)) {
if (! $token = $this->request->{$query}) {
if (! $token = $this->request->header('Token')) {
throw new JWTE... | [
"public",
"function",
"parseToken",
"(",
"$",
"method",
"=",
"'bearer'",
",",
"$",
"header",
"=",
"'authorization'",
",",
"$",
"query",
"=",
"'token'",
")",
"{",
"if",
"(",
"!",
"$",
"token",
"=",
"$",
"this",
"->",
"parseAuthHeader",
"(",
"$",
"header... | Parse the token from the request.
@param string $query
@return JWTAuth | [
"Parse",
"the",
"token",
"from",
"the",
"request",
"."
] | 592574633d12c74cf25b43dd6694fee496abefcb | https://github.com/Xsaven/laravel-intelect-admin/blob/592574633d12c74cf25b43dd6694fee496abefcb/src/Addons/JWTAuth/JWTAuth.php#L190-L201 |
24,809 | Xsaven/laravel-intelect-admin | src/Addons/JWTAuth/JWTAuth.php | JWTAuth.parseAuthHeader | protected function parseAuthHeader($header = 'authorization', $method = 'bearer')
{
$header = $this->request->headers->get($header);
if (! starts_with(strtolower($header), $method)) {
return false;
}
return trim(str_ireplace($method, '', $header));
} | php | protected function parseAuthHeader($header = 'authorization', $method = 'bearer')
{
$header = $this->request->headers->get($header);
if (! starts_with(strtolower($header), $method)) {
return false;
}
return trim(str_ireplace($method, '', $header));
} | [
"protected",
"function",
"parseAuthHeader",
"(",
"$",
"header",
"=",
"'authorization'",
",",
"$",
"method",
"=",
"'bearer'",
")",
"{",
"$",
"header",
"=",
"$",
"this",
"->",
"request",
"->",
"headers",
"->",
"get",
"(",
"$",
"header",
")",
";",
"if",
"... | Parse token from the authorization header.
@param string $header
@param string $method
@return false|string | [
"Parse",
"token",
"from",
"the",
"authorization",
"header",
"."
] | 592574633d12c74cf25b43dd6694fee496abefcb | https://github.com/Xsaven/laravel-intelect-admin/blob/592574633d12c74cf25b43dd6694fee496abefcb/src/Addons/JWTAuth/JWTAuth.php#L211-L220 |
24,810 | Xsaven/laravel-intelect-admin | src/Addons/JWTAuth/JWTAuth.php | JWTAuth.requireToken | protected function requireToken($token)
{
if ($token) {
return $this->setToken($token);
} elseif ($this->token) {
return $this;
} else {
throw new JWTException('A token is required', 400);
}
} | php | protected function requireToken($token)
{
if ($token) {
return $this->setToken($token);
} elseif ($this->token) {
return $this;
} else {
throw new JWTException('A token is required', 400);
}
} | [
"protected",
"function",
"requireToken",
"(",
"$",
"token",
")",
"{",
"if",
"(",
"$",
"token",
")",
"{",
"return",
"$",
"this",
"->",
"setToken",
"(",
"$",
"token",
")",
";",
"}",
"elseif",
"(",
"$",
"this",
"->",
"token",
")",
"{",
"return",
"$",
... | Ensure that a token is available.
@param mixed $token
@return JWTAuth
@throws \Lia\Addons\JWTAuth\Exceptions\JWTException | [
"Ensure",
"that",
"a",
"token",
"is",
"available",
"."
] | 592574633d12c74cf25b43dd6694fee496abefcb | https://github.com/Xsaven/laravel-intelect-admin/blob/592574633d12c74cf25b43dd6694fee496abefcb/src/Addons/JWTAuth/JWTAuth.php#L284-L293 |
24,811 | zapheus/zapheus | src/Application.php | Application.add | public function add(ProviderInterface $provider)
{
$container = $this->container;
$this->container = $provider->register($container);
$this->providers[] = (string) get_class($provider);
return $this;
} | php | public function add(ProviderInterface $provider)
{
$container = $this->container;
$this->container = $provider->register($container);
$this->providers[] = (string) get_class($provider);
return $this;
} | [
"public",
"function",
"add",
"(",
"ProviderInterface",
"$",
"provider",
")",
"{",
"$",
"container",
"=",
"$",
"this",
"->",
"container",
";",
"$",
"this",
"->",
"container",
"=",
"$",
"provider",
"->",
"register",
"(",
"$",
"container",
")",
";",
"$",
... | Adds a new provider to be registered.
@param \Zapheus\Provider\ProviderInterface $provider
@return self | [
"Adds",
"a",
"new",
"provider",
"to",
"be",
"registered",
"."
] | 96618b5cee7d20b6700d0475e4334ae4b5163a6b | https://github.com/zapheus/zapheus/blob/96618b5cee7d20b6700d0475e4334ae4b5163a6b/src/Application.php#L74-L83 |
24,812 | zapheus/zapheus | src/Application.php | Application.config | public function config($data)
{
$items = is_array($data) ? $data : array();
$config = new Provider\Configuration($items);
if (is_string($data))
{
$config->load($data);
}
$interface = ProviderInterface::CONFIG;
return $this->set($interface, $con... | php | public function config($data)
{
$items = is_array($data) ? $data : array();
$config = new Provider\Configuration($items);
if (is_string($data))
{
$config->load($data);
}
$interface = ProviderInterface::CONFIG;
return $this->set($interface, $con... | [
"public",
"function",
"config",
"(",
"$",
"data",
")",
"{",
"$",
"items",
"=",
"is_array",
"(",
"$",
"data",
")",
"?",
"$",
"data",
":",
"array",
"(",
")",
";",
"$",
"config",
"=",
"new",
"Provider",
"\\",
"Configuration",
"(",
"$",
"items",
")",
... | Creates a new configuration based on given data.
@param array|string $data
@return self | [
"Creates",
"a",
"new",
"configuration",
"based",
"on",
"given",
"data",
"."
] | 96618b5cee7d20b6700d0475e4334ae4b5163a6b | https://github.com/zapheus/zapheus/blob/96618b5cee7d20b6700d0475e4334ae4b5163a6b/src/Application.php#L91-L105 |
24,813 | zapheus/zapheus | src/Application.php | Application.emit | public function emit(ResponseInterface $response)
{
$code = $response->code() . ' ' . $response->reason();
$headers = $response->headers();
$version = $response->version();
foreach ($headers as $name => $values)
{
header($name . ': ' . implode(',', $values));
... | php | public function emit(ResponseInterface $response)
{
$code = $response->code() . ' ' . $response->reason();
$headers = $response->headers();
$version = $response->version();
foreach ($headers as $name => $values)
{
header($name . ': ' . implode(',', $values));
... | [
"public",
"function",
"emit",
"(",
"ResponseInterface",
"$",
"response",
")",
"{",
"$",
"code",
"=",
"$",
"response",
"->",
"code",
"(",
")",
".",
"' '",
".",
"$",
"response",
"->",
"reason",
"(",
")",
";",
"$",
"headers",
"=",
"$",
"response",
"->",... | Emits the headers from the response instance.
@param \Zapheus\Http\Message\ResponseInterface $response
@return \Zapheus\Http\Message\ResponseInterface | [
"Emits",
"the",
"headers",
"from",
"the",
"response",
"instance",
"."
] | 96618b5cee7d20b6700d0475e4334ae4b5163a6b | https://github.com/zapheus/zapheus/blob/96618b5cee7d20b6700d0475e4334ae4b5163a6b/src/Application.php#L113-L129 |
24,814 | zapheus/zapheus | src/Application.php | Application.handle | public function handle(RequestInterface $request)
{
$handler = new RoutingHandler($this->container);
if (! $this->has(Application::MIDDLEWARE))
{
return $handler->handle($request);
}
$dispatcher = $this->get(Application::MIDDLEWARE);
return $dispatcher-... | php | public function handle(RequestInterface $request)
{
$handler = new RoutingHandler($this->container);
if (! $this->has(Application::MIDDLEWARE))
{
return $handler->handle($request);
}
$dispatcher = $this->get(Application::MIDDLEWARE);
return $dispatcher-... | [
"public",
"function",
"handle",
"(",
"RequestInterface",
"$",
"request",
")",
"{",
"$",
"handler",
"=",
"new",
"RoutingHandler",
"(",
"$",
"this",
"->",
"container",
")",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"has",
"(",
"Application",
"::",
"MIDDLEWAR... | Dispatches the request and returns into a response.
@param \Zapheus\Http\Message\RequestInterface $request
@return \Zapheus\Http\Message\ResponseInterface | [
"Dispatches",
"the",
"request",
"and",
"returns",
"into",
"a",
"response",
"."
] | 96618b5cee7d20b6700d0475e4334ae4b5163a6b | https://github.com/zapheus/zapheus/blob/96618b5cee7d20b6700d0475e4334ae4b5163a6b/src/Application.php#L150-L162 |
24,815 | ARCANESOFT/SEO | src/ViewComposers/ViewComposer.php | ViewComposer.cacheResults | protected function cacheResults($name, Closure $callback)
{
return Cache::remember('cache::' . $name, $this->minutes, $callback);
} | php | protected function cacheResults($name, Closure $callback)
{
return Cache::remember('cache::' . $name, $this->minutes, $callback);
} | [
"protected",
"function",
"cacheResults",
"(",
"$",
"name",
",",
"Closure",
"$",
"callback",
")",
"{",
"return",
"Cache",
"::",
"remember",
"(",
"'cache::'",
".",
"$",
"name",
",",
"$",
"this",
"->",
"minutes",
",",
"$",
"callback",
")",
";",
"}"
] | Cache the results.
@param string $name
@param \Closure $callback
@return mixed | [
"Cache",
"the",
"results",
"."
] | ce6d6135d55e8b2fd43cf7923839b4791b7c7ad2 | https://github.com/ARCANESOFT/SEO/blob/ce6d6135d55e8b2fd43cf7923839b4791b7c7ad2/src/ViewComposers/ViewComposer.php#L39-L42 |
24,816 | squareproton/Bond | src/Bond/RecordManager.php | RecordManager.getTransaction | public function getTransaction( $transaction = self::TRANSACTION_LAST_USED, $throwExceptionIfNotFound = true )
{
if( $transaction === self::TRANSACTIONS_ALL ) {
return array_keys( $this->queue );
}
if( $transaction === self::TRANSACTION_LAST_CREATED ) {
if( !$this->... | php | public function getTransaction( $transaction = self::TRANSACTION_LAST_USED, $throwExceptionIfNotFound = true )
{
if( $transaction === self::TRANSACTIONS_ALL ) {
return array_keys( $this->queue );
}
if( $transaction === self::TRANSACTION_LAST_CREATED ) {
if( !$this->... | [
"public",
"function",
"getTransaction",
"(",
"$",
"transaction",
"=",
"self",
"::",
"TRANSACTION_LAST_USED",
",",
"$",
"throwExceptionIfNotFound",
"=",
"true",
")",
"{",
"if",
"(",
"$",
"transaction",
"===",
"self",
"::",
"TRANSACTIONS_ALL",
")",
"{",
"return",
... | Get a transaction name
@param scalar The name of a transaction;
@param bool Throw exception if we can't find.
@return scalar|false in the event of not found | [
"Get",
"a",
"transaction",
"name"
] | a04ad9dd1a35adeaec98237716c2a41ce02b4f1a | https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/RecordManager.php#L409-L446 |
24,817 | squareproton/Bond | src/Bond/RecordManager.php | RecordManager.removeTransaction | public function removeTransaction( $transaction = self::TRANSACTION_LAST_USED, $throwExceptionIfNotFound = true )
{
// remove all transactions
if( $transaction === self::TRANSACTIONS_ALL ) {
$numTransactions = count( $this->queue );
$this->queue = array();
$this-... | php | public function removeTransaction( $transaction = self::TRANSACTION_LAST_USED, $throwExceptionIfNotFound = true )
{
// remove all transactions
if( $transaction === self::TRANSACTIONS_ALL ) {
$numTransactions = count( $this->queue );
$this->queue = array();
$this-... | [
"public",
"function",
"removeTransaction",
"(",
"$",
"transaction",
"=",
"self",
"::",
"TRANSACTION_LAST_USED",
",",
"$",
"throwExceptionIfNotFound",
"=",
"true",
")",
"{",
"// remove all transactions",
"if",
"(",
"$",
"transaction",
"===",
"self",
"::",
"TRANSACTIO... | Remove a transaction
@param scalar|array The name of the transaction
@param bool Throw a exception if the transaction we want to remove can't be found
@return int The number of transactions removed | [
"Remove",
"a",
"transaction"
] | a04ad9dd1a35adeaec98237716c2a41ce02b4f1a | https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/RecordManager.php#L456-L531 |
24,818 | Kris-Kuiper/sFire-Framework | src/Mail/Mail.php | Mail.send | public function send($closure = null) {
if(gettype($closure) == 'object') {
call_user_func($closure, $this);
}
//Renders the optional viewmodels and assign the mail variables to them
foreach($this -> viewmodels as $type => $view) {
if(null !== $view) {
$viewmodel = new ViewModel($view, ... | php | public function send($closure = null) {
if(gettype($closure) == 'object') {
call_user_func($closure, $this);
}
//Renders the optional viewmodels and assign the mail variables to them
foreach($this -> viewmodels as $type => $view) {
if(null !== $view) {
$viewmodel = new ViewModel($view, ... | [
"public",
"function",
"send",
"(",
"$",
"closure",
"=",
"null",
")",
"{",
"if",
"(",
"gettype",
"(",
"$",
"closure",
")",
"==",
"'object'",
")",
"{",
"call_user_func",
"(",
"$",
"closure",
",",
"$",
"this",
")",
";",
"}",
"//Renders the optional viewmode... | Try to send the mail with optional callback.
@param object $closure
@return sFire\Mail\Mail | [
"Try",
"to",
"send",
"the",
"mail",
"with",
"optional",
"callback",
"."
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/Mail/Mail.php#L69-L98 |
24,819 | Kris-Kuiper/sFire-Framework | src/Mail/Mail.php | Mail.addHeader | public function addHeader($key, $value) {
if(false === is_string($key)) {
return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($key)), E_USER_ERROR);
}
if(false === is_string($value)) {
return trigger_error(sprintf('Argument 2 passed t... | php | public function addHeader($key, $value) {
if(false === is_string($key)) {
return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($key)), E_USER_ERROR);
}
if(false === is_string($value)) {
return trigger_error(sprintf('Argument 2 passed t... | [
"public",
"function",
"addHeader",
"(",
"$",
"key",
",",
"$",
"value",
")",
"{",
"if",
"(",
"false",
"===",
"is_string",
"(",
"$",
"key",
")",
")",
"{",
"return",
"trigger_error",
"(",
"sprintf",
"(",
"'Argument 1 passed to %s() must be of the type string, \"%s\... | Adds a custom header to the mail
@param string $key
@param string $value
@return sFire\Mail\Mail | [
"Adds",
"a",
"custom",
"header",
"to",
"the",
"mail"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/Mail/Mail.php#L125-L140 |
24,820 | Kris-Kuiper/sFire-Framework | src/Mail/Mail.php | Mail.removeHeader | public function removeHeader($key) {
if(false === is_string($key)) {
return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($key)), E_USER_ERROR);
}
if(true === isset($this -> headers['custom'][$key])) {
unset($this -> headers['custom'][... | php | public function removeHeader($key) {
if(false === is_string($key)) {
return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($key)), E_USER_ERROR);
}
if(true === isset($this -> headers['custom'][$key])) {
unset($this -> headers['custom'][... | [
"public",
"function",
"removeHeader",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"false",
"===",
"is_string",
"(",
"$",
"key",
")",
")",
"{",
"return",
"trigger_error",
"(",
"sprintf",
"(",
"'Argument 1 passed to %s() must be of the type string, \"%s\" given'",
",",
"_... | Removes a custom header by key
@param string $key
@return sFire\Mail\Mail | [
"Removes",
"a",
"custom",
"header",
"by",
"key"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/Mail/Mail.php#L180-L189 |
24,821 | Kris-Kuiper/sFire-Framework | src/Mail/Mail.php | Mail.render | public function render($htmlview = null, $textview = null) {
if(null !== $htmlview && false === is_string($htmlview)) {
return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($htmlview)), E_USER_ERROR);
}
if(null !== $textview && false === i... | php | public function render($htmlview = null, $textview = null) {
if(null !== $htmlview && false === is_string($htmlview)) {
return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($htmlview)), E_USER_ERROR);
}
if(null !== $textview && false === i... | [
"public",
"function",
"render",
"(",
"$",
"htmlview",
"=",
"null",
",",
"$",
"textview",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"htmlview",
"&&",
"false",
"===",
"is_string",
"(",
"$",
"htmlview",
")",
")",
"{",
"return",
"trigger_error"... | Parses the message by given an optional HTML view and an optional plain text view
@param string $htmlview
@param string $textview
@return sFire\Mail\Mail | [
"Parses",
"the",
"message",
"by",
"given",
"an",
"optional",
"HTML",
"view",
"and",
"an",
"optional",
"plain",
"text",
"view"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/Mail/Mail.php#L257-L270 |
24,822 | Kris-Kuiper/sFire-Framework | src/Mail/Mail.php | Mail.priority | public function priority($level = 1) {
if(false === ('-' . intval($level) == '-' . $level)) {
return trigger_error(sprintf('Argument 1 passed to %s() must be of the type integer, "%s" given', __METHOD__, gettype($level)), E_USER_ERROR);
}
if($level < 1 || $level > 5) {
return trigger_error(sprintf(... | php | public function priority($level = 1) {
if(false === ('-' . intval($level) == '-' . $level)) {
return trigger_error(sprintf('Argument 1 passed to %s() must be of the type integer, "%s" given', __METHOD__, gettype($level)), E_USER_ERROR);
}
if($level < 1 || $level > 5) {
return trigger_error(sprintf(... | [
"public",
"function",
"priority",
"(",
"$",
"level",
"=",
"1",
")",
"{",
"if",
"(",
"false",
"===",
"(",
"'-'",
".",
"intval",
"(",
"$",
"level",
")",
"==",
"'-'",
".",
"$",
"level",
")",
")",
"{",
"return",
"trigger_error",
"(",
"sprintf",
"(",
... | Sets the priority Level between 1 and 5
@param int $level
@return sFire\Mail\Mail | [
"Sets",
"the",
"priority",
"Level",
"between",
"1",
"and",
"5"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/Mail/Mail.php#L296-L318 |
24,823 | Kris-Kuiper/sFire-Framework | src/Mail/Mail.php | Mail.to | public function to($email, $name = null) {
if(false === $this -> validateEmail($email)) {
return trigger_error(sprintf('Argument 1 passed to %s() must be a valid email', __METHOD__), E_USER_ERROR);
}
if(null !== $name && false === is_string($name)) {
return trigger_error(sprintf('Argument 2 passed ... | php | public function to($email, $name = null) {
if(false === $this -> validateEmail($email)) {
return trigger_error(sprintf('Argument 1 passed to %s() must be a valid email', __METHOD__), E_USER_ERROR);
}
if(null !== $name && false === is_string($name)) {
return trigger_error(sprintf('Argument 2 passed ... | [
"public",
"function",
"to",
"(",
"$",
"email",
",",
"$",
"name",
"=",
"null",
")",
"{",
"if",
"(",
"false",
"===",
"$",
"this",
"->",
"validateEmail",
"(",
"$",
"email",
")",
")",
"{",
"return",
"trigger_error",
"(",
"sprintf",
"(",
"'Argument 1 passed... | Adds to email
@param string $email
@param string $name
@return sFire\Mail\Mail | [
"Adds",
"to",
"email"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/Mail/Mail.php#L327-L344 |
24,824 | Kris-Kuiper/sFire-Framework | src/Mail/Mail.php | Mail.validateEmail | private function validateEmail($email) {
if(true === is_string($email)) {
return false !== filter_var(trim($email), \FILTER_VALIDATE_EMAIL);
}
return false;
} | php | private function validateEmail($email) {
if(true === is_string($email)) {
return false !== filter_var(trim($email), \FILTER_VALIDATE_EMAIL);
}
return false;
} | [
"private",
"function",
"validateEmail",
"(",
"$",
"email",
")",
"{",
"if",
"(",
"true",
"===",
"is_string",
"(",
"$",
"email",
")",
")",
"{",
"return",
"false",
"!==",
"filter_var",
"(",
"trim",
"(",
"$",
"email",
")",
",",
"\\",
"FILTER_VALIDATE_EMAIL",... | Returns if a email is valid or not
@param string email
@return boolean | [
"Returns",
"if",
"a",
"email",
"is",
"valid",
"or",
"not"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/Mail/Mail.php#L473-L480 |
24,825 | Kris-Kuiper/sFire-Framework | src/Mail/Mail.php | Mail.emailsToString | private function emailsToString($emails) {
$format = [];
foreach($emails as $email) {
if(true === isset($email -> name) && trim($email -> name) !== '') {
$format[] = sprintf('"%s" <%s>', $email -> name, filter_var($email -> email, FILTER_SANITIZE_EMAIL));
}
else {
$format[] = filter_va... | php | private function emailsToString($emails) {
$format = [];
foreach($emails as $email) {
if(true === isset($email -> name) && trim($email -> name) !== '') {
$format[] = sprintf('"%s" <%s>', $email -> name, filter_var($email -> email, FILTER_SANITIZE_EMAIL));
}
else {
$format[] = filter_va... | [
"private",
"function",
"emailsToString",
"(",
"$",
"emails",
")",
"{",
"$",
"format",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"emails",
"as",
"$",
"email",
")",
"{",
"if",
"(",
"true",
"===",
"isset",
"(",
"$",
"email",
"->",
"name",
")",
"&&",
... | Formats an array with emails to string
@param array $emails
@return null|string | [
"Formats",
"an",
"array",
"with",
"emails",
"to",
"string"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/Mail/Mail.php#L488-L505 |
24,826 | Kris-Kuiper/sFire-Framework | src/Mail/Mail.php | Mail.formatTo | private function formatTo() {
$to = null;
if(true === isset($this -> headers['to'])) {
$to = $this -> emailsToString($this -> headers['to']);
}
return $to;
} | php | private function formatTo() {
$to = null;
if(true === isset($this -> headers['to'])) {
$to = $this -> emailsToString($this -> headers['to']);
}
return $to;
} | [
"private",
"function",
"formatTo",
"(",
")",
"{",
"$",
"to",
"=",
"null",
";",
"if",
"(",
"true",
"===",
"isset",
"(",
"$",
"this",
"->",
"headers",
"[",
"'to'",
"]",
")",
")",
"{",
"$",
"to",
"=",
"$",
"this",
"->",
"emailsToString",
"(",
"$",
... | Formats the "to" email and returns it
@return string | [
"Formats",
"the",
"to",
"email",
"and",
"returns",
"it"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/Mail/Mail.php#L512-L521 |
24,827 | Kris-Kuiper/sFire-Framework | src/Mail/Mail.php | Mail.formatHeaders | private function formatHeaders() {
$headers = [];
$files = true === isset($this -> headers['files']) ? $this -> headers['files'] : [];
//Prepair emailaddresses
foreach(['BCC', 'CC', 'Reply-To', 'From'] as $type) {
if(true === isset($this -> headers[strtolower($type)])) {
$headers[] = sprint... | php | private function formatHeaders() {
$headers = [];
$files = true === isset($this -> headers['files']) ? $this -> headers['files'] : [];
//Prepair emailaddresses
foreach(['BCC', 'CC', 'Reply-To', 'From'] as $type) {
if(true === isset($this -> headers[strtolower($type)])) {
$headers[] = sprint... | [
"private",
"function",
"formatHeaders",
"(",
")",
"{",
"$",
"headers",
"=",
"[",
"]",
";",
"$",
"files",
"=",
"true",
"===",
"isset",
"(",
"$",
"this",
"->",
"headers",
"[",
"'files'",
"]",
")",
"?",
"$",
"this",
"->",
"headers",
"[",
"'files'",
"]... | Formats the headers and returns it as a string
@return string | [
"Formats",
"the",
"headers",
"and",
"returns",
"it",
"as",
"a",
"string"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/Mail/Mail.php#L528-L573 |
24,828 | Kris-Kuiper/sFire-Framework | src/Mail/Mail.php | Mail.formatMessage | private function formatMessage() {
$message = [];
$files = true === isset($this -> headers['files']) ? $this -> headers['files'] : [];
if(count($files) > 0) {
$message[] = sprintf("--Boundary-mixed-%s\r\n", $this -> getBoundary());
$message[] = sprintf("Content-Type: multipart/alternative; b... | php | private function formatMessage() {
$message = [];
$files = true === isset($this -> headers['files']) ? $this -> headers['files'] : [];
if(count($files) > 0) {
$message[] = sprintf("--Boundary-mixed-%s\r\n", $this -> getBoundary());
$message[] = sprintf("Content-Type: multipart/alternative; b... | [
"private",
"function",
"formatMessage",
"(",
")",
"{",
"$",
"message",
"=",
"[",
"]",
";",
"$",
"files",
"=",
"true",
"===",
"isset",
"(",
"$",
"this",
"->",
"headers",
"[",
"'files'",
"]",
")",
"?",
"$",
"this",
"->",
"headers",
"[",
"'files'",
"]... | Formats the messages and returns it as a string
@return string | [
"Formats",
"the",
"messages",
"and",
"returns",
"it",
"as",
"a",
"string"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/Mail/Mail.php#L580-L628 |
24,829 | Kris-Kuiper/sFire-Framework | src/Mail/Mail.php | Mail.formatNotify | private function formatNotify() {
$notify = null;
if(true === isset($this -> headers['notify'])) {
$notify = $this -> emailsToString($this -> headers['notify']);
if(null === $notify) {
if(true === isset($this -> headers['from'])) {
$notify = $this -> emailsToString($this -> headers['f... | php | private function formatNotify() {
$notify = null;
if(true === isset($this -> headers['notify'])) {
$notify = $this -> emailsToString($this -> headers['notify']);
if(null === $notify) {
if(true === isset($this -> headers['from'])) {
$notify = $this -> emailsToString($this -> headers['f... | [
"private",
"function",
"formatNotify",
"(",
")",
"{",
"$",
"notify",
"=",
"null",
";",
"if",
"(",
"true",
"===",
"isset",
"(",
"$",
"this",
"->",
"headers",
"[",
"'notify'",
"]",
")",
")",
"{",
"$",
"notify",
"=",
"$",
"this",
"->",
"emailsToString",... | Formats the notify email and returns it
@return null|string | [
"Formats",
"the",
"notify",
"email",
"and",
"returns",
"it"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/Mail/Mail.php#L635-L655 |
24,830 | Kris-Kuiper/sFire-Framework | src/Mail/Mail.php | Mail.getBoundary | private function getBoundary() {
if(null === $this -> boundary) {
$this -> boundary = md5(date('r', time()));
}
return $this -> boundary;
} | php | private function getBoundary() {
if(null === $this -> boundary) {
$this -> boundary = md5(date('r', time()));
}
return $this -> boundary;
} | [
"private",
"function",
"getBoundary",
"(",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"boundary",
")",
"{",
"$",
"this",
"->",
"boundary",
"=",
"md5",
"(",
"date",
"(",
"'r'",
",",
"time",
"(",
")",
")",
")",
";",
"}",
"return",
"$",
... | Generates if needed and returns the boundary
@return string | [
"Generates",
"if",
"needed",
"and",
"returns",
"the",
"boundary"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/Mail/Mail.php#L662-L669 |
24,831 | jstewmc/path | src/Path.php | Path.format | public function format()
{
$string = '';
if ( ! empty($this->segments)) {
$string = implode($this->separator, $this->segments);
}
return $string;
} | php | public function format()
{
$string = '';
if ( ! empty($this->segments)) {
$string = implode($this->separator, $this->segments);
}
return $string;
} | [
"public",
"function",
"format",
"(",
")",
"{",
"$",
"string",
"=",
"''",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"segments",
")",
")",
"{",
"$",
"string",
"=",
"implode",
"(",
"$",
"this",
"->",
"separator",
",",
"$",
"this",
"->",
... | Returns the path as a string
@return string
@since 0.1.0 | [
"Returns",
"the",
"path",
"as",
"a",
"string"
] | d9813721cc10407710113865bd8baae7419b2f84 | https://github.com/jstewmc/path/blob/d9813721cc10407710113865bd8baae7419b2f84/src/Path.php#L137-L146 |
24,832 | jstewmc/path | src/Path.php | Path.parse | public function parse($path)
{
if (is_string($path)) {
if (substr($path, 0, 1) === $this->separator) {
$path = substr($path, 1);
}
$this->segments = explode($this->separator, $path);
} else {
throw new \InvalidArgumentException(
__METHOD__."() expects parameter one, path, to be a string"
);... | php | public function parse($path)
{
if (is_string($path)) {
if (substr($path, 0, 1) === $this->separator) {
$path = substr($path, 1);
}
$this->segments = explode($this->separator, $path);
} else {
throw new \InvalidArgumentException(
__METHOD__."() expects parameter one, path, to be a string"
);... | [
"public",
"function",
"parse",
"(",
"$",
"path",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"path",
")",
")",
"{",
"if",
"(",
"substr",
"(",
"$",
"path",
",",
"0",
",",
"1",
")",
"===",
"$",
"this",
"->",
"separator",
")",
"{",
"$",
"path",
... | Parses the string path into this Path object
Keep in mind, if $path does not use the default separator, you should set the
path's separator first, before calling parse().
@param string $path the path to parse (with or without leading separator)
@return self
@throws InvalidArgumentException if $path is not a str... | [
"Parses",
"the",
"string",
"path",
"into",
"this",
"Path",
"object"
] | d9813721cc10407710113865bd8baae7419b2f84 | https://github.com/jstewmc/path/blob/d9813721cc10407710113865bd8baae7419b2f84/src/Path.php#L488-L502 |
24,833 | jstewmc/path | src/Path.php | Path.slice | public function slice($offset, $length = null)
{
if (is_numeric($offset) && is_int(+$offset)) {
if ($length === null || (is_numeric($length) && is_int(+$length))) {
$this->segments = array_slice($this->segments, $offset, $length);
} else {
throw new \InvalidArgumentException(
__METHOD__."() expect... | php | public function slice($offset, $length = null)
{
if (is_numeric($offset) && is_int(+$offset)) {
if ($length === null || (is_numeric($length) && is_int(+$length))) {
$this->segments = array_slice($this->segments, $offset, $length);
} else {
throw new \InvalidArgumentException(
__METHOD__."() expect... | [
"public",
"function",
"slice",
"(",
"$",
"offset",
",",
"$",
"length",
"=",
"null",
")",
"{",
"if",
"(",
"is_numeric",
"(",
"$",
"offset",
")",
"&&",
"is_int",
"(",
"+",
"$",
"offset",
")",
")",
"{",
"if",
"(",
"$",
"length",
"===",
"null",
"||",... | Slices the path
Keep in mind, I will change this path. To keep this path the same and return a
new, sliced Path, use the getSlice() method instead.
For example:
$path = new Path('foo/bar/baz');
$path->slice(1);
echo $path; // prints "bar/baz"
@param int $offset if offset is non-negative, the slice will start a... | [
"Slices",
"the",
"path"
] | d9813721cc10407710113865bd8baae7419b2f84 | https://github.com/jstewmc/path/blob/d9813721cc10407710113865bd8baae7419b2f84/src/Path.php#L649-L666 |
24,834 | alkemann/h.l | src/debug/util/Debug.php | Debug.array_out | public function array_out($key = null) {
if (count($this->output) < 2 || ($key && !isset($this->output[$key]))) {
return array();
}
if ($key) {
return $this->output[$key];
}
array_shift($this->output);
return $this->output;
} | php | public function array_out($key = null) {
if (count($this->output) < 2 || ($key && !isset($this->output[$key]))) {
return array();
}
if ($key) {
return $this->output[$key];
}
array_shift($this->output);
return $this->output;
} | [
"public",
"function",
"array_out",
"(",
"$",
"key",
"=",
"null",
")",
"{",
"if",
"(",
"count",
"(",
"$",
"this",
"->",
"output",
")",
"<",
"2",
"||",
"(",
"$",
"key",
"&&",
"!",
"isset",
"(",
"$",
"this",
"->",
"output",
"[",
"$",
"key",
"]",
... | Return output dump as array
@param string $key
@return array | [
"Return",
"output",
"dump",
"as",
"array"
] | 0ba9a9738e317b32c4d6f800c618524fccfdbc9a | https://github.com/alkemann/h.l/blob/0ba9a9738e317b32c4d6f800c618524fccfdbc9a/src/debug/util/Debug.php#L115-L124 |
24,835 | alkemann/h.l | src/debug/util/Debug.php | Debug.out | public function out($key = null) {
if ($this->options['mode'] == 'Html') {
\alkemann\hl\debug\util\adapters\Html::top($this->output, $key);
return;
}
$this->__out($key);
} | php | public function out($key = null) {
if ($this->options['mode'] == 'Html') {
\alkemann\hl\debug\util\adapters\Html::top($this->output, $key);
return;
}
$this->__out($key);
} | [
"public",
"function",
"out",
"(",
"$",
"key",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"options",
"[",
"'mode'",
"]",
"==",
"'Html'",
")",
"{",
"\\",
"alkemann",
"\\",
"hl",
"\\",
"debug",
"\\",
"util",
"\\",
"adapters",
"\\",
"Html",
... | Echo out stored debugging
@param int $key | [
"Echo",
"out",
"stored",
"debugging"
] | 0ba9a9738e317b32c4d6f800c618524fccfdbc9a | https://github.com/alkemann/h.l/blob/0ba9a9738e317b32c4d6f800c618524fccfdbc9a/src/debug/util/Debug.php#L131-L137 |
24,836 | alkemann/h.l | src/debug/util/Debug.php | Debug.defines | public function defines() {
$defines = get_defined_constants();
$ret = array(); $offset = -1;
while ($def = array_slice($defines, $offset--, 1)) {
$key = key($def);
$value = current($def);
if ($key == 'FIRST_APP_CONSTANT') break;
$ret[$key ] = $va... | php | public function defines() {
$defines = get_defined_constants();
$ret = array(); $offset = -1;
while ($def = array_slice($defines, $offset--, 1)) {
$key = key($def);
$value = current($def);
if ($key == 'FIRST_APP_CONSTANT') break;
$ret[$key ] = $va... | [
"public",
"function",
"defines",
"(",
")",
"{",
"$",
"defines",
"=",
"get_defined_constants",
"(",
")",
";",
"$",
"ret",
"=",
"array",
"(",
")",
";",
"$",
"offset",
"=",
"-",
"1",
";",
"while",
"(",
"$",
"def",
"=",
"array_slice",
"(",
"$",
"define... | Grab global defines, will start at 'FIRST_APP_CONSTANT', if defined
@return type | [
"Grab",
"global",
"defines",
"will",
"start",
"at",
"FIRST_APP_CONSTANT",
"if",
"defined"
] | 0ba9a9738e317b32c4d6f800c618524fccfdbc9a | https://github.com/alkemann/h.l/blob/0ba9a9738e317b32c4d6f800c618524fccfdbc9a/src/debug/util/Debug.php#L158-L168 |
24,837 | alkemann/h.l | src/debug/util/Debug.php | Debug.dump_it | public function dump_it($var) {
$adapter = '\alkemann\hl\debug\util\adapters\\'. $this->options['mode'];
if (is_array($var))
return $adapter::dump_array($var, $this);
elseif (is_object($var))
return $adapter::dump_object($var, $this);
else
return $adapter::d... | php | public function dump_it($var) {
$adapter = '\alkemann\hl\debug\util\adapters\\'. $this->options['mode'];
if (is_array($var))
return $adapter::dump_array($var, $this);
elseif (is_object($var))
return $adapter::dump_object($var, $this);
else
return $adapter::d... | [
"public",
"function",
"dump_it",
"(",
"$",
"var",
")",
"{",
"$",
"adapter",
"=",
"'\\alkemann\\hl\\debug\\util\\adapters\\\\'",
".",
"$",
"this",
"->",
"options",
"[",
"'mode'",
"]",
";",
"if",
"(",
"is_array",
"(",
"$",
"var",
")",
")",
"return",
"$",
"... | Send a variable to the adapter and return it's formated output
@param mixed $var
@return string | [
"Send",
"a",
"variable",
"to",
"the",
"adapter",
"and",
"return",
"it",
"s",
"formated",
"output"
] | 0ba9a9738e317b32c4d6f800c618524fccfdbc9a | https://github.com/alkemann/h.l/blob/0ba9a9738e317b32c4d6f800c618524fccfdbc9a/src/debug/util/Debug.php#L176-L184 |
24,838 | alkemann/h.l | src/debug/util/Debug.php | Debug.location | public function location($trace) {
$root = substr($_SERVER['DOCUMENT_ROOT'], 0 , strlen(static::$defaults['docroot']) * -1);
$file = implode('/', array_diff(explode('/', $trace[0]['file']), explode('/', $root)));
$ret = array(
'file' => $file,
'line' => $trace[0]['line']
... | php | public function location($trace) {
$root = substr($_SERVER['DOCUMENT_ROOT'], 0 , strlen(static::$defaults['docroot']) * -1);
$file = implode('/', array_diff(explode('/', $trace[0]['file']), explode('/', $root)));
$ret = array(
'file' => $file,
'line' => $trace[0]['line']
... | [
"public",
"function",
"location",
"(",
"$",
"trace",
")",
"{",
"$",
"root",
"=",
"substr",
"(",
"$",
"_SERVER",
"[",
"'DOCUMENT_ROOT'",
"]",
",",
"0",
",",
"strlen",
"(",
"static",
"::",
"$",
"defaults",
"[",
"'docroot'",
"]",
")",
"*",
"-",
"1",
"... | Create an array that describes the location of the debug call
@param string $trace
@return array | [
"Create",
"an",
"array",
"that",
"describes",
"the",
"location",
"of",
"the",
"debug",
"call"
] | 0ba9a9738e317b32c4d6f800c618524fccfdbc9a | https://github.com/alkemann/h.l/blob/0ba9a9738e317b32c4d6f800c618524fccfdbc9a/src/debug/util/Debug.php#L192-L202 |
24,839 | RhubarbPHP/Scaffold.AuthenticationWithRoles | src/User.php | User.hasRole | public function hasRole($name)
{
if ($this->RoleID) {
$role = new Role($this->RoleID);
if ($role->RoleName == $name) {
return true;
}
}
foreach ($this->Roles as $role) {
if ($role->RoleName == $name) {
return tr... | php | public function hasRole($name)
{
if ($this->RoleID) {
$role = new Role($this->RoleID);
if ($role->RoleName == $name) {
return true;
}
}
foreach ($this->Roles as $role) {
if ($role->RoleName == $name) {
return tr... | [
"public",
"function",
"hasRole",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"RoleID",
")",
"{",
"$",
"role",
"=",
"new",
"Role",
"(",
"$",
"this",
"->",
"RoleID",
")",
";",
"if",
"(",
"$",
"role",
"->",
"RoleName",
"==",
"$",
"na... | Checks if user has a specific role
@param $name string
@return bool | [
"Checks",
"if",
"user",
"has",
"a",
"specific",
"role"
] | 7402e741b67f1936dfbb3d3ae6e1f6193c226f9b | https://github.com/RhubarbPHP/Scaffold.AuthenticationWithRoles/blob/7402e741b67f1936dfbb3d3ae6e1f6193c226f9b/src/User.php#L96-L111 |
24,840 | cloudtek/dynamodm | lib/Cloudtek/DynamoDM/Mapping/ClassMetadata.php | ClassMetadata.getAttributeValue | public function getAttributeValue($document, $attribute)
{
if ($document instanceof Proxy && !in_array($attribute, $this->getIdentifierAttributeNames()) && !$document->__isInitialized()) {
$document->__load();
}
return $this->getPropertyMetadata($attribute)->getValue($document);... | php | public function getAttributeValue($document, $attribute)
{
if ($document instanceof Proxy && !in_array($attribute, $this->getIdentifierAttributeNames()) && !$document->__isInitialized()) {
$document->__load();
}
return $this->getPropertyMetadata($attribute)->getValue($document);... | [
"public",
"function",
"getAttributeValue",
"(",
"$",
"document",
",",
"$",
"attribute",
")",
"{",
"if",
"(",
"$",
"document",
"instanceof",
"Proxy",
"&&",
"!",
"in_array",
"(",
"$",
"attribute",
",",
"$",
"this",
"->",
"getIdentifierAttributeNames",
"(",
")"... | Gets the specified attribute's value off the given document.
@param object $document
@param string $attribute
@return mixed | [
"Gets",
"the",
"specified",
"attribute",
"s",
"value",
"off",
"the",
"given",
"document",
"."
] | 119d355e2c5cbaef1f867970349b4432f5704fcd | https://github.com/cloudtek/dynamodm/blob/119d355e2c5cbaef1f867970349b4432f5704fcd/lib/Cloudtek/DynamoDM/Mapping/ClassMetadata.php#L560-L567 |
24,841 | cloudtek/dynamodm | lib/Cloudtek/DynamoDM/Mapping/ClassMetadata.php | ClassMetadata.getDefinitionTable | public function getDefinitionTable()
{
$definition = array_merge(
$this->getIndex()->getDefinition(),
$this->getDefinitionSecondaryIndexes()
);
$definition['TableName'] = $this->getTableName();
$definition['AttributeDefinitions'] = $this->getDefini... | php | public function getDefinitionTable()
{
$definition = array_merge(
$this->getIndex()->getDefinition(),
$this->getDefinitionSecondaryIndexes()
);
$definition['TableName'] = $this->getTableName();
$definition['AttributeDefinitions'] = $this->getDefini... | [
"public",
"function",
"getDefinitionTable",
"(",
")",
"{",
"$",
"definition",
"=",
"array_merge",
"(",
"$",
"this",
"->",
"getIndex",
"(",
")",
"->",
"getDefinition",
"(",
")",
",",
"$",
"this",
"->",
"getDefinitionSecondaryIndexes",
"(",
")",
")",
";",
"$... | Return the table definition for this class, formatted for AWS SDK.
@return array | [
"Return",
"the",
"table",
"definition",
"for",
"this",
"class",
"formatted",
"for",
"AWS",
"SDK",
"."
] | 119d355e2c5cbaef1f867970349b4432f5704fcd | https://github.com/cloudtek/dynamodm/blob/119d355e2c5cbaef1f867970349b4432f5704fcd/lib/Cloudtek/DynamoDM/Mapping/ClassMetadata.php#L605-L616 |
24,842 | cloudtek/dynamodm | lib/Cloudtek/DynamoDM/Mapping/ClassMetadata.php | ClassMetadata.getPropertyMetadata | public function getPropertyMetadata($propertyName)
{
if (!isset($this->propertyMetadata[$propertyName])) {
throw MappingException::mappingNotFound($this->name, $propertyName);
}
return $this->propertyMetadata[$propertyName];
} | php | public function getPropertyMetadata($propertyName)
{
if (!isset($this->propertyMetadata[$propertyName])) {
throw MappingException::mappingNotFound($this->name, $propertyName);
}
return $this->propertyMetadata[$propertyName];
} | [
"public",
"function",
"getPropertyMetadata",
"(",
"$",
"propertyName",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"propertyMetadata",
"[",
"$",
"propertyName",
"]",
")",
")",
"{",
"throw",
"MappingException",
"::",
"mappingNotFound",
"(",
"$"... | Gets the mapping metadata of a property.
@param string $propertyName The property name.
@return PropertyMetadata The property mapping.
@throws MappingException | [
"Gets",
"the",
"mapping",
"metadata",
"of",
"a",
"property",
"."
] | 119d355e2c5cbaef1f867970349b4432f5704fcd | https://github.com/cloudtek/dynamodm/blob/119d355e2c5cbaef1f867970349b4432f5704fcd/lib/Cloudtek/DynamoDM/Mapping/ClassMetadata.php#L788-L795 |
24,843 | cloudtek/dynamodm | lib/Cloudtek/DynamoDM/Mapping/ClassMetadata.php | ClassMetadata.getTypeOfAttribute | public function getTypeOfAttribute($attributeName)
{
return isset($this->propertyMetadata[$attributeName]) ?
$this->propertyMetadata[$attributeName]->type : null;
} | php | public function getTypeOfAttribute($attributeName)
{
return isset($this->propertyMetadata[$attributeName]) ?
$this->propertyMetadata[$attributeName]->type : null;
} | [
"public",
"function",
"getTypeOfAttribute",
"(",
"$",
"attributeName",
")",
"{",
"return",
"isset",
"(",
"$",
"this",
"->",
"propertyMetadata",
"[",
"$",
"attributeName",
"]",
")",
"?",
"$",
"this",
"->",
"propertyMetadata",
"[",
"$",
"attributeName",
"]",
"... | Returns a type name of this attribute.
This type names can be implementation specific but should at least include the php types:
integer, string, boolean, float/double, datetime.
@param string $attributeName
@return string | [
"Returns",
"a",
"type",
"name",
"of",
"this",
"attribute",
"."
] | 119d355e2c5cbaef1f867970349b4432f5704fcd | https://github.com/cloudtek/dynamodm/blob/119d355e2c5cbaef1f867970349b4432f5704fcd/lib/Cloudtek/DynamoDM/Mapping/ClassMetadata.php#L847-L851 |
24,844 | cloudtek/dynamodm | lib/Cloudtek/DynamoDM/Mapping/ClassMetadata.php | ClassMetadata.registerAlsoLoadMethod | public function registerAlsoLoadMethod($method, $attributes)
{
$this->alsoLoadMethods[$method] = is_array($attributes) ? $attributes : [$attributes];
} | php | public function registerAlsoLoadMethod($method, $attributes)
{
$this->alsoLoadMethods[$method] = is_array($attributes) ? $attributes : [$attributes];
} | [
"public",
"function",
"registerAlsoLoadMethod",
"(",
"$",
"method",
",",
"$",
"attributes",
")",
"{",
"$",
"this",
"->",
"alsoLoadMethods",
"[",
"$",
"method",
"]",
"=",
"is_array",
"(",
"$",
"attributes",
")",
"?",
"$",
"attributes",
":",
"[",
"$",
"att... | Registers a method for loading document data before attribute hydration.
Note: A method may be registered multiple times for different attributes.
it will be invoked only once for the first attribute found.
@param string $method Method name
@param array|string $attributes Database attribute name(s) | [
"Registers",
"a",
"method",
"for",
"loading",
"document",
"data",
"before",
"attribute",
"hydration",
"."
] | 119d355e2c5cbaef1f867970349b4432f5704fcd | https://github.com/cloudtek/dynamodm/blob/119d355e2c5cbaef1f867970349b4432f5704fcd/lib/Cloudtek/DynamoDM/Mapping/ClassMetadata.php#L1181-L1184 |
24,845 | cloudtek/dynamodm | lib/Cloudtek/DynamoDM/Mapping/ClassMetadata.php | ClassMetadata.setDiscriminatorAttribute | public function setDiscriminatorAttribute($discriminatorAttribute)
{
if ($discriminatorAttribute === null) {
$this->discriminatorAttribute = null;
return;
}
foreach ($this->propertyMetadata as $attributeMapping) {
if ($discriminatorAttribute === $attribu... | php | public function setDiscriminatorAttribute($discriminatorAttribute)
{
if ($discriminatorAttribute === null) {
$this->discriminatorAttribute = null;
return;
}
foreach ($this->propertyMetadata as $attributeMapping) {
if ($discriminatorAttribute === $attribu... | [
"public",
"function",
"setDiscriminatorAttribute",
"(",
"$",
"discriminatorAttribute",
")",
"{",
"if",
"(",
"$",
"discriminatorAttribute",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"discriminatorAttribute",
"=",
"null",
";",
"return",
";",
"}",
"foreach",
"(",... | Sets the discriminator attribute.
The attribute name is the the unmapped database attribute. Discriminator
values are only used to discern the hydration class and are not mapped to
class properties.
@param string $discriminatorAttribute
@throws MappingException If the discriminator attribute conflicts with the
name ... | [
"Sets",
"the",
"discriminator",
"attribute",
"."
] | 119d355e2c5cbaef1f867970349b4432f5704fcd | https://github.com/cloudtek/dynamodm/blob/119d355e2c5cbaef1f867970349b4432f5704fcd/lib/Cloudtek/DynamoDM/Mapping/ClassMetadata.php#L1239-L1254 |
24,846 | cloudtek/dynamodm | lib/Cloudtek/DynamoDM/Mapping/ClassMetadata.php | ClassMetadata.setDiscriminatorDefaultValue | public function setDiscriminatorDefaultValue($discriminatorDefaultValue)
{
if ($discriminatorDefaultValue !== null && !array_key_exists($discriminatorDefaultValue, $this->discriminatorMap)) {
throw MappingException::invalidDiscriminatorValue($discriminatorDefaultValue, $this->name);
}
... | php | public function setDiscriminatorDefaultValue($discriminatorDefaultValue)
{
if ($discriminatorDefaultValue !== null && !array_key_exists($discriminatorDefaultValue, $this->discriminatorMap)) {
throw MappingException::invalidDiscriminatorValue($discriminatorDefaultValue, $this->name);
}
... | [
"public",
"function",
"setDiscriminatorDefaultValue",
"(",
"$",
"discriminatorDefaultValue",
")",
"{",
"if",
"(",
"$",
"discriminatorDefaultValue",
"!==",
"null",
"&&",
"!",
"array_key_exists",
"(",
"$",
"discriminatorDefaultValue",
",",
"$",
"this",
"->",
"discrimina... | Sets the default discriminator value to be used for this class
Used for JOINED and SINGLE_TABLE inheritance mapping strategies if the
document has no discriminator value
@param string $discriminatorDefaultValue
@throws MappingException | [
"Sets",
"the",
"default",
"discriminator",
"value",
"to",
"be",
"used",
"for",
"this",
"class",
"Used",
"for",
"JOINED",
"and",
"SINGLE_TABLE",
"inheritance",
"mapping",
"strategies",
"if",
"the",
"document",
"has",
"no",
"discriminator",
"value"
] | 119d355e2c5cbaef1f867970349b4432f5704fcd | https://github.com/cloudtek/dynamodm/blob/119d355e2c5cbaef1f867970349b4432f5704fcd/lib/Cloudtek/DynamoDM/Mapping/ClassMetadata.php#L1265-L1272 |
24,847 | cloudtek/dynamodm | lib/Cloudtek/DynamoDM/Mapping/ClassMetadata.php | ClassMetadata.setTable | public function setTable($table)
{
if (is_array($table)) {
if (!isset($table['name'])) {
throw new \InvalidArgumentException('A name key is required when passing an array to setTable()');
}
$this->table = $table['name'];
} else {
$this-... | php | public function setTable($table)
{
if (is_array($table)) {
if (!isset($table['name'])) {
throw new \InvalidArgumentException('A name key is required when passing an array to setTable()');
}
$this->table = $table['name'];
} else {
$this-... | [
"public",
"function",
"setTable",
"(",
"$",
"table",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"table",
")",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"table",
"[",
"'name'",
"]",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
... | Sets the table this document is mapped to.
@param array|string $table The table name.
@throws \InvalidArgumentException | [
"Sets",
"the",
"table",
"this",
"document",
"is",
"mapped",
"to",
"."
] | 119d355e2c5cbaef1f867970349b4432f5704fcd | https://github.com/cloudtek/dynamodm/blob/119d355e2c5cbaef1f867970349b4432f5704fcd/lib/Cloudtek/DynamoDM/Mapping/ClassMetadata.php#L1430-L1440 |
24,848 | anorgan/deployer-common | src/Runner.php | Runner.run | public function run()
{
foreach ($this->getSteps() as $step) {
$this->logger->info('Starting "'.$step->getTitle().'"');
foreach ($this->getServersForStep($step) as $server) {
if ($step->isMandatory()) {
$server->runCommands();
... | php | public function run()
{
foreach ($this->getSteps() as $step) {
$this->logger->info('Starting "'.$step->getTitle().'"');
foreach ($this->getServersForStep($step) as $server) {
if ($step->isMandatory()) {
$server->runCommands();
... | [
"public",
"function",
"run",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"getSteps",
"(",
")",
"as",
"$",
"step",
")",
"{",
"$",
"this",
"->",
"logger",
"->",
"info",
"(",
"'Starting \"'",
".",
"$",
"step",
"->",
"getTitle",
"(",
")",
".",
... | Run commands on every server of every step with steps' commands. | [
"Run",
"commands",
"on",
"every",
"server",
"of",
"every",
"step",
"with",
"steps",
"commands",
"."
] | 8b4bdb6c7ea3f7031aa4ee8eb06a16e49006da6f | https://github.com/anorgan/deployer-common/blob/8b4bdb6c7ea3f7031aa4ee8eb06a16e49006da6f/src/Runner.php#L38-L57 |
24,849 | PenoaksDev/Milky-Framework | src/Milky/Http/View/Compilers/BladeCompiler.php | BladeCompiler.parseSegments | protected function parseSegments( $expression, $requiredSegmentCount )
{
$segments = explode( ',', preg_replace( "/[ \(\)\\\"\']/", '', $expression ) );
if ( $requiredSegmentCount > count( $segments ) )
throw new FrameworkException( "Blade directive is short the required number of segments of " . $requiredSegm... | php | protected function parseSegments( $expression, $requiredSegmentCount )
{
$segments = explode( ',', preg_replace( "/[ \(\)\\\"\']/", '', $expression ) );
if ( $requiredSegmentCount > count( $segments ) )
throw new FrameworkException( "Blade directive is short the required number of segments of " . $requiredSegm... | [
"protected",
"function",
"parseSegments",
"(",
"$",
"expression",
",",
"$",
"requiredSegmentCount",
")",
"{",
"$",
"segments",
"=",
"explode",
"(",
"','",
",",
"preg_replace",
"(",
"\"/[ \\(\\)\\\\\\\"\\']/\"",
",",
"''",
",",
"$",
"expression",
")",
")",
";",... | Parses out a blade directive arguments
@param $expression
@param $requiredSegmentCount
@return array
@throws FrameworkException | [
"Parses",
"out",
"a",
"blade",
"directive",
"arguments"
] | 8afd7156610a70371aa5b1df50b8a212bf7b142c | https://github.com/PenoaksDev/Milky-Framework/blob/8afd7156610a70371aa5b1df50b8a212bf7b142c/src/Milky/Http/View/Compilers/BladeCompiler.php#L1071-L1079 |
24,850 | MARCspec/File_MARC_Reference | src/File_MARC_Reference.php | File_MARC_Reference.getFieldIndex | private function getFieldIndex($prevTag, $tag, $fieldIndex)
{
if ($prevTag == $tag or '' == $prevTag) {
return $fieldIndex; // iteration of field index will continue
}
$specTag = $this->currentSpec['field']->getTag();
if (preg_match('/'.$specTag.'/', $tag)) {
... | php | private function getFieldIndex($prevTag, $tag, $fieldIndex)
{
if ($prevTag == $tag or '' == $prevTag) {
return $fieldIndex; // iteration of field index will continue
}
$specTag = $this->currentSpec['field']->getTag();
if (preg_match('/'.$specTag.'/', $tag)) {
... | [
"private",
"function",
"getFieldIndex",
"(",
"$",
"prevTag",
",",
"$",
"tag",
",",
"$",
"fieldIndex",
")",
"{",
"if",
"(",
"$",
"prevTag",
"==",
"$",
"tag",
"or",
"''",
"==",
"$",
"prevTag",
")",
"{",
"return",
"$",
"fieldIndex",
";",
"// iteration of ... | Get the current field index.
@param string $prevTag The previous field tag
@param string $tag The current field tag
@param int $fieldIndex The current field index
@return int $fieldIndex The current field index | [
"Get",
"the",
"current",
"field",
"index",
"."
] | 29abbff5bec5e3bcfeeb07ba7bee94cc0a0a7f5e | https://github.com/MARCspec/File_MARC_Reference/blob/29abbff5bec5e3bcfeeb07ba7bee94cc0a0a7f5e/src/File_MARC_Reference.php#L179-L191 |
24,851 | MARCspec/File_MARC_Reference | src/File_MARC_Reference.php | File_MARC_Reference.iterateSubSpec | private function iterateSubSpec($subSpecs, $fieldIndex, $subfieldIndex = null)
{
$valid = true;
foreach ($subSpecs as $_subSpec) {
if (is_array($_subSpec)) { // chained subSpecs (OR)
foreach ($_subSpec as $this->currentSubSpec) {
$this->setIndexStartEn... | php | private function iterateSubSpec($subSpecs, $fieldIndex, $subfieldIndex = null)
{
$valid = true;
foreach ($subSpecs as $_subSpec) {
if (is_array($_subSpec)) { // chained subSpecs (OR)
foreach ($_subSpec as $this->currentSubSpec) {
$this->setIndexStartEn... | [
"private",
"function",
"iterateSubSpec",
"(",
"$",
"subSpecs",
",",
"$",
"fieldIndex",
",",
"$",
"subfieldIndex",
"=",
"null",
")",
"{",
"$",
"valid",
"=",
"true",
";",
"foreach",
"(",
"$",
"subSpecs",
"as",
"$",
"_subSpec",
")",
"{",
"if",
"(",
"is_ar... | Iterate on subspecs.
@param array $subSpecs Array of subspecs
@param int $fieldIndex The current field index
@param int $subfieldIndex The current subfield index
@return bool The validation result | [
"Iterate",
"on",
"subspecs",
"."
] | 29abbff5bec5e3bcfeeb07ba7bee94cc0a0a7f5e | https://github.com/MARCspec/File_MARC_Reference/blob/29abbff5bec5e3bcfeeb07ba7bee94cc0a0a7f5e/src/File_MARC_Reference.php#L202-L224 |
24,852 | MARCspec/File_MARC_Reference | src/File_MARC_Reference.php | File_MARC_Reference.setIndexStartEnd | private function setIndexStartEnd($fieldIndex, $subfieldIndex = null)
{
foreach (['leftSubTerm', 'rightSubTerm'] as $side) {
if (!($this->currentSubSpec[$side] instanceof CK\MARCspec\ComparisonStringInterface)) {
// only set new index if subspec field tag equals spec field tag!!
... | php | private function setIndexStartEnd($fieldIndex, $subfieldIndex = null)
{
foreach (['leftSubTerm', 'rightSubTerm'] as $side) {
if (!($this->currentSubSpec[$side] instanceof CK\MARCspec\ComparisonStringInterface)) {
// only set new index if subspec field tag equals spec field tag!!
... | [
"private",
"function",
"setIndexStartEnd",
"(",
"$",
"fieldIndex",
",",
"$",
"subfieldIndex",
"=",
"null",
")",
"{",
"foreach",
"(",
"[",
"'leftSubTerm'",
",",
"'rightSubTerm'",
"]",
"as",
"$",
"side",
")",
"{",
"if",
"(",
"!",
"(",
"$",
"this",
"->",
... | Sets the start and end index of the current spec
if it's an instance of CK\MARCspec\PositionOrRangeInterface.
@param object $spec The current spec
@param int $fieldIndex the start/end index to set
@param int $subfieldIndex the start/end index to set | [
"Sets",
"the",
"start",
"and",
"end",
"index",
"of",
"the",
"current",
"spec",
"if",
"it",
"s",
"an",
"instance",
"of",
"CK",
"\\",
"MARCspec",
"\\",
"PositionOrRangeInterface",
"."
] | 29abbff5bec5e3bcfeeb07ba7bee94cc0a0a7f5e | https://github.com/MARCspec/File_MARC_Reference/blob/29abbff5bec5e3bcfeeb07ba7bee94cc0a0a7f5e/src/File_MARC_Reference.php#L234-L251 |
24,853 | MARCspec/File_MARC_Reference | src/File_MARC_Reference.php | File_MARC_Reference.checkSubSpec | private function checkSubSpec()
{
$validation = $this->cache->validation($this->currentSubSpec);
if (!is_null($validation)) {
return $validation;
}
return $this->validateSubSpec();
} | php | private function checkSubSpec()
{
$validation = $this->cache->validation($this->currentSubSpec);
if (!is_null($validation)) {
return $validation;
}
return $this->validateSubSpec();
} | [
"private",
"function",
"checkSubSpec",
"(",
")",
"{",
"$",
"validation",
"=",
"$",
"this",
"->",
"cache",
"->",
"validation",
"(",
"$",
"this",
"->",
"currentSubSpec",
")",
";",
"if",
"(",
"!",
"is_null",
"(",
"$",
"validation",
")",
")",
"{",
"return"... | Checks cache for subspec validation result.
Validates SubSpec if it's not in cache.
@return bool Validation result | [
"Checks",
"cache",
"for",
"subspec",
"validation",
"result",
".",
"Validates",
"SubSpec",
"if",
"it",
"s",
"not",
"in",
"cache",
"."
] | 29abbff5bec5e3bcfeeb07ba7bee94cc0a0a7f5e | https://github.com/MARCspec/File_MARC_Reference/blob/29abbff5bec5e3bcfeeb07ba7bee94cc0a0a7f5e/src/File_MARC_Reference.php#L259-L267 |
24,854 | MARCspec/File_MARC_Reference | src/File_MARC_Reference.php | File_MARC_Reference.validateSubSpec | private function validateSubSpec()
{
if ('!' != $this->currentSubSpec['operator'] && '?' != $this->currentSubSpec['operator']) { // skip left subTerm on operators ! and ?
if (false === ($this->currentSubSpec['leftSubTerm'] instanceof CK\MARCspec\ComparisonStringInterface)) {
$lef... | php | private function validateSubSpec()
{
if ('!' != $this->currentSubSpec['operator'] && '?' != $this->currentSubSpec['operator']) { // skip left subTerm on operators ! and ?
if (false === ($this->currentSubSpec['leftSubTerm'] instanceof CK\MARCspec\ComparisonStringInterface)) {
$lef... | [
"private",
"function",
"validateSubSpec",
"(",
")",
"{",
"if",
"(",
"'!'",
"!=",
"$",
"this",
"->",
"currentSubSpec",
"[",
"'operator'",
"]",
"&&",
"'?'",
"!=",
"$",
"this",
"->",
"currentSubSpec",
"[",
"'operator'",
"]",
")",
"{",
"// skip left subTerm on o... | Validates a subSpec.
@return bool True if subSpec is valid and false if not | [
"Validates",
"a",
"subSpec",
"."
] | 29abbff5bec5e3bcfeeb07ba7bee94cc0a0a7f5e | https://github.com/MARCspec/File_MARC_Reference/blob/29abbff5bec5e3bcfeeb07ba7bee94cc0a0a7f5e/src/File_MARC_Reference.php#L274-L372 |
24,855 | MARCspec/File_MARC_Reference | src/File_MARC_Reference.php | File_MARC_Reference.referenceFieldsByTag | private function referenceFieldsByTag()
{
$tag = $this->spec['field']['tag'];
if ($this->cache->offsetExists($tag)) {
return $this->cache[$tag];
}
if ('LDR' !== $tag) {
$_fieldRef = $this->record->getFields($tag, true);
} else {
// tag = ... | php | private function referenceFieldsByTag()
{
$tag = $this->spec['field']['tag'];
if ($this->cache->offsetExists($tag)) {
return $this->cache[$tag];
}
if ('LDR' !== $tag) {
$_fieldRef = $this->record->getFields($tag, true);
} else {
// tag = ... | [
"private",
"function",
"referenceFieldsByTag",
"(",
")",
"{",
"$",
"tag",
"=",
"$",
"this",
"->",
"spec",
"[",
"'field'",
"]",
"[",
"'tag'",
"]",
";",
"if",
"(",
"$",
"this",
"->",
"cache",
"->",
"offsetExists",
"(",
"$",
"tag",
")",
")",
"{",
"ret... | Reference fields by field tag.
@return array Array of referred fields | [
"Reference",
"fields",
"by",
"field",
"tag",
"."
] | 29abbff5bec5e3bcfeeb07ba7bee94cc0a0a7f5e | https://github.com/MARCspec/File_MARC_Reference/blob/29abbff5bec5e3bcfeeb07ba7bee94cc0a0a7f5e/src/File_MARC_Reference.php#L379-L397 |
24,856 | MARCspec/File_MARC_Reference | src/File_MARC_Reference.php | File_MARC_Reference.referenceFields | private function referenceFields()
{
if ($this->fields = $this->cache->getData($this->spec['field'])) {
return $this->fields;
}
if (!$this->fields = $this->referenceFieldsByTag()) {
return;
}
/*
* filter by indizes
*/
if ($_in... | php | private function referenceFields()
{
if ($this->fields = $this->cache->getData($this->spec['field'])) {
return $this->fields;
}
if (!$this->fields = $this->referenceFieldsByTag()) {
return;
}
/*
* filter by indizes
*/
if ($_in... | [
"private",
"function",
"referenceFields",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"fields",
"=",
"$",
"this",
"->",
"cache",
"->",
"getData",
"(",
"$",
"this",
"->",
"spec",
"[",
"'field'",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"fie... | Reference fields. Filter by index and indicator.
@return array Array of referenced fields | [
"Reference",
"fields",
".",
"Filter",
"by",
"index",
"and",
"indicator",
"."
] | 29abbff5bec5e3bcfeeb07ba7bee94cc0a0a7f5e | https://github.com/MARCspec/File_MARC_Reference/blob/29abbff5bec5e3bcfeeb07ba7bee94cc0a0a7f5e/src/File_MARC_Reference.php#L404-L446 |
24,857 | MARCspec/File_MARC_Reference | src/File_MARC_Reference.php | File_MARC_Reference.referenceSubfields | private function referenceSubfields($currentSubfieldSpec)
{
$baseSubfieldSpec = $this->baseSpec.$currentSubfieldSpec->getBaseSpec();
if ($subfields = $this->cache->getData($this->currentSpec['field'], $currentSubfieldSpec)) {
return $subfields;
}
$_subfields = $this->fi... | php | private function referenceSubfields($currentSubfieldSpec)
{
$baseSubfieldSpec = $this->baseSpec.$currentSubfieldSpec->getBaseSpec();
if ($subfields = $this->cache->getData($this->currentSpec['field'], $currentSubfieldSpec)) {
return $subfields;
}
$_subfields = $this->fi... | [
"private",
"function",
"referenceSubfields",
"(",
"$",
"currentSubfieldSpec",
")",
"{",
"$",
"baseSubfieldSpec",
"=",
"$",
"this",
"->",
"baseSpec",
".",
"$",
"currentSubfieldSpec",
"->",
"getBaseSpec",
"(",
")",
";",
"if",
"(",
"$",
"subfields",
"=",
"$",
"... | Reference subfield contents and filter by index.
@param SubfieldInterface $currentSubfieldSpec The current subfield spec
@return array An array of referenced subfields | [
"Reference",
"subfield",
"contents",
"and",
"filter",
"by",
"index",
"."
] | 29abbff5bec5e3bcfeeb07ba7bee94cc0a0a7f5e | https://github.com/MARCspec/File_MARC_Reference/blob/29abbff5bec5e3bcfeeb07ba7bee94cc0a0a7f5e/src/File_MARC_Reference.php#L455-L490 |
24,858 | MARCspec/File_MARC_Reference | src/File_MARC_Reference.php | File_MARC_Reference.getIndexRange | private function getIndexRange($spec, $total)
{
$lastIndex = $total - 1;
$indexStart = $spec['indexStart'];
$indexEnd = $spec['indexEnd'];
if ('#' === $indexStart) {
if ('#' === $indexEnd or 0 === $indexEnd) {
return [$lastIndex];
}
... | php | private function getIndexRange($spec, $total)
{
$lastIndex = $total - 1;
$indexStart = $spec['indexStart'];
$indexEnd = $spec['indexEnd'];
if ('#' === $indexStart) {
if ('#' === $indexEnd or 0 === $indexEnd) {
return [$lastIndex];
}
... | [
"private",
"function",
"getIndexRange",
"(",
"$",
"spec",
",",
"$",
"total",
")",
"{",
"$",
"lastIndex",
"=",
"$",
"total",
"-",
"1",
";",
"$",
"indexStart",
"=",
"$",
"spec",
"[",
"'indexStart'",
"]",
";",
"$",
"indexEnd",
"=",
"$",
"spec",
"[",
"... | Calculates a range from indexStart and indexEnd.
@param array $spec The spec with possible indizes
@param int $total Total count of (sub)fields
@return array The range of indizes | [
"Calculates",
"a",
"range",
"from",
"indexStart",
"and",
"indexEnd",
"."
] | 29abbff5bec5e3bcfeeb07ba7bee94cc0a0a7f5e | https://github.com/MARCspec/File_MARC_Reference/blob/29abbff5bec5e3bcfeeb07ba7bee94cc0a0a7f5e/src/File_MARC_Reference.php#L500-L524 |
24,859 | MARCspec/File_MARC_Reference | src/File_MARC_Reference.php | File_MARC_Reference.ref | public function ref($spec, $value)
{
array_push($this->data, $value);
/*
* set content
*/
$value = $this->cache->getContents($spec, [$value]);
$this->content = array_merge($this->content, $value);
} | php | public function ref($spec, $value)
{
array_push($this->data, $value);
/*
* set content
*/
$value = $this->cache->getContents($spec, [$value]);
$this->content = array_merge($this->content, $value);
} | [
"public",
"function",
"ref",
"(",
"$",
"spec",
",",
"$",
"value",
")",
"{",
"array_push",
"(",
"$",
"this",
"->",
"data",
",",
"$",
"value",
")",
";",
"/*\n * set content\n */",
"$",
"value",
"=",
"$",
"this",
"->",
"cache",
"->",
"getConte... | Reference data and set content.
@param FieldInterface|SubfieldInterface $spec The corresponding spec
@param string|File_MARC_Field|File_MARC_Subfield $value The value to reference | [
"Reference",
"data",
"and",
"set",
"content",
"."
] | 29abbff5bec5e3bcfeeb07ba7bee94cc0a0a7f5e | https://github.com/MARCspec/File_MARC_Reference/blob/29abbff5bec5e3bcfeeb07ba7bee94cc0a0a7f5e/src/File_MARC_Reference.php#L532-L540 |
24,860 | xZ1mEFx/yii2-base | web/User.php | User.cannot | public function cannot($permissionName, $params = [], $allowCaching = TRUE)
{
return !$this->can($permissionName, $params, $allowCaching);
} | php | public function cannot($permissionName, $params = [], $allowCaching = TRUE)
{
return !$this->can($permissionName, $params, $allowCaching);
} | [
"public",
"function",
"cannot",
"(",
"$",
"permissionName",
",",
"$",
"params",
"=",
"[",
"]",
",",
"$",
"allowCaching",
"=",
"TRUE",
")",
"{",
"return",
"!",
"$",
"this",
"->",
"can",
"(",
"$",
"permissionName",
",",
"$",
"params",
",",
"$",
"allowC... | Checks if the user cannot perform the operation as specified by the given permission.
Note that you must configure "authManager" application component in order to use this method.
Otherwise it will always return false.
@param string|array $permissionName the name(s) of the permission (e.g. "edit post") that needs acc... | [
"Checks",
"if",
"the",
"user",
"cannot",
"perform",
"the",
"operation",
"as",
"specified",
"by",
"the",
"given",
"permission",
"."
] | f6633c08ccccb7eb5ac000dfae0db26cb2e0a76a | https://github.com/xZ1mEFx/yii2-base/blob/f6633c08ccccb7eb5ac000dfae0db26cb2e0a76a/web/User.php#L31-L34 |
24,861 | xZ1mEFx/yii2-base | web/User.php | User.can | public function can($permissionName, $params = [], $allowCaching = TRUE)
{
if (is_array($permissionName)) {
foreach (array_unique($permissionName) as $permissionNameItem) {
if (parent::can($permissionNameItem, $params, $allowCaching)) {
return TRUE;
... | php | public function can($permissionName, $params = [], $allowCaching = TRUE)
{
if (is_array($permissionName)) {
foreach (array_unique($permissionName) as $permissionNameItem) {
if (parent::can($permissionNameItem, $params, $allowCaching)) {
return TRUE;
... | [
"public",
"function",
"can",
"(",
"$",
"permissionName",
",",
"$",
"params",
"=",
"[",
"]",
",",
"$",
"allowCaching",
"=",
"TRUE",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"permissionName",
")",
")",
"{",
"foreach",
"(",
"array_unique",
"(",
"$",
"... | Checks if the user can perform the operation as specified by the given permission.
Note that you must configure "authManager" application component in order to use this method.
Otherwise it will always return false.
@param string|array $permissionName the name(s) of the permission (e.g. "edit post") that needs access... | [
"Checks",
"if",
"the",
"user",
"can",
"perform",
"the",
"operation",
"as",
"specified",
"by",
"the",
"given",
"permission",
"."
] | f6633c08ccccb7eb5ac000dfae0db26cb2e0a76a | https://github.com/xZ1mEFx/yii2-base/blob/f6633c08ccccb7eb5ac000dfae0db26cb2e0a76a/web/User.php#L56-L67 |
24,862 | enikeishik/ufoframework | src/Ufo/Core/Config.php | Config.load | public function load(string $configPath, $overwrite = false): void
{
if (!file_exists($configPath)) {
return;
}
$config = include $configPath;
if (!is_array($config) && !is_object($config)) {
return;
}
if (is_object($config)) {
$con... | php | public function load(string $configPath, $overwrite = false): void
{
if (!file_exists($configPath)) {
return;
}
$config = include $configPath;
if (!is_array($config) && !is_object($config)) {
return;
}
if (is_object($config)) {
$con... | [
"public",
"function",
"load",
"(",
"string",
"$",
"configPath",
",",
"$",
"overwrite",
"=",
"false",
")",
":",
"void",
"{",
"if",
"(",
"!",
"file_exists",
"(",
"$",
"configPath",
")",
")",
"{",
"return",
";",
"}",
"$",
"config",
"=",
"include",
"$",
... | Loads configuration from configuration file.
@param string $configPath
@param bool $overwrite = false | [
"Loads",
"configuration",
"from",
"configuration",
"file",
"."
] | fb44461bcb0506dbc3257724a2281f756594f62f | https://github.com/enikeishik/ufoframework/blob/fb44461bcb0506dbc3257724a2281f756594f62f/src/Ufo/Core/Config.php#L162-L175 |
24,863 | enikeishik/ufoframework | src/Ufo/Core/Config.php | Config.loadWithDefault | public function loadWithDefault(string $configPath, string $defaultConfigPath): void
{
if (!file_exists($configPath)) {
return;
}
$configDefault = include $defaultConfigPath;
$config = include $configPath;
if (!is_array($configDefault) && !is_array($config)) {
... | php | public function loadWithDefault(string $configPath, string $defaultConfigPath): void
{
if (!file_exists($configPath)) {
return;
}
$configDefault = include $defaultConfigPath;
$config = include $configPath;
if (!is_array($configDefault) && !is_array($config)) {
... | [
"public",
"function",
"loadWithDefault",
"(",
"string",
"$",
"configPath",
",",
"string",
"$",
"defaultConfigPath",
")",
":",
"void",
"{",
"if",
"(",
"!",
"file_exists",
"(",
"$",
"configPath",
")",
")",
"{",
"return",
";",
"}",
"$",
"configDefault",
"=",
... | Loads configuration from configuration file, and from default configuration file.
@param string $configPath
@param string $defaultConfigPath | [
"Loads",
"configuration",
"from",
"configuration",
"file",
"and",
"from",
"default",
"configuration",
"file",
"."
] | fb44461bcb0506dbc3257724a2281f756594f62f | https://github.com/enikeishik/ufoframework/blob/fb44461bcb0506dbc3257724a2281f756594f62f/src/Ufo/Core/Config.php#L182-L193 |
24,864 | enikeishik/ufoframework | src/Ufo/Core/Config.php | Config.loadArray | public function loadArray(array $config, $overwrite = false): void
{
foreach ($config as $name => $value) {
if (!$overwrite && property_exists($this, $name)) {
continue;
}
$this->$name = $value;
}
} | php | public function loadArray(array $config, $overwrite = false): void
{
foreach ($config as $name => $value) {
if (!$overwrite && property_exists($this, $name)) {
continue;
}
$this->$name = $value;
}
} | [
"public",
"function",
"loadArray",
"(",
"array",
"$",
"config",
",",
"$",
"overwrite",
"=",
"false",
")",
":",
"void",
"{",
"foreach",
"(",
"$",
"config",
"as",
"$",
"name",
"=>",
"$",
"value",
")",
"{",
"if",
"(",
"!",
"$",
"overwrite",
"&&",
"pro... | Loads configuration from array.
@param array $config
@param bool $overwrite = false | [
"Loads",
"configuration",
"from",
"array",
"."
] | fb44461bcb0506dbc3257724a2281f756594f62f | https://github.com/enikeishik/ufoframework/blob/fb44461bcb0506dbc3257724a2281f756594f62f/src/Ufo/Core/Config.php#L200-L208 |
24,865 | enikeishik/ufoframework | src/Ufo/Core/Config.php | Config.loadFromIni | public function loadFromIni(string $iniPath, bool $overwrite = false): void
{
if (!file_exists($iniPath)) {
return;
}
$iniArr = null;
try {
$iniArr = parse_ini_file($iniPath, false, INI_SCANNER_TYPED);
} catch (\Throwable $e) {
}
... | php | public function loadFromIni(string $iniPath, bool $overwrite = false): void
{
if (!file_exists($iniPath)) {
return;
}
$iniArr = null;
try {
$iniArr = parse_ini_file($iniPath, false, INI_SCANNER_TYPED);
} catch (\Throwable $e) {
}
... | [
"public",
"function",
"loadFromIni",
"(",
"string",
"$",
"iniPath",
",",
"bool",
"$",
"overwrite",
"=",
"false",
")",
":",
"void",
"{",
"if",
"(",
"!",
"file_exists",
"(",
"$",
"iniPath",
")",
")",
"{",
"return",
";",
"}",
"$",
"iniArr",
"=",
"null",... | Loads configuration from INI file.
@param string $iniPath
@param bool $overwrite = false | [
"Loads",
"configuration",
"from",
"INI",
"file",
"."
] | fb44461bcb0506dbc3257724a2281f756594f62f | https://github.com/enikeishik/ufoframework/blob/fb44461bcb0506dbc3257724a2281f756594f62f/src/Ufo/Core/Config.php#L215-L237 |
24,866 | sndsgd/http | src/http/data/decoder/MultipartDataDecoder.php | MultipartDataDecoder.fieldsRemain | protected function fieldsRemain()
{
$bufferlen = strlen($this->buffer);
$minlen = strlen($this->lastBoundary);
# if the buffer is too short to contain the last boundary
# read enough bytes into the buffer to allow for a strpos test
if ($bufferlen < $minlen) {
if ... | php | protected function fieldsRemain()
{
$bufferlen = strlen($this->buffer);
$minlen = strlen($this->lastBoundary);
# if the buffer is too short to contain the last boundary
# read enough bytes into the buffer to allow for a strpos test
if ($bufferlen < $minlen) {
if ... | [
"protected",
"function",
"fieldsRemain",
"(",
")",
"{",
"$",
"bufferlen",
"=",
"strlen",
"(",
"$",
"this",
"->",
"buffer",
")",
";",
"$",
"minlen",
"=",
"strlen",
"(",
"$",
"this",
"->",
"lastBoundary",
")",
";",
"# if the buffer is too short to contain the la... | Determine if any more fields remain in the stream
@return bool | [
"Determine",
"if",
"any",
"more",
"fields",
"remain",
"in",
"the",
"stream"
] | e7f82010a66c6d3241a24ea82baf4593130c723b | https://github.com/sndsgd/http/blob/e7f82010a66c6d3241a24ea82baf4593130c723b/src/http/data/decoder/MultipartDataDecoder.php#L141-L170 |
24,867 | sndsgd/http | src/http/data/decoder/MultipartDataDecoder.php | MultipartDataDecoder.getValueFromField | private function getValueFromField()
{
$position = $this->readUntil($this->boundary);
# there is always a newline after the value and before the boundary
# exclude that newline from the value
$value = substr($this->buffer, 0, $position - 2);
# update the buffer to exclude t... | php | private function getValueFromField()
{
$position = $this->readUntil($this->boundary);
# there is always a newline after the value and before the boundary
# exclude that newline from the value
$value = substr($this->buffer, 0, $position - 2);
# update the buffer to exclude t... | [
"private",
"function",
"getValueFromField",
"(",
")",
"{",
"$",
"position",
"=",
"$",
"this",
"->",
"readUntil",
"(",
"$",
"this",
"->",
"boundary",
")",
";",
"# there is always a newline after the value and before the boundary",
"# exclude that newline from the value",
"... | Get the value of the current field in the input stream
@return string | [
"Get",
"the",
"value",
"of",
"the",
"current",
"field",
"in",
"the",
"input",
"stream"
] | e7f82010a66c6d3241a24ea82baf4593130c723b | https://github.com/sndsgd/http/blob/e7f82010a66c6d3241a24ea82baf4593130c723b/src/http/data/decoder/MultipartDataDecoder.php#L245-L257 |
24,868 | siriusSupreme/sirius-support | src/Str.php | Str.replaceFirst | public static function replaceFirst($search, $replace, $subject)
{
if ($search == '') {
return $subject;
}
$position = mb_strpos($subject, $search);
if ($position !== false) {
return mb_substr($subject, 0, $position).$replace.mb_substr($subject, $position + ... | php | public static function replaceFirst($search, $replace, $subject)
{
if ($search == '') {
return $subject;
}
$position = mb_strpos($subject, $search);
if ($position !== false) {
return mb_substr($subject, 0, $position).$replace.mb_substr($subject, $position + ... | [
"public",
"static",
"function",
"replaceFirst",
"(",
"$",
"search",
",",
"$",
"replace",
",",
"$",
"subject",
")",
"{",
"if",
"(",
"$",
"search",
"==",
"''",
")",
"{",
"return",
"$",
"subject",
";",
"}",
"$",
"position",
"=",
"mb_strpos",
"(",
"$",
... | Replace the first occurrence of a given value in the string.
@param string $search
@param string $replace
@param string $subject
@return string | [
"Replace",
"the",
"first",
"occurrence",
"of",
"a",
"given",
"value",
"in",
"the",
"string",
"."
] | 80436cf8ae7b95d96bb34cd7297be00c77fc1033 | https://github.com/siriusSupreme/sirius-support/blob/80436cf8ae7b95d96bb34cd7297be00c77fc1033/src/Str.php#L327-L340 |
24,869 | comodojo/foundation | src/Comodojo/Foundation/Logging/Levels.php | Levels.getLevel | public static function getLevel($level = null) {
$level = strtoupper($level);
if ( array_key_exists($level, self::$levels) ) return self::$levels[$level];
return self::$levels[self::DEFAULT_LOG_LEVEL];
} | php | public static function getLevel($level = null) {
$level = strtoupper($level);
if ( array_key_exists($level, self::$levels) ) return self::$levels[$level];
return self::$levels[self::DEFAULT_LOG_LEVEL];
} | [
"public",
"static",
"function",
"getLevel",
"(",
"$",
"level",
"=",
"null",
")",
"{",
"$",
"level",
"=",
"strtoupper",
"(",
"$",
"level",
")",
";",
"if",
"(",
"array_key_exists",
"(",
"$",
"level",
",",
"self",
"::",
"$",
"levels",
")",
")",
"return"... | Map provided log level to level code
@param string $level
@return integer | [
"Map",
"provided",
"log",
"level",
"to",
"level",
"code"
] | 21ed690e81763ed9e1ef7721a7eb4fcc0fcefc1a | https://github.com/comodojo/foundation/blob/21ed690e81763ed9e1ef7721a7eb4fcc0fcefc1a/src/Comodojo/Foundation/Logging/Levels.php#L44-L52 |
24,870 | PatrolServer/patrolsdk-php | lib/PatrolModel.php | PatrolModel._get | protected function _get($url, $parameters = null, $scopes = [], $class = null) {
$client = new HttpClient($this->patrol, 'get', $url, $parameters);
$client->setScopes($scopes);
$data = $client->response();
if (isset($data['error'])) {
$this->_error($data);
}
... | php | protected function _get($url, $parameters = null, $scopes = [], $class = null) {
$client = new HttpClient($this->patrol, 'get', $url, $parameters);
$client->setScopes($scopes);
$data = $client->response();
if (isset($data['error'])) {
$this->_error($data);
}
... | [
"protected",
"function",
"_get",
"(",
"$",
"url",
",",
"$",
"parameters",
"=",
"null",
",",
"$",
"scopes",
"=",
"[",
"]",
",",
"$",
"class",
"=",
"null",
")",
"{",
"$",
"client",
"=",
"new",
"HttpClient",
"(",
"$",
"this",
"->",
"patrol",
",",
"'... | Perform a GET request based on this model
@param string $url
@param array $parameters
@param array $scopes
@param string $class The class type where the result should be casted to
@return PatrolSdk\Model | [
"Perform",
"a",
"GET",
"request",
"based",
"on",
"this",
"model"
] | 2451f0d2ba2bb5bc3d7e47cfc110f7f272620db2 | https://github.com/PatrolServer/patrolsdk-php/blob/2451f0d2ba2bb5bc3d7e47cfc110f7f272620db2/lib/PatrolModel.php#L32-L47 |
24,871 | PatrolServer/patrolsdk-php | lib/PatrolModel.php | PatrolModel._post | protected function _post($url, $data = [], $class = null) {
$client = new HttpClient($this->patrol, 'post', $url, $data);
$data = $client->response();
if (isset($data['error'])) {
$this->_error($data);
}
if (!isset($data['data'])) {
return $data;
... | php | protected function _post($url, $data = [], $class = null) {
$client = new HttpClient($this->patrol, 'post', $url, $data);
$data = $client->response();
if (isset($data['error'])) {
$this->_error($data);
}
if (!isset($data['data'])) {
return $data;
... | [
"protected",
"function",
"_post",
"(",
"$",
"url",
",",
"$",
"data",
"=",
"[",
"]",
",",
"$",
"class",
"=",
"null",
")",
"{",
"$",
"client",
"=",
"new",
"HttpClient",
"(",
"$",
"this",
"->",
"patrol",
",",
"'post'",
",",
"$",
"url",
",",
"$",
"... | Perform a POST request based on this model
@param string $url
@param array $data
@param string $class The class type where the result should be casted to
@return PatrolSdk\Model | [
"Perform",
"a",
"POST",
"request",
"based",
"on",
"this",
"model"
] | 2451f0d2ba2bb5bc3d7e47cfc110f7f272620db2 | https://github.com/PatrolServer/patrolsdk-php/blob/2451f0d2ba2bb5bc3d7e47cfc110f7f272620db2/lib/PatrolModel.php#L58-L75 |
24,872 | tonis-io-legacy/tonis | src/Http/Response.php | Response.redirectToRoute | public function redirectToRoute($route, array $params = [], $permanent = false)
{
$map = $this->app()->getRouteMap();
$url = $map->assemble($route, $params);
return $this->redirect($url, $permanent);
} | php | public function redirectToRoute($route, array $params = [], $permanent = false)
{
$map = $this->app()->getRouteMap();
$url = $map->assemble($route, $params);
return $this->redirect($url, $permanent);
} | [
"public",
"function",
"redirectToRoute",
"(",
"$",
"route",
",",
"array",
"$",
"params",
"=",
"[",
"]",
",",
"$",
"permanent",
"=",
"false",
")",
"{",
"$",
"map",
"=",
"$",
"this",
"->",
"app",
"(",
")",
"->",
"getRouteMap",
"(",
")",
";",
"$",
"... | Redirects to a named route.
@see \Tonis\Http\Response::redirect()
@param string $route
@param array $params
@param bool|false $permanent
@return ResponseInterface | [
"Redirects",
"to",
"a",
"named",
"route",
"."
] | 8371a277a94232433d882aaf37a85cd469daf501 | https://github.com/tonis-io-legacy/tonis/blob/8371a277a94232433d882aaf37a85cd469daf501/src/Http/Response.php#L60-L66 |
24,873 | PenoaksDev/Milky-Framework | src/Milky/Mail/TransportManager.php | TransportManager.getHttpClient | protected function getHttpClient( $config )
{
$guzzleConfig = Arr::get( $config, 'guzzle', [] );
return new HttpClient( Arr::add( $guzzleConfig, 'connect_timeout', 60 ) );
} | php | protected function getHttpClient( $config )
{
$guzzleConfig = Arr::get( $config, 'guzzle', [] );
return new HttpClient( Arr::add( $guzzleConfig, 'connect_timeout', 60 ) );
} | [
"protected",
"function",
"getHttpClient",
"(",
"$",
"config",
")",
"{",
"$",
"guzzleConfig",
"=",
"Arr",
"::",
"get",
"(",
"$",
"config",
",",
"'guzzle'",
",",
"[",
"]",
")",
";",
"return",
"new",
"HttpClient",
"(",
"Arr",
"::",
"add",
"(",
"$",
"guz... | Get a fresh Guzzle HTTP client instance.
@param array $config
@return HttpClient | [
"Get",
"a",
"fresh",
"Guzzle",
"HTTP",
"client",
"instance",
"."
] | 8afd7156610a70371aa5b1df50b8a212bf7b142c | https://github.com/PenoaksDev/Milky-Framework/blob/8afd7156610a70371aa5b1df50b8a212bf7b142c/src/Milky/Mail/TransportManager.php#L156-L161 |
24,874 | pluf/tenant | src/Tenant/Views/Resource.php | Tenant_Views_Resource.download | public function download($request, $match)
{
// GET data
$resource = Pluf_Shortcuts_GetObjectOr404('Tenant_Resource', $match['modelId']);
// Do
$resource->downloads += 1;
$resource->update();
return new Pluf_HTTP_Response_File($resource->getAbsloutPath(), $resource->m... | php | public function download($request, $match)
{
// GET data
$resource = Pluf_Shortcuts_GetObjectOr404('Tenant_Resource', $match['modelId']);
// Do
$resource->downloads += 1;
$resource->update();
return new Pluf_HTTP_Response_File($resource->getAbsloutPath(), $resource->m... | [
"public",
"function",
"download",
"(",
"$",
"request",
",",
"$",
"match",
")",
"{",
"// GET data",
"$",
"resource",
"=",
"Pluf_Shortcuts_GetObjectOr404",
"(",
"'Tenant_Resource'",
",",
"$",
"match",
"[",
"'modelId'",
"]",
")",
";",
"// Do",
"$",
"resource",
... | Download a resource
@param Pluf_HTTP_Request $request
@param array $match
@return Pluf_HTTP_Response_File | [
"Download",
"a",
"resource"
] | a06359c52b9a257b5a0a186264e8770acfc54b73 | https://github.com/pluf/tenant/blob/a06359c52b9a257b5a0a186264e8770acfc54b73/src/Tenant/Views/Resource.php#L37-L45 |
24,875 | hiqdev/minii-caching | src/ApcCache.php | ApcCache.setValues | protected function setValues($data, $duration)
{
$result = apc_store($data, null, $duration);
return is_array($result) ? array_keys($result) : [];
} | php | protected function setValues($data, $duration)
{
$result = apc_store($data, null, $duration);
return is_array($result) ? array_keys($result) : [];
} | [
"protected",
"function",
"setValues",
"(",
"$",
"data",
",",
"$",
"duration",
")",
"{",
"$",
"result",
"=",
"apc_store",
"(",
"$",
"data",
",",
"null",
",",
"$",
"duration",
")",
";",
"return",
"is_array",
"(",
"$",
"result",
")",
"?",
"array_keys",
... | Stores multiple key-value pairs in cache.
@param array $data array where key corresponds to cache key while value
@param integer $duration the number of seconds in which the cached values will expire. 0 means never expire.
@return array array of failed keys | [
"Stores",
"multiple",
"key",
"-",
"value",
"pairs",
"in",
"cache",
"."
] | 04c3f810a4af43b53855ee9c5e3ef6455080b538 | https://github.com/hiqdev/minii-caching/blob/04c3f810a4af43b53855ee9c5e3ef6455080b538/src/ApcCache.php#L82-L86 |
24,876 | hiqdev/minii-caching | src/ApcCache.php | ApcCache.addValues | protected function addValues($data, $duration)
{
$result = apc_add($data, null, $duration);
return is_array($result) ? array_keys($result) : [];
} | php | protected function addValues($data, $duration)
{
$result = apc_add($data, null, $duration);
return is_array($result) ? array_keys($result) : [];
} | [
"protected",
"function",
"addValues",
"(",
"$",
"data",
",",
"$",
"duration",
")",
"{",
"$",
"result",
"=",
"apc_add",
"(",
"$",
"data",
",",
"null",
",",
"$",
"duration",
")",
";",
"return",
"is_array",
"(",
"$",
"result",
")",
"?",
"array_keys",
"(... | Adds multiple key-value pairs to cache.
@param array $data array where key corresponds to cache key while value is the value stored
@param integer $duration the number of seconds in which the cached values will expire. 0 means never expire.
@return array array of failed keys | [
"Adds",
"multiple",
"key",
"-",
"value",
"pairs",
"to",
"cache",
"."
] | 04c3f810a4af43b53855ee9c5e3ef6455080b538 | https://github.com/hiqdev/minii-caching/blob/04c3f810a4af43b53855ee9c5e3ef6455080b538/src/ApcCache.php#L107-L111 |
24,877 | rutger-speksnijder/restphp | src/RestPHP/Response/ResponseFactory.php | ResponseFactory.build | public function build($type, $data, $hypertextRoutes = [])
{
if (!isset($this->types[$type])) {
throw new \Exception("Unknown response type.");
}
return new $this->types[$type]($data, $hypertextRoutes);
} | php | public function build($type, $data, $hypertextRoutes = [])
{
if (!isset($this->types[$type])) {
throw new \Exception("Unknown response type.");
}
return new $this->types[$type]($data, $hypertextRoutes);
} | [
"public",
"function",
"build",
"(",
"$",
"type",
",",
"$",
"data",
",",
"$",
"hypertextRoutes",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"types",
"[",
"$",
"type",
"]",
")",
")",
"{",
"throw",
"new",
"\\",
"Exce... | Builds the response object.
@param string $type The type of response to build.
@param mixed $data The response data.
@param optional array $hypertextRoutes An array of hypertext routes.
@throws Exception Throws an exception for unknown response types.
@return \RestPHP\Response The created object. | [
"Builds",
"the",
"response",
"object",
"."
] | 326a7c0d79b266bbdd8a27ff1c8021caf9d28a3d | https://github.com/rutger-speksnijder/restphp/blob/326a7c0d79b266bbdd8a27ff1c8021caf9d28a3d/src/RestPHP/Response/ResponseFactory.php#L52-L58 |
24,878 | TeaLabs/collections | src/Collection.php | Collection.default | public function default($key, $default = null)
{
if($this->has($key))
return $this->get($key);
$this->put($key, $default);
return $default;
} | php | public function default($key, $default = null)
{
if($this->has($key))
return $this->get($key);
$this->put($key, $default);
return $default;
} | [
"public",
"function",
"default",
"(",
"$",
"key",
",",
"$",
"default",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"has",
"(",
"$",
"key",
")",
")",
"return",
"$",
"this",
"->",
"get",
"(",
"$",
"key",
")",
";",
"$",
"this",
"->",
"p... | If key is in the collection, return its value.
If not, insert key with the given default as value and return default.
@param string $key
@param mixed $default
@return mixed | [
"If",
"key",
"is",
"in",
"the",
"collection",
"return",
"its",
"value",
".",
"If",
"not",
"insert",
"key",
"with",
"the",
"given",
"default",
"as",
"value",
"and",
"return",
"default",
"."
] | 5d8885b2799791c0bcbff4e6cbacddb270b4288e | https://github.com/TeaLabs/collections/blob/5d8885b2799791c0bcbff4e6cbacddb270b4288e/src/Collection.php#L30-L38 |
24,879 | stevenliebregt/crispysystem | src/Database/Model.php | Model.showTables | public function showTables()
{
$sql = 'SHOW TABLES';
$query = $this->pdo->prepare($sql);
$query->execute();
return $query->fetchAll(PDO::FETCH_ASSOC);
} | php | public function showTables()
{
$sql = 'SHOW TABLES';
$query = $this->pdo->prepare($sql);
$query->execute();
return $query->fetchAll(PDO::FETCH_ASSOC);
} | [
"public",
"function",
"showTables",
"(",
")",
"{",
"$",
"sql",
"=",
"'SHOW TABLES'",
";",
"$",
"query",
"=",
"$",
"this",
"->",
"pdo",
"->",
"prepare",
"(",
"$",
"sql",
")",
";",
"$",
"query",
"->",
"execute",
"(",
")",
";",
"return",
"$",
"query",... | Run a `SHOW TABLES` query and return the results
@return array Result of the `SHOW TABLES` query
@since 1.1.4 | [
"Run",
"a",
"SHOW",
"TABLES",
"query",
"and",
"return",
"the",
"results"
] | 06547dae100dae1023a93ec903f2d2abacce9aec | https://github.com/stevenliebregt/crispysystem/blob/06547dae100dae1023a93ec903f2d2abacce9aec/src/Database/Model.php#L56-L63 |
24,880 | stevenliebregt/crispysystem | src/Database/Model.php | Model.getAll | public function getAll()
{
$fields = implode(', ', $this->fields);
$sql = 'SELECT ' . $fields . ' FROM ' . $this->table;
$query = $this->pdo->prepare($sql);
$query->execute();
return $query->fetchAll(PDO::FETCH_ASSOC);
} | php | public function getAll()
{
$fields = implode(', ', $this->fields);
$sql = 'SELECT ' . $fields . ' FROM ' . $this->table;
$query = $this->pdo->prepare($sql);
$query->execute();
return $query->fetchAll(PDO::FETCH_ASSOC);
} | [
"public",
"function",
"getAll",
"(",
")",
"{",
"$",
"fields",
"=",
"implode",
"(",
"', '",
",",
"$",
"this",
"->",
"fields",
")",
";",
"$",
"sql",
"=",
"'SELECT '",
".",
"$",
"fields",
".",
"' FROM '",
".",
"$",
"this",
"->",
"table",
";",
"$",
"... | Run a SELECT all query
@return array Query result
@since 1.1.4 | [
"Run",
"a",
"SELECT",
"all",
"query"
] | 06547dae100dae1023a93ec903f2d2abacce9aec | https://github.com/stevenliebregt/crispysystem/blob/06547dae100dae1023a93ec903f2d2abacce9aec/src/Database/Model.php#L70-L78 |
24,881 | stevenliebregt/crispysystem | src/Database/Model.php | Model.getOneById | public function getOneById($id)
{
$id = (string)$id;
$fields = implode(', ', $this->fields);
$sql = 'SELECT ' . $fields . ' FROM ' . $this->table . ' WHERE ' . $this->table . '.id = :id';
$query = $this->pdo->prepare($sql);
$query->bindParam(':id', $id);
$query->exec... | php | public function getOneById($id)
{
$id = (string)$id;
$fields = implode(', ', $this->fields);
$sql = 'SELECT ' . $fields . ' FROM ' . $this->table . ' WHERE ' . $this->table . '.id = :id';
$query = $this->pdo->prepare($sql);
$query->bindParam(':id', $id);
$query->exec... | [
"public",
"function",
"getOneById",
"(",
"$",
"id",
")",
"{",
"$",
"id",
"=",
"(",
"string",
")",
"$",
"id",
";",
"$",
"fields",
"=",
"implode",
"(",
"', '",
",",
"$",
"this",
"->",
"fields",
")",
";",
"$",
"sql",
"=",
"'SELECT '",
".",
"$",
"f... | Run a SELECT query by ID
@param int|string $id The id of the record you want to retrieve
@return mixed Query result
@since 1.1.4 | [
"Run",
"a",
"SELECT",
"query",
"by",
"ID"
] | 06547dae100dae1023a93ec903f2d2abacce9aec | https://github.com/stevenliebregt/crispysystem/blob/06547dae100dae1023a93ec903f2d2abacce9aec/src/Database/Model.php#L86-L97 |
24,882 | stevenliebregt/crispysystem | src/Database/Model.php | Model.insert | public function insert(array $values) : int
{
$fields = $this->fields;
array_shift($fields);
$sql = 'INSERT INTO `' . $this->table . '` (' . implode(', ', $fields) . ') VALUES (:' . implode(', :', $fields) . ')';
$query = $this->pdo->prepare($sql);
foreach ($values as $key =... | php | public function insert(array $values) : int
{
$fields = $this->fields;
array_shift($fields);
$sql = 'INSERT INTO `' . $this->table . '` (' . implode(', ', $fields) . ') VALUES (:' . implode(', :', $fields) . ')';
$query = $this->pdo->prepare($sql);
foreach ($values as $key =... | [
"public",
"function",
"insert",
"(",
"array",
"$",
"values",
")",
":",
"int",
"{",
"$",
"fields",
"=",
"$",
"this",
"->",
"fields",
";",
"array_shift",
"(",
"$",
"fields",
")",
";",
"$",
"sql",
"=",
"'INSERT INTO `'",
".",
"$",
"this",
"->",
"table",... | Insert a new record in the database
@param array $values Values to insert, except id, since it is expected to be AUTO_INCREMENT
@return int Return the last inserted id
@since 1.1.4 | [
"Insert",
"a",
"new",
"record",
"in",
"the",
"database"
] | 06547dae100dae1023a93ec903f2d2abacce9aec | https://github.com/stevenliebregt/crispysystem/blob/06547dae100dae1023a93ec903f2d2abacce9aec/src/Database/Model.php#L105-L118 |
24,883 | stevenliebregt/crispysystem | src/Database/Model.php | Model.deleteById | public function deleteById($id) : int
{
$sql = 'DELETE FROM `' . $this->table . '` WHERE ';
// Assign ids
if (is_array($id)) {
$i = 0;
foreach ($id as $_id) {
if ($i === 0) {
$sql .= ' id=:id' . $i;
} else {
... | php | public function deleteById($id) : int
{
$sql = 'DELETE FROM `' . $this->table . '` WHERE ';
// Assign ids
if (is_array($id)) {
$i = 0;
foreach ($id as $_id) {
if ($i === 0) {
$sql .= ' id=:id' . $i;
} else {
... | [
"public",
"function",
"deleteById",
"(",
"$",
"id",
")",
":",
"int",
"{",
"$",
"sql",
"=",
"'DELETE FROM `'",
".",
"$",
"this",
"->",
"table",
".",
"'` WHERE '",
";",
"// Assign ids",
"if",
"(",
"is_array",
"(",
"$",
"id",
")",
")",
"{",
"$",
"i",
... | Run a DELETE query
@param string|array $id Id(s) to delete
@return int Return affected rows
@since 1.1.4 | [
"Run",
"a",
"DELETE",
"query"
] | 06547dae100dae1023a93ec903f2d2abacce9aec | https://github.com/stevenliebregt/crispysystem/blob/06547dae100dae1023a93ec903f2d2abacce9aec/src/Database/Model.php#L175-L203 |
24,884 | Wedeto/FileFormats | src/XML/Reader.php | Reader.readFile | public function readFile(string $file_name)
{
$reader = new XMLReader;
$reader->open($file_name);
$data = $this->toArray($reader);
$reader->close();
return $data;
} | php | public function readFile(string $file_name)
{
$reader = new XMLReader;
$reader->open($file_name);
$data = $this->toArray($reader);
$reader->close();
return $data;
} | [
"public",
"function",
"readFile",
"(",
"string",
"$",
"file_name",
")",
"{",
"$",
"reader",
"=",
"new",
"XMLReader",
";",
"$",
"reader",
"->",
"open",
"(",
"$",
"file_name",
")",
";",
"$",
"data",
"=",
"$",
"this",
"->",
"toArray",
"(",
"$",
"reader"... | Read a XML file into an array
@param string $filename The file to read
@return array The array representation of the XML Data | [
"Read",
"a",
"XML",
"file",
"into",
"an",
"array"
] | 65b71fbd38a2ee6b504622aca4f4047ce9d31e9f | https://github.com/Wedeto/FileFormats/blob/65b71fbd38a2ee6b504622aca4f4047ce9d31e9f/src/XML/Reader.php#L42-L51 |
24,885 | Wedeto/FileFormats | src/XML/Reader.php | Reader.readString | public function readString(string $data)
{
$reader = new XMLReader;
$reader->XML($data);
$contents = $this->toArray($reader);
$reader->close();
return $contents;
} | php | public function readString(string $data)
{
$reader = new XMLReader;
$reader->XML($data);
$contents = $this->toArray($reader);
$reader->close();
return $contents;
} | [
"public",
"function",
"readString",
"(",
"string",
"$",
"data",
")",
"{",
"$",
"reader",
"=",
"new",
"XMLReader",
";",
"$",
"reader",
"->",
"XML",
"(",
"$",
"data",
")",
";",
"$",
"contents",
"=",
"$",
"this",
"->",
"toArray",
"(",
"$",
"reader",
"... | Read XML Data from a string
@param string $data The data to read
@return array the array representation of the XML data | [
"Read",
"XML",
"Data",
"from",
"a",
"string"
] | 65b71fbd38a2ee6b504622aca4f4047ce9d31e9f | https://github.com/Wedeto/FileFormats/blob/65b71fbd38a2ee6b504622aca4f4047ce9d31e9f/src/XML/Reader.php#L59-L68 |
24,886 | Wedeto/FileFormats | src/XML/Reader.php | Reader.parseTree | public function parseTree(XMLReader $reader)
{
libxml_use_internal_errors(true);
$root = new XMLNode;
$cur = null;
$read_anything = false;
while ($reader->read())
{
$read_anything = true;
if ($reader->nodeType === XMLReader::ELEMENT)
... | php | public function parseTree(XMLReader $reader)
{
libxml_use_internal_errors(true);
$root = new XMLNode;
$cur = null;
$read_anything = false;
while ($reader->read())
{
$read_anything = true;
if ($reader->nodeType === XMLReader::ELEMENT)
... | [
"public",
"function",
"parseTree",
"(",
"XMLReader",
"$",
"reader",
")",
"{",
"libxml_use_internal_errors",
"(",
"true",
")",
";",
"$",
"root",
"=",
"new",
"XMLNode",
";",
"$",
"cur",
"=",
"null",
";",
"$",
"read_anything",
"=",
"false",
";",
"while",
"(... | Parse the XML into an array. This will add all nodes and attributes to
a tree of XML nodes. This is only basic XML flattening, for full-blown
XML support be sure to use a more fully featured solution like SimpleXML
@param XMLReader $reader The reader reading the XML
@return XMLNode The root node | [
"Parse",
"the",
"XML",
"into",
"an",
"array",
".",
"This",
"will",
"add",
"all",
"nodes",
"and",
"attributes",
"to",
"a",
"tree",
"of",
"XML",
"nodes",
".",
"This",
"is",
"only",
"basic",
"XML",
"flattening",
"for",
"full",
"-",
"blown",
"XML",
"suppor... | 65b71fbd38a2ee6b504622aca4f4047ce9d31e9f | https://github.com/Wedeto/FileFormats/blob/65b71fbd38a2ee6b504622aca4f4047ce9d31e9f/src/XML/Reader.php#L93-L152 |
24,887 | ciims/ciims-modules-api | ApiModule.php | ApiModule.init | public function init()
{
// Autoload the models and components directory
$this->setImport(array(
'api.models.*',
'api.components.*',
));
// Disable layout rendering
$this->layout = false;
// Disable logging for the... | php | public function init()
{
// Autoload the models and components directory
$this->setImport(array(
'api.models.*',
'api.components.*',
));
// Disable layout rendering
$this->layout = false;
// Disable logging for the... | [
"public",
"function",
"init",
"(",
")",
"{",
"// Autoload the models and components directory \r",
"$",
"this",
"->",
"setImport",
"(",
"array",
"(",
"'api.models.*'",
",",
"'api.components.*'",
",",
")",
")",
";",
"// Disable layout rendering\r",
"$",
"this",
"->",
... | Yii Init method
Implements basic configuration for module | [
"Yii",
"Init",
"method",
"Implements",
"basic",
"configuration",
"for",
"module"
] | 4351855328da0b112ac27bde7e7e07e212be8689 | https://github.com/ciims/ciims-modules-api/blob/4351855328da0b112ac27bde7e7e07e212be8689/ApiModule.php#L24-L52 |
24,888 | MatiasNAmendola/slimpower-auth-core | src/Abstracts/AuthenticationMiddleware.php | AuthenticationMiddleware.call | public function call() {
/* If rules say we should not authenticate call next and return. */
if (false === $this->shouldAuthenticate()) {
$this->next->call();
return;
}
$this->checkSecure();
$freePass = $this->hasFreePass();
/* If userdata canno... | php | public function call() {
/* If rules say we should not authenticate call next and return. */
if (false === $this->shouldAuthenticate()) {
$this->next->call();
return;
}
$this->checkSecure();
$freePass = $this->hasFreePass();
/* If userdata canno... | [
"public",
"function",
"call",
"(",
")",
"{",
"/* If rules say we should not authenticate call next and return. */",
"if",
"(",
"false",
"===",
"$",
"this",
"->",
"shouldAuthenticate",
"(",
")",
")",
"{",
"$",
"this",
"->",
"next",
"->",
"call",
"(",
")",
";",
... | Call the middleware | [
"Call",
"the",
"middleware"
] | 550ab85d871de8451cb242eaa17f4041ff320b7c | https://github.com/MatiasNAmendola/slimpower-auth-core/blob/550ab85d871de8451cb242eaa17f4041ff320b7c/src/Abstracts/AuthenticationMiddleware.php#L132-L183 |
24,889 | MatiasNAmendola/slimpower-auth-core | src/Abstracts/AuthenticationMiddleware.php | AuthenticationMiddleware.checkSecure | private function checkSecure() {
$environment = $this->app->environment;
$scheme = $environment["slim.url_scheme"];
if ("https" !== $scheme && true === $this->options["secure"]) {
if (!in_array($environment["SERVER_NAME"], $this->options["relaxed"])) {
$message = spr... | php | private function checkSecure() {
$environment = $this->app->environment;
$scheme = $environment["slim.url_scheme"];
if ("https" !== $scheme && true === $this->options["secure"]) {
if (!in_array($environment["SERVER_NAME"], $this->options["relaxed"])) {
$message = spr... | [
"private",
"function",
"checkSecure",
"(",
")",
"{",
"$",
"environment",
"=",
"$",
"this",
"->",
"app",
"->",
"environment",
";",
"$",
"scheme",
"=",
"$",
"environment",
"[",
"\"slim.url_scheme\"",
"]",
";",
"if",
"(",
"\"https\"",
"!==",
"$",
"scheme",
... | HTTP allowed only if secure is false or server is in relaxed array.
@throws \RuntimeException | [
"HTTP",
"allowed",
"only",
"if",
"secure",
"is",
"false",
"or",
"server",
"is",
"in",
"relaxed",
"array",
"."
] | 550ab85d871de8451cb242eaa17f4041ff320b7c | https://github.com/MatiasNAmendola/slimpower-auth-core/blob/550ab85d871de8451cb242eaa17f4041ff320b7c/src/Abstracts/AuthenticationMiddleware.php#L193-L205 |
24,890 | MatiasNAmendola/slimpower-auth-core | src/Abstracts/AuthenticationMiddleware.php | AuthenticationMiddleware.hydrate | private function hydrate($data = array()) {
foreach ($data as $key => $value) {
$method = "set" . ucfirst($key);
if (method_exists($this, $method)) {
call_user_func(array($this, $method), $value);
}
}
} | php | private function hydrate($data = array()) {
foreach ($data as $key => $value) {
$method = "set" . ucfirst($key);
if (method_exists($this, $method)) {
call_user_func(array($this, $method), $value);
}
}
} | [
"private",
"function",
"hydrate",
"(",
"$",
"data",
"=",
"array",
"(",
")",
")",
"{",
"foreach",
"(",
"$",
"data",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"$",
"method",
"=",
"\"set\"",
".",
"ucfirst",
"(",
"$",
"key",
")",
";",
"if",
"... | Hydate options from given array
@param array $data Array of options.
@return self | [
"Hydate",
"options",
"from",
"given",
"array"
] | 550ab85d871de8451cb242eaa17f4041ff320b7c | https://github.com/MatiasNAmendola/slimpower-auth-core/blob/550ab85d871de8451cb242eaa17f4041ff320b7c/src/Abstracts/AuthenticationMiddleware.php#L230-L237 |
24,891 | MatiasNAmendola/slimpower-auth-core | src/Abstracts/AuthenticationMiddleware.php | AuthenticationMiddleware.callError | public function callError() {
if (!($this->error instanceof Error)) {
$this->error = new Error();
}
$status = $this->error->getStatus();
$this->app->response->status($status);
if (is_callable($this->options["error"])) {
$this->options["error"]($this->err... | php | public function callError() {
if (!($this->error instanceof Error)) {
$this->error = new Error();
}
$status = $this->error->getStatus();
$this->app->response->status($status);
if (is_callable($this->options["error"])) {
$this->options["error"]($this->err... | [
"public",
"function",
"callError",
"(",
")",
"{",
"if",
"(",
"!",
"(",
"$",
"this",
"->",
"error",
"instanceof",
"Error",
")",
")",
"{",
"$",
"this",
"->",
"error",
"=",
"new",
"Error",
"(",
")",
";",
"}",
"$",
"status",
"=",
"$",
"this",
"->",
... | Call the error handler if it exists
@return void | [
"Call",
"the",
"error",
"handler",
"if",
"it",
"exists"
] | 550ab85d871de8451cb242eaa17f4041ff320b7c | https://github.com/MatiasNAmendola/slimpower-auth-core/blob/550ab85d871de8451cb242eaa17f4041ff320b7c/src/Abstracts/AuthenticationMiddleware.php#L259-L270 |
24,892 | MatiasNAmendola/slimpower-auth-core | src/Abstracts/AuthenticationMiddleware.php | AuthenticationMiddleware.setRules | public function setRules(array $rules) {
/* Clear the stack */
unset($this->rules);
$this->rules = new \SplStack;
/* Add the rules */
foreach ($rules as $callable) {
$this->addRule($callable);
}
return $this;
} | php | public function setRules(array $rules) {
/* Clear the stack */
unset($this->rules);
$this->rules = new \SplStack;
/* Add the rules */
foreach ($rules as $callable) {
$this->addRule($callable);
}
return $this;
} | [
"public",
"function",
"setRules",
"(",
"array",
"$",
"rules",
")",
"{",
"/* Clear the stack */",
"unset",
"(",
"$",
"this",
"->",
"rules",
")",
";",
"$",
"this",
"->",
"rules",
"=",
"new",
"\\",
"SplStack",
";",
"/* Add the rules */",
"foreach",
"(",
"$",
... | Set all rules in the stack
@return self | [
"Set",
"all",
"rules",
"in",
"the",
"stack"
] | 550ab85d871de8451cb242eaa17f4041ff320b7c | https://github.com/MatiasNAmendola/slimpower-auth-core/blob/550ab85d871de8451cb242eaa17f4041ff320b7c/src/Abstracts/AuthenticationMiddleware.php#L413-L424 |
24,893 | theopera/framework | src/Component/Http/ParameterBag.php | ParameterBag.add | public function add(string $key, $value, bool $override = false)
{
if (!$override && $this->exists($key)) {
return;
}
$this->parameters[$key] = $value;
} | php | public function add(string $key, $value, bool $override = false)
{
if (!$override && $this->exists($key)) {
return;
}
$this->parameters[$key] = $value;
} | [
"public",
"function",
"add",
"(",
"string",
"$",
"key",
",",
"$",
"value",
",",
"bool",
"$",
"override",
"=",
"false",
")",
"{",
"if",
"(",
"!",
"$",
"override",
"&&",
"$",
"this",
"->",
"exists",
"(",
"$",
"key",
")",
")",
"{",
"return",
";",
... | Add a parameter to the bag
@param string $key
@param mixed $value | [
"Add",
"a",
"parameter",
"to",
"the",
"bag"
] | fa6165d3891a310faa580c81dee49a63c150c711 | https://github.com/theopera/framework/blob/fa6165d3891a310faa580c81dee49a63c150c711/src/Component/Http/ParameterBag.php#L57-L64 |
24,894 | chee-commerce/CheeModule | src/Chee/Module/CheeModule.php | CheeModule.start | public function start()
{
$modules = ModuleModel::where('module_status', 1)->get();
foreach($modules as $module)
{
$path = $this->getModuleDirectory($module->module_name);
if ($path)
{
$name = $module->module_name;
$this->mo... | php | public function start()
{
$modules = ModuleModel::where('module_status', 1)->get();
foreach($modules as $module)
{
$path = $this->getModuleDirectory($module->module_name);
if ($path)
{
$name = $module->module_name;
$this->mo... | [
"public",
"function",
"start",
"(",
")",
"{",
"$",
"modules",
"=",
"ModuleModel",
"::",
"where",
"(",
"'module_status'",
",",
"1",
")",
"->",
"get",
"(",
")",
";",
"foreach",
"(",
"$",
"modules",
"as",
"$",
"module",
")",
"{",
"$",
"path",
"=",
"$"... | Get all module from database and initialize
@return void | [
"Get",
"all",
"module",
"from",
"database",
"and",
"initialize"
] | ccfff426f4ecf8f13687f5acd49246ba4997deee | https://github.com/chee-commerce/CheeModule/blob/ccfff426f4ecf8f13687f5acd49246ba4997deee/src/Chee/Module/CheeModule.php#L120-L132 |
24,895 | chee-commerce/CheeModule | src/Chee/Module/CheeModule.php | CheeModule.register | public function register()
{
foreach ($this->modules as $module)
{
$module->register();
}
$modules = ModuleModel::where('module_status', 1)->get();
foreach ($modules as $module)
{
if ($module->module_is_installed)
{
... | php | public function register()
{
foreach ($this->modules as $module)
{
$module->register();
}
$modules = ModuleModel::where('module_status', 1)->get();
foreach ($modules as $module)
{
if ($module->module_is_installed)
{
... | [
"public",
"function",
"register",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"modules",
"as",
"$",
"module",
")",
"{",
"$",
"module",
"->",
"register",
"(",
")",
";",
"}",
"$",
"modules",
"=",
"ModuleModel",
"::",
"where",
"(",
"'module_status'"... | Register modules with Moduel class
@return void | [
"Register",
"modules",
"with",
"Moduel",
"class"
] | ccfff426f4ecf8f13687f5acd49246ba4997deee | https://github.com/chee-commerce/CheeModule/blob/ccfff426f4ecf8f13687f5acd49246ba4997deee/src/Chee/Module/CheeModule.php#L139-L166 |
24,896 | chee-commerce/CheeModule | src/Chee/Module/CheeModule.php | CheeModule.enable | public function enable($moduleName)
{
$module = $this->findOrFalse('module_name', $moduleName);
if ($module)
{
if(!$module->module_status)
{
$module->module_status = 1;
$module->module_is_enabled = 1;
$module->save();
... | php | public function enable($moduleName)
{
$module = $this->findOrFalse('module_name', $moduleName);
if ($module)
{
if(!$module->module_status)
{
$module->module_status = 1;
$module->module_is_enabled = 1;
$module->save();
... | [
"public",
"function",
"enable",
"(",
"$",
"moduleName",
")",
"{",
"$",
"module",
"=",
"$",
"this",
"->",
"findOrFalse",
"(",
"'module_name'",
",",
"$",
"moduleName",
")",
";",
"if",
"(",
"$",
"module",
")",
"{",
"if",
"(",
"!",
"$",
"module",
"->",
... | Enable module to load
@param string #moduleName
@return bool | [
"Enable",
"module",
"to",
"load"
] | ccfff426f4ecf8f13687f5acd49246ba4997deee | https://github.com/chee-commerce/CheeModule/blob/ccfff426f4ecf8f13687f5acd49246ba4997deee/src/Chee/Module/CheeModule.php#L174-L189 |
24,897 | chee-commerce/CheeModule | src/Chee/Module/CheeModule.php | CheeModule.getListModules | protected function getListModules($modulesModel)
{
$modules = array();
foreach ($modulesModel as $module)
{
$modules[$module->module_name]['name'] = $this->def($module->module_name, 'name');
$modules[$module->module_name]['icon'] = $this->getConfig('assets').'/'.$modu... | php | protected function getListModules($modulesModel)
{
$modules = array();
foreach ($modulesModel as $module)
{
$modules[$module->module_name]['name'] = $this->def($module->module_name, 'name');
$modules[$module->module_name]['icon'] = $this->getConfig('assets').'/'.$modu... | [
"protected",
"function",
"getListModules",
"(",
"$",
"modulesModel",
")",
"{",
"$",
"modules",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"modulesModel",
"as",
"$",
"module",
")",
"{",
"$",
"modules",
"[",
"$",
"module",
"->",
"module_name",
"]",
... | Get list modules
@param model $modulesModel
@return array | [
"Get",
"list",
"modules"
] | ccfff426f4ecf8f13687f5acd49246ba4997deee | https://github.com/chee-commerce/CheeModule/blob/ccfff426f4ecf8f13687f5acd49246ba4997deee/src/Chee/Module/CheeModule.php#L254-L267 |
24,898 | chee-commerce/CheeModule | src/Chee/Module/CheeModule.php | CheeModule.buildAssets | public function buildAssets($moduleName)
{
$module = $this->getModuleDirectory($moduleName);
if ($module)
{
$module .= '/assets';
if ($this->files->exists($module))
{
if (!@$this->files->copyDirectory($module, $this->getAssetDirectory($modu... | php | public function buildAssets($moduleName)
{
$module = $this->getModuleDirectory($moduleName);
if ($module)
{
$module .= '/assets';
if ($this->files->exists($module))
{
if (!@$this->files->copyDirectory($module, $this->getAssetDirectory($modu... | [
"public",
"function",
"buildAssets",
"(",
"$",
"moduleName",
")",
"{",
"$",
"module",
"=",
"$",
"this",
"->",
"getModuleDirectory",
"(",
"$",
"moduleName",
")",
";",
"if",
"(",
"$",
"module",
")",
"{",
"$",
"module",
".=",
"'/assets'",
";",
"if",
"(",
... | Move contents assets module to public directory
@param string $moduleName
@return bool | [
"Move",
"contents",
"assets",
"module",
"to",
"public",
"directory"
] | ccfff426f4ecf8f13687f5acd49246ba4997deee | https://github.com/chee-commerce/CheeModule/blob/ccfff426f4ecf8f13687f5acd49246ba4997deee/src/Chee/Module/CheeModule.php#L275-L292 |
24,899 | chee-commerce/CheeModule | src/Chee/Module/CheeModule.php | CheeModule.removeAssets | public function removeAssets($moduleName)
{
$assets = $this->getAssetDirectory($moduleName);
$this->files->deleteDirectory($assets);
if ($this->files->exists($assets))
{
$this->errors->add('delete_assets', 'Unable to delete assets in: '.$assets);
return false... | php | public function removeAssets($moduleName)
{
$assets = $this->getAssetDirectory($moduleName);
$this->files->deleteDirectory($assets);
if ($this->files->exists($assets))
{
$this->errors->add('delete_assets', 'Unable to delete assets in: '.$assets);
return false... | [
"public",
"function",
"removeAssets",
"(",
"$",
"moduleName",
")",
"{",
"$",
"assets",
"=",
"$",
"this",
"->",
"getAssetDirectory",
"(",
"$",
"moduleName",
")",
";",
"$",
"this",
"->",
"files",
"->",
"deleteDirectory",
"(",
"$",
"assets",
")",
";",
"if",... | Remove assets of a module
@param string $moduleName
@return bool | [
"Remove",
"assets",
"of",
"a",
"module"
] | ccfff426f4ecf8f13687f5acd49246ba4997deee | https://github.com/chee-commerce/CheeModule/blob/ccfff426f4ecf8f13687f5acd49246ba4997deee/src/Chee/Module/CheeModule.php#L300-L311 |
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.