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
196,700
phpffcms/ffcms-core
src/Managers/MigrationsManager.php
MigrationsManager.makeDown
public function makeDown($file) { if (Any::isArray($file)) { $success = true; foreach ($file as $item) { $exec = $this->makeDown($file); if (!$exec) { $success = false; } return $success; ...
php
public function makeDown($file) { if (Any::isArray($file)) { $success = true; foreach ($file as $item) { $exec = $this->makeDown($file); if (!$exec) { $success = false; } return $success; ...
[ "public", "function", "makeDown", "(", "$", "file", ")", "{", "if", "(", "Any", "::", "isArray", "(", "$", "file", ")", ")", "{", "$", "success", "=", "true", ";", "foreach", "(", "$", "file", "as", "$", "item", ")", "{", "$", "exec", "=", "$",...
Make migration down @param array|string $file @return bool
[ "Make", "migration", "down" ]
44a309553ef9f115ccfcfd71f2ac6e381c612082
https://github.com/phpffcms/ffcms-core/blob/44a309553ef9f115ccfcfd71f2ac6e381c612082/src/Managers/MigrationsManager.php#L138-L170
196,701
OpenConext/Stepup-bundle
src/EventListener/RequestIdRequestResponseListener.php
RequestIdRequestResponseListener.onKernelRequest
public function onKernelRequest(GetResponseEvent $event) { $headers = $event->getRequest()->headers; if (!$headers->has(self::HEADER_NAME)) { return; } $this->requestId->set($headers->get(self::HEADER_NAME, null, true), true); }
php
public function onKernelRequest(GetResponseEvent $event) { $headers = $event->getRequest()->headers; if (!$headers->has(self::HEADER_NAME)) { return; } $this->requestId->set($headers->get(self::HEADER_NAME, null, true), true); }
[ "public", "function", "onKernelRequest", "(", "GetResponseEvent", "$", "event", ")", "{", "$", "headers", "=", "$", "event", "->", "getRequest", "(", ")", "->", "headers", ";", "if", "(", "!", "$", "headers", "->", "has", "(", "self", "::", "HEADER_NAME"...
If present, reads the request ID from the appropriate header and sets it on a RequestId instance. @param GetResponseEvent $event
[ "If", "present", "reads", "the", "request", "ID", "from", "the", "appropriate", "header", "and", "sets", "it", "on", "a", "RequestId", "instance", "." ]
94178ddb421889df9e068109293a8da880793ed2
https://github.com/OpenConext/Stepup-bundle/blob/94178ddb421889df9e068109293a8da880793ed2/src/EventListener/RequestIdRequestResponseListener.php#L51-L60
196,702
OpenConext/Stepup-bundle
src/EventListener/RequestIdRequestResponseListener.php
RequestIdRequestResponseListener.onKernelResponse
public function onKernelResponse(FilterResponseEvent $event) { $event->getResponse()->headers->set(self::HEADER_NAME, $this->requestId->get()); }
php
public function onKernelResponse(FilterResponseEvent $event) { $event->getResponse()->headers->set(self::HEADER_NAME, $this->requestId->get()); }
[ "public", "function", "onKernelResponse", "(", "FilterResponseEvent", "$", "event", ")", "{", "$", "event", "->", "getResponse", "(", ")", "->", "headers", "->", "set", "(", "self", "::", "HEADER_NAME", ",", "$", "this", "->", "requestId", "->", "get", "("...
If enabled, sets the request ID on the appropriate response header. @param FilterResponseEvent $event
[ "If", "enabled", "sets", "the", "request", "ID", "on", "the", "appropriate", "response", "header", "." ]
94178ddb421889df9e068109293a8da880793ed2
https://github.com/OpenConext/Stepup-bundle/blob/94178ddb421889df9e068109293a8da880793ed2/src/EventListener/RequestIdRequestResponseListener.php#L67-L70
196,703
buflix/SimpleCollection
src/SimpleCollection/AbstractCollection.php
AbstractCollection.current
public function current() { $sKey = key($this->values); return (true === isset($this->values[$sKey])) ? $this->values[$sKey] : null; }
php
public function current() { $sKey = key($this->values); return (true === isset($this->values[$sKey])) ? $this->values[$sKey] : null; }
[ "public", "function", "current", "(", ")", "{", "$", "sKey", "=", "key", "(", "$", "this", "->", "values", ")", ";", "return", "(", "true", "===", "isset", "(", "$", "this", "->", "values", "[", "$", "sKey", "]", ")", ")", "?", "$", "this", "->...
returns current value @return mixed
[ "returns", "current", "value" ]
405504d8be6415a872a5a49ce8223c22a932831a
https://github.com/buflix/SimpleCollection/blob/405504d8be6415a872a5a49ce8223c22a932831a/src/SimpleCollection/AbstractCollection.php#L47-L52
196,704
buflix/SimpleCollection
src/SimpleCollection/AbstractCollection.php
AbstractCollection.scNext
public function scNext() { $mValue = $this->next(); return (false === $mValue and false === $this->valid()) ? self::NOT_SET_FLAG : $mValue; }
php
public function scNext() { $mValue = $this->next(); return (false === $mValue and false === $this->valid()) ? self::NOT_SET_FLAG : $mValue; }
[ "public", "function", "scNext", "(", ")", "{", "$", "mValue", "=", "$", "this", "->", "next", "(", ")", ";", "return", "(", "false", "===", "$", "mValue", "and", "false", "===", "$", "this", "->", "valid", "(", ")", ")", "?", "self", "::", "NOT_S...
Like next, but return Not_Set_Flag if there are no next value instead of false @return mixed
[ "Like", "next", "but", "return", "Not_Set_Flag", "if", "there", "are", "no", "next", "value", "instead", "of", "false" ]
405504d8be6415a872a5a49ce8223c22a932831a
https://github.com/buflix/SimpleCollection/blob/405504d8be6415a872a5a49ce8223c22a932831a/src/SimpleCollection/AbstractCollection.php#L69-L74
196,705
buflix/SimpleCollection
src/SimpleCollection/AbstractCollection.php
AbstractCollection.scPrev
public function scPrev() { $mValue = $this->prev(); return (false === $mValue and false === $this->valid()) ? self::NOT_SET_FLAG : $mValue; }
php
public function scPrev() { $mValue = $this->prev(); return (false === $mValue and false === $this->valid()) ? self::NOT_SET_FLAG : $mValue; }
[ "public", "function", "scPrev", "(", ")", "{", "$", "mValue", "=", "$", "this", "->", "prev", "(", ")", ";", "return", "(", "false", "===", "$", "mValue", "and", "false", "===", "$", "this", "->", "valid", "(", ")", ")", "?", "self", "::", "NOT_S...
rewind the pointer for one position @return mixed|false
[ "rewind", "the", "pointer", "for", "one", "position" ]
405504d8be6415a872a5a49ce8223c22a932831a
https://github.com/buflix/SimpleCollection/blob/405504d8be6415a872a5a49ce8223c22a932831a/src/SimpleCollection/AbstractCollection.php#L91-L96
196,706
buflix/SimpleCollection
src/SimpleCollection/AbstractCollection.php
AbstractCollection.valid
public function valid() { $bIsValid = false; if (null !== $this->values) { $sKey = $this->key(); $bIsValid = isset($sKey); } return $bIsValid; }
php
public function valid() { $bIsValid = false; if (null !== $this->values) { $sKey = $this->key(); $bIsValid = isset($sKey); } return $bIsValid; }
[ "public", "function", "valid", "(", ")", "{", "$", "bIsValid", "=", "false", ";", "if", "(", "null", "!==", "$", "this", "->", "values", ")", "{", "$", "sKey", "=", "$", "this", "->", "key", "(", ")", ";", "$", "bIsValid", "=", "isset", "(", "$...
check if the the current value is set @return bool True if set, otherwise false
[ "check", "if", "the", "the", "current", "value", "is", "set" ]
405504d8be6415a872a5a49ce8223c22a932831a
https://github.com/buflix/SimpleCollection/blob/405504d8be6415a872a5a49ce8223c22a932831a/src/SimpleCollection/AbstractCollection.php#L113-L122
196,707
buflix/SimpleCollection
src/SimpleCollection/AbstractCollection.php
AbstractCollection.get
public function get($mOffset, $mDefault = null) { return (true === isset($this->values[$mOffset])) ? $this->values[$mOffset] : $mDefault; }
php
public function get($mOffset, $mDefault = null) { return (true === isset($this->values[$mOffset])) ? $this->values[$mOffset] : $mDefault; }
[ "public", "function", "get", "(", "$", "mOffset", ",", "$", "mDefault", "=", "null", ")", "{", "return", "(", "true", "===", "isset", "(", "$", "this", "->", "values", "[", "$", "mOffset", "]", ")", ")", "?", "$", "this", "->", "values", "[", "$"...
Return the value with the given offset, if is not set return the default @param mixed $mOffset @param mixed $mDefault @return mixed
[ "Return", "the", "value", "with", "the", "given", "offset", "if", "is", "not", "set", "return", "the", "default" ]
405504d8be6415a872a5a49ce8223c22a932831a
https://github.com/buflix/SimpleCollection/blob/405504d8be6415a872a5a49ce8223c22a932831a/src/SimpleCollection/AbstractCollection.php#L176-L179
196,708
buflix/SimpleCollection
src/SimpleCollection/AbstractCollection.php
AbstractCollection.offsetSet
public function offsetSet($mOffset, $mValue) { if (false === is_string($mOffset) and false === is_integer($mOffset)) { throw new \InvalidArgumentException('Invalid offset given: ' . gettype($mOffset)); } $this->values[$mOffset] = $mValue; return $this; }
php
public function offsetSet($mOffset, $mValue) { if (false === is_string($mOffset) and false === is_integer($mOffset)) { throw new \InvalidArgumentException('Invalid offset given: ' . gettype($mOffset)); } $this->values[$mOffset] = $mValue; return $this; }
[ "public", "function", "offsetSet", "(", "$", "mOffset", ",", "$", "mValue", ")", "{", "if", "(", "false", "===", "is_string", "(", "$", "mOffset", ")", "and", "false", "===", "is_integer", "(", "$", "mOffset", ")", ")", "{", "throw", "new", "\\", "In...
set the value by the given offset @param string|int $mOffset Offset @param mixed $mValue ProxyServer @return $this @throws \InvalidArgumentException
[ "set", "the", "value", "by", "the", "given", "offset" ]
405504d8be6415a872a5a49ce8223c22a932831a
https://github.com/buflix/SimpleCollection/blob/405504d8be6415a872a5a49ce8223c22a932831a/src/SimpleCollection/AbstractCollection.php#L204-L212
196,709
buflix/SimpleCollection
src/SimpleCollection/AbstractCollection.php
AbstractCollection.seek
public function seek($iOffset) { $this->rewind(); $iPosition = 0; while ($iPosition < $iOffset and true === $this->valid()) { $this->next(); $iPosition++; } if (false === $this->valid()) { throw new \OutOfBoundsException('Invalid seek pos...
php
public function seek($iOffset) { $this->rewind(); $iPosition = 0; while ($iPosition < $iOffset and true === $this->valid()) { $this->next(); $iPosition++; } if (false === $this->valid()) { throw new \OutOfBoundsException('Invalid seek pos...
[ "public", "function", "seek", "(", "$", "iOffset", ")", "{", "$", "this", "->", "rewind", "(", ")", ";", "$", "iPosition", "=", "0", ";", "while", "(", "$", "iPosition", "<", "$", "iOffset", "and", "true", "===", "$", "this", "->", "valid", "(", ...
seek the pointer to the offset position @param int $iOffset Seek position @return mixed @throws \OutOfBoundsException
[ "seek", "the", "pointer", "to", "the", "offset", "position" ]
405504d8be6415a872a5a49ce8223c22a932831a
https://github.com/buflix/SimpleCollection/blob/405504d8be6415a872a5a49ce8223c22a932831a/src/SimpleCollection/AbstractCollection.php#L246-L261
196,710
buflix/SimpleCollection
src/SimpleCollection/AbstractCollection.php
AbstractCollection.seekToKey
public function seekToKey($mKey, $bStrictMode = true) { $this->rewind(); if ($bStrictMode === true) { while (true === $this->valid() and $mKey !== $this->key()) { $this->next(); } } else { while (true === $this->valid() and $mKey != $this->...
php
public function seekToKey($mKey, $bStrictMode = true) { $this->rewind(); if ($bStrictMode === true) { while (true === $this->valid() and $mKey !== $this->key()) { $this->next(); } } else { while (true === $this->valid() and $mKey != $this->...
[ "public", "function", "seekToKey", "(", "$", "mKey", ",", "$", "bStrictMode", "=", "true", ")", "{", "$", "this", "->", "rewind", "(", ")", ";", "if", "(", "$", "bStrictMode", "===", "true", ")", "{", "while", "(", "true", "===", "$", "this", "->",...
Try to seek to given offset @param mixed $mKey @param bool $bStrictMode @return mixed @throws \OutOfBoundsException
[ "Try", "to", "seek", "to", "given", "offset" ]
405504d8be6415a872a5a49ce8223c22a932831a
https://github.com/buflix/SimpleCollection/blob/405504d8be6415a872a5a49ce8223c22a932831a/src/SimpleCollection/AbstractCollection.php#L272-L289
196,711
buflix/SimpleCollection
src/SimpleCollection/AbstractCollection.php
AbstractCollection.filter
public function filter(\Closure $cClosure) { $sClassName = get_class($this); $aFilteredValues = array(); foreach ($this->values as $sKey => $mValue) { if (true === $cClosure($mValue, $sKey)) { $aFilteredValues[$sKey] = $mValue; } } ...
php
public function filter(\Closure $cClosure) { $sClassName = get_class($this); $aFilteredValues = array(); foreach ($this->values as $sKey => $mValue) { if (true === $cClosure($mValue, $sKey)) { $aFilteredValues[$sKey] = $mValue; } } ...
[ "public", "function", "filter", "(", "\\", "Closure", "$", "cClosure", ")", "{", "$", "sClassName", "=", "get_class", "(", "$", "this", ")", ";", "$", "aFilteredValues", "=", "array", "(", ")", ";", "foreach", "(", "$", "this", "->", "values", "as", ...
Filters the current values and return a new collection @param \Closure $cClosure @return AbstractCollection
[ "Filters", "the", "current", "values", "and", "return", "a", "new", "collection" ]
405504d8be6415a872a5a49ce8223c22a932831a
https://github.com/buflix/SimpleCollection/blob/405504d8be6415a872a5a49ce8223c22a932831a/src/SimpleCollection/AbstractCollection.php#L353-L364
196,712
buflix/SimpleCollection
src/SimpleCollection/AbstractCollection.php
AbstractCollection.forAll
public function forAll(\Closure $cClosure) { foreach ($this->values as $mKey => $mValue) { $this->offsetSet($mKey, $cClosure($mValue, $mKey)); } return $this; }
php
public function forAll(\Closure $cClosure) { foreach ($this->values as $mKey => $mValue) { $this->offsetSet($mKey, $cClosure($mValue, $mKey)); } return $this; }
[ "public", "function", "forAll", "(", "\\", "Closure", "$", "cClosure", ")", "{", "foreach", "(", "$", "this", "->", "values", "as", "$", "mKey", "=>", "$", "mValue", ")", "{", "$", "this", "->", "offsetSet", "(", "$", "mKey", ",", "$", "cClosure", ...
Use a function on all values of the collection, and set the result as new values for the key @param \Closure $cClosure @return $this
[ "Use", "a", "function", "on", "all", "values", "of", "the", "collection", "and", "set", "the", "result", "as", "new", "values", "for", "the", "key" ]
405504d8be6415a872a5a49ce8223c22a932831a
https://github.com/buflix/SimpleCollection/blob/405504d8be6415a872a5a49ce8223c22a932831a/src/SimpleCollection/AbstractCollection.php#L373-L380
196,713
buflix/SimpleCollection
src/SimpleCollection/AbstractCollection.php
AbstractCollection.sliceByKey
public function sliceByKey($mStartKey, $bStrict = true, $iLength = PHP_INT_MAX) { $aSlice = array(); try { $this->seekToKey($mStartKey, $bStrict); if ($iLength > 0) { $aSlice[$this->key()] = $this->current(); $iLength--; $this-...
php
public function sliceByKey($mStartKey, $bStrict = true, $iLength = PHP_INT_MAX) { $aSlice = array(); try { $this->seekToKey($mStartKey, $bStrict); if ($iLength > 0) { $aSlice[$this->key()] = $this->current(); $iLength--; $this-...
[ "public", "function", "sliceByKey", "(", "$", "mStartKey", ",", "$", "bStrict", "=", "true", ",", "$", "iLength", "=", "PHP_INT_MAX", ")", "{", "$", "aSlice", "=", "array", "(", ")", ";", "try", "{", "$", "this", "->", "seekToKey", "(", "$", "mStartK...
Slice elements and create a new instance @param mixed $mStartKey @param bool $bStrict @param int $iLength @return AbstractCollection
[ "Slice", "elements", "and", "create", "a", "new", "instance" ]
405504d8be6415a872a5a49ce8223c22a932831a
https://github.com/buflix/SimpleCollection/blob/405504d8be6415a872a5a49ce8223c22a932831a/src/SimpleCollection/AbstractCollection.php#L391-L414
196,714
SagittariusX/Beluga.Core
src/Beluga/TypeTool.php
TypeTool.XmlToType
public static function XmlToType( \SimpleXMLElement $xmlElement ) { $type = null; $value = null; if ( false !== ( $type = XmlAttributeHelper::GetAttributeValue( $xmlElement, 'type' ) ) ) { $type = (string) $type; } else if ( isset( $xmlElement->type ) ) { ...
php
public static function XmlToType( \SimpleXMLElement $xmlElement ) { $type = null; $value = null; if ( false !== ( $type = XmlAttributeHelper::GetAttributeValue( $xmlElement, 'type' ) ) ) { $type = (string) $type; } else if ( isset( $xmlElement->type ) ) { ...
[ "public", "static", "function", "XmlToType", "(", "\\", "SimpleXMLElement", "$", "xmlElement", ")", "{", "$", "type", "=", "null", ";", "$", "value", "=", "null", ";", "if", "(", "false", "!==", "(", "$", "type", "=", "XmlAttributeHelper", "::", "GetAttr...
Extracts typed data from defined XML element. For it, the XML element must define the data of a single value. The type name can be defined by 'type' attribute or by the &lt;Type&gt;Typename&lt;/Type&gt; element. The type value can be defined as string by 'value' attribute or by the &lt;Value&gt;A value&lt;/Value&gt;...
[ "Extracts", "typed", "data", "from", "defined", "XML", "element", "." ]
51057b362707157a4b075df42bb49f397e2d310b
https://github.com/SagittariusX/Beluga.Core/blob/51057b362707157a4b075df42bb49f397e2d310b/src/Beluga/TypeTool.php#L424-L466
196,715
SagittariusX/Beluga.Core
src/Beluga/TypeTool.php
TypeTool.WriteTypedXmlValue
public static function WriteTypedXmlValue( \XMLWriter $w, $value, string $name, bool $short = true, bool $separateElements = false) { if ( ! ( $value instanceof Type ) ) { $value = new Type( $value ); } $v = null; $t = null; switch ( $value->getType() ) { ...
php
public static function WriteTypedXmlValue( \XMLWriter $w, $value, string $name, bool $short = true, bool $separateElements = false) { if ( ! ( $value instanceof Type ) ) { $value = new Type( $value ); } $v = null; $t = null; switch ( $value->getType() ) { ...
[ "public", "static", "function", "WriteTypedXmlValue", "(", "\\", "XMLWriter", "$", "w", ",", "$", "value", ",", "string", "$", "name", ",", "bool", "$", "short", "=", "true", ",", "bool", "$", "separateElements", "=", "false", ")", "{", "if", "(", "!",...
Writes all data of the defined Value to the XmlWriter. You can write it in 3 different ways: - &lt;$name type="..." value="..." /&gt; Is created if $short is boolean TRUE. If $short is FALSE you can write in the following 2 ways: - &lt;$name type="..."&gt;$value&lt;/$name&gt; Is created if $separateElements is bool...
[ "Writes", "all", "data", "of", "the", "defined", "Value", "to", "the", "XmlWriter", "." ]
51057b362707157a4b075df42bb49f397e2d310b
https://github.com/SagittariusX/Beluga.Core/blob/51057b362707157a4b075df42bb49f397e2d310b/src/Beluga/TypeTool.php#L489-L575
196,716
SagittariusX/Beluga.Core
src/Beluga/TypeTool.php
TypeTool.IsNativeType
public static function IsNativeType( $value ) : bool { return ( \is_bool( $value ) || \is_int( $value ) || \is_string( $value ) || \is_double( $value ) || \is_float( $value ) || \is_array( $value ) ); }
php
public static function IsNativeType( $value ) : bool { return ( \is_bool( $value ) || \is_int( $value ) || \is_string( $value ) || \is_double( $value ) || \is_float( $value ) || \is_array( $value ) ); }
[ "public", "static", "function", "IsNativeType", "(", "$", "value", ")", ":", "bool", "{", "return", "(", "\\", "is_bool", "(", "$", "value", ")", "||", "\\", "is_int", "(", "$", "value", ")", "||", "\\", "is_string", "(", "$", "value", ")", "||", "...
Returns if the type of defined value is a native PHP type. Native types are: boolean, integer, double, float, string, array @param mixed $value THe value to check. @return boolean
[ "Returns", "if", "the", "type", "of", "defined", "value", "is", "a", "native", "PHP", "type", "." ]
51057b362707157a4b075df42bb49f397e2d310b
https://github.com/SagittariusX/Beluga.Core/blob/51057b362707157a4b075df42bb49f397e2d310b/src/Beluga/TypeTool.php#L585-L597
196,717
SagittariusX/Beluga.Core
src/Beluga/TypeTool.php
TypeTool.GetTypeName
public static function GetTypeName( $value ) : string { if ( \is_null( $value ) ) { return Type::PHP_NULL; } if ( \is_object( $value ) ) { return \get_class( $value ); } if ( \is_string( $value ) ) { return Type::PHP_STRING; } ...
php
public static function GetTypeName( $value ) : string { if ( \is_null( $value ) ) { return Type::PHP_NULL; } if ( \is_object( $value ) ) { return \get_class( $value ); } if ( \is_string( $value ) ) { return Type::PHP_STRING; } ...
[ "public", "static", "function", "GetTypeName", "(", "$", "value", ")", ":", "string", "{", "if", "(", "\\", "is_null", "(", "$", "value", ")", ")", "{", "return", "Type", "::", "PHP_NULL", ";", "}", "if", "(", "\\", "is_object", "(", "$", "value", ...
Returns the type name of the defined value. @param mixed $value The value. @return string
[ "Returns", "the", "type", "name", "of", "the", "defined", "value", "." ]
51057b362707157a4b075df42bb49f397e2d310b
https://github.com/SagittariusX/Beluga.Core/blob/51057b362707157a4b075df42bb49f397e2d310b/src/Beluga/TypeTool.php#L643-L693
196,718
kawanamiyuu/Maye.OAuthClient
src/AbstractOAuthClient.php
AbstractOAuthClient.clearCachedAccessToken
protected function clearCachedAccessToken() { /** @var TokenStorageInterface $storage */ $storage = $this->service->getStorage(); $storage->clearToken($this->getServiceName()); return $this; }
php
protected function clearCachedAccessToken() { /** @var TokenStorageInterface $storage */ $storage = $this->service->getStorage(); $storage->clearToken($this->getServiceName()); return $this; }
[ "protected", "function", "clearCachedAccessToken", "(", ")", "{", "/** @var TokenStorageInterface $storage */", "$", "storage", "=", "$", "this", "->", "service", "->", "getStorage", "(", ")", ";", "$", "storage", "->", "clearToken", "(", "$", "this", "->", "get...
clear Cached Access token @return self
[ "clear", "Cached", "Access", "token" ]
6001a66bb76d6477606d1d3700258b459f556226
https://github.com/kawanamiyuu/Maye.OAuthClient/blob/6001a66bb76d6477606d1d3700258b459f556226/src/AbstractOAuthClient.php#L54-L61
196,719
geoffadams/bedrest-core
library/BedRest/Resource/Mapping/ResourceMetadataFactory.php
ResourceMetadataFactory.getMetadataByResourceName
public function getMetadataByResourceName($resourceName) { $this->getAllMetadata(); if (!isset($this->resourceClassMap[$resourceName])) { throw Exception::resourceNotFound($resourceName); } return $this->loadedMetadata[$this->resourceClassMap[$resourceName]]; }
php
public function getMetadataByResourceName($resourceName) { $this->getAllMetadata(); if (!isset($this->resourceClassMap[$resourceName])) { throw Exception::resourceNotFound($resourceName); } return $this->loadedMetadata[$this->resourceClassMap[$resourceName]]; }
[ "public", "function", "getMetadataByResourceName", "(", "$", "resourceName", ")", "{", "$", "this", "->", "getAllMetadata", "(", ")", ";", "if", "(", "!", "isset", "(", "$", "this", "->", "resourceClassMap", "[", "$", "resourceName", "]", ")", ")", "{", ...
Returns ResourceMetadata for the specified resource. @param string $resourceName @throws \BedRest\Resource\Mapping\Exception @return \BedRest\Resource\Mapping\ResourceMetadata
[ "Returns", "ResourceMetadata", "for", "the", "specified", "resource", "." ]
a77bf8b7492dfbfb720b201f7ec91a4f03417b5c
https://github.com/geoffadams/bedrest-core/blob/a77bf8b7492dfbfb720b201f7ec91a4f03417b5c/library/BedRest/Resource/Mapping/ResourceMetadataFactory.php#L150-L159
196,720
geoffadams/bedrest-core
library/BedRest/Resource/Mapping/ResourceMetadataFactory.php
ResourceMetadataFactory.getAllMetadata
public function getAllMetadata() { $resourceClasses = $this->driver->getAllClassNames(); foreach ($resourceClasses as $class) { $this->getMetadataFor($class); } return $this->loadedMetadata; }
php
public function getAllMetadata() { $resourceClasses = $this->driver->getAllClassNames(); foreach ($resourceClasses as $class) { $this->getMetadataFor($class); } return $this->loadedMetadata; }
[ "public", "function", "getAllMetadata", "(", ")", "{", "$", "resourceClasses", "=", "$", "this", "->", "driver", "->", "getAllClassNames", "(", ")", ";", "foreach", "(", "$", "resourceClasses", "as", "$", "class", ")", "{", "$", "this", "->", "getMetadataF...
Returns the entire collection of ResourceMetadata objects for all mapped resources. Entities not marked as resources are not included. @return array
[ "Returns", "the", "entire", "collection", "of", "ResourceMetadata", "objects", "for", "all", "mapped", "resources", ".", "Entities", "not", "marked", "as", "resources", "are", "not", "included", "." ]
a77bf8b7492dfbfb720b201f7ec91a4f03417b5c
https://github.com/geoffadams/bedrest-core/blob/a77bf8b7492dfbfb720b201f7ec91a4f03417b5c/library/BedRest/Resource/Mapping/ResourceMetadataFactory.php#L167-L176
196,721
geoffadams/bedrest-core
library/BedRest/Resource/Mapping/ResourceMetadataFactory.php
ResourceMetadataFactory.loadMetadata
protected function loadMetadata($className) { $resource = new ResourceMetadata($className); $this->driver->loadMetadataForClass($className, $resource); $this->loadedMetadata[$className] = $resource; $this->resourceClassMap[$resource->getName()] = $className; }
php
protected function loadMetadata($className) { $resource = new ResourceMetadata($className); $this->driver->loadMetadataForClass($className, $resource); $this->loadedMetadata[$className] = $resource; $this->resourceClassMap[$resource->getName()] = $className; }
[ "protected", "function", "loadMetadata", "(", "$", "className", ")", "{", "$", "resource", "=", "new", "ResourceMetadata", "(", "$", "className", ")", ";", "$", "this", "->", "driver", "->", "loadMetadataForClass", "(", "$", "className", ",", "$", "resource"...
Loads the ResourceMetadata for the specified class. @param string $className
[ "Loads", "the", "ResourceMetadata", "for", "the", "specified", "class", "." ]
a77bf8b7492dfbfb720b201f7ec91a4f03417b5c
https://github.com/geoffadams/bedrest-core/blob/a77bf8b7492dfbfb720b201f7ec91a4f03417b5c/library/BedRest/Resource/Mapping/ResourceMetadataFactory.php#L183-L191
196,722
drdplusinfo/drdplus-skills
DrdPlus/Skills/Physical/ShieldUsage.php
ShieldUsage.getMalusToFightNumber
public function getMalusToFightNumber(Tables $tables, $shieldRestriction): int { /** * using shield as a weapon means using something without skill (zero skill ShieldAsAWeapon respectively) *, @see PPH page 86 right column top */ return $this->getRestrictionWit...
php
public function getMalusToFightNumber(Tables $tables, $shieldRestriction): int { /** * using shield as a weapon means using something without skill (zero skill ShieldAsAWeapon respectively) *, @see PPH page 86 right column top */ return $this->getRestrictionWit...
[ "public", "function", "getMalusToFightNumber", "(", "Tables", "$", "tables", ",", "$", "shieldRestriction", ")", ":", "int", "{", "/**\n * using shield as a weapon means using something without skill (zero skill ShieldAsAWeapon respectively)\n *, @see PPH page 86 right co...
Only for using shield as a weapon! @param Tables $tables @param int $shieldRestriction as a negative number @return int negative number or zero @throws \Granam\Integer\Tools\Exceptions\WrongParameterType @throws \Granam\Integer\Tools\Exceptions\ValueLostOnCast @throws \Granam\Integer\Tools\Exceptions\NegativeIntegerCa...
[ "Only", "for", "using", "shield", "as", "a", "weapon!" ]
9ae6ecdbaadf594d6572ec0c190fc13572c0a53f
https://github.com/drdplusinfo/drdplus-skills/blob/9ae6ecdbaadf594d6572ec0c190fc13572c0a53f/DrdPlus/Skills/Physical/ShieldUsage.php#L37-L46
196,723
mwyatt/core
src/Iterator/Collection.php
Collection.pluck
public function pluck($key, $unique = false) { $results = []; foreach ($this as $item) { $value = is_object($item) ? $item->$key : $item[$key]; if ($unique) { $results[$value] = $value; } else { $results[] = $value; } ...
php
public function pluck($key, $unique = false) { $results = []; foreach ($this as $item) { $value = is_object($item) ? $item->$key : $item[$key]; if ($unique) { $results[$value] = $value; } else { $results[] = $value; } ...
[ "public", "function", "pluck", "(", "$", "key", ",", "$", "unique", "=", "false", ")", "{", "$", "results", "=", "[", "]", ";", "foreach", "(", "$", "this", "as", "$", "item", ")", "{", "$", "value", "=", "is_object", "(", "$", "item", ")", "?"...
get a collection of values from property @param string $property @return Object
[ "get", "a", "collection", "of", "values", "from", "property" ]
8ea9d67cc84fe6aff17a469c703d5492dbcd93ed
https://github.com/mwyatt/core/blob/8ea9d67cc84fe6aff17a469c703d5492dbcd93ed/src/Iterator/Collection.php#L45-L58
196,724
mwyatt/core
src/Iterator/Collection.php
Collection.getByPropertyValues
public function getByPropertyValues($property, $values, $strict = false) { $results = []; foreach ($this as $item) { foreach ($values as $value) { if ($strict) { if ($item->$property === $value) { $results[] = $item; ...
php
public function getByPropertyValues($property, $values, $strict = false) { $results = []; foreach ($this as $item) { foreach ($values as $value) { if ($strict) { if ($item->$property === $value) { $results[] = $item; ...
[ "public", "function", "getByPropertyValues", "(", "$", "property", ",", "$", "values", ",", "$", "strict", "=", "false", ")", "{", "$", "results", "=", "[", "]", ";", "foreach", "(", "$", "this", "as", "$", "item", ")", "{", "foreach", "(", "$", "v...
get the models which match the property values loose matching not strict @param string $property @param mixed $value @return object ModelIterator
[ "get", "the", "models", "which", "match", "the", "property", "values", "loose", "matching", "not", "strict" ]
8ea9d67cc84fe6aff17a469c703d5492dbcd93ed
https://github.com/mwyatt/core/blob/8ea9d67cc84fe6aff17a469c703d5492dbcd93ed/src/Iterator/Collection.php#L79-L96
196,725
mwyatt/core
src/Iterator/Collection.php
Collection.getKeyedByProperty
public function getKeyedByProperty($property) { $results = []; foreach ($this as $item) { $results[$item->$property] = $item; } return new static($results); }
php
public function getKeyedByProperty($property) { $results = []; foreach ($this as $item) { $results[$item->$property] = $item; } return new static($results); }
[ "public", "function", "getKeyedByProperty", "(", "$", "property", ")", "{", "$", "results", "=", "[", "]", ";", "foreach", "(", "$", "this", "as", "$", "item", ")", "{", "$", "results", "[", "$", "item", "->", "$", "property", "]", "=", "$", "item"...
key the iterator by the specified property @param string $property @return Object
[ "key", "the", "iterator", "by", "the", "specified", "property" ]
8ea9d67cc84fe6aff17a469c703d5492dbcd93ed
https://github.com/mwyatt/core/blob/8ea9d67cc84fe6aff17a469c703d5492dbcd93ed/src/Iterator/Collection.php#L110-L117
196,726
mwyatt/core
src/Iterator/Collection.php
Collection.sort
public function sort(callable $callback = null) { $items = $this->getArrayCopy(); $callback ? uasort($items, $callback) : asort($items); return new static($items); }
php
public function sort(callable $callback = null) { $items = $this->getArrayCopy(); $callback ? uasort($items, $callback) : asort($items); return new static($items); }
[ "public", "function", "sort", "(", "callable", "$", "callback", "=", "null", ")", "{", "$", "items", "=", "$", "this", "->", "getArrayCopy", "(", ")", ";", "$", "callback", "?", "uasort", "(", "$", "items", ",", "$", "callback", ")", ":", "asort", ...
how to reset array keys here? as when jsonencoded the keys must be reset not sure you would always want to reset as may need to maintain sometimes?
[ "how", "to", "reset", "array", "keys", "here?", "as", "when", "jsonencoded", "the", "keys", "must", "be", "reset", "not", "sure", "you", "would", "always", "want", "to", "reset", "as", "may", "need", "to", "maintain", "sometimes?" ]
8ea9d67cc84fe6aff17a469c703d5492dbcd93ed
https://github.com/mwyatt/core/blob/8ea9d67cc84fe6aff17a469c703d5492dbcd93ed/src/Iterator/Collection.php#L136-L141
196,727
mwyatt/core
src/Iterator/Collection.php
Collection.offsetAppend
public function offsetAppend($index, $value) { $items = []; if ($this->offsetExists($index)) { $items = $this->offsetGet($index); if (!is_array($items)) { $itemsType = gettype($items); throw new \Exception("Offset '$index' is '$itemsType' and m...
php
public function offsetAppend($index, $value) { $items = []; if ($this->offsetExists($index)) { $items = $this->offsetGet($index); if (!is_array($items)) { $itemsType = gettype($items); throw new \Exception("Offset '$index' is '$itemsType' and m...
[ "public", "function", "offsetAppend", "(", "$", "index", ",", "$", "value", ")", "{", "$", "items", "=", "[", "]", ";", "if", "(", "$", "this", "->", "offsetExists", "(", "$", "index", ")", ")", "{", "$", "items", "=", "$", "this", "->", "offsetG...
adds a value to an offset array, if there is an array @param mixed $index @param mixed $value @return bool
[ "adds", "a", "value", "to", "an", "offset", "array", "if", "there", "is", "an", "array" ]
8ea9d67cc84fe6aff17a469c703d5492dbcd93ed
https://github.com/mwyatt/core/blob/8ea9d67cc84fe6aff17a469c703d5492dbcd93ed/src/Iterator/Collection.php#L184-L196
196,728
maddoger/yii2-cms-user
common/models/User.php
User.getRoleDescription
public function getRoleDescription() { static $list = null; if ($list === null) { $list = static::getRoles(); } return (isset($list[$this->role])) ? $list[$this->role] : $this->role; }
php
public function getRoleDescription() { static $list = null; if ($list === null) { $list = static::getRoles(); } return (isset($list[$this->role])) ? $list[$this->role] : $this->role; }
[ "public", "function", "getRoleDescription", "(", ")", "{", "static", "$", "list", "=", "null", ";", "if", "(", "$", "list", "===", "null", ")", "{", "$", "list", "=", "static", "::", "getRoles", "(", ")", ";", "}", "return", "(", "isset", "(", "$",...
Role sting representation @return string
[ "Role", "sting", "representation" ]
6792d1d0d2c0bf01fe87729985b5659de4c1aac1
https://github.com/maddoger/yii2-cms-user/blob/6792d1d0d2c0bf01fe87729985b5659de4c1aac1/common/models/User.php#L292-L299
196,729
maddoger/yii2-cms-user
common/models/User.php
User.getStatusDescription
public function getStatusDescription() { static $list = null; if ($list === null) { $list = static::getStatuses(); } return (isset($list[$this->status])) ? $list[$this->status] : $this->status; }
php
public function getStatusDescription() { static $list = null; if ($list === null) { $list = static::getStatuses(); } return (isset($list[$this->status])) ? $list[$this->status] : $this->status; }
[ "public", "function", "getStatusDescription", "(", ")", "{", "static", "$", "list", "=", "null", ";", "if", "(", "$", "list", "===", "null", ")", "{", "$", "list", "=", "static", "::", "getStatuses", "(", ")", ";", "}", "return", "(", "isset", "(", ...
Status sting representation @return string
[ "Status", "sting", "representation" ]
6792d1d0d2c0bf01fe87729985b5659de4c1aac1
https://github.com/maddoger/yii2-cms-user/blob/6792d1d0d2c0bf01fe87729985b5659de4c1aac1/common/models/User.php#L305-L312
196,730
maddoger/yii2-cms-user
common/models/User.php
User.findByEmail
public static function findByEmail($email, $checkStatus = true) { return static::findOne( $checkStatus ? ['email' => $email, 'status' => self::STATUS_ACTIVE] : ['email' => $email] ); }
php
public static function findByEmail($email, $checkStatus = true) { return static::findOne( $checkStatus ? ['email' => $email, 'status' => self::STATUS_ACTIVE] : ['email' => $email] ); }
[ "public", "static", "function", "findByEmail", "(", "$", "email", ",", "$", "checkStatus", "=", "true", ")", "{", "return", "static", "::", "findOne", "(", "$", "checkStatus", "?", "[", "'email'", "=>", "$", "email", ",", "'status'", "=>", "self", "::", ...
Finds user by email @param string $email @param bool $checkStatus @return null|static
[ "Finds", "user", "by", "email" ]
6792d1d0d2c0bf01fe87729985b5659de4c1aac1
https://github.com/maddoger/yii2-cms-user/blob/6792d1d0d2c0bf01fe87729985b5659de4c1aac1/common/models/User.php#L358-L365
196,731
maddoger/yii2-cms-user
common/models/User.php
User.findByUsernameOrEmail
public static function findByUsernameOrEmail($username, $checkStatus = true) { $query = static::find(); $query->where(['or', ['username' => $username], ['email' => $username]]); if ($checkStatus) { $query->andWhere(['status' => self::STATUS_ACTIVE]); } return $que...
php
public static function findByUsernameOrEmail($username, $checkStatus = true) { $query = static::find(); $query->where(['or', ['username' => $username], ['email' => $username]]); if ($checkStatus) { $query->andWhere(['status' => self::STATUS_ACTIVE]); } return $que...
[ "public", "static", "function", "findByUsernameOrEmail", "(", "$", "username", ",", "$", "checkStatus", "=", "true", ")", "{", "$", "query", "=", "static", "::", "find", "(", ")", ";", "$", "query", "->", "where", "(", "[", "'or'", ",", "[", "'username...
Finds user by username or email @param string $username @param bool $checkStatus @return null|static
[ "Finds", "user", "by", "username", "or", "email" ]
6792d1d0d2c0bf01fe87729985b5659de4c1aac1
https://github.com/maddoger/yii2-cms-user/blob/6792d1d0d2c0bf01fe87729985b5659de4c1aac1/common/models/User.php#L374-L382
196,732
maddoger/yii2-cms-user
common/models/User.php
User.updateLastVisit
public static function updateLastVisit($event) { if ($event->isValid) { /** * @var User $user */ $user = $event->identity; $user->last_visit_at = time(); $user->updateAttributes(['last_visit_at']); return true; } ...
php
public static function updateLastVisit($event) { if ($event->isValid) { /** * @var User $user */ $user = $event->identity; $user->last_visit_at = time(); $user->updateAttributes(['last_visit_at']); return true; } ...
[ "public", "static", "function", "updateLastVisit", "(", "$", "event", ")", "{", "if", "(", "$", "event", "->", "isValid", ")", "{", "/**\n * @var User $user\n */", "$", "user", "=", "$", "event", "->", "identity", ";", "$", "user", "->"...
Update last visit time event handler in user component: 'on afterLogin' => ['maddoger\user\common\models\User', 'updateLastVisit'], 'on afterLogout' => ['maddoger\user\common\models\User', 'updateLastVisit'], @param $event @return bool
[ "Update", "last", "visit", "time", "event", "handler" ]
6792d1d0d2c0bf01fe87729985b5659de4c1aac1
https://github.com/maddoger/yii2-cms-user/blob/6792d1d0d2c0bf01fe87729985b5659de4c1aac1/common/models/User.php#L472-L484
196,733
agentmedia/phine-core
src/Core/Logic/Sitemap/Generator.php
Generator.Generate
function Generate() { if ($this->cacher->MustUseCache()) { $this->xml = $this->cacher->GetFromCache(); return; } $this->AddAllPages(); $this->xml = $this->sitemap->SaveXml(); if ($this->cacher->MustStoreToCache()) { $this->c...
php
function Generate() { if ($this->cacher->MustUseCache()) { $this->xml = $this->cacher->GetFromCache(); return; } $this->AddAllPages(); $this->xml = $this->sitemap->SaveXml(); if ($this->cacher->MustStoreToCache()) { $this->c...
[ "function", "Generate", "(", ")", "{", "if", "(", "$", "this", "->", "cacher", "->", "MustUseCache", "(", ")", ")", "{", "$", "this", "->", "xml", "=", "$", "this", "->", "cacher", "->", "GetFromCache", "(", ")", ";", "return", ";", "}", "$", "th...
Generates the xml by pulling it from cache or generating it @return string
[ "Generates", "the", "xml", "by", "pulling", "it", "from", "cache", "or", "generating", "it" ]
38c1be8d03ebffae950d00a96da3c612aff67832
https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Sitemap/Generator.php#L82-L95
196,734
agentmedia/phine-core
src/Core/Logic/Sitemap/Generator.php
Generator.AddAllPages
private function AddAllPages() { $page = $this->pageTree->TopMost(); while ($page) { $this->AddPageBranch($page); $page = $this->pageTree->NextOf($page); } }
php
private function AddAllPages() { $page = $this->pageTree->TopMost(); while ($page) { $this->AddPageBranch($page); $page = $this->pageTree->NextOf($page); } }
[ "private", "function", "AddAllPages", "(", ")", "{", "$", "page", "=", "$", "this", "->", "pageTree", "->", "TopMost", "(", ")", ";", "while", "(", "$", "page", ")", "{", "$", "this", "->", "AddPageBranch", "(", "$", "page", ")", ";", "$", "page", ...
The entry point for fetching all pages as sitemap
[ "The", "entry", "point", "for", "fetching", "all", "pages", "as", "sitemap" ]
38c1be8d03ebffae950d00a96da3c612aff67832
https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Sitemap/Generator.php#L99-L107
196,735
agentmedia/phine-core
src/Core/Logic/Sitemap/Generator.php
Generator.AddPageBranch
private function AddPageBranch(Page $page) { $this->AddPage($page); $child = $this->pageTree->FirstChildOf($page); while ($child) { $this->AddPageBranch($child); $child = $this->pageTree->NextOf($child); } }
php
private function AddPageBranch(Page $page) { $this->AddPage($page); $child = $this->pageTree->FirstChildOf($page); while ($child) { $this->AddPageBranch($child); $child = $this->pageTree->NextOf($child); } }
[ "private", "function", "AddPageBranch", "(", "Page", "$", "page", ")", "{", "$", "this", "->", "AddPage", "(", "$", "page", ")", ";", "$", "child", "=", "$", "this", "->", "pageTree", "->", "FirstChildOf", "(", "$", "page", ")", ";", "while", "(", ...
Adds a page and all of its children @param Page $page The current page
[ "Adds", "a", "page", "and", "all", "of", "its", "children" ]
38c1be8d03ebffae950d00a96da3c612aff67832
https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Sitemap/Generator.php#L114-L123
196,736
agentmedia/phine-core
src/Core/Logic/Sitemap/Generator.php
Generator.AddPage
private function AddPage(Page $page) { if (!$this->PageAllowed($page)) { return; } $params = FrontendRouter::GatherParams($page->GetUrl()); if (count($params) == 0) { $changeFreq = ChangeFrequency::ByValue($page->GetSitemapChangeFrequency()); ...
php
private function AddPage(Page $page) { if (!$this->PageAllowed($page)) { return; } $params = FrontendRouter::GatherParams($page->GetUrl()); if (count($params) == 0) { $changeFreq = ChangeFrequency::ByValue($page->GetSitemapChangeFrequency()); ...
[ "private", "function", "AddPage", "(", "Page", "$", "page", ")", "{", "if", "(", "!", "$", "this", "->", "PageAllowed", "(", "$", "page", ")", ")", "{", "return", ";", "}", "$", "params", "=", "FrontendRouter", "::", "GatherParams", "(", "$", "page",...
Adds a single page to the sitemap @param Page $page The page
[ "Adds", "a", "single", "page", "to", "the", "sitemap" ]
38c1be8d03ebffae950d00a96da3c612aff67832
https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Sitemap/Generator.php#L129-L144
196,737
modulusphp/utility
Mail.php
Mail.action
public function action(string $message, string $link, string $class = 'btn btn-primary') : Mail { $this->body .= "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"{$class}\"> <tbody> <tr> <td align=\"left\"> <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\"> <tbody> ...
php
public function action(string $message, string $link, string $class = 'btn btn-primary') : Mail { $this->body .= "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"{$class}\"> <tbody> <tr> <td align=\"left\"> <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\"> <tbody> ...
[ "public", "function", "action", "(", "string", "$", "message", ",", "string", "$", "link", ",", "string", "$", "class", "=", "'btn btn-primary'", ")", ":", "Mail", "{", "$", "this", "->", "body", ".=", "\"<table border=\\\"0\\\" cellpadding=\\\"0\\\" cellspacing=\...
Create a action @param string $message @param string $link @param string $class @return Mail
[ "Create", "a", "action" ]
c1e127539b13d3ec8381e41c64b881e0701807f5
https://github.com/modulusphp/utility/blob/c1e127539b13d3ec8381e41c64b881e0701807f5/Mail.php#L187-L208
196,738
modulusphp/utility
Mail.php
Mail.view
public function view(string $view, array $data = []) : Mail { $this->viewLocation = $view; $this->viewArgs = $data; return $this; }
php
public function view(string $view, array $data = []) : Mail { $this->viewLocation = $view; $this->viewArgs = $data; return $this; }
[ "public", "function", "view", "(", "string", "$", "view", ",", "array", "$", "data", "=", "[", "]", ")", ":", "Mail", "{", "$", "this", "->", "viewLocation", "=", "$", "view", ";", "$", "this", "->", "viewArgs", "=", "$", "data", ";", "return", "...
Set view email view @param string $view @param array $data @return Mail
[ "Set", "view", "email", "view" ]
c1e127539b13d3ec8381e41c64b881e0701807f5
https://github.com/modulusphp/utility/blob/c1e127539b13d3ec8381e41c64b881e0701807f5/Mail.php#L217-L222
196,739
modulusphp/utility
Mail.php
Mail.send
public function send(?string $message = null, ?string $subject = null) { if ($message != null) { $this->body = $message; } if ($subject != null) { $this->subject = $subject; } if ($this->viewLocation != null || $this->viewLocation !== '') { $this->render($this->viewLocation, $t...
php
public function send(?string $message = null, ?string $subject = null) { if ($message != null) { $this->body = $message; } if ($subject != null) { $this->subject = $subject; } if ($this->viewLocation != null || $this->viewLocation !== '') { $this->render($this->viewLocation, $t...
[ "public", "function", "send", "(", "?", "string", "$", "message", "=", "null", ",", "?", "string", "$", "subject", "=", "null", ")", "{", "if", "(", "$", "message", "!=", "null", ")", "{", "$", "this", "->", "body", "=", "$", "message", ";", "}",...
Finally send the email!!! @param mixed ?string @param mixed ?string @return void
[ "Finally", "send", "the", "email!!!" ]
c1e127539b13d3ec8381e41c64b881e0701807f5
https://github.com/modulusphp/utility/blob/c1e127539b13d3ec8381e41c64b881e0701807f5/Mail.php#L330-L394
196,740
phossa/phossa-di
src/Phossa/Di/Definition/Loader/LoaderXml.php
LoaderXml.xmlToArray
protected static function xmlToArray(\SimpleXMLElement $xml)/*# : array */ { $arr = array(); foreach ($xml as $element) { $tag = $element->getName(); $ele = get_object_vars($element); if (!empty($ele)) { $arr[$tag] = $element instanceof \SimpleXMLE...
php
protected static function xmlToArray(\SimpleXMLElement $xml)/*# : array */ { $arr = array(); foreach ($xml as $element) { $tag = $element->getName(); $ele = get_object_vars($element); if (!empty($ele)) { $arr[$tag] = $element instanceof \SimpleXMLE...
[ "protected", "static", "function", "xmlToArray", "(", "\\", "SimpleXMLElement", "$", "xml", ")", "/*# : array */", "{", "$", "arr", "=", "array", "(", ")", ";", "foreach", "(", "$", "xml", "as", "$", "element", ")", "{", "$", "tag", "=", "$", "element"...
Convert SimpleXML object to array @param \SimpleXMLElement $xml the xml object @return array @access protected @static
[ "Convert", "SimpleXML", "object", "to", "array" ]
bbe1e95b081068e2bc49c6cd465f38aab0374be5
https://github.com/phossa/phossa-di/blob/bbe1e95b081068e2bc49c6cd465f38aab0374be5/src/Phossa/Di/Definition/Loader/LoaderXml.php#L55-L70
196,741
agentmedia/phine-core
src/Core/Logic/Rendering/PageRenderer.php
PageRenderer.RenderArea
protected function RenderArea($name) { $area = $this->areas[$name]; if (!$area) { throw new \InvalidArgumentException("Invalid area name $name"); } $layoutAreaRenderer = new LayoutAreaRenderer($area); $result = $layoutAreaRenderer->Render(); ...
php
protected function RenderArea($name) { $area = $this->areas[$name]; if (!$area) { throw new \InvalidArgumentException("Invalid area name $name"); } $layoutAreaRenderer = new LayoutAreaRenderer($area); $result = $layoutAreaRenderer->Render(); ...
[ "protected", "function", "RenderArea", "(", "$", "name", ")", "{", "$", "area", "=", "$", "this", "->", "areas", "[", "$", "name", "]", ";", "if", "(", "!", "$", "area", ")", "{", "throw", "new", "\\", "InvalidArgumentException", "(", "\"Invalid area n...
Renders the area with the given name @param string $name The area name @return string Returns the rendering output for the area @throws \InvalidArgumentException Raises an exception on invalid area name
[ "Renders", "the", "area", "with", "the", "given", "name" ]
38c1be8d03ebffae950d00a96da3c612aff67832
https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Rendering/PageRenderer.php#L90-L103
196,742
agentmedia/phine-core
src/Core/Logic/Rendering/PageRenderer.php
PageRenderer.Render
function Render() { self::$currentPage = $this->page; self::$Title = self::$currentPage->GetTitle(); self::$Description = self::$currentPage->GetDescription(); self::$Keywords = self::$currentPage->GetKeywords(); if ($this->page->GetType() == (string)PageType::NotFound()) ...
php
function Render() { self::$currentPage = $this->page; self::$Title = self::$currentPage->GetTitle(); self::$Description = self::$currentPage->GetDescription(); self::$Keywords = self::$currentPage->GetKeywords(); if ($this->page->GetType() == (string)PageType::NotFound()) ...
[ "function", "Render", "(", ")", "{", "self", "::", "$", "currentPage", "=", "$", "this", "->", "page", ";", "self", "::", "$", "Title", "=", "self", "::", "$", "currentPage", "->", "GetTitle", "(", ")", ";", "self", "::", "$", "Description", "=", "...
Renders the complete page by requiring the page layout @return string Returns the page contents
[ "Renders", "the", "complete", "page", "by", "requiring", "the", "page", "layout" ]
38c1be8d03ebffae950d00a96da3c612aff67832
https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Rendering/PageRenderer.php#L109-L128
196,743
Polosa/shade-framework-core
app/Router/Wildcard.php
Wildcard.getRoute
protected function getRoute($destination) { $destinationPieces = explode('/', $destination); $mappingNode = $this->routeMapping; $argValues = array(); foreach($destinationPieces as $destinationPiece) { if (isset($mappingNode[$destinationPiece])) { $mappin...
php
protected function getRoute($destination) { $destinationPieces = explode('/', $destination); $mappingNode = $this->routeMapping; $argValues = array(); foreach($destinationPieces as $destinationPiece) { if (isset($mappingNode[$destinationPiece])) { $mappin...
[ "protected", "function", "getRoute", "(", "$", "destination", ")", "{", "$", "destinationPieces", "=", "explode", "(", "'/'", ",", "$", "destination", ")", ";", "$", "mappingNode", "=", "$", "this", "->", "routeMapping", ";", "$", "argValues", "=", "array"...
Get Route for given destination @param string $destination Destination @throws \Shade\Exception @return Route
[ "Get", "Route", "for", "given", "destination" ]
d735d3e8e0616fb9cf4ffc25b8425762ed07940f
https://github.com/Polosa/shade-framework-core/blob/d735d3e8e0616fb9cf4ffc25b8425762ed07940f/app/Router/Wildcard.php#L48-L86
196,744
Polosa/shade-framework-core
app/Router/Wildcard.php
Wildcard.addMapping
public function addMapping($destinationPattern, $controllerClass, $actionName) { $mapping = new Route\Mapping($destinationPattern, $controllerClass, $actionName); $this->reverseMapping[$controllerClass][$actionName] = $mapping; $destinationPieces = explode('/', $destinationPattern); ...
php
public function addMapping($destinationPattern, $controllerClass, $actionName) { $mapping = new Route\Mapping($destinationPattern, $controllerClass, $actionName); $this->reverseMapping[$controllerClass][$actionName] = $mapping; $destinationPieces = explode('/', $destinationPattern); ...
[ "public", "function", "addMapping", "(", "$", "destinationPattern", ",", "$", "controllerClass", ",", "$", "actionName", ")", "{", "$", "mapping", "=", "new", "Route", "\\", "Mapping", "(", "$", "destinationPattern", ",", "$", "controllerClass", ",", "$", "a...
Add route mapping @param string $destinationPattern Destination pattern @param string $controllerClass Controller class @param string $actionName Action name @return \Shade\Route\Mapping @throws Exception
[ "Add", "route", "mapping" ]
d735d3e8e0616fb9cf4ffc25b8425762ed07940f
https://github.com/Polosa/shade-framework-core/blob/d735d3e8e0616fb9cf4ffc25b8425762ed07940f/app/Router/Wildcard.php#L114-L139
196,745
Polosa/shade-framework-core
app/Controller/Profiler.php
Profiler.outputAction
public function outputAction($startTime, $showProfiler) { $data = ['showProfiler' => $showProfiler]; if ($showProfiler) { $data = [ 'showProfiler' => true, 'memory' => \Shade\Converter::formatBytes(memory_get_usage(true)), 'memoryPeak' => \...
php
public function outputAction($startTime, $showProfiler) { $data = ['showProfiler' => $showProfiler]; if ($showProfiler) { $data = [ 'showProfiler' => true, 'memory' => \Shade\Converter::formatBytes(memory_get_usage(true)), 'memoryPeak' => \...
[ "public", "function", "outputAction", "(", "$", "startTime", ",", "$", "showProfiler", ")", "{", "$", "data", "=", "[", "'showProfiler'", "=>", "$", "showProfiler", "]", ";", "if", "(", "$", "showProfiler", ")", "{", "$", "data", "=", "[", "'showProfiler...
Output profiler information @param string $startTime Application start time @param bool $showProfiler Is debug mode enabled @return \Shade\Response
[ "Output", "profiler", "information" ]
d735d3e8e0616fb9cf4ffc25b8425762ed07940f
https://github.com/Polosa/shade-framework-core/blob/d735d3e8e0616fb9cf4ffc25b8425762ed07940f/app/Controller/Profiler.php#L28-L41
196,746
AnonymPHP/Anonym-HttpFoundation
Response.php
Response.header
public function header($name, $value = null) { if ($value === null) { $this->headers[] = $name; } else { $this->headers[] = $this->headerString($name, $value); } return $this; }
php
public function header($name, $value = null) { if ($value === null) { $this->headers[] = $name; } else { $this->headers[] = $this->headerString($name, $value); } return $this; }
[ "public", "function", "header", "(", "$", "name", ",", "$", "value", "=", "null", ")", "{", "if", "(", "$", "value", "===", "null", ")", "{", "$", "this", "->", "headers", "[", "]", "=", "$", "name", ";", "}", "else", "{", "$", "this", "->", ...
Header kodu ekler mesaja @param $name @param null $value @return $this
[ "Header", "kodu", "ekler", "mesaja" ]
943e5f40f45bc2e11a4b9e1d22c6583c31dc4317
https://github.com/AnonymPHP/Anonym-HttpFoundation/blob/943e5f40f45bc2e11a4b9e1d22c6583c31dc4317/Response.php#L297-L307
196,747
bseddon/XPath20
lyquidity/Convert.php
Convert.ToChar
public static function ToChar( $value, $provider = null ) { if ( $value instanceof \DateTime ) { $value = Convert::ToString( $value, $provider ); if ( is_null( $value ) ) return null; } if ( is_string( $value ) && strlen( $value ) ) { return $value[0]; } else if ( is_numeric( $value...
php
public static function ToChar( $value, $provider = null ) { if ( $value instanceof \DateTime ) { $value = Convert::ToString( $value, $provider ); if ( is_null( $value ) ) return null; } if ( is_string( $value ) && strlen( $value ) ) { return $value[0]; } else if ( is_numeric( $value...
[ "public", "static", "function", "ToChar", "(", "$", "value", ",", "$", "provider", "=", "null", ")", "{", "if", "(", "$", "value", "instanceof", "\\", "DateTime", ")", "{", "$", "value", "=", "Convert", "::", "ToString", "(", "$", "value", ",", "$", ...
Converts the value of this instance to an equivalent Unicode character using the specified culture-specific formatting information. @param object $value The value to convert @param IFormatProvider $provider An interface implementation that supplies culture-specific formatting information. @return char A Unicode charac...
[ "Converts", "the", "value", "of", "this", "instance", "to", "an", "equivalent", "Unicode", "character", "using", "the", "specified", "culture", "-", "specific", "formatting", "information", "." ]
69882b6efffaa5470a819d5fdd2f6473ddeb046d
https://github.com/bseddon/XPath20/blob/69882b6efffaa5470a819d5fdd2f6473ddeb046d/lyquidity/Convert.php#L87-L106
196,748
bseddon/XPath20
lyquidity/Convert.php
Convert.ChangeType
public static function ChangeType( $value, $conversionType, $provider = null ) { return Convert::ToType( $value, $conversionType, $provider ); }
php
public static function ChangeType( $value, $conversionType, $provider = null ) { return Convert::ToType( $value, $conversionType, $provider ); }
[ "public", "static", "function", "ChangeType", "(", "$", "value", ",", "$", "conversionType", ",", "$", "provider", "=", "null", ")", "{", "return", "Convert", "::", "ToType", "(", "$", "value", ",", "$", "conversionType", ",", "$", "provider", ")", ";", ...
ChangeType an alias for ToType @param object $value @param Type $conversionType @param NodeProvider $provider (optional) @return object
[ "ChangeType", "an", "alias", "for", "ToType" ]
69882b6efffaa5470a819d5fdd2f6473ddeb046d
https://github.com/bseddon/XPath20/blob/69882b6efffaa5470a819d5fdd2f6473ddeb046d/lyquidity/Convert.php#L115-L118
196,749
bseddon/XPath20
lyquidity/Convert.php
Convert.ToDateTime
public static function ToDateTime( $value, $provider = null ) { if ( $value instanceof \DateTime ) return $value; if ( is_string( $value ) ) { $timestamp = strtotime( $value ); if ( $timestamp === false ) return null; /** * @var \DateTime $dt */ $dt = new \DateTime(); $dt-...
php
public static function ToDateTime( $value, $provider = null ) { if ( $value instanceof \DateTime ) return $value; if ( is_string( $value ) ) { $timestamp = strtotime( $value ); if ( $timestamp === false ) return null; /** * @var \DateTime $dt */ $dt = new \DateTime(); $dt-...
[ "public", "static", "function", "ToDateTime", "(", "$", "value", ",", "$", "provider", "=", "null", ")", "{", "if", "(", "$", "value", "instanceof", "\\", "DateTime", ")", "return", "$", "value", ";", "if", "(", "is_string", "(", "$", "value", ")", "...
Converts the value of this instance to an equivalent DateTime using the specified culture-specific formatting information. @param object $value The value to convert @param IFormatProvider $provider An interface implementation that supplies culture-specific formatting information. @return DateTime A DateTime instance e...
[ "Converts", "the", "value", "of", "this", "instance", "to", "an", "equivalent", "DateTime", "using", "the", "specified", "culture", "-", "specific", "formatting", "information", "." ]
69882b6efffaa5470a819d5fdd2f6473ddeb046d
https://github.com/bseddon/XPath20/blob/69882b6efffaa5470a819d5fdd2f6473ddeb046d/lyquidity/Convert.php#L128-L154
196,750
bseddon/XPath20
lyquidity/Convert.php
Convert.ToDecimal
public static function ToDecimal( $value, $provider = null ) { return is_double( $value ) ? DecimalValue::FromFloat( $value ) : new DecimalValue( $value ); // return Convert::ToDouble( $value, $provider ); }
php
public static function ToDecimal( $value, $provider = null ) { return is_double( $value ) ? DecimalValue::FromFloat( $value ) : new DecimalValue( $value ); // return Convert::ToDouble( $value, $provider ); }
[ "public", "static", "function", "ToDecimal", "(", "$", "value", ",", "$", "provider", "=", "null", ")", "{", "return", "is_double", "(", "$", "value", ")", "?", "DecimalValue", "::", "FromFloat", "(", "$", "value", ")", ":", "new", "DecimalValue", "(", ...
Converts the value of this instance to an equivalent System.Decimal number using the specified culture-specific formatting information. @param object $value The value to convert @param IFormatProvider $provider An implementation that supplies culture-specific formatting information. @return DecimalValue A Decimal numb...
[ "Converts", "the", "value", "of", "this", "instance", "to", "an", "equivalent", "System", ".", "Decimal", "number", "using", "the", "specified", "culture", "-", "specific", "formatting", "information", "." ]
69882b6efffaa5470a819d5fdd2f6473ddeb046d
https://github.com/bseddon/XPath20/blob/69882b6efffaa5470a819d5fdd2f6473ddeb046d/lyquidity/Convert.php#L164-L170
196,751
bseddon/XPath20
lyquidity/Convert.php
Convert.ToDouble
public static function ToDouble( $value, $provider = null ) { if ( $value instanceof \DateTime ) { return NAN; // $value->getTimestamp() + 0.0; } else if ( ( is_numeric( $value ) && $value == INF ) || ( is_string( $value ) && strtoupper( $value ) == "INF" ) ) { return INF; } else if ( ( i...
php
public static function ToDouble( $value, $provider = null ) { if ( $value instanceof \DateTime ) { return NAN; // $value->getTimestamp() + 0.0; } else if ( ( is_numeric( $value ) && $value == INF ) || ( is_string( $value ) && strtoupper( $value ) == "INF" ) ) { return INF; } else if ( ( i...
[ "public", "static", "function", "ToDouble", "(", "$", "value", ",", "$", "provider", "=", "null", ")", "{", "if", "(", "$", "value", "instanceof", "\\", "DateTime", ")", "{", "return", "NAN", ";", "// $value->getTimestamp() + 0.0;\r", "}", "else", "if", "(...
Converts the value of this instance to an equivalent double-precision floating-point number using the specified culture-specific formatting information. @param object $value The value to convert @param IFormatProvider $provider An interface implementation that supplies culture-specific formatting information. @return ...
[ "Converts", "the", "value", "of", "this", "instance", "to", "an", "equivalent", "double", "-", "precision", "floating", "-", "point", "number", "using", "the", "specified", "culture", "-", "specific", "formatting", "information", "." ]
69882b6efffaa5470a819d5fdd2f6473ddeb046d
https://github.com/bseddon/XPath20/blob/69882b6efffaa5470a819d5fdd2f6473ddeb046d/lyquidity/Convert.php#L180-L244
196,752
bseddon/XPath20
lyquidity/Convert.php
Convert.ToString
public static function ToString( $value, $provider = null ) { if ( $value instanceof XPath2Item ) { return $value->getValue(); } if ( $value instanceof \DateTime ) { // Use locale information to create a formatted string $collator = \Collator::create( null ); $locale = $collator->getL...
php
public static function ToString( $value, $provider = null ) { if ( $value instanceof XPath2Item ) { return $value->getValue(); } if ( $value instanceof \DateTime ) { // Use locale information to create a formatted string $collator = \Collator::create( null ); $locale = $collator->getL...
[ "public", "static", "function", "ToString", "(", "$", "value", ",", "$", "provider", "=", "null", ")", "{", "if", "(", "$", "value", "instanceof", "XPath2Item", ")", "{", "return", "$", "value", "->", "getValue", "(", ")", ";", "}", "if", "(", "$", ...
Converts the value of this instance to an equivalent System.String using the specified culture-specific formatting information. @param object $value The value to convert @param IFormatProvider $provider An interface implementation that supplies culture-specific formatting information. @return string A string instance ...
[ "Converts", "the", "value", "of", "this", "instance", "to", "an", "equivalent", "System", ".", "String", "using", "the", "specified", "culture", "-", "specific", "formatting", "information", "." ]
69882b6efffaa5470a819d5fdd2f6473ddeb046d
https://github.com/bseddon/XPath20/blob/69882b6efffaa5470a819d5fdd2f6473ddeb046d/lyquidity/Convert.php#L254-L271
196,753
bseddon/XPath20
lyquidity/Convert.php
Convert.ToInt
public static function ToInt( $value, $provider = null ) { if ( $value instanceof ValueProxy ) { return $value->ToInt( $provider ); } if ( $value instanceof XPath2Item ) { return Convert::ToInt( $value->getTypedValue(), $provider ); // return $value->ToInt( $provider ); } if ( is_...
php
public static function ToInt( $value, $provider = null ) { if ( $value instanceof ValueProxy ) { return $value->ToInt( $provider ); } if ( $value instanceof XPath2Item ) { return Convert::ToInt( $value->getTypedValue(), $provider ); // return $value->ToInt( $provider ); } if ( is_...
[ "public", "static", "function", "ToInt", "(", "$", "value", ",", "$", "provider", "=", "null", ")", "{", "if", "(", "$", "value", "instanceof", "ValueProxy", ")", "{", "return", "$", "value", "->", "ToInt", "(", "$", "provider", ")", ";", "}", "if", ...
Converts the value of this instance to an equivalent integer using the specified culture-specific formatting information. @param object $value The value to convert @param IFormatProvider $provider An interface implementation that supplies culture-specific formatting information. @return int An 32-bit signed integer eq...
[ "Converts", "the", "value", "of", "this", "instance", "to", "an", "equivalent", "integer", "using", "the", "specified", "culture", "-", "specific", "formatting", "information", "." ]
69882b6efffaa5470a819d5fdd2f6473ddeb046d
https://github.com/bseddon/XPath20/blob/69882b6efffaa5470a819d5fdd2f6473ddeb046d/lyquidity/Convert.php#L281-L318
196,754
AltCtrlSupr/ACSPanel-Settings
Event/Subscribers/SettingsSubscriber.php
SettingsSubscriber.updateUserSettings
public function updateUserSettings(FilterUserFieldsEvent $userfields_filter) { $settings_manager = $userfields_filter->getContainer()->get('acs.setting_manager'); $user = $userfields_filter->getContainer()->get('security.context')->getToken()->getUser(); $fields_template = $userfields_filt...
php
public function updateUserSettings(FilterUserFieldsEvent $userfields_filter) { $settings_manager = $userfields_filter->getContainer()->get('acs.setting_manager'); $user = $userfields_filter->getContainer()->get('security.context')->getToken()->getUser(); $fields_template = $userfields_filt...
[ "public", "function", "updateUserSettings", "(", "FilterUserFieldsEvent", "$", "userfields_filter", ")", "{", "$", "settings_manager", "=", "$", "userfields_filter", "->", "getContainer", "(", ")", "->", "get", "(", "'acs.setting_manager'", ")", ";", "$", "user", ...
Create new added fields to user or missing fields
[ "Create", "new", "added", "fields", "to", "user", "or", "missing", "fields" ]
b1e363bf98d4c74368b3063abba0c77bb3a61230
https://github.com/AltCtrlSupr/ACSPanel-Settings/blob/b1e363bf98d4c74368b3063abba0c77bb3a61230/Event/Subscribers/SettingsSubscriber.php#L25-L37
196,755
aicouto/sheet
src/Sheet.php
Sheet.toArray
public function toArray($sheet_name,$ext=false) { if(!$ext){ $ext=pathinfo($sheet_name, PATHINFO_EXTENSION); } switch ($ext) { case 'csv': $reader = ReaderFactory::create(Type::CSV); break; case 'ods': $reader = ReaderFactory::create(Type::ODS); break; case ...
php
public function toArray($sheet_name,$ext=false) { if(!$ext){ $ext=pathinfo($sheet_name, PATHINFO_EXTENSION); } switch ($ext) { case 'csv': $reader = ReaderFactory::create(Type::CSV); break; case 'ods': $reader = ReaderFactory::create(Type::ODS); break; case ...
[ "public", "function", "toArray", "(", "$", "sheet_name", ",", "$", "ext", "=", "false", ")", "{", "if", "(", "!", "$", "ext", ")", "{", "$", "ext", "=", "pathinfo", "(", "$", "sheet_name", ",", "PATHINFO_EXTENSION", ")", ";", "}", "switch", "(", "$...
Converte uma planilha para array
[ "Converte", "uma", "planilha", "para", "array" ]
9cd7e850050208b3ab96e7a9fd82e88fd47151ce
https://github.com/aicouto/sheet/blob/9cd7e850050208b3ab96e7a9fd82e88fd47151ce/src/Sheet.php#L59-L92
196,756
aicouto/sheet
src/Sheet.php
Sheet.toSheet
public function toSheet($array, $sheet_name, $ext=false) { if(!$ext){ $ext=pathinfo($sheet_name, PATHINFO_EXTENSION); } switch ($ext) { case 'csv': $writer = WriterFactory::create(Type::CSV); break; case 'ods': $writer = WriterFactory::create(Type::ODS); break; ...
php
public function toSheet($array, $sheet_name, $ext=false) { if(!$ext){ $ext=pathinfo($sheet_name, PATHINFO_EXTENSION); } switch ($ext) { case 'csv': $writer = WriterFactory::create(Type::CSV); break; case 'ods': $writer = WriterFactory::create(Type::ODS); break; ...
[ "public", "function", "toSheet", "(", "$", "array", ",", "$", "sheet_name", ",", "$", "ext", "=", "false", ")", "{", "if", "(", "!", "$", "ext", ")", "{", "$", "ext", "=", "pathinfo", "(", "$", "sheet_name", ",", "PATHINFO_EXTENSION", ")", ";", "}"...
Converte um array de dados para uma planilha
[ "Converte", "um", "array", "de", "dados", "para", "uma", "planilha" ]
9cd7e850050208b3ab96e7a9fd82e88fd47151ce
https://github.com/aicouto/sheet/blob/9cd7e850050208b3ab96e7a9fd82e88fd47151ce/src/Sheet.php#L96-L121
196,757
Kris-Kuiper/sFire-Framework
src/Debugging/Debug.php
Debug.dump
public static function dump($data = null, $export = false) { if(false === is_bool($export)) { return trigger_error(sprintf('Argument 2 passed to %s() must be of the type boolean, "%s" given', __METHOD__, gettype($export)), E_USER_ERROR); } if($data === null || (true === is_string($data) && trim($data)...
php
public static function dump($data = null, $export = false) { if(false === is_bool($export)) { return trigger_error(sprintf('Argument 2 passed to %s() must be of the type boolean, "%s" given', __METHOD__, gettype($export)), E_USER_ERROR); } if($data === null || (true === is_string($data) && trim($data)...
[ "public", "static", "function", "dump", "(", "$", "data", "=", "null", ",", "$", "export", "=", "false", ")", "{", "if", "(", "false", "===", "is_bool", "(", "$", "export", ")", ")", "{", "return", "trigger_error", "(", "sprintf", "(", "'Argument 2 pas...
Advanced debugging of variables @param mixed $data @param boolean $export @return mixed
[ "Advanced", "debugging", "of", "variables" ]
deefe1d9d2b40e7326381e8dcd4f01f9aa61885c
https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/Debugging/Debug.php#L27-L49
196,758
Kris-Kuiper/sFire-Framework
src/Debugging/Debug.php
Debug.time
public static function time($key = null) { if(null !== $key && false === is_string($key)) { return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($key)), E_USER_ERROR); } if(count(static :: $time) === 0) { static :: $time = []; } ...
php
public static function time($key = null) { if(null !== $key && false === is_string($key)) { return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($key)), E_USER_ERROR); } if(count(static :: $time) === 0) { static :: $time = []; } ...
[ "public", "static", "function", "time", "(", "$", "key", "=", "null", ")", "{", "if", "(", "null", "!==", "$", "key", "&&", "false", "===", "is_string", "(", "$", "key", ")", ")", "{", "return", "trigger_error", "(", "sprintf", "(", "'Argument 1 passed...
Calculate process times by adding new times an exporting them @param string $key @return array
[ "Calculate", "process", "times", "by", "adding", "new", "times", "an", "exporting", "them" ]
deefe1d9d2b40e7326381e8dcd4f01f9aa61885c
https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/Debugging/Debug.php#L57-L86
196,759
sndsgd/http
src/http/HeaderCollection.php
HeaderCollection.has
public function has(string $key): bool { $key = $this->getKey($key, true); return isset($this->headers[$key]); }
php
public function has(string $key): bool { $key = $this->getKey($key, true); return isset($this->headers[$key]); }
[ "public", "function", "has", "(", "string", "$", "key", ")", ":", "bool", "{", "$", "key", "=", "$", "this", "->", "getKey", "(", "$", "key", ",", "true", ")", ";", "return", "isset", "(", "$", "this", "->", "headers", "[", "$", "key", "]", ")"...
Determine whether a particular header exists @param string $key The key to check for @return bool
[ "Determine", "whether", "a", "particular", "header", "exists" ]
e7f82010a66c6d3241a24ea82baf4593130c723b
https://github.com/sndsgd/http/blob/e7f82010a66c6d3241a24ea82baf4593130c723b/src/http/HeaderCollection.php#L25-L29
196,760
sndsgd/http
src/http/HeaderCollection.php
HeaderCollection.getKey
protected function getKey(string $key, bool $register = false): string { $lowercaseKey = strtolower($key); if (isset($this->keyMap[$lowercaseKey])) { $key = $this->keyMap[$lowercaseKey]; } elseif ($register) { $this->keyMap[$lowercaseKey] = $key; } ret...
php
protected function getKey(string $key, bool $register = false): string { $lowercaseKey = strtolower($key); if (isset($this->keyMap[$lowercaseKey])) { $key = $this->keyMap[$lowercaseKey]; } elseif ($register) { $this->keyMap[$lowercaseKey] = $key; } ret...
[ "protected", "function", "getKey", "(", "string", "$", "key", ",", "bool", "$", "register", "=", "false", ")", ":", "string", "{", "$", "lowercaseKey", "=", "strtolower", "(", "$", "key", ")", ";", "if", "(", "isset", "(", "$", "this", "->", "keyMap"...
Retrieve a key that can be used in a hashmap to prevent duplicate keys @param string $key @param bool $register Whether to register a new key @return string
[ "Retrieve", "a", "key", "that", "can", "be", "used", "in", "a", "hashmap", "to", "prevent", "duplicate", "keys" ]
e7f82010a66c6d3241a24ea82baf4593130c723b
https://github.com/sndsgd/http/blob/e7f82010a66c6d3241a24ea82baf4593130c723b/src/http/HeaderCollection.php#L38-L47
196,761
sndsgd/http
src/http/HeaderCollection.php
HeaderCollection.addMultiple
public function addMultiple(array $headers): HeaderCollection { foreach ($headers as $key => $value) { $key = $this->getKey($key, true); \sndsgd\Arr::addValue($this->headers, $key, $value); } return $this; }
php
public function addMultiple(array $headers): HeaderCollection { foreach ($headers as $key => $value) { $key = $this->getKey($key, true); \sndsgd\Arr::addValue($this->headers, $key, $value); } return $this; }
[ "public", "function", "addMultiple", "(", "array", "$", "headers", ")", ":", "HeaderCollection", "{", "foreach", "(", "$", "headers", "as", "$", "key", "=>", "$", "value", ")", "{", "$", "key", "=", "$", "this", "->", "getKey", "(", "$", "key", ",", ...
Add multiple headers @param array<string,string> $headers
[ "Add", "multiple", "headers" ]
e7f82010a66c6d3241a24ea82baf4593130c723b
https://github.com/sndsgd/http/blob/e7f82010a66c6d3241a24ea82baf4593130c723b/src/http/HeaderCollection.php#L90-L97
196,762
sndsgd/http
src/http/HeaderCollection.php
HeaderCollection.get
public function get(string $key): string { $key = $this->getKey($key); $value = $this->headers[$key] ?? ""; return is_array($value) ? implode(", ", $value) : $value; }
php
public function get(string $key): string { $key = $this->getKey($key); $value = $this->headers[$key] ?? ""; return is_array($value) ? implode(", ", $value) : $value; }
[ "public", "function", "get", "(", "string", "$", "key", ")", ":", "string", "{", "$", "key", "=", "$", "this", "->", "getKey", "(", "$", "key", ")", ";", "$", "value", "=", "$", "this", "->", "headers", "[", "$", "key", "]", "??", "\"\"", ";", ...
Get a header value @param string $key @return string
[ "Get", "a", "header", "value" ]
e7f82010a66c6d3241a24ea82baf4593130c723b
https://github.com/sndsgd/http/blob/e7f82010a66c6d3241a24ea82baf4593130c723b/src/http/HeaderCollection.php#L105-L110
196,763
sndsgd/http
src/http/HeaderCollection.php
HeaderCollection.getMultiple
public function getMultiple(string ...$keys): array { $ret = []; foreach ($keys as $key) { $ret[] = $this->get($key); } return $ret; }
php
public function getMultiple(string ...$keys): array { $ret = []; foreach ($keys as $key) { $ret[] = $this->get($key); } return $ret; }
[ "public", "function", "getMultiple", "(", "string", "...", "$", "keys", ")", ":", "array", "{", "$", "ret", "=", "[", "]", ";", "foreach", "(", "$", "keys", "as", "$", "key", ")", "{", "$", "ret", "[", "]", "=", "$", "this", "->", "get", "(", ...
Get multiple header values @param string ...$keys @return array<string>
[ "Get", "multiple", "header", "values" ]
e7f82010a66c6d3241a24ea82baf4593130c723b
https://github.com/sndsgd/http/blob/e7f82010a66c6d3241a24ea82baf4593130c723b/src/http/HeaderCollection.php#L118-L125
196,764
sndsgd/http
src/http/HeaderCollection.php
HeaderCollection.getStringifiedArray
public function getStringifiedArray(): array { $ret = []; foreach ($this->headers as $header => $value) { if (is_array($value)) { $value = implode(", ", $value); } $ret[] = "$header: $value"; } return $ret; }
php
public function getStringifiedArray(): array { $ret = []; foreach ($this->headers as $header => $value) { if (is_array($value)) { $value = implode(", ", $value); } $ret[] = "$header: $value"; } return $ret; }
[ "public", "function", "getStringifiedArray", "(", ")", ":", "array", "{", "$", "ret", "=", "[", "]", ";", "foreach", "(", "$", "this", "->", "headers", "as", "$", "header", "=>", "$", "value", ")", "{", "if", "(", "is_array", "(", "$", "value", ")"...
Retrieve an array of headers as strings @return array<string>
[ "Retrieve", "an", "array", "of", "headers", "as", "strings" ]
e7f82010a66c6d3241a24ea82baf4593130c723b
https://github.com/sndsgd/http/blob/e7f82010a66c6d3241a24ea82baf4593130c723b/src/http/HeaderCollection.php#L132-L142
196,765
nicmart/DomainSpecificQuery
src/Compiler/MatcherCompiler.php
MatcherCompiler.map
public function map($type, $transformation) { if (!is_callable($transformation)) throw new InvalidTransformationException('Transformations must be callable objects'); foreach ((array) $type as $t) { $this->getMatcher()->rule('type', $t, $transformation); } r...
php
public function map($type, $transformation) { if (!is_callable($transformation)) throw new InvalidTransformationException('Transformations must be callable objects'); foreach ((array) $type as $t) { $this->getMatcher()->rule('type', $t, $transformation); } r...
[ "public", "function", "map", "(", "$", "type", ",", "$", "transformation", ")", "{", "if", "(", "!", "is_callable", "(", "$", "transformation", ")", ")", "throw", "new", "InvalidTransformationException", "(", "'Transformations must be callable objects'", ")", ";",...
Register a map for the compiler, that matches on type @param string|array $type The type/s of the expressions that will be transformed @param callable $transformation The transformation @throws InvalidTransformationException @return $this The current instance
[ "Register", "a", "map", "for", "the", "compiler", "that", "matches", "on", "type" ]
7c01fe94337afdfae5884809e8b5487127a63ac3
https://github.com/nicmart/DomainSpecificQuery/blob/7c01fe94337afdfae5884809e8b5487127a63ac3/src/Compiler/MatcherCompiler.php#L88-L98
196,766
lasallecms/lasallecms-l5-usermanagement-pkg
src/Http/Controllers/Frontendauth/Register2faUserController.php
Register2faUserController.post2faRegisterDisplayForm
public function post2faRegisterDisplayForm(Request $request) { if (config('lasallecmsusermanagement.auth_users_registration_front_end_require_terms_of_service')) { if (!$request->input('terms-of-service')) { return redirect()->route('auth.register') ->withInput($...
php
public function post2faRegisterDisplayForm(Request $request) { if (config('lasallecmsusermanagement.auth_users_registration_front_end_require_terms_of_service')) { if (!$request->input('terms-of-service')) { return redirect()->route('auth.register') ->withInput($...
[ "public", "function", "post2faRegisterDisplayForm", "(", "Request", "$", "request", ")", "{", "if", "(", "config", "(", "'lasallecmsusermanagement.auth_users_registration_front_end_require_terms_of_service'", ")", ")", "{", "if", "(", "!", "$", "request", "->", "input",...
The front-end 2FA registration form comes here. This method validates the form data only. This validation occurs via the command bus as usual; however, I modified the command bus flow to accommodate this special validation-only. So far (v1.01), this is the one-and-only time where any changes to the command bus are hap...
[ "The", "front", "-", "end", "2FA", "registration", "form", "comes", "here", "." ]
b5203d596e18e2566e7fdcd3f13868bb44a94c1d
https://github.com/lasallecms/lasallecms-l5-usermanagement-pkg/blob/b5203d596e18e2566e7fdcd3f13868bb44a94c1d/src/Http/Controllers/Frontendauth/Register2faUserController.php#L135-L182
196,767
itkg/core
src/Itkg/Core/Command/DatabaseList/Finder.php
Finder.findAll
public function findAll() { $files = array(); foreach (new \DirectoryIterator($this->path) as $file) { if ($file->isDot()) { continue; } $files[] = $file->getFilename(); } sort($files); return $files; }
php
public function findAll() { $files = array(); foreach (new \DirectoryIterator($this->path) as $file) { if ($file->isDot()) { continue; } $files[] = $file->getFilename(); } sort($files); return $files; }
[ "public", "function", "findAll", "(", ")", "{", "$", "files", "=", "array", "(", ")", ";", "foreach", "(", "new", "\\", "DirectoryIterator", "(", "$", "this", "->", "path", ")", "as", "$", "file", ")", "{", "if", "(", "$", "file", "->", "isDot", ...
Find all releases @return array
[ "Find", "all", "releases" ]
e5e4efb05feb4d23b0df41f2b21fd095103e593b
https://github.com/itkg/core/blob/e5e4efb05feb4d23b0df41f2b21fd095103e593b/src/Itkg/Core/Command/DatabaseList/Finder.php#L35-L49
196,768
endroid/tile
src/Twig/Extension/TileExtension.php
TileExtension.tileUrlFunction
public function tileUrlFunction($text, $extension = 'png') { $router = $this->container->get('router'); $url = $router->generate('tile', [ 'text' => $text, 'extension' => $extension, ]); return $url; }
php
public function tileUrlFunction($text, $extension = 'png') { $router = $this->container->get('router'); $url = $router->generate('tile', [ 'text' => $text, 'extension' => $extension, ]); return $url; }
[ "public", "function", "tileUrlFunction", "(", "$", "text", ",", "$", "extension", "=", "'png'", ")", "{", "$", "router", "=", "$", "this", "->", "container", "->", "get", "(", "'router'", ")", ";", "$", "url", "=", "$", "router", "->", "generate", "(...
Creates the QR code URL corresponding to the given message and extension. @param $text @param string $extension @return mixed
[ "Creates", "the", "QR", "code", "URL", "corresponding", "to", "the", "given", "message", "and", "extension", "." ]
db7a3556f511f873073b154c13cf49a8b9fe69b0
https://github.com/endroid/tile/blob/db7a3556f511f873073b154c13cf49a8b9fe69b0/src/Twig/Extension/TileExtension.php#L52-L61
196,769
togucms/FrontendBundle
Controller/ContentController.php
ContentController.typeAction
public function typeAction($contentDocument, $_format, Request $request) { if (!$contentDocument || ! $contentDocument instanceof Page) { throw new NotFoundHttpException('Content not found'); } if ($this->container->has('profiler')) { $this->container->get('profiler')->d...
php
public function typeAction($contentDocument, $_format, Request $request) { if (!$contentDocument || ! $contentDocument instanceof Page) { throw new NotFoundHttpException('Content not found'); } if ($this->container->has('profiler')) { $this->container->get('profiler')->d...
[ "public", "function", "typeAction", "(", "$", "contentDocument", ",", "$", "_format", ",", "Request", "$", "request", ")", "{", "if", "(", "!", "$", "contentDocument", "||", "!", "$", "contentDocument", "instanceof", "Page", ")", "{", "throw", "new", "NotF...
This action is mapped in the controller_by_type map This can inject something else for the template for content with this type @param object $contentDocument @return Response
[ "This", "action", "is", "mapped", "in", "the", "controller_by_type", "map" ]
fd165aca0fb6498ce85b39c1ff536cc1bd8ba285
https://github.com/togucms/FrontendBundle/blob/fd165aca0fb6498ce85b39c1ff536cc1bd8ba285/Controller/ContentController.php#L65-L87
196,770
DaGhostman/codewave
src/Flash/Manager.php
Manager.getMessage
public function getMessage($type, $id = null) { $result = null; if (null === $id) { if (array_key_exists($type, $this->messages)) { $result = $this->messages[$type]; if (!$this->persistMessages) { unset($this->messages[$type]); ...
php
public function getMessage($type, $id = null) { $result = null; if (null === $id) { if (array_key_exists($type, $this->messages)) { $result = $this->messages[$type]; if (!$this->persistMessages) { unset($this->messages[$type]); ...
[ "public", "function", "getMessage", "(", "$", "type", ",", "$", "id", "=", "null", ")", "{", "$", "result", "=", "null", ";", "if", "(", "null", "===", "$", "id", ")", "{", "if", "(", "array_key_exists", "(", "$", "type", ",", "$", "this", "->", ...
Retrieve a message @param mixed $type The type of the messages to retrieve. @param string $id The ID of the message @return null|Message|\Wave\Framework\Flash\Message[]
[ "Retrieve", "a", "message" ]
f0f58e721699cdaaf87cbfaf8ce589a6b3c473b8
https://github.com/DaGhostman/codewave/blob/f0f58e721699cdaaf87cbfaf8ce589a6b3c473b8/src/Flash/Manager.php#L84-L109
196,771
rzajac/phptools
src/Helper/Num.php
Num.equalWithin
public static function equalWithin($a, $b, $delta) { if (is_infinite($a) xor is_infinite($b)) { return false; } if (is_nan($a) || is_nan($b) || is_nan($delta)) { return false; } return abs($a - $b) <= $delta; }
php
public static function equalWithin($a, $b, $delta) { if (is_infinite($a) xor is_infinite($b)) { return false; } if (is_nan($a) || is_nan($b) || is_nan($delta)) { return false; } return abs($a - $b) <= $delta; }
[ "public", "static", "function", "equalWithin", "(", "$", "a", ",", "$", "b", ",", "$", "delta", ")", "{", "if", "(", "is_infinite", "(", "$", "a", ")", "xor", "is_infinite", "(", "$", "b", ")", ")", "{", "return", "false", ";", "}", "if", "(", ...
Are two numbers equal within given delta. @param int|float $a @param int|float $b @param int|float $delta @return bool
[ "Are", "two", "numbers", "equal", "within", "given", "delta", "." ]
3cbece7645942d244603c14ba897d8a676ee3088
https://github.com/rzajac/phptools/blob/3cbece7645942d244603c14ba897d8a676ee3088/src/Helper/Num.php#L36-L47
196,772
netzmacht-archive/subcolumns_bootstrap_customizable
src/system/modules/subcolumns_bootstrap_customizable/classes/Netzmacht/ColumnSet/colsetStart.php
colsetStart.compile
protected function compile() { parent::compile(); if($GLOBALS['TL_CONFIG']['subcolumns'] == 'bootstrap_customizable') { $container = ColumnSet::prepareContainer($this->columnset_id); if($container) { $this->Template->column = $container[$this->sc_sortid][0] . ' col_' . ($this->sc_sortid+1) . (($this...
php
protected function compile() { parent::compile(); if($GLOBALS['TL_CONFIG']['subcolumns'] == 'bootstrap_customizable') { $container = ColumnSet::prepareContainer($this->columnset_id); if($container) { $this->Template->column = $container[$this->sc_sortid][0] . ' col_' . ($this->sc_sortid+1) . (($this...
[ "protected", "function", "compile", "(", ")", "{", "parent", "::", "compile", "(", ")", ";", "if", "(", "$", "GLOBALS", "[", "'TL_CONFIG'", "]", "[", "'subcolumns'", "]", "==", "'bootstrap_customizable'", ")", "{", "$", "container", "=", "ColumnSet", "::",...
extends subcolumns compile method for generating dynamically column set
[ "extends", "subcolumns", "compile", "method", "for", "generating", "dynamically", "column", "set" ]
c0f63755282451fad670ceaa49b984bfabf9e4ee
https://github.com/netzmacht-archive/subcolumns_bootstrap_customizable/blob/c0f63755282451fad670ceaa49b984bfabf9e4ee/src/system/modules/subcolumns_bootstrap_customizable/classes/Netzmacht/ColumnSet/colsetStart.php#L30-L42
196,773
t3v/t3v_core
Classes/Utility/RendererUtility.php
RendererUtility.getFluidRendererForTemplate
public function getFluidRendererForTemplate(string $template, string $format = 'html') { $configurationManager = $this->objectManager->get(ConfigurationManagerInterface::class); $configuration = $configurationManager->getConfiguration(ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK); $lay...
php
public function getFluidRendererForTemplate(string $template, string $format = 'html') { $configurationManager = $this->objectManager->get(ConfigurationManagerInterface::class); $configuration = $configurationManager->getConfiguration(ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK); $lay...
[ "public", "function", "getFluidRendererForTemplate", "(", "string", "$", "template", ",", "string", "$", "format", "=", "'html'", ")", "{", "$", "configurationManager", "=", "$", "this", "->", "objectManager", "->", "get", "(", "ConfigurationManagerInterface", "::...
Gets a Fluid renderer for a template. @param string $template The template @param string $format The optional format, `html` is used as default @return \TYPO3\CMS\Fluid\View\StandaloneView The renderer for the template
[ "Gets", "a", "Fluid", "renderer", "for", "a", "template", "." ]
8c04b7688cc2773f11fcc87fda3f7cd53d80a980
https://github.com/t3v/t3v_core/blob/8c04b7688cc2773f11fcc87fda3f7cd53d80a980/Classes/Utility/RendererUtility.php#L30-L70
196,774
squareproton/Bond
src/Bond/Flock.php
Flock.merge
public function merge( array $members ) { foreach( $members as $offset => $value ) { $this->offsetSet( $offset, $value ); } return $this; }
php
public function merge( array $members ) { foreach( $members as $offset => $value ) { $this->offsetSet( $offset, $value ); } return $this; }
[ "public", "function", "merge", "(", "array", "$", "members", ")", "{", "foreach", "(", "$", "members", "as", "$", "offset", "=>", "$", "value", ")", "{", "$", "this", "->", "offsetSet", "(", "$", "offset", ",", "$", "value", ")", ";", "}", "return"...
Merge a array of potential members into the flock replacing as required @param array $members @return Bond\Flock
[ "Merge", "a", "array", "of", "potential", "members", "into", "the", "flock", "replacing", "as", "required" ]
a04ad9dd1a35adeaec98237716c2a41ce02b4f1a
https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/Flock.php#L71-L77
196,775
squareproton/Bond
src/Bond/Flock.php
Flock.add
public function add() { $args = func_get_args(); foreach( $args as $arg ) { if( is_array($arg) ) { foreach( $arg as $value ) { $this[] = $value; } } else { $this[] = $arg; } } retu...
php
public function add() { $args = func_get_args(); foreach( $args as $arg ) { if( is_array($arg) ) { foreach( $arg as $value ) { $this[] = $value; } } else { $this[] = $arg; } } retu...
[ "public", "function", "add", "(", ")", "{", "$", "args", "=", "func_get_args", "(", ")", ";", "foreach", "(", "$", "args", "as", "$", "arg", ")", "{", "if", "(", "is_array", "(", "$", "arg", ")", ")", "{", "foreach", "(", "$", "arg", "as", "$",...
Add items to this flock @return $this;
[ "Add", "items", "to", "this", "flock" ]
a04ad9dd1a35adeaec98237716c2a41ce02b4f1a
https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/Flock.php#L83-L96
196,776
squareproton/Bond
src/Bond/Flock.php
Flock.remove
public function remove( $member ) { if( false !== $key = array_search( $member, $this->members, true ) ) { unset( $this->members[$key] ); } return $this; }
php
public function remove( $member ) { if( false !== $key = array_search( $member, $this->members, true ) ) { unset( $this->members[$key] ); } return $this; }
[ "public", "function", "remove", "(", "$", "member", ")", "{", "if", "(", "false", "!==", "$", "key", "=", "array_search", "(", "$", "member", ",", "$", "this", "->", "members", ",", "true", ")", ")", "{", "unset", "(", "$", "this", "->", "members",...
Remove a member from the flock @param Member @return Bond\Flock
[ "Remove", "a", "member", "from", "the", "flock" ]
a04ad9dd1a35adeaec98237716c2a41ce02b4f1a
https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/Flock.php#L113-L119
196,777
squareproton/Bond
src/Bond/Flock.php
Flock.makeCheckCallback
private function makeCheckCallback( $check ) { // callable if( is_callable($check) ) { $this->check = $check; $this->type = $this->makeCallbackHumanReadable( $check ); return; } // class or obj if( is_object($check) ) { $class ...
php
private function makeCheckCallback( $check ) { // callable if( is_callable($check) ) { $this->check = $check; $this->type = $this->makeCallbackHumanReadable( $check ); return; } // class or obj if( is_object($check) ) { $class ...
[ "private", "function", "makeCheckCallback", "(", "$", "check", ")", "{", "// callable", "if", "(", "is_callable", "(", "$", "check", ")", ")", "{", "$", "this", "->", "check", "=", "$", "check", ";", "$", "this", "->", "type", "=", "$", "this", "->",...
Make check callback for flock @return Callable
[ "Make", "check", "callback", "for", "flock" ]
a04ad9dd1a35adeaec98237716c2a41ce02b4f1a
https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/Flock.php#L214-L235
196,778
squareproton/Bond
src/Bond/Flock.php
Flock.makeCallbackHumanReadable
private function makeCallbackHumanReadable( Callable $callback ) { if( is_string($callback) ) { return $callback; } elseif( is_array($callback) ) { return sprintf( "%s::%s", is_object( $callback[0] ) ? get_class($callback[0]) : $callback[0], ...
php
private function makeCallbackHumanReadable( Callable $callback ) { if( is_string($callback) ) { return $callback; } elseif( is_array($callback) ) { return sprintf( "%s::%s", is_object( $callback[0] ) ? get_class($callback[0]) : $callback[0], ...
[ "private", "function", "makeCallbackHumanReadable", "(", "Callable", "$", "callback", ")", "{", "if", "(", "is_string", "(", "$", "callback", ")", ")", "{", "return", "$", "callback", ";", "}", "elseif", "(", "is_array", "(", "$", "callback", ")", ")", "...
Return a string which is a best human readable representation the callback possible @param Callable $callback @return string
[ "Return", "a", "string", "which", "is", "a", "best", "human", "readable", "representation", "the", "callback", "possible" ]
a04ad9dd1a35adeaec98237716c2a41ce02b4f1a
https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/Flock.php#L242-L256
196,779
quantaphp/container-compilation
src/CompiledFactoryMap.php
CompiledFactoryMap.isPathWritable
private function isPathWritable(): bool { if (! file_exists($this->path)) { return is_writable(dirname($this->path)); } return is_writable($this->path); }
php
private function isPathWritable(): bool { if (! file_exists($this->path)) { return is_writable(dirname($this->path)); } return is_writable($this->path); }
[ "private", "function", "isPathWritable", "(", ")", ":", "bool", "{", "if", "(", "!", "file_exists", "(", "$", "this", "->", "path", ")", ")", "{", "return", "is_writable", "(", "dirname", "(", "$", "this", "->", "path", ")", ")", ";", "}", "return", ...
Return whether the path is writable. @return bool
[ "Return", "whether", "the", "path", "is", "writable", "." ]
411ed1b23b50b3362897f2a9a81147bbd4f478e6
https://github.com/quantaphp/container-compilation/blob/411ed1b23b50b3362897f2a9a81147bbd4f478e6/src/CompiledFactoryMap.php#L101-L108
196,780
quantaphp/container-compilation
src/CompiledFactoryMap.php
CompiledFactoryMap.write
private function write(array $compiled): void { $tmp = tempnam(sys_get_temp_dir(), 'quanta'); if ($tmp !== false) { file_put_contents($tmp, vsprintf('<?php%s%sreturn %s;%s', [ PHP_EOL, PHP_EOL, Utils::ArrayStr($compiled ?? []), ...
php
private function write(array $compiled): void { $tmp = tempnam(sys_get_temp_dir(), 'quanta'); if ($tmp !== false) { file_put_contents($tmp, vsprintf('<?php%s%sreturn %s;%s', [ PHP_EOL, PHP_EOL, Utils::ArrayStr($compiled ?? []), ...
[ "private", "function", "write", "(", "array", "$", "compiled", ")", ":", "void", "{", "$", "tmp", "=", "tempnam", "(", "sys_get_temp_dir", "(", ")", ",", "'quanta'", ")", ";", "if", "(", "$", "tmp", "!==", "false", ")", "{", "file_put_contents", "(", ...
Write the given compiled factories array to a unique temporary file and move it to the compiled file path. Is this safe ? @param string[] $compiled @return void
[ "Write", "the", "given", "compiled", "factories", "array", "to", "a", "unique", "temporary", "file", "and", "move", "it", "to", "the", "compiled", "file", "path", "." ]
411ed1b23b50b3362897f2a9a81147bbd4f478e6
https://github.com/quantaphp/container-compilation/blob/411ed1b23b50b3362897f2a9a81147bbd4f478e6/src/CompiledFactoryMap.php#L119-L133
196,781
quantaphp/container-compilation
src/CompiledFactoryMap.php
CompiledFactoryMap.compiled
public function compiled(callable $callable): string { if (! $this->compiler) { $this->compiler = new Compiler( new AstAnalyzerAdapter( new AstAnalyzer ) ); } return ($this->compiler)($callable); }
php
public function compiled(callable $callable): string { if (! $this->compiler) { $this->compiler = new Compiler( new AstAnalyzerAdapter( new AstAnalyzer ) ); } return ($this->compiler)($callable); }
[ "public", "function", "compiled", "(", "callable", "$", "callable", ")", ":", "string", "{", "if", "(", "!", "$", "this", "->", "compiler", ")", "{", "$", "this", "->", "compiler", "=", "new", "Compiler", "(", "new", "AstAnalyzerAdapter", "(", "new", "...
Return a string representation of the given callable. @param callable $callable @return string
[ "Return", "a", "string", "representation", "of", "the", "given", "callable", "." ]
411ed1b23b50b3362897f2a9a81147bbd4f478e6
https://github.com/quantaphp/container-compilation/blob/411ed1b23b50b3362897f2a9a81147bbd4f478e6/src/CompiledFactoryMap.php#L141-L152
196,782
ekyna/Table
Table.php
Table.getContext
public function getContext() { if (!$this->locked) { throw new Exception\LogicException( 'Context is not yet available. You must first call handleRequest()' ); } if (null === $this->context) { $this->context = new Context\Context(); ...
php
public function getContext() { if (!$this->locked) { throw new Exception\LogicException( 'Context is not yet available. You must first call handleRequest()' ); } if (null === $this->context) { $this->context = new Context\Context(); ...
[ "public", "function", "getContext", "(", ")", "{", "if", "(", "!", "$", "this", "->", "locked", ")", "{", "throw", "new", "Exception", "\\", "LogicException", "(", "'Context is not yet available. You must first call handleRequest()'", ")", ";", "}", "if", "(", "...
Returns the context. @return Context\ContextInterface
[ "Returns", "the", "context", "." ]
6f06e8fd8a3248d52f3a91f10508471344db311a
https://github.com/ekyna/Table/blob/6f06e8fd8a3248d52f3a91f10508471344db311a/Table.php#L384-L400
196,783
ekyna/Table
Table.php
Table.sortElements
public function sortElements() { $sort = function ($a, $b) { /** * @var Column\ColumnInterface|Filter\FilterInterface $a * @var Column\ColumnInterface|Filter\FilterInterface $b */ $aPos = $a->getConfig()->getPosition(); $bPos = $b->g...
php
public function sortElements() { $sort = function ($a, $b) { /** * @var Column\ColumnInterface|Filter\FilterInterface $a * @var Column\ColumnInterface|Filter\FilterInterface $b */ $aPos = $a->getConfig()->getPosition(); $bPos = $b->g...
[ "public", "function", "sortElements", "(", ")", "{", "$", "sort", "=", "function", "(", "$", "a", ",", "$", "b", ")", "{", "/**\n * @var Column\\ColumnInterface|Filter\\FilterInterface $a\n * @var Column\\ColumnInterface|Filter\\FilterInterface $b\n ...
Sorts the columns and filers.
[ "Sorts", "the", "columns", "and", "filers", "." ]
6f06e8fd8a3248d52f3a91f10508471344db311a
https://github.com/ekyna/Table/blob/6f06e8fd8a3248d52f3a91f10508471344db311a/Table.php#L441-L461
196,784
ekyna/Table
Table.php
Table.getSelectionMode
private function getSelectionMode() { if (null !== $mode = $this->config->getSelectionMode()) { return $mode; } if ($this->config->isBatchable() && !empty($this->actions)) { return Util\Config::SELECTION_MULTIPLE; } if ($this->config->isExportable() ...
php
private function getSelectionMode() { if (null !== $mode = $this->config->getSelectionMode()) { return $mode; } if ($this->config->isBatchable() && !empty($this->actions)) { return Util\Config::SELECTION_MULTIPLE; } if ($this->config->isExportable() ...
[ "private", "function", "getSelectionMode", "(", ")", "{", "if", "(", "null", "!==", "$", "mode", "=", "$", "this", "->", "config", "->", "getSelectionMode", "(", ")", ")", "{", "return", "$", "mode", ";", "}", "if", "(", "$", "this", "->", "config", ...
Returns the table's selection mode. @return null|string
[ "Returns", "the", "table", "s", "selection", "mode", "." ]
6f06e8fd8a3248d52f3a91f10508471344db311a
https://github.com/ekyna/Table/blob/6f06e8fd8a3248d52f3a91f10508471344db311a/Table.php#L706-L721
196,785
danielgp/common-lib
source/MySQLiMultipleExecution.php
MySQLiMultipleExecution.fixTableSource
protected function fixTableSource($refTbl) { $outS = []; if (substr($refTbl, 0, 1) !== '`') { $outS[] = '`'; } $psT = strpos($refTbl, '.`'); if ($psT !== false) { $refTbl = substr($refTbl, $psT + 2, strlen($refTbl) - $psT); } $outS[] = ...
php
protected function fixTableSource($refTbl) { $outS = []; if (substr($refTbl, 0, 1) !== '`') { $outS[] = '`'; } $psT = strpos($refTbl, '.`'); if ($psT !== false) { $refTbl = substr($refTbl, $psT + 2, strlen($refTbl) - $psT); } $outS[] = ...
[ "protected", "function", "fixTableSource", "(", "$", "refTbl", ")", "{", "$", "outS", "=", "[", "]", ";", "if", "(", "substr", "(", "$", "refTbl", ",", "0", ",", "1", ")", "!==", "'`'", ")", "{", "$", "outS", "[", "]", "=", "'`'", ";", "}", "...
Adjust table name with proper sufix and prefix @param string $refTbl @return string
[ "Adjust", "table", "name", "with", "proper", "sufix", "and", "prefix" ]
627b99b4408414c7cd21a6c8016f6468dc9216b2
https://github.com/danielgp/common-lib/blob/627b99b4408414c7cd21a6c8016f6468dc9216b2/source/MySQLiMultipleExecution.php#L81-L96
196,786
danielgp/common-lib
source/MySQLiMultipleExecution.php
MySQLiMultipleExecution.handleFeatures
protected function handleFeatures($fieldName, $features) { $rOly = $this->handleFeaturesSingle($fieldName, $features, 'readonly'); $rDbld = $this->handleFeaturesSingle($fieldName, $features, 'disabled'); $rNl = []; if (isset($features['include_null']) && in_array($fieldName, $feat...
php
protected function handleFeatures($fieldName, $features) { $rOly = $this->handleFeaturesSingle($fieldName, $features, 'readonly'); $rDbld = $this->handleFeaturesSingle($fieldName, $features, 'disabled'); $rNl = []; if (isset($features['include_null']) && in_array($fieldName, $feat...
[ "protected", "function", "handleFeatures", "(", "$", "fieldName", ",", "$", "features", ")", "{", "$", "rOly", "=", "$", "this", "->", "handleFeaturesSingle", "(", "$", "fieldName", ",", "$", "features", ",", "'readonly'", ")", ";", "$", "rDbld", "=", "$...
Manages features flag @param string $fieldName @param array $features @return array
[ "Manages", "features", "flag" ]
627b99b4408414c7cd21a6c8016f6468dc9216b2
https://github.com/danielgp/common-lib/blob/627b99b4408414c7cd21a6c8016f6468dc9216b2/source/MySQLiMultipleExecution.php#L136-L145
196,787
danielgp/common-lib
source/MySQLiMultipleExecution.php
MySQLiMultipleExecution.handleFeaturesSingle
private function handleFeaturesSingle($fieldName, $features, $featureKey) { $fMap = [ 'readonly' => ['readonly', 'class', 'input_readonly'], 'disabled' => ['disabled'] ]; $aReturn = []; if (array_key_exists($featureKey, $features)) { if (array_k...
php
private function handleFeaturesSingle($fieldName, $features, $featureKey) { $fMap = [ 'readonly' => ['readonly', 'class', 'input_readonly'], 'disabled' => ['disabled'] ]; $aReturn = []; if (array_key_exists($featureKey, $features)) { if (array_k...
[ "private", "function", "handleFeaturesSingle", "(", "$", "fieldName", ",", "$", "features", ",", "$", "featureKey", ")", "{", "$", "fMap", "=", "[", "'readonly'", "=>", "[", "'readonly'", ",", "'class'", ",", "'input_readonly'", "]", ",", "'disabled'", "=>",...
Handles the features @param string $fieldName @param array $features @param string $featureKey @return array
[ "Handles", "the", "features" ]
627b99b4408414c7cd21a6c8016f6468dc9216b2
https://github.com/danielgp/common-lib/blob/627b99b4408414c7cd21a6c8016f6468dc9216b2/source/MySQLiMultipleExecution.php#L155-L171
196,788
danielgp/common-lib
source/MySQLiMultipleExecution.php
MySQLiMultipleExecution.handleMySqlVersionConsistenly
private function handleMySqlVersionConsistenly() { if (substr($this->mySQLconnection->server_info, -7) === 'MariaDB') { $strVersionParts = explode('.', explode('-', $this->mySQLconnection->server_info)[1]); return $this->getTwoDecimalsNumber($strVersionParts[0]) . $this->getTwoDecima...
php
private function handleMySqlVersionConsistenly() { if (substr($this->mySQLconnection->server_info, -7) === 'MariaDB') { $strVersionParts = explode('.', explode('-', $this->mySQLconnection->server_info)[1]); return $this->getTwoDecimalsNumber($strVersionParts[0]) . $this->getTwoDecima...
[ "private", "function", "handleMySqlVersionConsistenly", "(", ")", "{", "if", "(", "substr", "(", "$", "this", "->", "mySQLconnection", "->", "server_info", ",", "-", "7", ")", "===", "'MariaDB'", ")", "{", "$", "strVersionParts", "=", "explode", "(", "'.'", ...
Ensures a consistent output of version for MySQL as well as MariaDB @return string
[ "Ensures", "a", "consistent", "output", "of", "version", "for", "MySQL", "as", "well", "as", "MariaDB" ]
627b99b4408414c7cd21a6c8016f6468dc9216b2
https://github.com/danielgp/common-lib/blob/627b99b4408414c7cd21a6c8016f6468dc9216b2/source/MySQLiMultipleExecution.php#L178-L186
196,789
danielgp/common-lib
source/MySQLiMultipleExecution.php
MySQLiMultipleExecution.setVariableTypeForMySqlStatements
protected function setVariableTypeForMySqlStatements($variabaleValue) { $sReturn = 'b'; if (is_int($variabaleValue)) { $sReturn = 'i'; } elseif (is_double($variabaleValue)) { $sReturn = 'd'; } elseif (is_string($variabaleValue)) { $sReturn = 's'; ...
php
protected function setVariableTypeForMySqlStatements($variabaleValue) { $sReturn = 'b'; if (is_int($variabaleValue)) { $sReturn = 'i'; } elseif (is_double($variabaleValue)) { $sReturn = 'd'; } elseif (is_string($variabaleValue)) { $sReturn = 's'; ...
[ "protected", "function", "setVariableTypeForMySqlStatements", "(", "$", "variabaleValue", ")", "{", "$", "sReturn", "=", "'b'", ";", "if", "(", "is_int", "(", "$", "variabaleValue", ")", ")", "{", "$", "sReturn", "=", "'i'", ";", "}", "elseif", "(", "is_do...
Detects what kind of variable has been transmitted to return the identifier needed by MySQL statement preparing @return string
[ "Detects", "what", "kind", "of", "variable", "has", "been", "transmitted", "to", "return", "the", "identifier", "needed", "by", "MySQL", "statement", "preparing" ]
627b99b4408414c7cd21a6c8016f6468dc9216b2
https://github.com/danielgp/common-lib/blob/627b99b4408414c7cd21a6c8016f6468dc9216b2/source/MySQLiMultipleExecution.php#L207-L218
196,790
PenoaksDev/Milky-Framework
src/Milky/Database/Eloquent/Nested/SetValidator.php
SetValidator.validateBounds
protected function validateBounds() { $connection = $this->model->getConnection(); $grammar = $connection->getQueryGrammar(); $tableName = $this->model->getTable(); $primaryKeyName = $this->model->getKeyName(); $parentColumn = $this->model->getQualifiedParentColumnName(); $lftCol = $grammar->wrap( $this-...
php
protected function validateBounds() { $connection = $this->model->getConnection(); $grammar = $connection->getQueryGrammar(); $tableName = $this->model->getTable(); $primaryKeyName = $this->model->getKeyName(); $parentColumn = $this->model->getQualifiedParentColumnName(); $lftCol = $grammar->wrap( $this-...
[ "protected", "function", "validateBounds", "(", ")", "{", "$", "connection", "=", "$", "this", "->", "model", "->", "getConnection", "(", ")", ";", "$", "grammar", "=", "$", "connection", "->", "getQueryGrammar", "(", ")", ";", "$", "tableName", "=", "$"...
Validates bounds of the nested tree structure. It will perform checks on the `lft`, `rgt` and `parent_id` columns. Mainly that they're not null, rights greater than lefts, and that they're within the bounds of the parent. @return boolean
[ "Validates", "bounds", "of", "the", "nested", "tree", "structure", ".", "It", "will", "perform", "checks", "on", "the", "lft", "rgt", "and", "parent_id", "columns", ".", "Mainly", "that", "they", "re", "not", "null", "rights", "greater", "than", "lefts", "...
8afd7156610a70371aa5b1df50b8a212bf7b142c
https://github.com/PenoaksDev/Milky-Framework/blob/8afd7156610a70371aa5b1df50b8a212bf7b142c/src/Milky/Database/Eloquent/Nested/SetValidator.php#L50-L76
196,791
PenoaksDev/Milky-Framework
src/Milky/Database/Eloquent/Nested/SetValidator.php
SetValidator.validateDuplicates
protected function validateDuplicates() { return ( !$this->duplicatesExistForColumn( $this->model->getQualifiedLeftColumnName() ) && !$this->duplicatesExistForColumn( $this->model->getQualifiedRightColumnName() ) ); }
php
protected function validateDuplicates() { return ( !$this->duplicatesExistForColumn( $this->model->getQualifiedLeftColumnName() ) && !$this->duplicatesExistForColumn( $this->model->getQualifiedRightColumnName() ) ); }
[ "protected", "function", "validateDuplicates", "(", ")", "{", "return", "(", "!", "$", "this", "->", "duplicatesExistForColumn", "(", "$", "this", "->", "model", "->", "getQualifiedLeftColumnName", "(", ")", ")", "&&", "!", "$", "this", "->", "duplicatesExistF...
Checks that there are no duplicates for the `lft` and `rgt` columns. @return boolean
[ "Checks", "that", "there", "are", "no", "duplicates", "for", "the", "lft", "and", "rgt", "columns", "." ]
8afd7156610a70371aa5b1df50b8a212bf7b142c
https://github.com/PenoaksDev/Milky-Framework/blob/8afd7156610a70371aa5b1df50b8a212bf7b142c/src/Milky/Database/Eloquent/Nested/SetValidator.php#L83-L86
196,792
PenoaksDev/Milky-Framework
src/Milky/Database/Eloquent/Nested/SetValidator.php
SetValidator.validateRoots
protected function validateRoots() { $roots = forward_static_call( [get_class( $this->model ), 'roots'] )->get(); // If a scope is defined in the model we should check that the roots are // valid *for each* value in the scope columns. if ( $this->model->isScoped() ) return $this->validateRootsByScope( $roo...
php
protected function validateRoots() { $roots = forward_static_call( [get_class( $this->model ), 'roots'] )->get(); // If a scope is defined in the model we should check that the roots are // valid *for each* value in the scope columns. if ( $this->model->isScoped() ) return $this->validateRootsByScope( $roo...
[ "protected", "function", "validateRoots", "(", ")", "{", "$", "roots", "=", "forward_static_call", "(", "[", "get_class", "(", "$", "this", "->", "model", ")", ",", "'roots'", "]", ")", "->", "get", "(", ")", ";", "// If a scope is defined in the model we shou...
For each root of the whole nested set tree structure, checks that their `lft` and `rgt` bounds are properly set. @return boolean
[ "For", "each", "root", "of", "the", "whole", "nested", "set", "tree", "structure", "checks", "that", "their", "lft", "and", "rgt", "bounds", "are", "properly", "set", "." ]
8afd7156610a70371aa5b1df50b8a212bf7b142c
https://github.com/PenoaksDev/Milky-Framework/blob/8afd7156610a70371aa5b1df50b8a212bf7b142c/src/Milky/Database/Eloquent/Nested/SetValidator.php#L94-L104
196,793
PenoaksDev/Milky-Framework
src/Milky/Database/Eloquent/Nested/SetValidator.php
SetValidator.keyForScope
protected function keyForScope( $model ) { return implode( '-', array_map( function ( $column ) use ( $model ) { $value = $model->getAttribute( $column ); if ( is_null( $value ) ) return 'NULL'; return $value; }, $model->getScopedColumns() ) ); }
php
protected function keyForScope( $model ) { return implode( '-', array_map( function ( $column ) use ( $model ) { $value = $model->getAttribute( $column ); if ( is_null( $value ) ) return 'NULL'; return $value; }, $model->getScopedColumns() ) ); }
[ "protected", "function", "keyForScope", "(", "$", "model", ")", "{", "return", "implode", "(", "'-'", ",", "array_map", "(", "function", "(", "$", "column", ")", "use", "(", "$", "model", ")", "{", "$", "value", "=", "$", "model", "->", "getAttribute",...
Builds a single string for the given scope columns values. Useful for making array keys for grouping. @param NestedModel $model @return string
[ "Builds", "a", "single", "string", "for", "the", "given", "scope", "columns", "values", ".", "Useful", "for", "making", "array", "keys", "for", "grouping", "." ]
8afd7156610a70371aa5b1df50b8a212bf7b142c
https://github.com/PenoaksDev/Milky-Framework/blob/8afd7156610a70371aa5b1df50b8a212bf7b142c/src/Milky/Database/Eloquent/Nested/SetValidator.php#L215-L226
196,794
translationexchange/tml-php-clientsdk
library/Tr8n/Tokens/DataToken.php
DataToken.parse
function parse() { $name_without_parens = preg_replace('/[{}]/', '', $this->full_name); $parts = explode('::', $name_without_parens); $name_without_case_keys = trim($parts[0]); array_shift($parts); $this->case_keys = array_map('trim', $parts); $parts = explode(':', $nam...
php
function parse() { $name_without_parens = preg_replace('/[{}]/', '', $this->full_name); $parts = explode('::', $name_without_parens); $name_without_case_keys = trim($parts[0]); array_shift($parts); $this->case_keys = array_map('trim', $parts); $parts = explode(':', $nam...
[ "function", "parse", "(", ")", "{", "$", "name_without_parens", "=", "preg_replace", "(", "'/[{}]/'", ",", "''", ",", "$", "this", "->", "full_name", ")", ";", "$", "parts", "=", "explode", "(", "'::'", ",", "$", "name_without_parens", ")", ";", "$", "...
Parses token name elements
[ "Parses", "token", "name", "elements" ]
fe51473824e62cfd883c6aa0c6a3783a16ce8425
https://github.com/translationexchange/tml-php-clientsdk/blob/fe51473824e62cfd883c6aa0c6a3783a16ce8425/library/Tr8n/Tokens/DataToken.php#L93-L105
196,795
translationexchange/tml-php-clientsdk
library/Tr8n/Tokens/DataToken.php
DataToken.contextForLanguage
public function contextForLanguage($language, $opts = array()) { if (count($this->context_keys) > 0) { $ctx = $language->contextByKeyword($this->context_keys[0]); } else { $ctx = $language->contextByTokenName($this->short_name); } return $ctx; }
php
public function contextForLanguage($language, $opts = array()) { if (count($this->context_keys) > 0) { $ctx = $language->contextByKeyword($this->context_keys[0]); } else { $ctx = $language->contextByTokenName($this->short_name); } return $ctx; }
[ "public", "function", "contextForLanguage", "(", "$", "language", ",", "$", "opts", "=", "array", "(", ")", ")", "{", "if", "(", "count", "(", "$", "this", "->", "context_keys", ")", ">", "0", ")", "{", "$", "ctx", "=", "$", "language", "->", "cont...
For transform tokens, we can only use the first context key, if it is not mapped in the context itself. {user:gender | male: , female: ... } It is not possible to apply multiple context rules on a single token at the same time: {user:gender:value | .... hah?} It is still possible to setup dependencies on multiple c...
[ "For", "transform", "tokens", "we", "can", "only", "use", "the", "first", "context", "key", "if", "it", "is", "not", "mapped", "in", "the", "context", "itself", "." ]
fe51473824e62cfd883c6aa0c6a3783a16ce8425
https://github.com/translationexchange/tml-php-clientsdk/blob/fe51473824e62cfd883c6aa0c6a3783a16ce8425/library/Tr8n/Tokens/DataToken.php#L143-L151
196,796
translationexchange/tml-php-clientsdk
library/Tr8n/Tokens/DataToken.php
DataToken.tokenObject
public static function tokenObject($token_values, $token_name) { if ($token_values == null) return null; if (!array_key_exists($token_name, $token_values)) return null; $token_object = $token_values[$token_name]; if (is_array($token_object)) { if (\...
php
public static function tokenObject($token_values, $token_name) { if ($token_values == null) return null; if (!array_key_exists($token_name, $token_values)) return null; $token_object = $token_values[$token_name]; if (is_array($token_object)) { if (\...
[ "public", "static", "function", "tokenObject", "(", "$", "token_values", ",", "$", "token_name", ")", "{", "if", "(", "$", "token_values", "==", "null", ")", "return", "null", ";", "if", "(", "!", "array_key_exists", "(", "$", "token_name", ",", "$", "to...
Returns an object from values hash. @param mixed[] $token_values @param string $token_name @return mixed
[ "Returns", "an", "object", "from", "values", "hash", "." ]
fe51473824e62cfd883c6aa0c6a3783a16ce8425
https://github.com/translationexchange/tml-php-clientsdk/blob/fe51473824e62cfd883c6aa0c6a3783a16ce8425/library/Tr8n/Tokens/DataToken.php#L160-L180
196,797
translationexchange/tml-php-clientsdk
library/Tr8n/Tokens/DataToken.php
DataToken.tokenValueFromArrayParam
public function tokenValueFromArrayParam($token_data, $language, $options = array()) { // if you provided an array, it better have some values if (count($token_data) == 0) return $this->error("Invalid number of params of an array"); $object = $token_data[0]; $method = count(...
php
public function tokenValueFromArrayParam($token_data, $language, $options = array()) { // if you provided an array, it better have some values if (count($token_data) == 0) return $this->error("Invalid number of params of an array"); $object = $token_data[0]; $method = count(...
[ "public", "function", "tokenValueFromArrayParam", "(", "$", "token_data", ",", "$", "language", ",", "$", "options", "=", "array", "(", ")", ")", "{", "// if you provided an array, it better have some values", "if", "(", "count", "(", "$", "token_data", ")", "==",...
gets the value based on various evaluation methods examples: tr("Hello {user}", array("user" => array($current_user, $current_user->name))) tr("Hello {user}", array("user" => array($current_user, "@name"))) tr("Hello {user}", array("user" => array($current_user, "@@firstName"))) tr("Hello {user}", {:user => array(ar...
[ "gets", "the", "value", "based", "on", "various", "evaluation", "methods" ]
fe51473824e62cfd883c6aa0c6a3783a16ce8425
https://github.com/translationexchange/tml-php-clientsdk/blob/fe51473824e62cfd883c6aa0c6a3783a16ce8425/library/Tr8n/Tokens/DataToken.php#L199-L222
196,798
translationexchange/tml-php-clientsdk
library/Tr8n/Tokens/DataToken.php
DataToken.tokenValue
public function tokenValue($token_values, $language, $options = array()) { if (isset($token_values[$this->short_name])) { $object = $token_values[$this->short_name]; } else { $object = Config::instance()->defaultToken($this->short_name, 'data'); } if ($object ===...
php
public function tokenValue($token_values, $language, $options = array()) { if (isset($token_values[$this->short_name])) { $object = $token_values[$this->short_name]; } else { $object = Config::instance()->defaultToken($this->short_name, 'data'); } if ($object ===...
[ "public", "function", "tokenValue", "(", "$", "token_values", ",", "$", "language", ",", "$", "options", "=", "array", "(", ")", ")", "{", "if", "(", "isset", "(", "$", "token_values", "[", "$", "this", "->", "short_name", "]", ")", ")", "{", "$", ...
Returns a value from values hash. @param mixed[] $token_values @param \Tr8n\Language $language @param array $options @return string @throws \Tr8n\Tr8nException
[ "Returns", "a", "value", "from", "values", "hash", "." ]
fe51473824e62cfd883c6aa0c6a3783a16ce8425
https://github.com/translationexchange/tml-php-clientsdk/blob/fe51473824e62cfd883c6aa0c6a3783a16ce8425/library/Tr8n/Tokens/DataToken.php#L494-L515
196,799
translationexchange/tml-php-clientsdk
library/Tr8n/Tokens/DataToken.php
DataToken.substitute
public function substitute($label, $token_values, $language, $options = array()) { // Logger::instance()->debug("Substituting $label in " . $language->locale); $token_value = $this->tokenValue($token_values, $language, $options); return str_replace($this->full_name, $token_value, $label); }
php
public function substitute($label, $token_values, $language, $options = array()) { // Logger::instance()->debug("Substituting $label in " . $language->locale); $token_value = $this->tokenValue($token_values, $language, $options); return str_replace($this->full_name, $token_value, $label); }
[ "public", "function", "substitute", "(", "$", "label", ",", "$", "token_values", ",", "$", "language", ",", "$", "options", "=", "array", "(", ")", ")", "{", "// Logger::instance()->debug(\"Substituting $label in \" . $language->locale);", "$", "token_value", "...
Main substitution function @param string $label @param mixed[] $token_values @param \Tr8n\Language $language @param mixed[] $options @return mixed
[ "Main", "substitution", "function" ]
fe51473824e62cfd883c6aa0c6a3783a16ce8425
https://github.com/translationexchange/tml-php-clientsdk/blob/fe51473824e62cfd883c6aa0c6a3783a16ce8425/library/Tr8n/Tokens/DataToken.php#L581-L585