id int32 0 241k | repo stringlengths 6 63 | path stringlengths 5 140 | func_name stringlengths 3 151 | original_string stringlengths 84 13k | language stringclasses 1
value | code stringlengths 84 13k | code_tokens list | docstring stringlengths 3 47.2k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 91 247 |
|---|---|---|---|---|---|---|---|---|---|---|---|
197,600 | Kris-Kuiper/sFire-Framework | src/Validator/File/Validator.php | Validator.isRequired | private function isRequired($field, $file) {
if(true === isset($this -> required[$field])) {
if(false === $this -> required[$field] && (null === $file || trim($file['tmp_name']) === '')) {
return true;
}
}
return false;
} | php | private function isRequired($field, $file) {
if(true === isset($this -> required[$field])) {
if(false === $this -> required[$field] && (null === $file || trim($file['tmp_name']) === '')) {
return true;
}
}
return false;
} | [
"private",
"function",
"isRequired",
"(",
"$",
"field",
",",
"$",
"file",
")",
"{",
"if",
"(",
"true",
"===",
"isset",
"(",
"$",
"this",
"->",
"required",
"[",
"$",
"field",
"]",
")",
")",
"{",
"if",
"(",
"false",
"===",
"$",
"this",
"->",
"requi... | Evaluates if file is required or not
@param $field string
@param $file null | string
@return boolean | [
"Evaluates",
"if",
"file",
"is",
"required",
"or",
"not"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/Validator/File/Validator.php#L141-L151 |
197,601 | Kris-Kuiper/sFire-Framework | src/Validator/File/Validator.php | Validator.getFile | private function getFile($field, $prefix) {
//Prefix
if(null !== $prefix) {
$field = $prefix . '[' . $field . ']';
}
//Get the value
$helper = new StringToArray();
$data = $helper -> execute($field, null, $this -> getData());
return $data;
} | php | private function getFile($field, $prefix) {
//Prefix
if(null !== $prefix) {
$field = $prefix . '[' . $field . ']';
}
//Get the value
$helper = new StringToArray();
$data = $helper -> execute($field, null, $this -> getData());
return $data;
} | [
"private",
"function",
"getFile",
"(",
"$",
"field",
",",
"$",
"prefix",
")",
"{",
"//Prefix\r",
"if",
"(",
"null",
"!==",
"$",
"prefix",
")",
"{",
"$",
"field",
"=",
"$",
"prefix",
".",
"'['",
".",
"$",
"field",
".",
"']'",
";",
"}",
"//Get the va... | Returns the file array for a given field
@param string $field
@param string $prefix
@return mixed | [
"Returns",
"the",
"file",
"array",
"for",
"a",
"given",
"field"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/Validator/File/Validator.php#L215-L227 |
197,602 | Wedeto/FileFormats | src/INI/Writer.php | Writer.writeParameter | private static function writeParameter($file_handle, $name, $parameter, $depth = 0)
{
if ($depth > 1)
throw new \DomainException("Cannot nest arrays more than once in INI-file");
$str = "";
if (WF::is_array_like($parameter))
{
foreach ($parameter as $key => $... | php | private static function writeParameter($file_handle, $name, $parameter, $depth = 0)
{
if ($depth > 1)
throw new \DomainException("Cannot nest arrays more than once in INI-file");
$str = "";
if (WF::is_array_like($parameter))
{
foreach ($parameter as $key => $... | [
"private",
"static",
"function",
"writeParameter",
"(",
"$",
"file_handle",
",",
"$",
"name",
",",
"$",
"parameter",
",",
"$",
"depth",
"=",
"0",
")",
"{",
"if",
"(",
"$",
"depth",
">",
"1",
")",
"throw",
"new",
"\\",
"DomainException",
"(",
"\"Cannot ... | Recursive function that writes a parameter or a series of parameters
to the INI file
@param $name string The name of the parameter
@param $parameter mixed The parameter to write | [
"Recursive",
"function",
"that",
"writes",
"a",
"parameter",
"or",
"a",
"series",
"of",
"parameters",
"to",
"the",
"INI",
"file"
] | 65b71fbd38a2ee6b504622aca4f4047ce9d31e9f | https://github.com/Wedeto/FileFormats/blob/65b71fbd38a2ee6b504622aca4f4047ce9d31e9f/src/INI/Writer.php#L167-L193 |
197,603 | wb-crowdfusion/crowdfusion | system/core/classes/mvc/http/Request.php | Request.getAcceptedEncodings | public function getAcceptedEncodings()
{
if (null === $this->encodings) {
if (isset($_SERVER['HTTP_ACCEPT_ENCODING'])) {
$this->encodings = strtolower(trim($_SERVER['HTTP_ACCEPT_ENCODING']));
} else {
$this->encodings = '';
}
}
... | php | public function getAcceptedEncodings()
{
if (null === $this->encodings) {
if (isset($_SERVER['HTTP_ACCEPT_ENCODING'])) {
$this->encodings = strtolower(trim($_SERVER['HTTP_ACCEPT_ENCODING']));
} else {
$this->encodings = '';
}
}
... | [
"public",
"function",
"getAcceptedEncodings",
"(",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"encodings",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"_SERVER",
"[",
"'HTTP_ACCEPT_ENCODING'",
"]",
")",
")",
"{",
"$",
"this",
"->",
"encodings",
... | Returns the encodings the client accepts.
from HTTP_ACCEPT_ENCODING
@return string | [
"Returns",
"the",
"encodings",
"the",
"client",
"accepts",
".",
"from",
"HTTP_ACCEPT_ENCODING"
] | 8cad7988f046a6fefbed07d026cb4ae6706c1217 | https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/mvc/http/Request.php#L231-L242 |
197,604 | byjg/serializer | src/BinderObject.php | BinderObject.toArrayFrom | public static function toArrayFrom($source, $firstLevel = false, $excludeClasses = [], $propertyPattern = null)
{
// Prepare the source object type
$object = new SerializerObject($source);
$object->setStopFirstLevel($firstLevel);
$object->setDoNotParse($excludeClasses);
if (!... | php | public static function toArrayFrom($source, $firstLevel = false, $excludeClasses = [], $propertyPattern = null)
{
// Prepare the source object type
$object = new SerializerObject($source);
$object->setStopFirstLevel($firstLevel);
$object->setDoNotParse($excludeClasses);
if (!... | [
"public",
"static",
"function",
"toArrayFrom",
"(",
"$",
"source",
",",
"$",
"firstLevel",
"=",
"false",
",",
"$",
"excludeClasses",
"=",
"[",
"]",
",",
"$",
"propertyPattern",
"=",
"null",
")",
"{",
"// Prepare the source object type",
"$",
"object",
"=",
"... | Get all properties from a source object as an associative array
@param mixed $source
@param bool $firstLevel
@param array $excludeClasses
@param array|null $propertyPattern
@return array
@throws \ByJG\Serializer\Exception\InvalidArgumentException | [
"Get",
"all",
"properties",
"from",
"a",
"source",
"object",
"as",
"an",
"associative",
"array"
] | 035f9df69b3ad8af6fbe737da25d70d84b358f0f | https://github.com/byjg/serializer/blob/035f9df69b3ad8af6fbe737da25d70d84b358f0f/src/BinderObject.php#L78-L93 |
197,605 | byjg/serializer | src/BinderObject.php | BinderObject.setPropValue | protected function setPropValue($obj, $propName, $value)
{
if (method_exists($obj, 'set' . $propName)) {
$obj->{'set' . $propName}($value);
} elseif (isset($obj->{$propName}) || $obj instanceof stdClass) {
$obj->{$propName} = $value;
} else {
// Check if s... | php | protected function setPropValue($obj, $propName, $value)
{
if (method_exists($obj, 'set' . $propName)) {
$obj->{'set' . $propName}($value);
} elseif (isset($obj->{$propName}) || $obj instanceof stdClass) {
$obj->{$propName} = $value;
} else {
// Check if s... | [
"protected",
"function",
"setPropValue",
"(",
"$",
"obj",
",",
"$",
"propName",
",",
"$",
"value",
")",
"{",
"if",
"(",
"method_exists",
"(",
"$",
"obj",
",",
"'set'",
".",
"$",
"propName",
")",
")",
"{",
"$",
"obj",
"->",
"{",
"'set'",
".",
"$",
... | Set the property value
@param mixed $obj
@param string $propName
@param string $value | [
"Set",
"the",
"property",
"value"
] | 035f9df69b3ad8af6fbe737da25d70d84b358f0f | https://github.com/byjg/serializer/blob/035f9df69b3ad8af6fbe737da25d70d84b358f0f/src/BinderObject.php#L102-L125 |
197,606 | zhaoxianfang/tools | src/Symfony/Component/Config/Util/XmlUtils.php | XmlUtils.convertDomElementToArray | public static function convertDomElementToArray(\DOMElement $element, $checkPrefix = true)
{
$prefix = (string) $element->prefix;
$empty = true;
$config = array();
foreach ($element->attributes as $name => $node) {
if ($checkPrefix && !in_array((string) $node->prefix, arr... | php | public static function convertDomElementToArray(\DOMElement $element, $checkPrefix = true)
{
$prefix = (string) $element->prefix;
$empty = true;
$config = array();
foreach ($element->attributes as $name => $node) {
if ($checkPrefix && !in_array((string) $node->prefix, arr... | [
"public",
"static",
"function",
"convertDomElementToArray",
"(",
"\\",
"DOMElement",
"$",
"element",
",",
"$",
"checkPrefix",
"=",
"true",
")",
"{",
"$",
"prefix",
"=",
"(",
"string",
")",
"$",
"element",
"->",
"prefix",
";",
"$",
"empty",
"=",
"true",
"... | Converts a \DOMElement object to a PHP array.
The following rules applies during the conversion:
* Each tag is converted to a key value or an array
if there is more than one "value"
* The content of a tag is set under a "value" key (<foo>bar</foo>)
if the tag also has some nested tags
* The attributes are converted... | [
"Converts",
"a",
"\\",
"DOMElement",
"object",
"to",
"a",
"PHP",
"array",
"."
] | d8fc8a9ecd75b5ce4236f0a2e9fdc055108573e7 | https://github.com/zhaoxianfang/tools/blob/d8fc8a9ecd75b5ce4236f0a2e9fdc055108573e7/src/Symfony/Component/Config/Util/XmlUtils.php#L157-L206 |
197,607 | zhaoxianfang/tools | src/Symfony/Component/Config/Util/XmlUtils.php | XmlUtils.phpize | public static function phpize($value)
{
$value = (string) $value;
$lowercaseValue = strtolower($value);
switch (true) {
case 'null' === $lowercaseValue:
return;
case ctype_digit($value):
$raw = $value;
$cast = (int) $va... | php | public static function phpize($value)
{
$value = (string) $value;
$lowercaseValue = strtolower($value);
switch (true) {
case 'null' === $lowercaseValue:
return;
case ctype_digit($value):
$raw = $value;
$cast = (int) $va... | [
"public",
"static",
"function",
"phpize",
"(",
"$",
"value",
")",
"{",
"$",
"value",
"=",
"(",
"string",
")",
"$",
"value",
";",
"$",
"lowercaseValue",
"=",
"strtolower",
"(",
"$",
"value",
")",
";",
"switch",
"(",
"true",
")",
"{",
"case",
"'null'",... | Converts an xml value to a PHP type.
@param mixed $value
@return mixed | [
"Converts",
"an",
"xml",
"value",
"to",
"a",
"PHP",
"type",
"."
] | d8fc8a9ecd75b5ce4236f0a2e9fdc055108573e7 | https://github.com/zhaoxianfang/tools/blob/d8fc8a9ecd75b5ce4236f0a2e9fdc055108573e7/src/Symfony/Component/Config/Util/XmlUtils.php#L215-L248 |
197,608 | AltCtrlSupr/ACSPanel-Wordpress | Controller/WPSetupController.php | WPSetupController.indexAction | public function indexAction()
{
$em = $this->getDoctrine()->getManager();
//
// IF is admin can see all the hosts, if is user only their ones...
if (true === $this->get('security.context')->isGranted('ROLE_SUPER_ADMIN')) {
$entities = $em->getRepository('ACSACSPanelWordpr... | php | public function indexAction()
{
$em = $this->getDoctrine()->getManager();
//
// IF is admin can see all the hosts, if is user only their ones...
if (true === $this->get('security.context')->isGranted('ROLE_SUPER_ADMIN')) {
$entities = $em->getRepository('ACSACSPanelWordpr... | [
"public",
"function",
"indexAction",
"(",
")",
"{",
"$",
"em",
"=",
"$",
"this",
"->",
"getDoctrine",
"(",
")",
"->",
"getManager",
"(",
")",
";",
"//",
"// IF is admin can see all the hosts, if is user only their ones...",
"if",
"(",
"true",
"===",
"$",
"this",... | Lists all WPSetup entities. | [
"Lists",
"all",
"WPSetup",
"entities",
"."
] | b8d1daff071d8dd51afa24813162b37548610041 | https://github.com/AltCtrlSupr/ACSPanel-Wordpress/blob/b8d1daff071d8dd51afa24813162b37548610041/Controller/WPSetupController.php#L25-L47 |
197,609 | AltCtrlSupr/ACSPanel-Wordpress | Controller/WPSetupController.php | WPSetupController.newAction | public function newAction()
{
$entity = new WPSetup();
$form = $this->createForm(new WPSetupType($this->container), $entity);
return $this->render('ACSACSPanelWordpressBundle:WPSetup:new.html.twig', array(
'entity' => $entity,
'form' => $form->createView(),
... | php | public function newAction()
{
$entity = new WPSetup();
$form = $this->createForm(new WPSetupType($this->container), $entity);
return $this->render('ACSACSPanelWordpressBundle:WPSetup:new.html.twig', array(
'entity' => $entity,
'form' => $form->createView(),
... | [
"public",
"function",
"newAction",
"(",
")",
"{",
"$",
"entity",
"=",
"new",
"WPSetup",
"(",
")",
";",
"$",
"form",
"=",
"$",
"this",
"->",
"createForm",
"(",
"new",
"WPSetupType",
"(",
"$",
"this",
"->",
"container",
")",
",",
"$",
"entity",
")",
... | Displays a form to create a new WPSetup entity. | [
"Displays",
"a",
"form",
"to",
"create",
"a",
"new",
"WPSetup",
"entity",
"."
] | b8d1daff071d8dd51afa24813162b37548610041 | https://github.com/AltCtrlSupr/ACSPanel-Wordpress/blob/b8d1daff071d8dd51afa24813162b37548610041/Controller/WPSetupController.php#L74-L83 |
197,610 | AltCtrlSupr/ACSPanel-Wordpress | Controller/WPSetupController.php | WPSetupController.createAction | public function createAction(Request $request)
{
$em = $this->getDoctrine()->getManager();
$entity = new WPSetup();
$form = $this->createForm(new WPSetupType($this->container), $entity);
$form->bind($request);
if ($form->isValid()) {
$user = $this->get('securi... | php | public function createAction(Request $request)
{
$em = $this->getDoctrine()->getManager();
$entity = new WPSetup();
$form = $this->createForm(new WPSetupType($this->container), $entity);
$form->bind($request);
if ($form->isValid()) {
$user = $this->get('securi... | [
"public",
"function",
"createAction",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"em",
"=",
"$",
"this",
"->",
"getDoctrine",
"(",
")",
"->",
"getManager",
"(",
")",
";",
"$",
"entity",
"=",
"new",
"WPSetup",
"(",
")",
";",
"$",
"form",
"=",
"$... | Creates a new WPSetup entity. | [
"Creates",
"a",
"new",
"WPSetup",
"entity",
"."
] | b8d1daff071d8dd51afa24813162b37548610041 | https://github.com/AltCtrlSupr/ACSPanel-Wordpress/blob/b8d1daff071d8dd51afa24813162b37548610041/Controller/WPSetupController.php#L89-L144 |
197,611 | AltCtrlSupr/ACSPanel-Wordpress | Controller/WPSetupController.php | WPSetupController.editAction | public function editAction($id)
{
$em = $this->getDoctrine()->getManager();
$entity = $em->getRepository('ACSACSPanelWordpressBundle:WPSetup')->find($id);
if (!$entity) {
throw $this->createNotFoundException('Unable to find WPSetup entity.');
}
$editForm = $thi... | php | public function editAction($id)
{
$em = $this->getDoctrine()->getManager();
$entity = $em->getRepository('ACSACSPanelWordpressBundle:WPSetup')->find($id);
if (!$entity) {
throw $this->createNotFoundException('Unable to find WPSetup entity.');
}
$editForm = $thi... | [
"public",
"function",
"editAction",
"(",
"$",
"id",
")",
"{",
"$",
"em",
"=",
"$",
"this",
"->",
"getDoctrine",
"(",
")",
"->",
"getManager",
"(",
")",
";",
"$",
"entity",
"=",
"$",
"em",
"->",
"getRepository",
"(",
"'ACSACSPanelWordpressBundle:WPSetup'",
... | Displays a form to edit an existing WPSetup entity. | [
"Displays",
"a",
"form",
"to",
"edit",
"an",
"existing",
"WPSetup",
"entity",
"."
] | b8d1daff071d8dd51afa24813162b37548610041 | https://github.com/AltCtrlSupr/ACSPanel-Wordpress/blob/b8d1daff071d8dd51afa24813162b37548610041/Controller/WPSetupController.php#L150-L168 |
197,612 | AltCtrlSupr/ACSPanel-Wordpress | Controller/WPSetupController.php | WPSetupController.updateAction | public function updateAction(Request $request, $id)
{
$em = $this->getDoctrine()->getManager();
$entity = $em->getRepository('ACSACSPanelWordpressBundle:WPSetup')->find($id);
if (!$entity) {
throw $this->createNotFoundException('Unable to find WPSetup entity.');
}
... | php | public function updateAction(Request $request, $id)
{
$em = $this->getDoctrine()->getManager();
$entity = $em->getRepository('ACSACSPanelWordpressBundle:WPSetup')->find($id);
if (!$entity) {
throw $this->createNotFoundException('Unable to find WPSetup entity.');
}
... | [
"public",
"function",
"updateAction",
"(",
"Request",
"$",
"request",
",",
"$",
"id",
")",
"{",
"$",
"em",
"=",
"$",
"this",
"->",
"getDoctrine",
"(",
")",
"->",
"getManager",
"(",
")",
";",
"$",
"entity",
"=",
"$",
"em",
"->",
"getRepository",
"(",
... | Edits an existing WPSetup entity. | [
"Edits",
"an",
"existing",
"WPSetup",
"entity",
"."
] | b8d1daff071d8dd51afa24813162b37548610041 | https://github.com/AltCtrlSupr/ACSPanel-Wordpress/blob/b8d1daff071d8dd51afa24813162b37548610041/Controller/WPSetupController.php#L174-L200 |
197,613 | aztech-digital/phinject | src/ParameterContainer.php | ParameterContainer.validateParameter | protected function validateParameter($key, $value)
{
if ($this->isSafeValue($value)) {
return true;
}
$this->enforceNonObjectValue($key, $value);
$this->enforceMultidimensionalArrayOfScalars($key, $value);
return true;
} | php | protected function validateParameter($key, $value)
{
if ($this->isSafeValue($value)) {
return true;
}
$this->enforceNonObjectValue($key, $value);
$this->enforceMultidimensionalArrayOfScalars($key, $value);
return true;
} | [
"protected",
"function",
"validateParameter",
"(",
"$",
"key",
",",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isSafeValue",
"(",
"$",
"value",
")",
")",
"{",
"return",
"true",
";",
"}",
"$",
"this",
"->",
"enforceNonObjectValue",
"(",
"$",... | Check that the value to bind is a scalar, or an array multi-dimensional of scalars
@param string $key
@param mixed $value
@return boolean
@throws IllegalTypeException | [
"Check",
"that",
"the",
"value",
"to",
"bind",
"is",
"a",
"scalar",
"or",
"an",
"array",
"multi",
"-",
"dimensional",
"of",
"scalars"
] | 1bb2fb3b5ef44e62f168af71134c613c48b58d95 | https://github.com/aztech-digital/phinject/blob/1bb2fb3b5ef44e62f168af71134c613c48b58d95/src/ParameterContainer.php#L112-L122 |
197,614 | nails/module-geo-ip | src/Service/GeoIp.php | GeoIp.getDriverInstance | public function getDriverInstance($sSlug = null)
{
$oDriverService = Factory::service('Driver', 'nails/module-geo-ip');
$sEnabledDriver = appSetting($oDriverService->getSettingKey(), 'nails/module-geo-ip');
$oEnabledDriver = $oDriverService->getEnabled();
if (empty($sEnabledDriver) ... | php | public function getDriverInstance($sSlug = null)
{
$oDriverService = Factory::service('Driver', 'nails/module-geo-ip');
$sEnabledDriver = appSetting($oDriverService->getSettingKey(), 'nails/module-geo-ip');
$oEnabledDriver = $oDriverService->getEnabled();
if (empty($sEnabledDriver) ... | [
"public",
"function",
"getDriverInstance",
"(",
"$",
"sSlug",
"=",
"null",
")",
"{",
"$",
"oDriverService",
"=",
"Factory",
"::",
"service",
"(",
"'Driver'",
",",
"'nails/module-geo-ip'",
")",
";",
"$",
"sEnabledDriver",
"=",
"appSetting",
"(",
"$",
"oDriverSe... | Returns an instance of the driver
@param string $sSlug The driver's slug
@throws GeoIpDriverException
@return \Nails\GeoIp\Interfaces\Driver | [
"Returns",
"an",
"instance",
"of",
"the",
"driver"
] | 1c73513e18ae490c37d4e5f5fddd071c95d850ce | https://github.com/nails/module-geo-ip/blob/1c73513e18ae490c37d4e5f5fddd071c95d850ce/src/Service/GeoIp.php#L54-L83 |
197,615 | nails/module-geo-ip | src/Service/GeoIp.php | GeoIp.lookup | public function lookup($sIp = '')
{
$sIp = trim($sIp);
if (empty($sIp) && !empty($_SERVER['REMOTE_ADDR'])) {
$sIp = $_SERVER['REMOTE_ADDR'];
}
$oCache = $this->getCache($sIp);
if (!empty($oCache)) {
return $oCache;
}
$oIp = $this->o... | php | public function lookup($sIp = '')
{
$sIp = trim($sIp);
if (empty($sIp) && !empty($_SERVER['REMOTE_ADDR'])) {
$sIp = $_SERVER['REMOTE_ADDR'];
}
$oCache = $this->getCache($sIp);
if (!empty($oCache)) {
return $oCache;
}
$oIp = $this->o... | [
"public",
"function",
"lookup",
"(",
"$",
"sIp",
"=",
"''",
")",
"{",
"$",
"sIp",
"=",
"trim",
"(",
"$",
"sIp",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"sIp",
")",
"&&",
"!",
"empty",
"(",
"$",
"_SERVER",
"[",
"'REMOTE_ADDR'",
"]",
")",
")",
... | Return all information about a given IP
@param string $sIp The IP to get details for
@throws GeoIpException
@return \Nails\GeoIp\Result\Ip | [
"Return",
"all",
"information",
"about",
"a",
"given",
"IP"
] | 1c73513e18ae490c37d4e5f5fddd071c95d850ce | https://github.com/nails/module-geo-ip/blob/1c73513e18ae490c37d4e5f5fddd071c95d850ce/src/Service/GeoIp.php#L95-L118 |
197,616 | phpgears/event | src/Time/FixedTimeProvider.php | FixedTimeProvider.setCurrentTime | public function setCurrentTime(\DateTimeImmutable $fixedTime): void
{
$this->fixedTime = $fixedTime->setTimezone($this->timeZone);
} | php | public function setCurrentTime(\DateTimeImmutable $fixedTime): void
{
$this->fixedTime = $fixedTime->setTimezone($this->timeZone);
} | [
"public",
"function",
"setCurrentTime",
"(",
"\\",
"DateTimeImmutable",
"$",
"fixedTime",
")",
":",
"void",
"{",
"$",
"this",
"->",
"fixedTime",
"=",
"$",
"fixedTime",
"->",
"setTimezone",
"(",
"$",
"this",
"->",
"timeZone",
")",
";",
"}"
] | Set fixed date.
@param \DateTimeImmutable $fixedTime | [
"Set",
"fixed",
"date",
"."
] | 9b25301837748a67b3b48cc46ad837c859c4522d | https://github.com/phpgears/event/blob/9b25301837748a67b3b48cc46ad837c859c4522d/src/Time/FixedTimeProvider.php#L50-L53 |
197,617 | eureka-framework/component-config | src/Config/Config.php | Config.load | public function load($file, $namespace = '', $parser = null, $env = null)
{
$config = [];
$this->currentFile = $file;
//~ Check in cache
if (is_object($this->cache)) {
$config = $this->cache->get('Eureka.Component.Config.Test.' . $env . '.' . md5($file) . '.cache');
... | php | public function load($file, $namespace = '', $parser = null, $env = null)
{
$config = [];
$this->currentFile = $file;
//~ Check in cache
if (is_object($this->cache)) {
$config = $this->cache->get('Eureka.Component.Config.Test.' . $env . '.' . md5($file) . '.cache');
... | [
"public",
"function",
"load",
"(",
"$",
"file",
",",
"$",
"namespace",
"=",
"''",
",",
"$",
"parser",
"=",
"null",
",",
"$",
"env",
"=",
"null",
")",
"{",
"$",
"config",
"=",
"[",
"]",
";",
"$",
"this",
"->",
"currentFile",
"=",
"$",
"file",
";... | Get config value for config var specified.
@param string $file
@param string $namespace
@param object $parser File parser
@param string $env
@return $this
@throws \Exception | [
"Get",
"config",
"value",
"for",
"config",
"var",
"specified",
"."
] | ae3f17683fb3e96641b65375c6cca6a3139ae85e | https://github.com/eureka-framework/component-config/blob/ae3f17683fb3e96641b65375c6cca6a3139ae85e/src/Config/Config.php#L294-L341 |
197,618 | eureka-framework/component-config | src/Config/Config.php | Config.loadYamlFromDirectory | public function loadYamlFromDirectory($directory, $namespace = 'global.', $environment = null)
{
if ($environment === null) {
$environment = $this->environment;
}
foreach (glob($directory . '/*.yml') as $filename) {
$this->load($filename, $namespace . basename($filen... | php | public function loadYamlFromDirectory($directory, $namespace = 'global.', $environment = null)
{
if ($environment === null) {
$environment = $this->environment;
}
foreach (glob($directory . '/*.yml') as $filename) {
$this->load($filename, $namespace . basename($filen... | [
"public",
"function",
"loadYamlFromDirectory",
"(",
"$",
"directory",
",",
"$",
"namespace",
"=",
"'global.'",
",",
"$",
"environment",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"environment",
"===",
"null",
")",
"{",
"$",
"environment",
"=",
"$",
"this",
"... | Load yaml files froem given directory.
@param string $directory
@param string $namespace
@param null|string $environment
@return $this | [
"Load",
"yaml",
"files",
"froem",
"given",
"directory",
"."
] | ae3f17683fb3e96641b65375c6cca6a3139ae85e | https://github.com/eureka-framework/component-config/blob/ae3f17683fb3e96641b65375c6cca6a3139ae85e/src/Config/Config.php#L351-L362 |
197,619 | eureka-framework/component-config | src/Config/Config.php | Config.replaceReferences | private function replaceReferences(array &$config)
{
foreach ($config as $key => &$value) {
if (is_array($value)) {
$this->replaceReferences($value);
continue;
}
//~ Not string, skip
if (!is_string($value)) {
co... | php | private function replaceReferences(array &$config)
{
foreach ($config as $key => &$value) {
if (is_array($value)) {
$this->replaceReferences($value);
continue;
}
//~ Not string, skip
if (!is_string($value)) {
co... | [
"private",
"function",
"replaceReferences",
"(",
"array",
"&",
"$",
"config",
")",
"{",
"foreach",
"(",
"$",
"config",
"as",
"$",
"key",
"=>",
"&",
"$",
"value",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"value",
")",
")",
"{",
"$",
"this",
"->",
... | Replace references values in all configurations.
@param array $config
@return void | [
"Replace",
"references",
"values",
"in",
"all",
"configurations",
"."
] | ae3f17683fb3e96641b65375c6cca6a3139ae85e | https://github.com/eureka-framework/component-config/blob/ae3f17683fb3e96641b65375c6cca6a3139ae85e/src/Config/Config.php#L370-L394 |
197,620 | nattreid/tracking | src/Model/TrackingPages/TrackingPagesMapper.php | TrackingPagesMapper.findCalculateDate | public function findCalculateDate(Range $interval): array
{
$result = [];
if (!isset($this->isCalculated[(string) $interval])) {
$this->isCalculated[(string) $interval] = true;
// dopocita posledni den
if ($interval->to->format('Y-m-d') >= (new DateTime)->format('Y-m-d')) {
$last = $this->connection-... | php | public function findCalculateDate(Range $interval): array
{
$result = [];
if (!isset($this->isCalculated[(string) $interval])) {
$this->isCalculated[(string) $interval] = true;
// dopocita posledni den
if ($interval->to->format('Y-m-d') >= (new DateTime)->format('Y-m-d')) {
$last = $this->connection-... | [
"public",
"function",
"findCalculateDate",
"(",
"Range",
"$",
"interval",
")",
":",
"array",
"{",
"$",
"result",
"=",
"[",
"]",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"isCalculated",
"[",
"(",
"string",
")",
"$",
"interval",
"]",
")",
... | Vrati datum, ktere je treba prepocitat
@param Range $interval
@return DateTime[]
@throws QueryException | [
"Vrati",
"datum",
"ktere",
"je",
"treba",
"prepocitat"
] | 5fc7c993c08774945405c79a393584ef2ed589f7 | https://github.com/nattreid/tracking/blob/5fc7c993c08774945405c79a393584ef2ed589f7/src/Model/TrackingPages/TrackingPagesMapper.php#L62-L100 |
197,621 | phpffcms/ffcms-core | src/Helper/Type/Any.php | Any.isBool | public static function isBool(&$var = null): bool
{
// will return true for "1", true, "on", "yes", false for 0, "false", "off", 'no', '', NULL FOR ANY OTHER VALUE!!!
$parse = filter_var($var, FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE);
if ($parse !== null) {
$var = $parse;... | php | public static function isBool(&$var = null): bool
{
// will return true for "1", true, "on", "yes", false for 0, "false", "off", 'no', '', NULL FOR ANY OTHER VALUE!!!
$parse = filter_var($var, FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE);
if ($parse !== null) {
$var = $parse;... | [
"public",
"static",
"function",
"isBool",
"(",
"&",
"$",
"var",
"=",
"null",
")",
":",
"bool",
"{",
"// will return true for \"1\", true, \"on\", \"yes\", false for 0, \"false\", \"off\", 'no', '', NULL FOR ANY OTHER VALUE!!!",
"$",
"parse",
"=",
"filter_var",
"(",
"$",
"va... | Check if var is boolean and parseBool by ref
@param mixed $var
@return bool | [
"Check",
"if",
"var",
"is",
"boolean",
"and",
"parseBool",
"by",
"ref"
] | 44a309553ef9f115ccfcfd71f2ac6e381c612082 | https://github.com/phpffcms/ffcms-core/blob/44a309553ef9f115ccfcfd71f2ac6e381c612082/src/Helper/Type/Any.php#L93-L102 |
197,622 | VTacius/ldapPM | src/Controlador/ldapAccess.php | ldapAccess.obtenerConfiguracionDominio | protected function obtenerConfiguracionDominio($destino, $fichero){
$yaml = new \Symfony\Component\Yaml\Parser();
$valor = $yaml->parse(file_get_contents($fichero));
$parametros = $valor['ldapPM'];
if ($parametros['solo_default']) {
// TODO: Implementar esto
}else{
... | php | protected function obtenerConfiguracionDominio($destino, $fichero){
$yaml = new \Symfony\Component\Yaml\Parser();
$valor = $yaml->parse(file_get_contents($fichero));
$parametros = $valor['ldapPM'];
if ($parametros['solo_default']) {
// TODO: Implementar esto
}else{
... | [
"protected",
"function",
"obtenerConfiguracionDominio",
"(",
"$",
"destino",
",",
"$",
"fichero",
")",
"{",
"$",
"yaml",
"=",
"new",
"\\",
"Symfony",
"\\",
"Component",
"\\",
"Yaml",
"\\",
"Parser",
"(",
")",
";",
"$",
"valor",
"=",
"$",
"yaml",
"->",
... | Recoge la configuracion del dominio dado
@param string $destino
@param string $fichero
@return array | [
"Recoge",
"la",
"configuracion",
"del",
"dominio",
"dado"
] | 728af24cd0a5ca4fbed76ffb52aa4800b118879f | https://github.com/VTacius/ldapPM/blob/728af24cd0a5ca4fbed76ffb52aa4800b118879f/src/Controlador/ldapAccess.php#L129-L138 |
197,623 | rougin/blueprint | src/Application.php | Application.run | public function run($console = false)
{
$commands = $this->commands;
is_string($commands) && $commands = $this->classes();
foreach ((array) $commands as $command) {
$item = $this->container->get($command);
$this->console->add($instance = $item);
}
... | php | public function run($console = false)
{
$commands = $this->commands;
is_string($commands) && $commands = $this->classes();
foreach ((array) $commands as $command) {
$item = $this->container->get($command);
$this->console->add($instance = $item);
}
... | [
"public",
"function",
"run",
"(",
"$",
"console",
"=",
"false",
")",
"{",
"$",
"commands",
"=",
"$",
"this",
"->",
"commands",
";",
"is_string",
"(",
"$",
"commands",
")",
"&&",
"$",
"commands",
"=",
"$",
"this",
"->",
"classes",
"(",
")",
";",
"fo... | Runs the console instance.
@param boolean $console
@return \Symfony\Component\Console\Application | [
"Runs",
"the",
"console",
"instance",
"."
] | 02dab857b0fab60e060632f11f73e24467483e5b | https://github.com/rougin/blueprint/blob/02dab857b0fab60e060632f11f73e24467483e5b/src/Application.php#L164-L179 |
197,624 | rougin/blueprint | src/Application.php | Application.classes | protected function classes()
{
list($items, $pattern) = array(array(), '/\\.[^.\\s]{3,4}$/');
$files = glob($this->commands . '/*.php');
$path = strlen($this->commands . DIRECTORY_SEPARATOR);
foreach ((array) $files as $file) {
$substring = substr($file, $path);
... | php | protected function classes()
{
list($items, $pattern) = array(array(), '/\\.[^.\\s]{3,4}$/');
$files = glob($this->commands . '/*.php');
$path = strlen($this->commands . DIRECTORY_SEPARATOR);
foreach ((array) $files as $file) {
$substring = substr($file, $path);
... | [
"protected",
"function",
"classes",
"(",
")",
"{",
"list",
"(",
"$",
"items",
",",
"$",
"pattern",
")",
"=",
"array",
"(",
"array",
"(",
")",
",",
"'/\\\\.[^.\\\\s]{3,4}$/'",
")",
";",
"$",
"files",
"=",
"glob",
"(",
"$",
"this",
"->",
"commands",
".... | Returns an array of command classes.
@return string[] | [
"Returns",
"an",
"array",
"of",
"command",
"classes",
"."
] | 02dab857b0fab60e060632f11f73e24467483e5b | https://github.com/rougin/blueprint/blob/02dab857b0fab60e060632f11f73e24467483e5b/src/Application.php#L186-L207 |
197,625 | rougin/blueprint | src/Application.php | Application.parse | protected function parse($file)
{
$search = '%%CURRENT_DIRECTORY%%';
$yaml = file_get_contents($file);
$yaml = str_replace($search, $this->root, $yaml);
$result = Yaml::parse($yaml);
$this->commands = $result['paths']['commands'];
$this->namespace = $result['name... | php | protected function parse($file)
{
$search = '%%CURRENT_DIRECTORY%%';
$yaml = file_get_contents($file);
$yaml = str_replace($search, $this->root, $yaml);
$result = Yaml::parse($yaml);
$this->commands = $result['paths']['commands'];
$this->namespace = $result['name... | [
"protected",
"function",
"parse",
"(",
"$",
"file",
")",
"{",
"$",
"search",
"=",
"'%%CURRENT_DIRECTORY%%'",
";",
"$",
"yaml",
"=",
"file_get_contents",
"(",
"$",
"file",
")",
";",
"$",
"yaml",
"=",
"str_replace",
"(",
"$",
"search",
",",
"$",
"this",
... | Parses the YAML file.
@param string $file
@return void | [
"Parses",
"the",
"YAML",
"file",
"."
] | 02dab857b0fab60e060632f11f73e24467483e5b | https://github.com/rougin/blueprint/blob/02dab857b0fab60e060632f11f73e24467483e5b/src/Application.php#L215-L230 |
197,626 | DreadLabs/app-migration-migrator-phinx | src/Migrator.php | Migrator.needsToRun | public function needsToRun()
{
$this->initializeVersions();
if (empty($this->migratedVersions) && empty($this->availableVersions)) {
return false;
}
$needsToRun = $this->hasUnmigratedVersions();
return $needsToRun;
} | php | public function needsToRun()
{
$this->initializeVersions();
if (empty($this->migratedVersions) && empty($this->availableVersions)) {
return false;
}
$needsToRun = $this->hasUnmigratedVersions();
return $needsToRun;
} | [
"public",
"function",
"needsToRun",
"(",
")",
"{",
"$",
"this",
"->",
"initializeVersions",
"(",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"migratedVersions",
")",
"&&",
"empty",
"(",
"$",
"this",
"->",
"availableVersions",
")",
")",
"{",
"... | Flags if migrations need to be executed
@return bool | [
"Flags",
"if",
"migrations",
"need",
"to",
"be",
"executed"
] | a43e437fcc4e3dff7becf7114bc65b78099d0977 | https://github.com/DreadLabs/app-migration-migrator-phinx/blob/a43e437fcc4e3dff7becf7114bc65b78099d0977/src/Migrator.php#L74-L85 |
197,627 | DreadLabs/app-migration-migrator-phinx | src/Migrator.php | Migrator.initializeVersions | private function initializeVersions()
{
$env = $this->manager->getEnvironment($this->environment);
$this->migratedVersions = $env->getVersions();
$this->availableVersions = $this->manager->getMigrations();
$this->currentVersion = $env->getCurrentVersion();
} | php | private function initializeVersions()
{
$env = $this->manager->getEnvironment($this->environment);
$this->migratedVersions = $env->getVersions();
$this->availableVersions = $this->manager->getMigrations();
$this->currentVersion = $env->getCurrentVersion();
} | [
"private",
"function",
"initializeVersions",
"(",
")",
"{",
"$",
"env",
"=",
"$",
"this",
"->",
"manager",
"->",
"getEnvironment",
"(",
"$",
"this",
"->",
"environment",
")",
";",
"$",
"this",
"->",
"migratedVersions",
"=",
"$",
"env",
"->",
"getVersions",... | Initializes the migrated, available and current versions
@return void | [
"Initializes",
"the",
"migrated",
"available",
"and",
"current",
"versions"
] | a43e437fcc4e3dff7becf7114bc65b78099d0977 | https://github.com/DreadLabs/app-migration-migrator-phinx/blob/a43e437fcc4e3dff7becf7114bc65b78099d0977/src/Migrator.php#L92-L99 |
197,628 | DreadLabs/app-migration-migrator-phinx | src/Migrator.php | Migrator.hasUnmigratedVersions | private function hasUnmigratedVersions()
{
$needsToRun = false;
foreach ($this->availableVersions as $migration) {
$isTargetMigrated = in_array($migration->getVersion(), $this->migratedVersions);
if ($isTargetMigrated) {
continue;
}
... | php | private function hasUnmigratedVersions()
{
$needsToRun = false;
foreach ($this->availableVersions as $migration) {
$isTargetMigrated = in_array($migration->getVersion(), $this->migratedVersions);
if ($isTargetMigrated) {
continue;
}
... | [
"private",
"function",
"hasUnmigratedVersions",
"(",
")",
"{",
"$",
"needsToRun",
"=",
"false",
";",
"foreach",
"(",
"$",
"this",
"->",
"availableVersions",
"as",
"$",
"migration",
")",
"{",
"$",
"isTargetMigrated",
"=",
"in_array",
"(",
"$",
"migration",
"-... | Flags if unmigrated versions exists
@return bool | [
"Flags",
"if",
"unmigrated",
"versions",
"exists"
] | a43e437fcc4e3dff7becf7114bc65b78099d0977 | https://github.com/DreadLabs/app-migration-migrator-phinx/blob/a43e437fcc4e3dff7becf7114bc65b78099d0977/src/Migrator.php#L106-L122 |
197,629 | agentmedia/phine-core | src/Core/Modules/Backend/UserForm.php | UserForm.AddPasswordField | private function AddPasswordField()
{
$name = 'Password';
$this->AddField(Input::Password($name));
//Password needs contain lower case letter, upper case letter, and a digit
//$validator = new RegExp('/((?=.*\d)(?=.*[a-z])(?=.*[A-Z]))/');
//$this->AddValidator($name,... | php | private function AddPasswordField()
{
$name = 'Password';
$this->AddField(Input::Password($name));
//Password needs contain lower case letter, upper case letter, and a digit
//$validator = new RegExp('/((?=.*\d)(?=.*[a-z])(?=.*[A-Z]))/');
//$this->AddValidator($name,... | [
"private",
"function",
"AddPasswordField",
"(",
")",
"{",
"$",
"name",
"=",
"'Password'",
";",
"$",
"this",
"->",
"AddField",
"(",
"Input",
"::",
"Password",
"(",
"$",
"name",
")",
")",
";",
"//Password needs contain lower case letter, upper case letter, and a digit... | Adds the password field | [
"Adds",
"the",
"password",
"field"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Modules/Backend/UserForm.php#L104-L117 |
197,630 | stubbles/stubbles-webapp-session | src/main/php/WebSession.php | WebSession.removeValue | public function removeValue($key)
{
if (!$this->isValid()) {
throw new \LogicException('Session is in an invalid state.');
}
if ($this->storage->hasValue($key)) {
$this->storage->removeValue($key);
return true;
}
return false;
} | php | public function removeValue($key)
{
if (!$this->isValid()) {
throw new \LogicException('Session is in an invalid state.');
}
if ($this->storage->hasValue($key)) {
$this->storage->removeValue($key);
return true;
}
return false;
} | [
"public",
"function",
"removeValue",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"isValid",
"(",
")",
")",
"{",
"throw",
"new",
"\\",
"LogicException",
"(",
"'Session is in an invalid state.'",
")",
";",
"}",
"if",
"(",
"$",
"this",
"... | removes a value from the session
@param string $key key where value is stored under
@return bool true if value existed and was removed, else false
@throws \LogicException | [
"removes",
"a",
"value",
"from",
"the",
"session"
] | 2976fa28995bfb6ad00e3eac59ad689dd7892450 | https://github.com/stubbles/stubbles-webapp-session/blob/2976fa28995bfb6ad00e3eac59ad689dd7892450/src/main/php/WebSession.php#L223-L235 |
197,631 | stubbles/stubbles-webapp-session | src/main/php/WebSession.php | WebSession.valueKeys | public function valueKeys()
{
if (!$this->isValid()) {
throw new \LogicException('Session is in an invalid state.');
}
return array_values(
array_filter(
$this->storage->valueKeys(),
function($valueKey)
... | php | public function valueKeys()
{
if (!$this->isValid()) {
throw new \LogicException('Session is in an invalid state.');
}
return array_values(
array_filter(
$this->storage->valueKeys(),
function($valueKey)
... | [
"public",
"function",
"valueKeys",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"isValid",
"(",
")",
")",
"{",
"throw",
"new",
"\\",
"LogicException",
"(",
"'Session is in an invalid state.'",
")",
";",
"}",
"return",
"array_values",
"(",
"array_filter"... | return an array of all keys registered in this session
@return string[]
@throws \LogicException | [
"return",
"an",
"array",
"of",
"all",
"keys",
"registered",
"in",
"this",
"session"
] | 2976fa28995bfb6ad00e3eac59ad689dd7892450 | https://github.com/stubbles/stubbles-webapp-session/blob/2976fa28995bfb6ad00e3eac59ad689dd7892450/src/main/php/WebSession.php#L243-L258 |
197,632 | stubbles/stubbles-dbal | src/main/php/Databases.php | Databases.get | public function get(string $name = null): Database
{
return new Database($this->connections->get($name));
} | php | public function get(string $name = null): Database
{
return new Database($this->connections->get($name));
} | [
"public",
"function",
"get",
"(",
"string",
"$",
"name",
"=",
"null",
")",
":",
"Database",
"{",
"return",
"new",
"Database",
"(",
"$",
"this",
"->",
"connections",
"->",
"get",
"(",
"$",
"name",
")",
")",
";",
"}"
] | returns the database
If a name is provided and a connection with this name exists this
connection will be used. If fallback is enabled and the named
connection does not exist the default connection will be used, if
fallback is disabled a DatabaseException will be thrown.
If no name is provided the default connection ... | [
"returns",
"the",
"database"
] | b42a589025a9e511b40a2798ac84df94d6451c36 | https://github.com/stubbles/stubbles-dbal/blob/b42a589025a9e511b40a2798ac84df94d6451c36/src/main/php/Databases.php#L51-L54 |
197,633 | koolkode/context | src/Bind/ContainerInitializerLoader.php | ContainerInitializerLoader.getHash | public function getHash()
{
$names = array_keys($this->initializers);
sort($names);
return md5(implode('|', $names));
} | php | public function getHash()
{
$names = array_keys($this->initializers);
sort($names);
return md5(implode('|', $names));
} | [
"public",
"function",
"getHash",
"(",
")",
"{",
"$",
"names",
"=",
"array_keys",
"(",
"$",
"this",
"->",
"initializers",
")",
";",
"sort",
"(",
"$",
"names",
")",
";",
"return",
"md5",
"(",
"implode",
"(",
"'|'",
",",
"$",
"names",
")",
")",
";",
... | Get an MD5 hash computed from the sorted type names of all initializers.
@return string | [
"Get",
"an",
"MD5",
"hash",
"computed",
"from",
"the",
"sorted",
"type",
"names",
"of",
"all",
"initializers",
"."
] | f4aa614eb4ca1080bd89c7a2a54c9467c5b17a36 | https://github.com/koolkode/context/blob/f4aa614eb4ca1080bd89c7a2a54c9467c5b17a36/src/Bind/ContainerInitializerLoader.php#L63-L69 |
197,634 | koolkode/context | src/Bind/ContainerInitializerLoader.php | ContainerInitializerLoader.getLastModified | public function getLastModified()
{
$mtime = 0;
foreach($this->initializers as $initializer)
{
$mtime = max($mtime, filemtime((new \ReflectionClass(get_class($initializer)))->getFileName()));
}
return $mtime;
} | php | public function getLastModified()
{
$mtime = 0;
foreach($this->initializers as $initializer)
{
$mtime = max($mtime, filemtime((new \ReflectionClass(get_class($initializer)))->getFileName()));
}
return $mtime;
} | [
"public",
"function",
"getLastModified",
"(",
")",
"{",
"$",
"mtime",
"=",
"0",
";",
"foreach",
"(",
"$",
"this",
"->",
"initializers",
"as",
"$",
"initializer",
")",
"{",
"$",
"mtime",
"=",
"max",
"(",
"$",
"mtime",
",",
"filemtime",
"(",
"(",
"new"... | Get the time of the most recent modification to an initializer.
@return integer | [
"Get",
"the",
"time",
"of",
"the",
"most",
"recent",
"modification",
"to",
"an",
"initializer",
"."
] | f4aa614eb4ca1080bd89c7a2a54c9467c5b17a36 | https://github.com/koolkode/context/blob/f4aa614eb4ca1080bd89c7a2a54c9467c5b17a36/src/Bind/ContainerInitializerLoader.php#L76-L86 |
197,635 | koolkode/context | src/Bind/ContainerInitializerLoader.php | ContainerInitializerLoader.registerInitializer | public function registerInitializer(ContainerInitializerInterface $initializer)
{
$key = get_class($initializer);
if(empty($this->initializers[$key]))
{
$this->initializers[$key] = $initializer;
}
return $this;
} | php | public function registerInitializer(ContainerInitializerInterface $initializer)
{
$key = get_class($initializer);
if(empty($this->initializers[$key]))
{
$this->initializers[$key] = $initializer;
}
return $this;
} | [
"public",
"function",
"registerInitializer",
"(",
"ContainerInitializerInterface",
"$",
"initializer",
")",
"{",
"$",
"key",
"=",
"get_class",
"(",
"$",
"initializer",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"initializers",
"[",
"$",
"key",
"]"... | Register a container initializer if it has not been registered yet.
@param ContainerInitializerInterface $initializer
@return ContainerInitializerLoader | [
"Register",
"a",
"container",
"initializer",
"if",
"it",
"has",
"not",
"been",
"registered",
"yet",
"."
] | f4aa614eb4ca1080bd89c7a2a54c9467c5b17a36 | https://github.com/koolkode/context/blob/f4aa614eb4ca1080bd89c7a2a54c9467c5b17a36/src/Bind/ContainerInitializerLoader.php#L94-L104 |
197,636 | larapulse/support | src/Helpers/Regex.php | Regex.fetchQuantifier | public static function fetchQuantifier($min = null, $max = INF, bool $lazyLoad = false) : string
{
$lazy = $lazyLoad ? '?' : '';
switch (true) {
case ($min === 0 && $max === 1):
return '?'.$lazy;
case ($min === 0 && $max === INF):
return '*'.$... | php | public static function fetchQuantifier($min = null, $max = INF, bool $lazyLoad = false) : string
{
$lazy = $lazyLoad ? '?' : '';
switch (true) {
case ($min === 0 && $max === 1):
return '?'.$lazy;
case ($min === 0 && $max === INF):
return '*'.$... | [
"public",
"static",
"function",
"fetchQuantifier",
"(",
"$",
"min",
"=",
"null",
",",
"$",
"max",
"=",
"INF",
",",
"bool",
"$",
"lazyLoad",
"=",
"false",
")",
":",
"string",
"{",
"$",
"lazy",
"=",
"$",
"lazyLoad",
"?",
"'?'",
":",
"''",
";",
"switc... | Build quantifier from parameters
@param int|null $min
@param float|int $max
@param bool $lazyLoad
@return string | [
"Build",
"quantifier",
"from",
"parameters"
] | 601ee3fd6967be669afe081322340c82c7edf32d | https://github.com/larapulse/support/blob/601ee3fd6967be669afe081322340c82c7edf32d/src/Helpers/Regex.php#L23-L42 |
197,637 | locomotivemtl/charcoal-translator | src/Charcoal/Translator/Script/TranslationParserScript.php | TranslationParserScript.displayInformations | protected function displayInformations()
{
$this->climate()->underline()->out(
'Initializing translations parser script...'
);
$this->climate()->green()->out(
'CSV file output: <white>'.$this->filePath().'</white>'
);
$this->climate()->green()->out(
... | php | protected function displayInformations()
{
$this->climate()->underline()->out(
'Initializing translations parser script...'
);
$this->climate()->green()->out(
'CSV file output: <white>'.$this->filePath().'</white>'
);
$this->climate()->green()->out(
... | [
"protected",
"function",
"displayInformations",
"(",
")",
"{",
"$",
"this",
"->",
"climate",
"(",
")",
"->",
"underline",
"(",
")",
"->",
"out",
"(",
"'Initializing translations parser script...'",
")",
";",
"$",
"this",
"->",
"climate",
"(",
")",
"->",
"gre... | Give feedback about what's going on.
@return self Chainable. | [
"Give",
"feedback",
"about",
"what",
"s",
"going",
"on",
"."
] | 0a64432baef223dcccbfecf057015440dfa76e49 | https://github.com/locomotivemtl/charcoal-translator/blob/0a64432baef223dcccbfecf057015440dfa76e49/src/Charcoal/Translator/Script/TranslationParserScript.php#L205-L228 |
197,638 | locomotivemtl/charcoal-translator | src/Charcoal/Translator/Script/TranslationParserScript.php | TranslationParserScript.filePath | protected function filePath()
{
if ($this->filePath) {
return $this->filePath;
}
$base = $this->appConfig->get('base_path');
$output = $this->output();
$this->filePath = str_replace('/', DIRECTORY_SEPARATOR, $base.$output);
return $this->filePath;
} | php | protected function filePath()
{
if ($this->filePath) {
return $this->filePath;
}
$base = $this->appConfig->get('base_path');
$output = $this->output();
$this->filePath = str_replace('/', DIRECTORY_SEPARATOR, $base.$output);
return $this->filePath;
} | [
"protected",
"function",
"filePath",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"filePath",
")",
"{",
"return",
"$",
"this",
"->",
"filePath",
";",
"}",
"$",
"base",
"=",
"$",
"this",
"->",
"appConfig",
"->",
"get",
"(",
"'base_path'",
")",
";",
... | Complete filepath to the CSV location.
@return string Filepath to the csv. | [
"Complete",
"filepath",
"to",
"the",
"CSV",
"location",
"."
] | 0a64432baef223dcccbfecf057015440dfa76e49 | https://github.com/locomotivemtl/charcoal-translator/blob/0a64432baef223dcccbfecf057015440dfa76e49/src/Charcoal/Translator/Script/TranslationParserScript.php#L234-L244 |
197,639 | locomotivemtl/charcoal-translator | src/Charcoal/Translator/Script/TranslationParserScript.php | TranslationParserScript.regEx | public function regEx($type)
{
switch ($type) {
case 'php':
$f = $this->phpFunction();
$regex = '/->'.$f.'\(\s*\n*\r*(["\'])(?<text>(.|\n|\r|\n\r)*?)\s*\n*\r*\1\)/i';
break;
case 'mustache':
$tag = $this->mustacheTag();... | php | public function regEx($type)
{
switch ($type) {
case 'php':
$f = $this->phpFunction();
$regex = '/->'.$f.'\(\s*\n*\r*(["\'])(?<text>(.|\n|\r|\n\r)*?)\s*\n*\r*\1\)/i';
break;
case 'mustache':
$tag = $this->mustacheTag();... | [
"public",
"function",
"regEx",
"(",
"$",
"type",
")",
"{",
"switch",
"(",
"$",
"type",
")",
"{",
"case",
"'php'",
":",
"$",
"f",
"=",
"$",
"this",
"->",
"phpFunction",
"(",
")",
";",
"$",
"regex",
"=",
"'/->'",
".",
"$",
"f",
".",
"'\\(\\s*\\n*\\... | Regex to match in files.
@param string $type File type (mustache|php).
@return string Regex string. | [
"Regex",
"to",
"match",
"in",
"files",
"."
] | 0a64432baef223dcccbfecf057015440dfa76e49 | https://github.com/locomotivemtl/charcoal-translator/blob/0a64432baef223dcccbfecf057015440dfa76e49/src/Charcoal/Translator/Script/TranslationParserScript.php#L291-L310 |
197,640 | OxfordInfoLabs/kinikit-core | src/Util/Caching/FileCache.php | FileCache.getCachedFile | public function getCachedFile($cacheKey) {
// Get directory and filename
list($directory, $filename) = $this->getDirectoryAndFilenameFromKey($cacheKey);
if (file_exists($directory . "/" . $filename) && !is_dir($directory . "/" . $filename)) {
return file_get_contents($directory . "... | php | public function getCachedFile($cacheKey) {
// Get directory and filename
list($directory, $filename) = $this->getDirectoryAndFilenameFromKey($cacheKey);
if (file_exists($directory . "/" . $filename) && !is_dir($directory . "/" . $filename)) {
return file_get_contents($directory . "... | [
"public",
"function",
"getCachedFile",
"(",
"$",
"cacheKey",
")",
"{",
"// Get directory and filename",
"list",
"(",
"$",
"directory",
",",
"$",
"filename",
")",
"=",
"$",
"this",
"->",
"getDirectoryAndFilenameFromKey",
"(",
"$",
"cacheKey",
")",
";",
"if",
"(... | Get a cached file using the cache key - either a string or an array of keys
@param mixed $cacheKey | [
"Get",
"a",
"cached",
"file",
"using",
"the",
"cache",
"key",
"-",
"either",
"a",
"string",
"or",
"an",
"array",
"of",
"keys"
] | edc1b2e6ffabd595c4c7d322279b3dd1e59ef359 | https://github.com/OxfordInfoLabs/kinikit-core/blob/edc1b2e6ffabd595c4c7d322279b3dd1e59ef359/src/Util/Caching/FileCache.php#L31-L43 |
197,641 | OxfordInfoLabs/kinikit-core | src/Util/Caching/FileCache.php | FileCache.cacheFile | public function cacheFile($cacheKey, $fileContents) {
// Get directory and filename
list($directory, $filename) = $this->getDirectoryAndFilenameFromKey($cacheKey);
// Make the cache directory
if (!file_exists($directory)) mkdir($directory, 0777, true);
// Save the file
... | php | public function cacheFile($cacheKey, $fileContents) {
// Get directory and filename
list($directory, $filename) = $this->getDirectoryAndFilenameFromKey($cacheKey);
// Make the cache directory
if (!file_exists($directory)) mkdir($directory, 0777, true);
// Save the file
... | [
"public",
"function",
"cacheFile",
"(",
"$",
"cacheKey",
",",
"$",
"fileContents",
")",
"{",
"// Get directory and filename",
"list",
"(",
"$",
"directory",
",",
"$",
"filename",
")",
"=",
"$",
"this",
"->",
"getDirectoryAndFilenameFromKey",
"(",
"$",
"cacheKey"... | Cache a file using the file contents - overwrite if necessary.
@param $cacheKey
@param $fileContents | [
"Cache",
"a",
"file",
"using",
"the",
"file",
"contents",
"-",
"overwrite",
"if",
"necessary",
"."
] | edc1b2e6ffabd595c4c7d322279b3dd1e59ef359 | https://github.com/OxfordInfoLabs/kinikit-core/blob/edc1b2e6ffabd595c4c7d322279b3dd1e59ef359/src/Util/Caching/FileCache.php#L51-L62 |
197,642 | OxfordInfoLabs/kinikit-core | src/Util/Caching/FileCache.php | FileCache.getDirectoryAndFilenameFromKey | private function getDirectoryAndFilenameFromKey($cacheKey) {
if (!is_array($cacheKey)) {
$cacheKey = array($cacheKey);
}
$filename = array_pop($cacheKey);
$dir = $this->cacheBaseDir . "/" . join("/", $cacheKey);
// Return dir and filename
return array($dir... | php | private function getDirectoryAndFilenameFromKey($cacheKey) {
if (!is_array($cacheKey)) {
$cacheKey = array($cacheKey);
}
$filename = array_pop($cacheKey);
$dir = $this->cacheBaseDir . "/" . join("/", $cacheKey);
// Return dir and filename
return array($dir... | [
"private",
"function",
"getDirectoryAndFilenameFromKey",
"(",
"$",
"cacheKey",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"cacheKey",
")",
")",
"{",
"$",
"cacheKey",
"=",
"array",
"(",
"$",
"cacheKey",
")",
";",
"}",
"$",
"filename",
"=",
"array_pop... | Get the filename and directory from a key | [
"Get",
"the",
"filename",
"and",
"directory",
"from",
"a",
"key"
] | edc1b2e6ffabd595c4c7d322279b3dd1e59ef359 | https://github.com/OxfordInfoLabs/kinikit-core/blob/edc1b2e6ffabd595c4c7d322279b3dd1e59ef359/src/Util/Caching/FileCache.php#L82-L95 |
197,643 | miBadger/miBadger.Enum | src/Enum.php | Enum.getOrdinal | public function getOrdinal()
{
$ordinal = array_search($this->value, array_values(static::toArray()));
return $ordinal !== false ? $ordinal : -1;
} | php | public function getOrdinal()
{
$ordinal = array_search($this->value, array_values(static::toArray()));
return $ordinal !== false ? $ordinal : -1;
} | [
"public",
"function",
"getOrdinal",
"(",
")",
"{",
"$",
"ordinal",
"=",
"array_search",
"(",
"$",
"this",
"->",
"value",
",",
"array_values",
"(",
"static",
"::",
"toArray",
"(",
")",
")",
")",
";",
"return",
"$",
"ordinal",
"!==",
"false",
"?",
"$",
... | Returns the ordinal.
@return int the ordinal. | [
"Returns",
"the",
"ordinal",
"."
] | e0ed0e9c69630442b498ce2900021440224a4a15 | https://github.com/miBadger/miBadger.Enum/blob/e0ed0e9c69630442b498ce2900021440224a4a15/src/Enum.php#L54-L59 |
197,644 | TiMESPLiNTER/tsFramework | src/ch/timesplinter/auth/AuthHandlerHttp.php | AuthHandlerHttp.http_digest_parse | private function http_digest_parse($txt) {
// gegen fehlende Daten schützen
$noetige_teile = array('nonce' => 1
,'nc' => 1
,'cnonce' => 1
,'qop' => 1
,'username' => 1
,'uri' => 1
,'response' => 1
);
$daten = array();
$schluessel = implode('|', array_key... | php | private function http_digest_parse($txt) {
// gegen fehlende Daten schützen
$noetige_teile = array('nonce' => 1
,'nc' => 1
,'cnonce' => 1
,'qop' => 1
,'username' => 1
,'uri' => 1
,'response' => 1
);
$daten = array();
$schluessel = implode('|', array_key... | [
"private",
"function",
"http_digest_parse",
"(",
"$",
"txt",
")",
"{",
"// gegen fehlende Daten schützen",
"$",
"noetige_teile",
"=",
"array",
"(",
"'nonce'",
"=>",
"1",
",",
"'nc'",
"=>",
"1",
",",
"'cnonce'",
"=>",
"1",
",",
"'qop'",
"=>",
"1",
",",
"'us... | Funktion zum analysieren der HTTP-Auth-Header | [
"Funktion",
"zum",
"analysieren",
"der",
"HTTP",
"-",
"Auth",
"-",
"Header"
] | b3b9fd98f6d456a9e571015877ecca203786fd0c | https://github.com/TiMESPLiNTER/tsFramework/blob/b3b9fd98f6d456a9e571015877ecca203786fd0c/src/ch/timesplinter/auth/AuthHandlerHttp.php#L93-L115 |
197,645 | loevgaard/dandomain-foundation-entities | src/Entity/QueueItem.php | QueueItem.create | public static function create(string $identifier, string $type): QueueItemInterface
{
$queueItem = new self();
$queueItem
->setIdentifier($identifier)
->setType($type);
return $queueItem;
} | php | public static function create(string $identifier, string $type): QueueItemInterface
{
$queueItem = new self();
$queueItem
->setIdentifier($identifier)
->setType($type);
return $queueItem;
} | [
"public",
"static",
"function",
"create",
"(",
"string",
"$",
"identifier",
",",
"string",
"$",
"type",
")",
":",
"QueueItemInterface",
"{",
"$",
"queueItem",
"=",
"new",
"self",
"(",
")",
";",
"$",
"queueItem",
"->",
"setIdentifier",
"(",
"$",
"identifier... | The create method creates a valid queue item object.
@param string $identifier
@param string $type
@return QueueItemInterface | [
"The",
"create",
"method",
"creates",
"a",
"valid",
"queue",
"item",
"object",
"."
] | 256f7aa8b40d2bd9488046c3c2b1e04e982d78ad | https://github.com/loevgaard/dandomain-foundation-entities/blob/256f7aa8b40d2bd9488046c3c2b1e04e982d78ad/src/Entity/QueueItem.php#L110-L118 |
197,646 | rzajac/phptools | src/Helper/Str.php | Str.getRandomWeightedElement | public static function getRandomWeightedElement(array $weightedValues, $default = 1)
{
$sum = (int) array_sum($weightedValues);
$min = 1;
$rand = mt_rand(min($min, $sum), max($min, $sum));
$ret = $default;
foreach ($weightedValues as $key => $value) {
$rand -= ... | php | public static function getRandomWeightedElement(array $weightedValues, $default = 1)
{
$sum = (int) array_sum($weightedValues);
$min = 1;
$rand = mt_rand(min($min, $sum), max($min, $sum));
$ret = $default;
foreach ($weightedValues as $key => $value) {
$rand -= ... | [
"public",
"static",
"function",
"getRandomWeightedElement",
"(",
"array",
"$",
"weightedValues",
",",
"$",
"default",
"=",
"1",
")",
"{",
"$",
"sum",
"=",
"(",
"int",
")",
"array_sum",
"(",
"$",
"weightedValues",
")",
";",
"$",
"min",
"=",
"1",
";",
"$... | Get random weighted element.
Utility function for getting random values with weighting.
Pass in an associative array, such as array('A'=>5, 'B'=>45, 'C'=>50)
An array like this means that "A" has a 5% chance of being selected, "B" 45%, and "C" 50%.
The return value is the array key, A, B, or C in this case. Note tha... | [
"Get",
"random",
"weighted",
"element",
"."
] | 3cbece7645942d244603c14ba897d8a676ee3088 | https://github.com/rzajac/phptools/blob/3cbece7645942d244603c14ba897d8a676ee3088/src/Helper/Str.php#L95-L114 |
197,647 | rzajac/phptools | src/Helper/Str.php | Str.toString | public static function toString($value)
{
if (is_null($value)) {
$ret = 'null';
} elseif (is_bool($value)) {
$ret = $value ? 'true' : 'false';
} elseif (is_array($value)) {
$ret = '[' . implode(',', $value) . ']';
} else if ((!is_object($value) && ... | php | public static function toString($value)
{
if (is_null($value)) {
$ret = 'null';
} elseif (is_bool($value)) {
$ret = $value ? 'true' : 'false';
} elseif (is_array($value)) {
$ret = '[' . implode(',', $value) . ']';
} else if ((!is_object($value) && ... | [
"public",
"static",
"function",
"toString",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"value",
")",
")",
"{",
"$",
"ret",
"=",
"'null'",
";",
"}",
"elseif",
"(",
"is_bool",
"(",
"$",
"value",
")",
")",
"{",
"$",
"ret",
"=",
"... | Cast anything to string.
@param mixed $value The value to cast to string.
@return string | [
"Cast",
"anything",
"to",
"string",
"."
] | 3cbece7645942d244603c14ba897d8a676ee3088 | https://github.com/rzajac/phptools/blob/3cbece7645942d244603c14ba897d8a676ee3088/src/Helper/Str.php#L227-L244 |
197,648 | rzajac/phptools | src/Helper/Str.php | Str.contains | public static function contains($haystack, $needle, $ignoreCase = false)
{
if ($ignoreCase) {
$needle = strtolower($needle);
$haystack = strtolower($haystack);
}
$pos = strpos($haystack, $needle);
return !($pos === false);
} | php | public static function contains($haystack, $needle, $ignoreCase = false)
{
if ($ignoreCase) {
$needle = strtolower($needle);
$haystack = strtolower($haystack);
}
$pos = strpos($haystack, $needle);
return !($pos === false);
} | [
"public",
"static",
"function",
"contains",
"(",
"$",
"haystack",
",",
"$",
"needle",
",",
"$",
"ignoreCase",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"ignoreCase",
")",
"{",
"$",
"needle",
"=",
"strtolower",
"(",
"$",
"needle",
")",
";",
"$",
"haysta... | Return true if haystack contains needle.
@param string $haystack The string to check for needle existence.
@param string $needle The string to find in the haystack.
@param bool $ignoreCase Set to true to ignore case.
@return bool | [
"Return",
"true",
"if",
"haystack",
"contains",
"needle",
"."
] | 3cbece7645942d244603c14ba897d8a676ee3088 | https://github.com/rzajac/phptools/blob/3cbece7645942d244603c14ba897d8a676ee3088/src/Helper/Str.php#L255-L264 |
197,649 | frameworkwtf/core | src/Root.php | Root.setData | public function setData(array $data): self
{
$this->data = \array_merge($this->data, $data);
return $this;
} | php | public function setData(array $data): self
{
$this->data = \array_merge($this->data, $data);
return $this;
} | [
"public",
"function",
"setData",
"(",
"array",
"$",
"data",
")",
":",
"self",
"{",
"$",
"this",
"->",
"data",
"=",
"\\",
"array_merge",
"(",
"$",
"this",
"->",
"data",
",",
"$",
"data",
")",
";",
"return",
"$",
"this",
";",
"}"
] | Set all data to entity.
@param array $data
@return Root | [
"Set",
"all",
"data",
"to",
"entity",
"."
] | 8104ca140ec287c26724389780e5e1dba57a030a | https://github.com/frameworkwtf/core/blob/8104ca140ec287c26724389780e5e1dba57a030a/src/Root.php#L127-L132 |
197,650 | jonesiscoding/xq-sassy | src/AbstractSassDriver.php | AbstractSassDriver.setOutputStyle | public function setOutputStyle( $style )
{
$possibleStyles = array(
self::STYLE_NESTED,
self::STYLE_EXPANDED,
self::STYLE_COMPACT,
self::STYLE_COMPRESSED
);
if ( !in_array( $style, $possibleStyles ) )
{
throw new \Exception( 'Invalid output style specified.' );
}
... | php | public function setOutputStyle( $style )
{
$possibleStyles = array(
self::STYLE_NESTED,
self::STYLE_EXPANDED,
self::STYLE_COMPACT,
self::STYLE_COMPRESSED
);
if ( !in_array( $style, $possibleStyles ) )
{
throw new \Exception( 'Invalid output style specified.' );
}
... | [
"public",
"function",
"setOutputStyle",
"(",
"$",
"style",
")",
"{",
"$",
"possibleStyles",
"=",
"array",
"(",
"self",
"::",
"STYLE_NESTED",
",",
"self",
"::",
"STYLE_EXPANDED",
",",
"self",
"::",
"STYLE_COMPACT",
",",
"self",
"::",
"STYLE_COMPRESSED",
")",
... | Sets the output style between the various output styles supported by SASS.
@param int $style One of the output style constants from this class.
@return $this
@throws \Exception If an invalid output style is specified. | [
"Sets",
"the",
"output",
"style",
"between",
"the",
"various",
"output",
"styles",
"supported",
"by",
"SASS",
"."
] | cad2575ac54c997f9bf13233775fb4738dee4bbf | https://github.com/jonesiscoding/xq-sassy/blob/cad2575ac54c997f9bf13233775fb4738dee4bbf/src/AbstractSassDriver.php#L69-L86 |
197,651 | jonesiscoding/xq-sassy | src/AbstractSassDriver.php | AbstractSassDriver.setDefaults | protected function setDefaults()
{
$this->importPaths = array();
$this->pluginPaths = array();
$this->sourceMap = self::DEFAULT_SOURCEMAP;
$this->mapComment = self::DEFAULT_MAPCOMMENT;
$this->lineNumbers = self::DEFAULT_LINENUMBERS;
$this->precision = self::DEFAULT_PRECISION;
$this->style ... | php | protected function setDefaults()
{
$this->importPaths = array();
$this->pluginPaths = array();
$this->sourceMap = self::DEFAULT_SOURCEMAP;
$this->mapComment = self::DEFAULT_MAPCOMMENT;
$this->lineNumbers = self::DEFAULT_LINENUMBERS;
$this->precision = self::DEFAULT_PRECISION;
$this->style ... | [
"protected",
"function",
"setDefaults",
"(",
")",
"{",
"$",
"this",
"->",
"importPaths",
"=",
"array",
"(",
")",
";",
"$",
"this",
"->",
"pluginPaths",
"=",
"array",
"(",
")",
";",
"$",
"this",
"->",
"sourceMap",
"=",
"self",
"::",
"DEFAULT_SOURCEMAP",
... | Sets the object's properties back to their defaults. | [
"Sets",
"the",
"object",
"s",
"properties",
"back",
"to",
"their",
"defaults",
"."
] | cad2575ac54c997f9bf13233775fb4738dee4bbf | https://github.com/jonesiscoding/xq-sassy/blob/cad2575ac54c997f9bf13233775fb4738dee4bbf/src/AbstractSassDriver.php#L207-L216 |
197,652 | kaiohken1982/Neobazaar | src/Neobazaar/Doctrine/ORM/EntityRepository.php | EntityRepository.findByEncryptedId | public function findByEncryptedId($id, $field = 'id')
{
$hashids = $this->getServiceLocator()->get('neobazaar.service.hashid');
$id = $hashids->decrypt($id);
$id = is_array($id) ? reset($id) : $id;
$options = array();
$qb = $this->_em->createQueryBuilder();
$qb->select(ar... | php | public function findByEncryptedId($id, $field = 'id')
{
$hashids = $this->getServiceLocator()->get('neobazaar.service.hashid');
$id = $hashids->decrypt($id);
$id = is_array($id) ? reset($id) : $id;
$options = array();
$qb = $this->_em->createQueryBuilder();
$qb->select(ar... | [
"public",
"function",
"findByEncryptedId",
"(",
"$",
"id",
",",
"$",
"field",
"=",
"'id'",
")",
"{",
"$",
"hashids",
"=",
"$",
"this",
"->",
"getServiceLocator",
"(",
")",
"->",
"get",
"(",
"'neobazaar.service.hashid'",
")",
";",
"$",
"id",
"=",
"$",
"... | Get an entity using the encrypted ID
@param string $id
@param string $field
@return unknown | [
"Get",
"an",
"entity",
"using",
"the",
"encrypted",
"ID"
] | 288c972dea981d715c4e136edb5dba0318c9e6cb | https://github.com/kaiohken1982/Neobazaar/blob/288c972dea981d715c4e136edb5dba0318c9e6cb/src/Neobazaar/Doctrine/ORM/EntityRepository.php#L47-L62 |
197,653 | kaiohken1982/Neobazaar | src/Neobazaar/Doctrine/ORM/EntityRepository.php | EntityRepository.getEncryptedId | public function getEncryptedId($id)
{
$hashids = $this->getServiceLocator()->get('neobazaar.service.hashid');
$hash = $hashids->encrypt($id);
return $hash;
} | php | public function getEncryptedId($id)
{
$hashids = $this->getServiceLocator()->get('neobazaar.service.hashid');
$hash = $hashids->encrypt($id);
return $hash;
} | [
"public",
"function",
"getEncryptedId",
"(",
"$",
"id",
")",
"{",
"$",
"hashids",
"=",
"$",
"this",
"->",
"getServiceLocator",
"(",
")",
"->",
"get",
"(",
"'neobazaar.service.hashid'",
")",
";",
"$",
"hash",
"=",
"$",
"hashids",
"->",
"encrypt",
"(",
"$"... | Return the encrypted id using hash id service
@param int $id
@return string | [
"Return",
"the",
"encrypted",
"id",
"using",
"hash",
"id",
"service"
] | 288c972dea981d715c4e136edb5dba0318c9e6cb | https://github.com/kaiohken1982/Neobazaar/blob/288c972dea981d715c4e136edb5dba0318c9e6cb/src/Neobazaar/Doctrine/ORM/EntityRepository.php#L70-L76 |
197,654 | xZ1mEFx/yii2-base | helpers/Url.php | Url.removeUrlSegment | public static function removeUrlSegment($url, $segment, $replacement = '/')
{
$preparedSegment = trim($segment, '/');
if (empty($preparedSegment)) {
return $url;
}
preg_match('/^([^?]+?)(\?.+?)?$/', $url, $matches); // get url and get apart
return preg_replace(
... | php | public static function removeUrlSegment($url, $segment, $replacement = '/')
{
$preparedSegment = trim($segment, '/');
if (empty($preparedSegment)) {
return $url;
}
preg_match('/^([^?]+?)(\?.+?)?$/', $url, $matches); // get url and get apart
return preg_replace(
... | [
"public",
"static",
"function",
"removeUrlSegment",
"(",
"$",
"url",
",",
"$",
"segment",
",",
"$",
"replacement",
"=",
"'/'",
")",
"{",
"$",
"preparedSegment",
"=",
"trim",
"(",
"$",
"segment",
",",
"'/'",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"pr... | Try to remove URL segment
@param string $url Subject URL
@param string $segment Search segment
@param string $replacement Replacement string
@return string Results URL | [
"Try",
"to",
"remove",
"URL",
"segment"
] | f6633c08ccccb7eb5ac000dfae0db26cb2e0a76a | https://github.com/xZ1mEFx/yii2-base/blob/f6633c08ccccb7eb5ac000dfae0db26cb2e0a76a/helpers/Url.php#L20-L32 |
197,655 | ekyna/MediaBundle | Browser/Browser.php | Browser.findMedias | public function findMedias(array $types = [])
{
if (null === $this->folder) {
throw new \RuntimeException('No folder selected.');
}
$criteria = ['folder' => $this->folder];
if (count($types)) {
$criteria['type'] = $types;
}
/** @var MediaInte... | php | public function findMedias(array $types = [])
{
if (null === $this->folder) {
throw new \RuntimeException('No folder selected.');
}
$criteria = ['folder' => $this->folder];
if (count($types)) {
$criteria['type'] = $types;
}
/** @var MediaInte... | [
"public",
"function",
"findMedias",
"(",
"array",
"$",
"types",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"folder",
")",
"{",
"throw",
"new",
"\\",
"RuntimeException",
"(",
"'No folder selected.'",
")",
";",
"}",
"$",
"crite... | Returns the media found in the current folder.
@param array $types
@return MediaInterface[] | [
"Returns",
"the",
"media",
"found",
"in",
"the",
"current",
"folder",
"."
] | 512cf86c801a130a9f17eba8b48d646d23acdbab | https://github.com/ekyna/MediaBundle/blob/512cf86c801a130a9f17eba8b48d646d23acdbab/Browser/Browser.php#L72-L94 |
197,656 | koolkode/lexer | src/AbstractLexer.php | AbstractLexer.tokenizeUrl | public function tokenizeUrl($url)
{
if(!is_file($url))
{
throw new \RuntimeException(sprintf('URL does not point to a valid file: "%s"', $url));
}
$source = @file_get_contents($url);
if($source === false)
{
// @codeCoverageIgnoreStart
throw new \RuntimeException(sprintf('Unable to tokenize c... | php | public function tokenizeUrl($url)
{
if(!is_file($url))
{
throw new \RuntimeException(sprintf('URL does not point to a valid file: "%s"', $url));
}
$source = @file_get_contents($url);
if($source === false)
{
// @codeCoverageIgnoreStart
throw new \RuntimeException(sprintf('Unable to tokenize c... | [
"public",
"function",
"tokenizeUrl",
"(",
"$",
"url",
")",
"{",
"if",
"(",
"!",
"is_file",
"(",
"$",
"url",
")",
")",
"{",
"throw",
"new",
"\\",
"RuntimeException",
"(",
"sprintf",
"(",
"'URL does not point to a valid file: \"%s\"'",
",",
"$",
"url",
")",
... | Tokenize the resource at the given url and return the
resulting token sequence.
@param string $url
@return AbstractTokenSequence
@throws \RuntimeException | [
"Tokenize",
"the",
"resource",
"at",
"the",
"given",
"url",
"and",
"return",
"the",
"resulting",
"token",
"sequence",
"."
] | 1f33fb4e95bf3b6b21c63187e503bbe612a1646c | https://github.com/koolkode/lexer/blob/1f33fb4e95bf3b6b21c63187e503bbe612a1646c/src/AbstractLexer.php#L39-L56 |
197,657 | koolkode/lexer | src/AbstractLexer.php | AbstractLexer.readLiteral | protected function readLiteral($input, $delim = '"', $escaper = NULL)
{
$literal = '';
$escaped = false;
$terminated = false;
for($size = strlen($input), $i = 1; $i < $size; $i++)
{
if($input[$i] == $escaper)
{
if($escaped)
{
$literal .= $escaper;
$escaped = false;
conti... | php | protected function readLiteral($input, $delim = '"', $escaper = NULL)
{
$literal = '';
$escaped = false;
$terminated = false;
for($size = strlen($input), $i = 1; $i < $size; $i++)
{
if($input[$i] == $escaper)
{
if($escaped)
{
$literal .= $escaper;
$escaped = false;
conti... | [
"protected",
"function",
"readLiteral",
"(",
"$",
"input",
",",
"$",
"delim",
"=",
"'\"'",
",",
"$",
"escaper",
"=",
"NULL",
")",
"{",
"$",
"literal",
"=",
"''",
";",
"$",
"escaped",
"=",
"false",
";",
"$",
"terminated",
"=",
"false",
";",
"for",
"... | Reads a literal from the input delimited by the given delimiter.
@param string $input
@param string $delim The delimiter character.
@param string $escaper An escaping character.
@return string Parsed literal value without delimters.
@throws \RuntimeException When an unterminated literal is detected. | [
"Reads",
"a",
"literal",
"from",
"the",
"input",
"delimited",
"by",
"the",
"given",
"delimiter",
"."
] | 1f33fb4e95bf3b6b21c63187e503bbe612a1646c | https://github.com/koolkode/lexer/blob/1f33fb4e95bf3b6b21c63187e503bbe612a1646c/src/AbstractLexer.php#L68-L116 |
197,658 | bkstg/schedule-bundle | Entity/Event.php | Event.addGroup | public function addGroup(GroupInterface $group): self
{
if (!$group instanceof Production) {
throw new Exception('Group type not supported.');
}
$this->groups[] = $group;
return $this;
} | php | public function addGroup(GroupInterface $group): self
{
if (!$group instanceof Production) {
throw new Exception('Group type not supported.');
}
$this->groups[] = $group;
return $this;
} | [
"public",
"function",
"addGroup",
"(",
"GroupInterface",
"$",
"group",
")",
":",
"self",
"{",
"if",
"(",
"!",
"$",
"group",
"instanceof",
"Production",
")",
"{",
"throw",
"new",
"Exception",
"(",
"'Group type not supported.'",
")",
";",
"}",
"$",
"this",
"... | Add group.
@param Production $group The production.
@return Event | [
"Add",
"group",
"."
] | e64ac897aa7b28bc48319470d65de13cd4788afe | https://github.com/bkstg/schedule-bundle/blob/e64ac897aa7b28bc48319470d65de13cd4788afe/Entity/Event.php#L257-L265 |
197,659 | bkstg/schedule-bundle | Entity/Event.php | Event.addInvitation | public function addInvitation(Invitation $invitation): self
{
$invitation->setEvent($this);
$this->invitations[] = $invitation;
return $this;
} | php | public function addInvitation(Invitation $invitation): self
{
$invitation->setEvent($this);
$this->invitations[] = $invitation;
return $this;
} | [
"public",
"function",
"addInvitation",
"(",
"Invitation",
"$",
"invitation",
")",
":",
"self",
"{",
"$",
"invitation",
"->",
"setEvent",
"(",
"$",
"this",
")",
";",
"$",
"this",
"->",
"invitations",
"[",
"]",
"=",
"$",
"invitation",
";",
"return",
"$",
... | Add invitation.
@param Invitation $invitation The invitation.
@return Event | [
"Add",
"invitation",
"."
] | e64ac897aa7b28bc48319470d65de13cd4788afe | https://github.com/bkstg/schedule-bundle/blob/e64ac897aa7b28bc48319470d65de13cd4788afe/Entity/Event.php#L314-L320 |
197,660 | dorsataio/Squibble | src/SquibbleDriver.php | SquibbleDriver.getConnection | public static function getConnection($filter = ''){
switch ($filter) {
case 'host':
return self::$_host;
break;
case 'port':
return self::$_port;
break;
case 'dbname':
return self::$_dbname;
break;
case 'user':
return self::$_user;
break;
default... | php | public static function getConnection($filter = ''){
switch ($filter) {
case 'host':
return self::$_host;
break;
case 'port':
return self::$_port;
break;
case 'dbname':
return self::$_dbname;
break;
case 'user':
return self::$_user;
break;
default... | [
"public",
"static",
"function",
"getConnection",
"(",
"$",
"filter",
"=",
"''",
")",
"{",
"switch",
"(",
"$",
"filter",
")",
"{",
"case",
"'host'",
":",
"return",
"self",
"::",
"$",
"_host",
";",
"break",
";",
"case",
"'port'",
":",
"return",
"self",
... | Get specific connection parameters. Unfortunately the password is used during the
connection phase and is not stored therefore not returnable.
@method getConnection
@param string $filter A database connection parameter (host, port, dbname, user).
If none is supplied, the PDO object is returned instead.
@retu... | [
"Get",
"specific",
"connection",
"parameters",
".",
"Unfortunately",
"the",
"password",
"is",
"used",
"during",
"the",
"connection",
"phase",
"and",
"is",
"not",
"stored",
"therefore",
"not",
"returnable",
"."
] | 77f3e8049c11b6cb56baac4686c0bd2a82e5b6e9 | https://github.com/dorsataio/Squibble/blob/77f3e8049c11b6cb56baac4686c0bd2a82e5b6e9/src/SquibbleDriver.php#L207-L229 |
197,661 | dorsataio/Squibble | src/SquibbleDriver.php | SquibbleDriver.table | public function table($t){
if(is_array($t)){
$tArray = $t;
$t = $t_alias = array_shift(array_keys($tArray));
$driver = get_called_class();
if(($tArray[$t_alias] instanceof $driver) === true){
$this->_placeholders = array_merge($this->_placeholders, $tArray[$t_alias]->queryData());
$t = $tAr... | php | public function table($t){
if(is_array($t)){
$tArray = $t;
$t = $t_alias = array_shift(array_keys($tArray));
$driver = get_called_class();
if(($tArray[$t_alias] instanceof $driver) === true){
$this->_placeholders = array_merge($this->_placeholders, $tArray[$t_alias]->queryData());
$t = $tAr... | [
"public",
"function",
"table",
"(",
"$",
"t",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"t",
")",
")",
"{",
"$",
"tArray",
"=",
"$",
"t",
";",
"$",
"t",
"=",
"$",
"t_alias",
"=",
"array_shift",
"(",
"array_keys",
"(",
"$",
"tArray",
")",
")",
... | Set a table or subquery to execute the query on.
@param mixed $t Can be a string defining the table to execute the query on or an array
whose key is a subquery alias and the value is a Squibble object.
@return object returns the current squibble object. | [
"Set",
"a",
"table",
"or",
"subquery",
"to",
"execute",
"the",
"query",
"on",
"."
] | 77f3e8049c11b6cb56baac4686c0bd2a82e5b6e9 | https://github.com/dorsataio/Squibble/blob/77f3e8049c11b6cb56baac4686c0bd2a82e5b6e9/src/SquibbleDriver.php#L276-L296 |
197,662 | dorsataio/Squibble | src/SquibbleDriver.php | SquibbleDriver.select | public function select($t, $c = array()){
if(!is_array($c)){
$c = array($c);
}
if(is_array($t)){
$c = $t;
}elseif(is_string($t)){
$this->table($t);
}
$columns = [];
foreach($c as $i => $s){
$column = [];
if(!is_array($s)){
$column = \Dorsataio\Squibble\Resource\Extract::fro... | php | public function select($t, $c = array()){
if(!is_array($c)){
$c = array($c);
}
if(is_array($t)){
$c = $t;
}elseif(is_string($t)){
$this->table($t);
}
$columns = [];
foreach($c as $i => $s){
$column = [];
if(!is_array($s)){
$column = \Dorsataio\Squibble\Resource\Extract::fro... | [
"public",
"function",
"select",
"(",
"$",
"t",
",",
"$",
"c",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"c",
")",
")",
"{",
"$",
"c",
"=",
"array",
"(",
"$",
"c",
")",
";",
"}",
"if",
"(",
"is_array",
"(",
"$... | Start a new SELECT query.
@param array $c Array containing columns that the SELECT query will return.
@return object returns the current squibble object. | [
"Start",
"a",
"new",
"SELECT",
"query",
"."
] | 77f3e8049c11b6cb56baac4686c0bd2a82e5b6e9 | https://github.com/dorsataio/Squibble/blob/77f3e8049c11b6cb56baac4686c0bd2a82e5b6e9/src/SquibbleDriver.php#L305-L328 |
197,663 | dorsataio/Squibble | src/SquibbleDriver.php | SquibbleDriver.insert | public function insert($t, $nvp = array()){
$nvps = $nvp;
if(is_array($t)){
$nvps = $t;
}elseif(is_string($t)){
$this->table($t);
}
if(!isset($nvps[0])){
$nvps = array($nvps);
}
$columns = [];
foreach($nvps as $i => $nvp){
$columns[$i] = [];
foreach(array_keys($nvp) as $s){
... | php | public function insert($t, $nvp = array()){
$nvps = $nvp;
if(is_array($t)){
$nvps = $t;
}elseif(is_string($t)){
$this->table($t);
}
if(!isset($nvps[0])){
$nvps = array($nvps);
}
$columns = [];
foreach($nvps as $i => $nvp){
$columns[$i] = [];
foreach(array_keys($nvp) as $s){
... | [
"public",
"function",
"insert",
"(",
"$",
"t",
",",
"$",
"nvp",
"=",
"array",
"(",
")",
")",
"{",
"$",
"nvps",
"=",
"$",
"nvp",
";",
"if",
"(",
"is_array",
"(",
"$",
"t",
")",
")",
"{",
"$",
"nvps",
"=",
"$",
"t",
";",
"}",
"elseif",
"(",
... | Start a new INSERT query.
@param array $nvp An NVP array containing columns their value to be inserted.
@return object returns the current squibble object. | [
"Start",
"a",
"new",
"INSERT",
"query",
"."
] | 77f3e8049c11b6cb56baac4686c0bd2a82e5b6e9 | https://github.com/dorsataio/Squibble/blob/77f3e8049c11b6cb56baac4686c0bd2a82e5b6e9/src/SquibbleDriver.php#L337-L358 |
197,664 | dorsataio/Squibble | src/SquibbleDriver.php | SquibbleDriver.update | public function update($t, $nvp = array()){
if(is_array($t)){
$nvp = $t;
}elseif(is_string($t)){
$this->table($t);
}
$columns = [];
foreach(array_keys($nvp) as $s){
$column = \Dorsataio\Squibble\Resource\Extract::fromColumn($s);
$column['value'] = $nvp[$s];
array_push($columns, $colum... | php | public function update($t, $nvp = array()){
if(is_array($t)){
$nvp = $t;
}elseif(is_string($t)){
$this->table($t);
}
$columns = [];
foreach(array_keys($nvp) as $s){
$column = \Dorsataio\Squibble\Resource\Extract::fromColumn($s);
$column['value'] = $nvp[$s];
array_push($columns, $colum... | [
"public",
"function",
"update",
"(",
"$",
"t",
",",
"$",
"nvp",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"t",
")",
")",
"{",
"$",
"nvp",
"=",
"$",
"t",
";",
"}",
"elseif",
"(",
"is_string",
"(",
"$",
"t",
")",
")",... | Start a new UPDATE query.
@param array $nvp An NVP array containing columns their value to be updated.
@return object returns the current squibble object. | [
"Start",
"a",
"new",
"UPDATE",
"query",
"."
] | 77f3e8049c11b6cb56baac4686c0bd2a82e5b6e9 | https://github.com/dorsataio/Squibble/blob/77f3e8049c11b6cb56baac4686c0bd2a82e5b6e9/src/SquibbleDriver.php#L367-L381 |
197,665 | dorsataio/Squibble | src/SquibbleDriver.php | SquibbleDriver.delete | public function delete($t, $conditions = array()){
if(is_array($t)){
$conditions = $t;
}elseif(is_string($t)){
$this->table($t);
}
if(!empty($conditions)){
$this->where($conditions);
}
$this->_sql = $this->getDeleteStatement();
return $this;
} | php | public function delete($t, $conditions = array()){
if(is_array($t)){
$conditions = $t;
}elseif(is_string($t)){
$this->table($t);
}
if(!empty($conditions)){
$this->where($conditions);
}
$this->_sql = $this->getDeleteStatement();
return $this;
} | [
"public",
"function",
"delete",
"(",
"$",
"t",
",",
"$",
"conditions",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"t",
")",
")",
"{",
"$",
"conditions",
"=",
"$",
"t",
";",
"}",
"elseif",
"(",
"is_string",
"(",
"$",
"t",... | Start a new DELETE query.
@param array $conditions An NVP array containing WHERE conditions.
@return object returns the current squibble object. | [
"Start",
"a",
"new",
"DELETE",
"query",
"."
] | 77f3e8049c11b6cb56baac4686c0bd2a82e5b6e9 | https://github.com/dorsataio/Squibble/blob/77f3e8049c11b6cb56baac4686c0bd2a82e5b6e9/src/SquibbleDriver.php#L390-L401 |
197,666 | TeaLabs/collections | src/Forest.php | Forest.get | public function get($path, $default = null)
{
return Arr::get($this->items, $this->keyFor($path), $default);
} | php | public function get($path, $default = null)
{
return Arr::get($this->items, $this->keyFor($path), $default);
} | [
"public",
"function",
"get",
"(",
"$",
"path",
",",
"$",
"default",
"=",
"null",
")",
"{",
"return",
"Arr",
"::",
"get",
"(",
"$",
"this",
"->",
"items",
",",
"$",
"this",
"->",
"keyFor",
"(",
"$",
"path",
")",
",",
"$",
"default",
")",
";",
"}... | Get an item from the collection by path.
@param mixed $path
@param mixed $default
@return mixed | [
"Get",
"an",
"item",
"from",
"the",
"collection",
"by",
"path",
"."
] | 5d8885b2799791c0bcbff4e6cbacddb270b4288e | https://github.com/TeaLabs/collections/blob/5d8885b2799791c0bcbff4e6cbacddb270b4288e/src/Forest.php#L94-L97 |
197,667 | hiqdev/minii-validators | src/IpValidator.php | IpValidator.inRange | private function inRange($ip, $cidr, $range)
{
$ipVersion = $this->getIpVersion($ip);
$binIp = $this->ip2bin($ip);
$parts = explode('/', $range);
$net = array_shift($parts);
$range_cidr = array_shift($parts);
$netVersion = $this->getIpVersion($net);
if ($ip... | php | private function inRange($ip, $cidr, $range)
{
$ipVersion = $this->getIpVersion($ip);
$binIp = $this->ip2bin($ip);
$parts = explode('/', $range);
$net = array_shift($parts);
$range_cidr = array_shift($parts);
$netVersion = $this->getIpVersion($net);
if ($ip... | [
"private",
"function",
"inRange",
"(",
"$",
"ip",
",",
"$",
"cidr",
",",
"$",
"range",
")",
"{",
"$",
"ipVersion",
"=",
"$",
"this",
"->",
"getIpVersion",
"(",
"$",
"ip",
")",
";",
"$",
"binIp",
"=",
"$",
"this",
"->",
"ip2bin",
"(",
"$",
"ip",
... | Checks whether the IP is in subnet range
@param string $ip an IPv4 or IPv6 address
@param integer $cidr
@param string $range subnet in CIDR format e.g. `10.0.0.0/8` or `2001:af::/64`
@return bool | [
"Checks",
"whether",
"the",
"IP",
"is",
"in",
"subnet",
"range"
] | 3e32ccf5d0dadc070bc5a9bd6ebe98f778a1f741 | https://github.com/hiqdev/minii-validators/blob/3e32ccf5d0dadc070bc5a9bd6ebe98f778a1f741/src/IpValidator.php#L511-L534 |
197,668 | hiqdev/minii-validators | src/IpValidator.php | IpValidator.ip2bin | private function ip2bin($ip)
{
if ($this->getIpVersion($ip) === 4) {
return str_pad(base_convert(ip2long($ip), 10, 2), static::IPV4_ADDRESS_LENGTH, '0', STR_PAD_LEFT);
} else {
$unpack = unpack('A16', inet_pton($ip));
$binStr = array_shift($unpack);
$b... | php | private function ip2bin($ip)
{
if ($this->getIpVersion($ip) === 4) {
return str_pad(base_convert(ip2long($ip), 10, 2), static::IPV4_ADDRESS_LENGTH, '0', STR_PAD_LEFT);
} else {
$unpack = unpack('A16', inet_pton($ip));
$binStr = array_shift($unpack);
$b... | [
"private",
"function",
"ip2bin",
"(",
"$",
"ip",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"getIpVersion",
"(",
"$",
"ip",
")",
"===",
"4",
")",
"{",
"return",
"str_pad",
"(",
"base_convert",
"(",
"ip2long",
"(",
"$",
"ip",
")",
",",
"10",
",",
"2"... | Converts IP address to bits representation
@param string $ip
@return string bits as a string | [
"Converts",
"IP",
"address",
"to",
"bits",
"representation"
] | 3e32ccf5d0dadc070bc5a9bd6ebe98f778a1f741 | https://github.com/hiqdev/minii-validators/blob/3e32ccf5d0dadc070bc5a9bd6ebe98f778a1f741/src/IpValidator.php#L542-L556 |
197,669 | kambalabs/KmbDomain | src/KmbDomain/Model/Group.php | Group.dump | public function dump()
{
$dump = [];
if ($this->hasClasses()) {
foreach ($this->classes as $class) {
$dump[$class->getName()] = $class->dump();
}
}
return $dump;
} | php | public function dump()
{
$dump = [];
if ($this->hasClasses()) {
foreach ($this->classes as $class) {
$dump[$class->getName()] = $class->dump();
}
}
return $dump;
} | [
"public",
"function",
"dump",
"(",
")",
"{",
"$",
"dump",
"=",
"[",
"]",
";",
"if",
"(",
"$",
"this",
"->",
"hasClasses",
"(",
")",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"classes",
"as",
"$",
"class",
")",
"{",
"$",
"dump",
"[",
"$",
"... | Dump group classes.
@return array | [
"Dump",
"group",
"classes",
"."
] | b1631bd936c6c6798076b51dfaebd706e1bdc8c2 | https://github.com/kambalabs/KmbDomain/blob/b1631bd936c6c6798076b51dfaebd706e1bdc8c2/src/KmbDomain/Model/Group.php#L374-L383 |
197,670 | kambalabs/KmbDomain | src/KmbDomain/Model/Group.php | Group.extract | public function extract()
{
return [
'name' => $this->getName(),
'ordering' => $this->getOrdering(),
'type' => $this->getType(),
'include_pattern' => $this->getIncludePattern(),
'exclude_pattern' => $this->getExcludePattern(),
'classes'... | php | public function extract()
{
return [
'name' => $this->getName(),
'ordering' => $this->getOrdering(),
'type' => $this->getType(),
'include_pattern' => $this->getIncludePattern(),
'exclude_pattern' => $this->getExcludePattern(),
'classes'... | [
"public",
"function",
"extract",
"(",
")",
"{",
"return",
"[",
"'name'",
"=>",
"$",
"this",
"->",
"getName",
"(",
")",
",",
"'ordering'",
"=>",
"$",
"this",
"->",
"getOrdering",
"(",
")",
",",
"'type'",
"=>",
"$",
"this",
"->",
"getType",
"(",
")",
... | Extract all group's data in array.
@return array | [
"Extract",
"all",
"group",
"s",
"data",
"in",
"array",
"."
] | b1631bd936c6c6798076b51dfaebd706e1bdc8c2 | https://github.com/kambalabs/KmbDomain/blob/b1631bd936c6c6798076b51dfaebd706e1bdc8c2/src/KmbDomain/Model/Group.php#L390-L400 |
197,671 | OliverMonneke/pennePHP | src/Datatype/Boolean.php | Boolean.isValid | public static function isValid($expression, $translate = false)
{
if ($translate) {
$expression = self::translate($expression);
}
return is_bool($expression);
} | php | public static function isValid($expression, $translate = false)
{
if ($translate) {
$expression = self::translate($expression);
}
return is_bool($expression);
} | [
"public",
"static",
"function",
"isValid",
"(",
"$",
"expression",
",",
"$",
"translate",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"translate",
")",
"{",
"$",
"expression",
"=",
"self",
"::",
"translate",
"(",
"$",
"expression",
")",
";",
"}",
"return",... | Check if expression is valid
@param mixed $expression The expression to check
@param bool $translate
@return bool | [
"Check",
"if",
"expression",
"is",
"valid"
] | dd0de7944685a3f1947157e1254fc54b55ff9942 | https://github.com/OliverMonneke/pennePHP/blob/dd0de7944685a3f1947157e1254fc54b55ff9942/src/Datatype/Boolean.php#L37-L44 |
197,672 | libgraviton/analytics-mongoshell-converter | src/Parser.php | Parser.parse | public function parse()
{
$this->lexer->moveNext();
while (true) {
if (!$this->lexer->lookahead) {
break;
}
$this->lexer->moveNext();
$thisLine = null;
switch ($this->lexer->token['type']) {
case Lexer::T_... | php | public function parse()
{
$this->lexer->moveNext();
while (true) {
if (!$this->lexer->lookahead) {
break;
}
$this->lexer->moveNext();
$thisLine = null;
switch ($this->lexer->token['type']) {
case Lexer::T_... | [
"public",
"function",
"parse",
"(",
")",
"{",
"$",
"this",
"->",
"lexer",
"->",
"moveNext",
"(",
")",
";",
"while",
"(",
"true",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"lexer",
"->",
"lookahead",
")",
"{",
"break",
";",
"}",
"$",
"this",
... | parses our stuff
@return string parsed pipeline as a script | [
"parses",
"our",
"stuff"
] | 437731c353c58978d39bcd40ac5a741a0b106667 | https://github.com/libgraviton/analytics-mongoshell-converter/blob/437731c353c58978d39bcd40ac5a741a0b106667/src/Parser.php#L46-L133 |
197,673 | FusePump/cli.php | lib/FusePump/Cli/Colours.php | Colours.string | public static function string($string, $foreground_colour = null, $background_colour = null)
{
$coloured_string = "";
// Check if given foreground colour found
if (isset(self::$foreground_colours[$foreground_colour])) {
$coloured_string .= self::getForegroundCode($foreground_col... | php | public static function string($string, $foreground_colour = null, $background_colour = null)
{
$coloured_string = "";
// Check if given foreground colour found
if (isset(self::$foreground_colours[$foreground_colour])) {
$coloured_string .= self::getForegroundCode($foreground_col... | [
"public",
"static",
"function",
"string",
"(",
"$",
"string",
",",
"$",
"foreground_colour",
"=",
"null",
",",
"$",
"background_colour",
"=",
"null",
")",
"{",
"$",
"coloured_string",
"=",
"\"\"",
";",
"// Check if given foreground colour found",
"if",
"(",
"iss... | Adds colouring control codes to a string.
@param string $string String to format.
@param string $foreground_colour Optional foreground colour for string.
@param string $background_colour Optional background colour for string.
@return string Formatted string. | [
"Adds",
"colouring",
"control",
"codes",
"to",
"a",
"string",
"."
] | 2cc92f09ce7b2f73d5cbc09f5ae4f31f3f9ae3b4 | https://github.com/FusePump/cli.php/blob/2cc92f09ce7b2f73d5cbc09f5ae4f31f3f9ae3b4/lib/FusePump/Cli/Colours.php#L69-L86 |
197,674 | FusePump/cli.php | lib/FusePump/Cli/Colours.php | Colours.getForegroundCode | public static function getForegroundCode($foregroundColour)
{
if (!isset(self::$foreground_colours[$foregroundColour])) {
throw new \Exception('Invalid foreground colour.');
}
return "\033[" . self::$foreground_colours[$foregroundColour] . 'm';
} | php | public static function getForegroundCode($foregroundColour)
{
if (!isset(self::$foreground_colours[$foregroundColour])) {
throw new \Exception('Invalid foreground colour.');
}
return "\033[" . self::$foreground_colours[$foregroundColour] . 'm';
} | [
"public",
"static",
"function",
"getForegroundCode",
"(",
"$",
"foregroundColour",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"self",
"::",
"$",
"foreground_colours",
"[",
"$",
"foregroundColour",
"]",
")",
")",
"{",
"throw",
"new",
"\\",
"Exception",
"(",
"'... | Returns the code for a foreground colour.
@param string $foregroundColour Foreground colour to set.
@return string Foreground colour code.
@throws \Exception if the colour code is invalid. | [
"Returns",
"the",
"code",
"for",
"a",
"foreground",
"colour",
"."
] | 2cc92f09ce7b2f73d5cbc09f5ae4f31f3f9ae3b4 | https://github.com/FusePump/cli.php/blob/2cc92f09ce7b2f73d5cbc09f5ae4f31f3f9ae3b4/lib/FusePump/Cli/Colours.php#L97-L103 |
197,675 | FusePump/cli.php | lib/FusePump/Cli/Colours.php | Colours.getBackgroundCode | public static function getBackgroundCode($backgroundColour)
{
if (!isset(self::$background_colours[$backgroundColour])) {
throw new \Exception('Invalid background colour.');
}
return "\033[" . self::$background_colours[$backgroundColour] . 'm';
} | php | public static function getBackgroundCode($backgroundColour)
{
if (!isset(self::$background_colours[$backgroundColour])) {
throw new \Exception('Invalid background colour.');
}
return "\033[" . self::$background_colours[$backgroundColour] . 'm';
} | [
"public",
"static",
"function",
"getBackgroundCode",
"(",
"$",
"backgroundColour",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"self",
"::",
"$",
"background_colours",
"[",
"$",
"backgroundColour",
"]",
")",
")",
"{",
"throw",
"new",
"\\",
"Exception",
"(",
"'... | Returns the code for a background colour.
@param string $backgroundColour Background colour to set.
@return string Background colour code.
@throws \Exception if the colour code is invalid. | [
"Returns",
"the",
"code",
"for",
"a",
"background",
"colour",
"."
] | 2cc92f09ce7b2f73d5cbc09f5ae4f31f3f9ae3b4 | https://github.com/FusePump/cli.php/blob/2cc92f09ce7b2f73d5cbc09f5ae4f31f3f9ae3b4/lib/FusePump/Cli/Colours.php#L114-L120 |
197,676 | dms-org/common.structure | src/Table/Form/Builder/TableRowFieldDefiner.php | TableRowFieldDefiner.withPredefinedRowValues | public function withPredefinedRowValues(FieldBuilderBase $field, array $rowValues) : TableCellValueFieldDefiner
{
$this->fieldBuilder->attr(TableType::ATTR_PREDEFINED_ROWS, array_values($rowValues));
return $this->withRowKeyAs($field);
} | php | public function withPredefinedRowValues(FieldBuilderBase $field, array $rowValues) : TableCellValueFieldDefiner
{
$this->fieldBuilder->attr(TableType::ATTR_PREDEFINED_ROWS, array_values($rowValues));
return $this->withRowKeyAs($field);
} | [
"public",
"function",
"withPredefinedRowValues",
"(",
"FieldBuilderBase",
"$",
"field",
",",
"array",
"$",
"rowValues",
")",
":",
"TableCellValueFieldDefiner",
"{",
"$",
"this",
"->",
"fieldBuilder",
"->",
"attr",
"(",
"TableType",
"::",
"ATTR_PREDEFINED_ROWS",
",",... | Defines the rows as predefined set of values.
@param FieldBuilderBase $field
@param array $rowValues
@return TableCellValueFieldDefiner | [
"Defines",
"the",
"rows",
"as",
"predefined",
"set",
"of",
"values",
"."
] | 23f122182f60df5ec847047a81a39c8aab019ff1 | https://github.com/dms-org/common.structure/blob/23f122182f60df5ec847047a81a39c8aab019ff1/src/Table/Form/Builder/TableRowFieldDefiner.php#L53-L57 |
197,677 | dms-org/common.structure | src/Table/Form/Builder/TableRowFieldDefiner.php | TableRowFieldDefiner.withRowKeyAsField | public function withRowKeyAsField(IField $field) : TableCellValueFieldDefiner
{
return new TableCellValueFieldDefiner($this->fieldBuilder, $this->cellClassName, $this->columnField, $field);
} | php | public function withRowKeyAsField(IField $field) : TableCellValueFieldDefiner
{
return new TableCellValueFieldDefiner($this->fieldBuilder, $this->cellClassName, $this->columnField, $field);
} | [
"public",
"function",
"withRowKeyAsField",
"(",
"IField",
"$",
"field",
")",
":",
"TableCellValueFieldDefiner",
"{",
"return",
"new",
"TableCellValueFieldDefiner",
"(",
"$",
"this",
"->",
"fieldBuilder",
",",
"$",
"this",
"->",
"cellClassName",
",",
"$",
"this",
... | Defines the row key as the supplied field.
@param IField $field
@return TableCellValueFieldDefiner | [
"Defines",
"the",
"row",
"key",
"as",
"the",
"supplied",
"field",
"."
] | 23f122182f60df5ec847047a81a39c8aab019ff1 | https://github.com/dms-org/common.structure/blob/23f122182f60df5ec847047a81a39c8aab019ff1/src/Table/Form/Builder/TableRowFieldDefiner.php#L78-L81 |
197,678 | Wayn0/Log | src/Log/Log.php | Log.log | private function log($line, $log_level)
{
// Write all events less than log verbosity
if ($log_level <= $this->log_verbosity) {
$line = $this->prepend($log_level) . $line . "\n";
$this->writeLine($line);
}
} | php | private function log($line, $log_level)
{
// Write all events less than log verbosity
if ($log_level <= $this->log_verbosity) {
$line = $this->prepend($log_level) . $line . "\n";
$this->writeLine($line);
}
} | [
"private",
"function",
"log",
"(",
"$",
"line",
",",
"$",
"log_level",
")",
"{",
"// Write all events less than log verbosity",
"if",
"(",
"$",
"log_level",
"<=",
"$",
"this",
"->",
"log_verbosity",
")",
"{",
"$",
"line",
"=",
"$",
"this",
"->",
"prepend",
... | Write the log entry | [
"Write",
"the",
"log",
"entry"
] | d049c9a2188b9684faa29be9a920cc4216c747bd | https://github.com/Wayn0/Log/blob/d049c9a2188b9684faa29be9a920cc4216c747bd/src/Log/Log.php#L138-L145 |
197,679 | Wayn0/Log | src/Log/Log.php | Log.prepend | private function prepend($log_level)
{
$time = date('Y-m-d G:i:s');
switch ($log_level) {
case self::FATAL:
return $time . ' - FATAL - ';
break;
case self::ERROR:
return $time . ' - ERROR - ';
break;
case self::WARN:
return $time . ' - WARN - ';
break;
case self::INFO:... | php | private function prepend($log_level)
{
$time = date('Y-m-d G:i:s');
switch ($log_level) {
case self::FATAL:
return $time . ' - FATAL - ';
break;
case self::ERROR:
return $time . ' - ERROR - ';
break;
case self::WARN:
return $time . ' - WARN - ';
break;
case self::INFO:... | [
"private",
"function",
"prepend",
"(",
"$",
"log_level",
")",
"{",
"$",
"time",
"=",
"date",
"(",
"'Y-m-d G:i:s'",
")",
";",
"switch",
"(",
"$",
"log_level",
")",
"{",
"case",
"self",
"::",
"FATAL",
":",
"return",
"$",
"time",
".",
"' - FATAL - '",
";"... | format the line prefix | [
"format",
"the",
"line",
"prefix"
] | d049c9a2188b9684faa29be9a920cc4216c747bd | https://github.com/Wayn0/Log/blob/d049c9a2188b9684faa29be9a920cc4216c747bd/src/Log/Log.php#L154-L187 |
197,680 | zapheus/zapheus | src/Provider/Configuration.php | Configuration.all | public function all($dotify = false)
{
return $dotify ? $this->dotify($this->data) : $this->data;
} | php | public function all($dotify = false)
{
return $dotify ? $this->dotify($this->data) : $this->data;
} | [
"public",
"function",
"all",
"(",
"$",
"dotify",
"=",
"false",
")",
"{",
"return",
"$",
"dotify",
"?",
"$",
"this",
"->",
"dotify",
"(",
"$",
"this",
"->",
"data",
")",
":",
"$",
"this",
"->",
"data",
";",
"}"
] | Returns all the stored configurations.
@param boolean $dotify
@return array | [
"Returns",
"all",
"the",
"stored",
"configurations",
"."
] | 96618b5cee7d20b6700d0475e4334ae4b5163a6b | https://github.com/zapheus/zapheus/blob/96618b5cee7d20b6700d0475e4334ae4b5163a6b/src/Provider/Configuration.php#L34-L37 |
197,681 | zapheus/zapheus | src/Provider/Configuration.php | Configuration.get | public function get($key, $default = null, $dotify = false)
{
$items = $this->data;
$keys = array_filter(explode('.', $key));
$length = count($keys);
for ($i = 0; $i < $length; $i++)
{
$index = $keys[(int) $i];
$items = &$items[$index];
}
... | php | public function get($key, $default = null, $dotify = false)
{
$items = $this->data;
$keys = array_filter(explode('.', $key));
$length = count($keys);
for ($i = 0; $i < $length; $i++)
{
$index = $keys[(int) $i];
$items = &$items[$index];
}
... | [
"public",
"function",
"get",
"(",
"$",
"key",
",",
"$",
"default",
"=",
"null",
",",
"$",
"dotify",
"=",
"false",
")",
"{",
"$",
"items",
"=",
"$",
"this",
"->",
"data",
";",
"$",
"keys",
"=",
"array_filter",
"(",
"explode",
"(",
"'.'",
",",
"$",... | Returns the value from the specified key.
@param string $key
@param mixed|null $default
@param boolean $dotify
@return mixed | [
"Returns",
"the",
"value",
"from",
"the",
"specified",
"key",
"."
] | 96618b5cee7d20b6700d0475e4334ae4b5163a6b | https://github.com/zapheus/zapheus/blob/96618b5cee7d20b6700d0475e4334ae4b5163a6b/src/Provider/Configuration.php#L47-L73 |
197,682 | zapheus/zapheus | src/Provider/Configuration.php | Configuration.load | public function load($path)
{
list($data, $items) = array(array(), array($path));
if (substr((string) $path, -4) !== '.php')
{
$directory = new \RecursiveDirectoryIterator($path);
$iterator = new \RecursiveIteratorIterator($directory);
$regex = new \Reg... | php | public function load($path)
{
list($data, $items) = array(array(), array($path));
if (substr((string) $path, -4) !== '.php')
{
$directory = new \RecursiveDirectoryIterator($path);
$iterator = new \RecursiveIteratorIterator($directory);
$regex = new \Reg... | [
"public",
"function",
"load",
"(",
"$",
"path",
")",
"{",
"list",
"(",
"$",
"data",
",",
"$",
"items",
")",
"=",
"array",
"(",
"array",
"(",
")",
",",
"array",
"(",
"$",
"path",
")",
")",
";",
"if",
"(",
"substr",
"(",
"(",
"string",
")",
"$"... | Loads an array of values from a specified file or directory.
@param string $path
@return void | [
"Loads",
"an",
"array",
"of",
"values",
"from",
"a",
"specified",
"file",
"or",
"directory",
"."
] | 96618b5cee7d20b6700d0475e4334ae4b5163a6b | https://github.com/zapheus/zapheus/blob/96618b5cee7d20b6700d0475e4334ae4b5163a6b/src/Provider/Configuration.php#L81-L104 |
197,683 | zapheus/zapheus | src/Provider/Configuration.php | Configuration.dotify | protected function dotify(array $data, $result = array(), $key = '')
{
foreach ((array) $data as $name => $value)
{
if (is_array($value) && empty($value) === false)
{
$text = (string) $key . $name . '.';
$item = $this->dotify($value, $result, ... | php | protected function dotify(array $data, $result = array(), $key = '')
{
foreach ((array) $data as $name => $value)
{
if (is_array($value) && empty($value) === false)
{
$text = (string) $key . $name . '.';
$item = $this->dotify($value, $result, ... | [
"protected",
"function",
"dotify",
"(",
"array",
"$",
"data",
",",
"$",
"result",
"=",
"array",
"(",
")",
",",
"$",
"key",
"=",
"''",
")",
"{",
"foreach",
"(",
"(",
"array",
")",
"$",
"data",
"as",
"$",
"name",
"=>",
"$",
"value",
")",
"{",
"if... | Converts the data into dot notation values.
@param array $data
@param array $result
@param string $key
@return array | [
"Converts",
"the",
"data",
"into",
"dot",
"notation",
"values",
"."
] | 96618b5cee7d20b6700d0475e4334ae4b5163a6b | https://github.com/zapheus/zapheus/blob/96618b5cee7d20b6700d0475e4334ae4b5163a6b/src/Provider/Configuration.php#L114-L133 |
197,684 | zapheus/zapheus | src/Provider/Configuration.php | Configuration.rename | protected function rename($item, $path)
{
$name = str_replace($path, '', (string) $item);
$name = str_replace(array('\\', '/'), '.', $name);
$regex = preg_replace('/^./i', '', $name);
return basename(strtolower($regex), '.php');
} | php | protected function rename($item, $path)
{
$name = str_replace($path, '', (string) $item);
$name = str_replace(array('\\', '/'), '.', $name);
$regex = preg_replace('/^./i', '', $name);
return basename(strtolower($regex), '.php');
} | [
"protected",
"function",
"rename",
"(",
"$",
"item",
",",
"$",
"path",
")",
"{",
"$",
"name",
"=",
"str_replace",
"(",
"$",
"path",
",",
"''",
",",
"(",
"string",
")",
"$",
"item",
")",
";",
"$",
"name",
"=",
"str_replace",
"(",
"array",
"(",
"'\... | Renames the item into a dot notation one.
@param string $item
@param string $path
@return string | [
"Renames",
"the",
"item",
"into",
"a",
"dot",
"notation",
"one",
"."
] | 96618b5cee7d20b6700d0475e4334ae4b5163a6b | https://github.com/zapheus/zapheus/blob/96618b5cee7d20b6700d0475e4334ae4b5163a6b/src/Provider/Configuration.php#L158-L167 |
197,685 | zapheus/zapheus | src/Provider/Configuration.php | Configuration.save | protected function save(array &$keys, &$data, $value)
{
$key = array_shift($keys);
if (! isset($data[$key]))
{
$data[$key] = array();
}
if (empty($keys))
{
return $data[$key] = $value;
}
return $this->save($keys, $data[$key],... | php | protected function save(array &$keys, &$data, $value)
{
$key = array_shift($keys);
if (! isset($data[$key]))
{
$data[$key] = array();
}
if (empty($keys))
{
return $data[$key] = $value;
}
return $this->save($keys, $data[$key],... | [
"protected",
"function",
"save",
"(",
"array",
"&",
"$",
"keys",
",",
"&",
"$",
"data",
",",
"$",
"value",
")",
"{",
"$",
"key",
"=",
"array_shift",
"(",
"$",
"keys",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"data",
"[",
"$",
"key",
"]",
... | Saves the specified key in the list of data.
@param array &$keys
@param array &$data
@param mixed $value
@return mixed | [
"Saves",
"the",
"specified",
"key",
"in",
"the",
"list",
"of",
"data",
"."
] | 96618b5cee7d20b6700d0475e4334ae4b5163a6b | https://github.com/zapheus/zapheus/blob/96618b5cee7d20b6700d0475e4334ae4b5163a6b/src/Provider/Configuration.php#L177-L192 |
197,686 | agentmedia/phine-builtin | src/BuiltIn/Modules/Backend/LogoutForm.php | LogoutForm.InitForm | protected function InitForm()
{
$this->logout = $this->LoadElement();
$this->AddNextUrlField();
$this->AddCssIDField();
$this->AddCssClassField();
$this->AddTemplateField();
$this->AddSubmit();
} | php | protected function InitForm()
{
$this->logout = $this->LoadElement();
$this->AddNextUrlField();
$this->AddCssIDField();
$this->AddCssClassField();
$this->AddTemplateField();
$this->AddSubmit();
} | [
"protected",
"function",
"InitForm",
"(",
")",
"{",
"$",
"this",
"->",
"logout",
"=",
"$",
"this",
"->",
"LoadElement",
"(",
")",
";",
"$",
"this",
"->",
"AddNextUrlField",
"(",
")",
";",
"$",
"this",
"->",
"AddCssIDField",
"(",
")",
";",
"$",
"this"... | Intializes the form | [
"Intializes",
"the",
"form"
] | 4dd05bc406a71e997bd4eaa16b12e23dbe62a456 | https://github.com/agentmedia/phine-builtin/blob/4dd05bc406a71e997bd4eaa16b12e23dbe62a456/src/BuiltIn/Modules/Backend/LogoutForm.php#L47-L55 |
197,687 | agentmedia/phine-builtin | src/BuiltIn/Modules/Backend/LogoutForm.php | LogoutForm.SaveElement | protected function SaveElement()
{
$this->logout->SetNextUrl($this->selectorNext->Save($this->logout->GetNextUrl()));
return $this->logout;
} | php | protected function SaveElement()
{
$this->logout->SetNextUrl($this->selectorNext->Save($this->logout->GetNextUrl()));
return $this->logout;
} | [
"protected",
"function",
"SaveElement",
"(",
")",
"{",
"$",
"this",
"->",
"logout",
"->",
"SetNextUrl",
"(",
"$",
"this",
"->",
"selectorNext",
"->",
"Save",
"(",
"$",
"this",
"->",
"logout",
"->",
"GetNextUrl",
"(",
")",
")",
")",
";",
"return",
"$",
... | Saves the element and returns it
@return ContentLogout | [
"Saves",
"the",
"element",
"and",
"returns",
"it"
] | 4dd05bc406a71e997bd4eaa16b12e23dbe62a456 | https://github.com/agentmedia/phine-builtin/blob/4dd05bc406a71e997bd4eaa16b12e23dbe62a456/src/BuiltIn/Modules/Backend/LogoutForm.php#L72-L76 |
197,688 | nativgames-old/pegase | src/Pegase/Extension/Form/Service/FormBuilder.php | FormBuilder.generate | public function generate($target, $type = 'post') {
$form = new \Pegase\Extension\Form\Objects\Form(
$target,
$this->sm->get('pegase.security.token_csrf_container'),
$type);
return $form;
} | php | public function generate($target, $type = 'post') {
$form = new \Pegase\Extension\Form\Objects\Form(
$target,
$this->sm->get('pegase.security.token_csrf_container'),
$type);
return $form;
} | [
"public",
"function",
"generate",
"(",
"$",
"target",
",",
"$",
"type",
"=",
"'post'",
")",
"{",
"$",
"form",
"=",
"new",
"\\",
"Pegase",
"\\",
"Extension",
"\\",
"Form",
"\\",
"Objects",
"\\",
"Form",
"(",
"$",
"target",
",",
"$",
"this",
"->",
"s... | generate a form | [
"generate",
"a",
"form"
] | 9a00e09a26f391c988aadecd7640c72316eaa521 | https://github.com/nativgames-old/pegase/blob/9a00e09a26f391c988aadecd7640c72316eaa521/src/Pegase/Extension/Form/Service/FormBuilder.php#L22-L30 |
197,689 | cubicmushroom/valueobjects | src/Geography/Street.php | Street.fromNative | public static function fromNative()
{
$args = func_get_args();
if (\count($args) < 2) {
throw new \BadMethodCallException('You must provide from 2 to 4 arguments: 1) street name, 2) street number, 3) elements, 4) format (optional)');
}
$nameString = $args[0];
... | php | public static function fromNative()
{
$args = func_get_args();
if (\count($args) < 2) {
throw new \BadMethodCallException('You must provide from 2 to 4 arguments: 1) street name, 2) street number, 3) elements, 4) format (optional)');
}
$nameString = $args[0];
... | [
"public",
"static",
"function",
"fromNative",
"(",
")",
"{",
"$",
"args",
"=",
"func_get_args",
"(",
")",
";",
"if",
"(",
"\\",
"count",
"(",
"$",
"args",
")",
"<",
"2",
")",
"{",
"throw",
"new",
"\\",
"BadMethodCallException",
"(",
"'You must provide fr... | Returns a new Street from native PHP string name and number.
@param string $name
@param string $number
@param string $elements
@return Street
@throws \BadFunctionCallException | [
"Returns",
"a",
"new",
"Street",
"from",
"native",
"PHP",
"string",
"name",
"and",
"number",
"."
] | 4554239ab75d65eeb9773219aa5b07e9fbfabb92 | https://github.com/cubicmushroom/valueobjects/blob/4554239ab75d65eeb9773219aa5b07e9fbfabb92/src/Geography/Street.php#L35-L54 |
197,690 | cubicmushroom/valueobjects | src/Geography/Street.php | Street.sameValueAs | public function sameValueAs(ValueObjectInterface $street)
{
if (false === Util::classEquals($this, $street)) {
return false;
}
return $this->getName()->sameValueAs($street->getName()) &&
$this->getNumber()->sameValueAs($street->getNumber()) &&
$this... | php | public function sameValueAs(ValueObjectInterface $street)
{
if (false === Util::classEquals($this, $street)) {
return false;
}
return $this->getName()->sameValueAs($street->getName()) &&
$this->getNumber()->sameValueAs($street->getNumber()) &&
$this... | [
"public",
"function",
"sameValueAs",
"(",
"ValueObjectInterface",
"$",
"street",
")",
"{",
"if",
"(",
"false",
"===",
"Util",
"::",
"classEquals",
"(",
"$",
"this",
",",
"$",
"street",
")",
")",
"{",
"return",
"false",
";",
"}",
"return",
"$",
"this",
... | Tells whether two Street objects are equal
@param ValueObjectInterface $street
@return bool | [
"Tells",
"whether",
"two",
"Street",
"objects",
"are",
"equal"
] | 4554239ab75d65eeb9773219aa5b07e9fbfabb92 | https://github.com/cubicmushroom/valueobjects/blob/4554239ab75d65eeb9773219aa5b07e9fbfabb92/src/Geography/Street.php#L83-L93 |
197,691 | rafrsr/generic-api | src/GenericApi.php | GenericApi.validate | protected function validate(ApiServiceInterface $service)
{
$validator = Validation::createValidatorBuilder()->enableAnnotationMapping()->getValidator();
$violations = $validator->validate($service);
/** @var ConstraintViolation $violation */
foreach ($violations as $violation) {
... | php | protected function validate(ApiServiceInterface $service)
{
$validator = Validation::createValidatorBuilder()->enableAnnotationMapping()->getValidator();
$violations = $validator->validate($service);
/** @var ConstraintViolation $violation */
foreach ($violations as $violation) {
... | [
"protected",
"function",
"validate",
"(",
"ApiServiceInterface",
"$",
"service",
")",
"{",
"$",
"validator",
"=",
"Validation",
"::",
"createValidatorBuilder",
"(",
")",
"->",
"enableAnnotationMapping",
"(",
")",
"->",
"getValidator",
"(",
")",
";",
"$",
"violat... | Validate a service data using Symfony validation component
@param ApiServiceInterface $service
@throws InvalidApiDataException | [
"Validate",
"a",
"service",
"data",
"using",
"Symfony",
"validation",
"component"
] | 2572d3dcc32e03914cf710f0229d72e1c09ea65b | https://github.com/rafrsr/generic-api/blob/2572d3dcc32e03914cf710f0229d72e1c09ea65b/src/GenericApi.php#L235-L247 |
197,692 | vpg/titon.utility | src/Titon/Utility/Time.php | Time.factory | public static function factory($time = null, $timezone = null) {
$timezone = static::timezone($timezone);
if ($time instanceof DateTime) {
return $time->setTimezone($timezone);
}
if (is_numeric($time)) {
$time = '@' . $time;
}
$dt = new DateTime... | php | public static function factory($time = null, $timezone = null) {
$timezone = static::timezone($timezone);
if ($time instanceof DateTime) {
return $time->setTimezone($timezone);
}
if (is_numeric($time)) {
$time = '@' . $time;
}
$dt = new DateTime... | [
"public",
"static",
"function",
"factory",
"(",
"$",
"time",
"=",
"null",
",",
"$",
"timezone",
"=",
"null",
")",
"{",
"$",
"timezone",
"=",
"static",
"::",
"timezone",
"(",
"$",
"timezone",
")",
";",
"if",
"(",
"$",
"time",
"instanceof",
"DateTime",
... | Return a DateTime object based on the current time and timezone.
@param string|int $time
@param string $timezone
@return \DateTime | [
"Return",
"a",
"DateTime",
"object",
"based",
"on",
"the",
"current",
"time",
"and",
"timezone",
"."
] | 8a77eb9e7b8baacf41cc25487289779d8319cd3a | https://github.com/vpg/titon.utility/blob/8a77eb9e7b8baacf41cc25487289779d8319cd3a/src/Titon/Utility/Time.php#L49-L64 |
197,693 | vpg/titon.utility | src/Titon/Utility/Time.php | Time.isWithinNext | public static function isWithinNext($time, $span) {
$span = static::factory($span);
$time = static::factory($time);
$now = static::factory();
return ($time <= $span && $time >= $now);
} | php | public static function isWithinNext($time, $span) {
$span = static::factory($span);
$time = static::factory($time);
$now = static::factory();
return ($time <= $span && $time >= $now);
} | [
"public",
"static",
"function",
"isWithinNext",
"(",
"$",
"time",
",",
"$",
"span",
")",
"{",
"$",
"span",
"=",
"static",
"::",
"factory",
"(",
"$",
"span",
")",
";",
"$",
"time",
"=",
"static",
"::",
"factory",
"(",
"$",
"time",
")",
";",
"$",
"... | Returns true if the date passed will be within the next time frame span.
@param string|int $time
@param int $span
@return bool
static | [
"Returns",
"true",
"if",
"the",
"date",
"passed",
"will",
"be",
"within",
"the",
"next",
"time",
"frame",
"span",
"."
] | 8a77eb9e7b8baacf41cc25487289779d8319cd3a | https://github.com/vpg/titon.utility/blob/8a77eb9e7b8baacf41cc25487289779d8319cd3a/src/Titon/Utility/Time.php#L124-L130 |
197,694 | vpg/titon.utility | src/Titon/Utility/Time.php | Time.toUnix | public static function toUnix($time) {
if (!$time) {
return time();
} else if ($time instanceof DateTime) {
return $time->format('U');
}
return is_string($time) ? strtotime($time) : (int) $time;
} | php | public static function toUnix($time) {
if (!$time) {
return time();
} else if ($time instanceof DateTime) {
return $time->format('U');
}
return is_string($time) ? strtotime($time) : (int) $time;
} | [
"public",
"static",
"function",
"toUnix",
"(",
"$",
"time",
")",
"{",
"if",
"(",
"!",
"$",
"time",
")",
"{",
"return",
"time",
"(",
")",
";",
"}",
"else",
"if",
"(",
"$",
"time",
"instanceof",
"DateTime",
")",
"{",
"return",
"$",
"time",
"->",
"f... | Return a unix timestamp. If the time is a string convert it, else cast to int.
@param int|string $time
@return int | [
"Return",
"a",
"unix",
"timestamp",
".",
"If",
"the",
"time",
"is",
"a",
"string",
"convert",
"it",
"else",
"cast",
"to",
"int",
"."
] | 8a77eb9e7b8baacf41cc25487289779d8319cd3a | https://github.com/vpg/titon.utility/blob/8a77eb9e7b8baacf41cc25487289779d8319cd3a/src/Titon/Utility/Time.php#L156-L165 |
197,695 | vpg/titon.utility | src/Titon/Utility/Time.php | Time.wasLastWeek | public static function wasLastWeek($time) {
$start = static::factory('last week 00:00:00');
$end = clone $start;
$end->modify('next week -1 second');
$time = static::factory($time);
return ($time >= $start && $time <= $end);
} | php | public static function wasLastWeek($time) {
$start = static::factory('last week 00:00:00');
$end = clone $start;
$end->modify('next week -1 second');
$time = static::factory($time);
return ($time >= $start && $time <= $end);
} | [
"public",
"static",
"function",
"wasLastWeek",
"(",
"$",
"time",
")",
"{",
"$",
"start",
"=",
"static",
"::",
"factory",
"(",
"'last week 00:00:00'",
")",
";",
"$",
"end",
"=",
"clone",
"$",
"start",
";",
"$",
"end",
"->",
"modify",
"(",
"'next week -1 s... | Returns true if date passed was within last week.
@param string|int $time
@return bool | [
"Returns",
"true",
"if",
"date",
"passed",
"was",
"within",
"last",
"week",
"."
] | 8a77eb9e7b8baacf41cc25487289779d8319cd3a | https://github.com/vpg/titon.utility/blob/8a77eb9e7b8baacf41cc25487289779d8319cd3a/src/Titon/Utility/Time.php#L173-L182 |
197,696 | vpg/titon.utility | src/Titon/Utility/Time.php | Time.wasLastMonth | public static function wasLastMonth($time) {
$start = static::factory('first day of last month 00:00:00');
$end = clone $start;
$end->modify('next month -1 second');
$time = static::factory($time);
return ($time >= $start && $time <= $end);
} | php | public static function wasLastMonth($time) {
$start = static::factory('first day of last month 00:00:00');
$end = clone $start;
$end->modify('next month -1 second');
$time = static::factory($time);
return ($time >= $start && $time <= $end);
} | [
"public",
"static",
"function",
"wasLastMonth",
"(",
"$",
"time",
")",
"{",
"$",
"start",
"=",
"static",
"::",
"factory",
"(",
"'first day of last month 00:00:00'",
")",
";",
"$",
"end",
"=",
"clone",
"$",
"start",
";",
"$",
"end",
"->",
"modify",
"(",
"... | Returns true if date passed was within last month.
@param string|int $time
@return bool | [
"Returns",
"true",
"if",
"date",
"passed",
"was",
"within",
"last",
"month",
"."
] | 8a77eb9e7b8baacf41cc25487289779d8319cd3a | https://github.com/vpg/titon.utility/blob/8a77eb9e7b8baacf41cc25487289779d8319cd3a/src/Titon/Utility/Time.php#L190-L199 |
197,697 | vpg/titon.utility | src/Titon/Utility/Time.php | Time.wasLastYear | public static function wasLastYear($time) {
$start = static::factory('last year January 1st 00:00:00');
$end = clone $start;
$end->modify('next year -1 second');
$time = static::factory($time);
return ($time >= $start && $time <= $end);
} | php | public static function wasLastYear($time) {
$start = static::factory('last year January 1st 00:00:00');
$end = clone $start;
$end->modify('next year -1 second');
$time = static::factory($time);
return ($time >= $start && $time <= $end);
} | [
"public",
"static",
"function",
"wasLastYear",
"(",
"$",
"time",
")",
"{",
"$",
"start",
"=",
"static",
"::",
"factory",
"(",
"'last year January 1st 00:00:00'",
")",
";",
"$",
"end",
"=",
"clone",
"$",
"start",
";",
"$",
"end",
"->",
"modify",
"(",
"'ne... | Returns true if date passed was within last year.
@param string|int $time
@return bool | [
"Returns",
"true",
"if",
"date",
"passed",
"was",
"within",
"last",
"year",
"."
] | 8a77eb9e7b8baacf41cc25487289779d8319cd3a | https://github.com/vpg/titon.utility/blob/8a77eb9e7b8baacf41cc25487289779d8319cd3a/src/Titon/Utility/Time.php#L207-L216 |
197,698 | vpg/titon.utility | src/Titon/Utility/Time.php | Time.wasWithinLast | public static function wasWithinLast($time, $span) {
$span = static::factory($span);
$time = static::factory($time);
$now = static::factory();
return ($time >= $span && $time <= $now);
} | php | public static function wasWithinLast($time, $span) {
$span = static::factory($span);
$time = static::factory($time);
$now = static::factory();
return ($time >= $span && $time <= $now);
} | [
"public",
"static",
"function",
"wasWithinLast",
"(",
"$",
"time",
",",
"$",
"span",
")",
"{",
"$",
"span",
"=",
"static",
"::",
"factory",
"(",
"$",
"span",
")",
";",
"$",
"time",
"=",
"static",
"::",
"factory",
"(",
"$",
"time",
")",
";",
"$",
... | Returns true if the date passed was within the last time frame span.
@param string|int $time
@param int $span
@return bool | [
"Returns",
"true",
"if",
"the",
"date",
"passed",
"was",
"within",
"the",
"last",
"time",
"frame",
"span",
"."
] | 8a77eb9e7b8baacf41cc25487289779d8319cd3a | https://github.com/vpg/titon.utility/blob/8a77eb9e7b8baacf41cc25487289779d8319cd3a/src/Titon/Utility/Time.php#L235-L241 |
197,699 | cloudtek/dynamodm | lib/Cloudtek/DynamoDM/Persister/CollectionPersister.php | CollectionPersister.delete | public function delete(PersistentCollectionInterface $coll)
{
$mapping = $coll->getMapping();
if ($mapping->isInverseSide) {
return; // ignore inverse side
}
if ($mapping->strategy === PropertyMetadata::STORAGE_STRATEGY_ATOMIC_SET) {
throw new \UnexpectedValue... | php | public function delete(PersistentCollectionInterface $coll)
{
$mapping = $coll->getMapping();
if ($mapping->isInverseSide) {
return; // ignore inverse side
}
if ($mapping->strategy === PropertyMetadata::STORAGE_STRATEGY_ATOMIC_SET) {
throw new \UnexpectedValue... | [
"public",
"function",
"delete",
"(",
"PersistentCollectionInterface",
"$",
"coll",
")",
"{",
"$",
"mapping",
"=",
"$",
"coll",
"->",
"getMapping",
"(",
")",
";",
"if",
"(",
"$",
"mapping",
"->",
"isInverseSide",
")",
"{",
"return",
";",
"// ignore inverse si... | Deletes a PersistentCollection instance completely from a document using REMOVE.
@param PersistentCollectionInterface $coll | [
"Deletes",
"a",
"PersistentCollection",
"instance",
"completely",
"from",
"a",
"document",
"using",
"REMOVE",
"."
] | 119d355e2c5cbaef1f867970349b4432f5704fcd | https://github.com/cloudtek/dynamodm/blob/119d355e2c5cbaef1f867970349b4432f5704fcd/lib/Cloudtek/DynamoDM/Persister/CollectionPersister.php#L75-L89 |
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.