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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
195,100 | Kris-Kuiper/sFire-Framework | src/DB/Driver/MySQLi/Entity.php | Entity.setExclude | public function setExclude($exclude) {
if(false === is_array($exclude)) {
return trigger_error(sprintf('Argument 1 passed to %s() must be of the type Array, "%s" given', __METHOD__, gettype($exclude)), E_USER_ERROR);
}
$this -> exclude = $exclude;
return $this;
} | php | public function setExclude($exclude) {
if(false === is_array($exclude)) {
return trigger_error(sprintf('Argument 1 passed to %s() must be of the type Array, "%s" given', __METHOD__, gettype($exclude)), E_USER_ERROR);
}
$this -> exclude = $exclude;
return $this;
} | [
"public",
"function",
"setExclude",
"(",
"$",
"exclude",
")",
"{",
"if",
"(",
"false",
"===",
"is_array",
"(",
"$",
"exclude",
")",
")",
"{",
"return",
"trigger_error",
"(",
"sprintf",
"(",
"'Argument 1 passed to %s() must be of the type Array, \"%s\" given'",
",",
... | Sets exclude column names to be excluded when entity is saved. This will prevent data saved to MySQL generated columns which will trigger an error
@param string|array $identifier | [
"Sets",
"exclude",
"column",
"names",
"to",
"be",
"excluded",
"when",
"entity",
"is",
"saved",
".",
"This",
"will",
"prevent",
"data",
"saved",
"to",
"MySQL",
"generated",
"columns",
"which",
"will",
"trigger",
"an",
"error"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/DB/Driver/MySQLi/Entity.php#L289-L298 |
195,101 | Kris-Kuiper/sFire-Framework | src/DB/Driver/MySQLi/Entity.php | Entity.getIdentifier | public function getIdentifier() {
if(false === isset($this -> identifier)) {
$cl = new \ReflectionClass($this);
return trigger_error(sprintf('No table identifier specified in "%s" class', $cl -> getFileName()), E_USER_ERROR);
}
return $this -> identifier;
} | php | public function getIdentifier() {
if(false === isset($this -> identifier)) {
$cl = new \ReflectionClass($this);
return trigger_error(sprintf('No table identifier specified in "%s" class', $cl -> getFileName()), E_USER_ERROR);
}
return $this -> identifier;
} | [
"public",
"function",
"getIdentifier",
"(",
")",
"{",
"if",
"(",
"false",
"===",
"isset",
"(",
"$",
"this",
"->",
"identifier",
")",
")",
"{",
"$",
"cl",
"=",
"new",
"\\",
"ReflectionClass",
"(",
"$",
"this",
")",
";",
"return",
"trigger_error",
"(",
... | Returns the identifier
@return string | [
"Returns",
"the",
"identifier"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/DB/Driver/MySQLi/Entity.php#L305-L314 |
195,102 | Kris-Kuiper/sFire-Framework | src/DB/Driver/MySQLi/Entity.php | Entity.save | public function save() {
if(null === $this -> getAdapter()) {
return trigger_error('Adapter is not set. Set the adapter with the setAdapter() method', E_USER_ERROR);
}
//Execute user defined before save function
$this -> beforeSave();
$class = new \ReflectionClass(get_class($this));
$value... | php | public function save() {
if(null === $this -> getAdapter()) {
return trigger_error('Adapter is not set. Set the adapter with the setAdapter() method', E_USER_ERROR);
}
//Execute user defined before save function
$this -> beforeSave();
$class = new \ReflectionClass(get_class($this));
$value... | [
"public",
"function",
"save",
"(",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"getAdapter",
"(",
")",
")",
"{",
"return",
"trigger_error",
"(",
"'Adapter is not set. Set the adapter with the setAdapter() method'",
",",
"E_USER_ERROR",
")",
";",
"}",
... | Inserts or updates entity based on identifier
@return boolean | [
"Inserts",
"or",
"updates",
"entity",
"based",
"on",
"identifier"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/DB/Driver/MySQLi/Entity.php#L330-L393 |
195,103 | Kris-Kuiper/sFire-Framework | src/DB/Driver/MySQLi/Entity.php | Entity.delete | public function delete() {
if(null === $this -> getAdapter()) {
return trigger_error('Adapter is not set. Set the adapter with the setAdapter() method', E_USER_ERROR);
}
//Execute user defined before deleting function
$this -> beforeDelete();
$class = new \ReflectionClass(get_class($this))... | php | public function delete() {
if(null === $this -> getAdapter()) {
return trigger_error('Adapter is not set. Set the adapter with the setAdapter() method', E_USER_ERROR);
}
//Execute user defined before deleting function
$this -> beforeDelete();
$class = new \ReflectionClass(get_class($this))... | [
"public",
"function",
"delete",
"(",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"getAdapter",
"(",
")",
")",
"{",
"return",
"trigger_error",
"(",
"'Adapter is not set. Set the adapter with the setAdapter() method'",
",",
"E_USER_ERROR",
")",
";",
"}",
... | Delete the current entitiy based on identifier
@return boolean | [
"Delete",
"the",
"current",
"entitiy",
"based",
"on",
"identifier"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/DB/Driver/MySQLi/Entity.php#L400-L441 |
195,104 | Kris-Kuiper/sFire-Framework | src/DB/Driver/MySQLi/Entity.php | Entity.convertToDate | public function convertToDate($value) {
foreach($this -> date_formats as $format) {
if(false !== \DateTime :: createFromFormat($format, $value)) {
$d = new DateTime($value);
$d -> createFromFormat($format, $value);
if($d && $d -> format($format) == $value) {
$d -> saveFormat($forma... | php | public function convertToDate($value) {
foreach($this -> date_formats as $format) {
if(false !== \DateTime :: createFromFormat($format, $value)) {
$d = new DateTime($value);
$d -> createFromFormat($format, $value);
if($d && $d -> format($format) == $value) {
$d -> saveFormat($forma... | [
"public",
"function",
"convertToDate",
"(",
"$",
"value",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"date_formats",
"as",
"$",
"format",
")",
"{",
"if",
"(",
"false",
"!==",
"\\",
"DateTime",
"::",
"createFromFormat",
"(",
"$",
"format",
",",
"$",
"... | Tries to check if given value is a valid date. If so, return the used format and returns a sFire DateTime object. Otherwise, returns the given value
@param string $value
@return mixed | [
"Tries",
"to",
"check",
"if",
"given",
"value",
"is",
"a",
"valid",
"date",
".",
"If",
"so",
"return",
"the",
"used",
"format",
"and",
"returns",
"a",
"sFire",
"DateTime",
"object",
".",
"Otherwise",
"returns",
"the",
"given",
"value"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/DB/Driver/MySQLi/Entity.php#L565-L583 |
195,105 | Kris-Kuiper/sFire-Framework | src/DB/Driver/MySQLi/Entity.php | Entity.convertJsonToArray | public function convertJsonToArray($value) {
if(true === $this -> convert_json) {
if(true === is_string($value)) {
$tmp = @json_decode($value, true);
if(true === (json_last_error() == JSON_ERROR_NONE)) {
$value = $tmp;
}
}
}
return $value;
} | php | public function convertJsonToArray($value) {
if(true === $this -> convert_json) {
if(true === is_string($value)) {
$tmp = @json_decode($value, true);
if(true === (json_last_error() == JSON_ERROR_NONE)) {
$value = $tmp;
}
}
}
return $value;
} | [
"public",
"function",
"convertJsonToArray",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"true",
"===",
"$",
"this",
"->",
"convert_json",
")",
"{",
"if",
"(",
"true",
"===",
"is_string",
"(",
"$",
"value",
")",
")",
"{",
"$",
"tmp",
"=",
"@",
"json_decod... | Tries covnert values to JSON strings. Otherwise, returns the given value
@param string $value
@return mixed | [
"Tries",
"covnert",
"values",
"to",
"JSON",
"strings",
".",
"Otherwise",
"returns",
"the",
"given",
"value"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/DB/Driver/MySQLi/Entity.php#L591-L606 |
195,106 | mylxsw/FocusPHP | src/Config/ArrayConfig.php | ArrayConfig.get | public function get($key, $default = null)
{
if (!isset($this->_configs[$key])) {
$cfg = get_cfg_var($key);
if ($cfg !== false) {
return $cfg;
}
return $default;
}
return $this->_configs[$key];
} | php | public function get($key, $default = null)
{
if (!isset($this->_configs[$key])) {
$cfg = get_cfg_var($key);
if ($cfg !== false) {
return $cfg;
}
return $default;
}
return $this->_configs[$key];
} | [
"public",
"function",
"get",
"(",
"$",
"key",
",",
"$",
"default",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"_configs",
"[",
"$",
"key",
"]",
")",
")",
"{",
"$",
"cfg",
"=",
"get_cfg_var",
"(",
"$",
"key",
")",
... | Get config info.
@param string $key
@param mixed $default
@return null|string | [
"Get",
"config",
"info",
"."
] | 33922bacbea66f11f874d991d7308a36cdf5831a | https://github.com/mylxsw/FocusPHP/blob/33922bacbea66f11f874d991d7308a36cdf5831a/src/Config/ArrayConfig.php#L32-L44 |
195,107 | koolkode/context | src/ContainerCompiler.php | ContainerCompiler.compile | public function compile(ContainerBuilder $builder, $proxyCachePath = NULL, array $additionalProxies = [])
{
try
{
return $this->compileBuilder($builder, $proxyCachePath, $additionalProxies);
}
finally
{
$this->methods = [];
$this->namespaceContextCache = [];
}
} | php | public function compile(ContainerBuilder $builder, $proxyCachePath = NULL, array $additionalProxies = [])
{
try
{
return $this->compileBuilder($builder, $proxyCachePath, $additionalProxies);
}
finally
{
$this->methods = [];
$this->namespaceContextCache = [];
}
} | [
"public",
"function",
"compile",
"(",
"ContainerBuilder",
"$",
"builder",
",",
"$",
"proxyCachePath",
"=",
"NULL",
",",
"array",
"$",
"additionalProxies",
"=",
"[",
"]",
")",
"{",
"try",
"{",
"return",
"$",
"this",
"->",
"compileBuilder",
"(",
"$",
"builde... | Generate PHP code of an optimized DI container from the given builder.
@param ContainerBuilder $builder
@param string $proxyCachePath Cache directory for scoped proxies, NULL deactivates pre-generation of proxies.
@param array<string> $additionalProxies Additional type names that need a scoped proxy.
@return string | [
"Generate",
"PHP",
"code",
"of",
"an",
"optimized",
"DI",
"container",
"from",
"the",
"given",
"builder",
"."
] | f4aa614eb4ca1080bd89c7a2a54c9467c5b17a36 | https://github.com/koolkode/context/blob/f4aa614eb4ca1080bd89c7a2a54c9467c5b17a36/src/ContainerCompiler.php#L69-L80 |
195,108 | koolkode/context | src/ContainerCompiler.php | ContainerCompiler.compileBuilder | protected function compileBuilder(ContainerBuilder $builder, $proxyCachePath = NULL, array $additionalProxies = [])
{
$imports = [
DelegateBinding::class,
ContextLookupException::class,
InjectionPoint::class,
InjectionPointInterface::class
];
$code = '<?php' . "\n\n";
$code .= 'namespace ' . $th... | php | protected function compileBuilder(ContainerBuilder $builder, $proxyCachePath = NULL, array $additionalProxies = [])
{
$imports = [
DelegateBinding::class,
ContextLookupException::class,
InjectionPoint::class,
InjectionPointInterface::class
];
$code = '<?php' . "\n\n";
$code .= 'namespace ' . $th... | [
"protected",
"function",
"compileBuilder",
"(",
"ContainerBuilder",
"$",
"builder",
",",
"$",
"proxyCachePath",
"=",
"NULL",
",",
"array",
"$",
"additionalProxies",
"=",
"[",
"]",
")",
"{",
"$",
"imports",
"=",
"[",
"DelegateBinding",
"::",
"class",
",",
"Co... | Compiles the given container builder and takes care of scoped proxy generation.
@param ContainerBuilder $builder
@param string $proxyCachePath
@param array<string> $additionalProxies
@return string | [
"Compiles",
"the",
"given",
"container",
"builder",
"and",
"takes",
"care",
"of",
"scoped",
"proxy",
"generation",
"."
] | f4aa614eb4ca1080bd89c7a2a54c9467c5b17a36 | https://github.com/koolkode/context/blob/f4aa614eb4ca1080bd89c7a2a54c9467c5b17a36/src/ContainerCompiler.php#L90-L154 |
195,109 | koolkode/context | src/ContainerCompiler.php | ContainerCompiler.compileBinding | protected function compileBinding(Binding $binding)
{
$prop = str_replace('\\', '_', $binding->getTypeName());
$code = "\tpublic function binding_" . $prop . "() {\n\n";
$code .= "\t\t\t\$binding = new DelegateBinding(" . var_export($binding->getTypeName(), true);
$code .= ', ' . var_export($binding->ge... | php | protected function compileBinding(Binding $binding)
{
$prop = str_replace('\\', '_', $binding->getTypeName());
$code = "\tpublic function binding_" . $prop . "() {\n\n";
$code .= "\t\t\t\$binding = new DelegateBinding(" . var_export($binding->getTypeName(), true);
$code .= ', ' . var_export($binding->ge... | [
"protected",
"function",
"compileBinding",
"(",
"Binding",
"$",
"binding",
")",
"{",
"$",
"prop",
"=",
"str_replace",
"(",
"'\\\\'",
",",
"'_'",
",",
"$",
"binding",
"->",
"getTypeName",
"(",
")",
")",
";",
"$",
"code",
"=",
"\"\\tpublic function binding_\""... | Compiles PHP code for the given binding.
@param Binding $binding
@return string | [
"Compiles",
"PHP",
"code",
"for",
"the",
"given",
"binding",
"."
] | f4aa614eb4ca1080bd89c7a2a54c9467c5b17a36 | https://github.com/koolkode/context/blob/f4aa614eb4ca1080bd89c7a2a54c9467c5b17a36/src/ContainerCompiler.php#L162-L192 |
195,110 | koolkode/context | src/ContainerCompiler.php | ContainerCompiler.compileInlineFactoryBinding | protected function compileInlineFactoryBinding(Binding $binding)
{
$code = '';
$num = count($this->methods);
$ref = new \ReflectionFunction($binding->getTarget());
$sig = $this->generateReplacementMethodSignature($ref, $num);
$body = $this->extractClosureCode($ref);
$this->methods[] = "\t\t" . $sig .... | php | protected function compileInlineFactoryBinding(Binding $binding)
{
$code = '';
$num = count($this->methods);
$ref = new \ReflectionFunction($binding->getTarget());
$sig = $this->generateReplacementMethodSignature($ref, $num);
$body = $this->extractClosureCode($ref);
$this->methods[] = "\t\t" . $sig .... | [
"protected",
"function",
"compileInlineFactoryBinding",
"(",
"Binding",
"$",
"binding",
")",
"{",
"$",
"code",
"=",
"''",
";",
"$",
"num",
"=",
"count",
"(",
"$",
"this",
"->",
"methods",
")",
";",
"$",
"ref",
"=",
"new",
"\\",
"ReflectionFunction",
"(",... | Compiles an inline factory binding by creating a replacement method in the DI container.
@param Binding $binding
@return string | [
"Compiles",
"an",
"inline",
"factory",
"binding",
"by",
"creating",
"a",
"replacement",
"method",
"in",
"the",
"DI",
"container",
"."
] | f4aa614eb4ca1080bd89c7a2a54c9467c5b17a36 | https://github.com/koolkode/context/blob/f4aa614eb4ca1080bd89c7a2a54c9467c5b17a36/src/ContainerCompiler.php#L361-L431 |
195,111 | koolkode/context | src/ContainerCompiler.php | ContainerCompiler.compileMarkerLookup | protected function compileMarkerLookup(array $marked)
{
$code = '';
foreach($marked as $markerType => $markedBindings)
{
$code .= "\tpublic function markedBindings_" . str_replace('\\', '_', $markerType) . "() {\n";
$code .= "\t\tstatic \$bindings;\n";
$code .= "\t\tif(\$bindings === NULL) {\n";
$... | php | protected function compileMarkerLookup(array $marked)
{
$code = '';
foreach($marked as $markerType => $markedBindings)
{
$code .= "\tpublic function markedBindings_" . str_replace('\\', '_', $markerType) . "() {\n";
$code .= "\t\tstatic \$bindings;\n";
$code .= "\t\tif(\$bindings === NULL) {\n";
$... | [
"protected",
"function",
"compileMarkerLookup",
"(",
"array",
"$",
"marked",
")",
"{",
"$",
"code",
"=",
"''",
";",
"foreach",
"(",
"$",
"marked",
"as",
"$",
"markerType",
"=>",
"$",
"markedBindings",
")",
"{",
"$",
"code",
".=",
"\"\\tpublic function marked... | Compiles lookup methods for marked bindings.
@param array<string, array<string, Binding>> $marked
@return string | [
"Compiles",
"lookup",
"methods",
"for",
"marked",
"bindings",
"."
] | f4aa614eb4ca1080bd89c7a2a54c9467c5b17a36 | https://github.com/koolkode/context/blob/f4aa614eb4ca1080bd89c7a2a54c9467c5b17a36/src/ContainerCompiler.php#L439-L491 |
195,112 | koolkode/context | src/ContainerCompiler.php | ContainerCompiler.compileScopedProxies | protected function compileScopedProxies(ContainerBuilder $builder, $proxyCachePath, array $additionalProxies = [])
{
$code = "\t\tpublic function loadScopedProxy(\$typeName) {\n";
$code .= "\t\tswitch(\$typeName) {\n";
$proxyTypes = [];
foreach($builder->getProxyBindings() as $binding)
{
$ref = n... | php | protected function compileScopedProxies(ContainerBuilder $builder, $proxyCachePath, array $additionalProxies = [])
{
$code = "\t\tpublic function loadScopedProxy(\$typeName) {\n";
$code .= "\t\tswitch(\$typeName) {\n";
$proxyTypes = [];
foreach($builder->getProxyBindings() as $binding)
{
$ref = n... | [
"protected",
"function",
"compileScopedProxies",
"(",
"ContainerBuilder",
"$",
"builder",
",",
"$",
"proxyCachePath",
",",
"array",
"$",
"additionalProxies",
"=",
"[",
"]",
")",
"{",
"$",
"code",
"=",
"\"\\t\\tpublic function loadScopedProxy(\\$typeName) {\\n\"",
";",
... | Compiles scoped proxy types and saves them on the filesystem.
@param ContainerBuilder $builder
@param string $proxyCachePath
@param array<stribg> $additionalProxies
@return string | [
"Compiles",
"scoped",
"proxy",
"types",
"and",
"saves",
"them",
"on",
"the",
"filesystem",
"."
] | f4aa614eb4ca1080bd89c7a2a54c9467c5b17a36 | https://github.com/koolkode/context/blob/f4aa614eb4ca1080bd89c7a2a54c9467c5b17a36/src/ContainerCompiler.php#L501-L551 |
195,113 | koolkode/context | src/ContainerCompiler.php | ContainerCompiler.compileSetterInjector | protected function compileSetterInjector(Binding $binding, $wrapClosure = true)
{
$setters = $binding->getMarkers(SetterInjection::class);
if(empty($setters))
{
return 'NULL';
}
$setterTypeName = $binding->isImplementationBinding() ? $binding->getTarget() : $binding->getTypeName();
$code = $wra... | php | protected function compileSetterInjector(Binding $binding, $wrapClosure = true)
{
$setters = $binding->getMarkers(SetterInjection::class);
if(empty($setters))
{
return 'NULL';
}
$setterTypeName = $binding->isImplementationBinding() ? $binding->getTarget() : $binding->getTypeName();
$code = $wra... | [
"protected",
"function",
"compileSetterInjector",
"(",
"Binding",
"$",
"binding",
",",
"$",
"wrapClosure",
"=",
"true",
")",
"{",
"$",
"setters",
"=",
"$",
"binding",
"->",
"getMarkers",
"(",
"SetterInjection",
"::",
"class",
")",
";",
"if",
"(",
"empty",
... | Compile a setter injector for a binding.
@param Binding $binding
@param boolean $wrapClosure
@return string | [
"Compile",
"a",
"setter",
"injector",
"for",
"a",
"binding",
"."
] | f4aa614eb4ca1080bd89c7a2a54c9467c5b17a36 | https://github.com/koolkode/context/blob/f4aa614eb4ca1080bd89c7a2a54c9467c5b17a36/src/ContainerCompiler.php#L560-L610 |
195,114 | koolkode/context | src/ContainerCompiler.php | ContainerCompiler.collectSetterMethods | protected function collectSetterMethods(\ReflectionClass $ref, SetterInjection $setter)
{
$methods = [];
foreach($ref->getMethods() as $method)
{
if($method->isStatic() || $method->isAbstract() || !$method->isPublic())
{
continue;
}
if($setter->accept($method))
{
$methods[strtolower... | php | protected function collectSetterMethods(\ReflectionClass $ref, SetterInjection $setter)
{
$methods = [];
foreach($ref->getMethods() as $method)
{
if($method->isStatic() || $method->isAbstract() || !$method->isPublic())
{
continue;
}
if($setter->accept($method))
{
$methods[strtolower... | [
"protected",
"function",
"collectSetterMethods",
"(",
"\\",
"ReflectionClass",
"$",
"ref",
",",
"SetterInjection",
"$",
"setter",
")",
"{",
"$",
"methods",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"ref",
"->",
"getMethods",
"(",
")",
"as",
"$",
"method",
... | Collect all matching setter injetion methods for the given type.
@param \ReflectionClass $ref
@param SetterInjection $setter
@return array<string, MethodInfoInterface> | [
"Collect",
"all",
"matching",
"setter",
"injetion",
"methods",
"for",
"the",
"given",
"type",
"."
] | f4aa614eb4ca1080bd89c7a2a54c9467c5b17a36 | https://github.com/koolkode/context/blob/f4aa614eb4ca1080bd89c7a2a54c9467c5b17a36/src/ContainerCompiler.php#L619-L637 |
195,115 | koolkode/context | src/ContainerCompiler.php | ContainerCompiler.generateCallCode | protected function generateCallCode($typeName, \ReflectionFunction $ref, $num, array $prepend = [], array $resolvers = NULL)
{
$code = '$this->call_' . $num . '(';
foreach($ref->getParameters() as $i => $param)
{
if($i != 0)
{
$code .= ', ';
}
if(array_key_exists($i, $prepend))
{
$c... | php | protected function generateCallCode($typeName, \ReflectionFunction $ref, $num, array $prepend = [], array $resolvers = NULL)
{
$code = '$this->call_' . $num . '(';
foreach($ref->getParameters() as $i => $param)
{
if($i != 0)
{
$code .= ', ';
}
if(array_key_exists($i, $prepend))
{
$c... | [
"protected",
"function",
"generateCallCode",
"(",
"$",
"typeName",
",",
"\\",
"ReflectionFunction",
"$",
"ref",
",",
"$",
"num",
",",
"array",
"$",
"prepend",
"=",
"[",
"]",
",",
"array",
"$",
"resolvers",
"=",
"NULL",
")",
"{",
"$",
"code",
"=",
"'$th... | Generate code calling a replacement method with arguments.
@param string $typeName
@param \ReflectionFunction $ref
@param integer $num
@param array<string> $prepend
@return string
@throws \RuntimeException When a param value could not be populated. | [
"Generate",
"code",
"calling",
"a",
"replacement",
"method",
"with",
"arguments",
"."
] | f4aa614eb4ca1080bd89c7a2a54c9467c5b17a36 | https://github.com/koolkode/context/blob/f4aa614eb4ca1080bd89c7a2a54c9467c5b17a36/src/ContainerCompiler.php#L650-L723 |
195,116 | koolkode/context | src/ContainerCompiler.php | ContainerCompiler.generateReplacementMethodSignature | protected function generateReplacementMethodSignature(\ReflectionFunction $ref, $num)
{
$code = 'protected function call_' . $num . '(';
foreach($ref->getParameters() as $i => $param)
{
if($i != 0)
{
$code .= ', ';
}
if(NULL !== ($ptype = $this->getParamType($param)))
{
$code .= '\\... | php | protected function generateReplacementMethodSignature(\ReflectionFunction $ref, $num)
{
$code = 'protected function call_' . $num . '(';
foreach($ref->getParameters() as $i => $param)
{
if($i != 0)
{
$code .= ', ';
}
if(NULL !== ($ptype = $this->getParamType($param)))
{
$code .= '\\... | [
"protected",
"function",
"generateReplacementMethodSignature",
"(",
"\\",
"ReflectionFunction",
"$",
"ref",
",",
"$",
"num",
")",
"{",
"$",
"code",
"=",
"'protected function call_'",
".",
"$",
"num",
".",
"'('",
";",
"foreach",
"(",
"$",
"ref",
"->",
"getParam... | Generate a signature for a method replacing the given closure.
@param \ReflectionFunction $ref
@param integer $num
@return string | [
"Generate",
"a",
"signature",
"for",
"a",
"method",
"replacing",
"the",
"given",
"closure",
"."
] | f4aa614eb4ca1080bd89c7a2a54c9467c5b17a36 | https://github.com/koolkode/context/blob/f4aa614eb4ca1080bd89c7a2a54c9467c5b17a36/src/ContainerCompiler.php#L732-L762 |
195,117 | koolkode/context | src/ContainerCompiler.php | ContainerCompiler.extractClosureCode | protected function extractClosureCode(\ReflectionFunction $ref)
{
$file = $ref->getFileName();
$lines = file($file, FILE_IGNORE_NEW_LINES);
if(isset($this->namespaceContextCache[$file]))
{
$namespaceContext = $this->namespaceContextCache[$file];
}
else
{
$tokens = token_get_all(implode("\n", $li... | php | protected function extractClosureCode(\ReflectionFunction $ref)
{
$file = $ref->getFileName();
$lines = file($file, FILE_IGNORE_NEW_LINES);
if(isset($this->namespaceContextCache[$file]))
{
$namespaceContext = $this->namespaceContextCache[$file];
}
else
{
$tokens = token_get_all(implode("\n", $li... | [
"protected",
"function",
"extractClosureCode",
"(",
"\\",
"ReflectionFunction",
"$",
"ref",
")",
"{",
"$",
"file",
"=",
"$",
"ref",
"->",
"getFileName",
"(",
")",
";",
"$",
"lines",
"=",
"file",
"(",
"$",
"file",
",",
"FILE_IGNORE_NEW_LINES",
")",
";",
"... | Extract code of the given closure and process it for use in a replacement method.
@param \ReflectionFunction $ref
@return string | [
"Extract",
"code",
"of",
"the",
"given",
"closure",
"and",
"process",
"it",
"for",
"use",
"in",
"a",
"replacement",
"method",
"."
] | f4aa614eb4ca1080bd89c7a2a54c9467c5b17a36 | https://github.com/koolkode/context/blob/f4aa614eb4ca1080bd89c7a2a54c9467c5b17a36/src/ContainerCompiler.php#L770-L796 |
195,118 | koolkode/context | src/ContainerCompiler.php | ContainerCompiler.generateNamespaceContext | protected function generateNamespaceContext(array & $tokens)
{
$namespaceContext = new NamespaceContext();
for($size = count($tokens), $i = 0; $i < $size; $i++)
{
if(is_array($tokens[$i]))
{
switch($tokens[$i][0])
{
case T_NAMESPACE:
$namespace = '';
for($i++; $i <... | php | protected function generateNamespaceContext(array & $tokens)
{
$namespaceContext = new NamespaceContext();
for($size = count($tokens), $i = 0; $i < $size; $i++)
{
if(is_array($tokens[$i]))
{
switch($tokens[$i][0])
{
case T_NAMESPACE:
$namespace = '';
for($i++; $i <... | [
"protected",
"function",
"generateNamespaceContext",
"(",
"array",
"&",
"$",
"tokens",
")",
"{",
"$",
"namespaceContext",
"=",
"new",
"NamespaceContext",
"(",
")",
";",
"for",
"(",
"$",
"size",
"=",
"count",
"(",
"$",
"tokens",
")",
",",
"$",
"i",
"=",
... | Read namespace context from the given PHP source tokens.
@param array $tokens
@return NamespaceContext | [
"Read",
"namespace",
"context",
"from",
"the",
"given",
"PHP",
"source",
"tokens",
"."
] | f4aa614eb4ca1080bd89c7a2a54c9467c5b17a36 | https://github.com/koolkode/context/blob/f4aa614eb4ca1080bd89c7a2a54c9467c5b17a36/src/ContainerCompiler.php#L804-L860 |
195,119 | koolkode/context | src/ContainerCompiler.php | ContainerCompiler.readImport | protected function readImport(array $tokens, & $i, NamespaceContext $context)
{
$import = '';
for($size = count($tokens); $i < $size; $i++)
{
if(is_array($tokens[$i]))
{
switch($tokens[$i][0])
{
case T_WHITESPACE:
case T_COMMENT:
case T_DOC_COMMENT:
continue 2;
case T_N... | php | protected function readImport(array $tokens, & $i, NamespaceContext $context)
{
$import = '';
for($size = count($tokens); $i < $size; $i++)
{
if(is_array($tokens[$i]))
{
switch($tokens[$i][0])
{
case T_WHITESPACE:
case T_COMMENT:
case T_DOC_COMMENT:
continue 2;
case T_N... | [
"protected",
"function",
"readImport",
"(",
"array",
"$",
"tokens",
",",
"&",
"$",
"i",
",",
"NamespaceContext",
"$",
"context",
")",
"{",
"$",
"import",
"=",
"''",
";",
"for",
"(",
"$",
"size",
"=",
"count",
"(",
"$",
"tokens",
")",
";",
"$",
"i",... | Read a PHP import statement and register it with the given namespace context.
@param array $tokens
@param integer $i
@param NamespaceContext $context | [
"Read",
"a",
"PHP",
"import",
"statement",
"and",
"register",
"it",
"with",
"the",
"given",
"namespace",
"context",
"."
] | f4aa614eb4ca1080bd89c7a2a54c9467c5b17a36 | https://github.com/koolkode/context/blob/f4aa614eb4ca1080bd89c7a2a54c9467c5b17a36/src/ContainerCompiler.php#L1003-L1057 |
195,120 | stubbles/stubbles-date | src/main/php/span/Day.php | Day.isToday | public function isToday(): bool
{
return $this->date->format('Y-m-d') === Date::now($this->date->timezone())->format('Y-m-d');
} | php | public function isToday(): bool
{
return $this->date->format('Y-m-d') === Date::now($this->date->timezone())->format('Y-m-d');
} | [
"public",
"function",
"isToday",
"(",
")",
":",
"bool",
"{",
"return",
"$",
"this",
"->",
"date",
"->",
"format",
"(",
"'Y-m-d'",
")",
"===",
"Date",
"::",
"now",
"(",
"$",
"this",
"->",
"date",
"->",
"timezone",
"(",
")",
")",
"->",
"format",
"(",... | checks if it represents the current day
@return bool | [
"checks",
"if",
"it",
"represents",
"the",
"current",
"day"
] | 98553392bec03affc53a6e3eb7f88408c2720d1c | https://github.com/stubbles/stubbles-date/blob/98553392bec03affc53a6e3eb7f88408c2720d1c/src/main/php/span/Day.php#L109-L112 |
195,121 | ZeeCoder/good-to-know | src/ZeeCoder/GoodToKnow/Repository/AbstractFileRepository.php | AbstractFileRepository.mapDataToFactObjects | private function mapDataToFactObjects(array $data)
{
return array_map(function($factData) {
return (new Fact)
->setText($factData['text'])
->setGroups($factData['groups'])
;
}, $data);
} | php | private function mapDataToFactObjects(array $data)
{
return array_map(function($factData) {
return (new Fact)
->setText($factData['text'])
->setGroups($factData['groups'])
;
}, $data);
} | [
"private",
"function",
"mapDataToFactObjects",
"(",
"array",
"$",
"data",
")",
"{",
"return",
"array_map",
"(",
"function",
"(",
"$",
"factData",
")",
"{",
"return",
"(",
"new",
"Fact",
")",
"->",
"setText",
"(",
"$",
"factData",
"[",
"'text'",
"]",
")",... | Converts an array of data to an array of Fact objects.
@param array $data An array of data with two keys: "text" and "groups"
where text must be a string and groups must be an array of strings.
@return array | [
"Converts",
"an",
"array",
"of",
"data",
"to",
"an",
"array",
"of",
"Fact",
"objects",
"."
] | 53a8ea6ab4a2cb0f2fd8e1371e7a4a4841be5ede | https://github.com/ZeeCoder/good-to-know/blob/53a8ea6ab4a2cb0f2fd8e1371e7a4a4841be5ede/src/ZeeCoder/GoodToKnow/Repository/AbstractFileRepository.php#L47-L55 |
195,122 | fridge-project/dbal | src/Fridge/DBAL/Connection/Connection.php | Connection.bindStatementParameters | private function bindStatementParameters(DriverStatementInterface $statement, array $parameters, array $types)
{
foreach ($parameters as $key => $parameter) {
if (is_int($key)) {
$placeholder = $key + 1;
} else {
$placeholder = ':'.$key;
}
... | php | private function bindStatementParameters(DriverStatementInterface $statement, array $parameters, array $types)
{
foreach ($parameters as $key => $parameter) {
if (is_int($key)) {
$placeholder = $key + 1;
} else {
$placeholder = ':'.$key;
}
... | [
"private",
"function",
"bindStatementParameters",
"(",
"DriverStatementInterface",
"$",
"statement",
",",
"array",
"$",
"parameters",
",",
"array",
"$",
"types",
")",
"{",
"foreach",
"(",
"$",
"parameters",
"as",
"$",
"key",
"=>",
"$",
"parameter",
")",
"{",
... | Binds typed parameters to a statement.
@param \Fridge\DBAL\Driver\Statement\DriverStatementInterface $statement The statement to bind on.
@param array $parameters The statement parameters.
@param array $types The st... | [
"Binds",
"typed",
"parameters",
"to",
"a",
"statement",
"."
] | d0b8c3551922d696836487aa0eb1bd74014edcd4 | https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/Connection/Connection.php#L681-L702 |
195,123 | fridge-project/dbal | src/Fridge/DBAL/Connection/Connection.php | Connection.createQueryDebugger | private function createQueryDebugger($query, array $parameters = array(), array $types = array())
{
if ($this->getConfiguration()->getDebug()) {
return new QueryDebugger($query, $parameters, $types);
}
} | php | private function createQueryDebugger($query, array $parameters = array(), array $types = array())
{
if ($this->getConfiguration()->getDebug()) {
return new QueryDebugger($query, $parameters, $types);
}
} | [
"private",
"function",
"createQueryDebugger",
"(",
"$",
"query",
",",
"array",
"$",
"parameters",
"=",
"array",
"(",
")",
",",
"array",
"$",
"types",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"getConfiguration",
"(",
")",
"->",
... | Creates a query debugger if the query needs to be debugged.
@param string $query The query to debug.
@param array $parameters The query parameters to debug.
@param array $types The query parameter types to debug.
@return \Fridge\DBAL\Debug\QueryDebugger|null The query debugger or null if the query does ne... | [
"Creates",
"a",
"query",
"debugger",
"if",
"the",
"query",
"needs",
"to",
"be",
"debugged",
"."
] | d0b8c3551922d696836487aa0eb1bd74014edcd4 | https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/Connection/Connection.php#L713-L718 |
195,124 | fridge-project/dbal | src/Fridge/DBAL/Connection/Connection.php | Connection.debugQuery | private function debugQuery(QueryDebugger $queryDebugger = null)
{
if ($queryDebugger === null) {
return;
}
$queryDebugger->stop();
$this->getConfiguration()->getEventDispatcher()->dispatch(
Events::QUERY_DEBUG,
new QueryDebugEvent($queryDebugger... | php | private function debugQuery(QueryDebugger $queryDebugger = null)
{
if ($queryDebugger === null) {
return;
}
$queryDebugger->stop();
$this->getConfiguration()->getEventDispatcher()->dispatch(
Events::QUERY_DEBUG,
new QueryDebugEvent($queryDebugger... | [
"private",
"function",
"debugQuery",
"(",
"QueryDebugger",
"$",
"queryDebugger",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"queryDebugger",
"===",
"null",
")",
"{",
"return",
";",
"}",
"$",
"queryDebugger",
"->",
"stop",
"(",
")",
";",
"$",
"this",
"->",
... | Debugs a query.
@param \Fridge\DBAL\Debug\QueryDebugger|null $queryDebugger The query debugger. | [
"Debugs",
"a",
"query",
"."
] | d0b8c3551922d696836487aa0eb1bd74014edcd4 | https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/Connection/Connection.php#L725-L737 |
195,125 | mikyprog/LocationBundle | Manager/LocationManager.php | LocationManager.updateLocation | public function updateLocation(Location $location, $andFlush = true)
{
$this->objectManager->persist($location);
if ($andFlush) {
$this->objectManager->flush();
}
} | php | public function updateLocation(Location $location, $andFlush = true)
{
$this->objectManager->persist($location);
if ($andFlush) {
$this->objectManager->flush();
}
} | [
"public",
"function",
"updateLocation",
"(",
"Location",
"$",
"location",
",",
"$",
"andFlush",
"=",
"true",
")",
"{",
"$",
"this",
"->",
"objectManager",
"->",
"persist",
"(",
"$",
"location",
")",
";",
"if",
"(",
"$",
"andFlush",
")",
"{",
"$",
"this... | Updates a Location.
@param Location $location
@param Boolean $andFlush Whether to flush the changes (default true) | [
"Updates",
"a",
"Location",
"."
] | ffbbc8e6b7c759f0dbf0dec6d36a8f3150322f23 | https://github.com/mikyprog/LocationBundle/blob/ffbbc8e6b7c759f0dbf0dec6d36a8f3150322f23/Manager/LocationManager.php#L86-L92 |
195,126 | mikyprog/LocationBundle | Manager/LocationManager.php | LocationManager.refreshLocation | public function refreshLocation(Location $location)
{
$refreshedLocation = $this->findLocationBy(array('id' => $location->getId()));
if (null === $refreshedLocation) {
throw new UsernameNotFoundException(sprintf('User with ID "%d" could not be reloaded.', $location->getId()));
}... | php | public function refreshLocation(Location $location)
{
$refreshedLocation = $this->findLocationBy(array('id' => $location->getId()));
if (null === $refreshedLocation) {
throw new UsernameNotFoundException(sprintf('User with ID "%d" could not be reloaded.', $location->getId()));
}... | [
"public",
"function",
"refreshLocation",
"(",
"Location",
"$",
"location",
")",
"{",
"$",
"refreshedLocation",
"=",
"$",
"this",
"->",
"findLocationBy",
"(",
"array",
"(",
"'id'",
"=>",
"$",
"location",
"->",
"getId",
"(",
")",
")",
")",
";",
"if",
"(",
... | Refreshed a Location by Location Instance
@param LocationInterface $location
@return Ad | [
"Refreshed",
"a",
"Location",
"by",
"Location",
"Instance"
] | ffbbc8e6b7c759f0dbf0dec6d36a8f3150322f23 | https://github.com/mikyprog/LocationBundle/blob/ffbbc8e6b7c759f0dbf0dec6d36a8f3150322f23/Manager/LocationManager.php#L113-L121 |
195,127 | itcreator/custom-cmf | Module/Url/src/Cmf/Url/Builder/Adapter/Get.php | Get.buildRecursive | protected function buildRecursive($key, $value)
{
$url = '';
if (is_array($value)) {
foreach ($value as $key2 => $val) {
if ($part = $this->buildRecursive($key . '[' . $key2 . ']', $val)) {
$url .= ($url ? '&' : '') . $part;
}
... | php | protected function buildRecursive($key, $value)
{
$url = '';
if (is_array($value)) {
foreach ($value as $key2 => $val) {
if ($part = $this->buildRecursive($key . '[' . $key2 . ']', $val)) {
$url .= ($url ? '&' : '') . $part;
}
... | [
"protected",
"function",
"buildRecursive",
"(",
"$",
"key",
",",
"$",
"value",
")",
"{",
"$",
"url",
"=",
"''",
";",
"if",
"(",
"is_array",
"(",
"$",
"value",
")",
")",
"{",
"foreach",
"(",
"$",
"value",
"as",
"$",
"key2",
"=>",
"$",
"val",
")",
... | arrays in request
@param string $key
@param string|array $value
@return string | [
"arrays",
"in",
"request"
] | 42fc0535dfa0f641856f06673f6ab596b2020c40 | https://github.com/itcreator/custom-cmf/blob/42fc0535dfa0f641856f06673f6ab596b2020c40/Module/Url/src/Cmf/Url/Builder/Adapter/Get.php#L81-L95 |
195,128 | dmitrya2e/filtration-bundle | Filter/FilterOption/FilterOptionHandler.php | FilterOptionHandler.validateFilterOptions | protected function validateFilterOptions(array $options, array $validOptions)
{
foreach ($options as $option => $value) {
// Check if the option is allowed.
if (!array_key_exists($option, $validOptions)) {
throw new FilterOptionValidatorException(sprintf(
... | php | protected function validateFilterOptions(array $options, array $validOptions)
{
foreach ($options as $option => $value) {
// Check if the option is allowed.
if (!array_key_exists($option, $validOptions)) {
throw new FilterOptionValidatorException(sprintf(
... | [
"protected",
"function",
"validateFilterOptions",
"(",
"array",
"$",
"options",
",",
"array",
"$",
"validOptions",
")",
"{",
"foreach",
"(",
"$",
"options",
"as",
"$",
"option",
"=>",
"$",
"value",
")",
"{",
"// Check if the option is allowed.",
"if",
"(",
"!"... | Validates filter options.
@param array $options User set options
@param array $validOptions FilterOptionInterface::getValidOptions()
@return static
@throws FilterOptionException On unexpected errors (e.g. function for type checking does not exist)
@throws FilterOptionValidatorException On validation error | [
"Validates",
"filter",
"options",
"."
] | fed5764af4e43871835744fb84957b2a76e9a215 | https://github.com/dmitrya2e/filtration-bundle/blob/fed5764af4e43871835744fb84957b2a76e9a215/Filter/FilterOption/FilterOptionHandler.php#L68-L141 |
195,129 | dmitrya2e/filtration-bundle | Filter/FilterOption/FilterOptionHandler.php | FilterOptionHandler.setFilterOptions | protected function setFilterOptions(FilterOptionInterface $filter, array $options, array $validOptions)
{
foreach ($options as $option => $value) {
if (!array_key_exists('setter', $validOptions[$option])) {
throw new FilterOptionException(sprintf(
'Key "setter... | php | protected function setFilterOptions(FilterOptionInterface $filter, array $options, array $validOptions)
{
foreach ($options as $option => $value) {
if (!array_key_exists('setter', $validOptions[$option])) {
throw new FilterOptionException(sprintf(
'Key "setter... | [
"protected",
"function",
"setFilterOptions",
"(",
"FilterOptionInterface",
"$",
"filter",
",",
"array",
"$",
"options",
",",
"array",
"$",
"validOptions",
")",
"{",
"foreach",
"(",
"$",
"options",
"as",
"$",
"option",
"=>",
"$",
"value",
")",
"{",
"if",
"(... | Sets filter options.
Options must be validated before setting them.
@param FilterOptionInterface $filter
@param array $options User set options
@param array $validOptions FilterOptionInterface::getValidOptions()
@return static
@throws FilterOptionException On unexpected error (suc... | [
"Sets",
"filter",
"options",
".",
"Options",
"must",
"be",
"validated",
"before",
"setting",
"them",
"."
] | fed5764af4e43871835744fb84957b2a76e9a215 | https://github.com/dmitrya2e/filtration-bundle/blob/fed5764af4e43871835744fb84957b2a76e9a215/Filter/FilterOption/FilterOptionHandler.php#L154-L176 |
195,130 | Krinkle/toollabs-base | src/GlobalConfig.php | GlobalConfig.writeDebugLog | public function writeDebugLog( $val ) {
if ( $this->debugMode === false ) {
return;
}
$this->runlog .= $this->getLogSection() . '> '
. $val
. "\n";
} | php | public function writeDebugLog( $val ) {
if ( $this->debugMode === false ) {
return;
}
$this->runlog .= $this->getLogSection() . '> '
. $val
. "\n";
} | [
"public",
"function",
"writeDebugLog",
"(",
"$",
"val",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"debugMode",
"===",
"false",
")",
"{",
"return",
";",
"}",
"$",
"this",
"->",
"runlog",
".=",
"$",
"this",
"->",
"getLogSection",
"(",
")",
".",
"'> '",
... | Write one or more lines to the debug log | [
"Write",
"one",
"or",
"more",
"lines",
"to",
"the",
"debug",
"log"
] | 784150ca58f4b48cc89534fd6142c54b4f138cd2 | https://github.com/Krinkle/toollabs-base/blob/784150ca58f4b48cc89534fd6142c54b4f138cd2/src/GlobalConfig.php#L98-L106 |
195,131 | liip/DataAggregator | src/Liip/DataAggregator/DataAggregatorBatch.php | DataAggregatorBatch.run | public function run()
{
Assertion::notEmpty(
$this->loaders,
'No loader attached.',
DataAggregatorException::NO_LOADER_ATTACHED
);
foreach ($this->loaders as $identifier => $loader) {
$this->executeLoader($loader);
}
} | php | public function run()
{
Assertion::notEmpty(
$this->loaders,
'No loader attached.',
DataAggregatorException::NO_LOADER_ATTACHED
);
foreach ($this->loaders as $identifier => $loader) {
$this->executeLoader($loader);
}
} | [
"public",
"function",
"run",
"(",
")",
"{",
"Assertion",
"::",
"notEmpty",
"(",
"$",
"this",
"->",
"loaders",
",",
"'No loader attached.'",
",",
"DataAggregatorException",
"::",
"NO_LOADER_ATTACHED",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"loaders",
"as"... | Executes the processing of every attached loader.
Run each loader with limit and offset as long as it
returns not less than the limit of items persist
after each batch.
@throws \Assert\InvalidArgumentException in case no loader is attached. | [
"Executes",
"the",
"processing",
"of",
"every",
"attached",
"loader",
"."
] | 53da08ed3f5f24597be9f40ecf8ec44da7765e47 | https://github.com/liip/DataAggregator/blob/53da08ed3f5f24597be9f40ecf8ec44da7765e47/src/Liip/DataAggregator/DataAggregatorBatch.php#L57-L68 |
195,132 | liip/DataAggregator | src/Liip/DataAggregator/DataAggregatorBatch.php | DataAggregatorBatch.executeLoader | protected function executeLoader(LoaderInterface $loader)
{
$offset = 0;
try {
while ($result = $loader->load($this->limit, $offset)) {
$this->persist($result);
$offset += $this->limit;
}
} catch (LoaderException $e) {
$... | php | protected function executeLoader(LoaderInterface $loader)
{
$offset = 0;
try {
while ($result = $loader->load($this->limit, $offset)) {
$this->persist($result);
$offset += $this->limit;
}
} catch (LoaderException $e) {
$... | [
"protected",
"function",
"executeLoader",
"(",
"LoaderInterface",
"$",
"loader",
")",
"{",
"$",
"offset",
"=",
"0",
";",
"try",
"{",
"while",
"(",
"$",
"result",
"=",
"$",
"loader",
"->",
"load",
"(",
"$",
"this",
"->",
"limit",
",",
"$",
"offset",
"... | Runs the addressed loader to retrieve its' data.
Any exception or error will be logged to the systems error log.
@param LoaderInterface $loader | [
"Runs",
"the",
"addressed",
"loader",
"to",
"retrieve",
"its",
"data",
"."
] | 53da08ed3f5f24597be9f40ecf8ec44da7765e47 | https://github.com/liip/DataAggregator/blob/53da08ed3f5f24597be9f40ecf8ec44da7765e47/src/Liip/DataAggregator/DataAggregatorBatch.php#L77-L92 |
195,133 | liip/DataAggregator | src/Liip/DataAggregator/DataAggregatorBatch.php | DataAggregatorBatch.setLimit | public function setLimit($limit)
{
$message = 'Given limit must be a positive number.';
Assertion::numeric($limit, $message);
Assertion::min($limit, 0, $message);
$this->limit = $limit;
} | php | public function setLimit($limit)
{
$message = 'Given limit must be a positive number.';
Assertion::numeric($limit, $message);
Assertion::min($limit, 0, $message);
$this->limit = $limit;
} | [
"public",
"function",
"setLimit",
"(",
"$",
"limit",
")",
"{",
"$",
"message",
"=",
"'Given limit must be a positive number.'",
";",
"Assertion",
"::",
"numeric",
"(",
"$",
"limit",
",",
"$",
"message",
")",
";",
"Assertion",
"::",
"min",
"(",
"$",
"limit",
... | Defines the amount of entities to be fetched from the information provider.
@param integer $limit Positive integer defining the amount of records to be return in max. Zero (0) defines an unlimited amount.
@throws \Assert\InvalidArgumentException in case the provided argument does not meet expectations. | [
"Defines",
"the",
"amount",
"of",
"entities",
"to",
"be",
"fetched",
"from",
"the",
"information",
"provider",
"."
] | 53da08ed3f5f24597be9f40ecf8ec44da7765e47 | https://github.com/liip/DataAggregator/blob/53da08ed3f5f24597be9f40ecf8ec44da7765e47/src/Liip/DataAggregator/DataAggregatorBatch.php#L101-L108 |
195,134 | liip/DataAggregator | src/Liip/DataAggregator/DataAggregatorBatch.php | DataAggregatorBatch.persist | protected function persist(array $data)
{
Assertion::notEmpty(
$this->persistors,
'No persistor attached.',
DataAggregatorException::NO_PERSISTOR_ATTACHED
);
foreach ($this->persistors as $persistor) {
try {
$persistor->persist... | php | protected function persist(array $data)
{
Assertion::notEmpty(
$this->persistors,
'No persistor attached.',
DataAggregatorException::NO_PERSISTOR_ATTACHED
);
foreach ($this->persistors as $persistor) {
try {
$persistor->persist... | [
"protected",
"function",
"persist",
"(",
"array",
"$",
"data",
")",
"{",
"Assertion",
"::",
"notEmpty",
"(",
"$",
"this",
"->",
"persistors",
",",
"'No persistor attached.'",
",",
"DataAggregatorException",
"::",
"NO_PERSISTOR_ATTACHED",
")",
";",
"foreach",
"(",
... | Forwards the gathered data to every registered output handler.
@param array $data
@throws InvalidArgumentException in case no persistor has been attached. | [
"Forwards",
"the",
"gathered",
"data",
"to",
"every",
"registered",
"output",
"handler",
"."
] | 53da08ed3f5f24597be9f40ecf8ec44da7765e47 | https://github.com/liip/DataAggregator/blob/53da08ed3f5f24597be9f40ecf8ec44da7765e47/src/Liip/DataAggregator/DataAggregatorBatch.php#L127-L143 |
195,135 | liip/DataAggregator | src/Liip/DataAggregator/DataAggregatorBatch.php | DataAggregatorBatch.attachLoader | public function attachLoader(LoaderInterface $loader, $key = '')
{
if (empty($key)) {
$this->loaders[] = $loader;
} else {
$this->loaders[$key] = $loader;
}
} | php | public function attachLoader(LoaderInterface $loader, $key = '')
{
if (empty($key)) {
$this->loaders[] = $loader;
} else {
$this->loaders[$key] = $loader;
}
} | [
"public",
"function",
"attachLoader",
"(",
"LoaderInterface",
"$",
"loader",
",",
"$",
"key",
"=",
"''",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"key",
")",
")",
"{",
"$",
"this",
"->",
"loaders",
"[",
"]",
"=",
"$",
"loader",
";",
"}",
"else",
"... | Adds given loader to registry.
@param LoaderInterface $loader
@param string $key | [
"Adds",
"given",
"loader",
"to",
"registry",
"."
] | 53da08ed3f5f24597be9f40ecf8ec44da7765e47 | https://github.com/liip/DataAggregator/blob/53da08ed3f5f24597be9f40ecf8ec44da7765e47/src/Liip/DataAggregator/DataAggregatorBatch.php#L151-L158 |
195,136 | liip/DataAggregator | src/Liip/DataAggregator/DataAggregatorBatch.php | DataAggregatorBatch.attachPersistor | public function attachPersistor(PersistorInterface $persistor, $key = '')
{
if (empty($key)) {
$this->persistors[] = $persistor;
} else {
$this->persistors[$key] = $persistor;
}
} | php | public function attachPersistor(PersistorInterface $persistor, $key = '')
{
if (empty($key)) {
$this->persistors[] = $persistor;
} else {
$this->persistors[$key] = $persistor;
}
} | [
"public",
"function",
"attachPersistor",
"(",
"PersistorInterface",
"$",
"persistor",
",",
"$",
"key",
"=",
"''",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"key",
")",
")",
"{",
"$",
"this",
"->",
"persistors",
"[",
"]",
"=",
"$",
"persistor",
";",
"}"... | Adds the given persistor to the collection of output handlers
@param PersistorInterface $persistor
@param string $key | [
"Adds",
"the",
"given",
"persistor",
"to",
"the",
"collection",
"of",
"output",
"handlers"
] | 53da08ed3f5f24597be9f40ecf8ec44da7765e47 | https://github.com/liip/DataAggregator/blob/53da08ed3f5f24597be9f40ecf8ec44da7765e47/src/Liip/DataAggregator/DataAggregatorBatch.php#L185-L192 |
195,137 | AlexyaFramework/FileSystem | Alexya/FileSystem/File.php | File.make | public static function make(string $path, int $ifExists = File::MAKE_FILE_EXISTS_THROW_EXCEPTION) : File
{
$exists = File::exists($path);
if($exists) {
if($ifExists === File::MAKE_FILE_EXISTS_OVERWRITE) {
unlink($path);
} else if($ifExists === File::MAKE_FILE... | php | public static function make(string $path, int $ifExists = File::MAKE_FILE_EXISTS_THROW_EXCEPTION) : File
{
$exists = File::exists($path);
if($exists) {
if($ifExists === File::MAKE_FILE_EXISTS_OVERWRITE) {
unlink($path);
} else if($ifExists === File::MAKE_FILE... | [
"public",
"static",
"function",
"make",
"(",
"string",
"$",
"path",
",",
"int",
"$",
"ifExists",
"=",
"File",
"::",
"MAKE_FILE_EXISTS_THROW_EXCEPTION",
")",
":",
"File",
"{",
"$",
"exists",
"=",
"File",
"::",
"exists",
"(",
"$",
"path",
")",
";",
"if",
... | Makes a file.
The second parameter specifies what to do in case file already exists:
* `\Alexya\FileSystem\File::MAKE_FILE_EXISTS_THROW_EXCEPTION`, throws an exception (default).
* `\Alexya\FileSystem\File::MAKE_FILE_EXISTS_OVERWRITE`, deletes the file and recreates it.
* `\Alexya\FileSystem\File::MAKE_FILE_EXISTS_OP... | [
"Makes",
"a",
"file",
"."
] | 1f2a848c4bd508c0ce0e14f49e231522cc059424 | https://github.com/AlexyaFramework/FileSystem/blob/1f2a848c4bd508c0ce0e14f49e231522cc059424/Alexya/FileSystem/File.php#L81-L100 |
195,138 | AlexyaFramework/FileSystem | Alexya/FileSystem/File.php | File.write | public function write(string $str)
{
$handler = fopen($this->_path, "w");
fwrite($handler, $str);
fclose($handler);
} | php | public function write(string $str)
{
$handler = fopen($this->_path, "w");
fwrite($handler, $str);
fclose($handler);
} | [
"public",
"function",
"write",
"(",
"string",
"$",
"str",
")",
"{",
"$",
"handler",
"=",
"fopen",
"(",
"$",
"this",
"->",
"_path",
",",
"\"w\"",
")",
";",
"fwrite",
"(",
"$",
"handler",
",",
"$",
"str",
")",
";",
"fclose",
"(",
"$",
"handler",
")... | Writes a string to the file.
@param string $str String to write. | [
"Writes",
"a",
"string",
"to",
"the",
"file",
"."
] | 1f2a848c4bd508c0ce0e14f49e231522cc059424 | https://github.com/AlexyaFramework/FileSystem/blob/1f2a848c4bd508c0ce0e14f49e231522cc059424/Alexya/FileSystem/File.php#L235-L240 |
195,139 | AlexyaFramework/FileSystem | Alexya/FileSystem/File.php | File.read | public function read(int $length = 1, int $offset = 0) : string
{
return substr($this->getContent(), $offset, $length);
} | php | public function read(int $length = 1, int $offset = 0) : string
{
return substr($this->getContent(), $offset, $length);
} | [
"public",
"function",
"read",
"(",
"int",
"$",
"length",
"=",
"1",
",",
"int",
"$",
"offset",
"=",
"0",
")",
":",
"string",
"{",
"return",
"substr",
"(",
"$",
"this",
"->",
"getContent",
"(",
")",
",",
"$",
"offset",
",",
"$",
"length",
")",
";",... | Returns a string of specified length from file.
@param int $length Length to read.
@param int $offset Length to skip before reading.
@return string String from file of given length. | [
"Returns",
"a",
"string",
"of",
"specified",
"length",
"from",
"file",
"."
] | 1f2a848c4bd508c0ce0e14f49e231522cc059424 | https://github.com/AlexyaFramework/FileSystem/blob/1f2a848c4bd508c0ce0e14f49e231522cc059424/Alexya/FileSystem/File.php#L272-L275 |
195,140 | AlexyaFramework/FileSystem | Alexya/FileSystem/File.php | File.readLine | public function readLine(int $line = 1) : string
{
$lines = file($this->_path);
if($line > count($lines)) {
throw new LineNumberAboveFileLines($this->_path, $line, count($lines));
}
if($line <= 0) {
$line = 1;
}
return $lines[($line - 1)];
... | php | public function readLine(int $line = 1) : string
{
$lines = file($this->_path);
if($line > count($lines)) {
throw new LineNumberAboveFileLines($this->_path, $line, count($lines));
}
if($line <= 0) {
$line = 1;
}
return $lines[($line - 1)];
... | [
"public",
"function",
"readLine",
"(",
"int",
"$",
"line",
"=",
"1",
")",
":",
"string",
"{",
"$",
"lines",
"=",
"file",
"(",
"$",
"this",
"->",
"_path",
")",
";",
"if",
"(",
"$",
"line",
">",
"count",
"(",
"$",
"lines",
")",
")",
"{",
"throw",... | Returns a single line from file.
@param int $line Line number.
@return string Line as string.
@throws LineNumberAboveFileLines If the line number is bigger than the total number of lines | [
"Returns",
"a",
"single",
"line",
"from",
"file",
"."
] | 1f2a848c4bd508c0ce0e14f49e231522cc059424 | https://github.com/AlexyaFramework/FileSystem/blob/1f2a848c4bd508c0ce0e14f49e231522cc059424/Alexya/FileSystem/File.php#L299-L312 |
195,141 | AlexyaFramework/FileSystem | Alexya/FileSystem/File.php | File.setExtension | public function setExtension(string $extension)
{
$old = $this->getPath();
$new = $this->getLocation().DIRECTORY_SEPARATOR.$this->getName();
if(!empty($extension)) {
$new .= ".{$extension}";
}
if(rename($old, $new)) {
$this->_extension = $extension;
... | php | public function setExtension(string $extension)
{
$old = $this->getPath();
$new = $this->getLocation().DIRECTORY_SEPARATOR.$this->getName();
if(!empty($extension)) {
$new .= ".{$extension}";
}
if(rename($old, $new)) {
$this->_extension = $extension;
... | [
"public",
"function",
"setExtension",
"(",
"string",
"$",
"extension",
")",
"{",
"$",
"old",
"=",
"$",
"this",
"->",
"getPath",
"(",
")",
";",
"$",
"new",
"=",
"$",
"this",
"->",
"getLocation",
"(",
")",
".",
"DIRECTORY_SEPARATOR",
".",
"$",
"this",
... | Renames file extension.
@param string $extension New file extension. | [
"Renames",
"file",
"extension",
"."
] | 1f2a848c4bd508c0ce0e14f49e231522cc059424 | https://github.com/AlexyaFramework/FileSystem/blob/1f2a848c4bd508c0ce0e14f49e231522cc059424/Alexya/FileSystem/File.php#L380-L392 |
195,142 | shadowfax/zf2-asset-manager | src/AssetManager/Mvc/AssetRouteListener.php | AssetRouteListener.onPreRoute | public function onPreRoute(MvcEvent $event)
{
// Get the router object
$serviceManager = $event->getApplication()->getServiceManager();
$router = $event->getRouter();
// Load the route configuration
$config = $serviceManager->get('Config');
$config = isset($config['asset_... | php | public function onPreRoute(MvcEvent $event)
{
// Get the router object
$serviceManager = $event->getApplication()->getServiceManager();
$router = $event->getRouter();
// Load the route configuration
$config = $serviceManager->get('Config');
$config = isset($config['asset_... | [
"public",
"function",
"onPreRoute",
"(",
"MvcEvent",
"$",
"event",
")",
"{",
"// Get the router object",
"$",
"serviceManager",
"=",
"$",
"event",
"->",
"getApplication",
"(",
")",
"->",
"getServiceManager",
"(",
")",
";",
"$",
"router",
"=",
"$",
"event",
"... | Late-binding asset routes.
@param MvcEvent $event | [
"Late",
"-",
"binding",
"asset",
"routes",
"."
] | adbdc40417c6fddbba1a8c8b675e59ce1a25ad65 | https://github.com/shadowfax/zf2-asset-manager/blob/adbdc40417c6fddbba1a8c8b675e59ce1a25ad65/src/AssetManager/Mvc/AssetRouteListener.php#L65-L115 |
195,143 | shadowfax/zf2-asset-manager | src/AssetManager/Mvc/AssetRouteListener.php | AssetRouteListener.onPostRoute | public function onPostRoute(MvcEvent $e)
{
$matches = $e->getRouteMatch();
if (!$matches instanceof Router\RouteMatch) {
// Can't do anything without a route match
return;
}
// Check for 'asset_manager' route
$routeName = $matches->getMatchedRouteNa... | php | public function onPostRoute(MvcEvent $e)
{
$matches = $e->getRouteMatch();
if (!$matches instanceof Router\RouteMatch) {
// Can't do anything without a route match
return;
}
// Check for 'asset_manager' route
$routeName = $matches->getMatchedRouteNa... | [
"public",
"function",
"onPostRoute",
"(",
"MvcEvent",
"$",
"e",
")",
"{",
"$",
"matches",
"=",
"$",
"e",
"->",
"getRouteMatch",
"(",
")",
";",
"if",
"(",
"!",
"$",
"matches",
"instanceof",
"Router",
"\\",
"RouteMatch",
")",
"{",
"// Can't do anything witho... | Listen to the "route" event and determine if an asset should be loaded.
@param MvcEvent $e
@return Response|null | [
"Listen",
"to",
"the",
"route",
"event",
"and",
"determine",
"if",
"an",
"asset",
"should",
"be",
"loaded",
"."
] | adbdc40417c6fddbba1a8c8b675e59ce1a25ad65 | https://github.com/shadowfax/zf2-asset-manager/blob/adbdc40417c6fddbba1a8c8b675e59ce1a25ad65/src/AssetManager/Mvc/AssetRouteListener.php#L123-L169 |
195,144 | linpax/microphp-framework | src/base/Application.php | Application.doRun | private function doRun()
{
$dispatcher = (new DispatcherInjector)->build();
//покажем событие Request
if (($response = $dispatcher->signal('kernel.request')) instanceof ResponseInterface) {
return $response; // событие завершило очередь
}
$resolver = $this->getR... | php | private function doRun()
{
$dispatcher = (new DispatcherInjector)->build();
//покажем событие Request
if (($response = $dispatcher->signal('kernel.request')) instanceof ResponseInterface) {
return $response; // событие завершило очередь
}
$resolver = $this->getR... | [
"private",
"function",
"doRun",
"(",
")",
"{",
"$",
"dispatcher",
"=",
"(",
"new",
"DispatcherInjector",
")",
"->",
"build",
"(",
")",
";",
"//покажем событие Request",
"if",
"(",
"(",
"$",
"response",
"=",
"$",
"dispatcher",
"->",
"signal",
"(",
"'kernel.... | Real run application
@return ResponseInterface | [
"Real",
"run",
"application"
] | 11f3370f3f64c516cce9b84ecd8276c6e9ae8df9 | https://github.com/linpax/microphp-framework/blob/11f3370f3f64c516cce9b84ecd8276c6e9ae8df9/src/base/Application.php#L70-L110 |
195,145 | dms-org/common.structure | src/FileSystem/Image.php | Image.getWidth | public function getWidth() : int
{
if (!$this->loadImageInfo()) {
throw InvalidOperationException::format(
'Invalid call to %s: file \'%s\' is not a valid image',
__METHOD__,
$this->fullPath
);
}
return $thi... | php | public function getWidth() : int
{
if (!$this->loadImageInfo()) {
throw InvalidOperationException::format(
'Invalid call to %s: file \'%s\' is not a valid image',
__METHOD__,
$this->fullPath
);
}
return $thi... | [
"public",
"function",
"getWidth",
"(",
")",
":",
"int",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"loadImageInfo",
"(",
")",
")",
"{",
"throw",
"InvalidOperationException",
"::",
"format",
"(",
"'Invalid call to %s: file \\'%s\\' is not a valid image'",
",",
"__METH... | Gets the image width in pixels.
@return int
@throws InvalidOperationException | [
"Gets",
"the",
"image",
"width",
"in",
"pixels",
"."
] | 23f122182f60df5ec847047a81a39c8aab019ff1 | https://github.com/dms-org/common.structure/blob/23f122182f60df5ec847047a81a39c8aab019ff1/src/FileSystem/Image.php#L89-L100 |
195,146 | dms-org/common.structure | src/FileSystem/Image.php | Image.getHeight | public function getHeight() : int
{
if (!$this->loadImageInfo()) {
throw InvalidOperationException::format(
'Invalid call to %s: file \'%s\' is not a valid image',
__METHOD__,
$this->fullPath
);
}
return $th... | php | public function getHeight() : int
{
if (!$this->loadImageInfo()) {
throw InvalidOperationException::format(
'Invalid call to %s: file \'%s\' is not a valid image',
__METHOD__,
$this->fullPath
);
}
return $th... | [
"public",
"function",
"getHeight",
"(",
")",
":",
"int",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"loadImageInfo",
"(",
")",
")",
"{",
"throw",
"InvalidOperationException",
"::",
"format",
"(",
"'Invalid call to %s: file \\'%s\\' is not a valid image'",
",",
"__MET... | Gets the image height in pixels.
@return int
@throws InvalidOperationException | [
"Gets",
"the",
"image",
"height",
"in",
"pixels",
"."
] | 23f122182f60df5ec847047a81a39c8aab019ff1 | https://github.com/dms-org/common.structure/blob/23f122182f60df5ec847047a81a39c8aab019ff1/src/FileSystem/Image.php#L108-L119 |
195,147 | jenskooij/cloudcontrol | src/storage/factories/ImageSetFactory.php | ImageSetFactory.createImageSetFromPostValues | public static function createImageSetFromPostValues($postValues)
{
if (isset($postValues['title'], $postValues['width'], $postValues['height'], $postValues['method'])) {
$imageSetObject = new \stdClass();
$imageSetObject->title = $postValues['title'];
$imageSetObject->sl... | php | public static function createImageSetFromPostValues($postValues)
{
if (isset($postValues['title'], $postValues['width'], $postValues['height'], $postValues['method'])) {
$imageSetObject = new \stdClass();
$imageSetObject->title = $postValues['title'];
$imageSetObject->sl... | [
"public",
"static",
"function",
"createImageSetFromPostValues",
"(",
"$",
"postValues",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"postValues",
"[",
"'title'",
"]",
",",
"$",
"postValues",
"[",
"'width'",
"]",
",",
"$",
"postValues",
"[",
"'height'",
"]",
",... | Ceate image set from post values
@param $postValues
@return \stdClass
@throws \Exception | [
"Ceate",
"image",
"set",
"from",
"post",
"values"
] | 76e5d9ac8f9c50d06d39a995d13cc03742536548 | https://github.com/jenskooij/cloudcontrol/blob/76e5d9ac8f9c50d06d39a995d13cc03742536548/src/storage/factories/ImageSetFactory.php#L23-L38 |
195,148 | AltCtrlSupr/ACSPanel-Settings | Model/SettingManager.php | SettingManager.isUpdateAvailable | public function isUpdateAvailable($user, $version_key, $schema_version)
{
$user_fields_version = $this->getSetting($version_key, 'user_internal', $user);
if (!$user_fields_version) {
$user_fields_version = 0;
}
if ($user_fields_version < $schema_version) {
re... | php | public function isUpdateAvailable($user, $version_key, $schema_version)
{
$user_fields_version = $this->getSetting($version_key, 'user_internal', $user);
if (!$user_fields_version) {
$user_fields_version = 0;
}
if ($user_fields_version < $schema_version) {
re... | [
"public",
"function",
"isUpdateAvailable",
"(",
"$",
"user",
",",
"$",
"version_key",
",",
"$",
"schema_version",
")",
"{",
"$",
"user_fields_version",
"=",
"$",
"this",
"->",
"getSetting",
"(",
"$",
"version_key",
",",
"'user_internal'",
",",
"$",
"user",
"... | Returns true if there is a update of the user fields | [
"Returns",
"true",
"if",
"there",
"is",
"a",
"update",
"of",
"the",
"user",
"fields"
] | b1e363bf98d4c74368b3063abba0c77bb3a61230 | https://github.com/AltCtrlSupr/ACSPanel-Settings/blob/b1e363bf98d4c74368b3063abba0c77bb3a61230/Model/SettingManager.php#L25-L37 |
195,149 | AltCtrlSupr/ACSPanel-Settings | Model/SettingManager.php | SettingManager.loadSettingDefaults | public function loadSettingDefaults(array $fields, $user)
{
$user = $this->container->get('security.context')->getToken()->getUser();
foreach($fields as $field){
if (!$this->getSetting($field['setting_key'], $field['focus'], $user)) {
if(!isset($field['default_value'])) ... | php | public function loadSettingDefaults(array $fields, $user)
{
$user = $this->container->get('security.context')->getToken()->getUser();
foreach($fields as $field){
if (!$this->getSetting($field['setting_key'], $field['focus'], $user)) {
if(!isset($field['default_value'])) ... | [
"public",
"function",
"loadSettingDefaults",
"(",
"array",
"$",
"fields",
",",
"$",
"user",
")",
"{",
"$",
"user",
"=",
"$",
"this",
"->",
"container",
"->",
"get",
"(",
"'security.context'",
")",
"->",
"getToken",
"(",
")",
"->",
"getUser",
"(",
")",
... | Loading of settings needed for the app
Called if it's the first time or user need update of settings | [
"Loading",
"of",
"settings",
"needed",
"for",
"the",
"app",
"Called",
"if",
"it",
"s",
"the",
"first",
"time",
"or",
"user",
"need",
"update",
"of",
"settings"
] | b1e363bf98d4c74368b3063abba0c77bb3a61230 | https://github.com/AltCtrlSupr/ACSPanel-Settings/blob/b1e363bf98d4c74368b3063abba0c77bb3a61230/Model/SettingManager.php#L43-L57 |
195,150 | AltCtrlSupr/ACSPanel-Settings | Model/SettingManager.php | SettingManager.loadObjectSettingsDefaults | public function loadObjectSettingsDefaults($object_id)
{
$em = $this->getEntityManager();
$object = $em->getRepository('ACSACSPanelBundle:Service')->find($object_id);
$object_fields = $object->getType()->getFieldTypes();
return $object_fields;
} | php | public function loadObjectSettingsDefaults($object_id)
{
$em = $this->getEntityManager();
$object = $em->getRepository('ACSACSPanelBundle:Service')->find($object_id);
$object_fields = $object->getType()->getFieldTypes();
return $object_fields;
} | [
"public",
"function",
"loadObjectSettingsDefaults",
"(",
"$",
"object_id",
")",
"{",
"$",
"em",
"=",
"$",
"this",
"->",
"getEntityManager",
"(",
")",
";",
"$",
"object",
"=",
"$",
"em",
"->",
"getRepository",
"(",
"'ACSACSPanelBundle:Service'",
")",
"->",
"f... | Create the settings configured for specified object | [
"Create",
"the",
"settings",
"configured",
"for",
"specified",
"object"
] | b1e363bf98d4c74368b3063abba0c77bb3a61230 | https://github.com/AltCtrlSupr/ACSPanel-Settings/blob/b1e363bf98d4c74368b3063abba0c77bb3a61230/Model/SettingManager.php#L90-L98 |
195,151 | AltCtrlSupr/ACSPanel-Settings | Model/SettingManager.php | SettingManager.getSetting | public function getSetting($setting_key, $focus = null, $user = null)
{
$params = array();
$params['setting_key'] = $setting_key;
if ($focus) {
$params['focus'] = $focus;
}
if ($user) {
$params['user'] = $user;
}
$setting = $this->fi... | php | public function getSetting($setting_key, $focus = null, $user = null)
{
$params = array();
$params['setting_key'] = $setting_key;
if ($focus) {
$params['focus'] = $focus;
}
if ($user) {
$params['user'] = $user;
}
$setting = $this->fi... | [
"public",
"function",
"getSetting",
"(",
"$",
"setting_key",
",",
"$",
"focus",
"=",
"null",
",",
"$",
"user",
"=",
"null",
")",
"{",
"$",
"params",
"=",
"array",
"(",
")",
";",
"$",
"params",
"[",
"'setting_key'",
"]",
"=",
"$",
"setting_key",
";",
... | Get setting by parameters | [
"Get",
"setting",
"by",
"parameters"
] | b1e363bf98d4c74368b3063abba0c77bb3a61230 | https://github.com/AltCtrlSupr/ACSPanel-Settings/blob/b1e363bf98d4c74368b3063abba0c77bb3a61230/Model/SettingManager.php#L103-L123 |
195,152 | AltCtrlSupr/ACSPanel-Settings | Model/SettingManager.php | SettingManager.setSetting | public function setSetting($setting_key, $focus, $value, $context = '', $user = null)
{
$em = $this->getEntityManager();
$params = array();
$params['setting_key'] = $setting_key;
$params['focus'] = $focus;
if ($context) {
$params['context'] = $context;
}... | php | public function setSetting($setting_key, $focus, $value, $context = '', $user = null)
{
$em = $this->getEntityManager();
$params = array();
$params['setting_key'] = $setting_key;
$params['focus'] = $focus;
if ($context) {
$params['context'] = $context;
}... | [
"public",
"function",
"setSetting",
"(",
"$",
"setting_key",
",",
"$",
"focus",
",",
"$",
"value",
",",
"$",
"context",
"=",
"''",
",",
"$",
"user",
"=",
"null",
")",
"{",
"$",
"em",
"=",
"$",
"this",
"->",
"getEntityManager",
"(",
")",
";",
"$",
... | Sets a setting value | [
"Sets",
"a",
"setting",
"value"
] | b1e363bf98d4c74368b3063abba0c77bb3a61230 | https://github.com/AltCtrlSupr/ACSPanel-Settings/blob/b1e363bf98d4c74368b3063abba0c77bb3a61230/Model/SettingManager.php#L128-L160 |
195,153 | AltCtrlSupr/ACSPanel-Settings | Model/SettingManager.php | SettingManager.getContexts | public function getContexts($user)
{
$em = $this->getEntityManager();
$contexts_rep = $em->getRepository('ACSACSPanelBundle:PanelSetting');
$query = $contexts_rep->createQueryBuilder('ps')
->select('ps.context')
->where('ps.user = ?1')
->andWhere('ps.cont... | php | public function getContexts($user)
{
$em = $this->getEntityManager();
$contexts_rep = $em->getRepository('ACSACSPanelBundle:PanelSetting');
$query = $contexts_rep->createQueryBuilder('ps')
->select('ps.context')
->where('ps.user = ?1')
->andWhere('ps.cont... | [
"public",
"function",
"getContexts",
"(",
"$",
"user",
")",
"{",
"$",
"em",
"=",
"$",
"this",
"->",
"getEntityManager",
"(",
")",
";",
"$",
"contexts_rep",
"=",
"$",
"em",
"->",
"getRepository",
"(",
"'ACSACSPanelBundle:PanelSetting'",
")",
";",
"$",
"quer... | Returns the context used to organize the settings view | [
"Returns",
"the",
"context",
"used",
"to",
"organize",
"the",
"settings",
"view"
] | b1e363bf98d4c74368b3063abba0c77bb3a61230 | https://github.com/AltCtrlSupr/ACSPanel-Settings/blob/b1e363bf98d4c74368b3063abba0c77bb3a61230/Model/SettingManager.php#L206-L229 |
195,154 | AltCtrlSupr/ACSPanel-Settings | Model/SettingManager.php | SettingManager.loadUserFields | function loadUserFields()
{
$user_fields = array();
$this->container->get('event_dispatcher')->dispatch(SettingsEvents::BEFORE_LOAD_USERFIELDS, new FilterUserFieldsEvent($user_fields, $this->container));
array_merge($user_fields, $user_fields = $this->container->getParameter("acs_settings.... | php | function loadUserFields()
{
$user_fields = array();
$this->container->get('event_dispatcher')->dispatch(SettingsEvents::BEFORE_LOAD_USERFIELDS, new FilterUserFieldsEvent($user_fields, $this->container));
array_merge($user_fields, $user_fields = $this->container->getParameter("acs_settings.... | [
"function",
"loadUserFields",
"(",
")",
"{",
"$",
"user_fields",
"=",
"array",
"(",
")",
";",
"$",
"this",
"->",
"container",
"->",
"get",
"(",
"'event_dispatcher'",
")",
"->",
"dispatch",
"(",
"SettingsEvents",
"::",
"BEFORE_LOAD_USERFIELDS",
",",
"new",
"F... | Load the settings array to pass to form | [
"Load",
"the",
"settings",
"array",
"to",
"pass",
"to",
"form"
] | b1e363bf98d4c74368b3063abba0c77bb3a61230 | https://github.com/AltCtrlSupr/ACSPanel-Settings/blob/b1e363bf98d4c74368b3063abba0c77bb3a61230/Model/SettingManager.php#L234-L256 |
195,155 | t-kanstantsin/fileupload | src/config/Alias.php | Alias.getFilePath | public function getFilePath(IFile $file): ?string
{
if ($this->filePathClosure !== null) {
return \call_user_func($this->filePathClosure, $file);
}
if ($file instanceof ExternalFile) {
return $file->getActualPath();
}
return $file->getId() !== null
... | php | public function getFilePath(IFile $file): ?string
{
if ($this->filePathClosure !== null) {
return \call_user_func($this->filePathClosure, $file);
}
if ($file instanceof ExternalFile) {
return $file->getActualPath();
}
return $file->getId() !== null
... | [
"public",
"function",
"getFilePath",
"(",
"IFile",
"$",
"file",
")",
":",
"?",
"string",
"{",
"if",
"(",
"$",
"this",
"->",
"filePathClosure",
"!==",
"null",
")",
"{",
"return",
"\\",
"call_user_func",
"(",
"$",
"this",
"->",
"filePathClosure",
",",
"$",... | Returns file path in contentFS
@param IFile $file
@return string|null | [
"Returns",
"file",
"path",
"in",
"contentFS"
] | d6317a9b9b36d992f09affe3900ef7d7ddfd855f | https://github.com/t-kanstantsin/fileupload/blob/d6317a9b9b36d992f09affe3900ef7d7ddfd855f/src/config/Alias.php#L115-L128 |
195,156 | t-kanstantsin/fileupload | src/config/Alias.php | Alias.getAssetPath | public function getAssetPath(IFile $file, string $formatName): string
{
return implode('/', array_filter([
Type::$folderPrefix[$file->getType()] . '_' . $formatName,
$file->getModelAlias(),
mb_substr($file->getHash(), 0, $this->cacheHashLength),
$this->getAsse... | php | public function getAssetPath(IFile $file, string $formatName): string
{
return implode('/', array_filter([
Type::$folderPrefix[$file->getType()] . '_' . $formatName,
$file->getModelAlias(),
mb_substr($file->getHash(), 0, $this->cacheHashLength),
$this->getAsse... | [
"public",
"function",
"getAssetPath",
"(",
"IFile",
"$",
"file",
",",
"string",
"$",
"formatName",
")",
":",
"string",
"{",
"return",
"implode",
"(",
"'/'",
",",
"array_filter",
"(",
"[",
"Type",
"::",
"$",
"folderPrefix",
"[",
"$",
"file",
"->",
"getTyp... | Returns path in asset filesystem
@param IFile $file
@param string $formatName
@return string | [
"Returns",
"path",
"in",
"asset",
"filesystem"
] | d6317a9b9b36d992f09affe3900ef7d7ddfd855f | https://github.com/t-kanstantsin/fileupload/blob/d6317a9b9b36d992f09affe3900ef7d7ddfd855f/src/config/Alias.php#L136-L144 |
195,157 | t-kanstantsin/fileupload | src/config/Alias.php | Alias.getAssetName | public function getAssetName(IFile $file): string
{
if ($this->assetNameClosure !== null) {
return \call_user_func($this->assetNameClosure, $file);
}
return $file->getId() . '_' . $file->getFullName();
} | php | public function getAssetName(IFile $file): string
{
if ($this->assetNameClosure !== null) {
return \call_user_func($this->assetNameClosure, $file);
}
return $file->getId() . '_' . $file->getFullName();
} | [
"public",
"function",
"getAssetName",
"(",
"IFile",
"$",
"file",
")",
":",
"string",
"{",
"if",
"(",
"$",
"this",
"->",
"assetNameClosure",
"!==",
"null",
")",
"{",
"return",
"\\",
"call_user_func",
"(",
"$",
"this",
"->",
"assetNameClosure",
",",
"$",
"... | File name in asset directory
@param IFile $file
@return string | [
"File",
"name",
"in",
"asset",
"directory"
] | d6317a9b9b36d992f09affe3900ef7d7ddfd855f | https://github.com/t-kanstantsin/fileupload/blob/d6317a9b9b36d992f09affe3900ef7d7ddfd855f/src/config/Alias.php#L151-L158 |
195,158 | t-kanstantsin/fileupload | src/config/Alias.php | Alias.getFileDirectory | public function getFileDirectory(IFile $file): string
{
return implode(DIRECTORY_SEPARATOR, array_filter([
$this->directory,
// TODO: check if used correct hash.
// Which value should be passed into getDirectoryHash? Directory name or file id?
$this->getDirect... | php | public function getFileDirectory(IFile $file): string
{
return implode(DIRECTORY_SEPARATOR, array_filter([
$this->directory,
// TODO: check if used correct hash.
// Which value should be passed into getDirectoryHash? Directory name or file id?
$this->getDirect... | [
"public",
"function",
"getFileDirectory",
"(",
"IFile",
"$",
"file",
")",
":",
"string",
"{",
"return",
"implode",
"(",
"DIRECTORY_SEPARATOR",
",",
"array_filter",
"(",
"[",
"$",
"this",
"->",
"directory",
",",
"// TODO: check if used correct hash.",
"// Which value... | Returns target directory for uploaded file
@param IFile $file
@return string | [
"Returns",
"target",
"directory",
"for",
"uploaded",
"file"
] | d6317a9b9b36d992f09affe3900ef7d7ddfd855f | https://github.com/t-kanstantsin/fileupload/blob/d6317a9b9b36d992f09affe3900ef7d7ddfd855f/src/config/Alias.php#L174-L182 |
195,159 | anime-db/catalog-bundle | src/Controller/InstallController.php | InstallController.whatYouWantAction | public function whatYouWantAction(Request $request)
{
// app already installed
if ($this->container->getParameter('anime_db.catalog.installed')) {
return $this->redirect($this->generateUrl('home'));
}
$response = $this->getCacheTimeKeeper()->getResponse();
// res... | php | public function whatYouWantAction(Request $request)
{
// app already installed
if ($this->container->getParameter('anime_db.catalog.installed')) {
return $this->redirect($this->generateUrl('home'));
}
$response = $this->getCacheTimeKeeper()->getResponse();
// res... | [
"public",
"function",
"whatYouWantAction",
"(",
"Request",
"$",
"request",
")",
"{",
"// app already installed",
"if",
"(",
"$",
"this",
"->",
"container",
"->",
"getParameter",
"(",
"'anime_db.catalog.installed'",
")",
")",
"{",
"return",
"$",
"this",
"->",
"re... | What you want.
@param Request $request
@return Response | [
"What",
"you",
"want",
"."
] | 631b6f92a654e91bee84f46218c52cf42bdb8606 | https://github.com/anime-db/catalog-bundle/blob/631b6f92a654e91bee84f46218c52cf42bdb8606/src/Controller/InstallController.php#L131-L154 |
195,160 | AeonDigital/PHP-Numbers | src/RealNumber.php | RealNumber.pow | public function pow($v, int $dPlaces = 0) : RealNumber
{
$d = new RealNumber($v);
return new RealNumber(bcpow($this->value(), $d->value(), $this->useDecimalPlaces($dPlaces)));
} | php | public function pow($v, int $dPlaces = 0) : RealNumber
{
$d = new RealNumber($v);
return new RealNumber(bcpow($this->value(), $d->value(), $this->useDecimalPlaces($dPlaces)));
} | [
"public",
"function",
"pow",
"(",
"$",
"v",
",",
"int",
"$",
"dPlaces",
"=",
"0",
")",
":",
"RealNumber",
"{",
"$",
"d",
"=",
"new",
"RealNumber",
"(",
"$",
"v",
")",
";",
"return",
"new",
"RealNumber",
"(",
"bcpow",
"(",
"$",
"this",
"->",
"valu... | Eleva o valor atual pelo expoente indicado.
@param mixed $v
É esperado valores "RealNumber", "int", "float"
ou uma string numérica.
@param int $dPlaces
Total de casas decimais a serem levadas em conta.
@return RealNumber | [
"Eleva",
"o",
"valor",
"atual",
"pelo",
"expoente",
"indicado",
"."
] | 0fdb05807e72191278fc794484bf491c1307f644 | https://github.com/AeonDigital/PHP-Numbers/blob/0fdb05807e72191278fc794484bf491c1307f644/src/RealNumber.php#L639-L643 |
195,161 | AeonDigital/PHP-Numbers | src/RealNumber.php | RealNumber.sqrt | public function sqrt(int $dPlaces = 0) : RealNumber
{
return new RealNumber(bcsqrt($this->value(), $this->useDecimalPlaces($dPlaces)));
} | php | public function sqrt(int $dPlaces = 0) : RealNumber
{
return new RealNumber(bcsqrt($this->value(), $this->useDecimalPlaces($dPlaces)));
} | [
"public",
"function",
"sqrt",
"(",
"int",
"$",
"dPlaces",
"=",
"0",
")",
":",
"RealNumber",
"{",
"return",
"new",
"RealNumber",
"(",
"bcsqrt",
"(",
"$",
"this",
"->",
"value",
"(",
")",
",",
"$",
"this",
"->",
"useDecimalPlaces",
"(",
"$",
"dPlaces",
... | Retorna a raiz do valor atual pelo operando indicado.
@param int $dPlaces
Total de casas decimais a serem levadas em conta.
@return RealNumber | [
"Retorna",
"a",
"raiz",
"do",
"valor",
"atual",
"pelo",
"operando",
"indicado",
"."
] | 0fdb05807e72191278fc794484bf491c1307f644 | https://github.com/AeonDigital/PHP-Numbers/blob/0fdb05807e72191278fc794484bf491c1307f644/src/RealNumber.php#L657-L660 |
195,162 | jabernardo/console.php | src/Console/Application.php | Application.add | public function add($name, callable $command, $default = false) {
// Make sure to unify command name
$commandName = strtolower($name);
if (isset($this->_command[$commandName])) {
throw new \Console\Exception\Runtime('Duplicated command.');
}
if (!is_null($this->_def... | php | public function add($name, callable $command, $default = false) {
// Make sure to unify command name
$commandName = strtolower($name);
if (isset($this->_command[$commandName])) {
throw new \Console\Exception\Runtime('Duplicated command.');
}
if (!is_null($this->_def... | [
"public",
"function",
"add",
"(",
"$",
"name",
",",
"callable",
"$",
"command",
",",
"$",
"default",
"=",
"false",
")",
"{",
"// Make sure to unify command name",
"$",
"commandName",
"=",
"strtolower",
"(",
"$",
"name",
")",
";",
"if",
"(",
"isset",
"(",
... | Add console command
@param string $name Command Name
@param callable $command Callable command
@param boolean $default Use as default command (false)
@return void
@throws \Console\Exception\Runtime Duplicated command registered | [
"Add",
"console",
"command"
] | a526458f4d1a525d0ccff62cd9cfcfbc5526bc9c | https://github.com/jabernardo/console.php/blob/a526458f4d1a525d0ccff62cd9cfcfbc5526bc9c/src/Console/Application.php#L73-L91 |
195,163 | jabernardo/console.php | src/Console/Application.php | Application.get | public function get($command) {
return isset($this->_commands[$command]) ?
$this->_commands[$command] :
null;
} | php | public function get($command) {
return isset($this->_commands[$command]) ?
$this->_commands[$command] :
null;
} | [
"public",
"function",
"get",
"(",
"$",
"command",
")",
"{",
"return",
"isset",
"(",
"$",
"this",
"->",
"_commands",
"[",
"$",
"command",
"]",
")",
"?",
"$",
"this",
"->",
"_commands",
"[",
"$",
"command",
"]",
":",
"null",
";",
"}"
] | Get command callback
@access public
@param string $command
@return mixed | [
"Get",
"command",
"callback"
] | a526458f4d1a525d0ccff62cd9cfcfbc5526bc9c | https://github.com/jabernardo/console.php/blob/a526458f4d1a525d0ccff62cd9cfcfbc5526bc9c/src/Console/Application.php#L101-L105 |
195,164 | Kris-Kuiper/sFire-Framework | src/System/Directory.php | Directory.move | public function move($directory) {
if(false === is_string($directory)) {
return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($directory)), E_USER_ERROR);
}
if(false === is_dir($directory)) {
return trigger_error(sprintf('Directory "%s... | php | public function move($directory) {
if(false === is_string($directory)) {
return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($directory)), E_USER_ERROR);
}
if(false === is_dir($directory)) {
return trigger_error(sprintf('Directory "%s... | [
"public",
"function",
"move",
"(",
"$",
"directory",
")",
"{",
"if",
"(",
"false",
"===",
"is_string",
"(",
"$",
"directory",
")",
")",
"{",
"return",
"trigger_error",
"(",
"sprintf",
"(",
"'Argument 1 passed to %s() must be of the type string, \"%s\" given'",
",",
... | Move the current directory to a new directory including its content
@param string $directory
@return sFire\System\Directory | [
"Move",
"the",
"current",
"directory",
"to",
"a",
"new",
"directory",
"including",
"its",
"content"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/System/Directory.php#L83-L110 |
195,165 | Kris-Kuiper/sFire-Framework | src/System/Directory.php | Directory.delete | public function delete() {
if(false !== $this -> directory -> getExists()) {
if(rmdir($this -> directory -> getBasepath())) {
$this -> refresh();
}
}
return $this;
} | php | public function delete() {
if(false !== $this -> directory -> getExists()) {
if(rmdir($this -> directory -> getBasepath())) {
$this -> refresh();
}
}
return $this;
} | [
"public",
"function",
"delete",
"(",
")",
"{",
"if",
"(",
"false",
"!==",
"$",
"this",
"->",
"directory",
"->",
"getExists",
"(",
")",
")",
"{",
"if",
"(",
"rmdir",
"(",
"$",
"this",
"->",
"directory",
"->",
"getBasepath",
"(",
")",
")",
")",
"{",
... | Delete the current directory
@return sFire\System\Directory | [
"Delete",
"the",
"current",
"directory"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/System/Directory.php#L117-L127 |
195,166 | Kris-Kuiper/sFire-Framework | src/System/Directory.php | Directory.copy | public function copy($directory) {
if(false === is_dir($directory)) {
return trigger_error(sprintf('Directory "%s" passed to %s is not an existing directory', $directory, __METHOD__), E_USER_ERROR);
}
if(false === is_writable($directory)) {
return trigger_error(sprintf('Directory "%s" passed to %s ... | php | public function copy($directory) {
if(false === is_dir($directory)) {
return trigger_error(sprintf('Directory "%s" passed to %s is not an existing directory', $directory, __METHOD__), E_USER_ERROR);
}
if(false === is_writable($directory)) {
return trigger_error(sprintf('Directory "%s" passed to %s ... | [
"public",
"function",
"copy",
"(",
"$",
"directory",
")",
"{",
"if",
"(",
"false",
"===",
"is_dir",
"(",
"$",
"directory",
")",
")",
"{",
"return",
"trigger_error",
"(",
"sprintf",
"(",
"'Directory \"%s\" passed to %s is not an existing directory'",
",",
"$",
"d... | Copy the current directory contents to a new directory including its content
@param string $directory
@return sFire\System\Directory | [
"Copy",
"the",
"current",
"directory",
"contents",
"to",
"a",
"new",
"directory",
"including",
"its",
"content"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/System/Directory.php#L135-L150 |
195,167 | Kris-Kuiper/sFire-Framework | src/System/Directory.php | Directory.rename | public function rename($name) {
if(false === is_string($name)) {
return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($name)), E_USER_ERROR);
}
if(false !== $this -> directory -> getExists()) {
if(rename($this -> directory -> getP... | php | public function rename($name) {
if(false === is_string($name)) {
return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($name)), E_USER_ERROR);
}
if(false !== $this -> directory -> getExists()) {
if(rename($this -> directory -> getP... | [
"public",
"function",
"rename",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"false",
"===",
"is_string",
"(",
"$",
"name",
")",
")",
"{",
"return",
"trigger_error",
"(",
"sprintf",
"(",
"'Argument 1 passed to %s() must be of the type string, \"%s\" given'",
",",
"__MET... | Rename the current directory
@param string $name
@return sFire\System\Directory | [
"Rename",
"the",
"current",
"directory"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/System/Directory.php#L158-L174 |
195,168 | Kris-Kuiper/sFire-Framework | src/System/Directory.php | Directory.getContent | public function getContent($type = 'default') {
if(false === is_string($type)) {
return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($type)), E_USER_ERROR);
}
if(false === is_dir($this -> directory -> getPath())) {
return trigger_erro... | php | public function getContent($type = 'default') {
if(false === is_string($type)) {
return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($type)), E_USER_ERROR);
}
if(false === is_dir($this -> directory -> getPath())) {
return trigger_erro... | [
"public",
"function",
"getContent",
"(",
"$",
"type",
"=",
"'default'",
")",
"{",
"if",
"(",
"false",
"===",
"is_string",
"(",
"$",
"type",
")",
")",
"{",
"return",
"trigger_error",
"(",
"sprintf",
"(",
"'Argument 1 passed to %s() must be of the type string, \"%s\... | Returns files and folders about the current directory
@param string $type
@return array|object|string | [
"Returns",
"files",
"and",
"folders",
"about",
"the",
"current",
"directory"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/System/Directory.php#L214-L254 |
195,169 | Kris-Kuiper/sFire-Framework | src/System/Directory.php | Directory.chmod | public function chmod($type) {
if(false !== $this -> directory -> getExists()) {
return chmod($this -> directory -> getPath(), $type);
}
return false;
} | php | public function chmod($type) {
if(false !== $this -> directory -> getExists()) {
return chmod($this -> directory -> getPath(), $type);
}
return false;
} | [
"public",
"function",
"chmod",
"(",
"$",
"type",
")",
"{",
"if",
"(",
"false",
"!==",
"$",
"this",
"->",
"directory",
"->",
"getExists",
"(",
")",
")",
"{",
"return",
"chmod",
"(",
"$",
"this",
"->",
"directory",
"->",
"getPath",
"(",
")",
",",
"$"... | Returns true if current directory has successfully changed file mode, otherwise false
@param int|string $type
@return boolean | [
"Returns",
"true",
"if",
"current",
"directory",
"has",
"successfully",
"changed",
"file",
"mode",
"otherwise",
"false"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/System/Directory.php#L302-L309 |
195,170 | Kris-Kuiper/sFire-Framework | src/System/Directory.php | Directory.chown | public function chown($username) {
if(false === is_string($username)) {
return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($username)), E_USER_ERROR);
}
if(false !== $this -> directory -> getExists()) {
return chown($this -> director... | php | public function chown($username) {
if(false === is_string($username)) {
return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($username)), E_USER_ERROR);
}
if(false !== $this -> directory -> getExists()) {
return chown($this -> director... | [
"public",
"function",
"chown",
"(",
"$",
"username",
")",
"{",
"if",
"(",
"false",
"===",
"is_string",
"(",
"$",
"username",
")",
")",
"{",
"return",
"trigger_error",
"(",
"sprintf",
"(",
"'Argument 1 passed to %s() must be of the type string, \"%s\" given'",
",",
... | Returns true if current directory has successfully changed owner, otherwise false
@param string $username
@return boolean | [
"Returns",
"true",
"if",
"current",
"directory",
"has",
"successfully",
"changed",
"owner",
"otherwise",
"false"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/System/Directory.php#L317-L328 |
195,171 | Kris-Kuiper/sFire-Framework | src/System/Directory.php | Directory.isReadable | public function isReadable() {
if(false !== $this -> directory -> getExists()) {
$this -> refresh();
return $this -> directory -> getReadable();
}
return false;
} | php | public function isReadable() {
if(false !== $this -> directory -> getExists()) {
$this -> refresh();
return $this -> directory -> getReadable();
}
return false;
} | [
"public",
"function",
"isReadable",
"(",
")",
"{",
"if",
"(",
"false",
"!==",
"$",
"this",
"->",
"directory",
"->",
"getExists",
"(",
")",
")",
"{",
"$",
"this",
"->",
"refresh",
"(",
")",
";",
"return",
"$",
"this",
"->",
"directory",
"->",
"getRead... | Returns boolean if the current directory is readable
@return boolean | [
"Returns",
"boolean",
"if",
"the",
"current",
"directory",
"is",
"readable"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/System/Directory.php#L335-L345 |
195,172 | Kris-Kuiper/sFire-Framework | src/System/Directory.php | Directory.isWritable | public function isWritable() {
if(false !== $this -> directory -> getExists()) {
$this -> refresh();
return $this -> directory -> getWritable();
}
return false;
} | php | public function isWritable() {
if(false !== $this -> directory -> getExists()) {
$this -> refresh();
return $this -> directory -> getWritable();
}
return false;
} | [
"public",
"function",
"isWritable",
"(",
")",
"{",
"if",
"(",
"false",
"!==",
"$",
"this",
"->",
"directory",
"->",
"getExists",
"(",
")",
")",
"{",
"$",
"this",
"->",
"refresh",
"(",
")",
";",
"return",
"$",
"this",
"->",
"directory",
"->",
"getWrit... | Returns boolean if the current directory is writable
@return boolean | [
"Returns",
"boolean",
"if",
"the",
"current",
"directory",
"is",
"writable"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/System/Directory.php#L352-L362 |
195,173 | Kris-Kuiper/sFire-Framework | src/System/Directory.php | Directory.refresh | public function refresh() {
$directory = new Directory($this -> directory -> getPath());
$this -> directory = $directory -> entity();
return $this;
} | php | public function refresh() {
$directory = new Directory($this -> directory -> getPath());
$this -> directory = $directory -> entity();
return $this;
} | [
"public",
"function",
"refresh",
"(",
")",
"{",
"$",
"directory",
"=",
"new",
"Directory",
"(",
"$",
"this",
"->",
"directory",
"->",
"getPath",
"(",
")",
")",
";",
"$",
"this",
"->",
"directory",
"=",
"$",
"directory",
"->",
"entity",
"(",
")",
";",... | Drop old and create new directory entity to update information about current directory
@return sFire\System\Directory | [
"Drop",
"old",
"and",
"create",
"new",
"directory",
"entity",
"to",
"update",
"information",
"about",
"current",
"directory"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/System/Directory.php#L369-L375 |
195,174 | Kris-Kuiper/sFire-Framework | src/System/Directory.php | Directory.rcopy | private function rcopy($source, $destination) {
if(false === is_string($source)) {
return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($source)), E_USER_ERROR);
}
if(false === is_string($destination)) {
return trigger_error(s... | php | private function rcopy($source, $destination) {
if(false === is_string($source)) {
return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($source)), E_USER_ERROR);
}
if(false === is_string($destination)) {
return trigger_error(s... | [
"private",
"function",
"rcopy",
"(",
"$",
"source",
",",
"$",
"destination",
")",
"{",
"if",
"(",
"false",
"===",
"is_string",
"(",
"$",
"source",
")",
")",
"{",
"return",
"trigger_error",
"(",
"sprintf",
"(",
"'Argument 1 passed to %s() must be of the type stri... | Copy all contens of directory to an existing directory
@param string $source
@param string $destination | [
"Copy",
"all",
"contens",
"of",
"directory",
"to",
"an",
"existing",
"directory"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/System/Directory.php#L383-L415 |
195,175 | Kris-Kuiper/sFire-Framework | src/Entity/Entity.php | Entity.toArray | public function toArray($set = [], $convert = true) {
$methods = get_class_methods($this);
$array = [];
if(true === is_string($set)) {
$set = [$set];
}
$set = array_flip($set);
$amount = count($set);
foreach($methods as $method) {
$chunks = explode('get', $method);
if(... | php | public function toArray($set = [], $convert = true) {
$methods = get_class_methods($this);
$array = [];
if(true === is_string($set)) {
$set = [$set];
}
$set = array_flip($set);
$amount = count($set);
foreach($methods as $method) {
$chunks = explode('get', $method);
if(... | [
"public",
"function",
"toArray",
"(",
"$",
"set",
"=",
"[",
"]",
",",
"$",
"convert",
"=",
"true",
")",
"{",
"$",
"methods",
"=",
"get_class_methods",
"(",
"$",
"this",
")",
";",
"$",
"array",
"=",
"[",
"]",
";",
"if",
"(",
"true",
"===",
"is_str... | Converts all getters to an Array
@param array $set
@param boolean $convert
@return array | [
"Converts",
"all",
"getters",
"to",
"an",
"Array"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/Entity/Entity.php#L23-L61 |
195,176 | Linkvalue-Interne/MajoraFrameworkExtraBundle | src/Majora/Framework/Date/Clock.php | Clock.now | public function now($format = null)
{
$date = $this->currentDate
? clone $this->currentDate
: ($this->currentDate = new \DateTime())
;
return empty($format) ?
$date :
$date->format($format)
;
} | php | public function now($format = null)
{
$date = $this->currentDate
? clone $this->currentDate
: ($this->currentDate = new \DateTime())
;
return empty($format) ?
$date :
$date->format($format)
;
} | [
"public",
"function",
"now",
"(",
"$",
"format",
"=",
"null",
")",
"{",
"$",
"date",
"=",
"$",
"this",
"->",
"currentDate",
"?",
"clone",
"$",
"this",
"->",
"currentDate",
":",
"(",
"$",
"this",
"->",
"currentDate",
"=",
"new",
"\\",
"DateTime",
"(",... | return current date
@param string $format optionnal date format
@return \DateTime | [
"return",
"current",
"date"
] | 6f368380cfc39d27fafb0844e9a53b4d86d7c034 | https://github.com/Linkvalue-Interne/MajoraFrameworkExtraBundle/blob/6f368380cfc39d27fafb0844e9a53b4d86d7c034/src/Majora/Framework/Date/Clock.php#L44-L55 |
195,177 | gplcart/cli | controllers/commands/Currency.php | Currency.cmdUpdateCurrency | public function cmdUpdateCurrency()
{
$params = $this->getParam();
if (empty($params[0]) || count($params) < 2) {
$this->errorAndExit($this->text('Invalid command'));
}
$this->setSubmitted(null, $params);
$this->setSubmitted('update', $params[0]);
$this-... | php | public function cmdUpdateCurrency()
{
$params = $this->getParam();
if (empty($params[0]) || count($params) < 2) {
$this->errorAndExit($this->text('Invalid command'));
}
$this->setSubmitted(null, $params);
$this->setSubmitted('update', $params[0]);
$this-... | [
"public",
"function",
"cmdUpdateCurrency",
"(",
")",
"{",
"$",
"params",
"=",
"$",
"this",
"->",
"getParam",
"(",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"params",
"[",
"0",
"]",
")",
"||",
"count",
"(",
"$",
"params",
")",
"<",
"2",
")",
"{",
... | Callback for "currency-update" | [
"Callback",
"for",
"currency",
"-",
"update"
] | e57dba53e291a225b4bff0c0d9b23d685dd1c125 | https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/Currency.php#L40-L53 |
195,178 | gplcart/cli | controllers/commands/Currency.php | Currency.cmdGetCurrency | public function cmdGetCurrency()
{
$list = $this->getListCurrency();
$this->outputFormat($list);
$this->outputFormatTableCurrency($list);
$this->output();
} | php | public function cmdGetCurrency()
{
$list = $this->getListCurrency();
$this->outputFormat($list);
$this->outputFormatTableCurrency($list);
$this->output();
} | [
"public",
"function",
"cmdGetCurrency",
"(",
")",
"{",
"$",
"list",
"=",
"$",
"this",
"->",
"getListCurrency",
"(",
")",
";",
"$",
"this",
"->",
"outputFormat",
"(",
"$",
"list",
")",
";",
"$",
"this",
"->",
"outputFormatTableCurrency",
"(",
"$",
"list",... | Callback for "currency-get" command | [
"Callback",
"for",
"currency",
"-",
"get",
"command"
] | e57dba53e291a225b4bff0c0d9b23d685dd1c125 | https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/Currency.php#L72-L78 |
195,179 | gplcart/cli | controllers/commands/Currency.php | Currency.cmdDeleteCurrency | public function cmdDeleteCurrency()
{
$id = $this->getParam(0);
$all = $this->getParam('all');
if (empty($id) && empty($all)) {
$this->errorAndExit($this->text('Invalid command'));
}
$result = false;
if (!empty($id)) {
$result = $this->curre... | php | public function cmdDeleteCurrency()
{
$id = $this->getParam(0);
$all = $this->getParam('all');
if (empty($id) && empty($all)) {
$this->errorAndExit($this->text('Invalid command'));
}
$result = false;
if (!empty($id)) {
$result = $this->curre... | [
"public",
"function",
"cmdDeleteCurrency",
"(",
")",
"{",
"$",
"id",
"=",
"$",
"this",
"->",
"getParam",
"(",
"0",
")",
";",
"$",
"all",
"=",
"$",
"this",
"->",
"getParam",
"(",
"'all'",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"id",
")",
"&&",
... | Callback for "currency-delete" command | [
"Callback",
"for",
"currency",
"-",
"delete",
"command"
] | e57dba53e291a225b4bff0c0d9b23d685dd1c125 | https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/Currency.php#L83-L110 |
195,180 | gplcart/cli | controllers/commands/Currency.php | Currency.outputFormatTableCurrency | protected function outputFormatTableCurrency(array $items)
{
$header = array(
$this->text('Code'),
$this->text('Name'),
$this->text('Symbol'),
$this->text('Conversion rate'),
$this->text('In database'),
$this->text('Enabled')
);... | php | protected function outputFormatTableCurrency(array $items)
{
$header = array(
$this->text('Code'),
$this->text('Name'),
$this->text('Symbol'),
$this->text('Conversion rate'),
$this->text('In database'),
$this->text('Enabled')
);... | [
"protected",
"function",
"outputFormatTableCurrency",
"(",
"array",
"$",
"items",
")",
"{",
"$",
"header",
"=",
"array",
"(",
"$",
"this",
"->",
"text",
"(",
"'Code'",
")",
",",
"$",
"this",
"->",
"text",
"(",
"'Name'",
")",
",",
"$",
"this",
"->",
"... | Output formatted table
@param array $items | [
"Output",
"formatted",
"table"
] | e57dba53e291a225b4bff0c0d9b23d685dd1c125 | https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/Currency.php#L139-L164 |
195,181 | gplcart/cli | controllers/commands/Currency.php | Currency.submitAddCurrency | protected function submitAddCurrency()
{
$this->setSubmitted(null, $this->getParam());
$this->validateComponent('currency');
$this->addCurrency();
} | php | protected function submitAddCurrency()
{
$this->setSubmitted(null, $this->getParam());
$this->validateComponent('currency');
$this->addCurrency();
} | [
"protected",
"function",
"submitAddCurrency",
"(",
")",
"{",
"$",
"this",
"->",
"setSubmitted",
"(",
"null",
",",
"$",
"this",
"->",
"getParam",
"(",
")",
")",
";",
"$",
"this",
"->",
"validateComponent",
"(",
"'currency'",
")",
";",
"$",
"this",
"->",
... | Add a currency at once | [
"Add",
"a",
"currency",
"at",
"once"
] | e57dba53e291a225b4bff0c0d9b23d685dd1c125 | https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/Currency.php#L190-L195 |
195,182 | gplcart/cli | controllers/commands/Currency.php | Currency.wizardAddCurrency | protected function wizardAddCurrency()
{
// Required
$this->validatePrompt('code', $this->text('Code'), 'currency');
$this->validatePrompt('name', $this->text('Name'), 'currency');
$this->validatePrompt('symbol', $this->text('Symbol'), 'currency');
$this->validatePrompt('majo... | php | protected function wizardAddCurrency()
{
// Required
$this->validatePrompt('code', $this->text('Code'), 'currency');
$this->validatePrompt('name', $this->text('Name'), 'currency');
$this->validatePrompt('symbol', $this->text('Symbol'), 'currency');
$this->validatePrompt('majo... | [
"protected",
"function",
"wizardAddCurrency",
"(",
")",
"{",
"// Required",
"$",
"this",
"->",
"validatePrompt",
"(",
"'code'",
",",
"$",
"this",
"->",
"text",
"(",
"'Code'",
")",
",",
"'currency'",
")",
";",
"$",
"this",
"->",
"validatePrompt",
"(",
"'nam... | Adds a currency step by step | [
"Adds",
"a",
"currency",
"step",
"by",
"step"
] | e57dba53e291a225b4bff0c0d9b23d685dd1c125 | https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/Currency.php#L200-L222 |
195,183 | dittertp/Puzzle | src/Puzzle/Client.php | Client.init | protected function init()
{
$handle = curl_init();
$this->handle = $handle;
$this->setSerializer(new DefaultSerializer());
$this->scheme = self::SCHEME_PLAIN;
$this->httpOptions = array();
$this->httpOptions[CURLOPT_RETURNTRANSFER] = true;
$this->httpOptions... | php | protected function init()
{
$handle = curl_init();
$this->handle = $handle;
$this->setSerializer(new DefaultSerializer());
$this->scheme = self::SCHEME_PLAIN;
$this->httpOptions = array();
$this->httpOptions[CURLOPT_RETURNTRANSFER] = true;
$this->httpOptions... | [
"protected",
"function",
"init",
"(",
")",
"{",
"$",
"handle",
"=",
"curl_init",
"(",
")",
";",
"$",
"this",
"->",
"handle",
"=",
"$",
"handle",
";",
"$",
"this",
"->",
"setSerializer",
"(",
"new",
"DefaultSerializer",
"(",
")",
")",
";",
"$",
"this"... | initialize default values
@return void
@throws Exceptions\ServerErrorException | [
"initialize",
"default",
"values"
] | cb3dfd64b0df8610c054dbb43b242fbf2cf668a0 | https://github.com/dittertp/Puzzle/blob/cb3dfd64b0df8610c054dbb43b242fbf2cf668a0/src/Puzzle/Client.php#L125-L136 |
195,184 | dittertp/Puzzle | src/Puzzle/Client.php | Client.setHost | protected function setHost($host, $port = null)
{
$this->host = $host;
if ($port !== null) {
if (is_numeric($port)) {
$this->port = (int) $port;
} else {
throw new ConfigurationException("Port '{$port}' is not numeric");
}
}... | php | protected function setHost($host, $port = null)
{
$this->host = $host;
if ($port !== null) {
if (is_numeric($port)) {
$this->port = (int) $port;
} else {
throw new ConfigurationException("Port '{$port}' is not numeric");
}
}... | [
"protected",
"function",
"setHost",
"(",
"$",
"host",
",",
"$",
"port",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"host",
"=",
"$",
"host",
";",
"if",
"(",
"$",
"port",
"!==",
"null",
")",
"{",
"if",
"(",
"is_numeric",
"(",
"$",
"port",
")",
")... | Sets hostname and optional port
@param string $host the hostname
@param mixed $port the port
@return void
@throws \Puzzle\Exceptions\ConfigurationException | [
"Sets",
"hostname",
"and",
"optional",
"port"
] | cb3dfd64b0df8610c054dbb43b242fbf2cf668a0 | https://github.com/dittertp/Puzzle/blob/cb3dfd64b0df8610c054dbb43b242fbf2cf668a0/src/Puzzle/Client.php#L192-L202 |
195,185 | dittertp/Puzzle | src/Puzzle/Client.php | Client.performRequest | public function performRequest($method, $uri, $params = null, $body = null)
{
try {
// serialize(json) body if it's not already a string
if ($body !== null) {
$body = $this->getSerializer()->serialize($body);
}
return $this->processRequest(
... | php | public function performRequest($method, $uri, $params = null, $body = null)
{
try {
// serialize(json) body if it's not already a string
if ($body !== null) {
$body = $this->getSerializer()->serialize($body);
}
return $this->processRequest(
... | [
"public",
"function",
"performRequest",
"(",
"$",
"method",
",",
"$",
"uri",
",",
"$",
"params",
"=",
"null",
",",
"$",
"body",
"=",
"null",
")",
"{",
"try",
"{",
"// serialize(json) body if it's not already a string",
"if",
"(",
"$",
"body",
"!==",
"null",
... | performs the request
@param string $method request method
@param string $uri uri string
@param mixed $params optional query string parameters
@param mixed $body "post" body
@return mixed
@throws \Puzzle\Exceptions\ServerErrorResponseException
@throws \Puzzle\Exceptions\ClientErrorResponseException | [
"performs",
"the",
"request"
] | cb3dfd64b0df8610c054dbb43b242fbf2cf668a0 | https://github.com/dittertp/Puzzle/blob/cb3dfd64b0df8610c054dbb43b242fbf2cf668a0/src/Puzzle/Client.php#L236-L255 |
195,186 | dittertp/Puzzle | src/Puzzle/Client.php | Client.get | public function get($uri, $params = null, $body = null)
{
return $this->performRequest("get", $uri, $params, $body);
} | php | public function get($uri, $params = null, $body = null)
{
return $this->performRequest("get", $uri, $params, $body);
} | [
"public",
"function",
"get",
"(",
"$",
"uri",
",",
"$",
"params",
"=",
"null",
",",
"$",
"body",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"performRequest",
"(",
"\"get\"",
",",
"$",
"uri",
",",
"$",
"params",
",",
"$",
"body",
")",
";"... | perform a get request
@param string $uri uri string
@param mixed $params optional query string parameters
@param mixed $body the "post" body
@return mixed
@throws ClientErrorResponseException
@throws ServerErrorResponseException
@throws \Exception | [
"perform",
"a",
"get",
"request"
] | cb3dfd64b0df8610c054dbb43b242fbf2cf668a0 | https://github.com/dittertp/Puzzle/blob/cb3dfd64b0df8610c054dbb43b242fbf2cf668a0/src/Puzzle/Client.php#L269-L272 |
195,187 | dittertp/Puzzle | src/Puzzle/Client.php | Client.put | public function put($uri, $params = null, $body = null)
{
return $this->performRequest("put", $uri, $params, $body);
} | php | public function put($uri, $params = null, $body = null)
{
return $this->performRequest("put", $uri, $params, $body);
} | [
"public",
"function",
"put",
"(",
"$",
"uri",
",",
"$",
"params",
"=",
"null",
",",
"$",
"body",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"performRequest",
"(",
"\"put\"",
",",
"$",
"uri",
",",
"$",
"params",
",",
"$",
"body",
")",
";"... | perform a put request
@param string $uri uri string
@param mixed $params optional query string parameters
@param mixed $body the "post" body
@return mixed
@throws ClientErrorResponseException
@throws ServerErrorResponseException
@throws \Exception | [
"perform",
"a",
"put",
"request"
] | cb3dfd64b0df8610c054dbb43b242fbf2cf668a0 | https://github.com/dittertp/Puzzle/blob/cb3dfd64b0df8610c054dbb43b242fbf2cf668a0/src/Puzzle/Client.php#L286-L289 |
195,188 | dittertp/Puzzle | src/Puzzle/Client.php | Client.post | public function post($uri, $params = null, $body = null)
{
return $this->performRequest("post", $uri, $params, $body);
} | php | public function post($uri, $params = null, $body = null)
{
return $this->performRequest("post", $uri, $params, $body);
} | [
"public",
"function",
"post",
"(",
"$",
"uri",
",",
"$",
"params",
"=",
"null",
",",
"$",
"body",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"performRequest",
"(",
"\"post\"",
",",
"$",
"uri",
",",
"$",
"params",
",",
"$",
"body",
")",
"... | perform a post request
@param string $uri uri string
@param mixed $params optional query string parameters
@param mixed $body the "post" body
@return mixed
@throws ClientErrorResponseException
@throws ServerErrorResponseException
@throws \Exception | [
"perform",
"a",
"post",
"request"
] | cb3dfd64b0df8610c054dbb43b242fbf2cf668a0 | https://github.com/dittertp/Puzzle/blob/cb3dfd64b0df8610c054dbb43b242fbf2cf668a0/src/Puzzle/Client.php#L303-L306 |
195,189 | dittertp/Puzzle | src/Puzzle/Client.php | Client.patch | public function patch($uri, $params = null, $body = null)
{
return $this->performRequest("patch", $uri, $params, $body);
} | php | public function patch($uri, $params = null, $body = null)
{
return $this->performRequest("patch", $uri, $params, $body);
} | [
"public",
"function",
"patch",
"(",
"$",
"uri",
",",
"$",
"params",
"=",
"null",
",",
"$",
"body",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"performRequest",
"(",
"\"patch\"",
",",
"$",
"uri",
",",
"$",
"params",
",",
"$",
"body",
")",
... | perform a patch
@param string $uri uri string
@param mixed $params optional query string parameters
@param mixed $body the "post" body
@return mixed
@throws ClientErrorResponseException
@throws ServerErrorResponseException
@throws \Exception | [
"perform",
"a",
"patch"
] | cb3dfd64b0df8610c054dbb43b242fbf2cf668a0 | https://github.com/dittertp/Puzzle/blob/cb3dfd64b0df8610c054dbb43b242fbf2cf668a0/src/Puzzle/Client.php#L320-L323 |
195,190 | dittertp/Puzzle | src/Puzzle/Client.php | Client.head | public function head($uri, $params = null, $body = null)
{
return $this->performRequest("head", $uri, $params, $body);
} | php | public function head($uri, $params = null, $body = null)
{
return $this->performRequest("head", $uri, $params, $body);
} | [
"public",
"function",
"head",
"(",
"$",
"uri",
",",
"$",
"params",
"=",
"null",
",",
"$",
"body",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"performRequest",
"(",
"\"head\"",
",",
"$",
"uri",
",",
"$",
"params",
",",
"$",
"body",
")",
"... | perform a head request
@param string $uri uri string
@param mixed $params optional query string parameters
@param mixed $body the "post" body
@return mixed
@throws ClientErrorResponseException
@throws ServerErrorResponseException
@throws \Exception | [
"perform",
"a",
"head",
"request"
] | cb3dfd64b0df8610c054dbb43b242fbf2cf668a0 | https://github.com/dittertp/Puzzle/blob/cb3dfd64b0df8610c054dbb43b242fbf2cf668a0/src/Puzzle/Client.php#L337-L340 |
195,191 | dittertp/Puzzle | src/Puzzle/Client.php | Client.delete | public function delete($uri, $params = null, $body = null)
{
return $this->performRequest("delete", $uri, $params, $body);
} | php | public function delete($uri, $params = null, $body = null)
{
return $this->performRequest("delete", $uri, $params, $body);
} | [
"public",
"function",
"delete",
"(",
"$",
"uri",
",",
"$",
"params",
"=",
"null",
",",
"$",
"body",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"performRequest",
"(",
"\"delete\"",
",",
"$",
"uri",
",",
"$",
"params",
",",
"$",
"body",
")",... | perform a delete request
@param string $uri uri string
@param mixed $params optional query string parameters
@param mixed $body the "post" body
@return mixed
@throws ClientErrorResponseException
@throws ServerErrorResponseException
@throws \Exception | [
"perform",
"a",
"delete",
"request"
] | cb3dfd64b0df8610c054dbb43b242fbf2cf668a0 | https://github.com/dittertp/Puzzle/blob/cb3dfd64b0df8610c054dbb43b242fbf2cf668a0/src/Puzzle/Client.php#L354-L357 |
195,192 | dittertp/Puzzle | src/Puzzle/Client.php | Client.processRequest | protected function processRequest($method, $uri, $params = null, $body = null)
{
$methodString = $this->getMethod($method);
if (method_exists($this, $methodString)) {
return $this->$methodString($method, $uri, $params, $body);
} else {
throw new InvalidRequestMethodE... | php | protected function processRequest($method, $uri, $params = null, $body = null)
{
$methodString = $this->getMethod($method);
if (method_exists($this, $methodString)) {
return $this->$methodString($method, $uri, $params, $body);
} else {
throw new InvalidRequestMethodE... | [
"protected",
"function",
"processRequest",
"(",
"$",
"method",
",",
"$",
"uri",
",",
"$",
"params",
"=",
"null",
",",
"$",
"body",
"=",
"null",
")",
"{",
"$",
"methodString",
"=",
"$",
"this",
"->",
"getMethod",
"(",
"$",
"method",
")",
";",
"if",
... | precess the request
@param string $method the request method
@param string $uri the uri string
@param mixed $params the optional query string parameters
@param string $body the (post) body
@return mixed
@throws Exceptions\InvalidRequestMethodException | [
"precess",
"the",
"request"
] | cb3dfd64b0df8610c054dbb43b242fbf2cf668a0 | https://github.com/dittertp/Puzzle/blob/cb3dfd64b0df8610c054dbb43b242fbf2cf668a0/src/Puzzle/Client.php#L370-L379 |
195,193 | dittertp/Puzzle | src/Puzzle/Client.php | Client.getRequest | protected function getRequest($method, $uri, $params, $body)
{
// get requests has no specific necessary requirements
return $this->execute($method, $uri, $params, $body);
} | php | protected function getRequest($method, $uri, $params, $body)
{
// get requests has no specific necessary requirements
return $this->execute($method, $uri, $params, $body);
} | [
"protected",
"function",
"getRequest",
"(",
"$",
"method",
",",
"$",
"uri",
",",
"$",
"params",
",",
"$",
"body",
")",
"{",
"// get requests has no specific necessary requirements",
"return",
"$",
"this",
"->",
"execute",
"(",
"$",
"method",
",",
"$",
"uri",
... | get request implementation
@param string $method the request method
@param string $uri the uri
@param mixed $params optional query string parameters
@param string $body body/post parameters
@return string
@throws \Puzzle\Exceptions\InvalidRequestException | [
"get",
"request",
"implementation"
] | cb3dfd64b0df8610c054dbb43b242fbf2cf668a0 | https://github.com/dittertp/Puzzle/blob/cb3dfd64b0df8610c054dbb43b242fbf2cf668a0/src/Puzzle/Client.php#L410-L415 |
195,194 | dittertp/Puzzle | src/Puzzle/Client.php | Client.deleteRequest | protected function deleteRequest($method, $uri, $params, $body)
{
return $this->execute($method, $uri, $params, $body);
} | php | protected function deleteRequest($method, $uri, $params, $body)
{
return $this->execute($method, $uri, $params, $body);
} | [
"protected",
"function",
"deleteRequest",
"(",
"$",
"method",
",",
"$",
"uri",
",",
"$",
"params",
",",
"$",
"body",
")",
"{",
"return",
"$",
"this",
"->",
"execute",
"(",
"$",
"method",
",",
"$",
"uri",
",",
"$",
"params",
",",
"$",
"body",
")",
... | delete request implementation
@param string $method the request method
@param string $uri the uri
@param mixed $params optional query string parameters
@param string $body body/post parameters
@return string
@throws \Puzzle\Exceptions\InvalidRequestException | [
"delete",
"request",
"implementation"
] | cb3dfd64b0df8610c054dbb43b242fbf2cf668a0 | https://github.com/dittertp/Puzzle/blob/cb3dfd64b0df8610c054dbb43b242fbf2cf668a0/src/Puzzle/Client.php#L428-L431 |
195,195 | dittertp/Puzzle | src/Puzzle/Client.php | Client.headRequest | protected function headRequest($method, $uri, $params, $body)
{
// head requests has no specific necessary requirements
return $this->execute($method, $uri, $params, $body);
} | php | protected function headRequest($method, $uri, $params, $body)
{
// head requests has no specific necessary requirements
return $this->execute($method, $uri, $params, $body);
} | [
"protected",
"function",
"headRequest",
"(",
"$",
"method",
",",
"$",
"uri",
",",
"$",
"params",
",",
"$",
"body",
")",
"{",
"// head requests has no specific necessary requirements",
"return",
"$",
"this",
"->",
"execute",
"(",
"$",
"method",
",",
"$",
"uri",... | head request implementation
@param string $method the request method
@param string $uri the uri
@param mixed $params optional query string parameters
@param string $body body/post parameters
@return string
@throws \Puzzle\Exceptions\InvalidRequestException | [
"head",
"request",
"implementation"
] | cb3dfd64b0df8610c054dbb43b242fbf2cf668a0 | https://github.com/dittertp/Puzzle/blob/cb3dfd64b0df8610c054dbb43b242fbf2cf668a0/src/Puzzle/Client.php#L444-L449 |
195,196 | dittertp/Puzzle | src/Puzzle/Client.php | Client.postRequest | protected function postRequest($method, $uri, $params, $body)
{
// post requests has no specific necessary requirements
return $this->execute($method, $uri, $params, $body);
} | php | protected function postRequest($method, $uri, $params, $body)
{
// post requests has no specific necessary requirements
return $this->execute($method, $uri, $params, $body);
} | [
"protected",
"function",
"postRequest",
"(",
"$",
"method",
",",
"$",
"uri",
",",
"$",
"params",
",",
"$",
"body",
")",
"{",
"// post requests has no specific necessary requirements",
"return",
"$",
"this",
"->",
"execute",
"(",
"$",
"method",
",",
"$",
"uri",... | post request implementation
@param string $method the request method
@param string $uri the uri
@param mixed $params optional query string parameters
@param string $body body/post parameters
@return string
@throws \Puzzle\Exceptions\InvalidRequestException | [
"post",
"request",
"implementation"
] | cb3dfd64b0df8610c054dbb43b242fbf2cf668a0 | https://github.com/dittertp/Puzzle/blob/cb3dfd64b0df8610c054dbb43b242fbf2cf668a0/src/Puzzle/Client.php#L462-L467 |
195,197 | dittertp/Puzzle | src/Puzzle/Client.php | Client.putRequest | protected function putRequest($method, $uri, $params, $body)
{
$this->checkBody($body, $method);
// put requests requires content-length header
$this->setHttpHeader('Content-Length: ' . strlen($body));
return $this->execute($method, $uri, $params, $body);
} | php | protected function putRequest($method, $uri, $params, $body)
{
$this->checkBody($body, $method);
// put requests requires content-length header
$this->setHttpHeader('Content-Length: ' . strlen($body));
return $this->execute($method, $uri, $params, $body);
} | [
"protected",
"function",
"putRequest",
"(",
"$",
"method",
",",
"$",
"uri",
",",
"$",
"params",
",",
"$",
"body",
")",
"{",
"$",
"this",
"->",
"checkBody",
"(",
"$",
"body",
",",
"$",
"method",
")",
";",
"// put requests requires content-length header",
"$... | put request implementation
@param string $method the request method
@param string $uri the uri
@param mixed $params optional query string parameters
@param string $body body/post parameters
@return string
@throws \Puzzle\Exceptions\InvalidRequestException | [
"put",
"request",
"implementation"
] | cb3dfd64b0df8610c054dbb43b242fbf2cf668a0 | https://github.com/dittertp/Puzzle/blob/cb3dfd64b0df8610c054dbb43b242fbf2cf668a0/src/Puzzle/Client.php#L480-L488 |
195,198 | dittertp/Puzzle | src/Puzzle/Client.php | Client.prepareResponse | protected function prepareResponse($result)
{
$this->checkForCurlErrors();
$response = array();
$response["data"] = $this->getSerializer()->deserialize($result);
$response["status"] = $this->getStatusCode();
if ($response['status'] >= 400 && $response['status'] < 500) {
... | php | protected function prepareResponse($result)
{
$this->checkForCurlErrors();
$response = array();
$response["data"] = $this->getSerializer()->deserialize($result);
$response["status"] = $this->getStatusCode();
if ($response['status'] >= 400 && $response['status'] < 500) {
... | [
"protected",
"function",
"prepareResponse",
"(",
"$",
"result",
")",
"{",
"$",
"this",
"->",
"checkForCurlErrors",
"(",
")",
";",
"$",
"response",
"=",
"array",
"(",
")",
";",
"$",
"response",
"[",
"\"data\"",
"]",
"=",
"$",
"this",
"->",
"getSerializer"... | prepares the response
@param string $result the curl result
@return array
@throws ClientErrorException
@throws ConnectionException
@throws ServerErrorException | [
"prepares",
"the",
"response"
] | cb3dfd64b0df8610c054dbb43b242fbf2cf668a0 | https://github.com/dittertp/Puzzle/blob/cb3dfd64b0df8610c054dbb43b242fbf2cf668a0/src/Puzzle/Client.php#L550-L572 |
195,199 | dittertp/Puzzle | src/Puzzle/Client.php | Client.checkForCurlErrors | protected function checkForCurlErrors()
{
if (curl_errno($this->getHandle())) {
$exceptionText = "Connection Error: " . curl_error($this->getHandle());
throw new ConnectionException($exceptionText);
}
} | php | protected function checkForCurlErrors()
{
if (curl_errno($this->getHandle())) {
$exceptionText = "Connection Error: " . curl_error($this->getHandle());
throw new ConnectionException($exceptionText);
}
} | [
"protected",
"function",
"checkForCurlErrors",
"(",
")",
"{",
"if",
"(",
"curl_errno",
"(",
"$",
"this",
"->",
"getHandle",
"(",
")",
")",
")",
"{",
"$",
"exceptionText",
"=",
"\"Connection Error: \"",
".",
"curl_error",
"(",
"$",
"this",
"->",
"getHandle",
... | checks if a curl error occurred
@return void
@throws ConnectionException | [
"checks",
"if",
"a",
"curl",
"error",
"occurred"
] | cb3dfd64b0df8610c054dbb43b242fbf2cf668a0 | https://github.com/dittertp/Puzzle/blob/cb3dfd64b0df8610c054dbb43b242fbf2cf668a0/src/Puzzle/Client.php#L590-L596 |
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.