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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
25,500 | AnonymPHP/Anonym-Database | Mode/Read.php | Read.join | public function join($join = [])
{
$this->string['join'] = $this->useBuilder('join')->join($join, $this->getBase()->getTable());
return $this;
} | php | public function join($join = [])
{
$this->string['join'] = $this->useBuilder('join')->join($join, $this->getBase()->getTable());
return $this;
} | [
"public",
"function",
"join",
"(",
"$",
"join",
"=",
"[",
"]",
")",
"{",
"$",
"this",
"->",
"string",
"[",
"'join'",
"]",
"=",
"$",
"this",
"->",
"useBuilder",
"(",
"'join'",
")",
"->",
"join",
"(",
"$",
"join",
",",
"$",
"this",
"->",
"getBase",... | Join komutu ekler
@param array $join
@return $this | [
"Join",
"komutu",
"ekler"
] | 4d034219e0e3eb2833fa53204e9f52a74a9a7e4b | https://github.com/AnonymPHP/Anonym-Database/blob/4d034219e0e3eb2833fa53204e9f52a74a9a7e4b/Mode/Read.php#L122-L126 |
25,501 | FlexModel/FlexModelBundle | DataCollector/FlexModelDataCollector.php | FlexModelDataCollector.collect | public function collect(Request $request, Response $response, Exception $exception = null)
{
$objects = array();
$objectNames = $this->flexModel->getObjectNames();
foreach ($objectNames as $objectName) {
$fieldNames = $this->flexModel->getFieldNames($objectName);
$ob... | php | public function collect(Request $request, Response $response, Exception $exception = null)
{
$objects = array();
$objectNames = $this->flexModel->getObjectNames();
foreach ($objectNames as $objectName) {
$fieldNames = $this->flexModel->getFieldNames($objectName);
$ob... | [
"public",
"function",
"collect",
"(",
"Request",
"$",
"request",
",",
"Response",
"$",
"response",
",",
"Exception",
"$",
"exception",
"=",
"null",
")",
"{",
"$",
"objects",
"=",
"array",
"(",
")",
";",
"$",
"objectNames",
"=",
"$",
"this",
"->",
"flex... | Collect the specific FlexModel data for the Symfony Profiler.
@param Request $request
@param Response $response
@param Exception $exception | [
"Collect",
"the",
"specific",
"FlexModel",
"data",
"for",
"the",
"Symfony",
"Profiler",
"."
] | 7b4720d25b0dc6baf29b1da8ad7c67dfb2686460 | https://github.com/FlexModel/FlexModelBundle/blob/7b4720d25b0dc6baf29b1da8ad7c67dfb2686460/DataCollector/FlexModelDataCollector.php#L42-L58 |
25,502 | fxpio/fxp-doctrine-extra | Util/ManagerUtils.php | ManagerUtils.getManager | public static function getManager(ManagerRegistry $or, $class)
{
$manager = $or->getManagerForClass($class);
if (null === $manager) {
foreach ($or->getManagers() as $objectManager) {
if ($objectManager->getMetadataFactory()->hasMetadataFor($class)
... | php | public static function getManager(ManagerRegistry $or, $class)
{
$manager = $or->getManagerForClass($class);
if (null === $manager) {
foreach ($or->getManagers() as $objectManager) {
if ($objectManager->getMetadataFactory()->hasMetadataFor($class)
... | [
"public",
"static",
"function",
"getManager",
"(",
"ManagerRegistry",
"$",
"or",
",",
"$",
"class",
")",
"{",
"$",
"manager",
"=",
"$",
"or",
"->",
"getManagerForClass",
"(",
"$",
"class",
")",
";",
"if",
"(",
"null",
"===",
"$",
"manager",
")",
"{",
... | Get the doctrine object manager of the class.
@param ManagerRegistry $or The doctrine registry
@param string $class The class name or doctrine shortcut class name
@return null|ObjectManager | [
"Get",
"the",
"doctrine",
"object",
"manager",
"of",
"the",
"class",
"."
] | 9c672acde7892717958efff0ee3bad723be4a70f | https://github.com/fxpio/fxp-doctrine-extra/blob/9c672acde7892717958efff0ee3bad723be4a70f/Util/ManagerUtils.php#L34-L50 |
25,503 | fxpio/fxp-doctrine-extra | Util/ManagerUtils.php | ManagerUtils.isValidManager | private static function isValidManager(ObjectManager $manager, $class)
{
$meta = $manager->getClassMetadata($class);
return !$meta instanceof OrmClassMetadata || !$meta->isMappedSuperclass;
} | php | private static function isValidManager(ObjectManager $manager, $class)
{
$meta = $manager->getClassMetadata($class);
return !$meta instanceof OrmClassMetadata || !$meta->isMappedSuperclass;
} | [
"private",
"static",
"function",
"isValidManager",
"(",
"ObjectManager",
"$",
"manager",
",",
"$",
"class",
")",
"{",
"$",
"meta",
"=",
"$",
"manager",
"->",
"getClassMetadata",
"(",
"$",
"class",
")",
";",
"return",
"!",
"$",
"meta",
"instanceof",
"OrmCla... | Check if the object manager is valid.
@param ObjectManager $manager The object manager
@param string $class The class name
@return bool | [
"Check",
"if",
"the",
"object",
"manager",
"is",
"valid",
"."
] | 9c672acde7892717958efff0ee3bad723be4a70f | https://github.com/fxpio/fxp-doctrine-extra/blob/9c672acde7892717958efff0ee3bad723be4a70f/Util/ManagerUtils.php#L81-L86 |
25,504 | WideFocus/Feed-Writer | src/ExtractFieldValuesTrait.php | ExtractFieldValuesTrait.extractFieldValues | protected function extractFieldValues(
ArrayAccess $item,
WriterFieldInterface ...$fields
): array {
return array_map(
function (WriterFieldInterface $field) use ($item) : string {
return $field->getValue($item);
},
$fields
);
} | php | protected function extractFieldValues(
ArrayAccess $item,
WriterFieldInterface ...$fields
): array {
return array_map(
function (WriterFieldInterface $field) use ($item) : string {
return $field->getValue($item);
},
$fields
);
} | [
"protected",
"function",
"extractFieldValues",
"(",
"ArrayAccess",
"$",
"item",
",",
"WriterFieldInterface",
"...",
"$",
"fields",
")",
":",
"array",
"{",
"return",
"array_map",
"(",
"function",
"(",
"WriterFieldInterface",
"$",
"field",
")",
"use",
"(",
"$",
... | Extract item values from fields.
@param ArrayAccess $item
@param WriterFieldInterface[] ...$fields
@return string[] | [
"Extract",
"item",
"values",
"from",
"fields",
"."
] | c2698394645c75db06962e5e9d638f0cabe69fe3 | https://github.com/WideFocus/Feed-Writer/blob/c2698394645c75db06962e5e9d638f0cabe69fe3/src/ExtractFieldValuesTrait.php#L21-L31 |
25,505 | Talesoft/tale-framework | src/Tale/Event/EmitterTrait.php | EmitterTrait.getEvent | public function getEvent($name)
{
if (!isset($this->_events))
$this->_events = [];
if (!isset($this->_events[$name])) {
$className = $this->getEventClassName();
$this->_events[$name] = new $className($name);
}
return $this->_events[$name];
... | php | public function getEvent($name)
{
if (!isset($this->_events))
$this->_events = [];
if (!isset($this->_events[$name])) {
$className = $this->getEventClassName();
$this->_events[$name] = new $className($name);
}
return $this->_events[$name];
... | [
"public",
"function",
"getEvent",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"_events",
")",
")",
"$",
"this",
"->",
"_events",
"=",
"[",
"]",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"_events",
"[... | Returns an event by name.
If the event doesnt exist yet, it is created
@param $name The name of the event
@return \Tale\Event The unique event instance | [
"Returns",
"an",
"event",
"by",
"name",
".",
"If",
"the",
"event",
"doesnt",
"exist",
"yet",
"it",
"is",
"created"
] | 739a7011c6dad409a51c4bcfbcf4b4ffbc8cba49 | https://github.com/Talesoft/tale-framework/blob/739a7011c6dad409a51c4bcfbcf4b4ffbc8cba49/src/Tale/Event/EmitterTrait.php#L38-L51 |
25,506 | Subscribo/omnipay-subscribo-shared | src/Shared/Widget/AbstractWidget.php | AbstractWidget.checkParameters | protected function checkParameters($parameters, $requirements = true)
{
if (is_array($parameters)) {
$parameters = array_replace($this->getParameters(), $parameters);
}
$obstacles = $this->collectRenderingObstacles($parameters, $requirements);
if ($obstacles) {
... | php | protected function checkParameters($parameters, $requirements = true)
{
if (is_array($parameters)) {
$parameters = array_replace($this->getParameters(), $parameters);
}
$obstacles = $this->collectRenderingObstacles($parameters, $requirements);
if ($obstacles) {
... | [
"protected",
"function",
"checkParameters",
"(",
"$",
"parameters",
",",
"$",
"requirements",
"=",
"true",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"parameters",
")",
")",
"{",
"$",
"parameters",
"=",
"array_replace",
"(",
"$",
"this",
"->",
"getParamete... | Merges provided parameters with those from objects and checks them
@param array $parameters
@param bool|array $requirements - required parameter names or true for getting them from getRequiredParameters()
@return array
@throws \Subscribo\Omnipay\Shared\Exception\WidgetInvalidRenderingParametersException | [
"Merges",
"provided",
"parameters",
"with",
"those",
"from",
"objects",
"and",
"checks",
"them"
] | aa9fa115ef8324b50fe5c91d3593d5632f53b669 | https://github.com/Subscribo/omnipay-subscribo-shared/blob/aa9fa115ef8324b50fe5c91d3593d5632f53b669/src/Shared/Widget/AbstractWidget.php#L40-L50 |
25,507 | Subscribo/omnipay-subscribo-shared | src/Shared/Widget/AbstractWidget.php | AbstractWidget.collectRenderingObstacles | protected function collectRenderingObstacles($parameters, $requirements = true)
{
if ( ! is_array($parameters)) {
return ['Parameters should be an array'];
}
if (true === $requirements) {
$requirements = $this->getRequiredParameters();
}
$obstacles = [... | php | protected function collectRenderingObstacles($parameters, $requirements = true)
{
if ( ! is_array($parameters)) {
return ['Parameters should be an array'];
}
if (true === $requirements) {
$requirements = $this->getRequiredParameters();
}
$obstacles = [... | [
"protected",
"function",
"collectRenderingObstacles",
"(",
"$",
"parameters",
",",
"$",
"requirements",
"=",
"true",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"parameters",
")",
")",
"{",
"return",
"[",
"'Parameters should be an array'",
"]",
";",
"}",
... | Returns an array of possible problems for rendering widget or of some widget rendering functionality
@param $parameters
@param bool|array $requirements - required parameter names or true for getting them from getRequiredParameters()
@return array | [
"Returns",
"an",
"array",
"of",
"possible",
"problems",
"for",
"rendering",
"widget",
"or",
"of",
"some",
"widget",
"rendering",
"functionality"
] | aa9fa115ef8324b50fe5c91d3593d5632f53b669 | https://github.com/Subscribo/omnipay-subscribo-shared/blob/aa9fa115ef8324b50fe5c91d3593d5632f53b669/src/Shared/Widget/AbstractWidget.php#L59-L74 |
25,508 | heiglandreas/DateFormatter | src/Formatter/Pdf.php | Pdf.format | public function format(\DateTimeInterface $date)
{
if ($date->getOffset() == 0) {
return $date->format('YmdHis\Z');
}
return str_replace(':', '\'', $date->format('YmdHisP')) . '\'';
} | php | public function format(\DateTimeInterface $date)
{
if ($date->getOffset() == 0) {
return $date->format('YmdHis\Z');
}
return str_replace(':', '\'', $date->format('YmdHisP')) . '\'';
} | [
"public",
"function",
"format",
"(",
"\\",
"DateTimeInterface",
"$",
"date",
")",
"{",
"if",
"(",
"$",
"date",
"->",
"getOffset",
"(",
")",
"==",
"0",
")",
"{",
"return",
"$",
"date",
"->",
"format",
"(",
"'YmdHis\\Z'",
")",
";",
"}",
"return",
"str_... | Formats the date according to the formatting string
@param \DateTimeInterface $date
@return string | [
"Formats",
"the",
"date",
"according",
"to",
"the",
"formatting",
"string"
] | 948737d329e72b74c118dac902d795d6c244a486 | https://github.com/heiglandreas/DateFormatter/blob/948737d329e72b74c118dac902d795d6c244a486/src/Formatter/Pdf.php#L43-L49 |
25,509 | capimichi/crawler | src/Crawler/Downloader/Downloader.php | Downloader.getDomXpath | public function getDomXpath($url)
{
$dom = $this->getDomDocument($url);
$xpath = new \DOMXPath($dom);
return $xpath;
} | php | public function getDomXpath($url)
{
$dom = $this->getDomDocument($url);
$xpath = new \DOMXPath($dom);
return $xpath;
} | [
"public",
"function",
"getDomXpath",
"(",
"$",
"url",
")",
"{",
"$",
"dom",
"=",
"$",
"this",
"->",
"getDomDocument",
"(",
"$",
"url",
")",
";",
"$",
"xpath",
"=",
"new",
"\\",
"DOMXPath",
"(",
"$",
"dom",
")",
";",
"return",
"$",
"xpath",
";",
"... | Get the DOMXPath of the downloaded content
@param $url
@return \DOMXPath | [
"Get",
"the",
"DOMXPath",
"of",
"the",
"downloaded",
"content"
] | e1cd4ba00a9a1da994dc381ee396ba4a5038c986 | https://github.com/capimichi/crawler/blob/e1cd4ba00a9a1da994dc381ee396ba4a5038c986/src/Crawler/Downloader/Downloader.php#L94-L99 |
25,510 | ARCANESOFT/Media | src/Http/Controllers/Admin/ApiController.php | ApiController.getAll | public function getAll(Request $request)
{
$this->authorize(MediasPolicy::PERMISSION_LIST);
return $this->jsonResponseSuccess([
'medias' => $this->media->all(
$request->get('location', '/')
),
]);
} | php | public function getAll(Request $request)
{
$this->authorize(MediasPolicy::PERMISSION_LIST);
return $this->jsonResponseSuccess([
'medias' => $this->media->all(
$request->get('location', '/')
),
]);
} | [
"public",
"function",
"getAll",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"this",
"->",
"authorize",
"(",
"MediasPolicy",
"::",
"PERMISSION_LIST",
")",
";",
"return",
"$",
"this",
"->",
"jsonResponseSuccess",
"(",
"[",
"'medias'",
"=>",
"$",
"this",
"... | Get the the media files.
@param \Illuminate\Http\Request $request
@return \Illuminate\Http\JsonResponse | [
"Get",
"the",
"the",
"media",
"files",
"."
] | e98aad52f94e6587fcbf79c56f7bf7072929bfc9 | https://github.com/ARCANESOFT/Media/blob/e98aad52f94e6587fcbf79c56f7bf7072929bfc9/src/Http/Controllers/Admin/ApiController.php#L65-L74 |
25,511 | ARCANESOFT/Media | src/Http/Controllers/Admin/ApiController.php | ApiController.getDestinations | private function getDestinations($name, $location)
{
$selected = ($isHome = $location === '/') ? $name : "{$location}/{$name}";
$destinations = $this->media->directories($location)
->pluck('path')
->reject(function ($path) use ($selected) {
return $path ==... | php | private function getDestinations($name, $location)
{
$selected = ($isHome = $location === '/') ? $name : "{$location}/{$name}";
$destinations = $this->media->directories($location)
->pluck('path')
->reject(function ($path) use ($selected) {
return $path ==... | [
"private",
"function",
"getDestinations",
"(",
"$",
"name",
",",
"$",
"location",
")",
"{",
"$",
"selected",
"=",
"(",
"$",
"isHome",
"=",
"$",
"location",
"===",
"'/'",
")",
"?",
"$",
"name",
":",
"\"{$location}/{$name}\"",
";",
"$",
"destinations",
"="... | Get the destinations paths.
@param string $name
@param string $location
@return \Arcanesoft\Media\Entities\DirectoryCollection | [
"Get",
"the",
"destinations",
"paths",
"."
] | e98aad52f94e6587fcbf79c56f7bf7072929bfc9 | https://github.com/ARCANESOFT/Media/blob/e98aad52f94e6587fcbf79c56f7bf7072929bfc9/src/Http/Controllers/Admin/ApiController.php#L245-L259 |
25,512 | ARCANESOFT/Media | src/Http/Controllers/Admin/ApiController.php | ApiController.performMoveMedia | private function performMoveMedia($type, $location, $oldName, $newName)
{
$from = "{$location}/{$oldName}";
switch (Str::lower($type)) {
case Media::MEDIA_TYPE_FILE:
return $this->moveFile($from, $location, $newName);
case Media::MEDIA_TYPE_DIRECTORY:
... | php | private function performMoveMedia($type, $location, $oldName, $newName)
{
$from = "{$location}/{$oldName}";
switch (Str::lower($type)) {
case Media::MEDIA_TYPE_FILE:
return $this->moveFile($from, $location, $newName);
case Media::MEDIA_TYPE_DIRECTORY:
... | [
"private",
"function",
"performMoveMedia",
"(",
"$",
"type",
",",
"$",
"location",
",",
"$",
"oldName",
",",
"$",
"newName",
")",
"{",
"$",
"from",
"=",
"\"{$location}/{$oldName}\"",
";",
"switch",
"(",
"Str",
"::",
"lower",
"(",
"$",
"type",
")",
")",
... | Perform the media movement.
@param string $type
@param string $location
@param string $oldName
@param string $newName
@return bool|string | [
"Perform",
"the",
"media",
"movement",
"."
] | e98aad52f94e6587fcbf79c56f7bf7072929bfc9 | https://github.com/ARCANESOFT/Media/blob/e98aad52f94e6587fcbf79c56f7bf7072929bfc9/src/Http/Controllers/Admin/ApiController.php#L271-L285 |
25,513 | ARCANESOFT/Media | src/Http/Controllers/Admin/ApiController.php | ApiController.moveDirectory | private function moveDirectory($from, $location, $newName)
{
$newName = Str::slug($newName);
return tap("{$location}/{$newName}", function ($to) use ($from) {
$this->media->move($from, $to);
});
} | php | private function moveDirectory($from, $location, $newName)
{
$newName = Str::slug($newName);
return tap("{$location}/{$newName}", function ($to) use ($from) {
$this->media->move($from, $to);
});
} | [
"private",
"function",
"moveDirectory",
"(",
"$",
"from",
",",
"$",
"location",
",",
"$",
"newName",
")",
"{",
"$",
"newName",
"=",
"Str",
"::",
"slug",
"(",
"$",
"newName",
")",
";",
"return",
"tap",
"(",
"\"{$location}/{$newName}\"",
",",
"function",
"... | Move directory.
@param string $from
@param string $location
@param string $newName
@return string | [
"Move",
"directory",
"."
] | e98aad52f94e6587fcbf79c56f7bf7072929bfc9 | https://github.com/ARCANESOFT/Media/blob/e98aad52f94e6587fcbf79c56f7bf7072929bfc9/src/Http/Controllers/Admin/ApiController.php#L316-L323 |
25,514 | ARCANESOFT/Media | src/Http/Controllers/Admin/ApiController.php | ApiController.performDeleteMedia | private function performDeleteMedia($type, $path)
{
switch (Str::lower($type)) {
case Media::MEDIA_TYPE_FILE:
return $this->media->deleteFile($path);
case Media::MEDIA_TYPE_DIRECTORY:
return $this->media->deleteDirectory(trim($path, '/'));
... | php | private function performDeleteMedia($type, $path)
{
switch (Str::lower($type)) {
case Media::MEDIA_TYPE_FILE:
return $this->media->deleteFile($path);
case Media::MEDIA_TYPE_DIRECTORY:
return $this->media->deleteDirectory(trim($path, '/'));
... | [
"private",
"function",
"performDeleteMedia",
"(",
"$",
"type",
",",
"$",
"path",
")",
"{",
"switch",
"(",
"Str",
"::",
"lower",
"(",
"$",
"type",
")",
")",
"{",
"case",
"Media",
"::",
"MEDIA_TYPE_FILE",
":",
"return",
"$",
"this",
"->",
"media",
"->",
... | Perform the media deletion.
@param string $type
@param string $path
@return bool | [
"Perform",
"the",
"media",
"deletion",
"."
] | e98aad52f94e6587fcbf79c56f7bf7072929bfc9 | https://github.com/ARCANESOFT/Media/blob/e98aad52f94e6587fcbf79c56f7bf7072929bfc9/src/Http/Controllers/Admin/ApiController.php#L333-L345 |
25,515 | SlaxWeb/Bootstrap | src/Service/LoggerProvider.php | LoggerProvider.register | public function register(App $app)
{
$app["logger.service"] = $app->protect(
function (string $loggerName = "") use ($app) {
$cacheName = "logger.service-{$loggerName}";
if (isset($app[$cacheName])) {
return $app[$cacheName];
}
... | php | public function register(App $app)
{
$app["logger.service"] = $app->protect(
function (string $loggerName = "") use ($app) {
$cacheName = "logger.service-{$loggerName}";
if (isset($app[$cacheName])) {
return $app[$cacheName];
}
... | [
"public",
"function",
"register",
"(",
"App",
"$",
"app",
")",
"{",
"$",
"app",
"[",
"\"logger.service\"",
"]",
"=",
"$",
"app",
"->",
"protect",
"(",
"function",
"(",
"string",
"$",
"loggerName",
"=",
"\"\"",
")",
"use",
"(",
"$",
"app",
")",
"{",
... | Register Logger Service Provider
Method used by the DIC to register a new service provider. This Service
Provider defines only the Logger service.
@param \Pimple\Container $app Pimple Dependency Injection Container
@return void | [
"Register",
"Logger",
"Service",
"Provider"
] | 5ec8ef40f357f2c75afa0ad99090a9d2f7021557 | https://github.com/SlaxWeb/Bootstrap/blob/5ec8ef40f357f2c75afa0ad99090a9d2f7021557/src/Service/LoggerProvider.php#L32-L91 |
25,516 | Wedeto/HTTP | src/Forms/FormField.php | FormField.setName | public function setName(string $name)
{
$this->name = $name;
while (preg_match('/^(.*)\[([^\]]*)\]$/', $name, $matches) === 1)
{
if (empty($matches[2]))
{
if ($this->name_depth > 1)
throw new \InvalidArgumentException("Invalid name:... | php | public function setName(string $name)
{
$this->name = $name;
while (preg_match('/^(.*)\[([^\]]*)\]$/', $name, $matches) === 1)
{
if (empty($matches[2]))
{
if ($this->name_depth > 1)
throw new \InvalidArgumentException("Invalid name:... | [
"public",
"function",
"setName",
"(",
"string",
"$",
"name",
")",
"{",
"$",
"this",
"->",
"name",
"=",
"$",
"name",
";",
"while",
"(",
"preg_match",
"(",
"'/^(.*)\\[([^\\]]*)\\]$/'",
",",
"$",
"name",
",",
"$",
"matches",
")",
"===",
"1",
")",
"{",
"... | Change the name of the field.
@param string $name The name to set. If the name contains [] pairs,
the field type will be set to array.
@return FormField Provides fluent interface
@throws InvalidArgumentException When an invalid names as used. An invalid name
is a name with more than one empty array pair,
like foo[][] | [
"Change",
"the",
"name",
"of",
"the",
"field",
"."
] | 7318eff1b81a3c103c4263466d09b7f3593b70b9 | https://github.com/Wedeto/HTTP/blob/7318eff1b81a3c103c4263466d09b7f3593b70b9/src/Forms/FormField.php#L99-L119 |
25,517 | Wedeto/HTTP | src/Forms/FormField.php | FormField.addValidator | public function addValidator($validator)
{
if ($validator === FormField::TYPE_FILE)
{
$this->is_file = true;
$validator = Type::RESOURCE;
}
if (!$validator instanceof Validator)
{
$validator = new Validator($validator, ['unstrict' => true]... | php | public function addValidator($validator)
{
if ($validator === FormField::TYPE_FILE)
{
$this->is_file = true;
$validator = Type::RESOURCE;
}
if (!$validator instanceof Validator)
{
$validator = new Validator($validator, ['unstrict' => true]... | [
"public",
"function",
"addValidator",
"(",
"$",
"validator",
")",
"{",
"if",
"(",
"$",
"validator",
"===",
"FormField",
"::",
"TYPE_FILE",
")",
"{",
"$",
"this",
"->",
"is_file",
"=",
"true",
";",
"$",
"validator",
"=",
"Type",
"::",
"RESOURCE",
";",
"... | Change the type of the field
@param Validator $validator The validator to add. Provide either
one of the constants in Type, or a instantiated
Validator. FormField::TYPE_FILE will be transparently
converted to a file upload form field.
@return FormField Provides fluent interface | [
"Change",
"the",
"type",
"of",
"the",
"field"
] | 7318eff1b81a3c103c4263466d09b7f3593b70b9 | https://github.com/Wedeto/HTTP/blob/7318eff1b81a3c103c4263466d09b7f3593b70b9/src/Forms/FormField.php#L129-L144 |
25,518 | Wedeto/HTTP | src/Forms/FormField.php | FormField.removeValidator | public function removeValidator(int $index)
{
$validators = $this->validators;
unset($validators[$index]);
$this->validators = array_values($validators);
return $this;
} | php | public function removeValidator(int $index)
{
$validators = $this->validators;
unset($validators[$index]);
$this->validators = array_values($validators);
return $this;
} | [
"public",
"function",
"removeValidator",
"(",
"int",
"$",
"index",
")",
"{",
"$",
"validators",
"=",
"$",
"this",
"->",
"validators",
";",
"unset",
"(",
"$",
"validators",
"[",
"$",
"index",
"]",
")",
";",
"$",
"this",
"->",
"validators",
"=",
"array_v... | Remove a validator with a specific index
@param int $index The index to remove
@return FormField Provides fluent interface | [
"Remove",
"a",
"validator",
"with",
"a",
"specific",
"index"
] | 7318eff1b81a3c103c4263466d09b7f3593b70b9 | https://github.com/Wedeto/HTTP/blob/7318eff1b81a3c103c4263466d09b7f3593b70b9/src/Forms/FormField.php#L151-L157 |
25,519 | Wedeto/HTTP | src/Forms/FormField.php | FormField.getErrors | public function getErrors()
{
if (!empty($this->fixed_error))
return count($this->errors) ? [$this->fixed_error] : [];
return $this->errors;
} | php | public function getErrors()
{
if (!empty($this->fixed_error))
return count($this->errors) ? [$this->fixed_error] : [];
return $this->errors;
} | [
"public",
"function",
"getErrors",
"(",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"fixed_error",
")",
")",
"return",
"count",
"(",
"$",
"this",
"->",
"errors",
")",
"?",
"[",
"$",
"this",
"->",
"fixed_error",
"]",
":",
"[",
"]",
... | Return the error messages produced during validation. Should be called
after validation failed, otherwise an non-relevant or empty array will be
returned.
@return array List of errors. Empty when validation succeeded. | [
"Return",
"the",
"error",
"messages",
"produced",
"during",
"validation",
".",
"Should",
"be",
"called",
"after",
"validation",
"failed",
"otherwise",
"an",
"non",
"-",
"relevant",
"or",
"empty",
"array",
"will",
"be",
"returned",
"."
] | 7318eff1b81a3c103c4263466d09b7f3593b70b9 | https://github.com/Wedeto/HTTP/blob/7318eff1b81a3c103c4263466d09b7f3593b70b9/src/Forms/FormField.php#L279-L285 |
25,520 | Wedeto/HTTP | src/Forms/FormField.php | FormField.setError | public function setError(array $msg)
{
if (!isset($msg['msg']))
throw new InvalidArgumentException("Error message does not contain msg key");
$this->errors = [$msg];
$this->fixed_error = $msg;
return $this;
} | php | public function setError(array $msg)
{
if (!isset($msg['msg']))
throw new InvalidArgumentException("Error message does not contain msg key");
$this->errors = [$msg];
$this->fixed_error = $msg;
return $this;
} | [
"public",
"function",
"setError",
"(",
"array",
"$",
"msg",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"msg",
"[",
"'msg'",
"]",
")",
")",
"throw",
"new",
"InvalidArgumentException",
"(",
"\"Error message does not contain msg key\"",
")",
";",
"$",
"this",... | Set the form field with an error state. This will override the
fixed error.
@param array $msg The error message. Must contain a 'msg' key.
@return FormField provides fluent interface | [
"Set",
"the",
"form",
"field",
"with",
"an",
"error",
"state",
".",
"This",
"will",
"override",
"the",
"fixed",
"error",
"."
] | 7318eff1b81a3c103c4263466d09b7f3593b70b9 | https://github.com/Wedeto/HTTP/blob/7318eff1b81a3c103c4263466d09b7f3593b70b9/src/Forms/FormField.php#L318-L326 |
25,521 | Wedeto/HTTP | src/Forms/FormField.php | FormField.getValue | public function getValue(bool $transform = false)
{
if ($transform && $this->transformer !== null)
return $this->transformer->serialize($this->value);
return $this->value;
} | php | public function getValue(bool $transform = false)
{
if ($transform && $this->transformer !== null)
return $this->transformer->serialize($this->value);
return $this->value;
} | [
"public",
"function",
"getValue",
"(",
"bool",
"$",
"transform",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"transform",
"&&",
"$",
"this",
"->",
"transformer",
"!==",
"null",
")",
"return",
"$",
"this",
"->",
"transformer",
"->",
"serialize",
"(",
"$",
"... | Returns the value, optionally HTML escaped
@param bool $transform Set to true to run the transformer on the value, false
to return the raw value.
@return mixed The value for the item | [
"Returns",
"the",
"value",
"optionally",
"HTML",
"escaped"
] | 7318eff1b81a3c103c4263466d09b7f3593b70b9 | https://github.com/Wedeto/HTTP/blob/7318eff1b81a3c103c4263466d09b7f3593b70b9/src/Forms/FormField.php#L424-L429 |
25,522 | Wedeto/HTTP | src/Forms/FormField.php | FormField.setValue | public function setValue($value, bool $transform = false)
{
if (null === $value)
$this->value = null;
elseif ($transform && $this->transformer !== null)
$this->value = $this->transformer->deserialize($value);
else
$this->value = $value;
return $th... | php | public function setValue($value, bool $transform = false)
{
if (null === $value)
$this->value = null;
elseif ($transform && $this->transformer !== null)
$this->value = $this->transformer->deserialize($value);
else
$this->value = $value;
return $th... | [
"public",
"function",
"setValue",
"(",
"$",
"value",
",",
"bool",
"$",
"transform",
"=",
"false",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"value",
")",
"$",
"this",
"->",
"value",
"=",
"null",
";",
"elseif",
"(",
"$",
"transform",
"&&",
"$",
"this... | Change the value for this field. The value is not validated, this is
just to be referred to later, for example for showing to the visitor
@param mixed $value The value to set
@param bool $transform Whether to run the transformer on it before setting
@return FormField Provides fluent interface | [
"Change",
"the",
"value",
"for",
"this",
"field",
".",
"The",
"value",
"is",
"not",
"validated",
"this",
"is",
"just",
"to",
"be",
"referred",
"to",
"later",
"for",
"example",
"for",
"showing",
"to",
"the",
"visitor"
] | 7318eff1b81a3c103c4263466d09b7f3593b70b9 | https://github.com/Wedeto/HTTP/blob/7318eff1b81a3c103c4263466d09b7f3593b70b9/src/Forms/FormField.php#L439-L449 |
25,523 | Wedeto/HTTP | src/Forms/FormField.php | FormField.formatErrorMessage | public static function formatErrorMessage(array $error_message)
{
$msg = $error_message['msg'] ?? "";
$context = $error_message['context'] ?? [];
if (class_exists("Wedeto\I18n\I18nShortcut"))
{
return t($msg, $context);
}
return WF::fillPlaceholders($msg,... | php | public static function formatErrorMessage(array $error_message)
{
$msg = $error_message['msg'] ?? "";
$context = $error_message['context'] ?? [];
if (class_exists("Wedeto\I18n\I18nShortcut"))
{
return t($msg, $context);
}
return WF::fillPlaceholders($msg,... | [
"public",
"static",
"function",
"formatErrorMessage",
"(",
"array",
"$",
"error_message",
")",
"{",
"$",
"msg",
"=",
"$",
"error_message",
"[",
"'msg'",
"]",
"??",
"\"\"",
";",
"$",
"context",
"=",
"$",
"error_message",
"[",
"'context'",
"]",
"??",
"[",
... | Format the error message into a single string
@return string The formatted error message | [
"Format",
"the",
"error",
"message",
"into",
"a",
"single",
"string"
] | 7318eff1b81a3c103c4263466d09b7f3593b70b9 | https://github.com/Wedeto/HTTP/blob/7318eff1b81a3c103c4263466d09b7f3593b70b9/src/Forms/FormField.php#L499-L509 |
25,524 | onoi/callback-container | src/CallbackContainerBuilder.php | CallbackContainerBuilder.registerObject | public function registerObject( $serviceName, $instance ) {
if ( !is_string( $serviceName ) ) {
throw new InvalidParameterTypeException( "Expected a string" );
}
if ( isset( $this->aliases[$serviceName] ) ) {
throw new ServiceAliasMismatchException( $serviceName );
}
unset( $this->singletons[$service... | php | public function registerObject( $serviceName, $instance ) {
if ( !is_string( $serviceName ) ) {
throw new InvalidParameterTypeException( "Expected a string" );
}
if ( isset( $this->aliases[$serviceName] ) ) {
throw new ServiceAliasMismatchException( $serviceName );
}
unset( $this->singletons[$service... | [
"public",
"function",
"registerObject",
"(",
"$",
"serviceName",
",",
"$",
"instance",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"serviceName",
")",
")",
"{",
"throw",
"new",
"InvalidParameterTypeException",
"(",
"\"Expected a string\"",
")",
";",
"}",
... | If you are not running PHPUnit or for that matter any other testing
environment then you are not suppose to use this function.
@since 2.0
{@inheritDoc} | [
"If",
"you",
"are",
"not",
"running",
"PHPUnit",
"or",
"for",
"that",
"matter",
"any",
"other",
"testing",
"environment",
"then",
"you",
"are",
"not",
"suppose",
"to",
"use",
"this",
"function",
"."
] | 70d2266c19b4bf0b4e78672fea340d8fdefb7500 | https://github.com/onoi/callback-container/blob/70d2266c19b4bf0b4e78672fea340d8fdefb7500/src/CallbackContainerBuilder.php#L104-L118 |
25,525 | jfadich/json-property | src/JsonPropertyTrait.php | JsonPropertyTrait.saveJsonString | public function saveJsonString($property, $jsonString)
{
$this->jsonManager()->isJsonProperty($property, true);
$this->{$property} = $jsonString;
} | php | public function saveJsonString($property, $jsonString)
{
$this->jsonManager()->isJsonProperty($property, true);
$this->{$property} = $jsonString;
} | [
"public",
"function",
"saveJsonString",
"(",
"$",
"property",
",",
"$",
"jsonString",
")",
"{",
"$",
"this",
"->",
"jsonManager",
"(",
")",
"->",
"isJsonProperty",
"(",
"$",
"property",
",",
"true",
")",
";",
"$",
"this",
"->",
"{",
"$",
"property",
"}... | Set the raw json string on the model
@param string $property
@param string $jsonString
@throws JsonPropertyException | [
"Set",
"the",
"raw",
"json",
"string",
"on",
"the",
"model"
] | 3c11ac731a7bc206529058a94047eeafa5827b15 | https://github.com/jfadich/json-property/blob/3c11ac731a7bc206529058a94047eeafa5827b15/src/JsonPropertyTrait.php#L34-L39 |
25,526 | jfadich/json-property | src/JsonPropertyTrait.php | JsonPropertyTrait.jsonManager | private function jsonManager()
{
if($this->jsonManager === null)
$this->jsonManager = new JsonManager($this, $this->jsonProperty);
return $this->jsonManager;
} | php | private function jsonManager()
{
if($this->jsonManager === null)
$this->jsonManager = new JsonManager($this, $this->jsonProperty);
return $this->jsonManager;
} | [
"private",
"function",
"jsonManager",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"jsonManager",
"===",
"null",
")",
"$",
"this",
"->",
"jsonManager",
"=",
"new",
"JsonManager",
"(",
"$",
"this",
",",
"$",
"this",
"->",
"jsonProperty",
")",
";",
"retu... | Get the JsonManager instance
@return JsonManager | [
"Get",
"the",
"JsonManager",
"instance"
] | 3c11ac731a7bc206529058a94047eeafa5827b15 | https://github.com/jfadich/json-property/blob/3c11ac731a7bc206529058a94047eeafa5827b15/src/JsonPropertyTrait.php#L64-L70 |
25,527 | ekyna/PaymentBundle | Install/PaymentInstaller.php | PaymentInstaller.createImageFolder | private function createImageFolder()
{
$em = $this->container->get('ekyna_payment.method.manager');
$folderRepository = $this->container->get('ekyna_media.folder.repository');
if (null === $rootFolder = $folderRepository->findRoot()) {
throw new \RuntimeException('Can\'t find ro... | php | private function createImageFolder()
{
$em = $this->container->get('ekyna_payment.method.manager');
$folderRepository = $this->container->get('ekyna_media.folder.repository');
if (null === $rootFolder = $folderRepository->findRoot()) {
throw new \RuntimeException('Can\'t find ro... | [
"private",
"function",
"createImageFolder",
"(",
")",
"{",
"$",
"em",
"=",
"$",
"this",
"->",
"container",
"->",
"get",
"(",
"'ekyna_payment.method.manager'",
")",
";",
"$",
"folderRepository",
"=",
"$",
"this",
"->",
"container",
"->",
"get",
"(",
"'ekyna_m... | Creates the payment images folder.
@return Folder | [
"Creates",
"the",
"payment",
"images",
"folder",
"."
] | 1b4f4103b28e3a4f8dbfac2cbd872d728238f4d1 | https://github.com/ekyna/PaymentBundle/blob/1b4f4103b28e3a4f8dbfac2cbd872d728238f4d1/Install/PaymentInstaller.php#L52-L81 |
25,528 | mglaman/toolstack-helper | src/Stacks/Drupal.php | Drupal.getMakefiles | public function getMakefiles($dir)
{
$finder = new Finder();
$finder->in($dir)
->files()
->depth('< 1')
->name('*.make*');
return $finder;
} | php | public function getMakefiles($dir)
{
$finder = new Finder();
$finder->in($dir)
->files()
->depth('< 1')
->name('*.make*');
return $finder;
} | [
"public",
"function",
"getMakefiles",
"(",
"$",
"dir",
")",
"{",
"$",
"finder",
"=",
"new",
"Finder",
"(",
")",
";",
"$",
"finder",
"->",
"in",
"(",
"$",
"dir",
")",
"->",
"files",
"(",
")",
"->",
"depth",
"(",
"'< 1'",
")",
"->",
"name",
"(",
... | Return Finder with all makefiles in directory.
@param $dir
@return \Symfony\Component\Finder\Finder | [
"Return",
"Finder",
"with",
"all",
"makefiles",
"in",
"directory",
"."
] | 1b3b93ac284a6c77286988b5d41c75509dd3dc20 | https://github.com/mglaman/toolstack-helper/blob/1b3b93ac284a6c77286988b5d41c75509dd3dc20/src/Stacks/Drupal.php#L41-L49 |
25,529 | mglaman/toolstack-helper | src/Stacks/Drupal.php | Drupal.source | public function source($dir)
{
// Check if unbuilt Drupal
foreach ($this->getMakefiles($dir) as $file) {
$f = fopen($file, 'r');
$peek = fread($f, 1000);
fclose($f);
if (strpos($peek, 'api') !== FALSE && strpos($peek, 'core') !== FALSE) {
... | php | public function source($dir)
{
// Check if unbuilt Drupal
foreach ($this->getMakefiles($dir) as $file) {
$f = fopen($file, 'r');
$peek = fread($f, 1000);
fclose($f);
if (strpos($peek, 'api') !== FALSE && strpos($peek, 'core') !== FALSE) {
... | [
"public",
"function",
"source",
"(",
"$",
"dir",
")",
"{",
"// Check if unbuilt Drupal",
"foreach",
"(",
"$",
"this",
"->",
"getMakefiles",
"(",
"$",
"dir",
")",
"as",
"$",
"file",
")",
"{",
"$",
"f",
"=",
"fopen",
"(",
"$",
"file",
",",
"'r'",
")",
... | Checks if Drupal project, but source.
@param $dir
@return bool | [
"Checks",
"if",
"Drupal",
"project",
"but",
"source",
"."
] | 1b3b93ac284a6c77286988b5d41c75509dd3dc20 | https://github.com/mglaman/toolstack-helper/blob/1b3b93ac284a6c77286988b5d41c75509dd3dc20/src/Stacks/Drupal.php#L58-L71 |
25,530 | stubbles/stubbles-dbal | src/main/php/config/PropertyBasedDatabaseConfigurations.php | PropertyBasedDatabaseConfigurations.contain | public function contain(string $id): bool
{
if ($this->properties()->containSection($id)) {
return true;
}
return $this->hasFallback();
} | php | public function contain(string $id): bool
{
if ($this->properties()->containSection($id)) {
return true;
}
return $this->hasFallback();
} | [
"public",
"function",
"contain",
"(",
"string",
"$",
"id",
")",
":",
"bool",
"{",
"if",
"(",
"$",
"this",
"->",
"properties",
"(",
")",
"->",
"containSection",
"(",
"$",
"id",
")",
")",
"{",
"return",
"true",
";",
"}",
"return",
"$",
"this",
"->",
... | checks whether database configuration for given id exists
@param string $id
@return bool | [
"checks",
"whether",
"database",
"configuration",
"for",
"given",
"id",
"exists"
] | b42a589025a9e511b40a2798ac84df94d6451c36 | https://github.com/stubbles/stubbles-dbal/blob/b42a589025a9e511b40a2798ac84df94d6451c36/src/main/php/config/PropertyBasedDatabaseConfigurations.php#L82-L89 |
25,531 | stubbles/stubbles-dbal | src/main/php/config/PropertyBasedDatabaseConfigurations.php | PropertyBasedDatabaseConfigurations.get | public function get(string $id)
{
if (!$this->properties()->containSection($id)) {
if (!$this->hasFallback()) {
throw new \OutOfBoundsException('No database configuration known for database requested with id ' . $id);
}
$id = DatabaseConfiguration::DEFAUL... | php | public function get(string $id)
{
if (!$this->properties()->containSection($id)) {
if (!$this->hasFallback()) {
throw new \OutOfBoundsException('No database configuration known for database requested with id ' . $id);
}
$id = DatabaseConfiguration::DEFAUL... | [
"public",
"function",
"get",
"(",
"string",
"$",
"id",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"properties",
"(",
")",
"->",
"containSection",
"(",
"$",
"id",
")",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"hasFallback",
"(",
")",
")",
... | returns database configuration with given id
@param string $id
@return \stubbles\db\config\DatabaseConfiguration
@throws \OutOfBoundsException in case no configuration for given id is found and fallback is disabled
@throws \LogicException in case the found configuration misses the dsn property | [
"returns",
"database",
"configuration",
"with",
"given",
"id"
] | b42a589025a9e511b40a2798ac84df94d6451c36 | https://github.com/stubbles/stubbles-dbal/blob/b42a589025a9e511b40a2798ac84df94d6451c36/src/main/php/config/PropertyBasedDatabaseConfigurations.php#L99-L118 |
25,532 | stubbles/stubbles-dbal | src/main/php/config/PropertyBasedDatabaseConfigurations.php | PropertyBasedDatabaseConfigurations.properties | protected function properties(): Properties
{
if (null === $this->dbProperties) {
$this->dbProperties = Properties::fromFile($this->configPath . '/' . $this->descriptor . '.ini');
}
return $this->dbProperties;
} | php | protected function properties(): Properties
{
if (null === $this->dbProperties) {
$this->dbProperties = Properties::fromFile($this->configPath . '/' . $this->descriptor . '.ini');
}
return $this->dbProperties;
} | [
"protected",
"function",
"properties",
"(",
")",
":",
"Properties",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"dbProperties",
")",
"{",
"$",
"this",
"->",
"dbProperties",
"=",
"Properties",
"::",
"fromFile",
"(",
"$",
"this",
"->",
"configPath",
... | reads properties if not done yet
@return \stubbles\values\Properties | [
"reads",
"properties",
"if",
"not",
"done",
"yet"
] | b42a589025a9e511b40a2798ac84df94d6451c36 | https://github.com/stubbles/stubbles-dbal/blob/b42a589025a9e511b40a2798ac84df94d6451c36/src/main/php/config/PropertyBasedDatabaseConfigurations.php#L125-L132 |
25,533 | SagittariusX/Beluga.IO | src/Beluga/IO/Path.php | Path.RemoveWorkingDir | public static function RemoveWorkingDir( string $path = null ) : string
{
if ( \is_null( $path ) )
{
return '';
}
$wd = '~^' . \preg_quote( static::Unixize( \getcwd() ) . '/' ) . '~';
return \preg_replace( $wd, '', static::Unixize( $path ) );
} | php | public static function RemoveWorkingDir( string $path = null ) : string
{
if ( \is_null( $path ) )
{
return '';
}
$wd = '~^' . \preg_quote( static::Unixize( \getcwd() ) . '/' ) . '~';
return \preg_replace( $wd, '', static::Unixize( $path ) );
} | [
"public",
"static",
"function",
"RemoveWorkingDir",
"(",
"string",
"$",
"path",
"=",
"null",
")",
":",
"string",
"{",
"if",
"(",
"\\",
"is_null",
"(",
"$",
"path",
")",
")",
"{",
"return",
"''",
";",
"}",
"$",
"wd",
"=",
"'~^'",
".",
"\\",
"preg_qu... | Removes the current working directory from defined path, if it starts with it.
@param string $path
@return string | [
"Removes",
"the",
"current",
"working",
"directory",
"from",
"defined",
"path",
"if",
"it",
"starts",
"with",
"it",
"."
] | c8af09a1b3cc8a955e43c89b70779d11b30ae29e | https://github.com/SagittariusX/Beluga.IO/blob/c8af09a1b3cc8a955e43c89b70779d11b30ae29e/src/Beluga/IO/Path.php#L172-L184 |
25,534 | TiMESPLiNTER/tsFramework | src/ch/timesplinter/core/ErrorHandler.php | ErrorHandler.handlePHPError | public function handlePHPError($error_number, $error, $error_file, $error_line)
{
// respect the current error_reporting setting
if((error_reporting() & $error_number) === 0)
return;
throw new PHPException($error_number, $error, $error_file, $error_line);
} | php | public function handlePHPError($error_number, $error, $error_file, $error_line)
{
// respect the current error_reporting setting
if((error_reporting() & $error_number) === 0)
return;
throw new PHPException($error_number, $error, $error_file, $error_line);
} | [
"public",
"function",
"handlePHPError",
"(",
"$",
"error_number",
",",
"$",
"error",
",",
"$",
"error_file",
",",
"$",
"error_line",
")",
"{",
"// respect the current error_reporting setting",
"if",
"(",
"(",
"error_reporting",
"(",
")",
"&",
"$",
"error_number",
... | Catches all the PHP errors and convert them into a PHP exception
@param int $error_number
@param string $error
@param string $error_file
@param int $error_line
@throws PHPException | [
"Catches",
"all",
"the",
"PHP",
"errors",
"and",
"convert",
"them",
"into",
"a",
"PHP",
"exception"
] | b3b9fd98f6d456a9e571015877ecca203786fd0c | https://github.com/TiMESPLiNTER/tsFramework/blob/b3b9fd98f6d456a9e571015877ecca203786fd0c/src/ch/timesplinter/core/ErrorHandler.php#L34-L41 |
25,535 | TiMESPLiNTER/tsFramework | src/ch/timesplinter/core/ErrorHandler.php | ErrorHandler.handleException | public function handleException(\Exception $e)
{
$environment = $this->core->getCurrentDomain()->environment;
if(isset($this->core->getSettings()->errorhandling->controller->$environment) === true) {
$controller = FrameworkUtils::stringToClassName($this->core->getSettings()->errorhandling->controller->... | php | public function handleException(\Exception $e)
{
$environment = $this->core->getCurrentDomain()->environment;
if(isset($this->core->getSettings()->errorhandling->controller->$environment) === true) {
$controller = FrameworkUtils::stringToClassName($this->core->getSettings()->errorhandling->controller->... | [
"public",
"function",
"handleException",
"(",
"\\",
"Exception",
"$",
"e",
")",
"{",
"$",
"environment",
"=",
"$",
"this",
"->",
"core",
"->",
"getCurrentDomain",
"(",
")",
"->",
"environment",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"core",
"... | Default stub for print an exception
@param \Exception $e | [
"Default",
"stub",
"for",
"print",
"an",
"exception"
] | b3b9fd98f6d456a9e571015877ecca203786fd0c | https://github.com/TiMESPLiNTER/tsFramework/blob/b3b9fd98f6d456a9e571015877ecca203786fd0c/src/ch/timesplinter/core/ErrorHandler.php#L48-L86 |
25,536 | buildok/validator | src/types/StringValidator.php | StringValidator.maxLength | private function maxLength()
{
$max = mb_strlen($this->value);
if (!$ret = $max <= $this->options->max) {
$this->error(1);
}
return $ret;
} | php | private function maxLength()
{
$max = mb_strlen($this->value);
if (!$ret = $max <= $this->options->max) {
$this->error(1);
}
return $ret;
} | [
"private",
"function",
"maxLength",
"(",
")",
"{",
"$",
"max",
"=",
"mb_strlen",
"(",
"$",
"this",
"->",
"value",
")",
";",
"if",
"(",
"!",
"$",
"ret",
"=",
"$",
"max",
"<=",
"$",
"this",
"->",
"options",
"->",
"max",
")",
"{",
"$",
"this",
"->... | Check max length
@return boolean | [
"Check",
"max",
"length"
] | 3612ebca7901c84be2f26f641470933e468a0811 | https://github.com/buildok/validator/blob/3612ebca7901c84be2f26f641470933e468a0811/src/types/StringValidator.php#L42-L50 |
25,537 | buildok/validator | src/types/StringValidator.php | StringValidator.minLength | private function minLength()
{
$min = mb_strlen($this->value);
if (!$ret = $min >= $this->options->min) {
$this->error(2);
}
return $ret;
} | php | private function minLength()
{
$min = mb_strlen($this->value);
if (!$ret = $min >= $this->options->min) {
$this->error(2);
}
return $ret;
} | [
"private",
"function",
"minLength",
"(",
")",
"{",
"$",
"min",
"=",
"mb_strlen",
"(",
"$",
"this",
"->",
"value",
")",
";",
"if",
"(",
"!",
"$",
"ret",
"=",
"$",
"min",
">=",
"$",
"this",
"->",
"options",
"->",
"min",
")",
"{",
"$",
"this",
"->... | Check min length
@return boolean | [
"Check",
"min",
"length"
] | 3612ebca7901c84be2f26f641470933e468a0811 | https://github.com/buildok/validator/blob/3612ebca7901c84be2f26f641470933e468a0811/src/types/StringValidator.php#L56-L64 |
25,538 | Wedeto/Util | src/DI/DefaultFactory.php | DefaultFactory.determineArgumentsFor | protected function determineArgumentsFor(
ReflectionMethod $method,
string $class,
string $method_name,
array $args,
string $selector,
Injector $injector
)
{
$params = $method->getParameters();
$method_args = [];
// Determine values f... | php | protected function determineArgumentsFor(
ReflectionMethod $method,
string $class,
string $method_name,
array $args,
string $selector,
Injector $injector
)
{
$params = $method->getParameters();
$method_args = [];
// Determine values f... | [
"protected",
"function",
"determineArgumentsFor",
"(",
"ReflectionMethod",
"$",
"method",
",",
"string",
"$",
"class",
",",
"string",
"$",
"method_name",
",",
"array",
"$",
"args",
",",
"string",
"$",
"selector",
",",
"Injector",
"$",
"injector",
")",
"{",
"... | Find arguments for a method | [
"Find",
"arguments",
"for",
"a",
"method"
] | 0e080251bbaa8e7d91ae8d02eb79c029c976744a | https://github.com/Wedeto/Util/blob/0e080251bbaa8e7d91ae8d02eb79c029c976744a/src/DI/DefaultFactory.php#L115-L165 |
25,539 | squareproton/Bond | src/Bond/Database/Enum.php | Enum.getValues | public function getValues( $name )
{
if( !isset( $this->enums[$name] ) ) {
throw new UnknownEnumException($name);
}
return $this->enums[$name];
} | php | public function getValues( $name )
{
if( !isset( $this->enums[$name] ) ) {
throw new UnknownEnumException($name);
}
return $this->enums[$name];
} | [
"public",
"function",
"getValues",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"enums",
"[",
"$",
"name",
"]",
")",
")",
"{",
"throw",
"new",
"UnknownEnumException",
"(",
"$",
"name",
")",
";",
"}",
"return",
"$",
... | Public accessor for enum options
@param string
@return array Allowed values | [
"Public",
"accessor",
"for",
"enum",
"options"
] | a04ad9dd1a35adeaec98237716c2a41ce02b4f1a | https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/Database/Enum.php#L36-L42 |
25,540 | squareproton/Bond | src/Bond/Database/Enum.php | Enum.isValid | public function isValid( $name, $value = null )
{
if( !isset( $this->enums[$name] ) ) {
return false;
} elseif( $value === null ) {
return true;
}
return !isset( $value ) || in_array( $value, $this->enums[$name] );
} | php | public function isValid( $name, $value = null )
{
if( !isset( $this->enums[$name] ) ) {
return false;
} elseif( $value === null ) {
return true;
}
return !isset( $value ) || in_array( $value, $this->enums[$name] );
} | [
"public",
"function",
"isValid",
"(",
"$",
"name",
",",
"$",
"value",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"enums",
"[",
"$",
"name",
"]",
")",
")",
"{",
"return",
"false",
";",
"}",
"elseif",
"(",
"$",
"value... | Is valid check
@param string enum name
@param string value
@return bool | [
"Is",
"valid",
"check"
] | a04ad9dd1a35adeaec98237716c2a41ce02b4f1a | https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/Database/Enum.php#L60-L68 |
25,541 | squareproton/Bond | src/Bond/Database/Enum.php | Enum.getRandomValue | public function getRandomValue( $name )
{
if( !isset( $this->enums[$name] ) ) {
throw new UnknownEnumException($name);
}
return $this->enums[$name][array_rand($this->enums[$name])];
} | php | public function getRandomValue( $name )
{
if( !isset( $this->enums[$name] ) ) {
throw new UnknownEnumException($name);
}
return $this->enums[$name][array_rand($this->enums[$name])];
} | [
"public",
"function",
"getRandomValue",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"enums",
"[",
"$",
"name",
"]",
")",
")",
"{",
"throw",
"new",
"UnknownEnumException",
"(",
"$",
"name",
")",
";",
"}",
"return",
"... | Get a random value from a enum. Primarily used by the import script
@return string | [
"Get",
"a",
"random",
"value",
"from",
"a",
"enum",
".",
"Primarily",
"used",
"by",
"the",
"import",
"script"
] | a04ad9dd1a35adeaec98237716c2a41ce02b4f1a | https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/Database/Enum.php#L74-L80 |
25,542 | eureka-framework/component-http | src/Http/Message/ResponseSender.php | ResponseSender.writeStatus | private function writeStatus()
{
$string = $this->response->getProtocolVersion() . ' ' . $this->response->getStatusCode() . ' ' . $this->response->getReasonPhrase();
header($string, true, $this->response->getStatusCode());
} | php | private function writeStatus()
{
$string = $this->response->getProtocolVersion() . ' ' . $this->response->getStatusCode() . ' ' . $this->response->getReasonPhrase();
header($string, true, $this->response->getStatusCode());
} | [
"private",
"function",
"writeStatus",
"(",
")",
"{",
"$",
"string",
"=",
"$",
"this",
"->",
"response",
"->",
"getProtocolVersion",
"(",
")",
".",
"' '",
".",
"$",
"this",
"->",
"response",
"->",
"getStatusCode",
"(",
")",
".",
"' '",
".",
"$",
"this",... | Write response status
@return void | [
"Write",
"response",
"status"
] | 698c3b73581a9703a9c932890c57e50f8774607a | https://github.com/eureka-framework/component-http/blob/698c3b73581a9703a9c932890c57e50f8774607a/src/Http/Message/ResponseSender.php#L51-L55 |
25,543 | eureka-framework/component-http | src/Http/Message/ResponseSender.php | ResponseSender.writeHeaders | private function writeHeaders()
{
$headers = $this->response->getHeaders();
foreach ($headers as $name => $list) {
header("$name: " . implode(', ', $list));
}
} | php | private function writeHeaders()
{
$headers = $this->response->getHeaders();
foreach ($headers as $name => $list) {
header("$name: " . implode(', ', $list));
}
} | [
"private",
"function",
"writeHeaders",
"(",
")",
"{",
"$",
"headers",
"=",
"$",
"this",
"->",
"response",
"->",
"getHeaders",
"(",
")",
";",
"foreach",
"(",
"$",
"headers",
"as",
"$",
"name",
"=>",
"$",
"list",
")",
"{",
"header",
"(",
"\"$name: \"",
... | Write headers.
@return void | [
"Write",
"headers",
"."
] | 698c3b73581a9703a9c932890c57e50f8774607a | https://github.com/eureka-framework/component-http/blob/698c3b73581a9703a9c932890c57e50f8774607a/src/Http/Message/ResponseSender.php#L62-L68 |
25,544 | flextype-components/notification | Notification.php | Notification.get | public static function get(string $key)
{
return isset(Notification::$notifications[$key]) ? Notification::$notifications[$key] : null;
} | php | public static function get(string $key)
{
return isset(Notification::$notifications[$key]) ? Notification::$notifications[$key] : null;
} | [
"public",
"static",
"function",
"get",
"(",
"string",
"$",
"key",
")",
"{",
"return",
"isset",
"(",
"Notification",
"::",
"$",
"notifications",
"[",
"$",
"key",
"]",
")",
"?",
"Notification",
"::",
"$",
"notifications",
"[",
"$",
"key",
"]",
":",
"null... | Returns a specific variable from the Notifications array.
echo Notification::get('success');
echo Notification::get('errors');
@param string $key Variable name
@return mixed | [
"Returns",
"a",
"specific",
"variable",
"from",
"the",
"Notifications",
"array",
"."
] | 5a813df5a455a06efab672ae19ca1ce106584c16 | https://github.com/flextype-components/notification/blob/5a813df5a455a06efab672ae19ca1ce106584c16/Notification.php#L40-L43 |
25,545 | flextype-components/notification | Notification.php | Notification.set | public static function set(string $key, $value) : void
{
$_SESSION[Notification::SESSION_KEY][$key] = $value;
} | php | public static function set(string $key, $value) : void
{
$_SESSION[Notification::SESSION_KEY][$key] = $value;
} | [
"public",
"static",
"function",
"set",
"(",
"string",
"$",
"key",
",",
"$",
"value",
")",
":",
"void",
"{",
"$",
"_SESSION",
"[",
"Notification",
"::",
"SESSION_KEY",
"]",
"[",
"$",
"key",
"]",
"=",
"$",
"value",
";",
"}"
] | Adds specific variable to the Notifications array.
Notification::set('success', 'Data has been saved with success!');
Notification::set('errors', 'Data not saved!');
@param string $key Variable name
@param mixed $value Variable value | [
"Adds",
"specific",
"variable",
"to",
"the",
"Notifications",
"array",
"."
] | 5a813df5a455a06efab672ae19ca1ce106584c16 | https://github.com/flextype-components/notification/blob/5a813df5a455a06efab672ae19ca1ce106584c16/Notification.php#L54-L57 |
25,546 | flextype-components/notification | Notification.php | Notification.init | public static function init() : void
{
if ( ! empty($_SESSION[Notification::SESSION_KEY]) && is_array($_SESSION[Notification::SESSION_KEY])) {
Notification::$notifications = $_SESSION[Notification::SESSION_KEY];
}
$_SESSION[Notification::SESSION_KEY] = [];
} | php | public static function init() : void
{
if ( ! empty($_SESSION[Notification::SESSION_KEY]) && is_array($_SESSION[Notification::SESSION_KEY])) {
Notification::$notifications = $_SESSION[Notification::SESSION_KEY];
}
$_SESSION[Notification::SESSION_KEY] = [];
} | [
"public",
"static",
"function",
"init",
"(",
")",
":",
"void",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"_SESSION",
"[",
"Notification",
"::",
"SESSION_KEY",
"]",
")",
"&&",
"is_array",
"(",
"$",
"_SESSION",
"[",
"Notification",
"::",
"SESSION_KEY",
"]",
... | Initializes the Notification service.
Notification::init();
This will read notification/flash data from the $_SESSION variable and load it into
the $this->previous array. | [
"Initializes",
"the",
"Notification",
"service",
"."
] | 5a813df5a455a06efab672ae19ca1ce106584c16 | https://github.com/flextype-components/notification/blob/5a813df5a455a06efab672ae19ca1ce106584c16/Notification.php#L93-L100 |
25,547 | mpf-soft/admin-widgets | datatable/columns/actions/Basic.php | Basic.getString | public function getString($row, Table $table) {
if (!$this->isVisible($row)) {
return "";
}
$options = $this->htmlOptions;
if ($this->title != "") {
eval("\$options['title'] = {$this->title};");
} elseif (!isset($options['title'])) {
$options['... | php | public function getString($row, Table $table) {
if (!$this->isVisible($row)) {
return "";
}
$options = $this->htmlOptions;
if ($this->title != "") {
eval("\$options['title'] = {$this->title};");
} elseif (!isset($options['title'])) {
$options['... | [
"public",
"function",
"getString",
"(",
"$",
"row",
",",
"Table",
"$",
"table",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"isVisible",
"(",
"$",
"row",
")",
")",
"{",
"return",
"\"\"",
";",
"}",
"$",
"options",
"=",
"$",
"this",
"->",
"htmlOpt... | Final result, a HTML Element for current action;
@param Model $row
@param \mpf\widgets\datatable\Table $table
@return string | [
"Final",
"result",
"a",
"HTML",
"Element",
"for",
"current",
"action",
";"
] | 92597f9a09d086664268d6b7e0111d5a5586d8c7 | https://github.com/mpf-soft/admin-widgets/blob/92597f9a09d086664268d6b7e0111d5a5586d8c7/datatable/columns/actions/Basic.php#L149-L191 |
25,548 | mpf-soft/admin-widgets | datatable/columns/actions/Basic.php | Basic.getIcon | public function getIcon($title, Table $table) {
if ($this->icon) {
$icon = str_replace(array('%DATATABLE_ASSETS%', '%SIZE%'), array($table->getAssetsURL(), $this->iconSize . 'x' . $this->iconSize), $this->icon);
if ('%MPF_ASSETS%' == substr($icon, 0, 12)) {
$icon = Assets... | php | public function getIcon($title, Table $table) {
if ($this->icon) {
$icon = str_replace(array('%DATATABLE_ASSETS%', '%SIZE%'), array($table->getAssetsURL(), $this->iconSize . 'x' . $this->iconSize), $this->icon);
if ('%MPF_ASSETS%' == substr($icon, 0, 12)) {
$icon = Assets... | [
"public",
"function",
"getIcon",
"(",
"$",
"title",
",",
"Table",
"$",
"table",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"icon",
")",
"{",
"$",
"icon",
"=",
"str_replace",
"(",
"array",
"(",
"'%DATATABLE_ASSETS%'",
",",
"'%SIZE%'",
")",
",",
"array",
... | Get HTML img tag for icon or an empty string if there is no icon
@param string $title
@param \mpf\widgets\datatable\Table $table
@return string | [
"Get",
"HTML",
"img",
"tag",
"for",
"icon",
"or",
"an",
"empty",
"string",
"if",
"there",
"is",
"no",
"icon"
] | 92597f9a09d086664268d6b7e0111d5a5586d8c7 | https://github.com/mpf-soft/admin-widgets/blob/92597f9a09d086664268d6b7e0111d5a5586d8c7/datatable/columns/actions/Basic.php#L199-L208 |
25,549 | mpf-soft/admin-widgets | datatable/columns/actions/Basic.php | Basic.isVisible | public function isVisible($row) {
if (false === $this->visible) // check if it's visible
return false;
elseif (is_string($this->visible)) {
$visible = true;
eval("\$visible = {$this->visible};");
if (false == $visible)
return false;
... | php | public function isVisible($row) {
if (false === $this->visible) // check if it's visible
return false;
elseif (is_string($this->visible)) {
$visible = true;
eval("\$visible = {$this->visible};");
if (false == $visible)
return false;
... | [
"public",
"function",
"isVisible",
"(",
"$",
"row",
")",
"{",
"if",
"(",
"false",
"===",
"$",
"this",
"->",
"visible",
")",
"// check if it's visible",
"return",
"false",
";",
"elseif",
"(",
"is_string",
"(",
"$",
"this",
"->",
"visible",
")",
")",
"{",
... | Checks if action is visible or not
@return boolean | [
"Checks",
"if",
"action",
"is",
"visible",
"or",
"not"
] | 92597f9a09d086664268d6b7e0111d5a5586d8c7 | https://github.com/mpf-soft/admin-widgets/blob/92597f9a09d086664268d6b7e0111d5a5586d8c7/datatable/columns/actions/Basic.php#L214-L224 |
25,550 | weareunite/unisys-transactions | src/Http/Controllers/HandleTransaction.php | HandleTransaction.allTransactions | public function allTransactions(int $id)
{
/** @var HasTransactionsInterface $object */
if(!$object = $this->repository->find($id)) {
abort(404);
}
$transactions = $object->getLatestTransactions();
return TransactionResource::collection($transactions);
} | php | public function allTransactions(int $id)
{
/** @var HasTransactionsInterface $object */
if(!$object = $this->repository->find($id)) {
abort(404);
}
$transactions = $object->getLatestTransactions();
return TransactionResource::collection($transactions);
} | [
"public",
"function",
"allTransactions",
"(",
"int",
"$",
"id",
")",
"{",
"/** @var HasTransactionsInterface $object */",
"if",
"(",
"!",
"$",
"object",
"=",
"$",
"this",
"->",
"repository",
"->",
"find",
"(",
"$",
"id",
")",
")",
"{",
"abort",
"(",
"404",... | Get latest Transactions
Get all transactions order by created desc for given model find by model primary id
@param int $id
@return AnonymousResourceCollection|TransactionResource[] | [
"Get",
"latest",
"Transactions"
] | 3bfaf6993cc209871298340f5dabbe56f1eeab5d | https://github.com/weareunite/unisys-transactions/blob/3bfaf6993cc209871298340f5dabbe56f1eeab5d/src/Http/Controllers/HandleTransaction.php#L51-L61 |
25,551 | agentmedia/phine-core | src/Core/Logic/Util/ArrayLinesSerializer.php | ArrayLinesSerializer.LinesToArray | function LinesToArray($text)
{
$result = array();
$lines = Str::SplitLines($text);
foreach ($lines as $line)
{
$line = trim($line);
if (!$line)
{
continue;
}
$pos = strpos($line, $this->separator);
... | php | function LinesToArray($text)
{
$result = array();
$lines = Str::SplitLines($text);
foreach ($lines as $line)
{
$line = trim($line);
if (!$line)
{
continue;
}
$pos = strpos($line, $this->separator);
... | [
"function",
"LinesToArray",
"(",
"$",
"text",
")",
"{",
"$",
"result",
"=",
"array",
"(",
")",
";",
"$",
"lines",
"=",
"Str",
"::",
"SplitLines",
"(",
"$",
"text",
")",
";",
"foreach",
"(",
"$",
"lines",
"as",
"$",
"line",
")",
"{",
"$",
"line",
... | Fetches the lines of a text and serializes them to an array of key value pairs
@param string $text The text representation of the array
@return array Returns the array representation as associative array | [
"Fetches",
"the",
"lines",
"of",
"a",
"text",
"and",
"serializes",
"them",
"to",
"an",
"array",
"of",
"key",
"value",
"pairs"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Util/ArrayLinesSerializer.php#L36-L58 |
25,552 | brunschgi/TerrificComposerBundle | Controller/SearchController.php | SearchController.searchAction | public function searchAction(Request $request)
{
// get all modules
$moduleManager = $this->get('terrific.composer.module.manager');
$modules = $moduleManager->getModules();
// get all pages
$pageManager = $this->get('terrific.composer.page.manager');
$pages = $pag... | php | public function searchAction(Request $request)
{
// get all modules
$moduleManager = $this->get('terrific.composer.module.manager');
$modules = $moduleManager->getModules();
// get all pages
$pageManager = $this->get('terrific.composer.page.manager');
$pages = $pag... | [
"public",
"function",
"searchAction",
"(",
"Request",
"$",
"request",
")",
"{",
"// get all modules",
"$",
"moduleManager",
"=",
"$",
"this",
"->",
"get",
"(",
"'terrific.composer.module.manager'",
")",
";",
"$",
"modules",
"=",
"$",
"moduleManager",
"->",
"getM... | Displays the terrific component search.
@Route("/search", name="composer_search")
@Template()
@param Request $request
@return Response | [
"Displays",
"the",
"terrific",
"component",
"search",
"."
] | 6eef4ace887c19ef166ab6654de385bc1ffbf5f1 | https://github.com/brunschgi/TerrificComposerBundle/blob/6eef4ace887c19ef166ab6654de385bc1ffbf5f1/Controller/SearchController.php#L40-L54 |
25,553 | ekyna/Resource | Configuration/Configuration.php | Configuration.getClass | private function getClass($key)
{
if (!array_key_exists($key, $this->config['classes'])) {
throw new \InvalidArgumentException(sprintf('Undefined resource class "%s".', $key));
}
return $this->config['classes'][$key];
} | php | private function getClass($key)
{
if (!array_key_exists($key, $this->config['classes'])) {
throw new \InvalidArgumentException(sprintf('Undefined resource class "%s".', $key));
}
return $this->config['classes'][$key];
} | [
"private",
"function",
"getClass",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"key",
",",
"$",
"this",
"->",
"config",
"[",
"'classes'",
"]",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"sprintf",
... | Returns the class for the given key.
@param string $key
@return string | [
"Returns",
"the",
"class",
"for",
"the",
"given",
"key",
"."
] | 96ee3d28e02bd9513705408e3bb7f88a76e52f56 | https://github.com/ekyna/Resource/blob/96ee3d28e02bd9513705408e3bb7f88a76e52f56/Configuration/Configuration.php#L228-L235 |
25,554 | Xiphe/THEWPTOOLS | src/Xiphe/THEWPTOOLS.php | THEWPTOOLS.shorten | public static function shorten($text, $maxlength = 140, $end = '[...]') {
$maxlength++;
if (mb_strlen($text) > $maxlength) {
$subex = mb_substr($text, 0, $maxlength - 5);
$exwords = explode(' ', $subex);
$excut = - (mb_strlen($exwords[count($exwords)-1]));
... | php | public static function shorten($text, $maxlength = 140, $end = '[...]') {
$maxlength++;
if (mb_strlen($text) > $maxlength) {
$subex = mb_substr($text, 0, $maxlength - 5);
$exwords = explode(' ', $subex);
$excut = - (mb_strlen($exwords[count($exwords)-1]));
... | [
"public",
"static",
"function",
"shorten",
"(",
"$",
"text",
",",
"$",
"maxlength",
"=",
"140",
",",
"$",
"end",
"=",
"'[...]'",
")",
"{",
"$",
"maxlength",
"++",
";",
"if",
"(",
"mb_strlen",
"(",
"$",
"text",
")",
">",
"$",
"maxlength",
")",
"{",
... | Builds an excerpt from a longer text.
@param string $text the input text
@param integer $maxlength maximal length of the text
@param string $end a string that will be attached to the short version of $text
@return string | [
"Builds",
"an",
"excerpt",
"from",
"a",
"longer",
"text",
"."
] | 4d36d99f3f55f87e9a664c66d2bdcd8dedf0d780 | https://github.com/Xiphe/THEWPTOOLS/blob/4d36d99f3f55f87e9a664c66d2bdcd8dedf0d780/src/Xiphe/THEWPTOOLS.php#L94-L108 |
25,555 | Xiphe/THEWPTOOLS | src/Xiphe/THEWPTOOLS.php | THEWPTOOLS.get_nav_menu_item_children | function get_nav_menu_item_children( $parent_id, $nav_menu_items, $depth = true ) {
$nav_menu_item_list = array();
foreach ( (array) $nav_menu_items as $nav_menu_item ) {
if ( $nav_menu_item->menu_item_parent == $parent_id ) {
$nav_menu_item_list[] = $nav_menu_item;
... | php | function get_nav_menu_item_children( $parent_id, $nav_menu_items, $depth = true ) {
$nav_menu_item_list = array();
foreach ( (array) $nav_menu_items as $nav_menu_item ) {
if ( $nav_menu_item->menu_item_parent == $parent_id ) {
$nav_menu_item_list[] = $nav_menu_item;
... | [
"function",
"get_nav_menu_item_children",
"(",
"$",
"parent_id",
",",
"$",
"nav_menu_items",
",",
"$",
"depth",
"=",
"true",
")",
"{",
"$",
"nav_menu_item_list",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"(",
"array",
")",
"$",
"nav_menu_items",
"as",
"... | Returns all child nav_menu_items under a specific parent
http://wpsmith.net/2011/wp/how-to-get-all-the-children-of-a-specific-nav-menu-item/
@param int the parent nav_menu_item ID
@param array nav_menu_items
@param bool gives all children or direct children only
@return array returns filtere... | [
"Returns",
"all",
"child",
"nav_menu_items",
"under",
"a",
"specific",
"parent"
] | 4d36d99f3f55f87e9a664c66d2bdcd8dedf0d780 | https://github.com/Xiphe/THEWPTOOLS/blob/4d36d99f3f55f87e9a664c66d2bdcd8dedf0d780/src/Xiphe/THEWPTOOLS.php#L217-L229 |
25,556 | Xiphe/THEWPTOOLS | src/Xiphe/THEWPTOOLS.php | THEWPTOOLS.posted_on | public static function posted_on()
{
return sprintf(__('<span class="sep">Posted on </span><a href="%1$s" title="%2$s" rel="bookmark"><time class="entry-date" datetime="%3$s" pubdate>%4$s</time></a><span class="by-author"> <span class="sep"> by </span> <span class="author vcard"><a class="url fn n" href="... | php | public static function posted_on()
{
return sprintf(__('<span class="sep">Posted on </span><a href="%1$s" title="%2$s" rel="bookmark"><time class="entry-date" datetime="%3$s" pubdate>%4$s</time></a><span class="by-author"> <span class="sep"> by </span> <span class="author vcard"><a class="url fn n" href="... | [
"public",
"static",
"function",
"posted_on",
"(",
")",
"{",
"return",
"sprintf",
"(",
"__",
"(",
"'<span class=\"sep\">Posted on </span><a href=\"%1$s\" title=\"%2$s\" rel=\"bookmark\"><time class=\"entry-date\" datetime=\"%3$s\" pubdate>%4$s</time></a><span class=\"by-author\"> <span class=... | The "Posted by Derp in FooBar" post-meta.
Taken from TwentyEleven Wordpress Theme.
@return string | [
"The",
"Posted",
"by",
"Derp",
"in",
"FooBar",
"post",
"-",
"meta",
".",
"Taken",
"from",
"TwentyEleven",
"Wordpress",
"Theme",
"."
] | 4d36d99f3f55f87e9a664c66d2bdcd8dedf0d780 | https://github.com/Xiphe/THEWPTOOLS/blob/4d36d99f3f55f87e9a664c66d2bdcd8dedf0d780/src/Xiphe/THEWPTOOLS.php#L263-L274 |
25,557 | Xiphe/THEWPTOOLS | src/Xiphe/THEWPTOOLS.php | THEWPTOOLS.get_title | public static function get_title()
{
global $page, $paged;
$r = wp_title('|', false, 'right');
// Add the blog name.
$r .= get_bloginfo('name');
// Add the blog description for the home/front page.
$site_description = get_bloginfo('description', 'display'... | php | public static function get_title()
{
global $page, $paged;
$r = wp_title('|', false, 'right');
// Add the blog name.
$r .= get_bloginfo('name');
// Add the blog description for the home/front page.
$site_description = get_bloginfo('description', 'display'... | [
"public",
"static",
"function",
"get_title",
"(",
")",
"{",
"global",
"$",
"page",
",",
"$",
"paged",
";",
"$",
"r",
"=",
"wp_title",
"(",
"'|'",
",",
"false",
",",
"'right'",
")",
";",
"// Add the blog name.\r",
"$",
"r",
".=",
"get_bloginfo",
"(",
"'... | A Standard title for Wordpress Pages.
Taken from TwentyEleven Wordpress Theme.
@access public
@return string the title. | [
"A",
"Standard",
"title",
"for",
"Wordpress",
"Pages",
".",
"Taken",
"from",
"TwentyEleven",
"Wordpress",
"Theme",
"."
] | 4d36d99f3f55f87e9a664c66d2bdcd8dedf0d780 | https://github.com/Xiphe/THEWPTOOLS/blob/4d36d99f3f55f87e9a664c66d2bdcd8dedf0d780/src/Xiphe/THEWPTOOLS.php#L283-L303 |
25,558 | OxfordInfoLabs/kinikit-core | src/Util/HTTP/HttpRequest.php | HttpRequest.instance | public static function instance($reload = false) {
if (HttpRequest::$instance == null || $reload) {
HttpRequest::$instance = new HttpRequest ();
}
return HttpRequest::$instance;
} | php | public static function instance($reload = false) {
if (HttpRequest::$instance == null || $reload) {
HttpRequest::$instance = new HttpRequest ();
}
return HttpRequest::$instance;
} | [
"public",
"static",
"function",
"instance",
"(",
"$",
"reload",
"=",
"false",
")",
"{",
"if",
"(",
"HttpRequest",
"::",
"$",
"instance",
"==",
"null",
"||",
"$",
"reload",
")",
"{",
"HttpRequest",
"::",
"$",
"instance",
"=",
"new",
"HttpRequest",
"(",
... | Enforce a singleton session object
@return HttpRequest | [
"Enforce",
"a",
"singleton",
"session",
"object"
] | edc1b2e6ffabd595c4c7d322279b3dd1e59ef359 | https://github.com/OxfordInfoLabs/kinikit-core/blob/edc1b2e6ffabd595c4c7d322279b3dd1e59ef359/src/Util/HTTP/HttpRequest.php#L99-L107 |
25,559 | Dhii/iterator-abstract | src/IteratorIteratorTrait.php | IteratorIteratorTrait._advanceTracker | protected function _advanceTracker($tracker)
{
if (!($tracker instanceof Iterator)) {
throw $this->_createInvalidArgumentException($this->__('Can only advance an Iterator tracker'), null, null, $tracker);
}
$tracker->next();
} | php | protected function _advanceTracker($tracker)
{
if (!($tracker instanceof Iterator)) {
throw $this->_createInvalidArgumentException($this->__('Can only advance an Iterator tracker'), null, null, $tracker);
}
$tracker->next();
} | [
"protected",
"function",
"_advanceTracker",
"(",
"$",
"tracker",
")",
"{",
"if",
"(",
"!",
"(",
"$",
"tracker",
"instanceof",
"Iterator",
")",
")",
"{",
"throw",
"$",
"this",
"->",
"_createInvalidArgumentException",
"(",
"$",
"this",
"->",
"__",
"(",
"'Can... | Advances the iterator forward.
@since [*next-version*]
@param Iterator $tracker The iterator used to track the loop.
@throws InvalidArgumentException If problem advancing iterator. | [
"Advances",
"the",
"iterator",
"forward",
"."
] | 576484183865575ffc2a0d586132741329626fb8 | https://github.com/Dhii/iterator-abstract/blob/576484183865575ffc2a0d586132741329626fb8/src/IteratorIteratorTrait.php#L28-L35 |
25,560 | Dhii/iterator-abstract | src/IteratorIteratorTrait.php | IteratorIteratorTrait._resetTracker | protected function _resetTracker($tracker)
{
if (!($tracker instanceof Iterator)) {
throw $this->_createInvalidArgumentException($this->__('Can only reset an Iterator tracker'), null, null, $tracker);
}
$tracker->rewind();
} | php | protected function _resetTracker($tracker)
{
if (!($tracker instanceof Iterator)) {
throw $this->_createInvalidArgumentException($this->__('Can only reset an Iterator tracker'), null, null, $tracker);
}
$tracker->rewind();
} | [
"protected",
"function",
"_resetTracker",
"(",
"$",
"tracker",
")",
"{",
"if",
"(",
"!",
"(",
"$",
"tracker",
"instanceof",
"Iterator",
")",
")",
"{",
"throw",
"$",
"this",
"->",
"_createInvalidArgumentException",
"(",
"$",
"this",
"->",
"__",
"(",
"'Can o... | Reset the iterator back to the start.
@param Iterator $tracker The iterator used to track the loop.
@throws InvalidArgumentException If problem resetting tracker. | [
"Reset",
"the",
"iterator",
"back",
"to",
"the",
"start",
"."
] | 576484183865575ffc2a0d586132741329626fb8 | https://github.com/Dhii/iterator-abstract/blob/576484183865575ffc2a0d586132741329626fb8/src/IteratorIteratorTrait.php#L44-L51 |
25,561 | Dhii/iterator-abstract | src/IteratorIteratorTrait.php | IteratorIteratorTrait._createIterationFromTracker | protected function _createIterationFromTracker($tracker)
{
if (!($tracker instanceof Iterator)) {
throw $this->_createInvalidArgumentException($this->__('Can only create an iteration from an Iterator tracker'), null, null, $tracker);
}
$key = $this->_calculateKey($tracker);
... | php | protected function _createIterationFromTracker($tracker)
{
if (!($tracker instanceof Iterator)) {
throw $this->_createInvalidArgumentException($this->__('Can only create an iteration from an Iterator tracker'), null, null, $tracker);
}
$key = $this->_calculateKey($tracker);
... | [
"protected",
"function",
"_createIterationFromTracker",
"(",
"$",
"tracker",
")",
"{",
"if",
"(",
"!",
"(",
"$",
"tracker",
"instanceof",
"Iterator",
")",
")",
"{",
"throw",
"$",
"this",
"->",
"_createInvalidArgumentException",
"(",
"$",
"this",
"->",
"__",
... | Creates a new iteration using an internal iterator.
@since [*next-version*]
@param Iterator $tracker The iterator used to track the iteration.
@return IterationInterface The new iteration. | [
"Creates",
"a",
"new",
"iteration",
"using",
"an",
"internal",
"iterator",
"."
] | 576484183865575ffc2a0d586132741329626fb8 | https://github.com/Dhii/iterator-abstract/blob/576484183865575ffc2a0d586132741329626fb8/src/IteratorIteratorTrait.php#L62-L72 |
25,562 | DreadLabs/typo3-cms-phing-helper | Classes/Utility/TYPO3/ArrayUtility.php | ArrayUtility.sortByKeyRecursive | static public function sortByKeyRecursive(array $array)
{
ksort($array);
foreach ($array as $key => $value) {
if (is_array($value) && !empty($value)) {
$array[$key] = self::sortByKeyRecursive($value);
}
}
return $array;
} | php | static public function sortByKeyRecursive(array $array)
{
ksort($array);
foreach ($array as $key => $value) {
if (is_array($value) && !empty($value)) {
$array[$key] = self::sortByKeyRecursive($value);
}
}
return $array;
} | [
"static",
"public",
"function",
"sortByKeyRecursive",
"(",
"array",
"$",
"array",
")",
"{",
"ksort",
"(",
"$",
"array",
")",
";",
"foreach",
"(",
"$",
"array",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"value",
... | Sorts an array recursively by key
@param $array Array to sort recursively by key
@return array Sorted array | [
"Sorts",
"an",
"array",
"recursively",
"by",
"key"
] | b6606102c4702a92bc1872eba962febceaa0e645 | https://github.com/DreadLabs/typo3-cms-phing-helper/blob/b6606102c4702a92bc1872eba962febceaa0e645/Classes/Utility/TYPO3/ArrayUtility.php#L80-L90 |
25,563 | DreadLabs/typo3-cms-phing-helper | Classes/Utility/TYPO3/ArrayUtility.php | ArrayUtility.renumberKeysToAvoidLeapsIfKeysAreAllNumeric | static public function renumberKeysToAvoidLeapsIfKeysAreAllNumeric(array $array = array(), $level = 0)
{
$level++;
$allKeysAreNumeric = TRUE;
foreach (array_keys($array) as $key) {
if (is_numeric($key) === FALSE) {
$allKeysAreNumeric = FALSE;
break... | php | static public function renumberKeysToAvoidLeapsIfKeysAreAllNumeric(array $array = array(), $level = 0)
{
$level++;
$allKeysAreNumeric = TRUE;
foreach (array_keys($array) as $key) {
if (is_numeric($key) === FALSE) {
$allKeysAreNumeric = FALSE;
break... | [
"static",
"public",
"function",
"renumberKeysToAvoidLeapsIfKeysAreAllNumeric",
"(",
"array",
"$",
"array",
"=",
"array",
"(",
")",
",",
"$",
"level",
"=",
"0",
")",
"{",
"$",
"level",
"++",
";",
"$",
"allKeysAreNumeric",
"=",
"TRUE",
";",
"foreach",
"(",
"... | Renumber the keys of an array to avoid leaps is keys are all numeric.
Is called recursively for nested arrays.
Example:
Given
array(0 => 'Zero' 1 => 'One', 2 => 'Two', 4 => 'Three')
as input, it will return
array(0 => 'Zero' 1 => 'One', 2 => 'Two', 3 => 'Three')
Will treat keys string representations of number (ie.... | [
"Renumber",
"the",
"keys",
"of",
"an",
"array",
"to",
"avoid",
"leaps",
"is",
"keys",
"are",
"all",
"numeric",
"."
] | b6606102c4702a92bc1872eba962febceaa0e645 | https://github.com/DreadLabs/typo3-cms-phing-helper/blob/b6606102c4702a92bc1872eba962febceaa0e645/Classes/Utility/TYPO3/ArrayUtility.php#L120-L141 |
25,564 | bandama-framework/bandama-framework | src/foundation/dependency-injection/Container.php | Container.setInstance | public function setInstance($instance) {
$reflection = new ReflectionClass($instance);
$name = str_replace('\\', ':', $reflection->getName());
$this->instances[$name] = $instance;
} | php | public function setInstance($instance) {
$reflection = new ReflectionClass($instance);
$name = str_replace('\\', ':', $reflection->getName());
$this->instances[$name] = $instance;
} | [
"public",
"function",
"setInstance",
"(",
"$",
"instance",
")",
"{",
"$",
"reflection",
"=",
"new",
"ReflectionClass",
"(",
"$",
"instance",
")",
";",
"$",
"name",
"=",
"str_replace",
"(",
"'\\\\'",
",",
"':'",
",",
"$",
"reflection",
"->",
"getName",
"(... | Add new entry in instances.
@param string $key Key of entry
@param Callable $resolver Callable of entry
@return void | [
"Add",
"new",
"entry",
"in",
"instances",
"."
] | 234ed703baf9e31268941c9d5f6d5e004cc53066 | https://github.com/bandama-framework/bandama-framework/blob/234ed703baf9e31268941c9d5f6d5e004cc53066/src/foundation/dependency-injection/Container.php#L113-L117 |
25,565 | bandama-framework/bandama-framework | src/foundation/dependency-injection/Container.php | Container.get | public function get($key) {
// If the key is in factories the return new instance of class
if (isset($this->factories[$key])) {
return $this->factories[$key]();
}
// If the key is not in instances
if (!isset($this->instances[$key])) {
// If the key is in registry, instanciate the corresponding class an... | php | public function get($key) {
// If the key is in factories the return new instance of class
if (isset($this->factories[$key])) {
return $this->factories[$key]();
}
// If the key is not in instances
if (!isset($this->instances[$key])) {
// If the key is in registry, instanciate the corresponding class an... | [
"public",
"function",
"get",
"(",
"$",
"key",
")",
"{",
"// If the key is in factories the return new instance of class",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"factories",
"[",
"$",
"key",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"factories",
... | Get an entry by key
@param string $key Key of entry
@return Callable|Object | [
"Get",
"an",
"entry",
"by",
"key"
] | 234ed703baf9e31268941c9d5f6d5e004cc53066 | https://github.com/bandama-framework/bandama-framework/blob/234ed703baf9e31268941c9d5f6d5e004cc53066/src/foundation/dependency-injection/Container.php#L126-L144 |
25,566 | bandama-framework/bandama-framework | src/foundation/dependency-injection/Container.php | Container.newInstance | public static function newInstance($class) {
$className = str_replace(':', '\\', $class);
$reflectedClass = new ReflectionClass($className);
if ($reflectedClass->isInstantiable()) {
$constructor = $reflectedClass->getConstructor();
if ($constructor) {
$parameters = $constructor->getParameters();
$... | php | public static function newInstance($class) {
$className = str_replace(':', '\\', $class);
$reflectedClass = new ReflectionClass($className);
if ($reflectedClass->isInstantiable()) {
$constructor = $reflectedClass->getConstructor();
if ($constructor) {
$parameters = $constructor->getParameters();
$... | [
"public",
"static",
"function",
"newInstance",
"(",
"$",
"class",
")",
"{",
"$",
"className",
"=",
"str_replace",
"(",
"':'",
",",
"'\\\\'",
",",
"$",
"class",
")",
";",
"$",
"reflectedClass",
"=",
"new",
"ReflectionClass",
"(",
"$",
"className",
")",
";... | An instance factory method
@param string $class Full class name with used : as namespace separator
@return mixed | [
"An",
"instance",
"factory",
"method"
] | 234ed703baf9e31268941c9d5f6d5e004cc53066 | https://github.com/bandama-framework/bandama-framework/blob/234ed703baf9e31268941c9d5f6d5e004cc53066/src/foundation/dependency-injection/Container.php#L153-L180 |
25,567 | hamjoint/mustard-media | src/lib/Http/Controllers/ItemController.php | ItemController.postAddPhotos | public function postAddPhotos(Request $request)
{
if (!$request->hasFile('photos')) {
return response('', 400);
}
foreach ($request->file('photos') as $file) {
$photo = Photo::upload($file->getRealPath());
session()->push('photos', [
'pho... | php | public function postAddPhotos(Request $request)
{
if (!$request->hasFile('photos')) {
return response('', 400);
}
foreach ($request->file('photos') as $file) {
$photo = Photo::upload($file->getRealPath());
session()->push('photos', [
'pho... | [
"public",
"function",
"postAddPhotos",
"(",
"Request",
"$",
"request",
")",
"{",
"if",
"(",
"!",
"$",
"request",
"->",
"hasFile",
"(",
"'photos'",
")",
")",
"{",
"return",
"response",
"(",
"''",
",",
"400",
")",
";",
"}",
"foreach",
"(",
"$",
"reques... | Process and store several photos.
@param \Illuminate\Http\Request $request
@return \Illuminate\Http\RedirectResponse | [
"Process",
"and",
"store",
"several",
"photos",
"."
] | d3c799dbc3578e1e1022bb4eccae7a20e285ba06 | https://github.com/hamjoint/mustard-media/blob/d3c799dbc3578e1e1022bb4eccae7a20e285ba06/src/lib/Http/Controllers/ItemController.php#L37-L51 |
25,568 | hamjoint/mustard-media | src/lib/Http/Controllers/ItemController.php | ItemController.postDeletePhoto | public function postDeletePhoto(Request $request)
{
if (session()->has('photos')) {
$photos = session('photos');
foreach ($photos as $index => $photo) {
if (in_array($request->input('file'), $photo)) {
$photo = Photo::find($photo['photo_id']);
... | php | public function postDeletePhoto(Request $request)
{
if (session()->has('photos')) {
$photos = session('photos');
foreach ($photos as $index => $photo) {
if (in_array($request->input('file'), $photo)) {
$photo = Photo::find($photo['photo_id']);
... | [
"public",
"function",
"postDeletePhoto",
"(",
"Request",
"$",
"request",
")",
"{",
"if",
"(",
"session",
"(",
")",
"->",
"has",
"(",
"'photos'",
")",
")",
"{",
"$",
"photos",
"=",
"session",
"(",
"'photos'",
")",
";",
"foreach",
"(",
"$",
"photos",
"... | Delete a photo.
@param \Illuminate\Http\Request $request
@return \Illuminate\Http\Response | [
"Delete",
"a",
"photo",
"."
] | d3c799dbc3578e1e1022bb4eccae7a20e285ba06 | https://github.com/hamjoint/mustard-media/blob/d3c799dbc3578e1e1022bb4eccae7a20e285ba06/src/lib/Http/Controllers/ItemController.php#L60-L81 |
25,569 | black-lamp/blcms-nova-poshta | frontend/controllers/DefaultController.php | DefaultController.actionGetWarehouses | public function actionGetWarehouses() {
$street = $_GET['street'];
$warehouses = $this->getResponse('AddressGeneral', 'getWarehouses',
['CityName' => $_GET['CityName']]);
$warehousesByStreet = [];
foreach ($warehouses->data['data'] as $warehouse) {
if (substr_c... | php | public function actionGetWarehouses() {
$street = $_GET['street'];
$warehouses = $this->getResponse('AddressGeneral', 'getWarehouses',
['CityName' => $_GET['CityName']]);
$warehousesByStreet = [];
foreach ($warehouses->data['data'] as $warehouse) {
if (substr_c... | [
"public",
"function",
"actionGetWarehouses",
"(",
")",
"{",
"$",
"street",
"=",
"$",
"_GET",
"[",
"'street'",
"]",
";",
"$",
"warehouses",
"=",
"$",
"this",
"->",
"getResponse",
"(",
"'AddressGeneral'",
",",
"'getWarehouses'",
",",
"[",
"'CityName'",
"=>",
... | Gets warehouses by city and street.
@return string | [
"Gets",
"warehouses",
"by",
"city",
"and",
"street",
"."
] | 75b7d4b2034dd636c0bd59c87dc695c25de36f59 | https://github.com/black-lamp/blcms-nova-poshta/blob/75b7d4b2034dd636c0bd59c87dc695c25de36f59/frontend/controllers/DefaultController.php#L69-L85 |
25,570 | internetofvoice/vsms-core | src/Controller/AbstractLinkController.php | AbstractLinkController.validateRequestParameters | public function validateRequestParameters($request, $amz_client_id) {
$errors = array();
$state = $request->getParam('state', false);
$redirect_uri = $request->getParam('redirect_uri', false);
$client_id = $request->getParam('client_id', false);
$scope ... | php | public function validateRequestParameters($request, $amz_client_id) {
$errors = array();
$state = $request->getParam('state', false);
$redirect_uri = $request->getParam('redirect_uri', false);
$client_id = $request->getParam('client_id', false);
$scope ... | [
"public",
"function",
"validateRequestParameters",
"(",
"$",
"request",
",",
"$",
"amz_client_id",
")",
"{",
"$",
"errors",
"=",
"array",
"(",
")",
";",
"$",
"state",
"=",
"$",
"request",
"->",
"getParam",
"(",
"'state'",
",",
"false",
")",
";",
"$",
"... | Validate request parameters
@param \Slim\Http\Request $request Slim request
@param string $amz_client_id Client ID as configured in Amazon Developer Console
@return array
@throws \InvalidArgumentException
@access public
@author a.schmidt@internet-of-voice.de | [
"Validate",
"request",
"parameters"
] | bd1eb6ca90a55f4928c35b9f0742a5cc922298ef | https://github.com/internetofvoice/vsms-core/blob/bd1eb6ca90a55f4928c35b9f0742a5cc922298ef/src/Controller/AbstractLinkController.php#L24-L59 |
25,571 | internetofvoice/vsms-core | src/Controller/AbstractLinkController.php | AbstractLinkController.getRedirectLocation | public function getRedirectLocation($parameters, $access_token) {
$location = array();
array_push($location, $parameters['redirect_uri'] . '#state=' . $parameters['state']);
array_push($location, 'access_token=' . $access_token);
array_push($location, 'token_type=Bearer');
retur... | php | public function getRedirectLocation($parameters, $access_token) {
$location = array();
array_push($location, $parameters['redirect_uri'] . '#state=' . $parameters['state']);
array_push($location, 'access_token=' . $access_token);
array_push($location, 'token_type=Bearer');
retur... | [
"public",
"function",
"getRedirectLocation",
"(",
"$",
"parameters",
",",
"$",
"access_token",
")",
"{",
"$",
"location",
"=",
"array",
"(",
")",
";",
"array_push",
"(",
"$",
"location",
",",
"$",
"parameters",
"[",
"'redirect_uri'",
"]",
".",
"'#state='",
... | Get redirect location
@param array $parameters Amazon parameters (see validateRequestParameters())
@param string $access_token Generated access token
@return string
@access public
@author a.schmidt@internet-of-voice.de | [
"Get",
"redirect",
"location"
] | bd1eb6ca90a55f4928c35b9f0742a5cc922298ef | https://github.com/internetofvoice/vsms-core/blob/bd1eb6ca90a55f4928c35b9f0742a5cc922298ef/src/Controller/AbstractLinkController.php#L70-L77 |
25,572 | jabernardo/lollipop-php | Library/HTTP/Router.php | Router._registerDispatch | static private function _registerDispatch() {
// Register dispatch function
$auto_dispatch = !is_null(Config::get('router.auto_dispatch')) ?
Config::get('router.auto_dispatch') :
true;
if (!self::$_dispatch_registered && $auto_dispatch) {
// Make sure... | php | static private function _registerDispatch() {
// Register dispatch function
$auto_dispatch = !is_null(Config::get('router.auto_dispatch')) ?
Config::get('router.auto_dispatch') :
true;
if (!self::$_dispatch_registered && $auto_dispatch) {
// Make sure... | [
"static",
"private",
"function",
"_registerDispatch",
"(",
")",
"{",
"// Register dispatch function",
"$",
"auto_dispatch",
"=",
"!",
"is_null",
"(",
"Config",
"::",
"get",
"(",
"'router.auto_dispatch'",
")",
")",
"?",
"Config",
"::",
"get",
"(",
"'router.auto_dis... | Register dispatch function on shutdown
@access private
@return void | [
"Register",
"dispatch",
"function",
"on",
"shutdown"
] | 004d80b21f7246bb3e08c7b9f74a165b0d3ca0f5 | https://github.com/jabernardo/lollipop-php/blob/004d80b21f7246bb3e08c7b9f74a165b0d3ca0f5/Library/HTTP/Router.php#L372-L388 |
25,573 | jabernardo/lollipop-php | Library/HTTP/Router.php | Router._process | static private function _process(\Lollipop\HTTP\Request $req, \Lollipop\HTTP\Response $res) {
if (is_null(self::$_kernel)) {
$active = self::$_active_route;
$top = function(\Lollipop\HTTP\Request $req, \Lollipop\HTTP\Response $res) use ($active) {
return Route::resolve($a... | php | static private function _process(\Lollipop\HTTP\Request $req, \Lollipop\HTTP\Response $res) {
if (is_null(self::$_kernel)) {
$active = self::$_active_route;
$top = function(\Lollipop\HTTP\Request $req, \Lollipop\HTTP\Response $res) use ($active) {
return Route::resolve($a... | [
"static",
"private",
"function",
"_process",
"(",
"\\",
"Lollipop",
"\\",
"HTTP",
"\\",
"Request",
"$",
"req",
",",
"\\",
"Lollipop",
"\\",
"HTTP",
"\\",
"Response",
"$",
"res",
")",
"{",
"if",
"(",
"is_null",
"(",
"self",
"::",
"$",
"_kernel",
")",
... | Process middleware stack
@access private
@param \Lollipop\HTTP\Request $req Request Object
@param \Lollipop\HTTP\Response $res Response Object
@return \Lollipop\HTTP\Response Response object | [
"Process",
"middleware",
"stack"
] | 004d80b21f7246bb3e08c7b9f74a165b0d3ca0f5 | https://github.com/jabernardo/lollipop-php/blob/004d80b21f7246bb3e08c7b9f74a165b0d3ca0f5/Library/HTTP/Router.php#L399-L425 |
25,574 | jabernardo/lollipop-php | Library/HTTP/Router.php | Router._getDefaultPageNotFound | static private function _getDefaultPageNotFound() {
return [
'path' => '404',
'callback' => function(\Lollipop\HTTP\Request $req, \Lollipop\HTTP\Response $res, $args = []) {
// Create a default 404 page
$pagenotfound = '<!DOCTYPE html>'
... | php | static private function _getDefaultPageNotFound() {
return [
'path' => '404',
'callback' => function(\Lollipop\HTTP\Request $req, \Lollipop\HTTP\Response $res, $args = []) {
// Create a default 404 page
$pagenotfound = '<!DOCTYPE html>'
... | [
"static",
"private",
"function",
"_getDefaultPageNotFound",
"(",
")",
"{",
"return",
"[",
"'path'",
"=>",
"'404'",
",",
"'callback'",
"=>",
"function",
"(",
"\\",
"Lollipop",
"\\",
"HTTP",
"\\",
"Request",
"$",
"req",
",",
"\\",
"Lollipop",
"\\",
"HTTP",
"... | Check if any of routes doesn't match
@access private
@return \Lollipop\HTTP\Response | [
"Check",
"if",
"any",
"of",
"routes",
"doesn",
"t",
"match"
] | 004d80b21f7246bb3e08c7b9f74a165b0d3ca0f5 | https://github.com/jabernardo/lollipop-php/blob/004d80b21f7246bb3e08c7b9f74a165b0d3ca0f5/Library/HTTP/Router.php#L475-L501 |
25,575 | ARCANESOFT/SEO | src/Providers/RouteServiceProvider.php | RouteServiceProvider.mapAdminRoutes | protected function mapAdminRoutes()
{
$this->name('seo.')
->prefix($this->config()->get('arcanesoft.seo.route.prefix', 'seo'))
->group(function () {
Routes\Admin\DashboardRoutes::register();
Routes\Admin\PagesRoutes::register();
Ro... | php | protected function mapAdminRoutes()
{
$this->name('seo.')
->prefix($this->config()->get('arcanesoft.seo.route.prefix', 'seo'))
->group(function () {
Routes\Admin\DashboardRoutes::register();
Routes\Admin\PagesRoutes::register();
Ro... | [
"protected",
"function",
"mapAdminRoutes",
"(",
")",
"{",
"$",
"this",
"->",
"name",
"(",
"'seo.'",
")",
"->",
"prefix",
"(",
"$",
"this",
"->",
"config",
"(",
")",
"->",
"get",
"(",
"'arcanesoft.seo.route.prefix'",
",",
"'seo'",
")",
")",
"->",
"group",... | Map the admin routes. | [
"Map",
"the",
"admin",
"routes",
"."
] | ce6d6135d55e8b2fd43cf7923839b4791b7c7ad2 | https://github.com/ARCANESOFT/SEO/blob/ce6d6135d55e8b2fd43cf7923839b4791b7c7ad2/src/Providers/RouteServiceProvider.php#L62-L75 |
25,576 | cinnamonlab/framework | src/Framework/Input.php | Input.file | static function file( $key, $default = null, $validator = null) {
if ( ! isset($_FILES[$key])
|| $_FILES[$key]['error'] != UPLOAD_ERR_OK)
return self::processError($default);
$file = new InputFile($_FILES[$key]['tmp_name']);
$file->setContentType($_FILES[$key]['type']);
... | php | static function file( $key, $default = null, $validator = null) {
if ( ! isset($_FILES[$key])
|| $_FILES[$key]['error'] != UPLOAD_ERR_OK)
return self::processError($default);
$file = new InputFile($_FILES[$key]['tmp_name']);
$file->setContentType($_FILES[$key]['type']);
... | [
"static",
"function",
"file",
"(",
"$",
"key",
",",
"$",
"default",
"=",
"null",
",",
"$",
"validator",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"_FILES",
"[",
"$",
"key",
"]",
")",
"||",
"$",
"_FILES",
"[",
"$",
"key",
"]",
... | Get Uploaded File
@param $key
@param null $default
@param null $validator
@return InputFile | [
"Get",
"Uploaded",
"File"
] | 958ba3e60d3f927adc40a543ec6d4f08d38cfd2c | https://github.com/cinnamonlab/framework/blob/958ba3e60d3f927adc40a543ec6d4f08d38cfd2c/src/Framework/Input.php#L76-L105 |
25,577 | cinnamonlab/framework | src/Framework/Input.php | Input.set | static function set( $key, $value ) {
$me = self::getInstance();
$me->parameters[$key] = $value;
} | php | static function set( $key, $value ) {
$me = self::getInstance();
$me->parameters[$key] = $value;
} | [
"static",
"function",
"set",
"(",
"$",
"key",
",",
"$",
"value",
")",
"{",
"$",
"me",
"=",
"self",
"::",
"getInstance",
"(",
")",
";",
"$",
"me",
"->",
"parameters",
"[",
"$",
"key",
"]",
"=",
"$",
"value",
";",
"}"
] | Set Value Manually
@param $key
@param $value | [
"Set",
"Value",
"Manually"
] | 958ba3e60d3f927adc40a543ec6d4f08d38cfd2c | https://github.com/cinnamonlab/framework/blob/958ba3e60d3f927adc40a543ec6d4f08d38cfd2c/src/Framework/Input.php#L112-L115 |
25,578 | MichaelJ2324/PHP-REST-Client | src/Auth/Abstracts/AbstractAuthController.php | AbstractAuthController.configureEndpoint | protected function configureEndpoint(EndpointInterface $Endpoint, $action)
{
switch ($action) {
case self::ACTION_AUTH:
$Endpoint = $this->configureAuthenticationEndpoint($Endpoint);
break;
case self::ACTION_LOGOUT:
$Endpoint = $this->c... | php | protected function configureEndpoint(EndpointInterface $Endpoint, $action)
{
switch ($action) {
case self::ACTION_AUTH:
$Endpoint = $this->configureAuthenticationEndpoint($Endpoint);
break;
case self::ACTION_LOGOUT:
$Endpoint = $this->c... | [
"protected",
"function",
"configureEndpoint",
"(",
"EndpointInterface",
"$",
"Endpoint",
",",
"$",
"action",
")",
"{",
"switch",
"(",
"$",
"action",
")",
"{",
"case",
"self",
"::",
"ACTION_AUTH",
":",
"$",
"Endpoint",
"=",
"$",
"this",
"->",
"configureAuthen... | Configure an actions Endpoint Object
@param EndpointInterface $Endpoint
@param string $action
@return EndpointInterface | [
"Configure",
"an",
"actions",
"Endpoint",
"Object"
] | b8a2caaf6456eccaa845ba5c5098608aa9645c92 | https://github.com/MichaelJ2324/PHP-REST-Client/blob/b8a2caaf6456eccaa845ba5c5098608aa9645c92/src/Auth/Abstracts/AbstractAuthController.php#L249-L260 |
25,579 | eliasis-framework/complement | src/Complement.php | Complement.run | public static function run()
{
if (! session_id()) {
session_start();
}
$complementType = self::getType('strtoupper');
$path = App::$complementType();
if ($paths = File::getFilesFromDir($path)) {
foreach ($paths as $path) {
if (! $pa... | php | public static function run()
{
if (! session_id()) {
session_start();
}
$complementType = self::getType('strtoupper');
$path = App::$complementType();
if ($paths = File::getFilesFromDir($path)) {
foreach ($paths as $path) {
if (! $pa... | [
"public",
"static",
"function",
"run",
"(",
")",
"{",
"if",
"(",
"!",
"session_id",
"(",
")",
")",
"{",
"session_start",
"(",
")",
";",
"}",
"$",
"complementType",
"=",
"self",
"::",
"getType",
"(",
"'strtoupper'",
")",
";",
"$",
"path",
"=",
"App",
... | Load all complements found in the directory.
@uses \Eliasis\Complement\ComplementRequest::requestHandler()
@uses \Eliasis\Complement\ComplementHandler::getType() | [
"Load",
"all",
"complements",
"found",
"in",
"the",
"directory",
"."
] | d50e92cf01600ff4573bf1761c312069044748c3 | https://github.com/eliasis-framework/complement/blob/d50e92cf01600ff4573bf1761c312069044748c3/src/Complement.php#L111-L136 |
25,580 | eliasis-framework/complement | src/Complement.php | Complement.load | public static function load($file)
{
$complement = Json::fileToArray($file);
$complement['config-file'] = $file;
self::$id = isset($complement['id']) ? $complement['id'] : 'Default';
$that = self::getInstance();
return $that->setComplement($complement);
} | php | public static function load($file)
{
$complement = Json::fileToArray($file);
$complement['config-file'] = $file;
self::$id = isset($complement['id']) ? $complement['id'] : 'Default';
$that = self::getInstance();
return $that->setComplement($complement);
} | [
"public",
"static",
"function",
"load",
"(",
"$",
"file",
")",
"{",
"$",
"complement",
"=",
"Json",
"::",
"fileToArray",
"(",
"$",
"file",
")",
";",
"$",
"complement",
"[",
"'config-file'",
"]",
"=",
"$",
"file",
";",
"self",
"::",
"$",
"id",
"=",
... | Load complement configuration from json file and set settings.
@param string $file → path or url to the complement configuration file
@uses \Josantonius\Json\Json::fileToArray()
@uses \Eliasis\Complement\ComplementHandler->setComplement()
@return bool true | [
"Load",
"complement",
"configuration",
"from",
"json",
"file",
"and",
"set",
"settings",
"."
] | d50e92cf01600ff4573bf1761c312069044748c3 | https://github.com/eliasis-framework/complement/blob/d50e92cf01600ff4573bf1761c312069044748c3/src/Complement.php#L148-L156 |
25,581 | eliasis-framework/complement | src/Complement.php | Complement.setCurrentID | public static function setCurrentID($id)
{
$type = self::getType();
$appID = App::getCurrentID();
if (array_key_exists($id, self::$instances[$appID][$type])) {
self::$id = $id;
return true;
}
return false;
} | php | public static function setCurrentID($id)
{
$type = self::getType();
$appID = App::getCurrentID();
if (array_key_exists($id, self::$instances[$appID][$type])) {
self::$id = $id;
return true;
}
return false;
} | [
"public",
"static",
"function",
"setCurrentID",
"(",
"$",
"id",
")",
"{",
"$",
"type",
"=",
"self",
"::",
"getType",
"(",
")",
";",
"$",
"appID",
"=",
"App",
"::",
"getCurrentID",
"(",
")",
";",
"if",
"(",
"array_key_exists",
"(",
"$",
"id",
",",
"... | Define the current complement ID.
@since 1.1.0
@param string $id → complement ID
@return bool | [
"Define",
"the",
"current",
"complement",
"ID",
"."
] | d50e92cf01600ff4573bf1761c312069044748c3 | https://github.com/eliasis-framework/complement/blob/d50e92cf01600ff4573bf1761c312069044748c3/src/Complement.php#L250-L261 |
25,582 | eliasis-framework/complement | src/Complement.php | Complement.script | public static function script($pathUrl = null, $vue = true, $vueResource = true)
{
$that = self::getInstance();
$file = $vue ? 'vue+' : '';
$file .= $vueResource ? 'vue-resource+' : '';
return $that->setFile($file . 'eliasis-complement.min', 'script', $pathUrl);
} | php | public static function script($pathUrl = null, $vue = true, $vueResource = true)
{
$that = self::getInstance();
$file = $vue ? 'vue+' : '';
$file .= $vueResource ? 'vue-resource+' : '';
return $that->setFile($file . 'eliasis-complement.min', 'script', $pathUrl);
} | [
"public",
"static",
"function",
"script",
"(",
"$",
"pathUrl",
"=",
"null",
",",
"$",
"vue",
"=",
"true",
",",
"$",
"vueResource",
"=",
"true",
")",
"{",
"$",
"that",
"=",
"self",
"::",
"getInstance",
"(",
")",
";",
"$",
"file",
"=",
"$",
"vue",
... | Set and get script url.
@param string $pathUrl → url where JS files will be created & loaded
@param bool $vue → include Vue.js in the script
@param bool $vueResource → include vue-resource in the script
@uses \Eliasis\Complement\ComplementView::setFile()
@return string → script url | [
"Set",
"and",
"get",
"script",
"url",
"."
] | d50e92cf01600ff4573bf1761c312069044748c3 | https://github.com/eliasis-framework/complement/blob/d50e92cf01600ff4573bf1761c312069044748c3/src/Complement.php#L274-L282 |
25,583 | eliasis-framework/complement | src/Complement.php | Complement.exists | public static function exists($complementID)
{
$type = self::getType();
return array_key_exists(
$complementID,
self::$instances[App::getCurrentID()][$type]
);
} | php | public static function exists($complementID)
{
$type = self::getType();
return array_key_exists(
$complementID,
self::$instances[App::getCurrentID()][$type]
);
} | [
"public",
"static",
"function",
"exists",
"(",
"$",
"complementID",
")",
"{",
"$",
"type",
"=",
"self",
"::",
"getType",
"(",
")",
";",
"return",
"array_key_exists",
"(",
"$",
"complementID",
",",
"self",
"::",
"$",
"instances",
"[",
"App",
"::",
"getCur... | Check if complement exists.
@param string $complementID → complement id
@uses \Eliasis\Framework\App::getCurrentID()
@uses \Eliasis\Complement\ComplementHandler::getType()
@return bool | [
"Check",
"if",
"complement",
"exists",
"."
] | d50e92cf01600ff4573bf1761c312069044748c3 | https://github.com/eliasis-framework/complement/blob/d50e92cf01600ff4573bf1761c312069044748c3/src/Complement.php#L310-L318 |
25,584 | eliasis-framework/complement | src/Complement.php | Complement.getLibraryVersion | public static function getLibraryVersion()
{
$path = self::getLibraryPath();
$composer = Json::fileToArray($path . 'composer.json');
return isset($composer['version']) ? $composer['version'] : '1.1.1';
} | php | public static function getLibraryVersion()
{
$path = self::getLibraryPath();
$composer = Json::fileToArray($path . 'composer.json');
return isset($composer['version']) ? $composer['version'] : '1.1.1';
} | [
"public",
"static",
"function",
"getLibraryVersion",
"(",
")",
"{",
"$",
"path",
"=",
"self",
"::",
"getLibraryPath",
"(",
")",
";",
"$",
"composer",
"=",
"Json",
"::",
"fileToArray",
"(",
"$",
"path",
".",
"'composer.json'",
")",
";",
"return",
"isset",
... | Get library version.
@uses \Josantonius\Json\Json::fileToArray()
@return string | [
"Get",
"library",
"version",
"."
] | d50e92cf01600ff4573bf1761c312069044748c3 | https://github.com/eliasis-framework/complement/blob/d50e92cf01600ff4573bf1761c312069044748c3/src/Complement.php#L337-L343 |
25,585 | eliasis-framework/complement | src/Complement.php | Complement.getInstance | protected static function getInstance()
{
$type = self::getType();
$appID = App::getCurrentID();
$complementID = self::getCurrentID();
$complement = get_called_class();
if (! isset(self::$instances[$appID][$type][$complementID])) {
self::$instances[$appID][$type][... | php | protected static function getInstance()
{
$type = self::getType();
$appID = App::getCurrentID();
$complementID = self::getCurrentID();
$complement = get_called_class();
if (! isset(self::$instances[$appID][$type][$complementID])) {
self::$instances[$appID][$type][... | [
"protected",
"static",
"function",
"getInstance",
"(",
")",
"{",
"$",
"type",
"=",
"self",
"::",
"getType",
"(",
")",
";",
"$",
"appID",
"=",
"App",
"::",
"getCurrentID",
"(",
")",
";",
"$",
"complementID",
"=",
"self",
"::",
"getCurrentID",
"(",
")",
... | Get complement instance.
@uses \Eliasis\Framework\App::getCurrentID()
@uses \Eliasis\Complement\ComplementHandler::getType()
@return object → complement instance | [
"Get",
"complement",
"instance",
"."
] | d50e92cf01600ff4573bf1761c312069044748c3 | https://github.com/eliasis-framework/complement/blob/d50e92cf01600ff4573bf1761c312069044748c3/src/Complement.php#L380-L391 |
25,586 | cubicmushroom/valueobjects | src/Geography/Address.php | Address.fromNative | public static function fromNative()
{
$args = \func_get_args();
if (\count($args) != 8) {
throw new \BadMethodCallException('You must provide exactly 8 arguments: 1) addressee name, 2) street name, 3) street number, 4) district, 5) city, 6) region, 7) postal code, 8) country code.');
... | php | public static function fromNative()
{
$args = \func_get_args();
if (\count($args) != 8) {
throw new \BadMethodCallException('You must provide exactly 8 arguments: 1) addressee name, 2) street name, 3) street number, 4) district, 5) city, 6) region, 7) postal code, 8) country code.');
... | [
"public",
"static",
"function",
"fromNative",
"(",
")",
"{",
"$",
"args",
"=",
"\\",
"func_get_args",
"(",
")",
";",
"if",
"(",
"\\",
"count",
"(",
"$",
"args",
")",
"!=",
"8",
")",
"{",
"throw",
"new",
"\\",
"BadMethodCallException",
"(",
"'You must p... | Returns a new Address from native PHP arguments
@param string $name
@param string $street_name
@param string $street_number
@param string $district
@param string $city
@param string $region
@param string $postal_code
@param string $country_code
@return self
@throws \BadMethodCallException | [
"Returns",
"a",
"new",
"Address",
"from",
"native",
"PHP",
"arguments"
] | 4554239ab75d65eeb9773219aa5b07e9fbfabb92 | https://github.com/cubicmushroom/valueobjects/blob/4554239ab75d65eeb9773219aa5b07e9fbfabb92/src/Geography/Address.php#L61-L78 |
25,587 | cubicmushroom/valueobjects | src/Geography/Address.php | Address.sameValueAs | public function sameValueAs(ValueObjectInterface $address)
{
if (false === Util::classEquals($this, $address)) {
return false;
}
return $this->getName()->sameValueAs($address->getName()) &&
$this->getStreet()->sameValueAs($address->getStreet()) ... | php | public function sameValueAs(ValueObjectInterface $address)
{
if (false === Util::classEquals($this, $address)) {
return false;
}
return $this->getName()->sameValueAs($address->getName()) &&
$this->getStreet()->sameValueAs($address->getStreet()) ... | [
"public",
"function",
"sameValueAs",
"(",
"ValueObjectInterface",
"$",
"address",
")",
"{",
"if",
"(",
"false",
"===",
"Util",
"::",
"classEquals",
"(",
"$",
"this",
",",
"$",
"address",
")",
")",
"{",
"return",
"false",
";",
"}",
"return",
"$",
"this",
... | Tells whether two Address are equal
@param ValueObjectInterface $address
@return bool | [
"Tells",
"whether",
"two",
"Address",
"are",
"equal"
] | 4554239ab75d65eeb9773219aa5b07e9fbfabb92 | https://github.com/cubicmushroom/valueobjects/blob/4554239ab75d65eeb9773219aa5b07e9fbfabb92/src/Geography/Address.php#L108-L122 |
25,588 | agniukaitis/CInformer | src/cinformer/CInformer.php | CInformer.setMessage | public function setMessage($data)
{
// initialize a flash session variable
if(!isset($_SESSION['flash'])) {
$_SESSION['flash'] = array();
}
// check for valid message template. Set to default if not valid
if(!in_array($data['type'], $this->valid)) {
$... | php | public function setMessage($data)
{
// initialize a flash session variable
if(!isset($_SESSION['flash'])) {
$_SESSION['flash'] = array();
}
// check for valid message template. Set to default if not valid
if(!in_array($data['type'], $this->valid)) {
$... | [
"public",
"function",
"setMessage",
"(",
"$",
"data",
")",
"{",
"// initialize a flash session variable",
"if",
"(",
"!",
"isset",
"(",
"$",
"_SESSION",
"[",
"'flash'",
"]",
")",
")",
"{",
"$",
"_SESSION",
"[",
"'flash'",
"]",
"=",
"array",
"(",
")",
";"... | Set the message into session variable
@return boolean | [
"Set",
"the",
"message",
"into",
"session",
"variable"
] | bfaed9d9f624174efe3ac0a6654d49d2fdba628b | https://github.com/agniukaitis/CInformer/blob/bfaed9d9f624174efe3ac0a6654d49d2fdba628b/src/cinformer/CInformer.php#L31-L47 |
25,589 | sabinus52/OlixDatatablesBootstrapBundle | Twig/DatatableTwigExtension.php | DatatableTwigExtension.datatableRenderHtml | public function datatableRenderHtml(Twig_Environment $twig, AbstractDatatableView $datatable)
{
//return $twig->render('OlixDatatablesBootstrapBundle::datatable_html.html.twig', $this->getOptions($datatable));
return $twig->render('SgDatatablesBundle:Datatable:datatable_html.html.twig', $this->getOp... | php | public function datatableRenderHtml(Twig_Environment $twig, AbstractDatatableView $datatable)
{
//return $twig->render('OlixDatatablesBootstrapBundle::datatable_html.html.twig', $this->getOptions($datatable));
return $twig->render('SgDatatablesBundle:Datatable:datatable_html.html.twig', $this->getOp... | [
"public",
"function",
"datatableRenderHtml",
"(",
"Twig_Environment",
"$",
"twig",
",",
"AbstractDatatableView",
"$",
"datatable",
")",
"{",
"//return $twig->render('OlixDatatablesBootstrapBundle::datatable_html.html.twig', $this->getOptions($datatable));",
"return",
"$",
"twig",
"... | Renders the html template.
@param Twig_Environment $twig
@param AbstractDatatableView $datatable
@return mixed|string
@throws Exception | [
"Renders",
"the",
"html",
"template",
"."
] | 9b5d6dfb72b7aeecef43545378f50e7a6adc1b12 | https://github.com/sabinus52/OlixDatatablesBootstrapBundle/blob/9b5d6dfb72b7aeecef43545378f50e7a6adc1b12/Twig/DatatableTwigExtension.php#L136-L140 |
25,590 | sabinus52/OlixDatatablesBootstrapBundle | Twig/DatatableTwigExtension.php | DatatableTwigExtension.datatableRenderJs | public function datatableRenderJs(Twig_Environment $twig, AbstractDatatableView $datatable)
{
return $twig->render('SgDatatablesBundle:Datatable:datatable_js.html.twig', $this->getOptions($datatable));
} | php | public function datatableRenderJs(Twig_Environment $twig, AbstractDatatableView $datatable)
{
return $twig->render('SgDatatablesBundle:Datatable:datatable_js.html.twig', $this->getOptions($datatable));
} | [
"public",
"function",
"datatableRenderJs",
"(",
"Twig_Environment",
"$",
"twig",
",",
"AbstractDatatableView",
"$",
"datatable",
")",
"{",
"return",
"$",
"twig",
"->",
"render",
"(",
"'SgDatatablesBundle:Datatable:datatable_js.html.twig'",
",",
"$",
"this",
"->",
"get... | Renders the js template.
@param Twig_Environment $twig
@param AbstractDatatableView $datatable
@return mixed|string
@throws Exception | [
"Renders",
"the",
"js",
"template",
"."
] | 9b5d6dfb72b7aeecef43545378f50e7a6adc1b12 | https://github.com/sabinus52/OlixDatatablesBootstrapBundle/blob/9b5d6dfb72b7aeecef43545378f50e7a6adc1b12/Twig/DatatableTwigExtension.php#L151-L154 |
25,591 | sabinus52/OlixDatatablesBootstrapBundle | Twig/DatatableTwigExtension.php | DatatableTwigExtension.datatableFilterRender | public function datatableFilterRender(Twig_Environment $twig, AbstractDatatableView $datatable, AbstractColumn $column, $loopIndex)
{
if ($filterProperty = $column->getFilter()->getProperty()) {
$filterColumnId = $datatable->getColumnIdByColumnName($filterProperty);
} else {
... | php | public function datatableFilterRender(Twig_Environment $twig, AbstractDatatableView $datatable, AbstractColumn $column, $loopIndex)
{
if ($filterProperty = $column->getFilter()->getProperty()) {
$filterColumnId = $datatable->getColumnIdByColumnName($filterProperty);
} else {
... | [
"public",
"function",
"datatableFilterRender",
"(",
"Twig_Environment",
"$",
"twig",
",",
"AbstractDatatableView",
"$",
"datatable",
",",
"AbstractColumn",
"$",
"column",
",",
"$",
"loopIndex",
")",
"{",
"if",
"(",
"$",
"filterProperty",
"=",
"$",
"column",
"->"... | Renders the custom datatable filter.
@param Twig_Environment $twig
@param AbstractDatatableView $datatable
@param AbstractColumn $column
@param integer $loopIndex
@return mixed|string|void | [
"Renders",
"the",
"custom",
"datatable",
"filter",
"."
] | 9b5d6dfb72b7aeecef43545378f50e7a6adc1b12 | https://github.com/sabinus52/OlixDatatablesBootstrapBundle/blob/9b5d6dfb72b7aeecef43545378f50e7a6adc1b12/Twig/DatatableTwigExtension.php#L166-L181 |
25,592 | sabinus52/OlixDatatablesBootstrapBundle | Twig/DatatableTwigExtension.php | DatatableTwigExtension.datatableIcon | public function datatableIcon(Twig_Environment $twig, $icon, $label = '')
{
if ($icon)
return $twig->render('SgDatatablesBundle:Action:icon.html.twig', array('icon' => $icon, 'label' => $label));
else
return $label;
} | php | public function datatableIcon(Twig_Environment $twig, $icon, $label = '')
{
if ($icon)
return $twig->render('SgDatatablesBundle:Action:icon.html.twig', array('icon' => $icon, 'label' => $label));
else
return $label;
} | [
"public",
"function",
"datatableIcon",
"(",
"Twig_Environment",
"$",
"twig",
",",
"$",
"icon",
",",
"$",
"label",
"=",
"''",
")",
"{",
"if",
"(",
"$",
"icon",
")",
"return",
"$",
"twig",
"->",
"render",
"(",
"'SgDatatablesBundle:Action:icon.html.twig'",
",",... | Renders icon && label.
@param Twig_Environment $twig
@param string $icon
@param string $label
@return string | [
"Renders",
"icon",
"&&",
"label",
"."
] | 9b5d6dfb72b7aeecef43545378f50e7a6adc1b12 | https://github.com/sabinus52/OlixDatatablesBootstrapBundle/blob/9b5d6dfb72b7aeecef43545378f50e7a6adc1b12/Twig/DatatableTwigExtension.php#L192-L198 |
25,593 | vatson/isolated-callback | src/Vatson/Callback/IsolatedCallback.php | IsolatedCallback.registerChildShutdown | protected function registerChildShutdown()
{
$ipc = $this->ipc;
register_shutdown_function(function () use ($ipc) {
$error = error_get_last();
if ($error && isset($error['type']) && in_array($error['type'], array(E_ERROR, E_PARSE, E_CORE_ERROR, E_COMPILE_ERROR))) {
... | php | protected function registerChildShutdown()
{
$ipc = $this->ipc;
register_shutdown_function(function () use ($ipc) {
$error = error_get_last();
if ($error && isset($error['type']) && in_array($error['type'], array(E_ERROR, E_PARSE, E_CORE_ERROR, E_COMPILE_ERROR))) {
... | [
"protected",
"function",
"registerChildShutdown",
"(",
")",
"{",
"$",
"ipc",
"=",
"$",
"this",
"->",
"ipc",
";",
"register_shutdown_function",
"(",
"function",
"(",
")",
"use",
"(",
"$",
"ipc",
")",
"{",
"$",
"error",
"=",
"error_get_last",
"(",
")",
";"... | Avoids the closing of resources in child process | [
"Avoids",
"the",
"closing",
"of",
"resources",
"in",
"child",
"process"
] | c048f4cc830c246c0aa8c45da91af9e8c5a86ca4 | https://github.com/vatson/isolated-callback/blob/c048f4cc830c246c0aa8c45da91af9e8c5a86ca4/src/Vatson/Callback/IsolatedCallback.php#L70-L86 |
25,594 | FuzeWorks/Core | src/FuzeWorks/Events.php | Events.addListener | public static function addListener($callback, $eventName, $priority = EventPriority::NORMAL)
{
// Perform multiple checks
if (EventPriority::getPriority($priority) == false) {
throw new EventException('Can not add listener: Unknown priority '.$priority, 1);
}
if (!is_cal... | php | public static function addListener($callback, $eventName, $priority = EventPriority::NORMAL)
{
// Perform multiple checks
if (EventPriority::getPriority($priority) == false) {
throw new EventException('Can not add listener: Unknown priority '.$priority, 1);
}
if (!is_cal... | [
"public",
"static",
"function",
"addListener",
"(",
"$",
"callback",
",",
"$",
"eventName",
",",
"$",
"priority",
"=",
"EventPriority",
"::",
"NORMAL",
")",
"{",
"// Perform multiple checks",
"if",
"(",
"EventPriority",
"::",
"getPriority",
"(",
"$",
"priority",... | Adds a function as listener.
@param mixed $callback The callback when the events get fired, see {@link http://php.net/manual/en/language.types.callable.php PHP.net}
@param string $eventName The name of the event
@param int $priority The priority, even though integers are valid... | [
"Adds",
"a",
"function",
"as",
"listener",
"."
] | 051c64fdaa3a648174cbd54557d05ad553dd826b | https://github.com/FuzeWorks/Core/blob/051c64fdaa3a648174cbd54557d05ad553dd826b/src/FuzeWorks/Events.php#L85-L119 |
25,595 | FuzeWorks/Core | src/FuzeWorks/Events.php | Events.removeListener | public static function removeListener($callback, $eventName, $priority = EventPriority::NORMAL)
{
if (EventPriority::getPriority($priority) == false) {
throw new EventException('Unknown priority '.$priority);
}
if (!isset(self::$listeners[$eventName]) || !isset(self::$listeners[... | php | public static function removeListener($callback, $eventName, $priority = EventPriority::NORMAL)
{
if (EventPriority::getPriority($priority) == false) {
throw new EventException('Unknown priority '.$priority);
}
if (!isset(self::$listeners[$eventName]) || !isset(self::$listeners[... | [
"public",
"static",
"function",
"removeListener",
"(",
"$",
"callback",
",",
"$",
"eventName",
",",
"$",
"priority",
"=",
"EventPriority",
"::",
"NORMAL",
")",
"{",
"if",
"(",
"EventPriority",
"::",
"getPriority",
"(",
"$",
"priority",
")",
"==",
"false",
... | Removes a function as listener.
@param mixed callback The callback when the events get fired, see {@link http://php.net/manual/en/language.types.callable.php PHP.net}
@param string $eventName The name of the event
@param int $priority The priority, even though integers are valid, please use EventPriority (for exam... | [
"Removes",
"a",
"function",
"as",
"listener",
"."
] | 051c64fdaa3a648174cbd54557d05ad553dd826b | https://github.com/FuzeWorks/Core/blob/051c64fdaa3a648174cbd54557d05ad553dd826b/src/FuzeWorks/Events.php#L132-L149 |
25,596 | netlogix/Netlogix.Crud | Classes/Netlogix/Crud/Domain/Service/DataTransferObjectFactory.php | DataTransferObjectFactory.getDataTransferObjectName | public function getDataTransferObjectName($object) {
$objectName = TypeHandling::getTypeForValue($object);
if (!array_key_exists($objectName, $this->classMappingConfiguration)) {
foreach (array_reverse($this->classNameToDtoClassNameReplaceFragments, TRUE) as $dtoClassNameFragment => $classNameFragment) {
$d... | php | public function getDataTransferObjectName($object) {
$objectName = TypeHandling::getTypeForValue($object);
if (!array_key_exists($objectName, $this->classMappingConfiguration)) {
foreach (array_reverse($this->classNameToDtoClassNameReplaceFragments, TRUE) as $dtoClassNameFragment => $classNameFragment) {
$d... | [
"public",
"function",
"getDataTransferObjectName",
"(",
"$",
"object",
")",
"{",
"$",
"objectName",
"=",
"TypeHandling",
"::",
"getTypeForValue",
"(",
"$",
"object",
")",
";",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"objectName",
",",
"$",
"this",
"->"... | Returns the class name of the given DataTransferObject.
@param $object
@return string
@throws InvalidTargetException | [
"Returns",
"the",
"class",
"name",
"of",
"the",
"given",
"DataTransferObject",
"."
] | 61438827ba6b0a7a63cd2f08a294967ed5928144 | https://github.com/netlogix/Netlogix.Crud/blob/61438827ba6b0a7a63cd2f08a294967ed5928144/Classes/Netlogix/Crud/Domain/Service/DataTransferObjectFactory.php#L82-L100 |
25,597 | netlogix/Netlogix.Crud | Classes/Netlogix/Crud/Domain/Service/DataTransferObjectFactory.php | DataTransferObjectFactory.getDataTransferObject | public function getDataTransferObject($object) {
if ($object === NULL) {
return NULL;
}
$identifier = $this->persistenceManager->getIdentifierByObject($object);
$dto = $this->propertyMapper->convert($identifier, $this->getDataTransferObjectName($object));
return $dto;
} | php | public function getDataTransferObject($object) {
if ($object === NULL) {
return NULL;
}
$identifier = $this->persistenceManager->getIdentifierByObject($object);
$dto = $this->propertyMapper->convert($identifier, $this->getDataTransferObjectName($object));
return $dto;
} | [
"public",
"function",
"getDataTransferObject",
"(",
"$",
"object",
")",
"{",
"if",
"(",
"$",
"object",
"===",
"NULL",
")",
"{",
"return",
"NULL",
";",
"}",
"$",
"identifier",
"=",
"$",
"this",
"->",
"persistenceManager",
"->",
"getIdentifierByObject",
"(",
... | Returns a DataTransferObject for the given object name.
@param mixed $object
@return \Netlogix\Crud\Domain\Model\DataTransfer\AbstractDataTransferObject | [
"Returns",
"a",
"DataTransferObject",
"for",
"the",
"given",
"object",
"name",
"."
] | 61438827ba6b0a7a63cd2f08a294967ed5928144 | https://github.com/netlogix/Netlogix.Crud/blob/61438827ba6b0a7a63cd2f08a294967ed5928144/Classes/Netlogix/Crud/Domain/Service/DataTransferObjectFactory.php#L108-L115 |
25,598 | netlogix/Netlogix.Crud | Classes/Netlogix/Crud/Domain/Service/DataTransferObjectFactory.php | DataTransferObjectFactory.pushClassNameToDtoClassNameReplaceFragments | public function pushClassNameToDtoClassNameReplaceFragments(array $classNameToDtoClassNameReplaceFragments, $mergeWithExistingFragments = TRUE) {
array_push($this->classNameToDtoClassNameReplaceFragmentsStack, $this->classNameToDtoClassNameReplaceFragments);
array_push($this->classMappingConfigurationStack, $this->... | php | public function pushClassNameToDtoClassNameReplaceFragments(array $classNameToDtoClassNameReplaceFragments, $mergeWithExistingFragments = TRUE) {
array_push($this->classNameToDtoClassNameReplaceFragmentsStack, $this->classNameToDtoClassNameReplaceFragments);
array_push($this->classMappingConfigurationStack, $this->... | [
"public",
"function",
"pushClassNameToDtoClassNameReplaceFragments",
"(",
"array",
"$",
"classNameToDtoClassNameReplaceFragments",
",",
"$",
"mergeWithExistingFragments",
"=",
"TRUE",
")",
"{",
"array_push",
"(",
"$",
"this",
"->",
"classNameToDtoClassNameReplaceFragmentsStack"... | Register new class name fragments
@param array $classNameToDtoClassNameReplaceFragments
@param bool $mergeWithExistingFragments | [
"Register",
"new",
"class",
"name",
"fragments"
] | 61438827ba6b0a7a63cd2f08a294967ed5928144 | https://github.com/netlogix/Netlogix.Crud/blob/61438827ba6b0a7a63cd2f08a294967ed5928144/Classes/Netlogix/Crud/Domain/Service/DataTransferObjectFactory.php#L135-L142 |
25,599 | netlogix/Netlogix.Crud | Classes/Netlogix/Crud/Domain/Service/DataTransferObjectFactory.php | DataTransferObjectFactory.popClassNameToDtoClassNameReplaceFragments | public function popClassNameToDtoClassNameReplaceFragments() {
$this->classMappingConfiguration = array_pop($this->classMappingConfigurationStack);
$this->classNameToDtoClassNameReplaceFragments = array_pop($this->classNameToDtoClassNameReplaceFragmentsStack);
} | php | public function popClassNameToDtoClassNameReplaceFragments() {
$this->classMappingConfiguration = array_pop($this->classMappingConfigurationStack);
$this->classNameToDtoClassNameReplaceFragments = array_pop($this->classNameToDtoClassNameReplaceFragmentsStack);
} | [
"public",
"function",
"popClassNameToDtoClassNameReplaceFragments",
"(",
")",
"{",
"$",
"this",
"->",
"classMappingConfiguration",
"=",
"array_pop",
"(",
"$",
"this",
"->",
"classMappingConfigurationStack",
")",
";",
"$",
"this",
"->",
"classNameToDtoClassNameReplaceFragm... | Restore old class name fragment settings | [
"Restore",
"old",
"class",
"name",
"fragment",
"settings"
] | 61438827ba6b0a7a63cd2f08a294967ed5928144 | https://github.com/netlogix/Netlogix.Crud/blob/61438827ba6b0a7a63cd2f08a294967ed5928144/Classes/Netlogix/Crud/Domain/Service/DataTransferObjectFactory.php#L147-L150 |
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.