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
lasallecms/lasallecms-l5-lasallecmsapi-pkg
src/FeaturedImageProcessing/FeaturedImageProcessing.php
FeaturedImageProcessing.validateFeaturedImageServer
public function validateFeaturedImageServer($featuredImageServer) { // if there is no featured_image_server, then there is no featured image -- which is ok if ((!$featuredImageServer) || ($featuredImageServer == "") ) { return "passed"; } // not acceptable file extension ...
php
public function validateFeaturedImageServer($featuredImageServer) { // if there is no featured_image_server, then there is no featured image -- which is ok if ((!$featuredImageServer) || ($featuredImageServer == "") ) { return "passed"; } // not acceptable file extension ...
[ "public", "function", "validateFeaturedImageServer", "(", "$", "featuredImageServer", ")", "{", "// if there is no featured_image_server, then there is no featured image -- which is ok", "if", "(", "(", "!", "$", "featuredImageServer", ")", "||", "(", "$", "featuredImageServer"...
Validate the featured_image_server field's data @param string $featuredImageServer The featured_image_server form field's value @return string "passed", or an error message
[ "Validate", "the", "featured_image_server", "field", "s", "data" ]
train
https://github.com/lasallecms/lasallecms-l5-lasallecmsapi-pkg/blob/05083be19645d52be86d8ba4f322773db348a11d/src/FeaturedImageProcessing/FeaturedImageProcessing.php#L201-L219
lasallecms/lasallecms-l5-lasallecmsapi-pkg
src/FeaturedImageProcessing/FeaturedImageProcessing.php
FeaturedImageProcessing.isImageFileExtensionKosher
public function isImageFileExtensionKosher($filename) { // must have acceptable file extension $imageFileExtension = $this->ImagesHelper->filenameWithExtensionOnly($filename); $haystack = Config::get('lasallecmsfrontend.acceptable_image_extensions_for_uploading'); if (in_array(strtolo...
php
public function isImageFileExtensionKosher($filename) { // must have acceptable file extension $imageFileExtension = $this->ImagesHelper->filenameWithExtensionOnly($filename); $haystack = Config::get('lasallecmsfrontend.acceptable_image_extensions_for_uploading'); if (in_array(strtolo...
[ "public", "function", "isImageFileExtensionKosher", "(", "$", "filename", ")", "{", "// must have acceptable file extension", "$", "imageFileExtension", "=", "$", "this", "->", "ImagesHelper", "->", "filenameWithExtensionOnly", "(", "$", "filename", ")", ";", "$", "ha...
Is the image's extension allowed? @param string $filename The image's filename @return bool
[ "Is", "the", "image", "s", "extension", "allowed?" ]
train
https://github.com/lasallecms/lasallecms-l5-lasallecmsapi-pkg/blob/05083be19645d52be86d8ba4f322773db348a11d/src/FeaturedImageProcessing/FeaturedImageProcessing.php#L238-L250
lasallecms/lasallecms-l5-lasallecmsapi-pkg
src/FeaturedImageProcessing/FeaturedImageProcessing.php
FeaturedImageProcessing.doesImageFileExistOnServer
public function doesImageFileExistOnServer($filename) { if (\File::exists($this->ImagesHelper->pathOfImagesUploadParentFolder() . "/" . Config::get('lasallecmsfrontend.images_folder_uploaded'). '/'. $filename)) { return true; } return false; }
php
public function doesImageFileExistOnServer($filename) { if (\File::exists($this->ImagesHelper->pathOfImagesUploadParentFolder() . "/" . Config::get('lasallecmsfrontend.images_folder_uploaded'). '/'. $filename)) { return true; } return false; }
[ "public", "function", "doesImageFileExistOnServer", "(", "$", "filename", ")", "{", "if", "(", "\\", "File", "::", "exists", "(", "$", "this", "->", "ImagesHelper", "->", "pathOfImagesUploadParentFolder", "(", ")", ".", "\"/\"", ".", "Config", "::", "get", "...
Does the iamge file exist already on the server? @param string $filename The image's filename @return bool
[ "Does", "the", "iamge", "file", "exist", "already", "on", "the", "server?" ]
train
https://github.com/lasallecms/lasallecms-l5-lasallecmsapi-pkg/blob/05083be19645d52be86d8ba4f322773db348a11d/src/FeaturedImageProcessing/FeaturedImageProcessing.php#L258-L264
lasallecms/lasallecms-l5-lasallecmsapi-pkg
src/FeaturedImageProcessing/FeaturedImageProcessing.php
FeaturedImageProcessing.moveFile
public function moveFile($filename) { $destinationPath = $this->ImagesHelper->pathOfImagesUploadParentFolder() . "/" . Config::get('lasallecmsfrontend.images_folder_uploaded'); \Input::file('featured_image_upload')->move($destinationPath, $filename); }
php
public function moveFile($filename) { $destinationPath = $this->ImagesHelper->pathOfImagesUploadParentFolder() . "/" . Config::get('lasallecmsfrontend.images_folder_uploaded'); \Input::file('featured_image_upload')->move($destinationPath, $filename); }
[ "public", "function", "moveFile", "(", "$", "filename", ")", "{", "$", "destinationPath", "=", "$", "this", "->", "ImagesHelper", "->", "pathOfImagesUploadParentFolder", "(", ")", ".", "\"/\"", ".", "Config", "::", "get", "(", "'lasallecmsfrontend.images_folder_up...
Move the uploaded file from the tmp folder to its proper destination folder @param string $filename The image's filename @return null
[ "Move", "the", "uploaded", "file", "from", "the", "tmp", "folder", "to", "its", "proper", "destination", "folder" ]
train
https://github.com/lasallecms/lasallecms-l5-lasallecmsapi-pkg/blob/05083be19645d52be86d8ba4f322773db348a11d/src/FeaturedImageProcessing/FeaturedImageProcessing.php#L277-L282
itiqiti/dev-lib
src/Extension/Core/Command/InfoCommand.php
InfoCommand.execute
public function execute(array $args = [], array $options = []) { $path = getcwd().'/README.md'; $this->writeln($this->replaceVars("Project <info>{{project_name}}</info> <comment>({{project_group}})</comment>", $this->getConfig())); $this->writeln(); if (is_file($path)) { ...
php
public function execute(array $args = [], array $options = []) { $path = getcwd().'/README.md'; $this->writeln($this->replaceVars("Project <info>{{project_name}}</info> <comment>({{project_group}})</comment>", $this->getConfig())); $this->writeln(); if (is_file($path)) { ...
[ "public", "function", "execute", "(", "array", "$", "args", "=", "[", "]", ",", "array", "$", "options", "=", "[", "]", ")", "{", "$", "path", "=", "getcwd", "(", ")", ".", "'/README.md'", ";", "$", "this", "->", "writeln", "(", "$", "this", "->"...
@param array $args @param array $options @return void
[ "@param", "array", "$args", "@param", "array", "$options" ]
train
https://github.com/itiqiti/dev-lib/blob/6f99f9332270095e072e75fd9f3a6c7e1d2cb7d8/src/Extension/Core/Command/InfoCommand.php#L25-L35
Ydle/HubBundle
Entity/RoomType.php
RoomType.addRoom
public function addRoom(\Ydle\HubBundle\Entity\Room $rooms) { $this->rooms[] = $rooms; return $this; }
php
public function addRoom(\Ydle\HubBundle\Entity\Room $rooms) { $this->rooms[] = $rooms; return $this; }
[ "public", "function", "addRoom", "(", "\\", "Ydle", "\\", "HubBundle", "\\", "Entity", "\\", "Room", "$", "rooms", ")", "{", "$", "this", "->", "rooms", "[", "]", "=", "$", "rooms", ";", "return", "$", "this", ";", "}" ]
Add rooms @param \Ydle\HubBundle\Entity\Room $rooms @return RoomType
[ "Add", "rooms" ]
train
https://github.com/Ydle/HubBundle/blob/7fa423241246bcfd115f2ed3ad3997b4b63adb01/Entity/RoomType.php#L187-L192
Ydle/HubBundle
Entity/RoomType.php
RoomType.removeRoom
public function removeRoom(\Ydle\HubBundle\Entity\Room $rooms) { $this->rooms->removeElement($rooms); }
php
public function removeRoom(\Ydle\HubBundle\Entity\Room $rooms) { $this->rooms->removeElement($rooms); }
[ "public", "function", "removeRoom", "(", "\\", "Ydle", "\\", "HubBundle", "\\", "Entity", "\\", "Room", "$", "rooms", ")", "{", "$", "this", "->", "rooms", "->", "removeElement", "(", "$", "rooms", ")", ";", "}" ]
Remove rooms @param \Ydle\HubBundle\Entity\Room $rooms
[ "Remove", "rooms" ]
train
https://github.com/Ydle/HubBundle/blob/7fa423241246bcfd115f2ed3ad3997b4b63adb01/Entity/RoomType.php#L199-L202
Ydle/HubBundle
Entity/RoomType.php
RoomType.toArray
public function toArray() { return array( 'id' => $this->getId(), 'name' => $this->getName(), 'description' => $this->getDescription(), 'is_active' => $this->getIsActive(), 'nb_rooms' => $this->getRooms()->count() ); }
php
public function toArray() { return array( 'id' => $this->getId(), 'name' => $this->getName(), 'description' => $this->getDescription(), 'is_active' => $this->getIsActive(), 'nb_rooms' => $this->getRooms()->count() ); }
[ "public", "function", "toArray", "(", ")", "{", "return", "array", "(", "'id'", "=>", "$", "this", "->", "getId", "(", ")", ",", "'name'", "=>", "$", "this", "->", "getName", "(", ")", ",", "'description'", "=>", "$", "this", "->", "getDescription", ...
Custom toArray classe @return array
[ "Custom", "toArray", "classe" ]
train
https://github.com/Ydle/HubBundle/blob/7fa423241246bcfd115f2ed3ad3997b4b63adb01/Entity/RoomType.php#L275-L284
xmlscript/srv
api.php
api.query2parameters
final private function query2parameters(string $method, array $args):\Generator{#{{{ if($method && $args && method_exists($this,$method)) foreach((new \ReflectionMethod($this,$method))->getParameters() as $param){ $name = strtolower($param->name); if(isset($args[$name])){ [$type,$allowsNull]...
php
final private function query2parameters(string $method, array $args):\Generator{#{{{ if($method && $args && method_exists($this,$method)) foreach((new \ReflectionMethod($this,$method))->getParameters() as $param){ $name = strtolower($param->name); if(isset($args[$name])){ [$type,$allowsNull]...
[ "final", "private", "function", "query2parameters", "(", "string", "$", "method", ",", "array", "$", "args", ")", ":", "\\", "Generator", "{", "#{{{", "if", "(", "$", "method", "&&", "$", "args", "&&", "method_exists", "(", "$", "this", ",", "$", "meth...
#}}}
[ "#", "}}}" ]
train
https://github.com/xmlscript/srv/blob/64e28952d95b16b8ba43809a5593023b0ca81ace/api.php#L72-L92
xmlscript/srv
api.php
api.&
final private function &parse(string $doc):array{#{{{ //header('Content-Type: text/html;charset=utf-8'); preg_match_all('#@([a-zA-Z]+)\s*([a-zA-Z0-9, ()_].*)#', $doc, $matches, PREG_SET_ORDER); $arr = []; foreach($matches as $item){ } array_walk($matches, function(&$v){ $v = ['tag'=>$v[1]...
php
final private function &parse(string $doc):array{#{{{ //header('Content-Type: text/html;charset=utf-8'); preg_match_all('#@([a-zA-Z]+)\s*([a-zA-Z0-9, ()_].*)#', $doc, $matches, PREG_SET_ORDER); $arr = []; foreach($matches as $item){ } array_walk($matches, function(&$v){ $v = ['tag'=>$v[1]...
[ "final", "private", "function", "&", "parse", "(", "string", "$", "doc", ")", ":", "array", "{", "#{{{", "//header('Content-Type: text/html;charset=utf-8');", "preg_match_all", "(", "'#@([a-zA-Z]+)\\s*([a-zA-Z0-9, ()_].*)#'", ",", "$", "doc", ",", "$", "matches", ",",...
#}}}
[ "#", "}}}" ]
train
https://github.com/xmlscript/srv/blob/64e28952d95b16b8ba43809a5593023b0ca81ace/api.php#L126-L137
wakerscz/cms-base-module
src/Util/ProtectedFile.php
ProtectedFile.move
public function move(FileUpload $file) : ?string { if ($file->isOk()) { $this->privateFileName = (new DateTime())->getTimestamp() . '-' . $file->getSanitizedName(); $length = strlen($this->privateFileName); if ($length > self::MAX_FILE_NAME_LENGTH) {...
php
public function move(FileUpload $file) : ?string { if ($file->isOk()) { $this->privateFileName = (new DateTime())->getTimestamp() . '-' . $file->getSanitizedName(); $length = strlen($this->privateFileName); if ($length > self::MAX_FILE_NAME_LENGTH) {...
[ "public", "function", "move", "(", "FileUpload", "$", "file", ")", ":", "?", "string", "{", "if", "(", "$", "file", "->", "isOk", "(", ")", ")", "{", "$", "this", "->", "privateFileName", "=", "(", "new", "DateTime", "(", ")", ")", "->", "getTimest...
Uloží soubor na disk a vrátí jeho nový název @param FileUpload $file @return string @throws ProtectedFileException
[ "Uloží", "soubor", "na", "disk", "a", "vrátí", "jeho", "nový", "název" ]
train
https://github.com/wakerscz/cms-base-module/blob/3a14ea5d6a41999eb5b92fb956b55363806ff872/src/Util/ProtectedFile.php#L105-L132
wakerscz/cms-base-module
src/Util/ProtectedFile.php
ProtectedFile.getAttr
public function getAttr(string $name) { if (!isset($this->attr[$name])) { return NULL; } return $this->attr[$name]; }
php
public function getAttr(string $name) { if (!isset($this->attr[$name])) { return NULL; } return $this->attr[$name]; }
[ "public", "function", "getAttr", "(", "string", "$", "name", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "attr", "[", "$", "name", "]", ")", ")", "{", "return", "NULL", ";", "}", "return", "$", "this", "->", "attr", "[", "$", "na...
Vrací atribut podle jeho názvu @param string $name @throws InvalidArgumentException @return mixed
[ "Vrací", "atribut", "podle", "jeho", "názvu" ]
train
https://github.com/wakerscz/cms-base-module/blob/3a14ea5d6a41999eb5b92fb956b55363806ff872/src/Util/ProtectedFile.php#L141-L149
wakerscz/cms-base-module
src/Util/ProtectedFile.php
ProtectedFile.getPrivateFile
public function getPrivateFile() : ?\SplFileInfo { $path = self::PRIVATE_ABSOLUTE_PATH . $this->destination . $this->privateFileName; if (!$this->privateFileName || !file_exists($path)) { return NULL; } return new \SplFileInfo($path); }
php
public function getPrivateFile() : ?\SplFileInfo { $path = self::PRIVATE_ABSOLUTE_PATH . $this->destination . $this->privateFileName; if (!$this->privateFileName || !file_exists($path)) { return NULL; } return new \SplFileInfo($path); }
[ "public", "function", "getPrivateFile", "(", ")", ":", "?", "\\", "SplFileInfo", "{", "$", "path", "=", "self", "::", "PRIVATE_ABSOLUTE_PATH", ".", "$", "this", "->", "destination", ".", "$", "this", "->", "privateFileName", ";", "if", "(", "!", "$", "th...
Vrací SplInfo o privátním souboru @return \SplFileInfo|NULL
[ "Vrací", "SplInfo", "o", "privátním", "souboru" ]
train
https://github.com/wakerscz/cms-base-module/blob/3a14ea5d6a41999eb5b92fb956b55363806ff872/src/Util/ProtectedFile.php#L156-L166
wakerscz/cms-base-module
src/Util/ProtectedFile.php
ProtectedFile.remove
public function remove() : bool { $private = self::PRIVATE_ABSOLUTE_PATH . $this->destination . $this->privateFileName; $public = self::PUBLIC_ABSOLUTE_PATH . $this->destination; if (file_exists($private) || file_exists($public)) { FileSystem::delete($private); ...
php
public function remove() : bool { $private = self::PRIVATE_ABSOLUTE_PATH . $this->destination . $this->privateFileName; $public = self::PUBLIC_ABSOLUTE_PATH . $this->destination; if (file_exists($private) || file_exists($public)) { FileSystem::delete($private); ...
[ "public", "function", "remove", "(", ")", ":", "bool", "{", "$", "private", "=", "self", "::", "PRIVATE_ABSOLUTE_PATH", ".", "$", "this", "->", "destination", ".", "$", "this", "->", "privateFileName", ";", "$", "public", "=", "self", "::", "PUBLIC_ABSOLUT...
Odstraní privátní soubor a jeho veřejné kopie či thumbnaily @return bool
[ "Odstraní", "privátní", "soubor", "a", "jeho", "veřejné", "kopie", "či", "thumbnaily" ]
train
https://github.com/wakerscz/cms-base-module/blob/3a14ea5d6a41999eb5b92fb956b55363806ff872/src/Util/ProtectedFile.php#L173-L187
wakerscz/cms-base-module
src/Util/ProtectedFile.php
ProtectedFile.getPublicFile
public function getPublicFile() : ?string { $publicDestination = self::PUBLIC_ABSOLUTE_PATH . $this->destination; $privateFile = $this->getPrivateFile(); if (!$this->privateFileName || !file_exists($privateFile->getPathname())) { return NULL; } $name = $...
php
public function getPublicFile() : ?string { $publicDestination = self::PUBLIC_ABSOLUTE_PATH . $this->destination; $privateFile = $this->getPrivateFile(); if (!$this->privateFileName || !file_exists($privateFile->getPathname())) { return NULL; } $name = $...
[ "public", "function", "getPublicFile", "(", ")", ":", "?", "string", "{", "$", "publicDestination", "=", "self", "::", "PUBLIC_ABSOLUTE_PATH", ".", "$", "this", "->", "destination", ";", "$", "privateFile", "=", "$", "this", "->", "getPrivateFile", "(", ")",...
Generuje či Vrací kopii souboru @return string|NULL
[ "Generuje", "či", "Vrací", "kopii", "souboru" ]
train
https://github.com/wakerscz/cms-base-module/blob/3a14ea5d6a41999eb5b92fb956b55363806ff872/src/Util/ProtectedFile.php#L194-L212
wakerscz/cms-base-module
src/Util/ProtectedFile.php
ProtectedFile.getPublicImage
public function getPublicImage(string $size, string $cropType) : string { $size = strtolower($size); $cropType = strtolower($cropType); list ($width, $height) = explode('x', $size); $width = $width === 'null' ? NULL : $width; $height = $height === 'null' ? NULL : $height; ...
php
public function getPublicImage(string $size, string $cropType) : string { $size = strtolower($size); $cropType = strtolower($cropType); list ($width, $height) = explode('x', $size); $width = $width === 'null' ? NULL : $width; $height = $height === 'null' ? NULL : $height; ...
[ "public", "function", "getPublicImage", "(", "string", "$", "size", ",", "string", "$", "cropType", ")", ":", "string", "{", "$", "size", "=", "strtolower", "(", "$", "size", ")", ";", "$", "cropType", "=", "strtolower", "(", "$", "cropType", ")", ";",...
Generuje či Vrací kopii zmenšeného obrázku @param string $size @param string $cropType @return string @throws \Nette\Utils\UnknownImageFileException
[ "Generuje", "či", "Vrací", "kopii", "zmenšeného", "obrázku" ]
train
https://github.com/wakerscz/cms-base-module/blob/3a14ea5d6a41999eb5b92fb956b55363806ff872/src/Util/ProtectedFile.php#L222-L281
agentmedia/phine-builtin
src/BuiltIn/Modules/Backend/ContainerForm.php
ContainerForm.InitForm
protected function InitForm() { $this->container = $this->LoadElement(); $this->AddContainerField(); $this->AddCssClassField(); $this->AddCssIDField(); $this->AddSubmit(); }
php
protected function InitForm() { $this->container = $this->LoadElement(); $this->AddContainerField(); $this->AddCssClassField(); $this->AddCssIDField(); $this->AddSubmit(); }
[ "protected", "function", "InitForm", "(", ")", "{", "$", "this", "->", "container", "=", "$", "this", "->", "LoadElement", "(", ")", ";", "$", "this", "->", "AddContainerField", "(", ")", ";", "$", "this", "->", "AddCssClassField", "(", ")", ";", "$", ...
Initializes the form
[ "Initializes", "the", "form" ]
train
https://github.com/agentmedia/phine-builtin/blob/4dd05bc406a71e997bd4eaa16b12e23dbe62a456/src/BuiltIn/Modules/Backend/ContainerForm.php#L47-L54
reliv/rcm-config
src/Entity/RcmConfig.php
RcmConfig.getValue
public function getValue() { $value = json_decode($this->value, true); if (json_last_error() !== JSON_ERROR_NONE) { throw new InvalidJsonException("Invalid JSON config value for id: " . $this->getId()); } return $value; }
php
public function getValue() { $value = json_decode($this->value, true); if (json_last_error() !== JSON_ERROR_NONE) { throw new InvalidJsonException("Invalid JSON config value for id: " . $this->getId()); } return $value; }
[ "public", "function", "getValue", "(", ")", "{", "$", "value", "=", "json_decode", "(", "$", "this", "->", "value", ",", "true", ")", ";", "if", "(", "json_last_error", "(", ")", "!==", "JSON_ERROR_NONE", ")", "{", "throw", "new", "InvalidJsonException", ...
getValue @return mixed @throws InvalidJsonException
[ "getValue" ]
train
https://github.com/reliv/rcm-config/blob/3e8cdea57a8688b06997ce1b167b8410bccac09e/src/Entity/RcmConfig.php#L152-L160
n2n/n2n-io
src/app/n2n/io/managed/impl/engine/FileSourceAdapter.php
FileSourceAdapter.buildHash
public function buildHash(): string { $this->ensureValid(); $fs = IoUtils::stat($this->fileFsPath); return sprintf('%x-%x-%s', $fs['ino'], $fs['size'], base_convert(str_pad($fs['mtime'], 16, '0'), 10, 16)); }
php
public function buildHash(): string { $this->ensureValid(); $fs = IoUtils::stat($this->fileFsPath); return sprintf('%x-%x-%s', $fs['ino'], $fs['size'], base_convert(str_pad($fs['mtime'], 16, '0'), 10, 16)); }
[ "public", "function", "buildHash", "(", ")", ":", "string", "{", "$", "this", "->", "ensureValid", "(", ")", ";", "$", "fs", "=", "IoUtils", "::", "stat", "(", "$", "this", "->", "fileFsPath", ")", ";", "return", "sprintf", "(", "'%x-%x-%s'", ",", "$...
{@inheritDoc} @see \n2n\io\managed\FileSource::buildHash()
[ "{" ]
train
https://github.com/n2n/n2n-io/blob/ff642e195f0c0db1273b6c067eff1192cf2cd987/src/app/n2n/io/managed/impl/engine/FileSourceAdapter.php#L97-L101
n2n/n2n-io
src/app/n2n/io/managed/impl/engine/FileSourceAdapter.php
FileSourceAdapter.move
public function move(FsPath $fsPath, $filePerm, $overwrite = false) { $this->ensureValid(); $this->valid = false; $this->fileFsPath->moveFile($fsPath, $filePerm, $overwrite); if ($this->infoFsPath !== null) { $this->infoFsPath->delete(); } }
php
public function move(FsPath $fsPath, $filePerm, $overwrite = false) { $this->ensureValid(); $this->valid = false; $this->fileFsPath->moveFile($fsPath, $filePerm, $overwrite); if ($this->infoFsPath !== null) { $this->infoFsPath->delete(); } }
[ "public", "function", "move", "(", "FsPath", "$", "fsPath", ",", "$", "filePerm", ",", "$", "overwrite", "=", "false", ")", "{", "$", "this", "->", "ensureValid", "(", ")", ";", "$", "this", "->", "valid", "=", "false", ";", "$", "this", "->", "fil...
/* (non-PHPdoc) @see \n2n\io\managed\FileSource::move()
[ "/", "*", "(", "non", "-", "PHPdoc", ")" ]
train
https://github.com/n2n/n2n-io/blob/ff642e195f0c0db1273b6c067eff1192cf2cd987/src/app/n2n/io/managed/impl/engine/FileSourceAdapter.php#L147-L155
n2n/n2n-io
src/app/n2n/io/managed/impl/engine/FileSourceAdapter.php
FileSourceAdapter.copy
public function copy(FsPath $fsPath, $filePerm, $overwrite = false) { $this->ensureValid(); $this->fileFsPath->copyFile($fsPath, $filePerm, $overwrite); }
php
public function copy(FsPath $fsPath, $filePerm, $overwrite = false) { $this->ensureValid(); $this->fileFsPath->copyFile($fsPath, $filePerm, $overwrite); }
[ "public", "function", "copy", "(", "FsPath", "$", "fsPath", ",", "$", "filePerm", ",", "$", "overwrite", "=", "false", ")", "{", "$", "this", "->", "ensureValid", "(", ")", ";", "$", "this", "->", "fileFsPath", "->", "copyFile", "(", "$", "fsPath", "...
/* (non-PHPdoc) @see \n2n\io\managed\FileSource::copy()
[ "/", "*", "(", "non", "-", "PHPdoc", ")" ]
train
https://github.com/n2n/n2n-io/blob/ff642e195f0c0db1273b6c067eff1192cf2cd987/src/app/n2n/io/managed/impl/engine/FileSourceAdapter.php#L160-L164
n2n/n2n-io
src/app/n2n/io/managed/impl/engine/FileSourceAdapter.php
FileSourceAdapter.delete
public function delete() { $this->ensureValid(); $this->valid = false; $this->fileFsPath->delete(); if ($this->infoFsPath !== null) { $this->infoFsPath->delete(); } }
php
public function delete() { $this->ensureValid(); $this->valid = false; $this->fileFsPath->delete(); if ($this->infoFsPath !== null) { $this->infoFsPath->delete(); } }
[ "public", "function", "delete", "(", ")", "{", "$", "this", "->", "ensureValid", "(", ")", ";", "$", "this", "->", "valid", "=", "false", ";", "$", "this", "->", "fileFsPath", "->", "delete", "(", ")", ";", "if", "(", "$", "this", "->", "infoFsPath...
/* (non-PHPdoc) @see \n2n\io\managed\FileSource::delete()
[ "/", "*", "(", "non", "-", "PHPdoc", ")" ]
train
https://github.com/n2n/n2n-io/blob/ff642e195f0c0db1273b6c067eff1192cf2cd987/src/app/n2n/io/managed/impl/engine/FileSourceAdapter.php#L170-L178
andela-doladosu/liteorm
src/Origins/BaseModel.php
BaseModel.doSearch
protected static function doSearch($id = null) { $model = self::createModelInstance(); $tableName = $model->getTableName($model->className); return $id ? self::selectOne($model, $tableName, $id) : self::selectAll($model, $tableName); }
php
protected static function doSearch($id = null) { $model = self::createModelInstance(); $tableName = $model->getTableName($model->className); return $id ? self::selectOne($model, $tableName, $id) : self::selectAll($model, $tableName); }
[ "protected", "static", "function", "doSearch", "(", "$", "id", "=", "null", ")", "{", "$", "model", "=", "self", "::", "createModelInstance", "(", ")", ";", "$", "tableName", "=", "$", "model", "->", "getTableName", "(", "$", "model", "->", "className", ...
Choose to either search database for one row or all rows depending on whether the $id argument is passed @param int $id @return mixed
[ "Choose", "to", "either", "search", "database", "for", "one", "row", "or", "all", "rows", "depending", "on", "whether", "the", "$id", "argument", "is", "passed" ]
train
https://github.com/andela-doladosu/liteorm/blob/e97f69e20be4ce0c078a0c25a9a777307d85e9e4/src/Origins/BaseModel.php#L53-L59
andela-doladosu/liteorm
src/Origins/BaseModel.php
BaseModel.where
public function where($table, $column, $keyword) { $connection = Connection::connect(); $selectValue = $connection->prepare('select * from '.$table.' where '.$column.' = \''.$keyword.'\''); $selectValue->execute(); return $selectValue->fetch(PDO::FETCH_ASSOC); }
php
public function where($table, $column, $keyword) { $connection = Connection::connect(); $selectValue = $connection->prepare('select * from '.$table.' where '.$column.' = \''.$keyword.'\''); $selectValue->execute(); return $selectValue->fetch(PDO::FETCH_ASSOC); }
[ "public", "function", "where", "(", "$", "table", ",", "$", "column", ",", "$", "keyword", ")", "{", "$", "connection", "=", "Connection", "::", "connect", "(", ")", ";", "$", "selectValue", "=", "$", "connection", "->", "prepare", "(", "'select * from '...
Return details where a column is matched by the given keyword @param string $table @param string $column @param string $keyword @return array
[ "Return", "details", "where", "a", "column", "is", "matched", "by", "the", "given", "keyword" ]
train
https://github.com/andela-doladosu/liteorm/blob/e97f69e20be4ce0c078a0c25a9a777307d85e9e4/src/Origins/BaseModel.php#L70-L78
andela-doladosu/liteorm
src/Origins/BaseModel.php
BaseModel.selectAll
protected static function selectAll($model, $tableName) { $connection = Connection::connect(); $getAll = $connection->prepare('select * from '.$tableName); $getAll->execute(); while ($allRows = $getAll->fetch(PDO::FETCH_ASSOC)) { array_push($model->resultRows, $allRo...
php
protected static function selectAll($model, $tableName) { $connection = Connection::connect(); $getAll = $connection->prepare('select * from '.$tableName); $getAll->execute(); while ($allRows = $getAll->fetch(PDO::FETCH_ASSOC)) { array_push($model->resultRows, $allRo...
[ "protected", "static", "function", "selectAll", "(", "$", "model", ",", "$", "tableName", ")", "{", "$", "connection", "=", "Connection", "::", "connect", "(", ")", ";", "$", "getAll", "=", "$", "connection", "->", "prepare", "(", "'select * from '", ".", ...
Search database for all rows @param $model @param $tableName @return mixed
[ "Search", "database", "for", "all", "rows" ]
train
https://github.com/andela-doladosu/liteorm/blob/e97f69e20be4ce0c078a0c25a9a777307d85e9e4/src/Origins/BaseModel.php#L88-L100
andela-doladosu/liteorm
src/Origins/BaseModel.php
BaseModel.selectOne
protected static function selectOne($model, $tableName, $id) { $connection = Connection::connect(); $getAll = $connection->prepare('select * from '.$tableName.' where id='.$id); $getAll->execute(); $row = $getAll->fetch(PDO::FETCH_ASSOC); array_push($model->resultRows, $row...
php
protected static function selectOne($model, $tableName, $id) { $connection = Connection::connect(); $getAll = $connection->prepare('select * from '.$tableName.' where id='.$id); $getAll->execute(); $row = $getAll->fetch(PDO::FETCH_ASSOC); array_push($model->resultRows, $row...
[ "protected", "static", "function", "selectOne", "(", "$", "model", ",", "$", "tableName", ",", "$", "id", ")", "{", "$", "connection", "=", "Connection", "::", "connect", "(", ")", ";", "$", "getAll", "=", "$", "connection", "->", "prepare", "(", "'sel...
Search database for one row @param $model @param $tableName @param $id @return mixed
[ "Search", "database", "for", "one", "row" ]
train
https://github.com/andela-doladosu/liteorm/blob/e97f69e20be4ce0c078a0c25a9a777307d85e9e4/src/Origins/BaseModel.php#L111-L122
andela-doladosu/liteorm
src/Origins/BaseModel.php
BaseModel.insertRow
protected function insertRow() { $assignedValues = $this->getAssignedValues(); $columns = implode(', ', $assignedValues['columns']); $values = '\''.implode('\', \'', $assignedValues['values']).'\''; $tableName = $this->getTableName($this->className); $connection = Conne...
php
protected function insertRow() { $assignedValues = $this->getAssignedValues(); $columns = implode(', ', $assignedValues['columns']); $values = '\''.implode('\', \'', $assignedValues['values']).'\''; $tableName = $this->getTableName($this->className); $connection = Conne...
[ "protected", "function", "insertRow", "(", ")", "{", "$", "assignedValues", "=", "$", "this", "->", "getAssignedValues", "(", ")", ";", "$", "columns", "=", "implode", "(", "', '", ",", "$", "assignedValues", "[", "'columns'", "]", ")", ";", "$", "values...
Insert a new row @return string
[ "Insert", "a", "new", "row" ]
train
https://github.com/andela-doladosu/liteorm/blob/e97f69e20be4ce0c078a0c25a9a777307d85e9e4/src/Origins/BaseModel.php#L153-L171
andela-doladosu/liteorm
src/Origins/BaseModel.php
BaseModel.updateRow
protected function updateRow() { $tableName = $this->getTableName($this->className); $assignedValues = $this->getAssignedValues(); $updateDetails = []; for ($i = 0; $i < count($assignedValues['columns']); $i++) { array_push($updateDetails, $assignedValues['columns'][...
php
protected function updateRow() { $tableName = $this->getTableName($this->className); $assignedValues = $this->getAssignedValues(); $updateDetails = []; for ($i = 0; $i < count($assignedValues['columns']); $i++) { array_push($updateDetails, $assignedValues['columns'][...
[ "protected", "function", "updateRow", "(", ")", "{", "$", "tableName", "=", "$", "this", "->", "getTableName", "(", "$", "this", "->", "className", ")", ";", "$", "assignedValues", "=", "$", "this", "->", "getAssignedValues", "(", ")", ";", "$", "updateD...
Edit an existing row @return bool
[ "Edit", "an", "existing", "row" ]
train
https://github.com/andela-doladosu/liteorm/blob/e97f69e20be4ce0c078a0c25a9a777307d85e9e4/src/Origins/BaseModel.php#L178-L198
andela-doladosu/liteorm
src/Origins/BaseModel.php
BaseModel.destroy
public static function destroy($id) { if (self::confirmIdExists($id)) { return self::doDelete($id); } else { throw new Exception('Now rows found with ID '.$id.' in the database, it may have been already deleted'); } }
php
public static function destroy($id) { if (self::confirmIdExists($id)) { return self::doDelete($id); } else { throw new Exception('Now rows found with ID '.$id.' in the database, it may have been already deleted'); } }
[ "public", "static", "function", "destroy", "(", "$", "id", ")", "{", "if", "(", "self", "::", "confirmIdExists", "(", "$", "id", ")", ")", "{", "return", "self", "::", "doDelete", "(", "$", "id", ")", ";", "}", "else", "{", "throw", "new", "Excepti...
Call doDelete function if the specified id exists @param $id @return string
[ "Call", "doDelete", "function", "if", "the", "specified", "id", "exists" ]
train
https://github.com/andela-doladosu/liteorm/blob/e97f69e20be4ce0c078a0c25a9a777307d85e9e4/src/Origins/BaseModel.php#L207-L214
andela-doladosu/liteorm
src/Origins/BaseModel.php
BaseModel.doDelete
protected static function doDelete($id) { $model = self::createModelInstance(); $tableName = $model->getTableName($model->className); $connection = Connection::connect(); $delete = $connection->prepare('delete from '.$tableName.' where id ='.$id); return $delete->execute() ...
php
protected static function doDelete($id) { $model = self::createModelInstance(); $tableName = $model->getTableName($model->className); $connection = Connection::connect(); $delete = $connection->prepare('delete from '.$tableName.' where id ='.$id); return $delete->execute() ...
[ "protected", "static", "function", "doDelete", "(", "$", "id", ")", "{", "$", "model", "=", "self", "::", "createModelInstance", "(", ")", ";", "$", "tableName", "=", "$", "model", "->", "getTableName", "(", "$", "model", "->", "className", ")", ";", "...
Delete an existing row from the database @param $id @return string
[ "Delete", "an", "existing", "row", "from", "the", "database" ]
train
https://github.com/andela-doladosu/liteorm/blob/e97f69e20be4ce0c078a0c25a9a777307d85e9e4/src/Origins/BaseModel.php#L222-L233
alphalemon/BootstrapBundle
Core/ActionManager/ActionManagerGenerator.php
ActionManagerGenerator.generate
public function generate($actionManager) { if ($actionManager instanceof ActionManagerInterface) { $this->actionManager = $actionManager; $this->actionManagerClass = get_class($this->actionManager); } if (is_string($actionManager) && class_exists($actionManager)) { ...
php
public function generate($actionManager) { if ($actionManager instanceof ActionManagerInterface) { $this->actionManager = $actionManager; $this->actionManagerClass = get_class($this->actionManager); } if (is_string($actionManager) && class_exists($actionManager)) { ...
[ "public", "function", "generate", "(", "$", "actionManager", ")", "{", "if", "(", "$", "actionManager", "instanceof", "ActionManagerInterface", ")", "{", "$", "this", "->", "actionManager", "=", "$", "actionManager", ";", "$", "this", "->", "actionManagerClass",...
Generates the ActionManager object @param mixed ActionManagerInterface|string $actionManager
[ "Generates", "the", "ActionManager", "object" ]
train
https://github.com/alphalemon/BootstrapBundle/blob/27ff5cbc58d58149ec72a974f2a9d765a6fd37a6/Core/ActionManager/ActionManagerGenerator.php#L48-L59
ColibriPlatform/base
Env.php
Env.load
public static function load($file) { if (file_exists($file)) { $env = \M1\Env\Parser::parse(file_get_contents($file)); foreach ($env as $key => $value) { putenv("{$key}={$value}"); } } }
php
public static function load($file) { if (file_exists($file)) { $env = \M1\Env\Parser::parse(file_get_contents($file)); foreach ($env as $key => $value) { putenv("{$key}={$value}"); } } }
[ "public", "static", "function", "load", "(", "$", "file", ")", "{", "if", "(", "file_exists", "(", "$", "file", ")", ")", "{", "$", "env", "=", "\\", "M1", "\\", "Env", "\\", "Parser", "::", "parse", "(", "file_get_contents", "(", "$", "file", ")",...
Load file containing environment variables and setup environment with these variables @param string $file @return void
[ "Load", "file", "containing", "environment", "variables", "and", "setup", "environment", "with", "these", "variables" ]
train
https://github.com/ColibriPlatform/base/blob/b45db9c88317e28acc5b024ac98f8428685179aa/Env.php#L27-L35
net-tools/core
src/Helpers/PdoHelper.php
PdoHelper.addForeignKey
function addForeignKey($table, $pkname, $tables) { if ( is_string($tables) ) $tables = array($tables); $this->_foreignKeys[$table] = array( 'primaryKey' => $pkname, 'tables' => $tables ); }
php
function addForeignKey($table, $pkname, $tables) { if ( is_string($tables) ) $tables = array($tables); $this->_foreignKeys[$table] = array( 'primaryKey' => $pkname, 'tables' => $tables ); }
[ "function", "addForeignKey", "(", "$", "table", ",", "$", "pkname", ",", "$", "tables", ")", "{", "if", "(", "is_string", "(", "$", "tables", ")", ")", "$", "tables", "=", "array", "(", "$", "tables", ")", ";", "$", "this", "->", "_foreignKeys", "[...
Add some config data for a new foreign key @param string $table Name of the foreign key table @param string $pkname Name of its primary key @param string[] $tables Array of tables referencing $table parameter
[ "Add", "some", "config", "data", "for", "a", "new", "foreign", "key" ]
train
https://github.com/net-tools/core/blob/51446641cee22c0cf53d2b409c76cc8bd1a187e7/src/Helpers/PdoHelper.php#L59-L69
net-tools/core
src/Helpers/PdoHelper.php
PdoHelper.pdo_query
function pdo_query($query, $values = NULL) { if ( !is_null($values) && !is_array($values) ) $values = array($values); return $this->prepare($query)->execute($values); }
php
function pdo_query($query, $values = NULL) { if ( !is_null($values) && !is_array($values) ) $values = array($values); return $this->prepare($query)->execute($values); }
[ "function", "pdo_query", "(", "$", "query", ",", "$", "values", "=", "NULL", ")", "{", "if", "(", "!", "is_null", "(", "$", "values", ")", "&&", "!", "is_array", "(", "$", "values", ")", ")", "$", "values", "=", "array", "(", "$", "values", ")", ...
Helper query method to prepare and execute a sql request (DELETE, INSERT, UPDATE) @param string $query The SQL query @param string[] $values An array of parameters for the query (? and :xxx placeholders concrete values) @return bool Returns true if query OK @throws \PDOException If an error occured, a exception is thr...
[ "Helper", "query", "method", "to", "prepare", "and", "execute", "a", "sql", "request", "(", "DELETE", "INSERT", "UPDATE", ")" ]
train
https://github.com/net-tools/core/blob/51446641cee22c0cf53d2b409c76cc8bd1a187e7/src/Helpers/PdoHelper.php#L103-L109
net-tools/core
src/Helpers/PdoHelper.php
PdoHelper.pdo_query_select
function pdo_query_select($query, $values = NULL) { if ( !is_null($values) && !is_array($values) ) $values = array($values); $st = $this->prepare($query); $st->execute($values); return $st; }
php
function pdo_query_select($query, $values = NULL) { if ( !is_null($values) && !is_array($values) ) $values = array($values); $st = $this->prepare($query); $st->execute($values); return $st; }
[ "function", "pdo_query_select", "(", "$", "query", ",", "$", "values", "=", "NULL", ")", "{", "if", "(", "!", "is_null", "(", "$", "values", ")", "&&", "!", "is_array", "(", "$", "values", ")", ")", "$", "values", "=", "array", "(", "$", "values", ...
Helper query method for a SQL SELECT request @param string $query The SQL query @param string[] $values An array of parameters for the query (? and :xxx placeholders concrete values) @return \PDOStatement A PDOStatement object with rows to fetch @throws \PDOException If an error occured, a exception is thrown
[ "Helper", "query", "method", "for", "a", "SQL", "SELECT", "request" ]
train
https://github.com/net-tools/core/blob/51446641cee22c0cf53d2b409c76cc8bd1a187e7/src/Helpers/PdoHelper.php#L120-L129
net-tools/core
src/Helpers/PdoHelper.php
PdoHelper.pdo_dbexists
function pdo_dbexists($query, $values = NULL) { try { if ( !is_null($values) && !is_array($values) ) $values = array($values); $st = $this->prepare($query); $st->execute($values); $r = $st->fetch(\PDO::FETCH_COLUMN, 0); $st->closeCursor(); return $r; } catch ( \PDOException $e ) { ...
php
function pdo_dbexists($query, $values = NULL) { try { if ( !is_null($values) && !is_array($values) ) $values = array($values); $st = $this->prepare($query); $st->execute($values); $r = $st->fetch(\PDO::FETCH_COLUMN, 0); $st->closeCursor(); return $r; } catch ( \PDOException $e ) { ...
[ "function", "pdo_dbexists", "(", "$", "query", ",", "$", "values", "=", "NULL", ")", "{", "try", "{", "if", "(", "!", "is_null", "(", "$", "values", ")", "&&", "!", "is_array", "(", "$", "values", ")", ")", "$", "values", "=", "array", "(", "$", ...
Get a single value fetched with a SELECT query (first column) If more than one line is returned by the request, only the first one is used ; If an exception is thrown by PDO, it is intercepted and false is returned @param string $query The SQL query @param string[] $values An array of parameters for the query (? and ...
[ "Get", "a", "single", "value", "fetched", "with", "a", "SELECT", "query", "(", "first", "column", ")" ]
train
https://github.com/net-tools/core/blob/51446641cee22c0cf53d2b409c76cc8bd1a187e7/src/Helpers/PdoHelper.php#L142-L159
net-tools/core
src/Helpers/PdoHelper.php
PdoHelper.pdo_value
static function pdo_value(\PDOStatement $st, $values = NULL) { try { if ( !is_null($values) && !is_array($values) ) $values = array($values); $st->execute($values); $r = $st->fetch(\PDO::FETCH_COLUMN, 0); $st->closeCursor(); return $r; } catch ( \PDOException $e ) { return FALSE; ...
php
static function pdo_value(\PDOStatement $st, $values = NULL) { try { if ( !is_null($values) && !is_array($values) ) $values = array($values); $st->execute($values); $r = $st->fetch(\PDO::FETCH_COLUMN, 0); $st->closeCursor(); return $r; } catch ( \PDOException $e ) { return FALSE; ...
[ "static", "function", "pdo_value", "(", "\\", "PDOStatement", "$", "st", ",", "$", "values", "=", "NULL", ")", "{", "try", "{", "if", "(", "!", "is_null", "(", "$", "values", ")", "&&", "!", "is_array", "(", "$", "values", ")", ")", "$", "values", ...
Get a value (first column of row) from a PDO Statement (to be executed with values, if given) If more than one line is returned by the request, only the first one is used ; If an exception is thrown by PDO, it is intercepted and false is returned @param \PDOStatement $st The PDO statement, already prepared @param str...
[ "Get", "a", "value", "(", "first", "column", "of", "row", ")", "from", "a", "PDO", "Statement", "(", "to", "be", "executed", "with", "values", "if", "given", ")" ]
train
https://github.com/net-tools/core/blob/51446641cee22c0cf53d2b409c76cc8bd1a187e7/src/Helpers/PdoHelper.php#L172-L188
net-tools/core
src/Helpers/PdoHelper.php
PdoHelper.pdo_dbsum
static function pdo_dbsum(\PDOStatement $result, $col, $values = NULL) { $tot = 0.0; $result->execute($values); if ( $result->rowCount() ) { $fetch = is_string($col) ? \PDO::FETCH_ASSOC : \PDO::FETCH_NUM; while ( $row = $result->fetch($fetch) ) $tot += $row[$col]; } $result->closeCursor(); ...
php
static function pdo_dbsum(\PDOStatement $result, $col, $values = NULL) { $tot = 0.0; $result->execute($values); if ( $result->rowCount() ) { $fetch = is_string($col) ? \PDO::FETCH_ASSOC : \PDO::FETCH_NUM; while ( $row = $result->fetch($fetch) ) $tot += $row[$col]; } $result->closeCursor(); ...
[ "static", "function", "pdo_dbsum", "(", "\\", "PDOStatement", "$", "result", ",", "$", "col", ",", "$", "values", "=", "NULL", ")", "{", "$", "tot", "=", "0.0", ";", "$", "result", "->", "execute", "(", "$", "values", ")", ";", "if", "(", "$", "r...
Sum rows on one column from a PDO statement (to be executed with parametered values, if given) @param \PDOStatement $result SQL statement, already prepared @param int|string $col The column to sum (a column name or a column index) @param string[] $values An array of parameters for the query (? and :xxx placeholders co...
[ "Sum", "rows", "on", "one", "column", "from", "a", "PDO", "statement", "(", "to", "be", "executed", "with", "parametered", "values", "if", "given", ")" ]
train
https://github.com/net-tools/core/blob/51446641cee22c0cf53d2b409c76cc8bd1a187e7/src/Helpers/PdoHelper.php#L217-L231
net-tools/core
src/Helpers/PdoHelper.php
PdoHelper.pdo_foreignkeys
function pdo_foreignkeys($tablefk, $keyvalue) { $fk_tables = $this->_foreignKeys; try { // if we have no data about this table in the foreign key config, we are fine if ( !$fk_tables[$tablefk] ) return array('statut'=>true); // get the list of tables having $TABLEFK as a foreign key $...
php
function pdo_foreignkeys($tablefk, $keyvalue) { $fk_tables = $this->_foreignKeys; try { // if we have no data about this table in the foreign key config, we are fine if ( !$fk_tables[$tablefk] ) return array('statut'=>true); // get the list of tables having $TABLEFK as a foreign key $...
[ "function", "pdo_foreignkeys", "(", "$", "tablefk", ",", "$", "keyvalue", ")", "{", "$", "fk_tables", "=", "$", "this", "->", "_foreignKeys", ";", "try", "{", "// if we have no data about this table in the foreign key config, we are fine", "if", "(", "!", "$", "fk_t...
Test if a given primary key value from a table is referenced by other tables (foreign key is used) @param string $tablefk Table name of the table being foreign key @param string $keyvalue Value of the primary key to look for @return string[] Array describing the result `['statut'=>true]` if the foreign key is not used...
[ "Test", "if", "a", "given", "primary", "key", "value", "from", "a", "table", "is", "referenced", "by", "other", "tables", "(", "foreign", "key", "is", "used", ")" ]
train
https://github.com/net-tools/core/blob/51446641cee22c0cf53d2b409c76cc8bd1a187e7/src/Helpers/PdoHelper.php#L242-L302
MindyPHP/Pagination
BasePagination.php
BasePagination.paginate
public function paginate() { $this->total = $this->dataSource->getTotal($this->source); if ( ($this->getPagesCount() > 0 && $this->getPage() > $this->getPagesCount()) || $this->getPage() <= 0 ) { $this->handler->wrongPageCallback(); } $th...
php
public function paginate() { $this->total = $this->dataSource->getTotal($this->source); if ( ($this->getPagesCount() > 0 && $this->getPage() > $this->getPagesCount()) || $this->getPage() <= 0 ) { $this->handler->wrongPageCallback(); } $th...
[ "public", "function", "paginate", "(", ")", "{", "$", "this", "->", "total", "=", "$", "this", "->", "dataSource", "->", "getTotal", "(", "$", "this", "->", "source", ")", ";", "if", "(", "(", "$", "this", "->", "getPagesCount", "(", ")", ">", "0",...
Apply limits to source. @throws \Exception @return array
[ "Apply", "limits", "to", "source", "." ]
train
https://github.com/MindyPHP/Pagination/blob/9f38cc7ac219ea2639b88d9f45351c7b24ea8322/BasePagination.php#L204-L222
ZendExperts/phpids
lib/IDS/Filter/Storage.php
IDS_Filter_Storage._isCached
private function _isCached() { $filters = false; if ($this->cacheSettings) { if ($this->cache) { $filters = $this->cache->getCache(); } } return $filters; }
php
private function _isCached() { $filters = false; if ($this->cacheSettings) { if ($this->cache) { $filters = $this->cache->getCache(); } } return $filters; }
[ "private", "function", "_isCached", "(", ")", "{", "$", "filters", "=", "false", ";", "if", "(", "$", "this", "->", "cacheSettings", ")", "{", "if", "(", "$", "this", "->", "cache", ")", "{", "$", "filters", "=", "$", "this", "->", "cache", "->", ...
Checks if any filters are cached @return mixed $filters cached filters or false
[ "Checks", "if", "any", "filters", "are", "cached" ]
train
https://github.com/ZendExperts/phpids/blob/f30df04eea47b94d056e2ae9ec8fea1c626f1c03/lib/IDS/Filter/Storage.php#L166-L178
ZendExperts/phpids
lib/IDS/Filter/Storage.php
IDS_Filter_Storage.getFilterFromXML
public function getFilterFromXML() { if (extension_loaded('SimpleXML')) { /* * See if filters are already available in the cache */ $filters = $this->_isCached(); /* * If they aren't, parse the source file */ ...
php
public function getFilterFromXML() { if (extension_loaded('SimpleXML')) { /* * See if filters are already available in the cache */ $filters = $this->_isCached(); /* * If they aren't, parse the source file */ ...
[ "public", "function", "getFilterFromXML", "(", ")", "{", "if", "(", "extension_loaded", "(", "'SimpleXML'", ")", ")", "{", "/*\n * See if filters are already available in the cache\n */", "$", "filters", "=", "$", "this", "->", "_isCached", "(", ...
Loads filters from XML using SimpleXML This function parses the provided source file and stores the result. If caching mode is enabled the result will be cached to increase the performance. @throws Exception if problems with fetching the XML data occur @return object $this
[ "Loads", "filters", "from", "XML", "using", "SimpleXML" ]
train
https://github.com/ZendExperts/phpids/blob/f30df04eea47b94d056e2ae9ec8fea1c626f1c03/lib/IDS/Filter/Storage.php#L190-L278
ZendExperts/phpids
lib/IDS/Filter/Storage.php
IDS_Filter_Storage.getFilterFromJson
public function getFilterFromJson() { if (extension_loaded('Json')) { /* * See if filters are already available in the cache */ $filters = $this->_isCached(); /* * If they aren't, parse the source file */ ...
php
public function getFilterFromJson() { if (extension_loaded('Json')) { /* * See if filters are already available in the cache */ $filters = $this->_isCached(); /* * If they aren't, parse the source file */ ...
[ "public", "function", "getFilterFromJson", "(", ")", "{", "if", "(", "extension_loaded", "(", "'Json'", ")", ")", "{", "/*\n * See if filters are already available in the cache\n */", "$", "filters", "=", "$", "this", "->", "_isCached", "(", ")",...
Loads filters from Json file using ext/Json This function parses the provided source file and stores the result. If caching mode is enabled the result will be cached to increase the performance. @throws Exception if problems with fetching the JSON data occur @return object $this
[ "Loads", "filters", "from", "Json", "file", "using", "ext", "/", "Json" ]
train
https://github.com/ZendExperts/phpids/blob/f30df04eea47b94d056e2ae9ec8fea1c626f1c03/lib/IDS/Filter/Storage.php#L290-L372
CatLabInteractive/Accounts
src/CatLab/Accounts/Module.php
Module.initialize
public function initialize ($routepath) { // Set path $this->routepath = $routepath; // Add templates Template::addPath (__DIR__ . '/templates/', 'CatLab/Accounts/'); // Add locales Text::getInstance ()->addPath ('catlab.accounts', __DIR__ . '/locales/'); /...
php
public function initialize ($routepath) { // Set path $this->routepath = $routepath; // Add templates Template::addPath (__DIR__ . '/templates/', 'CatLab/Accounts/'); // Add locales Text::getInstance ()->addPath ('catlab.accounts', __DIR__ . '/locales/'); /...
[ "public", "function", "initialize", "(", "$", "routepath", ")", "{", "// Set path", "$", "this", "->", "routepath", "=", "$", "routepath", ";", "// Add templates", "Template", "::", "addPath", "(", "__DIR__", ".", "'/templates/'", ",", "'CatLab/Accounts/'", ")",...
Set template paths, config vars, etc @param string $routepath The prefix that should be added to all route paths. @return void
[ "Set", "template", "paths", "config", "vars", "etc" ]
train
https://github.com/CatLabInteractive/Accounts/blob/e5465ad815c3caba5b7c1fde7b465a5fa05f3298/src/CatLab/Accounts/Module.php#L56-L77
CatLabInteractive/Accounts
src/CatLab/Accounts/Module.php
Module.setRequestUser
public function setRequestUser (Request $request) { $request->addUserCallback ('accounts', function (Request $request) { $userid = $request->getSession ()->get ('catlab-user-id'); if ($userid) { $user = MapperFactory::getUserMapper ()->getFromId ($userid...
php
public function setRequestUser (Request $request) { $request->addUserCallback ('accounts', function (Request $request) { $userid = $request->getSession ()->get ('catlab-user-id'); if ($userid) { $user = MapperFactory::getUserMapper ()->getFromId ($userid...
[ "public", "function", "setRequestUser", "(", "Request", "$", "request", ")", "{", "$", "request", "->", "addUserCallback", "(", "'accounts'", ",", "function", "(", "Request", "$", "request", ")", "{", "$", "userid", "=", "$", "request", "->", "getSession", ...
Set user from session @param Request $request @throws \Neuron\Exceptions\InvalidParameter
[ "Set", "user", "from", "session" ]
train
https://github.com/CatLabInteractive/Accounts/blob/e5465ad815c3caba5b7c1fde7b465a5fa05f3298/src/CatLab/Accounts/Module.php#L84-L99
CatLabInteractive/Accounts
src/CatLab/Accounts/Module.php
Module.login
public function login (Request $request, User $user, $registration = false) { // Check for email validation if ($this->requiresEmailValidation()) { if (!$user->isEmailVerified()) { $request->getSession()->set ('catlab-non-verified-user-id', $user->getId()); ...
php
public function login (Request $request, User $user, $registration = false) { // Check for email validation if ($this->requiresEmailValidation()) { if (!$user->isEmailVerified()) { $request->getSession()->set ('catlab-non-verified-user-id', $user->getId()); ...
[ "public", "function", "login", "(", "Request", "$", "request", ",", "User", "$", "user", ",", "$", "registration", "=", "false", ")", "{", "// Check for email validation", "if", "(", "$", "this", "->", "requiresEmailValidation", "(", ")", ")", "{", "if", "...
Login a specific user @param Request $request @param User $user @param bool $registration @return \Neuron\Net\Response @throws DataNotSet
[ "Login", "a", "specific", "user" ]
train
https://github.com/CatLabInteractive/Accounts/blob/e5465ad815c3caba5b7c1fde7b465a5fa05f3298/src/CatLab/Accounts/Module.php#L141-L153
CatLabInteractive/Accounts
src/CatLab/Accounts/Module.php
Module.logout
public function logout (Request $request) { $request->getSession ()->set ('catlab-user-id', null); $request->getSession ()->set ('catlab-non-verified-user-id', null); return $this->postLogout ($request); }
php
public function logout (Request $request) { $request->getSession ()->set ('catlab-user-id', null); $request->getSession ()->set ('catlab-non-verified-user-id', null); return $this->postLogout ($request); }
[ "public", "function", "logout", "(", "Request", "$", "request", ")", "{", "$", "request", "->", "getSession", "(", ")", "->", "set", "(", "'catlab-user-id'", ",", "null", ")", ";", "$", "request", "->", "getSession", "(", ")", "->", "set", "(", "'catla...
Logout user @param Request $request @throws \Neuron\Exceptions\DataNotSet @return \Neuron\Net\Response
[ "Logout", "user" ]
train
https://github.com/CatLabInteractive/Accounts/blob/e5465ad815c3caba5b7c1fde7b465a5fa05f3298/src/CatLab/Accounts/Module.php#L161-L166
CatLabInteractive/Accounts
src/CatLab/Accounts/Module.php
Module.postLogin
public function postLogin (Request $request, \Neuron\Interfaces\Models\User $user, $registered = false) { $parameters = array(); if ($registered) { $parameters['registered'] = 1; } // Also set in session... why wouldn't this be in session? :D $request->getSession...
php
public function postLogin (Request $request, \Neuron\Interfaces\Models\User $user, $registered = false) { $parameters = array(); if ($registered) { $parameters['registered'] = 1; } // Also set in session... why wouldn't this be in session? :D $request->getSession...
[ "public", "function", "postLogin", "(", "Request", "$", "request", ",", "\\", "Neuron", "\\", "Interfaces", "\\", "Models", "\\", "User", "$", "user", ",", "$", "registered", "=", "false", ")", "{", "$", "parameters", "=", "array", "(", ")", ";", "if",...
Called right after a user is logged in. Should be a redirect. @param Request $request @param \Neuron\Interfaces\Models\User $user @param boolean $registered @return \Neuron\Net\Response @throws DataNotSet
[ "Called", "right", "after", "a", "user", "is", "logged", "in", ".", "Should", "be", "a", "redirect", "." ]
train
https://github.com/CatLabInteractive/Accounts/blob/e5465ad815c3caba5b7c1fde7b465a5fa05f3298/src/CatLab/Accounts/Module.php#L177-L200
CatLabInteractive/Accounts
src/CatLab/Accounts/Module.php
Module.postLogout
public function postLogout (Request $request) { if ($redirect = $request->getSession ()->get ('post-login-redirect')) { $request->getSession ()->set ('post-login-redirect', null); $request->getSession ()->set ('cancel-login-redirect', null); return Response::redi...
php
public function postLogout (Request $request) { if ($redirect = $request->getSession ()->get ('post-login-redirect')) { $request->getSession ()->set ('post-login-redirect', null); $request->getSession ()->set ('cancel-login-redirect', null); return Response::redi...
[ "public", "function", "postLogout", "(", "Request", "$", "request", ")", "{", "if", "(", "$", "redirect", "=", "$", "request", "->", "getSession", "(", ")", "->", "get", "(", "'post-login-redirect'", ")", ")", "{", "$", "request", "->", "getSession", "("...
Called after a redirect @param Request $request @return Response @throws DataNotSet
[ "Called", "after", "a", "redirect" ]
train
https://github.com/CatLabInteractive/Accounts/blob/e5465ad815c3caba5b7c1fde7b465a5fa05f3298/src/CatLab/Accounts/Module.php#L223-L234
CatLabInteractive/Accounts
src/CatLab/Accounts/Module.php
Module.setRoutes
public function setRoutes (Router $router) { // Filter $router->addFilter ('authenticated', array ($this, 'routerVerifier')); // Routes $router->match ('GET|POST', $this->routepath . '/login/{authenticator}', '\CatLab\Accounts\Controllers\LoginController@authenticator'); $ro...
php
public function setRoutes (Router $router) { // Filter $router->addFilter ('authenticated', array ($this, 'routerVerifier')); // Routes $router->match ('GET|POST', $this->routepath . '/login/{authenticator}', '\CatLab\Accounts\Controllers\LoginController@authenticator'); $ro...
[ "public", "function", "setRoutes", "(", "Router", "$", "router", ")", "{", "// Filter", "$", "router", "->", "addFilter", "(", "'authenticated'", ",", "array", "(", "$", "this", ",", "'routerVerifier'", ")", ")", ";", "// Routes", "$", "router", "->", "mat...
Register the routes required for this module. @param Router $router @return mixed
[ "Register", "the", "routes", "required", "for", "this", "module", "." ]
train
https://github.com/CatLabInteractive/Accounts/blob/e5465ad815c3caba5b7c1fde7b465a5fa05f3298/src/CatLab/Accounts/Module.php#L249-L269
aloframework/common
src/Alo.php
Alo.asciiRand
public static function asciiRand($length, $subset = self::ASCII_ALL) { switch ($subset) { case self::ASCII_ALPHANUM: $subset = self::$asciiAlphanum; break; case self::ASCII_NONALPHANUM: $subset = self::$asciNonAlphan...
php
public static function asciiRand($length, $subset = self::ASCII_ALL) { switch ($subset) { case self::ASCII_ALPHANUM: $subset = self::$asciiAlphanum; break; case self::ASCII_NONALPHANUM: $subset = self::$asciNonAlphan...
[ "public", "static", "function", "asciiRand", "(", "$", "length", ",", "$", "subset", "=", "self", "::", "ASCII_ALL", ")", "{", "switch", "(", "$", "subset", ")", "{", "case", "self", "::", "ASCII_ALPHANUM", ":", "$", "subset", "=", "self", "::", "$", ...
Generates a string of random ASCII characters @author Art <a.molcanovas@gmail.com> @param int $length The length of the string @param int $subset Which subset to use - see class' ASCII_* constants @return string @since 1.3
[ "Generates", "a", "string", "of", "random", "ASCII", "characters" ]
train
https://github.com/aloframework/common/blob/484ef76ea5e1b99b2758e5c35c76229572dc27cb/src/Alo.php#L189-L210
aloframework/common
src/Alo.php
Alo.getUniqid
public static function getUniqid($hash = 'sha256', $prefix = '', $entropy = 10000, $rawOutput = false) { $str = mt_rand(~PHP_INT_MAX, PHP_INT_MAX) . json_encode([$_COOKIE, $_REQUEST, ...
php
public static function getUniqid($hash = 'sha256', $prefix = '', $entropy = 10000, $rawOutput = false) { $str = mt_rand(~PHP_INT_MAX, PHP_INT_MAX) . json_encode([$_COOKIE, $_REQUEST, ...
[ "public", "static", "function", "getUniqid", "(", "$", "hash", "=", "'sha256'", ",", "$", "prefix", "=", "''", ",", "$", "entropy", "=", "10000", ",", "$", "rawOutput", "=", "false", ")", "{", "$", "str", "=", "mt_rand", "(", "~", "PHP_INT_MAX", ",",...
Generates a unique identifier @author Art <a.molcanovas@gmail.com> @param string $hash Hash algorithm @param string $prefix Prefix for the identifier @param int $entropy Number of pseudo bytes used in entropy @param bool $rawOutput When set to true, outputs raw binary data. false outputs lowercase hexi...
[ "Generates", "a", "unique", "identifier" ]
train
https://github.com/aloframework/common/blob/484ef76ea5e1b99b2758e5c35c76229572dc27cb/src/Alo.php#L230-L256
aloframework/common
src/Alo.php
Alo.ifnull
public static function ifnull(&$var, $planB, $useNullget = false) { $v = $useNullget ? self::nullget($var) : self::get($var); return $v !== null ? $v : $planB; }
php
public static function ifnull(&$var, $planB, $useNullget = false) { $v = $useNullget ? self::nullget($var) : self::get($var); return $v !== null ? $v : $planB; }
[ "public", "static", "function", "ifnull", "(", "&", "$", "var", ",", "$", "planB", ",", "$", "useNullget", "=", "false", ")", "{", "$", "v", "=", "$", "useNullget", "?", "self", "::", "nullget", "(", "$", "var", ")", ":", "self", "::", "get", "("...
Returns $var if it's set $planB if it's not @author Art <a.molcanovas@gmail.com> @param mixed $var Reference to the main variable @param mixed $planB What to return if $var isn't available @param bool $useNullget If set to true, will use self::nullget(), otherwise will use self::get() to determinewhether...
[ "Returns", "$var", "if", "it", "s", "set", "$planB", "if", "it", "s", "not" ]
train
https://github.com/aloframework/common/blob/484ef76ea5e1b99b2758e5c35c76229572dc27cb/src/Alo.php#L347-L351
aloframework/common
src/Alo.php
Alo.getFingerprint
public static function getFingerprint($hashAlgo = 'sha256') { return hash($hashAlgo, '#QramRAN7*s%6n%@x*53jVVPsnrz@5MY$49o^mhJ8HqY%3a09yJnSWg9lBl$O4CKUb&&S%EgYBjhUZEbhquw$keCjR6I%zMcA!Qr' . self::get($_SERVER['HTTP_USER_AGENT']) . 'OE2%...
php
public static function getFingerprint($hashAlgo = 'sha256') { return hash($hashAlgo, '#QramRAN7*s%6n%@x*53jVVPsnrz@5MY$49o^mhJ8HqY%3a09yJnSWg9lBl$O4CKUb&&S%EgYBjhUZEbhquw$keCjR6I%zMcA!Qr' . self::get($_SERVER['HTTP_USER_AGENT']) . 'OE2%...
[ "public", "static", "function", "getFingerprint", "(", "$", "hashAlgo", "=", "'sha256'", ")", "{", "return", "hash", "(", "$", "hashAlgo", ",", "'#QramRAN7*s%6n%@x*53jVVPsnrz@5MY$49o^mhJ8HqY%3a09yJnSWg9lBl$O4CKUb&&S%EgYBjhUZEbhquw$keCjR6I%zMcA!Qr'", ".", "self", "::", "get"...
Returns a hashed browser fingerprint @author Art <a.molcanovas@gmail.com> @param string $hashAlgo Hash algorithm to use @return string @since 1.2
[ "Returns", "a", "hashed", "browser", "fingerprint" ]
train
https://github.com/aloframework/common/blob/484ef76ea5e1b99b2758e5c35c76229572dc27cb/src/Alo.php#L388-L397
aloframework/common
src/Alo.php
Alo.unXss
public static function unXss($input) { if (self::isTraversable($input)) { foreach ($input as &$i) { $i = self::unXss($i); } } elseif (is_scalar($input)) { $input = htmlspecialchars($input, ENT_QUOTES | ENT_HTML5 | ENT_SUBSTITUTE...
php
public static function unXss($input) { if (self::isTraversable($input)) { foreach ($input as &$i) { $i = self::unXss($i); } } elseif (is_scalar($input)) { $input = htmlspecialchars($input, ENT_QUOTES | ENT_HTML5 | ENT_SUBSTITUTE...
[ "public", "static", "function", "unXss", "(", "$", "input", ")", "{", "if", "(", "self", "::", "isTraversable", "(", "$", "input", ")", ")", "{", "foreach", "(", "$", "input", "as", "&", "$", "i", ")", "{", "$", "i", "=", "self", "::", "unXss", ...
Protects the input from cross-site scripting attacks @author Art <a.molcanovas@gmail.com> @param string|array|Traversable $input The scalar input, or an array/Traversable @return string|array|Traversable The escaped string. If an array or traversable was passed on, the input withall its applicable values escaped. @s...
[ "Protects", "the", "input", "from", "cross", "-", "site", "scripting", "attacks" ]
train
https://github.com/aloframework/common/blob/484ef76ea5e1b99b2758e5c35c76229572dc27cb/src/Alo.php#L425-L435
irfantoor/engine
src/Http/Uri.php
Uri.withUserInfo
public function withUserInfo($user, $password = null) { $clone = clone $this; $clone->user = $user; $clone->pass = $password; $clone->_process(); return $clone; }
php
public function withUserInfo($user, $password = null) { $clone = clone $this; $clone->user = $user; $clone->pass = $password; $clone->_process(); return $clone; }
[ "public", "function", "withUserInfo", "(", "$", "user", ",", "$", "password", "=", "null", ")", "{", "$", "clone", "=", "clone", "$", "this", ";", "$", "clone", "->", "user", "=", "$", "user", ";", "$", "clone", "->", "pass", "=", "$", "password", ...
Return an instance with the specified user information. This method MUST retain the state of the current instance, and return an instance that contains the specified user information. Password is optional, but the user information MUST include the user; an empty string for the user is equivalent to removing user info...
[ "Return", "an", "instance", "with", "the", "specified", "user", "information", "." ]
train
https://github.com/irfantoor/engine/blob/4d2d221add749f75100d0b4ffe1488cdbf7af5d3/src/Http/Uri.php#L356-L364
mpf-soft/admin-widgets
jqueryfileupload/Uploader.php
Uploader.init
protected function init($config) { parent::init($config); if (!$this->dataUrl) { $this->dataUrl = WebApp::get()->request()->getCurrentURL(); // if dataUrl is not set then current URL will be used; } if ($this->handleRequest) { $this->_handle(); die(); ...
php
protected function init($config) { parent::init($config); if (!$this->dataUrl) { $this->dataUrl = WebApp::get()->request()->getCurrentURL(); // if dataUrl is not set then current URL will be used; } if ($this->handleRequest) { $this->_handle(); die(); ...
[ "protected", "function", "init", "(", "$", "config", ")", "{", "parent", "::", "init", "(", "$", "config", ")", ";", "if", "(", "!", "$", "this", "->", "dataUrl", ")", "{", "$", "this", "->", "dataUrl", "=", "WebApp", "::", "get", "(", ")", "->",...
It will take care of upload and delete requests; @param array $config @return bool @throws \Exception
[ "It", "will", "take", "care", "of", "upload", "and", "delete", "requests", ";" ]
train
https://github.com/mpf-soft/admin-widgets/blob/92597f9a09d086664268d6b7e0111d5a5586d8c7/jqueryfileupload/Uploader.php#L127-L138
mpf-soft/admin-widgets
jqueryfileupload/Uploader.php
Uploader.display
public function display() { $source = str_replace(['{VENDOR}', '{APP_ROOT}'], [LIBS_FOLDER, APP_ROOT], $this->jsSource); $url = AssetsPublisher::get()->publishFolder($source); $events = $this->getJSEvents(); $r = Form::get()->input($this->name . '[]', 'file', null, [ 'id'...
php
public function display() { $source = str_replace(['{VENDOR}', '{APP_ROOT}'], [LIBS_FOLDER, APP_ROOT], $this->jsSource); $url = AssetsPublisher::get()->publishFolder($source); $events = $this->getJSEvents(); $r = Form::get()->input($this->name . '[]', 'file', null, [ 'id'...
[ "public", "function", "display", "(", ")", "{", "$", "source", "=", "str_replace", "(", "[", "'{VENDOR}'", ",", "'{APP_ROOT}'", "]", ",", "[", "LIBS_FOLDER", ",", "APP_ROOT", "]", ",", "$", "this", "->", "jsSource", ")", ";", "$", "url", "=", "AssetsPu...
Returns the HTML code for the element. @return string
[ "Returns", "the", "HTML", "code", "for", "the", "element", "." ]
train
https://github.com/mpf-soft/admin-widgets/blob/92597f9a09d086664268d6b7e0111d5a5586d8c7/jqueryfileupload/Uploader.php#L183-L209
stellaqua/Waltz.Stagehand
src/Waltz/Stagehand/ClassUtility/ClassObject/PhpClassObject.php
PhpClassObject.getName
public function getName ( $withoutNamespace = false ) { $className = $this->_reflectionClass->getName(); if ( $withoutNamespace === true ) { $tokens = explode('\\', $className); $className = end($tokens); } return $className; }
php
public function getName ( $withoutNamespace = false ) { $className = $this->_reflectionClass->getName(); if ( $withoutNamespace === true ) { $tokens = explode('\\', $className); $className = end($tokens); } return $className; }
[ "public", "function", "getName", "(", "$", "withoutNamespace", "=", "false", ")", "{", "$", "className", "=", "$", "this", "->", "_reflectionClass", "->", "getName", "(", ")", ";", "if", "(", "$", "withoutNamespace", "===", "true", ")", "{", "$", "tokens...
Get class name @param bool $withoutNamespace @return string Class name
[ "Get", "class", "name" ]
train
https://github.com/stellaqua/Waltz.Stagehand/blob/01df286751f5b9a5c90c47138dca3709e5bc383b/src/Waltz/Stagehand/ClassUtility/ClassObject/PhpClassObject.php#L61-L69
stellaqua/Waltz.Stagehand
src/Waltz/Stagehand/ClassUtility/ClassObject/PhpClassObject.php
PhpClassObject.getDocComment
public function getDocComment ( $withCommentMark = false ) { $docComment = $this->_reflectionClass->getDocComment(); if ( $withCommentMark === false ) { $docComment = PhpDocCommentObject::stripCommentMarks($docComment); } return $docComment; }
php
public function getDocComment ( $withCommentMark = false ) { $docComment = $this->_reflectionClass->getDocComment(); if ( $withCommentMark === false ) { $docComment = PhpDocCommentObject::stripCommentMarks($docComment); } return $docComment; }
[ "public", "function", "getDocComment", "(", "$", "withCommentMark", "=", "false", ")", "{", "$", "docComment", "=", "$", "this", "->", "_reflectionClass", "->", "getDocComment", "(", ")", ";", "if", "(", "$", "withCommentMark", "===", "false", ")", "{", "$...
Get DocComment of class @param bool $withCommentMark @return string DocComment
[ "Get", "DocComment", "of", "class" ]
train
https://github.com/stellaqua/Waltz.Stagehand/blob/01df286751f5b9a5c90c47138dca3709e5bc383b/src/Waltz/Stagehand/ClassUtility/ClassObject/PhpClassObject.php#L77-L83
975L/ConfigBundle
Service/ConfigService.php
ConfigService.convertToArray
public function convertToArray(Config $config) { $values = get_object_vars($config); unset($values['configDataReserved']); //Converts yaml array to php array foreach ($values as $key => $value) { if (is_string($value) && ('[' == substr($value, 0, 1) || '{' == substr($val...
php
public function convertToArray(Config $config) { $values = get_object_vars($config); unset($values['configDataReserved']); //Converts yaml array to php array foreach ($values as $key => $value) { if (is_string($value) && ('[' == substr($value, 0, 1) || '{' == substr($val...
[ "public", "function", "convertToArray", "(", "Config", "$", "config", ")", "{", "$", "values", "=", "get_object_vars", "(", "$", "config", ")", ";", "unset", "(", "$", "values", "[", "'configDataReserved'", "]", ")", ";", "//Converts yaml array to php array", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/975L/ConfigBundle/blob/1f9a9e937dbb79ad06fe5d456e7536d58bd56e19/Service/ConfigService.php#L74-L87
975L/ConfigBundle
Service/ConfigService.php
ConfigService.createForm
public function createForm(string $bundle) { $config = $this->getConfig($bundle); return $this->configFormFactory->create($config); }
php
public function createForm(string $bundle) { $config = $this->getConfig($bundle); return $this->configFormFactory->create($config); }
[ "public", "function", "createForm", "(", "string", "$", "bundle", ")", "{", "$", "config", "=", "$", "this", "->", "getConfig", "(", "$", "bundle", ")", ";", "return", "$", "this", "->", "configFormFactory", "->", "create", "(", "$", "config", ")", ";"...
{@inheritdoc}
[ "{" ]
train
https://github.com/975L/ConfigBundle/blob/1f9a9e937dbb79ad06fe5d456e7536d58bd56e19/Service/ConfigService.php#L92-L97
975L/ConfigBundle
Service/ConfigService.php
ConfigService.getBundleConfig
public function getBundleConfig(string $bundle) { $file = $this->container->getParameter('kernel.root_dir') . '/../vendor/' . $bundle . '/Resources/config/bundle.yaml'; if (is_file($file)) { $yamlBundleConfig = Yaml::parseFile($file); if (is_array($yamlBundleConfig)) { ...
php
public function getBundleConfig(string $bundle) { $file = $this->container->getParameter('kernel.root_dir') . '/../vendor/' . $bundle . '/Resources/config/bundle.yaml'; if (is_file($file)) { $yamlBundleConfig = Yaml::parseFile($file); if (is_array($yamlBundleConfig)) { ...
[ "public", "function", "getBundleConfig", "(", "string", "$", "bundle", ")", "{", "$", "file", "=", "$", "this", "->", "container", "->", "getParameter", "(", "'kernel.root_dir'", ")", ".", "'/../vendor/'", ".", "$", "bundle", ".", "'/Resources/config/bundle.yaml...
{@inheritdoc}
[ "{" ]
train
https://github.com/975L/ConfigBundle/blob/1f9a9e937dbb79ad06fe5d456e7536d58bd56e19/Service/ConfigService.php#L102-L136
975L/ConfigBundle
Service/ConfigService.php
ConfigService.getBundles
public function getBundles() { $folder = $this->container->getParameter('kernel.root_dir') . '/../vendor/*/*/Resources'; $bundlesConfigFiles = new Finder(); $bundlesConfigFiles ->files() ->name('bundle.yaml') ->in($folder) ->sortByName() ...
php
public function getBundles() { $folder = $this->container->getParameter('kernel.root_dir') . '/../vendor/*/*/Resources'; $bundlesConfigFiles = new Finder(); $bundlesConfigFiles ->files() ->name('bundle.yaml') ->in($folder) ->sortByName() ...
[ "public", "function", "getBundles", "(", ")", "{", "$", "folder", "=", "$", "this", "->", "container", "->", "getParameter", "(", "'kernel.root_dir'", ")", ".", "'/../vendor/*/*/Resources'", ";", "$", "bundlesConfigFiles", "=", "new", "Finder", "(", ")", ";", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/975L/ConfigBundle/blob/1f9a9e937dbb79ad06fe5d456e7536d58bd56e19/Service/ConfigService.php#L141-L164
975L/ConfigBundle
Service/ConfigService.php
ConfigService.getConfig
public function getConfig(string $bundle) { //Initializes config with data defined in bundle.yaml $config = $this->getBundleConfig($bundle); //Updates config with data defined in config_bundles.yaml $roots = $config->configDataReserved['roots']; foreach ($roots as $root) { ...
php
public function getConfig(string $bundle) { //Initializes config with data defined in bundle.yaml $config = $this->getBundleConfig($bundle); //Updates config with data defined in config_bundles.yaml $roots = $config->configDataReserved['roots']; foreach ($roots as $root) { ...
[ "public", "function", "getConfig", "(", "string", "$", "bundle", ")", "{", "//Initializes config with data defined in bundle.yaml", "$", "config", "=", "$", "this", "->", "getBundleConfig", "(", "$", "bundle", ")", ";", "//Updates config with data defined in config_bundle...
{@inheritdoc}
[ "{" ]
train
https://github.com/975L/ConfigBundle/blob/1f9a9e937dbb79ad06fe5d456e7536d58bd56e19/Service/ConfigService.php#L169-L188
975L/ConfigBundle
Service/ConfigService.php
ConfigService.getDefinedConfig
public function getDefinedConfig(string $root) { $globalConfig = $this->getGlobalConfig(); if (null !== $globalConfig && array_key_exists($root, $globalConfig)) { $definedConfig = $globalConfig[$root]; return $definedConfig; } return null; }
php
public function getDefinedConfig(string $root) { $globalConfig = $this->getGlobalConfig(); if (null !== $globalConfig && array_key_exists($root, $globalConfig)) { $definedConfig = $globalConfig[$root]; return $definedConfig; } return null; }
[ "public", "function", "getDefinedConfig", "(", "string", "$", "root", ")", "{", "$", "globalConfig", "=", "$", "this", "->", "getGlobalConfig", "(", ")", ";", "if", "(", "null", "!==", "$", "globalConfig", "&&", "array_key_exists", "(", "$", "root", ",", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/975L/ConfigBundle/blob/1f9a9e937dbb79ad06fe5d456e7536d58bd56e19/Service/ConfigService.php#L193-L204
975L/ConfigBundle
Service/ConfigService.php
ConfigService.getGlobalConfig
public function getGlobalConfig() { $file = $this->getConfigFolder() . self::CONFIG_FILE_YAML; if (is_file($file)) { $globalConfig = Yaml::parseFile($file, Yaml::PARSE_DATETIME); return $globalConfig; } return null; }
php
public function getGlobalConfig() { $file = $this->getConfigFolder() . self::CONFIG_FILE_YAML; if (is_file($file)) { $globalConfig = Yaml::parseFile($file, Yaml::PARSE_DATETIME); return $globalConfig; } return null; }
[ "public", "function", "getGlobalConfig", "(", ")", "{", "$", "file", "=", "$", "this", "->", "getConfigFolder", "(", ")", ".", "self", "::", "CONFIG_FILE_YAML", ";", "if", "(", "is_file", "(", "$", "file", ")", ")", "{", "$", "globalConfig", "=", "Yaml...
{@inheritdoc}
[ "{" ]
train
https://github.com/975L/ConfigBundle/blob/1f9a9e937dbb79ad06fe5d456e7536d58bd56e19/Service/ConfigService.php#L209-L219
975L/ConfigBundle
Service/ConfigService.php
ConfigService.getConfigFolder
public function getConfigFolder() { $rootFolder = $this->container->getParameter('kernel.root_dir'); return '4' === substr(Kernel::VERSION, 0, 1) ? $rootFolder . '/../config/' : $rootFolder . '/../app/config/'; }
php
public function getConfigFolder() { $rootFolder = $this->container->getParameter('kernel.root_dir'); return '4' === substr(Kernel::VERSION, 0, 1) ? $rootFolder . '/../config/' : $rootFolder . '/../app/config/'; }
[ "public", "function", "getConfigFolder", "(", ")", "{", "$", "rootFolder", "=", "$", "this", "->", "container", "->", "getParameter", "(", "'kernel.root_dir'", ")", ";", "return", "'4'", "===", "substr", "(", "Kernel", "::", "VERSION", ",", "0", ",", "1", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/975L/ConfigBundle/blob/1f9a9e937dbb79ad06fe5d456e7536d58bd56e19/Service/ConfigService.php#L232-L237
975L/ConfigBundle
Service/ConfigService.php
ConfigService.getParameter
public function getParameter(string $parameter, string $bundle = null) { if (strpos($parameter, '.')) { $paramArray = explode('.', $parameter); $parameters = $this->getParametersCacheFile($paramArray[0], $bundle); if (null !== $parameters) { if (array_key...
php
public function getParameter(string $parameter, string $bundle = null) { if (strpos($parameter, '.')) { $paramArray = explode('.', $parameter); $parameters = $this->getParametersCacheFile($paramArray[0], $bundle); if (null !== $parameters) { if (array_key...
[ "public", "function", "getParameter", "(", "string", "$", "parameter", ",", "string", "$", "bundle", "=", "null", ")", "{", "if", "(", "strpos", "(", "$", "parameter", ",", "'.'", ")", ")", "{", "$", "paramArray", "=", "explode", "(", "'.'", ",", "$"...
{@inheritdoc}
[ "{" ]
train
https://github.com/975L/ConfigBundle/blob/1f9a9e937dbb79ad06fe5d456e7536d58bd56e19/Service/ConfigService.php#L250-L264
975L/ConfigBundle
Service/ConfigService.php
ConfigService.getParametersCacheFile
public function getParametersCacheFile(string $root, string $bundle = null) { static $parameters; if (null !== $parameters) { return $parameters; } //Creates cache file if not existing $file = $this->getCacheFolder() . self::CONFIG_FILE_PHP; if (!is_file...
php
public function getParametersCacheFile(string $root, string $bundle = null) { static $parameters; if (null !== $parameters) { return $parameters; } //Creates cache file if not existing $file = $this->getCacheFolder() . self::CONFIG_FILE_PHP; if (!is_file...
[ "public", "function", "getParametersCacheFile", "(", "string", "$", "root", ",", "string", "$", "bundle", "=", "null", ")", "{", "static", "$", "parameters", ";", "if", "(", "null", "!==", "$", "parameters", ")", "{", "return", "$", "parameters", ";", "}...
{@inheritdoc}
[ "{" ]
train
https://github.com/975L/ConfigBundle/blob/1f9a9e937dbb79ad06fe5d456e7536d58bd56e19/Service/ConfigService.php#L269-L312
975L/ConfigBundle
Service/ConfigService.php
ConfigService.hasParameter
public function hasParameter(string $parameter) { if (strpos($parameter, '.')) { $paramArray = explode('.', $parameter); $parameters = $this->getParametersCacheFile($paramArray[0]); if (null !== $parameters) { if (array_key_exists($paramArray[0], $paramet...
php
public function hasParameter(string $parameter) { if (strpos($parameter, '.')) { $paramArray = explode('.', $parameter); $parameters = $this->getParametersCacheFile($paramArray[0]); if (null !== $parameters) { if (array_key_exists($paramArray[0], $paramet...
[ "public", "function", "hasParameter", "(", "string", "$", "parameter", ")", "{", "if", "(", "strpos", "(", "$", "parameter", ",", "'.'", ")", ")", "{", "$", "paramArray", "=", "explode", "(", "'.'", ",", "$", "parameter", ")", ";", "$", "parameters", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/975L/ConfigBundle/blob/1f9a9e937dbb79ad06fe5d456e7536d58bd56e19/Service/ConfigService.php#L317-L331
975L/ConfigBundle
Service/ConfigService.php
ConfigService.setConfig
public function setConfig($data) { if ($data instanceof Form) { $data = $data->getData(); } //Adds new values $newDefinedValues = $this->convertToArray($data); $globalConfig = $this->getGlobalConfig(); $parameters = $data->configDataReserved['parameters']...
php
public function setConfig($data) { if ($data instanceof Form) { $data = $data->getData(); } //Adds new values $newDefinedValues = $this->convertToArray($data); $globalConfig = $this->getGlobalConfig(); $parameters = $data->configDataReserved['parameters']...
[ "public", "function", "setConfig", "(", "$", "data", ")", "{", "if", "(", "$", "data", "instanceof", "Form", ")", "{", "$", "data", "=", "$", "data", "->", "getData", "(", ")", ";", "}", "//Adds new values", "$", "newDefinedValues", "=", "$", "this", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/975L/ConfigBundle/blob/1f9a9e937dbb79ad06fe5d456e7536d58bd56e19/Service/ConfigService.php#L336-L362
975L/ConfigBundle
Service/ConfigService.php
ConfigService.writeYamlFile
public function writeYamlFile(array $globalConfig) { $yamlContent = Yaml::dump($globalConfig, 2, 4, Yaml::DUMP_EXCEPTION_ON_INVALID_TYPE); //Removes quotes around array otherwise yaml will not see it as an array $yamlContent = preg_replace("/'({.*})'/", '$1', $yamlContent); $yamlCon...
php
public function writeYamlFile(array $globalConfig) { $yamlContent = Yaml::dump($globalConfig, 2, 4, Yaml::DUMP_EXCEPTION_ON_INVALID_TYPE); //Removes quotes around array otherwise yaml will not see it as an array $yamlContent = preg_replace("/'({.*})'/", '$1', $yamlContent); $yamlCon...
[ "public", "function", "writeYamlFile", "(", "array", "$", "globalConfig", ")", "{", "$", "yamlContent", "=", "Yaml", "::", "dump", "(", "$", "globalConfig", ",", "2", ",", "4", ",", "Yaml", "::", "DUMP_EXCEPTION_ON_INVALID_TYPE", ")", ";", "//Removes quotes ar...
{@inheritdoc}
[ "{" ]
train
https://github.com/975L/ConfigBundle/blob/1f9a9e937dbb79ad06fe5d456e7536d58bd56e19/Service/ConfigService.php#L367-L383
975L/ConfigBundle
Service/ConfigService.php
ConfigService.writePhpFile
public function writePhpFile(array $globalConfig) { $fs = new Filesystem(); $file = $this->getCacheFolder() . self::CONFIG_FILE_PHP; $phpContent = "<?php\nreturn " . var_export($globalConfig, true) . ';'; $phpContent = str_replace(array('\'"', '"\''), "'", $phpContent); $fs-...
php
public function writePhpFile(array $globalConfig) { $fs = new Filesystem(); $file = $this->getCacheFolder() . self::CONFIG_FILE_PHP; $phpContent = "<?php\nreturn " . var_export($globalConfig, true) . ';'; $phpContent = str_replace(array('\'"', '"\''), "'", $phpContent); $fs-...
[ "public", "function", "writePhpFile", "(", "array", "$", "globalConfig", ")", "{", "$", "fs", "=", "new", "Filesystem", "(", ")", ";", "$", "file", "=", "$", "this", "->", "getCacheFolder", "(", ")", ".", "self", "::", "CONFIG_FILE_PHP", ";", "$", "php...
{@inheritdoc}
[ "{" ]
train
https://github.com/975L/ConfigBundle/blob/1f9a9e937dbb79ad06fe5d456e7536d58bd56e19/Service/ConfigService.php#L388-L396
padosoft/HTTPClient
src/Multipart.php
Multipart.getMultipartArray
public function getMultipartArray() { $arrMultipart = array(); $arrMultipart[] = ['name' => $this->name, 'contents' => $this->contents, 'headers' => $this->headers, 'filename' => $this->filename ]; ...
php
public function getMultipartArray() { $arrMultipart = array(); $arrMultipart[] = ['name' => $this->name, 'contents' => $this->contents, 'headers' => $this->headers, 'filename' => $this->filename ]; ...
[ "public", "function", "getMultipartArray", "(", ")", "{", "$", "arrMultipart", "=", "array", "(", ")", ";", "$", "arrMultipart", "[", "]", "=", "[", "'name'", "=>", "$", "this", "->", "name", ",", "'contents'", "=>", "$", "this", "->", "contents", ",",...
Return an associative array for RequestHelper::SetMultipart() @return array
[ "Return", "an", "associative", "array", "for", "RequestHelper", "::", "SetMultipart", "()" ]
train
https://github.com/padosoft/HTTPClient/blob/916f3832275bfcb5cc0691a7f39e4c74557dabc4/src/Multipart.php#L113-L124
fridge-project/dbal
src/Fridge/DBAL/Schema/Column.php
Column.setLength
public function setLength($length) { if (($length !== null) && (!is_int($length) || ($length <= 0))) { throw SchemaException::invalidColumnLength($this->getName()); } $this->length = $length; }
php
public function setLength($length) { if (($length !== null) && (!is_int($length) || ($length <= 0))) { throw SchemaException::invalidColumnLength($this->getName()); } $this->length = $length; }
[ "public", "function", "setLength", "(", "$", "length", ")", "{", "if", "(", "(", "$", "length", "!==", "null", ")", "&&", "(", "!", "is_int", "(", "$", "length", ")", "||", "(", "$", "length", "<=", "0", ")", ")", ")", "{", "throw", "SchemaExcept...
Sets the column length. @param integer|null $length The column length. @throws \Fridge\DBAL\Exception\SchemaException If the length is not a positive integer.
[ "Sets", "the", "column", "length", "." ]
train
https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/Schema/Column.php#L117-L124
fridge-project/dbal
src/Fridge/DBAL/Schema/Column.php
Column.setPrecision
public function setPrecision($precision) { if (($precision !== null) && (!is_int($precision) || ($precision <= 0))) { throw SchemaException::invalidColumnPrecision($this->getName()); } $this->precision = $precision; }
php
public function setPrecision($precision) { if (($precision !== null) && (!is_int($precision) || ($precision <= 0))) { throw SchemaException::invalidColumnPrecision($this->getName()); } $this->precision = $precision; }
[ "public", "function", "setPrecision", "(", "$", "precision", ")", "{", "if", "(", "(", "$", "precision", "!==", "null", ")", "&&", "(", "!", "is_int", "(", "$", "precision", ")", "||", "(", "$", "precision", "<=", "0", ")", ")", ")", "{", "throw", ...
Sets the column precision. @param integer|null $precision The column precision. @throws \Fridge\DBAL\Exception\SchemaException If the precision is not a positive integer.
[ "Sets", "the", "column", "precision", "." ]
train
https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/Schema/Column.php#L143-L150
fridge-project/dbal
src/Fridge/DBAL/Schema/Column.php
Column.setScale
public function setScale($scale) { if (($scale !== null) && (!is_int($scale) || ($scale < 0))) { throw SchemaException::invalidColumnScale($this->getName()); } $this->scale = $scale; }
php
public function setScale($scale) { if (($scale !== null) && (!is_int($scale) || ($scale < 0))) { throw SchemaException::invalidColumnScale($this->getName()); } $this->scale = $scale; }
[ "public", "function", "setScale", "(", "$", "scale", ")", "{", "if", "(", "(", "$", "scale", "!==", "null", ")", "&&", "(", "!", "is_int", "(", "$", "scale", ")", "||", "(", "$", "scale", "<", "0", ")", ")", ")", "{", "throw", "SchemaException", ...
Sets the column scale. @param integer|null $scale The column scale. @throws \Fridge\DBAL\Exception\SchemaException If the scale is not a positive integer.
[ "Sets", "the", "column", "scale", "." ]
train
https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/Schema/Column.php#L169-L176
fridge-project/dbal
src/Fridge/DBAL/Schema/Column.php
Column.setUnsigned
public function setUnsigned($unsigned) { if (($unsigned !== null) && !is_bool($unsigned)) { throw SchemaException::invalidColumnUnsignedFlag($this->getName()); } $this->unsigned = $unsigned; }
php
public function setUnsigned($unsigned) { if (($unsigned !== null) && !is_bool($unsigned)) { throw SchemaException::invalidColumnUnsignedFlag($this->getName()); } $this->unsigned = $unsigned; }
[ "public", "function", "setUnsigned", "(", "$", "unsigned", ")", "{", "if", "(", "(", "$", "unsigned", "!==", "null", ")", "&&", "!", "is_bool", "(", "$", "unsigned", ")", ")", "{", "throw", "SchemaException", "::", "invalidColumnUnsignedFlag", "(", "$", ...
Sets the column unsigned flag. @param boolean|null $unsigned The column unsigned flag. @throws \Fridge\DBAL\Exception\SchemaException If the unsigned flag is not a boolean.
[ "Sets", "the", "column", "unsigned", "flag", "." ]
train
https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/Schema/Column.php#L195-L202
fridge-project/dbal
src/Fridge/DBAL/Schema/Column.php
Column.setFixed
public function setFixed($fixed) { if (($fixed !== null) && !is_bool($fixed)) { throw SchemaException::invalidColumnFixedFlag($this->getName()); } $this->fixed = $fixed; }
php
public function setFixed($fixed) { if (($fixed !== null) && !is_bool($fixed)) { throw SchemaException::invalidColumnFixedFlag($this->getName()); } $this->fixed = $fixed; }
[ "public", "function", "setFixed", "(", "$", "fixed", ")", "{", "if", "(", "(", "$", "fixed", "!==", "null", ")", "&&", "!", "is_bool", "(", "$", "fixed", ")", ")", "{", "throw", "SchemaException", "::", "invalidColumnFixedFlag", "(", "$", "this", "->",...
Sets the column fixed flag. @param boolean $fixed The column fixed flag. @throws \Fridge\DBAL\Exception\SchemaException If the fixed flag is not a boolean.
[ "Sets", "the", "column", "fixed", "flag", "." ]
train
https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/Schema/Column.php#L221-L228
fridge-project/dbal
src/Fridge/DBAL/Schema/Column.php
Column.setNotNull
public function setNotNull($notNull) { if (($notNull !== null) && !is_bool($notNull)) { throw SchemaException::invalidColumnNotNullFlag($this->getName()); } $this->notNull = $notNull; }
php
public function setNotNull($notNull) { if (($notNull !== null) && !is_bool($notNull)) { throw SchemaException::invalidColumnNotNullFlag($this->getName()); } $this->notNull = $notNull; }
[ "public", "function", "setNotNull", "(", "$", "notNull", ")", "{", "if", "(", "(", "$", "notNull", "!==", "null", ")", "&&", "!", "is_bool", "(", "$", "notNull", ")", ")", "{", "throw", "SchemaException", "::", "invalidColumnNotNullFlag", "(", "$", "this...
Sets the column not null flag. @param boolean|null $notNull The column not null flag. @throws \Fridge\DBAL\Exception\SchemaException If the not null flag is not a boolean.
[ "Sets", "the", "column", "not", "null", "flag", "." ]
train
https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/Schema/Column.php#L247-L254
fridge-project/dbal
src/Fridge/DBAL/Schema/Column.php
Column.setAutoIncrement
public function setAutoIncrement($autoIncrement) { if (($autoIncrement !== null) && !is_bool($autoIncrement)) { throw SchemaException::invalidColumnAutoIncrementFlag($this->getName()); } $this->autoIncrement = $autoIncrement; }
php
public function setAutoIncrement($autoIncrement) { if (($autoIncrement !== null) && !is_bool($autoIncrement)) { throw SchemaException::invalidColumnAutoIncrementFlag($this->getName()); } $this->autoIncrement = $autoIncrement; }
[ "public", "function", "setAutoIncrement", "(", "$", "autoIncrement", ")", "{", "if", "(", "(", "$", "autoIncrement", "!==", "null", ")", "&&", "!", "is_bool", "(", "$", "autoIncrement", ")", ")", "{", "throw", "SchemaException", "::", "invalidColumnAutoIncreme...
Sets the column auto increment flag. @param boolean|null $autoIncrement The column auto increment flag. @throws \Fridge\DBAL\Exception\SchemaException If the auto increment flag is not a boolean.
[ "Sets", "the", "column", "auto", "increment", "flag", "." ]
train
https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/Schema/Column.php#L293-L300
fridge-project/dbal
src/Fridge/DBAL/Schema/Column.php
Column.setComment
public function setComment($comment) { if (($comment !== null) && !is_string($comment)) { throw SchemaException::invalidColumnComment($this->getName()); } $this->comment = $comment; }
php
public function setComment($comment) { if (($comment !== null) && !is_string($comment)) { throw SchemaException::invalidColumnComment($this->getName()); } $this->comment = $comment; }
[ "public", "function", "setComment", "(", "$", "comment", ")", "{", "if", "(", "(", "$", "comment", "!==", "null", ")", "&&", "!", "is_string", "(", "$", "comment", ")", ")", "{", "throw", "SchemaException", "::", "invalidColumnComment", "(", "$", "this",...
Sets the column comment. @param string|null $comment The column comment. @throws \Fridge\DBAL\Exception\SchemaException If the comment is not a string.
[ "Sets", "the", "column", "comment", "." ]
train
https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/Schema/Column.php#L319-L326
fridge-project/dbal
src/Fridge/DBAL/Schema/Column.php
Column.setProperties
public function setProperties(array $properties) { foreach ($properties as $property => $value) { $method = sprintf('set%s', str_replace('_', '', $property)); if (!method_exists($this, $method)) { throw SchemaException::invalidColumnProperty($this->getName(), $prope...
php
public function setProperties(array $properties) { foreach ($properties as $property => $value) { $method = sprintf('set%s', str_replace('_', '', $property)); if (!method_exists($this, $method)) { throw SchemaException::invalidColumnProperty($this->getName(), $prope...
[ "public", "function", "setProperties", "(", "array", "$", "properties", ")", "{", "foreach", "(", "$", "properties", "as", "$", "property", "=>", "$", "value", ")", "{", "$", "method", "=", "sprintf", "(", "'set%s'", ",", "str_replace", "(", "'_'", ",", ...
Sets the column options. @param array $properties Associative array that describes property => value pairs. @throws \Fridge\DBAL\Exception\SchemaException If the property does not exist.
[ "Sets", "the", "column", "options", "." ]
train
https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/Schema/Column.php#L335-L346
fridge-project/dbal
src/Fridge/DBAL/Schema/Column.php
Column.toArray
public function toArray() { return array( 'name' => $this->getName(), 'type' => $this->getType()->getName(), 'length' => $this->getLength(), 'precision' => $this->getPrecision(), 'scale' => $this->getScale(...
php
public function toArray() { return array( 'name' => $this->getName(), 'type' => $this->getType()->getName(), 'length' => $this->getLength(), 'precision' => $this->getPrecision(), 'scale' => $this->getScale(...
[ "public", "function", "toArray", "(", ")", "{", "return", "array", "(", "'name'", "=>", "$", "this", "->", "getName", "(", ")", ",", "'type'", "=>", "$", "this", "->", "getType", "(", ")", "->", "getName", "(", ")", ",", "'length'", "=>", "$", "thi...
Converts a column to an array. @return array The column converted to an array.
[ "Converts", "a", "column", "to", "an", "array", "." ]
train
https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/Schema/Column.php#L353-L368
eureka-framework/component-controller
src/Controller/DataCollection.php
DataCollection.add
public function add($key, $value) { $this->collection[$key] = $value; $this->indices[$this->length] = $key; $this->length++; return $this; }
php
public function add($key, $value) { $this->collection[$key] = $value; $this->indices[$this->length] = $key; $this->length++; return $this; }
[ "public", "function", "add", "(", "$", "key", ",", "$", "value", ")", "{", "$", "this", "->", "collection", "[", "$", "key", "]", "=", "$", "value", ";", "$", "this", "->", "indices", "[", "$", "this", "->", "length", "]", "=", "$", "key", ";",...
Add data to the collection. @param string $key @param mixed $value @return self
[ "Add", "data", "to", "the", "collection", "." ]
train
https://github.com/eureka-framework/component-controller/blob/368efb6fb9eece4f7f69233e6190e1fdbb0ace2c/src/Controller/DataCollection.php#L54-L61
SagittariusX/Beluga.Core
src/Beluga/Type.php
Type.getPhpCode
public final function getPhpCode() : string { $str = $this->stringValue; switch ( $this->typeName ) { case Type::PHP_BOOLEAN: case 'boolean': return ( $this->value ? 'true' : 'false' ); case Type::PHP_DOUBLE: case Type::PHP_FLOAT: case Ty...
php
public final function getPhpCode() : string { $str = $this->stringValue; switch ( $this->typeName ) { case Type::PHP_BOOLEAN: case 'boolean': return ( $this->value ? 'true' : 'false' ); case Type::PHP_DOUBLE: case Type::PHP_FLOAT: case Ty...
[ "public", "final", "function", "getPhpCode", "(", ")", ":", "string", "{", "$", "str", "=", "$", "this", "->", "stringValue", ";", "switch", "(", "$", "this", "->", "typeName", ")", "{", "case", "Type", "::", "PHP_BOOLEAN", ":", "case", "'boolean'", ":...
Returns the PHP code, defining the current base value. @return string
[ "Returns", "the", "PHP", "code", "defining", "the", "current", "base", "value", "." ]
train
https://github.com/SagittariusX/Beluga.Core/blob/51057b362707157a4b075df42bb49f397e2d310b/src/Beluga/Type.php#L298-L359
Linkvalue-Interne/MajoraOrientDBBundle
src/Majora/Component/Graph/Engine/OrientDbEngine.php
OrientDbEngine.registerConnection
public function registerConnection($name, array $configuration) { $this->configurations->set($name, new OrientDbMetadata( $configuration['host'], $configuration['port'], $configuration['timeout'], $configuration['user'], $configuration['password'],...
php
public function registerConnection($name, array $configuration) { $this->configurations->set($name, new OrientDbMetadata( $configuration['host'], $configuration['port'], $configuration['timeout'], $configuration['user'], $configuration['password'],...
[ "public", "function", "registerConnection", "(", "$", "name", ",", "array", "$", "configuration", ")", "{", "$", "this", "->", "configurations", "->", "set", "(", "$", "name", ",", "new", "OrientDbMetadata", "(", "$", "configuration", "[", "'host'", "]", "...
Register a new OrientDB connection under given name @param string $name
[ "Register", "a", "new", "OrientDB", "connection", "under", "given", "name" ]
train
https://github.com/Linkvalue-Interne/MajoraOrientDBBundle/blob/9fc9a409604472b558319c274442f75bbd055435/src/Majora/Component/Graph/Engine/OrientDbEngine.php#L44-L56
Linkvalue-Interne/MajoraOrientDBBundle
src/Majora/Component/Graph/Engine/OrientDbEngine.php
OrientDbEngine.getConfiguration
public function getConfiguration($connectionName = 'default') { if (!$this->configurations->containsKey($connectionName)) { throw new \InvalidArgumentException(sprintf('Any registered configuration under given key.')); } return $this->configurations->get($connectionName); }
php
public function getConfiguration($connectionName = 'default') { if (!$this->configurations->containsKey($connectionName)) { throw new \InvalidArgumentException(sprintf('Any registered configuration under given key.')); } return $this->configurations->get($connectionName); }
[ "public", "function", "getConfiguration", "(", "$", "connectionName", "=", "'default'", ")", "{", "if", "(", "!", "$", "this", "->", "configurations", "->", "containsKey", "(", "$", "connectionName", ")", ")", "{", "throw", "new", "\\", "InvalidArgumentExcepti...
Return registered configuration under given connectionName @param string $connectionName @return OrientDbMetadata
[ "Return", "registered", "configuration", "under", "given", "connectionName" ]
train
https://github.com/Linkvalue-Interne/MajoraOrientDBBundle/blob/9fc9a409604472b558319c274442f75bbd055435/src/Majora/Component/Graph/Engine/OrientDbEngine.php#L76-L83
Linkvalue-Interne/MajoraOrientDBBundle
src/Majora/Component/Graph/Engine/OrientDbEngine.php
OrientDbEngine.getConnection
public function getConnection($connectionName = 'default') { if ($this->connections->containsKey($connectionName)) { return $this->connections->get($connectionName); } $configuration = $this->getConfiguration($connectionName); $this->connections->set($connectionName, ...
php
public function getConnection($connectionName = 'default') { if ($this->connections->containsKey($connectionName)) { return $this->connections->get($connectionName); } $configuration = $this->getConfiguration($connectionName); $this->connections->set($connectionName, ...
[ "public", "function", "getConnection", "(", "$", "connectionName", "=", "'default'", ")", "{", "if", "(", "$", "this", "->", "connections", "->", "containsKey", "(", "$", "connectionName", ")", ")", "{", "return", "$", "this", "->", "connections", "->", "g...
Return registered connection under given connectionName @param string $connectionName @return \OrientDB
[ "Return", "registered", "connection", "under", "given", "connectionName" ]
train
https://github.com/Linkvalue-Interne/MajoraOrientDBBundle/blob/9fc9a409604472b558319c274442f75bbd055435/src/Majora/Component/Graph/Engine/OrientDbEngine.php#L92-L113
Linkvalue-Interne/MajoraOrientDBBundle
src/Majora/Component/Graph/Engine/OrientDbEngine.php
OrientDbEngine.createDatabase
public function createDatabase($connectionName) { $configuration = $this->getConfiguration($connectionName); $database = $this->getConnection($connectionName); $database->DBCreate( $configuration->getDatabase(), $configuration->getDataType(), $configurati...
php
public function createDatabase($connectionName) { $configuration = $this->getConfiguration($connectionName); $database = $this->getConnection($connectionName); $database->DBCreate( $configuration->getDatabase(), $configuration->getDataType(), $configurati...
[ "public", "function", "createDatabase", "(", "$", "connectionName", ")", "{", "$", "configuration", "=", "$", "this", "->", "getConfiguration", "(", "$", "connectionName", ")", ";", "$", "database", "=", "$", "this", "->", "getConnection", "(", "$", "connect...
Tries to create a database for given connection name @param string $name @return \OrientDB
[ "Tries", "to", "create", "a", "database", "for", "given", "connection", "name" ]
train
https://github.com/Linkvalue-Interne/MajoraOrientDBBundle/blob/9fc9a409604472b558319c274442f75bbd055435/src/Majora/Component/Graph/Engine/OrientDbEngine.php#L122-L134
Linkvalue-Interne/MajoraOrientDBBundle
src/Majora/Component/Graph/Engine/OrientDbEngine.php
OrientDbEngine.dropDatabase
public function dropDatabase($connectionName) { $configuration = $this->getConfiguration($connectionName); $database = $this->getConnection($connectionName); $database->DBDelete( $configuration->getDatabase() ); }
php
public function dropDatabase($connectionName) { $configuration = $this->getConfiguration($connectionName); $database = $this->getConnection($connectionName); $database->DBDelete( $configuration->getDatabase() ); }
[ "public", "function", "dropDatabase", "(", "$", "connectionName", ")", "{", "$", "configuration", "=", "$", "this", "->", "getConfiguration", "(", "$", "connectionName", ")", ";", "$", "database", "=", "$", "this", "->", "getConnection", "(", "$", "connectio...
Tries to drop a database for given connection name @param string $name @return \OrientDB
[ "Tries", "to", "drop", "a", "database", "for", "given", "connection", "name" ]
train
https://github.com/Linkvalue-Interne/MajoraOrientDBBundle/blob/9fc9a409604472b558319c274442f75bbd055435/src/Majora/Component/Graph/Engine/OrientDbEngine.php#L143-L151
Linkvalue-Interne/MajoraOrientDBBundle
src/Majora/Component/Graph/Engine/OrientDbEngine.php
OrientDbEngine.getDatabase
public function getDatabase($connectionName = 'default') { if ($this->databases->containsKey($connectionName)) { return $this->databases->get($connectionName); } $configuration = $this->getConfiguration($connectionName); $database = $this->getConnection($connectionName);...
php
public function getDatabase($connectionName = 'default') { if ($this->databases->containsKey($connectionName)) { return $this->databases->get($connectionName); } $configuration = $this->getConfiguration($connectionName); $database = $this->getConnection($connectionName);...
[ "public", "function", "getDatabase", "(", "$", "connectionName", "=", "'default'", ")", "{", "if", "(", "$", "this", "->", "databases", "->", "containsKey", "(", "$", "connectionName", ")", ")", "{", "return", "$", "this", "->", "databases", "->", "get", ...
Return registered database under given name @param string $connectionName @return \OrientDB
[ "Return", "registered", "database", "under", "given", "name" ]
train
https://github.com/Linkvalue-Interne/MajoraOrientDBBundle/blob/9fc9a409604472b558319c274442f75bbd055435/src/Majora/Component/Graph/Engine/OrientDbEngine.php#L160-L178
Linkvalue-Interne/MajoraOrientDBBundle
src/Majora/Component/Graph/Engine/OrientDbEngine.php
OrientDbEngine.synchronize
public function synchronize($connectionName) { $configuration = $this->getConfiguration($connectionName); $database = $this->getDatabase($connectionName); foreach ($configuration->getVertexes() as $vertex) { try { $database->query(sprintf('CREATE CLASS %s EXTENDS...
php
public function synchronize($connectionName) { $configuration = $this->getConfiguration($connectionName); $database = $this->getDatabase($connectionName); foreach ($configuration->getVertexes() as $vertex) { try { $database->query(sprintf('CREATE CLASS %s EXTENDS...
[ "public", "function", "synchronize", "(", "$", "connectionName", ")", "{", "$", "configuration", "=", "$", "this", "->", "getConfiguration", "(", "$", "connectionName", ")", ";", "$", "database", "=", "$", "this", "->", "getDatabase", "(", "$", "connectionNa...
Synchronize vertexes and edges with related OrientDb database @param string $connectionName
[ "Synchronize", "vertexes", "and", "edges", "with", "related", "OrientDb", "database" ]
train
https://github.com/Linkvalue-Interne/MajoraOrientDBBundle/blob/9fc9a409604472b558319c274442f75bbd055435/src/Majora/Component/Graph/Engine/OrientDbEngine.php#L185-L207
1HappyPlace/ansi-terminal
src/ANSI/EscapeSequenceGenerator.php
EscapeSequenceGenerator.generateTextColorSequence
public static function generateTextColorSequence(ColorInterface $textColor, $mode) { $code = $textColor->generateColorCoding($mode); // if a code came back if ($code !== "") { // return the full sequence return self::CSI . $code . self::CSE; // no valid...
php
public static function generateTextColorSequence(ColorInterface $textColor, $mode) { $code = $textColor->generateColorCoding($mode); // if a code came back if ($code !== "") { // return the full sequence return self::CSI . $code . self::CSE; // no valid...
[ "public", "static", "function", "generateTextColorSequence", "(", "ColorInterface", "$", "textColor", ",", "$", "mode", ")", "{", "$", "code", "=", "$", "textColor", "->", "generateColorCoding", "(", "$", "mode", ")", ";", "// if a code came back", "if", "(", ...
Static helper function to generate a text color sequence @param ColorInterface $textColor - the color desired @param Mode $mode - the terminal mode @return string - the full escape sequence for the text color, or an empty string if color or mode is not valid
[ "Static", "helper", "function", "to", "generate", "a", "text", "color", "sequence", "@param", "ColorInterface", "$textColor", "-", "the", "color", "desired", "@param", "Mode", "$mode", "-", "the", "terminal", "mode" ]
train
https://github.com/1HappyPlace/ansi-terminal/blob/3a550eadb21bb87a6909436c3b961919d2731923/src/ANSI/EscapeSequenceGenerator.php#L136-L152
1HappyPlace/ansi-terminal
src/ANSI/EscapeSequenceGenerator.php
EscapeSequenceGenerator.generateFillColorSequence
public static function generateFillColorSequence(ColorInterface $fillColor, $mode) { $code = $fillColor->generateColorCoding($mode, true); // if a code came back if ($code !== "") { // return the full sequence return self::CSI . $code . self::CSE; ...
php
public static function generateFillColorSequence(ColorInterface $fillColor, $mode) { $code = $fillColor->generateColorCoding($mode, true); // if a code came back if ($code !== "") { // return the full sequence return self::CSI . $code . self::CSE; ...
[ "public", "static", "function", "generateFillColorSequence", "(", "ColorInterface", "$", "fillColor", ",", "$", "mode", ")", "{", "$", "code", "=", "$", "fillColor", "->", "generateColorCoding", "(", "$", "mode", ",", "true", ")", ";", "// if a code came back", ...
Static helper function to generate a fill color sequence @param ColorInterface $fillColor - the color desired @param Mode $mode - the terminal mode @return string - the full escape sequence for the text color
[ "Static", "helper", "function", "to", "generate", "a", "fill", "color", "sequence", "@param", "ColorInterface", "$fillColor", "-", "the", "color", "desired", "@param", "Mode", "$mode", "-", "the", "terminal", "mode" ]
train
https://github.com/1HappyPlace/ansi-terminal/blob/3a550eadb21bb87a6909436c3b961919d2731923/src/ANSI/EscapeSequenceGenerator.php#L161-L177
1HappyPlace/ansi-terminal
src/ANSI/EscapeSequenceGenerator.php
EscapeSequenceGenerator.generateSequence
public function generateSequence(TerminalState $state, $reset) { // this will return null if there are no active styles $sequence = ""; // build an array of the currently active style codes $styles = []; if ($state->isBold()) {$styles[] = self::BOLD;} if ($stat...
php
public function generateSequence(TerminalState $state, $reset) { // this will return null if there are no active styles $sequence = ""; // build an array of the currently active style codes $styles = []; if ($state->isBold()) {$styles[] = self::BOLD;} if ($stat...
[ "public", "function", "generateSequence", "(", "TerminalState", "$", "state", ",", "$", "reset", ")", "{", "// this will return null if there are no active styles", "$", "sequence", "=", "\"\"", ";", "// build an array of the currently active style codes", "$", "styles", "=...
Generate the escape sequencing for a particular state @param TerminalState $state - the state to achieve @param boolean $reset - whether the zero reset code needs to start this sequence @return string
[ "Generate", "the", "escape", "sequencing", "for", "a", "particular", "state" ]
train
https://github.com/1HappyPlace/ansi-terminal/blob/3a550eadb21bb87a6909436c3b961919d2731923/src/ANSI/EscapeSequenceGenerator.php#L197-L253
1HappyPlace/ansi-terminal
src/ANSI/EscapeSequenceGenerator.php
EscapeSequenceGenerator.generate
public function generate(TerminalStateInterface $currentState, TerminalState $desiredState) { // get a state object with anything that is changing $changes = $currentState->findChanges($desiredState); // if an object is returned, then just positive changes are occurring if ($changes) {...
php
public function generate(TerminalStateInterface $currentState, TerminalState $desiredState) { // get a state object with anything that is changing $changes = $currentState->findChanges($desiredState); // if an object is returned, then just positive changes are occurring if ($changes) {...
[ "public", "function", "generate", "(", "TerminalStateInterface", "$", "currentState", ",", "TerminalState", "$", "desiredState", ")", "{", "// get a state object with anything that is changing", "$", "changes", "=", "$", "currentState", "->", "findChanges", "(", "$", "d...
Generate an escape sequence based on the current state and the new desired state @param TerminalStateInterface $currentState @param TerminalState $desiredState @return string
[ "Generate", "an", "escape", "sequence", "based", "on", "the", "current", "state", "and", "the", "new", "desired", "state" ]
train
https://github.com/1HappyPlace/ansi-terminal/blob/3a550eadb21bb87a6909436c3b961919d2731923/src/ANSI/EscapeSequenceGenerator.php#L263-L295
geniv/nette-general-form
src/Events/ClearFormEvent.php
ClearFormEvent.update
public function update(IEventContainer $eventContainer, array $values) { $component = $eventContainer->getComponent(); if ($component->presenter->isAjax()) { // ajax reset form $component->redrawControl($this->snippetName); $eventContainer->getForm()->reset(); ...
php
public function update(IEventContainer $eventContainer, array $values) { $component = $eventContainer->getComponent(); if ($component->presenter->isAjax()) { // ajax reset form $component->redrawControl($this->snippetName); $eventContainer->getForm()->reset(); ...
[ "public", "function", "update", "(", "IEventContainer", "$", "eventContainer", ",", "array", "$", "values", ")", "{", "$", "component", "=", "$", "eventContainer", "->", "getComponent", "(", ")", ";", "if", "(", "$", "component", "->", "presenter", "->", "...
Update. @param IEventContainer $eventContainer @param array $values
[ "Update", "." ]
train
https://github.com/geniv/nette-general-form/blob/0d0548b63cf7db58c17ee12d6933f2dd995a64e6/src/Events/ClearFormEvent.php#L42-L53
netbull/CoreBundle
ORM/Subscribers/Sluggable/SluggableSubscriber.php
SluggableSubscriber.loadClassMetadata
public function loadClassMetadata(LoadClassMetadataEventArgs $eventArgs) { $classMetadata = $eventArgs->getClassMetadata(); if (null === $classMetadata->reflClass) { return; } if ($this->isSluggable($classMetadata)) { if (!$classMetadata->hasField('slug')) {...
php
public function loadClassMetadata(LoadClassMetadataEventArgs $eventArgs) { $classMetadata = $eventArgs->getClassMetadata(); if (null === $classMetadata->reflClass) { return; } if ($this->isSluggable($classMetadata)) { if (!$classMetadata->hasField('slug')) {...
[ "public", "function", "loadClassMetadata", "(", "LoadClassMetadataEventArgs", "$", "eventArgs", ")", "{", "$", "classMetadata", "=", "$", "eventArgs", "->", "getClassMetadata", "(", ")", ";", "if", "(", "null", "===", "$", "classMetadata", "->", "reflClass", ")"...
{@inheritdoc}
[ "{" ]
train
https://github.com/netbull/CoreBundle/blob/0bacc1d9e4733b6da613027400c48421e5a14645/ORM/Subscribers/Sluggable/SluggableSubscriber.php#L37-L54