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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
192,300 | backbee/backbee-php | Bundle/AbstractBundle.php | AbstractBundle.initBundleExposedActions | private function initBundleExposedActions()
{
if (true === $this->isEnabled()) {
$container = $this->getApplication()->getContainer();
foreach ((array) $this->getProperty('exposed_actions') as $controllerId => $actions) {
if (false === $container->has($controllerId)) ... | php | private function initBundleExposedActions()
{
if (true === $this->isEnabled()) {
$container = $this->getApplication()->getContainer();
foreach ((array) $this->getProperty('exposed_actions') as $controllerId => $actions) {
if (false === $container->has($controllerId)) ... | [
"private",
"function",
"initBundleExposedActions",
"(",
")",
"{",
"if",
"(",
"true",
"===",
"$",
"this",
"->",
"isEnabled",
"(",
")",
")",
"{",
"$",
"container",
"=",
"$",
"this",
"->",
"getApplication",
"(",
")",
"->",
"getContainer",
"(",
")",
";",
"... | Initialize bundle exposed actions by building exposed_actions array and exposed_actions_callback array. | [
"Initialize",
"bundle",
"exposed",
"actions",
"by",
"building",
"exposed_actions",
"array",
"and",
"exposed_actions_callback",
"array",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Bundle/AbstractBundle.php#L410-L425 |
192,301 | backbee/backbee-php | Bundle/AbstractBundle.php | AbstractBundle.formatAndInjectExposedAction | private function formatAndInjectExposedAction($controller, $actions)
{
$controllerId = explode('\\', get_class($controller));
$controllerId = str_replace('controller', '', strtolower(array_pop(($controllerId))));
$this->exposedActions[$controllerId] = array('actions' => array());
if... | php | private function formatAndInjectExposedAction($controller, $actions)
{
$controllerId = explode('\\', get_class($controller));
$controllerId = str_replace('controller', '', strtolower(array_pop(($controllerId))));
$this->exposedActions[$controllerId] = array('actions' => array());
if... | [
"private",
"function",
"formatAndInjectExposedAction",
"(",
"$",
"controller",
",",
"$",
"actions",
")",
"{",
"$",
"controllerId",
"=",
"explode",
"(",
"'\\\\'",
",",
"get_class",
"(",
"$",
"controller",
")",
")",
";",
"$",
"controllerId",
"=",
"str_replace",
... | Format a valid map between controller and actions and hydrate.
@param BundleExposedControllerInterface $controller
@param array $actions | [
"Format",
"a",
"valid",
"map",
"between",
"controller",
"and",
"actions",
"and",
"hydrate",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Bundle/AbstractBundle.php#L433-L455 |
192,302 | backbee/backbee-php | MetaData/MetaData.php | MetaData.setName | public function setName($name)
{
if (!preg_match('/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/', $name)) {
throw new \InvalidArgumentException(sprintf('Invalid name for metadata: `%s`.', $name));
}
$this->name = $name;
return $this;
} | php | public function setName($name)
{
if (!preg_match('/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/', $name)) {
throw new \InvalidArgumentException(sprintf('Invalid name for metadata: `%s`.', $name));
}
$this->name = $name;
return $this;
} | [
"public",
"function",
"setName",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"!",
"preg_match",
"(",
"'/[a-zA-Z_\\x7f-\\xff][a-zA-Z0-9_\\x7f-\\xff]*/'",
",",
"$",
"name",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"sprintf",
"(",
"'Invalid ... | Sets the name of the metadata.
@param string $name
@return MetaData
@throws \InvalidArgumentException Occurs if $name if not a valid string. | [
"Sets",
"the",
"name",
"of",
"the",
"metadata",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/MetaData/MetaData.php#L97-L106 |
192,303 | backbee/backbee-php | MetaData/MetaData.php | MetaData.setAttribute | public function setAttribute($attribute, $value, $scheme = null, $isComputed = false)
{
$this->attributes[$attribute] = $value;
$this->scheme[$attribute] = $scheme;
$this->is_computed[$attribute] = (true === $isComputed);
return $this;
} | php | public function setAttribute($attribute, $value, $scheme = null, $isComputed = false)
{
$this->attributes[$attribute] = $value;
$this->scheme[$attribute] = $scheme;
$this->is_computed[$attribute] = (true === $isComputed);
return $this;
} | [
"public",
"function",
"setAttribute",
"(",
"$",
"attribute",
",",
"$",
"value",
",",
"$",
"scheme",
"=",
"null",
",",
"$",
"isComputed",
"=",
"false",
")",
"{",
"$",
"this",
"->",
"attributes",
"[",
"$",
"attribute",
"]",
"=",
"$",
"value",
";",
"$",... | Sets the value of the attribute.
@param string $attribute
@param string $scheme
@return MetaData | [
"Sets",
"the",
"value",
"of",
"the",
"attribute",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/MetaData/MetaData.php#L142-L149 |
192,304 | backbee/backbee-php | MetaData/MetaData.php | MetaData.isComputed | public function isComputed($attribute)
{
$attr = $this->getAttribute($attribute);
return empty($attr) || $this->is_computed[$attribute];
} | php | public function isComputed($attribute)
{
$attr = $this->getAttribute($attribute);
return empty($attr) || $this->is_computed[$attribute];
} | [
"public",
"function",
"isComputed",
"(",
"$",
"attribute",
")",
"{",
"$",
"attr",
"=",
"$",
"this",
"->",
"getAttribute",
"(",
"$",
"attribute",
")",
";",
"return",
"empty",
"(",
"$",
"attr",
")",
"||",
"$",
"this",
"->",
"is_computed",
"[",
"$",
"at... | Is the attribute is computed?
@param string $attribute
@return boolean | [
"Is",
"the",
"attribute",
"is",
"computed?"
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/MetaData/MetaData.php#L158-L163 |
192,305 | backbee/backbee-php | Rest/Controller/KeywordController.php | KeywordController.postAction | public function postAction(Request $request, $parent = null)
{
try {
$keyWordLabel = trim($request->request->get('keyword'));
$uid = $request->request->get('uid', null);
if (null !== $uid) {
$keywordItem = $this->getKeywordRepository()->find($uid);
... | php | public function postAction(Request $request, $parent = null)
{
try {
$keyWordLabel = trim($request->request->get('keyword'));
$uid = $request->request->get('uid', null);
if (null !== $uid) {
$keywordItem = $this->getKeywordRepository()->find($uid);
... | [
"public",
"function",
"postAction",
"(",
"Request",
"$",
"request",
",",
"$",
"parent",
"=",
"null",
")",
"{",
"try",
"{",
"$",
"keyWordLabel",
"=",
"trim",
"(",
"$",
"request",
"->",
"request",
"->",
"get",
"(",
"'keyword'",
")",
")",
";",
"$",
"uid... | Create a keyword object
and if a parent is provided add the keyword as its last child.
@param KeyWord $keyword
@Rest\RequestParam(name="keyword", description="Keyword value", requirements={
@Assert\NotBlank()
})
@Rest\ParamConverter(
name="parent", id_name="parent_uid", id_source="request", class="BackBee\NestedNode\... | [
"Create",
"a",
"keyword",
"object",
"and",
"if",
"a",
"parent",
"is",
"provided",
"add",
"the",
"keyword",
"as",
"its",
"last",
"child",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Rest/Controller/KeywordController.php#L220-L262 |
192,306 | contao-bootstrap/navbar | src/Module/NavbarModule.php | NavbarModule.compile | protected function compile()
{
$config = StringUtil::deserialize($this->bs_navbarModules, true);
$modules = [];
$models = $this->prefetchModules($config);
foreach ($config as $module) {
$id = $module['module'];
if ($id != '' && !$module['inactive'] && arra... | php | protected function compile()
{
$config = StringUtil::deserialize($this->bs_navbarModules, true);
$modules = [];
$models = $this->prefetchModules($config);
foreach ($config as $module) {
$id = $module['module'];
if ($id != '' && !$module['inactive'] && arra... | [
"protected",
"function",
"compile",
"(",
")",
"{",
"$",
"config",
"=",
"StringUtil",
"::",
"deserialize",
"(",
"$",
"this",
"->",
"bs_navbarModules",
",",
"true",
")",
";",
"$",
"modules",
"=",
"[",
"]",
";",
"$",
"models",
"=",
"$",
"this",
"->",
"p... | Compile the navbar.
@return void | [
"Compile",
"the",
"navbar",
"."
] | 6d6956510a3053dd438a11384f4d237644d4321e | https://github.com/contao-bootstrap/navbar/blob/6d6956510a3053dd438a11384f4d237644d4321e/src/Module/NavbarModule.php#L40-L66 |
192,307 | contao-bootstrap/navbar | src/Module/NavbarModule.php | NavbarModule.extractModuleIds | protected function extractModuleIds($config)
{
$ids = [];
foreach ($config as $index => $module) {
if ($module['inactive']) {
continue;
}
$ids[$index] = intval($module['module']);
}
return $ids;
} | php | protected function extractModuleIds($config)
{
$ids = [];
foreach ($config as $index => $module) {
if ($module['inactive']) {
continue;
}
$ids[$index] = intval($module['module']);
}
return $ids;
} | [
"protected",
"function",
"extractModuleIds",
"(",
"$",
"config",
")",
"{",
"$",
"ids",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"config",
"as",
"$",
"index",
"=>",
"$",
"module",
")",
"{",
"if",
"(",
"$",
"module",
"[",
"'inactive'",
"]",
")",
"{",... | Extract module ids from navbar config.
@param array $config The navbar config.
@return array | [
"Extract",
"module",
"ids",
"from",
"navbar",
"config",
"."
] | 6d6956510a3053dd438a11384f4d237644d4321e | https://github.com/contao-bootstrap/navbar/blob/6d6956510a3053dd438a11384f4d237644d4321e/src/Module/NavbarModule.php#L95-L107 |
192,308 | contao-bootstrap/navbar | src/Module/NavbarModule.php | NavbarModule.prefetchModules | protected function prefetchModules($config)
{
$ids = $this->extractModuleIds($config);
$models = [];
if ($ids) {
// prefetch modules, so only 1 query is required
$ids = implode(',', $ids);
$collection = ModuleModel::findBy(['tl_module.id IN(' . ... | php | protected function prefetchModules($config)
{
$ids = $this->extractModuleIds($config);
$models = [];
if ($ids) {
// prefetch modules, so only 1 query is required
$ids = implode(',', $ids);
$collection = ModuleModel::findBy(['tl_module.id IN(' . ... | [
"protected",
"function",
"prefetchModules",
"(",
"$",
"config",
")",
"{",
"$",
"ids",
"=",
"$",
"this",
"->",
"extractModuleIds",
"(",
"$",
"config",
")",
";",
"$",
"models",
"=",
"[",
"]",
";",
"if",
"(",
"$",
"ids",
")",
"{",
"// prefetch modules, so... | Prefetch modules.
@param array $config Navbar config.
@return array | [
"Prefetch",
"modules",
"."
] | 6d6956510a3053dd438a11384f4d237644d4321e | https://github.com/contao-bootstrap/navbar/blob/6d6956510a3053dd438a11384f4d237644d4321e/src/Module/NavbarModule.php#L116-L136 |
192,309 | backbee/backbee-php | Bundle/BundleControllerResolver.php | BundleControllerResolver.resolveBaseAdminUrl | public function resolveBaseAdminUrl($bundleId, $controllerId, $actionId)
{
return str_replace(
[
'%bundle_id%',
'%controller_id%',
'%action_id%',
],
[
$bundleId,
$controllerId,
... | php | public function resolveBaseAdminUrl($bundleId, $controllerId, $actionId)
{
return str_replace(
[
'%bundle_id%',
'%controller_id%',
'%action_id%',
],
[
$bundleId,
$controllerId,
... | [
"public",
"function",
"resolveBaseAdminUrl",
"(",
"$",
"bundleId",
",",
"$",
"controllerId",
",",
"$",
"actionId",
")",
"{",
"return",
"str_replace",
"(",
"[",
"'%bundle_id%'",
",",
"'%controller_id%'",
",",
"'%action_id%'",
",",
"]",
",",
"[",
"$",
"bundleId"... | Compute the minimal Admin Base Url
@param String $bundleId Bundle identifier used to declare it into bundle.yml
@param String $controllerId Controller identifier used to declare it inte your bundle configuration
@param String $actionId Action identifier refere to a method name like "indexAction" into the co... | [
"Compute",
"the",
"minimal",
"Admin",
"Base",
"Url"
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Bundle/BundleControllerResolver.php#L101-L116 |
192,310 | backbee/backbee-php | Security/SecurityContext.php | SecurityContext.getAuthProvider | public function getAuthProvider($key)
{
if (array_key_exists($key, $this->authproviders)) {
return $this->authproviders[$key];
}
throw \InvalidArgumentException(sprintf("Auth provider doesn't exists", $key));
} | php | public function getAuthProvider($key)
{
if (array_key_exists($key, $this->authproviders)) {
return $this->authproviders[$key];
}
throw \InvalidArgumentException(sprintf("Auth provider doesn't exists", $key));
} | [
"public",
"function",
"getAuthProvider",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"array_key_exists",
"(",
"$",
"key",
",",
"$",
"this",
"->",
"authproviders",
")",
")",
"{",
"return",
"$",
"this",
"->",
"authproviders",
"[",
"$",
"key",
"]",
";",
"}",
... | Get auth provider.
@param string $key
@return AuthenticationProviderInterface
@throws InvalidArgumentException if provider not found | [
"Get",
"auth",
"provider",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Security/SecurityContext.php#L256-L263 |
192,311 | backbee/backbee-php | Security/SecurityContext.php | SecurityContext.createEncoderFactory | private function createEncoderFactory(array $config)
{
if (true === array_key_exists('encoders', $config)) {
$this->_encoderfactory = new EncoderFactory($config['encoders']);
}
return $this;
} | php | private function createEncoderFactory(array $config)
{
if (true === array_key_exists('encoders', $config)) {
$this->_encoderfactory = new EncoderFactory($config['encoders']);
}
return $this;
} | [
"private",
"function",
"createEncoderFactory",
"(",
"array",
"$",
"config",
")",
"{",
"if",
"(",
"true",
"===",
"array_key_exists",
"(",
"'encoders'",
",",
"$",
"config",
")",
")",
"{",
"$",
"this",
"->",
"_encoderfactory",
"=",
"new",
"EncoderFactory",
"(",... | Create an encoders factory if need.
@param array $config
@return \BackBee\Security\SecurityContext | [
"Create",
"an",
"encoders",
"factory",
"if",
"need",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Security/SecurityContext.php#L386-L393 |
192,312 | backbee/backbee-php | Bundle/Registry/Repository.php | Repository.save | public function save(\BackBee\Bundle\Registry $registry)
{
if (false === $this->getEntityManager()->contains($registry)) {
$this->getEntityManager()->persist($registry);
}
$this->getEntityManager()->flush($registry);
return $registry;
} | php | public function save(\BackBee\Bundle\Registry $registry)
{
if (false === $this->getEntityManager()->contains($registry)) {
$this->getEntityManager()->persist($registry);
}
$this->getEntityManager()->flush($registry);
return $registry;
} | [
"public",
"function",
"save",
"(",
"\\",
"BackBee",
"\\",
"Bundle",
"\\",
"Registry",
"$",
"registry",
")",
"{",
"if",
"(",
"false",
"===",
"$",
"this",
"->",
"getEntityManager",
"(",
")",
"->",
"contains",
"(",
"$",
"registry",
")",
")",
"{",
"$",
"... | Saves the registry entry in DB, persist it if need.
@param \BackBee\Bundle\Registry $registry
@return \BackBee\Bundle\Registry | [
"Saves",
"the",
"registry",
"entry",
"in",
"DB",
"persist",
"it",
"if",
"need",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Bundle/Registry/Repository.php#L47-L56 |
192,313 | backbee/backbee-php | Controller/MediaController.php | MediaController.mediaAction | public function mediaAction($type, $filename, $includePath = array())
{
$includePath = array_merge(
$includePath,
array($this->application->getStorageDir(), $this->application->getMediaDir())
);
if (null !== $this->application->getBBUserToken()) {
$includ... | php | public function mediaAction($type, $filename, $includePath = array())
{
$includePath = array_merge(
$includePath,
array($this->application->getStorageDir(), $this->application->getMediaDir())
);
if (null !== $this->application->getBBUserToken()) {
$includ... | [
"public",
"function",
"mediaAction",
"(",
"$",
"type",
",",
"$",
"filename",
",",
"$",
"includePath",
"=",
"array",
"(",
")",
")",
"{",
"$",
"includePath",
"=",
"array_merge",
"(",
"$",
"includePath",
",",
"array",
"(",
"$",
"this",
"->",
"application",
... | Handles a media file request.
@param string $filename The media file to provide
@throws FrontControllerException
@return Response | [
"Handles",
"a",
"media",
"file",
"request",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Controller/MediaController.php#L68-L101 |
192,314 | backbee/backbee-php | Console/Command/UpgradeToPageSectionCommand.php | UpgradeToPageSectionCommand.checksSectionTable | private function checksSectionTable()
{
$schemaManager = $this->em->getConnection()->getSchemaManager();
$tableName = $this->em->getClassMetadata('BackBee\NestedNode\Section')->getTableName();
$this->output->write(sprintf(' - New table `%s` - ', $tableName));
if (true === $this->ov... | php | private function checksSectionTable()
{
$schemaManager = $this->em->getConnection()->getSchemaManager();
$tableName = $this->em->getClassMetadata('BackBee\NestedNode\Section')->getTableName();
$this->output->write(sprintf(' - New table `%s` - ', $tableName));
if (true === $this->ov... | [
"private",
"function",
"checksSectionTable",
"(",
")",
"{",
"$",
"schemaManager",
"=",
"$",
"this",
"->",
"em",
"->",
"getConnection",
"(",
")",
"->",
"getSchemaManager",
"(",
")",
";",
"$",
"tableName",
"=",
"$",
"this",
"->",
"em",
"->",
"getClassMetadat... | Checks for existing table `section`, throw exception if overrideExisting is set to FALSE
@return \BackBee\Console\Command\UpgradeToPageSectionCommand
@throws BBException Raises if table `section` already exists | [
"Checks",
"for",
"existing",
"table",
"section",
"throw",
"exception",
"if",
"overrideExisting",
"is",
"set",
"to",
"FALSE"
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Console/Command/UpgradeToPageSectionCommand.php#L157-L176 |
192,315 | backbee/backbee-php | Console/Command/UpgradeToPageSectionCommand.php | UpgradeToPageSectionCommand.checksPageTable | private function checksPageTable()
{
$schemaManager = $this->em->getConnection()->getSchemaManager();
$tableName = $this->em->getClassMetadata('BackBee\NestedNode\Page')->getTableName();
$this->output->write(sprintf(' - Existing table `%s` - ', $tableName));
if (false === $schemaMa... | php | private function checksPageTable()
{
$schemaManager = $this->em->getConnection()->getSchemaManager();
$tableName = $this->em->getClassMetadata('BackBee\NestedNode\Page')->getTableName();
$this->output->write(sprintf(' - Existing table `%s` - ', $tableName));
if (false === $schemaMa... | [
"private",
"function",
"checksPageTable",
"(",
")",
"{",
"$",
"schemaManager",
"=",
"$",
"this",
"->",
"em",
"->",
"getConnection",
"(",
")",
"->",
"getSchemaManager",
"(",
")",
";",
"$",
"tableName",
"=",
"$",
"this",
"->",
"em",
"->",
"getClassMetadata",... | Checks for required fields in table `page`
@return \BackBee\Console\Command\UpgradeToPageSectionCommand
@throws BBException Raises if table `page` doesn't exists or is incomplete | [
"Checks",
"for",
"required",
"fields",
"in",
"table",
"page"
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Console/Command/UpgradeToPageSectionCommand.php#L184-L232 |
192,316 | backbee/backbee-php | Console/Command/UpgradeToPageSectionCommand.php | UpgradeToPageSectionCommand.updateNodes | private function updateNodes($classname)
{
$this->output->writeln(sprintf('<info>Updating nested data for %s.</info>', $classname));
if (true === $this->skipNodesUpdate) {
$this->output->writeln(' - <comment>Skipped</comment> (option --skip-nodes-update set)');
return $this;... | php | private function updateNodes($classname)
{
$this->output->writeln(sprintf('<info>Updating nested data for %s.</info>', $classname));
if (true === $this->skipNodesUpdate) {
$this->output->writeln(' - <comment>Skipped</comment> (option --skip-nodes-update set)');
return $this;... | [
"private",
"function",
"updateNodes",
"(",
"$",
"classname",
")",
"{",
"$",
"this",
"->",
"output",
"->",
"writeln",
"(",
"sprintf",
"(",
"'<info>Updating nested data for %s.</info>'",
",",
"$",
"classname",
")",
")",
";",
"if",
"(",
"true",
"===",
"$",
"thi... | Updates nested data from existing pages
@param string $classname
@return \BackBee\Console\Command\UpgradeToPageSectionCommand | [
"Updates",
"nested",
"data",
"from",
"existing",
"pages"
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Console/Command/UpgradeToPageSectionCommand.php#L241-L270 |
192,317 | backbee/backbee-php | Console/Command/UpgradeToPageSectionCommand.php | UpgradeToPageSectionCommand.countNodes | private function countNodes($classname)
{
$query = sprintf(
'SELECT COUNT(%s) FROM %s',
$this->requiredFields['uid'],
$this->em->getClassMetadata($classname)->getTableName()
);
$count = $this->em->getConnection()
->ex... | php | private function countNodes($classname)
{
$query = sprintf(
'SELECT COUNT(%s) FROM %s',
$this->requiredFields['uid'],
$this->em->getClassMetadata($classname)->getTableName()
);
$count = $this->em->getConnection()
->ex... | [
"private",
"function",
"countNodes",
"(",
"$",
"classname",
")",
"{",
"$",
"query",
"=",
"sprintf",
"(",
"'SELECT COUNT(%s) FROM %s'",
",",
"$",
"this",
"->",
"requiredFields",
"[",
"'uid'",
"]",
",",
"$",
"this",
"->",
"em",
"->",
"getClassMetadata",
"(",
... | Returns the number of nested nodes
@param string $classname
@return int | [
"Returns",
"the",
"number",
"of",
"nested",
"nodes"
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Console/Command/UpgradeToPageSectionCommand.php#L382-L395 |
192,318 | backbee/backbee-php | Console/Command/UpgradeToPageSectionCommand.php | UpgradeToPageSectionCommand.updateTreeNatively | private function updateTreeNatively($nodeUid, $classname, $leftnode = 1, $level = 0)
{
$node = new \StdClass();
$node->uid = $nodeUid;
$node->leftnode = $leftnode;
$node->rightnode = $leftnode + 1;
$node->level = $level;
$start = 0;
$numChildren = $this->getC... | php | private function updateTreeNatively($nodeUid, $classname, $leftnode = 1, $level = 0)
{
$node = new \StdClass();
$node->uid = $nodeUid;
$node->leftnode = $leftnode;
$node->rightnode = $leftnode + 1;
$node->level = $level;
$start = 0;
$numChildren = $this->getC... | [
"private",
"function",
"updateTreeNatively",
"(",
"$",
"nodeUid",
",",
"$",
"classname",
",",
"$",
"leftnode",
"=",
"1",
",",
"$",
"level",
"=",
"0",
")",
"{",
"$",
"node",
"=",
"new",
"\\",
"StdClass",
"(",
")",
";",
"$",
"node",
"->",
"uid",
"=",... | Updates nodes information of a tree
@param string $nodeUid The starting point in the tree
@param string $classname
@param int $leftnode Optional, the first value of left node
@param int $level Optional, the first value of level
@return \StdClass | [
"Updates",
"nodes",
"information",
"of",
"a",
"tree"
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Console/Command/UpgradeToPageSectionCommand.php#L430-L454 |
192,319 | backbee/backbee-php | Security/Acl/Domain/SecurityIdentityRetrievalStrategy.php | SecurityIdentityRetrievalStrategy.getSecurityIdentities | public function getSecurityIdentities(TokenInterface $token)
{
$sids = parent::getSecurityIdentities($token);
if ($token->getUser() instanceof \BackBee\Security\User) {
foreach ($token->getUser()->getGroups() as $group) {
$securityIdentity = new UserSecurityIdentity($gro... | php | public function getSecurityIdentities(TokenInterface $token)
{
$sids = parent::getSecurityIdentities($token);
if ($token->getUser() instanceof \BackBee\Security\User) {
foreach ($token->getUser()->getGroups() as $group) {
$securityIdentity = new UserSecurityIdentity($gro... | [
"public",
"function",
"getSecurityIdentities",
"(",
"TokenInterface",
"$",
"token",
")",
"{",
"$",
"sids",
"=",
"parent",
"::",
"getSecurityIdentities",
"(",
"$",
"token",
")",
";",
"if",
"(",
"$",
"token",
"->",
"getUser",
"(",
")",
"instanceof",
"\\",
"B... | Retrieves the available security identities for the given token.
@param \Symfony\Component\Security\Core\Authentication\Token\TokenInterface $token
@return array An array of SecurityIdentityInterface implementations | [
"Retrieves",
"the",
"available",
"security",
"identities",
"for",
"the",
"given",
"token",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Security/Acl/Domain/SecurityIdentityRetrievalStrategy.php#L48-L60 |
192,320 | backbee/backbee-php | Security/Authentication/Provider/UserAuthenticationProvider.php | UserAuthenticationProvider.authenticate | public function authenticate(TokenInterface $token)
{
if (!$this->supports($token)) {
return;
}
$username = $token->getUsername();
if (empty($username)) {
$username = 'NONE_PROVIDED';
}
$user = $this->_userProvider->loadUserByUsername($userna... | php | public function authenticate(TokenInterface $token)
{
if (!$this->supports($token)) {
return;
}
$username = $token->getUsername();
if (empty($username)) {
$username = 'NONE_PROVIDED';
}
$user = $this->_userProvider->loadUserByUsername($userna... | [
"public",
"function",
"authenticate",
"(",
"TokenInterface",
"$",
"token",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"supports",
"(",
"$",
"token",
")",
")",
"{",
"return",
";",
"}",
"$",
"username",
"=",
"$",
"token",
"->",
"getUsername",
"(",
")... | Authenticate a token according to the user provider.
@param \Symfony\Component\Security\Core\Authentication\Token\TokenInterface $token
@return \Symfony\Component\Security\Core\User\UserProviderInterface
@throws SecurityException Occures on invalid connection | [
"Authenticate",
"a",
"token",
"according",
"to",
"the",
"user",
"provider",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Security/Authentication/Provider/UserAuthenticationProvider.php#L81-L111 |
192,321 | backbee/backbee-php | Security/Authentication/Provider/UserAuthenticationProvider.php | UserAuthenticationProvider.authenticateUser | private function authenticateUser(TokenInterface $token, UserInterface $user)
{
if (null === $this->_encoderFactory) {
return $this->authenticateWithoutEncoder($token, $user);
} else {
return $this->authenticateWithEncoder($token, $user);
}
} | php | private function authenticateUser(TokenInterface $token, UserInterface $user)
{
if (null === $this->_encoderFactory) {
return $this->authenticateWithoutEncoder($token, $user);
} else {
return $this->authenticateWithEncoder($token, $user);
}
} | [
"private",
"function",
"authenticateUser",
"(",
"TokenInterface",
"$",
"token",
",",
"UserInterface",
"$",
"user",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"_encoderFactory",
")",
"{",
"return",
"$",
"this",
"->",
"authenticateWithoutEncoder",
"(... | Authenticate a token accoridng to the user provided.
@param \Symfony\Component\Security\Core\Authentication\Token\TokenInterface $token
@param \Symfony\Component\Security\Core\User\UserInterface $user
@return boolean|\BackBee\Security\Token\UsernamePasswordToken | [
"Authenticate",
"a",
"token",
"accoridng",
"to",
"the",
"user",
"provided",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Security/Authentication/Provider/UserAuthenticationProvider.php#L133-L140 |
192,322 | backbee/backbee-php | Security/Authentication/Provider/UserAuthenticationProvider.php | UserAuthenticationProvider.authenticateWithEncoder | private function authenticateWithEncoder(TokenInterface $token, UserInterface $user)
{
try {
$classname = \Symfony\Component\Security\Core\Util\ClassUtils::getRealClass($user);
if (true === $this->_encoderFactory
->getEncoder($classname)
->isPa... | php | private function authenticateWithEncoder(TokenInterface $token, UserInterface $user)
{
try {
$classname = \Symfony\Component\Security\Core\Util\ClassUtils::getRealClass($user);
if (true === $this->_encoderFactory
->getEncoder($classname)
->isPa... | [
"private",
"function",
"authenticateWithEncoder",
"(",
"TokenInterface",
"$",
"token",
",",
"UserInterface",
"$",
"user",
")",
"{",
"try",
"{",
"$",
"classname",
"=",
"\\",
"Symfony",
"\\",
"Component",
"\\",
"Security",
"\\",
"Core",
"\\",
"Util",
"\\",
"Cl... | Authenticate a token according to the user provided with password encoder.
@param \Symfony\Component\Security\Core\Authentication\Token\TokenInterface $token
@param \Symfony\Component\Security\Core\User\UserInterface $user
@return boolean|\BackBee\Security\Token\UsernamePasswordToken | [
"Authenticate",
"a",
"token",
"according",
"to",
"the",
"user",
"provided",
"with",
"password",
"encoder",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Security/Authentication/Provider/UserAuthenticationProvider.php#L150-L162 |
192,323 | backbee/backbee-php | Security/Authentication/Provider/UserAuthenticationProvider.php | UserAuthenticationProvider.authenticateWithoutEncoder | private function authenticateWithoutEncoder(TokenInterface $token, UserInterface $user)
{
if (null !== $user->getSalt() &&
call_user_func($user->getSalt(), $token->getCredentials()) === $user->getPassword()) {
return new UsernamePasswordToken($user, $user->getPassword(), $user->g... | php | private function authenticateWithoutEncoder(TokenInterface $token, UserInterface $user)
{
if (null !== $user->getSalt() &&
call_user_func($user->getSalt(), $token->getCredentials()) === $user->getPassword()) {
return new UsernamePasswordToken($user, $user->getPassword(), $user->g... | [
"private",
"function",
"authenticateWithoutEncoder",
"(",
"TokenInterface",
"$",
"token",
",",
"UserInterface",
"$",
"user",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"user",
"->",
"getSalt",
"(",
")",
"&&",
"call_user_func",
"(",
"$",
"user",
"->",
"getSalt"... | Authenticate a token according to the user provided without any password encoders.
@param \Symfony\Component\Security\Core\Authentication\Token\TokenInterface $token
@param \Symfony\Component\Security\Core\User\UserInterface $user
@return boolean|\BackBee\Security\Token\UsernamePasswordToken | [
"Authenticate",
"a",
"token",
"according",
"to",
"the",
"user",
"provided",
"without",
"any",
"password",
"encoders",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Security/Authentication/Provider/UserAuthenticationProvider.php#L172-L182 |
192,324 | backbee/backbee-php | DependencyInjection/Container.php | Container.getContainerValues | public function getContainerValues(&$item)
{
if (false === is_object($item) && false === is_array($item)) {
$item = $this->getContainerServices($this->getContainerParameters($item));
}
return $item;
} | php | public function getContainerValues(&$item)
{
if (false === is_object($item) && false === is_array($item)) {
$item = $this->getContainerServices($this->getContainerParameters($item));
}
return $item;
} | [
"public",
"function",
"getContainerValues",
"(",
"&",
"$",
"item",
")",
"{",
"if",
"(",
"false",
"===",
"is_object",
"(",
"$",
"item",
")",
"&&",
"false",
"===",
"is_array",
"(",
"$",
"item",
")",
")",
"{",
"$",
"item",
"=",
"$",
"this",
"->",
"get... | Giving a string, try to return the container service or parameter if exists
This method can be call by array_walk or array_walk_recursive.
@param mixed $item
@return mixed | [
"Giving",
"a",
"string",
"try",
"to",
"return",
"the",
"container",
"service",
"or",
"parameter",
"if",
"exists",
"This",
"method",
"can",
"be",
"call",
"by",
"array_walk",
"or",
"array_walk_recursive",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/DependencyInjection/Container.php#L91-L98 |
192,325 | backbee/backbee-php | DependencyInjection/Container.php | Container.getContainerParameters | private function getContainerParameters($item)
{
$matches = array();
if (preg_match('/^%([^%]+)%$/', $item, $matches)) {
if ($this->hasParameter($matches[1])) {
return $this->getParameter($matches[1]);
}
}
if (preg_match_all('/%([^%]+)%/', $it... | php | private function getContainerParameters($item)
{
$matches = array();
if (preg_match('/^%([^%]+)%$/', $item, $matches)) {
if ($this->hasParameter($matches[1])) {
return $this->getParameter($matches[1]);
}
}
if (preg_match_all('/%([^%]+)%/', $it... | [
"private",
"function",
"getContainerParameters",
"(",
"$",
"item",
")",
"{",
"$",
"matches",
"=",
"array",
"(",
")",
";",
"if",
"(",
"preg_match",
"(",
"'/^%([^%]+)%$/'",
",",
"$",
"item",
",",
"$",
"matches",
")",
")",
"{",
"if",
"(",
"$",
"this",
"... | Replaces known container parameters key by their values.
@param string $item
@return string | [
"Replaces",
"known",
"container",
"parameters",
"key",
"by",
"their",
"values",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/DependencyInjection/Container.php#L107-L125 |
192,326 | backbee/backbee-php | DependencyInjection/Container.php | Container.getContainerServices | private function getContainerServices($item)
{
if (false === is_string($item)) {
return $item;
}
$matches = array();
if (preg_match('/^@([a-z0-9.-]+)$/i', trim($item), $matches)) {
if ($this->has($matches[1])) {
return $this->get($matches[1]);... | php | private function getContainerServices($item)
{
if (false === is_string($item)) {
return $item;
}
$matches = array();
if (preg_match('/^@([a-z0-9.-]+)$/i', trim($item), $matches)) {
if ($this->has($matches[1])) {
return $this->get($matches[1]);... | [
"private",
"function",
"getContainerServices",
"(",
"$",
"item",
")",
"{",
"if",
"(",
"false",
"===",
"is_string",
"(",
"$",
"item",
")",
")",
"{",
"return",
"$",
"item",
";",
"}",
"$",
"matches",
"=",
"array",
"(",
")",
";",
"if",
"(",
"preg_match",... | Returns the associated service to item if exists, item itself otherwise.
@param string $item
@return mixed | [
"Returns",
"the",
"associated",
"service",
"to",
"item",
"if",
"exists",
"item",
"itself",
"otherwise",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/DependencyInjection/Container.php#L134-L148 |
192,327 | backbee/backbee-php | DependencyInjection/Container.php | Container.isLoaded | public function isLoaded($id)
{
$id = strtolower($id);
return $this->hasInstanceOf($id)
|| method_exists($this, 'get'.strtr($id, array('_' => '', '.' => '_')).'Service')
;
} | php | public function isLoaded($id)
{
$id = strtolower($id);
return $this->hasInstanceOf($id)
|| method_exists($this, 'get'.strtr($id, array('_' => '', '.' => '_')).'Service')
;
} | [
"public",
"function",
"isLoaded",
"(",
"$",
"id",
")",
"{",
"$",
"id",
"=",
"strtolower",
"(",
"$",
"id",
")",
";",
"return",
"$",
"this",
"->",
"hasInstanceOf",
"(",
"$",
"id",
")",
"||",
"method_exists",
"(",
"$",
"this",
",",
"'get'",
".",
"strt... | Returns true if the given service is loaded.
@param string $id The service identifier
@return Boolean true if the service is loaded, false otherwise | [
"Returns",
"true",
"if",
"the",
"given",
"service",
"is",
"loaded",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/DependencyInjection/Container.php#L157-L164 |
192,328 | gossi/swagger | src/collections/Definitions.php | Definitions.get | public function get($name) {
if (!$this->definitions->has($name)) {
$this->definitions->set($name, new Schema());
}
return $this->definitions->get($name);
} | php | public function get($name) {
if (!$this->definitions->has($name)) {
$this->definitions->set($name, new Schema());
}
return $this->definitions->get($name);
} | [
"public",
"function",
"get",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"definitions",
"->",
"has",
"(",
"$",
"name",
")",
")",
"{",
"$",
"this",
"->",
"definitions",
"->",
"set",
"(",
"$",
"name",
",",
"new",
"Schema",
"(",
... | Returns the schema for the given field
@param string $name
@return Schema | [
"Returns",
"the",
"schema",
"for",
"the",
"given",
"field"
] | 557dd831cb7cd7a6e3965b2027dac05c4d56c38e | https://github.com/gossi/swagger/blob/557dd831cb7cd7a6e3965b2027dac05c4d56c38e/src/collections/Definitions.php#L42-L47 |
192,329 | gossi/swagger | src/collections/Definitions.php | Definitions.setAll | public function setAll(Definitions $definitions) {
foreach ($definitions as $name => $schema) {
$this->set($name, $schema);
}
} | php | public function setAll(Definitions $definitions) {
foreach ($definitions as $name => $schema) {
$this->set($name, $schema);
}
} | [
"public",
"function",
"setAll",
"(",
"Definitions",
"$",
"definitions",
")",
"{",
"foreach",
"(",
"$",
"definitions",
"as",
"$",
"name",
"=>",
"$",
"schema",
")",
"{",
"$",
"this",
"->",
"set",
"(",
"$",
"name",
",",
"$",
"schema",
")",
";",
"}",
"... | Sets all definitions from another definitions collection. Will overwrite existing ones.
@param Definitions $definitions | [
"Sets",
"all",
"definitions",
"from",
"another",
"definitions",
"collection",
".",
"Will",
"overwrite",
"existing",
"ones",
"."
] | 557dd831cb7cd7a6e3965b2027dac05c4d56c38e | https://github.com/gossi/swagger/blob/557dd831cb7cd7a6e3965b2027dac05c4d56c38e/src/collections/Definitions.php#L64-L68 |
192,330 | gossi/swagger | src/collections/Responses.php | Responses.get | public function get($code) {
if (!$this->responses->has($code)) {
$this->responses->set($code, new Response($code));
}
return $this->responses->get($code);
} | php | public function get($code) {
if (!$this->responses->has($code)) {
$this->responses->set($code, new Response($code));
}
return $this->responses->get($code);
} | [
"public",
"function",
"get",
"(",
"$",
"code",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"responses",
"->",
"has",
"(",
"$",
"code",
")",
")",
"{",
"$",
"this",
"->",
"responses",
"->",
"set",
"(",
"$",
"code",
",",
"new",
"Response",
"(",
"... | Returns the reponse info for the given code
@param string $code
@return Response | [
"Returns",
"the",
"reponse",
"info",
"for",
"the",
"given",
"code"
] | 557dd831cb7cd7a6e3965b2027dac05c4d56c38e | https://github.com/gossi/swagger/blob/557dd831cb7cd7a6e3965b2027dac05c4d56c38e/src/collections/Responses.php#L75-L81 |
192,331 | FriendsOfSymfony/FOSMessage | src/Sender.php | Sender.createAndPersistConversation | private function createAndPersistConversation($subject)
{
$conversation = $this->driver->createConversationModel();
$conversation->setSubject($subject);
$this->driver->persistConversation($conversation);
return $conversation;
} | php | private function createAndPersistConversation($subject)
{
$conversation = $this->driver->createConversationModel();
$conversation->setSubject($subject);
$this->driver->persistConversation($conversation);
return $conversation;
} | [
"private",
"function",
"createAndPersistConversation",
"(",
"$",
"subject",
")",
"{",
"$",
"conversation",
"=",
"$",
"this",
"->",
"driver",
"->",
"createConversationModel",
"(",
")",
";",
"$",
"conversation",
"->",
"setSubject",
"(",
"$",
"subject",
")",
";",... | Create and persist a conversation object.
@param string $subject
@return ConversationInterface | [
"Create",
"and",
"persist",
"a",
"conversation",
"object",
"."
] | fec9ad9069582e62f26927d41de96f0e8b2c1669 | https://github.com/FriendsOfSymfony/FOSMessage/blob/fec9ad9069582e62f26927d41de96f0e8b2c1669/src/Sender.php#L154-L162 |
192,332 | FriendsOfSymfony/FOSMessage | src/Sender.php | Sender.createAndPersistConversationPerson | private function createAndPersistConversationPerson(ConversationInterface $conversation, PersonInterface $person)
{
$conversationPerson = $this->driver->createConversationPersonModel($conversation, $person);
$this->driver->persistConversationPerson($conversationPerson);
return $conversatio... | php | private function createAndPersistConversationPerson(ConversationInterface $conversation, PersonInterface $person)
{
$conversationPerson = $this->driver->createConversationPersonModel($conversation, $person);
$this->driver->persistConversationPerson($conversationPerson);
return $conversatio... | [
"private",
"function",
"createAndPersistConversationPerson",
"(",
"ConversationInterface",
"$",
"conversation",
",",
"PersonInterface",
"$",
"person",
")",
"{",
"$",
"conversationPerson",
"=",
"$",
"this",
"->",
"driver",
"->",
"createConversationPersonModel",
"(",
"$",... | Create and persist a conversation person object.
@param ConversationInterface $conversation
@param PersonInterface $person
@return ConversationPersonInterface | [
"Create",
"and",
"persist",
"a",
"conversation",
"person",
"object",
"."
] | fec9ad9069582e62f26927d41de96f0e8b2c1669 | https://github.com/FriendsOfSymfony/FOSMessage/blob/fec9ad9069582e62f26927d41de96f0e8b2c1669/src/Sender.php#L172-L179 |
192,333 | FriendsOfSymfony/FOSMessage | src/Sender.php | Sender.createAndPersistMessage | private function createAndPersistMessage(ConversationInterface $conversation, PersonInterface $sender, $body)
{
$message = $this->driver->createMessageModel($conversation, $sender, $body);
$this->driver->persistMessage($message);
return $message;
} | php | private function createAndPersistMessage(ConversationInterface $conversation, PersonInterface $sender, $body)
{
$message = $this->driver->createMessageModel($conversation, $sender, $body);
$this->driver->persistMessage($message);
return $message;
} | [
"private",
"function",
"createAndPersistMessage",
"(",
"ConversationInterface",
"$",
"conversation",
",",
"PersonInterface",
"$",
"sender",
",",
"$",
"body",
")",
"{",
"$",
"message",
"=",
"$",
"this",
"->",
"driver",
"->",
"createMessageModel",
"(",
"$",
"conve... | Create and persist a message object.
@param ConversationInterface $conversation
@param PersonInterface $sender
@param string $body
@return MessageInterface | [
"Create",
"and",
"persist",
"a",
"message",
"object",
"."
] | fec9ad9069582e62f26927d41de96f0e8b2c1669 | https://github.com/FriendsOfSymfony/FOSMessage/blob/fec9ad9069582e62f26927d41de96f0e8b2c1669/src/Sender.php#L190-L197 |
192,334 | FriendsOfSymfony/FOSMessage | src/Sender.php | Sender.createAndPersistMessagePerson | private function createAndPersistMessagePerson(MessageInterface $message, PersonInterface $person, $setRead)
{
$messagePerson = $this->driver->createMessagePersonModel($message, $person);
if ($setRead) {
$messagePerson->setRead();
}
$this->driver->persistMessagePerson($... | php | private function createAndPersistMessagePerson(MessageInterface $message, PersonInterface $person, $setRead)
{
$messagePerson = $this->driver->createMessagePersonModel($message, $person);
if ($setRead) {
$messagePerson->setRead();
}
$this->driver->persistMessagePerson($... | [
"private",
"function",
"createAndPersistMessagePerson",
"(",
"MessageInterface",
"$",
"message",
",",
"PersonInterface",
"$",
"person",
",",
"$",
"setRead",
")",
"{",
"$",
"messagePerson",
"=",
"$",
"this",
"->",
"driver",
"->",
"createMessagePersonModel",
"(",
"$... | Create and persist a message person object.
@param MessageInterface $message
@param PersonInterface $person
@param bool $setRead
@return ConversationPersonInterface | [
"Create",
"and",
"persist",
"a",
"message",
"person",
"object",
"."
] | fec9ad9069582e62f26927d41de96f0e8b2c1669 | https://github.com/FriendsOfSymfony/FOSMessage/blob/fec9ad9069582e62f26927d41de96f0e8b2c1669/src/Sender.php#L208-L219 |
192,335 | deesoft/yii2-console | MigrateTrait.php | MigrateTrait.getMigrationFiles | protected function getMigrationFiles()
{
if ($this->_migrationFiles === null) {
$this->_migrationFiles = [];
$directories = $this->getDirectories();
foreach ($directories as $namespace => $dir) {
if ($dir && is_dir($dir)) {
$handle = o... | php | protected function getMigrationFiles()
{
if ($this->_migrationFiles === null) {
$this->_migrationFiles = [];
$directories = $this->getDirectories();
foreach ($directories as $namespace => $dir) {
if ($dir && is_dir($dir)) {
$handle = o... | [
"protected",
"function",
"getMigrationFiles",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_migrationFiles",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"_migrationFiles",
"=",
"[",
"]",
";",
"$",
"directories",
"=",
"$",
"this",
"->",
"getDirectories",
... | List of migration class at all entire path
@return array | [
"List",
"of",
"migration",
"class",
"at",
"all",
"entire",
"path"
] | 82de65e7edde4dadd35c4d7df9eed1b21b590650 | https://github.com/deesoft/yii2-console/blob/82de65e7edde4dadd35c4d7df9eed1b21b590650/MigrateTrait.php#L93-L129 |
192,336 | deesoft/yii2-console | MigrateTrait.php | MigrateTrait.getExcepts | protected function getExcepts()
{
if (!is_array($this->excepts)) {
$excepts = [];
if (!empty($this->excepts)) {
foreach (preg_split('/\s*,\s*/', $this->excepts) as $version) {
if (preg_match('/m?(\d{6}_?\d{6})(\D.*?)?$/is', $version, $matches)) {
... | php | protected function getExcepts()
{
if (!is_array($this->excepts)) {
$excepts = [];
if (!empty($this->excepts)) {
foreach (preg_split('/\s*,\s*/', $this->excepts) as $version) {
if (preg_match('/m?(\d{6}_?\d{6})(\D.*?)?$/is', $version, $matches)) {
... | [
"protected",
"function",
"getExcepts",
"(",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"this",
"->",
"excepts",
")",
")",
"{",
"$",
"excepts",
"=",
"[",
"]",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"excepts",
")",
")",
"{",
"... | Excepted version to be applied | [
"Excepted",
"version",
"to",
"be",
"applied"
] | 82de65e7edde4dadd35c4d7df9eed1b21b590650 | https://github.com/deesoft/yii2-console/blob/82de65e7edde4dadd35c4d7df9eed1b21b590650/MigrateTrait.php#L159-L173 |
192,337 | deesoft/yii2-console | MigrateTrait.php | MigrateTrait.actionUp | public function actionUp($limit = 0)
{
if (is_numeric($limit)) {
return parent::actionUp($limit);
} else {
return $this->actionPartialUp($limit);
}
} | php | public function actionUp($limit = 0)
{
if (is_numeric($limit)) {
return parent::actionUp($limit);
} else {
return $this->actionPartialUp($limit);
}
} | [
"public",
"function",
"actionUp",
"(",
"$",
"limit",
"=",
"0",
")",
"{",
"if",
"(",
"is_numeric",
"(",
"$",
"limit",
")",
")",
"{",
"return",
"parent",
"::",
"actionUp",
"(",
"$",
"limit",
")",
";",
"}",
"else",
"{",
"return",
"$",
"this",
"->",
... | Upgrades the application by applying new migrations.
For example,
```
yii migrate # apply all new migrations
yii migrate 3 # apply the first 3 new migrations
yii migrate 101129_185401 # apply only one specific migration
yii migrate m101129_185401_create_user_table # using full name
```
@p... | [
"Upgrades",
"the",
"application",
"by",
"applying",
"new",
"migrations",
".",
"For",
"example"
] | 82de65e7edde4dadd35c4d7df9eed1b21b590650 | https://github.com/deesoft/yii2-console/blob/82de65e7edde4dadd35c4d7df9eed1b21b590650/MigrateTrait.php#L223-L230 |
192,338 | deesoft/yii2-console | MigrateTrait.php | MigrateTrait.actionDown | public function actionDown($limit = 1)
{
if (is_numeric($limit) || $limit === 'all') {
return parent::actionDown($limit);
} else {
return $this->actionPartialDown($limit);
}
} | php | public function actionDown($limit = 1)
{
if (is_numeric($limit) || $limit === 'all') {
return parent::actionDown($limit);
} else {
return $this->actionPartialDown($limit);
}
} | [
"public",
"function",
"actionDown",
"(",
"$",
"limit",
"=",
"1",
")",
"{",
"if",
"(",
"is_numeric",
"(",
"$",
"limit",
")",
"||",
"$",
"limit",
"===",
"'all'",
")",
"{",
"return",
"parent",
"::",
"actionDown",
"(",
"$",
"limit",
")",
";",
"}",
"els... | Downgrades the application by reverting old migrations.
For example,
```
yii migrate/down # revert the last migration
yii migrate/down 3 # revert the last 3 migrations
yii migrate/down all # revert all migrations
yii migrate/down 101129_185401 # revert specific migration
yii migrate/down m10... | [
"Downgrades",
"the",
"application",
"by",
"reverting",
"old",
"migrations",
".",
"For",
"example"
] | 82de65e7edde4dadd35c4d7df9eed1b21b590650 | https://github.com/deesoft/yii2-console/blob/82de65e7edde4dadd35c4d7df9eed1b21b590650/MigrateTrait.php#L250-L257 |
192,339 | deesoft/yii2-console | MigrateTrait.php | MigrateTrait.actionRedo | public function actionRedo($limit = 1)
{
if (is_numeric($limit) || $limit === 'all') {
return parent::actionRedo($limit);
} else {
return $this->actionPartialRedo($limit);
}
} | php | public function actionRedo($limit = 1)
{
if (is_numeric($limit) || $limit === 'all') {
return parent::actionRedo($limit);
} else {
return $this->actionPartialRedo($limit);
}
} | [
"public",
"function",
"actionRedo",
"(",
"$",
"limit",
"=",
"1",
")",
"{",
"if",
"(",
"is_numeric",
"(",
"$",
"limit",
")",
"||",
"$",
"limit",
"===",
"'all'",
")",
"{",
"return",
"parent",
"::",
"actionRedo",
"(",
"$",
"limit",
")",
";",
"}",
"els... | Redoes the last few migrations.
This command will first revert the specified migrations, and then apply
them again. For example,
```
yii migrate/redo # redo the last applied migration
yii migrate/redo 3 # redo the last 3 applied migrations
yii migrate/redo all # redo all migrations
yii migrate/redo 101129_18540... | [
"Redoes",
"the",
"last",
"few",
"migrations",
"."
] | 82de65e7edde4dadd35c4d7df9eed1b21b590650 | https://github.com/deesoft/yii2-console/blob/82de65e7edde4dadd35c4d7df9eed1b21b590650/MigrateTrait.php#L279-L286 |
192,340 | deesoft/yii2-console | MigrateTrait.php | MigrateTrait.actionPartialUp | public function actionPartialUp($version)
{
$migrations = $this->getVersions('new', $version);
if (empty($migrations)) {
$this->stdout("No new migrations to be applied.\n", Console::FG_GREEN);
return self::EXIT_CODE_NORMAL;
}
$n = count($migrations);
$... | php | public function actionPartialUp($version)
{
$migrations = $this->getVersions('new', $version);
if (empty($migrations)) {
$this->stdout("No new migrations to be applied.\n", Console::FG_GREEN);
return self::EXIT_CODE_NORMAL;
}
$n = count($migrations);
$... | [
"public",
"function",
"actionPartialUp",
"(",
"$",
"version",
")",
"{",
"$",
"migrations",
"=",
"$",
"this",
"->",
"getVersions",
"(",
"'new'",
",",
"$",
"version",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"migrations",
")",
")",
"{",
"$",
"this",
"->... | Upgrades the application by applying new migration.
For example,
```
yii migrate/partial-up 101129_185401 # using timestamp
yii migrate/partial-up m101129_185401_create_user_table # using full name
```
@param string $version the version at which the migration history should be marked.
This can ... | [
"Upgrades",
"the",
"application",
"by",
"applying",
"new",
"migration",
".",
"For",
"example"
] | 82de65e7edde4dadd35c4d7df9eed1b21b590650 | https://github.com/deesoft/yii2-console/blob/82de65e7edde4dadd35c4d7df9eed1b21b590650/MigrateTrait.php#L337-L367 |
192,341 | deesoft/yii2-console | MigrateTrait.php | MigrateTrait.actionPartialDown | public function actionPartialDown($version)
{
$migrations = $this->getVersions('history', $version);
if (empty($migrations)) {
$this->stdout("No migration has been done before.\n", Console::FG_GREEN);
return self::EXIT_CODE_NORMAL;
}
$n = count($migrations);
... | php | public function actionPartialDown($version)
{
$migrations = $this->getVersions('history', $version);
if (empty($migrations)) {
$this->stdout("No migration has been done before.\n", Console::FG_GREEN);
return self::EXIT_CODE_NORMAL;
}
$n = count($migrations);
... | [
"public",
"function",
"actionPartialDown",
"(",
"$",
"version",
")",
"{",
"$",
"migrations",
"=",
"$",
"this",
"->",
"getVersions",
"(",
"'history'",
",",
"$",
"version",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"migrations",
")",
")",
"{",
"$",
"this",... | Downgrades the application by reverting old migration.
For example,
```
yii migrate/partial-down 101129_185401 # using timestamp
yii migrate/partial-down m101129_185401_create_user_table # using full name
```
@param string $version the version at which the migration history should be marked.
Th... | [
"Downgrades",
"the",
"application",
"by",
"reverting",
"old",
"migration",
".",
"For",
"example"
] | 82de65e7edde4dadd35c4d7df9eed1b21b590650 | https://github.com/deesoft/yii2-console/blob/82de65e7edde4dadd35c4d7df9eed1b21b590650/MigrateTrait.php#L383-L412 |
192,342 | deesoft/yii2-console | MigrateTrait.php | MigrateTrait.actionPartialRedo | public function actionPartialRedo($version)
{
$migrations = $this->getVersions('history', $version);
if (empty($migrations)) {
$this->stdout("No migration has been done before.\n", Console::FG_GREEN);
return self::EXIT_CODE_NORMAL;
}
$n = count($migrations);
... | php | public function actionPartialRedo($version)
{
$migrations = $this->getVersions('history', $version);
if (empty($migrations)) {
$this->stdout("No migration has been done before.\n", Console::FG_GREEN);
return self::EXIT_CODE_NORMAL;
}
$n = count($migrations);
... | [
"public",
"function",
"actionPartialRedo",
"(",
"$",
"version",
")",
"{",
"$",
"migrations",
"=",
"$",
"this",
"->",
"getVersions",
"(",
"'history'",
",",
"$",
"version",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"migrations",
")",
")",
"{",
"$",
"this",... | Redoes partial migration.
This command will first revert the specified migrations, and then apply
them again. For example,
```
yii migrate/partial-redo 101129_185401 # using timestamp
yii migrate/partial-redo m101129_185401_create_user_table # using full name
```
@param string $version the ver... | [
"Redoes",
"partial",
"migration",
"."
] | 82de65e7edde4dadd35c4d7df9eed1b21b590650 | https://github.com/deesoft/yii2-console/blob/82de65e7edde4dadd35c4d7df9eed1b21b590650/MigrateTrait.php#L430-L463 |
192,343 | dzarezenko/etherscan-api | src/tools/Request.php | Request.exec | public function exec(array $req = []) {
usleep(250000);
// API settings
$req['apikey'] = $this->apiKeyToken;
// generate the POST data string
$postData = http_build_query($req, '', '&');
// curl handle (initialize if required)
if (is_null(self::$ch)) {
... | php | public function exec(array $req = []) {
usleep(250000);
// API settings
$req['apikey'] = $this->apiKeyToken;
// generate the POST data string
$postData = http_build_query($req, '', '&');
// curl handle (initialize if required)
if (is_null(self::$ch)) {
... | [
"public",
"function",
"exec",
"(",
"array",
"$",
"req",
"=",
"[",
"]",
")",
"{",
"usleep",
"(",
"250000",
")",
";",
"// API settings",
"$",
"req",
"[",
"'apikey'",
"]",
"=",
"$",
"this",
"->",
"apiKeyToken",
";",
"// generate the POST data string",
"$",
... | Executes curl request to the Etherscan API.
@param array $req Request parameters list.
@return array JSON data.
@throws \Exception If Curl error or Etherscan API error occurred. | [
"Executes",
"curl",
"request",
"to",
"the",
"Etherscan",
"API",
"."
] | 679b6ea1c8ee4e1cf29487e6b177cce09d5a56b0 | https://github.com/dzarezenko/etherscan-api/blob/679b6ea1c8ee4e1cf29487e6b177cce09d5a56b0/src/tools/Request.php#L51-L88 |
192,344 | FriendsOfSymfony/FOSMessage | src/Driver/Doctrine/ORM/DoctrineORMDriver.php | DoctrineORMDriver.createConversationQueryBuilder | private function createConversationQueryBuilder()
{
return $this->objectManager->createQueryBuilder()
->select('c', 'cp', 'p', 't', 'm', 'mp')
->from($this->getConversationClass(), 'c')
->leftJoin('c.persons', 'cp')
->leftJoin('cp.person', 'p')
->l... | php | private function createConversationQueryBuilder()
{
return $this->objectManager->createQueryBuilder()
->select('c', 'cp', 'p', 't', 'm', 'mp')
->from($this->getConversationClass(), 'c')
->leftJoin('c.persons', 'cp')
->leftJoin('cp.person', 'p')
->l... | [
"private",
"function",
"createConversationQueryBuilder",
"(",
")",
"{",
"return",
"$",
"this",
"->",
"objectManager",
"->",
"createQueryBuilder",
"(",
")",
"->",
"select",
"(",
"'c'",
",",
"'cp'",
",",
"'p'",
",",
"'t'",
",",
"'m'",
",",
"'mp'",
")",
"->",... | Create a conversation query builder with optimized joins.
@return \Doctrine\ORM\QueryBuilder | [
"Create",
"a",
"conversation",
"query",
"builder",
"with",
"optimized",
"joins",
"."
] | fec9ad9069582e62f26927d41de96f0e8b2c1669 | https://github.com/FriendsOfSymfony/FOSMessage/blob/fec9ad9069582e62f26927d41de96f0e8b2c1669/src/Driver/Doctrine/ORM/DoctrineORMDriver.php#L157-L169 |
192,345 | gossi/swagger | src/collections/SecurityDefinitions.php | SecurityDefinitions.get | public function get($id) {
if (!$this->schemes->has($id)) {
$this->schemes->set($id, new SecurityScheme($id));
}
return $this->schemes->get($id);
} | php | public function get($id) {
if (!$this->schemes->has($id)) {
$this->schemes->set($id, new SecurityScheme($id));
}
return $this->schemes->get($id);
} | [
"public",
"function",
"get",
"(",
"$",
"id",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"schemes",
"->",
"has",
"(",
"$",
"id",
")",
")",
"{",
"$",
"this",
"->",
"schemes",
"->",
"set",
"(",
"$",
"id",
",",
"new",
"SecurityScheme",
"(",
"$",
... | Returns the scheme info for the given id
@param string $id
@return SecurityScheme | [
"Returns",
"the",
"scheme",
"info",
"for",
"the",
"given",
"id"
] | 557dd831cb7cd7a6e3965b2027dac05c4d56c38e | https://github.com/gossi/swagger/blob/557dd831cb7cd7a6e3965b2027dac05c4d56c38e/src/collections/SecurityDefinitions.php#L63-L68 |
192,346 | gossi/swagger | src/collections/Parameters.php | Parameters.searchByName | public function searchByName($name) {
return $this->parameters->search($name, function (Parameter $param, $name) {
return $param->getName() == $name;
});
} | php | public function searchByName($name) {
return $this->parameters->search($name, function (Parameter $param, $name) {
return $param->getName() == $name;
});
} | [
"public",
"function",
"searchByName",
"(",
"$",
"name",
")",
"{",
"return",
"$",
"this",
"->",
"parameters",
"->",
"search",
"(",
"$",
"name",
",",
"function",
"(",
"Parameter",
"$",
"param",
",",
"$",
"name",
")",
"{",
"return",
"$",
"param",
"->",
... | Searches whether a parameter with the given name exists
@param string $name
@return bool | [
"Searches",
"whether",
"a",
"parameter",
"with",
"the",
"given",
"name",
"exists"
] | 557dd831cb7cd7a6e3965b2027dac05c4d56c38e | https://github.com/gossi/swagger/blob/557dd831cb7cd7a6e3965b2027dac05c4d56c38e/src/collections/Parameters.php#L53-L57 |
192,347 | gossi/swagger | src/collections/Parameters.php | Parameters.findByName | public function findByName($name) {
foreach ($this->parameters as $param) {
if ($param->getName() == $name) {
return $param;
}
}
} | php | public function findByName($name) {
foreach ($this->parameters as $param) {
if ($param->getName() == $name) {
return $param;
}
}
} | [
"public",
"function",
"findByName",
"(",
"$",
"name",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"parameters",
"as",
"$",
"param",
")",
"{",
"if",
"(",
"$",
"param",
"->",
"getName",
"(",
")",
"==",
"$",
"name",
")",
"{",
"return",
"$",
"param",
... | Returns parameter with the given name if it exists
@param string $name
@return Parameter|void | [
"Returns",
"parameter",
"with",
"the",
"given",
"name",
"if",
"it",
"exists"
] | 557dd831cb7cd7a6e3965b2027dac05c4d56c38e | https://github.com/gossi/swagger/blob/557dd831cb7cd7a6e3965b2027dac05c4d56c38e/src/collections/Parameters.php#L65-L71 |
192,348 | gossi/swagger | src/collections/Parameters.php | Parameters.getByName | public function getByName($name) {
$param = $this->findByName($name);
if (empty($param)) {
$param = new Parameter();
$param->setName($name);
$this->parameters->add($param);
}
return $param;
} | php | public function getByName($name) {
$param = $this->findByName($name);
if (empty($param)) {
$param = new Parameter();
$param->setName($name);
$this->parameters->add($param);
}
return $param;
} | [
"public",
"function",
"getByName",
"(",
"$",
"name",
")",
"{",
"$",
"param",
"=",
"$",
"this",
"->",
"findByName",
"(",
"$",
"name",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"param",
")",
")",
"{",
"$",
"param",
"=",
"new",
"Parameter",
"(",
")",
... | Searches for the parameter with the given name. Creates a parameter with the given name
if none exists
@param string $name
@return Parameter | [
"Searches",
"for",
"the",
"parameter",
"with",
"the",
"given",
"name",
".",
"Creates",
"a",
"parameter",
"with",
"the",
"given",
"name",
"if",
"none",
"exists"
] | 557dd831cb7cd7a6e3965b2027dac05c4d56c38e | https://github.com/gossi/swagger/blob/557dd831cb7cd7a6e3965b2027dac05c4d56c38e/src/collections/Parameters.php#L80-L89 |
192,349 | gossi/swagger | src/collections/Parameters.php | Parameters.search | public function search($name, $in) {
return $this->parameters->search(function (Parameter $param) use ($name, $in) {
return $param->getIn() == $in && $param->getName() == $name;
});
} | php | public function search($name, $in) {
return $this->parameters->search(function (Parameter $param) use ($name, $in) {
return $param->getIn() == $in && $param->getName() == $name;
});
} | [
"public",
"function",
"search",
"(",
"$",
"name",
",",
"$",
"in",
")",
"{",
"return",
"$",
"this",
"->",
"parameters",
"->",
"search",
"(",
"function",
"(",
"Parameter",
"$",
"param",
")",
"use",
"(",
"$",
"name",
",",
"$",
"in",
")",
"{",
"return"... | Searches whether a parameter with the given unique combination exists
@param string $name
@param string $id
@return bool | [
"Searches",
"whether",
"a",
"parameter",
"with",
"the",
"given",
"unique",
"combination",
"exists"
] | 557dd831cb7cd7a6e3965b2027dac05c4d56c38e | https://github.com/gossi/swagger/blob/557dd831cb7cd7a6e3965b2027dac05c4d56c38e/src/collections/Parameters.php#L98-L102 |
192,350 | deesoft/yii2-console | Request.php | Request.parse | protected function parse($pattern, $route, $params)
{
$pattern = ltrim($pattern, '/');
if (preg_match_all(self::REGEX, $pattern, $matches, PREG_OFFSET_CAPTURE | PREG_SET_ORDER)) {
$regex = '~^';
$variables = [];
$offset = 0;
$i = 1;
foreach... | php | protected function parse($pattern, $route, $params)
{
$pattern = ltrim($pattern, '/');
if (preg_match_all(self::REGEX, $pattern, $matches, PREG_OFFSET_CAPTURE | PREG_SET_ORDER)) {
$regex = '~^';
$variables = [];
$offset = 0;
$i = 1;
foreach... | [
"protected",
"function",
"parse",
"(",
"$",
"pattern",
",",
"$",
"route",
",",
"$",
"params",
")",
"{",
"$",
"pattern",
"=",
"ltrim",
"(",
"$",
"pattern",
",",
"'/'",
")",
";",
"if",
"(",
"preg_match_all",
"(",
"self",
"::",
"REGEX",
",",
"$",
"pat... | Parses a route string that does not contain optional segments. | [
"Parses",
"a",
"route",
"string",
"that",
"does",
"not",
"contain",
"optional",
"segments",
"."
] | 82de65e7edde4dadd35c4d7df9eed1b21b590650 | https://github.com/deesoft/yii2-console/blob/82de65e7edde4dadd35c4d7df9eed1b21b590650/Request.php#L103-L130 |
192,351 | gossi/swagger | src/collections/Paths.php | Paths.get | public function get($path) {
if (!$this->paths->has($path)) {
$this->paths->set($path, new Path($path));
}
return $this->paths->get($path);
} | php | public function get($path) {
if (!$this->paths->has($path)) {
$this->paths->set($path, new Path($path));
}
return $this->paths->get($path);
} | [
"public",
"function",
"get",
"(",
"$",
"path",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"paths",
"->",
"has",
"(",
"$",
"path",
")",
")",
"{",
"$",
"this",
"->",
"paths",
"->",
"set",
"(",
"$",
"path",
",",
"new",
"Path",
"(",
"$",
"path"... | Returns the path info for the given path
@param string $path
@return Path | [
"Returns",
"the",
"path",
"info",
"for",
"the",
"given",
"path"
] | 557dd831cb7cd7a6e3965b2027dac05c4d56c38e | https://github.com/gossi/swagger/blob/557dd831cb7cd7a6e3965b2027dac05c4d56c38e/src/collections/Paths.php#L72-L77 |
192,352 | gossi/swagger | src/collections/Paths.php | Paths.add | public function add(Path $path) {
$this->paths->set($path->getPath(), $path);
return $this;
} | php | public function add(Path $path) {
$this->paths->set($path->getPath(), $path);
return $this;
} | [
"public",
"function",
"add",
"(",
"Path",
"$",
"path",
")",
"{",
"$",
"this",
"->",
"paths",
"->",
"set",
"(",
"$",
"path",
"->",
"getPath",
"(",
")",
",",
"$",
"path",
")",
";",
"return",
"$",
"this",
";",
"}"
] | Sets the path
@param Path $path
@return $this | [
"Sets",
"the",
"path"
] | 557dd831cb7cd7a6e3965b2027dac05c4d56c38e | https://github.com/gossi/swagger/blob/557dd831cb7cd7a6e3965b2027dac05c4d56c38e/src/collections/Paths.php#L85-L88 |
192,353 | gossi/swagger | src/collections/Paths.php | Paths.addAll | public function addAll(Paths $paths) {
foreach ($paths as $p) {
$path = $this->get($p->getPath());
foreach ($p->getMethods() as $method) {
$path->setOperation($method, $p->getOperation($method));
}
}
} | php | public function addAll(Paths $paths) {
foreach ($paths as $p) {
$path = $this->get($p->getPath());
foreach ($p->getMethods() as $method) {
$path->setOperation($method, $p->getOperation($method));
}
}
} | [
"public",
"function",
"addAll",
"(",
"Paths",
"$",
"paths",
")",
"{",
"foreach",
"(",
"$",
"paths",
"as",
"$",
"p",
")",
"{",
"$",
"path",
"=",
"$",
"this",
"->",
"get",
"(",
"$",
"p",
"->",
"getPath",
"(",
")",
")",
";",
"foreach",
"(",
"$",
... | Adds all operations from another paths collection. Will overwrite existing operations.
@param Paths $paths | [
"Adds",
"all",
"operations",
"from",
"another",
"paths",
"collection",
".",
"Will",
"overwrite",
"existing",
"operations",
"."
] | 557dd831cb7cd7a6e3965b2027dac05c4d56c38e | https://github.com/gossi/swagger/blob/557dd831cb7cd7a6e3965b2027dac05c4d56c38e/src/collections/Paths.php#L95-L102 |
192,354 | RomeroMsk/yii2-chosen | Chosen.php | Chosen.registerScript | public function registerScript()
{
ChosenBootstrapAsset::register($this->getView());
$clientOptions = Json::encode($this->clientOptions);
$id = $this->options['id'];
$this->getView()->registerJs("jQuery('#$id').chosen({$clientOptions});");
} | php | public function registerScript()
{
ChosenBootstrapAsset::register($this->getView());
$clientOptions = Json::encode($this->clientOptions);
$id = $this->options['id'];
$this->getView()->registerJs("jQuery('#$id').chosen({$clientOptions});");
} | [
"public",
"function",
"registerScript",
"(",
")",
"{",
"ChosenBootstrapAsset",
"::",
"register",
"(",
"$",
"this",
"->",
"getView",
"(",
")",
")",
";",
"$",
"clientOptions",
"=",
"Json",
"::",
"encode",
"(",
"$",
"this",
"->",
"clientOptions",
")",
";",
... | Registers chosen.js | [
"Registers",
"chosen",
".",
"js"
] | 3aae8570fafcee765bc39609c8469813ecc192ad | https://github.com/RomeroMsk/yii2-chosen/blob/3aae8570fafcee765bc39609c8469813ecc192ad/Chosen.php#L112-L118 |
192,355 | BKWLD/laravel-haml | src/Bkwld/LaravelHaml/ServiceProvider.php | ServiceProvider.registerHamlCompiler | public function registerHamlCompiler() {
// Add resolver
$this->app['view.engine.resolver']->register('haml', function() {
return new CompilerEngine($this->app['Bkwld\LaravelHaml\HamlCompiler']);
});
// Add extensions
$this->app['view']->addExtension('haml', 'haml');
$this->app['view']->addExtension('h... | php | public function registerHamlCompiler() {
// Add resolver
$this->app['view.engine.resolver']->register('haml', function() {
return new CompilerEngine($this->app['Bkwld\LaravelHaml\HamlCompiler']);
});
// Add extensions
$this->app['view']->addExtension('haml', 'haml');
$this->app['view']->addExtension('h... | [
"public",
"function",
"registerHamlCompiler",
"(",
")",
"{",
"// Add resolver",
"$",
"this",
"->",
"app",
"[",
"'view.engine.resolver'",
"]",
"->",
"register",
"(",
"'haml'",
",",
"function",
"(",
")",
"{",
"return",
"new",
"CompilerEngine",
"(",
"$",
"this",
... | Register the regular haml compiler
@return void | [
"Register",
"the",
"regular",
"haml",
"compiler"
] | 4d2d6734a8e58a2fce25f54e2fe8665637e5b352 | https://github.com/BKWLD/laravel-haml/blob/4d2d6734a8e58a2fce25f54e2fe8665637e5b352/src/Bkwld/LaravelHaml/ServiceProvider.php#L112-L122 |
192,356 | BKWLD/laravel-haml | src/Bkwld/LaravelHaml/ServiceProvider.php | ServiceProvider.registerHamlBladeCompiler | public function registerHamlBladeCompiler() {
// Add resolver
$this->app['view.engine.resolver']->register('haml.blade', function() {
return new CompilerEngine($this->app['Bkwld\LaravelHaml\HamlBladeCompiler']);
});
// Add extensions
$this->app['view']->addExtension('haml.blade', 'haml.blade');
$this->... | php | public function registerHamlBladeCompiler() {
// Add resolver
$this->app['view.engine.resolver']->register('haml.blade', function() {
return new CompilerEngine($this->app['Bkwld\LaravelHaml\HamlBladeCompiler']);
});
// Add extensions
$this->app['view']->addExtension('haml.blade', 'haml.blade');
$this->... | [
"public",
"function",
"registerHamlBladeCompiler",
"(",
")",
"{",
"// Add resolver",
"$",
"this",
"->",
"app",
"[",
"'view.engine.resolver'",
"]",
"->",
"register",
"(",
"'haml.blade'",
",",
"function",
"(",
")",
"{",
"return",
"new",
"CompilerEngine",
"(",
"$",... | Register the blade compiler compiler
@return void | [
"Register",
"the",
"blade",
"compiler",
"compiler"
] | 4d2d6734a8e58a2fce25f54e2fe8665637e5b352 | https://github.com/BKWLD/laravel-haml/blob/4d2d6734a8e58a2fce25f54e2fe8665637e5b352/src/Bkwld/LaravelHaml/ServiceProvider.php#L129-L139 |
192,357 | mdlayher/serial | src/serial/serial.php | serial.close | public function close()
{
if (isset($this->serial))
{
dio_close($this->serial);
unset($this->serial);
}
return true;
} | php | public function close()
{
if (isset($this->serial))
{
dio_close($this->serial);
unset($this->serial);
}
return true;
} | [
"public",
"function",
"close",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"serial",
")",
")",
"{",
"dio_close",
"(",
"$",
"this",
"->",
"serial",
")",
";",
"unset",
"(",
"$",
"this",
"->",
"serial",
")",
";",
"}",
"return",
"true"... | Close connection to serial port | [
"Close",
"connection",
"to",
"serial",
"port"
] | 557c90d80cb4971ca2d59ba9d531b91fb1abbcd4 | https://github.com/mdlayher/serial/blob/557c90d80cb4971ca2d59ba9d531b91fb1abbcd4/src/serial/serial.php#L158-L166 |
192,358 | mdlayher/serial | src/serial/serial.php | serial.read | public function read($length = self::DEFAULT_LENGTH)
{
$bytes = dio_read($this->serial, $length);
return $bytes;
} | php | public function read($length = self::DEFAULT_LENGTH)
{
$bytes = dio_read($this->serial, $length);
return $bytes;
} | [
"public",
"function",
"read",
"(",
"$",
"length",
"=",
"self",
"::",
"DEFAULT_LENGTH",
")",
"{",
"$",
"bytes",
"=",
"dio_read",
"(",
"$",
"this",
"->",
"serial",
",",
"$",
"length",
")",
";",
"return",
"$",
"bytes",
";",
"}"
] | Read data from serial port | [
"Read",
"data",
"from",
"serial",
"port"
] | 557c90d80cb4971ca2d59ba9d531b91fb1abbcd4 | https://github.com/mdlayher/serial/blob/557c90d80cb4971ca2d59ba9d531b91fb1abbcd4/src/serial/serial.php#L169-L173 |
192,359 | mdlayher/serial | src/serial/serial.php | serial.write | public function write($data, $length = self::DEFAULT_LENGTH, $wait = self::DEFAULT_WAIT)
{
$bytes = dio_write($this->serial, $data);
usleep($wait);
return $bytes;
} | php | public function write($data, $length = self::DEFAULT_LENGTH, $wait = self::DEFAULT_WAIT)
{
$bytes = dio_write($this->serial, $data);
usleep($wait);
return $bytes;
} | [
"public",
"function",
"write",
"(",
"$",
"data",
",",
"$",
"length",
"=",
"self",
"::",
"DEFAULT_LENGTH",
",",
"$",
"wait",
"=",
"self",
"::",
"DEFAULT_WAIT",
")",
"{",
"$",
"bytes",
"=",
"dio_write",
"(",
"$",
"this",
"->",
"serial",
",",
"$",
"data... | Write data to serial port | [
"Write",
"data",
"to",
"serial",
"port"
] | 557c90d80cb4971ca2d59ba9d531b91fb1abbcd4 | https://github.com/mdlayher/serial/blob/557c90d80cb4971ca2d59ba9d531b91fb1abbcd4/src/serial/serial.php#L176-L181 |
192,360 | JZechy/jQuery-FileUpload | src/FileUploadControl.php | FileUploadControl.parseIniSize | private function parseIniSize($value) {
$units = ['k' => 1024, 'm' => 1048576, 'g' => 1073741824];
$unit = strtolower(substr($value, -1));
if(is_numeric($unit) || !isset($units[ $unit ])) {
return $value;
}
return ((int)$value) * $units[ $unit ];
} | php | private function parseIniSize($value) {
$units = ['k' => 1024, 'm' => 1048576, 'g' => 1073741824];
$unit = strtolower(substr($value, -1));
if(is_numeric($unit) || !isset($units[ $unit ])) {
return $value;
}
return ((int)$value) * $units[ $unit ];
} | [
"private",
"function",
"parseIniSize",
"(",
"$",
"value",
")",
"{",
"$",
"units",
"=",
"[",
"'k'",
"=>",
"1024",
",",
"'m'",
"=>",
"1048576",
",",
"'g'",
"=>",
"1073741824",
"]",
";",
"$",
"unit",
"=",
"strtolower",
"(",
"substr",
"(",
"$",
"value",
... | Parses ini size
@param string $value
@return int | [
"Parses",
"ini",
"size"
] | 22c6539ffde62a7529b9199118e784ab8508ea96 | https://github.com/JZechy/jQuery-FileUpload/blob/22c6539ffde62a7529b9199118e784ab8508ea96/src/FileUploadControl.php#L607-L615 |
192,361 | gossi/swagger | src/Path.php | Path.getOperation | public function getOperation($method) {
if (!$this->operations->has($method)) {
$this->operations->set($method, new Operation());
}
return $this->operations->get($method);
} | php | public function getOperation($method) {
if (!$this->operations->has($method)) {
$this->operations->set($method, new Operation());
}
return $this->operations->get($method);
} | [
"public",
"function",
"getOperation",
"(",
"$",
"method",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"operations",
"->",
"has",
"(",
"$",
"method",
")",
")",
"{",
"$",
"this",
"->",
"operations",
"->",
"set",
"(",
"$",
"method",
",",
"new",
"Oper... | Gets the operation for the given method, creates one if none exists
@param string $method
@return Operation | [
"Gets",
"the",
"operation",
"for",
"the",
"given",
"method",
"creates",
"one",
"if",
"none",
"exists"
] | 557dd831cb7cd7a6e3965b2027dac05c4d56c38e | https://github.com/gossi/swagger/blob/557dd831cb7cd7a6e3965b2027dac05c4d56c38e/src/Path.php#L63-L69 |
192,362 | dzarezenko/etherscan-api | src/Etherscan.php | Etherscan.balance | public function balance($address, $tag = EtherscanAPIConf::TAG_LATEST) {
return $this->request->exec([
'module' => "account",
'action' => "balance",
'address' => $address,
'tag' => $tag
]);
} | php | public function balance($address, $tag = EtherscanAPIConf::TAG_LATEST) {
return $this->request->exec([
'module' => "account",
'action' => "balance",
'address' => $address,
'tag' => $tag
]);
} | [
"public",
"function",
"balance",
"(",
"$",
"address",
",",
"$",
"tag",
"=",
"EtherscanAPIConf",
"::",
"TAG_LATEST",
")",
"{",
"return",
"$",
"this",
"->",
"request",
"->",
"exec",
"(",
"[",
"'module'",
"=>",
"\"account\"",
",",
"'action'",
"=>",
"\"balance... | Get Ether Balance for a single Address.
@param string $address Ether address.
@param string $tag
@return array | [
"Get",
"Ether",
"Balance",
"for",
"a",
"single",
"Address",
"."
] | 679b6ea1c8ee4e1cf29487e6b177cce09d5a56b0 | https://github.com/dzarezenko/etherscan-api/blob/679b6ea1c8ee4e1cf29487e6b177cce09d5a56b0/src/Etherscan.php#L58-L65 |
192,363 | dzarezenko/etherscan-api | src/Etherscan.php | Etherscan.balanceMulti | public function balanceMulti($addresses, $tag = EtherscanAPIConf::TAG_LATEST) {
if (is_array($addresses)) {
$addresses = implode(",", $addresses);
}
return $this->request->exec([
'module' => "account",
'action' => "balancemulti",
'address' => $add... | php | public function balanceMulti($addresses, $tag = EtherscanAPIConf::TAG_LATEST) {
if (is_array($addresses)) {
$addresses = implode(",", $addresses);
}
return $this->request->exec([
'module' => "account",
'action' => "balancemulti",
'address' => $add... | [
"public",
"function",
"balanceMulti",
"(",
"$",
"addresses",
",",
"$",
"tag",
"=",
"EtherscanAPIConf",
"::",
"TAG_LATEST",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"addresses",
")",
")",
"{",
"$",
"addresses",
"=",
"implode",
"(",
"\",\"",
",",
"$",
... | Get Ether Balance for multiple Addresses in a single call.
@param string $addresses Ether address.
@param string $tag
@return array | [
"Get",
"Ether",
"Balance",
"for",
"multiple",
"Addresses",
"in",
"a",
"single",
"call",
"."
] | 679b6ea1c8ee4e1cf29487e6b177cce09d5a56b0 | https://github.com/dzarezenko/etherscan-api/blob/679b6ea1c8ee4e1cf29487e6b177cce09d5a56b0/src/Etherscan.php#L75-L86 |
192,364 | dzarezenko/etherscan-api | src/Etherscan.php | Etherscan.getMinedBlocks | public function getMinedBlocks($address, $blockType = EtherscanAPIConf::BLOCK_TYPE_BLOCKS, $page = null, $offset = null) {
if (!in_array($blockType, EtherscanAPIConf::$blockTypes)) {
throw new \Exception("Invalid block type");
}
$params = [
'module' => "account",
... | php | public function getMinedBlocks($address, $blockType = EtherscanAPIConf::BLOCK_TYPE_BLOCKS, $page = null, $offset = null) {
if (!in_array($blockType, EtherscanAPIConf::$blockTypes)) {
throw new \Exception("Invalid block type");
}
$params = [
'module' => "account",
... | [
"public",
"function",
"getMinedBlocks",
"(",
"$",
"address",
",",
"$",
"blockType",
"=",
"EtherscanAPIConf",
"::",
"BLOCK_TYPE_BLOCKS",
",",
"$",
"page",
"=",
"null",
",",
"$",
"offset",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"in_array",
"(",
"$",
"block... | Get list of Blocks Mined by Address.
@param string $address Ether address
@param string $blockType "blocks" or "uncles"
@param int $page Page number
@param int $offset Offset
@return array | [
"Get",
"list",
"of",
"Blocks",
"Mined",
"by",
"Address",
"."
] | 679b6ea1c8ee4e1cf29487e6b177cce09d5a56b0 | https://github.com/dzarezenko/etherscan-api/blob/679b6ea1c8ee4e1cf29487e6b177cce09d5a56b0/src/Etherscan.php#L181-L202 |
192,365 | gossi/swagger | src/collections/SecurityRequirements.php | SecurityRequirements.get | public function get($id) {
if (!$this->securities->has($id)) {
$this->securities->set($id, new Set());
}
return $this->securities->get($id);
} | php | public function get($id) {
if (!$this->securities->has($id)) {
$this->securities->set($id, new Set());
}
return $this->securities->get($id);
} | [
"public",
"function",
"get",
"(",
"$",
"id",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"securities",
"->",
"has",
"(",
"$",
"id",
")",
")",
"{",
"$",
"this",
"->",
"securities",
"->",
"set",
"(",
"$",
"id",
",",
"new",
"Set",
"(",
")",
")"... | Returns the scopes for the given id
@param string $id
@return Set | [
"Returns",
"the",
"scopes",
"for",
"the",
"given",
"id"
] | 557dd831cb7cd7a6e3965b2027dac05c4d56c38e | https://github.com/gossi/swagger/blob/557dd831cb7cd7a6e3965b2027dac05c4d56c38e/src/collections/SecurityRequirements.php#L62-L67 |
192,366 | efriandika/laravel-settings | src/Settings.php | Settings.forget | public function forget($key)
{
$this->database->table($this->config['db_table'])->where('setting_key', $key)->delete();
$this->cache->forget($key);
} | php | public function forget($key)
{
$this->database->table($this->config['db_table'])->where('setting_key', $key)->delete();
$this->cache->forget($key);
} | [
"public",
"function",
"forget",
"(",
"$",
"key",
")",
"{",
"$",
"this",
"->",
"database",
"->",
"table",
"(",
"$",
"this",
"->",
"config",
"[",
"'db_table'",
"]",
")",
"->",
"where",
"(",
"'setting_key'",
",",
"$",
"key",
")",
"->",
"delete",
"(",
... | Remove a setting
@param string $key
@return void | [
"Remove",
"a",
"setting"
] | c45a166ce18ffdc27040515c0608f23225ccc813 | https://github.com/efriandika/laravel-settings/blob/c45a166ce18ffdc27040515c0608f23225ccc813/src/Settings.php#L140-L144 |
192,367 | asika32764/minify | src/JsMinifier.php | JsMinifier.minifyDirectToOutput | protected function minifyDirectToOutput($js, $options)
{
$this->initialize($js, $options);
$this->loop();
$this->clean();
} | php | protected function minifyDirectToOutput($js, $options)
{
$this->initialize($js, $options);
$this->loop();
$this->clean();
} | [
"protected",
"function",
"minifyDirectToOutput",
"(",
"$",
"js",
",",
"$",
"options",
")",
"{",
"$",
"this",
"->",
"initialize",
"(",
"$",
"js",
",",
"$",
"options",
")",
";",
"$",
"this",
"->",
"loop",
"(",
")",
";",
"$",
"this",
"->",
"clean",
"(... | Processes a javascript string and outputs only the required characters,
stripping out all unneeded characters.
@param string $js The raw javascript to be minified
@param array $options Various runtime options in an associative array | [
"Processes",
"a",
"javascript",
"string",
"and",
"outputs",
"only",
"the",
"required",
"characters",
"stripping",
"out",
"all",
"unneeded",
"characters",
"."
] | b19ee05208fcd3628d5ba58040a71e36166e20ae | https://github.com/asika32764/minify/blob/b19ee05208fcd3628d5ba58040a71e36166e20ae/src/JsMinifier.php#L119-L124 |
192,368 | asika32764/minify | src/JsMinifier.php | JsMinifier.initialize | protected function initialize($js, $options)
{
$this->options = array_merge(static::$defaultOptions, $options);
$js = str_replace("\r\n", "\n", $js);
$js = str_replace('/**/', '', $js);
$this->input = str_replace("\r", "\n", $js);
// We add a newline to the end of the script to make ... | php | protected function initialize($js, $options)
{
$this->options = array_merge(static::$defaultOptions, $options);
$js = str_replace("\r\n", "\n", $js);
$js = str_replace('/**/', '', $js);
$this->input = str_replace("\r", "\n", $js);
// We add a newline to the end of the script to make ... | [
"protected",
"function",
"initialize",
"(",
"$",
"js",
",",
"$",
"options",
")",
"{",
"$",
"this",
"->",
"options",
"=",
"array_merge",
"(",
"static",
"::",
"$",
"defaultOptions",
",",
"$",
"options",
")",
";",
"$",
"js",
"=",
"str_replace",
"(",
"\"\\... | Initializes internal variables, normalizes new lines,
@param string $js The raw javascript to be minified
@param array $options Various runtime options in an associative array | [
"Initializes",
"internal",
"variables",
"normalizes",
"new",
"lines"
] | b19ee05208fcd3628d5ba58040a71e36166e20ae | https://github.com/asika32764/minify/blob/b19ee05208fcd3628d5ba58040a71e36166e20ae/src/JsMinifier.php#L132-L148 |
192,369 | asika32764/minify | src/JsMinifier.php | JsMinifier.clean | protected function clean()
{
unset($this->input);
$this->index = 0;
$this->a = $this->b = '';
unset($this->c);
unset($this->options);
} | php | protected function clean()
{
unset($this->input);
$this->index = 0;
$this->a = $this->b = '';
unset($this->c);
unset($this->options);
} | [
"protected",
"function",
"clean",
"(",
")",
"{",
"unset",
"(",
"$",
"this",
"->",
"input",
")",
";",
"$",
"this",
"->",
"index",
"=",
"0",
";",
"$",
"this",
"->",
"a",
"=",
"$",
"this",
"->",
"b",
"=",
"''",
";",
"unset",
"(",
"$",
"this",
"-... | Resets attributes that do not need to be stored between requests so that
the next request is ready to go. Another reason for this is to make sure
the variables are cleared and are not taking up memory. | [
"Resets",
"attributes",
"that",
"do",
"not",
"need",
"to",
"be",
"stored",
"between",
"requests",
"so",
"that",
"the",
"next",
"request",
"is",
"ready",
"to",
"go",
".",
"Another",
"reason",
"for",
"this",
"is",
"to",
"make",
"sure",
"the",
"variables",
... | b19ee05208fcd3628d5ba58040a71e36166e20ae | https://github.com/asika32764/minify/blob/b19ee05208fcd3628d5ba58040a71e36166e20ae/src/JsMinifier.php#L242-L251 |
192,370 | asika32764/minify | src/JsMinifier.php | JsMinifier.processOneLineComments | protected function processOneLineComments($startIndex)
{
$thirdCommentString = substr($this->input, $this->index, 1);
// kill rest of line
$this->getNext("\n");
if ($thirdCommentString === '@')
{
$endPoint = $this->index - $startIndex;
unset($this->c);
$char = "\n" . substr($this->input, $startInd... | php | protected function processOneLineComments($startIndex)
{
$thirdCommentString = substr($this->input, $this->index, 1);
// kill rest of line
$this->getNext("\n");
if ($thirdCommentString === '@')
{
$endPoint = $this->index - $startIndex;
unset($this->c);
$char = "\n" . substr($this->input, $startInd... | [
"protected",
"function",
"processOneLineComments",
"(",
"$",
"startIndex",
")",
"{",
"$",
"thirdCommentString",
"=",
"substr",
"(",
"$",
"this",
"->",
"input",
",",
"$",
"this",
"->",
"index",
",",
"1",
")",
";",
"// kill rest of line",
"$",
"this",
"->",
... | Removed one line comments, with the exception of some very specific types of
conditional comments.
@param int $startIndex The index point where "getReal" function started
@return string | [
"Removed",
"one",
"line",
"comments",
"with",
"the",
"exception",
"of",
"some",
"very",
"specific",
"types",
"of",
"conditional",
"comments",
"."
] | b19ee05208fcd3628d5ba58040a71e36166e20ae | https://github.com/asika32764/minify/blob/b19ee05208fcd3628d5ba58040a71e36166e20ae/src/JsMinifier.php#L335-L356 |
192,371 | asika32764/minify | src/JsMinifier.php | JsMinifier.processMultiLineComments | protected function processMultiLineComments($startIndex)
{
$this->getChar(); // current C
$thirdCommentString = $this->getChar();
// kill everything up to the next */ if it's there
if ($this->getNext('*/'))
{
$this->getChar(); // get *
$this->getChar(); // get /
$char = $this->getChar(); // get nex... | php | protected function processMultiLineComments($startIndex)
{
$this->getChar(); // current C
$thirdCommentString = $this->getChar();
// kill everything up to the next */ if it's there
if ($this->getNext('*/'))
{
$this->getChar(); // get *
$this->getChar(); // get /
$char = $this->getChar(); // get nex... | [
"protected",
"function",
"processMultiLineComments",
"(",
"$",
"startIndex",
")",
"{",
"$",
"this",
"->",
"getChar",
"(",
")",
";",
"// current C",
"$",
"thirdCommentString",
"=",
"$",
"this",
"->",
"getChar",
"(",
")",
";",
"// kill everything up to the next */ i... | Skips multiline comments where appropriate, and includes them where needed.
Conditional comments and "license" style blocks are preserved.
@param int $startIndex The index point where "getReal" function started
@return bool|string False if there's no character
@throws \RuntimeException Unclosed comments will t... | [
"Skips",
"multiline",
"comments",
"where",
"appropriate",
"and",
"includes",
"them",
"where",
"needed",
".",
"Conditional",
"comments",
"and",
"license",
"style",
"blocks",
"are",
"preserved",
"."
] | b19ee05208fcd3628d5ba58040a71e36166e20ae | https://github.com/asika32764/minify/blob/b19ee05208fcd3628d5ba58040a71e36166e20ae/src/JsMinifier.php#L367-L423 |
192,372 | asika32764/minify | src/JsMinifier.php | JsMinifier.getNext | protected function getNext($string)
{
// Find the next occurrence of "string" after the current position.
$pos = strpos($this->input, $string, $this->index);
// If it's not there return false.
if ($pos === false)
{
return false;
}
// Adjust position of index to jump ahead to the asked for string
... | php | protected function getNext($string)
{
// Find the next occurrence of "string" after the current position.
$pos = strpos($this->input, $string, $this->index);
// If it's not there return false.
if ($pos === false)
{
return false;
}
// Adjust position of index to jump ahead to the asked for string
... | [
"protected",
"function",
"getNext",
"(",
"$",
"string",
")",
"{",
"// Find the next occurrence of \"string\" after the current position.",
"$",
"pos",
"=",
"strpos",
"(",
"$",
"this",
"->",
"input",
",",
"$",
"string",
",",
"$",
"this",
"->",
"index",
")",
";",
... | Pushes the index ahead to the next instance of the supplied string. If it
is found the first character of the string is returned and the index is set
to it's position.
@param string $string
@return string|false Returns the first character of the string or false. | [
"Pushes",
"the",
"index",
"ahead",
"to",
"the",
"next",
"instance",
"of",
"the",
"supplied",
"string",
".",
"If",
"it",
"is",
"found",
"the",
"first",
"character",
"of",
"the",
"string",
"is",
"returned",
"and",
"the",
"index",
"is",
"set",
"to",
"it",
... | b19ee05208fcd3628d5ba58040a71e36166e20ae | https://github.com/asika32764/minify/blob/b19ee05208fcd3628d5ba58040a71e36166e20ae/src/JsMinifier.php#L434-L451 |
192,373 | asika32764/minify | src/JsMinifier.php | JsMinifier.saveString | protected function saveString()
{
$startpos = $this->index;
// saveString is always called after a gets cleared, so we push b into
// that spot.
$this->a = $this->b;
// If this isn't a string we don't need to do anything.
if ($this->a !== "'" && $this->a !== '"')
{
return;
}
// String type is t... | php | protected function saveString()
{
$startpos = $this->index;
// saveString is always called after a gets cleared, so we push b into
// that spot.
$this->a = $this->b;
// If this isn't a string we don't need to do anything.
if ($this->a !== "'" && $this->a !== '"')
{
return;
}
// String type is t... | [
"protected",
"function",
"saveString",
"(",
")",
"{",
"$",
"startpos",
"=",
"$",
"this",
"->",
"index",
";",
"// saveString is always called after a gets cleared, so we push b into",
"// that spot.",
"$",
"this",
"->",
"a",
"=",
"$",
"this",
"->",
"b",
";",
"// If... | When a javascript string is detected this function crawls for the end of
it and saves the whole string.
@throws \RuntimeException Unclosed strings will throw an error | [
"When",
"a",
"javascript",
"string",
"is",
"detected",
"this",
"function",
"crawls",
"for",
"the",
"end",
"of",
"it",
"and",
"saves",
"the",
"whole",
"string",
"."
] | b19ee05208fcd3628d5ba58040a71e36166e20ae | https://github.com/asika32764/minify/blob/b19ee05208fcd3628d5ba58040a71e36166e20ae/src/JsMinifier.php#L459-L526 |
192,374 | asika32764/minify | src/JsMinifier.php | JsMinifier.saveRegex | protected function saveRegex()
{
echo $this->a . $this->b;
while (($this->a = $this->getChar()) !== false)
{
if ($this->a === '/')
{
break;
}
if ($this->a === '\\')
{
echo $this->a;
$this->a = $this->getChar();
}
if ($this->a === "\n")
{
throw new \RuntimeException('Unc... | php | protected function saveRegex()
{
echo $this->a . $this->b;
while (($this->a = $this->getChar()) !== false)
{
if ($this->a === '/')
{
break;
}
if ($this->a === '\\')
{
echo $this->a;
$this->a = $this->getChar();
}
if ($this->a === "\n")
{
throw new \RuntimeException('Unc... | [
"protected",
"function",
"saveRegex",
"(",
")",
"{",
"echo",
"$",
"this",
"->",
"a",
".",
"$",
"this",
"->",
"b",
";",
"while",
"(",
"(",
"$",
"this",
"->",
"a",
"=",
"$",
"this",
"->",
"getChar",
"(",
")",
")",
"!==",
"false",
")",
"{",
"if",
... | When a regular expression is detected this function crawls for the end of
it and saves the whole regex.
@throws \RuntimeException Unclosed regex will throw an error | [
"When",
"a",
"regular",
"expression",
"is",
"detected",
"this",
"function",
"crawls",
"for",
"the",
"end",
"of",
"it",
"and",
"saves",
"the",
"whole",
"regex",
"."
] | b19ee05208fcd3628d5ba58040a71e36166e20ae | https://github.com/asika32764/minify/blob/b19ee05208fcd3628d5ba58040a71e36166e20ae/src/JsMinifier.php#L534-L560 |
192,375 | asika32764/minify | src/JsMinifier.php | JsMinifier.lock | protected function lock($js)
{
/* lock things like <code>"asd" + ++x;</code> */
$lock = '"LOCK---' . crc32(time()) . '"';
$matches = array();
preg_match('/([+-])(\s+)([+-])/S', $js, $matches);
if (empty($matches))
{
return $js;
}
$this->locks[$lock] = $matches[2];
$js = preg_replace('/([+-])\s+... | php | protected function lock($js)
{
/* lock things like <code>"asd" + ++x;</code> */
$lock = '"LOCK---' . crc32(time()) . '"';
$matches = array();
preg_match('/([+-])(\s+)([+-])/S', $js, $matches);
if (empty($matches))
{
return $js;
}
$this->locks[$lock] = $matches[2];
$js = preg_replace('/([+-])\s+... | [
"protected",
"function",
"lock",
"(",
"$",
"js",
")",
"{",
"/* lock things like <code>\"asd\" + ++x;</code> */",
"$",
"lock",
"=",
"'\"LOCK---'",
".",
"crc32",
"(",
"time",
"(",
")",
")",
".",
"'\"'",
";",
"$",
"matches",
"=",
"array",
"(",
")",
";",
"preg... | Replace patterns in the given string and store the replacement
@param string $js The string to lock
@return bool | [
"Replace",
"patterns",
"in",
"the",
"given",
"string",
"and",
"store",
"the",
"replacement"
] | b19ee05208fcd3628d5ba58040a71e36166e20ae | https://github.com/asika32764/minify/blob/b19ee05208fcd3628d5ba58040a71e36166e20ae/src/JsMinifier.php#L581-L600 |
192,376 | asika32764/minify | src/JsMinifier.php | JsMinifier.unlock | protected function unlock($js)
{
if (empty($this->locks))
{
return $js;
}
foreach ($this->locks as $lock => $replacement)
{
$js = str_replace($lock, $replacement, $js);
}
return $js;
} | php | protected function unlock($js)
{
if (empty($this->locks))
{
return $js;
}
foreach ($this->locks as $lock => $replacement)
{
$js = str_replace($lock, $replacement, $js);
}
return $js;
} | [
"protected",
"function",
"unlock",
"(",
"$",
"js",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"locks",
")",
")",
"{",
"return",
"$",
"js",
";",
"}",
"foreach",
"(",
"$",
"this",
"->",
"locks",
"as",
"$",
"lock",
"=>",
"$",
"replacement... | Replace "locks" with the original characters
@param string $js The string to unlock
@return bool | [
"Replace",
"locks",
"with",
"the",
"original",
"characters"
] | b19ee05208fcd3628d5ba58040a71e36166e20ae | https://github.com/asika32764/minify/blob/b19ee05208fcd3628d5ba58040a71e36166e20ae/src/JsMinifier.php#L609-L622 |
192,377 | Indaxia/doctrine-orm-transformations | src/Traits/Transformable.php | Transformable.getEntityFullName | protected static function getEntityFullName(\ReflectionClass $headRefClass, $name = null) {
if($name && $name[0] !== "\\") {
$ns = $headRefClass->getNamespaceName();
if($ns) {
$name = $ns."\\".$name;
}
} else {
$name = $headRefClass->getN... | php | protected static function getEntityFullName(\ReflectionClass $headRefClass, $name = null) {
if($name && $name[0] !== "\\") {
$ns = $headRefClass->getNamespaceName();
if($ns) {
$name = $ns."\\".$name;
}
} else {
$name = $headRefClass->getN... | [
"protected",
"static",
"function",
"getEntityFullName",
"(",
"\\",
"ReflectionClass",
"$",
"headRefClass",
",",
"$",
"name",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"name",
"&&",
"$",
"name",
"[",
"0",
"]",
"!==",
"\"\\\\\"",
")",
"{",
"$",
"ns",
"=",
... | Doctrine replaces Entity class with Proxy class, so remove proxy namespace from results. | [
"Doctrine",
"replaces",
"Entity",
"class",
"with",
"Proxy",
"class",
"so",
"remove",
"proxy",
"namespace",
"from",
"results",
"."
] | 3fb41c2d7575a933d93e183884d3e247e29c0c14 | https://github.com/Indaxia/doctrine-orm-transformations/blob/3fb41c2d7575a933d93e183884d3e247e29c0c14/src/Traits/Transformable.php#L515-L528 |
192,378 | digiaonline/lumen-doctrine | src/DoctrineServiceProvider.php | DoctrineServiceProvider.createEntityManager | protected function createEntityManager(ConfigRepository $config)
{
if (!isset($config['doctrine'])) {
throw new Exception('Doctrine configuration not registered.');
}
if (!isset($config['database'])) {
throw new Exception('Database configuration not registered.');
... | php | protected function createEntityManager(ConfigRepository $config)
{
if (!isset($config['doctrine'])) {
throw new Exception('Doctrine configuration not registered.');
}
if (!isset($config['database'])) {
throw new Exception('Database configuration not registered.');
... | [
"protected",
"function",
"createEntityManager",
"(",
"ConfigRepository",
"$",
"config",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"config",
"[",
"'doctrine'",
"]",
")",
")",
"{",
"throw",
"new",
"Exception",
"(",
"'Doctrine configuration not registered.'",
")... | Creates the Doctrine entity manager instance.
@param ConfigRepository $config
@return EntityManager
@throws Exception
@throws \Doctrine\ORM\ORMException | [
"Creates",
"the",
"Doctrine",
"entity",
"manager",
"instance",
"."
] | a7cec36dd49616aa8e86fc1cca05203c4502ea1f | https://github.com/digiaonline/lumen-doctrine/blob/a7cec36dd49616aa8e86fc1cca05203c4502ea1f/src/DoctrineServiceProvider.php#L97-L132 |
192,379 | digiaonline/lumen-doctrine | src/DoctrineServiceProvider.php | DoctrineServiceProvider.createConnectionConfig | protected function createConnectionConfig(array $doctrineConfig, array $databaseConfig)
{
$connectionName = array_get($doctrineConfig, 'connection', $databaseConfig['default']);
$connectionConfig = array_get($databaseConfig['connections'], $connectionName);
if ($connectionConfig === null)... | php | protected function createConnectionConfig(array $doctrineConfig, array $databaseConfig)
{
$connectionName = array_get($doctrineConfig, 'connection', $databaseConfig['default']);
$connectionConfig = array_get($databaseConfig['connections'], $connectionName);
if ($connectionConfig === null)... | [
"protected",
"function",
"createConnectionConfig",
"(",
"array",
"$",
"doctrineConfig",
",",
"array",
"$",
"databaseConfig",
")",
"{",
"$",
"connectionName",
"=",
"array_get",
"(",
"$",
"doctrineConfig",
",",
"'connection'",
",",
"$",
"databaseConfig",
"[",
"'defa... | Creates the Doctrine connection configuration.
@param array $doctrineConfig
@param array $databaseConfig
@return array
@throws Exception | [
"Creates",
"the",
"Doctrine",
"connection",
"configuration",
"."
] | a7cec36dd49616aa8e86fc1cca05203c4502ea1f | https://github.com/digiaonline/lumen-doctrine/blob/a7cec36dd49616aa8e86fc1cca05203c4502ea1f/src/DoctrineServiceProvider.php#L144-L154 |
192,380 | digiaonline/lumen-doctrine | src/DoctrineServiceProvider.php | DoctrineServiceProvider.normalizeConnectionConfig | protected function normalizeConnectionConfig(array $config)
{
$adapter = $this->createConfigurationAdapter($config['driver']);
$configuration = new ConnectionConfiguration($adapter);
return $configuration->map($config);
} | php | protected function normalizeConnectionConfig(array $config)
{
$adapter = $this->createConfigurationAdapter($config['driver']);
$configuration = new ConnectionConfiguration($adapter);
return $configuration->map($config);
} | [
"protected",
"function",
"normalizeConnectionConfig",
"(",
"array",
"$",
"config",
")",
"{",
"$",
"adapter",
"=",
"$",
"this",
"->",
"createConfigurationAdapter",
"(",
"$",
"config",
"[",
"'driver'",
"]",
")",
";",
"$",
"configuration",
"=",
"new",
"Connection... | Normalizes the connection config to a format Doctrine can use.
@param array $config
@return array
@throws \Exception | [
"Normalizes",
"the",
"connection",
"config",
"to",
"a",
"format",
"Doctrine",
"can",
"use",
"."
] | a7cec36dd49616aa8e86fc1cca05203c4502ea1f | https://github.com/digiaonline/lumen-doctrine/blob/a7cec36dd49616aa8e86fc1cca05203c4502ea1f/src/DoctrineServiceProvider.php#L165-L172 |
192,381 | digiaonline/lumen-doctrine | src/DoctrineServiceProvider.php | DoctrineServiceProvider.createMetadataConfiguration | protected function createMetadataConfiguration(
$type,
$paths,
$isDevMode,
$proxyDir,
$cache,
$useSimpleAnnotationReader = true
) {
switch ($type) {
case self::METADATA_ANNOTATIONS:
return Setup::createAnnotationMetadataConfiguratio... | php | protected function createMetadataConfiguration(
$type,
$paths,
$isDevMode,
$proxyDir,
$cache,
$useSimpleAnnotationReader = true
) {
switch ($type) {
case self::METADATA_ANNOTATIONS:
return Setup::createAnnotationMetadataConfiguratio... | [
"protected",
"function",
"createMetadataConfiguration",
"(",
"$",
"type",
",",
"$",
"paths",
",",
"$",
"isDevMode",
",",
"$",
"proxyDir",
",",
"$",
"cache",
",",
"$",
"useSimpleAnnotationReader",
"=",
"true",
")",
"{",
"switch",
"(",
"$",
"type",
")",
"{",... | Creates the metadata configuration instance.
@param string $type
@param array $paths
@param bool $isDevMode
@param string $proxyDir
@param Cache $cache
@param bool $useSimpleAnnotationReader
@return Configuration
@throws \Exception | [
"Creates",
"the",
"metadata",
"configuration",
"instance",
"."
] | a7cec36dd49616aa8e86fc1cca05203c4502ea1f | https://github.com/digiaonline/lumen-doctrine/blob/a7cec36dd49616aa8e86fc1cca05203c4502ea1f/src/DoctrineServiceProvider.php#L209-L228 |
192,382 | digiaonline/lumen-doctrine | src/DoctrineServiceProvider.php | DoctrineServiceProvider.configureMetadataConfiguration | protected function configureMetadataConfiguration(
Configuration $configuration,
array $doctrineConfig
) {
if (isset($doctrineConfig['filters'])) {
foreach ($doctrineConfig['filters'] as $name => $filter) {
$configuration->addFilter($name, $filter['class']);
... | php | protected function configureMetadataConfiguration(
Configuration $configuration,
array $doctrineConfig
) {
if (isset($doctrineConfig['filters'])) {
foreach ($doctrineConfig['filters'] as $name => $filter) {
$configuration->addFilter($name, $filter['class']);
... | [
"protected",
"function",
"configureMetadataConfiguration",
"(",
"Configuration",
"$",
"configuration",
",",
"array",
"$",
"doctrineConfig",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"doctrineConfig",
"[",
"'filters'",
"]",
")",
")",
"{",
"foreach",
"(",
"$",
"do... | Configures the metadata configuration instance.
@param Configuration $configuration
@param array $doctrineConfig
@throws ORMException | [
"Configures",
"the",
"metadata",
"configuration",
"instance",
"."
] | a7cec36dd49616aa8e86fc1cca05203c4502ea1f | https://github.com/digiaonline/lumen-doctrine/blob/a7cec36dd49616aa8e86fc1cca05203c4502ea1f/src/DoctrineServiceProvider.php#L239-L263 |
192,383 | digiaonline/lumen-doctrine | src/DoctrineServiceProvider.php | DoctrineServiceProvider.configureEventManager | protected function configureEventManager(array $doctrineConfig, EventManager $eventManager)
{
if (isset($doctrineConfig['event_listeners'])) {
foreach ($doctrineConfig['event_listeners'] as $name => $listener) {
$eventManager->addEventListener($listener['events'], new $listener['... | php | protected function configureEventManager(array $doctrineConfig, EventManager $eventManager)
{
if (isset($doctrineConfig['event_listeners'])) {
foreach ($doctrineConfig['event_listeners'] as $name => $listener) {
$eventManager->addEventListener($listener['events'], new $listener['... | [
"protected",
"function",
"configureEventManager",
"(",
"array",
"$",
"doctrineConfig",
",",
"EventManager",
"$",
"eventManager",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"doctrineConfig",
"[",
"'event_listeners'",
"]",
")",
")",
"{",
"foreach",
"(",
"$",
"doctr... | Configures the Doctrine event manager instance.
@param array $doctrineConfig
@param EventManager $eventManager | [
"Configures",
"the",
"Doctrine",
"event",
"manager",
"instance",
"."
] | a7cec36dd49616aa8e86fc1cca05203c4502ea1f | https://github.com/digiaonline/lumen-doctrine/blob/a7cec36dd49616aa8e86fc1cca05203c4502ea1f/src/DoctrineServiceProvider.php#L272-L279 |
192,384 | digiaonline/lumen-doctrine | src/DoctrineServiceProvider.php | DoctrineServiceProvider.configureEntityManager | protected function configureEntityManager(array $doctrineConfig, EntityManager $entityManager)
{
if (isset($doctrineConfig['filters'])) {
foreach ($doctrineConfig['filters'] as $name => $filter) {
if (!array_get($filter, 'enabled', false)) {
continue;
... | php | protected function configureEntityManager(array $doctrineConfig, EntityManager $entityManager)
{
if (isset($doctrineConfig['filters'])) {
foreach ($doctrineConfig['filters'] as $name => $filter) {
if (!array_get($filter, 'enabled', false)) {
continue;
... | [
"protected",
"function",
"configureEntityManager",
"(",
"array",
"$",
"doctrineConfig",
",",
"EntityManager",
"$",
"entityManager",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"doctrineConfig",
"[",
"'filters'",
"]",
")",
")",
"{",
"foreach",
"(",
"$",
"doctrineCo... | Configures the Doctrine entity manager instance.
@param array $doctrineConfig
@param EntityManager $entityManager | [
"Configures",
"the",
"Doctrine",
"entity",
"manager",
"instance",
"."
] | a7cec36dd49616aa8e86fc1cca05203c4502ea1f | https://github.com/digiaonline/lumen-doctrine/blob/a7cec36dd49616aa8e86fc1cca05203c4502ea1f/src/DoctrineServiceProvider.php#L288-L308 |
192,385 | 2gis/webapi-client | src/DGApiClient/Mappers/AbstractMapper.php | AbstractMapper.keyToMethodName | protected static function keyToMethodName($keyName, $capitalizeFirstCharacter = false)
{
$str = str_replace(' ', '', ucwords(str_replace('_', ' ', $keyName)));
if (!$capitalizeFirstCharacter) {
$str = lcfirst($str);
}
return $str;
} | php | protected static function keyToMethodName($keyName, $capitalizeFirstCharacter = false)
{
$str = str_replace(' ', '', ucwords(str_replace('_', ' ', $keyName)));
if (!$capitalizeFirstCharacter) {
$str = lcfirst($str);
}
return $str;
} | [
"protected",
"static",
"function",
"keyToMethodName",
"(",
"$",
"keyName",
",",
"$",
"capitalizeFirstCharacter",
"=",
"false",
")",
"{",
"$",
"str",
"=",
"str_replace",
"(",
"' '",
",",
"''",
",",
"ucwords",
"(",
"str_replace",
"(",
"'_'",
",",
"' '",
",",... | Convert some_variable_name to someVariableName
@param string $keyName
@param bool $capitalizeFirstCharacter
@return string | [
"Convert",
"some_variable_name",
"to",
"someVariableName"
] | f028f71943ddbb1a06243127b92bbffe78f70bbd | https://github.com/2gis/webapi-client/blob/f028f71943ddbb1a06243127b92bbffe78f70bbd/src/DGApiClient/Mappers/AbstractMapper.php#L79-L86 |
192,386 | Indaxia/doctrine-orm-transformations | src/Annotations/Annotation.php | Annotation.insideOf | public function insideOf(Annotation $a = null) {
if($a) { $this->nested = $a->nested; }
return $this;
} | php | public function insideOf(Annotation $a = null) {
if($a) { $this->nested = $a->nested; }
return $this;
} | [
"public",
"function",
"insideOf",
"(",
"Annotation",
"$",
"a",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"a",
")",
"{",
"$",
"this",
"->",
"nested",
"=",
"$",
"a",
"->",
"nested",
";",
"}",
"return",
"$",
"this",
";",
"}"
] | Include sub-policy list from the existing policy
@param array
@return Annotation | [
"Include",
"sub",
"-",
"policy",
"list",
"from",
"the",
"existing",
"policy"
] | 3fb41c2d7575a933d93e183884d3e247e29c0c14 | https://github.com/Indaxia/doctrine-orm-transformations/blob/3fb41c2d7575a933d93e183884d3e247e29c0c14/src/Annotations/Annotation.php#L49-L52 |
192,387 | mtdowling/php-supervisor-event | src/Mtdowling/Supervisor/EventNotification.php | EventNotification.parseData | public static function parseData($data)
{
$parsed = array();
foreach (explode(' ', $data) as $pair) {
if (strpos($pair, ':') > 0) {
list($key, $value) = array_map('trim', explode(':', $pair));
$parsed[$key] = $value;
}
}
return... | php | public static function parseData($data)
{
$parsed = array();
foreach (explode(' ', $data) as $pair) {
if (strpos($pair, ':') > 0) {
list($key, $value) = array_map('trim', explode(':', $pair));
$parsed[$key] = $value;
}
}
return... | [
"public",
"static",
"function",
"parseData",
"(",
"$",
"data",
")",
"{",
"$",
"parsed",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"explode",
"(",
"' '",
",",
"$",
"data",
")",
"as",
"$",
"pair",
")",
"{",
"if",
"(",
"strpos",
"(",
"$",
"pair",... | Parse a colon and space separated string into an array
@param string $data Data to parse
@return array | [
"Parse",
"a",
"colon",
"and",
"space",
"separated",
"string",
"into",
"an",
"array"
] | f151603e47236bdcb77bac78ef4072ce9661577c | https://github.com/mtdowling/php-supervisor-event/blob/f151603e47236bdcb77bac78ef4072ce9661577c/src/Mtdowling/Supervisor/EventNotification.php#L63-L74 |
192,388 | Indaxia/doctrine-orm-transformations | src/Annotations/PolicyResolver.php | PolicyResolver.merge | public function merge(array $policies) {
$last = reset($policies);
for($i = 1; $i < count($policies); ++$i) {
if($policies[$i]->isPriorityGreaterThanOrEqualTo($last)) {
$last = $policies[$i];
}
}
return $last;
} | php | public function merge(array $policies) {
$last = reset($policies);
for($i = 1; $i < count($policies); ++$i) {
if($policies[$i]->isPriorityGreaterThanOrEqualTo($last)) {
$last = $policies[$i];
}
}
return $last;
} | [
"public",
"function",
"merge",
"(",
"array",
"$",
"policies",
")",
"{",
"$",
"last",
"=",
"reset",
"(",
"$",
"policies",
")",
";",
"for",
"(",
"$",
"i",
"=",
"1",
";",
"$",
"i",
"<",
"count",
"(",
"$",
"policies",
")",
";",
"++",
"$",
"i",
")... | Merges property list into priority one and returns it
@param array $policies list of policies to merge
@return Policy\Interfaces\Policy | [
"Merges",
"property",
"list",
"into",
"priority",
"one",
"and",
"returns",
"it"
] | 3fb41c2d7575a933d93e183884d3e247e29c0c14 | https://github.com/Indaxia/doctrine-orm-transformations/blob/3fb41c2d7575a933d93e183884d3e247e29c0c14/src/Annotations/PolicyResolver.php#L119-L127 |
192,389 | ARCANEDEV/LaravelTracker | src/Trackers/VisitorActivityTracker.php | VisitorActivityTracker.track | public function track(array $data)
{
$model = $this->getModel()->fill($data);
$model->save();
return $model->getKey();
} | php | public function track(array $data)
{
$model = $this->getModel()->fill($data);
$model->save();
return $model->getKey();
} | [
"public",
"function",
"track",
"(",
"array",
"$",
"data",
")",
"{",
"$",
"model",
"=",
"$",
"this",
"->",
"getModel",
"(",
")",
"->",
"fill",
"(",
"$",
"data",
")",
";",
"$",
"model",
"->",
"save",
"(",
")",
";",
"return",
"$",
"model",
"->",
"... | Track the visitor activity.
@param array $data
@return int | [
"Track",
"the",
"visitor",
"activity",
"."
] | 9bd728dd89ea7e10ea8b92efa2af9ab9d99dcab6 | https://github.com/ARCANEDEV/LaravelTracker/blob/9bd728dd89ea7e10ea8b92efa2af9ab9d99dcab6/src/Trackers/VisitorActivityTracker.php#L41-L47 |
192,390 | ARCANEDEV/LaravelTracker | src/Trackers/RouteTracker.php | RouteTracker.trackRoute | private function trackRoute(Route $route)
{
return $this->getModel()->newQuery()->firstOrCreate([
'name' => $this->getRouteName($route),
'action' => $route->getActionName(),
])->getKey();
} | php | private function trackRoute(Route $route)
{
return $this->getModel()->newQuery()->firstOrCreate([
'name' => $this->getRouteName($route),
'action' => $route->getActionName(),
])->getKey();
} | [
"private",
"function",
"trackRoute",
"(",
"Route",
"$",
"route",
")",
"{",
"return",
"$",
"this",
"->",
"getModel",
"(",
")",
"->",
"newQuery",
"(",
")",
"->",
"firstOrCreate",
"(",
"[",
"'name'",
"=>",
"$",
"this",
"->",
"getRouteName",
"(",
"$",
"rou... | Track the current route.
@param \Illuminate\Routing\Route $route
@return int | [
"Track",
"the",
"current",
"route",
"."
] | 9bd728dd89ea7e10ea8b92efa2af9ab9d99dcab6 | https://github.com/ARCANEDEV/LaravelTracker/blob/9bd728dd89ea7e10ea8b92efa2af9ab9d99dcab6/src/Trackers/RouteTracker.php#L79-L85 |
192,391 | ARCANEDEV/LaravelTracker | src/Trackers/RouteTracker.php | RouteTracker.checkPatterns | private function checkPatterns($value, array $patterns)
{
foreach ($patterns as $pattern) {
if (Str::is($pattern, $value)) return true;
}
return false;
} | php | private function checkPatterns($value, array $patterns)
{
foreach ($patterns as $pattern) {
if (Str::is($pattern, $value)) return true;
}
return false;
} | [
"private",
"function",
"checkPatterns",
"(",
"$",
"value",
",",
"array",
"$",
"patterns",
")",
"{",
"foreach",
"(",
"$",
"patterns",
"as",
"$",
"pattern",
")",
"{",
"if",
"(",
"Str",
"::",
"is",
"(",
"$",
"pattern",
",",
"$",
"value",
")",
")",
"re... | Check if the value match the given patterns.
@param string|null $value
@param array $patterns
@return bool | [
"Check",
"if",
"the",
"value",
"match",
"the",
"given",
"patterns",
"."
] | 9bd728dd89ea7e10ea8b92efa2af9ab9d99dcab6 | https://github.com/ARCANEDEV/LaravelTracker/blob/9bd728dd89ea7e10ea8b92efa2af9ab9d99dcab6/src/Trackers/RouteTracker.php#L123-L130 |
192,392 | ARCANEDEV/LaravelTracker | src/Trackers/RouteTracker.php | RouteTracker.trackRoutePath | private function trackRoutePath(Route $route, Request $request, $routeId)
{
/** @var \Arcanedev\LaravelTracker\Models\RoutePath $model */
$model = $this->makeModel(BindingManager::MODEL_ROUTE_PATH)->firstOrCreate([
'route_id' => $routeId,
'path' => $request->path(),
... | php | private function trackRoutePath(Route $route, Request $request, $routeId)
{
/** @var \Arcanedev\LaravelTracker\Models\RoutePath $model */
$model = $this->makeModel(BindingManager::MODEL_ROUTE_PATH)->firstOrCreate([
'route_id' => $routeId,
'path' => $request->path(),
... | [
"private",
"function",
"trackRoutePath",
"(",
"Route",
"$",
"route",
",",
"Request",
"$",
"request",
",",
"$",
"routeId",
")",
"{",
"/** @var \\Arcanedev\\LaravelTracker\\Models\\RoutePath $model */",
"$",
"model",
"=",
"$",
"this",
"->",
"makeModel",
"(",
"Bindin... | Track the route path.
@param \Illuminate\Routing\Route $route
@param \Illuminate\Http\Request $request
@param int $routeId
@return int | [
"Track",
"the",
"route",
"path",
"."
] | 9bd728dd89ea7e10ea8b92efa2af9ab9d99dcab6 | https://github.com/ARCANEDEV/LaravelTracker/blob/9bd728dd89ea7e10ea8b92efa2af9ab9d99dcab6/src/Trackers/RouteTracker.php#L153-L165 |
192,393 | ARCANEDEV/LaravelTracker | src/Trackers/RouteTracker.php | RouteTracker.trackRoutePathParameters | private function trackRoutePathParameters(Route $route, Models\RoutePath $routePath)
{
$parameters = [];
if ($route->hasParameters()) {
foreach ($route->parameters() as $parameter => $value) {
$parameters[] = $this->makeModel(BindingManager::MODEL_ROUTE_PATH_PARAMETER)->... | php | private function trackRoutePathParameters(Route $route, Models\RoutePath $routePath)
{
$parameters = [];
if ($route->hasParameters()) {
foreach ($route->parameters() as $parameter => $value) {
$parameters[] = $this->makeModel(BindingManager::MODEL_ROUTE_PATH_PARAMETER)->... | [
"private",
"function",
"trackRoutePathParameters",
"(",
"Route",
"$",
"route",
",",
"Models",
"\\",
"RoutePath",
"$",
"routePath",
")",
"{",
"$",
"parameters",
"=",
"[",
"]",
";",
"if",
"(",
"$",
"route",
"->",
"hasParameters",
"(",
")",
")",
"{",
"forea... | Track the route path parameters.
@param \Illuminate\Routing\Route $route
@param \Arcanedev\LaravelTracker\Models\RoutePath $routePath | [
"Track",
"the",
"route",
"path",
"parameters",
"."
] | 9bd728dd89ea7e10ea8b92efa2af9ab9d99dcab6 | https://github.com/ARCANEDEV/LaravelTracker/blob/9bd728dd89ea7e10ea8b92efa2af9ab9d99dcab6/src/Trackers/RouteTracker.php#L173-L188 |
192,394 | ARCANEDEV/LaravelTracker | src/Trackers/RouteTracker.php | RouteTracker.checkIfValueIsEloquentModel | private function checkIfValueIsEloquentModel($value)
{
if ($value instanceof EloquentModel) {
foreach ($this->getConfig('routes.model-columns', ['id']) as $column) {
if (
array_key_exists($column, $attributes = $value->getAttributes()) &&
!... | php | private function checkIfValueIsEloquentModel($value)
{
if ($value instanceof EloquentModel) {
foreach ($this->getConfig('routes.model-columns', ['id']) as $column) {
if (
array_key_exists($column, $attributes = $value->getAttributes()) &&
!... | [
"private",
"function",
"checkIfValueIsEloquentModel",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"value",
"instanceof",
"EloquentModel",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"getConfig",
"(",
"'routes.model-columns'",
",",
"[",
"'id'",
"]",
")",
"a... | Check if the value is an eloquent model.
@param mixed $value
@return mixed | [
"Check",
"if",
"the",
"value",
"is",
"an",
"eloquent",
"model",
"."
] | 9bd728dd89ea7e10ea8b92efa2af9ab9d99dcab6 | https://github.com/ARCANEDEV/LaravelTracker/blob/9bd728dd89ea7e10ea8b92efa2af9ab9d99dcab6/src/Trackers/RouteTracker.php#L197-L211 |
192,395 | ARCANEDEV/LaravelTracker | src/Trackers/UserTracker.php | UserTracker.instantiateAuthentication | private function instantiateAuthentication()
{
foreach ((array) $this->getConfig('auth.bindings', []) as $binding) {
$this->auths[] = $this->make($binding);
}
} | php | private function instantiateAuthentication()
{
foreach ((array) $this->getConfig('auth.bindings', []) as $binding) {
$this->auths[] = $this->make($binding);
}
} | [
"private",
"function",
"instantiateAuthentication",
"(",
")",
"{",
"foreach",
"(",
"(",
"array",
")",
"$",
"this",
"->",
"getConfig",
"(",
"'auth.bindings'",
",",
"[",
"]",
")",
"as",
"$",
"binding",
")",
"{",
"$",
"this",
"->",
"auths",
"[",
"]",
"=",... | Grab all the authentication bindings. | [
"Grab",
"all",
"the",
"authentication",
"bindings",
"."
] | 9bd728dd89ea7e10ea8b92efa2af9ab9d99dcab6 | https://github.com/ARCANEDEV/LaravelTracker/blob/9bd728dd89ea7e10ea8b92efa2af9ab9d99dcab6/src/Trackers/UserTracker.php#L43-L48 |
192,396 | ARCANEDEV/LaravelTracker | src/Trackers/UserTracker.php | UserTracker.executeAuthMethod | private function executeAuthMethod($method)
{
foreach ($this->auths as $auth) {
if (is_callable([$auth, $method], true)) {
if ($data = $auth->{$method}()) return $data;
}
}
return false;
} | php | private function executeAuthMethod($method)
{
foreach ($this->auths as $auth) {
if (is_callable([$auth, $method], true)) {
if ($data = $auth->{$method}()) return $data;
}
}
return false;
} | [
"private",
"function",
"executeAuthMethod",
"(",
"$",
"method",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"auths",
"as",
"$",
"auth",
")",
"{",
"if",
"(",
"is_callable",
"(",
"[",
"$",
"auth",
",",
"$",
"method",
"]",
",",
"true",
")",
")",
"{",... | Execute the auth method.
@param string $method
@return mixed|false | [
"Execute",
"the",
"auth",
"method",
"."
] | 9bd728dd89ea7e10ea8b92efa2af9ab9d99dcab6 | https://github.com/ARCANEDEV/LaravelTracker/blob/9bd728dd89ea7e10ea8b92efa2af9ab9d99dcab6/src/Trackers/UserTracker.php#L114-L123 |
192,397 | leighmacdonald/php_rbac | src/RBAC/Manager/RoleManager.php | RoleManager.roleAddSubject | public function roleAddSubject(Role $role, SubjectInterface $subject)
{
if ($this->roleAddSubjectId($role, $subject->id())) {
$users_role_set = $subject->getRoleSet();
$users_role_set->addRole($role);
$subject->loadRoleSet($users_role_set);
return true;
... | php | public function roleAddSubject(Role $role, SubjectInterface $subject)
{
if ($this->roleAddSubjectId($role, $subject->id())) {
$users_role_set = $subject->getRoleSet();
$users_role_set->addRole($role);
$subject->loadRoleSet($users_role_set);
return true;
... | [
"public",
"function",
"roleAddSubject",
"(",
"Role",
"$",
"role",
",",
"SubjectInterface",
"$",
"subject",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"roleAddSubjectId",
"(",
"$",
"role",
",",
"$",
"subject",
"->",
"id",
"(",
")",
")",
")",
"{",
"$",
"u... | Add a user to an existing role. This will insert the added role into the users active RoleSet
instance upon successful insertion into the database
@param Role $role Existing role to be added to
@param \RBAC\Subject\SubjectInterface $subject Initialized subject instance
@return bool Database execution success status | [
"Add",
"a",
"user",
"to",
"an",
"existing",
"role",
".",
"This",
"will",
"insert",
"the",
"added",
"role",
"into",
"the",
"users",
"active",
"RoleSet",
"instance",
"upon",
"successful",
"insertion",
"into",
"the",
"database"
] | 8855d6bbfa29e0a5d89f2911d552bc2ab394cf52 | https://github.com/leighmacdonald/php_rbac/blob/8855d6bbfa29e0a5d89f2911d552bc2ab394cf52/src/RBAC/Manager/RoleManager.php#L55-L65 |
192,398 | leighmacdonald/php_rbac | src/RBAC/Manager/RoleManager.php | RoleManager.loadSubjectRoles | public function loadSubjectRoles(SubjectInterface $subject, $permissions = true)
{
//todo cache this.
$role_set = new RoleSet($this->roleFetchSubjectRoles($subject, $permissions));
$subject->loadRoleSet($role_set);
return $subject;
} | php | public function loadSubjectRoles(SubjectInterface $subject, $permissions = true)
{
//todo cache this.
$role_set = new RoleSet($this->roleFetchSubjectRoles($subject, $permissions));
$subject->loadRoleSet($role_set);
return $subject;
} | [
"public",
"function",
"loadSubjectRoles",
"(",
"SubjectInterface",
"$",
"subject",
",",
"$",
"permissions",
"=",
"true",
")",
"{",
"//todo cache this.",
"$",
"role_set",
"=",
"new",
"RoleSet",
"(",
"$",
"this",
"->",
"roleFetchSubjectRoles",
"(",
"$",
"subject",... | Load a user instance with its corresponding RoleSet
@param \RBAC\Subject\SubjectInterface $subject Initialized subject instance
@param bool $permissions
@return \RBAC\Subject\SubjectInterface | [
"Load",
"a",
"user",
"instance",
"with",
"its",
"corresponding",
"RoleSet"
] | 8855d6bbfa29e0a5d89f2911d552bc2ab394cf52 | https://github.com/leighmacdonald/php_rbac/blob/8855d6bbfa29e0a5d89f2911d552bc2ab394cf52/src/RBAC/Manager/RoleManager.php#L74-L80 |
192,399 | leighmacdonald/php_rbac | src/RBAC/Manager/RoleManager.php | RoleManager.roleFetchSubjectRoles | public function roleFetchSubjectRoles(SubjectInterface $subject, $permissions = true)
{
$roles = $this->storage->roleFetchSubjectRoles($subject, $permissions);
if ($permissions) {
$this->roleLoadPermissions($roles);
}
return $roles;
} | php | public function roleFetchSubjectRoles(SubjectInterface $subject, $permissions = true)
{
$roles = $this->storage->roleFetchSubjectRoles($subject, $permissions);
if ($permissions) {
$this->roleLoadPermissions($roles);
}
return $roles;
} | [
"public",
"function",
"roleFetchSubjectRoles",
"(",
"SubjectInterface",
"$",
"subject",
",",
"$",
"permissions",
"=",
"true",
")",
"{",
"$",
"roles",
"=",
"$",
"this",
"->",
"storage",
"->",
"roleFetchSubjectRoles",
"(",
"$",
"subject",
",",
"$",
"permissions"... | Fetch the roles that are associated with the user instance passed in.
@todo cache roles
@param \RBAC\Subject\SubjectInterface $subject Initialized subject instance
@param bool $permissions Load the permission set
@return Role[] Roles the user has assigned | [
"Fetch",
"the",
"roles",
"that",
"are",
"associated",
"with",
"the",
"user",
"instance",
"passed",
"in",
"."
] | 8855d6bbfa29e0a5d89f2911d552bc2ab394cf52 | https://github.com/leighmacdonald/php_rbac/blob/8855d6bbfa29e0a5d89f2911d552bc2ab394cf52/src/RBAC/Manager/RoleManager.php#L90-L97 |
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.