repository_name
stringlengths
5
67
func_path_in_repository
stringlengths
4
234
func_name
stringlengths
0
314
whole_func_string
stringlengths
52
3.87M
language
stringclasses
6 values
func_code_string
stringlengths
52
3.87M
func_code_tokens
listlengths
15
672k
func_documentation_string
stringlengths
1
47.2k
func_documentation_tokens
listlengths
1
3.92k
split_name
stringclasses
1 value
func_code_url
stringlengths
85
339
webforge-labs/psc-cms
lib/PHPWord/PHPWord/Section/Table/Cell.php
PHPWord_Section_Table_Cell.addLink
public function addLink($linkSrc, $linkName = null, $style = null) { if($this->_insideOf == 'section') { $link = new PHPWord_Section_Link($linkSrc, $linkName, $style); $rID = PHPWord_Media::addSectionLinkElement($linkSrc); $link->setRelationId($rID); $this->_elementCollection[] = $link; ...
php
public function addLink($linkSrc, $linkName = null, $style = null) { if($this->_insideOf == 'section') { $link = new PHPWord_Section_Link($linkSrc, $linkName, $style); $rID = PHPWord_Media::addSectionLinkElement($linkSrc); $link->setRelationId($rID); $this->_elementCollection[] = $link; ...
[ "public", "function", "addLink", "(", "$", "linkSrc", ",", "$", "linkName", "=", "null", ",", "$", "style", "=", "null", ")", "{", "if", "(", "$", "this", "->", "_insideOf", "==", "'section'", ")", "{", "$", "link", "=", "new", "PHPWord_Section_Link", ...
Add a Link Element @param string $linkSrc @param string $linkName @param mixed $style @return PHPWord_Section_Link
[ "Add", "a", "Link", "Element" ]
train
https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/PHPWord/PHPWord/Section/Table/Cell.php#L124-L137
webforge-labs/psc-cms
lib/PHPWord/PHPWord/Section/Table/Cell.php
PHPWord_Section_Table_Cell.addListItem
public function addListItem($text, $depth = 0, $styleText = null, $styleList = null) { $listItem = new PHPWord_Section_ListItem($text, $depth, $styleText, $styleList); $this->_elementCollection[] = $listItem; return $listItem; }
php
public function addListItem($text, $depth = 0, $styleText = null, $styleList = null) { $listItem = new PHPWord_Section_ListItem($text, $depth, $styleText, $styleList); $this->_elementCollection[] = $listItem; return $listItem; }
[ "public", "function", "addListItem", "(", "$", "text", ",", "$", "depth", "=", "0", ",", "$", "styleText", "=", "null", ",", "$", "styleList", "=", "null", ")", "{", "$", "listItem", "=", "new", "PHPWord_Section_ListItem", "(", "$", "text", ",", "$", ...
Add a ListItem Element @param string $text @param int $depth @param mixed $styleText @param mixed $styleList @return PHPWord_Section_ListItem
[ "Add", "a", "ListItem", "Element" ]
train
https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/PHPWord/PHPWord/Section/Table/Cell.php#L157-L161
webforge-labs/psc-cms
lib/PHPWord/PHPWord/Section/Table/Cell.php
PHPWord_Section_Table_Cell.addImage
public function addImage($src, $style = null) { $image = new PHPWord_Section_Image($src, $style); if(!is_null($image->getSource())) { if($this->_insideOf == 'section') { $rID = PHPWord_Media::addSectionMediaElement($src, 'image'); } elseif($this->_insideOf == 'header') { $rID = PHPWord_Media...
php
public function addImage($src, $style = null) { $image = new PHPWord_Section_Image($src, $style); if(!is_null($image->getSource())) { if($this->_insideOf == 'section') { $rID = PHPWord_Media::addSectionMediaElement($src, 'image'); } elseif($this->_insideOf == 'header') { $rID = PHPWord_Media...
[ "public", "function", "addImage", "(", "$", "src", ",", "$", "style", "=", "null", ")", "{", "$", "image", "=", "new", "PHPWord_Section_Image", "(", "$", "src", ",", "$", "style", ")", ";", "if", "(", "!", "is_null", "(", "$", "image", "->", "getSo...
Add a Image Element @param string $src @param mixed $style @return PHPWord_Section_Image
[ "Add", "a", "Image", "Element" ]
train
https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/PHPWord/PHPWord/Section/Table/Cell.php#L170-L188
webforge-labs/psc-cms
lib/PHPWord/PHPWord/Section/Table/Cell.php
PHPWord_Section_Table_Cell.addMemoryImage
public function addMemoryImage($link, $style = null) { $memoryImage = new PHPWord_Section_MemoryImage($link, $style); if(!is_null($memoryImage->getSource())) { if($this->_insideOf == 'section') { $rID = PHPWord_Media::addSectionMediaElement($link, 'image', $memoryImage); } elseif($this->_insideOf == ...
php
public function addMemoryImage($link, $style = null) { $memoryImage = new PHPWord_Section_MemoryImage($link, $style); if(!is_null($memoryImage->getSource())) { if($this->_insideOf == 'section') { $rID = PHPWord_Media::addSectionMediaElement($link, 'image', $memoryImage); } elseif($this->_insideOf == ...
[ "public", "function", "addMemoryImage", "(", "$", "link", ",", "$", "style", "=", "null", ")", "{", "$", "memoryImage", "=", "new", "PHPWord_Section_MemoryImage", "(", "$", "link", ",", "$", "style", ")", ";", "if", "(", "!", "is_null", "(", "$", "memo...
Add a by PHP created Image Element @param string $link @param mixed $style @return PHPWord_Section_MemoryImage
[ "Add", "a", "by", "PHP", "created", "Image", "Element" ]
train
https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/PHPWord/PHPWord/Section/Table/Cell.php#L197-L214
webforge-labs/psc-cms
lib/PHPWord/PHPWord/Section/Table/Cell.php
PHPWord_Section_Table_Cell.addObject
public function addObject($src, $style = null) { $object = new PHPWord_Section_Object($src, $style); if(!is_null($object->getSource())) { $inf = pathinfo($src); $ext = $inf['extension']; if(strlen($ext) == 4 && strtolower(substr($ext, -1)) == 'x') { $ext = substr($ext, 0, -1); } ...
php
public function addObject($src, $style = null) { $object = new PHPWord_Section_Object($src, $style); if(!is_null($object->getSource())) { $inf = pathinfo($src); $ext = $inf['extension']; if(strlen($ext) == 4 && strtolower(substr($ext, -1)) == 'x') { $ext = substr($ext, 0, -1); } ...
[ "public", "function", "addObject", "(", "$", "src", ",", "$", "style", "=", "null", ")", "{", "$", "object", "=", "new", "PHPWord_Section_Object", "(", "$", "src", ",", "$", "style", ")", ";", "if", "(", "!", "is_null", "(", "$", "object", "->", "g...
Add a OLE-Object Element @param string $src @param mixed $style @return PHPWord_Section_Object
[ "Add", "a", "OLE", "-", "Object", "Element" ]
train
https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/PHPWord/PHPWord/Section/Table/Cell.php#L223-L254
webforge-labs/psc-cms
lib/PHPWord/PHPWord/Section/Table/Cell.php
PHPWord_Section_Table_Cell.addPreserveText
public function addPreserveText($text, $styleFont = null, $styleParagraph = null) { if($this->_insideOf == 'footer' || $this->_insideOf == 'header') { $ptext = new PHPWord_Section_Footer_PreserveText($text, $styleFont, $styleParagraph); $this->_elementCollection[] = $ptext; return $ptext; } else { ...
php
public function addPreserveText($text, $styleFont = null, $styleParagraph = null) { if($this->_insideOf == 'footer' || $this->_insideOf == 'header') { $ptext = new PHPWord_Section_Footer_PreserveText($text, $styleFont, $styleParagraph); $this->_elementCollection[] = $ptext; return $ptext; } else { ...
[ "public", "function", "addPreserveText", "(", "$", "text", ",", "$", "styleFont", "=", "null", ",", "$", "styleParagraph", "=", "null", ")", "{", "if", "(", "$", "this", "->", "_insideOf", "==", "'footer'", "||", "$", "this", "->", "_insideOf", "==", "...
Add a PreserveText Element @param string $text @param mixed $styleFont @param mixed $styleParagraph @return PHPWord_Section_Footer_PreserveText
[ "Add", "a", "PreserveText", "Element" ]
train
https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/PHPWord/PHPWord/Section/Table/Cell.php#L264-L272
webforge-labs/psc-cms
lib/PHPWord/PHPWord/Section/Table/Cell.php
PHPWord_Section_Table_Cell.createTextRun
public function createTextRun($styleParagraph = null) { $textRun = new PHPWord_Section_TextRun($styleParagraph); $this->_elementCollection[] = $textRun; return $textRun; }
php
public function createTextRun($styleParagraph = null) { $textRun = new PHPWord_Section_TextRun($styleParagraph); $this->_elementCollection[] = $textRun; return $textRun; }
[ "public", "function", "createTextRun", "(", "$", "styleParagraph", "=", "null", ")", "{", "$", "textRun", "=", "new", "PHPWord_Section_TextRun", "(", "$", "styleParagraph", ")", ";", "$", "this", "->", "_elementCollection", "[", "]", "=", "$", "textRun", ";"...
Create a new TextRun @return PHPWord_Section_TextRun
[ "Create", "a", "new", "TextRun" ]
train
https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/PHPWord/PHPWord/Section/Table/Cell.php#L279-L283
webforge-labs/psc-cms
lib/PHPWord/PHPWord/TOC.php
PHPWord_TOC.addTitle
public static function addTitle($text, $depth = 0) { $anchor = '_Toc'.++self::$_anchor; $bookmarkId = self::$_bookmarkId++; $title = array(); $title['text'] = $text; $title['depth'] = $depth; $title['anchor'] = $anchor; $title['bookmarkId'] = $bookmarkId; self::$_titles[] = $title; ...
php
public static function addTitle($text, $depth = 0) { $anchor = '_Toc'.++self::$_anchor; $bookmarkId = self::$_bookmarkId++; $title = array(); $title['text'] = $text; $title['depth'] = $depth; $title['anchor'] = $anchor; $title['bookmarkId'] = $bookmarkId; self::$_titles[] = $title; ...
[ "public", "static", "function", "addTitle", "(", "$", "text", ",", "$", "depth", "=", "0", ")", "{", "$", "anchor", "=", "'_Toc'", ".", "++", "self", "::", "$", "_anchor", ";", "$", "bookmarkId", "=", "self", "::", "$", "_bookmarkId", "++", ";", "$...
Add a Title @return array
[ "Add", "a", "Title" ]
train
https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/PHPWord/PHPWord/TOC.php#L113-L126
phpmob/changmin
src/PhpMob/ChangMinBundle/Fixture/AdminUserFactory.php
AdminUserFactory.create
public function create(array $options = []) { $options = $this->optionsResolver->resolve($options); /** @var AdminUserInterface $user */ $user = $this->userFactory->createNew(); $user->setEmail($options['email']); $user->setUsername($options['username']); $user->setP...
php
public function create(array $options = []) { $options = $this->optionsResolver->resolve($options); /** @var AdminUserInterface $user */ $user = $this->userFactory->createNew(); $user->setEmail($options['email']); $user->setUsername($options['username']); $user->setP...
[ "public", "function", "create", "(", "array", "$", "options", "=", "[", "]", ")", "{", "$", "options", "=", "$", "this", "->", "optionsResolver", "->", "resolve", "(", "$", "options", ")", ";", "/** @var AdminUserInterface $user */", "$", "user", "=", "$",...
{@inheritdoc}
[ "{" ]
train
https://github.com/phpmob/changmin/blob/bfebb1561229094d1c138574abab75f2f1d17d66/src/PhpMob/ChangMinBundle/Fixture/AdminUserFactory.php#L47-L66
phpmob/changmin
src/PhpMob/ChangMinBundle/Fixture/AdminUserFactory.php
AdminUserFactory.configureOptions
protected function configureOptions(OptionsResolver $resolver) { $resolver ->setDefault('email', function (Options $options) { return $this->faker->email; }) ->setDefault('username', function (Options $options) { return $this->faker->userNa...
php
protected function configureOptions(OptionsResolver $resolver) { $resolver ->setDefault('email', function (Options $options) { return $this->faker->email; }) ->setDefault('username', function (Options $options) { return $this->faker->userNa...
[ "protected", "function", "configureOptions", "(", "OptionsResolver", "$", "resolver", ")", "{", "$", "resolver", "->", "setDefault", "(", "'email'", ",", "function", "(", "Options", "$", "options", ")", "{", "return", "$", "this", "->", "faker", "->", "email...
{@inheritdoc}
[ "{" ]
train
https://github.com/phpmob/changmin/blob/bfebb1561229094d1c138574abab75f2f1d17d66/src/PhpMob/ChangMinBundle/Fixture/AdminUserFactory.php#L71-L88
transfer-framework/ezplatform
src/Transfer/EzPlatform/Worker/Transformer/EzClassSpecToArrayTransformer.php
EzClassSpecToArrayTransformer.handle
public function handle($ezclasspec) { $ezclasspec = json_decode($ezclasspec, true); $array = []; foreach ($ezclasspec['class_list'] as $class) { $array[$class['class_identifier']] = $this->mapContentType($class); } return $array; }
php
public function handle($ezclasspec) { $ezclasspec = json_decode($ezclasspec, true); $array = []; foreach ($ezclasspec['class_list'] as $class) { $array[$class['class_identifier']] = $this->mapContentType($class); } return $array; }
[ "public", "function", "handle", "(", "$", "ezclasspec", ")", "{", "$", "ezclasspec", "=", "json_decode", "(", "$", "ezclasspec", ",", "true", ")", ";", "$", "array", "=", "[", "]", ";", "foreach", "(", "$", "ezclasspec", "[", "'class_list'", "]", "as",...
{@inheritdoc}
[ "{" ]
train
https://github.com/transfer-framework/ezplatform/blob/1b2d87caa1a6b79fd8fc78109c26a2d1d6359c2f/src/Transfer/EzPlatform/Worker/Transformer/EzClassSpecToArrayTransformer.php#L24-L34
transfer-framework/ezplatform
src/Transfer/EzPlatform/Worker/Transformer/EzClassSpecToArrayTransformer.php
EzClassSpecToArrayTransformer.mapField
protected function mapField($attibute) { $field = array(); foreach ($attibute as $key => $value) { switch ($key) { case 'name': $field['name'] = $this->uctToUtf($value); break; case 'datatype': $f...
php
protected function mapField($attibute) { $field = array(); foreach ($attibute as $key => $value) { switch ($key) { case 'name': $field['name'] = $this->uctToUtf($value); break; case 'datatype': $f...
[ "protected", "function", "mapField", "(", "$", "attibute", ")", "{", "$", "field", "=", "array", "(", ")", ";", "foreach", "(", "$", "attibute", "as", "$", "key", "=>", "$", "value", ")", "{", "switch", "(", "$", "key", ")", "{", "case", "'name'", ...
@param array $attibute @return array
[ "@param", "array", "$attibute" ]
train
https://github.com/transfer-framework/ezplatform/blob/1b2d87caa1a6b79fd8fc78109c26a2d1d6359c2f/src/Transfer/EzPlatform/Worker/Transformer/EzClassSpecToArrayTransformer.php#L65-L86
gerritdrost/phenum
src/GerritDrost/Lib/Enum/EnumMap.php
EnumMap.has
public function has(Enum $enum) { $this->checkType($enum); return isset($this->valueMap[$enum->getConstName()]); }
php
public function has(Enum $enum) { $this->checkType($enum); return isset($this->valueMap[$enum->getConstName()]); }
[ "public", "function", "has", "(", "Enum", "$", "enum", ")", "{", "$", "this", "->", "checkType", "(", "$", "enum", ")", ";", "return", "isset", "(", "$", "this", "->", "valueMap", "[", "$", "enum", "->", "getConstName", "(", ")", "]", ")", ";", "...
@param Enum $enum An offset to check for. @return boolean true on success or false on failure. @throws InvalidArgumentException
[ "@param", "Enum", "$enum", "An", "offset", "to", "check", "for", "." ]
train
https://github.com/gerritdrost/phenum/blob/935ba4911d0591dea9a2c94a1c1ab5babeec92cb/src/GerritDrost/Lib/Enum/EnumMap.php#L74-L79
gerritdrost/phenum
src/GerritDrost/Lib/Enum/EnumMap.php
EnumMap.get
public function get(Enum $enum, $notPresentValue = null) { $this->checkType($enum); return isset($this->valueMap[$enum->getConstName()]) ? $this->valueMap[$enum->getConstName()] : $notPresentValue; }
php
public function get(Enum $enum, $notPresentValue = null) { $this->checkType($enum); return isset($this->valueMap[$enum->getConstName()]) ? $this->valueMap[$enum->getConstName()] : $notPresentValue; }
[ "public", "function", "get", "(", "Enum", "$", "enum", ",", "$", "notPresentValue", "=", "null", ")", "{", "$", "this", "->", "checkType", "(", "$", "enum", ")", ";", "return", "isset", "(", "$", "this", "->", "valueMap", "[", "$", "enum", "->", "g...
@param Enum $enum The offset to retrieve. @param mixed $notPresentValue The value to return when the enum is not mapped @return mixed Can return all value types. @throws InvalidArgumentException
[ "@param", "Enum", "$enum", "The", "offset", "to", "retrieve", ".", "@param", "mixed", "$notPresentValue", "The", "value", "to", "return", "when", "the", "enum", "is", "not", "mapped" ]
train
https://github.com/gerritdrost/phenum/blob/935ba4911d0591dea9a2c94a1c1ab5babeec92cb/src/GerritDrost/Lib/Enum/EnumMap.php#L89-L96
gerritdrost/phenum
src/GerritDrost/Lib/Enum/EnumMap.php
EnumMap.map
public function map(Enum $enum, $value) { $this->checkType($enum); $this->valueMap[$enum->getConstName()] = $value; $this->mappedEnums[] = $enum; return $this; }
php
public function map(Enum $enum, $value) { $this->checkType($enum); $this->valueMap[$enum->getConstName()] = $value; $this->mappedEnums[] = $enum; return $this; }
[ "public", "function", "map", "(", "Enum", "$", "enum", ",", "$", "value", ")", "{", "$", "this", "->", "checkType", "(", "$", "enum", ")", ";", "$", "this", "->", "valueMap", "[", "$", "enum", "->", "getConstName", "(", ")", "]", "=", "$", "value...
@param Enum $enum The offset to assign the value to. @param mixed $value The value to set. @return $this @throws InvalidArgumentException
[ "@param", "Enum", "$enum", "The", "offset", "to", "assign", "the", "value", "to", ".", "@param", "mixed", "$value", "The", "value", "to", "set", "." ]
train
https://github.com/gerritdrost/phenum/blob/935ba4911d0591dea9a2c94a1c1ab5babeec92cb/src/GerritDrost/Lib/Enum/EnumMap.php#L106-L114
gerritdrost/phenum
src/GerritDrost/Lib/Enum/EnumMap.php
EnumMap.remove
public function remove(Enum $enum) { $this->checkType($enum); $enumName = $enum->getConstName(); if (isset($this->valueMap[$enumName])) { $value = $this->valueMap[$enumName]; unset($this->valueMap[$enumName]); $index = array_search($enum, $this->mapped...
php
public function remove(Enum $enum) { $this->checkType($enum); $enumName = $enum->getConstName(); if (isset($this->valueMap[$enumName])) { $value = $this->valueMap[$enumName]; unset($this->valueMap[$enumName]); $index = array_search($enum, $this->mapped...
[ "public", "function", "remove", "(", "Enum", "$", "enum", ")", "{", "$", "this", "->", "checkType", "(", "$", "enum", ")", ";", "$", "enumName", "=", "$", "enum", "->", "getConstName", "(", ")", ";", "if", "(", "isset", "(", "$", "this", "->", "v...
@param Enum $enum The offset to unset. @return mixed|null the removed value on success, null otherwise @throws InvalidArgumentException
[ "@param", "Enum", "$enum", "The", "offset", "to", "unset", "." ]
train
https://github.com/gerritdrost/phenum/blob/935ba4911d0591dea9a2c94a1c1ab5babeec92cb/src/GerritDrost/Lib/Enum/EnumMap.php#L123-L141
gerritdrost/phenum
src/GerritDrost/Lib/Enum/EnumMap.php
EnumMap.checkType
protected function checkType(Enum $enum) { if (get_class($enum) !== $this->fqcn) { throw new InvalidArgumentException(sprintf('Provided variable $enum is not of type %s', $this->fqcn)); } }
php
protected function checkType(Enum $enum) { if (get_class($enum) !== $this->fqcn) { throw new InvalidArgumentException(sprintf('Provided variable $enum is not of type %s', $this->fqcn)); } }
[ "protected", "function", "checkType", "(", "Enum", "$", "enum", ")", "{", "if", "(", "get_class", "(", "$", "enum", ")", "!==", "$", "this", "->", "fqcn", ")", "{", "throw", "new", "InvalidArgumentException", "(", "sprintf", "(", "'Provided variable $enum is...
@param Enum $enum @throws InvalidArgumentException
[ "@param", "Enum", "$enum" ]
train
https://github.com/gerritdrost/phenum/blob/935ba4911d0591dea9a2c94a1c1ab5babeec92cb/src/GerritDrost/Lib/Enum/EnumMap.php#L165-L170
gerritdrost/phenum
src/GerritDrost/Lib/Enum/EnumMap.php
EnumMap.current
public function current() { return isset($this->mappedEnums[$this->iteratorIndex]) ? $this->valueMap[$this->mappedEnums[$this->iteratorIndex]->getConstName()] : null; }
php
public function current() { return isset($this->mappedEnums[$this->iteratorIndex]) ? $this->valueMap[$this->mappedEnums[$this->iteratorIndex]->getConstName()] : null; }
[ "public", "function", "current", "(", ")", "{", "return", "isset", "(", "$", "this", "->", "mappedEnums", "[", "$", "this", "->", "iteratorIndex", "]", ")", "?", "$", "this", "->", "valueMap", "[", "$", "this", "->", "mappedEnums", "[", "$", "this", ...
Return the current element @link http://php.net/manual/en/iterator.current.php @return mixed
[ "Return", "the", "current", "element" ]
train
https://github.com/gerritdrost/phenum/blob/935ba4911d0591dea9a2c94a1c1ab5babeec92cb/src/GerritDrost/Lib/Enum/EnumMap.php#L179-L184
gerritdrost/phenum
src/GerritDrost/Lib/Enum/EnumMap.php
EnumMap.key
public function key() { return isset($this->mappedEnums[$this->iteratorIndex]) ? $this->mappedEnums[$this->iteratorIndex] : null; }
php
public function key() { return isset($this->mappedEnums[$this->iteratorIndex]) ? $this->mappedEnums[$this->iteratorIndex] : null; }
[ "public", "function", "key", "(", ")", "{", "return", "isset", "(", "$", "this", "->", "mappedEnums", "[", "$", "this", "->", "iteratorIndex", "]", ")", "?", "$", "this", "->", "mappedEnums", "[", "$", "this", "->", "iteratorIndex", "]", ":", "null", ...
Return the key of the current element @link http://php.net/manual/en/iterator.key.php @return Enum
[ "Return", "the", "key", "of", "the", "current", "element" ]
train
https://github.com/gerritdrost/phenum/blob/935ba4911d0591dea9a2c94a1c1ab5babeec92cb/src/GerritDrost/Lib/Enum/EnumMap.php#L205-L210
webforge-labs/psc-cms
lib/Psc/Code/Differ.php
Differ.getDiffs
public function getDiffs() { $diffs = array(); foreach ($this->diffs as $diff) { if ($diff[1] !== self::OLD) { $diffs[] = $diff; } } return $diffs; }
php
public function getDiffs() { $diffs = array(); foreach ($this->diffs as $diff) { if ($diff[1] !== self::OLD) { $diffs[] = $diff; } } return $diffs; }
[ "public", "function", "getDiffs", "(", ")", "{", "$", "diffs", "=", "array", "(", ")", ";", "foreach", "(", "$", "this", "->", "diffs", "as", "$", "diff", ")", "{", "if", "(", "$", "diff", "[", "1", "]", "!==", "self", "::", "OLD", ")", "{", ...
Gibt alle Diffs ohne old zurück
[ "Gibt", "alle", "Diffs", "ohne", "old", "zurück" ]
train
https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/Code/Differ.php#L45-L53
webforge-labs/psc-cms
lib/Psc/Doctrine/Helper.php
Helper.reindex
public static function reindex($collection, $getIndex = 'getIdentifier') { if (!Code::isTraversable($collection)) { throw new \InvalidArgumentException('$collection muss Traversable sein. '.Code::varInfo($collection)); } $getIndex = Code::castGetter($getIndex); $ret = array(); foreach ($c...
php
public static function reindex($collection, $getIndex = 'getIdentifier') { if (!Code::isTraversable($collection)) { throw new \InvalidArgumentException('$collection muss Traversable sein. '.Code::varInfo($collection)); } $getIndex = Code::castGetter($getIndex); $ret = array(); foreach ($c...
[ "public", "static", "function", "reindex", "(", "$", "collection", ",", "$", "getIndex", "=", "'getIdentifier'", ")", "{", "if", "(", "!", "Code", "::", "isTraversable", "(", "$", "collection", ")", ")", "{", "throw", "new", "\\", "InvalidArgumentException",...
Organisiert die Collection mit einem neuen Index macht eine Kopie der $collection, deshalb erstmal nur array erlaubt, bis ich weiß, was da die arraycollection macht @param string|Closure $getIndex wenn ein Closure wird als erster Parameter das Objekt der Collection übergeben. wenn ein string ist dies der Name des Gett...
[ "Organisiert", "die", "Collection", "mit", "einem", "neuen", "Index" ]
train
https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/Doctrine/Helper.php#L48-L60
webforge-labs/psc-cms
lib/Psc/Doctrine/Helper.php
Helper.map
public static function map($collection, $getProperty) { $getProperty = Code::castGetter($getProperty); $ret = array(); foreach ($collection as $key =>$o) { // nicht direkt collection bearbeiten weil dies bei einen ArrayCollection glaub ich $collection verändern würde $ret[$key] = $getProperty($o...
php
public static function map($collection, $getProperty) { $getProperty = Code::castGetter($getProperty); $ret = array(); foreach ($collection as $key =>$o) { // nicht direkt collection bearbeiten weil dies bei einen ArrayCollection glaub ich $collection verändern würde $ret[$key] = $getProperty($o...
[ "public", "static", "function", "map", "(", "$", "collection", ",", "$", "getProperty", ")", "{", "$", "getProperty", "=", "Code", "::", "castGetter", "(", "$", "getProperty", ")", ";", "$", "ret", "=", "array", "(", ")", ";", "foreach", "(", "$", "c...
Konvertiert den Array in nur Werte die die Propertys von $getProperty sind ist z. B: Praktisch um in PHP Unit Objekte vergleichen zu können Schlüssel bleiben erhalten! $phpUnit->assertEquals(Helper::convert($expectedModes, 'getIdentifier'), Helper::convert($actualModes, 'getIdentifier'), 1,10,TRUE); @return array
[ "Konvertiert", "den", "Array", "in", "nur", "Werte", "die", "die", "Propertys", "von", "$getProperty", "sind" ]
train
https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/Doctrine/Helper.php#L73-L81
webforge-labs/psc-cms
lib/Psc/Doctrine/Helper.php
Helper.mergeUnique
public static function mergeUnique(Array $collection1, Array $collection2, $getIndex1, $getIndex2 = NULL) { $getIndex1 = Code::castGetter($getIndex1); if (!isset($getIndex2)) $getIndex2 = $getIndex1; else $getIndex2 = Code::castGetter($getIndex2); $merge = array(); foreach ($collect...
php
public static function mergeUnique(Array $collection1, Array $collection2, $getIndex1, $getIndex2 = NULL) { $getIndex1 = Code::castGetter($getIndex1); if (!isset($getIndex2)) $getIndex2 = $getIndex1; else $getIndex2 = Code::castGetter($getIndex2); $merge = array(); foreach ($collect...
[ "public", "static", "function", "mergeUnique", "(", "Array", "$", "collection1", ",", "Array", "$", "collection2", ",", "$", "getIndex1", ",", "$", "getIndex2", "=", "NULL", ")", "{", "$", "getIndex1", "=", "Code", "::", "castGetter", "(", "$", "getIndex1"...
Fügt die beiden Collections Ahand der Funktion $getIndex zusammen der Array hat als schlüssel die werte von jedem objekt der collection auf das $getIndex angewandt wurde jedes Element kommt nur einmal vor. @see Code::castGetter()
[ "Fügt", "die", "beiden", "Collections", "Ahand", "der", "Funktion", "$getIndex", "zusammen" ]
train
https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/Doctrine/Helper.php#L100-L119
webforge-labs/psc-cms
lib/Psc/Doctrine/Helper.php
Helper.deleteDiff
public static function deleteDiff($dbCollection, $actualItems) { $convert = $actualItems instanceof Collection; $dbCollection = Code::castArray($dbCollection); $actualItems = self::reindex(Code::castArray($actualItems)); /* Es ist gar nicht so leicht dass mit den php diff etc funktionen (außer vielleic...
php
public static function deleteDiff($dbCollection, $actualItems) { $convert = $actualItems instanceof Collection; $dbCollection = Code::castArray($dbCollection); $actualItems = self::reindex(Code::castArray($actualItems)); /* Es ist gar nicht so leicht dass mit den php diff etc funktionen (außer vielleic...
[ "public", "static", "function", "deleteDiff", "(", "$", "dbCollection", ",", "$", "actualItems", ")", "{", "$", "convert", "=", "$", "actualItems", "instanceof", "Collection", ";", "$", "dbCollection", "=", "Code", "::", "castArray", "(", "$", "dbCollection", ...
Gibt die Elemente aus der $dbCollection zurück, die gelöscht werden müssen (die nicht in $actualItems sind) ist sortierungsunabhängig (die schlüssel werden nicht gecheckt) die Schlüssel sind nicht von 0 - x sondern wild @param \Doctrine\Common\Collections\Collection|array $dbCollection @param \Doctrine\Common\Collect...
[ "Gibt", "die", "Elemente", "aus", "der", "$dbCollection", "zurück", "die", "gelöscht", "werden", "müssen", "(", "die", "nicht", "in", "$actualItems", "sind", ")" ]
train
https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/Doctrine/Helper.php#L131-L157
webforge-labs/psc-cms
lib/Psc/Doctrine/Helper.php
Helper.doSafe
public static function doSafe($flags, Closure $what, EntityManager $em = NULL) { if (!isset($em)) $em = self::em(); $transaction = $flags & self::IN_TRANSACTION; $logging = $flags & self::WITH_LOGGING; $rollback = $flags & self::ROLLBACK; try { if ($transaction) $em->beginTra...
php
public static function doSafe($flags, Closure $what, EntityManager $em = NULL) { if (!isset($em)) $em = self::em(); $transaction = $flags & self::IN_TRANSACTION; $logging = $flags & self::WITH_LOGGING; $rollback = $flags & self::ROLLBACK; try { if ($transaction) $em->beginTra...
[ "public", "static", "function", "doSafe", "(", "$", "flags", ",", "Closure", "$", "what", ",", "EntityManager", "$", "em", "=", "NULL", ")", "{", "if", "(", "!", "isset", "(", "$", "em", ")", ")", "$", "em", "=", "self", "::", "em", "(", ")", "...
Führt Datenbank Aktionen innerhalb eine Safe-Umgebung (try catch - transactional) aus und kann dabei loggen $what bekommt als erstes Argument $em übergeben
[ "Führt", "Datenbank", "Aktionen", "innerhalb", "eine", "Safe", "-", "Umgebung", "(", "try", "catch", "-", "transactional", ")", "aus", "und", "kann", "dabei", "loggen", "$what", "bekommt", "als", "erstes", "Argument", "$em", "übergeben" ]
train
https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/Doctrine/Helper.php#L364-L412
bpolaszek/where
src/SelectQuery/SelectQueryBuilder.php
SelectQueryBuilder.split
public function split(int $buffer, int $max, int $offsetStart = 0): iterable { for ($offset = $offsetStart; $offset < $max; $offset += $buffer) { yield $offset => $this->offset($offset)->limit($buffer); } }
php
public function split(int $buffer, int $max, int $offsetStart = 0): iterable { for ($offset = $offsetStart; $offset < $max; $offset += $buffer) { yield $offset => $this->offset($offset)->limit($buffer); } }
[ "public", "function", "split", "(", "int", "$", "buffer", ",", "int", "$", "max", ",", "int", "$", "offsetStart", "=", "0", ")", ":", "iterable", "{", "for", "(", "$", "offset", "=", "$", "offsetStart", ";", "$", "offset", "<", "$", "max", ";", "...
Split current query into multiple sub-queries (with OFFSET and LIMIT). @param int $buffer @param int $max @param int $offsetStart @return iterable|self[]
[ "Split", "current", "query", "into", "multiple", "sub", "-", "queries", "(", "with", "OFFSET", "and", "LIMIT", ")", "." ]
train
https://github.com/bpolaszek/where/blob/f40c6a97bca831c633ee3b87e2c7e3591af4fdff/src/SelectQuery/SelectQueryBuilder.php#L590-L595
webforge-labs/psc-cms
lib/Psc/Form/DataInput.php
DataInput.get
public function get($keys, $do = self::RETURN_NULL, $default = NULL) { // der default NULL für exception ist eigentlich uninteressant, da es zur Auswertung dieses Wertes vor der Exception nie kommt return parent::get($keys, $do, ($do === self::RETURN_NULL || $do === self::THROW_EXCEPTION) ? NULL : $do); }
php
public function get($keys, $do = self::RETURN_NULL, $default = NULL) { // der default NULL für exception ist eigentlich uninteressant, da es zur Auswertung dieses Wertes vor der Exception nie kommt return parent::get($keys, $do, ($do === self::RETURN_NULL || $do === self::THROW_EXCEPTION) ? NULL : $do); }
[ "public", "function", "get", "(", "$", "keys", ",", "$", "do", "=", "self", "::", "RETURN_NULL", ",", "$", "default", "=", "NULL", ")", "{", "// der default NULL für exception ist eigentlich uninteressant, da es zur Auswertung dieses Wertes vor der Exception nie kommt", "re...
Gibt das Feld mit einem Defaultwert belegt zurück Im FormDataInput ist der dritte Parameter wirkungslos (er wird auf dasselbe wie $do gesetzt) Deshalb ist hier der dritte Parameter unwirksam denn hier gilt $do = $default zu beachten ist auch, dass der Defaultwert im FormDataInput auch genommen wird wenn der Wert trim(...
[ "Gibt", "das", "Feld", "mit", "einem", "Defaultwert", "belegt", "zurück" ]
train
https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/Form/DataInput.php#L36-L39
CakeCMS/Core
src/Utility/Toolbar.php
Toolbar.getInstance
public static function getInstance($name = self::DEFAULT_NAME) { if (empty(self::$_instances[$name])) { self::$_instances[$name] = new Toolbar($name); } return self::$_instances[$name]; }
php
public static function getInstance($name = self::DEFAULT_NAME) { if (empty(self::$_instances[$name])) { self::$_instances[$name] = new Toolbar($name); } return self::$_instances[$name]; }
[ "public", "static", "function", "getInstance", "(", "$", "name", "=", "self", "::", "DEFAULT_NAME", ")", "{", "if", "(", "empty", "(", "self", "::", "$", "_instances", "[", "$", "name", "]", ")", ")", "{", "self", "::", "$", "_instances", "[", "$", ...
Get toolbar instance. @param string $name @return array|Toolbar
[ "Get", "toolbar", "instance", "." ]
train
https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/Utility/Toolbar.php#L92-L99
CakeCMS/Core
src/Utility/Toolbar.php
Toolbar.loadItemType
public function loadItemType($type) { $signature = md5($type); if (isset($this->_buttons[$signature])) { return $this->_buttons[$signature]; } list($plugin, $name) = pluginSplit($type); $alias = Slug::filter($name, '_'); $aliasClass = Inflector::classify(...
php
public function loadItemType($type) { $signature = md5($type); if (isset($this->_buttons[$signature])) { return $this->_buttons[$signature]; } list($plugin, $name) = pluginSplit($type); $alias = Slug::filter($name, '_'); $aliasClass = Inflector::classify(...
[ "public", "function", "loadItemType", "(", "$", "type", ")", "{", "$", "signature", "=", "md5", "(", "$", "type", ")", ";", "if", "(", "isset", "(", "$", "this", "->", "_buttons", "[", "$", "signature", "]", ")", ")", "{", "return", "$", "this", ...
Load object of item type. @param $type @return ToolbarItem|bool
[ "Load", "object", "of", "item", "type", "." ]
train
https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/Utility/Toolbar.php#L127-L146
CakeCMS/Core
src/Utility/Toolbar.php
Toolbar.render
public function render() { $i = 0; $output = []; $count = count($this->_items); foreach ($this->_items as $item) { $i++; $item['class'] = 'item-wrapper tb-item-' . $i; if ($i == 1) { $item['class'] .= ' first'; } ...
php
public function render() { $i = 0; $output = []; $count = count($this->_items); foreach ($this->_items as $item) { $i++; $item['class'] = 'item-wrapper tb-item-' . $i; if ($i == 1) { $item['class'] .= ' first'; } ...
[ "public", "function", "render", "(", ")", "{", "$", "i", "=", "0", ";", "$", "output", "=", "[", "]", ";", "$", "count", "=", "count", "(", "$", "this", "->", "_items", ")", ";", "foreach", "(", "$", "this", "->", "_items", "as", "$", "item", ...
Render toolbar items. @return string @SuppressWarnings(PHPMD.ShortVariable)
[ "Render", "toolbar", "items", "." ]
train
https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/Utility/Toolbar.php#L167-L188
CakeCMS/Core
src/Utility/Toolbar.php
Toolbar.renderItem
public function renderItem(&$node) { $type = $node[0]; $item = $this->loadItemType($type); if ($item === false) { return null; } return $item->render($node); }
php
public function renderItem(&$node) { $type = $node[0]; $item = $this->loadItemType($type); if ($item === false) { return null; } return $item->render($node); }
[ "public", "function", "renderItem", "(", "&", "$", "node", ")", "{", "$", "type", "=", "$", "node", "[", "0", "]", ";", "$", "item", "=", "$", "this", "->", "loadItemType", "(", "$", "type", ")", ";", "if", "(", "$", "item", "===", "false", ")"...
Render toolbar item html. @param $node @return null|string
[ "Render", "toolbar", "item", "html", "." ]
train
https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/Utility/Toolbar.php#L196-L206
CakeCMS/Core
src/Utility/Toolbar.php
Toolbar._getItemClassName
protected function _getItemClassName($plugin, $aliasClass) { if ($plugin === null) { $plugin = 'Core'; } $buttonClass = $plugin . '.' . self::CLASS_NAME_PREFIX . $aliasClass; $className = App::className($buttonClass, self::CLASS_TYPE); if ($className === false...
php
protected function _getItemClassName($plugin, $aliasClass) { if ($plugin === null) { $plugin = 'Core'; } $buttonClass = $plugin . '.' . self::CLASS_NAME_PREFIX . $aliasClass; $className = App::className($buttonClass, self::CLASS_TYPE); if ($className === false...
[ "protected", "function", "_getItemClassName", "(", "$", "plugin", ",", "$", "aliasClass", ")", "{", "if", "(", "$", "plugin", "===", "null", ")", "{", "$", "plugin", "=", "'Core'", ";", "}", "$", "buttonClass", "=", "$", "plugin", ".", "'.'", ".", "s...
Get full class name. @param string $plugin @param string $aliasClass @return bool|string
[ "Get", "full", "class", "name", "." ]
train
https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/Utility/Toolbar.php#L215-L230
spiral-modules/scaffolder
source/Scaffolder/Commands/ServiceCommand.php
ServiceCommand.perform
public function perform() { /** @var ServiceDeclaration $declaration */ $declaration = $this->createDeclaration(); foreach ($this->option('method') as $method) { $declaration->method($method)->setAccess(MethodDeclaration::ACCESS_PUBLIC); } $this->writeDeclaratio...
php
public function perform() { /** @var ServiceDeclaration $declaration */ $declaration = $this->createDeclaration(); foreach ($this->option('method') as $method) { $declaration->method($method)->setAccess(MethodDeclaration::ACCESS_PUBLIC); } $this->writeDeclaratio...
[ "public", "function", "perform", "(", ")", "{", "/** @var ServiceDeclaration $declaration */", "$", "declaration", "=", "$", "this", "->", "createDeclaration", "(", ")", ";", "foreach", "(", "$", "this", "->", "option", "(", "'method'", ")", "as", "$", "method...
Create controller declaration.
[ "Create", "controller", "declaration", "." ]
train
https://github.com/spiral-modules/scaffolder/blob/9be9dd0da6e4b02232db24e797fe5c288afbbddf/source/Scaffolder/Commands/ServiceCommand.php#L36-L46
CakeCMS/Core
src/View/Helper/Traits/HelperTrait.php
HelperTrait._addClass
protected function _addClass(array $options = [], $class = null, $key = 'class') { if (Arr::key($key, $options) && Str::trim($options[$key])) { $options[$key] .= ' ' . $class; } else { $options[$key] = $class; } return $options; }
php
protected function _addClass(array $options = [], $class = null, $key = 'class') { if (Arr::key($key, $options) && Str::trim($options[$key])) { $options[$key] .= ' ' . $class; } else { $options[$key] = $class; } return $options; }
[ "protected", "function", "_addClass", "(", "array", "$", "options", "=", "[", "]", ",", "$", "class", "=", "null", ",", "$", "key", "=", "'class'", ")", "{", "if", "(", "Arr", "::", "key", "(", "$", "key", ",", "$", "options", ")", "&&", "Str", ...
Adds the given class to the element options @param array $options Array options/attributes to add a class to @param string $class The class name being added. @param string $key the key to use for class. @return array Array of options with $key set.
[ "Adds", "the", "given", "class", "to", "the", "element", "options" ]
train
https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/View/Helper/Traits/HelperTrait.php#L40-L48
CakeCMS/Core
src/View/Helper/Traits/HelperTrait.php
HelperTrait._createIcon
protected function _createIcon(HtmlHelper $html, $title, array $options = []) { list($options, $iconOptions) = $this->_createIconAttr($options); if (Arr::key('createIcon', $iconOptions)) { unset($iconOptions['createIcon']); $title = $html->icon($options['icon'], $iconOptions...
php
protected function _createIcon(HtmlHelper $html, $title, array $options = []) { list($options, $iconOptions) = $this->_createIconAttr($options); if (Arr::key('createIcon', $iconOptions)) { unset($iconOptions['createIcon']); $title = $html->icon($options['icon'], $iconOptions...
[ "protected", "function", "_createIcon", "(", "HtmlHelper", "$", "html", ",", "$", "title", ",", "array", "$", "options", "=", "[", "]", ")", "{", "list", "(", "$", "options", ",", "$", "iconOptions", ")", "=", "$", "this", "->", "_createIconAttr", "(",...
Create current icon. @param HtmlHelper $html @param string|int $title @param array $options @return array
[ "Create", "current", "icon", "." ]
train
https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/View/Helper/Traits/HelperTrait.php#L69-L84
CakeCMS/Core
src/View/Helper/Traits/HelperTrait.php
HelperTrait._createIconAttr
protected function _createIconAttr(array $options = []) { $iconOptions = ['class' => '']; if (Arr::key('icon', $options)) { if (Arr::key('iconClass', $options)) { $iconOptions = $this->_addClass($iconOptions, $options['iconClass']); unset($options['iconCl...
php
protected function _createIconAttr(array $options = []) { $iconOptions = ['class' => '']; if (Arr::key('icon', $options)) { if (Arr::key('iconClass', $options)) { $iconOptions = $this->_addClass($iconOptions, $options['iconClass']); unset($options['iconCl...
[ "protected", "function", "_createIconAttr", "(", "array", "$", "options", "=", "[", "]", ")", "{", "$", "iconOptions", "=", "[", "'class'", "=>", "''", "]", ";", "if", "(", "Arr", "::", "key", "(", "'icon'", ",", "$", "options", ")", ")", "{", "if"...
Create icon attributes. @param array $options @return array
[ "Create", "icon", "attributes", "." ]
train
https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/View/Helper/Traits/HelperTrait.php#L92-L106
CakeCMS/Core
src/View/Helper/Traits/HelperTrait.php
HelperTrait._getBtnClass
protected function _getBtnClass(array $options = []) { if (Arr::key('button', $options)) { $button = $options['button']; unset($options['button']); if (is_callable($this->getConfig('prepareBtnClass'))) { return (array) call_user_func($this->getConfig('pre...
php
protected function _getBtnClass(array $options = []) { if (Arr::key('button', $options)) { $button = $options['button']; unset($options['button']); if (is_callable($this->getConfig('prepareBtnClass'))) { return (array) call_user_func($this->getConfig('pre...
[ "protected", "function", "_getBtnClass", "(", "array", "$", "options", "=", "[", "]", ")", "{", "if", "(", "Arr", "::", "key", "(", "'button'", ",", "$", "options", ")", ")", "{", "$", "button", "=", "$", "options", "[", "'button'", "]", ";", "unse...
Create and get button classes. @param array $options @return array
[ "Create", "and", "get", "button", "classes", "." ]
train
https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/View/Helper/Traits/HelperTrait.php#L114-L128
CakeCMS/Core
src/View/Helper/Traits/HelperTrait.php
HelperTrait._getToolTipAttr
protected function _getToolTipAttr(array $options = [], $toggle = 'tooltip') { if (Arr::key('tooltip', $options)) { $tooltip = $options['tooltip']; unset($options['tooltip']); if (is_callable($this->getConfig('prepareTooltip'))) { return (array) call_user...
php
protected function _getToolTipAttr(array $options = [], $toggle = 'tooltip') { if (Arr::key('tooltip', $options)) { $tooltip = $options['tooltip']; unset($options['tooltip']); if (is_callable($this->getConfig('prepareTooltip'))) { return (array) call_user...
[ "protected", "function", "_getToolTipAttr", "(", "array", "$", "options", "=", "[", "]", ",", "$", "toggle", "=", "'tooltip'", ")", "{", "if", "(", "Arr", "::", "key", "(", "'tooltip'", ",", "$", "options", ")", ")", "{", "$", "tooltip", "=", "$", ...
Create and get tooltip attributes. @param array $options @param string $toggle @return array
[ "Create", "and", "get", "tooltip", "attributes", "." ]
train
https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/View/Helper/Traits/HelperTrait.php#L137-L163
CakeCMS/Core
src/View/Helper/Traits/HelperTrait.php
HelperTrait._prepareBeforeAfterContainer
protected function _prepareBeforeAfterContainer($type, $value) { $output = null; $iconClass = ($type === 'before') ? 'prefix' : 'postfix'; if ($value !== null) { $output = $value; if (is_string($output)) { $hasIcon = preg_match('/icon:[a-zA-Z]/', $...
php
protected function _prepareBeforeAfterContainer($type, $value) { $output = null; $iconClass = ($type === 'before') ? 'prefix' : 'postfix'; if ($value !== null) { $output = $value; if (is_string($output)) { $hasIcon = preg_match('/icon:[a-zA-Z]/', $...
[ "protected", "function", "_prepareBeforeAfterContainer", "(", "$", "type", ",", "$", "value", ")", "{", "$", "output", "=", "null", ";", "$", "iconClass", "=", "(", "$", "type", "===", "'before'", ")", "?", "'prefix'", ":", "'postfix'", ";", "if", "(", ...
Prepare before after content for input container. @param string|int $type Set before or after flag. @param string|int $value @return null|string
[ "Prepare", "before", "after", "content", "for", "input", "container", "." ]
train
https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/View/Helper/Traits/HelperTrait.php#L172-L190
CakeCMS/Core
src/View/Helper/Traits/HelperTrait.php
HelperTrait._setBtnClass
protected function _setBtnClass($button, array $options = []) { if ($button !== true) { $classes = [$this->_configRead('btnPref')]; foreach ((array) $button as $button) { $classes[] = $this->_configRead('btnPref') . '-' . $button; } $options = ...
php
protected function _setBtnClass($button, array $options = []) { if ($button !== true) { $classes = [$this->_configRead('btnPref')]; foreach ((array) $button as $button) { $classes[] = $this->_configRead('btnPref') . '-' . $button; } $options = ...
[ "protected", "function", "_setBtnClass", "(", "$", "button", ",", "array", "$", "options", "=", "[", "]", ")", "{", "if", "(", "$", "button", "!==", "true", ")", "{", "$", "classes", "=", "[", "$", "this", "->", "_configRead", "(", "'btnPref'", ")", ...
Setup button classes by options. @param string $button @param array $options @return array
[ "Setup", "button", "classes", "by", "options", "." ]
train
https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/View/Helper/Traits/HelperTrait.php#L199-L210
CakeCMS/Core
src/View/Helper/Traits/HelperTrait.php
HelperTrait._setIconOptions
protected function _setIconOptions(array $options = [], array $iconOptions = []) { $icon = $options['icon']; if (Arr::key('iconInline', $options)) { $iconPrefix = $this->_configRead('iconPref'); $options = $this->_addClass($options, implode(' ', [ $this->_clas...
php
protected function _setIconOptions(array $options = [], array $iconOptions = []) { $icon = $options['icon']; if (Arr::key('iconInline', $options)) { $iconPrefix = $this->_configRead('iconPref'); $options = $this->_addClass($options, implode(' ', [ $this->_clas...
[ "protected", "function", "_setIconOptions", "(", "array", "$", "options", "=", "[", "]", ",", "array", "$", "iconOptions", "=", "[", "]", ")", "{", "$", "icon", "=", "$", "options", "[", "'icon'", "]", ";", "if", "(", "Arr", "::", "key", "(", "'ico...
Setup icon options. @param array $options @param array $iconOptions @return array
[ "Setup", "icon", "options", "." ]
train
https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/View/Helper/Traits/HelperTrait.php#L219-L237
CakeCMS/Core
src/View/Helper/Traits/HelperTrait.php
HelperTrait._setTooltipTitle
protected function _setTooltipTitle($tooltip, array $options = []) { if ($tooltip === true && !Arr::key('title', $options)) { $options['title'] = strip_tags($options['label']); } if (is_string($tooltip)) { $options['title'] = $tooltip; } return $opti...
php
protected function _setTooltipTitle($tooltip, array $options = []) { if ($tooltip === true && !Arr::key('title', $options)) { $options['title'] = strip_tags($options['label']); } if (is_string($tooltip)) { $options['title'] = $tooltip; } return $opti...
[ "protected", "function", "_setTooltipTitle", "(", "$", "tooltip", ",", "array", "$", "options", "=", "[", "]", ")", "{", "if", "(", "$", "tooltip", "===", "true", "&&", "!", "Arr", "::", "key", "(", "'title'", ",", "$", "options", ")", ")", "{", "$...
Setup tooltip title by options. @param string $tooltip @param array $options @return array
[ "Setup", "tooltip", "title", "by", "options", "." ]
train
https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/View/Helper/Traits/HelperTrait.php#L246-L257
aryelgois/yasql-php
src/Utils.php
Utils.arrayAppendLast
public static function arrayAppendLast( array $array, string $last, string $others = null ) { $count = count($array); foreach ($array as $key => $value) { $array[$key] = $value . (--$count > 0 ? $others : $last); } return $array; }
php
public static function arrayAppendLast( array $array, string $last, string $others = null ) { $count = count($array); foreach ($array as $key => $value) { $array[$key] = $value . (--$count > 0 ? $others : $last); } return $array; }
[ "public", "static", "function", "arrayAppendLast", "(", "array", "$", "array", ",", "string", "$", "last", ",", "string", "$", "others", "=", "null", ")", "{", "$", "count", "=", "count", "(", "$", "array", ")", ";", "foreach", "(", "$", "array", "as...
Appends a string to the last item in an array Optionally, appends a string to the other items @param string[] $array Array to receive data @param string $last Appended to the last item @param string $others Appended to the other items
[ "Appends", "a", "string", "to", "the", "last", "item", "in", "an", "array" ]
train
https://github.com/aryelgois/yasql-php/blob/f428b180d35bfc1ddf1f9b3323f9b085fbc09ac7/src/Utils.php#L28-L38
maximebf/events
src/Events/ClassListener.php
ClassListener.handle
public function handle(Event $event) { $args = array(); $method = new \ReflectionMethod($this->object, $this->getMethodName($event)); if ($this->paramsAsArgs) { foreach ($method->getParameters() as $param) { if ($event->hasParam($param->getName())) { ...
php
public function handle(Event $event) { $args = array(); $method = new \ReflectionMethod($this->object, $this->getMethodName($event)); if ($this->paramsAsArgs) { foreach ($method->getParameters() as $param) { if ($event->hasParam($param->getName())) { ...
[ "public", "function", "handle", "(", "Event", "$", "event", ")", "{", "$", "args", "=", "array", "(", ")", ";", "$", "method", "=", "new", "\\", "ReflectionMethod", "(", "$", "this", "->", "object", ",", "$", "this", "->", "getMethodName", "(", "$", ...
{@inheritDoc}
[ "{" ]
train
https://github.com/maximebf/events/blob/b9861c260ee9eaabb9aa986bab76a2e039eb871f/src/Events/ClassListener.php#L63-L84
webforge-labs/psc-cms
lib/PHPWord/PHPWord/Writer/Word2007/Rels.php
PHPWord_Writer_Word2007_Rels._writeRelationship
private function _writeRelationship(PHPWord_Shared_XMLWriter $objWriter = null, $pId = 1, $pType = '', $pTarget = '', $pTargetMode = '') { if($pType != '' && $pTarget != '') { if(strpos($pId, 'rId') === false) { $pId = 'rId' . $pId; } // Write relationship $objWriter->startElement('Relation...
php
private function _writeRelationship(PHPWord_Shared_XMLWriter $objWriter = null, $pId = 1, $pType = '', $pTarget = '', $pTargetMode = '') { if($pType != '' && $pTarget != '') { if(strpos($pId, 'rId') === false) { $pId = 'rId' . $pId; } // Write relationship $objWriter->startElement('Relation...
[ "private", "function", "_writeRelationship", "(", "PHPWord_Shared_XMLWriter", "$", "objWriter", "=", "null", ",", "$", "pId", "=", "1", ",", "$", "pType", "=", "''", ",", "$", "pTarget", "=", "''", ",", "$", "pTargetMode", "=", "''", ")", "{", "if", "(...
Write Override content type @param PHPWord_Shared_XMLWriter $objWriter XML Writer @param int $pId Relationship ID. rId will be prepended! @param string $pType Relationship type @param string $pTarget Relationship target @param string $pTargetMode Relationship target mode @throws Ex...
[ "Write", "Override", "content", "type" ]
train
https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/PHPWord/PHPWord/Writer/Word2007/Rels.php#L89-L109
yuncms/framework
src/helpers/Json.php
Json.decodeIfJson
public static function decodeIfJson(string $str, bool $asArray = true) { try { return static::decode($str, $asArray); } catch (InvalidArgumentException $e) { // Wasn't JSON return $str; } }
php
public static function decodeIfJson(string $str, bool $asArray = true) { try { return static::decode($str, $asArray); } catch (InvalidArgumentException $e) { // Wasn't JSON return $str; } }
[ "public", "static", "function", "decodeIfJson", "(", "string", "$", "str", ",", "bool", "$", "asArray", "=", "true", ")", "{", "try", "{", "return", "static", "::", "decode", "(", "$", "str", ",", "$", "asArray", ")", ";", "}", "catch", "(", "Invalid...
Decodes the given JSON string into a PHP data structure, only if the string is valid JSON. @param string $str The string to be decoded, if it's valid JSON. @param bool $asArray Whether to return objects in terms of associative arrays. @return mixed The PHP data, or the given string if it wasn’t valid JSON.
[ "Decodes", "the", "given", "JSON", "string", "into", "a", "PHP", "data", "structure", "only", "if", "the", "string", "is", "valid", "JSON", "." ]
train
https://github.com/yuncms/framework/blob/af42e28ea4ae15ab8eead3f6d119f93863b94154/src/helpers/Json.php#L27-L35
barebone-php/barebone-core
lib/Request.php
Request.createFromGlobals
public static function createFromGlobals() { $server = Factory::normalizeServer($_SERVER); $files = Factory::normalizeFiles($_FILES); $headers = Factory::marshalHeaders($server); return new static( $server, $files, Factory::marshalUriFromServer($s...
php
public static function createFromGlobals() { $server = Factory::normalizeServer($_SERVER); $files = Factory::normalizeFiles($_FILES); $headers = Factory::marshalHeaders($server); return new static( $server, $files, Factory::marshalUriFromServer($s...
[ "public", "static", "function", "createFromGlobals", "(", ")", "{", "$", "server", "=", "Factory", "::", "normalizeServer", "(", "$", "_SERVER", ")", ";", "$", "files", "=", "Factory", "::", "normalizeFiles", "(", "$", "_FILES", ")", ";", "$", "headers", ...
Create a request from the supplied superglobal values. If any argument is not supplied, the corresponding superglobal value will be used. The ServerRequest created is then passed to the fromServer() method in order to marshal the request URI and headers. @see ServerRequestFactory::fromServer() @throws InvalidArgume...
[ "Create", "a", "request", "from", "the", "supplied", "superglobal", "values", "." ]
train
https://github.com/barebone-php/barebone-core/blob/7fda3a62d5fa103cdc4d2d34e1adf8f3ccbfe2bc/lib/Request.php#L54-L72
barebone-php/barebone-core
lib/Request.php
Request._marshalProtocolVersion
private static function _marshalProtocolVersion($server) { if (!isset($server['SERVER_PROTOCOL'])) { return '1.1'; } if (!preg_match( '#^(HTTP/)?(?P<version>[1-9]\d*(?:\.\d)?)$#', $server['SERVER_PROTOCOL'], $matches ) ) { thro...
php
private static function _marshalProtocolVersion($server) { if (!isset($server['SERVER_PROTOCOL'])) { return '1.1'; } if (!preg_match( '#^(HTTP/)?(?P<version>[1-9]\d*(?:\.\d)?)$#', $server['SERVER_PROTOCOL'], $matches ) ) { thro...
[ "private", "static", "function", "_marshalProtocolVersion", "(", "$", "server", ")", "{", "if", "(", "!", "isset", "(", "$", "server", "[", "'SERVER_PROTOCOL'", "]", ")", ")", "{", "return", "'1.1'", ";", "}", "if", "(", "!", "preg_match", "(", "'#^(HTTP...
Return HTTP protocol version (X.Y) @param array $server The SERVER environment variable @return string
[ "Return", "HTTP", "protocol", "version", "(", "X", ".", "Y", ")" ]
train
https://github.com/barebone-php/barebone-core/blob/7fda3a62d5fa103cdc4d2d34e1adf8f3ccbfe2bc/lib/Request.php#L81-L101
barebone-php/barebone-core
lib/Request.php
Request.getContentType
public function getContentType() { $contentType = null; $_contentType = $this->getHeader('Content-Type'); if (!empty($_contentType)) { $_contentType = explode(';', $_contentType[0]); $contentType = $_contentType[0]; } return $contentType; }
php
public function getContentType() { $contentType = null; $_contentType = $this->getHeader('Content-Type'); if (!empty($_contentType)) { $_contentType = explode(';', $_contentType[0]); $contentType = $_contentType[0]; } return $contentType; }
[ "public", "function", "getContentType", "(", ")", "{", "$", "contentType", "=", "null", ";", "$", "_contentType", "=", "$", "this", "->", "getHeader", "(", "'Content-Type'", ")", ";", "if", "(", "!", "empty", "(", "$", "_contentType", ")", ")", "{", "$...
Get primary content-type header without encoding info @return string|null
[ "Get", "primary", "content", "-", "type", "header", "without", "encoding", "info" ]
train
https://github.com/barebone-php/barebone-core/blob/7fda3a62d5fa103cdc4d2d34e1adf8f3ccbfe2bc/lib/Request.php#L132-L142
barebone-php/barebone-core
lib/Request.php
Request.getParsedBody
public function getParsedBody() { $parsedBody = parent::getParsedBody(); if (empty($parsedBody)) { if ($this->getContentType() == 'application/json') { $input = file_get_contents("php://input"); $parsedBody = json_decode($input, true); } ...
php
public function getParsedBody() { $parsedBody = parent::getParsedBody(); if (empty($parsedBody)) { if ($this->getContentType() == 'application/json') { $input = file_get_contents("php://input"); $parsedBody = json_decode($input, true); } ...
[ "public", "function", "getParsedBody", "(", ")", "{", "$", "parsedBody", "=", "parent", "::", "getParsedBody", "(", ")", ";", "if", "(", "empty", "(", "$", "parsedBody", ")", ")", "{", "if", "(", "$", "this", "->", "getContentType", "(", ")", "==", "...
{@inheritdoc}
[ "{" ]
train
https://github.com/barebone-php/barebone-core/blob/7fda3a62d5fa103cdc4d2d34e1adf8f3ccbfe2bc/lib/Request.php#L147-L159
flextype-components/http
Http.php
Http.setResponseStatus
public static function setResponseStatus(int $status) : void { if (array_key_exists($status, Http::$http_status_messages)) { header('HTTP/1.1 ' . $status . ' ' . Http::$http_status_messages[$status]); } }
php
public static function setResponseStatus(int $status) : void { if (array_key_exists($status, Http::$http_status_messages)) { header('HTTP/1.1 ' . $status . ' ' . Http::$http_status_messages[$status]); } }
[ "public", "static", "function", "setResponseStatus", "(", "int", "$", "status", ")", ":", "void", "{", "if", "(", "array_key_exists", "(", "$", "status", ",", "Http", "::", "$", "http_status_messages", ")", ")", "{", "header", "(", "'HTTP/1.1 '", ".", "$",...
Set response header status Http::setResponseStatus(404); @param integer $status Status code @return void
[ "Set", "response", "header", "status" ]
train
https://github.com/flextype-components/http/blob/97c352f79b216355ba655a1cefcdbe69c134dee5/Http.php#L95-L100
flextype-components/http
Http.php
Http.redirect
public static function redirect(string $url, int $status = 302, int $delay = null) { // Status codes $messages = []; $messages[301] = '301 Moved Permanently'; $messages[302] = '302 Found'; // Is Headers sent ? if (headers_sent()) { echo "<script>document....
php
public static function redirect(string $url, int $status = 302, int $delay = null) { // Status codes $messages = []; $messages[301] = '301 Moved Permanently'; $messages[302] = '302 Found'; // Is Headers sent ? if (headers_sent()) { echo "<script>document....
[ "public", "static", "function", "redirect", "(", "string", "$", "url", ",", "int", "$", "status", "=", "302", ",", "int", "$", "delay", "=", "null", ")", "{", "// Status codes", "$", "messages", "=", "[", "]", ";", "$", "messages", "[", "301", "]", ...
Redirects the browser to a page specified by the $url argument. Http::redirect('test'); @param string $url The URL @param integer $status Status @param integer $delay Delay
[ "Redirects", "the", "browser", "to", "a", "page", "specified", "by", "the", "$url", "argument", "." ]
train
https://github.com/flextype-components/http/blob/97c352f79b216355ba655a1cefcdbe69c134dee5/Http.php#L111-L137
flextype-components/http
Http.php
Http.getBaseUrl
public static function getBaseUrl() : string { $https = (isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on') ? 'https://' : 'http://'; return $https . rtrim(rtrim($_SERVER['HTTP_HOST'], '\\/') . dirname($_SERVER['PHP_SELF']), '\\/'); }
php
public static function getBaseUrl() : string { $https = (isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on') ? 'https://' : 'http://'; return $https . rtrim(rtrim($_SERVER['HTTP_HOST'], '\\/') . dirname($_SERVER['PHP_SELF']), '\\/'); }
[ "public", "static", "function", "getBaseUrl", "(", ")", ":", "string", "{", "$", "https", "=", "(", "isset", "(", "$", "_SERVER", "[", "'HTTPS'", "]", ")", "&&", "strtolower", "(", "$", "_SERVER", "[", "'HTTPS'", "]", ")", "==", "'on'", ")", "?", "...
Gets the base URL echo Http::getBaseUrl(); @return string
[ "Gets", "the", "base", "URL" ]
train
https://github.com/flextype-components/http/blob/97c352f79b216355ba655a1cefcdbe69c134dee5/Http.php#L189-L194
flextype-components/http
Http.php
Http.getUriString
public static function getUriString() : string { // Get request url and script url $url = ''; $request_url = (isset($_SERVER['REQUEST_URI'])) ? $_SERVER['REQUEST_URI'] : ''; $script_url = (isset($_SERVER['PHP_SELF'])) ? $_SERVER['PHP_SELF'] : ''; // Get our url path and tri...
php
public static function getUriString() : string { // Get request url and script url $url = ''; $request_url = (isset($_SERVER['REQUEST_URI'])) ? $_SERVER['REQUEST_URI'] : ''; $script_url = (isset($_SERVER['PHP_SELF'])) ? $_SERVER['PHP_SELF'] : ''; // Get our url path and tri...
[ "public", "static", "function", "getUriString", "(", ")", ":", "string", "{", "// Get request url and script url", "$", "url", "=", "''", ";", "$", "request_url", "=", "(", "isset", "(", "$", "_SERVER", "[", "'REQUEST_URI'", "]", ")", ")", "?", "$", "_SERV...
Get Uri String $uri_string = Http::getUriString(); @access public @return string
[ "Get", "Uri", "String" ]
train
https://github.com/flextype-components/http/blob/97c352f79b216355ba655a1cefcdbe69c134dee5/Http.php#L216-L231
flextype-components/http
Http.php
Http.getUriSegment
public static function getUriSegment(int $segment) { $segments = self::getUriSegments(); return isset($segments[$segment]) ? $segments[$segment] : null; }
php
public static function getUriSegment(int $segment) { $segments = self::getUriSegments(); return isset($segments[$segment]) ? $segments[$segment] : null; }
[ "public", "static", "function", "getUriSegment", "(", "int", "$", "segment", ")", "{", "$", "segments", "=", "self", "::", "getUriSegments", "(", ")", ";", "return", "isset", "(", "$", "segments", "[", "$", "segment", "]", ")", "?", "$", "segments", "[...
Get Uri Segment $uri_segment = Http::getUriSegment(1); @access public @param int $segment segment @return string
[ "Get", "Uri", "Segment" ]
train
https://github.com/flextype-components/http/blob/97c352f79b216355ba655a1cefcdbe69c134dee5/Http.php#L255-L259
npbtrac/yii2-enpii-cms
libs/override/web/NpUrlManager.php
NpUrlManager.processLocaleUrl
protected function processLocaleUrl($request) { $this->_request = $request; $pathInfo = $request->getPathInfo(); $parts = []; foreach ($this->languages as $k => $v) { $value = is_string($k) ? $k : $v; if (substr($value, -2)==='-*') { $lng = substr($value, 0, -2); $parts[] = "$lng\-[a-z]{2,3}"; ...
php
protected function processLocaleUrl($request) { $this->_request = $request; $pathInfo = $request->getPathInfo(); $parts = []; foreach ($this->languages as $k => $v) { $value = is_string($k) ? $k : $v; if (substr($value, -2)==='-*') { $lng = substr($value, 0, -2); $parts[] = "$lng\-[a-z]{2,3}"; ...
[ "protected", "function", "processLocaleUrl", "(", "$", "request", ")", "{", "$", "this", "->", "_request", "=", "$", "request", ";", "$", "pathInfo", "=", "$", "request", "->", "getPathInfo", "(", ")", ";", "$", "parts", "=", "[", "]", ";", "foreach", ...
Checks for a language or locale parameter in the URL and rewrites the pathInfo if found. If no parameter is found it will try to detect the language from persistent storage (session / cookie) or from browser settings. @var \yii\web\Request $request
[ "Checks", "for", "a", "language", "or", "locale", "parameter", "in", "the", "URL", "and", "rewrites", "the", "pathInfo", "if", "found", ".", "If", "no", "parameter", "is", "found", "it", "will", "try", "to", "detect", "the", "language", "from", "persistent...
train
https://github.com/npbtrac/yii2-enpii-cms/blob/3495e697509a57a573983f552629ff9f707a63b9/libs/override/web/NpUrlManager.php#L244-L341
npbtrac/yii2-enpii-cms
libs/override/web/NpUrlManager.php
NpUrlManager.matchCode
protected function matchCode($code) { $language = $code; $country = null; $parts = explode('-', $code); if (count($parts)===2) { $language = $parts[0]; $country = strtoupper($parts[1]); } if (in_array($code, $this->languages)) { return [$language, $country]; } elseif ( $country && in_array("$...
php
protected function matchCode($code) { $language = $code; $country = null; $parts = explode('-', $code); if (count($parts)===2) { $language = $parts[0]; $country = strtoupper($parts[1]); } if (in_array($code, $this->languages)) { return [$language, $country]; } elseif ( $country && in_array("$...
[ "protected", "function", "matchCode", "(", "$", "code", ")", "{", "$", "language", "=", "$", "code", ";", "$", "country", "=", "null", ";", "$", "parts", "=", "explode", "(", "'-'", ",", "$", "code", ")", ";", "if", "(", "count", "(", "$", "parts...
Tests whether the given code matches any of the configured languages. If the code is a single language code, and matches either - an exact language as configured (ll) - a language with a country wildcard (ll-*) this language code is returned. If the code also contains a country code, and matches either - an exact ...
[ "Tests", "whether", "the", "given", "code", "matches", "any", "of", "the", "configured", "languages", "." ]
train
https://github.com/npbtrac/yii2-enpii-cms/blob/3495e697509a57a573983f552629ff9f707a63b9/libs/override/web/NpUrlManager.php#L363-L384
slashworks/control-bundle
src/Slashworks/AppBundle/Controller/AboutController.php
AboutController.aboutAction
public function aboutAction() { $oLicense = LicenseQuery::create()->findOne(); // include symfony requirements class require_once dirname(__FILE__) . '/../../../../app/SymfonyRequirements.php'; $symfonyRequirements = new \SymfonyRequirements(); //...
php
public function aboutAction() { $oLicense = LicenseQuery::create()->findOne(); // include symfony requirements class require_once dirname(__FILE__) . '/../../../../app/SymfonyRequirements.php'; $symfonyRequirements = new \SymfonyRequirements(); //...
[ "public", "function", "aboutAction", "(", ")", "{", "$", "oLicense", "=", "LicenseQuery", "::", "create", "(", ")", "->", "findOne", "(", ")", ";", "// include symfony requirements class", "require_once", "dirname", "(", "__FILE__", ")", ".", "'/../../../../app/Sy...
Display form for license activation @return \Symfony\Component\HttpFoundation\Response
[ "Display", "form", "for", "license", "activation" ]
train
https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Controller/AboutController.php#L44-L72
CakeCMS/Core
src/View/Helper/HtmlHelper.php
HtmlHelper.initialize
public function initialize(array $config) { $isMaterializeCss = $this->getConfig('materializeCss', false); if ($isMaterializeCss === true) { $this->_configWrite('prepareBtnClass', function (Helper $form, $options, $button) { return $this->_prepareBtn($form, $options, $bu...
php
public function initialize(array $config) { $isMaterializeCss = $this->getConfig('materializeCss', false); if ($isMaterializeCss === true) { $this->_configWrite('prepareBtnClass', function (Helper $form, $options, $button) { return $this->_prepareBtn($form, $options, $bu...
[ "public", "function", "initialize", "(", "array", "$", "config", ")", "{", "$", "isMaterializeCss", "=", "$", "this", "->", "getConfig", "(", "'materializeCss'", ",", "false", ")", ";", "if", "(", "$", "isMaterializeCss", "===", "true", ")", "{", "$", "t...
Constructor hook method. Implement this method to avoid having to overwrite the constructor and call parent. @param array $config The configuration settings provided to this helper. @return void
[ "Constructor", "hook", "method", ".", "Implement", "this", "method", "to", "avoid", "having", "to", "overwrite", "the", "constructor", "and", "call", "parent", "." ]
train
https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/View/Helper/HtmlHelper.php#L90-L105
CakeCMS/Core
src/View/Helper/HtmlHelper.php
HtmlHelper.getAssets
public function getAssets($key) { $value = Hash::get($this->_assets, $key); if (is_string($value)) { return $value; } return Hash::sort((array) $value, '{n}.weight', 'asc'); }
php
public function getAssets($key) { $value = Hash::get($this->_assets, $key); if (is_string($value)) { return $value; } return Hash::sort((array) $value, '{n}.weight', 'asc'); }
[ "public", "function", "getAssets", "(", "$", "key", ")", "{", "$", "value", "=", "Hash", "::", "get", "(", "$", "this", "->", "_assets", ",", "$", "key", ")", ";", "if", "(", "is_string", "(", "$", "value", ")", ")", "{", "return", "$", "value", ...
Get sort assets included list. @param string $key @return array|null|string
[ "Get", "sort", "assets", "included", "list", "." ]
train
https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/View/Helper/HtmlHelper.php#L126-L134
CakeCMS/Core
src/View/Helper/HtmlHelper.php
HtmlHelper.icon
public function icon($icon = 'home', array $options = []) { $iconPref = $this->_configRead('iconPref'); $_classes = [ $this->_class(__FUNCTION__), $iconPref, $iconPref . '-' . $icon, ]; $options = $this->_addClass($options, implode(' ', $_classes)...
php
public function icon($icon = 'home', array $options = []) { $iconPref = $this->_configRead('iconPref'); $_classes = [ $this->_class(__FUNCTION__), $iconPref, $iconPref . '-' . $icon, ]; $options = $this->_addClass($options, implode(' ', $_classes)...
[ "public", "function", "icon", "(", "$", "icon", "=", "'home'", ",", "array", "$", "options", "=", "[", "]", ")", "{", "$", "iconPref", "=", "$", "this", "->", "_configRead", "(", "'iconPref'", ")", ";", "$", "_classes", "=", "[", "$", "this", "->",...
Create icon element. @param string $icon @param array $options @return null|string
[ "Create", "icon", "element", "." ]
train
https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/View/Helper/HtmlHelper.php#L143-L161
CakeCMS/Core
src/View/Helper/HtmlHelper.php
HtmlHelper.less
public function less($path, array $options = []) { $cssPath = []; if (!Arr::key('force', $options)) { $options['force'] = false; } if (is_array($path)) { foreach ($path as $i) { if ($result = $this->Less->process($i, $options['force'])) { ...
php
public function less($path, array $options = []) { $cssPath = []; if (!Arr::key('force', $options)) { $options['force'] = false; } if (is_array($path)) { foreach ($path as $i) { if ($result = $this->Less->process($i, $options['force'])) { ...
[ "public", "function", "less", "(", "$", "path", ",", "array", "$", "options", "=", "[", "]", ")", "{", "$", "cssPath", "=", "[", "]", ";", "if", "(", "!", "Arr", "::", "key", "(", "'force'", ",", "$", "options", ")", ")", "{", "$", "options", ...
Creates a CSS stylesheets from less. @param string|array $path @param array $options @return null|string @throws \JBZoo\Less\Exception
[ "Creates", "a", "CSS", "stylesheets", "from", "less", "." ]
train
https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/View/Helper/HtmlHelper.php#L172-L193
CakeCMS/Core
src/View/Helper/HtmlHelper.php
HtmlHelper.link
public function link($title, $url = null, array $options = []) { $options = $this->addClass($options, $this->_class(__FUNCTION__)); $options = Hash::merge([ 'escapeTitle' => false, 'clear' => false, 'label' => $title, ], $options); $is...
php
public function link($title, $url = null, array $options = []) { $options = $this->addClass($options, $this->_class(__FUNCTION__)); $options = Hash::merge([ 'escapeTitle' => false, 'clear' => false, 'label' => $title, ], $options); $is...
[ "public", "function", "link", "(", "$", "title", ",", "$", "url", "=", "null", ",", "array", "$", "options", "=", "[", "]", ")", "{", "$", "options", "=", "$", "this", "->", "addClass", "(", "$", "options", ",", "$", "this", "->", "_class", "(", ...
Create an html link. @param string $title @param null|string|array $url @param array $options @return string
[ "Create", "an", "html", "link", "." ]
train
https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/View/Helper/HtmlHelper.php#L203-L229
CakeCMS/Core
src/View/Helper/HtmlHelper.php
HtmlHelper.status
public function status($status = 0, array $url = [], $icon = 'circle') { $class = (int) $status === 1 ? 'ck-green' : 'ck-red'; if (count($url) === 0) { return $this->icon($icon, ['class' => $class]); } return $this->link(null, 'javascript:void(0);', [ 'icon' ...
php
public function status($status = 0, array $url = [], $icon = 'circle') { $class = (int) $status === 1 ? 'ck-green' : 'ck-red'; if (count($url) === 0) { return $this->icon($icon, ['class' => $class]); } return $this->link(null, 'javascript:void(0);', [ 'icon' ...
[ "public", "function", "status", "(", "$", "status", "=", "0", ",", "array", "$", "url", "=", "[", "]", ",", "$", "icon", "=", "'circle'", ")", "{", "$", "class", "=", "(", "int", ")", "$", "status", "===", "1", "?", "'ck-green'", ":", "'ck-red'",...
Create status icon or link. @param int $status @param array $url @param string $icon @return null|string
[ "Create", "status", "icon", "or", "link", "." ]
train
https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/View/Helper/HtmlHelper.php#L251-L263
CakeCMS/Core
src/View/Helper/HtmlHelper.php
HtmlHelper.toggle
public function toggle(Entity $entity, array $url = [], array $data = []) { if (count($url) === 0) { $url = [ 'action' => 'toggle', 'prefix' => $this->request->getParam('prefix'), 'plugin' => $this->request->getParam('plugin'), ...
php
public function toggle(Entity $entity, array $url = [], array $data = []) { if (count($url) === 0) { $url = [ 'action' => 'toggle', 'prefix' => $this->request->getParam('prefix'), 'plugin' => $this->request->getParam('plugin'), ...
[ "public", "function", "toggle", "(", "Entity", "$", "entity", ",", "array", "$", "url", "=", "[", "]", ",", "array", "$", "data", "=", "[", "]", ")", "{", "if", "(", "count", "(", "$", "url", ")", "===", "0", ")", "{", "$", "url", "=", "[", ...
Create and render ajax toggle element. @param Entity $entity @param array $url @param array $data @return string
[ "Create", "and", "render", "ajax", "toggle", "element", "." ]
train
https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/View/Helper/HtmlHelper.php#L273-L292
CakeCMS/Core
src/View/Helper/HtmlHelper.php
HtmlHelper._setTitleAttr
protected function _setTitleAttr($title, array $options = []) { if (!Arr::key('title', $options)) { $options['title'] = strip_tags($title); } return $options; }
php
protected function _setTitleAttr($title, array $options = []) { if (!Arr::key('title', $options)) { $options['title'] = strip_tags($title); } return $options; }
[ "protected", "function", "_setTitleAttr", "(", "$", "title", ",", "array", "$", "options", "=", "[", "]", ")", "{", "if", "(", "!", "Arr", "::", "key", "(", "'title'", ",", "$", "options", ")", ")", "{", "$", "options", "[", "'title'", "]", "=", ...
Setup default title attr. @param string $title @param array $options @return array
[ "Setup", "default", "title", "attr", "." ]
train
https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/View/Helper/HtmlHelper.php#L314-L321
joomlatools/joomlatools-platform-legacy
code/utilities/xmlelement.php
JXMLElement.asFormattedXml
public function asFormattedXml($compressed = false, $indent = "\t", $level = 0) { JLog::add('JXMLElement::asFormattedXml() is deprecated, use SimpleXMLElement::asXml() instead.', JLog::WARNING, 'deprecated'); $out = ''; // Start a new line, indent by the number indicated in $level $out .= ($compressed) ? '' :...
php
public function asFormattedXml($compressed = false, $indent = "\t", $level = 0) { JLog::add('JXMLElement::asFormattedXml() is deprecated, use SimpleXMLElement::asXml() instead.', JLog::WARNING, 'deprecated'); $out = ''; // Start a new line, indent by the number indicated in $level $out .= ($compressed) ? '' :...
[ "public", "function", "asFormattedXml", "(", "$", "compressed", "=", "false", ",", "$", "indent", "=", "\"\\t\"", ",", "$", "level", "=", "0", ")", "{", "JLog", "::", "add", "(", "'JXMLElement::asFormattedXml() is deprecated, use SimpleXMLElement::asXml() instead.'", ...
Return a well-formed XML string based on SimpleXML element @param boolean $compressed Should we use indentation and newlines ? @param string $indent Indention character. @param integer $level The level within the document which informs the indentation. @return string @since 11.1 @deprecated ...
[ "Return", "a", "well", "-", "formed", "XML", "string", "based", "on", "SimpleXML", "element" ]
train
https://github.com/joomlatools/joomlatools-platform-legacy/blob/3a76944e2f2c415faa6504754c75321a3b478c06/code/utilities/xmlelement.php#L49-L103
steeffeen/FancyManiaLinks
FML/Script/Features/ValuePickerFeature.php
ValuePickerFeature.setLabel
public function setLabel(Label $label) { $label->checkId(); $label->setScriptEvents(true); $this->label = $label; return $this; }
php
public function setLabel(Label $label) { $label->checkId(); $label->setScriptEvents(true); $this->label = $label; return $this; }
[ "public", "function", "setLabel", "(", "Label", "$", "label", ")", "{", "$", "label", "->", "checkId", "(", ")", ";", "$", "label", "->", "setScriptEvents", "(", "true", ")", ";", "$", "this", "->", "label", "=", "$", "label", ";", "return", "$", "...
Set the Label @api @param Label $label Label @return static
[ "Set", "the", "Label" ]
train
https://github.com/steeffeen/FancyManiaLinks/blob/227b0759306f0a3c75873ba50276e4163a93bfa6/FML/Script/Features/ValuePickerFeature.php#L93-L99
steeffeen/FancyManiaLinks
FML/Script/Features/ValuePickerFeature.php
ValuePickerFeature.setValues
public function setValues(array $values) { $this->values = array(); foreach ($values as $value) { $this->addValue($value); } return $this; }
php
public function setValues(array $values) { $this->values = array(); foreach ($values as $value) { $this->addValue($value); } return $this; }
[ "public", "function", "setValues", "(", "array", "$", "values", ")", "{", "$", "this", "->", "values", "=", "array", "(", ")", ";", "foreach", "(", "$", "values", "as", "$", "value", ")", "{", "$", "this", "->", "addValue", "(", "$", "value", ")", ...
Set the possible values @api @param string[] $values Possible values @return static
[ "Set", "the", "possible", "values" ]
train
https://github.com/steeffeen/FancyManiaLinks/blob/227b0759306f0a3c75873ba50276e4163a93bfa6/FML/Script/Features/ValuePickerFeature.php#L157-L164
steeffeen/FancyManiaLinks
FML/Script/Features/ValuePickerFeature.php
ValuePickerFeature.getDefault
public function getDefault() { if ($this->default) { return $this->default; } if (!empty($this->values)) { return reset($this->values); } return null; }
php
public function getDefault() { if ($this->default) { return $this->default; } if (!empty($this->values)) { return reset($this->values); } return null; }
[ "public", "function", "getDefault", "(", ")", "{", "if", "(", "$", "this", "->", "default", ")", "{", "return", "$", "this", "->", "default", ";", "}", "if", "(", "!", "empty", "(", "$", "this", "->", "values", ")", ")", "{", "return", "reset", "...
Get the default value @api @return string
[ "Get", "the", "default", "value" ]
train
https://github.com/steeffeen/FancyManiaLinks/blob/227b0759306f0a3c75873ba50276e4163a93bfa6/FML/Script/Features/ValuePickerFeature.php#L172-L181
steeffeen/FancyManiaLinks
FML/Script/Features/ValuePickerFeature.php
ValuePickerFeature.setDefault
public function setDefault($default) { $this->default = (string)$default; if ($this->default && !in_array($this->default, $this->values, true)) { $this->addValue($this->default); } return $this; }
php
public function setDefault($default) { $this->default = (string)$default; if ($this->default && !in_array($this->default, $this->values, true)) { $this->addValue($this->default); } return $this; }
[ "public", "function", "setDefault", "(", "$", "default", ")", "{", "$", "this", "->", "default", "=", "(", "string", ")", "$", "default", ";", "if", "(", "$", "this", "->", "default", "&&", "!", "in_array", "(", "$", "this", "->", "default", ",", "...
Set the default value @api @param string $default Default value @return static
[ "Set", "the", "default", "value" ]
train
https://github.com/steeffeen/FancyManiaLinks/blob/227b0759306f0a3c75873ba50276e4163a93bfa6/FML/Script/Features/ValuePickerFeature.php#L190-L197
steeffeen/FancyManiaLinks
FML/Script/Features/ValuePickerFeature.php
ValuePickerFeature.buildInitScriptText
protected function buildInitScriptText() { $labelId = Builder::getId($this->label); $entryId = Builder::EMPTY_STRING; if ($this->entry) { $entryId = Builder::getId($this->entry); } $values = Builder::getArray($this->values); $default = Builder::escapeTex...
php
protected function buildInitScriptText() { $labelId = Builder::getId($this->label); $entryId = Builder::EMPTY_STRING; if ($this->entry) { $entryId = Builder::getId($this->entry); } $values = Builder::getArray($this->values); $default = Builder::escapeTex...
[ "protected", "function", "buildInitScriptText", "(", ")", "{", "$", "labelId", "=", "Builder", "::", "getId", "(", "$", "this", "->", "label", ")", ";", "$", "entryId", "=", "Builder", "::", "EMPTY_STRING", ";", "if", "(", "$", "this", "->", "entry", "...
Build the init script text @return string
[ "Build", "the", "init", "script", "text" ]
train
https://github.com/steeffeen/FancyManiaLinks/blob/227b0759306f0a3c75873ba50276e4163a93bfa6/FML/Script/Features/ValuePickerFeature.php#L254-L275
krzysztofmazur/php-object-mapper
src/KrzysztofMazur/ObjectMapper/Mapping/Field/ValueWriter/PropertyValueWriter.php
PropertyValueWriter.writeValue
protected function writeValue($object, $value) { Reflection::getProperty(get_class($object), $this->propertyName)->setValue($object, $value); }
php
protected function writeValue($object, $value) { Reflection::getProperty(get_class($object), $this->propertyName)->setValue($object, $value); }
[ "protected", "function", "writeValue", "(", "$", "object", ",", "$", "value", ")", "{", "Reflection", "::", "getProperty", "(", "get_class", "(", "$", "object", ")", ",", "$", "this", "->", "propertyName", ")", "->", "setValue", "(", "$", "object", ",", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/krzysztofmazur/php-object-mapper/blob/2c22acad9634cfe8e9a75d72e665d450ada8d4e3/src/KrzysztofMazur/ObjectMapper/Mapping/Field/ValueWriter/PropertyValueWriter.php#L37-L40
Lansoweb/LosBase
src/LosBase/Controller/AbstractBaseController.php
AbstractBaseController.getActionRoute
public function getActionRoute($action = null) { if (null === $action) { $action = $this->getEvent() ->getRouteMatch() ->getParam('action'); } return $this->getRouteName().'/'.$action; }
php
public function getActionRoute($action = null) { if (null === $action) { $action = $this->getEvent() ->getRouteMatch() ->getParam('action'); } return $this->getRouteName().'/'.$action; }
[ "public", "function", "getActionRoute", "(", "$", "action", "=", "null", ")", "{", "if", "(", "null", "===", "$", "action", ")", "{", "$", "action", "=", "$", "this", "->", "getEvent", "(", ")", "->", "getRouteMatch", "(", ")", "->", "getParam", "(",...
Retorna uma rota para a ação especificada ou a atual. @param string $action
[ "Retorna", "uma", "rota", "para", "a", "ação", "especificada", "ou", "a", "atual", "." ]
train
https://github.com/Lansoweb/LosBase/blob/90e18a53d29c1bd841c149dca43aa365eecc656d/src/LosBase/Controller/AbstractBaseController.php#L79-L88
VincentChalnot/SidusAdminBundle
Event/AdminControllerInjecter.php
AdminControllerInjecter.onKernelController
public function onKernelController(FilterControllerEvent $event): void { $controller = $event->getController(); if (\is_array($controller)) { [$controller] = $controller; // Ignoring action } if (!$controller instanceof AdminInjectableInterface && !$controller instanceof ...
php
public function onKernelController(FilterControllerEvent $event): void { $controller = $event->getController(); if (\is_array($controller)) { [$controller] = $controller; // Ignoring action } if (!$controller instanceof AdminInjectableInterface && !$controller instanceof ...
[ "public", "function", "onKernelController", "(", "FilterControllerEvent", "$", "event", ")", ":", "void", "{", "$", "controller", "=", "$", "event", "->", "getController", "(", ")", ";", "if", "(", "\\", "is_array", "(", "$", "controller", ")", ")", "{", ...
@param FilterControllerEvent $event @throws \LogicException|\UnexpectedValueException|\InvalidArgumentException
[ "@param", "FilterControllerEvent", "$event" ]
train
https://github.com/VincentChalnot/SidusAdminBundle/blob/3366f3f1525435860cf275ed2f1f0b58cf6eea18/Event/AdminControllerInjecter.php#L30-L68
alphayax/phpdoc_md
src/models/NamespaceMd.php
NamespaceMd.generateTree
public function generateTree( $pad = '', $relativePath = '') { $generatedMd = ''; /// SubPages if( ! empty( $this->subPages)){ foreach( $this->subPages as $subPageName => $subPage){ $subPageFile = './' . $relativePath . $subPageName . DIRECTORY_SEPARATOR . $subPage-...
php
public function generateTree( $pad = '', $relativePath = '') { $generatedMd = ''; /// SubPages if( ! empty( $this->subPages)){ foreach( $this->subPages as $subPageName => $subPage){ $subPageFile = './' . $relativePath . $subPageName . DIRECTORY_SEPARATOR . $subPage-...
[ "public", "function", "generateTree", "(", "$", "pad", "=", "''", ",", "$", "relativePath", "=", "''", ")", "{", "$", "generatedMd", "=", "''", ";", "/// SubPages", "if", "(", "!", "empty", "(", "$", "this", "->", "subPages", ")", ")", "{", "foreach"...
Generate overview markdown tree @param string $pad @param string $relativePath @return string
[ "Generate", "overview", "markdown", "tree" ]
train
https://github.com/alphayax/phpdoc_md/blob/326da10b837161591a32ab4f36f9b2f4feabbe65/src/models/NamespaceMd.php#L73-L96
alphayax/phpdoc_md
src/models/NamespaceMd.php
NamespaceMd.write
public function write(){ $m = new \Mustache_Engine([ 'loader' => new \Mustache_Loader_FilesystemLoader( __DIR__.'/../views') ]); $template = $m->loadTemplate('Page'); $generatedMd = $template->render( $this); $this->writeSubPages(); /// Write page ...
php
public function write(){ $m = new \Mustache_Engine([ 'loader' => new \Mustache_Loader_FilesystemLoader( __DIR__.'/../views') ]); $template = $m->loadTemplate('Page'); $generatedMd = $template->render( $this); $this->writeSubPages(); /// Write page ...
[ "public", "function", "write", "(", ")", "{", "$", "m", "=", "new", "\\", "Mustache_Engine", "(", "[", "'loader'", "=>", "new", "\\", "Mustache_Loader_FilesystemLoader", "(", "__DIR__", ".", "'/../views'", ")", "]", ")", ";", "$", "template", "=", "$", "...
Write markdown file
[ "Write", "markdown", "file" ]
train
https://github.com/alphayax/phpdoc_md/blob/326da10b837161591a32ab4f36f9b2f4feabbe65/src/models/NamespaceMd.php#L101-L115
alphayax/phpdoc_md
src/models/NamespaceMd.php
NamespaceMd.writeSubPages
public function writeSubPages() { foreach( $this->subPages as $subPageName => $subPage) { $subPageDirectory = $this->page_rd . DIRECTORY_SEPARATOR . $subPageName; $subPage->setDirectory( $subPageDirectory); $subPage->write(); } }
php
public function writeSubPages() { foreach( $this->subPages as $subPageName => $subPage) { $subPageDirectory = $this->page_rd . DIRECTORY_SEPARATOR . $subPageName; $subPage->setDirectory( $subPageDirectory); $subPage->write(); } }
[ "public", "function", "writeSubPages", "(", ")", "{", "foreach", "(", "$", "this", "->", "subPages", "as", "$", "subPageName", "=>", "$", "subPage", ")", "{", "$", "subPageDirectory", "=", "$", "this", "->", "page_rd", ".", "DIRECTORY_SEPARATOR", ".", "$",...
Write sub pages of this page
[ "Write", "sub", "pages", "of", "this", "page" ]
train
https://github.com/alphayax/phpdoc_md/blob/326da10b837161591a32ab4f36f9b2f4feabbe65/src/models/NamespaceMd.php#L120-L126
JeanWolf/yii2-jrbac
src/JrbacMenuSearch.php
JrbacMenuSearch.search
public function search($params) { $query = static::find(); // add conditions that should always apply here $dataProvider = new ActiveDataProvider([ 'query' => $query, ]); $this->load($params); if (!$this->validate()) { // uncomment the foll...
php
public function search($params) { $query = static::find(); // add conditions that should always apply here $dataProvider = new ActiveDataProvider([ 'query' => $query, ]); $this->load($params); if (!$this->validate()) { // uncomment the foll...
[ "public", "function", "search", "(", "$", "params", ")", "{", "$", "query", "=", "static", "::", "find", "(", ")", ";", "// add conditions that should always apply here", "$", "dataProvider", "=", "new", "ActiveDataProvider", "(", "[", "'query'", "=>", "$", "q...
Creates data provider instance with search query applied @param array $params @return ActiveDataProvider
[ "Creates", "data", "provider", "instance", "with", "search", "query", "applied" ]
train
https://github.com/JeanWolf/yii2-jrbac/blob/1e5c80038451bd5b385f83cb9344c3bd5edd85e0/src/JrbacMenuSearch.php#L26-L57
php-rise/rise
src/Middlewares/Locale.php
Locale.extractFromPath
public function extractFromPath(Closure $next) { $locale = $this->request->getUrlParam('locale'); if ($this->translation->hasLocale($locale)) { $this->translation->setLocale($locale); $next(); } else { $this->notFound(); } }
php
public function extractFromPath(Closure $next) { $locale = $this->request->getUrlParam('locale'); if ($this->translation->hasLocale($locale)) { $this->translation->setLocale($locale); $next(); } else { $this->notFound(); } }
[ "public", "function", "extractFromPath", "(", "Closure", "$", "next", ")", "{", "$", "locale", "=", "$", "this", "->", "request", "->", "getUrlParam", "(", "'locale'", ")", ";", "if", "(", "$", "this", "->", "translation", "->", "hasLocale", "(", "$", ...
Get locale from request url. To use it, you should put "{locale}" in the routes config. e.g.: $scope->get('/{locale}/products', 'App\Handlers\Handler'); or $scope->prefix('/{locale}'); @param \Closure $next
[ "Get", "locale", "from", "request", "url", ".", "To", "use", "it", "you", "should", "put", "{", "locale", "}", "in", "the", "routes", "config", "." ]
train
https://github.com/php-rise/rise/blob/cd14ef9956f1b6875b7bcd642545dcef6a9152b7/src/Middlewares/Locale.php#L45-L53
userfriendly/SocialUserBundle
Model/UserIdentity.php
UserIdentity.setType
public function setType( $type ) { $this->type = is_int( $type ) ? $type : self::getStorableType( $type ); return $this; }
php
public function setType( $type ) { $this->type = is_int( $type ) ? $type : self::getStorableType( $type ); return $this; }
[ "public", "function", "setType", "(", "$", "type", ")", "{", "$", "this", "->", "type", "=", "is_int", "(", "$", "type", ")", "?", "$", "type", ":", "self", "::", "getStorableType", "(", "$", "type", ")", ";", "return", "$", "this", ";", "}" ]
Set type @param integer $type @return \Userfriendly\Bundle\SocialUserBundle\Model\UserIdentity
[ "Set", "type" ]
train
https://github.com/userfriendly/SocialUserBundle/blob/1dfcf76af2bc639901c471e6f28b04d73fb65452/Model/UserIdentity.php#L80-L84
userfriendly/SocialUserBundle
Model/UserIdentity.php
UserIdentity.getReadableType
static public function getReadableType( $type ) { switch ( $type ) { case self::TYPE_GOOGLE: return 'google'; case self::TYPE_FACEBOOK: return 'facebook'; case self::TYPE_YAHOO: return 'yahoo'; case self::TYPE_TWITTER: return 'twitter'; ...
php
static public function getReadableType( $type ) { switch ( $type ) { case self::TYPE_GOOGLE: return 'google'; case self::TYPE_FACEBOOK: return 'facebook'; case self::TYPE_YAHOO: return 'yahoo'; case self::TYPE_TWITTER: return 'twitter'; ...
[ "static", "public", "function", "getReadableType", "(", "$", "type", ")", "{", "switch", "(", "$", "type", ")", "{", "case", "self", "::", "TYPE_GOOGLE", ":", "return", "'google'", ";", "case", "self", "::", "TYPE_FACEBOOK", ":", "return", "'facebook'", ";...
Convert type to human-readable form @param integer $type @return string
[ "Convert", "type", "to", "human", "-", "readable", "form" ]
train
https://github.com/userfriendly/SocialUserBundle/blob/1dfcf76af2bc639901c471e6f28b04d73fb65452/Model/UserIdentity.php#L112-L121
userfriendly/SocialUserBundle
Model/UserIdentity.php
UserIdentity.getStorableType
static public function getStorableType( $type ) { switch ( $type ) { case 'google': return self::TYPE_GOOGLE; case 'facebook': return self::TYPE_FACEBOOK; case 'yahoo': return self::TYPE_YAHOO; case 'twitter': return self::TYPE_TWITTE...
php
static public function getStorableType( $type ) { switch ( $type ) { case 'google': return self::TYPE_GOOGLE; case 'facebook': return self::TYPE_FACEBOOK; case 'yahoo': return self::TYPE_YAHOO; case 'twitter': return self::TYPE_TWITTE...
[ "static", "public", "function", "getStorableType", "(", "$", "type", ")", "{", "switch", "(", "$", "type", ")", "{", "case", "'google'", ":", "return", "self", "::", "TYPE_GOOGLE", ";", "case", "'facebook'", ":", "return", "self", "::", "TYPE_FACEBOOK", ";...
Convert human-readable type to integer @param string $type @return integer
[ "Convert", "human", "-", "readable", "type", "to", "integer" ]
train
https://github.com/userfriendly/SocialUserBundle/blob/1dfcf76af2bc639901c471e6f28b04d73fb65452/Model/UserIdentity.php#L129-L138
aedart/laravel-helpers
src/Traits/Logging/PsrLogTrait.php
PsrLogTrait.getPsrLog
public function getPsrLog(): ?LoggerInterface { if (!$this->hasPsrLog()) { $this->setPsrLog($this->getDefaultPsrLog()); } return $this->psrLog; }
php
public function getPsrLog(): ?LoggerInterface { if (!$this->hasPsrLog()) { $this->setPsrLog($this->getDefaultPsrLog()); } return $this->psrLog; }
[ "public", "function", "getPsrLog", "(", ")", ":", "?", "LoggerInterface", "{", "if", "(", "!", "$", "this", "->", "hasPsrLog", "(", ")", ")", "{", "$", "this", "->", "setPsrLog", "(", "$", "this", "->", "getDefaultPsrLog", "(", ")", ")", ";", "}", ...
Get psr log If no psr log has been set, this method will set and return a default psr log, if any such value is available @see getDefaultPsrLog() @return LoggerInterface|null psr log or null if none psr log has been set
[ "Get", "psr", "log" ]
train
https://github.com/aedart/laravel-helpers/blob/8b81a2d6658f3f8cb62b6be2c34773aaa2df219a/src/Traits/Logging/PsrLogTrait.php#L53-L59
Double-Opt-in/php-client-api
src/Config/ClientConfig.php
ClientConfig.getAccessTokenCacheFile
public function getAccessTokenCacheFile() { if (empty($this->accessTokenCacheFile)) return null; return $this->accessTokenCacheFile . '_' . $this->siteToken() . '-' . $this->clientId(); }
php
public function getAccessTokenCacheFile() { if (empty($this->accessTokenCacheFile)) return null; return $this->accessTokenCacheFile . '_' . $this->siteToken() . '-' . $this->clientId(); }
[ "public", "function", "getAccessTokenCacheFile", "(", ")", "{", "if", "(", "empty", "(", "$", "this", "->", "accessTokenCacheFile", ")", ")", "return", "null", ";", "return", "$", "this", "->", "accessTokenCacheFile", ".", "'_'", ".", "$", "this", "->", "s...
returns AccessTokenCacheFile appended with site token and client id @return string
[ "returns", "AccessTokenCacheFile" ]
train
https://github.com/Double-Opt-in/php-client-api/blob/2f17da58ec20a408bbd55b2cdd053bc689f995f4/src/Config/ClientConfig.php#L116-L122
Double-Opt-in/php-client-api
src/Config/ClientConfig.php
ClientConfig.setAccessTokenCacheFile
public function setAccessTokenCacheFile($accessTokenCacheFile) { if (is_dir($accessTokenCacheFile)) $accessTokenCacheFile .= DIRECTORY_SEPARATOR; $this->accessTokenCacheFile = $accessTokenCacheFile; return $this; }
php
public function setAccessTokenCacheFile($accessTokenCacheFile) { if (is_dir($accessTokenCacheFile)) $accessTokenCacheFile .= DIRECTORY_SEPARATOR; $this->accessTokenCacheFile = $accessTokenCacheFile; return $this; }
[ "public", "function", "setAccessTokenCacheFile", "(", "$", "accessTokenCacheFile", ")", "{", "if", "(", "is_dir", "(", "$", "accessTokenCacheFile", ")", ")", "$", "accessTokenCacheFile", ".=", "DIRECTORY_SEPARATOR", ";", "$", "this", "->", "accessTokenCacheFile", "=...
sets accessTokenCacheFile @param string $accessTokenCacheFile @return $this
[ "sets", "accessTokenCacheFile" ]
train
https://github.com/Double-Opt-in/php-client-api/blob/2f17da58ec20a408bbd55b2cdd053bc689f995f4/src/Config/ClientConfig.php#L131-L139
periaptio/empress-generator
src/Parser/FieldParser.php
FieldParser.generate
public function generate($table, $schema, $database) { $this->database = $database; $columns = $schema->listTableColumns($table); if (empty($columns)) { return false; } $indexParser = new IndexParser($table, $schema); $fields = $this->setEnum($this->getFi...
php
public function generate($table, $schema, $database) { $this->database = $database; $columns = $schema->listTableColumns($table); if (empty($columns)) { return false; } $indexParser = new IndexParser($table, $schema); $fields = $this->setEnum($this->getFi...
[ "public", "function", "generate", "(", "$", "table", ",", "$", "schema", ",", "$", "database", ")", "{", "$", "this", "->", "database", "=", "$", "database", ";", "$", "columns", "=", "$", "schema", "->", "listTableColumns", "(", "$", "table", ")", "...
Create array of all the fields for a table @param string $table Table Name @param \Doctrine\DBAL\Schema\AbstractSchemaManager $schema @param string $database @return array|bool
[ "Create", "array", "of", "all", "the", "fields", "for", "a", "table" ]
train
https://github.com/periaptio/empress-generator/blob/749fb4b12755819e9c97377ebfb446ee0822168a/src/Parser/FieldParser.php#L34-L46
SimonEast/Simple-Ansi-Colors
Ansi.php
Ansi.tagsToColors
public static function tagsToColors($string) { if (static::$enabled === null) { static::$enabled = !static::isWindows() || static::isAnsiCon(); } if (!static::$enabled) { // Strip tags (replace them with an empty string) return str_replace(array_keys(stat...
php
public static function tagsToColors($string) { if (static::$enabled === null) { static::$enabled = !static::isWindows() || static::isAnsiCon(); } if (!static::$enabled) { // Strip tags (replace them with an empty string) return str_replace(array_keys(stat...
[ "public", "static", "function", "tagsToColors", "(", "$", "string", ")", "{", "if", "(", "static", "::", "$", "enabled", "===", "null", ")", "{", "static", "::", "$", "enabled", "=", "!", "static", "::", "isWindows", "(", ")", "||", "static", "::", "...
This is the primary function for converting tags to ANSI color codes (see the class description for the supported tags) For safety, this function always appends a <reset> at the end, otherwise the console may stick permanently in the colors you have used. @param string $string @return string
[ "This", "is", "the", "primary", "function", "for", "converting", "tags", "to", "ANSI", "color", "codes", "(", "see", "the", "class", "description", "for", "the", "supported", "tags", ")" ]
train
https://github.com/SimonEast/Simple-Ansi-Colors/blob/7b0abb5d779e25fffd26bcceb3d88278d1c064ed/Ansi.php#L97-L111
Lansoweb/LosReCaptcha
src/Captcha/Invisible.php
Invisible.isValid
public function isValid($value, $context = null) { if (empty($value)) { $this->error(self::MISSING_VALUE); return false; } $service = $this->getService(); $res = $service->verify($value); if (! $res) { $this->error(self::ERR_CAPTCHA); ...
php
public function isValid($value, $context = null) { if (empty($value)) { $this->error(self::MISSING_VALUE); return false; } $service = $this->getService(); $res = $service->verify($value); if (! $res) { $this->error(self::ERR_CAPTCHA); ...
[ "public", "function", "isValid", "(", "$", "value", ",", "$", "context", "=", "null", ")", "{", "if", "(", "empty", "(", "$", "value", ")", ")", "{", "$", "this", "->", "error", "(", "self", "::", "MISSING_VALUE", ")", ";", "return", "false", ";", ...
Validate captcha @see \Zend\Validator\ValidatorInterface::isValid() @param mixed $value @param mixed $context @return bool
[ "Validate", "captcha" ]
train
https://github.com/Lansoweb/LosReCaptcha/blob/8df866995501db087c3850f97fd2b6547632e6ed/src/Captcha/Invisible.php#L117-L138
benmanu/silverstripe-knowledgebase
code/forms/KnowledgeBaseSearchForm.php
KnowledgeBaseSearchForm.doSearchKnowledgeBase
public function doSearchKnowledgeBase($data, $form) { if (!$this->kbPageId) { return $this->controller->redirectBack(); } $page = KnowledgebasePage::get()->byID($this->kbPageId); // just in case the page doesn't actually exist anymore if (!$page) { r...
php
public function doSearchKnowledgeBase($data, $form) { if (!$this->kbPageId) { return $this->controller->redirectBack(); } $page = KnowledgebasePage::get()->byID($this->kbPageId); // just in case the page doesn't actually exist anymore if (!$page) { r...
[ "public", "function", "doSearchKnowledgeBase", "(", "$", "data", ",", "$", "form", ")", "{", "if", "(", "!", "$", "this", "->", "kbPageId", ")", "{", "return", "$", "this", "->", "controller", "->", "redirectBack", "(", ")", ";", "}", "$", "page", "=...
Handler for the form submission. @param array $data @param Form $form @return SS_HTTPResponse
[ "Handler", "for", "the", "form", "submission", "." ]
train
https://github.com/benmanu/silverstripe-knowledgebase/blob/db19bfd4836f43da17ab52e8b53e72a11be64210/code/forms/KnowledgeBaseSearchForm.php#L62-L83
2amigos/yiifoundation
helpers/Button.php
Button.button
public static function button($label = 'button', $htmlOptions = array()) { $htmlOptions = ArrayHelper::defaultValue('name', \CHtml::ID_PREFIX . \CHtml::$count++, $htmlOptions); Html::clientChange('click', $htmlOptions); return static::btn('button', $label, $htmlOptions); }
php
public static function button($label = 'button', $htmlOptions = array()) { $htmlOptions = ArrayHelper::defaultValue('name', \CHtml::ID_PREFIX . \CHtml::$count++, $htmlOptions); Html::clientChange('click', $htmlOptions); return static::btn('button', $label, $htmlOptions); }
[ "public", "static", "function", "button", "(", "$", "label", "=", "'button'", ",", "$", "htmlOptions", "=", "array", "(", ")", ")", "{", "$", "htmlOptions", "=", "ArrayHelper", "::", "defaultValue", "(", "'name'", ",", "\\", "CHtml", "::", "ID_PREFIX", "...
Generates a button @param string $label @param array $htmlOptions @return string the generated button.
[ "Generates", "a", "button" ]
train
https://github.com/2amigos/yiifoundation/blob/49bed0d3ca1a9bac9299000e48a2661bdc8f9a29/helpers/Button.php#L28-L33
2amigos/yiifoundation
helpers/Button.php
Button.group
public static function group($buttons, $htmlOptions = array()) { ArrayHelper::addValue('class', 'button-group', $htmlOptions); ob_start(); echo \CHtml::openTag('ul', $htmlOptions); foreach ($buttons as $button) { echo $button; } echo \CHtml::closeTag('ul'...
php
public static function group($buttons, $htmlOptions = array()) { ArrayHelper::addValue('class', 'button-group', $htmlOptions); ob_start(); echo \CHtml::openTag('ul', $htmlOptions); foreach ($buttons as $button) { echo $button; } echo \CHtml::closeTag('ul'...
[ "public", "static", "function", "group", "(", "$", "buttons", ",", "$", "htmlOptions", "=", "array", "(", ")", ")", "{", "ArrayHelper", "::", "addValue", "(", "'class'", ",", "'button-group'", ",", "$", "htmlOptions", ")", ";", "ob_start", "(", ")", ";",...
Generates a group of link buttons @param array $buttons the link buttons to render in a group @param array $htmlOptions @return string @see http://foundation.zurb.com/docs/components/button-groups.html
[ "Generates", "a", "group", "of", "link", "buttons" ]
train
https://github.com/2amigos/yiifoundation/blob/49bed0d3ca1a9bac9299000e48a2661bdc8f9a29/helpers/Button.php#L54-L66
2amigos/yiifoundation
helpers/Button.php
Button.bar
public static function bar($groups, $htmlOptions = array()) { ArrayHelper::addValue('class', 'button-bar', $htmlOptions); ob_start(); echo \CHtml::openTag('div', $htmlOptions); foreach ($groups as $group) { echo $group; } echo \CHtml::closeTag('div'); ...
php
public static function bar($groups, $htmlOptions = array()) { ArrayHelper::addValue('class', 'button-bar', $htmlOptions); ob_start(); echo \CHtml::openTag('div', $htmlOptions); foreach ($groups as $group) { echo $group; } echo \CHtml::closeTag('div'); ...
[ "public", "static", "function", "bar", "(", "$", "groups", ",", "$", "htmlOptions", "=", "array", "(", ")", ")", "{", "ArrayHelper", "::", "addValue", "(", "'class'", ",", "'button-bar'", ",", "$", "htmlOptions", ")", ";", "ob_start", "(", ")", ";", "e...
Generates a button bar by wrapping multiple button groups into a button-bar @param array $groups the button group to wrap @param array $htmlOptions @return string
[ "Generates", "a", "button", "bar", "by", "wrapping", "multiple", "button", "groups", "into", "a", "button", "-", "bar" ]
train
https://github.com/2amigos/yiifoundation/blob/49bed0d3ca1a9bac9299000e48a2661bdc8f9a29/helpers/Button.php#L74-L86
2amigos/yiifoundation
helpers/Button.php
Button.btn
public static function btn($tag, $label, $htmlOptions = array()) { ArrayHelper::addValue('class', 'button', $htmlOptions); $icon = ArrayHelper::removeValue($htmlOptions, 'icon'); if (isset($icon)) $label = Icon::icon($icon) . '&nbsp;' . $label; return \CHtml::tag($tag, ...
php
public static function btn($tag, $label, $htmlOptions = array()) { ArrayHelper::addValue('class', 'button', $htmlOptions); $icon = ArrayHelper::removeValue($htmlOptions, 'icon'); if (isset($icon)) $label = Icon::icon($icon) . '&nbsp;' . $label; return \CHtml::tag($tag, ...
[ "public", "static", "function", "btn", "(", "$", "tag", ",", "$", "label", ",", "$", "htmlOptions", "=", "array", "(", ")", ")", "{", "ArrayHelper", "::", "addValue", "(", "'class'", ",", "'button'", ",", "$", "htmlOptions", ")", ";", "$", "icon", "=...
Generates a button. @param string $tag the HTML tag. @param string $label the button label text. @param array $htmlOptions additional HTML attributes. @return string the generated button.
[ "Generates", "a", "button", "." ]
train
https://github.com/2amigos/yiifoundation/blob/49bed0d3ca1a9bac9299000e48a2661bdc8f9a29/helpers/Button.php#L95-L104
2amigos/yiifoundation
helpers/Button.php
Button.dropdown
public static function dropdown($label, $list, $htmlOptions = array()) { $id = Enum::ID_PREFIX . '-' . Html::$count++; ArrayHelper::addValue('data-dropdown', $id, $htmlOptions); ArrayHelper::addValue('class', Enum::DROPDOWN, $htmlOptions); $dropHtmlOptions ...
php
public static function dropdown($label, $list, $htmlOptions = array()) { $id = Enum::ID_PREFIX . '-' . Html::$count++; ArrayHelper::addValue('data-dropdown', $id, $htmlOptions); ArrayHelper::addValue('class', Enum::DROPDOWN, $htmlOptions); $dropHtmlOptions ...
[ "public", "static", "function", "dropdown", "(", "$", "label", ",", "$", "list", ",", "$", "htmlOptions", "=", "array", "(", ")", ")", "{", "$", "id", "=", "Enum", "::", "ID_PREFIX", ".", "'-'", ".", "Html", "::", "$", "count", "++", ";", "ArrayHel...
Generates a dropdown button. Important: This method does not formats your list items into links, you have to pass them as link tags. For a more flexible solution use the widget. @param string $label @param array $list of link items to be displayed on the dropdown menu @param array $htmlOptions the HTML attributes. It ...
[ "Generates", "a", "dropdown", "button", ".", "Important", ":", "This", "method", "does", "not", "formats", "your", "list", "items", "into", "links", "you", "have", "to", "pass", "them", "as", "link", "tags", ".", "For", "a", "more", "flexible", "solution",...
train
https://github.com/2amigos/yiifoundation/blob/49bed0d3ca1a9bac9299000e48a2661bdc8f9a29/helpers/Button.php#L116-L138
alanpich/slender
src/App.php
App.loadConfigDefaults
protected function loadConfigDefaults($userSettings) { $parser = $this['config-parser']; $defaults = $parser->parseFile(__DIR__ . '/slender.yml'); $userSettings = array_merge_recursive($defaults, $userSettings); $this['settings']->setArray($userSettings); }
php
protected function loadConfigDefaults($userSettings) { $parser = $this['config-parser']; $defaults = $parser->parseFile(__DIR__ . '/slender.yml'); $userSettings = array_merge_recursive($defaults, $userSettings); $this['settings']->setArray($userSettings); }
[ "protected", "function", "loadConfigDefaults", "(", "$", "userSettings", ")", "{", "$", "parser", "=", "$", "this", "[", "'config-parser'", "]", ";", "$", "defaults", "=", "$", "parser", "->", "parseFile", "(", "__DIR__", ".", "'/slender.yml'", ")", ";", "...
Load up config defaults This is a hardcoded config file within Slender core that sets up sane default values for config @var ConfigFileParserInterface $parser
[ "Load", "up", "config", "defaults" ]
train
https://github.com/alanpich/slender/blob/247f5c08af20cda95b116eb5d9f6f623d61e8a8a/src/App.php#L91-L97
alanpich/slender
src/App.php
App.loadApplicationConfigFiles
protected function loadApplicationConfigFiles($userSettings) { $parser = $this['config-parser']; $loader = $this['config-finder']; $userSettings = array(); foreach ($loader->findFiles() as $path) { if (is_readable($path)) { $parsedFile = $parser->parseFile...
php
protected function loadApplicationConfigFiles($userSettings) { $parser = $this['config-parser']; $loader = $this['config-finder']; $userSettings = array(); foreach ($loader->findFiles() as $path) { if (is_readable($path)) { $parsedFile = $parser->parseFile...
[ "protected", "function", "loadApplicationConfigFiles", "(", "$", "userSettings", ")", "{", "$", "parser", "=", "$", "this", "[", "'config-parser'", "]", ";", "$", "loader", "=", "$", "this", "[", "'config-finder'", "]", ";", "$", "userSettings", "=", "array"...
Load any application config files @var ConfigFileFinderInterface $loader
[ "Load", "any", "application", "config", "files" ]
train
https://github.com/alanpich/slender/blob/247f5c08af20cda95b116eb5d9f6f623d61e8a8a/src/App.php#L104-L119
alanpich/slender
src/App.php
App.registerService
public function registerService($service, $class) { $this[$service] = function ($app) use ($class) { $inst = new $class; if ($inst instanceof FactoryInterface) { return $inst->create($app); } else { return $inst; ...
php
public function registerService($service, $class) { $this[$service] = function ($app) use ($class) { $inst = new $class; if ($inst instanceof FactoryInterface) { return $inst->create($app); } else { return $inst; ...
[ "public", "function", "registerService", "(", "$", "service", ",", "$", "class", ")", "{", "$", "this", "[", "$", "service", "]", "=", "function", "(", "$", "app", ")", "use", "(", "$", "class", ")", "{", "$", "inst", "=", "new", "$", "class", ";...
Register a Service to the DI container. Services are singletons, and the same instance is returned every time the identifier is requested @param string $service identifier @param string $class Class to create
[ "Register", "a", "Service", "to", "the", "DI", "container", ".", "Services", "are", "singletons", "and", "the", "same", "instance", "is", "returned", "every", "time", "the", "identifier", "is", "requested" ]
train
https://github.com/alanpich/slender/blob/247f5c08af20cda95b116eb5d9f6f623d61e8a8a/src/App.php#L129-L139
alanpich/slender
src/App.php
App.registerFactory
public function registerFactory($factory, $class) { $this[$factory] = $this->factory(function ($app) use ($class) { $obj = new $class; if ($obj instanceof FactoryInterface) { return $obj->create($app); } else { return $obj; } ...
php
public function registerFactory($factory, $class) { $this[$factory] = $this->factory(function ($app) use ($class) { $obj = new $class; if ($obj instanceof FactoryInterface) { return $obj->create($app); } else { return $obj; } ...
[ "public", "function", "registerFactory", "(", "$", "factory", ",", "$", "class", ")", "{", "$", "this", "[", "$", "factory", "]", "=", "$", "this", "->", "factory", "(", "function", "(", "$", "app", ")", "use", "(", "$", "class", ")", "{", "$", "...
Register a Factory to the DI container. Factories return a new instance of a class each time they are called @param string $factory identifier @param string $class Class to create
[ "Register", "a", "Factory", "to", "the", "DI", "container", ".", "Factories", "return", "a", "new", "instance", "of", "a", "class", "each", "time", "they", "are", "called" ]
train
https://github.com/alanpich/slender/blob/247f5c08af20cda95b116eb5d9f6f623d61e8a8a/src/App.php#L149-L159
alanpich/slender
src/App.php
App.registerCoreServices
protected function registerCoreServices() { $this['util'] = function ($app) { return new \Slender\Core\Util\Util(); }; $this->registerService('dependency-injector','Slender\Core\DependencyInjector\Factory'); $this->registerService('autoloader', 'Slender\Core\Autoloader\A...
php
protected function registerCoreServices() { $this['util'] = function ($app) { return new \Slender\Core\Util\Util(); }; $this->registerService('dependency-injector','Slender\Core\DependencyInjector\Factory'); $this->registerService('autoloader', 'Slender\Core\Autoloader\A...
[ "protected", "function", "registerCoreServices", "(", ")", "{", "$", "this", "[", "'util'", "]", "=", "function", "(", "$", "app", ")", "{", "return", "new", "\\", "Slender", "\\", "Core", "\\", "Util", "\\", "Util", "(", ")", ";", "}", ";", "$", "...
Registers core services to the IoC Container
[ "Registers", "core", "services", "to", "the", "IoC", "Container" ]
train
https://github.com/alanpich/slender/blob/247f5c08af20cda95b116eb5d9f6f623d61e8a8a/src/App.php#L236-L311