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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
194,200 | ciims/ciims-modules-api | controllers/CommentController.php | CommentController.beforeAction | public function beforeAction($action)
{
if (Cii::getConfig('useDisqusComments'))
throw new CHttpException(403, Yii::t('Api.comment', 'The comment API is not available while Disqus comments are enabled.'));
if (Cii::getConfig('useDiscourceComments'))
throw new CHttpException(403, Yii::t('Api.comment', ... | php | public function beforeAction($action)
{
if (Cii::getConfig('useDisqusComments'))
throw new CHttpException(403, Yii::t('Api.comment', 'The comment API is not available while Disqus comments are enabled.'));
if (Cii::getConfig('useDiscourceComments'))
throw new CHttpException(403, Yii::t('Api.comment', ... | [
"public",
"function",
"beforeAction",
"(",
"$",
"action",
")",
"{",
"if",
"(",
"Cii",
"::",
"getConfig",
"(",
"'useDisqusComments'",
")",
")",
"throw",
"new",
"CHttpException",
"(",
"403",
",",
"Yii",
"::",
"t",
"(",
"'Api.comment'",
",",
"'The comment API i... | If Disqus comments are enabled, disable the entire API
@param CAction $action The action we are using
@return null|boolean | [
"If",
"Disqus",
"comments",
"are",
"enabled",
"disable",
"the",
"entire",
"API"
] | 4351855328da0b112ac27bde7e7e07e212be8689 | https://github.com/ciims/ciims-modules-api/blob/4351855328da0b112ac27bde7e7e07e212be8689/controllers/CommentController.php#L36-L45 |
194,201 | ciims/ciims-modules-api | controllers/CommentController.php | CommentController.getCommentModel | private function getCommentModel($id=NULL)
{
if ($id === NULL)
throw new CHttpException(400, Yii::t('Api.comment', 'Missing id'));
$model = Comments::model()->findByPk($id);
if ($model === NULL)
throw new CHttpException(404, Yii::t('Api.comment', 'Comment #{{id}} was not found.', array('{{id}}' => ... | php | private function getCommentModel($id=NULL)
{
if ($id === NULL)
throw new CHttpException(400, Yii::t('Api.comment', 'Missing id'));
$model = Comments::model()->findByPk($id);
if ($model === NULL)
throw new CHttpException(404, Yii::t('Api.comment', 'Comment #{{id}} was not found.', array('{{id}}' => ... | [
"private",
"function",
"getCommentModel",
"(",
"$",
"id",
"=",
"NULL",
")",
"{",
"if",
"(",
"$",
"id",
"===",
"NULL",
")",
"throw",
"new",
"CHttpException",
"(",
"400",
",",
"Yii",
"::",
"t",
"(",
"'Api.comment'",
",",
"'Missing id'",
")",
")",
";",
... | Retrieves the Comment model
@param int $id The comment model
@return Comment | [
"Retrieves",
"the",
"Comment",
"model"
] | 4351855328da0b112ac27bde7e7e07e212be8689 | https://github.com/ciims/ciims-modules-api/blob/4351855328da0b112ac27bde7e7e07e212be8689/controllers/CommentController.php#L241-L251 |
194,202 | nicmart/Arrayze | src/ArrayAdapterTrait.php | ArrayAdapterTrait.toArray | public function toArray()
{
$ary = [];
foreach ($this as $key => $value) {
$ary[$key] = $value;
}
return $ary;
} | php | public function toArray()
{
$ary = [];
foreach ($this as $key => $value) {
$ary[$key] = $value;
}
return $ary;
} | [
"public",
"function",
"toArray",
"(",
")",
"{",
"$",
"ary",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"$",
"ary",
"[",
"$",
"key",
"]",
"=",
"$",
"value",
";",
"}",
"return",
"$",
"ary",
... | Converts the object to an array
@return array | [
"Converts",
"the",
"object",
"to",
"an",
"array"
] | 7a86c8a661456b5f7055857aeda3e6ee3af05b13 | https://github.com/nicmart/Arrayze/blob/7a86c8a661456b5f7055857aeda3e6ee3af05b13/src/ArrayAdapterTrait.php#L78-L87 |
194,203 | sokil/CommandBusBundle | src/CommandBus.php | CommandBus.addHandlerDefinition | public function addHandlerDefinition($commandClassName, $handlerServiceId)
{
// Check if handler already associated with command
if (isset($this->handlerDefinitions[$commandClassName])) {
throw new \InvalidArgumentException(sprintf(
"Handler with service id '%s' already c... | php | public function addHandlerDefinition($commandClassName, $handlerServiceId)
{
// Check if handler already associated with command
if (isset($this->handlerDefinitions[$commandClassName])) {
throw new \InvalidArgumentException(sprintf(
"Handler with service id '%s' already c... | [
"public",
"function",
"addHandlerDefinition",
"(",
"$",
"commandClassName",
",",
"$",
"handlerServiceId",
")",
"{",
"// Check if handler already associated with command",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"handlerDefinitions",
"[",
"$",
"commandClassName",
"]"... | Add handler definition
@param string $commandClassName
@param string $handlerServiceId
@return CommandBus | [
"Add",
"handler",
"definition"
] | 7cfdd5f1e8a77f0620b94dd5214091a2159a143d | https://github.com/sokil/CommandBusBundle/blob/7cfdd5f1e8a77f0620b94dd5214091a2159a143d/src/CommandBus.php#L37-L54 |
194,204 | alphalemon/BootstrapBundle | Core/Listener/ExecutePostActionsListener.php | ExecutePostActionsListener.onKernelRequest | public function onKernelRequest()
{
if ($this->executed) return;
$installerScript = $this->scriptFactory->createScript('PostBootInstaller');
$installerScript->setContainer($this->container)
->executeActionsFromFile($this->basePath . '/.PostInstall');
... | php | public function onKernelRequest()
{
if ($this->executed) return;
$installerScript = $this->scriptFactory->createScript('PostBootInstaller');
$installerScript->setContainer($this->container)
->executeActionsFromFile($this->basePath . '/.PostInstall');
... | [
"public",
"function",
"onKernelRequest",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"executed",
")",
"return",
";",
"$",
"installerScript",
"=",
"$",
"this",
"->",
"scriptFactory",
"->",
"createScript",
"(",
"'PostBootInstaller'",
")",
";",
"$",
"installer... | Executes the action when the onKernelRequest event is dispatched | [
"Executes",
"the",
"action",
"when",
"the",
"onKernelRequest",
"event",
"is",
"dispatched"
] | 27ff5cbc58d58149ec72a974f2a9d765a6fd37a6 | https://github.com/alphalemon/BootstrapBundle/blob/27ff5cbc58d58149ec72a974f2a9d765a6fd37a6/Core/Listener/ExecutePostActionsListener.php#L35-L48 |
194,205 | indigoram89/laravel-translatable | src/Translatable.php | Translatable.getTranslation | public function getTranslation(string $key, string $locale = null)
{
$this->throwExceptionIfAttributeIsNotTranslatable($key);
$translations = $this->getTranslations($key);
if (count($translations)) {
$locale = $locale ?: config('app.locale');
if (isset($translation... | php | public function getTranslation(string $key, string $locale = null)
{
$this->throwExceptionIfAttributeIsNotTranslatable($key);
$translations = $this->getTranslations($key);
if (count($translations)) {
$locale = $locale ?: config('app.locale');
if (isset($translation... | [
"public",
"function",
"getTranslation",
"(",
"string",
"$",
"key",
",",
"string",
"$",
"locale",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"throwExceptionIfAttributeIsNotTranslatable",
"(",
"$",
"key",
")",
";",
"$",
"translations",
"=",
"$",
"this",
"->",
... | Get attribute translation.
@param string $key
@param string|null $locale
@return mixed | [
"Get",
"attribute",
"translation",
"."
] | b981d719ac7dc21d7b507917fa04cc1d49c09f36 | https://github.com/indigoram89/laravel-translatable/blob/b981d719ac7dc21d7b507917fa04cc1d49c09f36/src/Translatable.php#L39-L63 |
194,206 | indigoram89/laravel-translatable | src/Translatable.php | Translatable.setTranslation | public function setTranslation(string $key, string $value = null, string $locale = null)
{
$this->throwExceptionIfAttributeIsNotTranslatable($key);
$locale = $locale ?: config('app.locale');
$translations = $this->getTranslations($key);
if ($this->hasSetMutator($key)) {
... | php | public function setTranslation(string $key, string $value = null, string $locale = null)
{
$this->throwExceptionIfAttributeIsNotTranslatable($key);
$locale = $locale ?: config('app.locale');
$translations = $this->getTranslations($key);
if ($this->hasSetMutator($key)) {
... | [
"public",
"function",
"setTranslation",
"(",
"string",
"$",
"key",
",",
"string",
"$",
"value",
"=",
"null",
",",
"string",
"$",
"locale",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"throwExceptionIfAttributeIsNotTranslatable",
"(",
"$",
"key",
")",
";",
"$... | Set attribute translation.
@param string $key
@param string $value
@param string|null $locale
@return mixed | [
"Set",
"attribute",
"translation",
"."
] | b981d719ac7dc21d7b507917fa04cc1d49c09f36 | https://github.com/indigoram89/laravel-translatable/blob/b981d719ac7dc21d7b507917fa04cc1d49c09f36/src/Translatable.php#L105-L122 |
194,207 | ciims/ciims-modules-install | commands/InstallerCommand.php | InstallerCommand.runMigrationTool | private function runMigrationTool(array $dsn)
{
$runner=new CConsoleCommandRunner();
$runner->commands=array(
'migrate' => array(
'class' => 'application.commands.CiiMigrateCommand',
'dsn' => $dsn,
'interactive' => 0,
),
... | php | private function runMigrationTool(array $dsn)
{
$runner=new CConsoleCommandRunner();
$runner->commands=array(
'migrate' => array(
'class' => 'application.commands.CiiMigrateCommand',
'dsn' => $dsn,
'interactive' => 0,
),
... | [
"private",
"function",
"runMigrationTool",
"(",
"array",
"$",
"dsn",
")",
"{",
"$",
"runner",
"=",
"new",
"CConsoleCommandRunner",
"(",
")",
";",
"$",
"runner",
"->",
"commands",
"=",
"array",
"(",
"'migrate'",
"=>",
"array",
"(",
"'class'",
"=>",
"'applic... | Runs the migration tool, effectivly installing the database an all appliciable default settings | [
"Runs",
"the",
"migration",
"tool",
"effectivly",
"installing",
"the",
"database",
"an",
"all",
"appliciable",
"default",
"settings"
] | 54d6a93e5c42c2d98e19de38a90e27f77358e88b | https://github.com/ciims/ciims-modules-install/blob/54d6a93e5c42c2d98e19de38a90e27f77358e88b/commands/InstallerCommand.php#L79-L105 |
194,208 | shgysk8zer0/core_api | traits/ports.php | Ports.getDefaultPort | final public function getDefaultPort($name)
{
$this->_getPortKey($name);
if ($this->isNamedPort($name)) {
return constant($this->_port_class . $name);
} else {
throw new \InvalidArgumentException("Unknown name or scheme: {$name}");
}
} | php | final public function getDefaultPort($name)
{
$this->_getPortKey($name);
if ($this->isNamedPort($name)) {
return constant($this->_port_class . $name);
} else {
throw new \InvalidArgumentException("Unknown name or scheme: {$name}");
}
} | [
"final",
"public",
"function",
"getDefaultPort",
"(",
"$",
"name",
")",
"{",
"$",
"this",
"->",
"_getPortKey",
"(",
"$",
"name",
")",
";",
"if",
"(",
"$",
"this",
"->",
"isNamedPort",
"(",
"$",
"name",
")",
")",
"{",
"return",
"constant",
"(",
"$",
... | Get the port number from its name or scheme
@param string $name The name or scheme
@return int The default port number for it | [
"Get",
"the",
"port",
"number",
"from",
"its",
"name",
"or",
"scheme"
] | 9e9b8baf761af874b95256ad2462e55fbb2b2e58 | https://github.com/shgysk8zer0/core_api/blob/9e9b8baf761af874b95256ad2462e55fbb2b2e58/traits/ports.php#L45-L53 |
194,209 | shgysk8zer0/core_api | traits/ports.php | Ports.isDefaultPort | final public function isDefaultPort($scheme, $port)
{
$this->_getPortKey($scheme);
try {
return $this->isNamedPort($scheme) and ($this->getDefaultPort($scheme) === (int)$port);
} catch (\Exception $e) {
echo $e. PHP_EOL;
}
} | php | final public function isDefaultPort($scheme, $port)
{
$this->_getPortKey($scheme);
try {
return $this->isNamedPort($scheme) and ($this->getDefaultPort($scheme) === (int)$port);
} catch (\Exception $e) {
echo $e. PHP_EOL;
}
} | [
"final",
"public",
"function",
"isDefaultPort",
"(",
"$",
"scheme",
",",
"$",
"port",
")",
"{",
"$",
"this",
"->",
"_getPortKey",
"(",
"$",
"scheme",
")",
";",
"try",
"{",
"return",
"$",
"this",
"->",
"isNamedPort",
"(",
"$",
"scheme",
")",
"and",
"(... | Checks that the given scheme and port match, according to defaults
@param string $scheme The scheme name (E.G. http)
@param int $port The number to check default port against
@return bool Whether or not given port is the default for the scheme | [
"Checks",
"that",
"the",
"given",
"scheme",
"and",
"port",
"match",
"according",
"to",
"defaults"
] | 9e9b8baf761af874b95256ad2462e55fbb2b2e58 | https://github.com/shgysk8zer0/core_api/blob/9e9b8baf761af874b95256ad2462e55fbb2b2e58/traits/ports.php#L63-L71 |
194,210 | bkstg/schedule-bundle | EventListener/FullCompanyListener.php | FullCompanyListener.onFlush | public function onFlush(OnFlushEventArgs $args): void
{
// Get the entity manager and unit of work.
$em = $args->getEntityManager();
$uow = $em->getUnitOfWork();
// Check insertions for new events.
foreach ($uow->getScheduledEntityInsertions() as $entity) {
forea... | php | public function onFlush(OnFlushEventArgs $args): void
{
// Get the entity manager and unit of work.
$em = $args->getEntityManager();
$uow = $em->getUnitOfWork();
// Check insertions for new events.
foreach ($uow->getScheduledEntityInsertions() as $entity) {
forea... | [
"public",
"function",
"onFlush",
"(",
"OnFlushEventArgs",
"$",
"args",
")",
":",
"void",
"{",
"// Get the entity manager and unit of work.",
"$",
"em",
"=",
"$",
"args",
"->",
"getEntityManager",
"(",
")",
";",
"$",
"uow",
"=",
"$",
"em",
"->",
"getUnitOfWork"... | Listens for the onFlush event.
@param OnFlushEventArgs $args The arguments for this event.
@return void | [
"Listens",
"for",
"the",
"onFlush",
"event",
"."
] | e64ac897aa7b28bc48319470d65de13cd4788afe | https://github.com/bkstg/schedule-bundle/blob/e64ac897aa7b28bc48319470d65de13cd4788afe/EventListener/FullCompanyListener.php#L41-L62 |
194,211 | bkstg/schedule-bundle | EventListener/FullCompanyListener.php | FullCompanyListener.getInvitations | private function getInvitations($object)
{
// This must be an event with a full company call.
if (!$object instanceof Event
|| !$object->getFullCompany()) {
return [];
}
// Index existing invites so that we don't duplicate any.
$existing = [];
... | php | private function getInvitations($object)
{
// This must be an event with a full company call.
if (!$object instanceof Event
|| !$object->getFullCompany()) {
return [];
}
// Index existing invites so that we don't duplicate any.
$existing = [];
... | [
"private",
"function",
"getInvitations",
"(",
"$",
"object",
")",
"{",
"// This must be an event with a full company call.",
"if",
"(",
"!",
"$",
"object",
"instanceof",
"Event",
"||",
"!",
"$",
"object",
"->",
"getFullCompany",
"(",
")",
")",
"{",
"return",
"["... | Helper function that generates new invitations as needed.
@param mixed $object The entity being acted on.
@return Invitation[] The new invitations needed for this event. | [
"Helper",
"function",
"that",
"generates",
"new",
"invitations",
"as",
"needed",
"."
] | e64ac897aa7b28bc48319470d65de13cd4788afe | https://github.com/bkstg/schedule-bundle/blob/e64ac897aa7b28bc48319470d65de13cd4788afe/EventListener/FullCompanyListener.php#L71-L112 |
194,212 | wearenolte/wp-acf | src/Acf/RestApi.php | RestApi.register | public static function register() {
foreach ( [ 'post', 'user' ] as $type ) {
\register_rest_field(
'post' === $type ? get_post_types() : $type ,
self::FIELD_NAME,
[ 'get_callback' => [ __CLASS__, 'get_' . $type . '_fields' ] ]
);
}
} | php | public static function register() {
foreach ( [ 'post', 'user' ] as $type ) {
\register_rest_field(
'post' === $type ? get_post_types() : $type ,
self::FIELD_NAME,
[ 'get_callback' => [ __CLASS__, 'get_' . $type . '_fields' ] ]
);
}
} | [
"public",
"static",
"function",
"register",
"(",
")",
"{",
"foreach",
"(",
"[",
"'post'",
",",
"'user'",
"]",
"as",
"$",
"type",
")",
"{",
"\\",
"register_rest_field",
"(",
"'post'",
"===",
"$",
"type",
"?",
"get_post_types",
"(",
")",
":",
"$",
"type"... | Register the field for all post types and users. | [
"Register",
"the",
"field",
"for",
"all",
"post",
"types",
"and",
"users",
"."
] | 2f5093438d637fa0eca42ad6d10f6b433ec078b2 | https://github.com/wearenolte/wp-acf/blob/2f5093438d637fa0eca42ad6d10f6b433ec078b2/src/Acf/RestApi.php#L22-L30 |
194,213 | jabernardo/lollipop-php | Library/Page.php | Page.render | static function render($view, array $data = []) {
if (file_exists($view)) {
if (is_array($data)) {
foreach ($data as $_data => $_value) {
if (Config::get('security.anti_xss') && is_string($_value)) {
$_value = Text::entities($_value);
... | php | static function render($view, array $data = []) {
if (file_exists($view)) {
if (is_array($data)) {
foreach ($data as $_data => $_value) {
if (Config::get('security.anti_xss') && is_string($_value)) {
$_value = Text::entities($_value);
... | [
"static",
"function",
"render",
"(",
"$",
"view",
",",
"array",
"$",
"data",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"file_exists",
"(",
"$",
"view",
")",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"data",
")",
")",
"{",
"foreach",
"(",
"$",
"data"... | Alias read file
@param string $view File address
@param array $data Data
@throws \Lollipop\Exception\Runtime
@return string | [
"Alias",
"read",
"file"
] | 004d80b21f7246bb3e08c7b9f74a165b0d3ca0f5 | https://github.com/jabernardo/lollipop-php/blob/004d80b21f7246bb3e08c7b9f74a165b0d3ca0f5/Library/Page.php#L30-L62 |
194,214 | zhaoxianfang/tools | src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php | PhpDumper.addServiceInstance | private function addServiceInstance($id, Definition $definition, $isSimpleInstance)
{
$class = $this->dumpValue($definition->getClass());
if (0 === strpos($class, "'") && false === strpos($class, '$') && !preg_match('/^\'(?:\\\{2})?[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*(?:\\\{2}[a-zA-Z_\x7f-\xff]... | php | private function addServiceInstance($id, Definition $definition, $isSimpleInstance)
{
$class = $this->dumpValue($definition->getClass());
if (0 === strpos($class, "'") && false === strpos($class, '$') && !preg_match('/^\'(?:\\\{2})?[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*(?:\\\{2}[a-zA-Z_\x7f-\xff]... | [
"private",
"function",
"addServiceInstance",
"(",
"$",
"id",
",",
"Definition",
"$",
"definition",
",",
"$",
"isSimpleInstance",
")",
"{",
"$",
"class",
"=",
"$",
"this",
"->",
"dumpValue",
"(",
"$",
"definition",
"->",
"getClass",
"(",
")",
")",
";",
"i... | Generates the service instance.
@param string $id
@param Definition $definition
@param bool $isSimpleInstance
@return string
@throws InvalidArgumentException
@throws RuntimeException | [
"Generates",
"the",
"service",
"instance",
"."
] | d8fc8a9ecd75b5ce4236f0a2e9fdc055108573e7 | https://github.com/zhaoxianfang/tools/blob/d8fc8a9ecd75b5ce4236f0a2e9fdc055108573e7/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php#L531-L562 |
194,215 | zhaoxianfang/tools | src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php | PhpDumper.isTrivialInstance | private function isTrivialInstance(Definition $definition)
{
if ($definition->isSynthetic() || $definition->getFile() || $definition->getMethodCalls() || $definition->getProperties() || $definition->getConfigurator()) {
return false;
}
if ($definition->isDeprecated() || $definiti... | php | private function isTrivialInstance(Definition $definition)
{
if ($definition->isSynthetic() || $definition->getFile() || $definition->getMethodCalls() || $definition->getProperties() || $definition->getConfigurator()) {
return false;
}
if ($definition->isDeprecated() || $definiti... | [
"private",
"function",
"isTrivialInstance",
"(",
"Definition",
"$",
"definition",
")",
"{",
"if",
"(",
"$",
"definition",
"->",
"isSynthetic",
"(",
")",
"||",
"$",
"definition",
"->",
"getFile",
"(",
")",
"||",
"$",
"definition",
"->",
"getMethodCalls",
"(",... | Checks if the definition is a trivial instance.
@param Definition $definition
@return bool | [
"Checks",
"if",
"the",
"definition",
"is",
"a",
"trivial",
"instance",
"."
] | d8fc8a9ecd75b5ce4236f0a2e9fdc055108573e7 | https://github.com/zhaoxianfang/tools/blob/d8fc8a9ecd75b5ce4236f0a2e9fdc055108573e7/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php#L571-L611 |
194,216 | zhaoxianfang/tools | src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php | PhpDumper.addServiceMethodCalls | private function addServiceMethodCalls(Definition $definition, $variableName = 'instance')
{
$calls = '';
foreach ($definition->getMethodCalls() as $call) {
$arguments = array();
foreach ($call[1] as $value) {
$arguments[] = $this->dumpValue($value);
... | php | private function addServiceMethodCalls(Definition $definition, $variableName = 'instance')
{
$calls = '';
foreach ($definition->getMethodCalls() as $call) {
$arguments = array();
foreach ($call[1] as $value) {
$arguments[] = $this->dumpValue($value);
... | [
"private",
"function",
"addServiceMethodCalls",
"(",
"Definition",
"$",
"definition",
",",
"$",
"variableName",
"=",
"'instance'",
")",
"{",
"$",
"calls",
"=",
"''",
";",
"foreach",
"(",
"$",
"definition",
"->",
"getMethodCalls",
"(",
")",
"as",
"$",
"call",... | Adds method calls to a service definition.
@param Definition $definition
@param string $variableName
@return string | [
"Adds",
"method",
"calls",
"to",
"a",
"service",
"definition",
"."
] | d8fc8a9ecd75b5ce4236f0a2e9fdc055108573e7 | https://github.com/zhaoxianfang/tools/blob/d8fc8a9ecd75b5ce4236f0a2e9fdc055108573e7/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php#L621-L634 |
194,217 | zhaoxianfang/tools | src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php | PhpDumper.addServiceConfigurator | private function addServiceConfigurator(Definition $definition, $variableName = 'instance')
{
if (!$callable = $definition->getConfigurator()) {
return '';
}
if (is_array($callable)) {
if ($callable[0] instanceof Reference
|| ($callable[0] instanceof ... | php | private function addServiceConfigurator(Definition $definition, $variableName = 'instance')
{
if (!$callable = $definition->getConfigurator()) {
return '';
}
if (is_array($callable)) {
if ($callable[0] instanceof Reference
|| ($callable[0] instanceof ... | [
"private",
"function",
"addServiceConfigurator",
"(",
"Definition",
"$",
"definition",
",",
"$",
"variableName",
"=",
"'instance'",
")",
"{",
"if",
"(",
"!",
"$",
"callable",
"=",
"$",
"definition",
"->",
"getConfigurator",
"(",
")",
")",
"{",
"return",
"''"... | Adds configurator definition.
@param Definition $definition
@param string $variableName
@return string | [
"Adds",
"configurator",
"definition",
"."
] | d8fc8a9ecd75b5ce4236f0a2e9fdc055108573e7 | https://github.com/zhaoxianfang/tools/blob/d8fc8a9ecd75b5ce4236f0a2e9fdc055108573e7/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php#L690-L716 |
194,218 | zhaoxianfang/tools | src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php | PhpDumper.addNormalizedIds | private function addNormalizedIds()
{
$code = '';
$normalizedIds = $this->container->getNormalizedIds();
ksort($normalizedIds);
foreach ($normalizedIds as $id => $normalizedId) {
if ($this->container->has($normalizedId)) {
$code .= ' '.$this->do... | php | private function addNormalizedIds()
{
$code = '';
$normalizedIds = $this->container->getNormalizedIds();
ksort($normalizedIds);
foreach ($normalizedIds as $id => $normalizedId) {
if ($this->container->has($normalizedId)) {
$code .= ' '.$this->do... | [
"private",
"function",
"addNormalizedIds",
"(",
")",
"{",
"$",
"code",
"=",
"''",
";",
"$",
"normalizedIds",
"=",
"$",
"this",
"->",
"container",
"->",
"getNormalizedIds",
"(",
")",
";",
"ksort",
"(",
"$",
"normalizedIds",
")",
";",
"foreach",
"(",
"$",
... | Adds the normalizedIds property definition.
@return string | [
"Adds",
"the",
"normalizedIds",
"property",
"definition",
"."
] | d8fc8a9ecd75b5ce4236f0a2e9fdc055108573e7 | https://github.com/zhaoxianfang/tools/blob/d8fc8a9ecd75b5ce4236f0a2e9fdc055108573e7/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php#L1086-L1098 |
194,219 | zhaoxianfang/tools | src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php | PhpDumper.addRemovedIds | private function addRemovedIds()
{
if (!$ids = $this->container->getRemovedIds()) {
return '';
}
if ($this->asFiles) {
$code = "require \$this->containerDir.\\DIRECTORY_SEPARATOR.'removed-ids.php'";
} else {
$code = '';
$ids = array_key... | php | private function addRemovedIds()
{
if (!$ids = $this->container->getRemovedIds()) {
return '';
}
if ($this->asFiles) {
$code = "require \$this->containerDir.\\DIRECTORY_SEPARATOR.'removed-ids.php'";
} else {
$code = '';
$ids = array_key... | [
"private",
"function",
"addRemovedIds",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"ids",
"=",
"$",
"this",
"->",
"container",
"->",
"getRemovedIds",
"(",
")",
")",
"{",
"return",
"''",
";",
"}",
"if",
"(",
"$",
"this",
"->",
"asFiles",
")",
"{",
"$",
"... | Adds the removedIds definition.
@return string | [
"Adds",
"the",
"removedIds",
"definition",
"."
] | d8fc8a9ecd75b5ce4236f0a2e9fdc055108573e7 | https://github.com/zhaoxianfang/tools/blob/d8fc8a9ecd75b5ce4236f0a2e9fdc055108573e7/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php#L1124-L1150 |
194,220 | zhaoxianfang/tools | src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php | PhpDumper.addFileMap | private function addFileMap()
{
$code = '';
$definitions = $this->container->getDefinitions();
ksort($definitions);
foreach ($definitions as $id => $definition) {
if (!$definition->isSynthetic() && $definition->isShared() && !$this->isHotPath($definition)) {
... | php | private function addFileMap()
{
$code = '';
$definitions = $this->container->getDefinitions();
ksort($definitions);
foreach ($definitions as $id => $definition) {
if (!$definition->isSynthetic() && $definition->isShared() && !$this->isHotPath($definition)) {
... | [
"private",
"function",
"addFileMap",
"(",
")",
"{",
"$",
"code",
"=",
"''",
";",
"$",
"definitions",
"=",
"$",
"this",
"->",
"container",
"->",
"getDefinitions",
"(",
")",
";",
"ksort",
"(",
"$",
"definitions",
")",
";",
"foreach",
"(",
"$",
"definitio... | Adds the fileMap property definition.
@return string | [
"Adds",
"the",
"fileMap",
"property",
"definition",
"."
] | d8fc8a9ecd75b5ce4236f0a2e9fdc055108573e7 | https://github.com/zhaoxianfang/tools/blob/d8fc8a9ecd75b5ce4236f0a2e9fdc055108573e7/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php#L1176-L1188 |
194,221 | zhaoxianfang/tools | src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php | PhpDumper.getServiceConditionals | private function getServiceConditionals($value)
{
$conditions = array();
foreach (ContainerBuilder::getInitializedConditionals($value) as $service) {
if (!$this->container->hasDefinition($service)) {
return 'false';
}
$conditions[] = sprintf("isset... | php | private function getServiceConditionals($value)
{
$conditions = array();
foreach (ContainerBuilder::getInitializedConditionals($value) as $service) {
if (!$this->container->hasDefinition($service)) {
return 'false';
}
$conditions[] = sprintf("isset... | [
"private",
"function",
"getServiceConditionals",
"(",
"$",
"value",
")",
"{",
"$",
"conditions",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"ContainerBuilder",
"::",
"getInitializedConditionals",
"(",
"$",
"value",
")",
"as",
"$",
"service",
")",
"{",
"if"... | Get the conditions to execute for conditional services.
@param string $value
@return null|string | [
"Get",
"the",
"conditions",
"to",
"execute",
"for",
"conditional",
"services",
"."
] | d8fc8a9ecd75b5ce4236f0a2e9fdc055108573e7 | https://github.com/zhaoxianfang/tools/blob/d8fc8a9ecd75b5ce4236f0a2e9fdc055108573e7/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php#L1530-L1552 |
194,222 | zhaoxianfang/tools | src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php | PhpDumper.getNextVariableName | private function getNextVariableName()
{
$firstChars = self::FIRST_CHARS;
$firstCharsLength = strlen($firstChars);
$nonFirstChars = self::NON_FIRST_CHARS;
$nonFirstCharsLength = strlen($nonFirstChars);
while (true) {
$name = '';
$i = $this->variableCo... | php | private function getNextVariableName()
{
$firstChars = self::FIRST_CHARS;
$firstCharsLength = strlen($firstChars);
$nonFirstChars = self::NON_FIRST_CHARS;
$nonFirstCharsLength = strlen($nonFirstChars);
while (true) {
$name = '';
$i = $this->variableCo... | [
"private",
"function",
"getNextVariableName",
"(",
")",
"{",
"$",
"firstChars",
"=",
"self",
"::",
"FIRST_CHARS",
";",
"$",
"firstCharsLength",
"=",
"strlen",
"(",
"$",
"firstChars",
")",
";",
"$",
"nonFirstChars",
"=",
"self",
"::",
"NON_FIRST_CHARS",
";",
... | Returns the next name to use.
@return string | [
"Returns",
"the",
"next",
"name",
"to",
"use",
"."
] | d8fc8a9ecd75b5ce4236f0a2e9fdc055108573e7 | https://github.com/zhaoxianfang/tools/blob/d8fc8a9ecd75b5ce4236f0a2e9fdc055108573e7/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php#L1979-L2010 |
194,223 | freialib/ran.tools | src/Field.php | Field.fieldfillers | protected function fieldfillers() {
$fieldrender = $this->fieldrender();
if ($this->hintrenderer !== null) {
$callable = &$this->hintrenderer;
$hintsrender = $callable($this->hints());
}
else { # no hint renderer
$hintsrender = null;
}
if ($this->showerrors && $this->errorrenderer) {
$callabl... | php | protected function fieldfillers() {
$fieldrender = $this->fieldrender();
if ($this->hintrenderer !== null) {
$callable = &$this->hintrenderer;
$hintsrender = $callable($this->hints());
}
else { # no hint renderer
$hintsrender = null;
}
if ($this->showerrors && $this->errorrenderer) {
$callabl... | [
"protected",
"function",
"fieldfillers",
"(",
")",
"{",
"$",
"fieldrender",
"=",
"$",
"this",
"->",
"fieldrender",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"hintrenderer",
"!==",
"null",
")",
"{",
"$",
"callable",
"=",
"&",
"$",
"this",
"->",
"hi... | Hook for adding additional fillers for hotwiring funcitonality.
eg. say you need special classes on labels, you would overwrite this
method to enable your templates to understand new inputs
@return array | [
"Hook",
"for",
"adding",
"additional",
"fillers",
"for",
"hotwiring",
"funcitonality",
"."
] | f4cbb926ef54da357b102cbfa4b6ce273be6ce63 | https://github.com/freialib/ran.tools/blob/f4cbb926ef54da357b102cbfa4b6ce273be6ce63/src/Field.php#L46-L74 |
194,224 | stubbles/stubbles-date | src/main/php/Date.php | Date.castFrom | public static function castFrom($value, string $name = 'Date'): self
{
if (is_int($value) || is_string($value) || $value instanceof \DateTime) {
return new self($value);
}
if (!($value instanceof Date)) {
throw new \InvalidArgumentException(
$name... | php | public static function castFrom($value, string $name = 'Date'): self
{
if (is_int($value) || is_string($value) || $value instanceof \DateTime) {
return new self($value);
}
if (!($value instanceof Date)) {
throw new \InvalidArgumentException(
$name... | [
"public",
"static",
"function",
"castFrom",
"(",
"$",
"value",
",",
"string",
"$",
"name",
"=",
"'Date'",
")",
":",
"self",
"{",
"if",
"(",
"is_int",
"(",
"$",
"value",
")",
"||",
"is_string",
"(",
"$",
"value",
")",
"||",
"$",
"value",
"instanceof",... | casts given value to an instance of Date
@param int|string|\DateTime|Date $value
@param string $name
@return \stubbles\date\Date
@throws \InvalidArgumentException
@since 3.4.4 | [
"casts",
"given",
"value",
"to",
"an",
"instance",
"of",
"Date"
] | 98553392bec03affc53a6e3eb7f88408c2720d1c | https://github.com/stubbles/stubbles-date/blob/98553392bec03affc53a6e3eb7f88408c2720d1c/src/main/php/Date.php#L112-L127 |
194,225 | silverorange/Concentrate | Concentrate/Path.php | Concentrate_Path.writeDirectory | public function writeDirectory()
{
$toDirectory = dirname($this->path);
if (!file_exists($toDirectory)) {
mkdir($toDirectory, 0770, true);
}
if (!is_dir($toDirectory)) {
throw new Concentrate_FileException(
"Could not write to directory {$toD... | php | public function writeDirectory()
{
$toDirectory = dirname($this->path);
if (!file_exists($toDirectory)) {
mkdir($toDirectory, 0770, true);
}
if (!is_dir($toDirectory)) {
throw new Concentrate_FileException(
"Could not write to directory {$toD... | [
"public",
"function",
"writeDirectory",
"(",
")",
"{",
"$",
"toDirectory",
"=",
"dirname",
"(",
"$",
"this",
"->",
"path",
")",
";",
"if",
"(",
"!",
"file_exists",
"(",
"$",
"toDirectory",
")",
")",
"{",
"mkdir",
"(",
"$",
"toDirectory",
",",
"0770",
... | Creates a directory for this path if such a directory does not already
exist
The last item in this path is considered the file and is stripped off the
path before the directory is created. For example, this creates the
directory '/foo/bar':
<code>
<?php
$path = new Concentrate_Path('/foo/bar/baz');
$path->writeDirecto... | [
"Creates",
"a",
"directory",
"for",
"this",
"path",
"if",
"such",
"a",
"directory",
"does",
"not",
"already",
"exist"
] | e0b679bedc105dc4280bb68a233c31246d20e6c5 | https://github.com/silverorange/Concentrate/blob/e0b679bedc105dc4280bb68a233c31246d20e6c5/Concentrate/Path.php#L55-L73 |
194,226 | silverorange/Concentrate | Concentrate/Path.php | Concentrate_Path.evaluate | public function evaluate()
{
$postPath = array();
$prePath = array();
$path = rtrim($this->path, '/');
$pathSegments = explode('/', $path);
foreach ($pathSegments as $segment) {
if ($segment == '..') {
if (count($postPath) > 0) {
... | php | public function evaluate()
{
$postPath = array();
$prePath = array();
$path = rtrim($this->path, '/');
$pathSegments = explode('/', $path);
foreach ($pathSegments as $segment) {
if ($segment == '..') {
if (count($postPath) > 0) {
... | [
"public",
"function",
"evaluate",
"(",
")",
"{",
"$",
"postPath",
"=",
"array",
"(",
")",
";",
"$",
"prePath",
"=",
"array",
"(",
")",
";",
"$",
"path",
"=",
"rtrim",
"(",
"$",
"this",
"->",
"path",
",",
"'/'",
")",
";",
"$",
"pathSegments",
"=",... | Evaluates a path that contains relative references and removes
superfluous current directory references
@return Concentrate_Path a new path object. | [
"Evaluates",
"a",
"path",
"that",
"contains",
"relative",
"references",
"and",
"removes",
"superfluous",
"current",
"directory",
"references"
] | e0b679bedc105dc4280bb68a233c31246d20e6c5 | https://github.com/silverorange/Concentrate/blob/e0b679bedc105dc4280bb68a233c31246d20e6c5/Concentrate/Path.php#L81-L112 |
194,227 | miBadger/miBadger.Observer | src/SubjectTrait.php | SubjectTrait.attach | public function attach(ObserverInterface $observer)
{
if ($this->isAttached($observer)) {
return false;
}
$this->observers[] = $observer;
return true;
} | php | public function attach(ObserverInterface $observer)
{
if ($this->isAttached($observer)) {
return false;
}
$this->observers[] = $observer;
return true;
} | [
"public",
"function",
"attach",
"(",
"ObserverInterface",
"$",
"observer",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isAttached",
"(",
"$",
"observer",
")",
")",
"{",
"return",
"false",
";",
"}",
"$",
"this",
"->",
"observers",
"[",
"]",
"=",
"$",
"ob... | Returns true if the observer is attached successfully.
@param ObserverInterface $observer
@return bool true if the observer is attached successfully. | [
"Returns",
"true",
"if",
"the",
"observer",
"is",
"attached",
"successfully",
"."
] | bbb87638acd7b524793042660ffd4d42c8d6b8e5 | https://github.com/miBadger/miBadger.Observer/blob/bbb87638acd7b524793042660ffd4d42c8d6b8e5/src/SubjectTrait.php#L41-L50 |
194,228 | miBadger/miBadger.Observer | src/SubjectTrait.php | SubjectTrait.detach | public function detach(ObserverInterface $observer)
{
foreach ($this->observers as $key => $value) {
if ($value === $observer) {
unset($this->observers[$key]);
return true;
}
}
return false;
} | php | public function detach(ObserverInterface $observer)
{
foreach ($this->observers as $key => $value) {
if ($value === $observer) {
unset($this->observers[$key]);
return true;
}
}
return false;
} | [
"public",
"function",
"detach",
"(",
"ObserverInterface",
"$",
"observer",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"observers",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"value",
"===",
"$",
"observer",
")",
"{",
"unset",
"... | Returns true if the observer is detached successfully.
@param ObserverInterface $observer
@return bool true if the observer is detached successfully. | [
"Returns",
"true",
"if",
"the",
"observer",
"is",
"detached",
"successfully",
"."
] | bbb87638acd7b524793042660ffd4d42c8d6b8e5 | https://github.com/miBadger/miBadger.Observer/blob/bbb87638acd7b524793042660ffd4d42c8d6b8e5/src/SubjectTrait.php#L58-L69 |
194,229 | miBadger/miBadger.Observer | src/SubjectTrait.php | SubjectTrait.notify | public function notify($arguments = null)
{
foreach ($this->observers as $observer) {
$observer->update($this, $arguments);
}
} | php | public function notify($arguments = null)
{
foreach ($this->observers as $observer) {
$observer->update($this, $arguments);
}
} | [
"public",
"function",
"notify",
"(",
"$",
"arguments",
"=",
"null",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"observers",
"as",
"$",
"observer",
")",
"{",
"$",
"observer",
"->",
"update",
"(",
"$",
"this",
",",
"$",
"arguments",
")",
";",
"}",
... | Notify all the attached observers.
@param mixed $arguments
@return null | [
"Notify",
"all",
"the",
"attached",
"observers",
"."
] | bbb87638acd7b524793042660ffd4d42c8d6b8e5 | https://github.com/miBadger/miBadger.Observer/blob/bbb87638acd7b524793042660ffd4d42c8d6b8e5/src/SubjectTrait.php#L77-L82 |
194,230 | JBZoo/Path | src/Path.php | Path.clean | public function clean($path)
{
$tokens = [];
$path = $this->cleanPath($path);
$prefix = $this->prefix($path);
$path = substr($path, strlen($prefix));
$parts = array_filter(explode('/', $path), 'strlen');
foreach ($parts as $part) {
if ('..' === $part) {
... | php | public function clean($path)
{
$tokens = [];
$path = $this->cleanPath($path);
$prefix = $this->prefix($path);
$path = substr($path, strlen($prefix));
$parts = array_filter(explode('/', $path), 'strlen');
foreach ($parts as $part) {
if ('..' === $part) {
... | [
"public",
"function",
"clean",
"(",
"$",
"path",
")",
"{",
"$",
"tokens",
"=",
"[",
"]",
";",
"$",
"path",
"=",
"$",
"this",
"->",
"cleanPath",
"(",
"$",
"path",
")",
";",
"$",
"prefix",
"=",
"$",
"this",
"->",
"prefix",
"(",
"$",
"path",
")",
... | Normalize and clean path.
@param string $path ("C:\server\test.dev\file.txt")
@return string | [
"Normalize",
"and",
"clean",
"path",
"."
] | 98f8427340ba3f55a999e1ea99f41a526fe2ee90 | https://github.com/JBZoo/Path/blob/98f8427340ba3f55a999e1ea99f41a526fe2ee90/src/Path.php#L195-L212 |
194,231 | JBZoo/Path | src/Path.php | Path.getPaths | public function getPaths($source)
{
$source = $this->cleanSource($source);
list(, $paths) = $this->parse($source);
return $paths;
} | php | public function getPaths($source)
{
$source = $this->cleanSource($source);
list(, $paths) = $this->parse($source);
return $paths;
} | [
"public",
"function",
"getPaths",
"(",
"$",
"source",
")",
"{",
"$",
"source",
"=",
"$",
"this",
"->",
"cleanSource",
"(",
"$",
"source",
")",
";",
"list",
"(",
",",
"$",
"paths",
")",
"=",
"$",
"this",
"->",
"parse",
"(",
"$",
"source",
")",
";"... | Get all absolute path to a file or a directory.
@param $source (example: "default:file.txt")
@return mixed | [
"Get",
"all",
"absolute",
"path",
"to",
"a",
"file",
"or",
"a",
"directory",
"."
] | 98f8427340ba3f55a999e1ea99f41a526fe2ee90 | https://github.com/JBZoo/Path/blob/98f8427340ba3f55a999e1ea99f41a526fe2ee90/src/Path.php#L244-L250 |
194,232 | JBZoo/Path | src/Path.php | Path.isVirtual | public function isVirtual($path): bool
{
$parts = explode(':', $path, 2);
list($alias) = $parts;
$alias = $this->cleanAlias($alias);
if (!array_key_exists($alias, $this->paths) && $this->prefix($path) !== null) {
return false;
}
return count($parts) === ... | php | public function isVirtual($path): bool
{
$parts = explode(':', $path, 2);
list($alias) = $parts;
$alias = $this->cleanAlias($alias);
if (!array_key_exists($alias, $this->paths) && $this->prefix($path) !== null) {
return false;
}
return count($parts) === ... | [
"public",
"function",
"isVirtual",
"(",
"$",
"path",
")",
":",
"bool",
"{",
"$",
"parts",
"=",
"explode",
"(",
"':'",
",",
"$",
"path",
",",
"2",
")",
";",
"list",
"(",
"$",
"alias",
")",
"=",
"$",
"parts",
";",
"$",
"alias",
"=",
"$",
"this",
... | Check virtual or real path.
@param string $path (example: "default:file.txt" or "C:\server\test.dev\file.txt")
@return bool | [
"Check",
"virtual",
"or",
"real",
"path",
"."
] | 98f8427340ba3f55a999e1ea99f41a526fe2ee90 | https://github.com/JBZoo/Path/blob/98f8427340ba3f55a999e1ea99f41a526fe2ee90/src/Path.php#L281-L292 |
194,233 | JBZoo/Path | src/Path.php | Path.prefix | public function prefix($path)
{
$path = $this->cleanPath($path);
return preg_match('|^(?P<prefix>([a-zA-Z]+:)?//?)|', $path, $matches) ? $matches['prefix'] : null;
} | php | public function prefix($path)
{
$path = $this->cleanPath($path);
return preg_match('|^(?P<prefix>([a-zA-Z]+:)?//?)|', $path, $matches) ? $matches['prefix'] : null;
} | [
"public",
"function",
"prefix",
"(",
"$",
"path",
")",
"{",
"$",
"path",
"=",
"$",
"this",
"->",
"cleanPath",
"(",
"$",
"path",
")",
";",
"return",
"preg_match",
"(",
"'|^(?P<prefix>([a-zA-Z]+:)?//?)|'",
",",
"$",
"path",
",",
"$",
"matches",
")",
"?",
... | Get path prefix.
@param string $path (example: "C:\server\test.dev\file.txt")
@return null | [
"Get",
"path",
"prefix",
"."
] | 98f8427340ba3f55a999e1ea99f41a526fe2ee90 | https://github.com/JBZoo/Path/blob/98f8427340ba3f55a999e1ea99f41a526fe2ee90/src/Path.php#L300-L304 |
194,234 | JBZoo/Path | src/Path.php | Path.remove | public function remove($fromSource, $paths): bool
{
$paths = (array)$paths;
$fromSource = $this->cleanSource($fromSource);
list($alias) = $this->parse($fromSource);
$return = false;
foreach ($paths as $origPath) {
$path = $this->cleanPathInternal($this->cleanPat... | php | public function remove($fromSource, $paths): bool
{
$paths = (array)$paths;
$fromSource = $this->cleanSource($fromSource);
list($alias) = $this->parse($fromSource);
$return = false;
foreach ($paths as $origPath) {
$path = $this->cleanPathInternal($this->cleanPat... | [
"public",
"function",
"remove",
"(",
"$",
"fromSource",
",",
"$",
"paths",
")",
":",
"bool",
"{",
"$",
"paths",
"=",
"(",
"array",
")",
"$",
"paths",
";",
"$",
"fromSource",
"=",
"$",
"this",
"->",
"cleanSource",
"(",
"$",
"fromSource",
")",
";",
"... | Remove path from registered paths for source
@param string $fromSource (example: "default:file.txt")
@param string|array $paths
@return bool | [
"Remove",
"path",
"from",
"registered",
"paths",
"for",
"source"
] | 98f8427340ba3f55a999e1ea99f41a526fe2ee90 | https://github.com/JBZoo/Path/blob/98f8427340ba3f55a999e1ea99f41a526fe2ee90/src/Path.php#L313-L332 |
194,235 | JBZoo/Path | src/Path.php | Path.setRoot | public function setRoot($dir)
{
if (!is_dir($dir)) {
throw new Exception(sprintf('Not found directory: %s', $dir));
}
$this->root = $this->cleanPath($dir);
} | php | public function setRoot($dir)
{
if (!is_dir($dir)) {
throw new Exception(sprintf('Not found directory: %s', $dir));
}
$this->root = $this->cleanPath($dir);
} | [
"public",
"function",
"setRoot",
"(",
"$",
"dir",
")",
"{",
"if",
"(",
"!",
"is_dir",
"(",
"$",
"dir",
")",
")",
"{",
"throw",
"new",
"Exception",
"(",
"sprintf",
"(",
"'Not found directory: %s'",
",",
"$",
"dir",
")",
")",
";",
"}",
"$",
"this",
"... | Setup root directory.
@param string $dir
@throws Exception | [
"Setup",
"root",
"directory",
"."
] | 98f8427340ba3f55a999e1ea99f41a526fe2ee90 | https://github.com/JBZoo/Path/blob/98f8427340ba3f55a999e1ea99f41a526fe2ee90/src/Path.php#L340-L347 |
194,236 | JBZoo/Path | src/Path.php | Path.rel | public function rel($source)
{
$fullpath = (string)$this->get($source);
return FS::getRelative($fullpath, $this->root, '/');
} | php | public function rel($source)
{
$fullpath = (string)$this->get($source);
return FS::getRelative($fullpath, $this->root, '/');
} | [
"public",
"function",
"rel",
"(",
"$",
"source",
")",
"{",
"$",
"fullpath",
"=",
"(",
"string",
")",
"$",
"this",
"->",
"get",
"(",
"$",
"source",
")",
";",
"return",
"FS",
"::",
"getRelative",
"(",
"$",
"fullpath",
",",
"$",
"this",
"->",
"root",
... | Get relative path to file or directory
@param string $source (example: "default:file.txt")
@return null|string | [
"Get",
"relative",
"path",
"to",
"file",
"or",
"directory"
] | 98f8427340ba3f55a999e1ea99f41a526fe2ee90 | https://github.com/JBZoo/Path/blob/98f8427340ba3f55a999e1ea99f41a526fe2ee90/src/Path.php#L382-L386 |
194,237 | JBZoo/Path | src/Path.php | Path.relGlob | public function relGlob($source)
{
$list = (array)$this->glob($source);
foreach ($list as $key => $item) {
$list[$key] = FS::getRelative($item, $this->root, '/');
}
return $list;
} | php | public function relGlob($source)
{
$list = (array)$this->glob($source);
foreach ($list as $key => $item) {
$list[$key] = FS::getRelative($item, $this->root, '/');
}
return $list;
} | [
"public",
"function",
"relGlob",
"(",
"$",
"source",
")",
"{",
"$",
"list",
"=",
"(",
"array",
")",
"$",
"this",
"->",
"glob",
"(",
"$",
"source",
")",
";",
"foreach",
"(",
"$",
"list",
"as",
"$",
"key",
"=>",
"$",
"item",
")",
"{",
"$",
"list"... | Get list of relative path to file or directory
@param string $source (example: "default:*.txt")
@return null|string | [
"Get",
"list",
"of",
"relative",
"path",
"to",
"file",
"or",
"directory"
] | 98f8427340ba3f55a999e1ea99f41a526fe2ee90 | https://github.com/JBZoo/Path/blob/98f8427340ba3f55a999e1ea99f41a526fe2ee90/src/Path.php#L394-L402 |
194,238 | JBZoo/Path | src/Path.php | Path.addNewPath | protected function addNewPath($path, $alias, $mode)
{
if ($cleanPath = $this->cleanPathInternal($path)) {
if ($mode === self::MOD_PREPEND) {
array_unshift($this->paths[$alias], $cleanPath);
}
if ($mode === self::MOD_APPEND) {
$this->paths[... | php | protected function addNewPath($path, $alias, $mode)
{
if ($cleanPath = $this->cleanPathInternal($path)) {
if ($mode === self::MOD_PREPEND) {
array_unshift($this->paths[$alias], $cleanPath);
}
if ($mode === self::MOD_APPEND) {
$this->paths[... | [
"protected",
"function",
"addNewPath",
"(",
"$",
"path",
",",
"$",
"alias",
",",
"$",
"mode",
")",
"{",
"if",
"(",
"$",
"cleanPath",
"=",
"$",
"this",
"->",
"cleanPathInternal",
"(",
"$",
"path",
")",
")",
"{",
"if",
"(",
"$",
"mode",
"===",
"self"... | Add path to hold.
@param string|array $path (example: "default:file.txt" or "C:/Server/public_html/index.php")
@param string $alias
@param string|bool $mode
@return void | [
"Add",
"path",
"to",
"hold",
"."
] | 98f8427340ba3f55a999e1ea99f41a526fe2ee90 | https://github.com/JBZoo/Path/blob/98f8427340ba3f55a999e1ea99f41a526fe2ee90/src/Path.php#L412-L423 |
194,239 | JBZoo/Path | src/Path.php | Path.find | protected function find($paths, $file, $isGlob = false)
{
$paths = (array)$paths;
$file = ltrim($file, "\\/");
foreach ($paths as $path) {
$fullPath = $this->clean($path . '/' . $file);
if ($isGlob) {
$paths = glob($fullPath, GLOB_BRACE);
... | php | protected function find($paths, $file, $isGlob = false)
{
$paths = (array)$paths;
$file = ltrim($file, "\\/");
foreach ($paths as $path) {
$fullPath = $this->clean($path . '/' . $file);
if ($isGlob) {
$paths = glob($fullPath, GLOB_BRACE);
... | [
"protected",
"function",
"find",
"(",
"$",
"paths",
",",
"$",
"file",
",",
"$",
"isGlob",
"=",
"false",
")",
"{",
"$",
"paths",
"=",
"(",
"array",
")",
"$",
"paths",
";",
"$",
"file",
"=",
"ltrim",
"(",
"$",
"file",
",",
"\"\\\\/\"",
")",
";",
... | Find actual file or directory in the paths.
@param string|array $paths
@param string $file
@param bool $isGlob
@return null|string|array | [
"Find",
"actual",
"file",
"or",
"directory",
"in",
"the",
"paths",
"."
] | 98f8427340ba3f55a999e1ea99f41a526fe2ee90 | https://github.com/JBZoo/Path/blob/98f8427340ba3f55a999e1ea99f41a526fe2ee90/src/Path.php#L445-L465 |
194,240 | JBZoo/Path | src/Path.php | Path.cleanPathInternal | protected function cleanPathInternal($path)
{
if ($this->isVirtual($path)) {
return $this->cleanPath($path);
}
if ($this->hasCDBack($path)) {
$realpath = $this->cleanPath(realpath($path));
return $realpath ?: null;
}
return $this->cleanPa... | php | protected function cleanPathInternal($path)
{
if ($this->isVirtual($path)) {
return $this->cleanPath($path);
}
if ($this->hasCDBack($path)) {
$realpath = $this->cleanPath(realpath($path));
return $realpath ?: null;
}
return $this->cleanPa... | [
"protected",
"function",
"cleanPathInternal",
"(",
"$",
"path",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isVirtual",
"(",
"$",
"path",
")",
")",
"{",
"return",
"$",
"this",
"->",
"cleanPath",
"(",
"$",
"path",
")",
";",
"}",
"if",
"(",
"$",
"this",... | Get add path.
@param string $path (example: "default:file.txt" or "C:/Server/public_html/index.php")
@param string $path
@return null|string | [
"Get",
"add",
"path",
"."
] | 98f8427340ba3f55a999e1ea99f41a526fe2ee90 | https://github.com/JBZoo/Path/blob/98f8427340ba3f55a999e1ea99f41a526fe2ee90/src/Path.php#L474-L486 |
194,241 | JBZoo/Path | src/Path.php | Path.getUrlPath | protected function getUrlPath($path, $exitsFile = false): string
{
$this->checkRoot();
$path = $this->cleanPathInternal($path);
if ($this->isVirtual($path)) {
$path = $this->get($path);
}
$subject = $path;
$pattern = '/^' . preg_quote($this->root, '/') .... | php | protected function getUrlPath($path, $exitsFile = false): string
{
$this->checkRoot();
$path = $this->cleanPathInternal($path);
if ($this->isVirtual($path)) {
$path = $this->get($path);
}
$subject = $path;
$pattern = '/^' . preg_quote($this->root, '/') .... | [
"protected",
"function",
"getUrlPath",
"(",
"$",
"path",
",",
"$",
"exitsFile",
"=",
"false",
")",
":",
"string",
"{",
"$",
"this",
"->",
"checkRoot",
"(",
")",
";",
"$",
"path",
"=",
"$",
"this",
"->",
"cleanPathInternal",
"(",
"$",
"path",
")",
";"... | Get url path.
@param string $path (example: "default:file.txt" or "C:/Server/public_html/index.php")
@param bool $exitsFile
@return string
@throws Exception | [
"Get",
"url",
"path",
"."
] | 98f8427340ba3f55a999e1ea99f41a526fe2ee90 | https://github.com/JBZoo/Path/blob/98f8427340ba3f55a999e1ea99f41a526fe2ee90/src/Path.php#L496-L513 |
194,242 | JBZoo/Path | src/Path.php | Path.parse | protected function parse($source): array
{
$path = null;
list($alias, $path) = explode(':', $source, 2);
$path = ltrim($path, "\\/");
$paths = $this->resolvePaths($alias);
return [$alias, $paths, $path];
} | php | protected function parse($source): array
{
$path = null;
list($alias, $path) = explode(':', $source, 2);
$path = ltrim($path, "\\/");
$paths = $this->resolvePaths($alias);
return [$alias, $paths, $path];
} | [
"protected",
"function",
"parse",
"(",
"$",
"source",
")",
":",
"array",
"{",
"$",
"path",
"=",
"null",
";",
"list",
"(",
"$",
"alias",
",",
"$",
"path",
")",
"=",
"explode",
"(",
"':'",
",",
"$",
"source",
",",
"2",
")",
";",
"$",
"path",
"=",... | Parse source string.
@param string $source (example: "default:file.txt")
@return array | [
"Parse",
"source",
"string",
"."
] | 98f8427340ba3f55a999e1ea99f41a526fe2ee90 | https://github.com/JBZoo/Path/blob/98f8427340ba3f55a999e1ea99f41a526fe2ee90/src/Path.php#L533-L542 |
194,243 | agentmedia/phine-core | src/Core/Modules/Backend/ContainerForm.php | ContainerForm.Init | protected function Init()
{
$this->container = new Container(Request::GetData('container'));
$this->containerRights = new ContainerRights($this->container->GetUserGroupRights());
$this->AddNameField();
$this->AddUserGroupField();
$this->AddSubmit();
return parent::Ini... | php | protected function Init()
{
$this->container = new Container(Request::GetData('container'));
$this->containerRights = new ContainerRights($this->container->GetUserGroupRights());
$this->AddNameField();
$this->AddUserGroupField();
$this->AddSubmit();
return parent::Ini... | [
"protected",
"function",
"Init",
"(",
")",
"{",
"$",
"this",
"->",
"container",
"=",
"new",
"Container",
"(",
"Request",
"::",
"GetData",
"(",
"'container'",
")",
")",
";",
"$",
"this",
"->",
"containerRights",
"=",
"new",
"ContainerRights",
"(",
"$",
"t... | Initializes the container form
@return boolea True if processing shall continue | [
"Initializes",
"the",
"container",
"form"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Modules/Backend/ContainerForm.php#L39-L47 |
194,244 | agentmedia/phine-core | src/Core/Modules/Backend/ContainerForm.php | ContainerForm.OnSuccess | protected function OnSuccess()
{
$action = Action::Update();
if (!$this->container->Exists())
{
$action = Action::Create();
$this->container->SetUser(self::Guard()->GetUser());
}
$this->container->SetName($this->Value('Name'));
$this->container... | php | protected function OnSuccess()
{
$action = Action::Update();
if (!$this->container->Exists())
{
$action = Action::Create();
$this->container->SetUser(self::Guard()->GetUser());
}
$this->container->SetName($this->Value('Name'));
$this->container... | [
"protected",
"function",
"OnSuccess",
"(",
")",
"{",
"$",
"action",
"=",
"Action",
"::",
"Update",
"(",
")",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"container",
"->",
"Exists",
"(",
")",
")",
"{",
"$",
"action",
"=",
"Action",
"::",
"Create",
"(",... | Saves the container | [
"Saves",
"the",
"container"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Modules/Backend/ContainerForm.php#L76-L95 |
194,245 | agentmedia/phine-core | src/Core/Modules/Backend/ContainerForm.php | ContainerForm.SaveRights | private function SaveRights()
{
$groupID = $this->Value('UserGroup');
$userGroup = Usergroup::Schema()->ByID($groupID);
$this->container->SetUserGroup($userGroup);
if (!$userGroup)
{
$oldRights = $this->container->GetUserGroupRights();
if ($oldRights)
... | php | private function SaveRights()
{
$groupID = $this->Value('UserGroup');
$userGroup = Usergroup::Schema()->ByID($groupID);
$this->container->SetUserGroup($userGroup);
if (!$userGroup)
{
$oldRights = $this->container->GetUserGroupRights();
if ($oldRights)
... | [
"private",
"function",
"SaveRights",
"(",
")",
"{",
"$",
"groupID",
"=",
"$",
"this",
"->",
"Value",
"(",
"'UserGroup'",
")",
";",
"$",
"userGroup",
"=",
"Usergroup",
"::",
"Schema",
"(",
")",
"->",
"ByID",
"(",
"$",
"groupID",
")",
";",
"$",
"this",... | Saves group and rights | [
"Saves",
"group",
"and",
"rights"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Modules/Backend/ContainerForm.php#L110-L131 |
194,246 | fiiSoft/fiisoft-basics | src/Tools/Configuration/AbstractConfiguration.php | AbstractConfiguration.mergeCopyWith | public function mergeCopyWith($other, $notNull = true)
{
$copy = clone $this;
if ($other === $this) {
return $copy;
}
if ($other instanceof self) {
foreach ($other->toArray($notNull) as $key => $value) {
if (property_exists($copy,... | php | public function mergeCopyWith($other, $notNull = true)
{
$copy = clone $this;
if ($other === $this) {
return $copy;
}
if ($other instanceof self) {
foreach ($other->toArray($notNull) as $key => $value) {
if (property_exists($copy,... | [
"public",
"function",
"mergeCopyWith",
"(",
"$",
"other",
",",
"$",
"notNull",
"=",
"true",
")",
"{",
"$",
"copy",
"=",
"clone",
"$",
"this",
";",
"if",
"(",
"$",
"other",
"===",
"$",
"this",
")",
"{",
"return",
"$",
"copy",
";",
"}",
"if",
"(",
... | Create copy of this configuration with merged other data.
@param AbstractConfiguration|\Traversable|\ArrayAccess|array $other
@param bool $notNull
@throws \InvalidArgumentException if cannot merge $other to $this
@return AbstractConfiguration copy of $this configuration with merged $other data | [
"Create",
"copy",
"of",
"this",
"configuration",
"with",
"merged",
"other",
"data",
"."
] | cf0e56a9abf646fae075f16e65eced282601c193 | https://github.com/fiiSoft/fiisoft-basics/blob/cf0e56a9abf646fae075f16e65eced282601c193/src/Tools/Configuration/AbstractConfiguration.php#L76-L110 |
194,247 | SagittariusX/Beluga.Drawing | src/Beluga/Drawing/Size.php | Size.setWidth | public final function setWidth( int $width ) : Size
{
$this->triggerFixedErrorByNeed( 'width-change' );
$this->_width = \max( $width, 0 );
return $this;
} | php | public final function setWidth( int $width ) : Size
{
$this->triggerFixedErrorByNeed( 'width-change' );
$this->_width = \max( $width, 0 );
return $this;
} | [
"public",
"final",
"function",
"setWidth",
"(",
"int",
"$",
"width",
")",
":",
"Size",
"{",
"$",
"this",
"->",
"triggerFixedErrorByNeed",
"(",
"'width-change'",
")",
";",
"$",
"this",
"->",
"_width",
"=",
"\\",
"max",
"(",
"$",
"width",
",",
"0",
")",
... | Sets the width.
@param int $width
@return Size
@throws \Beluga\BelugaError If the instance is set to fixed | [
"Sets",
"the",
"width",
"."
] | 9c82874cf4ec68cb0af78757b65f19783540004a | https://github.com/SagittariusX/Beluga.Drawing/blob/9c82874cf4ec68cb0af78757b65f19783540004a/src/Beluga/Drawing/Size.php#L154-L163 |
194,248 | SagittariusX/Beluga.Drawing | src/Beluga/Drawing/Size.php | Size.setHeight | public final function setHeight( int $height ) : Size
{
$this->triggerFixedErrorByNeed( 'height-change' );
$this->_height = \max( $height, 0 );
return $this;
} | php | public final function setHeight( int $height ) : Size
{
$this->triggerFixedErrorByNeed( 'height-change' );
$this->_height = \max( $height, 0 );
return $this;
} | [
"public",
"final",
"function",
"setHeight",
"(",
"int",
"$",
"height",
")",
":",
"Size",
"{",
"$",
"this",
"->",
"triggerFixedErrorByNeed",
"(",
"'height-change'",
")",
";",
"$",
"this",
"->",
"_height",
"=",
"\\",
"max",
"(",
"$",
"height",
",",
"0",
... | Sets the height.
@param int $height
@return Size
@throws \Beluga\BelugaError If the instance is set to fixed | [
"Sets",
"the",
"height",
"."
] | 9c82874cf4ec68cb0af78757b65f19783540004a | https://github.com/SagittariusX/Beluga.Drawing/blob/9c82874cf4ec68cb0af78757b65f19783540004a/src/Beluga/Drawing/Size.php#L172-L181 |
194,249 | SagittariusX/Beluga.Drawing | src/Beluga/Drawing/Size.php | Size.contains | public final function contains( Size $size ) : bool
{
return (
( $size->_width <= $this->_width )
&&
( $size->_height <= $this->_height )
);
} | php | public final function contains( Size $size ) : bool
{
return (
( $size->_width <= $this->_width )
&&
( $size->_height <= $this->_height )
);
} | [
"public",
"final",
"function",
"contains",
"(",
"Size",
"$",
"size",
")",
":",
"bool",
"{",
"return",
"(",
"(",
"$",
"size",
"->",
"_width",
"<=",
"$",
"this",
"->",
"_width",
")",
"&&",
"(",
"$",
"size",
"->",
"_height",
"<=",
"$",
"this",
"->",
... | Returns if the current size can contain the size dimensions of the defined size.
@param \Beluga\Drawing\Size $size
@return bool | [
"Returns",
"if",
"the",
"current",
"size",
"can",
"contain",
"the",
"size",
"dimensions",
"of",
"the",
"defined",
"size",
"."
] | 9c82874cf4ec68cb0af78757b65f19783540004a | https://github.com/SagittariusX/Beluga.Drawing/blob/9c82874cf4ec68cb0af78757b65f19783540004a/src/Beluga/Drawing/Size.php#L206-L215 |
194,250 | SagittariusX/Beluga.Drawing | src/Beluga/Drawing/Size.php | Size.isNearQuadratic | public final function isNearQuadratic( float $maxDifference = 0.15 ) : bool
{
if ( $this->isQuadratic() )
{
return true;
}
if ( $maxDifference >= 0.01 && $maxDifference <= 0.3 )
{
$diff = 1.0 + $maxDifference;
}
else
{
$diff = 1.15;
}... | php | public final function isNearQuadratic( float $maxDifference = 0.15 ) : bool
{
if ( $this->isQuadratic() )
{
return true;
}
if ( $maxDifference >= 0.01 && $maxDifference <= 0.3 )
{
$diff = 1.0 + $maxDifference;
}
else
{
$diff = 1.15;
}... | [
"public",
"final",
"function",
"isNearQuadratic",
"(",
"float",
"$",
"maxDifference",
"=",
"0.15",
")",
":",
"bool",
"{",
"if",
"(",
"$",
"this",
"->",
"isQuadratic",
"(",
")",
")",
"{",
"return",
"true",
";",
"}",
"if",
"(",
"$",
"maxDifference",
">="... | Returns if the current size uses a near quadratic format. It means, if width and height
difference is lower or equal to ?? percent.
@param double $maxDifference If you want to change the allowed difference percent value you can do it here.
Valid values here are 0.01 (means 1%) to 0.3 (means 30%) default is 0.15
@retur... | [
"Returns",
"if",
"the",
"current",
"size",
"uses",
"a",
"near",
"quadratic",
"format",
".",
"It",
"means",
"if",
"width",
"and",
"height",
"difference",
"is",
"lower",
"or",
"equal",
"to",
"??",
"percent",
"."
] | 9c82874cf4ec68cb0af78757b65f19783540004a | https://github.com/SagittariusX/Beluga.Drawing/blob/9c82874cf4ec68cb0af78757b65f19783540004a/src/Beluga/Drawing/Size.php#L261-L285 |
194,251 | SagittariusX/Beluga.Drawing | src/Beluga/Drawing/Size.php | Size.reduceToMaxSize | public final function reduceToMaxSize( Size $maxSize ) : bool
{
$this->triggerFixedErrorByNeed( 'reduceToMaxSize' );
if ( ( $this->_width < $maxSize->_width )
&& ( $this->_height < $maxSize->_height ) )
{
return false;
}
if ( ( $this->_width === $maxSize->_width )
... | php | public final function reduceToMaxSize( Size $maxSize ) : bool
{
$this->triggerFixedErrorByNeed( 'reduceToMaxSize' );
if ( ( $this->_width < $maxSize->_width )
&& ( $this->_height < $maxSize->_height ) )
{
return false;
}
if ( ( $this->_width === $maxSize->_width )
... | [
"public",
"final",
"function",
"reduceToMaxSize",
"(",
"Size",
"$",
"maxSize",
")",
":",
"bool",
"{",
"$",
"this",
"->",
"triggerFixedErrorByNeed",
"(",
"'reduceToMaxSize'",
")",
";",
"if",
"(",
"(",
"$",
"this",
"->",
"_width",
"<",
"$",
"maxSize",
"->",
... | Decrease the current size to fit the defined Size, by holding its proportions.
@param \Beluga\Drawing\Size $maxSize
@return bool TRUE on success, or FALSE, if current size is already smaller than defined size.
@throws \Beluga\BelugaError If the instance is set to fixed. | [
"Decrease",
"the",
"current",
"size",
"to",
"fit",
"the",
"defined",
"Size",
"by",
"holding",
"its",
"proportions",
"."
] | 9c82874cf4ec68cb0af78757b65f19783540004a | https://github.com/SagittariusX/Beluga.Drawing/blob/9c82874cf4ec68cb0af78757b65f19783540004a/src/Beluga/Drawing/Size.php#L347-L393 |
194,252 | SagittariusX/Beluga.Drawing | src/Beluga/Drawing/Size.php | Size.reduceMinSideTo | public final function reduceMinSideTo( int $newShortSideLength ) : bool
{
$this->triggerFixedErrorByNeed( 'reduceMinSideTo' );
if ( $this->isPortrait() )
{
if ( $newShortSideLength >= $this->_width )
{
return false;
}
$resultPercent = ( 100 * $new... | php | public final function reduceMinSideTo( int $newShortSideLength ) : bool
{
$this->triggerFixedErrorByNeed( 'reduceMinSideTo' );
if ( $this->isPortrait() )
{
if ( $newShortSideLength >= $this->_width )
{
return false;
}
$resultPercent = ( 100 * $new... | [
"public",
"final",
"function",
"reduceMinSideTo",
"(",
"int",
"$",
"newShortSideLength",
")",
":",
"bool",
"{",
"$",
"this",
"->",
"triggerFixedErrorByNeed",
"(",
"'reduceMinSideTo'",
")",
";",
"if",
"(",
"$",
"this",
"->",
"isPortrait",
"(",
")",
")",
"{",
... | Decrease the shortest side to the defined length and also contracts the longer side to hold the proportion
of this size. If the current size defines a quadratic size, it is also decreased but with searching the
longer side.
@param int $newShortSideLength
@return bool TRUE on success, or FALSE if shortest side is alre... | [
"Decrease",
"the",
"shortest",
"side",
"to",
"the",
"defined",
"length",
"and",
"also",
"contracts",
"the",
"longer",
"side",
"to",
"hold",
"the",
"proportion",
"of",
"this",
"size",
".",
"If",
"the",
"current",
"size",
"defines",
"a",
"quadratic",
"size",
... | 9c82874cf4ec68cb0af78757b65f19783540004a | https://github.com/SagittariusX/Beluga.Drawing/blob/9c82874cf4ec68cb0af78757b65f19783540004a/src/Beluga/Drawing/Size.php#L513-L557 |
194,253 | SagittariusX/Beluga.Drawing | src/Beluga/Drawing/Size.php | Size.reduceMinSideTo2 | public final function reduceMinSideTo2( int $newLandscapeMaxHeight, int $newPortraitMaxWidth ) : bool
{
$this->triggerFixedErrorByNeed( 'reduceMinSideTo2' );
if ( $this->isPortrait() )
{
if ( $newPortraitMaxWidth >= $this->_width )
{
return false;
}
... | php | public final function reduceMinSideTo2( int $newLandscapeMaxHeight, int $newPortraitMaxWidth ) : bool
{
$this->triggerFixedErrorByNeed( 'reduceMinSideTo2' );
if ( $this->isPortrait() )
{
if ( $newPortraitMaxWidth >= $this->_width )
{
return false;
}
... | [
"public",
"final",
"function",
"reduceMinSideTo2",
"(",
"int",
"$",
"newLandscapeMaxHeight",
",",
"int",
"$",
"newPortraitMaxWidth",
")",
":",
"bool",
"{",
"$",
"this",
"->",
"triggerFixedErrorByNeed",
"(",
"'reduceMinSideTo2'",
")",
";",
"if",
"(",
"$",
"this",... | Decrease the shortest side to the defined length and also contracts the longer side to hold the proportion
of this size. The value, used as max side length is depending to the current size format.
$newLandscapeMaxHeight is used if the current size uses a landscape ord quadratic format. Otherwise the
$newPortraitMaxWid... | [
"Decrease",
"the",
"shortest",
"side",
"to",
"the",
"defined",
"length",
"and",
"also",
"contracts",
"the",
"longer",
"side",
"to",
"hold",
"the",
"proportion",
"of",
"this",
"size",
".",
"The",
"value",
"used",
"as",
"max",
"side",
"length",
"is",
"depend... | 9c82874cf4ec68cb0af78757b65f19783540004a | https://github.com/SagittariusX/Beluga.Drawing/blob/9c82874cf4ec68cb0af78757b65f19783540004a/src/Beluga/Drawing/Size.php#L571-L611 |
194,254 | SagittariusX/Beluga.Drawing | src/Beluga/Drawing/Size.php | Size.expandMaxSideTo | public final function expandMaxSideTo( int $newMaxSideLength ) : bool
{
$this->triggerFixedErrorByNeed( 'expandMaxSideTo' );
if ( $this->isPortrait() )
{
if ( $newMaxSideLength < $this->_height )
{
return false;
}
$resultPercent = ( 100 * $newMaxSi... | php | public final function expandMaxSideTo( int $newMaxSideLength ) : bool
{
$this->triggerFixedErrorByNeed( 'expandMaxSideTo' );
if ( $this->isPortrait() )
{
if ( $newMaxSideLength < $this->_height )
{
return false;
}
$resultPercent = ( 100 * $newMaxSi... | [
"public",
"final",
"function",
"expandMaxSideTo",
"(",
"int",
"$",
"newMaxSideLength",
")",
":",
"bool",
"{",
"$",
"this",
"->",
"triggerFixedErrorByNeed",
"(",
"'expandMaxSideTo'",
")",
";",
"if",
"(",
"$",
"this",
"->",
"isPortrait",
"(",
")",
")",
"{",
... | Expands the longest side to the defined length and also expands the shorter side to hold the proportion
of this size. If the current size defines a quadratic size, its also expanded but without searching the
longer side.
@param integer $newMaxSideLength
@return boolean TRUE on success, or FALSE if longest side is alr... | [
"Expands",
"the",
"longest",
"side",
"to",
"the",
"defined",
"length",
"and",
"also",
"expands",
"the",
"shorter",
"side",
"to",
"hold",
"the",
"proportion",
"of",
"this",
"size",
".",
"If",
"the",
"current",
"size",
"defines",
"a",
"quadratic",
"size",
"i... | 9c82874cf4ec68cb0af78757b65f19783540004a | https://github.com/SagittariusX/Beluga.Drawing/blob/9c82874cf4ec68cb0af78757b65f19783540004a/src/Beluga/Drawing/Size.php#L646-L686 |
194,255 | SagittariusX/Beluga.Drawing | src/Beluga/Drawing/Size.php | Size.expandMaxSideTo2 | public final function expandMaxSideTo2( int $newLandscapeMaxWidth, int $newPortraitMaxHeight ) : bool
{
$this->triggerFixedErrorByNeed( 'expandMaxSideTo2' );
if ( $this->isPortrait() )
{
if ( $newPortraitMaxHeight <= $this->_height )
{
return false;
}
... | php | public final function expandMaxSideTo2( int $newLandscapeMaxWidth, int $newPortraitMaxHeight ) : bool
{
$this->triggerFixedErrorByNeed( 'expandMaxSideTo2' );
if ( $this->isPortrait() )
{
if ( $newPortraitMaxHeight <= $this->_height )
{
return false;
}
... | [
"public",
"final",
"function",
"expandMaxSideTo2",
"(",
"int",
"$",
"newLandscapeMaxWidth",
",",
"int",
"$",
"newPortraitMaxHeight",
")",
":",
"bool",
"{",
"$",
"this",
"->",
"triggerFixedErrorByNeed",
"(",
"'expandMaxSideTo2'",
")",
";",
"if",
"(",
"$",
"this",... | Expands the longest side to the defined length and also expands the shorter side to hold the proportion
of this size. The value, used as max side length is depending to the current size format.
$newLandscapeMaxWidth is used if the current size uses a landscape ord quadratic format. Otherwise the
$newPortraitMaxHeight ... | [
"Expands",
"the",
"longest",
"side",
"to",
"the",
"defined",
"length",
"and",
"also",
"expands",
"the",
"shorter",
"side",
"to",
"hold",
"the",
"proportion",
"of",
"this",
"size",
".",
"The",
"value",
"used",
"as",
"max",
"side",
"length",
"is",
"depending... | 9c82874cf4ec68cb0af78757b65f19783540004a | https://github.com/SagittariusX/Beluga.Drawing/blob/9c82874cf4ec68cb0af78757b65f19783540004a/src/Beluga/Drawing/Size.php#L700-L740 |
194,256 | SagittariusX/Beluga.Drawing | src/Beluga/Drawing/Size.php | Size.resizeMaxSideTo2 | public final function resizeMaxSideTo2( int $newLandscapeWidth, int $newPortraitHeight ) : bool
{
if ( $this->isPortrait() )
{
// Portrait format
if ( $newPortraitHeight == $this->_height )
{
// No resizing required
return false;
}
... | php | public final function resizeMaxSideTo2( int $newLandscapeWidth, int $newPortraitHeight ) : bool
{
if ( $this->isPortrait() )
{
// Portrait format
if ( $newPortraitHeight == $this->_height )
{
// No resizing required
return false;
}
... | [
"public",
"final",
"function",
"resizeMaxSideTo2",
"(",
"int",
"$",
"newLandscapeWidth",
",",
"int",
"$",
"newPortraitHeight",
")",
":",
"bool",
"{",
"if",
"(",
"$",
"this",
"->",
"isPortrait",
"(",
")",
")",
"{",
"// Portrait format",
"if",
"(",
"$",
"new... | Resize the longest side to the defined length and also resize the shorter side to hold the proportion
of this size. The value, used as max side length is depending to the current size format.
$newLandscapeWidth is used if the current size uses a landscape ord quadratic format. Otherwise the
$newPortraitHeight is used.... | [
"Resize",
"the",
"longest",
"side",
"to",
"the",
"defined",
"length",
"and",
"also",
"resize",
"the",
"shorter",
"side",
"to",
"hold",
"the",
"proportion",
"of",
"this",
"size",
".",
"The",
"value",
"used",
"as",
"max",
"side",
"length",
"is",
"depending",... | 9c82874cf4ec68cb0af78757b65f19783540004a | https://github.com/SagittariusX/Beluga.Drawing/blob/9c82874cf4ec68cb0af78757b65f19783540004a/src/Beluga/Drawing/Size.php#L819-L861 |
194,257 | SagittariusX/Beluga.Drawing | src/Beluga/Drawing/Size.php | Size.TryParse | public static function TryParse( $value, &$size, bool $fixed = false ) : bool
{
$size = null;
if ( \is_int( $value ) )
{
// An single integer value will result in an quadratic size
$size = new Size( $value, $value, $fixed );
return true;
}
if ( \is_double( ... | php | public static function TryParse( $value, &$size, bool $fixed = false ) : bool
{
$size = null;
if ( \is_int( $value ) )
{
// An single integer value will result in an quadratic size
$size = new Size( $value, $value, $fixed );
return true;
}
if ( \is_double( ... | [
"public",
"static",
"function",
"TryParse",
"(",
"$",
"value",
",",
"&",
"$",
"size",
",",
"bool",
"$",
"fixed",
"=",
"false",
")",
":",
"bool",
"{",
"$",
"size",
"=",
"null",
";",
"if",
"(",
"\\",
"is_int",
"(",
"$",
"value",
")",
")",
"{",
"/... | Tries to parse the the defined values as a size and returns the success state.
If parsing was successful (TRUE is returned) the resulting Beluga\Drawing\Size is
returned by the $size parameter.
@param mixed $value int|double|array|string|image-resource
@param \Beluga\Drawing\Size $size The resulting {@s... | [
"Tries",
"to",
"parse",
"the",
"the",
"defined",
"values",
"as",
"a",
"size",
"and",
"returns",
"the",
"success",
"state",
"."
] | 9c82874cf4ec68cb0af78757b65f19783540004a | https://github.com/SagittariusX/Beluga.Drawing/blob/9c82874cf4ec68cb0af78757b65f19783540004a/src/Beluga/Drawing/Size.php#L1065-L1112 |
194,258 | SagittariusX/Beluga.Drawing | src/Beluga/Drawing/Size.php | Size.Empty | public static function Empty( bool $fixed = false ) : Size
{
if ( $fixed )
{
return \is_null( static::$emptyFixed )
? ( static::$emptyFixed = new Size( 0, 0, true ) )
: static::$emptyFixed;
}
return new Size( 0, 0, $fixed );
} | php | public static function Empty( bool $fixed = false ) : Size
{
if ( $fixed )
{
return \is_null( static::$emptyFixed )
? ( static::$emptyFixed = new Size( 0, 0, true ) )
: static::$emptyFixed;
}
return new Size( 0, 0, $fixed );
} | [
"public",
"static",
"function",
"Empty",
"(",
"bool",
"$",
"fixed",
"=",
"false",
")",
":",
"Size",
"{",
"if",
"(",
"$",
"fixed",
")",
"{",
"return",
"\\",
"is_null",
"(",
"static",
"::",
"$",
"emptyFixed",
")",
"?",
"(",
"static",
"::",
"$",
"empt... | Gets a empty Size instance.
@param bool $fixed Is this instance fixed? (fixed is the read-only mode).
@return \Beluga\Drawing\Size | [
"Gets",
"a",
"empty",
"Size",
"instance",
"."
] | 9c82874cf4ec68cb0af78757b65f19783540004a | https://github.com/SagittariusX/Beluga.Drawing/blob/9c82874cf4ec68cb0af78757b65f19783540004a/src/Beluga/Drawing/Size.php#L1168-L1180 |
194,259 | togucms/ApplicationModelsBundle | Document/BasePage.php | BasePage.getAllSections | public function getAllSections() {
$sections = array();
$section = $this->section;
do {
$sections[] = $section;
} while($section = $section->getSectionConfig()->getParentSection());
return array_reverse($sections);
} | php | public function getAllSections() {
$sections = array();
$section = $this->section;
do {
$sections[] = $section;
} while($section = $section->getSectionConfig()->getParentSection());
return array_reverse($sections);
} | [
"public",
"function",
"getAllSections",
"(",
")",
"{",
"$",
"sections",
"=",
"array",
"(",
")",
";",
"$",
"section",
"=",
"$",
"this",
"->",
"section",
";",
"do",
"{",
"$",
"sections",
"[",
"]",
"=",
"$",
"section",
";",
"}",
"while",
"(",
"$",
"... | Recursively gets all the sections
@return array | [
"Recursively",
"gets",
"all",
"the",
"sections"
] | 125ab47e0327d17afdedb8db074c9d7e211e6417 | https://github.com/togucms/ApplicationModelsBundle/blob/125ab47e0327d17afdedb8db074c9d7e211e6417/Document/BasePage.php#L118-L126 |
194,260 | RudyMas/xml_json | src/XML_JSON/XML_JSON.php | XML_JSON.xml2array | public function xml2array(): void
{
$this->xml2json();
$this->arrayData = json_decode($this->jsonData, TRUE);
} | php | public function xml2array(): void
{
$this->xml2json();
$this->arrayData = json_decode($this->jsonData, TRUE);
} | [
"public",
"function",
"xml2array",
"(",
")",
":",
"void",
"{",
"$",
"this",
"->",
"xml2json",
"(",
")",
";",
"$",
"this",
"->",
"arrayData",
"=",
"json_decode",
"(",
"$",
"this",
"->",
"jsonData",
",",
"TRUE",
")",
";",
"}"
] | Convert XML to Array | [
"Convert",
"XML",
"to",
"Array"
] | b27edf82f838e587caa0a93a46402dd0e45b5372 | https://github.com/RudyMas/xml_json/blob/b27edf82f838e587caa0a93a46402dd0e45b5372/src/XML_JSON/XML_JSON.php#L74-L78 |
194,261 | RudyMas/xml_json | src/XML_JSON/XML_JSON.php | XML_JSON.array2xml | public function array2xml(string $xmlField = '', ?string $dataField = null): void
{
$xml = new SimpleXMLElement('<?xml version="1.0" encoding="UTF-8"?><' . $xmlField . '/>');
$this->createXml($xml, $this->arrayData, $dataField);
$this->xmlData = $xml->asXML();
} | php | public function array2xml(string $xmlField = '', ?string $dataField = null): void
{
$xml = new SimpleXMLElement('<?xml version="1.0" encoding="UTF-8"?><' . $xmlField . '/>');
$this->createXml($xml, $this->arrayData, $dataField);
$this->xmlData = $xml->asXML();
} | [
"public",
"function",
"array2xml",
"(",
"string",
"$",
"xmlField",
"=",
"''",
",",
"?",
"string",
"$",
"dataField",
"=",
"null",
")",
":",
"void",
"{",
"$",
"xml",
"=",
"new",
"SimpleXMLElement",
"(",
"'<?xml version=\"1.0\" encoding=\"UTF-8\"?><'",
".",
"$",
... | Convert Array to XML
@param string $xmlField The opening tag for the XML file
@param string|null $dataField | [
"Convert",
"Array",
"to",
"XML"
] | b27edf82f838e587caa0a93a46402dd0e45b5372 | https://github.com/RudyMas/xml_json/blob/b27edf82f838e587caa0a93a46402dd0e45b5372/src/XML_JSON/XML_JSON.php#L86-L91 |
194,262 | RudyMas/xml_json | src/XML_JSON/XML_JSON.php | XML_JSON.createXml | private function createXml(SimpleXMLElement $obj, array $array, ?string $prevKey = 'data'): void
{
foreach ($array as $key => $value) {
if (is_array($value)) {
if (is_numeric($key)) {
$node = $obj->addChild($prevKey);
$this->createXml($node... | php | private function createXml(SimpleXMLElement $obj, array $array, ?string $prevKey = 'data'): void
{
foreach ($array as $key => $value) {
if (is_array($value)) {
if (is_numeric($key)) {
$node = $obj->addChild($prevKey);
$this->createXml($node... | [
"private",
"function",
"createXml",
"(",
"SimpleXMLElement",
"$",
"obj",
",",
"array",
"$",
"array",
",",
"?",
"string",
"$",
"prevKey",
"=",
"'data'",
")",
":",
"void",
"{",
"foreach",
"(",
"$",
"array",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{... | Private method to create XML output
@param SimpleXMLElement $obj
@param array $array
@param null|string $prevKey | [
"Private",
"method",
"to",
"create",
"XML",
"output"
] | b27edf82f838e587caa0a93a46402dd0e45b5372 | https://github.com/RudyMas/xml_json/blob/b27edf82f838e587caa0a93a46402dd0e45b5372/src/XML_JSON/XML_JSON.php#L100-L123 |
194,263 | RudyMas/xml_json | src/XML_JSON/XML_JSON.php | XML_JSON.xml2json | public function xml2json(): void
{
$xml = simplexml_load_string($this->xmlData, NULL, LIBXML_NOCDATA);
$this->jsonData = json_encode($xml);
} | php | public function xml2json(): void
{
$xml = simplexml_load_string($this->xmlData, NULL, LIBXML_NOCDATA);
$this->jsonData = json_encode($xml);
} | [
"public",
"function",
"xml2json",
"(",
")",
":",
"void",
"{",
"$",
"xml",
"=",
"simplexml_load_string",
"(",
"$",
"this",
"->",
"xmlData",
",",
"NULL",
",",
"LIBXML_NOCDATA",
")",
";",
"$",
"this",
"->",
"jsonData",
"=",
"json_encode",
"(",
"$",
"xml",
... | Convert XML to JSON | [
"Convert",
"XML",
"to",
"JSON"
] | b27edf82f838e587caa0a93a46402dd0e45b5372 | https://github.com/RudyMas/xml_json/blob/b27edf82f838e587caa0a93a46402dd0e45b5372/src/XML_JSON/XML_JSON.php#L144-L148 |
194,264 | thomasez/BisonLabSakonninBundle | Controller/MessageTypeController.php | MessageTypeController.indexAction | public function indexAction()
{
$em = $this->getDoctrineManager();
$entities = $em->getRepository('BisonLabSakonninBundle:MessageType')->findAll();
$parents = $em->createQueryBuilder()
->select('mt')
->from('BisonLab\SakonninBundle\Entity\MessageType', 'm... | php | public function indexAction()
{
$em = $this->getDoctrineManager();
$entities = $em->getRepository('BisonLabSakonninBundle:MessageType')->findAll();
$parents = $em->createQueryBuilder()
->select('mt')
->from('BisonLab\SakonninBundle\Entity\MessageType', 'm... | [
"public",
"function",
"indexAction",
"(",
")",
"{",
"$",
"em",
"=",
"$",
"this",
"->",
"getDoctrineManager",
"(",
")",
";",
"$",
"entities",
"=",
"$",
"em",
"->",
"getRepository",
"(",
"'BisonLabSakonninBundle:MessageType'",
")",
"->",
"findAll",
"(",
")",
... | Lists all MessageType entities.
@Route("/", name="messagetype", methods={"GET"}) | [
"Lists",
"all",
"MessageType",
"entities",
"."
] | 45ca7ce9874c4a2be7b503d7067b3d11d2b518cb | https://github.com/thomasez/BisonLabSakonninBundle/blob/45ca7ce9874c4a2be7b503d7067b3d11d2b518cb/Controller/MessageTypeController.php#L32-L54 |
194,265 | thomasez/BisonLabSakonninBundle | Controller/MessageTypeController.php | MessageTypeController.createAction | public function createAction(Request $request)
{
$entity = new MessageType();
$form = $this->createCreateForm($entity);
$form->handleRequest($request);
$data = $form->getData();
if (!$data->getParent() && !isset($request->request->get($form->getName())['create_group'])) {
... | php | public function createAction(Request $request)
{
$entity = new MessageType();
$form = $this->createCreateForm($entity);
$form->handleRequest($request);
$data = $form->getData();
if (!$data->getParent() && !isset($request->request->get($form->getName())['create_group'])) {
... | [
"public",
"function",
"createAction",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"entity",
"=",
"new",
"MessageType",
"(",
")",
";",
"$",
"form",
"=",
"$",
"this",
"->",
"createCreateForm",
"(",
"$",
"entity",
")",
";",
"$",
"form",
"->",
"handleRe... | Creates a new MessageType entity.
@Route("/", name="messagetype_create", methods={"POST"}) | [
"Creates",
"a",
"new",
"MessageType",
"entity",
"."
] | 45ca7ce9874c4a2be7b503d7067b3d11d2b518cb | https://github.com/thomasez/BisonLabSakonninBundle/blob/45ca7ce9874c4a2be7b503d7067b3d11d2b518cb/Controller/MessageTypeController.php#L61-L83 |
194,266 | thomasez/BisonLabSakonninBundle | Controller/MessageTypeController.php | MessageTypeController.createCreateForm | private function createCreateForm(MessageType $entity)
{
$form = $this->createForm(MessageTypeType::class, $entity, array(
'action' => $this->generateUrl('messagetype_create'),
'method' => 'POST',
));
$this->_addFunctionsToForm($form);
$form->add('create_grou... | php | private function createCreateForm(MessageType $entity)
{
$form = $this->createForm(MessageTypeType::class, $entity, array(
'action' => $this->generateUrl('messagetype_create'),
'method' => 'POST',
));
$this->_addFunctionsToForm($form);
$form->add('create_grou... | [
"private",
"function",
"createCreateForm",
"(",
"MessageType",
"$",
"entity",
")",
"{",
"$",
"form",
"=",
"$",
"this",
"->",
"createForm",
"(",
"MessageTypeType",
"::",
"class",
",",
"$",
"entity",
",",
"array",
"(",
"'action'",
"=>",
"$",
"this",
"->",
... | Creates a form to create a MessageType entity.
@param MessageType $entity The entity
@return \Symfony\Component\Form\Form The form | [
"Creates",
"a",
"form",
"to",
"create",
"a",
"MessageType",
"entity",
"."
] | 45ca7ce9874c4a2be7b503d7067b3d11d2b518cb | https://github.com/thomasez/BisonLabSakonninBundle/blob/45ca7ce9874c4a2be7b503d7067b3d11d2b518cb/Controller/MessageTypeController.php#L92-L104 |
194,267 | thomasez/BisonLabSakonninBundle | Controller/MessageTypeController.php | MessageTypeController.newAction | public function newAction()
{
$entity = new MessageType();
$form = $this->createCreateForm($entity);
return $this->render(
'BisonLabSakonninBundle:MessageType:edit.html.twig', array(
'entity' => $entity,
'edit_form' => $form->createView(),
));... | php | public function newAction()
{
$entity = new MessageType();
$form = $this->createCreateForm($entity);
return $this->render(
'BisonLabSakonninBundle:MessageType:edit.html.twig', array(
'entity' => $entity,
'edit_form' => $form->createView(),
));... | [
"public",
"function",
"newAction",
"(",
")",
"{",
"$",
"entity",
"=",
"new",
"MessageType",
"(",
")",
";",
"$",
"form",
"=",
"$",
"this",
"->",
"createCreateForm",
"(",
"$",
"entity",
")",
";",
"return",
"$",
"this",
"->",
"render",
"(",
"'BisonLabSako... | Displays a form to create a new MessageType entity.
@Route("/new", name="messagetype_new", methods={"GET"}) | [
"Displays",
"a",
"form",
"to",
"create",
"a",
"new",
"MessageType",
"entity",
"."
] | 45ca7ce9874c4a2be7b503d7067b3d11d2b518cb | https://github.com/thomasez/BisonLabSakonninBundle/blob/45ca7ce9874c4a2be7b503d7067b3d11d2b518cb/Controller/MessageTypeController.php#L111-L121 |
194,268 | thomasez/BisonLabSakonninBundle | Controller/MessageTypeController.php | MessageTypeController.createEditForm | private function createEditForm(MessageType $entity)
{
$form = $this->createForm(MessageTypeType::class, $entity, array(
'action' => $this->generateUrl('messagetype_update', array('id' => $entity->getId())),
'method' => 'PUT',
));
$this->_addFunctionsToForm($form);
... | php | private function createEditForm(MessageType $entity)
{
$form = $this->createForm(MessageTypeType::class, $entity, array(
'action' => $this->generateUrl('messagetype_update', array('id' => $entity->getId())),
'method' => 'PUT',
));
$this->_addFunctionsToForm($form);
... | [
"private",
"function",
"createEditForm",
"(",
"MessageType",
"$",
"entity",
")",
"{",
"$",
"form",
"=",
"$",
"this",
"->",
"createForm",
"(",
"MessageTypeType",
"::",
"class",
",",
"$",
"entity",
",",
"array",
"(",
"'action'",
"=>",
"$",
"this",
"->",
"g... | Creates a form to edit a MessageType entity.
@param MessageType $entity The entity
@return \Symfony\Component\Form\Form The form | [
"Creates",
"a",
"form",
"to",
"edit",
"a",
"MessageType",
"entity",
"."
] | 45ca7ce9874c4a2be7b503d7067b3d11d2b518cb | https://github.com/thomasez/BisonLabSakonninBundle/blob/45ca7ce9874c4a2be7b503d7067b3d11d2b518cb/Controller/MessageTypeController.php#L179-L189 |
194,269 | thomasez/BisonLabSakonninBundle | Controller/MessageTypeController.php | MessageTypeController.updateAction | public function updateAction(Request $request, $id)
{
$em = $this->getDoctrineManager();
$entity = $em->getRepository('BisonLabSakonninBundle:MessageType')->find($id);
if (!$entity) {
throw $this->createNotFoundException('Unable to find MessageType entity.');
}
... | php | public function updateAction(Request $request, $id)
{
$em = $this->getDoctrineManager();
$entity = $em->getRepository('BisonLabSakonninBundle:MessageType')->find($id);
if (!$entity) {
throw $this->createNotFoundException('Unable to find MessageType entity.');
}
... | [
"public",
"function",
"updateAction",
"(",
"Request",
"$",
"request",
",",
"$",
"id",
")",
"{",
"$",
"em",
"=",
"$",
"this",
"->",
"getDoctrineManager",
"(",
")",
";",
"$",
"entity",
"=",
"$",
"em",
"->",
"getRepository",
"(",
"'BisonLabSakonninBundle:Mess... | Edits an existing MessageType entity.
@Route("/{id}", name="messagetype_update", methods={"PUT"}) | [
"Edits",
"an",
"existing",
"MessageType",
"entity",
"."
] | 45ca7ce9874c4a2be7b503d7067b3d11d2b518cb | https://github.com/thomasez/BisonLabSakonninBundle/blob/45ca7ce9874c4a2be7b503d7067b3d11d2b518cb/Controller/MessageTypeController.php#L196-L220 |
194,270 | thomasez/BisonLabSakonninBundle | Controller/MessageTypeController.php | MessageTypeController.deleteAction | public function deleteAction(Request $request, $id)
{
$form = $this->createDeleteForm($id);
$form->handleRequest($request);
if ($form->isValid()) {
$em = $this->getDoctrineManager();
$entity = $em->getRepository('BisonLabSakonninBundle:MessageType')->find($id);
... | php | public function deleteAction(Request $request, $id)
{
$form = $this->createDeleteForm($id);
$form->handleRequest($request);
if ($form->isValid()) {
$em = $this->getDoctrineManager();
$entity = $em->getRepository('BisonLabSakonninBundle:MessageType')->find($id);
... | [
"public",
"function",
"deleteAction",
"(",
"Request",
"$",
"request",
",",
"$",
"id",
")",
"{",
"$",
"form",
"=",
"$",
"this",
"->",
"createDeleteForm",
"(",
"$",
"id",
")",
";",
"$",
"form",
"->",
"handleRequest",
"(",
"$",
"request",
")",
";",
"if"... | Deletes a MessageType entity.
@Route("/{id}", name="messagetype_delete", methods={"DELETE"}) | [
"Deletes",
"a",
"MessageType",
"entity",
"."
] | 45ca7ce9874c4a2be7b503d7067b3d11d2b518cb | https://github.com/thomasez/BisonLabSakonninBundle/blob/45ca7ce9874c4a2be7b503d7067b3d11d2b518cb/Controller/MessageTypeController.php#L227-L244 |
194,271 | mossphp/moss-storage | Moss/Storage/Query/EventDispatcher/EventDispatcher.php | EventDispatcher.register | public function register($event, callable $listener, $priority = null)
{
foreach ((array) $event as $e) {
$this->registerListener($e, $listener, $priority);
}
return $this;
} | php | public function register($event, callable $listener, $priority = null)
{
foreach ((array) $event as $e) {
$this->registerListener($e, $listener, $priority);
}
return $this;
} | [
"public",
"function",
"register",
"(",
"$",
"event",
",",
"callable",
"$",
"listener",
",",
"$",
"priority",
"=",
"null",
")",
"{",
"foreach",
"(",
"(",
"array",
")",
"$",
"event",
"as",
"$",
"e",
")",
"{",
"$",
"this",
"->",
"registerListener",
"(",... | Adds listener to single event or array of events
@param string|array $event
@param callable $listener
@param null|int $priority
@return $this | [
"Adds",
"listener",
"to",
"single",
"event",
"or",
"array",
"of",
"events"
] | 0d123e7ae6bbfce1e2a18e73bf70997277b430c1 | https://github.com/mossphp/moss-storage/blob/0d123e7ae6bbfce1e2a18e73bf70997277b430c1/Moss/Storage/Query/EventDispatcher/EventDispatcher.php#L36-L43 |
194,272 | phossa/phossa-di | src/Phossa/Di/Factory/ServiceFactoryTrait.php | ServiceFactoryTrait.resolvePseudoCallable | protected function resolvePseudoCallable($callableOrArray)
{
if (is_array($callableOrArray)) {
$this->dereferenceArray($callableOrArray);
}
// normal callable
if (is_callable($callableOrArray)) {
return $callableOrArray;
} else {
throw new... | php | protected function resolvePseudoCallable($callableOrArray)
{
if (is_array($callableOrArray)) {
$this->dereferenceArray($callableOrArray);
}
// normal callable
if (is_callable($callableOrArray)) {
return $callableOrArray;
} else {
throw new... | [
"protected",
"function",
"resolvePseudoCallable",
"(",
"$",
"callableOrArray",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"callableOrArray",
")",
")",
"{",
"$",
"this",
"->",
"dereferenceArray",
"(",
"$",
"callableOrArray",
")",
";",
"}",
"// normal callable",
... | Resolve a fake callable to a real one
fake callable like `[ '@cache@', 'setLogger' ]` or
`[ new ServiceReference('cache'), 'setLogger' ]`
@param callable|array $callableOrArray
@return callable
@throws LogicException
@throws NotFoundException
@access protected | [
"Resolve",
"a",
"fake",
"callable",
"to",
"a",
"real",
"one"
] | bbe1e95b081068e2bc49c6cd465f38aab0374be5 | https://github.com/phossa/phossa-di/blob/bbe1e95b081068e2bc49c6cd465f38aab0374be5/src/Phossa/Di/Factory/ServiceFactoryTrait.php#L68-L83 |
194,273 | phossa/phossa-di | src/Phossa/Di/Factory/ServiceFactoryTrait.php | ServiceFactoryTrait.resolveCallableArguments | protected function resolveCallableArguments(
callable $callable,
array $providedArguments
)/*# : array */ {
// object with __invoke defined or \Closure
if (is_object($callable) && !$callable instanceof \Closure) {
$reflector = new \ReflectionClass($callable);
... | php | protected function resolveCallableArguments(
callable $callable,
array $providedArguments
)/*# : array */ {
// object with __invoke defined or \Closure
if (is_object($callable) && !$callable instanceof \Closure) {
$reflector = new \ReflectionClass($callable);
... | [
"protected",
"function",
"resolveCallableArguments",
"(",
"callable",
"$",
"callable",
",",
"array",
"$",
"providedArguments",
")",
"/*# : array */",
"{",
"// object with __invoke defined or \\Closure",
"if",
"(",
"is_object",
"(",
"$",
"callable",
")",
"&&",
"!",
"$"... | Resolve arguments for a callable
@param callable $callable
@param array $providedArguments the provided arguments
@return array the resolved arguments
@throws LogicException
@throws NotFoundException
@access protected | [
"Resolve",
"arguments",
"for",
"a",
"callable"
] | bbe1e95b081068e2bc49c6cd465f38aab0374be5 | https://github.com/phossa/phossa-di/blob/bbe1e95b081068e2bc49c6cd465f38aab0374be5/src/Phossa/Di/Factory/ServiceFactoryTrait.php#L95-L122 |
194,274 | phossa/phossa-di | src/Phossa/Di/Factory/ServiceFactoryTrait.php | ServiceFactoryTrait.getObjectByClassname | protected function getObjectByClassname(/*# string */ $classname)
{
// mapping exists
if (isset($this->mappings[$classname])) {
$classname = $this->mappings[$classname];
// is it a reference ? #changed
if (false !== ($ref = $this->isReference($classname))) {
... | php | protected function getObjectByClassname(/*# string */ $classname)
{
// mapping exists
if (isset($this->mappings[$classname])) {
$classname = $this->mappings[$classname];
// is it a reference ? #changed
if (false !== ($ref = $this->isReference($classname))) {
... | [
"protected",
"function",
"getObjectByClassname",
"(",
"/*# string */",
"$",
"classname",
")",
"{",
"// mapping exists",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"mappings",
"[",
"$",
"classname",
"]",
")",
")",
"{",
"$",
"classname",
"=",
"$",
"this",
"... | Get an object base on provided classname
@param string $classname class name
@return object
@throws LogicException
@access protected
@api | [
"Get",
"an",
"object",
"base",
"on",
"provided",
"classname"
] | bbe1e95b081068e2bc49c6cd465f38aab0374be5 | https://github.com/phossa/phossa-di/blob/bbe1e95b081068e2bc49c6cd465f38aab0374be5/src/Phossa/Di/Factory/ServiceFactoryTrait.php#L243-L262 |
194,275 | phossa/phossa-di | src/Phossa/Di/Factory/ServiceFactoryTrait.php | ServiceFactoryTrait.createServiceObject | protected function createServiceObject(/*# string */ $id, array $arguments)
{
// class definition
$def = &$this->services[$id]['class'];
$class = $def[0];
// prepare constructor arguments
$args = empty($arguments) ?
(isset($def[1]) ? $def[1] : []) : $arguments... | php | protected function createServiceObject(/*# string */ $id, array $arguments)
{
// class definition
$def = &$this->services[$id]['class'];
$class = $def[0];
// prepare constructor arguments
$args = empty($arguments) ?
(isset($def[1]) ? $def[1] : []) : $arguments... | [
"protected",
"function",
"createServiceObject",
"(",
"/*# string */",
"$",
"id",
",",
"array",
"$",
"arguments",
")",
"{",
"// class definition",
"$",
"def",
"=",
"&",
"$",
"this",
"->",
"services",
"[",
"$",
"id",
"]",
"[",
"'class'",
"]",
";",
"$",
"cl... | Create service object from service definition
@param string $id service id
@param array $arguments
@return object
@throws LogicException if something goes wrong
@access protected | [
"Create",
"service",
"object",
"from",
"service",
"definition"
] | bbe1e95b081068e2bc49c6cd465f38aab0374be5 | https://github.com/phossa/phossa-di/blob/bbe1e95b081068e2bc49c6cd465f38aab0374be5/src/Phossa/Di/Factory/ServiceFactoryTrait.php#L273-L314 |
194,276 | phossa/phossa-di | src/Phossa/Di/Factory/ServiceFactoryTrait.php | ServiceFactoryTrait.runDefinedMethods | protected function runDefinedMethods(/*# string */ $id, $service)
{
try {
if (isset($this->services[$id]['methods'])) {
$methods = $this->services[$id]['methods'];
foreach ($methods as $method) {
if (!is_array($method) ||
... | php | protected function runDefinedMethods(/*# string */ $id, $service)
{
try {
if (isset($this->services[$id]['methods'])) {
$methods = $this->services[$id]['methods'];
foreach ($methods as $method) {
if (!is_array($method) ||
... | [
"protected",
"function",
"runDefinedMethods",
"(",
"/*# string */",
"$",
"id",
",",
"$",
"service",
")",
"{",
"try",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"services",
"[",
"$",
"id",
"]",
"[",
"'methods'",
"]",
")",
")",
"{",
"$",
"methods... | Initialize service object by runing its defined methods
@param string $id service id
@param object $service service object
@return void
@throws LogicException
@access protected | [
"Initialize",
"service",
"object",
"by",
"runing",
"its",
"defined",
"methods"
] | bbe1e95b081068e2bc49c6cd465f38aab0374be5 | https://github.com/phossa/phossa-di/blob/bbe1e95b081068e2bc49c6cd465f38aab0374be5/src/Phossa/Di/Factory/ServiceFactoryTrait.php#L377-L408 |
194,277 | sil-project/Contact | Model/Group.php | Group.addMember | public function addMember(GroupMemberInterface $member)
{
if ($this->members->contains($member)) {
throw new \InvalidArgumentException('This entity is already a member of this group');
}
$this->members->add($member);
} | php | public function addMember(GroupMemberInterface $member)
{
if ($this->members->contains($member)) {
throw new \InvalidArgumentException('This entity is already a member of this group');
}
$this->members->add($member);
} | [
"public",
"function",
"addMember",
"(",
"GroupMemberInterface",
"$",
"member",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"members",
"->",
"contains",
"(",
"$",
"member",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"'This entity is alrea... | Add a member to the collection.
@param GroupMemberInterface $member | [
"Add",
"a",
"member",
"to",
"the",
"collection",
"."
] | ead863b5dc4ee7a6a2e3f0f181d1a0874b4969b9 | https://github.com/sil-project/Contact/blob/ead863b5dc4ee7a6a2e3f0f181d1a0874b4969b9/Model/Group.php#L92-L99 |
194,278 | sil-project/Contact | Model/Group.php | Group.removeMember | public function removeMember(GroupMemberInterface $member)
{
if (!$this->hasMember($member)) {
throw new \InvalidArgumentException('Trying to remove a member that is not in that group');
}
$this->members->removeElement($member);
} | php | public function removeMember(GroupMemberInterface $member)
{
if (!$this->hasMember($member)) {
throw new \InvalidArgumentException('Trying to remove a member that is not in that group');
}
$this->members->removeElement($member);
} | [
"public",
"function",
"removeMember",
"(",
"GroupMemberInterface",
"$",
"member",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"hasMember",
"(",
"$",
"member",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"'Trying to remove a member that... | Remove a member from the collection.
@param GroupMemberInterface $member | [
"Remove",
"a",
"member",
"from",
"the",
"collection",
"."
] | ead863b5dc4ee7a6a2e3f0f181d1a0874b4969b9 | https://github.com/sil-project/Contact/blob/ead863b5dc4ee7a6a2e3f0f181d1a0874b4969b9/Model/Group.php#L106-L113 |
194,279 | sil-project/Contact | Model/Group.php | Group.addChild | public function addChild(GroupInterface $child)
{
if ($this->children->contains($child)) {
throw new \InvalidArgumentException('This entity is already a child of this group');
}
$this->children->add($child);
} | php | public function addChild(GroupInterface $child)
{
if ($this->children->contains($child)) {
throw new \InvalidArgumentException('This entity is already a child of this group');
}
$this->children->add($child);
} | [
"public",
"function",
"addChild",
"(",
"GroupInterface",
"$",
"child",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"children",
"->",
"contains",
"(",
"$",
"child",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"'This entity is already a chi... | Add a child group to the collection.
@param GroupInterface $child | [
"Add",
"a",
"child",
"group",
"to",
"the",
"collection",
"."
] | ead863b5dc4ee7a6a2e3f0f181d1a0874b4969b9 | https://github.com/sil-project/Contact/blob/ead863b5dc4ee7a6a2e3f0f181d1a0874b4969b9/Model/Group.php#L162-L169 |
194,280 | sil-project/Contact | Model/Group.php | Group.removeChild | public function removeChild(GroupInterface $child)
{
if (!$this->hasChild($child)) {
throw new \InvalidArgumentException('Trying to remove a non existing child group');
}
$this->children->removeElement($child);
} | php | public function removeChild(GroupInterface $child)
{
if (!$this->hasChild($child)) {
throw new \InvalidArgumentException('Trying to remove a non existing child group');
}
$this->children->removeElement($child);
} | [
"public",
"function",
"removeChild",
"(",
"GroupInterface",
"$",
"child",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"hasChild",
"(",
"$",
"child",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"'Trying to remove a non existing child gr... | Remove a child group from the collection.
@param GroupInterface $child | [
"Remove",
"a",
"child",
"group",
"from",
"the",
"collection",
"."
] | ead863b5dc4ee7a6a2e3f0f181d1a0874b4969b9 | https://github.com/sil-project/Contact/blob/ead863b5dc4ee7a6a2e3f0f181d1a0874b4969b9/Model/Group.php#L176-L183 |
194,281 | Raphhh/puppy-application | src/Route/RouteFinder.php | RouteFinder.find | public function find(Request $request, array $routes)
{
foreach ($routes as $route) {
if(!$this->matchMethod($request, $route)){
continue;
}
if(!$this->matchContentType($request, $route)){
continue;
}
if(!$this->m... | php | public function find(Request $request, array $routes)
{
foreach ($routes as $route) {
if(!$this->matchMethod($request, $route)){
continue;
}
if(!$this->matchContentType($request, $route)){
continue;
}
if(!$this->m... | [
"public",
"function",
"find",
"(",
"Request",
"$",
"request",
",",
"array",
"$",
"routes",
")",
"{",
"foreach",
"(",
"$",
"routes",
"as",
"$",
"route",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"matchMethod",
"(",
"$",
"request",
",",
"$",
"rout... | Finds a route in matching its pattern with a uri.
@param Request $request
@param Route[] $routes
@return Route | [
"Finds",
"a",
"route",
"in",
"matching",
"its",
"pattern",
"with",
"a",
"uri",
"."
] | 9291543cd28e19a2986abd7fb146898ca5f5f5da | https://github.com/Raphhh/puppy-application/blob/9291543cd28e19a2986abd7fb146898ca5f5f5da/src/Route/RouteFinder.php#L37-L64 |
194,282 | valu-digital/valusetup | src/ValuSetup/Service/AbstractSetupService.php | AbstractSetupService.getName | public function getName()
{
if (!$this->name) {
$this->name = $this->utils()->whichModule($this);
}
return $this->name;
} | php | public function getName()
{
if (!$this->name) {
$this->name = $this->utils()->whichModule($this);
}
return $this->name;
} | [
"public",
"function",
"getName",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"name",
")",
"{",
"$",
"this",
"->",
"name",
"=",
"$",
"this",
"->",
"utils",
"(",
")",
"->",
"whichModule",
"(",
"$",
"this",
")",
";",
"}",
"return",
"$",
"thi... | Retrieve module name for setup service
@return string
@ValuService\Context({"cli", "http", "http-get"})
@ValuServiceAcl\Superuser | [
"Retrieve",
"module",
"name",
"for",
"setup",
"service"
] | db1a0bfe1262d555eb11cd0d99625b9ee43d6744 | https://github.com/valu-digital/valusetup/blob/db1a0bfe1262d555eb11cd0d99625b9ee43d6744/src/ValuSetup/Service/AbstractSetupService.php#L64-L71 |
194,283 | valu-digital/valusetup | src/ValuSetup/Service/AbstractSetupService.php | AbstractSetupService.install | public function install($version = null, array $options = array())
{
$module = $this->utils()->whichModule($this);
if ($version === null) {
$version = $this->utils()->getModuleVersion($module);
if (!$version) {
throw new MissingParameterException(... | php | public function install($version = null, array $options = array())
{
$module = $this->utils()->whichModule($this);
if ($version === null) {
$version = $this->utils()->getModuleVersion($module);
if (!$version) {
throw new MissingParameterException(... | [
"public",
"function",
"install",
"(",
"$",
"version",
"=",
"null",
",",
"array",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"$",
"module",
"=",
"$",
"this",
"->",
"utils",
"(",
")",
"->",
"whichModule",
"(",
"$",
"this",
")",
";",
"if",
"(... | Install module and its dependencies
@param array $options Setup options
@return boolean True on success
@ValuService\Context({"cli", "http", "http-put"})
@ValuServiceAcl\Superuser | [
"Install",
"module",
"and",
"its",
"dependencies"
] | db1a0bfe1262d555eb11cd0d99625b9ee43d6744 | https://github.com/valu-digital/valusetup/blob/db1a0bfe1262d555eb11cd0d99625b9ee43d6744/src/ValuSetup/Service/AbstractSetupService.php#L94-L107 |
194,284 | valu-digital/valusetup | src/ValuSetup/Service/AbstractSetupService.php | AbstractSetupService.update | public function update(array $options = array())
{
$module = $this->utils()->whichModule($this);
return $this->utils()->update($module, $options);
} | php | public function update(array $options = array())
{
$module = $this->utils()->whichModule($this);
return $this->utils()->update($module, $options);
} | [
"public",
"function",
"update",
"(",
"array",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"$",
"module",
"=",
"$",
"this",
"->",
"utils",
"(",
")",
"->",
"whichModule",
"(",
"$",
"this",
")",
";",
"return",
"$",
"this",
"->",
"utils",
"(",
... | Update module and its dependencies
@param array $options Setup options
@return boolean True on success
@ValuService\Context({"cli", "http", "http-post"})
@ValuServiceAcl\Superuser | [
"Update",
"module",
"and",
"its",
"dependencies"
] | db1a0bfe1262d555eb11cd0d99625b9ee43d6744 | https://github.com/valu-digital/valusetup/blob/db1a0bfe1262d555eb11cd0d99625b9ee43d6744/src/ValuSetup/Service/AbstractSetupService.php#L118-L122 |
194,285 | valu-digital/valusetup | src/ValuSetup/Service/AbstractSetupService.php | AbstractSetupService.upgrade | public function upgrade($from, array $options = array()){
$to = $this->utils()->getModuleVersion($this->getName());
if(SoftwareVersion::compare($to, $from) <= 0){
throw new Exception\IllegalVersionException(
sprintf('Unable to upgrade %s to version %s', $this->getName().' ... | php | public function upgrade($from, array $options = array()){
$to = $this->utils()->getModuleVersion($this->getName());
if(SoftwareVersion::compare($to, $from) <= 0){
throw new Exception\IllegalVersionException(
sprintf('Unable to upgrade %s to version %s', $this->getName().' ... | [
"public",
"function",
"upgrade",
"(",
"$",
"from",
",",
"array",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"$",
"to",
"=",
"$",
"this",
"->",
"utils",
"(",
")",
"->",
"getModuleVersion",
"(",
"$",
"this",
"->",
"getName",
"(",
")",
")",
"... | Upgrade module from previous version
This method should be invoked only after the new
version has been loaded. This method should also ignore
any values of $from that indicate version number that
is greater than or equal to current version.
This method should ensure backwards compatibility and
prepare data from previ... | [
"Upgrade",
"module",
"from",
"previous",
"version"
] | db1a0bfe1262d555eb11cd0d99625b9ee43d6744 | https://github.com/valu-digital/valusetup/blob/db1a0bfe1262d555eb11cd0d99625b9ee43d6744/src/ValuSetup/Service/AbstractSetupService.php#L157-L168 |
194,286 | valu-digital/valusetup | src/ValuSetup/Service/AbstractSetupService.php | AbstractSetupService.utils | protected function utils()
{
if(!$this->utils){
$this->utils = $this->getServiceLocator()->get('valu_setup.setup_utils');
}
return $this->utils;
} | php | protected function utils()
{
if(!$this->utils){
$this->utils = $this->getServiceLocator()->get('valu_setup.setup_utils');
}
return $this->utils;
} | [
"protected",
"function",
"utils",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"utils",
")",
"{",
"$",
"this",
"->",
"utils",
"=",
"$",
"this",
"->",
"getServiceLocator",
"(",
")",
"->",
"get",
"(",
"'valu_setup.setup_utils'",
")",
";",
"}",
"re... | Direct access to service utilities
@return \ValuSetup\Setup\SetupUtils | [
"Direct",
"access",
"to",
"service",
"utilities"
] | db1a0bfe1262d555eb11cd0d99625b9ee43d6744 | https://github.com/valu-digital/valusetup/blob/db1a0bfe1262d555eb11cd0d99625b9ee43d6744/src/ValuSetup/Service/AbstractSetupService.php#L240-L247 |
194,287 | squareproton/Bond | src/Bond/Pg.php | Pg.listen | public function listen( $channels )
{
$channels = is_array( $channels ) ? $channels : array( $channels );
foreach( $channels as $channel ) {
// clean up channel - it doesn't require quoting (not sure why)
// make safe with whitelist of chars
$channel = preg_replac... | php | public function listen( $channels )
{
$channels = is_array( $channels ) ? $channels : array( $channels );
foreach( $channels as $channel ) {
// clean up channel - it doesn't require quoting (not sure why)
// make safe with whitelist of chars
$channel = preg_replac... | [
"public",
"function",
"listen",
"(",
"$",
"channels",
")",
"{",
"$",
"channels",
"=",
"is_array",
"(",
"$",
"channels",
")",
"?",
"$",
"channels",
":",
"array",
"(",
"$",
"channels",
")",
";",
"foreach",
"(",
"$",
"channels",
"as",
"$",
"channel",
")... | Subscribe to a postgres channel | [
"Subscribe",
"to",
"a",
"postgres",
"channel"
] | a04ad9dd1a35adeaec98237716c2a41ce02b4f1a | https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/Pg.php#L203-L212 |
194,288 | squareproton/Bond | src/Bond/Pg.php | Pg.quote | public function quote( $value, array $modifiers = [] )
{
if( is_null( $value ) ) {
$value = 'NULL';
} elseif( is_bool( $value ) ) {
$value = $value ? 'TRUE' : 'FALSE';
} elseif( is_int( $value ) ) {
$value = (string) $value;
} elseif( $value instan... | php | public function quote( $value, array $modifiers = [] )
{
if( is_null( $value ) ) {
$value = 'NULL';
} elseif( is_bool( $value ) ) {
$value = $value ? 'TRUE' : 'FALSE';
} elseif( is_int( $value ) ) {
$value = (string) $value;
} elseif( $value instan... | [
"public",
"function",
"quote",
"(",
"$",
"value",
",",
"array",
"$",
"modifiers",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"value",
")",
")",
"{",
"$",
"value",
"=",
"'NULL'",
";",
"}",
"elseif",
"(",
"is_bool",
"(",
"$",
"value",... | Return a value made safe for insertion into a database
@param array $modifiers Array of \Closures to be applied before returning
@return string | [
"Return",
"a",
"value",
"made",
"safe",
"for",
"insertion",
"into",
"a",
"database"
] | a04ad9dd1a35adeaec98237716c2a41ce02b4f1a | https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/Pg.php#L220-L239 |
194,289 | squareproton/Bond | src/Bond/Pg.php | Pg.getParameter | public function getParameter( $parameter )
{
self::isParameterAllowed( $parameter );
$value = $this->query(new Raw("SHOW {$parameter}"))->fetch( Result::FETCH_SINGLE );
return ( $value === 'true' or $value === 'false' )
? \Bond\boolval( $value )
: $value;
} | php | public function getParameter( $parameter )
{
self::isParameterAllowed( $parameter );
$value = $this->query(new Raw("SHOW {$parameter}"))->fetch( Result::FETCH_SINGLE );
return ( $value === 'true' or $value === 'false' )
? \Bond\boolval( $value )
: $value;
} | [
"public",
"function",
"getParameter",
"(",
"$",
"parameter",
")",
"{",
"self",
"::",
"isParameterAllowed",
"(",
"$",
"parameter",
")",
";",
"$",
"value",
"=",
"$",
"this",
"->",
"query",
"(",
"new",
"Raw",
"(",
"\"SHOW {$parameter}\"",
")",
")",
"->",
"f... | Get a postgres runtime parameter
@return string | [
"Get",
"a",
"postgres",
"runtime",
"parameter"
] | a04ad9dd1a35adeaec98237716c2a41ce02b4f1a | https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/Pg.php#L272-L283 |
194,290 | squareproton/Bond | src/Bond/Pg.php | Pg.setParameter | public function setParameter( $parameter, $value, $restorePoint = self::PREVIOUS, $type = self::SESSION )
{
if (!is_scalar($value)) {
throw new BadTypeException($value, 'scalar');
}
self::isParameterAllowed( $parameter );
if( !in_array( $type, array( self::SESSION, self... | php | public function setParameter( $parameter, $value, $restorePoint = self::PREVIOUS, $type = self::SESSION )
{
if (!is_scalar($value)) {
throw new BadTypeException($value, 'scalar');
}
self::isParameterAllowed( $parameter );
if( !in_array( $type, array( self::SESSION, self... | [
"public",
"function",
"setParameter",
"(",
"$",
"parameter",
",",
"$",
"value",
",",
"$",
"restorePoint",
"=",
"self",
"::",
"PREVIOUS",
",",
"$",
"type",
"=",
"self",
"::",
"SESSION",
")",
"{",
"if",
"(",
"!",
"is_scalar",
"(",
"$",
"value",
")",
")... | Set a postgres runtime parameter
@param string
@param mixed
@param scalar
@param string self::SESSION | self::LOCAL
@return $this | [
"Set",
"a",
"postgres",
"runtime",
"parameter"
] | a04ad9dd1a35adeaec98237716c2a41ce02b4f1a | https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/Pg.php#L293-L342 |
194,291 | dmj/PicaRecord | src/HAB/Pica/Record/Record.php | Record.factory | public static function factory (array $record)
{
if (!array_key_exists('fields', $record)) {
throw new InvalidArgumentException("Missing 'fields' index in record array");
}
$fields = array_map(array('HAB\Pica\Record\Field', 'factory'), $record['fields']);
$type = null;
... | php | public static function factory (array $record)
{
if (!array_key_exists('fields', $record)) {
throw new InvalidArgumentException("Missing 'fields' index in record array");
}
$fields = array_map(array('HAB\Pica\Record\Field', 'factory'), $record['fields']);
$type = null;
... | [
"public",
"static",
"function",
"factory",
"(",
"array",
"$",
"record",
")",
"{",
"if",
"(",
"!",
"array_key_exists",
"(",
"'fields'",
",",
"$",
"record",
")",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"\"Missing 'fields' index in record array\"",... | Return a new record based on its array representation.
Returns either a {@link TitleRecord} or a {@link AuthorityRecord}
depending on the field 002@ which encodes the record type.
@throws InvalidArgumentException Missing type field
@throws InvalidArgumentException Missing `fields' index
@param array $record Array r... | [
"Return",
"a",
"new",
"record",
"based",
"on",
"its",
"array",
"representation",
"."
] | bd5577b9a4333aa6156398b94cc870a9377061b8 | https://github.com/dmj/PicaRecord/blob/bd5577b9a4333aa6156398b94cc870a9377061b8/src/HAB/Pica/Record/Record.php#L51-L76 |
194,292 | dmj/PicaRecord | src/HAB/Pica/Record/Record.php | Record.append | public function append (Field $field)
{
if (in_array($field, $this->_fields, true)) {
throw new InvalidArgumentException("{$this} already contains {$field}");
}
$this->_fields []= $field;
} | php | public function append (Field $field)
{
if (in_array($field, $this->_fields, true)) {
throw new InvalidArgumentException("{$this} already contains {$field}");
}
$this->_fields []= $field;
} | [
"public",
"function",
"append",
"(",
"Field",
"$",
"field",
")",
"{",
"if",
"(",
"in_array",
"(",
"$",
"field",
",",
"$",
"this",
"->",
"_fields",
",",
"true",
")",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"\"{$this} already contains {$fiel... | Append a field to the record.
@throws InvalidArgumentException Field already in record
@param \HAB\Pica\Record\Field $field Field to append
@return void | [
"Append",
"a",
"field",
"to",
"the",
"record",
"."
] | bd5577b9a4333aa6156398b94cc870a9377061b8 | https://github.com/dmj/PicaRecord/blob/bd5577b9a4333aa6156398b94cc870a9377061b8/src/HAB/Pica/Record/Record.php#L136-L142 |
194,293 | dmj/PicaRecord | src/HAB/Pica/Record/Record.php | Record.sort | public function sort ()
{
usort($this->_fields,
function (Field $fieldA, Field $fieldB) {
return strcmp($fieldA->getShorthand(), $fieldB->getShorthand());
});
} | php | public function sort ()
{
usort($this->_fields,
function (Field $fieldA, Field $fieldB) {
return strcmp($fieldA->getShorthand(), $fieldB->getShorthand());
});
} | [
"public",
"function",
"sort",
"(",
")",
"{",
"usort",
"(",
"$",
"this",
"->",
"_fields",
",",
"function",
"(",
"Field",
"$",
"fieldA",
",",
"Field",
"$",
"fieldB",
")",
"{",
"return",
"strcmp",
"(",
"$",
"fieldA",
"->",
"getShorthand",
"(",
")",
",",... | Sort the fields of the record.
Fields are sorted by their shorthand.
@see \HAB\Pica\Record\Field::getShorthand()
@return void | [
"Sort",
"the",
"fields",
"of",
"the",
"record",
"."
] | bd5577b9a4333aa6156398b94cc870a9377061b8 | https://github.com/dmj/PicaRecord/blob/bd5577b9a4333aa6156398b94cc870a9377061b8/src/HAB/Pica/Record/Record.php#L153-L159 |
194,294 | dmj/PicaRecord | src/HAB/Pica/Record/Record.php | Record.setFields | public function setFields (array $fields)
{
$this->_fields = array();
foreach ($fields as $field) {
$this->append($field);
}
} | php | public function setFields (array $fields)
{
$this->_fields = array();
foreach ($fields as $field) {
$this->append($field);
}
} | [
"public",
"function",
"setFields",
"(",
"array",
"$",
"fields",
")",
"{",
"$",
"this",
"->",
"_fields",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"fields",
"as",
"$",
"field",
")",
"{",
"$",
"this",
"->",
"append",
"(",
"$",
"field",
")",
... | Set the record fields.
Removes the current set of fields and replaces it with the fields in
argument.
@param array $fields Fields
@return void | [
"Set",
"the",
"record",
"fields",
"."
] | bd5577b9a4333aa6156398b94cc870a9377061b8 | https://github.com/dmj/PicaRecord/blob/bd5577b9a4333aa6156398b94cc870a9377061b8/src/HAB/Pica/Record/Record.php#L170-L176 |
194,295 | dmj/PicaRecord | src/HAB/Pica/Record/Record.php | Record.getMaximumOccurrenceOf | public function getMaximumOccurrenceOf ($tag)
{
if (!preg_match(Field::TAG_RE, $tag)) {
throw new InvalidArgumentException("Invalid field tag: {$tag}");
}
return array_reduce($this->getFields($tag),
function ($maxOccurrence, Field $field) {
... | php | public function getMaximumOccurrenceOf ($tag)
{
if (!preg_match(Field::TAG_RE, $tag)) {
throw new InvalidArgumentException("Invalid field tag: {$tag}");
}
return array_reduce($this->getFields($tag),
function ($maxOccurrence, Field $field) {
... | [
"public",
"function",
"getMaximumOccurrenceOf",
"(",
"$",
"tag",
")",
"{",
"if",
"(",
"!",
"preg_match",
"(",
"Field",
"::",
"TAG_RE",
",",
"$",
"tag",
")",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"\"Invalid field tag: {$tag}\"",
")",
";",
... | Return the maximum occurrence value of a field.
@throws InvalidArgumentException Invalid field tag
@param string $tag Field tag
@return int|null Maximum occurrence of field or NULL if field does not
exist | [
"Return",
"the",
"maximum",
"occurrence",
"value",
"of",
"a",
"field",
"."
] | bd5577b9a4333aa6156398b94cc870a9377061b8 | https://github.com/dmj/PicaRecord/blob/bd5577b9a4333aa6156398b94cc870a9377061b8/src/HAB/Pica/Record/Record.php#L187-L200 |
194,296 | dmj/PicaRecord | src/HAB/Pica/Record/Record.php | Record.getFirstMatchingField | public function getFirstMatchingField ($selector)
{
$fields = $this->getFields($selector);
if (empty($fields)) {
return null;
} else {
return reset($fields);
}
} | php | public function getFirstMatchingField ($selector)
{
$fields = $this->getFields($selector);
if (empty($fields)) {
return null;
} else {
return reset($fields);
}
} | [
"public",
"function",
"getFirstMatchingField",
"(",
"$",
"selector",
")",
"{",
"$",
"fields",
"=",
"$",
"this",
"->",
"getFields",
"(",
"$",
"selector",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"fields",
")",
")",
"{",
"return",
"null",
";",
"}",
"els... | Return the first field that matches a selector.
@param string $selector Body of regular expression
@return Field|null The first matching field or NULL if no match | [
"Return",
"the",
"first",
"field",
"that",
"matches",
"a",
"selector",
"."
] | bd5577b9a4333aa6156398b94cc870a9377061b8 | https://github.com/dmj/PicaRecord/blob/bd5577b9a4333aa6156398b94cc870a9377061b8/src/HAB/Pica/Record/Record.php#L254-L262 |
194,297 | FuzeWorks/Core | src/FuzeWorks/Helpers.php | Helpers.load | public function load($helperName, $directory = null): bool
{
// First determine the name of the helper
$helperName = strtolower(str_replace(array('_helper', '.php'), '', $helperName).'_helper');
// Determine what directories should be checked
$directories = (is_null($directo... | php | public function load($helperName, $directory = null): bool
{
// First determine the name of the helper
$helperName = strtolower(str_replace(array('_helper', '.php'), '', $helperName).'_helper');
// Determine what directories should be checked
$directories = (is_null($directo... | [
"public",
"function",
"load",
"(",
"$",
"helperName",
",",
"$",
"directory",
"=",
"null",
")",
":",
"bool",
"{",
"// First determine the name of the helper",
"$",
"helperName",
"=",
"strtolower",
"(",
"str_replace",
"(",
"array",
"(",
"'_helper'",
",",
"'.php'",... | Load a helper.
Supply the name and the helper will be loaded from the supplied directory,
or from one of the helperPaths (which you can add).
@param string $helperName Name of the helper
@param string|null $directory Directory to load the helper from, will ignore $helperPaths
@return bool ... | [
"Load",
"a",
"helper",
"."
] | 051c64fdaa3a648174cbd54557d05ad553dd826b | https://github.com/FuzeWorks/Core/blob/051c64fdaa3a648174cbd54557d05ad553dd826b/src/FuzeWorks/Helpers.php#L92-L167 |
194,298 | FuzeWorks/Core | src/FuzeWorks/Helpers.php | Helpers.removeHelperPath | public function removeHelperPath($directory)
{
if (($key = array_search($directory, $this->helperPaths)) !== false)
{
unset($this->helperPaths[$key]);
}
} | php | public function removeHelperPath($directory)
{
if (($key = array_search($directory, $this->helperPaths)) !== false)
{
unset($this->helperPaths[$key]);
}
} | [
"public",
"function",
"removeHelperPath",
"(",
"$",
"directory",
")",
"{",
"if",
"(",
"(",
"$",
"key",
"=",
"array_search",
"(",
"$",
"directory",
",",
"$",
"this",
"->",
"helperPaths",
")",
")",
"!==",
"false",
")",
"{",
"unset",
"(",
"$",
"this",
"... | Remove a path where helpers can be found
@param string $directory The directory
@return void | [
"Remove",
"a",
"path",
"where",
"helpers",
"can",
"be",
"found"
] | 051c64fdaa3a648174cbd54557d05ad553dd826b | https://github.com/FuzeWorks/Core/blob/051c64fdaa3a648174cbd54557d05ad553dd826b/src/FuzeWorks/Helpers.php#L202-L208 |
194,299 | joegreen88/zf1-component-validate | src/Zend/Validate/Isbn.php | Zend_Validate_Isbn.setType | public function setType($type)
{
// check type
if (!in_array($type, array(self::AUTO, self::ISBN10, self::ISBN13))) {
/**
* @see Zend_Validate_Exception
*/
throw new Zend_Validate_Exception('Invalid ISBN type');
}
$this->_type = $ty... | php | public function setType($type)
{
// check type
if (!in_array($type, array(self::AUTO, self::ISBN10, self::ISBN13))) {
/**
* @see Zend_Validate_Exception
*/
throw new Zend_Validate_Exception('Invalid ISBN type');
}
$this->_type = $ty... | [
"public",
"function",
"setType",
"(",
"$",
"type",
")",
"{",
"// check type",
"if",
"(",
"!",
"in_array",
"(",
"$",
"type",
",",
"array",
"(",
"self",
"::",
"AUTO",
",",
"self",
"::",
"ISBN10",
",",
"self",
"::",
"ISBN13",
")",
")",
")",
"{",
"/**\... | Set allowed ISBN type.
@param string $type
@throws Zend_Validate_Exception When $type is not valid
@return Zend_Validate_Isbn Provides a fluent interface | [
"Set",
"allowed",
"ISBN",
"type",
"."
] | 88d9ea016f73d48ff0ba7d06ecbbf28951fd279e | https://github.com/joegreen88/zf1-component-validate/blob/88d9ea016f73d48ff0ba7d06ecbbf28951fd279e/src/Zend/Validate/Isbn.php#L255-L268 |
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.